From 9e0f0d9441a6dbd054314c991e7e6707876f7fd4 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Fri, 13 Nov 2026 06:16:03 -0500 Subject: [PATCH 01/16] chore: pws codec Signed-off-by: Guillaume Belanger --- cmd/pergen/emit.go | 11 + cmd/pergen/emit_struct.go | 33 +- cmd/pergen/emit_struct_test.go | 40 + cmd/pergen/tag.go | 6 +- cmd/pergen/tag_test.go | 13 + internal/decoder/ngap/golden_test.go | 8 + internal/decoder/ngap/ngap.go | 18 + internal/decoder/ngap/overload.go | 80 + internal/decoder/ngap/pws.go | 375 ++ internal/decoder/ngap/pws_overload_test.go | 142 + internal/decoder/ngap/reroute_nas.go | 78 + .../testdata/golden/overload_start_full.json | 86 + .../ngap/testdata/golden/overload_stop.json | 17 + .../golden/pws_cancel_request_full.json | 95 + .../golden/pws_cancel_response_full.json | 139 + .../golden/pws_failure_indication.json | 66 + .../golden/pws_restart_indication_full.json | 106 + .../golden/reroute_nas_request_full.json | 139 + .../write_replace_warning_request_full.json | 208 + .../write_replace_warning_response_full.json | 144 + internal/decoder/s1ap/golden_test.go | 6 + internal/decoder/s1ap/overload.go | 63 + internal/decoder/s1ap/pws.go | 308 ++ internal/decoder/s1ap/pws_test.go | 143 + internal/decoder/s1ap/reroute_nas.go | 46 + internal/decoder/s1ap/s1ap.go | 18 + .../testdata/golden/kill_request_full.json | 84 + .../testdata/golden/kill_response_full.json | 139 + .../testdata/golden/overload_start_full.json | 76 + .../testdata/golden/overload_stop_full.json | 44 + .../golden/pws_failure_indication_full.json | 79 + .../golden/pws_restart_indication_full.json | 112 + .../golden/reroute_nas_request_full.json | 122 + .../write_replace_warning_request_full.json | 225 + .../write_replace_warning_response_full.json | 142 + internal/tester/enb/broadcast_plmn_test.go | 60 + .../tester/enb/build_initial_ue_message.go | 34 +- internal/tester/enb/build_ng_setup_request.go | 14 +- .../tester/enb/build_uplink_nas_transport.go | 4 +- internal/tester/enb/helpers.go | 13 +- internal/tester/enb/server.go | 8 + internal/tester/gnb/broadcast_plmn.go | 117 + internal/tester/gnb/broadcast_plmn_test.go | 191 + internal/tester/gnb/build_handover_notify.go | 12 +- .../tester/gnb/build_initial_ue_message.go | 4 +- internal/tester/gnb/build_ng_setup_request.go | 19 +- .../tester/gnb/build_path_switch_request.go | 4 +- ...d_pdu_session_resource_release_response.go | 4 +- .../gnb/build_ran_configuration_update.go | 19 +- .../gnb/build_ue_context_release_complete.go | 4 +- .../tester/gnb/build_uplink_nas_transport.go | 4 +- ...le_pdu_session_resource_release_command.go | 4 + .../gnb/handle_ue_context_release_command.go | 4 + internal/tester/gnb/helpers.go | 9 +- internal/tester/gnb/send.go | 8 + internal/tester/gnb/server.go | 23 +- internal/tester/s1enb/attach.go | 4 +- internal/tester/s1enb/broadcast_plmn.go | 75 + internal/tester/s1enb/broadcast_plmn_test.go | 122 + internal/tester/s1enb/handover.go | 2 +- internal/tester/s1enb/idle_mobility.go | 2 +- internal/tester/s1enb/lifecycle.go | 6 +- internal/tester/s1enb/reject.go | 4 +- internal/tester/s1enb/s1ap.go | 23 +- internal/tester/s1enb/server.go | 12 + internal/tester/s1enb/sms.go | 2 +- internal/tester/s1enb/tau_reject.go | 2 +- internal/tester/s1enb/ue.go | 1 + ngap/enum_names.go | 21 + ngap/enum_names_test.go | 7 + ngap/ie_ids.go | 2 + ngap/ie_names.go | 2 + ngap/ie_pws.go | 811 +++ ngap/ng_reset.go | 8 +- ngap/overload.go | 246 + ngap/parsers.go | 10 + ngap/per_gen.go | 4837 +++++++++++------ ngap/per_leaf.go | 37 + ngap/pws.go | 608 +++ ngap/pws_overload_test.go | 412 ++ ngap/raw_pdu.go | 122 + ngap/raw_pdu_registry_test.go | 579 ++ ngap/raw_pdu_test.go | 732 +++ ngap/raw_pdu_ue_ids.go | 54 + ngap/reroute_nas.go | 243 + ngap/reset_extensions_test.go | 206 + ngap/testdata/captures/open5gs.txt | 117 + .../testdata/fuzz/FuzzRawPDU/a9b1313141f783c8 | 2 + per/extension.go | 101 + per/extension_test.go | 127 + per/protocolie/protocolie.go | 375 ++ per/protocolie/protocolie_test.go | 433 ++ per/reader.go | 18 + s1ap/ie_ids.go | 26 + s1ap/ie_names.go | 26 + s1ap/ie_pws.go | 454 ++ s1ap/overload.go | 191 + s1ap/parsers.go | 10 + s1ap/per_gen.go | 882 ++- s1ap/per_leaf.go | 37 + s1ap/pws.go | 563 ++ s1ap/pws_overload_test.go | 396 ++ s1ap/raw_pdu.go | 122 + s1ap/raw_pdu_registry_test.go | 610 +++ s1ap/raw_pdu_test.go | 732 +++ s1ap/raw_pdu_ue_ids.go | 44 + s1ap/reroute_nas.go | 141 + s1ap/reset.go | 8 +- s1ap/reset_extensions_test.go | 214 + s1ap/testdata/captures/open5gs.txt | 99 + .../testdata/fuzz/FuzzRawPDU/13ffa649c7e29f77 | 2 + 111 files changed, 17173 insertions(+), 1719 deletions(-) create mode 100644 internal/decoder/ngap/overload.go create mode 100644 internal/decoder/ngap/pws.go create mode 100644 internal/decoder/ngap/pws_overload_test.go create mode 100644 internal/decoder/ngap/reroute_nas.go create mode 100644 internal/decoder/ngap/testdata/golden/overload_start_full.json create mode 100644 internal/decoder/ngap/testdata/golden/overload_stop.json create mode 100644 internal/decoder/ngap/testdata/golden/pws_cancel_request_full.json create mode 100644 internal/decoder/ngap/testdata/golden/pws_cancel_response_full.json create mode 100644 internal/decoder/ngap/testdata/golden/pws_failure_indication.json create mode 100644 internal/decoder/ngap/testdata/golden/pws_restart_indication_full.json create mode 100644 internal/decoder/ngap/testdata/golden/reroute_nas_request_full.json create mode 100644 internal/decoder/ngap/testdata/golden/write_replace_warning_request_full.json create mode 100644 internal/decoder/ngap/testdata/golden/write_replace_warning_response_full.json create mode 100644 internal/decoder/s1ap/overload.go create mode 100644 internal/decoder/s1ap/pws.go create mode 100644 internal/decoder/s1ap/pws_test.go create mode 100644 internal/decoder/s1ap/reroute_nas.go create mode 100644 internal/decoder/s1ap/testdata/golden/kill_request_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/kill_response_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/overload_start_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/overload_stop_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/pws_failure_indication_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/pws_restart_indication_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/reroute_nas_request_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/write_replace_warning_request_full.json create mode 100644 internal/decoder/s1ap/testdata/golden/write_replace_warning_response_full.json create mode 100644 internal/tester/enb/broadcast_plmn_test.go create mode 100644 internal/tester/gnb/broadcast_plmn.go create mode 100644 internal/tester/gnb/broadcast_plmn_test.go create mode 100644 internal/tester/s1enb/broadcast_plmn.go create mode 100644 internal/tester/s1enb/broadcast_plmn_test.go create mode 100644 ngap/ie_pws.go create mode 100644 ngap/overload.go create mode 100644 ngap/pws.go create mode 100644 ngap/pws_overload_test.go create mode 100644 ngap/raw_pdu.go create mode 100644 ngap/raw_pdu_registry_test.go create mode 100644 ngap/raw_pdu_test.go create mode 100644 ngap/raw_pdu_ue_ids.go create mode 100644 ngap/reroute_nas.go create mode 100644 ngap/reset_extensions_test.go create mode 100644 ngap/testdata/captures/open5gs.txt create mode 100644 ngap/testdata/fuzz/FuzzRawPDU/a9b1313141f783c8 create mode 100644 per/extension.go create mode 100644 per/extension_test.go create mode 100644 per/protocolie/protocolie.go create mode 100644 per/protocolie/protocolie_test.go create mode 100644 s1ap/ie_pws.go create mode 100644 s1ap/overload.go create mode 100644 s1ap/pws.go create mode 100644 s1ap/pws_overload_test.go create mode 100644 s1ap/raw_pdu.go create mode 100644 s1ap/raw_pdu_registry_test.go create mode 100644 s1ap/raw_pdu_test.go create mode 100644 s1ap/raw_pdu_ue_ids.go create mode 100644 s1ap/reroute_nas.go create mode 100644 s1ap/reset_extensions_test.go create mode 100644 s1ap/testdata/captures/open5gs.txt create mode 100644 s1ap/testdata/fuzz/FuzzRawPDU/13ffa649c7e29f77 diff --git a/cmd/pergen/emit.go b/cmd/pergen/emit.go index 4aaf390c7b..88d541f5c9 100644 --- a/cmd/pergen/emit.go +++ b/cmd/pergen/emit.go @@ -18,6 +18,7 @@ type structType struct { fields []fieldInfo // extSeq marks the type extensible ("...") with no extension additions. extSeq bool + extRaw string } // parseStruct classifies each field for emission. Fields tagged `per:"-"` or @@ -43,6 +44,16 @@ func (g *generator) parseStruct(name string, named *types.Named, s *types.Struct continue } + if parsed.ExtRaw { + if st.extRaw != "" { + return nil, fmt.Errorf("%s: more than one extraw field", name) + } + + st.extRaw = s.Field(i).Name() + + continue + } + fi, err := g.classifyField(s.Field(i), rawTag) if err != nil { return nil, err diff --git a/cmd/pergen/emit_struct.go b/cmd/pergen/emit_struct.go index a8e5d67c0e..c903fe1b8e 100644 --- a/cmd/pergen/emit_struct.go +++ b/cmd/pergen/emit_struct.go @@ -31,7 +31,11 @@ func (g *generator) emitStruct(name string, s *structType) error { } } - extensible := len(extFields) > 0 || s.extSeq + extensible := len(extFields) > 0 || s.extSeq || s.extRaw != "" + + if s.extRaw != "" && len(extFields) > 0 { + return fmt.Errorf("%s: extraw cannot be combined with modeled extension additions", name) + } // Root fields carrying a bit in the OPTIONAL/DEFAULT preamble bitmap. var optionalIdx []int @@ -43,8 +47,8 @@ func (g *generator) emitStruct(name string, s *structType) error { } g.emitHeader(name) - g.emitMarshalExt(recv, name, rootFields, extFields, optionalIdx, extensible) - g.emitUnmarshalExt(recv, name, rootFields, extFields, optionalIdx, extensible) + g.emitMarshalExt(recv, name, rootFields, extFields, optionalIdx, extensible, s.extRaw) + g.emitUnmarshalExt(recv, name, rootFields, extFields, optionalIdx, extensible, s.extRaw) return nil } @@ -59,13 +63,15 @@ func (g *generator) emitHeader(_ string) { } } -func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields []fieldInfo, optionalIdx []int, extensible bool) { +func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields []fieldInfo, optionalIdx []int, extensible bool, extRaw string) { r := &g.buf fmt.Fprintf(r, "func (%s *%s) MarshalPER(w *per.Writer, enc per.Encoding) error {\n", recv, typeName) // Extension bit (X.691 §19.1): set when any extension addition is present. if extensible { - if len(extFields) > 0 { + if extRaw != "" { + fmt.Fprintf(r, "\tw.WriteBit(%s.%s.Present())\n", recv, extRaw) + } else if len(extFields) > 0 { fmt.Fprintf(r, "\tw.WriteBit(%s)\n", extPresentExpr(recv, extFields)) } else { fmt.Fprintf(r, "\tw.WriteBit(false)\n") @@ -111,6 +117,12 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields } } + if extRaw != "" { + fmt.Fprintf(r, "\tif %s.%s.Present() {\n", recv, extRaw) + fmt.Fprintf(r, "\t\tif err := %s.%s.MarshalPER(w, enc); err != nil {\n\t\t\treturn err\n\t\t}\n", recv, extRaw) + fmt.Fprintf(r, "\t}\n") + } + // Extension additions (X.691 §19.6-19.9). if extensible && len(extFields) > 0 { fmt.Fprintf(r, "\tif %s {\n", extPresentExpr(recv, extFields)) @@ -292,7 +304,7 @@ func asNamed(t types.Type) *types.Named { return n } -func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extFields []fieldInfo, optionalIdx []int, extensible bool) { +func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extFields []fieldInfo, optionalIdx []int, extensible bool, extRaw string) { r := &g.buf fmt.Fprintf(r, "func (%s *%s) UnmarshalPER(r *per.Reader, enc per.Encoding) error {\n", recv, typeName) @@ -340,6 +352,15 @@ func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extField } } + if extRaw != "" { + fmt.Fprintf(r, "\tif extBit {\n") + fmt.Fprintf(r, "\t\tif err := %s.%s.UnmarshalPER(r, enc); err != nil {\n\t\t\treturn err\n\t\t}\n", recv, extRaw) + fmt.Fprintf(r, "\t}\n") + fmt.Fprintf(r, "\treturn nil\n}\n\n") + + return + } + // Extension additions (X.691 §19.6-19.9). if extensible { fmt.Fprintf(r, "\tif extBit {\n") diff --git a/cmd/pergen/emit_struct_test.go b/cmd/pergen/emit_struct_test.go index f42e4bf0e4..3c6459efa2 100644 --- a/cmd/pergen/emit_struct_test.go +++ b/cmd/pergen/emit_struct_test.go @@ -102,3 +102,43 @@ func TestEmitBoundedEnumerated(t *testing.T) { t.Errorf("bounded ENUMERATED must not use the root-only helpers:\n%s", out) } } + +func TestEmitExtRaw(t *testing.T) { + t.Parallel() + + var g generator + + g.emitMarshalExt("x", "T", nil, nil, nil, true, "ext") + g.emitUnmarshalExt("x", "T", nil, nil, nil, true, "ext") + + out := g.buf.String() + + for _, want := range []string{ + "w.WriteBit(x.ext.Present())", + "if err := x.ext.MarshalPER(w, enc); err != nil", + "if err := x.ext.UnmarshalPER(r, enc); err != nil", + } { + if !strings.Contains(out, want) { + t.Errorf("generated code lacks %q:\n%s", want, out) + } + } + + if strings.Contains(out, "SkipOpenType") { + t.Errorf("extraw must keep extension additions, not skip them:\n%s", out) + } + + if _, err := parser.ParseFile(token.NewFileSet(), "", "package p\n"+out, 0); err != nil { + t.Fatalf("generated code does not parse: %v\n%s", err, out) + } +} + +func TestExtRawRejectsModeledAdditions(t *testing.T) { + t.Parallel() + + g := generator{} + st := &structType{name: "T", extRaw: "ext", fields: []fieldInfo{{name: "A", tag: FieldTag{Ext: true}}}} + + if err := g.emitStruct("T", st); err == nil { + t.Fatal("extraw combined with an extension addition accepted") + } +} diff --git a/cmd/pergen/tag.go b/cmd/pergen/tag.go index 22ab45cf21..07573d0c98 100644 --- a/cmd/pergen/tag.go +++ b/cmd/pergen/tag.go @@ -48,6 +48,7 @@ type FieldTag struct { // ExtSeq marks the parent type extensible ("...") with no extension // additions; it sits on a placeholder field that carries no encoding. ExtSeq bool + ExtRaw bool EnumExtValues int64 HasEnumExtValues bool @@ -144,7 +145,7 @@ func knownTypeName(name string) bool { return asn1TypeNames[name] } // looksLikeOption distinguishes an option token from a bare ASN.1 type name. func looksLikeOption(token string) bool { - if token == "optional" || token == "ext" || token == "extseq" || token == "skip" { + if token == "optional" || token == "ext" || token == "extseq" || token == "extraw" || token == "skip" { return true } @@ -176,6 +177,9 @@ func parseOption(t *FieldTag, opt string) error { case "extseq": t.ExtSeq = true return nil + case "extraw": + t.ExtRaw = true + return nil } key, value, ok := splitKV(opt) diff --git a/cmd/pergen/tag_test.go b/cmd/pergen/tag_test.go index ac7b35e563..e72b707621 100644 --- a/cmd/pergen/tag_test.go +++ b/cmd/pergen/tag_test.go @@ -343,3 +343,16 @@ func TestParseTagErrors(t *testing.T) { } } } + +func TestParseTagExtRaw(t *testing.T) { + t.Parallel() + + tag, err := ParseTag(",extraw") + if err != nil { + t.Fatal(err) + } + + if !tag.ExtRaw || tag.Name != "" || tag.ExtSeq { + t.Fatalf("ParseTag(\",extraw\") = %+v", tag) + } +} diff --git a/internal/decoder/ngap/golden_test.go b/internal/decoder/ngap/golden_test.go index 359fea8e16..7ac608e3b3 100644 --- a/internal/decoder/ngap/golden_test.go +++ b/internal/decoder/ngap/golden_test.go @@ -585,6 +585,10 @@ func goldenCorpus(t *testing.T) map[string][]byte { RoutingID: lib.RoutingID{0x03}, NRPPaPDU: nrppaPDU, }) + for name, b := range pwsOverloadCorpus(t) { + corpus[name] = b + } + return corpus } @@ -658,6 +662,9 @@ func TestGoldenCoversEveryRenderedProcedure(t *testing.T) { lib.ProcUplinkRANStatusTransfer, lib.ProcDownlinkRANStatusTransfer, lib.ProcHandoverPreparation, lib.ProcHandoverResourceAllocation, lib.ProcHandoverNotification, lib.ProcHandoverCancel, + lib.ProcOverloadStart, lib.ProcOverloadStop, lib.ProcWriteReplaceWarning, + lib.ProcPWSCancel, lib.ProcPWSRestartIndication, lib.ProcPWSFailureIndication, + lib.ProcRerouteNASRequest, }, "SuccessfulOutcome": { lib.ProcNGSetup, lib.ProcInitialContextSetup, lib.ProcPDUSessionResourceSetup, @@ -666,6 +673,7 @@ func TestGoldenCoversEveryRenderedProcedure(t *testing.T) { lib.ProcPDUSessionResourceModify, lib.ProcPDUSessionResourceModifyIndication, lib.ProcRANConfigurationUpdate, lib.ProcHandoverPreparation, lib.ProcHandoverResourceAllocation, lib.ProcHandoverCancel, + lib.ProcWriteReplaceWarning, lib.ProcPWSCancel, }, "UnsuccessfulOutcome": { lib.ProcNGSetup, lib.ProcInitialContextSetup, lib.ProcUEContextModification, lib.ProcPathSwitchRequest, lib.ProcRANConfigurationUpdate, diff --git a/internal/decoder/ngap/ngap.go b/internal/decoder/ngap/ngap.go index b63b5a16fb..368559fbc2 100644 --- a/internal/decoder/ngap/ngap.go +++ b/internal/decoder/ngap/ngap.go @@ -198,6 +198,20 @@ func buildInitiatingMessage(m *ngap.InitiatingMessage) NGAPMessageValue { return buildTraceStart(m.Value) case ngap.ProcTraceFailureIndication: return buildTraceFailureIndication(m.Value) + case ngap.ProcOverloadStart: + return buildOverloadStart(m.Value) + case ngap.ProcOverloadStop: + return buildOverloadStop(m.Value) + case ngap.ProcWriteReplaceWarning: + return buildWriteReplaceWarningRequest(m.Value) + case ngap.ProcPWSCancel: + return buildPWSCancelRequest(m.Value) + case ngap.ProcPWSRestartIndication: + return buildPWSRestartIndication(m.Value) + case ngap.ProcPWSFailureIndication: + return buildPWSFailureIndication(m.Value) + case ngap.ProcRerouteNASRequest: + return buildRerouteNASRequest(m.Value) default: return unsupportedProcedure(m.ProcedureCode) } @@ -235,6 +249,10 @@ func buildSuccessfulOutcome(m *ngap.SuccessfulOutcome) NGAPMessageValue { return buildHandoverRequestAcknowledge(m.Value) case ngap.ProcHandoverCancel: return buildHandoverCancelAcknowledge(m.Value) + case ngap.ProcWriteReplaceWarning: + return buildWriteReplaceWarningResponse(m.Value) + case ngap.ProcPWSCancel: + return buildPWSCancelResponse(m.Value) default: return unsupportedProcedure(m.ProcedureCode) } diff --git a/internal/decoder/ngap/overload.go b/internal/decoder/ngap/overload.go new file mode 100644 index 0000000000..6ecd52ff86 --- /dev/null +++ b/internal/decoder/ngap/overload.go @@ -0,0 +1,80 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "fmt" + + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/ngap" +) + +type OverloadStartNSSAIItem struct { + SliceOverloadList []SNSSAI `json:"slice_overload_list"` + SliceOverloadResponse *utils.EnumField `json:"slice_overload_response,omitempty"` + SliceTrafficLoadReductionIndication *int64 `json:"slice_traffic_load_reduction_indication,omitempty"` +} + +func overloadResponse(o ngap.OverloadResponse) utils.EnumField { + return utils.NamedEnum(uint8(o.OverloadAction), o.OverloadAction.Name()) +} + +func overloadStartNSSAIList(list ngap.OverloadStartNSSAIList) []OverloadStartNSSAIItem { + out := make([]OverloadStartNSSAIItem, 0, len(list)) + + for _, item := range list { + slices := make([]SNSSAI, 0, len(item.SliceOverloadList)) + for _, s := range item.SliceOverloadList { + slices = append(slices, buildSNSSAIValue(s.SNSSAI)) + } + + o := OverloadStartNSSAIItem{SliceOverloadList: slices} + + if item.SliceOverloadResponse != nil { + r := overloadResponse(*item.SliceOverloadResponse) + o.SliceOverloadResponse = &r + } + + if item.SliceTrafficLoadReductionIndication != nil { + v := int64(*item.SliceTrafficLoadReductionIndication) + o.SliceTrafficLoadReductionIndication = &v + } + + out = append(out, o) + } + + return out +} + +func buildOverloadStart(value []byte) NGAPMessageValue { + m, err := ngap.ParseOverloadStart(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse Overload Start: %v", err)} + } + + var ies []IE + + if m.AMFOverloadResponse != nil { + ies = append(ies, ie(ngap.IDAMFOverloadResponse, ngap.CriticalityReject, overloadResponse(*m.AMFOverloadResponse))) + } + + if m.AMFTrafficLoadReductionIndication != nil { + ies = append(ies, ie(ngap.IDAMFTrafficLoadReductionIndication, ngap.CriticalityIgnore, int64(*m.AMFTrafficLoadReductionIndication))) + } + + if len(m.OverloadStartNSSAIList) > 0 { + ies = append(ies, ie(ngap.IDOverloadStartNSSAIList, ngap.CriticalityIgnore, overloadStartNSSAIList(m.OverloadStartNSSAIList))) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} + +func buildOverloadStop(value []byte) NGAPMessageValue { + m, err := ngap.ParseOverloadStop(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse Overload Stop: %v", err)} + } + + return NGAPMessageValue{IEs: unmodeledIEs(m.UnknownIEs())} +} diff --git a/internal/decoder/ngap/pws.go b/internal/decoder/ngap/pws.go new file mode 100644 index 0000000000..b710f5a601 --- /dev/null +++ b/internal/decoder/ngap/pws.go @@ -0,0 +1,375 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/hex" + "fmt" + + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/ngap" +) + +type CellIDList struct { + EUTRACGIs []EUTRACGI `json:"eutra_cgi_list,omitempty"` + NRCGIs []NRCGI `json:"nr_cgi_list,omitempty"` +} + +type WarningAreaList struct { + CellIDList + TAIs []TAI `json:"tai_list,omitempty"` + EmergencyAreaIDs []string `json:"emergency_area_id_list,omitempty"` +} + +type BroadcastCell struct { + EUTRACGI *EUTRACGI `json:"eutra_cgi,omitempty"` + NRCGI *NRCGI `json:"nr_cgi,omitempty"` + NumberOfBroadcasts *int64 `json:"number_of_broadcasts,omitempty"` +} + +type BroadcastTAI struct { + TAI TAI `json:"tai"` + Cells []BroadcastCell `json:"cells"` +} + +type BroadcastEmergencyArea struct { + EmergencyAreaID string `json:"emergency_area_id"` + Cells []BroadcastCell `json:"cells"` +} + +type BroadcastAreaList struct { + CellIDEUTRA []BroadcastCell `json:"cell_id_eutra,omitempty"` + TAIEUTRA []BroadcastTAI `json:"tai_eutra,omitempty"` + EmergencyAreaIDEUTRA []BroadcastEmergencyArea `json:"emergency_area_id_eutra,omitempty"` + CellIDNR []BroadcastCell `json:"cell_id_nr,omitempty"` + TAINR []BroadcastTAI `json:"tai_nr,omitempty"` + EmergencyAreaIDNR []BroadcastEmergencyArea `json:"emergency_area_id_nr,omitempty"` +} + +func eutraCGI(c ngap.EUTRACGI) EUTRACGI { + return EUTRACGI{ + PLMNID: plmnIDToDecoder(c.PLMNIdentity), + EUTRACellIdentity: bitsHex(uint64(c.EUTRACellIdentity), ngap.EUTRACellIdentityBits), + } +} + +func nrCGI(c ngap.NRCGI) NRCGI { + return NRCGI{ + PLMNID: plmnIDToDecoder(c.PLMNIdentity), + NRCellIdentity: bitsHex(uint64(c.NRCellIdentity), ngap.NRCellIdentityBits), + } +} + +func cellIDList(eutra []ngap.EUTRACGI, nr []ngap.NRCGI) CellIDList { + var out CellIDList + + for _, c := range eutra { + out.EUTRACGIs = append(out.EUTRACGIs, eutraCGI(c)) + } + + for _, c := range nr { + out.NRCGIs = append(out.NRCGIs, nrCGI(c)) + } + + return out +} + +func taiList(list []ngap.TAI) []TAI { + out := make([]TAI, 0, len(list)) + for _, t := range list { + out = append(out, tai(t)) + } + + return out +} + +func emergencyAreaIDs(list []ngap.EmergencyAreaID) []string { + out := make([]string, 0, len(list)) + for _, e := range list { + out = append(out, hex.EncodeToString(e[:])) + } + + return out +} + +func warningAreaList(l ngap.WarningAreaList) WarningAreaList { + out := WarningAreaList{CellIDList: cellIDList(l.EUTRACGIs, l.NRCGIs)} + + if len(l.TAIs) > 0 { + out.TAIs = taiList(l.TAIs) + } + + if len(l.EmergencyAreaIDs) > 0 { + out.EmergencyAreaIDs = emergencyAreaIDs(l.EmergencyAreaIDs) + } + + return out +} + +func eutraCell(c ngap.EUTRACGI, n *uint16) BroadcastCell { + cgi := eutraCGI(c) + out := BroadcastCell{EUTRACGI: &cgi} + + if n != nil { + v := int64(*n) + out.NumberOfBroadcasts = &v + } + + return out +} + +func nrCell(c ngap.NRCGI, n *uint16) BroadcastCell { + cgi := nrCGI(c) + out := BroadcastCell{NRCGI: &cgi} + + if n != nil { + v := int64(*n) + out.NumberOfBroadcasts = &v + } + + return out +} + +func broadcastCompletedAreaList(l ngap.BroadcastCompletedAreaList) BroadcastAreaList { + var out BroadcastAreaList + + for _, it := range l.CellIDBroadcastEUTRA { + out.CellIDEUTRA = append(out.CellIDEUTRA, eutraCell(it.EUTRACGI, nil)) + } + + for _, it := range l.TAIBroadcastEUTRA { + b := BroadcastTAI{TAI: tai(it.TAI)} + for _, c := range it.CompletedCellsInTAI { + b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, nil)) + } + + out.TAIEUTRA = append(out.TAIEUTRA, b) + } + + for _, it := range l.EmergencyAreaIDBroadcastEUTRA { + b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} + for _, c := range it.CompletedCellsInEAI { + b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, nil)) + } + + out.EmergencyAreaIDEUTRA = append(out.EmergencyAreaIDEUTRA, b) + } + + for _, it := range l.CellIDBroadcastNR { + out.CellIDNR = append(out.CellIDNR, nrCell(it.NRCGI, nil)) + } + + for _, it := range l.TAIBroadcastNR { + b := BroadcastTAI{TAI: tai(it.TAI)} + for _, c := range it.CompletedCellsInTAI { + b.Cells = append(b.Cells, nrCell(c.NRCGI, nil)) + } + + out.TAINR = append(out.TAINR, b) + } + + for _, it := range l.EmergencyAreaIDBroadcastNR { + b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} + for _, c := range it.CompletedCellsInEAI { + b.Cells = append(b.Cells, nrCell(c.NRCGI, nil)) + } + + out.EmergencyAreaIDNR = append(out.EmergencyAreaIDNR, b) + } + + return out +} + +func broadcastCancelledAreaList(l ngap.BroadcastCancelledAreaList) BroadcastAreaList { + var out BroadcastAreaList + + for _, it := range l.CellIDCancelledEUTRA { + out.CellIDEUTRA = append(out.CellIDEUTRA, eutraCell(it.EUTRACGI, &it.NumberOfBroadcasts)) + } + + for _, it := range l.TAICancelledEUTRA { + b := BroadcastTAI{TAI: tai(it.TAI)} + for _, c := range it.CancelledCellsInTAI { + b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, &c.NumberOfBroadcasts)) + } + + out.TAIEUTRA = append(out.TAIEUTRA, b) + } + + for _, it := range l.EmergencyAreaIDCancelledEUTRA { + b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} + for _, c := range it.CancelledCellsInEAI { + b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, &c.NumberOfBroadcasts)) + } + + out.EmergencyAreaIDEUTRA = append(out.EmergencyAreaIDEUTRA, b) + } + + for _, it := range l.CellIDCancelledNR { + out.CellIDNR = append(out.CellIDNR, nrCell(it.NRCGI, &it.NumberOfBroadcasts)) + } + + for _, it := range l.TAICancelledNR { + b := BroadcastTAI{TAI: tai(it.TAI)} + for _, c := range it.CancelledCellsInTAI { + b.Cells = append(b.Cells, nrCell(c.NRCGI, &c.NumberOfBroadcasts)) + } + + out.TAINR = append(out.TAINR, b) + } + + for _, it := range l.EmergencyAreaIDCancelledNR { + b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} + for _, c := range it.CancelledCellsInEAI { + b.Cells = append(b.Cells, nrCell(c.NRCGI, &c.NumberOfBroadcasts)) + } + + out.EmergencyAreaIDNR = append(out.EmergencyAreaIDNR, b) + } + + return out +} + +func warningIdentity(id ngap.MessageIdentifier, sn ngap.SerialNumber) []IE { + return []IE{ + ie(ngap.IDMessageIdentifier, ngap.CriticalityReject, fmt.Sprintf("%04x", uint16(id))), + ie(ngap.IDSerialNumber, ngap.CriticalityReject, fmt.Sprintf("%04x", uint16(sn))), + } +} + +func buildWriteReplaceWarningRequest(value []byte) NGAPMessageValue { + m, err := ngap.ParseWriteReplaceWarningRequest(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse Write-Replace Warning Request: %v", err)} + } + + ies := warningIdentity(m.MessageIdentifier, m.SerialNumber) + + if m.WarningAreaList != nil { + ies = append(ies, ie(ngap.IDWarningAreaList, ngap.CriticalityIgnore, warningAreaList(*m.WarningAreaList))) + } + + ies = append(ies, + ie(ngap.IDRepetitionPeriod, ngap.CriticalityReject, int64(m.RepetitionPeriod)), + ie(ngap.IDNumberOfBroadcastsRequested, ngap.CriticalityReject, int64(m.NumberOfBroadcastsRequested)), + ) + + if m.WarningType != nil { + ies = append(ies, ie(ngap.IDWarningType, ngap.CriticalityIgnore, utils.NewRawOctets(m.WarningType[:]))) + } + + if m.WarningSecurityInfo != nil { + ies = append(ies, ie(ngap.IDWarningSecurityInfo, ngap.CriticalityIgnore, utils.NewRawOctets(m.WarningSecurityInfo[:]))) + } + + if m.DataCodingScheme != nil { + ies = append(ies, ie(ngap.IDDataCodingScheme, ngap.CriticalityIgnore, fmt.Sprintf("%02x", uint8(*m.DataCodingScheme)))) + } + + if len(m.WarningMessageContents) > 0 { + ies = append(ies, ie(ngap.IDWarningMessageContents, ngap.CriticalityIgnore, utils.NewRawOctets(m.WarningMessageContents))) + } + + if m.ConcurrentWarningMessageInd != nil { + ies = append(ies, ie(ngap.IDConcurrentWarningMessageInd, ngap.CriticalityReject, + utils.NamedEnum(uint8(*m.ConcurrentWarningMessageInd), m.ConcurrentWarningMessageInd.Name()))) + } + + if len(m.WarningAreaCoordinates) > 0 { + ies = append(ies, ie(ngap.IDWarningAreaCoordinates, ngap.CriticalityIgnore, utils.NewRawOctets(m.WarningAreaCoordinates))) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} + +func buildWriteReplaceWarningResponse(value []byte) NGAPMessageValue { + m, err := ngap.ParseWriteReplaceWarningResponse(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse Write-Replace Warning Response: %v", err)} + } + + ies := warningIdentity(m.MessageIdentifier, m.SerialNumber) + + if m.BroadcastCompletedAreaList != nil { + ies = append(ies, ie(ngap.IDBroadcastCompletedAreaList, ngap.CriticalityIgnore, broadcastCompletedAreaList(*m.BroadcastCompletedAreaList))) + } + + if m.CriticalityDiagnostics != nil { + ies = append(ies, ie(ngap.IDCriticalityDiagnostics, ngap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} + +func buildPWSCancelRequest(value []byte) NGAPMessageValue { + m, err := ngap.ParsePWSCancelRequest(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse PWS Cancel Request: %v", err)} + } + + ies := warningIdentity(m.MessageIdentifier, m.SerialNumber) + + if m.WarningAreaList != nil { + ies = append(ies, ie(ngap.IDWarningAreaList, ngap.CriticalityIgnore, warningAreaList(*m.WarningAreaList))) + } + + if m.CancelAllWarningMessages != nil { + ies = append(ies, ie(ngap.IDCancelAllWarningMessages, ngap.CriticalityReject, + utils.NamedEnum(uint8(*m.CancelAllWarningMessages), m.CancelAllWarningMessages.Name()))) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} + +func buildPWSCancelResponse(value []byte) NGAPMessageValue { + m, err := ngap.ParsePWSCancelResponse(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse PWS Cancel Response: %v", err)} + } + + ies := warningIdentity(m.MessageIdentifier, m.SerialNumber) + + if m.BroadcastCancelledAreaList != nil { + ies = append(ies, ie(ngap.IDBroadcastCancelledAreaList, ngap.CriticalityIgnore, broadcastCancelledAreaList(*m.BroadcastCancelledAreaList))) + } + + if m.CriticalityDiagnostics != nil { + ies = append(ies, ie(ngap.IDCriticalityDiagnostics, ngap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} + +func buildPWSRestartIndication(value []byte) NGAPMessageValue { + m, err := ngap.ParsePWSRestartIndication(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse PWS Restart Indication: %v", err)} + } + + ies := []IE{ + ie(ngap.IDCellIDListForRestart, ngap.CriticalityReject, cellIDList(m.CellIDListForRestart.EUTRACGIs, m.CellIDListForRestart.NRCGIs)), + ie(ngap.IDGlobalRANNodeID, ngap.CriticalityReject, buildGlobalRANNodeID(m.GlobalRANNodeID)), + ie(ngap.IDTAIListForRestart, ngap.CriticalityReject, taiList(m.TAIListForRestart)), + } + + if len(m.EmergencyAreaIDListForRestart) > 0 { + ies = append(ies, ie(ngap.IDEmergencyAreaIDListForRestart, ngap.CriticalityReject, emergencyAreaIDs(m.EmergencyAreaIDListForRestart))) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} + +func buildPWSFailureIndication(value []byte) NGAPMessageValue { + m, err := ngap.ParsePWSFailureIndication(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse PWS Failure Indication: %v", err)} + } + + ies := []IE{ + ie(ngap.IDPWSFailedCellIDList, ngap.CriticalityReject, cellIDList(m.PWSFailedCellIDList.EUTRACGIs, m.PWSFailedCellIDList.NRCGIs)), + ie(ngap.IDGlobalRANNodeID, ngap.CriticalityReject, buildGlobalRANNodeID(m.GlobalRANNodeID)), + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} diff --git a/internal/decoder/ngap/pws_overload_test.go b/internal/decoder/ngap/pws_overload_test.go new file mode 100644 index 0000000000..bc1b39f61b --- /dev/null +++ b/internal/decoder/ngap/pws_overload_test.go @@ -0,0 +1,142 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "testing" + + "github.com/ellanetworks/core/internal/decoder/utils" + lib "github.com/ellanetworks/core/ngap" +) + +var ( + pwsNRCGI = lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: 0x123456789} + pwsEUTRACGI = lib.EUTRACGI{PLMNIdentity: testPLMN, EUTRACellIdentity: 0x1234567} + pwsGNB = lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 1, Bits: 22} +) + +func pwsCBSData() lib.WarningMessageContents { + page := make([]byte, 82) + copy(page, []byte{0xd4, 0xf2, 0x9c, 0x0e}) + + return append(append(lib.WarningMessageContents{0x01}, page...), 0x04) +} + +func pwsOverloadCorpus(t *testing.T) map[string][]byte { + t.Helper() + + return map[string][]byte{ + "overload_start_full": mustMarshal(t, &lib.OverloadStart{ + AMFOverloadResponse: &lib.OverloadResponse{OverloadAction: lib.OverloadActionRejectRRCCRSignalling}, + AMFTrafficLoadReductionIndication: lib.Ptr(lib.TrafficLoadReductionIndication(50)), + OverloadStartNSSAIList: lib.OverloadStartNSSAIList{{ + SliceOverloadList: []lib.SliceOverloadItem{{SNSSAI: lib.SNSSAI{SST: 1, SD: &lib.SD{0x00, 0x00, 0x01}}}}, + SliceOverloadResponse: &lib.OverloadResponse{OverloadAction: lib.OverloadActionPermitEmergencySessionsAndMTServicesOnly}, + SliceTrafficLoadReductionIndication: lib.Ptr(lib.TrafficLoadReductionIndication(20)), + }}, + }), + "overload_stop": mustMarshal(t, &lib.OverloadStop{}), + "write_replace_warning_request_full": mustMarshal(t, &lib.WriteReplaceWarningRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + WarningAreaList: &lib.WarningAreaList{NRCGIs: []lib.NRCGI{pwsNRCGI}}, + RepetitionPeriod: 10, + NumberOfBroadcastsRequested: 1, + WarningType: &lib.WarningType{0x05, 0x80}, + WarningSecurityInfo: &lib.WarningSecurityInfo{0x01}, + DataCodingScheme: lib.Ptr(lib.DataCodingScheme(0x0f)), + WarningMessageContents: pwsCBSData(), + ConcurrentWarningMessageInd: lib.Ptr(lib.ConcurrentWarningMessageIndTrue), + WarningAreaCoordinates: lib.WarningAreaCoordinates{0xaa, 0xbb}, + }), + "write_replace_warning_response_full": mustMarshal(t, &lib.WriteReplaceWarningResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + BroadcastCompletedAreaList: &lib.BroadcastCompletedAreaList{TAIBroadcastNR: []lib.TAIBroadcastNRItem{{ + TAI: testTAI, + CompletedCellsInTAI: []lib.CompletedCellsInTAINRItem{{NRCGI: pwsNRCGI}}, + }}}, + CriticalityDiagnostics: testDiagnostics(), + }), + "pws_cancel_request_full": mustMarshal(t, &lib.PWSCancelRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + WarningAreaList: &lib.WarningAreaList{TAIs: []lib.TAI{testTAI}}, + CancelAllWarningMessages: lib.Ptr(lib.CancelAllWarningMessagesTrue), + }), + "pws_cancel_response_full": mustMarshal(t, &lib.PWSCancelResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + BroadcastCancelledAreaList: &lib.BroadcastCancelledAreaList{EmergencyAreaIDCancelledEUTRA: []lib.EmergencyAreaIDCancelledEUTRAItem{{ + EmergencyAreaID: lib.EmergencyAreaID{0x01, 0x02, 0x03}, + CancelledCellsInEAI: []lib.CancelledCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI, NumberOfBroadcasts: 3}}, + }}}, + CriticalityDiagnostics: testDiagnostics(), + }), + "pws_restart_indication_full": mustMarshal(t, &lib.PWSRestartIndication{ + CellIDListForRestart: lib.CellIDListForRestart{NRCGIs: []lib.NRCGI{pwsNRCGI}}, + GlobalRANNodeID: pwsGNB, + TAIListForRestart: lib.TAIListForRestart{testTAI}, + EmergencyAreaIDListForRestart: lib.EmergencyAreaIDListForRestart{{0x01, 0x02, 0x03}}, + }), + "pws_failure_indication": mustMarshal(t, &lib.PWSFailureIndication{ + PWSFailedCellIDList: lib.PWSFailedCellIDList{EUTRACGIs: []lib.EUTRACGI{pwsEUTRACGI}}, + GlobalRANNodeID: pwsGNB, + }), + "reroute_nas_request_full": mustMarshal(t, &lib.RerouteNASRequest{ + RANUENGAPID: 5, + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), + NGAPMessage: lib.NGAPMessage{0x00, 0x0f, 0x40, 0x00}, + AMFSetID: 1, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + SourceToTargetAMFInformationReroute: &lib.SourceToTargetAMFInformationReroute{ + RejectedNSSAIinPLMN: &lib.RejectedNSSAIinPLMN{0x01}, + }, + PartiallyAllowedNSSAI: lib.PartiallyAllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 2}}}, + }), + } +} + +func TestDecodeNGAPMessage_PWSAndOverload(t *testing.T) { + for name, raw := range pwsOverloadCorpus(t) { + t.Run(name, func(t *testing.T) { + msg := DecodeNGAPMessage(raw) + + if msg.Value.Error != "" { + t.Fatalf("decode error: %s", msg.Value.Error) + } + + for _, e := range msg.Value.IEs { + if e.ID.Unknown { + t.Errorf("IE %d rendered as unknown", e.ID.Value) + } + + if _, raw := e.Value.(rawIEValue); raw { + t.Errorf("IE %s rendered as unmodeled", e.ID.Label) + } + } + }) + } +} + +func TestDecodeNGAPMessage_RerouteNASRequestSummary(t *testing.T) { + msg := DecodeNGAPMessage(pwsOverloadCorpus(t)["reroute_nas_request_full"]) + + if want := "RerouteNASRequest, RAN-UE=5, AMF-UE=7"; msg.Summary != want { + t.Fatalf("summary %q, want %q", msg.Summary, want) + } +} + +func TestDecodeNGAPMessage_OverloadStartAction(t *testing.T) { + msg := DecodeNGAPMessage(pwsOverloadCorpus(t)["overload_start_full"]) + + if len(msg.Value.IEs) != 3 { + t.Fatalf("got %d IEs, want 3", len(msg.Value.IEs)) + } + + action, ok := msg.Value.IEs[0].Value.(utils.EnumField) + if !ok || action.Label != "reject-rrc-cr-signalling" || action.Unknown { + t.Fatalf("AMF Overload Response = %+v", msg.Value.IEs[0].Value) + } +} diff --git a/internal/decoder/ngap/reroute_nas.go b/internal/decoder/ngap/reroute_nas.go new file mode 100644 index 0000000000..639478ac92 --- /dev/null +++ b/internal/decoder/ngap/reroute_nas.go @@ -0,0 +1,78 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "fmt" + + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/ngap" +) + +type SourceToTargetAMFInformationReroute struct { + ConfiguredNSSAI *utils.RawOctets `json:"configured_nssai,omitempty"` + RejectedNSSAIinPLMN *utils.RawOctets `json:"rejected_nssai_in_plmn,omitempty"` + RejectedNSSAIinTA *utils.RawOctets `json:"rejected_nssai_in_ta,omitempty"` +} + +func sourceToTargetAMFInformationReroute(s ngap.SourceToTargetAMFInformationReroute) SourceToTargetAMFInformationReroute { + var out SourceToTargetAMFInformationReroute + + if s.ConfiguredNSSAI != nil { + out.ConfiguredNSSAI = utils.NewRawOctets(s.ConfiguredNSSAI[:]) + } + + if s.RejectedNSSAIinPLMN != nil { + out.RejectedNSSAIinPLMN = utils.NewRawOctets(s.RejectedNSSAIinPLMN[:]) + } + + if s.RejectedNSSAIinTA != nil { + out.RejectedNSSAIinTA = utils.NewRawOctets(s.RejectedNSSAIinTA[:]) + } + + return out +} + +func buildRerouteNASRequest(value []byte) NGAPMessageValue { + m, err := ngap.ParseRerouteNASRequest(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse Reroute NAS Request: %v", err)} + } + + ies := []IE{ie(ngap.IDRANUENGAPID, ngap.CriticalityReject, int64(m.RANUENGAPID))} + + if m.AMFUENGAPID != nil { + ies = append(ies, ie(ngap.IDAMFUENGAPID, ngap.CriticalityIgnore, int64(*m.AMFUENGAPID))) + } + + ies = append(ies, + ie(ngap.IDNGAPMessage, ngap.CriticalityReject, utils.NewRawOctets(m.NGAPMessage)), + ie(ngap.IDAMFSetID, ngap.CriticalityReject, bitsHex(uint64(m.AMFSetID), 10)), + ) + + if len(m.AllowedNSSAI) > 0 { + slices := make([]SNSSAI, 0, len(m.AllowedNSSAI)) + for _, item := range m.AllowedNSSAI { + slices = append(slices, buildSNSSAIValue(item.SNSSAI)) + } + + ies = append(ies, ie(ngap.IDAllowedNSSAI, ngap.CriticalityReject, slices)) + } + + if m.SourceToTargetAMFInformationReroute != nil { + ies = append(ies, ie(ngap.IDSourceToTargetAMFInformationReroute, ngap.CriticalityIgnore, + sourceToTargetAMFInformationReroute(*m.SourceToTargetAMFInformationReroute))) + } + + if len(m.PartiallyAllowedNSSAI) > 0 { + slices := make([]SNSSAI, 0, len(m.PartiallyAllowedNSSAI)) + for _, item := range m.PartiallyAllowedNSSAI { + slices = append(slices, buildSNSSAIValue(item.SNSSAI)) + } + + ies = append(ies, ie(ngap.IDPartiallyAllowedNSSAI, ngap.CriticalityIgnore, slices)) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} diff --git a/internal/decoder/ngap/testdata/golden/overload_start_full.json b/internal/decoder/ngap/testdata/golden/overload_start_full.json new file mode 100644 index 0000000000..39e89fdc9c --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/overload_start_full.json @@ -0,0 +1,86 @@ +{ + "summary": "OverloadStart", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 22, + "label": "OverloadStart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 2, + "label": "AMFOverloadResponse", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "type": "enum", + "value": 1, + "label": "reject-rrc-cr-signalling", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 9, + "label": "AMFTrafficLoadReductionIndication", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 50 + }, + { + "id": { + "type": "enum", + "value": 49, + "label": "OverloadStartNSSAIList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "slice_overload_list": [ + { + "sst": 1, + "sd": "000001" + } + ], + "slice_overload_response": { + "type": "enum", + "value": 2, + "label": "permit-emergency-sessions-and-mobile-terminated-services-only", + "unknown": false + }, + "slice_traffic_load_reduction_indication": 20 + } + ] + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/overload_stop.json b/internal/decoder/ngap/testdata/golden/overload_stop.json new file mode 100644 index 0000000000..77f53877a8 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/overload_stop.json @@ -0,0 +1,17 @@ +{ + "summary": "OverloadStop", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 23, + "label": "OverloadStop", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": {} +} diff --git a/internal/decoder/ngap/testdata/golden/pws_cancel_request_full.json b/internal/decoder/ngap/testdata/golden/pws_cancel_request_full.json new file mode 100644 index 0000000000..72de80bd98 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/pws_cancel_request_full.json @@ -0,0 +1,95 @@ +{ + "summary": "PWSCancel", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 32, + "label": "PWSCancel", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 35, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "1112" + }, + { + "id": { + "type": "enum", + "value": 95, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "3456" + }, + { + "id": { + "type": "enum", + "value": 122, + "label": "WarningAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "tai_list": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": "000001" + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 14, + "label": "CancelAllWarningMessages", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "true", + "unknown": false + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/pws_cancel_response_full.json b/internal/decoder/ngap/testdata/golden/pws_cancel_response_full.json new file mode 100644 index 0000000000..9dbf71293e --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/pws_cancel_response_full.json @@ -0,0 +1,139 @@ +{ + "summary": "PWSCancel", + "pdu_type": "SuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 32, + "label": "PWSCancel", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 35, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "1112" + }, + { + "id": { + "type": "enum", + "value": 95, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "3456" + }, + { + "id": { + "type": "enum", + "value": 12, + "label": "BroadcastCancelledAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "emergency_area_id_eutra": [ + { + "emergency_area_id": "010203", + "cells": [ + { + "eutra_cgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "eutra_cell_identity": "1234567" + }, + "number_of_broadcasts": 3 + } + ] + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 19, + "label": "CriticalityDiagnostics", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "procedure_code": { + "type": "enum", + "value": 21, + "label": "NGSetup", + "unknown": false + }, + "triggering_message": { + "type": "enum", + "value": 0, + "label": "initiating-message", + "unknown": false + }, + "procedure_criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "ies": [ + { + "ie_id": { + "type": "enum", + "value": 27, + "label": "GlobalRANNodeID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "type_of_error": { + "type": "enum", + "value": 1, + "label": "missing", + "unknown": false + } + } + ] + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/pws_failure_indication.json b/internal/decoder/ngap/testdata/golden/pws_failure_indication.json new file mode 100644 index 0000000000..bdb034b359 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/pws_failure_indication.json @@ -0,0 +1,66 @@ +{ + "summary": "PWSFailureIndication", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 33, + "label": "PWSFailureIndication", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 81, + "label": "PWSFailedCellIDList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "eutra_cgi_list": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "eutra_cell_identity": "1234567" + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 27, + "label": "GlobalRANNodeID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_identity": { + "mcc": "001", + "mnc": "01" + }, + "global_gnb_id": "000001" + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/pws_restart_indication_full.json b/internal/decoder/ngap/testdata/golden/pws_restart_indication_full.json new file mode 100644 index 0000000000..41b135e6ea --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/pws_restart_indication_full.json @@ -0,0 +1,106 @@ +{ + "summary": "PWSRestartIndication", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 34, + "label": "PWSRestartIndication", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 16, + "label": "CellIDListForRestart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "nr_cgi_list": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "nr_cell_identity": "123456789" + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 27, + "label": "GlobalRANNodeID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_identity": { + "mcc": "001", + "mnc": "01" + }, + "global_gnb_id": "000001" + } + }, + { + "id": { + "type": "enum", + "value": 104, + "label": "TAIListForRestart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": "000001" + } + ] + }, + { + "id": { + "type": "enum", + "value": 23, + "label": "EmergencyAreaIDListForRestart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + "010203" + ] + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/reroute_nas_request_full.json b/internal/decoder/ngap/testdata/golden/reroute_nas_request_full.json new file mode 100644 index 0000000000..63145bbd10 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/reroute_nas_request_full.json @@ -0,0 +1,139 @@ +{ + "summary": "RerouteNASRequest, RAN-UE=5, AMF-UE=7", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 36, + "label": "RerouteNASRequest", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 85, + "label": "RAN-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 5 + }, + { + "id": { + "type": "enum", + "value": 10, + "label": "AMF-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 7 + }, + { + "id": { + "type": "enum", + "value": 42, + "label": "NGAP-Message", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "hex": "000f4000" + } + }, + { + "id": { + "type": "enum", + "value": 3, + "label": "AMFSetID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "004" + }, + { + "id": { + "type": "enum", + "value": 0, + "label": "AllowedNSSAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "sst": 1 + } + ] + }, + { + "id": { + "type": "enum", + "value": 171, + "label": "SourceToTarget-AMFInformationReroute", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "rejected_nssai_in_plmn": { + "hex": "0100000000000000000000000000000000000000000000000000000000000000" + } + } + }, + { + "id": { + "type": "enum", + "value": 414, + "label": "Partially-Allowed-NSSAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "sst": 2 + } + ] + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/write_replace_warning_request_full.json b/internal/decoder/ngap/testdata/golden/write_replace_warning_request_full.json new file mode 100644 index 0000000000..229696201d --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/write_replace_warning_request_full.json @@ -0,0 +1,208 @@ +{ + "summary": "WriteReplaceWarning", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 51, + "label": "WriteReplaceWarning", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 35, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "1112" + }, + { + "id": { + "type": "enum", + "value": 95, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "3456" + }, + { + "id": { + "type": "enum", + "value": 122, + "label": "WarningAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "nr_cgi_list": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "nr_cell_identity": "123456789" + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 87, + "label": "RepetitionPeriod", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 10 + }, + { + "id": { + "type": "enum", + "value": 47, + "label": "NumberOfBroadcastsRequested", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 125, + "label": "WarningType", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "0580" + } + }, + { + "id": { + "type": "enum", + "value": 124, + "label": "WarningSecurityInfo", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "0100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "id": { + "type": "enum", + "value": 20, + "label": "DataCodingScheme", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": "0f" + }, + { + "id": { + "type": "enum", + "value": 123, + "label": "WarningMessageContents", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "01d4f29c0e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004" + } + }, + { + "id": { + "type": "enum", + "value": 17, + "label": "ConcurrentWarningMessageInd", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "true", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 141, + "label": "WarningAreaCoordinates", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "aabb" + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/write_replace_warning_response_full.json b/internal/decoder/ngap/testdata/golden/write_replace_warning_response_full.json new file mode 100644 index 0000000000..7f02c31d09 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/write_replace_warning_response_full.json @@ -0,0 +1,144 @@ +{ + "summary": "WriteReplaceWarning", + "pdu_type": "SuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 51, + "label": "WriteReplaceWarning", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 35, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "1112" + }, + { + "id": { + "type": "enum", + "value": 95, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "3456" + }, + { + "id": { + "type": "enum", + "value": 13, + "label": "BroadcastCompletedAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "tai_nr": [ + { + "tai": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": "000001" + }, + "cells": [ + { + "nr_cgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "nr_cell_identity": "123456789" + } + } + ] + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 19, + "label": "CriticalityDiagnostics", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "procedure_code": { + "type": "enum", + "value": 21, + "label": "NGSetup", + "unknown": false + }, + "triggering_message": { + "type": "enum", + "value": 0, + "label": "initiating-message", + "unknown": false + }, + "procedure_criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "ies": [ + { + "ie_id": { + "type": "enum", + "value": 27, + "label": "GlobalRANNodeID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "type_of_error": { + "type": "enum", + "value": 1, + "label": "missing", + "unknown": false + } + } + ] + } + } + ] + } +} diff --git a/internal/decoder/s1ap/golden_test.go b/internal/decoder/s1ap/golden_test.go index 1c994da125..1c6f784215 100644 --- a/internal/decoder/s1ap/golden_test.go +++ b/internal/decoder/s1ap/golden_test.go @@ -444,6 +444,8 @@ func goldenCorpus(t *testing.T) map[string][]byte { LPPaPDU: lppaPDU, }) + addPWSOverloadCorpus(t, corpus) + return corpus } @@ -514,6 +516,9 @@ func TestGoldenCoversEveryRenderedProcedure(t *testing.T) { s1ap.ProcENBConfigurationUpdate, s1ap.ProcENBConfigurationTransfer, s1ap.ProcMMEConfigurationTransfer, s1ap.ProcLocationReport, s1ap.ProcDownlinkNonUEAssociatedLPPaTransport, s1ap.ProcUplinkNonUEAssociatedLPPaTransport, + s1ap.ProcWriteReplaceWarning, s1ap.ProcKill, s1ap.ProcPWSRestartIndication, + s1ap.ProcPWSFailureIndication, s1ap.ProcOverloadStart, s1ap.ProcOverloadStop, + s1ap.ProcRerouteNASRequest, }, "SuccessfulOutcome": { s1ap.ProcS1Setup, s1ap.ProcInitialContextSetup, s1ap.ProcUEContextRelease, s1ap.ProcUEContextModification, @@ -522,6 +527,7 @@ func TestGoldenCoversEveryRenderedProcedure(t *testing.T) { s1ap.ProcReset, s1ap.ProcPathSwitchRequest, s1ap.ProcERABModify, s1ap.ProcERABModificationIndication, s1ap.ProcENBConfigurationUpdate, + s1ap.ProcWriteReplaceWarning, s1ap.ProcKill, }, "UnsuccessfulOutcome": { s1ap.ProcS1Setup, s1ap.ProcInitialContextSetup, s1ap.ProcUEContextModification, diff --git a/internal/decoder/s1ap/overload.go b/internal/decoder/s1ap/overload.go new file mode 100644 index 0000000000..5216b58253 --- /dev/null +++ b/internal/decoder/s1ap/overload.go @@ -0,0 +1,63 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "fmt" + + "github.com/ellanetworks/core/s1ap" +) + +type OverloadResponse struct { + OverloadAction uint8 `json:"overload_action"` +} + +func gummeiList(list []s1ap.GUMMEI) []GUMMEI { + out := make([]GUMMEI, 0, len(list)) + for _, g := range list { + out = append(out, gummei(g)) + } + + return out +} + +func buildOverloadStart(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseOverloadStart(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse Overload Start: %v", err)}, "" + } + + ies := []IE{ + ie(s1ap.IDOverloadResponse, s1ap.CriticalityReject, OverloadResponse{OverloadAction: uint8(m.OverloadResponse.OverloadAction)}), + } + + if len(m.GUMMEIList) > 0 { + ies = append(ies, ie(s1ap.IDGUMMEIList, s1ap.CriticalityIgnore, gummeiList(m.GUMMEIList))) + } + + if m.TrafficLoadReductionIndication != nil { + ies = append(ies, ie(s1ap.IDTrafficLoadReductionIndication, s1ap.CriticalityIgnore, *m.TrafficLoadReductionIndication)) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, fmt.Sprintf("Overload Start (action %d)", uint8(m.OverloadResponse.OverloadAction)) +} + +func buildOverloadStop(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseOverloadStop(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse Overload Stop: %v", err)}, "" + } + + var ies []IE + + if len(m.GUMMEIList) > 0 { + ies = append(ies, ie(s1ap.IDGUMMEIList, s1ap.CriticalityIgnore, gummeiList(m.GUMMEIList))) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, "Overload Stop" +} diff --git a/internal/decoder/s1ap/pws.go b/internal/decoder/s1ap/pws.go new file mode 100644 index 0000000000..7344228905 --- /dev/null +++ b/internal/decoder/s1ap/pws.go @@ -0,0 +1,308 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + "fmt" + + "github.com/ellanetworks/core/s1ap" +) + +type WarningAreaList struct { + ECGIs []EUTRANCGI `json:"ecgi_list,omitempty"` + TAIs []TAI `json:"tai_list,omitempty"` + EmergencyAreaIDs []string `json:"emergency_area_id_list,omitempty"` +} + +type TAIBroadcast struct { + TAI TAI `json:"tai"` + CompletedCells []EUTRANCGI `json:"completed_cells"` +} + +type EmergencyAreaIDBroadcast struct { + EmergencyAreaID string `json:"emergency_area_id"` + CompletedCells []EUTRANCGI `json:"completed_cells"` +} + +type BroadcastCompletedAreaList struct { + CellIDs []EUTRANCGI `json:"cell_id_broadcast,omitempty"` + TAIs []TAIBroadcast `json:"tai_broadcast,omitempty"` + EmergencyAreaIDs []EmergencyAreaIDBroadcast `json:"emergency_area_id_broadcast,omitempty"` +} + +type CancelledCell struct { + ECGI EUTRANCGI `json:"ecgi"` + NumberOfBroadcasts uint16 `json:"number_of_broadcasts"` +} + +type TAICancelled struct { + TAI TAI `json:"tai"` + CancelledCells []CancelledCell `json:"cancelled_cells"` +} + +type EmergencyAreaIDCancelled struct { + EmergencyAreaID string `json:"emergency_area_id"` + CancelledCells []CancelledCell `json:"cancelled_cells"` +} + +type BroadcastCancelledAreaList struct { + CellIDs []CancelledCell `json:"cell_id_cancelled,omitempty"` + TAIs []TAICancelled `json:"tai_cancelled,omitempty"` + EmergencyAreaIDs []EmergencyAreaIDCancelled `json:"emergency_area_id_cancelled,omitempty"` +} + +func emergencyAreaID(id s1ap.EmergencyAreaID) string { return hex.EncodeToString(id[:]) } + +func emergencyAreaIDs(ids []s1ap.EmergencyAreaID) []string { + out := make([]string, 0, len(ids)) + for _, id := range ids { + out = append(out, emergencyAreaID(id)) + } + + return out +} + +func ecgis(cells []s1ap.EUTRANCGI) []EUTRANCGI { + out := make([]EUTRANCGI, 0, len(cells)) + for _, c := range cells { + out = append(out, eutranCGI(c)) + } + + return out +} + +func tais(list []s1ap.TAI) []TAI { + out := make([]TAI, 0, len(list)) + for _, t := range list { + out = append(out, tai(t)) + } + + return out +} + +func warningAreaList(l s1ap.WarningAreaList) WarningAreaList { + return WarningAreaList{ECGIs: ecgis(l.CellIDList), TAIs: tais(l.TAIList), EmergencyAreaIDs: emergencyAreaIDs(l.EmergencyAreaIDList)} +} + +func broadcastCompletedAreaList(l s1ap.BroadcastCompletedAreaList) BroadcastCompletedAreaList { + var out BroadcastCompletedAreaList + + for _, c := range l.CellIDBroadcast { + out.CellIDs = append(out.CellIDs, eutranCGI(c.ECGI)) + } + + for _, t := range l.TAIBroadcast { + b := TAIBroadcast{TAI: tai(t.TAI)} + for _, c := range t.CompletedCellInTAI { + b.CompletedCells = append(b.CompletedCells, eutranCGI(c.ECGI)) + } + + out.TAIs = append(out.TAIs, b) + } + + for _, e := range l.EmergencyAreaIDBroadcast { + b := EmergencyAreaIDBroadcast{EmergencyAreaID: emergencyAreaID(e.EmergencyAreaID)} + for _, c := range e.CompletedCellInEAI { + b.CompletedCells = append(b.CompletedCells, eutranCGI(c.ECGI)) + } + + out.EmergencyAreaIDs = append(out.EmergencyAreaIDs, b) + } + + return out +} + +func broadcastCancelledAreaList(l s1ap.BroadcastCancelledAreaList) BroadcastCancelledAreaList { + var out BroadcastCancelledAreaList + + for _, c := range l.CellIDCancelled { + out.CellIDs = append(out.CellIDs, CancelledCell{ECGI: eutranCGI(c.ECGI), NumberOfBroadcasts: c.NumberOfBroadcasts}) + } + + for _, t := range l.TAICancelled { + b := TAICancelled{TAI: tai(t.TAI)} + for _, c := range t.CancelledCellInTAI { + b.CancelledCells = append(b.CancelledCells, CancelledCell{ECGI: eutranCGI(c.ECGI), NumberOfBroadcasts: c.NumberOfBroadcasts}) + } + + out.TAIs = append(out.TAIs, b) + } + + for _, e := range l.EmergencyAreaIDCancelled { + b := EmergencyAreaIDCancelled{EmergencyAreaID: emergencyAreaID(e.EmergencyAreaID)} + for _, c := range e.CancelledCellInEAI { + b.CancelledCells = append(b.CancelledCells, CancelledCell{ECGI: eutranCGI(c.ECGI), NumberOfBroadcasts: c.NumberOfBroadcasts}) + } + + out.EmergencyAreaIDs = append(out.EmergencyAreaIDs, b) + } + + return out +} + +func warningSummary(name string, id s1ap.MessageIdentifier, sn s1ap.SerialNumber) string { + return fmt.Sprintf("%s (message %d, serial %d)", name, uint16(id), uint16(sn)) +} + +func buildWriteReplaceWarningRequest(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseWriteReplaceWarningRequest(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse Write-Replace Warning Request: %v", err)}, "" + } + + ies := []IE{ + ie(s1ap.IDMessageIdentifier, s1ap.CriticalityReject, uint16(m.MessageIdentifier)), + ie(s1ap.IDSerialNumber, s1ap.CriticalityReject, uint16(m.SerialNumber)), + } + + if m.WarningAreaList != nil { + ies = append(ies, ie(s1ap.IDWarningAreaList, s1ap.CriticalityIgnore, warningAreaList(*m.WarningAreaList))) + } + + ies = append(ies, ie(s1ap.IDRepetitionPeriod, s1ap.CriticalityReject, m.RepetitionPeriod)) + + if m.ExtendedRepetitionPeriod != nil { + ies = append(ies, ie(s1ap.IDExtendedRepetitionPeriod, s1ap.CriticalityReject, *m.ExtendedRepetitionPeriod)) + } + + ies = append(ies, ie(s1ap.IDNumberofBroadcastRequest, s1ap.CriticalityReject, m.NumberofBroadcastRequest)) + + if m.WarningType != nil { + ies = append(ies, ie(s1ap.IDWarningType, s1ap.CriticalityIgnore, rawIEValue{Hex: hex.EncodeToString(m.WarningType[:])})) + } + + if m.WarningSecurityInfo != nil { + ies = append(ies, ie(s1ap.IDWarningSecurityInfo, s1ap.CriticalityIgnore, rawIEValue{Hex: hex.EncodeToString(m.WarningSecurityInfo[:])})) + } + + if m.DataCodingScheme != nil { + ies = append(ies, ie(s1ap.IDDataCodingScheme, s1ap.CriticalityIgnore, uint8(*m.DataCodingScheme))) + } + + if m.WarningMessageContents != nil { + ies = append(ies, ie(s1ap.IDWarningMessageContents, s1ap.CriticalityIgnore, rawIEValue{Hex: hex.EncodeToString(*m.WarningMessageContents)})) + } + + if m.ConcurrentWarningMessageIndicator != nil { + ies = append(ies, ie(s1ap.IDConcurrentWarningMessageIndicator, s1ap.CriticalityReject, *m.ConcurrentWarningMessageIndicator == s1ap.ConcurrentWarningMessageIndicatorTrue)) + } + + if m.WarningAreaCoordinates != nil { + ies = append(ies, ie(s1ap.IDWarningAreaCoordinates, s1ap.CriticalityIgnore, rawIEValue{Hex: hex.EncodeToString(*m.WarningAreaCoordinates)})) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, warningSummary("Write-Replace Warning Request", m.MessageIdentifier, m.SerialNumber) +} + +func buildWriteReplaceWarningResponse(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseWriteReplaceWarningResponse(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse Write-Replace Warning Response: %v", err)}, "" + } + + ies := []IE{ + ie(s1ap.IDMessageIdentifier, s1ap.CriticalityReject, uint16(m.MessageIdentifier)), + ie(s1ap.IDSerialNumber, s1ap.CriticalityReject, uint16(m.SerialNumber)), + } + + if m.BroadcastCompletedAreaList != nil { + ies = append(ies, ie(s1ap.IDBroadcastCompletedAreaList, s1ap.CriticalityIgnore, broadcastCompletedAreaList(*m.BroadcastCompletedAreaList))) + } + + if m.CriticalityDiagnostics != nil { + ies = append(ies, ie(s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, warningSummary("Write-Replace Warning Response", m.MessageIdentifier, m.SerialNumber) +} + +func buildKillRequest(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseKillRequest(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse Kill Request: %v", err)}, "" + } + + ies := []IE{ + ie(s1ap.IDMessageIdentifier, s1ap.CriticalityReject, uint16(m.MessageIdentifier)), + ie(s1ap.IDSerialNumber, s1ap.CriticalityReject, uint16(m.SerialNumber)), + } + + if m.WarningAreaList != nil { + ies = append(ies, ie(s1ap.IDWarningAreaList, s1ap.CriticalityIgnore, warningAreaList(*m.WarningAreaList))) + } + + if m.KillAllWarningMessages != nil { + ies = append(ies, ie(s1ap.IDKillAllWarningMessages, s1ap.CriticalityReject, *m.KillAllWarningMessages == s1ap.KillAllWarningMessagesTrue)) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, warningSummary("Kill Request", m.MessageIdentifier, m.SerialNumber) +} + +func buildKillResponse(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseKillResponse(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse Kill Response: %v", err)}, "" + } + + ies := []IE{ + ie(s1ap.IDMessageIdentifier, s1ap.CriticalityReject, uint16(m.MessageIdentifier)), + ie(s1ap.IDSerialNumber, s1ap.CriticalityReject, uint16(m.SerialNumber)), + } + + if m.BroadcastCancelledAreaList != nil { + ies = append(ies, ie(s1ap.IDBroadcastCancelledAreaList, s1ap.CriticalityIgnore, broadcastCancelledAreaList(*m.BroadcastCancelledAreaList))) + } + + if m.CriticalityDiagnostics != nil { + ies = append(ies, ie(s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, warningSummary("Kill Response", m.MessageIdentifier, m.SerialNumber) +} + +func buildPWSRestartIndication(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParsePWSRestartIndication(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse PWS Restart Indication: %v", err)}, "" + } + + ies := []IE{ + ie(s1ap.IDECGIListForRestart, s1ap.CriticalityReject, ecgis(m.ECGIListForRestart)), + ie(s1ap.IDGlobalENBID, s1ap.CriticalityReject, globalENBID(m.GlobalENBID)), + ie(s1ap.IDTAIListForRestart, s1ap.CriticalityReject, tais(m.TAIListForRestart)), + } + + if len(m.EmergencyAreaIDListForRestart) > 0 { + ies = append(ies, ie(s1ap.IDEmergencyAreaIDListForRestart, s1ap.CriticalityReject, emergencyAreaIDs(m.EmergencyAreaIDListForRestart))) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, fmt.Sprintf("PWS Restart Indication (%d cell(s))", len(m.ECGIListForRestart)) +} + +func buildPWSFailureIndication(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParsePWSFailureIndication(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse PWS Failure Indication: %v", err)}, "" + } + + ies := []IE{ + ie(s1ap.IDPWSfailedECGIList, s1ap.CriticalityReject, ecgis(m.PWSFailedECGIList)), + ie(s1ap.IDGlobalENBID, s1ap.CriticalityReject, globalENBID(m.GlobalENBID)), + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, fmt.Sprintf("PWS Failure Indication (%d cell(s))", len(m.PWSFailedECGIList)) +} diff --git a/internal/decoder/s1ap/pws_test.go b/internal/decoder/s1ap/pws_test.go new file mode 100644 index 0000000000..02f7b9cee8 --- /dev/null +++ b/internal/decoder/s1ap/pws_test.go @@ -0,0 +1,143 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "testing" + + "github.com/ellanetworks/core/s1ap" +) + +var ( + testCGI2 = s1ap.EUTRANCGI{PLMNIdentity: testPLMN, CellID: 0x0019b02} + testEAI = s1ap.EmergencyAreaID{0x01, 0x02, 0x03} + testENB = s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 0x12345}} + testGUMMEI = s1ap.GUMMEI{PLMNIdentity: testPLMN, MMEGroupID: s1ap.MMEGroupID{0x80, 0x01}, MMECode: 1} +) + +func testWarningAreaList() *s1ap.WarningAreaList { + return &s1ap.WarningAreaList{CellIDList: []s1ap.EUTRANCGI{testCGI, testCGI2}} +} + +func addPWSOverloadCorpus(t *testing.T, corpus map[string][]byte) { + t.Helper() + + contents := s1ap.WarningMessageContents{0x01, 0x41, 0x42, 0x43} + coords := s1ap.WarningAreaCoordinates{0x0a, 0x0b} + + corpus["write_replace_warning_request_full"] = mustMarshal(t, &s1ap.WriteReplaceWarningRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3001, + WarningAreaList: testWarningAreaList(), + RepetitionPeriod: 60, + ExtendedRepetitionPeriod: s1ap.Ptr(uint32(5000)), + NumberofBroadcastRequest: 3, + WarningType: &s1ap.WarningType{0x01, 0x80}, + WarningSecurityInfo: &s1ap.WarningSecurityInfo{0xaa}, + DataCodingScheme: s1ap.Ptr(s1ap.DataCodingScheme(0x0f)), + WarningMessageContents: &contents, + ConcurrentWarningMessageIndicator: s1ap.Ptr(s1ap.ConcurrentWarningMessageIndicatorTrue), + WarningAreaCoordinates: &coords, + }) + + corpus["write_replace_warning_response_full"] = mustMarshal(t, &s1ap.WriteReplaceWarningResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3001, + BroadcastCompletedAreaList: &s1ap.BroadcastCompletedAreaList{ + TAIBroadcast: []s1ap.TAIBroadcastItem{{TAI: testTAI, CompletedCellInTAI: []s1ap.CompletedCellInTAIItem{{ECGI: testCGI}}}}, + }, + CriticalityDiagnostics: testDiagnostics(), + }) + + corpus["kill_request_full"] = mustMarshal(t, &s1ap.KillRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3001, + WarningAreaList: &s1ap.WarningAreaList{EmergencyAreaIDList: []s1ap.EmergencyAreaID{testEAI}}, + KillAllWarningMessages: s1ap.Ptr(s1ap.KillAllWarningMessagesTrue), + }) + + corpus["kill_response_full"] = mustMarshal(t, &s1ap.KillResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3001, + BroadcastCancelledAreaList: &s1ap.BroadcastCancelledAreaList{ + EmergencyAreaIDCancelled: []s1ap.EmergencyAreaIDCancelledItem{{ + EmergencyAreaID: testEAI, + CancelledCellInEAI: []s1ap.CancelledCellInEAIItem{{ECGI: testCGI, NumberOfBroadcasts: 4}}, + }}, + }, + CriticalityDiagnostics: testDiagnostics(), + }) + + corpus["pws_restart_indication_full"] = mustMarshal(t, &s1ap.PWSRestartIndication{ + ECGIListForRestart: []s1ap.EUTRANCGI{testCGI}, + GlobalENBID: testENB, + TAIListForRestart: []s1ap.TAI{testTAI}, + EmergencyAreaIDListForRestart: []s1ap.EmergencyAreaID{testEAI}, + }) + + corpus["pws_failure_indication_full"] = mustMarshal(t, &s1ap.PWSFailureIndication{ + PWSFailedECGIList: []s1ap.EUTRANCGI{testCGI, testCGI2}, + GlobalENBID: testENB, + }) + + corpus["overload_start_full"] = mustMarshal(t, &s1ap.OverloadStart{ + OverloadResponse: s1ap.OverloadResponse{OverloadAction: s1ap.OverloadActionRejectRRCCRSignalling}, + GUMMEIList: []s1ap.GUMMEI{testGUMMEI}, + TrafficLoadReductionIndication: s1ap.Ptr(uint8(40)), + }) + + corpus["overload_stop_full"] = mustMarshal(t, &s1ap.OverloadStop{GUMMEIList: []s1ap.GUMMEI{testGUMMEI}}) + + corpus["reroute_nas_request_full"] = mustMarshal(t, &s1ap.RerouteNASRequest{ + ENBUES1APID: 2, + MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(7)), + S1Message: s1ap.S1Message{0x00, 0x0c, 0x40, 0x00}, + MMEGroupID: s1ap.MMEGroupID{0x80, 0x02}, + AdditionalGUTI: &s1ap.AdditionalGUTI{GUMMEI: testGUMMEI, MTMSI: 0xdeadbeef}, + UEUsageType: s1ap.Ptr(uint8(5)), + }) +} + +func TestPWSOverloadDecode(t *testing.T) { + corpus := map[string][]byte{} + addPWSOverloadCorpus(t, corpus) + + want := map[string]struct { + summary string + ies int + }{ + "write_replace_warning_request_full": {"Write-Replace Warning Request (message 4370, serial 12289)", 12}, + "write_replace_warning_response_full": {"Write-Replace Warning Response (message 4370, serial 12289)", 4}, + "kill_request_full": {"Kill Request (message 4370, serial 12289)", 4}, + "kill_response_full": {"Kill Response (message 4370, serial 12289)", 4}, + "pws_restart_indication_full": {"PWS Restart Indication (1 cell(s))", 4}, + "pws_failure_indication_full": {"PWS Failure Indication (2 cell(s))", 2}, + "overload_start_full": {"Overload Start (action 1)", 3}, + "overload_stop_full": {"Overload Stop", 1}, + "reroute_nas_request_full": {"Reroute NAS Request (eNB UE 2)", 6}, + } + + for name, w := range want { + msg := DecodeS1APMessage(corpus[name]) + + if msg.Value.Error != "" { + t.Errorf("%s: %s", name, msg.Value.Error) + continue + } + + if msg.Summary != w.summary { + t.Errorf("%s: summary %q, want %q", name, msg.Summary, w.summary) + } + + if len(msg.Value.IEs) != w.ies { + t.Errorf("%s: %d IEs, want %d", name, len(msg.Value.IEs), w.ies) + } + + for _, e := range msg.Value.IEs { + if e.ID.Unknown || e.ID.Label == "" { + t.Errorf("%s: IE %d has no name", name, e.ID.Value) + } + } + } +} diff --git a/internal/decoder/s1ap/reroute_nas.go b/internal/decoder/s1ap/reroute_nas.go new file mode 100644 index 0000000000..85c6278645 --- /dev/null +++ b/internal/decoder/s1ap/reroute_nas.go @@ -0,0 +1,46 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + "fmt" + + "github.com/ellanetworks/core/s1ap" +) + +type AdditionalGUTI struct { + GUMMEI GUMMEI `json:"gummei"` + MTMSI uint32 `json:"m_tmsi"` +} + +func buildRerouteNASRequest(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseRerouteNASRequest(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse Reroute NAS Request: %v", err)}, "" + } + + ies := []IE{ie(s1ap.IDENBUES1APID, s1ap.CriticalityReject, uint32(m.ENBUES1APID))} + + if m.MMEUES1APID != nil { + ies = append(ies, ie(s1ap.IDMMEUES1APID, s1ap.CriticalityIgnore, uint32(*m.MMEUES1APID))) + } + + ies = append(ies, + ie(s1ap.IDS1Message, s1ap.CriticalityReject, rawIEValue{Hex: hex.EncodeToString(m.S1Message)}), + ie(s1ap.IDMMEGroupID, s1ap.CriticalityReject, uint16(m.MMEGroupID[0])<<8|uint16(m.MMEGroupID[1])), + ) + + if m.AdditionalGUTI != nil { + ies = append(ies, ie(s1ap.IDAdditionalGUTI, s1ap.CriticalityIgnore, AdditionalGUTI{GUMMEI: gummei(m.AdditionalGUTI.GUMMEI), MTMSI: uint32(m.AdditionalGUTI.MTMSI)})) + } + + if m.UEUsageType != nil { + ies = append(ies, ie(s1ap.IDUEUsageType, s1ap.CriticalityIgnore, *m.UEUsageType)) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, fmt.Sprintf("Reroute NAS Request (eNB UE %d)", uint32(m.ENBUES1APID)) +} diff --git a/internal/decoder/s1ap/s1ap.go b/internal/decoder/s1ap/s1ap.go index 9cb7bcac0e..ff7b8b4537 100644 --- a/internal/decoder/s1ap/s1ap.go +++ b/internal/decoder/s1ap/s1ap.go @@ -142,6 +142,20 @@ func decodeInitiatingMessage(m *s1ap.InitiatingMessage) S1APMessage { msg.Value, msg.Summary = buildDownlinkUEAssociatedLPPaTransport(m.Value) case s1ap.ProcUplinkUEAssociatedLPPaTransport: msg.Value, msg.Summary = buildUplinkUEAssociatedLPPaTransport(m.Value) + case s1ap.ProcWriteReplaceWarning: + msg.Value, msg.Summary = buildWriteReplaceWarningRequest(m.Value) + case s1ap.ProcKill: + msg.Value, msg.Summary = buildKillRequest(m.Value) + case s1ap.ProcPWSRestartIndication: + msg.Value, msg.Summary = buildPWSRestartIndication(m.Value) + case s1ap.ProcPWSFailureIndication: + msg.Value, msg.Summary = buildPWSFailureIndication(m.Value) + case s1ap.ProcOverloadStart: + msg.Value, msg.Summary = buildOverloadStart(m.Value) + case s1ap.ProcOverloadStop: + msg.Value, msg.Summary = buildOverloadStop(m.Value) + case s1ap.ProcRerouteNASRequest: + msg.Value, msg.Summary = buildRerouteNASRequest(m.Value) default: msg.Value = unsupportedProcedure(m.ProcedureCode) } @@ -187,6 +201,10 @@ func decodeSuccessfulOutcome(m *s1ap.SuccessfulOutcome) S1APMessage { msg.Value, msg.Summary = buildHandoverRequestAcknowledge(m.Value) case s1ap.ProcHandoverCancel: msg.Value, msg.Summary = buildHandoverCancelAcknowledge(m.Value) + case s1ap.ProcWriteReplaceWarning: + msg.Value, msg.Summary = buildWriteReplaceWarningResponse(m.Value) + case s1ap.ProcKill: + msg.Value, msg.Summary = buildKillResponse(m.Value) default: msg.Value = unsupportedProcedure(m.ProcedureCode) } diff --git a/internal/decoder/s1ap/testdata/golden/kill_request_full.json b/internal/decoder/s1ap/testdata/golden/kill_request_full.json new file mode 100644 index 0000000000..f30174c863 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/kill_request_full.json @@ -0,0 +1,84 @@ +{ + "summary": "Kill Request (message 4370, serial 12289)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 43, + "label": "Kill", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 111, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 4370 + }, + { + "id": { + "type": "enum", + "value": 112, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 12289 + }, + { + "id": { + "type": "enum", + "value": 113, + "label": "WarningAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "emergency_area_id_list": [ + "010203" + ] + } + }, + { + "id": { + "type": "enum", + "value": 191, + "label": "KillAllWarningMessages", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": true + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/kill_response_full.json b/internal/decoder/s1ap/testdata/golden/kill_response_full.json new file mode 100644 index 0000000000..e8b2a3fa39 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/kill_response_full.json @@ -0,0 +1,139 @@ +{ + "summary": "Kill Response (message 4370, serial 12289)", + "pdu_type": "SuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 43, + "label": "Kill", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 111, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 4370 + }, + { + "id": { + "type": "enum", + "value": 112, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 12289 + }, + { + "id": { + "type": "enum", + "value": 141, + "label": "BroadcastCancelledAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "emergency_area_id_cancelled": [ + { + "emergency_area_id": "010203", + "cancelled_cells": [ + { + "ecgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + }, + "number_of_broadcasts": 4 + } + ] + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 58, + "label": "CriticalityDiagnostics", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "procedure_code": { + "type": "enum", + "value": 17, + "label": "S1Setup", + "unknown": false + }, + "triggering_message": { + "type": "enum", + "value": 0, + "label": "initiating-message", + "unknown": false + }, + "procedure_criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "ies": [ + { + "ie_id": { + "type": "enum", + "value": 59, + "label": "Global-ENB-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "type_of_error": { + "type": "enum", + "value": 1, + "label": "missing", + "unknown": false + } + } + ] + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/overload_start_full.json b/internal/decoder/s1ap/testdata/golden/overload_start_full.json new file mode 100644 index 0000000000..e4e0138873 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/overload_start_full.json @@ -0,0 +1,76 @@ +{ + "summary": "Overload Start (action 1)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 34, + "label": "OverloadStart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 101, + "label": "OverloadResponse", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "overload_action": 1 + } + }, + { + "id": { + "type": "enum", + "value": 154, + "label": "GUMMEIList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "mme_group_id": 32769, + "mme_code": 1 + } + ] + }, + { + "id": { + "type": "enum", + "value": 161, + "label": "TrafficLoadReductionIndication", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 40 + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/overload_stop_full.json b/internal/decoder/s1ap/testdata/golden/overload_stop_full.json new file mode 100644 index 0000000000..57ce06147a --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/overload_stop_full.json @@ -0,0 +1,44 @@ +{ + "summary": "Overload Stop", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 35, + "label": "OverloadStop", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 154, + "label": "GUMMEIList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "mme_group_id": 32769, + "mme_code": 1 + } + ] + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/pws_failure_indication_full.json b/internal/decoder/s1ap/testdata/golden/pws_failure_indication_full.json new file mode 100644 index 0000000000..8933839cc2 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/pws_failure_indication_full.json @@ -0,0 +1,79 @@ +{ + "summary": "PWS Failure Indication (2 cell(s))", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 51, + "label": "PWSFailureIndication", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 222, + "label": "PWSfailedECGIList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + }, + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b02" + } + ] + }, + { + "id": { + "type": "enum", + "value": 59, + "label": "Global-ENB-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "enb_id": { + "kind": { + "type": "enum", + "value": 0, + "label": "macroENB-ID", + "unknown": false + }, + "value": 74565 + } + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/pws_restart_indication_full.json b/internal/decoder/s1ap/testdata/golden/pws_restart_indication_full.json new file mode 100644 index 0000000000..92fac9deda --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/pws_restart_indication_full.json @@ -0,0 +1,112 @@ +{ + "summary": "PWS Restart Indication (1 cell(s))", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 49, + "label": "PWSRestartIndication", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 182, + "label": "ECGIListForRestart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + } + ] + }, + { + "id": { + "type": "enum", + "value": 59, + "label": "Global-ENB-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "enb_id": { + "kind": { + "type": "enum", + "value": 0, + "label": "macroENB-ID", + "unknown": false + }, + "value": 74565 + } + } + }, + { + "id": { + "type": "enum", + "value": 188, + "label": "TAIListForRestart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": 1 + } + ] + }, + { + "id": { + "type": "enum", + "value": 190, + "label": "EmergencyAreaIDListForRestart", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + "010203" + ] + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/reroute_nas_request_full.json b/internal/decoder/s1ap/testdata/golden/reroute_nas_request_full.json new file mode 100644 index 0000000000..877e819d44 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/reroute_nas_request_full.json @@ -0,0 +1,122 @@ +{ + "summary": "Reroute NAS Request (eNB UE 2)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 52, + "label": "RerouteNASRequest", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 8, + "label": "eNB-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 0, + "label": "MME-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 7 + }, + { + "id": { + "type": "enum", + "value": 225, + "label": "S1-Message", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "hex": "000c4000" + } + }, + { + "id": { + "type": "enum", + "value": 223, + "label": "MME-Group-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 32770 + }, + { + "id": { + "type": "enum", + "value": 224, + "label": "Additional-GUTI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "gummei": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "mme_group_id": 32769, + "mme_code": 1 + }, + "m_tmsi": 3735928559 + } + }, + { + "id": { + "type": "enum", + "value": 230, + "label": "UE-Usage-Type", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 5 + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/write_replace_warning_request_full.json b/internal/decoder/s1ap/testdata/golden/write_replace_warning_request_full.json new file mode 100644 index 0000000000..401c23186c --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/write_replace_warning_request_full.json @@ -0,0 +1,225 @@ +{ + "summary": "Write-Replace Warning Request (message 4370, serial 12289)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 36, + "label": "WriteReplaceWarning", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 111, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 4370 + }, + { + "id": { + "type": "enum", + "value": 112, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 12289 + }, + { + "id": { + "type": "enum", + "value": 113, + "label": "WarningAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ecgi_list": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + }, + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b02" + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 114, + "label": "RepetitionPeriod", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 60 + }, + { + "id": { + "type": "enum", + "value": 144, + "label": "ExtendedRepetitionPeriod", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 5000 + }, + { + "id": { + "type": "enum", + "value": 115, + "label": "NumberofBroadcastRequest", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 3 + }, + { + "id": { + "type": "enum", + "value": 116, + "label": "WarningType", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "0180" + } + }, + { + "id": { + "type": "enum", + "value": 117, + "label": "WarningSecurityInfo", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "aa00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "id": { + "type": "enum", + "value": 118, + "label": "DataCodingScheme", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 15 + }, + { + "id": { + "type": "enum", + "value": 119, + "label": "WarningMessageContents", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "01414243" + } + }, + { + "id": { + "type": "enum", + "value": 142, + "label": "ConcurrentWarningMessageIndicator", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": true + }, + { + "id": { + "type": "enum", + "value": 286, + "label": "WarningAreaCoordinates", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "0a0b" + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/write_replace_warning_response_full.json b/internal/decoder/s1ap/testdata/golden/write_replace_warning_response_full.json new file mode 100644 index 0000000000..a6e78ecb9a --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/write_replace_warning_response_full.json @@ -0,0 +1,142 @@ +{ + "summary": "Write-Replace Warning Response (message 4370, serial 12289)", + "pdu_type": "SuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 36, + "label": "WriteReplaceWarning", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 111, + "label": "MessageIdentifier", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 4370 + }, + { + "id": { + "type": "enum", + "value": 112, + "label": "SerialNumber", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 12289 + }, + { + "id": { + "type": "enum", + "value": 120, + "label": "BroadcastCompletedAreaList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "tai_broadcast": [ + { + "tai": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": 1 + }, + "completed_cells": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + } + ] + } + ] + } + }, + { + "id": { + "type": "enum", + "value": 58, + "label": "CriticalityDiagnostics", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "procedure_code": { + "type": "enum", + "value": 17, + "label": "S1Setup", + "unknown": false + }, + "triggering_message": { + "type": "enum", + "value": 0, + "label": "initiating-message", + "unknown": false + }, + "procedure_criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "ies": [ + { + "ie_id": { + "type": "enum", + "value": 59, + "label": "Global-ENB-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "type_of_error": { + "type": "enum", + "value": 1, + "label": "missing", + "unknown": false + } + } + ] + } + } + ] + } +} diff --git a/internal/tester/enb/broadcast_plmn_test.go b/internal/tester/enb/broadcast_plmn_test.go new file mode 100644 index 0000000000..2d7bf7eb2c --- /dev/null +++ b/internal/tester/enb/broadcast_plmn_test.go @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package enb_test + +import ( + "testing" + + "github.com/ellanetworks/core/internal/tester/enb" + "github.com/ellanetworks/core/internal/tester/gnb" + "github.com/ellanetworks/core/ngap" +) + +func TestBuildNGSetupRequestBroadcastsAdditionalPLMNs(t *testing.T) { + pdu, err := enb.BuildNGSetupRequest(&enb.NGSetupRequestOpts{ + EnbID: testEnbID, Mcc: testMCC, Mnc: testMNC, Tac: testTAC, Sst: 1, + AdditionalPLMNs: []gnb.BroadcastPLMN{{Mcc: "310", Mnc: "260", Slices: []gnb.SliceOpt{{Sst: 2}}}}, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseNGSetupRequest(initiatingValue(t, pdu, ngap.ProcNGSetup)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + bplmns := msg.SupportedTAList[0].BroadcastPLMNList + if len(bplmns) != 2 || bplmns[1].PLMNIdentity != (ngap.PLMNIdentity{0x13, 0x00, 0x62}) { + t.Fatalf("broadcast PLMNs = %+v, want primary then 310/260", bplmns) + } + + if s := bplmns[1].TAISliceSupportList; len(s) != 1 || s[0].SNSSAI.SST != 2 { + t.Errorf("additional slices = %+v, want SST 2", s) + } +} + +func TestBuildInitialUEMessageCarriesSelectedPLMNInTAI(t *testing.T) { + pdu, err := enb.BuildInitialUEMessage(&enb.InitialUEMessageOpts{ + RanUENGAPID: 1, NasPDU: []byte{0x7e}, Mcc: testMCC, Mnc: testMNC, + SelectedMcc: "310", SelectedMnc: "260", Tac: testTAC, EnbID: testEnbID, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseInitialUEMessage(initiatingValue(t, pdu, ngap.ProcInitialUEMessage)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + uli := msg.UserLocationInformation + if uli.Kind != ngap.UserLocationEUTRA || uli.TAI.PLMNIdentity != (ngap.PLMNIdentity{0x13, 0x00, 0x62}) { + t.Errorf("location = %+v, want an E-UTRA cell with TAI PLMN 310/260", uli) + } + + if uli.PLMNIdentity != (ngap.PLMNIdentity{0x00, 0xf1, 0x10}) { + t.Errorf("E-UTRA CGI PLMN = % x, want the primary PLMN", uli.PLMNIdentity) + } +} diff --git a/internal/tester/enb/build_initial_ue_message.go b/internal/tester/enb/build_initial_ue_message.go index c57630580c..aa6a5e9f33 100644 --- a/internal/tester/enb/build_initial_ue_message.go +++ b/internal/tester/enb/build_initial_ue_message.go @@ -17,6 +17,8 @@ type InitialUEMessageOpts struct { Guti5g []byte Mcc string Mnc string + SelectedMcc string + SelectedMnc string Tac string EnbID string RRCEstablishmentCause ngap.RRCEstablishmentCause @@ -47,37 +49,17 @@ func BuildInitialUEMessage(opts *InitialUEMessageOpts) ([]byte, error) { return nil, fmt.Errorf("RAN UE NGAP ID is required to build InitialUEMessage") } - plmn, err := gnb.PLMNIdentity(opts.Mcc, opts.Mnc) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.EnbID, opts.Tac) if err != nil { return nil, err } - tac, err := gnb.TACValue(opts.Tac) - if err != nil { - return nil, err - } - - node, err := NgENBNodeID(opts.Mcc, opts.Mnc, opts.EnbID) - if err != nil { - return nil, err - } - - cellID, err := node.EUTRACellIdentity(0) - if err != nil { - return nil, fmt.Errorf("could not build E-UTRA cell identity: %w", err) - } - msg := &ngap.InitialUEMessage{ - RANUENGAPID: ngap.RANUENGAPID(opts.RanUENGAPID), - NASPDU: ngap.NASPDU(opts.NasPDU), - UserLocationInformation: ngap.UserLocationInformation{ - Kind: ngap.UserLocationEUTRA, - PLMNIdentity: plmn, - CellIdentity: cellID, - TAI: ngap.TAI{PLMNIdentity: plmn, TAC: tac}, - }, - RRCEstablishmentCause: ngap.Ptr(opts.RRCEstablishmentCause), - UEContextRequest: ngap.Ptr(ngap.UEContextRequested), + RANUENGAPID: ngap.RANUENGAPID(opts.RanUENGAPID), + NASPDU: ngap.NASPDU(opts.NasPDU), + UserLocationInformation: uli, + RRCEstablishmentCause: ngap.Ptr(opts.RRCEstablishmentCause), + UEContextRequest: ngap.Ptr(ngap.UEContextRequested), } // The AMF Set ID (10 bits) and AMF Pointer (6 bits) sit in octets 6-7 of the diff --git a/internal/tester/enb/build_ng_setup_request.go b/internal/tester/enb/build_ng_setup_request.go index 7ae273cc5d..90aeb6055c 100644 --- a/internal/tester/enb/build_ng_setup_request.go +++ b/internal/tester/enb/build_ng_setup_request.go @@ -18,6 +18,8 @@ type NGSetupRequestOpts struct { Tac string Sst int32 Sd string + + AdditionalPLMNs []gnb.BroadcastPLMN } // ngENBIDBits is the macroNgENB-ID width this simulator advertises, and the @@ -60,15 +62,17 @@ func BuildNGSetupRequest(opts *NGSetupRequestOpts) ([]byte, error) { return nil, err } + bplmns, err := gnb.BuildBroadcastPLMNList(node.PLMNIdentity, ngap.SliceSupportList{{SNSSAI: snssai}}, opts.AdditionalPLMNs) + if err != nil { + return nil, err + } + req := &ngap.NGSetupRequest{ GlobalRANNodeID: node, RANNodeName: ngap.Ptr(opts.Name), SupportedTAList: ngap.SupportedTAList{{ - TAC: tac, - BroadcastPLMNList: ngap.BroadcastPLMNList{{ - PLMNIdentity: node.PLMNIdentity, - TAISliceSupportList: ngap.SliceSupportList{{SNSSAI: snssai}}, - }}, + TAC: tac, + BroadcastPLMNList: bplmns, }}, DefaultPagingDRX: ngap.Ptr(ngap.PagingDRXv128), } diff --git a/internal/tester/enb/build_uplink_nas_transport.go b/internal/tester/enb/build_uplink_nas_transport.go index 3a46940fca..b2e2d4bc8b 100644 --- a/internal/tester/enb/build_uplink_nas_transport.go +++ b/internal/tester/enb/build_uplink_nas_transport.go @@ -15,6 +15,8 @@ type UplinkNasTransportOpts struct { NasPDU []byte Mcc string Mnc string + SelectedMcc string + SelectedMnc string EnbID string Tac string } @@ -36,7 +38,7 @@ func BuildUplinkNasTransport(opts *UplinkNasTransportOpts) ([]byte, error) { return nil, fmt.Errorf("NAS PDU is required to build UplinkNasTransport") } - uli, err := userLocation(opts.Mcc, opts.Mnc, opts.EnbID, opts.Tac) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.EnbID, opts.Tac) if err != nil { return nil, err } diff --git a/internal/tester/enb/helpers.go b/internal/tester/enb/helpers.go index 19bb61b0d2..b6fdf3ccb5 100644 --- a/internal/tester/enb/helpers.go +++ b/internal/tester/enb/helpers.go @@ -40,12 +40,21 @@ func ngENBNodeID(mcc, mnc, enbID string) (ngap.GlobalRANNodeID, error) { // userLocation builds the User Location Information this simulator reports: the // E-UTRA cell it serves and the TAI that cell is in (TS 38.413 §9.3.1.16). // internal/tester/gnb reports an NR cell the same way. -func userLocation(mcc, mnc, enbID, tac string) (ngap.UserLocationInformation, error) { +func userLocation(mcc, mnc, selMcc, selMnc, enbID, tac string) (ngap.UserLocationInformation, error) { plmn, err := gnb.PLMNIdentity(mcc, mnc) if err != nil { return ngap.UserLocationInformation{}, err } + selected := plmn + + if selMcc != "" && selMnc != "" { + selected, err = gnb.PLMNIdentity(selMcc, selMnc) + if err != nil { + return ngap.UserLocationInformation{}, err + } + } + tacValue, err := gnb.TACValue(tac) if err != nil { return ngap.UserLocationInformation{}, err @@ -67,6 +76,6 @@ func userLocation(mcc, mnc, enbID, tac string) (ngap.UserLocationInformation, er Kind: ngap.UserLocationEUTRA, PLMNIdentity: plmn, CellIdentity: cellID, - TAI: ngap.TAI{PLMNIdentity: plmn, TAC: tacValue}, + TAI: ngap.TAI{PLMNIdentity: selected, TAC: tacValue}, }, nil } diff --git a/internal/tester/enb/server.go b/internal/tester/enb/server.go index d47c7c0719..30602b9527 100644 --- a/internal/tester/enb/server.go +++ b/internal/tester/enb/server.go @@ -140,7 +140,11 @@ func Start( } func (n *NgeNB) SendInitialUEMessage(nasPDU []byte, ranUENGAPID int64, guti5G []byte, cause ngap.RRCEstablishmentCause) error { + selMcc, selMnc := n.SelectedPLMN(ranUENGAPID) + opts := &InitialUEMessageOpts{ + SelectedMcc: selMcc, + SelectedMnc: selMnc, Mcc: n.MCC, Mnc: n.MNC, EnbID: n.EnbID, @@ -174,7 +178,11 @@ func (n *NgeNB) SendInitialUEMessage(nasPDU []byte, ranUENGAPID int64, guti5G [] } func (n *NgeNB) SendUplinkNAS(nasPDU []byte, amfUENGAPID int64, ranUENGAPID int64) error { + selMcc, selMnc := n.SelectedPLMN(ranUENGAPID) + err := n.sendUplinkNASTransport(&UplinkNasTransportOpts{ + SelectedMcc: selMcc, + SelectedMnc: selMnc, AMFUeNgapID: amfUENGAPID, RANUeNgapID: ranUENGAPID, Mcc: n.MCC, diff --git a/internal/tester/gnb/broadcast_plmn.go b/internal/tester/gnb/broadcast_plmn.go new file mode 100644 index 0000000000..6b31285aa5 --- /dev/null +++ b/internal/tester/gnb/broadcast_plmn.go @@ -0,0 +1,117 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package gnb + +import ( + "fmt" + + "github.com/ellanetworks/core/ngap" +) + +type BroadcastPLMN struct { + Mcc string + Mnc string + Slices []SliceOpt +} + +func sliceSupportList(slices []SliceOpt) (ngap.SliceSupportList, error) { + support := make(ngap.SliceSupportList, 0, len(slices)) + + for _, s := range slices { + snssai, err := sliceToNGAP(s) + if err != nil { + return nil, err + } + + support = append(support, ngap.SliceSupportItem{SNSSAI: snssai}) + } + + return support, nil +} + +func BuildBroadcastPLMNList(primary ngap.PLMNIdentity, support ngap.SliceSupportList, additional []BroadcastPLMN) (ngap.BroadcastPLMNList, error) { + list := ngap.BroadcastPLMNList{{PLMNIdentity: primary, TAISliceSupportList: support}} + seen := map[ngap.PLMNIdentity]bool{primary: true} + + for _, p := range additional { + plmn, err := PLMNIdentity(p.Mcc, p.Mnc) + if err != nil { + return nil, err + } + + if seen[plmn] { + return nil, fmt.Errorf("PLMN %s/%s is broadcast twice", p.Mcc, p.Mnc) + } + + seen[plmn] = true + + item := ngap.BroadcastPLMNItem{PLMNIdentity: plmn, TAISliceSupportList: support} + + if len(p.Slices) > 0 { + item.TAISliceSupportList, err = sliceSupportList(p.Slices) + if err != nil { + return nil, err + } + } + + list = append(list, item) + } + + return list, nil +} + +func selectedOrServing(mcc, mnc, selMcc, selMnc string) (string, string) { + if selMcc == "" || selMnc == "" { + return mcc, mnc + } + + return selMcc, selMnc +} + +func (g *GnodeB) SelectPLMN(ranUENGAPID int64, mcc, mnc string) error { + plmn, err := PLMNIdentity(mcc, mnc) + if err != nil { + return err + } + + broadcast := mcc == g.MCC && mnc == g.MNC + + for _, p := range g.AdditionalPLMNs { + if other, err := PLMNIdentity(p.Mcc, p.Mnc); err == nil && other == plmn { + broadcast = true + } + } + + if !broadcast { + return fmt.Errorf("PLMN %s/%s is not broadcast by this node", mcc, mnc) + } + + g.mu.Lock() + defer g.mu.Unlock() + + if g.selectedPLMNs == nil { + g.selectedPLMNs = make(map[int64]BroadcastPLMN) + } + + g.selectedPLMNs[ranUENGAPID] = BroadcastPLMN{Mcc: mcc, Mnc: mnc} + + return nil +} + +func (g *GnodeB) SelectedPLMN(ranUENGAPID int64) (mcc, mnc string) { + if mcc, mnc = g.explicitPLMN(ranUENGAPID); mcc != "" { + return mcc, mnc + } + + return g.MCC, g.MNC +} + +func (g *GnodeB) explicitPLMN(ranUENGAPID int64) (mcc, mnc string) { + g.mu.Lock() + defer g.mu.Unlock() + + p := g.selectedPLMNs[ranUENGAPID] + + return p.Mcc, p.Mnc +} diff --git a/internal/tester/gnb/broadcast_plmn_test.go b/internal/tester/gnb/broadcast_plmn_test.go new file mode 100644 index 0000000000..f30e24eff1 --- /dev/null +++ b/internal/tester/gnb/broadcast_plmn_test.go @@ -0,0 +1,191 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package gnb_test + +import ( + "testing" + + "github.com/ellanetworks/core/internal/tester/gnb" + "github.com/ellanetworks/core/ngap" +) + +var ( + homePLMN = ngap.PLMNIdentity{0x00, 0xf1, 0x10} + otherPLMN = ngap.PLMNIdentity{0x13, 0x00, 0x62} +) + +func TestBuildNGSetupRequestBroadcastsAdditionalPLMNs(t *testing.T) { + pdu, err := gnb.BuildNGSetupRequest(&gnb.NGSetupRequestOpts{ + Name: "ella", GnbID: testGnbID, Mcc: testMCC, Mnc: testMNC, Tac: testTAC, Sst: 1, + AdditionalPLMNs: []gnb.BroadcastPLMN{ + {Mcc: "310", Mnc: "260", Slices: []gnb.SliceOpt{{Sst: 2, Sd: "0a0b0c"}, {Sst: 3}}}, + }, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseNGSetupRequest(initiatingValue(t, pdu, ngap.ProcNGSetup)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if msg.GlobalRANNodeID.PLMNIdentity != homePLMN { + t.Errorf("node PLMN = % x, want the primary PLMN", msg.GlobalRANNodeID.PLMNIdentity) + } + + if len(msg.SupportedTAList) != 1 { + t.Fatalf("supported TAs = %d, want 1", len(msg.SupportedTAList)) + } + + bplmns := msg.SupportedTAList[0].BroadcastPLMNList + if len(bplmns) != 2 || bplmns[0].PLMNIdentity != homePLMN || bplmns[1].PLMNIdentity != otherPLMN { + t.Fatalf("broadcast PLMNs = %+v, want primary then 310/260", bplmns) + } + + if s := bplmns[0].TAISliceSupportList; len(s) != 1 || s[0].SNSSAI.SST != 1 { + t.Errorf("primary slices = %+v, want SST 1", s) + } + + s := bplmns[1].TAISliceSupportList + if len(s) != 2 || s[0].SNSSAI.SST != 2 || s[0].SNSSAI.SD == nil || *s[0].SNSSAI.SD != (ngap.SD{0x0a, 0x0b, 0x0c}) || s[1].SNSSAI.SST != 3 { + t.Errorf("additional slices = %+v, want SST 2/0a0b0c and SST 3", s) + } +} + +func TestBuildNGSetupRequestAdditionalPLMNInheritsSlices(t *testing.T) { + pdu, err := gnb.BuildNGSetupRequest(&gnb.NGSetupRequestOpts{ + GnbID: testGnbID, Mcc: testMCC, Mnc: testMNC, Tac: testTAC, Sst: 1, Sd: "010203", + AdditionalPLMNs: []gnb.BroadcastPLMN{{Mcc: "310", Mnc: "260"}}, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseNGSetupRequest(initiatingValue(t, pdu, ngap.ProcNGSetup)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + s := msg.SupportedTAList[0].BroadcastPLMNList[1].TAISliceSupportList + if len(s) != 1 || s[0].SNSSAI.SST != 1 || s[0].SNSSAI.SD == nil { + t.Errorf("slices = %+v, want the primary SST 1/010203", s) + } +} + +func TestBuildNGSetupRequestRefusesDuplicatePLMN(t *testing.T) { + _, err := gnb.BuildNGSetupRequest(&gnb.NGSetupRequestOpts{ + GnbID: testGnbID, Mcc: testMCC, Mnc: testMNC, Tac: testTAC, Sst: 1, + AdditionalPLMNs: []gnb.BroadcastPLMN{{Mcc: testMCC, Mnc: testMNC}}, + }) + if err == nil { + t.Fatal("build accepted the primary PLMN twice") + } +} + +func TestBuildRANConfigurationUpdateBroadcastsAdditionalPLMNs(t *testing.T) { + pdu, err := gnb.BuildRANConfigurationUpdate(&gnb.RANConfigurationUpdateOpts{ + Mcc: testMCC, Mnc: testMNC, Tac: testTAC, Sst: 1, + AdditionalPLMNs: []gnb.BroadcastPLMN{{Mcc: "310", Mnc: "260"}}, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseRANConfigurationUpdate(initiatingValue(t, pdu, ngap.ProcRANConfigurationUpdate)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + bplmns := msg.SupportedTAList[0].BroadcastPLMNList + if len(bplmns) != 2 || bplmns[1].PLMNIdentity != otherPLMN { + t.Fatalf("broadcast PLMNs = %+v, want primary then 310/260", bplmns) + } +} + +func TestBuildInitialUEMessageCarriesSelectedPLMNInTAI(t *testing.T) { + pdu, err := gnb.BuildInitialUEMessage(&gnb.InitialUEMessageOpts{ + RanUENGAPID: 1, NasPDU: []byte{0x7e}, Mcc: testMCC, Mnc: testMNC, + SelectedMcc: "310", SelectedMnc: "260", Tac: testTAC, GnbID: testGnbID, + RRCEstablishmentCause: ngap.RRCCauseMOSignalling, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseInitialUEMessage(initiatingValue(t, pdu, ngap.ProcInitialUEMessage)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + uli := msg.UserLocationInformation + if uli.TAI.PLMNIdentity != otherPLMN { + t.Errorf("TAI PLMN = % x, want the selected 310/260", uli.TAI.PLMNIdentity) + } + + if uli.PLMNIdentity != homePLMN { + t.Errorf("NR CGI PLMN = % x, want the primary PLMN", uli.PLMNIdentity) + } +} + +func TestBuildInitialUEMessageDefaultsTAIToServingPLMN(t *testing.T) { + pdu, err := gnb.BuildInitialUEMessage(&gnb.InitialUEMessageOpts{ + RanUENGAPID: 1, NasPDU: []byte{0x7e}, Mcc: testMCC, Mnc: testMNC, Tac: testTAC, GnbID: testGnbID, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseInitialUEMessage(initiatingValue(t, pdu, ngap.ProcInitialUEMessage)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if msg.UserLocationInformation.TAI.PLMNIdentity != homePLMN { + t.Errorf("TAI PLMN = % x, want the primary PLMN", msg.UserLocationInformation.TAI.PLMNIdentity) + } +} + +func TestBuildUplinkNasTransportCarriesSelectedPLMNInTAI(t *testing.T) { + pdu, err := gnb.BuildUplinkNasTransport(&gnb.UplinkNasTransportOpts{ + AMFUeNgapID: 2, RANUeNgapID: 1, NasPDU: []byte{0x7e}, Mcc: testMCC, Mnc: testMNC, + SelectedMcc: "310", SelectedMnc: "260", Tac: testTAC, GnbID: testGnbID, + }) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := ngap.ParseUplinkNASTransport(initiatingValue(t, pdu, ngap.ProcUplinkNASTransport)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if msg.UserLocationInformation == nil || msg.UserLocationInformation.TAI.PLMNIdentity != otherPLMN { + t.Errorf("location = %+v, want TAI PLMN 310/260", msg.UserLocationInformation) + } +} + +func TestSelectPLMNAcceptsOnlyBroadcastPLMNs(t *testing.T) { + g := &gnb.GnodeB{MCC: testMCC, MNC: testMNC, AdditionalPLMNs: []gnb.BroadcastPLMN{{Mcc: "310", Mnc: "260"}}} + + if err := g.SelectPLMN(5, "999", "99"); err == nil { + t.Fatal("SelectPLMN accepted a PLMN the node does not broadcast") + } + + if mcc, mnc := g.SelectedPLMN(5); mcc != testMCC || mnc != testMNC { + t.Fatalf("unselected UE = %s/%s, want the primary PLMN", mcc, mnc) + } + + if err := g.SelectPLMN(5, "310", "260"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + if mcc, mnc := g.SelectedPLMN(5); mcc != "310" || mnc != "260" { + t.Fatalf("selected = %s/%s, want 310/260", mcc, mnc) + } + + if mcc, _ := g.SelectedPLMN(6); mcc != testMCC { + t.Fatalf("another UE = %s, want the primary PLMN", mcc) + } +} diff --git a/internal/tester/gnb/build_handover_notify.go b/internal/tester/gnb/build_handover_notify.go index 630088d4c9..dd2be06b05 100644 --- a/internal/tester/gnb/build_handover_notify.go +++ b/internal/tester/gnb/build_handover_notify.go @@ -12,16 +12,18 @@ type HandoverNotifyOpts struct { RANUENGAPID int64 // Location info (auto-filled from gNB if empty). - Mcc string - Mnc string - Tac string - GnbID string + Mcc string + Mnc string + SelectedMcc string + SelectedMnc string + Tac string + GnbID string } // BuildHandoverNotify encodes a HANDOVER NOTIFY PDU (TS 38.413 §8.4.3), which // the target NG-RAN node sends once the UE has arrived. func BuildHandoverNotify(opts *HandoverNotifyOpts) ([]byte, error) { - uli, err := userLocation(opts.Mcc, opts.Mnc, opts.GnbID, opts.Tac) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.GnbID, opts.Tac) if err != nil { return nil, err } diff --git a/internal/tester/gnb/build_initial_ue_message.go b/internal/tester/gnb/build_initial_ue_message.go index 6d2a7e3da2..74e752491b 100644 --- a/internal/tester/gnb/build_initial_ue_message.go +++ b/internal/tester/gnb/build_initial_ue_message.go @@ -17,6 +17,8 @@ type InitialUEMessageOpts struct { Guti5g []byte Mcc string Mnc string + SelectedMcc string + SelectedMnc string Tac string GnbID string RRCEstablishmentCause ngap.RRCEstablishmentCause @@ -48,7 +50,7 @@ func BuildInitialUEMessage(opts *InitialUEMessageOpts) ([]byte, error) { return nil, fmt.Errorf("RAN UE NGAP ID is required to build InitialUEMessage") } - uli, err := userLocation(opts.Mcc, opts.Mnc, opts.GnbID, opts.Tac) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.GnbID, opts.Tac) if err != nil { return nil, err } diff --git a/internal/tester/gnb/build_ng_setup_request.go b/internal/tester/gnb/build_ng_setup_request.go index 90d19b023a..1b2e1a3c51 100644 --- a/internal/tester/gnb/build_ng_setup_request.go +++ b/internal/tester/gnb/build_ng_setup_request.go @@ -26,6 +26,8 @@ type NGSetupRequestOpts struct { Sst int32 Sd string Slices []SliceOpt // If non-empty, overrides Sst/Sd with multiple slices + + AdditionalPLMNs []BroadcastPLMN } // gnbIDBits is the gNB-ID width this simulator advertises. NGAP allows 22..32 @@ -80,15 +82,14 @@ func BuildNGSetupRequest(opts *NGSetupRequestOpts) ([]byte, error) { return nil, fmt.Errorf("TAC is %d octets, want 3", len(tac)) } - support := make(ngap.SliceSupportList, 0, len(slices)) - - for _, s := range slices { - snssai, err := sliceToNGAP(s) - if err != nil { - return nil, err - } + support, err := sliceSupportList(slices) + if err != nil { + return nil, err + } - support = append(support, ngap.SliceSupportItem{SNSSAI: snssai}) + bplmns, err := BuildBroadcastPLMNList(plmn, support, opts.AdditionalPLMNs) + if err != nil { + return nil, err } req := &ngap.NGSetupRequest{ @@ -101,7 +102,7 @@ func BuildNGSetupRequest(opts *NGSetupRequestOpts) ([]byte, error) { RANNodeName: ngap.Ptr(opts.Name), SupportedTAList: ngap.SupportedTAList{{ TAC: ngap.TAC(uint32(tac[0])<<16 | uint32(tac[1])<<8 | uint32(tac[2])), - BroadcastPLMNList: ngap.BroadcastPLMNList{{PLMNIdentity: plmn, TAISliceSupportList: support}}, + BroadcastPLMNList: bplmns, }}, DefaultPagingDRX: ngap.Ptr(ngap.PagingDRXv128), } diff --git a/internal/tester/gnb/build_path_switch_request.go b/internal/tester/gnb/build_path_switch_request.go index d1f672e6d2..3ef1c78c5e 100644 --- a/internal/tester/gnb/build_path_switch_request.go +++ b/internal/tester/gnb/build_path_switch_request.go @@ -21,6 +21,8 @@ type PathSwitchRequestOpts struct { UESecurityCapabilities ngap.UESecurityCapabilities Mcc string Mnc string + SelectedMcc string + SelectedMnc string Tac string GnbID string } @@ -29,7 +31,7 @@ type PathSwitchRequestOpts struct { // which the target NG-RAN node sends after an Xn handover to move the downlink // tunnels of every session it took over. func BuildPathSwitchRequest(opts *PathSwitchRequestOpts) ([]byte, error) { - uli, err := userLocation(opts.Mcc, opts.Mnc, opts.GnbID, opts.Tac) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.GnbID, opts.Tac) if err != nil { return nil, err } diff --git a/internal/tester/gnb/build_pdu_session_resource_release_response.go b/internal/tester/gnb/build_pdu_session_resource_release_response.go index 0b01847acd..ecc77eff9e 100644 --- a/internal/tester/gnb/build_pdu_session_resource_release_response.go +++ b/internal/tester/gnb/build_pdu_session_resource_release_response.go @@ -15,6 +15,8 @@ type PDUSessionResourceReleaseResponseOpts struct { PDUSessionIDs []int64 Mcc string Mnc string + SelectedMcc string + SelectedMnc string GnbID string Tac string } @@ -27,7 +29,7 @@ func BuildPDUSessionResourceReleaseResponse(opts *PDUSessionResourceReleaseRespo return nil, fmt.Errorf("PDUSessionResourceReleaseResponseOpts is nil") } - uli, err := userLocation(opts.Mcc, opts.Mnc, opts.GnbID, opts.Tac) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.GnbID, opts.Tac) if err != nil { return nil, err } diff --git a/internal/tester/gnb/build_ran_configuration_update.go b/internal/tester/gnb/build_ran_configuration_update.go index 3e9a60e878..e956fc173d 100644 --- a/internal/tester/gnb/build_ran_configuration_update.go +++ b/internal/tester/gnb/build_ran_configuration_update.go @@ -23,6 +23,8 @@ type RANConfigurationUpdateOpts struct { Sst int32 Sd string Slices []SliceOpt // if set, overrides Sst/Sd + + AdditionalPLMNs []BroadcastPLMN } // BuildRANConfigurationUpdate encodes a RAN CONFIGURATION UPDATE PDU. @@ -74,20 +76,19 @@ func BuildRANConfigurationUpdate(opts *RANConfigurationUpdateOpts) ([]byte, erro slices = []SliceOpt{{Sst: opts.Sst, Sd: opts.Sd}} } - support := make(ngap.SliceSupportList, 0, len(slices)) - - for _, s := range slices { - snssai, err := sliceToNGAP(s) - if err != nil { - return nil, err - } + support, err := sliceSupportList(slices) + if err != nil { + return nil, err + } - support = append(support, ngap.SliceSupportItem{SNSSAI: snssai}) + bplmns, err := BuildBroadcastPLMNList(plmn, support, opts.AdditionalPLMNs) + if err != nil { + return nil, err } req.SupportedTAList = ngap.SupportedTAList{{ TAC: ngap.TAC(uint32(tac[0])<<16 | uint32(tac[1])<<8 | uint32(tac[2])), - BroadcastPLMNList: ngap.BroadcastPLMNList{{PLMNIdentity: plmn, TAISliceSupportList: support}}, + BroadcastPLMNList: bplmns, }} return req.Marshal() diff --git a/internal/tester/gnb/build_ue_context_release_complete.go b/internal/tester/gnb/build_ue_context_release_complete.go index 4375b951bf..543b17acbf 100644 --- a/internal/tester/gnb/build_ue_context_release_complete.go +++ b/internal/tester/gnb/build_ue_context_release_complete.go @@ -15,6 +15,8 @@ type UEContextReleaseCompleteOpts struct { PDUSessionIDs [16]bool Mcc string Mnc string + SelectedMcc string + SelectedMnc string GnbID string Tac string } @@ -32,7 +34,7 @@ func BuildUEContextReleaseComplete(opts *UEContextReleaseCompleteOpts) ([]byte, } } - uli, err := userLocation(opts.Mcc, opts.Mnc, opts.GnbID, opts.Tac) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.GnbID, opts.Tac) if err != nil { return nil, err } diff --git a/internal/tester/gnb/build_uplink_nas_transport.go b/internal/tester/gnb/build_uplink_nas_transport.go index a914acc15c..f761b255ba 100644 --- a/internal/tester/gnb/build_uplink_nas_transport.go +++ b/internal/tester/gnb/build_uplink_nas_transport.go @@ -15,6 +15,8 @@ type UplinkNasTransportOpts struct { NasPDU []byte Mcc string Mnc string + SelectedMcc string + SelectedMnc string GnbID string Tac string } @@ -36,7 +38,7 @@ func BuildUplinkNasTransport(opts *UplinkNasTransportOpts) ([]byte, error) { return nil, fmt.Errorf("NAS PDU is required to build UplinkNasTransport") } - uli, err := userLocation(opts.Mcc, opts.Mnc, opts.GnbID, opts.Tac) + uli, err := userLocation(opts.Mcc, opts.Mnc, opts.SelectedMcc, opts.SelectedMnc, opts.GnbID, opts.Tac) if err != nil { return nil, err } diff --git a/internal/tester/gnb/handle_pdu_session_resource_release_command.go b/internal/tester/gnb/handle_pdu_session_resource_release_command.go index 0383ad3e3d..7d1b6aa7bb 100644 --- a/internal/tester/gnb/handle_pdu_session_resource_release_command.go +++ b/internal/tester/gnb/handle_pdu_session_resource_release_command.go @@ -52,12 +52,16 @@ func handlePDUSessionResourceReleaseCommand(gnb *GnodeB, value []byte) error { ) } + selMcc, selMnc := gnb.explicitPLMN(ranUeNgapID) + if err := gnb.SendPDUSessionResourceReleaseResponse(&PDUSessionResourceReleaseResponseOpts{ AMFUENGAPID: amfUeNgapID, RANUENGAPID: ranUeNgapID, PDUSessionIDs: ids, Mcc: gnb.MCC, Mnc: gnb.MNC, + SelectedMcc: selMcc, + SelectedMnc: selMnc, GnbID: gnb.GnbID, Tac: gnb.TAC, }); err != nil { diff --git a/internal/tester/gnb/handle_ue_context_release_command.go b/internal/tester/gnb/handle_ue_context_release_command.go index 7750c591c7..fb171b3437 100644 --- a/internal/tester/gnb/handle_ue_context_release_command.go +++ b/internal/tester/gnb/handle_ue_context_release_command.go @@ -44,12 +44,16 @@ func handleUEContextReleaseCommand(gnb *GnodeB, value []byte) error { } } + selMcc, selMnc := gnb.explicitPLMN(ranUEID) + err = gnb.SendUEContextReleaseComplete(&UEContextReleaseCompleteOpts{ AMFUENGAPID: amfUEID, RANUENGAPID: ranUEID, PDUSessionIDs: released, Mcc: gnb.MCC, Mnc: gnb.MNC, + SelectedMcc: selMcc, + SelectedMnc: selMnc, GnbID: gnb.GnbID, Tac: gnb.TAC, }) diff --git a/internal/tester/gnb/helpers.go b/internal/tester/gnb/helpers.go index a7f975a37c..ef7ba20d0f 100644 --- a/internal/tester/gnb/helpers.go +++ b/internal/tester/gnb/helpers.go @@ -65,12 +65,17 @@ func transportLayerAddress(ip netip.Addr) (ngap.TransportLayerAddress, error) { // userLocation builds the User Location Information this simulator reports: // the NR cell it serves and the TAI that cell is in (TS 38.413 §9.3.1.16). // internal/tester/s1enb reports its E-UTRAN CGI and TAI the same way. -func userLocation(mcc, mnc, gnbID, tac string) (ngap.UserLocationInformation, error) { +func userLocation(mcc, mnc, selMcc, selMnc, gnbID, tac string) (ngap.UserLocationInformation, error) { plmn, err := PLMNIdentity(mcc, mnc) if err != nil { return ngap.UserLocationInformation{}, err } + selected, err := PLMNIdentity(selectedOrServing(mcc, mnc, selMcc, selMnc)) + if err != nil { + return ngap.UserLocationInformation{}, err + } + tacValue, err := TACValue(tac) if err != nil { return ngap.UserLocationInformation{}, err @@ -90,6 +95,6 @@ func userLocation(mcc, mnc, gnbID, tac string) (ngap.UserLocationInformation, er Kind: ngap.UserLocationNR, PLMNIdentity: plmn, CellIdentity: cellID, - TAI: ngap.TAI{PLMNIdentity: plmn, TAC: tacValue}, + TAI: ngap.TAI{PLMNIdentity: selected, TAC: tacValue}, }, nil } diff --git a/internal/tester/gnb/send.go b/internal/tester/gnb/send.go index 385d445abb..d479ade1bb 100644 --- a/internal/tester/gnb/send.go +++ b/internal/tester/gnb/send.go @@ -181,6 +181,10 @@ func (g *GnodeB) SendPathSwitchRequest(opts *PathSwitchRequestOpts) error { opts.Tac = g.TAC opts.GnbID = g.GnbID + if opts.SelectedMcc == "" { + opts.SelectedMcc, opts.SelectedMnc = g.explicitPLMN(opts.RANUENGAPID) + } + pdu, err := BuildPathSwitchRequest(opts) if err != nil { return fmt.Errorf("couldn't build PathSwitchRequest: %s", err.Error()) @@ -340,6 +344,10 @@ func (g *GnodeB) SendHandoverNotify(opts *HandoverNotifyOpts) error { opts.Tac = firstNonEmpty(opts.Tac, g.TAC) opts.GnbID = firstNonEmpty(opts.GnbID, g.GnbID) + if opts.SelectedMcc == "" { + opts.SelectedMcc, opts.SelectedMnc = g.explicitPLMN(opts.RANUENGAPID) + } + pdu, err := BuildHandoverNotify(opts) if err != nil { return fmt.Errorf("couldn't build HandoverNotify: %s", err.Error()) diff --git a/internal/tester/gnb/server.go b/internal/tester/gnb/server.go index 2fbd5baaca..b400c2c774 100644 --- a/internal/tester/gnb/server.go +++ b/internal/tester/gnb/server.go @@ -110,6 +110,7 @@ type GnodeB struct { SST int32 SD string Slices []SliceOpt // Additional slices beyond SST/SD + AdditionalPLMNs []BroadcastPLMN TAC string DNN string Name string @@ -161,6 +162,8 @@ type GnodeB struct { n2Shutdown bool n2Change chan struct{} // closed on every active-peer transition n2SetupOpts NGSetupRequestOpts + + selectedPLMNs map[int64]BroadcastPLMN } type n2Peer struct { @@ -624,10 +627,11 @@ type StartOpts struct { SST int32 SD string // Slices lists additional slices beyond SST/SD advertised in NG Setup. - Slices []SliceOpt - DNN string - TAC string - Name string + Slices []SliceOpt + AdditionalPLMNs []BroadcastPLMN + DNN string + TAC string + Name string // Ordered Ella Core N2 endpoints: the gNB uses the first as primary and // falls through to the next on failure. CoreN2Addresses []string @@ -695,6 +699,7 @@ func Start(opts *StartOpts) (*GnodeB, error) { SST: opts.SST, SD: opts.SD, Slices: opts.Slices, + AdditionalPLMNs: opts.AdditionalPLMNs, DNN: opts.DNN, TAC: opts.TAC, Name: opts.Name, @@ -717,6 +722,8 @@ func Start(opts *StartOpts) (*GnodeB, error) { Tac: opts.TAC, Name: opts.Name, Slices: opts.Slices, + + AdditionalPLMNs: opts.AdditionalPLMNs, }, } g.cond = sync.NewCond(&g.mu) @@ -1198,7 +1205,11 @@ func (g *GnodeB) Close() { } func (g *GnodeB) SendUplinkNAS(nasPDU []byte, amfUENGAPID int64, ranUENGAPID int64) error { + selMcc, selMnc := g.explicitPLMN(ranUENGAPID) + err := g.SendUplinkNASTransport(&UplinkNasTransportOpts{ + SelectedMcc: selMcc, + SelectedMnc: selMnc, AMFUeNgapID: amfUENGAPID, RANUeNgapID: ranUENGAPID, Mcc: g.MCC, @@ -1222,7 +1233,11 @@ func (g *GnodeB) SendUplinkNAS(nasPDU []byte, amfUENGAPID int64, ranUENGAPID int } func (g *GnodeB) SendInitialUEMessage(nasPDU []byte, ranUENGAPID int64, guti5G []byte, cause ngap.RRCEstablishmentCause) error { + selMcc, selMnc := g.explicitPLMN(ranUENGAPID) + opts := &InitialUEMessageOpts{ + SelectedMcc: selMcc, + SelectedMnc: selMnc, Mcc: g.MCC, Mnc: g.MNC, GnbID: g.GnbID, diff --git a/internal/tester/s1enb/attach.go b/internal/tester/s1enb/attach.go index 5c616e6202..d0fced2345 100644 --- a/internal/tester/s1enb/attach.go +++ b/internal/tester/s1enb/attach.go @@ -71,7 +71,7 @@ func (e *ENB) ReattachWithGUTI(ue *UE, guti *eps.EPSMobileIdentity, staleENBUEID return nil, err } - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) if err := e.SendInitialUEMessage(enbUEID, attachReq); err != nil { return nil, err @@ -224,7 +224,7 @@ func (e *ENB) awaitAttachAccept(ue *UE, enbUEID int64, identityRequested bool, t } func (e *ENB) attachUntilSecured(ue *UE, timeout time.Duration) (enbUEID int64, identityRequested bool, err error) { - enbUEID = e.AllocateENBUEID() + enbUEID = e.AllocateENBUEIDFor(ue) attachReq, err := ue.buildAttachRequest() if err != nil { diff --git a/internal/tester/s1enb/broadcast_plmn.go b/internal/tester/s1enb/broadcast_plmn.go new file mode 100644 index 0000000000..6325461336 --- /dev/null +++ b/internal/tester/s1enb/broadcast_plmn.go @@ -0,0 +1,75 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1enb + +import ( + "fmt" + "slices" + + "github.com/ellanetworks/core/nas" + "github.com/ellanetworks/core/s1ap" +) + +func broadcastPLMNs(primary s1ap.PLMNIdentity, additional []nas.PLMN) (s1ap.BPLMNs, error) { + out := s1ap.BPLMNs{primary} + + for _, p := range additional { + plmn, err := plmnOctets(p.MCC, p.MNC) + if err != nil { + return nil, err + } + + if slices.Contains(out, plmn) { + return nil, fmt.Errorf("s1enb: PLMN %s/%s is broadcast twice", p.MCC, p.MNC) + } + + out = append(out, plmn) + } + + return out, nil +} + +func (e *ENB) BroadcastPLMNs() s1ap.BPLMNs { + return slices.Clone(e.bplmns) +} + +func (ue *UE) SelectPLMN(mcc, mnc string) error { + plmn, err := plmnOctets(mcc, mnc) + if err != nil { + return err + } + + if !slices.Contains(ue.enb.bplmns, plmn) { + return fmt.Errorf("s1enb: PLMN %s/%s is not broadcast by eNB %#x", mcc, mnc, ue.enb.enbID) + } + + ue.selectedPLMN = &plmn + ue.plmn = append([]byte(nil), plmn[:]...) + + return nil +} + +func (e *ENB) AllocateENBUEIDFor(ue *UE) int64 { + id := e.AllocateENBUEID() + + if ue != nil && ue.selectedPLMN != nil { + e.mu.Lock() + e.selected[id] = *ue.selectedPLMN + e.mu.Unlock() + } + + return id +} + +func (e *ENB) taiFor(enbUEID int64) s1ap.TAI { + e.mu.Lock() + plmn, ok := e.selected[enbUEID] + e.mu.Unlock() + + if !ok { + plmn = e.plmn + } + + return s1ap.TAI{PLMNIdentity: plmn, TAC: s1ap.TAC(e.tac)} +} diff --git a/internal/tester/s1enb/broadcast_plmn_test.go b/internal/tester/s1enb/broadcast_plmn_test.go new file mode 100644 index 0000000000..ad6fce7943 --- /dev/null +++ b/internal/tester/s1enb/broadcast_plmn_test.go @@ -0,0 +1,122 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1enb + +import ( + "testing" + + "github.com/ellanetworks/core/nas" + "github.com/ellanetworks/core/s1ap" +) + +var ( + testHomePLMN = s1ap.PLMNIdentity{0x00, 0xf1, 0x10} + testOtherPLMN = s1ap.PLMNIdentity{0x13, 0x00, 0x62} +) + +func multiPLMNENB(t *testing.T) *ENB { + t.Helper() + + bplmns, err := broadcastPLMNs(testHomePLMN, []nas.PLMN{{MCC: "310", MNC: "260"}}) + if err != nil { + t.Fatalf("broadcastPLMNs: %v", err) + } + + return &ENB{ + enbID: 0x19b, enbIDKind: s1ap.ENBIDMacro, name: "ella", plmn: testHomePLMN, bplmns: bplmns, tac: 1, + selected: make(map[int64]s1ap.PLMNIdentity), nextENBUEID: 1, + } +} + +func initiatingValue(t *testing.T, b []byte, want s1ap.ProcedureCode) []byte { + t.Helper() + + pdu, err := s1ap.Unmarshal(b) + if err != nil { + t.Fatalf("unmarshal: %v", err) + } + + im, ok := pdu.(*s1ap.InitiatingMessage) + if !ok || im.ProcedureCode != want { + t.Fatalf("got %T, want an InitiatingMessage of procedure %d", pdu, want) + } + + return im.Value +} + +func TestS1SetupRequestBroadcastsAdditionalPLMNs(t *testing.T) { + e := multiPLMNENB(t) + + b, err := e.buildS1SetupRequest() + if err != nil { + t.Fatalf("build: %v", err) + } + + req, err := s1ap.ParseS1SetupRequest(initiatingValue(t, b, s1ap.ProcS1Setup)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if req.GlobalENBID.PLMNIdentity != testHomePLMN { + t.Errorf("Global eNB ID PLMN = % x, want the primary PLMN", req.GlobalENBID.PLMNIdentity) + } + + if len(req.SupportedTAs) != 1 { + t.Fatalf("supported TAs = %d, want 1", len(req.SupportedTAs)) + } + + got := req.SupportedTAs[0].BroadcastPLMNs + if len(got) != 2 || got[0] != testHomePLMN || got[1] != testOtherPLMN { + t.Fatalf("broadcast PLMNs = % x, want primary then 310/260", got) + } +} + +func TestBroadcastPLMNsRefusesDuplicate(t *testing.T) { + if _, err := broadcastPLMNs(testHomePLMN, []nas.PLMN{{MCC: "001", MNC: "01"}}); err == nil { + t.Fatal("accepted the primary PLMN twice") + } +} + +func TestInitialUEMessageCarriesSelectedPLMNInTAI(t *testing.T) { + e := multiPLMNENB(t) + + ue := e.NewUE("310260000000001", [16]byte{}, [16]byte{}) + + if err := ue.SelectPLMN("999", "99"); err == nil { + t.Fatal("SelectPLMN accepted a PLMN the eNB does not broadcast") + } + + if err := ue.SelectPLMN("310", "260"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + if string(ue.plmn) != string(testOtherPLMN[:]) { + t.Errorf("serving network = % x, want the selected PLMN", ue.plmn) + } + + id := e.AllocateENBUEIDFor(ue) + + b, err := e.buildInitialUEMessage(id, []byte{0x07, 0x41}) + if err != nil { + t.Fatalf("build: %v", err) + } + + msg, err := s1ap.ParseInitialUEMessage(initiatingValue(t, b, s1ap.ProcInitialUEMessage)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if msg.TAI.PLMNIdentity != testOtherPLMN { + t.Errorf("TAI PLMN = % x, want the selected 310/260", msg.TAI.PLMNIdentity) + } + + if msg.EUTRANCGI == nil || msg.EUTRANCGI.PLMNIdentity != testHomePLMN { + t.Errorf("E-UTRAN CGI = %+v, want the primary PLMN", msg.EUTRANCGI) + } + + other := e.AllocateENBUEIDFor(e.NewUE("001010000000001", [16]byte{}, [16]byte{})) + if tai := e.taiFor(other); tai.PLMNIdentity != testHomePLMN { + t.Errorf("unselected UE TAI PLMN = % x, want the primary PLMN", tai.PLMNIdentity) + } +} diff --git a/internal/tester/s1enb/handover.go b/internal/tester/s1enb/handover.go index ac278a2673..077ec21333 100644 --- a/internal/tester/s1enb/handover.go +++ b/internal/tester/s1enb/handover.go @@ -188,7 +188,7 @@ func (e *ENB) SendHandoverNotify(enbUEID, mmeUEID int64) error { MMEUES1APID: s1ap.MMEUES1APID(mmeUEID), ENBUES1APID: s1ap.ENBUES1APID(enbUEID), EUTRANCGI: s1ap.Ptr(e.eutranCGI()), - TAI: s1ap.Ptr(e.tai()), + TAI: s1ap.Ptr(e.taiFor(enbUEID)), } b, err := notify.Marshal() diff --git a/internal/tester/s1enb/idle_mobility.go b/internal/tester/s1enb/idle_mobility.go index eedcf5179c..b02b2ca9ef 100644 --- a/internal/tester/s1enb/idle_mobility.go +++ b/internal/tester/s1enb/idle_mobility.go @@ -118,7 +118,7 @@ func (ue *UE) BuildIdleTrackingAreaUpdate(opts IdleTrackingAreaUpdateOpts) ([]by } func (e *ENB) TrackingAreaUpdateFrom5GS(ue *UE, opts IdleTrackingAreaUpdateOpts, timeout time.Duration) (*AttachResult, error) { - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) wire, err := ue.BuildIdleTrackingAreaUpdate(opts) if err != nil { diff --git a/internal/tester/s1enb/lifecycle.go b/internal/tester/s1enb/lifecycle.go index 653350ed22..700314284d 100644 --- a/internal/tester/s1enb/lifecycle.go +++ b/internal/tester/s1enb/lifecycle.go @@ -129,7 +129,7 @@ func (e *ENB) serviceRequest(ue *UE, guti *eps.EPSMobileIdentity, answeringPage return nil, fmt.Errorf("s1enb: service request requires the UE's GUTI") } - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) sr, err := ue.buildServiceRequest() if err != nil { @@ -201,7 +201,7 @@ func (e *ENB) PeriodicTrackingAreaUpdate(ue *UE, guti *eps.EPSMobileIdentity, ti return fmt.Errorf("s1enb: tracking area update requires the UE's GUTI") } - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) tau, err := ue.buildTrackingAreaUpdateRequest(eps.EPSUpdateTypePeriodic, false, guti) if err != nil { @@ -240,7 +240,7 @@ func (e *ENB) TrackingAreaUpdateWithBearerStatus(ue *UE, guti *eps.EPSMobileIden return nil, fmt.Errorf("s1enb: tracking area update requires the UE's GUTI") } - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) tau, err := ue.buildTrackingAreaUpdateRequestWithBearerStatus(eps.EPSUpdateTypeTA, false, guti, status) if err != nil { diff --git a/internal/tester/s1enb/reject.go b/internal/tester/s1enb/reject.go index 9c81c53fb8..6449a43fee 100644 --- a/internal/tester/s1enb/reject.go +++ b/internal/tester/s1enb/reject.go @@ -15,7 +15,7 @@ import ( // authentication (e.g. an unknown IMSI, TS 24.301 §5.5.1.2.5), returning the EMM // cause it carries. func (e *ENB) AttachExpectReject(ue *UE, timeout time.Duration) (uint8, error) { - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) attachReq, err := ue.buildAttachRequest() if err != nil { @@ -43,7 +43,7 @@ func (e *ENB) AttachExpectReject(ue *UE, timeout time.Duration) (uint8, error) { // AUTHENTICATION REJECT, the MME's response when RES does not match (TS 24.301 // §5.4.2.5). ue must hold credentials that do not match the provisioned subscriber. func (e *ENB) AttachExpectAuthReject(ue *UE, timeout time.Duration) error { - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) attachReq, err := ue.buildAttachRequest() if err != nil { diff --git a/internal/tester/s1enb/s1ap.go b/internal/tester/s1enb/s1ap.go index 8bd37b10ba..6d66ccccce 100644 --- a/internal/tester/s1enb/s1ap.go +++ b/internal/tester/s1enb/s1ap.go @@ -81,7 +81,7 @@ func (e *ENB) buildS1SetupRequest() ([]byte, error) { }, ENBName: new(e.name), SupportedTAs: s1ap.SupportedTAs{ - {TAC: s1ap.TAC(e.tac), BroadcastPLMNs: s1ap.BPLMNs{e.plmn}}, + {TAC: s1ap.TAC(e.tac), BroadcastPLMNs: e.bplmns}, }, DefaultPagingDRX: s1ap.Ptr(s1ap.PagingDRXv32), } @@ -152,20 +152,29 @@ func (e *ENB) WaitForS1SetupFailure(timeout time.Duration) (*s1ap.S1SetupFailure // SendInitialUEMessage sends an INITIAL UE MESSAGE carrying the UE's first uplink // NAS PDU (e.g. an Attach Request), as the eNB does on RRC connection setup. func (e *ENB) SendInitialUEMessage(enbUEID int64, nas []byte) error { + b, err := e.buildInitialUEMessage(enbUEID, nas) + if err != nil { + return err + } + + return e.SendMessage(b, true) +} + +func (e *ENB) buildInitialUEMessage(enbUEID int64, nas []byte) ([]byte, error) { msg := &s1ap.InitialUEMessage{ ENBUES1APID: s1ap.ENBUES1APID(enbUEID), NASPDU: s1ap.NASPDU(nas), - TAI: e.tai(), + TAI: e.taiFor(enbUEID), EUTRANCGI: s1ap.Ptr(e.eutranCGI()), RRCEstablishmentCause: s1ap.Ptr(s1ap.RRCCauseMOSignalling), } b, err := msg.Marshal() if err != nil { - return fmt.Errorf("s1enb: build Initial UE Message: %w", err) + return nil, fmt.Errorf("s1enb: build Initial UE Message: %w", err) } - return e.SendMessage(b, true) + return b, nil } // SendInitialUEMessageWithSTMSI sends an INITIAL UE MESSAGE identified by the @@ -186,7 +195,7 @@ func (e *ENB) sendInitialUEMessageWithSTMSI(enbUEID int64, mmec uint8, mtmsi uin msg := &s1ap.InitialUEMessage{ ENBUES1APID: s1ap.ENBUES1APID(enbUEID), NASPDU: s1ap.NASPDU(nas), - TAI: e.tai(), + TAI: e.taiFor(enbUEID), EUTRANCGI: s1ap.Ptr(e.eutranCGI()), RRCEstablishmentCause: s1ap.Ptr(cause), STMSI: &s1ap.STMSI{MMEC: s1ap.MMECode(mmec), MTMSI: s1ap.MTMSI(mtmsi)}, @@ -208,7 +217,7 @@ func (e *ENB) SendUplinkNASTransport(mmeUEID, enbUEID int64, nas []byte) error { ENBUES1APID: s1ap.ENBUES1APID(enbUEID), NASPDU: s1ap.NASPDU(nas), EUTRANCGI: s1ap.Ptr(e.eutranCGI()), - TAI: s1ap.Ptr(e.tai()), + TAI: s1ap.Ptr(e.taiFor(enbUEID)), } b, err := msg.Marshal() @@ -240,7 +249,7 @@ func (e *ENB) SendPathSwitchRequest(enbUEID, sourceMMEUEID int64, erabID s1ap.ER }}, SourceMMEUES1APID: s1ap.MMEUES1APID(sourceMMEUEID), EUTRANCGI: s1ap.Ptr(e.eutranCGI()), - TAI: s1ap.Ptr(e.tai()), + TAI: s1ap.Ptr(e.taiFor(enbUEID)), UESecurityCapabilities: s1ap.Ptr(caps), } diff --git a/internal/tester/s1enb/server.go b/internal/tester/s1enb/server.go index df91b1f9bd..f4db2f7908 100644 --- a/internal/tester/s1enb/server.go +++ b/internal/tester/s1enb/server.go @@ -21,6 +21,7 @@ import ( "github.com/ellanetworks/core/internal/tester/logger" "github.com/ellanetworks/core/internal/tester/teid" + "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/s1ap" "github.com/ellanetworks/core/sctp" "go.uber.org/zap" @@ -85,6 +86,8 @@ type StartOpts struct { // SkipS1SetupWait sends the S1 Setup Request but returns without waiting for // the response, so a scenario can assert an S1 Setup Failure (TS 36.413). SkipS1SetupWait bool + + AdditionalPLMNs []nas.PLMN } // ENB is a connected S1AP eNB. Its methods are safe for concurrent use. @@ -95,6 +98,7 @@ type ENB struct { enbIDKind s1ap.ENBIDKind name string plmn s1ap.PLMNIdentity + bplmns s1ap.BPLMNs tac uint16 n3Addr net.IP // eNB S1-U endpoint reported in bearer setup @@ -118,6 +122,7 @@ type ENB struct { background sync.WaitGroup nextENBUEID int64 + selected map[int64]s1ap.PLMNIdentity nextTEID uint32 nextFwdTEID uint32 @@ -165,6 +170,11 @@ func Start(opts *StartOpts) (*ENB, error) { return nil, err } + bplmns, err := broadcastPLMNs(plmn, opts.AdditionalPLMNs) + if err != nil { + return nil, err + } + addresses := opts.CoreS1MMEAddresses if len(addresses) == 0 { addresses = []string{opts.CoreS1MMEAddress} @@ -200,6 +210,8 @@ func Start(opts *StartOpts) (*ENB, error) { enbIDKind: opts.ENBIDKind, name: opts.Name, plmn: plmn, + bplmns: bplmns, + selected: make(map[int64]s1ap.PLMNIdentity), tac: tac, n3Addr: n3IP, tunnels: make(map[uint32]*tunnel), diff --git a/internal/tester/s1enb/sms.go b/internal/tester/s1enb/sms.go index 44c4507dfe..44656584c8 100644 --- a/internal/tester/s1enb/sms.go +++ b/internal/tester/s1enb/sms.go @@ -111,7 +111,7 @@ func (e *ENB) CombinedTrackingAreaUpdate(ue *UE, guti *eps.EPSMobileIdentity, st return nil, fmt.Errorf("s1enb: tracking area update requires the UE's GUTI") } - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) tau, err := ue.buildTrackingAreaUpdateRequestWithBearerStatus(eps.EPSUpdateTypeCombinedTALA, false, guti, status) if err != nil { diff --git a/internal/tester/s1enb/tau_reject.go b/internal/tester/s1enb/tau_reject.go index 2db19ea5d5..a9caa11d11 100644 --- a/internal/tester/s1enb/tau_reject.go +++ b/internal/tester/s1enb/tau_reject.go @@ -59,7 +59,7 @@ func (e *ENB) TrackingAreaUpdateRejected(ue *UE, guti eps.EPSMobileIdentity, tim return nil, err } - enbUEID := e.AllocateENBUEID() + enbUEID := e.AllocateENBUEIDFor(ue) if err := e.SendInitialUEMessageWithSTMSI(enbUEID, guti.GUTI.MMECode, binary.BigEndian.Uint32(guti.GUTI.TMSI[:]), tau); err != nil { return nil, err diff --git a/internal/tester/s1enb/ue.go b/internal/tester/s1enb/ue.go index 668d484712..a4d478fa6a 100644 --- a/internal/tester/s1enb/ue.go +++ b/internal/tester/s1enb/ue.go @@ -77,6 +77,7 @@ type UE struct { sqn []byte resyncs int resyncPending bool + selectedPLMN *s1ap.PLMNIdentity } func (e *ENB) NewUE(imsi string, k, opc [16]byte) *UE { diff --git a/ngap/enum_names.go b/ngap/enum_names.go index a6432c052e..b5c75875cb 100644 --- a/ngap/enum_names.go +++ b/ngap/enum_names.go @@ -131,3 +131,24 @@ var handoverTypeNames = map[HandoverType]string{ } func (h HandoverType) Name() string { return handoverTypeNames[h] } + +var overloadActionNames = map[OverloadAction]string{ + OverloadActionRejectNonEmergencyMODT: "reject-non-emergency-mo-dt", + OverloadActionRejectRRCCRSignalling: "reject-rrc-cr-signalling", + OverloadActionPermitEmergencySessionsAndMTServicesOnly: "permit-emergency-sessions-and-mobile-terminated-services-only", + OverloadActionPermitHighPrioritySessionsAndMTServicesOnly: "permit-high-priority-sessions-and-mobile-terminated-services-only", +} + +func (a OverloadAction) Name() string { return overloadActionNames[a] } + +var concurrentWarningMessageIndNames = map[ConcurrentWarningMessageInd]string{ + ConcurrentWarningMessageIndTrue: "true", +} + +func (c ConcurrentWarningMessageInd) Name() string { return concurrentWarningMessageIndNames[c] } + +var cancelAllWarningMessagesNames = map[CancelAllWarningMessages]string{ + CancelAllWarningMessagesTrue: "true", +} + +func (c CancelAllWarningMessages) Name() string { return cancelAllWarningMessagesNames[c] } diff --git a/ngap/enum_names_test.go b/ngap/enum_names_test.go index 2201343c1f..4ec323555e 100644 --- a/ngap/enum_names_test.go +++ b/ngap/enum_names_test.go @@ -39,6 +39,13 @@ func TestEnumNames(t *testing.T) { {"UEContextRequested", UEContextRequested.Name(), "requested"}, {"UEContextRequest(9)", UEContextRequest(9).Name(), ""}, + {"OverloadActionRejectRRCCRSignalling", OverloadActionRejectRRCCRSignalling.Name(), "reject-rrc-cr-signalling"}, + {"OverloadAction(9)", OverloadAction(9).Name(), ""}, + + {"ConcurrentWarningMessageIndTrue", ConcurrentWarningMessageIndTrue.Name(), "true"}, + {"CancelAllWarningMessagesTrue", CancelAllWarningMessagesTrue.Name(), "true"}, + {"CancelAllWarningMessages(9)", CancelAllWarningMessages(9).Name(), ""}, + {"UERetentionUesRetained", UERetentionUesRetained.Name(), "ues-retained"}, {"UERetentionInformation(9)", UERetentionInformation(9).Name(), ""}, diff --git a/ngap/ie_ids.go b/ngap/ie_ids.go index 426e63b040..b867cbe2f9 100644 --- a/ngap/ie_ids.go +++ b/ngap/ie_ids.go @@ -164,6 +164,8 @@ const ( IDENDCSONConfigurationTransferDL ProtocolIEID = 157 IDENDCSONConfigurationTransferUL ProtocolIEID = 158 IDNGRANTNLAssociationToRemoveList ProtocolIEID = 167 + IDSourceToTargetAMFInformationReroute ProtocolIEID = 171 IDTargettoSourceFailureTransparentContainer ProtocolIEID = 262 IDNotifySourceNGRANNode ProtocolIEID = 269 + IDPartiallyAllowedNSSAI ProtocolIEID = 414 ) diff --git a/ngap/ie_names.go b/ngap/ie_names.go index 91eee4de06..08ec3f2de8 100644 --- a/ngap/ie_names.go +++ b/ngap/ie_names.go @@ -172,8 +172,10 @@ var protocolIENames = map[ProtocolIEID]string{ IDENDCSONConfigurationTransferDL: "ENDC-SONConfigurationTransferDL", IDENDCSONConfigurationTransferUL: "ENDC-SONConfigurationTransferUL", IDNGRANTNLAssociationToRemoveList: "NGRAN-TNLAssociationToRemoveList", + IDSourceToTargetAMFInformationReroute: "SourceToTarget-AMFInformationReroute", IDTargettoSourceFailureTransparentContainer: "TargettoSource-Failure-TransparentContainer", IDNotifySourceNGRANNode: "NotifySourceNGRANNode", + IDPartiallyAllowedNSSAI: "Partially-Allowed-NSSAI", } // ProtocolIEIDName returns the TS 38.413 name of id, and whether it is known. diff --git a/ngap/ie_pws.go b/ngap/ie_pws.go new file mode 100644 index 0000000000..3c4c9405d1 --- /dev/null +++ b/ngap/ie_pws.go @@ -0,0 +1,811 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "fmt" + + "github.com/ellanetworks/core/per" +) + +const ( + maxnoofCellIDforWarning = 65535 + maxnoofTAIforWarning = 65535 + maxnoofEmergencyAreaID = 65535 + maxnoofCellinTAI = 65535 + maxnoofCellinEAI = 65535 + maxnoofCellsinngeNB = 256 + maxnoofCellsingNB = 16384 +) + +const ( + messageIdentifierBits = 16 + serialNumberBits = 16 + dataCodingSchemeBits = 8 + repetitionPeriodMax = 131071 + warningMessageMaxLen = 9600 + warningCoordinatesMax = 1024 + warningSecurityLen = 50 +) + +type NRCellIdentity uint64 + +func (c NRCellIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(c), NRCellIdentityBits) +} + +func (c *NRCellIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, NRCellIdentityBits) + if err != nil { + return err + } + + *c = NRCellIdentity(v) + + return nil +} + +type EUTRACellIdentity uint32 + +func (c EUTRACellIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(c), EUTRACellIdentityBits) +} + +func (c *EUTRACellIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, EUTRACellIdentityBits) + if err != nil { + return err + } + + *c = EUTRACellIdentity(v) + + return nil +} + +// TS 38.413 §9.3.1.7. +type NRCGI struct { + _ [0]struct{} `per:"extseq"` + PLMNIdentity PLMNIdentity + NRCellIdentity NRCellIdentity + _ ieExtensions `per:",skip"` +} + +// TS 38.413 §9.3.1.9. +type EUTRACGI struct { + _ [0]struct{} `per:"extseq"` + PLMNIdentity PLMNIdentity + EUTRACellIdentity EUTRACellIdentity + _ ieExtensions `per:",skip"` +} + +// TS 38.413 §9.3.1.35. +type MessageIdentifier uint16 + +func (m MessageIdentifier) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(m), messageIdentifierBits) +} + +func (m *MessageIdentifier) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, messageIdentifierBits) + if err != nil { + return err + } + + *m = MessageIdentifier(v) + + return nil +} + +// TS 38.413 §9.3.1.36. +type SerialNumber uint16 + +func (s SerialNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(s), serialNumberBits) +} + +func (s *SerialNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, serialNumberBits) + if err != nil { + return err + } + + *s = SerialNumber(v) + + return nil +} + +// TS 38.413 §9.3.1.49. +type RepetitionPeriod uint32 + +func (p RepetitionPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: repetitionPeriodMax, HasUB: true}, int64(p)) +} + +func (p *RepetitionPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: repetitionPeriodMax, HasUB: true}) + if err != nil { + return err + } + + *p = RepetitionPeriod(v) + + return nil +} + +// TS 38.413 §9.3.1.38. +type NumberOfBroadcastsRequested uint16 + +func (n NumberOfBroadcastsRequested) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(n)) +} + +func (n *NumberOfBroadcastsRequested) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + + *n = NumberOfBroadcastsRequested(v) + + return nil +} + +// TS 38.413 §9.3.1.39. +type WarningType [2]byte + +func (t WarningType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 2, 2, true, true, false, t[:]) +} + +func (t *WarningType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) + if err != nil { + return err + } + + copy(t[:], b) + + return nil +} + +type WarningSecurityInfo [warningSecurityLen]byte + +func (s WarningSecurityInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, warningSecurityLen, warningSecurityLen, true, true, false, s[:]) +} + +func (s *WarningSecurityInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, warningSecurityLen, warningSecurityLen, true, true, false) + if err != nil { + return err + } + + copy(s[:], b) + + return nil +} + +// TS 38.413 §9.3.1.41. +type DataCodingScheme uint8 + +func (d DataCodingScheme) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(d), dataCodingSchemeBits) +} + +func (d *DataCodingScheme) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, dataCodingSchemeBits) + if err != nil { + return err + } + + *d = DataCodingScheme(v) + + return nil +} + +// TS 38.413 §9.3.1.42. +type WarningMessageContents []byte + +func (c WarningMessageContents) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, warningMessageMaxLen, true, true, false, c) +} + +func (c *WarningMessageContents) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, warningMessageMaxLen, true, true, false) + if err != nil { + return err + } + + *c = b + + return nil +} + +// TS 38.413 §9.3.1.112. +type WarningAreaCoordinates []byte + +func (c WarningAreaCoordinates) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, warningCoordinatesMax, true, true, false, c) +} + +func (c *WarningAreaCoordinates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, warningCoordinatesMax, true, true, false) + if err != nil { + return err + } + + *c = b + + return nil +} + +// TS 38.413 §9.3.1.46. +type ConcurrentWarningMessageInd uint8 + +const ( + ConcurrentWarningMessageIndTrue ConcurrentWarningMessageInd = iota + + concurrentWarningMessageIndRootCount = 1 +) + +func (c ConcurrentWarningMessageInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, concurrentWarningMessageIndRootCount, int64(c), "ConcurrentWarningMessageInd") +} + +func (c *ConcurrentWarningMessageInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeRootEnumerated(r, enc, concurrentWarningMessageIndRootCount, "ConcurrentWarningMessageInd") + if err != nil { + return err + } + + *c = ConcurrentWarningMessageInd(v) + + return nil +} + +// TS 38.413 §9.3.1.48. +type EmergencyAreaID [3]byte + +func (e EmergencyAreaID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 3, 3, true, true, false, e[:]) +} + +func (e *EmergencyAreaID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 3, 3, true, true, false) + if err != nil { + return err + } + + copy(e[:], b) + + return nil +} + +func chosenAlternative(choice string, set ...bool) (int64, error) { + idx := int64(-1) + + for i, s := range set { + if !s { + continue + } + + if idx >= 0 { + return 0, fmt.Errorf("ngap: %s has more than one alternative set", choice) + } + + idx = int64(i) + } + + if idx < 0 { + return 0, fmt.Errorf("ngap: %s has no alternative set", choice) + } + + return idx, nil +} + +const ( + warningAreaListEUTRACGI = iota + warningAreaListNRCGI + warningAreaListTAI + warningAreaListEmergencyAreaID + warningAreaListChoiceExtensions + + warningAreaListAlternatives = 5 +) + +// TS 38.413 §9.3.1.37. +type WarningAreaList struct { + EUTRACGIs []EUTRACGI + NRCGIs []NRCGI + TAIs []TAI + EmergencyAreaIDs []EmergencyAreaID +} + +func (l WarningAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := chosenAlternative("WarningAreaList", len(l.EUTRACGIs) > 0, len(l.NRCGIs) > 0, len(l.TAIs) > 0, len(l.EmergencyAreaIDs) > 0) + if err != nil { + return err + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, warningAreaListAlternatives-1, idx); err != nil { + return err + } + + switch idx { + case warningAreaListEUTRACGI: + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.EUTRACGIs) + case warningAreaListNRCGI: + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.NRCGIs) + case warningAreaListTAI: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIs) + default: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDs) + } +} + +func (l *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, warningAreaListAlternatives-1) + if err != nil { + return fmt.Errorf("ngap: WarningAreaList choice: %w", err) + } + + var v WarningAreaList + + switch idx { + case warningAreaListEUTRACGI: + v.EUTRACGIs, err = unmarshalSeqOf[EUTRACGI](r, enc, 1, maxnoofCellIDforWarning) + case warningAreaListNRCGI: + v.NRCGIs, err = unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellIDforWarning) + case warningAreaListTAI: + v.TAIs, err = unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforWarning) + case warningAreaListEmergencyAreaID: + v.EmergencyAreaIDs, err = unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofEmergencyAreaID) + case warningAreaListChoiceExtensions: + return decodeChoiceExtension(r, enc, "WarningAreaList") + } + + if err != nil { + return err + } + + *l = v + + return nil +} + +type CellIDBroadcastEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EUTRACGI EUTRACGI + _ ieExtensions `per:",skip"` +} + +type CompletedCellsInTAIEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EUTRACGI EUTRACGI + _ ieExtensions `per:",skip"` +} + +type TAIBroadcastEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + TAI TAI + CompletedCellsInTAI []CompletedCellsInTAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CompletedCellsInEAIEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EUTRACGI EUTRACGI + _ ieExtensions `per:",skip"` +} + +type EmergencyAreaIDBroadcastEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EmergencyAreaID EmergencyAreaID + CompletedCellsInEAI []CompletedCellsInEAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CellIDBroadcastNRItem struct { + _ [0]struct{} `per:"extseq"` + NRCGI NRCGI + _ ieExtensions `per:",skip"` +} + +type CompletedCellsInTAINRItem struct { + _ [0]struct{} `per:"extseq"` + NRCGI NRCGI + _ ieExtensions `per:",skip"` +} + +type TAIBroadcastNRItem struct { + _ [0]struct{} `per:"extseq"` + TAI TAI + CompletedCellsInTAI []CompletedCellsInTAINRItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CompletedCellsInEAINRItem struct { + _ [0]struct{} `per:"extseq"` + NRCGI NRCGI + _ ieExtensions `per:",skip"` +} + +type EmergencyAreaIDBroadcastNRItem struct { + _ [0]struct{} `per:"extseq"` + EmergencyAreaID EmergencyAreaID + CompletedCellsInEAI []CompletedCellsInEAINRItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +const ( + broadcastAreaCellIDEUTRA = iota + broadcastAreaTAIEUTRA + broadcastAreaEmergencyAreaIDEUTRA + broadcastAreaCellIDNR + broadcastAreaTAINR + broadcastAreaEmergencyAreaIDNR + broadcastAreaChoiceExtensions + + broadcastAreaAlternatives = 7 +) + +// TS 38.413 §9.3.1.43. +type BroadcastCompletedAreaList struct { + CellIDBroadcastEUTRA []CellIDBroadcastEUTRAItem + TAIBroadcastEUTRA []TAIBroadcastEUTRAItem + EmergencyAreaIDBroadcastEUTRA []EmergencyAreaIDBroadcastEUTRAItem + CellIDBroadcastNR []CellIDBroadcastNRItem + TAIBroadcastNR []TAIBroadcastNRItem + EmergencyAreaIDBroadcastNR []EmergencyAreaIDBroadcastNRItem +} + +func (l BroadcastCompletedAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := chosenAlternative("BroadcastCompletedAreaList", + len(l.CellIDBroadcastEUTRA) > 0, len(l.TAIBroadcastEUTRA) > 0, len(l.EmergencyAreaIDBroadcastEUTRA) > 0, + len(l.CellIDBroadcastNR) > 0, len(l.TAIBroadcastNR) > 0, len(l.EmergencyAreaIDBroadcastNR) > 0) + if err != nil { + return err + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, broadcastAreaAlternatives-1, idx); err != nil { + return err + } + + switch idx { + case broadcastAreaCellIDEUTRA: + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDBroadcastEUTRA) + case broadcastAreaTAIEUTRA: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIBroadcastEUTRA) + case broadcastAreaEmergencyAreaIDEUTRA: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDBroadcastEUTRA) + case broadcastAreaCellIDNR: + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDBroadcastNR) + case broadcastAreaTAINR: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIBroadcastNR) + default: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDBroadcastNR) + } +} + +func (l *BroadcastCompletedAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, broadcastAreaAlternatives-1) + if err != nil { + return fmt.Errorf("ngap: BroadcastCompletedAreaList choice: %w", err) + } + + var v BroadcastCompletedAreaList + + switch idx { + case broadcastAreaCellIDEUTRA: + v.CellIDBroadcastEUTRA, err = unmarshalSeqOf[CellIDBroadcastEUTRAItem](r, enc, 1, maxnoofCellIDforWarning) + case broadcastAreaTAIEUTRA: + v.TAIBroadcastEUTRA, err = unmarshalSeqOf[TAIBroadcastEUTRAItem](r, enc, 1, maxnoofTAIforWarning) + case broadcastAreaEmergencyAreaIDEUTRA: + v.EmergencyAreaIDBroadcastEUTRA, err = unmarshalSeqOf[EmergencyAreaIDBroadcastEUTRAItem](r, enc, 1, maxnoofEmergencyAreaID) + case broadcastAreaCellIDNR: + v.CellIDBroadcastNR, err = unmarshalSeqOf[CellIDBroadcastNRItem](r, enc, 1, maxnoofCellIDforWarning) + case broadcastAreaTAINR: + v.TAIBroadcastNR, err = unmarshalSeqOf[TAIBroadcastNRItem](r, enc, 1, maxnoofTAIforWarning) + case broadcastAreaEmergencyAreaIDNR: + v.EmergencyAreaIDBroadcastNR, err = unmarshalSeqOf[EmergencyAreaIDBroadcastNRItem](r, enc, 1, maxnoofEmergencyAreaID) + case broadcastAreaChoiceExtensions: + return decodeChoiceExtension(r, enc, "BroadcastCompletedAreaList") + } + + if err != nil { + return err + } + + *l = v + + return nil +} + +// TS 38.413 §9.3.1.47. +type CancelAllWarningMessages uint8 + +const ( + CancelAllWarningMessagesTrue CancelAllWarningMessages = iota + + cancelAllWarningMessagesRootCount = 1 +) + +func (c CancelAllWarningMessages) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, cancelAllWarningMessagesRootCount, int64(c), "CancelAllWarningMessages") +} + +func (c *CancelAllWarningMessages) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeRootEnumerated(r, enc, cancelAllWarningMessagesRootCount, "CancelAllWarningMessages") + if err != nil { + return err + } + + *c = CancelAllWarningMessages(v) + + return nil +} + +type CellIDCancelledEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EUTRACGI EUTRACGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type CancelledCellsInTAIEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EUTRACGI EUTRACGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type TAICancelledEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + TAI TAI + CancelledCellsInTAI []CancelledCellsInTAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CancelledCellsInEAIEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EUTRACGI EUTRACGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type EmergencyAreaIDCancelledEUTRAItem struct { + _ [0]struct{} `per:"extseq"` + EmergencyAreaID EmergencyAreaID + CancelledCellsInEAI []CancelledCellsInEAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CellIDCancelledNRItem struct { + _ [0]struct{} `per:"extseq"` + NRCGI NRCGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type CancelledCellsInTAINRItem struct { + _ [0]struct{} `per:"extseq"` + NRCGI NRCGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type TAICancelledNRItem struct { + _ [0]struct{} `per:"extseq"` + TAI TAI + CancelledCellsInTAI []CancelledCellsInTAINRItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CancelledCellsInEAINRItem struct { + _ [0]struct{} `per:"extseq"` + NRCGI NRCGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type EmergencyAreaIDCancelledNRItem struct { + _ [0]struct{} `per:"extseq"` + EmergencyAreaID EmergencyAreaID + CancelledCellsInEAI []CancelledCellsInEAINRItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +// TS 38.413 §9.3.1.44. +type BroadcastCancelledAreaList struct { + CellIDCancelledEUTRA []CellIDCancelledEUTRAItem + TAICancelledEUTRA []TAICancelledEUTRAItem + EmergencyAreaIDCancelledEUTRA []EmergencyAreaIDCancelledEUTRAItem + CellIDCancelledNR []CellIDCancelledNRItem + TAICancelledNR []TAICancelledNRItem + EmergencyAreaIDCancelledNR []EmergencyAreaIDCancelledNRItem +} + +func (l BroadcastCancelledAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := chosenAlternative("BroadcastCancelledAreaList", + len(l.CellIDCancelledEUTRA) > 0, len(l.TAICancelledEUTRA) > 0, len(l.EmergencyAreaIDCancelledEUTRA) > 0, + len(l.CellIDCancelledNR) > 0, len(l.TAICancelledNR) > 0, len(l.EmergencyAreaIDCancelledNR) > 0) + if err != nil { + return err + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, broadcastAreaAlternatives-1, idx); err != nil { + return err + } + + switch idx { + case broadcastAreaCellIDEUTRA: + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDCancelledEUTRA) + case broadcastAreaTAIEUTRA: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAICancelledEUTRA) + case broadcastAreaEmergencyAreaIDEUTRA: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDCancelledEUTRA) + case broadcastAreaCellIDNR: + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDCancelledNR) + case broadcastAreaTAINR: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAICancelledNR) + default: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDCancelledNR) + } +} + +func (l *BroadcastCancelledAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, broadcastAreaAlternatives-1) + if err != nil { + return fmt.Errorf("ngap: BroadcastCancelledAreaList choice: %w", err) + } + + var v BroadcastCancelledAreaList + + switch idx { + case broadcastAreaCellIDEUTRA: + v.CellIDCancelledEUTRA, err = unmarshalSeqOf[CellIDCancelledEUTRAItem](r, enc, 1, maxnoofCellIDforWarning) + case broadcastAreaTAIEUTRA: + v.TAICancelledEUTRA, err = unmarshalSeqOf[TAICancelledEUTRAItem](r, enc, 1, maxnoofTAIforWarning) + case broadcastAreaEmergencyAreaIDEUTRA: + v.EmergencyAreaIDCancelledEUTRA, err = unmarshalSeqOf[EmergencyAreaIDCancelledEUTRAItem](r, enc, 1, maxnoofEmergencyAreaID) + case broadcastAreaCellIDNR: + v.CellIDCancelledNR, err = unmarshalSeqOf[CellIDCancelledNRItem](r, enc, 1, maxnoofCellIDforWarning) + case broadcastAreaTAINR: + v.TAICancelledNR, err = unmarshalSeqOf[TAICancelledNRItem](r, enc, 1, maxnoofTAIforWarning) + case broadcastAreaEmergencyAreaIDNR: + v.EmergencyAreaIDCancelledNR, err = unmarshalSeqOf[EmergencyAreaIDCancelledNRItem](r, enc, 1, maxnoofEmergencyAreaID) + case broadcastAreaChoiceExtensions: + return decodeChoiceExtension(r, enc, "BroadcastCancelledAreaList") + } + + if err != nil { + return err + } + + *l = v + + return nil +} + +const ( + maxnoofTAIforRestart = 2048 + maxnoofEAIforRestart = 256 +) + +const ( + cellListEUTRA = iota + cellListNR + cellListChoiceExtensions + + cellListAlternatives = 3 +) + +func marshalCellList(w *per.Writer, enc per.Encoding, choice string, eutra []EUTRACGI, nr []NRCGI) error { + idx, err := chosenAlternative(choice, len(eutra) > 0, len(nr) > 0) + if err != nil { + return err + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, cellListAlternatives-1, idx); err != nil { + return err + } + + if idx == cellListEUTRA { + return marshalSeqOf(w, enc, 1, maxnoofCellsinngeNB, eutra) + } + + return marshalSeqOf(w, enc, 1, maxnoofCellsingNB, nr) +} + +func unmarshalCellList(r *per.Reader, enc per.Encoding, choice string) ([]EUTRACGI, []NRCGI, error) { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, cellListAlternatives-1) + if err != nil { + return nil, nil, fmt.Errorf("ngap: %s choice: %w", choice, err) + } + + switch idx { + case cellListEUTRA: + eutra, err := unmarshalSeqOf[EUTRACGI](r, enc, 1, maxnoofCellsinngeNB) + return eutra, nil, err + case cellListNR: + nr, err := unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellsingNB) + return nil, nr, err + default: + return nil, nil, decodeChoiceExtension(r, enc, choice) + } +} + +type CellIDListForRestart struct { + EUTRACGIs []EUTRACGI + NRCGIs []NRCGI +} + +func (l CellIDListForRestart) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalCellList(w, enc, "CellIDListForRestart", l.EUTRACGIs, l.NRCGIs) +} + +func (l *CellIDListForRestart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + eutra, nr, err := unmarshalCellList(r, enc, "CellIDListForRestart") + if err != nil { + return err + } + + *l = CellIDListForRestart{EUTRACGIs: eutra, NRCGIs: nr} + + return nil +} + +type TAIListForRestart []TAI + +func (l TAIListForRestart) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforRestart, []TAI(l)) +} + +func (l *TAIListForRestart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforRestart) + if err != nil { + return err + } + + *l = items + + return nil +} + +type EmergencyAreaIDListForRestart []EmergencyAreaID + +func (l EmergencyAreaIDListForRestart) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEAIforRestart, []EmergencyAreaID(l)) +} + +func (l *EmergencyAreaIDListForRestart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofEAIforRestart) + if err != nil { + return err + } + + *l = items + + return nil +} + +type PWSFailedCellIDList struct { + EUTRACGIs []EUTRACGI + NRCGIs []NRCGI +} + +func (l PWSFailedCellIDList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalCellList(w, enc, "PWSFailedCellIDList", l.EUTRACGIs, l.NRCGIs) +} + +func (l *PWSFailedCellIDList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + eutra, nr, err := unmarshalCellList(r, enc, "PWSFailedCellIDList") + if err != nil { + return err + } + + *l = PWSFailedCellIDList{EUTRACGIs: eutra, NRCGIs: nr} + + return nil +} diff --git a/ngap/ng_reset.go b/ngap/ng_reset.go index 15b7fca371..d4becba746 100644 --- a/ngap/ng_reset.go +++ b/ngap/ng_reset.go @@ -29,10 +29,10 @@ const resetAllRootCount = 1 // TS 38.413 §9.3.3.25. Both identities are optional; an item may carry either // or both. type UEAssociatedLogicalNGConnectionItem struct { - _ [0]struct{} `per:"extseq"` - AMFUENGAPID *AMFUENGAPID `per:",optional"` - RANUENGAPID *RANUENGAPID `per:",optional"` - _ ieExtensions `per:",skip"` + AMFUENGAPID *AMFUENGAPID `per:",optional"` + RANUENGAPID *RANUENGAPID `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // UEAssociatedLogicalNGConnectionList ::= SEQUENCE (SIZE(1.. diff --git a/ngap/overload.go b/ngap/overload.go new file mode 100644 index 0000000000..0ba94da250 --- /dev/null +++ b/ngap/overload.go @@ -0,0 +1,246 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "fmt" + + "github.com/ellanetworks/core/per" +) + +// TS 38.413 §9.3.1.105. +type OverloadAction uint8 + +const ( + OverloadActionRejectNonEmergencyMODT OverloadAction = iota + OverloadActionRejectRRCCRSignalling + OverloadActionPermitEmergencySessionsAndMTServicesOnly + OverloadActionPermitHighPrioritySessionsAndMTServicesOnly + + overloadActionRootCount = 4 +) + +func (a OverloadAction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, overloadActionRootCount, int64(a), "OverloadAction") +} + +func (a *OverloadAction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeRootEnumerated(r, enc, overloadActionRootCount, "OverloadAction") + if err != nil { + return err + } + + *a = OverloadAction(v) + + return nil +} + +const ( + overloadResponseOverloadAction = iota + overloadResponseChoiceExtensions + + overloadResponseAlternatives = 2 +) + +// TS 38.413 §9.3.1.104. +type OverloadResponse struct { + OverloadAction OverloadAction +} + +func (o OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, overloadResponseAlternatives-1, overloadResponseOverloadAction); err != nil { + return err + } + + return o.OverloadAction.MarshalPER(w, enc) +} + +func (o *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, overloadResponseAlternatives-1) + if err != nil { + return fmt.Errorf("ngap: OverloadResponse choice: %w", err) + } + + if idx == overloadResponseChoiceExtensions { + return decodeChoiceExtension(r, enc, "OverloadResponse") + } + + return o.OverloadAction.UnmarshalPER(r, enc) +} + +const ( + trafficLoadReductionMin = 1 + trafficLoadReductionMax = 99 +) + +// TS 38.413 §9.3.1.106. +type TrafficLoadReductionIndication uint8 + +func (t TrafficLoadReductionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: trafficLoadReductionMin, HasLB: true, UB: trafficLoadReductionMax, HasUB: true}, int64(t)) +} + +func (t *TrafficLoadReductionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: trafficLoadReductionMin, HasLB: true, UB: trafficLoadReductionMax, HasUB: true}) + if err != nil { + return err + } + + *t = TrafficLoadReductionIndication(v) + + return nil +} + +type SliceOverloadItem struct { + _ [0]struct{} `per:"extseq"` + SNSSAI SNSSAI + _ ieExtensions `per:",skip"` +} + +type OverloadStartNSSAIItem struct { + _ [0]struct{} `per:"extseq"` + SliceOverloadList []SliceOverloadItem `per:"SEQUENCE-OF,size:1..1024"` + SliceOverloadResponse *OverloadResponse `per:",optional"` + SliceTrafficLoadReductionIndication *TrafficLoadReductionIndication `per:",optional"` + _ ieExtensions `per:",skip"` +} + +type OverloadStartNSSAIList []OverloadStartNSSAIItem + +func (l OverloadStartNSSAIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofSliceItems, []OverloadStartNSSAIItem(l)) +} + +func (l *OverloadStartNSSAIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[OverloadStartNSSAIItem](r, enc, 1, maxnoofSliceItems) + if err != nil { + return err + } + + *l = items + + return nil +} + +// TS 38.413 §9.2.6.14. +type OverloadStart struct { + AMFOverloadResponse *OverloadResponse + AMFTrafficLoadReductionIndication *TrafficLoadReductionIndication + OverloadStartNSSAIList OverloadStartNSSAIList + + messageMeta +} + +var overloadStartIEs = []ieSpec[OverloadStart]{ + { + id: IDAMFOverloadResponse, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + var v OverloadResponse + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.AMFOverloadResponse = &v + + return nil + }, + encode: func(m *OverloadStart) (per.Marshaler, bool) { + if m.AMFOverloadResponse == nil { + return nil, false + } + + return m.AMFOverloadResponse, true + }, + }, + { + id: IDAMFTrafficLoadReductionIndication, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + var v TrafficLoadReductionIndication + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.AMFTrafficLoadReductionIndication = &v + + return nil + }, + encode: func(m *OverloadStart) (per.Marshaler, bool) { + if m.AMFTrafficLoadReductionIndication == nil { + return nil, false + } + + return m.AMFTrafficLoadReductionIndication, true + }, + }, + { + id: IDOverloadStartNSSAIList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.OverloadStartNSSAIList) + }, + encode: func(m *OverloadStart) (per.Marshaler, bool) { + if len(m.OverloadStartNSSAIList) == 0 { + return nil, false + } + + return m.OverloadStartNSSAIList, true + }, + }, +} + +func (m *OverloadStart) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcOverloadStart, overloadStartIEs, m) +} + +func (m *OverloadStart) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcOverloadStart, + Criticality: CriticalityIgnore, + Value: w.Bytes(), + }) +} + +func ParseOverloadStart(value []byte) (*OverloadStart, error) { + return parseMessageBody[OverloadStart](ProcOverloadStart, TriggeringInitiatingMessage, overloadStartIEs, value) +} + +// TS 38.413 §9.2.6.15. +type OverloadStop struct { + messageMeta +} + +var overloadStopIEs = []ieSpec[OverloadStop]{} + +func (m *OverloadStop) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcOverloadStop, overloadStopIEs, m) +} + +func (m *OverloadStop) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcOverloadStop, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseOverloadStop(value []byte) (*OverloadStop, error) { + return parseMessageBody[OverloadStop](ProcOverloadStop, TriggeringInitiatingMessage, overloadStopIEs, value) +} diff --git a/ngap/parsers.go b/ngap/parsers.go index bb80de5dc3..2e74a27c39 100644 --- a/ngap/parsers.go +++ b/ngap/parsers.go @@ -13,6 +13,7 @@ var messageParsers = []messageParser{ {"ParseAMFStatusIndication", func(v []byte) error { _, err := ParseAMFStatusIndication(v); return err }}, {"ParseErrorIndication", func(v []byte) error { _, err := ParseErrorIndication(v); return err }}, {"ParseNGReset", func(v []byte) error { _, err := ParseNGReset(v); return err }}, + {"ParseRawPDU", func(v []byte) error { _, err := ParseRawPDU(v); return err }}, {"ParseNGResetAcknowledge", func(v []byte) error { _, err := ParseNGResetAcknowledge(v); return err }}, {"ParseNGSetupFailure", func(v []byte) error { _, err := ParseNGSetupFailure(v); return err }}, {"ParseNGSetupRequest", func(v []byte) error { _, err := ParseNGSetupRequest(v); return err }}, @@ -233,4 +234,13 @@ var transferParsers = []messageParser{ _, err := ParsePathSwitchRequestSetupFailedTransfer(v) return err }}, + {"ParseOverloadStart", func(v []byte) error { _, err := ParseOverloadStart(v); return err }}, + {"ParseOverloadStop", func(v []byte) error { _, err := ParseOverloadStop(v); return err }}, + {"ParseWriteReplaceWarningRequest", func(v []byte) error { _, err := ParseWriteReplaceWarningRequest(v); return err }}, + {"ParseWriteReplaceWarningResponse", func(v []byte) error { _, err := ParseWriteReplaceWarningResponse(v); return err }}, + {"ParsePWSCancelRequest", func(v []byte) error { _, err := ParsePWSCancelRequest(v); return err }}, + {"ParsePWSCancelResponse", func(v []byte) error { _, err := ParsePWSCancelResponse(v); return err }}, + {"ParsePWSRestartIndication", func(v []byte) error { _, err := ParsePWSRestartIndication(v); return err }}, + {"ParsePWSFailureIndication", func(v []byte) error { _, err := ParsePWSFailureIndication(v); return err }}, + {"ParseRerouteNASRequest", func(v []byte) error { _, err := ParseRerouteNASRequest(v); return err }}, } diff --git a/ngap/per_gen.go b/ngap/per_gen.go index a22cd1af60..fb3a994d47 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -263,46 +263,36 @@ func (broadcastPLMNItem *BroadcastPLMNItem) UnmarshalPER(r *per.Reader, enc per. return nil } -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { - return err - } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(criticalityDiagnosticsIEItem.IEID)); err != nil { + if err := cancelledCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(criticalityDiagnosticsIEItem.TypeOfError), "TypeOfError"); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInEAIEUTRAItem.NumberOfBroadcasts)); err != nil { return err } return nil } -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - e0, err := per.DecodeEnumerated(r, enc, 3, false) - if err != nil { + if err := (&cancelledCellsInEAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - criticalityDiagnosticsIEItem.IECriticality = Criticality(e0) n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) if err != nil { return err } - criticalityDiagnosticsIEItem.IEID = ProtocolIEID(n1) - e2, err := decodeRootEnumerated(r, enc, 2, "TypeOfError") - if err != nil { - return err - } - criticalityDiagnosticsIEItem.TypeOfError = TypeOfError(e2) - if p_f3 { + cancelledCellsInEAIEUTRAItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -335,62 +325,36 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r return nil } -func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil) - w.WriteBit(dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil) w.WriteBit(false) - if err := dataForwardingResponseDRBItem.DRBID.MarshalPER(w, enc); err != nil { + if err := cancelledCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } - if dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil { - if err := (*dataForwardingResponseDRBItem.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil { - if err := (*dataForwardingResponseDRBItem.ULForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInEAINRItem.NumberOfBroadcasts)); err != nil { + return err } return nil } -func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwardingUPTNLInformation, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_ULForwardingUPTNLInformation, err := r.ReadBit() - if err != nil { + if err := (&cancelledCellsInEAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - p_f3, err := r.ReadBit() + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) if err != nil { return err } - if err := (&dataForwardingResponseDRBItem.DRBID).UnmarshalPER(r, enc); err != nil { - return err - } - if p_DLForwardingUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - dataForwardingResponseDRBItem.DLForwardingUPTNLInformation = &v - } - if p_ULForwardingUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - dataForwardingResponseDRBItem.ULForwardingUPTNLInformation = &v - } - if p_f3 { + cancelledCellsInEAINRItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -423,110 +387,98 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER return nil } -func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(dynamic5QIDescriptor.FiveQI != nil) - w.WriteBit(dynamic5QIDescriptor.DelayCritical != nil) - w.WriteBit(dynamic5QIDescriptor.AveragingWindow != nil) - w.WriteBit(dynamic5QIDescriptor.MaximumDataBurstVolume != nil) w.WriteBit(false) - if err := dynamic5QIDescriptor.PriorityLevelQos.MarshalPER(w, enc); err != nil { + if err := cancelledCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } - if err := dynamic5QIDescriptor.PacketDelayBudget.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInTAIEUTRAItem.NumberOfBroadcasts)); err != nil { return err } - if err := dynamic5QIDescriptor.PacketErrorRate.MarshalPER(w, enc); err != nil { + return nil +} + +func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { return err } - if dynamic5QIDescriptor.FiveQI != nil { - if err := (*dynamic5QIDescriptor.FiveQI).MarshalPER(w, enc); err != nil { - return err - } + p_f2, err := r.ReadBit() + if err != nil { + return err } - if dynamic5QIDescriptor.DelayCritical != nil { - if err := encodeRootEnumerated(w, enc, 2, int64((*dynamic5QIDescriptor.DelayCritical)), "DelayCritical"); err != nil { - return err - } + if err := (&cancelledCellsInTAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { + return err } - if dynamic5QIDescriptor.AveragingWindow != nil { - if err := (*dynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cancelledCellsInTAIEUTRAItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + _ = v } - if dynamic5QIDescriptor.MaximumDataBurstVolume != nil { - if err := (*dynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { return err } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } } return nil } -func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := cancelledCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } - p_FiveQI, err := r.ReadBit() - if err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInTAINRItem.NumberOfBroadcasts)); err != nil { return err } - p_DelayCritical, err := r.ReadBit() + return nil +} + +func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() if err != nil { return err } - p_AveragingWindow, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_MaximumDataBurstVolume, err := r.ReadBit() - if err != nil { + if err := (&cancelledCellsInTAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - p_f7, err := r.ReadBit() + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) if err != nil { return err } - if err := (&dynamic5QIDescriptor.PriorityLevelQos).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&dynamic5QIDescriptor.PacketDelayBudget).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&dynamic5QIDescriptor.PacketErrorRate).UnmarshalPER(r, enc); err != nil { - return err - } - if p_FiveQI { - var v FiveQI - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - dynamic5QIDescriptor.FiveQI = &v - } - if p_DelayCritical { - var v DelayCritical - e4, err := decodeRootEnumerated(r, enc, 2, "DelayCritical") - if err != nil { - return err - } - v = DelayCritical(e4) - dynamic5QIDescriptor.DelayCritical = &v - } - if p_AveragingWindow { - var v AveragingWindow - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - dynamic5QIDescriptor.AveragingWindow = &v - } - if p_MaximumDataBurstVolume { - var v MaximumDataBurstVolume - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - dynamic5QIDescriptor.MaximumDataBurstVolume = &v - } - if p_f7 { + cancelledCellsInTAINRItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -559,34 +511,28 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, en return nil } -func (ePSTAI *EPSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := ePSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := ePSTAI.TAC.MarshalPER(w, enc); err != nil { + if err := cellIDBroadcastEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } return nil } -func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&ePSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&ePSTAI.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&cellIDBroadcastEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -619,40 +565,28 @@ func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (fiveGSTMSI *FiveGSTMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := fiveGSTMSI.AMFSetID.MarshalPER(w, enc); err != nil { - return err - } - if err := fiveGSTMSI.AMFPointer.MarshalPER(w, enc); err != nil { - return err - } - if err := fiveGSTMSI.FiveGTMSI.MarshalPER(w, enc); err != nil { + if err := cellIDBroadcastNRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } return nil } -func (fiveGSTMSI *FiveGSTMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&fiveGSTMSI.AMFSetID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&fiveGSTMSI.AMFPointer).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&fiveGSTMSI.FiveGTMSI).UnmarshalPER(r, enc); err != nil { + if err := (&cellIDBroadcastNRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -685,19 +619,19 @@ func (fiveGSTMSI *FiveGSTMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := forbiddenAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := cellIDCancelledEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } - if err := forbiddenAreaInformationItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledEUTRAItem.NumberOfBroadcasts)); err != nil { return err } return nil } -func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -706,12 +640,14 @@ func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r if err != nil { return err } - if err := (&forbiddenAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&cellIDCancelledEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&forbiddenAreaInformationItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } + cellIDCancelledEUTRAItem.NumberOfBroadcasts = uint16(n1) if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -745,99 +681,36 @@ func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r return nil } -func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (cellIDCancelledNRItem *CellIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(gBRQosInformation.NotificationControl != nil) - w.WriteBit(gBRQosInformation.MaximumPacketLossRateDL != nil) - w.WriteBit(gBRQosInformation.MaximumPacketLossRateUL != nil) w.WriteBit(false) - if err := gBRQosInformation.MaximumFlowBitRateDL.MarshalPER(w, enc); err != nil { - return err - } - if err := gBRQosInformation.MaximumFlowBitRateUL.MarshalPER(w, enc); err != nil { - return err - } - if err := gBRQosInformation.GuaranteedFlowBitRateDL.MarshalPER(w, enc); err != nil { + if err := cellIDCancelledNRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } - if err := gBRQosInformation.GuaranteedFlowBitRateUL.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledNRItem.NumberOfBroadcasts)); err != nil { return err } - if gBRQosInformation.NotificationControl != nil { - if err := encodeRootEnumerated(w, enc, 1, int64((*gBRQosInformation.NotificationControl)), "NotificationControl"); err != nil { - return err - } - } - if gBRQosInformation.MaximumPacketLossRateDL != nil { - if err := (*gBRQosInformation.MaximumPacketLossRateDL).MarshalPER(w, enc); err != nil { - return err - } - } - if gBRQosInformation.MaximumPacketLossRateUL != nil { - if err := (*gBRQosInformation.MaximumPacketLossRateUL).MarshalPER(w, enc); err != nil { - return err - } - } return nil } -func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDCancelledNRItem *CellIDCancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_NotificationControl, err := r.ReadBit() - if err != nil { - return err - } - p_MaximumPacketLossRateDL, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_MaximumPacketLossRateUL, err := r.ReadBit() - if err != nil { + if err := (&cellIDCancelledNRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - p_f7, err := r.ReadBit() + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) if err != nil { return err } - if err := (&gBRQosInformation.MaximumFlowBitRateDL).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gBRQosInformation.MaximumFlowBitRateUL).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gBRQosInformation.GuaranteedFlowBitRateDL).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gBRQosInformation.GuaranteedFlowBitRateUL).UnmarshalPER(r, enc); err != nil { - return err - } - if p_NotificationControl { - var v NotificationControl - e4, err := decodeRootEnumerated(r, enc, 1, "NotificationControl") - if err != nil { - return err - } - v = NotificationControl(e4) - gBRQosInformation.NotificationControl = &v - } - if p_MaximumPacketLossRateDL { - var v PacketLossRate - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - gBRQosInformation.MaximumPacketLossRateDL = &v - } - if p_MaximumPacketLossRateUL { - var v PacketLossRate - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - gBRQosInformation.MaximumPacketLossRateUL = &v - } - if p_f7 { + cellIDCancelledNRItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -870,34 +743,28 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. return nil } -func (gTPTunnel *GTPTunnel) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := gTPTunnel.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err - } - if err := gTPTunnel.GTPTEID.MarshalPER(w, enc); err != nil { + if err := completedCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } return nil } -func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&gTPTunnel.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gTPTunnel.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellsInEAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -930,46 +797,28 @@ func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -func (gUAMI *GUAMI) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := gUAMI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := gUAMI.AMFRegionID.MarshalPER(w, enc); err != nil { - return err - } - if err := gUAMI.AMFSetID.MarshalPER(w, enc); err != nil { - return err - } - if err := gUAMI.AMFPointer.MarshalPER(w, enc); err != nil { + if err := completedCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } return nil } -func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f4, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&gUAMI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gUAMI.AMFRegionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gUAMI.AMFSetID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gUAMI.AMFPointer).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellsInEAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f4 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1002,34 +851,28 @@ func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (globalNgENBID *GlobalNgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := globalNgENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := globalNgENBID.NgENBID.MarshalPER(w, enc); err != nil { + if err := completedCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } return nil } -func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&globalNgENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&globalNgENBID.NgENBID).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellsInTAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1062,69 +905,28 @@ func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding return nil } -func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(handoverCommandTransfer.DLForwardingUPTNLInformation != nil) - w.WriteBit(handoverCommandTransfer.QosFlowToBeForwarded != nil) - w.WriteBit(handoverCommandTransfer.DataForwardingResponseDRB != nil) w.WriteBit(false) - if handoverCommandTransfer.DLForwardingUPTNLInformation != nil { - if err := (*handoverCommandTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if handoverCommandTransfer.QosFlowToBeForwarded != nil { - if err := handoverCommandTransfer.QosFlowToBeForwarded.MarshalPER(w, enc); err != nil { - return err - } - } - if handoverCommandTransfer.DataForwardingResponseDRB != nil { - if err := handoverCommandTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { - return err - } + if err := completedCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { + return err } return nil } -func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwardingUPTNLInformation, err := r.ReadBit() - if err != nil { - return err - } - p_QosFlowToBeForwarded, err := r.ReadBit() - if err != nil { - return err - } - p_DataForwardingResponseDRB, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() - if err != nil { + if err := (&completedCellsInTAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - if p_DLForwardingUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - handoverCommandTransfer.DLForwardingUPTNLInformation = &v - } - if p_QosFlowToBeForwarded { - if err := (&handoverCommandTransfer.QosFlowToBeForwarded).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_DataForwardingResponseDRB { - if err := (&handoverCommandTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_f3 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1157,28 +959,46 @@ func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Read return nil } -func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := handoverPreparationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(criticalityDiagnosticsIEItem.IEID)); err != nil { + return err + } + if err := encodeRootEnumerated(w, enc, 2, int64(criticalityDiagnosticsIEItem.TypeOfError), "TypeOfError"); err != nil { return err } return nil } -func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_f3, err := r.ReadBit() if err != nil { return err } - if err := (&handoverPreparationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + e0, err := per.DecodeEnumerated(r, enc, 3, false) + if err != nil { return err } - if p_f1 { + criticalityDiagnosticsIEItem.IECriticality = Criticality(e0) + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + criticalityDiagnosticsIEItem.IEID = ProtocolIEID(n1) + e2, err := decodeRootEnumerated(r, enc, 2, "TypeOfError") + if err != nil { + return err + } + criticalityDiagnosticsIEItem.TypeOfError = TypeOfError(e2) + if p_f3 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1211,43 +1031,28 @@ func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTr return nil } -func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil) - w.WriteBit(handoverRequestAcknowledgeTransfer.SecurityResult != nil) - w.WriteBit(handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil) - w.WriteBit(handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil) + w.WriteBit(dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil) + w.WriteBit(dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil) w.WriteBit(false) - if err := handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { - return err - } - if handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil { - if err := (*handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if handoverRequestAcknowledgeTransfer.SecurityResult != nil { - if err := (*handoverRequestAcknowledgeTransfer.SecurityResult).MarshalPER(w, enc); err != nil { - return err - } - } - if err := handoverRequestAcknowledgeTransfer.QosFlowSetupResponse.MarshalPER(w, enc); err != nil { + if err := dataForwardingResponseDRBItem.DRBID.MarshalPER(w, enc); err != nil { return err } - if handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil { - if err := handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { + if dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil { + if err := (*dataForwardingResponseDRBItem.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { return err } } - if handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil { - if err := handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { + if dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil { + if err := (*dataForwardingResponseDRBItem.ULForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { return err } } return nil } -func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -1256,23 +1061,15 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un if err != nil { return err } - p_SecurityResult, err := r.ReadBit() - if err != nil { - return err - } - p_QosFlowFailedToSetup, err := r.ReadBit() - if err != nil { - return err - } - p_DataForwardingResponseDRB, err := r.ReadBit() + p_ULForwardingUPTNLInformation, err := r.ReadBit() if err != nil { return err } - p_f6, err := r.ReadBit() + p_f3, err := r.ReadBit() if err != nil { return err } - if err := (&handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&dataForwardingResponseDRBItem.DRBID).UnmarshalPER(r, enc); err != nil { return err } if p_DLForwardingUPTNLInformation { @@ -1280,29 +1077,16 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation = &v + dataForwardingResponseDRBItem.DLForwardingUPTNLInformation = &v } - if p_SecurityResult { - var v SecurityResult + if p_ULForwardingUPTNLInformation { + var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - handoverRequestAcknowledgeTransfer.SecurityResult = &v - } - if err := (&handoverRequestAcknowledgeTransfer.QosFlowSetupResponse).UnmarshalPER(r, enc); err != nil { - return err - } - if p_QosFlowFailedToSetup { - if err := (&handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_DataForwardingResponseDRB { - if err := (&handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { - return err - } + dataForwardingResponseDRBItem.ULForwardingUPTNLInformation = &v } - if p_f6 { + if p_f3 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1335,39 +1119,1892 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un return nil } -func (handoverRequiredTransfer *HandoverRequiredTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(handoverRequiredTransfer.DirectForwardingPathAvailability != nil) + w.WriteBit(dynamic5QIDescriptor.FiveQI != nil) + w.WriteBit(dynamic5QIDescriptor.DelayCritical != nil) + w.WriteBit(dynamic5QIDescriptor.AveragingWindow != nil) + w.WriteBit(dynamic5QIDescriptor.MaximumDataBurstVolume != nil) w.WriteBit(false) - if handoverRequiredTransfer.DirectForwardingPathAvailability != nil { - if err := (*handoverRequiredTransfer.DirectForwardingPathAvailability).MarshalPER(w, enc); err != nil { - return err - } + if err := dynamic5QIDescriptor.PriorityLevelQos.MarshalPER(w, enc); err != nil { + return err } - return nil + if err := dynamic5QIDescriptor.PacketDelayBudget.MarshalPER(w, enc); err != nil { + return err + } + if err := dynamic5QIDescriptor.PacketErrorRate.MarshalPER(w, enc); err != nil { + return err + } + if dynamic5QIDescriptor.FiveQI != nil { + if err := (*dynamic5QIDescriptor.FiveQI).MarshalPER(w, enc); err != nil { + return err + } + } + if dynamic5QIDescriptor.DelayCritical != nil { + if err := encodeRootEnumerated(w, enc, 2, int64((*dynamic5QIDescriptor.DelayCritical)), "DelayCritical"); err != nil { + return err + } + } + if dynamic5QIDescriptor.AveragingWindow != nil { + if err := (*dynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { + return err + } + } + if dynamic5QIDescriptor.MaximumDataBurstVolume != nil { + if err := (*dynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_FiveQI, err := r.ReadBit() + if err != nil { + return err + } + p_DelayCritical, err := r.ReadBit() + if err != nil { + return err + } + p_AveragingWindow, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumDataBurstVolume, err := r.ReadBit() + if err != nil { + return err + } + p_f7, err := r.ReadBit() + if err != nil { + return err + } + if err := (&dynamic5QIDescriptor.PriorityLevelQos).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&dynamic5QIDescriptor.PacketDelayBudget).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&dynamic5QIDescriptor.PacketErrorRate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_FiveQI { + var v FiveQI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + dynamic5QIDescriptor.FiveQI = &v + } + if p_DelayCritical { + var v DelayCritical + e4, err := decodeRootEnumerated(r, enc, 2, "DelayCritical") + if err != nil { + return err + } + v = DelayCritical(e4) + dynamic5QIDescriptor.DelayCritical = &v + } + if p_AveragingWindow { + var v AveragingWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + dynamic5QIDescriptor.AveragingWindow = &v + } + if p_MaximumDataBurstVolume { + var v MaximumDataBurstVolume + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + dynamic5QIDescriptor.MaximumDataBurstVolume = &v + } + if p_f7 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (ePSTAI *EPSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := ePSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := ePSTAI.TAC.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&ePSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&ePSTAI.TAC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (eUTRACGI *EUTRACGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := eUTRACGI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := eUTRACGI.EUTRACellIdentity.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (eUTRACGI *EUTRACGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eUTRACGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eUTRACGI.EUTRACellIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + return nil +} + +func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + return err + } + emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI) + emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI = append(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI, make([]CompletedCellsInEAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := emergencyAreaIDBroadcastNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + return nil +} + +func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&emergencyAreaIDBroadcastNRItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + return err + } + emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI) + emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI = append(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI, make([]CompletedCellsInEAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + return nil +} + +func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + return err + } + emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI) + emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI = append(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI, make([]CancelledCellsInEAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := emergencyAreaIDCancelledNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + return nil +} + +func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&emergencyAreaIDCancelledNRItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + return err + } + emergencyAreaIDCancelledNRItem.CancelledCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI) + emergencyAreaIDCancelledNRItem.CancelledCellsInEAI = append(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI, make([]CancelledCellsInEAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (fiveGSTMSI *FiveGSTMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := fiveGSTMSI.AMFSetID.MarshalPER(w, enc); err != nil { + return err + } + if err := fiveGSTMSI.AMFPointer.MarshalPER(w, enc); err != nil { + return err + } + if err := fiveGSTMSI.FiveGTMSI.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (fiveGSTMSI *FiveGSTMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f3, err := r.ReadBit() + if err != nil { + return err + } + if err := (&fiveGSTMSI.AMFSetID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&fiveGSTMSI.AMFPointer).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&fiveGSTMSI.FiveGTMSI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f3 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := forbiddenAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := forbiddenAreaInformationItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&forbiddenAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&forbiddenAreaInformationItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(gBRQosInformation.NotificationControl != nil) + w.WriteBit(gBRQosInformation.MaximumPacketLossRateDL != nil) + w.WriteBit(gBRQosInformation.MaximumPacketLossRateUL != nil) + w.WriteBit(false) + if err := gBRQosInformation.MaximumFlowBitRateDL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.MaximumFlowBitRateUL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.GuaranteedFlowBitRateDL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.GuaranteedFlowBitRateUL.MarshalPER(w, enc); err != nil { + return err + } + if gBRQosInformation.NotificationControl != nil { + if err := encodeRootEnumerated(w, enc, 1, int64((*gBRQosInformation.NotificationControl)), "NotificationControl"); err != nil { + return err + } + } + if gBRQosInformation.MaximumPacketLossRateDL != nil { + if err := (*gBRQosInformation.MaximumPacketLossRateDL).MarshalPER(w, enc); err != nil { + return err + } + } + if gBRQosInformation.MaximumPacketLossRateUL != nil { + if err := (*gBRQosInformation.MaximumPacketLossRateUL).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NotificationControl, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumPacketLossRateDL, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumPacketLossRateUL, err := r.ReadBit() + if err != nil { + return err + } + p_f7, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gBRQosInformation.MaximumFlowBitRateDL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.MaximumFlowBitRateUL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.GuaranteedFlowBitRateDL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.GuaranteedFlowBitRateUL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NotificationControl { + var v NotificationControl + e4, err := decodeRootEnumerated(r, enc, 1, "NotificationControl") + if err != nil { + return err + } + v = NotificationControl(e4) + gBRQosInformation.NotificationControl = &v + } + if p_MaximumPacketLossRateDL { + var v PacketLossRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + gBRQosInformation.MaximumPacketLossRateDL = &v + } + if p_MaximumPacketLossRateUL { + var v PacketLossRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + gBRQosInformation.MaximumPacketLossRateUL = &v + } + if p_f7 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (gTPTunnel *GTPTunnel) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := gTPTunnel.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := gTPTunnel.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gTPTunnel.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gTPTunnel.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (gUAMI *GUAMI) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := gUAMI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := gUAMI.AMFRegionID.MarshalPER(w, enc); err != nil { + return err + } + if err := gUAMI.AMFSetID.MarshalPER(w, enc); err != nil { + return err + } + if err := gUAMI.AMFPointer.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f4, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gUAMI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUAMI.AMFRegionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUAMI.AMFSetID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUAMI.AMFPointer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f4 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (globalNgENBID *GlobalNgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := globalNgENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalNgENBID.NgENBID.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalNgENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalNgENBID.NgENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(handoverCommandTransfer.DLForwardingUPTNLInformation != nil) + w.WriteBit(handoverCommandTransfer.QosFlowToBeForwarded != nil) + w.WriteBit(handoverCommandTransfer.DataForwardingResponseDRB != nil) + w.WriteBit(false) + if handoverCommandTransfer.DLForwardingUPTNLInformation != nil { + if err := (*handoverCommandTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if handoverCommandTransfer.QosFlowToBeForwarded != nil { + if err := handoverCommandTransfer.QosFlowToBeForwarded.MarshalPER(w, enc); err != nil { + return err + } + } + if handoverCommandTransfer.DataForwardingResponseDRB != nil { + if err := handoverCommandTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwardingUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowToBeForwarded, err := r.ReadBit() + if err != nil { + return err + } + p_DataForwardingResponseDRB, err := r.ReadBit() + if err != nil { + return err + } + p_f3, err := r.ReadBit() + if err != nil { + return err + } + if p_DLForwardingUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverCommandTransfer.DLForwardingUPTNLInformation = &v + } + if p_QosFlowToBeForwarded { + if err := (&handoverCommandTransfer.QosFlowToBeForwarded).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_DataForwardingResponseDRB { + if err := (&handoverCommandTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_f3 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := handoverPreparationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f1, err := r.ReadBit() + if err != nil { + return err + } + if err := (&handoverPreparationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f1 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil) + w.WriteBit(handoverRequestAcknowledgeTransfer.SecurityResult != nil) + w.WriteBit(handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil) + w.WriteBit(handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil) + w.WriteBit(false) + if err := handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil { + if err := (*handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if handoverRequestAcknowledgeTransfer.SecurityResult != nil { + if err := (*handoverRequestAcknowledgeTransfer.SecurityResult).MarshalPER(w, enc); err != nil { + return err + } + } + if err := handoverRequestAcknowledgeTransfer.QosFlowSetupResponse.MarshalPER(w, enc); err != nil { + return err + } + if handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil { + if err := handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { + return err + } + } + if handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil { + if err := handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwardingUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_SecurityResult, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowFailedToSetup, err := r.ReadBit() + if err != nil { + return err + } + p_DataForwardingResponseDRB, err := r.ReadBit() + if err != nil { + return err + } + p_f6, err := r.ReadBit() + if err != nil { + return err + } + if err := (&handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLForwardingUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation = &v + } + if p_SecurityResult { + var v SecurityResult + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverRequestAcknowledgeTransfer.SecurityResult = &v + } + if err := (&handoverRequestAcknowledgeTransfer.QosFlowSetupResponse).UnmarshalPER(r, enc); err != nil { + return err + } + if p_QosFlowFailedToSetup { + if err := (&handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_DataForwardingResponseDRB { + if err := (&handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_f6 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (handoverRequiredTransfer *HandoverRequiredTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(handoverRequiredTransfer.DirectForwardingPathAvailability != nil) + w.WriteBit(false) + if handoverRequiredTransfer.DirectForwardingPathAvailability != nil { + if err := (*handoverRequiredTransfer.DirectForwardingPathAvailability).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverRequiredTransfer *HandoverRequiredTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DirectForwardingPathAvailability, err := r.ReadBit() + if err != nil { + return err + } + p_f1, err := r.ReadBit() + if err != nil { + return err + } + if p_DirectForwardingPathAvailability { + var v DirectForwardingPathAvailability + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverRequiredTransfer.DirectForwardingPathAvailability = &v + } + if p_f1 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil) + w.WriteBit(false) + if err := handoverResourceAllocationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil { + if err := (*handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_CriticalityDiagnostics, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&handoverResourceAllocationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_CriticalityDiagnostics { + var v CriticalityDiagnostics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics = &v + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (mobilityRestrictionList *MobilityRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(mobilityRestrictionList.EquivalentPLMNs != nil) + w.WriteBit(mobilityRestrictionList.RATRestrictions != nil) + w.WriteBit(mobilityRestrictionList.ForbiddenAreaInformation != nil) + w.WriteBit(mobilityRestrictionList.ServiceAreaInformation != nil) + w.WriteBit(false) + if err := mobilityRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { + return err + } + if mobilityRestrictionList.EquivalentPLMNs != nil { + if err := mobilityRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { + return err + } + } + if mobilityRestrictionList.RATRestrictions != nil { + if err := mobilityRestrictionList.RATRestrictions.MarshalPER(w, enc); err != nil { + return err + } + } + if mobilityRestrictionList.ForbiddenAreaInformation != nil { + if err := mobilityRestrictionList.ForbiddenAreaInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if mobilityRestrictionList.ServiceAreaInformation != nil { + if err := mobilityRestrictionList.ServiceAreaInformation.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mobilityRestrictionList *MobilityRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_EquivalentPLMNs, err := r.ReadBit() + if err != nil { + return err + } + p_RATRestrictions, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenAreaInformation, err := r.ReadBit() + if err != nil { + return err + } + p_ServiceAreaInformation, err := r.ReadBit() + if err != nil { + return err + } + p_f5, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mobilityRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { + return err + } + if p_EquivalentPLMNs { + if err := (&mobilityRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_RATRestrictions { + if err := (&mobilityRestrictionList.RATRestrictions).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenAreaInformation { + if err := (&mobilityRestrictionList.ForbiddenAreaInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ServiceAreaInformation { + if err := (&mobilityRestrictionList.ServiceAreaInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_f5 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil) + w.WriteBit(false) + if err := nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil { + if err := (*nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + p_TNLAssociationTransportLayerAddressAMF, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TNLAssociationTransportLayerAddressAMF { + var v CPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF = &v + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + return nil +} + +func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := nRCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := nRCGI.NRCellIdentity.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nRCGI.NRCellIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(nonDynamic5QIDescriptor.PriorityLevelQos != nil) + w.WriteBit(nonDynamic5QIDescriptor.AveragingWindow != nil) + w.WriteBit(nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil) + w.WriteBit(false) + if err := nonDynamic5QIDescriptor.FiveQI.MarshalPER(w, enc); err != nil { + return err + } + if nonDynamic5QIDescriptor.PriorityLevelQos != nil { + if err := (*nonDynamic5QIDescriptor.PriorityLevelQos).MarshalPER(w, enc); err != nil { + return err + } + } + if nonDynamic5QIDescriptor.AveragingWindow != nil { + if err := (*nonDynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { + return err + } + } + if nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil { + if err := (*nonDynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PriorityLevelQos, err := r.ReadBit() + if err != nil { + return err + } + p_AveragingWindow, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumDataBurstVolume, err := r.ReadBit() + if err != nil { + return err + } + p_f4, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nonDynamic5QIDescriptor.FiveQI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_PriorityLevelQos { + var v PriorityLevelQos + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nonDynamic5QIDescriptor.PriorityLevelQos = &v + } + if p_AveragingWindow { + var v AveragingWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nonDynamic5QIDescriptor.AveragingWindow = &v + } + if p_MaximumDataBurstVolume { + var v MaximumDataBurstVolume + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nonDynamic5QIDescriptor.MaximumDataBurstVolume = &v + } + if p_f4 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (overloadStartNSSAIItem *OverloadStartNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(overloadStartNSSAIItem.SliceOverloadResponse != nil) + w.WriteBit(overloadStartNSSAIItem.SliceTrafficLoadReductionIndication != nil) + w.WriteBit(false) + off0 := 0 + if err := per.EncodeLength(w, enc, 1, 1024, true, int64(len(overloadStartNSSAIItem.SliceOverloadList)), func(count int64) error { + end := off0 + int(count) + for i := off0; i < end; i++ { + if err := overloadStartNSSAIItem.SliceOverloadList[i].MarshalPER(w, enc); err != nil { + return err + } + } + off0 = end + return nil + }); err != nil { + return err + } + if overloadStartNSSAIItem.SliceOverloadResponse != nil { + if err := (*overloadStartNSSAIItem.SliceOverloadResponse).MarshalPER(w, enc); err != nil { + return err + } + } + if overloadStartNSSAIItem.SliceTrafficLoadReductionIndication != nil { + if err := (*overloadStartNSSAIItem.SliceTrafficLoadReductionIndication).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (overloadStartNSSAIItem *OverloadStartNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SliceOverloadResponse, err := r.ReadBit() + if err != nil { + return err + } + p_SliceTrafficLoadReductionIndication, err := r.ReadBit() + if err != nil { + return err + } + p_f3, err := r.ReadBit() + if err != nil { + return err + } + overloadStartNSSAIItem.SliceOverloadList = nil + if err := per.DecodeLength(r, enc, 1, 1024, true, func(count int64) error { + start := len(overloadStartNSSAIItem.SliceOverloadList) + overloadStartNSSAIItem.SliceOverloadList = append(overloadStartNSSAIItem.SliceOverloadList, make([]SliceOverloadItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&overloadStartNSSAIItem.SliceOverloadList[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_SliceOverloadResponse { + var v OverloadResponse + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + overloadStartNSSAIItem.SliceOverloadResponse = &v + } + if p_SliceTrafficLoadReductionIndication { + var v TrafficLoadReductionIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + overloadStartNSSAIItem.SliceTrafficLoadReductionIndication = &v + } + if p_f3 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil } -func (handoverRequiredTransfer *HandoverRequiredTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := pDUSessionAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_DirectForwardingPathAvailability, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { + if err := (&pDUSessionAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { return err } - if p_DirectForwardingPathAvailability { - var v DirectForwardingPathAvailability - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - handoverRequiredTransfer.DirectForwardingPathAvailability = &v + if err := (&pDUSessionAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { + return err } - if p_f1 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1400,43 +3037,32 @@ func (handoverRequiredTransfer *HandoverRequiredTransfer) UnmarshalPER(r *per.Re return nil } -func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(false) - if err := handoverResourceAllocationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceAdmittedItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil { - if err := (*handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceAdmittedItem.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_CriticalityDiagnostics, err := r.ReadBit() - if err != nil { - return err - } p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&handoverResourceAllocationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceAdmittedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_CriticalityDiagnostics { - var v CriticalityDiagnostics - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics = &v + if err := (&pDUSessionResourceAdmittedItem.Transfer).UnmarshalPER(r, enc); err != nil { + return err } if p_f2 { var v ieExtensions @@ -1471,88 +3097,34 @@ func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocation return nil } -func (mobilityRestrictionList *MobilityRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(mobilityRestrictionList.EquivalentPLMNs != nil) - w.WriteBit(mobilityRestrictionList.RATRestrictions != nil) - w.WriteBit(mobilityRestrictionList.ForbiddenAreaInformation != nil) - w.WriteBit(mobilityRestrictionList.ServiceAreaInformation != nil) w.WriteBit(false) - if err := mobilityRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if mobilityRestrictionList.EquivalentPLMNs != nil { - if err := mobilityRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { - return err - } - } - if mobilityRestrictionList.RATRestrictions != nil { - if err := mobilityRestrictionList.RATRestrictions.MarshalPER(w, enc); err != nil { - return err - } - } - if mobilityRestrictionList.ForbiddenAreaInformation != nil { - if err := mobilityRestrictionList.ForbiddenAreaInformation.MarshalPER(w, enc); err != nil { - return err - } - } - if mobilityRestrictionList.ServiceAreaInformation != nil { - if err := mobilityRestrictionList.ServiceAreaInformation.MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceFailedToModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (mobilityRestrictionList *MobilityRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_EquivalentPLMNs, err := r.ReadBit() - if err != nil { - return err - } - p_RATRestrictions, err := r.ReadBit() - if err != nil { - return err - } - p_ForbiddenAreaInformation, err := r.ReadBit() - if err != nil { - return err - } - p_ServiceAreaInformation, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_f5, err := r.ReadBit() - if err != nil { + if err := (&pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&mobilityRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_EquivalentPLMNs { - if err := (&mobilityRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_RATRestrictions { - if err := (&mobilityRestrictionList.RATRestrictions).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ForbiddenAreaInformation { - if err := (&mobilityRestrictionList.ForbiddenAreaInformation).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ServiceAreaInformation { - if err := (&mobilityRestrictionList.ServiceAreaInformation).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_f5 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1585,22 +3157,20 @@ func (mobilityRestrictionList *MobilityRestrictionList) UnmarshalPER(r *per.Read return nil } -func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil) +func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - if err := nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.MarshalPER(w, enc); err != nil { + w.WriteBit(false) + if err := pDUSessionResourceFailedToModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil { - if err := (*nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF).MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceFailedToModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - p_TNLAssociationTransportLayerAddressAMF, err := r.ReadBit() +func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() if err != nil { return err } @@ -1608,15 +3178,11 @@ func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) Unmarsha if err != nil { return err } - if err := (&nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_TNLAssociationTransportLayerAddressAMF { - var v CPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF = &v + if err := (&pDUSessionResourceFailedToModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err } if p_f2 { var v ieExtensions @@ -1625,82 +3191,60 @@ func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) Unmarsha } _ = v } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } return nil } -func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(nonDynamic5QIDescriptor.PriorityLevelQos != nil) - w.WriteBit(nonDynamic5QIDescriptor.AveragingWindow != nil) - w.WriteBit(nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil) w.WriteBit(false) - if err := nonDynamic5QIDescriptor.FiveQI.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if nonDynamic5QIDescriptor.PriorityLevelQos != nil { - if err := (*nonDynamic5QIDescriptor.PriorityLevelQos).MarshalPER(w, enc); err != nil { - return err - } - } - if nonDynamic5QIDescriptor.AveragingWindow != nil { - if err := (*nonDynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { - return err - } - } - if nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil { - if err := (*nonDynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceFailedToSetupItemCxtFail.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_PriorityLevelQos, err := r.ReadBit() - if err != nil { - return err - } - p_AveragingWindow, err := r.ReadBit() - if err != nil { - return err - } - p_MaximumDataBurstVolume, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_f4, err := r.ReadBit() - if err != nil { + if err := (&pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&nonDynamic5QIDescriptor.FiveQI).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemCxtFail.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_PriorityLevelQos { - var v PriorityLevelQos - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - nonDynamic5QIDescriptor.PriorityLevelQos = &v - } - if p_AveragingWindow { - var v AveragingWindow - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - nonDynamic5QIDescriptor.AveragingWindow = &v - } - if p_MaximumDataBurstVolume { - var v MaximumDataBurstVolume - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - nonDynamic5QIDescriptor.MaximumDataBurstVolume = &v - } - if p_f4 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1733,19 +3277,19 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Read return nil } -func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -1754,10 +3298,10 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Unma if err != nil { return err } - if err := (&pDUSessionAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -1793,19 +3337,19 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Unma return nil } -func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceAdmittedItem.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceAdmittedItem.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemHOAck.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -1814,10 +3358,10 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalP if err != nil { return err } - if err := (&pDUSessionResourceAdmittedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceAdmittedItem.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemHOAck.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -1853,19 +3397,19 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalP return nil } -func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemPSReq.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -1874,10 +3418,10 @@ func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModi if err != nil { return err } - if err := (&pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemPSReq.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -1913,19 +3457,19 @@ func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModi return nil } -func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceFailedToModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceFailedToSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -1934,10 +3478,10 @@ func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModi if err != nil { return err } - if err := (&pDUSessionResourceFailedToModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceFailedToSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -1973,19 +3517,19 @@ func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModi return nil } -func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceHandoverItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToSetupItemCxtFail.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceHandoverItem.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -1994,10 +3538,10 @@ func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetu if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceHandoverItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemCxtFail.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceHandoverItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -2033,34 +3577,28 @@ func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetu return nil } -func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceFailedToSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceItemCxtRelCpl.PDUSessionID.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceFailedToSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceItemCxtRelCpl.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2093,34 +3631,28 @@ func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetup return nil } -func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceFailedToSetupItemHOAck.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceItemCxtRelReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceFailedToSetupItemHOAck.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceItemCxtRelReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2153,19 +3685,19 @@ func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupI return nil } -func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceItemHORqd.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToSetupItemPSReq.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceItemHORqd.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -2174,10 +3706,10 @@ func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupI if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceItemHORqd.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemPSReq.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceItemHORqd.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -2213,34 +3745,64 @@ func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupI return nil } -func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil) w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil { + if err := pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil { + if err := pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_AdditionalNGUUPTNLInformation, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_QosFlowFailedToModify, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { + p_f4, err := r.ReadBit() + if err != nil { return err } - if p_f2 { + if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AdditionalNGUUPTNLInformation { + if err := (&pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_QosFlowFailedToModify { + if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_f4 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2273,33 +3835,42 @@ func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupI return nil } -func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil) w.WriteBit(false) - if err := pDUSessionResourceHandoverItem.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceHandoverItem.Transfer.MarshalPER(w, enc); err != nil { - return err + if pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil { + if err := pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceHandoverItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_f2, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionResourceHandoverItem.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { return err } + if p_AdditionalDLQosFlowPerTNLInformation { + if err := (&pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -2333,16 +3904,16 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalP return nil } -func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceItemCxtRelCpl.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -2351,7 +3922,7 @@ func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) Unmarsha if err != nil { return err } - if err := (&pDUSessionResourceItemCxtRelCpl.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { return err } if p_f1 { @@ -2387,28 +3958,34 @@ func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) Unmarsha return nil } -func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceItemCxtRelReq.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceItemCxtRelReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { + if err := (&pDUSessionResourceModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2441,19 +4018,19 @@ func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) Unmarsha return nil } -func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceItemHORqd.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyItemModInd.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceItemHORqd.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyItemModInd.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -2462,10 +4039,10 @@ func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r * if err != nil { return err } - if err := (&pDUSessionResourceItemHORqd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyItemModInd.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceItemHORqd.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyItemModInd.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -2501,64 +4078,51 @@ func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r * return nil } -func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil) + w.WriteBit(pDUSessionResourceModifyItemModReq.NASPDU != nil) w.WriteBit(false) - if err := pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyItemModReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil { - if err := pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + if pDUSessionResourceModifyItemModReq.NASPDU != nil { + if err := (*pDUSessionResourceModifyItemModReq.NASPDU).MarshalPER(w, enc); err != nil { return err } } - if pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil { - if err := pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify.MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceModifyItemModReq.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_AdditionalNGUUPTNLInformation, err := r.ReadBit() - if err != nil { - return err - } - p_QosFlowFailedToModify, err := r.ReadBit() + p_NASPDU, err := r.ReadBit() if err != nil { return err } - p_f4, err := r.ReadBit() + p_f3, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyItemModReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_AdditionalNGUUPTNLInformation { - if err := (&pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + if p_NASPDU { + var v NASPDU + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + pDUSessionResourceModifyItemModReq.NASPDU = &v } - if p_QosFlowFailedToModify { - if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify).UnmarshalPER(r, enc); err != nil { - return err - } + if err := (&pDUSessionResourceModifyItemModReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err } - if p_f4 { + if p_f3 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2591,41 +4155,32 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr return nil } -func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil) w.WriteBit(false) - if err := pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil { - if err := pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() - if err != nil { - return err - } p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_AdditionalDLQosFlowPerTNLInformation { - if err := (&pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } + if err := (&pDUSessionResourceModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err } if p_f2 { var v ieExtensions @@ -2660,28 +4215,101 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica return nil } -func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil) w.WriteBit(false) - if err := pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { - return err + if pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil { + if err := (*pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil { + if err := (*pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil { + if err := pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { + if err := pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil { + if err := pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_DLNGUUPTNLInformation, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + p_ULNGUUPTNLInformation, err := r.ReadBit() + if err != nil { return err } - if p_f1 { + p_QosFlowAddOrModifyResponse, err := r.ReadBit() + if err != nil { + return err + } + p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowFailedToAddOrModify, err := r.ReadBit() + if err != nil { + return err + } + p_f5, err := r.ReadBit() + if err != nil { + return err + } + if p_DLNGUUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation = &v + } + if p_ULNGUUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation = &v + } + if p_QosFlowAddOrModifyResponse { + if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_AdditionalDLQosFlowPerTNLInformation { + if err := (&pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_QosFlowFailedToAddOrModify { + if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_f5 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2714,33 +4342,44 @@ func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResource return nil } -func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(false) - if err := pDUSessionResourceModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceModifyUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { - return err + if pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil { + if err := (*pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_CriticalityDiagnostics, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_f2, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceModifyUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { return err } + if p_CriticalityDiagnostics { + var v CriticalityDiagnostics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics = &v + } if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -2774,19 +4413,19 @@ func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Un return nil } -func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceModifyItemModInd.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceNotifyItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceModifyItemModInd.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceNotifyItem.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -2795,10 +4434,10 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Un if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModInd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceNotifyItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceModifyItemModInd.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceNotifyItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -2834,51 +4473,52 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Un return nil } -func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceModifyItemModReq.NASPDU != nil) + w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowNotify != nil) + w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowReleased != nil) w.WriteBit(false) - if err := pDUSessionResourceModifyItemModReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if pDUSessionResourceModifyItemModReq.NASPDU != nil { - if err := (*pDUSessionResourceModifyItemModReq.NASPDU).MarshalPER(w, enc); err != nil { + if pDUSessionResourceNotifyTransfer.QosFlowNotify != nil { + if err := pDUSessionResourceNotifyTransfer.QosFlowNotify.MarshalPER(w, enc); err != nil { return err } } - if err := pDUSessionResourceModifyItemModReq.Transfer.MarshalPER(w, enc); err != nil { - return err + if pDUSessionResourceNotifyTransfer.QosFlowReleased != nil { + if err := pDUSessionResourceNotifyTransfer.QosFlowReleased.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() + p_QosFlowNotify, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_QosFlowReleased, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_f2, err := r.ReadBit() + if err != nil { return err } - if p_NASPDU { - var v NASPDU - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_QosFlowNotify { + if err := (&pDUSessionResourceNotifyTransfer.QosFlowNotify).UnmarshalPER(r, enc); err != nil { return err } - pDUSessionResourceModifyItemModReq.NASPDU = &v } - if err := (&pDUSessionResourceModifyItemModReq.Transfer).UnmarshalPER(r, enc); err != nil { - return err + if p_QosFlowReleased { + if err := (&pDUSessionResourceNotifyTransfer.QosFlowReleased).UnmarshalPER(r, enc); err != nil { + return err + } } - if p_f3 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2911,34 +4551,28 @@ func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Un return nil } -func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceReleaseCommandTransfer.Cause.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceReleaseCommandTransfer.Cause).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2971,101 +4605,82 @@ func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Un return nil } -func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil) w.WriteBit(false) - if pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil { - if err := (*pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } + return nil +} + +func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err } - if pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil { - if err := (*pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } + p_f0, err := r.ReadBit() + if err != nil { + return err } - if pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil { - if err := pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse.MarshalPER(w, enc); err != nil { + if p_f0 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + _ = v } - if pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { - if err := pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { return err } - } - if pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil { - if err := pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify.MarshalPER(w, enc); err != nil { - return err + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } } } return nil } -func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_DLNGUUPTNLInformation, err := r.ReadBit() - if err != nil { +func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := pDUSessionResourceReleasedItemNot.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - p_ULNGUUPTNLInformation, err := r.ReadBit() - if err != nil { + if err := pDUSessionResourceReleasedItemNot.Transfer.MarshalPER(w, enc); err != nil { return err } - p_QosFlowAddOrModifyResponse, err := r.ReadBit() + return nil +} + +func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() if err != nil { return err } - p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_QosFlowFailedToAddOrModify, err := r.ReadBit() - if err != nil { + if err := (&pDUSessionResourceReleasedItemNot.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - p_f5, err := r.ReadBit() - if err != nil { + if err := (&pDUSessionResourceReleasedItemNot.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_DLNGUUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation = &v - } - if p_ULNGUUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation = &v - } - if p_QosFlowAddOrModifyResponse { - if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_AdditionalDLQosFlowPerTNLInformation { - if err := (&pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_QosFlowFailedToAddOrModify { - if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_f5 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3098,43 +4713,32 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse return nil } -func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(false) - if err := pDUSessionResourceModifyUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceReleasedItemPSAck.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil { - if err := (*pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceReleasedItemPSAck.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_CriticalityDiagnostics, err := r.ReadBit() - if err != nil { - return err - } p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceReleasedItemPSAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if p_CriticalityDiagnostics { - var v CriticalityDiagnostics - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics = &v + if err := (&pDUSessionResourceReleasedItemPSAck.Transfer).UnmarshalPER(r, enc); err != nil { + return err } if p_f2 { var v ieExtensions @@ -3169,19 +4773,19 @@ func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsu return nil } -func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceNotifyItem.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceReleasedItemPSFail.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceNotifyItem.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceReleasedItemPSFail.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -3190,10 +4794,10 @@ func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r if err != nil { return err } - if err := (&pDUSessionResourceNotifyItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceReleasedItemPSFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceNotifyItem.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceReleasedItemPSFail.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -3229,51 +4833,33 @@ func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r return nil } -func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowNotify != nil) - w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowReleased != nil) w.WriteBit(false) - if pDUSessionResourceNotifyTransfer.QosFlowNotify != nil { - if err := pDUSessionResourceNotifyTransfer.QosFlowNotify.MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceReleasedItemRelRes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err } - if pDUSessionResourceNotifyTransfer.QosFlowReleased != nil { - if err := pDUSessionResourceNotifyTransfer.QosFlowReleased.MarshalPER(w, enc); err != nil { - return err - } + if err := pDUSessionResourceReleasedItemRelRes.Transfer.MarshalPER(w, enc); err != nil { + return err } return nil } -func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_QosFlowNotify, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_QosFlowReleased, err := r.ReadBit() - if err != nil { + if err := (&pDUSessionResourceReleasedItemRelRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { + if err := (&pDUSessionResourceReleasedItemRelRes.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_QosFlowNotify { - if err := (&pDUSessionResourceNotifyTransfer.QosFlowNotify).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_QosFlowReleased { - if err := (&pDUSessionResourceNotifyTransfer.QosFlowReleased).UnmarshalPER(r, enc); err != nil { - return err - } - } if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -3307,28 +4893,57 @@ func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Unmars return nil } -func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemCxtReq.NASPDU != nil) w.WriteBit(false) - if err := pDUSessionResourceReleaseCommandTransfer.Cause.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupItemCxtReq.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceSetupItemCxtReq.NASPDU != nil { + if err := (*pDUSessionResourceSetupItemCxtReq.NASPDU).MarshalPER(w, enc); err != nil { + return err + } + } + if err := pDUSessionResourceSetupItemCxtReq.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemCxtReq.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_NASPDU, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceReleaseCommandTransfer.Cause).UnmarshalPER(r, enc); err != nil { + p_f4, err := r.ReadBit() + if err != nil { return err } - if p_f1 { + if err := (&pDUSessionResourceSetupItemCxtReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NASPDU { + var v NASPDU + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceSetupItemCxtReq.NASPDU = &v + } + if err := (&pDUSessionResourceSetupItemCxtReq.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemCxtReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f4 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3361,22 +4976,34 @@ func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommand return nil } -func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) + if err := pDUSessionResourceSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { + return err + } return nil } -func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f0, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if p_f0 { + if err := (&pDUSessionResourceSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3409,34 +5036,40 @@ func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseRespon return nil } -func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceReleasedItemNot.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupItemHOReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceReleasedItemNot.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupItemHOReq.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemHOReq.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f3, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceReleasedItemNot.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSetupItemHOReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceReleasedItemNot.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSetupItemHOReq.SNSSAI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if err := (&pDUSessionResourceSetupItemHOReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f3 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3469,34 +5102,57 @@ func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) Unma return nil } -func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemSUReq.NASPDU != nil) w.WriteBit(false) - if err := pDUSessionResourceReleasedItemPSAck.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupItemSUReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceReleasedItemPSAck.Transfer.MarshalPER(w, enc); err != nil { + if pDUSessionResourceSetupItemSUReq.NASPDU != nil { + if err := (*pDUSessionResourceSetupItemSUReq.NASPDU).MarshalPER(w, enc); err != nil { + return err + } + } + if err := pDUSessionResourceSetupItemSUReq.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemSUReq.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { - return err + p_NASPDU, err := r.ReadBit() + if err != nil { + return err + } + p_f4, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemSUReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NASPDU { + var v NASPDU + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceSetupItemSUReq.NASPDU = &v } - if err := (&pDUSessionResourceReleasedItemPSAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSetupItemSUReq.SNSSAI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceReleasedItemPSAck.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSetupItemSUReq.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f4 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3529,19 +5185,19 @@ func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) return nil } -func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceReleasedItemPSFail.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceReleasedItemPSFail.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -3550,10 +5206,10 @@ func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail if err != nil { return err } - if err := (&pDUSessionResourceReleasedItemPSFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceReleasedItemPSFail.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -3589,34 +5245,75 @@ func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail return nil } -func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.SecurityResult != nil) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil) w.WriteBit(false) - if err := pDUSessionResourceReleasedItemRelRes.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceReleasedItemRelRes.Transfer.MarshalPER(w, enc); err != nil { - return err + if pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { + if err := pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupResponseTransfer.SecurityResult != nil { + if err := (*pDUSessionResourceSetupResponseTransfer.SecurityResult).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil { + if err := pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceReleasedItemRelRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_SecurityResult, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionResourceReleasedItemRelRes.Transfer).UnmarshalPER(r, enc); err != nil { + p_QosFlowFailedToSetup, err := r.ReadBit() + if err != nil { return err } - if p_f2 { + p_f4, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AdditionalDLQosFlowPerTNLInformation { + if err := (&pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_SecurityResult { + var v SecurityResult + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceSetupResponseTransfer.SecurityResult = &v + } + if p_QosFlowFailedToSetup { + if err := (&pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_f4 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3649,57 +5346,45 @@ func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes return nil } -func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceSetupItemCxtReq.NASPDU != nil) + w.WriteBit(pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(false) - if err := pDUSessionResourceSetupItemCxtReq.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSetupUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupItemCxtReq.NASPDU != nil { - if err := (*pDUSessionResourceSetupItemCxtReq.NASPDU).MarshalPER(w, enc); err != nil { + if pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil { + if err := (*pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { return err } } - if err := pDUSessionResourceSetupItemCxtReq.SNSSAI.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceSetupItemCxtReq.Transfer.MarshalPER(w, enc); err != nil { - return err - } return nil } -func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() + p_CriticalityDiagnostics, err := r.ReadBit() if err != nil { return err } - p_f4, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSetupItemCxtReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSetupUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { return err } - if p_NASPDU { - var v NASPDU + if p_CriticalityDiagnostics { + var v CriticalityDiagnostics if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pDUSessionResourceSetupItemCxtReq.NASPDU = &v - } - if err := (&pDUSessionResourceSetupItemCxtReq.SNSSAI).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSetupItemCxtReq.Transfer).UnmarshalPER(r, enc); err != nil { - return err + pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics = &v } - if p_f4 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3732,19 +5417,19 @@ func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Unma return nil } -func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSwitchedItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceSwitchedItem.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -3753,10 +5438,10 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Unma if err != nil { return err } - if err := (&pDUSessionResourceSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSwitchedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceSwitchedItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -3792,40 +5477,34 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Unma return nil } -func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceSetupItemHOReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceSetupItemHOReq.SNSSAI.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceToBeSwitchedDLItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceSetupItemHOReq.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceToBeSwitchedDLItem.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSetupItemHOReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSetupItemHOReq.SNSSAI).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceToBeSwitchedDLItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceSetupItemHOReq.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceToBeSwitchedDLItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3858,57 +5537,34 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Unmars return nil } -func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceSetupItemSUReq.NASPDU != nil) w.WriteBit(false) - if err := pDUSessionResourceSetupItemSUReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if pDUSessionResourceSetupItemSUReq.NASPDU != nil { - if err := (*pDUSessionResourceSetupItemSUReq.NASPDU).MarshalPER(w, enc); err != nil { - return err - } - } - if err := pDUSessionResourceSetupItemSUReq.SNSSAI.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceToReleaseItemHOCmd.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceSetupItemSUReq.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceToReleaseItemHOCmd.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() - if err != nil { - return err - } - p_f4, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSetupItemSUReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if p_NASPDU { - var v NASPDU - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceSetupItemSUReq.NASPDU = &v - } - if err := (&pDUSessionResourceSetupItemSUReq.SNSSAI).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceToReleaseItemHOCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceSetupItemSUReq.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceToReleaseItemHOCmd.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f4 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -3941,19 +5597,19 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Unmars return nil } -func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceToReleaseItemRelCmd.PDUSessionID.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { + if err := pDUSessionResourceToReleaseItemRelCmd.Transfer.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -3962,10 +5618,10 @@ func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Unmars if err != nil { return err } - if err := (&pDUSessionResourceSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceToReleaseItemRelCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pDUSessionResourceToReleaseItemRelCmd.Transfer).UnmarshalPER(r, enc); err != nil { return err } if p_f2 { @@ -4001,75 +5657,34 @@ func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Unmars return nil } -func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pLMNSupportItem *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) - w.WriteBit(pDUSessionResourceSetupResponseTransfer.SecurityResult != nil) - w.WriteBit(pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil) w.WriteBit(false) - if err := pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + if err := pLMNSupportItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { - if err := pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { - return err - } - } - if pDUSessionResourceSetupResponseTransfer.SecurityResult != nil { - if err := (*pDUSessionResourceSetupResponseTransfer.SecurityResult).MarshalPER(w, enc); err != nil { - return err - } - } - if pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil { - if err := pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { - return err - } + if err := pLMNSupportItem.SliceSupportList.MarshalPER(w, enc); err != nil { + return err } return nil } -func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pLMNSupportItem *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() - if err != nil { - return err - } - p_SecurityResult, err := r.ReadBit() - if err != nil { - return err - } - p_QosFlowFailedToSetup, err := r.ReadBit() - if err != nil { - return err - } - p_f4, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - if p_AdditionalDLQosFlowPerTNLInformation { - if err := (&pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_SecurityResult { - var v SecurityResult - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceSetupResponseTransfer.SecurityResult = &v + if err := (&pLMNSupportItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err } - if p_QosFlowFailedToSetup { - if err := (&pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { - return err - } + if err := (&pLMNSupportItem.SliceSupportList).UnmarshalPER(r, enc); err != nil { + return err } - if p_f4 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4102,43 +5717,32 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr return nil } -func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(false) - if err := pDUSessionResourceSetupUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + if err := packetErrorRate.Scalar.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil { - if err := (*pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { - return err - } + if err := packetErrorRate.Exponent.MarshalPER(w, enc); err != nil { + return err } return nil } -func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_CriticalityDiagnostics, err := r.ReadBit() - if err != nil { - return err - } p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSetupUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&packetErrorRate.Scalar).UnmarshalPER(r, enc); err != nil { return err } - if p_CriticalityDiagnostics { - var v CriticalityDiagnostics - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics = &v + if err := (&packetErrorRate.Exponent).UnmarshalPER(r, enc); err != nil { + return err } if p_f2 { var v ieExtensions @@ -4173,34 +5777,28 @@ func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsucc return nil } -func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceSwitchedItem.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceSwitchedItem.Transfer.MarshalPER(w, enc); err != nil { + if err := partiallyAllowedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSwitchedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSwitchedItem.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&partiallyAllowedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4233,33 +5831,55 @@ func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalP return nil } -func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil) + w.WriteBit(pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil) w.WriteBit(false) - if err := pDUSessionResourceToBeSwitchedDLItem.PDUSessionID.MarshalPER(w, enc); err != nil { - return err + if pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil { + if err := (*pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } } - if err := pDUSessionResourceToBeSwitchedDLItem.Transfer.MarshalPER(w, enc); err != nil { - return err + if pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil { + if err := (*pathSwitchRequestAcknowledgeTransfer.SecurityIndication).MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_ULNGUUPTNLInformation, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceToBeSwitchedDLItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_SecurityIndication, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionResourceToBeSwitchedDLItem.Transfer).UnmarshalPER(r, enc); err != nil { + p_f2, err := r.ReadBit() + if err != nil { return err } + if p_ULNGUUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation = &v + } + if p_SecurityIndication { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestAcknowledgeTransfer.SecurityIndication = &v + } if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -4293,34 +5913,28 @@ func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem return nil } -func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pDUSessionResourceToReleaseItemHOCmd.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceToReleaseItemHOCmd.Transfer.MarshalPER(w, enc); err != nil { + if err := pathSwitchRequestSetupFailedTransfer.Cause.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceToReleaseItemHOCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceToReleaseItemHOCmd.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&pathSwitchRequestSetupFailedTransfer.Cause).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4353,34 +5967,68 @@ func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd return nil } -func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil) + w.WriteBit(pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil) w.WriteBit(false) - if err := pDUSessionResourceToReleaseItemRelCmd.PDUSessionID.MarshalPER(w, enc); err != nil { + if err := pathSwitchRequestTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceToReleaseItemRelCmd.Transfer.MarshalPER(w, enc); err != nil { + if pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil { + if err := (*pathSwitchRequestTransfer.DLNGUTNLInformationReused).MarshalPER(w, enc); err != nil { + return err + } + } + if pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil { + if err := (*pathSwitchRequestTransfer.UserPlaneSecurityInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if err := pathSwitchRequestTransfer.QosFlowAccepted.MarshalPER(w, enc); err != nil { return err } return nil } -func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_DLNGUTNLInformationReused, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceToReleaseItemRelCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_UserPlaneSecurityInformation, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionResourceToReleaseItemRelCmd.Transfer).UnmarshalPER(r, enc); err != nil { + p_f4, err := r.ReadBit() + if err != nil { return err } - if p_f2 { + if err := (&pathSwitchRequestTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLNGUTNLInformationReused { + var v DLNGUTNLInformationReused + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestTransfer.DLNGUTNLInformationReused = &v + } + if p_UserPlaneSecurityInformation { + var v UserPlaneSecurityInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestTransfer.UserPlaneSecurityInformation = &v + } + if err := (&pathSwitchRequestTransfer.QosFlowAccepted).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f4 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4413,34 +6061,28 @@ func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelC return nil } -func (pLMNSupportItem *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pLMNSupportItem.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := pLMNSupportItem.SliceSupportList.MarshalPER(w, enc); err != nil { + if err := pathSwitchRequestUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { return err } return nil } -func (pLMNSupportItem *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&pLMNSupportItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pLMNSupportItem.SliceSupportList).UnmarshalPER(r, enc); err != nil { + if err := (&pathSwitchRequestUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4473,34 +6115,28 @@ func (pLMNSupportItem *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowAcceptedItem *QosFlowAcceptedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := packetErrorRate.Scalar.MarshalPER(w, enc); err != nil { - return err - } - if err := packetErrorRate.Exponent.MarshalPER(w, enc); err != nil { + if err := qosFlowAcceptedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } return nil } -func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&packetErrorRate.Scalar).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&packetErrorRate.Exponent).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowAcceptedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4533,56 +6169,62 @@ func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil) - w.WriteBit(pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil) + w.WriteBit(qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil) + w.WriteBit(qosFlowAddOrModifyRequestItem.ERABID != nil) w.WriteBit(false) - if pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil { - if err := (*pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { + if err := qosFlowAddOrModifyRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil { + if err := (*qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters).MarshalPER(w, enc); err != nil { return err } } - if pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil { - if err := (*pathSwitchRequestAcknowledgeTransfer.SecurityIndication).MarshalPER(w, enc); err != nil { + if qosFlowAddOrModifyRequestItem.ERABID != nil { + if err := (*qosFlowAddOrModifyRequestItem.ERABID).MarshalPER(w, enc); err != nil { return err } } return nil } -func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_ULNGUUPTNLInformation, err := r.ReadBit() + p_QosFlowLevelQosParameters, err := r.ReadBit() if err != nil { return err } - p_SecurityIndication, err := r.ReadBit() + p_ERABID, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_f3, err := r.ReadBit() if err != nil { return err } - if p_ULNGUUPTNLInformation { - var v UPTransportLayerInformation + if err := (&qosFlowAddOrModifyRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_QosFlowLevelQosParameters { + var v QosFlowLevelQosParameters if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation = &v + qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters = &v } - if p_SecurityIndication { - var v SecurityIndication + if p_ERABID { + var v ERABID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pathSwitchRequestAcknowledgeTransfer.SecurityIndication = &v + qosFlowAddOrModifyRequestItem.ERABID = &v } - if p_f2 { + if p_f3 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4615,16 +6257,16 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer return nil } -func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := pathSwitchRequestSetupFailedTransfer.Cause.MarshalPER(w, enc); err != nil { + if err := qosFlowAddOrModifyResponseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } return nil } -func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -4633,7 +6275,7 @@ func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer if err != nil { return err } - if err := (&pathSwitchRequestSetupFailedTransfer.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowAddOrModifyResponseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } if p_f1 { @@ -4669,68 +6311,45 @@ func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer return nil } -func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil) - w.WriteBit(pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil) + w.WriteBit(qosFlowItemWithDataForwarding.DataForwardingAccepted != nil) w.WriteBit(false) - if err := pathSwitchRequestTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + if err := qosFlowItemWithDataForwarding.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil { - if err := (*pathSwitchRequestTransfer.DLNGUTNLInformationReused).MarshalPER(w, enc); err != nil { - return err - } - } - if pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil { - if err := (*pathSwitchRequestTransfer.UserPlaneSecurityInformation).MarshalPER(w, enc); err != nil { + if qosFlowItemWithDataForwarding.DataForwardingAccepted != nil { + if err := (*qosFlowItemWithDataForwarding.DataForwardingAccepted).MarshalPER(w, enc); err != nil { return err } } - if err := pathSwitchRequestTransfer.QosFlowAccepted.MarshalPER(w, enc); err != nil { - return err - } return nil } -func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_DLNGUTNLInformationReused, err := r.ReadBit() - if err != nil { - return err - } - p_UserPlaneSecurityInformation, err := r.ReadBit() + p_DataForwardingAccepted, err := r.ReadBit() if err != nil { return err } - p_f4, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&pathSwitchRequestTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowItemWithDataForwarding.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_DLNGUTNLInformationReused { - var v DLNGUTNLInformationReused - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pathSwitchRequestTransfer.DLNGUTNLInformationReused = &v - } - if p_UserPlaneSecurityInformation { - var v UserPlaneSecurityInformation + if p_DataForwardingAccepted { + var v DataForwardingAccepted if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pathSwitchRequestTransfer.UserPlaneSecurityInformation = &v - } - if err := (&pathSwitchRequestTransfer.QosFlowAccepted).UnmarshalPER(r, enc); err != nil { - return err + qosFlowItemWithDataForwarding.DataForwardingAccepted = &v } - if p_f4 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4763,28 +6382,89 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per. return nil } -func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(qosFlowLevelQosParameters.GBRQosInformation != nil) + w.WriteBit(qosFlowLevelQosParameters.ReflectiveQosAttribute != nil) + w.WriteBit(qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil) w.WriteBit(false) - if err := pathSwitchRequestUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + if err := qosFlowLevelQosParameters.QosCharacteristics.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowLevelQosParameters.AllocationAndRetentionPriority.MarshalPER(w, enc); err != nil { return err } + if qosFlowLevelQosParameters.GBRQosInformation != nil { + if err := (*qosFlowLevelQosParameters.GBRQosInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowLevelQosParameters.ReflectiveQosAttribute != nil { + if err := encodeRootEnumerated(w, enc, 1, int64((*qosFlowLevelQosParameters.ReflectiveQosAttribute)), "ReflectiveQosAttribute"); err != nil { + return err + } + } + if qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil { + if err := encodeRootEnumerated(w, enc, 1, int64((*qosFlowLevelQosParameters.AdditionalQosFlowInformation)), "AdditionalQosFlowInformation"); err != nil { + return err + } + } return nil } -func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_GBRQosInformation, err := r.ReadBit() if err != nil { return err } - if err := (&pathSwitchRequestUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + p_ReflectiveQosAttribute, err := r.ReadBit() + if err != nil { return err } - if p_f1 { + p_AdditionalQosFlowInformation, err := r.ReadBit() + if err != nil { + return err + } + p_f5, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowLevelQosParameters.QosCharacteristics).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qosFlowLevelQosParameters.AllocationAndRetentionPriority).UnmarshalPER(r, enc); err != nil { + return err + } + if p_GBRQosInformation { + var v GBRQosInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowLevelQosParameters.GBRQosInformation = &v + } + if p_ReflectiveQosAttribute { + var v ReflectiveQosAttribute + e3, err := decodeRootEnumerated(r, enc, 1, "ReflectiveQosAttribute") + if err != nil { + return err + } + v = ReflectiveQosAttribute(e3) + qosFlowLevelQosParameters.ReflectiveQosAttribute = &v + } + if p_AdditionalQosFlowInformation { + var v AdditionalQosFlowInformation + e4, err := decodeRootEnumerated(r, enc, 1, "AdditionalQosFlowInformation") + if err != nil { + return err + } + v = AdditionalQosFlowInformation(e4) + qosFlowLevelQosParameters.AdditionalQosFlowInformation = &v + } + if p_f5 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4817,16 +6497,16 @@ func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransf return nil } -func (qosFlowAcceptedItem *QosFlowAcceptedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := qosFlowAcceptedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := qosFlowModifyConfirmItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } return nil } -func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -4835,7 +6515,7 @@ func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc if err != nil { return err } - if err := (&qosFlowAcceptedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowModifyConfirmItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } if p_f1 { @@ -4871,62 +6551,36 @@ func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc return nil } -func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowNotifyItem *QosFlowNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil) - w.WriteBit(qosFlowAddOrModifyRequestItem.ERABID != nil) w.WriteBit(false) - if err := qosFlowAddOrModifyRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := qosFlowNotifyItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil { - if err := (*qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters).MarshalPER(w, enc); err != nil { - return err - } - } - if qosFlowAddOrModifyRequestItem.ERABID != nil { - if err := (*qosFlowAddOrModifyRequestItem.ERABID).MarshalPER(w, enc); err != nil { - return err - } + if err := encodeRootEnumerated(w, enc, 2, int64(qosFlowNotifyItem.NotificationCause), "NotificationCause"); err != nil { + return err } return nil } -func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_QosFlowLevelQosParameters, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - p_ERABID, err := r.ReadBit() - if err != nil { + if err := (&qosFlowNotifyItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - p_f3, err := r.ReadBit() + e1, err := decodeRootEnumerated(r, enc, 2, "NotificationCause") if err != nil { return err } - if err := (&qosFlowAddOrModifyRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { - return err - } - if p_QosFlowLevelQosParameters { - var v QosFlowLevelQosParameters - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters = &v - } - if p_ERABID { - var v ERABID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - qosFlowAddOrModifyRequestItem.ERABID = &v - } - if p_f3 { + qosFlowNotifyItem.NotificationCause = NotificationCause(e1) + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -4959,28 +6613,34 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER return nil } -func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := qosFlowAddOrModifyResponseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := qosFlowPerTNLInformation.UPTransportLayerInformation.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowPerTNLInformation.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { return err } return nil } -func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowAddOrModifyResponseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowPerTNLInformation.UPTransportLayerInformation).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { + if err := (&qosFlowPerTNLInformation.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5013,45 +6673,28 @@ func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalP return nil } -func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(qosFlowItemWithDataForwarding.DataForwardingAccepted != nil) w.WriteBit(false) - if err := qosFlowItemWithDataForwarding.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { return err } - if qosFlowItemWithDataForwarding.DataForwardingAccepted != nil { - if err := (*qosFlowItemWithDataForwarding.DataForwardingAccepted).MarshalPER(w, enc); err != nil { - return err - } - } return nil } -func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_DataForwardingAccepted, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowItemWithDataForwarding.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowPerTNLInformationItem.QosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { return err } - if p_DataForwardingAccepted { - var v DataForwardingAccepted - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - qosFlowItemWithDataForwarding.DataForwardingAccepted = &v - } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5084,89 +6727,105 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER return nil } -func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(qosFlowLevelQosParameters.GBRQosInformation != nil) - w.WriteBit(qosFlowLevelQosParameters.ReflectiveQosAttribute != nil) - w.WriteBit(qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil) + w.WriteBit(qosFlowSetupRequestItem.ERABID != nil) w.WriteBit(false) - if err := qosFlowLevelQosParameters.QosCharacteristics.MarshalPER(w, enc); err != nil { + if err := qosFlowSetupRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if err := qosFlowLevelQosParameters.AllocationAndRetentionPriority.MarshalPER(w, enc); err != nil { + if err := qosFlowSetupRequestItem.QosFlowLevelQosParameters.MarshalPER(w, enc); err != nil { return err } - if qosFlowLevelQosParameters.GBRQosInformation != nil { - if err := (*qosFlowLevelQosParameters.GBRQosInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if qosFlowLevelQosParameters.ReflectiveQosAttribute != nil { - if err := encodeRootEnumerated(w, enc, 1, int64((*qosFlowLevelQosParameters.ReflectiveQosAttribute)), "ReflectiveQosAttribute"); err != nil { - return err - } - } - if qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil { - if err := encodeRootEnumerated(w, enc, 1, int64((*qosFlowLevelQosParameters.AdditionalQosFlowInformation)), "AdditionalQosFlowInformation"); err != nil { + if qosFlowSetupRequestItem.ERABID != nil { + if err := (*qosFlowSetupRequestItem.ERABID).MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_GBRQosInformation, err := r.ReadBit() - if err != nil { - return err - } - p_ReflectiveQosAttribute, err := r.ReadBit() - if err != nil { - return err - } - p_AdditionalQosFlowInformation, err := r.ReadBit() + p_ERABID, err := r.ReadBit() if err != nil { return err } - p_f5, err := r.ReadBit() + p_f3, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowLevelQosParameters.QosCharacteristics).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowSetupRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if err := (&qosFlowLevelQosParameters.AllocationAndRetentionPriority).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowSetupRequestItem.QosFlowLevelQosParameters).UnmarshalPER(r, enc); err != nil { return err } - if p_GBRQosInformation { - var v GBRQosInformation + if p_ERABID { + var v ERABID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowLevelQosParameters.GBRQosInformation = &v + qosFlowSetupRequestItem.ERABID = &v } - if p_ReflectiveQosAttribute { - var v ReflectiveQosAttribute - e3, err := decodeRootEnumerated(r, enc, 1, "ReflectiveQosAttribute") - if err != nil { + if p_f3 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - v = ReflectiveQosAttribute(e3) - qosFlowLevelQosParameters.ReflectiveQosAttribute = &v + _ = v } - if p_AdditionalQosFlowInformation { - var v AdditionalQosFlowInformation - e4, err := decodeRootEnumerated(r, enc, 1, "AdditionalQosFlowInformation") - if err != nil { + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { return err } - v = AdditionalQosFlowInformation(e4) - qosFlowLevelQosParameters.AdditionalQosFlowInformation = &v + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } } - if p_f5 { + return nil +} + +func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := qosFlowToBeForwardedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f1, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowToBeForwardedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5199,28 +6858,34 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per. return nil } -func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (qosFlowWithCauseItem *QosFlowWithCauseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := qosFlowModifyConfirmItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := qosFlowWithCauseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowWithCauseItem.Cause.MarshalPER(w, enc); err != nil { return err } return nil } -func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowModifyConfirmItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&qosFlowWithCauseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { + if err := (&qosFlowWithCauseItem.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5253,19 +6918,19 @@ func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Re return nil } -func (qosFlowNotifyItem *QosFlowNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := qosFlowNotifyItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := rATRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(qosFlowNotifyItem.NotificationCause), "NotificationCause"); err != nil { + if err := rATRestrictionsItem.RATRestrictionInformation.MarshalPER(w, enc); err != nil { return err } return nil } -func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -5274,14 +6939,12 @@ func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per. if err != nil { return err } - if err := (&qosFlowNotifyItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&rATRestrictionsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - e1, err := decodeRootEnumerated(r, enc, 2, "NotificationCause") - if err != nil { + if err := (&rATRestrictionsItem.RATRestrictionInformation).UnmarshalPER(r, enc); err != nil { return err } - qosFlowNotifyItem.NotificationCause = NotificationCause(e1) if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -5315,33 +6978,44 @@ func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per. return nil } -func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(sNSSAI.SD != nil) w.WriteBit(false) - if err := qosFlowPerTNLInformation.UPTransportLayerInformation.MarshalPER(w, enc); err != nil { + if err := sNSSAI.SST.MarshalPER(w, enc); err != nil { return err } - if err := qosFlowPerTNLInformation.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { - return err + if sNSSAI.SD != nil { + if err := (*sNSSAI.SD).MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_SD, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowPerTNLInformation.UPTransportLayerInformation).UnmarshalPER(r, enc); err != nil { + p_f2, err := r.ReadBit() + if err != nil { return err } - if err := (&qosFlowPerTNLInformation.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { + if err := (&sNSSAI.SST).UnmarshalPER(r, enc); err != nil { return err } + if p_SD { + var v SD + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sNSSAI.SD = &v + } if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -5375,28 +7049,36 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Re return nil } -func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { + return err + } + if err := securityContext.NextHopNH.MarshalPER(w, enc); err != nil { return err } return nil } -func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowPerTNLInformationItem.QosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}) + if err != nil { return err } - if p_f1 { + securityContext.NextHopChainingCount = uint8(n0) + if err := (&securityContext.NextHopNH).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5429,30 +7111,30 @@ func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r return nil } -func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(qosFlowSetupRequestItem.ERABID != nil) + w.WriteBit(securityIndication.MaximumIntegrityProtectedDataRateUL != nil) w.WriteBit(false) - if err := qosFlowSetupRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := encodeRootEnumerated(w, enc, 3, int64(securityIndication.IntegrityProtectionIndication), "IntegrityProtectionIndication"); err != nil { return err } - if err := qosFlowSetupRequestItem.QosFlowLevelQosParameters.MarshalPER(w, enc); err != nil { + if err := encodeRootEnumerated(w, enc, 3, int64(securityIndication.ConfidentialityProtectionIndication), "ConfidentialityProtectionIndication"); err != nil { return err } - if qosFlowSetupRequestItem.ERABID != nil { - if err := (*qosFlowSetupRequestItem.ERABID).MarshalPER(w, enc); err != nil { + if securityIndication.MaximumIntegrityProtectedDataRateUL != nil { + if err := encodeRootEnumerated(w, enc, 2, int64((*securityIndication.MaximumIntegrityProtectedDataRateUL)), "MaximumIntegrityProtectedDataRate"); err != nil { return err } } return nil } -func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_ERABID, err := r.ReadBit() + p_MaximumIntegrityProtectedDataRateUL, err := r.ReadBit() if err != nil { return err } @@ -5460,18 +7142,24 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Read if err != nil { return err } - if err := (&qosFlowSetupRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + e0, err := decodeRootEnumerated(r, enc, 3, "IntegrityProtectionIndication") + if err != nil { return err } - if err := (&qosFlowSetupRequestItem.QosFlowLevelQosParameters).UnmarshalPER(r, enc); err != nil { + securityIndication.IntegrityProtectionIndication = IntegrityProtectionIndication(e0) + e1, err := decodeRootEnumerated(r, enc, 3, "ConfidentialityProtectionIndication") + if err != nil { return err } - if p_ERABID { - var v ERABID - if err := (&v).UnmarshalPER(r, enc); err != nil { + securityIndication.ConfidentialityProtectionIndication = ConfidentialityProtectionIndication(e1) + if p_MaximumIntegrityProtectedDataRateUL { + var v MaximumIntegrityProtectedDataRate + e2, err := decodeRootEnumerated(r, enc, 2, "MaximumIntegrityProtectedDataRate") + if err != nil { return err } - qosFlowSetupRequestItem.ERABID = &v + v = MaximumIntegrityProtectedDataRate(e2) + securityIndication.MaximumIntegrityProtectedDataRateUL = &v } if p_f3 { var v ieExtensions @@ -5506,28 +7194,38 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Read return nil } -func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (securityResult *SecurityResult) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := qosFlowToBeForwardedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.IntegrityProtectionResult), "IntegrityProtectionResult"); err != nil { + return err + } + if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.ConfidentialityProtectionResult), "ConfidentialityProtectionResult"); err != nil { return err } return nil } -func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowToBeForwardedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + e0, err := decodeRootEnumerated(r, enc, 2, "IntegrityProtectionResult") + if err != nil { return err } - if p_f1 { + securityResult.IntegrityProtectionResult = IntegrityProtectionResult(e0) + e1, err := decodeRootEnumerated(r, enc, 2, "ConfidentialityProtectionResult") + if err != nil { + return err + } + securityResult.ConfidentialityProtectionResult = ConfidentialityProtectionResult(e1) + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5560,33 +7258,44 @@ func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Re return nil } -func (qosFlowWithCauseItem *QosFlowWithCauseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (servedGUAMIItem *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(servedGUAMIItem.BackupAMFName != nil) w.WriteBit(false) - if err := qosFlowWithCauseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + if err := servedGUAMIItem.GUAMI.MarshalPER(w, enc); err != nil { return err } - if err := qosFlowWithCauseItem.Cause.MarshalPER(w, enc); err != nil { - return err + if servedGUAMIItem.BackupAMFName != nil { + if err := (*servedGUAMIItem.BackupAMFName).MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (servedGUAMIItem *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_BackupAMFName, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowWithCauseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + p_f2, err := r.ReadBit() + if err != nil { return err } - if err := (&qosFlowWithCauseItem.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&servedGUAMIItem.GUAMI).UnmarshalPER(r, enc); err != nil { return err } + if p_BackupAMFName { + var v Name + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + servedGUAMIItem.BackupAMFName = &v + } if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -5620,34 +7329,58 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, en return nil } -func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (serviceAreaInformationItem *ServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) + w.WriteBit(serviceAreaInformationItem.AllowedTACs != nil) + w.WriteBit(serviceAreaInformationItem.NotAllowedTACs != nil) w.WriteBit(false) - if err := rATRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := serviceAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := rATRestrictionsItem.RATRestrictionInformation.MarshalPER(w, enc); err != nil { - return err + if serviceAreaInformationItem.AllowedTACs != nil { + if err := serviceAreaInformationItem.AllowedTACs.MarshalPER(w, enc); err != nil { + return err + } + } + if serviceAreaInformationItem.NotAllowedTACs != nil { + if err := serviceAreaInformationItem.NotAllowedTACs.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (serviceAreaInformationItem *ServiceAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_AllowedTACs, err := r.ReadBit() + if err != nil { + return err + } + p_NotAllowedTACs, err := r.ReadBit() if err != nil { return err } - if err := (&rATRestrictionsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + p_f3, err := r.ReadBit() + if err != nil { return err } - if err := (&rATRestrictionsItem.RATRestrictionInformation).UnmarshalPER(r, enc); err != nil { + if err := (&serviceAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_AllowedTACs { + if err := (&serviceAreaInformationItem.AllowedTACs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_NotAllowedTACs { + if err := (&serviceAreaInformationItem.NotAllowedTACs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_f3 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5680,45 +7413,28 @@ func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc return nil } -func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (sliceOverloadItem *SliceOverloadItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(sNSSAI.SD != nil) w.WriteBit(false) - if err := sNSSAI.SST.MarshalPER(w, enc); err != nil { + if err := sliceOverloadItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } - if sNSSAI.SD != nil { - if err := (*sNSSAI.SD).MarshalPER(w, enc); err != nil { - return err - } - } return nil } -func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (sliceOverloadItem *SliceOverloadItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_SD, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - if err := (&sNSSAI.SST).UnmarshalPER(r, enc); err != nil { + if err := (&sliceOverloadItem.SNSSAI).UnmarshalPER(r, enc); err != nil { return err } - if p_SD { - var v SD - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - sNSSAI.SD = &v - } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5751,36 +7467,28 @@ func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (sliceSupportItem *SliceSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { - return err - } - if err := securityContext.NextHopNH.MarshalPER(w, enc); err != nil { + if err := sliceSupportItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } return nil } -func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}) + p_f1, err := r.ReadBit() if err != nil { return err } - securityContext.NextHopChainingCount = uint8(n0) - if err := (&securityContext.NextHopNH).UnmarshalPER(r, enc); err != nil { + if err := (&sliceSupportItem.SNSSAI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -5813,55 +7521,71 @@ func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(securityIndication.MaximumIntegrityProtectedDataRateUL != nil) + w.WriteBit(sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil) + w.WriteBit(sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN != nil) + w.WriteBit(sourceToTargetAMFInformationReroute.RejectedNSSAIinTA != nil) w.WriteBit(false) - if err := encodeRootEnumerated(w, enc, 3, int64(securityIndication.IntegrityProtectionIndication), "IntegrityProtectionIndication"); err != nil { - return err + if sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil { + if err := (*sourceToTargetAMFInformationReroute.ConfiguredNSSAI).MarshalPER(w, enc); err != nil { + return err + } } - if err := encodeRootEnumerated(w, enc, 3, int64(securityIndication.ConfidentialityProtectionIndication), "ConfidentialityProtectionIndication"); err != nil { - return err + if sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN != nil { + if err := (*sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN).MarshalPER(w, enc); err != nil { + return err + } } - if securityIndication.MaximumIntegrityProtectedDataRateUL != nil { - if err := encodeRootEnumerated(w, enc, 2, int64((*securityIndication.MaximumIntegrityProtectedDataRateUL)), "MaximumIntegrityProtectedDataRate"); err != nil { + if sourceToTargetAMFInformationReroute.RejectedNSSAIinTA != nil { + if err := (*sourceToTargetAMFInformationReroute.RejectedNSSAIinTA).MarshalPER(w, enc); err != nil { return err } } return nil } -func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_MaximumIntegrityProtectedDataRateUL, err := r.ReadBit() + p_ConfiguredNSSAI, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_RejectedNSSAIinPLMN, err := r.ReadBit() if err != nil { return err } - e0, err := decodeRootEnumerated(r, enc, 3, "IntegrityProtectionIndication") + p_RejectedNSSAIinTA, err := r.ReadBit() if err != nil { return err } - securityIndication.IntegrityProtectionIndication = IntegrityProtectionIndication(e0) - e1, err := decodeRootEnumerated(r, enc, 3, "ConfidentialityProtectionIndication") + p_f3, err := r.ReadBit() if err != nil { return err } - securityIndication.ConfidentialityProtectionIndication = ConfidentialityProtectionIndication(e1) - if p_MaximumIntegrityProtectedDataRateUL { - var v MaximumIntegrityProtectedDataRate - e2, err := decodeRootEnumerated(r, enc, 2, "MaximumIntegrityProtectedDataRate") - if err != nil { + if p_ConfiguredNSSAI { + var v ConfiguredNSSAI + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - v = MaximumIntegrityProtectedDataRate(e2) - securityIndication.MaximumIntegrityProtectedDataRateUL = &v + sourceToTargetAMFInformationReroute.ConfiguredNSSAI = &v + } + if p_RejectedNSSAIinPLMN { + var v RejectedNSSAIinPLMN + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN = &v + } + if p_RejectedNSSAIinTA { + var v RejectedNSSAIinTA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceToTargetAMFInformationReroute.RejectedNSSAIinTA = &v } if p_f3 { var v ieExtensions @@ -5896,19 +7620,19 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe return nil } -func (securityResult *SecurityResult) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.IntegrityProtectionResult), "IntegrityProtectionResult"); err != nil { + if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.ConfidentialityProtectionResult), "ConfidentialityProtectionResult"); err != nil { + if err := supportedTAItem.BroadcastPLMNList.MarshalPER(w, enc); err != nil { return err } return nil } -func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -5917,16 +7641,12 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi if err != nil { return err } - e0, err := decodeRootEnumerated(r, enc, 2, "IntegrityProtectionResult") - if err != nil { + if err := (&supportedTAItem.TAC).UnmarshalPER(r, enc); err != nil { return err } - securityResult.IntegrityProtectionResult = IntegrityProtectionResult(e0) - e1, err := decodeRootEnumerated(r, enc, 2, "ConfidentialityProtectionResult") - if err != nil { + if err := (&supportedTAItem.BroadcastPLMNList).UnmarshalPER(r, enc); err != nil { return err } - securityResult.ConfidentialityProtectionResult = ConfidentialityProtectionResult(e1) if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -5960,43 +7680,32 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -func (servedGUAMIItem *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(servedGUAMIItem.BackupAMFName != nil) w.WriteBit(false) - if err := servedGUAMIItem.GUAMI.MarshalPER(w, enc); err != nil { + if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if servedGUAMIItem.BackupAMFName != nil { - if err := (*servedGUAMIItem.BackupAMFName).MarshalPER(w, enc); err != nil { - return err - } + if err := tAI.TAC.MarshalPER(w, enc); err != nil { + return err } return nil } -func (servedGUAMIItem *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_BackupAMFName, err := r.ReadBit() - if err != nil { - return err - } p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&servedGUAMIItem.GUAMI).UnmarshalPER(r, enc); err != nil { + if err := (&tAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if p_BackupAMFName { - var v Name - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - servedGUAMIItem.BackupAMFName = &v + if err := (&tAI.TAC).UnmarshalPER(r, enc); err != nil { + return err } if p_f2 { var v ieExtensions @@ -6031,58 +7740,54 @@ func (servedGUAMIItem *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (serviceAreaInformationItem *ServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(serviceAreaInformationItem.AllowedTACs != nil) - w.WriteBit(serviceAreaInformationItem.NotAllowedTACs != nil) w.WriteBit(false) - if err := serviceAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := tAIBroadcastEUTRAItem.TAI.MarshalPER(w, enc); err != nil { return err } - if serviceAreaInformationItem.AllowedTACs != nil { - if err := serviceAreaInformationItem.AllowedTACs.MarshalPER(w, enc); err != nil { - return err - } - } - if serviceAreaInformationItem.NotAllowedTACs != nil { - if err := serviceAreaInformationItem.NotAllowedTACs.MarshalPER(w, enc); err != nil { - return err + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastEUTRAItem.CompletedCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAIBroadcastEUTRAItem.CompletedCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } } + off1 = end + return nil + }); err != nil { + return err } return nil } -func (serviceAreaInformationItem *ServiceAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_AllowedTACs, err := r.ReadBit() - if err != nil { - return err - } - p_NotAllowedTACs, err := r.ReadBit() - if err != nil { - return err - } - p_f3, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&serviceAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&tAIBroadcastEUTRAItem.TAI).UnmarshalPER(r, enc); err != nil { return err } - if p_AllowedTACs { - if err := (&serviceAreaInformationItem.AllowedTACs).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_NotAllowedTACs { - if err := (&serviceAreaInformationItem.NotAllowedTACs).UnmarshalPER(r, enc); err != nil { - return err + tAIBroadcastEUTRAItem.CompletedCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAIBroadcastEUTRAItem.CompletedCellsInTAI) + tAIBroadcastEUTRAItem.CompletedCellsInTAI = append(tAIBroadcastEUTRAItem.CompletedCellsInTAI, make([]CompletedCellsInTAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAIBroadcastEUTRAItem.CompletedCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } } + return nil + }); err != nil { + return err } - if p_f3 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -6115,28 +7820,54 @@ func (serviceAreaInformationItem *ServiceAreaInformationItem) UnmarshalPER(r *pe return nil } -func (sliceSupportItem *SliceSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (tAIBroadcastNRItem *TAIBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := sliceSupportItem.SNSSAI.MarshalPER(w, enc); err != nil { + if err := tAIBroadcastNRItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastNRItem.CompletedCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAIBroadcastNRItem.CompletedCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } return nil } -func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (tAIBroadcastNRItem *TAIBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&sliceSupportItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + if err := (&tAIBroadcastNRItem.TAI).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { + tAIBroadcastNRItem.CompletedCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAIBroadcastNRItem.CompletedCellsInTAI) + tAIBroadcastNRItem.CompletedCellsInTAI = append(tAIBroadcastNRItem.CompletedCellsInTAI, make([]CompletedCellsInTAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAIBroadcastNRItem.CompletedCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -6169,19 +7900,29 @@ func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { + if err := tAICancelledEUTRAItem.TAI.MarshalPER(w, enc); err != nil { return err } - if err := supportedTAItem.BroadcastPLMNList.MarshalPER(w, enc); err != nil { + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledEUTRAItem.CancelledCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAICancelledEUTRAItem.CancelledCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } return nil } -func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -6190,10 +7931,20 @@ func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Enco if err != nil { return err } - if err := (&supportedTAItem.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&tAICancelledEUTRAItem.TAI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&supportedTAItem.BroadcastPLMNList).UnmarshalPER(r, enc); err != nil { + tAICancelledEUTRAItem.CancelledCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAICancelledEUTRAItem.CancelledCellsInTAI) + tAICancelledEUTRAItem.CancelledCellsInTAI = append(tAICancelledEUTRAItem.CancelledCellsInTAI, make([]CancelledCellsInTAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAICancelledEUTRAItem.CancelledCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } if p_f2 { @@ -6229,19 +7980,29 @@ func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (tAICancelledNRItem *TAICancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := tAICancelledNRItem.TAI.MarshalPER(w, enc); err != nil { return err } - if err := tAI.TAC.MarshalPER(w, enc); err != nil { + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledNRItem.CancelledCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAICancelledNRItem.CancelledCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } return nil } -func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (tAICancelledNRItem *TAICancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err @@ -6250,10 +8011,20 @@ func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { if err != nil { return err } - if err := (&tAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&tAICancelledNRItem.TAI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&tAI.TAC).UnmarshalPER(r, enc); err != nil { + tAICancelledNRItem.CancelledCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAICancelledNRItem.CancelledCellsInTAI) + tAICancelledNRItem.CancelledCellsInTAI = append(tAICancelledNRItem.CancelledCellsInTAI, make([]CancelledCellsInTAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAICancelledNRItem.CancelledCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } if p_f2 { @@ -6530,10 +8301,10 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per. } func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(uEAssociatedLogicalNGConnectionItem.extensions.Present()) w.WriteBit(uEAssociatedLogicalNGConnectionItem.AMFUENGAPID != nil) w.WriteBit(uEAssociatedLogicalNGConnectionItem.RANUENGAPID != nil) - w.WriteBit(false) + w.WriteBit(uEAssociatedLogicalNGConnectionItem.iEExtensions != nil) if uEAssociatedLogicalNGConnectionItem.AMFUENGAPID != nil { if err := (*uEAssociatedLogicalNGConnectionItem.AMFUENGAPID).MarshalPER(w, enc); err != nil { return err @@ -6544,6 +8315,16 @@ func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) return err } } + if uEAssociatedLogicalNGConnectionItem.iEExtensions != nil { + if err := (*uEAssociatedLogicalNGConnectionItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if uEAssociatedLogicalNGConnectionItem.extensions.Present() { + if err := uEAssociatedLogicalNGConnectionItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6560,7 +8341,7 @@ func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6578,35 +8359,17 @@ func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) } uEAssociatedLogicalNGConnectionItem.RANUENGAPID = &v } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + uEAssociatedLogicalNGConnectionItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := uEAssociatedLogicalNGConnectionItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } diff --git a/ngap/per_leaf.go b/ngap/per_leaf.go index 90a7d908e7..1a094bdd8d 100644 --- a/ngap/per_leaf.go +++ b/ngap/per_leaf.go @@ -1654,3 +1654,40 @@ func (l *QosFlowNotifyList) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } + +type rawIEExtensions struct { + data []byte + nbits int +} + +func (e *rawIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { + if enc == per.Aligned { + w.AlignToByte() + } + + w.WriteBitString(e.data, e.nbits) + + return nil +} + +func (e *rawIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + if enc == per.Aligned { + r.AlignToByte() + } + + start := r.Offset() + + var c ieExtensions + if err := c.UnmarshalPER(r, enc); err != nil { + return err + } + + data, nbits, err := r.Since(start) + if err != nil { + return err + } + + e.data, e.nbits = data, nbits + + return nil +} diff --git a/ngap/pws.go b/ngap/pws.go new file mode 100644 index 0000000000..d43f2760c2 --- /dev/null +++ b/ngap/pws.go @@ -0,0 +1,608 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import "github.com/ellanetworks/core/per" + +// TS 38.413 §9.2.8.1. +type WriteReplaceWarningRequest struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + WarningAreaList *WarningAreaList + RepetitionPeriod RepetitionPeriod + NumberOfBroadcastsRequested NumberOfBroadcastsRequested + WarningType *WarningType + WarningSecurityInfo *WarningSecurityInfo + DataCodingScheme *DataCodingScheme + WarningMessageContents WarningMessageContents + ConcurrentWarningMessageInd *ConcurrentWarningMessageInd + WarningAreaCoordinates WarningAreaCoordinates + + messageMeta +} + +var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.SerialNumber, true }, + }, + { + id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + var v WarningAreaList + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.WarningAreaList = &v + + return nil + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if m.WarningAreaList == nil { + return nil, false + } + + return m.WarningAreaList, true + }, + }, + { + id: IDRepetitionPeriod, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.RepetitionPeriod) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.RepetitionPeriod, true }, + }, + { + id: IDNumberOfBroadcastsRequested, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.NumberOfBroadcastsRequested) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.NumberOfBroadcastsRequested, true }, + }, + { + id: IDWarningType, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + var v WarningType + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.WarningType = &v + + return nil + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if m.WarningType == nil { + return nil, false + } + + return m.WarningType, true + }, + }, + { + id: IDWarningSecurityInfo, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + var v WarningSecurityInfo + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.WarningSecurityInfo = &v + + return nil + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if m.WarningSecurityInfo == nil { + return nil, false + } + + return m.WarningSecurityInfo, true + }, + }, + { + id: IDDataCodingScheme, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + var v DataCodingScheme + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.DataCodingScheme = &v + + return nil + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if m.DataCodingScheme == nil { + return nil, false + } + + return m.DataCodingScheme, true + }, + }, + { + id: IDWarningMessageContents, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.WarningMessageContents) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if len(m.WarningMessageContents) == 0 { + return nil, false + } + + return m.WarningMessageContents, true + }, + }, + { + id: IDConcurrentWarningMessageInd, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + var v ConcurrentWarningMessageInd + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.ConcurrentWarningMessageInd = &v + + return nil + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if m.ConcurrentWarningMessageInd == nil { + return nil, false + } + + return m.ConcurrentWarningMessageInd, true + }, + }, + { + id: IDWarningAreaCoordinates, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.WarningAreaCoordinates) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if len(m.WarningAreaCoordinates) == 0 { + return nil, false + } + + return m.WarningAreaCoordinates, true + }, + }, +} + +func (m *WriteReplaceWarningRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcWriteReplaceWarning, writeReplaceWarningRequestIEs, m) +} + +func (m *WriteReplaceWarningRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcWriteReplaceWarning, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, error) { + return parseMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, TriggeringInitiatingMessage, writeReplaceWarningRequestIEs, value) +} + +// TS 38.413 §9.2.8.2. +type WriteReplaceWarningResponse struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + BroadcastCompletedAreaList *BroadcastCompletedAreaList + CriticalityDiagnostics *CriticalityDiagnostics + + messageMeta +} + +var writeReplaceWarningResponseIEs = []ieSpec[WriteReplaceWarningResponse]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return m.SerialNumber, true }, + }, + { + id: IDBroadcastCompletedAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + var v BroadcastCompletedAreaList + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.BroadcastCompletedAreaList = &v + + return nil + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + if m.BroadcastCompletedAreaList == nil { + return nil, false + } + + return m.BroadcastCompletedAreaList, true + }, + }, + { + id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + var v CriticalityDiagnostics + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.CriticalityDiagnostics = &v + + return nil + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + if m.CriticalityDiagnostics == nil { + return nil, false + } + + return m.CriticalityDiagnostics, true + }, + }, +} + +func (m *WriteReplaceWarningResponse) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcWriteReplaceWarning, writeReplaceWarningResponseIEs, m) +} + +func (m *WriteReplaceWarningResponse) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&SuccessfulOutcome{ + ProcedureCode: ProcWriteReplaceWarning, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningResponse, error) { + return parseMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, TriggeringSuccessfulOutcome, writeReplaceWarningResponseIEs, value) +} + +// TS 38.413 §9.2.8.3. +type PWSCancelRequest struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + WarningAreaList *WarningAreaList + CancelAllWarningMessages *CancelAllWarningMessages + + messageMeta +} + +var pWSCancelRequestIEs = []ieSpec[PWSCancelRequest]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { return m.SerialNumber, true }, + }, + { + id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { + var v WarningAreaList + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.WarningAreaList = &v + + return nil + }, + encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { + if m.WarningAreaList == nil { + return nil, false + } + + return m.WarningAreaList, true + }, + }, + { + id: IDCancelAllWarningMessages, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { + var v CancelAllWarningMessages + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.CancelAllWarningMessages = &v + + return nil + }, + encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { + if m.CancelAllWarningMessages == nil { + return nil, false + } + + return m.CancelAllWarningMessages, true + }, + }, +} + +func (m *PWSCancelRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPWSCancel, pWSCancelRequestIEs, m) +} + +func (m *PWSCancelRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcPWSCancel, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParsePWSCancelRequest(value []byte) (*PWSCancelRequest, error) { + return parseMessageBody[PWSCancelRequest](ProcPWSCancel, TriggeringInitiatingMessage, pWSCancelRequestIEs, value) +} + +// TS 38.413 §9.2.8.4. +type PWSCancelResponse struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + BroadcastCancelledAreaList *BroadcastCancelledAreaList + CriticalityDiagnostics *CriticalityDiagnostics + + messageMeta +} + +var pWSCancelResponseIEs = []ieSpec[PWSCancelResponse]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { return m.SerialNumber, true }, + }, + { + id: IDBroadcastCancelledAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { + var v BroadcastCancelledAreaList + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.BroadcastCancelledAreaList = &v + + return nil + }, + encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { + if m.BroadcastCancelledAreaList == nil { + return nil, false + } + + return m.BroadcastCancelledAreaList, true + }, + }, + { + id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { + var v CriticalityDiagnostics + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.CriticalityDiagnostics = &v + + return nil + }, + encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { + if m.CriticalityDiagnostics == nil { + return nil, false + } + + return m.CriticalityDiagnostics, true + }, + }, +} + +func (m *PWSCancelResponse) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPWSCancel, pWSCancelResponseIEs, m) +} + +func (m *PWSCancelResponse) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&SuccessfulOutcome{ + ProcedureCode: ProcPWSCancel, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParsePWSCancelResponse(value []byte) (*PWSCancelResponse, error) { + return parseMessageBody[PWSCancelResponse](ProcPWSCancel, TriggeringSuccessfulOutcome, pWSCancelResponseIEs, value) +} + +// TS 38.413 §9.2.8.5. +type PWSRestartIndication struct { + CellIDListForRestart CellIDListForRestart + GlobalRANNodeID GlobalRANNodeID + TAIListForRestart TAIListForRestart + EmergencyAreaIDListForRestart EmergencyAreaIDListForRestart + + messageMeta +} + +var pWSRestartIndicationIEs = []ieSpec[PWSRestartIndication]{ + { + id: IDCellIDListForRestart, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.CellIDListForRestart) + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return m.CellIDListForRestart, true }, + }, + { + id: IDGlobalRANNodeID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.GlobalRANNodeID) + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return m.GlobalRANNodeID, true }, + }, + { + id: IDTAIListForRestart, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.TAIListForRestart) + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return m.TAIListForRestart, true }, + }, + { + id: IDEmergencyAreaIDListForRestart, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.EmergencyAreaIDListForRestart) + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + if len(m.EmergencyAreaIDListForRestart) == 0 { + return nil, false + } + + return m.EmergencyAreaIDListForRestart, true + }, + }, +} + +func (m *PWSRestartIndication) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPWSRestartIndication, pWSRestartIndicationIEs, m) +} + +func (m *PWSRestartIndication) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcPWSRestartIndication, + Criticality: CriticalityIgnore, + Value: w.Bytes(), + }) +} + +func ParsePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { + return parseMessageBody[PWSRestartIndication](ProcPWSRestartIndication, TriggeringInitiatingMessage, pWSRestartIndicationIEs, value) +} + +// TS 38.413 §9.2.8.6. +type PWSFailureIndication struct { + PWSFailedCellIDList PWSFailedCellIDList + GlobalRANNodeID GlobalRANNodeID + + messageMeta +} + +var pWSFailureIndicationIEs = []ieSpec[PWSFailureIndication]{ + { + id: IDPWSFailedCellIDList, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.PWSFailedCellIDList) + }, + encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return m.PWSFailedCellIDList, true }, + }, + { + id: IDGlobalRANNodeID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.GlobalRANNodeID) + }, + encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return m.GlobalRANNodeID, true }, + }, +} + +func (m *PWSFailureIndication) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPWSFailureIndication, pWSFailureIndicationIEs, m) +} + +func (m *PWSFailureIndication) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcPWSFailureIndication, + Criticality: CriticalityIgnore, + Value: w.Bytes(), + }) +} + +func ParsePWSFailureIndication(value []byte) (*PWSFailureIndication, error) { + return parseMessageBody[PWSFailureIndication](ProcPWSFailureIndication, TriggeringInitiatingMessage, pWSFailureIndicationIEs, value) +} diff --git a/ngap/pws_overload_test.go b/ngap/pws_overload_test.go new file mode 100644 index 0000000000..d01f748e9a --- /dev/null +++ b/ngap/pws_overload_test.go @@ -0,0 +1,412 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/hex" + "errors" + "reflect" + "testing" + + "github.com/ellanetworks/core/per" +) + +func pwsPLMN() PLMNIdentity { return PLMNIdentity{0x00, 0xf1, 0x10} } + +func pwsTAI() TAI { return TAI{PLMNIdentity: pwsPLMN(), TAC: 1} } + +func pwsNRCGI() NRCGI { return NRCGI{PLMNIdentity: pwsPLMN(), NRCellIdentity: 0x123456789} } + +func pwsEUTRACGI() EUTRACGI { return EUTRACGI{PLMNIdentity: pwsPLMN(), EUTRACellIdentity: 0x1234567} } + +func pwsCBSData() WarningMessageContents { + page := make([]byte, 82) + copy(page, []byte{0xd4, 0xf2, 0x9c, 0x0e}) + + return append(append(WarningMessageContents{0x01}, page...), 0x04) +} + +func pwsGNB() GlobalRANNodeID { + return GlobalRANNodeID{Kind: RANNodeIDGNB, PLMNIdentity: pwsPLMN(), Value: 1, Bits: 22} +} + +func goldOverloadStart() *OverloadStart { + return &OverloadStart{ + AMFOverloadResponse: &OverloadResponse{OverloadAction: OverloadActionRejectRRCCRSignalling}, + AMFTrafficLoadReductionIndication: Ptr(TrafficLoadReductionIndication(50)), + OverloadStartNSSAIList: OverloadStartNSSAIList{{ + SliceOverloadList: []SliceOverloadItem{{SNSSAI: SNSSAI{SST: 1, SD: &SD{0x00, 0x00, 0x01}}}}, + SliceOverloadResponse: &OverloadResponse{OverloadAction: OverloadActionPermitEmergencySessionsAndMTServicesOnly}, + SliceTrafficLoadReductionIndication: Ptr(TrafficLoadReductionIndication(20)), + }}, + } +} + +func goldWriteReplaceWarningRequest() *WriteReplaceWarningRequest { + return &WriteReplaceWarningRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + WarningAreaList: &WarningAreaList{NRCGIs: []NRCGI{pwsNRCGI()}}, + RepetitionPeriod: 10, + NumberOfBroadcastsRequested: 1, + WarningType: &WarningType{0x05, 0x80}, + DataCodingScheme: Ptr(DataCodingScheme(0x0f)), + WarningMessageContents: pwsCBSData(), + ConcurrentWarningMessageInd: Ptr(ConcurrentWarningMessageIndTrue), + WarningAreaCoordinates: WarningAreaCoordinates{0xaa, 0xbb}, + } +} + +func goldWriteReplaceWarningResponse() *WriteReplaceWarningResponse { + return &WriteReplaceWarningResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + BroadcastCompletedAreaList: &BroadcastCompletedAreaList{TAIBroadcastNR: []TAIBroadcastNRItem{{ + TAI: pwsTAI(), + CompletedCellsInTAI: []CompletedCellsInTAINRItem{{NRCGI: pwsNRCGI()}}, + }}}, + } +} + +func goldPWSCancelRequest() *PWSCancelRequest { + return &PWSCancelRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + WarningAreaList: &WarningAreaList{TAIs: []TAI{pwsTAI()}}, + CancelAllWarningMessages: Ptr(CancelAllWarningMessagesTrue), + } +} + +func goldPWSCancelResponse() *PWSCancelResponse { + return &PWSCancelResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3456, + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{CellIDCancelledNR: []CellIDCancelledNRItem{{ + NRCGI: pwsNRCGI(), + NumberOfBroadcasts: 3, + }}}, + } +} + +func goldPWSRestartIndication() *PWSRestartIndication { + return &PWSRestartIndication{ + CellIDListForRestart: CellIDListForRestart{NRCGIs: []NRCGI{pwsNRCGI()}}, + GlobalRANNodeID: pwsGNB(), + TAIListForRestart: TAIListForRestart{pwsTAI()}, + EmergencyAreaIDListForRestart: EmergencyAreaIDListForRestart{{0x01, 0x02, 0x03}}, + } +} + +func goldPWSFailureIndication() *PWSFailureIndication { + return &PWSFailureIndication{ + PWSFailedCellIDList: PWSFailedCellIDList{EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}}, + GlobalRANNodeID: pwsGNB(), + } +} + +func goldRerouteNASRequest() *RerouteNASRequest { + return &RerouteNASRequest{ + RANUENGAPID: 5, + AMFUENGAPID: Ptr(AMFUENGAPID(7)), + NGAPMessage: NGAPMessage{0x00, 0x0f, 0x40, 0x00}, + AMFSetID: 1, + AllowedNSSAI: AllowedNSSAI{{SNSSAI: SNSSAI{SST: 1}}}, + SourceToTargetAMFInformationReroute: &SourceToTargetAMFInformationReroute{ + RejectedNSSAIinPLMN: &RejectedNSSAIinPLMN{0x01}, + }, + PartiallyAllowedNSSAI: PartiallyAllowedNSSAI{{SNSSAI: SNSSAI{SST: 2}}}, + } +} + +type pwsCase struct { + name string + marshal func() ([]byte, error) + parse func([]byte) (any, error) + want any + golden string +} + +func pwsCases() []pwsCase { + return []pwsCase{ + {"OverloadStart", goldOverloadStart().Marshal, func(v []byte) (any, error) { return ParseOverloadStart(v) }, goldOverloadStart(), "0016401d000003000200011000094001620031400c000060000010080000012260"}, + {"OverloadStop", (&OverloadStop{}).Marshal, func(v []byte) (any, error) { return ParseOverloadStop(v) }, &OverloadStop{}, "00170003000000"}, + {"WriteReplaceWarningRequest", goldWriteReplaceWarningRequest().Marshal, func(v []byte) (any, error) { return ParseWriteReplaceWarningRequest(v) }, goldWriteReplaceWarningRequest(), "003300809d00000a002300021112005f00023456007a400c2000000000f110123456789000570002000a002f00020001007d40020580001440010f007b4056005301d4f29c0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040011000100008d40040001aabb"}, + {"WriteReplaceWarningResponse", goldWriteReplaceWarningResponse().Marshal, func(v []byte) (any, error) { return ParseWriteReplaceWarningResponse(v) }, goldWriteReplaceWarningResponse(), "20330028000003002300021112005f00023456000d40158000000000f11000000100000000f1101234567890"}, + {"PWSCancelRequest", goldPWSCancelRequest().Marshal, func(v []byte) (any, error) { return ParsePWSCancelRequest(v) }, goldPWSCancelRequest(), "00200022000004002300021112005f00023456007a400a4000000000f110000001000e000100"}, + {"PWSCancelResponse", goldPWSCancelResponse().Marshal, func(v []byte) (any, error) { return ParsePWSCancelResponse(v) }, goldPWSCancelResponse(), "20200021000003002300021112005f00023456000c400e6000000000f11012345678900003"}, + {"PWSRestartIndication", goldPWSRestartIndication().Marshal, func(v []byte) (any, error) { return ParsePWSRestartIndication(v) }, goldPWSRestartIndication(), "002240340000040010000c4000000000f1101234567890001b00080000f110000000040068000900000000f1100000010017000400010203"}, + {"PWSFailureIndication", goldPWSFailureIndication().Marshal, func(v []byte) (any, error) { return ParsePWSFailureIndication(v) }, goldPWSFailureIndication(), "0021401d0000020051000a00000000f11012345670001b00080000f11000000004"}, + {"RerouteNASRequest", goldRerouteNASRequest().Marshal, func(v []byte) (any, error) { return ParseRerouteNASRequest(v) }, goldRerouteNASRequest(), "0024004f000007005500020005000a40020007002a000504000f400000030002004000000002000100ab4021200100000000000000000000000000000000000000000000000000000000000000019e40020002"}, + } +} + +func TestPWSOverloadRoundTripGolden(t *testing.T) { + for _, c := range pwsCases() { + t.Run(c.name, func(t *testing.T) { + b, err := c.marshal() + if err != nil { + t.Fatal(err) + } + + if got := hex.EncodeToString(b); got != c.golden { + t.Errorf("PDU = %s, want %s", got, c.golden) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + got, err := c.parse(pdu.value()) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(got, c.want) { + t.Errorf("round trip = %+v, want %+v", got, c.want) + } + }) + } +} + +func TestPWSOverloadWireCriticality(t *testing.T) { + type wireIE struct { + id ProtocolIEID + crit Criticality + } + + tests := []struct { + name string + body func(*per.Writer, per.Encoding) error + want []wireIE + }{ + {"OverloadStart §9.2.6.14", goldOverloadStart().encodeBody, []wireIE{ + {IDAMFOverloadResponse, CriticalityReject}, + {IDAMFTrafficLoadReductionIndication, CriticalityIgnore}, + {IDOverloadStartNSSAIList, CriticalityIgnore}, + }}, + {"OverloadStop §9.2.6.15", (&OverloadStop{}).encodeBody, nil}, + {"WriteReplaceWarningRequest §9.2.8.1", func() func(*per.Writer, per.Encoding) error { + m := goldWriteReplaceWarningRequest() + m.WarningSecurityInfo = &WarningSecurityInfo{} + + return m.encodeBody + }(), []wireIE{ + {IDMessageIdentifier, CriticalityReject}, + {IDSerialNumber, CriticalityReject}, + {IDWarningAreaList, CriticalityIgnore}, + {IDRepetitionPeriod, CriticalityReject}, + {IDNumberOfBroadcastsRequested, CriticalityReject}, + {IDWarningType, CriticalityIgnore}, + {IDWarningSecurityInfo, CriticalityIgnore}, + {IDDataCodingScheme, CriticalityIgnore}, + {IDWarningMessageContents, CriticalityIgnore}, + {IDConcurrentWarningMessageInd, CriticalityReject}, + {IDWarningAreaCoordinates, CriticalityIgnore}, + }}, + {"WriteReplaceWarningResponse §9.2.8.2", func() func(*per.Writer, per.Encoding) error { + m := goldWriteReplaceWarningResponse() + m.CriticalityDiagnostics = &CriticalityDiagnostics{} + + return m.encodeBody + }(), []wireIE{ + {IDMessageIdentifier, CriticalityReject}, + {IDSerialNumber, CriticalityReject}, + {IDBroadcastCompletedAreaList, CriticalityIgnore}, + {IDCriticalityDiagnostics, CriticalityIgnore}, + }}, + {"PWSCancelRequest §9.2.8.3", goldPWSCancelRequest().encodeBody, []wireIE{ + {IDMessageIdentifier, CriticalityReject}, + {IDSerialNumber, CriticalityReject}, + {IDWarningAreaList, CriticalityIgnore}, + {IDCancelAllWarningMessages, CriticalityReject}, + }}, + {"PWSCancelResponse §9.2.8.4", func() func(*per.Writer, per.Encoding) error { + m := goldPWSCancelResponse() + m.CriticalityDiagnostics = &CriticalityDiagnostics{} + + return m.encodeBody + }(), []wireIE{ + {IDMessageIdentifier, CriticalityReject}, + {IDSerialNumber, CriticalityReject}, + {IDBroadcastCancelledAreaList, CriticalityIgnore}, + {IDCriticalityDiagnostics, CriticalityIgnore}, + }}, + {"PWSRestartIndication §9.2.8.5", goldPWSRestartIndication().encodeBody, []wireIE{ + {IDCellIDListForRestart, CriticalityReject}, + {IDGlobalRANNodeID, CriticalityReject}, + {IDTAIListForRestart, CriticalityReject}, + {IDEmergencyAreaIDListForRestart, CriticalityReject}, + }}, + {"PWSFailureIndication §9.2.8.6", goldPWSFailureIndication().encodeBody, []wireIE{ + {IDPWSFailedCellIDList, CriticalityReject}, + {IDGlobalRANNodeID, CriticalityReject}, + }}, + {"RerouteNASRequest §9.2.5.5", func() func(*per.Writer, per.Encoding) error { + m := goldRerouteNASRequest() + m.SourceToTargetAMFInformationReroute.ConfiguredNSSAI = &ConfiguredNSSAI{} + m.SourceToTargetAMFInformationReroute.RejectedNSSAIinTA = &RejectedNSSAIinTA{} + + return m.encodeBody + }(), []wireIE{ + {IDRANUENGAPID, CriticalityReject}, + {IDAMFUENGAPID, CriticalityIgnore}, + {IDNGAPMessage, CriticalityReject}, + {IDAMFSetID, CriticalityReject}, + {IDAllowedNSSAI, CriticalityReject}, + {IDSourceToTargetAMFInformationReroute, CriticalityIgnore}, + {IDPartiallyAllowedNSSAI, CriticalityIgnore}, + }}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := wireIEs(t, tt.body) + if len(got) != len(tt.want) { + t.Fatalf("encoded %d IEs, want %d", len(got), len(tt.want)) + } + + for i, w := range tt.want { + if got[i].id != w.id || got[i].crit != w.crit { + t.Errorf("IE %d: got %v/%v, want %v/%v", i, got[i].id, got[i].crit, w.id, w.crit) + } + } + }) + } +} + +func pwsRoundTrip[T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](t *testing.T, in PT) { + t.Helper() + + w := per.NewWriter() + if err := in.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + out := PT(new(T)) + if err := out.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned); err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, in) { + t.Errorf("round trip = %+v, want %+v", out, in) + } +} + +func TestPWSAreaListAlternativesRoundTrip(t *testing.T) { + eai := EmergencyAreaID{0x0a, 0x0b, 0x0c} + + for _, l := range []WarningAreaList{ + {EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}}, + {NRCGIs: []NRCGI{pwsNRCGI()}}, + {TAIs: []TAI{pwsTAI()}}, + {EmergencyAreaIDs: []EmergencyAreaID{eai}}, + } { + pwsRoundTrip(t, &l) + } + + for _, l := range []BroadcastCompletedAreaList{ + {CellIDBroadcastEUTRA: []CellIDBroadcastEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}, + {TAIBroadcastEUTRA: []TAIBroadcastEUTRAItem{{TAI: pwsTAI(), CompletedCellsInTAI: []CompletedCellsInTAIEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}}}, + {EmergencyAreaIDBroadcastEUTRA: []EmergencyAreaIDBroadcastEUTRAItem{{EmergencyAreaID: eai, CompletedCellsInEAI: []CompletedCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}}}, + {CellIDBroadcastNR: []CellIDBroadcastNRItem{{NRCGI: pwsNRCGI()}}}, + {TAIBroadcastNR: []TAIBroadcastNRItem{{TAI: pwsTAI(), CompletedCellsInTAI: []CompletedCellsInTAINRItem{{NRCGI: pwsNRCGI()}}}}}, + {EmergencyAreaIDBroadcastNR: []EmergencyAreaIDBroadcastNRItem{{EmergencyAreaID: eai, CompletedCellsInEAI: []CompletedCellsInEAINRItem{{NRCGI: pwsNRCGI()}}}}}, + } { + pwsRoundTrip(t, &l) + } + + for _, l := range []BroadcastCancelledAreaList{ + {CellIDCancelledEUTRA: []CellIDCancelledEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 1}}}, + {TAICancelledEUTRA: []TAICancelledEUTRAItem{{TAI: pwsTAI(), CancelledCellsInTAI: []CancelledCellsInTAIEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 2}}}}}, + {EmergencyAreaIDCancelledEUTRA: []EmergencyAreaIDCancelledEUTRAItem{{EmergencyAreaID: eai, CancelledCellsInEAI: []CancelledCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 3}}}}}, + {CellIDCancelledNR: []CellIDCancelledNRItem{{NRCGI: pwsNRCGI(), NumberOfBroadcasts: 65535}}}, + {TAICancelledNR: []TAICancelledNRItem{{TAI: pwsTAI(), CancelledCellsInTAI: []CancelledCellsInTAINRItem{{NRCGI: pwsNRCGI()}}}}}, + {EmergencyAreaIDCancelledNR: []EmergencyAreaIDCancelledNRItem{{EmergencyAreaID: eai, CancelledCellsInEAI: []CancelledCellsInEAINRItem{{NRCGI: pwsNRCGI()}}}}}, + } { + pwsRoundTrip(t, &l) + } + + pwsRoundTrip(t, &CellIDListForRestart{EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}}) + pwsRoundTrip(t, &PWSFailedCellIDList{NRCGIs: []NRCGI{pwsNRCGI()}}) +} + +func TestPWSChoiceNeedsExactlyOneAlternative(t *testing.T) { + for _, m := range []per.Marshaler{ + WarningAreaList{}, + WarningAreaList{TAIs: []TAI{pwsTAI()}, NRCGIs: []NRCGI{pwsNRCGI()}}, + BroadcastCompletedAreaList{}, + BroadcastCancelledAreaList{}, + CellIDListForRestart{}, + PWSFailedCellIDList{EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}, NRCGIs: []NRCGI{pwsNRCGI()}}, + } { + if err := m.MarshalPER(per.NewWriter(), per.Aligned); err == nil { + t.Errorf("%T %+v: Marshal accepted it", m, m) + } + } +} + +func TestPWSChoiceExtensionsNotComprehended(t *testing.T) { + cases := []struct { + name string + u per.Unmarshaler + idx int64 + ub int64 + }{ + {"WarningAreaList", &WarningAreaList{}, warningAreaListChoiceExtensions, warningAreaListAlternatives - 1}, + {"BroadcastCompletedAreaList", &BroadcastCompletedAreaList{}, broadcastAreaChoiceExtensions, broadcastAreaAlternatives - 1}, + {"BroadcastCancelledAreaList", &BroadcastCancelledAreaList{}, broadcastAreaChoiceExtensions, broadcastAreaAlternatives - 1}, + {"CellIDListForRestart", &CellIDListForRestart{}, cellListChoiceExtensions, cellListAlternatives - 1}, + {"PWSFailedCellIDList", &PWSFailedCellIDList{}, cellListChoiceExtensions, cellListAlternatives - 1}, + {"OverloadResponse", &OverloadResponse{}, overloadResponseChoiceExtensions, overloadResponseAlternatives - 1}, + } + + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + w := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, c.ub, c.idx); err != nil { + t.Fatal(err) + } + + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, 999); err != nil { + t.Fatal(err) + } + + if err := per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(CriticalityIgnore)); err != nil { + t.Fatal(err) + } + + if err := per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x00}); err != nil { + t.Fatal(err) + } + + err := c.u.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned) + if !errors.Is(err, errNotComprehended) { + t.Fatalf("err = %v, want errNotComprehended", err) + } + }) + } +} + +func TestPWSMandatoryRejectIEAbsentRejects(t *testing.T) { + if _, err := ParseWriteReplaceWarningRequest(container(t)); err == nil { + t.Error("ParseWriteReplaceWarningRequest accepted a request without its mandatory IEs") + } + + if _, err := ParseRerouteNASRequest(container(t)); err == nil { + t.Error("ParseRerouteNASRequest accepted a request without its mandatory IEs") + } +} + +func TestTrafficLoadReductionIndicationRange(t *testing.T) { + for _, v := range []TrafficLoadReductionIndication{0, 100} { + if err := v.MarshalPER(per.NewWriter(), per.Aligned); err == nil { + t.Errorf("TrafficLoadReductionIndication %d encoded", v) + } + } +} diff --git a/ngap/raw_pdu.go b/ngap/raw_pdu.go new file mode 100644 index 0000000000..b50ee17517 --- /dev/null +++ b/ngap/raw_pdu.go @@ -0,0 +1,122 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "errors" + "fmt" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/protocolie" +) + +var ErrIENotPresent = errors.New("ngap: IE not present") + +type RawPDU struct { + m *protocolie.Message +} + +func ParseRawPDU(b []byte) (*RawPDU, error) { + m, err := protocolie.Parse(b, func(pc uint8) bool { return ProcedureCode(pc) == ProcPrivateMessage }) + if err != nil { + return nil, fmt.Errorf("ngap: %w", err) + } + + return &RawPDU{m: m}, nil +} + +func (p *RawPDU) Trigger() TriggeringMessage { return TriggeringMessage(p.m.Choice()) } + +func (p *RawPDU) ProcedureCode() ProcedureCode { return ProcedureCode(p.m.ProcedureCode()) } + +func (p *RawPDU) Criticality() Criticality { return Criticality(p.m.Criticality()) } + +func (p *RawPDU) Len() int { return p.m.Len() } + +func (p *RawPDU) IE(i int) (RawIE, error) { + f, err := p.m.Field(i) + if err != nil { + return RawIE{}, fmt.Errorf("ngap: %w", err) + } + + return RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value}, nil +} + +func (p *RawPDU) IEs() []RawIE { + fields := p.m.Fields() + + out := make([]RawIE, len(fields)) + for i, f := range fields { + out[i] = RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value} + } + + return out +} + +func (p *RawPDU) Index(id ProtocolIEID) int { return p.m.Index(uint16(id)) } + +func (p *RawPDU) SetValue(i int, value []byte) error { + if err := p.m.SetValue(i, value); err != nil { + return fmt.Errorf("ngap: %w", err) + } + + return nil +} + +func (p *RawPDU) Insert(i int, ie RawIE) error { + if err := p.m.Insert(i, protocolie.Field{ID: uint16(ie.ID), Criticality: uint8(ie.Criticality), Value: ie.Value}); err != nil { + return fmt.Errorf("ngap: %w", err) + } + + return nil +} + +func (p *RawPDU) Remove(i int) error { + if err := p.m.Remove(i); err != nil { + return fmt.Errorf("ngap: %w", err) + } + + return nil +} + +func (p *RawPDU) Marshal() ([]byte, error) { + b, err := p.m.Bytes() + if err != nil { + return nil, fmt.Errorf("ngap: %w", err) + } + + return b, nil +} + +func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { + i := p.m.Index(uint16(id)) + if i < 0 { + return false, nil + } + + f, err := p.m.Field(i) + if err != nil { + return false, fmt.Errorf("ngap: %w", err) + } + + if err := perIEDecode(f.Value, v); err != nil { + return false, fmt.Errorf("ngap: IE %s: %w", id, err) + } + + return true, nil +} + +func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { + i := p.m.Index(uint16(id)) + if i < 0 { + return fmt.Errorf("%w: %s", ErrIENotPresent, id) + } + + b, err := per.Marshal(v, per.Aligned) + if err != nil { + return fmt.Errorf("ngap: IE %s: %w", id, err) + } + + return p.SetValue(i, b) +} diff --git a/ngap/raw_pdu_registry_test.go b/ngap/raw_pdu_registry_test.go new file mode 100644 index 0000000000..1dae2bf5d3 --- /dev/null +++ b/ngap/raw_pdu_registry_test.go @@ -0,0 +1,579 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +var typedCodecs = map[typedKey]func([]byte) (typedMessage, error){ + {TriggeringInitiatingMessage, ProcAMFConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseAMFConfigurationUpdate(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcAMFConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseAMFConfigurationUpdateAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcAMFConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseAMFConfigurationUpdateFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcAMFStatusIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseAMFStatusIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkRANConfigurationTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkRANConfigurationTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkRANConfigurationTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkRANConfigurationTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcErrorIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseErrorIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverCancel}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverCancel(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcHandoverCancel}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverCancelAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverNotification}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverNotify(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverPreparation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverRequired(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcHandoverPreparation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverCommand(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcHandoverPreparation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverPreparationFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverResourceAllocation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcHandoverResourceAllocation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverRequestAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcHandoverResourceAllocation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcInitialContextSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialContextSetupRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcInitialContextSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialContextSetupResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcInitialContextSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialContextSetupFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcLocationReport}: func(v []byte) (typedMessage, error) { + m, err := ParseLocationReport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcLocationReportingControl}: func(v []byte) (typedMessage, error) { + m, err := ParseLocationReportingControl(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcNASNonDeliveryIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseNASNonDeliveryIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcInitialUEMessage}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialUEMessage(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkNASTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkNASTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkNASTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkNASTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcNGReset}: func(v []byte) (typedMessage, error) { + m, err := ParseNGReset(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcNGReset}: func(v []byte) (typedMessage, error) { + m, err := ParseNGResetAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcNGSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseNGSetupRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcNGSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseNGSetupFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcNGSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseNGSetupResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkUEAssociatedNRPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkUEAssociatedNRPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkUEAssociatedNRPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkUEAssociatedNRPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkNonUEAssociatedNRPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkNonUEAssociatedNRPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkNonUEAssociatedNRPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkNonUEAssociatedNRPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcOverloadStart}: func(v []byte) (typedMessage, error) { + m, err := ParseOverloadStart(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcOverloadStop}: func(v []byte) (typedMessage, error) { + m, err := ParseOverloadStop(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPaging}: func(v []byte) (typedMessage, error) { + m, err := ParsePaging(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPathSwitchRequest}: func(v []byte) (typedMessage, error) { + m, err := ParsePathSwitchRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcPathSwitchRequest}: func(v []byte) (typedMessage, error) { + m, err := ParsePathSwitchRequestAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcPathSwitchRequest}: func(v []byte) (typedMessage, error) { + m, err := ParsePathSwitchRequestFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPDUSessionResourceModify}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceModifyRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcPDUSessionResourceModify}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceModifyResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPDUSessionResourceModifyIndication}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceModifyIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcPDUSessionResourceModifyIndication}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceModifyConfirm(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPDUSessionResourceNotify}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceNotify(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPDUSessionResourceRelease}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceReleaseCommand(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcPDUSessionResourceRelease}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceReleaseResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPDUSessionResourceSetup}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceSetupRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcPDUSessionResourceSetup}: func(v []byte) (typedMessage, error) { + m, err := ParsePDUSessionResourceSetupResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcWriteReplaceWarning}: func(v []byte) (typedMessage, error) { + m, err := ParseWriteReplaceWarningRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcWriteReplaceWarning}: func(v []byte) (typedMessage, error) { + m, err := ParseWriteReplaceWarningResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPWSCancel}: func(v []byte) (typedMessage, error) { + m, err := ParsePWSCancelRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcPWSCancel}: func(v []byte) (typedMessage, error) { + m, err := ParsePWSCancelResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPWSRestartIndication}: func(v []byte) (typedMessage, error) { + m, err := ParsePWSRestartIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPWSFailureIndication}: func(v []byte) (typedMessage, error) { + m, err := ParsePWSFailureIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcRANConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseRANConfigurationUpdate(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcRANConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseRANConfigurationUpdateAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcRANConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseRANConfigurationUpdateFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcRerouteNASRequest}: func(v []byte) (typedMessage, error) { + m, err := ParseRerouteNASRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkRANStatusTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkRANStatusTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkRANStatusTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkRANStatusTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcTraceStart}: func(v []byte) (typedMessage, error) { + m, err := ParseTraceStart(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcTraceFailureIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseTraceFailureIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUEContextModification}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextModificationRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcUEContextModification}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextModificationResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcUEContextModification}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextModificationFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUEContextRelease}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextReleaseCommand(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcUEContextRelease}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextReleaseComplete(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUEContextReleaseRequest}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextReleaseRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUERadioCapabilityInfoIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseUERadioCapabilityInfoIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, +} + +func sampleMessages() []typedMessage { + return []typedMessage{ + goldErrorIndicationFull(), + errorIndicationWithSTMSI(), + goldNGResetPart(), + goldNGResetAcknowledge(), + goldRequest(), + goldResponse(), + goldFailure(), + } +} diff --git a/ngap/raw_pdu_test.go b/ngap/raw_pdu_test.go new file mode 100644 index 0000000000..3104ddf396 --- /dev/null +++ b/ngap/raw_pdu_test.go @@ -0,0 +1,732 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bufio" + "bytes" + "encoding/hex" + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "reflect" + "regexp" + "slices" + "strconv" + "strings" + "testing" + + "github.com/ellanetworks/core/per" +) + +type corpusPDU struct { + source string + b []byte +} + +type typedKey struct { + trigger TriggeringMessage + proc ProcedureCode +} + +type typedMessage interface { + Marshal() ([]byte, error) +} + +var hexLiteral = regexp.MustCompile(`"([0-9a-fA-F]{8,})"`) + +func loadCorpus(t testing.TB) []corpusPDU { + t.Helper() + + var out []corpusPDU + + f, err := os.Open(filepath.Join("testdata", "captures", "open5gs.txt")) + if err != nil { + t.Fatal(err) + } + + defer func() { _ = f.Close() }() + + sc := bufio.NewScanner(f) + sc.Buffer(make([]byte, 0, 1<<16), 1<<20) + + for n := 1; sc.Scan(); n++ { + line := strings.TrimSpace(sc.Text()) + if line == "" { + continue + } + + b, err := hex.DecodeString(line) + if err != nil { + t.Fatalf("open5gs.txt:%d: %v", n, err) + } + + out = append(out, corpusPDU{source: fmt.Sprintf("open5gs.txt:%d", n), b: b}) + } + + if err := sc.Err(); err != nil { + t.Fatal(err) + } + + files, err := filepath.Glob("*_test.go") + if err != nil { + t.Fatal(err) + } + + for _, name := range files { + src, err := os.ReadFile(name) + if err != nil { + t.Fatal(err) + } + + for _, m := range hexLiteral.FindAllStringSubmatch(string(src), -1) { + b, err := hex.DecodeString(m[1]) + if err != nil { + continue + } + + pdu, err := Unmarshal(b) + if err != nil { + continue + } + + re, err := Marshal(pdu) + if err != nil || !bytes.Equal(re, b) { + continue + } + + if slices.ContainsFunc(out, func(c corpusPDU) bool { return bytes.Equal(c.b, b) }) { + continue + } + + out = append(out, corpusPDU{source: name, b: b}) + } + } + + for i, m := range sampleMessages() { + b, err := m.Marshal() + if err != nil { + t.Fatalf("sample %d (%T): %v", i, m, err) + } + + out = append(out, corpusPDU{source: fmt.Sprintf("sample %T", m), b: b}) + } + + return out +} + +func TestRawPDUCorpusIdentity(t *testing.T) { + procs := map[typedKey]int{} + + for _, c := range loadCorpus(t) { + p, err := ParseRawPDU(c.b) + if err != nil { + t.Errorf("%s: ParseRawPDU: %v", c.source, err) + continue + } + + out, err := p.Marshal() + if err != nil { + t.Errorf("%s: Marshal: %v", c.source, err) + continue + } + + if !bytes.Equal(out, c.b) { + t.Errorf("%s: re-emit differs\n got % x\nwant % x", c.source, out, c.b) + } + + pdu, err := Unmarshal(c.b) + if err != nil { + t.Errorf("%s: Unmarshal: %v", c.source, err) + continue + } + + if p.ProcedureCode() != pdu.procedureCode() || int(p.Trigger()) != pdu.choiceIndex() || p.Criticality() != pdu.criticality() { + t.Errorf("%s: header mismatch with Unmarshal", c.source) + } + + r := per.NewReader(pdu.value()) + if _, err := r.ReadBit(); err != nil { + t.Errorf("%s: preamble: %v", c.source, err) + continue + } + + ies, err := decodeIEContainer(r, per.Aligned) + if err != nil { + t.Errorf("%s: decodeIEContainer: %v", c.source, err) + continue + } + + got := p.IEs() + if len(got) != len(ies) { + t.Errorf("%s: %d IEs, decodeIEContainer found %d", c.source, len(got), len(ies)) + continue + } + + for i := range ies { + if got[i].ID != ies[i].id || got[i].Criticality != ies[i].crit || !bytes.Equal(got[i].Value, ies[i].value) { + t.Errorf("%s: IE %d differs from decodeIEContainer", c.source, i) + } + } + + procs[typedKey{p.Trigger(), p.ProcedureCode()}]++ + + for i := range p.Len() { + ie, _ := p.IE(i) + if err := p.SetValue(i, ie.Value); err != nil { + t.Fatal(err) + } + } + + if out, _ := p.Marshal(); !bytes.Equal(out, c.b) { + t.Errorf("%s: same-value replace is not identity", c.source) + } + } + + t.Logf("%d distinct (trigger, procedure) pairs", len(procs)) +} + +type idSetter struct { + field string + set func(p *RawPDU, v uint64) error + value func(v uint64) reflect.Value + has func(p *RawPDU) bool +} + +func ueIDSetters() []idSetter { + return []idSetter{ + { + field: "AMFUENGAPID", + set: func(p *RawPDU, v uint64) error { return p.SetAMFUENGAPID(AMFUENGAPID(v)) }, + value: func(v uint64) reflect.Value { return reflect.ValueOf(AMFUENGAPID(v)) }, + has: func(p *RawPDU) bool { return p.Index(IDAMFUENGAPID) >= 0 }, + }, + { + field: "RANUENGAPID", + set: func(p *RawPDU, v uint64) error { return p.SetRANUENGAPID(RANUENGAPID(v)) }, + value: func(v uint64) reflect.Value { return reflect.ValueOf(RANUENGAPID(v)) }, + has: func(p *RawPDU) bool { return p.Index(IDRANUENGAPID) >= 0 }, + }, + } +} + +var ueIDValues = map[string][]uint64{ + "AMFUENGAPID": {0, 1099511627775, 0x1234}, + "RANUENGAPID": {0, 4294967295, 0x80}, +} + +func setTypedField(m typedMessage, field string, v reflect.Value) bool { + rv := reflect.ValueOf(m).Elem() + + f := rv.FieldByName(field) + if !f.IsValid() || !f.CanSet() { + return false + } + + switch { + case f.Type() == v.Type(): + f.Set(v) + case f.Kind() == reflect.Pointer && f.Type().Elem() == v.Type(): + if f.IsNil() { + return false + } + + p := reflect.New(v.Type()) + p.Elem().Set(v) + f.Set(p) + default: + return false + } + + return true +} + +func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { + var compared, notExact, refused, unmodeled int + + for _, c := range loadCorpus(t) { + pdu, err := Unmarshal(c.b) + if err != nil { + t.Fatal(err) + } + + codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + if !ok { + unmodeled++ + continue + } + + for _, s := range ueIDSetters() { + probe, err := ParseRawPDU(c.b) + if err != nil { + t.Fatal(err) + } + + if !s.has(probe) { + continue + } + + for _, v := range ueIDValues[s.field] { + msg, err := codec(pdu.value()) + if err != nil { + refused++ + break + } + + re, err := msg.Marshal() + if err != nil || !bytes.Equal(re, c.b) { + notExact++ + break + } + + if !setTypedField(msg, s.field, s.value(v)) { + t.Errorf("%s: %T has no settable %s", c.source, msg, s.field) + break + } + + want, err := msg.Marshal() + if err != nil { + t.Errorf("%s: typed marshal: %v", c.source, err) + break + } + + p, err := ParseRawPDU(c.b) + if err != nil { + t.Fatal(err) + } + + if err := s.set(p, v); err != nil { + t.Fatalf("%s: set %s: %v", c.source, s.field, err) + } + + got, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(got, want) { + t.Errorf("%s: %s=%d\nsplice % x\ntyped % x", c.source, s.field, v, got, want) + } + + compared++ + } + } + } + + t.Logf("compared %d splices with the typed codec; typed codec skipped: %d not re-encoded byte-exactly, %d refused, %d unmodeled", compared, notExact, refused, unmodeled) + + if compared < 20 { + t.Fatalf("only %d comparisons", compared) + } +} + +type fieldSpan struct { + id uint16 + start, valStart, end int +} + +func determinant(b []byte, off int) (n, size int, ok bool) { + if off >= len(b) { + return 0, 0, false + } + + switch { + case b[off]&0x80 == 0: + return int(b[off]), 1, true + case b[off]&0x40 == 0 && off+1 < len(b): + return int(b[off]&0x3f)<<8 | int(b[off+1]), 2, true + default: + return 0, 0, false + } +} + +func layoutOf(b []byte) (bodyStart int, fields []fieldSpan, ok bool) { + n, size, ok := determinant(b, 3) + if !ok || 3+size+n > len(b) { + return 0, nil, false + } + + bodyStart = 3 + size + count := int(b[bodyStart+1])<<8 | int(b[bodyStart+2]) + p := bodyStart + 3 + + for range count { + vn, vs, ok := determinant(b, p+3) + if !ok { + return 0, nil, false + } + + fields = append(fields, fieldSpan{id: uint16(b[p])<<8 | uint16(b[p+1]), start: p, valStart: p + 3 + vs, end: p + 3 + vs + vn}) + p += 3 + vs + vn + } + + return bodyStart, fields, true +} + +func TestRawPDUSpliceLocality(t *testing.T) { + var checked int + + for _, c := range loadCorpus(t) { + oldBody, oldFields, ok := layoutOf(c.b) + if !ok { + continue + } + + for _, s := range ueIDSetters() { + for _, v := range ueIDValues[s.field] { + p, err := ParseRawPDU(c.b) + if err != nil { + t.Fatal(err) + } + + if !s.has(p) { + continue + } + + target := p.Index(map[string]ProtocolIEID{"AMFUENGAPID": IDAMFUENGAPID, "RANUENGAPID": IDRANUENGAPID}[s.field]) + + if err := s.set(p, v); err != nil { + t.Fatal(err) + } + + out, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + newBody, newFields, ok := layoutOf(out) + if !ok || len(newFields) != len(oldFields) { + t.Fatalf("%s: spliced PDU layout unreadable", c.source) + } + + of, nf := oldFields[target], newFields[target] + + if !bytes.Equal(out[:3], c.b[:3]) { + t.Errorf("%s: PDU header changed", c.source) + } + + if !bytes.Equal(out[newBody:nf.start+3], c.b[oldBody:of.start+3]) { + t.Errorf("%s: octets before the target value changed", c.source) + } + + if !bytes.Equal(out[nf.end:], c.b[of.end:]) { + t.Errorf("%s: octets after the target value changed", c.source) + } + + if nf.end-nf.valStart == of.end-of.valStart && !bytes.Equal(out[:nf.valStart], c.b[:of.valStart]) { + t.Errorf("%s: a same-length value moved a determinant", c.source) + } + + checked++ + } + } + } + + if checked == 0 { + t.Fatal("no PDU carried a UE ID") + } +} + +func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { + t.Helper() + + pcap := exec.CommandContext(t.Context(), text2pcap, "-q", "-S", "38412,38412,60", "-", "-") + pcap.Stdin = strings.NewReader(dump) + + pcapBytes, err := pcap.Output() + if err != nil { + t.Fatalf("text2pcap: %v", err) + } + + cmd := exec.CommandContext(t.Context(), tshark, "-r", "-", "-T", "fields", "-E", "separator=|", "-E", "occurrence=a", "-E", "aggregator=,", + "-e", "frame.number", "-e", "ngap.AMF_UE_NGAP_ID", "-e", "ngap.RAN_UE_NGAP_ID", "-e", "_ws.malformed", "-e", "_ws.expert.severity") + cmd.Stdin = bytes.NewReader(pcapBytes) + + cmd.Env = append(os.Environ(), "HOME="+t.TempDir()) + + var stderr bytes.Buffer + + cmd.Stderr = &stderr + + res, err := cmd.Output() + if err != nil { + t.Fatalf("tshark: %v: %s", err, stderr.String()) + } + + var out [][]string + + for line := range strings.SplitSeq(strings.TrimRight(string(res), "\n"), "\n") { + cols := strings.Split(line, "|") + if len(cols) != 5 { + t.Fatalf("unexpected tshark output %q", line) + } + + out = append(out, cols) + } + + return out +} + +func hexDump(dump *strings.Builder, b []byte) { + for off := 0; off < len(b); off += 16 { + fmt.Fprintf(dump, "%06x %s\n", off, hexSpaced(b[off:min(off+16, len(b))])) + } +} + +func TestRawPDUTshark(t *testing.T) { + tshark, err1 := exec.LookPath("tshark") + text2pcap, err2 := exec.LookPath("text2pcap") + + if err1 != nil || err2 != nil { + t.Skip("tshark/text2pcap not installed") + } + + type expect struct { + source string + id1, id2 string + } + + var ( + origDump, splicedDump strings.Builder + expects []expect + ) + + for _, c := range loadCorpus(t) { + p, err := ParseRawPDU(c.b) + if err != nil { + t.Fatalf("%s: %v", c.source, err) + } + + e := expect{source: c.source} + + if p.Index(IDAMFUENGAPID) >= 0 { + if err := p.SetAMFUENGAPID(1099511627775); err != nil { + t.Fatal(err) + } + + e.id1 = strconv.FormatUint(1099511627775, 10) + } + + if p.Index(IDRANUENGAPID) >= 0 { + if err := p.SetRANUENGAPID(4294967295 - 1); err != nil { + t.Fatal(err) + } + + e.id2 = strconv.FormatUint(4294967295-1, 10) + } + + out, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + hexDump(&origDump, c.b) + hexDump(&splicedDump, out) + + expects = append(expects, e) + } + + orig := tsharkFields(t, tshark, text2pcap, origDump.String()) + spliced := tsharkFields(t, tshark, text2pcap, splicedDump.String()) + + if len(orig) != len(expects) || len(spliced) != len(expects) { + t.Fatalf("tshark decoded %d/%d frames, want %d", len(orig), len(spliced), len(expects)) + } + + var withIDs int + + for i, cols := range spliced { + e := expects[i] + + if cols[3] != orig[i][3] || cols[4] != orig[i][4] { + t.Errorf("frame %d (%s): splice changed tshark's verdict from %q to %q", i+1, e.source, strings.Join(orig[i][3:], "|"), strings.Join(cols[3:], "|")) + } + + if strings.HasPrefix(e.source, "open5gs") && (cols[3] != "" || strings.Contains(cols[4], "8388608")) { + t.Errorf("frame %d (%s): tshark reports an error: %q", i+1, e.source, strings.Join(cols, "|")) + } + + if e.id1 != "" && !slices.Contains(strings.Split(cols[1], ","), e.id1) { + t.Errorf("frame %d (%s): AMFUENGAPID %q, want %s", i+1, e.source, cols[1], e.id1) + } + + if e.id2 != "" && !slices.Contains(strings.Split(cols[2], ","), e.id2) { + t.Errorf("frame %d (%s): RANUENGAPID %q, want %s", i+1, e.source, cols[2], e.id2) + } + + if e.id1 != "" || e.id2 != "" { + withIDs++ + } + } + + t.Logf("tshark decoded %d spliced PDUs, %d with rewritten UE IDs", len(spliced), withIDs) +} + +func hexSpaced(b []byte) string { + parts := make([]string, len(b)) + for i, x := range b { + parts[i] = fmt.Sprintf("%02x", x) + } + + return strings.Join(parts, " ") +} + +func TestRawPDURefusesPrivateMessage(t *testing.T) { + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcPrivateMessage, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x00, 0x00}}) + if err != nil { + t.Fatal(err) + } + + if _, err := ParseRawPDU(b); err == nil { + t.Fatal("PrivateMessage accepted as a ProtocolIE-Container") + } +} + +func TestRawPDUSetAbsentIE(t *testing.T) { + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcErrorIndication, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x00, 0x00}}) + if err != nil { + t.Fatal(err) + } + + p, err := ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + if err := p.SetAMFUENGAPID(1); !errors.Is(err, ErrIENotPresent) { + t.Fatalf("Set on an absent IE: %v", err) + } + + if _, ok, err := p.AMFUENGAPID(); ok || err != nil { + t.Fatalf("Get on an absent IE: %v %v", ok, err) + } + + if err := p.Insert(0, RawIE{ID: IDAMFUENGAPID, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x05}}); err != nil { + t.Fatal(err) + } + + if v, ok, err := p.AMFUENGAPID(); !ok || err != nil || v != 5 { + t.Fatalf("after Insert: %v %v %v", v, ok, err) + } +} + +func TestRawPDUUnmodeledProcedure(t *testing.T) { + id, err := per.Marshal(AMFUENGAPID(42)) + if err != nil { + t.Fatal(err) + } + + body := per.NewWriter() + body.WriteBit(false) + + if err := encodeIEContainer(body, per.Aligned, []ieField{ + {id: 60000, crit: CriticalityNotify, raw: []byte{0xde, 0xad}}, + {id: IDAMFUENGAPID, crit: CriticalityReject, raw: id}, + {id: 60001, crit: CriticalityIgnore, raw: bytes.Repeat([]byte{0xbe}, 200)}, + }); err != nil { + t.Fatal(err) + } + + for _, pdu := range []PDU{ + &InitiatingMessage{ProcedureCode: 250, Criticality: CriticalityIgnore, Value: body.Bytes()}, + &SuccessfulOutcome{ProcedureCode: 251, Criticality: CriticalityReject, Value: body.Bytes()}, + &UnsuccessfulOutcome{ProcedureCode: 252, Criticality: CriticalityNotify, Value: body.Bytes()}, + } { + b, err := Marshal(pdu) + if err != nil { + t.Fatal(err) + } + + p, err := ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + if int(p.Trigger()) != pdu.choiceIndex() || p.ProcedureCode() != pdu.procedureCode() || p.Criticality() != pdu.criticality() { + t.Fatalf("header %d/%d/%d", p.Trigger(), p.ProcedureCode(), p.Criticality()) + } + + if err := p.SetAMFUENGAPID(1099511627775); err != nil { + t.Fatal(err) + } + + out, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + back, err := ParseRawPDU(out) + if err != nil { + t.Fatal(err) + } + + if v, ok, err := back.AMFUENGAPID(); !ok || err != nil || uint64(v) != 1099511627775 { + t.Fatalf("AMFUENGAPID = %v %v %v", v, ok, err) + } + + ies := back.IEs() + if len(ies) != 3 || ies[0].ID != 60000 || ies[0].Criticality != CriticalityNotify || !bytes.Equal(ies[0].Value, []byte{0xde, 0xad}) || + ies[2].ID != 60001 || len(ies[2].Value) != 200 { + t.Fatalf("other IEs disturbed: %+v", ies) + } + } +} + +func FuzzRawPDU(f *testing.F) { + for _, c := range loadCorpus(f) { + f.Add(c.b) + } + + f.Fuzz(func(t *testing.T, data []byte) { + p, err := ParseRawPDU(data) + if err != nil { + return + } + + out, err := p.Marshal() + if err != nil || !bytes.Equal(out, data) { + t.Fatalf("identity: %v", err) + } + + for i := range p.Len() { + ie, err := p.IE(i) + if err != nil { + t.Fatal(err) + } + + if err := p.SetValue(i, ie.Value); err != nil { + t.Fatal(err) + } + } + + out, err = p.Marshal() + if err != nil || !bytes.Equal(out, data) { + t.Fatalf("same-value replace: %v", err) + } + + if p.Index(IDAMFUENGAPID) < 0 { + return + } + + if err := p.SetAMFUENGAPID(1099511627775); err != nil { + t.Fatal(err) + } + + out, err = p.Marshal() + if err != nil { + t.Fatal(err) + } + + back, err := ParseRawPDU(out) + if err != nil { + t.Fatalf("re-parse: %v", err) + } + + if v, ok, err := back.AMFUENGAPID(); !ok || err != nil || uint64(v) != 1099511627775 { + t.Fatalf("AMFUENGAPID after splice: %v %v %v", v, ok, err) + } + }) +} diff --git a/ngap/raw_pdu_ue_ids.go b/ngap/raw_pdu_ue_ids.go new file mode 100644 index 0000000000..ffe9600399 --- /dev/null +++ b/ngap/raw_pdu_ue_ids.go @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +func (p *RawPDU) AMFUENGAPID() (AMFUENGAPID, bool, error) { + var v AMFUENGAPID + + ok, err := p.Get(IDAMFUENGAPID, &v) + + return v, ok, err +} + +func (p *RawPDU) SetAMFUENGAPID(v AMFUENGAPID) error { return p.Set(IDAMFUENGAPID, v) } + +func (p *RawPDU) RANUENGAPID() (RANUENGAPID, bool, error) { + var v RANUENGAPID + + ok, err := p.Get(IDRANUENGAPID, &v) + + return v, ok, err +} + +func (p *RawPDU) SetRANUENGAPID(v RANUENGAPID) error { return p.Set(IDRANUENGAPID, v) } + +func (p *RawPDU) SourceAMFUENGAPID() (AMFUENGAPID, bool, error) { + var v AMFUENGAPID + + ok, err := p.Get(IDSourceAMFUENGAPID, &v) + + return v, ok, err +} + +func (p *RawPDU) SetSourceAMFUENGAPID(v AMFUENGAPID) error { return p.Set(IDSourceAMFUENGAPID, v) } + +func (p *RawPDU) NewAMFUENGAPID() (AMFUENGAPID, bool, error) { + var v AMFUENGAPID + + ok, err := p.Get(IDNewAMFUENGAPID, &v) + + return v, ok, err +} + +func (p *RawPDU) SetNewAMFUENGAPID(v AMFUENGAPID) error { return p.Set(IDNewAMFUENGAPID, v) } + +func (p *RawPDU) UENGAPIDs() (UENGAPIDs, bool, error) { + var v UENGAPIDs + + ok, err := p.Get(IDUENGAPIDs, &v) + + return v, ok, err +} + +func (p *RawPDU) SetUENGAPIDs(v UENGAPIDs) error { return p.Set(IDUENGAPIDs, v) } diff --git a/ngap/reroute_nas.go b/ngap/reroute_nas.go new file mode 100644 index 0000000000..5a6f2f9c6e --- /dev/null +++ b/ngap/reroute_nas.go @@ -0,0 +1,243 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import "github.com/ellanetworks/core/per" + +const maxnoofPartiallyAllowedSNSSAIs = 8 + +const ( + configuredNSSAILen = 128 + rejectedNSSAILen = 32 +) + +type NGAPMessage []byte + +func (n NGAPMessage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, n) +} + +func (n *NGAPMessage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *n = b + + return nil +} + +type ConfiguredNSSAI [configuredNSSAILen]byte + +func (c ConfiguredNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, configuredNSSAILen, configuredNSSAILen, true, true, false, c[:]) +} + +func (c *ConfiguredNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, configuredNSSAILen, configuredNSSAILen, true, true, false) + if err != nil { + return err + } + + copy(c[:], b) + + return nil +} + +type RejectedNSSAIinPLMN [rejectedNSSAILen]byte + +func (n RejectedNSSAIinPLMN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, rejectedNSSAILen, rejectedNSSAILen, true, true, false, n[:]) +} + +func (n *RejectedNSSAIinPLMN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, rejectedNSSAILen, rejectedNSSAILen, true, true, false) + if err != nil { + return err + } + + copy(n[:], b) + + return nil +} + +type RejectedNSSAIinTA [rejectedNSSAILen]byte + +func (n RejectedNSSAIinTA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, rejectedNSSAILen, rejectedNSSAILen, true, true, false, n[:]) +} + +func (n *RejectedNSSAIinTA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, rejectedNSSAILen, rejectedNSSAILen, true, true, false) + if err != nil { + return err + } + + copy(n[:], b) + + return nil +} + +// TS 38.413 §9.3.3.27. +type SourceToTargetAMFInformationReroute struct { + _ [0]struct{} `per:"extseq"` + ConfiguredNSSAI *ConfiguredNSSAI `per:",optional"` + RejectedNSSAIinPLMN *RejectedNSSAIinPLMN `per:",optional"` + RejectedNSSAIinTA *RejectedNSSAIinTA `per:",optional"` + _ ieExtensions `per:",skip"` +} + +type PartiallyAllowedNSSAIItem struct { + _ [0]struct{} `per:"extseq"` + SNSSAI SNSSAI + _ ieExtensions `per:",skip"` +} + +// TS 38.413 §9.3.1.261. +type PartiallyAllowedNSSAI []PartiallyAllowedNSSAIItem + +func (p PartiallyAllowedNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPartiallyAllowedSNSSAIs, []PartiallyAllowedNSSAIItem(p)) +} + +func (p *PartiallyAllowedNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PartiallyAllowedNSSAIItem](r, enc, 1, maxnoofPartiallyAllowedSNSSAIs) + if err != nil { + return err + } + + *p = items + + return nil +} + +// TS 38.413 §9.2.5.5. +type RerouteNASRequest struct { + RANUENGAPID RANUENGAPID + AMFUENGAPID *AMFUENGAPID + NGAPMessage NGAPMessage + AMFSetID AMFSetID + AllowedNSSAI AllowedNSSAI + SourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute + PartiallyAllowedNSSAI PartiallyAllowedNSSAI + + messageMeta +} + +var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ + { + id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.RANUENGAPID) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.RANUENGAPID, true }, + }, + { + id: IDAMFUENGAPID, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + var v AMFUENGAPID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.AMFUENGAPID = &v + + return nil + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + if m.AMFUENGAPID == nil { + return nil, false + } + + return m.AMFUENGAPID, true + }, + }, + { + id: IDNGAPMessage, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.NGAPMessage) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.NGAPMessage, true }, + }, + { + id: IDAMFSetID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AMFSetID) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.AMFSetID, true }, + }, + { + id: IDAllowedNSSAI, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AllowedNSSAI) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + if len(m.AllowedNSSAI) == 0 { + return nil, false + } + + return m.AllowedNSSAI, true + }, + }, + { + id: IDSourceToTargetAMFInformationReroute, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + var v SourceToTargetAMFInformationReroute + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.SourceToTargetAMFInformationReroute = &v + + return nil + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + if m.SourceToTargetAMFInformationReroute == nil { + return nil, false + } + + return m.SourceToTargetAMFInformationReroute, true + }, + }, + { + id: IDPartiallyAllowedNSSAI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.PartiallyAllowedNSSAI) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + if len(m.PartiallyAllowedNSSAI) == 0 { + return nil, false + } + + return m.PartiallyAllowedNSSAI, true + }, + }, +} + +func (m *RerouteNASRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcRerouteNASRequest, rerouteNASRequestIEs, m) +} + +func (m *RerouteNASRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcRerouteNASRequest, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseRerouteNASRequest(value []byte) (*RerouteNASRequest, error) { + return parseMessageBody[RerouteNASRequest](ProcRerouteNASRequest, TriggeringInitiatingMessage, rerouteNASRequestIEs, value) +} diff --git a/ngap/reset_extensions_test.go b/ngap/reset_extensions_test.go new file mode 100644 index 0000000000..e1d9d40d58 --- /dev/null +++ b/ngap/reset_extensions_test.go @@ -0,0 +1,206 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "testing" + + "github.com/ellanetworks/core/per" +) + +type handItem struct { + amf *uint64 + ran *uint32 + extCrit Criticality + withExt bool + withAdditions bool +} + +func mustNil(t *testing.T, err error) { + t.Helper() + + if err != nil { + t.Fatal(err) + } +} + +func encodeHandItem(t *testing.T, w *per.Writer, it handItem) { + t.Helper() + + enc := per.Aligned + + w.WriteBit(it.withAdditions) + w.WriteBit(it.amf != nil) + w.WriteBit(it.ran != nil) + w.WriteBit(it.withExt) + + if it.amf != nil { + mustNil(t, AMFUENGAPID(*it.amf).MarshalPER(w, enc)) + } + + if it.ran != nil { + mustNil(t, RANUENGAPID(*it.ran).MarshalPER(w, enc)) + } + + if it.withExt { + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, 2)) + + for i, id := range []int64{999, 1000} { + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 0, maxProtocolIEs, id)) + mustNil(t, per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(it.extCrit))) + mustNil(t, per.EncodeOpenTypeBytes(w, enc, bytes.Repeat([]byte{0xab}, 1+i*200))) + } + } + + if it.withAdditions { + mustNil(t, per.EncodeNormallySmallLength(w, enc, 3, func(int64) error { + w.WriteBit(true) + w.WriteBit(false) + w.WriteBit(true) + + return nil + })) + mustNil(t, per.EncodeOpenTypeBytes(w, enc, []byte{0x11})) + mustNil(t, per.EncodeOpenTypeBytes(w, enc, []byte{0x22, 0x33})) + } +} + +func encodeHandList(t *testing.T, w *per.Writer, items []handItem) { + t.Helper() + + mustNil(t, per.EncodeLength(w, per.Aligned, 1, maxnoofNGConnectionsToReset, true, int64(len(items)), func(int64) error { + for _, it := range items { + encodeHandItem(t, w, it) + } + + return nil + })) +} + +func handNGReset(t *testing.T, items []handItem) []byte { + t.Helper() + + rt := per.NewWriter() + mustNil(t, per.EncodeConstrainedWholeNumber(rt, per.Aligned, 0, resetTypeAlternatives-1, resetTypePartOfNGInterface)) + encodeHandList(t, rt, items) + + cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + mustNil(t, err) + + body := per.NewWriter() + body.WriteBit(false) + mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ + {id: IDCause, crit: CriticalityIgnore, raw: cause}, + {id: IDResetType, crit: CriticalityReject, raw: rt.Bytes()}, + })) + + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcNGReset, Criticality: CriticalityReject, Value: body.Bytes()}) + mustNil(t, err) + + return b +} + +func handNGResetAck(t *testing.T, items []handItem) []byte { + t.Helper() + + list := per.NewWriter() + encodeHandList(t, list, items) + + body := per.NewWriter() + body.WriteBit(false) + mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ + {id: IDUEAssociatedLogicalNGConnectionList, crit: CriticalityIgnore, raw: list.Bytes()}, + })) + + b, err := Marshal(&SuccessfulOutcome{ProcedureCode: ProcNGReset, Criticality: CriticalityReject, Value: body.Bytes()}) + mustNil(t, err) + + return b +} + +func u64(v uint64) *uint64 { return &v } +func u32(v uint32) *uint32 { return &v } + +func resetFixtures(amf uint64) []handItem { + return []handItem{ + {amf: u64(amf), ran: u32(7), extCrit: CriticalityIgnore, withExt: true, withAdditions: true}, + {ran: u32(8), extCrit: CriticalityNotify, withExt: true}, + {amf: u64(amf + 1), withAdditions: true}, + {amf: u64(amf + 2), ran: u32(9)}, + } +} + +func TestNGResetPreservesItemExtensions(t *testing.T) { + in := handNGReset(t, resetFixtures(5)) + + pdu, err := Unmarshal(in) + mustNil(t, err) + + m, err := ParseNGReset(pdu.value()) + mustNil(t, err) + + out, err := m.Marshal() + mustNil(t, err) + + if !bytes.Equal(out, in) { + t.Fatalf("unmodified NG Reset re-encoded differently\n got % x\nwant % x", out, in) + } + + for i := range m.ResetType.Part { + if m.ResetType.Part[i].AMFUENGAPID != nil { + v := *m.ResetType.Part[i].AMFUENGAPID - 5 + 0xFFFFFFFFFF - 2 + m.ResetType.Part[i].AMFUENGAPID = &v + } + } + + out, err = m.Marshal() + mustNil(t, err) + + if want := handNGReset(t, resetFixtures(0xFFFFFFFFFF-2)); !bytes.Equal(out, want) { + t.Fatalf("rewritten NG Reset differs\n got % x\nwant % x", out, want) + } +} + +func TestNGResetAcknowledgePreservesItemExtensions(t *testing.T) { + in := handNGResetAck(t, resetFixtures(70000)) + + pdu, err := Unmarshal(in) + mustNil(t, err) + + m, err := ParseNGResetAcknowledge(pdu.value()) + mustNil(t, err) + + out, err := m.Marshal() + mustNil(t, err) + + if !bytes.Equal(out, in) { + t.Fatalf("unmodified NG Reset Acknowledge re-encoded differently\n got % x\nwant % x", out, in) + } + + for i := range m.ConnectionList { + if m.ConnectionList[i].AMFUENGAPID != nil { + v := *m.ConnectionList[i].AMFUENGAPID - 70000 + 3 + m.ConnectionList[i].AMFUENGAPID = &v + } + } + + out, err = m.Marshal() + mustNil(t, err) + + if want := handNGResetAck(t, resetFixtures(3)); !bytes.Equal(out, want) { + t.Fatalf("rewritten NG Reset Acknowledge differs\n got % x\nwant % x", out, want) + } +} + +func TestNGResetItemRejectExtensionNotComprehended(t *testing.T) { + in := handNGReset(t, []handItem{{amf: u64(1), extCrit: CriticalityReject, withExt: true}}) + + pdu, err := Unmarshal(in) + mustNil(t, err) + + if _, err := ParseNGReset(pdu.value()); err == nil { + t.Fatal("reject-criticality item extension accepted") + } +} diff --git a/ngap/testdata/captures/open5gs.txt b/ngap/testdata/captures/open5gs.txt new file mode 100644 index 0000000000..27a6d9f461 --- /dev/null +++ b/ngap/testdata/captures/open5gs.txt @@ -0,0 +1,117 @@ +00150037000004001b00080009f107000100000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +201500320000040001000e05806f70656e3567732d616d663000600008000009f10702004000564001ff005000080009f10700000008 +000f00490000050055000200010026001f1e7e004179000bf2000000000000000000002e02f0f01707f0f0c0400180300079000f4009f107000040001009f107000001005a4001180070400100 +00044018000003000a0002000100550002000100260005047e005b01 +002e4039000004000a0002000100550002000100260013127e005c000d0109f107f0ff000000002031900079400f4009f107000040001009f107000001 +0004403e000003000a000200010055000200010026002b2a7e005600020000213527919dcefbc89511fc63a56101118c20104bd76e8d3ebf80006f9c8a54556a89aa +002e403c000004000a0002000100550002000100260016157e00572d10c1399f835bd6b1606c645f5adf8ad5ab0079400f4009f107000040001009f107000001 +00044027000003000a0002000100550002000100260014137e03c0e3083a007e005d010002f0f0e1360102 +002e406f000004000a0002000100550002000100260049487e048905b1aa007e005e7700098566050704405003f171002f7e004179000bf2000000000000000000001001032e02f0f02f0201015209f1070000011707f0f0c0400180301801010079400f4009f107000040001009f107000001 +000e00809e000009000a00020001005500020001006e000a0c3e800000303e800000001c00070009f107020040000000020001007700091c000e000000000000005e0020b22817f02c1b87f2224629a31ad5055c1292bd5d9f95a7f40ba1b22e6f35d447002240088665070400ffff010026402f2e7e02b98641ab017e0042010177000bf209f107020040c7004bb354072009f10700000115020101210201005e0129 +002c4081ad000003000a0002000100550002000100754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +200e000f000002000a40020001005540020001 +002e4031000004000a000200010055000200010026000b0a7e02b0b79770017e00430079400f4009f107000040001009f107000001 +0004403a000003000a0002000100550002000100260027267e021e4a3911027e0054430f10004f00700065006e0035004700534702802251350169490100 +002e405a000004000a0002000100550002000100260034337e02f9b4ddfd027e00670100152e0501c1ffff93a17b000a80000a00000300000d00120581220101250908696e7465726e65740079400f4009f107000040001009f107000001 +001d0080df000003000a00020001005500020001004a0080cb00400580847e02ff9a1baa037e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000020a2d00022201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000100860001200088000700010000091c00 +201d0024000003000a40020001005540020001004b00110000050d0003e07f000002000000010001 +000f0080a20000060055000200020026006d6c7e01f8d9d52f037e00410a000bf209f107020040c7004bb31001032e02f0f02f0201015209f1070000011707f0f0c0400180301801017100337e00410a000bf209f107020040c7004bb31001032e02f0f02f0201015209f1070000011707f0f0c040018030400220001801010079000f4009f107000040001009f107000001005a400118001a4007001000c7004bb30070400100 +000e00827b00000b000a00020002005500020002006e000a0c3e800000303e800000001c00070009f1070200400047004500000500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000100860001200088000700010000091c00000000020001007700091c000e000000000000005e002023195d611675962a7476cfb0c7c6870c8f5a669f28630389dcad0d7c8270b8b700754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000002240088665070400ffff0100264025247e02c098f4a9047e0042010154072009f1070000011502010121020100260200005e0129 +200e0024000003000a40020002005540020002004840110000050d0003e07f000002000000010001 +000f006c00000600550002000300260037367e01f7bd3e5b047e00410b000bf209f107020040000012341001032e02f0f02f0201015209f1070000011707f0f0c0400180301801010079000f4009f107000040001009f107000001005a400118001a4007001000000012340070400100 +00044018000003000a0002000300550002000300260005047e005b01 +002e4039000004000a0002000300550002000300260013127e005c000d0109f107f0ff000000002031900079400f4009f107000040001009f107000001 +0004403e000003000a000200030055000200030026002b2a7e005601020000215761c8647a28cbaeb20f45260f1a673320106d0a517e5f2b8000f11421280c9a9b7c +002e403c000004000a0002000300550002000300260016157e00572d102845ca1645c21678f2fb43bd3299a5030079400f4009f107000040001009f107000001 +00044027000003000a0002000300550002000300260014137e03ffd6f448007e005d010102f0f0e1360102 +002e406f000004000a0002000300550002000300260049487e04c38ebd1d007e005e7700098566050704405003f171002f7e00410b000bf209f107020040000012341001032e02f0f02f0201015209f1070000011707f0f0c0400180301801010079400f4009f107000040001009f107000001 +000e00809e000009000a00020003005500020003006e000a0c3e800000303e800000001c00070009f107020040000000020001007700091c000e000000000000005e0020bba5fa1d6d250b36c5fdc5320749a69adff83b58cb74a2a76f4765c2489c99f0002240088665070400ffff010026402f2e7e02932a946b017e0042010177000bf209f107020040d00028ca54072009f10700000115020101210201005e0129 +200e000f000002000a40020003005540020003 +0004403a000003000a0002000300550002000300260027267e0236b9cfd2027e0054430f10004f00700065006e0035004700534702802251350169490100 +001d0080df000003000a00020003005500020003004a0080cb00400580847e026af75d37037e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000030a2d00032201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000200860001200088000700010000091c00 +201d0024000003000a40020003005540020003004b00110000050d0003e07f000002000000010001 +00150038000004001b00090009f10728000800000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +000f004e00000500550002000100260024237e004179000d0109f107f0ff000000002031901001032e02f0f01707f0f0c0400180300079000f4009f107000040001009f107000001005a4001180070400100 +002900100000020072000400040001000f400140 +2029000f000002000a40020004005540020001 +00150037000004001b00080009f107080080000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +000f004b00000500550002000100260021207e004179000d0109f107f0ff000000002031902e02f0f01707f0f0c0400180300079000f4009f107000040001009f107000001005a4001180070400100 +000e00809e000009000a00020005005500020001006e000a0c3e800000303e800000001c00070009f107020040000000020001007700091c000e000000000000005e0020ba7fe6336e3759c9dd2ff4484aec851529c0e40c74544b74328c9a4647301706002240088665070400ffff010026402f2e7e02c30c6eff017e0042010177000bf209f107020040f100c84354072009f10700000115020101210201005e0129 +002c4081ad000003000a0002000500550002000100754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +200e000f000002000a40020005005540020001 +001d0080df000003000a00020005005500020001004a0080cb00400580847e0218da0007037e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000040a2d00042201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000300860001200088000700010000091c00 +201d0024000003000a40020005005540020001004b00110000050d0003e07f000002000000030001 +002a401c000004000a0002000500550002000100850003000005000f40020500 +002900100000020072000400050001000f400140 +2029000f000002000a40020005005540020001 +000f005e00000600550002000200260029287e015c9e0b24037e004c000007f40040f100c8437100117e004c000007f40040f100c843500220000079000f4009f107000040001009f107000001005a400118001a4007001000f100c8430070400100 +000e00821c00000a000a00020006005500020002006e000a0c3e800000303e800000001c00070009f107020040000000020001007700091c000e000000000000005e00207a2bffa74249e69b723f63ef1bce35d7fe3a6efe7b94d4f672ea46972d9963d000754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000002240088665070400ffff010026400f0e7e02c0db0820047e004e50022000 +200e0024000003000a40020006005540020002004840110000050d0003e07f000002000000030001 +002a401c000004000a0002000600550002000200850003000005000f40020500 +002900100000020072000400060002000f400140 +2029000f000002000a40020006005540020002 +000f005e00000600550002000300260029287e01d33a636b047e004c000007f40040f100c8437100117e004c000007f40040f100c843400220000079000f4009f107000040001009f107000001005a400118001a4007001000f100c8430070400100 +000e00826500000b000a00020007005500020003006e000a0c3e800000303e800000001c00070009f1070200400047004500000500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000300860001200088000700010000091c00000000020001007700091c000e000000000000005e0020e4d129f0b35c3e2b95459dfab48d04fd8ab06c9d79c192137487503a3bf1515400754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000002240088665070400ffff010026400f0e7e023897d81e057e004e26020000 +200e0024000003000a40020007005540020003004840110000050d0003e07f000002000000030001 +00150037000004001b00080009f107100040000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +000e00823c00000a000a00020008005500020001006e000a0c3e800000303e800000001c00070009f107020040000000020001007700091c000e000000000000005e0020d0f3938a0348b1ff4147140e414851b11357f209a94e71b9cfca64d51904bd2a00754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000002240088665070400ffff010026402f2e7e026cde37bb017e0042010177000bf209f107020040f100c84354072009f10700000115020101210201005e0129 +002c4081ad000003000a0002000800550002000100754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +200e000f000002000a40020008005540020001 +002a401c000004000a0002000800550002000100850003000005000f40020500 +002900100000020072000400080001000f400140 +2029000f000002000a40020008005540020001 +000f005e00000600550002000200260029287e01f7fc31bc027e004c000007f40040f100c8437100117e004c000007f40040f100c843500200000079000f4009f107000040001009f107000001005a400118001a4007001000f100c8430070400100 +000e00821c00000a000a00020009005500020002006e000a0c3e800000303e800000001c00070009f107020040000000020001007700091c000e000000000000005e0020ffc76dbbdb2c477f42dac0be875758283e3ecc92e71ca9dbee8e3aeaea39300a00754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000002240088665070400ffff010026400f0e7e02519660cb037e004e50020000 +200e000f000002000a40020009005540020002 +00150038000004001b00090009f10718002000000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +002c4081ad000003000a0002000a00550002000100754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +001d0080df000003000a0002000a005500020001004a0080cb00400580847e0278185ea2037e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000050a2d00052201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000400860001200088000700010000091c00 +201d0024000003000a4002000a005540020001004b00110000050d0003e07f000002000000050001 +00150038000004001b00090009f10730000400000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +002c4081ad000003000a0002000c00550002000100754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +002a4015000003000a0002000c005500020001000f40020500 +0029001000000200720004000c0001000f400140 +2029000f000002000a4002000c005540020001 +001d0080df000003000a0002000d005500020002004a0080cb00400580847e02cf865658047e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000060a2d00062201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000500860001200088000700010000091c00 +201d0024000003000a4002000d005540020002004b00110000050d0003e07f000002000000060001 +002a4015000003000a00020002005500020002000f40020500 +00094015000003000a40020002005540020002000f40020380 +0029001000000200720004000e0003000f400148 +2029000f000002000a4002000e005540020003 +002c4081ad000003000a0002000f00550002000100754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +001d0080df000003000a0002000f005500020001004a0080cb00400580847e02d9ef9afe037e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000070a2d00072201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000600860001200088000700010000091c00 +201d0024000003000a4002000f005540020001004b00110000050d0003e07f000002000000070001 +002a401c000004000a0002000f00550002000100850003000005000f40020500 +0029001000000200720004000f0001000f400140 +2029000f000002000a4002000f005540020001 +001d0080df000003000a00020010005500020002004a0080cb00400580847e0226ad1135057e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000080a2d00082201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000700860001200088000700010000091c00 +201d0024000003000a40020010005540020002004b00110000050d0003e07f000002000000070001 +002c4081ad000003000a0002001100550002000000754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +001d0080df000003000a00020011005500020000004a0080cb00400580847e02f7c61aa8037e00680100752e0501c213000901000631210101ff01060a00030a0003290d0300000000000000090a2d00092201017900060120410101097b0035800003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404250908696e7465726e6574120500203f0000040082000a0c3e800000303e800000008b001a09f07f000007000000000000000000000000000000010000000800860001200088000700010000091c00 +201d0024000003000a40020011005540020000004b00110000050d0003e07f000002000000080001 +002a401c000004000a0002001100550002000000850003000005000f40020500 +002900100000020072000400110000000f400140 +2029000f000002000a40020011005540020000 +00150038000004001b00090009f10720001000000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +002c4081ad000003000a0002001300550002000100754081998197040ca1080fde1a00000074e5a031e000380a03c1260c80038d80818804804c0203018022a36146b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a36266b040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c002a3626eb040d0d000120098087ad8202020e1de38720c38002064f1f570000f001c0003c0003403898000000e4807134000001c900e140000003900884070226c70e04089b1c3810226c70e007b0380c000a07010140c00a0341f000080000000032a68020800004b2ca82000032cb2800a955d52a9a0207000b000000040080118b1000020406071112131b1f2125262728292a4a50123bb4000200020818391244cd9f429532750a551021ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21ffff21fffffe0dd8860028070690000000054888af4100001a47a08000023fe40000331401c36980610fffffffff3550002004524000080000412c38042609a143c0c0000041000041043940000000000 +001c0031000004000a0002001500550002000100264015147e0268ddb670047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a40020015005540020001004640050000050100 +001c0031000004000a0002001700550002000100264015147e028831a250047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a40020017005540020001004640050000050100 +001c0031000004000a0002001800550002000200264015147e02e961d884047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a40020018005540020002004640050000050100 +001c0031000004000a0002001900550002000300264015147e02de0dc4ad047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a40020019005540020003004640050000050100 +001c0031000004000a0002001a00550002000400264015147e02d9e1e150047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a4002001a005540020004004640050000050100 +001c0031000004000a0002001b00550002000500264015147e025540403b047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a4002001b005540020005004640050000050100 +001c0031000004000a0002001c00550002000600264015147e029c5c7857047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a4002001c005540020006004640050000050100 +001c0031000004000a0002001d00550002000700264015147e0233b418f8047e00680100052e0501d3241205004f00050000050110 +201c0018000003000a4002001d005540020007004640050000050100 +00150038000004001b00090009f10738000200000052400b0400354720674e422d43550066001000000000010009f107000010080100000015400100 +400e0015000003000a40020025005540020001000f40020540 +201500320000040001000e05806f70656e3567732d616d663000600008000000f11002004000564001ff005000080000f11000000008 +002a401c000004000a0002000100550002000100850003000005000f40020500 +201500320000040001000e05806f70656e3567732d616d663000600008000099f90702004000564001ff005000080099f90700000008 diff --git a/ngap/testdata/fuzz/FuzzRawPDU/a9b1313141f783c8 b/ngap/testdata/fuzz/FuzzRawPDU/a9b1313141f783c8 new file mode 100644 index 0000000000..e02808134e --- /dev/null +++ b/ngap/testdata/fuzz/FuzzRawPDU/a9b1313141f783c8 @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("000\x180\x00\x03000\x0200000\x0200000\x0000000") diff --git a/per/extension.go b/per/extension.go new file mode 100644 index 0000000000..903107ce6a --- /dev/null +++ b/per/extension.go @@ -0,0 +1,101 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package per + +type ExtensionAdditions struct { + present []bool + fields []rawBits +} + +type rawBits struct { + data []byte + nbits int +} + +func (e *ExtensionAdditions) Present() bool { return len(e.present) > 0 } + +func (e *ExtensionAdditions) MarshalPER(w *Writer, enc Encoding) error { + if len(e.present) == 0 { + return nil + } + + off := 0 + + err := EncodeNormallySmallLength(w, enc, int64(len(e.present)), func(count int64) error { + end := off + int(count) + for _, p := range e.present[off:end] { + w.WriteBit(p) + } + + off = end + + return nil + }) + if err != nil { + return err + } + + for _, f := range e.fields { + if enc == Aligned { + w.AlignToByte() + } + + w.WriteBitString(f.data, f.nbits) + } + + return nil +} + +func (e *ExtensionAdditions) UnmarshalPER(r *Reader, enc Encoding) error { + var present []bool + + err := DecodeNormallySmallLength(r, enc, func(count int64) error { + if int64(r.Bits()) < count { + return ErrTruncated + } + + for range count { + b, err := r.ReadBit() + if err != nil { + return err + } + + present = append(present, b) + } + + return nil + }) + if err != nil { + return err + } + + var fields []rawBits + + for _, p := range present { + if !p { + continue + } + + if enc == Aligned { + r.AlignToByte() + } + + start := r.Offset() + + if err := SkipOpenType(r, enc); err != nil { + return err + } + + data, nbits, err := r.Since(start) + if err != nil { + return err + } + + fields = append(fields, rawBits{data: data, nbits: nbits}) + } + + e.present, e.fields = present, fields + + return nil +} diff --git a/per/extension_test.go b/per/extension_test.go new file mode 100644 index 0000000000..41878a8eca --- /dev/null +++ b/per/extension_test.go @@ -0,0 +1,127 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package per + +import ( + "bytes" + "testing" +) + +func encodeAdditions(t *testing.T, enc Encoding, lead int, present []bool, values [][]byte) []byte { + t.Helper() + + w := NewWriter() + w.WriteBits(0x5, lead) + + if err := EncodeNormallySmallLength(w, enc, int64(len(present)), func(int64) error { + for _, p := range present { + w.WriteBit(p) + } + + return nil + }); err != nil { + t.Fatal(err) + } + + for _, v := range values { + if err := EncodeOpenTypeBytes(w, enc, v); err != nil { + t.Fatal(err) + } + } + + w.WriteBits(0x3, 2) + + return w.Bytes() +} + +func TestExtensionAdditionsRoundTrip(t *testing.T) { + present := []bool{true, false, true, false, false} + values := [][]byte{{0x01, 0x02}, bytes.Repeat([]byte{0x7f}, 300)} + + for _, enc := range []Encoding{Aligned, Unaligned} { + for lead := range 9 { + in := encodeAdditions(t, enc, lead, present, values) + + r := NewReader(in) + if _, err := r.ReadBits(lead); err != nil { + t.Fatal(err) + } + + var e ExtensionAdditions + if err := e.UnmarshalPER(r, enc); err != nil { + t.Fatalf("%s lead %d: %v", enc, lead, err) + } + + if !e.Present() || len(e.fields) != 2 { + t.Fatalf("%s lead %d: present %v, %d fields", enc, lead, e.present, len(e.fields)) + } + + tail, err := r.ReadBits(2) + if err != nil || tail != 0x3 { + t.Fatalf("%s lead %d: reader misplaced after additions: %v %x", enc, lead, err, tail) + } + + w := NewWriter() + w.WriteBits(0x5, lead) + + if err := e.MarshalPER(w, enc); err != nil { + t.Fatal(err) + } + + w.WriteBits(0x3, 2) + + if out := w.Bytes(); !bytes.Equal(out, in) { + t.Fatalf("%s lead %d: got % x, want % x", enc, lead, out, in) + } + } + } +} + +func TestExtensionAdditionsAbsent(t *testing.T) { + var e ExtensionAdditions + if e.Present() { + t.Fatal("zero value reports present") + } + + w := NewWriter() + if err := e.MarshalPER(w, Aligned); err != nil || w.Bits() != 0 { + t.Fatalf("absent additions wrote %d bits, err %v", w.Bits(), err) + } +} + +func TestExtensionAdditionsTruncated(t *testing.T) { + in := encodeAdditions(t, Aligned, 0, []bool{true}, [][]byte{{0x01, 0x02, 0x03}}) + + for i := range len(in) - 1 { + var e ExtensionAdditions + if err := e.UnmarshalPER(NewReader(in[:i]), Aligned); err == nil { + t.Errorf("truncation at %d accepted", i) + } + } +} + +func TestReaderSince(t *testing.T) { + r := NewReader([]byte{0xab, 0xcd, 0xef}) + if _, err := r.ReadBits(3); err != nil { + t.Fatal(err) + } + + start := r.Offset() + if _, err := r.ReadBits(10); err != nil { + t.Fatal(err) + } + + data, nbits, err := r.Since(start) + if err != nil || nbits != 10 { + t.Fatalf("Since: %v, %d bits", err, nbits) + } + + if !bytes.Equal(data, []byte{0x5e, 0x40}) { + t.Fatalf("Since = % x", data) + } + + if _, _, err := r.Since(r.Offset() + 1); err == nil { + t.Fatal("start past the reader accepted") + } +} diff --git a/per/protocolie/protocolie.go b/per/protocolie/protocolie.go new file mode 100644 index 0000000000..98ad3cc986 --- /dev/null +++ b/per/protocolie/protocolie.go @@ -0,0 +1,375 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package protocolie + +import ( + "bytes" + "errors" + "fmt" + + "github.com/ellanetworks/core/per" +) + +const ( + pduChoiceCount = 3 + maxProcedureCode = 255 + criticalityCount = 3 + maxProtocolIEs = 65535 + minFieldOctets = 4 + fragmentedForm = 0xC0 +) + +var ( + ErrExtensionAlternative = errors.New("protocolie: PDU extension alternative") + ErrNotProtocolIEContainer = errors.New("protocolie: message body is not a ProtocolIE-Container") + ErrIndex = errors.New("protocolie: field index out of range") + ErrTooManyFields = errors.New("protocolie: more than maxProtocolIEs fields") + ErrCriticality = errors.New("protocolie: criticality out of range") +) + +type Field struct { + ID uint16 + Criticality uint8 + Value []byte +} + +type openType struct { + det []byte + content []byte + raw []byte +} + +type field struct { + id uint16 + crit uint8 + hdr []byte + val openType + content []byte +} + +type Message struct { + choice int + procedureCode uint8 + criticality uint8 + + orig []byte + head []byte + body openType + bodyHdr []byte + count []byte + fields []field + bodyTail []byte + tail []byte + + countChanged bool + dirty bool +} + +func Parse(b []byte, opaque func(procedureCode uint8) bool) (*Message, error) { + r := per.NewReader(b) + enc := per.Aligned + + ext, err := r.ReadBit() + if err != nil { + return nil, fmt.Errorf("protocolie: PDU choice: %w", err) + } + + if ext { + return nil, ErrExtensionAlternative + } + + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, pduChoiceCount-1) + if err != nil { + return nil, fmt.Errorf("protocolie: PDU choice: %w", err) + } + + pc, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProcedureCode) + if err != nil { + return nil, fmt.Errorf("protocolie: procedureCode: %w", err) + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) + if err != nil { + return nil, fmt.Errorf("protocolie: criticality: %w", err) + } + + if opaque != nil && opaque(uint8(pc)) { + return nil, ErrNotProtocolIEContainer + } + + r.AlignToByte() + headEnd := r.Offset() / 8 + + body, err := readOpenType(r, b) + if err != nil { + return nil, fmt.Errorf("protocolie: value: %w", err) + } + + m := &Message{ + choice: int(idx), + procedureCode: uint8(pc), + criticality: uint8(crit), + orig: b, + head: b[:headEnd], + body: body, + tail: b[r.Offset()/8:], + } + + if err := m.parseBody(); err != nil { + return nil, err + } + + return m, nil +} + +func (m *Message) parseBody() error { + content := m.body.content + r := per.NewReader(content) + enc := per.Aligned + + if _, err := r.ReadBit(); err != nil { + return fmt.Errorf("protocolie: message preamble: %w", err) + } + + r.AlignToByte() + hdrEnd := r.Offset() / 8 + + n, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) + if err != nil { + return fmt.Errorf("protocolie: IE count: %w", err) + } + + countEnd := r.Offset() / 8 + + if n > int64(len(content)-countEnd)/minFieldOctets { + return fmt.Errorf("protocolie: %d IEs declared in %d octets", n, len(content)-countEnd) + } + + m.bodyHdr = content[:hdrEnd] + m.count = content[hdrEnd:countEnd] + m.fields = make([]field, 0, n) + + for i := range n { + start := r.Offset() / 8 + + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) + if err != nil { + return fmt.Errorf("protocolie: IE %d id: %w", i, err) + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) + if err != nil { + return fmt.Errorf("protocolie: IE %d criticality: %w", i, err) + } + + r.AlignToByte() + hdrEnd := r.Offset() / 8 + + val, err := readOpenType(r, content) + if err != nil { + return fmt.Errorf("protocolie: IE %d value: %w", i, err) + } + + m.fields = append(m.fields, field{id: uint16(id), crit: uint8(crit), hdr: content[start:hdrEnd], val: val, content: val.content}) + } + + m.bodyTail = content[r.Offset()/8:] + + return nil +} + +func readOpenType(r *per.Reader, buf []byte) (openType, error) { + start := r.Offset() / 8 + + content, err := per.DecodeOpenTypeBytes(r, per.Aligned) + if err != nil { + return openType{}, err + } + + raw := buf[start : r.Offset()/8] + ot := openType{content: content, raw: raw} + + if raw[0]&fragmentedForm != fragmentedForm { + ot.det = raw[:len(raw)-len(content)] + } + + return ot, nil +} + +func (m *Message) Choice() int { return m.choice } + +func (m *Message) ProcedureCode() uint8 { return m.procedureCode } + +func (m *Message) Criticality() uint8 { return m.criticality } + +func (m *Message) Len() int { return len(m.fields) } + +func (m *Message) Field(i int) (Field, error) { + if i < 0 || i >= len(m.fields) { + return Field{}, ErrIndex + } + + f := m.fields[i] + + return Field{ID: f.id, Criticality: f.crit, Value: append([]byte(nil), f.content...)}, nil +} + +func (m *Message) Fields() []Field { + out := make([]Field, len(m.fields)) + for i := range m.fields { + out[i], _ = m.Field(i) + } + + return out +} + +func (m *Message) Index(id uint16) int { + for i, f := range m.fields { + if f.id == id { + return i + } + } + + return -1 +} + +func (m *Message) SetValue(i int, value []byte) error { + if i < 0 || i >= len(m.fields) { + return ErrIndex + } + + m.fields[i].content = completeEncoding(value) + m.dirty = true + + return nil +} + +func (m *Message) Insert(i int, f Field) error { + if i < 0 || i > len(m.fields) { + return ErrIndex + } + + if len(m.fields) >= maxProtocolIEs { + return ErrTooManyFields + } + + if f.Criticality >= criticalityCount { + return ErrCriticality + } + + nf := field{id: f.ID, crit: f.Criticality, content: completeEncoding(f.Value)} + + m.fields = append(m.fields, field{}) + copy(m.fields[i+1:], m.fields[i:]) + m.fields[i] = nf + m.countChanged = true + m.dirty = true + + return nil +} + +func (m *Message) Remove(i int) error { + if i < 0 || i >= len(m.fields) { + return ErrIndex + } + + m.fields = append(m.fields[:i], m.fields[i+1:]...) + m.countChanged = true + m.dirty = true + + return nil +} + +func (m *Message) Bytes() ([]byte, error) { + if !m.dirty { + return append([]byte(nil), m.orig...), nil + } + + content := make([]byte, 0, len(m.body.content)+16) + content = append(content, m.bodyHdr...) + + if m.countChanged { + w := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(len(m.fields))); err != nil { + return nil, err + } + + content = append(content, w.Bytes()...) + } else { + content = append(content, m.count...) + } + + for _, f := range m.fields { + enc, err := f.encode() + if err != nil { + return nil, err + } + + content = append(content, enc...) + } + + content = append(content, m.bodyTail...) + + body, err := m.body.encode(content) + if err != nil { + return nil, err + } + + out := make([]byte, 0, len(m.head)+len(body)+len(m.tail)) + out = append(out, m.head...) + out = append(out, body...) + out = append(out, m.tail...) + + return out, nil +} + +func (f field) encode() ([]byte, error) { + hdr := f.hdr + if hdr == nil { + w := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(f.id)); err != nil { + return nil, err + } + + if err := per.EncodeEnumerated(w, per.Aligned, criticalityCount, false, int64(f.crit)); err != nil { + return nil, err + } + + hdr = w.Bytes() + } + + val, err := f.val.encode(f.content) + if err != nil { + return nil, err + } + + out := make([]byte, 0, len(hdr)+len(val)) + out = append(out, hdr...) + + return append(out, val...), nil +} + +func (o openType) encode(content []byte) ([]byte, error) { + if o.raw != nil && bytes.Equal(content, o.content) { + return o.raw, nil + } + + if o.det != nil && len(content) == len(o.content) && len(content) > 0 { + out := make([]byte, 0, len(o.det)+len(content)) + out = append(out, o.det...) + + return append(out, content...), nil + } + + w := per.NewWriter() + if err := per.EncodeOpenTypeBytes(w, per.Aligned, content); err != nil { + return nil, err + } + + return w.Bytes(), nil +} + +func completeEncoding(value []byte) []byte { + return append([]byte{}, value...) +} diff --git a/per/protocolie/protocolie_test.go b/per/protocolie/protocolie_test.go new file mode 100644 index 0000000000..152d3c4d57 --- /dev/null +++ b/per/protocolie/protocolie_test.go @@ -0,0 +1,433 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package protocolie + +import ( + "bytes" + "errors" + "testing" + + "github.com/ellanetworks/core/per" +) + +func encodeBody(t testing.TB, fields []Field) []byte { + t.Helper() + + w := per.NewWriter() + w.WriteBit(false) + + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(len(fields))); err != nil { + t.Fatal(err) + } + + for _, f := range fields { + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(f.ID)); err != nil { + t.Fatal(err) + } + + if err := per.EncodeEnumerated(w, per.Aligned, criticalityCount, false, int64(f.Criticality)); err != nil { + t.Fatal(err) + } + + if err := per.EncodeOpenTypeBytes(w, per.Aligned, f.Value); err != nil { + t.Fatal(err) + } + } + + return w.Bytes() +} + +func encodePDU(t testing.TB, choice int, pc uint8, crit uint8, body []byte) []byte { + t.Helper() + + w := per.NewWriter() + w.WriteBit(false) + + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, pduChoiceCount-1, int64(choice)); err != nil { + t.Fatal(err) + } + + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProcedureCode, int64(pc)); err != nil { + t.Fatal(err) + } + + if err := per.EncodeEnumerated(w, per.Aligned, criticalityCount, false, int64(crit)); err != nil { + t.Fatal(err) + } + + if err := per.EncodeOpenTypeBytes(w, per.Aligned, body); err != nil { + t.Fatal(err) + } + + return w.Bytes() +} + +func mustParse(t testing.TB, b []byte) *Message { + t.Helper() + + m, err := Parse(b, nil) + if err != nil { + t.Fatalf("Parse(% x): %v", b, err) + } + + return m +} + +func mustBytes(t testing.TB, m *Message) []byte { + t.Helper() + + b, err := m.Bytes() + if err != nil { + t.Fatal(err) + } + + return b +} + +func TestParseHeaderAndFields(t *testing.T) { + fields := []Field{ + {ID: 0, Criticality: 0, Value: []byte{0x00, 0x01}}, + {ID: 8, Criticality: 0, Value: []byte{0x00, 0x07}}, + {ID: 26, Criticality: 1, Value: []byte{0x01, 0x07}}, + } + b := encodePDU(t, 1, 11, 1, encodeBody(t, fields)) + + m := mustParse(t, b) + + if m.Choice() != 1 || m.ProcedureCode() != 11 || m.Criticality() != 1 { + t.Fatalf("header = %d/%d/%d", m.Choice(), m.ProcedureCode(), m.Criticality()) + } + + got := m.Fields() + if len(got) != len(fields) { + t.Fatalf("got %d fields, want %d", len(got), len(fields)) + } + + for i := range fields { + if got[i].ID != fields[i].ID || got[i].Criticality != fields[i].Criticality || !bytes.Equal(got[i].Value, fields[i].Value) { + t.Errorf("field %d = %+v, want %+v", i, got[i], fields[i]) + } + } + + if m.Index(26) != 2 || m.Index(99) != -1 { + t.Errorf("Index: %d %d", m.Index(26), m.Index(99)) + } + + if !bytes.Equal(mustBytes(t, m), b) { + t.Fatal("unmodified re-emit differs") + } +} + +func TestEmptyContainer(t *testing.T) { + b := encodePDU(t, 0, 14, 0, encodeBody(t, nil)) + m := mustParse(t, b) + + if m.Len() != 0 { + t.Fatalf("Len = %d", m.Len()) + } + + if err := m.Insert(0, Field{ID: 2, Criticality: 1, Value: []byte{0x00}}); err != nil { + t.Fatal(err) + } + + want := encodePDU(t, 0, 14, 0, encodeBody(t, []Field{{ID: 2, Criticality: 1, Value: []byte{0x00}}})) + if got := mustBytes(t, m); !bytes.Equal(got, want) { + t.Fatalf("got % x, want % x", got, want) + } +} + +func TestSetValueLengthBoundaries(t *testing.T) { + sizes := []int{1, 2, 127, 128, 16383, 16384, 16385, 32768, 65536, 65537, 70000} + + for _, from := range sizes { + for _, to := range sizes { + fields := []Field{ + {ID: 1, Criticality: 0, Value: bytes.Repeat([]byte{0xa1}, 5)}, + {ID: 2, Criticality: 1, Value: bytes.Repeat([]byte{0xb2}, from)}, + {ID: 3, Criticality: 2, Value: bytes.Repeat([]byte{0xc3}, 3)}, + } + b := encodePDU(t, 0, 9, 0, encodeBody(t, fields)) + m := mustParse(t, b) + + if !bytes.Equal(mustBytes(t, m), b) { + t.Fatalf("%d: identity failed", from) + } + + nv := bytes.Repeat([]byte{0xd4}, to) + if err := m.SetValue(1, nv); err != nil { + t.Fatal(err) + } + + fields[1].Value = nv + want := encodePDU(t, 0, 9, 0, encodeBody(t, fields)) + + if got := mustBytes(t, m); !bytes.Equal(got, want) { + t.Fatalf("%d -> %d: re-encoded PDU differs from a fresh encoding", from, to) + } + + back := mustParse(t, want) + if f, _ := back.Field(1); !bytes.Equal(f.Value, nv) { + t.Fatalf("%d -> %d: value did not survive", from, to) + } + } + } +} + +func TestSetSameValueIsIdentity(t *testing.T) { + fields := []Field{ + {ID: 1, Criticality: 0, Value: bytes.Repeat([]byte{0x11}, 40000)}, + {ID: 2, Criticality: 1, Value: []byte{0x22}}, + } + b := encodePDU(t, 2, 3, 0, encodeBody(t, fields)) + m := mustParse(t, b) + + for i := range m.Len() { + f, _ := m.Field(i) + if err := m.SetValue(i, f.Value); err != nil { + t.Fatal(err) + } + } + + if !bytes.Equal(mustBytes(t, m), b) { + t.Fatal("replacing every value with itself changed the PDU") + } +} + +func TestNonCanonicalDeterminantKeptWhenUntouched(t *testing.T) { + b := []byte{ + 0x00, 0x0b, 0x40, 0x10, + 0x00, 0x00, 0x02, + 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x02, 0x00, 0x05, + } + m := mustParse(t, b) + + if !bytes.Equal(mustBytes(t, m), b) { + t.Fatal("identity failed") + } + + if err := m.SetValue(1, []byte{0x00, 0x09}); err != nil { + t.Fatal(err) + } + + got := mustBytes(t, m) + + want := append([]byte(nil), b...) + want[len(want)-1] = 0x09 + + if !bytes.Equal(got, want) { + t.Fatalf("got % x, want % x", got, want) + } + + if err := m.SetValue(0, []byte{0x00, 0x03}); err != nil { + t.Fatal(err) + } + + got = mustBytes(t, m) + want[13] = 0x03 + + if !bytes.Equal(got, want) { + t.Fatalf("same-length replace must keep the sender's determinant: got % x, want % x", got, want) + } +} + +func TestPaddingTailAndExtensionKept(t *testing.T) { + body := encodeBody(t, []Field{{ID: 5, Criticality: 0, Value: []byte{0x01}}}) + body[0] |= 0x80 + body = append(body, 0x01, 0x80, 0x01, 0xff) + + b := encodePDU(t, 0, 7, 0, body) + b[0] |= 0x01 + b = append(b, 0xee) + + m := mustParse(t, b) + + if err := m.SetValue(0, []byte{0x02, 0x03}); err != nil { + t.Fatal(err) + } + + got := mustBytes(t, m) + + if got[0] != b[0] || got[len(got)-1] != 0xee { + t.Fatalf("header padding or PDU tail lost: % x", got) + } + + back := mustParse(t, got) + if !bytes.Equal(back.bodyTail, []byte{0x01, 0x80, 0x01, 0xff}) || back.bodyHdr[0]&0x80 == 0 { + t.Fatalf("message extension lost: hdr % x tail % x", back.bodyHdr, back.bodyTail) + } +} + +func TestInsertRemove(t *testing.T) { + fields := []Field{ + {ID: 1, Criticality: 0, Value: []byte{0x01}}, + {ID: 2, Criticality: 1, Value: []byte{0x02}}, + } + b := encodePDU(t, 0, 1, 0, encodeBody(t, fields)) + m := mustParse(t, b) + + if err := m.Insert(1, Field{ID: 9, Criticality: 2, Value: []byte{0x09, 0x09}}); err != nil { + t.Fatal(err) + } + + if err := m.Remove(0); err != nil { + t.Fatal(err) + } + + want := encodePDU(t, 0, 1, 0, encodeBody(t, []Field{{ID: 9, Criticality: 2, Value: []byte{0x09, 0x09}}, fields[1]})) + if got := mustBytes(t, m); !bytes.Equal(got, want) { + t.Fatalf("got % x, want % x", got, want) + } + + if err := m.Insert(5, Field{}); !errors.Is(err, ErrIndex) { + t.Errorf("Insert past end: %v", err) + } + + if err := m.Insert(0, Field{Criticality: 3}); !errors.Is(err, ErrCriticality) { + t.Errorf("Insert criticality 3: %v", err) + } + + if err := m.Remove(-1); !errors.Is(err, ErrIndex) { + t.Errorf("Remove(-1): %v", err) + } + + if err := m.SetValue(2, nil); !errors.Is(err, ErrIndex) { + t.Errorf("SetValue(2): %v", err) + } +} + +func TestRefusals(t *testing.T) { + body := encodeBody(t, nil) + + if _, err := Parse(encodePDU(t, 0, 39, 1, body), func(pc uint8) bool { return pc == 39 }); !errors.Is(err, ErrNotProtocolIEContainer) { + t.Errorf("private message: %v", err) + } + + ext := encodePDU(t, 0, 1, 0, body) + ext[0] |= 0x80 + + if _, err := Parse(ext, nil); !errors.Is(err, ErrExtensionAlternative) { + t.Errorf("extension alternative: %v", err) + } + + bad := encodePDU(t, 0, 1, 0, body) + bad[0] |= 0x60 + + if _, err := Parse(bad, nil); err == nil { + t.Error("choice index 3 accepted") + } + + badCrit := encodePDU(t, 0, 1, 0, encodeBody(t, []Field{{ID: 1, Value: []byte{0x00}}})) + badCrit[9] = 0xc0 + + if _, err := Parse(badCrit, nil); err == nil { + t.Error("IE criticality 3 accepted") + } + + inflated := encodePDU(t, 0, 1, 0, []byte{0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00}) + if _, err := Parse(inflated, nil); err == nil { + t.Error("count larger than the content accepted") + } + + full := encodePDU(t, 0, 1, 0, encodeBody(t, []Field{{ID: 1, Value: []byte{0x00}}})) + for i := range len(full) - 1 { + if _, err := Parse(full[:i], nil); err == nil { + t.Errorf("truncation at %d accepted", i) + } + } +} + +func TestFragmentedOuterBody(t *testing.T) { + fields := []Field{ + {ID: 1, Criticality: 0, Value: bytes.Repeat([]byte{0x01}, 20000)}, + {ID: 2, Criticality: 0, Value: []byte{0x00, 0x05}}, + } + b := encodePDU(t, 0, 0, 0, encodeBody(t, fields)) + m := mustParse(t, b) + + if m.body.det != nil { + t.Fatal("outer open type should be fragmented") + } + + if err := m.SetValue(1, []byte{0x40, 0x01, 0x00}); err != nil { + t.Fatal(err) + } + + fields[1].Value = []byte{0x40, 0x01, 0x00} + want := encodePDU(t, 0, 0, 0, encodeBody(t, fields)) + + if got := mustBytes(t, m); !bytes.Equal(got, want) { + t.Fatal("fragmented body not re-encoded canonically") + } +} + +func FuzzParse(f *testing.F) { + f.Add(encodePDU(f, 0, 12, 1, encodeBody(f, []Field{{ID: 8, Value: []byte{0x00, 0x01}}, {ID: 26, Criticality: 1, Value: []byte{0x01, 0x07}}}))) + f.Add(encodePDU(f, 1, 14, 0, encodeBody(f, nil))) + f.Add(encodePDU(f, 2, 17, 0, encodeBody(f, []Field{{ID: 2, Criticality: 1, Value: bytes.Repeat([]byte{0x33}, 300)}}))) + f.Add([]byte{0x30, 0x30, 0x30, 0x0a, 0x30, 0x00, 0x01, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00}) + f.Add([]byte{0x00, 0x0b, 0x40, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x05}) + + f.Fuzz(func(t *testing.T, data []byte) { + m, err := Parse(data, nil) + if err != nil { + return + } + + out, err := m.Bytes() + if err != nil { + t.Fatalf("Bytes: %v", err) + } + + if !bytes.Equal(out, data) { + t.Fatalf("unmodified re-emit differs") + } + + for i := range m.Len() { + fld, err := m.Field(i) + if err != nil { + t.Fatal(err) + } + + if err := m.SetValue(i, fld.Value); err != nil { + t.Fatal(err) + } + } + + out, err = m.Bytes() + if err != nil { + t.Fatalf("Bytes after same-value replace: %v", err) + } + + if !bytes.Equal(out, data) { + t.Fatalf("same-value replace is not identity") + } + + if m.Len() == 0 { + return + } + + if err := m.SetValue(0, []byte{0x5a, 0x5a, 0x5a}); err != nil { + t.Fatal(err) + } + + out, err = m.Bytes() + if err != nil { + t.Fatalf("Bytes after replace: %v", err) + } + + back, err := Parse(out, nil) + if err != nil { + t.Fatalf("re-parse after replace: %v", err) + } + + if back.Len() != m.Len() { + t.Fatalf("field count changed: %d -> %d", m.Len(), back.Len()) + } + + if fld, _ := back.Field(0); !bytes.Equal(fld.Value, []byte{0x5a, 0x5a, 0x5a}) { + t.Fatalf("replaced value lost: % x", fld.Value) + } + }) +} diff --git a/per/reader.go b/per/reader.go index 724d787927..4029884e0f 100644 --- a/per/reader.go +++ b/per/reader.go @@ -117,3 +117,21 @@ func (r *Reader) ReadOctets(n int) ([]byte, error) { return out, nil } + +func (r *Reader) Offset() int { return r.pos*8 + int(r.bit) } + +func (r *Reader) Since(start int) ([]byte, int, error) { + end := r.Offset() + if start < 0 || start > end { + return nil, 0, ErrOverflow + } + + sub := &Reader{buf: r.buf, pos: start / 8, bit: uint8(start % 8)} + + b, err := sub.ReadBitString(end - start) + if err != nil { + return nil, 0, err + } + + return b, end - start, nil +} diff --git a/s1ap/ie_ids.go b/s1ap/ie_ids.go index bd486c83a0..a66a8bae40 100644 --- a/s1ap/ie_ids.go +++ b/s1ap/ie_ids.go @@ -73,11 +73,22 @@ const ( IDRequestType ProtocolIEID = 98 IDUES1APIDs ProtocolIEID = 99 IDEUTRANCGI ProtocolIEID = 100 + IDOverloadResponse ProtocolIEID = 101 IDSourceToTargetTransparentContainer ProtocolIEID = 104 IDServedGUMMEIs ProtocolIEID = 105 IDUESecurityCapabilities ProtocolIEID = 107 IDCNDomain ProtocolIEID = 109 IDERABReleasedList ProtocolIEID = 110 + IDMessageIdentifier ProtocolIEID = 111 + IDSerialNumber ProtocolIEID = 112 + IDWarningAreaList ProtocolIEID = 113 + IDRepetitionPeriod ProtocolIEID = 114 + IDNumberofBroadcastRequest ProtocolIEID = 115 + IDWarningType ProtocolIEID = 116 + IDWarningSecurityInfo ProtocolIEID = 117 + IDDataCodingScheme ProtocolIEID = 118 + IDWarningMessageContents ProtocolIEID = 119 + IDBroadcastCompletedAreaList ProtocolIEID = 120 IDTargetToSourceTransparentContainer ProtocolIEID = 123 IDSONConfigurationTransferECT ProtocolIEID = 129 IDSONConfigurationTransferMCT ProtocolIEID = 130 @@ -85,11 +96,20 @@ const ( IDNASSecurityParametersfromEUTRAN ProtocolIEID = 135 IDNASSecurityParameterstoEUTRAN ProtocolIEID = 136 IDDefaultPagingDRX ProtocolIEID = 137 + IDBroadcastCancelledAreaList ProtocolIEID = 141 + IDConcurrentWarningMessageIndicator ProtocolIEID = 142 IDDataForwardingNotPossible ProtocolIEID = 143 + IDExtendedRepetitionPeriod ProtocolIEID = 144 IDLPPaPDU ProtocolIEID = 147 IDRoutingID ProtocolIEID = 148 IDPagingPriority ProtocolIEID = 151 + IDGUMMEIList ProtocolIEID = 154 + IDTrafficLoadReductionIndication ProtocolIEID = 161 + IDECGIListForRestart ProtocolIEID = 182 + IDTAIListForRestart ProtocolIEID = 188 IDUserLocationInformation ProtocolIEID = 189 + IDEmergencyAreaIDListForRestart ProtocolIEID = 190 + IDKillAllWarningMessages ProtocolIEID = 191 IDUERadioCapabilityForPaging ProtocolIEID = 198 IDERABToBeModifiedListBearerModInd ProtocolIEID = 199 IDERABToBeModifiedItemBearerModInd ProtocolIEID = 200 @@ -99,5 +119,11 @@ const ( IDERABModifyItemBearerModConf ProtocolIEID = 204 IDERABFailedToModifyListBearerModConf ProtocolIEID = 205 IDERABToBeReleasedListBearerModConf ProtocolIEID = 210 + IDPWSfailedECGIList ProtocolIEID = 222 + IDMMEGroupID ProtocolIEID = 223 + IDAdditionalGUTI ProtocolIEID = 224 + IDS1Message ProtocolIEID = 225 IDUERetentionInformation ProtocolIEID = 228 + IDUEUsageType ProtocolIEID = 230 + IDWarningAreaCoordinates ProtocolIEID = 286 ) diff --git a/s1ap/ie_names.go b/s1ap/ie_names.go index 16d3c38925..9d535c206a 100644 --- a/s1ap/ie_names.go +++ b/s1ap/ie_names.go @@ -107,6 +107,32 @@ var protocolIENames = map[ProtocolIEID]string{ IDERABFailedToModifyListBearerModConf: "E-RABFailedToModifyListBearerModConf", IDERABToBeReleasedListBearerModConf: "E-RABToBeReleasedListBearerModConf", IDUERetentionInformation: "UE-RetentionInformation", + IDOverloadResponse: "OverloadResponse", + IDMessageIdentifier: "MessageIdentifier", + IDSerialNumber: "SerialNumber", + IDWarningAreaList: "WarningAreaList", + IDRepetitionPeriod: "RepetitionPeriod", + IDNumberofBroadcastRequest: "NumberofBroadcastRequest", + IDWarningType: "WarningType", + IDWarningSecurityInfo: "WarningSecurityInfo", + IDDataCodingScheme: "DataCodingScheme", + IDWarningMessageContents: "WarningMessageContents", + IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", + IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", + IDConcurrentWarningMessageIndicator: "ConcurrentWarningMessageIndicator", + IDExtendedRepetitionPeriod: "ExtendedRepetitionPeriod", + IDGUMMEIList: "GUMMEIList", + IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", + IDECGIListForRestart: "ECGIListForRestart", + IDTAIListForRestart: "TAIListForRestart", + IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", + IDKillAllWarningMessages: "KillAllWarningMessages", + IDPWSfailedECGIList: "PWSfailedECGIList", + IDMMEGroupID: "MME-Group-ID", + IDAdditionalGUTI: "Additional-GUTI", + IDS1Message: "S1-Message", + IDUEUsageType: "UE-Usage-Type", + IDWarningAreaCoordinates: "WarningAreaCoordinates", } // ProtocolIEIDName returns the TS 36.413 name of id, and whether it is known. diff --git a/s1ap/ie_pws.go b/s1ap/ie_pws.go new file mode 100644 index 0000000000..54e4723d7b --- /dev/null +++ b/s1ap/ie_pws.go @@ -0,0 +1,454 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "fmt" + + "github.com/ellanetworks/core/per" +) + +const ( + maxnoofCellID = 65535 + maxnoofTAIforWarning = 65535 + maxnoofEmergencyAreaID = 65535 + maxnoofCellsineNB = 256 + maxnoofCellsforRestart = 256 + maxnoofRestartTAIs = 2048 + maxnoofRestartEmergencyAreaIDs = 256 + maxWarningMessageContents = 9600 + maxWarningAreaCoordinates = 1024 + warningSecurityInfoOctets = 50 +) + +var ( + repetitionPeriodBounds = per.Bounds{LB: 0, UB: 4095, HasLB: true, HasUB: true} + extendedRepetitionPeriodBounds = per.Bounds{LB: 4096, UB: 131071, HasLB: true, HasUB: true} + numberofBroadcastRequestBounds = per.Bounds{LB: 0, UB: 65535, HasLB: true, HasUB: true} +) + +type MessageIdentifier uint16 + +func (m MessageIdentifier) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(m), 16) +} + +func (m *MessageIdentifier) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, 16) + if err != nil { + return err + } + + *m = MessageIdentifier(v) + + return nil +} + +type SerialNumber uint16 + +func (s SerialNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(s), 16) +} + +func (s *SerialNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, 16) + if err != nil { + return err + } + + *s = SerialNumber(v) + + return nil +} + +type DataCodingScheme uint8 + +func (d DataCodingScheme) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(d), 8) +} + +func (d *DataCodingScheme) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, 8) + if err != nil { + return err + } + + *d = DataCodingScheme(v) + + return nil +} + +type EmergencyAreaID [3]byte + +func (e EmergencyAreaID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 3, 3, true, true, false, e[:]) +} + +func (e *EmergencyAreaID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 3, 3, true, true, false) + if err != nil { + return err + } + + copy(e[:], b) + + return nil +} + +type WarningType [2]byte + +func (t WarningType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 2, 2, true, true, false, t[:]) +} + +func (t *WarningType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) + if err != nil { + return err + } + + copy(t[:], b) + + return nil +} + +type WarningSecurityInfo [warningSecurityInfoOctets]byte + +func (s WarningSecurityInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, warningSecurityInfoOctets, warningSecurityInfoOctets, true, true, false, s[:]) +} + +func (s *WarningSecurityInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, warningSecurityInfoOctets, warningSecurityInfoOctets, true, true, false) + if err != nil { + return err + } + + copy(s[:], b) + + return nil +} + +type WarningMessageContents []byte + +func (c WarningMessageContents) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, maxWarningMessageContents, true, true, false, c) +} + +func (c *WarningMessageContents) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, maxWarningMessageContents, true, true, false) + if err != nil { + return err + } + + *c = b + + return nil +} + +type WarningAreaCoordinates []byte + +func (c WarningAreaCoordinates) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, maxWarningAreaCoordinates, true, true, false, c) +} + +func (c *WarningAreaCoordinates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, maxWarningAreaCoordinates, true, true, false) + if err != nil { + return err + } + + *c = b + + return nil +} + +type ConcurrentWarningMessageIndicator uint8 + +const ConcurrentWarningMessageIndicatorTrue ConcurrentWarningMessageIndicator = 0 + +func (c ConcurrentWarningMessageIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeEnumerated(w, enc, 1, false, int64(c)) +} + +func (c *ConcurrentWarningMessageIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeEnumerated(r, enc, 1, false) + if err != nil { + return err + } + + *c = ConcurrentWarningMessageIndicator(v) + + return nil +} + +type KillAllWarningMessages uint8 + +const KillAllWarningMessagesTrue KillAllWarningMessages = 0 + +func (k KillAllWarningMessages) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeEnumerated(w, enc, 1, false, int64(k)) +} + +func (k *KillAllWarningMessages) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeEnumerated(r, enc, 1, false) + if err != nil { + return err + } + + *k = KillAllWarningMessages(v) + + return nil +} + +type CellIDBroadcastItem struct { + _ [0]struct{} `per:"extseq"` + ECGI EUTRANCGI + _ ieExtensions `per:",skip"` +} + +type CompletedCellInTAIItem struct { + _ [0]struct{} `per:"extseq"` + ECGI EUTRANCGI + _ ieExtensions `per:",skip"` +} + +type TAIBroadcastItem struct { + _ [0]struct{} `per:"extseq"` + TAI TAI + CompletedCellInTAI []CompletedCellInTAIItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CompletedCellInEAIItem struct { + _ [0]struct{} `per:"extseq"` + ECGI EUTRANCGI + _ ieExtensions `per:",skip"` +} + +type EmergencyAreaIDBroadcastItem struct { + _ [0]struct{} `per:"extseq"` + EmergencyAreaID EmergencyAreaID + CompletedCellInEAI []CompletedCellInEAIItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CellIDCancelledItem struct { + _ [0]struct{} `per:"extseq"` + ECGI EUTRANCGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type CancelledCellInTAIItem struct { + _ [0]struct{} `per:"extseq"` + ECGI EUTRANCGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type TAICancelledItem struct { + _ [0]struct{} `per:"extseq"` + TAI TAI + CancelledCellInTAI []CancelledCellInTAIItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +type CancelledCellInEAIItem struct { + _ [0]struct{} `per:"extseq"` + ECGI EUTRANCGI + NumberOfBroadcasts uint16 `per:",range:0..65535"` + _ ieExtensions `per:",skip"` +} + +type EmergencyAreaIDCancelledItem struct { + _ [0]struct{} `per:"extseq"` + EmergencyAreaID EmergencyAreaID + CancelledCellInEAI []CancelledCellInEAIItem `per:"SEQUENCE-OF,size:1..65535"` + _ ieExtensions `per:",skip"` +} + +func encodeExtensibleChoice(w *per.Writer, enc per.Encoding, nRoot, idx int64) error { + w.WriteBit(false) + + return per.EncodeConstrainedWholeNumber(w, enc, 0, nRoot-1, idx) +} + +func decodeExtensibleChoice(r *per.Reader, enc per.Encoding, nRoot int64, name string) (int64, error) { + isExt, err := r.ReadBit() + if err != nil { + return 0, fmt.Errorf("s1ap: %s choice: %w", name, err) + } + + if isExt { + return 0, fmt.Errorf("%w: %s extension alternative", errNotComprehended, name) + } + + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, nRoot-1) + if err != nil { + return 0, fmt.Errorf("s1ap: %s choice: %w", name, err) + } + + return idx, nil +} + +func choiceAlternative(name string, set ...bool) (int64, error) { + idx := int64(-1) + + for i, s := range set { + if !s { + continue + } + + if idx >= 0 { + return 0, fmt.Errorf("s1ap: %s has more than one alternative set", name) + } + + idx = int64(i) + } + + if idx < 0 { + return 0, fmt.Errorf("s1ap: %s has no alternative set", name) + } + + return idx, nil +} + +type WarningAreaList struct { + CellIDList []EUTRANCGI + TAIList []TAI + EmergencyAreaIDList []EmergencyAreaID +} + +func (l WarningAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := choiceAlternative("WarningAreaList", len(l.CellIDList) > 0, len(l.TAIList) > 0, len(l.EmergencyAreaIDList) > 0) + if err != nil { + return err + } + + if err := encodeExtensibleChoice(w, enc, 3, idx); err != nil { + return err + } + + switch idx { + case 0: + return marshalSeqOf(w, enc, 1, maxnoofCellID, l.CellIDList) + case 1: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIList) + default: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDList) + } +} + +func (l *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeExtensibleChoice(r, enc, 3, "WarningAreaList") + if err != nil { + return err + } + + *l = WarningAreaList{} + + switch idx { + case 0: + l.CellIDList, err = unmarshalSeqOf[EUTRANCGI](r, enc, 1, maxnoofCellID) + case 1: + l.TAIList, err = unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforWarning) + default: + l.EmergencyAreaIDList, err = unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofEmergencyAreaID) + } + + return err +} + +type BroadcastCompletedAreaList struct { + CellIDBroadcast []CellIDBroadcastItem + TAIBroadcast []TAIBroadcastItem + EmergencyAreaIDBroadcast []EmergencyAreaIDBroadcastItem +} + +func (l BroadcastCompletedAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := choiceAlternative("BroadcastCompletedAreaList", len(l.CellIDBroadcast) > 0, len(l.TAIBroadcast) > 0, len(l.EmergencyAreaIDBroadcast) > 0) + if err != nil { + return err + } + + if err := encodeExtensibleChoice(w, enc, 3, idx); err != nil { + return err + } + + switch idx { + case 0: + return marshalSeqOf(w, enc, 1, maxnoofCellID, l.CellIDBroadcast) + case 1: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIBroadcast) + default: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDBroadcast) + } +} + +func (l *BroadcastCompletedAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeExtensibleChoice(r, enc, 3, "BroadcastCompletedAreaList") + if err != nil { + return err + } + + *l = BroadcastCompletedAreaList{} + + switch idx { + case 0: + l.CellIDBroadcast, err = unmarshalSeqOf[CellIDBroadcastItem](r, enc, 1, maxnoofCellID) + case 1: + l.TAIBroadcast, err = unmarshalSeqOf[TAIBroadcastItem](r, enc, 1, maxnoofTAIforWarning) + default: + l.EmergencyAreaIDBroadcast, err = unmarshalSeqOf[EmergencyAreaIDBroadcastItem](r, enc, 1, maxnoofEmergencyAreaID) + } + + return err +} + +type BroadcastCancelledAreaList struct { + CellIDCancelled []CellIDCancelledItem + TAICancelled []TAICancelledItem + EmergencyAreaIDCancelled []EmergencyAreaIDCancelledItem +} + +func (l BroadcastCancelledAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := choiceAlternative("BroadcastCancelledAreaList", len(l.CellIDCancelled) > 0, len(l.TAICancelled) > 0, len(l.EmergencyAreaIDCancelled) > 0) + if err != nil { + return err + } + + if err := encodeExtensibleChoice(w, enc, 3, idx); err != nil { + return err + } + + switch idx { + case 0: + return marshalSeqOf(w, enc, 1, maxnoofCellID, l.CellIDCancelled) + case 1: + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAICancelled) + default: + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDCancelled) + } +} + +func (l *BroadcastCancelledAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeExtensibleChoice(r, enc, 3, "BroadcastCancelledAreaList") + if err != nil { + return err + } + + *l = BroadcastCancelledAreaList{} + + switch idx { + case 0: + l.CellIDCancelled, err = unmarshalSeqOf[CellIDCancelledItem](r, enc, 1, maxnoofCellID) + case 1: + l.TAICancelled, err = unmarshalSeqOf[TAICancelledItem](r, enc, 1, maxnoofTAIforWarning) + default: + l.EmergencyAreaIDCancelled, err = unmarshalSeqOf[EmergencyAreaIDCancelledItem](r, enc, 1, maxnoofEmergencyAreaID) + } + + return err +} diff --git a/s1ap/overload.go b/s1ap/overload.go new file mode 100644 index 0000000000..c46d6739df --- /dev/null +++ b/s1ap/overload.go @@ -0,0 +1,191 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "fmt" + + "github.com/ellanetworks/core/per" +) + +var trafficLoadReductionIndicationBounds = per.Bounds{LB: 1, UB: 99, HasLB: true, HasUB: true} + +type OverloadAction uint8 + +const ( + OverloadActionRejectNonEmergencyMODT OverloadAction = iota + OverloadActionRejectRRCCRSignalling + OverloadActionPermitEmergencySessionsAndMobileTerminatedServicesOnly + OverloadActionPermitHighPrioritySessionsAndMobileTerminatedServicesOnly + OverloadActionRejectDelayTolerantAccess + OverloadActionPermitHighPrioritySessionsAndExceptionReportingAndMobileTerminatedServicesOnly + OverloadActionNotAcceptMODataOrDelayTolerantAccessFromCPCIoT + + overloadActionRootCount = 3 + overloadActionValueCount = 7 +) + +type OverloadResponse struct { + OverloadAction OverloadAction +} + +func (o OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { + if o.OverloadAction >= overloadActionValueCount { + return fmt.Errorf("s1ap: OverloadAction %d is not defined", o.OverloadAction) + } + + w.WriteBit(false) + + return per.EncodeEnumerated(w, enc, overloadActionRootCount, true, int64(o.OverloadAction)) +} + +func (o *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + isExt, err := r.ReadBit() + if err != nil { + return fmt.Errorf("s1ap: OverloadResponse choice: %w", err) + } + + if isExt { + return fmt.Errorf("%w: OverloadResponse extension alternative", errNotComprehended) + } + + v, err := per.DecodeEnumerated(r, enc, overloadActionRootCount, true) + if err != nil { + return fmt.Errorf("s1ap: OverloadAction: %w", err) + } + + if v >= overloadActionValueCount { + return fmt.Errorf("%w: OverloadAction extension value %d", errNotComprehended, v) + } + + *o = OverloadResponse{OverloadAction: OverloadAction(v)} + + return nil +} + +func decodeGUMMEIList(raw []byte, enc per.Encoding) ([]GUMMEI, error) { + return unmarshalSeqOf[GUMMEI](per.NewReader(raw), enc, 1, maxnoofMMECs) +} + +func gUMMEIListIE(l []GUMMEI) (per.Marshaler, bool) { + if len(l) == 0 { + return nil, false + } + + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMMECs, l) + }), true +} + +// TS 36.413 §9.1.8.13. +type OverloadStart struct { + OverloadResponse OverloadResponse + GUMMEIList []GUMMEI + TrafficLoadReductionIndication *uint8 + + messageMeta +} + +var overloadStartIEs = []ieSpec[OverloadStart]{ + { + id: IDOverloadResponse, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.OverloadResponse) + }, + encode: func(m *OverloadStart) (per.Marshaler, bool) { return &m.OverloadResponse, true }, + }, + { + id: IDGUMMEIList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + var err error + + m.GUMMEIList, err = decodeGUMMEIList(raw, enc) + + return err + }, + encode: func(m *OverloadStart) (per.Marshaler, bool) { return gUMMEIListIE(m.GUMMEIList) }, + }, + { + id: IDTrafficLoadReductionIndication, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + return decodeOptionalInteger(raw, trafficLoadReductionIndicationBounds, &m.TrafficLoadReductionIndication) + }, + encode: func(m *OverloadStart) (per.Marshaler, bool) { + if m.TrafficLoadReductionIndication == nil { + return nil, false + } + + return integerIE(trafficLoadReductionIndicationBounds, int64(*m.TrafficLoadReductionIndication)), true + }, + }, +} + +func (m *OverloadStart) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcOverloadStart, overloadStartIEs, m) +} + +func (m *OverloadStart) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcOverloadStart, + Criticality: CriticalityIgnore, + Value: w.Bytes(), + }) +} + +func ParseOverloadStart(value []byte) (*OverloadStart, error) { + return parseMessageBody[OverloadStart](ProcOverloadStart, TriggeringInitiatingMessage, overloadStartIEs, value) +} + +// TS 36.413 §9.1.8.14. +type OverloadStop struct { + GUMMEIList []GUMMEI + + messageMeta +} + +var overloadStopIEs = []ieSpec[OverloadStop]{ + { + id: IDGUMMEIList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *OverloadStop, raw []byte, enc per.Encoding) error { + var err error + + m.GUMMEIList, err = decodeGUMMEIList(raw, enc) + + return err + }, + encode: func(m *OverloadStop) (per.Marshaler, bool) { return gUMMEIListIE(m.GUMMEIList) }, + }, +} + +func (m *OverloadStop) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcOverloadStop, overloadStopIEs, m) +} + +func (m *OverloadStop) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcOverloadStop, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseOverloadStop(value []byte) (*OverloadStop, error) { + return parseMessageBody[OverloadStop](ProcOverloadStop, TriggeringInitiatingMessage, overloadStopIEs, value) +} diff --git a/s1ap/parsers.go b/s1ap/parsers.go index 1ae64edb06..702923877e 100644 --- a/s1ap/parsers.go +++ b/s1ap/parsers.go @@ -53,6 +53,7 @@ var messageParsers = []messageParser{ {"ParsePathSwitchRequest", func(v []byte) error { _, err := ParsePathSwitchRequest(v); return err }}, {"ParsePathSwitchRequestAcknowledge", func(v []byte) error { _, err := ParsePathSwitchRequestAcknowledge(v); return err }}, {"ParsePathSwitchRequestFailure", func(v []byte) error { _, err := ParsePathSwitchRequestFailure(v); return err }}, + {"ParseRawPDU", func(v []byte) error { _, err := ParseRawPDU(v); return err }}, {"ParseReset", func(v []byte) error { _, err := ParseReset(v); return err }}, {"ParseResetAcknowledge", func(v []byte) error { _, err := ParseResetAcknowledge(v); return err }}, {"ParseS1SetupFailure", func(v []byte) error { _, err := ParseS1SetupFailure(v); return err }}, @@ -75,4 +76,13 @@ var messageParsers = []messageParser{ return err }}, {"ParseUplinkUEAssociatedLPPaTransport", func(v []byte) error { _, err := ParseUplinkUEAssociatedLPPaTransport(v); return err }}, + {"ParseOverloadStart", func(v []byte) error { _, err := ParseOverloadStart(v); return err }}, + {"ParseOverloadStop", func(v []byte) error { _, err := ParseOverloadStop(v); return err }}, + {"ParseWriteReplaceWarningRequest", func(v []byte) error { _, err := ParseWriteReplaceWarningRequest(v); return err }}, + {"ParseWriteReplaceWarningResponse", func(v []byte) error { _, err := ParseWriteReplaceWarningResponse(v); return err }}, + {"ParseKillRequest", func(v []byte) error { _, err := ParseKillRequest(v); return err }}, + {"ParseKillResponse", func(v []byte) error { _, err := ParseKillResponse(v); return err }}, + {"ParsePWSRestartIndication", func(v []byte) error { _, err := ParsePWSRestartIndication(v); return err }}, + {"ParsePWSFailureIndication", func(v []byte) error { _, err := ParsePWSFailureIndication(v); return err }}, + {"ParseRerouteNASRequest", func(v []byte) error { _, err := ParseRerouteNASRequest(v); return err }}, } diff --git a/s1ap/per_gen.go b/s1ap/per_gen.go index 12a2bf2a7f..c762c3dbfd 100644 --- a/s1ap/per_gen.go +++ b/s1ap/per_gen.go @@ -6,46 +6,454 @@ package s1ap import "github.com/ellanetworks/core/per" +func (additionalGUTI *AdditionalGUTI) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := additionalGUTI.GUMMEI.MarshalPER(w, enc); err != nil { + return err + } + if err := additionalGUTI.MTMSI.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (additionalGUTI *AdditionalGUTI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&additionalGUTI.GUMMEI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&additionalGUTI.MTMSI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true}, int64(allocationAndRetentionPriority.PriorityLevel)); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true}, int64(allocationAndRetentionPriority.PriorityLevel)); err != nil { + return err + } + if err := per.EncodeEnumerated(w, enc, 2, false, int64(allocationAndRetentionPriority.PreemptionCapability)); err != nil { + return err + } + if err := per.EncodeEnumerated(w, enc, 2, false, int64(allocationAndRetentionPriority.PreemptionVulnerability)); err != nil { + return err + } + return nil +} + +func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f3, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true}) + if err != nil { + return err + } + allocationAndRetentionPriority.PriorityLevel = uint8(n0) + e1, err := per.DecodeEnumerated(r, enc, 2, false) + if err != nil { + return err + } + allocationAndRetentionPriority.PreemptionCapability = PreemptionCapability(e1) + e2, err := per.DecodeEnumerated(r, enc, 2, false) + if err != nil { + return err + } + allocationAndRetentionPriority.PreemptionVulnerability = PreemptionVulnerability(e2) + if p_f3 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (cancelledCellInEAIItem *CancelledCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := cancelledCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInEAIItem.NumberOfBroadcasts)); err != nil { + return err + } + return nil +} + +func (cancelledCellInEAIItem *CancelledCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cancelledCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cancelledCellInEAIItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (cancelledCellInTAIItem *CancelledCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := cancelledCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInTAIItem.NumberOfBroadcasts)); err != nil { + return err + } + return nil +} + +func (cancelledCellInTAIItem *CancelledCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cancelledCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cancelledCellInTAIItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (cellIDBroadcastItem *CellIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := cellIDBroadcastItem.ECGI.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (cellIDBroadcastItem *CellIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f1, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cellIDBroadcastItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f1 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (cellIDCancelledItem *CellIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := cellIDCancelledItem.ECGI.MarshalPER(w, enc); err != nil { return err } - if err := per.EncodeEnumerated(w, enc, 2, false, int64(allocationAndRetentionPriority.PreemptionCapability)); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledItem.NumberOfBroadcasts)); err != nil { return err } - if err := per.EncodeEnumerated(w, enc, 2, false, int64(allocationAndRetentionPriority.PreemptionVulnerability)); err != nil { + return nil +} + +func (cellIDCancelledItem *CellIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cellIDCancelledItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cellIDCancelledItem.NumberOfBroadcasts = uint16(n1) + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (completedCellInEAIItem *CompletedCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := completedCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { return err } return nil } -func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellInEAIItem *CompletedCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_f1, err := r.ReadBit() if err != nil { return err } - n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true}) - if err != nil { + if err := (&completedCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { return err } - allocationAndRetentionPriority.PriorityLevel = uint8(n0) - e1, err := per.DecodeEnumerated(r, enc, 2, false) + if p_f1 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (completedCellInTAIItem *CompletedCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := completedCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (completedCellInTAIItem *CompletedCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() if err != nil { return err } - allocationAndRetentionPriority.PreemptionCapability = PreemptionCapability(e1) - e2, err := per.DecodeEnumerated(r, enc, 2, false) + p_f1, err := r.ReadBit() if err != nil { return err } - allocationAndRetentionPriority.PreemptionVulnerability = PreemptionVulnerability(e2) - if p_f3 { + if err := (&completedCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f1 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -973,7 +1381,150 @@ func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *pe return err } } - if p_f5 { + if p_f5 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(eRABToBeSetupItemHOReq.Extensions != nil) + if err := eRABToBeSetupItemHOReq.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemHOReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemHOReq.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemHOReq.QoS.MarshalPER(w, enc); err != nil { + return err + } + if eRABToBeSetupItemHOReq.Extensions != nil { + if err := (*eRABToBeSetupItemHOReq.Extensions).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_Extensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eRABToBeSetupItemHOReq.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSetupItemHOReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSetupItemHOReq.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSetupItemHOReq.QoS).UnmarshalPER(r, enc); err != nil { + return err + } + if p_Extensions { + var v ERABToBeSetupItemHOReqExtIEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABToBeSetupItemHOReq.Extensions = &v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := eRABToBeSwitchedDLItem.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSwitchedDLItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSwitchedDLItem.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f3, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eRABToBeSwitchedDLItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSwitchedDLItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSwitchedDLItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f3 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -1006,56 +1557,59 @@ func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *pe return nil } -func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) - w.WriteBit(eRABToBeSetupItemHOReq.Extensions != nil) - if err := eRABToBeSetupItemHOReq.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemHOReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemHOReq.GTPTEID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemHOReq.QoS.MarshalPER(w, enc); err != nil { + w.WriteBit(false) + if err := emergencyAreaIDBroadcastItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { return err } - if eRABToBeSetupItemHOReq.Extensions != nil { - if err := (*eRABToBeSetupItemHOReq.Extensions).MarshalPER(w, enc); err != nil { - return err + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastItem.CompletedCellInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].MarshalPER(w, enc); err != nil { + return err + } } + off1 = end + return nil + }); err != nil { + return err } return nil } -func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_Extensions, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeSetupItemHOReq.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemHOReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&emergencyAreaIDBroadcastItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeSetupItemHOReq.GTPTEID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemHOReq.QoS).UnmarshalPER(r, enc); err != nil { + emergencyAreaIDBroadcastItem.CompletedCellInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDBroadcastItem.CompletedCellInEAI) + emergencyAreaIDBroadcastItem.CompletedCellInEAI = append(emergencyAreaIDBroadcastItem.CompletedCellInEAI, make([]CompletedCellInEAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDBroadcastItem.CompletedCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } - if p_Extensions { - var v ERABToBeSetupItemHOReqExtIEs + if p_f2 { + var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - eRABToBeSetupItemHOReq.Extensions = &v + _ = v } if extBit { var extBits []bool @@ -1083,40 +1637,54 @@ func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader return nil } -func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) - if err := eRABToBeSwitchedDLItem.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSwitchedDLItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if err := emergencyAreaIDCancelledItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSwitchedDLItem.GTPTEID.MarshalPER(w, enc); err != nil { + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledItem.CancelledCellInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDCancelledItem.CancelledCellInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } return nil } -func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_f2, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSwitchedDLItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&emergencyAreaIDCancelledItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + emergencyAreaIDCancelledItem.CancelledCellInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDCancelledItem.CancelledCellInEAI) + emergencyAreaIDCancelledItem.CancelledCellInEAI = append(emergencyAreaIDCancelledItem.CancelledCellInEAI, make([]CancelledCellInEAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDCancelledItem.CancelledCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } - if p_f3 { + if p_f2 { var v ieExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err @@ -2243,6 +2811,166 @@ func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } +func (tAIBroadcastItem *TAIBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := tAIBroadcastItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastItem.CompletedCellInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAIBroadcastItem.CompletedCellInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + return nil +} + +func (tAIBroadcastItem *TAIBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIBroadcastItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAIBroadcastItem.CompletedCellInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAIBroadcastItem.CompletedCellInTAI) + tAIBroadcastItem.CompletedCellInTAI = append(tAIBroadcastItem.CompletedCellInTAI, make([]CompletedCellInTAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAIBroadcastItem.CompletedCellInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + +func (tAICancelledItem *TAICancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := tAICancelledItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledItem.CancelledCellInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAICancelledItem.CancelledCellInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + return nil +} + +func (tAICancelledItem *TAICancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f2, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAICancelledItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAICancelledItem.CancelledCellInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAICancelledItem.CancelledCellInTAI) + tAICancelledItem.CancelledCellInTAI = append(tAICancelledItem.CancelledCellInTAI, make([]CancelledCellInTAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAICancelledItem.CancelledCellInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_f2 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + func (targetNgRanNodeID *TargetNgRanNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -2424,10 +3152,10 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per. } func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(uEAssociatedLogicalS1ConnectionItem.extensions.Present()) w.WriteBit(uEAssociatedLogicalS1ConnectionItem.MMEUES1APID != nil) w.WriteBit(uEAssociatedLogicalS1ConnectionItem.ENBUES1APID != nil) - w.WriteBit(false) + w.WriteBit(uEAssociatedLogicalS1ConnectionItem.iEExtensions != nil) if uEAssociatedLogicalS1ConnectionItem.MMEUES1APID != nil { if err := (*uEAssociatedLogicalS1ConnectionItem.MMEUES1APID).MarshalPER(w, enc); err != nil { return err @@ -2438,6 +3166,16 @@ func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) return err } } + if uEAssociatedLogicalS1ConnectionItem.iEExtensions != nil { + if err := (*uEAssociatedLogicalS1ConnectionItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if uEAssociatedLogicalS1ConnectionItem.extensions.Present() { + if err := uEAssociatedLogicalS1ConnectionItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -2454,7 +3192,7 @@ func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -2472,35 +3210,17 @@ func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) } uEAssociatedLogicalS1ConnectionItem.ENBUES1APID = &v } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + uEAssociatedLogicalS1ConnectionItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := uEAssociatedLogicalS1ConnectionItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } diff --git a/s1ap/per_leaf.go b/s1ap/per_leaf.go index 7afc02c8bf..9374d8f11d 100644 --- a/s1ap/per_leaf.go +++ b/s1ap/per_leaf.go @@ -753,3 +753,40 @@ func unmarshalSeqOf[T any](r *per.Reader, enc per.Encoding, lb, ub int64) ([]T, func perIEDecode(b []byte, u per.Unmarshaler) error { return u.UnmarshalPER(per.NewReader(b), per.Aligned) } + +type rawIEExtensions struct { + data []byte + nbits int +} + +func (e *rawIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { + if enc == per.Aligned { + w.AlignToByte() + } + + w.WriteBitString(e.data, e.nbits) + + return nil +} + +func (e *rawIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + if enc == per.Aligned { + r.AlignToByte() + } + + start := r.Offset() + + var c ieExtensions + if err := c.UnmarshalPER(r, enc); err != nil { + return err + } + + data, nbits, err := r.Since(start) + if err != nil { + return err + } + + e.data, e.nbits = data, nbits + + return nil +} diff --git a/s1ap/pws.go b/s1ap/pws.go new file mode 100644 index 0000000000..2f002cb121 --- /dev/null +++ b/s1ap/pws.go @@ -0,0 +1,563 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "github.com/ellanetworks/core/per" +) + +func decodeOptionalIE[T any, PT interface { + *T + per.Unmarshaler +}](raw []byte, dst **T) error { + v := PT(new(T)) + if err := perIEDecode(raw, v); err != nil { + return err + } + + *dst = (*T)(v) + + return nil +} + +func optionalIE[T any, PT interface { + *T + per.Marshaler +}](v *T) (per.Marshaler, bool) { + if v == nil { + return nil, false + } + + return PT(v), true +} + +func decodeOptionalInteger[T ~uint8 | ~uint16 | ~uint32](raw []byte, b per.Bounds, dst **T) error { + n, err := per.DecodeInteger(per.NewReader(raw), per.Aligned, b) + if err != nil { + return err + } + + v := T(n) + *dst = &v + + return nil +} + +func integerIE(b per.Bounds, v int64) per.Marshaler { + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, b, v) + }) +} + +// TS 36.413 §9.1.13.1. +type WriteReplaceWarningRequest struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + WarningAreaList *WarningAreaList + RepetitionPeriod uint16 + ExtendedRepetitionPeriod *uint32 + NumberofBroadcastRequest uint16 + WarningType *WarningType + WarningSecurityInfo *WarningSecurityInfo + DataCodingScheme *DataCodingScheme + WarningMessageContents *WarningMessageContents + ConcurrentWarningMessageIndicator *ConcurrentWarningMessageIndicator + WarningAreaCoordinates *WarningAreaCoordinates + + messageMeta +} + +var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return &m.SerialNumber, true }, + }, + { + id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.WarningAreaList) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningAreaList) }, + }, + { + id: IDRepetitionPeriod, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + n, err := per.DecodeInteger(per.NewReader(raw), enc, repetitionPeriodBounds) + m.RepetitionPeriod = uint16(n) + + return err + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + return integerIE(repetitionPeriodBounds, int64(m.RepetitionPeriod)), true + }, + }, + { + id: IDExtendedRepetitionPeriod, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalInteger(raw, extendedRepetitionPeriodBounds, &m.ExtendedRepetitionPeriod) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + if m.ExtendedRepetitionPeriod == nil { + return nil, false + } + + return integerIE(extendedRepetitionPeriodBounds, int64(*m.ExtendedRepetitionPeriod)), true + }, + }, + { + id: IDNumberofBroadcastRequest, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + n, err := per.DecodeInteger(per.NewReader(raw), enc, numberofBroadcastRequestBounds) + m.NumberofBroadcastRequest = uint16(n) + + return err + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + return integerIE(numberofBroadcastRequestBounds, int64(m.NumberofBroadcastRequest)), true + }, + }, + { + id: IDWarningType, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.WarningType) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningType) }, + }, + { + id: IDWarningSecurityInfo, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.WarningSecurityInfo) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningSecurityInfo) }, + }, + { + id: IDDataCodingScheme, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.DataCodingScheme) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.DataCodingScheme) }, + }, + { + id: IDWarningMessageContents, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.WarningMessageContents) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + return optionalIE(m.WarningMessageContents) + }, + }, + { + id: IDConcurrentWarningMessageIndicator, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.ConcurrentWarningMessageIndicator) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + return optionalIE(m.ConcurrentWarningMessageIndicator) + }, + }, + { + id: IDWarningAreaCoordinates, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.WarningAreaCoordinates) + }, + encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + return optionalIE(m.WarningAreaCoordinates) + }, + }, +} + +func (m *WriteReplaceWarningRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcWriteReplaceWarning, writeReplaceWarningRequestIEs, m) +} + +func (m *WriteReplaceWarningRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcWriteReplaceWarning, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, error) { + return parseMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, TriggeringInitiatingMessage, writeReplaceWarningRequestIEs, value) +} + +// TS 36.413 §9.1.13.2. +type WriteReplaceWarningResponse struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + BroadcastCompletedAreaList *BroadcastCompletedAreaList + CriticalityDiagnostics *CriticalityDiagnostics + + messageMeta +} + +var writeReplaceWarningResponseIEs = []ieSpec[WriteReplaceWarningResponse]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return &m.SerialNumber, true }, + }, + { + id: IDBroadcastCompletedAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.BroadcastCompletedAreaList) + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + return optionalIE(m.BroadcastCompletedAreaList) + }, + }, + { + id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.CriticalityDiagnostics) + }, + encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + return optionalIE(m.CriticalityDiagnostics) + }, + }, +} + +func (m *WriteReplaceWarningResponse) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcWriteReplaceWarning, writeReplaceWarningResponseIEs, m) +} + +func (m *WriteReplaceWarningResponse) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&SuccessfulOutcome{ + ProcedureCode: ProcWriteReplaceWarning, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningResponse, error) { + return parseMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, TriggeringSuccessfulOutcome, writeReplaceWarningResponseIEs, value) +} + +// TS 36.413 §9.1.13.3. +type KillRequest struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + WarningAreaList *WarningAreaList + KillAllWarningMessages *KillAllWarningMessages + + messageMeta +} + +var killRequestIEs = []ieSpec[KillRequest]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *KillRequest) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *KillRequest) (per.Marshaler, bool) { return &m.SerialNumber, true }, + }, + { + id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.WarningAreaList) + }, + encode: func(m *KillRequest) (per.Marshaler, bool) { return optionalIE(m.WarningAreaList) }, + }, + { + id: IDKillAllWarningMessages, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.KillAllWarningMessages) + }, + encode: func(m *KillRequest) (per.Marshaler, bool) { return optionalIE(m.KillAllWarningMessages) }, + }, +} + +func (m *KillRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcKill, killRequestIEs, m) +} + +func (m *KillRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcKill, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseKillRequest(value []byte) (*KillRequest, error) { + return parseMessageBody[KillRequest](ProcKill, TriggeringInitiatingMessage, killRequestIEs, value) +} + +// TS 36.413 §9.1.13.4. +type KillResponse struct { + MessageIdentifier MessageIdentifier + SerialNumber SerialNumber + BroadcastCancelledAreaList *BroadcastCancelledAreaList + CriticalityDiagnostics *CriticalityDiagnostics + + messageMeta +} + +var killResponseIEs = []ieSpec[KillResponse]{ + { + id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MessageIdentifier) + }, + encode: func(m *KillResponse) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + }, + { + id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.SerialNumber) + }, + encode: func(m *KillResponse) (per.Marshaler, bool) { return &m.SerialNumber, true }, + }, + { + id: IDBroadcastCancelledAreaList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.BroadcastCancelledAreaList) + }, + encode: func(m *KillResponse) (per.Marshaler, bool) { return optionalIE(m.BroadcastCancelledAreaList) }, + }, + { + id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.CriticalityDiagnostics) + }, + encode: func(m *KillResponse) (per.Marshaler, bool) { return optionalIE(m.CriticalityDiagnostics) }, + }, +} + +func (m *KillResponse) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcKill, killResponseIEs, m) +} + +func (m *KillResponse) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&SuccessfulOutcome{ + ProcedureCode: ProcKill, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseKillResponse(value []byte) (*KillResponse, error) { + return parseMessageBody[KillResponse](ProcKill, TriggeringSuccessfulOutcome, killResponseIEs, value) +} + +// TS 36.413 §9.1.13.5. +type PWSRestartIndication struct { + ECGIListForRestart []EUTRANCGI + GlobalENBID GlobalENBID + TAIListForRestart []TAI + EmergencyAreaIDListForRestart []EmergencyAreaID + + messageMeta +} + +var pWSRestartIndicationIEs = []ieSpec[PWSRestartIndication]{ + { + id: IDECGIListForRestart, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + var err error + + m.ECGIListForRestart, err = unmarshalSeqOf[EUTRANCGI](per.NewReader(raw), enc, 1, maxnoofCellsforRestart) + + return err + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + if len(m.ECGIListForRestart) == 0 { + return nil, false + } + + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsforRestart, m.ECGIListForRestart) + }), true + }, + }, + { + id: IDGlobalENBID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.GlobalENBID) + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return &m.GlobalENBID, true }, + }, + { + id: IDTAIListForRestart, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + var err error + + m.TAIListForRestart, err = unmarshalSeqOf[TAI](per.NewReader(raw), enc, 1, maxnoofRestartTAIs) + + return err + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + if len(m.TAIListForRestart) == 0 { + return nil, false + } + + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofRestartTAIs, m.TAIListForRestart) + }), true + }, + }, + { + id: IDEmergencyAreaIDListForRestart, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + var err error + + m.EmergencyAreaIDListForRestart, err = unmarshalSeqOf[EmergencyAreaID](per.NewReader(raw), enc, 1, maxnoofRestartEmergencyAreaIDs) + + return err + }, + encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + if len(m.EmergencyAreaIDListForRestart) == 0 { + return nil, false + } + + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofRestartEmergencyAreaIDs, m.EmergencyAreaIDListForRestart) + }), true + }, + }, +} + +func (m *PWSRestartIndication) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPWSRestartIndication, pWSRestartIndicationIEs, m) +} + +func (m *PWSRestartIndication) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcPWSRestartIndication, + Criticality: CriticalityIgnore, + Value: w.Bytes(), + }) +} + +func ParsePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { + return parseMessageBody[PWSRestartIndication](ProcPWSRestartIndication, TriggeringInitiatingMessage, pWSRestartIndicationIEs, value) +} + +// TS 36.413 §9.1.13.6. +type PWSFailureIndication struct { + PWSFailedECGIList []EUTRANCGI + GlobalENBID GlobalENBID + + messageMeta +} + +var pWSFailureIndicationIEs = []ieSpec[PWSFailureIndication]{ + { + id: IDPWSfailedECGIList, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { + var err error + + m.PWSFailedECGIList, err = unmarshalSeqOf[EUTRANCGI](per.NewReader(raw), enc, 1, maxnoofCellsineNB) + + return err + }, + encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { + if len(m.PWSFailedECGIList) == 0 { + return nil, false + } + + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsineNB, m.PWSFailedECGIList) + }), true + }, + }, + { + id: IDGlobalENBID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.GlobalENBID) + }, + encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return &m.GlobalENBID, true }, + }, +} + +func (m *PWSFailureIndication) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPWSFailureIndication, pWSFailureIndicationIEs, m) +} + +func (m *PWSFailureIndication) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcPWSFailureIndication, + Criticality: CriticalityIgnore, + Value: w.Bytes(), + }) +} + +func ParsePWSFailureIndication(value []byte) (*PWSFailureIndication, error) { + return parseMessageBody[PWSFailureIndication](ProcPWSFailureIndication, TriggeringInitiatingMessage, pWSFailureIndicationIEs, value) +} diff --git a/s1ap/pws_overload_test.go b/s1ap/pws_overload_test.go new file mode 100644 index 0000000000..6b00b449fa --- /dev/null +++ b/s1ap/pws_overload_test.go @@ -0,0 +1,396 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + "errors" + "os" + "reflect" + "testing" + + "github.com/ellanetworks/core/per" +) + +func pwsPLMN() PLMNIdentity { return PLMNIdentity{0x00, 0xf1, 0x10} } + +func pwsECGI(cell uint32) EUTRANCGI { return EUTRANCGI{PLMNIdentity: pwsPLMN(), CellID: cell} } + +func pwsTAI(tac TAC) TAI { return TAI{PLMNIdentity: pwsPLMN(), TAC: tac} } + +func pwsENB() GlobalENBID { + return GlobalENBID{PLMNIdentity: pwsPLMN(), ENBID: ENBID{Kind: ENBIDMacro, Value: 0x12345}} +} + +func pwsGUMMEI() GUMMEI { + return GUMMEI{PLMNIdentity: pwsPLMN(), MMEGroupID: MMEGroupID{0x80, 0x01}, MMECode: 0x01} +} + +func pwsCBSPage() WarningMessageContents { + page := make(WarningMessageContents, 84) + page[0] = 1 + copy(page[1:], "hello") + page[83] = 5 + + return page +} + +func pwsInitialUEMessage() S1Message { + b, err := hex.DecodeString("000c402b000005000800020001001a000302074a004300060000f1100001006440080000f110123450100086400130") + if err != nil { + panic(err) + } + + return b +} + +type newMessageCase struct { + name string + msg interface{ Marshal() ([]byte, error) } + parse func([]byte) (any, error) + choice func(PDU) bool + golden string +} + +func isInitiating(p PDU) bool { _, ok := p.(*InitiatingMessage); return ok } + +func isSuccessful(p PDU) bool { _, ok := p.(*SuccessfulOutcome); return ok } + +func newMessageCases() []newMessageCase { + return []newMessageCase{ + { + name: "OverloadStart", + msg: &OverloadStart{ + OverloadResponse: OverloadResponse{OverloadAction: OverloadActionRejectDelayTolerantAccess}, + GUMMEIList: []GUMMEI{pwsGUMMEI()}, + TrafficLoadReductionIndication: Ptr(uint8(50)), + }, + parse: func(b []byte) (any, error) { return ParseOverloadStart(b) }, + choice: isInitiating, + golden: "0022401a000003006500024080009a4008000000f11080010100a1400162", + }, + { + name: "OverloadStop", + msg: &OverloadStop{GUMMEIList: []GUMMEI{pwsGUMMEI(), pwsGUMMEI()}}, + parse: func(b []byte) (any, error) { return ParseOverloadStop(b) }, + choice: isInitiating, + golden: "00230016000001009a400f010000f1108001010000f110800101", + }, + { + name: "WriteReplaceWarningRequest", + msg: &WriteReplaceWarningRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3000, + WarningAreaList: &WarningAreaList{CellIDList: []EUTRANCGI{pwsECGI(0x1234501), pwsECGI(0x1234502)}}, + RepetitionPeriod: 60, + ExtendedRepetitionPeriod: Ptr(uint32(5000)), + NumberofBroadcastRequest: 0, + WarningType: &WarningType{0x05, 0x80}, + WarningSecurityInfo: &WarningSecurityInfo{}, + DataCodingScheme: Ptr(DataCodingScheme(0x0f)), + WarningMessageContents: Ptr(pwsCBSPage()), + ConcurrentWarningMessageIndicator: Ptr(ConcurrentWarningMessageIndicatorTrue), + WarningAreaCoordinates: &WarningAreaCoordinates{0xaa, 0xbb}, + }, + parse: func(b []byte) (any, error) { return ParseWriteReplaceWarningRequest(b) }, + choice: isInitiating, + golden: "00240080e000000c006f00021112007000023000007140120000010000f1101234501000f1101234502000720002003c00900003400388007300020000007440020580007540320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007640010f0077405600530168656c6c6f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005008e000100011e40040001aabb", + }, + { + name: "WriteReplaceWarningRequestTAIs", + msg: &WriteReplaceWarningRequest{ + MessageIdentifier: 0x1100, + SerialNumber: 0x0001, + WarningAreaList: &WarningAreaList{TAIList: []TAI{pwsTAI(1)}}, + RepetitionPeriod: 0, + NumberofBroadcastRequest: 1, + }, + parse: func(b []byte) (any, error) { return ParseWriteReplaceWarningRequest(b) }, + choice: isInitiating, + golden: "00240028000005006f00021100007000020001007140092000000000f1100001007200020000007300020001", + }, + { + name: "WriteReplaceWarningResponse", + msg: &WriteReplaceWarningResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3000, + BroadcastCompletedAreaList: &BroadcastCompletedAreaList{TAIBroadcast: []TAIBroadcastItem{{ + TAI: pwsTAI(7), + CompletedCellInTAI: []CompletedCellInTAIItem{{ECGI: pwsECGI(0x1234501)}}, + }}}, + CriticalityDiagnostics: &CriticalityDiagnostics{ProcedureCode: Ptr(ProcWriteReplaceWarning)}, + }, + parse: func(b []byte) (any, error) { return ParseWriteReplaceWarningResponse(b) }, + choice: isSuccessful, + golden: "2024002c000004006f00021112007000023000007840132000000000f110000700000000f11012345010003a40024024", + }, + { + name: "WriteReplaceWarningResponseEmergencyAreas", + msg: &WriteReplaceWarningResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3000, + BroadcastCompletedAreaList: &BroadcastCompletedAreaList{EmergencyAreaIDBroadcast: []EmergencyAreaIDBroadcastItem{{ + EmergencyAreaID: EmergencyAreaID{0x01, 0x02, 0x03}, + CompletedCellInEAI: []CompletedCellInEAIItem{{ECGI: pwsECGI(0x1234501)}}, + }}}, + }, + parse: func(b []byte) (any, error) { return ParseWriteReplaceWarningResponse(b) }, + choice: isSuccessful, + golden: "20240024000003006f00021112007000023000007840114000000001020300000000f11012345010", + }, + { + name: "KillRequest", + msg: &KillRequest{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3000, + WarningAreaList: &WarningAreaList{EmergencyAreaIDList: []EmergencyAreaID{{0x01, 0x02, 0x03}}}, + KillAllWarningMessages: Ptr(KillAllWarningMessagesTrue), + }, + parse: func(b []byte) (any, error) { return ParseKillRequest(b) }, + choice: isInitiating, + golden: "002b001e000004006f000211120070000230000071400640000001020300bf000100", + }, + { + name: "KillResponse", + msg: &KillResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3000, + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{CellIDCancelled: []CellIDCancelledItem{ + {ECGI: pwsECGI(0x1234501), NumberOfBroadcasts: 3}, + }}, + }, + parse: func(b []byte) (any, error) { return ParseKillResponse(b) }, + choice: isSuccessful, + golden: "202b0020000003006f00021112007000023000008d400d0000000000f110123450100003", + }, + { + name: "KillResponseTAIs", + msg: &KillResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3000, + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{TAICancelled: []TAICancelledItem{{ + TAI: pwsTAI(7), + CancelledCellInTAI: []CancelledCellInTAIItem{{ECGI: pwsECGI(0x1234501), NumberOfBroadcasts: 300}}, + }}}, + }, + parse: func(b []byte) (any, error) { return ParseKillResponse(b) }, + choice: isSuccessful, + golden: "202b0028000003006f00021112007000023000008d40152000000000f110000700000000f11012345010012c", + }, + { + name: "KillResponseEmergencyAreas", + msg: &KillResponse{ + MessageIdentifier: 0x1112, + SerialNumber: 0x3000, + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{EmergencyAreaIDCancelled: []EmergencyAreaIDCancelledItem{{ + EmergencyAreaID: EmergencyAreaID{0x01, 0x02, 0x03}, + CancelledCellInEAI: []CancelledCellInEAIItem{{ECGI: pwsECGI(0x1234501), NumberOfBroadcasts: 1}}, + }}}, + }, + parse: func(b []byte) (any, error) { return ParseKillResponse(b) }, + choice: isSuccessful, + golden: "202b0026000003006f00021112007000023000008d40134000000001020300000000f110123450100001", + }, + { + name: "PWSRestartIndication", + msg: &PWSRestartIndication{ + ECGIListForRestart: []EUTRANCGI{pwsECGI(0x1234501)}, + GlobalENBID: pwsENB(), + TAIListForRestart: []TAI{pwsTAI(1), pwsTAI(2)}, + EmergencyAreaIDListForRestart: []EmergencyAreaID{{0x01, 0x02, 0x03}}, + }, + parse: func(b []byte) (any, error) { return ParsePWSRestartIndication(b) }, + choice: isInitiating, + golden: "0031403600000400b60009000000f11012345010003b00080000f1100012345000bc000e00010000f11000010000f110000200be000400010203", + }, + { + name: "PWSFailureIndication", + msg: &PWSFailureIndication{ + PWSFailedECGIList: []EUTRANCGI{pwsECGI(0x1234501), pwsECGI(0x1234502)}, + GlobalENBID: pwsENB(), + }, + parse: func(b []byte) (any, error) { return ParsePWSFailureIndication(b) }, + choice: isInitiating, + golden: "0033402300000200de0010010000f1101234501000f11012345020003b00080000f11000123450", + }, + { + name: "RerouteNASRequest", + msg: &RerouteNASRequest{ + ENBUES1APID: 1, + MMEUES1APID: Ptr(MMEUES1APID(2)), + S1Message: pwsInitialUEMessage(), + MMEGroupID: MMEGroupID{0x80, 0x02}, + AdditionalGUTI: &AdditionalGUTI{GUMMEI: pwsGUMMEI(), MTMSI: 0xdeadbeef}, + UEUsageType: Ptr(uint8(128)), + }, + parse: func(b []byte) (any, error) { return ParseRerouteNASRequest(b) }, + choice: isInitiating, + golden: "0034005d00000600080002000100004002000200e100302f000c402b000005000800020001001a000302074a004300060000f1100001006440080000f11012345010008640013000df0002800200e0400b0000f110800101deadbeef00e6400180", + }, + } +} + +func TestNewMessagesRoundTrip(t *testing.T) { + dump := os.Getenv("S1AP_DUMP_NEW_MESSAGES") != "" + + for _, tc := range newMessageCases() { + t.Run(tc.name, func(t *testing.T) { + b, err := tc.msg.Marshal() + if err != nil { + t.Fatal(err) + } + + if dump { + t.Logf("%s %s", tc.name, hex.EncodeToString(b)) + } + + if tc.golden != "" && hex.EncodeToString(b) != tc.golden { + t.Errorf("bytes = %x, want %s", b, tc.golden) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if !tc.choice(pdu) { + t.Fatalf("PDU alternative %T", pdu) + } + + got, err := tc.parse(pdu.value()) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(got, tc.msg) { + t.Errorf("round trip mismatch:\n got %+v\nwant %+v", got, tc.msg) + } + + again, err := got.(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatal(err) + } + + if hex.EncodeToString(again) != hex.EncodeToString(b) { + t.Errorf("re-encode = %x, want %x", again, b) + } + }) + } +} + +func TestNewMessagesWireCriticality(t *testing.T) { + type wireIE struct { + id ProtocolIEID + crit Criticality + } + + cases := map[string][]wireIE{ + "OverloadStart": {{IDOverloadResponse, CriticalityReject}, {IDGUMMEIList, CriticalityIgnore}, {IDTrafficLoadReductionIndication, CriticalityIgnore}}, + "OverloadStop": {{IDGUMMEIList, CriticalityIgnore}}, + "WriteReplaceWarningRequest": {{IDMessageIdentifier, CriticalityReject}, {IDSerialNumber, CriticalityReject}, {IDWarningAreaList, CriticalityIgnore}, {IDRepetitionPeriod, CriticalityReject}, {IDExtendedRepetitionPeriod, CriticalityReject}, {IDNumberofBroadcastRequest, CriticalityReject}, {IDWarningType, CriticalityIgnore}, {IDWarningSecurityInfo, CriticalityIgnore}, {IDDataCodingScheme, CriticalityIgnore}, {IDWarningMessageContents, CriticalityIgnore}, {IDConcurrentWarningMessageIndicator, CriticalityReject}, {IDWarningAreaCoordinates, CriticalityIgnore}}, + "WriteReplaceWarningResponse": {{IDMessageIdentifier, CriticalityReject}, {IDSerialNumber, CriticalityReject}, {IDBroadcastCompletedAreaList, CriticalityIgnore}, {IDCriticalityDiagnostics, CriticalityIgnore}}, + "KillRequest": {{IDMessageIdentifier, CriticalityReject}, {IDSerialNumber, CriticalityReject}, {IDWarningAreaList, CriticalityIgnore}, {IDKillAllWarningMessages, CriticalityReject}}, + "KillResponse": {{IDMessageIdentifier, CriticalityReject}, {IDSerialNumber, CriticalityReject}, {IDBroadcastCancelledAreaList, CriticalityIgnore}}, + "PWSRestartIndication": {{IDECGIListForRestart, CriticalityReject}, {IDGlobalENBID, CriticalityReject}, {IDTAIListForRestart, CriticalityReject}, {IDEmergencyAreaIDListForRestart, CriticalityReject}}, + "PWSFailureIndication": {{IDPWSfailedECGIList, CriticalityReject}, {IDGlobalENBID, CriticalityReject}}, + "RerouteNASRequest": {{IDENBUES1APID, CriticalityReject}, {IDMMEUES1APID, CriticalityIgnore}, {IDS1Message, CriticalityReject}, {IDMMEGroupID, CriticalityReject}, {IDAdditionalGUTI, CriticalityIgnore}, {IDUEUsageType, CriticalityIgnore}}, + } + + for _, tc := range newMessageCases() { + want, ok := cases[tc.name] + if !ok { + continue + } + + t.Run(tc.name, func(t *testing.T) { + b, err := tc.msg.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + r := per.NewReader(pdu.value()) + if _, err := r.ReadBit(); err != nil { + t.Fatal(err) + } + + got, err := decodeIEContainer(r, per.Aligned) + if err != nil { + t.Fatal(err) + } + + if len(got) != len(want) { + t.Fatalf("%d IEs, want %d", len(got), len(want)) + } + + for i := range want { + if got[i].id != want[i].id || got[i].crit != want[i].crit { + t.Errorf("IE %d = {%s, %s}, want {%s, %s}", i, got[i].id, got[i].crit, want[i].id, want[i].crit) + } + } + }) + } +} + +func TestWarningAreaListNeedsExactlyOneAlternative(t *testing.T) { + for name, l := range map[string]WarningAreaList{ + "none": {}, + "two": {CellIDList: []EUTRANCGI{pwsECGI(1)}, TAIList: []TAI{pwsTAI(1)}}, + } { + if _, err := per.Marshal(l); err == nil { + t.Errorf("%s: Marshal() = nil error", name) + } + } + + if _, err := per.Marshal(BroadcastCompletedAreaList{}); err == nil { + t.Error("empty BroadcastCompletedAreaList encoded") + } + + if _, err := per.Marshal(BroadcastCancelledAreaList{}); err == nil { + t.Error("empty BroadcastCancelledAreaList encoded") + } +} + +func TestWarningAreaListExtensionAlternativeNotComprehended(t *testing.T) { + var l WarningAreaList + if err := per.Unmarshal([]byte{0x80, 0x01, 0x00}, &l); !errors.Is(err, errNotComprehended) { + t.Fatalf("err = %v, want errNotComprehended", err) + } +} + +func TestOverloadActionExtensionValues(t *testing.T) { + for v := OverloadActionRejectNonEmergencyMODT; v <= OverloadActionNotAcceptMODataOrDelayTolerantAccessFromCPCIoT; v++ { + b, err := per.Marshal(OverloadResponse{OverloadAction: v}) + if err != nil { + t.Fatalf("%d: %v", v, err) + } + + var got OverloadResponse + if err := per.Unmarshal(b, &got); err != nil || got.OverloadAction != v { + t.Fatalf("%d: got %d, %v", v, got.OverloadAction, err) + } + } + + if _, err := per.Marshal(OverloadResponse{OverloadAction: 7}); err == nil { + t.Error("undefined OverloadAction encoded") + } + + var got OverloadResponse + if err := per.Unmarshal([]byte{0x42, 0x00}, &got); !errors.Is(err, errNotComprehended) { + t.Errorf("unknown extension value: err = %v, want errNotComprehended", err) + } +} + +func TestOverloadStartWithoutResponseRejected(t *testing.T) { + _, err := ParseOverloadStart(container(t)) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) { + t.Fatalf("err = %v, want an AbstractSyntaxError", err) + } +} diff --git a/s1ap/raw_pdu.go b/s1ap/raw_pdu.go new file mode 100644 index 0000000000..f6899f765f --- /dev/null +++ b/s1ap/raw_pdu.go @@ -0,0 +1,122 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "errors" + "fmt" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/protocolie" +) + +var ErrIENotPresent = errors.New("s1ap: IE not present") + +type RawPDU struct { + m *protocolie.Message +} + +func ParseRawPDU(b []byte) (*RawPDU, error) { + m, err := protocolie.Parse(b, func(pc uint8) bool { return ProcedureCode(pc) == ProcPrivateMessage }) + if err != nil { + return nil, fmt.Errorf("s1ap: %w", err) + } + + return &RawPDU{m: m}, nil +} + +func (p *RawPDU) Trigger() TriggeringMessage { return TriggeringMessage(p.m.Choice()) } + +func (p *RawPDU) ProcedureCode() ProcedureCode { return ProcedureCode(p.m.ProcedureCode()) } + +func (p *RawPDU) Criticality() Criticality { return Criticality(p.m.Criticality()) } + +func (p *RawPDU) Len() int { return p.m.Len() } + +func (p *RawPDU) IE(i int) (RawIE, error) { + f, err := p.m.Field(i) + if err != nil { + return RawIE{}, fmt.Errorf("s1ap: %w", err) + } + + return RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value}, nil +} + +func (p *RawPDU) IEs() []RawIE { + fields := p.m.Fields() + + out := make([]RawIE, len(fields)) + for i, f := range fields { + out[i] = RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value} + } + + return out +} + +func (p *RawPDU) Index(id ProtocolIEID) int { return p.m.Index(uint16(id)) } + +func (p *RawPDU) SetValue(i int, value []byte) error { + if err := p.m.SetValue(i, value); err != nil { + return fmt.Errorf("s1ap: %w", err) + } + + return nil +} + +func (p *RawPDU) Insert(i int, ie RawIE) error { + if err := p.m.Insert(i, protocolie.Field{ID: uint16(ie.ID), Criticality: uint8(ie.Criticality), Value: ie.Value}); err != nil { + return fmt.Errorf("s1ap: %w", err) + } + + return nil +} + +func (p *RawPDU) Remove(i int) error { + if err := p.m.Remove(i); err != nil { + return fmt.Errorf("s1ap: %w", err) + } + + return nil +} + +func (p *RawPDU) Marshal() ([]byte, error) { + b, err := p.m.Bytes() + if err != nil { + return nil, fmt.Errorf("s1ap: %w", err) + } + + return b, nil +} + +func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { + i := p.m.Index(uint16(id)) + if i < 0 { + return false, nil + } + + f, err := p.m.Field(i) + if err != nil { + return false, fmt.Errorf("s1ap: %w", err) + } + + if err := perIEDecode(f.Value, v); err != nil { + return false, fmt.Errorf("s1ap: IE %s: %w", id, err) + } + + return true, nil +} + +func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { + i := p.m.Index(uint16(id)) + if i < 0 { + return fmt.Errorf("%w: %s", ErrIENotPresent, id) + } + + b, err := per.Marshal(v, per.Aligned) + if err != nil { + return fmt.Errorf("s1ap: IE %s: %w", id, err) + } + + return p.SetValue(i, b) +} diff --git a/s1ap/raw_pdu_registry_test.go b/s1ap/raw_pdu_registry_test.go new file mode 100644 index 0000000000..415f8f5e14 --- /dev/null +++ b/s1ap/raw_pdu_registry_test.go @@ -0,0 +1,610 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +var typedCodecs = map[typedKey]func([]byte) (typedMessage, error){ + {TriggeringInitiatingMessage, ProcENBConfigurationTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseENBConfigurationTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcMMEConfigurationTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseMMEConfigurationTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcENBConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseENBConfigurationUpdate(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcENBConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseENBConfigurationUpdateAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcENBConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseENBConfigurationUpdateFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcERABModificationIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseERABModificationIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcERABModificationIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseERABModificationConfirm(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcERABModify}: func(v []byte) (typedMessage, error) { + m, err := ParseERABModifyRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcERABModify}: func(v []byte) (typedMessage, error) { + m, err := ParseERABModifyResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcERABRelease}: func(v []byte) (typedMessage, error) { + m, err := ParseERABReleaseCommand(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcERABRelease}: func(v []byte) (typedMessage, error) { + m, err := ParseERABReleaseResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcERABReleaseIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseERABReleaseIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcERABSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseERABSetupRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcERABSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseERABSetupResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcErrorIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseErrorIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverCancel}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverCancel(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcHandoverCancel}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverCancelAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverNotification}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverNotify(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverPreparation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverRequired(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcHandoverPreparation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverCommand(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcHandoverPreparation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverPreparationFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcHandoverResourceAllocation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcHandoverResourceAllocation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverRequestAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcHandoverResourceAllocation}: func(v []byte) (typedMessage, error) { + m, err := ParseHandoverFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcInitialContextSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialContextSetupRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcInitialContextSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialContextSetupResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcInitialContextSetup}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialContextSetupFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcLocationReport}: func(v []byte) (typedMessage, error) { + m, err := ParseLocationReport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkUEAssociatedLPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkUEAssociatedLPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkUEAssociatedLPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkUEAssociatedLPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkNonUEAssociatedLPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkNonUEAssociatedLPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkNonUEAssociatedLPPaTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkNonUEAssociatedLPPaTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcMMEConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseMMEConfigurationUpdate(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcMMEConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseMMEConfigurationUpdateAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcMMEConfigurationUpdate}: func(v []byte) (typedMessage, error) { + m, err := ParseMMEConfigurationUpdateFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcNASNonDeliveryIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseNASNonDeliveryIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcInitialUEMessage}: func(v []byte) (typedMessage, error) { + m, err := ParseInitialUEMessage(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUplinkNASTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseUplinkNASTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcDownlinkNASTransport}: func(v []byte) (typedMessage, error) { + m, err := ParseDownlinkNASTransport(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcOverloadStart}: func(v []byte) (typedMessage, error) { + m, err := ParseOverloadStart(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcOverloadStop}: func(v []byte) (typedMessage, error) { + m, err := ParseOverloadStop(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPaging}: func(v []byte) (typedMessage, error) { + m, err := ParsePaging(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPathSwitchRequest}: func(v []byte) (typedMessage, error) { + m, err := ParsePathSwitchRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcPathSwitchRequest}: func(v []byte) (typedMessage, error) { + m, err := ParsePathSwitchRequestAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcPathSwitchRequest}: func(v []byte) (typedMessage, error) { + m, err := ParsePathSwitchRequestFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcWriteReplaceWarning}: func(v []byte) (typedMessage, error) { + m, err := ParseWriteReplaceWarningRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcWriteReplaceWarning}: func(v []byte) (typedMessage, error) { + m, err := ParseWriteReplaceWarningResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcKill}: func(v []byte) (typedMessage, error) { + m, err := ParseKillRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcKill}: func(v []byte) (typedMessage, error) { + m, err := ParseKillResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPWSRestartIndication}: func(v []byte) (typedMessage, error) { + m, err := ParsePWSRestartIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcPWSFailureIndication}: func(v []byte) (typedMessage, error) { + m, err := ParsePWSFailureIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcRerouteNASRequest}: func(v []byte) (typedMessage, error) { + m, err := ParseRerouteNASRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcReset}: func(v []byte) (typedMessage, error) { + m, err := ParseReset(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcReset}: func(v []byte) (typedMessage, error) { + m, err := ParseResetAcknowledge(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcS1Setup}: func(v []byte) (typedMessage, error) { + m, err := ParseS1SetupRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcS1Setup}: func(v []byte) (typedMessage, error) { + m, err := ParseS1SetupFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcS1Setup}: func(v []byte) (typedMessage, error) { + m, err := ParseS1SetupResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcENBStatusTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseENBStatusTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcMMEStatusTransfer}: func(v []byte) (typedMessage, error) { + m, err := ParseMMEStatusTransfer(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcTraceStart}: func(v []byte) (typedMessage, error) { + m, err := ParseTraceStart(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcTraceFailureIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseTraceFailureIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUECapabilityInfoIndication}: func(v []byte) (typedMessage, error) { + m, err := ParseUECapabilityInfoIndication(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUEContextModification}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextModificationRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcUEContextModification}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextModificationResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcUEContextModification}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextModificationFailure(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUEContextRelease}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextReleaseCommand(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcUEContextRelease}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextReleaseComplete(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringInitiatingMessage, ProcUEContextReleaseRequest}: func(v []byte) (typedMessage, error) { + m, err := ParseUEContextReleaseRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, +} + +func sampleMessages() []typedMessage { + return []typedMessage{ + &DownlinkNASTransport{NASPDU: NASPDU{0x07}}, + &DownlinkUEAssociatedLPPaTransport{}, + &ENBConfigurationUpdate{}, + &ENBConfigurationUpdateAcknowledge{}, + &ENBConfigurationUpdateFailure{Cause: new(Cause)}, + &ENBStatusTransfer{Container: StatusTransferContainer{0xaa}}, + &ERABModificationConfirm{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &ERABModificationIndication{ToBeModified: []ERABToBeModifiedItemBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA(), DLGTPTEID: 1}}}, + &ERABModifyRequest{ERABToBeModified: []ERABToBeModifiedItemBearerModReq{{ERABID: 1, QoS: goldQoS(), NASPDU: NASPDU{0x01}}}}, + &ERABModifyResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &ERABReleaseCommand{ERABToBeReleased: []ERABItem{goldERABItem()}}, + &ERABReleaseIndication{ERABReleased: []ERABItem{goldERABItem()}}, + &ERABModificationConfirm{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), FailedToModify: []ERABItem{goldERABItem()}, ToBeReleased: []ERABItem{goldERABItem()}}, + &ERABReleaseResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &ERABSetupRequest{ERABToBeSetup: []ERABToBeSetupItemBearerSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, NASPDU: NASPDU{0x01}}}}, + &ERABSetupResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &HandoverCancel{Cause: new(Cause)}, + &HandoverCancelAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &HandoverCommand{TargetToSource: TransparentContainer{0x00}}, + &HandoverFailure{MMEUES1APID: new(MMEUES1APID), Cause: new(Cause)}, + &HandoverNotify{EUTRANCGI: new(EUTRANCGI), TAI: new(TAI)}, + &HandoverPreparationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, + &HandoverRequest{Cause: new(Cause), SourceToTarget: TransparentContainer{0x00}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}}, + &HandoverRequestAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), TargetToSource: TransparentContainer{0x00}, ERABAdmitted: []ERABAdmittedItem{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, + &HandoverRequired{Cause: new(Cause), SourceToTarget: TransparentContainer{0x00}}, + &InitialContextSetupFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, + &InitialContextSetupRequest{ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, + &InitialContextSetupResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), ERABSetup: []ERABSetupItemCtxtSURes{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, + &InitialUEMessage{NASPDU: NASPDU{0x07}, EUTRANCGI: new(EUTRANCGI), RRCEstablishmentCause: new(RRCEstablishmentCause)}, + &LocationReport{EUTRANCGI: new(EUTRANCGI), TAI: new(TAI), RequestType: new(RequestType)}, + &MMEConfigurationTransfer{}, + &MMEConfigurationUpdate{RelativeMMECapacity: new(uint8)}, + &MMEConfigurationUpdateAcknowledge{}, + &MMEConfigurationUpdateFailure{Cause: new(Cause)}, + &MMEStatusTransfer{Container: StatusTransferContainer{0xaa}}, + &NASNonDeliveryIndication{NASPDU: NASPDU{}, Cause: new(Cause)}, + &Paging{UEIdentityIndexValue: new(uint16), STMSI: new(STMSI), CNDomain: new(CNDomain), TAIList: []TAI{{PLMNIdentity: goldPLMN(), TAC: 1}}}, + &PathSwitchRequest{EUTRANCGI: new(EUTRANCGI), TAI: new(TAI), UESecurityCapabilities: new(UESecurityCapabilities), ERABToBeSwitchedDL: []ERABToBeSwitchedDLItem{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, + &PathSwitchRequestAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &PathSwitchRequestFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, + &Reset{Cause: new(Cause), ResetType: ResetType{All: true}}, + &ResetAcknowledge{}, + &S1SetupFailure{Cause: new(Cause)}, + &S1SetupRequest{DefaultPagingDRX: new(PagingDRX), SupportedTAs: SupportedTAs{{TAC: 1, BroadcastPLMNs: BPLMNs{goldPLMN()}}}}, + &S1SetupResponse{RelativeMMECapacity: new(uint8), ServedGUMMEIs: ServedGUMMEIs{{ServedPLMNs: []PLMNIdentity{goldPLMN()}, ServedGroupIDs: []MMEGroupID{{0x80, 0x01}}, ServedMMECs: []MMECode{1}}}}, + &UECapabilityInfoIndication{UERadioCapability: []byte{}}, + &UEContextModificationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, + &UEContextModificationRequest{UEAggregateMaximumBitRate: &UEAggregateMaximumBitRate{}}, + &UEContextModificationResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &UEContextReleaseCommand{Cause: new(Cause)}, + &UEContextReleaseComplete{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, + &UEContextReleaseRequest{Cause: new(Cause)}, + &UplinkNASTransport{NASPDU: NASPDU{0x07}, EUTRANCGI: new(EUTRANCGI), TAI: new(TAI)}, + &UplinkUEAssociatedLPPaTransport{}, + } +} diff --git a/s1ap/raw_pdu_test.go b/s1ap/raw_pdu_test.go new file mode 100644 index 0000000000..032af24602 --- /dev/null +++ b/s1ap/raw_pdu_test.go @@ -0,0 +1,732 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bufio" + "bytes" + "encoding/hex" + "errors" + "fmt" + "os" + "os/exec" + "path/filepath" + "reflect" + "regexp" + "slices" + "strconv" + "strings" + "testing" + + "github.com/ellanetworks/core/per" +) + +type corpusPDU struct { + source string + b []byte +} + +type typedKey struct { + trigger TriggeringMessage + proc ProcedureCode +} + +type typedMessage interface { + Marshal() ([]byte, error) +} + +var hexLiteral = regexp.MustCompile(`"([0-9a-fA-F]{8,})"`) + +func loadCorpus(t testing.TB) []corpusPDU { + t.Helper() + + var out []corpusPDU + + f, err := os.Open(filepath.Join("testdata", "captures", "open5gs.txt")) + if err != nil { + t.Fatal(err) + } + + defer func() { _ = f.Close() }() + + sc := bufio.NewScanner(f) + sc.Buffer(make([]byte, 0, 1<<16), 1<<20) + + for n := 1; sc.Scan(); n++ { + line := strings.TrimSpace(sc.Text()) + if line == "" { + continue + } + + b, err := hex.DecodeString(line) + if err != nil { + t.Fatalf("open5gs.txt:%d: %v", n, err) + } + + out = append(out, corpusPDU{source: fmt.Sprintf("open5gs.txt:%d", n), b: b}) + } + + if err := sc.Err(); err != nil { + t.Fatal(err) + } + + files, err := filepath.Glob("*_test.go") + if err != nil { + t.Fatal(err) + } + + for _, name := range files { + src, err := os.ReadFile(name) + if err != nil { + t.Fatal(err) + } + + for _, m := range hexLiteral.FindAllStringSubmatch(string(src), -1) { + b, err := hex.DecodeString(m[1]) + if err != nil { + continue + } + + pdu, err := Unmarshal(b) + if err != nil { + continue + } + + re, err := Marshal(pdu) + if err != nil || !bytes.Equal(re, b) { + continue + } + + if slices.ContainsFunc(out, func(c corpusPDU) bool { return bytes.Equal(c.b, b) }) { + continue + } + + out = append(out, corpusPDU{source: name, b: b}) + } + } + + for i, m := range sampleMessages() { + b, err := m.Marshal() + if err != nil { + t.Fatalf("sample %d (%T): %v", i, m, err) + } + + out = append(out, corpusPDU{source: fmt.Sprintf("sample %T", m), b: b}) + } + + return out +} + +func TestRawPDUCorpusIdentity(t *testing.T) { + procs := map[typedKey]int{} + + for _, c := range loadCorpus(t) { + p, err := ParseRawPDU(c.b) + if err != nil { + t.Errorf("%s: ParseRawPDU: %v", c.source, err) + continue + } + + out, err := p.Marshal() + if err != nil { + t.Errorf("%s: Marshal: %v", c.source, err) + continue + } + + if !bytes.Equal(out, c.b) { + t.Errorf("%s: re-emit differs\n got % x\nwant % x", c.source, out, c.b) + } + + pdu, err := Unmarshal(c.b) + if err != nil { + t.Errorf("%s: Unmarshal: %v", c.source, err) + continue + } + + if p.ProcedureCode() != pdu.procedureCode() || int(p.Trigger()) != pdu.choiceIndex() || p.Criticality() != pdu.criticality() { + t.Errorf("%s: header mismatch with Unmarshal", c.source) + } + + r := per.NewReader(pdu.value()) + if _, err := r.ReadBit(); err != nil { + t.Errorf("%s: preamble: %v", c.source, err) + continue + } + + ies, err := decodeIEContainer(r, per.Aligned) + if err != nil { + t.Errorf("%s: decodeIEContainer: %v", c.source, err) + continue + } + + got := p.IEs() + if len(got) != len(ies) { + t.Errorf("%s: %d IEs, decodeIEContainer found %d", c.source, len(got), len(ies)) + continue + } + + for i := range ies { + if got[i].ID != ies[i].id || got[i].Criticality != ies[i].crit || !bytes.Equal(got[i].Value, ies[i].value) { + t.Errorf("%s: IE %d differs from decodeIEContainer", c.source, i) + } + } + + procs[typedKey{p.Trigger(), p.ProcedureCode()}]++ + + for i := range p.Len() { + ie, _ := p.IE(i) + if err := p.SetValue(i, ie.Value); err != nil { + t.Fatal(err) + } + } + + if out, _ := p.Marshal(); !bytes.Equal(out, c.b) { + t.Errorf("%s: same-value replace is not identity", c.source) + } + } + + t.Logf("%d distinct (trigger, procedure) pairs", len(procs)) +} + +type idSetter struct { + field string + set func(p *RawPDU, v uint64) error + value func(v uint64) reflect.Value + has func(p *RawPDU) bool +} + +func ueIDSetters() []idSetter { + return []idSetter{ + { + field: "MMEUES1APID", + set: func(p *RawPDU, v uint64) error { return p.SetMMEUES1APID(MMEUES1APID(v)) }, + value: func(v uint64) reflect.Value { return reflect.ValueOf(MMEUES1APID(v)) }, + has: func(p *RawPDU) bool { return p.Index(IDMMEUES1APID) >= 0 }, + }, + { + field: "ENBUES1APID", + set: func(p *RawPDU, v uint64) error { return p.SetENBUES1APID(ENBUES1APID(v)) }, + value: func(v uint64) reflect.Value { return reflect.ValueOf(ENBUES1APID(v)) }, + has: func(p *RawPDU) bool { return p.Index(IDENBUES1APID) >= 0 }, + }, + } +} + +var ueIDValues = map[string][]uint64{ + "MMEUES1APID": {0, 4294967295, 0x1234}, + "ENBUES1APID": {0, 16777215, 0x80}, +} + +func setTypedField(m typedMessage, field string, v reflect.Value) bool { + rv := reflect.ValueOf(m).Elem() + + f := rv.FieldByName(field) + if !f.IsValid() || !f.CanSet() { + return false + } + + switch { + case f.Type() == v.Type(): + f.Set(v) + case f.Kind() == reflect.Pointer && f.Type().Elem() == v.Type(): + if f.IsNil() { + return false + } + + p := reflect.New(v.Type()) + p.Elem().Set(v) + f.Set(p) + default: + return false + } + + return true +} + +func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { + var compared, notExact, refused, unmodeled int + + for _, c := range loadCorpus(t) { + pdu, err := Unmarshal(c.b) + if err != nil { + t.Fatal(err) + } + + codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + if !ok { + unmodeled++ + continue + } + + for _, s := range ueIDSetters() { + probe, err := ParseRawPDU(c.b) + if err != nil { + t.Fatal(err) + } + + if !s.has(probe) { + continue + } + + for _, v := range ueIDValues[s.field] { + msg, err := codec(pdu.value()) + if err != nil { + refused++ + break + } + + re, err := msg.Marshal() + if err != nil || !bytes.Equal(re, c.b) { + notExact++ + break + } + + if !setTypedField(msg, s.field, s.value(v)) { + t.Errorf("%s: %T has no settable %s", c.source, msg, s.field) + break + } + + want, err := msg.Marshal() + if err != nil { + t.Errorf("%s: typed marshal: %v", c.source, err) + break + } + + p, err := ParseRawPDU(c.b) + if err != nil { + t.Fatal(err) + } + + if err := s.set(p, v); err != nil { + t.Fatalf("%s: set %s: %v", c.source, s.field, err) + } + + got, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(got, want) { + t.Errorf("%s: %s=%d\nsplice % x\ntyped % x", c.source, s.field, v, got, want) + } + + compared++ + } + } + } + + t.Logf("compared %d splices with the typed codec; typed codec skipped: %d not re-encoded byte-exactly, %d refused, %d unmodeled", compared, notExact, refused, unmodeled) + + if compared < 20 { + t.Fatalf("only %d comparisons", compared) + } +} + +type fieldSpan struct { + id uint16 + start, valStart, end int +} + +func determinant(b []byte, off int) (n, size int, ok bool) { + if off >= len(b) { + return 0, 0, false + } + + switch { + case b[off]&0x80 == 0: + return int(b[off]), 1, true + case b[off]&0x40 == 0 && off+1 < len(b): + return int(b[off]&0x3f)<<8 | int(b[off+1]), 2, true + default: + return 0, 0, false + } +} + +func layoutOf(b []byte) (bodyStart int, fields []fieldSpan, ok bool) { + n, size, ok := determinant(b, 3) + if !ok || 3+size+n > len(b) { + return 0, nil, false + } + + bodyStart = 3 + size + count := int(b[bodyStart+1])<<8 | int(b[bodyStart+2]) + p := bodyStart + 3 + + for range count { + vn, vs, ok := determinant(b, p+3) + if !ok { + return 0, nil, false + } + + fields = append(fields, fieldSpan{id: uint16(b[p])<<8 | uint16(b[p+1]), start: p, valStart: p + 3 + vs, end: p + 3 + vs + vn}) + p += 3 + vs + vn + } + + return bodyStart, fields, true +} + +func TestRawPDUSpliceLocality(t *testing.T) { + var checked int + + for _, c := range loadCorpus(t) { + oldBody, oldFields, ok := layoutOf(c.b) + if !ok { + continue + } + + for _, s := range ueIDSetters() { + for _, v := range ueIDValues[s.field] { + p, err := ParseRawPDU(c.b) + if err != nil { + t.Fatal(err) + } + + if !s.has(p) { + continue + } + + target := p.Index(map[string]ProtocolIEID{"MMEUES1APID": IDMMEUES1APID, "ENBUES1APID": IDENBUES1APID}[s.field]) + + if err := s.set(p, v); err != nil { + t.Fatal(err) + } + + out, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + newBody, newFields, ok := layoutOf(out) + if !ok || len(newFields) != len(oldFields) { + t.Fatalf("%s: spliced PDU layout unreadable", c.source) + } + + of, nf := oldFields[target], newFields[target] + + if !bytes.Equal(out[:3], c.b[:3]) { + t.Errorf("%s: PDU header changed", c.source) + } + + if !bytes.Equal(out[newBody:nf.start+3], c.b[oldBody:of.start+3]) { + t.Errorf("%s: octets before the target value changed", c.source) + } + + if !bytes.Equal(out[nf.end:], c.b[of.end:]) { + t.Errorf("%s: octets after the target value changed", c.source) + } + + if nf.end-nf.valStart == of.end-of.valStart && !bytes.Equal(out[:nf.valStart], c.b[:of.valStart]) { + t.Errorf("%s: a same-length value moved a determinant", c.source) + } + + checked++ + } + } + } + + if checked == 0 { + t.Fatal("no PDU carried a UE ID") + } +} + +func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { + t.Helper() + + pcap := exec.CommandContext(t.Context(), text2pcap, "-q", "-S", "36412,36412,18", "-", "-") + pcap.Stdin = strings.NewReader(dump) + + pcapBytes, err := pcap.Output() + if err != nil { + t.Fatalf("text2pcap: %v", err) + } + + cmd := exec.CommandContext(t.Context(), tshark, "-r", "-", "-T", "fields", "-E", "separator=|", "-E", "occurrence=a", "-E", "aggregator=,", + "-e", "frame.number", "-e", "s1ap.MME_UE_S1AP_ID", "-e", "s1ap.ENB_UE_S1AP_ID", "-e", "_ws.malformed", "-e", "_ws.expert.severity") + cmd.Stdin = bytes.NewReader(pcapBytes) + + cmd.Env = append(os.Environ(), "HOME="+t.TempDir()) + + var stderr bytes.Buffer + + cmd.Stderr = &stderr + + res, err := cmd.Output() + if err != nil { + t.Fatalf("tshark: %v: %s", err, stderr.String()) + } + + var out [][]string + + for line := range strings.SplitSeq(strings.TrimRight(string(res), "\n"), "\n") { + cols := strings.Split(line, "|") + if len(cols) != 5 { + t.Fatalf("unexpected tshark output %q", line) + } + + out = append(out, cols) + } + + return out +} + +func hexDump(dump *strings.Builder, b []byte) { + for off := 0; off < len(b); off += 16 { + fmt.Fprintf(dump, "%06x %s\n", off, hexSpaced(b[off:min(off+16, len(b))])) + } +} + +func TestRawPDUTshark(t *testing.T) { + tshark, err1 := exec.LookPath("tshark") + text2pcap, err2 := exec.LookPath("text2pcap") + + if err1 != nil || err2 != nil { + t.Skip("tshark/text2pcap not installed") + } + + type expect struct { + source string + id1, id2 string + } + + var ( + origDump, splicedDump strings.Builder + expects []expect + ) + + for _, c := range loadCorpus(t) { + p, err := ParseRawPDU(c.b) + if err != nil { + t.Fatalf("%s: %v", c.source, err) + } + + e := expect{source: c.source} + + if p.Index(IDMMEUES1APID) >= 0 { + if err := p.SetMMEUES1APID(4294967295); err != nil { + t.Fatal(err) + } + + e.id1 = strconv.FormatUint(4294967295, 10) + } + + if p.Index(IDENBUES1APID) >= 0 { + if err := p.SetENBUES1APID(16777215 - 1); err != nil { + t.Fatal(err) + } + + e.id2 = strconv.FormatUint(16777215-1, 10) + } + + out, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + hexDump(&origDump, c.b) + hexDump(&splicedDump, out) + + expects = append(expects, e) + } + + orig := tsharkFields(t, tshark, text2pcap, origDump.String()) + spliced := tsharkFields(t, tshark, text2pcap, splicedDump.String()) + + if len(orig) != len(expects) || len(spliced) != len(expects) { + t.Fatalf("tshark decoded %d/%d frames, want %d", len(orig), len(spliced), len(expects)) + } + + var withIDs int + + for i, cols := range spliced { + e := expects[i] + + if cols[3] != orig[i][3] || cols[4] != orig[i][4] { + t.Errorf("frame %d (%s): splice changed tshark's verdict from %q to %q", i+1, e.source, strings.Join(orig[i][3:], "|"), strings.Join(cols[3:], "|")) + } + + if strings.HasPrefix(e.source, "open5gs") && (cols[3] != "" || strings.Contains(cols[4], "8388608")) { + t.Errorf("frame %d (%s): tshark reports an error: %q", i+1, e.source, strings.Join(cols, "|")) + } + + if e.id1 != "" && !slices.Contains(strings.Split(cols[1], ","), e.id1) { + t.Errorf("frame %d (%s): MMEUES1APID %q, want %s", i+1, e.source, cols[1], e.id1) + } + + if e.id2 != "" && !slices.Contains(strings.Split(cols[2], ","), e.id2) { + t.Errorf("frame %d (%s): ENBUES1APID %q, want %s", i+1, e.source, cols[2], e.id2) + } + + if e.id1 != "" || e.id2 != "" { + withIDs++ + } + } + + t.Logf("tshark decoded %d spliced PDUs, %d with rewritten UE IDs", len(spliced), withIDs) +} + +func hexSpaced(b []byte) string { + parts := make([]string, len(b)) + for i, x := range b { + parts[i] = fmt.Sprintf("%02x", x) + } + + return strings.Join(parts, " ") +} + +func TestRawPDURefusesPrivateMessage(t *testing.T) { + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcPrivateMessage, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x00, 0x00}}) + if err != nil { + t.Fatal(err) + } + + if _, err := ParseRawPDU(b); err == nil { + t.Fatal("PrivateMessage accepted as a ProtocolIE-Container") + } +} + +func TestRawPDUSetAbsentIE(t *testing.T) { + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcErrorIndication, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x00, 0x00}}) + if err != nil { + t.Fatal(err) + } + + p, err := ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + if err := p.SetMMEUES1APID(1); !errors.Is(err, ErrIENotPresent) { + t.Fatalf("Set on an absent IE: %v", err) + } + + if _, ok, err := p.MMEUES1APID(); ok || err != nil { + t.Fatalf("Get on an absent IE: %v %v", ok, err) + } + + if err := p.Insert(0, RawIE{ID: IDMMEUES1APID, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x05}}); err != nil { + t.Fatal(err) + } + + if v, ok, err := p.MMEUES1APID(); !ok || err != nil || v != 5 { + t.Fatalf("after Insert: %v %v %v", v, ok, err) + } +} + +func TestRawPDUUnmodeledProcedure(t *testing.T) { + id, err := per.Marshal(MMEUES1APID(42)) + if err != nil { + t.Fatal(err) + } + + body := per.NewWriter() + body.WriteBit(false) + + if err := encodeIEContainer(body, per.Aligned, []ieField{ + {id: 60000, crit: CriticalityNotify, raw: []byte{0xde, 0xad}}, + {id: IDMMEUES1APID, crit: CriticalityReject, raw: id}, + {id: 60001, crit: CriticalityIgnore, raw: bytes.Repeat([]byte{0xbe}, 200)}, + }); err != nil { + t.Fatal(err) + } + + for _, pdu := range []PDU{ + &InitiatingMessage{ProcedureCode: 250, Criticality: CriticalityIgnore, Value: body.Bytes()}, + &SuccessfulOutcome{ProcedureCode: 251, Criticality: CriticalityReject, Value: body.Bytes()}, + &UnsuccessfulOutcome{ProcedureCode: 252, Criticality: CriticalityNotify, Value: body.Bytes()}, + } { + b, err := Marshal(pdu) + if err != nil { + t.Fatal(err) + } + + p, err := ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + if int(p.Trigger()) != pdu.choiceIndex() || p.ProcedureCode() != pdu.procedureCode() || p.Criticality() != pdu.criticality() { + t.Fatalf("header %d/%d/%d", p.Trigger(), p.ProcedureCode(), p.Criticality()) + } + + if err := p.SetMMEUES1APID(4294967295); err != nil { + t.Fatal(err) + } + + out, err := p.Marshal() + if err != nil { + t.Fatal(err) + } + + back, err := ParseRawPDU(out) + if err != nil { + t.Fatal(err) + } + + if v, ok, err := back.MMEUES1APID(); !ok || err != nil || uint64(v) != 4294967295 { + t.Fatalf("MMEUES1APID = %v %v %v", v, ok, err) + } + + ies := back.IEs() + if len(ies) != 3 || ies[0].ID != 60000 || ies[0].Criticality != CriticalityNotify || !bytes.Equal(ies[0].Value, []byte{0xde, 0xad}) || + ies[2].ID != 60001 || len(ies[2].Value) != 200 { + t.Fatalf("other IEs disturbed: %+v", ies) + } + } +} + +func FuzzRawPDU(f *testing.F) { + for _, c := range loadCorpus(f) { + f.Add(c.b) + } + + f.Fuzz(func(t *testing.T, data []byte) { + p, err := ParseRawPDU(data) + if err != nil { + return + } + + out, err := p.Marshal() + if err != nil || !bytes.Equal(out, data) { + t.Fatalf("identity: %v", err) + } + + for i := range p.Len() { + ie, err := p.IE(i) + if err != nil { + t.Fatal(err) + } + + if err := p.SetValue(i, ie.Value); err != nil { + t.Fatal(err) + } + } + + out, err = p.Marshal() + if err != nil || !bytes.Equal(out, data) { + t.Fatalf("same-value replace: %v", err) + } + + if p.Index(IDMMEUES1APID) < 0 { + return + } + + if err := p.SetMMEUES1APID(4294967295); err != nil { + t.Fatal(err) + } + + out, err = p.Marshal() + if err != nil { + t.Fatal(err) + } + + back, err := ParseRawPDU(out) + if err != nil { + t.Fatalf("re-parse: %v", err) + } + + if v, ok, err := back.MMEUES1APID(); !ok || err != nil || uint64(v) != 4294967295 { + t.Fatalf("MMEUES1APID after splice: %v %v %v", v, ok, err) + } + }) +} diff --git a/s1ap/raw_pdu_ue_ids.go b/s1ap/raw_pdu_ue_ids.go new file mode 100644 index 0000000000..1f6cb21d35 --- /dev/null +++ b/s1ap/raw_pdu_ue_ids.go @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +func (p *RawPDU) MMEUES1APID() (MMEUES1APID, bool, error) { + var v MMEUES1APID + + ok, err := p.Get(IDMMEUES1APID, &v) + + return v, ok, err +} + +func (p *RawPDU) SetMMEUES1APID(v MMEUES1APID) error { return p.Set(IDMMEUES1APID, v) } + +func (p *RawPDU) ENBUES1APID() (ENBUES1APID, bool, error) { + var v ENBUES1APID + + ok, err := p.Get(IDENBUES1APID, &v) + + return v, ok, err +} + +func (p *RawPDU) SetENBUES1APID(v ENBUES1APID) error { return p.Set(IDENBUES1APID, v) } + +func (p *RawPDU) SourceMMEUES1APID() (MMEUES1APID, bool, error) { + var v MMEUES1APID + + ok, err := p.Get(IDSourceMMEUES1APID, &v) + + return v, ok, err +} + +func (p *RawPDU) SetSourceMMEUES1APID(v MMEUES1APID) error { return p.Set(IDSourceMMEUES1APID, v) } + +func (p *RawPDU) UES1APIDs() (UES1APIDs, bool, error) { + var v UES1APIDs + + ok, err := p.Get(IDUES1APIDs, &v) + + return v, ok, err +} + +func (p *RawPDU) SetUES1APIDs(v UES1APIDs) error { return p.Set(IDUES1APIDs, v) } diff --git a/s1ap/reroute_nas.go b/s1ap/reroute_nas.go new file mode 100644 index 0000000000..6de3a0dd35 --- /dev/null +++ b/s1ap/reroute_nas.go @@ -0,0 +1,141 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "github.com/ellanetworks/core/per" +) + +var uEUsageTypeBounds = per.Bounds{LB: 0, UB: 255, HasLB: true, HasUB: true} + +type S1Message []byte + +func (s S1Message) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, s) +} + +func (s *S1Message) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *s = b + + return nil +} + +type AdditionalGUTI struct { + _ [0]struct{} `per:"extseq"` + GUMMEI GUMMEI + MTMSI MTMSI + _ ieExtensions `per:",skip"` +} + +// TS 36.413 §9.1.7.5. +type RerouteNASRequest struct { + ENBUES1APID ENBUES1APID + MMEUES1APID *MMEUES1APID + S1Message S1Message + MMEGroupID MMEGroupID + AdditionalGUTI *AdditionalGUTI + UEUsageType *uint8 + + messageMeta +} + +var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ + { + id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.ENBUES1APID) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + }, + { + id: IDMMEUES1APID, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalIE(raw, &m.MMEUES1APID) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return optionalIE(m.MMEUES1APID) }, + }, + { + id: IDS1Message, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.S1Message) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + if m.S1Message == nil { + return nil, false + } + + return m.S1Message, true + }, + }, + { + id: IDMMEGroupID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.MMEGroupID) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return &m.MMEGroupID, true }, + }, + { + id: IDAdditionalGUTI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + var v AdditionalGUTI + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.AdditionalGUTI = &v + + return nil + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + if m.AdditionalGUTI == nil { + return nil, false + } + + return m.AdditionalGUTI, true + }, + }, + { + id: IDUEUsageType, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + return decodeOptionalInteger(raw, uEUsageTypeBounds, &m.UEUsageType) + }, + encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + if m.UEUsageType == nil { + return nil, false + } + + return integerIE(uEUsageTypeBounds, int64(*m.UEUsageType)), true + }, + }, +} + +func (m *RerouteNASRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcRerouteNASRequest, rerouteNASRequestIEs, m) +} + +func (m *RerouteNASRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcRerouteNASRequest, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseRerouteNASRequest(value []byte) (*RerouteNASRequest, error) { + return parseMessageBody[RerouteNASRequest](ProcRerouteNASRequest, TriggeringInitiatingMessage, rerouteNASRequestIEs, value) +} diff --git a/s1ap/reset.go b/s1ap/reset.go index dd40453dc0..4e6019497c 100644 --- a/s1ap/reset.go +++ b/s1ap/reset.go @@ -26,10 +26,10 @@ const resetAllRootCount = 1 // TS 36.413. Both identities are optional; an item may carry either or both. type UEAssociatedLogicalS1ConnectionItem struct { - _ [0]struct{} `per:"extseq"` - MMEUES1APID *MMEUES1APID `per:",optional"` - ENBUES1APID *ENBUES1APID `per:",optional"` - _ ieExtensions `per:",skip"` + MMEUES1APID *MMEUES1APID `per:",optional"` + ENBUES1APID *ENBUES1APID `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // All selects s1-Interface, resetting the whole interface; otherwise Part diff --git a/s1ap/reset_extensions_test.go b/s1ap/reset_extensions_test.go new file mode 100644 index 0000000000..08315b122a --- /dev/null +++ b/s1ap/reset_extensions_test.go @@ -0,0 +1,214 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "testing" + + "github.com/ellanetworks/core/per" +) + +type handItem struct { + mme, enb *uint32 + extCrit Criticality + withExt bool + withAdditions bool +} + +func encodeHandItem(t *testing.T, it handItem) []byte { + t.Helper() + + w := per.NewWriter() + enc := per.Aligned + + w.WriteBit(it.withAdditions) + w.WriteBit(it.mme != nil) + w.WriteBit(it.enb != nil) + w.WriteBit(it.withExt) + + if it.mme != nil { + if err := MMEUES1APID(*it.mme).MarshalPER(w, enc); err != nil { + t.Fatal(err) + } + } + + if it.enb != nil { + if err := ENBUES1APID(*it.enb).MarshalPER(w, enc); err != nil { + t.Fatal(err) + } + } + + if it.withExt { + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, 2)) + + for i, id := range []int64{999, 1000} { + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 0, maxProtocolIEs, id)) + mustNil(t, per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(it.extCrit))) + mustNil(t, per.EncodeOpenTypeBytes(w, enc, bytes.Repeat([]byte{0xab}, 1+i*200))) + } + } + + if it.withAdditions { + mustNil(t, per.EncodeNormallySmallLength(w, enc, 3, func(int64) error { + w.WriteBit(true) + w.WriteBit(false) + w.WriteBit(true) + + return nil + })) + mustNil(t, per.EncodeOpenTypeBytes(w, enc, []byte{0x11})) + mustNil(t, per.EncodeOpenTypeBytes(w, enc, []byte{0x22, 0x33})) + } + + return w.Bytes() +} + +func mustNil(t *testing.T, err error) { + t.Helper() + + if err != nil { + t.Fatal(err) + } +} + +func encodeHandList(t *testing.T, w *per.Writer, crit Criticality, items []handItem) { + t.Helper() + + mustNil(t, per.EncodeLength(w, per.Aligned, 1, maxnoofIndividualS1ConnectionsToReset, true, int64(len(items)), func(int64) error { + for _, it := range items { + if err := encodeContainerField(w, per.Aligned, ieField{id: IDUEAssociatedLogicalS1ConnectionItem, crit: crit, raw: encodeHandItem(t, it)}); err != nil { + return err + } + } + + return nil + })) +} + +func handReset(t *testing.T, items []handItem) []byte { + t.Helper() + + rt := per.NewWriter() + rt.WriteBit(false) + mustNil(t, per.EncodeConstrainedWholeNumber(rt, per.Aligned, 0, resetTypeChoiceRootCount-1, resetTypePartOfS1Interface)) + encodeHandList(t, rt, CriticalityReject, items) + + cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + mustNil(t, err) + + body := per.NewWriter() + body.WriteBit(false) + mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ + {id: IDCause, crit: CriticalityIgnore, raw: cause}, + {id: IDResetType, crit: CriticalityReject, raw: rt.Bytes()}, + })) + + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcReset, Criticality: CriticalityReject, Value: body.Bytes()}) + mustNil(t, err) + + return b +} + +func handResetAck(t *testing.T, items []handItem) []byte { + t.Helper() + + list := per.NewWriter() + encodeHandList(t, list, CriticalityIgnore, items) + + body := per.NewWriter() + body.WriteBit(false) + mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ + {id: IDUEAssociatedLogicalS1ConnectionListResAck, crit: CriticalityIgnore, raw: list.Bytes()}, + })) + + b, err := Marshal(&SuccessfulOutcome{ProcedureCode: ProcReset, Criticality: CriticalityReject, Value: body.Bytes()}) + mustNil(t, err) + + return b +} + +func u32(v uint32) *uint32 { return &v } + +func resetFixtures(mme uint32) []handItem { + return []handItem{ + {mme: u32(mme), enb: u32(7), extCrit: CriticalityIgnore, withExt: true, withAdditions: true}, + {enb: u32(8), extCrit: CriticalityNotify, withExt: true}, + {mme: u32(mme + 1), withAdditions: true}, + {mme: u32(mme + 2), enb: u32(9)}, + } +} + +func TestResetPreservesItemExtensions(t *testing.T) { + in := handReset(t, resetFixtures(5)) + + pdu, err := Unmarshal(in) + mustNil(t, err) + + m, err := ParseReset(pdu.value()) + mustNil(t, err) + + out, err := m.Marshal() + mustNil(t, err) + + if !bytes.Equal(out, in) { + t.Fatalf("unmodified Reset re-encoded differently\n got % x\nwant % x", out, in) + } + + for i := range m.ResetType.Part { + if m.ResetType.Part[i].MMEUES1APID != nil { + v := *m.ResetType.Part[i].MMEUES1APID + 0x10000000 - 5 + m.ResetType.Part[i].MMEUES1APID = &v + } + } + + out, err = m.Marshal() + mustNil(t, err) + + if want := handReset(t, resetFixtures(0x10000000)); !bytes.Equal(out, want) { + t.Fatalf("rewritten Reset differs\n got % x\nwant % x", out, want) + } +} + +func TestResetAcknowledgePreservesItemExtensions(t *testing.T) { + in := handResetAck(t, resetFixtures(70000)) + + pdu, err := Unmarshal(in) + mustNil(t, err) + + m, err := ParseResetAcknowledge(pdu.value()) + mustNil(t, err) + + out, err := m.Marshal() + mustNil(t, err) + + if !bytes.Equal(out, in) { + t.Fatalf("unmodified Reset Acknowledge re-encoded differently\n got % x\nwant % x", out, in) + } + + for i := range m.ConnectionList { + if m.ConnectionList[i].MMEUES1APID != nil { + v := *m.ConnectionList[i].MMEUES1APID - 70000 + 3 + m.ConnectionList[i].MMEUES1APID = &v + } + } + + out, err = m.Marshal() + mustNil(t, err) + + if want := handResetAck(t, resetFixtures(3)); !bytes.Equal(out, want) { + t.Fatalf("rewritten Reset Acknowledge differs\n got % x\nwant % x", out, want) + } +} + +func TestResetItemRejectExtensionNotComprehended(t *testing.T) { + in := handReset(t, []handItem{{mme: u32(1), extCrit: CriticalityReject, withExt: true}}) + + pdu, err := Unmarshal(in) + mustNil(t, err) + + if _, err := ParseReset(pdu.value()); err == nil { + t.Fatal("reject-criticality item extension accepted") + } +} diff --git a/s1ap/testdata/captures/open5gs.txt b/s1ap/testdata/captures/open5gs.txt new file mode 100644 index 0000000000..2a1ef2650e --- /dev/null +++ b/s1ap/testdata/captures/open5gs.txt @@ -0,0 +1,99 @@ +0011001f000003003b00080009f1070054f640004000070000004009f1070089400120 +201100170000020069000b000009f10700000002000100574001ff +0011001f000003003b00080009f1070054f650004000070000004009f1070089400120 +0011001f000003003b00080009f1070054f660004000070000004009f1070089400120 +0011001f000003003b00080009f1070054f670004000070000004009f1070089400120 +00110021000003003b40080062f22400000170004000070000004062f224002c00030a0100 +000f40080000010002400135 +000c005b000005000800020001001a00333217000000000007410208991007374600000607f0f0c04001001000050201d031d15c20003103e5e0349011035f58a65d0105004300060009f1070001006440080009f1071079baf00086400130 +000b4038000003000000020001000800020001001a0025240752002b6af03df2dddd1292f73931cc13855210c10b4fcdde3180004a3e9d91fd62d73d +000d4035000005000000020001000800020001001a000c0b07530830b32a4f09a54ac4006440080009f1071079baf0004340060009f1070001 +000b402f000003000000020001000800020001001a001c1b37a8a82a3200075d010005f0f0c04070c14f08a35e5f5912506ad4 +000d403d000005000000020001000800020001001a00141327f15301c101075e23098366050704405003f1006440080009f1071079baf0004340060009f1070001 +000b401d000003000000020001000800020001001a000a092777ffdd94010201d9 +000d405d000005000000020001000800020001001a00343327ea6d5cf2020201da280908696e7465726e6574271d8080211001010010810600000000830600000000000300000a00000d00006440080009f1071079baf0004340060009f1070001 +00090081060000070000000200010008000200010042000a183d090000603d09000000180080ab0000340080a54500093c0f807f00000600000002809527318b76fe0207420249062009f1070001006f5201c101090908696e7465726e65740d0300000000000000020a2d00025e06fefee2e20303274880802110020000108106080808088306080804040003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404500bf609f107000201cc00ab6b594964020108006b00051c000e000000490020b615aadfadc061f29a85420532cd63d1bf6fea41e751109324e205fc44318a0800c040088665070400ffff01 +0016403c000003000000020001000800020001004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +200900220000030000400200010008400200010033400f000032400a0a1f7f00000200000001 +000d4044000006000000020001000800020001001a000e0d276d1ed06e03074300035200c2006440080009f1071079baf0004340060009f1070001012040090009f1070012345020 +000b4038000003000000020001000800020001001a0025242753e73944030761430f10004f00700065006e0035004700534702802251250369490100 +000c0080a0000005000800020002001a00787717e164b6d1040741020bf609f107000201cc00ab6b07f0f0c04001001000240201d031d1271d8080211001010010810600000000830600000000000300000a00000d005209f10700015c20003103e5e0341309f107000111035f58a6200b601404ef65233b8878d29040080402600400021f025d0105e0004300060009f1070001006440080009f1071079baf00086400130 +000b401d000003000000020002000800020002001a000a0927eec81e21040201d9 +00124015000003000000020001000800020001000240020280 +000f40150000030000400200010008400200010002400201a0 +000d406a000006000000020002000800020002001a00343327dc4d6cbf050201da280908696e7465726e6574271d8080211001010010810600000000830600000000000300000a00000d00006440080009f1071079baf0004340060009f1070001012040090009f1070012345020 +00090081260000080000000200020008000200020042000a183d090000603d090000001800809e0000340080984500093c0f807f000006000000028088278673b29b0507420249062009f1070001006f5201c101090908696e7465726e65740d0300000000000000020a2d00025e06fefee2e20303274880802110020000108106080808088306080804040003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404594964020108006b00051c000e0000004900209a18a963abd7baa72d979ea54fb40eaf4b5a325d4ab895301bf4e36664e2e136004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a03000088000000c040088665070400ffff01 +000d4044000006000000020002000800020002001a000e0d27ec8345d406074300035200c2006440080009f1071079baf0004340060009f1070001012040090009f1070012345020 +000b4038000003000000020002000800020002001a00252427d801c2bd060761430f10004f00700065006e0035004700534702802251250369490100 +000c0048000006000800020003001a00161527ff806bbe070745090bf609f107000201cc00ab6b004300060009f1070001006440080009f1071079baf00086400130006040060040cc00ab6b +0017001000000200630004000300030002400124 +2017000f000002000040020003000840020003 +000c0080a0000005000800020004001a00787717f3635f53080741020bf609f1070002010000123407f0f0c04001001000240201d031d1271d8080211001010010810600000000830600000000000300000a00000d005209f10700015c20003103e5e0341309f107000111035f58a6200b601404ef65233b8878d29040080402600400021f025d0105e0004300060009f1070001006440080009f1071079baf00086400130 +000b4017000003000000020004000800020004001a000403075501 +000d4042000006000000020004000800020004001a000c0b0756089910073746000056006440080009f1071079baf0004340060009f1070001012040090009f1070012345020 +000b4017000003000000020004000800020004001a000403074408 +0017001000000200630004000400040002400120 +2017000f000002000040020004000840020004 +000c0070000005000800020001001a00484707417208991007374600000607f0f0c04001001000240201d031d1271d8080211001010010810600000000830600000000000300000a00000d005c20009011035f58a6f15d0105004300060009f1070001006440080009f1071079baf00086400130 +000d4035000005000000020005000800020001001a000c0b075308922d8c167ca68fa0006440080009f1071079baf0004340060009f1070001 +00090081330000080000000200050008000200010042000a183d090000603d09000000180080ab0000340080a54500093c0f807f000006000000048095276af46e640207420249062009f1070001006f5201c101090908696e7465726e65740d0300000000000000030a2d00035e06fefee2e20303274880802110020000108106080808088306080804040003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404500bf609f107000201cc00ab6b594964020108006b00051c000e00000049002096a2a900e7483b8981c9c6ff487e9f20cd46cea4ec6817684b16a9d79f05baf2004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a03000088000000c040088665070400ffff01 +0016403c000003000000020005000800020001004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +200900220000030000400200050008400200010033400f000032400a0a1f7f00000200000002 +000c006a000005000800020002001a0042411732cb41460307410208991007374600000607f0f0c04001001000240201d031d1271d8080211001010010810600000000830600000000000300000a00000d00c1004300060009f1070001006440080009f1071079baf00086400130 +00090081330000080000000200060008000200020042000a183d090000603d09000000180080ab0000340080a54500093c0f807f00000600000004809527ccb13a5e0507420249062009f1070001006f5201c101090908696e7465726e65740d0300000000000000030a2d00035e06fefee2e20303274880802110020000108106080808088306080804040003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404500bf609f107000201cc00ab6b594964020108006b00051c000e000000490020a9f1bfa59353da3fb48bddeaf1f2968ab8479d96195cec8cb6867cf5e3accc5c004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a03000088000000c040088665070400ffff01 +000c0064000005000800020003001a003c3b07410208991007374600000607f0f0c04001001000240201d031d1271d8080211001010010810600000000830600000000000300000a00000d00c1004300060009f1070001006440080009f1071079baf00086400130 +0017001000000200630004000700030002400120 +2017000f000002000040020007000840020003 +000c0064000005000800020001001a003c3b07417108991007374600000607f0f0c04001001000240201d031d1271d8080211001010010810600000000830600000000000300000a00000d00c1004300060009f1070001006440080009f107054f64000086400130 +00090081060000070000000200080008000200010042000a183d090000603d09000000180080ab0000340080a54500093c0f807f0000060000000680952779f06e950207420149062009f1070001006f5201c101090908696e7465726e65740d0300000000000000040a2d00045e06fefee2e20303274880802110020000108106080808088306080804040003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404500bf609f107000201da0046a4594964020108006b00051c000e00000049002016fd717c63e0bef75f73df8955dcb381f3d8ea6e146a3a60ee6f65d1ac5bea5600c040088665070400ffff01 +0016403c000003000000020008000800020001004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +200900220000030000400200080008400200010033400f000032400a0a1f7f00000200000003 +00124015000003000000020008000800020001000240020280 +0017001000000200630004000800010002400120 +2017000f000002000040020008000840020001 +000900809a0000080000000200090008000200020042000a183d090000603d09000000180013000034000e0500093c0f807f00000600000006006b00051c000e0000004900206a8a5cad5338ca8ce190bf8d6de946ffb2a48430770ef6021a626b8189bf3394004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a03000088000000c040088665070400ffff01 +0016403c000003000000020009000800020002004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +200900220000030000400200090008400200020033400f000032400a0a1f7f00000200000003 +00090080b700000800000002000a0008000200030042000a183d090000603d09000000180030000034002b4500093c0f807f000006000000061c27769be83d040749015a4954062009f1070001570220005949640101006b00051c000e0000004900206a8a5cad5338ca8ce190bf8d6de946ffb2a48430770ef6021a626b8189bf3394004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a03000088000000c040088665070400ffff01 +2009002200000300004002000a0008400200030033400f000032400a0a1f7f00000200000003 +0017001000000200630004000b00040002400120 +2017000f00000200004002000b000840020004 +000900813300000800000002000c0008000200010042000a183d090000603d09000000180080ab0000340080a54500093c0f807f00000600000008809527a56e1e790107420249062009f1070001006f5201c101090908696e7465726e65740d0300000000000000050a2d00055e06fefee2e20303274880802110020000108106080808088306080804040003102001486048600000000000000000888800031020014860486000000000000000008844000d0408080808000d0408080404500bf609f107000201da0046a4594964020108006b00051c000e000000490020259b8a21ad078683e9bab916db0b0f5cd2d16cd8cb52269b60cb4bd48640f0b9004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a03000088000000c040088665070400ffff01 +0017001000000200630004000c00010002400120 +2017000f00000200004002000c000840020001 +0017001000000200630004000d00010002400120 +2017000f00000200004002000d000840020001 +0016403c00000300000002000e000800020002004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +2009002200000300004002000e0008400200020033400f000032400a0a1f7f00000200000005 +000e4015000002000240020060005c00084000005b0002400e +200e000e000001005d400700005b4002400e +0017001000000200630004000f00030002400120 +2017000f00000200004002000f000840020003 +400900150000030000400200100008400200010002400202a0 +001240150000030000000200100008000200010002400202a0 +0011001f000003003b00080009f107002343d0004000070000004009f1070089400120 +0016403c000003000000020011000800020001004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +0016403c000003000000020012000800020002004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +200900220000030000400200120008400200020033400f000032400a0a1f7f00000200000007 +400900150000030000400200120008400200020002400202a0 +0016403c000003000000020013000800020001004a402928013001023cd98000bc000ff06ec4d00141b82c0000000007d404000ef0802000016a030000880000 +200900220000030000400200140008400200020033400f000032400a0a1f7f00000200000008 +00124015000003000000020014000800020002000240020280 +400900150000030000400200150008400200030002400202a0 +00124015000003000000020015000800020003000240020280 +0011002d000004003b00080009f107000019b0003c400a0380737273656e62303100400007000001c009f1070089400140 +0005007f0000030000000200060008000200050010006c00001100670e80010b08a02820a02820a02820a0280f800a048015000000214c276489306f117200c5060501282828283b2210011a301111c0a86502ffffffff100a048015ffffffff40c3885079fa21021a301111c0a86502ffffffff100a048015ffffffff40c3885079fa +0005007f0000030000000200070008000200060010006c00001100670e80010b08a02820a02820a02820a0280f800a048015000000234c27b1fa1e6a117200c5060501282828283b2210011a301111c0a86503ffffffff100a048015ffffffff40c360507a0621021a301111c0a86503ffffffff100a048015ffffffff40c360507a06 +20050022000003000040020006000840020005001c400f000027400a0e1fac18002d000000b2 +00050080aa00000300000002000600080002000500100080960000110080900c0005040f80ac180f1e0000001b808027bb449bce116247c101050403696d730501c0a865025e02b38e583227628080211002000010810608080808830608080404000d0408080808000d04080804040003102001486048600000000000000000888800031020014860486000000000000000008844000110fe80000000000000f8163efffe15fe34000c040a048015 +20050022000003000040020006000840020005001c400f000027400a0c1fac18002e000000f9 +0005006e0000030000000200070008000200060010005b00001100560c0005040f80ac180f1e0000001f47278863adc0126202c101050403696d730501c0a865055e02b38e583227298080211002000010810608080808830608080404000c040a048015000d0408080808000d0408080404 +20050022000003000040020007000840020006001c400f000027400a0c1fac18002e00000009 +00050080c000000300000002000100080002000000100080ac0000110080a60e80010b100140504001405040014050400140500f80ac180f1e00000009808627d15c2bd3057200c506050142424242752410011a301111c0a86502ffffffff100a048015ffffffff4004d25077a221021a301111c0a86502ffffffff100a048015ffffffff4004d25077a212031a301111c0a86502ffffffff100a048015ffffffff4004d35077a323041a301111c0a86502ffffffff100a048015ffffffff4004d35077a3 +00050080c000000300000002000200080002000100100080ac0000110080a60e80010b100140504001405040014050400140500f80ac180f1e0000000b80862781d0c187057200c506050142424242752410011a301111c0a86503ffffffff100a048015ffffffff4004da5077aa21021a301111c0a86503ffffffff100a048015ffffffff4004da5077aa12031a301111c0a86503ffffffff100a048015ffffffff4004db5077ab23041a301111c0a86503ffffffff100a048015ffffffff4004db5077ab +20050022000003000040020001000840020000001c400f000027400a0e1fac18002e00000072 +20050022000003000040020002000840020001001c400f000027400a0e1fac18002e0000007a +00050080c000000300000002000500080002000400100080ac0000110080a60e80010b100140504001405040014050400140500f80ac180f1e000000118086273a90cb690a7200c506050142424242752410011a301111c0a86504ffffffff100a048015ffffffff4004d250753021021a301111c0a86504ffffffff100a048015ffffffff4004d250753012031a301111c0a86504ffffffff100a048015ffffffff4004d350753123041a301111c0a86504ffffffff100a048015ffffffff4004d3507531 +00050080c000000300000002000300080002000200100080ac0000110080a60e80010b100140504001405040014050400140500f80ac180f1e000000138086277de5597e0a7200c506050142424242752410011a301111c0a86502ffffffff100a048015ffffffff40c38850754621021a301111c0a86502ffffffff100a048015ffffffff40c38850754612031a301111c0a86502ffffffff100a048015ffffffff40c38950754723041a301111c0a86502ffffffff100a048015ffffffff40c389507547 +20050022000003000040020005000840020004001c400f000027400a0e1fac18002e000000da +20050022000003000040020008000840020007001c400f000027400a0e1fac18002e0000008a diff --git a/s1ap/testdata/fuzz/FuzzRawPDU/13ffa649c7e29f77 b/s1ap/testdata/fuzz/FuzzRawPDU/13ffa649c7e29f77 new file mode 100644 index 0000000000..ec069f2648 --- /dev/null +++ b/s1ap/testdata/fuzz/FuzzRawPDU/13ffa649c7e29f77 @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("000\x150\x00\x02000\x00000\x000000000000") From ee5cecc48307cd60fdd873b0b5b96ae1a5bce702 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Fri, 13 Nov 2026 06:55:07 -0500 Subject: [PATCH 02/16] fix: pr review Signed-off-by: Guillaume Belanger --- REUSE.toml | 8 ++ internal/tester/gnb/broadcast_plmn.go | 7 ++ .../gnb/handle_ue_context_release_command.go | 1 + .../tester/gnb/release_selected_plmn_test.go | 106 ++++++++++++++++++ internal/tester/s1enb/broadcast_plmn.go | 7 ++ internal/tester/s1enb/broadcast_plmn_test.go | 20 ++++ internal/tester/s1enb/s1ap.go | 2 + ngap/golden_tshark_test.go | 97 ++++++++++++++++ ngap/ie_pws.go | 16 --- ngap/overload.go | 5 - ngap/pws.go | 6 - ngap/raw_pdu_test.go | 16 ++- ngap/raw_pdu_ue_ids_test.go | 85 ++++++++++++++ ngap/reroute_nas.go | 3 - ngap/ue_context_release.go | 38 ++++++- per/extension_test.go | 9 ++ per/opentype.go | 16 ++- per/opentype_test.go | 19 ++++ per/protocolie/protocolie.go | 1 + per/protocolie/protocolie_test.go | 32 ++++++ s1ap/golden_tshark_test.go | 101 +++++++++++++++++ s1ap/overload.go | 2 - s1ap/pws.go | 6 - s1ap/pws_overload_test.go | 10 ++ s1ap/raw_pdu_test.go | 16 ++- s1ap/raw_pdu_ue_ids_test.go | 86 ++++++++++++++ s1ap/reroute_nas.go | 3 +- s1ap/ue_context_release.go | 38 ++++++- 28 files changed, 691 insertions(+), 65 deletions(-) create mode 100644 internal/tester/gnb/release_selected_plmn_test.go create mode 100644 ngap/golden_tshark_test.go create mode 100644 ngap/raw_pdu_ue_ids_test.go create mode 100644 s1ap/golden_tshark_test.go create mode 100644 s1ap/raw_pdu_ue_ids_test.go diff --git a/REUSE.toml b/REUSE.toml index 92feab3b5b..bb9efb33cb 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -99,6 +99,14 @@ precedence = "aggregate" SPDX-FileCopyrightText = "Ella Networks Inc." SPDX-License-Identifier = "Apache-2.0" +# S1AP and NGAP PDUs extracted with tshark from the pcapng files in the +# Open5GS repository (docs/assets/pcapng, commit 39a8c771f6d5). +[[annotations]] +path = ["s1ap/testdata/captures/open5gs.txt", "ngap/testdata/captures/open5gs.txt"] +precedence = "override" +SPDX-FileCopyrightText = "Open5GS contributors" +SPDX-License-Identifier = "AGPL-3.0-or-later" + # pergen generated code, not hand-edited [[annotations]] path = ["**/per_gen.go"] diff --git a/internal/tester/gnb/broadcast_plmn.go b/internal/tester/gnb/broadcast_plmn.go index 6b31285aa5..642a05af5d 100644 --- a/internal/tester/gnb/broadcast_plmn.go +++ b/internal/tester/gnb/broadcast_plmn.go @@ -115,3 +115,10 @@ func (g *GnodeB) explicitPLMN(ranUENGAPID int64) (mcc, mnc string) { return p.Mcc, p.Mnc } + +func (g *GnodeB) dropSelectedPLMN(ranUENGAPID int64) { + g.mu.Lock() + defer g.mu.Unlock() + + delete(g.selectedPLMNs, ranUENGAPID) +} diff --git a/internal/tester/gnb/handle_ue_context_release_command.go b/internal/tester/gnb/handle_ue_context_release_command.go index fb171b3437..b5949520a4 100644 --- a/internal/tester/gnb/handle_ue_context_release_command.go +++ b/internal/tester/gnb/handle_ue_context_release_command.go @@ -66,6 +66,7 @@ func handleUEContextReleaseCommand(gnb *GnodeB, value []byte) error { gnb.dropPDUSessions(ranUEID) gnb.dropRadioCapabilityReport(ranUEID) gnb.dropUEContext(ranUEID) + gnb.dropSelectedPLMN(ranUEID) ue.RRCRelease() diff --git a/internal/tester/gnb/release_selected_plmn_test.go b/internal/tester/gnb/release_selected_plmn_test.go new file mode 100644 index 0000000000..cafcf4a2f7 --- /dev/null +++ b/internal/tester/gnb/release_selected_plmn_test.go @@ -0,0 +1,106 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +//go:build linux && !386 + +package gnb_test + +import ( + "context" + "net" + "net/netip" + "testing" + "time" + + "github.com/ellanetworks/core/internal/tester/gnb" + "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/sctp" +) + +func TestUEContextReleaseClearsSelectedPLMN(t *testing.T) { + skipIfNoSCTP(t) + + const ranUEID = 3 + + acceptedCh := make(chan *sctp.SCTPConn, 1) + + srv := sctp.NewServer(sctp.Config{PPID: 60, Name: "TEST"}, sctp.Callbacks{ + Dispatch: func(_ context.Context, conn *sctp.SCTPConn, _ []byte) { + select { + case acceptedCh <- conn: + default: + } + }, + }) + + ctx, cancel := context.WithCancel(context.Background()) + t.Cleanup(cancel) + + ln, err := new(sctp.ListenConfig).Listen(ctx, &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: net.IPv4(127, 0, 0, 1)}}}) + if err != nil { + t.Fatalf("Listen: %v", err) + } + + srv.Serve(ctx, ln) + + t.Cleanup(func() { + shutdownCtx, shutdownCancel := context.WithTimeout(context.Background(), 5*time.Second) + defer shutdownCancel() + + srv.Shutdown(shutdownCtx) + }) + + loopback := &sctp.SCTPAddr{IPAddrs: []net.IPAddr{{IP: net.ParseIP("127.0.0.1")}}} + + gnbConn, err := sctp.Dial(ctx, "sctp", loopback, &sctp.SCTPAddr{IPAddrs: loopback.IPAddrs, Port: ln.Addr().(*sctp.SCTPAddr).Port}, sctp.InitMsg{NumOstreams: 2, MaxInstreams: 2}) + if err != nil { + t.Fatalf("dial: %v", err) + } + + g := gnb.NewGnodeB("000102", "001", "01", 1, "", "internet", "000001", "test", gnbConn, nil, netip.Addr{}) + t.Cleanup(g.Close) + + g.AdditionalPLMNs = []gnb.BroadcastPLMN{{Mcc: "310", Mnc: "260"}} + g.AddUE(ranUEID, &recordingDownlinkSender{}) + + if err := g.SelectPLMN(ranUEID, "310", "260"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + if _, err := gnbConn.WriteMsg(marshalNGSetupRequest(t), &sctp.SndRcvInfo{PPID: sctp.PPIDWireOrder(60), Stream: 0}); err != nil { + t.Fatalf("NG Setup trigger write: %v", err) + } + + var amfConn *sctp.SCTPConn + select { + case amfConn = <-acceptedCh: + case <-time.After(8 * time.Second): + t.Fatal("server never dispatched the association") + } + + cmd := &ngap.UEContextReleaseCommand{ + UENGAPIDs: ngap.UENGAPIDs{AMFUENGAPID: 1, RANUENGAPID: ranUEID, Pair: true}, + Cause: &ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}, + } + + pdu, err := cmd.Marshal() + if err != nil { + t.Fatalf("marshal UEContextReleaseCommand: %v", err) + } + + if _, err := amfConn.WriteMsg(pdu, &sctp.SndRcvInfo{PPID: sctp.PPIDWireOrder(60), Stream: 1}); err != nil { + t.Fatalf("write UEContextReleaseCommand: %v", err) + } + + deadline := time.Now().Add(8 * time.Second) + for time.Now().Before(deadline) { + if mcc, mnc := g.SelectedPLMN(ranUEID); mcc == "001" && mnc == "01" { + return + } + + time.Sleep(10 * time.Millisecond) + } + + mcc, mnc := g.SelectedPLMN(ranUEID) + t.Fatalf("SelectedPLMN after release = %s/%s, want the serving 001/01", mcc, mnc) +} diff --git a/internal/tester/s1enb/broadcast_plmn.go b/internal/tester/s1enb/broadcast_plmn.go index 6325461336..a9182f08a7 100644 --- a/internal/tester/s1enb/broadcast_plmn.go +++ b/internal/tester/s1enb/broadcast_plmn.go @@ -73,3 +73,10 @@ func (e *ENB) taiFor(enbUEID int64) s1ap.TAI { return s1ap.TAI{PLMNIdentity: plmn, TAC: s1ap.TAC(e.tac)} } + +func (e *ENB) dropSelectedPLMN(enbUEID int64) { + e.mu.Lock() + defer e.mu.Unlock() + + delete(e.selected, enbUEID) +} diff --git a/internal/tester/s1enb/broadcast_plmn_test.go b/internal/tester/s1enb/broadcast_plmn_test.go index ad6fce7943..30106b1ec7 100644 --- a/internal/tester/s1enb/broadcast_plmn_test.go +++ b/internal/tester/s1enb/broadcast_plmn_test.go @@ -120,3 +120,23 @@ func TestInitialUEMessageCarriesSelectedPLMNInTAI(t *testing.T) { t.Errorf("unselected UE TAI PLMN = % x, want the primary PLMN", tai.PLMNIdentity) } } + +func TestUEContextReleaseCompleteClearsSelectedPLMN(t *testing.T) { + e := multiPLMNENB(t) + + ue := e.NewUE("001010000000001", [16]byte{}, [16]byte{}) + if err := ue.SelectPLMN("310", "260"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + id := e.AllocateENBUEIDFor(ue) + if tai := e.taiFor(id); tai.PLMNIdentity != testOtherPLMN { + t.Fatalf("TAI PLMN = % x, want the selected 310/260", tai.PLMNIdentity) + } + + _ = e.SendUEContextReleaseComplete(1, id) + + if tai := e.taiFor(id); tai.PLMNIdentity != testHomePLMN { + t.Errorf("released UE TAI PLMN = % x, want the primary PLMN", tai.PLMNIdentity) + } +} diff --git a/internal/tester/s1enb/s1ap.go b/internal/tester/s1enb/s1ap.go index 6d66ccccce..e7434721c6 100644 --- a/internal/tester/s1enb/s1ap.go +++ b/internal/tester/s1enb/s1ap.go @@ -355,6 +355,8 @@ func (e *ENB) SendUEContextReleaseComplete(mmeUEID, enbUEID int64) error { return fmt.Errorf("s1enb: build UE Context Release Complete: %w", err) } + e.dropSelectedPLMN(enbUEID) + return e.SendMessage(b, true) } diff --git a/ngap/golden_tshark_test.go b/ngap/golden_tshark_test.go new file mode 100644 index 0000000000..9bfb474e3e --- /dev/null +++ b/ngap/golden_tshark_test.go @@ -0,0 +1,97 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/hex" + "os/exec" + "strconv" + "strings" + "testing" +) + +type tsharkVector struct { + name string + b []byte + extensionNotices int +} + +func goldenTsharkVectors(t *testing.T) []tsharkVector { + t.Helper() + + var out []tsharkVector + + for _, c := range pwsCases() { + b, err := hex.DecodeString(c.golden) + mustNil(t, err) + + out = append(out, tsharkVector{name: c.name, b: b}) + } + + return append(out, + tsharkVector{"NGReset", handNGReset(t, resetFixtures(5)), 4}, + tsharkVector{"NGResetMaxAMFUENGAPID", handNGReset(t, resetFixtures(0xFFFFFFFFFF-2)), 4}, + tsharkVector{"NGResetAcknowledge", handNGResetAck(t, resetFixtures(70000)), 4}, + tsharkVector{"UEContextReleaseCommandPairExtensions", handUEContextReleaseCommand(t, 1), 1}, + ) +} + +func isSubsequence(want, got []string) bool { + i := 0 + + for _, g := range got { + if i < len(want) && g == want[i] { + i++ + } + } + + return i == len(want) +} + +func TestGoldenVectorsTshark(t *testing.T) { + tshark, err1 := exec.LookPath("tshark") + text2pcap, err2 := exec.LookPath("text2pcap") + + if err1 != nil || err2 != nil { + t.Skip("tshark/text2pcap not installed") + } + + vectors := goldenTsharkVectors(t) + + var dump strings.Builder + for _, v := range vectors { + hexDump(&dump, v.b) + } + + rows := tsharkFields(t, tshark, text2pcap, dump.String(), "frame.number", "ngap.procedureCode", "ngap.id", "_ws.malformed", "_ws.expert.message") + if len(rows) != len(vectors) { + t.Fatalf("tshark decoded %d frames, want %d", len(rows), len(vectors)) + } + + for i, v := range vectors { + cols := rows[i] + + p, err := ParseRawPDU(v.b) + if err != nil { + t.Fatalf("%s: %v", v.name, err) + } + + if cols[3] != "" || cols[4] != strings.TrimSuffix(strings.Repeat("unknown sequence extension,", v.extensionNotices), ",") { + t.Errorf("%s: tshark reports %q, want %d unknown sequence extension notes", v.name, strings.Join(cols[3:], "|"), v.extensionNotices) + } + + if pc := strings.Split(cols[1], ",")[0]; pc != strconv.Itoa(int(p.ProcedureCode())) { + t.Errorf("%s: tshark procedureCode %s, want %d", v.name, pc, p.ProcedureCode()) + } + + var ids []string + for _, ie := range p.IEs() { + ids = append(ids, strconv.Itoa(int(ie.ID))) + } + + if !isSubsequence(ids, strings.Split(cols[2], ",")) { + t.Errorf("%s: tshark IE ids %s, want the top-level IEs %s in order", v.name, cols[2], strings.Join(ids, ",")) + } + } +} diff --git a/ngap/ie_pws.go b/ngap/ie_pws.go index 3c4c9405d1..4ffeab7ab0 100644 --- a/ngap/ie_pws.go +++ b/ngap/ie_pws.go @@ -63,7 +63,6 @@ func (c *EUTRACellIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -// TS 38.413 §9.3.1.7. type NRCGI struct { _ [0]struct{} `per:"extseq"` PLMNIdentity PLMNIdentity @@ -71,7 +70,6 @@ type NRCGI struct { _ ieExtensions `per:",skip"` } -// TS 38.413 §9.3.1.9. type EUTRACGI struct { _ [0]struct{} `per:"extseq"` PLMNIdentity PLMNIdentity @@ -79,7 +77,6 @@ type EUTRACGI struct { _ ieExtensions `per:",skip"` } -// TS 38.413 §9.3.1.35. type MessageIdentifier uint16 func (m MessageIdentifier) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -97,7 +94,6 @@ func (m *MessageIdentifier) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -// TS 38.413 §9.3.1.36. type SerialNumber uint16 func (s SerialNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -115,7 +111,6 @@ func (s *SerialNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -// TS 38.413 §9.3.1.49. type RepetitionPeriod uint32 func (p RepetitionPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -133,7 +128,6 @@ func (p *RepetitionPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -// TS 38.413 §9.3.1.38. type NumberOfBroadcastsRequested uint16 func (n NumberOfBroadcastsRequested) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -151,7 +145,6 @@ func (n *NumberOfBroadcastsRequested) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -// TS 38.413 §9.3.1.39. type WarningType [2]byte func (t WarningType) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -186,7 +179,6 @@ func (s *WarningSecurityInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -// TS 38.413 §9.3.1.41. type DataCodingScheme uint8 func (d DataCodingScheme) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -204,7 +196,6 @@ func (d *DataCodingScheme) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -// TS 38.413 §9.3.1.42. type WarningMessageContents []byte func (c WarningMessageContents) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -222,7 +213,6 @@ func (c *WarningMessageContents) UnmarshalPER(r *per.Reader, enc per.Encoding) e return nil } -// TS 38.413 §9.3.1.112. type WarningAreaCoordinates []byte func (c WarningAreaCoordinates) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -240,7 +230,6 @@ func (c *WarningAreaCoordinates) UnmarshalPER(r *per.Reader, enc per.Encoding) e return nil } -// TS 38.413 §9.3.1.46. type ConcurrentWarningMessageInd uint8 const ( @@ -264,7 +253,6 @@ func (c *ConcurrentWarningMessageInd) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -// TS 38.413 §9.3.1.48. type EmergencyAreaID [3]byte func (e EmergencyAreaID) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -314,7 +302,6 @@ const ( warningAreaListAlternatives = 5 ) -// TS 38.413 §9.3.1.37. type WarningAreaList struct { EUTRACGIs []EUTRACGI NRCGIs []NRCGI @@ -450,7 +437,6 @@ const ( broadcastAreaAlternatives = 7 ) -// TS 38.413 §9.3.1.43. type BroadcastCompletedAreaList struct { CellIDBroadcastEUTRA []CellIDBroadcastEUTRAItem TAIBroadcastEUTRA []TAIBroadcastEUTRAItem @@ -522,7 +508,6 @@ func (l *BroadcastCompletedAreaList) UnmarshalPER(r *per.Reader, enc per.Encodin return nil } -// TS 38.413 §9.3.1.47. type CancelAllWarningMessages uint8 const ( @@ -616,7 +601,6 @@ type EmergencyAreaIDCancelledNRItem struct { _ ieExtensions `per:",skip"` } -// TS 38.413 §9.3.1.44. type BroadcastCancelledAreaList struct { CellIDCancelledEUTRA []CellIDCancelledEUTRAItem TAICancelledEUTRA []TAICancelledEUTRAItem diff --git a/ngap/overload.go b/ngap/overload.go index 0ba94da250..0ae1a78ffa 100644 --- a/ngap/overload.go +++ b/ngap/overload.go @@ -9,7 +9,6 @@ import ( "github.com/ellanetworks/core/per" ) -// TS 38.413 §9.3.1.105. type OverloadAction uint8 const ( @@ -43,7 +42,6 @@ const ( overloadResponseAlternatives = 2 ) -// TS 38.413 §9.3.1.104. type OverloadResponse struct { OverloadAction OverloadAction } @@ -74,7 +72,6 @@ const ( trafficLoadReductionMax = 99 ) -// TS 38.413 §9.3.1.106. type TrafficLoadReductionIndication uint8 func (t TrafficLoadReductionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -123,7 +120,6 @@ func (l *OverloadStartNSSAIList) UnmarshalPER(r *per.Reader, enc per.Encoding) e return nil } -// TS 38.413 §9.2.6.14. type OverloadStart struct { AMFOverloadResponse *OverloadResponse AMFTrafficLoadReductionIndication *TrafficLoadReductionIndication @@ -214,7 +210,6 @@ func ParseOverloadStart(value []byte) (*OverloadStart, error) { return parseMessageBody[OverloadStart](ProcOverloadStart, TriggeringInitiatingMessage, overloadStartIEs, value) } -// TS 38.413 §9.2.6.15. type OverloadStop struct { messageMeta } diff --git a/ngap/pws.go b/ngap/pws.go index d43f2760c2..17091ffe1a 100644 --- a/ngap/pws.go +++ b/ngap/pws.go @@ -5,7 +5,6 @@ package ngap import "github.com/ellanetworks/core/per" -// TS 38.413 §9.2.8.1. type WriteReplaceWarningRequest struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -208,7 +207,6 @@ func ParseWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, return parseMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, TriggeringInitiatingMessage, writeReplaceWarningRequestIEs, value) } -// TS 38.413 §9.2.8.2. type WriteReplaceWarningResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -301,7 +299,6 @@ func ParseWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningRespons return parseMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, TriggeringSuccessfulOutcome, writeReplaceWarningResponseIEs, value) } -// TS 38.413 §9.2.8.3. type PWSCancelRequest struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -394,7 +391,6 @@ func ParsePWSCancelRequest(value []byte) (*PWSCancelRequest, error) { return parseMessageBody[PWSCancelRequest](ProcPWSCancel, TriggeringInitiatingMessage, pWSCancelRequestIEs, value) } -// TS 38.413 §9.2.8.4. type PWSCancelResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -487,7 +483,6 @@ func ParsePWSCancelResponse(value []byte) (*PWSCancelResponse, error) { return parseMessageBody[PWSCancelResponse](ProcPWSCancel, TriggeringSuccessfulOutcome, pWSCancelResponseIEs, value) } -// TS 38.413 §9.2.8.5. type PWSRestartIndication struct { CellIDListForRestart CellIDListForRestart GlobalRANNodeID GlobalRANNodeID @@ -558,7 +553,6 @@ func ParsePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { return parseMessageBody[PWSRestartIndication](ProcPWSRestartIndication, TriggeringInitiatingMessage, pWSRestartIndicationIEs, value) } -// TS 38.413 §9.2.8.6. type PWSFailureIndication struct { PWSFailedCellIDList PWSFailedCellIDList GlobalRANNodeID GlobalRANNodeID diff --git a/ngap/raw_pdu_test.go b/ngap/raw_pdu_test.go index 3104ddf396..94f9ec98dc 100644 --- a/ngap/raw_pdu_test.go +++ b/ngap/raw_pdu_test.go @@ -430,7 +430,7 @@ func TestRawPDUSpliceLocality(t *testing.T) { } } -func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { +func tsharkFields(t *testing.T, tshark, text2pcap, dump string, fields ...string) [][]string { t.Helper() pcap := exec.CommandContext(t.Context(), text2pcap, "-q", "-S", "38412,38412,60", "-", "-") @@ -441,8 +441,12 @@ func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { t.Fatalf("text2pcap: %v", err) } - cmd := exec.CommandContext(t.Context(), tshark, "-r", "-", "-T", "fields", "-E", "separator=|", "-E", "occurrence=a", "-E", "aggregator=,", - "-e", "frame.number", "-e", "ngap.AMF_UE_NGAP_ID", "-e", "ngap.RAN_UE_NGAP_ID", "-e", "_ws.malformed", "-e", "_ws.expert.severity") + args := []string{"-r", "-", "-T", "fields", "-E", "separator=|", "-E", "occurrence=a", "-E", "aggregator=,"} + for _, f := range fields { + args = append(args, "-e", f) + } + + cmd := exec.CommandContext(t.Context(), tshark, args...) cmd.Stdin = bytes.NewReader(pcapBytes) cmd.Env = append(os.Environ(), "HOME="+t.TempDir()) @@ -460,7 +464,7 @@ func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { for line := range strings.SplitSeq(strings.TrimRight(string(res), "\n"), "\n") { cols := strings.Split(line, "|") - if len(cols) != 5 { + if len(cols) != len(fields) { t.Fatalf("unexpected tshark output %q", line) } @@ -529,8 +533,8 @@ func TestRawPDUTshark(t *testing.T) { expects = append(expects, e) } - orig := tsharkFields(t, tshark, text2pcap, origDump.String()) - spliced := tsharkFields(t, tshark, text2pcap, splicedDump.String()) + orig := tsharkFields(t, tshark, text2pcap, origDump.String(), "frame.number", "ngap.AMF_UE_NGAP_ID", "ngap.RAN_UE_NGAP_ID", "_ws.malformed", "_ws.expert.severity") + spliced := tsharkFields(t, tshark, text2pcap, splicedDump.String(), "frame.number", "ngap.AMF_UE_NGAP_ID", "ngap.RAN_UE_NGAP_ID", "_ws.malformed", "_ws.expert.severity") if len(orig) != len(expects) || len(spliced) != len(expects) { t.Fatalf("tshark decoded %d/%d frames, want %d", len(orig), len(spliced), len(expects)) diff --git a/ngap/raw_pdu_ue_ids_test.go b/ngap/raw_pdu_ue_ids_test.go new file mode 100644 index 0000000000..b59b0967f5 --- /dev/null +++ b/ngap/raw_pdu_ue_ids_test.go @@ -0,0 +1,85 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "testing" + + "github.com/ellanetworks/core/per" +) + +func handUEContextReleaseCommand(t *testing.T, ran uint32) []byte { + t.Helper() + + enc := per.Aligned + + ids := per.NewWriter() + mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 0, ueNGAPIDsAlternatives-1, ueNGAPIDsPair)) + ids.WriteBit(true) + ids.WriteBit(true) + mustNil(t, AMFUENGAPID(7).MarshalPER(ids, enc)) + mustNil(t, RANUENGAPID(ran).MarshalPER(ids, enc)) + mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 1, maxProtocolExtensions, 1)) + mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 0, maxProtocolIEs, 999)) + mustNil(t, per.EncodeEnumerated(ids, enc, criticalityRootCount, false, int64(CriticalityIgnore))) + mustNil(t, per.EncodeOpenTypeBytes(ids, enc, []byte{0xab, 0xcd})) + mustNil(t, per.EncodeNormallySmallLength(ids, enc, 2, func(int64) error { + ids.WriteBit(false) + ids.WriteBit(true) + + return nil + })) + mustNil(t, per.EncodeOpenTypeBytes(ids, enc, []byte{0x11, 0x22})) + + cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + mustNil(t, err) + + body := per.NewWriter() + body.WriteBit(false) + mustNil(t, encodeIEContainer(body, enc, []ieField{ + {id: IDUENGAPIDs, crit: CriticalityReject, raw: ids.Bytes()}, + {id: IDCause, crit: CriticalityIgnore, raw: cause}, + })) + + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUEContextRelease, Criticality: CriticalityReject, Value: body.Bytes()}) + mustNil(t, err) + + return b +} + +func TestRawPDUUENGAPIDsKeepPairExtensions(t *testing.T) { + in := handUEContextReleaseCommand(t, 1) + + p, err := ParseRawPDU(in) + mustNil(t, err) + + ids, ok, err := p.UENGAPIDs() + if err != nil || !ok { + t.Fatalf("UENGAPIDs() = %v, %v", ok, err) + } + + if !ids.Pair || ids.AMFUENGAPID != 7 || ids.RANUENGAPID != 1 { + t.Fatalf("UENGAPIDs() = %+v", ids) + } + + mustNil(t, p.SetUENGAPIDs(ids)) + + got, err := p.Marshal() + mustNil(t, err) + + if !bytes.Equal(got, in) { + t.Fatalf("unchanged set:\n got %x\nwant %x", got, in) + } + + ids.RANUENGAPID = 9 + mustNil(t, p.SetUENGAPIDs(ids)) + + got, err = p.Marshal() + mustNil(t, err) + + if want := handUEContextReleaseCommand(t, 9); !bytes.Equal(got, want) { + t.Fatalf("changed set:\n got %x\nwant %x", got, want) + } +} diff --git a/ngap/reroute_nas.go b/ngap/reroute_nas.go index 5a6f2f9c6e..f894bb1311 100644 --- a/ngap/reroute_nas.go +++ b/ngap/reroute_nas.go @@ -80,7 +80,6 @@ func (n *RejectedNSSAIinTA) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -// TS 38.413 §9.3.3.27. type SourceToTargetAMFInformationReroute struct { _ [0]struct{} `per:"extseq"` ConfiguredNSSAI *ConfiguredNSSAI `per:",optional"` @@ -95,7 +94,6 @@ type PartiallyAllowedNSSAIItem struct { _ ieExtensions `per:",skip"` } -// TS 38.413 §9.3.1.261. type PartiallyAllowedNSSAI []PartiallyAllowedNSSAIItem func (p PartiallyAllowedNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -113,7 +111,6 @@ func (p *PartiallyAllowedNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -// TS 38.413 §9.2.5.5. type RerouteNASRequest struct { RANUENGAPID RANUENGAPID AMFUENGAPID *AMFUENGAPID diff --git a/ngap/ue_context_release.go b/ngap/ue_context_release.go index 999aed7d23..db79609d3a 100644 --- a/ngap/ue_context_release.go +++ b/ngap/ue_context_release.go @@ -24,6 +24,9 @@ type UENGAPIDs struct { AMFUENGAPID AMFUENGAPID RANUENGAPID RANUENGAPID Pair bool + + pairIEExtensions *rawIEExtensions + pairExtensions per.ExtensionAdditions } func (u UENGAPIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -41,14 +44,24 @@ func (u UENGAPIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { // UE-NGAP-ID-pair ::= SEQUENCE { aMF-UE-NGAP-ID, rAN-UE-NGAP-ID, // iE-Extensions OPTIONAL } (extensible). - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(u.pairExtensions.Present()) + w.WriteBit(u.pairIEExtensions != nil) if err := u.AMFUENGAPID.MarshalPER(w, enc); err != nil { return err } - return u.RANUENGAPID.MarshalPER(w, enc) + if err := u.RANUENGAPID.MarshalPER(w, enc); err != nil { + return err + } + + if u.pairIEExtensions != nil { + if err := u.pairIEExtensions.MarshalPER(w, enc); err != nil { + return err + } + } + + return u.pairExtensions.MarshalPER(w, enc) } func (u *UENGAPIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { @@ -79,11 +92,24 @@ func (u *UENGAPIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err + var ieExt *rawIEExtensions + + if extContainer { + ieExt = &rawIEExtensions{} + if err := ieExt.UnmarshalPER(r, enc); err != nil { + return err + } + } + + var ext per.ExtensionAdditions + + if extBit { + if err := ext.UnmarshalPER(r, enc); err != nil { + return err + } } - *u = UENGAPIDs{AMFUENGAPID: amf, RANUENGAPID: ran, Pair: true} + *u = UENGAPIDs{AMFUENGAPID: amf, RANUENGAPID: ran, Pair: true, pairIEExtensions: ieExt, pairExtensions: ext} return nil case ueNGAPIDsChoiceExtensions: diff --git a/per/extension_test.go b/per/extension_test.go index 41878a8eca..22249e8d17 100644 --- a/per/extension_test.go +++ b/per/extension_test.go @@ -125,3 +125,12 @@ func TestReaderSince(t *testing.T) { t.Fatal("start past the reader accepted") } } + +func TestExtensionAdditionsRejectsZeroLengthBitmap(t *testing.T) { + for _, enc := range []Encoding{Aligned, Unaligned} { + var e ExtensionAdditions + if err := e.UnmarshalPER(NewReader([]byte{0x80, 0x00}), enc); err == nil { + t.Fatalf("%s: zero-length extension bitmap accepted", enc) + } + } +} diff --git a/per/opentype.go b/per/opentype.go index c6d4637e87..c9b9121b61 100644 --- a/per/opentype.go +++ b/per/opentype.go @@ -127,5 +127,19 @@ func DecodeNormallySmallLength(r *Reader, enc Encoding, consume func(count int64 return consume(n) } - return decodeUnconstrainedLengthFrag(r, enc, consume) + var total int64 + + err = decodeUnconstrainedLengthFrag(r, enc, func(count int64) error { + total += count + return consume(count) + }) + if err != nil { + return err + } + + if total == 0 { + return ErrOverflow + } + + return nil } diff --git a/per/opentype_test.go b/per/opentype_test.go index eb900a8350..ffbae5191a 100644 --- a/per/opentype_test.go +++ b/per/opentype_test.go @@ -5,6 +5,7 @@ package per import ( "bytes" + "errors" "testing" ) @@ -211,3 +212,21 @@ func TestDecodeNormallySmallLengthFragments(t *testing.T) { t.Fatalf("second fragment = %v, want [false true false]", got) } } + +func TestNormallySmallLengthRejectsZero(t *testing.T) { + t.Parallel() + + for _, enc := range []Encoding{Aligned, Unaligned} { + r := NewReader([]byte{0x80, 0x00}) + + called := false + + err := DecodeNormallySmallLength(r, enc, func(int64) error { + called = true + return nil + }) + if !errors.Is(err, ErrOverflow) || called { + t.Fatalf("%s: err=%v called=%v, want ErrOverflow and no consume", enc, err, called) + } + } +} diff --git a/per/protocolie/protocolie.go b/per/protocolie/protocolie.go index 98ad3cc986..12b8da95ac 100644 --- a/per/protocolie/protocolie.go +++ b/per/protocolie/protocolie.go @@ -67,6 +67,7 @@ type Message struct { } func Parse(b []byte, opaque func(procedureCode uint8) bool) (*Message, error) { + b = bytes.Clone(b) r := per.NewReader(b) enc := per.Aligned diff --git a/per/protocolie/protocolie_test.go b/per/protocolie/protocolie_test.go index 152d3c4d57..09d9779e8a 100644 --- a/per/protocolie/protocolie_test.go +++ b/per/protocolie/protocolie_test.go @@ -119,6 +119,38 @@ func TestParseHeaderAndFields(t *testing.T) { } } +func TestParseIndependentOfInput(t *testing.T) { + fields := []Field{ + {ID: 0, Criticality: 0, Value: []byte{0x00, 0x01}}, + {ID: 8, Criticality: 0, Value: []byte{0x00, 0x07}}, + {ID: 26, Criticality: 1, Value: []byte{0x01, 0x07}}, + } + b := encodePDU(t, 1, 11, 1, encodeBody(t, fields)) + orig := bytes.Clone(b) + + unmodified := mustParse(t, b) + modified := mustParse(t, b) + + if err := modified.SetValue(1, []byte{0x00, 0x09}); err != nil { + t.Fatal(err) + } + + for i := range b { + b[i] = 0xff + } + + if got := mustBytes(t, unmodified); !bytes.Equal(got, orig) { + t.Fatalf("unmodified re-emit = % x, want % x", got, orig) + } + + fields[1].Value = []byte{0x00, 0x09} + + want := encodePDU(t, 1, 11, 1, encodeBody(t, fields)) + if got := mustBytes(t, modified); !bytes.Equal(got, want) { + t.Fatalf("modified re-emit = % x, want % x", got, want) + } +} + func TestEmptyContainer(t *testing.T) { b := encodePDU(t, 0, 14, 0, encodeBody(t, nil)) m := mustParse(t, b) diff --git a/s1ap/golden_tshark_test.go b/s1ap/golden_tshark_test.go new file mode 100644 index 0000000000..caca14bbe3 --- /dev/null +++ b/s1ap/golden_tshark_test.go @@ -0,0 +1,101 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + "os/exec" + "strconv" + "strings" + "testing" +) + +type tsharkVector struct { + name string + b []byte + extensionNotices int +} + +func goldenTsharkVectors(t *testing.T) []tsharkVector { + t.Helper() + + var out []tsharkVector + + for _, c := range newMessageCases() { + if c.golden == "" { + continue + } + + b, err := hex.DecodeString(c.golden) + mustNil(t, err) + + out = append(out, tsharkVector{name: c.name, b: b}) + } + + return append(out, + tsharkVector{"Reset", handReset(t, resetFixtures(5)), 4}, + tsharkVector{"ResetLargeMMEUES1APID", handReset(t, resetFixtures(0x10000000)), 4}, + tsharkVector{"ResetAcknowledge", handResetAck(t, resetFixtures(70000)), 4}, + tsharkVector{"UEContextReleaseCommandPairExtensions", handUEContextReleaseCommand(t, 1), 1}, + ) +} + +func isSubsequence(want, got []string) bool { + i := 0 + + for _, g := range got { + if i < len(want) && g == want[i] { + i++ + } + } + + return i == len(want) +} + +func TestGoldenVectorsTshark(t *testing.T) { + tshark, err1 := exec.LookPath("tshark") + text2pcap, err2 := exec.LookPath("text2pcap") + + if err1 != nil || err2 != nil { + t.Skip("tshark/text2pcap not installed") + } + + vectors := goldenTsharkVectors(t) + + var dump strings.Builder + for _, v := range vectors { + hexDump(&dump, v.b) + } + + rows := tsharkFields(t, tshark, text2pcap, dump.String(), "frame.number", "s1ap.procedureCode", "s1ap.id", "_ws.malformed", "_ws.expert.message") + if len(rows) != len(vectors) { + t.Fatalf("tshark decoded %d frames, want %d", len(rows), len(vectors)) + } + + for i, v := range vectors { + cols := rows[i] + + p, err := ParseRawPDU(v.b) + if err != nil { + t.Fatalf("%s: %v", v.name, err) + } + + if cols[3] != "" || cols[4] != strings.TrimSuffix(strings.Repeat("unknown sequence extension,", v.extensionNotices), ",") { + t.Errorf("%s: tshark reports %q, want %d unknown sequence extension notes", v.name, strings.Join(cols[3:], "|"), v.extensionNotices) + } + + if pc := strings.Split(cols[1], ",")[0]; pc != strconv.Itoa(int(p.ProcedureCode())) { + t.Errorf("%s: tshark procedureCode %s, want %d", v.name, pc, p.ProcedureCode()) + } + + var ids []string + for _, ie := range p.IEs() { + ids = append(ids, strconv.Itoa(int(ie.ID))) + } + + if !isSubsequence(ids, strings.Split(cols[2], ",")) { + t.Errorf("%s: tshark IE ids %s, want the top-level IEs %s in order", v.name, cols[2], strings.Join(ids, ",")) + } + } +} diff --git a/s1ap/overload.go b/s1ap/overload.go index c46d6739df..01d16d7a67 100644 --- a/s1ap/overload.go +++ b/s1ap/overload.go @@ -78,7 +78,6 @@ func gUMMEIListIE(l []GUMMEI) (per.Marshaler, bool) { }), true } -// TS 36.413 §9.1.8.13. type OverloadStart struct { OverloadResponse OverloadResponse GUMMEIList []GUMMEI @@ -145,7 +144,6 @@ func ParseOverloadStart(value []byte) (*OverloadStart, error) { return parseMessageBody[OverloadStart](ProcOverloadStart, TriggeringInitiatingMessage, overloadStartIEs, value) } -// TS 36.413 §9.1.8.14. type OverloadStop struct { GUMMEIList []GUMMEI diff --git a/s1ap/pws.go b/s1ap/pws.go index 2f002cb121..8532e82483 100644 --- a/s1ap/pws.go +++ b/s1ap/pws.go @@ -50,7 +50,6 @@ func integerIE(b per.Bounds, v int64) per.Marshaler { }) } -// TS 36.413 §9.1.13.1. type WriteReplaceWarningRequest struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -201,7 +200,6 @@ func ParseWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, return parseMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, TriggeringInitiatingMessage, writeReplaceWarningRequestIEs, value) } -// TS 36.413 §9.1.13.2. type WriteReplaceWarningResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -270,7 +268,6 @@ func ParseWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningRespons return parseMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, TriggeringSuccessfulOutcome, writeReplaceWarningResponseIEs, value) } -// TS 36.413 §9.1.13.3. type KillRequest struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -335,7 +332,6 @@ func ParseKillRequest(value []byte) (*KillRequest, error) { return parseMessageBody[KillRequest](ProcKill, TriggeringInitiatingMessage, killRequestIEs, value) } -// TS 36.413 §9.1.13.4. type KillResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -400,7 +396,6 @@ func ParseKillResponse(value []byte) (*KillResponse, error) { return parseMessageBody[KillResponse](ProcKill, TriggeringSuccessfulOutcome, killResponseIEs, value) } -// TS 36.413 §9.1.13.5. type PWSRestartIndication struct { ECGIListForRestart []EUTRANCGI GlobalENBID GlobalENBID @@ -501,7 +496,6 @@ func ParsePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { return parseMessageBody[PWSRestartIndication](ProcPWSRestartIndication, TriggeringInitiatingMessage, pWSRestartIndicationIEs, value) } -// TS 36.413 §9.1.13.6. type PWSFailureIndication struct { PWSFailedECGIList []EUTRANCGI GlobalENBID GlobalENBID diff --git a/s1ap/pws_overload_test.go b/s1ap/pws_overload_test.go index 6b00b449fa..c7442a28ee 100644 --- a/s1ap/pws_overload_test.go +++ b/s1ap/pws_overload_test.go @@ -228,6 +228,16 @@ func newMessageCases() []newMessageCase { choice: isInitiating, golden: "0034005d00000600080002000100004002000200e100302f000c402b000005000800020001001a000302074a004300060000f1100001006440080000f11012345010008640013000df0002800200e0400b0000f110800101deadbeef00e6400180", }, + { + name: "RerouteNASRequestEmptyS1Message", + msg: &RerouteNASRequest{ + ENBUES1APID: 1, + S1Message: S1Message{}, + MMEGroupID: MMEGroupID{0x80, 0x02}, + }, + parse: func(b []byte) (any, error) { return ParseRerouteNASRequest(b) }, + choice: isInitiating, + }, } } diff --git a/s1ap/raw_pdu_test.go b/s1ap/raw_pdu_test.go index 032af24602..5513302444 100644 --- a/s1ap/raw_pdu_test.go +++ b/s1ap/raw_pdu_test.go @@ -430,7 +430,7 @@ func TestRawPDUSpliceLocality(t *testing.T) { } } -func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { +func tsharkFields(t *testing.T, tshark, text2pcap, dump string, fields ...string) [][]string { t.Helper() pcap := exec.CommandContext(t.Context(), text2pcap, "-q", "-S", "36412,36412,18", "-", "-") @@ -441,8 +441,12 @@ func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { t.Fatalf("text2pcap: %v", err) } - cmd := exec.CommandContext(t.Context(), tshark, "-r", "-", "-T", "fields", "-E", "separator=|", "-E", "occurrence=a", "-E", "aggregator=,", - "-e", "frame.number", "-e", "s1ap.MME_UE_S1AP_ID", "-e", "s1ap.ENB_UE_S1AP_ID", "-e", "_ws.malformed", "-e", "_ws.expert.severity") + args := []string{"-r", "-", "-T", "fields", "-E", "separator=|", "-E", "occurrence=a", "-E", "aggregator=,"} + for _, f := range fields { + args = append(args, "-e", f) + } + + cmd := exec.CommandContext(t.Context(), tshark, args...) cmd.Stdin = bytes.NewReader(pcapBytes) cmd.Env = append(os.Environ(), "HOME="+t.TempDir()) @@ -460,7 +464,7 @@ func tsharkFields(t *testing.T, tshark, text2pcap, dump string) [][]string { for line := range strings.SplitSeq(strings.TrimRight(string(res), "\n"), "\n") { cols := strings.Split(line, "|") - if len(cols) != 5 { + if len(cols) != len(fields) { t.Fatalf("unexpected tshark output %q", line) } @@ -529,8 +533,8 @@ func TestRawPDUTshark(t *testing.T) { expects = append(expects, e) } - orig := tsharkFields(t, tshark, text2pcap, origDump.String()) - spliced := tsharkFields(t, tshark, text2pcap, splicedDump.String()) + orig := tsharkFields(t, tshark, text2pcap, origDump.String(), "frame.number", "s1ap.MME_UE_S1AP_ID", "s1ap.ENB_UE_S1AP_ID", "_ws.malformed", "_ws.expert.severity") + spliced := tsharkFields(t, tshark, text2pcap, splicedDump.String(), "frame.number", "s1ap.MME_UE_S1AP_ID", "s1ap.ENB_UE_S1AP_ID", "_ws.malformed", "_ws.expert.severity") if len(orig) != len(expects) || len(spliced) != len(expects) { t.Fatalf("tshark decoded %d/%d frames, want %d", len(orig), len(spliced), len(expects)) diff --git a/s1ap/raw_pdu_ue_ids_test.go b/s1ap/raw_pdu_ue_ids_test.go new file mode 100644 index 0000000000..91a28cc9ec --- /dev/null +++ b/s1ap/raw_pdu_ue_ids_test.go @@ -0,0 +1,86 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "testing" + + "github.com/ellanetworks/core/per" +) + +func handUEContextReleaseCommand(t *testing.T, enb uint32) []byte { + t.Helper() + + enc := per.Aligned + + ids := per.NewWriter() + ids.WriteBit(false) + mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 0, ues1apIDsChoiceRootCount-1, ues1apIDsPair)) + ids.WriteBit(true) + ids.WriteBit(true) + mustNil(t, MMEUES1APID(7).MarshalPER(ids, enc)) + mustNil(t, ENBUES1APID(enb).MarshalPER(ids, enc)) + mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 1, maxProtocolExtensions, 1)) + mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 0, maxProtocolIEs, 999)) + mustNil(t, per.EncodeEnumerated(ids, enc, criticalityRootCount, false, int64(CriticalityIgnore))) + mustNil(t, per.EncodeOpenTypeBytes(ids, enc, []byte{0xab, 0xcd})) + mustNil(t, per.EncodeNormallySmallLength(ids, enc, 2, func(int64) error { + ids.WriteBit(false) + ids.WriteBit(true) + + return nil + })) + mustNil(t, per.EncodeOpenTypeBytes(ids, enc, []byte{0x11, 0x22})) + + cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + mustNil(t, err) + + body := per.NewWriter() + body.WriteBit(false) + mustNil(t, encodeIEContainer(body, enc, []ieField{ + {id: IDUES1APIDs, crit: CriticalityReject, raw: ids.Bytes()}, + {id: IDCause, crit: CriticalityIgnore, raw: cause}, + })) + + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUEContextRelease, Criticality: CriticalityReject, Value: body.Bytes()}) + mustNil(t, err) + + return b +} + +func TestRawPDUUES1APIDsKeepPairExtensions(t *testing.T) { + in := handUEContextReleaseCommand(t, 1) + + p, err := ParseRawPDU(in) + mustNil(t, err) + + ids, ok, err := p.UES1APIDs() + if err != nil || !ok { + t.Fatalf("UES1APIDs() = %v, %v", ok, err) + } + + if !ids.Pair || ids.MMEUES1APID != 7 || ids.ENBUES1APID != 1 { + t.Fatalf("UES1APIDs() = %+v", ids) + } + + mustNil(t, p.SetUES1APIDs(ids)) + + got, err := p.Marshal() + mustNil(t, err) + + if !bytes.Equal(got, in) { + t.Fatalf("unchanged set:\n got %x\nwant %x", got, in) + } + + ids.ENBUES1APID = 9 + mustNil(t, p.SetUES1APIDs(ids)) + + got, err = p.Marshal() + mustNil(t, err) + + if want := handUEContextReleaseCommand(t, 9); !bytes.Equal(got, want) { + t.Fatalf("changed set:\n got %x\nwant %x", got, want) + } +} diff --git a/s1ap/reroute_nas.go b/s1ap/reroute_nas.go index 6de3a0dd35..9c2aa565bb 100644 --- a/s1ap/reroute_nas.go +++ b/s1ap/reroute_nas.go @@ -21,7 +21,7 @@ func (s *S1Message) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } - *s = b + *s = append(S1Message{}, b...) return nil } @@ -33,7 +33,6 @@ type AdditionalGUTI struct { _ ieExtensions `per:",skip"` } -// TS 36.413 §9.1.7.5. type RerouteNASRequest struct { ENBUES1APID ENBUES1APID MMEUES1APID *MMEUES1APID diff --git a/s1ap/ue_context_release.go b/s1ap/ue_context_release.go index 3725b5763d..b4a9ad6018 100644 --- a/s1ap/ue_context_release.go +++ b/s1ap/ue_context_release.go @@ -25,6 +25,9 @@ type UES1APIDs struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID Pair bool + + pairIEExtensions *rawIEExtensions + pairExtensions per.ExtensionAdditions } func (u UES1APIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -44,14 +47,24 @@ func (u UES1APIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { // UE-S1AP-ID-pair ::= SEQUENCE { mME-UE-S1AP-ID, eNB-UE-S1AP-ID, // iE-Extensions OPTIONAL } (extensible). - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(u.pairExtensions.Present()) + w.WriteBit(u.pairIEExtensions != nil) if err := u.MMEUES1APID.MarshalPER(w, enc); err != nil { return err } - return u.ENBUES1APID.MarshalPER(w, enc) + if err := u.ENBUES1APID.MarshalPER(w, enc); err != nil { + return err + } + + if u.pairIEExtensions != nil { + if err := u.pairIEExtensions.MarshalPER(w, enc); err != nil { + return err + } + } + + return u.pairExtensions.MarshalPER(w, enc) } func (u *UES1APIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { @@ -93,11 +106,24 @@ func (u *UES1APIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err + var ieExt *rawIEExtensions + + if extContainer { + ieExt = &rawIEExtensions{} + if err := ieExt.UnmarshalPER(r, enc); err != nil { + return err + } + } + + var ext per.ExtensionAdditions + + if extBit { + if err := ext.UnmarshalPER(r, enc); err != nil { + return err + } } - *u = UES1APIDs{MMEUES1APID: mme, ENBUES1APID: enb, Pair: true} + *u = UES1APIDs{MMEUES1APID: mme, ENBUES1APID: enb, Pair: true, pairIEExtensions: ieExt, pairExtensions: ext} return nil default: From 80e97c8e6e4b599841ac0bd9151e85724ee5a7cb Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Fri, 13 Nov 2026 10:23:29 -0500 Subject: [PATCH 03/16] fix: license Signed-off-by: Guillaume Belanger --- REUSE.toml | 8 -------- ngap/raw_pdu_test.go | 8 ++++---- ngap/testdata/captures/{open5gs.txt => corpus.txt} | 0 s1ap/raw_pdu_test.go | 8 ++++---- s1ap/testdata/captures/{open5gs.txt => corpus.txt} | 0 5 files changed, 8 insertions(+), 16 deletions(-) rename ngap/testdata/captures/{open5gs.txt => corpus.txt} (100%) rename s1ap/testdata/captures/{open5gs.txt => corpus.txt} (100%) diff --git a/REUSE.toml b/REUSE.toml index bb9efb33cb..92feab3b5b 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -99,14 +99,6 @@ precedence = "aggregate" SPDX-FileCopyrightText = "Ella Networks Inc." SPDX-License-Identifier = "Apache-2.0" -# S1AP and NGAP PDUs extracted with tshark from the pcapng files in the -# Open5GS repository (docs/assets/pcapng, commit 39a8c771f6d5). -[[annotations]] -path = ["s1ap/testdata/captures/open5gs.txt", "ngap/testdata/captures/open5gs.txt"] -precedence = "override" -SPDX-FileCopyrightText = "Open5GS contributors" -SPDX-License-Identifier = "AGPL-3.0-or-later" - # pergen generated code, not hand-edited [[annotations]] path = ["**/per_gen.go"] diff --git a/ngap/raw_pdu_test.go b/ngap/raw_pdu_test.go index 94f9ec98dc..132dd526c7 100644 --- a/ngap/raw_pdu_test.go +++ b/ngap/raw_pdu_test.go @@ -43,7 +43,7 @@ func loadCorpus(t testing.TB) []corpusPDU { var out []corpusPDU - f, err := os.Open(filepath.Join("testdata", "captures", "open5gs.txt")) + f, err := os.Open(filepath.Join("testdata", "captures", "corpus.txt")) if err != nil { t.Fatal(err) } @@ -61,10 +61,10 @@ func loadCorpus(t testing.TB) []corpusPDU { b, err := hex.DecodeString(line) if err != nil { - t.Fatalf("open5gs.txt:%d: %v", n, err) + t.Fatalf("corpus.txt:%d: %v", n, err) } - out = append(out, corpusPDU{source: fmt.Sprintf("open5gs.txt:%d", n), b: b}) + out = append(out, corpusPDU{source: fmt.Sprintf("corpus.txt:%d", n), b: b}) } if err := sc.Err(); err != nil { @@ -549,7 +549,7 @@ func TestRawPDUTshark(t *testing.T) { t.Errorf("frame %d (%s): splice changed tshark's verdict from %q to %q", i+1, e.source, strings.Join(orig[i][3:], "|"), strings.Join(cols[3:], "|")) } - if strings.HasPrefix(e.source, "open5gs") && (cols[3] != "" || strings.Contains(cols[4], "8388608")) { + if strings.HasPrefix(e.source, "corpus") && (cols[3] != "" || strings.Contains(cols[4], "8388608")) { t.Errorf("frame %d (%s): tshark reports an error: %q", i+1, e.source, strings.Join(cols, "|")) } diff --git a/ngap/testdata/captures/open5gs.txt b/ngap/testdata/captures/corpus.txt similarity index 100% rename from ngap/testdata/captures/open5gs.txt rename to ngap/testdata/captures/corpus.txt diff --git a/s1ap/raw_pdu_test.go b/s1ap/raw_pdu_test.go index 5513302444..b82bb3de22 100644 --- a/s1ap/raw_pdu_test.go +++ b/s1ap/raw_pdu_test.go @@ -43,7 +43,7 @@ func loadCorpus(t testing.TB) []corpusPDU { var out []corpusPDU - f, err := os.Open(filepath.Join("testdata", "captures", "open5gs.txt")) + f, err := os.Open(filepath.Join("testdata", "captures", "corpus.txt")) if err != nil { t.Fatal(err) } @@ -61,10 +61,10 @@ func loadCorpus(t testing.TB) []corpusPDU { b, err := hex.DecodeString(line) if err != nil { - t.Fatalf("open5gs.txt:%d: %v", n, err) + t.Fatalf("corpus.txt:%d: %v", n, err) } - out = append(out, corpusPDU{source: fmt.Sprintf("open5gs.txt:%d", n), b: b}) + out = append(out, corpusPDU{source: fmt.Sprintf("corpus.txt:%d", n), b: b}) } if err := sc.Err(); err != nil { @@ -549,7 +549,7 @@ func TestRawPDUTshark(t *testing.T) { t.Errorf("frame %d (%s): splice changed tshark's verdict from %q to %q", i+1, e.source, strings.Join(orig[i][3:], "|"), strings.Join(cols[3:], "|")) } - if strings.HasPrefix(e.source, "open5gs") && (cols[3] != "" || strings.Contains(cols[4], "8388608")) { + if strings.HasPrefix(e.source, "corpus") && (cols[3] != "" || strings.Contains(cols[4], "8388608")) { t.Errorf("frame %d (%s): tshark reports an error: %q", i+1, e.source, strings.Join(cols, "|")) } diff --git a/s1ap/testdata/captures/open5gs.txt b/s1ap/testdata/captures/corpus.txt similarity index 100% rename from s1ap/testdata/captures/open5gs.txt rename to s1ap/testdata/captures/corpus.txt From 392cc3ef8e1addc2c0cd09c35a9d2c9fc97442cb Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Fri, 13 Nov 2026 15:42:09 -0500 Subject: [PATCH 04/16] chore: codec improvements Signed-off-by: Guillaume Belanger --- .../decoder/ngap/amf_configuration_update.go | 4 + .../ngap/initial_context_setup_request.go | 4 + internal/decoder/ngap/modeled_ies_test.go | 90 +++++++++++++++++++ internal/decoder/ngap/overload.go | 21 ++++- .../decoder/ngap/ue_context_modification.go | 4 + internal/decoder/ngap/ue_context_release.go | 4 + ngap/amf_config_update.go | 14 +++ ngap/amf_config_update_test.go | 59 +++++++++++- ngap/enum_encode_test.go | 1 + ngap/fuzz_test.go | 20 +++++ ngap/golden_tshark_test.go | 53 +++++++++++ ngap/ie_ids.go | 2 + ngap/ie_names.go | 2 + ngap/ie_ue.go | 23 +++++ ngap/initial_context_setup.go | 22 +++++ ngap/initial_context_setup_test.go | 31 +++++++ ngap/overload.go | 57 +++++++++++- ngap/per_gen.go | 54 +++++++++++ ngap/pws_overload_test.go | 39 ++++++++ ngap/table_order_test.go | 10 ++- ngap/ue_context_modification.go | 22 +++++ ngap/ue_context_modification_test.go | 30 +++++++ ngap/ue_context_release.go | 30 ++++++- ngap/ue_context_release_test.go | 45 ++++++++++ ngap/wire_criticality_test.go | 48 ++++++++++ ngap/zz_probe_test.go | 38 ++++++++ s1ap/cause.go | 2 + s1ap/cause_test.go | 41 +++++++++ s1ap/zz_probe_test.go | 38 ++++++++ 29 files changed, 797 insertions(+), 11 deletions(-) create mode 100644 internal/decoder/ngap/modeled_ies_test.go create mode 100644 ngap/zz_probe_test.go create mode 100644 s1ap/zz_probe_test.go diff --git a/internal/decoder/ngap/amf_configuration_update.go b/internal/decoder/ngap/amf_configuration_update.go index 5cb0aad0c6..e9f2d08e8d 100644 --- a/internal/decoder/ngap/amf_configuration_update.go +++ b/internal/decoder/ngap/amf_configuration_update.go @@ -29,6 +29,10 @@ func buildAMFConfigurationUpdate(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDRelativeAMFCapacity, ngap.CriticalityIgnore, *m.RelativeAMFCapacity)) } + if len(m.PLMNSupportList) > 0 { + ies = append(ies, ie(ngap.IDPLMNSupportList, ngap.CriticalityReject, buildPLMNSupportList(m.PLMNSupportList))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/initial_context_setup_request.go b/internal/decoder/ngap/initial_context_setup_request.go index 469492daa1..700a348ab5 100644 --- a/internal/decoder/ngap/initial_context_setup_request.go +++ b/internal/decoder/ngap/initial_context_setup_request.go @@ -181,6 +181,10 @@ func buildInitialContextSetupRequest(value []byte) NGAPMessageValue { ie(ngap.IDSecurityKey, ngap.CriticalityReject, hex.EncodeToString(m.SecurityKey[:])), ) + if m.TraceActivation != nil { + ies = append(ies, ie(ngap.IDTraceActivation, ngap.CriticalityIgnore, traceActivation(*m.TraceActivation))) + } + if m.NASPDU != nil { ies = append(ies, ie(ngap.IDNASPDU, ngap.CriticalityIgnore, libNASPDU(*m.NASPDU))) } diff --git a/internal/decoder/ngap/modeled_ies_test.go b/internal/decoder/ngap/modeled_ies_test.go new file mode 100644 index 0000000000..d9f98985b2 --- /dev/null +++ b/internal/decoder/ngap/modeled_ies_test.go @@ -0,0 +1,90 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "testing" + + lib "github.com/ellanetworks/core/ngap" +) + +func modeledIEsCorpus(t *testing.T) map[string][]byte { + t.Helper() + + guamis := lib.GUAMIList{ + {GUAMI: lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 0xca, AMFSetID: 0x3f8, AMFPointer: 0x01}}, + } + + var key lib.SecurityKey + + return map[string][]byte{ + "overload_start_guami_list": mustMarshal(t, &lib.OverloadStart{GUAMIList: guamis}), + "overload_stop_guami_list": mustMarshal(t, &lib.OverloadStop{GUAMIList: guamis}), + "amf_configuration_update_plmn_support_list": mustMarshal(t, &lib.AMFConfigurationUpdate{ + PLMNSupportList: lib.PLMNSupportList{{ + PLMNIdentity: testPLMN, + SliceSupportList: lib.SliceSupportList{{SNSSAI: lib.SNSSAI{SST: 1}}}, + }}, + }), + "initial_context_setup_request_trace_activation": mustMarshal(t, &lib.InitialContextSetupRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + GUAMI: guamis[0].GUAMI, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + SecurityKey: key, + TraceActivation: &lib.TraceActivation{ + NGRANTraceID: lib.NGRANTraceID{0x02, 0xf8, 0x39, 0x0a, 0x0b, 0x0c, 0x12, 0x34}, + InterfacesToTrace: lib.InterfaceToTraceNGC, + TraceDepth: lib.TraceDepthMinimum, + TraceCollectionEntityIPAddress: lib.TransportLayerAddress{10, 0, 0, 1}, + }, + }), + "ue_context_modification_request_new_amf_ue_ngap_id": mustMarshal(t, &lib.UEContextModificationRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + NewAMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(3)), + }), + "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &lib.UEContextReleaseRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: lib.CauseRadioNetworkUserInactivity}, + GWContextReleaseIndication: lib.Ptr(lib.GWContextReleaseIndicationTrue), + }), + } +} + +func TestDecodeNGAPMessage_ModeledIEs(t *testing.T) { + for name, raw := range modeledIEsCorpus(t) { + t.Run(name, func(t *testing.T) { + msg := DecodeNGAPMessage(raw) + + if msg.Value.Error != "" { + t.Fatalf("decode error: %s", msg.Value.Error) + } + + for _, e := range msg.Value.IEs { + if e.ID.Unknown { + t.Errorf("IE %d rendered as unknown", e.ID.Value) + } + + if _, raw := e.Value.(rawIEValue); raw { + t.Errorf("IE %s rendered as unmodeled", e.ID.Label) + } + } + }) + } +} + +func TestDecodeNGAPMessage_OverloadStopGUAMIList(t *testing.T) { + msg := DecodeNGAPMessage(modeledIEsCorpus(t)["overload_stop_guami_list"]) + + if len(msg.Value.IEs) != 1 || msg.Value.IEs[0].ID.Value != int64(lib.IDGUAMIList) { + t.Fatalf("IEs = %+v, want the GUAMI List alone", msg.Value.IEs) + } + + list, ok := msg.Value.IEs[0].Value.([]Guami) + if !ok || len(list) != 1 || list[0].AMFRegionID == "" { + t.Fatalf("GUAMI List = %+v", msg.Value.IEs[0].Value) + } +} diff --git a/internal/decoder/ngap/overload.go b/internal/decoder/ngap/overload.go index 6ecd52ff86..88ed5c7cb6 100644 --- a/internal/decoder/ngap/overload.go +++ b/internal/decoder/ngap/overload.go @@ -47,6 +47,15 @@ func overloadStartNSSAIList(list ngap.OverloadStartNSSAIList) []OverloadStartNSS return out } +func guamiList(list ngap.GUAMIList) []Guami { + out := make([]Guami, 0, len(list)) + for _, item := range list { + out = append(out, guami(item.GUAMI)) + } + + return out +} + func buildOverloadStart(value []byte) NGAPMessageValue { m, err := ngap.ParseOverloadStart(value) if err != nil { @@ -67,6 +76,10 @@ func buildOverloadStart(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDOverloadStartNSSAIList, ngap.CriticalityIgnore, overloadStartNSSAIList(m.OverloadStartNSSAIList))) } + if len(m.GUAMIList) > 0 { + ies = append(ies, ie(ngap.IDGUAMIList, ngap.CriticalityIgnore, guamiList(m.GUAMIList))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } @@ -76,5 +89,11 @@ func buildOverloadStop(value []byte) NGAPMessageValue { return NGAPMessageValue{Error: fmt.Sprintf("parse Overload Stop: %v", err)} } - return NGAPMessageValue{IEs: unmodeledIEs(m.UnknownIEs())} + var ies []IE + + if len(m.GUAMIList) > 0 { + ies = append(ies, ie(ngap.IDGUAMIList, ngap.CriticalityIgnore, guamiList(m.GUAMIList))) + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/ue_context_modification.go b/internal/decoder/ngap/ue_context_modification.go index d2558ad0e2..ab8dff9dd6 100644 --- a/internal/decoder/ngap/ue_context_modification.go +++ b/internal/decoder/ngap/ue_context_modification.go @@ -28,6 +28,10 @@ func buildUEContextModificationRequest(value []byte) NGAPMessageValue { })) } + if m.NewAMFUENGAPID != nil { + ies = append(ies, ie(ngap.IDNewAMFUENGAPID, ngap.CriticalityReject, int64(*m.NewAMFUENGAPID))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/ue_context_release.go b/internal/decoder/ngap/ue_context_release.go index 8046bf3a4c..3a523e4250 100644 --- a/internal/decoder/ngap/ue_context_release.go +++ b/internal/decoder/ngap/ue_context_release.go @@ -65,6 +65,10 @@ func buildUEContextReleaseRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDCause, ngap.CriticalityIgnore, cause(*m.Cause))) } + if m.GWContextReleaseIndication != nil { + ies = append(ies, ie(ngap.IDGWContextReleaseIndication, ngap.CriticalityReject, true)) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/ngap/amf_config_update.go b/ngap/amf_config_update.go index 8857c8e036..4fa8bba09e 100644 --- a/ngap/amf_config_update.go +++ b/ngap/amf_config_update.go @@ -11,6 +11,7 @@ type AMFConfigurationUpdate struct { AMFName *string ServedGUAMIList ServedGUAMIList RelativeAMFCapacity *uint8 + PLMNSupportList PLMNSupportList messageMeta } @@ -74,6 +75,19 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }), true }, }, + { + id: IDPLMNSupportList, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.PLMNSupportList) + }, + encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + if len(m.PLMNSupportList) == 0 { + return nil, false + } + + return m.PLMNSupportList, true + }, + }, } func (m *AMFConfigurationUpdate) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/amf_config_update_test.go b/ngap/amf_config_update_test.go index 05a7e4f4ce..8e94ced6e4 100644 --- a/ngap/amf_config_update_test.go +++ b/ngap/amf_config_update_test.go @@ -3,7 +3,10 @@ package ngap -import "testing" +import ( + "strings" + "testing" +) func TestAMFConfigurationUpdateRoundTrips(t *testing.T) { in := &AMFConfigurationUpdate{ @@ -122,3 +125,57 @@ func TestAMFConfigurationUpdateFailureRoundTrips(t *testing.T) { t.Fatalf("TimeToWait mismatch: %+v", out.TimeToWait) } } + +func goldAMFConfigurationUpdatePLMNSupport() *AMFConfigurationUpdate { + return &AMFConfigurationUpdate{ + AMFName: Ptr("ella-amf"), + ServedGUAMIList: goldResponse().ServedGUAMIList, + RelativeAMFCapacity: Ptr(uint8(255)), + PLMNSupportList: PLMNSupportList{ + { + PLMNIdentity: goldPLMN(), + SliceSupportList: SliceSupportList{{SNSSAI: SNSSAI{SST: 1, SD: &SD{0x01, 0x02, 0x03}}}}, + }, + { + PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, + SliceSupportList: SliceSupportList{ + {SNSSAI: SNSSAI{SST: 1}}, + {SNSSAI: SNSSAI{SST: 2, SD: &SD{0xff, 0xff, 0xfe}}}, + }, + }, + }, + } +} + +func amfConfigurationUpdateGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{ + { + "AMFConfigurationUpdatePLMNSupportList", + goldAMFConfigurationUpdatePLMNSupport(), + func(v []byte) (any, error) { return ParseAMFConfigurationUpdate(v) }, + "0000003e0000040001000a0380656c6c612d616d6600600008000002f83902004300564001ff005000181002f839000010080102030000f110000100088080fffffe", + }, + { + "AMFConfigurationUpdatePLMNSupportListOnly", + &AMFConfigurationUpdate{PLMNSupportList: goldAMFConfigurationUpdatePLMNSupport().PLMNSupportList[:1]}, + func(v []byte) (any, error) { return ParseAMFConfigurationUpdate(v) }, + "000000120000010050000b0002f83900001008010203", + }, + } +} + +func TestAMFConfigurationUpdatePLMNSupportListGolden(t *testing.T) { + for _, c := range amfConfigurationUpdateGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} + +func TestAMFConfigurationUpdateUnsetPLMNSupportListLeavesEncodingUnchanged(t *testing.T) { + m := goldAMFConfigurationUpdatePLMNSupport() + m.PLMNSupportList = nil + + got := mustMarshalHex(t, m) + if strings.Contains(got, "0050000b") { + t.Fatalf("PLMN Support List encoded while unset: %s", got) + } +} diff --git a/ngap/enum_encode_test.go b/ngap/enum_encode_test.go index cfb9580a47..432a128127 100644 --- a/ngap/enum_encode_test.go +++ b/ngap/enum_encode_test.go @@ -23,6 +23,7 @@ func TestEnumOutsideRootIsNotEncoded(t *testing.T) { {"TimeToWait", timeToWaitRootCount, func(v int64) per.Marshaler { return TimeToWait(v) }}, {"RRCEstablishmentCause", rrcEstablishmentCauseRootCount, func(v int64) per.Marshaler { return RRCEstablishmentCause(v) }}, {"UEContextRequest", ueContextRequestRootCount, func(v int64) per.Marshaler { return UEContextRequest(v) }}, + {"GWContextReleaseIndication", gwContextReleaseIndicationRootCount, func(v int64) per.Marshaler { return GWContextReleaseIndication(v) }}, {"UERetentionInformation", ueRetentionInformationRootCount, func(v int64) per.Marshaler { return UERetentionInformation(v) }}, {"TimerApproachForGUAMIRemoval", timerApproachForGUAMIRemovalRootCount, func(v int64) per.Marshaler { return TimerApproachForGUAMIRemoval(v) }}, } diff --git a/ngap/fuzz_test.go b/ngap/fuzz_test.go index a42d1f1d52..8333d9cd64 100644 --- a/ngap/fuzz_test.go +++ b/ngap/fuzz_test.go @@ -45,6 +45,24 @@ func FuzzDecodeNoPanic(f *testing.F) { f.Add(b) } + for _, c := range ieAdditionGoldenCases() { + b, err := hex.DecodeString(c.golden) + if err != nil { + f.Fatal(err) + } + + f.Add(b) + } + + for _, c := range pwsCases() { + b, err := hex.DecodeString(c.golden) + if err != nil { + f.Fatal(err) + } + + f.Add(b) + } + f.Fuzz(func(t *testing.T, data []byte) { _, _ = unmarshalPERValue[Cause](data) _, _ = unmarshalPERValue[CriticalityDiagnostics](data) @@ -52,6 +70,8 @@ func FuzzDecodeNoPanic(f *testing.F) { _, _ = unmarshalPERValue[SupportedTAList](data) _, _ = unmarshalPERValue[ServedGUAMIList](data) _, _ = unmarshalPERValue[PLMNSupportList](data) + _, _ = unmarshalPERValue[GUAMIList](data) + _, _ = unmarshalPERValue[GWContextReleaseIndication](data) _, _ = unmarshalPERValue[FiveGSTMSI](data) _, _ = unmarshalPERValue[ResetType](data) _, _ = unmarshalPERValue[UserLocationInformation](data) diff --git a/ngap/golden_tshark_test.go b/ngap/golden_tshark_test.go index 9bfb474e3e..a04b8fdb92 100644 --- a/ngap/golden_tshark_test.go +++ b/ngap/golden_tshark_test.go @@ -6,11 +6,60 @@ package ngap import ( "encoding/hex" "os/exec" + "reflect" "strconv" "strings" "testing" ) +type goldenRoundTrip struct { + name string + msg interface{ Marshal() ([]byte, error) } + parse func([]byte) (any, error) + golden string +} + +func checkGoldenRoundTrip(t *testing.T, c goldenRoundTrip) { + t.Helper() + + if got := mustMarshalHex(t, c.msg); got != c.golden { + t.Fatalf("encoded\n got %s\nwant %s", got, c.golden) + } + + pdu, err := Unmarshal(mustHex(t, c.golden)) + if err != nil { + t.Fatal(err) + } + + out, err := c.parse(pdu.value()) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, c.msg) { + t.Fatalf("decoded\n got %+v\nwant %+v", out, c.msg) + } + + m, ok := out.(interface{ Marshal() ([]byte, error) }) + if !ok { + t.Fatalf("%T cannot be re-encoded", out) + } + + if got := mustMarshalHex(t, m); got != c.golden { + t.Fatalf("re-encoded\n got %s\nwant %s", got, c.golden) + } +} + +func ieAdditionGoldenCases() []goldenRoundTrip { + var out []goldenRoundTrip + + out = append(out, amfConfigurationUpdateGoldenCases()...) + out = append(out, initialContextSetupRequestGoldenCases()...) + out = append(out, uEContextModificationRequestGoldenCases()...) + + return append(out, uEContextReleaseRequestGoldenCases()...) +} + type tsharkVector struct { name string b []byte @@ -29,6 +78,10 @@ func goldenTsharkVectors(t *testing.T) []tsharkVector { out = append(out, tsharkVector{name: c.name, b: b}) } + for _, c := range ieAdditionGoldenCases() { + out = append(out, tsharkVector{name: c.name, b: mustHex(t, c.golden)}) + } + return append(out, tsharkVector{"NGReset", handNGReset(t, resetFixtures(5)), 4}, tsharkVector{"NGResetMaxAMFUENGAPID", handNGReset(t, resetFixtures(0xFFFFFFFFFF-2)), 4}, diff --git a/ngap/ie_ids.go b/ngap/ie_ids.go index b867cbe2f9..4d813e35ca 100644 --- a/ngap/ie_ids.go +++ b/ngap/ie_ids.go @@ -168,4 +168,6 @@ const ( IDTargettoSourceFailureTransparentContainer ProtocolIEID = 262 IDNotifySourceNGRANNode ProtocolIEID = 269 IDPartiallyAllowedNSSAI ProtocolIEID = 414 + IDGUAMIList ProtocolIEID = 451 + IDGWContextReleaseIndication ProtocolIEID = 452 ) diff --git a/ngap/ie_names.go b/ngap/ie_names.go index 08ec3f2de8..7fdfa05451 100644 --- a/ngap/ie_names.go +++ b/ngap/ie_names.go @@ -176,6 +176,8 @@ var protocolIENames = map[ProtocolIEID]string{ IDTargettoSourceFailureTransparentContainer: "TargettoSource-Failure-TransparentContainer", IDNotifySourceNGRANNode: "NotifySourceNGRANNode", IDPartiallyAllowedNSSAI: "Partially-Allowed-NSSAI", + IDGUAMIList: "GUAMIList", + IDGWContextReleaseIndication: "GW-Context-Release-Indication", } // ProtocolIEIDName returns the TS 38.413 name of id, and whether it is known. diff --git a/ngap/ie_ue.go b/ngap/ie_ue.go index 5873f43abf..c2ac8b953f 100644 --- a/ngap/ie_ue.go +++ b/ngap/ie_ue.go @@ -118,6 +118,29 @@ func (u *UEContextRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } +type GWContextReleaseIndication uint8 + +const ( + GWContextReleaseIndicationTrue GWContextReleaseIndication = iota + + gwContextReleaseIndicationRootCount = 1 +) + +func (g GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, gwContextReleaseIndicationRootCount, int64(g), "GWContextReleaseIndication") +} + +func (g *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, gwContextReleaseIndicationRootCount, "GWContextReleaseIndication") + if err != nil { + return err + } + + *g = GWContextReleaseIndication(idx) + + return nil +} + // Cell identity widths of the two 3GPP-access CGIs (TS 38.413 §9.3.1.7, // §9.3.1.9). S1AP has one, 28 bits wide. const ( diff --git a/ngap/initial_context_setup.go b/ngap/initial_context_setup.go index f35c18d1e9..58eb679e8e 100644 --- a/ngap/initial_context_setup.go +++ b/ngap/initial_context_setup.go @@ -82,6 +82,7 @@ type InitialContextSetupRequest struct { AllowedNSSAI AllowedNSSAI UESecurityCapabilities UESecurityCapabilities SecurityKey SecurityKey + TraceActivation *TraceActivation UERadioCapability UERadioCapability NASPDU *NASPDU UERadioCapabilityForPaging *UERadioCapabilityForPaging @@ -175,6 +176,27 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ }, encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.SecurityKey, true }, }, + { + id: IDTraceActivation, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + var v TraceActivation + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.TraceActivation = &v + + return nil + }, + encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + if m.TraceActivation == nil { + return nil, false + } + + return m.TraceActivation, true + }, + }, { id: IDUERadioCapability, presence: presenceOptional, crit: CriticalityIgnore, decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { diff --git a/ngap/initial_context_setup_test.go b/ngap/initial_context_setup_test.go index f46e7a32ca..93216c09ea 100644 --- a/ngap/initial_context_setup_test.go +++ b/ngap/initial_context_setup_test.go @@ -277,3 +277,34 @@ func TestInitialContextSetupRequestMissingRejectIE(t *testing.T) { } } } + +func goldInitialContextSetupRequestTraceActivation() *InitialContextSetupRequest { + ta := goldenTraceActivation() + + return &InitialContextSetupRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + GUAMI: goldContextGUAMI(), + AllowedNSSAI: AllowedNSSAI{{SNSSAI: SNSSAI{SST: 1, SD: &SD{0x01, 0x02, 0x03}}}}, + UESecurityCapabilities: goldUESecurityCapabilities(), + SecurityKey: goldSecurityKey(), + TraceActivation: &ta, + } +} + +func initialContextSetupRequestGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{ + { + "InitialContextSetupRequestTraceActivation", + goldInitialContextSetupRequestTraceActivation(), + func(v []byte) (any, error) { return ParseInitialContextSetupRequest(v) }, + "000e0068000007000a00020001005500020002001c00070000f11001004000000005020101020300770009100004000100004000005e0020000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f006c40100002f8390a0b0c1234f800f80a000001", + }, + } +} + +func TestInitialContextSetupRequestTraceActivationGolden(t *testing.T) { + for _, c := range initialContextSetupRequestGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} diff --git a/ngap/overload.go b/ngap/overload.go index 0ae1a78ffa..5e044b2430 100644 --- a/ngap/overload.go +++ b/ngap/overload.go @@ -120,10 +120,36 @@ func (l *OverloadStartNSSAIList) UnmarshalPER(r *per.Reader, enc per.Encoding) e return nil } +const maxnoofGUAMIs = 1024 + +type GUAMIListItem struct { + _ [0]struct{} `per:"extseq"` + GUAMI GUAMI + _ ieExtensions `per:",skip"` +} + +type GUAMIList []GUAMIListItem + +func (l GUAMIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofGUAMIs, []GUAMIListItem(l)) +} + +func (l *GUAMIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[GUAMIListItem](r, enc, 1, maxnoofGUAMIs) + if err != nil { + return err + } + + *l = items + + return nil +} + type OverloadStart struct { AMFOverloadResponse *OverloadResponse AMFTrafficLoadReductionIndication *TrafficLoadReductionIndication OverloadStartNSSAIList OverloadStartNSSAIList + GUAMIList GUAMIList messageMeta } @@ -184,6 +210,19 @@ var overloadStartIEs = []ieSpec[OverloadStart]{ return m.OverloadStartNSSAIList, true }, }, + { + id: IDGUAMIList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.GUAMIList) + }, + encode: func(m *OverloadStart) (per.Marshaler, bool) { + if len(m.GUAMIList) == 0 { + return nil, false + } + + return m.GUAMIList, true + }, + }, } func (m *OverloadStart) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -211,10 +250,26 @@ func ParseOverloadStart(value []byte) (*OverloadStart, error) { } type OverloadStop struct { + GUAMIList GUAMIList + messageMeta } -var overloadStopIEs = []ieSpec[OverloadStop]{} +var overloadStopIEs = []ieSpec[OverloadStop]{ + { + id: IDGUAMIList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *OverloadStop, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.GUAMIList) + }, + encode: func(m *OverloadStop) (per.Marshaler, bool) { + if len(m.GUAMIList) == 0 { + return nil, false + } + + return m.GUAMIList, true + }, + }, +} func (m *OverloadStop) encodeBody(w *per.Writer, enc per.Encoding) error { return encodeMessageBody(w, enc, ProcOverloadStop, overloadStopIEs, m) diff --git a/ngap/per_gen.go b/ngap/per_gen.go index fb3a994d47..db5145bef6 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -2078,6 +2078,60 @@ func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } +func (gUAMIListItem *GUAMIListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(false) + w.WriteBit(false) + if err := gUAMIListItem.GUAMI.MarshalPER(w, enc); err != nil { + return err + } + return nil +} + +func (gUAMIListItem *GUAMIListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_f1, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gUAMIListItem.GUAMI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_f1 { + var v ieExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + _ = v + } + if extBit { + var extBits []bool + if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + for i := int64(0); i < count; i++ { + b, err := r.ReadBit() + if err != nil { + return err + } + extBits = append(extBits, b) + } + return nil + }); err != nil { + return err + } + for _, present := range extBits { + if !present { + continue + } + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + } + return nil +} + func (globalNgENBID *GlobalNgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) diff --git a/ngap/pws_overload_test.go b/ngap/pws_overload_test.go index d01f748e9a..075fff9fc0 100644 --- a/ngap/pws_overload_test.go +++ b/ngap/pws_overload_test.go @@ -43,6 +43,24 @@ func goldOverloadStart() *OverloadStart { } } +func goldGUAMIList() GUAMIList { + return GUAMIList{ + {GUAMI: GUAMI{PLMNIdentity: pwsPLMN(), AMFRegionID: 0xca, AMFSetID: 0x3f8, AMFPointer: 0x01}}, + {GUAMI: GUAMI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, AMFRegionID: 0x01, AMFSetID: 0x001, AMFPointer: 0x3f}}, + } +} + +func goldOverloadStartGUAMIList() *OverloadStart { + m := goldOverloadStart() + m.GUAMIList = goldGUAMIList() + + return m +} + +func goldOverloadStopGUAMIList() *OverloadStop { + return &OverloadStop{GUAMIList: goldGUAMIList()} +} + func goldWriteReplaceWarningRequest() *WriteReplaceWarningRequest { return &WriteReplaceWarningRequest{ MessageIdentifier: 0x1112, @@ -131,6 +149,8 @@ func pwsCases() []pwsCase { return []pwsCase{ {"OverloadStart", goldOverloadStart().Marshal, func(v []byte) (any, error) { return ParseOverloadStart(v) }, goldOverloadStart(), "0016401d000003000200011000094001620031400c000060000010080000012260"}, {"OverloadStop", (&OverloadStop{}).Marshal, func(v []byte) (any, error) { return ParseOverloadStop(v) }, &OverloadStop{}, "00170003000000"}, + {"OverloadStartGUAMIList", goldOverloadStartGUAMIList().Marshal, func(v []byte) (any, error) { return ParseOverloadStart(v) }, goldOverloadStartGUAMIList(), "00164031000004000200011000094001620031400c00006000001008000001226001c3401000010000f110cafe010002f83901007f"}, + {"OverloadStopGUAMIList", goldOverloadStopGUAMIList().Marshal, func(v []byte) (any, error) { return ParseOverloadStop(v) }, goldOverloadStopGUAMIList(), "0017001700000101c3401000010000f110cafe010002f83901007f"}, {"WriteReplaceWarningRequest", goldWriteReplaceWarningRequest().Marshal, func(v []byte) (any, error) { return ParseWriteReplaceWarningRequest(v) }, goldWriteReplaceWarningRequest(), "003300809d00000a002300021112005f00023456007a400c2000000000f110123456789000570002000a002f00020001007d40020580001440010f007b4056005301d4f29c0e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040011000100008d40040001aabb"}, {"WriteReplaceWarningResponse", goldWriteReplaceWarningResponse().Marshal, func(v []byte) (any, error) { return ParseWriteReplaceWarningResponse(v) }, goldWriteReplaceWarningResponse(), "20330028000003002300021112005f00023456000d40158000000000f11000000100000000f1101234567890"}, {"PWSCancelRequest", goldPWSCancelRequest().Marshal, func(v []byte) (any, error) { return ParsePWSCancelRequest(v) }, goldPWSCancelRequest(), "00200022000004002300021112005f00023456007a400a4000000000f110000001000e000100"}, @@ -186,7 +206,16 @@ func TestPWSOverloadWireCriticality(t *testing.T) { {IDAMFTrafficLoadReductionIndication, CriticalityIgnore}, {IDOverloadStartNSSAIList, CriticalityIgnore}, }}, + {"OverloadStart §9.2.6.14 GUAMI List", goldOverloadStartGUAMIList().encodeBody, []wireIE{ + {IDAMFOverloadResponse, CriticalityReject}, + {IDAMFTrafficLoadReductionIndication, CriticalityIgnore}, + {IDOverloadStartNSSAIList, CriticalityIgnore}, + {IDGUAMIList, CriticalityIgnore}, + }}, {"OverloadStop §9.2.6.15", (&OverloadStop{}).encodeBody, nil}, + {"OverloadStop §9.2.6.15 GUAMI List", goldOverloadStopGUAMIList().encodeBody, []wireIE{ + {IDGUAMIList, CriticalityIgnore}, + }}, {"WriteReplaceWarningRequest §9.2.8.1", func() func(*per.Writer, per.Encoding) error { m := goldWriteReplaceWarningRequest() m.WarningSecurityInfo = &WarningSecurityInfo{} @@ -410,3 +439,13 @@ func TestTrafficLoadReductionIndicationRange(t *testing.T) { } } } + +func TestOverloadStopGUAMIListBounds(t *testing.T) { + if _, err := (&OverloadStop{GUAMIList: make(GUAMIList, maxnoofGUAMIs+1)}).Marshal(); err == nil { + t.Fatal("encoded a GUAMI List longer than maxnoofGUAMIs") + } + + if _, err := (&OverloadStop{GUAMIList: make(GUAMIList, maxnoofGUAMIs)}).Marshal(); err != nil { + t.Fatalf("maxnoofGUAMIs items: %v", err) + } +} diff --git a/ngap/table_order_test.go b/ngap/table_order_test.go index bc070c2a53..1174eed6a3 100644 --- a/ngap/table_order_test.go +++ b/ngap/table_order_test.go @@ -27,7 +27,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDRANUENGAPID, IDNASPDU, IDUserLocationInformation, IDRRCEstablishmentCause, IDFiveGSTMSI, IDAMFSetID, IDUEContextRequest, IDAllowedNSSAI}}, {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU}}, {"UplinkNASTransport", tableIDs(uplinkNASTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDUserLocationInformation}}, - {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate, IDGUAMI, IDPDUSessionResourceSetupListCxtReq, IDAllowedNSSAI, IDUESecurityCapabilities, IDSecurityKey, IDUERadioCapability, IDNASPDU, IDUERadioCapabilityForPaging}}, + {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate, IDGUAMI, IDPDUSessionResourceSetupListCxtReq, IDAllowedNSSAI, IDUESecurityCapabilities, IDSecurityKey, IDTraceActivation, IDUERadioCapability, IDNASPDU, IDUERadioCapabilityForPaging}}, {"InitialContextSetupResponse", tableIDs(initialContextSetupResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceSetupListCxtRes, IDPDUSessionResourceFailedToSetupListCxtRes, IDCriticalityDiagnostics}}, {"InitialContextSetupFailure", tableIDs(initialContextSetupFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceFailedToSetupListCxtFail, IDCause, IDCriticalityDiagnostics}}, {"HandoverRequired", tableIDs(handoverRequiredIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDHandoverType, IDCause, IDTargetID, IDDirectForwardingPathAvailability, IDPDUSessionResourceListHORqd, IDSourceToTargetTransparentContainer}}, @@ -62,15 +62,17 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"PDUSessionResourceSetupRequest", tableIDs(pDUSessionResourceSetupRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDPDUSessionResourceSetupListSUReq, IDUEAggregateMaximumBitRate}}, {"PDUSessionResourceSetupResponse", tableIDs(pDUSessionResourceSetupResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceSetupListSURes, IDPDUSessionResourceFailedToSetupListSURes, IDCriticalityDiagnostics, IDUserLocationInformation}}, {"UERadioCapabilityInfoIndication", tableIDs(uERadioCapabilityInfoIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUERadioCapability, IDUERadioCapabilityForPaging}}, - {"UEContextModificationRequest", tableIDs(uEContextModificationRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate}}, + {"UEContextModificationRequest", tableIDs(uEContextModificationRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate, IDNewAMFUENGAPID}}, {"UEContextModificationResponse", tableIDs(uEContextModificationResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDCriticalityDiagnostics}}, {"UEContextModificationFailure", tableIDs(uEContextModificationFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCause, IDCriticalityDiagnostics}}, - {"UEContextReleaseRequest", tableIDs(uEContextReleaseRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceListCxtRelReq, IDCause}}, + {"UEContextReleaseRequest", tableIDs(uEContextReleaseRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceListCxtRelReq, IDCause, IDGWContextReleaseIndication}}, {"UEContextReleaseCommand", tableIDs(uEContextReleaseCommandIEs), []ProtocolIEID{IDUENGAPIDs, IDCause}}, {"UEContextReleaseComplete", tableIDs(uEContextReleaseCompleteIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDPDUSessionResourceListCxtRelCpl, IDCriticalityDiagnostics}}, {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEPagingIdentity, IDPagingDRX, IDTAIListForPaging, IDPagingPriority, IDUERadioCapabilityForPaging, IDPagingOrigin}}, {"RANConfigurationUpdate", tableIDs(rANConfigurationUpdateIEs), []ProtocolIEID{IDRANNodeName, IDSupportedTAList, IDDefaultPagingDRX, IDGlobalRANNodeID, IDNGRANTNLAssociationToRemoveList}}, - {"AMFConfigurationUpdate", tableIDs(aMFConfigurationUpdateIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity}}, + {"AMFConfigurationUpdate", tableIDs(aMFConfigurationUpdateIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList}}, + {"OverloadStart", tableIDs(overloadStartIEs), []ProtocolIEID{IDAMFOverloadResponse, IDAMFTrafficLoadReductionIndication, IDOverloadStartNSSAIList, IDGUAMIList}}, + {"OverloadStop", tableIDs(overloadStopIEs), []ProtocolIEID{IDGUAMIList}}, {"AMFConfigurationUpdateAcknowledge", tableIDs(aMFConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, {"AMFConfigurationUpdateFailure", tableIDs(aMFConfigurationUpdateFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, {"RANConfigurationUpdateAcknowledge", tableIDs(rANConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, diff --git a/ngap/ue_context_modification.go b/ngap/ue_context_modification.go index e7b51384ea..2c8afb7739 100644 --- a/ngap/ue_context_modification.go +++ b/ngap/ue_context_modification.go @@ -11,6 +11,7 @@ type UEContextModificationRequest struct { AMFUENGAPID AMFUENGAPID RANUENGAPID RANUENGAPID UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + NewAMFUENGAPID *AMFUENGAPID messageMeta } @@ -51,6 +52,27 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return m.UEAggregateMaximumBitRate, true }, }, + { + id: IDNewAMFUENGAPID, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { + var v AMFUENGAPID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.NewAMFUENGAPID = &v + + return nil + }, + encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { + if m.NewAMFUENGAPID == nil { + return nil, false + } + + return m.NewAMFUENGAPID, true + }, + }, } func (m *UEContextModificationRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ue_context_modification_test.go b/ngap/ue_context_modification_test.go index 83cc93b591..4f55d4f7f3 100644 --- a/ngap/ue_context_modification_test.go +++ b/ngap/ue_context_modification_test.go @@ -169,3 +169,33 @@ func TestUEContextModificationRoundTrips(t *testing.T) { } }) } + +func goldUEContextModificationRequestNewAMFUENGAPID() *UEContextModificationRequest { + m := goldUEContextModificationRequest() + m.NewAMFUENGAPID = Ptr(AMFUENGAPID(0xffffffffff)) + + return m +} + +func uEContextModificationRequestGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{ + { + "UEContextModificationRequestNewAMFUENGAPID", + goldUEContextModificationRequestNewAMFUENGAPID(), + func(v []byte) (any, error) { return ParseUEContextModificationRequest(v) }, + "00280027000004000a00020001005500020002006e400a0c0bebc2003005f5e1000028000680ffffffffff", + }, + { + "UEContextModificationRequestNewAMFUENGAPIDOnly", + &UEContextModificationRequest{AMFUENGAPID: 1, RANUENGAPID: 2, NewAMFUENGAPID: Ptr(AMFUENGAPID(3))}, + func(v []byte) (any, error) { return ParseUEContextModificationRequest(v) }, + "00280015000003000a00020001005500020002002800020003", + }, + } +} + +func TestUEContextModificationRequestNewAMFUENGAPIDGolden(t *testing.T) { + for _, c := range uEContextModificationRequestGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} diff --git a/ngap/ue_context_release.go b/ngap/ue_context_release.go index db79609d3a..a336b490ba 100644 --- a/ngap/ue_context_release.go +++ b/ngap/ue_context_release.go @@ -357,10 +357,11 @@ func ParseUEContextReleaseComplete(value []byte) (*UEContextReleaseComplete, err // TS 38.413 §9.2.2.4. type UEContextReleaseRequest struct { - AMFUENGAPID AMFUENGAPID - RANUENGAPID RANUENGAPID - PDUSessionResourceList PDUSessionResourceListCxtRelReq - Cause *Cause + AMFUENGAPID AMFUENGAPID + RANUENGAPID RANUENGAPID + PDUSessionResourceList PDUSessionResourceListCxtRelReq + Cause *Cause + GWContextReleaseIndication *GWContextReleaseIndication messageMeta } @@ -414,6 +415,27 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ return m.Cause, true }, }, + { + id: IDGWContextReleaseIndication, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { + var v GWContextReleaseIndication + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.GWContextReleaseIndication = &v + + return nil + }, + encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { + if m.GWContextReleaseIndication == nil { + return nil, false + } + + return m.GWContextReleaseIndication, true + }, + }, } func (m *UEContextReleaseRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ue_context_release_test.go b/ngap/ue_context_release_test.go index 0e1bebadae..3e559092e3 100644 --- a/ngap/ue_context_release_test.go +++ b/ngap/ue_context_release_test.go @@ -273,3 +273,48 @@ func TestUEContextReleaseCommandChoiceExtension(t *testing.T) { t.Errorf("diagnostics = %+v, want one not-understood entry for UE-NGAP-IDs", ase.IEs) } } + +func uEContextReleaseRequestGoldenCases() []goldenRoundTrip { + inactivity := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity} + + return []goldenRoundTrip{ + { + "UEContextReleaseRequestGWContextReleaseIndication", + &UEContextReleaseRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + PDUSessionResourceList: PDUSessionResourceListCxtRelReq{{PDUSessionID: 5}}, + Cause: &inactivity, + GWContextReleaseIndication: Ptr(GWContextReleaseIndicationTrue), + }, + func(v []byte) (any, error) { return ParseUEContextReleaseRequest(v) }, + "002a4021000005000a0002000100550002000200850003000005000f4002050001c4000100", + }, + } +} + +func TestUEContextReleaseRequestGWContextReleaseIndicationGolden(t *testing.T) { + for _, c := range uEContextReleaseRequestGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} + +func TestUEContextReleaseRequestGWContextReleaseIndicationExtensionRejects(t *testing.T) { + cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity} + + _, err := ParseUEContextReleaseRequest(container(t, + ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: Ptr(AMFUENGAPID(1))}, + ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: Ptr(RANUENGAPID(2))}, + ieField{id: IDCause, crit: CriticalityIgnore, val: &cause}, + ieField{id: IDGWContextReleaseIndication, crit: CriticalityReject, raw: extensionEnum(t, gwContextReleaseIndicationRootCount, 0)}, + )) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) { + t.Fatalf("err = %v, want an AbstractSyntaxError", err) + } + + if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDGWContextReleaseIndication || ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { + t.Fatalf("IEs = %+v, want GW-Context-Release-Indication not-understood", ase.IEs) + } +} diff --git a/ngap/wire_criticality_test.go b/ngap/wire_criticality_test.go index 76705eb168..e546c3a0de 100644 --- a/ngap/wire_criticality_test.go +++ b/ngap/wire_criticality_test.go @@ -142,6 +142,19 @@ func TestWireCriticality(t *testing.T) { {IDSecurityKey, CriticalityReject}, }, }, + { + "InitialContextSetupRequest §9.2.2.1 Trace Activation", + goldInitialContextSetupRequestTraceActivation().encodeBody, + []wireIE{ + {IDAMFUENGAPID, CriticalityReject}, + {IDRANUENGAPID, CriticalityReject}, + {IDGUAMI, CriticalityReject}, + {IDAllowedNSSAI, CriticalityReject}, + {IDUESecurityCapabilities, CriticalityReject}, + {IDSecurityKey, CriticalityReject}, + {IDTraceActivation, CriticalityIgnore}, + }, + }, { "InitialContextSetupResponse §9.2.2.2", (&InitialContextSetupResponse{ @@ -168,6 +181,16 @@ func TestWireCriticality(t *testing.T) { {IDUEAggregateMaximumBitRate, CriticalityIgnore}, }, }, + { + "UEContextModificationRequest §9.2.2.7 New AMF UE NGAP ID", + goldUEContextModificationRequestNewAMFUENGAPID().encodeBody, + []wireIE{ + {IDAMFUENGAPID, CriticalityReject}, + {IDRANUENGAPID, CriticalityReject}, + {IDUEAggregateMaximumBitRate, CriticalityIgnore}, + {IDNewAMFUENGAPID, CriticalityReject}, + }, + }, { "UEContextModificationResponse §9.2.2.8", (&UEContextModificationResponse{ @@ -378,6 +401,31 @@ func TestWireCriticality(t *testing.T) { {IDCause, CriticalityIgnore}, }, }, + { + "UEContextReleaseRequest §9.2.2.4 GW Context Release Indication", + (&UEContextReleaseRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity}), + GWContextReleaseIndication: Ptr(GWContextReleaseIndicationTrue), + }).encodeBody, + []wireIE{ + {IDAMFUENGAPID, CriticalityReject}, + {IDRANUENGAPID, CriticalityReject}, + {IDCause, CriticalityIgnore}, + {IDGWContextReleaseIndication, CriticalityReject}, + }, + }, + { + "AMFConfigurationUpdate §9.2.6.7 PLMN Support List", + goldAMFConfigurationUpdatePLMNSupport().encodeBody, + []wireIE{ + {IDAMFName, CriticalityReject}, + {IDServedGUAMIList, CriticalityReject}, + {IDRelativeAMFCapacity, CriticalityIgnore}, + {IDPLMNSupportList, CriticalityReject}, + }, + }, { "UEContextReleaseCommand §9.2.2.5", (&UEContextReleaseCommand{ diff --git a/ngap/zz_probe_test.go b/ngap/zz_probe_test.go new file mode 100644 index 0000000000..b8832be7c6 --- /dev/null +++ b/ngap/zz_probe_test.go @@ -0,0 +1,38 @@ +package ngap + +import ( + "bytes" + "testing" + + "github.com/ellanetworks/core/per" +) + +func TestZZProbe(t *testing.T) { + for _, c := range loadCorpus(t) { + pdu, _ := Unmarshal(c.b) + codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + if !ok { + continue + } + msg, err := codec(pdu.value()) + if err != nil { + t.Logf("%s REFUSED %v", c.source, err) + continue + } + re, err := msg.Marshal() + if err != nil || !bytes.Equal(re, c.b) { + t.Logf("%s NOTEXACT %v %T", c.source, err, msg) + if err == nil { + ra := per.NewReader(pdu.value()); _, _ = ra.ReadBit(); a, _ := decodeIEContainer(ra, per.Aligned) + p2, _ := Unmarshal(re) + rb := per.NewReader(p2.value()); _, _ = rb.ReadBit(); b, _ := decodeIEContainer(rb, per.Aligned) + var ia, ib []ProtocolIEID + for _, f := range a { ia = append(ia, f.id) } + for _, f := range b { ib = append(ib, f.id) } + t.Logf(" orig %x\n re %x", c.b, re) + t.Logf(" wire %v\n re %v", ia, ib) + for i := range a { for j := range b { if a[i].id == b[j].id && !bytes.Equal(a[i].value, b[j].value) { t.Logf(" IE %v differs\n %x\n %x", a[i].id, a[i].value, b[j].value) } } } + } + } + } +} diff --git a/s1ap/cause.go b/s1ap/cause.go index 30ddbc80a4..f284720ad1 100644 --- a/s1ap/cause.go +++ b/s1ap/cause.go @@ -77,7 +77,9 @@ const ( CauseProtocolTransferSyntaxError = 0 // transfer-syntax-error CauseProtocolAbstractSyntaxErrorReject = 1 // abstract-syntax-error-reject CauseProtocolAbstractSyntaxErrorIgnoreAndNotify = 2 // abstract-syntax-error-ignore-and-notify + CauseProtocolMessageNotCompatible = 3 CauseProtocolSemanticError = 4 // semantic-error + CauseProtocolUnspecified = 6 // abstract-syntax-error-falsely-constructed-message CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage = 5 diff --git a/s1ap/cause_test.go b/s1ap/cause_test.go index e22b594f56..3e9cd2e147 100644 --- a/s1ap/cause_test.go +++ b/s1ap/cause_test.go @@ -70,3 +70,44 @@ func TestCauseEnumeratedValueContinuesPastTheRoot(t *testing.T) { t.Fatalf("extension value = %d, want %d", got, causeGroupRootCount[CauseGroupRadioNetwork]+5) } } + +func TestCauseProtocolConstantsMatchTS36413(t *testing.T) { + cases := []struct { + value int + name string + }{ + {CauseProtocolTransferSyntaxError, "transfer-syntax-error"}, + {CauseProtocolAbstractSyntaxErrorReject, "abstract-syntax-error-reject"}, + {CauseProtocolAbstractSyntaxErrorIgnoreAndNotify, "abstract-syntax-error-ignore-and-notify"}, + {CauseProtocolMessageNotCompatible, "message-not-compatible-with-receiver-state"}, + {CauseProtocolSemanticError, "semantic-error"}, + {CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage, "abstract-syntax-error-falsely-constructed-message"}, + {CauseProtocolUnspecified, "unspecified"}, + } + + if len(cases) != len(protocolRoot) { + t.Fatalf("%d named protocol causes, CauseProtocol has %d root values", len(cases), len(protocolRoot)) + } + + for i, c := range cases { + if c.value != i { + t.Errorf("%s = %d, want %d", c.name, c.value, i) + } + + if got, _ := (Cause{Group: CauseGroupProtocol, Value: c.value}).ValueName(); got != c.name { + t.Errorf("value %d named %q, want %q", c.value, got, c.name) + } + } +} + +func TestCauseMessageNotCompatibleVector(t *testing.T) { + w := per.NewWriter() + + if err := (Cause{Group: CauseGroupProtocol, Value: CauseProtocolMessageNotCompatible}).MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + if want := []byte{0x33}; !bytes.Equal(perBytes(w), want) { + t.Fatalf("cause = % x, want % x", perBytes(w), want) + } +} diff --git a/s1ap/zz_probe_test.go b/s1ap/zz_probe_test.go new file mode 100644 index 0000000000..ba26a309c2 --- /dev/null +++ b/s1ap/zz_probe_test.go @@ -0,0 +1,38 @@ +package s1ap + +import ( + "bytes" + "testing" + + "github.com/ellanetworks/core/per" +) + +func TestZZProbe(t *testing.T) { + for _, c := range loadCorpus(t) { + pdu, _ := Unmarshal(c.b) + codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + if !ok { + continue + } + msg, err := codec(pdu.value()) + if err != nil { + t.Logf("%s REFUSED %v", c.source, err) + continue + } + re, err := msg.Marshal() + if err != nil || !bytes.Equal(re, c.b) { + t.Logf("%s NOTEXACT %v %T", c.source, err, msg) + if err == nil { + ra := per.NewReader(pdu.value()); _, _ = ra.ReadBit(); a, _ := decodeIEContainer(ra, per.Aligned) + p2, _ := Unmarshal(re) + rb := per.NewReader(p2.value()); _, _ = rb.ReadBit(); b, _ := decodeIEContainer(rb, per.Aligned) + var ia, ib []ProtocolIEID + for _, f := range a { ia = append(ia, f.id) } + for _, f := range b { ib = append(ib, f.id) } + t.Logf(" orig %x\n re %x", c.b, re) + t.Logf(" wire %v\n re %v", ia, ib) + for i := range a { for j := range b { if a[i].id == b[j].id && !bytes.Equal(a[i].value, b[j].value) { t.Logf(" IE %v differs\n %x\n %x", a[i].id, a[i].value, b[j].value) } } } + } + } + } +} From b07f94238fac6def895a67b2c56d223d2b025abb Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sat, 14 Nov 2026 06:48:33 -0500 Subject: [PATCH 05/16] fix: review fixes Signed-off-by: Guillaume Belanger --- .../decoder/ngap/amf_configuration_update.go | 128 ++++ internal/decoder/ngap/golden_test.go | 7 +- internal/decoder/ngap/handover.go | 4 + .../ngap/initial_context_setup_request.go | 4 + internal/decoder/ngap/initial_ue_message.go | 17 + internal/decoder/ngap/modeled_ies_test.go | 102 ++++ internal/decoder/ngap/ng_setup.go | 39 +- internal/decoder/ngap/ng_setup_test.go | 2 +- internal/decoder/ngap/ngap.go | 2 + internal/decoder/ngap/path_switch.go | 4 + .../decoder/ngap/ran_configuration_update.go | 4 +- .../ue_tnla_binding_release_request.json | 50 ++ .../decoder/ngap/ue_tnla_binding_release.go | 24 + internal/decoder/ngap/util.go | 7 +- ngap/amf_config_update.go | 95 ++- ngap/amf_config_update_test.go | 286 +++++++++ ngap/enum_encode_test.go | 3 + ngap/enum_names.go | 15 + ngap/enum_names_test.go | 8 + ngap/fuzz_test.go | 7 + ngap/golden_tshark_test.go | 130 ++++ ngap/handover_resource_allocation.go | 24 +- ngap/handover_resource_allocation_test.go | 41 ++ ngap/ie_common.go | 41 ++ ngap/ie_guami.go | 155 ++++- ngap/ie_ids.go | 99 +++ ngap/ie_names.go | 99 +++ ngap/ie_setup.go | 337 +++++++++- ngap/ie_slice.go | 27 + ngap/ie_table.go | 89 ++- ngap/ie_tnl.go | 296 ++++++++- ngap/ie_ue.go | 15 + ngap/ies.go | 8 + ngap/initial_context_setup.go | 22 + ngap/initial_context_setup_test.go | 43 ++ ngap/nas_transport.go | 58 ++ ngap/nas_transport_test.go | 56 ++ ngap/overload.go | 6 +- ngap/parsers.go | 1 + ngap/path_switch.go | 22 + ngap/path_switch_test.go | 31 + ngap/per_gen.go | 577 +++++++++++++----- ngap/raw_pdu_registry_test.go | 8 + ngap/raw_pdu_test.go | 83 ++- ngap/symmetry_test.go | 2 + ngap/table_order_test.go | 16 +- ngap/ue_tnla_binding_release.go | 56 ++ ngap/ue_tnla_binding_release_test.go | 53 ++ ngap/unknown_ie_test.go | 135 +++- ngap/wire_criticality_test.go | 63 ++ ngap/zz_probe_test.go | 38 -- s1ap/ie_table.go | 89 ++- s1ap/ies.go | 8 + s1ap/nas_non_delivery.go | 10 +- s1ap/raw_pdu_test.go | 83 ++- s1ap/ue_capability.go | 10 +- s1ap/unknown_ie_test.go | 117 ++++ s1ap/zz_probe_test.go | 38 -- 58 files changed, 3494 insertions(+), 300 deletions(-) create mode 100644 internal/decoder/ngap/testdata/golden/ue_tnla_binding_release_request.json create mode 100644 internal/decoder/ngap/ue_tnla_binding_release.go create mode 100644 ngap/ue_tnla_binding_release.go create mode 100644 ngap/ue_tnla_binding_release_test.go delete mode 100644 ngap/zz_probe_test.go delete mode 100644 s1ap/zz_probe_test.go diff --git a/internal/decoder/ngap/amf_configuration_update.go b/internal/decoder/ngap/amf_configuration_update.go index e9f2d08e8d..14fe817b33 100644 --- a/internal/decoder/ngap/amf_configuration_update.go +++ b/internal/decoder/ngap/amf_configuration_update.go @@ -5,10 +5,64 @@ package ngap import ( "fmt" + "net" + "strconv" + "github.com/ellanetworks/core/internal/decoder/utils" "github.com/ellanetworks/core/ngap" ) +type AMFTNLAssociation struct { + Address string `json:"address"` + TNLAssociationUsage *utils.EnumField `json:"tnl_association_usage,omitempty"` + WeightFactor *int64 `json:"tnl_address_weight_factor,omitempty"` + NGRANAddress *string `json:"ngran_address,omitempty"` +} + +type ExtendedAMFName struct { + VisibleString *string `json:"amf_name_visible_string,omitempty"` + UTF8String *string `json:"amf_name_utf8_string,omitempty"` +} + +type TNLAssociation struct { + Address string `json:"address"` + Cause Cause `json:"cause"` +} + +func extendedAMFName(n ngap.ExtendedAMFName) ExtendedAMFName { + var out ExtendedAMFName + + if v := n.AMFNameVisibleString; v != nil { + s := string(*v) + out.VisibleString = &s + } + + if v := n.AMFNameUTF8String; v != nil { + s := string(*v) + out.UTF8String = &s + } + + return out +} + +func cpTransportLayerAddress(c ngap.CPTransportLayerInformation) string { + if p := c.EndpointIPAddressAndPort; p != nil { + return net.JoinHostPort(transportLayerAddressToString(p.EndpointIPAddress), strconv.Itoa(int(p.PortNumber))) + } + + return transportLayerAddressToString(c.EndpointIPAddress) +} + +func tnlAssociationUsage(u *ngap.TNLAssociationUsage) *utils.EnumField { + if u == nil { + return nil + } + + e := utils.NamedEnum(uint8(*u), u.Name()) + + return &e +} + func buildAMFConfigurationUpdate(value []byte) NGAPMessageValue { m, err := ngap.ParseAMFConfigurationUpdate(value) if err != nil { @@ -33,6 +87,59 @@ func buildAMFConfigurationUpdate(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDPLMNSupportList, ngap.CriticalityReject, buildPLMNSupportList(m.PLMNSupportList))) } + if len(m.AMFTNLAssociationToAddList) > 0 { + out := make([]AMFTNLAssociation, 0, len(m.AMFTNLAssociationToAddList)) + for _, it := range m.AMFTNLAssociationToAddList { + weight := int64(it.TNLAddressWeightFactor) + out = append(out, AMFTNLAssociation{ + Address: cpTransportLayerAddress(it.AMFTNLAssociationAddress), + TNLAssociationUsage: tnlAssociationUsage(it.TNLAssociationUsage), + WeightFactor: &weight, + }) + } + + ies = append(ies, ie(ngap.IDAMFTNLAssociationToAddList, ngap.CriticalityIgnore, out)) + } + + if len(m.AMFTNLAssociationToRemoveList) > 0 { + out := make([]AMFTNLAssociation, 0, len(m.AMFTNLAssociationToRemoveList)) + for _, it := range m.AMFTNLAssociationToRemoveList { + entry := AMFTNLAssociation{Address: cpTransportLayerAddress(it.AMFTNLAssociationAddress)} + + if ngran := it.TNLAssociationTransportLayerAddressNGRAN; ngran != nil { + addr := cpTransportLayerAddress(*ngran) + entry.NGRANAddress = &addr + } + + out = append(out, entry) + } + + ies = append(ies, ie(ngap.IDAMFTNLAssociationToRemoveList, ngap.CriticalityIgnore, out)) + } + + if len(m.AMFTNLAssociationToUpdateList) > 0 { + out := make([]AMFTNLAssociation, 0, len(m.AMFTNLAssociationToUpdateList)) + for _, it := range m.AMFTNLAssociationToUpdateList { + entry := AMFTNLAssociation{ + Address: cpTransportLayerAddress(it.AMFTNLAssociationAddress), + TNLAssociationUsage: tnlAssociationUsage(it.TNLAssociationUsage), + } + + if it.TNLAddressWeightFactor != nil { + weight := int64(*it.TNLAddressWeightFactor) + entry.WeightFactor = &weight + } + + out = append(out, entry) + } + + ies = append(ies, ie(ngap.IDAMFTNLAssociationToUpdateList, ngap.CriticalityIgnore, out)) + } + + if m.ExtendedAMFName != nil { + ies = append(ies, ie(ngap.IDExtendedAMFName, ngap.CriticalityIgnore, extendedAMFName(*m.ExtendedAMFName))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } @@ -44,6 +151,27 @@ func buildAMFConfigurationUpdateAcknowledge(value []byte) NGAPMessageValue { var ies []IE + if len(m.AMFTNLAssociationSetupList) > 0 { + out := make([]AMFTNLAssociation, 0, len(m.AMFTNLAssociationSetupList)) + for _, it := range m.AMFTNLAssociationSetupList { + out = append(out, AMFTNLAssociation{Address: cpTransportLayerAddress(it.AMFTNLAssociationAddress)}) + } + + ies = append(ies, ie(ngap.IDAMFTNLAssociationSetupList, ngap.CriticalityIgnore, out)) + } + + if len(m.AMFTNLAssociationFailedToSetupList) > 0 { + out := make([]TNLAssociation, 0, len(m.AMFTNLAssociationFailedToSetupList)) + for _, it := range m.AMFTNLAssociationFailedToSetupList { + out = append(out, TNLAssociation{ + Address: cpTransportLayerAddress(it.TNLAssociationAddress), + Cause: cause(it.Cause), + }) + } + + ies = append(ies, ie(ngap.IDAMFTNLAssociationFailedToSetupList, ngap.CriticalityIgnore, out)) + } + if m.CriticalityDiagnostics != nil { ies = append(ies, ie(ngap.IDCriticalityDiagnostics, ngap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) } diff --git a/internal/decoder/ngap/golden_test.go b/internal/decoder/ngap/golden_test.go index 7ac608e3b3..bec6f26381 100644 --- a/internal/decoder/ngap/golden_test.go +++ b/internal/decoder/ngap/golden_test.go @@ -539,6 +539,11 @@ func goldenCorpus(t *testing.T) map[string][]byte { }, }) + corpus["ue_tnla_binding_release_request"] = mustMarshal(t, &lib.UETNLABindingReleaseRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + }) + corpus["location_report_full"] = mustMarshal(t, &lib.LocationReport{ AMFUENGAPID: 1, RANUENGAPID: 2, @@ -649,7 +654,7 @@ func TestGoldenCoversEveryRenderedProcedure(t *testing.T) { lib.ProcUplinkNASTransport, lib.ProcInitialContextSetup, lib.ProcPDUSessionResourceSetup, lib.ProcUEContextReleaseRequest, lib.ProcUEContextRelease, lib.ProcUEContextModification, lib.ProcPDUSessionResourceRelease, - lib.ProcUERadioCapabilityInfoIndication, lib.ProcAMFStatusIndication, + lib.ProcUERadioCapabilityInfoIndication, lib.ProcUETNLABindingRelease, lib.ProcAMFStatusIndication, lib.ProcPaging, lib.ProcDownlinkUEAssociatedNRPPaTransport, lib.ProcUplinkUEAssociatedNRPPaTransport, lib.ProcDownlinkNonUEAssociatedNRPPaTransport, diff --git a/internal/decoder/ngap/handover.go b/internal/decoder/ngap/handover.go index 2ea2064363..ee4bbd696e 100644 --- a/internal/decoder/ngap/handover.go +++ b/internal/decoder/ngap/handover.go @@ -538,6 +538,10 @@ func buildHandoverRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDGUAMI, ngap.CriticalityReject, guami(m.GUAMI))) + if m.AMFUENGAPID2 != nil { + ies = append(ies, ie(ngap.IDAMFUENGAPID2, ngap.CriticalityIgnore, int64(*m.AMFUENGAPID2))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/initial_context_setup_request.go b/internal/decoder/ngap/initial_context_setup_request.go index 700a348ab5..5cd311bcd6 100644 --- a/internal/decoder/ngap/initial_context_setup_request.go +++ b/internal/decoder/ngap/initial_context_setup_request.go @@ -198,6 +198,10 @@ func buildInitialContextSetupRequest(value []byte) NGAPMessageValue { ueRadioCapabilityForPaging(*m.UERadioCapabilityForPaging))) } + if m.AMFUENGAPID2 != nil { + ies = append(ies, ie(ngap.IDAMFUENGAPID2, ngap.CriticalityIgnore, int64(*m.AMFUENGAPID2))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/initial_ue_message.go b/internal/decoder/ngap/initial_ue_message.go index 5b07e0b507..e9c8c87a22 100644 --- a/internal/decoder/ngap/initial_ue_message.go +++ b/internal/decoder/ngap/initial_ue_message.go @@ -102,6 +102,23 @@ func buildInitialUEMessage(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDAllowedNSSAI, ngap.CriticalityReject, slices)) } + if m.GUAMI != nil { + ies = append(ies, ie(ngap.IDGUAMI, ngap.CriticalityIgnore, guami(*m.GUAMI))) + } + + if m.GUAMIType != nil { + ies = append(ies, ie(ngap.IDGUAMIType, ngap.CriticalityIgnore, utils.NamedEnum(uint8(*m.GUAMIType), m.GUAMIType.Name()))) + } + + if len(m.RequestedNSSAI) > 0 { + slices := make([]SNSSAI, 0, len(m.RequestedNSSAI)) + for _, item := range m.RequestedNSSAI { + slices = append(slices, buildSNSSAIValue(item.SNSSAI)) + } + + ies = append(ies, ie(ngap.IDRequestedNSSAI, ngap.CriticalityIgnore, slices)) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/modeled_ies_test.go b/internal/decoder/ngap/modeled_ies_test.go index d9f98985b2..a26cbb5910 100644 --- a/internal/decoder/ngap/modeled_ies_test.go +++ b/internal/decoder/ngap/modeled_ies_test.go @@ -40,11 +40,69 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { TraceCollectionEntityIPAddress: lib.TransportLayerAddress{10, 0, 0, 1}, }, }), + "amf_configuration_update_tnl_and_extended_name": mustMarshal(t, &lib.AMFConfigurationUpdate{ + AMFTNLAssociationToAddList: lib.AMFTNLAssociationToAddList{{ + AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddressAndPort: &lib.EndpointIPAddressAndPort{ + EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 3}, PortNumber: 38412, + }}, + TNLAssociationUsage: lib.Ptr(lib.TNLAssociationUsageBoth), + TNLAddressWeightFactor: 1, + }}, + AMFTNLAssociationToRemoveList: lib.AMFTNLAssociationToRemoveList{{ + AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 4}}, + TNLAssociationTransportLayerAddressNGRAN: &lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 1, 4}}, + }}, + AMFTNLAssociationToUpdateList: lib.AMFTNLAssociationToUpdateList{{ + AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 2}}, + }}, + ExtendedAMFName: &lib.ExtendedAMFName{AMFNameUTF8String: lib.Ptr(lib.AMFNameUTF8String("ella"))}, + }), + "initial_context_setup_request_amf_ue_ngap_id_2": mustMarshal(t, &lib.InitialContextSetupRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + GUAMI: guamis[0].GUAMI, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + SecurityKey: key, + AMFUENGAPID2: lib.Ptr(lib.AMFUENGAPID(9)), + }), + "path_switch_request_acknowledge_amf_ue_ngap_id_2": mustMarshal(t, &lib.PathSwitchRequestAcknowledge{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), + RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), + PDUSessionResourceSwitchedList: lib.PDUSessionResourceSwitchedList{{PDUSessionID: 5, Transfer: lib.TransferContainer{0x00}}}, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + AMFUENGAPID2: lib.Ptr(lib.AMFUENGAPID(9)), + }), + "initial_ue_message_guami_type_requested_nssai": mustMarshal(t, &lib.InitialUEMessage{ + RANUENGAPID: 1, + NASPDU: lib.NASPDU{0x7e, 0x00}, + UserLocationInformation: lib.UserLocationInformation{Kind: lib.UserLocationNR, PLMNIdentity: testPLMN, TAI: testTAI}, + RRCEstablishmentCause: lib.Ptr(lib.RRCCauseMOSignalling), + GUAMI: &guamis[0].GUAMI, + GUAMIType: lib.Ptr(lib.GUAMITypeMapped), + RequestedNSSAI: lib.RequestedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + }), "ue_context_modification_request_new_amf_ue_ngap_id": mustMarshal(t, &lib.UEContextModificationRequest{ AMFUENGAPID: 1, RANUENGAPID: 2, NewAMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(3)), }), + "amf_configuration_update_acknowledge_tnl_lists": mustMarshal(t, &lib.AMFConfigurationUpdateAcknowledge{ + AMFTNLAssociationSetupList: lib.AMFTNLAssociationSetupList{{ + AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 2}}, + }}, + AMFTNLAssociationFailedToSetupList: lib.TNLAssociationList{{ + TNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 5}}, + Cause: lib.Cause{Group: lib.CauseGroupTransport, Value: lib.CauseTransportResourceUnavailable}, + }}, + }), + "amf_configuration_update_served_guami_extensions": mustMarshal(t, &lib.AMFConfigurationUpdate{ + ServedGUAMIList: lib.ServedGUAMIList{{ + GUAMI: guamis[0].GUAMI, + BackupAMFName: lib.Ptr(lib.Name("backup")), + GUAMIType: lib.Ptr(lib.GUAMITypeMapped), + ExtendedBackupAMFName: &lib.ExtendedAMFName{AMFNameVisibleString: lib.Ptr(lib.AMFNameVisibleString("backup-extended"))}, + }}, + }), "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &lib.UEContextReleaseRequest{ AMFUENGAPID: 1, RANUENGAPID: 2, @@ -88,3 +146,47 @@ func TestDecodeNGAPMessage_OverloadStopGUAMIList(t *testing.T) { t.Fatalf("GUAMI List = %+v", msg.Value.IEs[0].Value) } } + +func TestDecodeNGAPMessage_AMFConfigurationUpdateAcknowledgeTNLLists(t *testing.T) { + msg := DecodeNGAPMessage(modeledIEsCorpus(t)["amf_configuration_update_acknowledge_tnl_lists"]) + + if len(msg.Value.IEs) != 2 { + t.Fatalf("IEs = %+v, want the setup and failed-to-setup lists", msg.Value.IEs) + } + + setup, ok := msg.Value.IEs[0].Value.([]AMFTNLAssociation) + if !ok || msg.Value.IEs[0].ID.Value != int64(lib.IDAMFTNLAssociationSetupList) || len(setup) != 1 || setup[0].Address != "10.0.0.2" { + t.Fatalf("setup list = %+v", msg.Value.IEs[0]) + } + + failed, ok := msg.Value.IEs[1].Value.([]TNLAssociation) + if !ok || msg.Value.IEs[1].ID.Value != int64(lib.IDAMFTNLAssociationFailedToSetupList) || len(failed) != 1 || failed[0].Address != "10.0.0.5" { + t.Fatalf("failed list = %+v", msg.Value.IEs[1]) + } + + if failed[0].Cause != cause(lib.Cause{Group: lib.CauseGroupTransport, Value: lib.CauseTransportResourceUnavailable}) { + t.Fatalf("cause = %+v", failed[0].Cause) + } +} + +func TestDecodeNGAPMessage_ServedGUAMIExtensions(t *testing.T) { + msg := DecodeNGAPMessage(modeledIEsCorpus(t)["amf_configuration_update_served_guami_extensions"]) + + list, ok := msg.Value.IEs[0].Value.([]ServedGUAMI) + if !ok || len(list) != 1 { + t.Fatalf("Served GUAMI List = %+v", msg.Value.IEs[0].Value) + } + + got := list[0] + if got.AMFRegionID == "" || got.BackupAMFName == nil || *got.BackupAMFName != "backup" { + t.Fatalf("served GUAMI = %+v", got) + } + + if got.GUAMIType == nil || got.GUAMIType.Value != int64(lib.GUAMITypeMapped) { + t.Fatalf("GUAMI Type = %+v", got.GUAMIType) + } + + if got.ExtendedBackupAMFName == nil || got.ExtendedBackupAMFName.VisibleString == nil || *got.ExtendedBackupAMFName.VisibleString != "backup-extended" { + t.Fatalf("Extended Backup AMF Name = %+v", got.ExtendedBackupAMFName) + } +} diff --git a/internal/decoder/ngap/ng_setup.go b/internal/decoder/ngap/ng_setup.go index c24d0ace1a..cea7e23197 100644 --- a/internal/decoder/ngap/ng_setup.go +++ b/internal/decoder/ngap/ng_setup.go @@ -154,10 +154,32 @@ func guami(g ngap.GUAMI) Guami { } } -func buildServedGUAMIList(list ngap.ServedGUAMIList) []Guami { - out := make([]Guami, len(list)) +type ServedGUAMI struct { + Guami + BackupAMFName *string `json:"backup_amf_name,omitempty"` + GUAMIType *utils.EnumField `json:"guami_type,omitempty"` + ExtendedBackupAMFName *ExtendedAMFName `json:"extended_backup_amf_name,omitempty"` +} + +func buildServedGUAMIList(list ngap.ServedGUAMIList) []ServedGUAMI { + out := make([]ServedGUAMI, len(list)) for i, item := range list { - out[i] = guami(item.GUAMI) + out[i] = ServedGUAMI{Guami: guami(item.GUAMI)} + + if item.BackupAMFName != nil { + name := string(*item.BackupAMFName) + out[i].BackupAMFName = &name + } + + if item.GUAMIType != nil { + t := utils.NamedEnum(uint8(*item.GUAMIType), item.GUAMIType.Name()) + out[i].GUAMIType = &t + } + + if item.ExtendedBackupAMFName != nil { + name := extendedAMFName(*item.ExtendedBackupAMFName) + out[i].ExtendedBackupAMFName = &name + } } return out @@ -171,8 +193,15 @@ func buildPLMNSupportList(list ngap.PLMNSupportList) []PLMN { out := make([]PLMN, len(list)) for i, item := range list { out[i] = PLMN{ - PLMNID: plmnIDToDecoder(item.PLMNIdentity), - SliceSupportList: buildSliceSupportList(item.SliceSupportList), + PLMNID: plmnIDToDecoder(item.PLMNIdentity), + SliceSupportList: buildSliceSupportList(item.SliceSupportList), + ExtendedSliceSupportList: buildSliceSupportList(ngap.SliceSupportList(item.ExtendedSliceSupportList)), + OnboardingSupport: item.OnboardingSupport != nil, + } + + if item.NPNSupport != nil { + nid := bitsHex(uint64(item.NPNSupport.SNPN), 44) + out[i].NPNSupportNID = &nid } } diff --git a/internal/decoder/ngap/ng_setup_test.go b/internal/decoder/ngap/ng_setup_test.go index d6c3934ce3..cc1f7de9e5 100644 --- a/internal/decoder/ngap/ng_setup_test.go +++ b/internal/decoder/ngap/ng_setup_test.go @@ -228,7 +228,7 @@ func TestDecodeNGAPMessage_NGSetupResponse(t *testing.T) { t.Errorf("Criticality = %v, want reject", item1.Criticality) } - servedGUAMIList, ok := item1.Value.([]Guami) + servedGUAMIList, ok := item1.Value.([]ServedGUAMI) if !ok { t.Fatalf("expected ServedGUAMIList, got %T", item1.Value) } diff --git a/internal/decoder/ngap/ngap.go b/internal/decoder/ngap/ngap.go index 368559fbc2..7e96da347e 100644 --- a/internal/decoder/ngap/ngap.go +++ b/internal/decoder/ngap/ngap.go @@ -144,6 +144,8 @@ func buildInitiatingMessage(m *ngap.InitiatingMessage) NGAPMessageValue { return buildPDUSessionResourceReleaseCommand(m.Value) case ngap.ProcUERadioCapabilityInfoIndication: return buildUERadioCapabilityInfoIndication(m.Value) + case ngap.ProcUETNLABindingRelease: + return buildUETNLABindingReleaseRequest(m.Value) case ngap.ProcAMFStatusIndication: return buildAMFStatusIndication(m.Value) case ngap.ProcPaging: diff --git a/internal/decoder/ngap/path_switch.go b/internal/decoder/ngap/path_switch.go index 2f7337c541..0013e9327c 100644 --- a/internal/decoder/ngap/path_switch.go +++ b/internal/decoder/ngap/path_switch.go @@ -256,6 +256,10 @@ func buildPathSwitchRequestAcknowledge(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDCriticalityDiagnostics, ngap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) } + if m.AMFUENGAPID2 != nil { + ies = append(ies, ie(ngap.IDAMFUENGAPID2, ngap.CriticalityIgnore, int64(*m.AMFUENGAPID2))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/ran_configuration_update.go b/internal/decoder/ngap/ran_configuration_update.go index d1ae8c92cf..3132373954 100644 --- a/internal/decoder/ngap/ran_configuration_update.go +++ b/internal/decoder/ngap/ran_configuration_update.go @@ -52,11 +52,11 @@ func buildRANConfigurationUpdate(value []byte) NGAPMessageValue { for _, it := range m.NGRANTNLAssociationToRemoveList { entry := NGRANTNLAssociationToRemove{ - TNLAssociationTransportLayerAddress: transportLayerAddressToString(it.TNLAssociationTransportLayerAddress.EndpointIPAddress), + TNLAssociationTransportLayerAddress: cpTransportLayerAddress(it.TNLAssociationTransportLayerAddress), } if amf := it.TNLAssociationTransportLayerAddressAMF; amf != nil { - addr := transportLayerAddressToString(amf.EndpointIPAddress) + addr := cpTransportLayerAddress(*amf) entry.TNLAssociationTransportLayerAddressAMF = &addr } diff --git a/internal/decoder/ngap/testdata/golden/ue_tnla_binding_release_request.json b/internal/decoder/ngap/testdata/golden/ue_tnla_binding_release_request.json new file mode 100644 index 0000000000..2cde6acea3 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/ue_tnla_binding_release_request.json @@ -0,0 +1,50 @@ +{ + "summary": "UETNLABindingRelease, AMF-UE=1, RAN-UE=2", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 45, + "label": "UETNLABindingRelease", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 10, + "label": "AMF-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 85, + "label": "RAN-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + } + ] + } +} diff --git a/internal/decoder/ngap/ue_tnla_binding_release.go b/internal/decoder/ngap/ue_tnla_binding_release.go new file mode 100644 index 0000000000..d43fb89da3 --- /dev/null +++ b/internal/decoder/ngap/ue_tnla_binding_release.go @@ -0,0 +1,24 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "fmt" + + "github.com/ellanetworks/core/ngap" +) + +func buildUETNLABindingReleaseRequest(value []byte) NGAPMessageValue { + m, err := ngap.ParseUETNLABindingReleaseRequest(value) + if err != nil { + return NGAPMessageValue{Error: fmt.Sprintf("parse UE TNLA Binding Release Request: %v", err)} + } + + ies := []IE{ + ie(ngap.IDAMFUENGAPID, ngap.CriticalityReject, int64(m.AMFUENGAPID)), + ie(ngap.IDRANUENGAPID, ngap.CriticalityReject, int64(m.RANUENGAPID)), + } + + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} +} diff --git a/internal/decoder/ngap/util.go b/internal/decoder/ngap/util.go index d86d23bc51..3403b88b5a 100644 --- a/internal/decoder/ngap/util.go +++ b/internal/decoder/ngap/util.go @@ -94,8 +94,11 @@ type CriticalityDiagnosticsIE struct { } type PLMN struct { - PLMNID PLMNID `json:"plmn_id"` - SliceSupportList []SNSSAI `json:"slice_support_list,omitempty"` + PLMNID PLMNID `json:"plmn_id"` + SliceSupportList []SNSSAI `json:"slice_support_list,omitempty"` + NPNSupportNID *string `json:"npn_support_nid,omitempty"` + ExtendedSliceSupportList []SNSSAI `json:"extended_slice_support_list,omitempty"` + OnboardingSupport bool `json:"onboarding_support,omitempty"` } // ranNodeIDHex renders a RAN node identifier as the hex digits its bit length diff --git a/ngap/amf_config_update.go b/ngap/amf_config_update.go index 4fa8bba09e..fef5104f16 100644 --- a/ngap/amf_config_update.go +++ b/ngap/amf_config_update.go @@ -13,6 +13,11 @@ type AMFConfigurationUpdate struct { RelativeAMFCapacity *uint8 PLMNSupportList PLMNSupportList + AMFTNLAssociationToAddList AMFTNLAssociationToAddList + AMFTNLAssociationToRemoveList AMFTNLAssociationToRemoveList + AMFTNLAssociationToUpdateList AMFTNLAssociationToUpdateList + ExtendedAMFName *ExtendedAMFName + messageMeta } @@ -88,6 +93,66 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ return m.PLMNSupportList, true }, }, + { + id: IDAMFTNLAssociationToAddList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AMFTNLAssociationToAddList) + }, + encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + if len(m.AMFTNLAssociationToAddList) == 0 { + return nil, false + } + + return m.AMFTNLAssociationToAddList, true + }, + }, + { + id: IDAMFTNLAssociationToRemoveList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AMFTNLAssociationToRemoveList) + }, + encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + if len(m.AMFTNLAssociationToRemoveList) == 0 { + return nil, false + } + + return m.AMFTNLAssociationToRemoveList, true + }, + }, + { + id: IDAMFTNLAssociationToUpdateList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AMFTNLAssociationToUpdateList) + }, + encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + if len(m.AMFTNLAssociationToUpdateList) == 0 { + return nil, false + } + + return m.AMFTNLAssociationToUpdateList, true + }, + }, + { + id: IDExtendedAMFName, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { + var v ExtendedAMFName + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.ExtendedAMFName = &v + + return nil + }, + encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + if m.ExtendedAMFName == nil { + return nil, false + } + + return m.ExtendedAMFName, true + }, + }, } func (m *AMFConfigurationUpdate) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -115,12 +180,40 @@ func ParseAMFConfigurationUpdate(value []byte) (*AMFConfigurationUpdate, error) } type AMFConfigurationUpdateAcknowledge struct { - CriticalityDiagnostics *CriticalityDiagnostics + AMFTNLAssociationSetupList AMFTNLAssociationSetupList + AMFTNLAssociationFailedToSetupList TNLAssociationList + CriticalityDiagnostics *CriticalityDiagnostics messageMeta } var aMFConfigurationUpdateAcknowledgeIEs = []ieSpec[AMFConfigurationUpdateAcknowledge]{ + { + id: IDAMFTNLAssociationSetupList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *AMFConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AMFTNLAssociationSetupList) + }, + encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + if len(m.AMFTNLAssociationSetupList) == 0 { + return nil, false + } + + return m.AMFTNLAssociationSetupList, true + }, + }, + { + id: IDAMFTNLAssociationFailedToSetupList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *AMFConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AMFTNLAssociationFailedToSetupList) + }, + encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + if len(m.AMFTNLAssociationFailedToSetupList) == 0 { + return nil, false + } + + return m.AMFTNLAssociationFailedToSetupList, true + }, + }, { id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, decode: func(m *AMFConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { diff --git a/ngap/amf_config_update_test.go b/ngap/amf_config_update_test.go index 8e94ced6e4..5638813898 100644 --- a/ngap/amf_config_update_test.go +++ b/ngap/amf_config_update_test.go @@ -4,8 +4,13 @@ package ngap import ( + "bytes" + "errors" + "reflect" "strings" "testing" + + "github.com/ellanetworks/core/per" ) func TestAMFConfigurationUpdateRoundTrips(t *testing.T) { @@ -179,3 +184,284 @@ func TestAMFConfigurationUpdateUnsetPLMNSupportListLeavesEncodingUnchanged(t *te t.Fatalf("PLMN Support List encoded while unset: %s", got) } } + +func goldAMFConfigurationUpdateRelay() *AMFConfigurationUpdate { + m := goldAMFConfigurationUpdatePLMNSupport() + m.PLMNSupportList[0].NPNSupport = &NPNSupport{SNPN: 0x123456789ab} + m.PLMNSupportList[0].ExtendedSliceSupportList = ExtendedSliceSupportList{{SNSSAI: SNSSAI{SST: 3, SD: &SD{0x00, 0x00, 0x02}}}} + m.PLMNSupportList[1].OnboardingSupport = Ptr(OnboardingSupportTrue) + m.AMFTNLAssociationToAddList = AMFTNLAssociationToAddList{ + { + AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 2}}, + TNLAssociationUsage: Ptr(TNLAssociationUsageBoth), + TNLAddressWeightFactor: 255, + }, + { + AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddressAndPort: &EndpointIPAddressAndPort{ + EndpointIPAddress: TransportLayerAddress{10, 0, 0, 3}, PortNumber: 38412, + }}, + TNLAddressWeightFactor: 1, + }, + } + m.AMFTNLAssociationToRemoveList = AMFTNLAssociationToRemoveList{{ + AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 4}}, + TNLAssociationTransportLayerAddressNGRAN: &CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 1, 4}}, + }} + m.AMFTNLAssociationToUpdateList = AMFTNLAssociationToUpdateList{{ + AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 2}}, + TNLAssociationUsage: Ptr(TNLAssociationUsageNonUE), + TNLAddressWeightFactor: Ptr(TNLAddressWeightFactor(7)), + }} + m.ExtendedAMFName = &ExtendedAMFName{ + AMFNameVisibleString: Ptr(AMFNameVisibleString("ella-amf-extended")), + AMFNameUTF8String: Ptr(AMFNameUTF8String("ella-amf-ü")), + } + + return m +} + +func amfConfigurationUpdateWireCases(t *testing.T) []wireCase { + t.Helper() + + return []wireCase{{ + name: "AMFConfigurationUpdateTNLListsExtendedAMFNamePLMNExtensions", + pdu: marshalT(t, goldAMFConfigurationUpdateRelay()), + parse: func(v []byte) (any, error) { return ParseAMFConfigurationUpdate(v) }, + check: func(t *testing.T, a any) { + t.Helper() + + if !reflect.DeepEqual(a, goldAMFConfigurationUpdateRelay()) { + t.Fatalf("decoded\n got %+v\n want %+v", a, goldAMFConfigurationUpdateRelay()) + } + }, + }} +} + +func TestPLMNSupportItemUnknownExtensionKeepsItsPosition(t *testing.T) { + item := goldAMFConfigurationUpdateRelay().PLMNSupportList[0] + item.iEExtensions = messageMeta{ + unknownIEs: []rawIE{{id: 9999, crit: CriticalityIgnore, value: []byte{0x5a}}}, + wire: []wireSlot{ + {id: IDNPNSupport, crit: CriticalityReject, unknown: -1}, + {id: 9999, crit: CriticalityIgnore, unknown: 0}, + {id: IDExtendedSliceSupportList, crit: CriticalityReject, unknown: -1}, + }, + } + + m := &AMFConfigurationUpdate{PLMNSupportList: PLMNSupportList{item}} + pdu := marshalT(t, m) + + p, err := Unmarshal(pdu) + if err != nil { + t.Fatal(err) + } + + out, err := ParseAMFConfigurationUpdate(p.value()) + if err != nil { + t.Fatal(err) + } + + got := out.PLMNSupportList[0] + if got.NPNSupport == nil || len(got.ExtendedSliceSupportList) != 1 || len(got.iEExtensions.unknownIEs) != 1 { + t.Fatalf("decoded %+v", got) + } + + if re := marshalT(t, out); !bytes.Equal(re, pdu) { + t.Fatalf("re-encoded\n got %x\n want %x", re, pdu) + } +} + +func TestPLMNSupportItemUnknownRejectExtensionRejectsProcedure(t *testing.T) { + item := goldAMFConfigurationUpdateRelay().PLMNSupportList[1] + item.iEExtensions = messageMeta{unknownIEs: []rawIE{{id: 9999, crit: CriticalityReject, value: []byte{0x5a}}}} + + p, err := Unmarshal(marshalT(t, &AMFConfigurationUpdate{PLMNSupportList: PLMNSupportList{item}})) + if err != nil { + t.Fatal(err) + } + + _, err = ParseAMFConfigurationUpdate(p.value()) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) || len(ase.IEs) != 1 || ase.IEs[0].IEID != 9999 { + t.Fatalf("err = %v, want the unknown reject extension reported", err) + } +} + +func TestAMFTNLAssociationToRemoveItemNGRANAddressIsComprehended(t *testing.T) { + m := &AMFConfigurationUpdate{AMFTNLAssociationToRemoveList: goldAMFConfigurationUpdateRelay().AMFTNLAssociationToRemoveList} + pdu := marshalT(t, m) + + p, err := Unmarshal(pdu) + if err != nil { + t.Fatal(err) + } + + out, err := ParseAMFConfigurationUpdate(p.value()) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, m) { + t.Fatalf("decoded %+v, want %+v", out, m) + } +} + +func goldAMFConfigurationUpdateAcknowledgeTNL() *AMFConfigurationUpdateAcknowledge { + return &AMFConfigurationUpdateAcknowledge{ + AMFTNLAssociationSetupList: AMFTNLAssociationSetupList{ + {AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 2}}}, + {AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddressAndPort: &EndpointIPAddressAndPort{ + EndpointIPAddress: TransportLayerAddress{10, 0, 0, 3}, PortNumber: 38412, + }}}, + }, + AMFTNLAssociationFailedToSetupList: TNLAssociationList{{ + TNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 5}}, + Cause: Cause{Group: CauseGroupTransport, Value: CauseTransportResourceUnavailable}, + }}, + CriticalityDiagnostics: &CriticalityDiagnostics{ + ProcedureCode: Ptr(ProcAMFConfigurationUpdate), + TriggeringMessage: Ptr(TriggeringInitiatingMessage), + }, + } +} + +func goldAMFConfigurationUpdateServedGUAMIExtensions() *AMFConfigurationUpdate { + m := &AMFConfigurationUpdate{ServedGUAMIList: goldResponse().ServedGUAMIList} + m.ServedGUAMIList[0].BackupAMFName = Ptr(Name("ella-amf-b")) + m.ServedGUAMIList[0].GUAMIType = Ptr(GUAMITypeMapped) + m.ServedGUAMIList[0].ExtendedBackupAMFName = &ExtendedAMFName{ + AMFNameVisibleString: Ptr(AMFNameVisibleString("ella-amf-backup-extended")), + } + + return m +} + +func amfConfigurationUpdateAcknowledgeGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{ + { + "AMFConfigurationUpdateAcknowledgeTNLLists", + goldAMFConfigurationUpdateAcknowledgeTNL(), + func(v []byte) (any, error) { return ParseAMFConfigurationUpdateAcknowledge(v) }, + "2000002e00000300054014080f800a0000022000a9000807c00a000003960c00044008000f800a0000052000134003600000", + }, + { + "AMFConfigurationUpdateServedGUAMIExtensions", + goldAMFConfigurationUpdateServedGUAMIExtensions(), + func(v []byte) (any, error) { return ParseAMFConfigurationUpdate(v) }, + "0000004000000100600039006002f8390200430480656c6c612d616d662d62000100b040014001ba401a40b8656c6c612d616d662d6261636b75702d657874656e646564", + }, + } +} + +func TestAMFConfigurationUpdateAcknowledgeTNLListsGolden(t *testing.T) { + for _, c := range amfConfigurationUpdateAcknowledgeGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} + +func tnlAssociationItemWithRawExtension(t *testing.T) []byte { + t.Helper() + + w := per.NewWriter() + mustNil(t, per.EncodeLength(w, per.Aligned, 1, maxnoofTNLAssociations, true, 1, func(int64) error { + w.WriteBit(false) + w.WriteBit(true) + + addr := CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 5}} + if err := addr.MarshalPER(w, per.Aligned); err != nil { + return err + } + + cause := Cause{Group: CauseGroupTransport, Value: CauseTransportUnspecified} + if err := cause.MarshalPER(w, per.Aligned); err != nil { + return err + } + + return encodeExtensionContainer(w, per.Aligned, []ieField{{id: 9999, crit: CriticalityIgnore, raw: []byte{0x5a}}}) + })) + w.AlignToByte() + + return w.Bytes() +} + +func TestTNLAssociationItemRawExtensionRoundTrips(t *testing.T) { + value := container(t, + ieField{id: IDAMFTNLAssociationFailedToSetupList, crit: CriticalityIgnore, raw: tnlAssociationItemWithRawExtension(t)}, + ) + + out, err := ParseAMFConfigurationUpdateAcknowledge(value) + if err != nil { + t.Fatal(err) + } + + if len(out.AMFTNLAssociationFailedToSetupList) != 1 || out.AMFTNLAssociationFailedToSetupList[0].iEExtensions == nil { + t.Fatalf("decoded %+v", out) + } + + if got := out.AMFTNLAssociationFailedToSetupList[0].Cause; got.Group != CauseGroupTransport || got.Value != CauseTransportUnspecified { + t.Fatalf("cause = %+v", got) + } + + w := per.NewWriter() + mustNil(t, out.encodeBody(w, per.Aligned)) + w.AlignToByte() + + if !bytes.Equal(w.Bytes(), value) { + t.Fatalf("re-encoded\n got %x\n want %x", w.Bytes(), value) + } +} + +func TestServedGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { + item := goldAMFConfigurationUpdateServedGUAMIExtensions().ServedGUAMIList[0] + item.iEExtensions = messageMeta{ + unknownIEs: []rawIE{{id: 9999, crit: CriticalityIgnore, value: []byte{0x5a}}}, + wire: []wireSlot{ + {id: IDGUAMIType, crit: CriticalityIgnore, unknown: -1}, + {id: 9999, crit: CriticalityIgnore, unknown: 0}, + {id: IDExtendedBackupAMFName, crit: CriticalityIgnore, unknown: -1}, + }, + } + + pdu := marshalT(t, &AMFConfigurationUpdate{ServedGUAMIList: ServedGUAMIList{item}}) + + p, err := Unmarshal(pdu) + if err != nil { + t.Fatal(err) + } + + out, err := ParseAMFConfigurationUpdate(p.value()) + if err != nil { + t.Fatal(err) + } + + got := out.ServedGUAMIList[0] + if got.GUAMIType == nil || got.ExtendedBackupAMFName == nil || len(got.iEExtensions.unknownIEs) != 1 { + t.Fatalf("decoded %+v", got) + } + + if !reflect.DeepEqual(got.iEExtensions.wire, item.iEExtensions.wire) { + t.Fatalf("wire order %+v, want %+v", got.iEExtensions.wire, item.iEExtensions.wire) + } + + if re := marshalT(t, out); !bytes.Equal(re, pdu) { + t.Fatalf("re-encoded\n got %x\n want %x", re, pdu) + } +} + +func TestServedGUAMIItemUnknownRejectExtensionRejectsProcedure(t *testing.T) { + item := goldResponse().ServedGUAMIList[0] + item.iEExtensions = messageMeta{unknownIEs: []rawIE{{id: 9999, crit: CriticalityReject, value: []byte{0x5a}}}} + + p, err := Unmarshal(marshalT(t, &AMFConfigurationUpdate{ServedGUAMIList: ServedGUAMIList{item}})) + if err != nil { + t.Fatal(err) + } + + _, err = ParseAMFConfigurationUpdate(p.value()) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) || len(ase.IEs) != 1 || ase.IEs[0].IEID != 9999 { + t.Fatalf("err = %v, want the unknown reject extension reported", err) + } +} diff --git a/ngap/enum_encode_test.go b/ngap/enum_encode_test.go index 432a128127..67a741b917 100644 --- a/ngap/enum_encode_test.go +++ b/ngap/enum_encode_test.go @@ -24,6 +24,9 @@ func TestEnumOutsideRootIsNotEncoded(t *testing.T) { {"RRCEstablishmentCause", rrcEstablishmentCauseRootCount, func(v int64) per.Marshaler { return RRCEstablishmentCause(v) }}, {"UEContextRequest", ueContextRequestRootCount, func(v int64) per.Marshaler { return UEContextRequest(v) }}, {"GWContextReleaseIndication", gwContextReleaseIndicationRootCount, func(v int64) per.Marshaler { return GWContextReleaseIndication(v) }}, + {"GUAMIType", guamiTypeRootCount, func(v int64) per.Marshaler { return GUAMIType(v) }}, + {"TNLAssociationUsage", tnlAssociationUsageRootCount, func(v int64) per.Marshaler { return TNLAssociationUsage(v) }}, + {"OnboardingSupport", onboardingSupportRootCount, func(v int64) per.Marshaler { return OnboardingSupport(v) }}, {"UERetentionInformation", ueRetentionInformationRootCount, func(v int64) per.Marshaler { return UERetentionInformation(v) }}, {"TimerApproachForGUAMIRemoval", timerApproachForGUAMIRemovalRootCount, func(v int64) per.Marshaler { return TimerApproachForGUAMIRemoval(v) }}, } diff --git a/ngap/enum_names.go b/ngap/enum_names.go index b5c75875cb..a5f2a577a8 100644 --- a/ngap/enum_names.go +++ b/ngap/enum_names.go @@ -152,3 +152,18 @@ var cancelAllWarningMessagesNames = map[CancelAllWarningMessages]string{ } func (c CancelAllWarningMessages) Name() string { return cancelAllWarningMessagesNames[c] } + +var guamiTypeNames = map[GUAMIType]string{ + GUAMITypeNative: "native", + GUAMITypeMapped: "mapped", +} + +func (g GUAMIType) Name() string { return guamiTypeNames[g] } + +var tnlAssociationUsageNames = map[TNLAssociationUsage]string{ + TNLAssociationUsageUE: "ue", + TNLAssociationUsageNonUE: "non-ue", + TNLAssociationUsageBoth: "both", +} + +func (u TNLAssociationUsage) Name() string { return tnlAssociationUsageNames[u] } diff --git a/ngap/enum_names_test.go b/ngap/enum_names_test.go index 4ec323555e..757802a9d9 100644 --- a/ngap/enum_names_test.go +++ b/ngap/enum_names_test.go @@ -39,6 +39,14 @@ func TestEnumNames(t *testing.T) { {"UEContextRequested", UEContextRequested.Name(), "requested"}, {"UEContextRequest(9)", UEContextRequest(9).Name(), ""}, + {"GUAMITypeNative", GUAMITypeNative.Name(), "native"}, + {"GUAMITypeMapped", GUAMITypeMapped.Name(), "mapped"}, + {"GUAMIType(9)", GUAMIType(9).Name(), ""}, + + {"TNLAssociationUsageUE", TNLAssociationUsageUE.Name(), "ue"}, + {"TNLAssociationUsageNonUE", TNLAssociationUsageNonUE.Name(), "non-ue"}, + {"TNLAssociationUsageBoth", TNLAssociationUsageBoth.Name(), "both"}, + {"OverloadActionRejectRRCCRSignalling", OverloadActionRejectRRCCRSignalling.Name(), "reject-rrc-cr-signalling"}, {"OverloadAction(9)", OverloadAction(9).Name(), ""}, diff --git a/ngap/fuzz_test.go b/ngap/fuzz_test.go index 8333d9cd64..d544ea0c83 100644 --- a/ngap/fuzz_test.go +++ b/ngap/fuzz_test.go @@ -72,6 +72,13 @@ func FuzzDecodeNoPanic(f *testing.F) { _, _ = unmarshalPERValue[PLMNSupportList](data) _, _ = unmarshalPERValue[GUAMIList](data) _, _ = unmarshalPERValue[GWContextReleaseIndication](data) + _, _ = unmarshalPERValue[ExtendedAMFName](data) + _, _ = unmarshalPERValue[AMFTNLAssociationToAddList](data) + _, _ = unmarshalPERValue[AMFTNLAssociationToRemoveList](data) + _, _ = unmarshalPERValue[AMFTNLAssociationToUpdateList](data) + _, _ = unmarshalPERValue[CPTransportLayerInformation](data) + _, _ = unmarshalPERValue[RequestedNSSAI](data) + _, _ = unmarshalPERValue[GUAMIType](data) _, _ = unmarshalPERValue[FiveGSTMSI](data) _, _ = unmarshalPERValue[ResetType](data) _, _ = unmarshalPERValue[UserLocationInformation](data) diff --git a/ngap/golden_tshark_test.go b/ngap/golden_tshark_test.go index a04b8fdb92..4b8140a791 100644 --- a/ngap/golden_tshark_test.go +++ b/ngap/golden_tshark_test.go @@ -4,12 +4,15 @@ package ngap import ( + "bytes" "encoding/hex" "os/exec" "reflect" "strconv" "strings" "testing" + + "github.com/ellanetworks/core/per" ) type goldenRoundTrip struct { @@ -50,10 +53,131 @@ func checkGoldenRoundTrip(t *testing.T, c goldenRoundTrip) { } } +type wireCase struct { + name string + pdu []byte + parse func([]byte) (any, error) + check func(t *testing.T, m any) + + notTshark string +} + +func insertRawIEs(t *testing.T, pdu []byte, at int, extra ...ieField) []byte { + t.Helper() + + p, err := Unmarshal(pdu) + if err != nil { + t.Fatal(err) + } + + r := per.NewReader(p.value()) + if _, err := r.ReadBit(); err != nil { + t.Fatal(err) + } + + raw, err := decodeIEContainer(r, per.Aligned) + if err != nil { + t.Fatal(err) + } + + fields := make([]ieField, 0, len(raw)+len(extra)) + for _, f := range raw[:at] { + fields = append(fields, f.field()) + } + + fields = append(fields, extra...) + for _, f := range raw[at:] { + fields = append(fields, f.field()) + } + + value := container(t, fields...) + + switch m := p.(type) { + case *InitiatingMessage: + m.Value = value + case *SuccessfulOutcome: + m.Value = value + case *UnsuccessfulOutcome: + m.Value = value + } + + b, err := Marshal(p) + if err != nil { + t.Fatal(err) + } + + return b +} + +func checkWireCase(t *testing.T, c wireCase) { + t.Helper() + + pdu, err := Unmarshal(c.pdu) + if err != nil { + t.Fatal(err) + } + + m, err := c.parse(pdu.value()) + if err != nil { + t.Fatal(err) + } + + c.check(t, m) + + re, err := m.(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, c.pdu) { + t.Fatalf("re-encoded\n got %x\n want %x", re, c.pdu) + } +} + +func rawMaskedIMEISV() ieField { + return ieField{id: IDMaskedIMEISV, crit: CriticalityIgnore, raw: []byte{0x86, 0x65, 0x07, 0x04, 0x00, 0xff, 0xff, 0x01}} +} + +func rawRedirectionVoiceFallback() ieField { + return ieField{id: IDRedirectionVoiceFallback, crit: CriticalityIgnore, raw: []byte{0x00}} +} + +func marshalT(t *testing.T, m interface{ Marshal() ([]byte, error) }) []byte { + t.Helper() + + b, err := m.Marshal() + if err != nil { + t.Fatal(err) + } + + return b +} + +func relayWireCases(t *testing.T) []wireCase { + t.Helper() + + var out []wireCase + + out = append(out, initialContextSetupRequestWireCases(t)...) + out = append(out, handoverRequestWireCases(t)...) + out = append(out, pathSwitchRequestAcknowledgeWireCases(t)...) + out = append(out, initialUEMessageWireCases(t)...) + + return append(out, amfConfigurationUpdateWireCases(t)...) +} + +func TestRelayWireCasesReencodeExactly(t *testing.T) { + for _, c := range relayWireCases(t) { + t.Run(c.name, func(t *testing.T) { checkWireCase(t, c) }) + } +} + func ieAdditionGoldenCases() []goldenRoundTrip { var out []goldenRoundTrip out = append(out, amfConfigurationUpdateGoldenCases()...) + out = append(out, amfConfigurationUpdateAcknowledgeGoldenCases()...) + out = append(out, uETNLABindingReleaseRequestGoldenCases()...) out = append(out, initialContextSetupRequestGoldenCases()...) out = append(out, uEContextModificationRequestGoldenCases()...) @@ -82,6 +206,12 @@ func goldenTsharkVectors(t *testing.T) []tsharkVector { out = append(out, tsharkVector{name: c.name, b: mustHex(t, c.golden)}) } + for _, c := range relayWireCases(t) { + if c.notTshark == "" { + out = append(out, tsharkVector{name: c.name, b: c.pdu}) + } + } + return append(out, tsharkVector{"NGReset", handNGReset(t, resetFixtures(5)), 4}, tsharkVector{"NGResetMaxAMFUENGAPID", handNGReset(t, resetFixtures(0xFFFFFFFFFF-2)), 4}, diff --git a/ngap/handover_resource_allocation.go b/ngap/handover_resource_allocation.go index 68a99e006f..77e0b77a38 100644 --- a/ngap/handover_resource_allocation.go +++ b/ngap/handover_resource_allocation.go @@ -39,7 +39,8 @@ type HandoverRequest struct { // when the list is absent and it cannot determine the serving PLMN otherwise. MobilityRestrictionList *MobilityRestrictionList - GUAMI GUAMI + GUAMI GUAMI + AMFUENGAPID2 *AMFUENGAPID messageMeta } @@ -223,6 +224,27 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.GUAMI, true }, }, + { + id: IDAMFUENGAPID2, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + var v AMFUENGAPID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.AMFUENGAPID2 = &v + + return nil + }, + encode: func(m *HandoverRequest) (per.Marshaler, bool) { + if m.AMFUENGAPID2 == nil { + return nil, false + } + + return m.AMFUENGAPID2, true + }, + }, } func (m *HandoverRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/handover_resource_allocation_test.go b/ngap/handover_resource_allocation_test.go index 33cadf28b0..25642c6002 100644 --- a/ngap/handover_resource_allocation_test.go +++ b/ngap/handover_resource_allocation_test.go @@ -41,6 +41,47 @@ const goldenHandoverRequest = "000d00809700000a000a00020001001d000100000f4002040 "00000000000000000000000000490027000005002021000003008b000a01f0c0a80101000000010086000100008800" + "07000100000900000000000200010065000302aabb001c00070002f839010040" +func goldHandoverRequest(t *testing.T) *HandoverRequest { + t.Helper() + + return &HandoverRequest{ + AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, + Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + SecurityContext: SecurityContext{NextHopChainingCount: 1}, + PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ + PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: handoverSetupTransfer(t), + }}, + AllowedNSSAI: AllowedNSSAI{{SNSSAI: SNSSAI{SST: 1}}}, + SourceToTargetTransparentContainer: SourceToTargetTransparentContainer{0xaa, 0xbb}, + GUAMI: GUAMI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, AMFRegionID: 1, AMFSetID: 1}, + } +} + +func handoverRequestWireCases(t *testing.T) []wireCase { + t.Helper() + + m := goldHandoverRequest(t) + m.AMFUENGAPID2 = Ptr(AMFUENGAPID(0xffffffffff)) + + return []wireCase{{ + name: "HandoverRequestAMFUENGAPID2AfterUnmodeledIE", + pdu: insertRawIEs(t, marshalT(t, m), 10, rawRedirectionVoiceFallback()), + parse: func(v []byte) (any, error) { return ParseHandoverRequest(v) }, + + notTshark: "the Source to Target Transparent Container is opaque test octets that tshark dissects as NR RRC", + check: func(t *testing.T, a any) { + t.Helper() + + m := a.(*HandoverRequest) + if deref(m.AMFUENGAPID2) != 0xffffffffff || len(m.UnknownIEs()) != 1 { + t.Fatalf("AMF UE NGAP ID 2 = %v, unknown IEs %+v", m.AMFUENGAPID2, m.UnknownIEs()) + } + }, + }} +} + func TestHandoverRequestGolden(t *testing.T) { in := HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, diff --git a/ngap/ie_common.go b/ngap/ie_common.go index 46f3de307d..f2108f2854 100644 --- a/ngap/ie_common.go +++ b/ngap/ie_common.go @@ -35,6 +35,47 @@ func (n *Name) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } +type AMFNameVisibleString string + +func (n AMFNameVisibleString) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeKnownMultiplierString(w, enc, per.CharVisibleString, 1, nameMaxLen, true, true, true, string(n)) +} + +func (n *AMFNameVisibleString) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + s, err := per.DecodeKnownMultiplierString(r, enc, per.CharVisibleString, 1, nameMaxLen, true, true, true) + if err != nil { + return err + } + + *n = AMFNameVisibleString(s) + + return nil +} + +type AMFNameUTF8String string + +func (n AMFNameUTF8String) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeString(w, enc, []byte(n)) +} + +func (n *AMFNameUTF8String) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeString(r, enc) + if err != nil { + return err + } + + *n = AMFNameUTF8String(b) + + return nil +} + +type ExtendedAMFName struct { + AMFNameVisibleString *AMFNameVisibleString `per:",optional"` + AMFNameUTF8String *AMFNameUTF8String `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + // GTP-TEID ::= OCTET STRING (SIZE(4)). type GTPTEID uint32 diff --git a/ngap/ie_guami.go b/ngap/ie_guami.go index f0e6d38d3b..e27c9fc889 100644 --- a/ngap/ie_guami.go +++ b/ngap/ie_guami.go @@ -3,6 +3,8 @@ package ngap +import "github.com/ellanetworks/core/per" + // maxnoofServedGUAMIs bounds ServedGUAMIList (TS 38.413, NGAP-Constants). const maxnoofServedGUAMIs = 256 @@ -34,13 +36,158 @@ type GUAMI struct { _ ieExtensions `per:",skip"` } +type GUAMIType uint8 + +const ( + GUAMITypeNative GUAMIType = iota + GUAMITypeMapped + + guamiTypeRootCount = 2 +) + +func (g GUAMIType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, guamiTypeRootCount, int64(g), "GUAMIType") +} + +func (g *GUAMIType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, guamiTypeRootCount, "GUAMIType") + if err != nil { + return err + } + + *g = GUAMIType(idx) + + return nil +} + // ServedGUAMIItem ::= SEQUENCE { gUAMI, backupAMFName OPTIONAL, iE-Extensions // OPTIONAL } (extensible). type ServedGUAMIItem struct { - _ [0]struct{} `per:"extseq"` - GUAMI GUAMI - BackupAMFName *Name `per:",optional"` - _ ieExtensions `per:",skip"` + GUAMI GUAMI + BackupAMFName *Name + GUAMIType *GUAMIType + ExtendedBackupAMFName *ExtendedAMFName + + iEExtensions messageMeta + extensions per.ExtensionAdditions +} + +var servedGUAMIItemExtIEs = []ieSpec[ServedGUAMIItem]{ + { + id: IDGUAMIType, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *ServedGUAMIItem, raw []byte, enc per.Encoding) error { + var v GUAMIType + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.GUAMIType = &v + + return nil + }, + encode: func(m *ServedGUAMIItem) (per.Marshaler, bool) { + if m.GUAMIType == nil { + return nil, false + } + + return m.GUAMIType, true + }, + }, + { + id: IDExtendedBackupAMFName, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *ServedGUAMIItem, raw []byte, enc per.Encoding) error { + var v ExtendedAMFName + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.ExtendedBackupAMFName = &v + + return nil + }, + encode: func(m *ServedGUAMIItem) (per.Marshaler, bool) { + if m.ExtendedBackupAMFName == nil { + return nil, false + } + + return m.ExtendedBackupAMFName, true + }, + }, +} + +func (s *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := extensionFields(servedGUAMIItemExtIEs, s, &s.iEExtensions) + + w.WriteBit(s.extensions.Present()) + w.WriteBit(s.BackupAMFName != nil) + w.WriteBit(len(ext) > 0) + + if err := s.GUAMI.MarshalPER(w, enc); err != nil { + return err + } + + if s.BackupAMFName != nil { + if err := s.BackupAMFName.MarshalPER(w, enc); err != nil { + return err + } + } + + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + + if s.extensions.Present() { + return s.extensions.MarshalPER(w, enc) + } + + return nil +} + +func (s *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + + backupAMFName, err := r.ReadBit() + if err != nil { + return err + } + + extContainer, err := r.ReadBit() + if err != nil { + return err + } + + if err := s.GUAMI.UnmarshalPER(r, enc); err != nil { + return err + } + + if backupAMFName { + var v Name + + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + s.BackupAMFName = &v + } + + if extContainer { + if err := decodeExtensionContainer(r, enc, servedGUAMIItemExtIEs, s, &s.iEExtensions); err != nil { + return err + } + } + + if extBit { + return s.extensions.UnmarshalPER(r, enc) + } + + return nil } // ServedGUAMIList ::= SEQUENCE (SIZE(1..maxnoofServedGUAMIs)) OF diff --git a/ngap/ie_ids.go b/ngap/ie_ids.go index 4d813e35ca..5cd3318314 100644 --- a/ngap/ie_ids.go +++ b/ngap/ie_ids.go @@ -163,11 +163,110 @@ const ( IDSecurityResult ProtocolIEID = 156 IDENDCSONConfigurationTransferDL ProtocolIEID = 157 IDENDCSONConfigurationTransferUL ProtocolIEID = 158 + IDNewGUAMI ProtocolIEID = 162 + IDCNAssistedRANTuning ProtocolIEID = 165 + IDCommonNetworkInstance ProtocolIEID = 166 IDNGRANTNLAssociationToRemoveList ProtocolIEID = 167 + IDTNLAssociationTransportLayerAddressNGRAN ProtocolIEID = 168 + IDEndpointIPAddressAndPort ProtocolIEID = 169 IDSourceToTargetAMFInformationReroute ProtocolIEID = 171 + IDSelectedPLMNIdentity ProtocolIEID = 174 + IDGUAMIType ProtocolIEID = 176 + IDSRVCCOperationPossible ProtocolIEID = 177 + IDAdditionalRedundantULNGUUPTNLInformation ProtocolIEID = 186 + IDRedundantCommonNetworkInstance ProtocolIEID = 190 + IDRedundantULNGUUPTNLInformation ProtocolIEID = 195 + IDRedundantPDUSessionInformation ProtocolIEID = 197 + IDIABAuthorized ProtocolIEID = 199 + IDIABSupported ProtocolIEID = 200 + IDIABNodeIndication ProtocolIEID = 201 + IDNBIoTPagingDRX ProtocolIEID = 202 + IDNBIoTPagingeDRXInfo ProtocolIEID = 203 + IDNBIoTDefaultPagingDRX ProtocolIEID = 204 + IDEnhancedCoverageRestriction ProtocolIEID = 205 + IDExtendedConnectedTime ProtocolIEID = 206 + IDPagingAssisDataforCEcapabUE ProtocolIEID = 207 + IDWUSAssistanceInformation ProtocolIEID = 208 + IDUEDifferentiationInfo ProtocolIEID = 209 + IDLTEV2XServicesAuthorized ProtocolIEID = 215 + IDNRV2XServicesAuthorized ProtocolIEID = 216 + IDLTEUESidelinkAggregateMaximumBitrate ProtocolIEID = 217 + IDNRUESidelinkAggregateMaximumBitrate ProtocolIEID = 218 + IDPC5QoSParameters ProtocolIEID = 219 + IDCEmodeBrestricted ProtocolIEID = 222 + IDEUTRAPagingeDRXInformation ProtocolIEID = 223 + IDCEmodeBSupportIndicator ProtocolIEID = 224 + IDLTEMIndication ProtocolIEID = 225 + IDEndIndication ProtocolIEID = 226 + IDEDTSession ProtocolIEID = 227 + IDUECapabilityInfoRequest ProtocolIEID = 228 + IDUEUPCIoTSupport ProtocolIEID = 234 + IDRRCResumeCause ProtocolIEID = 237 + IDRGLevelWirelineAccessCharacteristics ProtocolIEID = 238 + IDWAGFIdentityInformation ProtocolIEID = 239 + IDAuthenticatedIndication ProtocolIEID = 245 + IDTNGFIdentityInformation ProtocolIEID = 246 + IDTWIFIdentityInformation ProtocolIEID = 247 + IDIntersystemSONConfigurationTransferDL ProtocolIEID = 250 + IDIntersystemSONConfigurationTransferUL ProtocolIEID = 251 + IDManagementBasedMDTPLMNList ProtocolIEID = 254 + IDNPNSupport ProtocolIEID = 258 + IDNPNAccessInformation ProtocolIEID = 259 IDTargettoSourceFailureTransparentContainer ProtocolIEID = 262 + IDUERadioCapabilityID ProtocolIEID = 264 + IDUERadioCapabilityEUTRAFormat ProtocolIEID = 265 IDNotifySourceNGRANNode ProtocolIEID = 269 + IDExtendedSliceSupportList ProtocolIEID = 270 + IDExtendedRANNodeName ProtocolIEID = 273 + IDExtendedAMFName ProtocolIEID = 274 + IDMBSSessionToReleaseList ProtocolIEID = 317 + IDMBSSessionSetupRequestList ProtocolIEID = 318 + IDMBSSessionSetuporModifyRequestList ProtocolIEID = 319 + IDOnboardingSupport ProtocolIEID = 325 + IDTimeSyncAssistanceInfo ProtocolIEID = 326 + IDQMCConfigInfo ProtocolIEID = 328 + IDQMCDeactivation ProtocolIEID = 329 + IDNRPagingeDRXInformation ProtocolIEID = 332 + IDRedCapIndication ProtocolIEID = 333 + IDTargetNSSAIInformation ProtocolIEID = 334 + IDUESliceMaximumBitRateList ProtocolIEID = 335 + IDPagingCause ProtocolIEID = 342 + IDPEIPSassistanceInformation ProtocolIEID = 344 + IDFiveGProSeAuthorized ProtocolIEID = 345 + IDFiveGProSeUEPC5AggregateMaximumBitRate ProtocolIEID = 346 + IDFiveGProSePC5QoSParameters ProtocolIEID = 347 + IDManagementBasedMDTPLMNModificationList ProtocolIEID = 359 + IDNetworkControlledRepeaterAuthorized ProtocolIEID = 367 + IDSelectedNID ProtocolIEID = 371 + IDAerialUEsubscriptionInformation ProtocolIEID = 373 + IDNRA2XServicesAuthorized ProtocolIEID = 374 + IDLTEA2XServicesAuthorized ProtocolIEID = 375 + IDNRA2XUEPC5AggregateMaximumBitRate ProtocolIEID = 376 + IDLTEA2XUEPC5AggregateMaximumBitRate ProtocolIEID = 377 + IDA2XPC5QoSParameters ProtocolIEID = 378 + IDDownlinkTLContainer ProtocolIEID = 394 + IDMobileIABAuthorized ProtocolIEID = 400 + IDMobileIABNodeIndication ProtocolIEID = 402 + IDNoPDUSessionIndication ProtocolIEID = 403 + IDMobileIABSupported ProtocolIEID = 404 IDPartiallyAllowedNSSAI ProtocolIEID = 414 + IDERedCapIndication ProtocolIEID = 427 + IDXrDeviceWith2Rx ProtocolIEID = 428 + IDSLPositioningRangingServiceInfo ProtocolIEID = 430 + IDUserPlaneFailureIndication ProtocolIEID = 435 + IDAUN3DeviceAccessInfo ProtocolIEID = 440 + IDExtendedBackupAMFName ProtocolIEID = 442 + IDExtendedOldAMF ProtocolIEID = 443 + IDAMFUENGAPID2 ProtocolIEID = 450 IDGUAMIList ProtocolIEID = 451 IDGWContextReleaseIndication ProtocolIEID = 452 + IDSourceAMFGUAMI ProtocolIEID = 453 + IDRequestedNSSAI ProtocolIEID = 454 + IDTargetRANNodeID ProtocolIEID = 455 + IDAIOTFIdentifier ProtocolIEID = 467 + IDAIoTSupport ProtocolIEID = 475 + IDAIOTFName ProtocolIEID = 476 + IDLPWUSPSAssistanceInformation ProtocolIEID = 477 + IDAdditionalULI ProtocolIEID = 483 + IDLPWUSDisableIndication ProtocolIEID = 495 ) diff --git a/ngap/ie_names.go b/ngap/ie_names.go index 7fdfa05451..1ce55ba8a2 100644 --- a/ngap/ie_names.go +++ b/ngap/ie_names.go @@ -171,13 +171,112 @@ var protocolIENames = map[ProtocolIEID]string{ IDSecurityResult: "SecurityResult", IDENDCSONConfigurationTransferDL: "ENDC-SONConfigurationTransferDL", IDENDCSONConfigurationTransferUL: "ENDC-SONConfigurationTransferUL", + IDNewGUAMI: "NewGUAMI", + IDCNAssistedRANTuning: "CNAssistedRANTuning", + IDCommonNetworkInstance: "CommonNetworkInstance", IDNGRANTNLAssociationToRemoveList: "NGRAN-TNLAssociationToRemoveList", + IDTNLAssociationTransportLayerAddressNGRAN: "TNLAssociationTransportLayerAddressNGRAN", + IDEndpointIPAddressAndPort: "EndpointIPAddressAndPort", IDSourceToTargetAMFInformationReroute: "SourceToTarget-AMFInformationReroute", + IDSelectedPLMNIdentity: "SelectedPLMNIdentity", + IDGUAMIType: "GUAMIType", + IDSRVCCOperationPossible: "SRVCCOperationPossible", + IDAdditionalRedundantULNGUUPTNLInformation: "AdditionalRedundantUL-NGU-UP-TNLInformation", + IDRedundantCommonNetworkInstance: "RedundantCommonNetworkInstance", + IDRedundantULNGUUPTNLInformation: "RedundantUL-NGU-UP-TNLInformation", + IDRedundantPDUSessionInformation: "RedundantPDUSessionInformation", + IDIABAuthorized: "IAB-Authorized", + IDIABSupported: "IAB-Supported", + IDIABNodeIndication: "IABNodeIndication", + IDNBIoTPagingDRX: "NB-IoT-PagingDRX", + IDNBIoTPagingeDRXInfo: "NB-IoT-Paging-eDRXInfo", + IDNBIoTDefaultPagingDRX: "NB-IoT-DefaultPagingDRX", + IDEnhancedCoverageRestriction: "Enhanced-CoverageRestriction", + IDExtendedConnectedTime: "Extended-ConnectedTime", + IDPagingAssisDataforCEcapabUE: "PagingAssisDataforCEcapabUE", + IDWUSAssistanceInformation: "WUS-Assistance-Information", + IDUEDifferentiationInfo: "UE-DifferentiationInfo", + IDLTEV2XServicesAuthorized: "LTEV2XServicesAuthorized", + IDNRV2XServicesAuthorized: "NRV2XServicesAuthorized", + IDLTEUESidelinkAggregateMaximumBitrate: "LTEUESidelinkAggregateMaximumBitrate", + IDNRUESidelinkAggregateMaximumBitrate: "NRUESidelinkAggregateMaximumBitrate", + IDPC5QoSParameters: "PC5QoSParameters", + IDCEmodeBrestricted: "CEmodeBrestricted", + IDEUTRAPagingeDRXInformation: "EUTRA-PagingeDRXInformation", + IDCEmodeBSupportIndicator: "CEmodeBSupport-Indicator", + IDLTEMIndication: "LTEM-Indication", + IDEndIndication: "EndIndication", + IDEDTSession: "EDT-Session", + IDUECapabilityInfoRequest: "UECapabilityInfoRequest", + IDUEUPCIoTSupport: "UE-UP-CIoT-Support", + IDRRCResumeCause: "RRC-Resume-Cause", + IDRGLevelWirelineAccessCharacteristics: "RGLevelWirelineAccessCharacteristics", + IDWAGFIdentityInformation: "W-AGFIdentityInformation", + IDAuthenticatedIndication: "AuthenticatedIndication", + IDTNGFIdentityInformation: "TNGFIdentityInformation", + IDTWIFIdentityInformation: "TWIFIdentityInformation", + IDIntersystemSONConfigurationTransferDL: "IntersystemSONConfigurationTransferDL", + IDIntersystemSONConfigurationTransferUL: "IntersystemSONConfigurationTransferUL", + IDManagementBasedMDTPLMNList: "ManagementBasedMDTPLMNList", + IDNPNSupport: "NPN-Support", + IDNPNAccessInformation: "NPN-AccessInformation", IDTargettoSourceFailureTransparentContainer: "TargettoSource-Failure-TransparentContainer", + IDUERadioCapabilityID: "UERadioCapabilityID", + IDUERadioCapabilityEUTRAFormat: "UERadioCapability-EUTRA-Format", IDNotifySourceNGRANNode: "NotifySourceNGRANNode", + IDExtendedSliceSupportList: "ExtendedSliceSupportList", + IDExtendedRANNodeName: "Extended-RANNodeName", + IDExtendedAMFName: "Extended-AMFName", + IDMBSSessionToReleaseList: "MBSSessionToReleaseList", + IDMBSSessionSetupRequestList: "MBSSessionSetupRequestList", + IDMBSSessionSetuporModifyRequestList: "MBSSessionSetuporModifyRequestList", + IDOnboardingSupport: "OnboardingSupport", + IDTimeSyncAssistanceInfo: "TimeSyncAssistanceInfo", + IDQMCConfigInfo: "QMCConfigInfo", + IDQMCDeactivation: "QMCDeactivation", + IDNRPagingeDRXInformation: "NR-PagingeDRXInformation", + IDRedCapIndication: "RedCapIndication", + IDTargetNSSAIInformation: "TargetNSSAIInformation", + IDUESliceMaximumBitRateList: "UESliceMaximumBitRateList", + IDPagingCause: "PagingCause", + IDPEIPSassistanceInformation: "PEIPSassistanceInformation", + IDFiveGProSeAuthorized: "FiveG-ProSeAuthorized", + IDFiveGProSeUEPC5AggregateMaximumBitRate: "FiveG-ProSeUEPC5AggregateMaximumBitRate", + IDFiveGProSePC5QoSParameters: "FiveG-ProSePC5QoSParameters", + IDManagementBasedMDTPLMNModificationList: "ManagementBasedMDTPLMNModificationList", + IDNetworkControlledRepeaterAuthorized: "NetworkControlledRepeaterAuthorized", + IDSelectedNID: "SelectedNID", + IDAerialUEsubscriptionInformation: "AerialUEsubscriptionInformation", + IDNRA2XServicesAuthorized: "NR-A2X-ServicesAuthorized", + IDLTEA2XServicesAuthorized: "LTE-A2X-ServicesAuthorized", + IDNRA2XUEPC5AggregateMaximumBitRate: "NR-A2X-UE-PC5-AggregateMaximumBitRate", + IDLTEA2XUEPC5AggregateMaximumBitRate: "LTE-A2X-UE-PC5-AggregateMaximumBitRate", + IDA2XPC5QoSParameters: "A2X-PC5-QoS-Parameters", + IDDownlinkTLContainer: "DownlinkTLContainer", + IDMobileIABAuthorized: "MobileIAB-Authorized", + IDMobileIABNodeIndication: "MobileIABNodeIndication", + IDNoPDUSessionIndication: "NoPDUSessionIndication", + IDMobileIABSupported: "MobileIAB-Supported", IDPartiallyAllowedNSSAI: "Partially-Allowed-NSSAI", + IDERedCapIndication: "ERedCapIndication", + IDXrDeviceWith2Rx: "XrDeviceWith2Rx", + IDSLPositioningRangingServiceInfo: "SLPositioningRangingServiceInfo", + IDUserPlaneFailureIndication: "UserPlaneFailureIndication", + IDAUN3DeviceAccessInfo: "AUN3DeviceAccessInfo", + IDExtendedBackupAMFName: "ExtendedBackupAMFName", + IDExtendedOldAMF: "ExtendedOldAMF", + IDAMFUENGAPID2: "AMF-UE-NGAP-ID2", IDGUAMIList: "GUAMIList", IDGWContextReleaseIndication: "GW-Context-Release-Indication", + IDSourceAMFGUAMI: "SourceAMF-GUAMI", + IDRequestedNSSAI: "RequestedNSSAI", + IDTargetRANNodeID: "Target-RAN-Node-ID", + IDAIOTFIdentifier: "AIOTFIdentifier", + IDAIoTSupport: "AIoT-Support", + IDAIOTFName: "AIOTFName", + IDLPWUSPSAssistanceInformation: "LPWUSPSAssistanceInformation", + IDAdditionalULI: "AdditionalULI", + IDLPWUSDisableIndication: "LPWUSDisableIndication", } // ProtocolIEIDName returns the TS 38.413 name of id, and whether it is known. diff --git a/ngap/ie_setup.go b/ngap/ie_setup.go index 717b5e7587..761b5d41ad 100644 --- a/ngap/ie_setup.go +++ b/ngap/ie_setup.go @@ -3,6 +3,13 @@ package ngap +import ( + "errors" + "fmt" + + "github.com/ellanetworks/core/per" +) + // maxnoof constants for NG Setup IEs (TS 38.413, NGAP-Constants). const ( maxnoofTACs = 256 @@ -10,6 +17,8 @@ const ( maxnoofPLMNs = 12 ) +const maxnoofExtSliceItems = 65535 + // TAC ::= OCTET STRING (SIZE(3)). NR tracking area codes are three octets, // where S1AP's are two. type TAC uint32 @@ -42,10 +51,330 @@ type SupportedTAList []SupportedTAItem // PLMNSupportItem ::= SEQUENCE { pLMNIdentity, sliceSupportList, // iE-Extensions OPTIONAL } (extensible). type PLMNSupportItem struct { - _ [0]struct{} `per:"extseq"` - PLMNIdentity PLMNIdentity - SliceSupportList SliceSupportList - _ ieExtensions `per:",skip"` + PLMNIdentity PLMNIdentity + SliceSupportList SliceSupportList + NPNSupport *NPNSupport + ExtendedSliceSupportList ExtendedSliceSupportList + OnboardingSupport *OnboardingSupport + + iEExtensions messageMeta + extensions per.ExtensionAdditions +} + +var pLMNSupportItemExtIEs = []ieSpec[PLMNSupportItem]{ + { + id: IDNPNSupport, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *PLMNSupportItem, raw []byte, enc per.Encoding) error { + var v NPNSupport + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.NPNSupport = &v + + return nil + }, + encode: func(m *PLMNSupportItem) (per.Marshaler, bool) { + if m.NPNSupport == nil { + return nil, false + } + + return m.NPNSupport, true + }, + }, + { + id: IDExtendedSliceSupportList, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *PLMNSupportItem, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.ExtendedSliceSupportList) + }, + encode: func(m *PLMNSupportItem) (per.Marshaler, bool) { + if len(m.ExtendedSliceSupportList) == 0 { + return nil, false + } + + return m.ExtendedSliceSupportList, true + }, + }, + { + id: IDOnboardingSupport, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PLMNSupportItem, raw []byte, enc per.Encoding) error { + var v OnboardingSupport + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.OnboardingSupport = &v + + return nil + }, + encode: func(m *PLMNSupportItem) (per.Marshaler, bool) { + if m.OnboardingSupport == nil { + return nil, false + } + + return m.OnboardingSupport, true + }, + }, +} + +func (p *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := extensionFields(pLMNSupportItemExtIEs, p, &p.iEExtensions) + + w.WriteBit(p.extensions.Present()) + w.WriteBit(len(ext) > 0) + + if err := p.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + + if err := p.SliceSupportList.MarshalPER(w, enc); err != nil { + return err + } + + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + + if p.extensions.Present() { + return p.extensions.MarshalPER(w, enc) + } + + return nil +} + +func (p *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + + extContainer, err := r.ReadBit() + if err != nil { + return err + } + + if err := p.PLMNIdentity.UnmarshalPER(r, enc); err != nil { + return err + } + + if err := p.SliceSupportList.UnmarshalPER(r, enc); err != nil { + return err + } + + if extContainer { + if err := decodeExtensionContainer(r, enc, pLMNSupportItemExtIEs, p, &p.iEExtensions); err != nil { + return err + } + } + + if extBit { + return p.extensions.UnmarshalPER(r, enc) + } + + return nil +} + +type NID uint64 + +const nidBits = 44 + +func (n NID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(n), nidBits) +} + +func (n *NID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, nidBits) + if err != nil { + return err + } + + *n = NID(v) + + return nil +} + +const ( + npnSupportSNPN = iota + npnSupportChoiceExtensions + + npnSupportAlternatives = 2 +) + +type NPNSupport struct { + SNPN NID +} + +func (n NPNSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, npnSupportAlternatives-1, npnSupportSNPN); err != nil { + return err + } + + return n.SNPN.MarshalPER(w, enc) +} + +func (n *NPNSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, npnSupportAlternatives-1) + if err != nil { + return fmt.Errorf("ngap: NPN-Support choice: %w", err) + } + + if idx == npnSupportChoiceExtensions { + return decodeChoiceExtension(r, enc, "NPN-Support") + } + + return n.SNPN.UnmarshalPER(r, enc) +} + +type ExtendedSliceSupportList []SliceSupportItem + +func (l ExtendedSliceSupportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofExtSliceItems, []SliceSupportItem(l)) +} + +func (l *ExtendedSliceSupportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[SliceSupportItem](r, enc, 1, maxnoofExtSliceItems) + if err != nil { + return err + } + + *l = items + + return nil +} + +type OnboardingSupport uint8 + +const ( + OnboardingSupportTrue OnboardingSupport = iota + + onboardingSupportRootCount = 1 +) + +func (o OnboardingSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, onboardingSupportRootCount, int64(o), "OnboardingSupport") +} + +func (o *OnboardingSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, onboardingSupportRootCount, "OnboardingSupport") + if err != nil { + return err + } + + *o = OnboardingSupport(idx) + + return nil +} + +func extensionFields[M any](table []ieSpec[M], m *M, meta *messageMeta) []ieField { + typed := make([]*ieField, len(table)) + + for i, spec := range table { + if val, ok := spec.encode(m); ok { + typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} + } + } + + return orderFields(table, typed, meta) +} + +func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { + if len(fields) > maxProtocolExtensions { + return fmt.Errorf("ngap: %d extensions exceed maxProtocolExtensions", len(fields)) + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, int64(len(fields))); err != nil { + return err + } + + for _, f := range fields { + if err := encodeContainerField(w, enc, f); err != nil { + return err + } + } + + return nil +} + +func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *messageMeta) error { + n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) + if err != nil { + return err + } + + if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { + return fmt.Errorf("ngap: extension container declares %d fields in %d bits", n, maxBits) + } + + var rejected *notComprehendedIE + + lastIdx := -1 + + for i := int64(0); i < n; i++ { + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) + if err != nil { + return err + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) + if err != nil { + return err + } + + val, err := per.DecodeOpenTypeBytes(r, enc) + if err != nil { + return err + } + + f := rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val} + + if idx, spec, ok := lookupIESpec(table, f.id); ok { + if idx <= lastIdx { + return fmt.Errorf("ngap: extension %s out of order or repeated", f.id) + } + + lastIdx = idx + + err := spec.decode(m, f.value, enc) + if err == nil { + meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) + + continue + } + + if !errors.Is(err, errNotComprehended) { + return err + } + + var inner *notComprehendedIE + if errors.As(err, &inner) && inner.Crit == CriticalityReject && rejected == nil { + rejected = inner + } + } + + if f.crit == CriticalityReject { + if rejected == nil { + rejected = ¬ComprehendedIE{ID: f.id, Crit: CriticalityReject, What: "iE-Extensions"} + } + + continue + } + + meta.preserve(f) + } + + if rejected != nil { + return rejected + } + + if wireMatchesTable(table, meta.wire) { + meta.wire = nil + } + + return nil } // PLMNSupportList ::= SEQUENCE (SIZE(1..maxnoofPLMNs)) OF PLMNSupportItem. diff --git a/ngap/ie_slice.go b/ngap/ie_slice.go index 48ca31050e..3a91e0e8ce 100644 --- a/ngap/ie_slice.go +++ b/ngap/ie_slice.go @@ -3,6 +3,33 @@ package ngap +import "github.com/ellanetworks/core/per" + +const maxnoofRequestedSNSSAIs = 8 + +type RequestedNSSAIItem struct { + SNSSAI SNSSAI + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RequestedNSSAI []RequestedNSSAIItem + +func (l RequestedNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofRequestedSNSSAIs, []RequestedNSSAIItem(l)) +} + +func (l *RequestedNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[RequestedNSSAIItem](r, enc, 1, maxnoofRequestedSNSSAIs) + if err != nil { + return err + } + + *l = items + + return nil +} + // TS 38.413, NGAP-Constants. const ( maxnoofSliceItems = 1024 diff --git a/ngap/ie_table.go b/ngap/ie_table.go index a6e533ddd8..420c54d35d 100644 --- a/ngap/ie_table.go +++ b/ngap/ie_table.go @@ -68,9 +68,9 @@ func encodeMessageBody[M any, PM interface { ) error { w.WriteBit(false) - fields := make([]ieField, 0, len(table)) + typed := make([]*ieField, len(table)) - for _, spec := range table { + for i, spec := range table { val, ok := spec.encode((*M)(m)) required := spec.required((*M)(m)) @@ -87,14 +87,71 @@ func encodeMessageBody[M any, PM interface { return fmt.Errorf("ngap: %s: conditional IE %s is set but its condition does not hold", procedure, spec.id) } - fields = append(fields, ieField{id: spec.id, crit: spec.crit, val: val}) + typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} } - for _, e := range m.meta().unknownIEs { - fields = append(fields, e.field()) + return encodeIEContainer(w, enc, orderFields(table, typed, m.meta())) +} + +func orderFields[M any](table []ieSpec[M], typed []*ieField, meta *messageMeta) []ieField { + fields := make([]ieField, 0, len(table)+len(meta.unknownIEs)) + + if meta.wire == nil { + for _, f := range typed { + if f != nil { + fields = append(fields, *f) + } + } + + for _, e := range meta.unknownIEs { + fields = append(fields, e.field()) + } + + return fields } - return encodeIEContainer(w, enc, fields) + onWire := make([]bool, len(table)) + + for _, s := range meta.wire { + if idx, _, ok := lookupIESpec(table, s.id); ok && s.unknown < 0 { + onWire[idx] = true + } + } + + next := 0 + + flush := func(upto int) { + for ; next < upto; next++ { + if typed[next] != nil && !onWire[next] { + fields = append(fields, *typed[next]) + } + } + } + + for _, s := range meta.wire { + if s.unknown >= 0 { + fields = append(fields, meta.unknownIEs[s.unknown].field()) + + continue + } + + idx, _, ok := lookupIESpec(table, s.id) + if !ok { + continue + } + + flush(idx) + + if f := typed[idx]; f != nil { + fields = append(fields, ieField{id: f.id, crit: s.crit, val: f.val}) + } + + next = idx + 1 + } + + flush(len(table)) + + return fields } // Applies the abstract syntax error handling of TS 38.413 §10.3.4.2, §10.3.5 and @@ -212,6 +269,12 @@ func parseMessageBody[M any, PM interface { } seen[f.id] = true + + meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) + } + + if wireMatchesTable(table, meta.wire) { + meta.wire = nil } if len(notUnderstood) > 0 { @@ -258,6 +321,20 @@ func parseMessageBody[M any, PM interface { return m, nil } +func wireMatchesTable[M any](table []ieSpec[M], wire []wireSlot) bool { + for _, s := range wire { + if s.unknown >= 0 { + return false + } + + if _, spec, ok := lookupIESpec(table, s.id); !ok || spec.crit != s.crit { + return false + } + } + + return true +} + func lookupIESpec[M any](table []ieSpec[M], id ProtocolIEID) (int, ieSpec[M], bool) { for i := range table { if table[i].id == id { diff --git a/ngap/ie_tnl.go b/ngap/ie_tnl.go index daca647150..67c350230a 100644 --- a/ngap/ie_tnl.go +++ b/ngap/ie_tnl.go @@ -28,10 +28,26 @@ const ( // Only endpointIPAddress is modeled: the sole choice-Extensions alternative is // EndpointIPAddressAndPort, which Ella Core neither sends nor acts on. type CPTransportLayerInformation struct { - EndpointIPAddress TransportLayerAddress + EndpointIPAddress TransportLayerAddress + EndpointIPAddressAndPort *EndpointIPAddressAndPort + + endpointIPAddressAndPortCrit Criticality } func (c CPTransportLayerInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + if c.EndpointIPAddressAndPort != nil { + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, cpTransportLayerInformationAlternatives-1, + cpTransportLayerInformationChoiceExtensions); err != nil { + return err + } + + return encodeContainerField(w, enc, ieField{ + id: IDEndpointIPAddressAndPort, + crit: c.endpointIPAddressAndPortCrit, + val: c.EndpointIPAddressAndPort, + }) + } + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, cpTransportLayerInformationAlternatives-1, cpTransportLayerInformationEndpointIPAddress); err != nil { return err @@ -46,12 +62,284 @@ func (c *CPTransportLayerInformation) UnmarshalPER(r *per.Reader, enc per.Encodi return fmt.Errorf("ngap: CPTransportLayerInformation choice: %w", err) } - if idx != cpTransportLayerInformationEndpointIPAddress { + if idx == cpTransportLayerInformationEndpointIPAddress { + return c.EndpointIPAddress.UnmarshalPER(r, enc) + } + + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) + if err != nil { + return fmt.Errorf("ngap: CPTransportLayerInformation alternative choice-Extensions id: %w", err) + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) + if err != nil { + return fmt.Errorf("ngap: CPTransportLayerInformation alternative choice-Extensions criticality: %w", err) + } + + val, err := per.DecodeOpenTypeBytes(r, enc) + if err != nil { + return fmt.Errorf("ngap: CPTransportLayerInformation alternative choice-Extensions value: %w", err) + } + + if ProtocolIEID(id) != IDEndpointIPAddressAndPort { // A zero address must not read as one the peer selected. - return fmt.Errorf("%w: CPTransportLayerInformation alternative %d", errNotComprehended, idx) + return fmt.Errorf("%w: CPTransportLayerInformation alternative %s", errNotComprehended, ProtocolIEID(id)) + } + + var v EndpointIPAddressAndPort + if err := perIEDecode(val, &v); err != nil { + return err + } + + c.EndpointIPAddressAndPort = &v + c.endpointIPAddressAndPortCrit = Criticality(crit) + + return nil +} + +type EndpointIPAddressAndPort struct { + EndpointIPAddress TransportLayerAddress + PortNumber PortNumber + iEExtensions *rawIEExtensions `per:",optional"` +} + +type TNLAssociationUsage uint8 + +const ( + TNLAssociationUsageUE TNLAssociationUsage = iota + TNLAssociationUsageNonUE + TNLAssociationUsageBoth + + tnlAssociationUsageRootCount = 3 +) + +func (u TNLAssociationUsage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, tnlAssociationUsageRootCount, int64(u), "TNLAssociationUsage") +} + +func (u *TNLAssociationUsage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, tnlAssociationUsageRootCount, "TNLAssociationUsage") + if err != nil { + return err + } + + *u = TNLAssociationUsage(idx) + + return nil +} + +type TNLAddressWeightFactor uint8 + +func (f TNLAddressWeightFactor) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeConstrainedWholeNumber(w, enc, 0, 255, int64(f)) +} + +func (f *TNLAddressWeightFactor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 255) + if err != nil { + return err + } + + *f = TNLAddressWeightFactor(v) + + return nil +} + +type AMFTNLAssociationSetupItem struct { + AMFTNLAssociationAddress CPTransportLayerInformation + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AMFTNLAssociationSetupList []AMFTNLAssociationSetupItem + +func (l AMFTNLAssociationSetupList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTNLAssociations, []AMFTNLAssociationSetupItem(l)) +} + +func (l *AMFTNLAssociationSetupList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AMFTNLAssociationSetupItem](r, enc, 1, maxnoofTNLAssociations) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TNLAssociationItem struct { + TNLAssociationAddress CPTransportLayerInformation + Cause Cause + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TNLAssociationList []TNLAssociationItem + +func (l TNLAssociationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTNLAssociations, []TNLAssociationItem(l)) +} + +func (l *TNLAssociationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TNLAssociationItem](r, enc, 1, maxnoofTNLAssociations) + if err != nil { + return err + } + + *l = items + + return nil +} + +type AMFTNLAssociationToAddItem struct { + AMFTNLAssociationAddress CPTransportLayerInformation + TNLAssociationUsage *TNLAssociationUsage `per:",optional"` + TNLAddressWeightFactor TNLAddressWeightFactor + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AMFTNLAssociationToAddList []AMFTNLAssociationToAddItem + +func (l AMFTNLAssociationToAddList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTNLAssociations, []AMFTNLAssociationToAddItem(l)) +} + +func (l *AMFTNLAssociationToAddList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AMFTNLAssociationToAddItem](r, enc, 1, maxnoofTNLAssociations) + if err != nil { + return err + } + + *l = items + + return nil +} + +type AMFTNLAssociationToRemoveItem struct { + AMFTNLAssociationAddress CPTransportLayerInformation + TNLAssociationTransportLayerAddressNGRAN *CPTransportLayerInformation + + iEExtensions messageMeta + extensions per.ExtensionAdditions +} + +var aMFTNLAssociationToRemoveItemExtIEs = []ieSpec[AMFTNLAssociationToRemoveItem]{ + { + id: IDTNLAssociationTransportLayerAddressNGRAN, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *AMFTNLAssociationToRemoveItem, raw []byte, enc per.Encoding) error { + var v CPTransportLayerInformation + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.TNLAssociationTransportLayerAddressNGRAN = &v + + return nil + }, + encode: func(m *AMFTNLAssociationToRemoveItem) (per.Marshaler, bool) { + if m.TNLAssociationTransportLayerAddressNGRAN == nil { + return nil, false + } + + return m.TNLAssociationTransportLayerAddressNGRAN, true + }, + }, +} + +func (i *AMFTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := extensionFields(aMFTNLAssociationToRemoveItemExtIEs, i, &i.iEExtensions) + + w.WriteBit(i.extensions.Present()) + w.WriteBit(len(ext) > 0) + + if err := i.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { + return err + } + + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + + if i.extensions.Present() { + return i.extensions.MarshalPER(w, enc) } - return c.EndpointIPAddress.UnmarshalPER(r, enc) + return nil +} + +func (i *AMFTNLAssociationToRemoveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + + extContainer, err := r.ReadBit() + if err != nil { + return err + } + + if err := i.AMFTNLAssociationAddress.UnmarshalPER(r, enc); err != nil { + return err + } + + if extContainer { + if err := decodeExtensionContainer(r, enc, aMFTNLAssociationToRemoveItemExtIEs, i, &i.iEExtensions); err != nil { + return err + } + } + + if extBit { + return i.extensions.UnmarshalPER(r, enc) + } + + return nil +} + +type AMFTNLAssociationToRemoveList []AMFTNLAssociationToRemoveItem + +func (l AMFTNLAssociationToRemoveList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTNLAssociations, []AMFTNLAssociationToRemoveItem(l)) +} + +func (l *AMFTNLAssociationToRemoveList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AMFTNLAssociationToRemoveItem](r, enc, 1, maxnoofTNLAssociations) + if err != nil { + return err + } + + *l = items + + return nil +} + +type AMFTNLAssociationToUpdateItem struct { + AMFTNLAssociationAddress CPTransportLayerInformation + TNLAssociationUsage *TNLAssociationUsage `per:",optional"` + TNLAddressWeightFactor *TNLAddressWeightFactor `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AMFTNLAssociationToUpdateList []AMFTNLAssociationToUpdateItem + +func (l AMFTNLAssociationToUpdateList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTNLAssociations, []AMFTNLAssociationToUpdateItem(l)) +} + +func (l *AMFTNLAssociationToUpdateList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AMFTNLAssociationToUpdateItem](r, enc, 1, maxnoofTNLAssociations) + if err != nil { + return err + } + + *l = items + + return nil } // NGRANTNLAssociationToRemoveItem ::= SEQUENCE { diff --git a/ngap/ie_ue.go b/ngap/ie_ue.go index c2ac8b953f..b6c822f68a 100644 --- a/ngap/ie_ue.go +++ b/ngap/ie_ue.go @@ -176,6 +176,21 @@ const ( // PortNumber ::= OCTET STRING (SIZE(2)). type PortNumber uint16 +func (p PortNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 2, 2, true, true, false, []byte{byte(p >> 8), byte(p)}) +} + +func (p *PortNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) + if err != nil { + return err + } + + *p = PortNumber(uint16(b[0])<<8 | uint16(b[1])) + + return nil +} + // TimeStamp ::= OCTET STRING (SIZE(4)) — TS 38.413 §9.3.1.75. No S1AP // counterpart: the S1AP User Location Information carries no timestamp. type TimeStamp [4]byte diff --git a/ngap/ies.go b/ngap/ies.go index cdcc949d6e..464b82d82e 100644 --- a/ngap/ies.go +++ b/ngap/ies.go @@ -45,9 +45,16 @@ type RawIE struct { // abstract syntax errors that did not stop delivery. type messageMeta struct { unknownIEs []rawIE + wire []wireSlot diagnostics Diagnostics } +type wireSlot struct { + id ProtocolIEID + crit Criticality + unknown int +} + // Bounded: a peer chooses both the count and the size of what we would retain. func (u *messageMeta) preserve(f rawIE) { if len(u.unknownIEs) >= maxPreservedIEs { @@ -57,6 +64,7 @@ func (u *messageMeta) preserve(f rawIE) { } u.unknownIEs = append(u.unknownIEs, f) + u.wire = append(u.wire, wireSlot{id: f.id, crit: f.crit, unknown: len(u.unknownIEs) - 1}) } // The abstract syntax errors §10.3.4.2 and §10.3.5 let the receiver carry on diff --git a/ngap/initial_context_setup.go b/ngap/initial_context_setup.go index 58eb679e8e..48727bbf92 100644 --- a/ngap/initial_context_setup.go +++ b/ngap/initial_context_setup.go @@ -86,6 +86,7 @@ type InitialContextSetupRequest struct { UERadioCapability UERadioCapability NASPDU *NASPDU UERadioCapabilityForPaging *UERadioCapabilityForPaging + AMFUENGAPID2 *AMFUENGAPID messageMeta } @@ -252,6 +253,27 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UERadioCapabilityForPaging, true }, }, + { + id: IDAMFUENGAPID2, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + var v AMFUENGAPID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.AMFUENGAPID2 = &v + + return nil + }, + encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + if m.AMFUENGAPID2 == nil { + return nil, false + } + + return m.AMFUENGAPID2, true + }, + }, } func (m *InitialContextSetupRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/initial_context_setup_test.go b/ngap/initial_context_setup_test.go index 93216c09ea..efd1fb39a1 100644 --- a/ngap/initial_context_setup_test.go +++ b/ngap/initial_context_setup_test.go @@ -5,6 +5,7 @@ package ngap import ( "errors" + "slices" "testing" ) @@ -308,3 +309,45 @@ func TestInitialContextSetupRequestTraceActivationGolden(t *testing.T) { t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) } } + +func initialContextSetupRequestWireCases(t *testing.T) []wireCase { + t.Helper() + + m := goldInitialContextSetupRequestTraceActivation() + m.AMFUENGAPID2 = Ptr(AMFUENGAPID(0x0102030405)) + + return []wireCase{{ + name: "InitialContextSetupRequestAMFUENGAPID2AfterUnmodeledIEs", + pdu: insertRawIEs(t, marshalT(t, m), 7, rawMaskedIMEISV(), rawRedirectionVoiceFallback()), + parse: func(v []byte) (any, error) { return ParseInitialContextSetupRequest(v) }, + check: func(t *testing.T, a any) { + t.Helper() + + m := a.(*InitialContextSetupRequest) + if deref(m.AMFUENGAPID2) != 0x0102030405 || len(m.UnknownIEs()) != 2 { + t.Fatalf("AMF UE NGAP ID 2 = %v, unknown IEs %+v", m.AMFUENGAPID2, m.UnknownIEs()) + } + }, + }} +} + +func TestInitialContextSetupRequestAMFUENGAPID2SetAfterParseFollowsUnmodeledIEs(t *testing.T) { + pdu := insertRawIEs(t, marshalT(t, goldInitialContextSetupRequestTraceActivation()), 7, rawMaskedIMEISV(), rawRedirectionVoiceFallback()) + + p, err := Unmarshal(pdu) + if err != nil { + t.Fatal(err) + } + + m, err := ParseInitialContextSetupRequest(p.value()) + if err != nil { + t.Fatal(err) + } + + m.AMFUENGAPID2 = Ptr(AMFUENGAPID(7)) + + ids := wireIDs(t, m.encodeBody) + if want := []ProtocolIEID{IDTraceActivation, IDMaskedIMEISV, IDRedirectionVoiceFallback, IDAMFUENGAPID2}; !slices.Equal(ids[len(ids)-4:], want) { + t.Fatalf("IE order %v, want it to end %v", ids, want) + } +} diff --git a/ngap/nas_transport.go b/ngap/nas_transport.go index dca744ff57..cb8a130c70 100644 --- a/ngap/nas_transport.go +++ b/ngap/nas_transport.go @@ -26,6 +26,9 @@ type InitialUEMessage struct { AMFSetID *AMFSetID UEContextRequest *UEContextRequest AllowedNSSAI AllowedNSSAI + GUAMI *GUAMI + GUAMIType *GUAMIType + RequestedNSSAI RequestedNSSAI messageMeta } @@ -157,6 +160,61 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return m.AllowedNSSAI, true }, }, + { + id: IDGUAMI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + var v GUAMI + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.GUAMI = &v + + return nil + }, + encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + if m.GUAMI == nil { + return nil, false + } + + return m.GUAMI, true + }, + }, + { + id: IDGUAMIType, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + var v GUAMIType + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.GUAMIType = &v + + return nil + }, + encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + if m.GUAMIType == nil { + return nil, false + } + + return m.GUAMIType, true + }, + }, + { + id: IDRequestedNSSAI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.RequestedNSSAI) + }, + encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + if len(m.RequestedNSSAI) == 0 { + return nil, false + } + + return m.RequestedNSSAI, true + }, + }, } func (m *InitialUEMessage) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/nas_transport_test.go b/ngap/nas_transport_test.go index 33de2d39d1..e551694352 100644 --- a/ngap/nas_transport_test.go +++ b/ngap/nas_transport_test.go @@ -6,6 +6,7 @@ package ngap import ( "bytes" "errors" + "reflect" "testing" "github.com/ellanetworks/core/per" @@ -580,3 +581,58 @@ func TestInitialUEMessageAllowedNSSAI(t *testing.T) { t.Fatalf("re-encode mismatch:\n got %x\n want %x", got, want) } } + +func goldRegistrationRequestNAS() NASPDU { + return NASPDU{ + 0x7e, 0x00, 0x41, 0x79, 0x00, 0x0b, 0xf2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x2e, 0x02, 0xf0, 0xf0, 0x17, 0x07, 0xf0, 0xf0, 0xc0, 0x40, 0x01, 0x80, 0x30, + } +} + +func goldInitialUEMessageFemto() *InitialUEMessage { + return &InitialUEMessage{ + RANUENGAPID: 1, + NASPDU: goldRegistrationRequestNAS(), + UserLocationInformation: goldInitialULI(), + RRCEstablishmentCause: Ptr(RRCCauseMOSignalling), + GUAMI: &GUAMI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, AMFRegionID: 0xca, AMFSetID: 0x3f8, AMFPointer: 0x01}, + GUAMIType: Ptr(GUAMITypeMapped), + RequestedNSSAI: RequestedNSSAI{ + {SNSSAI: SNSSAI{SST: 1}}, + {SNSSAI: SNSSAI{SST: 2, SD: &SD{0x00, 0x00, 0x01}}}, + }, + } +} + +func initialUEMessageWireCases(t *testing.T) []wireCase { + t.Helper() + + return []wireCase{ + { + name: "InitialUEMessageGUAMITypeRequestedNSSAI", + pdu: marshalT(t, goldInitialUEMessageFemto()), + parse: func(v []byte) (any, error) { return ParseInitialUEMessage(v) }, + check: func(t *testing.T, a any) { + t.Helper() + + if !reflect.DeepEqual(a, goldInitialUEMessageFemto()) { + t.Fatalf("decoded %+v", a) + } + }, + }, + { + name: "InitialUEMessageGUAMIAfterSelectedPLMNIdentity", + pdu: insertRawIEs(t, marshalT(t, goldInitialUEMessageFemto()), 4, + ieField{id: IDSelectedPLMNIdentity, crit: CriticalityIgnore, raw: []byte{0x00, 0xf1, 0x10}}), + parse: func(v []byte) (any, error) { return ParseInitialUEMessage(v) }, + check: func(t *testing.T, a any) { + t.Helper() + + m := a.(*InitialUEMessage) + if m.GUAMI == nil || deref(m.GUAMIType) != GUAMITypeMapped || len(m.RequestedNSSAI) != 2 || len(m.UnknownIEs()) != 1 { + t.Fatalf("decoded %+v", m) + } + }, + }, + } +} diff --git a/ngap/overload.go b/ngap/overload.go index 5e044b2430..bc88b22d73 100644 --- a/ngap/overload.go +++ b/ngap/overload.go @@ -123,9 +123,9 @@ func (l *OverloadStartNSSAIList) UnmarshalPER(r *per.Reader, enc per.Encoding) e const maxnoofGUAMIs = 1024 type GUAMIListItem struct { - _ [0]struct{} `per:"extseq"` - GUAMI GUAMI - _ ieExtensions `per:",skip"` + GUAMI GUAMI + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } type GUAMIList []GUAMIListItem diff --git a/ngap/parsers.go b/ngap/parsers.go index 2e74a27c39..7d73acda8b 100644 --- a/ngap/parsers.go +++ b/ngap/parsers.go @@ -32,6 +32,7 @@ var messageParsers = []messageParser{ {"ParseInitialContextSetupResponse", func(v []byte) error { _, err := ParseInitialContextSetupResponse(v); return err }}, {"ParseInitialContextSetupFailure", func(v []byte) error { _, err := ParseInitialContextSetupFailure(v); return err }}, {"ParseUERadioCapabilityInfoIndication", func(v []byte) error { _, err := ParseUERadioCapabilityInfoIndication(v); return err }}, + {"ParseUETNLABindingReleaseRequest", func(v []byte) error { _, err := ParseUETNLABindingReleaseRequest(v); return err }}, {"ParsePDUSessionResourceSetupRequest", func(v []byte) error { _, err := ParsePDUSessionResourceSetupRequest(v); return err }}, {"ParsePDUSessionResourceSetupResponse", func(v []byte) error { _, err := ParsePDUSessionResourceSetupResponse(v); return err }}, {"ParsePDUSessionResourceReleaseCommand", func(v []byte) error { _, err := ParsePDUSessionResourceReleaseCommand(v); return err }}, diff --git a/ngap/path_switch.go b/ngap/path_switch.go index a81d9dd837..7661c8d17b 100644 --- a/ngap/path_switch.go +++ b/ngap/path_switch.go @@ -147,6 +147,7 @@ type PathSwitchRequestAcknowledge struct { PDUSessionResourceReleased PDUSessionResourceReleasedListPSAck AllowedNSSAI AllowedNSSAI CriticalityDiagnostics *CriticalityDiagnostics + AMFUENGAPID2 *AMFUENGAPID messageMeta } @@ -282,6 +283,27 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.CriticalityDiagnostics, true }, }, + { + id: IDAMFUENGAPID2, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + var v AMFUENGAPID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.AMFUENGAPID2 = &v + + return nil + }, + encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + if m.AMFUENGAPID2 == nil { + return nil, false + } + + return m.AMFUENGAPID2, true + }, + }, } func (m *PathSwitchRequestAcknowledge) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/path_switch_test.go b/ngap/path_switch_test.go index c82b5f487a..24cf9511ed 100644 --- a/ngap/path_switch_test.go +++ b/ngap/path_switch_test.go @@ -288,3 +288,34 @@ func TestPathSwitchSessionsAbsent(t *testing.T) { t.Fatalf("PathSwitchSessions = %+v, want nil", got) } } + +func pathSwitchRequestAcknowledgeWireCases(t *testing.T) []wireCase { + t.Helper() + + transfer, err := (&PathSwitchRequestAcknowledgeTransfer{}).Marshal() + if err != nil { + t.Fatal(err) + } + + m := &PathSwitchRequestAcknowledge{ + AMFUENGAPID: Ptr(AMFUENGAPID(1)), RANUENGAPID: Ptr(RANUENGAPID(2)), + SecurityContext: SecurityContext{NextHopChainingCount: 1}, + PDUSessionResourceSwitchedList: PDUSessionResourceSwitchedList{{PDUSessionID: 5, Transfer: transfer}}, + AllowedNSSAI: AllowedNSSAI{{SNSSAI: SNSSAI{SST: 1}}}, + AMFUENGAPID2: Ptr(AMFUENGAPID(0x0102030405)), + } + + return []wireCase{{ + name: "PathSwitchRequestAcknowledgeAMFUENGAPID2AfterUnmodeledIE", + pdu: insertRawIEs(t, marshalT(t, m), 5, rawRedirectionVoiceFallback()), + parse: func(v []byte) (any, error) { return ParsePathSwitchRequestAcknowledge(v) }, + check: func(t *testing.T, a any) { + t.Helper() + + m := a.(*PathSwitchRequestAcknowledge) + if deref(m.AMFUENGAPID2) != 0x0102030405 || len(m.UnknownIEs()) != 1 { + t.Fatalf("AMF UE NGAP ID 2 = %v, unknown IEs %+v", m.AMFUENGAPID2, m.UnknownIEs()) + } + }, + }} +} diff --git a/ngap/per_gen.go b/ngap/per_gen.go index db5145bef6..6986349d37 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -6,6 +6,201 @@ package ngap import "github.com/ellanetworks/core/per" +func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(aMFTNLAssociationSetupItem.extensions.Present()) + w.WriteBit(aMFTNLAssociationSetupItem.iEExtensions != nil) + if err := aMFTNLAssociationSetupItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { + return err + } + if aMFTNLAssociationSetupItem.iEExtensions != nil { + if err := (*aMFTNLAssociationSetupItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if aMFTNLAssociationSetupItem.extensions.Present() { + if err := aMFTNLAssociationSetupItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&aMFTNLAssociationSetupItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + aMFTNLAssociationSetupItem.iEExtensions = &v + } + if extBit { + if err := aMFTNLAssociationSetupItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(aMFTNLAssociationToAddItem.extensions.Present()) + w.WriteBit(aMFTNLAssociationToAddItem.TNLAssociationUsage != nil) + w.WriteBit(aMFTNLAssociationToAddItem.iEExtensions != nil) + if err := aMFTNLAssociationToAddItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { + return err + } + if aMFTNLAssociationToAddItem.TNLAssociationUsage != nil { + if err := (*aMFTNLAssociationToAddItem.TNLAssociationUsage).MarshalPER(w, enc); err != nil { + return err + } + } + if err := aMFTNLAssociationToAddItem.TNLAddressWeightFactor.MarshalPER(w, enc); err != nil { + return err + } + if aMFTNLAssociationToAddItem.iEExtensions != nil { + if err := (*aMFTNLAssociationToAddItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if aMFTNLAssociationToAddItem.extensions.Present() { + if err := aMFTNLAssociationToAddItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TNLAssociationUsage, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&aMFTNLAssociationToAddItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TNLAssociationUsage { + var v TNLAssociationUsage + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + aMFTNLAssociationToAddItem.TNLAssociationUsage = &v + } + if err := (&aMFTNLAssociationToAddItem.TNLAddressWeightFactor).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + aMFTNLAssociationToAddItem.iEExtensions = &v + } + if extBit { + if err := aMFTNLAssociationToAddItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(aMFTNLAssociationToUpdateItem.extensions.Present()) + w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil) + w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor != nil) + w.WriteBit(aMFTNLAssociationToUpdateItem.iEExtensions != nil) + if err := aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { + return err + } + if aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil { + if err := (*aMFTNLAssociationToUpdateItem.TNLAssociationUsage).MarshalPER(w, enc); err != nil { + return err + } + } + if aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor != nil { + if err := (*aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor).MarshalPER(w, enc); err != nil { + return err + } + } + if aMFTNLAssociationToUpdateItem.iEExtensions != nil { + if err := (*aMFTNLAssociationToUpdateItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if aMFTNLAssociationToUpdateItem.extensions.Present() { + if err := aMFTNLAssociationToUpdateItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TNLAssociationUsage, err := r.ReadBit() + if err != nil { + return err + } + p_TNLAddressWeightFactor, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TNLAssociationUsage { + var v TNLAssociationUsage + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + aMFTNLAssociationToUpdateItem.TNLAssociationUsage = &v + } + if p_TNLAddressWeightFactor { + var v TNLAddressWeightFactor + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor = &v + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + aMFTNLAssociationToUpdateItem.iEExtensions = &v + } + if extBit { + if err := aMFTNLAssociationToUpdateItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -1695,6 +1890,117 @@ func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) UnmarshalP return nil } +func (endpointIPAddressAndPort *EndpointIPAddressAndPort) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(endpointIPAddressAndPort.iEExtensions != nil) + if err := endpointIPAddressAndPort.EndpointIPAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := endpointIPAddressAndPort.PortNumber.MarshalPER(w, enc); err != nil { + return err + } + if endpointIPAddressAndPort.iEExtensions != nil { + if err := (*endpointIPAddressAndPort.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (endpointIPAddressAndPort *EndpointIPAddressAndPort) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&endpointIPAddressAndPort.EndpointIPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&endpointIPAddressAndPort.PortNumber).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + endpointIPAddressAndPort.iEExtensions = &v + } + return nil +} + +func (extendedAMFName *ExtendedAMFName) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(extendedAMFName.extensions.Present()) + w.WriteBit(extendedAMFName.AMFNameVisibleString != nil) + w.WriteBit(extendedAMFName.AMFNameUTF8String != nil) + w.WriteBit(extendedAMFName.iEExtensions != nil) + if extendedAMFName.AMFNameVisibleString != nil { + if err := (*extendedAMFName.AMFNameVisibleString).MarshalPER(w, enc); err != nil { + return err + } + } + if extendedAMFName.AMFNameUTF8String != nil { + if err := (*extendedAMFName.AMFNameUTF8String).MarshalPER(w, enc); err != nil { + return err + } + } + if extendedAMFName.iEExtensions != nil { + if err := (*extendedAMFName.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if extendedAMFName.extensions.Present() { + if err := extendedAMFName.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (extendedAMFName *ExtendedAMFName) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AMFNameVisibleString, err := r.ReadBit() + if err != nil { + return err + } + p_AMFNameUTF8String, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_AMFNameVisibleString { + var v AMFNameVisibleString + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + extendedAMFName.AMFNameVisibleString = &v + } + if p_AMFNameUTF8String { + var v AMFNameUTF8String + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + extendedAMFName.AMFNameUTF8String = &v + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + extendedAMFName.iEExtensions = &v + } + if extBit { + if err := extendedAMFName.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (fiveGSTMSI *FiveGSTMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -2079,11 +2385,21 @@ func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } func (gUAMIListItem *GUAMIListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(gUAMIListItem.extensions.Present()) + w.WriteBit(gUAMIListItem.iEExtensions != nil) if err := gUAMIListItem.GUAMI.MarshalPER(w, enc); err != nil { return err } + if gUAMIListItem.iEExtensions != nil { + if err := (*gUAMIListItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if gUAMIListItem.extensions.Present() { + if err := gUAMIListItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -2092,42 +2408,24 @@ func (gUAMIListItem *GUAMIListItem) UnmarshalPER(r *per.Reader, enc per.Encoding if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } if err := (&gUAMIListItem.GUAMI).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + gUAMIListItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := gUAMIListItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -5711,66 +6009,6 @@ func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelC return nil } -func (pLMNSupportItem *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pLMNSupportItem.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := pLMNSupportItem.SliceSupportList.MarshalPER(w, enc); err != nil { - return err - } - return nil -} - -func (pLMNSupportItem *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&pLMNSupportItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pLMNSupportItem.SliceSupportList).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -7032,6 +7270,52 @@ func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc return nil } +func (requestedNSSAIItem *RequestedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(requestedNSSAIItem.extensions.Present()) + w.WriteBit(requestedNSSAIItem.iEExtensions != nil) + if err := requestedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if requestedNSSAIItem.iEExtensions != nil { + if err := (*requestedNSSAIItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if requestedNSSAIItem.extensions.Present() { + if err := requestedNSSAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (requestedNSSAIItem *RequestedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&requestedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + requestedNSSAIItem.iEExtensions = &v + } + if extBit { + if err := requestedNSSAIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(sNSSAI.SD != nil) @@ -7312,77 +7596,6 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -func (servedGUAMIItem *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(servedGUAMIItem.BackupAMFName != nil) - w.WriteBit(false) - if err := servedGUAMIItem.GUAMI.MarshalPER(w, enc); err != nil { - return err - } - if servedGUAMIItem.BackupAMFName != nil { - if err := (*servedGUAMIItem.BackupAMFName).MarshalPER(w, enc); err != nil { - return err - } - } - return nil -} - -func (servedGUAMIItem *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_BackupAMFName, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&servedGUAMIItem.GUAMI).UnmarshalPER(r, enc); err != nil { - return err - } - if p_BackupAMFName { - var v Name - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - servedGUAMIItem.BackupAMFName = &v - } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - func (serviceAreaInformationItem *ServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(serviceAreaInformationItem.AllowedTACs != nil) @@ -8114,6 +8327,58 @@ func (tAICancelledNRItem *TAICancelledNRItem) UnmarshalPER(r *per.Reader, enc pe return nil } +func (tNLAssociationItem *TNLAssociationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(tNLAssociationItem.extensions.Present()) + w.WriteBit(tNLAssociationItem.iEExtensions != nil) + if err := tNLAssociationItem.TNLAssociationAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := tNLAssociationItem.Cause.MarshalPER(w, enc); err != nil { + return err + } + if tNLAssociationItem.iEExtensions != nil { + if err := (*tNLAssociationItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if tNLAssociationItem.extensions.Present() { + if err := tNLAssociationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tNLAssociationItem *TNLAssociationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tNLAssociationItem.TNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&tNLAssociationItem.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tNLAssociationItem.iEExtensions = &v + } + if extBit { + if err := tNLAssociationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (targetRANNodeID *TargetRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) diff --git a/ngap/raw_pdu_registry_test.go b/ngap/raw_pdu_registry_test.go index 1dae2bf5d3..7c428ab011 100644 --- a/ngap/raw_pdu_registry_test.go +++ b/ngap/raw_pdu_registry_test.go @@ -562,6 +562,14 @@ var typedCodecs = map[typedKey]func([]byte) (typedMessage, error){ return nil, err } + return m, nil + }, + {TriggeringInitiatingMessage, ProcUETNLABindingRelease}: func(v []byte) (typedMessage, error) { + m, err := ParseUETNLABindingReleaseRequest(v) + if err != nil { + return nil, err + } + return m, nil }, } diff --git a/ngap/raw_pdu_test.go b/ngap/raw_pdu_test.go index 132dd526c7..13a0408751 100644 --- a/ngap/raw_pdu_test.go +++ b/ngap/raw_pdu_test.go @@ -244,8 +244,81 @@ func setTypedField(m typedMessage, field string, v reflect.Value) bool { return true } +func withEnvelopeOf(t *testing.T, re []byte, orig PDU) []byte { + t.Helper() + + pdu, err := Unmarshal(re) + if err != nil { + t.Fatal(err) + } + + switch p := pdu.(type) { + case *InitiatingMessage: + p.Criticality = orig.criticality() + case *SuccessfulOutcome: + p.Criticality = orig.criticality() + case *UnsuccessfulOutcome: + p.Criticality = orig.criticality() + } + + b, err := Marshal(pdu) + if err != nil { + t.Fatal(err) + } + + return b +} + +func TestTypedCodecReencodesCorpusExactly(t *testing.T) { + var exact, envelope, refused int + + for _, c := range loadCorpus(t) { + pdu, err := Unmarshal(c.b) + if err != nil { + t.Fatal(err) + } + + codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + if !ok { + continue + } + + msg, err := codec(pdu.value()) + if err != nil { + refused++ + + continue + } + + re, err := msg.Marshal() + if err != nil { + t.Errorf("%s: %T: %v", c.source, msg, err) + + continue + } + + if !bytes.Equal(withEnvelopeOf(t, re, pdu), c.b) { + t.Errorf("%s: %T does not re-encode byte for byte\n got % x\n want % x", c.source, msg, re, c.b) + + continue + } + + if !bytes.Equal(re, c.b) { + envelope++ + } + + exact++ + } + + t.Logf("%d re-encoded byte for byte (%d of them under a procedure criticality other than the wire's), %d refused", exact, envelope, refused) + + if exact < 20 { + t.Fatalf("only %d corpus PDUs re-encoded", exact) + } +} + func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { - var compared, notExact, refused, unmodeled int + var compared, refused, unmodeled int for _, c := range loadCorpus(t) { pdu, err := Unmarshal(c.b) @@ -277,8 +350,8 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { } re, err := msg.Marshal() - if err != nil || !bytes.Equal(re, c.b) { - notExact++ + if err != nil || !bytes.Equal(withEnvelopeOf(t, re, pdu), c.b) { + t.Errorf("%s: %T does not re-encode byte for byte (%v)", c.source, msg, err) break } @@ -293,6 +366,8 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { break } + want = withEnvelopeOf(t, want, pdu) + p, err := ParseRawPDU(c.b) if err != nil { t.Fatal(err) @@ -316,7 +391,7 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { } } - t.Logf("compared %d splices with the typed codec; typed codec skipped: %d not re-encoded byte-exactly, %d refused, %d unmodeled", compared, notExact, refused, unmodeled) + t.Logf("compared %d splices with the typed codec; typed codec skipped: %d refused, %d unmodeled", compared, refused, unmodeled) if compared < 20 { t.Fatalf("only %d comparisons", compared) diff --git a/ngap/symmetry_test.go b/ngap/symmetry_test.go index a80d39bf51..77169b6527 100644 --- a/ngap/symmetry_test.go +++ b/ngap/symmetry_test.go @@ -128,6 +128,8 @@ var ngapOnlyFiles = map[string]string{ "amf_status_indication_test.go": "tests for amf_status_indication.go", "not_comprehended_test.go": "§10.3.1 case 6 reached through choice-Extensions, which only NGAP has (TS 38.413 §9.3)", "symmetry_test.go": "this file: the checker lives on one side", + "ue_tnla_binding_release.go": "TS 36.413 defines no UE TNLA binding and so no procedure to release one (TS 38.413 §8.13.1)", + "ue_tnla_binding_release_test.go": "tests for ue_tnla_binding_release.go", } // A type on both sides must live in the same-named file, so the two can be read diff --git a/ngap/table_order_test.go b/ngap/table_order_test.go index 1174eed6a3..57373af3ce 100644 --- a/ngap/table_order_test.go +++ b/ngap/table_order_test.go @@ -24,16 +24,16 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"NGSetupResponse", tableIDs(nGSetupResponseIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList, IDCriticalityDiagnostics, IDUERetentionInformation}}, {"NGSetupFailure", tableIDs(nGSetupFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, {"NASNonDeliveryIndication", tableIDs(nASNonDeliveryIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDCause}}, - {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDRANUENGAPID, IDNASPDU, IDUserLocationInformation, IDRRCEstablishmentCause, IDFiveGSTMSI, IDAMFSetID, IDUEContextRequest, IDAllowedNSSAI}}, + {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDRANUENGAPID, IDNASPDU, IDUserLocationInformation, IDRRCEstablishmentCause, IDFiveGSTMSI, IDAMFSetID, IDUEContextRequest, IDAllowedNSSAI, IDGUAMI, IDGUAMIType, IDRequestedNSSAI}}, {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU}}, {"UplinkNASTransport", tableIDs(uplinkNASTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDUserLocationInformation}}, - {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate, IDGUAMI, IDPDUSessionResourceSetupListCxtReq, IDAllowedNSSAI, IDUESecurityCapabilities, IDSecurityKey, IDTraceActivation, IDUERadioCapability, IDNASPDU, IDUERadioCapabilityForPaging}}, + {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate, IDGUAMI, IDPDUSessionResourceSetupListCxtReq, IDAllowedNSSAI, IDUESecurityCapabilities, IDSecurityKey, IDTraceActivation, IDUERadioCapability, IDNASPDU, IDUERadioCapabilityForPaging, IDAMFUENGAPID2}}, {"InitialContextSetupResponse", tableIDs(initialContextSetupResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceSetupListCxtRes, IDPDUSessionResourceFailedToSetupListCxtRes, IDCriticalityDiagnostics}}, {"InitialContextSetupFailure", tableIDs(initialContextSetupFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceFailedToSetupListCxtFail, IDCause, IDCriticalityDiagnostics}}, {"HandoverRequired", tableIDs(handoverRequiredIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDHandoverType, IDCause, IDTargetID, IDDirectForwardingPathAvailability, IDPDUSessionResourceListHORqd, IDSourceToTargetTransparentContainer}}, {"HandoverCommand", tableIDs(handoverCommandIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDHandoverType, IDNASSecurityParametersFromNGRAN, IDPDUSessionResourceHandoverList, IDPDUSessionResourceToReleaseListHOCmd, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverPreparationFailure", tableIDs(handoverPreparationFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCause, IDCriticalityDiagnostics, IDTargettoSourceFailureTransparentContainer}}, - {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDHandoverType, IDCause, IDUEAggregateMaximumBitRate, IDUESecurityCapabilities, IDSecurityContext, IDNewSecurityContextInd, IDNASC, IDPDUSessionResourceSetupListHOReq, IDAllowedNSSAI, IDTraceActivation, IDSourceToTargetTransparentContainer, IDMobilityRestrictionList, IDGUAMI}}, + {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDHandoverType, IDCause, IDUEAggregateMaximumBitRate, IDUESecurityCapabilities, IDSecurityContext, IDNewSecurityContextInd, IDNASC, IDPDUSessionResourceSetupListHOReq, IDAllowedNSSAI, IDTraceActivation, IDSourceToTargetTransparentContainer, IDMobilityRestrictionList, IDGUAMI, IDAMFUENGAPID2}}, {"HandoverRequestAcknowledge", tableIDs(handoverRequestAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceAdmittedList, IDPDUSessionResourceFailedToSetupListHOAck, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverFailure", tableIDs(handoverFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDCause, IDCriticalityDiagnostics, IDTargettoSourceFailureTransparentContainer}}, {"DownlinkUEAssociatedNRPPaTransport", tableIDs(downlinkUEAssociatedNRPPaTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRoutingID, IDNRPPaPDU}}, @@ -43,7 +43,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"LocationReport", tableIDs(locationReportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDUEPresenceInAreaOfInterestList, IDLocationReportingRequestType}}, {"LocationReportingControl", tableIDs(locationReportingControlIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDLocationReportingRequestType}}, {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDRANUENGAPID, IDSourceAMFUENGAPID, IDUserLocationInformation, IDUESecurityCapabilities, IDPDUSessionResourceToBeSwitchedDLList, IDPDUSessionResourceFailedToSetupListPSReq}}, - {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUESecurityCapabilities, IDSecurityContext, IDPDUSessionResourceSwitchedList, IDPDUSessionResourceReleasedListPSAck, IDAllowedNSSAI, IDCriticalityDiagnostics}}, + {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUESecurityCapabilities, IDSecurityContext, IDPDUSessionResourceSwitchedList, IDPDUSessionResourceReleasedListPSAck, IDAllowedNSSAI, IDCriticalityDiagnostics, IDAMFUENGAPID2}}, {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceReleasedListPSFail, IDCriticalityDiagnostics}}, {"UplinkRANStatusTransfer", tableIDs(uplinkRANStatusTransferIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRANStatusTransferTransparentContainer}}, {"DownlinkRANStatusTransfer", tableIDs(downlinkRANStatusTransferIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRANStatusTransferTransparentContainer}}, @@ -70,10 +70,14 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"UEContextReleaseComplete", tableIDs(uEContextReleaseCompleteIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDPDUSessionResourceListCxtRelCpl, IDCriticalityDiagnostics}}, {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEPagingIdentity, IDPagingDRX, IDTAIListForPaging, IDPagingPriority, IDUERadioCapabilityForPaging, IDPagingOrigin}}, {"RANConfigurationUpdate", tableIDs(rANConfigurationUpdateIEs), []ProtocolIEID{IDRANNodeName, IDSupportedTAList, IDDefaultPagingDRX, IDGlobalRANNodeID, IDNGRANTNLAssociationToRemoveList}}, - {"AMFConfigurationUpdate", tableIDs(aMFConfigurationUpdateIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList}}, + {"AMFConfigurationUpdate", tableIDs(aMFConfigurationUpdateIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList, IDAMFTNLAssociationToAddList, IDAMFTNLAssociationToRemoveList, IDAMFTNLAssociationToUpdateList, IDExtendedAMFName}}, + {"PLMNSupportItem extensions", tableIDs(pLMNSupportItemExtIEs), []ProtocolIEID{IDNPNSupport, IDExtendedSliceSupportList, IDOnboardingSupport}}, + {"AMFTNLAssociationToRemoveItem extensions", tableIDs(aMFTNLAssociationToRemoveItemExtIEs), []ProtocolIEID{IDTNLAssociationTransportLayerAddressNGRAN}}, + {"ServedGUAMIItem extensions", tableIDs(servedGUAMIItemExtIEs), []ProtocolIEID{IDGUAMIType, IDExtendedBackupAMFName}}, {"OverloadStart", tableIDs(overloadStartIEs), []ProtocolIEID{IDAMFOverloadResponse, IDAMFTrafficLoadReductionIndication, IDOverloadStartNSSAIList, IDGUAMIList}}, {"OverloadStop", tableIDs(overloadStopIEs), []ProtocolIEID{IDGUAMIList}}, - {"AMFConfigurationUpdateAcknowledge", tableIDs(aMFConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, + {"AMFConfigurationUpdateAcknowledge", tableIDs(aMFConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDAMFTNLAssociationSetupList, IDAMFTNLAssociationFailedToSetupList, IDCriticalityDiagnostics}}, + {"UETNLABindingReleaseRequest", tableIDs(uETNLABindingReleaseRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID}}, {"AMFConfigurationUpdateFailure", tableIDs(aMFConfigurationUpdateFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, {"RANConfigurationUpdateAcknowledge", tableIDs(rANConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, {"UplinkRANConfigurationTransfer", tableIDs(uplinkRANConfigurationTransferIEs), []ProtocolIEID{IDSONConfigurationTransferUL}}, diff --git a/ngap/ue_tnla_binding_release.go b/ngap/ue_tnla_binding_release.go new file mode 100644 index 0000000000..52ff9095da --- /dev/null +++ b/ngap/ue_tnla_binding_release.go @@ -0,0 +1,56 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "github.com/ellanetworks/core/per" +) + +type UETNLABindingReleaseRequest struct { + AMFUENGAPID AMFUENGAPID + RANUENGAPID RANUENGAPID + + messageMeta +} + +var uETNLABindingReleaseRequestIEs = []ieSpec[UETNLABindingReleaseRequest]{ + { + id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *UETNLABindingReleaseRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.AMFUENGAPID) + }, + encode: func(m *UETNLABindingReleaseRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + }, + { + id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, + decode: func(m *UETNLABindingReleaseRequest, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.RANUENGAPID) + }, + encode: func(m *UETNLABindingReleaseRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + }, +} + +func (m *UETNLABindingReleaseRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcUETNLABindingRelease, uETNLABindingReleaseRequestIEs, m) +} + +func (m *UETNLABindingReleaseRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcUETNLABindingRelease, + Criticality: CriticalityIgnore, + Value: w.Bytes(), + }) +} + +func ParseUETNLABindingReleaseRequest(value []byte) (*UETNLABindingReleaseRequest, error) { + return parseMessageBody[UETNLABindingReleaseRequest](ProcUETNLABindingRelease, TriggeringInitiatingMessage, uETNLABindingReleaseRequestIEs, value) +} diff --git a/ngap/ue_tnla_binding_release_test.go b/ngap/ue_tnla_binding_release_test.go new file mode 100644 index 0000000000..2ac63c5aa2 --- /dev/null +++ b/ngap/ue_tnla_binding_release_test.go @@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "errors" + "testing" +) + +const goldenUETNLABindingReleaseRequest = "002d4016000002000a000680010203040500550005c001020304" + +func goldUETNLABindingReleaseRequest() *UETNLABindingReleaseRequest { + return &UETNLABindingReleaseRequest{AMFUENGAPID: 0x0102030405, RANUENGAPID: 0x01020304} +} + +func uETNLABindingReleaseRequestGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{{ + "UETNLABindingReleaseRequest", + goldUETNLABindingReleaseRequest(), + func(v []byte) (any, error) { return ParseUETNLABindingReleaseRequest(v) }, + goldenUETNLABindingReleaseRequest, + }} +} + +func TestUETNLABindingReleaseRequestGolden(t *testing.T) { + for _, c := range uETNLABindingReleaseRequestGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} + +func TestUETNLABindingReleaseRequestEnvelope(t *testing.T) { + pdu, err := Unmarshal(mustHex(t, goldenUETNLABindingReleaseRequest)) + if err != nil { + t.Fatal(err) + } + + im, ok := pdu.(*InitiatingMessage) + if !ok || im.ProcedureCode != ProcUETNLABindingRelease || im.Criticality != CriticalityIgnore { + t.Fatalf("got %T %+v", pdu, pdu) + } +} + +func TestUETNLABindingReleaseRequestMissingRejectIE(t *testing.T) { + value := container(t, ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: Ptr(AMFUENGAPID(1))}) + + _, err := ParseUETNLABindingReleaseRequest(value) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) || len(ase.IEs) != 1 || ase.IEs[0].IEID != IDRANUENGAPID { + t.Fatalf("err = %v, want the missing RAN UE NGAP ID reported", err) + } +} diff --git a/ngap/unknown_ie_test.go b/ngap/unknown_ie_test.go index eb1deba98e..fa2aa1fe4b 100644 --- a/ngap/unknown_ie_test.go +++ b/ngap/unknown_ie_test.go @@ -6,15 +6,13 @@ package ngap import ( "bytes" "errors" + "reflect" + "slices" "testing" "github.com/ellanetworks/core/per" ) -// An NG SETUP REQUEST IE this version does not model (§9.2.6.1), ignore -// criticality. -const idNBIoTDefaultPagingDRX ProtocolIEID = 204 - // An NG SETUP REQUEST carrying one unmodeled IE at the given criticality. func encodeWithExtraIE(t *testing.T, crit Criticality, id ProtocolIEID) []byte { t.Helper() @@ -41,7 +39,7 @@ func encodeWithExtraIE(t *testing.T, crit Criticality, id ProtocolIEID) []byte { // §10.3.4.2: reported, still delivered, and preserved verbatim so a re-encode // stays faithful to what the peer sent. func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { - value := encodeWithExtraIE(t, CriticalityIgnore, idNBIoTDefaultPagingDRX) + value := encodeWithExtraIE(t, CriticalityIgnore, IDNBIoTDefaultPagingDRX) req, err := ParseNGSetupRequest(value) if err != nil { @@ -53,7 +51,7 @@ func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { t.Fatal("diagnostics empty, want the unmodeled IE reported") } - if got := d.IEs[0]; got.ID != idNBIoTDefaultPagingDRX || + if got := d.IEs[0]; got.ID != IDNBIoTDefaultPagingDRX || got.Criticality != CriticalityIgnore || got.TypeOfError != TypeOfErrorNotUnderstood { t.Errorf("diagnostic = %+v", got) @@ -65,7 +63,7 @@ func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { } unknown := req.UnknownIEs() - if len(unknown) != 1 || unknown[0].ID != idNBIoTDefaultPagingDRX || + if len(unknown) != 1 || unknown[0].ID != IDNBIoTDefaultPagingDRX || !bytes.Equal(unknown[0].Value, []byte{0xde, 0xad}) { t.Fatalf("UnknownIEs() = %+v", unknown) } @@ -91,14 +89,14 @@ func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { } last := fields[len(fields)-1] - if last.id != idNBIoTDefaultPagingDRX || !bytes.Equal(last.value, []byte{0xde, 0xad}) { + if last.id != IDNBIoTDefaultPagingDRX || !bytes.Equal(last.value, []byte{0xde, 0xad}) { t.Errorf("re-encoded trailing IE = %+v, want the preserved one", last) } } // TS 38.413 §10.3.4.2: the same IE marked reject stops the procedure. func TestUnmodeledRejectIEIsRejected(t *testing.T) { - value := encodeWithExtraIE(t, CriticalityReject, idNBIoTDefaultPagingDRX) + value := encodeWithExtraIE(t, CriticalityReject, IDNBIoTDefaultPagingDRX) msg, err := ParseNGSetupRequest(value) if msg != nil { @@ -115,7 +113,7 @@ func TestUnmodeledRejectIEIsRejected(t *testing.T) { t.Errorf("cause = %v, want %v", ase.Cause, want) } - if len(ase.IEs) != 1 || ase.IEs[0].IEID != idNBIoTDefaultPagingDRX || + if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDNBIoTDefaultPagingDRX || ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { t.Errorf("reported IEs = %+v", ase.IEs) } @@ -140,7 +138,7 @@ func TestUnknownIEsNilWhenNone(t *testing.T) { // The peer's criticality is kept: re-emitting under another would change what a // downstream receiver must do with it. func TestUnmodeledIECriticality(t *testing.T) { - value := encodeWithExtraIE(t, CriticalityIgnore, idNBIoTDefaultPagingDRX) + value := encodeWithExtraIE(t, CriticalityIgnore, IDNBIoTDefaultPagingDRX) req, err := ParseNGSetupRequest(value) if err != nil { @@ -172,8 +170,121 @@ func TestUnmodeledIECriticality(t *testing.T) { } last := fields[len(fields)-1] - if last.id != idNBIoTDefaultPagingDRX || last.crit != CriticalityIgnore { + if last.id != IDNBIoTDefaultPagingDRX || last.crit != CriticalityIgnore { t.Errorf("re-encoded IE = {%v, %v}, want the preserved id and criticality", last.id, last.crit) } } + +func bodyOf(t *testing.T, body func(*per.Writer, per.Encoding) error) []byte { + t.Helper() + + w := per.NewWriter() + if err := body(w, per.Aligned); err != nil { + t.Fatal(err) + } + + return perBytes(w) +} + +func wireIDs(t *testing.T, body func(*per.Writer, per.Encoding) error) []ProtocolIEID { + t.Helper() + + var ids []ProtocolIEID + for _, f := range wireIEs(t, body) { + ids = append(ids, f.id) + } + + return ids +} + +func TestUnknownIEKeepsItsWirePosition(t *testing.T) { + src := goldRequest() + value := container(t, + ieField{id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, + ieField{id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, + ieField{id: IDNBIoTDefaultPagingDRX, crit: CriticalityIgnore, raw: []byte{0xde, 0xad}}, + ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + ) + + req, err := ParseNGSetupRequest(value) + if err != nil { + t.Fatal(err) + } + + if got := bodyOf(t, req.encodeBody); !bytes.Equal(got, value) { + t.Fatalf("re-encoded\n got % x\n want % x", got, value) + } + + req.RANNodeName = Ptr("ella-gnb") + req.UERetentionInformation = Ptr(UERetentionUesRetained) + + want := []ProtocolIEID{IDGlobalRANNodeID, IDRANNodeName, IDSupportedTAList, IDNBIoTDefaultPagingDRX, IDDefaultPagingDRX, IDUERetentionInformation} + if got := wireIDs(t, req.encodeBody); !slices.Equal(got, want) { + t.Fatalf("IE order %v, want %v", got, want) + } + + req.RANNodeName = nil + req.DefaultPagingDRX = nil + req.UERetentionInformation = nil + + if _, err := req.Marshal(); err == nil { + t.Fatal("encoded without the mandatory Default Paging DRX") + } +} + +func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { + src := goldRequest() + value := container(t, + ieField{id: IDNBIoTDefaultPagingDRX, crit: CriticalityIgnore, raw: []byte{0x01}}, + ieField{id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, + ieField{id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, + ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + ieField{id: ProtocolIEID(9999), crit: CriticalityNotify, raw: []byte{0x02}}, + ) + + req, err := ParseNGSetupRequest(value) + if err != nil { + t.Fatal(err) + } + + if got := bodyOf(t, req.encodeBody); !bytes.Equal(got, value) { + t.Fatalf("re-encoded\n got % x\n want % x", got, value) + } +} + +func TestReceivedIECriticalityIsReencoded(t *testing.T) { + src := goldRequest() + value := container(t, + ieField{id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, + ieField{id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, + ieField{id: IDDefaultPagingDRX, crit: CriticalityReject, val: PagingDRXv128}, + ) + + req, err := ParseNGSetupRequest(value) + if err != nil { + t.Fatal(err) + } + + if got := bodyOf(t, req.encodeBody); !bytes.Equal(got, value) { + t.Fatalf("re-encoded\n got % x\n want % x", got, value) + } + + fresh := &NGSetupRequest{GlobalRANNodeID: src.GlobalRANNodeID, SupportedTAList: src.SupportedTAList, DefaultPagingDRX: Ptr(PagingDRXv128)} + if got := wireIEs(t, fresh.encodeBody)[2].crit; got != CriticalityIgnore { + t.Fatalf("built from scratch: Default Paging DRX criticality %v, want ignore", got) + } +} + +func TestConformingMessageParsesToItsBuiltForm(t *testing.T) { + in := goldRequest() + + req, err := ParseNGSetupRequest(bodyOf(t, in.encodeBody)) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(req, in) { + t.Fatalf("parsed %+v, want %+v", req, in) + } +} diff --git a/ngap/wire_criticality_test.go b/ngap/wire_criticality_test.go index e546c3a0de..128624e08a 100644 --- a/ngap/wire_criticality_test.go +++ b/ngap/wire_criticality_test.go @@ -416,6 +416,69 @@ func TestWireCriticality(t *testing.T) { {IDGWContextReleaseIndication, CriticalityReject}, }, }, + { + "AMFConfigurationUpdate §9.2.6.7 TNL lists and Extended AMF Name", + goldAMFConfigurationUpdateRelay().encodeBody, + []wireIE{ + {IDAMFName, CriticalityReject}, + {IDServedGUAMIList, CriticalityReject}, + {IDRelativeAMFCapacity, CriticalityIgnore}, + {IDPLMNSupportList, CriticalityReject}, + {IDAMFTNLAssociationToAddList, CriticalityIgnore}, + {IDAMFTNLAssociationToRemoveList, CriticalityIgnore}, + {IDAMFTNLAssociationToUpdateList, CriticalityIgnore}, + {IDExtendedAMFName, CriticalityIgnore}, + }, + }, + { + "AMFConfigurationUpdateAcknowledge §9.2.6.8 TNL lists", + goldAMFConfigurationUpdateAcknowledgeTNL().encodeBody, + []wireIE{ + {IDAMFTNLAssociationSetupList, CriticalityIgnore}, + {IDAMFTNLAssociationFailedToSetupList, CriticalityIgnore}, + {IDCriticalityDiagnostics, CriticalityIgnore}, + }, + }, + { + "UETNLABindingReleaseRequest §9.2.12.1", + goldUETNLABindingReleaseRequest().encodeBody, + []wireIE{ + {IDAMFUENGAPID, CriticalityReject}, + {IDRANUENGAPID, CriticalityReject}, + }, + }, + { + "InitialUEMessage §9.2.5.1 GUAMI, GUAMI Type, Requested NSSAI", + goldInitialUEMessageFemto().encodeBody, + []wireIE{ + {IDRANUENGAPID, CriticalityReject}, + {IDNASPDU, CriticalityReject}, + {IDUserLocationInformation, CriticalityReject}, + {IDRRCEstablishmentCause, CriticalityIgnore}, + {IDGUAMI, CriticalityIgnore}, + {IDGUAMIType, CriticalityIgnore}, + {IDRequestedNSSAI, CriticalityIgnore}, + }, + }, + { + "InitialContextSetupRequest §9.2.2.1 AMF UE NGAP ID 2", + (&InitialContextSetupRequest{ + AMFUENGAPID: 1, RANUENGAPID: 2, GUAMI: goldContextGUAMI(), + AllowedNSSAI: AllowedNSSAI{{SNSSAI: SNSSAI{SST: 1}}}, + UESecurityCapabilities: goldUESecurityCapabilities(), + SecurityKey: goldSecurityKey(), + AMFUENGAPID2: Ptr(AMFUENGAPID(3)), + }).encodeBody, + []wireIE{ + {IDAMFUENGAPID, CriticalityReject}, + {IDRANUENGAPID, CriticalityReject}, + {IDGUAMI, CriticalityReject}, + {IDAllowedNSSAI, CriticalityReject}, + {IDUESecurityCapabilities, CriticalityReject}, + {IDSecurityKey, CriticalityReject}, + {IDAMFUENGAPID2, CriticalityIgnore}, + }, + }, { "AMFConfigurationUpdate §9.2.6.7 PLMN Support List", goldAMFConfigurationUpdatePLMNSupport().encodeBody, diff --git a/ngap/zz_probe_test.go b/ngap/zz_probe_test.go deleted file mode 100644 index b8832be7c6..0000000000 --- a/ngap/zz_probe_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package ngap - -import ( - "bytes" - "testing" - - "github.com/ellanetworks/core/per" -) - -func TestZZProbe(t *testing.T) { - for _, c := range loadCorpus(t) { - pdu, _ := Unmarshal(c.b) - codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] - if !ok { - continue - } - msg, err := codec(pdu.value()) - if err != nil { - t.Logf("%s REFUSED %v", c.source, err) - continue - } - re, err := msg.Marshal() - if err != nil || !bytes.Equal(re, c.b) { - t.Logf("%s NOTEXACT %v %T", c.source, err, msg) - if err == nil { - ra := per.NewReader(pdu.value()); _, _ = ra.ReadBit(); a, _ := decodeIEContainer(ra, per.Aligned) - p2, _ := Unmarshal(re) - rb := per.NewReader(p2.value()); _, _ = rb.ReadBit(); b, _ := decodeIEContainer(rb, per.Aligned) - var ia, ib []ProtocolIEID - for _, f := range a { ia = append(ia, f.id) } - for _, f := range b { ib = append(ib, f.id) } - t.Logf(" orig %x\n re %x", c.b, re) - t.Logf(" wire %v\n re %v", ia, ib) - for i := range a { for j := range b { if a[i].id == b[j].id && !bytes.Equal(a[i].value, b[j].value) { t.Logf(" IE %v differs\n %x\n %x", a[i].id, a[i].value, b[j].value) } } } - } - } - } -} diff --git a/s1ap/ie_table.go b/s1ap/ie_table.go index 60d6908e0d..e53761e811 100644 --- a/s1ap/ie_table.go +++ b/s1ap/ie_table.go @@ -68,9 +68,9 @@ func encodeMessageBody[M any, PM interface { ) error { w.WriteBit(false) - fields := make([]ieField, 0, len(table)) + typed := make([]*ieField, len(table)) - for _, spec := range table { + for i, spec := range table { val, ok := spec.encode((*M)(m)) required := spec.required((*M)(m)) @@ -87,14 +87,71 @@ func encodeMessageBody[M any, PM interface { return fmt.Errorf("s1ap: %s: conditional IE %s is set but its condition does not hold", procedure, spec.id) } - fields = append(fields, ieField{id: spec.id, crit: spec.crit, val: val}) + typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} } - for _, e := range m.meta().unknownIEs { - fields = append(fields, e.field()) + return encodeIEContainer(w, enc, orderFields(table, typed, m.meta())) +} + +func orderFields[M any](table []ieSpec[M], typed []*ieField, meta *messageMeta) []ieField { + fields := make([]ieField, 0, len(table)+len(meta.unknownIEs)) + + if meta.wire == nil { + for _, f := range typed { + if f != nil { + fields = append(fields, *f) + } + } + + for _, e := range meta.unknownIEs { + fields = append(fields, e.field()) + } + + return fields } - return encodeIEContainer(w, enc, fields) + onWire := make([]bool, len(table)) + + for _, s := range meta.wire { + if idx, _, ok := lookupIESpec(table, s.id); ok && s.unknown < 0 { + onWire[idx] = true + } + } + + next := 0 + + flush := func(upto int) { + for ; next < upto; next++ { + if typed[next] != nil && !onWire[next] { + fields = append(fields, *typed[next]) + } + } + } + + for _, s := range meta.wire { + if s.unknown >= 0 { + fields = append(fields, meta.unknownIEs[s.unknown].field()) + + continue + } + + idx, _, ok := lookupIESpec(table, s.id) + if !ok { + continue + } + + flush(idx) + + if f := typed[idx]; f != nil { + fields = append(fields, ieField{id: f.id, crit: s.crit, val: f.val}) + } + + next = idx + 1 + } + + flush(len(table)) + + return fields } // Applies the abstract syntax error handling of TS 36.413 §10.3.4.2, §10.3.5 and @@ -212,6 +269,12 @@ func parseMessageBody[M any, PM interface { } seen[f.id] = true + + meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) + } + + if wireMatchesTable(table, meta.wire) { + meta.wire = nil } if len(notUnderstood) > 0 { @@ -258,6 +321,20 @@ func parseMessageBody[M any, PM interface { return m, nil } +func wireMatchesTable[M any](table []ieSpec[M], wire []wireSlot) bool { + for _, s := range wire { + if s.unknown >= 0 { + return false + } + + if _, spec, ok := lookupIESpec(table, s.id); !ok || spec.crit != s.crit { + return false + } + } + + return true +} + func lookupIESpec[M any](table []ieSpec[M], id ProtocolIEID) (int, ieSpec[M], bool) { for i := range table { if table[i].id == id { diff --git a/s1ap/ies.go b/s1ap/ies.go index f5257cbdea..a0383dae9a 100644 --- a/s1ap/ies.go +++ b/s1ap/ies.go @@ -45,9 +45,16 @@ type RawIE struct { // abstract syntax errors that did not stop delivery. type messageMeta struct { unknownIEs []rawIE + wire []wireSlot diagnostics Diagnostics } +type wireSlot struct { + id ProtocolIEID + crit Criticality + unknown int +} + // Bounded: a peer chooses both the count and the size of what we would retain. func (u *messageMeta) preserve(f rawIE) { if len(u.unknownIEs) >= maxPreservedIEs { @@ -57,6 +64,7 @@ func (u *messageMeta) preserve(f rawIE) { } u.unknownIEs = append(u.unknownIEs, f) + u.wire = append(u.wire, wireSlot{id: f.id, crit: f.crit, unknown: len(u.unknownIEs) - 1}) } // The abstract syntax errors §10.3.4.2 and §10.3.5 let the receiver carry on diff --git a/s1ap/nas_non_delivery.go b/s1ap/nas_non_delivery.go index 5746eb32d4..486d4e747b 100644 --- a/s1ap/nas_non_delivery.go +++ b/s1ap/nas_non_delivery.go @@ -35,7 +35,15 @@ var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ { id: IDNASPDU, presence: presenceMandatory, crit: CriticalityIgnore, decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + if err := perIEDecode(raw, &m.NASPDU); err != nil { + return err + } + + if m.NASPDU == nil { + m.NASPDU = NASPDU{} + } + + return nil }, encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { if m.NASPDU == nil { diff --git a/s1ap/raw_pdu_test.go b/s1ap/raw_pdu_test.go index b82bb3de22..90191bf3f6 100644 --- a/s1ap/raw_pdu_test.go +++ b/s1ap/raw_pdu_test.go @@ -244,8 +244,81 @@ func setTypedField(m typedMessage, field string, v reflect.Value) bool { return true } +func withEnvelopeOf(t *testing.T, re []byte, orig PDU) []byte { + t.Helper() + + pdu, err := Unmarshal(re) + if err != nil { + t.Fatal(err) + } + + switch p := pdu.(type) { + case *InitiatingMessage: + p.Criticality = orig.criticality() + case *SuccessfulOutcome: + p.Criticality = orig.criticality() + case *UnsuccessfulOutcome: + p.Criticality = orig.criticality() + } + + b, err := Marshal(pdu) + if err != nil { + t.Fatal(err) + } + + return b +} + +func TestTypedCodecReencodesCorpusExactly(t *testing.T) { + var exact, envelope, refused int + + for _, c := range loadCorpus(t) { + pdu, err := Unmarshal(c.b) + if err != nil { + t.Fatal(err) + } + + codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + if !ok { + continue + } + + msg, err := codec(pdu.value()) + if err != nil { + refused++ + + continue + } + + re, err := msg.Marshal() + if err != nil { + t.Errorf("%s: %T: %v", c.source, msg, err) + + continue + } + + if !bytes.Equal(withEnvelopeOf(t, re, pdu), c.b) { + t.Errorf("%s: %T does not re-encode byte for byte\n got % x\n want % x", c.source, msg, re, c.b) + + continue + } + + if !bytes.Equal(re, c.b) { + envelope++ + } + + exact++ + } + + t.Logf("%d re-encoded byte for byte (%d of them under a procedure criticality other than the wire's), %d refused", exact, envelope, refused) + + if exact < 20 { + t.Fatalf("only %d corpus PDUs re-encoded", exact) + } +} + func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { - var compared, notExact, refused, unmodeled int + var compared, refused, unmodeled int for _, c := range loadCorpus(t) { pdu, err := Unmarshal(c.b) @@ -277,8 +350,8 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { } re, err := msg.Marshal() - if err != nil || !bytes.Equal(re, c.b) { - notExact++ + if err != nil || !bytes.Equal(withEnvelopeOf(t, re, pdu), c.b) { + t.Errorf("%s: %T does not re-encode byte for byte (%v)", c.source, msg, err) break } @@ -293,6 +366,8 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { break } + want = withEnvelopeOf(t, want, pdu) + p, err := ParseRawPDU(c.b) if err != nil { t.Fatal(err) @@ -316,7 +391,7 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { } } - t.Logf("compared %d splices with the typed codec; typed codec skipped: %d not re-encoded byte-exactly, %d refused, %d unmodeled", compared, notExact, refused, unmodeled) + t.Logf("compared %d splices with the typed codec; typed codec skipped: %d refused, %d unmodeled", compared, refused, unmodeled) if compared < 20 { t.Fatalf("only %d comparisons", compared) diff --git a/s1ap/ue_capability.go b/s1ap/ue_capability.go index 30dca07c15..1f2dc6ac71 100644 --- a/s1ap/ue_capability.go +++ b/s1ap/ue_capability.go @@ -37,7 +37,15 @@ var uECapabilityInfoIndicationIEs = []ieSpec[UECapabilityInfoIndication]{ { id: IDUERadioCapability, presence: presenceMandatory, crit: CriticalityIgnore, decode: func(m *UECapabilityInfoIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UERadioCapability) + if err := perIEDecode(raw, &m.UERadioCapability); err != nil { + return err + } + + if m.UERadioCapability == nil { + m.UERadioCapability = []byte{} + } + + return nil }, encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { if m.UERadioCapability == nil { diff --git a/s1ap/unknown_ie_test.go b/s1ap/unknown_ie_test.go index 958774b5af..80f7f2c2ef 100644 --- a/s1ap/unknown_ie_test.go +++ b/s1ap/unknown_ie_test.go @@ -6,8 +6,11 @@ package s1ap import ( "bytes" "errors" + "reflect" "slices" "testing" + + "github.com/ellanetworks/core/per" ) // A ProtocolIE the message type does not model must survive Marshal/Parse @@ -218,3 +221,117 @@ func TestUnmodeledIECriticality(t *testing.T) { } }) } + +func goldS1SetupRequestForWire() *S1SetupRequest { + return &S1SetupRequest{ + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 0x0abcd}}, + SupportedTAs: SupportedTAs{{TAC: 0x0001, BroadcastPLMNs: BPLMNs{{0x00, 0xf1, 0x10}}}}, + DefaultPagingDRX: Ptr(PagingDRXv128), + } +} + +func bodyOf(t *testing.T, body func(*per.Writer, per.Encoding) error) []byte { + t.Helper() + + w := per.NewWriter() + if err := body(w, per.Aligned); err != nil { + t.Fatal(err) + } + + return perBytes(w) +} + +func wireIDs(t *testing.T, body func(*per.Writer, per.Encoding) error) []ProtocolIEID { + t.Helper() + + var ids []ProtocolIEID + for _, f := range wireIEs(t, body) { + ids = append(ids, f.id) + } + + return ids +} + +func TestUnknownIEKeepsItsWirePosition(t *testing.T) { + const unknownID ProtocolIEID = 300 + + src := goldS1SetupRequestForWire() + value := container(t, + ieField{id: IDGlobalENBID, crit: CriticalityReject, val: &src.GlobalENBID}, + ieField{id: IDSupportedTAs, crit: CriticalityReject, val: src.SupportedTAs}, + ieField{id: unknownID, crit: CriticalityIgnore, raw: []byte{0xde, 0xad}}, + ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + ) + + req, err := ParseS1SetupRequest(value) + if err != nil { + t.Fatal(err) + } + + if got := bodyOf(t, req.encodeBody); !bytes.Equal(got, value) { + t.Fatalf("re-encoded\n got % x\n want % x", got, value) + } + + req.ENBName = Ptr("eNB-1") + req.UERetentionInformation = Ptr(UERetentionUesRetained) + + want := []ProtocolIEID{IDGlobalENBID, IDENBname, IDSupportedTAs, unknownID, IDDefaultPagingDRX, IDUERetentionInformation} + if got := wireIDs(t, req.encodeBody); !slices.Equal(got, want) { + t.Fatalf("IE order %v, want %v", got, want) + } +} + +func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { + src := goldS1SetupRequestForWire() + value := container(t, + ieField{id: ProtocolIEID(300), crit: CriticalityIgnore, raw: []byte{0x01}}, + ieField{id: IDGlobalENBID, crit: CriticalityReject, val: &src.GlobalENBID}, + ieField{id: IDSupportedTAs, crit: CriticalityReject, val: src.SupportedTAs}, + ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + ieField{id: ProtocolIEID(9999), crit: CriticalityNotify, raw: []byte{0x02}}, + ) + + req, err := ParseS1SetupRequest(value) + if err != nil { + t.Fatal(err) + } + + if got := bodyOf(t, req.encodeBody); !bytes.Equal(got, value) { + t.Fatalf("re-encoded\n got % x\n want % x", got, value) + } +} + +func TestReceivedIECriticalityIsReencoded(t *testing.T) { + src := goldS1SetupRequestForWire() + value := container(t, + ieField{id: IDGlobalENBID, crit: CriticalityReject, val: &src.GlobalENBID}, + ieField{id: IDSupportedTAs, crit: CriticalityReject, val: src.SupportedTAs}, + ieField{id: IDDefaultPagingDRX, crit: CriticalityReject, val: PagingDRXv128}, + ) + + req, err := ParseS1SetupRequest(value) + if err != nil { + t.Fatal(err) + } + + if got := bodyOf(t, req.encodeBody); !bytes.Equal(got, value) { + t.Fatalf("re-encoded\n got % x\n want % x", got, value) + } + + if got := wireIEs(t, src.encodeBody)[2].crit; got != CriticalityIgnore { + t.Fatalf("built from scratch: Default Paging DRX criticality %v, want ignore", got) + } +} + +func TestConformingMessageParsesToItsBuiltForm(t *testing.T) { + in := goldS1SetupRequestForWire() + + req, err := ParseS1SetupRequest(bodyOf(t, in.encodeBody)) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(req, in) { + t.Fatalf("parsed %+v, want %+v", req, in) + } +} diff --git a/s1ap/zz_probe_test.go b/s1ap/zz_probe_test.go deleted file mode 100644 index ba26a309c2..0000000000 --- a/s1ap/zz_probe_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package s1ap - -import ( - "bytes" - "testing" - - "github.com/ellanetworks/core/per" -) - -func TestZZProbe(t *testing.T) { - for _, c := range loadCorpus(t) { - pdu, _ := Unmarshal(c.b) - codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] - if !ok { - continue - } - msg, err := codec(pdu.value()) - if err != nil { - t.Logf("%s REFUSED %v", c.source, err) - continue - } - re, err := msg.Marshal() - if err != nil || !bytes.Equal(re, c.b) { - t.Logf("%s NOTEXACT %v %T", c.source, err, msg) - if err == nil { - ra := per.NewReader(pdu.value()); _, _ = ra.ReadBit(); a, _ := decodeIEContainer(ra, per.Aligned) - p2, _ := Unmarshal(re) - rb := per.NewReader(p2.value()); _, _ = rb.ReadBit(); b, _ := decodeIEContainer(rb, per.Aligned) - var ia, ib []ProtocolIEID - for _, f := range a { ia = append(ia, f.id) } - for _, f := range b { ib = append(ib, f.id) } - t.Logf(" orig %x\n re %x", c.b, re) - t.Logf(" wire %v\n re %v", ia, ib) - for i := range a { for j := range b { if a[i].id == b[j].id && !bytes.Equal(a[i].value, b[j].value) { t.Logf(" IE %v differs\n %x\n %x", a[i].id, a[i].value, b[j].value) } } } - } - } - } -} From db57bba97ec0f7eeb4791efab71f6e5ad42186c8 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sat, 14 Nov 2026 07:03:47 -0500 Subject: [PATCH 06/16] fix: review 2 Signed-off-by: Guillaume Belanger --- ngap/amf_status_indication.go | 129 ++++++++++++++++++++++++++++- ngap/amf_status_indication_test.go | 84 +++++++++++++++++++ ngap/fuzz_test.go | 1 + ngap/golden_tshark_test.go | 2 + ngap/ng_setup_resp.go | 22 +++++ ngap/ng_setup_resp_test.go | 30 +++++++ ngap/per_gen.go | 88 -------------------- ngap/table_order_test.go | 3 +- ngap/wire_criticality_test.go | 11 +++ s1ap/enum_encode_test.go | 1 + s1ap/enum_extension_test.go | 4 + s1ap/ie_ids.go | 1 + s1ap/ie_names.go | 1 + s1ap/ie_ue.go | 23 +++++ s1ap/pws_overload_test.go | 7 +- s1ap/table_order_test.go | 2 +- s1ap/ue_context_release.go | 28 ++++++- s1ap/ue_context_release_test.go | 39 +++++++++ s1ap/wire_criticality_test.go | 15 ++++ 19 files changed, 391 insertions(+), 100 deletions(-) diff --git a/ngap/amf_status_indication.go b/ngap/amf_status_indication.go index 3ce0c43596..4abff94c90 100644 --- a/ngap/amf_status_indication.go +++ b/ngap/amf_status_indication.go @@ -37,12 +37,133 @@ func (t *TimerApproachForGUAMIRemoval) UnmarshalPER(r *per.Reader, enc per.Encod // OPTIONAL, backupAMFName OPTIONAL, iE-Extensions OPTIONAL } (extensible), // defined inline in TS 38.413 §9.2.6.10. type UnavailableGUAMIItem struct { - _ [0]struct{} `per:"extseq"` GUAMI GUAMI - TimerApproachForGUAMIRemoval *TimerApproachForGUAMIRemoval `per:",optional"` + TimerApproachForGUAMIRemoval *TimerApproachForGUAMIRemoval // The AMF to reselect towards (§8.7.6.2). - BackupAMFName *Name `per:",optional"` - _ ieExtensions `per:",skip"` + BackupAMFName *Name + ExtendedBackupAMFName *ExtendedAMFName + + iEExtensions messageMeta + extensions per.ExtensionAdditions +} + +var unavailableGUAMIItemExtIEs = []ieSpec[UnavailableGUAMIItem]{ + { + id: IDExtendedBackupAMFName, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *UnavailableGUAMIItem, raw []byte, enc per.Encoding) error { + var v ExtendedAMFName + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.ExtendedBackupAMFName = &v + + return nil + }, + encode: func(m *UnavailableGUAMIItem) (per.Marshaler, bool) { + if m.ExtendedBackupAMFName == nil { + return nil, false + } + + return m.ExtendedBackupAMFName, true + }, + }, +} + +func (u *UnavailableGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := extensionFields(unavailableGUAMIItemExtIEs, u, &u.iEExtensions) + + w.WriteBit(u.extensions.Present()) + w.WriteBit(u.TimerApproachForGUAMIRemoval != nil) + w.WriteBit(u.BackupAMFName != nil) + w.WriteBit(len(ext) > 0) + + if err := u.GUAMI.MarshalPER(w, enc); err != nil { + return err + } + + if u.TimerApproachForGUAMIRemoval != nil { + if err := u.TimerApproachForGUAMIRemoval.MarshalPER(w, enc); err != nil { + return err + } + } + + if u.BackupAMFName != nil { + if err := u.BackupAMFName.MarshalPER(w, enc); err != nil { + return err + } + } + + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + + if u.extensions.Present() { + return u.extensions.MarshalPER(w, enc) + } + + return nil +} + +func (u *UnavailableGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + + timerApproach, err := r.ReadBit() + if err != nil { + return err + } + + backupAMFName, err := r.ReadBit() + if err != nil { + return err + } + + extContainer, err := r.ReadBit() + if err != nil { + return err + } + + if err := u.GUAMI.UnmarshalPER(r, enc); err != nil { + return err + } + + if timerApproach { + var v TimerApproachForGUAMIRemoval + + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + u.TimerApproachForGUAMIRemoval = &v + } + + if backupAMFName { + var v Name + + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + u.BackupAMFName = &v + } + + if extContainer { + if err := decodeExtensionContainer(r, enc, unavailableGUAMIItemExtIEs, u, &u.iEExtensions); err != nil { + return err + } + } + + if extBit { + return u.extensions.UnmarshalPER(r, enc) + } + + return nil } // UnavailableGUAMIList ::= SEQUENCE (SIZE(1..maxnoofServedGUAMIs)) OF diff --git a/ngap/amf_status_indication_test.go b/ngap/amf_status_indication_test.go index debb14b3e7..38eee9f2ea 100644 --- a/ngap/amf_status_indication_test.go +++ b/ngap/amf_status_indication_test.go @@ -5,6 +5,8 @@ package ngap import ( "bytes" + "errors" + "reflect" "testing" ) @@ -136,3 +138,85 @@ func TestAMFStatusIndicationGUAMIListBounds(t *testing.T) { t.Fatalf("encoded %d GUAMIs, want a bound error", len(over)) } } + +func goldAMFStatusIndicationExtendedBackupAMFName() *AMFStatusIndication { + return &AMFStatusIndication{UnavailableGUAMIList: UnavailableGUAMIList{{ + GUAMI: goldGUAMI(), + TimerApproachForGUAMIRemoval: Ptr(TimerApproachApplyTimer), + BackupAMFName: Ptr(Name("backup-amf")), + ExtendedBackupAMFName: &ExtendedAMFName{ + AMFNameVisibleString: Ptr(AMFNameVisibleString("backup-amf-extended")), + AMFNameUTF8String: Ptr(AMFNameUTF8String("backup-amf-ü")), + }, + }}} +} + +func aMFStatusIndicationGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{ + { + "AMFStatusIndicationExtendedBackupAMFName", + goldAMFStatusIndicationExtendedBackupAMFName(), + func(v []byte) (any, error) { return ParseAMFStatusIndication(v) }, + "000140440000010078003d007000f110cafe0002406261636b75702d616d66000001ba402360906261636b75702d616d662d657874656e6465640d6261636b75702d616d662dc3bc", + }, + } +} + +func TestAMFStatusIndicationExtendedBackupAMFNameGolden(t *testing.T) { + for _, c := range aMFStatusIndicationGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} + +func TestUnavailableGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { + item := goldAMFStatusIndicationExtendedBackupAMFName().UnavailableGUAMIList[0] + item.iEExtensions = messageMeta{ + unknownIEs: []rawIE{{id: 9999, crit: CriticalityIgnore, value: []byte{0x5a}}}, + wire: []wireSlot{ + {id: 9999, crit: CriticalityIgnore, unknown: 0}, + {id: IDExtendedBackupAMFName, crit: CriticalityIgnore, unknown: -1}, + }, + } + + pdu := marshalT(t, &AMFStatusIndication{UnavailableGUAMIList: UnavailableGUAMIList{item}}) + + p, err := Unmarshal(pdu) + if err != nil { + t.Fatal(err) + } + + out, err := ParseAMFStatusIndication(p.value()) + if err != nil { + t.Fatal(err) + } + + got := out.UnavailableGUAMIList[0] + if got.ExtendedBackupAMFName == nil || len(got.iEExtensions.unknownIEs) != 1 { + t.Fatalf("decoded %+v", got) + } + + if !reflect.DeepEqual(got.iEExtensions.wire, item.iEExtensions.wire) { + t.Fatalf("wire order %+v, want %+v", got.iEExtensions.wire, item.iEExtensions.wire) + } + + if re := marshalT(t, out); !bytes.Equal(re, pdu) { + t.Fatalf("re-encoded\n got %x\n want %x", re, pdu) + } +} + +func TestUnavailableGUAMIItemUnknownRejectExtensionRejectsProcedure(t *testing.T) { + item := UnavailableGUAMIItem{GUAMI: goldGUAMI()} + item.iEExtensions = messageMeta{unknownIEs: []rawIE{{id: 9999, crit: CriticalityReject, value: []byte{0x5a}}}} + + p, err := Unmarshal(marshalT(t, &AMFStatusIndication{UnavailableGUAMIList: UnavailableGUAMIList{item}})) + if err != nil { + t.Fatal(err) + } + + _, err = ParseAMFStatusIndication(p.value()) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) || len(ase.IEs) != 1 || ase.IEs[0].IEID != 9999 { + t.Fatalf("err = %v, want the unknown reject extension reported", err) + } +} diff --git a/ngap/fuzz_test.go b/ngap/fuzz_test.go index d544ea0c83..345be42cfd 100644 --- a/ngap/fuzz_test.go +++ b/ngap/fuzz_test.go @@ -69,6 +69,7 @@ func FuzzDecodeNoPanic(f *testing.F) { _, _ = unmarshalPERValue[GlobalRANNodeID](data) _, _ = unmarshalPERValue[SupportedTAList](data) _, _ = unmarshalPERValue[ServedGUAMIList](data) + _, _ = unmarshalPERValue[UnavailableGUAMIList](data) _, _ = unmarshalPERValue[PLMNSupportList](data) _, _ = unmarshalPERValue[GUAMIList](data) _, _ = unmarshalPERValue[GWContextReleaseIndication](data) diff --git a/ngap/golden_tshark_test.go b/ngap/golden_tshark_test.go index 4b8140a791..2e21ac60ae 100644 --- a/ngap/golden_tshark_test.go +++ b/ngap/golden_tshark_test.go @@ -177,6 +177,8 @@ func ieAdditionGoldenCases() []goldenRoundTrip { out = append(out, amfConfigurationUpdateGoldenCases()...) out = append(out, amfConfigurationUpdateAcknowledgeGoldenCases()...) + out = append(out, nGSetupResponseGoldenCases()...) + out = append(out, aMFStatusIndicationGoldenCases()...) out = append(out, uETNLABindingReleaseRequestGoldenCases()...) out = append(out, initialContextSetupRequestGoldenCases()...) out = append(out, uEContextModificationRequestGoldenCases()...) diff --git a/ngap/ng_setup_resp.go b/ngap/ng_setup_resp.go index 22a73b71ee..79bc5a6a13 100644 --- a/ngap/ng_setup_resp.go +++ b/ngap/ng_setup_resp.go @@ -15,6 +15,7 @@ type NGSetupResponse struct { PLMNSupportList PLMNSupportList CriticalityDiagnostics *CriticalityDiagnostics UERetentionInformation *UERetentionInformation + ExtendedAMFName *ExtendedAMFName messageMeta } @@ -117,6 +118,27 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return m.UERetentionInformation, true }, }, + { + id: IDExtendedAMFName, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { + var v ExtendedAMFName + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.ExtendedAMFName = &v + + return nil + }, + encode: func(m *NGSetupResponse) (per.Marshaler, bool) { + if m.ExtendedAMFName == nil { + return nil, false + } + + return m.ExtendedAMFName, true + }, + }, } func (m *NGSetupResponse) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ng_setup_resp_test.go b/ngap/ng_setup_resp_test.go index 794ab4a44b..629c94c1c6 100644 --- a/ngap/ng_setup_resp_test.go +++ b/ngap/ng_setup_resp_test.go @@ -76,3 +76,33 @@ func TestNGSetupResponseReencodeStable(t *testing.T) { t.Fatalf("re-encode unstable:\n b1 % x\n b2 % x", b1, b2) } } + +func goldNGSetupResponseExtendedAMFName() *NGSetupResponse { + m := goldResponse() + m.ServedGUAMIList[0].ExtendedBackupAMFName = &ExtendedAMFName{ + AMFNameVisibleString: Ptr(AMFNameVisibleString("ella-amf-backup-extended")), + } + m.ExtendedAMFName = &ExtendedAMFName{ + AMFNameVisibleString: Ptr(AMFNameVisibleString("ella-amf-extended")), + AMFNameUTF8String: Ptr(AMFNameUTF8String("ella-amf-ü")), + } + + return m +} + +func nGSetupResponseGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{ + { + "NGSetupResponseExtendedAMFName", + goldNGSetupResponseExtendedAMFName(), + func(v []byte) (any, error) { return ParseNGSetupResponse(v) }, + "201500740000050001000a0380656c6c612d616d6600600028002002f839020043000001ba401a40b8656c6c612d616d662d6261636b75702d657874656e64656400564001ff0050000b0002f839000010080102030112401f6080656c6c612d616d662d657874656e6465640b656c6c612d616d662dc3bc", + }, + } +} + +func TestNGSetupResponseExtendedAMFNameGolden(t *testing.T) { + for _, c := range nGSetupResponseGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} diff --git a/ngap/per_gen.go b/ngap/per_gen.go index 6986349d37..99c20a00d2 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -9011,94 +9011,6 @@ func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) return nil } -func (unavailableGUAMIItem *UnavailableGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(unavailableGUAMIItem.TimerApproachForGUAMIRemoval != nil) - w.WriteBit(unavailableGUAMIItem.BackupAMFName != nil) - w.WriteBit(false) - if err := unavailableGUAMIItem.GUAMI.MarshalPER(w, enc); err != nil { - return err - } - if unavailableGUAMIItem.TimerApproachForGUAMIRemoval != nil { - if err := (*unavailableGUAMIItem.TimerApproachForGUAMIRemoval).MarshalPER(w, enc); err != nil { - return err - } - } - if unavailableGUAMIItem.BackupAMFName != nil { - if err := (*unavailableGUAMIItem.BackupAMFName).MarshalPER(w, enc); err != nil { - return err - } - } - return nil -} - -func (unavailableGUAMIItem *UnavailableGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_TimerApproachForGUAMIRemoval, err := r.ReadBit() - if err != nil { - return err - } - p_BackupAMFName, err := r.ReadBit() - if err != nil { - return err - } - p_f3, err := r.ReadBit() - if err != nil { - return err - } - if err := (&unavailableGUAMIItem.GUAMI).UnmarshalPER(r, enc); err != nil { - return err - } - if p_TimerApproachForGUAMIRemoval { - var v TimerApproachForGUAMIRemoval - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - unavailableGUAMIItem.TimerApproachForGUAMIRemoval = &v - } - if p_BackupAMFName { - var v Name - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - unavailableGUAMIItem.BackupAMFName = &v - } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - func (userPlaneSecurityInformation *UserPlaneSecurityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) diff --git a/ngap/table_order_test.go b/ngap/table_order_test.go index 57373af3ce..74e6c492b4 100644 --- a/ngap/table_order_test.go +++ b/ngap/table_order_test.go @@ -21,7 +21,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"NGReset", tableIDs(nGResetIEs), []ProtocolIEID{IDCause, IDResetType}}, {"NGResetAcknowledge", tableIDs(nGResetAcknowledgeIEs), []ProtocolIEID{IDUEAssociatedLogicalNGConnectionList, IDCriticalityDiagnostics}}, {"NGSetupRequest", tableIDs(nGSetupRequestIEs), []ProtocolIEID{IDGlobalRANNodeID, IDRANNodeName, IDSupportedTAList, IDDefaultPagingDRX, IDUERetentionInformation}}, - {"NGSetupResponse", tableIDs(nGSetupResponseIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList, IDCriticalityDiagnostics, IDUERetentionInformation}}, + {"NGSetupResponse", tableIDs(nGSetupResponseIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList, IDCriticalityDiagnostics, IDUERetentionInformation, IDExtendedAMFName}}, {"NGSetupFailure", tableIDs(nGSetupFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, {"NASNonDeliveryIndication", tableIDs(nASNonDeliveryIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDCause}}, {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDRANUENGAPID, IDNASPDU, IDUserLocationInformation, IDRRCEstablishmentCause, IDFiveGSTMSI, IDAMFSetID, IDUEContextRequest, IDAllowedNSSAI, IDGUAMI, IDGUAMIType, IDRequestedNSSAI}}, @@ -74,6 +74,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"PLMNSupportItem extensions", tableIDs(pLMNSupportItemExtIEs), []ProtocolIEID{IDNPNSupport, IDExtendedSliceSupportList, IDOnboardingSupport}}, {"AMFTNLAssociationToRemoveItem extensions", tableIDs(aMFTNLAssociationToRemoveItemExtIEs), []ProtocolIEID{IDTNLAssociationTransportLayerAddressNGRAN}}, {"ServedGUAMIItem extensions", tableIDs(servedGUAMIItemExtIEs), []ProtocolIEID{IDGUAMIType, IDExtendedBackupAMFName}}, + {"UnavailableGUAMIItem extensions", tableIDs(unavailableGUAMIItemExtIEs), []ProtocolIEID{IDExtendedBackupAMFName}}, {"OverloadStart", tableIDs(overloadStartIEs), []ProtocolIEID{IDAMFOverloadResponse, IDAMFTrafficLoadReductionIndication, IDOverloadStartNSSAIList, IDGUAMIList}}, {"OverloadStop", tableIDs(overloadStopIEs), []ProtocolIEID{IDGUAMIList}}, {"AMFConfigurationUpdateAcknowledge", tableIDs(aMFConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDAMFTNLAssociationSetupList, IDAMFTNLAssociationFailedToSetupList, IDCriticalityDiagnostics}}, diff --git a/ngap/wire_criticality_test.go b/ngap/wire_criticality_test.go index 128624e08a..f402a16eb4 100644 --- a/ngap/wire_criticality_test.go +++ b/ngap/wire_criticality_test.go @@ -68,6 +68,17 @@ func TestWireCriticality(t *testing.T) { {IDPLMNSupportList, CriticalityReject}, }, }, + { + "NGSetupResponse §9.2.6.2 Extended AMF Name", + goldNGSetupResponseExtendedAMFName().encodeBody, + []wireIE{ + {IDAMFName, CriticalityReject}, + {IDServedGUAMIList, CriticalityReject}, + {IDRelativeAMFCapacity, CriticalityIgnore}, + {IDPLMNSupportList, CriticalityReject}, + {IDExtendedAMFName, CriticalityIgnore}, + }, + }, { "NGSetupFailure §9.2.6.3", (&NGSetupFailure{ diff --git a/s1ap/enum_encode_test.go b/s1ap/enum_encode_test.go index e9e3961e49..de39f4596f 100644 --- a/s1ap/enum_encode_test.go +++ b/s1ap/enum_encode_test.go @@ -23,6 +23,7 @@ func TestEnumOutsideRootIsNotEncoded(t *testing.T) { {"TimeToWait", timeToWaitRootCount, func(v int64) per.Marshaler { return TimeToWait(v) }}, {"RRCEstablishmentCause", rrcEstablishmentCauseRootCount, func(v int64) per.Marshaler { return RRCEstablishmentCause(v) }}, {"UERetentionInformation", ueRetentionInformationRootCount, func(v int64) per.Marshaler { return UERetentionInformation(v) }}, + {"GWContextReleaseIndication", gwContextReleaseIndicationRootCount, func(v int64) per.Marshaler { return GWContextReleaseIndication(v) }}, // HandoverType is absent deliberately: TS 36.413 §9.2.1.13 assigns two // extension additions Ella encodes, so its bound is the assigned count diff --git a/s1ap/enum_extension_test.go b/s1ap/enum_extension_test.go index 7b2845def2..8be1eeee94 100644 --- a/s1ap/enum_extension_test.go +++ b/s1ap/enum_extension_test.go @@ -46,6 +46,10 @@ func TestEnumExtensionIsNotComprehended(t *testing.T) { var v RRCEstablishmentCause return v.UnmarshalPER(r, per.Aligned) }, "a root establishment cause"}, + {"GWContextReleaseIndication", gwContextReleaseIndicationRootCount, func(r *per.Reader) error { + var v GWContextReleaseIndication + return v.UnmarshalPER(r, per.Aligned) + }, "true"}, // HandoverType is absent deliberately: its first two extension additions // are values TS 36.413 §9.2.1.13 assigns and Ella decodes. // TestHandoverTypeInterSystemValues covers both those and the additions diff --git a/s1ap/ie_ids.go b/s1ap/ie_ids.go index a66a8bae40..d2ba5e560f 100644 --- a/s1ap/ie_ids.go +++ b/s1ap/ie_ids.go @@ -105,6 +105,7 @@ const ( IDPagingPriority ProtocolIEID = 151 IDGUMMEIList ProtocolIEID = 154 IDTrafficLoadReductionIndication ProtocolIEID = 161 + IDGWContextReleaseIndication ProtocolIEID = 164 IDECGIListForRestart ProtocolIEID = 182 IDTAIListForRestart ProtocolIEID = 188 IDUserLocationInformation ProtocolIEID = 189 diff --git a/s1ap/ie_names.go b/s1ap/ie_names.go index 9d535c206a..87c8fb5e12 100644 --- a/s1ap/ie_names.go +++ b/s1ap/ie_names.go @@ -123,6 +123,7 @@ var protocolIENames = map[ProtocolIEID]string{ IDExtendedRepetitionPeriod: "ExtendedRepetitionPeriod", IDGUMMEIList: "GUMMEIList", IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", + IDGWContextReleaseIndication: "GWContextReleaseIndication", IDECGIListForRestart: "ECGIListForRestart", IDTAIListForRestart: "TAIListForRestart", IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", diff --git a/s1ap/ie_ue.go b/s1ap/ie_ue.go index 61208de04b..bdc74b546a 100644 --- a/s1ap/ie_ue.go +++ b/s1ap/ie_ue.go @@ -300,3 +300,26 @@ func (c *RRCEstablishmentCause) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } + +type GWContextReleaseIndication uint8 + +const ( + GWContextReleaseIndicationTrue GWContextReleaseIndication = iota + + gwContextReleaseIndicationRootCount = 1 +) + +func (g GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, gwContextReleaseIndicationRootCount, int64(g), "GWContextReleaseIndication") +} + +func (g *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, gwContextReleaseIndicationRootCount, "GWContextReleaseIndication") + if err != nil { + return err + } + + *g = GWContextReleaseIndication(idx) + + return nil +} diff --git a/s1ap/pws_overload_test.go b/s1ap/pws_overload_test.go index c7442a28ee..86344c8673 100644 --- a/s1ap/pws_overload_test.go +++ b/s1ap/pws_overload_test.go @@ -58,7 +58,7 @@ func isInitiating(p PDU) bool { _, ok := p.(*InitiatingMessage); return ok } func isSuccessful(p PDU) bool { _, ok := p.(*SuccessfulOutcome); return ok } func newMessageCases() []newMessageCase { - return []newMessageCase{ + return append([]newMessageCase{ { name: "OverloadStart", msg: &OverloadStart{ @@ -238,7 +238,7 @@ func newMessageCases() []newMessageCase { parse: func(b []byte) (any, error) { return ParseRerouteNASRequest(b) }, choice: isInitiating, }, - } + }, uEContextReleaseRequestGoldenCases()...) } func TestNewMessagesRoundTrip(t *testing.T) { @@ -304,7 +304,8 @@ func TestNewMessagesWireCriticality(t *testing.T) { "KillResponse": {{IDMessageIdentifier, CriticalityReject}, {IDSerialNumber, CriticalityReject}, {IDBroadcastCancelledAreaList, CriticalityIgnore}}, "PWSRestartIndication": {{IDECGIListForRestart, CriticalityReject}, {IDGlobalENBID, CriticalityReject}, {IDTAIListForRestart, CriticalityReject}, {IDEmergencyAreaIDListForRestart, CriticalityReject}}, "PWSFailureIndication": {{IDPWSfailedECGIList, CriticalityReject}, {IDGlobalENBID, CriticalityReject}}, - "RerouteNASRequest": {{IDENBUES1APID, CriticalityReject}, {IDMMEUES1APID, CriticalityIgnore}, {IDS1Message, CriticalityReject}, {IDMMEGroupID, CriticalityReject}, {IDAdditionalGUTI, CriticalityIgnore}, {IDUEUsageType, CriticalityIgnore}}, + "UEContextReleaseRequestGWContextReleaseIndication": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDCause, CriticalityIgnore}, {IDGWContextReleaseIndication, CriticalityReject}}, + "RerouteNASRequest": {{IDENBUES1APID, CriticalityReject}, {IDMMEUES1APID, CriticalityIgnore}, {IDS1Message, CriticalityReject}, {IDMMEGroupID, CriticalityReject}, {IDAdditionalGUTI, CriticalityIgnore}, {IDUEUsageType, CriticalityIgnore}}, } for _, tc := range newMessageCases() { diff --git a/s1ap/table_order_test.go b/s1ap/table_order_test.go index a87fe28a6c..099969ca40 100644 --- a/s1ap/table_order_test.go +++ b/s1ap/table_order_test.go @@ -70,7 +70,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"UEContextModificationFailure", tableIDs(uEContextModificationFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"UEContextReleaseCommand", tableIDs(uEContextReleaseCommandIEs), []ProtocolIEID{IDUES1APIDs, IDCause}}, {"UEContextReleaseComplete", tableIDs(uEContextReleaseCompleteIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCriticalityDiagnostics, IDUserLocationInformation}}, - {"UEContextReleaseRequest", tableIDs(uEContextReleaseRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause}}, + {"UEContextReleaseRequest", tableIDs(uEContextReleaseRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDGWContextReleaseIndication}}, } for _, tt := range tests { diff --git a/s1ap/ue_context_release.go b/s1ap/ue_context_release.go index b4a9ad6018..e57da3840d 100644 --- a/s1ap/ue_context_release.go +++ b/s1ap/ue_context_release.go @@ -324,9 +324,10 @@ func ParseUEContextReleaseComplete(value []byte) (*UEContextReleaseComplete, err // TS 36.413 §9.1.4.5. type UEContextReleaseRequest struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - Cause *Cause + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + Cause *Cause + GWContextReleaseIndication *GWContextReleaseIndication messageMeta } @@ -367,6 +368,27 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ return m.Cause, true }, }, + { + id: IDGWContextReleaseIndication, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { + var v GWContextReleaseIndication + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.GWContextReleaseIndication = &v + + return nil + }, + encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { + if m.GWContextReleaseIndication == nil { + return nil, false + } + + return m.GWContextReleaseIndication, true + }, + }, } func (m *UEContextReleaseRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/ue_context_release_test.go b/s1ap/ue_context_release_test.go index 17222ce092..4368eaa1e8 100644 --- a/s1ap/ue_context_release_test.go +++ b/s1ap/ue_context_release_test.go @@ -163,3 +163,42 @@ func TestUEContextReleaseCommandExtensionAlternative(t *testing.T) { t.Errorf("diagnostics = %+v, want one not-understood entry for UE-S1AP-IDs", ase.IEs) } } + +func uEContextReleaseRequestGoldenCases() []newMessageCase { + x2 := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkX2HandoverTriggered} + + return []newMessageCase{ + { + name: "UEContextReleaseRequestGWContextReleaseIndication", + msg: &UEContextReleaseRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + Cause: &x2, + GWContextReleaseIndication: Ptr(GWContextReleaseIndicationTrue), + }, + parse: func(b []byte) (any, error) { return ParseUEContextReleaseRequest(b) }, + choice: isInitiating, + golden: "0012401a00000400000002000100080002000200024002046000a4000100", + }, + } +} + +func TestUEContextReleaseRequestGWContextReleaseIndicationExtensionRejects(t *testing.T) { + cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkX2HandoverTriggered} + + _, err := ParseUEContextReleaseRequest(container(t, + ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: Ptr(MMEUES1APID(1))}, + ieField{id: IDENBUES1APID, crit: CriticalityReject, val: Ptr(ENBUES1APID(2))}, + ieField{id: IDCause, crit: CriticalityIgnore, val: &cause}, + ieField{id: IDGWContextReleaseIndication, crit: CriticalityReject, raw: extensionEnum(t, gwContextReleaseIndicationRootCount, 0)}, + )) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) { + t.Fatalf("err = %v, want an AbstractSyntaxError", err) + } + + if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDGWContextReleaseIndication || ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { + t.Fatalf("IEs = %+v, want GWContextReleaseIndication not-understood", ase.IEs) + } +} diff --git a/s1ap/wire_criticality_test.go b/s1ap/wire_criticality_test.go index c58c5478dd..9168f3bb66 100644 --- a/s1ap/wire_criticality_test.go +++ b/s1ap/wire_criticality_test.go @@ -348,6 +348,21 @@ func TestWireCriticality(t *testing.T) { {IDCause, CriticalityIgnore}, }, }, + { + "UEContextReleaseRequest §9.1.4.5 GW Context Release Indication", + (&UEContextReleaseRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkX2HandoverTriggered}), + GWContextReleaseIndication: Ptr(GWContextReleaseIndicationTrue), + }).encodeBody, + []wireIE{ + {IDMMEUES1APID, CriticalityReject}, + {IDENBUES1APID, CriticalityReject}, + {IDCause, CriticalityIgnore}, + {IDGWContextReleaseIndication, CriticalityReject}, + }, + }, { "UEContextReleaseCommand §9.1.4.6", (&UEContextReleaseCommand{ From 0985fcf1cd49292dd1666f3b44c44de1852a5457 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sat, 14 Nov 2026 07:13:17 -0500 Subject: [PATCH 07/16] fix: review 3 Signed-off-by: Guillaume Belanger --- s1ap/fuzz_test.go | 15 ++++++ s1ap/handover_resource_allocation.go | 44 +++++++++++++++++ s1ap/handover_resource_allocation_test.go | 23 +++++++++ s1ap/ie_ids.go | 1 + s1ap/ie_names.go | 1 + s1ap/initial_context_setup.go | 44 +++++++++++++++++ s1ap/initial_context_setup_test.go | 24 +++++++++ s1ap/path_switch.go | 22 +++++++++ s1ap/path_switch_test.go | 17 +++++++ s1ap/pws_overload_test.go | 13 ++++- s1ap/table_order_test.go | 6 +-- s1ap/wire_criticality_test.go | 60 +++++++++++++++++++++++ 12 files changed, 265 insertions(+), 5 deletions(-) diff --git a/s1ap/fuzz_test.go b/s1ap/fuzz_test.go index 0c6421084a..8af9121721 100644 --- a/s1ap/fuzz_test.go +++ b/s1ap/fuzz_test.go @@ -4,6 +4,7 @@ package s1ap import ( + "encoding/hex" "testing" "github.com/ellanetworks/core/per" @@ -17,9 +18,23 @@ func FuzzDecodeNoPanic(f *testing.F) { f.Add([]byte{0x00, 0x11, 0x00, 0x02, 0x00, 0x00}) f.Add([]byte{0x20, 0x0a, 0x00, 0x00}) + for _, c := range newMessageCases() { + if c.golden == "" { + continue + } + + b, err := hex.DecodeString(c.golden) + if err != nil { + f.Fatal(err) + } + + f.Add(b) + } + f.Fuzz(func(t *testing.T, data []byte) { _, _ = unmarshalPERValue[Cause](data) _, _ = unmarshalPERValue[CriticalityDiagnostics](data) + _, _ = unmarshalPERValue[GUMMEI](data) pdu, err := Unmarshal(data) if err != nil { diff --git a/s1ap/handover_resource_allocation.go b/s1ap/handover_resource_allocation.go index e49f7a12ff..616dda26fb 100644 --- a/s1ap/handover_resource_allocation.go +++ b/s1ap/handover_resource_allocation.go @@ -27,6 +27,8 @@ type HandoverRequest struct { // C-iffromUTRANGERAN: present exactly when Handover Type is UTRANtoLTE or // GERANtoLTE (§9.1.5.4). NASSecurityParameterstoEUTRAN NASSecurityParameterstoEUTRAN + GUMMEI *GUMMEI + MMEUES1APID2 *MMEUES1APID messageMeta } @@ -178,6 +180,48 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.NASSecurityParameterstoEUTRAN, true }, }, + { + id: IDGUMMEI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + var v GUMMEI + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.GUMMEI = &v + + return nil + }, + encode: func(m *HandoverRequest) (per.Marshaler, bool) { + if m.GUMMEI == nil { + return nil, false + } + + return m.GUMMEI, true + }, + }, + { + id: IDMMEUES1APID2, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + var v MMEUES1APID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.MMEUES1APID2 = &v + + return nil + }, + encode: func(m *HandoverRequest) (per.Marshaler, bool) { + if m.MMEUES1APID2 == nil { + return nil, false + } + + return m.MMEUES1APID2, true + }, + }, } func (m *HandoverRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/handover_resource_allocation_test.go b/s1ap/handover_resource_allocation_test.go index 6cef18d2ae..ecfb8d2415 100644 --- a/s1ap/handover_resource_allocation_test.go +++ b/s1ap/handover_resource_allocation_test.go @@ -437,3 +437,26 @@ func TestHandoverRequestCarriesRestrictionList(t *testing.T) { t.Fatalf("restriction list = %+v, want none", out.HandoverRestrictionList) } } + +func handoverRequestGoldenCases() []newMessageCase { + return []newMessageCase{ + { + name: "HandoverRequestGUMMEIMMEUES1APID2", + msg: &HandoverRequest{ + MMEUES1APID: 1, + HandoverType: HandoverTypeIntraLTE, + Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + UEAMBR: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, + ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}, + SourceToTarget: TransparentContainer{0x00, 0x01, 0x80, 0x00, 0x00, 0xf1, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0xf1, 0x10, 0x00, 0x00, 0x10, 0x20, 0x80, 0x00, 0x0a}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0xc000}, + SecurityContext: SecurityContext{NextHopChainingCount: 3}, + GUMMEI: Ptr(goldGUMMEI()), + MMEUES1APID2: Ptr(MMEUES1APID(3)), + }, + parse: func(b []byte) (any, error) { return ParseHandoverRequest(b) }, + choice: isInitiating, + golden: "000100809000000a000000020001000100010000024002020000420008100f42404007a1200035001200001b000d0a1f0a0000010000000100090400680017160001800000f110000010100000f1100000102080000a006b000510000c000000280021180000000000000000000000000000000000000000000000000000000000000000004b40070000f110800102009e40020003", + }, + } +} diff --git a/s1ap/ie_ids.go b/s1ap/ie_ids.go index d2ba5e560f..437a44d6c0 100644 --- a/s1ap/ie_ids.go +++ b/s1ap/ie_ids.go @@ -104,6 +104,7 @@ const ( IDRoutingID ProtocolIEID = 148 IDPagingPriority ProtocolIEID = 151 IDGUMMEIList ProtocolIEID = 154 + IDMMEUES1APID2 ProtocolIEID = 158 IDTrafficLoadReductionIndication ProtocolIEID = 161 IDGWContextReleaseIndication ProtocolIEID = 164 IDECGIListForRestart ProtocolIEID = 182 diff --git a/s1ap/ie_names.go b/s1ap/ie_names.go index 87c8fb5e12..5fbb2cfcc2 100644 --- a/s1ap/ie_names.go +++ b/s1ap/ie_names.go @@ -122,6 +122,7 @@ var protocolIENames = map[ProtocolIEID]string{ IDConcurrentWarningMessageIndicator: "ConcurrentWarningMessageIndicator", IDExtendedRepetitionPeriod: "ExtendedRepetitionPeriod", IDGUMMEIList: "GUMMEIList", + IDMMEUES1APID2: "MME-UE-S1AP-ID-2", IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", IDGWContextReleaseIndication: "GWContextReleaseIndication", IDECGIListForRestart: "ECGIListForRestart", diff --git a/s1ap/initial_context_setup.go b/s1ap/initial_context_setup.go index 2b01c29de5..a9a8cfb9c3 100644 --- a/s1ap/initial_context_setup.go +++ b/s1ap/initial_context_setup.go @@ -16,6 +16,8 @@ type InitialContextSetupRequest struct { UESecurityCapabilities UESecurityCapabilities SecurityKey SecurityKey UERadioCapability UERadioCapability + GUMMEI *GUMMEI + MMEUES1APID2 *MMEUES1APID messageMeta } @@ -84,6 +86,48 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UERadioCapability, true }, }, + { + id: IDGUMMEI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + var v GUMMEI + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.GUMMEI = &v + + return nil + }, + encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + if m.GUMMEI == nil { + return nil, false + } + + return m.GUMMEI, true + }, + }, + { + id: IDMMEUES1APID2, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + var v MMEUES1APID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.MMEUES1APID2 = &v + + return nil + }, + encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + if m.MMEUES1APID2 == nil { + return nil, false + } + + return m.MMEUES1APID2, true + }, + }, } func (m *InitialContextSetupRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/initial_context_setup_test.go b/s1ap/initial_context_setup_test.go index 1ec03f36b5..f7d0f7334c 100644 --- a/s1ap/initial_context_setup_test.go +++ b/s1ap/initial_context_setup_test.go @@ -213,3 +213,27 @@ func TestInitialContextSetupRequestMissingRejectIE(t *testing.T) { } } } + +func goldGUMMEI() GUMMEI { + return GUMMEI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, MMEGroupID: MMEGroupID{0x80, 0x01}, MMECode: 0x02} +} + +func initialContextSetupRequestGoldenCases() []newMessageCase { + return []newMessageCase{ + { + name: "InitialContextSetupRequestGUMMEIMMEUES1APID2", + msg: &InitialContextSetupRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, + ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0xc000}, + GUMMEI: Ptr(goldGUMMEI()), + MMEUES1APID2: Ptr(MMEUES1APID(3)), + }, + parse: func(b []byte) (any, error) { return ParseInitialContextSetupRequest(b) }, + choice: isInitiating, + golden: "0009007000000800000002000100080002000200420008100f42404007a12000180013000034000e050009040f800a00000100000001006b000510000c0000004900200000000000000000000000000000000000000000000000000000000000000000004b40070000f110800102009e40020003", + }, + } +} diff --git a/s1ap/path_switch.go b/s1ap/path_switch.go index 1c2a777ed4..3715ba57ba 100644 --- a/s1ap/path_switch.go +++ b/s1ap/path_switch.go @@ -155,6 +155,7 @@ type PathSwitchRequestAcknowledge struct { ENBUES1APID *ENBUES1APID UEAggregateMaximumBitRate *UEAggregateMaximumBitRate SecurityContext SecurityContext + MMEUES1APID2 *MMEUES1APID UESecurityCapabilities *UESecurityCapabilities // E-RABs the MME failed to switch the UP path for, whose data radio bearers // the eNB releases (§8.4.4.2). @@ -257,6 +258,27 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return &m.SecurityContext, true }, }, + { + id: IDMMEUES1APID2, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + var v MMEUES1APID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.MMEUES1APID2 = &v + + return nil + }, + encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + if m.MMEUES1APID2 == nil { + return nil, false + } + + return m.MMEUES1APID2, true + }, + }, { id: IDUESecurityCapabilities, presence: presenceOptional, crit: CriticalityIgnore, decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { diff --git a/s1ap/path_switch_test.go b/s1ap/path_switch_test.go index 77814e2782..0e3efd6af3 100644 --- a/s1ap/path_switch_test.go +++ b/s1ap/path_switch_test.go @@ -193,3 +193,20 @@ func TestPathSwitchRequestFailureRoundTrip(t *testing.T) { t.Fatalf("failure = %+v, want %+v", out, in) } } + +func pathSwitchRequestAcknowledgeGoldenCases() []newMessageCase { + return []newMessageCase{ + { + name: "PathSwitchRequestAcknowledgeMMEUES1APID2", + msg: &PathSwitchRequestAcknowledge{ + MMEUES1APID: Ptr(MMEUES1APID(1)), + ENBUES1APID: Ptr(ENBUES1APID(2)), + SecurityContext: SecurityContext{NextHopChainingCount: 3}, + MMEUES1APID2: Ptr(MMEUES1APID(3)), + }, + parse: func(b []byte) (any, error) { return ParsePathSwitchRequestAcknowledge(b) }, + choice: isSuccessful, + golden: "2003003a00000400004002000100084002000200280021180000000000000000000000000000000000000000000000000000000000000000009e40020003", + }, + } +} diff --git a/s1ap/pws_overload_test.go b/s1ap/pws_overload_test.go index 86344c8673..b0e0b254ea 100644 --- a/s1ap/pws_overload_test.go +++ b/s1ap/pws_overload_test.go @@ -8,6 +8,7 @@ import ( "errors" "os" "reflect" + "slices" "testing" "github.com/ellanetworks/core/per" @@ -238,7 +239,12 @@ func newMessageCases() []newMessageCase { parse: func(b []byte) (any, error) { return ParseRerouteNASRequest(b) }, choice: isInitiating, }, - }, uEContextReleaseRequestGoldenCases()...) + }, slices.Concat( + uEContextReleaseRequestGoldenCases(), + initialContextSetupRequestGoldenCases(), + handoverRequestGoldenCases(), + pathSwitchRequestAcknowledgeGoldenCases(), + )...) } func TestNewMessagesRoundTrip(t *testing.T) { @@ -305,7 +311,10 @@ func TestNewMessagesWireCriticality(t *testing.T) { "PWSRestartIndication": {{IDECGIListForRestart, CriticalityReject}, {IDGlobalENBID, CriticalityReject}, {IDTAIListForRestart, CriticalityReject}, {IDEmergencyAreaIDListForRestart, CriticalityReject}}, "PWSFailureIndication": {{IDPWSfailedECGIList, CriticalityReject}, {IDGlobalENBID, CriticalityReject}}, "UEContextReleaseRequestGWContextReleaseIndication": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDCause, CriticalityIgnore}, {IDGWContextReleaseIndication, CriticalityReject}}, - "RerouteNASRequest": {{IDENBUES1APID, CriticalityReject}, {IDMMEUES1APID, CriticalityIgnore}, {IDS1Message, CriticalityReject}, {IDMMEGroupID, CriticalityReject}, {IDAdditionalGUTI, CriticalityIgnore}, {IDUEUsageType, CriticalityIgnore}}, + "InitialContextSetupRequestGUMMEIMMEUES1APID2": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDUEAggregateMaximumBitrate, CriticalityReject}, {IDERABToBeSetupListCtxtSUReq, CriticalityReject}, {IDUESecurityCapabilities, CriticalityReject}, {IDSecurityKey, CriticalityReject}, {IDGUMMEI, CriticalityIgnore}, {IDMMEUES1APID2, CriticalityIgnore}}, + "HandoverRequestGUMMEIMMEUES1APID2": {{IDMMEUES1APID, CriticalityReject}, {IDHandoverType, CriticalityReject}, {IDCause, CriticalityIgnore}, {IDUEAggregateMaximumBitrate, CriticalityReject}, {IDERABToBeSetupListHOReq, CriticalityReject}, {IDSourceToTargetTransparentContainer, CriticalityReject}, {IDUESecurityCapabilities, CriticalityReject}, {IDSecurityContext, CriticalityReject}, {IDGUMMEI, CriticalityIgnore}, {IDMMEUES1APID2, CriticalityIgnore}}, + "PathSwitchRequestAcknowledgeMMEUES1APID2": {{IDMMEUES1APID, CriticalityIgnore}, {IDENBUES1APID, CriticalityIgnore}, {IDSecurityContext, CriticalityReject}, {IDMMEUES1APID2, CriticalityIgnore}}, + "RerouteNASRequest": {{IDENBUES1APID, CriticalityReject}, {IDMMEUES1APID, CriticalityIgnore}, {IDS1Message, CriticalityReject}, {IDMMEGroupID, CriticalityReject}, {IDAdditionalGUTI, CriticalityIgnore}, {IDUEUsageType, CriticalityIgnore}}, } for _, tc := range newMessageCases() { diff --git a/s1ap/table_order_test.go b/s1ap/table_order_test.go index 099969ca40..51dd7f3010 100644 --- a/s1ap/table_order_test.go +++ b/s1ap/table_order_test.go @@ -42,10 +42,10 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"HandoverRequired", tableIDs(handoverRequiredIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDHandoverType, IDCause, IDTargetID, IDDirectForwardingPathAvailability, IDSourceToTargetTransparentContainer}}, {"HandoverCommand", tableIDs(handoverCommandIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDHandoverType, IDNASSecurityParametersfromEUTRAN, IDERABSubjecttoDataForwardingList, IDERABtoReleaseListHOCmd, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverPreparationFailure", tableIDs(handoverPreparationFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDHandoverType, IDCause, IDUEAggregateMaximumBitrate, IDERABToBeSetupListHOReq, IDSourceToTargetTransparentContainer, IDUESecurityCapabilities, IDHandoverRestrictionList, IDTraceActivation, IDSecurityContext, IDNASSecurityParameterstoEUTRAN}}, + {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDHandoverType, IDCause, IDUEAggregateMaximumBitrate, IDERABToBeSetupListHOReq, IDSourceToTargetTransparentContainer, IDUESecurityCapabilities, IDHandoverRestrictionList, IDTraceActivation, IDSecurityContext, IDNASSecurityParameterstoEUTRAN, IDGUMMEI, IDMMEUES1APID2}}, {"HandoverRequestAcknowledge", tableIDs(handoverRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABAdmittedList, IDERABFailedToSetupListHOReqAck, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverFailure", tableIDs(handoverFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSetupListCtxtSUReq, IDUESecurityCapabilities, IDSecurityKey, IDUERadioCapability}}, + {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSetupListCtxtSUReq, IDUESecurityCapabilities, IDSecurityKey, IDUERadioCapability, IDGUMMEI, IDMMEUES1APID2}}, {"InitialContextSetupResponse", tableIDs(initialContextSetupResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABSetupListCtxtSURes, IDERABFailedToSetupListCtxtSURes, IDCriticalityDiagnostics}}, {"InitialContextSetupFailure", tableIDs(initialContextSetupFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"LocationReport", tableIDs(locationReportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANCGI, IDTAI, IDRequestType}}, @@ -55,7 +55,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU}}, {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEIdentityIndexValue, IDUEPagingID, IDPagingDRX, IDCNDomain, IDTAIList, IDPagingPriority, IDUERadioCapabilityForPaging}}, {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDENBUES1APID, IDERABToBeSwitchedDLList, IDSourceMMEUES1APID, IDEUTRANCGI, IDTAI, IDUESecurityCapabilities}}, - {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeReleasedList, IDSecurityContext, IDUESecurityCapabilities}}, + {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeReleasedList, IDSecurityContext, IDMMEUES1APID2, IDUESecurityCapabilities}}, {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"Reset", tableIDs(resetIEs), []ProtocolIEID{IDCause, IDResetType}}, {"ResetAcknowledge", tableIDs(resetAcknowledgeIEs), []ProtocolIEID{IDUEAssociatedLogicalS1ConnectionListResAck, IDCriticalityDiagnostics}}, diff --git a/s1ap/wire_criticality_test.go b/s1ap/wire_criticality_test.go index 9168f3bb66..d360004210 100644 --- a/s1ap/wire_criticality_test.go +++ b/s1ap/wire_criticality_test.go @@ -70,6 +70,44 @@ func TestWireCriticality(t *testing.T) { {IDCause, CriticalityIgnore}, }, }, + { + "HandoverRequest §9.1.5.4 GUMMEI and MME UE S1AP ID 2", + (&HandoverRequest{ + Cause: new(Cause), + SourceToTarget: TransparentContainer{0x00}, + ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}, + GUMMEI: Ptr(goldGUMMEI()), + MMEUES1APID2: Ptr(MMEUES1APID(3)), + }).encodeBody, + []wireIE{ + {IDMMEUES1APID, CriticalityReject}, + {IDHandoverType, CriticalityReject}, + {IDCause, CriticalityIgnore}, + {IDUEAggregateMaximumBitrate, CriticalityReject}, + {IDERABToBeSetupListHOReq, CriticalityReject}, + {IDSourceToTargetTransparentContainer, CriticalityReject}, + {IDUESecurityCapabilities, CriticalityReject}, + {IDSecurityContext, CriticalityReject}, + {IDGUMMEI, CriticalityIgnore}, + {IDMMEUES1APID2, CriticalityIgnore}, + }, + }, + { + "PathSwitchRequestAcknowledge §9.1.5.9 MME UE S1AP ID 2", + (&PathSwitchRequestAcknowledge{ + MMEUES1APID: Ptr(MMEUES1APID(1)), + ENBUES1APID: Ptr(ENBUES1APID(2)), + MMEUES1APID2: Ptr(MMEUES1APID(3)), + UESecurityCapabilities: &UESecurityCapabilities{}, + }).encodeBody, + []wireIE{ + {IDMMEUES1APID, CriticalityIgnore}, + {IDENBUES1APID, CriticalityIgnore}, + {IDSecurityContext, CriticalityReject}, + {IDMMEUES1APID2, CriticalityIgnore}, + {IDUESecurityCapabilities, CriticalityIgnore}, + }, + }, { "PathSwitchRequestFailure §9.1.5.10", (&PathSwitchRequestFailure{ @@ -262,6 +300,28 @@ func TestWireCriticality(t *testing.T) { {IDUERadioCapability, CriticalityIgnore}, }, }, + { + "InitialContextSetupRequest §9.1.4.1 GUMMEI and MME UE S1AP ID 2", + (&InitialContextSetupRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}, + UERadioCapability: UERadioCapability{0x01}, + GUMMEI: Ptr(goldGUMMEI()), + MMEUES1APID2: Ptr(MMEUES1APID(3)), + }).encodeBody, + []wireIE{ + {IDMMEUES1APID, CriticalityReject}, + {IDENBUES1APID, CriticalityReject}, + {IDUEAggregateMaximumBitrate, CriticalityReject}, + {IDERABToBeSetupListCtxtSUReq, CriticalityReject}, + {IDUESecurityCapabilities, CriticalityReject}, + {IDSecurityKey, CriticalityReject}, + {IDUERadioCapability, CriticalityIgnore}, + {IDGUMMEI, CriticalityIgnore}, + {IDMMEUES1APID2, CriticalityIgnore}, + }, + }, { "InitialContextSetupResponse §9.1.4.3", (&InitialContextSetupResponse{ From d3cf6266d69ab270da999055e3cca28de3874274 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sat, 14 Nov 2026 07:22:37 -0500 Subject: [PATCH 08/16] fix: decoder Signed-off-by: Guillaume Belanger --- .../decoder/ngap/amf_status_indication.go | 26 +++- .../ngap/amf_status_indication_test.go | 2 +- internal/decoder/ngap/modeled_ies_test.go | 66 +++++++++ internal/decoder/ngap/ng_setup.go | 4 + internal/decoder/s1ap/golden_test.go | 3 + internal/decoder/s1ap/handover.go | 8 ++ .../decoder/s1ap/initial_context_setup.go | 8 ++ internal/decoder/s1ap/modeled_ies_test.go | 128 ++++++++++++++++++ internal/decoder/s1ap/path_switch.go | 4 + .../golden/handover_request_full.json | 37 +++++ .../path_switch_request_acknowledge_full.json | 15 ++ internal/decoder/s1ap/ue_context_release.go | 4 + 12 files changed, 302 insertions(+), 3 deletions(-) create mode 100644 internal/decoder/s1ap/modeled_ies_test.go diff --git a/internal/decoder/ngap/amf_status_indication.go b/internal/decoder/ngap/amf_status_indication.go index bd2023143f..03f889bd93 100644 --- a/internal/decoder/ngap/amf_status_indication.go +++ b/internal/decoder/ngap/amf_status_indication.go @@ -9,6 +9,13 @@ import ( "github.com/ellanetworks/core/ngap" ) +type UnavailableGUAMI struct { + Guami + TimerApproachForGUAMIRemoval bool `json:"timer_approach_for_guami_removal,omitempty"` + BackupAMFName *string `json:"backup_amf_name,omitempty"` + ExtendedBackupAMFName *ExtendedAMFName `json:"extended_backup_amf_name,omitempty"` +} + // AMF Status Indication tells the NG-RAN node which GUAMIs this AMF can no // longer serve (TS 38.413 §8.7.6). TS 36.413 defines no counterpart. func buildAMFStatusIndication(value []byte) NGAPMessageValue { @@ -17,9 +24,24 @@ func buildAMFStatusIndication(value []byte) NGAPMessageValue { return NGAPMessageValue{Error: fmt.Sprintf("parse AMF Status Indication: %v", err)} } - guamis := make([]Guami, 0, len(m.UnavailableGUAMIList)) + guamis := make([]UnavailableGUAMI, 0, len(m.UnavailableGUAMIList)) for _, item := range m.UnavailableGUAMIList { - guamis = append(guamis, guami(item.GUAMI)) + entry := UnavailableGUAMI{ + Guami: guami(item.GUAMI), + TimerApproachForGUAMIRemoval: item.TimerApproachForGUAMIRemoval != nil, + } + + if item.BackupAMFName != nil { + name := string(*item.BackupAMFName) + entry.BackupAMFName = &name + } + + if item.ExtendedBackupAMFName != nil { + name := extendedAMFName(*item.ExtendedBackupAMFName) + entry.ExtendedBackupAMFName = &name + } + + guamis = append(guamis, entry) } ies := []IE{ie(ngap.IDUnavailableGUAMIList, ngap.CriticalityReject, guamis)} diff --git a/internal/decoder/ngap/amf_status_indication_test.go b/internal/decoder/ngap/amf_status_indication_test.go index 33f04af7e4..a90f46896e 100644 --- a/internal/decoder/ngap/amf_status_indication_test.go +++ b/internal/decoder/ngap/amf_status_indication_test.go @@ -47,7 +47,7 @@ func TestDecodeNGAPMessage_AMFStatusIndication(t *testing.T) { t.Errorf("Criticality = %v, want reject", item0.Criticality) } - unavailableGuamiList, ok := item0.Value.([]Guami) + unavailableGuamiList, ok := item0.Value.([]UnavailableGUAMI) if !ok { t.Fatalf("expected UnavailableGUAMIList type, got %T", item0.Value) } diff --git a/internal/decoder/ngap/modeled_ies_test.go b/internal/decoder/ngap/modeled_ies_test.go index a26cbb5910..d5747d3d95 100644 --- a/internal/decoder/ngap/modeled_ies_test.go +++ b/internal/decoder/ngap/modeled_ies_test.go @@ -103,6 +103,24 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { ExtendedBackupAMFName: &lib.ExtendedAMFName{AMFNameVisibleString: lib.Ptr(lib.AMFNameVisibleString("backup-extended"))}, }}, }), + "ng_setup_response_extended_amf_name": mustMarshal(t, &lib.NGSetupResponse{ + AMFName: "amf", + RelativeAMFCapacity: lib.Ptr(uint8(255)), + ServedGUAMIList: lib.ServedGUAMIList{{GUAMI: guamis[0].GUAMI}}, + PLMNSupportList: lib.PLMNSupportList{{ + PLMNIdentity: testPLMN, + SliceSupportList: lib.SliceSupportList{{SNSSAI: lib.SNSSAI{SST: 1}}}, + }}, + ExtendedAMFName: &lib.ExtendedAMFName{AMFNameUTF8String: lib.Ptr(lib.AMFNameUTF8String("ella"))}, + }), + "amf_status_indication_unavailable_guami_extensions": mustMarshal(t, &lib.AMFStatusIndication{ + UnavailableGUAMIList: lib.UnavailableGUAMIList{{ + GUAMI: guamis[0].GUAMI, + TimerApproachForGUAMIRemoval: lib.Ptr(lib.TimerApproachApplyTimer), + BackupAMFName: lib.Ptr(lib.Name("backup")), + ExtendedBackupAMFName: &lib.ExtendedAMFName{AMFNameVisibleString: lib.Ptr(lib.AMFNameVisibleString("backup-extended"))}, + }}, + }), "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &lib.UEContextReleaseRequest{ AMFUENGAPID: 1, RANUENGAPID: 2, @@ -121,6 +139,22 @@ func TestDecodeNGAPMessage_ModeledIEs(t *testing.T) { t.Fatalf("decode error: %s", msg.Value.Error) } + pdu, err := lib.ParseRawPDU(raw) + if err != nil { + t.Fatal(err) + } + + wire := pdu.IEs() + if len(wire) != len(msg.Value.IEs) { + t.Fatalf("rendered %d IEs, want the %d on the wire", len(msg.Value.IEs), len(wire)) + } + + for i, w := range wire { + if msg.Value.IEs[i].ID.Value != int64(w.ID) { + t.Errorf("IE %d = %d, want %d", i, msg.Value.IEs[i].ID.Value, w.ID) + } + } + for _, e := range msg.Value.IEs { if e.ID.Unknown { t.Errorf("IE %d rendered as unknown", e.ID.Value) @@ -190,3 +224,35 @@ func TestDecodeNGAPMessage_ServedGUAMIExtensions(t *testing.T) { t.Fatalf("Extended Backup AMF Name = %+v", got.ExtendedBackupAMFName) } } + +func TestDecodeNGAPMessage_NGSetupResponseExtendedAMFName(t *testing.T) { + ies := DecodeNGAPMessage(modeledIEsCorpus(t)["ng_setup_response_extended_amf_name"]).Value.IEs + + last := ies[len(ies)-1] + if last.ID.Value != int64(lib.IDExtendedAMFName) || last.Criticality.Value != int64(lib.CriticalityIgnore) { + t.Fatalf("IEs = %+v, want Extended AMF Name last", ies) + } + + name, ok := last.Value.(ExtendedAMFName) + if !ok || name.UTF8String == nil || *name.UTF8String != "ella" { + t.Fatalf("Extended AMF Name = %+v", last.Value) + } +} + +func TestDecodeNGAPMessage_UnavailableGUAMIExtensions(t *testing.T) { + msg := DecodeNGAPMessage(modeledIEsCorpus(t)["amf_status_indication_unavailable_guami_extensions"]) + + list, ok := msg.Value.IEs[0].Value.([]UnavailableGUAMI) + if !ok || len(list) != 1 { + t.Fatalf("Unavailable GUAMI List = %+v", msg.Value.IEs[0].Value) + } + + got := list[0] + if got.AMFRegionID == "" || !got.TimerApproachForGUAMIRemoval || got.BackupAMFName == nil || *got.BackupAMFName != "backup" { + t.Fatalf("unavailable GUAMI = %+v", got) + } + + if got.ExtendedBackupAMFName == nil || got.ExtendedBackupAMFName.VisibleString == nil || *got.ExtendedBackupAMFName.VisibleString != "backup-extended" { + t.Fatalf("Extended Backup AMF Name = %+v", got.ExtendedBackupAMFName) + } +} diff --git a/internal/decoder/ngap/ng_setup.go b/internal/decoder/ngap/ng_setup.go index cea7e23197..c0d007122c 100644 --- a/internal/decoder/ngap/ng_setup.go +++ b/internal/decoder/ngap/ng_setup.go @@ -237,6 +237,10 @@ func buildNGSetupResponse(value []byte) NGAPMessageValue { buildUERetention(*resp.UERetentionInformation))) } + if resp.ExtendedAMFName != nil { + ies = append(ies, ie(ngap.IDExtendedAMFName, ngap.CriticalityIgnore, extendedAMFName(*resp.ExtendedAMFName))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(resp.UnknownIEs())...)} } diff --git a/internal/decoder/s1ap/golden_test.go b/internal/decoder/s1ap/golden_test.go index 1c6f784215..2eeb19d2b7 100644 --- a/internal/decoder/s1ap/golden_test.go +++ b/internal/decoder/s1ap/golden_test.go @@ -218,6 +218,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { {ERABID: 6, Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}}, }, SecurityContext: s1ap.SecurityContext{NextHopChainingCount: 3, NextHopParameter: s1ap.SecurityKey{0x01, 0x02, 0x03}}, + MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(5)), UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xe000, IntegrityProtectionAlgorithms: 0xe000}), }) @@ -363,6 +364,8 @@ func goldenCorpus(t *testing.T) map[string][]byte { }, SecurityContext: s1ap.SecurityContext{NextHopChainingCount: 1}, NASSecurityParameterstoEUTRAN: s1ap.NASSecurityParameterstoEUTRAN{0x0a, 0x0b}, + GUMMEI: &s1ap.GUMMEI{PLMNIdentity: testPLMN, MMEGroupID: s1ap.MMEGroupID{0x80, 0x01}, MMECode: 0x02}, + MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(8)), }) corpus["handover_request_acknowledge_full"] = mustMarshal(t, &s1ap.HandoverRequestAcknowledge{ diff --git a/internal/decoder/s1ap/handover.go b/internal/decoder/s1ap/handover.go index 815834182f..2f76daae28 100644 --- a/internal/decoder/s1ap/handover.go +++ b/internal/decoder/s1ap/handover.go @@ -198,6 +198,14 @@ func buildHandoverRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDNASSecurityParameterstoEUTRAN, s1ap.CriticalityReject, hex.EncodeToString(m.NASSecurityParameterstoEUTRAN))) } + if m.GUMMEI != nil { + ies = append(ies, ie(s1ap.IDGUMMEI, s1ap.CriticalityIgnore, gummei(*m.GUMMEI))) + } + + if m.MMEUES1APID2 != nil { + ies = append(ies, ie(s1ap.IDMMEUES1APID2, s1ap.CriticalityIgnore, uint32(*m.MMEUES1APID2))) + } + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Handover Request (MME-UE %d, %d E-RAB)", m.MMEUES1APID, len(m.ERABToBeSetup)) diff --git a/internal/decoder/s1ap/initial_context_setup.go b/internal/decoder/s1ap/initial_context_setup.go index aa6e39cdda..f4564e67f8 100644 --- a/internal/decoder/s1ap/initial_context_setup.go +++ b/internal/decoder/s1ap/initial_context_setup.go @@ -111,6 +111,14 @@ func buildInitialContextSetupRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUERadioCapability, s1ap.CriticalityIgnore, rrc.DescribeS1AP(m.UERadioCapability))) } + if m.GUMMEI != nil { + ies = append(ies, ie(s1ap.IDGUMMEI, s1ap.CriticalityIgnore, gummei(*m.GUMMEI))) + } + + if m.MMEUES1APID2 != nil { + ies = append(ies, ie(s1ap.IDMMEUES1APID2, s1ap.CriticalityIgnore, uint32(*m.MMEUES1APID2))) + } + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Initial Context Setup Request (MME-UE %d, eNB-UE %d, %d E-RAB)", m.MMEUES1APID, m.ENBUES1APID, len(m.ERABToBeSetup)) diff --git a/internal/decoder/s1ap/modeled_ies_test.go b/internal/decoder/s1ap/modeled_ies_test.go new file mode 100644 index 0000000000..0c020211db --- /dev/null +++ b/internal/decoder/s1ap/modeled_ies_test.go @@ -0,0 +1,128 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "testing" + + "github.com/ellanetworks/core/s1ap" +) + +func modeledIEsCorpus(t *testing.T) map[string][]byte { + t.Helper() + + gummeiID := s1ap.GUMMEI{PLMNIdentity: testPLMN, MMEGroupID: s1ap.MMEGroupID{0x80, 0x01}, MMECode: 0x02} + + return map[string][]byte{ + "initial_context_setup_request_gummei_mme_ue_s1ap_id_2": mustMarshal(t, &s1ap.InitialContextSetupRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + ERABToBeSetup: []s1ap.ERABToBeSetupItemCtxtSUReq{{ + ERABID: 5, + QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, + TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 1}, + GTPTEID: 1, + }}, + GUMMEI: &gummeiID, + MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(3)), + }), + "handover_request_gummei_mme_ue_s1ap_id_2": mustMarshal(t, &s1ap.HandoverRequest{ + MMEUES1APID: 1, + HandoverType: s1ap.HandoverTypeIntraLTE, + Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, + SourceToTarget: s1ap.TransparentContainer{0x00}, + ERABToBeSetup: []s1ap.ERABToBeSetupItemHOReq{{ + ERABID: 5, + TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 1}, + GTPTEID: 1, + QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, + }}, + GUMMEI: &gummeiID, + MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(3)), + }), + "path_switch_request_acknowledge_mme_ue_s1ap_id_2": mustMarshal(t, &s1ap.PathSwitchRequestAcknowledge{ + MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(1)), + ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), + MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(3)), + }), + "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &s1ap.UEContextReleaseRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkX2HandoverTriggered}, + GWContextReleaseIndication: s1ap.Ptr(s1ap.GWContextReleaseIndicationTrue), + }), + } +} + +func TestDecodeS1APMessage_ModeledIEs(t *testing.T) { + for name, raw := range modeledIEsCorpus(t) { + t.Run(name, func(t *testing.T) { + msg := DecodeS1APMessage(raw) + + if msg.Value.Error != "" { + t.Fatalf("decode error: %s", msg.Value.Error) + } + + pdu, err := s1ap.ParseRawPDU(raw) + if err != nil { + t.Fatal(err) + } + + wire := pdu.IEs() + if len(wire) != len(msg.Value.IEs) { + t.Fatalf("rendered %d IEs, want the %d on the wire", len(msg.Value.IEs), len(wire)) + } + + for i, w := range wire { + if msg.Value.IEs[i].ID.Value != int64(w.ID) { + t.Errorf("IE %d = %d, want %d", i, msg.Value.IEs[i].ID.Value, w.ID) + } + } + + for _, e := range msg.Value.IEs { + if e.ID.Unknown { + t.Errorf("IE %d rendered as unknown", e.ID.Value) + } + + if _, raw := e.Value.(rawIEValue); raw { + t.Errorf("IE %s rendered as unmodeled", e.ID.Label) + } + } + }) + } +} + +func TestDecodeS1APMessage_GUMMEIAndMMEUES1APID2(t *testing.T) { + for _, name := range []string{"initial_context_setup_request_gummei_mme_ue_s1ap_id_2", "handover_request_gummei_mme_ue_s1ap_id_2"} { + t.Run(name, func(t *testing.T) { + ies := DecodeS1APMessage(modeledIEsCorpus(t)[name]).Value.IEs + if len(ies) < 2 { + t.Fatalf("IEs = %+v", ies) + } + + g, id2 := ies[len(ies)-2], ies[len(ies)-1] + + if g.ID.Value != int64(s1ap.IDGUMMEI) || g.Criticality.Value != int64(s1ap.CriticalityIgnore) { + t.Fatalf("GUMMEI IE = %+v", g) + } + + if v, ok := g.Value.(GUMMEI); !ok || v != gummei(s1ap.GUMMEI{PLMNIdentity: testPLMN, MMEGroupID: s1ap.MMEGroupID{0x80, 0x01}, MMECode: 0x02}) { + t.Fatalf("GUMMEI = %#v", g.Value) + } + + if id2.ID.Value != int64(s1ap.IDMMEUES1APID2) || id2.Criticality.Value != int64(s1ap.CriticalityIgnore) || id2.Value != uint32(3) { + t.Fatalf("MME UE S1AP ID 2 IE = %+v", id2) + } + }) + } +} + +func TestDecodeS1APMessage_UEContextReleaseRequestGWContextReleaseIndication(t *testing.T) { + ies := DecodeS1APMessage(modeledIEsCorpus(t)["ue_context_release_request_gw_context_release_indication"]).Value.IEs + + last := ies[len(ies)-1] + if last.ID.Value != int64(s1ap.IDGWContextReleaseIndication) || last.Criticality.Value != int64(s1ap.CriticalityReject) || last.Value != true { + t.Fatalf("IEs = %+v, want GW Context Release Indication true last", ies) + } +} diff --git a/internal/decoder/s1ap/path_switch.go b/internal/decoder/s1ap/path_switch.go index 53a85f9f61..eb473d7a3c 100644 --- a/internal/decoder/s1ap/path_switch.go +++ b/internal/decoder/s1ap/path_switch.go @@ -84,6 +84,10 @@ func buildPathSwitchRequestAcknowledge(value []byte) (S1APMessageValue, string) ies = append(ies, ie(s1ap.IDSecurityContext, s1ap.CriticalityReject, securityContext(m.SecurityContext))) + if m.MMEUES1APID2 != nil { + ies = append(ies, ie(s1ap.IDMMEUES1APID2, s1ap.CriticalityIgnore, uint32(*m.MMEUES1APID2))) + } + if m.UESecurityCapabilities != nil { ies = append(ies, ie(s1ap.IDUESecurityCapabilities, s1ap.CriticalityIgnore, UESecurityCapabilities{ EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms, "EEA"), diff --git a/internal/decoder/s1ap/testdata/golden/handover_request_full.json b/internal/decoder/s1ap/testdata/golden/handover_request_full.json index 98668e8b6a..5736f39e29 100644 --- a/internal/decoder/s1ap/testdata/golden/handover_request_full.json +++ b/internal/decoder/s1ap/testdata/golden/handover_request_full.json @@ -248,6 +248,43 @@ "unknown": false }, "value": "0a0b" + }, + { + "id": { + "type": "enum", + "value": 75, + "label": "GUMMEI-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "mme_group_id": 32769, + "mme_code": 2 + } + }, + { + "id": { + "type": "enum", + "value": 158, + "label": "MME-UE-S1AP-ID-2", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 8 } ] } diff --git a/internal/decoder/s1ap/testdata/golden/path_switch_request_acknowledge_full.json b/internal/decoder/s1ap/testdata/golden/path_switch_request_acknowledge_full.json index 350ed81061..ca70a5a8fc 100644 --- a/internal/decoder/s1ap/testdata/golden/path_switch_request_acknowledge_full.json +++ b/internal/decoder/s1ap/testdata/golden/path_switch_request_acknowledge_full.json @@ -114,6 +114,21 @@ "next_hop_parameter": "0102030000000000000000000000000000000000000000000000000000000000" } }, + { + "id": { + "type": "enum", + "value": 158, + "label": "MME-UE-S1AP-ID-2", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 5 + }, { "id": { "type": "enum", diff --git a/internal/decoder/s1ap/ue_context_release.go b/internal/decoder/s1ap/ue_context_release.go index 2258f469bc..e87a7b5fa1 100644 --- a/internal/decoder/s1ap/ue_context_release.go +++ b/internal/decoder/s1ap/ue_context_release.go @@ -24,6 +24,10 @@ func buildUEContextReleaseRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDCause, s1ap.CriticalityIgnore, cause(*m.Cause))) } + if m.GWContextReleaseIndication != nil { + ies = append(ies, ie(s1ap.IDGWContextReleaseIndication, s1ap.CriticalityReject, true)) + } + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("UE Context Release Request (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) From 8789a97b3eb72d1bc7921f9775a8fd327e4d2fdf Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sat, 14 Nov 2026 11:26:05 -0500 Subject: [PATCH 09/16] feat: add missing handover codecs Signed-off-by: Guillaume Belanger --- internal/decoder/ngap/golden_test.go | 9 +- internal/decoder/ngap/handover.go | 8 +- internal/decoder/ngap/modeled_ies_test.go | 18 + internal/decoder/ngap/path_switch.go | 4 + .../golden/handover_request_full.json | 148 ++++- .../golden/handover_required_full.json | 112 +++- .../golden/path_switch_request_full.json | 23 + .../decoder/ngap/transparent_container.go | 208 +++++++ .../ngap/transparent_container_test.go | 121 ++++ internal/decoder/s1ap/golden_test.go | 4 +- internal/decoder/s1ap/handover.go | 4 +- internal/decoder/s1ap/modeled_ies_test.go | 22 + internal/decoder/s1ap/path_switch.go | 4 + .../golden/handover_request_full.json | 58 +- .../golden/handover_required_full.json | 58 +- .../decoder/s1ap/transparent_container.go | 116 ++++ .../s1ap/transparent_container_test.go | 89 +++ ngap/enum_names.go | 22 + ngap/enum_names_test.go | 9 + ngap/fuzz_test.go | 2 + ngap/golden_tshark_test.go | 1 + ngap/handover_resource_allocation.go | 26 +- ngap/ie_qos.go | 4 +- ngap/parsers.go | 11 +- ngap/path_switch.go | 22 + ngap/per_gen.go | 576 +++++++++++++++++- ngap/table_order_test.go | 4 +- .../a29ec5deebf91b2e | 2 + ngap/transparent_container.go | 575 +++++++++++++++++ ngap/transparent_container_test.go | 451 ++++++++++++++ s1ap/enum_names.go | 15 + s1ap/enum_names_test.go | 5 + s1ap/fuzz_test.go | 6 + s1ap/ie_ids.go | 3 + s1ap/ie_names.go | 119 ++-- s1ap/parsers.go | 7 + s1ap/parsers_test.go | 10 +- s1ap/path_switch.go | 22 + s1ap/per_gen.go | 257 ++++++++ s1ap/pws_overload_test.go | 1 + s1ap/table_order_test.go | 2 +- .../e81635cb9ebcd5c3 | 2 + s1ap/transparent_container.go | 473 ++++++++++++++ s1ap/transparent_container_test.go | 407 +++++++++++++ 44 files changed, 3929 insertions(+), 111 deletions(-) create mode 100644 internal/decoder/ngap/transparent_container.go create mode 100644 internal/decoder/ngap/transparent_container_test.go create mode 100644 internal/decoder/s1ap/transparent_container.go create mode 100644 internal/decoder/s1ap/transparent_container_test.go create mode 100644 ngap/testdata/fuzz/FuzzTransparentContainerRoundTrip/a29ec5deebf91b2e create mode 100644 ngap/transparent_container.go create mode 100644 ngap/transparent_container_test.go create mode 100644 s1ap/testdata/fuzz/FuzzTransparentContainerRoundTrip/e81635cb9ebcd5c3 create mode 100644 s1ap/transparent_container.go create mode 100644 s1ap/transparent_container_test.go diff --git a/internal/decoder/ngap/golden_test.go b/internal/decoder/ngap/golden_test.go index bec6f26381..032cd21bbc 100644 --- a/internal/decoder/ngap/golden_test.go +++ b/internal/decoder/ngap/golden_test.go @@ -131,6 +131,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { PDUSessionResourceToBeSwitchedDLList: lib.PDUSessionResourceToBeSwitchedDLList{ {PDUSessionID: 1, Transfer: psReqTransfer}, }, + SourceAMFGUAMI: &lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 0xca, AMFSetID: 0x3f8, AMFPointer: 0x01}, }) corpus["path_switch_request_acknowledge_full"] = mustMarshal(t, &lib.PathSwitchRequestAcknowledge{ @@ -351,7 +352,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { PDUSessionResourceListHORqd: lib.PDUSessionResourceListHORqd{ {PDUSessionID: 1, Transfer: hoRequiredTransfer}, }, - SourceToTargetTransparentContainer: lib.SourceToTargetTransparentContainer{0x01, 0x02}, + SourceToTargetTransparentContainer: testSourceNGRANContainer(t), }) corpus["handover_command_full"] = mustMarshal(t, &lib.HandoverCommand{ @@ -385,13 +386,15 @@ func goldenCorpus(t *testing.T) map[string][]byte { NewSecurityContextInd: lib.Ptr(lib.NewSecurityContextIndTrue), PDUSessionResourceSetupListHOReq: lib.PDUSessionResourceSetupListHOReq{{PDUSessionID: 1, SNSSAI: lib.SNSSAI{SST: 1}, Transfer: hoSetupTransfer}}, AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, - SourceToTargetTransparentContainer: lib.SourceToTargetTransparentContainer{0x05, 0x06}, + SourceToTargetTransparentContainer: testSourceNGRANContainer(t), MobilityRestrictionList: &lib.MobilityRestrictionList{ ServingPLMN: testPLMN, EquivalentPLMNs: lib.EquivalentPLMNs{testPLMN}, RATRestrictions: lib.RATRestrictions{{PLMNIdentity: testPLMN, RATRestrictionInformation: lib.RATRestrictionEUTRA}}, }, - GUAMI: lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 1, AMFSetID: 1, AMFPointer: 0}, + GUAMI: lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 1, AMFSetID: 1, AMFPointer: 0}, + AMFUENGAPID2: lib.Ptr(lib.AMFUENGAPID(9)), + TargetRANNodeID: &lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 2, Bits: 22}, }) corpus["handover_request_acknowledge_full"] = mustMarshal(t, &lib.HandoverRequestAcknowledge{ diff --git a/internal/decoder/ngap/handover.go b/internal/decoder/ngap/handover.go index ee4bbd696e..4796ddc4cb 100644 --- a/internal/decoder/ngap/handover.go +++ b/internal/decoder/ngap/handover.go @@ -390,7 +390,7 @@ func buildHandoverRequired(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDPDUSessionResourceListHORqd, ngap.CriticalityReject, sessions), - ie(ngap.IDSourceToTargetTransparentContainer, ngap.CriticalityReject, hex.EncodeToString(m.SourceToTargetTransparentContainer)), + ie(ngap.IDSourceToTargetTransparentContainer, ngap.CriticalityReject, sourceToTargetTransparentContainer(m.SourceToTargetTransparentContainer, m.HandoverType == ngap.HandoverTypeIntra5GS)), ) return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} @@ -530,7 +530,7 @@ func buildHandoverRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDTraceActivation, ngap.CriticalityIgnore, traceActivation(*m.TraceActivation))) } - ies = append(ies, ie(ngap.IDSourceToTargetTransparentContainer, ngap.CriticalityReject, hex.EncodeToString(m.SourceToTargetTransparentContainer))) + ies = append(ies, ie(ngap.IDSourceToTargetTransparentContainer, ngap.CriticalityReject, sourceToTargetTransparentContainer(m.SourceToTargetTransparentContainer, true))) if m.MobilityRestrictionList != nil { ies = append(ies, ie(ngap.IDMobilityRestrictionList, ngap.CriticalityIgnore, mobilityRestrictionList(*m.MobilityRestrictionList))) @@ -542,6 +542,10 @@ func buildHandoverRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDAMFUENGAPID2, ngap.CriticalityIgnore, int64(*m.AMFUENGAPID2))) } + if m.TargetRANNodeID != nil { + ies = append(ies, ie(ngap.IDTargetRANNodeID, ngap.CriticalityIgnore, buildGlobalRANNodeID(*m.TargetRANNodeID))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/modeled_ies_test.go b/internal/decoder/ngap/modeled_ies_test.go index d5747d3d95..5471b54a03 100644 --- a/internal/decoder/ngap/modeled_ies_test.go +++ b/internal/decoder/ngap/modeled_ies_test.go @@ -121,6 +121,24 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { ExtendedBackupAMFName: &lib.ExtendedAMFName{AMFNameVisibleString: lib.Ptr(lib.AMFNameVisibleString("backup-extended"))}, }}, }), + "handover_request_target_ran_node_id": mustMarshal(t, &lib.HandoverRequest{ + AMFUENGAPID: 1, + Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}, + PDUSessionResourceSetupListHOReq: lib.PDUSessionResourceSetupListHOReq{{PDUSessionID: 1, SNSSAI: lib.SNSSAI{SST: 1}, Transfer: lib.TransferContainer{0x00}}}, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + SourceToTargetTransparentContainer: testSourceNGRANContainer(t), + GUAMI: guamis[0].GUAMI, + AMFUENGAPID2: lib.Ptr(lib.AMFUENGAPID(9)), + TargetRANNodeID: &lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 2, Bits: 22}, + }), + "path_switch_request_source_amf_guami": mustMarshal(t, &lib.PathSwitchRequest{ + RANUENGAPID: 2, + SourceAMFUENGAPID: 1, + UserLocationInformation: &lib.UserLocationInformation{Kind: lib.UserLocationNR, PLMNIdentity: testPLMN, TAI: testTAI}, + UESecurityCapabilities: &lib.UESecurityCapabilities{}, + PDUSessionResourceToBeSwitchedDLList: lib.PDUSessionResourceToBeSwitchedDLList{{PDUSessionID: 5, Transfer: lib.TransferContainer{0x00}}}, + SourceAMFGUAMI: &guamis[0].GUAMI, + }), "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &lib.UEContextReleaseRequest{ AMFUENGAPID: 1, RANUENGAPID: 2, diff --git a/internal/decoder/ngap/path_switch.go b/internal/decoder/ngap/path_switch.go index 0013e9327c..c82e2d5b96 100644 --- a/internal/decoder/ngap/path_switch.go +++ b/internal/decoder/ngap/path_switch.go @@ -195,6 +195,10 @@ func buildPathSwitchRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDPDUSessionResourceFailedToSetupListPSReq, ngap.CriticalityIgnore, failed)) } + if m.SourceAMFGUAMI != nil { + ies = append(ies, ie(ngap.IDSourceAMFGUAMI, ngap.CriticalityIgnore, guami(*m.SourceAMFGUAMI))) + } + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/testdata/golden/handover_request_full.json b/internal/decoder/ngap/testdata/golden/handover_request_full.json index 82187039a0..7adcdad2c0 100644 --- a/internal/decoder/ngap/testdata/golden/handover_request_full.json +++ b/internal/decoder/ngap/testdata/golden/handover_request_full.json @@ -233,7 +233,117 @@ "label": "reject", "unknown": false }, - "value": "0506" + "value": { + "hex": "70018000400105010040000501002000450000f11000000001000630320000f1100000101100001e012c04020101100102180103", + "source_ngran_node_to_target_ngran_node": { + "rrc_container": "80", + "pdu_session_resource_information_list": [ + { + "pdu_session_id": 1, + "qos_flow_information_list": [ + { + "qos_flow_identifier": 1, + "dl_forwarding": { + "type": "enum", + "value": 0, + "label": "dl-forwarding-proposed", + "unknown": false + } + }, + { + "qos_flow_identifier": 2 + } + ], + "drbs_to_qos_flows_mapping_list": [ + { + "drb_id": 1, + "associated_qos_flow_list": [ + { + "qos_flow_identifier": 1, + "qos_flow_mapping_indication": { + "type": "enum", + "value": 0, + "label": "ul", + "unknown": false + } + }, + { + "qos_flow_identifier": 2 + } + ] + } + ] + } + ], + "erab_information_list": [ + { + "erab_id": 5, + "dl_forwarding": { + "type": "enum", + "value": 0, + "label": "dl-forwarding-proposed", + "unknown": false + } + } + ], + "target_cell_id": { + "nr_ran_cgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "nr_cell_identity": "000000010" + } + }, + "index_to_rfsp": 7, + "ue_history_information": [ + { + "ng_ran_cell": { + "global_cell_id": { + "eutra_cgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "eutra_cell_identity": "0000101" + } + }, + "cell_size": { + "type": "enum", + "value": 2, + "label": "medium", + "unknown": false + }, + "time_ue_stayed_in_cell": 30, + "time_ue_stayed_in_cell_enhanced_granularity": 300, + "ho_cause_value": { + "group": { + "type": "enum", + "value": 0, + "label": "radioNetwork", + "unknown": false + }, + "value": { + "type": "enum", + "value": 16, + "label": "handover-desirable-for-radio-reason", + "unknown": false + } + } + } + }, + { + "e_utran_cell": "01" + }, + { + "utran_cell": "02" + }, + { + "geran_cell": "03" + } + ] + } + } }, { "id": { @@ -292,6 +402,42 @@ "amf_set_id": "004", "amf_pointer": "00" } + }, + { + "id": { + "type": "enum", + "value": 450, + "label": "AMF-UE-NGAP-ID2", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 9 + }, + { + "id": { + "type": "enum", + "value": 455, + "label": "Target-RAN-Node-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_identity": { + "mcc": "001", + "mnc": "01" + }, + "global_gnb_id": "000002" + } } ] } diff --git a/internal/decoder/ngap/testdata/golden/handover_required_full.json b/internal/decoder/ngap/testdata/golden/handover_required_full.json index 0eeedbf062..7314093085 100644 --- a/internal/decoder/ngap/testdata/golden/handover_required_full.json +++ b/internal/decoder/ngap/testdata/golden/handover_required_full.json @@ -175,7 +175,117 @@ "label": "reject", "unknown": false }, - "value": "0102" + "value": { + "hex": "70018000400105010040000501002000450000f11000000001000630320000f1100000101100001e012c04020101100102180103", + "source_ngran_node_to_target_ngran_node": { + "rrc_container": "80", + "pdu_session_resource_information_list": [ + { + "pdu_session_id": 1, + "qos_flow_information_list": [ + { + "qos_flow_identifier": 1, + "dl_forwarding": { + "type": "enum", + "value": 0, + "label": "dl-forwarding-proposed", + "unknown": false + } + }, + { + "qos_flow_identifier": 2 + } + ], + "drbs_to_qos_flows_mapping_list": [ + { + "drb_id": 1, + "associated_qos_flow_list": [ + { + "qos_flow_identifier": 1, + "qos_flow_mapping_indication": { + "type": "enum", + "value": 0, + "label": "ul", + "unknown": false + } + }, + { + "qos_flow_identifier": 2 + } + ] + } + ] + } + ], + "erab_information_list": [ + { + "erab_id": 5, + "dl_forwarding": { + "type": "enum", + "value": 0, + "label": "dl-forwarding-proposed", + "unknown": false + } + } + ], + "target_cell_id": { + "nr_ran_cgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "nr_cell_identity": "000000010" + } + }, + "index_to_rfsp": 7, + "ue_history_information": [ + { + "ng_ran_cell": { + "global_cell_id": { + "eutra_cgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "eutra_cell_identity": "0000101" + } + }, + "cell_size": { + "type": "enum", + "value": 2, + "label": "medium", + "unknown": false + }, + "time_ue_stayed_in_cell": 30, + "time_ue_stayed_in_cell_enhanced_granularity": 300, + "ho_cause_value": { + "group": { + "type": "enum", + "value": 0, + "label": "radioNetwork", + "unknown": false + }, + "value": { + "type": "enum", + "value": 16, + "label": "handover-desirable-for-radio-reason", + "unknown": false + } + } + } + }, + { + "e_utran_cell": "01" + }, + { + "utran_cell": "02" + }, + { + "geran_cell": "03" + } + ] + } + } } ] } diff --git a/internal/decoder/ngap/testdata/golden/path_switch_request_full.json b/internal/decoder/ngap/testdata/golden/path_switch_request_full.json index f8daf409d7..fd45696467 100644 --- a/internal/decoder/ngap/testdata/golden/path_switch_request_full.json +++ b/internal/decoder/ngap/testdata/golden/path_switch_request_full.json @@ -132,6 +132,29 @@ } } ] + }, + { + "id": { + "type": "enum", + "value": 453, + "label": "SourceAMF-GUAMI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "amf_region_id": "ca", + "amf_set_id": "fe0", + "amf_pointer": "04" + } } ] } diff --git a/internal/decoder/ngap/transparent_container.go b/internal/decoder/ngap/transparent_container.go new file mode 100644 index 0000000000..6d4ad109dc --- /dev/null +++ b/internal/decoder/ngap/transparent_container.go @@ -0,0 +1,208 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/hex" + + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/ngap" +) + +type SourceToTargetTransparentContainer struct { + Hex string `json:"hex"` + SourceNGRANNodeToTargetNGRANNode *SourceNGRANNodeToTargetNGRANNodeTransparentContainer `json:"source_ngran_node_to_target_ngran_node,omitempty"` + Error string `json:"error,omitempty"` +} + +type SourceNGRANNodeToTargetNGRANNodeTransparentContainer struct { + RRCContainer string `json:"rrc_container"` + PDUSessionResourceInformationList []PDUSessionResourceInformation `json:"pdu_session_resource_information_list,omitempty"` + ERABInformationList []ERABInformation `json:"erab_information_list,omitempty"` + TargetCellID NGRANCGI `json:"target_cell_id"` + IndexToRFSP *uint16 `json:"index_to_rfsp,omitempty"` + UEHistoryInformation []LastVisitedCell `json:"ue_history_information"` +} + +type PDUSessionResourceInformation struct { + PDUSessionID int64 `json:"pdu_session_id"` + QosFlowInformationList []QosFlowInformation `json:"qos_flow_information_list"` + DRBsToQosFlowsMappingList []DRBToQosFlowsMapping `json:"drbs_to_qos_flows_mapping_list,omitempty"` +} + +type QosFlowInformation struct { + QosFlowIdentifier int64 `json:"qos_flow_identifier"` + DLForwarding *utils.EnumField `json:"dl_forwarding,omitempty"` +} + +type DRBToQosFlowsMapping struct { + DRBID int64 `json:"drb_id"` + AssociatedQosFlowList []MappedAssociatedQosFlow `json:"associated_qos_flow_list"` +} + +type MappedAssociatedQosFlow struct { + QosFlowIdentifier int64 `json:"qos_flow_identifier"` + QosFlowMappingIndication *utils.EnumField `json:"qos_flow_mapping_indication,omitempty"` +} + +type ERABInformation struct { + ERABID int64 `json:"erab_id"` + DLForwarding *utils.EnumField `json:"dl_forwarding,omitempty"` +} + +type LastVisitedCell struct { + NGRANCell *LastVisitedNGRANCell `json:"ng_ran_cell,omitempty"` + EUTRANCell *string `json:"e_utran_cell,omitempty"` + UTRANCell *string `json:"utran_cell,omitempty"` + GERANCell *string `json:"geran_cell,omitempty"` +} + +type LastVisitedNGRANCell struct { + GlobalCellID NGRANCGI `json:"global_cell_id"` + CellSize utils.EnumField `json:"cell_size"` + TimeUEStayedInCell uint16 `json:"time_ue_stayed_in_cell"` + TimeUEStayedInCellEnhancedGranularity *uint16 `json:"time_ue_stayed_in_cell_enhanced_granularity,omitempty"` + HOCauseValue *Cause `json:"ho_cause_value,omitempty"` +} + +func sourceToTargetTransparentContainer(b []byte, sourceNGRANNode bool) SourceToTargetTransparentContainer { + out := SourceToTargetTransparentContainer{Hex: hex.EncodeToString(b)} + + if !sourceNGRANNode { + return out + } + + c, err := ngap.ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) + if err != nil { + out.Error = err.Error() + + return out + } + + out.SourceNGRANNodeToTargetNGRANNode = sourceNGRANNodeToTargetNGRANNode(c) + + return out +} + +func sourceNGRANNodeToTargetNGRANNode(c *ngap.SourceNGRANNodeToTargetNGRANNodeTransparentContainer) *SourceNGRANNodeToTargetNGRANNodeTransparentContainer { + out := &SourceNGRANNodeToTargetNGRANNodeTransparentContainer{ + RRCContainer: hex.EncodeToString(c.RRCContainer), + TargetCellID: ngranCGI(c.TargetCellID), + UEHistoryInformation: make([]LastVisitedCell, 0, len(c.UEHistoryInformation)), + } + + for _, it := range c.PDUSessionResourceInformationList { + s := PDUSessionResourceInformation{ + PDUSessionID: int64(it.PDUSessionID), + QosFlowInformationList: make([]QosFlowInformation, 0, len(it.QosFlowInformationList)), + } + + for _, f := range it.QosFlowInformationList { + s.QosFlowInformationList = append(s.QosFlowInformationList, QosFlowInformation{ + QosFlowIdentifier: int64(f.QosFlowIdentifier), + DLForwarding: dlForwarding(f.DLForwarding), + }) + } + + for _, d := range it.DRBsToQosFlowsMappingList { + m := DRBToQosFlowsMapping{DRBID: int64(d.DRBID), AssociatedQosFlowList: make([]MappedAssociatedQosFlow, 0, len(d.AssociatedQosFlowList))} + + for _, f := range d.AssociatedQosFlowList { + a := MappedAssociatedQosFlow{QosFlowIdentifier: int64(f.QosFlowIdentifier)} + + if f.QosFlowMappingIndication != nil { + e := utils.NamedEnum(uint8(*f.QosFlowMappingIndication), f.QosFlowMappingIndication.Name()) + a.QosFlowMappingIndication = &e + } + + m.AssociatedQosFlowList = append(m.AssociatedQosFlowList, a) + } + + s.DRBsToQosFlowsMappingList = append(s.DRBsToQosFlowsMappingList, m) + } + + out.PDUSessionResourceInformationList = append(out.PDUSessionResourceInformationList, s) + } + + for _, it := range c.ERABInformationList { + out.ERABInformationList = append(out.ERABInformationList, ERABInformation{ + ERABID: int64(it.ERABID), + DLForwarding: dlForwarding(it.DLForwarding), + }) + } + + if c.IndexToRFSP != nil { + v := uint16(*c.IndexToRFSP) + out.IndexToRFSP = &v + } + + for _, it := range c.UEHistoryInformation { + out.UEHistoryInformation = append(out.UEHistoryInformation, lastVisitedCell(it.LastVisitedCellInformation)) + } + + return out +} + +func dlForwarding(d *ngap.DLForwarding) *utils.EnumField { + if d == nil { + return nil + } + + e := utils.NamedEnum(uint8(*d), d.Name()) + + return &e +} + +func ngranCGI(c ngap.NGRANCGI) NGRANCGI { + var out NGRANCGI + + switch { + case c.NRCGI != nil: + v := nrCGI(*c.NRCGI) + out.NRCGI = &v + case c.EUTRACGI != nil: + v := eutraCGI(*c.EUTRACGI) + out.EUTRACGI = &v + default: + out.Error = "unsupported NGRAN-CGI choice-Extensions alternative" + } + + return out +} + +func lastVisitedCell(c ngap.LastVisitedCellInformation) LastVisitedCell { + var out LastVisitedCell + + switch { + case c.NGRANCell != nil: + n := &LastVisitedNGRANCell{ + GlobalCellID: ngranCGI(c.NGRANCell.GlobalCellID), + CellSize: utils.NamedEnum(uint8(c.NGRANCell.CellType.CellSize), c.NGRANCell.CellType.CellSize.Name()), + TimeUEStayedInCell: uint16(c.NGRANCell.TimeUEStayedInCell), + } + + if g := c.NGRANCell.TimeUEStayedInCellEnhancedGranularity; g != nil { + v := uint16(*g) + n.TimeUEStayedInCellEnhancedGranularity = &v + } + + if h := c.NGRANCell.HOCauseValue; h != nil { + v := cause(*h) + n.HOCauseValue = &v + } + + out.NGRANCell = n + case c.EUTRANCell != nil: + v := hex.EncodeToString(*c.EUTRANCell) + out.EUTRANCell = &v + case c.UTRANCell != nil: + v := hex.EncodeToString(*c.UTRANCell) + out.UTRANCell = &v + case c.GERANCell != nil: + v := hex.EncodeToString(*c.GERANCell) + out.GERANCell = &v + } + + return out +} diff --git a/internal/decoder/ngap/transparent_container_test.go b/internal/decoder/ngap/transparent_container_test.go new file mode 100644 index 0000000000..7239a74e3e --- /dev/null +++ b/internal/decoder/ngap/transparent_container_test.go @@ -0,0 +1,121 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "reflect" + "testing" + + "github.com/ellanetworks/core/internal/decoder/utils" + lib "github.com/ellanetworks/core/ngap" +) + +func testSourceNGRANContainer(t *testing.T) lib.SourceToTargetTransparentContainer { + t.Helper() + + b, err := (&lib.SourceNGRANNodeToTargetNGRANNodeTransparentContainer{ + RRCContainer: lib.RRCContainer{0x80}, + PDUSessionResourceInformationList: lib.PDUSessionResourceInformationList{{ + PDUSessionID: 1, + QosFlowInformationList: lib.QosFlowInformationList{{QosFlowIdentifier: 1, DLForwarding: lib.Ptr(lib.DLForwardingProposed)}, {QosFlowIdentifier: 2}}, + DRBsToQosFlowsMappingList: lib.DRBsToQosFlowsMappingList{{ + DRBID: 1, + AssociatedQosFlowList: lib.AssociatedQosFlowList{{QosFlowIdentifier: 1, QosFlowMappingIndication: lib.Ptr(lib.QosFlowMappingUL)}, {QosFlowIdentifier: 2}}, + }}, + }}, + ERABInformationList: lib.ERABInformationList{{ERABID: 5, DLForwarding: lib.Ptr(lib.DLForwardingProposed)}}, + TargetCellID: lib.NGRANCGI{NRCGI: &lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: 0x10}}, + IndexToRFSP: lib.Ptr(lib.IndexToRFSP(7)), + UEHistoryInformation: lib.UEHistoryInformation{ + {LastVisitedCellInformation: lib.LastVisitedCellInformation{NGRANCell: &lib.LastVisitedNGRANCellInformation{ + GlobalCellID: lib.NGRANCGI{EUTRACGI: &lib.EUTRACGI{PLMNIdentity: testPLMN, EUTRACellIdentity: 0x101}}, + CellType: lib.CellType{CellSize: lib.CellSizeMedium}, + TimeUEStayedInCell: 30, + TimeUEStayedInCellEnhancedGranularity: lib.Ptr(lib.TimeUEStayedInCellEnhancedGranularity(300)), + HOCauseValue: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}, + }}}, + {LastVisitedCellInformation: lib.LastVisitedCellInformation{EUTRANCell: lib.Ptr(lib.LastVisitedEUTRANCellInformation{0x01})}}, + {LastVisitedCellInformation: lib.LastVisitedCellInformation{UTRANCell: lib.Ptr(lib.LastVisitedUTRANCellInformation{0x02})}}, + {LastVisitedCellInformation: lib.LastVisitedCellInformation{GERANCell: lib.Ptr(lib.LastVisitedGERANCellInformation{0x03})}}, + }, + }).Marshal() + if err != nil { + t.Fatal(err) + } + + return b +} + +func TestDecodeSourceNGRANNodeToTargetNGRANNodeTransparentContainer(t *testing.T) { + got := sourceToTargetTransparentContainer(testSourceNGRANContainer(t), true) + + nr := nrCGI(lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: 0x10}) + eutra := eutraCGI(lib.EUTRACGI{PLMNIdentity: testPLMN, EUTRACellIdentity: 0x101}) + dl := utils.NamedEnum(uint8(0), "dl-forwarding-proposed") + ul := utils.NamedEnum(uint8(0), "ul") + hoCause := cause(lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}) + e, u, g := "01", "02", "03" + + want := SourceToTargetTransparentContainer{ + Hex: got.Hex, + SourceNGRANNodeToTargetNGRANNode: &SourceNGRANNodeToTargetNGRANNodeTransparentContainer{ + RRCContainer: "80", + PDUSessionResourceInformationList: []PDUSessionResourceInformation{{ + PDUSessionID: 1, + QosFlowInformationList: []QosFlowInformation{{QosFlowIdentifier: 1, DLForwarding: &dl}, {QosFlowIdentifier: 2}}, + DRBsToQosFlowsMappingList: []DRBToQosFlowsMapping{{ + DRBID: 1, + AssociatedQosFlowList: []MappedAssociatedQosFlow{{QosFlowIdentifier: 1, QosFlowMappingIndication: &ul}, {QosFlowIdentifier: 2}}, + }}, + }}, + ERABInformationList: []ERABInformation{{ERABID: 5, DLForwarding: &dl}}, + TargetCellID: NGRANCGI{NRCGI: &nr}, + IndexToRFSP: lib.Ptr(uint16(7)), + UEHistoryInformation: []LastVisitedCell{ + {NGRANCell: &LastVisitedNGRANCell{ + GlobalCellID: NGRANCGI{EUTRACGI: &eutra}, + CellSize: utils.NamedEnum(uint8(2), "medium"), + TimeUEStayedInCell: 30, + TimeUEStayedInCellEnhancedGranularity: lib.Ptr(uint16(300)), + HOCauseValue: &hoCause, + }}, + {EUTRANCell: &e}, + {UTRANCell: &u}, + {GERANCell: &g}, + }, + }, + } + + if !reflect.DeepEqual(got, want) { + t.Fatalf("container\n got %+v\nwant %+v", got, want) + } +} + +func TestDecodeSourceToTargetTransparentContainerUndecodable(t *testing.T) { + got := sourceToTargetTransparentContainer([]byte{0x05, 0x06}, true) + if got.Hex != "0506" || got.SourceNGRANNodeToTargetNGRANNode != nil || got.Error == "" { + t.Fatalf("container = %+v", got) + } + + got = sourceToTargetTransparentContainer(testSourceNGRANContainer(t), false) + if got.SourceNGRANNodeToTargetNGRANNode != nil || got.Error != "" { + t.Fatalf("non-NG-RAN container = %+v", got) + } +} + +func TestDecodeNGAPMessage_TargetRANNodeIDAndSourceAMFGUAMI(t *testing.T) { + corpus := modeledIEsCorpus(t) + + ho := DecodeNGAPMessage(corpus["handover_request_target_ran_node_id"]).Value.IEs + if last := ho[len(ho)-1]; last.ID.Value != int64(lib.IDTargetRANNodeID) || last.Criticality.Value != int64(lib.CriticalityIgnore) || + !reflect.DeepEqual(last.Value, buildGlobalRANNodeID(lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 2, Bits: 22})) { + t.Fatalf("last IE = %+v, want Target-RAN-Node-ID", last) + } + + ps := DecodeNGAPMessage(corpus["path_switch_request_source_amf_guami"]).Value.IEs + if last := ps[len(ps)-1]; last.ID.Value != int64(lib.IDSourceAMFGUAMI) || last.Criticality.Value != int64(lib.CriticalityIgnore) || + !reflect.DeepEqual(last.Value, guami(lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 0xca, AMFSetID: 0x3f8, AMFPointer: 0x01})) { + t.Fatalf("last IE = %+v, want SourceAMF-GUAMI", last) + } +} diff --git a/internal/decoder/s1ap/golden_test.go b/internal/decoder/s1ap/golden_test.go index 2eeb19d2b7..54baaab39d 100644 --- a/internal/decoder/s1ap/golden_test.go +++ b/internal/decoder/s1ap/golden_test.go @@ -317,7 +317,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { SelectedTAI: testTAI, }}, DirectForwardingPathAvailability: s1ap.Ptr(s1ap.DirectForwardingPathAvailable), - SourceToTarget: s1ap.TransparentContainer{0xab, 0xcd}, + SourceToTarget: testSourceeNBContainer(t), }) corpus["handover_command_full"] = mustMarshal(t, &s1ap.HandoverCommand{ @@ -353,7 +353,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { GTPTEID: 0x99, QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, }}, - SourceToTarget: s1ap.TransparentContainer{0xab}, + SourceToTarget: testSourceeNBContainer(t), UESecurityCapabilities: s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}, HandoverRestrictionList: &s1ap.HandoverRestrictionList{ ServingPLMN: testPLMN, diff --git a/internal/decoder/s1ap/handover.go b/internal/decoder/s1ap/handover.go index 2f76daae28..199e2ed92f 100644 --- a/internal/decoder/s1ap/handover.go +++ b/internal/decoder/s1ap/handover.go @@ -138,7 +138,7 @@ func buildHandoverRequired(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDDirectForwardingPathAvailability, s1ap.CriticalityIgnore, utils.NamedEnum(uint8(d), d.Name()))) } - ies = append(ies, ie(s1ap.IDSourceToTargetTransparentContainer, s1ap.CriticalityReject, hex.EncodeToString(m.SourceToTarget))) + ies = append(ies, ie(s1ap.IDSourceToTargetTransparentContainer, s1ap.CriticalityReject, sourceToTargetTransparentContainer(m.SourceToTarget, m.HandoverType == s1ap.HandoverTypeIntraLTE))) ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Handover Required (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) @@ -177,7 +177,7 @@ func buildHandoverRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUEAggregateMaximumBitrate, s1ap.CriticalityReject, AMBR{DL: uint64(m.UEAMBR.DL), UL: uint64(m.UEAMBR.UL)}), ie(s1ap.IDERABToBeSetupListHOReq, s1ap.CriticalityReject, erabs), - ie(s1ap.IDSourceToTargetTransparentContainer, s1ap.CriticalityReject, hex.EncodeToString(m.SourceToTarget)), + ie(s1ap.IDSourceToTargetTransparentContainer, s1ap.CriticalityReject, sourceToTargetTransparentContainer(m.SourceToTarget, true)), ie(s1ap.IDUESecurityCapabilities, s1ap.CriticalityReject, UESecurityCapabilities{ EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms, "EEA"), IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms, "EIA"), diff --git a/internal/decoder/s1ap/modeled_ies_test.go b/internal/decoder/s1ap/modeled_ies_test.go index 0c020211db..e58e0190e3 100644 --- a/internal/decoder/s1ap/modeled_ies_test.go +++ b/internal/decoder/s1ap/modeled_ies_test.go @@ -46,6 +46,15 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(3)), }), + "path_switch_request_source_mme_gummei": mustMarshal(t, &s1ap.PathSwitchRequest{ + ENBUES1APID: 2, + ERABToBeSwitchedDL: []s1ap.ERABToBeSwitchedDLItem{{ERABID: 5, TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 1}, GTPTEID: 1}}, + SourceMMEUES1APID: 1, + EUTRANCGI: &s1ap.EUTRANCGI{PLMNIdentity: testPLMN, CellID: 1}, + TAI: &s1ap.TAI{PLMNIdentity: testPLMN, TAC: 1}, + UESecurityCapabilities: &s1ap.UESecurityCapabilities{}, + SourceMMEGUMMEI: &gummeiID, + }), "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &s1ap.UEContextReleaseRequest{ MMEUES1APID: 1, ENBUES1APID: 2, @@ -118,6 +127,19 @@ func TestDecodeS1APMessage_GUMMEIAndMMEUES1APID2(t *testing.T) { } } +func TestDecodeS1APMessage_PathSwitchRequestSourceMMEGUMMEI(t *testing.T) { + ies := DecodeS1APMessage(modeledIEsCorpus(t)["path_switch_request_source_mme_gummei"]).Value.IEs + + last := ies[len(ies)-1] + if last.ID.Value != int64(s1ap.IDSourceMMEGUMMEI) || last.Criticality.Value != int64(s1ap.CriticalityIgnore) { + t.Fatalf("IEs = %+v, want SourceMME-GUMMEI last", ies) + } + + if v, ok := last.Value.(GUMMEI); !ok || v != gummei(s1ap.GUMMEI{PLMNIdentity: testPLMN, MMEGroupID: s1ap.MMEGroupID{0x80, 0x01}, MMECode: 0x02}) { + t.Fatalf("SourceMME-GUMMEI = %#v", last.Value) + } +} + func TestDecodeS1APMessage_UEContextReleaseRequestGWContextReleaseIndication(t *testing.T) { ies := DecodeS1APMessage(modeledIEsCorpus(t)["ue_context_release_request_gw_context_release_indication"]).Value.IEs diff --git a/internal/decoder/s1ap/path_switch.go b/internal/decoder/s1ap/path_switch.go index eb473d7a3c..f4e80cf769 100644 --- a/internal/decoder/s1ap/path_switch.go +++ b/internal/decoder/s1ap/path_switch.go @@ -53,6 +53,10 @@ func buildPathSwitchRequest(value []byte) (S1APMessageValue, string) { })) } + if m.SourceMMEGUMMEI != nil { + ies = append(ies, ie(s1ap.IDSourceMMEGUMMEI, s1ap.CriticalityIgnore, gummei(*m.SourceMMEGUMMEI))) + } + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Path Switch Request (eNB-UE %d, source MME-UE %d, %d E-RAB)", m.ENBUES1APID, m.SourceMMEUES1APID, len(m.ERABToBeSwitchedDL)) diff --git a/internal/decoder/s1ap/testdata/golden/handover_request_full.json b/internal/decoder/s1ap/testdata/golden/handover_request_full.json index 5736f39e29..497c7b92b0 100644 --- a/internal/decoder/s1ap/testdata/golden/handover_request_full.json +++ b/internal/decoder/s1ap/testdata/golden/handover_request_full.json @@ -136,7 +136,63 @@ "label": "reject", "unknown": false }, - "value": "ab" + "value": { + "hex": "60018001004e40024500004e4001060000f1100019b0100b300000f1100019b01080001e20020102480002010a", + "source_enb_to_target_enb": { + "rrc_container": "80", + "erab_information_list": [ + { + "erab_id": 5, + "dl_forwarding": { + "type": "enum", + "value": 0, + "label": "dL-Forwarding-proposed", + "unknown": false + } + }, + { + "erab_id": 6 + } + ], + "target_cell_id": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + }, + "subscriber_profile_id_for_rfp": 12, + "ue_history_information": [ + { + "e_utran_cell": { + "global_cell_id": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + }, + "cell_size": { + "type": "enum", + "value": 1, + "label": "small", + "unknown": false + }, + "time_ue_stayed_in_cell": 30 + } + }, + { + "utran_cell": "0102" + }, + { + "geran_cell": "undefined" + }, + { + "ng_ran_cell": "0a" + } + ] + } + } }, { "id": { diff --git a/internal/decoder/s1ap/testdata/golden/handover_required_full.json b/internal/decoder/s1ap/testdata/golden/handover_required_full.json index ec2c2cb870..e3befb4422 100644 --- a/internal/decoder/s1ap/testdata/golden/handover_required_full.json +++ b/internal/decoder/s1ap/testdata/golden/handover_required_full.json @@ -164,7 +164,63 @@ "label": "reject", "unknown": false }, - "value": "abcd" + "value": { + "hex": "60018001004e40024500004e4001060000f1100019b0100b300000f1100019b01080001e20020102480002010a", + "source_enb_to_target_enb": { + "rrc_container": "80", + "erab_information_list": [ + { + "erab_id": 5, + "dl_forwarding": { + "type": "enum", + "value": 0, + "label": "dL-Forwarding-proposed", + "unknown": false + } + }, + { + "erab_id": 6 + } + ], + "target_cell_id": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + }, + "subscriber_profile_id_for_rfp": 12, + "ue_history_information": [ + { + "e_utran_cell": { + "global_cell_id": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + }, + "cell_size": { + "type": "enum", + "value": 1, + "label": "small", + "unknown": false + }, + "time_ue_stayed_in_cell": 30 + } + }, + { + "utran_cell": "0102" + }, + { + "geran_cell": "undefined" + }, + { + "ng_ran_cell": "0a" + } + ] + } + } } ] } diff --git a/internal/decoder/s1ap/transparent_container.go b/internal/decoder/s1ap/transparent_container.go new file mode 100644 index 0000000000..e0d94afa7b --- /dev/null +++ b/internal/decoder/s1ap/transparent_container.go @@ -0,0 +1,116 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/s1ap" +) + +type SourceToTargetTransparentContainer struct { + Hex string `json:"hex"` + SourceeNBToTargeteNB *SourceeNBToTargeteNBTransparentContainer `json:"source_enb_to_target_enb,omitempty"` + Error string `json:"error,omitempty"` +} + +type SourceeNBToTargeteNBTransparentContainer struct { + RRCContainer string `json:"rrc_container"` + ERABInformationList []ERABInformation `json:"erab_information_list,omitempty"` + TargetCellID EUTRANCGI `json:"target_cell_id"` + SubscriberProfileIDforRFP *uint16 `json:"subscriber_profile_id_for_rfp,omitempty"` + UEHistoryInformation []LastVisitedCell `json:"ue_history_information"` +} + +type ERABInformation struct { + ERABID uint8 `json:"erab_id"` + DLForwarding *utils.EnumField `json:"dl_forwarding,omitempty"` +} + +type LastVisitedCell struct { + EUTRANCell *LastVisitedEUTRANCell `json:"e_utran_cell,omitempty"` + UTRANCell *string `json:"utran_cell,omitempty"` + GERANCell *string `json:"geran_cell,omitempty"` + NGRANCell *string `json:"ng_ran_cell,omitempty"` +} + +type LastVisitedEUTRANCell struct { + GlobalCellID EUTRANCGI `json:"global_cell_id"` + CellSize utils.EnumField `json:"cell_size"` + TimeUEStayedInCell uint16 `json:"time_ue_stayed_in_cell"` +} + +func sourceToTargetTransparentContainer(b []byte, sourceeNB bool) SourceToTargetTransparentContainer { + out := SourceToTargetTransparentContainer{Hex: hex.EncodeToString(b)} + + if !sourceeNB { + return out + } + + c, err := s1ap.ParseSourceeNBToTargeteNBTransparentContainer(b) + if err != nil { + out.Error = err.Error() + + return out + } + + out.SourceeNBToTargeteNB = sourceeNBToTargeteNB(c) + + return out +} + +func sourceeNBToTargeteNB(c *s1ap.SourceeNBToTargeteNBTransparentContainer) *SourceeNBToTargeteNBTransparentContainer { + out := &SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: hex.EncodeToString(c.RRCContainer), + TargetCellID: eutranCGI(c.TargetCellID), + UEHistoryInformation: make([]LastVisitedCell, 0, len(c.UEHistoryInformation)), + } + + for _, it := range c.ERABInformationList { + e := ERABInformation{ERABID: uint8(it.ERABID)} + + if it.DLForwarding != nil { + f := utils.NamedEnum(uint8(*it.DLForwarding), it.DLForwarding.Name()) + e.DLForwarding = &f + } + + out.ERABInformationList = append(out.ERABInformationList, e) + } + + if c.SubscriberProfileIDforRFP != nil { + v := uint16(*c.SubscriberProfileIDforRFP) + out.SubscriberProfileIDforRFP = &v + } + + for _, it := range c.UEHistoryInformation { + out.UEHistoryInformation = append(out.UEHistoryInformation, lastVisitedCell(it)) + } + + return out +} + +func lastVisitedCell(it s1ap.LastVisitedCellItem) LastVisitedCell { + var out LastVisitedCell + + switch { + case it.EUTRANCell != nil: + out.EUTRANCell = &LastVisitedEUTRANCell{ + GlobalCellID: eutranCGI(it.EUTRANCell.GlobalCellID), + CellSize: utils.NamedEnum(uint8(it.EUTRANCell.CellType.CellSize), it.EUTRANCell.CellType.CellSize.Name()), + TimeUEStayedInCell: uint16(it.EUTRANCell.TimeUEStayedInCell), + } + case it.UTRANCell != nil: + v := hex.EncodeToString(*it.UTRANCell) + out.UTRANCell = &v + case it.GERANCell != nil: + v := "undefined" + out.GERANCell = &v + case it.NGRANCell != nil: + v := hex.EncodeToString(*it.NGRANCell) + out.NGRANCell = &v + } + + return out +} diff --git a/internal/decoder/s1ap/transparent_container_test.go b/internal/decoder/s1ap/transparent_container_test.go new file mode 100644 index 0000000000..0584ce64d0 --- /dev/null +++ b/internal/decoder/s1ap/transparent_container_test.go @@ -0,0 +1,89 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "reflect" + "testing" + + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/s1ap" +) + +func testSourceeNBContainer(t *testing.T) s1ap.TransparentContainer { + t.Helper() + + b, err := (&s1ap.SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: s1ap.RRCContainer{0x80}, + ERABInformationList: s1ap.ERABInformationList{{ERABID: 5, DLForwarding: s1ap.Ptr(s1ap.DLForwardingProposed)}, {ERABID: 6}}, + TargetCellID: testCGI, + SubscriberProfileIDforRFP: s1ap.Ptr(s1ap.SubscriberProfileIDforRFP(12)), + UEHistoryInformation: s1ap.UEHistoryInformation{ + {EUTRANCell: &s1ap.LastVisitedEUTRANCellInformation{GlobalCellID: testCGI, CellType: s1ap.CellType{CellSize: s1ap.CellSizeSmall}, TimeUEStayedInCell: 30}}, + {UTRANCell: s1ap.Ptr(s1ap.LastVisitedUTRANCellInformation{0x01, 0x02})}, + {GERANCell: &s1ap.LastVisitedGERANCellInformation{}}, + {NGRANCell: s1ap.Ptr(s1ap.LastVisitedNGRANCellInformation{0x0a})}, + }, + }).Marshal() + if err != nil { + t.Fatal(err) + } + + return b +} + +func TestDecodeSourceeNBToTargeteNBTransparentContainer(t *testing.T) { + c := testSourceeNBContainer(t) + + msg := DecodeS1APMessage(mustMarshal(t, &s1ap.HandoverRequired{ + MMEUES1APID: 7, + ENBUES1APID: 2, + HandoverType: s1ap.HandoverTypeIntraLTE, + Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, + TargetID: s1ap.TargetID{TargeteNBID: s1ap.TargeteNBID{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 2}}, + SelectedTAI: testTAI, + }}, + SourceToTarget: c, + })) + + got, ok := mustIE(t, msg, s1ap.IDSourceToTargetTransparentContainer).Value.(SourceToTargetTransparentContainer) + if !ok { + t.Fatalf("container rendered as %T", mustIE(t, msg, s1ap.IDSourceToTargetTransparentContainer).Value) + } + + utran, geran, ngran := "0102", "undefined", "0a" + dl := utils.NamedEnum(uint8(0), "dL-Forwarding-proposed") + want := SourceToTargetTransparentContainer{ + Hex: got.Hex, + SourceeNBToTargeteNB: &SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: "80", + ERABInformationList: []ERABInformation{{ERABID: 5, DLForwarding: &dl}, {ERABID: 6}}, + TargetCellID: eutranCGI(testCGI), + SubscriberProfileIDforRFP: s1ap.Ptr(uint16(12)), + UEHistoryInformation: []LastVisitedCell{ + {EUTRANCell: &LastVisitedEUTRANCell{GlobalCellID: eutranCGI(testCGI), CellSize: utils.NamedEnum(uint8(1), "small"), TimeUEStayedInCell: 30}}, + {UTRANCell: &utran}, + {GERANCell: &geran}, + {NGRANCell: &ngran}, + }, + }, + } + + if !reflect.DeepEqual(got, want) { + t.Fatalf("container\n got %+v\nwant %+v", got, want) + } +} + +func TestDecodeSourceToTargetTransparentContainerUndecodable(t *testing.T) { + got := sourceToTargetTransparentContainer([]byte{0xab}, true) + if got.Hex != "ab" || got.SourceeNBToTargeteNB != nil || got.Error == "" { + t.Fatalf("container = %+v", got) + } + + got = sourceToTargetTransparentContainer(testSourceeNBContainer(t), false) + if got.SourceeNBToTargeteNB != nil || got.Error != "" { + t.Fatalf("non-eNB container = %+v", got) + } +} diff --git a/ngap/enum_names.go b/ngap/enum_names.go index a5f2a577a8..ef56f394d0 100644 --- a/ngap/enum_names.go +++ b/ngap/enum_names.go @@ -167,3 +167,25 @@ var tnlAssociationUsageNames = map[TNLAssociationUsage]string{ } func (u TNLAssociationUsage) Name() string { return tnlAssociationUsageNames[u] } + +var dlForwardingNames = map[DLForwarding]string{ + DLForwardingProposed: "dl-forwarding-proposed", +} + +func (d DLForwarding) Name() string { return dlForwardingNames[d] } + +var cellSizeNames = map[CellSize]string{ + CellSizeVerySmall: "verysmall", + CellSizeSmall: "small", + CellSizeMedium: "medium", + CellSizeLarge: "large", +} + +func (c CellSize) Name() string { return cellSizeNames[c] } + +var qosFlowMappingIndicationNames = map[QosFlowMappingIndication]string{ + QosFlowMappingUL: "ul", + QosFlowMappingDL: "dl", +} + +func (q QosFlowMappingIndication) Name() string { return qosFlowMappingIndicationNames[q] } diff --git a/ngap/enum_names_test.go b/ngap/enum_names_test.go index 757802a9d9..7a801d78ec 100644 --- a/ngap/enum_names_test.go +++ b/ngap/enum_names_test.go @@ -60,6 +60,15 @@ func TestEnumNames(t *testing.T) { {"PagingOriginNon3GPP", PagingOriginNon3GPP.Name(), "non-3gpp"}, {"PagingOrigin(9)", PagingOrigin(9).Name(), ""}, + {"DLForwardingProposed", DLForwardingProposed.Name(), "dl-forwarding-proposed"}, + {"DLForwarding(9)", DLForwarding(9).Name(), ""}, + {"CellSizeVerySmall", CellSizeVerySmall.Name(), "verysmall"}, + {"CellSizeLarge", CellSizeLarge.Name(), "large"}, + {"CellSize(9)", CellSize(9).Name(), ""}, + {"QosFlowMappingUL", QosFlowMappingUL.Name(), "ul"}, + {"QosFlowMappingDL", QosFlowMappingDL.Name(), "dl"}, + {"QosFlowMappingIndication(9)", QosFlowMappingIndication(9).Name(), ""}, + {"PagingPriorityLevel8", PagingPriorityLevel8.Name(), "priolevel8"}, {"PagingPriority(99)", PagingPriority(99).Name(), ""}, diff --git a/ngap/fuzz_test.go b/ngap/fuzz_test.go index 345be42cfd..d53b11ca6d 100644 --- a/ngap/fuzz_test.go +++ b/ngap/fuzz_test.go @@ -63,6 +63,8 @@ func FuzzDecodeNoPanic(f *testing.F) { f.Add(b) } + f.Add(mustHexBytes(goldenSourceNGRANContainer)) + f.Fuzz(func(t *testing.T, data []byte) { _, _ = unmarshalPERValue[Cause](data) _, _ = unmarshalPERValue[CriticalityDiagnostics](data) diff --git a/ngap/golden_tshark_test.go b/ngap/golden_tshark_test.go index 2e21ac60ae..e1c705bcde 100644 --- a/ngap/golden_tshark_test.go +++ b/ngap/golden_tshark_test.go @@ -182,6 +182,7 @@ func ieAdditionGoldenCases() []goldenRoundTrip { out = append(out, uETNLABindingReleaseRequestGoldenCases()...) out = append(out, initialContextSetupRequestGoldenCases()...) out = append(out, uEContextModificationRequestGoldenCases()...) + out = append(out, transparentContainerGoldenCases()...) return append(out, uEContextReleaseRequestGoldenCases()...) } diff --git a/ngap/handover_resource_allocation.go b/ngap/handover_resource_allocation.go index 77e0b77a38..b099dab9bc 100644 --- a/ngap/handover_resource_allocation.go +++ b/ngap/handover_resource_allocation.go @@ -39,8 +39,9 @@ type HandoverRequest struct { // when the list is absent and it cannot determine the serving PLMN otherwise. MobilityRestrictionList *MobilityRestrictionList - GUAMI GUAMI - AMFUENGAPID2 *AMFUENGAPID + GUAMI GUAMI + AMFUENGAPID2 *AMFUENGAPID + TargetRANNodeID *GlobalRANNodeID messageMeta } @@ -245,6 +246,27 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.AMFUENGAPID2, true }, }, + { + id: IDTargetRANNodeID, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + var v GlobalRANNodeID + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.TargetRANNodeID = &v + + return nil + }, + encode: func(m *HandoverRequest) (per.Marshaler, bool) { + if m.TargetRANNodeID == nil { + return nil, false + } + + return m.TargetRANNodeID, true + }, + }, } func (m *HandoverRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ie_qos.go b/ngap/ie_qos.go index d9bb53493a..1c9c7c55f5 100644 --- a/ngap/ie_qos.go +++ b/ngap/ie_qos.go @@ -465,10 +465,10 @@ type QosFlowListWithCause []QosFlowWithCauseItem // AssociatedQosFlowItem ::= SEQUENCE { qosFlowIdentifier, // qosFlowMappingIndication OPTIONAL, iE-Extensions OPTIONAL } (extensible). type AssociatedQosFlowItem struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier QosFlowMappingIndication *QosFlowMappingIndication `per:"ENUMERATED,range:0..1,...,optional"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // AssociatedQosFlowList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF diff --git a/ngap/parsers.go b/ngap/parsers.go index 7d73acda8b..148449b496 100644 --- a/ngap/parsers.go +++ b/ngap/parsers.go @@ -147,10 +147,15 @@ var messageParsers = []messageParser{ }}, } -// transferParsers are the §9.3.4 transfer parsers. They take a -// TransferContainer rather than a message body, so they are registered apart -// from messageParsers; the fuzzer drives both. +// transferParsers are the §9.3.4 transfer parsers and the §9.3.1.29 +// container parser. They take OCTET STRING contents rather than a message +// body, so they are registered apart from messageParsers; the fuzzer drives +// both. var transferParsers = []messageParser{ + {"ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer", func(v []byte) error { + _, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(v) + return err + }}, {"ParsePDUSessionResourceNotifyTransfer", func(v []byte) error { _, err := ParsePDUSessionResourceNotifyTransfer(v) return err diff --git a/ngap/path_switch.go b/ngap/path_switch.go index 7661c8d17b..3688d522ab 100644 --- a/ngap/path_switch.go +++ b/ngap/path_switch.go @@ -19,6 +19,7 @@ type PathSwitchRequest struct { UESecurityCapabilities *UESecurityCapabilities PDUSessionResourceToBeSwitchedDLList PDUSessionResourceToBeSwitchedDLList PDUSessionResourceFailedToSetup PDUSessionResourceFailedToSetupListPSReq + SourceAMFGUAMI *GUAMI messageMeta } @@ -106,6 +107,27 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return m.PDUSessionResourceFailedToSetup, true }, }, + { + id: IDSourceAMFGUAMI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + var v GUAMI + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.SourceAMFGUAMI = &v + + return nil + }, + encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + if m.SourceAMFGUAMI == nil { + return nil, false + } + + return m.SourceAMFGUAMI, true + }, + }, } func (m *PathSwitchRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/per_gen.go b/ngap/per_gen.go index 99c20a00d2..7713e44df2 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -326,9 +326,9 @@ func (allowedNSSAIItem *AllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.En } func (associatedQosFlowItem *AssociatedQosFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(associatedQosFlowItem.extensions.Present()) w.WriteBit(associatedQosFlowItem.QosFlowMappingIndication != nil) - w.WriteBit(false) + w.WriteBit(associatedQosFlowItem.iEExtensions != nil) if err := associatedQosFlowItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } @@ -337,6 +337,16 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) MarshalPER(w *per.Writer, en return err } } + if associatedQosFlowItem.iEExtensions != nil { + if err := (*associatedQosFlowItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if associatedQosFlowItem.extensions.Present() { + if err := associatedQosFlowItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -349,7 +359,7 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) UnmarshalPER(r *per.Reader, if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -365,35 +375,17 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) UnmarshalPER(r *per.Reader, v = QosFlowMappingIndication(e1) associatedQosFlowItem.QosFlowMappingIndication = &v } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + associatedQosFlowItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := associatedQosFlowItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -938,6 +930,52 @@ func (cellIDCancelledNRItem *CellIDCancelledNRItem) UnmarshalPER(r *per.Reader, return nil } +func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(cellType.extensions.Present()) + w.WriteBit(cellType.iEExtensions != nil) + if err := cellType.CellSize.MarshalPER(w, enc); err != nil { + return err + } + if cellType.iEExtensions != nil { + if err := (*cellType.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if cellType.extensions.Present() { + if err := cellType.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cellType.CellSize).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cellType.iEExtensions = &v + } + if extBit { + if err := cellType.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -1226,6 +1264,58 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r return nil } +func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(dRBsToQosFlowsMappingItem.extensions.Present()) + w.WriteBit(dRBsToQosFlowsMappingItem.iEExtensions != nil) + if err := dRBsToQosFlowsMappingItem.DRBID.MarshalPER(w, enc); err != nil { + return err + } + if err := dRBsToQosFlowsMappingItem.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { + return err + } + if dRBsToQosFlowsMappingItem.iEExtensions != nil { + if err := (*dRBsToQosFlowsMappingItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if dRBsToQosFlowsMappingItem.extensions.Present() { + if err := dRBsToQosFlowsMappingItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&dRBsToQosFlowsMappingItem.DRBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&dRBsToQosFlowsMappingItem.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + dRBsToQosFlowsMappingItem.iEExtensions = &v + } + if extBit { + if err := dRBsToQosFlowsMappingItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil) @@ -1510,6 +1600,69 @@ func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } +func (eRABInformationItem *ERABInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(eRABInformationItem.extensions.Present()) + w.WriteBit(eRABInformationItem.DLForwarding != nil) + w.WriteBit(eRABInformationItem.iEExtensions != nil) + if err := eRABInformationItem.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if eRABInformationItem.DLForwarding != nil { + if err := (*eRABInformationItem.DLForwarding).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABInformationItem.iEExtensions != nil { + if err := (*eRABInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABInformationItem.extensions.Present() { + if err := eRABInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (eRABInformationItem *ERABInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwarding, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eRABInformationItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLForwarding { + var v DLForwarding + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABInformationItem.DLForwarding = &v + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABInformationItem.iEExtensions = &v + } + if extBit { + if err := eRABInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (eUTRACGI *EUTRACGI) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -2899,6 +3052,144 @@ func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocation return nil } +func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(lastVisitedCellItem.extensions.Present()) + w.WriteBit(lastVisitedCellItem.iEExtensions != nil) + if err := lastVisitedCellItem.LastVisitedCellInformation.MarshalPER(w, enc); err != nil { + return err + } + if lastVisitedCellItem.iEExtensions != nil { + if err := (*lastVisitedCellItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if lastVisitedCellItem.extensions.Present() { + if err := lastVisitedCellItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lastVisitedCellItem.LastVisitedCellInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellItem.iEExtensions = &v + } + if extBit { + if err := lastVisitedCellItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(lastVisitedNGRANCellInformation.extensions.Present()) + w.WriteBit(lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity != nil) + w.WriteBit(lastVisitedNGRANCellInformation.HOCauseValue != nil) + w.WriteBit(lastVisitedNGRANCellInformation.iEExtensions != nil) + if err := lastVisitedNGRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedNGRANCellInformation.CellType.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedNGRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { + return err + } + if lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity != nil { + if err := (*lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity).MarshalPER(w, enc); err != nil { + return err + } + } + if lastVisitedNGRANCellInformation.HOCauseValue != nil { + if err := (*lastVisitedNGRANCellInformation.HOCauseValue).MarshalPER(w, enc); err != nil { + return err + } + } + if lastVisitedNGRANCellInformation.iEExtensions != nil { + if err := (*lastVisitedNGRANCellInformation.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if lastVisitedNGRANCellInformation.extensions.Present() { + if err := lastVisitedNGRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TimeUEStayedInCellEnhancedGranularity, err := r.ReadBit() + if err != nil { + return err + } + p_HOCauseValue, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lastVisitedNGRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedNGRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedNGRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TimeUEStayedInCellEnhancedGranularity { + var v TimeUEStayedInCellEnhancedGranularity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity = &v + } + if p_HOCauseValue { + var v Cause + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedNGRANCellInformation.HOCauseValue = &v + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedNGRANCellInformation.iEExtensions = &v + } + if extBit { + if err := lastVisitedNGRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (mobilityRestrictionList *MobilityRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(mobilityRestrictionList.EquivalentPLMNs != nil) @@ -3929,6 +4220,73 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalP return nil } +func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(pDUSessionResourceInformationItem.extensions.Present()) + w.WriteBit(pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList != nil) + w.WriteBit(pDUSessionResourceInformationItem.iEExtensions != nil) + if err := pDUSessionResourceInformationItem.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceInformationItem.QosFlowInformationList.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList != nil { + if err := pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceInformationItem.iEExtensions != nil { + if err := (*pDUSessionResourceInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceInformationItem.extensions.Present() { + if err := pDUSessionResourceInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DRBsToQosFlowsMappingList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceInformationItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceInformationItem.QosFlowInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DRBsToQosFlowsMappingList { + if err := (&pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceInformationItem.iEExtensions = &v + } + if extBit { + if err := pDUSessionResourceInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -6603,6 +6961,69 @@ func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalP return nil } +func (qosFlowInformationItem *QosFlowInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(qosFlowInformationItem.extensions.Present()) + w.WriteBit(qosFlowInformationItem.DLForwarding != nil) + w.WriteBit(qosFlowInformationItem.iEExtensions != nil) + if err := qosFlowInformationItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowInformationItem.DLForwarding != nil { + if err := (*qosFlowInformationItem.DLForwarding).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowInformationItem.iEExtensions != nil { + if err := (*qosFlowInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowInformationItem.extensions.Present() { + if err := qosFlowInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowInformationItem *QosFlowInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwarding, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowInformationItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLForwarding { + var v DLForwarding + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowInformationItem.DLForwarding = &v + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowInformationItem.iEExtensions = &v + } + if extBit { + if err := qosFlowInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(qosFlowItemWithDataForwarding.DataForwardingAccepted != nil) @@ -7788,6 +8209,111 @@ func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.En return nil } +func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.Present()) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList != nil) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList != nil) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP != nil) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions != nil) + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.RRCContainer.MarshalPER(w, enc); err != nil { + return err + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList != nil { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList.MarshalPER(w, enc); err != nil { + return err + } + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList != nil { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList.MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID.MarshalPER(w, enc); err != nil { + return err + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP != nil { + if err := (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP).MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation.MarshalPER(w, enc); err != nil { + return err + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions != nil { + if err := (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.Present() { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PDUSessionResourceInformationList, err := r.ReadBit() + if err != nil { + return err + } + p_ERABInformationList, err := r.ReadBit() + if err != nil { + return err + } + p_IndexToRFSP, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.RRCContainer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_PDUSessionResourceInformationList { + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ERABInformationList { + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_IndexToRFSP { + var v IndexToRFSP + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP = &v + } + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions = &v + } + if extBit { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil) diff --git a/ngap/table_order_test.go b/ngap/table_order_test.go index 74e6c492b4..7771e6c304 100644 --- a/ngap/table_order_test.go +++ b/ngap/table_order_test.go @@ -33,7 +33,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"HandoverRequired", tableIDs(handoverRequiredIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDHandoverType, IDCause, IDTargetID, IDDirectForwardingPathAvailability, IDPDUSessionResourceListHORqd, IDSourceToTargetTransparentContainer}}, {"HandoverCommand", tableIDs(handoverCommandIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDHandoverType, IDNASSecurityParametersFromNGRAN, IDPDUSessionResourceHandoverList, IDPDUSessionResourceToReleaseListHOCmd, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverPreparationFailure", tableIDs(handoverPreparationFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCause, IDCriticalityDiagnostics, IDTargettoSourceFailureTransparentContainer}}, - {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDHandoverType, IDCause, IDUEAggregateMaximumBitRate, IDUESecurityCapabilities, IDSecurityContext, IDNewSecurityContextInd, IDNASC, IDPDUSessionResourceSetupListHOReq, IDAllowedNSSAI, IDTraceActivation, IDSourceToTargetTransparentContainer, IDMobilityRestrictionList, IDGUAMI, IDAMFUENGAPID2}}, + {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDHandoverType, IDCause, IDUEAggregateMaximumBitRate, IDUESecurityCapabilities, IDSecurityContext, IDNewSecurityContextInd, IDNASC, IDPDUSessionResourceSetupListHOReq, IDAllowedNSSAI, IDTraceActivation, IDSourceToTargetTransparentContainer, IDMobilityRestrictionList, IDGUAMI, IDAMFUENGAPID2, IDTargetRANNodeID}}, {"HandoverRequestAcknowledge", tableIDs(handoverRequestAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceAdmittedList, IDPDUSessionResourceFailedToSetupListHOAck, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverFailure", tableIDs(handoverFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDCause, IDCriticalityDiagnostics, IDTargettoSourceFailureTransparentContainer}}, {"DownlinkUEAssociatedNRPPaTransport", tableIDs(downlinkUEAssociatedNRPPaTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRoutingID, IDNRPPaPDU}}, @@ -42,7 +42,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"UplinkNonUEAssociatedNRPPaTransport", tableIDs(uplinkNonUEAssociatedNRPPaTransportIEs), []ProtocolIEID{IDRoutingID, IDNRPPaPDU}}, {"LocationReport", tableIDs(locationReportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDUEPresenceInAreaOfInterestList, IDLocationReportingRequestType}}, {"LocationReportingControl", tableIDs(locationReportingControlIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDLocationReportingRequestType}}, - {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDRANUENGAPID, IDSourceAMFUENGAPID, IDUserLocationInformation, IDUESecurityCapabilities, IDPDUSessionResourceToBeSwitchedDLList, IDPDUSessionResourceFailedToSetupListPSReq}}, + {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDRANUENGAPID, IDSourceAMFUENGAPID, IDUserLocationInformation, IDUESecurityCapabilities, IDPDUSessionResourceToBeSwitchedDLList, IDPDUSessionResourceFailedToSetupListPSReq, IDSourceAMFGUAMI}}, {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUESecurityCapabilities, IDSecurityContext, IDPDUSessionResourceSwitchedList, IDPDUSessionResourceReleasedListPSAck, IDAllowedNSSAI, IDCriticalityDiagnostics, IDAMFUENGAPID2}}, {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceReleasedListPSFail, IDCriticalityDiagnostics}}, {"UplinkRANStatusTransfer", tableIDs(uplinkRANStatusTransferIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRANStatusTransferTransparentContainer}}, diff --git a/ngap/testdata/fuzz/FuzzTransparentContainerRoundTrip/a29ec5deebf91b2e b/ngap/testdata/fuzz/FuzzTransparentContainerRoundTrip/a29ec5deebf91b2e new file mode 100644 index 0000000000..b1882713e0 --- /dev/null +++ b/ngap/testdata/fuzz/FuzzTransparentContainerRoundTrip/a29ec5deebf91b2e @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte(" \x010\x00A\x0500000000 000\x0000000000000000000000000000000") diff --git a/ngap/transparent_container.go b/ngap/transparent_container.go new file mode 100644 index 0000000000..b36d83de0e --- /dev/null +++ b/ngap/transparent_container.go @@ -0,0 +1,575 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "fmt" + + "github.com/ellanetworks/core/per" +) + +const ( + maxnoofERABs = 256 + maxnoofCellsinUEHistoryInfo = 16 +) + +const ( + ngranCGINR = iota + ngranCGIEUTRA + ngranCGIChoiceExtensions + + ngranCGIAlternatives = 3 +) + +const ( + lastVisitedCellInformationNGRAN = iota + lastVisitedCellInformationEUTRAN + lastVisitedCellInformationUTRAN + lastVisitedCellInformationGERAN + lastVisitedCellInformationChoiceExtensions + + lastVisitedCellInformationAlternatives = 5 +) + +type SourceNGRANNodeToTargetNGRANNodeTransparentContainer struct { + RRCContainer RRCContainer + PDUSessionResourceInformationList PDUSessionResourceInformationList `per:",optional"` + ERABInformationList ERABInformationList `per:",optional"` + TargetCellID NGRANCGI + IndexToRFSP *IndexToRFSP `per:",optional"` + UEHistoryInformation UEHistoryInformation + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +func (c *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Marshal() (SourceToTargetTransparentContainer, error) { + w := per.NewWriter() + + if err := c.MarshalPER(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return SourceToTargetTransparentContainer(w.Bytes()), nil +} + +func ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b []byte) (*SourceNGRANNodeToTargetNGRANNodeTransparentContainer, error) { + var c SourceNGRANNodeToTargetNGRANNodeTransparentContainer + + if err := c.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + return nil, fmt.Errorf("ngap: SourceNGRANNode-ToTargetNGRANNode-TransparentContainer: %w", err) + } + + return &c, nil +} + +type RRCContainer []byte + +func (c RRCContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *RRCContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *c = RRCContainer(b) + + return nil +} + +type PDUSessionResourceInformationItem struct { + PDUSessionID PDUSessionID + QosFlowInformationList QosFlowInformationList + DRBsToQosFlowsMappingList DRBsToQosFlowsMappingList `per:",optional"` + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PDUSessionResourceInformationList []PDUSessionResourceInformationItem + +func (l PDUSessionResourceInformationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPDUSessions, []PDUSessionResourceInformationItem(l)) +} + +func (l *PDUSessionResourceInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PDUSessionResourceInformationItem](r, enc, 1, maxnoofPDUSessions) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QosFlowInformationItem struct { + QosFlowIdentifier QosFlowIdentifier + DLForwarding *DLForwarding `per:",optional"` + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QosFlowInformationList []QosFlowInformationItem + +func (l QosFlowInformationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QosFlowInformationItem(l)) +} + +func (l *QosFlowInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QosFlowInformationItem](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type DRBsToQosFlowsMappingItem struct { + DRBID DRBID + AssociatedQosFlowList AssociatedQosFlowList + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type DRBsToQosFlowsMappingList []DRBsToQosFlowsMappingItem + +func (l DRBsToQosFlowsMappingList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofDRBs, []DRBsToQosFlowsMappingItem(l)) +} + +func (l *DRBsToQosFlowsMappingList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[DRBsToQosFlowsMappingItem](r, enc, 1, maxnoofDRBs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type DLForwarding uint8 + +const ( + DLForwardingProposed DLForwarding = iota + + dlForwardingRootCount = 1 +) + +func (d DLForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, dlForwardingRootCount, int64(d), "DLForwarding") +} + +func (d *DLForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, dlForwardingRootCount, "DLForwarding") + if err != nil { + return err + } + + *d = DLForwarding(idx) + + return nil +} + +type ERABInformationItem struct { + ERABID ERABID + DLForwarding *DLForwarding `per:",optional"` + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ERABInformationList []ERABInformationItem + +func (l ERABInformationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofERABs, []ERABInformationItem(l)) +} + +func (l *ERABInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ERABInformationItem](r, enc, 1, maxnoofERABs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NGRANCGI struct { + NRCGI *NRCGI + EUTRACGI *EUTRACGI + choiceExtension *rawIE +} + +func (c *NGRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := chosenAlternative("NGRAN-CGI", c.NRCGI != nil, c.EUTRACGI != nil, c.choiceExtension != nil) + if err != nil { + return err + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, ngranCGIAlternatives-1, idx); err != nil { + return err + } + + switch idx { + case ngranCGINR: + return c.NRCGI.MarshalPER(w, enc) + case ngranCGIEUTRA: + return c.EUTRACGI.MarshalPER(w, enc) + default: + return encodeContainerField(w, enc, c.choiceExtension.field()) + } +} + +func (c *NGRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, ngranCGIAlternatives-1) + if err != nil { + return fmt.Errorf("ngap: NGRAN-CGI choice: %w", err) + } + + *c = NGRANCGI{} + + switch idx { + case ngranCGINR: + var v NRCGI + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + c.NRCGI = &v + case ngranCGIEUTRA: + var v EUTRACGI + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + c.EUTRACGI = &v + default: + c.choiceExtension, err = decodeTransparentChoiceExtension(r, enc) + + return err + } + + return nil +} + +type IndexToRFSP uint16 + +func (i IndexToRFSP) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeExtensibleInt(w, enc, 1, 256, int64(i)) +} + +func (i *IndexToRFSP) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeExtensibleInt(r, enc, 1, 256, "IndexToRFSP") + if err != nil { + return err + } + + *i = IndexToRFSP(v) + + return nil +} + +type UEHistoryInformation []LastVisitedCellItem + +func (u UEHistoryInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsinUEHistoryInfo, []LastVisitedCellItem(u)) +} + +func (u *UEHistoryInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[LastVisitedCellItem](r, enc, 1, maxnoofCellsinUEHistoryInfo) + if err != nil { + return err + } + + *u = items + + return nil +} + +type LastVisitedCellItem struct { + LastVisitedCellInformation LastVisitedCellInformation + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LastVisitedCellInformation struct { + NGRANCell *LastVisitedNGRANCellInformation + EUTRANCell *LastVisitedEUTRANCellInformation + UTRANCell *LastVisitedUTRANCellInformation + GERANCell *LastVisitedGERANCellInformation + choiceExtension *rawIE +} + +func (l *LastVisitedCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := chosenAlternative("LastVisitedCellInformation", l.NGRANCell != nil, l.EUTRANCell != nil, l.UTRANCell != nil, l.GERANCell != nil, l.choiceExtension != nil) + if err != nil { + return err + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, lastVisitedCellInformationAlternatives-1, idx); err != nil { + return err + } + + switch idx { + case lastVisitedCellInformationNGRAN: + return l.NGRANCell.MarshalPER(w, enc) + case lastVisitedCellInformationEUTRAN: + return l.EUTRANCell.MarshalPER(w, enc) + case lastVisitedCellInformationUTRAN: + return l.UTRANCell.MarshalPER(w, enc) + case lastVisitedCellInformationGERAN: + return l.GERANCell.MarshalPER(w, enc) + default: + return encodeContainerField(w, enc, l.choiceExtension.field()) + } +} + +func (l *LastVisitedCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, lastVisitedCellInformationAlternatives-1) + if err != nil { + return fmt.Errorf("ngap: LastVisitedCellInformation choice: %w", err) + } + + *l = LastVisitedCellInformation{} + + switch idx { + case lastVisitedCellInformationNGRAN: + var v LastVisitedNGRANCellInformation + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + l.NGRANCell = &v + case lastVisitedCellInformationEUTRAN: + var v LastVisitedEUTRANCellInformation + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + l.EUTRANCell = &v + case lastVisitedCellInformationUTRAN: + var v LastVisitedUTRANCellInformation + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + l.UTRANCell = &v + case lastVisitedCellInformationGERAN: + var v LastVisitedGERANCellInformation + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + l.GERANCell = &v + default: + l.choiceExtension, err = decodeTransparentChoiceExtension(r, enc) + + return err + } + + return nil +} + +type LastVisitedNGRANCellInformation struct { + GlobalCellID NGRANCGI + CellType CellType + TimeUEStayedInCell TimeUEStayedInCell + TimeUEStayedInCellEnhancedGranularity *TimeUEStayedInCellEnhancedGranularity `per:",optional"` + HOCauseValue *Cause `per:",optional"` + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CellType struct { + CellSize CellSize + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CellSize uint8 + +const ( + CellSizeVerySmall CellSize = iota + CellSizeSmall + CellSizeMedium + CellSizeLarge + + cellSizeRootCount = 4 +) + +func (c CellSize) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, cellSizeRootCount, int64(c), "CellSize") +} + +func (c *CellSize) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, cellSizeRootCount, "CellSize") + if err != nil { + return err + } + + *c = CellSize(idx) + + return nil +} + +type TimeUEStayedInCell uint16 + +func (t TimeUEStayedInCell) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(t)) +} + +func (t *TimeUEStayedInCell) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + if err != nil { + return err + } + + *t = TimeUEStayedInCell(v) + + return nil +} + +type TimeUEStayedInCellEnhancedGranularity uint16 + +func (t TimeUEStayedInCellEnhancedGranularity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}, int64(t)) +} + +func (t *TimeUEStayedInCellEnhancedGranularity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}) + if err != nil { + return err + } + + *t = TimeUEStayedInCellEnhancedGranularity(v) + + return nil +} + +type LastVisitedEUTRANCellInformation []byte + +func (c LastVisitedEUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *LastVisitedEUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *c = LastVisitedEUTRANCellInformation(b) + + return nil +} + +type LastVisitedUTRANCellInformation []byte + +func (c LastVisitedUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *LastVisitedUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *c = LastVisitedUTRANCellInformation(b) + + return nil +} + +type LastVisitedGERANCellInformation []byte + +func (c LastVisitedGERANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *LastVisitedGERANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *c = LastVisitedGERANCellInformation(b) + + return nil +} + +func decodeTransparentChoiceExtension(r *per.Reader, enc per.Encoding) (*rawIE, error) { + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) + if err != nil { + return nil, err + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) + if err != nil { + return nil, err + } + + value, err := per.DecodeOpenTypeBytes(r, enc) + if err != nil { + return nil, err + } + + if len(value) == 0 { + return nil, fmt.Errorf("ngap: empty open type for choice-Extensions IE %d", id) + } + + return &rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: value}, nil +} + +type transparentIEExtensions struct { + data []byte + nbits int +} + +func (e *transparentIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { + if enc == per.Aligned { + w.AlignToByte() + } + + w.WriteBitString(e.data, e.nbits) + + return nil +} + +func (e *transparentIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + if enc == per.Aligned { + r.AlignToByte() + } + + start := r.Offset() + + n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) + if err != nil { + return err + } + + for range n { + if _, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs); err != nil { + return err + } + + if _, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false); err != nil { + return err + } + + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + + e.data, e.nbits, err = r.Since(start) + + return err +} diff --git a/ngap/transparent_container_test.go b/ngap/transparent_container_test.go new file mode 100644 index 0000000000..6bc4acb9cd --- /dev/null +++ b/ngap/transparent_container_test.go @@ -0,0 +1,451 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "encoding/hex" + "errors" + "os/exec" + "reflect" + "strings" + "testing" + + "github.com/ellanetworks/core/per" +) + +const goldenSourceNGRANContainer = "7001800040050501004000050140200145030002f8391234567890ff10320002f8390abcdef1800fff9ff604020b0002f83900001011000064" + +const goldenS1APLastVisitedEUTRANCellInformation = "0002f83900001011000064" + +func containerPLMN() PLMNIdentity { return PLMNIdentity{0x02, 0xf8, 0x39} } + +func goldSourceNGRANContainer() *SourceNGRANNodeToTargetNGRANNodeTransparentContainer { + return &SourceNGRANNodeToTargetNGRANNodeTransparentContainer{ + RRCContainer: RRCContainer{0x80}, + PDUSessionResourceInformationList: PDUSessionResourceInformationList{ + { + PDUSessionID: 5, + QosFlowInformationList: QosFlowInformationList{ + {QosFlowIdentifier: 1, DLForwarding: Ptr(DLForwardingProposed)}, + {QosFlowIdentifier: 2}, + }, + DRBsToQosFlowsMappingList: DRBsToQosFlowsMappingList{ + {DRBID: 1, AssociatedQosFlowList: AssociatedQosFlowList{{QosFlowIdentifier: 1, QosFlowMappingIndication: Ptr(QosFlowMappingDL)}, {QosFlowIdentifier: 2}}}, + }, + }, + }, + ERABInformationList: ERABInformationList{{ERABID: 5, DLForwarding: Ptr(DLForwardingProposed)}, {ERABID: 6}}, + TargetCellID: NGRANCGI{NRCGI: &NRCGI{PLMNIdentity: containerPLMN(), NRCellIdentity: 0x123456789}}, + IndexToRFSP: Ptr(IndexToRFSP(256)), + UEHistoryInformation: UEHistoryInformation{ + {LastVisitedCellInformation: LastVisitedCellInformation{NGRANCell: &LastVisitedNGRANCellInformation{ + GlobalCellID: NGRANCGI{EUTRACGI: &EUTRACGI{PLMNIdentity: containerPLMN(), EUTRACellIdentity: 0x0abcdef}}, + CellType: CellType{CellSize: CellSizeLarge}, + TimeUEStayedInCell: 4095, + TimeUEStayedInCellEnhancedGranularity: Ptr(TimeUEStayedInCellEnhancedGranularity(40950)), + HOCauseValue: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + }}}, + {LastVisitedCellInformation: LastVisitedCellInformation{EUTRANCell: Ptr(LastVisitedEUTRANCellInformation(mustHexBytes(goldenS1APLastVisitedEUTRANCellInformation)))}}, + }, + } +} + +func mustHexBytes(s string) []byte { + b, err := hex.DecodeString(s) + if err != nil { + panic(err) + } + + return b +} + +func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerGolden(t *testing.T) { + in := goldSourceNGRANContainer() + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + if got := hex.EncodeToString(b); got != goldenSourceNGRANContainer { + t.Fatalf("encoded\n got %s\nwant %s", got, goldenSourceNGRANContainer) + } + + out, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, in) { + t.Fatalf("decoded\n got %+v\nwant %+v", out, in) + } + + if out.TargetCellID.NRCGI == nil || out.TargetCellID.NRCGI.NRCellIdentity != 0x123456789 || out.TargetCellID.NRCGI.PLMNIdentity != containerPLMN() { + t.Fatalf("targetCell-ID = %+v", out.TargetCellID) + } + + again, err := out.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x, want %x", again, b) + } +} + +func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerMinimal(t *testing.T) { + in := &SourceNGRANNodeToTargetNGRANNodeTransparentContainer{ + RRCContainer: RRCContainer{0x80}, + TargetCellID: NGRANCGI{EUTRACGI: &EUTRACGI{PLMNIdentity: containerPLMN(), EUTRACellIdentity: 0x0000101}}, + UEHistoryInformation: UEHistoryInformation{{LastVisitedCellInformation: LastVisitedCellInformation{GERANCell: Ptr(LastVisitedGERANCellInformation{0x01})}}}, + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, in) { + t.Fatalf("decoded\n got %+v\nwant %+v", out, in) + } +} + +func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerRejectsInvalid(t *testing.T) { + for name, c := range map[string]*SourceNGRANNodeToTargetNGRANNodeTransparentContainer{ + "no target cell": { + RRCContainer: RRCContainer{0x80}, + UEHistoryInformation: UEHistoryInformation{{LastVisitedCellInformation: LastVisitedCellInformation{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}}}, + }, + "two target cells": { + RRCContainer: RRCContainer{0x80}, + TargetCellID: NGRANCGI{NRCGI: &NRCGI{}, EUTRACGI: &EUTRACGI{}}, + UEHistoryInformation: UEHistoryInformation{{LastVisitedCellInformation: LastVisitedCellInformation{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}}}, + }, + "empty history": { + RRCContainer: RRCContainer{0x80}, + TargetCellID: NGRANCGI{NRCGI: &NRCGI{}}, + }, + "history cell without alternative": { + RRCContainer: RRCContainer{0x80}, + TargetCellID: NGRANCGI{NRCGI: &NRCGI{}}, + UEHistoryInformation: UEHistoryInformation{{}}, + }, + "index to RFSP out of root": { + RRCContainer: RRCContainer{0x80}, + TargetCellID: NGRANCGI{NRCGI: &NRCGI{}}, + IndexToRFSP: Ptr(IndexToRFSP(0)), + UEHistoryInformation: UEHistoryInformation{{LastVisitedCellInformation: LastVisitedCellInformation{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}}}, + }, + } { + t.Run(name, func(t *testing.T) { + if _, err := c.Marshal(); err == nil { + t.Fatal("Marshal succeeded") + } + }) + } +} + +func handTransparentExtensions(t *testing.T, w *per.Writer, crit Criticality) { + t.Helper() + + w.AlignToByte() + mustNil(t, per.EncodeConstrainedWholeNumber(w, per.Aligned, 1, maxProtocolExtensions, 2)) + + for i, id := range []int64{1000, 999} { + mustNil(t, per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, id)) + mustNil(t, per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(crit))) + mustNil(t, per.EncodeOpenTypeBytes(w, per.Aligned, bytes.Repeat([]byte{0x5a}, 1+i*130))) + } +} + +func handAdditions(t *testing.T, w *per.Writer) { + t.Helper() + + mustNil(t, per.EncodeNormallySmallLength(w, per.Aligned, 2, func(int64) error { + w.WriteBit(false) + w.WriteBit(true) + + return nil + })) + mustNil(t, per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x77, 0x88})) +} + +func handChoiceExtension(t *testing.T, w *per.Writer) { + t.Helper() + + mustNil(t, encodeContainerField(w, per.Aligned, ieField{id: 998, crit: CriticalityIgnore, raw: []byte{0x01, 0x02, 0x03}})) +} + +func handSourceNGRANContainer(t *testing.T, extCrit Criticality) []byte { + t.Helper() + + w := per.NewWriter() + enc := per.Aligned + + w.WriteBit(true) + w.WriteBit(false) + w.WriteBit(false) + w.WriteBit(false) + w.WriteBit(true) + + mustNil(t, RRCContainer{0x80}.MarshalPER(w, enc)) + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 0, ngranCGIAlternatives-1, ngranCGIChoiceExtensions)) + handChoiceExtension(t, w) + + mustNil(t, per.EncodeLength(w, enc, 1, maxnoofCellsinUEHistoryInfo, true, 2, func(int64) error { + w.WriteBit(true) + w.WriteBit(true) + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 0, lastVisitedCellInformationAlternatives-1, lastVisitedCellInformationChoiceExtensions)) + handChoiceExtension(t, w) + handTransparentExtensions(t, w, CriticalityReject) + handAdditions(t, w) + + w.WriteBit(false) + w.WriteBit(false) + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 0, lastVisitedCellInformationAlternatives-1, lastVisitedCellInformationNGRAN)) + w.WriteBit(true) + w.WriteBit(false) + w.WriteBit(false) + w.WriteBit(true) + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 0, ngranCGIAlternatives-1, ngranCGINR)) + mustNil(t, (&NRCGI{PLMNIdentity: containerPLMN(), NRCellIdentity: 1}).MarshalPER(w, enc)) + w.WriteBit(true) + w.WriteBit(true) + mustNil(t, CellSizeSmall.MarshalPER(w, enc)) + handTransparentExtensions(t, w, CriticalityIgnore) + handAdditions(t, w) + mustNil(t, TimeUEStayedInCell(7).MarshalPER(w, enc)) + handTransparentExtensions(t, w, CriticalityReject) + handAdditions(t, w) + + return nil + })) + + handTransparentExtensions(t, w, extCrit) + handAdditions(t, w) + w.AlignToByte() + + return w.Bytes() +} + +func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerLossless(t *testing.T) { + for _, crit := range []Criticality{CriticalityIgnore, CriticalityReject} { + t.Run(crit.String(), func(t *testing.T) { + b := handSourceNGRANContainer(t, crit) + + c, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) + if err != nil { + t.Fatal(err) + } + + if c.TargetCellID.NRCGI != nil || c.TargetCellID.EUTRACGI != nil || c.TargetCellID.choiceExtension == nil || c.TargetCellID.choiceExtension.id != 998 { + t.Fatalf("targetCell-ID = %+v", c.TargetCellID) + } + + if len(c.UEHistoryInformation) != 2 || c.UEHistoryInformation[1].LastVisitedCellInformation.NGRANCell == nil { + t.Fatalf("UE history = %+v", c.UEHistoryInformation) + } + + again, err := c.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(again, b) { + t.Fatalf("re-encoded\n got %x\n want %x", again, b) + } + }) + } +} + +func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerTruncated(t *testing.T) { + b, err := goldSourceNGRANContainer().Marshal() + if err != nil { + t.Fatal(err) + } + + for n := range len(b) - 1 { + if _, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b[:n]); err == nil { + t.Errorf("parse of %d/%d octets succeeded", n, len(b)) + } + } +} + +func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerExtensionValue(t *testing.T) { + w := per.NewWriter() + w.WriteBit(false) + w.WriteBit(false) + w.WriteBit(false) + w.WriteBit(true) + w.WriteBit(false) + mustNil(t, RRCContainer{0x80}.MarshalPER(w, per.Aligned)) + mustNil(t, (&NGRANCGI{NRCGI: &NRCGI{}}).MarshalPER(w, per.Aligned)) + mustNil(t, per.EncodeInteger(w, per.Aligned, per.Bounds{LB: 1, HasLB: true, UB: 256, HasUB: true, Extensible: true}, 300)) + w.AlignToByte() + + if _, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(w.Bytes()); !errors.Is(err, errNotComprehended) { + t.Fatalf("err = %v, want not comprehended", err) + } +} + +func goldContainerHandoverRequest() *HandoverRequest { + c, err := goldSourceNGRANContainer().Marshal() + if err != nil { + panic(err) + } + + transfer, err := (&PDUSessionResourceSetupRequestTransfer{ + ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ + TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + }}, + PDUSessionType: PDUSessionTypeIPv4, + QosFlowSetupRequest: QosFlowSetupRequestList{{ + QosFlowIdentifier: 1, + QosFlowLevelQosParameters: QosFlowLevelQosParameters{ + QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}}, + AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, + }, + }}, + }).Marshal() + if err != nil { + panic(err) + } + + return &HandoverRequest{ + AMFUENGAPID: 1, + HandoverType: HandoverTypeIntra5GS, + Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + SecurityContext: SecurityContext{NextHopChainingCount: 1}, + PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ + PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: transfer, + }}, + AllowedNSSAI: AllowedNSSAI{{SNSSAI: SNSSAI{SST: 1}}}, + SourceToTargetTransparentContainer: c, + GUAMI: GUAMI{PLMNIdentity: containerPLMN(), AMFRegionID: 1, AMFSetID: 1}, + AMFUENGAPID2: Ptr(AMFUENGAPID(3)), + TargetRANNodeID: &GlobalRANNodeID{Kind: RANNodeIDGNB, PLMNIdentity: containerPLMN(), Value: 0x12345, Bits: 22}, + } +} + +func goldPathSwitchRequestSourceAMFGUAMI() *PathSwitchRequest { + return &PathSwitchRequest{ + RANUENGAPID: 2, + SourceAMFUENGAPID: 1, + UserLocationInformation: &UserLocationInformation{ + Kind: UserLocationNR, PLMNIdentity: containerPLMN(), CellIdentity: 0x123456789, + TAI: TAI{PLMNIdentity: containerPLMN(), TAC: 1}, + }, + UESecurityCapabilities: &UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + PDUSessionResourceToBeSwitchedDLList: PDUSessionResourceToBeSwitchedDLList{ + {PDUSessionID: 5, Transfer: TransferContainer(mustHexBytes("001fc0a80101000000010002"))}, + }, + SourceAMFGUAMI: &GUAMI{PLMNIdentity: containerPLMN(), AMFRegionID: 0xca, AMFSetID: 0x3fe, AMFPointer: 0x3f}, + } +} + +func transparentContainerGoldenCases() []goldenRoundTrip { + return []goldenRoundTrip{ + { + "HandoverRequestSourceNGRANContainerTargetRANNodeID", + goldContainerHandoverRequest(), + func(v []byte) (any, error) { return ParseHandoverRequest(v) }, + "000d0080e000000c000a00020001001d000100000f40020400006e000a0c3b9aca00303b9aca0000770009100008000000000000005d002108000000000000000000000000000000000000000000000000000000000000000000490027000005002021000003008b000a01f0c0a8010100000001008600010000880007000100000900000000000200010065003a397001800040050501004000050140200145030002f8391234567890ff10320002f8390abcdef1800fff9ff604020b0002f83900001011000064001c00070002f83901004001c24002000301c740080002f83900048d14", + }, + { + "PathSwitchRequestSourceAMFGUAMI", + goldPathSwitchRequestSourceAMFGUAMI(), + func(v []byte) (any, error) { return ParsePathSwitchRequest(v) }, + "0019004e0000060055000200020064000200010079400f4002f839123456789002f83900000100774009100008000000000000004c00100000050c001fc0a8010100000001000201c540070002f839caffbf", + }, + } +} + +func TestTransparentContainerMessagesGolden(t *testing.T) { + for _, c := range transparentContainerGoldenCases() { + t.Run(c.name, func(t *testing.T) { checkGoldenRoundTrip(t, c) }) + } +} + +func TestTransparentContainerMessagesWireCriticality(t *testing.T) { + ho := wireIEs(t, goldContainerHandoverRequest().encodeBody) + if last := ho[len(ho)-1]; last.id != IDTargetRANNodeID || last.crit != CriticalityIgnore { + t.Fatalf("HandoverRequest last IE = %d/%s, want Target-RAN-Node-ID ignore", last.id, last.crit) + } + + ps := wireIEs(t, goldPathSwitchRequestSourceAMFGUAMI().encodeBody) + if last := ps[len(ps)-1]; last.id != IDSourceAMFGUAMI || last.crit != CriticalityIgnore { + t.Fatalf("PathSwitchRequest last IE = %d/%s, want SourceAMF-GUAMI ignore", last.id, last.crit) + } +} + +func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerTshark(t *testing.T) { + tshark, err1 := exec.LookPath("tshark") + text2pcap, err2 := exec.LookPath("text2pcap") + + if err1 != nil || err2 != nil { + t.Skip("tshark/text2pcap not installed") + } + + var dump strings.Builder + hexDump(&dump, marshalT(t, goldContainerHandoverRequest())) + + rows := tsharkFields(t, tshark, text2pcap, dump.String(), + "ngap.NRCellIdentity", "ngap.EUTRACellIdentity", "ngap.indexToRFSP", "ngap.timeUEStayedInCell", + "ngap.timeUEStayedInCellEnhancedGranularity", "ngap.cellSize", "ngap.pDUSessionID", "ngap.qosFlowIdentifier", + "ngap.dRB_ID", "ngap.qosFlowMappingIndication", "ngap.e_RAB_ID", "ngap.dLForwarding", + "_ws.malformed", "_ws.expert.message") + if len(rows) != 1 { + t.Fatalf("tshark decoded %d frames, want 1", len(rows)) + } + + want := []string{ + "0x0000000123456789", "0x00abcdef", "256", "4095", "40950", "3", "5,5", "1,1,2,1,2", "1", "1", "5,6", "0,0", + "", "", + } + + for i, w := range want { + if rows[0][i] != w { + t.Errorf("column %d = %q, want %q (row %q)", i, rows[0][i], w, strings.Join(rows[0], "|")) + } + } +} + +func FuzzTransparentContainerRoundTrip(f *testing.F) { + f.Add(mustHexBytes(goldenSourceNGRANContainer)) + + f.Fuzz(func(t *testing.T, data []byte) { + c, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(data) + if err != nil { + return + } + + b, err := c.Marshal() + if err != nil { + t.Fatalf("encode decoded value: %v", err) + } + + again, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) + if err != nil { + t.Fatalf("decode re-encoded value: %v", err) + } + + if !reflect.DeepEqual(again, c) { + t.Fatalf("re-decoded\n got %+v\nwant %+v", again, c) + } + + b2, err := again.Marshal() + if err != nil || !bytes.Equal(b2, b) { + t.Fatalf("re-encoded %x (%v), want %x", b2, err, b) + } + }) +} diff --git a/s1ap/enum_names.go b/s1ap/enum_names.go index 8d5d0eff97..0d8c0a2002 100644 --- a/s1ap/enum_names.go +++ b/s1ap/enum_names.go @@ -141,3 +141,18 @@ var reportAreaNames = map[ReportArea]string{ } func (r ReportArea) Name() string { return reportAreaNames[r] } + +var dlForwardingNames = map[DLForwarding]string{ + DLForwardingProposed: "dL-Forwarding-proposed", +} + +func (d DLForwarding) Name() string { return dlForwardingNames[d] } + +var cellSizeNames = map[CellSize]string{ + CellSizeVerySmall: "verysmall", + CellSizeSmall: "small", + CellSizeMedium: "medium", + CellSizeLarge: "large", +} + +func (c CellSize) Name() string { return cellSizeNames[c] } diff --git a/s1ap/enum_names_test.go b/s1ap/enum_names_test.go index 1094c0209d..3c23bd07e4 100644 --- a/s1ap/enum_names_test.go +++ b/s1ap/enum_names_test.go @@ -45,6 +45,11 @@ func TestEnumNames(t *testing.T) { {"PagingPriority(99)", PagingPriority(99).Name(), ""}, {"DirectForwardingPathAvailable", DirectForwardingPathAvailable.Name(), "directPathAvailable"}, + {"DLForwardingProposed", DLForwardingProposed.Name(), "dL-Forwarding-proposed"}, + {"DLForwarding(9)", DLForwarding(9).Name(), ""}, + {"CellSizeVerySmall", CellSizeVerySmall.Name(), "verysmall"}, + {"CellSizeLarge", CellSizeLarge.Name(), "large"}, + {"CellSize(9)", CellSize(9).Name(), ""}, {"DirectForwardingPathAvailability(9)", DirectForwardingPathAvailability(9).Name(), ""}, {"UERetentionUesRetained", UERetentionUesRetained.Name(), "ues-retained"}, diff --git a/s1ap/fuzz_test.go b/s1ap/fuzz_test.go index 8af9121721..401748d641 100644 --- a/s1ap/fuzz_test.go +++ b/s1ap/fuzz_test.go @@ -31,11 +31,17 @@ func FuzzDecodeNoPanic(f *testing.F) { f.Add(b) } + f.Add(mustHexBytes(goldenSourceeNBContainer)) + f.Fuzz(func(t *testing.T, data []byte) { _, _ = unmarshalPERValue[Cause](data) _, _ = unmarshalPERValue[CriticalityDiagnostics](data) _, _ = unmarshalPERValue[GUMMEI](data) + for _, tp := range transferParsers { + _ = tp.Parse(data) + } + pdu, err := Unmarshal(data) if err != nil { return diff --git a/s1ap/ie_ids.go b/s1ap/ie_ids.go index 437a44d6c0..6d250bcc8c 100644 --- a/s1ap/ie_ids.go +++ b/s1ap/ie_ids.go @@ -60,6 +60,7 @@ const ( IDSecurityKey ProtocolIEID = 73 IDUERadioCapability ProtocolIEID = 74 IDGUMMEI ProtocolIEID = 75 + IDERABInformationListItem ProtocolIEID = 78 IDDirectForwardingPathAvailability ProtocolIEID = 79 IDUEIdentityIndexValue ProtocolIEID = 80 IDEUTRANTraceID ProtocolIEID = 86 @@ -69,6 +70,7 @@ const ( IDUEAssociatedLogicalS1ConnectionItem ProtocolIEID = 91 IDResetType ProtocolIEID = 92 IDUEAssociatedLogicalS1ConnectionListResAck ProtocolIEID = 93 + IDERABToBeSwitchedULList ProtocolIEID = 95 IDSTMSI ProtocolIEID = 96 IDRequestType ProtocolIEID = 98 IDUES1APIDs ProtocolIEID = 99 @@ -104,6 +106,7 @@ const ( IDRoutingID ProtocolIEID = 148 IDPagingPriority ProtocolIEID = 151 IDGUMMEIList ProtocolIEID = 154 + IDSourceMMEGUMMEI ProtocolIEID = 157 IDMMEUES1APID2 ProtocolIEID = 158 IDTrafficLoadReductionIndication ProtocolIEID = 161 IDGWContextReleaseIndication ProtocolIEID = 164 diff --git a/s1ap/ie_names.go b/s1ap/ie_names.go index 5fbb2cfcc2..59bd9cb434 100644 --- a/s1ap/ie_names.go +++ b/s1ap/ie_names.go @@ -68,6 +68,7 @@ var protocolIENames = map[ProtocolIEID]string{ IDSecurityKey: "SecurityKey", IDUERadioCapability: "UERadioCapability", IDGUMMEI: "GUMMEI-ID", + IDERABInformationListItem: "E-RABInformationListItem", IDDirectForwardingPathAvailability: "Direct-Forwarding-Path-Availability", IDUEIdentityIndexValue: "UEIdentityIndexValue", IDEUTRANTraceID: "E-UTRAN-Trace-ID", @@ -77,64 +78,66 @@ var protocolIENames = map[ProtocolIEID]string{ IDUEAssociatedLogicalS1ConnectionItem: "UE-associatedLogicalS1-ConnectionItem", IDResetType: "ResetType", IDUEAssociatedLogicalS1ConnectionListResAck: "UE-associatedLogicalS1-ConnectionListResAck", - IDSTMSI: "S-TMSI", - IDRequestType: "RequestType", - IDUES1APIDs: "UE-S1AP-IDs", - IDEUTRANCGI: "EUTRAN-CGI", - IDSourceToTargetTransparentContainer: "Source-ToTarget-TransparentContainer", - IDServedGUMMEIs: "ServedGUMMEIs", - IDUESecurityCapabilities: "UESecurityCapabilities", - IDCNDomain: "CNDomain", - IDTargetToSourceTransparentContainer: "Target-ToSource-TransparentContainer", - IDSONConfigurationTransferECT: "SONConfigurationTransferECT", - IDSONConfigurationTransferMCT: "SONConfigurationTransferMCT", - IDRRCEstablishmentCause: "RRC-Establishment-Cause", - IDNASSecurityParametersfromEUTRAN: "NASSecurityParametersfromE-UTRAN", - IDNASSecurityParameterstoEUTRAN: "NASSecurityParameterstoE-UTRAN", - IDDefaultPagingDRX: "DefaultPagingDRX", - IDDataForwardingNotPossible: "Data-Forwarding-Not-Possible", - IDLPPaPDU: "LPPa-PDU", - IDRoutingID: "Routing-ID", - IDPagingPriority: "PagingPriority", - IDUserLocationInformation: "UserLocationInformation", - IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", - IDERABToBeModifiedListBearerModInd: "E-RABToBeModifiedListBearerModInd", - IDERABToBeModifiedItemBearerModInd: "E-RABToBeModifiedItemBearerModInd", - IDERABNotToBeModifiedListBearerModInd: "E-RABNotToBeModifiedListBearerModInd", - IDERABNotToBeModifiedItemBearerModInd: "E-RABNotToBeModifiedItemBearerModInd", - IDERABModifyListBearerModConf: "E-RABModifyListBearerModConf", - IDERABModifyItemBearerModConf: "E-RABModifyItemBearerModConf", - IDERABFailedToModifyListBearerModConf: "E-RABFailedToModifyListBearerModConf", - IDERABToBeReleasedListBearerModConf: "E-RABToBeReleasedListBearerModConf", - IDUERetentionInformation: "UE-RetentionInformation", - IDOverloadResponse: "OverloadResponse", - IDMessageIdentifier: "MessageIdentifier", - IDSerialNumber: "SerialNumber", - IDWarningAreaList: "WarningAreaList", - IDRepetitionPeriod: "RepetitionPeriod", - IDNumberofBroadcastRequest: "NumberofBroadcastRequest", - IDWarningType: "WarningType", - IDWarningSecurityInfo: "WarningSecurityInfo", - IDDataCodingScheme: "DataCodingScheme", - IDWarningMessageContents: "WarningMessageContents", - IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", - IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", - IDConcurrentWarningMessageIndicator: "ConcurrentWarningMessageIndicator", - IDExtendedRepetitionPeriod: "ExtendedRepetitionPeriod", - IDGUMMEIList: "GUMMEIList", - IDMMEUES1APID2: "MME-UE-S1AP-ID-2", - IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", - IDGWContextReleaseIndication: "GWContextReleaseIndication", - IDECGIListForRestart: "ECGIListForRestart", - IDTAIListForRestart: "TAIListForRestart", - IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", - IDKillAllWarningMessages: "KillAllWarningMessages", - IDPWSfailedECGIList: "PWSfailedECGIList", - IDMMEGroupID: "MME-Group-ID", - IDAdditionalGUTI: "Additional-GUTI", - IDS1Message: "S1-Message", - IDUEUsageType: "UE-Usage-Type", - IDWarningAreaCoordinates: "WarningAreaCoordinates", + IDERABToBeSwitchedULList: "E-RABToBeSwitchedULList", + IDSTMSI: "S-TMSI", + IDRequestType: "RequestType", + IDUES1APIDs: "UE-S1AP-IDs", + IDEUTRANCGI: "EUTRAN-CGI", + IDSourceToTargetTransparentContainer: "Source-ToTarget-TransparentContainer", + IDServedGUMMEIs: "ServedGUMMEIs", + IDUESecurityCapabilities: "UESecurityCapabilities", + IDCNDomain: "CNDomain", + IDTargetToSourceTransparentContainer: "Target-ToSource-TransparentContainer", + IDSONConfigurationTransferECT: "SONConfigurationTransferECT", + IDSONConfigurationTransferMCT: "SONConfigurationTransferMCT", + IDRRCEstablishmentCause: "RRC-Establishment-Cause", + IDNASSecurityParametersfromEUTRAN: "NASSecurityParametersfromE-UTRAN", + IDNASSecurityParameterstoEUTRAN: "NASSecurityParameterstoE-UTRAN", + IDDefaultPagingDRX: "DefaultPagingDRX", + IDDataForwardingNotPossible: "Data-Forwarding-Not-Possible", + IDLPPaPDU: "LPPa-PDU", + IDRoutingID: "Routing-ID", + IDPagingPriority: "PagingPriority", + IDUserLocationInformation: "UserLocationInformation", + IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", + IDERABToBeModifiedListBearerModInd: "E-RABToBeModifiedListBearerModInd", + IDERABToBeModifiedItemBearerModInd: "E-RABToBeModifiedItemBearerModInd", + IDERABNotToBeModifiedListBearerModInd: "E-RABNotToBeModifiedListBearerModInd", + IDERABNotToBeModifiedItemBearerModInd: "E-RABNotToBeModifiedItemBearerModInd", + IDERABModifyListBearerModConf: "E-RABModifyListBearerModConf", + IDERABModifyItemBearerModConf: "E-RABModifyItemBearerModConf", + IDERABFailedToModifyListBearerModConf: "E-RABFailedToModifyListBearerModConf", + IDERABToBeReleasedListBearerModConf: "E-RABToBeReleasedListBearerModConf", + IDUERetentionInformation: "UE-RetentionInformation", + IDOverloadResponse: "OverloadResponse", + IDMessageIdentifier: "MessageIdentifier", + IDSerialNumber: "SerialNumber", + IDWarningAreaList: "WarningAreaList", + IDRepetitionPeriod: "RepetitionPeriod", + IDNumberofBroadcastRequest: "NumberofBroadcastRequest", + IDWarningType: "WarningType", + IDWarningSecurityInfo: "WarningSecurityInfo", + IDDataCodingScheme: "DataCodingScheme", + IDWarningMessageContents: "WarningMessageContents", + IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", + IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", + IDConcurrentWarningMessageIndicator: "ConcurrentWarningMessageIndicator", + IDExtendedRepetitionPeriod: "ExtendedRepetitionPeriod", + IDGUMMEIList: "GUMMEIList", + IDSourceMMEGUMMEI: "SourceMME-GUMMEI", + IDMMEUES1APID2: "MME-UE-S1AP-ID-2", + IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", + IDGWContextReleaseIndication: "GWContextReleaseIndication", + IDECGIListForRestart: "ECGIListForRestart", + IDTAIListForRestart: "TAIListForRestart", + IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", + IDKillAllWarningMessages: "KillAllWarningMessages", + IDPWSfailedECGIList: "PWSfailedECGIList", + IDMMEGroupID: "MME-Group-ID", + IDAdditionalGUTI: "Additional-GUTI", + IDS1Message: "S1-Message", + IDUEUsageType: "UE-Usage-Type", + IDWarningAreaCoordinates: "WarningAreaCoordinates", } // ProtocolIEIDName returns the TS 36.413 name of id, and whether it is known. diff --git a/s1ap/parsers.go b/s1ap/parsers.go index 702923877e..c55682653a 100644 --- a/s1ap/parsers.go +++ b/s1ap/parsers.go @@ -86,3 +86,10 @@ var messageParsers = []messageParser{ {"ParsePWSFailureIndication", func(v []byte) error { _, err := ParsePWSFailureIndication(v); return err }}, {"ParseRerouteNASRequest", func(v []byte) error { _, err := ParseRerouteNASRequest(v); return err }}, } + +var transferParsers = []messageParser{ + {"ParseSourceeNBToTargeteNBTransparentContainer", func(v []byte) error { + _, err := ParseSourceeNBToTargeteNBTransparentContainer(v) + return err + }}, +} diff --git a/s1ap/parsers_test.go b/s1ap/parsers_test.go index 2c6ac979d4..fa340489ca 100644 --- a/s1ap/parsers_test.go +++ b/s1ap/parsers_test.go @@ -18,8 +18,8 @@ var parseFuncRE = regexp.MustCompile(`(?m)^func (Parse[A-Za-z0-9]+)\(`) // unregistered parser is an unfuzzed decode path — exactly the gap that lets a // panic on hostile input reach production. func TestEveryParserIsRegistered(t *testing.T) { - registered := make(map[string]bool, len(messageParsers)) - for _, p := range messageParsers { + registered := make(map[string]bool, len(messageParsers)+len(transferParsers)) + for _, p := range append(append([]messageParser{}, messageParsers...), transferParsers...) { if registered[p.Name] { t.Errorf("parser %s registered twice", p.Name) } @@ -49,13 +49,13 @@ func TestEveryParserIsRegistered(t *testing.T) { found++ if !registered[m[1]] { - t.Errorf("%s declares %s but it is not in messageParsers (add it, or the fuzzer will never reach it)", name, m[1]) + t.Errorf("%s declares %s but it is in neither messageParsers nor transferParsers (add it, or the fuzzer will never reach it)", name, m[1]) } } } - if found != len(messageParsers) { - t.Errorf("found %d ParseXxx functions in source, registry has %d", found, len(messageParsers)) + if want := len(messageParsers) + len(transferParsers); found != want { + t.Errorf("found %d ParseXxx functions in source, registries have %d", found, want) } if found == 0 { diff --git a/s1ap/path_switch.go b/s1ap/path_switch.go index 3715ba57ba..a1a4a00984 100644 --- a/s1ap/path_switch.go +++ b/s1ap/path_switch.go @@ -26,6 +26,7 @@ type PathSwitchRequest struct { EUTRANCGI *EUTRANCGI TAI *TAI UESecurityCapabilities *UESecurityCapabilities + SourceMMEGUMMEI *GUMMEI messageMeta } @@ -123,6 +124,27 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return m.UESecurityCapabilities, true }, }, + { + id: IDSourceMMEGUMMEI, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + var v GUMMEI + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.SourceMMEGUMMEI = &v + + return nil + }, + encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + if m.SourceMMEGUMMEI == nil { + return nil, false + } + + return m.SourceMMEGUMMEI, true + }, + }, } func (m *PathSwitchRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/per_gen.go b/s1ap/per_gen.go index c762c3dbfd..14c7720bf6 100644 --- a/s1ap/per_gen.go +++ b/s1ap/per_gen.go @@ -378,6 +378,52 @@ func (cellIDCancelledItem *CellIDCancelledItem) UnmarshalPER(r *per.Reader, enc return nil } +func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(cellType.extensions.Present()) + w.WriteBit(cellType.iEExtensions != nil) + if err := cellType.CellSize.MarshalPER(w, enc); err != nil { + return err + } + if cellType.iEExtensions != nil { + if err := (*cellType.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if cellType.extensions.Present() { + if err := cellType.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cellType.CellSize).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cellType.iEExtensions = &v + } + if extBit { + if err := cellType.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (completedCellInEAIItem *CompletedCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -806,6 +852,69 @@ func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader return nil } +func (eRABInformationListItem *ERABInformationListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(eRABInformationListItem.extensions.Present()) + w.WriteBit(eRABInformationListItem.DLForwarding != nil) + w.WriteBit(eRABInformationListItem.iEExtensions != nil) + if err := eRABInformationListItem.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if eRABInformationListItem.DLForwarding != nil { + if err := (*eRABInformationListItem.DLForwarding).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABInformationListItem.iEExtensions != nil { + if err := (*eRABInformationListItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABInformationListItem.extensions.Present() { + if err := eRABInformationListItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (eRABInformationListItem *ERABInformationListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwarding, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eRABInformationListItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLForwarding { + var v DLForwarding + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABInformationListItem.DLForwarding = &v + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABInformationListItem.iEExtensions = &v + } + if extBit { + if err := eRABInformationListItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (eRABItem *ERABItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -2325,6 +2434,64 @@ func (handoverRestrictionList *HandoverRestrictionList) UnmarshalPER(r *per.Read return nil } +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(lastVisitedEUTRANCellInformation.extensions.Present()) + w.WriteBit(lastVisitedEUTRANCellInformation.iEExtensions != nil) + if err := lastVisitedEUTRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedEUTRANCellInformation.CellType.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedEUTRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { + return err + } + if lastVisitedEUTRANCellInformation.iEExtensions != nil { + if err := (*lastVisitedEUTRANCellInformation.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if lastVisitedEUTRANCellInformation.extensions.Present() { + if err := lastVisitedEUTRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedEUTRANCellInformation.iEExtensions = &v + } + if extBit { + if err := lastVisitedEUTRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (ngENB *NgENB) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -2691,6 +2858,96 @@ func (servedGUMMEIsItem *ServedGUMMEIsItem) UnmarshalPER(r *per.Reader, enc per. return nil } +func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(sourceeNBToTargeteNBTransparentContainer.extensions.Present()) + w.WriteBit(sourceeNBToTargeteNBTransparentContainer.ERABInformationList != nil) + w.WriteBit(sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP != nil) + w.WriteBit(sourceeNBToTargeteNBTransparentContainer.iEExtensions != nil) + if err := sourceeNBToTargeteNBTransparentContainer.RRCContainer.MarshalPER(w, enc); err != nil { + return err + } + if sourceeNBToTargeteNBTransparentContainer.ERABInformationList != nil { + if err := sourceeNBToTargeteNBTransparentContainer.ERABInformationList.MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceeNBToTargeteNBTransparentContainer.TargetCellID.MarshalPER(w, enc); err != nil { + return err + } + if sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP != nil { + if err := (*sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP).MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation.MarshalPER(w, enc); err != nil { + return err + } + if sourceeNBToTargeteNBTransparentContainer.iEExtensions != nil { + if err := (*sourceeNBToTargeteNBTransparentContainer.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if sourceeNBToTargeteNBTransparentContainer.extensions.Present() { + if err := sourceeNBToTargeteNBTransparentContainer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ERABInformationList, err := r.ReadBit() + if err != nil { + return err + } + p_SubscriberProfileIDforRFP, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sourceeNBToTargeteNBTransparentContainer.RRCContainer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_ERABInformationList { + if err := (&sourceeNBToTargeteNBTransparentContainer.ERABInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if err := (&sourceeNBToTargeteNBTransparentContainer.TargetCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_SubscriberProfileIDforRFP { + var v SubscriberProfileIDforRFP + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP = &v + } + if err := (&sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v transparentIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceeNBToTargeteNBTransparentContainer.iEExtensions = &v + } + if extBit { + if err := sourceeNBToTargeteNBTransparentContainer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) diff --git a/s1ap/pws_overload_test.go b/s1ap/pws_overload_test.go index b0e0b254ea..056dad227e 100644 --- a/s1ap/pws_overload_test.go +++ b/s1ap/pws_overload_test.go @@ -244,6 +244,7 @@ func newMessageCases() []newMessageCase { initialContextSetupRequestGoldenCases(), handoverRequestGoldenCases(), pathSwitchRequestAcknowledgeGoldenCases(), + transparentContainerGoldenCases(), )...) } diff --git a/s1ap/table_order_test.go b/s1ap/table_order_test.go index 51dd7f3010..283148a5ea 100644 --- a/s1ap/table_order_test.go +++ b/s1ap/table_order_test.go @@ -54,7 +54,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"UplinkNASTransport", tableIDs(uplinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDEUTRANCGI, IDTAI}}, {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU}}, {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEIdentityIndexValue, IDUEPagingID, IDPagingDRX, IDCNDomain, IDTAIList, IDPagingPriority, IDUERadioCapabilityForPaging}}, - {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDENBUES1APID, IDERABToBeSwitchedDLList, IDSourceMMEUES1APID, IDEUTRANCGI, IDTAI, IDUESecurityCapabilities}}, + {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDENBUES1APID, IDERABToBeSwitchedDLList, IDSourceMMEUES1APID, IDEUTRANCGI, IDTAI, IDUESecurityCapabilities, IDSourceMMEGUMMEI}}, {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeReleasedList, IDSecurityContext, IDMMEUES1APID2, IDUESecurityCapabilities}}, {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"Reset", tableIDs(resetIEs), []ProtocolIEID{IDCause, IDResetType}}, diff --git a/s1ap/testdata/fuzz/FuzzTransparentContainerRoundTrip/e81635cb9ebcd5c3 b/s1ap/testdata/fuzz/FuzzTransparentContainerRoundTrip/e81635cb9ebcd5c3 new file mode 100644 index 0000000000..599eeb191c --- /dev/null +++ b/s1ap/testdata/fuzz/FuzzTransparentContainerRoundTrip/e81635cb9ebcd5c3 @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("a\x010\x01\x00N0\x02A0\x00N0\x01\x06000000000\x0f\x0200\x000") diff --git a/s1ap/transparent_container.go b/s1ap/transparent_container.go new file mode 100644 index 0000000000..a2cf186663 --- /dev/null +++ b/s1ap/transparent_container.go @@ -0,0 +1,473 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "fmt" + + "github.com/ellanetworks/core/per" +) + +const maxnoofCellsinUEHistoryInfo = 16 + +const ( + lastVisitedCellItemEUTRAN = iota + lastVisitedCellItemUTRAN + lastVisitedCellItemGERAN + + lastVisitedCellItemRootCount = 3 +) + +const lastVisitedCellItemNGRANAddition = 0 + +const lastVisitedGERANCellInformationRootCount = 1 + +type SourceeNBToTargeteNBTransparentContainer struct { + RRCContainer RRCContainer + ERABInformationList ERABInformationList `per:",optional"` + TargetCellID EUTRANCGI + SubscriberProfileIDforRFP *SubscriberProfileIDforRFP `per:",optional"` + UEHistoryInformation UEHistoryInformation + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +func (c *SourceeNBToTargeteNBTransparentContainer) Marshal() (TransparentContainer, error) { + w := per.NewWriter() + + if err := c.MarshalPER(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return TransparentContainer(w.Bytes()), nil +} + +func ParseSourceeNBToTargeteNBTransparentContainer(b []byte) (*SourceeNBToTargeteNBTransparentContainer, error) { + var c SourceeNBToTargeteNBTransparentContainer + + if err := c.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + return nil, fmt.Errorf("s1ap: SourceeNB-ToTargeteNB-TransparentContainer: %w", err) + } + + return &c, nil +} + +type RRCContainer []byte + +func (c RRCContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *RRCContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *c = RRCContainer(b) + + return nil +} + +type DLForwarding uint8 + +const ( + DLForwardingProposed DLForwarding = iota + + dlForwardingRootCount = 1 +) + +func (d DLForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, dlForwardingRootCount, int64(d), "DL-Forwarding") +} + +func (d *DLForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, dlForwardingRootCount, "DL-Forwarding") + if err != nil { + return err + } + + *d = DLForwarding(idx) + + return nil +} + +type ERABInformationListItem struct { + ERABID ERABID + DLForwarding *DLForwarding `per:",optional"` + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ERABInformationList []ERABInformationListItem + +func (l ERABInformationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABInformationListItem, CriticalityIgnore, l) +} + +func (l *ERABInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABInformationListItem](r, enc, maxnoofERABs, IDERABInformationListItem) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SubscriberProfileIDforRFP uint16 + +func (s SubscriberProfileIDforRFP) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 256, HasUB: true}, int64(s)) +} + +func (s *SubscriberProfileIDforRFP) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 256, HasUB: true}) + if err != nil { + return err + } + + *s = SubscriberProfileIDforRFP(v) + + return nil +} + +type UEHistoryInformation []LastVisitedCellItem + +func (u UEHistoryInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsinUEHistoryInfo, []LastVisitedCellItem(u)) +} + +func (u *UEHistoryInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[LastVisitedCellItem](r, enc, 1, maxnoofCellsinUEHistoryInfo) + if err != nil { + return err + } + + *u = items + + return nil +} + +type LastVisitedCellItem struct { + EUTRANCell *LastVisitedEUTRANCellInformation + UTRANCell *LastVisitedUTRANCellInformation + GERANCell *LastVisitedGERANCellInformation + NGRANCell *LastVisitedNGRANCellInformation + extension *choiceExtensionAlternative +} + +func (l *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + idx, err := choiceAlternative("LastVisitedCell-Item", l.EUTRANCell != nil, l.UTRANCell != nil, l.GERANCell != nil, l.NGRANCell != nil, l.extension != nil) + if err != nil { + return err + } + + switch idx { + case lastVisitedCellItemEUTRAN: + if err := encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, idx); err != nil { + return err + } + + return l.EUTRANCell.MarshalPER(w, enc) + case lastVisitedCellItemUTRAN: + if err := encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, idx); err != nil { + return err + } + + return l.UTRANCell.MarshalPER(w, enc) + case lastVisitedCellItemGERAN: + if err := encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, idx); err != nil { + return err + } + + return l.GERANCell.MarshalPER(w, enc) + case lastVisitedCellItemRootCount: + return encodeChoiceAddition(w, enc, lastVisitedCellItemNGRANAddition, l.NGRANCell) + default: + return l.extension.MarshalPER(w, enc) + } +} + +func (l *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + isExt, err := r.ReadBit() + if err != nil { + return err + } + + *l = LastVisitedCellItem{} + + if isExt { + alt, err := decodeChoiceAddition(r, enc) + if err != nil { + return err + } + + if alt.index != lastVisitedCellItemNGRANAddition { + l.extension = alt + + return nil + } + + var v LastVisitedNGRANCellInformation + + inner := per.NewReader(alt.value) + if err := v.UnmarshalPER(inner, enc); err != nil { + return err + } + + if inner.Bits() >= 8 { + return fmt.Errorf("s1ap: LastVisitedCell-Item nG-RAN-Cell open type carries %d trailing bits", inner.Bits()) + } + + l.NGRANCell = &v + + return nil + } + + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, lastVisitedCellItemRootCount-1) + if err != nil { + return err + } + + switch idx { + case lastVisitedCellItemEUTRAN: + var v LastVisitedEUTRANCellInformation + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + l.EUTRANCell = &v + case lastVisitedCellItemUTRAN: + var v LastVisitedUTRANCellInformation + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + l.UTRANCell = &v + default: + var v LastVisitedGERANCellInformation + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + l.GERANCell = &v + } + + return nil +} + +type LastVisitedEUTRANCellInformation struct { + GlobalCellID EUTRANCGI + CellType CellType + TimeUEStayedInCell TimeUEStayedInCell + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CellType struct { + CellSize CellSize + iEExtensions *transparentIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CellSize uint8 + +const ( + CellSizeVerySmall CellSize = iota + CellSizeSmall + CellSizeMedium + CellSizeLarge + + cellSizeRootCount = 4 +) + +func (c CellSize) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, cellSizeRootCount, int64(c), "Cell-Size") +} + +func (c *CellSize) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, cellSizeRootCount, "Cell-Size") + if err != nil { + return err + } + + *c = CellSize(idx) + + return nil +} + +type TimeUEStayedInCell uint16 + +func (t TimeUEStayedInCell) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(t)) +} + +func (t *TimeUEStayedInCell) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + if err != nil { + return err + } + + *t = TimeUEStayedInCell(v) + + return nil +} + +type LastVisitedUTRANCellInformation []byte + +func (c LastVisitedUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *LastVisitedUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *c = LastVisitedUTRANCellInformation(b) + + return nil +} + +type LastVisitedNGRANCellInformation []byte + +func (c LastVisitedNGRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *LastVisitedNGRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *c = LastVisitedNGRANCellInformation(b) + + return nil +} + +type LastVisitedGERANCellInformation struct { + extension *choiceExtensionAlternative +} + +func (g *LastVisitedGERANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + if g.extension != nil { + return g.extension.MarshalPER(w, enc) + } + + return encodeExtensibleChoice(w, enc, lastVisitedGERANCellInformationRootCount, 0) +} + +func (g *LastVisitedGERANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + isExt, err := r.ReadBit() + if err != nil { + return err + } + + *g = LastVisitedGERANCellInformation{} + + if !isExt { + _, err := per.DecodeConstrainedWholeNumber(r, enc, 0, lastVisitedGERANCellInformationRootCount-1) + + return err + } + + g.extension, err = decodeChoiceAddition(r, enc) + + return err +} + +type choiceExtensionAlternative struct { + index int64 + value []byte +} + +func (a *choiceExtensionAlternative) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(true) + + if err := per.EncodeNormallySmall(w, enc, a.index); err != nil { + return err + } + + return per.EncodeOpenTypeBytes(w, enc, a.value) +} + +func encodeChoiceAddition(w *per.Writer, enc per.Encoding, index int64, m per.Marshaler) error { + w.WriteBit(true) + + if err := per.EncodeNormallySmall(w, enc, index); err != nil { + return err + } + + return per.EncodeOpenType(w, enc, m) +} + +func decodeChoiceAddition(r *per.Reader, enc per.Encoding) (*choiceExtensionAlternative, error) { + index, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return nil, err + } + + value, err := per.DecodeOpenTypeBytes(r, enc) + if err != nil { + return nil, err + } + + if len(value) == 0 { + return nil, fmt.Errorf("s1ap: empty open type for CHOICE extension alternative %d", index) + } + + return &choiceExtensionAlternative{index: index, value: value}, nil +} + +type transparentIEExtensions struct { + data []byte + nbits int +} + +func (e *transparentIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { + if enc == per.Aligned { + w.AlignToByte() + } + + w.WriteBitString(e.data, e.nbits) + + return nil +} + +func (e *transparentIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + if enc == per.Aligned { + r.AlignToByte() + } + + start := r.Offset() + + n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) + if err != nil { + return err + } + + for range n { + if _, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs); err != nil { + return err + } + + if _, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false); err != nil { + return err + } + + if err := per.SkipOpenType(r, enc); err != nil { + return err + } + } + + e.data, e.nbits, err = r.Since(start) + + return err +} diff --git a/s1ap/transparent_container_test.go b/s1ap/transparent_container_test.go new file mode 100644 index 0000000000..f451859222 --- /dev/null +++ b/s1ap/transparent_container_test.go @@ -0,0 +1,407 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "encoding/hex" + "errors" + "os/exec" + "reflect" + "strings" + "testing" + + "github.com/ellanetworks/core/per" +) + +const goldenSourceeNBContainer = "60018001004e40024500004e4001060002f839abcdef10ff100002f83900001011800fff800d0c0002f839000000010080001e" + +const goldenNGAPLastVisitedNGRANCellInformation = "0002f839000000010080001e" + +func containerPLMN() PLMNIdentity { return PLMNIdentity{0x02, 0xf8, 0x39} } + +func mustHexBytes(s string) []byte { + b, err := hex.DecodeString(s) + if err != nil { + panic(err) + } + + return b +} + +func goldSourceeNBContainer() *SourceeNBToTargeteNBTransparentContainer { + return &SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: RRCContainer{0x80}, + ERABInformationList: ERABInformationList{{ERABID: 5, DLForwarding: Ptr(DLForwardingProposed)}, {ERABID: 6}}, + TargetCellID: EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}, + SubscriberProfileIDforRFP: Ptr(SubscriberProfileIDforRFP(256)), + UEHistoryInformation: UEHistoryInformation{ + {EUTRANCell: &LastVisitedEUTRANCellInformation{ + GlobalCellID: EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0x0000101}, + CellType: CellType{CellSize: CellSizeLarge}, + TimeUEStayedInCell: 4095, + }}, + {NGRANCell: Ptr(LastVisitedNGRANCellInformation(mustHexBytes(goldenNGAPLastVisitedNGRANCellInformation)))}, + }, + } +} + +func TestSourceeNBToTargeteNBTransparentContainerGolden(t *testing.T) { + in := goldSourceeNBContainer() + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + if got := hex.EncodeToString(b); got != goldenSourceeNBContainer { + t.Fatalf("encoded\n got %s\nwant %s", got, goldenSourceeNBContainer) + } + + out, err := ParseSourceeNBToTargeteNBTransparentContainer(b) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, in) { + t.Fatalf("decoded\n got %+v\nwant %+v", out, in) + } + + if out.TargetCellID != (EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}) { + t.Fatalf("targetCell-ID = %+v", out.TargetCellID) + } + + again, err := out.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x, want %x", again, b) + } +} + +func TestSourceeNBToTargeteNBTransparentContainerFromHandoverRequest(t *testing.T) { + m := handoverRequestGoldenCases()[0].msg.(*HandoverRequest) + + c, err := ParseSourceeNBToTargeteNBTransparentContainer(m.SourceToTarget) + if err != nil { + t.Fatal(err) + } + + if c.TargetCellID != (EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x0000101}) { + t.Fatalf("targetCell-ID = %+v", c.TargetCellID) + } + + if !bytes.Equal(c.RRCContainer, []byte{0x80}) || len(c.UEHistoryInformation) != 1 || c.UEHistoryInformation[0].EUTRANCell == nil { + t.Fatalf("container = %+v", c) + } +} + +func TestSourceeNBToTargeteNBTransparentContainerAlternatives(t *testing.T) { + in := &SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: RRCContainer{0x80}, + TargetCellID: EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 1}, + UEHistoryInformation: UEHistoryInformation{ + {UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01, 0x02})}, + {GERANCell: &LastVisitedGERANCellInformation{}}, + }, + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := ParseSourceeNBToTargeteNBTransparentContainer(b) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, in) { + t.Fatalf("decoded\n got %+v\nwant %+v", out, in) + } +} + +func TestSourceeNBToTargeteNBTransparentContainerRejectsInvalid(t *testing.T) { + cell := UEHistoryInformation{{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}} + + for name, c := range map[string]*SourceeNBToTargeteNBTransparentContainer{ + "empty history": {RRCContainer: RRCContainer{0x80}}, + "history cell without alternative": {RRCContainer: RRCContainer{0x80}, UEHistoryInformation: UEHistoryInformation{{}}}, + "history cell with two alternatives": {RRCContainer: RRCContainer{0x80}, UEHistoryInformation: UEHistoryInformation{{UTRANCell: Ptr(LastVisitedUTRANCellInformation{}), GERANCell: &LastVisitedGERANCellInformation{}}}}, + "subscriber profile out of range": {RRCContainer: RRCContainer{0x80}, SubscriberProfileIDforRFP: Ptr(SubscriberProfileIDforRFP(0)), UEHistoryInformation: cell}, + "empty E-RAB list": {RRCContainer: RRCContainer{0x80}, ERABInformationList: ERABInformationList{}, UEHistoryInformation: cell}, + } { + t.Run(name, func(t *testing.T) { + if _, err := c.Marshal(); err == nil { + t.Fatal("Marshal succeeded") + } + }) + } +} + +func handTransparentExtensions(t *testing.T, w *per.Writer, crit Criticality) { + t.Helper() + + w.AlignToByte() + mustNil(t, per.EncodeConstrainedWholeNumber(w, per.Aligned, 1, maxProtocolExtensions, 2)) + + for i, id := range []int64{1000, 999} { + mustNil(t, per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, id)) + mustNil(t, per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(crit))) + mustNil(t, per.EncodeOpenTypeBytes(w, per.Aligned, bytes.Repeat([]byte{0x5a}, 1+i*130))) + } +} + +func handAdditions(t *testing.T, w *per.Writer) { + t.Helper() + + mustNil(t, per.EncodeNormallySmallLength(w, per.Aligned, 2, func(int64) error { + w.WriteBit(false) + w.WriteBit(true) + + return nil + })) + mustNil(t, per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x77, 0x88})) +} + +func handChoiceAddition(t *testing.T, w *per.Writer, index int64) { + t.Helper() + + w.WriteBit(true) + mustNil(t, per.EncodeNormallySmall(w, per.Aligned, index)) + mustNil(t, per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x01, 0x02, 0x03})) +} + +func handSourceeNBContainer(t *testing.T, extCrit Criticality) []byte { + t.Helper() + + w := per.NewWriter() + enc := per.Aligned + + w.WriteBit(true) + w.WriteBit(true) + w.WriteBit(false) + w.WriteBit(true) + + mustNil(t, RRCContainer{0x80}.MarshalPER(w, enc)) + mustNil(t, per.EncodeLength(w, enc, 1, maxnoofERABs, true, 1, func(int64) error { + item := per.NewWriter() + item.WriteBit(true) + item.WriteBit(false) + item.WriteBit(true) + mustNil(t, ERABID(5).MarshalPER(item, enc)) + handTransparentExtensions(t, item, CriticalityReject) + handAdditions(t, item) + item.AlignToByte() + + return encodeContainerField(w, enc, ieField{id: IDERABInformationListItem, crit: CriticalityIgnore, raw: item.Bytes()}) + })) + mustNil(t, EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}.MarshalPER(w, enc)) + + mustNil(t, per.EncodeLength(w, enc, 1, maxnoofCellsinUEHistoryInfo, true, 3, func(int64) error { + handChoiceAddition(t, w, 7) + + w.WriteBit(true) + mustNil(t, per.EncodeNormallySmall(w, enc, 0)) + mustNil(t, per.EncodeOpenTypeBytes(w, enc, []byte{0x02, 0xaa, 0xbb})) + + mustNil(t, encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, lastVisitedCellItemGERAN)) + handChoiceAddition(t, w, 4) + + return nil + })) + + handTransparentExtensions(t, w, extCrit) + handAdditions(t, w) + w.AlignToByte() + + return w.Bytes() +} + +func TestSourceeNBToTargeteNBTransparentContainerLossless(t *testing.T) { + for _, crit := range []Criticality{CriticalityIgnore, CriticalityReject} { + t.Run(crit.String(), func(t *testing.T) { + b := handSourceeNBContainer(t, crit) + + c, err := ParseSourceeNBToTargeteNBTransparentContainer(b) + if err != nil { + t.Fatal(err) + } + + if c.TargetCellID != (EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}) { + t.Fatalf("targetCell-ID = %+v", c.TargetCellID) + } + + h := c.UEHistoryInformation + if len(h) != 3 || h[0].extension == nil || h[0].extension.index != 7 || + h[1].NGRANCell == nil || !bytes.Equal(*h[1].NGRANCell, []byte{0xaa, 0xbb}) || + h[2].GERANCell == nil || h[2].GERANCell.extension == nil { + t.Fatalf("UE history = %+v", h) + } + + again, err := c.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(again, b) { + t.Fatalf("re-encoded\n got %x\n want %x", again, b) + } + }) + } +} + +func TestSourceeNBToTargeteNBTransparentContainerTruncated(t *testing.T) { + b, err := goldSourceeNBContainer().Marshal() + if err != nil { + t.Fatal(err) + } + + for n := range len(b) - 1 { + if _, err := ParseSourceeNBToTargeteNBTransparentContainer(b[:n]); err == nil { + t.Errorf("parse of %d/%d octets succeeded", n, len(b)) + } + } +} + +func TestSourceeNBToTargeteNBTransparentContainerExtensionValue(t *testing.T) { + w := per.NewWriter() + w.WriteBit(false) + w.WriteBit(true) + w.WriteBit(false) + w.WriteBit(false) + mustNil(t, RRCContainer{0x80}.MarshalPER(w, per.Aligned)) + mustNil(t, per.EncodeLength(w, per.Aligned, 1, maxnoofERABs, true, 1, func(int64) error { + item := per.NewWriter() + item.WriteBit(false) + item.WriteBit(true) + item.WriteBit(false) + mustNil(t, ERABID(5).MarshalPER(item, per.Aligned)) + mustNil(t, per.EncodeEnumerated(item, per.Aligned, dlForwardingRootCount, true, 1)) + item.AlignToByte() + + return encodeContainerField(w, per.Aligned, ieField{id: IDERABInformationListItem, crit: CriticalityIgnore, raw: item.Bytes()}) + })) + w.AlignToByte() + + if _, err := ParseSourceeNBToTargeteNBTransparentContainer(w.Bytes()); !errors.Is(err, errNotComprehended) { + t.Fatalf("err = %v, want not comprehended", err) + } +} + +func goldContainerHandoverRequest() *HandoverRequest { + c, err := goldSourceeNBContainer().Marshal() + if err != nil { + panic(err) + } + + return &HandoverRequest{ + MMEUES1APID: 1, + HandoverType: HandoverTypeIntraLTE, + Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + UEAMBR: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, + ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}, + SourceToTarget: c, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0xc000}, + SecurityContext: SecurityContext{NextHopChainingCount: 3}, + } +} + +func goldPathSwitchRequestSourceMMEGUMMEI() *PathSwitchRequest { + m := sampledPathSwitchRequest() + m.SourceMMEGUMMEI = Ptr(GUMMEI{PLMNIdentity: containerPLMN(), MMEGroupID: MMEGroupID{0x80, 0x01}, MMECode: 0x02}) + + return m +} + +func transparentContainerGoldenCases() []newMessageCase { + return []newMessageCase{ + { + name: "HandoverRequestSourceeNBContainer", + msg: goldContainerHandoverRequest(), + parse: func(b []byte) (any, error) { return ParseHandoverRequest(b) }, + choice: isInitiating, + golden: "000100809c000008000000020001000100010000024002020000420008100f42404007a1200035001200001b000d0a1f0a00000100000001000904006800343360018001004e40024500004e4001060002f839abcdef10ff100002f83900001011800fff800d0c0002f839000000010080001e006b000510000c000000280021180000000000000000000000000000000000000000000000000000000000000000", + }, + { + name: "PathSwitchRequestSourceMMEGUMMEI", + msg: goldPathSwitchRequestSourceMMEGUMMEI(), + parse: func(b []byte) (any, error) { return ParsePathSwitchRequest(b) }, + choice: isInitiating, + golden: "0003004f0000070008000200020016000f000017000a0a1f0a0102030102030400580005c0020000bf006440080000f110123c6010004340060000f1100001006b400518000c0000009d40070002f839800102", + }, + } +} + +func TestPathSwitchRequestSourceMMEGUMMEIWireCriticality(t *testing.T) { + ies := wireIEs(t, goldPathSwitchRequestSourceMMEGUMMEI().encodeBody) + if last := ies[len(ies)-1]; last.id != IDSourceMMEGUMMEI || last.crit != CriticalityIgnore { + t.Fatalf("last IE = %d/%s, want SourceMME-GUMMEI ignore", last.id, last.crit) + } +} + +func TestSourceeNBToTargeteNBTransparentContainerTshark(t *testing.T) { + tshark, err1 := exec.LookPath("tshark") + text2pcap, err2 := exec.LookPath("text2pcap") + + if err1 != nil || err2 != nil { + t.Skip("tshark/text2pcap not installed") + } + + b, err := goldContainerHandoverRequest().Marshal() + if err != nil { + t.Fatal(err) + } + + var dump strings.Builder + hexDump(&dump, b) + + rows := tsharkFields(t, tshark, text2pcap, dump.String(), + "s1ap.CellIdentity", "s1ap.subscriberProfileIDforRFP", "s1ap.e_RAB_ID", "s1ap.dL_Forwarding", + "s1ap.cell_Size", "s1ap.time_UE_StayedInCell", "ngap.NRCellIdentity", "ngap.timeUEStayedInCell", + "_ws.malformed", "_ws.expert.message") + if len(rows) != 1 { + t.Fatalf("tshark decoded %d frames, want 1", len(rows)) + } + + want := []string{"0x0abcdef1,0x00000101", "256", "5,5,6", "0", "3", "4095", "0x0000000000000010", "30", "", ""} + + for i, w := range want { + if rows[0][i] != w { + t.Errorf("column %d = %q, want %q (row %q)", i, rows[0][i], w, strings.Join(rows[0], "|")) + } + } +} + +func FuzzTransparentContainerRoundTrip(f *testing.F) { + f.Add(mustHexBytes(goldenSourceeNBContainer)) + + f.Fuzz(func(t *testing.T, data []byte) { + c, err := ParseSourceeNBToTargeteNBTransparentContainer(data) + if err != nil { + return + } + + b, err := c.Marshal() + if err != nil { + t.Fatalf("encode decoded value: %v", err) + } + + again, err := ParseSourceeNBToTargeteNBTransparentContainer(b) + if err != nil { + t.Fatalf("decode re-encoded value: %v", err) + } + + if !reflect.DeepEqual(again, c) { + t.Fatalf("re-decoded\n got %+v\nwant %+v", again, c) + } + + b2, err := again.Marshal() + if err != nil || !bytes.Equal(b2, b) { + t.Fatalf("re-encoded %x (%v), want %x", b2, err, b) + } + }) +} From b825d4dbbcc086593b56a67cecf20e4486557882 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sat, 14 Nov 2026 12:55:42 -0500 Subject: [PATCH 10/16] chore: codec for gtp-relay Signed-off-by: Guillaume Belanger --- cmd/pergen/emit.go | 7 + cmd/pergen/emit_struct.go | 22 +- cmd/pergen/emit_struct_test.go | 28 + cmd/pergen/gen.go | 5 + cmd/pergen/tag.go | 15 +- cmd/pergen/tag_test.go | 17 + internal/decoder/ngap/handover.go | 85 +- .../ngap/initial_context_setup_request.go | 12 +- internal/decoder/ngap/path_switch.go | 33 +- .../ngap/pdu_session_resource_modify.go | 130 +- .../pdu_session_resource_setup_response.go | 55 +- internal/decoder/ngap/pdu_session_transfer.go | 2 + ...session_resource_modify_response_full.json | 4 +- internal/decoder/ngap/tnl_extensions_test.go | 315 +++ internal/decoder/s1ap/erab_extensions.go | 89 + internal/decoder/s1ap/erab_extensions_test.go | 134 + internal/decoder/s1ap/erab_modify.go | 28 +- internal/decoder/s1ap/erab_setup.go | 14 + internal/decoder/s1ap/handover.go | 30 +- .../decoder/s1ap/initial_context_setup.go | 6 + internal/decoder/s1ap/modeled_ies_test.go | 48 + internal/decoder/s1ap/path_switch.go | 23 + internal/mme/bearer_arp_test.go | 3 +- internal/mme/dedicated_bearer_test.go | 3 +- internal/smf/non_gbr_test.go | 3 +- internal/smf/qos_flows_test.go | 3 +- .../scenarios/interworking/ims_mcptt.go | 3 +- internal/tester/scenarios/s1enb/ims_mcptt.go | 5 +- ngap/enum_names.go | 7 + ngap/enum_names_test.go | 4 + ngap/handover_transfer.go | 126 +- ngap/ie_common.go | 123 +- ngap/ie_extensions.go | 177 ++ ngap/ie_handover.go | 20 +- ngap/ie_ids.go | 537 ++-- ngap/ie_names.go | 537 ++-- ngap/ie_qos.go | 99 +- ngap/ie_qos_test.go | 5 +- ngap/ie_setup.go | 109 - ngap/ie_slice.go | 8 +- ngap/ie_table.go | 27 +- ngap/ies.go | 13 +- ngap/initial_context_setup.go | 8 +- ngap/pdu_session_resource_modify.go | 91 +- .../pdu_session_resource_modify_indication.go | 50 +- ngap/pdu_session_resource_setup.go | 59 +- ngap/per_gen.go | 2178 ++++++++--------- ngap/symmetry_test.go | 11 +- ngap/table_order_test.go | 16 +- .../FuzzTNLTransferRoundTrip/d58f147aedd0a272 | 3 + ngap/tnl_lossless_test.go | 1360 ++++++++++ s1ap/enum_names.go | 20 + s1ap/erab_lists.go | 219 ++ s1ap/erab_modification.go | 19 +- s1ap/erab_modify.go | 50 +- s1ap/erab_release.go | 8 +- s1ap/erab_setup.go | 38 +- s1ap/golden_tshark_test.go | 2 +- s1ap/handover_preparation.go | 6 +- s1ap/handover_resource_allocation.go | 10 +- s1ap/ie_erab.go | 224 +- s1ap/ie_erab_test.go | 5 +- s1ap/ie_extensions.go | 153 ++ s1ap/ie_handover.go | 70 +- s1ap/ie_ids.go | 13 + s1ap/ie_names.go | 13 + s1ap/ie_table.go | 27 +- s1ap/ies.go | 40 +- s1ap/initial_context_setup.go | 10 +- s1ap/initial_context_setup_test.go | 3 +- s1ap/paging.go | 2 +- s1ap/path_switch.go | 32 +- s1ap/per_gen.go | 632 ++--- s1ap/per_leaf.go | 82 +- s1ap/pws_overload_test.go | 15 +- s1ap/reset.go | 4 +- s1ap/table_order_test.go | 9 +- .../FuzzERABListRoundTrip/97e81ee8c2b8276d | 3 + s1ap/tnl_lossless_test.go | 729 ++++++ s1ap/transparent_container.go | 2 +- 80 files changed, 6575 insertions(+), 2555 deletions(-) create mode 100644 internal/decoder/ngap/tnl_extensions_test.go create mode 100644 internal/decoder/s1ap/erab_extensions.go create mode 100644 internal/decoder/s1ap/erab_extensions_test.go create mode 100644 ngap/ie_extensions.go create mode 100644 ngap/testdata/fuzz/FuzzTNLTransferRoundTrip/d58f147aedd0a272 create mode 100644 ngap/tnl_lossless_test.go create mode 100644 s1ap/erab_lists.go create mode 100644 s1ap/ie_extensions.go create mode 100644 s1ap/testdata/fuzz/FuzzERABListRoundTrip/97e81ee8c2b8276d create mode 100644 s1ap/tnl_lossless_test.go diff --git a/cmd/pergen/emit.go b/cmd/pergen/emit.go index 88d541f5c9..f2ffc57497 100644 --- a/cmd/pergen/emit.go +++ b/cmd/pergen/emit.go @@ -54,6 +54,12 @@ func (g *generator) parseStruct(name string, named *types.Named, s *types.Struct continue } + if parsed.ExtTable != "" { + st.fields = append(st.fields, fieldInfo{name: s.Field(i).Name(), tag: parsed, extTable: parsed.ExtTable, fieldIdx: len(st.fields)}) + + continue + } + fi, err := g.classifyField(s.Field(i), rawTag) if err != nil { return nil, err @@ -112,6 +118,7 @@ type fieldInfo struct { isOptional bool hasDefault bool isSkip bool + extTable string // noDeref marks an OPTIONAL field whose absence is a nil slice rather than // a nil pointer, so the value is used without dereferencing. noDeref bool diff --git a/cmd/pergen/emit_struct.go b/cmd/pergen/emit_struct.go index c903fe1b8e..a535161369 100644 --- a/cmd/pergen/emit_struct.go +++ b/cmd/pergen/emit_struct.go @@ -41,7 +41,7 @@ func (g *generator) emitStruct(name string, s *structType) error { var optionalIdx []int for i, fi := range rootFields { - if fi.isOptional || fi.hasDefault || fi.isSkip { + if fi.isOptional || fi.hasDefault || fi.isSkip || fi.extTable != "" { optionalIdx = append(optionalIdx, i) } } @@ -67,6 +67,12 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields r := &g.buf fmt.Fprintf(r, "func (%s *%s) MarshalPER(w *per.Writer, enc per.Encoding) error {\n", recv, typeName) + for _, fi := range rootFields { + if fi.extTable != "" { + fmt.Fprintf(r, "\text := extensionFields(%s, %s, &%s.%s)\n", fi.extTable, recv, recv, fi.name) + } + } + // Extension bit (X.691 §19.1): set when any extension addition is present. if extensible { if extRaw != "" { @@ -84,6 +90,8 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields expr := recv + "." + fi.name switch { + case fi.extTable != "": + fmt.Fprintf(r, "\tw.WriteBit(len(ext) > 0)\n") case fi.isSkip: fmt.Fprintf(r, "\tw.WriteBit(false)\n") case fi.isOptional: @@ -97,7 +105,11 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields fi := rootFields[i] expr := recv + "." + fi.name - if fi.isSkip { + if fi.extTable != "" { + fmt.Fprintf(r, "\tif len(ext) > 0 {\n") + fmt.Fprintf(r, "\t\tif err := encodeExtensionContainer(w, enc, ext); err != nil {\n\t\t\treturn err\n\t\t}\n") + fmt.Fprintf(r, "\t}\n") + } else if fi.isSkip { continue } else if fi.isOptional { valExpr := "(*" + expr + ")" @@ -323,7 +335,11 @@ func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extField fi := rootFields[i] expr := recv + "." + fi.name - if fi.isSkip { + if fi.extTable != "" { + fmt.Fprintf(r, "\tif %s {\n", preambleVar(fi)) + fmt.Fprintf(r, "\t\tif err := decodeExtensionContainer(r, enc, %s, %s, &%s); err != nil {\n\t\t\treturn err\n\t\t}\n", fi.extTable, recv, expr) + fmt.Fprintf(r, "\t}\n") + } else if fi.isSkip { fmt.Fprintf(r, "\tif %s {\n", preambleVar(fi)) fmt.Fprintf(r, "\t\tvar v %s\n", fi.typeStr) g.emitFieldUnmarshal(r, "v", fi, 1) diff --git a/cmd/pergen/emit_struct_test.go b/cmd/pergen/emit_struct_test.go index 3c6459efa2..b5ea1ef9ba 100644 --- a/cmd/pergen/emit_struct_test.go +++ b/cmd/pergen/emit_struct_test.go @@ -142,3 +142,31 @@ func TestExtRawRejectsModeledAdditions(t *testing.T) { t.Fatal("extraw combined with an extension addition accepted") } } + +func TestEmitExtTable(t *testing.T) { + t.Parallel() + + var g generator + + root := []fieldInfo{{name: "iEExtensions", extTable: "tExtIEs"}} + + g.emitMarshalExt("x", "T", root, nil, []int{0}, true, "ext") + g.emitUnmarshalExt("x", "T", root, nil, []int{0}, true, "ext") + + out := g.buf.String() + + for _, want := range []string{ + "ext := extensionFields(tExtIEs, x, &x.iEExtensions)", + "w.WriteBit(len(ext) > 0)", + "if err := encodeExtensionContainer(w, enc, ext); err != nil", + "if err := decodeExtensionContainer(r, enc, tExtIEs, x, &x.iEExtensions); err != nil", + } { + if !strings.Contains(out, want) { + t.Errorf("generated code lacks %q:\n%s", want, out) + } + } + + if _, err := parser.ParseFile(token.NewFileSet(), "", "package p\n"+out, 0); err != nil { + t.Fatalf("generated code does not parse: %v\n%s", err, out) + } +} diff --git a/cmd/pergen/gen.go b/cmd/pergen/gen.go index 42bda25e6c..f8627e34be 100644 --- a/cmd/pergen/gen.go +++ b/cmd/pergen/gen.go @@ -11,6 +11,7 @@ import ( "path/filepath" "slices" "sort" + "strings" "golang.org/x/tools/go/packages" ) @@ -154,6 +155,10 @@ func (g *generator) collectReferencedStructs(scope *types.Scope) { } for i := 0; i < underlying.NumFields(); i++ { + if tag := structTagGet(underlying.Tag(i), "per"); tag == "-" || strings.Contains(tag, "exttable:") { + continue + } + ft := underlying.Field(i).Type() if p, ok := ft.(*types.Pointer); ok { ft = p.Elem() diff --git a/cmd/pergen/tag.go b/cmd/pergen/tag.go index 07573d0c98..cb0426f053 100644 --- a/cmd/pergen/tag.go +++ b/cmd/pergen/tag.go @@ -47,8 +47,9 @@ type FieldTag struct { ExtAdd int // ExtSeq marks the parent type extensible ("...") with no extension // additions; it sits on a placeholder field that carries no encoding. - ExtSeq bool - ExtRaw bool + ExtSeq bool + ExtRaw bool + ExtTable string EnumExtValues int64 HasEnumExtValues bool @@ -152,7 +153,7 @@ func looksLikeOption(token string) bool { if i := strings.IndexByte(token, ':'); i > 0 { key := strings.TrimSpace(token[:i]) switch key { - case "range", "size", "default", "choice", "tag", "extadd", "extvalues": + case "range", "size", "default", "choice", "tag", "extadd", "extvalues", "exttable": return true } // Unknown "key:value" is claimed here so parseOption reports an error @@ -230,6 +231,14 @@ func parseOption(t *FieldTag, opt string) error { t.ExtAdd = n + return nil + case "exttable": + if value == "" { + return errors.New("exttable: empty table") + } + + t.ExtTable = value + return nil case "extvalues": n, err := strconv.ParseInt(value, 10, 64) diff --git a/cmd/pergen/tag_test.go b/cmd/pergen/tag_test.go index e72b707621..4087254183 100644 --- a/cmd/pergen/tag_test.go +++ b/cmd/pergen/tag_test.go @@ -356,3 +356,20 @@ func TestParseTagExtRaw(t *testing.T) { t.Fatalf("ParseTag(\",extraw\") = %+v", tag) } } + +func TestParseTagExtTable(t *testing.T) { + t.Parallel() + + tag, err := ParseTag(",exttable:fooExtIEs") + if err != nil { + t.Fatal(err) + } + + if tag.ExtTable != "fooExtIEs" { + t.Fatalf("ExtTable = %q", tag.ExtTable) + } + + if _, err := ParseTag(",exttable:"); err == nil { + t.Fatal("empty exttable accepted") + } +} diff --git a/internal/decoder/ngap/handover.go b/internal/decoder/ngap/handover.go index 4796ddc4cb..2125b83edf 100644 --- a/internal/decoder/ngap/handover.go +++ b/internal/decoder/ngap/handover.go @@ -62,20 +62,41 @@ type HandoverRequiredTransferDecoded struct { // HandoverCommandTransferDecoded is the per-session forwarding plan the source // node is given (TS 38.413 §9.3.4.10). type HandoverCommandTransferDecoded struct { - DLForwardingUPTNLInformation *GTPTunnel `json:"dl_forwarding_up_tnl_information,omitempty"` - QosFlowToBeForwarded []int64 `json:"qos_flow_to_be_forwarded,omitempty"` - DataForwardingResponseDRB []DataForwardingResponseDRB `json:"data_forwarding_response_drb,omitempty"` + DLForwardingUPTNLInformation *GTPTunnel `json:"dl_forwarding_up_tnl_information,omitempty"` + QosFlowToBeForwarded []int64 `json:"qos_flow_to_be_forwarded,omitempty"` + DataForwardingResponseDRB []DataForwardingResponseDRB `json:"data_forwarding_response_drb,omitempty"` + AdditionalDLForwardingUPTNLInformation []QosFlowPerTNLInformation `json:"additional_dl_forwarding_up_tnl_information,omitempty"` + ULForwardingUPTNLInformation *GTPTunnel `json:"ul_forwarding_up_tnl_information,omitempty"` + AdditionalULForwardingUPTNLInformation []GTPTunnel `json:"additional_ul_forwarding_up_tnl_information,omitempty"` + DataForwardingResponseERAB []DataForwardingResponseERAB `json:"data_forwarding_response_erab,omitempty"` +} + +type DataForwardingResponseERAB struct { + ERABID uint8 `json:"erab_id"` + DLForwardingUPTNLInformation GTPTunnel `json:"dl_forwarding_up_tnl_information"` +} + +type AdditionalDLUPTNLInformationForHO struct { + AdditionalDLNGUUPTNLInformation GTPTunnel `json:"additional_dl_ng_u_up_tnl_information"` + AdditionalQosFlowSetupResponse []QosFlowWithDataForwarding `json:"additional_qos_flow_setup_response,omitempty"` + AdditionalDLForwardingUPTNLInformation *GTPTunnel `json:"additional_dl_forwarding_up_tnl_information,omitempty"` + AdditionalRedundantDLNGUUPTNLInformation *GTPTunnel `json:"additional_redundant_dl_ng_u_up_tnl_information,omitempty"` } // HandoverRequestAcknowledgeTransferDecoded is what the target node reports per // admitted session (TS 38.413 §9.3.4.11). type HandoverRequestAcknowledgeTransferDecoded struct { - DLNGUUPTNLInformation GTPTunnel `json:"dl_ng_u_up_tnl_information"` - DLForwardingUPTNLInformation *GTPTunnel `json:"dl_forwarding_up_tnl_information,omitempty"` - SecurityResult *SecurityResult `json:"security_result,omitempty"` - QosFlowSetupResponse []QosFlowWithDataForwarding `json:"qos_flow_setup_response,omitempty"` - QosFlowFailedToSetup []QosFlowWithCause `json:"qos_flow_failed_to_setup,omitempty"` - DataForwardingResponseDRB []DataForwardingResponseDRB `json:"data_forwarding_response_drb,omitempty"` + DLNGUUPTNLInformation GTPTunnel `json:"dl_ng_u_up_tnl_information"` + DLForwardingUPTNLInformation *GTPTunnel `json:"dl_forwarding_up_tnl_information,omitempty"` + SecurityResult *SecurityResult `json:"security_result,omitempty"` + QosFlowSetupResponse []QosFlowWithDataForwarding `json:"qos_flow_setup_response,omitempty"` + QosFlowFailedToSetup []QosFlowWithCause `json:"qos_flow_failed_to_setup,omitempty"` + DataForwardingResponseDRB []DataForwardingResponseDRB `json:"data_forwarding_response_drb,omitempty"` + AdditionalDLUPTNLInformationForHO []AdditionalDLUPTNLInformationForHO `json:"additional_dl_up_tnl_information_for_ho,omitempty"` + ULForwardingUPTNLInformation *GTPTunnel `json:"ul_forwarding_up_tnl_information,omitempty"` + AdditionalULForwardingUPTNLInformation []GTPTunnel `json:"additional_ul_forwarding_up_tnl_information,omitempty"` + DataForwardingResponseERAB []DataForwardingResponseERAB `json:"data_forwarding_response_erab,omitempty"` + RedundantDLNGUUPTNLInformation *GTPTunnel `json:"redundant_dl_ng_u_up_tnl_information,omitempty"` } // HandoverResourceAllocationUnsuccessfulTransferDecoded says why the target node @@ -157,6 +178,11 @@ func libHandoverCommandTransfer(raw ngap.TransferContainer) (any, error) { out.QosFlowToBeForwarded = append(out.QosFlowToBeForwarded, int64(f.QosFlowIdentifier)) } + out.AdditionalDLForwardingUPTNLInformation = qosFlowPerTNLInformationList(t.AdditionalDLForwardingUPTNLInformation) + out.ULForwardingUPTNLInformation = optionalGTPTunnel(t.ULForwardingUPTNLInformation) + out.AdditionalULForwardingUPTNLInformation = gtpTunnelList(t.AdditionalULForwardingUPTNLInformation) + out.DataForwardingResponseERAB = dataForwardingResponseERABs(t.DataForwardingResponseERAB) + return out, nil } @@ -182,17 +208,52 @@ func libHandoverRequestAcknowledgeTransfer(raw ngap.TransferContainer) (any, err out.SecurityResult = &result } - for _, f := range t.QosFlowSetupResponse { + out.QosFlowSetupResponse = qosFlowsWithDataForwarding(t.QosFlowSetupResponse) + + for _, a := range t.AdditionalDLUPTNLInformationForHO { + out.AdditionalDLUPTNLInformationForHO = append(out.AdditionalDLUPTNLInformationForHO, AdditionalDLUPTNLInformationForHO{ + AdditionalDLNGUUPTNLInformation: libGTPTunnel(a.AdditionalDLNGUUPTNLInformation), + AdditionalQosFlowSetupResponse: qosFlowsWithDataForwarding(a.AdditionalQosFlowSetupResponse), + AdditionalDLForwardingUPTNLInformation: optionalGTPTunnel(a.AdditionalDLForwardingUPTNLInformation), + AdditionalRedundantDLNGUUPTNLInformation: optionalGTPTunnel(a.AdditionalRedundantDLNGUUPTNLInformation), + }) + } + + out.ULForwardingUPTNLInformation = optionalGTPTunnel(t.ULForwardingUPTNLInformation) + out.AdditionalULForwardingUPTNLInformation = gtpTunnelList(t.AdditionalULForwardingUPTNLInformation) + out.DataForwardingResponseERAB = dataForwardingResponseERABs(t.DataForwardingResponseERAB) + out.RedundantDLNGUUPTNLInformation = optionalGTPTunnel(t.RedundantDLNGUUPTNLInformation) + + return out, nil +} + +func qosFlowsWithDataForwarding(list ngap.QosFlowListWithDataForwarding) []QosFlowWithDataForwarding { + var out []QosFlowWithDataForwarding + + for _, f := range list { entry := QosFlowWithDataForwarding{QosFlowIdentifier: int64(f.QosFlowIdentifier)} if f.DataForwardingAccepted != nil { accepted := true entry.DataForwardingAccepted = &accepted } - out.QosFlowSetupResponse = append(out.QosFlowSetupResponse, entry) + out = append(out, entry) } - return out, nil + return out +} + +func dataForwardingResponseERABs(list ngap.DataForwardingResponseERABList) []DataForwardingResponseERAB { + var out []DataForwardingResponseERAB + + for _, e := range list { + out = append(out, DataForwardingResponseERAB{ + ERABID: uint8(e.ERABID), + DLForwardingUPTNLInformation: libGTPTunnel(e.DLForwardingUPTNLInformation), + }) + } + + return out } func libHandoverResourceAllocationUnsuccessfulTransfer(raw ngap.TransferContainer) (any, error) { diff --git a/internal/decoder/ngap/initial_context_setup_request.go b/internal/decoder/ngap/initial_context_setup_request.go index 5cd311bcd6..2aa0cd4b28 100644 --- a/internal/decoder/ngap/initial_context_setup_request.go +++ b/internal/decoder/ngap/initial_context_setup_request.go @@ -92,11 +92,13 @@ type PDUSessionResourceSetupRequestTransfer struct { SecurityIndication *SecurityIndication `json:"security_indication,omitempty"` // AdditionalULNGUUPTNLInformation carries the further uplink endpoints a // multi-homed or redundant session uses (TS 38.413 §9.3.1.1). - AdditionalULNGUUPTNLInformation []GTPTunnel `json:"additional_ul_ng_u_up_tnl_information,omitempty"` - DataForwardingNotPossible *bool `json:"data_forwarding_not_possible,omitempty"` - DirectForwardingPathAvailability *bool `json:"direct_forwarding_path_availability,omitempty"` - NetworkInstance *uint16 `json:"network_instance,omitempty"` - UnrecognizedIEs []IE `json:"unrecognized_ies,omitempty"` + AdditionalULNGUUPTNLInformation []GTPTunnel `json:"additional_ul_ng_u_up_tnl_information,omitempty"` + DataForwardingNotPossible *bool `json:"data_forwarding_not_possible,omitempty"` + DirectForwardingPathAvailability *bool `json:"direct_forwarding_path_availability,omitempty"` + NetworkInstance *uint16 `json:"network_instance,omitempty"` + RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` + AdditionalRedundantULNGUUPTNLInformation []GTPTunnel `json:"additional_redundant_ul_ng_u_up_tnl_information,omitempty"` + UnrecognizedIEs []IE `json:"unrecognized_ies,omitempty"` } type PDUSessionResourceSetupCxtReq struct { diff --git a/internal/decoder/ngap/path_switch.go b/internal/decoder/ngap/path_switch.go index c82e2d5b96..7089623edd 100644 --- a/internal/decoder/ngap/path_switch.go +++ b/internal/decoder/ngap/path_switch.go @@ -34,17 +34,24 @@ type UserPlaneSecurityInformation struct { // PathSwitchRequestTransferDecoded is the per-session transfer the target node // sends to move the downlink tunnel to itself (TS 38.413 §9.3.4.8). type PathSwitchRequestTransferDecoded struct { - DLNGUUPTNLInformation GTPTunnel `json:"dl_ng_u_up_tnl_information"` - DLNGUTNLInformationReused *bool `json:"dl_ng_u_tnl_information_reused,omitempty"` - UserPlaneSecurityInformation *UserPlaneSecurityInformation `json:"user_plane_security_information,omitempty"` - QosFlowAccepted []int64 `json:"qos_flow_accepted,omitempty"` + DLNGUUPTNLInformation GTPTunnel `json:"dl_ng_u_up_tnl_information"` + DLNGUTNLInformationReused *bool `json:"dl_ng_u_tnl_information_reused,omitempty"` + UserPlaneSecurityInformation *UserPlaneSecurityInformation `json:"user_plane_security_information,omitempty"` + QosFlowAccepted []int64 `json:"qos_flow_accepted,omitempty"` + AdditionalDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_dl_qos_flow_per_tnl_information,omitempty"` + RedundantDLNGUUPTNLInformation *GTPTunnel `json:"redundant_dl_ng_u_up_tnl_information,omitempty"` + RedundantDLNGUTNLInformationReused *bool `json:"redundant_dl_ng_u_tnl_information_reused,omitempty"` + AdditionalRedundantDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_redundant_dl_qos_flow_per_tnl_information,omitempty"` } // PathSwitchRequestAcknowledgeTransferDecoded is the transfer the AMF returns per // switched session (TS 38.413 §9.3.4.9). type PathSwitchRequestAcknowledgeTransferDecoded struct { - ULNGUUPTNLInformation *GTPTunnel `json:"ul_ng_u_up_tnl_information,omitempty"` - SecurityIndication *SecurityIndication `json:"security_indication,omitempty"` + ULNGUUPTNLInformation *GTPTunnel `json:"ul_ng_u_up_tnl_information,omitempty"` + SecurityIndication *SecurityIndication `json:"security_indication,omitempty"` + AdditionalNGUUPTNLInformation []ULNGUUPTNLModify `json:"additional_ng_u_up_tnl_information,omitempty"` + RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` + AdditionalRedundantNGUUPTNLInformation []ULNGUUPTNLModify `json:"additional_redundant_ng_u_up_tnl_information,omitempty"` } // CauseTransferDecoded is a transfer carrying only a cause, as the failed and @@ -98,6 +105,16 @@ func libPathSwitchRequestTransfer(raw ngap.TransferContainer) (*PathSwitchReques out.QosFlowAccepted = append(out.QosFlowAccepted, int64(flow.QosFlowIdentifier)) } + out.AdditionalDLQosFlowPerTNLInformation = qosFlowPerTNLInformationList(t.AdditionalDLQosFlowPerTNLInformation) + out.RedundantDLNGUUPTNLInformation = optionalGTPTunnel(t.RedundantDLNGUUPTNLInformation) + + if t.RedundantDLNGUTNLInformationReused != nil { + reused := *t.RedundantDLNGUTNLInformationReused == ngap.DLNGUTNLInformationReusedTrue + out.RedundantDLNGUTNLInformationReused = &reused + } + + out.AdditionalRedundantDLQosFlowPerTNLInformation = qosFlowPerTNLInformationList(t.AdditionalRedundantDLQosFlowPerTNLInformation) + return out, nil } @@ -114,6 +131,10 @@ func libPathSwitchRequestAcknowledgeTransfer(raw ngap.TransferContainer) (*PathS out.ULNGUUPTNLInformation = &tunnel } + out.AdditionalNGUUPTNLInformation = gtpTunnelPairs(t.AdditionalNGUUPTNLInformation) + out.RedundantULNGUUPTNLInformation = optionalGTPTunnel(t.RedundantULNGUUPTNLInformation) + out.AdditionalRedundantNGUUPTNLInformation = gtpTunnelPairs(t.AdditionalRedundantNGUUPTNLInformation) + return out, nil } diff --git a/internal/decoder/ngap/pdu_session_resource_modify.go b/internal/decoder/ngap/pdu_session_resource_modify.go index dad7eb05ee..01bb62bc5b 100644 --- a/internal/decoder/ngap/pdu_session_resource_modify.go +++ b/internal/decoder/ngap/pdu_session_resource_modify.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "fmt" + "github.com/ellanetworks/core/internal/decoder/utils" "github.com/ellanetworks/core/ngap" ) @@ -23,14 +24,28 @@ type QosFlowWithCause struct { type QosFlowAddOrModifyRequest struct { QosFlow *QosFlowSetupRequest `json:"qos_flow,omitempty"` - QosFlowIdentifier int64 `json:"qos_flow_identifier"` - ERABID *uint8 `json:"erab_id,omitempty"` + QosFlowIdentifier int64 `json:"qos_flow_identifier"` + ERABID *uint8 `json:"erab_id,omitempty"` + ULNGUUPTNLInformation *GTPTunnel `json:"ul_ng_u_up_tnl_information,omitempty"` +} + +type QosFlowAddOrModifyResponse struct { + QosFlowIdentifier int64 `json:"qos_flow_identifier"` + DLNGUUPTNLInformation *GTPTunnel `json:"dl_ng_u_up_tnl_information,omitempty"` +} + +type UserPlaneFailureIndication struct { + UserPlaneFailureType utils.EnumField `json:"user_plane_failure_type"` + ULNGUUPTNLInformation GTPTunnel `json:"ul_ng_u_up_tnl_information"` + DLNGUUPTNLInformation GTPTunnel `json:"dl_ng_u_up_tnl_information"` } // ULNGUUPTNLModify pairs the uplink and downlink endpoints a session moves to. type ULNGUUPTNLModify struct { - ULNGUUPTNLInformation GTPTunnel `json:"ul_ng_u_up_tnl_information"` - DLNGUUPTNLInformation GTPTunnel `json:"dl_ng_u_up_tnl_information"` + ULNGUUPTNLInformation GTPTunnel `json:"ul_ng_u_up_tnl_information"` + DLNGUUPTNLInformation GTPTunnel `json:"dl_ng_u_up_tnl_information"` + RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` + RedundantDLNGUUPTNLInformation *GTPTunnel `json:"redundant_dl_ng_u_up_tnl_information,omitempty"` } // QosFlowPerTNLInformation is a tunnel endpoint and the QoS flows carried on it @@ -43,38 +58,50 @@ type QosFlowPerTNLInformation struct { // PDUSessionResourceModifyRequestTransferDecoded is the per-session transfer the // AMF sends to change a session (TS 38.413 §9.3.4.3). type PDUSessionResourceModifyRequestTransferDecoded struct { - MaximumBitRate *MaximumBitRate `json:"maximum_bit_rate,omitempty"` - ULNGUUPTNLModify []ULNGUUPTNLModify `json:"ul_ng_u_up_tnl_modify,omitempty"` - NetworkInstance *uint16 `json:"network_instance,omitempty"` - QosFlowAddOrModifyRequest []QosFlowAddOrModifyRequest `json:"qos_flow_add_or_modify_request,omitempty"` - QosFlowToRelease []QosFlowWithCause `json:"qos_flow_to_release,omitempty"` - AdditionalULNGUUPTNLInformation []GTPTunnel `json:"additional_ul_ng_u_up_tnl_information,omitempty"` + MaximumBitRate *MaximumBitRate `json:"maximum_bit_rate,omitempty"` + ULNGUUPTNLModify []ULNGUUPTNLModify `json:"ul_ng_u_up_tnl_modify,omitempty"` + NetworkInstance *uint16 `json:"network_instance,omitempty"` + QosFlowAddOrModifyRequest []QosFlowAddOrModifyRequest `json:"qos_flow_add_or_modify_request,omitempty"` + QosFlowToRelease []QosFlowWithCause `json:"qos_flow_to_release,omitempty"` + AdditionalULNGUUPTNLInformation []GTPTunnel `json:"additional_ul_ng_u_up_tnl_information,omitempty"` + AdditionalRedundantULNGUUPTNLInformation []GTPTunnel `json:"additional_redundant_ul_ng_u_up_tnl_information,omitempty"` + RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` + UserPlaneFailureIndication *UserPlaneFailureIndication `json:"user_plane_failure_indication,omitempty"` } // PDUSessionResourceModifyResponseTransferDecoded is what the RAN reports back // per session (TS 38.413 §9.3.4.4). type PDUSessionResourceModifyResponseTransferDecoded struct { - DLNGUUPTNLInformation *GTPTunnel `json:"dl_ng_u_up_tnl_information,omitempty"` - ULNGUUPTNLInformation *GTPTunnel `json:"ul_ng_u_up_tnl_information,omitempty"` - QosFlowAddOrModifyResponse []int64 `json:"qos_flow_add_or_modify_response,omitempty"` - AdditionalDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_dl_qos_flow_per_tnl_information,omitempty"` - QosFlowFailedToAddOrModify []QosFlowWithCause `json:"qos_flow_failed_to_add_or_modify,omitempty"` + DLNGUUPTNLInformation *GTPTunnel `json:"dl_ng_u_up_tnl_information,omitempty"` + ULNGUUPTNLInformation *GTPTunnel `json:"ul_ng_u_up_tnl_information,omitempty"` + QosFlowAddOrModifyResponse []QosFlowAddOrModifyResponse `json:"qos_flow_add_or_modify_response,omitempty"` + AdditionalDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_dl_qos_flow_per_tnl_information,omitempty"` + QosFlowFailedToAddOrModify []QosFlowWithCause `json:"qos_flow_failed_to_add_or_modify,omitempty"` + AdditionalNGUUPTNLInformation []ULNGUUPTNLModify `json:"additional_ng_u_up_tnl_information,omitempty"` + RedundantDLNGUUPTNLInformation *GTPTunnel `json:"redundant_dl_ng_u_up_tnl_information,omitempty"` + RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` + AdditionalRedundantDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_redundant_dl_qos_flow_per_tnl_information,omitempty"` + AdditionalRedundantNGUUPTNLInformation []ULNGUUPTNLModify `json:"additional_redundant_ng_u_up_tnl_information,omitempty"` } // PDUSessionResourceModifyIndicationTransferDecoded is the RAN-initiated // indication's per-session transfer (TS 38.413 §9.3.4.6). type PDUSessionResourceModifyIndicationTransferDecoded struct { - DLQosFlowPerTNLInformation QosFlowPerTNLInformation `json:"dl_qos_flow_per_tnl_information"` - AdditionalDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_dl_qos_flow_per_tnl_information,omitempty"` + DLQosFlowPerTNLInformation QosFlowPerTNLInformation `json:"dl_qos_flow_per_tnl_information"` + AdditionalDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_dl_qos_flow_per_tnl_information,omitempty"` + RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `json:"redundant_dl_qos_flow_per_tnl_information,omitempty"` + AdditionalRedundantDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_redundant_dl_qos_flow_per_tnl_information,omitempty"` } // PDUSessionResourceModifyConfirmTransferDecoded is the AMF's confirmation of a // RAN-initiated modification (TS 38.413 §9.3.4.7). type PDUSessionResourceModifyConfirmTransferDecoded struct { - QosFlowModifyConfirm []int64 `json:"qos_flow_modify_confirm,omitempty"` - ULNGUUPTNLInformation GTPTunnel `json:"ul_ng_u_up_tnl_information"` - AdditionalNGUUPTNLInformation []ULNGUUPTNLModify `json:"additional_ng_u_up_tnl_information,omitempty"` - QosFlowFailedToModify []QosFlowWithCause `json:"qos_flow_failed_to_modify,omitempty"` + QosFlowModifyConfirm []int64 `json:"qos_flow_modify_confirm,omitempty"` + ULNGUUPTNLInformation GTPTunnel `json:"ul_ng_u_up_tnl_information"` + AdditionalNGUUPTNLInformation []ULNGUUPTNLModify `json:"additional_ng_u_up_tnl_information,omitempty"` + QosFlowFailedToModify []QosFlowWithCause `json:"qos_flow_failed_to_modify,omitempty"` + RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` + AdditionalRedundantNGUUPTNLInformation []ULNGUUPTNLModify `json:"additional_redundant_ng_u_up_tnl_information,omitempty"` } // ModifySession is one PDU session in a modify list: its id, and whichever @@ -82,6 +109,7 @@ type PDUSessionResourceModifyConfirmTransferDecoded struct { type ModifySession struct { PDUSessionID int64 `json:"pdu_session_id"` NASPDU *NASPDU `json:"nas_pdu,omitempty"` + SNSSAI *SNSSAI `json:"snssai,omitempty"` ModifyRequestTransfer *PDUSessionResourceModifyRequestTransferDecoded `json:"modify_request_transfer,omitempty"` ModifyResponseTransfer *PDUSessionResourceModifyResponseTransferDecoded `json:"modify_response_transfer,omitempty"` @@ -138,8 +166,10 @@ func libPDUSessionResourceModifyRequestTransfer(raw ngap.TransferContainer) (any for _, m := range t.ULNGUUPTNLModify { out.ULNGUUPTNLModify = append(out.ULNGUUPTNLModify, ULNGUUPTNLModify{ - ULNGUUPTNLInformation: libGTPTunnel(m.ULNGUUPTNLInformation), - DLNGUUPTNLInformation: libGTPTunnel(m.DLNGUUPTNLInformation), + ULNGUUPTNLInformation: libGTPTunnel(m.ULNGUUPTNLInformation), + DLNGUUPTNLInformation: libGTPTunnel(m.DLNGUUPTNLInformation), + RedundantULNGUUPTNLInformation: optionalGTPTunnel(m.RedundantULNGUUPTNLInformation), + RedundantDLNGUUPTNLInformation: optionalGTPTunnel(m.RedundantDLNGUUPTNLInformation), }) } @@ -164,6 +194,8 @@ func libPDUSessionResourceModifyRequestTransfer(raw ngap.TransferContainer) (any entry.ERABID = &id } + entry.ULNGUUPTNLInformation = optionalGTPTunnel(f.ULNGUUPTNLInformation) + out.QosFlowAddOrModifyRequest = append(out.QosFlowAddOrModifyRequest, entry) } @@ -173,6 +205,17 @@ func libPDUSessionResourceModifyRequestTransfer(raw ngap.TransferContainer) (any out.AdditionalULNGUUPTNLInformation = append(out.AdditionalULNGUUPTNLInformation, libGTPTunnel(item.NGUUPTNLInformation)) } + out.AdditionalRedundantULNGUUPTNLInformation = gtpTunnelList(t.AdditionalRedundantULNGUUPTNLInformation) + out.RedundantULNGUUPTNLInformation = optionalGTPTunnel(t.RedundantULNGUUPTNLInformation) + + if u := t.UserPlaneFailureIndication; u != nil { + out.UserPlaneFailureIndication = &UserPlaneFailureIndication{ + UserPlaneFailureType: utils.NamedEnum(uint8(u.UserPlaneFailureType), u.UserPlaneFailureType.Name()), + ULNGUUPTNLInformation: libGTPTunnel(u.ULNGUUPTNLInformation), + DLNGUUPTNLInformation: libGTPTunnel(u.DLNGUUPTNLInformation), + } + } + return out, nil } @@ -198,9 +241,18 @@ func libPDUSessionResourceModifyResponseTransfer(raw ngap.TransferContainer) (an } for _, f := range t.QosFlowAddOrModifyResponse { - out.QosFlowAddOrModifyResponse = append(out.QosFlowAddOrModifyResponse, int64(f.QosFlowIdentifier)) + out.QosFlowAddOrModifyResponse = append(out.QosFlowAddOrModifyResponse, QosFlowAddOrModifyResponse{ + QosFlowIdentifier: int64(f.QosFlowIdentifier), + DLNGUUPTNLInformation: optionalGTPTunnel(f.DLNGUUPTNLInformation), + }) } + out.AdditionalNGUUPTNLInformation = gtpTunnelPairs(t.AdditionalNGUUPTNLInformation) + out.RedundantDLNGUUPTNLInformation = optionalGTPTunnel(t.RedundantDLNGUUPTNLInformation) + out.RedundantULNGUUPTNLInformation = optionalGTPTunnel(t.RedundantULNGUUPTNLInformation) + out.AdditionalRedundantDLQosFlowPerTNLInformation = qosFlowPerTNLInformationList(t.AdditionalRedundantDLQosFlowPerTNLInformation) + out.AdditionalRedundantNGUUPTNLInformation = gtpTunnelPairs(t.AdditionalRedundantNGUUPTNLInformation) + return out, nil } @@ -210,10 +262,18 @@ func libPDUSessionResourceModifyIndicationTransfer(raw ngap.TransferContainer) ( return nil, err } - return &PDUSessionResourceModifyIndicationTransferDecoded{ - DLQosFlowPerTNLInformation: qosFlowPerTNLInformation(t.DLQosFlowPerTNLInformation), - AdditionalDLQosFlowPerTNLInformation: qosFlowPerTNLInformationList(t.AdditionalDLQosFlowPerTNLInformation), - }, nil + out := &PDUSessionResourceModifyIndicationTransferDecoded{ + DLQosFlowPerTNLInformation: qosFlowPerTNLInformation(t.DLQosFlowPerTNLInformation), + AdditionalDLQosFlowPerTNLInformation: qosFlowPerTNLInformationList(t.AdditionalDLQosFlowPerTNLInformation), + AdditionalRedundantDLQosFlowPerTNLInformation: qosFlowPerTNLInformationList(t.AdditionalRedundantDLQosFlowPerTNLInformation), + } + + if t.RedundantDLQosFlowPerTNLInformation != nil { + q := qosFlowPerTNLInformation(*t.RedundantDLQosFlowPerTNLInformation) + out.RedundantDLQosFlowPerTNLInformation = &q + } + + return out, nil } func libPDUSessionResourceModifyConfirmTransfer(raw ngap.TransferContainer) (any, error) { @@ -231,12 +291,9 @@ func libPDUSessionResourceModifyConfirmTransfer(raw ngap.TransferContainer) (any out.QosFlowModifyConfirm = append(out.QosFlowModifyConfirm, int64(f.QosFlowIdentifier)) } - for _, p := range t.AdditionalNGUUPTNLInformation { - out.AdditionalNGUUPTNLInformation = append(out.AdditionalNGUUPTNLInformation, ULNGUUPTNLModify{ - ULNGUUPTNLInformation: libGTPTunnel(p.ULNGUUPTNLInformation), - DLNGUUPTNLInformation: libGTPTunnel(p.DLNGUUPTNLInformation), - }) - } + out.AdditionalNGUUPTNLInformation = gtpTunnelPairs(t.AdditionalNGUUPTNLInformation) + out.RedundantULNGUUPTNLInformation = optionalGTPTunnel(t.RedundantULNGUUPTNLInformation) + out.AdditionalRedundantNGUUPTNLInformation = gtpTunnelPairs(t.AdditionalRedundantNGUUPTNLInformation) return out, nil } @@ -300,6 +357,11 @@ func buildPDUSessionResourceModifyRequest(value []byte) NGAPMessageValue { s.NASPDU = &pdu } + if it.SNSSAI != nil { + snssai := buildSNSSAIValue(*it.SNSSAI) + s.SNSSAI = &snssai + } + sessions = append(sessions, s) } diff --git a/internal/decoder/ngap/pdu_session_resource_setup_response.go b/internal/decoder/ngap/pdu_session_resource_setup_response.go index 3ef27be2cc..1f21f2754a 100644 --- a/internal/decoder/ngap/pdu_session_resource_setup_response.go +++ b/internal/decoder/ngap/pdu_session_resource_setup_response.go @@ -24,8 +24,12 @@ type QosFlowFailedToSetupItem struct { } type PDUSessionResourceSetupResponseTransferDecoded struct { - DLQosFlowPerTNLInformation DLQosFlowPerTNLInformation `json:"dl_qos_flow_per_tnl_information"` - QosFlowFailedToSetupList []QosFlowFailedToSetupItem `json:"qos_flow_failed_to_setup_list,omitempty"` + DLQosFlowPerTNLInformation DLQosFlowPerTNLInformation `json:"dl_qos_flow_per_tnl_information"` + AdditionalDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_dl_qos_flow_per_tnl_information,omitempty"` + SecurityResult *SecurityResult `json:"security_result,omitempty"` + QosFlowFailedToSetupList []QosFlowFailedToSetupItem `json:"qos_flow_failed_to_setup_list,omitempty"` + RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `json:"redundant_dl_qos_flow_per_tnl_information,omitempty"` + AdditionalRedundantDLQosFlowPerTNLInformation []QosFlowPerTNLInformation `json:"additional_redundant_dl_qos_flow_per_tnl_information,omitempty"` } type PDUSessionResourceSetupUnsuccessfulTransferDecoded struct { @@ -138,6 +142,20 @@ func libSetupResponseTransfer(t *ngap.PDUSessionResourceSetupResponseTransfer) * }) } + out.AdditionalDLQosFlowPerTNLInformation = qosFlowPerTNLInformationList(t.AdditionalDLQosFlowPerTNLInformation) + + if t.SecurityResult != nil { + result := securityResult(*t.SecurityResult) + out.SecurityResult = &result + } + + if t.RedundantDLQosFlowPerTNLInformation != nil { + q := qosFlowPerTNLInformation(*t.RedundantDLQosFlowPerTNLInformation) + out.RedundantDLQosFlowPerTNLInformation = &q + } + + out.AdditionalRedundantDLQosFlowPerTNLInformation = qosFlowPerTNLInformationList(t.AdditionalRedundantDLQosFlowPerTNLInformation) + return out } @@ -149,3 +167,36 @@ func libGTPTunnel(u ngap.UPTransportLayerInformation) GTPTunnel { TransportLayerAddress: transportLayerAddressToString(u.GTPTunnel.TransportLayerAddress), } } + +func optionalGTPTunnel(u *ngap.UPTransportLayerInformation) *GTPTunnel { + if u == nil { + return nil + } + + tunnel := libGTPTunnel(*u) + + return &tunnel +} + +func gtpTunnelList(list ngap.UPTransportLayerInformationList) []GTPTunnel { + var out []GTPTunnel + + for _, item := range list { + out = append(out, libGTPTunnel(item.NGUUPTNLInformation)) + } + + return out +} + +func gtpTunnelPairs(list ngap.UPTransportLayerInformationPairList) []ULNGUUPTNLModify { + var out []ULNGUUPTNLModify + + for _, p := range list { + out = append(out, ULNGUUPTNLModify{ + ULNGUUPTNLInformation: libGTPTunnel(p.ULNGUUPTNLInformation), + DLNGUUPTNLInformation: libGTPTunnel(p.DLNGUUPTNLInformation), + }) + } + + return out +} diff --git a/internal/decoder/ngap/pdu_session_transfer.go b/internal/decoder/ngap/pdu_session_transfer.go index 3f69de189f..701e7c026d 100644 --- a/internal/decoder/ngap/pdu_session_transfer.go +++ b/internal/decoder/ngap/pdu_session_transfer.go @@ -56,6 +56,8 @@ func libPDUSessionResourceSetupRequestTransfer(raw ngap.TransferContainer) (*PDU } out.SecurityIndication = securityIndication(t.SecurityIndication) + out.RedundantULNGUUPTNLInformation = optionalGTPTunnel(t.RedundantULNGUUPTNLInformation) + out.AdditionalRedundantULNGUUPTNLInformation = gtpTunnelList(t.AdditionalRedundantULNGUUPTNLInformation) out.UnrecognizedIEs = unmodeledIEs(t.UnknownIEs()) diff --git a/internal/decoder/ngap/testdata/golden/pdu_session_resource_modify_response_full.json b/internal/decoder/ngap/testdata/golden/pdu_session_resource_modify_response_full.json index 12b1ac127b..12b04c27bf 100644 --- a/internal/decoder/ngap/testdata/golden/pdu_session_resource_modify_response_full.json +++ b/internal/decoder/ngap/testdata/golden/pdu_session_resource_modify_response_full.json @@ -67,7 +67,9 @@ "transport_layer_address": "10.45.0.1" }, "qos_flow_add_or_modify_response": [ - 1 + { + "qos_flow_identifier": 1 + } ], "qos_flow_failed_to_add_or_modify": [ { diff --git a/internal/decoder/ngap/tnl_extensions_test.go b/internal/decoder/ngap/tnl_extensions_test.go new file mode 100644 index 0000000000..b8cb2b67e3 --- /dev/null +++ b/internal/decoder/ngap/tnl_extensions_test.go @@ -0,0 +1,315 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/json" + "fmt" + "strings" + "testing" + + lib "github.com/ellanetworks/core/ngap" +) + +func tunnel(teid uint32) lib.UPTransportLayerInformation { + return lib.UPTransportLayerInformation{GTPTunnel: lib.GTPTunnel{ + TransportLayerAddress: lib.TransportLayerAddress{10, 0, 0, 1}, + GTPTEID: lib.GTPTEID(teid), + }} +} + +func tunnelPtr(teid uint32) *lib.UPTransportLayerInformation { + u := tunnel(teid) + return &u +} + +func flowTunnel(teid uint32) lib.QosFlowPerTNLInformation { + return lib.QosFlowPerTNLInformation{UPTransportLayerInformation: tunnel(teid), AssociatedQosFlowList: lib.AssociatedQosFlowList{{QosFlowIdentifier: 1}}} +} + +func flowTunnels(teid uint32) lib.QosFlowPerTNLInformationList { + return lib.QosFlowPerTNLInformationList{{QosFlowPerTNLInformation: flowTunnel(teid)}} +} + +func tunnels(teid uint32) lib.UPTransportLayerInformationList { + return lib.UPTransportLayerInformationList{{NGUUPTNLInformation: tunnel(teid)}} +} + +func tunnelPairs(ul, dl uint32) lib.UPTransportLayerInformationPairList { + return lib.UPTransportLayerInformationPairList{{ULNGUUPTNLInformation: tunnel(ul), DLNGUUPTNLInformation: tunnel(dl)}} +} + +func mustTransfer(t *testing.T, m interface { + Marshal() (lib.TransferContainer, error) +}, +) lib.TransferContainer { + t.Helper() + + b, err := m.Marshal() + if err != nil { + t.Fatal(err) + } + + return b +} + +type tnlRenderCase struct { + name string + raw []byte + keys []string + teids []uint32 +} + +func tnlRenderCases(t *testing.T) []tnlRenderCase { + t.Helper() + + redundantFlow := flowTunnel(0x203) + + setupReq := mustTransfer(t, &lib.PDUSessionResourceSetupRequestTransfer{ + ULNGUUPTNLInformation: tunnel(0x101), + PDUSessionType: lib.PDUSessionTypeIPv4, + QosFlowSetupRequest: lib.QosFlowSetupRequestList{{ + QosFlowIdentifier: 1, + QosFlowLevelQosParameters: lib.QosFlowLevelQosParameters{ + QosCharacteristics: lib.QosCharacteristics{Kind: lib.QosCharacteristicsNonDynamic5QI, NonDynamic5QI: lib.NonDynamic5QIDescriptor{FiveQI: 9}}, + AllocationAndRetentionPriority: lib.AllocationAndRetentionPriority{PriorityLevelARP: 8}, + }, + }}, + RedundantULNGUUPTNLInformation: tunnelPtr(0x102), + AdditionalRedundantULNGUUPTNLInformation: tunnels(0x103), + }) + + setupRes := mustTransfer(t, &lib.PDUSessionResourceSetupResponseTransfer{ + DLQosFlowPerTNLInformation: flowTunnel(0x201), + AdditionalDLQosFlowPerTNLInformation: flowTunnels(0x202), + RedundantDLQosFlowPerTNLInformation: &redundantFlow, + AdditionalRedundantDLQosFlowPerTNLInformation: flowTunnels(0x204), + }) + + modReq := mustTransfer(t, &lib.PDUSessionResourceModifyRequestTransfer{ + ULNGUUPTNLModify: lib.ULNGUUPTNLModifyList{{ + ULNGUUPTNLInformation: tunnel(0x301), + DLNGUUPTNLInformation: tunnel(0x302), + RedundantULNGUUPTNLInformation: tunnelPtr(0x303), + RedundantDLNGUUPTNLInformation: tunnelPtr(0x304), + }}, + QosFlowAddOrModifyRequest: lib.QosFlowAddOrModifyRequestList{{QosFlowIdentifier: 1, ULNGUUPTNLInformation: tunnelPtr(0x305)}}, + AdditionalRedundantULNGUUPTNLInformation: tunnels(0x306), + RedundantULNGUUPTNLInformation: tunnelPtr(0x307), + UserPlaneFailureIndication: &lib.UserPlaneFailureIndication{ + UserPlaneFailureType: lib.UserPlaneFailureTypeUPPathFailure, + ULNGUUPTNLInformation: tunnel(0x308), + DLNGUUPTNLInformation: tunnel(0x309), + }, + }) + + modRes := mustTransfer(t, &lib.PDUSessionResourceModifyResponseTransfer{ + QosFlowAddOrModifyResponse: lib.QosFlowAddOrModifyResponseList{{QosFlowIdentifier: 1, DLNGUUPTNLInformation: tunnelPtr(0x401)}}, + AdditionalNGUUPTNLInformation: tunnelPairs(0x402, 0x403), + RedundantDLNGUUPTNLInformation: tunnelPtr(0x404), + RedundantULNGUUPTNLInformation: tunnelPtr(0x405), + AdditionalRedundantDLQosFlowPerTNLInformation: flowTunnels(0x406), + AdditionalRedundantNGUUPTNLInformation: tunnelPairs(0x407, 0x408), + }) + + redundantInd := flowTunnel(0x502) + + modInd := mustTransfer(t, &lib.PDUSessionResourceModifyIndicationTransfer{ + DLQosFlowPerTNLInformation: flowTunnel(0x501), + RedundantDLQosFlowPerTNLInformation: &redundantInd, + AdditionalRedundantDLQosFlowPerTNLInformation: flowTunnels(0x503), + }) + + modCfm := mustTransfer(t, &lib.PDUSessionResourceModifyConfirmTransfer{ + QosFlowModifyConfirm: lib.QosFlowModifyConfirmList{{QosFlowIdentifier: 1}}, + ULNGUUPTNLInformation: tunnel(0x601), + RedundantULNGUUPTNLInformation: tunnelPtr(0x602), + AdditionalRedundantNGUUPTNLInformation: tunnelPairs(0x603, 0x604), + }) + + psReq := mustTransfer(t, &lib.PathSwitchRequestTransfer{ + DLNGUUPTNLInformation: tunnel(0x701), + QosFlowAccepted: lib.QosFlowAcceptedList{{QosFlowIdentifier: 1}}, + AdditionalDLQosFlowPerTNLInformation: flowTunnels(0x702), + RedundantDLNGUUPTNLInformation: tunnelPtr(0x703), + RedundantDLNGUTNLInformationReused: lib.Ptr(lib.DLNGUTNLInformationReusedTrue), + AdditionalRedundantDLQosFlowPerTNLInformation: flowTunnels(0x704), + }) + + psAck := mustTransfer(t, &lib.PathSwitchRequestAcknowledgeTransfer{ + AdditionalNGUUPTNLInformation: tunnelPairs(0x801, 0x802), + RedundantULNGUUPTNLInformation: tunnelPtr(0x803), + AdditionalRedundantNGUUPTNLInformation: tunnelPairs(0x804, 0x805), + }) + + hoAck := mustTransfer(t, &lib.HandoverRequestAcknowledgeTransfer{ + DLNGUUPTNLInformation: tunnel(0x901), + QosFlowSetupResponse: lib.QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, + AdditionalDLUPTNLInformationForHO: lib.AdditionalDLUPTNLInformationForHOList{{ + AdditionalDLNGUUPTNLInformation: tunnel(0x902), + AdditionalQosFlowSetupResponse: lib.QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, + AdditionalDLForwardingUPTNLInformation: tunnelPtr(0x903), + AdditionalRedundantDLNGUUPTNLInformation: tunnelPtr(0x904), + }}, + ULForwardingUPTNLInformation: tunnelPtr(0x905), + AdditionalULForwardingUPTNLInformation: tunnels(0x906), + DataForwardingResponseERAB: lib.DataForwardingResponseERABList{{ERABID: 5, DLForwardingUPTNLInformation: tunnel(0x907)}}, + RedundantDLNGUUPTNLInformation: tunnelPtr(0x908), + }) + + hoCmd := mustTransfer(t, &lib.HandoverCommandTransfer{ + AdditionalDLForwardingUPTNLInformation: flowTunnels(0xa01), + ULForwardingUPTNLInformation: tunnelPtr(0xa02), + AdditionalULForwardingUPTNLInformation: tunnels(0xa03), + DataForwardingResponseERAB: lib.DataForwardingResponseERABList{{ERABID: 5, DLForwardingUPTNLInformation: tunnel(0xa04)}}, + }) + + return []tnlRenderCase{ + { + name: "setup_request", + raw: mustMarshal(t, &lib.PDUSessionResourceSetupRequest{ + AMFUENGAPID: 1, RANUENGAPID: 2, + PDUSessionResourceSetup: lib.PDUSessionResourceSetupListSUReq{{PDUSessionID: 5, SNSSAI: lib.SNSSAI{SST: 1}, Transfer: setupReq}}, + }), + keys: []string{"redundant_ul_ng_u_up_tnl_information", "additional_redundant_ul_ng_u_up_tnl_information"}, + teids: []uint32{0x101, 0x102, 0x103}, + }, + { + name: "setup_response", + raw: mustMarshal(t, &lib.PDUSessionResourceSetupResponse{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), + PDUSessionResourceSetup: lib.PDUSessionResourceSetupListSURes{{PDUSessionID: 5, Transfer: setupRes}}, + }), + keys: []string{"additional_dl_qos_flow_per_tnl_information", "redundant_dl_qos_flow_per_tnl_information", "additional_redundant_dl_qos_flow_per_tnl_information"}, + teids: []uint32{0x201, 0x202, 0x203, 0x204}, + }, + { + name: "modify_request", + raw: mustMarshal(t, &lib.PDUSessionResourceModifyRequest{ + AMFUENGAPID: 1, RANUENGAPID: 2, + PDUSessionResourceModify: lib.PDUSessionResourceModifyListModReq{{PDUSessionID: 5, Transfer: modReq, SNSSAI: &lib.SNSSAI{SST: 1}}}, + }), + keys: []string{ + "snssai", + "redundant_ul_ng_u_up_tnl_information", "redundant_dl_ng_u_up_tnl_information", + "additional_redundant_ul_ng_u_up_tnl_information", "user_plane_failure_indication", "up-path-failure", + }, + teids: []uint32{0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, 0x308, 0x309}, + }, + { + name: "modify_response", + raw: mustMarshal(t, &lib.PDUSessionResourceModifyResponse{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), + PDUSessionResourceModify: lib.PDUSessionResourceModifyListModRes{{PDUSessionID: 5, Transfer: modRes}}, + }), + keys: []string{ + "additional_ng_u_up_tnl_information", "redundant_dl_ng_u_up_tnl_information", "redundant_ul_ng_u_up_tnl_information", + "additional_redundant_dl_qos_flow_per_tnl_information", "additional_redundant_ng_u_up_tnl_information", + }, + teids: []uint32{0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408}, + }, + { + name: "modify_indication", + raw: mustMarshal(t, &lib.PDUSessionResourceModifyIndication{ + AMFUENGAPID: 1, RANUENGAPID: 2, + PDUSessionResourceModify: lib.PDUSessionResourceModifyListModInd{{PDUSessionID: 5, Transfer: modInd}}, + }), + keys: []string{"redundant_dl_qos_flow_per_tnl_information", "additional_redundant_dl_qos_flow_per_tnl_information"}, + teids: []uint32{0x501, 0x502, 0x503}, + }, + { + name: "modify_confirm", + raw: mustMarshal(t, &lib.PDUSessionResourceModifyConfirm{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), + PDUSessionResourceModify: lib.PDUSessionResourceModifyListModCfm{{PDUSessionID: 5, Transfer: modCfm}}, + }), + keys: []string{"redundant_ul_ng_u_up_tnl_information", "additional_redundant_ng_u_up_tnl_information"}, + teids: []uint32{0x601, 0x602, 0x603, 0x604}, + }, + { + name: "path_switch_request", + raw: mustMarshal(t, &lib.PathSwitchRequest{ + RANUENGAPID: 2, SourceAMFUENGAPID: 1, + UserLocationInformation: &lib.UserLocationInformation{Kind: lib.UserLocationNR, PLMNIdentity: testPLMN, TAI: testTAI}, + UESecurityCapabilities: &lib.UESecurityCapabilities{}, + PDUSessionResourceToBeSwitchedDLList: lib.PDUSessionResourceToBeSwitchedDLList{{PDUSessionID: 5, Transfer: psReq}}, + }), + keys: []string{ + "additional_dl_qos_flow_per_tnl_information", "redundant_dl_ng_u_up_tnl_information", + "redundant_dl_ng_u_tnl_information_reused", "additional_redundant_dl_qos_flow_per_tnl_information", + }, + teids: []uint32{0x701, 0x702, 0x703, 0x704}, + }, + { + name: "path_switch_request_acknowledge", + raw: mustMarshal(t, &lib.PathSwitchRequestAcknowledge{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), + PDUSessionResourceSwitchedList: lib.PDUSessionResourceSwitchedList{{PDUSessionID: 5, Transfer: psAck}}, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + }), + keys: []string{"additional_ng_u_up_tnl_information", "redundant_ul_ng_u_up_tnl_information", "additional_redundant_ng_u_up_tnl_information"}, + teids: []uint32{0x801, 0x802, 0x803, 0x804, 0x805}, + }, + { + name: "handover_request_acknowledge", + raw: mustMarshal(t, &lib.HandoverRequestAcknowledge{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), + PDUSessionResourceAdmittedList: lib.PDUSessionResourceAdmittedList{{PDUSessionID: 5, Transfer: hoAck}}, + TargetToSourceTransparentContainer: lib.TargetToSourceTransparentContainer{0x00, 0x00}, + }), + keys: []string{ + "additional_dl_up_tnl_information_for_ho", "additional_redundant_dl_ng_u_up_tnl_information", "ul_forwarding_up_tnl_information", + "additional_ul_forwarding_up_tnl_information", "data_forwarding_response_erab", "redundant_dl_ng_u_up_tnl_information", + }, + teids: []uint32{0x901, 0x902, 0x903, 0x904, 0x905, 0x906, 0x907, 0x908}, + }, + { + name: "handover_command", + raw: mustMarshal(t, &lib.HandoverCommand{ + AMFUENGAPID: 1, RANUENGAPID: 2, HandoverType: lib.HandoverTypeIntra5GS, + PDUSessionResourceHandoverList: lib.PDUSessionResourceHandoverList{{PDUSessionID: 5, Transfer: hoCmd}}, + TargetToSourceTransparentContainer: lib.TargetToSourceTransparentContainer{0x00, 0x00}, + }), + keys: []string{ + "additional_dl_forwarding_up_tnl_information", "ul_forwarding_up_tnl_information", + "additional_ul_forwarding_up_tnl_information", "data_forwarding_response_erab", + }, + teids: []uint32{0xa01, 0xa02, 0xa03, 0xa04}, + }, + } +} + +func TestDecodeNGAPMessage_TNLExtensions(t *testing.T) { + for _, c := range tnlRenderCases(t) { + t.Run(c.name, func(t *testing.T) { + msg := DecodeNGAPMessage(c.raw) + if msg.Value.Error != "" { + t.Fatalf("decode error: %s", msg.Value.Error) + } + + out, err := json.Marshal(msg) + if err != nil { + t.Fatal(err) + } + + s := string(out) + + if strings.Contains(s, `"error"`) || strings.Contains(s, "transfer_hex") { + t.Fatalf("a transfer did not decode: %s", s) + } + + for _, k := range c.keys { + if !strings.Contains(s, k) { + t.Errorf("rendering lacks %q: %s", k, s) + } + } + + for _, teid := range c.teids { + if !strings.Contains(s, fmt.Sprintf(`"gtp_teid":%d,`, teid)) { + t.Errorf("rendering lacks GTP-TEID %#x: %s", teid, s) + } + } + }) + } +} diff --git a/internal/decoder/s1ap/erab_extensions.go b/internal/decoder/s1ap/erab_extensions.go new file mode 100644 index 0000000000..dc27f3728d --- /dev/null +++ b/internal/decoder/s1ap/erab_extensions.go @@ -0,0 +1,89 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/s1ap" +) + +type ERABQoSExtensions struct { + DownlinkPacketLossRate *uint16 `json:"downlink_packet_loss_rate,omitempty"` + UplinkPacketLossRate *uint16 `json:"uplink_packet_loss_rate,omitempty"` +} + +type ERABSetupExtensions struct { + CorrelationID string `json:"correlation_id,omitempty"` + SIPTOCorrelationID string `json:"sipto_correlation_id,omitempty"` + BearerType *utils.EnumField `json:"bearer_type,omitempty"` + EthernetType *utils.EnumField `json:"ethernet_type,omitempty"` + IntegrityProtectionIndication *utils.EnumField `json:"integrity_protection_indication,omitempty"` + DataForwardingNotPossible *bool `json:"data_forwarding_not_possible,omitempty"` +} + +func qosExtensions(q s1ap.ERABLevelQoSParameters) ERABQoSExtensions { + var out ERABQoSExtensions + + if q.DownlinkPacketLossRate != nil { + v := uint16(*q.DownlinkPacketLossRate) + out.DownlinkPacketLossRate = &v + } + + if q.UplinkPacketLossRate != nil { + v := uint16(*q.UplinkPacketLossRate) + out.UplinkPacketLossRate = &v + } + + return out +} + +func correlationID(c *s1ap.CorrelationID) string { + if c == nil { + return "" + } + + return hex.EncodeToString(c[:]) +} + +func integrityProtectionIndication(s *s1ap.SecurityIndication) *utils.EnumField { + if s == nil { + return nil + } + + v := utils.NamedEnum(uint8(s.IntegrityProtectionIndication), s.IntegrityProtectionIndication.Name()) + + return &v +} + +func setupExtensions(c, sipto *s1ap.CorrelationID, bearer *s1ap.BearerType, ethernet *s1ap.EthernetType, sec *s1ap.SecurityIndication) ERABSetupExtensions { + out := ERABSetupExtensions{ + CorrelationID: correlationID(c), + SIPTOCorrelationID: correlationID(sipto), + IntegrityProtectionIndication: integrityProtectionIndication(sec), + } + + if bearer != nil { + v := utils.NamedEnum(uint8(*bearer), bearer.Name()) + out.BearerType = &v + } + + if ethernet != nil { + v := utils.NamedEnum(uint8(*ethernet), ethernet.Name()) + out.EthernetType = &v + } + + return out +} + +func extendedBitRate(b *s1ap.ExtendedBitRate) *uint64 { + if b == nil { + return nil + } + + v := uint64(*b) + + return &v +} diff --git a/internal/decoder/s1ap/erab_extensions_test.go b/internal/decoder/s1ap/erab_extensions_test.go new file mode 100644 index 0000000000..8b60ec87a6 --- /dev/null +++ b/internal/decoder/s1ap/erab_extensions_test.go @@ -0,0 +1,134 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/json" + "strings" + "testing" + + "github.com/ellanetworks/core/s1ap" +) + +func knownExtensionQoS() s1ap.ERABLevelQoSParameters { + return s1ap.ERABLevelQoSParameters{ + QCI: 1, + ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 2}, + GBR: &s1ap.GBRQosInformation{ + MaximumBitrateDL: 1, MaximumBitrateUL: 1, GuaranteedBitrateDL: 1, GuaranteedBitrateUL: 1, + ExtendedMaximumBitrateDL: s1ap.Ptr(s1ap.ExtendedBitRate(10000000001)), + ExtendedMaximumBitrateUL: s1ap.Ptr(s1ap.ExtendedBitRate(10000000002)), + ExtendedGuaranteedBitrateDL: s1ap.Ptr(s1ap.ExtendedBitRate(10000000003)), + ExtendedGuaranteedBitrateUL: s1ap.Ptr(s1ap.ExtendedBitRate(10000000004)), + }, + DownlinkPacketLossRate: s1ap.Ptr(s1ap.PacketLossRate(10)), + UplinkPacketLossRate: s1ap.Ptr(s1ap.PacketLossRate(20)), + } +} + +func TestDecodeS1APMessage_KnownERABExtensions(t *testing.T) { + sec := &s1ap.SecurityIndication{IntegrityProtectionIndication: s1ap.IntegrityProtectionPreferred} + tla := s1ap.TransportLayerAddress{10, 0, 0, 1} + qosKeys := []string{ + `"downlink_packet_loss_rate":10`, `"uplink_packet_loss_rate":20`, + `"extended_maximum_bitrate_dl":10000000001`, `"extended_maximum_bitrate_ul":10000000002`, + `"extended_guaranteed_bitrate_dl":10000000003`, `"extended_guaranteed_bitrate_ul":10000000004`, + } + setupKeys := []string{`"bearer_type"`, `"non-IP"`, `"ethernet_type"`, `"integrity_protection_indication"`, `"preferred"`} + + for _, c := range []struct { + name string + raw []byte + want []string + }{ + { + name: "initial_context_setup_request", + raw: mustMarshal(t, &s1ap.InitialContextSetupRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + ERABToBeSetup: s1ap.ERABToBeSetupListCtxtSUReq{{ + ERABID: 5, QoS: knownExtensionQoS(), TransportLayerAddress: tla, GTPTEID: 1, + CorrelationID: &s1ap.CorrelationID{1, 2, 3, 4}, SIPTOCorrelationID: &s1ap.CorrelationID{5, 6, 7, 8}, + BearerType: s1ap.Ptr(s1ap.BearerTypeNonIP), EthernetType: s1ap.Ptr(s1ap.EthernetTypeTrue), SecurityIndication: sec, + }}, + }), + want: append(append([]string{`"correlation_id":"01020304"`, `"sipto_correlation_id":"05060708"`}, setupKeys...), qosKeys...), + }, + { + name: "erab_setup_request", + raw: mustMarshal(t, &s1ap.ERABSetupRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + ERABToBeSetup: s1ap.ERABToBeSetupListBearerSUReq{{ + ERABID: 6, QoS: knownExtensionQoS(), TransportLayerAddress: tla, GTPTEID: 2, NASPDU: s1ap.NASPDU{0x27}, + CorrelationID: &s1ap.CorrelationID{1, 2, 3, 4}, SIPTOCorrelationID: &s1ap.CorrelationID{5, 6, 7, 8}, + BearerType: s1ap.Ptr(s1ap.BearerTypeNonIP), EthernetType: s1ap.Ptr(s1ap.EthernetTypeTrue), SecurityIndication: sec, + }}, + }), + want: append(append([]string{`"correlation_id":"01020304"`, `"sipto_correlation_id":"05060708"`}, setupKeys...), qosKeys...), + }, + { + name: "erab_modify_request", + raw: mustMarshal(t, &s1ap.ERABModifyRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + ERABToBeModified: s1ap.ERABToBeModifiedListBearerModReq{{ + ERABID: 5, QoS: knownExtensionQoS(), NASPDU: s1ap.NASPDU{0x07}, + }}, + }), + want: qosKeys, + }, + { + name: "handover_request", + raw: mustMarshal(t, &s1ap.HandoverRequest{ + MMEUES1APID: 1, + HandoverType: s1ap.HandoverTypeUTRANtoLTE, + Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, + SourceToTarget: testSourceeNBContainer(t), + + NASSecurityParameterstoEUTRAN: s1ap.NASSecurityParameterstoEUTRAN{0x0a, 0x0b}, + ERABToBeSetup: s1ap.ERABToBeSetupListHOReq{{ + ERABID: 5, TransportLayerAddress: tla, GTPTEID: 1, QoS: knownExtensionQoS(), + Extensions: &s1ap.ERABToBeSetupItemHOReqExtIEs{ + DataForwardingNotPossible: s1ap.Ptr(s1ap.DataForwardingNotPossibleTrue), + BearerType: s1ap.Ptr(s1ap.BearerTypeNonIP), + EthernetType: s1ap.Ptr(s1ap.EthernetTypeTrue), + SecurityIndication: sec, + }, + }}, + }), + want: append(append([]string{`"data_forwarding_not_possible":true`}, setupKeys...), qosKeys...), + }, + { + name: "path_switch_request", + raw: mustMarshal(t, &s1ap.PathSwitchRequest{ + ENBUES1APID: 2, + ERABToBeSwitchedDL: s1ap.ERABToBeSwitchedDLList{{ERABID: 5, TransportLayerAddress: tla, GTPTEID: 1, SecurityIndication: sec}}, + SourceMMEUES1APID: 1, + EUTRANCGI: &s1ap.EUTRANCGI{PLMNIdentity: testPLMN, CellID: 1}, + TAI: &s1ap.TAI{PLMNIdentity: testPLMN, TAC: 1}, + UESecurityCapabilities: &s1ap.UESecurityCapabilities{}, + }), + want: []string{`"integrity_protection_indication"`, `"preferred"`}, + }, + } { + t.Run(c.name, func(t *testing.T) { + msg := DecodeS1APMessage(c.raw) + if msg.Value.Error != "" { + t.Fatalf("decode error: %s", msg.Value.Error) + } + + out, err := json.Marshal(msg) + if err != nil { + t.Fatal(err) + } + + for _, w := range c.want { + if !strings.Contains(string(out), w) { + t.Errorf("rendering lacks %s: %s", w, out) + } + } + }) + } +} diff --git a/internal/decoder/s1ap/erab_modify.go b/internal/decoder/s1ap/erab_modify.go index f7c7f097c6..bd6ebc2e75 100644 --- a/internal/decoder/s1ap/erab_modify.go +++ b/internal/decoder/s1ap/erab_modify.go @@ -12,10 +12,19 @@ import ( // ERABToBeModified is an E-RAB whose QoS the MME asks the eNB to change, with // the NAS message that tells the UE about it (TS 36.413 §9.1.3.3). type ERABToBeModified struct { - ERABID uint8 `json:"erab_id"` - QCI uint8 `json:"qci"` - ARP ARP `json:"arp"` - NASPDU NASPDU `json:"nas_pdu"` + ERABID uint8 `json:"erab_id"` + QCI uint8 `json:"qci"` + ARP ARP `json:"arp"` + NASPDU NASPDU `json:"nas_pdu"` + GBR *GBRQoS `json:"gbr_qos_information,omitempty"` + ERABQoSExtensions + + TransportInformation *TransportInformation `json:"transport_information,omitempty"` +} + +type TransportInformation struct { + TransportLayerAddress string `json:"transport_layer_address"` + ULGTPTEID uint32 `json:"ul_gtp_teid"` } // ERABModifiedItem is an E-RAB the eNB confirms modified (TS 36.413 §9.1.3.4). @@ -60,8 +69,17 @@ func buildERABModifyRequest(value []byte) (S1APMessageValue, string) { PreemptionCapability: uint8(it.QoS.ARP.PreemptionCapability), PreemptionVulnerability: uint8(it.QoS.ARP.PreemptionVulnerability), }, - NASPDU: nasPDU(it.NASPDU), + NASPDU: nasPDU(it.NASPDU), + GBR: gbrQoS(it.QoS.GBR), + ERABQoSExtensions: qosExtensions(it.QoS), }) + + if ti := it.TransportInformation; ti != nil { + erabs[len(erabs)-1].TransportInformation = &TransportInformation{ + TransportLayerAddress: transportLayerAddress(ti.TransportLayerAddress), + ULGTPTEID: uint32(ti.ULGTPTEID), + } + } } ies := []IE{ diff --git a/internal/decoder/s1ap/erab_setup.go b/internal/decoder/s1ap/erab_setup.go index 773d4d57a2..8013731724 100644 --- a/internal/decoder/s1ap/erab_setup.go +++ b/internal/decoder/s1ap/erab_setup.go @@ -21,6 +21,8 @@ type ERABToBeSetupBearer struct { TransportLayerAddress string `json:"transport_layer_address"` GTPTEID uint32 `json:"gtp_teid"` NASPDU NASPDU `json:"nas_pdu"` + ERABQoSExtensions + ERABSetupExtensions } type GBRQoS struct { @@ -28,6 +30,11 @@ type GBRQoS struct { MaximumBitrateUL uint64 `json:"maximum_bitrate_ul"` GuaranteedBitrateDL uint64 `json:"guaranteed_bitrate_dl"` GuaranteedBitrateUL uint64 `json:"guaranteed_bitrate_ul"` + + ExtendedMaximumBitrateDL *uint64 `json:"extended_maximum_bitrate_dl,omitempty"` + ExtendedMaximumBitrateUL *uint64 `json:"extended_maximum_bitrate_ul,omitempty"` + ExtendedGuaranteedBitrateDL *uint64 `json:"extended_guaranteed_bitrate_dl,omitempty"` + ExtendedGuaranteedBitrateUL *uint64 `json:"extended_guaranteed_bitrate_ul,omitempty"` } func gbrQoS(g *s1ap.GBRQosInformation) *GBRQoS { @@ -40,6 +47,11 @@ func gbrQoS(g *s1ap.GBRQosInformation) *GBRQoS { MaximumBitrateUL: uint64(g.MaximumBitrateUL), GuaranteedBitrateDL: uint64(g.GuaranteedBitrateDL), GuaranteedBitrateUL: uint64(g.GuaranteedBitrateUL), + + ExtendedMaximumBitrateDL: extendedBitRate(g.ExtendedMaximumBitrateDL), + ExtendedMaximumBitrateUL: extendedBitRate(g.ExtendedMaximumBitrateUL), + ExtendedGuaranteedBitrateDL: extendedBitRate(g.ExtendedGuaranteedBitrateDL), + ExtendedGuaranteedBitrateUL: extendedBitRate(g.ExtendedGuaranteedBitrateUL), } } @@ -63,6 +75,8 @@ func buildERABSetupRequest(value []byte) (S1APMessageValue, string) { TransportLayerAddress: transportLayerAddress(it.TransportLayerAddress), GTPTEID: uint32(it.GTPTEID), NASPDU: nasPDU(it.NASPDU), + ERABQoSExtensions: qosExtensions(it.QoS), + ERABSetupExtensions: setupExtensions(it.CorrelationID, it.SIPTOCorrelationID, it.BearerType, it.EthernetType, it.SecurityIndication), }) } diff --git a/internal/decoder/s1ap/handover.go b/internal/decoder/s1ap/handover.go index 199e2ed92f..009a7c3dad 100644 --- a/internal/decoder/s1ap/handover.go +++ b/internal/decoder/s1ap/handover.go @@ -78,11 +78,14 @@ type SecurityContext struct { } type ERABToBeSetupHO struct { - ERABID uint8 `json:"erab_id"` - QCI uint8 `json:"qci"` - ARP ARP `json:"arp"` - TransportLayerAddress string `json:"transport_layer_address"` - GTPTEID uint32 `json:"gtp_teid"` + ERABID uint8 `json:"erab_id"` + QCI uint8 `json:"qci"` + ARP ARP `json:"arp"` + TransportLayerAddress string `json:"transport_layer_address"` + GTPTEID uint32 `json:"gtp_teid"` + GBR *GBRQoS `json:"gbr_qos_information,omitempty"` + ERABQoSExtensions + ERABSetupExtensions } type ERABAdmitted struct { @@ -152,7 +155,7 @@ func buildHandoverRequest(value []byte) (S1APMessageValue, string) { erabs := make([]ERABToBeSetupHO, 0, len(m.ERABToBeSetup)) for _, it := range m.ERABToBeSetup { - erabs = append(erabs, ERABToBeSetupHO{ + e := ERABToBeSetupHO{ ERABID: uint8(it.ERABID), QCI: uint8(it.QoS.QCI), ARP: ARP{ @@ -162,7 +165,20 @@ func buildHandoverRequest(value []byte) (S1APMessageValue, string) { }, TransportLayerAddress: transportLayerAddress(it.TransportLayerAddress), GTPTEID: uint32(it.GTPTEID), - }) + GBR: gbrQoS(it.QoS.GBR), + ERABQoSExtensions: qosExtensions(it.QoS), + } + + if x := it.Extensions; x != nil { + e.ERABSetupExtensions = setupExtensions(nil, nil, x.BearerType, x.EthernetType, x.SecurityIndication) + + if x.DataForwardingNotPossible != nil { + notPossible := true + e.DataForwardingNotPossible = ¬Possible + } + } + + erabs = append(erabs, e) } ies := []IE{ diff --git a/internal/decoder/s1ap/initial_context_setup.go b/internal/decoder/s1ap/initial_context_setup.go index f4564e67f8..99db44749f 100644 --- a/internal/decoder/s1ap/initial_context_setup.go +++ b/internal/decoder/s1ap/initial_context_setup.go @@ -29,6 +29,9 @@ type ERABToBeSetup struct { TransportLayerAddress string `json:"transport_layer_address"` GTPTEID uint32 `json:"gtp_teid"` NASPDU *NASPDU `json:"nas_pdu,omitempty"` // absent on a reconnect ICS (no piggybacked NAS) + GBR *GBRQoS `json:"gbr_qos_information,omitempty"` + ERABQoSExtensions + ERABSetupExtensions } type ERABSetupItem struct { @@ -72,6 +75,9 @@ func erabToBeSetup(it s1ap.ERABToBeSetupItemCtxtSUReq) ERABToBeSetup { }, TransportLayerAddress: transportLayerAddress(it.TransportLayerAddress), GTPTEID: uint32(it.GTPTEID), + GBR: gbrQoS(it.QoS.GBR), + ERABQoSExtensions: qosExtensions(it.QoS), + ERABSetupExtensions: setupExtensions(it.CorrelationID, it.SIPTOCorrelationID, it.BearerType, it.EthernetType, it.SecurityIndication), } // A reconnect ICS (Service Request / active TAU) carries no piggybacked NAS; diff --git a/internal/decoder/s1ap/modeled_ies_test.go b/internal/decoder/s1ap/modeled_ies_test.go index e58e0190e3..7eef59e96a 100644 --- a/internal/decoder/s1ap/modeled_ies_test.go +++ b/internal/decoder/s1ap/modeled_ies_test.go @@ -46,6 +46,21 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(3)), }), + "path_switch_request_acknowledge_erab_to_be_switched_ul_list": mustMarshal(t, &s1ap.PathSwitchRequestAcknowledge{ + MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(1)), + ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), + ERABToBeSwitchedUL: s1ap.ERABToBeSwitchedULList{{ERABID: 5, TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 9}, GTPTEID: 7}}, + }), + "erab_modify_request_transport_information": mustMarshal(t, &s1ap.ERABModifyRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + ERABToBeModified: s1ap.ERABToBeModifiedListBearerModReq{{ + ERABID: 5, + QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, + NASPDU: s1ap.NASPDU{0x07}, + TransportInformation: &s1ap.TransportInformation{TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 9}, ULGTPTEID: 7}, + }}, + }), "path_switch_request_source_mme_gummei": mustMarshal(t, &s1ap.PathSwitchRequest{ ENBUES1APID: 2, ERABToBeSwitchedDL: []s1ap.ERABToBeSwitchedDLItem{{ERABID: 5, TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 1}, GTPTEID: 1}}, @@ -148,3 +163,36 @@ func TestDecodeS1APMessage_UEContextReleaseRequestGWContextReleaseIndication(t * t.Fatalf("IEs = %+v, want GW Context Release Indication true last", ies) } } + +func TestDecodeS1APMessage_TNLExtensions(t *testing.T) { + corpus := modeledIEsCorpus(t) + + ack := DecodeS1APMessage(corpus["path_switch_request_acknowledge_erab_to_be_switched_ul_list"]) + + var ul []ERABToBeSwitchedUL + + for _, e := range ack.Value.IEs { + if v, ok := e.Value.([]ERABToBeSwitchedUL); ok { + ul = v + } + } + + if len(ul) != 1 || ul[0].ERABID != 5 || ul[0].TransportLayerAddress != "10.0.0.9" || ul[0].GTPTEID != 7 { + t.Fatalf("E-RAB To Be Switched UL List = %+v", ul) + } + + mod := DecodeS1APMessage(corpus["erab_modify_request_transport_information"]) + + var erabs []ERABToBeModified + + for _, e := range mod.Value.IEs { + if v, ok := e.Value.([]ERABToBeModified); ok { + erabs = v + } + } + + if len(erabs) != 1 || erabs[0].TransportInformation == nil || + *erabs[0].TransportInformation != (TransportInformation{TransportLayerAddress: "10.0.0.9", ULGTPTEID: 7}) { + t.Fatalf("E-RAB To Be Modified = %+v", erabs) + } +} diff --git a/internal/decoder/s1ap/path_switch.go b/internal/decoder/s1ap/path_switch.go index f4e80cf769..afd8d0565b 100644 --- a/internal/decoder/s1ap/path_switch.go +++ b/internal/decoder/s1ap/path_switch.go @@ -6,12 +6,20 @@ package s1ap import ( "fmt" + "github.com/ellanetworks/core/internal/decoder/utils" "github.com/ellanetworks/core/s1ap" ) // ERABToBeSwitchedDL is an E-RAB whose downlink GTP endpoint the target eNB asks // the MME to switch to it (TS 36.413 §9.1.5.8). type ERABToBeSwitchedDL struct { + ERABID uint8 `json:"erab_id"` + TransportLayerAddress string `json:"transport_layer_address"` + GTPTEID uint32 `json:"gtp_teid"` + IntegrityProtectionIndication *utils.EnumField `json:"integrity_protection_indication,omitempty"` +} + +type ERABToBeSwitchedUL struct { ERABID uint8 `json:"erab_id"` TransportLayerAddress string `json:"transport_layer_address"` GTPTEID uint32 `json:"gtp_teid"` @@ -29,6 +37,8 @@ func buildPathSwitchRequest(value []byte) (S1APMessageValue, string) { ERABID: uint8(it.ERABID), TransportLayerAddress: transportLayerAddress(it.TransportLayerAddress), GTPTEID: uint32(it.GTPTEID), + + IntegrityProtectionIndication: integrityProtectionIndication(it.SecurityIndication), }) } @@ -82,6 +92,19 @@ func buildPathSwitchRequestAcknowledge(value []byte) (S1APMessageValue, string) ies = append(ies, ie(s1ap.IDUEAggregateMaximumBitrate, s1ap.CriticalityIgnore, AMBR{DL: uint64(ambr.DL), UL: uint64(ambr.UL)})) } + if len(m.ERABToBeSwitchedUL) > 0 { + switched := make([]ERABToBeSwitchedUL, 0, len(m.ERABToBeSwitchedUL)) + for _, it := range m.ERABToBeSwitchedUL { + switched = append(switched, ERABToBeSwitchedUL{ + ERABID: uint8(it.ERABID), + TransportLayerAddress: transportLayerAddress(it.TransportLayerAddress), + GTPTEID: uint32(it.GTPTEID), + }) + } + + ies = append(ies, ie(s1ap.IDERABToBeSwitchedULList, s1ap.CriticalityIgnore, switched)) + } + if len(m.ERABToBeReleased) > 0 { ies = append(ies, ie(s1ap.IDERABToBeReleasedList, s1ap.CriticalityIgnore, erabFailedItems(m.ERABToBeReleased))) } diff --git a/internal/mme/bearer_arp_test.go b/internal/mme/bearer_arp_test.go index 08d41a9f81..c16e0f5645 100644 --- a/internal/mme/bearer_arp_test.go +++ b/internal/mme/bearer_arp_test.go @@ -4,6 +4,7 @@ package mme import ( + "reflect" "testing" "github.com/ellanetworks/core/internal/models" @@ -32,7 +33,7 @@ func TestBearerARP(t *testing.T) { s1ap.AllocationAndRetentionPriority{PriorityLevel: 12, PreemptionCapability: s1ap.PreemptionShallNotTrigger, PreemptionVulnerability: s1ap.PreemptionPreemptable}, }, } { - if got := BearerARP(tc.arp); got != tc.want { + if got := BearerARP(tc.arp); !reflect.DeepEqual(got, tc.want) { t.Errorf("BearerARP(%+v) = %+v, want %+v", tc.arp, got, tc.want) } } diff --git a/internal/mme/dedicated_bearer_test.go b/internal/mme/dedicated_bearer_test.go index 5a119cc9b2..409cf8a5d6 100644 --- a/internal/mme/dedicated_bearer_test.go +++ b/internal/mme/dedicated_bearer_test.go @@ -7,6 +7,7 @@ import ( "context" "errors" "net/netip" + "reflect" "slices" "testing" "time" @@ -743,7 +744,7 @@ func TestNonGBRBearerSignalsNoBitRates_TS36413_9_2_1_15(t *testing.T) { qos := DedicatedERABQoS(&info) want := s1ap.AllocationAndRetentionPriority{PriorityLevel: 3, PreemptionCapability: s1ap.PreemptionMayTrigger, PreemptionVulnerability: s1ap.PreemptionPreemptable} - if qos.QCI != 69 || qos.GBR != nil || qos.ARP != want { + if qos.QCI != 69 || qos.GBR != nil || !reflect.DeepEqual(qos.ARP, want) { t.Fatalf("E-RAB QoS %+v, want QCI 69 at ARP %+v without GBR QoS Information", qos, want) } diff --git a/internal/smf/non_gbr_test.go b/internal/smf/non_gbr_test.go index 05934f7e7c..13ec38d104 100644 --- a/internal/smf/non_gbr_test.go +++ b/internal/smf/non_gbr_test.go @@ -7,6 +7,7 @@ import ( "bytes" "context" "net/netip" + "reflect" "slices" "testing" @@ -115,7 +116,7 @@ func TestNonGBRRuleCreatesAQoSFlow_TS24501_9_11_4_12(t *testing.T) { PreemptionVulnerability: libngap.PreemptionPreemptable, } - if q := item.QosFlowLevelQosParameters; q == nil || q.GBRQosInformation != nil || q.QosCharacteristics.NonDynamic5QI.FiveQI != 69 || q.AllocationAndRetentionPriority != wantARP { + if q := item.QosFlowLevelQosParameters; q == nil || q.GBRQosInformation != nil || q.QosCharacteristics.NonDynamic5QI.FiveQI != 69 || !reflect.DeepEqual(q.AllocationAndRetentionPriority, wantARP) { t.Fatalf("N2 QoS flow %+v, want 5QI 69 at ARP %+v without GBR QoS Flow Information (TS 38.413 §9.3.1.12)", item, wantARP) } diff --git a/internal/smf/qos_flows_test.go b/internal/smf/qos_flows_test.go index 3cba348fcd..f4e4f7a1f1 100644 --- a/internal/smf/qos_flows_test.go +++ b/internal/smf/qos_flows_test.go @@ -6,6 +6,7 @@ package smf_test import ( "bytes" "context" + "reflect" "slices" "testing" "time" @@ -254,7 +255,7 @@ func TestVoiceRuleCreatesAGBRQoSFlow(t *testing.T) { PreemptionCapability: libngap.PreemptionMayTrigger, PreemptionVulnerability: libngap.PreemptionNotPreemptable, } - if arp := item.QosFlowLevelQosParameters.AllocationAndRetentionPriority; arp != wantARP { + if arp := item.QosFlowLevelQosParameters.AllocationAndRetentionPriority; !reflect.DeepEqual(arp, wantARP) { t.Fatalf("N2 ARP %+v, want the rule's %+v (TS 38.413 §9.3.1.19)", arp, wantARP) } diff --git a/internal/tester/scenarios/interworking/ims_mcptt.go b/internal/tester/scenarios/interworking/ims_mcptt.go index fca8875147..68f4b9d673 100644 --- a/internal/tester/scenarios/interworking/ims_mcptt.go +++ b/internal/tester/scenarios/interworking/ims_mcptt.go @@ -7,6 +7,7 @@ import ( "context" "errors" "fmt" + "reflect" "slices" "time" @@ -178,7 +179,7 @@ func mcpttHandoverSteps(ctx context.Context, r *imsCallRANs, p *imsParty, as *sc return hangUp(fmt.Errorf("handover to EPS: %w", err)) } - if qos := h.qos[mcpttQCI]; qos.ARP != mcpttNormalARP { + if qos := h.qos[mcpttQCI]; !reflect.DeepEqual(qos.ARP, mcpttNormalARP) { return hangUp(fmt.Errorf("the QCI %d E-RAB of the Handover Request has ARP %+v for %s, want the call's %+v kept (TS 23.502 §4.11.1.2.1 step 2, TS 29.214 Annex A.13.2)", mcpttQCI, qos.ARP, mcpttNormalPriority, mcpttNormalARP)) } diff --git a/internal/tester/scenarios/s1enb/ims_mcptt.go b/internal/tester/scenarios/s1enb/ims_mcptt.go index 07b0e75baa..f0094e5fb1 100644 --- a/internal/tester/scenarios/s1enb/ims_mcptt.go +++ b/internal/tester/scenarios/s1enb/ims_mcptt.go @@ -7,6 +7,7 @@ import ( "context" "errors" "fmt" + "reflect" "slices" "time" @@ -211,7 +212,7 @@ func (m *mcpttENB) checkVoice(b *s1enb.DedicatedBearer) error { return fmt.Errorf("UE %s MCPTT speech E-RAB has no guaranteed bit rate: %+v", m.u.ue.IMSI, b.QoS.GBR) case !ok || rates.GuaranteedDownlinkKbps == 0 || rates.GuaranteedUplinkKbps == 0: return fmt.Errorf("UE %s MCPTT speech EPS QoS has no guaranteed bit rate", m.u.ue.IMSI) - case b.QoS.ARP != m.arp: + case !reflect.DeepEqual(b.QoS.ARP, m.arp): return fmt.Errorf("UE %s MCPTT speech E-RAB ARP %+v for %s, want %+v (TS 29.214 Annex A.13.2)", m.u.ue.IMSI, b.QoS.ARP, m.priority, m.arp) case b.TFT.Operation != eps.TFTCreate || len(b.TFT.Filters) == 0: return fmt.Errorf("UE %s MCPTT speech bearer TFT %+v, want new packet filters", m.u.ue.IMSI, b.TFT) @@ -243,7 +244,7 @@ func (m *mcpttENB) awaitUpgrade(b mcpttBearers) error { return fmt.Errorf("UE %s E-RAB %d modified twice for the upgrade to %s", m.u.ue.IMSI, item.ERABID, mcpttUpgradePriority) case item.QoS.QCI != b.dedicated()[i].QoS.QCI: return fmt.Errorf("UE %s E-RAB %d modified to QCI %d, want its QCI %d kept", m.u.ue.IMSI, item.ERABID, item.QoS.QCI, b.dedicated()[i].QoS.QCI) - case item.QoS.ARP != want: + case !reflect.DeepEqual(item.QoS.ARP, want): return fmt.Errorf("UE %s QCI %d E-RAB %d ARP %+v after the upgrade to %s, want %+v (TS 29.214 Annex A.13.2)", m.u.ue.IMSI, item.QoS.QCI, item.ERABID, item.QoS.ARP, mcpttUpgradePriority, want) case item.QoS.GBR == nil: return fmt.Errorf("UE %s MCPTT speech E-RAB %d lost its GBR QoS Information in the upgrade", m.u.ue.IMSI, item.ERABID) diff --git a/ngap/enum_names.go b/ngap/enum_names.go index ef56f394d0..cb684fe2a8 100644 --- a/ngap/enum_names.go +++ b/ngap/enum_names.go @@ -189,3 +189,10 @@ var qosFlowMappingIndicationNames = map[QosFlowMappingIndication]string{ } func (q QosFlowMappingIndication) Name() string { return qosFlowMappingIndicationNames[q] } + +var userPlaneFailureTypeNames = map[UserPlaneFailureType]string{ + UserPlaneFailureTypeGTPUErrorIndicationReceived: "gtp-u-error-indication-received", + UserPlaneFailureTypeUPPathFailure: "up-path-failure", +} + +func (u UserPlaneFailureType) Name() string { return userPlaneFailureTypeNames[u] } diff --git a/ngap/enum_names_test.go b/ngap/enum_names_test.go index 7a801d78ec..0d49cd7512 100644 --- a/ngap/enum_names_test.go +++ b/ngap/enum_names_test.go @@ -39,6 +39,10 @@ func TestEnumNames(t *testing.T) { {"UEContextRequested", UEContextRequested.Name(), "requested"}, {"UEContextRequest(9)", UEContextRequest(9).Name(), ""}, + {"UserPlaneFailureTypeGTPUErrorIndicationReceived", UserPlaneFailureTypeGTPUErrorIndicationReceived.Name(), "gtp-u-error-indication-received"}, + {"UserPlaneFailureTypeUPPathFailure", UserPlaneFailureTypeUPPathFailure.Name(), "up-path-failure"}, + {"UserPlaneFailureType(9)", UserPlaneFailureType(9).Name(), ""}, + {"GUAMITypeNative", GUAMITypeNative.Name(), "native"}, {"GUAMITypeMapped", GUAMITypeMapped.Name(), "mapped"}, {"GUAMIType(9)", GUAMIType(9).Name(), ""}, diff --git a/ngap/handover_transfer.go b/ngap/handover_transfer.go index b9a2e831d6..b339d97f8e 100644 --- a/ngap/handover_transfer.go +++ b/ngap/handover_transfer.go @@ -67,21 +67,40 @@ func (d *DLNGUTNLInformationReused) UnmarshalPER(r *per.Reader, enc per.Encoding // §9.3.1.60. Both fields are mandatory: the NG-RAN node reports what it applied // alongside what it was asked for. type UserPlaneSecurityInformation struct { - _ [0]struct{} `per:"extseq"` SecurityResult SecurityResult SecurityIndication SecurityIndication - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // HandoverCommandTransfer ::= SEQUENCE { dLForwardingUP-TNLInformation // OPTIONAL, qosFlowToBeForwardedList OPTIONAL, dataForwardingResponseDRBList // OPTIONAL, iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.4.10. type HandoverCommandTransfer struct { - _ [0]struct{} `per:"extseq"` - DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` - QosFlowToBeForwarded QosFlowToBeForwardedList `per:",optional"` - DataForwardingResponseDRB DataForwardingResponseDRBList `per:",optional"` - _ ieExtensions `per:",skip"` + DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` + QosFlowToBeForwarded QosFlowToBeForwardedList `per:",optional"` + DataForwardingResponseDRB DataForwardingResponseDRBList `per:",optional"` + AdditionalDLForwardingUPTNLInformation QosFlowPerTNLInformationList `per:"-"` + ULForwardingUPTNLInformation *UPTransportLayerInformation `per:"-"` + AdditionalULForwardingUPTNLInformation UPTransportLayerInformationList `per:"-"` + DataForwardingResponseERAB DataForwardingResponseERABList `per:"-"` + iEExtensions messageMeta `per:",exttable:handoverCommandTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var handoverCommandTransferExtIEs = []ieSpec[HandoverCommandTransfer]{ + listExtension(IDAdditionalDLForwardingUPTNLInformation, CriticalityIgnore, func(m *HandoverCommandTransfer) *QosFlowPerTNLInformationList { + return &m.AdditionalDLForwardingUPTNLInformation + }), + optionalExtension(IDULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverCommandTransfer) **UPTransportLayerInformation { + return &m.ULForwardingUPTNLInformation + }), + listExtension(IDAdditionalULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverCommandTransfer) *UPTransportLayerInformationList { + return &m.AdditionalULForwardingUPTNLInformation + }), + listExtension(IDDataForwardingResponseERABList, CriticalityIgnore, func(m *HandoverCommandTransfer) *DataForwardingResponseERABList { + return &m.DataForwardingResponseERAB + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -148,14 +167,37 @@ func ParseHandoverPreparationUnsuccessfulTransfer(b TransferContainer) (*Handove // dataForwardingResponseDRBList OPTIONAL, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.4.11. type HandoverRequestAcknowledgeTransfer struct { - _ [0]struct{} `per:"extseq"` - DLNGUUPTNLInformation UPTransportLayerInformation - DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` - SecurityResult *SecurityResult `per:",optional"` - QosFlowSetupResponse QosFlowListWithDataForwarding - QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` - DataForwardingResponseDRB DataForwardingResponseDRBList `per:",optional"` - _ ieExtensions `per:",skip"` + DLNGUUPTNLInformation UPTransportLayerInformation + DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` + SecurityResult *SecurityResult `per:",optional"` + QosFlowSetupResponse QosFlowListWithDataForwarding + QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` + DataForwardingResponseDRB DataForwardingResponseDRBList `per:",optional"` + AdditionalDLUPTNLInformationForHO AdditionalDLUPTNLInformationForHOList `per:"-"` + ULForwardingUPTNLInformation *UPTransportLayerInformation `per:"-"` + AdditionalULForwardingUPTNLInformation UPTransportLayerInformationList `per:"-"` + DataForwardingResponseERAB DataForwardingResponseERABList `per:"-"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + iEExtensions messageMeta `per:",exttable:handoverRequestAcknowledgeTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var handoverRequestAcknowledgeTransferExtIEs = []ieSpec[HandoverRequestAcknowledgeTransfer]{ + listExtension(IDAdditionalDLUPTNLInformationForHOList, CriticalityIgnore, func(m *HandoverRequestAcknowledgeTransfer) *AdditionalDLUPTNLInformationForHOList { + return &m.AdditionalDLUPTNLInformationForHO + }), + optionalExtension(IDULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverRequestAcknowledgeTransfer) **UPTransportLayerInformation { + return &m.ULForwardingUPTNLInformation + }), + listExtension(IDAdditionalULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverRequestAcknowledgeTransfer) *UPTransportLayerInformationList { + return &m.AdditionalULForwardingUPTNLInformation + }), + listExtension(IDDataForwardingResponseERABList, CriticalityIgnore, func(m *HandoverRequestAcknowledgeTransfer) *DataForwardingResponseERABList { + return &m.DataForwardingResponseERAB + }), + optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *HandoverRequestAcknowledgeTransfer) **UPTransportLayerInformation { + return &m.RedundantDLNGUUPTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -256,12 +298,31 @@ func ParseHandoverRequiredTransfer(b TransferContainer) (*HandoverRequiredTransf // qosFlowAcceptedList, iE-Extensions OPTIONAL } (extensible) — TS 38.413 // §9.3.4.8. type PathSwitchRequestTransfer struct { - _ [0]struct{} `per:"extseq"` - DLNGUUPTNLInformation UPTransportLayerInformation - DLNGUTNLInformationReused *DLNGUTNLInformationReused `per:"ENUMERATED,range:0..0,...,optional"` - UserPlaneSecurityInformation *UserPlaneSecurityInformation `per:",optional"` - QosFlowAccepted QosFlowAcceptedList - _ ieExtensions `per:",skip"` + DLNGUUPTNLInformation UPTransportLayerInformation + DLNGUTNLInformationReused *DLNGUTNLInformationReused `per:"ENUMERATED,range:0..0,...,optional"` + UserPlaneSecurityInformation *UserPlaneSecurityInformation `per:",optional"` + QosFlowAccepted QosFlowAcceptedList + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + RedundantDLNGUTNLInformationReused *DLNGUTNLInformationReused `per:"-"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` + iEExtensions messageMeta `per:",exttable:pathSwitchRequestTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var pathSwitchRequestTransferExtIEs = []ieSpec[PathSwitchRequestTransfer]{ + listExtension(IDAdditionalDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestTransfer) *QosFlowPerTNLInformationList { + return &m.AdditionalDLQosFlowPerTNLInformation + }), + optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestTransfer) **UPTransportLayerInformation { + return &m.RedundantDLNGUUPTNLInformation + }), + optionalExtension(IDRedundantDLNGUTNLInformationReused, CriticalityIgnore, func(m *PathSwitchRequestTransfer) **DLNGUTNLInformationReused { + return &m.RedundantDLNGUTNLInformationReused + }), + listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestTransfer) *QosFlowPerTNLInformationList { + return &m.AdditionalRedundantDLQosFlowPerTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -293,10 +354,25 @@ func ParsePathSwitchRequestTransfer(b TransferContainer) (*PathSwitchRequestTran // OPTIONAL, securityIndication OPTIONAL, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.4.9. type PathSwitchRequestAcknowledgeTransfer struct { - _ [0]struct{} `per:"extseq"` - ULNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` - SecurityIndication *SecurityIndication `per:",optional"` - _ ieExtensions `per:",skip"` + ULNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` + SecurityIndication *SecurityIndication `per:",optional"` + AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` + iEExtensions messageMeta `per:",exttable:pathSwitchRequestAcknowledgeTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var pathSwitchRequestAcknowledgeTransferExtIEs = []ieSpec[PathSwitchRequestAcknowledgeTransfer]{ + listExtension(IDAdditionalNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledgeTransfer) *UPTransportLayerInformationPairList { + return &m.AdditionalNGUUPTNLInformation + }), + optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledgeTransfer) **UPTransportLayerInformation { + return &m.RedundantULNGUUPTNLInformation + }), + listExtension(IDAdditionalRedundantNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledgeTransfer) *UPTransportLayerInformationPairList { + return &m.AdditionalRedundantNGUUPTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. diff --git a/ngap/ie_common.go b/ngap/ie_common.go index f2108f2854..05886a02bc 100644 --- a/ngap/ie_common.go +++ b/ngap/ie_common.go @@ -97,10 +97,10 @@ func (t *GTPTEID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // GTPTunnel ::= SEQUENCE { transportLayerAddress, gTP-TEID, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.2.2. type GTPTunnel struct { - _ [0]struct{} `per:"extseq"` TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // UPTransportLayerInformation CHOICE alternatives. The CHOICE is not @@ -143,9 +143,9 @@ func (u *UPTransportLayerInformation) UnmarshalPER(r *per.Reader, enc per.Encodi // UPTransportLayerInformationItem ::= SEQUENCE { nGU-UP-TNLInformation, // iE-Extensions OPTIONAL } (extensible). type UPTransportLayerInformationItem struct { - _ [0]struct{} `per:"extseq"` NGUUPTNLInformation UPTransportLayerInformation - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // UPTransportLayerInformationList ::= SEQUENCE @@ -157,10 +157,10 @@ type UPTransportLayerInformationList []UPTransportLayerInformationItem // UPTransportLayerInformationPairItem ::= SEQUENCE { uL-NGU-UP-TNLInformation, // dL-NGU-UP-TNLInformation, iE-Extensions OPTIONAL } (extensible). type UPTransportLayerInformationPairItem struct { - _ [0]struct{} `per:"extseq"` ULNGUUPTNLInformation UPTransportLayerInformation DLNGUUPTNLInformation UPTransportLayerInformation - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // UPTransportLayerInformationPairList ::= SEQUENCE @@ -173,10 +173,21 @@ type UPTransportLayerInformationPairList []UPTransportLayerInformationPairItem // identical to UPTransportLayerInformationPairItem but a distinct ASN.1 type, // and its list is bounded by maxnoofMultiConnectivity rather than one less. type ULNGUUPTNLModifyItem struct { - _ [0]struct{} `per:"extseq"` - ULNGUUPTNLInformation UPTransportLayerInformation - DLNGUUPTNLInformation UPTransportLayerInformation - _ ieExtensions `per:",skip"` + ULNGUUPTNLInformation UPTransportLayerInformation + DLNGUUPTNLInformation UPTransportLayerInformation + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + iEExtensions messageMeta `per:",exttable:uLNGUUPTNLModifyItemExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var uLNGUUPTNLModifyItemExtIEs = []ieSpec[ULNGUUPTNLModifyItem]{ + optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *ULNGUUPTNLModifyItem) **UPTransportLayerInformation { + return &m.RedundantULNGUUPTNLInformation + }), + optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *ULNGUUPTNLModifyItem) **UPTransportLayerInformation { + return &m.RedundantDLNGUUPTNLInformation + }), } // ULNGUUPTNLModifyList ::= SEQUENCE (SIZE(1..maxnoofMultiConnectivity)) OF @@ -205,17 +216,105 @@ func (d *DRBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // dLForwardingUP-TNLInformation OPTIONAL, uLForwardingUP-TNLInformation // OPTIONAL, iE-Extensions OPTIONAL } (extensible). type DataForwardingResponseDRBItem struct { - _ [0]struct{} `per:"extseq"` DRBID DRBID DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` ULForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // DataForwardingResponseDRBList ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF // DataForwardingResponseDRBItem. type DataForwardingResponseDRBList []DataForwardingResponseDRBItem +type DataForwardingResponseERABListItem struct { + ERABID ERABID + DLForwardingUPTNLInformation UPTransportLayerInformation + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type DataForwardingResponseERABList []DataForwardingResponseERABListItem + +func (l DataForwardingResponseERABList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofERABs, []DataForwardingResponseERABListItem(l)) +} + +func (l *DataForwardingResponseERABList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[DataForwardingResponseERABListItem](r, enc, 1, maxnoofERABs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type AdditionalDLUPTNLInformationForHOItem struct { + AdditionalDLNGUUPTNLInformation UPTransportLayerInformation + AdditionalQosFlowSetupResponse QosFlowListWithDataForwarding + AdditionalDLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` + AdditionalRedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + iEExtensions messageMeta `per:",exttable:additionalDLUPTNLInformationForHOItemExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var additionalDLUPTNLInformationForHOItemExtIEs = []ieSpec[AdditionalDLUPTNLInformationForHOItem]{ + optionalExtension(IDAdditionalRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *AdditionalDLUPTNLInformationForHOItem) **UPTransportLayerInformation { + return &m.AdditionalRedundantDLNGUUPTNLInformation + }), +} + +type AdditionalDLUPTNLInformationForHOList []AdditionalDLUPTNLInformationForHOItem + +func (l AdditionalDLUPTNLInformationForHOList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMultiConnectivityMinusOne, []AdditionalDLUPTNLInformationForHOItem(l)) +} + +func (l *AdditionalDLUPTNLInformationForHOList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AdditionalDLUPTNLInformationForHOItem](r, enc, 1, maxnoofMultiConnectivityMinusOne) + if err != nil { + return err + } + + *l = items + + return nil +} + +type UserPlaneFailureType uint8 + +const ( + UserPlaneFailureTypeGTPUErrorIndicationReceived UserPlaneFailureType = iota + UserPlaneFailureTypeUPPathFailure + + userPlaneFailureTypeRootCount = 2 +) + +func (u UserPlaneFailureType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, userPlaneFailureTypeRootCount, int64(u), "UserPlaneFailureType") +} + +func (u *UserPlaneFailureType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, userPlaneFailureTypeRootCount, "UserPlaneFailureType") + if err != nil { + return err + } + + *u = UserPlaneFailureType(idx) + + return nil +} + +type UserPlaneFailureIndication struct { + UserPlaneFailureType UserPlaneFailureType + ULNGUUPTNLInformation UPTransportLayerInformation + DLNGUUPTNLInformation UPTransportLayerInformation + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + // encodeExtensibleInt encodes an INTEGER whose constraint carries an extension // marker but defines no extension additions: X.691 §13.1 spends one bit, then // the root value follows. A value outside the root is refused rather than sent diff --git a/ngap/ie_extensions.go b/ngap/ie_extensions.go new file mode 100644 index 0000000000..1ec251e15b --- /dev/null +++ b/ngap/ie_extensions.go @@ -0,0 +1,177 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "errors" + "fmt" + + "github.com/ellanetworks/core/per" +) + +func extensionFields[M any](table []ieSpec[M], m *M, meta *messageMeta) []ieField { + typed := make([]*ieField, len(table)) + + for i, spec := range table { + if val, ok := spec.encode(m); ok { + typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} + } + } + + return orderFields(table, typed, meta) +} + +func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { + if len(fields) > maxProtocolExtensions { + return fmt.Errorf("ngap: %d extensions exceed maxProtocolExtensions", len(fields)) + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, int64(len(fields))); err != nil { + return err + } + + for _, f := range fields { + if err := encodeContainerField(w, enc, f); err != nil { + return err + } + } + + return nil +} + +func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *messageMeta) error { + n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) + if err != nil { + return err + } + + if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { + return fmt.Errorf("ngap: extension container declares %d fields in %d bits", n, maxBits) + } + + var rejected *notComprehendedIE + + lastIdx := -1 + + for i := int64(0); i < n; i++ { + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) + if err != nil { + return err + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) + if err != nil { + return err + } + + val, err := per.DecodeOpenTypeBytes(r, enc) + if err != nil { + return err + } + + if len(val) == 0 { + return fmt.Errorf("ngap: extension %d has an empty open type", id) + } + + f := rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val} + + if idx, spec, ok := lookupIESpec(table, f.id); ok { + if idx <= lastIdx { + return fmt.Errorf("ngap: extension %s out of order or repeated", f.id) + } + + lastIdx = idx + + err := spec.decode(m, f.value, enc) + if err == nil { + meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) + + continue + } + + if !errors.Is(err, errNotComprehended) { + return err + } + + var inner *notComprehendedIE + if errors.As(err, &inner) && inner.Crit == CriticalityReject && rejected == nil { + rejected = inner + } + } + + if f.crit == CriticalityReject { + if rejected == nil { + rejected = ¬ComprehendedIE{ID: f.id, Crit: CriticalityReject, What: "iE-Extensions"} + } + + continue + } + + meta.preserveUpTo(f, maxProtocolExtensions) + } + + if rejected != nil { + return rejected + } + + if wireMatchesTable(table, meta.wire) { + meta.wire = nil + } + + return nil +} + +func optionalExtension[M any, T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](id ProtocolIEID, crit Criticality, field func(m *M) **T, +) ieSpec[M] { + return ieSpec[M]{ + id: id, presence: presenceOptional, crit: crit, + decode: func(m *M, raw []byte, _ per.Encoding) error { + v := PT(new(T)) + + if err := perIEDecode(raw, v); err != nil { + return err + } + + *field(m) = (*T)(v) + + return nil + }, + encode: func(m *M) (per.Marshaler, bool) { + v := *field(m) + if v == nil { + return nil, false + } + + return PT(v), true + }, + } +} + +func listExtension[M any, L interface { + ~[]E + per.Marshaler +}, E any, PL interface { + *L + per.Unmarshaler +}](id ProtocolIEID, crit Criticality, field func(m *M) *L, +) ieSpec[M] { + return ieSpec[M]{ + id: id, presence: presenceOptional, crit: crit, + decode: func(m *M, raw []byte, _ per.Encoding) error { + return perIEDecode(raw, PL(field(m))) + }, + encode: func(m *M) (per.Marshaler, bool) { + v := *field(m) + if len(v) == 0 { + return nil, false + } + + return v, true + }, + } +} diff --git a/ngap/ie_handover.go b/ngap/ie_handover.go index 9b4d5bd563..fc9b1d21f5 100644 --- a/ngap/ie_handover.go +++ b/ngap/ie_handover.go @@ -355,10 +355,10 @@ type PDUSessionResourceListHORqd []PDUSessionResourceItemHORqd // handoverCommandTransfer, iE-Extensions OPTIONAL } (extensible). One entry per // session the target admitted. type PDUSessionResourceHandoverItem struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceHandoverList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF @@ -414,11 +414,11 @@ type SecurityContext struct { // is a PDUSessionResourceSetupRequestTransfer, the same one the setup procedure // carries. type PDUSessionResourceSetupItemHOReq struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID SNSSAI SNSSAI Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListHOReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -428,10 +428,10 @@ type PDUSessionResourceSetupListHOReq []PDUSessionResourceSetupItemHOReq // PDUSessionResourceAdmittedItem ::= SEQUENCE { pDUSessionID, // handoverRequestAcknowledgeTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceAdmittedItem struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceAdmittedList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF @@ -455,10 +455,10 @@ type PDUSessionResourceFailedToSetupListHOAck []PDUSessionResourceFailedToSetupI // PDUSessionResourceToBeSwitchedDLItem ::= SEQUENCE { pDUSessionID, // pathSwitchRequestTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceToBeSwitchedDLItem struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceToBeSwitchedDLList ::= SEQUENCE @@ -481,10 +481,10 @@ type PDUSessionResourceFailedToSetupListPSReq []PDUSessionResourceFailedToSetupI // PDUSessionResourceSwitchedItem ::= SEQUENCE { pDUSessionID, // pathSwitchRequestAcknowledgeTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceSwitchedItem struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSwitchedList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF diff --git a/ngap/ie_ids.go b/ngap/ie_ids.go index 5cd3318314..2815eb0874 100644 --- a/ngap/ie_ids.go +++ b/ngap/ie_ids.go @@ -5,268 +5,277 @@ package ngap // ProtocolIE-ID values (TS 38.413 §9.4.7, NGAP-Constants). const ( - IDAllowedNSSAI ProtocolIEID = 0 - IDAMFName ProtocolIEID = 1 - IDAMFOverloadResponse ProtocolIEID = 2 - IDAMFSetID ProtocolIEID = 3 - IDAMFTNLAssociationFailedToSetupList ProtocolIEID = 4 - IDAMFTNLAssociationSetupList ProtocolIEID = 5 - IDAMFTNLAssociationToAddList ProtocolIEID = 6 - IDAMFTNLAssociationToRemoveList ProtocolIEID = 7 - IDAMFTNLAssociationToUpdateList ProtocolIEID = 8 - IDAMFTrafficLoadReductionIndication ProtocolIEID = 9 - IDAMFUENGAPID ProtocolIEID = 10 - IDAssistanceDataForPaging ProtocolIEID = 11 - IDBroadcastCancelledAreaList ProtocolIEID = 12 - IDBroadcastCompletedAreaList ProtocolIEID = 13 - IDCancelAllWarningMessages ProtocolIEID = 14 - IDCause ProtocolIEID = 15 - IDCellIDListForRestart ProtocolIEID = 16 - IDConcurrentWarningMessageInd ProtocolIEID = 17 - IDCoreNetworkAssistanceInformationForInactive ProtocolIEID = 18 - IDCriticalityDiagnostics ProtocolIEID = 19 - IDDataCodingScheme ProtocolIEID = 20 - IDDefaultPagingDRX ProtocolIEID = 21 - IDDirectForwardingPathAvailability ProtocolIEID = 22 - IDEmergencyAreaIDListForRestart ProtocolIEID = 23 - IDEmergencyFallbackIndicator ProtocolIEID = 24 - IDEUTRACGI ProtocolIEID = 25 - IDFiveGSTMSI ProtocolIEID = 26 - IDGlobalRANNodeID ProtocolIEID = 27 - IDGUAMI ProtocolIEID = 28 - IDHandoverType ProtocolIEID = 29 - IDIMSVoiceSupportIndicator ProtocolIEID = 30 - IDIndexToRFSP ProtocolIEID = 31 - IDInfoOnRecommendedCellsAndRANNodesForPaging ProtocolIEID = 32 - IDLocationReportingRequestType ProtocolIEID = 33 - IDMaskedIMEISV ProtocolIEID = 34 - IDMessageIdentifier ProtocolIEID = 35 - IDMobilityRestrictionList ProtocolIEID = 36 - IDNASC ProtocolIEID = 37 - IDNASPDU ProtocolIEID = 38 - IDNASSecurityParametersFromNGRAN ProtocolIEID = 39 - IDNewAMFUENGAPID ProtocolIEID = 40 - IDNewSecurityContextInd ProtocolIEID = 41 - IDNGAPMessage ProtocolIEID = 42 - IDNGRANCGI ProtocolIEID = 43 - IDNGRANTraceID ProtocolIEID = 44 - IDNRCGI ProtocolIEID = 45 - IDNRPPaPDU ProtocolIEID = 46 - IDNumberOfBroadcastsRequested ProtocolIEID = 47 - IDOldAMF ProtocolIEID = 48 - IDOverloadStartNSSAIList ProtocolIEID = 49 - IDPagingDRX ProtocolIEID = 50 - IDPagingOrigin ProtocolIEID = 51 - IDPagingPriority ProtocolIEID = 52 - IDPDUSessionResourceAdmittedList ProtocolIEID = 53 - IDPDUSessionResourceFailedToModifyListModRes ProtocolIEID = 54 - IDPDUSessionResourceFailedToSetupListCxtRes ProtocolIEID = 55 - IDPDUSessionResourceFailedToSetupListHOAck ProtocolIEID = 56 - IDPDUSessionResourceFailedToSetupListPSReq ProtocolIEID = 57 - IDPDUSessionResourceFailedToSetupListSURes ProtocolIEID = 58 - IDPDUSessionResourceHandoverList ProtocolIEID = 59 - IDPDUSessionResourceListCxtRelCpl ProtocolIEID = 60 - IDPDUSessionResourceListHORqd ProtocolIEID = 61 - IDPDUSessionResourceModifyListModCfm ProtocolIEID = 62 - IDPDUSessionResourceModifyListModInd ProtocolIEID = 63 - IDPDUSessionResourceModifyListModReq ProtocolIEID = 64 - IDPDUSessionResourceModifyListModRes ProtocolIEID = 65 - IDPDUSessionResourceNotifyList ProtocolIEID = 66 - IDPDUSessionResourceReleasedListNot ProtocolIEID = 67 - IDPDUSessionResourceReleasedListPSAck ProtocolIEID = 68 - IDPDUSessionResourceReleasedListPSFail ProtocolIEID = 69 - IDPDUSessionResourceReleasedListRelRes ProtocolIEID = 70 - IDPDUSessionResourceSetupListCxtReq ProtocolIEID = 71 - IDPDUSessionResourceSetupListCxtRes ProtocolIEID = 72 - IDPDUSessionResourceSetupListHOReq ProtocolIEID = 73 - IDPDUSessionResourceSetupListSUReq ProtocolIEID = 74 - IDPDUSessionResourceSetupListSURes ProtocolIEID = 75 - IDPDUSessionResourceToBeSwitchedDLList ProtocolIEID = 76 - IDPDUSessionResourceSwitchedList ProtocolIEID = 77 - IDPDUSessionResourceToReleaseListHOCmd ProtocolIEID = 78 - IDPDUSessionResourceToReleaseListRelCmd ProtocolIEID = 79 - IDPLMNSupportList ProtocolIEID = 80 - IDPWSFailedCellIDList ProtocolIEID = 81 - IDRANNodeName ProtocolIEID = 82 - IDRANPagingPriority ProtocolIEID = 83 - IDRANStatusTransferTransparentContainer ProtocolIEID = 84 - IDRANUENGAPID ProtocolIEID = 85 - IDRelativeAMFCapacity ProtocolIEID = 86 - IDRepetitionPeriod ProtocolIEID = 87 - IDResetType ProtocolIEID = 88 - IDRoutingID ProtocolIEID = 89 - IDRRCEstablishmentCause ProtocolIEID = 90 - IDRRCInactiveTransitionReportRequest ProtocolIEID = 91 - IDRRCState ProtocolIEID = 92 - IDSecurityContext ProtocolIEID = 93 - IDSecurityKey ProtocolIEID = 94 - IDSerialNumber ProtocolIEID = 95 - IDServedGUAMIList ProtocolIEID = 96 - IDSliceSupportList ProtocolIEID = 97 - IDSONConfigurationTransferDL ProtocolIEID = 98 - IDSONConfigurationTransferUL ProtocolIEID = 99 - IDSourceAMFUENGAPID ProtocolIEID = 100 - IDSourceToTargetTransparentContainer ProtocolIEID = 101 - IDSupportedTAList ProtocolIEID = 102 - IDTAIListForPaging ProtocolIEID = 103 - IDTAIListForRestart ProtocolIEID = 104 - IDTargetID ProtocolIEID = 105 - IDTargetToSourceTransparentContainer ProtocolIEID = 106 - IDTimeToWait ProtocolIEID = 107 - IDTraceActivation ProtocolIEID = 108 - IDTraceCollectionEntityIPAddress ProtocolIEID = 109 - IDUEAggregateMaximumBitRate ProtocolIEID = 110 - IDUEAssociatedLogicalNGConnectionList ProtocolIEID = 111 - IDUEContextRequest ProtocolIEID = 112 - IDUENGAPIDs ProtocolIEID = 114 - IDUEPagingIdentity ProtocolIEID = 115 - IDUEPresenceInAreaOfInterestList ProtocolIEID = 116 - IDUERadioCapability ProtocolIEID = 117 - IDUERadioCapabilityForPaging ProtocolIEID = 118 - IDUESecurityCapabilities ProtocolIEID = 119 - IDUnavailableGUAMIList ProtocolIEID = 120 - IDUserLocationInformation ProtocolIEID = 121 - IDWarningAreaList ProtocolIEID = 122 - IDWarningMessageContents ProtocolIEID = 123 - IDWarningSecurityInfo ProtocolIEID = 124 - IDWarningType ProtocolIEID = 125 - IDAdditionalULNGUUPTNLInformation ProtocolIEID = 126 - IDDataForwardingNotPossible ProtocolIEID = 127 - IDDLNGUUPTNLInformation ProtocolIEID = 128 - IDNetworkInstance ProtocolIEID = 129 - IDPDUSessionAggregateMaximumBitRate ProtocolIEID = 130 - IDPDUSessionResourceFailedToModifyListModCfm ProtocolIEID = 131 - IDPDUSessionResourceFailedToSetupListCxtFail ProtocolIEID = 132 - IDPDUSessionResourceListCxtRelReq ProtocolIEID = 133 - IDPDUSessionType ProtocolIEID = 134 - IDQosFlowAddOrModifyRequestList ProtocolIEID = 135 - IDQosFlowSetupRequestList ProtocolIEID = 136 - IDQosFlowToReleaseList ProtocolIEID = 137 - IDSecurityIndication ProtocolIEID = 138 - IDULNGUUPTNLInformation ProtocolIEID = 139 - IDULNGUUPTNLModifyList ProtocolIEID = 140 - IDWarningAreaCoordinates ProtocolIEID = 141 - IDPDUSessionResourceSecondaryRATUsageList ProtocolIEID = 142 - IDHandoverFlag ProtocolIEID = 143 - IDSecondaryRATUsageInformation ProtocolIEID = 144 - IDPDUSessionResourceReleaseResponseTransfer ProtocolIEID = 145 - IDRedirectionVoiceFallback ProtocolIEID = 146 - IDUERetentionInformation ProtocolIEID = 147 - IDSNSSAI ProtocolIEID = 148 - IDPSCellInformation ProtocolIEID = 149 - IDLastEUTRANPLMNIdentity ProtocolIEID = 150 - IDMaximumIntegrityProtectedDataRateDL ProtocolIEID = 151 - IDAdditionalDLForwardingUPTNLInformation ProtocolIEID = 152 - IDAdditionalDLUPTNLInformationForHOList ProtocolIEID = 153 - IDAdditionalNGUUPTNLInformation ProtocolIEID = 154 - IDAdditionalDLQosFlowPerTNLInformation ProtocolIEID = 155 - IDSecurityResult ProtocolIEID = 156 - IDENDCSONConfigurationTransferDL ProtocolIEID = 157 - IDENDCSONConfigurationTransferUL ProtocolIEID = 158 - IDNewGUAMI ProtocolIEID = 162 - IDCNAssistedRANTuning ProtocolIEID = 165 - IDCommonNetworkInstance ProtocolIEID = 166 - IDNGRANTNLAssociationToRemoveList ProtocolIEID = 167 - IDTNLAssociationTransportLayerAddressNGRAN ProtocolIEID = 168 - IDEndpointIPAddressAndPort ProtocolIEID = 169 - IDSourceToTargetAMFInformationReroute ProtocolIEID = 171 - IDSelectedPLMNIdentity ProtocolIEID = 174 - IDGUAMIType ProtocolIEID = 176 - IDSRVCCOperationPossible ProtocolIEID = 177 - IDAdditionalRedundantULNGUUPTNLInformation ProtocolIEID = 186 - IDRedundantCommonNetworkInstance ProtocolIEID = 190 - IDRedundantULNGUUPTNLInformation ProtocolIEID = 195 - IDRedundantPDUSessionInformation ProtocolIEID = 197 - IDIABAuthorized ProtocolIEID = 199 - IDIABSupported ProtocolIEID = 200 - IDIABNodeIndication ProtocolIEID = 201 - IDNBIoTPagingDRX ProtocolIEID = 202 - IDNBIoTPagingeDRXInfo ProtocolIEID = 203 - IDNBIoTDefaultPagingDRX ProtocolIEID = 204 - IDEnhancedCoverageRestriction ProtocolIEID = 205 - IDExtendedConnectedTime ProtocolIEID = 206 - IDPagingAssisDataforCEcapabUE ProtocolIEID = 207 - IDWUSAssistanceInformation ProtocolIEID = 208 - IDUEDifferentiationInfo ProtocolIEID = 209 - IDLTEV2XServicesAuthorized ProtocolIEID = 215 - IDNRV2XServicesAuthorized ProtocolIEID = 216 - IDLTEUESidelinkAggregateMaximumBitrate ProtocolIEID = 217 - IDNRUESidelinkAggregateMaximumBitrate ProtocolIEID = 218 - IDPC5QoSParameters ProtocolIEID = 219 - IDCEmodeBrestricted ProtocolIEID = 222 - IDEUTRAPagingeDRXInformation ProtocolIEID = 223 - IDCEmodeBSupportIndicator ProtocolIEID = 224 - IDLTEMIndication ProtocolIEID = 225 - IDEndIndication ProtocolIEID = 226 - IDEDTSession ProtocolIEID = 227 - IDUECapabilityInfoRequest ProtocolIEID = 228 - IDUEUPCIoTSupport ProtocolIEID = 234 - IDRRCResumeCause ProtocolIEID = 237 - IDRGLevelWirelineAccessCharacteristics ProtocolIEID = 238 - IDWAGFIdentityInformation ProtocolIEID = 239 - IDAuthenticatedIndication ProtocolIEID = 245 - IDTNGFIdentityInformation ProtocolIEID = 246 - IDTWIFIdentityInformation ProtocolIEID = 247 - IDIntersystemSONConfigurationTransferDL ProtocolIEID = 250 - IDIntersystemSONConfigurationTransferUL ProtocolIEID = 251 - IDManagementBasedMDTPLMNList ProtocolIEID = 254 - IDNPNSupport ProtocolIEID = 258 - IDNPNAccessInformation ProtocolIEID = 259 - IDTargettoSourceFailureTransparentContainer ProtocolIEID = 262 - IDUERadioCapabilityID ProtocolIEID = 264 - IDUERadioCapabilityEUTRAFormat ProtocolIEID = 265 - IDNotifySourceNGRANNode ProtocolIEID = 269 - IDExtendedSliceSupportList ProtocolIEID = 270 - IDExtendedRANNodeName ProtocolIEID = 273 - IDExtendedAMFName ProtocolIEID = 274 - IDMBSSessionToReleaseList ProtocolIEID = 317 - IDMBSSessionSetupRequestList ProtocolIEID = 318 - IDMBSSessionSetuporModifyRequestList ProtocolIEID = 319 - IDOnboardingSupport ProtocolIEID = 325 - IDTimeSyncAssistanceInfo ProtocolIEID = 326 - IDQMCConfigInfo ProtocolIEID = 328 - IDQMCDeactivation ProtocolIEID = 329 - IDNRPagingeDRXInformation ProtocolIEID = 332 - IDRedCapIndication ProtocolIEID = 333 - IDTargetNSSAIInformation ProtocolIEID = 334 - IDUESliceMaximumBitRateList ProtocolIEID = 335 - IDPagingCause ProtocolIEID = 342 - IDPEIPSassistanceInformation ProtocolIEID = 344 - IDFiveGProSeAuthorized ProtocolIEID = 345 - IDFiveGProSeUEPC5AggregateMaximumBitRate ProtocolIEID = 346 - IDFiveGProSePC5QoSParameters ProtocolIEID = 347 - IDManagementBasedMDTPLMNModificationList ProtocolIEID = 359 - IDNetworkControlledRepeaterAuthorized ProtocolIEID = 367 - IDSelectedNID ProtocolIEID = 371 - IDAerialUEsubscriptionInformation ProtocolIEID = 373 - IDNRA2XServicesAuthorized ProtocolIEID = 374 - IDLTEA2XServicesAuthorized ProtocolIEID = 375 - IDNRA2XUEPC5AggregateMaximumBitRate ProtocolIEID = 376 - IDLTEA2XUEPC5AggregateMaximumBitRate ProtocolIEID = 377 - IDA2XPC5QoSParameters ProtocolIEID = 378 - IDDownlinkTLContainer ProtocolIEID = 394 - IDMobileIABAuthorized ProtocolIEID = 400 - IDMobileIABNodeIndication ProtocolIEID = 402 - IDNoPDUSessionIndication ProtocolIEID = 403 - IDMobileIABSupported ProtocolIEID = 404 - IDPartiallyAllowedNSSAI ProtocolIEID = 414 - IDERedCapIndication ProtocolIEID = 427 - IDXrDeviceWith2Rx ProtocolIEID = 428 - IDSLPositioningRangingServiceInfo ProtocolIEID = 430 - IDUserPlaneFailureIndication ProtocolIEID = 435 - IDAUN3DeviceAccessInfo ProtocolIEID = 440 - IDExtendedBackupAMFName ProtocolIEID = 442 - IDExtendedOldAMF ProtocolIEID = 443 - IDAMFUENGAPID2 ProtocolIEID = 450 - IDGUAMIList ProtocolIEID = 451 - IDGWContextReleaseIndication ProtocolIEID = 452 - IDSourceAMFGUAMI ProtocolIEID = 453 - IDRequestedNSSAI ProtocolIEID = 454 - IDTargetRANNodeID ProtocolIEID = 455 - IDAIOTFIdentifier ProtocolIEID = 467 - IDAIoTSupport ProtocolIEID = 475 - IDAIOTFName ProtocolIEID = 476 - IDLPWUSPSAssistanceInformation ProtocolIEID = 477 - IDAdditionalULI ProtocolIEID = 483 - IDLPWUSDisableIndication ProtocolIEID = 495 + IDAllowedNSSAI ProtocolIEID = 0 + IDAMFName ProtocolIEID = 1 + IDAMFOverloadResponse ProtocolIEID = 2 + IDAMFSetID ProtocolIEID = 3 + IDAMFTNLAssociationFailedToSetupList ProtocolIEID = 4 + IDAMFTNLAssociationSetupList ProtocolIEID = 5 + IDAMFTNLAssociationToAddList ProtocolIEID = 6 + IDAMFTNLAssociationToRemoveList ProtocolIEID = 7 + IDAMFTNLAssociationToUpdateList ProtocolIEID = 8 + IDAMFTrafficLoadReductionIndication ProtocolIEID = 9 + IDAMFUENGAPID ProtocolIEID = 10 + IDAssistanceDataForPaging ProtocolIEID = 11 + IDBroadcastCancelledAreaList ProtocolIEID = 12 + IDBroadcastCompletedAreaList ProtocolIEID = 13 + IDCancelAllWarningMessages ProtocolIEID = 14 + IDCause ProtocolIEID = 15 + IDCellIDListForRestart ProtocolIEID = 16 + IDConcurrentWarningMessageInd ProtocolIEID = 17 + IDCoreNetworkAssistanceInformationForInactive ProtocolIEID = 18 + IDCriticalityDiagnostics ProtocolIEID = 19 + IDDataCodingScheme ProtocolIEID = 20 + IDDefaultPagingDRX ProtocolIEID = 21 + IDDirectForwardingPathAvailability ProtocolIEID = 22 + IDEmergencyAreaIDListForRestart ProtocolIEID = 23 + IDEmergencyFallbackIndicator ProtocolIEID = 24 + IDEUTRACGI ProtocolIEID = 25 + IDFiveGSTMSI ProtocolIEID = 26 + IDGlobalRANNodeID ProtocolIEID = 27 + IDGUAMI ProtocolIEID = 28 + IDHandoverType ProtocolIEID = 29 + IDIMSVoiceSupportIndicator ProtocolIEID = 30 + IDIndexToRFSP ProtocolIEID = 31 + IDInfoOnRecommendedCellsAndRANNodesForPaging ProtocolIEID = 32 + IDLocationReportingRequestType ProtocolIEID = 33 + IDMaskedIMEISV ProtocolIEID = 34 + IDMessageIdentifier ProtocolIEID = 35 + IDMobilityRestrictionList ProtocolIEID = 36 + IDNASC ProtocolIEID = 37 + IDNASPDU ProtocolIEID = 38 + IDNASSecurityParametersFromNGRAN ProtocolIEID = 39 + IDNewAMFUENGAPID ProtocolIEID = 40 + IDNewSecurityContextInd ProtocolIEID = 41 + IDNGAPMessage ProtocolIEID = 42 + IDNGRANCGI ProtocolIEID = 43 + IDNGRANTraceID ProtocolIEID = 44 + IDNRCGI ProtocolIEID = 45 + IDNRPPaPDU ProtocolIEID = 46 + IDNumberOfBroadcastsRequested ProtocolIEID = 47 + IDOldAMF ProtocolIEID = 48 + IDOverloadStartNSSAIList ProtocolIEID = 49 + IDPagingDRX ProtocolIEID = 50 + IDPagingOrigin ProtocolIEID = 51 + IDPagingPriority ProtocolIEID = 52 + IDPDUSessionResourceAdmittedList ProtocolIEID = 53 + IDPDUSessionResourceFailedToModifyListModRes ProtocolIEID = 54 + IDPDUSessionResourceFailedToSetupListCxtRes ProtocolIEID = 55 + IDPDUSessionResourceFailedToSetupListHOAck ProtocolIEID = 56 + IDPDUSessionResourceFailedToSetupListPSReq ProtocolIEID = 57 + IDPDUSessionResourceFailedToSetupListSURes ProtocolIEID = 58 + IDPDUSessionResourceHandoverList ProtocolIEID = 59 + IDPDUSessionResourceListCxtRelCpl ProtocolIEID = 60 + IDPDUSessionResourceListHORqd ProtocolIEID = 61 + IDPDUSessionResourceModifyListModCfm ProtocolIEID = 62 + IDPDUSessionResourceModifyListModInd ProtocolIEID = 63 + IDPDUSessionResourceModifyListModReq ProtocolIEID = 64 + IDPDUSessionResourceModifyListModRes ProtocolIEID = 65 + IDPDUSessionResourceNotifyList ProtocolIEID = 66 + IDPDUSessionResourceReleasedListNot ProtocolIEID = 67 + IDPDUSessionResourceReleasedListPSAck ProtocolIEID = 68 + IDPDUSessionResourceReleasedListPSFail ProtocolIEID = 69 + IDPDUSessionResourceReleasedListRelRes ProtocolIEID = 70 + IDPDUSessionResourceSetupListCxtReq ProtocolIEID = 71 + IDPDUSessionResourceSetupListCxtRes ProtocolIEID = 72 + IDPDUSessionResourceSetupListHOReq ProtocolIEID = 73 + IDPDUSessionResourceSetupListSUReq ProtocolIEID = 74 + IDPDUSessionResourceSetupListSURes ProtocolIEID = 75 + IDPDUSessionResourceToBeSwitchedDLList ProtocolIEID = 76 + IDPDUSessionResourceSwitchedList ProtocolIEID = 77 + IDPDUSessionResourceToReleaseListHOCmd ProtocolIEID = 78 + IDPDUSessionResourceToReleaseListRelCmd ProtocolIEID = 79 + IDPLMNSupportList ProtocolIEID = 80 + IDPWSFailedCellIDList ProtocolIEID = 81 + IDRANNodeName ProtocolIEID = 82 + IDRANPagingPriority ProtocolIEID = 83 + IDRANStatusTransferTransparentContainer ProtocolIEID = 84 + IDRANUENGAPID ProtocolIEID = 85 + IDRelativeAMFCapacity ProtocolIEID = 86 + IDRepetitionPeriod ProtocolIEID = 87 + IDResetType ProtocolIEID = 88 + IDRoutingID ProtocolIEID = 89 + IDRRCEstablishmentCause ProtocolIEID = 90 + IDRRCInactiveTransitionReportRequest ProtocolIEID = 91 + IDRRCState ProtocolIEID = 92 + IDSecurityContext ProtocolIEID = 93 + IDSecurityKey ProtocolIEID = 94 + IDSerialNumber ProtocolIEID = 95 + IDServedGUAMIList ProtocolIEID = 96 + IDSliceSupportList ProtocolIEID = 97 + IDSONConfigurationTransferDL ProtocolIEID = 98 + IDSONConfigurationTransferUL ProtocolIEID = 99 + IDSourceAMFUENGAPID ProtocolIEID = 100 + IDSourceToTargetTransparentContainer ProtocolIEID = 101 + IDSupportedTAList ProtocolIEID = 102 + IDTAIListForPaging ProtocolIEID = 103 + IDTAIListForRestart ProtocolIEID = 104 + IDTargetID ProtocolIEID = 105 + IDTargetToSourceTransparentContainer ProtocolIEID = 106 + IDTimeToWait ProtocolIEID = 107 + IDTraceActivation ProtocolIEID = 108 + IDTraceCollectionEntityIPAddress ProtocolIEID = 109 + IDUEAggregateMaximumBitRate ProtocolIEID = 110 + IDUEAssociatedLogicalNGConnectionList ProtocolIEID = 111 + IDUEContextRequest ProtocolIEID = 112 + IDUENGAPIDs ProtocolIEID = 114 + IDUEPagingIdentity ProtocolIEID = 115 + IDUEPresenceInAreaOfInterestList ProtocolIEID = 116 + IDUERadioCapability ProtocolIEID = 117 + IDUERadioCapabilityForPaging ProtocolIEID = 118 + IDUESecurityCapabilities ProtocolIEID = 119 + IDUnavailableGUAMIList ProtocolIEID = 120 + IDUserLocationInformation ProtocolIEID = 121 + IDWarningAreaList ProtocolIEID = 122 + IDWarningMessageContents ProtocolIEID = 123 + IDWarningSecurityInfo ProtocolIEID = 124 + IDWarningType ProtocolIEID = 125 + IDAdditionalULNGUUPTNLInformation ProtocolIEID = 126 + IDDataForwardingNotPossible ProtocolIEID = 127 + IDDLNGUUPTNLInformation ProtocolIEID = 128 + IDNetworkInstance ProtocolIEID = 129 + IDPDUSessionAggregateMaximumBitRate ProtocolIEID = 130 + IDPDUSessionResourceFailedToModifyListModCfm ProtocolIEID = 131 + IDPDUSessionResourceFailedToSetupListCxtFail ProtocolIEID = 132 + IDPDUSessionResourceListCxtRelReq ProtocolIEID = 133 + IDPDUSessionType ProtocolIEID = 134 + IDQosFlowAddOrModifyRequestList ProtocolIEID = 135 + IDQosFlowSetupRequestList ProtocolIEID = 136 + IDQosFlowToReleaseList ProtocolIEID = 137 + IDSecurityIndication ProtocolIEID = 138 + IDULNGUUPTNLInformation ProtocolIEID = 139 + IDULNGUUPTNLModifyList ProtocolIEID = 140 + IDWarningAreaCoordinates ProtocolIEID = 141 + IDPDUSessionResourceSecondaryRATUsageList ProtocolIEID = 142 + IDHandoverFlag ProtocolIEID = 143 + IDSecondaryRATUsageInformation ProtocolIEID = 144 + IDPDUSessionResourceReleaseResponseTransfer ProtocolIEID = 145 + IDRedirectionVoiceFallback ProtocolIEID = 146 + IDUERetentionInformation ProtocolIEID = 147 + IDSNSSAI ProtocolIEID = 148 + IDPSCellInformation ProtocolIEID = 149 + IDLastEUTRANPLMNIdentity ProtocolIEID = 150 + IDMaximumIntegrityProtectedDataRateDL ProtocolIEID = 151 + IDAdditionalDLForwardingUPTNLInformation ProtocolIEID = 152 + IDAdditionalDLUPTNLInformationForHOList ProtocolIEID = 153 + IDAdditionalNGUUPTNLInformation ProtocolIEID = 154 + IDAdditionalDLQosFlowPerTNLInformation ProtocolIEID = 155 + IDSecurityResult ProtocolIEID = 156 + IDENDCSONConfigurationTransferDL ProtocolIEID = 157 + IDENDCSONConfigurationTransferUL ProtocolIEID = 158 + IDNewGUAMI ProtocolIEID = 162 + IDULForwardingUPTNLInformation ProtocolIEID = 164 + IDCNAssistedRANTuning ProtocolIEID = 165 + IDCommonNetworkInstance ProtocolIEID = 166 + IDNGRANTNLAssociationToRemoveList ProtocolIEID = 167 + IDTNLAssociationTransportLayerAddressNGRAN ProtocolIEID = 168 + IDEndpointIPAddressAndPort ProtocolIEID = 169 + IDSourceToTargetAMFInformationReroute ProtocolIEID = 171 + IDAdditionalULForwardingUPTNLInformation ProtocolIEID = 172 + IDSelectedPLMNIdentity ProtocolIEID = 174 + IDGUAMIType ProtocolIEID = 176 + IDSRVCCOperationPossible ProtocolIEID = 177 + IDAdditionalRedundantDLNGUUPTNLInformation ProtocolIEID = 183 + IDAdditionalRedundantDLQosFlowPerTNLInformation ProtocolIEID = 184 + IDAdditionalRedundantNGUUPTNLInformation ProtocolIEID = 185 + IDAdditionalRedundantULNGUUPTNLInformation ProtocolIEID = 186 + IDRedundantCommonNetworkInstance ProtocolIEID = 190 + IDRedundantDLNGUTNLInformationReused ProtocolIEID = 191 + IDRedundantDLNGUUPTNLInformation ProtocolIEID = 192 + IDRedundantDLQosFlowPerTNLInformation ProtocolIEID = 193 + IDRedundantULNGUUPTNLInformation ProtocolIEID = 195 + IDRedundantPDUSessionInformation ProtocolIEID = 197 + IDIABAuthorized ProtocolIEID = 199 + IDIABSupported ProtocolIEID = 200 + IDIABNodeIndication ProtocolIEID = 201 + IDNBIoTPagingDRX ProtocolIEID = 202 + IDNBIoTPagingeDRXInfo ProtocolIEID = 203 + IDNBIoTDefaultPagingDRX ProtocolIEID = 204 + IDEnhancedCoverageRestriction ProtocolIEID = 205 + IDExtendedConnectedTime ProtocolIEID = 206 + IDPagingAssisDataforCEcapabUE ProtocolIEID = 207 + IDWUSAssistanceInformation ProtocolIEID = 208 + IDUEDifferentiationInfo ProtocolIEID = 209 + IDLTEV2XServicesAuthorized ProtocolIEID = 215 + IDNRV2XServicesAuthorized ProtocolIEID = 216 + IDLTEUESidelinkAggregateMaximumBitrate ProtocolIEID = 217 + IDNRUESidelinkAggregateMaximumBitrate ProtocolIEID = 218 + IDPC5QoSParameters ProtocolIEID = 219 + IDCEmodeBrestricted ProtocolIEID = 222 + IDEUTRAPagingeDRXInformation ProtocolIEID = 223 + IDCEmodeBSupportIndicator ProtocolIEID = 224 + IDLTEMIndication ProtocolIEID = 225 + IDEndIndication ProtocolIEID = 226 + IDEDTSession ProtocolIEID = 227 + IDUECapabilityInfoRequest ProtocolIEID = 228 + IDUEUPCIoTSupport ProtocolIEID = 234 + IDRRCResumeCause ProtocolIEID = 237 + IDRGLevelWirelineAccessCharacteristics ProtocolIEID = 238 + IDWAGFIdentityInformation ProtocolIEID = 239 + IDAuthenticatedIndication ProtocolIEID = 245 + IDTNGFIdentityInformation ProtocolIEID = 246 + IDTWIFIdentityInformation ProtocolIEID = 247 + IDDataForwardingResponseERABList ProtocolIEID = 249 + IDIntersystemSONConfigurationTransferDL ProtocolIEID = 250 + IDIntersystemSONConfigurationTransferUL ProtocolIEID = 251 + IDManagementBasedMDTPLMNList ProtocolIEID = 254 + IDNPNSupport ProtocolIEID = 258 + IDNPNAccessInformation ProtocolIEID = 259 + IDTargettoSourceFailureTransparentContainer ProtocolIEID = 262 + IDUERadioCapabilityID ProtocolIEID = 264 + IDUERadioCapabilityEUTRAFormat ProtocolIEID = 265 + IDNotifySourceNGRANNode ProtocolIEID = 269 + IDExtendedSliceSupportList ProtocolIEID = 270 + IDExtendedRANNodeName ProtocolIEID = 273 + IDExtendedAMFName ProtocolIEID = 274 + IDMBSSessionToReleaseList ProtocolIEID = 317 + IDMBSSessionSetupRequestList ProtocolIEID = 318 + IDMBSSessionSetuporModifyRequestList ProtocolIEID = 319 + IDOnboardingSupport ProtocolIEID = 325 + IDTimeSyncAssistanceInfo ProtocolIEID = 326 + IDQMCConfigInfo ProtocolIEID = 328 + IDQMCDeactivation ProtocolIEID = 329 + IDNRPagingeDRXInformation ProtocolIEID = 332 + IDRedCapIndication ProtocolIEID = 333 + IDTargetNSSAIInformation ProtocolIEID = 334 + IDUESliceMaximumBitRateList ProtocolIEID = 335 + IDPagingCause ProtocolIEID = 342 + IDPEIPSassistanceInformation ProtocolIEID = 344 + IDFiveGProSeAuthorized ProtocolIEID = 345 + IDFiveGProSeUEPC5AggregateMaximumBitRate ProtocolIEID = 346 + IDFiveGProSePC5QoSParameters ProtocolIEID = 347 + IDManagementBasedMDTPLMNModificationList ProtocolIEID = 359 + IDNetworkControlledRepeaterAuthorized ProtocolIEID = 367 + IDSelectedNID ProtocolIEID = 371 + IDAerialUEsubscriptionInformation ProtocolIEID = 373 + IDNRA2XServicesAuthorized ProtocolIEID = 374 + IDLTEA2XServicesAuthorized ProtocolIEID = 375 + IDNRA2XUEPC5AggregateMaximumBitRate ProtocolIEID = 376 + IDLTEA2XUEPC5AggregateMaximumBitRate ProtocolIEID = 377 + IDA2XPC5QoSParameters ProtocolIEID = 378 + IDDownlinkTLContainer ProtocolIEID = 394 + IDMobileIABAuthorized ProtocolIEID = 400 + IDMobileIABNodeIndication ProtocolIEID = 402 + IDNoPDUSessionIndication ProtocolIEID = 403 + IDMobileIABSupported ProtocolIEID = 404 + IDPartiallyAllowedNSSAI ProtocolIEID = 414 + IDERedCapIndication ProtocolIEID = 427 + IDXrDeviceWith2Rx ProtocolIEID = 428 + IDSLPositioningRangingServiceInfo ProtocolIEID = 430 + IDUserPlaneFailureIndication ProtocolIEID = 435 + IDAUN3DeviceAccessInfo ProtocolIEID = 440 + IDExtendedBackupAMFName ProtocolIEID = 442 + IDExtendedOldAMF ProtocolIEID = 443 + IDAMFUENGAPID2 ProtocolIEID = 450 + IDGUAMIList ProtocolIEID = 451 + IDGWContextReleaseIndication ProtocolIEID = 452 + IDSourceAMFGUAMI ProtocolIEID = 453 + IDRequestedNSSAI ProtocolIEID = 454 + IDTargetRANNodeID ProtocolIEID = 455 + IDAIOTFIdentifier ProtocolIEID = 467 + IDAIoTSupport ProtocolIEID = 475 + IDAIOTFName ProtocolIEID = 476 + IDLPWUSPSAssistanceInformation ProtocolIEID = 477 + IDAdditionalULI ProtocolIEID = 483 + IDLPWUSDisableIndication ProtocolIEID = 495 ) diff --git a/ngap/ie_names.go b/ngap/ie_names.go index 1ce55ba8a2..cfa9e4e236 100644 --- a/ngap/ie_names.go +++ b/ngap/ie_names.go @@ -13,270 +13,279 @@ import "fmt" // System (TS 38.413 §8.9), and its "key" pattern against SecurityKey, which // names the IE carrying the key, never a key value. var protocolIENames = map[ProtocolIEID]string{ - IDAllowedNSSAI: "AllowedNSSAI", - IDAMFName: "AMFName", - IDAMFOverloadResponse: "AMFOverloadResponse", - IDAMFSetID: "AMFSetID", - IDAMFTNLAssociationFailedToSetupList: "AMF-TNLAssociationFailedToSetupList", - IDAMFTNLAssociationSetupList: "AMF-TNLAssociationSetupList", - IDAMFTNLAssociationToAddList: "AMF-TNLAssociationToAddList", - IDAMFTNLAssociationToRemoveList: "AMF-TNLAssociationToRemoveList", - IDAMFTNLAssociationToUpdateList: "AMF-TNLAssociationToUpdateList", - IDAMFTrafficLoadReductionIndication: "AMFTrafficLoadReductionIndication", - IDAMFUENGAPID: "AMF-UE-NGAP-ID", - IDAssistanceDataForPaging: "AssistanceDataForPaging", - IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", - IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", - IDCancelAllWarningMessages: "CancelAllWarningMessages", - IDCause: "Cause", - IDCellIDListForRestart: "CellIDListForRestart", - IDConcurrentWarningMessageInd: "ConcurrentWarningMessageInd", - IDCoreNetworkAssistanceInformationForInactive: "CoreNetworkAssistanceInformationForInactive", - IDCriticalityDiagnostics: "CriticalityDiagnostics", - IDDataCodingScheme: "DataCodingScheme", - IDDefaultPagingDRX: "DefaultPagingDRX", - IDDirectForwardingPathAvailability: "DirectForwardingPathAvailability", - IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", - IDEmergencyFallbackIndicator: "EmergencyFallbackIndicator", - IDEUTRACGI: "EUTRA-CGI", - IDFiveGSTMSI: "FiveG-S-TMSI", - IDGlobalRANNodeID: "GlobalRANNodeID", - IDGUAMI: "GUAMI", - IDHandoverType: "HandoverType", - IDIMSVoiceSupportIndicator: "IMSVoiceSupportIndicator", - IDIndexToRFSP: "IndexToRFSP", - IDInfoOnRecommendedCellsAndRANNodesForPaging: "InfoOnRecommendedCellsAndRANNodesForPaging", - IDLocationReportingRequestType: "LocationReportingRequestType", - IDMaskedIMEISV: "MaskedIMEISV", - IDMessageIdentifier: "MessageIdentifier", - IDMobilityRestrictionList: "MobilityRestrictionList", - IDNASC: "NASC", - IDNASPDU: "NAS-PDU", - IDNASSecurityParametersFromNGRAN: "NASSecurityParametersFromNGRAN", - IDNewAMFUENGAPID: "NewAMF-UE-NGAP-ID", - IDNewSecurityContextInd: "NewSecurityContextInd", - IDNGAPMessage: "NGAP-Message", - IDNGRANCGI: "NGRAN-CGI", - IDNGRANTraceID: "NGRANTraceID", - IDNRCGI: "NR-CGI", - IDNRPPaPDU: "NRPPa-PDU", - IDNumberOfBroadcastsRequested: "NumberOfBroadcastsRequested", - IDOldAMF: "OldAMF", - IDOverloadStartNSSAIList: "OverloadStartNSSAIList", - IDPagingDRX: "PagingDRX", - IDPagingOrigin: "PagingOrigin", - IDPagingPriority: "PagingPriority", - IDPDUSessionResourceAdmittedList: "PDUSessionResourceAdmittedList", - IDPDUSessionResourceFailedToModifyListModRes: "PDUSessionResourceFailedToModifyListModRes", - IDPDUSessionResourceFailedToSetupListCxtRes: "PDUSessionResourceFailedToSetupListCxtRes", - IDPDUSessionResourceFailedToSetupListHOAck: "PDUSessionResourceFailedToSetupListHOAck", - IDPDUSessionResourceFailedToSetupListPSReq: "PDUSessionResourceFailedToSetupListPSReq", - IDPDUSessionResourceFailedToSetupListSURes: "PDUSessionResourceFailedToSetupListSURes", - IDPDUSessionResourceHandoverList: "PDUSessionResourceHandoverList", - IDPDUSessionResourceListCxtRelCpl: "PDUSessionResourceListCxtRelCpl", - IDPDUSessionResourceListHORqd: "PDUSessionResourceListHORqd", - IDPDUSessionResourceModifyListModCfm: "PDUSessionResourceModifyListModCfm", - IDPDUSessionResourceModifyListModInd: "PDUSessionResourceModifyListModInd", - IDPDUSessionResourceModifyListModReq: "PDUSessionResourceModifyListModReq", - IDPDUSessionResourceModifyListModRes: "PDUSessionResourceModifyListModRes", - IDPDUSessionResourceNotifyList: "PDUSessionResourceNotifyList", - IDPDUSessionResourceReleasedListNot: "PDUSessionResourceReleasedListNot", - IDPDUSessionResourceReleasedListPSAck: "PDUSessionResourceReleasedListPSAck", - IDPDUSessionResourceReleasedListPSFail: "PDUSessionResourceReleasedListPSFail", - IDPDUSessionResourceReleasedListRelRes: "PDUSessionResourceReleasedListRelRes", - IDPDUSessionResourceSetupListCxtReq: "PDUSessionResourceSetupListCxtReq", - IDPDUSessionResourceSetupListCxtRes: "PDUSessionResourceSetupListCxtRes", - IDPDUSessionResourceSetupListHOReq: "PDUSessionResourceSetupListHOReq", - IDPDUSessionResourceSetupListSUReq: "PDUSessionResourceSetupListSUReq", - IDPDUSessionResourceSetupListSURes: "PDUSessionResourceSetupListSURes", - IDPDUSessionResourceToBeSwitchedDLList: "PDUSessionResourceToBeSwitchedDLList", - IDPDUSessionResourceSwitchedList: "PDUSessionResourceSwitchedList", - IDPDUSessionResourceToReleaseListHOCmd: "PDUSessionResourceToReleaseListHOCmd", - IDPDUSessionResourceToReleaseListRelCmd: "PDUSessionResourceToReleaseListRelCmd", - IDPLMNSupportList: "PLMNSupportList", - IDPWSFailedCellIDList: "PWSFailedCellIDList", - IDRANNodeName: "RANNodeName", - IDRANPagingPriority: "RANPagingPriority", - IDRANStatusTransferTransparentContainer: "RANStatusTransfer-TransparentContainer", - IDRANUENGAPID: "RAN-UE-NGAP-ID", - IDRelativeAMFCapacity: "RelativeAMFCapacity", - IDRepetitionPeriod: "RepetitionPeriod", - IDResetType: "ResetType", - IDRoutingID: "RoutingID", - IDRRCEstablishmentCause: "RRCEstablishmentCause", - IDRRCInactiveTransitionReportRequest: "RRCInactiveTransitionReportRequest", - IDRRCState: "RRCState", - IDSecurityContext: "SecurityContext", - IDSecurityKey: "SecurityKey", - IDSerialNumber: "SerialNumber", - IDServedGUAMIList: "ServedGUAMIList", - IDSliceSupportList: "SliceSupportList", - IDSONConfigurationTransferDL: "SONConfigurationTransferDL", - IDSONConfigurationTransferUL: "SONConfigurationTransferUL", - IDSourceAMFUENGAPID: "SourceAMF-UE-NGAP-ID", - IDSourceToTargetTransparentContainer: "SourceToTarget-TransparentContainer", - IDSupportedTAList: "SupportedTAList", - IDTAIListForPaging: "TAIListForPaging", - IDTAIListForRestart: "TAIListForRestart", - IDTargetID: "TargetID", - IDTargetToSourceTransparentContainer: "TargetToSource-TransparentContainer", - IDTimeToWait: "TimeToWait", - IDTraceActivation: "TraceActivation", - IDTraceCollectionEntityIPAddress: "TraceCollectionEntityIPAddress", - IDUEAggregateMaximumBitRate: "UEAggregateMaximumBitRate", - IDUEAssociatedLogicalNGConnectionList: "UE-associatedLogicalNG-connectionList", - IDUEContextRequest: "UEContextRequest", - IDUENGAPIDs: "UE-NGAP-IDs", - IDUEPagingIdentity: "UEPagingIdentity", - IDUEPresenceInAreaOfInterestList: "UEPresenceInAreaOfInterestList", - IDUERadioCapability: "UERadioCapability", - IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", - IDUESecurityCapabilities: "UESecurityCapabilities", - IDUnavailableGUAMIList: "UnavailableGUAMIList", - IDUserLocationInformation: "UserLocationInformation", - IDWarningAreaList: "WarningAreaList", - IDWarningMessageContents: "WarningMessageContents", - IDWarningSecurityInfo: "WarningSecurityInfo", - IDWarningType: "WarningType", - IDAdditionalULNGUUPTNLInformation: "AdditionalUL-NGU-UP-TNLInformation", - IDDataForwardingNotPossible: "DataForwardingNotPossible", - IDDLNGUUPTNLInformation: "DL-NGU-UP-TNLInformation", - IDNetworkInstance: "NetworkInstance", - IDPDUSessionAggregateMaximumBitRate: "PDUSessionAggregateMaximumBitRate", - IDPDUSessionResourceFailedToModifyListModCfm: "PDUSessionResourceFailedToModifyListModCfm", - IDPDUSessionResourceFailedToSetupListCxtFail: "PDUSessionResourceFailedToSetupListCxtFail", - IDPDUSessionResourceListCxtRelReq: "PDUSessionResourceListCxtRelReq", - IDPDUSessionType: "PDUSessionType", - IDQosFlowAddOrModifyRequestList: "QosFlowAddOrModifyRequestList", - IDQosFlowSetupRequestList: "QosFlowSetupRequestList", - IDQosFlowToReleaseList: "QosFlowToReleaseList", - IDSecurityIndication: "SecurityIndication", - IDULNGUUPTNLInformation: "UL-NGU-UP-TNLInformation", - IDULNGUUPTNLModifyList: "UL-NGU-UP-TNLModifyList", - IDWarningAreaCoordinates: "WarningAreaCoordinates", - IDPDUSessionResourceSecondaryRATUsageList: "PDUSessionResourceSecondaryRATUsageList", - IDHandoverFlag: "HandoverFlag", - IDSecondaryRATUsageInformation: "SecondaryRATUsageInformation", - IDPDUSessionResourceReleaseResponseTransfer: "PDUSessionResourceReleaseResponseTransfer", - IDRedirectionVoiceFallback: "RedirectionVoiceFallback", - IDUERetentionInformation: "UERetentionInformation", - IDSNSSAI: "S-NSSAI", - IDPSCellInformation: "PSCellInformation", - IDLastEUTRANPLMNIdentity: "LastEUTRAN-PLMNIdentity", - IDMaximumIntegrityProtectedDataRateDL: "MaximumIntegrityProtectedDataRate-DL", - IDAdditionalDLForwardingUPTNLInformation: "AdditionalDLForwardingUPTNLInformation", - IDAdditionalDLUPTNLInformationForHOList: "AdditionalDLUPTNLInformationForHOList", - IDAdditionalNGUUPTNLInformation: "AdditionalNGU-UP-TNLInformation", - IDAdditionalDLQosFlowPerTNLInformation: "AdditionalDLQosFlowPerTNLInformation", - IDSecurityResult: "SecurityResult", - IDENDCSONConfigurationTransferDL: "ENDC-SONConfigurationTransferDL", - IDENDCSONConfigurationTransferUL: "ENDC-SONConfigurationTransferUL", - IDNewGUAMI: "NewGUAMI", - IDCNAssistedRANTuning: "CNAssistedRANTuning", - IDCommonNetworkInstance: "CommonNetworkInstance", - IDNGRANTNLAssociationToRemoveList: "NGRAN-TNLAssociationToRemoveList", - IDTNLAssociationTransportLayerAddressNGRAN: "TNLAssociationTransportLayerAddressNGRAN", - IDEndpointIPAddressAndPort: "EndpointIPAddressAndPort", - IDSourceToTargetAMFInformationReroute: "SourceToTarget-AMFInformationReroute", - IDSelectedPLMNIdentity: "SelectedPLMNIdentity", - IDGUAMIType: "GUAMIType", - IDSRVCCOperationPossible: "SRVCCOperationPossible", - IDAdditionalRedundantULNGUUPTNLInformation: "AdditionalRedundantUL-NGU-UP-TNLInformation", - IDRedundantCommonNetworkInstance: "RedundantCommonNetworkInstance", - IDRedundantULNGUUPTNLInformation: "RedundantUL-NGU-UP-TNLInformation", - IDRedundantPDUSessionInformation: "RedundantPDUSessionInformation", - IDIABAuthorized: "IAB-Authorized", - IDIABSupported: "IAB-Supported", - IDIABNodeIndication: "IABNodeIndication", - IDNBIoTPagingDRX: "NB-IoT-PagingDRX", - IDNBIoTPagingeDRXInfo: "NB-IoT-Paging-eDRXInfo", - IDNBIoTDefaultPagingDRX: "NB-IoT-DefaultPagingDRX", - IDEnhancedCoverageRestriction: "Enhanced-CoverageRestriction", - IDExtendedConnectedTime: "Extended-ConnectedTime", - IDPagingAssisDataforCEcapabUE: "PagingAssisDataforCEcapabUE", - IDWUSAssistanceInformation: "WUS-Assistance-Information", - IDUEDifferentiationInfo: "UE-DifferentiationInfo", - IDLTEV2XServicesAuthorized: "LTEV2XServicesAuthorized", - IDNRV2XServicesAuthorized: "NRV2XServicesAuthorized", - IDLTEUESidelinkAggregateMaximumBitrate: "LTEUESidelinkAggregateMaximumBitrate", - IDNRUESidelinkAggregateMaximumBitrate: "NRUESidelinkAggregateMaximumBitrate", - IDPC5QoSParameters: "PC5QoSParameters", - IDCEmodeBrestricted: "CEmodeBrestricted", - IDEUTRAPagingeDRXInformation: "EUTRA-PagingeDRXInformation", - IDCEmodeBSupportIndicator: "CEmodeBSupport-Indicator", - IDLTEMIndication: "LTEM-Indication", - IDEndIndication: "EndIndication", - IDEDTSession: "EDT-Session", - IDUECapabilityInfoRequest: "UECapabilityInfoRequest", - IDUEUPCIoTSupport: "UE-UP-CIoT-Support", - IDRRCResumeCause: "RRC-Resume-Cause", - IDRGLevelWirelineAccessCharacteristics: "RGLevelWirelineAccessCharacteristics", - IDWAGFIdentityInformation: "W-AGFIdentityInformation", - IDAuthenticatedIndication: "AuthenticatedIndication", - IDTNGFIdentityInformation: "TNGFIdentityInformation", - IDTWIFIdentityInformation: "TWIFIdentityInformation", - IDIntersystemSONConfigurationTransferDL: "IntersystemSONConfigurationTransferDL", - IDIntersystemSONConfigurationTransferUL: "IntersystemSONConfigurationTransferUL", - IDManagementBasedMDTPLMNList: "ManagementBasedMDTPLMNList", - IDNPNSupport: "NPN-Support", - IDNPNAccessInformation: "NPN-AccessInformation", - IDTargettoSourceFailureTransparentContainer: "TargettoSource-Failure-TransparentContainer", - IDUERadioCapabilityID: "UERadioCapabilityID", - IDUERadioCapabilityEUTRAFormat: "UERadioCapability-EUTRA-Format", - IDNotifySourceNGRANNode: "NotifySourceNGRANNode", - IDExtendedSliceSupportList: "ExtendedSliceSupportList", - IDExtendedRANNodeName: "Extended-RANNodeName", - IDExtendedAMFName: "Extended-AMFName", - IDMBSSessionToReleaseList: "MBSSessionToReleaseList", - IDMBSSessionSetupRequestList: "MBSSessionSetupRequestList", - IDMBSSessionSetuporModifyRequestList: "MBSSessionSetuporModifyRequestList", - IDOnboardingSupport: "OnboardingSupport", - IDTimeSyncAssistanceInfo: "TimeSyncAssistanceInfo", - IDQMCConfigInfo: "QMCConfigInfo", - IDQMCDeactivation: "QMCDeactivation", - IDNRPagingeDRXInformation: "NR-PagingeDRXInformation", - IDRedCapIndication: "RedCapIndication", - IDTargetNSSAIInformation: "TargetNSSAIInformation", - IDUESliceMaximumBitRateList: "UESliceMaximumBitRateList", - IDPagingCause: "PagingCause", - IDPEIPSassistanceInformation: "PEIPSassistanceInformation", - IDFiveGProSeAuthorized: "FiveG-ProSeAuthorized", - IDFiveGProSeUEPC5AggregateMaximumBitRate: "FiveG-ProSeUEPC5AggregateMaximumBitRate", - IDFiveGProSePC5QoSParameters: "FiveG-ProSePC5QoSParameters", - IDManagementBasedMDTPLMNModificationList: "ManagementBasedMDTPLMNModificationList", - IDNetworkControlledRepeaterAuthorized: "NetworkControlledRepeaterAuthorized", - IDSelectedNID: "SelectedNID", - IDAerialUEsubscriptionInformation: "AerialUEsubscriptionInformation", - IDNRA2XServicesAuthorized: "NR-A2X-ServicesAuthorized", - IDLTEA2XServicesAuthorized: "LTE-A2X-ServicesAuthorized", - IDNRA2XUEPC5AggregateMaximumBitRate: "NR-A2X-UE-PC5-AggregateMaximumBitRate", - IDLTEA2XUEPC5AggregateMaximumBitRate: "LTE-A2X-UE-PC5-AggregateMaximumBitRate", - IDA2XPC5QoSParameters: "A2X-PC5-QoS-Parameters", - IDDownlinkTLContainer: "DownlinkTLContainer", - IDMobileIABAuthorized: "MobileIAB-Authorized", - IDMobileIABNodeIndication: "MobileIABNodeIndication", - IDNoPDUSessionIndication: "NoPDUSessionIndication", - IDMobileIABSupported: "MobileIAB-Supported", - IDPartiallyAllowedNSSAI: "Partially-Allowed-NSSAI", - IDERedCapIndication: "ERedCapIndication", - IDXrDeviceWith2Rx: "XrDeviceWith2Rx", - IDSLPositioningRangingServiceInfo: "SLPositioningRangingServiceInfo", - IDUserPlaneFailureIndication: "UserPlaneFailureIndication", - IDAUN3DeviceAccessInfo: "AUN3DeviceAccessInfo", - IDExtendedBackupAMFName: "ExtendedBackupAMFName", - IDExtendedOldAMF: "ExtendedOldAMF", - IDAMFUENGAPID2: "AMF-UE-NGAP-ID2", - IDGUAMIList: "GUAMIList", - IDGWContextReleaseIndication: "GW-Context-Release-Indication", - IDSourceAMFGUAMI: "SourceAMF-GUAMI", - IDRequestedNSSAI: "RequestedNSSAI", - IDTargetRANNodeID: "Target-RAN-Node-ID", - IDAIOTFIdentifier: "AIOTFIdentifier", - IDAIoTSupport: "AIoT-Support", - IDAIOTFName: "AIOTFName", - IDLPWUSPSAssistanceInformation: "LPWUSPSAssistanceInformation", - IDAdditionalULI: "AdditionalULI", - IDLPWUSDisableIndication: "LPWUSDisableIndication", + IDAllowedNSSAI: "AllowedNSSAI", + IDAMFName: "AMFName", + IDAMFOverloadResponse: "AMFOverloadResponse", + IDAMFSetID: "AMFSetID", + IDAMFTNLAssociationFailedToSetupList: "AMF-TNLAssociationFailedToSetupList", + IDAMFTNLAssociationSetupList: "AMF-TNLAssociationSetupList", + IDAMFTNLAssociationToAddList: "AMF-TNLAssociationToAddList", + IDAMFTNLAssociationToRemoveList: "AMF-TNLAssociationToRemoveList", + IDAMFTNLAssociationToUpdateList: "AMF-TNLAssociationToUpdateList", + IDAMFTrafficLoadReductionIndication: "AMFTrafficLoadReductionIndication", + IDAMFUENGAPID: "AMF-UE-NGAP-ID", + IDAssistanceDataForPaging: "AssistanceDataForPaging", + IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", + IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", + IDCancelAllWarningMessages: "CancelAllWarningMessages", + IDCause: "Cause", + IDCellIDListForRestart: "CellIDListForRestart", + IDConcurrentWarningMessageInd: "ConcurrentWarningMessageInd", + IDCoreNetworkAssistanceInformationForInactive: "CoreNetworkAssistanceInformationForInactive", + IDCriticalityDiagnostics: "CriticalityDiagnostics", + IDDataCodingScheme: "DataCodingScheme", + IDDefaultPagingDRX: "DefaultPagingDRX", + IDDirectForwardingPathAvailability: "DirectForwardingPathAvailability", + IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", + IDEmergencyFallbackIndicator: "EmergencyFallbackIndicator", + IDEUTRACGI: "EUTRA-CGI", + IDFiveGSTMSI: "FiveG-S-TMSI", + IDGlobalRANNodeID: "GlobalRANNodeID", + IDGUAMI: "GUAMI", + IDHandoverType: "HandoverType", + IDIMSVoiceSupportIndicator: "IMSVoiceSupportIndicator", + IDIndexToRFSP: "IndexToRFSP", + IDInfoOnRecommendedCellsAndRANNodesForPaging: "InfoOnRecommendedCellsAndRANNodesForPaging", + IDLocationReportingRequestType: "LocationReportingRequestType", + IDMaskedIMEISV: "MaskedIMEISV", + IDMessageIdentifier: "MessageIdentifier", + IDMobilityRestrictionList: "MobilityRestrictionList", + IDNASC: "NASC", + IDNASPDU: "NAS-PDU", + IDNASSecurityParametersFromNGRAN: "NASSecurityParametersFromNGRAN", + IDNewAMFUENGAPID: "NewAMF-UE-NGAP-ID", + IDNewSecurityContextInd: "NewSecurityContextInd", + IDNGAPMessage: "NGAP-Message", + IDNGRANCGI: "NGRAN-CGI", + IDNGRANTraceID: "NGRANTraceID", + IDNRCGI: "NR-CGI", + IDNRPPaPDU: "NRPPa-PDU", + IDNumberOfBroadcastsRequested: "NumberOfBroadcastsRequested", + IDOldAMF: "OldAMF", + IDOverloadStartNSSAIList: "OverloadStartNSSAIList", + IDPagingDRX: "PagingDRX", + IDPagingOrigin: "PagingOrigin", + IDPagingPriority: "PagingPriority", + IDPDUSessionResourceAdmittedList: "PDUSessionResourceAdmittedList", + IDPDUSessionResourceFailedToModifyListModRes: "PDUSessionResourceFailedToModifyListModRes", + IDPDUSessionResourceFailedToSetupListCxtRes: "PDUSessionResourceFailedToSetupListCxtRes", + IDPDUSessionResourceFailedToSetupListHOAck: "PDUSessionResourceFailedToSetupListHOAck", + IDPDUSessionResourceFailedToSetupListPSReq: "PDUSessionResourceFailedToSetupListPSReq", + IDPDUSessionResourceFailedToSetupListSURes: "PDUSessionResourceFailedToSetupListSURes", + IDPDUSessionResourceHandoverList: "PDUSessionResourceHandoverList", + IDPDUSessionResourceListCxtRelCpl: "PDUSessionResourceListCxtRelCpl", + IDPDUSessionResourceListHORqd: "PDUSessionResourceListHORqd", + IDPDUSessionResourceModifyListModCfm: "PDUSessionResourceModifyListModCfm", + IDPDUSessionResourceModifyListModInd: "PDUSessionResourceModifyListModInd", + IDPDUSessionResourceModifyListModReq: "PDUSessionResourceModifyListModReq", + IDPDUSessionResourceModifyListModRes: "PDUSessionResourceModifyListModRes", + IDPDUSessionResourceNotifyList: "PDUSessionResourceNotifyList", + IDPDUSessionResourceReleasedListNot: "PDUSessionResourceReleasedListNot", + IDPDUSessionResourceReleasedListPSAck: "PDUSessionResourceReleasedListPSAck", + IDPDUSessionResourceReleasedListPSFail: "PDUSessionResourceReleasedListPSFail", + IDPDUSessionResourceReleasedListRelRes: "PDUSessionResourceReleasedListRelRes", + IDPDUSessionResourceSetupListCxtReq: "PDUSessionResourceSetupListCxtReq", + IDPDUSessionResourceSetupListCxtRes: "PDUSessionResourceSetupListCxtRes", + IDPDUSessionResourceSetupListHOReq: "PDUSessionResourceSetupListHOReq", + IDPDUSessionResourceSetupListSUReq: "PDUSessionResourceSetupListSUReq", + IDPDUSessionResourceSetupListSURes: "PDUSessionResourceSetupListSURes", + IDPDUSessionResourceToBeSwitchedDLList: "PDUSessionResourceToBeSwitchedDLList", + IDPDUSessionResourceSwitchedList: "PDUSessionResourceSwitchedList", + IDPDUSessionResourceToReleaseListHOCmd: "PDUSessionResourceToReleaseListHOCmd", + IDPDUSessionResourceToReleaseListRelCmd: "PDUSessionResourceToReleaseListRelCmd", + IDPLMNSupportList: "PLMNSupportList", + IDPWSFailedCellIDList: "PWSFailedCellIDList", + IDRANNodeName: "RANNodeName", + IDRANPagingPriority: "RANPagingPriority", + IDRANStatusTransferTransparentContainer: "RANStatusTransfer-TransparentContainer", + IDRANUENGAPID: "RAN-UE-NGAP-ID", + IDRelativeAMFCapacity: "RelativeAMFCapacity", + IDRepetitionPeriod: "RepetitionPeriod", + IDResetType: "ResetType", + IDRoutingID: "RoutingID", + IDRRCEstablishmentCause: "RRCEstablishmentCause", + IDRRCInactiveTransitionReportRequest: "RRCInactiveTransitionReportRequest", + IDRRCState: "RRCState", + IDSecurityContext: "SecurityContext", + IDSecurityKey: "SecurityKey", + IDSerialNumber: "SerialNumber", + IDServedGUAMIList: "ServedGUAMIList", + IDSliceSupportList: "SliceSupportList", + IDSONConfigurationTransferDL: "SONConfigurationTransferDL", + IDSONConfigurationTransferUL: "SONConfigurationTransferUL", + IDSourceAMFUENGAPID: "SourceAMF-UE-NGAP-ID", + IDSourceToTargetTransparentContainer: "SourceToTarget-TransparentContainer", + IDSupportedTAList: "SupportedTAList", + IDTAIListForPaging: "TAIListForPaging", + IDTAIListForRestart: "TAIListForRestart", + IDTargetID: "TargetID", + IDTargetToSourceTransparentContainer: "TargetToSource-TransparentContainer", + IDTimeToWait: "TimeToWait", + IDTraceActivation: "TraceActivation", + IDTraceCollectionEntityIPAddress: "TraceCollectionEntityIPAddress", + IDUEAggregateMaximumBitRate: "UEAggregateMaximumBitRate", + IDUEAssociatedLogicalNGConnectionList: "UE-associatedLogicalNG-connectionList", + IDUEContextRequest: "UEContextRequest", + IDUENGAPIDs: "UE-NGAP-IDs", + IDUEPagingIdentity: "UEPagingIdentity", + IDUEPresenceInAreaOfInterestList: "UEPresenceInAreaOfInterestList", + IDUERadioCapability: "UERadioCapability", + IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", + IDUESecurityCapabilities: "UESecurityCapabilities", + IDUnavailableGUAMIList: "UnavailableGUAMIList", + IDUserLocationInformation: "UserLocationInformation", + IDWarningAreaList: "WarningAreaList", + IDWarningMessageContents: "WarningMessageContents", + IDWarningSecurityInfo: "WarningSecurityInfo", + IDWarningType: "WarningType", + IDAdditionalULNGUUPTNLInformation: "AdditionalUL-NGU-UP-TNLInformation", + IDDataForwardingNotPossible: "DataForwardingNotPossible", + IDDLNGUUPTNLInformation: "DL-NGU-UP-TNLInformation", + IDNetworkInstance: "NetworkInstance", + IDPDUSessionAggregateMaximumBitRate: "PDUSessionAggregateMaximumBitRate", + IDPDUSessionResourceFailedToModifyListModCfm: "PDUSessionResourceFailedToModifyListModCfm", + IDPDUSessionResourceFailedToSetupListCxtFail: "PDUSessionResourceFailedToSetupListCxtFail", + IDPDUSessionResourceListCxtRelReq: "PDUSessionResourceListCxtRelReq", + IDPDUSessionType: "PDUSessionType", + IDQosFlowAddOrModifyRequestList: "QosFlowAddOrModifyRequestList", + IDQosFlowSetupRequestList: "QosFlowSetupRequestList", + IDQosFlowToReleaseList: "QosFlowToReleaseList", + IDSecurityIndication: "SecurityIndication", + IDULNGUUPTNLInformation: "UL-NGU-UP-TNLInformation", + IDULNGUUPTNLModifyList: "UL-NGU-UP-TNLModifyList", + IDWarningAreaCoordinates: "WarningAreaCoordinates", + IDPDUSessionResourceSecondaryRATUsageList: "PDUSessionResourceSecondaryRATUsageList", + IDHandoverFlag: "HandoverFlag", + IDSecondaryRATUsageInformation: "SecondaryRATUsageInformation", + IDPDUSessionResourceReleaseResponseTransfer: "PDUSessionResourceReleaseResponseTransfer", + IDRedirectionVoiceFallback: "RedirectionVoiceFallback", + IDUERetentionInformation: "UERetentionInformation", + IDSNSSAI: "S-NSSAI", + IDPSCellInformation: "PSCellInformation", + IDLastEUTRANPLMNIdentity: "LastEUTRAN-PLMNIdentity", + IDMaximumIntegrityProtectedDataRateDL: "MaximumIntegrityProtectedDataRate-DL", + IDAdditionalDLForwardingUPTNLInformation: "AdditionalDLForwardingUPTNLInformation", + IDAdditionalDLUPTNLInformationForHOList: "AdditionalDLUPTNLInformationForHOList", + IDAdditionalNGUUPTNLInformation: "AdditionalNGU-UP-TNLInformation", + IDAdditionalDLQosFlowPerTNLInformation: "AdditionalDLQosFlowPerTNLInformation", + IDSecurityResult: "SecurityResult", + IDENDCSONConfigurationTransferDL: "ENDC-SONConfigurationTransferDL", + IDENDCSONConfigurationTransferUL: "ENDC-SONConfigurationTransferUL", + IDNewGUAMI: "NewGUAMI", + IDULForwardingUPTNLInformation: "ULForwardingUP-TNLInformation", + IDCNAssistedRANTuning: "CNAssistedRANTuning", + IDCommonNetworkInstance: "CommonNetworkInstance", + IDNGRANTNLAssociationToRemoveList: "NGRAN-TNLAssociationToRemoveList", + IDTNLAssociationTransportLayerAddressNGRAN: "TNLAssociationTransportLayerAddressNGRAN", + IDEndpointIPAddressAndPort: "EndpointIPAddressAndPort", + IDSourceToTargetAMFInformationReroute: "SourceToTarget-AMFInformationReroute", + IDAdditionalULForwardingUPTNLInformation: "AdditionalULForwardingUPTNLInformation", + IDSelectedPLMNIdentity: "SelectedPLMNIdentity", + IDGUAMIType: "GUAMIType", + IDSRVCCOperationPossible: "SRVCCOperationPossible", + IDAdditionalRedundantDLNGUUPTNLInformation: "AdditionalRedundantDL-NGU-UP-TNLInformation", + IDAdditionalRedundantDLQosFlowPerTNLInformation: "AdditionalRedundantDLQosFlowPerTNLInformation", + IDAdditionalRedundantNGUUPTNLInformation: "AdditionalRedundantNGU-UP-TNLInformation", + IDAdditionalRedundantULNGUUPTNLInformation: "AdditionalRedundantUL-NGU-UP-TNLInformation", + IDRedundantCommonNetworkInstance: "RedundantCommonNetworkInstance", + IDRedundantDLNGUTNLInformationReused: "RedundantDL-NGU-TNLInformationReused", + IDRedundantDLNGUUPTNLInformation: "RedundantDL-NGU-UP-TNLInformation", + IDRedundantDLQosFlowPerTNLInformation: "RedundantDLQosFlowPerTNLInformation", + IDRedundantULNGUUPTNLInformation: "RedundantUL-NGU-UP-TNLInformation", + IDRedundantPDUSessionInformation: "RedundantPDUSessionInformation", + IDIABAuthorized: "IAB-Authorized", + IDIABSupported: "IAB-Supported", + IDIABNodeIndication: "IABNodeIndication", + IDNBIoTPagingDRX: "NB-IoT-PagingDRX", + IDNBIoTPagingeDRXInfo: "NB-IoT-Paging-eDRXInfo", + IDNBIoTDefaultPagingDRX: "NB-IoT-DefaultPagingDRX", + IDEnhancedCoverageRestriction: "Enhanced-CoverageRestriction", + IDExtendedConnectedTime: "Extended-ConnectedTime", + IDPagingAssisDataforCEcapabUE: "PagingAssisDataforCEcapabUE", + IDWUSAssistanceInformation: "WUS-Assistance-Information", + IDUEDifferentiationInfo: "UE-DifferentiationInfo", + IDLTEV2XServicesAuthorized: "LTEV2XServicesAuthorized", + IDNRV2XServicesAuthorized: "NRV2XServicesAuthorized", + IDLTEUESidelinkAggregateMaximumBitrate: "LTEUESidelinkAggregateMaximumBitrate", + IDNRUESidelinkAggregateMaximumBitrate: "NRUESidelinkAggregateMaximumBitrate", + IDPC5QoSParameters: "PC5QoSParameters", + IDCEmodeBrestricted: "CEmodeBrestricted", + IDEUTRAPagingeDRXInformation: "EUTRA-PagingeDRXInformation", + IDCEmodeBSupportIndicator: "CEmodeBSupport-Indicator", + IDLTEMIndication: "LTEM-Indication", + IDEndIndication: "EndIndication", + IDEDTSession: "EDT-Session", + IDUECapabilityInfoRequest: "UECapabilityInfoRequest", + IDUEUPCIoTSupport: "UE-UP-CIoT-Support", + IDRRCResumeCause: "RRC-Resume-Cause", + IDRGLevelWirelineAccessCharacteristics: "RGLevelWirelineAccessCharacteristics", + IDWAGFIdentityInformation: "W-AGFIdentityInformation", + IDAuthenticatedIndication: "AuthenticatedIndication", + IDTNGFIdentityInformation: "TNGFIdentityInformation", + IDTWIFIdentityInformation: "TWIFIdentityInformation", + IDDataForwardingResponseERABList: "DataForwardingResponseERABList", + IDIntersystemSONConfigurationTransferDL: "IntersystemSONConfigurationTransferDL", + IDIntersystemSONConfigurationTransferUL: "IntersystemSONConfigurationTransferUL", + IDManagementBasedMDTPLMNList: "ManagementBasedMDTPLMNList", + IDNPNSupport: "NPN-Support", + IDNPNAccessInformation: "NPN-AccessInformation", + IDTargettoSourceFailureTransparentContainer: "TargettoSource-Failure-TransparentContainer", + IDUERadioCapabilityID: "UERadioCapabilityID", + IDUERadioCapabilityEUTRAFormat: "UERadioCapability-EUTRA-Format", + IDNotifySourceNGRANNode: "NotifySourceNGRANNode", + IDExtendedSliceSupportList: "ExtendedSliceSupportList", + IDExtendedRANNodeName: "Extended-RANNodeName", + IDExtendedAMFName: "Extended-AMFName", + IDMBSSessionToReleaseList: "MBSSessionToReleaseList", + IDMBSSessionSetupRequestList: "MBSSessionSetupRequestList", + IDMBSSessionSetuporModifyRequestList: "MBSSessionSetuporModifyRequestList", + IDOnboardingSupport: "OnboardingSupport", + IDTimeSyncAssistanceInfo: "TimeSyncAssistanceInfo", + IDQMCConfigInfo: "QMCConfigInfo", + IDQMCDeactivation: "QMCDeactivation", + IDNRPagingeDRXInformation: "NR-PagingeDRXInformation", + IDRedCapIndication: "RedCapIndication", + IDTargetNSSAIInformation: "TargetNSSAIInformation", + IDUESliceMaximumBitRateList: "UESliceMaximumBitRateList", + IDPagingCause: "PagingCause", + IDPEIPSassistanceInformation: "PEIPSassistanceInformation", + IDFiveGProSeAuthorized: "FiveG-ProSeAuthorized", + IDFiveGProSeUEPC5AggregateMaximumBitRate: "FiveG-ProSeUEPC5AggregateMaximumBitRate", + IDFiveGProSePC5QoSParameters: "FiveG-ProSePC5QoSParameters", + IDManagementBasedMDTPLMNModificationList: "ManagementBasedMDTPLMNModificationList", + IDNetworkControlledRepeaterAuthorized: "NetworkControlledRepeaterAuthorized", + IDSelectedNID: "SelectedNID", + IDAerialUEsubscriptionInformation: "AerialUEsubscriptionInformation", + IDNRA2XServicesAuthorized: "NR-A2X-ServicesAuthorized", + IDLTEA2XServicesAuthorized: "LTE-A2X-ServicesAuthorized", + IDNRA2XUEPC5AggregateMaximumBitRate: "NR-A2X-UE-PC5-AggregateMaximumBitRate", + IDLTEA2XUEPC5AggregateMaximumBitRate: "LTE-A2X-UE-PC5-AggregateMaximumBitRate", + IDA2XPC5QoSParameters: "A2X-PC5-QoS-Parameters", + IDDownlinkTLContainer: "DownlinkTLContainer", + IDMobileIABAuthorized: "MobileIAB-Authorized", + IDMobileIABNodeIndication: "MobileIABNodeIndication", + IDNoPDUSessionIndication: "NoPDUSessionIndication", + IDMobileIABSupported: "MobileIAB-Supported", + IDPartiallyAllowedNSSAI: "Partially-Allowed-NSSAI", + IDERedCapIndication: "ERedCapIndication", + IDXrDeviceWith2Rx: "XrDeviceWith2Rx", + IDSLPositioningRangingServiceInfo: "SLPositioningRangingServiceInfo", + IDUserPlaneFailureIndication: "UserPlaneFailureIndication", + IDAUN3DeviceAccessInfo: "AUN3DeviceAccessInfo", + IDExtendedBackupAMFName: "ExtendedBackupAMFName", + IDExtendedOldAMF: "ExtendedOldAMF", + IDAMFUENGAPID2: "AMF-UE-NGAP-ID2", + IDGUAMIList: "GUAMIList", + IDGWContextReleaseIndication: "GW-Context-Release-Indication", + IDSourceAMFGUAMI: "SourceAMF-GUAMI", + IDRequestedNSSAI: "RequestedNSSAI", + IDTargetRANNodeID: "Target-RAN-Node-ID", + IDAIOTFIdentifier: "AIOTFIdentifier", + IDAIoTSupport: "AIoT-Support", + IDAIOTFName: "AIOTFName", + IDLPWUSPSAssistanceInformation: "LPWUSPSAssistanceInformation", + IDAdditionalULI: "AdditionalULI", + IDLPWUSDisableIndication: "LPWUSDisableIndication", } // ProtocolIEIDName returns the TS 38.413 name of id, and whether it is known. diff --git a/ngap/ie_qos.go b/ngap/ie_qos.go index 1c9c7c55f5..e2deec2dec 100644 --- a/ngap/ie_qos.go +++ b/ngap/ie_qos.go @@ -227,10 +227,10 @@ const ( // INTEGER (0..9, ...), iE-Extensions OPTIONAL } (extensible) — the rate is // scalar × 10^-exponent. type PacketErrorRate struct { - _ [0]struct{} `per:"extseq"` - Scalar PERDigit - Exponent PERDigit - _ ieExtensions `per:",skip"` + Scalar PERDigit + Exponent PERDigit + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PERDigit is the shared INTEGER (0..9, ...) of both PacketErrorRate fields. @@ -255,12 +255,12 @@ func (d *PERDigit) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // averagingWindow OPTIONAL, maximumDataBurstVolume OPTIONAL, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.1.28. type NonDynamic5QIDescriptor struct { - _ [0]struct{} `per:"extseq"` FiveQI FiveQI PriorityLevelQos *PriorityLevelQos `per:",optional"` AveragingWindow *AveragingWindow `per:",optional"` MaximumDataBurstVolume *MaximumDataBurstVolume `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // Dynamic5QIDescriptor ::= SEQUENCE { priorityLevelQos, packetDelayBudget, @@ -270,7 +270,6 @@ type NonDynamic5QIDescriptor struct { // averagingWindow on the flow being GBR, and maximumDataBurstVolume on // delayCritical being "delay critical". type Dynamic5QIDescriptor struct { - _ [0]struct{} `per:"extseq"` PriorityLevelQos PriorityLevelQos PacketDelayBudget PacketDelayBudget PacketErrorRate PacketErrorRate @@ -278,7 +277,8 @@ type Dynamic5QIDescriptor struct { DelayCritical *DelayCritical `per:"ENUMERATED,range:0..1,...,optional"` AveragingWindow *AveragingWindow `per:",optional"` MaximumDataBurstVolume *MaximumDataBurstVolume `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosCharacteristicsKind selects the QosCharacteristics CHOICE alternative. @@ -346,24 +346,24 @@ func (q *QosCharacteristics) UnmarshalPER(r *per.Reader, enc per.Encoding) error // E-RABLevelQoSParameters is the counterpart: a QCI where this has a // QosCharacteristics CHOICE, and no reflective/additional fields. type QosFlowLevelQosParameters struct { - _ [0]struct{} `per:"extseq"` QosCharacteristics QosCharacteristics AllocationAndRetentionPriority AllocationAndRetentionPriority GBRQosInformation *GBRQosInformation `per:",optional"` ReflectiveQosAttribute *ReflectiveQosAttribute `per:"ENUMERATED,range:0..0,...,optional"` AdditionalQosFlowInformation *AdditionalQosFlowInformation `per:"ENUMERATED,range:0..0,...,optional"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // AllocationAndRetentionPriority ::= SEQUENCE { priorityLevelARP, // pre-emptionCapability, pre-emptionVulnerability, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.1.19. type AllocationAndRetentionPriority struct { - _ [0]struct{} `per:"extseq"` PriorityLevelARP PriorityLevelARP PreemptionCapability PreemptionCapability `per:"ENUMERATED,range:0..1,..."` PreemptionVulnerability PreemptionVulnerability `per:"ENUMERATED,range:0..1,..."` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // GBR-QosInformation ::= SEQUENCE { four BitRates, notificationControl @@ -374,15 +374,15 @@ type AllocationAndRetentionPriority struct { // an optional extension on E-RABLevelQoSParameters, and is non-extensible // there where NGAP's PacketLossRate is extensible. type GBRQosInformation struct { - _ [0]struct{} `per:"extseq"` MaximumFlowBitRateDL BitRate MaximumFlowBitRateUL BitRate GuaranteedFlowBitRateDL BitRate GuaranteedFlowBitRateUL BitRate - NotificationControl *NotificationControl `per:"ENUMERATED,range:0..0,...,optional"` - MaximumPacketLossRateDL *PacketLossRate `per:",optional"` - MaximumPacketLossRateUL *PacketLossRate `per:",optional"` - _ ieExtensions `per:",skip"` + NotificationControl *NotificationControl `per:"ENUMERATED,range:0..0,...,optional"` + MaximumPacketLossRateDL *PacketLossRate `per:",optional"` + MaximumPacketLossRateUL *PacketLossRate `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowIdentifier ::= INTEGER (0..63, ...) — TS 38.413 §9.3.1.51. @@ -438,11 +438,11 @@ const ( // qosFlowLevelQosParameters, e-RAB-ID OPTIONAL, iE-Extensions OPTIONAL } // (extensible). type QosFlowSetupRequestItem struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier QosFlowLevelQosParameters QosFlowLevelQosParameters - ERABID *ERABID `per:",optional"` - _ ieExtensions `per:",skip"` + ERABID *ERABID `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowSetupRequestList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -452,10 +452,10 @@ type QosFlowSetupRequestList []QosFlowSetupRequestItem // QosFlowWithCauseItem ::= SEQUENCE { qosFlowIdentifier, cause, iE-Extensions // OPTIONAL } (extensible). type QosFlowWithCauseItem struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier Cause Cause - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowListWithCause ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -478,9 +478,9 @@ type AssociatedQosFlowList []AssociatedQosFlowItem // QosFlowModifyConfirmItem ::= SEQUENCE { qosFlowIdentifier, iE-Extensions // OPTIONAL } (extensible). type QosFlowModifyConfirmItem struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowModifyConfirmList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -493,11 +493,18 @@ type QosFlowModifyConfirmList []QosFlowModifyConfirmItem // QosFlowSetupRequestItem has them mandatory: a modify may touch only the // E-RAB mapping. type QosFlowAddOrModifyRequestItem struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier - QosFlowLevelQosParameters *QosFlowLevelQosParameters `per:",optional"` - ERABID *ERABID `per:",optional"` - _ ieExtensions `per:",skip"` + QosFlowLevelQosParameters *QosFlowLevelQosParameters `per:",optional"` + ERABID *ERABID `per:",optional"` + ULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + iEExtensions messageMeta `per:",exttable:qosFlowAddOrModifyRequestItemExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var qosFlowAddOrModifyRequestItemExtIEs = []ieSpec[QosFlowAddOrModifyRequestItem]{ + optionalExtension(IDULNGUUPTNLInformation, CriticalityIgnore, func(m *QosFlowAddOrModifyRequestItem) **UPTransportLayerInformation { + return &m.ULNGUUPTNLInformation + }), } // QosFlowAddOrModifyRequestList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -531,9 +538,9 @@ func (d *DataForwardingAccepted) UnmarshalPER(r *per.Reader, enc per.Encoding) e // QosFlowAcceptedItem ::= SEQUENCE { qosFlowIdentifier, iE-Extensions OPTIONAL // } (extensible). type QosFlowAcceptedItem struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowAcceptedList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -543,9 +550,9 @@ type QosFlowAcceptedList []QosFlowAcceptedItem // QosFlowToBeForwardedItem ::= SEQUENCE { qosFlowIdentifier, iE-Extensions // OPTIONAL } (extensible). type QosFlowToBeForwardedItem struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowToBeForwardedList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -555,10 +562,10 @@ type QosFlowToBeForwardedList []QosFlowToBeForwardedItem // QosFlowItemWithDataForwarding ::= SEQUENCE { qosFlowIdentifier, // dataForwardingAccepted OPTIONAL, iE-Extensions OPTIONAL } (extensible). type QosFlowItemWithDataForwarding struct { - _ [0]struct{} `per:"extseq"` QosFlowIdentifier QosFlowIdentifier DataForwardingAccepted *DataForwardingAccepted `per:"ENUMERATED,range:0..0,...,optional"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowListWithDataForwarding ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -569,18 +576,18 @@ type QosFlowListWithDataForwarding []QosFlowItemWithDataForwarding // associatedQosFlowList, iE-Extensions OPTIONAL } (extensible) — TS 38.413 // §9.3.2.8. type QosFlowPerTNLInformation struct { - _ [0]struct{} `per:"extseq"` UPTransportLayerInformation UPTransportLayerInformation AssociatedQosFlowList AssociatedQosFlowList - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowPerTNLInformationItem ::= SEQUENCE { qosFlowPerTNLInformation, // iE-Extensions OPTIONAL } (extensible). type QosFlowPerTNLInformationItem struct { - _ [0]struct{} `per:"extseq"` QosFlowPerTNLInformation QosFlowPerTNLInformation - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowPerTNLInformationList ::= SEQUENCE @@ -641,10 +648,10 @@ func (n *NetworkInstance) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // OPTIONAL } (extensible) — TS 38.413 §9.3.1.102. Session-level, where // UEAggregateMaximumBitRate is UE-level; S1AP has only the UE-level form. type PDUSessionAggregateMaximumBitRate struct { - _ [0]struct{} `per:"extseq"` - DL BitRate - UL BitRate - _ ieExtensions `per:",skip"` + DL BitRate + UL BitRate + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // IntegrityProtectionIndication ::= ENUMERATED { required, preferred, @@ -716,11 +723,11 @@ const ( // and a decoder accepts whatever arrives. TS 36.413 §9.2.1.163 defines the // same IE carrying the integrity indication alone. type SecurityIndication struct { - _ [0]struct{} `per:"extseq"` IntegrityProtectionIndication IntegrityProtectionIndication `per:"ENUMERATED,range:0..2,..."` ConfidentialityProtectionIndication ConfidentialityProtectionIndication `per:"ENUMERATED,range:0..2,..."` MaximumIntegrityProtectedDataRateUL *MaximumIntegrityProtectedDataRate `per:"ENUMERATED,range:0..1,...,optional"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // SecurityResult ::= SEQUENCE { integrityProtectionResult, @@ -728,10 +735,10 @@ type SecurityIndication struct { // 38.413 §9.3.1.59. TS 36.413 §9.2.1.164 defines the same IE carrying the // integrity result alone. type SecurityResult struct { - _ [0]struct{} `per:"extseq"` IntegrityProtectionResult IntegrityProtectionResult `per:"ENUMERATED,range:0..1,..."` ConfidentialityProtectionResult ConfidentialityProtectionResult `per:"ENUMERATED,range:0..1,..."` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // Name returns the value's name in TS 38.413 §9.3.1.27, or the empty string for diff --git a/ngap/ie_qos_test.go b/ngap/ie_qos_test.go index ff5d3e5137..001afbbb37 100644 --- a/ngap/ie_qos_test.go +++ b/ngap/ie_qos_test.go @@ -6,6 +6,7 @@ package ngap import ( "encoding/hex" "errors" + "reflect" "testing" "github.com/ellanetworks/core/per" @@ -44,7 +45,7 @@ func TestAllocationAndRetentionPriorityGolden(t *testing.T) { t.Fatal(err) } - if out != in { + if !reflect.DeepEqual(out, in) { t.Fatalf("round trip %+v, want %+v", out, in) } } @@ -208,7 +209,7 @@ func TestDynamic5QIRoundTrip(t *testing.T) { } if out.PriorityLevelQos != in.PriorityLevelQos || out.PacketDelayBudget != in.PacketDelayBudget || - out.PacketErrorRate != in.PacketErrorRate || *out.FiveQI != fiveQI || + !reflect.DeepEqual(out.PacketErrorRate, in.PacketErrorRate) || *out.FiveQI != fiveQI || *out.DelayCritical != delayCritical || *out.AveragingWindow != avg || *out.MaximumDataBurstVolume != mdbv { t.Fatalf("round trip %+v, want %+v", out, in) diff --git a/ngap/ie_setup.go b/ngap/ie_setup.go index 761b5d41ad..9c4de9116f 100644 --- a/ngap/ie_setup.go +++ b/ngap/ie_setup.go @@ -4,7 +4,6 @@ package ngap import ( - "errors" "fmt" "github.com/ellanetworks/core/per" @@ -269,114 +268,6 @@ func (o *OnboardingSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -func extensionFields[M any](table []ieSpec[M], m *M, meta *messageMeta) []ieField { - typed := make([]*ieField, len(table)) - - for i, spec := range table { - if val, ok := spec.encode(m); ok { - typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} - } - } - - return orderFields(table, typed, meta) -} - -func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - if len(fields) > maxProtocolExtensions { - return fmt.Errorf("ngap: %d extensions exceed maxProtocolExtensions", len(fields)) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, int64(len(fields))); err != nil { - return err - } - - for _, f := range fields { - if err := encodeContainerField(w, enc, f); err != nil { - return err - } - } - - return nil -} - -func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *messageMeta) error { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) - if err != nil { - return err - } - - if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { - return fmt.Errorf("ngap: extension container declares %d fields in %d bits", n, maxBits) - } - - var rejected *notComprehendedIE - - lastIdx := -1 - - for i := int64(0); i < n; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return err - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return err - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return err - } - - f := rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val} - - if idx, spec, ok := lookupIESpec(table, f.id); ok { - if idx <= lastIdx { - return fmt.Errorf("ngap: extension %s out of order or repeated", f.id) - } - - lastIdx = idx - - err := spec.decode(m, f.value, enc) - if err == nil { - meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) - - continue - } - - if !errors.Is(err, errNotComprehended) { - return err - } - - var inner *notComprehendedIE - if errors.As(err, &inner) && inner.Crit == CriticalityReject && rejected == nil { - rejected = inner - } - } - - if f.crit == CriticalityReject { - if rejected == nil { - rejected = ¬ComprehendedIE{ID: f.id, Crit: CriticalityReject, What: "iE-Extensions"} - } - - continue - } - - meta.preserve(f) - } - - if rejected != nil { - return rejected - } - - if wireMatchesTable(table, meta.wire) { - meta.wire = nil - } - - return nil -} - // PLMNSupportList ::= SEQUENCE (SIZE(1..maxnoofPLMNs)) OF PLMNSupportItem. type PLMNSupportList []PLMNSupportItem diff --git a/ngap/ie_slice.go b/ngap/ie_slice.go index 3a91e0e8ce..c844398e3b 100644 --- a/ngap/ie_slice.go +++ b/ngap/ie_slice.go @@ -51,10 +51,10 @@ type SD [3]byte // S-NSSAI ::= SEQUENCE { sST, sD OPTIONAL, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.1.24. type SNSSAI struct { - _ [0]struct{} `per:"extseq"` - SST SST - SD *SD `per:",optional"` - _ ieExtensions `per:",skip"` + SST SST + SD *SD `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // SliceSupportItem ::= SEQUENCE { s-NSSAI, iE-Extensions OPTIONAL } diff --git a/ngap/ie_table.go b/ngap/ie_table.go index 420c54d35d..cce4b34557 100644 --- a/ngap/ie_table.go +++ b/ngap/ie_table.go @@ -66,7 +66,11 @@ func encodeMessageBody[M any, PM interface { message }](w *per.Writer, enc per.Encoding, procedure ProcedureCode, table []ieSpec[M], m PM, ) error { - w.WriteBit(false) + if m.meta().dropped { + return fmt.Errorf("ngap: %s: unknown IEs were dropped on decode", procedure) + } + + w.WriteBit(m.meta().extensions.Present()) typed := make([]*ieField, len(table)) @@ -90,7 +94,11 @@ func encodeMessageBody[M any, PM interface { typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} } - return encodeIEContainer(w, enc, orderFields(table, typed, m.meta())) + if err := encodeIEContainer(w, enc, orderFields(table, typed, m.meta())); err != nil { + return err + } + + return m.meta().extensions.MarshalPER(w, enc) } func orderFields[M any](table []ieSpec[M], typed []*ieField, meta *messageMeta) []ieField { @@ -160,6 +168,14 @@ func parseMessageBody[M any, PM interface { *M message }](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, +) (PM, error) { + return parseBoundedMessageBody[M, PM](procedure, trigger, table, value, maxPreservedIEs) +} + +func parseBoundedMessageBody[M any, PM interface { + *M + message +}](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, limit int, ) (PM, error) { r := per.NewReader(value) enc := per.Aligned @@ -174,8 +190,10 @@ func parseMessageBody[M any, PM interface { return nil, &TransferSyntaxError{Procedure: procedure, Err: err} } + var additions per.ExtensionAdditions + if extPresent { - if err := skipSequenceExtensionsPER(r, enc, false, true); err != nil { + if err := additions.UnmarshalPER(r, enc); err != nil { return nil, &TransferSyntaxError{Procedure: procedure, Err: err} } } @@ -192,6 +210,7 @@ func parseMessageBody[M any, PM interface { m := PM(new(M)) meta := m.meta() + meta.extensions = additions seen := make(map[ProtocolIEID]bool, len(table)) lastIdx := -1 @@ -224,7 +243,7 @@ func parseMessageBody[M any, PM interface { } meta.diagnostics.record(f.id, f.crit, TypeOfErrorNotUnderstood) - meta.preserve(f) + meta.preserveUpTo(f, limit) continue } diff --git a/ngap/ies.go b/ngap/ies.go index 464b82d82e..32a13d2cc0 100644 --- a/ngap/ies.go +++ b/ngap/ies.go @@ -47,6 +47,8 @@ type messageMeta struct { unknownIEs []rawIE wire []wireSlot diagnostics Diagnostics + extensions per.ExtensionAdditions + dropped bool } type wireSlot struct { @@ -57,8 +59,13 @@ type wireSlot struct { // Bounded: a peer chooses both the count and the size of what we would retain. func (u *messageMeta) preserve(f rawIE) { - if len(u.unknownIEs) >= maxPreservedIEs { + u.preserveUpTo(f, maxPreservedIEs) +} + +func (u *messageMeta) preserveUpTo(f rawIE, limit int) { + if len(u.unknownIEs) >= limit { u.diagnostics.Truncated = true + u.dropped = true return } @@ -182,6 +189,10 @@ func decodeIEContainer(r *per.Reader, enc per.Encoding) ([]rawIE, error) { return nil, fmt.Errorf("ngap: IE %d value: %w", i, err) } + if len(val) == 0 { + return nil, fmt.Errorf("ngap: IE %d has an empty open type", i) + } + fields = append(fields, rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val}) } diff --git a/ngap/initial_context_setup.go b/ngap/initial_context_setup.go index 48727bbf92..c24f2804e7 100644 --- a/ngap/initial_context_setup.go +++ b/ngap/initial_context_setup.go @@ -15,12 +15,12 @@ import ( // (§9.3.4.1). The AMF neither builds nor reads it — the SMF does — so it is // carried opaquely. type PDUSessionResourceSetupItemCxtReq struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID NASPDU *NASPDU `per:",optional"` SNSSAI SNSSAI Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListCxtReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -32,10 +32,10 @@ type PDUSessionResourceSetupListCxtReq []PDUSessionResourceSetupItemCxtReq // (extensible). The transfer contains a PDUSessionResourceSetupResponseTransfer // (§9.3.4.2). type PDUSessionResourceSetupItemCxtRes struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListCxtRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) diff --git a/ngap/pdu_session_resource_modify.go b/ngap/pdu_session_resource_modify.go index 954ac6dae3..2732793c39 100644 --- a/ngap/pdu_session_resource_modify.go +++ b/ngap/pdu_session_resource_modify.go @@ -11,11 +11,18 @@ import ( // OPTIONAL, pDUSessionResourceModifyRequestTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceModifyItemModReq struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID NASPDU *NASPDU `per:",optional"` Transfer TransferContainer - _ ieExtensions `per:",skip"` + SNSSAI *SNSSAI `per:"-"` + iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyItemModReqExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var pDUSessionResourceModifyItemModReqExtIEs = []ieSpec[PDUSessionResourceModifyItemModReq]{ + optionalExtension(IDSNSSAI, CriticalityReject, func(m *PDUSessionResourceModifyItemModReq) **SNSSAI { + return &m.SNSSAI + }), } // PDUSessionResourceModifyListModReq ::= SEQUENCE @@ -26,10 +33,10 @@ type PDUSessionResourceModifyListModReq []PDUSessionResourceModifyItemModReq // pDUSessionResourceModifyResponseTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceModifyItemModRes struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceModifyListModRes ::= SEQUENCE @@ -268,12 +275,15 @@ func ParsePDUSessionResourceModifyResponse(value []byte) (*PDUSessionResourceMod // what changes. SecurityIndication is ignore criticality here where the setup // request transfer marks it reject, so it is left to the unknown-IE path. type PDUSessionResourceModifyRequestTransfer struct { - PDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate - ULNGUUPTNLModify ULNGUUPTNLModifyList - NetworkInstance *NetworkInstance - QosFlowAddOrModifyRequest QosFlowAddOrModifyRequestList - QosFlowToRelease QosFlowListWithCause - AdditionalULNGUUPTNLInformation UPTransportLayerInformationList + PDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate + ULNGUUPTNLModify ULNGUUPTNLModifyList + NetworkInstance *NetworkInstance + QosFlowAddOrModifyRequest QosFlowAddOrModifyRequestList + QosFlowToRelease QosFlowListWithCause + AdditionalULNGUUPTNLInformation UPTransportLayerInformationList + AdditionalRedundantULNGUUPTNLInformation UPTransportLayerInformationList + RedundantULNGUUPTNLInformation *UPTransportLayerInformation + UserPlaneFailureIndication *UserPlaneFailureIndication messageMeta } @@ -373,6 +383,15 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi return m.AdditionalULNGUUPTNLInformation, true }, }, + listExtension(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *UPTransportLayerInformationList { + return &m.AdditionalRedundantULNGUUPTNLInformation + }), + optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UPTransportLayerInformation { + return &m.RedundantULNGUUPTNLInformation + }), + optionalExtension(IDUserPlaneFailureIndication, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UserPlaneFailureIndication { + return &m.UserPlaneFailureIndication + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -391,16 +410,23 @@ func (t *PDUSessionResourceModifyRequestTransfer) Marshal() (TransferContainer, // ParsePDUSessionResourceModifyRequestTransfer decodes the transfer the SMF // sends for a session the NG-RAN node is to modify. func ParsePDUSessionResourceModifyRequestTransfer(b TransferContainer) (*PDUSessionResourceModifyRequestTransfer, error) { - return parseMessageBody[PDUSessionResourceModifyRequestTransfer](ProcPDUSessionResourceModify, TriggeringInitiatingMessage, pDUSessionResourceModifyRequestTransferIEs, b) + return parseBoundedMessageBody[PDUSessionResourceModifyRequestTransfer](ProcPDUSessionResourceModify, TriggeringInitiatingMessage, pDUSessionResourceModifyRequestTransferIEs, b, maxProtocolIEs) } // QosFlowAddOrModifyResponseItem ::= SEQUENCE { qosFlowIdentifier, // iE-Extensions OPTIONAL } (extensible), an inline type of the TS 38.413 // §9.3.4.4 table. type QosFlowAddOrModifyResponseItem struct { - _ [0]struct{} `per:"extseq"` - QosFlowIdentifier QosFlowIdentifier - _ ieExtensions `per:",skip"` + QosFlowIdentifier QosFlowIdentifier + DLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + iEExtensions messageMeta `per:",exttable:qosFlowAddOrModifyResponseItemExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var qosFlowAddOrModifyResponseItemExtIEs = []ieSpec[QosFlowAddOrModifyResponseItem]{ + optionalExtension(IDDLNGUUPTNLInformation, CriticalityIgnore, func(m *QosFlowAddOrModifyResponseItem) **UPTransportLayerInformation { + return &m.DLNGUUPTNLInformation + }), } // QosFlowAddOrModifyResponseList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -414,13 +440,36 @@ type QosFlowAddOrModifyResponseList []QosFlowAddOrModifyResponseItem // (extensible) — TS 38.413 §9.3.4.4. Every field is optional: an NG-RAN node // that accepted a modification without changing a tunnel sends it empty. type PDUSessionResourceModifyResponseTransfer struct { - _ [0]struct{} `per:"extseq"` - DLNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` - ULNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` - QosFlowAddOrModifyResponse QosFlowAddOrModifyResponseList `per:",optional"` - AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` - QosFlowFailedToAddOrModify QosFlowListWithCause `per:",optional"` - _ ieExtensions `per:",skip"` + DLNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` + ULNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` + QosFlowAddOrModifyResponse QosFlowAddOrModifyResponseList `per:",optional"` + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` + QosFlowFailedToAddOrModify QosFlowListWithCause `per:",optional"` + AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` + AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` + iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyResponseTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var pDUSessionResourceModifyResponseTransferExtIEs = []ieSpec[PDUSessionResourceModifyResponseTransfer]{ + listExtension(IDAdditionalNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) *UPTransportLayerInformationPairList { + return &m.AdditionalNGUUPTNLInformation + }), + optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) **UPTransportLayerInformation { + return &m.RedundantDLNGUUPTNLInformation + }), + optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) **UPTransportLayerInformation { + return &m.RedundantULNGUUPTNLInformation + }), + listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) *QosFlowPerTNLInformationList { + return &m.AdditionalRedundantDLQosFlowPerTNLInformation + }), + listExtension(IDAdditionalRedundantNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) *UPTransportLayerInformationPairList { + return &m.AdditionalRedundantNGUUPTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. diff --git a/ngap/pdu_session_resource_modify_indication.go b/ngap/pdu_session_resource_modify_indication.go index c38c823f92..6fc413ed47 100644 --- a/ngap/pdu_session_resource_modify_indication.go +++ b/ngap/pdu_session_resource_modify_indication.go @@ -11,10 +11,10 @@ import ( // pDUSessionResourceModifyIndicationTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceModifyItemModInd struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceModifyListModInd ::= SEQUENCE @@ -25,10 +25,10 @@ type PDUSessionResourceModifyListModInd []PDUSessionResourceModifyItemModInd // pDUSessionResourceModifyConfirmTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceModifyItemModCfm struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceModifyListModCfm ::= SEQUENCE @@ -301,10 +301,21 @@ func ParsePDUSessionResourceModifyConfirm(value []byte) (*PDUSessionResourceModi // iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.4.6. The NG-RAN node // builds it; the SMF consumes it. type PDUSessionResourceModifyIndicationTransfer struct { - _ [0]struct{} `per:"extseq"` - DLQosFlowPerTNLInformation QosFlowPerTNLInformation - AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` - _ ieExtensions `per:",skip"` + DLQosFlowPerTNLInformation QosFlowPerTNLInformation + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` + RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `per:"-"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` + iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyIndicationTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var pDUSessionResourceModifyIndicationTransferExtIEs = []ieSpec[PDUSessionResourceModifyIndicationTransfer]{ + optionalExtension(IDRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyIndicationTransfer) **QosFlowPerTNLInformation { + return &m.RedundantDLQosFlowPerTNLInformation + }), + listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyIndicationTransfer) *QosFlowPerTNLInformationList { + return &m.AdditionalRedundantDLQosFlowPerTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -338,12 +349,23 @@ func ParsePDUSessionResourceModifyIndicationTransfer(b TransferContainer) (*PDUS // iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.4.7. The SMF builds // it; the NG-RAN node consumes it. type PDUSessionResourceModifyConfirmTransfer struct { - _ [0]struct{} `per:"extseq"` - QosFlowModifyConfirm QosFlowModifyConfirmList - ULNGUUPTNLInformation UPTransportLayerInformation - AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:",optional"` - QosFlowFailedToModify QosFlowListWithCause `per:",optional"` - _ ieExtensions `per:",skip"` + QosFlowModifyConfirm QosFlowModifyConfirmList + ULNGUUPTNLInformation UPTransportLayerInformation + AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:",optional"` + QosFlowFailedToModify QosFlowListWithCause `per:",optional"` + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` + AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` + iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyConfirmTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var pDUSessionResourceModifyConfirmTransferExtIEs = []ieSpec[PDUSessionResourceModifyConfirmTransfer]{ + optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyConfirmTransfer) **UPTransportLayerInformation { + return &m.RedundantULNGUUPTNLInformation + }), + listExtension(IDAdditionalRedundantNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyConfirmTransfer) *UPTransportLayerInformationPairList { + return &m.AdditionalRedundantNGUUPTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. diff --git a/ngap/pdu_session_resource_setup.go b/ngap/pdu_session_resource_setup.go index 4cceb07556..72182014c7 100644 --- a/ngap/pdu_session_resource_setup.go +++ b/ngap/pdu_session_resource_setup.go @@ -12,12 +12,12 @@ import ( // iE-Extensions OPTIONAL } (extensible). Its own ASN.1 type, so it stays // distinct from the identically shaped CxtReq item. type PDUSessionResourceSetupItemSUReq struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID NASPDU *NASPDU `per:",optional"` SNSSAI SNSSAI Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListSUReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -28,10 +28,10 @@ type PDUSessionResourceSetupListSUReq []PDUSessionResourceSetupItemSUReq // pDUSessionResourceSetupResponseTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceSetupItemSURes struct { - _ [0]struct{} `per:"extseq"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListSURes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -377,15 +377,17 @@ func (d *DataForwardingNotPossible) UnmarshalPER(r *per.Reader, enc per.Encoding // it carries per-IE criticality and reuses the message-body engine. The SMF // builds it; the NG-RAN node consumes it. type PDUSessionResourceSetupRequestTransfer struct { - PDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate - ULNGUUPTNLInformation UPTransportLayerInformation - AdditionalULNGUUPTNLInformation UPTransportLayerInformationList - DataForwardingNotPossible *DataForwardingNotPossible - PDUSessionType PDUSessionType - SecurityIndication *SecurityIndication - NetworkInstance *NetworkInstance - QosFlowSetupRequest QosFlowSetupRequestList - DirectForwardingPathAvailability *DirectForwardingPathAvailability + PDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate + ULNGUUPTNLInformation UPTransportLayerInformation + AdditionalULNGUUPTNLInformation UPTransportLayerInformationList + DataForwardingNotPossible *DataForwardingNotPossible + PDUSessionType PDUSessionType + SecurityIndication *SecurityIndication + NetworkInstance *NetworkInstance + QosFlowSetupRequest QosFlowSetupRequestList + DirectForwardingPathAvailability *DirectForwardingPathAvailability + RedundantULNGUUPTNLInformation *UPTransportLayerInformation + AdditionalRedundantULNGUUPTNLInformation UPTransportLayerInformationList messageMeta } @@ -540,6 +542,12 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return m.DirectForwardingPathAvailability, true }, }, + optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) **UPTransportLayerInformation { + return &m.RedundantULNGUUPTNLInformation + }), + listExtension(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *UPTransportLayerInformationList { + return &m.AdditionalRedundantULNGUUPTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -559,7 +567,7 @@ func (t *PDUSessionResourceSetupRequestTransfer) Marshal() (TransferContainer, e // sends for a session the NG-RAN node is to set up. Errors carry the enclosing // procedure, which is what the AMF reports in Criticality Diagnostics. func ParsePDUSessionResourceSetupRequestTransfer(b TransferContainer) (*PDUSessionResourceSetupRequestTransfer, error) { - return parseMessageBody[PDUSessionResourceSetupRequestTransfer](ProcPDUSessionResourceSetup, TriggeringInitiatingMessage, pDUSessionResourceSetupRequestTransferIEs, b) + return parseBoundedMessageBody[PDUSessionResourceSetupRequestTransfer](ProcPDUSessionResourceSetup, TriggeringInitiatingMessage, pDUSessionResourceSetupRequestTransferIEs, b, maxProtocolIEs) } // PDUSessionResourceSetupResponseTransfer ::= SEQUENCE { @@ -568,12 +576,23 @@ func ParsePDUSessionResourceSetupRequestTransfer(b TransferContainer) (*PDUSessi // OPTIONAL } (extensible) — TS 38.413 §9.3.4.2. A plain SEQUENCE, unlike the // request transfer. The NG-RAN node builds it; the SMF consumes it. type PDUSessionResourceSetupResponseTransfer struct { - _ [0]struct{} `per:"extseq"` - DLQosFlowPerTNLInformation QosFlowPerTNLInformation - AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` - SecurityResult *SecurityResult `per:",optional"` - QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` - _ ieExtensions `per:",skip"` + DLQosFlowPerTNLInformation QosFlowPerTNLInformation + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` + SecurityResult *SecurityResult `per:",optional"` + QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` + RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `per:"-"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` + iEExtensions messageMeta `per:",exttable:pDUSessionResourceSetupResponseTransferExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var pDUSessionResourceSetupResponseTransferExtIEs = []ieSpec[PDUSessionResourceSetupResponseTransfer]{ + optionalExtension(IDRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupResponseTransfer) **QosFlowPerTNLInformation { + return &m.RedundantDLQosFlowPerTNLInformation + }), + listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupResponseTransfer) *QosFlowPerTNLInformationList { + return &m.AdditionalRedundantDLQosFlowPerTNLInformation + }), } // Marshal encodes the transfer for the OCTET STRING that carries it. diff --git a/ngap/per_gen.go b/ngap/per_gen.go index 7713e44df2..ff74239b08 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -201,9 +201,77 @@ func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) UnmarshalPER return nil } +func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := extensionFields(additionalDLUPTNLInformationForHOItemExtIEs, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions) + w.WriteBit(additionalDLUPTNLInformationForHOItem.extensions.Present()) + w.WriteBit(additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil) + w.WriteBit(len(ext) > 0) + if err := additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if err := additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse.MarshalPER(w, enc); err != nil { + return err + } + if additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil { + if err := (*additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if additionalDLUPTNLInformationForHOItem.extensions.Present() { + if err := additionalDLUPTNLInformationForHOItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AdditionalDLForwardingUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AdditionalDLForwardingUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation = &v + } + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, additionalDLUPTNLInformationForHOItemExtIEs, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := additionalDLUPTNLInformationForHOItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(allocationAndRetentionPriority.extensions.Present()) + w.WriteBit(allocationAndRetentionPriority.iEExtensions != nil) if err := allocationAndRetentionPriority.PriorityLevelARP.MarshalPER(w, enc); err != nil { return err } @@ -213,6 +281,16 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER if err := encodeRootEnumerated(w, enc, 2, int64(allocationAndRetentionPriority.PreemptionVulnerability), "PreemptionVulnerability"); err != nil { return err } + if allocationAndRetentionPriority.iEExtensions != nil { + if err := (*allocationAndRetentionPriority.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if allocationAndRetentionPriority.extensions.Present() { + if err := allocationAndRetentionPriority.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -221,7 +299,7 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -238,35 +316,17 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return err } allocationAndRetentionPriority.PreemptionVulnerability = PreemptionVulnerability(e2) - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + allocationAndRetentionPriority.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := allocationAndRetentionPriority.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -1317,10 +1377,10 @@ func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) UnmarshalPER(r *per. } func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(dataForwardingResponseDRBItem.extensions.Present()) w.WriteBit(dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil) w.WriteBit(dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil) - w.WriteBit(false) + w.WriteBit(dataForwardingResponseDRBItem.iEExtensions != nil) if err := dataForwardingResponseDRBItem.DRBID.MarshalPER(w, enc); err != nil { return err } @@ -1334,6 +1394,16 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w return err } } + if dataForwardingResponseDRBItem.iEExtensions != nil { + if err := (*dataForwardingResponseDRBItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if dataForwardingResponseDRBItem.extensions.Present() { + if err := dataForwardingResponseDRBItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1350,7 +1420,7 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1371,46 +1441,80 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER } dataForwardingResponseDRBItem.ULForwardingUPTNLInformation = &v } - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + dataForwardingResponseDRBItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := dataForwardingResponseDRBItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + return nil +} + +func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(dataForwardingResponseERABListItem.extensions.Present()) + w.WriteBit(dataForwardingResponseERABListItem.iEExtensions != nil) + if err := dataForwardingResponseERABListItem.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if err := dataForwardingResponseERABListItem.DLForwardingUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if dataForwardingResponseERABListItem.iEExtensions != nil { + if err := (*dataForwardingResponseERABListItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if dataForwardingResponseERABListItem.extensions.Present() { + if err := dataForwardingResponseERABListItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&dataForwardingResponseERABListItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&dataForwardingResponseERABListItem.DLForwardingUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + dataForwardingResponseERABListItem.iEExtensions = &v + } + if extBit { + if err := dataForwardingResponseERABListItem.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(dynamic5QIDescriptor.extensions.Present()) w.WriteBit(dynamic5QIDescriptor.FiveQI != nil) w.WriteBit(dynamic5QIDescriptor.DelayCritical != nil) w.WriteBit(dynamic5QIDescriptor.AveragingWindow != nil) w.WriteBit(dynamic5QIDescriptor.MaximumDataBurstVolume != nil) - w.WriteBit(false) + w.WriteBit(dynamic5QIDescriptor.iEExtensions != nil) if err := dynamic5QIDescriptor.PriorityLevelQos.MarshalPER(w, enc); err != nil { return err } @@ -1440,6 +1544,16 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc return err } } + if dynamic5QIDescriptor.iEExtensions != nil { + if err := (*dynamic5QIDescriptor.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if dynamic5QIDescriptor.extensions.Present() { + if err := dynamic5QIDescriptor.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1464,7 +1578,7 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, en if err != nil { return err } - p_f7, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1507,35 +1621,17 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, en } dynamic5QIDescriptor.MaximumDataBurstVolume = &v } - if p_f7 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + dynamic5QIDescriptor.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := dynamic5QIDescriptor.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -2281,11 +2377,11 @@ func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r } func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(gBRQosInformation.extensions.Present()) w.WriteBit(gBRQosInformation.NotificationControl != nil) w.WriteBit(gBRQosInformation.MaximumPacketLossRateDL != nil) w.WriteBit(gBRQosInformation.MaximumPacketLossRateUL != nil) - w.WriteBit(false) + w.WriteBit(gBRQosInformation.iEExtensions != nil) if err := gBRQosInformation.MaximumFlowBitRateDL.MarshalPER(w, enc); err != nil { return err } @@ -2313,6 +2409,16 @@ func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.En return err } } + if gBRQosInformation.iEExtensions != nil { + if err := (*gBRQosInformation.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if gBRQosInformation.extensions.Present() { + if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -2333,7 +2439,7 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. if err != nil { return err } - p_f7, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -2372,48 +2478,40 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. } gBRQosInformation.MaximumPacketLossRateUL = &v } - if p_f7 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + gBRQosInformation.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (gTPTunnel *GTPTunnel) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(gTPTunnel.extensions.Present()) + w.WriteBit(gTPTunnel.iEExtensions != nil) if err := gTPTunnel.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } if err := gTPTunnel.GTPTEID.MarshalPER(w, enc); err != nil { return err } + if gTPTunnel.iEExtensions != nil { + if err := (*gTPTunnel.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if gTPTunnel.extensions.Present() { + if err := gTPTunnel.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -2422,7 +2520,7 @@ func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -2432,35 +2530,17 @@ func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error if err := (&gTPTunnel.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + gTPTunnel.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := gTPTunnel.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -2644,11 +2724,12 @@ func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding } func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(handoverCommandTransferExtIEs, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions) + w.WriteBit(handoverCommandTransfer.extensions.Present()) w.WriteBit(handoverCommandTransfer.DLForwardingUPTNLInformation != nil) w.WriteBit(handoverCommandTransfer.QosFlowToBeForwarded != nil) w.WriteBit(handoverCommandTransfer.DataForwardingResponseDRB != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if handoverCommandTransfer.DLForwardingUPTNLInformation != nil { if err := (*handoverCommandTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { return err @@ -2664,11 +2745,21 @@ func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer return err } } - return nil -} - -func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if handoverCommandTransfer.extensions.Present() { + if err := handoverCommandTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() if err != nil { return err } @@ -2684,7 +2775,7 @@ func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Read if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -2705,35 +2796,15 @@ func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Read return err } } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, handoverCommandTransferExtIEs, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := handoverCommandTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -2793,12 +2864,13 @@ func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTr } func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(handoverRequestAcknowledgeTransferExtIEs, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions) + w.WriteBit(handoverRequestAcknowledgeTransfer.extensions.Present()) w.WriteBit(handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil) w.WriteBit(handoverRequestAcknowledgeTransfer.SecurityResult != nil) w.WriteBit(handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil) w.WriteBit(handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } @@ -2825,6 +2897,16 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Ma return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if handoverRequestAcknowledgeTransfer.extensions.Present() { + if err := handoverRequestAcknowledgeTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -2849,7 +2931,7 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un if err != nil { return err } - p_f6, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -2883,35 +2965,15 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un return err } } - if p_f6 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, handoverRequestAcknowledgeTransferExtIEs, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := handoverRequestAcknowledgeTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -3408,11 +3470,11 @@ func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(nonDynamic5QIDescriptor.extensions.Present()) w.WriteBit(nonDynamic5QIDescriptor.PriorityLevelQos != nil) w.WriteBit(nonDynamic5QIDescriptor.AveragingWindow != nil) w.WriteBit(nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil) - w.WriteBit(false) + w.WriteBit(nonDynamic5QIDescriptor.iEExtensions != nil) if err := nonDynamic5QIDescriptor.FiveQI.MarshalPER(w, enc); err != nil { return err } @@ -3431,6 +3493,16 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer return err } } + if nonDynamic5QIDescriptor.iEExtensions != nil { + if err := (*nonDynamic5QIDescriptor.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if nonDynamic5QIDescriptor.extensions.Present() { + if err := nonDynamic5QIDescriptor.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -3451,7 +3523,7 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Read if err != nil { return err } - p_f4, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -3479,35 +3551,17 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Read } nonDynamic5QIDescriptor.MaximumDataBurstVolume = &v } - if p_f4 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + nonDynamic5QIDescriptor.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := nonDynamic5QIDescriptor.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -3621,14 +3675,24 @@ func (overloadStartNSSAIItem *OverloadStartNSSAIItem) UnmarshalPER(r *per.Reader } func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionAggregateMaximumBitRate.extensions.Present()) + w.WriteBit(pDUSessionAggregateMaximumBitRate.iEExtensions != nil) if err := pDUSessionAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { return err } + if pDUSessionAggregateMaximumBitRate.iEExtensions != nil { + if err := (*pDUSessionAggregateMaximumBitRate.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionAggregateMaximumBitRate.extensions.Present() { + if err := pDUSessionAggregateMaximumBitRate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -3637,7 +3701,7 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Unma if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -3647,48 +3711,40 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Unma if err := (&pDUSessionAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionAggregateMaximumBitRate.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionAggregateMaximumBitRate.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceAdmittedItem.extensions.Present()) + w.WriteBit(pDUSessionResourceAdmittedItem.iEExtensions != nil) if err := pDUSessionResourceAdmittedItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceAdmittedItem.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceAdmittedItem.iEExtensions != nil { + if err := (*pDUSessionResourceAdmittedItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceAdmittedItem.extensions.Present() { + if err := pDUSessionResourceAdmittedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -3697,7 +3753,7 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalP if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -3707,35 +3763,17 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalP if err := (&pDUSessionResourceAdmittedItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceAdmittedItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -4161,14 +4199,24 @@ func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupI } func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceHandoverItem.extensions.Present()) + w.WriteBit(pDUSessionResourceHandoverItem.iEExtensions != nil) if err := pDUSessionResourceHandoverItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceHandoverItem.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceHandoverItem.iEExtensions != nil { + if err := (*pDUSessionResourceHandoverItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceHandoverItem.extensions.Present() { + if err := pDUSessionResourceHandoverItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4177,7 +4225,7 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalP if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -4187,35 +4235,17 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalP if err := (&pDUSessionResourceHandoverItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceHandoverItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceHandoverItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -4456,10 +4486,11 @@ func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r * } func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(pDUSessionResourceModifyConfirmTransferExtIEs, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyConfirmTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil) w.WriteBit(pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.MarshalPER(w, enc); err != nil { return err } @@ -4476,6 +4507,16 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyConfirmTransfer.extensions.Present() { + if err := pDUSessionResourceModifyConfirmTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4492,7 +4533,7 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr if err != nil { return err } - p_f4, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -4512,43 +4553,24 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr return err } } - if p_f4 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyConfirmTransferExtIEs, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceModifyConfirmTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(pDUSessionResourceModifyIndicationTransferExtIEs, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyIndicationTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { return err } @@ -4557,6 +4579,16 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyIndicationTransfer.extensions.Present() { + if err := pDUSessionResourceModifyIndicationTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4569,7 +4601,7 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -4581,35 +4613,15 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica return err } } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyIndicationTransferExtIEs, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceModifyIndicationTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -4669,14 +4681,24 @@ func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResource } func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceModifyItemModCfm.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyItemModCfm.iEExtensions != nil) if err := pDUSessionResourceModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceModifyItemModCfm.iEExtensions != nil { + if err := (*pDUSessionResourceModifyItemModCfm.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModCfm.extensions.Present() { + if err := pDUSessionResourceModifyItemModCfm.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4685,7 +4707,7 @@ func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Un if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -4695,48 +4717,40 @@ func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Un if err := (&pDUSessionResourceModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceModifyItemModCfm.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceModifyItemModCfm.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceModifyItemModInd.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyItemModInd.iEExtensions != nil) if err := pDUSessionResourceModifyItemModInd.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceModifyItemModInd.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceModifyItemModInd.iEExtensions != nil { + if err := (*pDUSessionResourceModifyItemModInd.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModInd.extensions.Present() { + if err := pDUSessionResourceModifyItemModInd.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4745,7 +4759,7 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Un if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -4755,43 +4769,26 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Un if err := (&pDUSessionResourceModifyItemModInd.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceModifyItemModInd.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceModifyItemModInd.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(pDUSessionResourceModifyItemModReqExtIEs, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions) + w.WriteBit(pDUSessionResourceModifyItemModReq.extensions.Present()) w.WriteBit(pDUSessionResourceModifyItemModReq.NASPDU != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := pDUSessionResourceModifyItemModReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } @@ -4803,6 +4800,16 @@ func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Ma if err := pDUSessionResourceModifyItemModReq.Transfer.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModReq.extensions.Present() { + if err := pDUSessionResourceModifyItemModReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4815,7 +4822,7 @@ func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Un if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -4832,48 +4839,38 @@ func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Un if err := (&pDUSessionResourceModifyItemModReq.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyItemModReqExtIEs, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceModifyItemModReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceModifyItemModRes.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyItemModRes.iEExtensions != nil) if err := pDUSessionResourceModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceModifyItemModRes.iEExtensions != nil { + if err := (*pDUSessionResourceModifyItemModRes.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModRes.extensions.Present() { + if err := pDUSessionResourceModifyItemModRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4882,7 +4879,7 @@ func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Un if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -4892,47 +4889,30 @@ func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Un if err := (&pDUSessionResourceModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceModifyItemModRes.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceModifyItemModRes.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(pDUSessionResourceModifyResponseTransferExtIEs, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil) w.WriteBit(pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil) w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil) w.WriteBit(pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil { if err := (*pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation).MarshalPER(w, enc); err != nil { return err @@ -4958,6 +4938,16 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.extensions.Present() { + if err := pDUSessionResourceModifyResponseTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -4986,7 +4976,7 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse if err != nil { return err } - p_f5, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -5019,35 +5009,15 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse return err } } - if p_f5 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyResponseTransferExtIEs, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceModifyResponseTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -5604,9 +5574,9 @@ func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes } func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemCxtReq.extensions.Present()) w.WriteBit(pDUSessionResourceSetupItemCxtReq.NASPDU != nil) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemCxtReq.iEExtensions != nil) if err := pDUSessionResourceSetupItemCxtReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } @@ -5621,6 +5591,16 @@ func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Mars if err := pDUSessionResourceSetupItemCxtReq.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceSetupItemCxtReq.iEExtensions != nil { + if err := (*pDUSessionResourceSetupItemCxtReq.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupItemCxtReq.extensions.Present() { + if err := pDUSessionResourceSetupItemCxtReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -5633,7 +5613,7 @@ func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Unma if err != nil { return err } - p_f4, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -5653,48 +5633,40 @@ func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Unma if err := (&pDUSessionResourceSetupItemCxtReq.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f4 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceSetupItemCxtReq.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceSetupItemCxtReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemCxtRes.extensions.Present()) + w.WriteBit(pDUSessionResourceSetupItemCxtRes.iEExtensions != nil) if err := pDUSessionResourceSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceSetupItemCxtRes.iEExtensions != nil { + if err := (*pDUSessionResourceSetupItemCxtRes.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupItemCxtRes.extensions.Present() { + if err := pDUSessionResourceSetupItemCxtRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -5703,7 +5675,7 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Unma if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -5713,42 +5685,24 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Unma if err := (&pDUSessionResourceSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceSetupItemCxtRes.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceSetupItemCxtRes.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemHOReq.extensions.Present()) + w.WriteBit(pDUSessionResourceSetupItemHOReq.iEExtensions != nil) if err := pDUSessionResourceSetupItemHOReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } @@ -5758,6 +5712,16 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Marsha if err := pDUSessionResourceSetupItemHOReq.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceSetupItemHOReq.iEExtensions != nil { + if err := (*pDUSessionResourceSetupItemHOReq.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupItemHOReq.extensions.Present() { + if err := pDUSessionResourceSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -5766,7 +5730,7 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Unmars if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -5779,43 +5743,25 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Unmars if err := (&pDUSessionResourceSetupItemHOReq.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceSetupItemHOReq.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemSUReq.extensions.Present()) w.WriteBit(pDUSessionResourceSetupItemSUReq.NASPDU != nil) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemSUReq.iEExtensions != nil) if err := pDUSessionResourceSetupItemSUReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } @@ -5830,6 +5776,16 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Marsha if err := pDUSessionResourceSetupItemSUReq.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceSetupItemSUReq.iEExtensions != nil { + if err := (*pDUSessionResourceSetupItemSUReq.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupItemSUReq.extensions.Present() { + if err := pDUSessionResourceSetupItemSUReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -5842,7 +5798,7 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Unmars if err != nil { return err } - p_f4, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -5862,48 +5818,40 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Unmars if err := (&pDUSessionResourceSetupItemSUReq.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f4 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceSetupItemSUReq.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceSetupItemSUReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSetupItemSURes.extensions.Present()) + w.WriteBit(pDUSessionResourceSetupItemSURes.iEExtensions != nil) if err := pDUSessionResourceSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceSetupItemSURes.iEExtensions != nil { + if err := (*pDUSessionResourceSetupItemSURes.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupItemSURes.extensions.Present() { + if err := pDUSessionResourceSetupItemSURes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -5912,7 +5860,7 @@ func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Unmars if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -5922,45 +5870,28 @@ func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Unmars if err := (&pDUSessionResourceSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceSetupItemSURes.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceSetupItemSURes.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(pDUSessionResourceSetupResponseTransferExtIEs, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) w.WriteBit(pDUSessionResourceSetupResponseTransfer.SecurityResult != nil) w.WriteBit(pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { return err } @@ -5979,6 +5910,16 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupResponseTransfer.extensions.Present() { + if err := pDUSessionResourceSetupResponseTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -5999,7 +5940,7 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr if err != nil { return err } - p_f4, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6023,35 +5964,15 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr return err } } - if p_f4 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, pDUSessionResourceSetupResponseTransferExtIEs, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceSetupResponseTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -6128,14 +6049,24 @@ func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsucc } func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceSwitchedItem.extensions.Present()) + w.WriteBit(pDUSessionResourceSwitchedItem.iEExtensions != nil) if err := pDUSessionResourceSwitchedItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceSwitchedItem.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceSwitchedItem.iEExtensions != nil { + if err := (*pDUSessionResourceSwitchedItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSwitchedItem.extensions.Present() { + if err := pDUSessionResourceSwitchedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6144,7 +6075,7 @@ func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalP if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6154,48 +6085,40 @@ func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalP if err := (&pDUSessionResourceSwitchedItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceSwitchedItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceSwitchedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(pDUSessionResourceToBeSwitchedDLItem.extensions.Present()) + w.WriteBit(pDUSessionResourceToBeSwitchedDLItem.iEExtensions != nil) if err := pDUSessionResourceToBeSwitchedDLItem.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if err := pDUSessionResourceToBeSwitchedDLItem.Transfer.MarshalPER(w, enc); err != nil { return err } + if pDUSessionResourceToBeSwitchedDLItem.iEExtensions != nil { + if err := (*pDUSessionResourceToBeSwitchedDLItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceToBeSwitchedDLItem.extensions.Present() { + if err := pDUSessionResourceToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6204,7 +6127,7 @@ func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6214,35 +6137,17 @@ func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem if err := (&pDUSessionResourceToBeSwitchedDLItem.Transfer).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + pDUSessionResourceToBeSwitchedDLItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pDUSessionResourceToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -6368,14 +6273,24 @@ func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelC } func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(packetErrorRate.extensions.Present()) + w.WriteBit(packetErrorRate.iEExtensions != nil) if err := packetErrorRate.Scalar.MarshalPER(w, enc); err != nil { return err } if err := packetErrorRate.Exponent.MarshalPER(w, enc); err != nil { return err } + if packetErrorRate.iEExtensions != nil { + if err := (*packetErrorRate.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if packetErrorRate.extensions.Present() { + if err := packetErrorRate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6384,7 +6299,7 @@ func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Enco if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6394,35 +6309,17 @@ func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Enco if err := (&packetErrorRate.Exponent).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + packetErrorRate.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := packetErrorRate.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -6482,10 +6379,11 @@ func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) UnmarshalPER(r *per. } func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(pathSwitchRequestAcknowledgeTransferExtIEs, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions) + w.WriteBit(pathSwitchRequestAcknowledgeTransfer.extensions.Present()) w.WriteBit(pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil) w.WriteBit(pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil { if err := (*pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { return err @@ -6496,6 +6394,16 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if pathSwitchRequestAcknowledgeTransfer.extensions.Present() { + if err := pathSwitchRequestAcknowledgeTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6512,7 +6420,7 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6530,35 +6438,15 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer } pathSwitchRequestAcknowledgeTransfer.SecurityIndication = &v } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, pathSwitchRequestAcknowledgeTransferExtIEs, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pathSwitchRequestAcknowledgeTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -6618,10 +6506,11 @@ func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer } func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(pathSwitchRequestTransferExtIEs, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions) + w.WriteBit(pathSwitchRequestTransfer.extensions.Present()) w.WriteBit(pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil) w.WriteBit(pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := pathSwitchRequestTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } @@ -6638,6 +6527,16 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Wr if err := pathSwitchRequestTransfer.QosFlowAccepted.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if pathSwitchRequestTransfer.extensions.Present() { + if err := pathSwitchRequestTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6654,7 +6553,7 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per. if err != nil { return err } - p_f4, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6678,35 +6577,15 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per. if err := (&pathSwitchRequestTransfer.QosFlowAccepted).UnmarshalPER(r, enc); err != nil { return err } - if p_f4 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, pathSwitchRequestTransferExtIEs, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := pathSwitchRequestTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -6766,11 +6645,21 @@ func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransf } func (qosFlowAcceptedItem *QosFlowAcceptedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(qosFlowAcceptedItem.extensions.Present()) + w.WriteBit(qosFlowAcceptedItem.iEExtensions != nil) if err := qosFlowAcceptedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } + if qosFlowAcceptedItem.iEExtensions != nil { + if err := (*qosFlowAcceptedItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowAcceptedItem.extensions.Present() { + if err := qosFlowAcceptedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6779,51 +6668,34 @@ func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } if err := (&qosFlowAcceptedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowAcceptedItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowAcceptedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(qosFlowAddOrModifyRequestItemExtIEs, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions) + w.WriteBit(qosFlowAddOrModifyRequestItem.extensions.Present()) w.WriteBit(qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil) w.WriteBit(qosFlowAddOrModifyRequestItem.ERABID != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := qosFlowAddOrModifyRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } @@ -6837,6 +6709,16 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if qosFlowAddOrModifyRequestItem.extensions.Present() { + if err := qosFlowAddOrModifyRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6853,7 +6735,7 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -6874,45 +6756,36 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER } qosFlowAddOrModifyRequestItem.ERABID = &v } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, qosFlowAddOrModifyRequestItemExtIEs, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowAddOrModifyRequestItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + ext := extensionFields(qosFlowAddOrModifyResponseItemExtIEs, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions) + w.WriteBit(qosFlowAddOrModifyResponseItem.extensions.Present()) + w.WriteBit(len(ext) > 0) if err := qosFlowAddOrModifyResponseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if qosFlowAddOrModifyResponseItem.extensions.Present() { + if err := qosFlowAddOrModifyResponseItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -6921,42 +6794,22 @@ func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalP if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } if err := (&qosFlowAddOrModifyResponseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, qosFlowAddOrModifyResponseItemExtIEs, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowAddOrModifyResponseItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -7025,9 +6878,9 @@ func (qosFlowInformationItem *QosFlowInformationItem) UnmarshalPER(r *per.Reader } func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(qosFlowItemWithDataForwarding.extensions.Present()) w.WriteBit(qosFlowItemWithDataForwarding.DataForwardingAccepted != nil) - w.WriteBit(false) + w.WriteBit(qosFlowItemWithDataForwarding.iEExtensions != nil) if err := qosFlowItemWithDataForwarding.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } @@ -7036,6 +6889,16 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w return err } } + if qosFlowItemWithDataForwarding.iEExtensions != nil { + if err := (*qosFlowItemWithDataForwarding.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowItemWithDataForwarding.extensions.Present() { + if err := qosFlowItemWithDataForwarding.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7048,7 +6911,7 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7062,45 +6925,27 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER } qosFlowItemWithDataForwarding.DataForwardingAccepted = &v } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowItemWithDataForwarding.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowItemWithDataForwarding.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(qosFlowLevelQosParameters.extensions.Present()) w.WriteBit(qosFlowLevelQosParameters.GBRQosInformation != nil) w.WriteBit(qosFlowLevelQosParameters.ReflectiveQosAttribute != nil) w.WriteBit(qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil) - w.WriteBit(false) + w.WriteBit(qosFlowLevelQosParameters.iEExtensions != nil) if err := qosFlowLevelQosParameters.QosCharacteristics.MarshalPER(w, enc); err != nil { return err } @@ -7122,6 +6967,16 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Wr return err } } + if qosFlowLevelQosParameters.iEExtensions != nil { + if err := (*qosFlowLevelQosParameters.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowLevelQosParameters.extensions.Present() { + if err := qosFlowLevelQosParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7142,7 +6997,7 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per. if err != nil { return err } - p_f5, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7177,45 +7032,37 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per. v = AdditionalQosFlowInformation(e4) qosFlowLevelQosParameters.AdditionalQosFlowInformation = &v } - if p_f5 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowLevelQosParameters.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowLevelQosParameters.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(qosFlowModifyConfirmItem.extensions.Present()) + w.WriteBit(qosFlowModifyConfirmItem.iEExtensions != nil) if err := qosFlowModifyConfirmItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } + if qosFlowModifyConfirmItem.iEExtensions != nil { + if err := (*qosFlowModifyConfirmItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowModifyConfirmItem.extensions.Present() { + if err := qosFlowModifyConfirmItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7224,42 +7071,24 @@ func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Re if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } if err := (&qosFlowModifyConfirmItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowModifyConfirmItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowModifyConfirmItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -7327,14 +7156,24 @@ func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per. } func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(qosFlowPerTNLInformation.extensions.Present()) + w.WriteBit(qosFlowPerTNLInformation.iEExtensions != nil) if err := qosFlowPerTNLInformation.UPTransportLayerInformation.MarshalPER(w, enc); err != nil { return err } if err := qosFlowPerTNLInformation.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { return err } + if qosFlowPerTNLInformation.iEExtensions != nil { + if err := (*qosFlowPerTNLInformation.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowPerTNLInformation.extensions.Present() { + if err := qosFlowPerTNLInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7343,7 +7182,7 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Re if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7353,45 +7192,37 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Re if err := (&qosFlowPerTNLInformation.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowPerTNLInformation.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowPerTNLInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(qosFlowPerTNLInformationItem.extensions.Present()) + w.WriteBit(qosFlowPerTNLInformationItem.iEExtensions != nil) if err := qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { return err } + if qosFlowPerTNLInformationItem.iEExtensions != nil { + if err := (*qosFlowPerTNLInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowPerTNLInformationItem.extensions.Present() { + if err := qosFlowPerTNLInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7400,50 +7231,32 @@ func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } if err := (&qosFlowPerTNLInformationItem.QosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowPerTNLInformationItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowPerTNLInformationItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(qosFlowSetupRequestItem.extensions.Present()) w.WriteBit(qosFlowSetupRequestItem.ERABID != nil) - w.WriteBit(false) + w.WriteBit(qosFlowSetupRequestItem.iEExtensions != nil) if err := qosFlowSetupRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } @@ -7455,6 +7268,16 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer return err } } + if qosFlowSetupRequestItem.iEExtensions != nil { + if err := (*qosFlowSetupRequestItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowSetupRequestItem.extensions.Present() { + if err := qosFlowSetupRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7467,7 +7290,7 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Read if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7484,45 +7307,37 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Read } qosFlowSetupRequestItem.ERABID = &v } - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowSetupRequestItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowSetupRequestItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(qosFlowToBeForwardedItem.extensions.Present()) + w.WriteBit(qosFlowToBeForwardedItem.iEExtensions != nil) if err := qosFlowToBeForwardedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } + if qosFlowToBeForwardedItem.iEExtensions != nil { + if err := (*qosFlowToBeForwardedItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowToBeForwardedItem.extensions.Present() { + if err := qosFlowToBeForwardedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7531,55 +7346,47 @@ func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Re if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } if err := (&qosFlowToBeForwardedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowToBeForwardedItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowToBeForwardedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (qosFlowWithCauseItem *QosFlowWithCauseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(qosFlowWithCauseItem.extensions.Present()) + w.WriteBit(qosFlowWithCauseItem.iEExtensions != nil) if err := qosFlowWithCauseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } if err := qosFlowWithCauseItem.Cause.MarshalPER(w, enc); err != nil { return err } + if qosFlowWithCauseItem.iEExtensions != nil { + if err := (*qosFlowWithCauseItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowWithCauseItem.extensions.Present() { + if err := qosFlowWithCauseItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7588,7 +7395,7 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, en if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7598,35 +7405,17 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, en if err := (&qosFlowWithCauseItem.Cause).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + qosFlowWithCauseItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := qosFlowWithCauseItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -7738,9 +7527,9 @@ func (requestedNSSAIItem *RequestedNSSAIItem) UnmarshalPER(r *per.Reader, enc pe } func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(sNSSAI.extensions.Present()) w.WriteBit(sNSSAI.SD != nil) - w.WriteBit(false) + w.WriteBit(sNSSAI.iEExtensions != nil) if err := sNSSAI.SST.MarshalPER(w, enc); err != nil { return err } @@ -7749,6 +7538,16 @@ func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } } + if sNSSAI.iEExtensions != nil { + if err := (*sNSSAI.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if sNSSAI.extensions.Present() { + if err := sNSSAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7761,7 +7560,7 @@ func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7775,34 +7574,16 @@ func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } sNSSAI.SD = &v } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + sNSSAI.iEExtensions = &v + } + if extBit { + if err := sNSSAI.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil @@ -7871,9 +7652,9 @@ func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Enco } func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(securityIndication.extensions.Present()) w.WriteBit(securityIndication.MaximumIntegrityProtectedDataRateUL != nil) - w.WriteBit(false) + w.WriteBit(securityIndication.iEExtensions != nil) if err := encodeRootEnumerated(w, enc, 3, int64(securityIndication.IntegrityProtectionIndication), "IntegrityProtectionIndication"); err != nil { return err } @@ -7885,6 +7666,16 @@ func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per. return err } } + if securityIndication.iEExtensions != nil { + if err := (*securityIndication.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if securityIndication.extensions.Present() { + if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7897,7 +7688,7 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7920,48 +7711,40 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe v = MaximumIntegrityProtectedDataRate(e2) securityIndication.MaximumIntegrityProtectedDataRateUL = &v } - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + securityIndication.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (securityResult *SecurityResult) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(securityResult.extensions.Present()) + w.WriteBit(securityResult.iEExtensions != nil) if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.IntegrityProtectionResult), "IntegrityProtectionResult"); err != nil { return err } if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.ConfidentialityProtectionResult), "ConfidentialityProtectionResult"); err != nil { return err } + if securityResult.iEExtensions != nil { + if err := (*securityResult.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if securityResult.extensions.Present() { + if err := securityResult.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -7970,7 +7753,7 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -7984,35 +7767,17 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi return err } securityResult.ConfidentialityProtectionResult = ConfidentialityProtectionResult(e1) - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + securityResult.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := securityResult.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -9364,14 +9129,25 @@ func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) UnmarshalPER(r *pe } func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + ext := extensionFields(uLNGUUPTNLModifyItemExtIEs, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions) + w.WriteBit(uLNGUUPTNLModifyItem.extensions.Present()) + w.WriteBit(len(ext) > 0) if err := uLNGUUPTNLModifyItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } if err := uLNGUUPTNLModifyItem.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if uLNGUUPTNLModifyItem.extensions.Present() { + if err := uLNGUUPTNLModifyItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -9380,7 +9156,7 @@ func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) UnmarshalPER(r *per.Reader, en if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -9390,45 +9166,35 @@ func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) UnmarshalPER(r *per.Reader, en if err := (&uLNGUUPTNLModifyItem.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, uLNGUUPTNLModifyItemExtIEs, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := uLNGUUPTNLModifyItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(uPTransportLayerInformationItem.extensions.Present()) + w.WriteBit(uPTransportLayerInformationItem.iEExtensions != nil) if err := uPTransportLayerInformationItem.NGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } + if uPTransportLayerInformationItem.iEExtensions != nil { + if err := (*uPTransportLayerInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if uPTransportLayerInformationItem.extensions.Present() { + if err := uPTransportLayerInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -9437,55 +9203,47 @@ func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) Unmarsha if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } if err := (&uPTransportLayerInformationItem.NGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + uPTransportLayerInformationItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := uPTransportLayerInformationItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(uPTransportLayerInformationPairItem.extensions.Present()) + w.WriteBit(uPTransportLayerInformationPairItem.iEExtensions != nil) if err := uPTransportLayerInformationPairItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } if err := uPTransportLayerInformationPairItem.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } + if uPTransportLayerInformationPairItem.iEExtensions != nil { + if err := (*uPTransportLayerInformationPairItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if uPTransportLayerInformationPairItem.extensions.Present() { + if err := uPTransportLayerInformationPairItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -9494,7 +9252,7 @@ func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -9504,48 +9262,98 @@ func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) if err := (&uPTransportLayerInformationPairItem.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + uPTransportLayerInformationPairItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := uPTransportLayerInformationPairItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + return nil +} + +func (userPlaneFailureIndication *UserPlaneFailureIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(userPlaneFailureIndication.extensions.Present()) + w.WriteBit(userPlaneFailureIndication.iEExtensions != nil) + if err := userPlaneFailureIndication.UserPlaneFailureType.MarshalPER(w, enc); err != nil { + return err + } + if err := userPlaneFailureIndication.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if err := userPlaneFailureIndication.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if userPlaneFailureIndication.iEExtensions != nil { + if err := (*userPlaneFailureIndication.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if userPlaneFailureIndication.extensions.Present() { + if err := userPlaneFailureIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userPlaneFailureIndication *UserPlaneFailureIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userPlaneFailureIndication.UserPlaneFailureType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userPlaneFailureIndication.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userPlaneFailureIndication.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userPlaneFailureIndication.iEExtensions = &v + } + if extBit { + if err := userPlaneFailureIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } func (userPlaneSecurityInformation *UserPlaneSecurityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(userPlaneSecurityInformation.extensions.Present()) + w.WriteBit(userPlaneSecurityInformation.iEExtensions != nil) if err := userPlaneSecurityInformation.SecurityResult.MarshalPER(w, enc); err != nil { return err } if err := userPlaneSecurityInformation.SecurityIndication.MarshalPER(w, enc); err != nil { return err } + if userPlaneSecurityInformation.iEExtensions != nil { + if err := (*userPlaneSecurityInformation.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if userPlaneSecurityInformation.extensions.Present() { + if err := userPlaneSecurityInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -9554,7 +9362,7 @@ func (userPlaneSecurityInformation *UserPlaneSecurityInformation) UnmarshalPER(r if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -9564,35 +9372,17 @@ func (userPlaneSecurityInformation *UserPlaneSecurityInformation) UnmarshalPER(r if err := (&userPlaneSecurityInformation.SecurityIndication).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + userPlaneSecurityInformation.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := userPlaneSecurityInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } diff --git a/ngap/symmetry_test.go b/ngap/symmetry_test.go index 77169b6527..306862b1da 100644 --- a/ngap/symmetry_test.go +++ b/ngap/symmetry_test.go @@ -40,8 +40,11 @@ var mandatedDeviations = map[string]string{ // NGAP lists are plain SEQUENCE OF Item; S1AP wraps its E-RAB list items // in ProtocolIE-SingleContainer, which needs a list codec NGAP has no use // for (TS 36.413 §9.1.3 vs TS 38.413 §9.3.1). - "s1ap only: func encodeSingleContainerList": "S1AP ProtocolIE-SingleContainer lists (TS 36.413 §9.1.3)", - "s1ap only: func decodeItemList": "S1AP ProtocolIE-SingleContainer lists (TS 36.413 §9.1.3)", + "s1ap only: func encodeSingleContainerList": "S1AP ProtocolIE-SingleContainer lists (TS 36.413 §9.1.3)", + "s1ap only: func decodeItemList": "S1AP ProtocolIE-SingleContainer lists (TS 36.413 §9.1.3)", + "s1ap only: type containerCrit": "S1AP E-RAB-IE-ContainerList elements carry their own criticality (TS 36.413 §9.3, E-RAB-IE-ContainerList)", + "s1ap only: type containerCritical": "S1AP E-RAB-IE-ContainerList elements carry their own criticality (TS 36.413 §9.3, E-RAB-IE-ContainerList)", + "s1ap only: func (containerCrit) wireCriticality": "S1AP E-RAB-IE-ContainerList elements carry their own criticality (TS 36.413 §9.3, E-RAB-IE-ContainerList)", // PATH SWITCH REQUEST FAILURE reports a mandatory released session list in // NGAP (TS 38.413 §9.2.3.10) and a mandatory Cause with no list in S1AP @@ -52,7 +55,9 @@ var mandatedDeviations = map[string]string{ // ngapOnlyFiles' mirror, so a file added to one side and forgotten on the other // is caught whichever side it landed on. -var s1apOnlyFiles = map[string]string{} +var s1apOnlyFiles = map[string]string{ + "erab_lists.go": "E-RAB-IE-ContainerList of ProtocolIE-SingleContainer per user-plane E-RAB list; NGAP lists are plain SEQUENCE OF (TS 36.413 §9.3, TS 38.413 §9.3)", +} // S1AP files whose NGAP counterparts are not written yet — outstanding work, // not a mandated asymmetry. Entries are deleted as counterparts appear, so the diff --git a/ngap/table_order_test.go b/ngap/table_order_test.go index 7771e6c304..e29cb7117a 100644 --- a/ngap/table_order_test.go +++ b/ngap/table_order_test.go @@ -87,8 +87,20 @@ func TestTableOrderMatchesASN1(t *testing.T) { // The §9.3.4 transfer containers reuse the ProtocolIE-Container shape, so // their rows are ordered by the same rule. - {"PDUSessionResourceSetupRequestTransfer", tableIDs(pDUSessionResourceSetupRequestTransferIEs), []ProtocolIEID{IDPDUSessionAggregateMaximumBitRate, IDULNGUUPTNLInformation, IDAdditionalULNGUUPTNLInformation, IDDataForwardingNotPossible, IDPDUSessionType, IDSecurityIndication, IDNetworkInstance, IDQosFlowSetupRequestList, IDDirectForwardingPathAvailability}}, - {"PDUSessionResourceModifyRequestTransfer", tableIDs(pDUSessionResourceModifyRequestTransferIEs), []ProtocolIEID{IDPDUSessionAggregateMaximumBitRate, IDULNGUUPTNLModifyList, IDNetworkInstance, IDQosFlowAddOrModifyRequestList, IDQosFlowToReleaseList, IDAdditionalULNGUUPTNLInformation}}, + {"PDUSessionResourceSetupRequestTransfer", tableIDs(pDUSessionResourceSetupRequestTransferIEs), []ProtocolIEID{IDPDUSessionAggregateMaximumBitRate, IDULNGUUPTNLInformation, IDAdditionalULNGUUPTNLInformation, IDDataForwardingNotPossible, IDPDUSessionType, IDSecurityIndication, IDNetworkInstance, IDQosFlowSetupRequestList, IDDirectForwardingPathAvailability, IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantULNGUUPTNLInformation}}, + {"PDUSessionResourceModifyRequestTransfer", tableIDs(pDUSessionResourceModifyRequestTransferIEs), []ProtocolIEID{IDPDUSessionAggregateMaximumBitRate, IDULNGUUPTNLModifyList, IDNetworkInstance, IDQosFlowAddOrModifyRequestList, IDQosFlowToReleaseList, IDAdditionalULNGUUPTNLInformation, IDAdditionalRedundantULNGUUPTNLInformation, IDRedundantULNGUUPTNLInformation, IDUserPlaneFailureIndication}}, + {"PDUSessionResourceSetupResponseTransfer extensions", tableIDs(pDUSessionResourceSetupResponseTransferExtIEs), []ProtocolIEID{IDRedundantDLQosFlowPerTNLInformation, IDAdditionalRedundantDLQosFlowPerTNLInformation}}, + {"PDUSessionResourceModifyResponseTransfer extensions", tableIDs(pDUSessionResourceModifyResponseTransferExtIEs), []ProtocolIEID{IDAdditionalNGUUPTNLInformation, IDRedundantDLNGUUPTNLInformation, IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantDLQosFlowPerTNLInformation, IDAdditionalRedundantNGUUPTNLInformation}}, + {"PDUSessionResourceModifyIndicationTransfer extensions", tableIDs(pDUSessionResourceModifyIndicationTransferExtIEs), []ProtocolIEID{IDRedundantDLQosFlowPerTNLInformation, IDAdditionalRedundantDLQosFlowPerTNLInformation}}, + {"PDUSessionResourceModifyConfirmTransfer extensions", tableIDs(pDUSessionResourceModifyConfirmTransferExtIEs), []ProtocolIEID{IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantNGUUPTNLInformation}}, + {"PathSwitchRequestTransfer extensions", tableIDs(pathSwitchRequestTransferExtIEs), []ProtocolIEID{IDAdditionalDLQosFlowPerTNLInformation, IDRedundantDLNGUUPTNLInformation, IDRedundantDLNGUTNLInformationReused, IDAdditionalRedundantDLQosFlowPerTNLInformation}}, + {"PathSwitchRequestAcknowledgeTransfer extensions", tableIDs(pathSwitchRequestAcknowledgeTransferExtIEs), []ProtocolIEID{IDAdditionalNGUUPTNLInformation, IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantNGUUPTNLInformation}}, + {"HandoverRequestAcknowledgeTransfer extensions", tableIDs(handoverRequestAcknowledgeTransferExtIEs), []ProtocolIEID{IDAdditionalDLUPTNLInformationForHOList, IDULForwardingUPTNLInformation, IDAdditionalULForwardingUPTNLInformation, IDDataForwardingResponseERABList, IDRedundantDLNGUUPTNLInformation}}, + {"HandoverCommandTransfer extensions", tableIDs(handoverCommandTransferExtIEs), []ProtocolIEID{IDAdditionalDLForwardingUPTNLInformation, IDULForwardingUPTNLInformation, IDAdditionalULForwardingUPTNLInformation, IDDataForwardingResponseERABList}}, + {"UL-NGU-UP-TNLModifyItem extensions", tableIDs(uLNGUUPTNLModifyItemExtIEs), []ProtocolIEID{IDRedundantULNGUUPTNLInformation, IDRedundantDLNGUUPTNLInformation}}, + {"AdditionalDLUPTNLInformationForHOItem extensions", tableIDs(additionalDLUPTNLInformationForHOItemExtIEs), []ProtocolIEID{IDAdditionalRedundantDLNGUUPTNLInformation}}, + {"QosFlowAddOrModifyRequestItem extensions", tableIDs(qosFlowAddOrModifyRequestItemExtIEs), []ProtocolIEID{IDULNGUUPTNLInformation}}, + {"QosFlowAddOrModifyResponseItem extensions", tableIDs(qosFlowAddOrModifyResponseItemExtIEs), []ProtocolIEID{IDDLNGUUPTNLInformation}}, } for _, tt := range tests { diff --git a/ngap/testdata/fuzz/FuzzTNLTransferRoundTrip/d58f147aedd0a272 b/ngap/testdata/fuzz/FuzzTNLTransferRoundTrip/d58f147aedd0a272 new file mode 100644 index 0000000000..39b863a0c4 --- /dev/null +++ b/ngap/testdata/fuzz/FuzzTNLTransferRoundTrip/d58f147aedd0a272 @@ -0,0 +1,3 @@ +go test fuzz v1 +byte('O') +[]byte("0\x00\x0100A\x000") diff --git a/ngap/tnl_lossless_test.go b/ngap/tnl_lossless_test.go new file mode 100644 index 0000000000..b77a37ceff --- /dev/null +++ b/ngap/tnl_lossless_test.go @@ -0,0 +1,1360 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "encoding/hex" + "fmt" + "os" + "os/exec" + "reflect" + "slices" + "strings" + "testing" + + "github.com/ellanetworks/core/per" +) + +const unknownExtensionID ProtocolIEID = 65000 + +func upTNL(host byte, teid uint32) UPTransportLayerInformation { + return UPTransportLayerInformation{GTPTunnel: GTPTunnel{ + TransportLayerAddress: TransportLayerAddress{10, 0, 0, host}, + GTPTEID: GTPTEID(teid), + }} +} + +func upTNLPtr(host byte, teid uint32) *UPTransportLayerInformation { + u := upTNL(host, teid) + return &u +} + +func qosFlowTNL(host byte, teid uint32) QosFlowPerTNLInformation { + return QosFlowPerTNLInformation{ + UPTransportLayerInformation: upTNL(host, teid), + AssociatedQosFlowList: AssociatedQosFlowList{{QosFlowIdentifier: 1}}, + } +} + +func qosFlowTNLList(host byte, teid uint32) QosFlowPerTNLInformationList { + return QosFlowPerTNLInformationList{{QosFlowPerTNLInformation: qosFlowTNL(host, teid)}} +} + +func pairList(ulHost byte, ulTEID uint32, dlHost byte, dlTEID uint32) UPTransportLayerInformationPairList { + return UPTransportLayerInformationPairList{{ + ULNGUUPTNLInformation: upTNL(ulHost, ulTEID), + DLNGUUPTNLInformation: upTNL(dlHost, dlTEID), + }} +} + +func tnlList(host byte, teid uint32) UPTransportLayerInformationList { + return UPTransportLayerInformationList{{NGUUPTNLInformation: upTNL(host, teid)}} +} + +func tnlSetupRequestTransfer() *PDUSessionResourceSetupRequestTransfer { + return &PDUSessionResourceSetupRequestTransfer{ + ULNGUUPTNLInformation: upTNL(1, 0x101), + AdditionalULNGUUPTNLInformation: tnlList(1, 0x102), + PDUSessionType: PDUSessionTypeIPv4, + QosFlowSetupRequest: QosFlowSetupRequestList{{ + QosFlowIdentifier: 1, + QosFlowLevelQosParameters: QosFlowLevelQosParameters{ + QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}}, + AllocationAndRetentionPriority: AllocationAndRetentionPriority{ + PriorityLevelARP: 8, + PreemptionCapability: PreemptionShallNotTrigger, + PreemptionVulnerability: PreemptionNotPreemptable, + }, + }, + }}, + RedundantULNGUUPTNLInformation: upTNLPtr(2, 0x103), + AdditionalRedundantULNGUUPTNLInformation: tnlList(2, 0x104), + } +} + +func tnlSetupResponseTransfer() *PDUSessionResourceSetupResponseTransfer { + r := qosFlowTNL(4, 0x203) + + return &PDUSessionResourceSetupResponseTransfer{ + DLQosFlowPerTNLInformation: qosFlowTNL(3, 0x201), + AdditionalDLQosFlowPerTNLInformation: qosFlowTNLList(3, 0x202), + RedundantDLQosFlowPerTNLInformation: &r, + AdditionalRedundantDLQosFlowPerTNLInformation: qosFlowTNLList(4, 0x204), + } +} + +func tnlModifyRequestTransfer() *PDUSessionResourceModifyRequestTransfer { + return &PDUSessionResourceModifyRequestTransfer{ + ULNGUUPTNLModify: ULNGUUPTNLModifyList{{ + ULNGUUPTNLInformation: upTNL(1, 0x301), + DLNGUUPTNLInformation: upTNL(3, 0x302), + RedundantULNGUUPTNLInformation: upTNLPtr(2, 0x303), + RedundantDLNGUUPTNLInformation: upTNLPtr(4, 0x304), + }}, + QosFlowAddOrModifyRequest: QosFlowAddOrModifyRequestList{{ + QosFlowIdentifier: 1, + ULNGUUPTNLInformation: upTNLPtr(1, 0x305), + }}, + AdditionalULNGUUPTNLInformation: tnlList(1, 0x306), + AdditionalRedundantULNGUUPTNLInformation: tnlList(2, 0x307), + RedundantULNGUUPTNLInformation: upTNLPtr(2, 0x308), + UserPlaneFailureIndication: &UserPlaneFailureIndication{ + UserPlaneFailureType: UserPlaneFailureTypeUPPathFailure, + ULNGUUPTNLInformation: upTNL(1, 0x309), + DLNGUUPTNLInformation: upTNL(3, 0x30a), + }, + } +} + +func tnlModifyResponseTransfer() *PDUSessionResourceModifyResponseTransfer { + return &PDUSessionResourceModifyResponseTransfer{ + DLNGUUPTNLInformation: upTNLPtr(3, 0x401), + ULNGUUPTNLInformation: upTNLPtr(1, 0x402), + QosFlowAddOrModifyResponse: QosFlowAddOrModifyResponseList{{ + QosFlowIdentifier: 1, + DLNGUUPTNLInformation: upTNLPtr(3, 0x403), + }}, + AdditionalDLQosFlowPerTNLInformation: qosFlowTNLList(3, 0x404), + AdditionalNGUUPTNLInformation: pairList(1, 0x405, 3, 0x406), + RedundantDLNGUUPTNLInformation: upTNLPtr(4, 0x407), + RedundantULNGUUPTNLInformation: upTNLPtr(2, 0x408), + AdditionalRedundantDLQosFlowPerTNLInformation: qosFlowTNLList(4, 0x409), + AdditionalRedundantNGUUPTNLInformation: pairList(2, 0x40a, 4, 0x40b), + } +} + +func tnlModifyIndicationTransfer() *PDUSessionResourceModifyIndicationTransfer { + r := qosFlowTNL(4, 0x503) + + return &PDUSessionResourceModifyIndicationTransfer{ + DLQosFlowPerTNLInformation: qosFlowTNL(3, 0x501), + AdditionalDLQosFlowPerTNLInformation: qosFlowTNLList(3, 0x502), + RedundantDLQosFlowPerTNLInformation: &r, + AdditionalRedundantDLQosFlowPerTNLInformation: qosFlowTNLList(4, 0x504), + } +} + +func tnlModifyConfirmTransfer() *PDUSessionResourceModifyConfirmTransfer { + return &PDUSessionResourceModifyConfirmTransfer{ + QosFlowModifyConfirm: QosFlowModifyConfirmList{{QosFlowIdentifier: 1}}, + ULNGUUPTNLInformation: upTNL(1, 0x601), + AdditionalNGUUPTNLInformation: pairList(1, 0x602, 3, 0x603), + RedundantULNGUUPTNLInformation: upTNLPtr(2, 0x604), + AdditionalRedundantNGUUPTNLInformation: pairList(2, 0x605, 4, 0x606), + } +} + +func tnlPathSwitchRequestTransfer() *PathSwitchRequestTransfer { + return &PathSwitchRequestTransfer{ + DLNGUUPTNLInformation: upTNL(3, 0x701), + QosFlowAccepted: QosFlowAcceptedList{{QosFlowIdentifier: 1}}, + AdditionalDLQosFlowPerTNLInformation: qosFlowTNLList(3, 0x702), + RedundantDLNGUUPTNLInformation: upTNLPtr(4, 0x703), + RedundantDLNGUTNLInformationReused: Ptr(DLNGUTNLInformationReusedTrue), + AdditionalRedundantDLQosFlowPerTNLInformation: qosFlowTNLList(4, 0x704), + } +} + +func tnlPathSwitchRequestAcknowledgeTransfer() *PathSwitchRequestAcknowledgeTransfer { + return &PathSwitchRequestAcknowledgeTransfer{ + ULNGUUPTNLInformation: upTNLPtr(1, 0x801), + AdditionalNGUUPTNLInformation: pairList(1, 0x802, 3, 0x803), + RedundantULNGUUPTNLInformation: upTNLPtr(2, 0x804), + AdditionalRedundantNGUUPTNLInformation: pairList(2, 0x805, 4, 0x806), + } +} + +func tnlHandoverRequestAcknowledgeTransfer() *HandoverRequestAcknowledgeTransfer { + return &HandoverRequestAcknowledgeTransfer{ + DLNGUUPTNLInformation: upTNL(3, 0x901), + DLForwardingUPTNLInformation: upTNLPtr(3, 0x902), + QosFlowSetupResponse: QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, + DataForwardingResponseDRB: DataForwardingResponseDRBList{{ + DRBID: 1, + DLForwardingUPTNLInformation: upTNLPtr(3, 0x903), + ULForwardingUPTNLInformation: upTNLPtr(3, 0x904), + }}, + AdditionalDLUPTNLInformationForHO: AdditionalDLUPTNLInformationForHOList{{ + AdditionalDLNGUUPTNLInformation: upTNL(3, 0x905), + AdditionalQosFlowSetupResponse: QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, + AdditionalDLForwardingUPTNLInformation: upTNLPtr(3, 0x906), + AdditionalRedundantDLNGUUPTNLInformation: upTNLPtr(4, 0x907), + }}, + ULForwardingUPTNLInformation: upTNLPtr(3, 0x908), + AdditionalULForwardingUPTNLInformation: tnlList(3, 0x909), + DataForwardingResponseERAB: DataForwardingResponseERABList{{ + ERABID: 5, + DLForwardingUPTNLInformation: upTNL(3, 0x90a), + }}, + RedundantDLNGUUPTNLInformation: upTNLPtr(4, 0x90b), + } +} + +func tnlHandoverCommandTransfer() *HandoverCommandTransfer { + return &HandoverCommandTransfer{ + DLForwardingUPTNLInformation: upTNLPtr(1, 0xa01), + QosFlowToBeForwarded: QosFlowToBeForwardedList{{QosFlowIdentifier: 1}}, + DataForwardingResponseDRB: DataForwardingResponseDRBList{{ + DRBID: 1, + DLForwardingUPTNLInformation: upTNLPtr(1, 0xa02), + ULForwardingUPTNLInformation: upTNLPtr(1, 0xa03), + }}, + AdditionalDLForwardingUPTNLInformation: qosFlowTNLList(1, 0xa04), + ULForwardingUPTNLInformation: upTNLPtr(1, 0xa05), + AdditionalULForwardingUPTNLInformation: tnlList(1, 0xa06), + DataForwardingResponseERAB: DataForwardingResponseERABList{{ + ERABID: 5, + DLForwardingUPTNLInformation: upTNL(1, 0xa07), + }}, + } +} + +type tnlTransferCase struct { + name string + transfer interface { + Marshal() (TransferContainer, error) + } + parse func(TransferContainer) (any, error) + message func(TransferContainer) interface{ Marshal() ([]byte, error) } + teids []uint32 + golden string + + notTshark []uint32 + notTsharkWhy string +} + +func tnlTransferCases() []tnlTransferCase { + return []tnlTransferCase{ + { + name: "PDUSessionResourceSetupRequestTransfer", + transfer: tnlSetupRequestTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePDUSessionResourceSetupRequestTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PDUSessionResourceSetupRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + PDUSessionResourceSetup: PDUSessionResourceSetupListSUReq{{PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: b}}, + } + }, + teids: []uint32{0x101, 0x102, 0x103, 0x104}, + golden: goldenTNLSetupRequest, + }, + { + name: "PDUSessionResourceSetupResponseTransfer", + transfer: tnlSetupResponseTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePDUSessionResourceSetupResponseTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PDUSessionResourceSetupResponse{ + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(2)), + PDUSessionResourceSetup: PDUSessionResourceSetupListSURes{{PDUSessionID: 5, Transfer: b}}, + } + }, + teids: []uint32{0x201, 0x202, 0x203, 0x204}, + golden: goldenTNLSetupResponse, + }, + { + name: "PDUSessionResourceModifyRequestTransfer", + transfer: tnlModifyRequestTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePDUSessionResourceModifyRequestTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PDUSessionResourceModifyRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + PDUSessionResourceModify: PDUSessionResourceModifyListModReq{{PDUSessionID: 5, Transfer: b, SNSSAI: &SNSSAI{SST: 1, SD: &SD{0x01, 0x02, 0x03}}}}, + } + }, + teids: []uint32{0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, 0x308, 0x309, 0x30a}, + golden: goldenTNLModifyRequest, + notTshark: []uint32{0x305}, + notTsharkWhy: "Wireshark 4.6 has no QosFlowAddOrModifyRequestItem-ExtIEs entry for id-UL-NGU-UP-TNLInformation and shows its value as undissected data", + }, + { + name: "PDUSessionResourceModifyResponseTransfer", + transfer: tnlModifyResponseTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePDUSessionResourceModifyResponseTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PDUSessionResourceModifyResponse{ + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(2)), + PDUSessionResourceModify: PDUSessionResourceModifyListModRes{{PDUSessionID: 5, Transfer: b}}, + } + }, + teids: []uint32{0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408, 0x409, 0x40a, 0x40b}, + golden: goldenTNLModifyResponse, + notTshark: []uint32{0x403}, + notTsharkWhy: "Wireshark 4.6 has no QosFlowAddOrModifyResponseItem-ExtIEs entry for id-DL-NGU-UP-TNLInformation and shows its value as undissected data", + }, + { + name: "PDUSessionResourceModifyIndicationTransfer", + transfer: tnlModifyIndicationTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePDUSessionResourceModifyIndicationTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PDUSessionResourceModifyIndication{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + PDUSessionResourceModify: PDUSessionResourceModifyListModInd{{PDUSessionID: 5, Transfer: b}}, + } + }, + teids: []uint32{0x501, 0x502, 0x503, 0x504}, + golden: goldenTNLModifyIndication, + }, + { + name: "PDUSessionResourceModifyConfirmTransfer", + transfer: tnlModifyConfirmTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePDUSessionResourceModifyConfirmTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PDUSessionResourceModifyConfirm{ + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(2)), + PDUSessionResourceModify: PDUSessionResourceModifyListModCfm{{PDUSessionID: 5, Transfer: b}}, + } + }, + teids: []uint32{0x601, 0x602, 0x603, 0x604, 0x605, 0x606}, + golden: goldenTNLModifyConfirm, + }, + { + name: "PathSwitchRequestTransfer", + transfer: tnlPathSwitchRequestTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePathSwitchRequestTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PathSwitchRequest{ + RANUENGAPID: 2, + SourceAMFUENGAPID: 1, + UserLocationInformation: &UserLocationInformation{Kind: UserLocationNR, PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}, + UESecurityCapabilities: &UESecurityCapabilities{}, + PDUSessionResourceToBeSwitchedDLList: PDUSessionResourceToBeSwitchedDLList{{PDUSessionID: 5, Transfer: b}}, + } + }, + teids: []uint32{0x701, 0x702, 0x703, 0x704}, + golden: goldenTNLPathSwitchRequest, + }, + { + name: "PathSwitchRequestAcknowledgeTransfer", + transfer: tnlPathSwitchRequestAcknowledgeTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParsePathSwitchRequestAcknowledgeTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &PathSwitchRequestAcknowledge{ + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(2)), + PDUSessionResourceSwitchedList: PDUSessionResourceSwitchedList{{PDUSessionID: 5, Transfer: b}}, + AllowedNSSAI: AllowedNSSAI{{SNSSAI: SNSSAI{SST: 1}}}, + } + }, + teids: []uint32{0x801, 0x802, 0x803, 0x804, 0x805, 0x806}, + golden: goldenTNLPathSwitchRequestAcknowledge, + }, + { + name: "HandoverRequestAcknowledgeTransfer", + transfer: tnlHandoverRequestAcknowledgeTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParseHandoverRequestAcknowledgeTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &HandoverRequestAcknowledge{ + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(2)), + PDUSessionResourceAdmittedList: PDUSessionResourceAdmittedList{{PDUSessionID: 5, Transfer: b}}, + TargetToSourceTransparentContainer: TargetToSourceTransparentContainer{0x00, 0x00}, + } + }, + teids: []uint32{0x901, 0x902, 0x903, 0x904, 0x905, 0x906, 0x907, 0x908, 0x909, 0x90a, 0x90b}, + golden: goldenTNLHandoverRequestAcknowledge, + }, + { + name: "HandoverCommandTransfer", + transfer: tnlHandoverCommandTransfer(), + parse: func(b TransferContainer) (any, error) { + return ParseHandoverCommandTransfer(b) + }, + message: func(b TransferContainer) interface{ Marshal() ([]byte, error) } { + return &HandoverCommand{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + HandoverType: HandoverTypeIntra5GS, + PDUSessionResourceHandoverList: PDUSessionResourceHandoverList{{PDUSessionID: 5, Transfer: b}}, + TargetToSourceTransparentContainer: TargetToSourceTransparentContainer{0x00, 0x00}, + } + }, + teids: []uint32{0xa01, 0xa02, 0xa03, 0xa04, 0xa05, 0xa06, 0xa07}, + golden: goldenTNLHandoverCommand, + }, + } +} + +func tnlCaseMessage(t *testing.T, c tnlTransferCase) []byte { + t.Helper() + + b, err := c.transfer.Marshal() + if err != nil { + t.Fatalf("%s: %v", c.name, err) + } + + m, err := c.message(b).Marshal() + if err != nil { + t.Fatalf("%s message: %v", c.name, err) + } + + return m +} + +func TestTNLExtensionGoldenRoundTrip(t *testing.T) { + for _, c := range tnlTransferCases() { + t.Run(c.name, func(t *testing.T) { + if got := hex.EncodeToString(tnlCaseMessage(t, c)); got != c.golden { + t.Fatalf("encoded\n got %s\nwant %s", got, c.golden) + } + + b, err := c.transfer.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := c.parse(b) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out, c.transfer) { + t.Fatalf("decoded\n got %+v\nwant %+v", out, c.transfer) + } + + again, err := out.(interface { + Marshal() (TransferContainer, error) + }).Marshal() + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x (%v), want %x", again, err, b) + } + }) + } +} + +func TestTNLExtensionGoldenTshark(t *testing.T) { + tshark, err1 := exec.LookPath("tshark") + text2pcap, err2 := exec.LookPath("text2pcap") + + if err1 != nil || err2 != nil { + t.Skip("tshark/text2pcap not installed") + } + + cases := tnlTransferCases() + + var dump strings.Builder + for _, c := range cases { + hexDump(&dump, mustHex(t, c.golden)) + } + + rows := tsharkFields(t, tshark, text2pcap, dump.String(), "ngap.gTP_TEID", "_ws.malformed", "_ws.expert.message") + if len(rows) != len(cases) { + t.Fatalf("tshark decoded %d frames, want %d", len(rows), len(cases)) + } + + for i, c := range cases { + var want []string + + for _, teid := range c.teids { + if !slices.Contains(c.notTshark, teid) { + want = append(want, fmt.Sprintf("%08x", teid)) + } + } + + got := strings.ReplaceAll(rows[i][0], ":", "") + if got != strings.Join(want, ",") { + t.Errorf("%s: tshark GTP-TEIDs %s, want %s", c.name, got, strings.Join(want, ",")) + } + + if rows[i][1] != "" || rows[i][2] != "" { + t.Errorf("%s: tshark reports %q", c.name, strings.Join(rows[i][1:], "|")) + } + } +} + +func TestTNLExtensionCriticality(t *testing.T) { + type row struct { + id ProtocolIEID + crit Criticality + } + + critOf := func(ids []ProtocolIEID, crits []Criticality) []row { + out := make([]row, len(ids)) + for i := range ids { + out[i] = row{ids[i], crits[i]} + } + + return out + } + + crits := func(table any) []Criticality { + v := reflect.ValueOf(table) + out := make([]Criticality, v.Len()) + + for i := range out { + out[i] = Criticality(v.Index(i).FieldByName("crit").Uint()) + } + + return out + } + + ids := func(table any) []ProtocolIEID { + v := reflect.ValueOf(table) + out := make([]ProtocolIEID, v.Len()) + + for i := range out { + out[i] = ProtocolIEID(v.Index(i).FieldByName("id").Uint()) + } + + return out + } + + ig, rj := CriticalityIgnore, CriticalityReject + + for _, tc := range []struct { + name string + table any + want []row + }{ + {"PDUSessionResourceSetupRequestTransferIEs", pDUSessionResourceSetupRequestTransferIEs, []row{ + {IDPDUSessionAggregateMaximumBitRate, rj}, + {IDULNGUUPTNLInformation, rj}, + {IDAdditionalULNGUUPTNLInformation, rj}, + {IDDataForwardingNotPossible, rj}, + {IDPDUSessionType, rj}, + {IDSecurityIndication, rj}, + {IDNetworkInstance, rj}, + {IDQosFlowSetupRequestList, rj}, + {IDDirectForwardingPathAvailability, ig}, + {IDRedundantULNGUUPTNLInformation, ig}, + {IDAdditionalRedundantULNGUUPTNLInformation, ig}, + }}, + {"PDUSessionResourceModifyRequestTransferIEs", pDUSessionResourceModifyRequestTransferIEs, []row{ + {IDPDUSessionAggregateMaximumBitRate, rj}, + {IDULNGUUPTNLModifyList, rj}, + {IDNetworkInstance, rj}, + {IDQosFlowAddOrModifyRequestList, rj}, + {IDQosFlowToReleaseList, rj}, + {IDAdditionalULNGUUPTNLInformation, rj}, + {IDAdditionalRedundantULNGUUPTNLInformation, ig}, + {IDRedundantULNGUUPTNLInformation, ig}, + {IDUserPlaneFailureIndication, ig}, + }}, + {"PDUSessionResourceSetupResponseTransfer-ExtIEs", pDUSessionResourceSetupResponseTransferExtIEs, []row{ + {IDRedundantDLQosFlowPerTNLInformation, ig}, {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, + }}, + {"PDUSessionResourceModifyResponseTransfer-ExtIEs", pDUSessionResourceModifyResponseTransferExtIEs, []row{ + {IDAdditionalNGUUPTNLInformation, ig}, + {IDRedundantDLNGUUPTNLInformation, ig}, + {IDRedundantULNGUUPTNLInformation, ig}, + {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, + {IDAdditionalRedundantNGUUPTNLInformation, ig}, + }}, + {"PDUSessionResourceModifyIndicationTransfer-ExtIEs", pDUSessionResourceModifyIndicationTransferExtIEs, []row{ + {IDRedundantDLQosFlowPerTNLInformation, ig}, {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, + }}, + {"PDUSessionResourceModifyConfirmTransfer-ExtIEs", pDUSessionResourceModifyConfirmTransferExtIEs, []row{ + {IDRedundantULNGUUPTNLInformation, ig}, {IDAdditionalRedundantNGUUPTNLInformation, ig}, + }}, + {"PathSwitchRequestTransfer-ExtIEs", pathSwitchRequestTransferExtIEs, []row{ + {IDAdditionalDLQosFlowPerTNLInformation, ig}, + {IDRedundantDLNGUUPTNLInformation, ig}, + {IDRedundantDLNGUTNLInformationReused, ig}, + {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, + }}, + {"PathSwitchRequestAcknowledgeTransfer-ExtIEs", pathSwitchRequestAcknowledgeTransferExtIEs, []row{ + {IDAdditionalNGUUPTNLInformation, ig}, {IDRedundantULNGUUPTNLInformation, ig}, {IDAdditionalRedundantNGUUPTNLInformation, ig}, + }}, + {"HandoverRequestAcknowledgeTransfer-ExtIEs", handoverRequestAcknowledgeTransferExtIEs, []row{ + {IDAdditionalDLUPTNLInformationForHOList, ig}, + {IDULForwardingUPTNLInformation, rj}, + {IDAdditionalULForwardingUPTNLInformation, rj}, + {IDDataForwardingResponseERABList, ig}, + {IDRedundantDLNGUUPTNLInformation, ig}, + }}, + {"HandoverCommandTransfer-ExtIEs", handoverCommandTransferExtIEs, []row{ + {IDAdditionalDLForwardingUPTNLInformation, ig}, + {IDULForwardingUPTNLInformation, rj}, + {IDAdditionalULForwardingUPTNLInformation, rj}, + {IDDataForwardingResponseERABList, ig}, + }}, + {"UL-NGU-UP-TNLModifyItem-ExtIEs", uLNGUUPTNLModifyItemExtIEs, []row{ + {IDRedundantULNGUUPTNLInformation, ig}, {IDRedundantDLNGUUPTNLInformation, ig}, + }}, + {"AdditionalDLUPTNLInformationForHOItem-ExtIEs", additionalDLUPTNLInformationForHOItemExtIEs, []row{ + {IDAdditionalRedundantDLNGUUPTNLInformation, ig}, + }}, + {"QosFlowAddOrModifyRequestItem-ExtIEs", qosFlowAddOrModifyRequestItemExtIEs, []row{{IDULNGUUPTNLInformation, ig}}}, + {"QosFlowAddOrModifyResponseItem-ExtIEs", qosFlowAddOrModifyResponseItemExtIEs, []row{{IDDLNGUUPTNLInformation, ig}}}, + {"PDUSessionResourceModifyItemModReq-ExtIEs", pDUSessionResourceModifyItemModReqExtIEs, []row{{IDSNSSAI, rj}}}, + } { + t.Run(tc.name, func(t *testing.T) { + if got := critOf(ids(tc.table), crits(tc.table)); !reflect.DeepEqual(got, tc.want) { + t.Fatalf("rows %v, want %v", got, tc.want) + } + }) + } +} + +func TestTNLExtensionWireCriticalityKept(t *testing.T) { + in := &HandoverCommandTransfer{ULForwardingUPTNLInformation: upTNLPtr(1, 0xa05)} + in.iEExtensions.wire = []wireSlot{{id: IDULForwardingUPTNLInformation, crit: CriticalityIgnore, unknown: -1}} + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := ParseHandoverCommandTransfer(b) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(out.iEExtensions.wire, in.iEExtensions.wire) { + t.Fatalf("wire %+v, want %+v", out.iEExtensions.wire, in.iEExtensions.wire) + } + + again, err := out.Marshal() + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x (%v), want %x", again, err, b) + } +} + +func tbNil(t testing.TB, err error) { + t.Helper() + + if err != nil { + t.Fatal(err) + } +} + +func unknownRawExtensions(t testing.TB) *rawIEExtensions { + t.Helper() + + w := per.NewWriter() + tbNil(t, per.EncodeConstrainedWholeNumber(w, per.Aligned, 1, maxProtocolExtensions, 1)) + tbNil(t, encodeContainerField(w, per.Aligned, ieField{id: unknownExtensionID, crit: CriticalityIgnore, raw: []byte{0xde, 0xad}})) + w.AlignToByte() + + var e rawIEExtensions + tbNil(t, e.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned)) + + return &e +} + +func unknownAdditions(t testing.TB) per.ExtensionAdditions { + t.Helper() + + w := per.NewWriter() + tbNil(t, per.EncodeNormallySmallLength(w, per.Aligned, 1, func(int64) error { + w.WriteBit(true) + return nil + })) + w.AlignToByte() + tbNil(t, per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0xbe, 0xef})) + w.AlignToByte() + + var e per.ExtensionAdditions + tbNil(t, e.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned)) + + return e +} + +func unknownMeta(t testing.TB) messageMeta { + t.Helper() + + var m messageMeta + m.preserve(rawIE{id: unknownExtensionID, crit: CriticalityIgnore, value: []byte{0xde, 0xad}}) + + return m +} + +type losslessCase struct { + name string + value func(t testing.TB) per.Marshaler + decode func(b []byte) (per.Marshaler, error) +} + +func decodeAs[T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](b []byte) (per.Marshaler, error) { + v := PT(new(T)) + if err := v.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + return nil, err + } + + return v, nil +} + +func losslessCases() []losslessCase { + snssai := func(t testing.TB) SNSSAI { + return SNSSAI{SST: 1, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + } + + arp := func(t testing.TB) AllocationAndRetentionPriority { + return AllocationAndRetentionPriority{ + PriorityLevelARP: 8, PreemptionCapability: PreemptionShallNotTrigger, PreemptionVulnerability: PreemptionNotPreemptable, + iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t), + } + } + + qosParams := func(t testing.TB) QosFlowLevelQosParameters { + return QosFlowLevelQosParameters{ + QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsDynamic5QI, Dynamic5QI: Dynamic5QIDescriptor{ + PriorityLevelQos: 10, + PacketDelayBudget: 100, + PacketErrorRate: PacketErrorRate{Scalar: 1, Exponent: 6, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)}, + iEExtensions: unknownRawExtensions(t), + extensions: unknownAdditions(t), + }}, + AllocationAndRetentionPriority: arp(t), + GBRQosInformation: &GBRQosInformation{ + MaximumFlowBitRateDL: 1, MaximumFlowBitRateUL: 2, GuaranteedFlowBitRateDL: 3, GuaranteedFlowBitRateUL: 4, + iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t), + }, + iEExtensions: unknownRawExtensions(t), + extensions: unknownAdditions(t), + } + } + + gtp := func(t testing.TB, host byte, teid uint32) UPTransportLayerInformation { + u := upTNL(host, teid) + u.GTPTunnel.iEExtensions = unknownRawExtensions(t) + u.GTPTunnel.extensions = unknownAdditions(t) + + return u + } + + qosTNL := func(t testing.TB) QosFlowPerTNLInformation { + return QosFlowPerTNLInformation{ + UPTransportLayerInformation: gtp(t, 3, 0x11), + AssociatedQosFlowList: AssociatedQosFlowList{{QosFlowIdentifier: 1}}, + iEExtensions: unknownRawExtensions(t), + extensions: unknownAdditions(t), + } + } + + transferItem := func(t testing.TB) (*rawIEExtensions, per.ExtensionAdditions) { + return unknownRawExtensions(t), unknownAdditions(t) + } + + return []losslessCase{ + {name: "GTPTunnel", value: func(t testing.TB) per.Marshaler { + u := gtp(t, 1, 0x10) + return &u.GTPTunnel + }, decode: decodeAs[GTPTunnel]}, + {name: "SNSSAI", value: func(t testing.TB) per.Marshaler { s := snssai(t); return &s }, decode: decodeAs[SNSSAI]}, + {name: "UPTransportLayerInformationItem", value: func(t testing.TB) per.Marshaler { + return &UPTransportLayerInformationItem{NGUUPTNLInformation: gtp(t, 1, 0x12), iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[UPTransportLayerInformationItem]}, + {name: "UPTransportLayerInformationPairItem", value: func(t testing.TB) per.Marshaler { + return &UPTransportLayerInformationPairItem{ + ULNGUUPTNLInformation: gtp(t, 1, 0x13), DLNGUUPTNLInformation: gtp(t, 3, 0x14), + iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[UPTransportLayerInformationPairItem]}, + {name: "UL-NGU-UP-TNLModifyItem", value: func(t testing.TB) per.Marshaler { + return &ULNGUUPTNLModifyItem{ + ULNGUUPTNLInformation: gtp(t, 1, 0x15), DLNGUUPTNLInformation: gtp(t, 3, 0x16), + RedundantULNGUUPTNLInformation: upTNLPtr(2, 0x17), + iEExtensions: unknownMeta(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[ULNGUUPTNLModifyItem]}, + {name: "QosFlowPerTNLInformation", value: func(t testing.TB) per.Marshaler { q := qosTNL(t); return &q }, decode: decodeAs[QosFlowPerTNLInformation]}, + {name: "QosFlowPerTNLInformationItem", value: func(t testing.TB) per.Marshaler { + return &QosFlowPerTNLInformationItem{QosFlowPerTNLInformation: qosTNL(t), iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowPerTNLInformationItem]}, + {name: "DataForwardingResponseDRBItem", value: func(t testing.TB) per.Marshaler { + ul := gtp(t, 3, 0x19) + + return &DataForwardingResponseDRBItem{ + DRBID: 1, DLForwardingUPTNLInformation: upTNLPtr(3, 0x18), ULForwardingUPTNLInformation: &ul, + iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[DataForwardingResponseDRBItem]}, + {name: "DataForwardingResponseERABListItem", value: func(t testing.TB) per.Marshaler { + return &DataForwardingResponseERABListItem{ERABID: 5, DLForwardingUPTNLInformation: gtp(t, 3, 0x1a), iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[DataForwardingResponseERABListItem]}, + {name: "AdditionalDLUPTNLInformationForHOItem", value: func(t testing.TB) per.Marshaler { + return &AdditionalDLUPTNLInformationForHOItem{ + AdditionalDLNGUUPTNLInformation: gtp(t, 3, 0x1b), + AdditionalQosFlowSetupResponse: QosFlowListWithDataForwarding{{ + QosFlowIdentifier: 1, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t), + }}, + AdditionalRedundantDLNGUUPTNLInformation: upTNLPtr(4, 0x1c), + iEExtensions: unknownMeta(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[AdditionalDLUPTNLInformationForHOItem]}, + {name: "UserPlaneFailureIndication", value: func(t testing.TB) per.Marshaler { + return &UserPlaneFailureIndication{ + UserPlaneFailureType: UserPlaneFailureTypeGTPUErrorIndicationReceived, + ULNGUUPTNLInformation: gtp(t, 1, 0x1d), DLNGUUPTNLInformation: gtp(t, 3, 0x1e), + iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[UserPlaneFailureIndication]}, + {name: "QosFlowAddOrModifyRequestItem", value: func(t testing.TB) per.Marshaler { + q := qosParams(t) + + return &QosFlowAddOrModifyRequestItem{ + QosFlowIdentifier: 1, QosFlowLevelQosParameters: &q, ERABID: Ptr(ERABID(5)), + ULNGUUPTNLInformation: upTNLPtr(1, 0x1f), iEExtensions: unknownMeta(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[QosFlowAddOrModifyRequestItem]}, + {name: "QosFlowAddOrModifyResponseItem", value: func(t testing.TB) per.Marshaler { + return &QosFlowAddOrModifyResponseItem{QosFlowIdentifier: 1, DLNGUUPTNLInformation: upTNLPtr(3, 0x20), iEExtensions: unknownMeta(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowAddOrModifyResponseItem]}, + {name: "QosFlowSetupRequestItem", value: func(t testing.TB) per.Marshaler { + return &QosFlowSetupRequestItem{QosFlowIdentifier: 1, QosFlowLevelQosParameters: qosParams(t), iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowSetupRequestItem]}, + {name: "NonDynamic5QIDescriptor", value: func(t testing.TB) per.Marshaler { + return &NonDynamic5QIDescriptor{FiveQI: 9, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[NonDynamic5QIDescriptor]}, + {name: "PDUSessionAggregateMaximumBitRate", value: func(t testing.TB) per.Marshaler { + return &PDUSessionAggregateMaximumBitRate{DL: 1000, UL: 2000, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[PDUSessionAggregateMaximumBitRate]}, + {name: "SecurityIndication", value: func(t testing.TB) per.Marshaler { + return &SecurityIndication{iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[SecurityIndication]}, + {name: "SecurityResult", value: func(t testing.TB) per.Marshaler { + return &SecurityResult{iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[SecurityResult]}, + {name: "UserPlaneSecurityInformation", value: func(t testing.TB) per.Marshaler { + return &UserPlaneSecurityInformation{ + SecurityResult: SecurityResult{iEExtensions: unknownRawExtensions(t)}, + SecurityIndication: SecurityIndication{extensions: unknownAdditions(t)}, + iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[UserPlaneSecurityInformation]}, + {name: "QosFlowWithCauseItem", value: func(t testing.TB) per.Marshaler { + return &QosFlowWithCauseItem{QosFlowIdentifier: 1, Cause: Cause{Group: CauseGroupMisc}, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowWithCauseItem]}, + {name: "QosFlowAcceptedItem", value: func(t testing.TB) per.Marshaler { + return &QosFlowAcceptedItem{QosFlowIdentifier: 1, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowAcceptedItem]}, + {name: "QosFlowItemWithDataForwarding", value: func(t testing.TB) per.Marshaler { + return &QosFlowItemWithDataForwarding{QosFlowIdentifier: 1, DataForwardingAccepted: Ptr(DataForwardingAcceptedTrue), iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowItemWithDataForwarding]}, + {name: "QosFlowToBeForwardedItem", value: func(t testing.TB) per.Marshaler { + return &QosFlowToBeForwardedItem{QosFlowIdentifier: 1, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowToBeForwardedItem]}, + {name: "QosFlowModifyConfirmItem", value: func(t testing.TB) per.Marshaler { + return &QosFlowModifyConfirmItem{QosFlowIdentifier: 1, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + }, decode: decodeAs[QosFlowModifyConfirmItem]}, + {name: "PDUSessionResourceSetupItemSUReq", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceSetupItemSUReq{PDUSessionID: 1, SNSSAI: snssai(t), Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceSetupItemSUReq]}, + {name: "PDUSessionResourceSetupItemSURes", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceSetupItemSURes{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceSetupItemSURes]}, + {name: "PDUSessionResourceSetupItemCxtReq", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceSetupItemCxtReq{PDUSessionID: 1, SNSSAI: snssai(t), Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceSetupItemCxtReq]}, + {name: "PDUSessionResourceSetupItemCxtRes", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceSetupItemCxtRes{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceSetupItemCxtRes]}, + {name: "PDUSessionResourceSetupItemHOReq", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceSetupItemHOReq{PDUSessionID: 1, SNSSAI: snssai(t), Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceSetupItemHOReq]}, + {name: "PDUSessionResourceAdmittedItem", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceAdmittedItem{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceAdmittedItem]}, + {name: "PDUSessionResourceHandoverItem", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceHandoverItem{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceHandoverItem]}, + {name: "PDUSessionResourceToBeSwitchedDLItem", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceToBeSwitchedDLItem{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceToBeSwitchedDLItem]}, + {name: "PDUSessionResourceSwitchedItem", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceSwitchedItem{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceSwitchedItem]}, + {name: "PDUSessionResourceModifyItemModReq", value: func(t testing.TB) per.Marshaler { + return &PDUSessionResourceModifyItemModReq{ + PDUSessionID: 1, Transfer: TransferContainer{0x00}, SNSSAI: &SNSSAI{SST: 1, SD: &SD{0x01, 0x02, 0x03}}, + iEExtensions: unknownMeta(t), extensions: unknownAdditions(t), + } + }, decode: decodeAs[PDUSessionResourceModifyItemModReq]}, + {name: "PDUSessionResourceModifyItemModRes", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceModifyItemModRes{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceModifyItemModRes]}, + {name: "PDUSessionResourceModifyItemModInd", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceModifyItemModInd{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceModifyItemModInd]}, + {name: "PDUSessionResourceModifyItemModCfm", value: func(t testing.TB) per.Marshaler { + e, a := transferItem(t) + return &PDUSessionResourceModifyItemModCfm{PDUSessionID: 1, Transfer: TransferContainer{0x00}, iEExtensions: e, extensions: a} + }, decode: decodeAs[PDUSessionResourceModifyItemModCfm]}, + {name: "PDUSessionResourceSetupResponseTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlSetupResponseTransfer() + v.DLQosFlowPerTNLInformation = qosTNL(t) + v.SecurityResult = &SecurityResult{iEExtensions: unknownRawExtensions(t)} + v.QosFlowFailedToSetup = QosFlowListWithCause{{QosFlowIdentifier: 2, Cause: Cause{Group: CauseGroupMisc}, extensions: unknownAdditions(t)}} + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[PDUSessionResourceSetupResponseTransfer]}, + {name: "PDUSessionResourceModifyResponseTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlModifyResponseTransfer() + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[PDUSessionResourceModifyResponseTransfer]}, + {name: "PDUSessionResourceModifyIndicationTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlModifyIndicationTransfer() + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[PDUSessionResourceModifyIndicationTransfer]}, + {name: "PDUSessionResourceModifyConfirmTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlModifyConfirmTransfer() + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[PDUSessionResourceModifyConfirmTransfer]}, + {name: "PathSwitchRequestTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlPathSwitchRequestTransfer() + v.UserPlaneSecurityInformation = &UserPlaneSecurityInformation{iEExtensions: unknownRawExtensions(t)} + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[PathSwitchRequestTransfer]}, + {name: "PathSwitchRequestAcknowledgeTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlPathSwitchRequestAcknowledgeTransfer() + v.SecurityIndication = &SecurityIndication{iEExtensions: unknownRawExtensions(t)} + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[PathSwitchRequestAcknowledgeTransfer]}, + {name: "HandoverRequestAcknowledgeTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlHandoverRequestAcknowledgeTransfer() + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[HandoverRequestAcknowledgeTransfer]}, + {name: "HandoverCommandTransfer", value: func(t testing.TB) per.Marshaler { + v := tnlHandoverCommandTransfer() + v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) + + return v + }, decode: decodeAs[HandoverCommandTransfer]}, + } +} + +func TestTNLStructuresKeepUnknownExtensions(t *testing.T) { + goldens := losslessGoldens() + + var regenerated []string + + for _, c := range losslessCases() { + t.Run(c.name, func(t *testing.T) { + in := c.value(t) + + b, err := per.Marshal(in) + if err != nil { + t.Fatal(err) + } + + if os.Getenv("NGAP_TNL_GOLDEN_UPDATE") != "" { + regenerated = append(regenerated, fmt.Sprintf("\t\t%q: %q,", c.name, hex.EncodeToString(b))) + } else if got := hex.EncodeToString(b); got != goldens[c.name] { + t.Fatalf("encoded\n got %s\nwant %s", got, goldens[c.name]) + } + + out, err := c.decode(b) + if err != nil { + t.Fatal(err) + } + + again, err := per.Marshal(out) + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x (%v), want %x", again, err, b) + } + + twice, err := c.decode(again) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(twice, out) { + t.Fatalf("re-decoded\n got %+v\nwant %+v", twice, out) + } + + if !bytes.Contains(b, []byte{0xfd, 0xe8}) || !bytes.Contains(b, []byte{0xde, 0xad}) || !bytes.Contains(b, []byte{0xbe, 0xef}) { + t.Fatalf("%x lacks the unknown extension or the extension addition", b) + } + }) + } + + if len(regenerated) > 0 { + t.Log("\n" + strings.Join(regenerated, "\n")) + } +} + +func TestTNLItemKeepsUnknownExtensionCriticalityAndOrder(t *testing.T) { + in := &HandoverCommandTransfer{ULForwardingUPTNLInformation: upTNLPtr(1, 0xa05)} + in.iEExtensions.preserve(rawIE{id: unknownExtensionID, crit: CriticalityNotify, value: []byte{0x01}}) + in.iEExtensions.wire = []wireSlot{ + {id: unknownExtensionID, crit: CriticalityNotify, unknown: 0}, + {id: IDULForwardingUPTNLInformation, crit: CriticalityReject, unknown: -1}, + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := ParseHandoverCommandTransfer(b) + if err != nil { + t.Fatal(err) + } + + if got := out.iEExtensions.UnknownIEs(); len(got) != 1 || got[0].ID != unknownExtensionID || got[0].Criticality != CriticalityNotify { + t.Fatalf("unknown extensions %+v", got) + } + + ids := make([]ProtocolIEID, 0, len(out.iEExtensions.wire)) + for _, s := range out.iEExtensions.wire { + ids = append(ids, s.id) + } + + if !slices.Equal(ids, []ProtocolIEID{unknownExtensionID, IDULForwardingUPTNLInformation}) { + t.Fatalf("wire order %v", ids) + } + + again, err := out.Marshal() + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x (%v), want %x", again, err, b) + } +} + +func TestTNLTransferRejectsUnknownRejectExtension(t *testing.T) { + in := &HandoverCommandTransfer{} + in.iEExtensions.preserve(rawIE{id: unknownExtensionID, crit: CriticalityReject, value: []byte{0x01}}) + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + if _, err := ParseHandoverCommandTransfer(b); err == nil { + t.Fatal("an unknown reject-criticality extension decoded") + } +} + +func tnlFuzzParsers() []func([]byte) (per.Marshaler, error) { + return []func([]byte) (per.Marshaler, error){ + decodeAs[PDUSessionResourceSetupResponseTransfer], + decodeAs[PDUSessionResourceModifyResponseTransfer], + decodeAs[PDUSessionResourceModifyIndicationTransfer], + decodeAs[PDUSessionResourceModifyConfirmTransfer], + decodeAs[PathSwitchRequestTransfer], + decodeAs[PathSwitchRequestAcknowledgeTransfer], + decodeAs[HandoverRequestAcknowledgeTransfer], + decodeAs[HandoverCommandTransfer], + func(b []byte) (per.Marshaler, error) { + v, err := ParsePDUSessionResourceSetupRequestTransfer(b) + if err != nil { + return nil, err + } + + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPDUSessionResourceSetup, pDUSessionResourceSetupRequestTransferIEs, v) + }), nil + }, + func(b []byte) (per.Marshaler, error) { + v, err := ParsePDUSessionResourceModifyRequestTransfer(b) + if err != nil { + return nil, err + } + + return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcPDUSessionResourceModify, pDUSessionResourceModifyRequestTransferIEs, v) + }), nil + }, + } +} + +func FuzzTNLTransferRoundTrip(f *testing.F) { + parsers := tnlFuzzParsers() + + for _, c := range tnlTransferCases() { + b, err := c.transfer.Marshal() + if err != nil { + f.Fatal(err) + } + + for i := range parsers { + f.Add(byte(i), []byte(b)) + } + } + + for i, c := range losslessCases() { + b, err := per.Marshal(c.value(f)) + if err != nil { + f.Fatal(err) + } + + f.Add(byte(i), b) + } + + f.Fuzz(func(t *testing.T, kind byte, data []byte) { + parse := parsers[int(kind)%len(parsers)] + + v, err := parse(data) + if err != nil { + return + } + + b, err := per.Marshal(v) + if err != nil { + t.Fatalf("encode decoded value: %v", err) + } + + again, err := parse(b) + if err != nil { + t.Fatalf("decode re-encoded value %x: %v", b, err) + } + + b2, err := per.Marshal(again) + if err != nil || !bytes.Equal(b2, b) { + t.Fatalf("re-encoded %x (%v), want %x", b2, err, b) + } + }) +} + +func losslessGoldens() map[string]string { + return map[string]string{ + "GTPTunnel": "c3e00a000001000000100000fde84002dead0102beef", + "SNSSAI": "a0200000fde84002dead0102beef", + "UPTransportLayerInformationItem": "d87c0a000001000000120000fde84002dead0102beef0000fde84002dead0102beef", + "UPTransportLayerInformationPairItem": "d87c0a000001000000130000fde84002dead0102beef61f00a000003000000140000fde84002dead0102beef0000fde84002dead0102beef", + "UL-NGU-UP-TNLModifyItem": "d87c0a000001000000150000fde84002dead0102beef61f00a000003000000160000fde84002dead0102beef0001fde84002dead00c3400a01f00a000002000000170102beef", + "QosFlowPerTNLInformation": "d87c0a000003000000110000fde84002dead0102beef00010000fde84002dead0102beef", + "QosFlowPerTNLInformationItem": "f61f0a000003000000110000fde84002dead0102beef00010000fde84002dead0102beef0000fde84002dead0102beef", + "DataForwardingResponseDRBItem": "f0007c0a0000030000001861f00a000003000000190000fde84002dead0102beef0000fde84002dead0102beef", + "DataForwardingResponseERABListItem": "cac3e00a0000030000001a0000fde84002dead0102beef0000fde84002dead0102beef", + "AdditionalDLUPTNLInformationForHOItem": "ac3e0a0000030000001b0000fde84002dead0102beef02810000fde84002dead0102beef0001fde84002dead00b7400a01f00a0000040000001c0102beef", + "UserPlaneFailureIndication": "c61f0a0000010000001d0000fde84002dead0102beef61f00a0000030000001e0000fde84002dead0102beef0000fde84002dead0102beef", + "QosFlowAddOrModifyRequestItem": "f0396109000064c2600000fde84002dead0102beef0000fde84002dead0102beefdc000000fde84002dead0102beef8800010002000300040000fde84002dead0102beef0000fde84002dead0102beef280001fde84002dead008b400a01f00a0000010000001f0102beef", + "QosFlowAddOrModifyResponseItem": "c0800001fde84002dead0080400a01f00a000003000000200102beef", + "QosFlowSetupRequestItem": "a072c2120064c2600000fde84002dead0102beef0000fde84002dead0102beefdc000000fde84002dead0102beef8800010002000300040000fde84002dead0102beef0000fde84002dead0102beef0000fde84002dead0102beef", + "NonDynamic5QIDescriptor": "88090000fde84002dead0102beef", + "PDUSessionAggregateMaximumBitRate": "c403e81007d00000fde84002dead0102beef", + "SecurityIndication": "a0000000fde84002dead0102beef", + "SecurityResult": "c00000fde84002dead0102beef", + "UserPlaneSecurityInformation": "d00000fde84002dead80008002beef0000fde84002dead0102beef", + "QosFlowWithCauseItem": "c0c00000fde84002dead0102beef", + "QosFlowAcceptedItem": "c0800000fde84002dead0102beef", + "QosFlowItemWithDataForwarding": "e0400000fde84002dead0102beef", + "QosFlowToBeForwardedItem": "c0800000fde84002dead0102beef", + "QosFlowModifyConfirmItem": "c0800000fde84002dead0102beef", + "PDUSessionResourceSetupItemSUReq": "a001a0200000fde84002dead0102beef01000000fde84002dead0102beef", + "PDUSessionResourceSetupItemSURes": "c00101000000fde84002dead0102beef", + "PDUSessionResourceSetupItemCxtReq": "a001a0200000fde84002dead0102beef01000000fde84002dead0102beef", + "PDUSessionResourceSetupItemCxtRes": "c00101000000fde84002dead0102beef", + "PDUSessionResourceSetupItemHOReq": "c001a0200000fde84002dead0102beef01000000fde84002dead0102beef", + "PDUSessionResourceAdmittedItem": "c00101000000fde84002dead0102beef", + "PDUSessionResourceHandoverItem": "c00101000000fde84002dead0102beef", + "PDUSessionResourceToBeSwitchedDLItem": "c00101000000fde84002dead0102beef", + "PDUSessionResourceSwitchedItem": "c00101000000fde84002dead0102beef", + "PDUSessionResourceModifyItemModReq": "a00101000001fde84002dead0094000540200102030102beef", + "PDUSessionResourceModifyItemModRes": "c00101000000fde84002dead0102beef", + "PDUSessionResourceModifyItemModInd": "c00101000000fde84002dead0102beef", + "PDUSessionResourceModifyItemModCfm": "c00101000000fde84002dead0102beef", + "PDUSessionResourceSetupResponseTransfer": "fec3e00a000003000000110000fde84002dead0102beef00010000fde84002dead0102beef0007c00a000003000002020001400000fde84002dead0205000402beef0002fde84002dead00c1400c007c0a00000400000203000100b8400d0007c00a0000040000020400010102beef", + "PDUSessionResourceModifyResponseTransfer": "fa03e00a0000030000040101f00a00000100000402010200000080400a01f00a000003000004030007c00a0000030000040400010005fde84002dead009a4014001f0a0000010000040501f00a0000030000040600c0400a01f00a0000040000040700c3400a01f00a0000020000040800b8400d0007c00a00000400000409000100b94014001f0a0000020000040a01f00a0000040000040b0102beef", + "PDUSessionResourceModifyIndicationTransfer": "e00f800a0000030000050100010007c00a0000030000050200010002fde84002dead00c1400c007c0a00000400000503000100b8400d0007c00a0000040000050400010102beef", + "PDUSessionResourceModifyConfirmTransfer": "d000203e0a00000100000601001f0a0000010000060201f00a000003000006030002fde84002dead00c3400a01f00a0000020000060400b94014001f0a0000020000060501f00a000004000006060102beef", + "PathSwitchRequestTransfer": "b01f0a000003000007014000000000fde84002dead00020004fde84002dead009b400d0007c00a00000300000702000100c0400a01f00a0000040000070300bf40010000b8400d0007c00a0000040000070400010102beef", + "PathSwitchRequestAcknowledgeTransfer": "f01f0a0000010000080120000000fde84002dead0003fde84002dead009a4014001f0a0000010000080201f00a0000030000080300c3400a01f00a0000020000080400b94014001f0a0000020000080501f00a000004000008060102beef", + "HandoverRequestAcknowledgeTransfer": "cc07c00a0000030000090101f00a000003000009020001030003e00a0000030000090301f00a000003000009040005fde84002dead00994027180f800a00000300000905000101f00a00000300000906000000b7400a01f00a0000040000090700a4000a01f00a0000030000090800ac000a001f0a0000030000090900f9400c000a03e00a0000030000090a00c0400a01f00a0000040000090b0102beef", + "HandoverCommandTransfer": "f80f800a00000100000a010002060007c00a00000100000a0201f00a00000100000a030004fde84002dead0098400d0007c00a00000100000a04000100a4000a01f00a00000100000a0500ac000a001f0a00000100000a0600f9400c000a03e00a00000100000a070102beef", + } +} + +const ( + goldenTNLSetupRequest = "001d0064000003000a00020001005500020002004a005100000500204b000006008b000a01f00a00000100000101007e000a001f0a0000010000010200860001000088000700010000091c0000c3400a01f00a0000020000010300ba400a001f0a00000200000104" + goldenTNLSetupResponse = "201d0054000003000a40020001005540020002004b40410000053d4803e00a0000030000020100010007c00a000003000002020001000100c1400c007c0a00000400000203000100b8400d0007c00a000004000002040001" + goldenTNLModifyRequest = "001a0080b6000003000a0002000100550002000200400080a20020058092000006008c0032101f0a0000010000030101f00a00000300000302000100c3400a01f00a0000020000030300c0400a01f00a00000400000304008700130040800000008b400a01f00a00000100000305007e000a001f0a0000010000030600ba400a001f0a0000020000030700c3400a01f00a0000020000030801b34014101f0a0000010000030901f00a0000030000030a0000009400054020010203" + goldenTNLModifyResponse = "201a0080ac000003000a40020001005540020002004140809800000580937a03e00a0000030000040101f00a00000100000402010200000080400a01f00a000003000004030007c00a0000030000040400010004009a4014001f0a0000010000040501f00a0000030000040600c0400a01f00a0000040000040700c3400a01f00a0000020000040800b8400d0007c00a00000400000409000100b94014001f0a0000020000040a01f00a0000040000040b" + goldenTNLModifyIndication = "001b0054000003000a00020001005500020002003f00410000053d600f800a0000030000050100010007c00a000003000005020001000100c1400c007c0a00000400000503000100b8400d0007c00a000004000005040001" + goldenTNLModifyConfirm = "201b005f000003000a40020001005540020002003e404c000005485000203e0a00000100000601001f0a0000010000060201f00a00000300000603000100c3400a01f00a0000020000060400b94014001f0a0000020000060501f00a00000400000606" + goldenTNLPathSwitchRequest = "0019007a0000050055000200020064000200010079400f4000f110000000000000f11000000100774009000000000000000000004c004700000543101f0a0000030000070100020003009b400d0007c00a00000300000702000100c0400a01f00a0000040000070300bf40010000b8400d0007c00a000004000007040001" + goldenTNLPathSwitchRequestAcknowledge = "201900808c000005000a40020001005540020002005d0021000000000000000000000000000000000000000000000000000000000000000000004d404e0000054a501f0a000001000008010002009a4014001f0a0000010000080201f00a0000030000080300c3400a01f00a0000020000080400b94014001f0a0000020000080501f00a00000400000806000000020001" + goldenTNLHandoverRequestAcknowledge = "200d0080b4000004000a40020001005540020002003540809900000580944c07c00a0000030000090101f00a000003000009020001030003e00a0000030000090301f00a00000300000904000400994027180f800a00000300000905000101f00a00000300000906000000b7400a01f00a0000040000090700a4000a01f00a0000030000090800ac000a001f0a0000030000090900f9400c000a03e00a0000030000090a00c0400a01f00a0000040000090b006a0003020000" + goldenTNLHandoverCommand = "200c008085000005000a00020001005500020002001d000100003b406600000562780f800a00000100000a010002060007c00a00000100000a0201f00a00000100000a0300030098400d0007c00a00000100000a04000100a4000a01f00a00000100000a0500ac000a001f0a00000100000a0600f9400c000a03e00a00000100000a07006a0003020000" +) + +func TestTNLRequestTransfersKeepUnknownIEsAndAdditions(t *testing.T) { + setup := tnlSetupRequestTransfer() + setup.preserve(rawIE{id: unknownExtensionID, crit: CriticalityIgnore, value: []byte{0xde, 0xad}}) + setup.extensions = unknownAdditions(t) + + modify := tnlModifyRequestTransfer() + modify.preserve(rawIE{id: unknownExtensionID, crit: CriticalityNotify, value: []byte{0xde, 0xad}}) + modify.extensions = unknownAdditions(t) + + for _, c := range []struct { + name string + transfer interface { + Marshal() (TransferContainer, error) + } + parse func(TransferContainer) (interface { + Marshal() (TransferContainer, error) + }, error) + }{ + {"PDUSessionResourceSetupRequestTransfer", setup, func(b TransferContainer) (interface { + Marshal() (TransferContainer, error) + }, error, + ) { + return ParsePDUSessionResourceSetupRequestTransfer(b) + }}, + {"PDUSessionResourceModifyRequestTransfer", modify, func(b TransferContainer) (interface { + Marshal() (TransferContainer, error) + }, error, + ) { + return ParsePDUSessionResourceModifyRequestTransfer(b) + }}, + } { + t.Run(c.name, func(t *testing.T) { + b, err := c.transfer.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := c.parse(b) + if err != nil { + t.Fatal(err) + } + + again, err := out.Marshal() + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x (%v), want %x", again, err, b) + } + + if b[0]&0x80 == 0 || !bytes.Contains(b, []byte{0xfd, 0xe8}) || !bytes.HasSuffix(b, []byte{0x01, 0x02, 0xbe, 0xef}) { + t.Fatalf("%x lacks the unknown IE or the extension addition", b) + } + }) + } +} + +func TestTNLManyUnknownExtensionsKeptExactly(t *testing.T) { + in := tnlHandoverCommandTransfer() + + fields := make([]ieField, 0, 3*maxPreservedIEs) + for i := range 3 * maxPreservedIEs { + fields = append(fields, ieField{id: unknownExtensionID - ProtocolIEID(i), crit: CriticalityIgnore, raw: []byte{byte(i)}}) + } + + w := per.NewWriter() + tbNil(t, encodeExtensionContainer(w, per.Aligned, fields)) + w.AlignToByte() + tbNil(t, decodeExtensionContainer(per.NewReader(w.Bytes()), per.Aligned, handoverCommandTransferExtIEs, in, &in.iEExtensions)) + + if got := len(in.iEExtensions.UnknownIEs()); got != 3*maxPreservedIEs { + t.Fatalf("kept %d unknown extensions, want %d", got, 3*maxPreservedIEs) + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := ParseHandoverCommandTransfer(b) + if err != nil { + t.Fatal(err) + } + + again, err := out.Marshal() + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("re-encoded %x (%v), want %x", again, err, b) + } +} + +func TestTNLRequestTransferKeepsManyUnknownIEs(t *testing.T) { + in := tnlSetupRequestTransfer() + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + r := per.NewReader(b) + _, err = r.ReadBit() + tbNil(t, err) + + fields, err := decodeIEContainer(r, per.Aligned) + tbNil(t, err) + + all := make([]ieField, 0, len(fields)+3*maxPreservedIEs) + for _, f := range fields { + all = append(all, f.field()) + } + + for i := range 3 * maxPreservedIEs { + all = append(all, ieField{id: unknownExtensionID - ProtocolIEID(i), crit: CriticalityIgnore, raw: []byte{byte(i)}}) + } + + w := per.NewWriter() + w.WriteBit(false) + tbNil(t, encodeIEContainer(w, per.Aligned, all)) + w.AlignToByte() + + out, err := ParsePDUSessionResourceSetupRequestTransfer(w.Bytes()) + if err != nil { + t.Fatal(err) + } + + if got := len(out.UnknownIEs()); got != 3*maxPreservedIEs { + t.Fatalf("kept %d unknown IEs, want %d", got, 3*maxPreservedIEs) + } + + again, err := out.Marshal() + if err != nil || !bytes.Equal(again, w.Bytes()) { + t.Fatalf("re-encoded %x (%v), want %x", again, err, w.Bytes()) + } +} + +func TestMessageTruncatedOnDecodeRefusesToEncode(t *testing.T) { + fields := ngSetupFields() + for i := range maxPreservedIEs + 1 { + fields = append(fields, ieField{id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}}) + } + + msg, err := ParseNGSetupRequest(container(t, fields...)) + if err != nil { + t.Fatal(err) + } + + if _, err := msg.Marshal(); err == nil { + t.Fatal("a message whose unknown IEs were dropped on decode re-encoded") + } +} diff --git a/s1ap/enum_names.go b/s1ap/enum_names.go index 0d8c0a2002..babf8ce61a 100644 --- a/s1ap/enum_names.go +++ b/s1ap/enum_names.go @@ -156,3 +156,23 @@ var cellSizeNames = map[CellSize]string{ } func (c CellSize) Name() string { return cellSizeNames[c] } + +var bearerTypeNames = map[BearerType]string{ + BearerTypeNonIP: "non-IP", +} + +func (b BearerType) Name() string { return bearerTypeNames[b] } + +var ethernetTypeNames = map[EthernetType]string{ + EthernetTypeTrue: "true", +} + +func (e EthernetType) Name() string { return ethernetTypeNames[e] } + +var integrityProtectionIndicationNames = map[IntegrityProtectionIndication]string{ + IntegrityProtectionRequired: "required", + IntegrityProtectionPreferred: "preferred", + IntegrityProtectionNotNeeded: "not-needed", +} + +func (i IntegrityProtectionIndication) Name() string { return integrityProtectionIndicationNames[i] } diff --git a/s1ap/erab_lists.go b/s1ap/erab_lists.go new file mode 100644 index 0000000000..7adc46c525 --- /dev/null +++ b/s1ap/erab_lists.go @@ -0,0 +1,219 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import "github.com/ellanetworks/core/per" + +type ERABToBeSwitchedULItem struct { + ERABID ERABID + TransportLayerAddress TransportLayerAddress + GTPTEID GTPTEID + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +type ERABToBeSetupListCtxtSUReq []ERABToBeSetupItemCtxtSUReq + +func (l ERABToBeSetupListCtxtSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject, l) +} + +func (l *ERABToBeSetupListCtxtSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeSetupItemCtxtSUReq](r, enc, maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABSetupListCtxtSURes []ERABSetupItemCtxtSURes + +func (l ERABSetupListCtxtSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore, l) +} + +func (l *ERABSetupListCtxtSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABSetupItemCtxtSURes](r, enc, maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABToBeSetupListBearerSUReq []ERABToBeSetupItemBearerSUReq + +func (l ERABToBeSetupListBearerSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject, l) +} + +func (l *ERABToBeSetupListBearerSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeSetupItemBearerSUReq](r, enc, maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABSetupListBearerSURes []ERABSetupItemBearerSURes + +func (l ERABSetupListBearerSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore, l) +} + +func (l *ERABSetupListBearerSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABSetupItemBearerSURes](r, enc, maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABToBeModifiedListBearerModReq []ERABToBeModifiedItemBearerModReq + +func (l ERABToBeModifiedListBearerModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject, l) +} + +func (l *ERABToBeModifiedListBearerModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeModifiedItemBearerModReq](r, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABToBeModifiedListBearerModInd []ERABToBeModifiedItemBearerModInd + +func (l ERABToBeModifiedListBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject, l) +} + +func (l *ERABToBeModifiedListBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABNotToBeModifiedListBearerModInd []ERABToBeModifiedItemBearerModInd + +func (l ERABNotToBeModifiedListBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject, l) +} + +func (l *ERABNotToBeModifiedListBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABToBeSetupListHOReq []ERABToBeSetupItemHOReq + +func (l ERABToBeSetupListHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject, l) +} + +func (l *ERABToBeSetupListHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeSetupItemHOReq](r, enc, maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABAdmittedList []ERABAdmittedItem + +func (l ERABAdmittedList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore, l) +} + +func (l *ERABAdmittedList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABAdmittedItem](r, enc, maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABSubjecttoDataForwardingList []ERABDataForwardingItem + +func (l ERABSubjecttoDataForwardingList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore, l) +} + +func (l *ERABSubjecttoDataForwardingList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABDataForwardingItem](r, enc, maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABToBeSwitchedDLList []ERABToBeSwitchedDLItem + +func (l ERABToBeSwitchedDLList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject, l) +} + +func (l *ERABToBeSwitchedDLList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeSwitchedDLItem](r, enc, maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ERABToBeSwitchedULList []ERABToBeSwitchedULItem + +func (l ERABToBeSwitchedULList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSwitchedULItem, CriticalityIgnore, l) +} + +func (l *ERABToBeSwitchedULList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeSwitchedULItem](r, enc, maxnoofERABs, IDERABToBeSwitchedULItem, CriticalityIgnore) + if err != nil { + return err + } + + *l = items + + return nil +} diff --git a/s1ap/erab_modification.go b/s1ap/erab_modification.go index 8e96c49268..e07a46bb3b 100644 --- a/s1ap/erab_modification.go +++ b/s1ap/erab_modification.go @@ -10,19 +10,20 @@ import ( // ERABToBeModifiedItemBearerModInd ::= SEQUENCE { e-RAB-ID, transportLayerAddress, // dL-GTP-TEID, iE-Extensions OPTIONAL } (extensible) (TS 36.413 §9.2.1.31). type ERABToBeModifiedItemBearerModInd struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID TransportLayerAddress TransportLayerAddress DLGTPTEID GTPTEID - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } // TS 36.413 §9.1.3.8. type ERABModificationIndication struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID - ToBeModified []ERABToBeModifiedItemBearerModInd - NotToBeModified []ERABToBeModifiedItemBearerModInd + ToBeModified ERABToBeModifiedListBearerModInd + NotToBeModified ERABNotToBeModifiedListBearerModInd UserLocationInformation *UserLocationInformation messageMeta @@ -48,7 +49,7 @@ var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ decode: func(m *ERABModificationIndication, raw []byte, enc per.Encoding) error { var err error - m.ToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd) + m.ToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject) return err }, @@ -63,7 +64,7 @@ var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ decode: func(m *ERABModificationIndication, raw []byte, enc per.Encoding) error { var err error - m.NotToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](per.NewReader(raw), enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd) + m.NotToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](per.NewReader(raw), enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) return err }, @@ -190,7 +191,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ { id: IDERABModifyListBearerModConf, presence: presenceOptional, crit: CriticalityIgnore, decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { - items, err := decodeItemList[erabModifyItemBearerModConf](per.NewReader(raw), enc, maxnoofERABs, IDERABModifyItemBearerModConf) + items, err := decodeItemList[erabModifyItemBearerModConf](per.NewReader(raw), enc, maxnoofERABs, IDERABModifyItemBearerModConf, CriticalityIgnore) if err != nil { return err } @@ -222,7 +223,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { var err error - m.FailedToModify, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.FailedToModify, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, @@ -241,7 +242,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { var err error - m.ToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, diff --git a/s1ap/erab_modify.go b/s1ap/erab_modify.go index 939af8ba1f..8266b20947 100644 --- a/s1ap/erab_modify.go +++ b/s1ap/erab_modify.go @@ -11,11 +11,43 @@ import ( // e-RABLevelQoSParameters, nAS-PDU, iE-Extensions OPTIONAL } (extensible). // The NAS-PDU carries the MODIFY EPS BEARER CONTEXT REQUEST (TS 36.413). type ERABToBeModifiedItemBearerModReq struct { - _ [0]struct{} `per:"extseq"` - ERABID ERABID - QoS ERABLevelQoSParameters - NASPDU NASPDU - _ ieExtensions `per:",skip"` + ERABID ERABID + QoS ERABLevelQoSParameters + NASPDU NASPDU + TransportInformation *TransportInformation `per:"-"` + iEExtensions messageMeta `per:",exttable:eRABToBeModifyItemBearerModReqExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +type TransportInformation struct { + TransportLayerAddress TransportLayerAddress + ULGTPTEID GTPTEID + extensions per.ExtensionAdditions `per:",extraw"` +} + +var eRABToBeModifyItemBearerModReqExtIEs = []ieSpec[ERABToBeModifiedItemBearerModReq]{ + { + id: IDTransportInformation, presence: presenceOptional, crit: CriticalityReject, + decode: func(m *ERABToBeModifiedItemBearerModReq, raw []byte, enc per.Encoding) error { + var v TransportInformation + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.TransportInformation = &v + + return nil + }, + encode: func(m *ERABToBeModifiedItemBearerModReq) (per.Marshaler, bool) { + if m.TransportInformation == nil { + return nil, false + } + + return m.TransportInformation, true + }, + }, } // ERABModifyItemBearerModRes ::= SEQUENCE { e-RAB-ID, iE-Extensions OPTIONAL } @@ -31,7 +63,7 @@ type ERABModifyRequest struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID UEAggregateMaximumBitRate *UEAggregateMaximumBitRate - ERABToBeModified []ERABToBeModifiedItemBearerModReq + ERABToBeModified ERABToBeModifiedListBearerModReq messageMeta } @@ -81,7 +113,7 @@ var eRABModifyRequestIEs = []ieSpec[ERABModifyRequest]{ decode: func(m *ERABModifyRequest, raw []byte, enc per.Encoding) error { var err error - m.ERABToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeModifiedItemBearerModReq) + m.ERABToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject) return err }, @@ -177,7 +209,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABModify, err = decodeItemList[ERABModifyItemBearerModRes](per.NewReader(raw), enc, maxnoofERABs, IDERABModifyItemBearerModRes) + m.ERABModify, err = decodeItemList[ERABModifyItemBearerModRes](per.NewReader(raw), enc, maxnoofERABs, IDERABModifyItemBearerModRes, CriticalityIgnore) return err }, @@ -196,7 +228,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABFailedToModify, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABFailedToModify, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, diff --git a/s1ap/erab_release.go b/s1ap/erab_release.go index 321b001b6d..0ac9a1e673 100644 --- a/s1ap/erab_release.go +++ b/s1ap/erab_release.go @@ -71,7 +71,7 @@ var eRABReleaseCommandIEs = []ieSpec[ERABReleaseCommand]{ decode: func(m *ERABReleaseCommand, raw []byte, enc per.Encoding) error { var err error - m.ERABToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, @@ -184,7 +184,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABReleased, err = decodeItemList[ERABReleaseItemBearerRelComp](per.NewReader(raw), enc, maxnoofERABs, IDERABReleaseItemBearerRelComp) + m.ERABReleased, err = decodeItemList[ERABReleaseItemBearerRelComp](per.NewReader(raw), enc, maxnoofERABs, IDERABReleaseItemBearerRelComp, CriticalityIgnore) return err }, @@ -203,7 +203,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABFailedToRelease, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABFailedToRelease, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, @@ -314,7 +314,7 @@ var eRABReleaseIndicationIEs = []ieSpec[ERABReleaseIndication]{ decode: func(m *ERABReleaseIndication, raw []byte, enc per.Encoding) error { var err error - m.ERABReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, diff --git a/s1ap/erab_setup.go b/s1ap/erab_setup.go index 1e3cf1fd3a..298e9620b1 100644 --- a/s1ap/erab_setup.go +++ b/s1ap/erab_setup.go @@ -12,13 +12,37 @@ import ( // (extensible). The NAS-PDU is mandatory: it carries the ACTIVATE DEFAULT EPS // BEARER CONTEXT REQUEST for an additional PDN connection. type ERABToBeSetupItemBearerSUReq struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID QoS ERABLevelQoSParameters TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID NASPDU NASPDU - _ ieExtensions `per:",skip"` + CorrelationID *CorrelationID `per:"-"` + SIPTOCorrelationID *CorrelationID `per:"-"` + BearerType *BearerType `per:"-"` + EthernetType *EthernetType `per:"-"` + SecurityIndication *SecurityIndication `per:"-"` + iEExtensions messageMeta `per:",exttable:eRABToBeSetupItemBearerSUReqExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +var eRABToBeSetupItemBearerSUReqExtIEs = []ieSpec[ERABToBeSetupItemBearerSUReq]{ + optionalExtension(IDCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemBearerSUReq) **CorrelationID { + return &m.CorrelationID + }), + optionalExtension(IDSIPTOCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemBearerSUReq) **CorrelationID { + return &m.SIPTOCorrelationID + }), + optionalExtension(IDBearerType, CriticalityReject, func(m *ERABToBeSetupItemBearerSUReq) **BearerType { + return &m.BearerType + }), + optionalExtension(IDEthernetType, CriticalityIgnore, func(m *ERABToBeSetupItemBearerSUReq) **EthernetType { + return &m.EthernetType + }), + optionalExtension(IDSecurityIndication, CriticalityReject, func(m *ERABToBeSetupItemBearerSUReq) **SecurityIndication { + return &m.SecurityIndication + }), } // ERABSetupItemBearerSURes ::= SEQUENCE { e-RAB-ID, transportLayerAddress, @@ -30,7 +54,7 @@ type ERABSetupRequest struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID UEAggregateMaximumBitRate *UEAggregateMaximumBitRate - ERABToBeSetup []ERABToBeSetupItemBearerSUReq + ERABToBeSetup ERABToBeSetupListBearerSUReq messageMeta } @@ -80,7 +104,7 @@ var eRABSetupRequestIEs = []ieSpec[ERABSetupRequest]{ decode: func(m *ERABSetupRequest, raw []byte, enc per.Encoding) error { var err error - m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemBearerSUReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemBearerSUReq) + m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemBearerSUReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject) return err }, @@ -120,7 +144,7 @@ func ParseERABSetupRequest(value []byte) (*ERABSetupRequest, error) { type ERABSetupResponse struct { MMEUES1APID *MMEUES1APID ENBUES1APID *ENBUES1APID - ERABSetup []ERABSetupItemBearerSURes + ERABSetup ERABSetupListBearerSURes ERABFailedToSetup []ERABItem CriticalityDiagnostics *CriticalityDiagnostics UserLocationInformation *UserLocationInformation @@ -176,7 +200,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABSetup, err = decodeItemList[ERABSetupItemBearerSURes](per.NewReader(raw), enc, maxnoofERABs, IDERABSetupItemBearerSURes) + m.ERABSetup, err = decodeItemList[ERABSetupItemBearerSURes](per.NewReader(raw), enc, maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore) return err }, @@ -195,7 +219,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, diff --git a/s1ap/golden_tshark_test.go b/s1ap/golden_tshark_test.go index caca14bbe3..7d71220128 100644 --- a/s1ap/golden_tshark_test.go +++ b/s1ap/golden_tshark_test.go @@ -30,7 +30,7 @@ func goldenTsharkVectors(t *testing.T) []tsharkVector { b, err := hex.DecodeString(c.golden) mustNil(t, err) - out = append(out, tsharkVector{name: c.name, b: b}) + out = append(out, tsharkVector{name: c.name, b: b, extensionNotices: c.extensionNotices}) } return append(out, diff --git a/s1ap/handover_preparation.go b/s1ap/handover_preparation.go index de1a514f5a..9c5ecf2650 100644 --- a/s1ap/handover_preparation.go +++ b/s1ap/handover_preparation.go @@ -144,7 +144,7 @@ type HandoverCommand struct { ENBUES1APID ENBUES1APID HandoverType HandoverType NASSecurityParametersfromEUTRAN NASSecurityParametersfromEUTRAN - ERABSubjecttoDataForwarding []ERABDataForwardingItem + ERABSubjecttoDataForwarding ERABSubjecttoDataForwardingList ERABToRelease []ERABItem TargetToSource TransparentContainer CriticalityDiagnostics *CriticalityDiagnostics @@ -199,7 +199,7 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { var err error - m.ERABSubjecttoDataForwarding, err = decodeItemList[ERABDataForwardingItem](per.NewReader(raw), enc, maxnoofERABs, IDERABDataForwardingItem) + m.ERABSubjecttoDataForwarding, err = decodeItemList[ERABDataForwardingItem](per.NewReader(raw), enc, maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore) return err }, @@ -218,7 +218,7 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { var err error - m.ERABToRelease, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABToRelease, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, diff --git a/s1ap/handover_resource_allocation.go b/s1ap/handover_resource_allocation.go index 616dda26fb..dcf2fc53ce 100644 --- a/s1ap/handover_resource_allocation.go +++ b/s1ap/handover_resource_allocation.go @@ -13,7 +13,7 @@ type HandoverRequest struct { HandoverType HandoverType Cause *Cause UEAMBR UEAggregateMaximumBitRate - ERABToBeSetup []ERABToBeSetupItemHOReq + ERABToBeSetup ERABToBeSetupListHOReq SourceToTarget TransparentContainer UESecurityCapabilities UESecurityCapabilities @@ -87,7 +87,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { var err error - m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemHOReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemHOReq) + m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemHOReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject) return err }, @@ -252,7 +252,7 @@ func ParseHandoverRequest(value []byte) (*HandoverRequest, error) { type HandoverRequestAcknowledge struct { MMEUES1APID *MMEUES1APID ENBUES1APID *ENBUES1APID - ERABAdmitted []ERABAdmittedItem + ERABAdmitted ERABAdmittedList ERABFailedToSetup []ERABItem TargetToSource TransparentContainer CriticalityDiagnostics *CriticalityDiagnostics @@ -308,7 +308,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { var err error - m.ERABAdmitted, err = decodeItemList[ERABAdmittedItem](per.NewReader(raw), enc, maxnoofERABs, IDERABAdmittedItem) + m.ERABAdmitted, err = decodeItemList[ERABAdmittedItem](per.NewReader(raw), enc, maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore) return err }, @@ -327,7 +327,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { var err error - m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABFailedtoSetupItemHOReqAck) + m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABFailedtoSetupItemHOReqAck, CriticalityIgnore) return err }, diff --git a/s1ap/ie_erab.go b/s1ap/ie_erab.go index 0808c7d0c4..d4ea1a3884 100644 --- a/s1ap/ie_erab.go +++ b/s1ap/ie_erab.go @@ -65,32 +65,62 @@ const ( // pre-emptionCapability, pre-emptionVulnerability, iE-Extensions OPTIONAL } // (extensible). PriorityLevel ::= INTEGER (0..15). type AllocationAndRetentionPriority struct { - _ [0]struct{} `per:"extseq"` PriorityLevel uint8 `per:",range:0..15"` PreemptionCapability PreemptionCapability `per:"ENUMERATED,range:0..1"` PreemptionVulnerability PreemptionVulnerability `per:"ENUMERATED,range:0..1"` - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` } // GBRQosInformation ::= SEQUENCE { four BitRates, iE-Extensions OPTIONAL } // (extensible). type GBRQosInformation struct { - _ [0]struct{} `per:"extseq"` - MaximumBitrateDL BitRate - MaximumBitrateUL BitRate - GuaranteedBitrateDL BitRate - GuaranteedBitrateUL BitRate - _ ieExtensions `per:",skip"` + MaximumBitrateDL BitRate + MaximumBitrateUL BitRate + GuaranteedBitrateDL BitRate + GuaranteedBitrateUL BitRate + ExtendedMaximumBitrateDL *ExtendedBitRate `per:"-"` + ExtendedMaximumBitrateUL *ExtendedBitRate `per:"-"` + ExtendedGuaranteedBitrateDL *ExtendedBitRate `per:"-"` + ExtendedGuaranteedBitrateUL *ExtendedBitRate `per:"-"` + iEExtensions messageMeta `per:",exttable:gBRQosInformationExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var gBRQosInformationExtIEs = []ieSpec[GBRQosInformation]{ + optionalExtension(IDExtendedERABMaximumBitrateDL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { + return &m.ExtendedMaximumBitrateDL + }), + optionalExtension(IDExtendedERABMaximumBitrateUL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { + return &m.ExtendedMaximumBitrateUL + }), + optionalExtension(IDExtendedERABGuaranteedBitrateDL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { + return &m.ExtendedGuaranteedBitrateDL + }), + optionalExtension(IDExtendedERABGuaranteedBitrateUL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { + return &m.ExtendedGuaranteedBitrateUL + }), } // ERABLevelQoSParameters ::= SEQUENCE { qCI, allocationRetentionPriority, // gbrQosInformation OPTIONAL, iE-Extensions OPTIONAL } (extensible). type ERABLevelQoSParameters struct { - _ [0]struct{} `per:"extseq"` - QCI QCI - ARP AllocationAndRetentionPriority - GBR *GBRQosInformation `per:",optional"` - _ ieExtensions `per:",skip"` + QCI QCI + ARP AllocationAndRetentionPriority + GBR *GBRQosInformation `per:",optional"` + DownlinkPacketLossRate *PacketLossRate `per:"-"` + UplinkPacketLossRate *PacketLossRate `per:"-"` + iEExtensions messageMeta `per:",exttable:eRABLevelQoSParametersExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +var eRABLevelQoSParametersExtIEs = []ieSpec[ERABLevelQoSParameters]{ + optionalExtension(IDDownlinkPacketLossRate, CriticalityIgnore, func(m *ERABLevelQoSParameters) **PacketLossRate { + return &m.DownlinkPacketLossRate + }), + optionalExtension(IDUplinkPacketLossRate, CriticalityIgnore, func(m *ERABLevelQoSParameters) **PacketLossRate { + return &m.UplinkPacketLossRate + }), } // TransportLayerAddress ::= BIT STRING (SIZE(1..160, ...)). Holds the address @@ -157,23 +187,48 @@ func (t *GTPTEID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // transportLayerAddress, gTP-TEID, nAS-PDU OPTIONAL, iE-Extensions OPTIONAL } // (extensible). type ERABToBeSetupItemCtxtSUReq struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID QoS ERABLevelQoSParameters TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - NASPDU NASPDU `per:",optional"` - _ ieExtensions `per:",skip"` + NASPDU NASPDU `per:",optional"` + CorrelationID *CorrelationID `per:"-"` + SIPTOCorrelationID *CorrelationID `per:"-"` + BearerType *BearerType `per:"-"` + EthernetType *EthernetType `per:"-"` + SecurityIndication *SecurityIndication `per:"-"` + iEExtensions messageMeta `per:",exttable:eRABToBeSetupItemCtxtSUReqExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +var eRABToBeSetupItemCtxtSUReqExtIEs = []ieSpec[ERABToBeSetupItemCtxtSUReq]{ + optionalExtension(IDCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemCtxtSUReq) **CorrelationID { + return &m.CorrelationID + }), + optionalExtension(IDSIPTOCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemCtxtSUReq) **CorrelationID { + return &m.SIPTOCorrelationID + }), + optionalExtension(IDBearerType, CriticalityReject, func(m *ERABToBeSetupItemCtxtSUReq) **BearerType { + return &m.BearerType + }), + optionalExtension(IDEthernetType, CriticalityIgnore, func(m *ERABToBeSetupItemCtxtSUReq) **EthernetType { + return &m.EthernetType + }), + optionalExtension(IDSecurityIndication, CriticalityReject, func(m *ERABToBeSetupItemCtxtSUReq) **SecurityIndication { + return &m.SecurityIndication + }), } // ERABSetupItemCtxtSURes ::= SEQUENCE { e-RAB-ID, transportLayerAddress, // gTP-TEID, iE-Extensions OPTIONAL } (extensible). type ERABSetupItemCtxtSURes struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - _ ieExtensions `per:",skip"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } // ERABItem ::= SEQUENCE { e-RAB-ID, cause, iE-Extensions OPTIONAL } (extensible). @@ -183,3 +238,136 @@ type ERABItem struct { Cause Cause _ ieExtensions `per:",skip"` } + +type BearerType uint8 + +const ( + BearerTypeNonIP BearerType = iota + + bearerTypeRootCount = 1 +) + +func (b BearerType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, bearerTypeRootCount, int64(b), "BearerType") +} + +func (b *BearerType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, bearerTypeRootCount, "BearerType") + if err != nil { + return err + } + + *b = BearerType(idx) + + return nil +} + +type EthernetType uint8 + +const ( + EthernetTypeTrue EthernetType = iota + + ethernetTypeRootCount = 1 +) + +func (e EthernetType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, ethernetTypeRootCount, int64(e), "Ethernet-Type") +} + +func (e *EthernetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, ethernetTypeRootCount, "Ethernet-Type") + if err != nil { + return err + } + + *e = EthernetType(idx) + + return nil +} + +type IntegrityProtectionIndication uint8 + +const ( + IntegrityProtectionRequired IntegrityProtectionIndication = iota + IntegrityProtectionPreferred + IntegrityProtectionNotNeeded + + integrityProtectionIndicationRootCount = 3 +) + +func (i IntegrityProtectionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, integrityProtectionIndicationRootCount, int64(i), "IntegrityProtectionIndication") +} + +func (i *IntegrityProtectionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, integrityProtectionIndicationRootCount, "IntegrityProtectionIndication") + if err != nil { + return err + } + + *i = IntegrityProtectionIndication(idx) + + return nil +} + +type SecurityIndication struct { + IntegrityProtectionIndication IntegrityProtectionIndication + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CorrelationID [4]byte + +func (c CorrelationID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 4, 4, true, true, false, c[:]) +} + +func (c *CorrelationID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) + if err != nil { + return err + } + + copy(c[:], b) + + return nil +} + +type PacketLossRate uint16 + +func (p PacketLossRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeConstrainedWholeNumber(w, enc, 0, 1000, int64(p)) +} + +func (p *PacketLossRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1000) + if err != nil { + return err + } + + *p = PacketLossRate(v) + + return nil +} + +const ( + extendedBitRateMin = 10000000001 + extendedBitRateMax = 4000000000000 +) + +type ExtendedBitRate uint64 + +func (b ExtendedBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeExtensibleInt(w, enc, extendedBitRateMin, extendedBitRateMax, int64(b)) +} + +func (b *ExtendedBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeExtensibleInt(r, enc, extendedBitRateMin, extendedBitRateMax, "ExtendedBitRate") + if err != nil { + return err + } + + *b = ExtendedBitRate(v) + + return nil +} diff --git a/s1ap/ie_erab_test.go b/s1ap/ie_erab_test.go index c14e3751c7..5d85109e8f 100644 --- a/s1ap/ie_erab_test.go +++ b/s1ap/ie_erab_test.go @@ -4,6 +4,7 @@ package s1ap import ( + "reflect" "testing" "github.com/ellanetworks/core/per" @@ -29,7 +30,7 @@ func TestAllocationAndRetentionPriorityRoundTrip(t *testing.T) { t.Fatalf("level %d: %v", level, err) } - if out != in { + if !reflect.DeepEqual(out, in) { t.Fatalf("level %d: round trip %+v, want %+v", level, out, in) } } @@ -55,7 +56,7 @@ func TestGBRQosInformationRoundTrip(t *testing.T) { t.Fatal(err) } - if out != in { + if !reflect.DeepEqual(out, in) { t.Fatalf("round trip %+v, want %+v", out, in) } } diff --git a/s1ap/ie_extensions.go b/s1ap/ie_extensions.go new file mode 100644 index 0000000000..6d0620a65e --- /dev/null +++ b/s1ap/ie_extensions.go @@ -0,0 +1,153 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "errors" + "fmt" + + "github.com/ellanetworks/core/per" +) + +func extensionFields[M any](table []ieSpec[M], m *M, meta *messageMeta) []ieField { + typed := make([]*ieField, len(table)) + + for i, spec := range table { + if val, ok := spec.encode(m); ok { + typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} + } + } + + return orderFields(table, typed, meta) +} + +func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { + if len(fields) > maxProtocolExtensions { + return fmt.Errorf("s1ap: %d extensions exceed maxProtocolExtensions", len(fields)) + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, int64(len(fields))); err != nil { + return err + } + + for _, f := range fields { + if err := encodeContainerField(w, enc, f); err != nil { + return err + } + } + + return nil +} + +func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *messageMeta) error { + n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) + if err != nil { + return err + } + + if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { + return fmt.Errorf("s1ap: extension container declares %d fields in %d bits", n, maxBits) + } + + var rejected *notComprehendedIE + + lastIdx := -1 + + for i := int64(0); i < n; i++ { + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) + if err != nil { + return err + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) + if err != nil { + return err + } + + val, err := per.DecodeOpenTypeBytes(r, enc) + if err != nil { + return err + } + + if len(val) == 0 { + return fmt.Errorf("s1ap: extension %d has an empty open type", id) + } + + f := rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val} + + if idx, spec, ok := lookupIESpec(table, f.id); ok { + if idx <= lastIdx { + return fmt.Errorf("s1ap: extension %s out of order or repeated", f.id) + } + + lastIdx = idx + + err := spec.decode(m, f.value, enc) + if err == nil { + meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) + + continue + } + + if !errors.Is(err, errNotComprehended) { + return err + } + + var inner *notComprehendedIE + if errors.As(err, &inner) && inner.Crit == CriticalityReject && rejected == nil { + rejected = inner + } + } + + if f.crit == CriticalityReject { + if rejected == nil { + rejected = ¬ComprehendedIE{ID: f.id, Crit: CriticalityReject, What: "iE-Extensions"} + } + + continue + } + + meta.preserveUpTo(f, maxProtocolExtensions) + } + + if rejected != nil { + return rejected + } + + if wireMatchesTable(table, meta.wire) { + meta.wire = nil + } + + return nil +} + +func optionalExtension[M any, T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](id ProtocolIEID, crit Criticality, field func(m *M) **T, +) ieSpec[M] { + return ieSpec[M]{ + id: id, presence: presenceOptional, crit: crit, + decode: func(m *M, raw []byte, _ per.Encoding) error { + v := PT(new(T)) + + if err := perIEDecode(raw, v); err != nil { + return err + } + + *field(m) = (*T)(v) + + return nil + }, + encode: func(m *M) (per.Marshaler, bool) { + v := *field(m) + if v == nil { + return nil, false + } + + return PT(v), true + }, + } +} diff --git a/s1ap/ie_handover.go b/s1ap/ie_handover.go index 6b8ef7b10d..fccc0fa813 100644 --- a/s1ap/ie_handover.go +++ b/s1ap/ie_handover.go @@ -373,12 +373,13 @@ type HandoverRestrictionList struct { // gTP-TEID, e-RABlevelQosParameters, iE-Extensions OPTIONAL } (extensible) // (TS 36.413). type ERABToBeSetupItemHOReq struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID QoS ERABLevelQoSParameters Extensions *ERABToBeSetupItemHOReqExtIEs `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } // DataForwardingNotPossible ::= ENUMERATED { data-forwarding-not-possible, @@ -392,10 +393,47 @@ const ( ) // ERABToBeSetupItemHOReqExtIEs is the ProtocolExtensionContainer of -// ERABToBeSetupItemHOReq. Of the extensions TS 36.413 defines for it, only -// id-Data-Forwarding-Not-Possible (143, criticality ignore) is modeled. +// ERABToBeSetupItemHOReq. type ERABToBeSetupItemHOReqExtIEs struct { DataForwardingNotPossible *DataForwardingNotPossible + BearerType *BearerType + EthernetType *EthernetType + SecurityIndication *SecurityIndication + + meta messageMeta +} + +var eRABToBeSetupItemHOReqExtIEs = []ieSpec[ERABToBeSetupItemHOReqExtIEs]{ + { + id: IDDataForwardingNotPossible, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *ERABToBeSetupItemHOReqExtIEs, raw []byte, enc per.Encoding) error { + var v DataForwardingNotPossible + + if err := perIEDecode(raw, &v); err != nil { + return err + } + + m.DataForwardingNotPossible = &v + + return nil + }, + encode: func(m *ERABToBeSetupItemHOReqExtIEs) (per.Marshaler, bool) { + if m.DataForwardingNotPossible == nil { + return nil, false + } + + return m.DataForwardingNotPossible, true + }, + }, + optionalExtension(IDBearerType, CriticalityReject, func(m *ERABToBeSetupItemHOReqExtIEs) **BearerType { + return &m.BearerType + }), + optionalExtension(IDEthernetType, CriticalityIgnore, func(m *ERABToBeSetupItemHOReqExtIEs) **EthernetType { + return &m.EthernetType + }), + optionalExtension(IDSecurityIndication, CriticalityReject, func(m *ERABToBeSetupItemHOReqExtIEs) **SecurityIndication { + return &m.SecurityIndication + }), } // ERABAdmittedItem ::= SEQUENCE { e-RAB-ID, transportLayerAddress, gTP-TEID, @@ -403,15 +441,16 @@ type ERABToBeSetupItemHOReqExtIEs struct { // OPTIONAL, uL-GTP-TEID OPTIONAL, iE-Extensions OPTIONAL } (extensible) // (TS 36.413). type ERABAdmittedItem struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - DLTransportLayerAddr TransportLayerAddress `per:",optional"` - DLGTPTEID *GTPTEID `per:",optional"` - ULTransportLayerAddr TransportLayerAddress `per:",optional"` - ULGTPTEID *GTPTEID `per:",optional"` - _ ieExtensions `per:",skip"` + DLTransportLayerAddr TransportLayerAddress `per:",optional"` + DLGTPTEID *GTPTEID `per:",optional"` + ULTransportLayerAddr TransportLayerAddress `per:",optional"` + ULGTPTEID *GTPTEID `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } // E-RABDataForwardingItem ::= SEQUENCE { e-RAB-ID, dL-transportLayerAddress @@ -420,11 +459,12 @@ type ERABAdmittedItem struct { // counterpart is not an IE of the message body: NGAP carries the same tunnels // inside the per-session HandoverCommandTransfer. type ERABDataForwardingItem struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID - DLTransportLayerAddr TransportLayerAddress `per:",optional"` - DLGTPTEID *GTPTEID `per:",optional"` - ULTransportLayerAddr TransportLayerAddress `per:",optional"` - ULGTPTEID *GTPTEID `per:",optional"` - _ ieExtensions `per:",skip"` + DLTransportLayerAddr TransportLayerAddress `per:",optional"` + DLGTPTEID *GTPTEID `per:",optional"` + ULTransportLayerAddr TransportLayerAddress `per:",optional"` + ULGTPTEID *GTPTEID `per:",optional"` + iEExtensions *rawIEExtensions `per:",optional"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } diff --git a/s1ap/ie_ids.go b/s1ap/ie_ids.go index 6d250bcc8c..6bcc1ab913 100644 --- a/s1ap/ie_ids.go +++ b/s1ap/ie_ids.go @@ -70,6 +70,7 @@ const ( IDUEAssociatedLogicalS1ConnectionItem ProtocolIEID = 91 IDResetType ProtocolIEID = 92 IDUEAssociatedLogicalS1ConnectionListResAck ProtocolIEID = 93 + IDERABToBeSwitchedULItem ProtocolIEID = 94 IDERABToBeSwitchedULList ProtocolIEID = 95 IDSTMSI ProtocolIEID = 96 IDRequestType ProtocolIEID = 98 @@ -106,11 +107,14 @@ const ( IDRoutingID ProtocolIEID = 148 IDPagingPriority ProtocolIEID = 151 IDGUMMEIList ProtocolIEID = 154 + IDCorrelationID ProtocolIEID = 156 IDSourceMMEGUMMEI ProtocolIEID = 157 IDMMEUES1APID2 ProtocolIEID = 158 IDTrafficLoadReductionIndication ProtocolIEID = 161 IDGWContextReleaseIndication ProtocolIEID = 164 IDECGIListForRestart ProtocolIEID = 182 + IDSIPTOCorrelationID ProtocolIEID = 183 + IDTransportInformation ProtocolIEID = 185 IDTAIListForRestart ProtocolIEID = 188 IDUserLocationInformation ProtocolIEID = 189 IDEmergencyAreaIDListForRestart ProtocolIEID = 190 @@ -130,5 +134,14 @@ const ( IDS1Message ProtocolIEID = 225 IDUERetentionInformation ProtocolIEID = 228 IDUEUsageType ProtocolIEID = 230 + IDBearerType ProtocolIEID = 233 + IDExtendedERABMaximumBitrateDL ProtocolIEID = 255 + IDExtendedERABMaximumBitrateUL ProtocolIEID = 256 + IDExtendedERABGuaranteedBitrateDL ProtocolIEID = 257 + IDExtendedERABGuaranteedBitrateUL ProtocolIEID = 258 + IDDownlinkPacketLossRate ProtocolIEID = 273 + IDUplinkPacketLossRate ProtocolIEID = 274 IDWarningAreaCoordinates ProtocolIEID = 286 + IDEthernetType ProtocolIEID = 305 + IDSecurityIndication ProtocolIEID = 332 ) diff --git a/s1ap/ie_names.go b/s1ap/ie_names.go index 59bd9cb434..5ef985b6f9 100644 --- a/s1ap/ie_names.go +++ b/s1ap/ie_names.go @@ -78,6 +78,7 @@ var protocolIENames = map[ProtocolIEID]string{ IDUEAssociatedLogicalS1ConnectionItem: "UE-associatedLogicalS1-ConnectionItem", IDResetType: "ResetType", IDUEAssociatedLogicalS1ConnectionListResAck: "UE-associatedLogicalS1-ConnectionListResAck", + IDERABToBeSwitchedULItem: "E-RABToBeSwitchedULItem", IDERABToBeSwitchedULList: "E-RABToBeSwitchedULList", IDSTMSI: "S-TMSI", IDRequestType: "RequestType", @@ -98,6 +99,8 @@ var protocolIENames = map[ProtocolIEID]string{ IDLPPaPDU: "LPPa-PDU", IDRoutingID: "Routing-ID", IDPagingPriority: "PagingPriority", + IDCorrelationID: "Correlation-ID", + IDSIPTOCorrelationID: "SIPTO-Correlation-ID", IDUserLocationInformation: "UserLocationInformation", IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", IDERABToBeModifiedListBearerModInd: "E-RABToBeModifiedListBearerModInd", @@ -129,6 +132,7 @@ var protocolIENames = map[ProtocolIEID]string{ IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", IDGWContextReleaseIndication: "GWContextReleaseIndication", IDECGIListForRestart: "ECGIListForRestart", + IDTransportInformation: "TransportInformation", IDTAIListForRestart: "TAIListForRestart", IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", IDKillAllWarningMessages: "KillAllWarningMessages", @@ -137,7 +141,16 @@ var protocolIENames = map[ProtocolIEID]string{ IDAdditionalGUTI: "Additional-GUTI", IDS1Message: "S1-Message", IDUEUsageType: "UE-Usage-Type", + IDBearerType: "BearerType", + IDExtendedERABMaximumBitrateDL: "extended-e-RAB-MaximumBitrateDL", + IDExtendedERABMaximumBitrateUL: "extended-e-RAB-MaximumBitrateUL", + IDExtendedERABGuaranteedBitrateDL: "extended-e-RAB-GuaranteedBitrateDL", + IDExtendedERABGuaranteedBitrateUL: "extended-e-RAB-GuaranteedBitrateUL", + IDDownlinkPacketLossRate: "DownlinkPacketLossRate", + IDUplinkPacketLossRate: "UplinkPacketLossRate", IDWarningAreaCoordinates: "WarningAreaCoordinates", + IDEthernetType: "Ethernet-Type", + IDSecurityIndication: "SecurityIndication", } // ProtocolIEIDName returns the TS 36.413 name of id, and whether it is known. diff --git a/s1ap/ie_table.go b/s1ap/ie_table.go index e53761e811..621e1e6365 100644 --- a/s1ap/ie_table.go +++ b/s1ap/ie_table.go @@ -66,7 +66,11 @@ func encodeMessageBody[M any, PM interface { message }](w *per.Writer, enc per.Encoding, procedure ProcedureCode, table []ieSpec[M], m PM, ) error { - w.WriteBit(false) + if m.meta().dropped { + return fmt.Errorf("s1ap: %s: unknown IEs were dropped on decode", procedure) + } + + w.WriteBit(m.meta().extensions.Present()) typed := make([]*ieField, len(table)) @@ -90,7 +94,11 @@ func encodeMessageBody[M any, PM interface { typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} } - return encodeIEContainer(w, enc, orderFields(table, typed, m.meta())) + if err := encodeIEContainer(w, enc, orderFields(table, typed, m.meta())); err != nil { + return err + } + + return m.meta().extensions.MarshalPER(w, enc) } func orderFields[M any](table []ieSpec[M], typed []*ieField, meta *messageMeta) []ieField { @@ -160,6 +168,14 @@ func parseMessageBody[M any, PM interface { *M message }](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, +) (PM, error) { + return parseBoundedMessageBody[M, PM](procedure, trigger, table, value, maxPreservedIEs) +} + +func parseBoundedMessageBody[M any, PM interface { + *M + message +}](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, limit int, ) (PM, error) { r := per.NewReader(value) enc := per.Aligned @@ -174,8 +190,10 @@ func parseMessageBody[M any, PM interface { return nil, &TransferSyntaxError{Procedure: procedure, Err: err} } + var additions per.ExtensionAdditions + if extPresent { - if err := skipSequenceExtensionsPER(r, enc, false, true); err != nil { + if err := additions.UnmarshalPER(r, enc); err != nil { return nil, &TransferSyntaxError{Procedure: procedure, Err: err} } } @@ -192,6 +210,7 @@ func parseMessageBody[M any, PM interface { m := PM(new(M)) meta := m.meta() + meta.extensions = additions seen := make(map[ProtocolIEID]bool, len(table)) lastIdx := -1 @@ -224,7 +243,7 @@ func parseMessageBody[M any, PM interface { } meta.diagnostics.record(f.id, f.crit, TypeOfErrorNotUnderstood) - meta.preserve(f) + meta.preserveUpTo(f, limit) continue } diff --git a/s1ap/ies.go b/s1ap/ies.go index a0383dae9a..c798b5996e 100644 --- a/s1ap/ies.go +++ b/s1ap/ies.go @@ -47,6 +47,8 @@ type messageMeta struct { unknownIEs []rawIE wire []wireSlot diagnostics Diagnostics + extensions per.ExtensionAdditions + dropped bool } type wireSlot struct { @@ -57,8 +59,13 @@ type wireSlot struct { // Bounded: a peer chooses both the count and the size of what we would retain. func (u *messageMeta) preserve(f rawIE) { - if len(u.unknownIEs) >= maxPreservedIEs { + u.preserveUpTo(f, maxPreservedIEs) +} + +func (u *messageMeta) preserveUpTo(f rawIE, limit int) { + if len(u.unknownIEs) >= limit { u.diagnostics.Truncated = true + u.dropped = true return } @@ -134,6 +141,16 @@ const maxnoofERABs = 256 // coincidental. // //nolint:unparam +type containerCrit struct { + crit *Criticality +} + +func (c *containerCrit) wireCriticality() *containerCrit { return c } + +type containerCritical interface { + wireCriticality() *containerCrit +} + func encodeSingleContainerList[T any](w *per.Writer, enc per.Encoding, ub int64, id ProtocolIEID, crit Criticality, items []T) error { if len(items) < 1 || int64(len(items)) > ub { return fmt.Errorf("s1ap: single-container list length %d outside [1, %d]", len(items), ub) @@ -149,7 +166,12 @@ func encodeSingleContainerList[T any](w *per.Writer, enc per.Encoding, ub int64, return fmt.Errorf("s1ap: %T does not implement per.Marshaler", items[i]) } - if err := encodeContainerField(w, enc, ieField{id: id, crit: crit, val: m}); err != nil { + c := crit + if h, ok := any(&items[i]).(containerCritical); ok && h.wireCriticality().crit != nil { + c = *h.wireCriticality().crit + } + + if err := encodeContainerField(w, enc, ieField{id: id, crit: c, val: m}); err != nil { return err } } @@ -163,7 +185,7 @@ func encodeSingleContainerList[T any](w *per.Writer, enc per.Encoding, ub int64, // Each item is its own open type, so each gets a fresh reader. // //nolint:unparam -func decodeItemList[T any](r *per.Reader, enc per.Encoding, ub int64, itemID ProtocolIEID) ([]T, error) { +func decodeItemList[T any](r *per.Reader, enc per.Encoding, ub int64, itemID ProtocolIEID, crit Criticality) ([]T, error) { var items []T err := per.DecodeLength(r, enc, 1, ub, true, func(count int64) error { @@ -177,7 +199,8 @@ func decodeItemList[T any](r *per.Reader, enc per.Encoding, ub int64, itemID Pro return fmt.Errorf("s1ap: list item %d has IE id %d, want %d", i, id, itemID) } - if _, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false); err != nil { + c, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) + if err != nil { return err } @@ -197,6 +220,11 @@ func decodeItemList[T any](r *per.Reader, enc per.Encoding, ub int64, itemID Pro return err } + if h, ok := any(&item).(containerCritical); ok && Criticality(c) != crit { + wire := Criticality(c) + h.wireCriticality().crit = &wire + } + items = append(items, item) } @@ -242,6 +270,10 @@ func decodeIEContainer(r *per.Reader, enc per.Encoding) ([]rawIE, error) { return nil, fmt.Errorf("s1ap: IE %d value: %w", i, err) } + if len(val) == 0 { + return nil, fmt.Errorf("s1ap: IE %d has an empty open type", i) + } + fields = append(fields, rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val}) } diff --git a/s1ap/initial_context_setup.go b/s1ap/initial_context_setup.go index a9a8cfb9c3..a8394ab8db 100644 --- a/s1ap/initial_context_setup.go +++ b/s1ap/initial_context_setup.go @@ -12,7 +12,7 @@ type InitialContextSetupRequest struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID UEAggregateMaximumBitRate UEAggregateMaximumBitRate - ERABToBeSetup []ERABToBeSetupItemCtxtSUReq + ERABToBeSetup ERABToBeSetupListCtxtSUReq UESecurityCapabilities UESecurityCapabilities SecurityKey SecurityKey UERadioCapability UERadioCapability @@ -49,7 +49,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { var err error - m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemCtxtSUReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemCtxtSUReq) + m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemCtxtSUReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject) return err }, @@ -158,7 +158,7 @@ func ParseInitialContextSetupRequest(value []byte) (*InitialContextSetupRequest, type InitialContextSetupResponse struct { MMEUES1APID *MMEUES1APID ENBUES1APID *ENBUES1APID - ERABSetup []ERABSetupItemCtxtSURes + ERABSetup ERABSetupListCtxtSURes ERABFailedToSetup []ERABItem CriticalityDiagnostics *CriticalityDiagnostics @@ -213,7 +213,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABSetup, err = decodeItemList[ERABSetupItemCtxtSURes](per.NewReader(raw), enc, maxnoofERABs, IDERABSetupItemCtxtSURes) + m.ERABSetup, err = decodeItemList[ERABSetupItemCtxtSURes](per.NewReader(raw), enc, maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore) return err }, @@ -232,7 +232,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { var err error - m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, diff --git a/s1ap/initial_context_setup_test.go b/s1ap/initial_context_setup_test.go index f7d0f7334c..99e557c14c 100644 --- a/s1ap/initial_context_setup_test.go +++ b/s1ap/initial_context_setup_test.go @@ -6,6 +6,7 @@ package s1ap import ( "bytes" "errors" + "reflect" "testing" ) @@ -126,7 +127,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { gi, go_ := in.ERABToBeSetup[0], out.ERABToBeSetup[0] if gi.ERABID != go_.ERABID || gi.GTPTEID != go_.GTPTEID || gi.QoS.QCI != go_.QoS.QCI || - gi.QoS.ARP != go_.QoS.ARP || !bytes.Equal(gi.TransportLayerAddress, go_.TransportLayerAddress) || + !reflect.DeepEqual(gi.QoS.ARP, go_.QoS.ARP) || !bytes.Equal(gi.TransportLayerAddress, go_.TransportLayerAddress) || !bytes.Equal(gi.NASPDU, go_.NASPDU) { t.Fatalf("E-RAB item mismatch:\n in %+v\n out %+v", gi, go_) } diff --git a/s1ap/paging.go b/s1ap/paging.go index 13acaaf6c1..c0135f404f 100644 --- a/s1ap/paging.go +++ b/s1ap/paging.go @@ -187,7 +187,7 @@ var pagingIEs = []ieSpec[Paging]{ { id: IDTAIList, presence: presenceMandatory, crit: CriticalityIgnore, decode: func(m *Paging, raw []byte, enc per.Encoding) error { - items, err := decodeItemList[taiItem](per.NewReader(raw), enc, maxnoofTAIs, IDTAIItem) + items, err := decodeItemList[taiItem](per.NewReader(raw), enc, maxnoofTAIs, IDTAIItem, CriticalityIgnore) if err != nil { return err } diff --git a/s1ap/path_switch.go b/s1ap/path_switch.go index a1a4a00984..a85b3ae92f 100644 --- a/s1ap/path_switch.go +++ b/s1ap/path_switch.go @@ -11,17 +11,25 @@ import ( // gTP-TEID, iE-Extensions OPTIONAL } (extensible). The target eNB's S1-U // downlink endpoint the GTP tunnel is switched to. type ERABToBeSwitchedDLItem struct { - _ [0]struct{} `per:"extseq"` ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - _ ieExtensions `per:",skip"` + SecurityIndication *SecurityIndication `per:"-"` + iEExtensions messageMeta `per:",exttable:eRABToBeSwitchedDLItemExtIEs"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +var eRABToBeSwitchedDLItemExtIEs = []ieSpec[ERABToBeSwitchedDLItem]{ + optionalExtension(IDSecurityIndication, CriticalityIgnore, func(m *ERABToBeSwitchedDLItem) **SecurityIndication { + return &m.SecurityIndication + }), } // TS 36.413 §9.1.5.8. type PathSwitchRequest struct { ENBUES1APID ENBUES1APID - ERABToBeSwitchedDL []ERABToBeSwitchedDLItem + ERABToBeSwitchedDL ERABToBeSwitchedDLList SourceMMEUES1APID MMEUES1APID EUTRANCGI *EUTRANCGI TAI *TAI @@ -44,7 +52,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { var err error - m.ERABToBeSwitchedDL, err = decodeItemList[ERABToBeSwitchedDLItem](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSwitchedDLItem) + m.ERABToBeSwitchedDL, err = decodeItemList[ERABToBeSwitchedDLItem](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject) return err }, @@ -176,6 +184,7 @@ type PathSwitchRequestAcknowledge struct { MMEUES1APID *MMEUES1APID ENBUES1APID *ENBUES1APID UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + ERABToBeSwitchedUL ERABToBeSwitchedULList SecurityContext SecurityContext MMEUES1APID2 *MMEUES1APID UESecurityCapabilities *UESecurityCapabilities @@ -254,12 +263,25 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.UEAggregateMaximumBitRate, true }, }, + { + id: IDERABToBeSwitchedULList, presence: presenceOptional, crit: CriticalityIgnore, + decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + return perIEDecode(raw, &m.ERABToBeSwitchedUL) + }, + encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + if len(m.ERABToBeSwitchedUL) == 0 { + return nil, false + } + + return m.ERABToBeSwitchedUL, true + }, + }, { id: IDERABToBeReleasedList, presence: presenceOptional, crit: CriticalityIgnore, decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { var err error - m.ERABToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem) + m.ERABToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, diff --git a/s1ap/per_gen.go b/s1ap/per_gen.go index 14c7720bf6..90ee7fca8d 100644 --- a/s1ap/per_gen.go +++ b/s1ap/per_gen.go @@ -67,8 +67,8 @@ func (additionalGUTI *AdditionalGUTI) UnmarshalPER(r *per.Reader, enc per.Encodi } func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(allocationAndRetentionPriority.extensions.Present()) + w.WriteBit(allocationAndRetentionPriority.iEExtensions != nil) if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true}, int64(allocationAndRetentionPriority.PriorityLevel)); err != nil { return err } @@ -78,6 +78,16 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER if err := per.EncodeEnumerated(w, enc, 2, false, int64(allocationAndRetentionPriority.PreemptionVulnerability)); err != nil { return err } + if allocationAndRetentionPriority.iEExtensions != nil { + if err := (*allocationAndRetentionPriority.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if allocationAndRetentionPriority.extensions.Present() { + if err := allocationAndRetentionPriority.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -86,7 +96,7 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -105,35 +115,17 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return err } allocationAndRetentionPriority.PreemptionVulnerability = PreemptionVulnerability(e2) - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + allocationAndRetentionPriority.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := allocationAndRetentionPriority.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -605,12 +597,12 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r } func (eRABAdmittedItem *ERABAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(eRABAdmittedItem.extensions.Present()) w.WriteBit(eRABAdmittedItem.DLTransportLayerAddr != nil) w.WriteBit(eRABAdmittedItem.DLGTPTEID != nil) w.WriteBit(eRABAdmittedItem.ULTransportLayerAddr != nil) w.WriteBit(eRABAdmittedItem.ULGTPTEID != nil) - w.WriteBit(false) + w.WriteBit(eRABAdmittedItem.iEExtensions != nil) if err := eRABAdmittedItem.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -640,6 +632,16 @@ func (eRABAdmittedItem *ERABAdmittedItem) MarshalPER(w *per.Writer, enc per.Enco return err } } + if eRABAdmittedItem.iEExtensions != nil { + if err := (*eRABAdmittedItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABAdmittedItem.extensions.Present() { + if err := eRABAdmittedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -664,7 +666,7 @@ func (eRABAdmittedItem *ERABAdmittedItem) UnmarshalPER(r *per.Reader, enc per.En if err != nil { return err } - p_f7, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -701,46 +703,28 @@ func (eRABAdmittedItem *ERABAdmittedItem) UnmarshalPER(r *per.Reader, enc per.En } eRABAdmittedItem.ULGTPTEID = &v } - if p_f7 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + eRABAdmittedItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (eRABDataForwardingItem *ERABDataForwardingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(eRABDataForwardingItem.extensions.Present()) w.WriteBit(eRABDataForwardingItem.DLTransportLayerAddr != nil) w.WriteBit(eRABDataForwardingItem.DLGTPTEID != nil) w.WriteBit(eRABDataForwardingItem.ULTransportLayerAddr != nil) w.WriteBit(eRABDataForwardingItem.ULGTPTEID != nil) - w.WriteBit(false) + w.WriteBit(eRABDataForwardingItem.iEExtensions != nil) if err := eRABDataForwardingItem.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -764,6 +748,16 @@ func (eRABDataForwardingItem *ERABDataForwardingItem) MarshalPER(w *per.Writer, return err } } + if eRABDataForwardingItem.iEExtensions != nil { + if err := (*eRABDataForwardingItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABDataForwardingItem.extensions.Present() { + if err := eRABDataForwardingItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -788,7 +782,7 @@ func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader if err != nil { return err } - p_f5, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -819,35 +813,17 @@ func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader } eRABDataForwardingItem.ULGTPTEID = &v } - if p_f5 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + eRABDataForwardingItem.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABDataForwardingItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -976,9 +952,10 @@ func (eRABItem *ERABItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } func (eRABLevelQoSParameters *ERABLevelQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(eRABLevelQoSParametersExtIEs, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions) + w.WriteBit(eRABLevelQoSParameters.extensions.Present()) w.WriteBit(eRABLevelQoSParameters.GBR != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := eRABLevelQoSParameters.QCI.MarshalPER(w, enc); err != nil { return err } @@ -990,6 +967,16 @@ func (eRABLevelQoSParameters *ERABLevelQoSParameters) MarshalPER(w *per.Writer, return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if eRABLevelQoSParameters.extensions.Present() { + if err := eRABLevelQoSParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1002,7 +989,7 @@ func (eRABLevelQoSParameters *ERABLevelQoSParameters) UnmarshalPER(r *per.Reader if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1019,35 +1006,15 @@ func (eRABLevelQoSParameters *ERABLevelQoSParameters) UnmarshalPER(r *per.Reader } eRABLevelQoSParameters.GBR = &v } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, eRABLevelQoSParametersExtIEs, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABLevelQoSParameters.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -1161,8 +1128,8 @@ func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) UnmarshalPER(r } func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(eRABSetupItemCtxtSURes.extensions.Present()) + w.WriteBit(eRABSetupItemCtxtSURes.iEExtensions != nil) if err := eRABSetupItemCtxtSURes.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -1172,6 +1139,16 @@ func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) MarshalPER(w *per.Writer, if err := eRABSetupItemCtxtSURes.GTPTEID.MarshalPER(w, enc); err != nil { return err } + if eRABSetupItemCtxtSURes.iEExtensions != nil { + if err := (*eRABSetupItemCtxtSURes.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABSetupItemCtxtSURes.extensions.Present() { + if err := eRABSetupItemCtxtSURes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1180,7 +1157,7 @@ func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) UnmarshalPER(r *per.Reader if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1193,42 +1170,24 @@ func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) UnmarshalPER(r *per.Reader if err := (&eRABSetupItemCtxtSURes.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + eRABSetupItemCtxtSURes.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABSetupItemCtxtSURes.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + w.WriteBit(eRABToBeModifiedItemBearerModInd.extensions.Present()) + w.WriteBit(eRABToBeModifiedItemBearerModInd.iEExtensions != nil) if err := eRABToBeModifiedItemBearerModInd.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -1238,6 +1197,16 @@ func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) Marsha if err := eRABToBeModifiedItemBearerModInd.DLGTPTEID.MarshalPER(w, enc); err != nil { return err } + if eRABToBeModifiedItemBearerModInd.iEExtensions != nil { + if err := (*eRABToBeModifiedItemBearerModInd.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABToBeModifiedItemBearerModInd.extensions.Present() { + if err := eRABToBeModifiedItemBearerModInd.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1246,7 +1215,7 @@ func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) Unmars if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1259,42 +1228,25 @@ func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) Unmars if err := (&eRABToBeModifiedItemBearerModInd.DLGTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { - var v ieExtensions + if p_iEExtensions { + var v rawIEExtensions if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + eRABToBeModifiedItemBearerModInd.iEExtensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeModifiedItemBearerModInd.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + ext := extensionFields(eRABToBeModifyItemBearerModReqExtIEs, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions) + w.WriteBit(eRABToBeModifiedItemBearerModReq.extensions.Present()) + w.WriteBit(len(ext) > 0) if err := eRABToBeModifiedItemBearerModReq.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -1304,6 +1256,16 @@ func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) Marsha if err := eRABToBeModifiedItemBearerModReq.NASPDU.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if eRABToBeModifiedItemBearerModReq.extensions.Present() { + if err := eRABToBeModifiedItemBearerModReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1312,7 +1274,7 @@ func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) Unmars if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1325,42 +1287,23 @@ func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) Unmars if err := (&eRABToBeModifiedItemBearerModReq.NASPDU).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, eRABToBeModifyItemBearerModReqExtIEs, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeModifiedItemBearerModReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + ext := extensionFields(eRABToBeSetupItemBearerSUReqExtIEs, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemBearerSUReq.extensions.Present()) + w.WriteBit(len(ext) > 0) if err := eRABToBeSetupItemBearerSUReq.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -1376,6 +1319,16 @@ func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) MarshalPER(w * if err := eRABToBeSetupItemBearerSUReq.NASPDU.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if eRABToBeSetupItemBearerSUReq.extensions.Present() { + if err := eRABToBeSetupItemBearerSUReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1384,7 +1337,7 @@ func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) UnmarshalPER(r if err != nil { return err } - p_f5, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1403,43 +1356,24 @@ func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) UnmarshalPER(r if err := (&eRABToBeSetupItemBearerSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { return err } - if p_f5 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, eRABToBeSetupItemBearerSUReqExtIEs, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeSetupItemBearerSUReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + ext := extensionFields(eRABToBeSetupItemCtxtSUReqExtIEs, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemCtxtSUReq.extensions.Present()) w.WriteBit(eRABToBeSetupItemCtxtSUReq.NASPDU != nil) - w.WriteBit(false) + w.WriteBit(len(ext) > 0) if err := eRABToBeSetupItemCtxtSUReq.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -1457,6 +1391,16 @@ func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) MarshalPER(w *per. return err } } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if eRABToBeSetupItemCtxtSUReq.extensions.Present() { + if err := eRABToBeSetupItemCtxtSUReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1469,7 +1413,7 @@ func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *pe if err != nil { return err } - p_f5, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1490,41 +1434,21 @@ func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *pe return err } } - if p_f5 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, eRABToBeSetupItemCtxtSUReqExtIEs, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) + w.WriteBit(eRABToBeSetupItemHOReq.extensions.Present()) w.WriteBit(eRABToBeSetupItemHOReq.Extensions != nil) if err := eRABToBeSetupItemHOReq.ERABID.MarshalPER(w, enc); err != nil { return err @@ -1543,6 +1467,11 @@ func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, return err } } + if eRABToBeSetupItemHOReq.extensions.Present() { + if err := eRABToBeSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1575,34 +1504,17 @@ func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader eRABToBeSetupItemHOReq.Extensions = &v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + ext := extensionFields(eRABToBeSwitchedDLItemExtIEs, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions) + w.WriteBit(eRABToBeSwitchedDLItem.extensions.Present()) + w.WriteBit(len(ext) > 0) if err := eRABToBeSwitchedDLItem.ERABID.MarshalPER(w, enc); err != nil { return err } @@ -1612,6 +1524,16 @@ func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, if err := eRABToBeSwitchedDLItem.GTPTEID.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if eRABToBeSwitchedDLItem.extensions.Present() { + if err := eRABToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -1620,7 +1542,7 @@ func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -1633,34 +1555,72 @@ func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader if err := (&eRABToBeSwitchedDLItem.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, eRABToBeSwitchedDLItemExtIEs, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + return nil +} + +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(eRABToBeSwitchedULItem.extensions.Present()) + w.WriteBit(eRABToBeSwitchedULItem.iEExtensions != nil) + if err := eRABToBeSwitchedULItem.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSwitchedULItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSwitchedULItem.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if eRABToBeSwitchedULItem.iEExtensions != nil { + if err := (*eRABToBeSwitchedULItem.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABToBeSwitchedULItem.extensions.Present() { + if err := eRABToBeSwitchedULItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eRABToBeSwitchedULItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSwitchedULItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSwitchedULItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABToBeSwitchedULItem.iEExtensions = &v + } + if extBit { + if err := eRABToBeSwitchedULItem.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil @@ -2007,8 +1967,9 @@ func (forbiddenTAsItem *ForbiddenTAsItem) UnmarshalPER(r *per.Reader, enc per.En } func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + ext := extensionFields(gBRQosInformationExtIEs, gBRQosInformation, &gBRQosInformation.iEExtensions) + w.WriteBit(gBRQosInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) if err := gBRQosInformation.MaximumBitrateDL.MarshalPER(w, enc); err != nil { return err } @@ -2021,6 +1982,16 @@ func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.En if err := gBRQosInformation.GuaranteedBitrateUL.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := encodeExtensionContainer(w, enc, ext); err != nil { + return err + } + } + if gBRQosInformation.extensions.Present() { + if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } @@ -2029,7 +2000,7 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. if err != nil { return err } - p_f4, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -2045,35 +2016,15 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. if err := (&gBRQosInformation.GuaranteedBitrateUL).UnmarshalPER(r, enc); err != nil { return err } - if p_f4 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := decodeExtensionContainer(r, enc, gBRQosInformationExtIEs, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } @@ -2732,6 +2683,52 @@ func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Enco return nil } +func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(securityIndication.extensions.Present()) + w.WriteBit(securityIndication.iEExtensions != nil) + if err := securityIndication.IntegrityProtectionIndication.MarshalPER(w, enc); err != nil { + return err + } + if securityIndication.iEExtensions != nil { + if err := (*securityIndication.iEExtensions).MarshalPER(w, enc); err != nil { + return err + } + } + if securityIndication.extensions.Present() { + if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&securityIndication.IntegrityProtectionIndication).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + var v rawIEExtensions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + securityIndication.iEExtensions = &v + } + if extBit { + if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (servedGUMMEIsItem *ServedGUMMEIsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) @@ -3348,6 +3345,41 @@ func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } +func (transportInformation *TransportInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(transportInformation.extensions.Present()) + if err := transportInformation.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := transportInformation.ULGTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if transportInformation.extensions.Present() { + if err := transportInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (transportInformation *TransportInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + extBit, err := r.ReadBit() + if err != nil { + return err + } + if err := (&transportInformation.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&transportInformation.ULGTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if extBit { + if err := transportInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { w.WriteBit(false) w.WriteBit(false) diff --git a/s1ap/per_leaf.go b/s1ap/per_leaf.go index 9374d8f11d..da5299179f 100644 --- a/s1ap/per_leaf.go +++ b/s1ap/per_leaf.go @@ -520,85 +520,29 @@ func (f *ForbiddenInterRATs) UnmarshalPER(r *per.Reader, enc per.Encoding) error } func (e *ERABToBeSetupItemHOReqExtIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - if e.DataForwardingNotPossible == nil { - return fmt.Errorf("s1ap: E-RABToBeSetupItemHOReq iE-Extensions carries no modeled extension") + ext := extensionFields(eRABToBeSetupItemHOReqExtIEs, e, &e.meta) + if len(ext) == 0 { + return fmt.Errorf("s1ap: E-RABToBeSetupItemHOReq iE-Extensions carries no extension") } - if err := per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, 1); err != nil { - return err - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, maxProtocolIEs, int64(IDDataForwardingNotPossible)); err != nil { - return err - } - - if err := per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(CriticalityIgnore)); err != nil { - return err - } + return encodeExtensionContainer(w, enc, ext) +} - v := *e.DataForwardingNotPossible +func (e *ERABToBeSetupItemHOReqExtIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + return decodeExtensionContainer(r, enc, eRABToBeSetupItemHOReqExtIEs, e, &e.meta) +} - return per.EncodeOpenType(w, enc, per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, dataForwardingNotPossibleRootCount, int64(v), "DataForwardingNotPossible") - })) +func (d DataForwardingNotPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeRootEnumerated(w, enc, dataForwardingNotPossibleRootCount, int64(d), "DataForwardingNotPossible") } -func (e *ERABToBeSetupItemHOReqExtIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) +func (d *DataForwardingNotPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + idx, err := decodeRootEnumerated(r, enc, dataForwardingNotPossibleRootCount, "DataForwardingNotPossible") if err != nil { return err } - var rejected ProtocolIEID - - comprehended := true - - for range n { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return err - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return err - } - - if ProtocolIEID(id) == IDDataForwardingNotPossible { - var v DataForwardingNotPossible - - if err := per.DecodeOpenType(r, enc, per.UnmarshalerFunc(func(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, dataForwardingNotPossibleRootCount, "DataForwardingNotPossible") - if err != nil { - return err - } - - v = DataForwardingNotPossible(idx) - - return nil - })); err != nil { - return err - } - - e.DataForwardingNotPossible = &v - - continue - } - - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - - // §10.3.4.2, as for any unmodeled extension: reject stops the procedure, - // ignore and notify leave the enclosing IE deliverable. - if Criticality(crit) == CriticalityReject && comprehended { - comprehended, rejected = false, ProtocolIEID(id) - } - } - - if !comprehended { - return ¬ComprehendedIE{ID: rejected, Crit: CriticalityReject, What: "iE-Extensions"} - } + *d = DataForwardingNotPossible(idx) return nil } diff --git a/s1ap/pws_overload_test.go b/s1ap/pws_overload_test.go index 056dad227e..abd3c0b81e 100644 --- a/s1ap/pws_overload_test.go +++ b/s1ap/pws_overload_test.go @@ -52,6 +52,8 @@ type newMessageCase struct { parse func([]byte) (any, error) choice func(PDU) bool golden string + + extensionNotices int } func isInitiating(p PDU) bool { _, ok := p.(*InitiatingMessage); return ok } @@ -244,6 +246,7 @@ func newMessageCases() []newMessageCase { initialContextSetupRequestGoldenCases(), handoverRequestGoldenCases(), pathSwitchRequestAcknowledgeGoldenCases(), + tnlGoldenCases(), transparentContainerGoldenCases(), )...) } @@ -311,11 +314,13 @@ func TestNewMessagesWireCriticality(t *testing.T) { "KillResponse": {{IDMessageIdentifier, CriticalityReject}, {IDSerialNumber, CriticalityReject}, {IDBroadcastCancelledAreaList, CriticalityIgnore}}, "PWSRestartIndication": {{IDECGIListForRestart, CriticalityReject}, {IDGlobalENBID, CriticalityReject}, {IDTAIListForRestart, CriticalityReject}, {IDEmergencyAreaIDListForRestart, CriticalityReject}}, "PWSFailureIndication": {{IDPWSfailedECGIList, CriticalityReject}, {IDGlobalENBID, CriticalityReject}}, - "UEContextReleaseRequestGWContextReleaseIndication": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDCause, CriticalityIgnore}, {IDGWContextReleaseIndication, CriticalityReject}}, - "InitialContextSetupRequestGUMMEIMMEUES1APID2": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDUEAggregateMaximumBitrate, CriticalityReject}, {IDERABToBeSetupListCtxtSUReq, CriticalityReject}, {IDUESecurityCapabilities, CriticalityReject}, {IDSecurityKey, CriticalityReject}, {IDGUMMEI, CriticalityIgnore}, {IDMMEUES1APID2, CriticalityIgnore}}, - "HandoverRequestGUMMEIMMEUES1APID2": {{IDMMEUES1APID, CriticalityReject}, {IDHandoverType, CriticalityReject}, {IDCause, CriticalityIgnore}, {IDUEAggregateMaximumBitrate, CriticalityReject}, {IDERABToBeSetupListHOReq, CriticalityReject}, {IDSourceToTargetTransparentContainer, CriticalityReject}, {IDUESecurityCapabilities, CriticalityReject}, {IDSecurityContext, CriticalityReject}, {IDGUMMEI, CriticalityIgnore}, {IDMMEUES1APID2, CriticalityIgnore}}, - "PathSwitchRequestAcknowledgeMMEUES1APID2": {{IDMMEUES1APID, CriticalityIgnore}, {IDENBUES1APID, CriticalityIgnore}, {IDSecurityContext, CriticalityReject}, {IDMMEUES1APID2, CriticalityIgnore}}, - "RerouteNASRequest": {{IDENBUES1APID, CriticalityReject}, {IDMMEUES1APID, CriticalityIgnore}, {IDS1Message, CriticalityReject}, {IDMMEGroupID, CriticalityReject}, {IDAdditionalGUTI, CriticalityIgnore}, {IDUEUsageType, CriticalityIgnore}}, + "UEContextReleaseRequestGWContextReleaseIndication": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDCause, CriticalityIgnore}, {IDGWContextReleaseIndication, CriticalityReject}}, + "InitialContextSetupRequestGUMMEIMMEUES1APID2": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDUEAggregateMaximumBitrate, CriticalityReject}, {IDERABToBeSetupListCtxtSUReq, CriticalityReject}, {IDUESecurityCapabilities, CriticalityReject}, {IDSecurityKey, CriticalityReject}, {IDGUMMEI, CriticalityIgnore}, {IDMMEUES1APID2, CriticalityIgnore}}, + "HandoverRequestGUMMEIMMEUES1APID2": {{IDMMEUES1APID, CriticalityReject}, {IDHandoverType, CriticalityReject}, {IDCause, CriticalityIgnore}, {IDUEAggregateMaximumBitrate, CriticalityReject}, {IDERABToBeSetupListHOReq, CriticalityReject}, {IDSourceToTargetTransparentContainer, CriticalityReject}, {IDUESecurityCapabilities, CriticalityReject}, {IDSecurityContext, CriticalityReject}, {IDGUMMEI, CriticalityIgnore}, {IDMMEUES1APID2, CriticalityIgnore}}, + "PathSwitchRequestAcknowledgeMMEUES1APID2": {{IDMMEUES1APID, CriticalityIgnore}, {IDENBUES1APID, CriticalityIgnore}, {IDSecurityContext, CriticalityReject}, {IDMMEUES1APID2, CriticalityIgnore}}, + "PathSwitchRequestAcknowledgeERABToBeSwitchedULList": {{IDMMEUES1APID, CriticalityIgnore}, {IDENBUES1APID, CriticalityIgnore}, {IDERABToBeSwitchedULList, CriticalityIgnore}, {IDSecurityContext, CriticalityReject}}, + "ERABModifyRequestTransportInformation": {{IDMMEUES1APID, CriticalityReject}, {IDENBUES1APID, CriticalityReject}, {IDERABToBeModifiedListBearerModReq, CriticalityReject}}, + "RerouteNASRequest": {{IDENBUES1APID, CriticalityReject}, {IDMMEUES1APID, CriticalityIgnore}, {IDS1Message, CriticalityReject}, {IDMMEGroupID, CriticalityReject}, {IDAdditionalGUTI, CriticalityIgnore}, {IDUEUsageType, CriticalityIgnore}}, } for _, tc := range newMessageCases() { diff --git a/s1ap/reset.go b/s1ap/reset.go index 4e6019497c..e0579b9b94 100644 --- a/s1ap/reset.go +++ b/s1ap/reset.go @@ -83,7 +83,7 @@ func (t *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil default: - items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](r, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem) + items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](r, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityReject) if err != nil { return err } @@ -170,7 +170,7 @@ var resetAcknowledgeIEs = []ieSpec[ResetAcknowledge]{ { id: IDUEAssociatedLogicalS1ConnectionListResAck, presence: presenceOptional, crit: CriticalityIgnore, decode: func(m *ResetAcknowledge, raw []byte, enc per.Encoding) error { - items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](per.NewReader(raw), enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem) + items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](per.NewReader(raw), enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityIgnore) if err != nil { return err } diff --git a/s1ap/table_order_test.go b/s1ap/table_order_test.go index 283148a5ea..7f5d132ecd 100644 --- a/s1ap/table_order_test.go +++ b/s1ap/table_order_test.go @@ -55,7 +55,14 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU}}, {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEIdentityIndexValue, IDUEPagingID, IDPagingDRX, IDCNDomain, IDTAIList, IDPagingPriority, IDUERadioCapabilityForPaging}}, {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDENBUES1APID, IDERABToBeSwitchedDLList, IDSourceMMEUES1APID, IDEUTRANCGI, IDTAI, IDUESecurityCapabilities, IDSourceMMEGUMMEI}}, - {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeReleasedList, IDSecurityContext, IDMMEUES1APID2, IDUESecurityCapabilities}}, + {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSwitchedULList, IDERABToBeReleasedList, IDSecurityContext, IDMMEUES1APID2, IDUESecurityCapabilities}}, + {"E-RABToBeModifyItemBearerModReqExtIEs", tableIDs(eRABToBeModifyItemBearerModReqExtIEs), []ProtocolIEID{IDTransportInformation}}, + {"E-RABToBeSetupItemHOReq-ExtIEs", tableIDs(eRABToBeSetupItemHOReqExtIEs), []ProtocolIEID{IDDataForwardingNotPossible, IDBearerType, IDEthernetType, IDSecurityIndication}}, + {"E-RABToBeSetupItemCtxtSUReqExtIEs", tableIDs(eRABToBeSetupItemCtxtSUReqExtIEs), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, + {"E-RABToBeSetupItemBearerSUReqExtIEs", tableIDs(eRABToBeSetupItemBearerSUReqExtIEs), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, + {"E-RABToBeSwitchedDLItem-ExtIEs", tableIDs(eRABToBeSwitchedDLItemExtIEs), []ProtocolIEID{IDSecurityIndication}}, + {"E-RABQoSParameters-ExtIEs", tableIDs(eRABLevelQoSParametersExtIEs), []ProtocolIEID{IDDownlinkPacketLossRate, IDUplinkPacketLossRate}}, + {"GBR-QosInformation-ExtIEs", tableIDs(gBRQosInformationExtIEs), []ProtocolIEID{IDExtendedERABMaximumBitrateDL, IDExtendedERABMaximumBitrateUL, IDExtendedERABGuaranteedBitrateDL, IDExtendedERABGuaranteedBitrateUL}}, {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"Reset", tableIDs(resetIEs), []ProtocolIEID{IDCause, IDResetType}}, {"ResetAcknowledge", tableIDs(resetAcknowledgeIEs), []ProtocolIEID{IDUEAssociatedLogicalS1ConnectionListResAck, IDCriticalityDiagnostics}}, diff --git a/s1ap/testdata/fuzz/FuzzERABListRoundTrip/97e81ee8c2b8276d b/s1ap/testdata/fuzz/FuzzERABListRoundTrip/97e81ee8c2b8276d new file mode 100644 index 0000000000..ade1796c6e --- /dev/null +++ b/s1ap/testdata/fuzz/FuzzERABListRoundTrip/97e81ee8c2b8276d @@ -0,0 +1,3 @@ +go test fuzz v1 +byte('\x04') +[]byte("\x00\x00$0\x16B000\x010\x00\x0000A\x000000000000") diff --git a/s1ap/tnl_lossless_test.go b/s1ap/tnl_lossless_test.go new file mode 100644 index 0000000000..14071b5f26 --- /dev/null +++ b/s1ap/tnl_lossless_test.go @@ -0,0 +1,729 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "encoding/hex" + "reflect" + "testing" + + "github.com/ellanetworks/core/per" +) + +const idUnknownExtension ProtocolIEID = 999 + +func tnlExtensionContainer(fields ...ieField) []byte { + w := per.NewWriter() + + if err := encodeExtensionContainer(w, per.Aligned, fields); err != nil { + panic(err) + } + + w.AlignToByte() + + return w.Bytes() +} + +func tnlRawExtensions(fields ...rawIE) *rawIEExtensions { + var ext []ieField + for _, f := range fields { + ext = append(ext, f.field()) + } + + var e rawIEExtensions + if err := e.UnmarshalPER(per.NewReader(tnlExtensionContainer(ext...)), per.Aligned); err != nil { + panic(err) + } + + return &e +} + +func tnlExtensionAdditions(contents ...[]byte) per.ExtensionAdditions { + w := per.NewWriter() + + if err := per.EncodeNormallySmallLength(w, per.Aligned, int64(len(contents)), func(count int64) error { + for range count { + w.WriteBit(true) + } + + return nil + }); err != nil { + panic(err) + } + + for _, c := range contents { + if err := per.EncodeOpenTypeBytes(w, per.Aligned, c); err != nil { + panic(err) + } + } + + w.AlignToByte() + + var e per.ExtensionAdditions + if err := e.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned); err != nil { + panic(err) + } + + return e +} + +func tnlUnknownExtension() *rawIEExtensions { + return tnlRawExtensions(rawIE{id: idUnknownExtension, crit: CriticalityIgnore, value: []byte{0x5a}}) +} + +func tnlUnknownMeta() messageMeta { + var m messageMeta + m.preserve(rawIE{id: idUnknownExtension, crit: CriticalityIgnore, value: []byte{0x5a}}) + + return m +} + +func tnlQoS() ERABLevelQoSParameters { + return ERABLevelQoSParameters{ + QCI: 1, + ARP: AllocationAndRetentionPriority{ + PriorityLevel: 2, + iEExtensions: tnlUnknownExtension(), + extensions: tnlExtensionAdditions([]byte{0x01}), + }, + GBR: &GBRQosInformation{ + MaximumBitrateDL: 1000, + MaximumBitrateUL: 1000, + GuaranteedBitrateDL: 500, + GuaranteedBitrateUL: 500, + iEExtensions: tnlUnknownMeta(), + extensions: tnlExtensionAdditions([]byte{0x02}), + }, + iEExtensions: tnlUnknownMeta(), + extensions: tnlExtensionAdditions([]byte{0x03}), + } +} + +func ignoreCrit() containerCrit { + c := CriticalityIgnore + return containerCrit{crit: &c} +} + +func rejectCrit() containerCrit { + c := CriticalityReject + return containerCrit{crit: &c} +} + +type tnlValue interface { + per.Marshaler + per.Unmarshaler +} + +func losslessRoundTrip[T any, PT interface { + *T + tnlValue +}](t *testing.T, in PT, want string) { + t.Helper() + + w := per.NewWriter() + if err := in.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + b := w.Bytes() + + if want != "" && hex.EncodeToString(b) != want { + t.Errorf("bytes = %x, want %s", b, want) + } + + out := PT(new(T)) + if err := out.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + t.Fatal(err) + } + + w = per.NewWriter() + if err := out.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + if !bytes.Equal(w.Bytes(), b) { + t.Errorf("re-encoded %x, want %x", w.Bytes(), b) + } + + again := PT(new(T)) + if err := again.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned); err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(again, out) { + t.Errorf("re-decoded\n got %+v\nwant %+v", again, out) + } +} + +func TestTNLItemsKnownExtensionsTyped(t *testing.T) { + sec := &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionRequired} + + ctxt := &ERABToBeSetupItemCtxtSUReq{ + ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, + CorrelationID: &CorrelationID{1, 2, 3, 4}, SIPTOCorrelationID: &CorrelationID{5, 6, 7, 8}, + BearerType: Ptr(BearerTypeNonIP), EthernetType: Ptr(EthernetTypeTrue), SecurityIndication: sec, + } + ctxt.QoS.DownlinkPacketLossRate = Ptr(PacketLossRate(10)) + ctxt.QoS.UplinkPacketLossRate = Ptr(PacketLossRate(1000)) + ctxt.QoS.GBR = &GBRQosInformation{ + MaximumBitrateDL: 1, MaximumBitrateUL: 1, GuaranteedBitrateDL: 1, GuaranteedBitrateUL: 1, + ExtendedMaximumBitrateDL: Ptr(ExtendedBitRate(10000000001)), + ExtendedMaximumBitrateUL: Ptr(ExtendedBitRate(4000000000000)), + ExtendedGuaranteedBitrateDL: Ptr(ExtendedBitRate(20000000000)), + ExtendedGuaranteedBitrateUL: Ptr(ExtendedBitRate(30000000000)), + } + + bearer := &ERABToBeSetupItemBearerSUReq{ + ERABID: 6, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 2, NASPDU: NASPDU{0x27}, + CorrelationID: &CorrelationID{1, 2, 3, 4}, BearerType: Ptr(BearerTypeNonIP), SecurityIndication: sec, + } + + ho := &ERABToBeSetupItemHOReq{ + ERABID: 7, TransportLayerAddress: goldTLA(), GTPTEID: 3, QoS: goldQoS(), + Extensions: &ERABToBeSetupItemHOReqExtIEs{ + DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), + BearerType: Ptr(BearerTypeNonIP), + EthernetType: Ptr(EthernetTypeTrue), + SecurityIndication: sec, + }, + } + + switched := &ERABToBeSwitchedDLItem{ERABID: 8, TransportLayerAddress: goldTLA(), GTPTEID: 4, SecurityIndication: sec} + + for _, c := range []struct { + name string + in tnlValue + out tnlValue + }{ + {"E-RABToBeSetupItemCtxtSUReq", ctxt, new(ERABToBeSetupItemCtxtSUReq)}, + {"E-RABToBeSetupItemBearerSUReq", bearer, new(ERABToBeSetupItemBearerSUReq)}, + {"E-RABToBeSetupItemHOReq", ho, new(ERABToBeSetupItemHOReq)}, + {"E-RABToBeSwitchedDLItem", switched, new(ERABToBeSwitchedDLItem)}, + } { + t.Run(c.name, func(t *testing.T) { + w := per.NewWriter() + if err := c.in.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + if err := c.out.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned); err != nil { + t.Fatalf("a known extension was not comprehended: %v", err) + } + + if !reflect.DeepEqual(c.out, c.in) { + t.Fatalf("decoded\n got %+v\nwant %+v", c.out, c.in) + } + }) + } +} + +func TestTNLItemsLossless(t *testing.T) { + ext := func() *rawIEExtensions { return tnlUnknownExtension() } + add := func() per.ExtensionAdditions { return tnlExtensionAdditions([]byte{0xaa}, []byte{0xbb, 0xcc}) } + + t.Run("E-RABToBeSetupItemCtxtSUReq", func(t *testing.T) { + losslessRoundTrip(t, &ERABToBeSetupItemCtxtSUReq{ERABID: 5, QoS: tnlQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, NASPDU: NASPDU{0x27}, CorrelationID: &CorrelationID{1, 2, 3, 4}, BearerType: Ptr(BearerTypeNonIP), SecurityIndication: &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionRequired}, iEExtensions: tnlUnknownMeta(), extensions: add()}, "") + }) + t.Run("E-RABSetupItemCtxtSURes", func(t *testing.T) { + losslessRoundTrip(t, &ERABSetupItemCtxtSURes{ERABID: 5, TransportLayerAddress: goldTLA(), GTPTEID: 2, iEExtensions: ext(), extensions: add()}, "") + }) + t.Run("E-RABToBeSetupItemBearerSUReq", func(t *testing.T) { + losslessRoundTrip(t, &ERABToBeSetupItemBearerSUReq{ERABID: 6, QoS: tnlQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 3, NASPDU: NASPDU{0x27}, SIPTOCorrelationID: &CorrelationID{5, 6, 7, 8}, EthernetType: Ptr(EthernetTypeTrue), SecurityIndication: &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionPreferred}, iEExtensions: tnlUnknownMeta(), extensions: add()}, "") + }) + t.Run("E-RABToBeModifiedItemBearerModReq", func(t *testing.T) { + in := &ERABToBeModifiedItemBearerModReq{ERABID: 7, QoS: tnlQoS(), NASPDU: NASPDU{0x27}, extensions: add()} + + container := tnlExtensionContainer( + ieField{id: IDTransportInformation, crit: CriticalityReject, val: &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 4, extensions: add()}}, + ieField{id: idUnknownExtension, crit: CriticalityIgnore, raw: []byte{0x5a}}, + ) + + if err := decodeExtensionContainer(per.NewReader(container), per.Aligned, eRABToBeModifyItemBearerModReqExtIEs, in, &in.iEExtensions); err != nil { + t.Fatal(err) + } + + if in.TransportInformation == nil || in.TransportInformation.ULGTPTEID != 4 { + t.Fatalf("TransportInformation = %+v", in.TransportInformation) + } + + losslessRoundTrip(t, in, "") + }) + t.Run("E-RABToBeModifiedItemBearerModInd", func(t *testing.T) { + losslessRoundTrip(t, &ERABToBeModifiedItemBearerModInd{ERABID: 8, TransportLayerAddress: goldTLA(), DLGTPTEID: 5, iEExtensions: ext(), extensions: add()}, "") + }) + t.Run("E-RABToBeSetupItemHOReq", func(t *testing.T) { + in := &ERABToBeSetupItemHOReq{ERABID: 9, TransportLayerAddress: goldTLA(), GTPTEID: 6, QoS: tnlQoS(), extensions: add()} + + container := tnlExtensionContainer( + ieField{id: idUnknownExtension, crit: CriticalityIgnore, raw: []byte{0x5a}}, + ieField{id: IDDataForwardingNotPossible, crit: CriticalityIgnore, val: DataForwardingNotPossibleTrue}, + ) + + var e ERABToBeSetupItemHOReqExtIEs + if err := e.UnmarshalPER(per.NewReader(container), per.Aligned); err != nil { + t.Fatal(err) + } + + if e.DataForwardingNotPossible == nil { + t.Fatal("Data-Forwarding-Not-Possible lost") + } + + in.Extensions = &e + + losslessRoundTrip(t, in, "") + }) + t.Run("E-RABAdmittedItem", func(t *testing.T) { + losslessRoundTrip(t, &ERABAdmittedItem{ + ERABID: 10, TransportLayerAddress: goldTLA(), GTPTEID: 7, + DLTransportLayerAddr: goldTLA(), DLGTPTEID: Ptr(GTPTEID(8)), + ULTransportLayerAddr: goldTLA(), ULGTPTEID: Ptr(GTPTEID(9)), + iEExtensions: ext(), extensions: add(), + }, "") + }) + t.Run("E-RABDataForwardingItem", func(t *testing.T) { + losslessRoundTrip(t, &ERABDataForwardingItem{ + ERABID: 11, DLTransportLayerAddr: goldTLA(), DLGTPTEID: Ptr(GTPTEID(10)), + iEExtensions: ext(), extensions: add(), + }, "") + }) + t.Run("E-RABToBeSwitchedDLItem", func(t *testing.T) { + losslessRoundTrip(t, &ERABToBeSwitchedDLItem{ERABID: 12, TransportLayerAddress: goldTLA(), GTPTEID: 11, SecurityIndication: &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionNotNeeded}, iEExtensions: tnlUnknownMeta(), extensions: add()}, "") + }) + t.Run("E-RABToBeSwitchedULItem", func(t *testing.T) { + losslessRoundTrip(t, &ERABToBeSwitchedULItem{ERABID: 13, TransportLayerAddress: goldTLA(), GTPTEID: 12, iEExtensions: ext(), extensions: add()}, "") + }) + t.Run("TransportInformation", func(t *testing.T) { + losslessRoundTrip(t, &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 13, extensions: add()}, "") + }) +} + +func TestTNLItemUnknownRejectExtensionNotComprehended(t *testing.T) { + w := per.NewWriter() + if err := encodeExtensionContainer(w, per.Aligned, []ieField{{id: idUnknownExtension, crit: CriticalityReject, raw: []byte{0x00}}}); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + var meta messageMeta + + err := decodeExtensionContainer(per.NewReader(w.Bytes()), per.Aligned, eRABToBeModifyItemBearerModReqExtIEs, new(ERABToBeModifiedItemBearerModReq), &meta) + if err == nil { + t.Fatal("unknown reject extension accepted") + } +} + +func TestTNLListsLossless(t *testing.T) { + t.Run("E-RABToBeSetupListCtxtSUReq", func(t *testing.T) { + l := ERABToBeSetupListCtxtSUReq{ + {ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}, + {ERABID: 2, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 2, iEExtensions: tnlUnknownMeta(), containerCrit: ignoreCrit()}, + } + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABSetupListCtxtSURes", func(t *testing.T) { + l := ERABSetupListCtxtSURes{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, containerCrit: rejectCrit()}} + losslessRoundTrip(t, &l, "000032000a021f0a00000100000001") + }) + t.Run("E-RABToBeSetupListBearerSUReq", func(t *testing.T) { + l := ERABToBeSetupListBearerSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, NASPDU: NASPDU{0x27}, containerCrit: ignoreCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABSetupListBearerSURes", func(t *testing.T) { + l := ERABSetupListBearerSURes{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, containerCrit: rejectCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABToBeModifiedListBearerModReq", func(t *testing.T) { + l := ERABToBeModifiedListBearerModReq{{ERABID: 1, QoS: goldQoS(), NASPDU: NASPDU{0x27}, TransportInformation: &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 1}, containerCrit: ignoreCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABToBeModifiedListBearerModInd", func(t *testing.T) { + l := ERABToBeModifiedListBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA(), DLGTPTEID: 1, containerCrit: ignoreCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABNotToBeModifiedListBearerModInd", func(t *testing.T) { + l := ERABNotToBeModifiedListBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA(), DLGTPTEID: 1, containerCrit: ignoreCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABToBeSetupListHOReq", func(t *testing.T) { + l := ERABToBeSetupListHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS(), containerCrit: ignoreCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABAdmittedList", func(t *testing.T) { + l := ERABAdmittedList{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, containerCrit: rejectCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABSubjecttoDataForwardingList", func(t *testing.T) { + l := ERABSubjecttoDataForwardingList{{ERABID: 1, ULTransportLayerAddr: goldTLA(), ULGTPTEID: Ptr(GTPTEID(1)), containerCrit: rejectCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABToBeSwitchedDLList", func(t *testing.T) { + l := ERABToBeSwitchedDLList{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, containerCrit: ignoreCrit()}} + losslessRoundTrip(t, &l, "") + }) + t.Run("E-RABToBeSwitchedULList", func(t *testing.T) { + l := ERABToBeSwitchedULList{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, containerCrit: rejectCrit()}} + losslessRoundTrip(t, &l, "") + }) +} + +func TestTNLListWireCriticality(t *testing.T) { + tests := []struct { + name string + list per.Marshaler + id ProtocolIEID + crit Criticality + }{ + {"E-RABToBeSetupListCtxtSUReq", ERABToBeSetupListCtxtSUReq{{QoS: goldQoS(), TransportLayerAddress: goldTLA()}}, IDERABToBeSetupItemCtxtSUReq, CriticalityReject}, + {"E-RABSetupListCtxtSURes", ERABSetupListCtxtSURes{{TransportLayerAddress: goldTLA()}}, IDERABSetupItemCtxtSURes, CriticalityIgnore}, + {"E-RABToBeSetupListBearerSUReq", ERABToBeSetupListBearerSUReq{{QoS: goldQoS(), TransportLayerAddress: goldTLA()}}, IDERABToBeSetupItemBearerSUReq, CriticalityReject}, + {"E-RABSetupListBearerSURes", ERABSetupListBearerSURes{{TransportLayerAddress: goldTLA()}}, IDERABSetupItemBearerSURes, CriticalityIgnore}, + {"E-RABToBeModifiedListBearerModReq", ERABToBeModifiedListBearerModReq{{QoS: goldQoS()}}, IDERABToBeModifiedItemBearerModReq, CriticalityReject}, + {"E-RABToBeModifiedListBearerModInd", ERABToBeModifiedListBearerModInd{{TransportLayerAddress: goldTLA()}}, IDERABToBeModifiedItemBearerModInd, CriticalityReject}, + {"E-RABNotToBeModifiedListBearerModInd", ERABNotToBeModifiedListBearerModInd{{TransportLayerAddress: goldTLA()}}, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject}, + {"E-RABToBeSetupListHOReq", ERABToBeSetupListHOReq{{QoS: goldQoS(), TransportLayerAddress: goldTLA()}}, IDERABToBeSetupItemHOReq, CriticalityReject}, + {"E-RABAdmittedList", ERABAdmittedList{{TransportLayerAddress: goldTLA()}}, IDERABAdmittedItem, CriticalityIgnore}, + {"E-RABSubjecttoDataForwardingList", ERABSubjecttoDataForwardingList{{}}, IDERABDataForwardingItem, CriticalityIgnore}, + {"E-RABToBeSwitchedDLList", ERABToBeSwitchedDLList{{TransportLayerAddress: goldTLA()}}, IDERABToBeSwitchedDLItem, CriticalityReject}, + {"E-RABToBeSwitchedULList", ERABToBeSwitchedULList{{TransportLayerAddress: goldTLA()}}, IDERABToBeSwitchedULItem, CriticalityIgnore}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + w := per.NewWriter() + if err := tt.list.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + r := per.NewReader(w.Bytes()) + + if err := per.DecodeLength(r, per.Aligned, 1, maxnoofERABs, true, func(int64) error { return nil }); err != nil { + t.Fatal(err) + } + + id, err := per.DecodeConstrainedWholeNumber(r, per.Aligned, 0, maxProtocolIEs) + if err != nil { + t.Fatal(err) + } + + crit, err := per.DecodeEnumerated(r, per.Aligned, criticalityRootCount, false) + if err != nil { + t.Fatal(err) + } + + if ProtocolIEID(id) != tt.id || Criticality(crit) != tt.crit { + t.Errorf("item %v/%v, want %v/%v", ProtocolIEID(id), Criticality(crit), tt.id, tt.crit) + } + }) + } +} + +func tnlGoldenCases() []newMessageCase { + return []newMessageCase{ + { + name: "PathSwitchRequestAcknowledgeERABToBeSwitchedULList", + msg: &PathSwitchRequestAcknowledge{ + MMEUES1APID: Ptr(MMEUES1APID(1)), + ENBUES1APID: Ptr(ENBUES1APID(2)), + ERABToBeSwitchedUL: ERABToBeSwitchedULList{{ERABID: 5, TransportLayerAddress: TransportLayerAddress{10, 0, 0, 9}, GTPTEID: 0x01020304}}, + SecurityContext: SecurityContext{NextHopChainingCount: 3}, + }, + parse: func(b []byte) (any, error) { return ParsePathSwitchRequestAcknowledge(b) }, + choice: isSuccessful, + golden: "20030047000004000040020001000840020002005f400f00005e400a0a1f0a0000090102030400280021180000000000000000000000000000000000000000000000000000000000000000", + }, + { + name: "ERABModifyRequestTransportInformation", + msg: &ERABModifyRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + ERABToBeModified: ERABToBeModifiedListBearerModReq{{ + ERABID: 5, + QoS: goldQoS(), + NASPDU: NASPDU{0x07, 0x46}, + TransportInformation: &TransportInformation{TransportLayerAddress: TransportLayerAddress{10, 0, 0, 9}, ULGTPTEID: 0x01020304}, + }}, + }, + parse: func(b []byte) (any, error) { return ParseERABModifyRequest(b) }, + choice: isInitiating, + golden: "0006002f000003000000020001000800020002001e001c00002400174a000904020746000000b9000a07c00a00000901020304", + }, + { + name: "InitialContextSetupRequestERABLossless", + msg: &InitialContextSetupRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000, UL: 1000}, + ERABToBeSetup: ERABToBeSetupListCtxtSUReq{{ + ERABID: 5, + QoS: goldQoS(), + TransportLayerAddress: goldTLA(), + GTPTEID: 1, + CorrelationID: &CorrelationID{0x01, 0x02, 0x03, 0x04}, + extensions: tnlExtensionAdditions([]byte{0xaa}), + containerCrit: ignoreCrit(), + }}, + UESecurityCapabilities: UESecurityCapabilities{}, + }, + parse: func(b []byte) (any, error) { return ParseInitialContextSetupRequest(b) }, + choice: isInitiating, + golden: "0009006a000006000000020001000800020002004200060803e82003e800180020000034401ba50009040f800a000001000000010000009c4004010203040101aa006b00050000000000004900200000000000000000000000000000000000000000000000000000000000000000", + extensionNotices: 1, + }, + { + name: "InitialContextSetupRequestKnownERABExtensions", + msg: &InitialContextSetupRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000, UL: 1000}, + ERABToBeSetup: ERABToBeSetupListCtxtSUReq{{ + ERABID: 5, + QoS: knownExtensionQoS(), + TransportLayerAddress: goldTLA(), + GTPTEID: 1, + CorrelationID: &CorrelationID{0x01, 0x02, 0x03, 0x04}, + SIPTOCorrelationID: &CorrelationID{0x05, 0x06, 0x07, 0x08}, + BearerType: Ptr(BearerTypeNonIP), + EthernetType: Ptr(EthernetTypeTrue), + SecurityIndication: &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionPreferred}, + }}, + UESecurityCapabilities: UESecurityCapabilities{}, + }, + parse: func(b []byte) (any, error) { return ParseInitialContextSetupRequest(b) }, + choice: isInitiating, + golden: goldenICSKnownERABExtensions, + }, + { + name: "PathSwitchRequestDLItemSecurityIndication", + msg: &PathSwitchRequest{ + ENBUES1APID: 2, + ERABToBeSwitchedDL: ERABToBeSwitchedDLList{{ + ERABID: 5, TransportLayerAddress: TransportLayerAddress{10, 1, 2, 3}, GTPTEID: 0x01020304, + SecurityIndication: &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionRequired}, + }}, + SourceMMEUES1APID: 0x020000bf, + EUTRANCGI: Ptr(EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x123c601}), + TAI: Ptr(TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}), + UESecurityCapabilities: Ptr(UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}), + }, + parse: func(b []byte) (any, error) { return ParsePathSwitchRequest(b) }, + choice: isInitiating, + golden: goldenPathSwitchDLSecurityIndication, + }, + } +} + +func knownExtensionQoS() ERABLevelQoSParameters { + return ERABLevelQoSParameters{ + QCI: 1, + ARP: AllocationAndRetentionPriority{PriorityLevel: 2}, + GBR: &GBRQosInformation{ + MaximumBitrateDL: 1000, + MaximumBitrateUL: 1000, + GuaranteedBitrateDL: 500, + GuaranteedBitrateUL: 500, + ExtendedMaximumBitrateDL: Ptr(ExtendedBitRate(10000000001)), + ExtendedMaximumBitrateUL: Ptr(ExtendedBitRate(4000000000000)), + ExtendedGuaranteedBitrateDL: Ptr(ExtendedBitRate(20000000000)), + ExtendedGuaranteedBitrateUL: Ptr(ExtendedBitRate(30000000000)), + }, + DownlinkPacketLossRate: Ptr(PacketLossRate(10)), + UplinkPacketLossRate: Ptr(PacketLossRate(1000)), + } +} + +const ( + goldenICSKnownERABExtensions = "" + goldenPathSwitchDLSecurityIndication = "0003004b0000060008000200020016001600001700114a1f0a010203010203040000014c40010000580005c0020000bf006440080000f110123c6010004340060000f1100001006b400518000c0000" +) + +func tnlListCodecs() []func() tnlValue { + return []func() tnlValue{ + func() tnlValue { return new(ERABToBeSetupListCtxtSUReq) }, + func() tnlValue { return new(ERABSetupListCtxtSURes) }, + func() tnlValue { return new(ERABToBeSetupListBearerSUReq) }, + func() tnlValue { return new(ERABSetupListBearerSURes) }, + func() tnlValue { return new(ERABToBeModifiedListBearerModReq) }, + func() tnlValue { return new(ERABToBeModifiedListBearerModInd) }, + func() tnlValue { return new(ERABNotToBeModifiedListBearerModInd) }, + func() tnlValue { return new(ERABToBeSetupListHOReq) }, + func() tnlValue { return new(ERABAdmittedList) }, + func() tnlValue { return new(ERABSubjecttoDataForwardingList) }, + func() tnlValue { return new(ERABToBeSwitchedDLList) }, + func() tnlValue { return new(ERABToBeSwitchedULList) }, + } +} + +func FuzzERABListRoundTrip(f *testing.F) { + add := tnlExtensionAdditions([]byte{0xaa}) + + seeds := []per.Marshaler{ + ERABToBeSetupListCtxtSUReq{{ERABID: 1, QoS: tnlQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, CorrelationID: &CorrelationID{1, 2, 3, 4}, extensions: add, containerCrit: ignoreCrit()}}, + ERABSetupListCtxtSURes{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, iEExtensions: tnlUnknownExtension()}}, + ERABToBeSetupListBearerSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), NASPDU: NASPDU{0x07}}}, + ERABSetupListBearerSURes{{ERABID: 1, TransportLayerAddress: goldTLA()}}, + ERABToBeModifiedListBearerModReq{{ERABID: 1, QoS: goldQoS(), NASPDU: NASPDU{0x07}, TransportInformation: &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 1}}}, + ERABToBeModifiedListBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA(), extensions: add}}, + ERABNotToBeModifiedListBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA()}}, + ERABToBeSetupListHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), QoS: goldQoS(), Extensions: &ERABToBeSetupItemHOReqExtIEs{DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue)}}}, + ERABAdmittedList{{ERABID: 1, TransportLayerAddress: goldTLA(), DLTransportLayerAddr: goldTLA(), DLGTPTEID: Ptr(GTPTEID(2))}}, + ERABSubjecttoDataForwardingList{{ERABID: 1, ULTransportLayerAddr: goldTLA(), ULGTPTEID: Ptr(GTPTEID(2)), iEExtensions: tnlUnknownExtension()}}, + ERABToBeSwitchedDLList{{ERABID: 1, TransportLayerAddress: goldTLA()}}, + ERABToBeSwitchedULList{{ERABID: 1, TransportLayerAddress: goldTLA(), containerCrit: rejectCrit()}}, + } + + for i, s := range seeds { + w := per.NewWriter() + if err := s.MarshalPER(w, per.Aligned); err != nil { + f.Fatal(err) + } + + w.AlignToByte() + f.Add(uint8(i), w.Bytes()) + } + + codecs := tnlListCodecs() + + f.Fuzz(func(t *testing.T, kind uint8, data []byte) { + newValue := codecs[int(kind)%len(codecs)] + + v := newValue() + if err := v.UnmarshalPER(per.NewReader(data), per.Aligned); err != nil { + return + } + + w := per.NewWriter() + if err := v.MarshalPER(w, per.Aligned); err != nil { + t.Fatalf("encode decoded value: %v", err) + } + + w.AlignToByte() + b := w.Bytes() + + again := newValue() + if err := again.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + t.Fatalf("decode re-encoded value: %v", err) + } + + if !reflect.DeepEqual(again, v) { + t.Fatalf("re-decoded\n got %+v\nwant %+v", again, v) + } + + w = per.NewWriter() + if err := again.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + if !bytes.Equal(w.Bytes(), b) { + t.Fatalf("re-encoded %x, want %x", w.Bytes(), b) + } + }) +} + +func TestTNLKnownExtensionCriticality(t *testing.T) { + type row struct { + id ProtocolIEID + crit Criticality + } + + rows := func(ids []ProtocolIEID, crits []Criticality) []row { + out := make([]row, len(ids)) + for i := range ids { + out[i] = row{ids[i], crits[i]} + } + + return out + } + + ig, rj := CriticalityIgnore, CriticalityReject + + for _, tc := range []struct { + name string + got []row + want []row + }{ + {"E-RABToBeSetupItemCtxtSUReqExtIEs", rows(tableIDs(eRABToBeSetupItemCtxtSUReqExtIEs), tableCrits(eRABToBeSetupItemCtxtSUReqExtIEs)), []row{ + {IDCorrelationID, ig}, {IDSIPTOCorrelationID, ig}, {IDBearerType, rj}, {IDEthernetType, ig}, {IDSecurityIndication, rj}, + }}, + {"E-RABToBeSetupItemBearerSUReqExtIEs", rows(tableIDs(eRABToBeSetupItemBearerSUReqExtIEs), tableCrits(eRABToBeSetupItemBearerSUReqExtIEs)), []row{ + {IDCorrelationID, ig}, {IDSIPTOCorrelationID, ig}, {IDBearerType, rj}, {IDEthernetType, ig}, {IDSecurityIndication, rj}, + }}, + {"E-RABToBeSetupItemHOReq-ExtIEs", rows(tableIDs(eRABToBeSetupItemHOReqExtIEs), tableCrits(eRABToBeSetupItemHOReqExtIEs)), []row{ + {IDDataForwardingNotPossible, ig}, {IDBearerType, rj}, {IDEthernetType, ig}, {IDSecurityIndication, rj}, + }}, + {"E-RABToBeSwitchedDLItem-ExtIEs", rows(tableIDs(eRABToBeSwitchedDLItemExtIEs), tableCrits(eRABToBeSwitchedDLItemExtIEs)), []row{{IDSecurityIndication, ig}}}, + {"E-RABQoSParameters-ExtIEs", rows(tableIDs(eRABLevelQoSParametersExtIEs), tableCrits(eRABLevelQoSParametersExtIEs)), []row{ + {IDDownlinkPacketLossRate, ig}, {IDUplinkPacketLossRate, ig}, + }}, + {"GBR-QosInformation-ExtIEs", rows(tableIDs(gBRQosInformationExtIEs), tableCrits(gBRQosInformationExtIEs)), []row{ + {IDExtendedERABMaximumBitrateDL, ig}, {IDExtendedERABMaximumBitrateUL, ig}, {IDExtendedERABGuaranteedBitrateDL, ig}, {IDExtendedERABGuaranteedBitrateUL, ig}, + }}, + } { + t.Run(tc.name, func(t *testing.T) { + if !reflect.DeepEqual(tc.got, tc.want) { + t.Fatalf("rows %v, want %v", tc.got, tc.want) + } + }) + } +} + +func tableCrits[M any](table []ieSpec[M]) []Criticality { + out := make([]Criticality, len(table)) + for i := range table { + out[i] = table[i].crit + } + + return out +} + +func TestTNLItemKeepsManyUnknownExtensions(t *testing.T) { + fields := make([]ieField, 0, 3*maxPreservedIEs) + for i := range 3 * maxPreservedIEs { + fields = append(fields, ieField{id: idUnknownExtension + ProtocolIEID(i), crit: CriticalityIgnore, raw: []byte{byte(i) | 1}}) + } + + in := &ERABToBeSetupItemCtxtSUReq{ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, BearerType: Ptr(BearerTypeNonIP)} + + w := per.NewWriter() + if err := encodeExtensionContainer(w, per.Aligned, fields); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + if err := decodeExtensionContainer(per.NewReader(w.Bytes()), per.Aligned, eRABToBeSetupItemCtxtSUReqExtIEs, in, &in.iEExtensions); err != nil { + t.Fatal(err) + } + + if got := len(in.iEExtensions.UnknownIEs()); got != 3*maxPreservedIEs { + t.Fatalf("kept %d unknown extensions, want %d", got, 3*maxPreservedIEs) + } + + losslessRoundTrip(t, in, "") +} + +func TestMessageTruncatedOnDecodeRefusesToEncode(t *testing.T) { + fields := uplinkNASFields() + for i := range maxPreservedIEs + 1 { + fields = append(fields, ieField{id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}}) + } + + msg, err := ParseUplinkNASTransport(container(t, fields...)) + if err != nil { + t.Fatal(err) + } + + if _, err := msg.Marshal(); err == nil { + t.Fatal("a message whose unknown IEs were dropped on decode re-encoded") + } +} diff --git a/s1ap/transparent_container.go b/s1ap/transparent_container.go index a2cf186663..547887663f 100644 --- a/s1ap/transparent_container.go +++ b/s1ap/transparent_container.go @@ -109,7 +109,7 @@ func (l ERABInformationList) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (l *ERABInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - items, err := decodeItemList[ERABInformationListItem](r, enc, maxnoofERABs, IDERABInformationListItem) + items, err := decodeItemList[ERABInformationListItem](r, enc, maxnoofERABs, IDERABInformationListItem, CriticalityIgnore) if err != nil { return err } From 8e46906e5edd283d7698b5a08c8aa40877bfeb5c Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sun, 15 Nov 2026 08:20:24 -0500 Subject: [PATCH 11/16] fix: pr review Signed-off-by: Guillaume Belanger --- cmd/pergen/doc.go | 8 - cmd/pergen/flags.go | 60 - cmd/pergen/flags_test.go | 150 - cmd/pergen/gen.go | 245 - cmd/pergen/load.go | 91 - go.mod | 2 - go.sum | 4 - internal/amf/amf_ue.go | 2 +- internal/amf/claim_ran_id_test.go | 13 +- internal/amf/drain_internal_test.go | 7 +- internal/amf/eps_cause_test.go | 96 +- internal/amf/eps_registration.go | 2 +- internal/amf/eps_relocation.go | 86 +- internal/amf/eps_relocation_test.go | 4 +- internal/amf/fivegs_relocation.go | 41 +- internal/amf/fivegs_relocation_test.go | 10 +- internal/amf/handover.go | 2 +- internal/amf/location.go | 91 +- internal/amf/location_test.go | 59 +- .../amf/nas/handle_deregistration_accept.go | 2 +- .../amf/nas/handle_deregistration_request.go | 2 +- .../amf/nas/handle_registration_complete.go | 2 +- .../amf/nas/handle_security_mode_reject.go | 2 +- internal/amf/nas/handle_service_request.go | 2 +- internal/amf/nas/nas_handler.go | 2 +- internal/amf/nas/reg_initial.go | 2 +- internal/amf/ngap/handle_error_indication.go | 6 +- .../amf/ngap/handle_error_indication_test.go | 12 +- internal/amf/ngap/handle_handover_cancel.go | 5 +- .../amf/ngap/handle_handover_cancel_test.go | 10 +- .../amf/ngap/handle_handover_failure_test.go | 12 +- internal/amf/ngap/handle_handover_notify.go | 2 +- .../amf/ngap/handle_handover_notify_test.go | 21 +- ...andle_handover_request_acknowledge_test.go | 23 +- .../amf/ngap/handle_handover_required_test.go | 29 +- ...ndle_initial_context_setup_failure_test.go | 12 +- .../ngap/handle_initial_ue_message_test.go | 2 +- ...handle_nas_non_delivery_indication_test.go | 2 +- internal/amf/ngap/handle_ng_reset.go | 13 +- internal/amf/ngap/handle_ng_reset_test.go | 10 +- internal/amf/ngap/handle_ng_setup.go | 10 +- internal/amf/ngap/handle_ng_setup_test.go | 23 +- .../amf/ngap/handle_path_switch_request.go | 10 +- .../ngap/handle_path_switch_request_test.go | 20 +- ..._pdu_session_resource_modify_indication.go | 4 +- ...session_resource_modify_indication_test.go | 4 +- ...du_session_resource_setup_response_test.go | 9 +- .../ngap/handle_ran_configuration_update.go | 2 +- .../handle_ran_configuration_update_test.go | 15 +- .../handle_ue_context_modification_test.go | 2 +- .../ngap/handle_ue_context_release_request.go | 4 +- .../handle_ue_context_release_request_test.go | 28 +- .../ngap/handle_uplink_nas_transport_test.go | 16 +- ..._uplink_ran_configuration_transfer_test.go | 4 +- internal/amf/ngap/handover.go | 14 +- .../amf/ngap/handover_conformance_test.go | 16 +- .../ngap/handover_from_eps_roaming_test.go | 2 +- internal/amf/ngap/handover_from_eps_test.go | 22 +- internal/amf/ngap/handover_to_eps_test.go | 21 +- internal/amf/ngap/ng_setup_outcome_test.go | 8 +- .../amf/ngap/path_switch_conformance_test.go | 2 +- internal/amf/ngap/path_switch_failure.go | 8 +- internal/amf/ngap/resolve_ue.go | 8 +- internal/amf/ngap/resolve_ue_test.go | 16 +- internal/amf/ngap/route_internal_test.go | 13 +- internal/amf/ngap/superseded_release_test.go | 2 +- internal/amf/ngap/unknown_procedure.go | 8 +- internal/amf/paging.go | 8 +- internal/amf/paging_test.go | 12 +- internal/amf/ran_trace.go | 7 +- internal/amf/ran_trace_internal_test.go | 4 +- internal/amf/ran_ue.go | 17 +- internal/amf/relocation.go | 2 +- internal/amf/roaming_steering.go | 2 +- internal/amf/send.go | 20 +- .../amf/ue_context_release_command_test.go | 15 +- internal/amf/ue_registration.go | 2 +- internal/amf/util/ngap_convert.go | 46 +- internal/amf/util/ngap_convert_test.go | 66 +- .../decoder/ngap/amf_configuration_update.go | 6 +- internal/decoder/ngap/common_ie.go | 58 +- .../decoder/ngap/error_indication_test.go | 2 +- internal/decoder/ngap/golden_test.go | 134 +- internal/decoder/ngap/handover.go | 15 +- .../ngap/initial_context_setup_request.go | 12 +- .../initial_context_setup_request_test.go | 17 +- internal/decoder/ngap/modeled_ies_test.go | 29 +- internal/decoder/ngap/ng_reset.go | 6 +- internal/decoder/ngap/ng_setup.go | 32 +- internal/decoder/ngap/overload.go | 6 +- internal/decoder/ngap/paging.go | 6 +- internal/decoder/ngap/pdu_session_transfer.go | 10 +- internal/decoder/ngap/pws.go | 48 +- internal/decoder/ngap/pws_overload_test.go | 18 +- .../golden/initial_context_setup_request.json | 37 +- internal/decoder/ngap/tnl_extensions_test.go | 9 +- internal/decoder/ngap/trace.go | 12 +- .../decoder/ngap/transparent_container.go | 2 +- .../ngap/transparent_container_test.go | 6 +- internal/decoder/ngap/ue_context_release.go | 16 +- internal/decoder/ngap/util.go | 38 +- internal/decoder/s1ap/common_ie.go | 32 +- internal/decoder/s1ap/config_transfer.go | 20 +- internal/decoder/s1ap/erab_extensions.go | 6 +- internal/decoder/s1ap/erab_extensions_test.go | 15 +- .../decoder/s1ap/error_indication_test.go | 4 +- internal/decoder/s1ap/golden_test.go | 87 +- internal/decoder/s1ap/handover.go | 36 +- internal/decoder/s1ap/handover_test.go | 15 +- .../decoder/s1ap/initial_context_setup.go | 4 +- internal/decoder/s1ap/location_report.go | 4 +- .../s1ap/mme_configuration_update_test.go | 2 +- internal/decoder/s1ap/modeled_ies_test.go | 15 +- internal/decoder/s1ap/overload.go | 9 +- internal/decoder/s1ap/paging.go | 20 +- internal/decoder/s1ap/path_switch.go | 8 +- internal/decoder/s1ap/pws.go | 14 +- internal/decoder/s1ap/pws_test.go | 12 +- internal/decoder/s1ap/reset.go | 16 +- internal/decoder/s1ap/s1_setup.go | 52 +- internal/decoder/s1ap/s1_setup_test.go | 6 +- .../enb_configuration_transfer_full.json | 2 +- .../mme_configuration_transfer_full.json | 2 +- internal/decoder/s1ap/trace.go | 2 +- internal/decoder/s1ap/trace_test.go | 2 +- .../decoder/s1ap/transparent_container.go | 6 +- .../s1ap/transparent_container_test.go | 9 +- internal/decoder/s1ap/ue_context_release.go | 5 +- .../decoder/s1ap/ue_context_release_test.go | 4 +- internal/decoder/s1ap/unknown_ie_test.go | 8 +- internal/decoder/s1ap/util.go | 20 +- internal/interworking/forward_relocation.go | 5 +- internal/lmf/engine_refresh_test.go | 11 +- internal/lmf/lpp/lpptype/message.go | 2 +- internal/mme/bearer_arp_test.go | 3 +- internal/mme/bearer_loss_test.go | 4 +- internal/mme/bearer_support.go | 4 +- internal/mme/cause.go | 6 +- internal/mme/cause_test.go | 14 +- internal/mme/dedicated_bearer.go | 9 +- internal/mme/dedicated_bearer_modify_test.go | 10 +- internal/mme/dedicated_bearer_test.go | 17 +- internal/mme/detach.go | 2 +- internal/mme/drain.go | 2 +- internal/mme/drain_test.go | 3 +- internal/mme/fivegs_relocation.go | 27 +- internal/mme/fivegs_relocation_test.go | 21 +- internal/mme/handover.go | 22 +- internal/mme/handover_bearers.go | 18 +- internal/mme/mme_radio_test.go | 4 +- internal/mme/nas/bearer.go | 9 +- internal/mme/nas/detach_nas_test.go | 4 +- .../mme/nas/handle_service_request_test.go | 8 +- internal/mme/nas/pdn_connectivity.go | 5 +- internal/mme/nas/pdn_connectivity_test.go | 7 +- internal/mme/nas/tau_test.go | 11 +- internal/mme/paging.go | 10 +- internal/mme/paging_test.go | 16 +- internal/mme/ran_trace.go | 7 +- internal/mme/ran_trace_test.go | 4 +- internal/mme/relocation.go | 26 +- internal/mme/relocation_test.go | 27 +- internal/mme/roaming_interworking.go | 5 +- internal/mme/roaming_interworking_test.go | 2 +- internal/mme/s1ap/ap_id_binding_test.go | 5 +- internal/mme/s1ap/ap_id_handling_test.go | 2 +- internal/mme/s1ap/deferred_release_test.go | 6 +- internal/mme/s1ap/enb_config_update_test.go | 4 +- .../s1ap/handle_enb_configuration_transfer.go | 6 +- .../handle_enb_configuration_transfer_test.go | 40 +- .../s1ap/handle_enb_configuration_update.go | 2 +- .../handle_erab_modification_indication.go | 2 +- ...andle_erab_modification_indication_test.go | 3 +- .../mme/s1ap/handle_erab_modify_response.go | 4 +- ...ndle_erab_modify_response_internal_test.go | 21 +- .../s1ap/handle_erab_release_indication.go | 3 +- .../handle_erab_release_indication_test.go | 2 +- internal/mme/s1ap/handle_error_indication.go | 27 +- .../mme/s1ap/handle_error_indication_test.go | 6 +- .../handle_handover_request_acknowledge.go | 11 +- .../handle_initial_context_setup_response.go | 6 +- .../mme/s1ap/handle_path_switch_request.go | 20 +- .../s1ap/handle_path_switch_request_test.go | 23 +- internal/mme/s1ap/handle_reset.go | 13 +- internal/mme/s1ap/handle_reset_test.go | 12 +- internal/mme/s1ap/handle_s1_setup.go | 18 +- internal/mme/s1ap/handle_s1_setup_test.go | 4 +- .../s1ap/handle_ue_context_modification.go | 2 +- .../handle_ue_context_modification_test.go | 2 +- .../s1ap/handle_ue_context_release_request.go | 4 +- internal/mme/s1ap/handover.go | 14 +- .../mme/s1ap/handover_conformance_test.go | 51 +- internal/mme/s1ap/handover_test.go | 103 +- internal/mme/s1ap/handover_to_5gs_test.go | 22 +- .../mme/s1ap/idle_mobility_from_5gs_test.go | 5 +- .../mme/s1ap/interworking_conformance_test.go | 3 +- internal/mme/s1ap/mme_config_update_test.go | 2 +- internal/mme/s1ap/mme_nas_test.go | 15 +- .../mme/s1ap/path_switch_conformance_test.go | 3 +- .../s1ap/protocol_error_indication_test.go | 10 +- internal/mme/s1ap/reject_paths_test.go | 7 +- internal/mme/s1ap/release_test.go | 8 +- internal/mme/s1ap/resolve_ue_test.go | 4 +- internal/mme/s1ap/robustness_test.go | 2 +- internal/mme/s1ap/s1_setup_outcome_test.go | 10 +- internal/mme/s1ap/superseded_release_test.go | 9 +- internal/mme/s1ap/uplink_nas_test.go | 2 +- internal/mme/ue_context_release.go | 12 +- internal/models/transport_layer_address.go | 64 - .../models/transport_layer_address_test.go | 107 - internal/smf/handover.go | 18 +- internal/smf/handover_from_eps_test.go | 2 +- internal/smf/ipv6_integration_test.go | 5 +- internal/smf/lifecycle_test.go | 5 +- internal/smf/modify.go | 7 +- internal/smf/n2_forwarding_test.go | 15 +- .../ngap/build_handover_command_transfer.go | 9 +- ...ath_switch_request_acknowledge_transfer.go | 5 +- ...ession_resource_modify_confirm_transfer.go | 5 +- ...ssion_resource_release_command_transfer.go | 2 +- ...session_resource_setup_request_transfer.go | 5 +- ...build_qos_flows_modify_request_transfer.go | 8 +- internal/smf/ngap/build_test.go | 59 +- internal/smf/ngap/qos.go | 3 +- internal/smf/ngap/transport_layer_address.go | 42 - .../smf/ngap/transport_layer_address_test.go | 247 - internal/smf/non_gbr_test.go | 3 +- internal/smf/qos_flows_loss_test.go | 6 +- internal/smf/qos_flows_test.go | 15 +- internal/smf/transfer_test.go | 2 +- internal/smf/unbound_downlink_test.go | 5 +- internal/smf/update.go | 26 +- internal/smf/update_test.go | 5 +- internal/tester/gnb/broadcast_plmn_test.go | 20 +- .../gnb/build_handover_request_acknowledge.go | 7 +- .../tester/gnb/build_handover_required.go | 6 +- .../gnb/build_handover_required_test.go | 4 +- .../build_initial_context_setup_response.go | 5 +- .../tester/gnb/build_initial_ue_message.go | 4 +- internal/tester/gnb/build_ng_reset.go | 4 +- internal/tester/gnb/build_ng_setup_request.go | 9 +- .../tester/gnb/build_path_switch_request.go | 5 +- internal/tester/gnb/build_roundtrip_test.go | 22 +- internal/tester/gnb/dispatch.go | 4 +- ...ndle_pdu_session_resource_setup_request.go | 41 +- .../gnb/handle_ue_context_release_command.go | 5 +- internal/tester/gnb/helpers.go | 28 +- internal/tester/gnb/lifecycle.go | 6 +- .../tester/gnb/ng_setup_roundtrip_test.go | 9 +- internal/tester/gnb/non_gbr_qos_flow_test.go | 2 +- .../tester/gnb/release_selected_plmn_test.go | 4 +- internal/tester/gnb/send.go | 2 +- internal/tester/s1enb/attach.go | 34 +- internal/tester/s1enb/broadcast_plmn_test.go | 2 +- internal/tester/s1enb/dedicated_test.go | 3 +- internal/tester/s1enb/handover.go | 20 +- internal/tester/s1enb/handover_to_5gs.go | 4 +- internal/tester/s1enb/lifecycle.go | 7 +- internal/tester/s1enb/pdn.go | 7 +- internal/tester/s1enb/s1ap.go | 42 +- internal/tester/s1enb/server.go | 17 +- internal/tester/s1enb/ue.go | 4 +- .../scenarios/gnb/n2_handover_failure.go | 10 +- .../gnb/n2_handover_indirect_forwarding.go | 3 +- .../gnb/n2_handover_partial_admission.go | 2 +- internal/tester/scenarios/gnb/ng_reset.go | 4 +- .../tester/scenarios/gnb/ng_setup_failure.go | 4 +- .../scenarios/gnb/ue_context_release.go | 4 +- .../tester/scenarios/gnb/xn_path_switch.go | 6 +- .../scenarios/gnb/xn_path_switch_failure.go | 4 +- .../tester/scenarios/interworking/handover.go | 6 +- .../scenarios/interworking/handover_to_5gs.go | 10 +- .../scenarios/interworking/ims_calls.go | 19 +- .../scenarios/interworking/ims_mcptt.go | 3 +- .../scenarios/interworking/ims_parties.go | 2 +- .../scenarios/interworking/ims_video.go | 2 +- .../tester/scenarios/s1enb/context_release.go | 11 +- internal/tester/scenarios/s1enb/drain_4g.go | 9 +- .../scenarios/s1enb/erab_setup_release.go | 6 +- .../scenarios/s1enb/error_indication.go | 2 +- internal/tester/scenarios/s1enb/helpers.go | 12 + internal/tester/scenarios/s1enb/ims_mcptt.go | 5 +- .../scenarios/s1enb/ims_registration.go | 2 +- .../scenarios/s1enb/initial_context_setup.go | 8 +- internal/tester/scenarios/s1enb/paging.go | 14 +- internal/tester/scenarios/s1enb/ran_trace.go | 2 +- .../tester/scenarios/s1enb/s1_handover.go | 4 +- .../scenarios/s1enb/s1_handover_failure.go | 6 +- .../s1enb/s1_handover_indirect_forwarding.go | 8 +- .../s1enb/s1_handover_partial_admission.go | 2 +- .../scenarios/s1enb/s1_handover_ping_pong.go | 2 +- internal/tester/scenarios/s1enb/s1_reset.go | 2 +- .../scenarios/s1enb/s1_setup_failure.go | 4 +- .../scenarios/s1enb/s1_setup_response.go | 2 +- .../tester/scenarios/s1enb/sctp_basics.go | 2 +- internal/tester/scenarios/s1enb/tau_reject.go | 6 +- .../scenarios/s1enb/x2_path_switch_failure.go | 2 +- ngap/abstract_syntax_test.go | 63 +- ngap/amf_config_update.go | 124 +- ngap/amf_config_update_test.go | 86 +- ngap/amf_status_indication.go | 160 +- ngap/amf_status_indication_test.go | 23 +- ngap/asn1_spec_test.go | 97 + ngap/bit_string.go | 64 + ngap/cause.go | 284 +- ngap/cause_names.go | 176 +- ngap/cause_test.go | 158 +- ngap/cell_identity_test.go | 6 +- ngap/choice_index_test.go | 29 + ngap/common.go | 61 +- ngap/comparable_test.go | 71 + ngap/config_transfer.go | 49 +- ngap/config_transfer_test.go | 9 +- ngap/coverage_cases_test.go | 477 + ngap/coverage_test.go | 413 + ngap/criticality_diagnostics.go | 125 +- ngap/criticality_diagnostics_test.go | 4 +- ngap/decode_total_test.go | 161 + ngap/diagnostics_bound_test.go | 8 +- ngap/enum_all_test.go | 1323 + ngap/enum_encode_test.go | 167 +- ngap/enum_extension_test.go | 112 +- ngap/enum_names.go | 1026 +- ngap/enum_names_test.go | 38 +- ngap/equal_test.go | 125 + ngap/error_indication.go | 44 +- ngap/error_indication_test.go | 4 +- ngap/errors.go | 119 +- ngap/extension_criticality_test.go | 13 +- ngap/golden_tshark_test.go | 16 +- ngap/handover_cancel.go | 56 +- ngap/handover_cancel_test.go | 16 +- ngap/handover_notify.go | 53 +- ngap/handover_notify_test.go | 37 +- ngap/handover_preparation.go | 182 +- ngap/handover_preparation_test.go | 96 +- ngap/handover_resource_allocation.go | 316 +- ngap/handover_resource_allocation_test.go | 53 +- ngap/handover_transfer.go | 308 +- ngap/handover_transfer_test.go | 26 +- ngap/ie_common.go | 223 +- ngap/ie_ext_types.go | 6570 ++ ngap/ie_extensions.go | 130 +- ngap/ie_guami.go | 150 +- ngap/ie_handover.go | 308 +- ngap/ie_ids.go | 221 + ngap/ie_names.go | 764 +- ngap/ie_pws.go | 594 +- ngap/ie_qos.go | 417 +- ngap/ie_qos_test.go | 168 +- ngap/ie_ran_node.go | 308 +- ngap/ie_ran_node_test.go | 252 +- ngap/ie_setup.go | 230 +- ngap/ie_slice.go | 16 +- ngap/ie_stmsi.go | 12 +- ngap/ie_table.go | 401 +- ngap/ie_tnl.go | 198 +- ngap/ie_tnl_test.go | 74 +- ngap/ie_transport_test.go | 36 +- ngap/ie_ue.go | 423 +- ngap/ies.go | 190 +- ngap/ies_test.go | 27 +- ngap/initial_context_setup.go | 355 +- ngap/initial_context_setup_test.go | 32 +- ngap/interworking_cause_names_test.go | 8 +- ngap/location_report.go | 330 +- ngap/location_report_test.go | 85 +- ngap/names_test.go | 2 +- ngap/nas_non_delivery.go | 36 +- ngap/nas_non_delivery_test.go | 22 +- ngap/nas_transport.go | 265 +- ngap/nas_transport_test.go | 206 +- ngap/ng_reset.go | 111 +- ngap/ng_reset_test.go | 65 +- ngap/ng_setup.go | 52 +- ngap/ng_setup_failure.go | 45 +- ngap/ng_setup_failure_test.go | 10 +- ngap/ng_setup_resp.go | 68 +- ngap/ng_setup_test.go | 25 +- ngap/not_comprehended_test.go | 104 +- ngap/nrppa_transport.go | 52 +- ngap/overload.go | 110 +- ngap/paging.go | 226 +- ngap/paging_test.go | 109 +- ngap/path_switch.go | 276 +- ngap/path_switch_test.go | 43 +- ngap/pdu.go | 98 +- ngap/pdu_session_resource_modify.go | 274 +- .../pdu_session_resource_modify_indication.go | 170 +- ...session_resource_modify_indication_test.go | 23 +- ngap/pdu_session_resource_modify_test.go | 41 +- ngap/pdu_session_resource_notify.go | 90 +- ngap/pdu_session_resource_notify_test.go | 7 +- ngap/pdu_session_resource_release.go | 127 +- ngap/pdu_session_resource_release_test.go | 27 +- ngap/pdu_session_resource_setup.go | 296 +- ngap/pdu_session_resource_setup_test.go | 41 +- ngap/per_gen.go | 51789 ++++++++++++++-- ngap/per_gen_test.go | 44 + ngap/per_leaf.go | 600 +- ngap/per_test_helpers_test.go | 56 + ngap/pws.go | 256 +- ngap/pws_overload_test.go | 126 +- ngap/ran_config_update.go | 92 +- ngap/ran_config_update_test.go | 19 +- ngap/raw_pdu.go | 107 +- ngap/raw_pdu_test.go | 45 +- ngap/raw_pdu_ue_ids.go | 2 +- ngap/raw_pdu_ue_ids_test.go | 11 +- ngap/reroute_nas.go | 76 +- ngap/reset_extensions_test.go | 18 +- ngap/status_transfer.go | 56 +- ngap/symmetry_test.go | 491 - ngap/table_order_test.go | 192 +- ngap/testdata/asn1/NGAP-CommonDataTypes.asn | 32 + ngap/testdata/asn1/NGAP-Constants.asn | 749 + ngap/testdata/asn1/NGAP-Containers.asn | 198 + ngap/testdata/asn1/NGAP-IEs.asn | 8704 +++ ngap/testdata/asn1/NGAP-PDU-Contents.asn | 4026 ++ ngap/testdata/asn1/NGAP-PDU-Descriptions.asn | 1012 + ngap/tnl_lossless_test.go | 172 +- ngap/trace.go | 161 +- ngap/trace_test.go | 61 +- ngap/transparent_container.go | 333 +- ngap/transparent_container_test.go | 79 +- ngap/transport_address_test.go | 42 +- ngap/typing_test.go | 4 +- ngap/ue_context_modification.go | 216 +- ngap/ue_context_modification_test.go | 15 +- ngap/ue_context_release.go | 259 +- ngap/ue_context_release_test.go | 66 +- ngap/ue_ids.go | 4 +- ngap/ue_radio_capability.go | 42 +- ngap/ue_radio_capability_test.go | 12 +- ngap/ue_tnla_binding_release.go | 20 +- ngap/ue_tnla_binding_release_test.go | 2 +- ngap/unknown_ie_test.go | 68 +- ngap/wire_criticality_test.go | 36 +- per/ap/container.go | 201 + per/ap/criticality.go | 42 + per/ap/diagnostics.go | 267 + per/ap/errors.go | 33 + per/ap/message_equal_test.go | 42 + per/ap/pdu.go | 116 + per/ap/preserved.go | 142 + per/ap/profile.go | 59 + per/ap/raw.go | 408 + .../protocolie_test.go => ap/raw_test.go} | 155 +- per/ap/table.go | 352 + per/ap/table_test.go | 461 + per/ap/transport_layer_address.go | 154 + per/ap/transport_layer_address_test.go | 298 + per/asn1spec/ast.go | 429 + per/asn1spec/parser.go | 979 + per/asn1spec/parser_test.go | 532 + per/asn1spec/scanner.go | 436 + per/asn1spec/spec.go | 493 + per/asn1spec/spec_test.go | 190 + per/cmd/pergen/flags.go | 59 + per/cmd/pergen/flags_test.go | 87 + {cmd => per/cmd}/pergen/main.go | 12 +- per/enumerated.go | 72 + per/errors.go | 3 +- per/extension.go | 50 +- per/extension_test.go | 46 +- .../conformance/ngap/ngap_test_types.go | 2 +- per/internal/conformance/ngap/per_gen.go | 12 +- .../conformance/rrc/rrc_test_types.go | 2 +- per/pergen/ap_test.go | 118 + {cmd => per}/pergen/emit.go | 209 +- per/pergen/emit_ap.go | 459 + {cmd => per}/pergen/emit_choice.go | 168 +- per/pergen/emit_equal.go | 320 + {cmd => per}/pergen/emit_struct.go | 128 +- {cmd => per}/pergen/emit_struct_test.go | 2 +- per/pergen/gen.go | 402 + per/pergen/load.go | 133 + per/pergen/names_test.go | 45 + {cmd => per}/pergen/tag.go | 68 +- {cmd => per}/pergen/tag_test.go | 2 +- per/pergen/testdata/ap/fixture.go | 42 + .../testdata/apbad/choiceraw/fixture.go | 26 + per/pergen/testdata/apbad/equalref/fixture.go | 27 + per/pergen/testdata/apbad/extseq/fixture.go | 21 + .../testdata/apbad/handtable/fixture.go | 21 + .../testdata/apbad/inlineenum/fixture.go | 21 + per/protocolie/protocolie.go | 376 - s1ap/abstract_syntax_test.go | 60 +- s1ap/cause.go | 269 +- s1ap/cause_names.go | 150 +- s1ap/cause_test.go | 126 +- s1ap/cell_identity_test.go | 31 +- s1ap/common.go | 62 +- s1ap/comparable_test.go | 78 + s1ap/config_transfer.go | 73 +- s1ap/config_transfer_test.go | 75 +- s1ap/criticality_diagnostics.go | 120 +- s1ap/criticality_diagnostics_test.go | 4 +- s1ap/decode_total_test.go | 141 + s1ap/diagnose.go | 28 + s1ap/diagnostics_bound_test.go | 8 +- s1ap/enb_config_update.go | 68 +- s1ap/enb_config_update_test.go | 8 +- s1ap/encode_golden_test.go | 38 +- s1ap/enum_encode_test.go | 313 +- s1ap/enum_extension_test.go | 62 +- s1ap/enum_names.go | 265 +- s1ap/enum_names_test.go | 42 +- s1ap/equal_test.go | 125 + s1ap/erab_lists.go | 2 +- s1ap/erab_modification.go | 134 +- s1ap/erab_modification_test.go | 23 +- s1ap/erab_modify.go | 134 +- s1ap/erab_release.go | 154 +- s1ap/erab_release_test.go | 10 +- s1ap/erab_setup.go | 130 +- s1ap/erab_setup_test.go | 8 +- s1ap/error_indication.go | 44 +- s1ap/error_indication_test.go | 8 +- s1ap/errors.go | 119 +- s1ap/extension_criticality_test.go | 107 +- s1ap/extension_typing_test.go | 278 + s1ap/handover_cancel.go | 56 +- s1ap/handover_cancel_test.go | 4 +- s1ap/handover_notify.go | 52 +- s1ap/handover_preparation.go | 174 +- s1ap/handover_preparation_test.go | 119 +- s1ap/handover_resource_allocation.go | 210 +- s1ap/handover_resource_allocation_test.go | 85 +- s1ap/ie_common.go | 31 +- s1ap/ie_erab.go | 206 +- s1ap/ie_erab_test.go | 5 +- s1ap/ie_extension_types.go | 693 + s1ap/ie_extensions.go | 153 - s1ap/ie_gummei.go | 15 +- s1ap/ie_handover.go | 291 +- s1ap/ie_ids.go | 50 + s1ap/ie_names.go | 50 + s1ap/ie_pws.go | 278 +- s1ap/ie_ran_node.go | 150 +- s1ap/ie_ran_node_test.go | 56 +- s1ap/ie_setup.go | 11 +- s1ap/ie_stmsi.go | 10 +- s1ap/ie_table.go | 401 +- s1ap/ie_ue.go | 163 +- s1ap/ies.go | 191 +- s1ap/ies_test.go | 27 +- s1ap/initial_context_setup.go | 184 +- s1ap/initial_context_setup_test.go | 31 +- s1ap/interworking_cause_names_test.go | 8 +- s1ap/location_report.go | 53 +- s1ap/location_report_test.go | 8 +- s1ap/lppa_transport.go | 52 +- s1ap/lppa_transport_test.go | 15 +- s1ap/mme_config_update.go | 68 +- s1ap/mme_config_update_test.go | 4 +- s1ap/names_test.go | 18 +- s1ap/nas_non_delivery.go | 36 +- s1ap/nas_non_delivery_test.go | 22 +- s1ap/nas_transport.go | 218 +- s1ap/nas_transport_test.go | 16 +- s1ap/overload.go | 90 +- s1ap/paging.go | 202 +- s1ap/paging_test.go | 103 +- s1ap/parsers.go | 3 + s1ap/path_switch.go | 214 +- s1ap/path_switch_test.go | 13 +- s1ap/pdu.go | 98 +- s1ap/per_gen.go | 13195 +++- s1ap/per_gen_test.go | 44 + s1ap/per_leaf.go | 487 +- s1ap/per_test_helpers_test.go | 33 + s1ap/procedure_criticality.go | 1 + s1ap/procedure_names.go | 1 + s1ap/pws.go | 288 +- s1ap/pws_overload_test.go | 102 +- s1ap/raw_pdu.go | 107 +- s1ap/raw_pdu_registry_test.go | 34 +- s1ap/raw_pdu_test.go | 45 +- s1ap/raw_pdu_ue_ids.go | 2 +- s1ap/raw_pdu_ue_ids_test.go | 13 +- s1ap/rel19_test.go | 242 + s1ap/reroute_nas.go | 60 +- s1ap/reset.go | 137 +- s1ap/reset_extensions_test.go | 29 +- s1ap/reset_test.go | 34 +- s1ap/s1_removal.go | 156 + s1ap/s1_setup.go | 44 +- s1ap/s1_setup_failure.go | 45 +- s1ap/s1_setup_failure_test.go | 8 +- s1ap/s1_setup_resp.go | 44 +- s1ap/s1_setup_test.go | 20 +- s1ap/status_transfer.go | 56 +- s1ap/table_order_test.go | 40 +- s1ap/testdata/asn1/S1AP-CommonDataTypes.asn | 32 + s1ap/testdata/asn1/S1AP-Constants.asn | 514 + s1ap/testdata/asn1/S1AP-Containers.asn | 196 + s1ap/testdata/asn1/S1AP-IEs.asn | 3388 + s1ap/testdata/asn1/S1AP-PDU-Contents.asn | 3415 + s1ap/testdata/asn1/S1AP-PDU-Descriptions.asn | 789 + s1ap/testdata/asn1/SonTransfer-IEs.asn | 329 + s1ap/tnl_lossless_test.go | 156 +- s1ap/trace.go | 152 +- s1ap/trace_test.go | 18 +- s1ap/transparent_container.go | 346 +- s1ap/transparent_container_test.go | 67 +- s1ap/transport_address_test.go | 42 +- s1ap/typed_extension_vectors_test.go | 324 + s1ap/typing_test.go | 4 +- s1ap/ue_ambr_test.go | 54 + s1ap/ue_capability.go | 36 +- s1ap/ue_capability_test.go | 12 +- s1ap/ue_context_modification.go | 100 +- s1ap/ue_context_modification_test.go | 4 +- s1ap/ue_context_release.go | 238 +- s1ap/ue_context_release_test.go | 30 +- s1ap/ue_ids.go | 4 +- s1ap/unknown_ie_test.go | 57 +- s1ap/wire_criticality_test.go | 18 +- 619 files changed, 115119 insertions(+), 24679 deletions(-) delete mode 100644 cmd/pergen/doc.go delete mode 100644 cmd/pergen/flags.go delete mode 100644 cmd/pergen/flags_test.go delete mode 100644 cmd/pergen/gen.go delete mode 100644 cmd/pergen/load.go delete mode 100644 internal/models/transport_layer_address.go delete mode 100644 internal/models/transport_layer_address_test.go delete mode 100644 internal/smf/ngap/transport_layer_address.go delete mode 100644 internal/smf/ngap/transport_layer_address_test.go create mode 100644 ngap/asn1_spec_test.go create mode 100644 ngap/bit_string.go create mode 100644 ngap/choice_index_test.go create mode 100644 ngap/comparable_test.go create mode 100644 ngap/coverage_cases_test.go create mode 100644 ngap/coverage_test.go create mode 100644 ngap/decode_total_test.go create mode 100644 ngap/enum_all_test.go create mode 100644 ngap/equal_test.go create mode 100644 ngap/ie_ext_types.go create mode 100644 ngap/per_gen_test.go delete mode 100644 ngap/symmetry_test.go create mode 100644 ngap/testdata/asn1/NGAP-CommonDataTypes.asn create mode 100644 ngap/testdata/asn1/NGAP-Constants.asn create mode 100644 ngap/testdata/asn1/NGAP-Containers.asn create mode 100644 ngap/testdata/asn1/NGAP-IEs.asn create mode 100644 ngap/testdata/asn1/NGAP-PDU-Contents.asn create mode 100644 ngap/testdata/asn1/NGAP-PDU-Descriptions.asn create mode 100644 per/ap/container.go create mode 100644 per/ap/criticality.go create mode 100644 per/ap/diagnostics.go create mode 100644 per/ap/errors.go create mode 100644 per/ap/message_equal_test.go create mode 100644 per/ap/pdu.go create mode 100644 per/ap/preserved.go create mode 100644 per/ap/profile.go create mode 100644 per/ap/raw.go rename per/{protocolie/protocolie_test.go => ap/raw_test.go} (67%) create mode 100644 per/ap/table.go create mode 100644 per/ap/table_test.go create mode 100644 per/ap/transport_layer_address.go create mode 100644 per/ap/transport_layer_address_test.go create mode 100644 per/asn1spec/ast.go create mode 100644 per/asn1spec/parser.go create mode 100644 per/asn1spec/parser_test.go create mode 100644 per/asn1spec/scanner.go create mode 100644 per/asn1spec/spec.go create mode 100644 per/asn1spec/spec_test.go create mode 100644 per/cmd/pergen/flags.go create mode 100644 per/cmd/pergen/flags_test.go rename {cmd => per/cmd}/pergen/main.go (70%) create mode 100644 per/enumerated.go create mode 100644 per/pergen/ap_test.go rename {cmd => per}/pergen/emit.go (69%) create mode 100644 per/pergen/emit_ap.go rename {cmd => per}/pergen/emit_choice.go (51%) create mode 100644 per/pergen/emit_equal.go rename {cmd => per}/pergen/emit_struct.go (86%) rename {cmd => per}/pergen/emit_struct_test.go (99%) create mode 100644 per/pergen/gen.go create mode 100644 per/pergen/load.go create mode 100644 per/pergen/names_test.go rename {cmd => per}/pergen/tag.go (86%) rename {cmd => per}/pergen/tag_test.go (99%) create mode 100644 per/pergen/testdata/ap/fixture.go create mode 100644 per/pergen/testdata/apbad/choiceraw/fixture.go create mode 100644 per/pergen/testdata/apbad/equalref/fixture.go create mode 100644 per/pergen/testdata/apbad/extseq/fixture.go create mode 100644 per/pergen/testdata/apbad/handtable/fixture.go create mode 100644 per/pergen/testdata/apbad/inlineenum/fixture.go delete mode 100644 per/protocolie/protocolie.go create mode 100644 s1ap/comparable_test.go create mode 100644 s1ap/decode_total_test.go create mode 100644 s1ap/diagnose.go create mode 100644 s1ap/equal_test.go create mode 100644 s1ap/extension_typing_test.go create mode 100644 s1ap/ie_extension_types.go delete mode 100644 s1ap/ie_extensions.go create mode 100644 s1ap/per_gen_test.go create mode 100644 s1ap/rel19_test.go create mode 100644 s1ap/s1_removal.go create mode 100644 s1ap/testdata/asn1/S1AP-CommonDataTypes.asn create mode 100644 s1ap/testdata/asn1/S1AP-Constants.asn create mode 100644 s1ap/testdata/asn1/S1AP-Containers.asn create mode 100644 s1ap/testdata/asn1/S1AP-IEs.asn create mode 100644 s1ap/testdata/asn1/S1AP-PDU-Contents.asn create mode 100644 s1ap/testdata/asn1/S1AP-PDU-Descriptions.asn create mode 100644 s1ap/testdata/asn1/SonTransfer-IEs.asn create mode 100644 s1ap/typed_extension_vectors_test.go create mode 100644 s1ap/ue_ambr_test.go diff --git a/cmd/pergen/doc.go b/cmd/pergen/doc.go deleted file mode 100644 index 8d55ec9c60..0000000000 --- a/cmd/pergen/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -// Command pergen generates reflection-free PER marshal/unmarshal methods for -// types declared with `per:` struct tags. It is invoked via go:generate: -// -// //go:generate go run github.com/ellanetworks/core/cmd/pergen -package main diff --git a/cmd/pergen/flags.go b/cmd/pergen/flags.go deleted file mode 100644 index 7633b3ec60..0000000000 --- a/cmd/pergen/flags.go +++ /dev/null @@ -1,60 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package main - -import ( - "flag" - "strings" -) - -type Config struct { - patterns []string - output string - // types restricts generation to the named types; empty means all. - types []string - suffix string -} - -func parseFlags(args []string) (Config, error) { - cfg := Config{output: "per_gen.go"} - fs := flag.NewFlagSet("pergen", flag.ContinueOnError) - fs.StringVar(&cfg.output, "o", "per_gen.go", "output file path") - fs.Var(commaSliceFlag{&cfg.types}, "type", "comma-separated list of types") - fs.StringVar(&cfg.suffix, "suffix", "", "method name suffix") - - if err := fs.Parse(args); err != nil { - return cfg, err - } - - rest := fs.Args() - if len(rest) == 0 { - cfg.patterns = []string{"."} - } else { - cfg.patterns = rest - } - - return cfg, nil -} - -type commaSliceFlag struct { - p *[]string -} - -func (f commaSliceFlag) String() string { - if f.p == nil || *f.p == nil { - return "" - } - - return strings.Join(*f.p, ",") -} - -func (f commaSliceFlag) Set(s string) error { - if s == "" { - return nil - } - - *f.p = strings.Split(s, ",") - - return nil -} diff --git a/cmd/pergen/flags_test.go b/cmd/pergen/flags_test.go deleted file mode 100644 index 371b89d309..0000000000 --- a/cmd/pergen/flags_test.go +++ /dev/null @@ -1,150 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package main - -import ( - "testing" -) - -func TestParseFlagsDefaults(t *testing.T) { - t.Parallel() - - cfg, err := parseFlags([]string{}) - if err != nil { - t.Fatal(err) - } - - if cfg.output != "per_gen.go" { - t.Fatalf("output = %q", cfg.output) - } - - if len(cfg.patterns) != 1 || cfg.patterns[0] != "." { - t.Fatalf("patterns = %v", cfg.patterns) - } - - if len(cfg.types) != 0 { - t.Fatalf("types = %v", cfg.types) - } -} - -func TestParseFlagsAll(t *testing.T) { - t.Parallel() - - cfg, err := parseFlags([]string{"-o", "gen.go", "-type", "A,B", "-suffix", "X", "./pkg"}) - if err != nil { - t.Fatal(err) - } - - if cfg.output != "gen.go" { - t.Fatalf("output = %q", cfg.output) - } - - if len(cfg.types) != 2 || cfg.types[0] != "A" || cfg.types[1] != "B" { - t.Fatalf("types = %v", cfg.types) - } - - if cfg.suffix != "X" { - t.Fatalf("suffix = %q", cfg.suffix) - } - - if len(cfg.patterns) != 1 || cfg.patterns[0] != "./pkg" { - t.Fatalf("patterns = %v", cfg.patterns) - } -} - -func TestParseFlagsMultiplePatterns(t *testing.T) { - t.Parallel() - - cfg, err := parseFlags([]string{"./pkg1", "./pkg2"}) - if err != nil { - t.Fatal(err) - } - - if len(cfg.patterns) != 2 { - t.Fatalf("patterns = %v", cfg.patterns) - } -} - -func TestParseFlagsTypeEmpty(t *testing.T) { - t.Parallel() - - cfg, err := parseFlags([]string{"-type", ""}) - if err != nil { - t.Fatal(err) - } - - if len(cfg.types) != 0 { - t.Fatalf("types = %v", cfg.types) - } -} - -func TestReceiverName(t *testing.T) { - t.Parallel() - - cases := []struct { - in, want string - }{ - {"Message", "message"}, - {"Foo", "foo"}, - {"", "v"}, - {"ABC", "aBC"}, - } - - for _, c := range cases { - if got := receiverName(c.in); got != c.want { - t.Errorf("receiverName(%q) = %q, want %q", c.in, got, c.want) - } - } -} - -func TestStructTagGet(t *testing.T) { - t.Parallel() - - cases := []struct { - tag, key, want string - }{ - {`per:"INTEGER,range:0..3" json:"version"`, "per", "INTEGER,range:0..3"}, - {`json:"version" per:"optional"`, "per", "optional"}, - {`json:"version"`, "per", ""}, - {``, "per", ""}, - {`per:""`, "per", ""}, - } - - for _, c := range cases { - if got := structTagGet(c.tag, c.key); got != c.want { - t.Errorf("structTagGet(%q, %q) = %q, want %q", c.tag, c.key, got, c.want) - } - } -} - -func TestCommaSliceFlag(t *testing.T) { - t.Parallel() - - var vals []string - - f := commaSliceFlag{&vals} - if f.String() != "" { - t.Fatalf("String() = %q", f.String()) - } - - if err := f.Set("A,B,C"); err != nil { - t.Fatal(err) - } - - if len(vals) != 3 || vals[0] != "A" || vals[2] != "C" { - t.Fatalf("vals = %v", vals) - } - - if f.String() != "A,B,C" { - t.Fatalf("String() = %q", f.String()) - } - - if err := f.Set(""); err != nil { - t.Fatal(err) - } - - if len(vals) != 3 { - t.Fatalf("vals after empty Set = %v", vals) - } -} diff --git a/cmd/pergen/gen.go b/cmd/pergen/gen.go deleted file mode 100644 index f8627e34be..0000000000 --- a/cmd/pergen/gen.go +++ /dev/null @@ -1,245 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package main - -import ( - "bytes" - "errors" - "fmt" - "go/types" - "path/filepath" - "slices" - "sort" - "strings" - - "golang.org/x/tools/go/packages" -) - -type generator struct { - cfg Config - buf bytes.Buffer - pkg *packages.Package - genTypes map[string]bool // types this run will emit methods for -} - -func newGenerator(cfg Config) *generator { - return &generator{cfg: cfg} -} - -func (g *generator) generate(pkgs []*packages.Package) error { - if len(pkgs) == 0 { - return errors.New("no packages to generate") - } - - for _, pkg := range pkgs { - if len(pkg.Errors) > 0 { - return fmt.Errorf("package %s has errors: %w", pkg.Name, pkg.Errors[0]) - } - - if err := g.generatePackage(pkg); err != nil { - return err - } - } - - return nil -} - -func (g *generator) generatePackage(pkg *packages.Package) error { - g.pkg = pkg - scope := pkg.Types.Scope() - // Sorted so the output is deterministic. - names := make([]string, 0, len(scope.Names())) - names = append(names, scope.Names()...) - sort.Strings(names) - - // First pass, so field classification can see which named types will - // implement MarshalPER before any method is emitted. - g.genTypes = make(map[string]bool) - - for _, name := range names { - obj := scope.Lookup(name) - if obj == nil { - continue - } - - nt, ok := obj.(*types.TypeName) - if !ok { - continue - } - - named, ok := nt.Type().(*types.Named) - if !ok { - continue - } - - underlying, ok := named.Underlying().(*types.Struct) - if !ok { - continue - } - - if structIsPER(underlying, named) || structIsExtSeq(underlying) { - g.genTypes[name] = true - } - } - - g.collectReferencedStructs(scope) - - found := false - - for _, name := range names { - if !g.genTypes[name] { - continue - } - - if !g.typeEnabled(name) { - continue - } - - obj := scope.Lookup(name) - nt := obj.(*types.TypeName) - named := nt.Type().(*types.Named) - underlying := named.Underlying().(*types.Struct) - - st, err := g.parseStruct(name, named, underlying) - if err != nil { - return err - } - - found = true - - if isChoiceType(st) { - if err := g.emitChoice(name, st); err != nil { - return err - } - } else { - if err := g.emitStruct(name, st); err != nil { - return err - } - } - } - - if !found { - return fmt.Errorf("no types with `per:` tags found in package %s", pkg.Name) - } - - return nil -} - -// collectReferencedStructs takes the transitive closure of genTypes over -// same-package struct types used as field types. -func (g *generator) collectReferencedStructs(scope *types.Scope) { - changed := true - for changed { - changed = false - - for name := range g.genTypes { - obj := scope.Lookup(name) - if obj == nil { - continue - } - - nt, ok := obj.(*types.TypeName) - if !ok { - continue - } - - named, ok := nt.Type().(*types.Named) - if !ok { - continue - } - - underlying, ok := named.Underlying().(*types.Struct) - if !ok { - continue - } - - for i := 0; i < underlying.NumFields(); i++ { - if tag := structTagGet(underlying.Tag(i), "per"); tag == "-" || strings.Contains(tag, "exttable:") { - continue - } - - ft := underlying.Field(i).Type() - if p, ok := ft.(*types.Pointer); ok { - ft = p.Elem() - } - - if s, ok := ft.(*types.Slice); ok { - ft = s.Elem() - } - - if n, ok := ft.(*types.Named); ok { - if n.Obj().Pkg() != g.pkg.Types { - continue - } - - // A hand-written MarshalPER is kept, so the closure does not - // emit a conflicting method. - if g.hasSourceMethod(n, "MarshalPER") { - continue - } - - if _, isStruct := n.Underlying().(*types.Struct); isStruct { - if !g.genTypes[n.Obj().Name()] { - g.genTypes[n.Obj().Name()] = true - changed = true - } - } - } - } - } - } -} - -// hasSourceMethod ignores methods declared in the output file, since this run -// replaces it. -func (g *generator) hasSourceMethod(named *types.Named, name string) bool { - for obj := range named.Methods() { - obj := obj - if obj.Name() != name { - continue - } - - pos := g.pkg.Fset.Position(obj.Pos()) - if filepath.Base(pos.Filename) != filepath.Base(g.cfg.output) { - return true - } - } - - return false -} - -// structIsPER reports whether any field carries a `per:` tag other than "-". -func structIsPER(s *types.Struct, _ *types.Named) bool { - for i := 0; i < s.NumFields(); i++ { - tag := structTagGet(s.Tag(i), "per") - if tag == "" || tag == "-" { - continue - } - - return true - } - - return false -} - -// structIsExtSeq admits a type whose only per: tag is `extseq`. -func structIsExtSeq(s *types.Struct) bool { - for i := 0; i < s.NumFields(); i++ { - tag := structTagGet(s.Tag(i), "per") - if tag == "extseq" { - return true - } - } - - return false -} - -// typeEnabled applies the -type filter; an empty filter enables every type. -func (g *generator) typeEnabled(name string) bool { - if len(g.cfg.types) == 0 { - return true - } - - return slices.Contains(g.cfg.types, name) -} diff --git a/cmd/pergen/load.go b/cmd/pergen/load.go deleted file mode 100644 index 3b8b510db6..0000000000 --- a/cmd/pergen/load.go +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package main - -import ( - "fmt" - "go/types" - "os" - "regexp" - - "golang.org/x/tools/go/packages" -) - -func loadPackages(patterns []string) ([]*packages.Package, error) { - cfg := &packages.Config{ - Mode: packages.NeedName | packages.NeedSyntax | packages.NeedTypes | packages.NeedTypesInfo | packages.NeedDeps, - } - - pkgs, err := packages.Load(cfg, patterns...) - if err != nil { - return nil, fmt.Errorf("load: %w", err) - } - - if len(pkgs) == 0 { - return nil, fmt.Errorf("no packages matched %v", patterns) - } - - var ( - firstErr error - tolerated int - ) - - for _, p := range pkgs { - kept := p.Errors[:0] - - for _, e := range p.Errors { - if pendingMethodError(p, e) { - tolerated++ - continue - } - - kept = append(kept, e) - - if firstErr == nil { - firstErr = e - } - } - - p.Errors = kept - } - - if firstErr != nil { - return pkgs, fmt.Errorf("package errors: %w", firstErr) - } - // A steady-state regeneration tolerates nothing, so the count is reported - // rather than swallowed. - if tolerated > 0 { - fmt.Fprintf(os.Stderr, "pergen: %d reference(s) to codec methods this run will generate\n", tolerated) - } - - return pkgs, nil -} - -// perMethodErrPatterns match the type-checker diagnostics for a reference to a -// codec method that does not exist yet, capturing the type it is missing from. -var perMethodErrPatterns = []*regexp.Regexp{ - regexp.MustCompile(`type \*?(\w+) has no field or method (?:Marshal|Unmarshal)PER`), - regexp.MustCompile(`\*?(\w+) does not implement per\.(?:Marshaler|Unmarshaler) \(missing method (?:Marshal|Unmarshal)PER\)`), -} - -// pendingMethodError also requires the named type to resolve locally: matching -// the message alone would swallow genuine errors mentioning those methods. -func pendingMethodError(pkg *packages.Package, e packages.Error) bool { - if pkg.Types == nil { - return false - } - - for _, re := range perMethodErrPatterns { - m := re.FindStringSubmatch(e.Msg) - if m == nil { - continue - } - - if obj, ok := pkg.Types.Scope().Lookup(m[1]).(*types.TypeName); ok && obj != nil { - return true - } - } - - return false -} diff --git a/go.mod b/go.mod index b7b824c262..8923a34c4f 100644 --- a/go.mod +++ b/go.mod @@ -47,7 +47,6 @@ require ( golang.org/x/net v0.62.0 golang.org/x/sync v0.25.0 golang.org/x/sys v0.49.0 - golang.org/x/tools v0.52.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -110,7 +109,6 @@ require ( go.opentelemetry.io/proto/otlp v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/mod v0.42.0 // indirect golang.org/x/text v0.43.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect diff --git a/go.sum b/go.sum index 3a2894d331..3a17faeacc 100644 --- a/go.sum +++ b/go.sum @@ -230,8 +230,6 @@ golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54= golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= @@ -254,8 +252,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= -golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= diff --git a/internal/amf/amf_ue.go b/internal/amf/amf_ue.go index f1f04ac350..551335ce47 100644 --- a/internal/amf/amf_ue.go +++ b/internal/amf/amf_ue.go @@ -288,7 +288,7 @@ func (a *AMF) AttachUeConn(ctx context.Context, ue *UeContext, ueConn *UeConn) { a.deactivateDisplacedUserPlane(ctx, ue, displaced) displaced.SendUEContextReleaseCommand(ctx, - ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) + ngap.CauseNASNormalRelease.Cause()) } a.clearPagingSuppression(ctx, ue) diff --git a/internal/amf/claim_ran_id_test.go b/internal/amf/claim_ran_id_test.go index 64f5901a76..10a567d44a 100644 --- a/internal/amf/claim_ran_id_test.go +++ b/internal/amf/claim_ran_id_test.go @@ -22,12 +22,7 @@ func gnbGlobalRANNodeID(t *testing.T, hexID string) ngap.GlobalRANNodeID { t.Fatalf("bad gNB id %q: %v", hexID, err) } - return ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, - PLMNIdentity: ngap.PLMNIdentity{0x02, 0xf8, 0x39}, - Value: uint32(v), - Bits: 24, - } + return ngap.NewGlobalGNBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, uint32(v), 24) } func gnbRanNodeID(t *testing.T, hexID string) models.GlobalRanNodeID { @@ -215,10 +210,10 @@ func TestClaimRanID_BitLengthIsPartOfTheIdentity(t *testing.T) { amfInstance := amf.New(nil, nil, nil) narrow := gnbGlobalRANNodeID(t, "00002A") - narrow.Bits = 22 + narrow.GlobalGNBID.GNBID.GNBID.Bits = 22 wide := gnbGlobalRANNodeID(t, "00002A") - wide.Bits = 24 + wide.GlobalGNBID.GNBID.GNBID.Bits = 24 first := claimGNB(t, amfInstance, "gNB-22bit", narrow) second := claimGNB(t, amfInstance, "gNB-24bit", wide) @@ -238,7 +233,7 @@ func TestClaimRanID_PLMNIsPartOfTheIdentity(t *testing.T) { home := gnbGlobalRANNodeID(t, "000102") visited := gnbGlobalRANNodeID(t, "000102") - visited.PLMNIdentity = ngap.PLMNIdentity{0x00, 0xf1, 0x10} + visited.GlobalGNBID.PLMNIdentity = ngap.PLMNIdentity{0x00, 0xf1, 0x10} first := claimGNB(t, amfInstance, "gNB-plmn-a", home) second := claimGNB(t, amfInstance, "gNB-plmn-b", visited) diff --git a/internal/amf/drain_internal_test.go b/internal/amf/drain_internal_test.go index 8c7afed814..6956f1824e 100644 --- a/internal/amf/drain_internal_test.go +++ b/internal/amf/drain_internal_test.go @@ -74,12 +74,7 @@ func trackPreSetupDrainTestRadio(a *AMF, conn NGAPWriter) *Radio { } func drainTestRanNodeID() ngap.GlobalRANNodeID { - return ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, - PLMNIdentity: ngap.PLMNIdentity{0x00, 0xf1, 0x10}, - Value: 0x000102, - Bits: 24, - } + return ngap.NewGlobalGNBID(ngap.PLMNIdentity{0x00, 0xf1, 0x10}, 0x000102, 24) } func parseAMFConfigUpdate(t *testing.T, pdu []byte) *ngap.AMFConfigurationUpdate { diff --git a/internal/amf/eps_cause_test.go b/internal/amf/eps_cause_test.go index 0a8579f653..04eaa3e3b9 100644 --- a/internal/amf/eps_cause_test.go +++ b/internal/amf/eps_cause_test.go @@ -15,31 +15,31 @@ func TestS1APHandoverCause(t *testing.T) { for _, tc := range []struct { name string in *ngap.Cause - want uint64 + want s1ap.CauseRadioNetwork }{ { name: "handover desirable for radio reasons", - in: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverDesirableForRadio}, + in: new(ngap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), want: s1ap.CauseRadioNetworkHandoverDesirableForRadio, }, { name: "time critical handover", - in: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTimeCriticalHandover}, + in: new(ngap.CauseRadioNetworkTimeCriticalHandover.Cause()), want: s1ap.CauseRadioNetworkTimeCriticalHandover, }, { name: "reduce load in serving cell", - in: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkReduceLoadInServingCell}, + in: new(ngap.CauseRadioNetworkReduceLoadInServingCell.Cause()), want: s1ap.CauseRadioNetworkReduceLoadInServingCell, }, { name: "any other radio network value", - in: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + in: new(ngap.CauseRadioNetworkUnspecified.Cause()), want: s1ap.CauseRadioNetworkResourceOptimisationHandover, }, { name: "any other group", - in: &ngap.Cause{Group: ngap.CauseGroupMisc}, + in: new(ngap.CauseMiscUnspecified.Cause()), want: s1ap.CauseRadioNetworkResourceOptimisationHandover, }, { @@ -51,7 +51,7 @@ func TestS1APHandoverCause(t *testing.T) { t.Run(tc.name, func(t *testing.T) { got := amf.S1APHandoverCause(tc.in) - if got.Group != s1ap.CauseGroupRadioNetwork || uint64(got.Value) != tc.want { + if got.RadioNetwork == nil || *got.RadioNetwork != tc.want { t.Errorf("cause = %+v, want radio network %d", got, tc.want) } }) @@ -66,32 +66,32 @@ func TestNGAPHandoverCause(t *testing.T) { }{ { name: "time critical", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkTimeCriticalHandover}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTimeCriticalHandover}, + in: s1ap.CauseRadioNetworkTimeCriticalHandover.Cause(), + want: ngap.CauseRadioNetworkTimeCriticalHandover.Cause(), }, { name: "resource optimisation", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkResourceOptimisationHandover}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkResourceOptimisationHandover}, + in: s1ap.CauseRadioNetworkResourceOptimisationHandover.Cause(), + want: ngap.CauseRadioNetworkResourceOptimisationHandover.Cause(), }, { name: "reduce load", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkReduceLoadInServingCell}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkReduceLoadInServingCell}, + in: s1ap.CauseRadioNetworkReduceLoadInServingCell.Cause(), + want: ngap.CauseRadioNetworkReduceLoadInServingCell.Cause(), }, { name: "another radio cause", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnspecified}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverDesirableForRadio}, + in: s1ap.CauseRadioNetworkUnspecified.Cause(), + want: ngap.CauseRadioNetworkHandoverDesirableForRadio.Cause(), }, { name: "another group", - in: s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 0}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverDesirableForRadio}, + in: s1ap.CauseMiscControlProcessingOverload.Cause(), + want: ngap.CauseRadioNetworkHandoverDesirableForRadio.Cause(), }, } { t.Run(tc.name, func(t *testing.T) { - if got := amf.NGAPHandoverCause(tc.in); got != tc.want { + if got := amf.NGAPHandoverCause(tc.in); !got.Equal(tc.want) { t.Errorf("cause = %+v, want %+v", got, tc.want) } }) @@ -106,42 +106,42 @@ func TestS1APHandoverFailureCause(t *testing.T) { }{ { name: "no radio resources in the target cell", - in: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell}, - want: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell}, + in: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(), + want: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(), }, { name: "algorithms not supported", - in: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported}, - want: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported}, + in: ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause(), + want: s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause(), }, { name: "insufficient UE capabilities", - in: ngap.CauseInsufficientUECapabilities, - want: s1ap.CauseInsufficientUECapabilities, + in: ngap.CauseRadioNetworkInsufficientUECapabilities.Cause(), + want: s1ap.CauseRadioNetworkInsufficientUECapabilities.Cause(), }, { name: "O&M intervention", - in: ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscOMIntervention}, - want: s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscOMIntervention}, + in: ngap.CauseMiscOMIntervention.Cause(), + want: s1ap.CauseMiscOMIntervention.Cause(), }, { name: "handover target not allowed", - in: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHoTargetNotAllowed}, - want: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed}, + in: ngap.CauseRadioNetworkHoTargetNotAllowed.Cause(), + want: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause(), }, { name: "another radio cause", - in: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, - want: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOFailureInTarget}, + in: ngap.CauseRadioNetworkUnspecified.Cause(), + want: s1ap.CauseRadioNetworkHOFailureInTarget.Cause(), }, { name: "another misc cause", - in: ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnspecified}, - want: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOFailureInTarget}, + in: ngap.CauseMiscUnspecified.Cause(), + want: s1ap.CauseRadioNetworkHOFailureInTarget.Cause(), }, } { t.Run(tc.name, func(t *testing.T) { - if got := amf.S1APHandoverFailureCause(tc.in); got != tc.want { + if got := amf.S1APHandoverFailureCause(tc.in); !got.Equal(tc.want) { t.Errorf("cause = %+v, want %+v", got, tc.want) } }) @@ -156,42 +156,42 @@ func TestNGAPHandoverFailureCause(t *testing.T) { }{ { name: "no radio resources in the target cell", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell}, + in: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(), + want: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(), }, { name: "algorithms not supported", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported}, + in: s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause(), + want: ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause(), }, { name: "insufficient UE capabilities", - in: s1ap.CauseInsufficientUECapabilities, - want: ngap.CauseInsufficientUECapabilities, + in: s1ap.CauseRadioNetworkInsufficientUECapabilities.Cause(), + want: ngap.CauseRadioNetworkInsufficientUECapabilities.Cause(), }, { name: "O&M intervention", - in: s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscOMIntervention}, - want: ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscOMIntervention}, + in: s1ap.CauseMiscOMIntervention.Cause(), + want: ngap.CauseMiscOMIntervention.Cause(), }, { name: "handover target not allowed", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHoTargetNotAllowed}, + in: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause(), + want: ngap.CauseRadioNetworkHoTargetNotAllowed.Cause(), }, { name: "another radio cause", - in: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnspecified}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + in: s1ap.CauseRadioNetworkUnspecified.Cause(), + want: ngap.CauseRadioNetworkHOFailureInTarget.Cause(), }, { name: "a transport cause", - in: s1ap.Cause{Group: s1ap.CauseGroupTransport, Value: s1ap.CauseTransportResourceUnavailable}, - want: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + in: s1ap.CauseTransportResourceUnavailable.Cause(), + want: ngap.CauseRadioNetworkHOFailureInTarget.Cause(), }, } { t.Run(tc.name, func(t *testing.T) { - if got := amf.NGAPHandoverFailureCause(tc.in); got != tc.want { + if got := amf.NGAPHandoverFailureCause(tc.in); !got.Equal(tc.want) { t.Errorf("cause = %+v, want %+v", got, tc.want) } }) diff --git a/internal/amf/eps_registration.go b/internal/amf/eps_registration.go index ed2b0dd876..d8b4640d05 100644 --- a/internal/amf/eps_registration.go +++ b/internal/amf/eps_registration.go @@ -15,7 +15,7 @@ import ( // deregisterToEPS is the NGAP cause carried by the UE Context Release Command of a UE // that left 5GS other than by handover: the release follows the AMF dropping the UE's // 5GS registration (TS 38.413 §9.3.1.2, NAS cause "Deregister"). -var deregisterToEPS = ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASDeregister} +var deregisterToEPS = ngap.CauseNASDeregister.Cause() // releaseToEPS gives a UE up to EPS. Its 5GS registration, PDU sessions and key-chain // procedures go; its 5G-GUTI and 5G security context stay, so a return to 5GS reuses them diff --git a/internal/amf/eps_relocation.go b/internal/amf/eps_relocation.go index 2d5a8994d9..1752fa053c 100644 --- a/internal/amf/eps_relocation.go +++ b/internal/amf/eps_relocation.go @@ -63,13 +63,9 @@ func (ue *UeContext) transferableEPSSessions(include func(pduSessionID uint8) bo } func ENBIdentityFromNGAP(target ngap.TargeteNBID) (interworking.ENBIdentity, error) { - bits, ok := map[ngap.NgENBIDKind]uint8{ - ngap.NgENBIDMacro: 20, - ngap.NgENBIDShortMacro: 18, - ngap.NgENBIDLongMacro: 21, - }[target.GlobalENBID.NgENBID.Kind] + id, bits, ok := target.GlobalENBID.NgENBID.ID() if !ok { - return interworking.ENBIdentity{}, fmt.Errorf("amf: unknown ng-eNB identity kind %d", target.GlobalENBID.NgENBID.Kind) + return interworking.ENBIdentity{}, fmt.Errorf("amf: unsupported ng-eNB identity alternative") } plmn, err := util.PLMNToModels(target.GlobalENBID.PLMNIdentity) @@ -84,8 +80,8 @@ func ENBIdentityFromNGAP(target ngap.TargeteNBID) (interworking.ENBIdentity, err return interworking.ENBIdentity{ PlmnID: plmn, - ID: target.GlobalENBID.NgENBID.Value, - Bits: bits, + ID: id, + Bits: uint8(bits), SelectedEPSTAI: interworking.EPSTAI{ PlmnID: taiPlmn, TAC: uint16(target.SelectedEPSTAI.TAC), @@ -128,80 +124,78 @@ func (ue *UeContext) BuildForwardRelocationRequest(target interworking.ENBIdenti } func S1APHandoverFailureCause(cause ngap.Cause) s1ap.Cause { - if cause == ngap.CauseInsufficientUECapabilities { - return s1ap.CauseInsufficientUECapabilities + if cause.RadioNetwork != nil && *cause.RadioNetwork == ngap.CauseRadioNetworkInsufficientUECapabilities { + return s1ap.CauseRadioNetworkInsufficientUECapabilities.Cause() } - switch cause.Group { - case ngap.CauseGroupRadioNetwork: - switch cause.Value { + switch { + case cause.RadioNetwork != nil: + switch *cause.RadioNetwork { case ngap.CauseRadioNetworkNoRadioResourcesInTargetCell: - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell} + return s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause() case ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported: - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported} + return s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause() case ngap.CauseRadioNetworkHoTargetNotAllowed: - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed} + return s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause() } - case ngap.CauseGroupMisc: - if cause.Value == ngap.CauseMiscOMIntervention { - return s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscOMIntervention} + case cause.Misc != nil: + if *cause.Misc == ngap.CauseMiscOMIntervention { + return s1ap.CauseMiscOMIntervention.Cause() } } - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOFailureInTarget} + return s1ap.CauseRadioNetworkHOFailureInTarget.Cause() } func NGAPHandoverFailureCause(cause s1ap.Cause) ngap.Cause { - if cause == s1ap.CauseInsufficientUECapabilities { - return ngap.CauseInsufficientUECapabilities - } - - switch cause.Group { - case s1ap.CauseGroupRadioNetwork: - switch cause.Value { + switch { + case cause.RadioNetwork != nil: + switch *cause.RadioNetwork { + case s1ap.CauseRadioNetworkInsufficientUECapabilities: + return ngap.CauseRadioNetworkInsufficientUECapabilities.Cause() case s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell: - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell} + return ngap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause() case s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported: - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported} + return ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause() case s1ap.CauseRadioNetworkHOTargetNotAllowed: - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHoTargetNotAllowed} + return ngap.CauseRadioNetworkHoTargetNotAllowed.Cause() } - case s1ap.CauseGroupMisc: - if cause.Value == s1ap.CauseMiscOMIntervention { - return ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscOMIntervention} + case cause.Misc != nil: + if *cause.Misc == s1ap.CauseMiscOMIntervention { + return ngap.CauseMiscOMIntervention.Cause() } } - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget} + return ngap.CauseRadioNetworkHOFailureInTarget.Cause() } func NGAPHandoverCause(cause s1ap.Cause) ngap.Cause { - if cause.Group == s1ap.CauseGroupRadioNetwork { - switch cause.Value { + if cause.RadioNetwork != nil { + switch *cause.RadioNetwork { case s1ap.CauseRadioNetworkTimeCriticalHandover: - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTimeCriticalHandover} + return ngap.CauseRadioNetworkTimeCriticalHandover.Cause() case s1ap.CauseRadioNetworkResourceOptimisationHandover: - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkResourceOptimisationHandover} + return ngap.CauseRadioNetworkResourceOptimisationHandover.Cause() case s1ap.CauseRadioNetworkReduceLoadInServingCell: - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkReduceLoadInServingCell} + return ngap.CauseRadioNetworkReduceLoadInServingCell.Cause() } } - return ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverDesirableForRadio} + return ngap.CauseRadioNetworkHandoverDesirableForRadio.Cause() } // TS 29.010 §7.2, TS 29.274 §8.49 func S1APHandoverCause(cause *ngap.Cause) s1ap.Cause { - if cause != nil && cause.Group == ngap.CauseGroupRadioNetwork { - switch cause.Value { + if cause != nil && cause.RadioNetwork != nil { + switch *cause.RadioNetwork { case ngap.CauseRadioNetworkHandoverDesirableForRadio: - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHandoverDesirableForRadio} + return s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause() case ngap.CauseRadioNetworkTimeCriticalHandover: - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkTimeCriticalHandover} + return s1ap.CauseRadioNetworkTimeCriticalHandover.Cause() case ngap.CauseRadioNetworkReduceLoadInServingCell: - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkReduceLoadInServingCell} + return s1ap.CauseRadioNetworkReduceLoadInServingCell.Cause() } } - return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkResourceOptimisationHandover} + return s1ap.CauseRadioNetworkResourceOptimisationHandover.Cause() } diff --git a/internal/amf/eps_relocation_test.go b/internal/amf/eps_relocation_test.go index 1b169b60f6..7f1cc951ff 100644 --- a/internal/amf/eps_relocation_test.go +++ b/internal/amf/eps_relocation_test.go @@ -260,7 +260,7 @@ func TestENBIdentityFromNGAP(t *testing.T) { got, err := amf.ENBIdentityFromNGAP(ngap.TargeteNBID{ GlobalENBID: ngap.GlobalNgENBID{ PLMNIdentity: plmn, - NgENBID: ngap.NgENBID{Kind: ngap.NgENBIDMacro, Value: 0x1234}, + NgENBID: ngap.NgENBID{MacroNgENBID: new(ngap.MacroNgENBID(0x1234))}, }, SelectedEPSTAI: ngap.EPSTAI{PLMNIdentity: sharedPLMN, TAC: 7}, }) @@ -283,7 +283,7 @@ func TestENBIdentityFromNGAP(t *testing.T) { func TestENBIdentityFromNGAPRejectsAnUnknownKind(t *testing.T) { if _, err := amf.ENBIdentityFromNGAP(ngap.TargeteNBID{ - GlobalENBID: ngap.GlobalNgENBID{NgENBID: ngap.NgENBID{Kind: 99}}, + GlobalENBID: ngap.GlobalNgENBID{NgENBID: ngap.NgENBID{ChoiceExtension: &ngap.SingleContainer{ID: 99}}}, }); err == nil { t.Fatal("an unknown ng-eNB identity kind must be refused") } diff --git a/internal/amf/fivegs_relocation.go b/internal/amf/fivegs_relocation.go index b29ba0dcb1..085e27db7a 100644 --- a/internal/amf/fivegs_relocation.go +++ b/internal/amf/fivegs_relocation.go @@ -32,12 +32,15 @@ var ( ) var ( - causeRelocationExpiry = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTNGRelocOverallExpiry} - causeRelocationCancelled = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverCancelled} + causeRelocationExpiry = ngap.CauseRadioNetworkTNGRelocOverallExpiry.Cause() + causeRelocationCancelled = ngap.CauseRadioNetworkHandoverCancelled.Cause() ) func NGRANIdentityToNGAP(target interworking.NGRANIdentity) (ngap.GlobalRANNodeID, error) { - var kind ngap.RANNodeIDKind + plmn, err := util.PLMNToNGAP(target.PlmnID) + if err != nil { + return ngap.GlobalRANNodeID{}, err + } switch target.Kind { case interworking.NGRANNodeGNB: @@ -45,33 +48,17 @@ func NGRANIdentityToNGAP(target interworking.NGRANIdentity) (ngap.GlobalRANNodeI return ngap.GlobalRANNodeID{}, fmt.Errorf("amf: no gNB identity is %d bits wide", target.Bits) } - kind = ngap.RANNodeIDGNB + return ngap.NewGlobalGNBID(plmn, target.ID, int(target.Bits)), nil case interworking.NGRANNodeNgENB: - k, ok := map[uint8]ngap.RANNodeIDKind{ - 18: ngap.RANNodeIDShortMacroNgENB, - 20: ngap.RANNodeIDMacroNgENB, - 21: ngap.RANNodeIDLongMacroNgENB, - }[target.Bits] + id, ok := ngap.NgENBIDOfBits(target.ID, int(target.Bits)) if !ok { return ngap.GlobalRANNodeID{}, fmt.Errorf("amf: no ng-eNB identity is %d bits wide", target.Bits) } - kind = k + return ngap.NewGlobalNgENBID(plmn, id), nil default: return ngap.GlobalRANNodeID{}, fmt.Errorf("amf: unknown NG-RAN node kind %d", target.Kind) } - - plmn, err := util.PLMNToNGAP(target.PlmnID) - if err != nil { - return ngap.GlobalRANNodeID{}, err - } - - return ngap.GlobalRANNodeID{ - Kind: kind, - PLMNIdentity: plmn, - Value: target.ID, - Bits: int(target.Bits), - }, nil } func (a *AMF) ForwardRelocation(ctx context.Context, req interworking.FiveGSRelocationRequest) (interworking.FiveGSRelocationResponse, error) { @@ -120,10 +107,7 @@ func (a *AMF) ForwardRelocation(ctx context.Context, req interworking.FiveGSRelo } if !subscriberProfile.Allow5G { - return none, interworking.TargetRefusal{Cause: s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, - Value: s1ap.CauseRadioNetworkHOTargetNotAllowed, - }} + return none, interworking.TargetRefusal{Cause: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()} } snssaiList := subscriberProfile.AllowedNssai @@ -175,10 +159,7 @@ func (a *AMF) arrivingProfile(ctx context.Context, ue *UeContext, transferred mo if err := a.AdmitVisitor(ctx, ue); err != nil { var r *Rejection if errors.As(err, &r) { - return nil, fmt.Errorf("%w: %w", r, interworking.TargetRefusal{Cause: s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, - Value: s1ap.CauseRadioNetworkHOTargetNotAllowed, - }}) + return nil, fmt.Errorf("%w: %w", r, interworking.TargetRefusal{Cause: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()}) } return nil, fmt.Errorf("amf: admit the roaming visitor: %w", err) diff --git a/internal/amf/fivegs_relocation_test.go b/internal/amf/fivegs_relocation_test.go index c3ad97f000..7d8ef4baf7 100644 --- a/internal/amf/fivegs_relocation_test.go +++ b/internal/amf/fivegs_relocation_test.go @@ -29,22 +29,22 @@ func TestNGRANIdentityToNGAP(t *testing.T) { { name: "gNB", in: interworking.NGRANIdentity{Kind: interworking.NGRANNodeGNB, PlmnID: plmn, ID: 0x1a2b3c, Bits: 24}, - want: ngap.GlobalRANNodeID{Kind: ngap.RANNodeIDGNB, PLMNIdentity: encoded, Value: 0x1a2b3c, Bits: 24}, + want: ngap.NewGlobalGNBID(encoded, 0x1a2b3c, 24), }, { name: "short macro ng-eNB", in: interworking.NGRANIdentity{Kind: interworking.NGRANNodeNgENB, PlmnID: plmn, ID: 0x201, Bits: 18}, - want: ngap.GlobalRANNodeID{Kind: ngap.RANNodeIDShortMacroNgENB, PLMNIdentity: encoded, Value: 0x201, Bits: 18}, + want: ngap.NewGlobalNgENBID(encoded, ngap.NgENBID{ShortMacroNgENBID: new(ngap.ShortMacroNgENBID(0x201))}), }, { name: "macro ng-eNB", in: interworking.NGRANIdentity{Kind: interworking.NGRANNodeNgENB, PlmnID: plmn, ID: 0x201, Bits: 20}, - want: ngap.GlobalRANNodeID{Kind: ngap.RANNodeIDMacroNgENB, PLMNIdentity: encoded, Value: 0x201, Bits: 20}, + want: ngap.NewGlobalNgENBID(encoded, ngap.NgENBID{MacroNgENBID: new(ngap.MacroNgENBID(0x201))}), }, { name: "long macro ng-eNB", in: interworking.NGRANIdentity{Kind: interworking.NGRANNodeNgENB, PlmnID: plmn, ID: 0x201, Bits: 21}, - want: ngap.GlobalRANNodeID{Kind: ngap.RANNodeIDLongMacroNgENB, PLMNIdentity: encoded, Value: 0x201, Bits: 21}, + want: ngap.NewGlobalNgENBID(encoded, ngap.NgENBID{LongMacroNgENBID: new(ngap.LongMacroNgENBID(0x201))}), }, } { t.Run(tc.name, func(t *testing.T) { @@ -53,7 +53,7 @@ func TestNGRANIdentityToNGAP(t *testing.T) { t.Fatalf("NGRANIdentityToNGAP: %v", err) } - if got != tc.want { + if !got.Equal(tc.want) { t.Fatalf("node id = %+v, want %+v", got, tc.want) } }) diff --git a/internal/amf/handover.go b/internal/amf/handover.go index 8748cbfdc5..7a4556d3fe 100644 --- a/internal/amf/handover.go +++ b/internal/amf/handover.go @@ -301,7 +301,7 @@ func handoverGuardExpiry(a *AMF, sourceUe, targetUe *UeConn) procedure.CancelFun targetUe.SetReleaseAction(UeContextReleaseHandover) targetUe.SendUEContextReleaseCommand(cctx, - ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTNGRelocOverallExpiry}) + ngap.CauseRadioNetworkTNGRelocOverallExpiry.Cause()) return procedure.Release, nil } diff --git a/internal/amf/location.go b/internal/amf/location.go index 83c928f321..3e594238e3 100644 --- a/internal/amf/location.go +++ b/internal/amf/location.go @@ -69,63 +69,57 @@ func (ue *UeContext) SetLocation(loc models.UserLocation, tai models.Tai) { func (ueConn *UeConn) buildLocation(ctx context.Context, uli ngap.UserLocationInformation) (models.UserLocation, *models.Tai, bool) { curTime := time.Now().UTC() - cellPlmnID, err := decodePLMN(uli.PLMNIdentity) - if err != nil { - logger.AmfLog.Warn("could not decode the cell PLMN of a User Location Information", zap.Error(err)) - return models.UserLocation{}, nil, false - } - - plmnID, err := decodePLMN(uli.TAI.PLMNIdentity) - if err != nil { - logger.AmfLog.Warn("could not decode the TAI PLMN of a User Location Information", zap.Error(err)) - return models.UserLocation{}, nil, false - } - - tai := &models.Tai{ - PlmnID: &plmnID, - Tac: fmt.Sprintf("%06x", uint32(uli.TAI.TAC)), - } + switch { + case uli.NR != nil: + cellPlmnID, tai, ok := cellLocation(uli.NR.NRCGI.PLMNIdentity, uli.NR.TAI) + if !ok { + return models.UserLocation{}, nil, false + } - switch uli.Kind { - case ngap.UserLocationNR: nr := &models.NrLocation{ Tai: tai, - Ncgi: &models.Ncgi{PlmnID: &cellPlmnID, NrCellID: fmt.Sprintf("%09x", uli.CellIdentity)}, + Ncgi: &models.Ncgi{PlmnID: &cellPlmnID, NrCellID: fmt.Sprintf("%09x", uint64(uli.NR.NRCGI.NRCellIdentity))}, UeLocationTimestamp: &curTime, } - if uli.TimeStamp != nil { - nr.AgeOfLocationInformation = ageOfLocation(*uli.TimeStamp, curTime) + if uli.NR.TimeStamp != nil { + nr.AgeOfLocationInformation = ageOfLocation(*uli.NR.TimeStamp, curTime) } return models.UserLocation{NrLocation: nr}, tai, true - case ngap.UserLocationEUTRA: + case uli.EUTRA != nil: + cellPlmnID, tai, ok := cellLocation(uli.EUTRA.EUTRACGI.PLMNIdentity, uli.EUTRA.TAI) + if !ok { + return models.UserLocation{}, nil, false + } + eutra := &models.EutraLocation{ Tai: tai, - Ecgi: &models.Ecgi{PlmnID: &cellPlmnID, EutraCellID: fmt.Sprintf("%07x", uli.CellIdentity)}, + Ecgi: &models.Ecgi{PlmnID: &cellPlmnID, EutraCellID: fmt.Sprintf("%07x", uint32(uli.EUTRA.EUTRACGI.EUTRACellIdentity))}, UeLocationTimestamp: &curTime, } - if uli.TimeStamp != nil { - eutra.AgeOfLocationInformation = ageOfLocation(*uli.TimeStamp, curTime) + if uli.EUTRA.TimeStamp != nil { + eutra.AgeOfLocationInformation = ageOfLocation(*uli.EUTRA.TimeStamp, curTime) } return models.UserLocation{EutraLocation: eutra}, tai, true - case ngap.UserLocationN3IWF: + case uli.N3IWF != nil: // Untrusted non-3GPP access reports the UE's transport address instead of // a cell, so this alternative carries no TAI of its own. TS 23.501 // §5.3.2.3 has the N3IWF supply one — dedicated to non-3GPP access — over // N2 setup or in the optional id-TAI extension of the with-PortNumber - // alternative, neither of which is modelled, so the operator's own TAI - // stands in and the location is recorded rather than dropped. - n3gppTai, err := ueConn.operatorTai(ctx) + // alternative. The extension is used when present; otherwise the + // operator's own TAI stands in and the location is recorded rather than + // dropped. + n3gppTai, err := ueConn.n3iwfTai(ctx, uli.N3IWF.TAI) if err != nil { - logger.AmfLog.Error("cannot record an N3IWF location without an operator TAI", zap.Error(err)) + logger.AmfLog.Error("cannot record an N3IWF location without a TAI", zap.Error(err)) return models.UserLocation{}, nil, false } - ipv4, ipv6 := uli.IPAddress.IPs() + ipv4, ipv6 := uli.N3IWF.IPAddress.IPv4(), uli.N3IWF.IPAddress.IPv6() n3ga := &models.N3gaLocation{ N3gppTai: n3gppTai, - PortNumber: int32(uli.PortNumber), + PortNumber: int32(uli.N3IWF.PortNumber), } if ipv4.IsValid() { @@ -142,6 +136,39 @@ func (ueConn *UeConn) buildLocation(ctx context.Context, uli ngap.UserLocationIn } } +func cellLocation(cellPLMN ngap.PLMNIdentity, t ngap.TAI) (models.PlmnID, *models.Tai, bool) { + cellPlmnID, err := decodePLMN(cellPLMN) + if err != nil { + logger.AmfLog.Warn("could not decode the cell PLMN of a User Location Information", zap.Error(err)) + return models.PlmnID{}, nil, false + } + + tai, err := taiToModels(t) + if err != nil { + logger.AmfLog.Warn("could not decode the TAI PLMN of a User Location Information", zap.Error(err)) + return models.PlmnID{}, nil, false + } + + return cellPlmnID, tai, true +} + +func taiToModels(t ngap.TAI) (*models.Tai, error) { + plmnID, err := decodePLMN(t.PLMNIdentity) + if err != nil { + return nil, err + } + + return &models.Tai{PlmnID: &plmnID, Tac: fmt.Sprintf("%06x", uint32(t.TAC))}, nil +} + +func (ueConn *UeConn) n3iwfTai(ctx context.Context, t *ngap.TAI) (*models.Tai, error) { + if t != nil { + return taiToModels(*t) + } + + return ueConn.operatorTai(ctx) +} + func (ueConn *UeConn) operatorTai(ctx context.Context) (*models.Tai, error) { if ueConn.amf == nil { return nil, fmt.Errorf("connection has no owning AMF") diff --git a/internal/amf/location_test.go b/internal/amf/location_test.go index 04eb1480da..c4ace7cc49 100644 --- a/internal/amf/location_test.go +++ b/internal/amf/location_test.go @@ -11,23 +11,37 @@ import ( "github.com/ellanetworks/core/internal/db" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) -func testUserLocation(kind ngap.UserLocationInformationKind, cell uint64) ngap.UserLocationInformation { +type testULIKind int + +const ( + testULINR testULIKind = iota + testULIEUTRA +) + +func testUserLocation(kind testULIKind, cell uint64) ngap.UserLocationInformation { plmn := ngap.PLMNIdentity{0x00, 0xf1, 0x10} + tai := ngap.TAI{PLMNIdentity: plmn, TAC: 7} - return ngap.UserLocationInformation{ - Kind: kind, - PLMNIdentity: plmn, - CellIdentity: cell, - TAI: ngap.TAI{PLMNIdentity: plmn, TAC: 7}, + if kind == testULIEUTRA { + return ngap.UserLocationInformation{EUTRA: &ngap.UserLocationInformationEUTRA{ + EUTRACGI: ngap.EUTRACGI{PLMNIdentity: plmn, EUTRACellIdentity: ngap.EUTRACellIdentity(cell)}, + TAI: tai, + }} } + + return ngap.UserLocationInformation{NR: &ngap.UserLocationInformationNR{ + NRCGI: ngap.NRCGI{PLMNIdentity: plmn, NRCellIdentity: ngap.NRCellIdentity(cell)}, + TAI: tai, + }} } func TestUpdateLocationConversion(t *testing.T) { c := &UeConn{} - c.UpdateLocation(context.Background(), testUserLocation(ngap.UserLocationNR, 0x123456789)) + c.UpdateLocation(context.Background(), testUserLocation(testULINR, 0x123456789)) nr := c.Location.NrLocation if nr == nil || nr.Tai == nil || nr.Ncgi == nil { @@ -54,7 +68,7 @@ func TestUpdateLocationConversion(t *testing.T) { func TestUpdateLocationEUTRA(t *testing.T) { c := &UeConn{} - c.UpdateLocation(context.Background(), testUserLocation(ngap.UserLocationEUTRA, 0x0abcde1)) + c.UpdateLocation(context.Background(), testUserLocation(testULIEUTRA, 0x0abcde1)) el := c.Location.EutraLocation if el == nil || el.Ecgi == nil { @@ -74,14 +88,14 @@ func TestUpdateLocationReplacesPreviousAccess(t *testing.T) { ctx := context.Background() c := &UeConn{} - c.UpdateLocation(ctx, testUserLocation(ngap.UserLocationNR, 0x123456789)) - c.UpdateLocation(ctx, testUserLocation(ngap.UserLocationEUTRA, 0x0abcde1)) + c.UpdateLocation(ctx, testUserLocation(testULINR, 0x123456789)) + c.UpdateLocation(ctx, testUserLocation(testULIEUTRA, 0x0abcde1)) if c.Location.NrLocation != nil { t.Errorf("NR location survived a move to E-UTRA: %+v", c.Location.NrLocation) } - c.UpdateLocation(ctx, testUserLocation(ngap.UserLocationNR, 0x123456789)) + c.UpdateLocation(ctx, testUserLocation(testULINR, 0x123456789)) if c.Location.EutraLocation != nil { t.Errorf("E-UTRA location survived a move to NR: %+v", c.Location.EutraLocation) @@ -91,14 +105,14 @@ func TestUpdateLocationReplacesPreviousAccess(t *testing.T) { func TestUpdateLocationTimeStamp(t *testing.T) { c := &UeConn{} - uli := testUserLocation(ngap.UserLocationNR, 1) + uli := testUserLocation(testULINR, 1) c.UpdateLocation(context.Background(), uli) if got := c.Location.NrLocation.AgeOfLocationInformation; got != 0 { t.Errorf("age = %d with no TimeStamp, want 0", got) } - uli.TimeStamp = ntpTimeStamp(time.Now().UTC().Add(-90 * time.Minute)) + uli.NR.TimeStamp = ntpTimeStamp(time.Now().UTC().Add(-90 * time.Minute)) c.UpdateLocation(context.Background(), uli) if got := c.Location.NrLocation.AgeOfLocationInformation; got != 90 { @@ -149,7 +163,7 @@ func TestUpdateLocationMirrorsToUeContext(t *testing.T) { t.Fatal("expected empty location initially") } - c.UpdateLocation(context.Background(), testUserLocation(ngap.UserLocationNR, 0x123456789)) + c.UpdateLocation(context.Background(), testUserLocation(testULINR, 0x123456789)) if ue.IsUserLocationEmpty() { t.Fatal("location not mirrored to the persistent UE context") @@ -164,7 +178,7 @@ func TestUpdateLocationMirrorsToUeContext(t *testing.T) { func TestUpdateLocationBareConnectionNotMirrored(t *testing.T) { c := &UeConn{} - c.UpdateLocation(context.Background(), testUserLocation(ngap.UserLocationNR, 1)) + c.UpdateLocation(context.Background(), testUserLocation(testULINR, 1)) if c.Location.NrLocation == nil { t.Fatal("connection location should be set even without a bound UE") @@ -176,7 +190,7 @@ func TestUpdateLocationConcurrentReadWrite(t *testing.T) { c := &UeConn{} c.ue.Store(ue) - uli := testUserLocation(ngap.UserLocationNR, 0x123456789) + uli := testUserLocation(testULINR, 0x123456789) done := make(chan struct{}) @@ -233,11 +247,7 @@ func TestUpdateLocationN3IWF(t *testing.T) { Mcc: "001", Mnc: "01", SupportedTACs: `["000007"]`, }}}} - c.UpdateLocation(context.Background(), ngap.UserLocationInformation{ - Kind: ngap.UserLocationN3IWF, - IPAddress: ngap.TransportLayerAddress{192, 168, 1, 1}, - PortNumber: 500, - }) + c.UpdateLocation(context.Background(), ngap.UserLocationInformation{N3IWF: &ngap.UserLocationInformationN3IWFWithPortNumber{IPAddress: ap.TransportLayerAddressFromOctets([]byte{192, 168, 1, 1}), PortNumber: 500}}) n3 := c.Location.N3gaLocation if n3 == nil { @@ -265,12 +275,9 @@ func TestUpdateLocationN3IWFKeepsLastKnownWithoutOperator(t *testing.T) { ctx := context.Background() c := &UeConn{} - c.UpdateLocation(ctx, testUserLocation(ngap.UserLocationNR, 0x123456789)) + c.UpdateLocation(ctx, testUserLocation(testULINR, 0x123456789)) - c.UpdateLocation(ctx, ngap.UserLocationInformation{ - Kind: ngap.UserLocationN3IWF, - IPAddress: ngap.TransportLayerAddress{192, 168, 1, 1}, - }) + c.UpdateLocation(ctx, ngap.UserLocationInformation{N3IWF: &ngap.UserLocationInformationN3IWFWithPortNumber{IPAddress: ap.TransportLayerAddressFromOctets([]byte{192, 168, 1, 1})}}) if c.Location.NrLocation == nil { t.Error("dropped the last known location on an unrecordable update") diff --git a/internal/amf/nas/handle_deregistration_accept.go b/internal/amf/nas/handle_deregistration_accept.go index 514c182a04..e04eccdd34 100644 --- a/internal/amf/nas/handle_deregistration_accept.go +++ b/internal/amf/nas/handle_deregistration_accept.go @@ -30,7 +30,7 @@ func handleDeregistrationAccept(ctx context.Context, ue *amf.UeContext) nasreply ueConn.SetReleaseAction(amf.UeContextReleaseDueToNwInitiatedDeregistraion) - ueConn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASDeregister}) + ueConn.SendUEContextReleaseCommand(ctx, ngap.CauseNASDeregister.Cause()) return nasreply.Handled() } diff --git a/internal/amf/nas/handle_deregistration_request.go b/internal/amf/nas/handle_deregistration_request.go index c5c9894cfa..18ef4386fd 100644 --- a/internal/amf/nas/handle_deregistration_request.go +++ b/internal/amf/nas/handle_deregistration_request.go @@ -50,7 +50,7 @@ func handleDeregistrationRequestUEOriginatingDeregistration(ctx context.Context, ueConn.SetReleaseAction(amf.UeContextReleaseUeContext) - ueConn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASDeregister}) + ueConn.SendUEContextReleaseCommand(ctx, ngap.CauseNASDeregister.Cause()) return nasreply.Handled() } diff --git a/internal/amf/nas/handle_registration_complete.go b/internal/amf/nas/handle_registration_complete.go index 610bbdd924..a3641f2c11 100644 --- a/internal/amf/nas/handle_registration_complete.go +++ b/internal/amf/nas/handle_registration_complete.go @@ -67,7 +67,7 @@ func handleRegistrationComplete(ctx context.Context, amfInstance *amf.AMF, ue *a return nasreply.Handled() } - cause := ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease} + cause := ngap.CauseNASNormalRelease.Cause() if ueConn.MTSignallingPending() { ueConn.DeferRelease(ctx, cause) diff --git a/internal/amf/nas/handle_security_mode_reject.go b/internal/amf/nas/handle_security_mode_reject.go index 7ee960182a..80fe9f9c66 100644 --- a/internal/amf/nas/handle_security_mode_reject.go +++ b/internal/amf/nas/handle_security_mode_reject.go @@ -41,7 +41,7 @@ func handleSecurityModeReject(ctx context.Context, ue *amf.UeContext, msg *fgs.S ueConn.SetReleaseAction(amf.UeContextReleaseUeContext) - ueConn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) + ueConn.SendUEContextReleaseCommand(ctx, ngap.CauseNASNormalRelease.Cause()) return nasreply.Handled() } diff --git a/internal/amf/nas/handle_service_request.go b/internal/amf/nas/handle_service_request.go index a9b04d20c0..b8dc11db73 100644 --- a/internal/amf/nas/handle_service_request.go +++ b/internal/amf/nas/handle_service_request.go @@ -589,7 +589,7 @@ func rejectService(ctx context.Context, ueConn *amf.UeConn, cause fgs.GMMCause) } ueConn.SetReleaseAction(amf.UeContextN2NormalRelease) - ueConn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) + ueConn.SendUEContextReleaseCommand(ctx, ngap.CauseNASNormalRelease.Cause()) } func releasesN1Connection(ueConn *amf.UeConn, cause fgs.GMMCause) bool { diff --git a/internal/amf/nas/nas_handler.go b/internal/amf/nas/nas_handler.go index 7211e9b9eb..b73565b2db 100644 --- a/internal/amf/nas/nas_handler.go +++ b/internal/amf/nas/nas_handler.go @@ -261,7 +261,7 @@ func rejectBareServiceRequest(ctx context.Context, ue *amf.UeConn, cause fgs.GMM logger.From(ctx, logger.AmfLog).Warn("failed to send service reject for uncontextualized service request", zap.Error(err)) } - ue.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) + ue.SendUEContextReleaseCommand(ctx, ngap.CauseNASNormalRelease.Cause()) } // fetchUeContextWithMobileIdentity resolves an existing UE context from the GUTI diff --git a/internal/amf/nas/reg_initial.go b/internal/amf/nas/reg_initial.go index 8993596405..30cbf46f1b 100644 --- a/internal/amf/nas/reg_initial.go +++ b/internal/amf/nas/reg_initial.go @@ -39,7 +39,7 @@ func releaseAbortedRegistration(ctx context.Context, ueConn *amf.UeConn) { ueConn.SetReleaseAction(amf.UeContextReleaseAbortRegistration) // SendUEContextReleaseCommand releases locally on a send failure and logs it. - ueConn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASUnspecified}) + ueConn.SendUEContextReleaseCommand(ctx, ngap.CauseNASUnspecified.Cause()) } func HandleInitialRegistration(ctx context.Context, amfInstance *amf.AMF, ue *amf.UeContext) { diff --git a/internal/amf/ngap/handle_error_indication.go b/internal/amf/ngap/handle_error_indication.go index be0bf15420..7eb28588aa 100644 --- a/internal/amf/ngap/handle_error_indication.go +++ b/internal/amf/ngap/handle_error_indication.go @@ -42,7 +42,7 @@ func reportDiagnostics(ctx context.Context, ran *amf.Radio, proc ngap.ProcedureC emitErrorIndication(ctx, ran, &ngap.ErrorIndication{ AMFUENGAPID: ids.amf, RANUENGAPID: ids.ran, - Cause: &ngap.Cause{Group: ngap.CauseGroupProtocol, Value: ngap.CauseProtocolAbstractSyntaxErrorIgnoreAndNotify}, + Cause: new(ngap.CauseProtocolAbstractSyntaxErrorIgnoreAndNotify.Cause()), CriticalityDiagnostics: &ngap.CriticalityDiagnostics{ ProcedureCode: &proc, TriggeringMessage: &trigger, @@ -88,7 +88,7 @@ func sendParseErrorIndication(ctx context.Context, ran *amf.Radio, proc ngap.Pro crit := ngap.ProcedureCriticality(proc) emitErrorIndication(ctx, ran, &ngap.ErrorIndication{ - Cause: &ngap.Cause{Group: ngap.CauseGroupProtocol, Value: ngap.CauseProtocolTransferSyntaxError}, + Cause: new(ngap.CauseProtocolTransferSyntaxError.Cause()), CriticalityDiagnostics: &ngap.CriticalityDiagnostics{ ProcedureCode: &proc, TriggeringMessage: &trigger, @@ -154,5 +154,5 @@ func HandleErrorIndication(ctx context.Context, amfInstance *amf.AMF, ran *amf.R ueConn.SetReleaseAction(amf.UeContextN2NormalRelease) - ueConn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}) + ueConn.SendUEContextReleaseCommand(ctx, ngap.CauseRadioNetworkUnspecified.Cause()) } diff --git a/internal/amf/ngap/handle_error_indication_test.go b/internal/amf/ngap/handle_error_indication_test.go index 568854ad5c..90d826e7c2 100644 --- a/internal/amf/ngap/handle_error_indication_test.go +++ b/internal/amf/ngap/handle_error_indication_test.go @@ -29,9 +29,7 @@ func TestHandleErrorIndication_WithCause(t *testing.T) { sender := ran.Conn.(*fakeNGAPSender) msg := &ngap.ErrorIndication{ - Cause: ngap.Ptr(ngap.Cause{ - Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified, - }), + Cause: ngap.Ptr(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleErrorIndication(context.Background(), amfInstance, ran, msg) @@ -51,9 +49,7 @@ func TestHandleErrorIndication_ReleasesNamedUE(t *testing.T) { amfID := ngap.AMFUENGAPID(10) msg := &ngap.ErrorIndication{ AMFUENGAPID: &amfID, - Cause: ngap.Ptr(ngap.Cause{ - Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified, - }), + Cause: ngap.Ptr(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleErrorIndication(context.Background(), amfInstance, ran, msg) @@ -75,9 +71,7 @@ func TestHandleErrorIndication_UnknownUENoRelease(t *testing.T) { amfID := ngap.AMFUENGAPID(999) msg := &ngap.ErrorIndication{ AMFUENGAPID: &amfID, - Cause: ngap.Ptr(ngap.Cause{ - Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified, - }), + Cause: ngap.Ptr(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleErrorIndication(context.Background(), amfInstance, ran, msg) diff --git a/internal/amf/ngap/handle_handover_cancel.go b/internal/amf/ngap/handle_handover_cancel.go index 772ab8df32..f9d2bae266 100644 --- a/internal/amf/ngap/handle_handover_cancel.go +++ b/internal/amf/ngap/handle_handover_cancel.go @@ -23,10 +23,7 @@ func HandleHandoverCancel(ctx context.Context, amfInstance *amf.AMF, ran *amf.Ra sourceUe.Log(ctx).Debug("Handle Handover Cancel", zap.Uint32("source_ran_ue_ngap_id", uint32(sourceUe.RanUeNgapID())), zap.Uint64("source_amf_ue_ngap_id", uint64(sourceUe.AmfUeNgapID))) sourceUe.TouchLastSeen() - cause := ngap.Cause{ - Group: ngap.CauseGroupRadioNetwork, - Value: ngap.CauseRadioNetworkHOFailureInTarget, - } + cause := ngap.CauseRadioNetworkHOFailureInTarget.Cause() if msg.Cause != nil { sourceUe.Log(ctx).Debug("Handover Cancel Cause", logger.Cause(msg.Cause.String())) diff --git a/internal/amf/ngap/handle_handover_cancel_test.go b/internal/amf/ngap/handle_handover_cancel_test.go index fe6d2148cf..4529f77dff 100644 --- a/internal/amf/ngap/handle_handover_cancel_test.go +++ b/internal/amf/ngap/handle_handover_cancel_test.go @@ -19,7 +19,7 @@ func TestHandleHandoverCancel_UnknownRanUeNgapID(t *testing.T) { msg := &ngap.HandoverCancel{ AMFUENGAPID: 1099511627775, RANUENGAPID: 99, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleHandoverCancel(context.Background(), amfInstance, ran, msg) @@ -30,8 +30,8 @@ func TestHandleHandoverCancel_UnknownRanUeNgapID(t *testing.T) { errInd := sender.SentErrorIndications[0] - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID} - if errInd.Cause == nil || *errInd.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() + if errInd.Cause == nil || !errInd.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want unknown-local-UE-NGAP-ID", errInd.Cause) } } @@ -49,7 +49,7 @@ func TestHandleHandoverCancel_UnknownAmfUeNgapID(t *testing.T) { msg := &ngap.HandoverCancel{ AMFUENGAPID: 999, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleHandoverCancel(context.Background(), amfInstance, sourceRan, msg) @@ -91,7 +91,7 @@ func TestHandleHandoverCancel_HappyPath(t *testing.T) { msg := &ngap.HandoverCancel{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleHandoverCancel(context.Background(), amfInstance, sourceRan, msg) diff --git a/internal/amf/ngap/handle_handover_failure_test.go b/internal/amf/ngap/handle_handover_failure_test.go index 78fb924394..2008743b0a 100644 --- a/internal/amf/ngap/handle_handover_failure_test.go +++ b/internal/amf/ngap/handle_handover_failure_test.go @@ -52,7 +52,7 @@ func TestHandleHandoverFailure_SourceUeContextDetached(t *testing.T) { msg := ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(200)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + Cause: new(ngap.CauseRadioNetworkHOFailureInTarget.Cause()), } HandleHandoverFailure(context.Background(), amfInstance, targetRan, &msg) @@ -94,7 +94,7 @@ func TestHandleHandoverFailure_DropsTargetLocally(t *testing.T) { msg := ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(200)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + Cause: new(ngap.CauseRadioNetworkHOFailureInTarget.Cause()), } HandleHandoverFailure(context.Background(), amfInstance, targetRan, &msg) @@ -139,7 +139,7 @@ func TestHandleHandoverFailure_NotFromPreparedTarget(t *testing.T) { msg := ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(100)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + Cause: new(ngap.CauseRadioNetworkHOFailureInTarget.Cause()), } HandleHandoverFailure(context.Background(), amfInstance, sourceRan, &msg) @@ -180,7 +180,7 @@ func TestHandleHandoverFailure_DoesNotRelayTargetDiagnosticsToSource(t *testing. HandleHandoverFailure(context.Background(), amfInstance, targetRan, &ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(200)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + Cause: new(ngap.CauseRadioNetworkHOFailureInTarget.Cause()), CriticalityDiagnostics: &ngap.CriticalityDiagnostics{ IEsCriticalityDiagnostics: []ngap.CriticalityDiagnosticsIEItem{{ IECriticality: ngap.CriticalityReject, @@ -224,7 +224,7 @@ func TestHandleHandoverFailure_RelaysTargetToSourceFailureContainer(t *testing.T HandleHandoverFailure(context.Background(), amfInstance, targetRan, &ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(200)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + Cause: new(ngap.CauseRadioNetworkHOFailureInTarget.Cause()), TargettoSourceFailureTransparentContainer: container, }) @@ -260,7 +260,7 @@ func TestHandleHandoverFailure_NoContainerToRelay(t *testing.T) { HandleHandoverFailure(context.Background(), amfInstance, targetRan, &ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(200)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget}, + Cause: new(ngap.CauseRadioNetworkHOFailureInTarget.Cause()), }) if len(sourceSender.SentHandoverPreparationFailures) != 1 { diff --git a/internal/amf/ngap/handle_handover_notify.go b/internal/amf/ngap/handle_handover_notify.go index ea1c520bf7..4efd83b2e7 100644 --- a/internal/amf/ngap/handle_handover_notify.go +++ b/internal/amf/ngap/handle_handover_notify.go @@ -82,7 +82,7 @@ func HandleHandoverNotify(ctx context.Context, amfInstance *amf.AMF, ran *amf.Ra sourceUe.SetReleaseAction(amf.UeContextReleaseHandover) - sourceUe.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkSuccessfulHandover}) + sourceUe.SendUEContextReleaseCommand(ctx, ngap.CauseRadioNetworkSuccessfulHandover.Cause()) amfInstance.ReconcileSessionsForUE(ctx, amfUe) } diff --git a/internal/amf/ngap/handle_handover_notify_test.go b/internal/amf/ngap/handle_handover_notify_test.go index 20d5b69c9c..46304f146c 100644 --- a/internal/amf/ngap/handle_handover_notify_test.go +++ b/internal/amf/ngap/handle_handover_notify_test.go @@ -33,8 +33,8 @@ func TestHandoverNotify_UnknownRanUeNgapID(t *testing.T) { t.Fatal("expected Cause in ErrorIndication, got nil") } - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID} - if errInd.Cause == nil || *errInd.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() + if errInd.Cause == nil || !errInd.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want unknown-local-UE-NGAP-ID", errInd.Cause) } @@ -125,16 +125,21 @@ func TestHandoverNotify_HappyPath(t *testing.T) { cmd := sourceNGAPSender.SentUEContextReleaseCommands[0] - if cmd.UENGAPIDs.AMFUENGAPID != 100 { - t.Errorf("expected AmfUeNgapID=100 (source), got %d", cmd.UENGAPIDs.AMFUENGAPID) + pair := cmd.UENGAPIDs.UENGAPIDPair + if pair == nil { + t.Fatalf("expected the UE-NGAP-ID pair, got %+v", cmd.UENGAPIDs) } - if cmd.UENGAPIDs.RANUENGAPID != 10 { - t.Errorf("expected RanUeNgapID=10 (source), got %d", cmd.UENGAPIDs.RANUENGAPID) + if pair.AMFUENGAPID != 100 { + t.Errorf("expected AmfUeNgapID=100 (source), got %d", pair.AMFUENGAPID) } - wantCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkSuccessfulHandover} - if cmd.Cause == nil || *cmd.Cause != wantCause { + if pair.RANUENGAPID != 10 { + t.Errorf("expected RanUeNgapID=10 (source), got %d", pair.RANUENGAPID) + } + + wantCause := ngap.CauseRadioNetworkSuccessfulHandover.Cause() + if cmd.Cause == nil || !cmd.Cause.Equal(wantCause) { t.Errorf("cause = %v, want successful-handover", cmd.Cause) } diff --git a/internal/amf/ngap/handle_handover_request_acknowledge_test.go b/internal/amf/ngap/handle_handover_request_acknowledge_test.go index 805901613e..07c41dc857 100644 --- a/internal/amf/ngap/handle_handover_request_acknowledge_test.go +++ b/internal/amf/ngap/handle_handover_request_acknowledge_test.go @@ -13,6 +13,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/internal/smf" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/sctp" ) @@ -192,8 +193,8 @@ func TestHandoverRequestAcknowledge_NoPDUSessionsAdmitted_SendsPreparationFailur failure := sourceNGAPSender.SentHandoverPreparationFailures[0] - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget} - if failure.Cause == nil || *failure.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkHOFailureInTarget.Cause() + if failure.Cause == nil || !failure.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want ho-failure-in-target-5GC-ngran-node-or-target-system", failure.Cause) } @@ -245,8 +246,8 @@ func TestHandoverRequestAcknowledge_HappyPath(t *testing.T) { transferBytes, err := (&ngap.HandoverRequestAcknowledgeTransfer{ DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{ - GTPTunnel: ngap.GTPTunnel{ - TransportLayerAddress: ngap.TransportLayerAddress{10, 0, 0, 2}, + GTPTunnel: &ngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 2}), GTPTEID: 0x000004D2, }, }, @@ -299,8 +300,8 @@ func admittedAckMsg(t *testing.T) *ngap.HandoverRequestAcknowledge { t.Helper() transferBytes, err := (&ngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: ngap.GTPTunnel{ - TransportLayerAddress: ngap.TransportLayerAddress{10, 0, 0, 2}, + DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: &ngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 2}), GTPTEID: 1234, }}, QosFlowSetupResponse: ngap.QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, @@ -343,8 +344,8 @@ func TestHandoverRequestAcknowledge_PartialAdmission(t *testing.T) { amf.HandoverCandidate{PDUSessionID: 1}, amf.HandoverCandidate{PDUSessionID: 2}) admittedBytes, err := (&ngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: ngap.GTPTunnel{ - TransportLayerAddress: ngap.TransportLayerAddress{10, 0, 0, 2}, + DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: &ngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 2}), GTPTEID: 1234, }}, QosFlowSetupResponse: ngap.QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, @@ -354,7 +355,7 @@ func TestHandoverRequestAcknowledge_PartialAdmission(t *testing.T) { } unsuccessfulBytes, err := (&ngap.HandoverResourceAllocationUnsuccessfulTransfer{ - Cause: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: ngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }).Marshal() if err != nil { t.Fatalf("failed to marshal unsuccessful transfer: %v", err) @@ -395,8 +396,8 @@ func TestHandoverRequestAcknowledge_PartialAdmission(t *testing.T) { t.Fatalf("to-release transfer does not decode: %v", err) } - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioResourcesNotAvailable} - if relayed.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() + if !relayed.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want radio-resources-not-available", relayed.Cause) } } diff --git a/internal/amf/ngap/handle_handover_required_test.go b/internal/amf/ngap/handle_handover_required_test.go index a6cf34c577..b6b95f5b9a 100644 --- a/internal/amf/ngap/handle_handover_required_test.go +++ b/internal/amf/ngap/handle_handover_required_test.go @@ -66,7 +66,7 @@ func handoverRequired(t *testing.T, ranID ngap.RANUENGAPID, sessions ...uint8) * }) } - cause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverDesirableForRadio} + cause := ngap.CauseRadioNetworkHandoverDesirableForRadio.Cause() return &ngap.HandoverRequired{ AMFUENGAPID: 1, @@ -74,13 +74,8 @@ func handoverRequired(t *testing.T, ranID ngap.RANUENGAPID, sessions ...uint8) * HandoverType: ngap.HandoverTypeIntra5GS, Cause: &cause, TargetID: ngap.TargetID{TargetRANNodeID: &ngap.TargetRANNodeID{ - GlobalRANNodeID: ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, - PLMNIdentity: operatorPLMN, - Value: uint32(gnb[0])<<16 | uint32(gnb[1])<<8 | uint32(gnb[2]), - Bits: 24, - }, - SelectedTAI: ngap.TAI{PLMNIdentity: operatorPLMN, TAC: 1}, + GlobalRANNodeID: ngap.NewGlobalGNBID(operatorPLMN, uint32(gnb[0])<<16|uint32(gnb[1])<<8|uint32(gnb[2]), 24), + SelectedTAI: ngap.TAI{PLMNIdentity: operatorPLMN, TAC: 1}, }}, PDUSessionResourceListHORqd: list, SourceToTargetTransparentContainer: ngap.SourceToTargetTransparentContainer{0x01, 0x02, 0x03}, @@ -206,8 +201,8 @@ func TestHandoverRequired_UnknownRanUeNgapID(t *testing.T) { t.Fatal("expected Cause in ErrorIndication, got nil") } - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID} - if errorIndication.Cause == nil || *errorIndication.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() + if errorIndication.Cause == nil || !errorIndication.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want unknown-local-UE-NGAP-ID", errorIndication.Cause) } } @@ -240,8 +235,8 @@ func TestHandoverRequired_InvalidSecurityContext(t *testing.T) { failure := sourceNGAPSender.SentHandoverPreparationFailures[0] - wantNasCause := ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASAuthenticationFailure} - if failure.Cause == nil || *failure.Cause != wantNasCause { + wantNasCause := ngap.CauseNASAuthenticationFailure.Cause() + if failure.Cause == nil || !failure.Cause.Equal(wantNasCause) { t.Errorf("cause = %v, want authentication-failure", failure.Cause) } @@ -300,8 +295,8 @@ func TestHandoverRequired_UnknownTarget(t *testing.T) { failure := sourceNGAPSender.SentHandoverPreparationFailures[0] - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownTargetID} - if failure.Cause == nil || *failure.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkUnknownTargetID.Cause() + if failure.Cause == nil || !failure.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want unknown-targetID", failure.Cause) } } @@ -520,8 +515,8 @@ func TestHandoverRequired_UnsupportedHandoverType(t *testing.T) { t.Fatalf("expected 1 HandoverPreparationFailure, got %d", len(sourceNGAPSender.SentHandoverPreparationFailures)) } - want := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHoTargetNotAllowed} - if failure := sourceNGAPSender.SentHandoverPreparationFailures[0]; failure.Cause == nil || *failure.Cause != want { + want := ngap.CauseRadioNetworkHoTargetNotAllowed.Cause() + if failure := sourceNGAPSender.SentHandoverPreparationFailures[0]; failure.Cause == nil || !failure.Cause.Equal(want) { t.Errorf("cause = %v, want ho-target-not-allowed", failure.Cause) } @@ -667,7 +662,7 @@ func TestHandoverRequired_OperatorLookupFailure(t *testing.T) { } failure := sourceNGAPSender.SentHandoverPreparationFailures[0] - if failure.Cause == nil || *failure.Cause != causeHandoverPrepUnspecific { + if failure.Cause == nil || !failure.Cause.Equal(causeHandoverPrepUnspecific) { t.Errorf("cause = %v, want %v", failure.Cause, causeHandoverPrepUnspecific) } } diff --git a/internal/amf/ngap/handle_initial_context_setup_failure_test.go b/internal/amf/ngap/handle_initial_context_setup_failure_test.go index ca885e1bef..74a1951eeb 100644 --- a/internal/amf/ngap/handle_initial_context_setup_failure_test.go +++ b/internal/amf/ngap/handle_initial_context_setup_failure_test.go @@ -37,7 +37,7 @@ func TestHandleInitialContextSetupFailure_UnknownAmfUeNgapID(t *testing.T) { msg := &ngap.InitialContextSetupFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(999)), RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(99)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleInitialContextSetupFailure(context.Background(), amfInstance, ran, msg) @@ -56,7 +56,7 @@ func TestHandleInitialContextSetupFailure_NilUeContext(t *testing.T) { msg := &ngap.InitialContextSetupFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(10)), RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleInitialContextSetupFailure(context.Background(), amfInstance, ran, msg) @@ -83,7 +83,7 @@ func TestHandleInitialContextSetupFailure_T3550Running(t *testing.T) { msg := &ngap.InitialContextSetupFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(10)), RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleInitialContextSetupFailure(context.Background(), amfInstance, ran, msg) @@ -116,7 +116,7 @@ func TestHandleInitialContextSetupFailure_PDUSessionFailureForwardedToSmf(t *tes msg := &ngap.InitialContextSetupFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(10)), RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), PDUSessionResourceFailed: ngap.PDUSessionResourceFailedToSetupListCxtFail{{PDUSessionID: 1, Transfer: transfer}}, } @@ -154,7 +154,7 @@ func TestHandleInitialContextSetupFailure_ReleasesNGRANStateForEverySession(t *t msg := &ngap.InitialContextSetupFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(10)), RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), PDUSessionResourceFailed: ngap.PDUSessionResourceFailedToSetupListCxtFail{{PDUSessionID: 1, Transfer: []byte{0xEE}}}, } @@ -189,7 +189,7 @@ func TestHandleInitialContextSetupFailure_ReleasesNGRANStateWithoutAFailedList(t msg := &ngap.InitialContextSetupFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(10)), RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), } HandleInitialContextSetupFailure(context.Background(), amfInstance, ran, msg) diff --git a/internal/amf/ngap/handle_initial_ue_message_test.go b/internal/amf/ngap/handle_initial_ue_message_test.go index da1a8510e4..f39fcac993 100644 --- a/internal/amf/ngap/handle_initial_ue_message_test.go +++ b/internal/amf/ngap/handle_initial_ue_message_test.go @@ -311,7 +311,7 @@ func TestInitialUEMessageReusingTheRanIDOfAConnectionBeingReleasedCompletesThatR HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, &ngap.UEContextReleaseRequest{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), }) HandleInitialUEMessage(context.Background(), amfInstance, ran, &ngap.InitialUEMessage{ diff --git a/internal/amf/ngap/handle_nas_non_delivery_indication_test.go b/internal/amf/ngap/handle_nas_non_delivery_indication_test.go index cf5d0fb317..1d0929b546 100644 --- a/internal/amf/ngap/handle_nas_non_delivery_indication_test.go +++ b/internal/amf/ngap/handle_nas_non_delivery_indication_test.go @@ -41,7 +41,7 @@ func TestNASNonDeliveryIndication_DoesNotReprocessNAS(t *testing.T) { RANUENGAPID: 1, AMFUENGAPID: 10, NASPDU: ngap.NASPDU{0xDE, 0xAD}, - Cause: ngap.Ptr(ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID}), + Cause: ngap.Ptr(ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause()), }) if len(fakeNAS.Calls) != 0 { diff --git a/internal/amf/ngap/handle_ng_reset.go b/internal/amf/ngap/handle_ng_reset.go index e15012ccaf..b59a9db713 100644 --- a/internal/amf/ngap/handle_ng_reset.go +++ b/internal/amf/ngap/handle_ng_reset.go @@ -28,7 +28,7 @@ func HandleNGReset(ctx context.Context, amfInstance *amf.AMF, ran *amf.Radio, re cause = req.Cause.String() } - if req.ResetType.All { + if req.ResetType.NGInterface != nil { // TS 38.413: NG Reset is initiated when one side has lost its // UE-associated logical NG-connection context. Treat as lower layer // failure so ongoing NAS procedures are aborted per TS 24.501. @@ -40,17 +40,22 @@ func HandleNGReset(ctx context.Context, amfInstance *amf.AMF, ran *amf.Radio, re return } - released := releaseListedUEs(ctx, amfInstance, ran, req.ResetType.Part) + var part ngap.UEAssociatedLogicalNGConnectionList + if req.ResetType.PartOfNGInterface != nil { + part = *req.ResetType.PartOfNGInterface + } + + released := releaseListedUEs(ctx, amfInstance, ran, part) ran.Log(ctx).Info("NG Reset (part of interface)", logger.Cause(cause), - zap.Int("requested", len(req.ResetType.Part)), + zap.Int("requested", len(part)), zap.Int("connections", len(released))) // TS 38.413 §8.7.4.2.2: the acknowledge echoes every UE-associated logical // NG-connection the reset named, in the order received, including the ones // this AMF does not hold. - sendNGResetAcknowledge(ctx, ran, req.ResetType.Part, req.Diagnostics()) + sendNGResetAcknowledge(ctx, ran, part, req.Diagnostics()) } // releaseListedUEs releases each UE the list names and returns the entries it diff --git a/internal/amf/ngap/handle_ng_reset_test.go b/internal/amf/ngap/handle_ng_reset_test.go index b723f99871..de88d846de 100644 --- a/internal/amf/ngap/handle_ng_reset_test.go +++ b/internal/amf/ngap/handle_ng_reset_test.go @@ -12,9 +12,7 @@ import ( ) func miscCause() *ngap.Cause { - return ngap.Ptr(ngap.Cause{ - Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscHardwareFailure, - }) + return ngap.Ptr(ngap.CauseMiscHardwareFailure.Cause()) } func TestHandleNGReset_ResetNGInterface(t *testing.T) { @@ -30,7 +28,7 @@ func TestHandleNGReset_ResetNGInterface(t *testing.T) { msg := &ngap.NGReset{ Cause: miscCause(), - ResetType: ngap.ResetType{All: true}, + ResetType: ngap.ResetType{NGInterface: new(ngap.ResetAllResetAll)}, } HandleNGReset(context.Background(), amfInstance, ran, msg) @@ -66,7 +64,7 @@ func TestHandleNGReset_PartOfNGInterface(t *testing.T) { msg := &ngap.NGReset{ Cause: miscCause(), - ResetType: ngap.ResetType{Part: partOfNG}, + ResetType: ngap.ResetType{PartOfNGInterface: &partOfNG}, } HandleNGReset(context.Background(), amfInstance, ran, msg) @@ -108,7 +106,7 @@ func TestHandleNGReset_PartOfNGInterface_UnknownUE(t *testing.T) { msg := &ngap.NGReset{ Cause: miscCause(), - ResetType: ngap.ResetType{Part: partOfNG}, + ResetType: ngap.ResetType{PartOfNGInterface: &partOfNG}, } HandleNGReset(context.Background(), amfInstance, ran, msg) diff --git a/internal/amf/ngap/handle_ng_setup.go b/internal/amf/ngap/handle_ng_setup.go index 77467a9fa7..9d1a369859 100644 --- a/internal/amf/ngap/handle_ng_setup.go +++ b/internal/amf/ngap/handle_ng_setup.go @@ -22,20 +22,20 @@ import ( // causeUnknownPLMN is NGAP Cause Misc "unknown-PLMN-or-SNPN" (TS 38.413), // returned in NG Setup Failure when the gNB broadcasts no PLMN this AMF serves. -var causeUnknownPLMN = ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnknownPLMNOrSNPN} +var causeUnknownPLMN = ngap.CauseMiscUnknownPLMNOrSNPN.Cause() // causeNoServedTAC is NGAP Cause Misc "unspecified", returned when the gNB // broadcasts a served PLMN but no TAC this AMF serves. -var causeNoServedTAC = ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnspecified} +var causeNoServedTAC = ngap.CauseMiscUnspecified.Cause() // causeUnspecified is the same Cause Misc "unspecified" on the wire, named for // the other reason the AMF sends it: a failure on its own side, where the // gNB's configuration is not at fault and nothing more specific fits. Kept // distinct from causeNoServedTAC so a reader can tell which rejection a call // site means. -var causeUnspecified = ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnspecified} +var causeUnspecified = ngap.CauseMiscUnspecified.Cause() -var causeSemanticError = ngap.Cause{Group: ngap.CauseGroupProtocol, Value: ngap.CauseProtocolSemanticError} +var causeSemanticError = ngap.CauseProtocolSemanticError.Cause() // HandleNGSetupRequest answers a gNB's NG Setup Request with an NG Setup // Response when the gNB broadcasts a TAI this AMF serves, otherwise an NG Setup @@ -161,7 +161,7 @@ func ngSetupOutcomeFor(req *ngap.NGSetupRequest, operatorInfo *amf.OperatorInfo, } reason = "gNB broadcasts no PLMN served by this AMF (Unknown PLMN)" - if cause == causeNoServedTAC { + if cause.Equal(causeNoServedTAC) { reason = "gNB broadcasts a served PLMN but no TAC served by this AMF" } diff --git a/internal/amf/ngap/handle_ng_setup_test.go b/internal/amf/ngap/handle_ng_setup_test.go index 8debeaeff6..103d863e92 100644 --- a/internal/amf/ngap/handle_ng_setup_test.go +++ b/internal/amf/ngap/handle_ng_setup_test.go @@ -59,12 +59,7 @@ func buildNGSetupRequest(opts *NGSetupRequestOpts) (*ngap.NGSetupRequest, error) } req := &ngap.NGSetupRequest{ - GlobalRANNodeID: ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, - PLMNIdentity: plmn, - Value: uint32(gnbID), - Bits: 24, - }, + GlobalRANNodeID: ngap.NewGlobalGNBID(plmn, uint32(gnbID), 24), RANNodeName: ngap.Ptr(opts.Name), DefaultPagingDRX: ngap.Ptr(ngap.PagingDRXv128), } @@ -139,8 +134,8 @@ func TestHandleNGSetupRequest_NGSetupFailure_gNodeBDoesntSupportAnyTAC(t *testin cause := sender.SentNGSetupFailures[0].Cause - want := ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnspecified} - if cause == nil || *cause != want { + want := ngap.CauseMiscUnspecified.Cause() + if cause == nil || !cause.Equal(want) { t.Errorf("cause = %v, want unspecified", cause) } @@ -193,8 +188,8 @@ func TestHandleNGSetupRequest_NGSetupFailure_gNodeBSupportsDifferentTAC(t *testi cause := sender.SentNGSetupFailures[0].Cause - want := ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnspecified} - if cause == nil || *cause != want { + want := ngap.CauseMiscUnspecified.Cause() + if cause == nil || !cause.Equal(want) { t.Errorf("cause = %v, want unspecified", cause) } @@ -503,8 +498,8 @@ func TestHandleNGSetupRequest_NGSetupFailure_PLMNMismatch(t *testing.T) { cause := sender.SentNGSetupFailures[0].Cause - want := ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnknownPLMNOrSNPN} - if cause == nil || *cause != want { + want := ngap.CauseMiscUnknownPLMNOrSNPN.Cause() + if cause == nil || !cause.Equal(want) { t.Errorf("cause = %v, want unknown-PLMN-or-SNPN", cause) } } @@ -542,8 +537,8 @@ func TestHandleNGSetupRequest_DBFailure_SendsNGSetupFailure(t *testing.T) { cause := sender.SentNGSetupFailures[0].Cause - want := ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnspecified} - if cause == nil || *cause != want { + want := ngap.CauseMiscUnspecified.Cause() + if cause == nil || !cause.Equal(want) { t.Errorf("cause = %v, want unspecified", cause) } } diff --git a/internal/amf/ngap/handle_path_switch_request.go b/internal/amf/ngap/handle_path_switch_request.go index 983cee34db..8380f085b8 100644 --- a/internal/amf/ngap/handle_path_switch_request.go +++ b/internal/amf/ngap/handle_path_switch_request.go @@ -23,9 +23,9 @@ import ( // appendPathSwitchReleasedItem records a PDU session the core could not switch in the // PATH SWITCH REQUEST ACKNOWLEDGE PDU Session Resource Released List so the NG-RAN // releases it; a session left unswitched has no downlink path (TS 38.413 §8.4.4.2). -func appendPathSwitchReleasedItem(ctx context.Context, ueConn *amf.UeConn, list *ngap.PDUSessionResourceReleasedListPSAck, pduSessionID uint8, causeValue int) { +func appendPathSwitchReleasedItem(ctx context.Context, ueConn *amf.UeConn, list *ngap.PDUSessionResourceReleasedListPSAck, pduSessionID uint8, causeValue ngap.CauseRadioNetwork) { transfer, err := (&ngap.PathSwitchRequestUnsuccessfulTransfer{ - Cause: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: causeValue}, + Cause: causeValue.Cause(), }).Marshal() if err != nil { ueConn.Log(ctx).Error("failed to build PathSwitchRequestUnsuccessfulTransfer", zap.Error(err), logger.PDUSessionID(pduSessionID)) @@ -169,7 +169,7 @@ func HandlePathSwitchRequest(ctx context.Context, amfInstance *amf.AMF, ran *amf amfUe.TraceConnection(ctx) } -func pathSwitchFailureCause(amfUe *amf.UeContext, pduSessionID uint8) int { +func pathSwitchFailureCause(amfUe *amf.UeContext, pduSessionID uint8) ngap.CauseRadioNetwork { if _, known := amfUe.SmContextFindByPDUSessionID(pduSessionID); !known { return ngap.CauseRadioNetworkUnknownPDUSessionID } @@ -219,8 +219,8 @@ func verifyUESecurityCapabilitiesOnPathSwitch( // negotiate E-UTRA algorithms with the UE, so the verify path compares only the // 5G NR columns. func ngapToNasUESecurityCapability(received *ngap.UESecurityCapabilities) *fgs.UESecurityCapability { - enc := byte(received.NREncryptionAlgorithms >> 8) - integ := byte(received.NRIntegrityProtectionAlgorithms >> 8) + enc := byte(received.NREncryptionAlgorithms.Uint16() >> 8) + integ := byte(received.NRIntegrityProtectionAlgorithms.Uint16() >> 8) return &fgs.UESecurityCapability{ EA: nas.AlgorithmSet((enc>>7&1)<<6 | (enc>>6&1)<<5 | (enc>>5&1)<<4), diff --git a/internal/amf/ngap/handle_path_switch_request_test.go b/internal/amf/ngap/handle_path_switch_request_test.go index 7d420c8cd4..eeb9de38d5 100644 --- a/internal/amf/ngap/handle_path_switch_request_test.go +++ b/internal/amf/ngap/handle_path_switch_request_test.go @@ -15,13 +15,14 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas/fgs" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/sctp" ) func buildPathSwitchRequestTransfer(teid uint32, ip []byte) (ngap.TransferContainer, error) { return (&ngap.PathSwitchRequestTransfer{ - DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: ngap.GTPTunnel{ - TransportLayerAddress: ngap.TransportLayerAddress(ip), + DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: &ngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets(ip), GTPTEID: ngap.GTPTEID(teid), }}, QosFlowAccepted: ngap.QosFlowAcceptedList{{QosFlowIdentifier: 1}}, @@ -36,12 +37,7 @@ func buildPathSwitchRequest( uESecurityCapabilities *ngap.UESecurityCapabilities, ) *ngap.PathSwitchRequest { msg := &ngap.PathSwitchRequest{ - UserLocationInformation: &ngap.UserLocationInformation{ - Kind: ngap.UserLocationNR, - PLMNIdentity: ngap.PLMNIdentity{0x02, 0xf8, 0x39}, - CellIdentity: 1, - TAI: ngap.TAI{PLMNIdentity: ngap.PLMNIdentity{0x02, 0xf8, 0x39}, TAC: 1}, - }, + UserLocationInformation: &ngap.UserLocationInformation{NR: &ngap.UserLocationInformationNR{NRCGI: ngap.NRCGI{PLMNIdentity: ngap.PLMNIdentity{0x02, 0xf8, 0x39}, NRCellIdentity: ngap.NRCellIdentity(1)}, TAI: ngap.TAI{PLMNIdentity: ngap.PLMNIdentity{0x02, 0xf8, 0x39}, TAC: 1}}}, UESecurityCapabilities: uESecurityCapabilities, PDUSessionResourceToBeSwitchedDLList: pduSessionDLList, PDUSessionResourceFailedToSetup: failedList, @@ -688,7 +684,7 @@ func TestPathSwitchRequest_FailedPDUSessionsReportedToSmf(t *testing.T) { } failedBytes, err := (&ngap.PathSwitchRequestSetupFailedTransfer{ - Cause: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID}, + Cause: ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause(), }).Marshal() if err != nil { t.Fatalf("failed to marshal failed transfer: %v", err) @@ -850,8 +846,10 @@ func TestPathSwitchRequest_UESecurityCapabilitiesMatching(t *testing.T) { } matchingCaps := &ngap.UESecurityCapabilities{ - NREncryptionAlgorithms: 0x8000, - NRIntegrityProtectionAlgorithms: 0x4000, + NREncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(0x8000), + NRIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(0x4000), + EUTRAEncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(0), + EUTRAIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(0), } msg := buildPathSwitchRequest( diff --git a/internal/amf/ngap/handle_pdu_session_resource_modify_indication.go b/internal/amf/ngap/handle_pdu_session_resource_modify_indication.go index 4ba8269a89..eb405d71f5 100644 --- a/internal/amf/ngap/handle_pdu_session_resource_modify_indication.go +++ b/internal/amf/ngap/handle_pdu_session_resource_modify_indication.go @@ -93,9 +93,9 @@ func HandlePDUSessionResourceModifyIndication(ctx context.Context, amfInstance * // appendFailedToModify records a session the AMF could not hand to the SMF, // carrying the reason in a Modify Indication Unsuccessful Transfer // (TS 38.413 §9.3.4.22). -func appendFailedToModify(ctx context.Context, ueConn *amf.UeConn, list ngap.PDUSessionResourceFailedToModifyListModCfm, pduSessionID ngap.PDUSessionID, causeValue int) ngap.PDUSessionResourceFailedToModifyListModCfm { +func appendFailedToModify(ctx context.Context, ueConn *amf.UeConn, list ngap.PDUSessionResourceFailedToModifyListModCfm, pduSessionID ngap.PDUSessionID, causeValue ngap.CauseRadioNetwork) ngap.PDUSessionResourceFailedToModifyListModCfm { t := &ngap.PDUSessionResourceModifyIndicationUnsuccessfulTransfer{ - Cause: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: causeValue}, + Cause: causeValue.Cause(), } transfer, err := t.Marshal() diff --git a/internal/amf/ngap/handle_pdu_session_resource_modify_indication_test.go b/internal/amf/ngap/handle_pdu_session_resource_modify_indication_test.go index 4cf782b17f..6092bf9428 100644 --- a/internal/amf/ngap/handle_pdu_session_resource_modify_indication_test.go +++ b/internal/amf/ngap/handle_pdu_session_resource_modify_indication_test.go @@ -27,8 +27,8 @@ func TestPDUSessionResourceModifyIndication_UnknownRanUeNgapID(t *testing.T) { ei := sender.SentErrorIndications[0] - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID} - if ei.Cause == nil || *ei.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() + if ei.Cause == nil || !ei.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want unknown-local-UE-NGAP-ID", ei.Cause) } } diff --git a/internal/amf/ngap/handle_pdu_session_resource_setup_response_test.go b/internal/amf/ngap/handle_pdu_session_resource_setup_response_test.go index 703309bd1a..07c60bf801 100644 --- a/internal/amf/ngap/handle_pdu_session_resource_setup_response_test.go +++ b/internal/amf/ngap/handle_pdu_session_resource_setup_response_test.go @@ -135,12 +135,9 @@ func TestHandlePDUSessionResourceSetupResponse_RecordsUserLocation(t *testing.T) plmn := ngap.PLMNIdentity{0x00, 0xf1, 0x10} HandlePDUSessionResourceSetupResponse(context.Background(), amfInstance, ran, &ngap.PDUSessionResourceSetupResponse{ - AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(10)), - RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), - UserLocationInformation: &ngap.UserLocationInformation{ - Kind: ngap.UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: ngap.TAI{PLMNIdentity: plmn, TAC: 7}, - }, + AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(10)), + RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), + UserLocationInformation: &ngap.UserLocationInformation{NR: &ngap.UserLocationInformationNR{NRCGI: ngap.NRCGI{PLMNIdentity: plmn, NRCellIdentity: ngap.NRCellIdentity(0x123456789)}, TAI: ngap.TAI{PLMNIdentity: plmn, TAC: 7}}}, }) loc := ueConn.Location.NrLocation diff --git a/internal/amf/ngap/handle_ran_configuration_update.go b/internal/amf/ngap/handle_ran_configuration_update.go index 32d16aac81..7c98ece942 100644 --- a/internal/amf/ngap/handle_ran_configuration_update.go +++ b/internal/amf/ngap/handle_ran_configuration_update.go @@ -107,7 +107,7 @@ func ranConfigUpdateOutcomeFor(req *ngap.RANConfigurationUpdate, operatorInfo *a } reason = "gNB broadcasts no PLMN served by this AMF (Unknown PLMN)" - if cause == causeNoServedTAC { + if cause.Equal(causeNoServedTAC) { reason = "gNB broadcasts a served PLMN but no TAC served by this AMF" } diff --git a/internal/amf/ngap/handle_ran_configuration_update_test.go b/internal/amf/ngap/handle_ran_configuration_update_test.go index 5f98ec97bc..250b7dcd80 100644 --- a/internal/amf/ngap/handle_ran_configuration_update_test.go +++ b/internal/amf/ngap/handle_ran_configuration_update_test.go @@ -139,9 +139,9 @@ func TestHandleRANConfigurationUpdate_NoMatchingTAC(t *testing.T) { } failure := sender.SentRanConfigurationUpdateFailures[0] - want := ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnspecified} + want := ngap.CauseMiscUnspecified.Cause() - if failure.Cause == nil || *failure.Cause != want { + if failure.Cause == nil || !failure.Cause.Equal(want) { t.Fatalf("cause = %v, want unspecified", failure.Cause) } } @@ -161,8 +161,8 @@ func TestHandleRANConfigurationUpdate_NoMatchingPLMN(t *testing.T) { failure := sender.SentRanConfigurationUpdateFailures[0] - want := ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnknownPLMNOrSNPN} - if failure.Cause == nil || *failure.Cause != want { + want := ngap.CauseMiscUnknownPLMNOrSNPN.Cause() + if failure.Cause == nil || !failure.Cause.Equal(want) { t.Fatalf("cause = %v, want unknown-PLMN-or-SNPN", failure.Cause) } } @@ -172,12 +172,7 @@ func TestHandleRANConfigurationUpdate_RebindsGlobalRANNodeID(t *testing.T) { ran := newTestRadio(newTestAMF()) amfInstance := newTestAMF() - newID := ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, - PLMNIdentity: ngap.PLMNIdentity{0x00, 0xf1, 0x10}, - Value: 0x0000AB, - Bits: 24, - } + newID := ngap.NewGlobalGNBID(ngap.PLMNIdentity{0x00, 0xf1, 0x10}, 0x0000AB, 24) HandleRANConfigurationUpdate(context.Background(), amfInstance, ran, &ngap.RANConfigurationUpdate{GlobalRANNodeID: &newID}) diff --git a/internal/amf/ngap/handle_ue_context_modification_test.go b/internal/amf/ngap/handle_ue_context_modification_test.go index e07c37f638..d10ca0ce4b 100644 --- a/internal/amf/ngap/handle_ue_context_modification_test.go +++ b/internal/amf/ngap/handle_ue_context_modification_test.go @@ -31,7 +31,7 @@ func TestUEContextModificationFailureForgetsTheUEAMBR(t *testing.T) { HandleUEContextModificationFailure(context.Background(), amfInstance, ran, &ngap.UEContextModificationFailure{ AMFUENGAPID: ngap.Ptr(ngap.AMFUENGAPID(1)), RANUENGAPID: ngap.Ptr(ngap.RANUENGAPID(1)), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified}, + Cause: new(ngap.CauseRadioNetworkUnspecified.Cause()), }) if _, ok := ueConn.HeldUEAMBR(); ok { diff --git a/internal/amf/ngap/handle_ue_context_release_request.go b/internal/amf/ngap/handle_ue_context_release_request.go index 36cfb86fef..9b96fe0bb0 100644 --- a/internal/amf/ngap/handle_ue_context_release_request.go +++ b/internal/amf/ngap/handle_ue_context_release_request.go @@ -14,10 +14,10 @@ import ( // causeReleaseUnspecified stands in for an omitted Cause IE (TS 38.413 §9.3.1.2, // CauseRadioNetwork "unspecified"). -var causeReleaseUnspecified = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified} +var causeReleaseUnspecified = ngap.CauseRadioNetworkUnspecified.Cause() func keepsConnectionForPendingDownlink(cause ngap.Cause, ueConn *amf.UeConn) bool { - if cause.Group != ngap.CauseGroupRadioNetwork || cause.Value != ngap.CauseRadioNetworkUserInactivity { + if cause.RadioNetwork == nil || *cause.RadioNetwork != ngap.CauseRadioNetworkUserInactivity { return false } diff --git a/internal/amf/ngap/handle_ue_context_release_request_test.go b/internal/amf/ngap/handle_ue_context_release_request_test.go index c5da13e139..1adbb6a5d5 100644 --- a/internal/amf/ngap/handle_ue_context_release_request_test.go +++ b/internal/amf/ngap/handle_ue_context_release_request_test.go @@ -20,7 +20,7 @@ func TestHandleUEContextReleaseRequest_UnknownUENGAPIDs(t *testing.T) { msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 999999, RANUENGAPID: 888888, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) @@ -31,8 +31,8 @@ func TestHandleUEContextReleaseRequest_UnknownUENGAPIDs(t *testing.T) { errInd := sender.SentErrorIndications[0] - wantRadioNetworkCause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID} - if errInd.Cause == nil || *errInd.Cause != wantRadioNetworkCause { + wantRadioNetworkCause := ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() + if errInd.Cause == nil || !errInd.Cause.Equal(wantRadioNetworkCause) { t.Errorf("cause = %v, want unknown-local-UE-NGAP-ID", errInd.Cause) } @@ -55,7 +55,7 @@ func TestHandleUEContextReleaseRequest_UEFoundRegistered(t *testing.T) { msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) @@ -65,8 +65,8 @@ func TestHandleUEContextReleaseRequest_UEFoundRegistered(t *testing.T) { } cmd := sender.SentUEContextReleaseCommands[0] - if cmd.UENGAPIDs.AMFUENGAPID != 10 || cmd.UENGAPIDs.RANUENGAPID != 1 { - t.Errorf("UEContextReleaseCommand IDs = (%d, %d), want (10, 1)", cmd.UENGAPIDs.AMFUENGAPID, cmd.UENGAPIDs.RANUENGAPID) + if pair := cmd.UENGAPIDs.UENGAPIDPair; pair == nil || pair.AMFUENGAPID != 10 || pair.RANUENGAPID != 1 { + t.Errorf("UEContextReleaseCommand IDs = %+v, want (10, 1)", cmd.UENGAPIDs) } if ueConn.ReleaseAction() != amf.UeContextN2NormalRelease { @@ -79,8 +79,8 @@ func TestSendUEContextReleaseCommand_Idempotent(t *testing.T) { sender := ran.Conn.(*fakeNGAPSender) ueConn := amf.NewUeConnForTest(ran, 1, 10) - ueConn.SendUEContextReleaseCommand(context.Background(), ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) - ueConn.SendUEContextReleaseCommand(context.Background(), ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) + ueConn.SendUEContextReleaseCommand(context.Background(), ngap.CauseNASNormalRelease.Cause()) + ueConn.SendUEContextReleaseCommand(context.Background(), ngap.CauseNASNormalRelease.Cause()) if len(sender.SentUEContextReleaseCommands) != 1 { t.Fatalf("expected a single UE Context Release Command, got %d", len(sender.SentUEContextReleaseCommands)) @@ -102,7 +102,7 @@ func TestHandleUEContextReleaseRequest_UserInactivityWithPendingMTTraffic(t *tes msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) @@ -128,7 +128,7 @@ func TestHandleUEContextReleaseRequest_OtherCauseReleasesDespitePendingMTTraffic msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioConnectionWithUELost}, + Cause: new(ngap.CauseRadioNetworkRadioConnectionWithUELost.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) @@ -157,7 +157,7 @@ func TestHandleUEContextReleaseRequest_UserInactivityDuringAnN2Setup(t *testing. msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) @@ -195,7 +195,7 @@ func TestHandleUEContextReleaseRequest_PagedRequestDoesNotFollowTheUEOntoANewCon msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 11, RANUENGAPID: 2, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) @@ -224,7 +224,7 @@ func TestHandleUEContextReleaseRequest_DeferredReleaseResumesWhenTheN2SetupEnds( msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) @@ -267,7 +267,7 @@ func TestHandleUEContextReleaseRequest_DeferredReleaseOfANonRegisteredUEStillRel msg := &ngap.UEContextReleaseRequest{ AMFUENGAPID: 10, RANUENGAPID: 1, - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, + Cause: new(ngap.CauseRadioNetworkUserInactivity.Cause()), } HandleUEContextReleaseRequest(context.Background(), amfInstance, ran, msg) diff --git a/internal/amf/ngap/handle_uplink_nas_transport_test.go b/internal/amf/ngap/handle_uplink_nas_transport_test.go index 5f949feb0d..8be7476ac7 100644 --- a/internal/amf/ngap/handle_uplink_nas_transport_test.go +++ b/internal/amf/ngap/handle_uplink_nas_transport_test.go @@ -29,8 +29,8 @@ func TestHandleUplinkNASTransport_UnknownUeConn_SendsErrorIndication(t *testing. cause := sender.SentErrorIndications[0].Cause - want := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID} - if cause == nil || *cause != want { + want := ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() + if cause == nil || !cause.Equal(want) { t.Errorf("cause = %v, want unknown-local-UE-NGAP-ID", cause) } } @@ -140,14 +140,10 @@ func TestHandleUplinkNASTransport_LocationUpdatedBeforeNAS(t *testing.T) { ueConn.AMFForTest().AttachUeConn(t.Context(), amfUe, ueConn) HandleUplinkNASTransport(context.Background(), amfInstance, ran, &ngap.UplinkNASTransport{ - AMFUENGAPID: 10, - RANUENGAPID: 1, - NASPDU: ngap.NASPDU{0xCC}, - UserLocationInformation: &ngap.UserLocationInformation{ - Kind: ngap.UserLocationNR, PLMNIdentity: ngap.PLMNIdentity{0x00, 0xf1, 0x10}, - CellIdentity: 0x123456789, - TAI: ngap.TAI{PLMNIdentity: ngap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, - }, + AMFUENGAPID: 10, + RANUENGAPID: 1, + NASPDU: ngap.NASPDU{0xCC}, + UserLocationInformation: &ngap.UserLocationInformation{NR: &ngap.UserLocationInformationNR{NRCGI: ngap.NRCGI{PLMNIdentity: ngap.PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: ngap.NRCellIdentity(0x123456789)}, TAI: ngap.TAI{PLMNIdentity: ngap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}}, }) if len(fakeNAS.Calls) != 1 { diff --git a/internal/amf/ngap/handle_uplink_ran_configuration_transfer_test.go b/internal/amf/ngap/handle_uplink_ran_configuration_transfer_test.go index 2fd66b738f..4ab05c5393 100644 --- a/internal/amf/ngap/handle_uplink_ran_configuration_transfer_test.go +++ b/internal/amf/ngap/handle_uplink_ran_configuration_transfer_test.go @@ -136,8 +136,8 @@ func TestUplinkRANConfigurationTransfer_ForwardsToTargetRan(t *testing.T) { t.Fatalf("forwarded transfer does not decode: %v", err) } - if got.GlobalRANNodeID.Kind != ngap.RANNodeIDGNB { - t.Fatalf("forwarded transfer lost its target gNB ID: kind = %d", got.GlobalRANNodeID.Kind) + if got.GlobalRANNodeID.GlobalGNBID == nil { + t.Fatalf("forwarded transfer lost its target gNB ID: %+v", got.GlobalRANNodeID) } if want := "000102"; got.GlobalRANNodeID.Hex() != want { diff --git a/internal/amf/ngap/handover.go b/internal/amf/ngap/handover.go index e4e09abe38..89d47bc593 100644 --- a/internal/amf/ngap/handover.go +++ b/internal/amf/ngap/handover.go @@ -6,11 +6,11 @@ package ngap import "github.com/ellanetworks/core/ngap" var ( - causeHOFailureInTarget = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHOFailureInTarget} - causeHOTargetNotAllowed = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHoTargetNotAllowed} - causeUnknownTargetID = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownTargetID} - causeHandoverNoSecurity = ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASAuthenticationFailure} - causeHandoverPrepUnspecific = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified} - causeUnknownPDUSessionID = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownPDUSessionID} - causeHandoverCNReason = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkReleaseDueTo5GCGeneratedReason} + causeHOFailureInTarget = ngap.CauseRadioNetworkHOFailureInTarget.Cause() + causeHOTargetNotAllowed = ngap.CauseRadioNetworkHoTargetNotAllowed.Cause() + causeUnknownTargetID = ngap.CauseRadioNetworkUnknownTargetID.Cause() + causeHandoverNoSecurity = ngap.CauseNASAuthenticationFailure.Cause() + causeHandoverPrepUnspecific = ngap.CauseRadioNetworkUnspecified.Cause() + causeUnknownPDUSessionID = ngap.CauseRadioNetworkUnknownPDUSessionID.Cause() + causeHandoverCNReason = ngap.CauseRadioNetworkReleaseDueTo5GCGeneratedReason.Cause() ) diff --git a/internal/amf/ngap/handover_conformance_test.go b/internal/amf/ngap/handover_conformance_test.go index 1ffcedb9c5..1c07543a8d 100644 --- a/internal/amf/ngap/handover_conformance_test.go +++ b/internal/amf/ngap/handover_conformance_test.go @@ -154,7 +154,7 @@ func unsuccessfulTransfer(t *testing.T) ngap.TransferContainer { t.Helper() b, err := (&ngap.HandoverResourceAllocationUnsuccessfulTransfer{ - Cause: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: ngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }).Marshal() if err != nil { t.Fatalf("marshal Handover Resource Allocation Unsuccessful Transfer: %v", err) @@ -274,7 +274,7 @@ func TestN2HandoverCommandReportsEveryUnadmittedSession(t *testing.T) { want := causeHOFailureInTarget if tt.failed != nil { - want = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioResourcesNotAvailable} + want = ngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() } assertToReleaseCause(t, cmd, 2, want) @@ -344,7 +344,7 @@ func assertToReleaseCause(t *testing.T, cmd *ngap.HandoverCommand, pduSessionID t.Fatalf("to-release transfer for PDU session %d does not decode: %v", pduSessionID, err) } - if transfer.Cause != want { + if !transfer.Cause.Equal(want) { t.Errorf("to-release cause for PDU session %d = %+v, want %+v", pduSessionID, transfer.Cause, want) } @@ -561,7 +561,7 @@ func TestN2HandoverFailureWithoutRanUeNgapIDFailsPreparation(t *testing.T) { env.required(t, 1) req := env.handoverRequest(t) - cause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioResourcesNotAvailable} + cause := ngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() HandleHandoverFailure(context.Background(), env.amf, env.targetRan, &ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(req.AMFUENGAPID), @@ -574,7 +574,7 @@ func TestN2HandoverFailureWithoutRanUeNgapIDFailsPreparation(t *testing.T) { } got := env.source.SentHandoverPreparationFailures[0] - if got.Cause == nil || *got.Cause != cause { + if got.Cause == nil || !got.Cause.Equal(cause) { t.Errorf("preparation failure cause = %+v, want the target's %+v", got.Cause, cause) } } @@ -626,8 +626,8 @@ func TestN2HandoverNotifyCompletesEachSessionAndReleasesTheSource(t *testing.T) cmd := env.source.SentUEContextReleaseCommands[0] - want := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkSuccessfulHandover} - if cmd.Cause == nil || *cmd.Cause != want { + want := ngap.CauseRadioNetworkSuccessfulHandover.Cause() + if cmd.Cause == nil || !cmd.Cause.Equal(want) { t.Errorf("source release cause = %+v, want successful-handover", cmd.Cause) } } @@ -681,7 +681,7 @@ func TestN2HandoverCancelReleasesTargetAndAcknowledges(t *testing.T) { env.required(t, 1) env.acknowledge(t, []uint8{1}, nil) - cause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTNGRelocOverallExpiry} + cause := ngap.CauseRadioNetworkTNGRelocOverallExpiry.Cause() HandleHandoverCancel(context.Background(), env.amf, env.sourceRan, &ngap.HandoverCancel{ AMFUENGAPID: ngap.AMFUENGAPID(env.sourceUe.AmfUeNgapID), diff --git a/internal/amf/ngap/handover_from_eps_roaming_test.go b/internal/amf/ngap/handover_from_eps_roaming_test.go index 0cf70ae737..53420ce9e6 100644 --- a/internal/amf/ngap/handover_from_eps_roaming_test.go +++ b/internal/amf/ngap/handover_from_eps_roaming_test.go @@ -107,7 +107,7 @@ func TestForwardRelocationRefusesAVisitorWithoutN26(t *testing.T) { } var refusal interworking.TargetRefusal - if !errors.As(err, &refusal) || refusal.Cause.Value != s1ap.CauseRadioNetworkHOTargetNotAllowed { + if !errors.As(err, &refusal) || !refusal.Cause.Equal(s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()) { t.Fatalf("error = %v, want a handover-target-not-allowed refusal", err) } diff --git a/internal/amf/ngap/handover_from_eps_test.go b/internal/amf/ngap/handover_from_eps_test.go index 0a5632f533..e3caf78b98 100644 --- a/internal/amf/ngap/handover_from_eps_test.go +++ b/internal/amf/ngap/handover_from_eps_test.go @@ -118,7 +118,7 @@ func arrivingRequest() interworking.FiveGSRelocationRequest { }}, Target: arrivingTarget(), SourceToTarget: []byte{0x01, 0x02}, - Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkTimeCriticalHandover}, + Cause: s1ap.CauseRadioNetworkTimeCriticalHandover.Cause(), UEAMBRUplink: models.MustParseBitRate("1 Gbps"), UEAMBRDownlink: models.MustParseBitRate("1 Gbps"), } @@ -253,7 +253,7 @@ func TestForwardRelocationSendsAnInterSystemHandoverRequest(t *testing.T) { t.Error("no next-hop key for the target NG-RAN node") } - if hoReq.Cause == nil || *hoReq.Cause != (ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTimeCriticalHandover}) { + if hoReq.Cause == nil || !hoReq.Cause.Equal(ngap.CauseRadioNetworkTimeCriticalHandover.Cause()) { t.Errorf("cause = %+v, want the source eNB's time-critical handover mapped through", hoReq.Cause) } @@ -261,11 +261,11 @@ func TestForwardRelocationSendsAnInterSystemHandoverRequest(t *testing.T) { t.Error("no Mobility Restriction List, so the target cannot determine the serving PLMN") } - if got := hoReq.UESecurityCapabilities.EUTRAEncryptionAlgorithms; got != 0xc000 { + if got := hoReq.UESecurityCapabilities.EUTRAEncryptionAlgorithms.Uint16(); got != 0xc000 { t.Errorf("E-UTRA encryption algorithms = %#04x, want the forwarded 0xc000", got) } - if got := hoReq.UESecurityCapabilities.EUTRAIntegrityProtectionAlgorithms; got != 0xc000 { + if got := hoReq.UESecurityCapabilities.EUTRAIntegrityProtectionAlgorithms.Uint16(); got != 0xc000 { t.Errorf("E-UTRA integrity algorithms = %#04x, want the forwarded 0xc000", got) } @@ -367,7 +367,7 @@ func TestHandoverFailureFromEPSRefusesTheRelocation(t *testing.T) { HandleHandoverFailure(context.Background(), amfInstance, radio, &ngap.HandoverFailure{ AMFUENGAPID: ngap.Ptr(hoReq.AMFUENGAPID), - Cause: &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell}, + Cause: new(ngap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause()), }) _, err := awaitArrival(t, done) @@ -380,8 +380,8 @@ func TestHandoverFailureFromEPSRefusesTheRelocation(t *testing.T) { t.Fatalf("error = %v, want a refusal carrying the target's cause", err) } - want := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell} - if refusal.Cause != want { + want := s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause() + if !refusal.Cause.Equal(want) { t.Errorf("refusal cause = %+v, want %+v mapped from the gNB's own", refusal.Cause, want) } } @@ -511,8 +511,8 @@ func TestForwardRelocationRefusesASubscriberBarredFrom5GS(t *testing.T) { t.Fatalf("error = %v, want a TargetRefusal the MME can map to an S1AP cause", err) } - want := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed} - if refusal.Cause != want { + want := s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause() + if !refusal.Cause.Equal(want) { t.Errorf("cause = %+v, want ho-target-not-allowed", refusal.Cause) } @@ -567,8 +567,8 @@ func TestForwardRelocationRefusesAUEThatIsNotAnOwnSubscriber(t *testing.T) { t.Fatalf("error = %v, TargetRefusal = %v, want %v", err, got, tc.wantRefusal) } - want := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed} - if tc.wantRefusal && refusal.Cause != want { + want := s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause() + if tc.wantRefusal && !refusal.Cause.Equal(want) { t.Errorf("cause = %+v, want ho-target-not-allowed", refusal.Cause) } diff --git a/internal/amf/ngap/handover_to_eps_test.go b/internal/amf/ngap/handover_to_eps_test.go index 778b7df24c..2f4af74ed3 100644 --- a/internal/amf/ngap/handover_to_eps_test.go +++ b/internal/amf/ngap/handover_to_eps_test.go @@ -142,10 +142,7 @@ func handoverRequiredToENB(t *testing.T, sessions ...uint8) *ngap.HandoverRequir msg.TargetID = ngap.TargetID{TargeteNBID: &ngap.TargeteNBID{ GlobalENBID: ngap.GlobalNgENBID{ PLMNIdentity: operatorPLMN, - NgENBID: ngap.NgENBID{ - Kind: ngap.NgENBIDMacro, - Value: relocationTargetENBID, - }, + NgENBID: ngap.NgENBID{MacroNgENBID: new(ngap.MacroNgENBID(relocationTargetENBID))}, }, SelectedEPSTAI: ngap.EPSTAI{PLMNIdentity: operatorPLMN, TAC: 1}, }} @@ -349,9 +346,7 @@ func TestHandoverRequiredToEPSRelaysATargetNotAllowedRefusal(t *testing.T) { err error }{ {"a subscriber who is not a home subscriber", interworking.RefuseN26Relocation()}, - {"a subscriber barred from 4G", interworking.TargetRefusal{Cause: s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed, - }}}, + {"a subscriber barred from 4G", interworking.TargetRefusal{Cause: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()}}, } { t.Run(tc.name, func(t *testing.T) { peer := &epsPeerStub{err: tc.err} @@ -367,7 +362,7 @@ func TestHandoverRequiredToEPSRelaysATargetNotAllowedRefusal(t *testing.T) { } got := sender.SentHandoverPreparationFailures[0].Cause - if got == nil || *got != causeHOTargetNotAllowed { + if got == nil || !got.Equal(causeHOTargetNotAllowed) { t.Errorf("cause = %+v, want ho-target-not-allowed", got) } }) @@ -396,7 +391,7 @@ func TestHandoverRequiredToEPSOfARoamingVisitorIsRefusedAtTheSource(t *testing.T t.Fatalf("got %d Handover Preparation Failures, want 1", len(sender.SentHandoverPreparationFailures)) } - if got := sender.SentHandoverPreparationFailures[0].Cause; got == nil || *got != causeHOTargetNotAllowed { + if got := sender.SentHandoverPreparationFailures[0].Cause; got == nil || !got.Equal(causeHOTargetNotAllowed) { t.Errorf("cause = %+v, want ho-target-not-allowed", got) } @@ -634,16 +629,14 @@ func TestHandoverToEPSFailureCause(t *testing.T) { {"unknown target", fmt.Errorf("wrapped: %w", interworking.ErrUnknownTarget), causeUnknownTargetID}, { "the target eNB's own cause", - interworking.TargetRefusal{Cause: s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell, - }}, - ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell}, + interworking.TargetRefusal{Cause: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause()}, + ngap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(), }, {"target refused", fmt.Errorf("wrapped: %w", interworking.ErrTargetRefused), causeHOFailureInTarget}, {"anything else", errors.New("boom"), causeHOFailureInTarget}, } { t.Run(tc.name, func(t *testing.T) { - if got := handoverToEPSFailureCause(tc.err); got != tc.want { + if got := handoverToEPSFailureCause(tc.err); !got.Equal(tc.want) { t.Errorf("cause = %+v, want %+v", got, tc.want) } }) diff --git a/internal/amf/ngap/ng_setup_outcome_test.go b/internal/amf/ngap/ng_setup_outcome_test.go index 67db39032d..4b7578f8f8 100644 --- a/internal/amf/ngap/ng_setup_outcome_test.go +++ b/internal/amf/ngap/ng_setup_outcome_test.go @@ -81,10 +81,8 @@ func outcomeRequest(t *testing.T, mcc, mnc string, tac uint32) *ngap.NGSetupRequ } return &ngap.NGSetupRequest{ - GlobalRANNodeID: ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, PLMNIdentity: plmn, Value: 0x000102, Bits: 24, - }, - RANNodeName: ngap.Ptr("ella-gnb"), + GlobalRANNodeID: ngap.NewGlobalGNBID(plmn, 0x000102, 24), + RANNodeName: ngap.Ptr("ella-gnb"), SupportedTAList: ngap.SupportedTAList{{ TAC: ngap.TAC(tac), BroadcastPLMNList: ngap.BroadcastPLMNList{{ @@ -182,7 +180,7 @@ func TestNGSetupOutcomeRejects(t *testing.T) { t.Fatalf("parse failure: %v", err) } - if fail.Cause == nil || *fail.Cause != tt.wantCause { + if fail.Cause == nil || !fail.Cause.Equal(tt.wantCause) { t.Errorf("cause = %v, want %v", fail.Cause, tt.wantCause) } }) diff --git a/internal/amf/ngap/path_switch_conformance_test.go b/internal/amf/ngap/path_switch_conformance_test.go index 3dc10f8386..a873538116 100644 --- a/internal/amf/ngap/path_switch_conformance_test.go +++ b/internal/amf/ngap/path_switch_conformance_test.go @@ -427,7 +427,7 @@ func TestPathSwitchToleratesAbsentIgnoreCriticalityIEs(t *testing.T) { ngap.Ptr(ngap.RANUENGAPID(2)), ngap.PDUSessionResourceToBeSwitchedDLList{switchedDLItem(t)}, nil, - ngap.Ptr(ngap.UESecurityCapabilities{NREncryptionAlgorithms: 0xc000, NRIntegrityProtectionAlgorithms: 0xc000}), + ngap.Ptr(ngap.UESecurityCapabilities{NREncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(0xc000), NRIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(0xc000), EUTRAEncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(0), EUTRAIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(0)}), ) encoded, err := full.Marshal() diff --git a/internal/amf/ngap/path_switch_failure.go b/internal/amf/ngap/path_switch_failure.go index 42932d6aa7..b1cce62552 100644 --- a/internal/amf/ngap/path_switch_failure.go +++ b/internal/amf/ngap/path_switch_failure.go @@ -54,7 +54,7 @@ func pathSwitchFailedSessions(items ngap.PDUSessionResourceFailedToSetupListPSRe // sendPathSwitchRequestFailure refuses a path switch. TS 38.413 §9.2.3.10 has // no Cause IE for the message as a whole — unlike TS 36.413 §9.1.5.10 — so the // reason is reported per session, once for every session the request named. -func sendPathSwitchRequestFailure(ctx context.Context, ran *amf.Radio, msg *ngap.PathSwitchRequest, causeValue int) { +func sendPathSwitchRequestFailure(ctx context.Context, ran *amf.Radio, msg *ngap.PathSwitchRequest, causeValue ngap.CauseRadioNetwork) { released, err := pathSwitchReleasedList(msg.PDUSessionResourceToBeSwitchedDLList, causeValue) if err != nil { ran.Log(ctx).Error("error building path switch released list", zap.Error(err)) @@ -77,7 +77,7 @@ func sendPathSwitchRequestFailure(ctx context.Context, ran *amf.Radio, msg *ngap // pathSwitchReleasedList builds the released list with one item per distinct // requested PDU session (TS 38.413). -func pathSwitchReleasedList(items ngap.PDUSessionResourceToBeSwitchedDLList, causeValue int) (ngap.PDUSessionResourceReleasedListPSFail, error) { +func pathSwitchReleasedList(items ngap.PDUSessionResourceToBeSwitchedDLList, causeValue ngap.CauseRadioNetwork) (ngap.PDUSessionResourceReleasedListPSFail, error) { transfer, err := buildPathSwitchRequestUnsuccessfulTransfer(causeValue) if err != nil { return nil, err @@ -102,9 +102,9 @@ func pathSwitchReleasedList(items ngap.PDUSessionResourceToBeSwitchedDLList, cau return list, nil } -func buildPathSwitchRequestUnsuccessfulTransfer(causeValue int) (ngap.TransferContainer, error) { +func buildPathSwitchRequestUnsuccessfulTransfer(causeValue ngap.CauseRadioNetwork) (ngap.TransferContainer, error) { b, err := (&ngap.PathSwitchRequestUnsuccessfulTransfer{ - Cause: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: causeValue}, + Cause: causeValue.Cause(), }).Marshal() if err != nil { return nil, fmt.Errorf("encode path switch request unsuccessful transfer: %w", err) diff --git a/internal/amf/ngap/resolve_ue.go b/internal/amf/ngap/resolve_ue.go index 8f41b9812b..762960e690 100644 --- a/internal/amf/ngap/resolve_ue.go +++ b/internal/amf/ngap/resolve_ue.go @@ -98,16 +98,12 @@ func resolveDecodedUE(ctx context.Context, amfInstance *amf.AMF, ran *amf.Radio, // causeUnknownLocalUEID is Cause Radio Network "unknown-local-UE-NGAP-ID" // (TS 38.413): an AMF UE NGAP ID this AMF does not hold. -var causeUnknownLocalUEID = ngap.Cause{ - Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID, -} +var causeUnknownLocalUEID = ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() // causeInconsistentRemoteUEID is Cause Radio Network // "inconsistent-remote-UE-NGAP-ID" (TS 38.413): a RAN UE NGAP ID that does not // match the one stored against its AMF UE NGAP ID. -var causeInconsistentRemoteUEID = ngap.Cause{ - Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkInconsistentRemoteUEID, -} +var causeInconsistentRemoteUEID = ngap.CauseRadioNetworkInconsistentRemoteUEID.Cause() func sendUnknownLocalUEError(ctx context.Context, ran *amf.Radio, amfID, ranID *int64) { a, r := decodedUEIDs(amfID, ranID) diff --git a/internal/amf/ngap/resolve_ue_test.go b/internal/amf/ngap/resolve_ue_test.go index 04c2c83e24..cf57402798 100644 --- a/internal/amf/ngap/resolve_ue_test.go +++ b/internal/amf/ngap/resolve_ue_test.go @@ -12,7 +12,7 @@ import ( "github.com/ellanetworks/core/sctp" ) -func assertSingleErrorIndication(t *testing.T, sender *fakeNGAPSender, wantCause int) *ngap.ErrorIndication { +func assertSingleErrorIndication(t *testing.T, sender *fakeNGAPSender, wantCause ngap.CauseRadioNetwork) *ngap.ErrorIndication { t.Helper() if len(sender.SentErrorIndications) != 1 { @@ -21,9 +21,9 @@ func assertSingleErrorIndication(t *testing.T, sender *fakeNGAPSender, wantCause errInd := sender.SentErrorIndications[0] - want := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: wantCause} - if errInd.Cause == nil || *errInd.Cause != want { - t.Errorf("cause = %v, want radio-network cause %d", errInd.Cause, wantCause) + want := wantCause.Cause() + if errInd.Cause == nil || !errInd.Cause.Equal(want) { + t.Errorf("cause = %v, want radio-network cause %v", errInd.Cause, want) } return errInd @@ -73,8 +73,8 @@ func TestCrossRadio_PDUSessionResourceSetupResponse(t *testing.T) { t.Fatalf("expected 1 ErrorIndication on attacker radio, got %d", len(attackerSender.SentErrorIndications)) } - want := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnknownLocalUENGAPID} - if cause := attackerSender.SentErrorIndications[0].Cause; cause == nil || *cause != want { + want := ngap.CauseRadioNetworkUnknownLocalUENGAPID.Cause() + if cause := attackerSender.SentErrorIndications[0].Cause; cause == nil || !cause.Equal(want) { t.Errorf("cause = %v, want unknown-local-UE-NGAP-ID", cause) } @@ -182,8 +182,8 @@ func TestInconsistentRanIDSendsErrorIndicationAndReleasesLocally(t *testing.T) { t.Fatalf("expected 1 ErrorIndication, got %d", len(sender.SentErrorIndications)) } - want := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkInconsistentRemoteUEID} - if cause := sender.SentErrorIndications[0].Cause; cause == nil || *cause != want { + want := ngap.CauseRadioNetworkInconsistentRemoteUEID.Cause() + if cause := sender.SentErrorIndications[0].Cause; cause == nil || !cause.Equal(want) { t.Errorf("cause = %v, want inconsistent-remote-UE-NGAP-ID", cause) } diff --git a/internal/amf/ngap/route_internal_test.go b/internal/amf/ngap/route_internal_test.go index d402fb2b94..f241a9f386 100644 --- a/internal/amf/ngap/route_internal_test.go +++ b/internal/amf/ngap/route_internal_test.go @@ -125,8 +125,7 @@ func TestHandleHandoverRequired_TargeteNBIDSendsPreparationFailure(t *testing.T) failure.AMFUENGAPID, failure.RANUENGAPID) } - if failure.Cause == nil || failure.Cause.Group != ngaplib.CauseGroupProtocol || - failure.Cause.Value != ngaplib.CauseProtocolAbstractSyntaxErrorReject { + if failure.Cause == nil || !failure.Cause.Equal(ngaplib.CauseProtocolAbstractSyntaxErrorReject.Cause()) { t.Fatalf("cause = %+v, want protocol abstract-syntax-error-reject", failure.Cause) } @@ -169,8 +168,8 @@ func TestSendProtocolErrorIndication(t *testing.T) { ind := sentErrorIndication(t, w.msgs[0]) - want := ngaplib.Cause{Group: ngaplib.CauseGroupProtocol, Value: ngaplib.CauseProtocolTransferSyntaxError} - if ind.Cause == nil || *ind.Cause != want { + want := ngaplib.CauseProtocolTransferSyntaxError.Cause() + if ind.Cause == nil || !ind.Cause.Equal(want) { t.Errorf("cause = %v, want transfer-syntax-error", ind.Cause) } @@ -185,7 +184,7 @@ func TestRespondToUnknownProcedure(t *testing.T) { name string crit ngaplib.Criticality wantReply bool - wantCause int + wantCause ngaplib.CauseProtocol }{ {"reject", ngaplib.CriticalityReject, true, ngaplib.CauseProtocolAbstractSyntaxErrorReject}, {"ignore-and-notify", ngaplib.CriticalityNotify, true, ngaplib.CauseProtocolAbstractSyntaxErrorIgnoreAndNotify}, @@ -216,8 +215,8 @@ func TestRespondToUnknownProcedure(t *testing.T) { ind := sentErrorIndication(t, w.msgs[0]) - want := ngaplib.Cause{Group: ngaplib.CauseGroupProtocol, Value: tt.wantCause} - if ind.Cause == nil || *ind.Cause != want { + want := tt.wantCause.Cause() + if ind.Cause == nil || !ind.Cause.Equal(want) { t.Errorf("cause = %v, want %v", ind.Cause, want) } diff --git a/internal/amf/ngap/superseded_release_test.go b/internal/amf/ngap/superseded_release_test.go index a117fbc797..c3f12b0295 100644 --- a/internal/amf/ngap/superseded_release_test.go +++ b/internal/amf/ngap/superseded_release_test.go @@ -48,7 +48,7 @@ func TestSupersededConnectionIsReleasedTowardGNB(t *testing.T) { var released bool for _, cmd := range sender.SentUEContextReleaseCommands { - if cmd.UENGAPIDs.AMFUENGAPID == ngap.AMFUENGAPID(oldAmfID) && cmd.UENGAPIDs.RANUENGAPID == ngap.RANUENGAPID(oldRanID) { + if p := cmd.UENGAPIDs.UENGAPIDPair; p != nil && p.AMFUENGAPID == ngap.AMFUENGAPID(oldAmfID) && p.RANUENGAPID == ngap.RANUENGAPID(oldRanID) { released = true } } diff --git a/internal/amf/ngap/unknown_procedure.go b/internal/amf/ngap/unknown_procedure.go index b16989438f..277a84d67f 100644 --- a/internal/amf/ngap/unknown_procedure.go +++ b/internal/amf/ngap/unknown_procedure.go @@ -25,7 +25,7 @@ func respondToUnknownProcedure(ctx context.Context, ran *amf.Radio, pdu ngap.PDU return } - var cause int + var cause ngap.CauseProtocol switch im.Criticality { case ngap.CriticalityReject: @@ -44,7 +44,7 @@ func respondToUnknownProcedure(ctx context.Context, ran *amf.Radio, pdu ngap.PDU crit := im.Criticality emitErrorIndication(ctx, ran, &ngap.ErrorIndication{ - Cause: &ngap.Cause{Group: ngap.CauseGroupProtocol, Value: cause}, + Cause: new(cause.Cause()), CriticalityDiagnostics: &ngap.CriticalityDiagnostics{ ProcedureCode: &proc, TriggeringMessage: &trigger, @@ -55,8 +55,8 @@ func respondToUnknownProcedure(ctx context.Context, ran *amf.Radio, pdu ngap.PDU // sendProtocolErrorIndication answers octets that did not decode at all, where // no procedure or IE can be named (TS 38.413 §10.2). -func sendProtocolErrorIndication(ctx context.Context, ran *amf.Radio, cause int) { +func sendProtocolErrorIndication(ctx context.Context, ran *amf.Radio, cause ngap.CauseProtocol) { emitErrorIndication(ctx, ran, &ngap.ErrorIndication{ - Cause: &ngap.Cause{Group: ngap.CauseGroupProtocol, Value: cause}, + Cause: new(cause.Cause()), }) } diff --git a/internal/amf/paging.go b/internal/amf/paging.go index 1799ff895a..c7b754dee8 100644 --- a/internal/amf/paging.go +++ b/internal/amf/paging.go @@ -202,7 +202,7 @@ func (amf *AMF) buildPaging(guami *models.Guami, ue *UeContext) (*ngap.Paging, e } return &ngap.Paging{ - FiveGSTMSI: stmsi, + UEPagingIdentity: &ngap.UEPagingIdentity{FiveGSTMSI: stmsi}, TAIListForPaging: taiList, // Replay the gNB-reported paging capability so it can apply paging // optimisations (TS 38.413 §9.3.1.68); omitted when none was reported. @@ -228,12 +228,12 @@ func fiveGSTMSIFor(guti etsi.GUTI5G) (*ngap.FiveGSTMSI, error) { }, nil } -func areaToNGAPTAIs(area []models.Tai) ([]ngap.TAI, error) { +func areaToNGAPTAIs(area []models.Tai) (ngap.TAIListForPaging, error) { if len(area) == 0 { return nil, fmt.Errorf("empty registration area") } - out := make([]ngap.TAI, 0, len(area)) + out := make(ngap.TAIListForPaging, 0, len(area)) for _, t := range area { if t.PlmnID == nil { @@ -250,7 +250,7 @@ func areaToNGAPTAIs(area []models.Tai) ([]ngap.TAI, error) { return nil, fmt.Errorf("parse TAC %q: %w", t.Tac, err) } - out = append(out, ngap.TAI{PLMNIdentity: plmn, TAC: ngap.TAC(tac)}) + out = append(out, ngap.TAIListForPagingItem{TAI: ngap.TAI{PLMNIdentity: plmn, TAC: ngap.TAC(tac)}}) } return out, nil diff --git a/internal/amf/paging_test.go b/internal/amf/paging_test.go index 169f11cf75..fd4ae7ae49 100644 --- a/internal/amf/paging_test.go +++ b/internal/amf/paging_test.go @@ -44,15 +44,17 @@ func TestBuildPaging(t *testing.T) { t.Fatalf("BuildPaging: %v", err) } - if paging.FiveGSTMSI == nil { + if paging.UEPagingIdentity == nil || paging.UEPagingIdentity.FiveGSTMSI == nil { t.Fatal("paging carries no 5G-S-TMSI") } - if got, want := paging.FiveGSTMSI.AMFSetID, ngap.AMFSetID(uint16(0xfe)<<2|uint16(0x00)>>6); got != want { + stmsi := paging.UEPagingIdentity.FiveGSTMSI + + if got, want := stmsi.AMFSetID, ngap.AMFSetID(uint16(0xfe)<<2|uint16(0x00)>>6); got != want { t.Errorf("AMFSetID = %d, want %d", got, want) } - if got := paging.FiveGSTMSI.FiveGTMSI; got != ngap.FiveGTMSI(0x0000dead) { + if got := stmsi.FiveGTMSI; got != ngap.FiveGTMSI(0x0000dead) { t.Errorf("5G-TMSI = %#x, want %#x", got, 0x0000dead) } @@ -60,8 +62,8 @@ func TestBuildPaging(t *testing.T) { t.Fatalf("TAI list length = %d, want 1", len(paging.TAIListForPaging)) } - if paging.TAIListForPaging[0].TAC != 1 { - t.Errorf("paging TAI TAC = %d, want 1 (served)", paging.TAIListForPaging[0].TAC) + if paging.TAIListForPaging[0].TAI.TAC != 1 { + t.Errorf("paging TAI TAC = %d, want 1 (served)", paging.TAIListForPaging[0].TAI.TAC) } if paging.UERadioCapabilityForPaging == nil || paging.UERadioCapabilityForPaging.NR == nil { diff --git a/internal/amf/ran_trace.go b/internal/amf/ran_trace.go index e3babf8191..259c64fd38 100644 --- a/internal/amf/ran_trace.go +++ b/internal/amf/ran_trace.go @@ -12,6 +12,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/internal/tracing" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -198,8 +199,8 @@ func (a *AMF) traceActivation(id tracing.RANTraceID) (*ngap.TraceActivation, err return nil, fmt.Errorf("RAN trace is not enabled") } - tce := a.ranTrace.Config().TCEAddress - if !tce.IsValid() { + tce, err := ap.TransportLayerAddressFrom(a.ranTrace.Config().TCEAddress) + if err != nil { return nil, fmt.Errorf("no Trace Collection Entity address") } @@ -207,6 +208,6 @@ func (a *AMF) traceActivation(id tracing.RANTraceID) (*ngap.TraceActivation, err NGRANTraceID: ngap.NGRANTraceID(id), InterfacesToTrace: ranTraceInterfaces, TraceDepth: ngap.TraceDepthMinimum, - TraceCollectionEntityIPAddress: ngap.TransportLayerAddress(tce.Unmap().AsSlice()), + TraceCollectionEntityIPAddress: tce, }, nil } diff --git a/internal/amf/ran_trace_internal_test.go b/internal/amf/ran_trace_internal_test.go index 06211316fc..0802f39f63 100644 --- a/internal/amf/ran_trace_internal_test.go +++ b/internal/amf/ran_trace_internal_test.go @@ -118,7 +118,7 @@ func TestTraceStartCarriesSessionAndConnection(t *testing.T) { t.Fatalf("interfaces %08b depth %d", ta.InterfacesToTrace, ta.TraceDepth) } - if ip, _ := ta.TraceCollectionEntityIPAddress.IPs(); ip != netip.MustParseAddr("10.0.0.1") { + if ip := ta.TraceCollectionEntityIPAddress.IPv4(); ip != netip.MustParseAddr("10.0.0.1") { t.Fatalf("TCE address %v", ip) } @@ -161,7 +161,7 @@ func TestTraceFailureResendsOnlyForTheConnectionID(t *testing.T) { ue.TraceConnection(t.Context()) id, _ := conn.RANTraceID() - cause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverCancelled} + cause := ngap.CauseRadioNetworkHandoverCancelled.Cause() other := id other[7]++ diff --git a/internal/amf/ran_ue.go b/internal/amf/ran_ue.go index 439969d68b..6027537079 100644 --- a/internal/amf/ran_ue.go +++ b/internal/amf/ran_ue.go @@ -506,7 +506,7 @@ func (ueConn *UeConn) superviseICS(ctx context.Context) { return } - a.releaseNGConnection(guardCtx, ueConn, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASUnspecified}, nil, models.ReleaseFor(models.ReleaseAccessReleased)) + a.releaseNGConnection(guardCtx, ueConn, ngap.CauseNASUnspecified.Cause(), nil, models.ReleaseFor(models.ReleaseAccessReleased)) }) } @@ -681,7 +681,7 @@ func (ueConn *UeConn) ClaimReleaseCompletion() bool { func (a *AMF) ReleaseOnRANRequest(ctx context.Context, ueConn *UeConn, cause ngap.Cause, reported []uint8) { received := models.ReleaseFor(models.ReleaseAccessReleased). - WithRanNas(models.ReceivedNGAPCause(uint8(cause.Group), uint16(cause.EnumeratedValue()))) + WithRanNas(models.ReceivedNGAPCause(causeIndices(cause))) a.releaseNGConnection(ctx, ueConn, cause, reported, received) } @@ -885,7 +885,7 @@ func (ueConn *UeConn) abortHandoverOnRemoval(ctx context.Context) { target.SetReleaseAction(UeContextReleaseHandover) target.SendUEContextReleaseCommand(ctx, - ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioConnectionWithUELost}) + ngap.CauseRadioNetworkRadioConnectionWithUELost.Cause()) } ueConn.Log(ctx).Info("released prepared N2 handover target: source association removed") @@ -1004,8 +1004,8 @@ func (ueConn *UeConn) preservesGBRFlows() bool { // TS 23.502 §4.2.6 step 6a. func preservesGBRFlows(cause ngap.Cause) bool { - return cause.Group == ngap.CauseGroupRadioNetwork && !cause.Extended && - (cause.Value == ngap.CauseRadioNetworkUserInactivity || cause.Value == ngap.CauseRadioNetworkRedirection) + return cause.RadioNetwork != nil && + (*cause.RadioNetwork == ngap.CauseRadioNetworkUserInactivity || *cause.RadioNetwork == ngap.CauseRadioNetworkRedirection) } func (r *UeConn) SetRRCEstablishmentCause(c *ngap.RRCEstablishmentCause) { @@ -1029,3 +1029,10 @@ func (r *UeConn) MayBeHighPriorityAccess() bool { return false } } + +func causeIndices(cause ngap.Cause) (uint8, uint16) { + alt, _ := cause.Alternative() + value, _ := cause.Value() + + return uint8(max(alt, 0)), uint16(max(value, 0)) +} diff --git a/internal/amf/relocation.go b/internal/amf/relocation.go index 297894faac..ba619770ac 100644 --- a/internal/amf/relocation.go +++ b/internal/amf/relocation.go @@ -132,7 +132,7 @@ func (a *AMF) RelocationComplete(ctx context.Context, supi etsi.SUPI, id interwo a.handVisitorToEPS(ctx, ue) a.releaseToEPS(ctx, ue, source, - ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkSuccessfulHandover}) + ngap.CauseRadioNetworkSuccessfulHandover.Cause()) logger.From(ctx, logger.AmfLog).Info("UE handed over to EPS; releasing its 5GS resources and keeping its 5G security context for a return", logger.SUPI(supi.String())) diff --git a/internal/amf/roaming_steering.go b/internal/amf/roaming_steering.go index f6f90a6b3d..b03c882d4c 100644 --- a/internal/amf/roaming_steering.go +++ b/internal/amf/roaming_steering.go @@ -217,7 +217,7 @@ func (amf *AMF) ConfigurationUpdateCompleted(ctx context.Context, ue *UeContext, logger.From(ctx, logger.AmfLog).Info("the visitor acknowledged the registration request; releasing its NAS signalling connection", logger.SUPI(ue.Supi().String())) - conn.ReleaseWithAction(ctx, UeContextN2NormalRelease, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) + conn.ReleaseWithAction(ctx, UeContextN2NormalRelease, ngap.CauseNASNormalRelease.Cause()) } func (amf *AMF) reregistrationFulfilled(ue *UeContext) { diff --git a/internal/amf/send.go b/internal/amf/send.go index a43d0182d2..272ff1f7e0 100644 --- a/internal/amf/send.go +++ b/internal/amf/send.go @@ -292,7 +292,7 @@ func (a *AMF) AbortRegistrationRetainingContext(ctx context.Context, ue *UeConte ueConn.SetReleaseAction(UeContextN2NormalRelease) - ueConn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASUnspecified}) + ueConn.SendUEContextReleaseCommand(ctx, ngap.CauseNASUnspecified.Cause()) } func secureExchangeSHT(ue *UeConn) uint8 { @@ -741,12 +741,8 @@ func (ueConn *UeConn) SendDownlinkNRPPaTransport(ctx context.Context, routingID func ueContextReleaseCommandBytes(amfID ngap.AMFUENGAPID, ranID ngap.RANUENGAPID, cause ngap.Cause) ([]byte, error) { msg := &ngap.UEContextReleaseCommand{ - UENGAPIDs: ngap.UENGAPIDs{ - AMFUENGAPID: amfID, - RANUENGAPID: ranID, - Pair: ranID != ngap.RANUENGAPID(models.RanUeNgapIDUnspecified), - }, - Cause: &cause, + UENGAPIDs: ueNGAPIDs(amfID, ranID), + Cause: &cause, } return msg.Marshal() @@ -1328,7 +1324,7 @@ func ReportProtectFailure(ctx context.Context, ue *UeContext, what string, err e zap.String("procedure", what), zap.Error(err)) if conn := ue.Conn(); conn != nil { - conn.SendUEContextReleaseCommand(ctx, ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}) + conn.SendUEContextReleaseCommand(ctx, ngap.CauseNASNormalRelease.Cause()) } } @@ -1447,3 +1443,11 @@ func (ueConn *UeConn) SendLocationReportingControl(ctx context.Context, eventTyp return nil } + +func ueNGAPIDs(amfID ngap.AMFUENGAPID, ranID ngap.RANUENGAPID) ngap.UENGAPIDs { + if ranID == ngap.RANUENGAPID(models.RanUeNgapIDUnspecified) { + return ngap.UENGAPIDs{AMFUENGAPID: &amfID} + } + + return ngap.UENGAPIDs{UENGAPIDPair: &ngap.UENGAPIDPair{AMFUENGAPID: amfID, RANUENGAPID: ranID}} +} diff --git a/internal/amf/ue_context_release_command_test.go b/internal/amf/ue_context_release_command_test.go index 13d3120a20..9c09b18457 100644 --- a/internal/amf/ue_context_release_command_test.go +++ b/internal/amf/ue_context_release_command_test.go @@ -13,7 +13,7 @@ import ( // TS 38.413 §8.3.3.2 func TestUEContextReleaseCommandSelectsIDAlternative(t *testing.T) { - cause := ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease} + cause := ngap.CauseNASNormalRelease.Cause() tests := []struct { name string @@ -59,12 +59,17 @@ func TestUEContextReleaseCommandSelectsIDAlternative(t *testing.T) { } wantPair := tt.ran != models.RanUeNgapIDUnspecified - if cmd.UENGAPIDs.Pair != wantPair { - t.Fatalf("Pair = %v, want %v", cmd.UENGAPIDs.Pair, wantPair) + if gotPair := cmd.UENGAPIDs.UENGAPIDPair != nil; gotPair != wantPair { + t.Fatalf("pair = %v, want %v", gotPair, wantPair) } - if cmd.UENGAPIDs.AMFUENGAPID != 1 { - t.Fatalf("AMFUENGAPID = %d, want 1", cmd.UENGAPIDs.AMFUENGAPID) + amfID := cmd.UENGAPIDs.AMFUENGAPID + if p := cmd.UENGAPIDs.UENGAPIDPair; p != nil { + amfID = &p.AMFUENGAPID + } + + if amfID == nil || *amfID != 1 { + t.Fatalf("AMFUENGAPID = %v, want 1", amfID) } }) } diff --git a/internal/amf/ue_registration.go b/internal/amf/ue_registration.go index 14d290a92a..ca5296c271 100644 --- a/internal/amf/ue_registration.go +++ b/internal/amf/ue_registration.go @@ -17,7 +17,7 @@ import ( "github.com/ellanetworks/core/ngap" ) -var causeReleaseDueToCNDetectedMobility = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkReleaseDueToCNDetectedMobility} +var causeReleaseDueToCNDetectedMobility = ngap.CauseRadioNetworkReleaseDueToCNDetectedMobility.Cause() type Registrar interface { Register(ctx context.Context, imsi string) (int64, error) diff --git a/internal/amf/util/ngap_convert.go b/internal/amf/util/ngap_convert.go index 079a5a7a8a..f33c8f959b 100644 --- a/internal/amf/util/ngap_convert.go +++ b/internal/amf/util/ngap_convert.go @@ -77,25 +77,30 @@ func SNSSAIToNGAP(snssai models.Snssai) (ngap.SNSSAI, error) { func RANNodeIDToModels(id ngap.GlobalRANNodeID) (models.GlobalRanNodeID, error) { h := id.Hex() - plmn, err := PLMNToModels(id.PLMNIdentity) + ngapPLMN, ok := id.PLMNIdentity() + if !ok { + return models.GlobalRanNodeID{}, fmt.Errorf("empty Global RAN Node ID") + } + + plmn, err := PLMNToModels(ngapPLMN) if err != nil { return models.GlobalRanNodeID{}, fmt.Errorf("could not decode the Global RAN Node ID PLMN: %w", err) } - switch id.Kind { - case ngap.RANNodeIDGNB: - return models.GlobalRanNodeID{PlmnID: &plmn, GNbID: &models.GNbID{BitLength: int32(id.Bits), GNBValue: h}}, nil - case ngap.RANNodeIDMacroNgENB: + switch { + case id.GlobalGNBID != nil && id.GlobalGNBID.GNBID.GNBID != nil: + return models.GlobalRanNodeID{PlmnID: &plmn, GNbID: &models.GNbID{BitLength: int32(id.GlobalGNBID.GNBID.GNBID.Bits), GNBValue: h}}, nil + case id.GlobalNgENBID != nil && id.GlobalNgENBID.NgENBID.MacroNgENBID != nil: return models.GlobalRanNodeID{PlmnID: &plmn, NgeNbID: "MacroNGeNB-" + h}, nil - case ngap.RANNodeIDShortMacroNgENB: + case id.GlobalNgENBID != nil && id.GlobalNgENBID.NgENBID.ShortMacroNgENBID != nil: return models.GlobalRanNodeID{PlmnID: &plmn, NgeNbID: "SMacroNGeNB-" + h}, nil - case ngap.RANNodeIDLongMacroNgENB: + case id.GlobalNgENBID != nil && id.GlobalNgENBID.NgENBID.LongMacroNgENBID != nil: return models.GlobalRanNodeID{PlmnID: &plmn, NgeNbID: "LMacroNGeNB-" + h}, nil - case ngap.RANNodeIDN3IWF: + case id.GlobalN3IWFID != nil && id.GlobalN3IWFID.N3IWFID.N3IWFID != nil: return models.GlobalRanNodeID{PlmnID: &plmn, N3IwfID: h}, nil } - return models.GlobalRanNodeID{}, fmt.Errorf("unknown Global RAN Node ID kind %d", id.Kind) + return models.GlobalRanNodeID{}, fmt.Errorf("unsupported Global RAN Node ID alternative") } // GUAMIToNGAP splits a 24-bit AMF identifier into the three bit strings a @@ -193,33 +198,34 @@ const ngapSecurityAlgorithms = 7 // selects from on EPS fallback and inter-RAT handover, and narrowing it there // would force the null algorithms. func SecurityCapabilitiesToNGAP(sc *fgs.UESecurityCapability) ngap.UESecurityCapabilities { - var out ngap.UESecurityCapabilities - - if sc == nil { - return out - } + var nrEA, nrIA, eutraEA, eutraIA uint16 - for n := uint8(1); n <= ngapSecurityAlgorithms; n++ { + for n := uint8(1); sc != nil && n <= ngapSecurityAlgorithms; n++ { bit := uint16(1) << (16 - n) if sc.SupportsEA(n) { - out.NREncryptionAlgorithms |= bit + nrEA |= bit } if sc.SupportsIA(n) { - out.NRIntegrityProtectionAlgorithms |= bit + nrIA |= bit } if sc.SupportsEEA(n) { - out.EUTRAEncryptionAlgorithms |= bit + eutraEA |= bit } if sc.SupportsEIA(n) { - out.EUTRAIntegrityProtectionAlgorithms |= bit + eutraIA |= bit } } - return out + return ngap.UESecurityCapabilities{ + NREncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(nrEA), + NRIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(nrIA), + EUTRAEncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(eutraEA), + EUTRAIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(eutraIA), + } } // RadioCapabilityForPagingToNGAP converts the UE's stored paging capability, diff --git a/internal/amf/util/ngap_convert_test.go b/internal/amf/util/ngap_convert_test.go index 657a8f0e4d..d826a9166d 100644 --- a/internal/amf/util/ngap_convert_test.go +++ b/internal/amf/util/ngap_convert_test.go @@ -16,31 +16,25 @@ import ( func TestRANNodeIDToModels(t *testing.T) { tests := []struct { name string - kind ngap.RANNodeIDKind - value uint32 + id ngap.GlobalRANNodeID bits int wantGNB string wantNgENB string wantN3IWF string }{ - {name: "gNB 22 bits", kind: ngap.RANNodeIDGNB, value: 0x3fabcd, bits: 22, wantGNB: "3fabcd"}, - {name: "gNB 24 bits", kind: ngap.RANNodeIDGNB, value: 0x000102, bits: 24, wantGNB: "000102"}, - {name: "gNB 28 bits", kind: ngap.RANNodeIDGNB, value: 0xabcdef1, bits: 28, wantGNB: "abcdef1"}, - {name: "gNB 32 bits", kind: ngap.RANNodeIDGNB, value: 0xdeadbeef, bits: 32, wantGNB: "deadbeef"}, - {name: "macro ng-eNB", kind: ngap.RANNodeIDMacroNgENB, value: 0xabcde, bits: 20, wantNgENB: "MacroNGeNB-abcde"}, - {name: "short macro ng-eNB", kind: ngap.RANNodeIDShortMacroNgENB, value: 0x3abcd, bits: 18, wantNgENB: "SMacroNGeNB-3abcd"}, - {name: "long macro ng-eNB", kind: ngap.RANNodeIDLongMacroNgENB, value: 0x1abcde, bits: 21, wantNgENB: "LMacroNGeNB-1abcde"}, - {name: "N3IWF", kind: ngap.RANNodeIDN3IWF, value: 0xbeef, bits: 16, wantN3IWF: "beef"}, + {name: "gNB 22 bits", id: ngap.NewGlobalGNBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, 0x3fabcd, 22), bits: 22, wantGNB: "3fabcd"}, + {name: "gNB 24 bits", id: ngap.NewGlobalGNBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, 0x000102, 24), bits: 24, wantGNB: "000102"}, + {name: "gNB 28 bits", id: ngap.NewGlobalGNBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, 0xabcdef1, 28), bits: 28, wantGNB: "abcdef1"}, + {name: "gNB 32 bits", id: ngap.NewGlobalGNBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, 0xdeadbeef, 32), bits: 32, wantGNB: "deadbeef"}, + {name: "macro ng-eNB", id: ngap.NewGlobalNgENBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, ngap.NgENBID{MacroNgENBID: new(ngap.MacroNgENBID(0xabcde))}), bits: 20, wantNgENB: "MacroNGeNB-abcde"}, + {name: "short macro ng-eNB", id: ngap.NewGlobalNgENBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, ngap.NgENBID{ShortMacroNgENBID: new(ngap.ShortMacroNgENBID(0x3abcd))}), bits: 18, wantNgENB: "SMacroNGeNB-3abcd"}, + {name: "long macro ng-eNB", id: ngap.NewGlobalNgENBID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, ngap.NgENBID{LongMacroNgENBID: new(ngap.LongMacroNgENBID(0x1abcde))}), bits: 21, wantNgENB: "LMacroNGeNB-1abcde"}, + {name: "N3IWF", id: ngap.NewGlobalN3IWFID(ngap.PLMNIdentity{0x02, 0xf8, 0x39}, 0xbeef), bits: 16, wantN3IWF: "beef"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := util.RANNodeIDToModels(ngap.GlobalRANNodeID{ - Kind: tt.kind, - PLMNIdentity: ngap.PLMNIdentity{0x02, 0xf8, 0x39}, - Value: tt.value, - Bits: tt.bits, - }) + got, err := util.RANNodeIDToModels(tt.id) if err != nil { t.Fatal(err) } @@ -172,28 +166,22 @@ func TestSecurityCapabilitiesToNGAP(t *testing.T) { { name: "nil capability", in: nil, - want: ngap.UESecurityCapabilities{}, + want: secCaps(0, 0, 0, 0), }, { name: "the null algorithms alone leave every bitmap zero", in: &fgs.UESecurityCapability{EA: nas.Algorithms(0), IA: nas.Algorithms(0)}, - want: ngap.UESecurityCapabilities{}, + want: secCaps(0, 0, 0, 0), }, { name: "5G-EA1 and 5G-IA2 take the first and second bits", in: &fgs.UESecurityCapability{EA: nas.Algorithms(1), IA: nas.Algorithms(2)}, - want: ngap.UESecurityCapabilities{ - NREncryptionAlgorithms: 0x8000, - NRIntegrityProtectionAlgorithms: 0x4000, - }, + want: secCaps(0x8000, 0x4000, 0, 0), }, { name: "the seventh algorithm reaches the seventh bit", in: &fgs.UESecurityCapability{EA: nas.Algorithms(7), IA: nas.Algorithms(7)}, - want: ngap.UESecurityCapabilities{ - NREncryptionAlgorithms: 0x0200, - NRIntegrityProtectionAlgorithms: 0x0200, - }, + want: secCaps(0x0200, 0x0200, 0, 0), }, { name: "every algorithm the bitmaps carry", @@ -201,10 +189,7 @@ func TestSecurityCapabilitiesToNGAP(t *testing.T) { EA: nas.Algorithms(0, 1, 2, 3, 4, 5, 6, 7), IA: nas.Algorithms(0, 1, 2, 3, 4, 5, 6, 7), }, - want: ngap.UESecurityCapabilities{ - NREncryptionAlgorithms: 0xfe00, - NRIntegrityProtectionAlgorithms: 0xfe00, - }, + want: secCaps(0xfe00, 0xfe00, 0, 0), }, { name: "a UE supporting S1 mode carries its EPS algorithms too", @@ -215,12 +200,7 @@ func TestSecurityCapabilitiesToNGAP(t *testing.T) { EEA: nas.Algorithms(1, 3), EIA: nas.Algorithms(2), }, - want: ngap.UESecurityCapabilities{ - NREncryptionAlgorithms: 0xc000, - NRIntegrityProtectionAlgorithms: 0x4000, - EUTRAEncryptionAlgorithms: 0xa000, - EUTRAIntegrityProtectionAlgorithms: 0x4000, - }, + want: secCaps(0xc000, 0x4000, 0xa000, 0x4000), }, { name: "a UE without S1 mode advertises no EPS algorithms", @@ -230,10 +210,7 @@ func TestSecurityCapabilitiesToNGAP(t *testing.T) { EEA: nas.Algorithms(1, 2, 3), EIA: nas.Algorithms(1, 2, 3), }, - want: ngap.UESecurityCapabilities{ - NREncryptionAlgorithms: 0x8000, - NRIntegrityProtectionAlgorithms: 0x8000, - }, + want: secCaps(0x8000, 0x8000, 0, 0), }, } @@ -245,3 +222,12 @@ func TestSecurityCapabilitiesToNGAP(t *testing.T) { }) } } + +func secCaps(nrEA, nrIA, eutraEA, eutraIA uint16) ngap.UESecurityCapabilities { + return ngap.UESecurityCapabilities{ + NREncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(nrEA), + NRIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(nrIA), + EUTRAEncryptionAlgorithms: ngap.SecurityAlgorithmsFrom(eutraEA), + EUTRAIntegrityProtectionAlgorithms: ngap.SecurityAlgorithmsFrom(eutraIA), + } +} diff --git a/internal/decoder/ngap/amf_configuration_update.go b/internal/decoder/ngap/amf_configuration_update.go index 14fe817b33..1f031e906c 100644 --- a/internal/decoder/ngap/amf_configuration_update.go +++ b/internal/decoder/ngap/amf_configuration_update.go @@ -50,7 +50,11 @@ func cpTransportLayerAddress(c ngap.CPTransportLayerInformation) string { return net.JoinHostPort(transportLayerAddressToString(p.EndpointIPAddress), strconv.Itoa(int(p.PortNumber))) } - return transportLayerAddressToString(c.EndpointIPAddress) + if c.EndpointIPAddress == nil { + return "" + } + + return transportLayerAddressToString(*c.EndpointIPAddress) } func tnlAssociationUsage(u *ngap.TNLAssociationUsage) *utils.EnumField { diff --git a/internal/decoder/ngap/common_ie.go b/internal/decoder/ngap/common_ie.go index 7d949fd1fd..77d5609edb 100644 --- a/internal/decoder/ngap/common_ie.go +++ b/internal/decoder/ngap/common_ie.go @@ -6,7 +6,6 @@ package ngap import ( "encoding/hex" "fmt" - "net/netip" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/ngap" @@ -97,36 +96,36 @@ func criticalityDiagnostics(cd ngap.CriticalityDiagnostics) CriticalityDiagnosti return out } -// userLocationInformation renders the CHOICE the library flattens into one -// struct (TS 38.413 §9.3.2.2). Cell identities are right-aligned in the width -// the variant implies, and rendered left-aligned in hex. +// userLocationInformation renders the UserLocationInformation CHOICE +// (TS 38.413 §9.3.2.2). Cell identities are right-aligned in the width the +// variant implies, and rendered left-aligned in hex. func userLocationInformation(uli ngap.UserLocationInformation) UserLocationInformation { - switch uli.Kind { - case ngap.UserLocationEUTRA: + switch { + case uli.EUTRA != nil: return UserLocationInformation{EUTRA: &UserLocationInformationEUTRA{ EUTRACGI: EUTRACGI{ - PLMNID: plmnIDToDecoder(uli.PLMNIdentity), - EUTRACellIdentity: bitsHex(uli.CellIdentity, ngap.EUTRACellIdentityBits), + PLMNID: plmnIDToDecoder(uli.EUTRA.EUTRACGI.PLMNIdentity), + EUTRACellIdentity: bitsHex(uint64(uli.EUTRA.EUTRACGI.EUTRACellIdentity), ngap.EUTRACellIdentityBits), }, - TAI: tai(uli.TAI), - TimeStamp: timeStamp(uli.TimeStamp), + TAI: tai(uli.EUTRA.TAI), + TimeStamp: timeStamp(uli.EUTRA.TimeStamp), }} - case ngap.UserLocationNR: + case uli.NR != nil: return UserLocationInformation{NR: &UserLocationInformationNR{ NRCGI: NRCGI{ - PLMNID: plmnIDToDecoder(uli.PLMNIdentity), - NRCellIdentity: bitsHex(uli.CellIdentity, ngap.NRCellIdentityBits), + PLMNID: plmnIDToDecoder(uli.NR.NRCGI.PLMNIdentity), + NRCellIdentity: bitsHex(uint64(uli.NR.NRCGI.NRCellIdentity), ngap.NRCellIdentityBits), }, - TAI: tai(uli.TAI), - TimeStamp: timeStamp(uli.TimeStamp), + TAI: tai(uli.NR.TAI), + TimeStamp: timeStamp(uli.NR.TimeStamp), }} - case ngap.UserLocationN3IWF: + case uli.N3IWF != nil: return UserLocationInformation{N3IWF: &UserLocationInformationN3IWF{ - IPAddress: ipAddressText(uli.IPAddress), - PortNumber: int32(uli.PortNumber), + IPAddress: transportLayerAddressText(uli.N3IWF.IPAddress), + PortNumber: int32(uli.N3IWF.PortNumber), }} default: - return UserLocationInformation{Error: fmt.Sprintf("unsupported UserLocationInformation type: %d", uli.Kind)} + return UserLocationInformation{Error: "unsupported UserLocationInformation alternative: " + uliAlternative(uli)} } } @@ -153,12 +152,19 @@ func timeStamp(ts *ngap.TimeStamp) *string { return &s } -// ipAddressText renders a transport layer address as an IP string; the length -// distinguishes IPv4 from IPv6 (TS 38.413 §9.3.2.4). -func ipAddressText(addr ngap.TransportLayerAddress) string { - if ip, ok := netip.AddrFromSlice(addr); ok { - return ip.String() +func uliAlternative(uli ngap.UserLocationInformation) string { + switch { + case uli.TNGF != nil: + return "userLocationInformationTNGF" + case uli.TWIF != nil: + return "userLocationInformationTWIF" + case uli.WAGF != nil: + return "userLocationInformationW-AGF" + case uli.N3IWFWithoutPortNumber != nil: + return "userLocationInformationN3IWF-without-PortNumber" + case uli.ChoiceExtension != nil: + return "choice-Extensions " + uli.ChoiceExtension.ID.String() + default: + return "none" } - - return hex.EncodeToString(addr) } diff --git a/internal/decoder/ngap/error_indication_test.go b/internal/decoder/ngap/error_indication_test.go index 6c5caaff48..689ae592c5 100644 --- a/internal/decoder/ngap/error_indication_test.go +++ b/internal/decoder/ngap/error_indication_test.go @@ -90,7 +90,7 @@ func TestDecodeNGAPMessage_ErrorIndication(t *testing.T) { t.Fatalf("expected Cause value type=Cause, got %T", item2.Value) } - if cause.Group.Value != int64(lib.CauseGroupRadioNetwork) { + if cause.Group.Label != "radioNetwork" { t.Errorf("expected Cause group=radioNetwork, got %s", cause.Group.Label) } diff --git a/internal/decoder/ngap/golden_test.go b/internal/decoder/ngap/golden_test.go index 032cd21bbc..9e78150267 100644 --- a/internal/decoder/ngap/golden_test.go +++ b/internal/decoder/ngap/golden_test.go @@ -14,6 +14,7 @@ import ( lib "github.com/ellanetworks/core/ngap" "github.com/ellanetworks/core/nrppa" + "github.com/ellanetworks/core/per/ap" ) // Regenerate with: go test ./internal/decoder/ngap/ -run TestDecoderGolden -update @@ -91,7 +92,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { psReqTransfer, err := (&lib.PathSwitchRequestTransfer{ DLNGUUPTNLInformation: lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 45, 0, 1}, GTPTEID: 0x21}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 1}), GTPTEID: 0x21}, }, QosFlowAccepted: lib.QosFlowAcceptedList{{QosFlowIdentifier: 1}}, }).Marshal() @@ -101,7 +102,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { psAckTransfer, err := (&lib.PathSwitchRequestAcknowledgeTransfer{ ULNGUUPTNLInformation: &lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 46, 0, 1}, GTPTEID: 0x31}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 46, 0, 1}), GTPTEID: 0x31}, }, }).Marshal() if err != nil { @@ -109,24 +110,19 @@ func goldenCorpus(t *testing.T) map[string][]byte { } psFailTransfer, err := (&lib.PathSwitchRequestUnsuccessfulTransfer{ - Cause: lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}, + Cause: lib.CauseRadioNetwork(0).Cause(), }).Marshal() if err != nil { t.Fatalf("build Path Switch Request Unsuccessful Transfer: %v", err) } corpus["path_switch_request_full"] = mustMarshal(t, &lib.PathSwitchRequest{ - RANUENGAPID: 3, - SourceAMFUENGAPID: 7, - UserLocationInformation: &lib.UserLocationInformation{ - Kind: lib.UserLocationNR, - PLMNIdentity: testPLMN, - CellIdentity: 0x000000010, - TAI: testTAI, - }, + RANUENGAPID: 3, + SourceAMFUENGAPID: 7, + UserLocationInformation: &lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: lib.NRCellIdentity(0x000000010)}, TAI: testTAI}}, UESecurityCapabilities: &lib.UESecurityCapabilities{ - NREncryptionAlgorithms: 0xe000, NRIntegrityProtectionAlgorithms: 0xe000, - EUTRAEncryptionAlgorithms: 0xe000, EUTRAIntegrityProtectionAlgorithms: 0xe000, + NREncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), NRIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), + EUTRAEncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), EUTRAIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), }, PDUSessionResourceToBeSwitchedDLList: lib.PDUSessionResourceToBeSwitchedDLList{ {PDUSessionID: 1, Transfer: psReqTransfer}, @@ -154,21 +150,16 @@ func goldenCorpus(t *testing.T) map[string][]byte { }) corpus["ue_context_modification_response_full"] = mustMarshal(t, &lib.UEContextModificationResponse{ - AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), - RANUENGAPID: lib.Ptr(lib.RANUENGAPID(3)), - UserLocationInformation: &lib.UserLocationInformation{ - Kind: lib.UserLocationNR, - PLMNIdentity: testPLMN, - CellIdentity: 0x000000010, - TAI: testTAI, - }, - CriticalityDiagnostics: &lib.CriticalityDiagnostics{ProcedureCode: lib.Ptr(lib.ProcUEContextModification)}, + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), + RANUENGAPID: lib.Ptr(lib.RANUENGAPID(3)), + UserLocationInformation: &lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: lib.NRCellIdentity(0x000000010)}, TAI: testTAI}}, + CriticalityDiagnostics: &lib.CriticalityDiagnostics{ProcedureCode: lib.Ptr(lib.ProcUEContextModification)}, }) corpus["ue_context_modification_failure_full"] = mustMarshal(t, &lib.UEContextModificationFailure{ AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(3)), - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: lib.CauseRadioNetworkUnspecified}, + Cause: new(lib.CauseRadioNetworkUnspecified.Cause()), }) corpus["path_switch_request_failure_full"] = mustMarshal(t, &lib.PathSwitchRequestFailure{ @@ -186,14 +177,13 @@ func goldenCorpus(t *testing.T) map[string][]byte { QosFlowIdentifier: 1, QosFlowLevelQosParameters: &lib.QosFlowLevelQosParameters{ QosCharacteristics: lib.QosCharacteristics{ - Kind: lib.QosCharacteristicsNonDynamic5QI, - NonDynamic5QI: lib.NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &lib.NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: lib.AllocationAndRetentionPriority{PriorityLevelARP: 8}, }, }}, QosFlowToRelease: lib.QosFlowListWithCause{ - {QosFlowIdentifier: 2, Cause: lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}}, + {QosFlowIdentifier: 2, Cause: lib.CauseRadioNetwork(0).Cause()}, }, }).Marshal() if err != nil { @@ -202,11 +192,11 @@ func goldenCorpus(t *testing.T) map[string][]byte { modRespTransfer, err := (&lib.PDUSessionResourceModifyResponseTransfer{ DLNGUUPTNLInformation: &lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 45, 0, 1}, GTPTEID: 0x41}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 1}), GTPTEID: 0x41}, }, QosFlowAddOrModifyResponse: lib.QosFlowAddOrModifyResponseList{{QosFlowIdentifier: 1}}, QosFlowFailedToAddOrModify: lib.QosFlowListWithCause{ - {QosFlowIdentifier: 2, Cause: lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}}, + {QosFlowIdentifier: 2, Cause: lib.CauseRadioNetwork(0).Cause()}, }, }).Marshal() if err != nil { @@ -216,7 +206,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { modIndTransfer, err := (&lib.PDUSessionResourceModifyIndicationTransfer{ DLQosFlowPerTNLInformation: lib.QosFlowPerTNLInformation{ UPTransportLayerInformation: lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 46, 0, 1}, GTPTEID: 0x51}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 46, 0, 1}), GTPTEID: 0x51}, }, AssociatedQosFlowList: lib.AssociatedQosFlowList{{QosFlowIdentifier: 1}}, }, @@ -228,7 +218,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { modCfmTransfer, err := (&lib.PDUSessionResourceModifyConfirmTransfer{ QosFlowModifyConfirm: lib.QosFlowModifyConfirmList{{QosFlowIdentifier: 1}}, ULNGUUPTNLInformation: lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 47, 0, 1}, GTPTEID: 0x61}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 47, 0, 1}), GTPTEID: 0x61}, }, }).Marshal() if err != nil { @@ -236,7 +226,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { } modFailTransfer, err := (&lib.PDUSessionResourceModifyIndicationUnsuccessfulTransfer{ - Cause: lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}, + Cause: lib.CauseRadioNetwork(0).Cause(), }).Marshal() if err != nil { t.Fatalf("build Modify Indication Unsuccessful Transfer: %v", err) @@ -286,7 +276,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { hoCommandTransfer, err := (&lib.HandoverCommandTransfer{ DLForwardingUPTNLInformation: &lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 45, 0, 9}, GTPTEID: 0x71}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 9}), GTPTEID: 0x71}, }, QosFlowToBeForwarded: lib.QosFlowToBeForwardedList{{QosFlowIdentifier: 1}}, }).Marshal() @@ -296,7 +286,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { hoAckTransfer, err := (&lib.HandoverRequestAcknowledgeTransfer{ DLNGUUPTNLInformation: lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 46, 0, 9}, GTPTEID: 0x81}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 46, 0, 9}), GTPTEID: 0x81}, }, SecurityResult: &lib.SecurityResult{IntegrityProtectionResult: lib.IntegrityProtectionPerformed}, QosFlowSetupResponse: lib.QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, @@ -306,14 +296,14 @@ func goldenCorpus(t *testing.T) map[string][]byte { } hoAllocFailTransfer, err := (&lib.HandoverResourceAllocationUnsuccessfulTransfer{ - Cause: lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}, + Cause: lib.CauseRadioNetwork(0).Cause(), }).Marshal() if err != nil { t.Fatalf("build Handover Resource Allocation Unsuccessful Transfer: %v", err) } hoPrepFailTransfer, err := (&lib.HandoverPreparationUnsuccessfulTransfer{ - Cause: lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}, + Cause: lib.CauseRadioNetwork(0).Cause(), }).Marshal() if err != nil { t.Fatalf("build Handover Preparation Unsuccessful Transfer: %v", err) @@ -321,15 +311,14 @@ func goldenCorpus(t *testing.T) map[string][]byte { hoSetupTransfer, err := (&lib.PDUSessionResourceSetupRequestTransfer{ ULNGUUPTNLInformation: lib.UPTransportLayerInformation{ - GTPTunnel: lib.GTPTunnel{TransportLayerAddress: lib.TransportLayerAddress{10, 47, 0, 9}, GTPTEID: 0x91}, + GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 47, 0, 9}), GTPTEID: 0x91}, }, PDUSessionType: lib.PDUSessionTypeIPv4, QosFlowSetupRequest: lib.QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: lib.QosFlowLevelQosParameters{ QosCharacteristics: lib.QosCharacteristics{ - Kind: lib.QosCharacteristicsNonDynamic5QI, - NonDynamic5QI: lib.NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &lib.NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: lib.AllocationAndRetentionPriority{PriorityLevelARP: 8}, }, @@ -343,9 +332,9 @@ func goldenCorpus(t *testing.T) map[string][]byte { AMFUENGAPID: 7, RANUENGAPID: 3, HandoverType: lib.HandoverTypeIntra5GS, - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}, + Cause: new(lib.CauseRadioNetwork(16).Cause()), TargetID: lib.TargetID{TargetRANNodeID: &lib.TargetRANNodeID{ - GlobalRANNodeID: lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 2, Bits: 22}, + GlobalRANNodeID: lib.NewGlobalGNBID(testPLMN, 2, 22), SelectedTAI: testTAI, }}, DirectForwardingPathAvailability: lib.Ptr(lib.DirectForwardingPathAvailable), @@ -369,18 +358,18 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["handover_preparation_failure_full"] = mustMarshal(t, &lib.HandoverPreparationFailure{ AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(3)), - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}, + Cause: new(lib.CauseRadioNetwork(0).Cause()), CriticalityDiagnostics: &lib.CriticalityDiagnostics{ProcedureCode: lib.Ptr(lib.ProcHandoverPreparation)}, }) corpus["handover_request_full"] = mustMarshal(t, &lib.HandoverRequest{ AMFUENGAPID: 7, HandoverType: lib.HandoverTypeIntra5GS, - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}, + Cause: new(lib.CauseRadioNetwork(16).Cause()), UEAggregateMaximumBitRate: lib.UEAggregateMaximumBitRate{DL: 200000000, UL: 100000000}, UESecurityCapabilities: lib.UESecurityCapabilities{ - NREncryptionAlgorithms: 0xe000, NRIntegrityProtectionAlgorithms: 0xe000, - EUTRAEncryptionAlgorithms: 0xe000, EUTRAIntegrityProtectionAlgorithms: 0xe000, + NREncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), NRIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), + EUTRAEncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), EUTRAIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xe000), }, SecurityContext: lib.SecurityContext{NextHopChainingCount: 1, NextHopNH: lib.SecurityKey{0x0a}}, NewSecurityContextInd: lib.Ptr(lib.NewSecurityContextIndTrue), @@ -390,11 +379,11 @@ func goldenCorpus(t *testing.T) map[string][]byte { MobilityRestrictionList: &lib.MobilityRestrictionList{ ServingPLMN: testPLMN, EquivalentPLMNs: lib.EquivalentPLMNs{testPLMN}, - RATRestrictions: lib.RATRestrictions{{PLMNIdentity: testPLMN, RATRestrictionInformation: lib.RATRestrictionEUTRA}}, + RATRestrictions: lib.RATRestrictions{{PLMNIdentity: testPLMN, RATRestrictionInformation: lib.RATRestrictionInformationFrom(lib.RATRestrictionEUTRA)}}, }, GUAMI: lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 1, AMFSetID: 1, AMFPointer: 0}, AMFUENGAPID2: lib.Ptr(lib.AMFUENGAPID(9)), - TargetRANNodeID: &lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 2, Bits: 22}, + TargetRANNodeID: new(lib.NewGlobalGNBID(testPLMN, 2, 22)), }) corpus["handover_request_acknowledge_full"] = mustMarshal(t, &lib.HandoverRequestAcknowledge{ @@ -409,22 +398,20 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["handover_failure_full"] = mustMarshal(t, &lib.HandoverFailure{ AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}, + Cause: new(lib.CauseRadioNetwork(0).Cause()), CriticalityDiagnostics: &lib.CriticalityDiagnostics{ProcedureCode: lib.Ptr(lib.ProcHandoverResourceAllocation)}, }) corpus["handover_notify_full"] = mustMarshal(t, &lib.HandoverNotify{ - AMFUENGAPID: 7, - RANUENGAPID: 3, - UserLocationInformation: &lib.UserLocationInformation{ - Kind: lib.UserLocationNR, PLMNIdentity: testPLMN, CellIdentity: 0x10, TAI: testTAI, - }, - NotifySourceNGRANNode: lib.Ptr(lib.NotifySourceNGRANNodeNotifySource), + AMFUENGAPID: 7, + RANUENGAPID: 3, + UserLocationInformation: &lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: lib.NRCellIdentity(0x10)}, TAI: testTAI}}, + NotifySourceNGRANNode: lib.Ptr(lib.NotifySourceNGRANNodeNotifySource), }) corpus["handover_cancel_full"] = mustMarshal(t, &lib.HandoverCancel{ AMFUENGAPID: 7, RANUENGAPID: 3, - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}, + Cause: new(lib.CauseRadioNetwork(0).Cause()), }) corpus["handover_cancel_acknowledge_full"] = mustMarshal(t, &lib.HandoverCancelAcknowledge{ @@ -437,10 +424,10 @@ func goldenCorpus(t *testing.T) map[string][]byte { RANNodeName: lib.Ptr("gnb01"), SupportedTAList: lib.SupportedTAList{{TAC: 1, BroadcastPLMNList: lib.BroadcastPLMNList{{PLMNIdentity: testPLMN, TAISliceSupportList: lib.SliceSupportList{{SNSSAI: lib.SNSSAI{SST: 1}}}}}}}, DefaultPagingDRX: lib.Ptr(lib.PagingDRXv128), - GlobalRANNodeID: &lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 1, Bits: 22}, + GlobalRANNodeID: new(lib.NewGlobalGNBID(testPLMN, 1, 22)), NGRANTNLAssociationToRemoveList: lib.NGRANTNLAssociationToRemoveList{{ - TNLAssociationTransportLayerAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 1}}, - TNLAssociationTransportLayerAddressAMF: &lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 2}}, + TNLAssociationTransportLayerAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}))}, + TNLAssociationTransportLayerAddressAMF: &lib.CPTransportLayerInformation{EndpointIPAddress: lib.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 2}))}, }}, }) @@ -449,7 +436,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { }) corpus["ran_configuration_update_failure_full"] = mustMarshal(t, &lib.RANConfigurationUpdateFailure{ - Cause: &lib.Cause{Group: lib.CauseGroupMisc, Value: 3}, + Cause: new(lib.CauseMisc(3).Cause()), TimeToWait: lib.Ptr(lib.TimeToWaitV10s), CriticalityDiagnostics: &lib.CriticalityDiagnostics{ProcedureCode: lib.Ptr(lib.ProcRANConfigurationUpdate)}, }) @@ -471,13 +458,13 @@ func goldenCorpus(t *testing.T) map[string][]byte { }) corpus["ng_reset_all_full"] = mustMarshal(t, &lib.NGReset{ - Cause: &lib.Cause{Group: lib.CauseGroupMisc, Value: 3}, - ResetType: lib.ResetType{All: true}, + Cause: new(lib.CauseMisc(3).Cause()), + ResetType: lib.ResetType{NGInterface: new(lib.ResetAllResetAll)}, }) corpus["ng_reset_part_full"] = mustMarshal(t, &lib.NGReset{ - Cause: &lib.Cause{Group: lib.CauseGroupTransport, Value: 0}, - ResetType: lib.ResetType{Part: lib.UEAssociatedLogicalNGConnectionList{ + Cause: new(lib.CauseTransport(0).Cause()), + ResetType: lib.ResetType{PartOfNGInterface: &lib.UEAssociatedLogicalNGConnectionList{ {AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(3))}, {RANUENGAPID: lib.Ptr(lib.RANUENGAPID(4))}, }}, @@ -494,13 +481,13 @@ func goldenCorpus(t *testing.T) map[string][]byte { AMFUENGAPID: 7, RANUENGAPID: 3, NASPDU: lib.NASPDU{0x7e, 0x00, 0x44}, - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 27}, + Cause: new(lib.CauseRadioNetwork(27).Cause()), }) corpus["paging_full"] = mustMarshal(t, &lib.Paging{ - FiveGSTMSI: &lib.FiveGSTMSI{AMFSetID: 1, AMFPointer: 2, FiveGTMSI: 0x01020304}, + UEPagingIdentity: &lib.UEPagingIdentity{FiveGSTMSI: &lib.FiveGSTMSI{AMFSetID: 1, AMFPointer: 2, FiveGTMSI: 0x01020304}}, PagingDRX: lib.Ptr(lib.PagingDRXv128), - TAIListForPaging: []lib.TAI{testTAI}, + TAIListForPaging: lib.TAIListForPaging{{TAI: testTAI}}, PagingPriority: lib.Ptr(lib.PagingPriority(0)), UERadioCapabilityForPaging: &lib.UERadioCapabilityForPaging{ NR: lib.Ptr(lib.UERadioCapabilityForPagingOfNR{0xab, 0xcd}), @@ -514,8 +501,8 @@ func goldenCorpus(t *testing.T) map[string][]byte { GUAMI: lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 2, AMFSetID: 1, AMFPointer: 0}, AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, UESecurityCapabilities: lib.UESecurityCapabilities{ - NREncryptionAlgorithms: 0xc000, NRIntegrityProtectionAlgorithms: 0xc000, - EUTRAEncryptionAlgorithms: 0xc000, EUTRAIntegrityProtectionAlgorithms: 0xc000, + NREncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), NRIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), + EUTRAEncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), EUTRAIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), }, SecurityKey: lib.SecurityKey{}, UERadioCapability: lib.UERadioCapability{0x01}, @@ -527,7 +514,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["error_indication_full"] = mustMarshal(t, &lib.ErrorIndication{ AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), - Cause: &lib.Cause{Group: lib.CauseGroupProtocol, Value: 0}, + Cause: new(lib.CauseProtocol(0).Cause()), CriticalityDiagnostics: testDiagnostics(), FiveGSTMSI: &lib.FiveGSTMSI{AMFSetID: 1, AMFPointer: 2, FiveGTMSI: 0x01020304}, }) @@ -548,14 +535,9 @@ func goldenCorpus(t *testing.T) map[string][]byte { }) corpus["location_report_full"] = mustMarshal(t, &lib.LocationReport{ - AMFUENGAPID: 1, - RANUENGAPID: 2, - UserLocationInformation: &lib.UserLocationInformation{ - Kind: lib.UserLocationNR, - PLMNIdentity: testPLMN, - CellIdentity: 0x000000010, - TAI: testTAI, - }, + AMFUENGAPID: 1, + RANUENGAPID: 2, + UserLocationInformation: &lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: lib.NRCellIdentity(0x000000010)}, TAI: testTAI}}, UEPresenceInAreaOfInterestList: lib.UEPresenceInAreaOfInterestList{{ LocationReportingReferenceID: 1, UEPresence: lib.UEPresenceIn, diff --git a/internal/decoder/ngap/handover.go b/internal/decoder/ngap/handover.go index 2125b83edf..2f47546b67 100644 --- a/internal/decoder/ngap/handover.go +++ b/internal/decoder/ngap/handover.go @@ -329,7 +329,7 @@ func tacsToStrings(list []ngap.TAC) []string { // ratRestrictionNames are the RATs a restriction bitmap can bar, in transmission // order (TS 38.413 §9.3.1.85). var ratRestrictionNames = []struct { - bit ngap.RATRestrictionInformation + bit ngap.RATRestrictionFlags name string }{ {ngap.RATRestrictionEUTRA, "e-UTRA"}, @@ -345,7 +345,7 @@ func ratRestrictionInformation(v ngap.RATRestrictionInformation) string { var restricted []string for _, r := range ratRestrictionNames { - if v&r.bit != 0 { + if v.Flags&r.bit != 0 { restricted = append(restricted, r.name) } } @@ -409,7 +409,7 @@ func targetID(t ngap.TargetID) TargetID { out.TargetENBID = &TargetENBID{ GlobalNgENBID: GlobalNgENBID{ PLMNIdentity: plmnIDToDecoder(t.TargeteNBID.GlobalENBID.PLMNIdentity), - NgENBID: fmt.Sprintf("%x", t.TargeteNBID.GlobalENBID.NgENBID.Value), + NgENBID: ngENBIDHex(t.TargeteNBID.GlobalENBID.NgENBID), }, SelectedEPSTAI: EPSTAI{ PLMNIdentity: plmnIDToDecoder(t.TargeteNBID.SelectedEPSTAI.PLMNIdentity), @@ -742,3 +742,12 @@ func buildHandoverCancelAcknowledge(value []byte) NGAPMessageValue { return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } + +func ngENBIDHex(id ngap.NgENBID) string { + v, _, ok := id.ID() + if !ok { + return "" + } + + return fmt.Sprintf("%x", v) +} diff --git a/internal/decoder/ngap/initial_context_setup_request.go b/internal/decoder/ngap/initial_context_setup_request.go index 2aa0cd4b28..acf3bf313b 100644 --- a/internal/decoder/ngap/initial_context_setup_request.go +++ b/internal/decoder/ngap/initial_context_setup_request.go @@ -187,6 +187,10 @@ func buildInitialContextSetupRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDTraceActivation, ngap.CriticalityIgnore, traceActivation(*m.TraceActivation))) } + if m.MobilityRestrictionList != nil { + ies = append(ies, ie(ngap.IDMobilityRestrictionList, ngap.CriticalityIgnore, mobilityRestrictionList(*m.MobilityRestrictionList))) + } + if m.NASPDU != nil { ies = append(ies, ie(ngap.IDNASPDU, ngap.CriticalityIgnore, libNASPDU(*m.NASPDU))) } @@ -212,10 +216,10 @@ func buildInitialContextSetupRequest(value []byte) NGAPMessageValue { // pair stays hex, as this core does not negotiate E-UTRA algorithms. func libUESecurityCapabilities(c ngap.UESecurityCapabilities) UESecurityCapabilities { return UESecurityCapabilities{ - NRencryptionAlgorithms: nrAlgorithmNames(c.NREncryptionAlgorithms, "NEA"), - NRintegrityProtectionAlgorithms: nrAlgorithmNames(c.NRIntegrityProtectionAlgorithms, "NIA"), - EUTRAencryptionAlgorithms: bitsHex(uint64(c.EUTRAEncryptionAlgorithms), 16), - EUTRAintegrityProtectionAlgorithms: bitsHex(uint64(c.EUTRAIntegrityProtectionAlgorithms), 16), + NRencryptionAlgorithms: nrAlgorithmNames(c.NREncryptionAlgorithms.Uint16(), "NEA"), + NRintegrityProtectionAlgorithms: nrAlgorithmNames(c.NRIntegrityProtectionAlgorithms.Uint16(), "NIA"), + EUTRAencryptionAlgorithms: bitsHex(uint64(c.EUTRAEncryptionAlgorithms.Uint16()), 16), + EUTRAintegrityProtectionAlgorithms: bitsHex(uint64(c.EUTRAIntegrityProtectionAlgorithms.Uint16()), 16), } } diff --git a/internal/decoder/ngap/initial_context_setup_request_test.go b/internal/decoder/ngap/initial_context_setup_request_test.go index 2ff9051366..92741bf433 100644 --- a/internal/decoder/ngap/initial_context_setup_request_test.go +++ b/internal/decoder/ngap/initial_context_setup_request_test.go @@ -215,10 +215,7 @@ func TestDecodeNGAPMessage_InitialContextSetupRequest(t *testing.T) { t.Errorf("expected SecurityKey=%s, got %s", expectedKey, securityKey) } - // The library does not model Mobility Restriction List — this AMF never - // sends it — so it is preserved and rendered as an unmodeled IE, after every - // modeled one, rather than decoded in place. - item6 := ngapMsg.Value.IEs[6] + item6 := ngapMsg.Value.IEs[7] if item6.ID.Value != int64(lib.IDNASPDU) { t.Errorf("IE id = %d, want %d", item6.ID.Value, lib.IDNASPDU) @@ -240,20 +237,20 @@ func TestDecodeNGAPMessage_InitialContextSetupRequest(t *testing.T) { t.Errorf("expected RawHex=%s, got %s", expectedHex, nasPdu.RawHex) } - var unmodeled *IE + var mrl *IE for i := range ngapMsg.Value.IEs { if ngapMsg.Value.IEs[i].ID.Value == int64(lib.IDMobilityRestrictionList) { - unmodeled = &ngapMsg.Value.IEs[i] + mrl = &ngapMsg.Value.IEs[i] } } - if unmodeled == nil { - t.Fatal("Mobility Restriction List was dropped; it must be preserved as an unmodeled IE") + if mrl == nil { + t.Fatal("Mobility Restriction List was dropped") } - if _, ok := unmodeled.Value.(rawIEValue); !ok { - t.Errorf("unmodeled IE value = %T, want rawIEValue", unmodeled.Value) + if _, ok := mrl.Value.(MobilityRestrictionList); !ok { + t.Errorf("Mobility Restriction List value = %T, want MobilityRestrictionList", mrl.Value) } } diff --git a/internal/decoder/ngap/modeled_ies_test.go b/internal/decoder/ngap/modeled_ies_test.go index 5471b54a03..2345b2d30d 100644 --- a/internal/decoder/ngap/modeled_ies_test.go +++ b/internal/decoder/ngap/modeled_ies_test.go @@ -7,6 +7,7 @@ import ( "testing" lib "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) func modeledIEsCorpus(t *testing.T) map[string][]byte { @@ -37,23 +38,23 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { NGRANTraceID: lib.NGRANTraceID{0x02, 0xf8, 0x39, 0x0a, 0x0b, 0x0c, 0x12, 0x34}, InterfacesToTrace: lib.InterfaceToTraceNGC, TraceDepth: lib.TraceDepthMinimum, - TraceCollectionEntityIPAddress: lib.TransportLayerAddress{10, 0, 0, 1}, + TraceCollectionEntityIPAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), }, }), "amf_configuration_update_tnl_and_extended_name": mustMarshal(t, &lib.AMFConfigurationUpdate{ AMFTNLAssociationToAddList: lib.AMFTNLAssociationToAddList{{ AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddressAndPort: &lib.EndpointIPAddressAndPort{ - EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 3}, PortNumber: 38412, + EndpointIPAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 3}), PortNumber: 38412, }}, TNLAssociationUsage: lib.Ptr(lib.TNLAssociationUsageBoth), TNLAddressWeightFactor: 1, }}, AMFTNLAssociationToRemoveList: lib.AMFTNLAssociationToRemoveList{{ - AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 4}}, - TNLAssociationTransportLayerAddressNGRAN: &lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 1, 4}}, + AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 4}))}, + TNLAssociationTransportLayerAddressNGRAN: &lib.CPTransportLayerInformation{EndpointIPAddress: lib.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 0, 1, 4}))}, }}, AMFTNLAssociationToUpdateList: lib.AMFTNLAssociationToUpdateList{{ - AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 2}}, + AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 2}))}, }}, ExtendedAMFName: &lib.ExtendedAMFName{AMFNameUTF8String: lib.Ptr(lib.AMFNameUTF8String("ella"))}, }), @@ -75,7 +76,7 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { "initial_ue_message_guami_type_requested_nssai": mustMarshal(t, &lib.InitialUEMessage{ RANUENGAPID: 1, NASPDU: lib.NASPDU{0x7e, 0x00}, - UserLocationInformation: lib.UserLocationInformation{Kind: lib.UserLocationNR, PLMNIdentity: testPLMN, TAI: testTAI}, + UserLocationInformation: lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: lib.NRCellIdentity(0)}, TAI: testTAI}}, RRCEstablishmentCause: lib.Ptr(lib.RRCCauseMOSignalling), GUAMI: &guamis[0].GUAMI, GUAMIType: lib.Ptr(lib.GUAMITypeMapped), @@ -88,11 +89,11 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { }), "amf_configuration_update_acknowledge_tnl_lists": mustMarshal(t, &lib.AMFConfigurationUpdateAcknowledge{ AMFTNLAssociationSetupList: lib.AMFTNLAssociationSetupList{{ - AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 2}}, + AMFTNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 2}))}, }}, AMFTNLAssociationFailedToSetupList: lib.TNLAssociationList{{ - TNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.TransportLayerAddress{10, 0, 0, 5}}, - Cause: lib.Cause{Group: lib.CauseGroupTransport, Value: lib.CauseTransportResourceUnavailable}, + TNLAssociationAddress: lib.CPTransportLayerInformation{EndpointIPAddress: lib.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 5}))}, + Cause: lib.CauseTransportResourceUnavailable.Cause(), }}, }), "amf_configuration_update_served_guami_extensions": mustMarshal(t, &lib.AMFConfigurationUpdate{ @@ -123,18 +124,18 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { }), "handover_request_target_ran_node_id": mustMarshal(t, &lib.HandoverRequest{ AMFUENGAPID: 1, - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}, + Cause: new(lib.CauseRadioNetwork(16).Cause()), PDUSessionResourceSetupListHOReq: lib.PDUSessionResourceSetupListHOReq{{PDUSessionID: 1, SNSSAI: lib.SNSSAI{SST: 1}, Transfer: lib.TransferContainer{0x00}}}, AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, SourceToTargetTransparentContainer: testSourceNGRANContainer(t), GUAMI: guamis[0].GUAMI, AMFUENGAPID2: lib.Ptr(lib.AMFUENGAPID(9)), - TargetRANNodeID: &lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 2, Bits: 22}, + TargetRANNodeID: new(lib.NewGlobalGNBID(testPLMN, 2, 22)), }), "path_switch_request_source_amf_guami": mustMarshal(t, &lib.PathSwitchRequest{ RANUENGAPID: 2, SourceAMFUENGAPID: 1, - UserLocationInformation: &lib.UserLocationInformation{Kind: lib.UserLocationNR, PLMNIdentity: testPLMN, TAI: testTAI}, + UserLocationInformation: &lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: lib.NRCellIdentity(0)}, TAI: testTAI}}, UESecurityCapabilities: &lib.UESecurityCapabilities{}, PDUSessionResourceToBeSwitchedDLList: lib.PDUSessionResourceToBeSwitchedDLList{{PDUSessionID: 5, Transfer: lib.TransferContainer{0x00}}}, SourceAMFGUAMI: &guamis[0].GUAMI, @@ -142,7 +143,7 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &lib.UEContextReleaseRequest{ AMFUENGAPID: 1, RANUENGAPID: 2, - Cause: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: lib.CauseRadioNetworkUserInactivity}, + Cause: new(lib.CauseRadioNetworkUserInactivity.Cause()), GWContextReleaseIndication: lib.Ptr(lib.GWContextReleaseIndicationTrue), }), } @@ -216,7 +217,7 @@ func TestDecodeNGAPMessage_AMFConfigurationUpdateAcknowledgeTNLLists(t *testing. t.Fatalf("failed list = %+v", msg.Value.IEs[1]) } - if failed[0].Cause != cause(lib.Cause{Group: lib.CauseGroupTransport, Value: lib.CauseTransportResourceUnavailable}) { + if failed[0].Cause != cause(lib.CauseTransportResourceUnavailable.Cause()) { t.Fatalf("cause = %+v", failed[0].Cause) } } diff --git a/internal/decoder/ngap/ng_reset.go b/internal/decoder/ngap/ng_reset.go index c0e76675eb..1bdbb4f567 100644 --- a/internal/decoder/ngap/ng_reset.go +++ b/internal/decoder/ngap/ng_reset.go @@ -58,9 +58,9 @@ func buildNGReset(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDCause, ngap.CriticalityIgnore, cause(*m.Cause))) } - rt := ResetType{NGInterface: m.ResetType.All} - if !m.ResetType.All { - rt.PartOfNG = ueAssociatedConnections(m.ResetType.Part) + rt := ResetType{NGInterface: m.ResetType.NGInterface != nil} + if p := m.ResetType.PartOfNGInterface; p != nil { + rt.PartOfNG = ueAssociatedConnections(*p) } ies = append(ies, ie(ngap.IDResetType, ngap.CriticalityReject, rt)) diff --git a/internal/decoder/ngap/ng_setup.go b/internal/decoder/ngap/ng_setup.go index c0d007122c..ff8636dcf2 100644 --- a/internal/decoder/ngap/ng_setup.go +++ b/internal/decoder/ngap/ng_setup.go @@ -6,6 +6,7 @@ package ngap import ( "encoding/hex" "fmt" + "strings" "github.com/ellanetworks/core/internal/decoder/utils" "github.com/ellanetworks/core/ngap" @@ -28,31 +29,34 @@ type Cause struct { Value utils.EnumField `json:"value"` } -func causeGroupToEnum(g ngap.CauseGroup) utils.EnumField { - return utils.NamedEnum(uint8(g), g.Name()) -} - // The library owns the cause vocabulary, including which values are extension // additions and where their numbering resumes, so the index it reports is the // one to display rather than the raw per-group value. func cause(c ngap.Cause) Cause { - name, index := c.ValueName() + alt, group := c.Alternative() + index, name := c.Value() + + unknown := name == "" || strings.HasPrefix(name, "unknown(") + if unknown { + name = "unknown" + } return Cause{ - Group: causeGroupToEnum(c.Group), - Value: utils.MakeEnum(int64(index), name, name == "unknown"), + Group: utils.NamedEnum(int64(alt), group), + Value: utils.MakeEnum(int64(index), name, unknown), } } func buildGlobalRANNodeID(id ngap.GlobalRANNodeID) GlobalRANNodeIDIE { - ie := GlobalRANNodeIDIE{PLMNIdentity: plmnIDToDecoder(id.PLMNIdentity)} + plmn, _ := id.PLMNIdentity() + ie := GlobalRANNodeIDIE{PLMNIdentity: plmnIDToDecoder(plmn)} - switch id.Kind { - case ngap.RANNodeIDGNB: + switch { + case id.GlobalGNBID != nil: ie.GlobalGNBID = id.Hex() - case ngap.RANNodeIDMacroNgENB, ngap.RANNodeIDShortMacroNgENB, ngap.RANNodeIDLongMacroNgENB: + case id.GlobalNgENBID != nil: ie.GlobalNgENBID = id.Hex() - case ngap.RANNodeIDN3IWF: + case id.GlobalN3IWFID != nil: ie.GlobalN3IWFID = id.Hex() } @@ -199,8 +203,8 @@ func buildPLMNSupportList(list ngap.PLMNSupportList) []PLMN { OnboardingSupport: item.OnboardingSupport != nil, } - if item.NPNSupport != nil { - nid := bitsHex(uint64(item.NPNSupport.SNPN), 44) + if item.NPNSupport != nil && item.NPNSupport.SNPN != nil { + nid := bitsHex(uint64(*item.NPNSupport.SNPN), 44) out[i].NPNSupportNID = &nid } } diff --git a/internal/decoder/ngap/overload.go b/internal/decoder/ngap/overload.go index 88ed5c7cb6..3788d92ebb 100644 --- a/internal/decoder/ngap/overload.go +++ b/internal/decoder/ngap/overload.go @@ -17,7 +17,11 @@ type OverloadStartNSSAIItem struct { } func overloadResponse(o ngap.OverloadResponse) utils.EnumField { - return utils.NamedEnum(uint8(o.OverloadAction), o.OverloadAction.Name()) + if o.OverloadAction == nil { + return utils.EnumField{} + } + + return utils.NamedEnum(uint8(*o.OverloadAction), o.OverloadAction.Name()) } func overloadStartNSSAIList(list ngap.OverloadStartNSSAIList) []OverloadStartNSSAIItem { diff --git a/internal/decoder/ngap/paging.go b/internal/decoder/ngap/paging.go index 2114619fff..5340c5958c 100644 --- a/internal/decoder/ngap/paging.go +++ b/internal/decoder/ngap/paging.go @@ -25,9 +25,9 @@ func buildPaging(value []byte) NGAPMessageValue { var ies []IE - if m.FiveGSTMSI != nil { + if m.UEPagingIdentity != nil && m.UEPagingIdentity.FiveGSTMSI != nil { ies = append(ies, ie(ngap.IDUEPagingIdentity, ngap.CriticalityIgnore, - UEPagingIdentity{FiveGSTMSI: buildFiveGSTMSI(*m.FiveGSTMSI)})) + UEPagingIdentity{FiveGSTMSI: buildFiveGSTMSI(*m.UEPagingIdentity.FiveGSTMSI)})) } if m.PagingDRX != nil { @@ -37,7 +37,7 @@ func buildPaging(value []byte) NGAPMessageValue { if m.TAIListForPaging != nil { tais := make([]TAI, 0, len(m.TAIListForPaging)) for _, item := range m.TAIListForPaging { - tais = append(tais, tai(item)) + tais = append(tais, tai(item.TAI)) } ies = append(ies, ie(ngap.IDTAIListForPaging, ngap.CriticalityIgnore, tais)) diff --git a/internal/decoder/ngap/pdu_session_transfer.go b/internal/decoder/ngap/pdu_session_transfer.go index 701e7c026d..a18c647d6a 100644 --- a/internal/decoder/ngap/pdu_session_transfer.go +++ b/internal/decoder/ngap/pdu_session_transfer.go @@ -72,11 +72,11 @@ func libQosFlowSetupRequest(flow ngap.QosFlowSetupRequestItem) QosFlowSetupReque PriArp: int64(params.AllocationAndRetentionPriority.PriorityLevelARP), } - switch params.QosCharacteristics.Kind { - case ngap.QosCharacteristicsNonDynamic5QI: - entry.FiveQi = ngap.Ptr(int64(params.QosCharacteristics.NonDynamic5QI.FiveQI)) - case ngap.QosCharacteristicsDynamic5QI: - dyn := params.QosCharacteristics.Dynamic5QI + switch q := params.QosCharacteristics; { + case q.NonDynamic5QI != nil: + entry.FiveQi = ngap.Ptr(int64(q.NonDynamic5QI.FiveQI)) + case q.Dynamic5QI != nil: + dyn := q.Dynamic5QI entry.Dynamic = true entry.PriorityLevelQos = ngap.Ptr(int64(dyn.PriorityLevelQos)) entry.PacketDelayBudget = ngap.Ptr(int64(dyn.PacketDelayBudget)) diff --git a/internal/decoder/ngap/pws.go b/internal/decoder/ngap/pws.go index b710f5a601..bcdc964474 100644 --- a/internal/decoder/ngap/pws.go +++ b/internal/decoder/ngap/pws.go @@ -94,14 +94,14 @@ func emergencyAreaIDs(list []ngap.EmergencyAreaID) []string { } func warningAreaList(l ngap.WarningAreaList) WarningAreaList { - out := WarningAreaList{CellIDList: cellIDList(l.EUTRACGIs, l.NRCGIs)} + out := WarningAreaList{CellIDList: cellIDList(deref(l.EUTRACGIListForWarning), deref(l.NRCGIListForWarning))} - if len(l.TAIs) > 0 { - out.TAIs = taiList(l.TAIs) + if l.TAIListForWarning != nil { + out.TAIs = taiList(*l.TAIListForWarning) } - if len(l.EmergencyAreaIDs) > 0 { - out.EmergencyAreaIDs = emergencyAreaIDs(l.EmergencyAreaIDs) + if l.EmergencyAreaIDList != nil { + out.EmergencyAreaIDs = emergencyAreaIDs(*l.EmergencyAreaIDList) } return out @@ -134,11 +134,11 @@ func nrCell(c ngap.NRCGI, n *uint16) BroadcastCell { func broadcastCompletedAreaList(l ngap.BroadcastCompletedAreaList) BroadcastAreaList { var out BroadcastAreaList - for _, it := range l.CellIDBroadcastEUTRA { + for _, it := range deref(l.CellIDBroadcastEUTRA) { out.CellIDEUTRA = append(out.CellIDEUTRA, eutraCell(it.EUTRACGI, nil)) } - for _, it := range l.TAIBroadcastEUTRA { + for _, it := range deref(l.TAIBroadcastEUTRA) { b := BroadcastTAI{TAI: tai(it.TAI)} for _, c := range it.CompletedCellsInTAI { b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, nil)) @@ -147,7 +147,7 @@ func broadcastCompletedAreaList(l ngap.BroadcastCompletedAreaList) BroadcastArea out.TAIEUTRA = append(out.TAIEUTRA, b) } - for _, it := range l.EmergencyAreaIDBroadcastEUTRA { + for _, it := range deref(l.EmergencyAreaIDBroadcastEUTRA) { b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} for _, c := range it.CompletedCellsInEAI { b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, nil)) @@ -156,11 +156,11 @@ func broadcastCompletedAreaList(l ngap.BroadcastCompletedAreaList) BroadcastArea out.EmergencyAreaIDEUTRA = append(out.EmergencyAreaIDEUTRA, b) } - for _, it := range l.CellIDBroadcastNR { + for _, it := range deref(l.CellIDBroadcastNR) { out.CellIDNR = append(out.CellIDNR, nrCell(it.NRCGI, nil)) } - for _, it := range l.TAIBroadcastNR { + for _, it := range deref(l.TAIBroadcastNR) { b := BroadcastTAI{TAI: tai(it.TAI)} for _, c := range it.CompletedCellsInTAI { b.Cells = append(b.Cells, nrCell(c.NRCGI, nil)) @@ -169,7 +169,7 @@ func broadcastCompletedAreaList(l ngap.BroadcastCompletedAreaList) BroadcastArea out.TAINR = append(out.TAINR, b) } - for _, it := range l.EmergencyAreaIDBroadcastNR { + for _, it := range deref(l.EmergencyAreaIDBroadcastNR) { b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} for _, c := range it.CompletedCellsInEAI { b.Cells = append(b.Cells, nrCell(c.NRCGI, nil)) @@ -184,11 +184,11 @@ func broadcastCompletedAreaList(l ngap.BroadcastCompletedAreaList) BroadcastArea func broadcastCancelledAreaList(l ngap.BroadcastCancelledAreaList) BroadcastAreaList { var out BroadcastAreaList - for _, it := range l.CellIDCancelledEUTRA { + for _, it := range deref(l.CellIDCancelledEUTRA) { out.CellIDEUTRA = append(out.CellIDEUTRA, eutraCell(it.EUTRACGI, &it.NumberOfBroadcasts)) } - for _, it := range l.TAICancelledEUTRA { + for _, it := range deref(l.TAICancelledEUTRA) { b := BroadcastTAI{TAI: tai(it.TAI)} for _, c := range it.CancelledCellsInTAI { b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, &c.NumberOfBroadcasts)) @@ -197,7 +197,7 @@ func broadcastCancelledAreaList(l ngap.BroadcastCancelledAreaList) BroadcastArea out.TAIEUTRA = append(out.TAIEUTRA, b) } - for _, it := range l.EmergencyAreaIDCancelledEUTRA { + for _, it := range deref(l.EmergencyAreaIDCancelledEUTRA) { b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} for _, c := range it.CancelledCellsInEAI { b.Cells = append(b.Cells, eutraCell(c.EUTRACGI, &c.NumberOfBroadcasts)) @@ -206,11 +206,11 @@ func broadcastCancelledAreaList(l ngap.BroadcastCancelledAreaList) BroadcastArea out.EmergencyAreaIDEUTRA = append(out.EmergencyAreaIDEUTRA, b) } - for _, it := range l.CellIDCancelledNR { + for _, it := range deref(l.CellIDCancelledNR) { out.CellIDNR = append(out.CellIDNR, nrCell(it.NRCGI, &it.NumberOfBroadcasts)) } - for _, it := range l.TAICancelledNR { + for _, it := range deref(l.TAICancelledNR) { b := BroadcastTAI{TAI: tai(it.TAI)} for _, c := range it.CancelledCellsInTAI { b.Cells = append(b.Cells, nrCell(c.NRCGI, &c.NumberOfBroadcasts)) @@ -219,7 +219,7 @@ func broadcastCancelledAreaList(l ngap.BroadcastCancelledAreaList) BroadcastArea out.TAINR = append(out.TAINR, b) } - for _, it := range l.EmergencyAreaIDCancelledNR { + for _, it := range deref(l.EmergencyAreaIDCancelledNR) { b := BroadcastEmergencyArea{EmergencyAreaID: hex.EncodeToString(it.EmergencyAreaID[:])} for _, c := range it.CancelledCellsInEAI { b.Cells = append(b.Cells, nrCell(c.NRCGI, &c.NumberOfBroadcasts)) @@ -348,7 +348,7 @@ func buildPWSRestartIndication(value []byte) NGAPMessageValue { } ies := []IE{ - ie(ngap.IDCellIDListForRestart, ngap.CriticalityReject, cellIDList(m.CellIDListForRestart.EUTRACGIs, m.CellIDListForRestart.NRCGIs)), + ie(ngap.IDCellIDListForRestart, ngap.CriticalityReject, cellIDList(deref(m.CellIDListForRestart.EUTRACGIListforRestart), deref(m.CellIDListForRestart.NRCGIListforRestart))), ie(ngap.IDGlobalRANNodeID, ngap.CriticalityReject, buildGlobalRANNodeID(m.GlobalRANNodeID)), ie(ngap.IDTAIListForRestart, ngap.CriticalityReject, taiList(m.TAIListForRestart)), } @@ -367,9 +367,19 @@ func buildPWSFailureIndication(value []byte) NGAPMessageValue { } ies := []IE{ - ie(ngap.IDPWSFailedCellIDList, ngap.CriticalityReject, cellIDList(m.PWSFailedCellIDList.EUTRACGIs, m.PWSFailedCellIDList.NRCGIs)), + ie(ngap.IDPWSFailedCellIDList, ngap.CriticalityReject, cellIDList(deref(m.PWSFailedCellIDList.EUTRACGIPWSFailedList), deref(m.PWSFailedCellIDList.NRCGIPWSFailedList))), ie(ngap.IDGlobalRANNodeID, ngap.CriticalityReject, buildGlobalRANNodeID(m.GlobalRANNodeID)), } return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } + +func deref[T any](p *T) T { + if p == nil { + var zero T + + return zero + } + + return *p +} diff --git a/internal/decoder/ngap/pws_overload_test.go b/internal/decoder/ngap/pws_overload_test.go index bc1b39f61b..9f93374ae9 100644 --- a/internal/decoder/ngap/pws_overload_test.go +++ b/internal/decoder/ngap/pws_overload_test.go @@ -13,7 +13,7 @@ import ( var ( pwsNRCGI = lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: 0x123456789} pwsEUTRACGI = lib.EUTRACGI{PLMNIdentity: testPLMN, EUTRACellIdentity: 0x1234567} - pwsGNB = lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 1, Bits: 22} + pwsGNB = lib.NewGlobalGNBID(testPLMN, 1, 22) ) func pwsCBSData() lib.WarningMessageContents { @@ -28,11 +28,11 @@ func pwsOverloadCorpus(t *testing.T) map[string][]byte { return map[string][]byte{ "overload_start_full": mustMarshal(t, &lib.OverloadStart{ - AMFOverloadResponse: &lib.OverloadResponse{OverloadAction: lib.OverloadActionRejectRRCCRSignalling}, + AMFOverloadResponse: &lib.OverloadResponse{OverloadAction: lib.Ptr(lib.OverloadActionRejectRRCCRSignalling)}, AMFTrafficLoadReductionIndication: lib.Ptr(lib.TrafficLoadReductionIndication(50)), OverloadStartNSSAIList: lib.OverloadStartNSSAIList{{ SliceOverloadList: []lib.SliceOverloadItem{{SNSSAI: lib.SNSSAI{SST: 1, SD: &lib.SD{0x00, 0x00, 0x01}}}}, - SliceOverloadResponse: &lib.OverloadResponse{OverloadAction: lib.OverloadActionPermitEmergencySessionsAndMTServicesOnly}, + SliceOverloadResponse: &lib.OverloadResponse{OverloadAction: lib.Ptr(lib.OverloadActionPermitEmergencySessionsAndMTServicesOnly)}, SliceTrafficLoadReductionIndication: lib.Ptr(lib.TrafficLoadReductionIndication(20)), }}, }), @@ -40,7 +40,7 @@ func pwsOverloadCorpus(t *testing.T) map[string][]byte { "write_replace_warning_request_full": mustMarshal(t, &lib.WriteReplaceWarningRequest{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - WarningAreaList: &lib.WarningAreaList{NRCGIs: []lib.NRCGI{pwsNRCGI}}, + WarningAreaList: &lib.WarningAreaList{NRCGIListForWarning: &lib.NRCGIListForWarning{pwsNRCGI}}, RepetitionPeriod: 10, NumberOfBroadcastsRequested: 1, WarningType: &lib.WarningType{0x05, 0x80}, @@ -53,7 +53,7 @@ func pwsOverloadCorpus(t *testing.T) map[string][]byte { "write_replace_warning_response_full": mustMarshal(t, &lib.WriteReplaceWarningResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - BroadcastCompletedAreaList: &lib.BroadcastCompletedAreaList{TAIBroadcastNR: []lib.TAIBroadcastNRItem{{ + BroadcastCompletedAreaList: &lib.BroadcastCompletedAreaList{TAIBroadcastNR: &lib.TAIBroadcastNR{{ TAI: testTAI, CompletedCellsInTAI: []lib.CompletedCellsInTAINRItem{{NRCGI: pwsNRCGI}}, }}}, @@ -62,26 +62,26 @@ func pwsOverloadCorpus(t *testing.T) map[string][]byte { "pws_cancel_request_full": mustMarshal(t, &lib.PWSCancelRequest{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - WarningAreaList: &lib.WarningAreaList{TAIs: []lib.TAI{testTAI}}, + WarningAreaList: &lib.WarningAreaList{TAIListForWarning: &lib.TAIListForWarning{testTAI}}, CancelAllWarningMessages: lib.Ptr(lib.CancelAllWarningMessagesTrue), }), "pws_cancel_response_full": mustMarshal(t, &lib.PWSCancelResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - BroadcastCancelledAreaList: &lib.BroadcastCancelledAreaList{EmergencyAreaIDCancelledEUTRA: []lib.EmergencyAreaIDCancelledEUTRAItem{{ + BroadcastCancelledAreaList: &lib.BroadcastCancelledAreaList{EmergencyAreaIDCancelledEUTRA: &lib.EmergencyAreaIDCancelledEUTRA{{ EmergencyAreaID: lib.EmergencyAreaID{0x01, 0x02, 0x03}, CancelledCellsInEAI: []lib.CancelledCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI, NumberOfBroadcasts: 3}}, }}}, CriticalityDiagnostics: testDiagnostics(), }), "pws_restart_indication_full": mustMarshal(t, &lib.PWSRestartIndication{ - CellIDListForRestart: lib.CellIDListForRestart{NRCGIs: []lib.NRCGI{pwsNRCGI}}, + CellIDListForRestart: lib.CellIDListForRestart{NRCGIListforRestart: &lib.NRCGIList{pwsNRCGI}}, GlobalRANNodeID: pwsGNB, TAIListForRestart: lib.TAIListForRestart{testTAI}, EmergencyAreaIDListForRestart: lib.EmergencyAreaIDListForRestart{{0x01, 0x02, 0x03}}, }), "pws_failure_indication": mustMarshal(t, &lib.PWSFailureIndication{ - PWSFailedCellIDList: lib.PWSFailedCellIDList{EUTRACGIs: []lib.EUTRACGI{pwsEUTRACGI}}, + PWSFailedCellIDList: lib.PWSFailedCellIDList{EUTRACGIPWSFailedList: &lib.EUTRACGIList{pwsEUTRACGI}}, GlobalRANNodeID: pwsGNB, }), "reroute_nas_request_full": mustMarshal(t, &lib.RerouteNASRequest{ diff --git a/internal/decoder/ngap/testdata/golden/initial_context_setup_request.json b/internal/decoder/ngap/testdata/golden/initial_context_setup_request.json index 4225a3454c..ab91656402 100644 --- a/internal/decoder/ngap/testdata/golden/initial_context_setup_request.json +++ b/internal/decoder/ngap/testdata/golden/initial_context_setup_request.json @@ -131,6 +131,26 @@ }, "value": "9a85901fe40beb43a11d225b6d31c8cc23d43c054f71e5fd52a85c13654e213c" }, + { + "id": { + "type": "enum", + "value": 36, + "label": "MobilityRestrictionList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "serving_plmn": { + "mcc": "001", + "mnc": "01" + } + } + }, { "id": { "type": "enum", @@ -229,23 +249,6 @@ "encrypted": false } } - }, - { - "id": { - "type": "enum", - "value": 36, - "label": "MobilityRestrictionList", - "unknown": false - }, - "criticality": { - "type": "enum", - "value": 1, - "label": "ignore", - "unknown": false - }, - "value": { - "hex": "0000f110" - } } ] } diff --git a/internal/decoder/ngap/tnl_extensions_test.go b/internal/decoder/ngap/tnl_extensions_test.go index b8cb2b67e3..477e73c60d 100644 --- a/internal/decoder/ngap/tnl_extensions_test.go +++ b/internal/decoder/ngap/tnl_extensions_test.go @@ -10,11 +10,12 @@ import ( "testing" lib "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) func tunnel(teid uint32) lib.UPTransportLayerInformation { - return lib.UPTransportLayerInformation{GTPTunnel: lib.GTPTunnel{ - TransportLayerAddress: lib.TransportLayerAddress{10, 0, 0, 1}, + return lib.UPTransportLayerInformation{GTPTunnel: &lib.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), GTPTEID: lib.GTPTEID(teid), }} } @@ -72,7 +73,7 @@ func tnlRenderCases(t *testing.T) []tnlRenderCase { QosFlowSetupRequest: lib.QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: lib.QosFlowLevelQosParameters{ - QosCharacteristics: lib.QosCharacteristics{Kind: lib.QosCharacteristicsNonDynamic5QI, NonDynamic5QI: lib.NonDynamic5QIDescriptor{FiveQI: 9}}, + QosCharacteristics: lib.QosCharacteristics{NonDynamic5QI: &lib.NonDynamic5QIDescriptor{FiveQI: 9}}, AllocationAndRetentionPriority: lib.AllocationAndRetentionPriority{PriorityLevelARP: 8}, }, }}, @@ -231,7 +232,7 @@ func tnlRenderCases(t *testing.T) []tnlRenderCase { name: "path_switch_request", raw: mustMarshal(t, &lib.PathSwitchRequest{ RANUENGAPID: 2, SourceAMFUENGAPID: 1, - UserLocationInformation: &lib.UserLocationInformation{Kind: lib.UserLocationNR, PLMNIdentity: testPLMN, TAI: testTAI}, + UserLocationInformation: &lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: lib.NRCellIdentity(0)}, TAI: testTAI}}, UESecurityCapabilities: &lib.UESecurityCapabilities{}, PDUSessionResourceToBeSwitchedDLList: lib.PDUSessionResourceToBeSwitchedDLList{{PDUSessionID: 5, Transfer: psReq}}, }), diff --git a/internal/decoder/ngap/trace.go b/internal/decoder/ngap/trace.go index f257e0cb70..bfe22b10c9 100644 --- a/internal/decoder/ngap/trace.go +++ b/internal/decoder/ngap/trace.go @@ -18,7 +18,7 @@ type TraceActivation struct { } var interfacesToTraceNames = []struct { - bit uint8 + bit ngap.InterfacesToTrace name string }{ {ngap.InterfaceToTraceNGC, "NG-C"}, @@ -55,18 +55,10 @@ func traceActivation(ta ngap.TraceActivation) TraceActivation { NGRANTraceID: hex.EncodeToString(ta.NGRANTraceID[:]), InterfacesToTrace: interfaces, TraceDepth: depth, - TraceCollectionEntityIPAddress: tceAddressText(ta.TraceCollectionEntityIPAddress), + TraceCollectionEntityIPAddress: transportLayerAddressText(ta.TraceCollectionEntityIPAddress), } } -func tceAddressText(addr ngap.TransportLayerAddress) string { - if text := transportLayerAddressToString(addr); text != "" { - return text - } - - return hex.EncodeToString(addr) -} - func buildTraceStart(value []byte) NGAPMessageValue { m, err := ngap.ParseTraceStart(value) if err != nil { diff --git a/internal/decoder/ngap/transparent_container.go b/internal/decoder/ngap/transparent_container.go index 6d4ad109dc..6372d240c1 100644 --- a/internal/decoder/ngap/transparent_container.go +++ b/internal/decoder/ngap/transparent_container.go @@ -73,7 +73,7 @@ func sourceToTargetTransparentContainer(b []byte, sourceNGRANNode bool) SourceTo return out } - c, err := ngap.ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) + c, err := ngap.DecodeSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) if err != nil { out.Error = err.Error() diff --git a/internal/decoder/ngap/transparent_container_test.go b/internal/decoder/ngap/transparent_container_test.go index 7239a74e3e..46c5597379 100644 --- a/internal/decoder/ngap/transparent_container_test.go +++ b/internal/decoder/ngap/transparent_container_test.go @@ -33,7 +33,7 @@ func testSourceNGRANContainer(t *testing.T) lib.SourceToTargetTransparentContain CellType: lib.CellType{CellSize: lib.CellSizeMedium}, TimeUEStayedInCell: 30, TimeUEStayedInCellEnhancedGranularity: lib.Ptr(lib.TimeUEStayedInCellEnhancedGranularity(300)), - HOCauseValue: &lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}, + HOCauseValue: new(lib.CauseRadioNetwork(16).Cause()), }}}, {LastVisitedCellInformation: lib.LastVisitedCellInformation{EUTRANCell: lib.Ptr(lib.LastVisitedEUTRANCellInformation{0x01})}}, {LastVisitedCellInformation: lib.LastVisitedCellInformation{UTRANCell: lib.Ptr(lib.LastVisitedUTRANCellInformation{0x02})}}, @@ -54,7 +54,7 @@ func TestDecodeSourceNGRANNodeToTargetNGRANNodeTransparentContainer(t *testing.T eutra := eutraCGI(lib.EUTRACGI{PLMNIdentity: testPLMN, EUTRACellIdentity: 0x101}) dl := utils.NamedEnum(uint8(0), "dl-forwarding-proposed") ul := utils.NamedEnum(uint8(0), "ul") - hoCause := cause(lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}) + hoCause := cause(lib.CauseRadioNetwork(16).Cause()) e, u, g := "01", "02", "03" want := SourceToTargetTransparentContainer{ @@ -109,7 +109,7 @@ func TestDecodeNGAPMessage_TargetRANNodeIDAndSourceAMFGUAMI(t *testing.T) { ho := DecodeNGAPMessage(corpus["handover_request_target_ran_node_id"]).Value.IEs if last := ho[len(ho)-1]; last.ID.Value != int64(lib.IDTargetRANNodeID) || last.Criticality.Value != int64(lib.CriticalityIgnore) || - !reflect.DeepEqual(last.Value, buildGlobalRANNodeID(lib.GlobalRANNodeID{Kind: lib.RANNodeIDGNB, PLMNIdentity: testPLMN, Value: 2, Bits: 22})) { + !reflect.DeepEqual(last.Value, buildGlobalRANNodeID(lib.NewGlobalGNBID(testPLMN, 2, 22))) { t.Fatalf("last IE = %+v, want Target-RAN-Node-ID", last) } diff --git a/internal/decoder/ngap/ue_context_release.go b/internal/decoder/ngap/ue_context_release.go index 3a523e4250..4f843cfc09 100644 --- a/internal/decoder/ngap/ue_context_release.go +++ b/internal/decoder/ngap/ue_context_release.go @@ -27,18 +27,20 @@ type PDUSessionResourceListCxtRelReq struct { PDUSessionID int64 `json:"pdu_session_id"` } -// UENGAPIDs ::= CHOICE { uE-NGAP-ID-pair, aMF-UE-NGAP-ID, ... }. The library -// flattens the CHOICE onto one struct with a Pair discriminator, so only the +// UENGAPIDs ::= CHOICE { uE-NGAP-ID-pair, aMF-UE-NGAP-ID, ... }. Only the // selected alternative is rendered (TS 38.413 §9.3.3.1). func libUENGAPIDs(ids ngap.UENGAPIDs) UENGAPIDs { - if ids.Pair { + switch { + case ids.UENGAPIDPair != nil: return UENGAPIDs{UENGAPIDPair: UENGAPIDPair{ - AMFUENGAPID: int64(ids.AMFUENGAPID), - RANUENGAPID: int64(ids.RANUENGAPID), + AMFUENGAPID: int64(ids.UENGAPIDPair.AMFUENGAPID), + RANUENGAPID: int64(ids.UENGAPIDPair.RANUENGAPID), }} + case ids.AMFUENGAPID != nil: + return UENGAPIDs{AMFUENGAPID: int64(*ids.AMFUENGAPID)} + default: + return UENGAPIDs{} } - - return UENGAPIDs{AMFUENGAPID: int64(ids.AMFUENGAPID)} } func buildUEContextReleaseRequest(value []byte) NGAPMessageValue { diff --git a/internal/decoder/ngap/util.go b/internal/decoder/ngap/util.go index 3403b88b5a..32b29ba09b 100644 --- a/internal/decoder/ngap/util.go +++ b/internal/decoder/ngap/util.go @@ -5,8 +5,8 @@ package ngap import ( "encoding/binary" + "encoding/hex" "fmt" - "net" "time" "github.com/ellanetworks/core/internal/decoder/utils" @@ -45,24 +45,34 @@ func ieEnum(id ngap.ProtocolIEID) utils.EnumField { return utils.MakeEnum(uint16(id), name, !ok) } -// transportLayerAddressToString formats a NGAP TransportLayerAddress byte slice -// as a human-readable string per 3GPP TS 38.414 Section 5.1: -// - 4 bytes → IPv4 dotted-decimal -// - 16 bytes → IPv6 colon-notation -// - 20 bytes → "IPv4+IPv6" dual-stack -func transportLayerAddressToString(addr []byte) string { - switch len(addr) { - case 4: - return fmt.Sprintf("%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]) - case 16: - return net.IP(addr).String() - case 20: - return fmt.Sprintf("%s+%s", net.IP(addr[0:4]).String(), net.IP(addr[4:20]).String()) +// transportLayerAddressToString formats a NGAP TransportLayerAddress as a +// human-readable string per 3GPP TS 38.414 Section 5.1: +// - 32 bits → IPv4 dotted-decimal +// - 128 bits → IPv6 colon-notation +// - 160 bits → "IPv4+IPv6" dual-stack +func transportLayerAddressToString(addr ngap.TransportLayerAddress) string { + ipv4, ipv6 := addr.IPv4(), addr.IPv6() + + switch { + case ipv4.IsValid() && ipv6.IsValid(): + return ipv4.String() + "+" + ipv6.String() + case ipv4.IsValid(): + return ipv4.String() + case ipv6.IsValid(): + return ipv6.String() default: return "" } } +func transportLayerAddressText(addr ngap.TransportLayerAddress) string { + if text := transportLayerAddressToString(addr); text != "" { + return text + } + + return hex.EncodeToString(addr.Bytes()) +} + func procedureCodeToEnum(code ngap.ProcedureCode) utils.EnumField { name, ok := ngap.ProcedureCodeName(code) diff --git a/internal/decoder/s1ap/common_ie.go b/internal/decoder/s1ap/common_ie.go index 53f4c7a87c..83dadb775c 100644 --- a/internal/decoder/s1ap/common_ie.go +++ b/internal/decoder/s1ap/common_ie.go @@ -6,7 +6,6 @@ package s1ap import ( "encoding/hex" "fmt" - "net" "strconv" "github.com/ellanetworks/core/internal/decoder/nas/eps" @@ -18,14 +17,18 @@ import ( // §9.2.2.1) — the S1-U endpoint — as a dotted IPv4 / IPv6 address (or both), // matching the NGAP decoder. An unexpected length falls back to hex so no // information is lost. -func transportLayerAddress(b []byte) string { - switch len(b) { - case 4, 16: - return net.IP(b).String() - case 20: // IPv4 followed by IPv6 - return net.IP(b[:4]).String() + "+" + net.IP(b[4:]).String() +func transportLayerAddress(a s1ap.TransportLayerAddress) string { + ipv4, ipv6 := a.IPv4(), a.IPv6() + + switch { + case ipv4.IsValid() && ipv6.IsValid(): + return ipv4.String() + "+" + ipv6.String() + case ipv4.IsValid(): + return ipv4.String() + case ipv6.IsValid(): + return ipv6.String() default: - return hex.EncodeToString(b) + return hex.EncodeToString(a.Bytes()) } } @@ -102,7 +105,10 @@ type UES1APIDs struct { } func ues1apIDs(ids s1ap.UES1APIDs) UES1APIDs { - return UES1APIDs{MMEUES1APID: uint32(ids.MMEUES1APID), ENBUES1APID: uint32(ids.ENBUES1APID)} + mme, _ := ids.MMEID() + enb, _ := ids.ENBID() + + return UES1APIDs{MMEUES1APID: uint32(mme), ENBUES1APID: uint32(enb)} } // CriticalityDiagnostics is the decoded CriticalityDiagnostics IE (TS 36.413 @@ -123,11 +129,11 @@ type CriticalityDiagnosticsIE struct { } func triggeringMessageToEnum(t s1ap.TriggeringMessage) utils.EnumField { - return utils.NamedEnum(uint8(t), t.Name()) + return namedEnum(uint8(t), t.Name()) } func typeOfErrorToEnum(t s1ap.TypeOfError) utils.EnumField { - return utils.NamedEnum(uint8(t), t.Name()) + return namedEnum(uint8(t), t.Name()) } func criticalityDiagnostics(d s1ap.CriticalityDiagnostics) CriticalityDiagnostics { @@ -176,11 +182,11 @@ func gummei(g s1ap.GUMMEI) GUMMEI { } func cnDomainToEnum(d s1ap.CNDomain) utils.EnumField { - return utils.NamedEnum(uint8(d), d.Name()) + return namedEnum(uint8(d), d.Name()) } func rrcCauseToEnum(c s1ap.RRCEstablishmentCause) utils.EnumField { - return utils.NamedEnum(uint8(c), c.Name()) + return namedEnum(uint8(c), c.Name()) } // ie is a small constructor for an Information Element with a spec-fixed diff --git a/internal/decoder/s1ap/config_transfer.go b/internal/decoder/s1ap/config_transfer.go index 4b9f44ea2b..2f627f4c5e 100644 --- a/internal/decoder/s1ap/config_transfer.go +++ b/internal/decoder/s1ap/config_transfer.go @@ -7,6 +7,7 @@ import ( "encoding/hex" "fmt" + "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/s1ap" ) @@ -24,9 +25,9 @@ func buildENBConfigurationTransfer(value []byte) (S1APMessageValue, string) { var ies []IE - if len(m.SONConfigurationTransfer) > 0 { + if m.SONConfigurationTransfer != nil { ies = append(ies, ie(s1ap.IDSONConfigurationTransferECT, s1ap.CriticalityIgnore, - SONConfigurationTransfer{Hex: hex.EncodeToString(m.SONConfigurationTransfer)})) + sonConfigurationTransfer(m.SONConfigurationTransfer))) } ies = appendUnknownIEs(ies, m.UnknownIEs()) @@ -42,12 +43,23 @@ func buildMMEConfigurationTransfer(value []byte) (S1APMessageValue, string) { var ies []IE - if len(m.SONConfigurationTransfer) > 0 { + if m.SONConfigurationTransfer != nil { ies = append(ies, ie(s1ap.IDSONConfigurationTransferMCT, s1ap.CriticalityIgnore, - SONConfigurationTransfer{Hex: hex.EncodeToString(m.SONConfigurationTransfer)})) + sonConfigurationTransfer(m.SONConfigurationTransfer))) } ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, "MME Configuration Transfer" } + +func sonConfigurationTransfer(v *s1ap.SONConfigurationTransfer) SONConfigurationTransfer { + w := per.NewWriter() + if err := v.MarshalPER(w, per.Aligned); err != nil { + return SONConfigurationTransfer{} + } + + w.AlignToByte() + + return SONConfigurationTransfer{Hex: hex.EncodeToString(w.Bytes())} +} diff --git a/internal/decoder/s1ap/erab_extensions.go b/internal/decoder/s1ap/erab_extensions.go index dc27f3728d..be5a95e618 100644 --- a/internal/decoder/s1ap/erab_extensions.go +++ b/internal/decoder/s1ap/erab_extensions.go @@ -53,7 +53,7 @@ func integrityProtectionIndication(s *s1ap.SecurityIndication) *utils.EnumField return nil } - v := utils.NamedEnum(uint8(s.IntegrityProtectionIndication), s.IntegrityProtectionIndication.Name()) + v := namedEnum(uint8(s.IntegrityProtectionIndication), s.IntegrityProtectionIndication.Name()) return &v } @@ -66,12 +66,12 @@ func setupExtensions(c, sipto *s1ap.CorrelationID, bearer *s1ap.BearerType, ethe } if bearer != nil { - v := utils.NamedEnum(uint8(*bearer), bearer.Name()) + v := namedEnum(uint8(*bearer), bearer.Name()) out.BearerType = &v } if ethernet != nil { - v := utils.NamedEnum(uint8(*ethernet), ethernet.Name()) + v := namedEnum(uint8(*ethernet), ethernet.Name()) out.EthernetType = &v } diff --git a/internal/decoder/s1ap/erab_extensions_test.go b/internal/decoder/s1ap/erab_extensions_test.go index 8b60ec87a6..74b726fe81 100644 --- a/internal/decoder/s1ap/erab_extensions_test.go +++ b/internal/decoder/s1ap/erab_extensions_test.go @@ -8,6 +8,7 @@ import ( "strings" "testing" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -29,7 +30,7 @@ func knownExtensionQoS() s1ap.ERABLevelQoSParameters { func TestDecodeS1APMessage_KnownERABExtensions(t *testing.T) { sec := &s1ap.SecurityIndication{IntegrityProtectionIndication: s1ap.IntegrityProtectionPreferred} - tla := s1ap.TransportLayerAddress{10, 0, 0, 1} + tla := ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}) qosKeys := []string{ `"downlink_packet_loss_rate":10`, `"uplink_packet_loss_rate":20`, `"extended_maximum_bitrate_dl":10000000001`, `"extended_maximum_bitrate_ul":10000000002`, @@ -84,18 +85,16 @@ func TestDecodeS1APMessage_KnownERABExtensions(t *testing.T) { raw: mustMarshal(t, &s1ap.HandoverRequest{ MMEUES1APID: 1, HandoverType: s1ap.HandoverTypeUTRANtoLTE, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), SourceToTarget: testSourceeNBContainer(t), NASSecurityParameterstoEUTRAN: s1ap.NASSecurityParameterstoEUTRAN{0x0a, 0x0b}, ERABToBeSetup: s1ap.ERABToBeSetupListHOReq{{ ERABID: 5, TransportLayerAddress: tla, GTPTEID: 1, QoS: knownExtensionQoS(), - Extensions: &s1ap.ERABToBeSetupItemHOReqExtIEs{ - DataForwardingNotPossible: s1ap.Ptr(s1ap.DataForwardingNotPossibleTrue), - BearerType: s1ap.Ptr(s1ap.BearerTypeNonIP), - EthernetType: s1ap.Ptr(s1ap.EthernetTypeTrue), - SecurityIndication: sec, - }, + DataForwardingNotPossible: s1ap.Ptr(s1ap.DataForwardingNotPossibleTrue), + BearerType: s1ap.Ptr(s1ap.BearerTypeNonIP), + EthernetType: s1ap.Ptr(s1ap.EthernetTypeTrue), + SecurityIndication: sec, }}, }), want: append(append([]string{`"data_forwarding_not_possible":true`}, setupKeys...), qosKeys...), diff --git a/internal/decoder/s1ap/error_indication_test.go b/internal/decoder/s1ap/error_indication_test.go index 6b7831b012..af763f2850 100644 --- a/internal/decoder/s1ap/error_indication_test.go +++ b/internal/decoder/s1ap/error_indication_test.go @@ -17,7 +17,7 @@ func TestDecodeErrorIndication(t *testing.T) { ind := &s1ap.ErrorIndication{ MMEUES1APID: &mme, ENBUES1APID: &enb, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseProtocolTransferSyntaxError.Cause()), } raw, err := ind.Marshal() @@ -39,7 +39,7 @@ func TestDecodeErrorIndication(t *testing.T) { } c := mustIE(t, msg, s1ap.IDCause).Value.(Cause) - if c.Group.Value != int64(s1ap.CauseGroupProtocol) || c.Value.Value != int64(s1ap.CauseProtocolTransferSyntaxError) { + if c.Group.Value != 3 || c.Value.Value != int64(s1ap.CauseProtocolTransferSyntaxError) { t.Fatalf("cause = %+v", c) } } diff --git a/internal/decoder/s1ap/golden_test.go b/internal/decoder/s1ap/golden_test.go index 54baaab39d..63fbd674d5 100644 --- a/internal/decoder/s1ap/golden_test.go +++ b/internal/decoder/s1ap/golden_test.go @@ -14,6 +14,7 @@ import ( "testing" "github.com/ellanetworks/core/lppa" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -61,6 +62,20 @@ func testDiagnostics() *s1ap.CriticalityDiagnostics { } } +func testSONConfigurationTransfer(target, source uint32) *s1ap.SONConfigurationTransfer { + return &s1ap.SONConfigurationTransfer{ + TargeteNBID: s1ap.TargeteNBID{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(target))}}, + SelectedTAI: testTAI, + }, + SourceeNBID: s1ap.SourceeNBID{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(source))}}, + SelectedTAI: testTAI, + }, + SONInformation: s1ap.SONInformation{SONInformationRequest: s1ap.Ptr(s1ap.SONInformationRequestTimeSynchronisationInfo)}, + } +} + // goldenCorpus is the PDU behind every fixture: wire captures where the message // occurs in normal operation, and codec-built messages elsewhere. The "_full" // entries carry every IE the message's table names, so a renderer that drops @@ -99,17 +114,17 @@ func goldenCorpus(t *testing.T) map[string][]byte { }) corpus["enb_configuration_update_failure_full"] = mustMarshal(t, &s1ap.ENBConfigurationUpdateFailure{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscUnspecified}, + Cause: s1ap.Ptr(s1ap.CauseMiscUnspecified.Cause()), TimeToWait: s1ap.Ptr(s1ap.TimeToWaitV10s), CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ProcedureCode: s1ap.Ptr(s1ap.ProcENBConfigurationUpdate)}, }) corpus["enb_configuration_transfer_full"] = mustMarshal(t, &s1ap.ENBConfigurationTransfer{ - SONConfigurationTransfer: s1ap.SONConfigurationTransfer{0x01, 0x02, 0x03, 0x04}, + SONConfigurationTransfer: testSONConfigurationTransfer(1, 2), }) corpus["mme_configuration_transfer_full"] = mustMarshal(t, &s1ap.MMEConfigurationTransfer{ - SONConfigurationTransfer: s1ap.SONConfigurationTransfer{0x05, 0x06, 0x07, 0x08}, + SONConfigurationTransfer: testSONConfigurationTransfer(5, 6), }) corpus["location_report_full"] = mustMarshal(t, &s1ap.LocationReport{ @@ -135,7 +150,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["ue_context_modification_failure_full"] = mustMarshal(t, &s1ap.UEContextModificationFailure{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(1)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), }) corpus["erab_modify_request_full"] = mustMarshal(t, &s1ap.ERABModifyRequest{ @@ -154,7 +169,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), ERABModify: []s1ap.ERABModifyItemBearerModRes{{ERABID: 5}}, ERABFailedToModify: []s1ap.ERABItem{ - {ERABID: 6, Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}}, + {ERABID: 6, Cause: s1ap.CauseRadioNetworkUnspecified.Cause()}, }, CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ProcedureCode: s1ap.Ptr(s1ap.ProcERABModify)}, UserLocationInformation: &s1ap.UserLocationInformation{EUTRANCGI: testCGI, TAI: testTAI}, @@ -164,10 +179,10 @@ func goldenCorpus(t *testing.T) map[string][]byte { MMEUES1APID: 1, ENBUES1APID: 2, ToBeModified: []s1ap.ERABToBeModifiedItemBearerModInd{ - {ERABID: 5, TransportLayerAddress: s1ap.TransportLayerAddress{10, 45, 0, 1}, DLGTPTEID: 0x21}, + {ERABID: 5, TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 1}), DLGTPTEID: 0x21}, }, NotToBeModified: []s1ap.ERABToBeModifiedItemBearerModInd{ - {ERABID: 6, TransportLayerAddress: s1ap.TransportLayerAddress{10, 45, 0, 2}, DLGTPTEID: 0x22}, + {ERABID: 6, TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 2}), DLGTPTEID: 0x22}, }, UserLocationInformation: &s1ap.UserLocationInformation{EUTRANCGI: testCGI, TAI: testTAI}, }) @@ -180,13 +195,13 @@ func goldenCorpus(t *testing.T) map[string][]byte { }) corpus["reset_all_full"] = mustMarshal(t, &s1ap.Reset{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscUnspecified}, - ResetType: s1ap.ResetType{All: true}, + Cause: s1ap.Ptr(s1ap.CauseMiscUnspecified.Cause()), + ResetType: s1ap.ResetType{S1Interface: s1ap.Ptr(s1ap.ResetAllResetAll)}, }) corpus["reset_part_full"] = mustMarshal(t, &s1ap.Reset{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupTransport, Value: 0}, - ResetType: s1ap.ResetType{Part: []s1ap.UEAssociatedLogicalS1ConnectionItem{ + Cause: s1ap.Ptr(s1ap.CauseTransportResourceUnavailable.Cause()), + ResetType: s1ap.ResetType{PartOfS1Interface: &s1ap.UEAssociatedLogicalS1ConnectionListRes{ {MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(7)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(3))}, {ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(4))}, }}, @@ -202,12 +217,12 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["path_switch_request_full"] = mustMarshal(t, &s1ap.PathSwitchRequest{ ENBUES1APID: 9, ERABToBeSwitchedDL: []s1ap.ERABToBeSwitchedDLItem{ - {ERABID: 5, TransportLayerAddress: s1ap.TransportLayerAddress{10, 45, 0, 1}, GTPTEID: 0x11}, + {ERABID: 5, TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 1}), GTPTEID: 0x11}, }, SourceMMEUES1APID: 4, EUTRANCGI: s1ap.Ptr(testCGI), TAI: s1ap.Ptr(testTAI), - UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xe000, IntegrityProtectionAlgorithms: 0xe000}), + UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xe000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xe000}}), }) corpus["path_switch_request_acknowledge_full"] = mustMarshal(t, &s1ap.PathSwitchRequestAcknowledge{ @@ -215,17 +230,17 @@ func goldenCorpus(t *testing.T) map[string][]byte { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(9)), UEAggregateMaximumBitRate: &s1ap.UEAggregateMaximumBitRate{DL: 200000000, UL: 100000000}, ERABToBeReleased: []s1ap.ERABItem{ - {ERABID: 6, Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}}, + {ERABID: 6, Cause: s1ap.CauseRadioNetworkUnspecified.Cause()}, }, SecurityContext: s1ap.SecurityContext{NextHopChainingCount: 3, NextHopParameter: s1ap.SecurityKey{0x01, 0x02, 0x03}}, MMEUES1APID2: s1ap.Ptr(s1ap.MMEUES1APID(5)), - UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xe000, IntegrityProtectionAlgorithms: 0xe000}), + UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xe000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xe000}}), }) corpus["path_switch_request_failure_full"] = mustMarshal(t, &s1ap.PathSwitchRequestFailure{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(4)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(9)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 6}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHOFailureInTarget.Cause()), CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ProcedureCode: s1ap.Ptr(s1ap.ProcPathSwitchRequest)}, }) @@ -233,13 +248,13 @@ func goldenCorpus(t *testing.T) map[string][]byte { MMEUES1APID: 4, ENBUES1APID: 9, NASPDU: s1ap.NASPDU{0x07, 0x4b, 0x09}, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 27}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkInvalidQoSCombination.Cause()), }) corpus["s1_setup_request_full"] = mustMarshal(t, &s1ap.S1SetupRequest{ GlobalENBID: s1ap.GlobalENBID{ PLMNIdentity: testPLMN, - ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 411}, + ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(411))}, }, ENBName: s1ap.Ptr("srsenb01"), SupportedTAs: s1ap.SupportedTAs{{ @@ -263,7 +278,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { }) corpus["s1_setup_failure_full"] = mustMarshal(t, &s1ap.S1SetupFailure{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 3}, + Cause: s1ap.Ptr(s1ap.CauseMiscOMIntervention.Cause()), TimeToWait: s1ap.Ptr(s1ap.TimeToWaitV10s), CriticalityDiagnostics: testDiagnostics(), }) @@ -277,10 +292,10 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["paging_full"] = mustMarshal(t, &s1ap.Paging{ UEIdentityIndexValue: s1ap.Ptr(uint16(42)), - STMSI: &s1ap.STMSI{MMEC: 1, MTMSI: 0x01020304}, + UEPagingID: &s1ap.UEPagingID{STMSI: &s1ap.STMSI{MMEC: 1, MTMSI: 0x01020304}}, PagingDRX: s1ap.Ptr(s1ap.PagingDRXv64), CNDomain: s1ap.Ptr(s1ap.CNDomainPS), - TAIList: []s1ap.TAI{testTAI}, + TAIList: s1ap.TAIList{{TAI: testTAI}}, PagingPriority: s1ap.Ptr(s1ap.PagingPriorityLevel1), UERadioCapabilityForPaging: []byte{0xab, 0xcd}, }) @@ -288,7 +303,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["error_indication_full"] = mustMarshal(t, &s1ap.ErrorIndication{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(7)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(807)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseProtocolTransferSyntaxError.Cause()), CriticalityDiagnostics: testDiagnostics(), STMSI: &s1ap.STMSI{MMEC: 1, MTMSI: 0x01020304}, }) @@ -296,7 +311,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["initial_context_setup_failure_full"] = mustMarshal(t, &s1ap.InitialContextSetupFailure{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(7)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(807)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), CriticalityDiagnostics: testDiagnostics(), }) @@ -311,9 +326,9 @@ func goldenCorpus(t *testing.T) map[string][]byte { MMEUES1APID: 7, ENBUES1APID: 2, HandoverType: s1ap.HandoverTypeIntraLTE, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, - TargetID: s1ap.TargetID{TargeteNBID: s1ap.TargeteNBID{ - GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 2}}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), + TargetID: s1ap.TargetID{TargeteNBID: &s1ap.TargeteNBID{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(2))}}, SelectedTAI: testTAI, }}, DirectForwardingPathAvailability: s1ap.Ptr(s1ap.DirectForwardingPathAvailable), @@ -327,10 +342,10 @@ func goldenCorpus(t *testing.T) map[string][]byte { NASSecurityParametersfromEUTRAN: s1ap.NASSecurityParametersfromEUTRAN{0x01, 0x02}, ERABSubjecttoDataForwarding: []s1ap.ERABDataForwardingItem{{ ERABID: 5, - DLTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 2}, + DLTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2})), DLGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0x99)), }}, - ERABToRelease: []s1ap.ERABItem{{ERABID: 6, Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}}}, + ERABToRelease: []s1ap.ERABItem{{ERABID: 6, Cause: s1ap.CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: s1ap.TransparentContainer{0x11}, CriticalityDiagnostics: testDiagnostics(), }) @@ -338,23 +353,23 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["handover_preparation_failure_full"] = mustMarshal(t, &s1ap.HandoverPreparationFailure{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(7)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), CriticalityDiagnostics: testDiagnostics(), }) corpus["handover_request_full"] = mustMarshal(t, &s1ap.HandoverRequest{ MMEUES1APID: 7, HandoverType: s1ap.HandoverTypeUTRANtoLTE, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAMBR: s1ap.UEAggregateMaximumBitRate{DL: 100_000_000, UL: 50_000_000}, ERABToBeSetup: []s1ap.ERABToBeSetupItemHOReq{{ ERABID: 5, - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, }}, SourceToTarget: testSourceeNBContainer(t), - UESecurityCapabilities: s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}}, HandoverRestrictionList: &s1ap.HandoverRestrictionList{ ServingPLMN: testPLMN, EquivalentPLMNs: s1ap.EPLMNs{testPLMN}, @@ -373,17 +388,17 @@ func goldenCorpus(t *testing.T) map[string][]byte { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(55)), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: 5, - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, }}, - ERABFailedToSetup: []s1ap.ERABItem{{ERABID: 6, Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}}}, + ERABFailedToSetup: []s1ap.ERABItem{{ERABID: 6, Cause: s1ap.CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: s1ap.TransparentContainer{0x11}, CriticalityDiagnostics: testDiagnostics(), }) corpus["handover_failure_full"] = mustMarshal(t, &s1ap.HandoverFailure{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(7)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), CriticalityDiagnostics: testDiagnostics(), }) @@ -397,7 +412,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus["handover_cancel_full"] = mustMarshal(t, &s1ap.HandoverCancel{ MMEUES1APID: 7, ENBUES1APID: 2, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), }) corpus["handover_cancel_acknowledge_full"] = mustMarshal(t, &s1ap.HandoverCancelAcknowledge{ diff --git a/internal/decoder/s1ap/handover.go b/internal/decoder/s1ap/handover.go index 009a7c3dad..bc88002f00 100644 --- a/internal/decoder/s1ap/handover.go +++ b/internal/decoder/s1ap/handover.go @@ -50,11 +50,11 @@ func targetID(t s1ap.TargetID) TargetID { SelectedTAI: FiveGSTAI{PLMNID: plmnToID(n.SelectedTAI.PLMNIdentity), TAC: uint32(n.SelectedTAI.TAC)}, } - if g := n.GlobalRANNodeID.GNB; g != nil { + if g := n.GlobalRANNodeID.GNB; g != nil && g.GlobalGNBID.GNBID.GNBID != nil { node.GlobalGNBID = &GlobalGNBID{ PLMNID: plmnToID(g.GlobalGNBID.PLMNIdentity), - GNBID: g.GlobalGNBID.GNBID.Value, - Bits: g.GlobalGNBID.GNBID.Bits, + GNBID: g.GlobalGNBID.GNBID.GNBID.Value, + Bits: g.GlobalGNBID.GNBID.GNBID.Bits, } } @@ -66,6 +66,10 @@ func targetID(t s1ap.TargetID) TargetID { return TargetID{NgRanNode: node} } + if t.TargeteNBID == nil { + return TargetID{} + } + enb := globalENBID(t.TargeteNBID.GlobalENBID) selected := tai(t.TargeteNBID.SelectedTAI) @@ -99,7 +103,7 @@ type ERABAdmitted struct { } func handoverType(t s1ap.HandoverType) utils.EnumField { - return utils.NamedEnum(uint8(t), t.Name()) + return namedEnum(uint8(t), t.Name()) } func securityContext(s s1ap.SecurityContext) SecurityContext { @@ -138,7 +142,7 @@ func buildHandoverRequired(value []byte) (S1APMessageValue, string) { if m.DirectForwardingPathAvailability != nil { d := *m.DirectForwardingPathAvailability - ies = append(ies, ie(s1ap.IDDirectForwardingPathAvailability, s1ap.CriticalityIgnore, utils.NamedEnum(uint8(d), d.Name()))) + ies = append(ies, ie(s1ap.IDDirectForwardingPathAvailability, s1ap.CriticalityIgnore, namedEnum(uint8(d), d.Name()))) } ies = append(ies, ie(s1ap.IDSourceToTargetTransparentContainer, s1ap.CriticalityReject, sourceToTargetTransparentContainer(m.SourceToTarget, m.HandoverType == s1ap.HandoverTypeIntraLTE))) @@ -169,13 +173,11 @@ func buildHandoverRequest(value []byte) (S1APMessageValue, string) { ERABQoSExtensions: qosExtensions(it.QoS), } - if x := it.Extensions; x != nil { - e.ERABSetupExtensions = setupExtensions(nil, nil, x.BearerType, x.EthernetType, x.SecurityIndication) + e.ERABSetupExtensions = setupExtensions(nil, nil, it.BearerType, it.EthernetType, it.SecurityIndication) - if x.DataForwardingNotPossible != nil { - notPossible := true - e.DataForwardingNotPossible = ¬Possible - } + if it.DataForwardingNotPossible != nil { + notPossible := true + e.DataForwardingNotPossible = ¬Possible } erabs = append(erabs, e) @@ -195,8 +197,8 @@ func buildHandoverRequest(value []byte) (S1APMessageValue, string) { ie(s1ap.IDERABToBeSetupListHOReq, s1ap.CriticalityReject, erabs), ie(s1ap.IDSourceToTargetTransparentContainer, s1ap.CriticalityReject, sourceToTargetTransparentContainer(m.SourceToTarget, true)), ie(s1ap.IDUESecurityCapabilities, s1ap.CriticalityReject, UESecurityCapabilities{ - EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms, "EEA"), - IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms, "EIA"), + EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms.Value, "EEA"), + IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms.Value, "EIA"), }), ) @@ -471,12 +473,12 @@ func buildMMEStatusTransfer(value []byte) (S1APMessageValue, string) { return S1APMessageValue{IEs: ies}, fmt.Sprintf("MME Status Transfer (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) } -func transportLayerAddressOrEmpty(b s1ap.TransportLayerAddress) string { - if len(b) == 0 { +func transportLayerAddressOrEmpty(a *s1ap.TransportLayerAddress) string { + if a == nil { return "" } - return transportLayerAddress(b) + return transportLayerAddress(*a) } // HandoverRestrictionList is the decoded Handover Restriction List IE @@ -528,7 +530,7 @@ func handoverRestrictionList(l s1ap.HandoverRestrictionList) HandoverRestriction if l.ForbiddenInterRATs != nil { r := *l.ForbiddenInterRATs - e := utils.NamedEnum(uint8(r), r.Name()) + e := namedEnum(uint8(r), r.Name()) out.ForbiddenInterRATs = &e } diff --git a/internal/decoder/s1ap/handover_test.go b/internal/decoder/s1ap/handover_test.go index 915d8e094c..5957888ae7 100644 --- a/internal/decoder/s1ap/handover_test.go +++ b/internal/decoder/s1ap/handover_test.go @@ -7,6 +7,7 @@ import ( "strings" "testing" + "github.com/ellanetworks/core/per/ap" lib "github.com/ellanetworks/core/s1ap" ) @@ -15,9 +16,9 @@ func TestDecodeHandoverRequired(t *testing.T) { MMEUES1APID: 7, ENBUES1APID: 2, HandoverType: lib.HandoverTypeIntraLTE, - Cause: lib.Ptr(lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}), - TargetID: lib.TargetID{TargeteNBID: lib.TargeteNBID{ - GlobalENBID: lib.GlobalENBID{PLMNIdentity: lib.PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: lib.ENBID{Kind: lib.ENBIDMacro, Value: 2}}, + Cause: lib.Ptr(lib.CauseRadioNetwork(16).Cause()), + TargetID: lib.TargetID{TargeteNBID: &lib.TargeteNBID{ + GlobalENBID: lib.GlobalENBID{PLMNIdentity: lib.PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: lib.ENBID{MacroENBID: lib.Ptr(lib.MacroENBID(2))}}, SelectedTAI: lib.TAI{PLMNIdentity: lib.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, }}, SourceToTarget: lib.TransparentContainer{0xab, 0xcd}, @@ -52,10 +53,10 @@ func TestDecodeHandoverRequestAcknowledge(t *testing.T) { ENBUES1APID: lib.Ptr(lib.ENBUES1APID(55)), ERABAdmitted: []lib.ERABAdmittedItem{{ ERABID: 5, - TransportLayerAddress: lib.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, }}, - ERABFailedToSetup: []lib.ERABItem{{ERABID: 6, Cause: lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 0}}}, + ERABFailedToSetup: []lib.ERABItem{{ERABID: 6, Cause: lib.CauseRadioNetwork(0).Cause()}}, TargetToSource: lib.TransparentContainer{0x11}, }).Marshal() if err != nil { @@ -109,11 +110,11 @@ func TestDecodeHandoverRequiredNGRANTarget(t *testing.T) { MMEUES1APID: 7, ENBUES1APID: 2, HandoverType: lib.HandoverTypeEPSToFiveGS, - Cause: lib.Ptr(lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 16}), + Cause: lib.Ptr(lib.CauseRadioNetwork(16).Cause()), TargetID: lib.TargetID{TargetNgRanNodeID: &lib.TargetNgRanNodeID{ GlobalRANNodeID: lib.GlobalRANNodeID{GNB: &lib.GNB{GlobalGNBID: lib.GlobalGNBID{ PLMNIdentity: lib.PLMNIdentity{0x00, 0xf1, 0x10}, - GNBID: lib.GNBID{Value: 0x2a, Bits: 22}, + GNBID: lib.GNBIdentity{GNBID: &lib.GNBID{Value: 0x2a, Bits: 22}}, }}}, SelectedTAI: lib.FiveGSTAI{PLMNIdentity: lib.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 0x000101}, }}, diff --git a/internal/decoder/s1ap/initial_context_setup.go b/internal/decoder/s1ap/initial_context_setup.go index 99db44749f..822fc5fc7f 100644 --- a/internal/decoder/s1ap/initial_context_setup.go +++ b/internal/decoder/s1ap/initial_context_setup.go @@ -107,8 +107,8 @@ func buildInitialContextSetupRequest(value []byte) (S1APMessageValue, string) { ie(s1ap.IDUEAggregateMaximumBitrate, s1ap.CriticalityReject, AMBR{DL: uint64(m.UEAggregateMaximumBitRate.DL), UL: uint64(m.UEAggregateMaximumBitRate.UL)}), ie(s1ap.IDERABToBeSetupListCtxtSUReq, s1ap.CriticalityReject, erabs), ie(s1ap.IDUESecurityCapabilities, s1ap.CriticalityReject, UESecurityCapabilities{ - EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms, "EEA"), - IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms, "EIA"), + EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms.Value, "EEA"), + IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms.Value, "EIA"), }), ie(s1ap.IDSecurityKey, s1ap.CriticalityReject, hex.EncodeToString(m.SecurityKey[:])), } diff --git a/internal/decoder/s1ap/location_report.go b/internal/decoder/s1ap/location_report.go index 878066a85b..88f7a57628 100644 --- a/internal/decoder/s1ap/location_report.go +++ b/internal/decoder/s1ap/location_report.go @@ -19,8 +19,8 @@ type RequestType struct { func requestType(r s1ap.RequestType) RequestType { return RequestType{ - EventType: utils.NamedEnum(uint8(r.EventType), r.EventType.Name()), - ReportArea: utils.NamedEnum(uint8(r.ReportArea), r.ReportArea.Name()), + EventType: namedEnum(uint8(r.EventType), r.EventType.Name()), + ReportArea: namedEnum(uint8(r.ReportArea), r.ReportArea.Name()), } } diff --git a/internal/decoder/s1ap/mme_configuration_update_test.go b/internal/decoder/s1ap/mme_configuration_update_test.go index 12c70b0d99..f2a1d84ad6 100644 --- a/internal/decoder/s1ap/mme_configuration_update_test.go +++ b/internal/decoder/s1ap/mme_configuration_update_test.go @@ -58,7 +58,7 @@ func TestDecodeMMEConfigurationUpdateAcknowledge(t *testing.T) { func TestDecodeMMEConfigurationUpdateFailure(t *testing.T) { msg := decodeHex(t, marshalHex(t, &s1ap.MMEConfigurationUpdateFailure{ - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolSemanticError}), + Cause: s1ap.Ptr(s1ap.CauseProtocolSemanticError.Cause()), })) if msg.PDUType != "UnsuccessfulOutcome" || msg.ProcedureCode.Value != int64(s1ap.ProcMMEConfigurationUpdate) { diff --git a/internal/decoder/s1ap/modeled_ies_test.go b/internal/decoder/s1ap/modeled_ies_test.go index 7eef59e96a..27222b763f 100644 --- a/internal/decoder/s1ap/modeled_ies_test.go +++ b/internal/decoder/s1ap/modeled_ies_test.go @@ -6,6 +6,7 @@ package s1ap import ( "testing" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -21,7 +22,7 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { ERABToBeSetup: []s1ap.ERABToBeSetupItemCtxtSUReq{{ ERABID: 5, QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, - TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 1}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), GTPTEID: 1, }}, GUMMEI: &gummeiID, @@ -30,11 +31,11 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { "handover_request_gummei_mme_ue_s1ap_id_2": mustMarshal(t, &s1ap.HandoverRequest{ MMEUES1APID: 1, HandoverType: s1ap.HandoverTypeIntraLTE, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), SourceToTarget: s1ap.TransparentContainer{0x00}, ERABToBeSetup: []s1ap.ERABToBeSetupItemHOReq{{ ERABID: 5, - TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 1}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), GTPTEID: 1, QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, }}, @@ -49,7 +50,7 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { "path_switch_request_acknowledge_erab_to_be_switched_ul_list": mustMarshal(t, &s1ap.PathSwitchRequestAcknowledge{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(1)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), - ERABToBeSwitchedUL: s1ap.ERABToBeSwitchedULList{{ERABID: 5, TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 9}, GTPTEID: 7}}, + ERABToBeSwitchedUL: s1ap.ERABToBeSwitchedULList{{ERABID: 5, TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 9}), GTPTEID: 7}}, }), "erab_modify_request_transport_information": mustMarshal(t, &s1ap.ERABModifyRequest{ MMEUES1APID: 1, @@ -58,12 +59,12 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { ERABID: 5, QoS: s1ap.ERABLevelQoSParameters{QCI: 9, ARP: s1ap.AllocationAndRetentionPriority{PriorityLevel: 15}}, NASPDU: s1ap.NASPDU{0x07}, - TransportInformation: &s1ap.TransportInformation{TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 9}, ULGTPTEID: 7}, + TransportInformation: &s1ap.TransportInformation{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 9}), ULGTPTEID: 7}, }}, }), "path_switch_request_source_mme_gummei": mustMarshal(t, &s1ap.PathSwitchRequest{ ENBUES1APID: 2, - ERABToBeSwitchedDL: []s1ap.ERABToBeSwitchedDLItem{{ERABID: 5, TransportLayerAddress: s1ap.TransportLayerAddress{10, 0, 0, 1}, GTPTEID: 1}}, + ERABToBeSwitchedDL: []s1ap.ERABToBeSwitchedDLItem{{ERABID: 5, TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), GTPTEID: 1}}, SourceMMEUES1APID: 1, EUTRANCGI: &s1ap.EUTRANCGI{PLMNIdentity: testPLMN, CellID: 1}, TAI: &s1ap.TAI{PLMNIdentity: testPLMN, TAC: 1}, @@ -73,7 +74,7 @@ func modeledIEsCorpus(t *testing.T) map[string][]byte { "ue_context_release_request_gw_context_release_indication": mustMarshal(t, &s1ap.UEContextReleaseRequest{ MMEUES1APID: 1, ENBUES1APID: 2, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkX2HandoverTriggered}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkX2HandoverTriggered.Cause()), GWContextReleaseIndication: s1ap.Ptr(s1ap.GWContextReleaseIndicationTrue), }), } diff --git a/internal/decoder/s1ap/overload.go b/internal/decoder/s1ap/overload.go index 5216b58253..eda222b55e 100644 --- a/internal/decoder/s1ap/overload.go +++ b/internal/decoder/s1ap/overload.go @@ -28,8 +28,13 @@ func buildOverloadStart(value []byte) (S1APMessageValue, string) { return S1APMessageValue{Error: fmt.Sprintf("parse Overload Start: %v", err)}, "" } + var action uint8 + if a := m.OverloadResponse.OverloadAction; a != nil { + action = uint8(*a) + } + ies := []IE{ - ie(s1ap.IDOverloadResponse, s1ap.CriticalityReject, OverloadResponse{OverloadAction: uint8(m.OverloadResponse.OverloadAction)}), + ie(s1ap.IDOverloadResponse, s1ap.CriticalityReject, OverloadResponse{OverloadAction: action}), } if len(m.GUMMEIList) > 0 { @@ -42,7 +47,7 @@ func buildOverloadStart(value []byte) (S1APMessageValue, string) { ies = appendUnknownIEs(ies, m.UnknownIEs()) - return S1APMessageValue{IEs: ies}, fmt.Sprintf("Overload Start (action %d)", uint8(m.OverloadResponse.OverloadAction)) + return S1APMessageValue{IEs: ies}, fmt.Sprintf("Overload Start (action %d)", action) } func buildOverloadStop(value []byte) (S1APMessageValue, string) { diff --git a/internal/decoder/s1ap/paging.go b/internal/decoder/s1ap/paging.go index aa6e3c5392..37e1d66b3d 100644 --- a/internal/decoder/s1ap/paging.go +++ b/internal/decoder/s1ap/paging.go @@ -8,7 +8,6 @@ import ( "fmt" "strconv" - "github.com/ellanetworks/core/internal/decoder/utils" "github.com/ellanetworks/core/s1ap" ) @@ -20,7 +19,7 @@ func buildPaging(value []byte) (S1APMessageValue, string) { tais := make([]TAI, 0, len(m.TAIList)) for _, t := range m.TAIList { - tais = append(tais, tai(t)) + tais = append(tais, tai(t.TAI)) } var ies []IE @@ -29,8 +28,15 @@ func buildPaging(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUEIdentityIndexValue, s1ap.CriticalityIgnore, *m.UEIdentityIndexValue)) } - if m.STMSI != nil { - ies = append(ies, ie(s1ap.IDUEPagingID, s1ap.CriticalityIgnore, stmsi(*m.STMSI))) + if p := m.UEPagingID; p != nil { + switch { + case p.STMSI != nil: + ies = append(ies, ie(s1ap.IDUEPagingID, s1ap.CriticalityIgnore, stmsi(*p.STMSI))) + case p.IMSI != nil: + ies = append(ies, ie(s1ap.IDUEPagingID, s1ap.CriticalityIgnore, hex.EncodeToString(*p.IMSI))) + case p.Ext != nil: + ies = append(ies, ie(s1ap.IDUEPagingID, s1ap.CriticalityIgnore, rawIEValue{Hex: hex.EncodeToString([]byte(p.Ext.Value))})) + } } if m.PagingDRX != nil { @@ -45,7 +51,7 @@ func buildPaging(value []byte) (S1APMessageValue, string) { if m.PagingPriority != nil { pr := *m.PagingPriority - ies = append(ies, ie(s1ap.IDPagingPriority, s1ap.CriticalityIgnore, utils.NamedEnum(uint8(pr), pr.Name()))) + ies = append(ies, ie(s1ap.IDPagingPriority, s1ap.CriticalityIgnore, namedEnum(uint8(pr), pr.Name()))) } if len(m.UERadioCapabilityForPaging) > 0 { @@ -55,8 +61,8 @@ func buildPaging(value []byte) (S1APMessageValue, string) { ies = appendUnknownIEs(ies, m.UnknownIEs()) mtmsi := "?" - if m.STMSI != nil { - mtmsi = strconv.FormatUint(uint64(m.STMSI.MTMSI), 10) + if m.UEPagingID != nil && m.UEPagingID.STMSI != nil { + mtmsi = strconv.FormatUint(uint64(m.UEPagingID.STMSI.MTMSI), 10) } return S1APMessageValue{IEs: ies}, fmt.Sprintf("Paging (M-TMSI %s, %d TAI)", mtmsi, len(m.TAIList)) diff --git a/internal/decoder/s1ap/path_switch.go b/internal/decoder/s1ap/path_switch.go index afd8d0565b..29d43bd03d 100644 --- a/internal/decoder/s1ap/path_switch.go +++ b/internal/decoder/s1ap/path_switch.go @@ -58,8 +58,8 @@ func buildPathSwitchRequest(value []byte) (S1APMessageValue, string) { if m.UESecurityCapabilities != nil { ies = append(ies, ie(s1ap.IDUESecurityCapabilities, s1ap.CriticalityIgnore, UESecurityCapabilities{ - EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms, "EEA"), - IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms, "EIA"), + EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms.Value, "EEA"), + IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms.Value, "EIA"), })) } @@ -117,8 +117,8 @@ func buildPathSwitchRequestAcknowledge(value []byte) (S1APMessageValue, string) if m.UESecurityCapabilities != nil { ies = append(ies, ie(s1ap.IDUESecurityCapabilities, s1ap.CriticalityIgnore, UESecurityCapabilities{ - EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms, "EEA"), - IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms, "EIA"), + EncryptionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.EncryptionAlgorithms.Value, "EEA"), + IntegrityProtectionAlgorithms: securityAlgorithms(m.UESecurityCapabilities.IntegrityProtectionAlgorithms.Value, "EIA"), })) } diff --git a/internal/decoder/s1ap/pws.go b/internal/decoder/s1ap/pws.go index 7344228905..4d6d3a51ac 100644 --- a/internal/decoder/s1ap/pws.go +++ b/internal/decoder/s1ap/pws.go @@ -83,17 +83,17 @@ func tais(list []s1ap.TAI) []TAI { } func warningAreaList(l s1ap.WarningAreaList) WarningAreaList { - return WarningAreaList{ECGIs: ecgis(l.CellIDList), TAIs: tais(l.TAIList), EmergencyAreaIDs: emergencyAreaIDs(l.EmergencyAreaIDList)} + return WarningAreaList{ECGIs: ecgis(derefSlice(l.CellIDList)), TAIs: tais(derefSlice(l.TrackingAreaListforWarning)), EmergencyAreaIDs: emergencyAreaIDs(derefSlice(l.EmergencyAreaIDList))} } func broadcastCompletedAreaList(l s1ap.BroadcastCompletedAreaList) BroadcastCompletedAreaList { var out BroadcastCompletedAreaList - for _, c := range l.CellIDBroadcast { + for _, c := range derefSlice(l.CellIDBroadcast) { out.CellIDs = append(out.CellIDs, eutranCGI(c.ECGI)) } - for _, t := range l.TAIBroadcast { + for _, t := range derefSlice(l.TAIBroadcast) { b := TAIBroadcast{TAI: tai(t.TAI)} for _, c := range t.CompletedCellInTAI { b.CompletedCells = append(b.CompletedCells, eutranCGI(c.ECGI)) @@ -102,7 +102,7 @@ func broadcastCompletedAreaList(l s1ap.BroadcastCompletedAreaList) BroadcastComp out.TAIs = append(out.TAIs, b) } - for _, e := range l.EmergencyAreaIDBroadcast { + for _, e := range derefSlice(l.EmergencyAreaIDBroadcast) { b := EmergencyAreaIDBroadcast{EmergencyAreaID: emergencyAreaID(e.EmergencyAreaID)} for _, c := range e.CompletedCellInEAI { b.CompletedCells = append(b.CompletedCells, eutranCGI(c.ECGI)) @@ -117,11 +117,11 @@ func broadcastCompletedAreaList(l s1ap.BroadcastCompletedAreaList) BroadcastComp func broadcastCancelledAreaList(l s1ap.BroadcastCancelledAreaList) BroadcastCancelledAreaList { var out BroadcastCancelledAreaList - for _, c := range l.CellIDCancelled { + for _, c := range derefSlice(l.CellIDCancelled) { out.CellIDs = append(out.CellIDs, CancelledCell{ECGI: eutranCGI(c.ECGI), NumberOfBroadcasts: c.NumberOfBroadcasts}) } - for _, t := range l.TAICancelled { + for _, t := range derefSlice(l.TAICancelled) { b := TAICancelled{TAI: tai(t.TAI)} for _, c := range t.CancelledCellInTAI { b.CancelledCells = append(b.CancelledCells, CancelledCell{ECGI: eutranCGI(c.ECGI), NumberOfBroadcasts: c.NumberOfBroadcasts}) @@ -130,7 +130,7 @@ func broadcastCancelledAreaList(l s1ap.BroadcastCancelledAreaList) BroadcastCanc out.TAIs = append(out.TAIs, b) } - for _, e := range l.EmergencyAreaIDCancelled { + for _, e := range derefSlice(l.EmergencyAreaIDCancelled) { b := EmergencyAreaIDCancelled{EmergencyAreaID: emergencyAreaID(e.EmergencyAreaID)} for _, c := range e.CancelledCellInEAI { b.CancelledCells = append(b.CancelledCells, CancelledCell{ECGI: eutranCGI(c.ECGI), NumberOfBroadcasts: c.NumberOfBroadcasts}) diff --git a/internal/decoder/s1ap/pws_test.go b/internal/decoder/s1ap/pws_test.go index 02f7b9cee8..2b83defe7d 100644 --- a/internal/decoder/s1ap/pws_test.go +++ b/internal/decoder/s1ap/pws_test.go @@ -12,12 +12,12 @@ import ( var ( testCGI2 = s1ap.EUTRANCGI{PLMNIdentity: testPLMN, CellID: 0x0019b02} testEAI = s1ap.EmergencyAreaID{0x01, 0x02, 0x03} - testENB = s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 0x12345}} + testENB = s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x12345))}} testGUMMEI = s1ap.GUMMEI{PLMNIdentity: testPLMN, MMEGroupID: s1ap.MMEGroupID{0x80, 0x01}, MMECode: 1} ) func testWarningAreaList() *s1ap.WarningAreaList { - return &s1ap.WarningAreaList{CellIDList: []s1ap.EUTRANCGI{testCGI, testCGI2}} + return &s1ap.WarningAreaList{CellIDList: &s1ap.ECGIList{testCGI, testCGI2}} } func addPWSOverloadCorpus(t *testing.T, corpus map[string][]byte) { @@ -45,7 +45,7 @@ func addPWSOverloadCorpus(t *testing.T, corpus map[string][]byte) { MessageIdentifier: 0x1112, SerialNumber: 0x3001, BroadcastCompletedAreaList: &s1ap.BroadcastCompletedAreaList{ - TAIBroadcast: []s1ap.TAIBroadcastItem{{TAI: testTAI, CompletedCellInTAI: []s1ap.CompletedCellInTAIItem{{ECGI: testCGI}}}}, + TAIBroadcast: &s1ap.TAIBroadcast{{TAI: testTAI, CompletedCellInTAI: []s1ap.CompletedCellInTAIItem{{ECGI: testCGI}}}}, }, CriticalityDiagnostics: testDiagnostics(), }) @@ -53,7 +53,7 @@ func addPWSOverloadCorpus(t *testing.T, corpus map[string][]byte) { corpus["kill_request_full"] = mustMarshal(t, &s1ap.KillRequest{ MessageIdentifier: 0x1112, SerialNumber: 0x3001, - WarningAreaList: &s1ap.WarningAreaList{EmergencyAreaIDList: []s1ap.EmergencyAreaID{testEAI}}, + WarningAreaList: &s1ap.WarningAreaList{EmergencyAreaIDList: &s1ap.EmergencyAreaIDList{testEAI}}, KillAllWarningMessages: s1ap.Ptr(s1ap.KillAllWarningMessagesTrue), }) @@ -61,7 +61,7 @@ func addPWSOverloadCorpus(t *testing.T, corpus map[string][]byte) { MessageIdentifier: 0x1112, SerialNumber: 0x3001, BroadcastCancelledAreaList: &s1ap.BroadcastCancelledAreaList{ - EmergencyAreaIDCancelled: []s1ap.EmergencyAreaIDCancelledItem{{ + EmergencyAreaIDCancelled: &s1ap.EmergencyAreaIDCancelled{{ EmergencyAreaID: testEAI, CancelledCellInEAI: []s1ap.CancelledCellInEAIItem{{ECGI: testCGI, NumberOfBroadcasts: 4}}, }}, @@ -82,7 +82,7 @@ func addPWSOverloadCorpus(t *testing.T, corpus map[string][]byte) { }) corpus["overload_start_full"] = mustMarshal(t, &s1ap.OverloadStart{ - OverloadResponse: s1ap.OverloadResponse{OverloadAction: s1ap.OverloadActionRejectRRCCRSignalling}, + OverloadResponse: s1ap.OverloadResponse{OverloadAction: s1ap.Ptr(s1ap.OverloadActionRejectRRCCRSignalling)}, GUMMEIList: []s1ap.GUMMEI{testGUMMEI}, TrafficLoadReductionIndication: s1ap.Ptr(uint8(40)), }) diff --git a/internal/decoder/s1ap/reset.go b/internal/decoder/s1ap/reset.go index 3ce91907b7..664070d4aa 100644 --- a/internal/decoder/s1ap/reset.go +++ b/internal/decoder/s1ap/reset.go @@ -4,6 +4,7 @@ package s1ap import ( + "encoding/hex" "fmt" "github.com/ellanetworks/core/s1ap" @@ -58,16 +59,21 @@ func buildReset(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDCause, s1ap.CriticalityIgnore, cause(*m.Cause))) } - rt := ResetType{S1Interface: m.ResetType.All} - if !m.ResetType.All { - rt.PartOfS1 = ueAssociatedConnections(m.ResetType.Part) + all := m.ResetType.S1Interface != nil + part := derefSlice(m.ResetType.PartOfS1Interface) + + var rt any = ResetType{S1Interface: all} + if m.ResetType.Ext != nil { + rt = rawIEValue{Hex: hex.EncodeToString([]byte(m.ResetType.Ext.Value))} + } else if !all { + rt = ResetType{PartOfS1: ueAssociatedConnections(part)} } ies = append(ies, ie(s1ap.IDResetType, s1ap.CriticalityReject, rt)) ies = appendUnknownIEs(ies, m.UnknownIEs()) - scope := fmt.Sprintf("%d connection(s)", len(m.ResetType.Part)) - if m.ResetType.All { + scope := fmt.Sprintf("%d connection(s)", len(part)) + if all { scope = "whole S1 interface" } diff --git a/internal/decoder/s1ap/s1_setup.go b/internal/decoder/s1ap/s1_setup.go index 242734d129..2ec7a9775f 100644 --- a/internal/decoder/s1ap/s1_setup.go +++ b/internal/decoder/s1ap/s1_setup.go @@ -5,6 +5,7 @@ package s1ap import ( "fmt" + "strings" "github.com/ellanetworks/core/internal/decoder/utils" "github.com/ellanetworks/core/s1ap" @@ -40,14 +41,29 @@ type Cause struct { Value utils.EnumField `json:"value"` } -func enbIDKind(kind s1ap.ENBIDKind) utils.EnumField { - return utils.NamedEnum(uint8(kind), kind.Name()) +func enbIDKind(e s1ap.ENBID) utils.EnumField { + switch { + case e.MacroENBID != nil: + return namedEnum(uint8(0), e.AlternativeName()) + case e.HomeENBID != nil: + return namedEnum(uint8(1), e.AlternativeName()) + case e.ShortMacroENBID != nil: + return namedEnum(uint8(2), e.AlternativeName()) + case e.LongMacroENBID != nil: + return namedEnum(uint8(3), e.AlternativeName()) + case e.Ext != nil: + return utils.MakeEnum(2+e.Ext.Index, "", true) + default: + return utils.MakeEnum(0, "", true) + } } func globalENBID(g s1ap.GlobalENBID) GlobalENBID { + value, _ := g.ENBID.Value() + return GlobalENBID{ PLMNID: plmnToID(g.PLMNIdentity), - ENBID: ENBID{Kind: enbIDKind(g.ENBID.Kind), Value: g.ENBID.Value}, + ENBID: ENBID{Kind: enbIDKind(g.ENBID), Value: value}, } } @@ -67,22 +83,34 @@ func supportedTAs(tas s1ap.SupportedTAs) []SupportedTA { } func pagingDRXToEnum(d s1ap.PagingDRX) utils.EnumField { - return utils.NamedEnum(uint8(d), d.Name()) + return namedEnum(uint8(d), d.Name()) } func timeToWaitToEnum(t s1ap.TimeToWait) utils.EnumField { - return utils.NamedEnum(uint8(t), t.Name()) -} - -func causeGroupToEnum(g s1ap.CauseGroup) utils.EnumField { - return utils.NamedEnum(uint8(g), g.Name()) + return namedEnum(uint8(t), t.Name()) } func cause(c s1ap.Cause) Cause { + group, ok := c.Group() + if !ok { + var ext int64 + if c.Ext != nil { + ext = c.Ext.Index + } + + return Cause{ + Group: utils.MakeEnum(5+ext, "", true), + Value: utils.MakeEnum(0, "unknown", true), + } + } + name, index := c.ValueName() + if strings.HasPrefix(name, "unknown(") { + name = "unknown" + } return Cause{ - Group: causeGroupToEnum(c.Group), + Group: namedEnum(uint8(group), c.GroupName()), Value: utils.MakeEnum(int64(index), name, name == "unknown"), } } @@ -123,7 +151,7 @@ func buildS1SetupRequest(value []byte) (S1APMessageValue, string) { if req.UERetentionInformation != nil { r := *req.UERetentionInformation - ies = append(ies, ie(s1ap.IDUERetentionInformation, s1ap.CriticalityIgnore, utils.NamedEnum(uint8(r), r.Name()))) + ies = append(ies, ie(s1ap.IDUERetentionInformation, s1ap.CriticalityIgnore, namedEnum(uint8(r), r.Name()))) } summary := "S1 Setup Request" @@ -172,7 +200,7 @@ func buildS1SetupResponse(value []byte) (S1APMessageValue, string) { if resp.UERetentionInformation != nil { r := *resp.UERetentionInformation - ies = append(ies, ie(s1ap.IDUERetentionInformation, s1ap.CriticalityIgnore, utils.NamedEnum(uint8(r), r.Name()))) + ies = append(ies, ie(s1ap.IDUERetentionInformation, s1ap.CriticalityIgnore, namedEnum(uint8(r), r.Name()))) } ies = appendUnknownIEs(ies, resp.UnknownIEs()) diff --git a/internal/decoder/s1ap/s1_setup_test.go b/internal/decoder/s1ap/s1_setup_test.go index 76a25d2372..366c02d8f7 100644 --- a/internal/decoder/s1ap/s1_setup_test.go +++ b/internal/decoder/s1ap/s1_setup_test.go @@ -22,7 +22,7 @@ func TestDecodeS1SetupRequest(t *testing.T) { } g := mustIE(t, msg, s1ap.IDGlobalENBID).Value.(GlobalENBID) - if g.PLMNID.Mcc != "999" || g.PLMNID.Mnc != "01" || g.ENBID.Value != 411 || g.ENBID.Kind.Value != int64(s1ap.ENBIDMacro) { + if g.PLMNID.Mcc != "999" || g.PLMNID.Mnc != "01" || g.ENBID.Value != 411 || g.ENBID.Kind.Value != 0 { t.Fatalf("Global-ENB-ID = %+v", g) } @@ -66,7 +66,7 @@ func TestDecodeS1SetupResponse(t *testing.T) { func TestDecodeS1SetupFailure(t *testing.T) { ttw := s1ap.TimeToWaitV10s fail := &s1ap.S1SetupFailure{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 3}, + Cause: s1ap.Ptr(s1ap.CauseMiscOMIntervention.Cause()), TimeToWait: &ttw, } @@ -82,7 +82,7 @@ func TestDecodeS1SetupFailure(t *testing.T) { } c := mustIE(t, msg, s1ap.IDCause).Value.(Cause) - if c.Group.Value != int64(s1ap.CauseGroupMisc) || c.Value.Value != 3 { + if c.Group.Value != 4 || c.Value.Value != 3 { t.Fatalf("cause = %+v", c) } diff --git a/internal/decoder/s1ap/testdata/golden/enb_configuration_transfer_full.json b/internal/decoder/s1ap/testdata/golden/enb_configuration_transfer_full.json index 18fb563bf9..f7d06c2fc7 100644 --- a/internal/decoder/s1ap/testdata/golden/enb_configuration_transfer_full.json +++ b/internal/decoder/s1ap/testdata/golden/enb_configuration_transfer_full.json @@ -29,7 +29,7 @@ "unknown": false }, "value": { - "hex": "01020304" + "hex": "0000f1100000001000f11000010000f1100000002000f11000012000" } } ] diff --git a/internal/decoder/s1ap/testdata/golden/mme_configuration_transfer_full.json b/internal/decoder/s1ap/testdata/golden/mme_configuration_transfer_full.json index 498836c2e1..2a0210bee5 100644 --- a/internal/decoder/s1ap/testdata/golden/mme_configuration_transfer_full.json +++ b/internal/decoder/s1ap/testdata/golden/mme_configuration_transfer_full.json @@ -29,7 +29,7 @@ "unknown": false }, "value": { - "hex": "05060708" + "hex": "0000f1100000005000f11000010000f1100000006000f11000012000" } } ] diff --git a/internal/decoder/s1ap/trace.go b/internal/decoder/s1ap/trace.go index 96581d5359..a4798cb388 100644 --- a/internal/decoder/s1ap/trace.go +++ b/internal/decoder/s1ap/trace.go @@ -18,7 +18,7 @@ type TraceActivation struct { } var interfacesToTraceNames = []struct { - bit uint8 + bit s1ap.InterfacesToTrace name string }{ {s1ap.InterfaceToTraceS1MME, "S1-MME"}, diff --git a/internal/decoder/s1ap/trace_test.go b/internal/decoder/s1ap/trace_test.go index 037e242392..10976d840a 100644 --- a/internal/decoder/s1ap/trace_test.go +++ b/internal/decoder/s1ap/trace_test.go @@ -36,7 +36,7 @@ func TestDecodeS1APMessage_TraceStart(t *testing.T) { func TestDecodeS1APMessage_TraceFailureIndication(t *testing.T) { id := lib.EUTRANTraceID{0x02, 0xf8, 0x39, 0x0a, 0x0b, 0x0c, 0x12, 0x34} - cause := lib.Cause{Group: lib.CauseGroupRadioNetwork, Value: 5} + cause := lib.CauseRadioNetwork(5).Cause() raw, err := (&lib.TraceFailureIndication{MMEUES1APID: 1, ENBUES1APID: 2, EUTRANTraceID: &id, Cause: &cause}).Marshal() if err != nil { diff --git a/internal/decoder/s1ap/transparent_container.go b/internal/decoder/s1ap/transparent_container.go index e0d94afa7b..d79897b2e3 100644 --- a/internal/decoder/s1ap/transparent_container.go +++ b/internal/decoder/s1ap/transparent_container.go @@ -49,7 +49,7 @@ func sourceToTargetTransparentContainer(b []byte, sourceeNB bool) SourceToTarget return out } - c, err := s1ap.ParseSourceeNBToTargeteNBTransparentContainer(b) + c, err := s1ap.DecodeSourceeNBToTargeteNBTransparentContainer(b) if err != nil { out.Error = err.Error() @@ -72,7 +72,7 @@ func sourceeNBToTargeteNB(c *s1ap.SourceeNBToTargeteNBTransparentContainer) *Sou e := ERABInformation{ERABID: uint8(it.ERABID)} if it.DLForwarding != nil { - f := utils.NamedEnum(uint8(*it.DLForwarding), it.DLForwarding.Name()) + f := namedEnum(uint8(*it.DLForwarding), it.DLForwarding.Name()) e.DLForwarding = &f } @@ -98,7 +98,7 @@ func lastVisitedCell(it s1ap.LastVisitedCellItem) LastVisitedCell { case it.EUTRANCell != nil: out.EUTRANCell = &LastVisitedEUTRANCell{ GlobalCellID: eutranCGI(it.EUTRANCell.GlobalCellID), - CellSize: utils.NamedEnum(uint8(it.EUTRANCell.CellType.CellSize), it.EUTRANCell.CellType.CellSize.Name()), + CellSize: namedEnum(uint8(it.EUTRANCell.CellType.CellSize), it.EUTRANCell.CellType.CellSize.Name()), TimeUEStayedInCell: uint16(it.EUTRANCell.TimeUEStayedInCell), } case it.UTRANCell != nil: diff --git a/internal/decoder/s1ap/transparent_container_test.go b/internal/decoder/s1ap/transparent_container_test.go index 0584ce64d0..afa62542d4 100644 --- a/internal/decoder/s1ap/transparent_container_test.go +++ b/internal/decoder/s1ap/transparent_container_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/s1ap" ) @@ -22,7 +23,7 @@ func testSourceeNBContainer(t *testing.T) s1ap.TransparentContainer { UEHistoryInformation: s1ap.UEHistoryInformation{ {EUTRANCell: &s1ap.LastVisitedEUTRANCellInformation{GlobalCellID: testCGI, CellType: s1ap.CellType{CellSize: s1ap.CellSizeSmall}, TimeUEStayedInCell: 30}}, {UTRANCell: s1ap.Ptr(s1ap.LastVisitedUTRANCellInformation{0x01, 0x02})}, - {GERANCell: &s1ap.LastVisitedGERANCellInformation{}}, + {GERANCell: &s1ap.LastVisitedGERANCellInformation{Undefined: &per.Null{}}}, {NGRANCell: s1ap.Ptr(s1ap.LastVisitedNGRANCellInformation{0x0a})}, }, }).Marshal() @@ -40,9 +41,9 @@ func TestDecodeSourceeNBToTargeteNBTransparentContainer(t *testing.T) { MMEUES1APID: 7, ENBUES1APID: 2, HandoverType: s1ap.HandoverTypeIntraLTE, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}, - TargetID: s1ap.TargetID{TargeteNBID: s1ap.TargeteNBID{ - GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 2}}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), + TargetID: s1ap.TargetID{TargeteNBID: &s1ap.TargeteNBID{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(2))}}, SelectedTAI: testTAI, }}, SourceToTarget: c, diff --git a/internal/decoder/s1ap/ue_context_release.go b/internal/decoder/s1ap/ue_context_release.go index e87a7b5fa1..c7d981b822 100644 --- a/internal/decoder/s1ap/ue_context_release.go +++ b/internal/decoder/s1ap/ue_context_release.go @@ -49,7 +49,10 @@ func buildUEContextReleaseCommand(value []byte) (S1APMessageValue, string) { ies = appendUnknownIEs(ies, m.UnknownIEs()) - return S1APMessageValue{IEs: ies}, fmt.Sprintf("UE Context Release Command (MME-UE %d, eNB-UE %d)", m.UES1APIDs.MMEUES1APID, m.UES1APIDs.ENBUES1APID) + mme, _ := m.UES1APIDs.MMEID() + enb, _ := m.UES1APIDs.ENBID() + + return S1APMessageValue{IEs: ies}, fmt.Sprintf("UE Context Release Command (MME-UE %d, eNB-UE %d)", mme, enb) } func buildUEContextReleaseComplete(value []byte) (S1APMessageValue, string) { diff --git a/internal/decoder/s1ap/ue_context_release_test.go b/internal/decoder/s1ap/ue_context_release_test.go index 1ef6d95a25..edb8047bfb 100644 --- a/internal/decoder/s1ap/ue_context_release_test.go +++ b/internal/decoder/s1ap/ue_context_release_test.go @@ -21,7 +21,7 @@ func TestDecodeUEContextReleaseRequest(t *testing.T) { } c := mustIE(t, msg, s1ap.IDCause).Value.(Cause) - if c.Group.Value != int64(s1ap.CauseGroupRadioNetwork) || c.Value.Value != 29 { + if c.Group.Value != 0 || c.Value.Value != 29 { t.Fatalf("cause = %+v", c) } } @@ -39,7 +39,7 @@ func TestDecodeUEContextReleaseCommand(t *testing.T) { } c := mustIE(t, msg, s1ap.IDCause).Value.(Cause) - if c.Group.Value != int64(s1ap.CauseGroupRadioNetwork) || c.Value.Value != int64(s1ap.CauseRadioNetworkRadioConnectionWithUELost) { + if c.Group.Value != 0 || c.Value.Value != int64(s1ap.CauseRadioNetworkRadioConnectionWithUELost) { t.Fatalf("cause = %+v", c) } } diff --git a/internal/decoder/s1ap/unknown_ie_test.go b/internal/decoder/s1ap/unknown_ie_test.go index aa5ba5975c..7cf4a9e11c 100644 --- a/internal/decoder/s1ap/unknown_ie_test.go +++ b/internal/decoder/s1ap/unknown_ie_test.go @@ -14,7 +14,7 @@ import ( // is shown rather than dropped (TS 36.413 §9.3). func TestAppendUnknownIEs(t *testing.T) { ies := appendUnknownIEs(nil, []s1ap.RawIE{ - {ID: 300, Criticality: s1ap.CriticalityNotify, Value: []byte{0xde, 0xad}}, + {ID: 999, Criticality: s1ap.CriticalityNotify, Value: []byte{0xde, 0xad}}, }) if len(ies) != 1 { @@ -22,8 +22,8 @@ func TestAppendUnknownIEs(t *testing.T) { } got := ies[0] - if got.ID.Value != 300 || !got.ID.Unknown { - t.Fatalf("id = %+v, want value 300 flagged unknown", got.ID) + if got.ID.Value != 999 || !got.ID.Unknown { + t.Fatalf("id = %+v, want value 999 flagged unknown", got.ID) } if got.Criticality.Value != int64(s1ap.CriticalityNotify) { @@ -43,7 +43,7 @@ func TestDecodeInitialContextSetupFailure(t *testing.T) { raw, err := (&s1ap.InitialContextSetupFailure{ MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(1)), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), }).Marshal() if err != nil { t.Fatal(err) diff --git a/internal/decoder/s1ap/util.go b/internal/decoder/s1ap/util.go index ed1a74805a..6cc705c248 100644 --- a/internal/decoder/s1ap/util.go +++ b/internal/decoder/s1ap/util.go @@ -4,6 +4,8 @@ package s1ap import ( + "strings" + "github.com/ellanetworks/core/internal/decoder/utils" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/s1ap" @@ -21,8 +23,24 @@ func procedureCodeToEnum(code s1ap.ProcedureCode) utils.EnumField { return utils.MakeEnum(int64(code), name, !ok) } +func namedEnum[T ~int | ~int32 | ~int64 | ~uint8 | ~uint16 | ~uint32 | ~uint64](v T, name string) utils.EnumField { + if strings.HasPrefix(name, "unknown(") { + name = "" + } + + return utils.NamedEnum(v, name) +} + +func derefSlice[S ~[]E, E any](p *S) S { + if p == nil { + return nil + } + + return *p +} + func criticalityToEnum(c s1ap.Criticality) utils.EnumField { - return utils.NamedEnum(uint8(c), c.Name()) + return namedEnum(uint8(c), c.Name()) } // PLMNID is the MCC/MNC view of a 3-octet PLMN identity. diff --git a/internal/interworking/forward_relocation.go b/internal/interworking/forward_relocation.go index 4650e18ddf..66e3e68857 100644 --- a/internal/interworking/forward_relocation.go +++ b/internal/interworking/forward_relocation.go @@ -108,10 +108,7 @@ var ( ) func RefuseN26Relocation() error { - return fmt.Errorf("%w: %w", ErrN26NotAllowed, TargetRefusal{Cause: s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, - Value: s1ap.CauseRadioNetworkHOTargetNotAllowed, - }}) + return fmt.Errorf("%w: %w", ErrN26NotAllowed, TargetRefusal{Cause: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()}) } type EPSPeer interface { diff --git a/internal/lmf/engine_refresh_test.go b/internal/lmf/engine_refresh_test.go index bf4aadd457..6d1ab9116f 100644 --- a/internal/lmf/engine_refresh_test.go +++ b/internal/lmf/engine_refresh_test.go @@ -584,14 +584,9 @@ func TestRefreshLocation_Success(t *testing.T) { // NR Cell Identity is 36 bits; the low 28 carry the cell, matching what the // reference encoding of 0x00000004 produced. msg := &ngaplib.LocationReport{ - AMFUENGAPID: 1, - RANUENGAPID: 1, - UserLocationInformation: &ngaplib.UserLocationInformation{ - Kind: ngaplib.UserLocationNR, - PLMNIdentity: ngaplib.PLMNIdentity(plmnBytes), - CellIdentity: 4, - TAI: ngaplib.TAI{PLMNIdentity: ngaplib.PLMNIdentity(plmnBytes), TAC: 0x1a}, - }, + AMFUENGAPID: 1, + RANUENGAPID: 1, + UserLocationInformation: &ngaplib.UserLocationInformation{NR: &ngaplib.UserLocationInformationNR{NRCGI: ngaplib.NRCGI{PLMNIdentity: ngaplib.PLMNIdentity(plmnBytes), NRCellIdentity: ngaplib.NRCellIdentity(4)}, TAI: ngaplib.TAI{PLMNIdentity: ngaplib.PLMNIdentity(plmnBytes), TAC: 0x1a}}}, LocationReportingRequestType: &ngaplib.LocationReportingRequestType{ EventType: ngaplib.EventTypeDirect, ReportArea: ngaplib.ReportAreaCell, diff --git a/internal/lmf/lpp/lpptype/message.go b/internal/lmf/lpp/lpptype/message.go index b3bf92b1fa..607c658933 100644 --- a/internal/lmf/lpp/lpptype/message.go +++ b/internal/lmf/lpp/lpptype/message.go @@ -16,7 +16,7 @@ package lpptype import "github.com/ellanetworks/core/per" -//go:generate sh -c "rm -f per_gen.go && go run github.com/ellanetworks/core/cmd/pergen" +//go:generate go run github.com/ellanetworks/core/per/cmd/pergen // ===================================================================== // LPP-Message (TS 37.355 §6.2) diff --git a/internal/mme/bearer_arp_test.go b/internal/mme/bearer_arp_test.go index c16e0f5645..08d41a9f81 100644 --- a/internal/mme/bearer_arp_test.go +++ b/internal/mme/bearer_arp_test.go @@ -4,7 +4,6 @@ package mme import ( - "reflect" "testing" "github.com/ellanetworks/core/internal/models" @@ -33,7 +32,7 @@ func TestBearerARP(t *testing.T) { s1ap.AllocationAndRetentionPriority{PriorityLevel: 12, PreemptionCapability: s1ap.PreemptionShallNotTrigger, PreemptionVulnerability: s1ap.PreemptionPreemptable}, }, } { - if got := BearerARP(tc.arp); !reflect.DeepEqual(got, tc.want) { + if got := BearerARP(tc.arp); got != tc.want { t.Errorf("BearerARP(%+v) = %+v, want %+v", tc.arp, got, tc.want) } } diff --git a/internal/mme/bearer_loss_test.go b/internal/mme/bearer_loss_test.go index 9871808a60..4a19530493 100644 --- a/internal/mme/bearer_loss_test.go +++ b/internal/mme/bearer_loss_test.go @@ -82,12 +82,12 @@ func TestSignallingOnlyReleaseKeepsAPreservedVoiceBearer(t *testing.T) { m, ue, _, fake := activeVoiceBearer(t) ctx := context.Background() - ue.Conn().releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + ue.Conn().releaseCause.Store(s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause())) m.FreeUeConn(ctx, ue) c := m.NewUeConn(&captureConn{}, 9) m.AttachUeConn(ctx, ue, c) - c.releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASNormalRelease}) + c.releaseCause.Store(s1ap.Ptr(s1ap.CauseNASNormalRelease.Cause())) m.FreeUeConn(ctx, ue) if _, b := m.LookupDedicated(ue, 6); b == nil { diff --git a/internal/mme/bearer_support.go b/internal/mme/bearer_support.go index 226f064791..f9e91cc488 100644 --- a/internal/mme/bearer_support.go +++ b/internal/mme/bearer_support.go @@ -49,8 +49,8 @@ type bearerStore interface { // §9.2.1.40, TS 33.401). func S1apSecurityCapabilities(uecap eps.UENetworkCapability) s1ap.UESecurityCapabilities { return s1ap.UESecurityCapabilities{ - EncryptionAlgorithms: uint16(uecap.EEA<<1) << 8, - IntegrityProtectionAlgorithms: uint16(uecap.EIA<<1) << 8, + EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: uint16(uecap.EEA<<1) << 8}, + IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: uint16(uecap.EIA<<1) << 8}, } } diff --git a/internal/mme/cause.go b/internal/mme/cause.go index 6ecb89239a..372a8b2ad8 100644 --- a/internal/mme/cause.go +++ b/internal/mme/cause.go @@ -9,9 +9,9 @@ import ( // S1AP NAS-group causes the MME uses when releasing a UE context (TS 36.413). var ( - CauseNASNormalRelease = s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASNormalRelease} - CauseNASDetach = s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASDetach} - CauseNASUnspecified = s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASUnspecified} + CauseNASNormalRelease = s1ap.CauseNASNormalRelease.Cause() + CauseNASDetach = s1ap.CauseNASDetach.Cause() + CauseNASUnspecified = s1ap.CauseNASUnspecified.Cause() ) // S1apCauseName renders an S1AP cause as ": ()". diff --git a/internal/mme/cause_test.go b/internal/mme/cause_test.go index 2258365ae6..725b494299 100644 --- a/internal/mme/cause_test.go +++ b/internal/mme/cause_test.go @@ -15,13 +15,13 @@ func TestS1APCauseName(t *testing.T) { cause s1ap.Cause want string }{ - {"radio user-inactivity", s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 20}, "radioNetwork: user-inactivity (20)"}, - {"radio radio-connection-with-ue-lost", s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 21}, "radioNetwork: radio-connection-with-ue-lost (21)"}, - {"radio unknown-mme-ue-s1ap-id", s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 13}, "radioNetwork: unknown-mme-ue-s1ap-id (13)"}, - {"radio extension n26", s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 4, Extended: true}, "radioNetwork: n26-interface-not-available (40)"}, - {"nas detach", s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: 2}, "nas: detach (2)"}, - {"misc unknown-PLMN", s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 5}, "misc: unknown-PLMN (5)"}, - {"radio out of range", s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 99}, "radioNetwork: unknown (99)"}, + {"radio user-inactivity", s1ap.CauseRadioNetworkUserInactivity.Cause(), "radioNetwork: user-inactivity (20)"}, + {"radio radio-connection-with-ue-lost", s1ap.CauseRadioNetworkRadioConnectionWithUELost.Cause(), "radioNetwork: radio-connection-with-ue-lost (21)"}, + {"radio unknown-mme-ue-s1ap-id", s1ap.CauseRadioNetworkUnknownMMEUES1APID.Cause(), "radioNetwork: unknown-mme-ue-s1ap-id (13)"}, + {"radio extension n26", s1ap.CauseRadioNetworkN26InterfaceNotAvailable.Cause(), "radioNetwork: n26-interface-not-available (40)"}, + {"nas detach", s1ap.CauseNASDetach.Cause(), "nas: detach (2)"}, + {"misc unknown-PLMN", s1ap.CauseMiscUnknownPLMN.Cause(), "misc: unknown-PLMN (5)"}, + {"radio out of range", s1ap.CauseRadioNetwork(99).Cause(), "radioNetwork: unknown (99)"}, } for _, tt := range tests { diff --git a/internal/mme/dedicated_bearer.go b/internal/mme/dedicated_bearer.go index 87b60a7fc9..b6e9351f1d 100644 --- a/internal/mme/dedicated_bearer.go +++ b/internal/mme/dedicated_bearer.go @@ -15,6 +15,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -298,7 +299,7 @@ func dedicatedActivation(linked uint8, b *DedicatedBearer, mappedFiveGSQoS []nas return nil, nil, fmt.Errorf("build Activate Dedicated EPS Bearer Context Request: %w", err) } - sgwTLA, err := models.EncodeTransportLayerAddress(b.SGW.Addr, b.SGWN3IPv6) + sgwTLA, err := ap.TransportLayerAddressFromAddrs(b.SGW.Addr, b.SGWN3IPv6) if err != nil { return nil, nil, fmt.Errorf("encode the S-GW transport layer address: %w", err) } @@ -307,7 +308,7 @@ func dedicatedActivation(linked uint8, b *DedicatedBearer, mappedFiveGSQoS []nas ERABToBeSetup: []s1ap.ERABToBeSetupItemBearerSUReq{{ ERABID: s1ap.ERABID(b.EBI), QoS: DedicatedERABQoS(&b.DedicatedBearerInfo), - TransportLayerAddress: s1ap.TransportLayerAddress(sgwTLA), + TransportLayerAddress: sgwTLA, GTPTEID: s1ap.GTPTEID(b.SGW.TEID), }}, }, nil @@ -749,11 +750,11 @@ func (m *MME) sendDedicatedERABRelease(ctx context.Context, ueConn *UeConn, ebi } func preservesGBRBearers(cause *s1ap.Cause) bool { - if cause == nil || cause.Group != s1ap.CauseGroupRadioNetwork || cause.Extended { + if cause == nil || cause.RadioNetwork == nil { return false } - switch cause.Value { + switch *cause.RadioNetwork { case s1ap.CauseRadioNetworkUserInactivity, s1ap.CauseRadioNetworkInterRATRedirection, s1ap.CauseRadioNetworkCSFallbackTriggered: return true default: diff --git a/internal/mme/dedicated_bearer_modify_test.go b/internal/mme/dedicated_bearer_modify_test.go index 2b323e1e1d..2e459a3154 100644 --- a/internal/mme/dedicated_bearer_modify_test.go +++ b/internal/mme/dedicated_bearer_modify_test.go @@ -160,7 +160,7 @@ func TestFailedModificationKeepsTheBearer(t *testing.T) { m.RadioBearerModified(context.Background(), ue, 6, false) }}, {"user-inactivity release before the UE answered", func(m *MME, ue *UeContext) { - ue.Conn().releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + ue.Conn().releaseCause.Store(s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause())) m.FreeUeConn(context.Background(), ue) }}, {"handover before the eNB answered", func(m *MME, ue *UeContext) { m.ResumeBearerReconfigurationAfterHandover(context.Background(), ue) }}, @@ -426,7 +426,7 @@ func TestModificationTheUEHasNotAnsweredIsAbortedByAConnectionRelease(t *testing sent := cc.count() - ue.Conn().releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + ue.Conn().releaseCause.Store(s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause())) m.FreeUeConn(ctx, ue) if got := fake.modifications(); len(got) != 1 || got[0].outcome != models.ModificationFailed { @@ -460,7 +460,7 @@ func TestModificationTheUEAcceptedIsCommittedWhenTheRadioIsInterrupted(t *testin m.ReconcileBearersToRAN(context.Background(), ue, RANBearers{Present: []RANBearer{{Ebi: 6, EnbFTEID: voiceENB}}}) }, interrupt: func(m *MME, ue *UeContext) { - ue.Conn().releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + ue.Conn().releaseCause.Store(s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause())) m.FreeUeConn(context.Background(), ue) }, }, @@ -621,7 +621,7 @@ func TestIdleARPChangeIsCommittedWithoutPaging(t *testing.T) { m, ue, cc, fake := activeVoiceBearer(t) ctx := context.Background() - ue.Conn().releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + ue.Conn().releaseCause.Store(s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause())) m.FreeUeConn(ctx, ue) sent := cc.count() @@ -683,7 +683,7 @@ func TestProcedureStartedOnASupersededConnectionIsNotArmed(t *testing.T) { ctx := context.Background() stale := ue.Conn() - stale.releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + stale.releaseCause.Store(s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause())) m.FreeUeConn(ctx, ue) m.AttachUeConn(ctx, ue, m.NewUeConn(&captureConn{}, 9)) diff --git a/internal/mme/dedicated_bearer_test.go b/internal/mme/dedicated_bearer_test.go index 409cf8a5d6..6346ddafb1 100644 --- a/internal/mme/dedicated_bearer_test.go +++ b/internal/mme/dedicated_bearer_test.go @@ -7,7 +7,6 @@ import ( "context" "errors" "net/netip" - "reflect" "slices" "testing" "time" @@ -232,7 +231,7 @@ func TestIdleUEDedicatedBearerIsReleasedLocally(t *testing.T) { m.DedicatedBearerAccepted(context.Background(), ue, 6) m.ReconcileBearersToRAN(context.Background(), ue, RANBearers{Present: []RANBearer{{Ebi: 6}}}) - ue.Conn().releaseCause.Store(&s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + ue.Conn().releaseCause.Store(s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause())) m.FreeUeConn(context.Background(), ue) if _, b := m.LookupDedicated(ue, 6); b == nil { @@ -522,12 +521,12 @@ func TestS1ReleaseKeepsGBRBearersOnlyForPreservingCauses(t *testing.T) { cause *s1ap.Cause kept bool }{ - {"user inactivity", &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}, true}, - {"inter-RAT redirection", &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkInterRATRedirection}, true}, - {"CS fallback triggered", &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkCSFallbackTriggered}, true}, - {"radio connection lost", &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioConnectionWithUELost}, false}, - {"UE not available for PS service", &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUENotAvailableForPSService}, false}, - {"MME normal release", &s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASNormalRelease}, false}, + {"user inactivity", s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause()), true}, + {"inter-RAT redirection", s1ap.Ptr(s1ap.CauseRadioNetworkInterRATRedirection.Cause()), true}, + {"CS fallback triggered", s1ap.Ptr(s1ap.CauseRadioNetworkCSFallbackTriggered.Cause()), true}, + {"radio connection lost", s1ap.Ptr(s1ap.CauseRadioNetworkRadioConnectionWithUELost.Cause()), false}, + {"UE not available for PS service", s1ap.Ptr(s1ap.CauseRadioNetworkUENotAvailableForPSService.Cause()), false}, + {"MME normal release", s1ap.Ptr(s1ap.CauseNASNormalRelease.Cause()), false}, {"local release, no cause", nil, false}, } @@ -744,7 +743,7 @@ func TestNonGBRBearerSignalsNoBitRates_TS36413_9_2_1_15(t *testing.T) { qos := DedicatedERABQoS(&info) want := s1ap.AllocationAndRetentionPriority{PriorityLevel: 3, PreemptionCapability: s1ap.PreemptionMayTrigger, PreemptionVulnerability: s1ap.PreemptionPreemptable} - if qos.QCI != 69 || qos.GBR != nil || !reflect.DeepEqual(qos.ARP, want) { + if qos.QCI != 69 || qos.GBR != nil || qos.ARP != want { t.Fatalf("E-RAB QoS %+v, want QCI 69 at ARP %+v without GBR QoS Information", qos, want) } diff --git a/internal/mme/detach.go b/internal/mme/detach.go index 132b3815b7..733faacdf3 100644 --- a/internal/mme/detach.go +++ b/internal/mme/detach.go @@ -23,7 +23,7 @@ func (m *MME) DetachUEAfterPathSwitchFailure(ctx context.Context, ue *UeContext) logger.SUPI(ue.Supi().String())) ue.TransitionTo(ctx, EMMDeregistered) - m.ReleaseUEContext(ctx, ue, ue.Conn(), s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASDetach}) + m.ReleaseUEContext(ctx, ue, ue.Conn(), s1ap.CauseNASDetach.Cause()) } func (m *MME) DetachSubscriber(ctx context.Context, imsi string) { diff --git a/internal/mme/drain.go b/internal/mme/drain.go index fe52d083e3..d7dbc5cb9a 100644 --- a/internal/mme/drain.go +++ b/internal/mme/drain.go @@ -19,7 +19,7 @@ const ( const configUpdateGuardTimeout = 5 * time.Second -var causeLoadBalancingTAURequired = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkLoadBalancingTAURequired} +var causeLoadBalancingTAURequired = s1ap.CauseRadioNetworkLoadBalancingTAURequired.Cause() func (m *MME) RelativeCapacity() uint8 { return uint8(m.relativeCapacity.Load()) diff --git a/internal/mme/drain_test.go b/internal/mme/drain_test.go index 0e8c59fd1c..56c31ec6f8 100644 --- a/internal/mme/drain_test.go +++ b/internal/mme/drain_test.go @@ -158,8 +158,7 @@ func TestOffloadReleasesRegisteredUEsWithLoadBalancingTAURequired(t *testing.T) t.Fatal(err) } - if cmd.Cause == nil || cmd.Cause.Group != s1ap.CauseGroupRadioNetwork || - cmd.Cause.Value != s1ap.CauseRadioNetworkLoadBalancingTAURequired { + if cmd.Cause == nil || !cmd.Cause.Equal(s1ap.CauseRadioNetworkLoadBalancingTAURequired.Cause()) { t.Fatalf("cause = %+v, want radioNetwork/load-balancing-tau-required", cmd.Cause) } } diff --git a/internal/mme/fivegs_relocation.go b/internal/mme/fivegs_relocation.go index f4137c297d..c7050a6b04 100644 --- a/internal/mme/fivegs_relocation.go +++ b/internal/mme/fivegs_relocation.go @@ -35,8 +35,14 @@ func NGRANIdentityFromS1AP(target s1ap.TargetNgRanNodeID) (interworking.NGRANIde case node.GNB != nil: id := node.GNB.GlobalGNBID - if id.GNBID.Bits < 22 || id.GNBID.Bits > 32 { - return interworking.NGRANIdentity{}, fmt.Errorf("%w: no gNB identity is %d bits wide", ErrUnusableTargetNGRAN, id.GNBID.Bits) + if id.GNBID.GNBID == nil { + return interworking.NGRANIdentity{}, fmt.Errorf("%w: unknown gNB identity alternative", ErrUnusableTargetNGRAN) + } + + gnbID := *id.GNBID.GNBID + + if gnbID.Bits < 22 || gnbID.Bits > 32 { + return interworking.NGRANIdentity{}, fmt.Errorf("%w: no gNB identity is %d bits wide", ErrUnusableTargetNGRAN, gnbID.Bits) } plmn, err := decodePLMN(id.PLMNIdentity) @@ -46,19 +52,14 @@ func NGRANIdentityFromS1AP(target s1ap.TargetNgRanNodeID) (interworking.NGRANIde out.Kind = interworking.NGRANNodeGNB out.PlmnID = plmn - out.ID = id.GNBID.Value - out.Bits = uint8(id.GNBID.Bits) + out.ID = gnbID.Value + out.Bits = uint8(gnbID.Bits) case node.NgENB != nil: id := node.NgENB.GlobalNgENBID - bits, ok := map[s1ap.ENBIDKind]uint8{ - s1ap.ENBIDShortMacro: 18, - s1ap.ENBIDMacro: 20, - s1ap.ENBIDLongMacro: 21, - s1ap.ENBIDHome: 28, - }[id.ENBID.Kind] + value, ok := id.ENBID.Value() if !ok { - return interworking.NGRANIdentity{}, fmt.Errorf("%w: unknown ng-eNB identity kind %d", ErrUnusableTargetNGRAN, id.ENBID.Kind) + return interworking.NGRANIdentity{}, fmt.Errorf("%w: unknown ng-eNB identity alternative", ErrUnusableTargetNGRAN) } plmn, err := decodePLMN(id.PLMNIdentity) @@ -68,8 +69,8 @@ func NGRANIdentityFromS1AP(target s1ap.TargetNgRanNodeID) (interworking.NGRANIde out.Kind = interworking.NGRANNodeNgENB out.PlmnID = plmn - out.ID = id.ENBID.Value - out.Bits = bits + out.ID = value + out.Bits = uint8(id.ENBID.Bits()) default: return interworking.NGRANIdentity{}, fmt.Errorf("%w: it is neither a gNB nor an ng-eNB", ErrUnusableTargetNGRAN) } diff --git a/internal/mme/fivegs_relocation_test.go b/internal/mme/fivegs_relocation_test.go index f4ee405c65..37adb42eac 100644 --- a/internal/mme/fivegs_relocation_test.go +++ b/internal/mme/fivegs_relocation_test.go @@ -9,6 +9,7 @@ import ( "github.com/ellanetworks/core/internal/interworking" "github.com/ellanetworks/core/internal/models" + "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/s1ap" ) @@ -30,7 +31,7 @@ func TestNGRANIdentityFromS1APGNB(t *testing.T) { target := s1ap.TargetNgRanNodeID{ GlobalRANNodeID: s1ap.GlobalRANNodeID{GNB: &s1ap.GNB{GlobalGNBID: s1ap.GlobalGNBID{ PLMNIdentity: fiveGSTargetPLMN(t, nodePLMN), - GNBID: s1ap.GNBID{Value: 0x1a2b3c, Bits: 24}, + GNBID: s1ap.GNBIdentity{GNBID: &s1ap.GNBID{Value: 0x1a2b3c, Bits: 24}}, }}}, SelectedTAI: s1ap.FiveGSTAI{ PLMNIdentity: fiveGSTargetPLMN(t, taiPLMN), @@ -65,19 +66,19 @@ func TestNGRANIdentityFromS1APNgENB(t *testing.T) { for _, tc := range []struct { name string - kind s1ap.ENBIDKind + id s1ap.ENBID bits uint8 }{ - {"short macro", s1ap.ENBIDShortMacro, 18}, - {"macro", s1ap.ENBIDMacro, 20}, - {"long macro", s1ap.ENBIDLongMacro, 21}, - {"home", s1ap.ENBIDHome, 28}, + {"short macro", s1ap.ENBID{ShortMacroENBID: s1ap.Ptr(s1ap.ShortMacroENBID(0x201))}, 18}, + {"macro", s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x201))}, 20}, + {"long macro", s1ap.ENBID{LongMacroENBID: s1ap.Ptr(s1ap.LongMacroENBID(0x201))}, 21}, + {"home", s1ap.ENBID{HomeENBID: s1ap.Ptr(s1ap.HomeENBID(0x201))}, 28}, } { t.Run(tc.name, func(t *testing.T) { target := s1ap.TargetNgRanNodeID{ GlobalRANNodeID: s1ap.GlobalRANNodeID{NgENB: &s1ap.NgENB{GlobalNgENBID: s1ap.GlobalENBID{ PLMNIdentity: encoded, - ENBID: s1ap.ENBID{Kind: tc.kind, Value: 0x201}, + ENBID: tc.id, }}}, SelectedTAI: s1ap.FiveGSTAI{PLMNIdentity: encoded, TAC: 1}, } @@ -112,15 +113,15 @@ func TestNGRANIdentityFromS1APRejectsUnusableTargets(t *testing.T) { {"no alternative", s1ap.GlobalRANNodeID{}}, {"gNB identity too narrow", s1ap.GlobalRANNodeID{GNB: &s1ap.GNB{GlobalGNBID: s1ap.GlobalGNBID{ PLMNIdentity: plmn, - GNBID: s1ap.GNBID{Value: 1, Bits: 21}, + GNBID: s1ap.GNBIdentity{GNBID: &s1ap.GNBID{Value: 1, Bits: 21}}, }}}}, {"gNB identity too wide", s1ap.GlobalRANNodeID{GNB: &s1ap.GNB{GlobalGNBID: s1ap.GlobalGNBID{ PLMNIdentity: plmn, - GNBID: s1ap.GNBID{Value: 1, Bits: 33}, + GNBID: s1ap.GNBIdentity{GNBID: &s1ap.GNBID{Value: 1, Bits: 33}}, }}}}, {"unknown ng-eNB identity kind", s1ap.GlobalRANNodeID{NgENB: &s1ap.NgENB{GlobalNgENBID: s1ap.GlobalENBID{ PLMNIdentity: plmn, - ENBID: s1ap.ENBID{Kind: s1ap.ENBIDKind(9), Value: 1}, + ENBID: s1ap.ENBID{Ext: &per.ExtensionAlternative{Index: 9}}, }}}}, } { t.Run(tc.name, func(t *testing.T) { diff --git a/internal/mme/handover.go b/internal/mme/handover.go index 2b5d455bfe..d96c099abe 100644 --- a/internal/mme/handover.go +++ b/internal/mme/handover.go @@ -30,9 +30,9 @@ type AdmittedERAB struct { Ebi uint8 EnbFTEID models.FTEID - DLForwardingAddr s1ap.TransportLayerAddress + DLForwardingAddr *s1ap.TransportLayerAddress DLForwardingTEID *s1ap.GTPTEID - ULForwardingAddr s1ap.TransportLayerAddress + ULForwardingAddr *s1ap.TransportLayerAddress ULForwardingTEID *s1ap.GTPTEID } @@ -41,8 +41,8 @@ func (a AdmittedERAB) Forwards() bool { validForwardingPair(a.ULForwardingAddr, a.ULForwardingTEID) } -func validForwardingPair(addr s1ap.TransportLayerAddress, teid *s1ap.GTPTEID) bool { - return addr.Valid() && teid != nil +func validForwardingPair(addr *s1ap.TransportLayerAddress, teid *s1ap.GTPTEID) bool { + return addr != nil && addr.Valid() && teid != nil } type HandoverCandidate struct { @@ -690,7 +690,7 @@ func SendHandoverPreparationFailure(ctx context.Context, m *MME, conn S1APWriter func SendUEContextRelease(ctx context.Context, m *MME, conn S1APWriter, mmeUEID s1ap.MMEUES1APID, enbUEID s1ap.ENBUES1APID, pair bool, cause s1ap.Cause) { cmd := &s1ap.UEContextReleaseCommand{ - UES1APIDs: s1ap.UES1APIDs{MMEUES1APID: mmeUEID, ENBUES1APID: enbUEID, Pair: pair}, + UES1APIDs: ueS1APIDs(mmeUEID, enbUEID, pair), Cause: s1ap.Ptr(cause), } @@ -705,12 +705,12 @@ func SendUEContextRelease(ctx context.Context, m *MME, conn S1APWriter, mmeUEID } var ( - CauseHandoverSuccess = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkSuccessfulHandover} - causeHandoverTS1relocExpiry = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkTS1RelocOverallExpiry} - causeHandoverCancelled = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHandoverCancelled} - causeHandoverEUTRANReason = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkReleaseDueToEUTRANGeneratedReason} - causeHandoverInterSystemTriggered = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkS1InterSystemHandoverTriggered} - causeHandoverUnspecified = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnspecified} + CauseHandoverSuccess = s1ap.CauseRadioNetworkSuccessfulHandover.Cause() + causeHandoverTS1relocExpiry = s1ap.CauseRadioNetworkTS1RelocOverallExpiry.Cause() + causeHandoverCancelled = s1ap.CauseRadioNetworkHandoverCancelled.Cause() + causeHandoverEUTRANReason = s1ap.CauseRadioNetworkReleaseDueToEUTRANGeneratedReason.Cause() + causeHandoverInterSystemTriggered = s1ap.CauseRadioNetworkS1InterSystemHandoverTriggered.Cause() + causeHandoverUnspecified = s1ap.CauseRadioNetworkUnspecified.Cause() ) func (ue *UeContext) advanceNextHop() error { diff --git a/internal/mme/handover_bearers.go b/internal/mme/handover_bearers.go index 56d5739bae..79ec9e26b4 100644 --- a/internal/mme/handover_bearers.go +++ b/internal/mme/handover_bearers.go @@ -8,7 +8,7 @@ import ( "slices" "github.com/ellanetworks/core/internal/logger" - "github.com/ellanetworks/core/internal/models" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" "go.uber.org/zap" ) @@ -21,7 +21,7 @@ func HandoverBearers(ue *UeContext, forwarding bool) (bearers []s1ap.ERABToBeSet candidates = make([]HandoverCandidate, 0, len(ue.Pdns)) for _, p := range ue.Pdns { - sgwTLA, err := models.EncodeTransportLayerAddress(p.SgwFTEID.Addr, p.SgwN3IPv6) + sgwTLA, err := ap.TransportLayerAddressFromAddrs(p.SgwFTEID.Addr, p.SgwN3IPv6) if err != nil { logger.MmeLog.Error("failed to encode S-GW transport layer address for handover", logger.SUPI(ue.supiOrEmpty()), logger.ERABID(p.Ebi), zap.Error(err)) @@ -35,7 +35,7 @@ func HandoverBearers(ue *UeContext, forwarding bool) (bearers []s1ap.ERABToBeSet bearer := s1ap.ERABToBeSetupItemHOReq{ ERABID: s1ap.ERABID(p.Ebi), - TransportLayerAddress: s1ap.TransportLayerAddress(sgwTLA), + TransportLayerAddress: sgwTLA, GTPTEID: s1ap.GTPTEID(p.SgwFTEID.TEID), QoS: s1ap.ERABLevelQoSParameters{ QCI: s1ap.QCI(p.Qci), @@ -44,9 +44,7 @@ func HandoverBearers(ue *UeContext, forwarding bool) (bearers []s1ap.ERABToBeSet } if !forwarding { - bearer.Extensions = &s1ap.ERABToBeSetupItemHOReqExtIEs{ - DataForwardingNotPossible: s1ap.Ptr(s1ap.DataForwardingNotPossibleTrue), - } + bearer.DataForwardingNotPossible = s1ap.Ptr(s1ap.DataForwardingNotPossibleTrue) } bearers = append(bearers, bearer) @@ -76,22 +74,20 @@ func HandoverBearers(ue *UeContext, forwarding bool) (bearers []s1ap.ERABToBeSet } func dedicatedHandoverItem(b *DedicatedBearer, forwarding bool) (s1ap.ERABToBeSetupItemHOReq, error) { - sgwTLA, err := models.EncodeTransportLayerAddress(b.SGW.Addr, b.SGWN3IPv6) + sgwTLA, err := ap.TransportLayerAddressFromAddrs(b.SGW.Addr, b.SGWN3IPv6) if err != nil { return s1ap.ERABToBeSetupItemHOReq{}, err } item := s1ap.ERABToBeSetupItemHOReq{ ERABID: s1ap.ERABID(b.EBI), - TransportLayerAddress: s1ap.TransportLayerAddress(sgwTLA), + TransportLayerAddress: sgwTLA, GTPTEID: s1ap.GTPTEID(b.SGW.TEID), QoS: DedicatedERABQoS(&b.DedicatedBearerInfo), } if !forwarding { - item.Extensions = &s1ap.ERABToBeSetupItemHOReqExtIEs{ - DataForwardingNotPossible: s1ap.Ptr(s1ap.DataForwardingNotPossibleTrue), - } + item.DataForwardingNotPossible = s1ap.Ptr(s1ap.DataForwardingNotPossibleTrue) } return item, nil diff --git a/internal/mme/mme_radio_test.go b/internal/mme/mme_radio_test.go index 0e4f0a5c34..f28d0a292f 100644 --- a/internal/mme/mme_radio_test.go +++ b/internal/mme/mme_radio_test.go @@ -15,7 +15,7 @@ import ( func testENBID(value uint32) s1ap.GlobalENBID { return s1ap.GlobalENBID{ PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, - ENBID: s1ap.ENBID{Value: value}, + ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(value))}, } } @@ -185,7 +185,7 @@ func TestClaimENBID_KindIsPartOfTheIdentity(t *testing.T) { macro := testENBID(8) home := testENBID(8) - home.ENBID.Kind = s1ap.ENBIDHome + home.ENBID = s1ap.ENBID{HomeENBID: s1ap.Ptr(s1ap.HomeENBID(8))} c1 := new(sctp.SCTPConn) c2 := new(sctp.SCTPConn) diff --git a/internal/mme/nas/bearer.go b/internal/mme/nas/bearer.go index bfcfd229aa..016ceb38b6 100644 --- a/internal/mme/nas/bearer.go +++ b/internal/mme/nas/bearer.go @@ -18,6 +18,7 @@ import ( "github.com/ellanetworks/core/internal/roaming" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" "go.uber.org/zap" ) @@ -283,7 +284,7 @@ func buildInitialContextSetup(ctx context.Context, m *mme.MME, ue *mme.UeContext for _, p := range pdns { // The S1-U endpoint advertises whichever transport address family the N3 has // (TS 36.413). - sgwTLA, err := models.EncodeTransportLayerAddress(p.SgwFTEID.Addr, p.SgwN3IPv6) + sgwTLA, err := ap.TransportLayerAddressFromAddrs(p.SgwFTEID.Addr, p.SgwN3IPv6) if err != nil { logger.From(ctx, logger.MmeLog).Error("failed to encode S-GW transport layer address", logger.ERABID(p.Ebi), zap.Error(err)) @@ -296,7 +297,7 @@ func buildInitialContextSetup(ctx context.Context, m *mme.MME, ue *mme.UeContext QCI: s1ap.QCI(p.Qci), ARP: mme.BearerARP(p.Arp), }, - TransportLayerAddress: s1ap.TransportLayerAddress(sgwTLA), + TransportLayerAddress: sgwTLA, GTPTEID: s1ap.GTPTEID(p.SgwFTEID.TEID), }) } @@ -306,7 +307,7 @@ func buildInitialContextSetup(ctx context.Context, m *mme.MME, ue *mme.UeContext continue } - sgwTLA, err := models.EncodeTransportLayerAddress(d.SGW.Addr, d.SGWN3IPv6) + sgwTLA, err := ap.TransportLayerAddressFromAddrs(d.SGW.Addr, d.SGWN3IPv6) if err != nil { logger.From(ctx, logger.MmeLog).Error("failed to encode S-GW transport layer address", logger.ERABID(d.EBI), zap.Error(err)) @@ -316,7 +317,7 @@ func buildInitialContextSetup(ctx context.Context, m *mme.MME, ue *mme.UeContext erabs = append(erabs, s1ap.ERABToBeSetupItemCtxtSUReq{ ERABID: s1ap.ERABID(d.EBI), QoS: mme.DedicatedERABQoS(&d), - TransportLayerAddress: s1ap.TransportLayerAddress(sgwTLA), + TransportLayerAddress: sgwTLA, GTPTEID: s1ap.GTPTEID(d.SGW.TEID), }) } diff --git a/internal/mme/nas/detach_nas_test.go b/internal/mme/nas/detach_nas_test.go index 16c8c677df..60aec1f83d 100644 --- a/internal/mme/nas/detach_nas_test.go +++ b/internal/mme/nas/detach_nas_test.go @@ -150,7 +150,7 @@ func TestDetachSwitchOff(t *testing.T) { } cmd := parseUEContextReleaseCommand(t, cc.sent[0]) - if !cmd.UES1APIDs.Pair || cmd.UES1APIDs.MMEUES1APID != ue.Conn().MMEUES1APID || cmd.UES1APIDs.ENBUES1APID != 7 { + if p := cmd.UES1APIDs.UES1APIDPair; p == nil || p.MMEUES1APID != ue.Conn().MMEUES1APID || p.ENBUES1APID != 7 { t.Fatalf("unexpected release command IDs: %+v", cmd.UES1APIDs) } @@ -307,7 +307,7 @@ func TestDetachAcceptReleasesWithTheDetachCause(t *testing.T) { } cmd := parseUEContextReleaseCommand(t, cc.sent[0]) - if cmd.Cause == nil || *cmd.Cause != mme.CauseNASDetach { + if cmd.Cause == nil || !cmd.Cause.Equal(mme.CauseNASDetach) { t.Errorf("release cause = %+v, want NAS detach: releasing the last PDN first claims the release, so the detach's own cause never reaches the eNB", cmd.Cause) } } diff --git a/internal/mme/nas/handle_service_request_test.go b/internal/mme/nas/handle_service_request_test.go index 1640a012ac..bd68d5644c 100644 --- a/internal/mme/nas/handle_service_request_test.go +++ b/internal/mme/nas/handle_service_request_test.go @@ -177,7 +177,7 @@ func TestServiceRequestRestoresThePreservedVoiceBearer(t *testing.T) { m.DedicatedBearerAccepted(t.Context(), ue, 6) m.ReconcileBearersToRAN(t.Context(), ue, mme.RANBearers{Present: []mme.RANBearer{{Ebi: 6, EnbFTEID: models.FTEID{TEID: 0x77, Addr: netip.AddrFrom4([4]byte{10, 3, 0, 3})}}}}) - m.ReleaseUEContext(t.Context(), ue, ue.Conn(), s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + m.ReleaseUEContext(t.Context(), ue, ue.Conn(), s1ap.CauseRadioNetworkUserInactivity.Cause()) m.FreeUeConn(t.Context(), ue) if ue.Connected() { @@ -294,7 +294,7 @@ func TestServiceRequestS1UTransportFamily(t *testing.T) { } ics := parseInitialContextSetup(t, cc.sent[0]) - got := []byte(ics.ERABToBeSetup[0].TransportLayerAddress) + got := ics.ERABToBeSetup[0].TransportLayerAddress.Bytes() if !bytes.Equal(got, tc.wantTLA) { t.Fatalf("S1-U transport layer address = %x, want %x", got, tc.wantTLA) @@ -355,8 +355,8 @@ func TestServiceRequestUnknownSTMSIRejected(t *testing.T) { } cmd := parseUEContextReleaseCommand(t, cc.sent[1]) - if cmd.UES1APIDs.ENBUES1APID != msg.ENBUES1APID { - t.Fatalf("release eNB-UE-S1AP-ID = %d, want %d", cmd.UES1APIDs.ENBUES1APID, msg.ENBUES1APID) + if enbID, _ := cmd.UES1APIDs.ENBID(); enbID != msg.ENBUES1APID { + t.Fatalf("release eNB-UE-S1AP-ID = %d, want %d", enbID, msg.ENBUES1APID) } } diff --git a/internal/mme/nas/pdn_connectivity.go b/internal/mme/nas/pdn_connectivity.go index a402aaf5e4..b24f2047ba 100644 --- a/internal/mme/nas/pdn_connectivity.go +++ b/internal/mme/nas/pdn_connectivity.go @@ -15,6 +15,7 @@ import ( "github.com/ellanetworks/core/internal/nasreply" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" "go.uber.org/zap" ) @@ -255,7 +256,7 @@ func resumePDNConnectivity(ctx context.Context, m *mme.MME, ue *mme.UeContext, u } func buildERABSetup(p *mme.PdnConnection, ueAmbr models.Ambr) (*s1ap.ERABSetupRequest, error) { - sgwTLA, err := models.EncodeTransportLayerAddress(p.SgwFTEID.Addr, p.SgwN3IPv6) + sgwTLA, err := ap.TransportLayerAddressFromAddrs(p.SgwFTEID.Addr, p.SgwN3IPv6) if err != nil { return nil, fmt.Errorf("failed to encode S-GW transport layer address: %w", err) } @@ -270,7 +271,7 @@ func buildERABSetup(p *mme.PdnConnection, ueAmbr models.Ambr) (*s1ap.ERABSetupRe QCI: s1ap.QCI(p.Qci), ARP: mme.BearerARP(p.Arp), }, - TransportLayerAddress: s1ap.TransportLayerAddress(sgwTLA), + TransportLayerAddress: sgwTLA, GTPTEID: s1ap.GTPTEID(p.SgwFTEID.TEID), }}, }, nil diff --git a/internal/mme/nas/pdn_connectivity_test.go b/internal/mme/nas/pdn_connectivity_test.go index 91105b2635..32791bba66 100644 --- a/internal/mme/nas/pdn_connectivity_test.go +++ b/internal/mme/nas/pdn_connectivity_test.go @@ -17,6 +17,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -121,7 +122,7 @@ func TestAdditionalPDNConnectionLifecycle(t *testing.T) { t.Fatalf("E-RAB Setup Request malformed: %+v", req) } - tla, err := models.EncodeTransportLayerAddress(netip.MustParseAddr("10.31.0.9"), netip.Addr{}) + tla, err := ap.TransportLayerAddressFrom(netip.MustParseAddr("10.31.0.9")) if err != nil { t.Fatal(err) } @@ -129,7 +130,7 @@ func TestAdditionalPDNConnectionLifecycle(t *testing.T) { resp := &s1ap.ERABSetupResponse{ MMEUES1APID: s1ap.Ptr(ue.Conn().MMEUES1APID), ENBUES1APID: s1ap.Ptr(ue.Conn().ENBUES1APID()), ERABSetup: []s1ap.ERABSetupItemBearerSURes{{ - ERABID: 6, TransportLayerAddress: s1ap.TransportLayerAddress(tla), GTPTEID: 0x1234, + ERABID: 6, TransportLayerAddress: tla, GTPTEID: 0x1234, }}, } @@ -571,7 +572,7 @@ func failERABSetup(t *testing.T, m *mme.MME, ue *mme.UeContext, cc *captureConn, MMEUES1APID: s1ap.Ptr(ue.Conn().MMEUES1APID), ENBUES1APID: s1ap.Ptr(ue.Conn().ENBUES1APID()), ERABFailedToSetup: []s1ap.ERABItem{{ ERABID: s1ap.ERABID(ebi), - Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }}, } diff --git a/internal/mme/nas/tau_test.go b/internal/mme/nas/tau_test.go index 9c7a4d8dc8..86048503f5 100644 --- a/internal/mme/nas/tau_test.go +++ b/internal/mme/nas/tau_test.go @@ -492,8 +492,11 @@ func TestTrackingAreaUpdateRecovery(t *testing.T) { } cmd := parseUEContextReleaseCommandPDU(t, cc.sent[1]) - if cmd.UES1APIDs.ENBUES1APID != 7 { - t.Fatalf("release command names eNB-UE-S1AP-ID %d, want the rejected connection's 7", cmd.UES1APIDs.ENBUES1APID) + mmeID, _ := cmd.UES1APIDs.MMEID() + enbID, _ := cmd.UES1APIDs.ENBID() + + if enbID != 7 { + t.Fatalf("release command names eNB-UE-S1AP-ID %d, want the rejected connection's 7", enbID) } if m.ConnCountForTest() != 1 { @@ -501,8 +504,8 @@ func TestTrackingAreaUpdateRecovery(t *testing.T) { } complete := &s1ap.UEContextReleaseComplete{ - MMEUES1APID: s1ap.Ptr(cmd.UES1APIDs.MMEUES1APID), - ENBUES1APID: s1ap.Ptr(cmd.UES1APIDs.ENBUES1APID), + MMEUES1APID: s1ap.Ptr(mmeID), + ENBUES1APID: s1ap.Ptr(enbID), } b, err := complete.Marshal() diff --git a/internal/mme/paging.go b/internal/mme/paging.go index b8f673e9b8..580e06fad3 100644 --- a/internal/mme/paging.go +++ b/internal/mme/paging.go @@ -23,7 +23,7 @@ var errPagingSkipped = errors.New("paging skipped") var errUEConnected = errors.New("mme: the UE re-established its S1 connection before it was paged") -var causeErrorIndicationReceived = s1ap.Cause{Group: s1ap.CauseGroupTransport, Value: s1ap.CauseTransportResourceUnavailable} +var causeErrorIndicationReceived = s1ap.CauseTransportResourceUnavailable.Cause() // Page sends an S1AP Paging for an EMM-REGISTERED, ECM-IDLE UE so it re-establishes // the S1 connection and buffered downlink data is delivered, within the UE's @@ -255,7 +255,7 @@ func (m *MME) buildPaging(ctx context.Context, ue *UeContext) (*s1ap.Paging, err return &s1ap.Paging{ UEIdentityIndexValue: s1ap.Ptr(ueIdentityIndex(ue.imsiOrEmpty())), - STMSI: &s1ap.STMSI{MMEC: s1ap.MMECode(mmeCode), MTMSI: s1ap.MTMSI(mtmsi)}, + UEPagingID: &s1ap.UEPagingID{STMSI: &s1ap.STMSI{MMEC: s1ap.MMECode(mmeCode), MTMSI: s1ap.MTMSI(mtmsi)}}, CNDomain: s1ap.Ptr(s1ap.CNDomainPS), TAIList: taiList, // Replay the eNB-reported paging capability so it can apply paging @@ -307,12 +307,12 @@ func (m *MME) ServedTAIs(ctx context.Context) ([]models.Tai, error) { // areaToS1APTAIs encodes a registration area as the S1AP TAI list carried in Paging. // An empty area is rejected: it would page the UE nowhere. -func areaToS1APTAIs(area []models.Tai) ([]s1ap.TAI, error) { +func areaToS1APTAIs(area []models.Tai) (s1ap.TAIList, error) { if len(area) == 0 { return nil, fmt.Errorf("empty registration area") } - out := make([]s1ap.TAI, 0, len(area)) + out := make(s1ap.TAIList, 0, len(area)) for _, t := range area { if t.PlmnID == nil { @@ -329,7 +329,7 @@ func areaToS1APTAIs(area []models.Tai) ([]s1ap.TAI, error) { return nil, fmt.Errorf("invalid TAC %q: %w", t.Tac, err) } - out = append(out, s1ap.TAI{PLMNIdentity: plmnID, TAC: s1ap.TAC(tac)}) + out = append(out, s1ap.TAIItem{TAI: s1ap.TAI{PLMNIdentity: plmnID, TAC: s1ap.TAC(tac)}}) } return out, nil diff --git a/internal/mme/paging_test.go b/internal/mme/paging_test.go index 9333f60766..d192a8a6d1 100644 --- a/internal/mme/paging_test.go +++ b/internal/mme/paging_test.go @@ -40,8 +40,8 @@ func TestBuildPaging(t *testing.T) { t.Fatalf("paging UE Radio Capability for Paging = %x, want %x", paging.UERadioCapabilityForPaging, ue.RadioCapabilityForPaging) } - if uint32(paging.STMSI.MTMSI) != ue.Tmsi().Uint32() { - t.Fatalf("S-TMSI M-TMSI = %#x, want %#x", paging.STMSI.MTMSI, ue.Tmsi().Uint32()) + if uint32(paging.UEPagingID.STMSI.MTMSI) != ue.Tmsi().Uint32() { + t.Fatalf("S-TMSI M-TMSI = %#x, want %#x", paging.UEPagingID.STMSI.MTMSI, ue.Tmsi().Uint32()) } if paging.UEIdentityIndexValue == nil || *paging.UEIdentityIndexValue != ueIdentityIndex(ue.imsiOrEmpty()) { @@ -56,8 +56,8 @@ func TestBuildPaging(t *testing.T) { t.Fatalf("TAI list length = %d, want 1", len(paging.TAIList)) } - if uint16(paging.TAIList[0].TAC) != 1 { - t.Fatalf("paging TAI TAC = %d, want 1 (served)", uint16(paging.TAIList[0].TAC)) + if uint16(paging.TAIList[0].TAI.TAC) != 1 { + t.Fatalf("paging TAI TAC = %d, want 1 (served)", uint16(paging.TAIList[0].TAI.TAC)) } b, err := paging.Marshal() @@ -88,8 +88,8 @@ func TestBuildPagingOldMTMSISentinel(t *testing.T) { t.Fatalf("buildPaging: %v", err) } - if paging.STMSI.MTMSI != 0 { - t.Fatalf("paged on M-TMSI %#x, want 0 (the old M-TMSI the UE still listens on)", paging.STMSI.MTMSI) + if paging.UEPagingID.STMSI.MTMSI != 0 { + t.Fatalf("paged on M-TMSI %#x, want 0 (the old M-TMSI the UE still listens on)", paging.UEPagingID.STMSI.MTMSI) } ue.SetOldTmsiForTest(0xFFFFFFFF) @@ -99,8 +99,8 @@ func TestBuildPagingOldMTMSISentinel(t *testing.T) { t.Fatalf("buildPaging: %v", err) } - if paging.STMSI.MTMSI != 0x1234 { - t.Fatalf("paged on M-TMSI %#x, want 0x1234 (the current M-TMSI)", paging.STMSI.MTMSI) + if paging.UEPagingID.STMSI.MTMSI != 0x1234 { + t.Fatalf("paged on M-TMSI %#x, want 0x1234 (the current M-TMSI)", paging.UEPagingID.STMSI.MTMSI) } } diff --git a/internal/mme/ran_trace.go b/internal/mme/ran_trace.go index 7749b37f71..5c05dbb86a 100644 --- a/internal/mme/ran_trace.go +++ b/internal/mme/ran_trace.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/internal/logger" "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/internal/tracing" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" @@ -184,8 +185,8 @@ func (m *MME) traceActivation(id tracing.RANTraceID) (*s1ap.TraceActivation, err return nil, fmt.Errorf("RAN trace is not enabled") } - tce := m.ranTrace.Config().TCEAddress - if !tce.IsValid() { + tce, err := ap.TransportLayerAddressFrom(m.ranTrace.Config().TCEAddress) + if err != nil { return nil, fmt.Errorf("no Trace Collection Entity address") } @@ -193,7 +194,7 @@ func (m *MME) traceActivation(id tracing.RANTraceID) (*s1ap.TraceActivation, err EUTRANTraceID: s1ap.EUTRANTraceID(id), InterfacesToTrace: ranTraceInterfaces, TraceDepth: s1ap.TraceDepthMinimum, - TraceCollectionEntityIPAddress: s1ap.TransportLayerAddress(tce.Unmap().AsSlice()), + TraceCollectionEntityIPAddress: tce, }, nil } diff --git a/internal/mme/ran_trace_test.go b/internal/mme/ran_trace_test.go index 65d8c80834..8837fce3d1 100644 --- a/internal/mme/ran_trace_test.go +++ b/internal/mme/ran_trace_test.go @@ -155,14 +155,14 @@ func TestMMETraceFailure(t *testing.T) { other := id other[7]++ - c.TraceFailed(t.Context(), s1ap.EUTRANTraceID(other), s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5}) + c.TraceFailed(t.Context(), s1ap.EUTRANTraceID(other), s1ap.CauseRadioNetworkPartialHandover.Cause()) ue.TraceConnection(t.Context()) if n := len(sentTraceStarts(t, w)); n != 1 { t.Fatalf("%d Trace Start messages after a failure for another Trace ID, want 1", n) } - c.TraceFailed(t.Context(), s1ap.EUTRANTraceID(id), s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5}) + c.TraceFailed(t.Context(), s1ap.EUTRANTraceID(id), s1ap.CauseRadioNetworkPartialHandover.Cause()) ue.TraceConnection(t.Context()) starts := sentTraceStarts(t, w) diff --git a/internal/mme/relocation.go b/internal/mme/relocation.go index 028b3c9a5e..afbdd70726 100644 --- a/internal/mme/relocation.go +++ b/internal/mme/relocation.go @@ -78,10 +78,7 @@ func (m *MME) ForwardRelocation(ctx context.Context, req interworking.ForwardRel } if !access.Allow4G { - return none, interworking.TargetRefusal{Cause: s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, - Value: s1ap.CauseRadioNetworkHOTargetNotAllowed, - }} + return none, interworking.TargetRefusal{Cause: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()} } ue := NewUeContext() @@ -407,13 +404,18 @@ func (m *MME) handoverRestrictionList(ctx context.Context) (*s1ap.HandoverRestri } func targetGlobalENBID(target interworking.ENBIdentity) (s1ap.GlobalENBID, error) { - kind, ok := map[uint8]s1ap.ENBIDKind{ - 18: s1ap.ENBIDShortMacro, - 20: s1ap.ENBIDMacro, - 21: s1ap.ENBIDLongMacro, - 28: s1ap.ENBIDHome, - }[target.Bits] - if !ok { + var enbID s1ap.ENBID + + switch target.Bits { + case 18: + enbID.ShortMacroENBID = s1ap.Ptr(s1ap.ShortMacroENBID(target.ID)) + case 20: + enbID.MacroENBID = s1ap.Ptr(s1ap.MacroENBID(target.ID)) + case 21: + enbID.LongMacroENBID = s1ap.Ptr(s1ap.LongMacroENBID(target.ID)) + case 28: + enbID.HomeENBID = s1ap.Ptr(s1ap.HomeENBID(target.ID)) + default: return s1ap.GlobalENBID{}, fmt.Errorf("mme: no eNB identity is %d bits wide", target.Bits) } @@ -424,6 +426,6 @@ func targetGlobalENBID(target interworking.ENBIdentity) (s1ap.GlobalENBID, error return s1ap.GlobalENBID{ PLMNIdentity: plmn, - ENBID: s1ap.ENBID{Kind: kind, Value: target.ID}, + ENBID: enbID, }, nil } diff --git a/internal/mme/relocation_test.go b/internal/mme/relocation_test.go index 95cff89abd..c816e1bc02 100644 --- a/internal/mme/relocation_test.go +++ b/internal/mme/relocation_test.go @@ -26,7 +26,7 @@ var testRelocationENBFTEID = models.FTEID{TEID: 0x5678, Addr: netip.AddrFrom4([4 var testTargetENB = s1ap.GlobalENBID{ PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, - ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 0x00abc}, + ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x00abc))}, } func relocationRequest(sessions ...interworking.PDNConnection) interworking.ForwardRelocationRequest { @@ -70,6 +70,7 @@ func relocationRequest(sessions ...interworking.PDNConnection) interworking.Forw TAC: 1, }, }, + Cause: s1ap.CauseRadioNetworkUnspecified.Cause(), SourceToTarget: []byte{0xde, 0xad, 0xbe, 0xef}, UEAMBRUplink: models.MustParseBitRate("1 Gbps"), UEAMBRDownlink: models.MustParseBitRate("2 Gbps"), @@ -732,14 +733,14 @@ func TestRelocationCancelForAnUnknownSubscriber(t *testing.T) { func TestTargetGlobalENBIDWidths(t *testing.T) { for _, tc := range []struct { bits uint8 - kind s1ap.ENBIDKind + kind string ok bool }{ - {18, s1ap.ENBIDShortMacro, true}, - {20, s1ap.ENBIDMacro, true}, - {21, s1ap.ENBIDLongMacro, true}, - {28, s1ap.ENBIDHome, true}, - {19, 0, false}, + {18, "short-macroENB-ID", true}, + {20, "macroENB-ID", true}, + {21, "long-macroENB-ID", true}, + {28, "homeENB-ID", true}, + {19, "", false}, } { got, err := targetGlobalENBID(interworking.ENBIdentity{ PlmnID: models.PlmnID{Mcc: "001", Mnc: "01"}, @@ -750,8 +751,8 @@ func TestTargetGlobalENBIDWidths(t *testing.T) { t.Fatalf("%d bits: err = %v, want ok = %t", tc.bits, err, tc.ok) } - if tc.ok && got.ENBID.Kind != tc.kind { - t.Errorf("%d bits: kind = %d, want %d", tc.bits, got.ENBID.Kind, tc.kind) + if tc.ok && got.ENBID.AlternativeName() != tc.kind { + t.Errorf("%d bits: kind = %s, want %s", tc.bits, got.ENBID.AlternativeName(), tc.kind) } } } @@ -777,7 +778,7 @@ func TestForwardRelocationReportsATargetRejection(t *testing.T) { t.Fatal("the relocated UE context is not reachable") } - refusal := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell} + refusal := s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause() m.FailHandoverToSource(context.Background(), ue, refusal) err := <-done @@ -790,7 +791,7 @@ func TestForwardRelocationReportsATargetRejection(t *testing.T) { t.Fatalf("error = %v, want a refusal carrying the target eNB's cause", err) } - if refused.Cause != refusal { + if !refused.Cause.Equal(refusal) { t.Errorf("refusal cause = %+v, want the target eNB's %+v", refused.Cause, refusal) } @@ -947,7 +948,7 @@ func TestForwardRelocationRefusesASubscriberBarredFrom4G(t *testing.T) { t.Fatalf("error = %v, want a TargetRefusal", err) } - if refusal.Cause.Value != s1ap.CauseRadioNetworkHOTargetNotAllowed { + if !refusal.Cause.Equal(s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()) { t.Fatalf("refusal cause = %+v, want handover target not allowed", refusal.Cause) } } @@ -1092,7 +1093,7 @@ func TestForwardRelocationRefusesAUEThatIsNotAnOwnSubscriber(t *testing.T) { t.Fatalf("error = %v, TargetRefusal = %v, want %v", err, got, tc.wantRefusal) } - if tc.wantRefusal && refusal.Cause.Value != s1ap.CauseRadioNetworkHOTargetNotAllowed { + if tc.wantRefusal && !refusal.Cause.Equal(s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()) { t.Fatalf("refusal cause = %+v, want handover target not allowed", refusal.Cause) } diff --git a/internal/mme/roaming_interworking.go b/internal/mme/roaming_interworking.go index a541f0d7cd..c713e85e6a 100644 --- a/internal/mme/roaming_interworking.go +++ b/internal/mme/roaming_interworking.go @@ -47,10 +47,7 @@ func (m *MME) admitArrivingVisitor(ctx context.Context, ue *UeContext) error { var r *Rejection if errors.As(err, &r) { - return fmt.Errorf("%w: %w", r, interworking.TargetRefusal{Cause: s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, - Value: s1ap.CauseRadioNetworkHOTargetNotAllowed, - }}) + return fmt.Errorf("%w: %w", r, interworking.TargetRefusal{Cause: s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()}) } return err diff --git a/internal/mme/roaming_interworking_test.go b/internal/mme/roaming_interworking_test.go index 24cce4842f..b9e27becda 100644 --- a/internal/mme/roaming_interworking_test.go +++ b/internal/mme/roaming_interworking_test.go @@ -121,7 +121,7 @@ func TestForwardRelocationRefusesAVisitorWithoutN26(t *testing.T) { } var refusal interworking.TargetRefusal - if !errors.As(err, &refusal) || refusal.Cause.Value != s1ap.CauseRadioNetworkHOTargetNotAllowed { + if !errors.As(err, &refusal) || !refusal.Cause.Equal(s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause()) { t.Fatalf("error = %v, want a handover-target-not-allowed refusal", err) } diff --git a/internal/mme/s1ap/ap_id_binding_test.go b/internal/mme/s1ap/ap_id_binding_test.go index a9b0fc21a6..79834a63c2 100644 --- a/internal/mme/s1ap/ap_id_binding_test.go +++ b/internal/mme/s1ap/ap_id_binding_test.go @@ -10,6 +10,7 @@ import ( "time" "github.com/ellanetworks/core/internal/mme" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -19,7 +20,7 @@ func handoverAck(targetMME s1ap.MMEUES1APID, enbID s1ap.ENBUES1APID) *s1ap.Hando ENBUES1APID: s1ap.Ptr(enbID), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, }}, TargetToSource: s1ap.TransparentContainer{0xaa}, @@ -121,7 +122,7 @@ func TestPathSwitchRequestReusingAnAllocatedENBUES1APIDIsRejectedAndReleasesTheH t.Errorf("Error Indication carries (%v, %v), want only the received eNB-UE-S1AP-ID 42", ind.MMEUES1APID, ind.ENBUES1APID) } - if ind.Cause == nil || *ind.Cause != causeUnknownENBUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownENBUES1APID) { t.Errorf("Error Indication cause = %v, want unknown-enb-ue-s1ap-id", ind.Cause) } diff --git a/internal/mme/s1ap/ap_id_handling_test.go b/internal/mme/s1ap/ap_id_handling_test.go index 665134a959..f85998f1b8 100644 --- a/internal/mme/s1ap/ap_id_handling_test.go +++ b/internal/mme/s1ap/ap_id_handling_test.go @@ -152,7 +152,7 @@ func TestInitialUEMessageReusingAnAllocatedENBUES1APIDIsRejectedAndReleasesTheHo t.Errorf("Error Indication eNB-UE-S1AP-ID = %v, want %d", ind.ENBUES1APID, enbID) } - if ind.Cause == nil || *ind.Cause != causeUnknownENBUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownENBUES1APID) { t.Errorf("Error Indication cause = %v, want unknown-enb-ue-s1ap-id", ind.Cause) } diff --git a/internal/mme/s1ap/deferred_release_test.go b/internal/mme/s1ap/deferred_release_test.go index 3bae96a4af..b39339fb70 100644 --- a/internal/mme/s1ap/deferred_release_test.go +++ b/internal/mme/s1ap/deferred_release_test.go @@ -15,7 +15,7 @@ func inactivityRelease(ue *mme.UeContext) *s1ap.UEContextReleaseRequest { return &s1ap.UEContextReleaseRequest{ MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: 7, - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUserInactivity.Cause()), } } @@ -60,7 +60,7 @@ func TestOtherCausesReleaseDespiteAnMTDeliveryInProgress(t *testing.T) { ue.PagingAnswered() req := inactivityRelease(ue) - req.Cause = s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioConnectionWithUELost}) + req.Cause = s1ap.Ptr(s1ap.CauseRadioNetworkRadioConnectionWithUELost.Cause()) deliverReleaseRequest(t, m, cc, req) @@ -73,7 +73,7 @@ func TestADeferralThatRacesTheSettlementResumesAtOnce(t *testing.T) { m := newTestMME(t) ue, cc := securedUE(t, m) - ue.Conn().DeferRelease(t.Context(), s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUserInactivity}) + ue.Conn().DeferRelease(t.Context(), s1ap.CauseRadioNetworkUserInactivity.Cause()) if len(cc.sent) != 1 { t.Fatalf("UE Context Release Commands sent = %d, want 1: a deferral whose pending signalling already settled must not wait for the guard", len(cc.sent)) diff --git a/internal/mme/s1ap/enb_config_update_test.go b/internal/mme/s1ap/enb_config_update_test.go index 439bc9990a..7c517b27b2 100644 --- a/internal/mme/s1ap/enb_config_update_test.go +++ b/internal/mme/s1ap/enb_config_update_test.go @@ -92,7 +92,7 @@ func TestENBConfigUpdateRejectedUnknownPLMN(t *testing.T) { t.Fatal(err) } - if failure.Cause == nil || *failure.Cause != causeUnknownPLMN { + if failure.Cause == nil || !failure.Cause.Equal(causeUnknownPLMN) { t.Fatalf("cause = %+v, want Unknown PLMN %+v", failure.Cause, causeUnknownPLMN) } } @@ -126,7 +126,7 @@ func TestENBConfigUpdateRejectedUnknownTAC(t *testing.T) { t.Fatal(err) } - if failure.Cause == nil || *failure.Cause != causeNoServedTAC { + if failure.Cause == nil || !failure.Cause.Equal(causeNoServedTAC) { t.Fatalf("cause = %+v, want Misc/unspecified %+v", failure.Cause, causeNoServedTAC) } } diff --git a/internal/mme/s1ap/handle_enb_configuration_transfer.go b/internal/mme/s1ap/handle_enb_configuration_transfer.go index 331d05e04a..9264cd8267 100644 --- a/internal/mme/s1ap/handle_enb_configuration_transfer.go +++ b/internal/mme/s1ap/handle_enb_configuration_transfer.go @@ -29,11 +29,7 @@ func handleENBConfigurationTransfer(ctx context.Context, m *mme.MME, radio *mme. return } - target, err := msg.SONConfigurationTransfer.TargetENBID() - if err != nil { - logger.From(ctx, logger.MmeLog).Warn("could not decode Target eNB-ID from SON Configuration Transfer", zap.Error(err)) - return - } + target := msg.SONConfigurationTransfer.TargeteNBID targetID, err := mme.RanNodeID(target.GlobalENBID) if err != nil { diff --git a/internal/mme/s1ap/handle_enb_configuration_transfer_test.go b/internal/mme/s1ap/handle_enb_configuration_transfer_test.go index 4a85786eeb..e76ae7eb95 100644 --- a/internal/mme/s1ap/handle_enb_configuration_transfer_test.go +++ b/internal/mme/s1ap/handle_enb_configuration_transfer_test.go @@ -5,22 +5,40 @@ package s1ap import ( "context" - "encoding/hex" "testing" "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/s1ap" ) -const goldenENBConfigTransfer = "000001008140110000f1100000abc000f1100007deadbeef" - func targetENBID() s1ap.GlobalENBID { return s1ap.GlobalENBID{ PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, - ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 0x00abc}, + ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x00abc))}, } } +func enbConfigTransferValue(t *testing.T) []byte { + t.Helper() + + msg := &s1ap.ENBConfigurationTransfer{SONConfigurationTransfer: &s1ap.SONConfigurationTransfer{ + TargeteNBID: s1ap.TargeteNBID{ + GlobalENBID: targetENBID(), + SelectedTAI: s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 7}, + }, + SourceeNBID: s1ap.SourceeNBID{ + GlobalENBID: s1ap.GlobalENBID{ + PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, + ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x00abd))}, + }, + SelectedTAI: s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 8}, + }, + SONInformation: s1ap.SONInformation{SONInformationRequest: s1ap.Ptr(s1ap.SONInformationRequestTimeSynchronisationInfo)}, + }} + + return initiatingValue(t, mustMarshal(t, msg.Marshal)) +} + func TestHandleENBConfigurationTransfer_RelaysToTarget(t *testing.T) { m := newTestMME(t) @@ -31,12 +49,7 @@ func TestHandleENBConfigurationTransfer_RelaysToTarget(t *testing.T) { sourceConn := &captureConn{} - value, err := hex.DecodeString(goldenENBConfigTransfer) - if err != nil { - t.Fatal(err) - } - - handleENBConfigurationTransfer(context.Background(), m, mme.NewRadioForTest(sourceConn), value) + handleENBConfigurationTransfer(context.Background(), m, mme.NewRadioForTest(sourceConn), enbConfigTransferValue(t)) if targetConn.count() != 1 { t.Fatalf("expected 1 relayed message to the target eNB, got %d", targetConn.count()) @@ -66,12 +79,7 @@ func TestHandleENBConfigurationTransfer_TargetNotConnected(t *testing.T) { m := newTestMME(t) sourceConn := &captureConn{} - value, err := hex.DecodeString(goldenENBConfigTransfer) - if err != nil { - t.Fatal(err) - } - - handleENBConfigurationTransfer(context.Background(), m, mme.NewRadioForTest(sourceConn), value) + handleENBConfigurationTransfer(context.Background(), m, mme.NewRadioForTest(sourceConn), enbConfigTransferValue(t)) if sourceConn.count() != 0 { t.Fatalf("no relay expected when the target eNB is not connected, got %d", sourceConn.count()) diff --git a/internal/mme/s1ap/handle_enb_configuration_update.go b/internal/mme/s1ap/handle_enb_configuration_update.go index 2375bf8101..4b20388151 100644 --- a/internal/mme/s1ap/handle_enb_configuration_update.go +++ b/internal/mme/s1ap/handle_enb_configuration_update.go @@ -147,7 +147,7 @@ func enbConfigUpdateOutcomeFor(req *s1ap.ENBConfigurationUpdate, plmn s1ap.PLMNI } reason = "eNB broadcasts no PLMN served by this MME (Unknown PLMN)" - if cause == causeNoServedTAC { + if cause.Equal(causeNoServedTAC) { reason = "eNB broadcasts a served PLMN but no TAC served by this MME" } diff --git a/internal/mme/s1ap/handle_erab_modification_indication.go b/internal/mme/s1ap/handle_erab_modification_indication.go index 4632df8a8a..5f59d654ff 100644 --- a/internal/mme/s1ap/handle_erab_modification_indication.go +++ b/internal/mme/s1ap/handle_erab_modification_indication.go @@ -16,7 +16,7 @@ import ( // causeERABModOmittedERAB is the UE Context Release cause when an E-RAB // Modification Indication omits an established E-RAB (TS 36.413 §8.2.4.4): no // specific radio-network cause applies, so "unspecified". -var causeERABModOmittedERAB = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnspecified} +var causeERABModOmittedERAB = s1ap.CauseRadioNetworkUnspecified.Cause() // handleERABModificationIndication relocates the downlink S1-U endpoint of the // UE's established E-RABs to the addresses the eNB reports (the DC / secondary-node diff --git a/internal/mme/s1ap/handle_erab_modification_indication_test.go b/internal/mme/s1ap/handle_erab_modification_indication_test.go index 3dbec43b1c..62affbe5d0 100644 --- a/internal/mme/s1ap/handle_erab_modification_indication_test.go +++ b/internal/mme/s1ap/handle_erab_modification_indication_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -32,7 +33,7 @@ func erabModValue(t *testing.T, req *s1ap.ERABModificationIndication) []byte { func modifiedItem(addr [4]byte, teid uint32) s1ap.ERABToBeModifiedItemBearerModInd { return s1ap.ERABToBeModifiedItemBearerModInd{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress(addr[:]), + TransportLayerAddress: ap.TransportLayerAddressFromOctets(addr[:]), DLGTPTEID: s1ap.GTPTEID(teid), } } diff --git a/internal/mme/s1ap/handle_erab_modify_response.go b/internal/mme/s1ap/handle_erab_modify_response.go index cb9af8b31c..a40214afc1 100644 --- a/internal/mme/s1ap/handle_erab_modify_response.go +++ b/internal/mme/s1ap/handle_erab_modify_response.go @@ -58,11 +58,11 @@ func handleERABModifyResponse(ctx context.Context, m *mme.MME, radio *mme.Radio, } func handoverTriggered(c s1ap.Cause) bool { - if c.Group != s1ap.CauseGroupRadioNetwork || c.Extended { + if c.RadioNetwork == nil { return false } - switch c.Value { + switch *c.RadioNetwork { case s1ap.CauseRadioNetworkS1IntraSystemHandoverTriggered, s1ap.CauseRadioNetworkS1InterSystemHandoverTriggered, s1ap.CauseRadioNetworkX2HandoverTriggered: return true default: diff --git a/internal/mme/s1ap/handle_erab_modify_response_internal_test.go b/internal/mme/s1ap/handle_erab_modify_response_internal_test.go index af150ff308..65635ff14e 100644 --- a/internal/mme/s1ap/handle_erab_modify_response_internal_test.go +++ b/internal/mme/s1ap/handle_erab_modify_response_internal_test.go @@ -10,17 +10,18 @@ import ( ) func TestHandoverTriggeredCauses(t *testing.T) { - radio := func(v int) s1ap.Cause { return s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: v} } - - for cause, want := range map[s1ap.Cause]bool{ - radio(s1ap.CauseRadioNetworkS1IntraSystemHandoverTriggered): true, - radio(s1ap.CauseRadioNetworkS1InterSystemHandoverTriggered): true, - radio(s1ap.CauseRadioNetworkX2HandoverTriggered): true, - radio(s1ap.CauseRadioNetworkRadioResourcesNotAvailable): false, - {Group: s1ap.CauseGroupTransport, Value: 35}: false, + for _, tc := range []struct { + cause s1ap.Cause + want bool + }{ + {s1ap.CauseRadioNetworkS1IntraSystemHandoverTriggered.Cause(), true}, + {s1ap.CauseRadioNetworkS1InterSystemHandoverTriggered.Cause(), true}, + {s1ap.CauseRadioNetworkX2HandoverTriggered.Cause(), true}, + {s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), false}, + {s1ap.CauseTransport(35).Cause(), false}, } { - if got := handoverTriggered(cause); got != want { - t.Errorf("handoverTriggered(%+v) = %v, want %v (TS 36.413 §8.2.2.2)", cause, got, want) + if got := handoverTriggered(tc.cause); got != tc.want { + t.Errorf("handoverTriggered(%+v) = %v, want %v (TS 36.413 §8.2.2.2)", tc.cause, got, tc.want) } } } diff --git a/internal/mme/s1ap/handle_erab_release_indication.go b/internal/mme/s1ap/handle_erab_release_indication.go index 9ba7404823..5ceeb30844 100644 --- a/internal/mme/s1ap/handle_erab_release_indication.go +++ b/internal/mme/s1ap/handle_erab_release_indication.go @@ -47,8 +47,9 @@ func handleERABReleaseIndication(ctx context.Context, m *mme.MME, radio *mme.Rad if p := m.LookupPDN(ue, ebi); p != nil { ueConn.Log(ctx).Warn("eNB released a default bearer's E-RAB; disconnecting its PDN connection (TS 23.401 §5.10.3)", logger.SUPI(ue.Supi().String()), logger.ERABID(ebi), zap.String("cause", erab.Cause.String())) + group, _ := erab.Cause.Group() m.DisconnectLostPDN(ctx, ue, p, models.ReleaseFor(models.ReleaseAccessReleased). - WithRanNas(models.ReceivedS1APCause(uint8(erab.Cause.Group), uint16(erab.Cause.EnumeratedValue())))) + WithRanNas(models.ReceivedS1APCause(uint8(group), uint16(erab.Cause.EnumeratedValue())))) continue } diff --git a/internal/mme/s1ap/handle_erab_release_indication_test.go b/internal/mme/s1ap/handle_erab_release_indication_test.go index 9e931f4344..132a2b0c92 100644 --- a/internal/mme/s1ap/handle_erab_release_indication_test.go +++ b/internal/mme/s1ap/handle_erab_release_indication_test.go @@ -18,7 +18,7 @@ func releaseIndication(t *testing.T, ue *mme.UeContext, ebi uint8) []byte { msg := &s1ap.ERABReleaseIndication{ MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), - ERABReleased: []s1ap.ERABItem{{ERABID: s1ap.ERABID(ebi), Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioConnectionWithUELost}}}, + ERABReleased: []s1ap.ERABItem{{ERABID: s1ap.ERABID(ebi), Cause: s1ap.CauseRadioNetworkRadioConnectionWithUELost.Cause()}}, } return initiatingValue(t, mustMarshal(t, msg.Marshal)) diff --git a/internal/mme/s1ap/handle_error_indication.go b/internal/mme/s1ap/handle_error_indication.go index 948666ddd7..0da149ff81 100644 --- a/internal/mme/s1ap/handle_error_indication.go +++ b/internal/mme/s1ap/handle_error_indication.go @@ -17,9 +17,9 @@ import ( // causeUnknownPairUES1APID is S1AP Cause Radio Network "unknown-pair-ue-s1ap-id" // (TS 36.413): a UE-associated message whose eNB-UE-S1AP-ID does not match the // one stored against its MME-UE-S1AP-ID. -var causeUnknownPairUES1APID = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnknownPairUES1APID} +var causeUnknownPairUES1APID = s1ap.CauseRadioNetworkUnknownPairUES1APID.Cause() -var causeUnknownENBUES1APID = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnknownENBUES1APID} +var causeUnknownENBUES1APID = s1ap.CauseRadioNetworkUnknownENBUES1APID.Cause() func resolveUEQuiet(m *mme.MME, conn mme.S1APWriter, mmeID s1ap.MMEUES1APID, enbID s1ap.ENBUES1APID) (*mme.UeContext, *mme.UeConn, bool) { ue, ok := m.LookupUe(mmeID) @@ -87,7 +87,7 @@ func rejectErroneousAPIDs(ctx context.Context, m *mme.MME, conn mme.S1APWriter, // causeMissingUES1APID answers a UE-associated message that omitted a UE S1AP // ID: without it the MME cannot address a UE context, so the procedure is // rejected (TS 36.413 §10.3.5). -var causeMissingUES1APID = s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolAbstractSyntaxErrorReject} +var causeMissingUES1APID = s1ap.CauseProtocolAbstractSyntaxErrorReject.Cause() // resolveUEIDs is resolveUE for a message whose UE S1AP IDs carry ignore // criticality and may therefore be absent. @@ -131,7 +131,7 @@ func sendParseErrorIndication(ctx context.Context, m *mme.MME, conn mme.S1APWrit ase, ok := errors.AsType[*s1ap.AbstractSyntaxError](err) if !ok { emitErrorIndication(ctx, m, conn, &s1ap.ErrorIndication{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolTransferSyntaxError}, + Cause: s1ap.Ptr(s1ap.CauseProtocolTransferSyntaxError.Cause()), CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ ProcedureCode: &proc, TriggeringMessage: &trigger, @@ -169,7 +169,7 @@ func reportDiagnostics(ctx context.Context, m *mme.MME, conn mme.S1APWriter, pro emitErrorIndication(ctx, m, conn, &s1ap.ErrorIndication{ MMEUES1APID: ids.mme, ENBUES1APID: ids.enb, - Cause: &s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolAbstractSyntaxErrorIgnoreAndNotify}, + Cause: s1ap.Ptr(s1ap.CauseProtocolAbstractSyntaxErrorIgnoreAndNotify.Cause()), CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ ProcedureCode: &proc, TriggeringMessage: &trigger, @@ -218,7 +218,7 @@ func rejectWithFailure(ctx context.Context, m *mme.MME, conn mme.S1APWriter, pro log := logger.From(ctx, logger.MmeLog) log.Warn("failed to decode S1AP message", zap.Int("procedure_code", int(proc)), zap.Error(err)) - cause := s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolTransferSyntaxError} + cause := s1ap.CauseProtocolTransferSyntaxError.Cause() var diag *s1ap.CriticalityDiagnostics @@ -246,9 +246,9 @@ func rejectWithFailure(ctx context.Context, m *mme.MME, conn mme.S1APWriter, pro // ERROR INDICATION (TS 36.413 §10.2). It carries no Criticality Diagnostics because a // transfer-syntax error decodes nothing to cite; it applies where a decode failed // outright. -func sendProtocolErrorIndication(ctx context.Context, m *mme.MME, conn mme.S1APWriter, cause int) { +func sendProtocolErrorIndication(ctx context.Context, m *mme.MME, conn mme.S1APWriter, cause s1ap.CauseProtocol) { emitErrorIndication(ctx, m, conn, &s1ap.ErrorIndication{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: cause}, + Cause: s1ap.Ptr(cause.Cause()), }) } @@ -258,7 +258,7 @@ func sendProtocolErrorIndication(ctx context.Context, m *mme.MME, conn mme.S1APW // (Procedure Code, Triggering Message, Procedure Criticality); Ignore is dropped // silently, as most procedures an eNB sends that the MME does not handle are. func respondToUnknownProcedure(ctx context.Context, m *mme.MME, conn mme.S1APWriter, im *s1ap.InitiatingMessage) { - var cause int + var cause s1ap.CauseProtocol switch im.Criticality { case s1ap.CriticalityReject: @@ -274,7 +274,7 @@ func respondToUnknownProcedure(ctx context.Context, m *mme.MME, conn mme.S1APWri crit := im.Criticality emitErrorIndication(ctx, m, conn, &s1ap.ErrorIndication{ - Cause: &s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: cause}, + Cause: s1ap.Ptr(cause.Cause()), CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ ProcedureCode: &proc, TriggeringMessage: &trigger, @@ -361,10 +361,5 @@ func reportsErroneousAPIDs(cause *s1ap.Cause) bool { return false } - switch *cause { - case causeUnknownMMEUES1APID, causeUnknownENBUES1APID, causeUnknownPairUES1APID: - return true - default: - return false - } + return cause.Equal(causeUnknownMMEUES1APID) || cause.Equal(causeUnknownENBUES1APID) || cause.Equal(causeUnknownPairUES1APID) } diff --git a/internal/mme/s1ap/handle_error_indication_test.go b/internal/mme/s1ap/handle_error_indication_test.go index cd9e31a9a2..ea00b5089a 100644 --- a/internal/mme/s1ap/handle_error_indication_test.go +++ b/internal/mme/s1ap/handle_error_indication_test.go @@ -16,7 +16,7 @@ func TestErrorIndicationReleasesReferencedUE(t *testing.T) { ue, cc := securedUE(t, m) id := ue.Conn().MMEUES1APID - cause := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0} + cause := s1ap.CauseRadioNetworkUnspecified.Cause() b, err := (&s1ap.ErrorIndication{MMEUES1APID: &id, Cause: &cause}).Marshal() if err != nil { @@ -36,7 +36,7 @@ func TestErrorIndicationWithoutUEIsNoop(t *testing.T) { m := newTestMME(t) b, err := (&s1ap.ErrorIndication{ - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 0}), + Cause: s1ap.Ptr(s1ap.CauseMiscControlProcessingOverload.Cause()), }).Marshal() if err != nil { t.Fatal(err) @@ -56,7 +56,7 @@ func TestErrorIndicationFromAnotherENBDoesNotRelease(t *testing.T) { ue, cc := securedUE(t, m) id := ue.Conn().MMEUES1APID - cause := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0} + cause := s1ap.CauseRadioNetworkUnspecified.Cause() b, err := (&s1ap.ErrorIndication{MMEUES1APID: &id, Cause: &cause}).Marshal() if err != nil { diff --git a/internal/mme/s1ap/handle_handover_request_acknowledge.go b/internal/mme/s1ap/handle_handover_request_acknowledge.go index 32e1f5fef7..d00f9211bb 100644 --- a/internal/mme/s1ap/handle_handover_request_acknowledge.go +++ b/internal/mme/s1ap/handle_handover_request_acknowledge.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/internal/logger" "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" "go.uber.org/zap" ) @@ -189,7 +190,7 @@ func relayForwardingThroughUPF(ctx context.Context, m *mme.MME, ue *mme.UeContex continue } - addr, ok := enbTransportAddress(a.DLForwardingAddr) + addr, ok := enbTransportAddress(*a.DLForwardingAddr) if !ok { a.DLForwardingAddr, a.DLForwardingTEID = nil, nil out = append(out, a) @@ -205,7 +206,7 @@ func relayForwardingThroughUPF(ctx context.Context, m *mme.MME, ue *mme.UeContex continue } - tla, err := models.EncodeTransportLayerAddress(local.IPv4, local.IPv6) + tla, err := ap.TransportLayerAddressFromAddrs(local.IPv4, local.IPv6) if err != nil { logger.From(ctx, logger.MmeLog).Warn("could not encode the forwarding tunnel's transport address", logger.ERABID(a.Ebi), zap.Error(err)) @@ -216,7 +217,7 @@ func relayForwardingThroughUPF(ctx context.Context, m *mme.MME, ue *mme.UeContex continue } - a.DLForwardingAddr = s1ap.TransportLayerAddress(tla) + a.DLForwardingAddr = &tla a.DLForwardingTEID = s1ap.Ptr(s1ap.GTPTEID(local.TEID)) out = append(out, a) @@ -249,8 +250,8 @@ func forwardingItems(admitted []mme.AdmittedERAB) []s1ap.ERABDataForwardingItem return out } -func forwardingPair(addr s1ap.TransportLayerAddress, teid *s1ap.GTPTEID) (s1ap.TransportLayerAddress, *s1ap.GTPTEID) { - if !addr.Valid() || teid == nil { +func forwardingPair(addr *s1ap.TransportLayerAddress, teid *s1ap.GTPTEID) (*s1ap.TransportLayerAddress, *s1ap.GTPTEID) { + if addr == nil || !addr.Valid() || teid == nil { return nil, nil } diff --git a/internal/mme/s1ap/handle_initial_context_setup_response.go b/internal/mme/s1ap/handle_initial_context_setup_response.go index 1de2e41631..30ac880862 100644 --- a/internal/mme/s1ap/handle_initial_context_setup_response.go +++ b/internal/mme/s1ap/handle_initial_context_setup_response.go @@ -15,16 +15,16 @@ import ( ) // enbTransportAddress resolves the eNB S1-U endpoint from an E-RAB Transport -// Layer Address (TS 36.413): IPv4 (4 octets), IPv6 (16), or dual-stack (20), +// Layer Address (TS 36.413): IPv4 (32 bits), IPv6 (128), or dual-stack (160), // preferring IPv6. It reports false when no address is present. func enbTransportAddress(tla s1ap.TransportLayerAddress) (netip.Addr, bool) { - v4, v6 := tla.IPs() + v4, v6 := tla.IPv4(), tla.IPv6() switch { case v6.IsValid(): return v6.Unmap(), true case v4.IsValid(): - return v4.Unmap(), true + return v4, true default: return netip.Addr{}, false } diff --git a/internal/mme/s1ap/handle_path_switch_request.go b/internal/mme/s1ap/handle_path_switch_request.go index a1ef22836b..384fa70e0b 100644 --- a/internal/mme/s1ap/handle_path_switch_request.go +++ b/internal/mme/s1ap/handle_path_switch_request.go @@ -15,10 +15,10 @@ import ( // S1AP causes the MME returns in a PATH SWITCH REQUEST FAILURE (TS 36.413). var ( - causeUnknownMMEUES1APID = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnknownMMEUES1APID} - causeMultipleERABInstances = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkMultipleERABIDInstances} - causePathSwitchNoSecurity = s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASAuthenticationFailure} - causePathSwitchUPFailure = s1ap.Cause{Group: s1ap.CauseGroupTransport, Value: s1ap.CauseTransportResourceUnavailable} + causeUnknownMMEUES1APID = s1ap.CauseRadioNetworkUnknownMMEUES1APID.Cause() + causeMultipleERABInstances = s1ap.CauseRadioNetworkMultipleERABIDInstances.Cause() + causePathSwitchNoSecurity = s1ap.CauseNASAuthenticationFailure.Cause() + causePathSwitchUPFailure = s1ap.CauseTransportResourceUnavailable.Cause() ) // handlePathSwitchRequest handles an X2-handover PATH SWITCH REQUEST from the @@ -220,7 +220,7 @@ func releasedERABItems(failed []uint8) []s1ap.ERABItem { return nil } - cause := s1ap.Cause{Group: s1ap.CauseGroupTransport, Value: s1ap.CauseTransportResourceUnavailable} + cause := s1ap.CauseTransportResourceUnavailable.Cause() items := make([]s1ap.ERABItem, 0, len(failed)) for _, ebi := range failed { @@ -258,15 +258,15 @@ func pathSwitchSecurityCapabilities(ctx context.Context, ue *mme.UeContext, rece stored := mme.S1apSecurityCapabilities(uecap) - if received == nil || *received == stored { + if received == nil || received.Equal(stored) { return nil } logger.From(ctx, logger.MmeLog).Warn("UE security capabilities reported by target eNB differ from stored; replaying stored values", - zap.Uint16("received_eea", received.EncryptionAlgorithms), - zap.Uint16("received_eia", received.IntegrityProtectionAlgorithms), - zap.Uint16("stored_eea", stored.EncryptionAlgorithms), - zap.Uint16("stored_eia", stored.IntegrityProtectionAlgorithms)) + zap.Uint16("received_eea", received.EncryptionAlgorithms.Value), + zap.Uint16("received_eia", received.IntegrityProtectionAlgorithms.Value), + zap.Uint16("stored_eea", stored.EncryptionAlgorithms.Value), + zap.Uint16("stored_eia", stored.IntegrityProtectionAlgorithms.Value)) return &stored } diff --git a/internal/mme/s1ap/handle_path_switch_request_test.go b/internal/mme/s1ap/handle_path_switch_request_test.go index eb098cbf28..27c35bc54a 100644 --- a/internal/mme/s1ap/handle_path_switch_request_test.go +++ b/internal/mme/s1ap/handle_path_switch_request_test.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -93,7 +94,7 @@ func pathSwitchUE(t *testing.T, m *mme.MME) *mme.UeContext { func switchedDLItem() s1ap.ERABToBeSwitchedDLItem { return s1ap.ERABToBeSwitchedDLItem{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, } } @@ -105,7 +106,7 @@ func samplePathSwitchRequest(ue *mme.UeContext) *s1ap.PathSwitchRequest { SourceMMEUES1APID: ue.Conn().MMEUES1APID, EUTRANCGI: s1ap.Ptr(s1ap.EUTRANCGI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 1}), TAI: s1ap.Ptr(s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}), - UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}), + UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}}), } } @@ -162,7 +163,7 @@ func TestPathSwitchUnknownUEFails(t *testing.T) { SourceMMEUES1APID: 999, EUTRANCGI: s1ap.Ptr(s1ap.EUTRANCGI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 1}), TAI: s1ap.Ptr(s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}), - UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}), + UESecurityCapabilities: s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}}), } target := &captureConn{} @@ -172,7 +173,7 @@ func TestPathSwitchUnknownUEFails(t *testing.T) { t.Fatalf("expected one downlink (Failure), got %d", target.count()) } - if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || *fail.Cause != causeUnknownMMEUES1APID { + if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || !fail.Cause.Equal(causeUnknownMMEUES1APID) { t.Fatalf("cause = %+v, want unknown-mme-ue-s1ap-id", fail.Cause) } } @@ -189,7 +190,7 @@ func TestPathSwitchNoSecurityContextFails(t *testing.T) { t.Fatalf("expected one downlink (Failure), got %d", target.count()) } - if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || *fail.Cause != causePathSwitchNoSecurity { + if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || !fail.Cause.Equal(causePathSwitchNoSecurity) { t.Fatalf("cause = %+v, want authentication-failure", fail.Cause) } @@ -208,7 +209,7 @@ func TestPathSwitchDuplicateERABFails(t *testing.T) { target := &captureConn{} handlePathSwitchRequest(context.Background(), m, mme.NewRadioForTest(target), pathSwitchValue(t, req)) - if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || *fail.Cause != causeMultipleERABInstances { + if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || !fail.Cause.Equal(causeMultipleERABInstances) { t.Fatalf("cause = %+v, want multiple-E-RAB-ID-instances", fail.Cause) } @@ -227,7 +228,7 @@ func TestPathSwitchUnknownERABFails(t *testing.T) { target := &captureConn{} handlePathSwitchRequest(context.Background(), m, mme.NewRadioForTest(target), pathSwitchValue(t, req)) - if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || *fail.Cause != causePathSwitchUPFailure { + if fail := parsePathSwitchFailure(t, target.sent[0]); fail.Cause == nil || !fail.Cause.Equal(causePathSwitchUPFailure) { t.Fatalf("cause = %+v, want transport-resource-unavailable", fail.Cause) } @@ -245,15 +246,15 @@ func TestPathSwitchCapabilityMismatchReplaysStored(t *testing.T) { ue := pathSwitchUE(t, m) req := samplePathSwitchRequest(ue) - req.UESecurityCapabilities = s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0x8000}) + req.UESecurityCapabilities = s1ap.Ptr(s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0x8000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0x8000}}) target := &captureConn{} handlePathSwitchRequest(context.Background(), m, mme.NewRadioForTest(target), pathSwitchValue(t, req)) ack := parsePathSwitchAck(t, target.sent[0]) - want := s1ap.UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000} - if ack.UESecurityCapabilities == nil || *ack.UESecurityCapabilities != want { + want := s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}} + if ack.UESecurityCapabilities == nil || !ack.UESecurityCapabilities.Equal(want) { t.Fatalf("replayed capabilities = %+v, want %+v", ack.UESecurityCapabilities, want) } } @@ -290,7 +291,7 @@ func TestPathSwitchPartialFailureReleasesUnswitchedERAB(t *testing.T) { req.ERABToBeSwitchedDL = append(req.ERABToBeSwitchedDL, s1ap.ERABToBeSwitchedDLItem{ ERABID: unknownERAB, - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 3}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3}), GTPTEID: 0x9a, }) diff --git a/internal/mme/s1ap/handle_reset.go b/internal/mme/s1ap/handle_reset.go index 1255dc6689..0bfccb465e 100644 --- a/internal/mme/s1ap/handle_reset.go +++ b/internal/mme/s1ap/handle_reset.go @@ -28,7 +28,7 @@ func handleReset(ctx context.Context, m *mme.MME, radio *mme.Radio, value []byte cause = mme.S1apCauseName(req.Cause) } - if req.ResetType.All { + if req.ResetType.S1Interface != nil { affected := m.ConnsOnConn(radio.Conn) m.ReclaimConns(ctx, affected, "S1 reset") @@ -39,17 +39,22 @@ func handleReset(ctx context.Context, m *mme.MME, radio *mme.Radio, value []byte return } - affected := m.ConnsForConnectionList(radio.Conn, req.ResetType.Part) + var part []s1ap.UEAssociatedLogicalS1ConnectionItem + if req.ResetType.PartOfS1Interface != nil { + part = *req.ResetType.PartOfS1Interface + } + + affected := m.ConnsForConnectionList(radio.Conn, part) m.ReclaimConns(ctx, affected, "S1 reset") radio.Log(ctx).Info("S1 Reset (part of interface)", logger.Cause(cause), - zap.Int("requested", len(req.ResetType.Part)), + zap.Int("requested", len(part)), zap.Int("connections", len(affected))) // TS 36.413 §8.7.1.2.1: the acknowledge echoes the UE-associated logical // S1-connections that were reset. - sendResetAcknowledge(ctx, m, radio.Conn, req.ResetType.Part, req.Diagnostics()) + sendResetAcknowledge(ctx, m, radio.Conn, part, req.Diagnostics()) } // sendResetAcknowledge answers a RESET with RESET ACKNOWLEDGE (TS 36.413 diff --git a/internal/mme/s1ap/handle_reset_test.go b/internal/mme/s1ap/handle_reset_test.go index df0614539f..829d288a43 100644 --- a/internal/mme/s1ap/handle_reset_test.go +++ b/internal/mme/s1ap/handle_reset_test.go @@ -64,8 +64,8 @@ func TestS1ResetWholeInterface(t *testing.T) { m.RegisterUEForTest(other, "001010000000012") testPDN(other).Apn = "internet" - cause := s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 0} - handleReset(context.Background(), m, mme.NewRadioForTest(cc), resetValue(t, &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: s1ap.ResetType{All: true}})) + cause := s1ap.CauseMiscControlProcessingOverload.Cause() + handleReset(context.Background(), m, mme.NewRadioForTest(cc), resetValue(t, &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: s1ap.ResetType{S1Interface: s1ap.Ptr(s1ap.ResetAllResetAll)}})) for _, ue := range []*mme.UeContext{ue1, ue2} { got, ok := m.LookupUeByIMSI(ue.IMSI()) @@ -107,11 +107,11 @@ func TestS1ResetPartOfInterface(t *testing.T) { mmeID := ue1.Conn().MMEUES1APID enbID := ue1.Conn().ENBUES1APID() - cause := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0} + cause := s1ap.CauseRadioNetworkUnspecified.Cause() handleReset(context.Background(), m, mme.NewRadioForTest(cc), resetValue(t, &s1ap.Reset{ Cause: s1ap.Ptr(cause), - ResetType: s1ap.ResetType{Part: []s1ap.UEAssociatedLogicalS1ConnectionItem{ + ResetType: s1ap.ResetType{PartOfS1Interface: &s1ap.UEAssociatedLogicalS1ConnectionListRes{ {MMEUES1APID: &mmeID, ENBUES1APID: &enbID}, }}, })) @@ -145,8 +145,8 @@ func TestS1ResetDropsMidAttachUE(t *testing.T) { ue.TransitionTo(t.Context(), mme.EMMDeregistered) testPDN(ue).Apn = "internet" - cause := s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 0} - handleReset(context.Background(), m, mme.NewRadioForTest(cc), resetValue(t, &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: s1ap.ResetType{All: true}})) + cause := s1ap.CauseMiscControlProcessingOverload.Cause() + handleReset(context.Background(), m, mme.NewRadioForTest(cc), resetValue(t, &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: s1ap.ResetType{S1Interface: s1ap.Ptr(s1ap.ResetAllResetAll)}})) if _, ok := m.LookupUeByIMSI(ue.IMSI()); ok { t.Fatal("incomplete-registration UE retained after S1 reset; expected drop") diff --git a/internal/mme/s1ap/handle_s1_setup.go b/internal/mme/s1ap/handle_s1_setup.go index 21389564cf..4abbcd5b3c 100644 --- a/internal/mme/s1ap/handle_s1_setup.go +++ b/internal/mme/s1ap/handle_s1_setup.go @@ -20,22 +20,22 @@ import ( // causeUnknownPLMN is S1AP Cause Misc "unknown-PLMN" (TS 36.413), returned in S1 // Setup Failure when the eNB broadcasts no PLMN this MME serves. -var causeUnknownPLMN = s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscUnknownPLMN} +var causeUnknownPLMN = s1ap.CauseMiscUnknownPLMN.Cause() // causeNoServedTAC is S1AP Cause Misc "unspecified", returned when the eNB // broadcasts a served PLMN but no TAC this MME serves. TS 36.413 §8.7.3.4 // mandates rejection only on Unknown PLMN; rejecting an unserved TAC matches the // AMF's NG Setup / RAN Configuration Update handling. -var causeNoServedTAC = s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscUnspecified} +var causeNoServedTAC = s1ap.CauseMiscUnspecified.Cause() // causeUnspecified is the same Cause Misc "unspecified" on the wire, named for // the other reason the MME sends it: a failure on its own side, where the // eNB's configuration is not at fault and nothing more specific fits. Kept // distinct from causeNoServedTAC so a reader can tell which rejection a call // site means. -var causeUnspecified = s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscUnspecified} +var causeUnspecified = s1ap.CauseMiscUnspecified.Cause() -var causeSemanticError = s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolSemanticError} +var causeSemanticError = s1ap.CauseProtocolSemanticError.Cause() // handleS1Setup answers an eNB's S1 Setup Request with an S1 Setup Response when // the eNB broadcasts a TAI this MME serves, otherwise an S1 Setup Failure @@ -80,7 +80,7 @@ func handleS1Setup(ctx context.Context, m *mme.MME, conn *sctp.SCTPConn, value [ m.RadioLog(ctx, conn).Info("S1 Setup Request", zap.String("enb_name", enbName(req.ENBName)), - zap.Uint32("enb_id", req.GlobalENBID.ENBID.Value), + zap.Uint32("enb_id", enbIDValue(req.GlobalENBID.ENBID)), ) if !accepted { @@ -178,7 +178,7 @@ func s1SetupOutcomeFor(reqValue []byte, plmn models.PlmnID, tacs []uint16, mmeGr } reason = "eNB broadcasts no PLMN served by this MME (Unknown PLMN)" - if cause == causeNoServedTAC { + if cause.Equal(causeNoServedTAC) { reason = "eNB broadcasts a served PLMN but no TAC served by this MME" } @@ -288,3 +288,9 @@ func enbName(name *string) string { return *name } + +func enbIDValue(id s1ap.ENBID) uint32 { + v, _ := id.Value() + + return v +} diff --git a/internal/mme/s1ap/handle_s1_setup_test.go b/internal/mme/s1ap/handle_s1_setup_test.go index 4ca5f985bf..7812f2280b 100644 --- a/internal/mme/s1ap/handle_s1_setup_test.go +++ b/internal/mme/s1ap/handle_s1_setup_test.go @@ -60,7 +60,7 @@ func TestServedTAICauseEmptySupportedTAs(t *testing.T) { t.Fatal("an empty Supported-TA list must not be accepted") } - if cause != causeNoServedTAC { + if !cause.Equal(causeNoServedTAC) { t.Errorf("cause = %+v, want unspecified (%+v)", cause, causeNoServedTAC) } } @@ -76,7 +76,7 @@ func TestServedTAICauseUnservedPLMN(t *testing.T) { t.Fatal("an unserved PLMN must not be accepted") } - if cause != causeUnknownPLMN { + if !cause.Equal(causeUnknownPLMN) { t.Errorf("cause = %+v, want unknown-PLMN (%+v)", cause, causeUnknownPLMN) } } diff --git a/internal/mme/s1ap/handle_ue_context_modification.go b/internal/mme/s1ap/handle_ue_context_modification.go index 4014fc98e6..0004d30b08 100644 --- a/internal/mme/s1ap/handle_ue_context_modification.go +++ b/internal/mme/s1ap/handle_ue_context_modification.go @@ -45,7 +45,7 @@ func handleUEContextModificationFailure(ctx context.Context, m *mme.MME, radio * ue.TouchLastSeen() ueConn.ForgetUEAMBR() - cause := s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscUnspecified} + cause := s1ap.CauseMiscUnspecified.Cause() if resp.Cause != nil { cause = *resp.Cause } diff --git a/internal/mme/s1ap/handle_ue_context_modification_test.go b/internal/mme/s1ap/handle_ue_context_modification_test.go index 75c173aeec..f582e47111 100644 --- a/internal/mme/s1ap/handle_ue_context_modification_test.go +++ b/internal/mme/s1ap/handle_ue_context_modification_test.go @@ -34,7 +34,7 @@ func TestUEContextModificationFailureForgetsTheUEAMBR(t *testing.T) { wire, err := (&s1ap.UEContextModificationFailure{ MMEUES1APID: s1ap.Ptr(ueConn.MMEUES1APID), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(7)), - Cause: &s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), }).Marshal() if err != nil { t.Fatal(err) diff --git a/internal/mme/s1ap/handle_ue_context_release_request.go b/internal/mme/s1ap/handle_ue_context_release_request.go index d4da35036e..e36a56a9eb 100644 --- a/internal/mme/s1ap/handle_ue_context_release_request.go +++ b/internal/mme/s1ap/handle_ue_context_release_request.go @@ -14,10 +14,10 @@ import ( // causeReleaseUnspecified stands in for an omitted Cause IE (TS 36.413 §9.2.1.3, // CauseRadioNetwork "unspecified"). -var causeReleaseUnspecified = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnspecified} +var causeReleaseUnspecified = s1ap.CauseRadioNetworkUnspecified.Cause() func keepsConnectionForPendingDownlink(cause s1ap.Cause, ueConn *mme.UeConn) bool { - if cause.Group != s1ap.CauseGroupRadioNetwork || cause.Value != s1ap.CauseRadioNetworkUserInactivity { + if cause.RadioNetwork == nil || *cause.RadioNetwork != s1ap.CauseRadioNetworkUserInactivity { return false } diff --git a/internal/mme/s1ap/handover.go b/internal/mme/s1ap/handover.go index 165f3a57c3..0db4e9e924 100644 --- a/internal/mme/s1ap/handover.go +++ b/internal/mme/s1ap/handover.go @@ -6,11 +6,11 @@ package s1ap import "github.com/ellanetworks/core/s1ap" var ( - causeHOFailureInTarget = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOFailureInTarget} - causeHOTargetNotAllowed = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed} - causeUnknownTargetID = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnknownTargetID} - causeHandoverNoSecurity = s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASAuthenticationFailure} - causeHandoverPrepUnspecific = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnspecified} - causeN26NotAvailable = s1ap.CauseN26InterfaceNotAvailable - causeProcedureConflict = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkInteractionWithOtherProcedure} + causeHOFailureInTarget = s1ap.CauseRadioNetworkHOFailureInTarget.Cause() + causeHOTargetNotAllowed = s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause() + causeUnknownTargetID = s1ap.CauseRadioNetworkUnknownTargetID.Cause() + causeHandoverNoSecurity = s1ap.CauseNASAuthenticationFailure.Cause() + causeHandoverPrepUnspecific = s1ap.CauseRadioNetworkUnspecified.Cause() + causeN26NotAvailable = s1ap.CauseRadioNetworkN26InterfaceNotAvailable.Cause() + causeProcedureConflict = s1ap.CauseRadioNetworkInteractionWithOtherProcedure.Cause() ) diff --git a/internal/mme/s1ap/handover_conformance_test.go b/internal/mme/s1ap/handover_conformance_test.go index 327296dff2..381dc0b545 100644 --- a/internal/mme/s1ap/handover_conformance_test.go +++ b/internal/mme/s1ap/handover_conformance_test.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -41,7 +42,7 @@ func ackWith(targetMME s1ap.MMEUES1APID, admitted, failed []uint8) *s1ap.Handove for _, ebi := range admitted { ack.ERABAdmitted = append(ack.ERABAdmitted, s1ap.ERABAdmittedItem{ ERABID: s1ap.ERABID(ebi), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: s1ap.GTPTEID(0x90 + uint32(ebi)), }) } @@ -49,7 +50,7 @@ func ackWith(targetMME s1ap.MMEUES1APID, admitted, failed []uint8) *s1ap.Handove for _, ebi := range failed { ack.ERABFailedToSetup = append(ack.ERABFailedToSetup, s1ap.ERABItem{ ERABID: s1ap.ERABID(ebi), - Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }) } @@ -179,7 +180,7 @@ func TestS1HandoverCommandReportsEveryUnadmittedERAB(t *testing.T) { want := causeHOFailureInTarget if tt.failed != nil { - want = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioResourcesNotAvailable} + want = s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() } assertReleaseCause(t, cmd, 6, want) @@ -195,7 +196,7 @@ func assertReleaseCause(t *testing.T, cmd *s1ap.HandoverCommand, ebi uint8, want continue } - if it.Cause != want { + if !it.Cause.Equal(want) { t.Errorf("release cause for E-RAB %d = %+v, want %+v", ebi, it.Cause, want) } @@ -227,7 +228,7 @@ func TestS1HandoverCommandReportsABearerTheCoreCouldNotOffer(t *testing.T) { successfulValue(t, mustMarshal(t, ack.Marshal))) cmd := handoverCommandOn(t, source) - assertReleaseCause(t, cmd, 6, s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkUnspecified}) + assertReleaseCause(t, cmd, 6, s1ap.CauseRadioNetworkUnspecified.Cause()) } func TestS1HandoverPreparationFailureCarriesMandatoryIEs(t *testing.T) { @@ -237,7 +238,7 @@ func TestS1HandoverPreparationFailureCarriesMandatoryIEs(t *testing.T) { sourceMME, sourceENB := ue.Conn().MMEUES1APID, ue.Conn().ENBUES1APID() req := sampleHandoverRequired(ue) - req.TargetID.TargeteNBID.GlobalENBID.ENBID = s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 0x99} + req.TargetID.TargeteNBID.GlobalENBID.ENBID = s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x99))} handleHandoverRequired(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, req.Marshal))) @@ -349,7 +350,7 @@ func TestS1HandoverRequestCarriesMandatoryIEs(t *testing.T) { t.Error("the E-RAB to set up carries no S-GW uplink TEID") } - if len(setup.TransportLayerAddress) == 0 { + if setup.TransportLayerAddress.IsZero() { t.Error("the E-RAB to set up carries no S-GW transport layer address") } @@ -374,14 +375,14 @@ func TestS1HandoverFailureWithoutENBUES1APIDFailsPreparation(t *testing.T) { initiatingValue(t, mustMarshal(t, sampleHandoverRequired(ue).Marshal))) targetMME := handoverRequestOn(t, target).MMEUES1APID - cause := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioResourcesNotAvailable} + cause := s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() fail := &s1ap.HandoverFailure{MMEUES1APID: s1ap.Ptr(targetMME), Cause: s1ap.Ptr(cause)} handleHandoverFailure(context.Background(), m, mme.NewRadioForTest(target), unsuccessfulValue(t, mustMarshal(t, fail.Marshal))) got := preparationFailureOn(t, source) - if got.Cause == nil || *got.Cause != cause { + if got.Cause == nil || !got.Cause.Equal(cause) { t.Errorf("preparation failure cause = %+v, want the target's %+v", got.Cause, cause) } @@ -404,15 +405,15 @@ func TestS1AcknowledgeAdmittingNoUsableBearerRejectsTheHandover(t *testing.T) { req := handoverRequestOn(t, target) ack := ackWith(req.MMEUES1APID, []uint8{mme.DefaultERABID}, nil) - ack.ERABAdmitted[0].TransportLayerAddress = s1ap.TransportLayerAddress{10, 4, 0} + ack.ERABAdmitted[0].TransportLayerAddress = ap.TransportLayerAddressFromOctets([]byte{10, 4, 0}) handleHandoverRequestAcknowledge(context.Background(), m, mme.NewRadioForTest(target), successfulValue(t, mustMarshal(t, ack.Marshal))) rel := parseUEContextReleaseCommand(t, lastSent(t, target)) - if rel.UES1APIDs.MMEUES1APID != req.MMEUES1APID { + if relMME, _ := rel.UES1APIDs.MMEID(); relMME != req.MMEUES1APID { t.Errorf("target release names MME-UE-S1AP-ID %d, want the target reservation's %d", - rel.UES1APIDs.MMEUES1APID, req.MMEUES1APID) + relMME, req.MMEUES1APID) } if preparationFailureOn(t, source).Cause == nil { @@ -474,12 +475,15 @@ func TestS1HandoverNotifySwitchesDownlinkAndReleasesTheSource(t *testing.T) { } rel := parseUEContextReleaseCommand(t, lastSent(t, source)) - if rel.UES1APIDs.MMEUES1APID != sourceMME || rel.UES1APIDs.ENBUES1APID != sourceENB { + relMME, _ := rel.UES1APIDs.MMEID() + relENB, _ := rel.UES1APIDs.ENBID() + + if relMME != sourceMME || relENB != sourceENB { t.Errorf("source release names (%d, %d), want the source's (%d, %d)", - rel.UES1APIDs.MMEUES1APID, rel.UES1APIDs.ENBUES1APID, sourceMME, sourceENB) + relMME, relENB, sourceMME, sourceENB) } - if rel.Cause == nil || *rel.Cause != mme.CauseHandoverSuccess { + if rel.Cause == nil || !rel.Cause.Equal(mme.CauseHandoverSuccess) { t.Errorf("source release cause = %+v, want successful-handover", rel.Cause) } } @@ -554,19 +558,22 @@ func TestS1HandoverCancelReleasesPreparationAndAcknowledges(t *testing.T) { targetMME, targetENB := driveToPrepared(t, m, ue, source, target) - cause := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkPartialHandover} + cause := s1ap.CauseRadioNetworkPartialHandover.Cause() cancel := &s1ap.HandoverCancel{MMEUES1APID: sourceMME, ENBUES1APID: sourceENB, Cause: s1ap.Ptr(cause)} handleHandoverCancel(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, cancel.Marshal))) rel := parseUEContextReleaseCommand(t, lastSent(t, target)) - if rel.UES1APIDs.MMEUES1APID != targetMME || rel.UES1APIDs.ENBUES1APID != targetENB { + relMME, _ := rel.UES1APIDs.MMEID() + relENB, _ := rel.UES1APIDs.ENBID() + + if relMME != targetMME || relENB != targetENB { t.Errorf("target release names (%d, %d), want the prepared target's (%d, %d)", - rel.UES1APIDs.MMEUES1APID, rel.UES1APIDs.ENBUES1APID, targetMME, targetENB) + relMME, relENB, targetMME, targetENB) } - if rel.Cause == nil || *rel.Cause != cause { + if rel.Cause == nil || !rel.Cause.Equal(cause) { t.Errorf("target release cause = %+v, want the source's cancel cause %+v", rel.Cause, cause) } @@ -609,7 +616,7 @@ func TestS1HandoverCancelWithoutCauseStillCancels(t *testing.T) { (&s1ap.HandoverCancel{ MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkPartialHandover}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkPartialHandover.Cause()), }).Marshal)), ieIDHandoverCause) handleHandoverCancel(context.Background(), m, mme.NewRadioForTest(source), body) @@ -723,7 +730,7 @@ func TestS1HandoverCommandRelaysTheTargetsReleaseCause(t *testing.T) { req := handoverRequestOn(t, target) - targetCause := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioResourcesNotAvailable} + targetCause := s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() ack := ackWith(req.MMEUES1APID, []uint8{mme.DefaultERABID}, nil) ack.ERABFailedToSetup = []s1ap.ERABItem{{ERABID: 6, Cause: targetCause}} @@ -736,7 +743,7 @@ func TestS1HandoverCommandRelaysTheTargetsReleaseCause(t *testing.T) { t.Fatalf("E-RABs to Release List = %+v, want the refused E-RAB", cmd.ERABToRelease) } - if cmd.ERABToRelease[0].Cause != targetCause { + if !cmd.ERABToRelease[0].Cause.Equal(targetCause) { t.Errorf("release cause = %+v, want the target's %+v", cmd.ERABToRelease[0].Cause, targetCause) } } diff --git a/internal/mme/s1ap/handover_test.go b/internal/mme/s1ap/handover_test.go index 052862d17a..6d25774293 100644 --- a/internal/mme/s1ap/handover_test.go +++ b/internal/mme/s1ap/handover_test.go @@ -12,12 +12,13 @@ import ( "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) var targetGlobalENBID = s1ap.GlobalENBID{ PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, - ENBID: s1ap.ENBID{Kind: s1ap.ENBIDMacro, Value: 2}, + ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(2))}, } func handoverUE(t *testing.T, m *mme.MME) (*mme.UeContext, *captureConn, *captureConn) { @@ -53,8 +54,8 @@ func sampleHandoverRequired(ue *mme.UeContext) *s1ap.HandoverRequired { MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), HandoverType: s1ap.HandoverTypeIntraLTE, - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}), - TargetID: s1ap.TargetID{TargeteNBID: s1ap.TargeteNBID{GlobalENBID: targetGlobalENBID, SelectedTAI: s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), + TargetID: s1ap.TargetID{TargeteNBID: &s1ap.TargeteNBID{GlobalENBID: targetGlobalENBID, SelectedTAI: s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}}, SourceToTarget: s1ap.TransparentContainer{0x01, 0x02, 0x03}, } } @@ -150,7 +151,7 @@ func driveToPrepared(t *testing.T, m *mme.MME, ue *mme.UeContext, source, target ENBUES1APID: s1ap.Ptr(targetENBUEID), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, }}, TargetToSource: s1ap.TransparentContainer{0xaa}, @@ -207,7 +208,7 @@ func TestHandoverHappyPath(t *testing.T) { ENBUES1APID: s1ap.Ptr(targetENBUEID), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, }}, TargetToSource: s1ap.TransparentContainer{0xaa}, @@ -272,11 +273,15 @@ func TestHandoverHappyPath(t *testing.T) { } relCmd, err := s1ap.ParseUEContextReleaseCommand(rel.Value) - if err != nil || relCmd.UES1APIDs.MMEUES1APID != sourceMME { + if err != nil { + t.Fatalf("source release addressed wrong id: %+v err %v", relCmd, err) + } + + if relMME, _ := relCmd.UES1APIDs.MMEID(); relMME != sourceMME { t.Fatalf("source release addressed wrong id: %+v err %v", relCmd, err) } - if want := (s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 2}); relCmd.Cause == nil || *relCmd.Cause != want { + if want := s1ap.CauseRadioNetworkSuccessfulHandover.Cause(); relCmd.Cause == nil || !relCmd.Cause.Equal(want) { t.Fatalf("source release cause = %+v, want %+v (successful-handover)", relCmd.Cause, want) } @@ -313,7 +318,7 @@ func TestHandoverRequiredNoSecurityFails(t *testing.T) { } fail, _ := s1ap.ParseHandoverPreparationFailure(uo.Value) - if fail.Cause == nil || *fail.Cause != causeHandoverNoSecurity { + if fail.Cause == nil || !fail.Cause.Equal(causeHandoverNoSecurity) { t.Fatalf("cause = %+v, want authentication-failure", fail.Cause) } @@ -327,7 +332,7 @@ func TestHandoverRequiredUnknownTargetFails(t *testing.T) { ue, source, _ := handoverUE(t, m) req := sampleHandoverRequired(ue) - req.TargetID.TargeteNBID.GlobalENBID.ENBID.Value = 999 + req.TargetID.TargeteNBID.GlobalENBID.ENBID = s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(999))} handleHandoverRequired(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, req.Marshal))) @@ -337,7 +342,7 @@ func TestHandoverRequiredUnknownTargetFails(t *testing.T) { } fail, _ := s1ap.ParseHandoverPreparationFailure(uo.Value) - if fail.Cause == nil || *fail.Cause != causeUnknownTargetID { + if fail.Cause == nil || !fail.Cause.Equal(causeUnknownTargetID) { t.Fatalf("cause = %+v, want unknown-targetID", fail.Cause) } } @@ -468,7 +473,7 @@ func TestHandoverFailureFailsToSource(t *testing.T) { handleHandoverRequired(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, sampleHandoverRequired(ue).Marshal))) - fail := &s1ap.HandoverFailure{MMEUES1APID: s1ap.Ptr(targetMMEUEID(t, target)), Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 12})} + fail := &s1ap.HandoverFailure{MMEUES1APID: s1ap.Ptr(targetMMEUEID(t, target)), Cause: s1ap.Ptr(s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause())} handleHandoverFailure(context.Background(), m, mme.NewRadioForTest(target), unsuccessfulValue(t, mustMarshal(t, fail.Marshal))) if ue.HasHandoverForTest() { @@ -485,7 +490,7 @@ func TestHandoverFailureFailsToSource(t *testing.T) { t.Fatalf("parse HANDOVER PREPARATION FAILURE: %v", err) } - if want := (s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 12}); prepFail.Cause == nil || *prepFail.Cause != want { + if want := s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(); prepFail.Cause == nil || !prepFail.Cause.Equal(want) { t.Fatalf("preparation failure cause = %+v, want %+v (relayed target cause)", prepFail.Cause, want) } @@ -500,7 +505,7 @@ func TestHandoverCancelReleasesTarget(t *testing.T) { targetMME, targetENBUEID := driveToPrepared(t, m, ue, source, target) - cancel := &s1ap.HandoverCancel{MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5})} + cancel := &s1ap.HandoverCancel{MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), Cause: s1ap.Ptr(s1ap.CauseRadioNetworkPartialHandover.Cause())} handleHandoverCancel(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, cancel.Marshal))) if ue.HasHandoverForTest() { @@ -517,7 +522,7 @@ func TestHandoverCancelReleasesTarget(t *testing.T) { t.Fatalf("parse target release command: %v", err) } - if want := (s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5}); relCmd.Cause == nil || *relCmd.Cause != want { + if want := s1ap.CauseRadioNetworkPartialHandover.Cause(); relCmd.Cause == nil || !relCmd.Cause.Equal(want) { t.Fatalf("target release cause = %+v, want %+v (relayed cancel cause)", relCmd.Cause, want) } @@ -549,7 +554,7 @@ func TestHandoverCancelDuringPreparationReleasesTarget(t *testing.T) { t.Fatalf("expected one HANDOVER REQUEST to the target, got %d", target.count()) } - cancel := &s1ap.HandoverCancel{MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5})} + cancel := &s1ap.HandoverCancel{MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), Cause: s1ap.Ptr(s1ap.CauseRadioNetworkPartialHandover.Cause())} handleHandoverCancel(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, cancel.Marshal))) if ue.HasHandoverForTest() { @@ -566,11 +571,11 @@ func TestHandoverCancelDuringPreparationReleasesTarget(t *testing.T) { t.Fatalf("parse target release command: %v", err) } - if relCmd.UES1APIDs.Pair { + if relCmd.UES1APIDs.UES1APIDPair != nil { t.Error("a preparing target's release must use the MME-UE-S1AP-ID alone, not the pair") } - if want := (s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5}); relCmd.Cause == nil || *relCmd.Cause != want { + if want := s1ap.CauseRadioNetworkPartialHandover.Cause(); relCmd.Cause == nil || !relCmd.Cause.Equal(want) { t.Fatalf("target release cause = %+v, want %+v (relayed cancel cause)", relCmd.Cause, want) } @@ -610,10 +615,10 @@ func TestHandoverPartialAdmissionReleasesFailedPDN(t *testing.T) { ENBUES1APID: s1ap.Ptr(targetENBUEID), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, }}, - ERABFailedToSetup: []s1ap.ERABItem{{ERABID: 6, Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}}}, + ERABFailedToSetup: []s1ap.ERABItem{{ERABID: 6, Cause: s1ap.CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: s1ap.TransparentContainer{0xaa}, } handleHandoverRequestAcknowledge(context.Background(), m, mme.NewRadioForTest(target), successfulValue(t, mustMarshal(t, ack.Marshal))) @@ -652,7 +657,7 @@ func TestHandoverCancelDuringCommitIgnored(t *testing.T) { targetBefore := target.count() - cancel := &s1ap.HandoverCancel{MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5})} + cancel := &s1ap.HandoverCancel{MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), Cause: s1ap.Ptr(s1ap.CauseRadioNetworkPartialHandover.Cause())} handleHandoverCancel(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, cancel.Marshal))) if !ue.HasHandoverForTest() { @@ -707,7 +712,7 @@ func TestHandoverGuardTimerAbandons(t *testing.T) { t.Fatalf("parse target release command: %v", err) } - if want := (s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 8}); relCmd.Cause == nil || *relCmd.Cause != want { + if want := s1ap.CauseRadioNetworkTS1RelocOverallExpiry.Cause(); relCmd.Cause == nil || !relCmd.Cause.Equal(want) { t.Fatalf("target release cause = %+v, want %+v (tS1relocoverall-expiry)", relCmd.Cause, want) } } @@ -733,10 +738,10 @@ func TestHandoverPartialAdmissionKeepsSurvivingPDN(t *testing.T) { ENBUES1APID: s1ap.Ptr(targetENBUEID), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: 6, - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, }}, - ERABFailedToSetup: []s1ap.ERABItem{{ERABID: s1ap.ERABID(mme.DefaultERABID), Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}}}, + ERABFailedToSetup: []s1ap.ERABItem{{ERABID: s1ap.ERABID(mme.DefaultERABID), Cause: s1ap.CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: s1ap.TransparentContainer{0xaa}, } handleHandoverRequestAcknowledge(context.Background(), m, mme.NewRadioForTest(target), successfulValue(t, mustMarshal(t, ack.Marshal))) @@ -808,7 +813,7 @@ func TestHandoverNotifyUnknownMMEUES1APIDSendsErrorIndication(t *testing.T) { t.Fatalf("Error Indication eNB-UE-S1AP-ID = %v, want %d", ind.ENBUES1APID, targetENB) } - if ind.Cause == nil || *ind.Cause != causeUnknownMMEUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownMMEUES1APID) { t.Fatalf("Error Indication cause = %v, want unknown-mme-ue-s1ap-id", ind.Cause) } @@ -851,7 +856,7 @@ func TestHandoverNotifyInconsistentENBUES1APIDSendsErrorIndication(t *testing.T) t.Fatalf("Error Indication eNB-UE-S1AP-ID = %v, want %d", ind.ENBUES1APID, wrongENB) } - if ind.Cause == nil || ind.Cause.Group != s1ap.CauseGroupRadioNetwork { + if ind.Cause == nil || ind.Cause.RadioNetwork == nil { t.Fatalf("Error Indication cause = %v, want a radio-network cause", ind.Cause) } @@ -950,8 +955,8 @@ func TestHandoverTargetResetAborts(t *testing.T) { targetMME, _ := driveToPrepared(t, m, ue, source, target) - cause := s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 0} - handleReset(context.Background(), m, mme.NewRadioForTest(target), resetValue(t, &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: s1ap.ResetType{All: true}})) + cause := s1ap.CauseMiscControlProcessingOverload.Cause() + handleReset(context.Background(), m, mme.NewRadioForTest(target), resetValue(t, &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: s1ap.ResetType{S1Interface: s1ap.Ptr(s1ap.ResetAllResetAll)}})) if ue.HasHandoverForTest() { t.Fatal("handover not aborted by a reset on the target eNB") @@ -1023,7 +1028,7 @@ func TestHandoverRequestAcknowledge_NoMatchingPreparation_DoesNotReleaseLiveUE(t ack := &s1ap.HandoverRequestAcknowledge{ MMEUES1APID: s1ap.Ptr(ue.Conn().MMEUES1APID), ENBUES1APID: s1ap.Ptr(ue.Conn().ENBUES1APID()), - ERABAdmitted: []s1ap.ERABAdmittedItem{{ERABID: s1ap.ERABID(mme.DefaultERABID), TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, GTPTEID: 0x99}}, + ERABAdmitted: []s1ap.ERABAdmittedItem{{ERABID: s1ap.ERABID(mme.DefaultERABID), TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99}}, TargetToSource: s1ap.TransparentContainer{0xaa}, } @@ -1074,7 +1079,7 @@ func TestHandoverCancelFromTheTargetLeavesTheHandoverStanding(t *testing.T) { cancel := &s1ap.HandoverCancel{ MMEUES1APID: targetMME, ENBUES1APID: targetENBUEID, - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 5}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkPartialHandover.Cause()), } handleHandoverCancel(context.Background(), m, mme.NewRadioForTest(target), initiatingValue(t, mustMarshal(t, cancel.Marshal))) @@ -1152,9 +1157,9 @@ func handoverForwardingExchangeFull(t *testing.T, directPath bool) forwardingExc ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(55)), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, - DLTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 3}, + DLTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3})), DLGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xfeed)), }}, TargetToSource: s1ap.TransparentContainer{0xaa}, @@ -1178,7 +1183,7 @@ func handoverForwardingExchangeFull(t *testing.T, directPath bool) forwardingExc func TestHandoverRelaysForwardingEndpointOnDirectPath(t *testing.T) { hoReq, cmd := handoverForwardingExchange(t, true) - if ext := hoReq.ERABToBeSetup[0].Extensions; ext != nil && ext.DataForwardingNotPossible != nil { + if hoReq.ERABToBeSetup[0].DataForwardingNotPossible != nil { t.Error("HANDOVER REQUEST still declared data forwarding not possible") } @@ -1195,7 +1200,7 @@ func TestHandoverRelaysForwardingEndpointOnDirectPath(t *testing.T) { t.Errorf("forwarded DL GTP-TEID = %v, want 0xfeed", item.DLGTPTEID) } - if got := []byte(item.DLTransportLayerAddr); string(got) != string([]byte{10, 4, 0, 3}) { + if got := item.DLTransportLayerAddr; got == nil || *got != ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3}) { t.Errorf("forwarded DL transport layer address = %v, want 10.4.0.3", got) } } @@ -1203,7 +1208,7 @@ func TestHandoverRelaysForwardingEndpointOnDirectPath(t *testing.T) { func TestHandoverWithoutDirectPathForwardsIndirectly(t *testing.T) { hoReq, cmd, sessions := handoverForwardingExchangeSessions(t, false) - if ext := hoReq.ERABToBeSetup[0].Extensions; ext != nil && ext.DataForwardingNotPossible != nil { + if hoReq.ERABToBeSetup[0].DataForwardingNotPossible != nil { t.Error("HANDOVER REQUEST declared data forwarding not possible, so the target allocates no endpoint") } @@ -1217,7 +1222,7 @@ func TestHandoverWithoutDirectPathForwardsIndirectly(t *testing.T) { t.Errorf("forwarded DL GTP-TEID = %v, want the UPF's 0xABCD", item.DLGTPTEID) } - if got := []byte(item.DLTransportLayerAddr); string(got) != string([]byte{192, 168, 1, 1}) { + if got := item.DLTransportLayerAddr; got == nil || *got != ap.TransportLayerAddressFromOctets([]byte{192, 168, 1, 1}) { t.Errorf("forwarded DL transport layer address = %v, want the UPF's 192.168.1.1", got) } @@ -1247,17 +1252,17 @@ func TestHandoverDropsHalfPopulatedForwardingTunnel(t *testing.T) { DLGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xfeed)), }}, {"dl address without a teid", s1ap.ERABAdmittedItem{ - DLTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 3}, + DLTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3})), }}, {"ul teid without an address", s1ap.ERABAdmittedItem{ ULGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xbeef)), }}, {"dl address that is neither ipv4 nor ipv6", s1ap.ERABAdmittedItem{ - DLTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 3, 7}, + DLTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3, 7})), DLGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xfeed)), }}, {"ul address that is neither ipv4 nor ipv6", s1ap.ERABAdmittedItem{ - ULTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 3, 7}, + ULTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3, 7})), ULGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xbeef)), }}, } @@ -1281,7 +1286,7 @@ func TestHandoverDropsHalfPopulatedForwardingTunnel(t *testing.T) { item := tc.item item.ERABID = s1ap.ERABID(mme.DefaultERABID) - item.TransportLayerAddress = s1ap.TransportLayerAddress{10, 4, 0, 2} + item.TransportLayerAddress = ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}) item.GTPTEID = 0x99 ack := &s1ap.HandoverRequestAcknowledge{ @@ -1329,11 +1334,11 @@ func TestHandoverDropsOnlyTheUnusableForwardingDirection(t *testing.T) { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(55)), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, - DLTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 3, 7}, + DLTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3, 7})), DLGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xfeed)), - ULTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 4}, + ULTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 4})), ULGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xbeef)), }}, TargetToSource: s1ap.TransparentContainer{0xaa}, @@ -1359,7 +1364,7 @@ func TestHandoverDropsOnlyTheUnusableForwardingDirection(t *testing.T) { item.DLTransportLayerAddr, item.DLGTPTEID) } - if got := []byte(item.ULTransportLayerAddr); string(got) != string([]byte{10, 4, 0, 4}) { + if got := item.ULTransportLayerAddr; got == nil || *got != ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 4}) { t.Errorf("forwarded UL transport layer address = %v, want 10.4.0.4", got) } @@ -1394,7 +1399,7 @@ func TestHandoverFailureReleasesForwardingTunnel(t *testing.T) { fail := &s1ap.HandoverFailure{ MMEUES1APID: s1ap.Ptr(x.hoReq.MMEUES1APID), - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 12}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause()), } handleHandoverFailure(context.Background(), x.m, mme.NewRadioForTest(x.target), unsuccessfulValue(t, mustMarshal(t, fail.Marshal))) @@ -1429,7 +1434,7 @@ func TestHandoverCancelAfterCompletionKeepsForwardingTunnel(t *testing.T) { cancel := &s1ap.HandoverCancel{ MMEUES1APID: x.hoReq.MMEUES1APID, ENBUES1APID: s1ap.ENBUES1APID(55), - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 12}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause()), } handleHandoverCancel(context.Background(), x.m, mme.NewRadioForTest(x.source), initiatingValue(t, mustMarshal(t, cancel.Marshal))) @@ -1465,9 +1470,9 @@ func TestHandoverForwardingEndpointIsDualStack(t *testing.T) { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(55)), ERABAdmitted: []s1ap.ERABAdmittedItem{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 0x99, - DLTransportLayerAddr: s1ap.TransportLayerAddress{10, 4, 0, 3}, + DLTransportLayerAddr: s1ap.Ptr(ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 3})), DLGTPTEID: s1ap.Ptr(s1ap.GTPTEID(0xfeed)), }}, TargetToSource: s1ap.TransparentContainer{0xaa}, @@ -1489,7 +1494,7 @@ func TestHandoverForwardingEndpointIsDualStack(t *testing.T) { t.Fatalf("E-RABSubjecttoDataForwardingList has %d items, want 1", len(cmd.ERABSubjecttoDataForwarding)) } - if got := len(cmd.ERABSubjecttoDataForwarding[0].DLTransportLayerAddr); got != 20 { - t.Fatalf("forwarding transport layer address is %d octets, want the 20-octet dual-stack form", got) + if got := cmd.ERABSubjecttoDataForwarding[0].DLTransportLayerAddr; got == nil || got.Bits() != 160 { + t.Fatalf("forwarding transport layer address is %v, want the 160-bit dual-stack form", got) } } diff --git a/internal/mme/s1ap/handover_to_5gs_test.go b/internal/mme/s1ap/handover_to_5gs_test.go index eab5361df3..1c8ac5ce11 100644 --- a/internal/mme/s1ap/handover_to_5gs_test.go +++ b/internal/mme/s1ap/handover_to_5gs_test.go @@ -125,11 +125,11 @@ func relocatingToFiveGSUE(t *testing.T, m *mme.MME, peer *fiveGSPeerStub) (*mme. func handoverRequiredToGNB(ue *mme.UeContext) *s1ap.HandoverRequired { req := sampleHandoverRequired(ue) req.HandoverType = s1ap.HandoverTypeEPSToFiveGS - req.Cause = s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkTimeCriticalHandover}) + req.Cause = s1ap.Ptr(s1ap.CauseRadioNetworkTimeCriticalHandover.Cause()) req.TargetID = s1ap.TargetID{TargetNgRanNodeID: &s1ap.TargetNgRanNodeID{ GlobalRANNodeID: s1ap.GlobalRANNodeID{GNB: &s1ap.GNB{GlobalGNBID: s1ap.GlobalGNBID{ PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, - GNBID: s1ap.GNBID{Value: relocationTargetGNBID, Bits: 24}, + GNBID: s1ap.GNBIdentity{GNBID: &s1ap.GNBID{Value: relocationTargetGNBID, Bits: 24}}, }}}, SelectedTAI: s1ap.FiveGSTAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, }} @@ -224,7 +224,7 @@ func TestHandoverRequiredToFiveGS(t *testing.T) { t.Errorf("selected 5GS TAI = %+v", req.Target.SelectedTAI) } - if req.Cause.Value != s1ap.CauseRadioNetworkTimeCriticalHandover { + if !req.Cause.Equal(s1ap.CauseRadioNetworkTimeCriticalHandover.Cause()) { t.Errorf("cause = %+v, want the source eNB's own", req.Cause) } @@ -379,7 +379,7 @@ func TestHandoverRequiredToFiveGSWithAnENBTarget(t *testing.T) { ue, source := relocatingToFiveGSUE(t, m, peer) req := handoverRequiredToGNB(ue) - req.TargetID = s1ap.TargetID{TargeteNBID: s1ap.TargeteNBID{GlobalENBID: targetGlobalENBID, SelectedTAI: s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}} + req.TargetID = s1ap.TargetID{TargeteNBID: &s1ap.TargeteNBID{GlobalENBID: targetGlobalENBID, SelectedTAI: s1ap.TAI{PLMNIdentity: s1ap.PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}} handleHandoverRequired(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, req.Marshal))) @@ -407,8 +407,8 @@ func TestHandoverRequiredToFiveGSWithNoTransferablePDN(t *testing.T) { t.Fatal("no cause in the preparation failure") } - want := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOTargetNotAllowed} - if *got.Cause != want { + want := s1ap.CauseRadioNetworkHOTargetNotAllowed.Cause() + if !got.Cause.Equal(want) { t.Errorf("cause = %+v, want ho-target-not-allowed", *got.Cause) } @@ -565,7 +565,7 @@ func handoverCancel(ue *mme.UeContext) *s1ap.HandoverCancel { return &s1ap.HandoverCancel{ MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHandoverCancelled}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverCancelled.Cause()), } } @@ -701,7 +701,7 @@ func TestSourceENBLossLeavesTheArrivalToThePeersGuard(t *testing.T) { func TestHandoverToFiveGSRelaysTheTargetsCause(t *testing.T) { m := newTestMME(t) - want := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell} + want := s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause() peer := &fiveGSPeerStub{err: interworking.TargetRefusal{Cause: want}} ue, source := relocatingToFiveGSUE(t, m, peer) @@ -715,7 +715,7 @@ func TestHandoverToFiveGSRelaysTheTargetsCause(t *testing.T) { t.Fatal("the refusal reached the source eNB without a cause") } - if *fail.Cause != want { + if !fail.Cause.Equal(want) { t.Errorf("cause = %+v, want the target's own %+v", *fail.Cause, want) } } @@ -792,8 +792,8 @@ func TestHandoverToFiveGSReleasesAPDNThatCannotMove(t *testing.T) { t.Fatalf("to-release list = %+v, want the PDN that cannot move", cmd.ERABToRelease) } - want := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkS1InterSystemHandoverTriggered} - if cmd.ERABToRelease[0].Cause != want { + want := s1ap.CauseRadioNetworkS1InterSystemHandoverTriggered.Cause() + if !cmd.ERABToRelease[0].Cause.Equal(want) { t.Errorf("cause = %+v, want s1-inter-system-handover-triggered", cmd.ERABToRelease[0].Cause) } } diff --git a/internal/mme/s1ap/idle_mobility_from_5gs_test.go b/internal/mme/s1ap/idle_mobility_from_5gs_test.go index 2dc08641a3..73c7d41704 100644 --- a/internal/mme/s1ap/idle_mobility_from_5gs_test.go +++ b/internal/mme/s1ap/idle_mobility_from_5gs_test.go @@ -127,8 +127,9 @@ func TestInterSystemTAUWithNoRecoverableContextIsRejected(t *testing.T) { t.Fatalf("TAU Reject cause = %d, want #%d", rej.Cause, tc.wantCause) } - if cmd := parseUEContextReleaseCommand(t, lastSent(t, conn)); cmd.UES1APIDs.ENBUES1APID != 1001 { - t.Errorf("release command names eNB-UE-S1AP-ID %d, want the rejected connection's 1001", cmd.UES1APIDs.ENBUES1APID) + cmd := parseUEContextReleaseCommand(t, lastSent(t, conn)) + if enbID, _ := cmd.UES1APIDs.ENBID(); enbID != 1001 { + t.Errorf("release command names eNB-UE-S1AP-ID %d, want the rejected connection's 1001", enbID) } }) } diff --git a/internal/mme/s1ap/interworking_conformance_test.go b/internal/mme/s1ap/interworking_conformance_test.go index f14350f9f5..593fabcf86 100644 --- a/internal/mme/s1ap/interworking_conformance_test.go +++ b/internal/mme/s1ap/interworking_conformance_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/internal/mme" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -22,7 +23,7 @@ func icsResponseFor(t *testing.T, m *mme.MME, cc *captureConn, ue *mme.UeContext for _, ebi := range ebis { rsp.ERABSetup = append(rsp.ERABSetup, s1ap.ERABSetupItemCtxtSURes{ ERABID: s1ap.ERABID(ebi), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 3, 0, 3}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 3, 0, 3}), GTPTEID: s1ap.GTPTEID(0x90 + uint32(ebi)), }) } diff --git a/internal/mme/s1ap/mme_config_update_test.go b/internal/mme/s1ap/mme_config_update_test.go index 33bf6a89f5..01fb82d9ee 100644 --- a/internal/mme/s1ap/mme_config_update_test.go +++ b/internal/mme/s1ap/mme_config_update_test.go @@ -28,7 +28,7 @@ func TestMMEConfigurationUpdateOutcomesAreRouted(t *testing.T) { t.Helper() b := mustMarshal(t, (&s1ap.MMEConfigurationUpdateFailure{ - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolSemanticError}), + Cause: s1ap.Ptr(s1ap.CauseProtocolSemanticError.Cause()), TimeToWait: s1ap.Ptr(s1ap.TimeToWait(1)), }).Marshal) diff --git a/internal/mme/s1ap/mme_nas_test.go b/internal/mme/s1ap/mme_nas_test.go index 9fe8691030..616e78335d 100644 --- a/internal/mme/s1ap/mme_nas_test.go +++ b/internal/mme/s1ap/mme_nas_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -25,7 +26,7 @@ func TestInitialContextSetupResponseRelaysENBFTEID(t *testing.T) { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(7)), ERABSetup: []s1ap.ERABSetupItemCtxtSURes{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress([]byte{10, 3, 0, 3}), + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 3, 0, 3}), GTPTEID: s1ap.GTPTEID(0x55), }}, } @@ -85,7 +86,7 @@ func TestInitialContextSetupResponseENBTransportFamily(t *testing.T) { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(7)), ERABSetup: []s1ap.ERABSetupItemCtxtSURes{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress(tc.tla), + TransportLayerAddress: ap.TransportLayerAddressFromOctets(tc.tla), GTPTEID: s1ap.GTPTEID(0x55), }}, } @@ -126,12 +127,12 @@ func TestInitialContextSetupResponseMultipleERABs(t *testing.T) { ERABSetup: []s1ap.ERABSetupItemCtxtSURes{ { ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress([]byte{10, 3, 0, 3}), + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 3, 0, 3}), GTPTEID: s1ap.GTPTEID(0x55), }, { ERABID: s1ap.ERABID(6), - TransportLayerAddress: s1ap.TransportLayerAddress([]byte{10, 3, 0, 4}), + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 3, 0, 4}), GTPTEID: s1ap.GTPTEID(0x66), }, }, @@ -178,12 +179,12 @@ func TestInitialContextSetupResponseReleasesFailedERAB(t *testing.T) { ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(7)), ERABSetup: []s1ap.ERABSetupItemCtxtSURes{{ ERABID: s1ap.ERABID(mme.DefaultERABID), - TransportLayerAddress: s1ap.TransportLayerAddress([]byte{10, 3, 0, 3}), + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 3, 0, 3}), GTPTEID: s1ap.GTPTEID(0x55), }}, ERABFailedToSetup: []s1ap.ERABItem{{ ERABID: s1ap.ERABID(6), - Cause: s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}, + Cause: s1ap.CauseRadioNetworkUnspecified.Cause(), }}, } @@ -232,7 +233,7 @@ func TestInitialContextSetupFailureAbortsUE(t *testing.T) { fail := &s1ap.InitialContextSetupFailure{ MMEUES1APID: s1ap.Ptr(mmeID), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(7)), - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupTransport, Value: s1ap.CauseTransportResourceUnavailable}), + Cause: s1ap.Ptr(s1ap.CauseTransportResourceUnavailable.Cause()), } b, err := fail.Marshal() diff --git a/internal/mme/s1ap/path_switch_conformance_test.go b/internal/mme/s1ap/path_switch_conformance_test.go index 2a31bf0db2..d693714dce 100644 --- a/internal/mme/s1ap/path_switch_conformance_test.go +++ b/internal/mme/s1ap/path_switch_conformance_test.go @@ -13,6 +13,7 @@ import ( "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -103,7 +104,7 @@ func pathSwitchUEWithSecondPDN(t *testing.T, m *mme.MME) (*mme.UeContext, *mme.P func switchedDLItemFor(ebi uint8, teid uint32) s1ap.ERABToBeSwitchedDLItem { return s1ap.ERABToBeSwitchedDLItem{ ERABID: s1ap.ERABID(ebi), - TransportLayerAddress: s1ap.TransportLayerAddress{10, 4, 0, 2}, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: s1ap.GTPTEID(teid), } } diff --git a/internal/mme/s1ap/protocol_error_indication_test.go b/internal/mme/s1ap/protocol_error_indication_test.go index b057896543..902078dc2f 100644 --- a/internal/mme/s1ap/protocol_error_indication_test.go +++ b/internal/mme/s1ap/protocol_error_indication_test.go @@ -24,8 +24,8 @@ func TestSendProtocolErrorIndication(t *testing.T) { ind := parseOutboundErrorIndication(t, cc.sent[0]) - want := s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolTransferSyntaxError} - if ind.Cause == nil || *ind.Cause != want { + want := s1ap.CauseProtocolTransferSyntaxError.Cause() + if ind.Cause == nil || !ind.Cause.Equal(want) { t.Fatalf("cause = %v, want transfer-syntax-error", ind.Cause) } @@ -40,7 +40,7 @@ func TestUnknownProcedure_SendsErrorIndication(t *testing.T) { name string crit s1ap.Criticality wantReply bool - wantCause int + wantCause s1ap.CauseProtocol }{ {"reject", s1ap.CriticalityReject, true, s1ap.CauseProtocolAbstractSyntaxErrorReject}, {"ignore-and-notify", s1ap.CriticalityNotify, true, s1ap.CauseProtocolAbstractSyntaxErrorIgnoreAndNotify}, @@ -71,8 +71,8 @@ func TestUnknownProcedure_SendsErrorIndication(t *testing.T) { ind := parseOutboundErrorIndication(t, cc.sent[0]) - wantCause := s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: tt.wantCause} - if ind.Cause == nil || *ind.Cause != wantCause { + wantCause := tt.wantCause.Cause() + if ind.Cause == nil || !ind.Cause.Equal(wantCause) { t.Fatalf("cause = %v, want protocol cause %d", ind.Cause, tt.wantCause) } diff --git a/internal/mme/s1ap/reject_paths_test.go b/internal/mme/s1ap/reject_paths_test.go index 575ad016f5..2fe19c2b05 100644 --- a/internal/mme/s1ap/reject_paths_test.go +++ b/internal/mme/s1ap/reject_paths_test.go @@ -107,11 +107,8 @@ func TestENBConfigurationUpdateRejectionAnswers(t *testing.T) { t.Fatalf("parse failure: %v", err) } - want := s1ap.Cause{ - Group: s1ap.CauseGroupProtocol, - Value: s1ap.CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage, - } - if fail.Cause == nil || *fail.Cause != want { + want := s1ap.CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage.Cause() + if fail.Cause == nil || !fail.Cause.Equal(want) { t.Errorf("cause = %v, want falsely-constructed-message", fail.Cause) } } diff --git a/internal/mme/s1ap/release_test.go b/internal/mme/s1ap/release_test.go index 209a12ce2f..4961202858 100644 --- a/internal/mme/s1ap/release_test.go +++ b/internal/mme/s1ap/release_test.go @@ -65,7 +65,7 @@ func TestUEContextReleaseRequestFromENB(t *testing.T) { req := &s1ap.UEContextReleaseRequest{ MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: 7, - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), } b, _ := req.Marshal() @@ -108,7 +108,7 @@ func TestUEContextReleaseRequestFromENB(t *testing.T) { } ind := parseOutboundErrorIndication(t, cc.sent[1]) - if ind.Cause == nil || *ind.Cause != causeUnknownMMEUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownMMEUES1APID) { t.Fatalf("expected cause unknown-mme-ue-s1ap-id, got %v", ind.Cause) } } @@ -119,7 +119,7 @@ func TestUEContextReleaseRequestFromForeignENB(t *testing.T) { req := &s1ap.UEContextReleaseRequest{ MMEUES1APID: ue.Conn().MMEUES1APID, ENBUES1APID: ue.Conn().ENBUES1APID(), - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 0}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkUnspecified.Cause()), } b, _ := req.Marshal() @@ -141,7 +141,7 @@ func TestUEContextReleaseRequestFromForeignENB(t *testing.T) { } ind := parseOutboundErrorIndication(t, foreign.sent[0]) - if ind.Cause == nil || *ind.Cause != causeUnknownMMEUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownMMEUES1APID) { t.Fatalf("expected cause unknown-mme-ue-s1ap-id, got %v", ind.Cause) } } diff --git a/internal/mme/s1ap/resolve_ue_test.go b/internal/mme/s1ap/resolve_ue_test.go index ad62b35f67..7dd4ac4951 100644 --- a/internal/mme/s1ap/resolve_ue_test.go +++ b/internal/mme/s1ap/resolve_ue_test.go @@ -52,7 +52,7 @@ func TestResolveUEUnknownMMEUES1APIDSendsErrorIndication(t *testing.T) { t.Fatalf("expected eNB-UE-S1AP-ID 7, got %v", ind.ENBUES1APID) } - if ind.Cause == nil || *ind.Cause != causeUnknownMMEUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownMMEUES1APID) { t.Fatalf("expected cause unknown-mme-ue-s1ap-id, got %v", ind.Cause) } } @@ -80,7 +80,7 @@ func TestResolveUEInconsistentENBUES1APIDSendsErrorIndication(t *testing.T) { t.Fatalf("expected the received eNB-UE-S1AP-ID 99, got %v", ind.ENBUES1APID) } - if ind.Cause == nil || *ind.Cause != causeUnknownPairUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownPairUES1APID) { t.Fatalf("expected cause unknown-pair-ue-s1ap-id, got %v", ind.Cause) } } diff --git a/internal/mme/s1ap/robustness_test.go b/internal/mme/s1ap/robustness_test.go index 12a6074cb6..92a2eeb3ad 100644 --- a/internal/mme/s1ap/robustness_test.go +++ b/internal/mme/s1ap/robustness_test.go @@ -24,7 +24,7 @@ func TestHandleParseError_EmitsErrorIndication(t *testing.T) { ind := parseOutboundErrorIndication(t, cc.sent[0]) - if ind.Cause == nil || ind.Cause.Group != s1ap.CauseGroupProtocol { + if ind.Cause == nil || ind.Cause.Protocol == nil { t.Errorf("cause = %+v, want protocol group", ind.Cause) } diff --git a/internal/mme/s1ap/s1_setup_outcome_test.go b/internal/mme/s1ap/s1_setup_outcome_test.go index 02118b5058..ec2657b27f 100644 --- a/internal/mme/s1ap/s1_setup_outcome_test.go +++ b/internal/mme/s1ap/s1_setup_outcome_test.go @@ -97,7 +97,7 @@ func TestS1SetupOutcomeRejectsUnknownPLMN(t *testing.T) { t.Fatalf("parse failure: %v", err) } - if fail.Cause == nil || *fail.Cause != causeUnknownPLMN { + if fail.Cause == nil || !fail.Cause.Equal(causeUnknownPLMN) { t.Fatalf("cause = %+v, want %+v (Misc/unknown-PLMN)", fail.Cause, causeUnknownPLMN) } } @@ -131,7 +131,7 @@ func TestS1SetupOutcomeRejectsUnknownTAC(t *testing.T) { t.Fatalf("parse failure: %v", err) } - if fail.Cause == nil || *fail.Cause != causeNoServedTAC { + if fail.Cause == nil || !fail.Cause.Equal(causeNoServedTAC) { t.Fatalf("cause = %+v, want %+v (Misc/unspecified)", fail.Cause, causeNoServedTAC) } } @@ -146,7 +146,7 @@ func TestS1SetupFailureNamesMissingIEs(t *testing.T) { out, err := buildS1SetupFailure(&s1ap.AbstractSyntaxError{ Procedure: s1ap.ProcS1Setup, Trigger: s1ap.TriggeringInitiatingMessage, - Cause: s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolAbstractSyntaxErrorReject}, + Cause: s1ap.CauseProtocolAbstractSyntaxErrorReject.Cause(), IEs: []s1ap.CriticalityDiagnosticsIEItem{ {IECriticality: s1ap.CriticalityReject, IEID: ieGlobalENBID, TypeOfError: s1ap.TypeOfErrorMissing}, {IECriticality: s1ap.CriticalityReject, IEID: ieSupportedTAs, TypeOfError: s1ap.TypeOfErrorMissing}, @@ -171,8 +171,8 @@ func TestS1SetupFailureNamesMissingIEs(t *testing.T) { t.Fatalf("parse failure: %v", err) } - wantCause := s1ap.Cause{Group: s1ap.CauseGroupProtocol, Value: s1ap.CauseProtocolAbstractSyntaxErrorReject} - if fail.Cause == nil || *fail.Cause != wantCause { + wantCause := s1ap.CauseProtocolAbstractSyntaxErrorReject.Cause() + if fail.Cause == nil || !fail.Cause.Equal(wantCause) { t.Fatalf("cause = %+v, want abstract-syntax-error-reject", fail.Cause) } diff --git a/internal/mme/s1ap/superseded_release_test.go b/internal/mme/s1ap/superseded_release_test.go index e6b578c57e..86016b30be 100644 --- a/internal/mme/s1ap/superseded_release_test.go +++ b/internal/mme/s1ap/superseded_release_test.go @@ -85,7 +85,10 @@ func isReleaseCommandFor(t *testing.T, pdu []byte, mmeID s1ap.MMEUES1APID, enbID t.Fatalf("parse UE Context Release Command: %v", err) } - return cmd.UES1APIDs.MMEUES1APID == mmeID && cmd.UES1APIDs.ENBUES1APID == enbID + gotMME, _ := cmd.UES1APIDs.MMEID() + gotENB, _ := cmd.UES1APIDs.ENBID() + + return gotMME == mmeID && gotENB == enbID } func isErrorIndication(t *testing.T, pdu []byte) bool { @@ -131,7 +134,7 @@ func TestSupersededConnectionReleaseRequestNoErrorIndication(t *testing.T) { relReq, err := (&s1ap.UEContextReleaseRequest{ MMEUES1APID: oldMMEID, ENBUES1APID: oldENBID, - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioConnectionWithUELost}), + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkRadioConnectionWithUELost.Cause()), }).Marshal() if err != nil { t.Fatal(err) @@ -163,7 +166,7 @@ func TestDetachedReleaseRequestGuardsAndDedups(t *testing.T) { t.Fatal("failed to allocate a bare connection") } - cause := s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASNormalRelease} + cause := s1ap.CauseNASNormalRelease.Cause() if !m.AnswerDetachedRelease(context.Background(), cc, bare.MMEUES1APID, enbID, cause) { t.Fatal("AnswerDetachedRelease did not match the detached connection") diff --git a/internal/mme/s1ap/uplink_nas_test.go b/internal/mme/s1ap/uplink_nas_test.go index 062038db1b..0937030f4b 100644 --- a/internal/mme/s1ap/uplink_nas_test.go +++ b/internal/mme/s1ap/uplink_nas_test.go @@ -43,7 +43,7 @@ func TestUplinkNASTransportUnknownUE(t *testing.T) { t.Fatalf("expected the received AP-ID pair (999, 7), got (%v, %v)", ind.MMEUES1APID, ind.ENBUES1APID) } - if ind.Cause == nil || *ind.Cause != causeUnknownMMEUES1APID { + if ind.Cause == nil || !ind.Cause.Equal(causeUnknownMMEUES1APID) { t.Fatalf("expected cause unknown-mme-ue-s1ap-id, got %v", ind.Cause) } } diff --git a/internal/mme/ue_context_release.go b/internal/mme/ue_context_release.go index d2692247b9..f3ecd54261 100644 --- a/internal/mme/ue_context_release.go +++ b/internal/mme/ue_context_release.go @@ -49,7 +49,7 @@ func (c *UeConn) SuperviseICS(ctx context.Context) { // causeSupersededConnection is the release cause for the old S1 connection when a UE // re-establishes on a new one: a normal release of the superseded NAS signalling // connection (TS 36.413 §8.3.3.1). -var causeSupersededConnection = s1ap.Cause{Group: s1ap.CauseGroupNAS, Value: s1ap.CauseNASNormalRelease} +var causeSupersededConnection = s1ap.CauseNASNormalRelease.Cause() // releaseSupersededConn releases the detached old connection toward the eNB and guards // the Release Complete (TS 36.413 §8.3.3.1). @@ -133,7 +133,7 @@ func (c *UeConn) sendUEContextReleaseCommand(ctx context.Context, cause s1ap.Cau } cmd := &s1ap.UEContextReleaseCommand{ - UES1APIDs: s1ap.UES1APIDs{MMEUES1APID: c.MMEUES1APID, ENBUES1APID: c.ENBUES1APID(), Pair: true}, + UES1APIDs: ueS1APIDs(c.MMEUES1APID, c.ENBUES1APID(), true), Cause: s1ap.Ptr(cause), } @@ -389,3 +389,11 @@ func (m *MME) releaseUEContextLocallyHeld(ctx context.Context, ue *UeContext, ex m.ResumeDeferredServiceRequest(ctx, ue) } + +func ueS1APIDs(mmeUEID s1ap.MMEUES1APID, enbUEID s1ap.ENBUES1APID, pair bool) s1ap.UES1APIDs { + if pair { + return s1ap.UES1APIDs{UES1APIDPair: &s1ap.UES1APIDPair{MMEUES1APID: mmeUEID, ENBUES1APID: enbUEID}} + } + + return s1ap.UES1APIDs{MMEUES1APID: &mmeUEID} +} diff --git a/internal/models/transport_layer_address.go b/internal/models/transport_layer_address.go deleted file mode 100644 index e1f01be997..0000000000 --- a/internal/models/transport_layer_address.go +++ /dev/null @@ -1,64 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package models - -import ( - "fmt" - "net/netip" -) - -// EncodeTransportLayerAddress encodes a GTP-U transport endpoint as the octets of -// the S1AP/NGAP Transport Layer Address (TS 36.413 / TS 38.413, semantics per -// TS 36.414): 4 octets for IPv4, 16 for IPv6, or 20 (IPv4 followed by IPv6) when -// the endpoint has both. It mirrors how the gNB N3 endpoint is signalled on the -// 5G side so the 4G S1-U endpoint is advertised the same way. -func EncodeTransportLayerAddress(v4, v6 netip.Addr) ([]byte, error) { - haveV4 := v4.IsValid() && v4.Is4() - haveV6 := v6.IsValid() && v6.Is6() - - switch { - case haveV4 && haveV6: - a4 := v4.As4() - a6 := v6.As16() - b := make([]byte, 20) - copy(b[0:4], a4[:]) - copy(b[4:20], a6[:]) - - return b, nil - case haveV6: - a6 := v6.As16() - b := make([]byte, 16) - copy(b, a6[:]) - - return b, nil - case haveV4: - a4 := v4.As4() - b := make([]byte, 4) - copy(b, a4[:]) - - return b, nil - default: - return nil, fmt.Errorf("no valid transport layer address") - } -} - -// DecodeTransportLayerAddress decodes the octets of an S1AP/NGAP Transport Layer -// Address (TS 36.413 / TS 38.413) into its IPv4 and/or IPv6 endpoints: 4 octets -// yield an IPv4 address, 16 an IPv6 address, and 20 both (IPv4 followed by IPv6). -// Either returned address may be the zero value when that family is absent. -func DecodeTransportLayerAddress(b []byte) (v4, v6 netip.Addr, err error) { - switch len(b) { - case 4: - v4, _ = netip.AddrFromSlice(b) - case 16: - v6, _ = netip.AddrFromSlice(b) - case 20: - v4, _ = netip.AddrFromSlice(b[0:4]) - v6, _ = netip.AddrFromSlice(b[4:20]) - default: - return netip.Addr{}, netip.Addr{}, fmt.Errorf("transport layer address: unexpected length %d", len(b)) - } - - return v4, v6, nil -} diff --git a/internal/models/transport_layer_address_test.go b/internal/models/transport_layer_address_test.go deleted file mode 100644 index 605041482a..0000000000 --- a/internal/models/transport_layer_address_test.go +++ /dev/null @@ -1,107 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package models_test - -import ( - "bytes" - "net/netip" - "testing" - - "github.com/ellanetworks/core/internal/models" -) - -func TestEncodeTransportLayerAddress(t *testing.T) { - v4 := netip.AddrFrom4([4]byte{10, 3, 0, 2}) - v6 := netip.MustParseAddr("2001:db8:3::10") - v6Octets := v6.As16() - - tests := []struct { - name string - v4, v6 netip.Addr - want []byte - wantErr bool - }{ - { - name: "ipv4 only is 4 octets", - v4: v4, - want: []byte{10, 3, 0, 2}, - }, - { - name: "ipv6 only is 16 octets", - v6: v6, - want: v6Octets[:], - }, - { - name: "dual stack is ipv4 followed by ipv6", - v4: v4, - v6: v6, - want: append([]byte{10, 3, 0, 2}, v6Octets[:]...), - }, - { - name: "neither is an error", - wantErr: true, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - got, err := models.EncodeTransportLayerAddress(tc.v4, tc.v6) - if tc.wantErr { - if err == nil { - t.Fatal("expected an error for an empty address pair") - } - - return - } - - if err != nil { - t.Fatal(err) - } - - if !bytes.Equal(got, tc.want) { - t.Fatalf("got %v, want %v", got, tc.want) - } - }) - } -} - -func TestDecodeTransportLayerAddress(t *testing.T) { - v4 := netip.AddrFrom4([4]byte{10, 3, 0, 2}) - v6 := netip.MustParseAddr("2001:db8:3::10") - v6Octets := v6.As16() - - tests := []struct { - name string - in []byte - wantV4 netip.Addr - wantV6 netip.Addr - wantErr bool - }{ - {name: "ipv4", in: []byte{10, 3, 0, 2}, wantV4: v4}, - {name: "ipv6", in: v6Octets[:], wantV6: v6}, - {name: "dual stack", in: append([]byte{10, 3, 0, 2}, v6Octets[:]...), wantV4: v4, wantV6: v6}, - {name: "bad length", in: []byte{1, 2, 3}, wantErr: true}, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - gotV4, gotV6, err := models.DecodeTransportLayerAddress(tc.in) - if tc.wantErr { - if err == nil { - t.Fatal("expected an error for a bad length") - } - - return - } - - if err != nil { - t.Fatal(err) - } - - if gotV4 != tc.wantV4 || gotV6 != tc.wantV6 { - t.Fatalf("got v4=%v v6=%v, want v4=%v v6=%v", gotV4, gotV6, tc.wantV4, tc.wantV6) - } - }) - } -} diff --git a/internal/smf/handover.go b/internal/smf/handover.go index 9af1e666e3..e4e317570b 100644 --- a/internal/smf/handover.go +++ b/internal/smf/handover.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/internal/smf/ngap" "github.com/ellanetworks/core/internal/tracing/attrs" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" "go.uber.org/zap" @@ -165,11 +166,16 @@ func (s *SMF) openN2ForwardingTunnel(ctx context.Context, sc *SMContext) error { return nil } - if err := s.openForwardingTunnel(ctx, sc, anchorFromGTPTunnel(plan.DLForwardingUPTNLInformation.GTPTunnel)); err != nil { + forwarding, err := anchorFromGTPTunnel(*plan.DLForwardingUPTNLInformation) + if err != nil { + return err + } + + if err := s.openForwardingTunnel(ctx, sc, forwarding); err != nil { return err } - addr, err := ngap.EncodeTransportLayerAddress(sc.Tunnel.N3IPv4, sc.Tunnel.N3IPv6) + addr, err := ap.TransportLayerAddressFromAddrs(sc.Tunnel.N3IPv4, sc.Tunnel.N3IPv6) if err != nil { return fmt.Errorf("encode the forwarding tunnel's transport layer address: %w", err) } @@ -274,7 +280,11 @@ func handleHandoverRequestAcknowledgeTransfer(b []byte, smContext *SMContext) er return err } - target := anchorFromGTPTunnel(transfer.DLNGUUPTNLInformation.GTPTunnel) + target, err := anchorFromGTPTunnel(transfer.DLNGUUPTNLInformation) + if err != nil { + return err + } + smContext.handoverTargetAN = &target if smContext.handoverForwarding != ngap.DataForwardingNone { @@ -443,7 +453,7 @@ func anchorFromPathSwitchRequest(b []byte, smContext *SMContext) (AnchorBinding, return AnchorBinding{}, err } - return anchorFromGTPTunnel(pathSwitchRequestTransfer.DLNGUUPTNLInformation.GTPTunnel), nil + return anchorFromGTPTunnel(pathSwitchRequestTransfer.DLNGUUPTNLInformation) } func (s *SMF) UpdateSmContextXnHandoverFailed(ctx context.Context, smContextRef string, n2Data []byte) error { diff --git a/internal/smf/handover_from_eps_test.go b/internal/smf/handover_from_eps_test.go index 53b8d66502..b10d386624 100644 --- a/internal/smf/handover_from_eps_test.go +++ b/internal/smf/handover_from_eps_test.go @@ -213,7 +213,7 @@ func TestRefusedArrivalLeavesThePDNConnectionOnEPS(t *testing.T) { sc, ref, _, pfcpBefore := prepareArrival(t, s, upf) refused, err := (&libngap.HandoverResourceAllocationUnsuccessfulTransfer{ - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: libngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }).Marshal() if err != nil { t.Fatalf("build the refusal transfer: %v", err) diff --git a/internal/smf/ipv6_integration_test.go b/internal/smf/ipv6_integration_test.go index cb9498f91e..150f6a1201 100644 --- a/internal/smf/ipv6_integration_test.go +++ b/internal/smf/ipv6_integration_test.go @@ -14,6 +14,7 @@ import ( "github.com/ellanetworks/core/internal/smf" "github.com/ellanetworks/core/nas/fgs" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) // buildPDUSessionEstRequestWithType builds a NAS PDU Session Establishment @@ -68,8 +69,8 @@ func ipv6Fakes() (*fakePCF, *fakeStore, *fakeUPF, *fakeAMF) { func buildPDUSessionResourceSetupResponseTransferIPv6(teid uint32, ip net.IP) ([]byte, error) { transfer := libngap.PDUSessionResourceSetupResponseTransfer{ DLQosFlowPerTNLInformation: libngap.QosFlowPerTNLInformation{ - UPTransportLayerInformation: libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress(ip.To16()), + UPTransportLayerInformation: libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets(ip.To16()), GTPTEID: libngap.GTPTEID(teid), }}, AssociatedQosFlowList: libngap.AssociatedQosFlowList{{QosFlowIdentifier: 1}}, diff --git a/internal/smf/lifecycle_test.go b/internal/smf/lifecycle_test.go index 1553c92302..f87efdce92 100644 --- a/internal/smf/lifecycle_test.go +++ b/internal/smf/lifecycle_test.go @@ -22,6 +22,7 @@ import ( "github.com/ellanetworks/core/internal/udm" "github.com/ellanetworks/core/nas/fgs" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) func TestMain(m *testing.M) { @@ -2183,8 +2184,8 @@ func testTunnel(teid uint32, ip net.IP) libngap.UPTransportLayerInformation { addr = ip.To16() } - return libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress(addr), + return libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets(addr), GTPTEID: libngap.GTPTEID(teid), }} } diff --git a/internal/smf/modify.go b/internal/smf/modify.go index f1634b0398..66fe5bdbfc 100644 --- a/internal/smf/modify.go +++ b/internal/smf/modify.go @@ -81,5 +81,10 @@ func handleModifyIndicationTransfer(b []byte) (AnchorBinding, []int64, error) { qfis = append(qfis, int64(item.QosFlowIdentifier)) } - return anchorFromGTPTunnel(transfer.DLQosFlowPerTNLInformation.UPTransportLayerInformation.GTPTunnel), qfis, nil + anchor, err := anchorFromGTPTunnel(transfer.DLQosFlowPerTNLInformation.UPTransportLayerInformation) + if err != nil { + return AnchorBinding{}, nil, err + } + + return anchor, qfis, nil } diff --git a/internal/smf/n2_forwarding_test.go b/internal/smf/n2_forwarding_test.go index 3190e00768..50b348bafb 100644 --- a/internal/smf/n2_forwarding_test.go +++ b/internal/smf/n2_forwarding_test.go @@ -13,6 +13,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/internal/smf" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) const ( @@ -40,15 +41,15 @@ func n2HandoverAcknowledge(t *testing.T, teid uint32, ip net.IP, forwardingTEID t.Helper() transfer := libngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress(ip.To4()), GTPTEID: libngap.GTPTEID(teid), + DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets(ip.To4()), GTPTEID: libngap.GTPTEID(teid), }}, QosFlowSetupResponse: libngap.QosFlowListWithDataForwarding{{ QosFlowIdentifier: libngap.QosFlowIdentifier(models.DefaultQFI), DataForwardingAccepted: libngap.Ptr(libngap.DataForwardingAcceptedTrue), }}, - DLForwardingUPTNLInformation: &libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress(ip.To4()), GTPTEID: libngap.GTPTEID(forwardingTEID), + DLForwardingUPTNLInformation: &libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets(ip.To4()), GTPTEID: libngap.GTPTEID(forwardingTEID), }}, } @@ -274,7 +275,7 @@ func TestN2HandoverFailureReleasesForwardingTunnel(t *testing.T) { s, upf, ref, ctx := n2HandoverToForwarding(t) unsuccessful := libngap.HandoverResourceAllocationUnsuccessfulTransfer{ - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: libngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), } b, err := unsuccessful.Marshal() @@ -335,7 +336,7 @@ func TestN2HandoverForwardingEndpointIsDualStack(t *testing.T) { t.Fatal("the Handover Command carried no forwarding endpoint") } - if got := len(command.DLForwardingUPTNLInformation.GTPTunnel.TransportLayerAddress); got != 20 { - t.Fatalf("forwarding transport layer address is %d octets, want the 20-octet dual-stack form", got) + if got := command.DLForwardingUPTNLInformation.GTPTunnel.TransportLayerAddress.Bits(); got != 160 { + t.Fatalf("forwarding transport layer address is %d bits, want the 160-bit dual-stack form", got) } } diff --git a/internal/smf/ngap/build_handover_command_transfer.go b/internal/smf/ngap/build_handover_command_transfer.go index 9ecc3d5c59..2453ceb6d3 100644 --- a/internal/smf/ngap/build_handover_command_transfer.go +++ b/internal/smf/ngap/build_handover_command_transfer.go @@ -7,7 +7,6 @@ package ngap import ( "fmt" - "net/netip" libngap "github.com/ellanetworks/core/ngap" ) @@ -46,7 +45,7 @@ func BuildHandoverCommandTransfer(plan *ForwardingPlan) ([]byte, error) { func (p *ForwardingPlan) RelayThrough(teid uint32, addr libngap.TransportLayerAddress) { p.DLForwardingUPTNLInformation = &libngap.UPTransportLayerInformation{ - GTPTunnel: libngap.GTPTunnel{ + GTPTunnel: &libngap.GTPTunnel{ TransportLayerAddress: addr, GTPTEID: libngap.GTPTEID(teid), }, @@ -54,10 +53,6 @@ func (p *ForwardingPlan) RelayThrough(teid uint32, addr libngap.TransportLayerAd p.DataForwardingResponseDRB = nil } -func EncodeTransportLayerAddress(ipv4, ipv6 netip.Addr) (libngap.TransportLayerAddress, error) { - return encodeTransportLayerAddress(ipv4, ipv6) -} - func ForwardingPlanFrom(ack *libngap.HandoverRequestAcknowledgeTransfer) *ForwardingPlan { if ack == nil { return nil @@ -91,7 +86,7 @@ func ForwardingPlanFrom(ack *libngap.HandoverRequestAcknowledgeTransfer) *Forwar } func forwardingTNL(tnl *libngap.UPTransportLayerInformation) *libngap.UPTransportLayerInformation { - if tnl == nil || !tnl.GTPTunnel.TransportLayerAddress.Valid() { + if tnl == nil || tnl.GTPTunnel == nil || !tnl.GTPTunnel.TransportLayerAddress.Valid() { return nil } diff --git a/internal/smf/ngap/build_path_switch_request_acknowledge_transfer.go b/internal/smf/ngap/build_path_switch_request_acknowledge_transfer.go index b475c34fc8..1c1b7f3820 100644 --- a/internal/smf/ngap/build_path_switch_request_acknowledge_transfer.go +++ b/internal/smf/ngap/build_path_switch_request_acknowledge_transfer.go @@ -10,17 +10,18 @@ import ( "net/netip" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) func BuildPathSwitchRequestAcknowledgeTransfer(teid uint32, n3IPv4 netip.Addr, n3IPv6 netip.Addr) ([]byte, error) { - tla, err := encodeTransportLayerAddress(n3IPv4, n3IPv6) + tla, err := ap.TransportLayerAddressFromAddrs(n3IPv4, n3IPv6) if err != nil { return nil, fmt.Errorf("encode transport layer address failed: %s", err) } transfer := libngap.PathSwitchRequestAcknowledgeTransfer{ ULNGUUPTNLInformation: &libngap.UPTransportLayerInformation{ - GTPTunnel: libngap.GTPTunnel{TransportLayerAddress: tla, GTPTEID: libngap.GTPTEID(teid)}, + GTPTunnel: &libngap.GTPTunnel{TransportLayerAddress: tla, GTPTEID: libngap.GTPTEID(teid)}, }, SecurityIndication: &libngap.SecurityIndication{ IntegrityProtectionIndication: libngap.IntegrityProtectionNotNeeded, diff --git a/internal/smf/ngap/build_pdu_session_resource_modify_confirm_transfer.go b/internal/smf/ngap/build_pdu_session_resource_modify_confirm_transfer.go index 5f39df3ebf..08d01ffda0 100644 --- a/internal/smf/ngap/build_pdu_session_resource_modify_confirm_transfer.go +++ b/internal/smf/ngap/build_pdu_session_resource_modify_confirm_transfer.go @@ -10,19 +10,20 @@ import ( "net/netip" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) // BuildPDUSessionResourceModifyConfirmTransfer encodes the UL NG-U tunnel and // confirmed QoS flows for a PDU Session Resource Modify Confirm (TS 38.413 §8.2.5.2). func BuildPDUSessionResourceModifyConfirmTransfer(teid uint32, n3IPv4 netip.Addr, n3IPv6 netip.Addr, qfis []int64) ([]byte, error) { - tla, err := encodeTransportLayerAddress(n3IPv4, n3IPv6) + tla, err := ap.TransportLayerAddressFromAddrs(n3IPv4, n3IPv6) if err != nil { return nil, fmt.Errorf("encode transport layer address failed: %s", err) } transfer := libngap.PDUSessionResourceModifyConfirmTransfer{ ULNGUUPTNLInformation: libngap.UPTransportLayerInformation{ - GTPTunnel: libngap.GTPTunnel{TransportLayerAddress: tla, GTPTEID: libngap.GTPTEID(teid)}, + GTPTunnel: &libngap.GTPTunnel{TransportLayerAddress: tla, GTPTEID: libngap.GTPTEID(teid)}, }, } diff --git a/internal/smf/ngap/build_pdu_session_resource_release_command_transfer.go b/internal/smf/ngap/build_pdu_session_resource_release_command_transfer.go index 89072d96e8..de706f7418 100644 --- a/internal/smf/ngap/build_pdu_session_resource_release_command_transfer.go +++ b/internal/smf/ngap/build_pdu_session_resource_release_command_transfer.go @@ -13,7 +13,7 @@ import ( func BuildPDUSessionResourceReleaseCommandTransfer() ([]byte, error) { transfer := libngap.PDUSessionResourceReleaseCommandTransfer{ - Cause: libngap.Cause{Group: libngap.CauseGroupNAS, Value: libngap.CauseNASNormalRelease}, + Cause: libngap.CauseNASNormalRelease.Cause(), } buf, err := transfer.Marshal() diff --git a/internal/smf/ngap/build_pdu_session_resource_setup_request_transfer.go b/internal/smf/ngap/build_pdu_session_resource_setup_request_transfer.go index e829bd8118..987823168b 100644 --- a/internal/smf/ngap/build_pdu_session_resource_setup_request_transfer.go +++ b/internal/smf/ngap/build_pdu_session_resource_setup_request_transfer.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/internal/models" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) func BuildPDUSessionResourceSetupRequestTransfer(ambr *models.Ambr, qosData *models.QosData, teid uint32, n3IPv4 netip.Addr, n3IPv6 netip.Addr, pduSessionType libngap.PDUSessionType, erabID uint8, flows []QoSFlow) ([]byte, error) { @@ -61,7 +62,7 @@ func pduSessionResourceSetupRequestTransfer(ambr *models.Ambr, qosData *models.Q return nil, fmt.Errorf("ambr is nil") } - tla, err := encodeTransportLayerAddress(n3IPv4, n3IPv6) + tla, err := ap.TransportLayerAddressFromAddrs(n3IPv4, n3IPv6) if err != nil { return nil, fmt.Errorf("encode transport layer address failed: %s", err) } @@ -70,7 +71,7 @@ func pduSessionResourceSetupRequestTransfer(ambr *models.Ambr, qosData *models.Q // Conditional: present when at least one non-GBR QoS flow is set up. PDUSessionAggregateMaximumBitRate: sessionAMBR(ambr), ULNGUUPTNLInformation: libngap.UPTransportLayerInformation{ - GTPTunnel: libngap.GTPTunnel{TransportLayerAddress: tla, GTPTEID: libngap.GTPTEID(teid)}, + GTPTunnel: &libngap.GTPTunnel{TransportLayerAddress: tla, GTPTEID: libngap.GTPTEID(teid)}, }, PDUSessionType: pduSessionType, } diff --git a/internal/smf/ngap/build_qos_flows_modify_request_transfer.go b/internal/smf/ngap/build_qos_flows_modify_request_transfer.go index 77123b1489..3f00b9bffc 100644 --- a/internal/smf/ngap/build_qos_flows_modify_request_transfer.go +++ b/internal/smf/ngap/build_qos_flows_modify_request_transfer.go @@ -63,7 +63,7 @@ func BuildQoSFlowsModifyRequestTransfer(addOrModify []QoSFlow, release []uint8) for _, qfi := range release { transfer.QosFlowToRelease = append(transfer.QosFlowToRelease, libngap.QosFlowWithCauseItem{ QosFlowIdentifier: libngap.QosFlowIdentifier(qfi), - Cause: libngap.Cause{Group: libngap.CauseGroupNAS, Value: libngap.CauseNASNormalRelease}, + Cause: libngap.CauseNASNormalRelease.Cause(), }) } @@ -120,11 +120,11 @@ func ParseModifyUnsuccessful(n2 []byte) (QoSFlowsOutcome, error) { } func handoverTriggered(c libngap.Cause) bool { - if c.Group != libngap.CauseGroupRadioNetwork || c.Extended { + if c.RadioNetwork == nil { return false } - switch c.Value { + switch *c.RadioNetwork { case libngap.CauseRadioNetworkNGIntraSystemHandoverTriggered, libngap.CauseRadioNetworkNGInterSystemHandoverTriggered, libngap.CauseRadioNetworkXnHandoverTriggered: return true default: @@ -133,7 +133,7 @@ func handoverTriggered(c libngap.Cause) bool { } func epsFallbackTriggered(c libngap.Cause) bool { - return c.Group == libngap.CauseGroupRadioNetwork && c.Value == libngap.CauseRadioNetworkIMSVoiceEPSFallbackTriggered && !c.Extended + return c.RadioNetwork != nil && *c.RadioNetwork == libngap.CauseRadioNetworkIMSVoiceEPSFallbackTriggered } type AdmittedQoSFlows struct { diff --git a/internal/smf/ngap/build_test.go b/internal/smf/ngap/build_test.go index dbfc9682e4..6eeb0a3738 100644 --- a/internal/smf/ngap/build_test.go +++ b/internal/smf/ngap/build_test.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/internal/smf/ngap" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) func decodeSetupRequestGTPTunnel(t *testing.T, buf []byte) (uint32, libngap.TransportLayerAddress) { @@ -42,12 +43,12 @@ func TestBuildPDUSessionResourceSetupRequestTransfer(t *testing.T) { t.Errorf("TEID: got %d, want 42", teid) } - if len(bs)*8 != 32 { - t.Fatalf("BitLength: got %d, want 32", len(bs)*8) + if bs.Bits() != 32 { + t.Fatalf("BitLength: got %d, want 32", bs.Bits()) } var ip [4]byte - copy(ip[:], []byte(bs)) + copy(ip[:], bs.Bytes()) if ip != [4]byte{10, 3, 0, 2} { t.Errorf("IP: got %v, want [10 3 0 2]", ip) @@ -127,16 +128,16 @@ func TestBuildPDUSessionResourceSetupRequestTransfer_IPv6Only(t *testing.T) { _, bs := decodeSetupRequestGTPTunnel(t, buf) - if len(bs)*8 != 128 { - t.Fatalf("BitLength: got %d, want 128", len(bs)*8) + if bs.Bits() != 128 { + t.Fatalf("BitLength: got %d, want 128", bs.Bits()) } - if len([]byte(bs)) != 16 { - t.Fatalf("Bytes length: got %d, want 16", len([]byte(bs))) + if len(bs.Bytes()) != 16 { + t.Fatalf("Bytes length: got %d, want 16", len(bs.Bytes())) } v6 := ipv6.As16() - for i, b := range []byte(bs) { + for i, b := range bs.Bytes() { if b != v6[i] { t.Errorf("IPv6 byte[%d]: got %02x, want %02x", i, b, v6[i]) } @@ -156,21 +157,21 @@ func TestBuildPDUSessionResourceSetupRequestTransfer_DualStack(t *testing.T) { _, bs := decodeSetupRequestGTPTunnel(t, buf) - if len(bs)*8 != 160 { - t.Fatalf("BitLength: got %d, want 160", len(bs)*8) + if bs.Bits() != 160 { + t.Fatalf("BitLength: got %d, want 160", bs.Bits()) } - if len([]byte(bs)) != 20 { - t.Fatalf("Bytes length: got %d, want 20", len([]byte(bs))) + if len(bs.Bytes()) != 20 { + t.Fatalf("Bytes length: got %d, want 20", len(bs.Bytes())) } wantV4 := ipv4.As4() - if [4]byte([]byte(bs)[0:4]) != wantV4 { - t.Errorf("IPv4 part: got %v, want %v", []byte(bs)[0:4], wantV4) + if [4]byte(bs.Bytes()[0:4]) != wantV4 { + t.Errorf("IPv4 part: got %v, want %v", bs.Bytes()[0:4], wantV4) } wantV6 := ipv6.As16() - for i, b := range []byte(bs)[4:20] { + for i, b := range bs.Bytes()[4:20] { if b != wantV6[i] { t.Errorf("IPv6 byte[%d]: got %02x, want %02x", i, b, wantV6[i]) } @@ -222,12 +223,12 @@ func TestBuildPathSwitchRequestAcknowledgeTransfer(t *testing.T) { } bs := tunnel.TransportLayerAddress - if len(bs)*8 != 32 { - t.Fatalf("BitLength: got %d, want 32", len(bs)*8) + if bs.Bits() != 32 { + t.Fatalf("BitLength: got %d, want 32", bs.Bits()) } var ip [4]byte - copy(ip[:], []byte(bs)) + copy(ip[:], bs.Bytes()) if ip != [4]byte{172, 16, 0, 1} { t.Errorf("IP: got %v, want [172 16 0 1]", ip) @@ -249,8 +250,8 @@ func TestBuildPathSwitchRequestAcknowledgeTransfer_IPv6Only(t *testing.T) { bs := transfer.ULNGUUPTNLInformation.GTPTunnel.TransportLayerAddress - if len(bs)*8 != 128 { - t.Fatalf("BitLength: got %d, want 128", len(bs)*8) + if bs.Bits() != 128 { + t.Fatalf("BitLength: got %d, want 128", bs.Bits()) } } @@ -417,12 +418,12 @@ func TestBuildHandoverRequestTransferWithDirectForwarding(t *testing.T) { } func TestForwardingPlanFromRelaysTheTargetsEndpoints(t *testing.T) { - fwd := libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress{10, 4, 0, 9}, GTPTEID: 0xfeed, + fwd := libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 9}), GTPTEID: 0xfeed, }} ack := &libngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{TransportLayerAddress: libngap.TransportLayerAddress{10, 4, 0, 2}, GTPTEID: 1}}, + DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 1}}, DLForwardingUPTNLInformation: &fwd, QosFlowSetupResponse: libngap.QosFlowListWithDataForwarding{ {QosFlowIdentifier: 1, DataForwardingAccepted: libngap.Ptr(libngap.DataForwardingAcceptedTrue)}, @@ -472,7 +473,7 @@ func TestForwardingPlanFromRelaysTheTargetsEndpoints(t *testing.T) { func TestForwardingPlanFromWithoutAcceptedForwarding(t *testing.T) { ack := &libngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{TransportLayerAddress: libngap.TransportLayerAddress{10, 4, 0, 2}, GTPTEID: 1}}, + DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 1}}, QosFlowSetupResponse: libngap.QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, } @@ -486,15 +487,15 @@ func TestForwardingPlanFromWithoutAcceptedForwarding(t *testing.T) { } func TestForwardingPlanFromDropsUnusableForwardingEndpoints(t *testing.T) { - bad := libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress{10, 4, 0, 9, 7}, GTPTEID: 0xfeed, + bad := libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 9, 7}), GTPTEID: 0xfeed, }} - good := libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress{10, 4, 0, 4}, GTPTEID: 0xbeef, + good := libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 4}), GTPTEID: 0xbeef, }} ack := &libngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{TransportLayerAddress: libngap.TransportLayerAddress{10, 4, 0, 2}, GTPTEID: 1}}, + DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 4, 0, 2}), GTPTEID: 1}}, DLForwardingUPTNLInformation: &bad, QosFlowSetupResponse: libngap.QosFlowListWithDataForwarding{ {QosFlowIdentifier: 1, DataForwardingAccepted: libngap.Ptr(libngap.DataForwardingAcceptedTrue)}, diff --git a/internal/smf/ngap/qos.go b/internal/smf/ngap/qos.go index 2f34e70ea5..e44bfdbb16 100644 --- a/internal/smf/ngap/qos.go +++ b/internal/smf/ngap/qos.go @@ -37,8 +37,7 @@ func qosFlowLevelQosParameters(qosData *models.QosData) (libngap.QosFlowLevelQos return libngap.QosFlowLevelQosParameters{ QosCharacteristics: libngap.QosCharacteristics{ - Kind: libngap.QosCharacteristicsNonDynamic5QI, - NonDynamic5QI: libngap.NonDynamic5QIDescriptor{FiveQI: libngap.FiveQI(qosData.Var5qi)}, + NonDynamic5QI: &libngap.NonDynamic5QIDescriptor{FiveQI: libngap.FiveQI(qosData.Var5qi)}, }, AllocationAndRetentionPriority: libngap.AllocationAndRetentionPriority{ PriorityLevelARP: libngap.PriorityLevelARP(priority), diff --git a/internal/smf/ngap/transport_layer_address.go b/internal/smf/ngap/transport_layer_address.go deleted file mode 100644 index b7add4aecf..0000000000 --- a/internal/smf/ngap/transport_layer_address.go +++ /dev/null @@ -1,42 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package ngap - -import ( - "net" - "net/netip" - - "github.com/ellanetworks/core/internal/models" - libngap "github.com/ellanetworks/core/ngap" -) - -// encodeTransportLayerAddress builds the NGAP TransportLayerAddress IE per -// 3GPP TS 38.414: -// - 32 bits: IPv4 only -// - 128 bits: IPv6 only -// - 160 bits: IPv4 (4B) || IPv6 (16B) — dual-stack -func encodeTransportLayerAddress(ipv4, ipv6 netip.Addr) (libngap.TransportLayerAddress, error) { - b, err := models.EncodeTransportLayerAddress(ipv4, ipv6) - if err != nil { - return nil, err - } - - return libngap.TransportLayerAddress(b), nil -} - -// ParseTransportLayerAddress adapts the library's netip form to the net.IP the -// SMF's session state carries. -func ParseTransportLayerAddress(a libngap.TransportLayerAddress) (ipv4 net.IP, ipv6 net.IP) { - v4, v6 := a.IPs() - - if v4.IsValid() { - ipv4 = net.IP(v4.AsSlice()) - } - - if v6.IsValid() { - ipv6 = net.IP(v6.AsSlice()) - } - - return ipv4, ipv6 -} diff --git a/internal/smf/ngap/transport_layer_address_test.go b/internal/smf/ngap/transport_layer_address_test.go deleted file mode 100644 index 78c8b5d16d..0000000000 --- a/internal/smf/ngap/transport_layer_address_test.go +++ /dev/null @@ -1,247 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package ngap - -import ( - "fmt" - "net/netip" - "testing" - - libngap "github.com/ellanetworks/core/ngap" - "github.com/stretchr/testify/assert" -) - -func TestEncodeTransportLayerAddress_HappyPath(t *testing.T) { - tests := []struct { - name string - ipv4 netip.Addr - ipv6 netip.Addr - expectedLen int - expectedHex string - }{ - { - name: "IPv4 only", - ipv4: netip.MustParseAddr("192.168.1.1"), - ipv6: netip.Addr{}, - expectedLen: 32, - expectedHex: "c0a80101", - }, - { - name: "IPv6 only", - ipv4: netip.Addr{}, - ipv6: netip.MustParseAddr("2001:db8::1"), - expectedLen: 128, - expectedHex: "20010db8000000000000000000000001", - }, - { - name: "dual-stack (IPv4 + IPv6)", - ipv4: netip.MustParseAddr("192.168.1.1"), - ipv6: netip.MustParseAddr("2001:db8::1"), - expectedLen: 160, - expectedHex: "c0a8010120010db8000000000000000000000001", - }, - { - name: "IPv4 loopback", - ipv4: netip.MustParseAddr("127.0.0.1"), - ipv6: netip.Addr{}, - expectedLen: 32, - expectedHex: "7f000001", - }, - { - name: "IPv6 loopback", - ipv4: netip.Addr{}, - ipv6: netip.MustParseAddr("::1"), - expectedLen: 128, - expectedHex: "00000000000000000000000000000001", - }, - { - name: "IPv4 any address", - ipv4: netip.MustParseAddr("0.0.0.0"), - ipv6: netip.Addr{}, - expectedLen: 32, - expectedHex: "00000000", - }, - { - name: "IPv6 any address", - ipv4: netip.Addr{}, - ipv6: netip.MustParseAddr("::"), - expectedLen: 128, - expectedHex: "00000000000000000000000000000000", - }, - { - name: "dual-stack with multiple IPs", - ipv4: netip.MustParseAddr("10.0.0.5"), - ipv6: netip.MustParseAddr("fd00::1234"), - expectedLen: 160, - expectedHex: "0a000005fd000000000000000000000000001234", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - result, err := encodeTransportLayerAddress(tt.ipv4, tt.ipv6) - assert.NoError(t, err) - - assert.Equal(t, tt.expectedLen/8, len(result)) - - if tt.expectedHex != "" { - expectedBytes, err := hexToBytes(tt.expectedHex) - assert.NoError(t, err) - assert.Equal(t, libngap.TransportLayerAddress(expectedBytes), result) - } - }) - } -} - -func TestEncodeTransportLayerAddress_ErrorCases(t *testing.T) { - tests := []struct { - name string - ipv4 netip.Addr - ipv6 netip.Addr - }{ - { - name: "both addresses invalid", - ipv4: netip.Addr{}, - ipv6: netip.Addr{}, - }, - { - name: "IPv4 is IPv6 address", - ipv4: netip.MustParseAddr("2001:db8::1"), - ipv6: netip.Addr{}, - }, - { - name: "IPv6 is IPv4 address", - ipv4: netip.Addr{}, - ipv6: netip.MustParseAddr("192.168.1.1"), - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - result, err := encodeTransportLayerAddress(tt.ipv4, tt.ipv6) - assert.Error(t, err) - assert.Nil(t, result) - }) - } -} - -func TestParseTransportLayerAddress_HappyPath(t *testing.T) { - tests := []struct { - name string - bitLength int - hexBytes string - wantV4 string - wantV6 string - }{ - { - name: "IPv4 only (32 bits)", - bitLength: 32, - hexBytes: "c0a80101", - wantV4: "192.168.1.1", - wantV6: "", - }, - { - name: "IPv6 only (128 bits)", - bitLength: 128, - hexBytes: "20010db8000000000000000000000001", - wantV4: "", - wantV6: "2001:db8::1", - }, - { - name: "dual-stack (160 bits)", - bitLength: 160, - hexBytes: "c0a8010120010db8000000000000000000000001", - wantV4: "192.168.1.1", - wantV6: "2001:db8::1", - }, - { - name: "IPv4 loopback (32 bits)", - bitLength: 32, - hexBytes: "7f000001", - wantV4: "127.0.0.1", - wantV6: "", - }, - { - name: "IPv6 loopback (128 bits)", - bitLength: 128, - hexBytes: "00000000000000000000000000000001", - wantV4: "", - wantV6: "::1", - }, - { - name: "IPv4 any (32 bits)", - bitLength: 32, - hexBytes: "00000000", - wantV4: "0.0.0.0", - wantV6: "", - }, - { - name: "IPv6 any (128 bits)", - bitLength: 128, - hexBytes: "00000000000000000000000000000000", - wantV4: "", - wantV6: "::", - }, - { - name: "dual-stack with multiple IPs (160 bits)", - bitLength: 160, - hexBytes: "0a000005fd000000000000000000000000001234", - wantV4: "10.0.0.5", - wantV6: "fd00::1234", - }, - { - name: "IPv4 multicast (32 bits)", - bitLength: 32, - hexBytes: "efff0001", - wantV4: "239.255.0.1", - wantV6: "", - }, - { - name: "IPv6 link-local (128 bits)", - bitLength: 128, - hexBytes: "fe800000000000000000000000000001", - wantV4: "", - wantV6: "fe80::1", - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - bytes, err := hexToBytes(tt.hexBytes) - assert.NoError(t, err) - - ipv4, ipv6 := ParseTransportLayerAddress(libngap.TransportLayerAddress(bytes)) - - if tt.wantV4 != "" { - assert.Equal(t, tt.wantV4, ipv4.String()) - } else { - assert.Nil(t, ipv4) - } - - if tt.wantV6 != "" { - assert.Equal(t, tt.wantV6, ipv6.String()) - } else { - assert.Nil(t, ipv6) - } - }) - } -} - -func hexToBytes(s string) ([]byte, error) { - n := len(s) / 2 - - bytes := make([]byte, n) - for i := 0; i < n; i++ { - var b byte - - _, err := fmt.Sscanf(s[i*2:i*2+2], "%02x", &b) - if err != nil { - return nil, err - } - - bytes[i] = b - } - - return bytes, nil -} diff --git a/internal/smf/non_gbr_test.go b/internal/smf/non_gbr_test.go index 13ec38d104..05934f7e7c 100644 --- a/internal/smf/non_gbr_test.go +++ b/internal/smf/non_gbr_test.go @@ -7,7 +7,6 @@ import ( "bytes" "context" "net/netip" - "reflect" "slices" "testing" @@ -116,7 +115,7 @@ func TestNonGBRRuleCreatesAQoSFlow_TS24501_9_11_4_12(t *testing.T) { PreemptionVulnerability: libngap.PreemptionPreemptable, } - if q := item.QosFlowLevelQosParameters; q == nil || q.GBRQosInformation != nil || q.QosCharacteristics.NonDynamic5QI.FiveQI != 69 || !reflect.DeepEqual(q.AllocationAndRetentionPriority, wantARP) { + if q := item.QosFlowLevelQosParameters; q == nil || q.GBRQosInformation != nil || q.QosCharacteristics.NonDynamic5QI.FiveQI != 69 || q.AllocationAndRetentionPriority != wantARP { t.Fatalf("N2 QoS flow %+v, want 5QI 69 at ARP %+v without GBR QoS Flow Information (TS 38.413 §9.3.1.12)", item, wantARP) } diff --git a/internal/smf/qos_flows_loss_test.go b/internal/smf/qos_flows_loss_test.go index b502e970ff..1f2a758673 100644 --- a/internal/smf/qos_flows_loss_test.go +++ b/internal/smf/qos_flows_loss_test.go @@ -154,7 +154,7 @@ func ranReleasesVoice(t *testing.T, s *smf.SMF, ref string) { raw, err := (&libngap.PDUSessionResourceNotifyTransfer{ QosFlowReleased: libngap.QosFlowListWithCause{{ QosFlowIdentifier: voiceQFI, - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: libngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }}, }).Marshal() if err != nil { @@ -633,7 +633,7 @@ func TestPathSwitchClearsAPendingDeletionTheTargetNeverHeld(t *testing.T) { waitFlowModifications(t, amfCb, 2) raw, err := (&libngap.PDUSessionResourceModifyUnsuccessfulTransfer{ - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: libngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }).Marshal() if err != nil { t.Fatal(err) @@ -860,7 +860,7 @@ func TestRANReleasingTheDefaultFlowReleasesTheSession(t *testing.T) { raw, err := (&libngap.PDUSessionResourceNotifyTransfer{ QosFlowReleased: libngap.QosFlowListWithCause{{ QosFlowIdentifier: libngap.QosFlowIdentifier(models.DefaultQFI), - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: libngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }}, }).Marshal() if err != nil { diff --git a/internal/smf/qos_flows_test.go b/internal/smf/qos_flows_test.go index f4e4f7a1f1..d3e2d51881 100644 --- a/internal/smf/qos_flows_test.go +++ b/internal/smf/qos_flows_test.go @@ -6,7 +6,6 @@ package smf_test import ( "bytes" "context" - "reflect" "slices" "testing" "time" @@ -129,7 +128,7 @@ func ranAnswers(t *testing.T, s *smf.SMF, ref string, accepted, failed []uint8) for _, qfi := range failed { tr.QosFlowFailedToAddOrModify = append(tr.QosFlowFailedToAddOrModify, libngap.QosFlowWithCauseItem{ QosFlowIdentifier: libngap.QosFlowIdentifier(qfi), - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: libngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }) } @@ -147,7 +146,7 @@ func ranFallsBack(t *testing.T, s *smf.SMF, ref string) { t.Helper() raw, err := (&libngap.PDUSessionResourceModifyUnsuccessfulTransfer{ - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkIMSVoiceEPSFallbackTriggered}, + Cause: libngap.CauseRadioNetworkIMSVoiceEPSFallbackTriggered.Cause(), }).Marshal() if err != nil { t.Fatal(err) @@ -255,7 +254,7 @@ func TestVoiceRuleCreatesAGBRQoSFlow(t *testing.T) { PreemptionCapability: libngap.PreemptionMayTrigger, PreemptionVulnerability: libngap.PreemptionNotPreemptable, } - if arp := item.QosFlowLevelQosParameters.AllocationAndRetentionPriority; !reflect.DeepEqual(arp, wantARP) { + if arp := item.QosFlowLevelQosParameters.AllocationAndRetentionPriority; arp != wantARP { t.Fatalf("N2 ARP %+v, want the rule's %+v (TS 38.413 §9.3.1.19)", arp, wantARP) } @@ -504,11 +503,11 @@ func waitReportedRules(t *testing.T, pcf *fakePCF) []string { return pcf.reportedRules() } -func ranFailsWithCause(t *testing.T, s *smf.SMF, ref string, value int) { +func ranFailsWithCause(t *testing.T, s *smf.SMF, ref string, value libngap.CauseRadioNetwork) { t.Helper() raw, err := (&libngap.PDUSessionResourceModifyUnsuccessfulTransfer{ - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: value}, + Cause: value.Cause(), }).Marshal() if err != nil { t.Fatal(err) @@ -547,7 +546,7 @@ func TestRANRefusingAJoiningCallKeepsTheFirstCall(t *testing.T) { } } -func ranFailsFlowsWithCause(t *testing.T, s *smf.SMF, ref string, value int, failed ...uint8) { +func ranFailsFlowsWithCause(t *testing.T, s *smf.SMF, ref string, value libngap.CauseRadioNetwork, failed ...uint8) { t.Helper() var tr libngap.PDUSessionResourceModifyResponseTransfer @@ -555,7 +554,7 @@ func ranFailsFlowsWithCause(t *testing.T, s *smf.SMF, ref string, value int, fai for _, qfi := range failed { tr.QosFlowFailedToAddOrModify = append(tr.QosFlowFailedToAddOrModify, libngap.QosFlowWithCauseItem{ QosFlowIdentifier: libngap.QosFlowIdentifier(qfi), - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: value}, + Cause: value.Cause(), }) } diff --git a/internal/smf/transfer_test.go b/internal/smf/transfer_test.go index 265d86bd62..9da89bd5f7 100644 --- a/internal/smf/transfer_test.go +++ b/internal/smf/transfer_test.go @@ -924,7 +924,7 @@ func assertMovable(t *testing.T, sc *smf.SMContext) { func buildPDUSessionResourceSetupUnsuccessfulTransfer() ([]byte, error) { transfer := libngap.PDUSessionResourceSetupUnsuccessfulTransfer{ - Cause: libngap.Cause{Group: libngap.CauseGroupRadioNetwork, Value: libngap.CauseRadioNetworkUnspecified}, + Cause: libngap.CauseRadioNetworkUnspecified.Cause(), } return transfer.Marshal() diff --git a/internal/smf/unbound_downlink_test.go b/internal/smf/unbound_downlink_test.go index 89e315cb35..64af8f8482 100644 --- a/internal/smf/unbound_downlink_test.go +++ b/internal/smf/unbound_downlink_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/internal/smf" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) func assertNoModify(t *testing.T, upf *fakeUPF) { @@ -85,8 +86,8 @@ func TestNGRANBindWithAnUnusableTransportAddressIsRefused(t *testing.T) { transfer := libngap.PDUSessionResourceSetupResponseTransfer{ DLQosFlowPerTNLInformation: libngap.QosFlowPerTNLInformation{ - UPTransportLayerInformation: libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress{10, 0, 0}, + UPTransportLayerInformation: libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0}), GTPTEID: libngap.GTPTEID(0x9001), }}, AssociatedQosFlowList: libngap.AssociatedQosFlowList{{QosFlowIdentifier: 1}}, diff --git a/internal/smf/update.go b/internal/smf/update.go index f32a504db1..bb583d4de4 100644 --- a/internal/smf/update.go +++ b/internal/smf/update.go @@ -7,6 +7,7 @@ import ( "context" "errors" "fmt" + "net" "net/netip" "slices" @@ -284,14 +285,23 @@ func (s *SMF) bindNGRANDownlink(ctx context.Context, smContext *SMContext, n2Dat return dropped, nil } -func anchorFromGTPTunnel(t libngap.GTPTunnel) AnchorBinding { - ipv4, ipv6 := ngap.ParseTransportLayerAddress(t.TransportLayerAddress) +func anchorFromGTPTunnel(u libngap.UPTransportLayerInformation) (AnchorBinding, error) { + t := u.GTPTunnel + if t == nil { + return AnchorBinding{}, fmt.Errorf("UP transport layer information is not a GTP tunnel") + } + + b := AnchorBinding{TEID: uint32(t.GTPTEID)} - return AnchorBinding{ - TEID: uint32(t.GTPTEID), - IPv4: ipv4, - IPv6: ipv6, + if v4 := t.TransportLayerAddress.IPv4(); v4.IsValid() { + b.IPv4 = net.IP(v4.AsSlice()) } + + if v6 := t.TransportLayerAddress.IPv6(); v6.IsValid() { + b.IPv6 = net.IP(v6.AsSlice()) + } + + return b, nil } func anchorFromSetupResponse(b []byte) (AnchorBinding, error) { @@ -300,9 +310,7 @@ func anchorFromSetupResponse(b []byte) (AnchorBinding, error) { return AnchorBinding{}, fmt.Errorf("failed to unmarshall resource setup response transfer: %w", err) } - // UPTransportLayerInformation is a CHOICE whose only modelled alternative is - // gTPTunnel; the decoder refuses choice-Extensions on our behalf. - return anchorFromGTPTunnel(transfer.DLQosFlowPerTNLInformation.UPTransportLayerInformation.GTPTunnel), nil + return anchorFromGTPTunnel(transfer.DLQosFlowPerTNLInformation.UPTransportLayerInformation) } // UpdateSmContextN2InfoPduResSetupFail handles a PDUSession Resource Setup failure. diff --git a/internal/smf/update_test.go b/internal/smf/update_test.go index c196ba2ba4..aa15f6e222 100644 --- a/internal/smf/update_test.go +++ b/internal/smf/update_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas/fgs" libngap "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) const testHandoverTEID = 0x1234 @@ -20,8 +21,8 @@ func validHandoverRequestAcknowledgeTransfer(t *testing.T) []byte { t.Helper() transfer := libngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: libngap.GTPTunnel{ - TransportLayerAddress: libngap.TransportLayerAddress{10, 0, 0, 1}, + DLNGUUPTNLInformation: libngap.UPTransportLayerInformation{GTPTunnel: &libngap.GTPTunnel{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), GTPTEID: libngap.GTPTEID(testHandoverTEID), }}, QosFlowSetupResponse: libngap.QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, diff --git a/internal/tester/gnb/broadcast_plmn_test.go b/internal/tester/gnb/broadcast_plmn_test.go index f30e24eff1..d35a5a4496 100644 --- a/internal/tester/gnb/broadcast_plmn_test.go +++ b/internal/tester/gnb/broadcast_plmn_test.go @@ -31,8 +31,8 @@ func TestBuildNGSetupRequestBroadcastsAdditionalPLMNs(t *testing.T) { t.Fatalf("parse: %v", err) } - if msg.GlobalRANNodeID.PLMNIdentity != homePLMN { - t.Errorf("node PLMN = % x, want the primary PLMN", msg.GlobalRANNodeID.PLMNIdentity) + if nodePLMN, _ := msg.GlobalRANNodeID.PLMNIdentity(); nodePLMN != homePLMN { + t.Errorf("node PLMN = % x, want the primary PLMN", nodePLMN) } if len(msg.SupportedTAList) != 1 { @@ -119,13 +119,17 @@ func TestBuildInitialUEMessageCarriesSelectedPLMNInTAI(t *testing.T) { t.Fatalf("parse: %v", err) } - uli := msg.UserLocationInformation + uli := msg.UserLocationInformation.NR + if uli == nil { + t.Fatalf("location = %+v, want NR", msg.UserLocationInformation) + } + if uli.TAI.PLMNIdentity != otherPLMN { t.Errorf("TAI PLMN = % x, want the selected 310/260", uli.TAI.PLMNIdentity) } - if uli.PLMNIdentity != homePLMN { - t.Errorf("NR CGI PLMN = % x, want the primary PLMN", uli.PLMNIdentity) + if uli.NRCGI.PLMNIdentity != homePLMN { + t.Errorf("NR CGI PLMN = % x, want the primary PLMN", uli.NRCGI.PLMNIdentity) } } @@ -142,8 +146,8 @@ func TestBuildInitialUEMessageDefaultsTAIToServingPLMN(t *testing.T) { t.Fatalf("parse: %v", err) } - if msg.UserLocationInformation.TAI.PLMNIdentity != homePLMN { - t.Errorf("TAI PLMN = % x, want the primary PLMN", msg.UserLocationInformation.TAI.PLMNIdentity) + if nr := msg.UserLocationInformation.NR; nr == nil || nr.TAI.PLMNIdentity != homePLMN { + t.Errorf("location = %+v, want TAI PLMN the primary PLMN", msg.UserLocationInformation) } } @@ -161,7 +165,7 @@ func TestBuildUplinkNasTransportCarriesSelectedPLMNInTAI(t *testing.T) { t.Fatalf("parse: %v", err) } - if msg.UserLocationInformation == nil || msg.UserLocationInformation.TAI.PLMNIdentity != otherPLMN { + if msg.UserLocationInformation == nil || msg.UserLocationInformation.NR == nil || msg.UserLocationInformation.NR.TAI.PLMNIdentity != otherPLMN { t.Errorf("location = %+v, want TAI PLMN 310/260", msg.UserLocationInformation) } } diff --git a/internal/tester/gnb/build_handover_request_acknowledge.go b/internal/tester/gnb/build_handover_request_acknowledge.go index 7a9abe0427..87a125f729 100644 --- a/internal/tester/gnb/build_handover_request_acknowledge.go +++ b/internal/tester/gnb/build_handover_request_acknowledge.go @@ -8,6 +8,7 @@ import ( "net/netip" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) type HandoverRequestAcknowledgeOpts struct { @@ -92,13 +93,13 @@ func BuildHandoverRequestAcknowledge(opts *HandoverRequestAcknowledgeOpts) ([]by } func buildHandoverRequestAcknowledgeTransfer(teid uint32, ip netip.Addr, forwardingTEID uint32, qfis []uint8) (ngap.TransferContainer, error) { - addr, err := transportLayerAddress(ip) + addr, err := ap.TransportLayerAddressFrom(ip) if err != nil { return nil, err } transfer := &ngap.HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: ngap.GTPTunnel{ + DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{GTPTunnel: &ngap.GTPTunnel{ TransportLayerAddress: addr, GTPTEID: ngap.GTPTEID(teid), }}, @@ -107,7 +108,7 @@ func buildHandoverRequestAcknowledgeTransfer(teid uint32, ip netip.Addr, forward } if forwardingTEID != 0 { - transfer.DLForwardingUPTNLInformation = &ngap.UPTransportLayerInformation{GTPTunnel: ngap.GTPTunnel{ + transfer.DLForwardingUPTNLInformation = &ngap.UPTransportLayerInformation{GTPTunnel: &ngap.GTPTunnel{ TransportLayerAddress: addr, GTPTEID: ngap.GTPTEID(forwardingTEID), }} diff --git a/internal/tester/gnb/build_handover_required.go b/internal/tester/gnb/build_handover_required.go index bcd713176c..512d4c7f28 100644 --- a/internal/tester/gnb/build_handover_required.go +++ b/internal/tester/gnb/build_handover_required.go @@ -53,7 +53,7 @@ func BuildHandoverRequired(opts *HandoverRequiredOpts) ([]byte, error) { cause := opts.Cause if cause == nil { - cause = &ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkHandoverDesirableForRadio} + cause = new(ngap.CauseRadioNetworkHandoverDesirableForRadio.Cause()) } sessions := make(ngap.PDUSessionResourceListHORqd, 0, len(opts.PDUSessions)) @@ -101,7 +101,7 @@ func handoverTargetID(opts *HandoverRequiredOpts, tac ngap.TAC) (ngap.TargetID, return ngap.TargetID{TargeteNBID: &ngap.TargeteNBID{ GlobalENBID: ngap.GlobalNgENBID{ PLMNIdentity: plmn, - NgENBID: ngap.NgENBID{Kind: ngap.NgENBIDMacro, Value: *opts.TargetENBID}, + NgENBID: ngap.NgENBID{MacroNgENBID: new(ngap.MacroNgENBID(*opts.TargetENBID))}, }, SelectedEPSTAI: ngap.EPSTAI{PLMNIdentity: plmn, TAC: ngap.EPSTAC(tac)}, }}, nil @@ -114,7 +114,7 @@ func handoverTargetID(opts *HandoverRequiredOpts, tac ngap.TAC) (ngap.TargetID, return ngap.TargetID{TargetRANNodeID: &ngap.TargetRANNodeID{ GlobalRANNodeID: node, - SelectedTAI: ngap.TAI{PLMNIdentity: node.PLMNIdentity, TAC: tac}, + SelectedTAI: ngap.TAI{PLMNIdentity: plmn, TAC: tac}, }}, nil } diff --git a/internal/tester/gnb/build_handover_required_test.go b/internal/tester/gnb/build_handover_required_test.go index d97d563cdd..a297648af9 100644 --- a/internal/tester/gnb/build_handover_required_test.go +++ b/internal/tester/gnb/build_handover_required_test.go @@ -91,8 +91,8 @@ func TestBuildHandoverRequiredToENB(t *testing.T) { } got := msg.TargetID.TargeteNBID.GlobalENBID.NgENBID - if got.Kind != ngap.NgENBIDMacro || got.Value != enbID { - t.Errorf("ng-eNB ID = kind %d value %#x, want a macro %#x", got.Kind, got.Value, enbID) + if got.MacroNgENBID == nil || uint32(*got.MacroNgENBID) != enbID { + t.Errorf("ng-eNB ID = %+v, want a macro %#x", got, enbID) } if msg.TargetID.TargetRANNodeID != nil { diff --git a/internal/tester/gnb/build_initial_context_setup_response.go b/internal/tester/gnb/build_initial_context_setup_response.go index 6a3ab24f4d..cbd5532fce 100644 --- a/internal/tester/gnb/build_initial_context_setup_response.go +++ b/internal/tester/gnb/build_initial_context_setup_response.go @@ -8,6 +8,7 @@ import ( "net/netip" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) type InitialContextSetupResponseOpts struct { @@ -49,7 +50,7 @@ func BuildInitialContextSetupResponse(opts *InitialContextSetupResponseOpts) ([] // naming the downlink tunnel this simulator has set up and the QoS flow it // accepted (TS 38.413 §9.3.4.2). func GetPDUSessionResourceSetupResponseTransfer(ip netip.Addr, teid uint32, qosID int64, flows ...uint8) (ngap.TransferContainer, error) { - addr, err := transportLayerAddress(ip) + addr, err := ap.TransportLayerAddressFrom(ip) if err != nil { return nil, err } @@ -57,7 +58,7 @@ func GetPDUSessionResourceSetupResponseTransfer(ip netip.Addr, teid uint32, qosI transfer := &ngap.PDUSessionResourceSetupResponseTransfer{ DLQosFlowPerTNLInformation: ngap.QosFlowPerTNLInformation{ UPTransportLayerInformation: ngap.UPTransportLayerInformation{ - GTPTunnel: ngap.GTPTunnel{TransportLayerAddress: addr, GTPTEID: ngap.GTPTEID(teid)}, + GTPTunnel: &ngap.GTPTunnel{TransportLayerAddress: addr, GTPTEID: ngap.GTPTEID(teid)}, }, AssociatedQosFlowList: ngap.AssociatedQosFlowList{ {QosFlowIdentifier: ngap.QosFlowIdentifier(qosID)}, diff --git a/internal/tester/gnb/build_initial_ue_message.go b/internal/tester/gnb/build_initial_ue_message.go index 74e752491b..1a851ce941 100644 --- a/internal/tester/gnb/build_initial_ue_message.go +++ b/internal/tester/gnb/build_initial_ue_message.go @@ -125,7 +125,5 @@ func GNBNodeID(mcc, mnc, gnbID string) (ngap.GlobalRANNodeID, error) { v = v<<8 | uint64(o) } - return ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, PLMNIdentity: plmn, Value: uint32(v), Bits: gnbIDBits, - }, nil + return ngap.NewGlobalGNBID(plmn, uint32(v), gnbIDBits), nil } diff --git a/internal/tester/gnb/build_ng_reset.go b/internal/tester/gnb/build_ng_reset.go index 0f8756fabc..e84deddef0 100644 --- a/internal/tester/gnb/build_ng_reset.go +++ b/internal/tester/gnb/build_ng_reset.go @@ -30,9 +30,9 @@ func BuildNGReset(opts *NGResetOpts) ([]byte, error) { req := &ngap.NGReset{Cause: opts.Cause} if opts.ResetAll { - req.ResetType = ngap.ResetType{All: true} + req.ResetType = ngap.ResetType{NGInterface: new(ngap.ResetAllResetAll)} } else { - req.ResetType = ngap.ResetType{Part: opts.Connections} + req.ResetType = ngap.ResetType{PartOfNGInterface: &opts.Connections} } return req.Marshal() diff --git a/internal/tester/gnb/build_ng_setup_request.go b/internal/tester/gnb/build_ng_setup_request.go index 1b2e1a3c51..0ac105b526 100644 --- a/internal/tester/gnb/build_ng_setup_request.go +++ b/internal/tester/gnb/build_ng_setup_request.go @@ -93,13 +93,8 @@ func BuildNGSetupRequest(opts *NGSetupRequestOpts) ([]byte, error) { } req := &ngap.NGSetupRequest{ - GlobalRANNodeID: ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDGNB, - PLMNIdentity: plmn, - Value: uint32(gnbID), - Bits: gnbIDBits, - }, - RANNodeName: ngap.Ptr(opts.Name), + GlobalRANNodeID: ngap.NewGlobalGNBID(plmn, uint32(gnbID), gnbIDBits), + RANNodeName: ngap.Ptr(opts.Name), SupportedTAList: ngap.SupportedTAList{{ TAC: ngap.TAC(uint32(tac[0])<<16 | uint32(tac[1])<<8 | uint32(tac[2])), BroadcastPLMNList: bplmns, diff --git a/internal/tester/gnb/build_path_switch_request.go b/internal/tester/gnb/build_path_switch_request.go index 3ef1c78c5e..02b44d9522 100644 --- a/internal/tester/gnb/build_path_switch_request.go +++ b/internal/tester/gnb/build_path_switch_request.go @@ -8,6 +8,7 @@ import ( "net/netip" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) type PathSwitchRequestOpts struct { @@ -36,7 +37,7 @@ func BuildPathSwitchRequest(opts *PathSwitchRequestOpts) ([]byte, error) { return nil, err } - addr, err := transportLayerAddress(opts.N3GnbIp) + addr, err := ap.TransportLayerAddressFrom(opts.N3GnbIp) if err != nil { return nil, err } @@ -76,7 +77,7 @@ func BuildPathSwitchRequest(opts *PathSwitchRequestOpts) ([]byte, error) { func buildPathSwitchRequestTransfer(teid uint32, addr ngap.TransportLayerAddress, flows []uint8) (ngap.TransferContainer, error) { transfer := &ngap.PathSwitchRequestTransfer{ DLNGUUPTNLInformation: ngap.UPTransportLayerInformation{ - GTPTunnel: ngap.GTPTunnel{TransportLayerAddress: addr, GTPTEID: ngap.GTPTEID(teid)}, + GTPTunnel: &ngap.GTPTunnel{TransportLayerAddress: addr, GTPTEID: ngap.GTPTEID(teid)}, }, QosFlowAccepted: ngap.QosFlowAcceptedList{{QosFlowIdentifier: 1}}, } diff --git a/internal/tester/gnb/build_roundtrip_test.go b/internal/tester/gnb/build_roundtrip_test.go index 940e3eb2c0..b74f6ab7de 100644 --- a/internal/tester/gnb/build_roundtrip_test.go +++ b/internal/tester/gnb/build_roundtrip_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/internal/tester/gnb" "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" ) const ( @@ -71,17 +72,18 @@ func assertUserLocation(t *testing.T, uli *ngap.UserLocationInformation) { t.Fatal("no User Location Information") } - if uli.Kind != ngap.UserLocationNR { - t.Errorf("location kind = %d, want NR", uli.Kind) + nr := uli.NR + if nr == nil { + t.Fatalf("location = %+v, want NR", uli) } wantPLMN := ngap.PLMNIdentity{0x00, 0xf1, 0x10} // 001/01 - if uli.PLMNIdentity != wantPLMN || uli.TAI.PLMNIdentity != wantPLMN { - t.Errorf("PLMN = %x / TAI %x, want %x", uli.PLMNIdentity, uli.TAI.PLMNIdentity, wantPLMN) + if nr.NRCGI.PLMNIdentity != wantPLMN || nr.TAI.PLMNIdentity != wantPLMN { + t.Errorf("PLMN = %x / TAI %x, want %x", nr.NRCGI.PLMNIdentity, nr.TAI.PLMNIdentity, wantPLMN) } - if uli.TAI.TAC != 1 { - t.Errorf("TAC = %d, want 1", uli.TAI.TAC) + if nr.TAI.TAC != 1 { + t.Errorf("TAC = %d, want 1", nr.TAI.TAC) } node, err := gnb.GNBNodeID(testMCC, testMNC, testGnbID) @@ -94,8 +96,8 @@ func assertUserLocation(t *testing.T, uli *ngap.UserLocationInformation) { t.Fatal(err) } - if uli.CellIdentity != wantCell { - t.Errorf("cell identity = %#x, want %#x", uli.CellIdentity, wantCell) + if uint64(nr.NRCGI.NRCellIdentity) != wantCell { + t.Errorf("cell identity = %#x, want %#x", nr.NRCGI.NRCellIdentity, wantCell) } } @@ -191,8 +193,8 @@ func TestBuildPathSwitchRequestRoundTrips(t *testing.T) { t.Errorf("TEID = %#x, want 0x11223344", transfer.DLNGUUPTNLInformation.GTPTunnel.GTPTEID) } - if got := transfer.DLNGUUPTNLInformation.GTPTunnel.TransportLayerAddress; string(got) != string([]byte{10, 0, 0, 2}) { - t.Errorf("transport address = %x, want 0a000002", got) + if got := transfer.DLNGUUPTNLInformation.GTPTunnel.TransportLayerAddress; got != ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 2}) { + t.Errorf("transport address = %v, want 10.0.0.2", got) } if len(transfer.QosFlowAccepted) != 1 { diff --git a/internal/tester/gnb/dispatch.go b/internal/tester/gnb/dispatch.go index eab0994769..af777ed0e5 100644 --- a/internal/tester/gnb/dispatch.go +++ b/internal/tester/gnb/dispatch.go @@ -250,8 +250,8 @@ func frameRANUEID(f SCTPFrame) (int64, bool) { return 0, false } - if m.UENGAPIDs.Pair { - return int64(m.UENGAPIDs.RANUENGAPID), true + if p := m.UENGAPIDs.UENGAPIDPair; p != nil { + return int64(p.RANUENGAPID), true } return 0, false diff --git a/internal/tester/gnb/handle_pdu_session_resource_setup_request.go b/internal/tester/gnb/handle_pdu_session_resource_setup_request.go index dd8033464b..8513b8d25a 100644 --- a/internal/tester/gnb/handle_pdu_session_resource_setup_request.go +++ b/internal/tester/gnb/handle_pdu_session_resource_setup_request.go @@ -44,7 +44,7 @@ func handlePDUSessionResourceSetupRequest(gnb *GnodeB, value []byte) error { zap.Int64("AMF UE NGAP ID", amfUeNgapID), ) - cause := ngap.Cause{Group: ngap.CauseGroupProtocol, Value: ngap.CauseProtocolMessageNotCompatible} + cause := ngap.CauseProtocolMessageNotCompatible.Cause() if err := gnb.SendErrorIndication(amfUeNgapID, ranUeNgapID, cause, ngap.ProcPDUSessionResourceSetup); err != nil { return fmt.Errorf("could not send ErrorIndication: %w", err) @@ -262,8 +262,8 @@ func qosFlowParams(qfi uint8, p *ngap.QosFlowLevelQosParameters) QoSFlowParams { GBR: p.GBRQosInformation != nil, } - if p.QosCharacteristics.Kind == ngap.QosCharacteristicsNonDynamic5QI { - params.FiveQI = int64(p.QosCharacteristics.NonDynamic5QI.FiveQI) + if q := p.QosCharacteristics.NonDynamic5QI; q != nil { + params.FiveQI = int64(q.FiveQI) } return params @@ -273,13 +273,13 @@ func qosFlowParams(qfi uint8, p *ngap.QosFlowLevelQosParameters) QoSFlowParams { // that matches the IP family of the given gNB N3 address. // // The encoding per 3GPP TS 38.414 is: -// - 4 bytes → IPv4 only -// - 16 bytes → IPv6 only -// - 20 bytes → dual-stack: first 4 bytes are IPv4, next 16 bytes are IPv6 +// - 32 bits → IPv4 only +// - 128 bits → IPv6 only +// - 160 bits → dual-stack: first 32 bits are IPv4, next 128 bits are IPv6 // // Returns an error when the UPF provides no address for the requested family. -func ParseUPFAddress(upfAddressBytes []byte, n3Addr netip.Addr) (string, error) { - if len(upfAddressBytes) == 0 { +func ParseUPFAddress(upfAddress ngap.TransportLayerAddress, n3Addr netip.Addr) (string, error) { + if upfAddress.IsZero() { return "", fmt.Errorf("UPF transport layer address is empty") } @@ -287,29 +287,12 @@ func ParseUPFAddress(upfAddressBytes []byte, n3Addr netip.Addr) (string, error) return "", fmt.Errorf("gNB N3 address is not set") } - var ipv4Addr, ipv6Addr netip.Addr - - switch len(upfAddressBytes) { - case 4: - var arr [4]byte - copy(arr[:], upfAddressBytes) - ipv4Addr = netip.AddrFrom4(arr) - case 16: - var arr [16]byte - copy(arr[:], upfAddressBytes) - ipv6Addr = netip.AddrFrom16(arr) - case 20: - var arr4 [4]byte - copy(arr4[:], upfAddressBytes[:4]) - ipv4Addr = netip.AddrFrom4(arr4) - - var arr16 [16]byte - copy(arr16[:], upfAddressBytes[4:]) - ipv6Addr = netip.AddrFrom16(arr16) - default: - return "", fmt.Errorf("unexpected UPF transport layer address length: %d bytes", len(upfAddressBytes)) + if !upfAddress.Valid() { + return "", fmt.Errorf("unexpected UPF transport layer address length: %d bits", upfAddress.Bits()) } + ipv4Addr, ipv6Addr := upfAddress.IPv4(), upfAddress.IPv6() + if n3Addr.Is4() { if !ipv4Addr.IsValid() { return "", fmt.Errorf("gNB N3 address is IPv4 but UPF provided no IPv4 address") diff --git a/internal/tester/gnb/handle_ue_context_release_command.go b/internal/tester/gnb/handle_ue_context_release_command.go index b5949520a4..50ee5aef03 100644 --- a/internal/tester/gnb/handle_ue_context_release_command.go +++ b/internal/tester/gnb/handle_ue_context_release_command.go @@ -19,11 +19,12 @@ func handleUEContextReleaseCommand(gnb *GnodeB, value []byte) error { // The AMF may address the UE by the pair or by the AMF UE NGAP ID alone // (TS 38.413 §9.2.2.5); only the pair names a RAN UE this gNB can resolve. - if !cmd.UENGAPIDs.Pair { + pair := cmd.UENGAPIDs.UENGAPIDPair + if pair == nil { return fmt.Errorf("UEContextReleaseCommand carries no RAN UE NGAP ID") } - amfUEID, ranUEID := int64(cmd.UENGAPIDs.AMFUENGAPID), int64(cmd.UENGAPIDs.RANUENGAPID) + amfUEID, ranUEID := int64(pair.AMFUENGAPID), int64(pair.RANUENGAPID) logger.GnbLogger.Debug("Received UE Context Release Command", zap.String("Cause", causeName(cmd.Cause)), diff --git a/internal/tester/gnb/helpers.go b/internal/tester/gnb/helpers.go index ef7ba20d0f..826398d781 100644 --- a/internal/tester/gnb/helpers.go +++ b/internal/tester/gnb/helpers.go @@ -6,7 +6,6 @@ package gnb import ( "encoding/hex" "fmt" - "net/netip" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/ngap" @@ -45,23 +44,6 @@ func GetGnbIdInBytes(gnbId string) ([]byte, error) { return resu, nil } -// transportLayerAddress renders an IP as the bit string a GTP tunnel endpoint -// carries: 32 bits for IPv4, 128 for IPv6 (TS 38.413 §9.3.2.4). -func transportLayerAddress(ip netip.Addr) (ngap.TransportLayerAddress, error) { - switch { - case ip.Is4(): - v4 := ip.As4() - - return ngap.TransportLayerAddress(v4[:]), nil - case ip.Is6(): - v6 := ip.As16() - - return ngap.TransportLayerAddress(v6[:]), nil - default: - return nil, fmt.Errorf("transport layer address %q is neither IPv4 nor IPv6", ip) - } -} - // userLocation builds the User Location Information this simulator reports: // the NR cell it serves and the TAI that cell is in (TS 38.413 §9.3.1.16). // internal/tester/s1enb reports its E-UTRAN CGI and TAI the same way. @@ -91,10 +73,8 @@ func userLocation(mcc, mnc, selMcc, selMnc, gnbID, tac string) (ngap.UserLocatio return ngap.UserLocationInformation{}, fmt.Errorf("could not build NR cell identity: %w", err) } - return ngap.UserLocationInformation{ - Kind: ngap.UserLocationNR, - PLMNIdentity: plmn, - CellIdentity: cellID, - TAI: ngap.TAI{PLMNIdentity: selected, TAC: tacValue}, - }, nil + return ngap.UserLocationInformation{NR: &ngap.UserLocationInformationNR{ + NRCGI: ngap.NRCGI{PLMNIdentity: plmn, NRCellIdentity: ngap.NRCellIdentity(cellID)}, + TAI: ngap.TAI{PLMNIdentity: selected, TAC: tacValue}, + }}, nil } diff --git a/internal/tester/gnb/lifecycle.go b/internal/tester/gnb/lifecycle.go index b5b6c27932..2ef2cfcb54 100644 --- a/internal/tester/gnb/lifecycle.go +++ b/internal/tester/gnb/lifecycle.go @@ -380,13 +380,13 @@ func (g *GnodeB) ServiceRequestSignalling(u *ue.UE, ranUENGAPID int64, timeout t return nil } -var CauseUserInactivity = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity} +var CauseUserInactivity = ngap.CauseRadioNetworkUserInactivity.Cause() -var CauseRadioConnectionWithUELost = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioConnectionWithUELost} +var CauseRadioConnectionWithUELost = ngap.CauseRadioNetworkRadioConnectionWithUELost.Cause() // CauseNASNormalRelease is the cause the AMF releases a UE context with when it // has no reason to hold the NAS signalling connection any longer. -var CauseNASNormalRelease = ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease} +var CauseNASNormalRelease = ngap.CauseNASNormalRelease.Cause() // ReleaseContext performs a gNB-initiated UE context release (TS 23.502 // §4.2.6), dropping the UE to CM-IDLE. ENB.ReleaseContext is its EPS diff --git a/internal/tester/gnb/ng_setup_roundtrip_test.go b/internal/tester/gnb/ng_setup_roundtrip_test.go index ccd0748123..ad0b27a25d 100644 --- a/internal/tester/gnb/ng_setup_roundtrip_test.go +++ b/internal/tester/gnb/ng_setup_roundtrip_test.go @@ -123,10 +123,7 @@ func (s *stubDB) AMFPointer() int { return 1 } // TS 38.413 §10.3 forbids replying to one, which would loop. func TestErrorIndicationGNBToAMF(t *testing.T) { ind := &ngap.ErrorIndication{ - Cause: ngap.Ptr(ngap.Cause{ - Group: ngap.CauseGroupProtocol, - Value: ngap.CauseProtocolAbstractSyntaxErrorReject, - }), + Cause: ngap.Ptr(ngap.CauseProtocolAbstractSyntaxErrorReject.Cause()), } raw, err := ind.Marshal() @@ -168,7 +165,7 @@ func TestErrorIndicationGNBToAMF(t *testing.T) { // the released UE-NGAP-IDs (TS 38.413 §8.7.4). func TestNGResetGNBToAMF(t *testing.T) { raw, err := gnb.BuildNGReset(&gnb.NGResetOpts{ - Cause: ngap.Ptr(ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscOMIntervention}), + Cause: ngap.Ptr(ngap.CauseMiscOMIntervention.Cause()), ResetAll: true, }) if err != nil { @@ -197,7 +194,7 @@ func TestNGResetGNBToAMF(t *testing.T) { t.Fatalf("AMF could not parse the NG Reset: %v", err) } - if !req.ResetType.All { + if req.ResetType.NGInterface == nil { t.Fatalf("AMF read ResetType %+v, want a whole-interface reset", req.ResetType) } diff --git a/internal/tester/gnb/non_gbr_qos_flow_test.go b/internal/tester/gnb/non_gbr_qos_flow_test.go index 51bc95a7eb..3ba7ea0f9d 100644 --- a/internal/tester/gnb/non_gbr_qos_flow_test.go +++ b/internal/tester/gnb/non_gbr_qos_flow_test.go @@ -174,7 +174,7 @@ func TestGBRRefusalSparesNonGBRQoSFlows(t *testing.T) { g := newQoSTestGnodeB() g.storePDUSession(testRANUEID, &PDUSessionInformation{PDUSessionID: testPDUSession, QFI: defaultTestQFI, QosId: defaultTestQFI, FiveQi: 9}) - cause := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUnspecified} + cause := ngap.CauseRadioNetworkUnspecified.Cause() g.RefuseNextGBRQoSFlows(testRANUEID, cause) handleModify(t, g, modifyRequest(t, mcpttFlow())) diff --git a/internal/tester/gnb/release_selected_plmn_test.go b/internal/tester/gnb/release_selected_plmn_test.go index cafcf4a2f7..d04dcd6de1 100644 --- a/internal/tester/gnb/release_selected_plmn_test.go +++ b/internal/tester/gnb/release_selected_plmn_test.go @@ -79,8 +79,8 @@ func TestUEContextReleaseClearsSelectedPLMN(t *testing.T) { } cmd := &ngap.UEContextReleaseCommand{ - UENGAPIDs: ngap.UENGAPIDs{AMFUENGAPID: 1, RANUENGAPID: ranUEID, Pair: true}, - Cause: &ngap.Cause{Group: ngap.CauseGroupNAS, Value: ngap.CauseNASNormalRelease}, + UENGAPIDs: ngap.UENGAPIDs{UENGAPIDPair: &ngap.UENGAPIDPair{AMFUENGAPID: 1, RANUENGAPID: ranUEID}}, + Cause: new(ngap.CauseNASNormalRelease.Cause()), } pdu, err := cmd.Marshal() diff --git a/internal/tester/gnb/send.go b/internal/tester/gnb/send.go index d479ade1bb..e2a88cac90 100644 --- a/internal/tester/gnb/send.go +++ b/internal/tester/gnb/send.go @@ -380,7 +380,7 @@ func (g *GnodeB) SendQoSFlowsReleased(amfUENGAPID, ranUENGAPID, pduSessionID int for _, qfi := range qfis { transfer.QosFlowReleased = append(transfer.QosFlowReleased, ngap.QosFlowWithCauseItem{ QosFlowIdentifier: ngap.QosFlowIdentifier(qfi), - Cause: ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioResourcesNotAvailable}, + Cause: ngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause(), }) } diff --git a/internal/tester/s1enb/attach.go b/internal/tester/s1enb/attach.go index d0fced2345..7665ff49b4 100644 --- a/internal/tester/s1enb/attach.go +++ b/internal/tester/s1enb/attach.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/internal/tester/logger" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" "go.uber.org/zap" ) @@ -353,17 +354,14 @@ func (e *ENB) waitForPlainDownlink(enbUEID int64, timeout time.Duration) (nas [] // sendInitialContextSetupResponse acknowledges the bearer setup, reporting the // eNB's S1-U downlink endpoint (the F-TEID the MME hands to the UPF). func (e *ENB) sendInitialContextSetupResponse(ics *s1ap.InitialContextSetupRequest, enbUEID int64, dlTEID uint32) error { - addr := e.n3Addr.To4() - if addr == nil { - addr = e.n3Addr.To16() - } + addr := e.n3TransportLayerAddress() resp := &s1ap.InitialContextSetupResponse{ MMEUES1APID: s1ap.Ptr(ics.MMEUES1APID), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(enbUEID)), ERABSetup: []s1ap.ERABSetupItemCtxtSURes{{ ERABID: ics.ERABToBeSetup[0].ERABID, - TransportLayerAddress: s1ap.TransportLayerAddress(addr), + TransportLayerAddress: addr, GTPTEID: s1ap.GTPTEID(dlTEID), }}, } @@ -377,27 +375,18 @@ func (e *ENB) sendInitialContextSetupResponse(ics *s1ap.InitialContextSetupReque } // selectUpfAddr resolves the UPF S1-U endpoint from the E-RAB Transport Layer -// Address (TS 36.413): 4 octets IPv4, 16 IPv6, or 20 dual-stack (IPv4||IPv6). +// Address (TS 36.413): 32 bits IPv4, 128 IPv6, or 160 dual-stack (IPv4||IPv6). // For a dual-stack endpoint it picks the family of the eNB's own N3 socket, since // the GTP-U transport between eNB and UPF must share an address family. func (e *ENB) selectUpfAddr(tla s1ap.TransportLayerAddress) (netip.Addr, error) { - b := []byte(tla) enbIsV6 := e.n3Addr.To4() == nil - var v4, v6 netip.Addr - - switch len(b) { - case 4: - v4, _ = netip.AddrFromSlice(b) - case 16: - v6, _ = netip.AddrFromSlice(b) - case 20: - v4, _ = netip.AddrFromSlice(b[0:4]) - v6, _ = netip.AddrFromSlice(b[4:20]) - default: - return netip.Addr{}, fmt.Errorf("s1enb: unexpected S1-U transport layer address length %d", len(b)) + if !tla.Valid() { + return netip.Addr{}, fmt.Errorf("s1enb: unexpected S1-U transport layer address length %d bits", tla.Bits()) } + v4, v6 := tla.IPv4(), tla.IPv6() + switch { case enbIsV6 && v6.IsValid(): return v6.Unmap(), nil @@ -431,3 +420,10 @@ func (e *ENB) allocForwardingTEID() uint32 { return t } + +func (e *ENB) n3TransportLayerAddress() s1ap.TransportLayerAddress { + addr, _ := netip.AddrFromSlice(e.n3Addr) + tla, _ := ap.TransportLayerAddressFrom(addr) + + return tla +} diff --git a/internal/tester/s1enb/broadcast_plmn_test.go b/internal/tester/s1enb/broadcast_plmn_test.go index 30106b1ec7..cc192a31a7 100644 --- a/internal/tester/s1enb/broadcast_plmn_test.go +++ b/internal/tester/s1enb/broadcast_plmn_test.go @@ -24,7 +24,7 @@ func multiPLMNENB(t *testing.T) *ENB { } return &ENB{ - enbID: 0x19b, enbIDKind: s1ap.ENBIDMacro, name: "ella", plmn: testHomePLMN, bplmns: bplmns, tac: 1, + enbID: 0x19b, enbIDKind: ENBIDMacro, name: "ella", plmn: testHomePLMN, bplmns: bplmns, tac: 1, selected: make(map[int64]s1ap.PLMNIdentity), nextENBUEID: 1, } } diff --git a/internal/tester/s1enb/dedicated_test.go b/internal/tester/s1enb/dedicated_test.go index 512ba6a89f..6b4d659439 100644 --- a/internal/tester/s1enb/dedicated_test.go +++ b/internal/tester/s1enb/dedicated_test.go @@ -13,6 +13,7 @@ import ( "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -25,7 +26,7 @@ func queueERABSetupRequest(t *testing.T, e *ENB, enbUEID int64, qos s1ap.ERABLev ERABToBeSetup: []s1ap.ERABToBeSetupItemBearerSUReq{{ ERABID: 6, QoS: qos, - TransportLayerAddress: s1ap.TransportLayerAddress(netip.MustParseAddr("10.0.0.1").AsSlice()), + TransportLayerAddress: ap.TransportLayerAddressFromOctets(netip.MustParseAddr("10.0.0.1").AsSlice()), GTPTEID: 0x1234, NASPDU: s1ap.NASPDU(nasPDU), }}, diff --git a/internal/tester/s1enb/handover.go b/internal/tester/s1enb/handover.go index 077ec21333..770b7eeca4 100644 --- a/internal/tester/s1enb/handover.go +++ b/internal/tester/s1enb/handover.go @@ -22,8 +22,8 @@ func (e *ENB) SendHandoverRequired(enbUEID, mmeUEID int64, target s1ap.GlobalENB MMEUES1APID: s1ap.MMEUES1APID(mmeUEID), ENBUES1APID: s1ap.ENBUES1APID(enbUEID), HandoverType: s1ap.HandoverTypeIntraLTE, - Cause: s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}), // handover-desirable-for-radio-reason - TargetID: s1ap.TargetID{TargeteNBID: s1ap.TargeteNBID{GlobalENBID: target, SelectedTAI: e.tai()}}, + Cause: s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()), // handover-desirable-for-radio-reason + TargetID: s1ap.TargetID{TargeteNBID: &s1ap.TargeteNBID{GlobalENBID: target, SelectedTAI: e.tai()}}, SourceToTarget: SourceToTargetContainer(), } @@ -57,10 +57,7 @@ func (e *ENB) WaitForHandoverRequest(timeout time.Duration) (*s1ap.HandoverReque // so the MME reports the refused ones back to the source in the Handover // Command E-RAB To Release list (TS 36.413 §9.1.5.4). func (e *ENB) SendHandoverRequestAcknowledgePartial(targetENBUEID, mmeUEID int64, admit []s1ap.ERABID, refuse []s1ap.ERABID, cause s1ap.Cause) (map[s1ap.ERABID]uint32, error) { - addr := e.n3Addr.To4() - if addr == nil { - addr = e.n3Addr.To16() - } + addr := e.n3TransportLayerAddress() admitted := make([]s1ap.ERABAdmittedItem, 0, len(admit)) teids := make(map[s1ap.ERABID]uint32, len(admit)) @@ -71,7 +68,7 @@ func (e *ENB) SendHandoverRequestAcknowledgePartial(targetENBUEID, mmeUEID int64 admitted = append(admitted, s1ap.ERABAdmittedItem{ ERABID: id, - TransportLayerAddress: s1ap.TransportLayerAddress(addr), + TransportLayerAddress: addr, GTPTEID: s1ap.GTPTEID(dlTEID), }) } @@ -102,22 +99,19 @@ func (e *ENB) SendHandoverRequestAcknowledgePartial(targetENBUEID, mmeUEID int64 } func (e *ENB) SendHandoverRequestAcknowledge(targetENBUEID, mmeUEID int64, erabID s1ap.ERABID, forwarding bool) (dlTEID, dlForwardingTEID uint32, err error) { - addr := e.n3Addr.To4() - if addr == nil { - addr = e.n3Addr.To16() - } + addr := e.n3TransportLayerAddress() dlTEID = e.allocTEID() item := s1ap.ERABAdmittedItem{ ERABID: erabID, - TransportLayerAddress: s1ap.TransportLayerAddress(addr), + TransportLayerAddress: addr, GTPTEID: s1ap.GTPTEID(dlTEID), } if forwarding { dlForwardingTEID = e.allocForwardingTEID() - item.DLTransportLayerAddr = s1ap.TransportLayerAddress(addr) + item.DLTransportLayerAddr = s1ap.Ptr(addr) item.DLGTPTEID = s1ap.Ptr(s1ap.GTPTEID(dlForwardingTEID)) } diff --git a/internal/tester/s1enb/handover_to_5gs.go b/internal/tester/s1enb/handover_to_5gs.go index 15eb4502ef..9338518943 100644 --- a/internal/tester/s1enb/handover_to_5gs.go +++ b/internal/tester/s1enb/handover_to_5gs.go @@ -34,7 +34,7 @@ func (e *ENB) SendHandoverRequiredToFiveGS(opts *HandoverToFiveGSOpts) error { cause := opts.Cause if cause == nil { - cause = s1ap.Ptr(s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 16}) + cause = s1ap.Ptr(s1ap.CauseRadioNetworkHandoverDesirableForRadio.Cause()) } req := &s1ap.HandoverRequired{ @@ -45,7 +45,7 @@ func (e *ENB) SendHandoverRequiredToFiveGS(opts *HandoverToFiveGSOpts) error { TargetID: s1ap.TargetID{TargetNgRanNodeID: &s1ap.TargetNgRanNodeID{ GlobalRANNodeID: s1ap.GlobalRANNodeID{GNB: &s1ap.GNB{GlobalGNBID: s1ap.GlobalGNBID{ PLMNIdentity: e.plmn, - GNBID: s1ap.GNBID{Value: opts.TargetGNBID, Bits: opts.TargetGNBIDBits}, + GNBID: s1ap.GNBIdentity{GNBID: &s1ap.GNBID{Value: opts.TargetGNBID, Bits: opts.TargetGNBIDBits}}, }}}, SelectedTAI: s1ap.FiveGSTAI{PLMNIdentity: e.plmn, TAC: s1ap.FiveGSTAC(opts.TargetTAC)}, }}, diff --git a/internal/tester/s1enb/lifecycle.go b/internal/tester/s1enb/lifecycle.go index 700314284d..45684061a0 100644 --- a/internal/tester/s1enb/lifecycle.go +++ b/internal/tester/s1enb/lifecycle.go @@ -297,11 +297,12 @@ func (e *ENB) completeContextRelease(enbUEID int64, timeout time.Duration) error // The MME may address the UE by the pair or by the MME UE S1AP ID alone // (TS 36.413 §9.1.4.6); only the pair names an eNB UE this simulator can // answer for. - if !cmd.UES1APIDs.Pair { + pair := cmd.UES1APIDs.UES1APIDPair + if pair == nil { return fmt.Errorf("UE Context Release Command carries no eNB UE S1AP ID") } - e.dropCapabilityReport(int64(cmd.UES1APIDs.ENBUES1APID)) + e.dropCapabilityReport(int64(pair.ENBUES1APID)) - return e.SendUEContextReleaseComplete(int64(cmd.UES1APIDs.MMEUES1APID), int64(cmd.UES1APIDs.ENBUES1APID)) + return e.SendUEContextReleaseComplete(int64(pair.MMEUES1APID), int64(pair.ENBUES1APID)) } diff --git a/internal/tester/s1enb/pdn.go b/internal/tester/s1enb/pdn.go index f8471460ed..0cd6634fae 100644 --- a/internal/tester/s1enb/pdn.go +++ b/internal/tester/s1enb/pdn.go @@ -275,17 +275,14 @@ func (e *ENB) sendERABReleaseResponse(cmd *s1ap.ERABReleaseCommand, enbUEID int6 // sendERABSetupResponse acknowledges an E-RAB SETUP REQUEST, reporting the eNB's // S1-U downlink endpoint for the new E-RAB (TS 36.413 §8.2.1). func (e *ENB) sendERABSetupResponse(req *s1ap.ERABSetupRequest, enbUEID int64, dlTEID uint32) error { - addr := e.n3Addr.To4() - if addr == nil { - addr = e.n3Addr.To16() - } + addr := e.n3TransportLayerAddress() resp := &s1ap.ERABSetupResponse{ MMEUES1APID: s1ap.Ptr(req.MMEUES1APID), ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(enbUEID)), ERABSetup: []s1ap.ERABSetupItemBearerSURes{{ ERABID: req.ERABToBeSetup[0].ERABID, - TransportLayerAddress: s1ap.TransportLayerAddress(addr), + TransportLayerAddress: addr, GTPTEID: s1ap.GTPTEID(dlTEID), }}, } diff --git a/internal/tester/s1enb/s1ap.go b/internal/tester/s1enb/s1ap.go index e7434721c6..1743a67e50 100644 --- a/internal/tester/s1enb/s1ap.go +++ b/internal/tester/s1enb/s1ap.go @@ -48,7 +48,7 @@ func parseTAC(s string) (uint16, error) { // only cell. func (e *ENB) eutranCellID() uint32 { cell := uint32(1) - if e.enbIDKind == s1ap.ENBIDHome { + if e.enbIDKind == ENBIDHome { cell = 0 } @@ -62,7 +62,16 @@ func (e *ENB) eutranCellID() uint32 { } func (e *ENB) enbNodeID() s1ap.ENBID { - return s1ap.ENBID{Kind: e.enbIDKind, Value: e.enbID} + switch e.enbIDKind { + case ENBIDHome: + return s1ap.ENBID{HomeENBID: s1ap.Ptr(s1ap.HomeENBID(e.enbID))} + case ENBIDShortMacro: + return s1ap.ENBID{ShortMacroENBID: s1ap.Ptr(s1ap.ShortMacroENBID(e.enbID))} + case ENBIDLongMacro: + return s1ap.ENBID{LongMacroENBID: s1ap.Ptr(s1ap.LongMacroENBID(e.enbID))} + default: + return s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(e.enbID))} + } } func (e *ENB) tai() s1ap.TAI { @@ -70,7 +79,7 @@ func (e *ENB) tai() s1ap.TAI { } func (e *ENB) eutranCGI() s1ap.EUTRANCGI { - return s1ap.EUTRANCGI{PLMNIdentity: e.plmn, CellID: e.eutranCellID()} + return s1ap.EUTRANCGI{PLMNIdentity: e.plmn, CellID: s1ap.CellIdentity(e.eutranCellID())} } func (e *ENB) buildS1SetupRequest() ([]byte, error) { @@ -233,10 +242,7 @@ func (e *ENB) SendUplinkNASTransport(mmeUEID, enbUEID int64, nas []byte) error { // eNB's S1-U endpoint. It returns the eNB downlink TEID it reported, so the caller // can build the target GTP tunnel. func (e *ENB) SendPathSwitchRequest(enbUEID, sourceMMEUEID int64, erabID s1ap.ERABID, caps s1ap.UESecurityCapabilities) (dlTEID uint32, err error) { - addr := e.n3Addr.To4() - if addr == nil { - addr = e.n3Addr.To16() - } + addr := e.n3TransportLayerAddress() dlTEID = e.allocTEID() @@ -244,7 +250,7 @@ func (e *ENB) SendPathSwitchRequest(enbUEID, sourceMMEUEID int64, erabID s1ap.ER ENBUES1APID: s1ap.ENBUES1APID(enbUEID), ERABToBeSwitchedDL: []s1ap.ERABToBeSwitchedDLItem{{ ERABID: erabID, - TransportLayerAddress: s1ap.TransportLayerAddress(addr), + TransportLayerAddress: addr, GTPTEID: s1ap.GTPTEID(dlTEID), }}, SourceMMEUES1APID: s1ap.MMEUES1APID(sourceMMEUEID), @@ -267,9 +273,9 @@ func (e *ENB) SendPathSwitchRequest(enbUEID, sourceMMEUEID int64, erabID s1ap.ER // CauseUserInactivity is the S1AP radioNetwork cause an eNB uses to request a UE // context release on inactivity (TS 36.413 §9.2.1.3, value 20). -var CauseUserInactivity = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 20} +var CauseUserInactivity = s1ap.CauseRadioNetworkUserInactivity.Cause() -var CauseNotSupportedQCIValue = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 1, Extended: true} +var CauseNotSupportedQCIValue = s1ap.CauseRadioNetworkNotSupportedQCIValue.Cause() // SendUEContextReleaseRequest asks the MME to release the UE's S1 context, as an // eNB does on inactivity or radio-link failure (TS 36.413 §8.3.2). @@ -288,9 +294,9 @@ func (e *ENB) SendUEContextReleaseRequest(mmeUEID, enbUEID int64, cause s1ap.Cau return e.SendMessage(b, true) } -var CauseRadioConnectionWithUELost = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioConnectionWithUELost} +var CauseRadioConnectionWithUELost = s1ap.CauseRadioNetworkRadioConnectionWithUELost.Cause() -var CauseReleaseDueToPreemption = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: 3, Extended: true} +var CauseReleaseDueToPreemption = s1ap.CauseRadioNetworkReleaseDueToPreemption.Cause() func (e *ENB) SendERABReleaseIndication(mmeUEID, enbUEID int64, erab s1ap.ERABID, cause s1ap.Cause) error { ind := &s1ap.ERABReleaseIndication{ @@ -360,12 +366,22 @@ func (e *ENB) SendUEContextReleaseComplete(mmeUEID, enbUEID int64) error { return e.SendMessage(b, true) } +func resetType(resetAll bool, items []s1ap.UEAssociatedLogicalS1ConnectionItem) s1ap.ResetType { + if resetAll { + return s1ap.ResetType{S1Interface: s1ap.Ptr(s1ap.ResetAllResetAll)} + } + + list := s1ap.UEAssociatedLogicalS1ConnectionListRes(items) + + return s1ap.ResetType{PartOfS1Interface: &list} +} + // SendReset sends an S1AP RESET (TS 36.413 §8.7.1). resetAll selects a // whole-interface reset; otherwise items names the UE-associated logical // S1-connections to reset. Reset is a non-UE-associated procedure, sent on // SCTP stream 0. func (e *ENB) SendReset(cause s1ap.Cause, resetAll bool, items []s1ap.UEAssociatedLogicalS1ConnectionItem) error { - req := &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: s1ap.ResetType{All: resetAll, Part: items}} + req := &s1ap.Reset{Cause: s1ap.Ptr(cause), ResetType: resetType(resetAll, items)} b, err := req.Marshal() if err != nil { diff --git a/internal/tester/s1enb/server.go b/internal/tester/s1enb/server.go index f4db2f7908..bd89e0693d 100644 --- a/internal/tester/s1enb/server.go +++ b/internal/tester/s1enb/server.go @@ -62,10 +62,19 @@ type Frame struct { // (S1 Setup, Reset). Real eNB-UE-S1AP-IDs start at 1 (see AllocateENBUEID). const NoUEID int64 = 0 +type ENBIDKind uint8 + +const ( + ENBIDMacro ENBIDKind = iota + ENBIDHome + ENBIDShortMacro + ENBIDLongMacro +) + // StartOpts configures an eNB simulator. type StartOpts struct { ENBID uint32 // eNB identity, at the width ENBIDKind implies - ENBIDKind s1ap.ENBIDKind + ENBIDKind ENBIDKind MCC string MNC string TAC string // hex or decimal string; parsed as the 16-bit TAC @@ -95,7 +104,7 @@ var DefaultUERadioCapability = []byte{0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, type ENB struct { enbID uint32 - enbIDKind s1ap.ENBIDKind + enbIDKind ENBIDKind name string plmn s1ap.PLMNIdentity bplmns s1ap.BPLMNs @@ -762,8 +771,8 @@ func frameENBUEID(f Frame) int64 { // Only the pair alternative names an eNB UE S1AP ID; a Command // addressed by the MME id alone cannot be demultiplexed per UE // (TS 36.413 §9.1.4.6). - if m, err := s1ap.ParseUEContextReleaseCommand(f.Value); err == nil && m.UES1APIDs.Pair { - return int64(m.UES1APIDs.ENBUES1APID) + if m, err := s1ap.ParseUEContextReleaseCommand(f.Value); err == nil && m.UES1APIDs.UES1APIDPair != nil { + return int64(m.UES1APIDs.UES1APIDPair.ENBUES1APID) } case f.Category == Initiating && f.ProcedureCode == s1ap.ProcERABSetup: if m, err := s1ap.ParseERABSetupRequest(f.Value); err == nil { diff --git a/internal/tester/s1enb/ue.go b/internal/tester/s1enb/ue.go index a4d478fa6a..1997980319 100644 --- a/internal/tester/s1enb/ue.go +++ b/internal/tester/s1enb/ue.go @@ -153,8 +153,8 @@ func (ue *UE) UseUnknownGUTI() { // octet is shifted left, matching how the MME stored them at attach. func (ue *UE) S1APSecurityCapabilities() s1ap.UESecurityCapabilities { return s1ap.UESecurityCapabilities{ - EncryptionAlgorithms: uint16(ue.netCapEEA<<1) << 8, - IntegrityProtectionAlgorithms: uint16(ue.netCapEIA<<1) << 8, + EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: uint16(ue.netCapEEA<<1) << 8}, + IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: uint16(ue.netCapEIA<<1) << 8}, } } diff --git a/internal/tester/scenarios/gnb/n2_handover_failure.go b/internal/tester/scenarios/gnb/n2_handover_failure.go index 4f2706b94b..6988b707f8 100644 --- a/internal/tester/scenarios/gnb/n2_handover_failure.go +++ b/internal/tester/scenarios/gnb/n2_handover_failure.go @@ -139,7 +139,7 @@ func runN2HandoverTargetRefuses(_ context.Context, env scenarios.Env, _ any) err return err } - refusal := ngaplib.Cause{Group: ngaplib.CauseGroupRadioNetwork, Value: ngaplib.CauseRadioNetworkHOFailureInTarget} + refusal := ngaplib.CauseRadioNetworkHOFailureInTarget.Cause() if err := pair.Target.SendHandoverFailure(int64(req.AMFUENGAPID), refusal); err != nil { return fmt.Errorf("refuse the handover at the target gNB: %w", err) } @@ -161,8 +161,8 @@ func runN2HandoverTargetRefuses(_ context.Context, env scenarios.Env, _ any) err return errors.New("the Handover Preparation Failure carries no cause") } - if fail.Cause.Group != ngaplib.CauseGroupRadioNetwork || fail.Cause.Value != ngaplib.CauseRadioNetworkHOFailureInTarget { - return fmt.Errorf("the Handover Preparation Failure cause = %+v, want a radio-network failure in the target", *fail.Cause) + if !fail.Cause.Equal(ngaplib.CauseRadioNetworkHOFailureInTarget.Cause()) { + return fmt.Errorf("the Handover Preparation Failure cause = %v, want a radio-network failure in the target", *fail.Cause) } return survivesOnSource(pair) @@ -211,7 +211,7 @@ func runN2HandoverCancel(_ context.Context, env scenarios.Env, _ any) error { return err } - cancelCause := ngaplib.Cause{Group: ngaplib.CauseGroupRadioNetwork, Value: ngaplib.CauseRadioNetworkHandoverCancelled} + cancelCause := ngaplib.CauseRadioNetworkHandoverCancelled.Cause() if err := pair.Source.SendHandoverCancel(pair.AMFUENGAPID, pair.RANUENGAPID, cancelCause); err != nil { return fmt.Errorf("cancel the handover at the source gNB: %w", err) } @@ -239,7 +239,7 @@ func runN2HandoverCancel(_ context.Context, env scenarios.Env, _ any) error { return fmt.Errorf("parse the target's UEContextReleaseCommand: %w", err) } - if !cmd.UENGAPIDs.Pair || int64(cmd.UENGAPIDs.RANUENGAPID) != targetRanUENGAPID { + if pair := cmd.UENGAPIDs.UENGAPIDPair; pair == nil || int64(pair.RANUENGAPID) != targetRanUENGAPID { return fmt.Errorf("the UEContextReleaseCommand named RAN-UE-NGAP-ID %v, want the target's %d", cmd.UENGAPIDs, targetRanUENGAPID) } diff --git a/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go b/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go index e90d294db4..00335962f7 100644 --- a/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go +++ b/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go @@ -263,7 +263,8 @@ func forwardingEndpoint(frame gnb.SCTPFrame, upfAddress string, targetForwarding return relayEndpoint{}, fmt.Errorf("the source was given the target's forwarding TEID %#x, not a tunnel on the UPF", teid) } - v4, v6 := transfer.DLForwardingUPTNLInformation.GTPTunnel.TransportLayerAddress.IPs() + tla := transfer.DLForwardingUPTNLInformation.GTPTunnel.TransportLayerAddress + v4, v6 := tla.IPv4(), tla.IPv6() upf, err := netip.ParseAddr(upfAddress) if err != nil { diff --git a/internal/tester/scenarios/gnb/n2_handover_partial_admission.go b/internal/tester/scenarios/gnb/n2_handover_partial_admission.go index 4cfb29a3ea..38dd7769ee 100644 --- a/internal/tester/scenarios/gnb/n2_handover_partial_admission.go +++ b/internal/tester/scenarios/gnb/n2_handover_partial_admission.go @@ -133,7 +133,7 @@ func runN2HandoverPartialAdmission(_ context.Context, env scenarios.Env, _ any) return fmt.Errorf("the HandoverRequest carried %d PDU sessions, want 2", len(req.PDUSessionResourceSetupListHOReq)) } - refusal := ngaplib.Cause{Group: ngaplib.CauseGroupRadioNetwork, Value: ngaplib.CauseRadioNetworkRadioResourcesNotAvailable} + refusal := ngaplib.CauseRadioNetworkRadioResourcesNotAvailable.Cause() if err := targetGNB.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: int64(req.AMFUENGAPID), diff --git a/internal/tester/scenarios/gnb/ng_reset.go b/internal/tester/scenarios/gnb/ng_reset.go index 98ee1aff5f..29148c713c 100644 --- a/internal/tester/scenarios/gnb/ng_reset.go +++ b/internal/tester/scenarios/gnb/ng_reset.go @@ -56,9 +56,7 @@ func runNGReset(_ context.Context, env scenarios.Env, _ any) error { } if err := node.SendNGReset(&gnb.NGResetOpts{ - Cause: ngaplib.Ptr(ngaplib.Cause{ - Group: ngaplib.CauseGroupMisc, Value: ngaplib.CauseMiscUnspecified, - }), + Cause: new(ngaplib.CauseMiscUnspecified.Cause()), ResetAll: true, }); err != nil { return fmt.Errorf("send NGReset: %w", err) diff --git a/internal/tester/scenarios/gnb/ng_setup_failure.go b/internal/tester/scenarios/gnb/ng_setup_failure.go index 8ca1a1cbf5..853d881272 100644 --- a/internal/tester/scenarios/gnb/ng_setup_failure.go +++ b/internal/tester/scenarios/gnb/ng_setup_failure.go @@ -68,8 +68,8 @@ func runNGSetupFailureUnknownPLMN(_ context.Context, env scenarios.Env, _ any) e // TS 38.455 gives Misc one root value, unknown-PLMN-or-SNPN, at index 4 // (TS 38.413 §9.3.1.2). - want := ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscUnknownPLMNOrSNPN} - if *failure.Cause != want { + want := ngap.CauseMiscUnknownPLMNOrSNPN.Cause() + if !failure.Cause.Equal(want) { return fmt.Errorf("expected cause Misc unknown-PLMN-or-SNPN, got %v", failure.Cause) } diff --git a/internal/tester/scenarios/gnb/ue_context_release.go b/internal/tester/scenarios/gnb/ue_context_release.go index 1404622d2d..34d42af8f1 100644 --- a/internal/tester/scenarios/gnb/ue_context_release.go +++ b/internal/tester/scenarios/gnb/ue_context_release.go @@ -127,13 +127,13 @@ func validateUEContextReleaseCommand(fr gnb.SCTPFrame, want ngaplib.Cause) error return fmt.Errorf("cause is absent") } - if *cmd.Cause != want { + if !cmd.Cause.Equal(want) { return fmt.Errorf("unexpected Cause: got %+v, want %+v", *cmd.Cause, want) } // The AMF addresses a UE it has a RAN UE NGAP ID for by the pair // (TS 38.413 §9.2.2.5). - if !cmd.UENGAPIDs.Pair { + if cmd.UENGAPIDs.UENGAPIDPair == nil { return fmt.Errorf("UE-NGAP-IDs carries no RAN UE NGAP ID") } diff --git a/internal/tester/scenarios/gnb/xn_path_switch.go b/internal/tester/scenarios/gnb/xn_path_switch.go index 865982fef4..5550bdf846 100644 --- a/internal/tester/scenarios/gnb/xn_path_switch.go +++ b/internal/tester/scenarios/gnb/xn_path_switch.go @@ -200,7 +200,9 @@ func xnPathSwitch(targetGNB *gnb.GnodeB, opts *xnPathSwitchOpts) (*ngaplib.PathS func xnUESecurityCapabilities() ngaplib.UESecurityCapabilities { return ngaplib.UESecurityCapabilities{ - NREncryptionAlgorithms: 0x4000, - NRIntegrityProtectionAlgorithms: 0x4000, + NREncryptionAlgorithms: ngaplib.SecurityAlgorithmsFrom(0x4000), + NRIntegrityProtectionAlgorithms: ngaplib.SecurityAlgorithmsFrom(0x4000), + EUTRAEncryptionAlgorithms: ngaplib.SecurityAlgorithmsFrom(0), + EUTRAIntegrityProtectionAlgorithms: ngaplib.SecurityAlgorithmsFrom(0), } } diff --git a/internal/tester/scenarios/gnb/xn_path_switch_failure.go b/internal/tester/scenarios/gnb/xn_path_switch_failure.go index 844879ad70..ed3b3b43ce 100644 --- a/internal/tester/scenarios/gnb/xn_path_switch_failure.go +++ b/internal/tester/scenarios/gnb/xn_path_switch_failure.go @@ -122,8 +122,8 @@ func runXnPathSwitchFailure(_ context.Context, env scenarios.Env, _ any) error { return fmt.Errorf("parse PathSwitchRequestUnsuccessfulTransfer: %w", err) } - if transfer.Cause.Group != ngaplib.CauseGroupRadioNetwork || transfer.Cause.Value != ngaplib.CauseRadioNetworkUnknownLocalUENGAPID { - return fmt.Errorf("the failure cause = %+v, want a radio-network unknown-local-UE-NGAP-ID", transfer.Cause) + if !transfer.Cause.Equal(ngaplib.CauseRadioNetworkUnknownLocalUENGAPID.Cause()) { + return fmt.Errorf("the failure cause = %v, want a radio-network unknown-local-UE-NGAP-ID", transfer.Cause) } if _, err := sourceGNB.WaitForMessage(gnb.Initiating, ngaplib.ProcUEContextRelease, 500*time.Millisecond); err == nil { diff --git a/internal/tester/scenarios/interworking/handover.go b/internal/tester/scenarios/interworking/handover.go index 5fe1d2aed3..a65eadb7f1 100644 --- a/internal/tester/scenarios/interworking/handover.go +++ b/internal/tester/scenarios/interworking/handover.go @@ -356,7 +356,7 @@ func refuseHandoverToEPS(gNodeB *gnb.GnodeB, e *s1enb.ENB, ranUENGAPID int64) er return fmt.Errorf("the target eNB got no Handover Request: %w", err) } - refusal := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOFailureInTarget} + refusal := s1ap.CauseRadioNetworkHOFailureInTarget.Cause() if err := e.SendHandoverFailure(int64(req.MMEUES1APID), refusal); err != nil { return fmt.Errorf("refuse the handover at the target eNB: %w", err) } @@ -371,8 +371,8 @@ func refuseHandoverToEPS(gNodeB *gnb.GnodeB, e *s1enb.ENB, ranUENGAPID int64) er } // TS 38.413 §9.3.1.2 - if fail.Cause.Group != ngap.CauseGroupRadioNetwork || fail.Cause.Value != ngap.CauseRadioNetworkHOFailureInTarget { - return fmt.Errorf("the Handover Preparation Failure cause = %+v, want a radio-network failure in the target", *fail.Cause) + if !fail.Cause.Equal(ngap.CauseRadioNetworkHOFailureInTarget.Cause()) { + return fmt.Errorf("the Handover Preparation Failure cause = %v, want a radio-network failure in the target", *fail.Cause) } return nil diff --git a/internal/tester/scenarios/interworking/handover_to_5gs.go b/internal/tester/scenarios/interworking/handover_to_5gs.go index 294af2788c..a27b9f5ff6 100644 --- a/internal/tester/scenarios/interworking/handover_to_5gs.go +++ b/internal/tester/scenarios/interworking/handover_to_5gs.go @@ -30,7 +30,7 @@ const ( targetGNBIDBits = 24 ) -var handoverRequiredCause = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkTimeCriticalHandover} +var handoverRequiredCause = s1ap.CauseRadioNetworkTimeCriticalHandover.Cause() func init() { scenarios.Register(scenarios.Scenario{ @@ -262,8 +262,8 @@ func checkArrivingHandoverRequest(req *ngap.HandoverRequest) (fgs.S1ModeToN1Mode return none, fmt.Errorf("the Handover Request handover type = %d, want eps-to-5gs", req.HandoverType) } - want := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkTimeCriticalHandover} - if req.Cause == nil || *req.Cause != want { + want := ngap.CauseRadioNetworkTimeCriticalHandover.Cause() + if req.Cause == nil || !req.Cause.Equal(want) { return none, fmt.Errorf("the Handover Request cause = %+v, want the time-critical handover the eNB asked for", req.Cause) } @@ -358,7 +358,7 @@ func refuseHandoverToFiveGS(gNodeB *gnb.GnodeB, e *s1enb.ENB, attached *s1enb.At return fmt.Errorf("the target gNB got no Handover Request: %w", err) } - refusal := ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell} + refusal := ngap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause() if err := gNodeB.SendHandoverFailure(int64(req.AMFUENGAPID), refusal); err != nil { return fmt.Errorf("refuse the handover at the target gNB: %w", err) } @@ -372,7 +372,7 @@ func refuseHandoverToFiveGS(gNodeB *gnb.GnodeB, e *s1enb.ENB, attached *s1enb.At return errors.New("the Handover Preparation Failure carries no cause") } - if fail.Cause.Group != s1ap.CauseGroupRadioNetwork || fail.Cause.Value != s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell { + if !fail.Cause.Equal(s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause()) { return fmt.Errorf("the Handover Preparation Failure cause = %+v, want no radio resources available in the target cell", *fail.Cause) } diff --git a/internal/tester/scenarios/interworking/ims_calls.go b/internal/tester/scenarios/interworking/ims_calls.go index 9b770822a5..a70e46893c 100644 --- a/internal/tester/scenarios/interworking/ims_calls.go +++ b/internal/tester/scenarios/interworking/ims_calls.go @@ -36,8 +36,8 @@ var ( imsFallbackHandoverCallee = scenarios.IMSSubscriber("001018600000012", "+15558600012") imsFallbackRedirectCaller = scenarios.IMSSubscriber("001018600000013", "+15558600013") imsFallbackRedirectCallee = scenarios.IMSSubscriber("001018600000014", "+15558600014") - imsEPSFallbackCause = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkIMSVoiceEPSFallbackTriggered} - imsRedirectionCause = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRedirection} + imsEPSFallbackCause = ngap.CauseRadioNetworkIMSVoiceEPSFallbackTriggered.Cause() + imsRedirectionCause = ngap.CauseRadioNetworkRedirection.Cause() imsFallbackRequestDeadline = 10 * time.Second ) @@ -418,8 +418,19 @@ func awaitNGContextReleased(g *gnb.GnodeB, amfUEID int64) error { return fmt.Errorf("parse UE Context Release Command: %w", err) } - if int64(cmd.UENGAPIDs.AMFUENGAPID) != amfUEID { - return fmt.Errorf("the AMF released AMF UE NGAP ID %d, want %d", cmd.UENGAPIDs.AMFUENGAPID, amfUEID) + var released ngap.AMFUENGAPID + + switch ids := cmd.UENGAPIDs; { + case ids.UENGAPIDPair != nil: + released = ids.UENGAPIDPair.AMFUENGAPID + case ids.AMFUENGAPID != nil: + released = *ids.AMFUENGAPID + default: + return errors.New("the UE Context Release Command names no AMF UE NGAP ID") + } + + if int64(released) != amfUEID { + return fmt.Errorf("the AMF released AMF UE NGAP ID %d, want %d", released, amfUEID) } if _, err := g.WaitForMessage(gnb.Initiating, ngap.ProcPDUSessionResourceRelease, 0); err == nil { diff --git a/internal/tester/scenarios/interworking/ims_mcptt.go b/internal/tester/scenarios/interworking/ims_mcptt.go index 68f4b9d673..fca8875147 100644 --- a/internal/tester/scenarios/interworking/ims_mcptt.go +++ b/internal/tester/scenarios/interworking/ims_mcptt.go @@ -7,7 +7,6 @@ import ( "context" "errors" "fmt" - "reflect" "slices" "time" @@ -179,7 +178,7 @@ func mcpttHandoverSteps(ctx context.Context, r *imsCallRANs, p *imsParty, as *sc return hangUp(fmt.Errorf("handover to EPS: %w", err)) } - if qos := h.qos[mcpttQCI]; !reflect.DeepEqual(qos.ARP, mcpttNormalARP) { + if qos := h.qos[mcpttQCI]; qos.ARP != mcpttNormalARP { return hangUp(fmt.Errorf("the QCI %d E-RAB of the Handover Request has ARP %+v for %s, want the call's %+v kept (TS 23.502 §4.11.1.2.1 step 2, TS 29.214 Annex A.13.2)", mcpttQCI, qos.ARP, mcpttNormalPriority, mcpttNormalARP)) } diff --git a/internal/tester/scenarios/interworking/ims_parties.go b/internal/tester/scenarios/interworking/ims_parties.go index 503054171b..65e579cc2d 100644 --- a/internal/tester/scenarios/interworking/ims_parties.go +++ b/internal/tester/scenarios/interworking/ims_parties.go @@ -46,7 +46,7 @@ const ( var ( imsVoicePayload = []byte{0x80, 0x76, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1} - imsRefusal = s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell} + imsRefusal = s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause() ) func registerIMS(name string, run func(context.Context, scenarios.Env) error, subs ...scenarios.SubscriberSpec) { diff --git a/internal/tester/scenarios/interworking/ims_video.go b/internal/tester/scenarios/interworking/ims_video.go index 69c235bd95..9d8026c338 100644 --- a/internal/tester/scenarios/interworking/ims_video.go +++ b/internal/tester/scenarios/interworking/ims_video.go @@ -39,7 +39,7 @@ var ( imsVideoFlowReleaseCause = s1enb.CauseRadioConnectionWithUELost imsVideoMediaKinds = []string{sdp.Audio, sdp.Video} imsVideoTransport = scenarios.IMSTransports[0] - imsVideoRefusal = ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkRadioResourcesNotAvailable} + imsVideoRefusal = ngap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() ) func init() { diff --git a/internal/tester/scenarios/s1enb/context_release.go b/internal/tester/scenarios/s1enb/context_release.go index 93942a222e..969a5a6b31 100644 --- a/internal/tester/scenarios/s1enb/context_release.go +++ b/internal/tester/scenarios/s1enb/context_release.go @@ -63,21 +63,22 @@ func runS1ENBContextRelease(_ context.Context, env scenarios.Env, _ any) error { return fmt.Errorf("UE Context Release Command carried no cause, want radioNetwork user-inactivity %+v", s1enb.CauseUserInactivity) } - if *cmd.Cause != s1enb.CauseUserInactivity { + if !cmd.Cause.Equal(s1enb.CauseUserInactivity) { return fmt.Errorf("UE Context Release Command cause = %+v, want radioNetwork user-inactivity %+v", *cmd.Cause, s1enb.CauseUserInactivity) } - if !cmd.UES1APIDs.Pair { + pair := cmd.UES1APIDs.UES1APIDPair + if pair == nil { return fmt.Errorf("UE Context Release Command carried a single UE-S1AP-ID, want the MME+eNB pair") } - if got := int64(cmd.UES1APIDs.MMEUES1APID); got != res.MMEUES1APID { + if got := int64(pair.MMEUES1APID); got != res.MMEUES1APID { return fmt.Errorf("UE Context Release Command MME-UE-S1AP-ID = %d, want %d", got, res.MMEUES1APID) } - if got := int64(cmd.UES1APIDs.ENBUES1APID); got != res.ENBUES1APID { + if got := int64(pair.ENBUES1APID); got != res.ENBUES1APID { return fmt.Errorf("UE Context Release Command eNB-UE-S1AP-ID = %d, want %d", got, res.ENBUES1APID) } - return e.SendUEContextReleaseComplete(int64(cmd.UES1APIDs.MMEUES1APID), int64(cmd.UES1APIDs.ENBUES1APID)) + return e.SendUEContextReleaseComplete(int64(pair.MMEUES1APID), int64(pair.ENBUES1APID)) } diff --git a/internal/tester/scenarios/s1enb/drain_4g.go b/internal/tester/scenarios/s1enb/drain_4g.go index 44b2463c9a..315f8176f2 100644 --- a/internal/tester/scenarios/s1enb/drain_4g.go +++ b/internal/tester/scenarios/s1enb/drain_4g.go @@ -22,10 +22,7 @@ const drainIMSI = "001017271246607" const drainSignalTimeout = 60 * time.Second -var causeLoadBalancingTAURequired = s1ap.Cause{ - Group: s1ap.CauseGroupRadioNetwork, - Value: s1ap.CauseRadioNetworkLoadBalancingTAURequired, -} +var causeLoadBalancingTAURequired = s1ap.CauseRadioNetworkLoadBalancingTAURequired.Cause() func init() { scenarios.Register(scenarios.Scenario{ @@ -118,12 +115,12 @@ func runS1ENBDrain(env scenarios.Env) error { return fmt.Errorf("phase2: UE Context Release Command carried no cause, want %+v", causeLoadBalancingTAURequired) } - if *cmd.Cause != causeLoadBalancingTAURequired { + if !cmd.Cause.Equal(causeLoadBalancingTAURequired) { return fmt.Errorf("phase2: release cause = %+v, want load-balancing-tau-required %+v; the UE would keep its GUMMEI and come back", *cmd.Cause, causeLoadBalancingTAURequired) } logger.Logger.Info("phase2: UE released for load re-balancing") - return e.SendUEContextReleaseComplete(int64(cmd.UES1APIDs.MMEUES1APID), int64(cmd.UES1APIDs.ENBUES1APID)) + return e.SendUEContextReleaseComplete(ueS1APIDs(cmd.UES1APIDs)) } diff --git a/internal/tester/scenarios/s1enb/erab_setup_release.go b/internal/tester/scenarios/s1enb/erab_setup_release.go index da75916d5f..1cb27b037b 100644 --- a/internal/tester/scenarios/s1enb/erab_setup_release.go +++ b/internal/tester/scenarios/s1enb/erab_setup_release.go @@ -132,9 +132,9 @@ func assertERABRelease(pdn *s1enb.PDNResult, rel *s1enb.PDNReleaseResult) error return fmt.Errorf("E-RAB Release Command released E-RAB %d, want the %d the PDN disconnect named", rel.ERABID, pdn.ERABID) } - if rel.Cause.Group != s1ap.CauseGroupNAS || rel.Cause.Value != s1ap.CauseNASNormalRelease { - return fmt.Errorf("E-RAB Release Command cause = group %d value %d, want NAS normal-release for a UE-requested PDN disconnect", - rel.Cause.Group, rel.Cause.Value) + if !rel.Cause.Equal(s1ap.CauseNASNormalRelease.Cause()) { + return fmt.Errorf("E-RAB Release Command cause = %s, want NAS normal-release for a UE-requested PDN disconnect", + rel.Cause) } return nil diff --git a/internal/tester/scenarios/s1enb/error_indication.go b/internal/tester/scenarios/s1enb/error_indication.go index dae4afce23..de678fad62 100644 --- a/internal/tester/scenarios/s1enb/error_indication.go +++ b/internal/tester/scenarios/s1enb/error_indication.go @@ -106,7 +106,7 @@ func runS1ENBErrorIndication(ctx context.Context, env scenarios.Env) error { return fmt.Errorf("the MME did not release S1 after the Error Indication: %w", err) } - if err := e.SendUEContextReleaseComplete(int64(cmd.UES1APIDs.MMEUES1APID), int64(cmd.UES1APIDs.ENBUES1APID)); err != nil { + if err := e.SendUEContextReleaseComplete(ueS1APIDs(cmd.UES1APIDs)); err != nil { return fmt.Errorf("acknowledge the UE Context Release: %w", err) } diff --git a/internal/tester/scenarios/s1enb/helpers.go b/internal/tester/scenarios/s1enb/helpers.go index 9fdaff72aa..8c656fbd1b 100644 --- a/internal/tester/scenarios/s1enb/helpers.go +++ b/internal/tester/scenarios/s1enb/helpers.go @@ -139,3 +139,15 @@ func assertStatusTransferRelayed(mst *s1ap.MMEStatusTransfer) error { return nil } + +func ueMMEID(ids s1ap.UES1APIDs) int64 { + mme, _ := ids.MMEID() + + return int64(mme) +} + +func ueS1APIDs(ids s1ap.UES1APIDs) (int64, int64) { + enb, _ := ids.ENBID() + + return ueMMEID(ids), int64(enb) +} diff --git a/internal/tester/scenarios/s1enb/ims_mcptt.go b/internal/tester/scenarios/s1enb/ims_mcptt.go index f0094e5fb1..07b0e75baa 100644 --- a/internal/tester/scenarios/s1enb/ims_mcptt.go +++ b/internal/tester/scenarios/s1enb/ims_mcptt.go @@ -7,7 +7,6 @@ import ( "context" "errors" "fmt" - "reflect" "slices" "time" @@ -212,7 +211,7 @@ func (m *mcpttENB) checkVoice(b *s1enb.DedicatedBearer) error { return fmt.Errorf("UE %s MCPTT speech E-RAB has no guaranteed bit rate: %+v", m.u.ue.IMSI, b.QoS.GBR) case !ok || rates.GuaranteedDownlinkKbps == 0 || rates.GuaranteedUplinkKbps == 0: return fmt.Errorf("UE %s MCPTT speech EPS QoS has no guaranteed bit rate", m.u.ue.IMSI) - case !reflect.DeepEqual(b.QoS.ARP, m.arp): + case b.QoS.ARP != m.arp: return fmt.Errorf("UE %s MCPTT speech E-RAB ARP %+v for %s, want %+v (TS 29.214 Annex A.13.2)", m.u.ue.IMSI, b.QoS.ARP, m.priority, m.arp) case b.TFT.Operation != eps.TFTCreate || len(b.TFT.Filters) == 0: return fmt.Errorf("UE %s MCPTT speech bearer TFT %+v, want new packet filters", m.u.ue.IMSI, b.TFT) @@ -244,7 +243,7 @@ func (m *mcpttENB) awaitUpgrade(b mcpttBearers) error { return fmt.Errorf("UE %s E-RAB %d modified twice for the upgrade to %s", m.u.ue.IMSI, item.ERABID, mcpttUpgradePriority) case item.QoS.QCI != b.dedicated()[i].QoS.QCI: return fmt.Errorf("UE %s E-RAB %d modified to QCI %d, want its QCI %d kept", m.u.ue.IMSI, item.ERABID, item.QoS.QCI, b.dedicated()[i].QoS.QCI) - case !reflect.DeepEqual(item.QoS.ARP, want): + case item.QoS.ARP != want: return fmt.Errorf("UE %s QCI %d E-RAB %d ARP %+v after the upgrade to %s, want %+v (TS 29.214 Annex A.13.2)", m.u.ue.IMSI, item.QoS.QCI, item.ERABID, item.QoS.ARP, mcpttUpgradePriority, want) case item.QoS.GBR == nil: return fmt.Errorf("UE %s MCPTT speech E-RAB %d lost its GBR QoS Information in the upgrade", m.u.ue.IMSI, item.ERABID) diff --git a/internal/tester/scenarios/s1enb/ims_registration.go b/internal/tester/scenarios/s1enb/ims_registration.go index 8711db5437..f8591d5f4e 100644 --- a/internal/tester/scenarios/s1enb/ims_registration.go +++ b/internal/tester/scenarios/s1enb/ims_registration.go @@ -987,7 +987,7 @@ func loseRadioConnection(e *s1enb.ENB, u imsCallUE, _ *s1enb.DedicatedBearer) er return fmt.Errorf("await UE Context Release Command: %w", err) } - return e.SendUEContextReleaseComplete(int64(cmd.UES1APIDs.MMEUES1APID), u.res.ENBUES1APID) + return e.SendUEContextReleaseComplete(ueMMEID(cmd.UES1APIDs), u.res.ENBUES1APID) } func runIMSCallLoss(ctx context.Context, env scenarios.Env, caller, callee scenarios.SubscriberSpec, lose bearerLoss) error { diff --git a/internal/tester/scenarios/s1enb/initial_context_setup.go b/internal/tester/scenarios/s1enb/initial_context_setup.go index ece77c4258..4ccdb55fc1 100644 --- a/internal/tester/scenarios/s1enb/initial_context_setup.go +++ b/internal/tester/scenarios/s1enb/initial_context_setup.go @@ -73,14 +73,14 @@ func assertInitialContextSetupSecurity(ue *s1enb.UE, res *s1enb.AttachResult) er want := ue.S1APSecurityCapabilities() - if res.UESecurityCaps.EncryptionAlgorithms != want.EncryptionAlgorithms { + if res.UESecurityCaps.EncryptionAlgorithms.Value != want.EncryptionAlgorithms.Value { return fmt.Errorf("initial Context Setup encryption algorithms = %#04x, want the %#04x the UE advertised", - res.UESecurityCaps.EncryptionAlgorithms, want.EncryptionAlgorithms) + res.UESecurityCaps.EncryptionAlgorithms.Value, want.EncryptionAlgorithms.Value) } - if res.UESecurityCaps.IntegrityProtectionAlgorithms != want.IntegrityProtectionAlgorithms { + if res.UESecurityCaps.IntegrityProtectionAlgorithms.Value != want.IntegrityProtectionAlgorithms.Value { return fmt.Errorf("initial Context Setup integrity algorithms = %#04x, want the %#04x the UE advertised", - res.UESecurityCaps.IntegrityProtectionAlgorithms, want.IntegrityProtectionAlgorithms) + res.UESecurityCaps.IntegrityProtectionAlgorithms.Value, want.IntegrityProtectionAlgorithms.Value) } return nil diff --git a/internal/tester/scenarios/s1enb/paging.go b/internal/tester/scenarios/s1enb/paging.go index ebda164ed1..e96be2585b 100644 --- a/internal/tester/scenarios/s1enb/paging.go +++ b/internal/tester/scenarios/s1enb/paging.go @@ -116,17 +116,19 @@ func runS1ENBPaging(ctx context.Context, env scenarios.Env, p *pagingParams) err } func assertPaging(p *s1ap.Paging, guti *eps.GUTI) error { - if p.STMSI == nil { + if p.UEPagingID == nil || p.UEPagingID.STMSI == nil { return fmt.Errorf("paging carried no S-TMSI, so the UE cannot recognise itself") } + stmsi := p.UEPagingID.STMSI + wantMTMSI := binary.BigEndian.Uint32(guti.TMSI[:]) - if uint32(p.STMSI.MTMSI) != wantMTMSI { - return fmt.Errorf("paging M-TMSI = %#08x, want the assigned %#08x", uint32(p.STMSI.MTMSI), wantMTMSI) + if uint32(stmsi.MTMSI) != wantMTMSI { + return fmt.Errorf("paging M-TMSI = %#08x, want the assigned %#08x", uint32(stmsi.MTMSI), wantMTMSI) } - if uint8(p.STMSI.MMEC) != guti.MMECode { - return fmt.Errorf("paging MME code = %#02x, want the assigned %#02x", uint8(p.STMSI.MMEC), guti.MMECode) + if uint8(stmsi.MMEC) != guti.MMECode { + return fmt.Errorf("paging MME code = %#02x, want the assigned %#02x", uint8(stmsi.MMEC), guti.MMECode) } if p.UEIdentityIndexValue == nil { @@ -155,7 +157,7 @@ func assertPaging(p *s1ap.Paging, guti *eps.GUTI) error { return fmt.Errorf("parse TAC: %w", err) } - tai := p.TAIList[0] + tai := p.TAIList[0].TAI if uint16(tai.TAC) != uint16(tac) { return fmt.Errorf("paging TAI TAC = %d, want %d", uint16(tai.TAC), uint16(tac)) } diff --git a/internal/tester/scenarios/s1enb/ran_trace.go b/internal/tester/scenarios/s1enb/ran_trace.go index 6ff88b42b6..91b37f2da1 100644 --- a/internal/tester/scenarios/s1enb/ran_trace.go +++ b/internal/tester/scenarios/s1enb/ran_trace.go @@ -114,7 +114,7 @@ func expectS1TraceStart(e *s1enb.ENB, enbUEID int64, plmn []byte) (s1ap.EUTRANTr return s1ap.EUTRANTraceID{}, fmt.Errorf("interfaces %08b depth %d, want %08b minimum", ta.InterfacesToTrace, ta.TraceDepth, wantInterfaces) } - if len(ta.TraceCollectionEntityIPAddress) == 0 { + if ta.TraceCollectionEntityIPAddress.IsZero() { return s1ap.EUTRANTraceID{}, fmt.Errorf("no Trace Collection Entity IP Address") } diff --git a/internal/tester/scenarios/s1enb/s1_handover.go b/internal/tester/scenarios/s1enb/s1_handover.go index b716f99cd6..2818a38024 100644 --- a/internal/tester/scenarios/s1enb/s1_handover.go +++ b/internal/tester/scenarios/s1enb/s1_handover.go @@ -131,7 +131,7 @@ func runS1ENBHandover(ctx context.Context, env scenarios.Env, _ any) error { targetENBUEID := target.AllocateENBUEID() - if ext := hoReq.ERABToBeSetup[0].Extensions; ext != nil && ext.DataForwardingNotPossible != nil { + if hoReq.ERABToBeSetup[0].DataForwardingNotPossible != nil { return fmt.Errorf("handover request declared data forwarding not possible despite a direct forwarding path") } @@ -225,7 +225,7 @@ func assertForwardingRelayed(cmd *s1ap.HandoverCommand, erabID s1ap.ERABID, fwdT return fmt.Errorf("forwarding item DL GTP-TEID = %v, want %#x", item.DLGTPTEID, fwdTEID) } - if len(item.DLTransportLayerAddr) == 0 { + if item.DLTransportLayerAddr == nil || item.DLTransportLayerAddr.IsZero() { return fmt.Errorf("forwarding item carried no DL transport layer address") } diff --git a/internal/tester/scenarios/s1enb/s1_handover_failure.go b/internal/tester/scenarios/s1enb/s1_handover_failure.go index c9851c1542..a9abdb1c01 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_failure.go +++ b/internal/tester/scenarios/s1enb/s1_handover_failure.go @@ -133,7 +133,7 @@ func runS1HandoverTargetRefuses(_ context.Context, env scenarios.Env, _ any) err return err } - refusal := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHOFailureInTarget} + refusal := s1ap.CauseRadioNetworkHOFailureInTarget.Cause() if err := pair.Target.SendHandoverFailure(int64(req.MMEUES1APID), refusal); err != nil { return fmt.Errorf("refuse the handover at the target eNB: %w", err) } @@ -151,7 +151,7 @@ func runS1HandoverTargetRefuses(_ context.Context, env scenarios.Env, _ any) err return errors.New("the Handover Preparation Failure carries no cause") } - if fail.Cause.Group != s1ap.CauseGroupRadioNetwork || fail.Cause.Value != s1ap.CauseRadioNetworkHOFailureInTarget { + if !fail.Cause.Equal(s1ap.CauseRadioNetworkHOFailureInTarget.Cause()) { return fmt.Errorf("the Handover Preparation Failure cause = %+v, want a radio-network failure in the target", *fail.Cause) } @@ -194,7 +194,7 @@ func runS1HandoverCancel(_ context.Context, env scenarios.Env, _ any) error { return err } - cancelCause := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkHandoverCancelled} + cancelCause := s1ap.CauseRadioNetworkHandoverCancelled.Cause() if err := pair.Source.SendHandoverCancel(pair.Attached.MMEUES1APID, pair.Attached.ENBUES1APID, cancelCause); err != nil { return fmt.Errorf("cancel the handover at the source eNB: %w", err) } diff --git a/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go b/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go index d9f7656e1f..4a3af36dc0 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go +++ b/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go @@ -98,7 +98,7 @@ func runS1HandoverIndirectForwarding(_ context.Context, env scenarios.Env, _ any return fmt.Errorf("handover request carried %d E-RABs, want 1", len(hoReq.ERABToBeSetup)) } - if ext := hoReq.ERABToBeSetup[0].Extensions; ext != nil && ext.DataForwardingNotPossible != nil { + if hoReq.ERABToBeSetup[0].DataForwardingNotPossible != nil { return fmt.Errorf("the target was told data forwarding is not possible, so it allocates no forwarding endpoint") } @@ -171,8 +171,8 @@ func s1ForwardingEndpoint(cmd *s1ap.HandoverCommand, erabID s1ap.ERABID, upfAddr return 0, netip.Addr{}, fmt.Errorf("forwarding item names E-RAB %d, want %d", item.ERABID, erabID) } - if item.DLGTPTEID == nil { - return 0, netip.Addr{}, fmt.Errorf("forwarding item carried no DL GTP-TEID, so the source forwards nothing") + if item.DLGTPTEID == nil || item.DLTransportLayerAddr == nil { + return 0, netip.Addr{}, fmt.Errorf("forwarding item carried no DL GTP tunnel, so the source forwards nothing") } teid := uint32(*item.DLGTPTEID) @@ -180,7 +180,7 @@ func s1ForwardingEndpoint(cmd *s1ap.HandoverCommand, erabID s1ap.ERABID, upfAddr return 0, netip.Addr{}, fmt.Errorf("the source was given the target's forwarding TEID %#x, not a tunnel on the UPF", teid) } - v4, v6 := item.DLTransportLayerAddr.IPs() + v4, v6 := item.DLTransportLayerAddr.IPv4(), item.DLTransportLayerAddr.IPv6() upf, err := netip.ParseAddr(upfAddress) if err != nil { diff --git a/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go b/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go index df3ea4f022..43855805cb 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go +++ b/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go @@ -82,7 +82,7 @@ func runS1HandoverPartialAdmission(_ context.Context, env scenarios.Env, _ any) } targetENBUEID := pair.Target.AllocateENBUEID() - refusal := s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkRadioResourcesNotAvailable} + refusal := s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() if _, err := pair.Target.SendHandoverRequestAcknowledgePartial(targetENBUEID, int64(req.MMEUES1APID), []s1ap.ERABID{pair.Attached.ERABID}, []s1ap.ERABID{second.ERABID}, refusal); err != nil { diff --git a/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go b/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go index c7546618f9..3274652168 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go +++ b/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go @@ -187,7 +187,7 @@ func s1PrepareHandoverLeg(source, target *s1enb.ENB, sourceENBUEID, sourceMMEUEI return s1LegEndpoints{}, fmt.Errorf("handover request carried %d E-RABs, want 1", len(hoReq.ERABToBeSetup)) } - if ext := hoReq.ERABToBeSetup[0].Extensions; ext != nil && ext.DataForwardingNotPossible != nil { + if hoReq.ERABToBeSetup[0].DataForwardingNotPossible != nil { return s1LegEndpoints{}, fmt.Errorf("the target was told data forwarding is not possible, so it allocates no forwarding endpoint") } diff --git a/internal/tester/scenarios/s1enb/s1_reset.go b/internal/tester/scenarios/s1enb/s1_reset.go index 19578d79e0..f6295d1cba 100644 --- a/internal/tester/scenarios/s1enb/s1_reset.go +++ b/internal/tester/scenarios/s1enb/s1_reset.go @@ -56,7 +56,7 @@ func runS1Reset(_ context.Context, env scenarios.Env, _ any) error { // and does not race the attach. time.Sleep(2 * time.Second) - cause := s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: 0} + cause := s1ap.CauseMiscControlProcessingOverload.Cause() if err := e.SendReset(cause, true, nil); err != nil { return fmt.Errorf("send Reset: %w", err) } diff --git a/internal/tester/scenarios/s1enb/s1_setup_failure.go b/internal/tester/scenarios/s1enb/s1_setup_failure.go index 63bd5032c6..bc3642b38b 100644 --- a/internal/tester/scenarios/s1enb/s1_setup_failure.go +++ b/internal/tester/scenarios/s1enb/s1_setup_failure.go @@ -63,8 +63,8 @@ func runS1ENBSetupFailureUnknownPLMN(_ context.Context, env scenarios.Env, _ any } // TS 36.413: Cause Misc "unknown-PLMN" is the sixth Misc root value. - if fail.Cause.Group != s1ap.CauseGroupMisc || fail.Cause.Value != 5 { - return fmt.Errorf("expected cause Misc unknown-PLMN, got group %d value %d", fail.Cause.Group, fail.Cause.Value) + if !fail.Cause.Equal(s1ap.CauseMiscUnknownPLMN.Cause()) { + return fmt.Errorf("expected cause Misc unknown-PLMN, got %s", fail.Cause) } return nil diff --git a/internal/tester/scenarios/s1enb/s1_setup_response.go b/internal/tester/scenarios/s1enb/s1_setup_response.go index 23c9f34b63..64be9ddd8b 100644 --- a/internal/tester/scenarios/s1enb/s1_setup_response.go +++ b/internal/tester/scenarios/s1enb/s1_setup_response.go @@ -55,7 +55,7 @@ func runS1SetupHomeENB(_ context.Context, env scenarios.Env, _ any) error { e, err := s1enb.Start(&s1enb.StartOpts{ ENBID: homeENBID, - ENBIDKind: s1ap.ENBIDHome, + ENBIDKind: s1enb.ENBIDHome, MCC: scenarios.DefaultMCC, MNC: scenarios.DefaultMNC, TAC: scenarios.DefaultTAC, diff --git a/internal/tester/scenarios/s1enb/sctp_basics.go b/internal/tester/scenarios/s1enb/sctp_basics.go index 0d05e50456..e760ad9e86 100644 --- a/internal/tester/scenarios/s1enb/sctp_basics.go +++ b/internal/tester/scenarios/s1enb/sctp_basics.go @@ -76,5 +76,5 @@ func runS1ENBSCTPBasics(_ context.Context, env scenarios.Env, _ any) error { return fmt.Errorf("parse UE Context Release Command: %w", err) } - return e.SendUEContextReleaseComplete(int64(cmd.UES1APIDs.MMEUES1APID), int64(cmd.UES1APIDs.ENBUES1APID)) + return e.SendUEContextReleaseComplete(ueS1APIDs(cmd.UES1APIDs)) } diff --git a/internal/tester/scenarios/s1enb/tau_reject.go b/internal/tester/scenarios/s1enb/tau_reject.go index f524e3c10c..a83f5d637e 100644 --- a/internal/tester/scenarios/s1enb/tau_reject.go +++ b/internal/tester/scenarios/s1enb/tau_reject.go @@ -58,9 +58,9 @@ func runS1ENBTAUReject(_ context.Context, env scenarios.Env, _ any) error { res.EMMCause, eps.EMMCauseUEIdentityCannotBeDerived) } - if res.ReleaseCause.Group != s1ap.CauseGroupNAS || res.ReleaseCause.Value != s1ap.CauseNASUnspecified { - return fmt.Errorf("UE Context Release Command cause = group %d value %d, want NAS unspecified", - res.ReleaseCause.Group, res.ReleaseCause.Value) + if !res.ReleaseCause.Equal(s1ap.CauseNASUnspecified.Cause()) { + return fmt.Errorf("UE Context Release Command cause = %s, want NAS unspecified", + res.ReleaseCause) } return nil diff --git a/internal/tester/scenarios/s1enb/x2_path_switch_failure.go b/internal/tester/scenarios/s1enb/x2_path_switch_failure.go index ad0cae88d5..9e95371d6c 100644 --- a/internal/tester/scenarios/s1enb/x2_path_switch_failure.go +++ b/internal/tester/scenarios/s1enb/x2_path_switch_failure.go @@ -64,7 +64,7 @@ func runX2PathSwitchFailure(_ context.Context, env scenarios.Env, _ any) error { return errors.New("the Path Switch Request Failure carries no cause") } - if fail.Cause.Group != s1ap.CauseGroupRadioNetwork || fail.Cause.Value != s1ap.CauseRadioNetworkUnknownMMEUES1APID { + if !fail.Cause.Equal(s1ap.CauseRadioNetworkUnknownMMEUES1APID.Cause()) { return fmt.Errorf("the failure cause = %+v, want a radio-network unknown-MME-UE-S1AP-ID", *fail.Cause) } diff --git a/ngap/abstract_syntax_test.go b/ngap/abstract_syntax_test.go index c3a64bf714..647ec4564b 100644 --- a/ngap/abstract_syntax_test.go +++ b/ngap/abstract_syntax_test.go @@ -4,10 +4,12 @@ package ngap import ( + "bytes" "errors" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // As a peer would send it, without the rules the encoder normally enforces. @@ -28,10 +30,10 @@ func ngSetupFields() []ieField { src := goldRequest() return []ieField{ - {id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, - {id: IDRANNodeName, crit: CriticalityIgnore, val: Name("ella-gnb")}, - {id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, - {id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + {ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, + {ID: IDRANNodeName, Criticality: CriticalityIgnore, Value: Name("ella-gnb")}, + {ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, + {ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, } } @@ -47,7 +49,7 @@ func TestDuplicateIERejected(t *testing.T) { t.Fatalf("error = %v, want *AbstractSyntaxError", err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage.Cause()) { t.Errorf("cause = %s, want falsely-constructed-message", ase.Cause) } } @@ -65,7 +67,7 @@ func TestIEsOutOfOrderRejected(t *testing.T) { t.Fatalf("error = %v, want *AbstractSyntaxError", err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage.Cause()) { t.Errorf("cause = %s, want falsely-constructed-message", ase.Cause) } } @@ -73,7 +75,7 @@ func TestIEsOutOfOrderRejected(t *testing.T) { // §10.3.6 considers only IEs the receiver's version defines. func TestUnknownIEDoesNotBreakOrdering(t *testing.T) { fields := ngSetupFields() - unknown := ieField{id: ProtocolIEID(60000), crit: CriticalityIgnore, raw: []byte{0x01, 0x02}} + unknown := ieField{ID: ProtocolIEID(60000), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01, 0x02})} fields = append([]ieField{fields[0], fields[1], unknown}, fields[2:]...) msg, err := ParseNGSetupRequest(container(t, fields...)) @@ -102,7 +104,7 @@ func TestAbsentIgnoreIEIsDelivered(t *testing.T) { diag := msg.Diagnostics() if len(diag.IEs) != 1 || diag.IEs[0].ID != IDDefaultPagingDRX || - diag.IEs[0].TypeOfError != TypeOfErrorMissing { + typeOfError(diag.IEs[0]) != TypeOfErrorMissing { t.Fatalf("diagnostics = %+v", diag.IEs) } } @@ -122,7 +124,7 @@ func TestAbsentRejectIEStopsDelivery(t *testing.T) { t.Fatalf("error = %v, want *AbstractSyntaxError", err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorReject { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorReject.Cause()) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } @@ -145,31 +147,36 @@ func TestEncodeRejectsUnsetRequiredIE(t *testing.T) { } } -// Recording is bounded, since a peer chooses how many IEs to send. -func TestDiagnosticsAreBounded(t *testing.T) { +func TestDiagnosticsAndPreservationAreUnbounded(t *testing.T) { fields := ngSetupFields() - for i := range maxDiagnosticIEs + 10 { + for i := range paddingIEs { fields = append(fields, ieField{ - id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), }) } - msg, err := ParseNGSetupRequest(container(t, fields...)) + value := container(t, fields...) + + msg, err := ParseNGSetupRequest(value) if err != nil { t.Fatalf("parse: %v", err) } - diag := msg.Diagnostics() - if len(diag.IEs) > maxDiagnosticIEs { - t.Errorf("recorded %d diagnostics, want at most %d", len(diag.IEs), maxDiagnosticIEs) + if got := len(msg.Diagnostics().IEs); got != paddingIEs { + t.Errorf("recorded %d diagnostics, want %d", got, paddingIEs) } - if !diag.Truncated { - t.Error("Truncated = false, want true") + if got := len(msg.UnknownIEs()); got != paddingIEs { + t.Errorf("preserved %d unknown IEs, want %d", got, paddingIEs) + } + + w := per.NewWriter() + if err := msg.encodeBody(w, per.Aligned); err != nil { + t.Fatal(err) } - if got := len(msg.UnknownIEs()); got > maxPreservedIEs { - t.Errorf("preserved %d unknown IEs, want at most %d", got, maxPreservedIEs) + if !bytes.Equal(w.Bytes(), value) { + t.Fatalf("re-encoded\n got %x\n want %x", w.Bytes(), value) } } @@ -216,17 +223,15 @@ func TestOversizedIECountRejected(t *testing.T) { } } -// A notify entry must survive the diagnostics bound or the §10.3.4.2 report -// carries no IE. No IE table assigns notify, but a peer chooses what it stamps. -func TestNotifySurvivesTruncation(t *testing.T) { +func TestNotifyReportedAmongIgnoredIEs(t *testing.T) { fields := ngSetupFields() - for i := range maxDiagnosticIEs + 10 { + for i := range paddingIEs + 10 { fields = append(fields, ieField{ - id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), }) } - fields = append(fields, ieField{id: ProtocolIEID(50000), crit: CriticalityNotify, raw: []byte{0x00}}) + fields = append(fields, ieField{ID: ProtocolIEID(50000), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x00})}) msg, err := ParseNGSetupRequest(container(t, fields...)) if err != nil { @@ -321,9 +326,9 @@ func TestModeledIEsSurvivePadding(t *testing.T) { fields := ngSetupFields() var padded []ieField - for i := range maxPreservedIEs * 2 { + for i := range paddingIEs * 2 { padded = append(padded, ieField{ - id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), }) } diff --git a/ngap/amf_config_update.go b/ngap/amf_config_update.go index fef5104f16..bc2d27c81c 100644 --- a/ngap/amf_config_update.go +++ b/ngap/amf_config_update.go @@ -23,20 +23,20 @@ type AMFConfigurationUpdate struct { var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ { - id: IDAMFName, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDAMFName, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { name := string(n) m.AMFName = &name } return err }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if m.AMFName == nil { return nil, false } @@ -45,11 +45,11 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }, }, { - id: IDServedGUAMIList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ServedGUAMIList) + ID: IDServedGUAMIList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ServedGUAMIList) }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if len(m.ServedGUAMIList) == 0 { return nil, false } @@ -58,9 +58,9 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }, }, { - id: IDRelativeAMFCapacity, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { - v, err := per.DecodeInteger(per.NewReader(raw), enc, relativeAMFCapacityBounds) + ID: IDRelativeAMFCapacity, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, relativeAMFCapacityBounds) if err != nil { return err } @@ -70,7 +70,7 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ return nil }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if m.RelativeAMFCapacity == nil { return nil, false } @@ -81,11 +81,11 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }, }, { - id: IDPLMNSupportList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PLMNSupportList) + ID: IDPLMNSupportList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PLMNSupportList) }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if len(m.PLMNSupportList) == 0 { return nil, false } @@ -94,11 +94,11 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }, }, { - id: IDAMFTNLAssociationToAddList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFTNLAssociationToAddList) + ID: IDAMFTNLAssociationToAddList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFTNLAssociationToAddList) }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if len(m.AMFTNLAssociationToAddList) == 0 { return nil, false } @@ -107,11 +107,11 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }, }, { - id: IDAMFTNLAssociationToRemoveList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFTNLAssociationToRemoveList) + ID: IDAMFTNLAssociationToRemoveList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFTNLAssociationToRemoveList) }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if len(m.AMFTNLAssociationToRemoveList) == 0 { return nil, false } @@ -120,11 +120,11 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }, }, { - id: IDAMFTNLAssociationToUpdateList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFTNLAssociationToUpdateList) + ID: IDAMFTNLAssociationToUpdateList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFTNLAssociationToUpdateList) }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if len(m.AMFTNLAssociationToUpdateList) == 0 { return nil, false } @@ -133,11 +133,11 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ }, }, { - id: IDExtendedAMFName, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDExtendedAMFName, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var v ExtendedAMFName - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -145,7 +145,7 @@ var aMFConfigurationUpdateIEs = []ieSpec[AMFConfigurationUpdate]{ return nil }, - encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdate) (per.Marshaler, bool) { if m.ExtendedAMFName == nil { return nil, false } @@ -179,6 +179,10 @@ func ParseAMFConfigurationUpdate(value []byte) (*AMFConfigurationUpdate, error) return parseMessageBody[AMFConfigurationUpdate](ProcAMFConfigurationUpdate, TriggeringInitiatingMessage, aMFConfigurationUpdateIEs, value) } +func DecodeAMFConfigurationUpdate(value []byte) (*AMFConfigurationUpdate, error) { + return decodeMessageBody[AMFConfigurationUpdate](ProcAMFConfigurationUpdate, aMFConfigurationUpdateIEs, value) +} + type AMFConfigurationUpdateAcknowledge struct { AMFTNLAssociationSetupList AMFTNLAssociationSetupList AMFTNLAssociationFailedToSetupList TNLAssociationList @@ -189,11 +193,11 @@ type AMFConfigurationUpdateAcknowledge struct { var aMFConfigurationUpdateAcknowledgeIEs = []ieSpec[AMFConfigurationUpdateAcknowledge]{ { - id: IDAMFTNLAssociationSetupList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFTNLAssociationSetupList) + ID: IDAMFTNLAssociationSetupList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdateAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFTNLAssociationSetupList) }, - encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { if len(m.AMFTNLAssociationSetupList) == 0 { return nil, false } @@ -202,11 +206,11 @@ var aMFConfigurationUpdateAcknowledgeIEs = []ieSpec[AMFConfigurationUpdateAcknow }, }, { - id: IDAMFTNLAssociationFailedToSetupList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFTNLAssociationFailedToSetupList) + ID: IDAMFTNLAssociationFailedToSetupList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdateAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFTNLAssociationFailedToSetupList) }, - encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { if len(m.AMFTNLAssociationFailedToSetupList) == 0 { return nil, false } @@ -215,11 +219,11 @@ var aMFConfigurationUpdateAcknowledgeIEs = []ieSpec[AMFConfigurationUpdateAcknow }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdateAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -227,7 +231,7 @@ var aMFConfigurationUpdateAcknowledgeIEs = []ieSpec[AMFConfigurationUpdateAcknow return nil }, - encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdateAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -261,6 +265,10 @@ func ParseAMFConfigurationUpdateAcknowledge(value []byte) (*AMFConfigurationUpda return parseMessageBody[AMFConfigurationUpdateAcknowledge](ProcAMFConfigurationUpdate, TriggeringSuccessfulOutcome, aMFConfigurationUpdateAcknowledgeIEs, value) } +func DecodeAMFConfigurationUpdateAcknowledge(value []byte) (*AMFConfigurationUpdateAcknowledge, error) { + return decodeMessageBody[AMFConfigurationUpdateAcknowledge](ProcAMFConfigurationUpdate, aMFConfigurationUpdateAcknowledgeIEs, value) +} + type AMFConfigurationUpdateFailure struct { Cause *Cause TimeToWait *TimeToWait @@ -271,11 +279,11 @@ type AMFConfigurationUpdateFailure struct { var aMFConfigurationUpdateFailureIEs = []ieSpec[AMFConfigurationUpdateFailure]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -283,7 +291,7 @@ var aMFConfigurationUpdateFailureIEs = []ieSpec[AMFConfigurationUpdateFailure]{ return nil }, - encode: func(m *AMFConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdateFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -292,11 +300,11 @@ var aMFConfigurationUpdateFailureIEs = []ieSpec[AMFConfigurationUpdateFailure]{ }, }, { - id: IDTimeToWait, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDTimeToWait, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var ttw TimeToWait - if err := perIEDecode(raw, &ttw); err != nil { + if err := decodeIE(r, &ttw); err != nil { return err } @@ -304,7 +312,7 @@ var aMFConfigurationUpdateFailureIEs = []ieSpec[AMFConfigurationUpdateFailure]{ return nil }, - encode: func(m *AMFConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdateFailure) (per.Marshaler, bool) { if m.TimeToWait == nil { return nil, false } @@ -313,11 +321,11 @@ var aMFConfigurationUpdateFailureIEs = []ieSpec[AMFConfigurationUpdateFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *AMFConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *AMFConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -325,7 +333,7 @@ var aMFConfigurationUpdateFailureIEs = []ieSpec[AMFConfigurationUpdateFailure]{ return nil }, - encode: func(m *AMFConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *AMFConfigurationUpdateFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -358,3 +366,7 @@ func (m *AMFConfigurationUpdateFailure) Marshal() ([]byte, error) { func ParseAMFConfigurationUpdateFailure(value []byte) (*AMFConfigurationUpdateFailure, error) { return parseMessageBody[AMFConfigurationUpdateFailure](ProcAMFConfigurationUpdate, TriggeringUnsuccessfulOutcome, aMFConfigurationUpdateFailureIEs, value) } + +func DecodeAMFConfigurationUpdateFailure(value []byte) (*AMFConfigurationUpdateFailure, error) { + return decodeMessageBody[AMFConfigurationUpdateFailure](ProcAMFConfigurationUpdate, aMFConfigurationUpdateFailureIEs, value) +} diff --git a/ngap/amf_config_update_test.go b/ngap/amf_config_update_test.go index 5638813898..7108c77a3d 100644 --- a/ngap/amf_config_update_test.go +++ b/ngap/amf_config_update_test.go @@ -6,11 +6,11 @@ package ngap import ( "bytes" "errors" - "reflect" "strings" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestAMFConfigurationUpdateRoundTrips(t *testing.T) { @@ -98,7 +98,7 @@ func TestAMFConfigurationUpdateFailureRoundTrips(t *testing.T) { ttw := TimeToWaitV2s in := &AMFConfigurationUpdateFailure{ - Cause: Ptr(Cause{Group: CauseGroupProtocol, Value: CauseProtocolSemanticError}), + Cause: Ptr(CauseProtocolSemanticError.Cause()), TimeToWait: &ttw, } @@ -122,7 +122,7 @@ func TestAMFConfigurationUpdateFailureRoundTrips(t *testing.T) { t.Fatal(err) } - if out.Cause == nil || out.Cause.Group != CauseGroupProtocol { + if out.Cause == nil || out.Cause.Protocol == nil { t.Fatalf("cause mismatch: %+v", out.Cause) } @@ -187,28 +187,28 @@ func TestAMFConfigurationUpdateUnsetPLMNSupportListLeavesEncodingUnchanged(t *te func goldAMFConfigurationUpdateRelay() *AMFConfigurationUpdate { m := goldAMFConfigurationUpdatePLMNSupport() - m.PLMNSupportList[0].NPNSupport = &NPNSupport{SNPN: 0x123456789ab} + m.PLMNSupportList[0].NPNSupport = &NPNSupport{SNPN: Ptr(NID(0x123456789ab))} m.PLMNSupportList[0].ExtendedSliceSupportList = ExtendedSliceSupportList{{SNSSAI: SNSSAI{SST: 3, SD: &SD{0x00, 0x00, 0x02}}}} m.PLMNSupportList[1].OnboardingSupport = Ptr(OnboardingSupportTrue) m.AMFTNLAssociationToAddList = AMFTNLAssociationToAddList{ { - AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 2}}, + AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 0, 0, 2))}, TNLAssociationUsage: Ptr(TNLAssociationUsageBoth), TNLAddressWeightFactor: 255, }, { AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddressAndPort: &EndpointIPAddressAndPort{ - EndpointIPAddress: TransportLayerAddress{10, 0, 0, 3}, PortNumber: 38412, + EndpointIPAddress: tlaOf(10, 0, 0, 3), PortNumber: 38412, }}, TNLAddressWeightFactor: 1, }, } m.AMFTNLAssociationToRemoveList = AMFTNLAssociationToRemoveList{{ - AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 4}}, - TNLAssociationTransportLayerAddressNGRAN: &CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 1, 4}}, + AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 0, 0, 4))}, + TNLAssociationTransportLayerAddressNGRAN: &CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 0, 1, 4))}, }} m.AMFTNLAssociationToUpdateList = AMFTNLAssociationToUpdateList{{ - AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 2}}, + AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 0, 0, 2))}, TNLAssociationUsage: Ptr(TNLAssociationUsageNonUE), TNLAddressWeightFactor: Ptr(TNLAddressWeightFactor(7)), }} @@ -230,7 +230,7 @@ func amfConfigurationUpdateWireCases(t *testing.T) []wireCase { check: func(t *testing.T, a any) { t.Helper() - if !reflect.DeepEqual(a, goldAMFConfigurationUpdateRelay()) { + if !equalByMethod(a, goldAMFConfigurationUpdateRelay()) { t.Fatalf("decoded\n got %+v\n want %+v", a, goldAMFConfigurationUpdateRelay()) } }, @@ -239,18 +239,16 @@ func amfConfigurationUpdateWireCases(t *testing.T) []wireCase { func TestPLMNSupportItemUnknownExtensionKeepsItsPosition(t *testing.T) { item := goldAMFConfigurationUpdateRelay().PLMNSupportList[0] - item.iEExtensions = messageMeta{ - unknownIEs: []rawIE{{id: 9999, crit: CriticalityIgnore, value: []byte{0x5a}}}, - wire: []wireSlot{ - {id: IDNPNSupport, crit: CriticalityReject, unknown: -1}, - {id: 9999, crit: CriticalityIgnore, unknown: 0}, - {id: IDExtendedSliceSupportList, crit: CriticalityReject, unknown: -1}, - }, - } - + restore := swapTable(&extIEsPLMNSupportItem, + tableRow(extIEsPLMNSupportItem, IDNPNSupport, CriticalityReject), + rawRow[PLMNSupportItem](9999, CriticalityIgnore, []byte{0x5a}), + tableRow(extIEsPLMNSupportItem, IDExtendedSliceSupportList, CriticalityReject), + ) m := &AMFConfigurationUpdate{PLMNSupportList: PLMNSupportList{item}} pdu := marshalT(t, m) + restore() + p, err := Unmarshal(pdu) if err != nil { t.Fatal(err) @@ -262,7 +260,7 @@ func TestPLMNSupportItemUnknownExtensionKeepsItsPosition(t *testing.T) { } got := out.PLMNSupportList[0] - if got.NPNSupport == nil || len(got.ExtendedSliceSupportList) != 1 || len(got.iEExtensions.unknownIEs) != 1 { + if got.NPNSupport == nil || len(got.ExtendedSliceSupportList) != 1 || len(got.iEExtensions.UnknownIEs()) != 1 { t.Fatalf("decoded %+v", got) } @@ -273,7 +271,7 @@ func TestPLMNSupportItemUnknownExtensionKeepsItsPosition(t *testing.T) { func TestPLMNSupportItemUnknownRejectExtensionRejectsProcedure(t *testing.T) { item := goldAMFConfigurationUpdateRelay().PLMNSupportList[1] - item.iEExtensions = messageMeta{unknownIEs: []rawIE{{id: 9999, crit: CriticalityReject, value: []byte{0x5a}}}} + item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityReject, Value: []byte{0x5a}}) p, err := Unmarshal(marshalT(t, &AMFConfigurationUpdate{PLMNSupportList: PLMNSupportList{item}})) if err != nil { @@ -302,7 +300,7 @@ func TestAMFTNLAssociationToRemoveItemNGRANAddressIsComprehended(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(out, m) { + if !equalByMethod(out, m) { t.Fatalf("decoded %+v, want %+v", out, m) } } @@ -310,14 +308,14 @@ func TestAMFTNLAssociationToRemoveItemNGRANAddressIsComprehended(t *testing.T) { func goldAMFConfigurationUpdateAcknowledgeTNL() *AMFConfigurationUpdateAcknowledge { return &AMFConfigurationUpdateAcknowledge{ AMFTNLAssociationSetupList: AMFTNLAssociationSetupList{ - {AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 2}}}, + {AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 0, 0, 2))}}, {AMFTNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddressAndPort: &EndpointIPAddressAndPort{ - EndpointIPAddress: TransportLayerAddress{10, 0, 0, 3}, PortNumber: 38412, + EndpointIPAddress: tlaOf(10, 0, 0, 3), PortNumber: 38412, }}}, }, AMFTNLAssociationFailedToSetupList: TNLAssociationList{{ - TNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 5}}, - Cause: Cause{Group: CauseGroupTransport, Value: CauseTransportResourceUnavailable}, + TNLAssociationAddress: CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 0, 0, 5))}, + Cause: CauseTransportResourceUnavailable.Cause(), }}, CriticalityDiagnostics: &CriticalityDiagnostics{ ProcedureCode: Ptr(ProcAMFConfigurationUpdate), @@ -368,17 +366,17 @@ func tnlAssociationItemWithRawExtension(t *testing.T) []byte { w.WriteBit(false) w.WriteBit(true) - addr := CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 0, 0, 5}} + addr := CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 0, 0, 5))} if err := addr.MarshalPER(w, per.Aligned); err != nil { return err } - cause := Cause{Group: CauseGroupTransport, Value: CauseTransportUnspecified} + cause := CauseTransportUnspecified.Cause() if err := cause.MarshalPER(w, per.Aligned); err != nil { return err } - return encodeExtensionContainer(w, per.Aligned, []ieField{{id: 9999, crit: CriticalityIgnore, raw: []byte{0x5a}}}) + return encodeExtensionContainer(w, per.Aligned, []ieField{{ID: 9999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x5a})}}) })) w.AlignToByte() @@ -387,7 +385,7 @@ func tnlAssociationItemWithRawExtension(t *testing.T) []byte { func TestTNLAssociationItemRawExtensionRoundTrips(t *testing.T) { value := container(t, - ieField{id: IDAMFTNLAssociationFailedToSetupList, crit: CriticalityIgnore, raw: tnlAssociationItemWithRawExtension(t)}, + ieField{ID: IDAMFTNLAssociationFailedToSetupList, Criticality: CriticalityIgnore, Value: ap.RawValue(tnlAssociationItemWithRawExtension(t))}, ) out, err := ParseAMFConfigurationUpdateAcknowledge(value) @@ -395,11 +393,11 @@ func TestTNLAssociationItemRawExtensionRoundTrips(t *testing.T) { t.Fatal(err) } - if len(out.AMFTNLAssociationFailedToSetupList) != 1 || out.AMFTNLAssociationFailedToSetupList[0].iEExtensions == nil { + if len(out.AMFTNLAssociationFailedToSetupList) != 1 || out.AMFTNLAssociationFailedToSetupList[0].iEExtensions == (extensionMeta{}) { t.Fatalf("decoded %+v", out) } - if got := out.AMFTNLAssociationFailedToSetupList[0].Cause; got.Group != CauseGroupTransport || got.Value != CauseTransportUnspecified { + if got := out.AMFTNLAssociationFailedToSetupList[0].Cause; !got.Equal(CauseTransportUnspecified.Cause()) { t.Fatalf("cause = %+v", got) } @@ -414,17 +412,15 @@ func TestTNLAssociationItemRawExtensionRoundTrips(t *testing.T) { func TestServedGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { item := goldAMFConfigurationUpdateServedGUAMIExtensions().ServedGUAMIList[0] - item.iEExtensions = messageMeta{ - unknownIEs: []rawIE{{id: 9999, crit: CriticalityIgnore, value: []byte{0x5a}}}, - wire: []wireSlot{ - {id: IDGUAMIType, crit: CriticalityIgnore, unknown: -1}, - {id: 9999, crit: CriticalityIgnore, unknown: 0}, - {id: IDExtendedBackupAMFName, crit: CriticalityIgnore, unknown: -1}, - }, - } - + restore := swapTable(&extIEsServedGUAMIItem, + tableRow(extIEsServedGUAMIItem, IDGUAMIType, CriticalityIgnore), + rawRow[ServedGUAMIItem](9999, CriticalityIgnore, []byte{0x5a}), + tableRow(extIEsServedGUAMIItem, IDExtendedBackupAMFName, CriticalityIgnore), + ) pdu := marshalT(t, &AMFConfigurationUpdate{ServedGUAMIList: ServedGUAMIList{item}}) + restore() + p, err := Unmarshal(pdu) if err != nil { t.Fatal(err) @@ -436,14 +432,10 @@ func TestServedGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { } got := out.ServedGUAMIList[0] - if got.GUAMIType == nil || got.ExtendedBackupAMFName == nil || len(got.iEExtensions.unknownIEs) != 1 { + if got.GUAMIType == nil || got.ExtendedBackupAMFName == nil || len(got.iEExtensions.UnknownIEs()) != 1 { t.Fatalf("decoded %+v", got) } - if !reflect.DeepEqual(got.iEExtensions.wire, item.iEExtensions.wire) { - t.Fatalf("wire order %+v, want %+v", got.iEExtensions.wire, item.iEExtensions.wire) - } - if re := marshalT(t, out); !bytes.Equal(re, pdu) { t.Fatalf("re-encoded\n got %x\n want %x", re, pdu) } @@ -451,7 +443,7 @@ func TestServedGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { func TestServedGUAMIItemUnknownRejectExtensionRejectsProcedure(t *testing.T) { item := goldResponse().ServedGUAMIList[0] - item.iEExtensions = messageMeta{unknownIEs: []rawIE{{id: 9999, crit: CriticalityReject, value: []byte{0x5a}}}} + item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityReject, Value: []byte{0x5a}}) p, err := Unmarshal(marshalT(t, &AMFConfigurationUpdate{ServedGUAMIList: ServedGUAMIList{item}})) if err != nil { diff --git a/ngap/amf_status_indication.go b/ngap/amf_status_indication.go index 4abff94c90..56b18292dc 100644 --- a/ngap/amf_status_indication.go +++ b/ngap/amf_status_indication.go @@ -14,156 +14,18 @@ type TimerApproachForGUAMIRemoval uint8 const ( TimerApproachApplyTimer TimerApproachForGUAMIRemoval = iota - - timerApproachForGUAMIRemovalRootCount = 1 ) -func (t TimerApproachForGUAMIRemoval) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, timerApproachForGUAMIRemovalRootCount, int64(t), "TimerApproachForGUAMIRemoval") -} - -func (t *TimerApproachForGUAMIRemoval) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeRootEnumerated(r, enc, timerApproachForGUAMIRemovalRootCount, "TimerApproachForGUAMIRemoval") - if err != nil { - return err - } - - *t = TimerApproachForGUAMIRemoval(v) - - return nil -} - // UnavailableGUAMIItem ::= SEQUENCE { gUAMI, timerApproachForGUAMIRemoval // OPTIONAL, backupAMFName OPTIONAL, iE-Extensions OPTIONAL } (extensible), // defined inline in TS 38.413 §9.2.6.10. type UnavailableGUAMIItem struct { GUAMI GUAMI - TimerApproachForGUAMIRemoval *TimerApproachForGUAMIRemoval - // The AMF to reselect towards (§8.7.6.2). - BackupAMFName *Name - ExtendedBackupAMFName *ExtendedAMFName - - iEExtensions messageMeta - extensions per.ExtensionAdditions -} - -var unavailableGUAMIItemExtIEs = []ieSpec[UnavailableGUAMIItem]{ - { - id: IDExtendedBackupAMFName, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UnavailableGUAMIItem, raw []byte, enc per.Encoding) error { - var v ExtendedAMFName - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.ExtendedBackupAMFName = &v - - return nil - }, - encode: func(m *UnavailableGUAMIItem) (per.Marshaler, bool) { - if m.ExtendedBackupAMFName == nil { - return nil, false - } - - return m.ExtendedBackupAMFName, true - }, - }, -} - -func (u *UnavailableGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(unavailableGUAMIItemExtIEs, u, &u.iEExtensions) - - w.WriteBit(u.extensions.Present()) - w.WriteBit(u.TimerApproachForGUAMIRemoval != nil) - w.WriteBit(u.BackupAMFName != nil) - w.WriteBit(len(ext) > 0) - - if err := u.GUAMI.MarshalPER(w, enc); err != nil { - return err - } - - if u.TimerApproachForGUAMIRemoval != nil { - if err := u.TimerApproachForGUAMIRemoval.MarshalPER(w, enc); err != nil { - return err - } - } - - if u.BackupAMFName != nil { - if err := u.BackupAMFName.MarshalPER(w, enc); err != nil { - return err - } - } - - if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { - return err - } - } - - if u.extensions.Present() { - return u.extensions.MarshalPER(w, enc) - } - - return nil -} - -func (u *UnavailableGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - timerApproach, err := r.ReadBit() - if err != nil { - return err - } - - backupAMFName, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - if err := u.GUAMI.UnmarshalPER(r, enc); err != nil { - return err - } - - if timerApproach { - var v TimerApproachForGUAMIRemoval - - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - u.TimerApproachForGUAMIRemoval = &v - } - - if backupAMFName { - var v Name - - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - u.BackupAMFName = &v - } - - if extContainer { - if err := decodeExtensionContainer(r, enc, unavailableGUAMIItemExtIEs, u, &u.iEExtensions); err != nil { - return err - } - } - - if extBit { - return u.extensions.UnmarshalPER(r, enc) - } - - return nil + TimerApproachForGUAMIRemoval *TimerApproachForGUAMIRemoval `per:",optional"` + BackupAMFName *Name `per:",optional"` + ExtendedBackupAMFName *ExtendedAMFName `per:",extie:IDExtendedBackupAMFName,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // UnavailableGUAMIList ::= SEQUENCE (SIZE(1..maxnoofServedGUAMIs)) OF @@ -180,11 +42,11 @@ type AMFStatusIndication struct { var aMFStatusIndicationIEs = []ieSpec[AMFStatusIndication]{ { - id: IDUnavailableGUAMIList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *AMFStatusIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UnavailableGUAMIList) + ID: IDUnavailableGUAMIList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *AMFStatusIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UnavailableGUAMIList) }, - encode: func(m *AMFStatusIndication) (per.Marshaler, bool) { + Encode: func(m *AMFStatusIndication) (per.Marshaler, bool) { return m.UnavailableGUAMIList, true }, }, @@ -213,3 +75,7 @@ func (m *AMFStatusIndication) Marshal() ([]byte, error) { func ParseAMFStatusIndication(value []byte) (*AMFStatusIndication, error) { return parseMessageBody[AMFStatusIndication](ProcAMFStatusIndication, TriggeringInitiatingMessage, aMFStatusIndicationIEs, value) } + +func DecodeAMFStatusIndication(value []byte) (*AMFStatusIndication, error) { + return decodeMessageBody[AMFStatusIndication](ProcAMFStatusIndication, aMFStatusIndicationIEs, value) +} diff --git a/ngap/amf_status_indication_test.go b/ngap/amf_status_indication_test.go index 38eee9f2ea..96c59455e7 100644 --- a/ngap/amf_status_indication_test.go +++ b/ngap/amf_status_indication_test.go @@ -6,7 +6,6 @@ package ngap import ( "bytes" "errors" - "reflect" "testing" ) @@ -170,16 +169,14 @@ func TestAMFStatusIndicationExtendedBackupAMFNameGolden(t *testing.T) { func TestUnavailableGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { item := goldAMFStatusIndicationExtendedBackupAMFName().UnavailableGUAMIList[0] - item.iEExtensions = messageMeta{ - unknownIEs: []rawIE{{id: 9999, crit: CriticalityIgnore, value: []byte{0x5a}}}, - wire: []wireSlot{ - {id: 9999, crit: CriticalityIgnore, unknown: 0}, - {id: IDExtendedBackupAMFName, crit: CriticalityIgnore, unknown: -1}, - }, - } - + restore := swapTable(&extIEsUnavailableGUAMIItem, + rawRow[UnavailableGUAMIItem](9999, CriticalityIgnore, []byte{0x5a}), + tableRow(extIEsUnavailableGUAMIItem, IDExtendedBackupAMFName, CriticalityIgnore), + ) pdu := marshalT(t, &AMFStatusIndication{UnavailableGUAMIList: UnavailableGUAMIList{item}}) + restore() + p, err := Unmarshal(pdu) if err != nil { t.Fatal(err) @@ -191,14 +188,10 @@ func TestUnavailableGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { } got := out.UnavailableGUAMIList[0] - if got.ExtendedBackupAMFName == nil || len(got.iEExtensions.unknownIEs) != 1 { + if got.ExtendedBackupAMFName == nil || len(got.iEExtensions.UnknownIEs()) != 1 { t.Fatalf("decoded %+v", got) } - if !reflect.DeepEqual(got.iEExtensions.wire, item.iEExtensions.wire) { - t.Fatalf("wire order %+v, want %+v", got.iEExtensions.wire, item.iEExtensions.wire) - } - if re := marshalT(t, out); !bytes.Equal(re, pdu) { t.Fatalf("re-encoded\n got %x\n want %x", re, pdu) } @@ -206,7 +199,7 @@ func TestUnavailableGUAMIItemUnknownExtensionKeepsItsPosition(t *testing.T) { func TestUnavailableGUAMIItemUnknownRejectExtensionRejectsProcedure(t *testing.T) { item := UnavailableGUAMIItem{GUAMI: goldGUAMI()} - item.iEExtensions = messageMeta{unknownIEs: []rawIE{{id: 9999, crit: CriticalityReject, value: []byte{0x5a}}}} + item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityReject, Value: []byte{0x5a}}) p, err := Unmarshal(marshalT(t, &AMFStatusIndication{UnavailableGUAMIList: UnavailableGUAMIList{item}})) if err != nil { diff --git a/ngap/asn1_spec_test.go b/ngap/asn1_spec_test.go new file mode 100644 index 0000000000..2fa62eee47 --- /dev/null +++ b/ngap/asn1_spec_test.go @@ -0,0 +1,97 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "os" + "sync" + "testing" + + "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/asn1spec" +) + +type tableRowSpec struct { + ID ProtocolIEID + Criticality Criticality + Presence ap.Presence +} + +var ( + asn1Once sync.Once + asn1Spec *asn1spec.Spec + asn1Err error +) + +func vendoredSpec(t *testing.T) *asn1spec.Spec { + t.Helper() + + asn1Once.Do(func() { + asn1Spec, asn1Err = asn1spec.ParseFS(os.DirFS("testdata/asn1"), "*.asn") + }) + + if asn1Err != nil { + t.Fatal(asn1Err) + } + + return asn1Spec +} + +func asn1Rows(t *testing.T, typeName, container string) []tableRowSpec { + t.Helper() + + s := vendoredSpec(t) + + ta := s.Type(typeName) + if ta == nil { + t.Fatalf("ASN.1 type %s not found", typeName) + } + + var set *asn1spec.ObjectSet + + for _, c := range ta.Type.Components { + if c.Type.Name == container && len(c.Type.Args) == 1 { + set = c.Type.Args[0].Set + } + } + + if set == nil { + t.Fatalf("%s has no %s", typeName, container) + } + + objs, err := s.Objects(set) + if err != nil { + t.Fatal(err) + } + + crits := map[string]Criticality{"reject": CriticalityReject, "ignore": CriticalityIgnore, "notify": CriticalityNotify} + presences := map[string]ap.Presence{"optional": ap.PresenceOptional, "conditional": ap.PresenceConditional, "mandatory": ap.PresenceMandatory} + + out := make([]tableRowSpec, 0, len(objs)) + + for _, o := range objs { + idv, _ := o.Value("&id") + + id, err := s.Int(idv) + if err != nil { + t.Fatal(err) + } + + crit, _ := o.Value("&criticality") + pres, _ := o.Value("&presence") + + out = append(out, tableRowSpec{ID: ProtocolIEID(id), Criticality: crits[crit.Ref], Presence: presences[pres.Ref]}) + } + + return out +} + +func tableRows[M any](table []ieSpec[M]) []tableRowSpec { + out := make([]tableRowSpec, len(table)) + for i, r := range table { + out[i] = tableRowSpec{ID: r.ID, Criticality: r.Criticality, Presence: r.Presence} + } + + return out +} diff --git a/ngap/bit_string.go b/ngap/bit_string.go new file mode 100644 index 0000000000..75979d53da --- /dev/null +++ b/ngap/bit_string.go @@ -0,0 +1,64 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/hex" + "strconv" + + "github.com/ellanetworks/core/per" +) + +type BitString struct { + octets string + bits int +} + +func BitStringFrom(b []byte, nbits int) BitString { + nbits = max(0, min(nbits, len(b)*8)) + n := (nbits + 7) / 8 + octets := make([]byte, n) + copy(octets, b[:n]) + + if rem := nbits % 8; rem != 0 { + octets[n-1] &= byte(0xff << (8 - rem)) + } + + return BitString{octets: string(octets), bits: nbits} +} + +func BitStringFromUint(v uint64, nbits int) BitString { + return BitStringFrom(uintToBits(v, nbits), nbits) +} + +func (b BitString) Bits() int { return b.bits } + +func (b BitString) Bytes() []byte { return []byte(b.octets) } + +func (b BitString) Uint64() uint64 { + if b.bits > 64 { + return bitsToUint([]byte(b.octets[:8]), 64) + } + + return bitsToUint([]byte(b.octets), b.bits) +} + +func (b BitString) String() string { + return hex.EncodeToString([]byte(b.octets)) + "/" + strconv.Itoa(b.bits) +} + +func (b BitString) encode(w *per.Writer, enc per.Encoding, lb, ub int64) error { + return per.EncodeBitString(w, enc, lb, ub, true, true, true, []byte(b.octets), b.bits) +} + +func decodeBitString(r *per.Reader, enc per.Encoding, lb, ub int64) (BitString, error) { + data, nbits, err := per.DecodeBitString(r, enc, lb, ub, true, true, true) + if err != nil { + return BitString{}, err + } + + return BitStringFrom(data, nbits), nil +} + +func (b BitString) Equal(y BitString) bool { return b == y } diff --git a/ngap/cause.go b/ngap/cause.go index e69d717d16..c9d36de2c3 100644 --- a/ngap/cause.go +++ b/ngap/cause.go @@ -3,164 +3,192 @@ package ngap -import ( - "fmt" +import "fmt" - "github.com/ellanetworks/core/per" -) +// Cause ::= CHOICE of five extensible ENUMERATED groups plus a +// choice-Extensions alternative. +type Cause struct { + RadioNetwork *CauseRadioNetwork `per:",choice:0"` + Transport *CauseTransport `per:",choice:1"` + NAS *CauseNas `per:",choice:2"` + Protocol *CauseProtocol `per:",choice:3"` + Misc *CauseMisc `per:",choice:4"` + ChoiceExtension *SingleContainer `per:",choice:5,extie"` +} -// CauseGroup selects a Cause CHOICE alternative (TS 38.413 §9.3.1.2). -type CauseGroup uint8 +type CauseRadioNetwork uint8 const ( - CauseGroupRadioNetwork CauseGroup = iota - CauseGroupTransport - CauseGroupNAS - CauseGroupProtocol - CauseGroupMisc - - causeRootGroups = 5 - - // An alternative index, not a group, so never a valid CauseGroup. - causeChoiceExtensions = 5 - - // The CHOICE is not extensible, so there is no extension bit and the index - // spans the choice-Extensions alternative. - causeAlternatives = 6 + CauseRadioNetworkUnspecified CauseRadioNetwork = iota // unspecified + CauseRadioNetworkTXnRelocOverallExpiry + CauseRadioNetworkSuccessfulHandover // successful-handover + CauseRadioNetworkReleaseDueToNGRANGeneratedReason // release-due-to-ngran-generated-reason + CauseRadioNetworkReleaseDueTo5GCGeneratedReason // release-due-to-5gc-generated-reason + CauseRadioNetworkHandoverCancelled // handover-cancelled + CauseRadioNetworkPartialHandover + CauseRadioNetworkHOFailureInTarget // ho-failure-in-target-5GC-ngran-node-or-target-system + CauseRadioNetworkHoTargetNotAllowed // ho-target-not-allowed + CauseRadioNetworkTNGRelocOverallExpiry // tngrelocoverall-expiry + CauseRadioNetworkTNGRelocPrepExpiry + CauseRadioNetworkCellNotAvailable + CauseRadioNetworkUnknownTargetID // unknown-targetID + CauseRadioNetworkNoRadioResourcesInTargetCell // no-radio-resources-available-in-target-cell + CauseRadioNetworkUnknownLocalUENGAPID // unknown-local-UE-NGAP-ID + CauseRadioNetworkInconsistentRemoteUEID // inconsistent-remote-UE-NGAP-ID + CauseRadioNetworkHandoverDesirableForRadio // handover-desirable-for-radio-reason + CauseRadioNetworkTimeCriticalHandover // time-critical-handover + CauseRadioNetworkResourceOptimisationHandover // resource-optimisation-handover + CauseRadioNetworkReduceLoadInServingCell // reduce-load-in-serving-cell + CauseRadioNetworkUserInactivity // user-inactivity + CauseRadioNetworkRadioConnectionWithUELost // radio-connection-with-ue-lost + CauseRadioNetworkRadioResourcesNotAvailable // radio-resources-not-available + CauseRadioNetworkInvalidQoSCombination + CauseRadioNetworkFailureInRadioInterfaceProcedure + CauseRadioNetworkInteractionWithOtherProcedure + CauseRadioNetworkUnknownPDUSessionID // unknown-PDU-session-ID + CauseRadioNetworkUnknownQoSFlowID + CauseRadioNetworkMultiplePDUSessionIDs // multiple-PDU-session-ID-instances + CauseRadioNetworkMultipleQoSFlowIDInstances + // encryption-and-or-integrity-protection-algorithms-not-supported + CauseRadioNetworkEncryptionAlgorithmsNotSupported + CauseRadioNetworkNGIntraSystemHandoverTriggered // ng-intra-system-handover-triggered + CauseRadioNetworkNGInterSystemHandoverTriggered // ng-inter-system-handover-triggered + CauseRadioNetworkXnHandoverTriggered // xn-handover-triggered + CauseRadioNetworkNotSupported5QIValue + CauseRadioNetworkUEContextTransfer + // ims-voice-eps-fallback-or-rat-fallback-triggered + CauseRadioNetworkIMSVoiceEPSFallbackTriggered // encryption-and-or-integrity-protection-algorithms-not-supported + CauseRadioNetworkUPIntegrityProtectionNotPossible + CauseRadioNetworkUPConfidentialityProtectionNotPossible + CauseRadioNetworkSliceNotSupported // slice-not-supported + CauseRadioNetworkUEInRRCInactiveStateNotReachable + CauseRadioNetworkRedirection // redirection + CauseRadioNetworkResourcesNotAvailableForTheSlice + CauseRadioNetworkUEMaxIntegrityProtectedDataRateReason + CauseRadioNetworkReleaseDueToCNDetectedMobility // release-due-to-cn-detected-mobility + CauseRadioNetworkN26InterfaceNotAvailable + CauseRadioNetworkReleaseDueToPreEmption + CauseRadioNetworkMultipleLocationReportingReferenceIDInstances + CauseRadioNetworkRSNNotAvailableForTheUP + CauseRadioNetworkNPNAccessDenied + CauseRadioNetworkCAGOnlyAccessDenied + CauseRadioNetworkInsufficientUECapabilities + CauseRadioNetworkRedCapUENotSupported + CauseRadioNetworkUnknownMBSSessionID + CauseRadioNetworkIndicatedMBSSessionAreaInformationNotServedByTheGNB + CauseRadioNetworkInconsistentSliceInfoForTheSession + CauseRadioNetworkMisalignedAssociationForMulticastUnicast + CauseRadioNetworkERedCapUENotSupported + CauseRadioNetworkTwoRxXRUENotSupported + CauseRadioNetworkAerialUEFlightInformationReportingInitiationFailure + CauseRadioNetworkUnknownRANAIoTDeviceNGAPID + CauseRadioNetworkRequestedAIoTServiceAreaInformationNotServedByTheGNB + CauseRadioNetworkUnknownAIoTSession + CauseRadioNetworkAIoTDeviceNotReachable + CauseRadioNetworkMultipleAIoTSessionIDInstances ) -// Root ENUMERATED values per group, which sets the index width (§9.3.1.2). -var causeGroupRootCount = [causeRootGroups]int{ - CauseGroupRadioNetwork: 45, - CauseGroupTransport: 2, - CauseGroupNAS: 4, - CauseGroupProtocol: 7, - CauseGroupMisc: 6, -} +type CauseTransport uint8 -// Root ENUMERATED values of each Cause group (TS 38.413 §9.3.1.2). A value is -// an index within its own group, so the same number differs across groups. const ( - CauseRadioNetworkUnspecified = 0 // unspecified - CauseRadioNetworkSuccessfulHandover = 2 // successful-handover - CauseRadioNetworkReleaseDueToNGRANGeneratedReason = 3 // release-due-to-ngran-generated-reason - CauseRadioNetworkReleaseDueTo5GCGeneratedReason = 4 // release-due-to-5gc-generated-reason - CauseRadioNetworkHandoverCancelled = 5 // handover-cancelled - CauseRadioNetworkHOFailureInTarget = 7 // ho-failure-in-target-5GC-ngran-node-or-target-system - CauseRadioNetworkHoTargetNotAllowed = 8 // ho-target-not-allowed - CauseRadioNetworkHandoverDesirableForRadio = 16 // handover-desirable-for-radio-reason - CauseRadioNetworkTimeCriticalHandover = 17 // time-critical-handover - CauseRadioNetworkResourceOptimisationHandover = 18 // resource-optimisation-handover - CauseRadioNetworkReduceLoadInServingCell = 19 // reduce-load-in-serving-cell - CauseRadioNetworkTNGRelocOverallExpiry = 9 // tngrelocoverall-expiry - CauseRadioNetworkUnknownTargetID = 12 // unknown-targetID - CauseRadioNetworkNoRadioResourcesInTargetCell = 13 // no-radio-resources-available-in-target-cell - CauseRadioNetworkUnknownLocalUENGAPID = 14 // unknown-local-UE-NGAP-ID - CauseRadioNetworkInconsistentRemoteUEID = 15 // inconsistent-remote-UE-NGAP-ID - CauseRadioNetworkUserInactivity = 20 // user-inactivity - CauseRadioNetworkRadioResourcesNotAvailable = 22 // radio-resources-not-available - CauseRadioNetworkRadioConnectionWithUELost = 21 // radio-connection-with-ue-lost - CauseRadioNetworkUnknownPDUSessionID = 26 // unknown-PDU-session-ID - CauseRadioNetworkMultiplePDUSessionIDs = 28 // multiple-PDU-session-ID-instances - CauseRadioNetworkSliceNotSupported = 39 // slice-not-supported - CauseRadioNetworkReleaseDueToCNDetectedMobility = 44 // release-due-to-cn-detected-mobility - CauseRadioNetworkRedirection = 41 // redirection - - CauseRadioNetworkNGIntraSystemHandoverTriggered = 31 // ng-intra-system-handover-triggered - CauseRadioNetworkNGInterSystemHandoverTriggered = 32 // ng-inter-system-handover-triggered - CauseRadioNetworkXnHandoverTriggered = 33 // xn-handover-triggered - - // ims-voice-eps-fallback-or-rat-fallback-triggered - CauseRadioNetworkIMSVoiceEPSFallbackTriggered = 36 - - // encryption-and-or-integrity-protection-algorithms-not-supported - CauseRadioNetworkEncryptionAlgorithmsNotSupported = 30 + CauseTransportResourceUnavailable CauseTransport = iota // transport-resource-unavailable + CauseTransportUnspecified // unspecified +) - CauseTransportResourceUnavailable = 0 // transport-resource-unavailable - CauseTransportUnspecified = 1 // unspecified +type CauseNas uint8 - CauseNASNormalRelease = 0 // normal-release - CauseNASAuthenticationFailure = 1 // authentication-failure - CauseNASDeregister = 2 // deregister - CauseNASUnspecified = 3 // unspecified +const ( + CauseNASNormalRelease CauseNas = iota // normal-release + CauseNASAuthenticationFailure // authentication-failure + CauseNASDeregister // deregister + CauseNASUnspecified // unspecified + CauseNASUENotInPLMNServingArea + CauseNASMobileIABNotAuthorized + CauseNASIABNotAuthorized + CauseNASNoAIoTNASResponse +) - CauseProtocolTransferSyntaxError = 0 // transfer-syntax-error - CauseProtocolAbstractSyntaxErrorReject = 1 // abstract-syntax-error-reject - CauseProtocolAbstractSyntaxErrorIgnoreAndNotify = 2 // abstract-syntax-error-ignore-and-notify - CauseProtocolMessageNotCompatible = 3 // message-not-compatible-with-receiver-state - CauseProtocolSemanticError = 4 // semantic-error - CauseProtocolUnspecified = 6 // unspecified +type CauseProtocol uint8 +const ( + CauseProtocolTransferSyntaxError CauseProtocol = iota // transfer-syntax-error + CauseProtocolAbstractSyntaxErrorReject // abstract-syntax-error-reject + CauseProtocolAbstractSyntaxErrorIgnoreAndNotify // abstract-syntax-error-ignore-and-notify + CauseProtocolMessageNotCompatible // message-not-compatible-with-receiver-state + CauseProtocolSemanticError // semantic-error // abstract-syntax-error-falsely-constructed-message - CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage = 5 - - CauseMiscControlProcessingOverload = 0 // control-processing-overload - CauseMiscHardwareFailure = 2 // hardware-failure - CauseMiscOMIntervention = 3 // om-intervention - CauseMiscUnknownPLMNOrSNPN = 4 // unknown-PLMN-or-SNPN - CauseMiscUnspecified = 5 // unspecified + CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage + CauseProtocolUnspecified // unspecified ) -var CauseInsufficientUECapabilities = Cause{Group: CauseGroupRadioNetwork, Value: 6, Extended: true} +type CauseMisc uint8 -// Cause ::= CHOICE of five extensible ENUMERATED groups plus a -// choice-Extensions alternative. Value indexes the chosen group; Extended -// marks it as indexing an extension addition of that group. -type Cause struct { - Group CauseGroup - Value int - Extended bool -} +const ( + CauseMiscControlProcessingOverload CauseMisc = iota // control-processing-overload + CauseMiscNotEnoughUserPlaneProcessingResources + CauseMiscHardwareFailure // hardware-failure + CauseMiscOMIntervention // om-intervention + CauseMiscUnknownPLMNOrSNPN // unknown-PLMN-or-SNPN + CauseMiscUnspecified // unspecified +) -func (c Cause) EnumeratedValue() int { - if c.Extended && int(c.Group) < causeRootGroups { - return causeGroupRootCount[c.Group] + c.Value - } +func (v CauseRadioNetwork) Cause() Cause { return Cause{RadioNetwork: &v} } - return c.Value -} +func (v CauseTransport) Cause() Cause { return Cause{Transport: &v} } -func (c Cause) MarshalPER(w *per.Writer, enc per.Encoding) error { - if int(c.Group) >= causeRootGroups { - return fmt.Errorf("ngap: invalid cause group %d", c.Group) - } +func (v CauseNas) Cause() Cause { return Cause{NAS: &v} } - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, causeAlternatives-1, int64(c.Group)); err != nil { - return err - } +func (v CauseProtocol) Cause() Cause { return Cause{Protocol: &v} } - n := int64(causeGroupRootCount[c.Group]) +func (v CauseMisc) Cause() Cause { return Cause{Misc: &v} } - idx := int64(c.Value) - if c.Extended { - idx += n +func (c Cause) Alternative() (index int, name string) { + switch { + case c.RadioNetwork != nil: + return 0, "radioNetwork" + case c.Transport != nil: + return 1, "transport" + case c.NAS != nil: + return 2, "nas" + case c.Protocol != nil: + return 3, "protocol" + case c.Misc != nil: + return 4, "misc" + case c.ChoiceExtension != nil: + return 5, "choice-Extensions" + default: + return -1, "" } - - return per.EncodeEnumerated(w, enc, n, true, idx) } -func (c *Cause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - gi, err := per.DecodeConstrainedWholeNumber(r, enc, 0, causeAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: cause group: %w", err) +func (c Cause) Value() (index int, name string) { + switch { + case c.RadioNetwork != nil: + return int(*c.RadioNetwork), c.RadioNetwork.Name() + case c.Transport != nil: + return int(*c.Transport), c.Transport.Name() + case c.NAS != nil: + return int(*c.NAS), c.NAS.Name() + case c.Protocol != nil: + return int(*c.Protocol), c.Protocol.Name() + case c.Misc != nil: + return int(*c.Misc), c.Misc.Name() + default: + return -1, "" } +} - if gi == causeChoiceExtensions { - return decodeChoiceExtension(r, enc, "Cause") +func (c Cause) String() string { + _, alt := c.Alternative() + if alt == "" { + return "empty" } - n := int64(causeGroupRootCount[gi]) - - idx, err := per.DecodeEnumerated(r, enc, n, true) - if err != nil { - return fmt.Errorf("ngap: cause value: %w", err) + if c.ChoiceExtension != nil { + return fmt.Sprintf("%s: id %d", alt, c.ChoiceExtension.ID) } - if idx >= n { - *c = Cause{Group: CauseGroup(gi), Value: int(idx - n), Extended: true} - } else { - *c = Cause{Group: CauseGroup(gi), Value: int(idx)} - } + index, name := c.Value() - return nil + return fmt.Sprintf("%s: %s (%d)", alt, name, index) } diff --git a/ngap/cause_names.go b/ngap/cause_names.go index 6da28e5836..33184664af 100644 --- a/ngap/cause_names.go +++ b/ngap/cause_names.go @@ -3,166 +3,32 @@ package ngap -import "fmt" - -// Cause value names from TS 38.413 §9.3.1.2. Each group lists its root -// ENUMERATED values, then the extension additions that continue the numbering. -var ( - radioNetworkRoot = []string{ - "unspecified", - "txnrelocoverall-expiry", - "successful-handover", - "release-due-to-ngran-generated-reason", - "release-due-to-5gc-generated-reason", - "handover-cancelled", - "partial-handover", - "ho-failure-in-target-5GC-ngran-node-or-target-system", - "ho-target-not-allowed", - "tngrelocoverall-expiry", - "tngrelocprep-expiry", - "cell-not-available", - "unknown-targetID", - "no-radio-resources-available-in-target-cell", - "unknown-local-UE-NGAP-ID", - "inconsistent-remote-UE-NGAP-ID", - "handover-desirable-for-radio-reason", - "time-critical-handover", - "resource-optimisation-handover", - "reduce-load-in-serving-cell", - "user-inactivity", - "radio-connection-with-ue-lost", - "radio-resources-not-available", - "invalid-qos-combination", - "failure-in-radio-interface-procedure", - "interaction-with-other-procedure", - "unknown-PDU-session-ID", - // TS 38.413 misspells this ENUMERATED value. The name belongs to the - // protocol, so it is reproduced rather than corrected. - "unkown-qos-flow-ID", //nolint:misspell - "multiple-PDU-session-ID-instances", - "multiple-qos-flow-ID-instances", - "encryption-and-or-integrity-protection-algorithms-not-supported", - "ng-intra-system-handover-triggered", - "ng-inter-system-handover-triggered", - "xn-handover-triggered", - "not-supported-5QI-value", - "ue-context-transfer", - "ims-voice-eps-fallback-or-rat-fallback-triggered", - "up-integrity-protection-not-possible", - "up-confidentiality-protection-not-possible", - "slice-not-supported", - "ue-in-rrc-inactive-state-not-reachable", - "redirection", - "resources-not-available-for-the-slice", - "ue-max-integrity-protected-data-rate-reason", - "release-due-to-cn-detected-mobility", - } - radioNetworkExt = []string{ - "n26-interface-not-available", - "release-due-to-pre-emption", - "multiple-location-reporting-reference-ID-instances", - "rsn-not-available-for-the-up", - "npn-access-denied", - "cag-only-access-denied", - "insufficient-ue-capabilities", - "redcap-ue-not-supported", - "unknown-MBS-Session-ID", - "indicated-MBS-session-area-information-not-served-by-the-gNB", - "inconsistent-slice-info-for-the-session", - "misaligned-association-for-multicast-unicast", - "eredcap-ue-not-supported", - "two-rx-xr-ue-not-supported", - } - - transportRoot = []string{ - "transport-resource-unavailable", - "unspecified", - } - - nasRoot = []string{ - "normal-release", - "authentication-failure", - "deregister", - "unspecified", - } - nasExt = []string{ - "uE-not-in-PLMN-serving-area", - "mobile-IAB-not-authorized", - "iAB-not-authorized", - } - - protocolRoot = []string{ - "transfer-syntax-error", - "abstract-syntax-error-reject", - "abstract-syntax-error-ignore-and-notify", - "message-not-compatible-with-receiver-state", - "semantic-error", - "abstract-syntax-error-falsely-constructed-message", - "unspecified", - } - - miscRoot = []string{ - "control-processing-overload", - "not-enough-user-plane-processing-resources", - "hardware-failure", - "om-intervention", - "unknown-PLMN-or-SNPN", - "unspecified", - } -) - -func causeTablesFor(group CauseGroup) (root, ext []string, known bool) { - switch group { - case CauseGroupRadioNetwork: - return radioNetworkRoot, radioNetworkExt, true - case CauseGroupTransport: - return transportRoot, nil, true - case CauseGroupNAS: - return nasRoot, nasExt, true - case CauseGroupProtocol: - return protocolRoot, nil, true - case CauseGroupMisc: - return miscRoot, nil, true - default: - return nil, nil, false - } +import "github.com/ellanetworks/core/per" + +// TS 38.413 misspells this ENUMERATED value. The name belongs to the +// protocol, so it is reproduced rather than corrected. +var enumCauseRadioNetwork = per.Enum[CauseRadioNetwork]{ + Root: []string{"unspecified", "txnrelocoverall-expiry", "successful-handover", "release-due-to-ngran-generated-reason", "release-due-to-5gc-generated-reason", "handover-cancelled", "partial-handover", "ho-failure-in-target-5GC-ngran-node-or-target-system", "ho-target-not-allowed", "tngrelocoverall-expiry", "tngrelocprep-expiry", "cell-not-available", "unknown-targetID", "no-radio-resources-available-in-target-cell", "unknown-local-UE-NGAP-ID", "inconsistent-remote-UE-NGAP-ID", "handover-desirable-for-radio-reason", "time-critical-handover", "resource-optimisation-handover", "reduce-load-in-serving-cell", "user-inactivity", "radio-connection-with-ue-lost", "radio-resources-not-available", "invalid-qos-combination", "failure-in-radio-interface-procedure", "interaction-with-other-procedure", "unknown-PDU-session-ID", "unkown-qos-flow-ID", //nolint:misspell + "multiple-PDU-session-ID-instances", "multiple-qos-flow-ID-instances", "encryption-and-or-integrity-protection-algorithms-not-supported", "ng-intra-system-handover-triggered", "ng-inter-system-handover-triggered", "xn-handover-triggered", "not-supported-5QI-value", "ue-context-transfer", "ims-voice-eps-fallback-or-rat-fallback-triggered", "up-integrity-protection-not-possible", "up-confidentiality-protection-not-possible", "slice-not-supported", "ue-in-rrc-inactive-state-not-reachable", "redirection", "resources-not-available-for-the-slice", "ue-max-integrity-protected-data-rate-reason", "release-due-to-cn-detected-mobility"}, + Extension: []string{"n26-interface-not-available", "release-due-to-pre-emption", "multiple-location-reporting-reference-ID-instances", "rsn-not-available-for-the-up", "npn-access-denied", "cag-only-access-denied", "insufficient-ue-capabilities", "redcap-ue-not-supported", "unknown-MBS-Session-ID", "indicated-MBS-session-area-information-not-served-by-the-gNB", "inconsistent-slice-info-for-the-session", "misaligned-association-for-multicast-unicast", "eredcap-ue-not-supported", "two-rx-xr-ue-not-supported", "aerial-ue-flight-information-reporting-initiation-failure", "unknown-RAN-AIoT-Device-NGAP-ID", "requested-AIoT-service-area-information-not-served-by-the-gNB", "unknown-AIoT-session", "aiot-device-not-reachable", "multiple-AIoT-session-ID-instances"}, } -var causeGroupNames = map[CauseGroup]string{ - CauseGroupRadioNetwork: "radioNetwork", - CauseGroupTransport: "transport", - CauseGroupNAS: "nas", - CauseGroupProtocol: "protocol", - CauseGroupMisc: "misc", +var enumCauseTransport = per.Enum[CauseTransport]{ + Root: []string{"transport-resource-unavailable", "unspecified"}, + Extensible: true, } -// ValueName returns the 3GPP name of the cause value, or "unknown". -func (c Cause) ValueName() (name string, index int) { - root, ext, known := causeTablesFor(c.Group) - if !known { - return "unknown", c.Value - } - - names, base := root, 0 - if c.Extended { - names, base = ext, len(root) - } - - if c.Value >= 0 && c.Value < len(names) { - return names[c.Value], base + c.Value - } - - return "unknown", base + c.Value +var enumCauseNas = per.Enum[CauseNas]{ + Root: []string{"normal-release", "authentication-failure", "deregister", "unspecified"}, + Extension: []string{"uE-not-in-PLMN-serving-area", "mobile-IAB-not-authorized", "iAB-not-authorized", "no-aiot-NAS-response"}, } -// String renders a cause as "radioNetwork: unspecified (0)". -func (c Cause) String() string { - group, ok := causeGroupNames[c.Group] - if !ok { - return fmt.Sprintf("group-%d: value-%d", int(c.Group), c.Value) - } - - name, index := c.ValueName() +var enumCauseProtocol = per.Enum[CauseProtocol]{ + Root: []string{"transfer-syntax-error", "abstract-syntax-error-reject", "abstract-syntax-error-ignore-and-notify", "message-not-compatible-with-receiver-state", "semantic-error", "abstract-syntax-error-falsely-constructed-message", "unspecified"}, + Extensible: true, +} - return fmt.Sprintf("%s: %s (%d)", group, name, index) +var enumCauseMisc = per.Enum[CauseMisc]{ + Root: []string{"control-processing-overload", "not-enough-user-plane-processing-resources", "hardware-failure", "om-intervention", "unknown-PLMN-or-SNPN", "unspecified"}, + Extensible: true, } diff --git a/ngap/cause_test.go b/ngap/cause_test.go index 6dbc4dc875..0b4b5d0996 100644 --- a/ngap/cause_test.go +++ b/ngap/cause_test.go @@ -4,23 +4,25 @@ package ngap import ( - "strings" + "bytes" + "errors" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestCauseRoundTrip(t *testing.T) { for _, c := range []Cause{ - {Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, - {Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkSliceNotSupported}, - {Group: CauseGroupTransport, Value: CauseTransportResourceUnavailable}, - {Group: CauseGroupNAS, Value: CauseNASDeregister}, - {Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject}, - {Group: CauseGroupMisc, Value: CauseMiscUnknownPLMNOrSNPN}, - // Extension additions of a group's ENUMERATED continue past its root. - {Group: CauseGroupRadioNetwork, Value: 0, Extended: true}, - {Group: CauseGroupNAS, Value: 2, Extended: true}, + CauseRadioNetworkUnspecified.Cause(), + CauseRadioNetworkSliceNotSupported.Cause(), + CauseTransportResourceUnavailable.Cause(), + CauseNASDeregister.Cause(), + CauseProtocolAbstractSyntaxErrorReject.Cause(), + CauseMiscUnknownPLMNOrSNPN.Cause(), + CauseRadioNetworkN26InterfaceNotAvailable.Cause(), + CauseRadioNetworkMultipleAIoTSessionIDInstances.Cause(), + CauseNASNoAIoTNASResponse.Cause(), } { w := per.NewWriter() if err := c.MarshalPER(w, per.Aligned); err != nil { @@ -32,54 +34,116 @@ func TestCauseRoundTrip(t *testing.T) { t.Fatalf("%v: unmarshal: %v", c, err) } - if got != c { - t.Errorf("round trip = %+v, want %+v", got, c) + if !got.Equal(c) { + t.Errorf("round trip = %v, want %v", got, c) } } } -// An out-of-range group cannot be encoded: the CHOICE has five groups plus a -// choice-Extensions alternative this library never selects. -func TestCauseInvalidGroup(t *testing.T) { +func TestCauseRejectsZeroOrSeveralAlternatives(t *testing.T) { + if err := (&Cause{}).MarshalPER(per.NewWriter(), per.Aligned); !errors.Is(err, per.ErrEmpty) { + t.Errorf("empty cause: err = %v, want per.ErrEmpty", err) + } + + two := CauseNASDeregister.Cause() + two.Misc = Ptr(CauseMiscUnspecified) + + if err := two.MarshalPER(per.NewWriter(), per.Aligned); !errors.Is(err, per.ErrChoice) { + t.Errorf("two alternatives: err = %v, want per.ErrChoice", err) + } +} + +func causeChoiceExtensionWire(t *testing.T, crit Criticality) []byte { + t.Helper() + w := per.NewWriter() - err := Cause{Group: CauseGroup(causeChoiceExtensions)}.MarshalPER(w, per.Aligned) - if err == nil { - t.Fatal("marshal accepted the choice-Extensions index as a group") + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 5, 5); err != nil { + t.Fatal(err) + } + + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: ap.RawValue([]byte{0x2a})}); err != nil { + t.Fatal(err) + } + + return perBytes(w) +} + +func TestCauseChoiceExtensionIsPreservedAndDiagnosed(t *testing.T) { + for _, crit := range []Criticality{CriticalityReject, CriticalityIgnore} { + wire := causeChoiceExtensionWire(t, crit) + + got, err := unmarshalPERValue[Cause](wire) + if err != nil { + t.Fatalf("decode: %v", err) + } + + if got.ChoiceExtension == nil || got.ChoiceExtension.ID != 9999 || got.ChoiceExtension.Criticality != crit { + t.Fatalf("ChoiceExtension = %+v, want id 9999 criticality %v", got.ChoiceExtension, crit) + } + + w := per.NewWriter() + if err := got.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + if !bytes.Equal(perBytes(w), wire) { + t.Errorf("re-encode = % x, want % x", perBytes(w), wire) + } + + d := ap.Diagnose[ProtocolIEID](&got) + + var found bool + + for _, e := range d.IEs { + if e.ID == 9999 && e.Criticality == crit { + found = true + } + } + + if !found { + t.Errorf("diagnostics %+v do not report the unknown choice-Extensions IE on criticality %v", d.IEs, crit) + } } } -// TS 38.413 §9.3.1.2 closes Cause with choice-Extensions rather than an -// extension marker. A peer selecting it has sent something this version cannot -// represent, so decoding must say so instead of yielding a zero Cause that -// reads as radioNetwork/unspecified. -func TestCauseChoiceExtensionIsRejected(t *testing.T) { +func TestCauseUnknownExtensionValueRoundTrips(t *testing.T) { w := per.NewWriter() - enc := per.Aligned - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, causeAlternatives-1, causeChoiceExtensions); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 5, 1); err != nil { t.Fatal(err) } - if err := encodeContainerField(w, enc, ieField{ - id: IDCause, - crit: CriticalityIgnore, - raw: []byte{0x00}, - }); err != nil { + if err := per.EncodeEnumerated(w, per.Aligned, 2, true, 40); err != nil { + t.Fatal(err) + } + + wire := perBytes(w) + + got, err := unmarshalPERValue[Cause](wire) + if err != nil { t.Fatal(err) } - got, err := unmarshalPERValue[Cause](perBytes(w)) - if err == nil { - t.Fatalf("decoded choice-Extensions as %+v, want an error", got) + if got.Transport == nil || *got.Transport != 40 { + t.Fatalf("Transport = %v, want 40", got.Transport) } - if !strings.Contains(err.Error(), "unsupported Cause alternative") { - t.Errorf("error = %q, want it to name the unsupported alternative", err) + if got.String() != "transport: unknown(40) (40)" { + t.Errorf("String() = %q", got.String()) + } + + if !got.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Error("Diagnose() = false for an unknown CauseTransport value") + } + + w = per.NewWriter() + if err := got.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) } - if got != (Cause{}) { - t.Errorf("cause = %+v, want it left untouched", got) + if !bytes.Equal(perBytes(w), wire) { + t.Errorf("re-encode = % x, want % x", perBytes(w), wire) } } @@ -88,12 +152,10 @@ func TestCauseString(t *testing.T) { in Cause want string }{ - {Cause{Group: CauseGroupRadioNetwork, Value: 0}, "radioNetwork: unspecified (0)"}, - {Cause{Group: CauseGroupNAS, Value: CauseNASDeregister}, "nas: deregister (2)"}, - // An extension addition's index continues after the root values. - {Cause{Group: CauseGroupNAS, Value: 0, Extended: true}, "nas: uE-not-in-PLMN-serving-area (4)"}, - {Cause{Group: CauseGroupRadioNetwork, Value: 99}, "radioNetwork: unknown (99)"}, - {Cause{Group: CauseGroup(9), Value: 1}, "group-9: value-1"}, + {CauseRadioNetworkUnspecified.Cause(), "radioNetwork: unspecified (0)"}, + {CauseNASDeregister.Cause(), "nas: deregister (2)"}, + {CauseNASUENotInPLMNServingArea.Cause(), "nas: uE-not-in-PLMN-serving-area (4)"}, + {Cause{}, "empty"}, } { if got := tc.in.String(); got != tc.want { t.Errorf("String() = %q, want %q", got, tc.want) @@ -101,12 +163,12 @@ func TestCauseString(t *testing.T) { } } -func TestCauseEnumeratedValueContinuesPastTheRoot(t *testing.T) { - if got := (Cause{Group: CauseGroupNAS, Value: CauseNASDeregister}).EnumeratedValue(); got != CauseNASDeregister { - t.Fatalf("root value = %d, want %d", got, CauseNASDeregister) +func TestCauseExtensionValuesContinuePastTheRoot(t *testing.T) { + if got := int(CauseRadioNetworkInsufficientUECapabilities); got != len(enumCauseRadioNetwork.Root)+6 { + t.Fatalf("insufficient-ue-capabilities = %d, want %d", got, len(enumCauseRadioNetwork.Root)+6) } - if got := CauseInsufficientUECapabilities.EnumeratedValue(); got != causeGroupRootCount[CauseGroupRadioNetwork]+6 { - t.Fatalf("extension value = %d, want %d", got, causeGroupRootCount[CauseGroupRadioNetwork]+6) + if got := CauseRadioNetworkInsufficientUECapabilities.Name(); got != "insufficient-ue-capabilities" { + t.Errorf("Name() = %q", got) } } diff --git a/ngap/cell_identity_test.go b/ngap/cell_identity_test.go index 392c505e7d..c19d55b0e1 100644 --- a/ngap/cell_identity_test.go +++ b/ngap/cell_identity_test.go @@ -6,7 +6,7 @@ package ngap import "testing" func nodeID(value uint32, bits int) GlobalRANNodeID { - return GlobalRANNodeID{Kind: RANNodeIDGNB, Value: value, Bits: bits} + return NewGlobalGNBID(PLMNIdentity{}, value, bits) } // TS 23.003 §19.6: the gNB ID occupies the leftmost bits of the 36-bit NCI and @@ -44,7 +44,7 @@ func TestNRCellIdentityComposition(t *testing.T) { } func TestEUTRACellIdentityComposition(t *testing.T) { - got, err := GlobalRANNodeID{Kind: RANNodeIDMacroNgENB, Value: 0x00010, Bits: 20}.EUTRACellIdentity(1) + got, err := testNgENBNodeID(t, PLMNIdentity{}, 0x00010, 20).EUTRACellIdentity(1) if err != nil { t.Fatal(err) } @@ -86,7 +86,7 @@ func TestGlobalRANNodeIDHex(t *testing.T) { {nodeID(0x3fffff, 22), "3fffff"}, {nodeID(0x2a, 22), "00002a"}, {nodeID(0xa8, 24), "0000a8"}, - {GlobalRANNodeID{Kind: RANNodeIDShortMacroNgENB, Value: 0x34b89, Bits: 18}, "34b89"}, + {testNgENBNodeID(t, PLMNIdentity{}, 0x34b89, 18), "34b89"}, } for _, tt := range tests { diff --git a/ngap/choice_index_test.go b/ngap/choice_index_test.go new file mode 100644 index 0000000000..a37de91167 --- /dev/null +++ b/ngap/choice_index_test.go @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +const ( + causeAlternatives = 6 + causeChoiceExtensions = 5 + globalRANNodeIDAlternatives = 4 + globalRANNodeIDChoiceExtensions = 3 + userLocationInformationAlternatives = 4 + userLocationInformationChoiceExtensions = 3 + targetIDAlternatives = 3 + targetIDChoiceExtensions = 2 + resetTypeAlternatives = 3 + resetTypePartOfNGInterface = 1 + resetTypeChoiceExtensions = 2 + ueNGAPIDsAlternatives = 3 + ueNGAPIDsPair = 0 + ueNGAPIDsChoiceExtensions = 2 + uePagingIdentityAlternatives = 2 + uePagingIdentityChoiceExtensions = 1 + warningAreaListAlternatives = 5 + warningAreaListChoiceExtensions = 4 + broadcastAreaAlternatives = 7 + broadcastAreaChoiceExtensions = 6 + cellListAlternatives = 3 + cellListChoiceExtensions = 2 +) diff --git a/ngap/common.go b/ngap/common.go index 3610fb2b1a..8784c43b09 100644 --- a/ngap/common.go +++ b/ngap/common.go @@ -17,8 +17,7 @@ // [AbstractSyntaxError]. Anything §10.3.4.2 and §10.3.5 let a receiver carry on // past is not an error: the message is returned and [Diagnostics] reports it. // -// Unmodeled IEs are preserved and re-emitted on encode. Preservation and -// diagnostics are both bounded, since a peer chooses how many IEs to send. +// Unmodeled IEs are preserved and re-emitted on encode. // // NGAP closes a CHOICE with a choice-Extensions alternative rather than an // extension marker (§9.3); an alternative this version does not model is an @@ -26,76 +25,28 @@ package ngap import ( - "fmt" - - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func Ptr[T any](v T) *T { return &v } // Not extensible. -type Criticality uint8 +type Criticality = ap.Criticality const ( - CriticalityReject Criticality = iota - CriticalityIgnore - CriticalityNotify + CriticalityReject = ap.CriticalityReject + CriticalityIgnore = ap.CriticalityIgnore + CriticalityNotify = ap.CriticalityNotify criticalityRootCount = 3 ) -func (c Criticality) String() string { - if name, ok := criticalityNames[c]; ok { - return name - } - - return fmt.Sprintf("Criticality(%d)", uint8(c)) -} - -// encodeRootEnumerated refuses to encode a value outside the root. -// per.EncodeEnumerated would take it as the (v-nRoot)'th extension addition and -// put a value 3GPP has not defined on the wire. -func encodeRootEnumerated(w *per.Writer, enc per.Encoding, nRoot, v int64, name string) error { - if v < 0 || v >= nRoot { - return fmt.Errorf("ngap: %s %d outside the root values", name, v) - } - - return per.EncodeEnumerated(w, enc, nRoot, true, v) -} - -// An extension value decodes as nRoot+k, which narrows back onto a root value -// in these small Go enum types, so it is refused: §10.3.1 case 6 handles it on -// the IE's criticality. -func decodeRootEnumerated(r *per.Reader, enc per.Encoding, nRoot int64, name string) (int64, error) { - idx, err := per.DecodeEnumerated(r, enc, nRoot, true) - if err != nil { - return 0, err - } - - if idx >= nRoot { - return 0, fmt.Errorf("%w: %s extension value %d", errNotComprehended, name, idx) - } - - return idx, nil -} - -// presence is the TS 38.413 §9.2 tabular "Presence" column. -type presence uint8 - -const ( - presenceOptional presence = iota - presenceConditional - presenceMandatory -) - type TriggeringMessage uint8 const ( TriggeringInitiatingMessage TriggeringMessage = iota TriggeringSuccessfulOutcome TriggeringUnsuccessfulOutcome - - triggeringMessageRootCount = 3 ) // ProtocolIEID ::= INTEGER (0..65535). diff --git a/ngap/comparable_test.go b/ngap/comparable_test.go new file mode 100644 index 0000000000..7430db9b3f --- /dev/null +++ b/ngap/comparable_test.go @@ -0,0 +1,71 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "reflect" + "testing" +) + +func requireComparable[T comparable]() reflect.Type { return reflect.TypeFor[T]() } + +func identityTypesWithValueEquality() []reflect.Type { + return []reflect.Type{ + requireComparable[PLMNIdentity](), + requireComparable[TAI](), + requireComparable[GUAMI](), + requireComparable[NRCGI](), + requireComparable[EUTRACGI](), + requireComparable[AllocationAndRetentionPriority](), + requireComparable[GTPTEID](), + requireComparable[TransportLayerAddress](), + requireComparable[GTPTunnel](), + requireComparable[EndpointIPAddressAndPort](), + } +} + +func identityTypesWithPointerComponents() []reflect.Type { + return []reflect.Type{ + requireComparable[SNSSAI](), + requireComparable[UPTransportLayerInformation](), + requireComparable[NGRANCGI](), + } +} + +func referenceFree(t reflect.Type, seen map[reflect.Type]bool) bool { + if seen[t] { + return true + } + + seen[t] = true + + switch t.Kind() { + case reflect.Pointer, reflect.Slice, reflect.Map, reflect.Func, reflect.Interface, reflect.Chan, reflect.UnsafePointer: + return false + case reflect.Array: + return referenceFree(t.Elem(), seen) + case reflect.Struct: + for i := range t.NumField() { + if !referenceFree(t.Field(i).Type, seen) { + return false + } + } + } + + return true +} + +func TestIdentityTypesHaveValueEquality(t *testing.T) { + for _, typ := range identityTypesWithValueEquality() { + if !referenceFree(typ, map[reflect.Type]bool{}) { + t.Errorf("%v holds a pointer, slice, map or interface, so == does not compare its value", typ) + } + } + + for _, typ := range identityTypesWithPointerComponents() { + if referenceFree(typ, map[reflect.Type]bool{}) { + t.Errorf("%v now has value equality: move it to identityTypesWithValueEquality", typ) + } + } +} diff --git a/ngap/config_transfer.go b/ngap/config_transfer.go index d15cfe011d..f06412ddc1 100644 --- a/ngap/config_transfer.go +++ b/ngap/config_transfer.go @@ -16,10 +16,11 @@ import ( // The plain TargetRANNodeID has the same shape but a different extension // container. type TargetRANNodeIDSON struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` GlobalRANNodeID GlobalRANNodeID SelectedTAI TAI - _ ieExtensions `per:",skip"` + NRCGI *NRCGI `per:",extie:IDNRCGI,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // SONConfigurationTransfer is held as raw open-type bytes: it is relayed @@ -58,19 +59,21 @@ func (c SONConfigurationTransfer) TargetRANNodeID() (TargetRANNodeIDSON, error) // TS 38.413 §9.2.7.1. type UplinkRANConfigurationTransfer struct { - SONConfigurationTransfer SONConfigurationTransfer + SONConfigurationTransfer SONConfigurationTransfer + ENDCSONConfigurationTransferUL *ENDCSONConfigurationTransfer + IntersystemSONConfigurationTransferUL *IntersystemSONConfigurationTransfer messageMeta } var uplinkRANConfigurationTransferIEs = []ieSpec[UplinkRANConfigurationTransfer]{ { - id: IDSONConfigurationTransferUL, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UplinkRANConfigurationTransfer, raw []byte, enc per.Encoding) error { - m.SONConfigurationTransfer = SONConfigurationTransfer(raw) + ID: IDSONConfigurationTransferUL, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UplinkRANConfigurationTransfer, r *per.Reader, enc per.Encoding) error { + m.SONConfigurationTransfer = SONConfigurationTransfer(restOctets(r)) return nil }, - encode: func(m *UplinkRANConfigurationTransfer) (per.Marshaler, bool) { + Encode: func(m *UplinkRANConfigurationTransfer) (per.Marshaler, bool) { if m.SONConfigurationTransfer == nil { return nil, false } @@ -78,6 +81,12 @@ var uplinkRANConfigurationTransferIEs = []ieSpec[UplinkRANConfigurationTransfer] return m.SONConfigurationTransfer, true }, }, + optionalExtension(IDENDCSONConfigurationTransferUL, CriticalityIgnore, func(m *UplinkRANConfigurationTransfer) **ENDCSONConfigurationTransfer { + return &m.ENDCSONConfigurationTransferUL + }), + optionalExtension(IDIntersystemSONConfigurationTransferUL, CriticalityIgnore, func(m *UplinkRANConfigurationTransfer) **IntersystemSONConfigurationTransfer { + return &m.IntersystemSONConfigurationTransferUL + }), } func (m *UplinkRANConfigurationTransfer) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -104,9 +113,15 @@ func ParseUplinkRANConfigurationTransfer(value []byte) (*UplinkRANConfigurationT return parseMessageBody[UplinkRANConfigurationTransfer](ProcUplinkRANConfigurationTransfer, TriggeringInitiatingMessage, uplinkRANConfigurationTransferIEs, value) } +func DecodeUplinkRANConfigurationTransfer(value []byte) (*UplinkRANConfigurationTransfer, error) { + return decodeMessageBody[UplinkRANConfigurationTransfer](ProcUplinkRANConfigurationTransfer, uplinkRANConfigurationTransferIEs, value) +} + // TS 38.413 §9.2.7.2. type DownlinkRANConfigurationTransfer struct { - SONConfigurationTransfer SONConfigurationTransfer + SONConfigurationTransfer SONConfigurationTransfer + ENDCSONConfigurationTransferDL *ENDCSONConfigurationTransfer + IntersystemSONConfigurationTransferDL *IntersystemSONConfigurationTransfer messageMeta } @@ -114,12 +129,12 @@ type DownlinkRANConfigurationTransfer struct { // The IE is optional, so an empty container is a valid message. var downlinkRANConfigurationTransferIEs = []ieSpec[DownlinkRANConfigurationTransfer]{ { - id: IDSONConfigurationTransferDL, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *DownlinkRANConfigurationTransfer, raw []byte, enc per.Encoding) error { - m.SONConfigurationTransfer = SONConfigurationTransfer(raw) + ID: IDSONConfigurationTransferDL, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *DownlinkRANConfigurationTransfer, r *per.Reader, enc per.Encoding) error { + m.SONConfigurationTransfer = SONConfigurationTransfer(restOctets(r)) return nil }, - encode: func(m *DownlinkRANConfigurationTransfer) (per.Marshaler, bool) { + Encode: func(m *DownlinkRANConfigurationTransfer) (per.Marshaler, bool) { if m.SONConfigurationTransfer == nil { return nil, false } @@ -127,6 +142,12 @@ var downlinkRANConfigurationTransferIEs = []ieSpec[DownlinkRANConfigurationTrans return m.SONConfigurationTransfer, true }, }, + optionalExtension(IDENDCSONConfigurationTransferDL, CriticalityIgnore, func(m *DownlinkRANConfigurationTransfer) **ENDCSONConfigurationTransfer { + return &m.ENDCSONConfigurationTransferDL + }), + optionalExtension(IDIntersystemSONConfigurationTransferDL, CriticalityIgnore, func(m *DownlinkRANConfigurationTransfer) **IntersystemSONConfigurationTransfer { + return &m.IntersystemSONConfigurationTransferDL + }), } func (m *DownlinkRANConfigurationTransfer) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -152,3 +173,7 @@ func (m *DownlinkRANConfigurationTransfer) Marshal() ([]byte, error) { func ParseDownlinkRANConfigurationTransfer(value []byte) (*DownlinkRANConfigurationTransfer, error) { return parseMessageBody[DownlinkRANConfigurationTransfer](ProcDownlinkRANConfigurationTransfer, TriggeringInitiatingMessage, downlinkRANConfigurationTransferIEs, value) } + +func DecodeDownlinkRANConfigurationTransfer(value []byte) (*DownlinkRANConfigurationTransfer, error) { + return decodeMessageBody[DownlinkRANConfigurationTransfer](ProcDownlinkRANConfigurationTransfer, downlinkRANConfigurationTransferIEs, value) +} diff --git a/ngap/config_transfer_test.go b/ngap/config_transfer_test.go index 051e312842..37df831251 100644 --- a/ngap/config_transfer_test.go +++ b/ngap/config_transfer_test.go @@ -108,14 +108,9 @@ func TestSONConfigurationTransferTargetRANNodeID(t *testing.T) { t.Fatalf("TargetRANNodeID: %v", err) } - want := GlobalRANNodeID{ - Kind: RANNodeIDGNB, - PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - Value: 0x000102, - Bits: 24, - } + want := NewGlobalGNBID(PLMNIdentity{0x00, 0xf1, 0x10}, 0x000102, 24) - if target.GlobalRANNodeID != want { + if !target.GlobalRANNodeID.Equal(want) { t.Errorf("GlobalRANNodeID = %+v, want %+v", target.GlobalRANNodeID, want) } diff --git a/ngap/coverage_cases_test.go b/ngap/coverage_cases_test.go new file mode 100644 index 0000000000..fe6a869d73 --- /dev/null +++ b/ngap/coverage_cases_test.go @@ -0,0 +1,477 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import "reflect" + +type extTableCase struct { + asn1 string + rows []tableRowSpec + typ reflect.Type +} + +func extTableCases() []extTableCase { + return []extTableCase{ + {"A2X-PC5-FlowBitRates", tableRows(extIEsA2XPC5FlowBitRates), reflect.TypeFor[A2XPC5FlowBitRates]()}, + {"A2X-PC5-QoS-Flow-Item", tableRows(extIEsA2XPC5QoSFlowItem), reflect.TypeFor[A2XPC5QoSFlowItem]()}, + {"A2X-PC5-QoS-Parameters", tableRows(extIEsA2XPC5QoSParameters), reflect.TypeFor[A2XPC5QoSParameters]()}, + {"AIOTFName", tableRows(extIEsAIOTFName), reflect.TypeFor[AIOTFName]()}, + {"AMF-TNLAssociationSetupItem", tableRows(extIEsAMFTNLAssociationSetupItem), reflect.TypeFor[AMFTNLAssociationSetupItem]()}, + {"AMF-TNLAssociationToAddItem", tableRows(extIEsAMFTNLAssociationToAddItem), reflect.TypeFor[AMFTNLAssociationToAddItem]()}, + {"AMF-TNLAssociationToRemoveItem", tableRows(extIEsAMFTNLAssociationToRemoveItem), reflect.TypeFor[AMFTNLAssociationToRemoveItem]()}, + {"AMF-TNLAssociationToUpdateItem", tableRows(extIEsAMFTNLAssociationToUpdateItem), reflect.TypeFor[AMFTNLAssociationToUpdateItem]()}, + {"AUN3DeviceAccessInfo", tableRows(extIEsAUN3DeviceAccessInfo), reflect.TypeFor[AUN3DeviceAccessInfo]()}, + {"AdditionalCancelledlocationReportingReferenceIDItem", tableRows(extIEsAdditionalCancelledlocationReportingReferenceIDItem), reflect.TypeFor[AdditionalCancelledlocationReportingReferenceIDItem]()}, + {"AdditionalDLUPTNLInformationForHOItem", tableRows(extIEsAdditionalDLUPTNLInformationForHOItem), reflect.TypeFor[AdditionalDLUPTNLInformationForHOItem]()}, + {"AdditionalULI", tableRows(extIEsAdditionalULI), reflect.TypeFor[AdditionalULI]()}, + {"Aerial-UE-FlightInformationReporting", tableRows(extIEsAerialUEFlightInformationReporting), reflect.TypeFor[AerialUEFlightInformationReporting]()}, + {"Aerial-UE-FlightInformationReportingControl", tableRows(extIEsAerialUEFlightInformationReportingControl), reflect.TypeFor[AerialUEFlightInformationReportingControl]()}, + {"Aerial-UE-FlightInformationReportingControlItem", tableRows(extIEsAerialUEFlightInformationReportingControlItem), reflect.TypeFor[AerialUEFlightInformationReportingControlItem]()}, + {"AllocationAndRetentionPriority", tableRows(extIEsAllocationAndRetentionPriority), reflect.TypeFor[AllocationAndRetentionPriority]()}, + {"AllowedNSSAI-Item", tableRows(extIEsAllowedNSSAIItem), reflect.TypeFor[AllowedNSSAIItem]()}, + {"Allowed-PNI-NPN-Item", tableRows(extIEsAllowedPNINPNItem), reflect.TypeFor[AllowedPNINPNItem]()}, + {"AlternativeQoSParaSetItem", tableRows(extIEsAlternativeQoSParaSetItem), reflect.TypeFor[AlternativeQoSParaSetItem]()}, + {"AreaOfInterest", tableRows(extIEsAreaOfInterest), reflect.TypeFor[AreaOfInterest]()}, + {"AreaOfInterestCellItem", tableRows(extIEsAreaOfInterestCellItem), reflect.TypeFor[AreaOfInterestCellItem]()}, + {"AreaOfInterestItem", tableRows(extIEsAreaOfInterestItem), reflect.TypeFor[AreaOfInterestItem]()}, + {"AreaOfInterestRANNodeItem", tableRows(extIEsAreaOfInterestRANNodeItem), reflect.TypeFor[AreaOfInterestRANNodeItem]()}, + {"AreaOfInterestTAIItem", tableRows(extIEsAreaOfInterestTAIItem), reflect.TypeFor[AreaOfInterestTAIItem]()}, + {"AreaScopeOfNeighCellsItem", tableRows(extIEsAreaScopeOfNeighCellsItem), reflect.TypeFor[AreaScopeOfNeighCellsItem]()}, + {"AssistanceDataForPaging", tableRows(extIEsAssistanceDataForPaging), reflect.TypeFor[AssistanceDataForPaging]()}, + {"AssistanceDataForRecommendedCells", tableRows(extIEsAssistanceDataForRecommendedCells), reflect.TypeFor[AssistanceDataForRecommendedCells]()}, + {"AssociatedMBSQosFlowSetupRequestItem", tableRows(extIEsAssociatedMBSQosFlowSetupRequestItem), reflect.TypeFor[AssociatedMBSQosFlowSetupRequestItem]()}, + {"AssociatedMBSQosFlowSetuporModifyRequestItem", tableRows(extIEsAssociatedMBSQosFlowSetuporModifyRequestItem), reflect.TypeFor[AssociatedMBSQosFlowSetuporModifyRequestItem]()}, + {"AssociatedQosFlowItem", tableRows(extIEsAssociatedQosFlowItem), reflect.TypeFor[AssociatedQosFlowItem]()}, + {"AvailableBitrateReportThresholdItem", tableRows(extIEsAvailableBitrateReportThresholdItem), reflect.TypeFor[AvailableBitrateReportThresholdItem]()}, + {"AvailableRANVisibleQoEMetrics", tableRows(extIEsAvailableRANVisibleQoEMetrics), reflect.TypeFor[AvailableRANVisibleQoEMetrics]()}, + {"BeamMeasurementsReportConfiguration", tableRows(extIEsBeamMeasurementsReportConfiguration), reflect.TypeFor[BeamMeasurementsReportConfiguration]()}, + {"BeamMeasurementsReportQuantity", tableRows(extIEsBeamMeasurementsReportQuantity), reflect.TypeFor[BeamMeasurementsReportQuantity]()}, + {"BluetoothMeasConfigNameItem", tableRows(extIEsBluetoothMeasConfigNameItem), reflect.TypeFor[BluetoothMeasConfigNameItem]()}, + {"BluetoothMeasurementConfiguration", tableRows(extIEsBluetoothMeasurementConfiguration), reflect.TypeFor[BluetoothMeasurementConfiguration]()}, + {"BroadcastPLMNItem", tableRows(extIEsBroadcastPLMNItem), reflect.TypeFor[BroadcastPLMNItem]()}, + {"BurstArrivalTimeWindow", tableRows(extIEsBurstArrivalTimeWindow), reflect.TypeFor[BurstArrivalTimeWindow]()}, + {"CAGListforMDTItem", tableRows(extIEsCAGListforMDTItem), reflect.TypeFor[CAGListforMDTItem]()}, + {"CNAssistedRANTuning", tableRows(extIEsCNAssistedRANTuning), reflect.TypeFor[CNAssistedRANTuning]()}, + {"CNTypeRestrictionsForEquivalentItem", tableRows(extIEsCNTypeRestrictionsForEquivalentItem), reflect.TypeFor[CNTypeRestrictionsForEquivalentItem]()}, + {"CancelledCellsInEAI-EUTRA-Item", tableRows(extIEsCancelledCellsInEAIEUTRAItem), reflect.TypeFor[CancelledCellsInEAIEUTRAItem]()}, + {"CancelledCellsInEAI-NR-Item", tableRows(extIEsCancelledCellsInEAINRItem), reflect.TypeFor[CancelledCellsInEAINRItem]()}, + {"CancelledCellsInTAI-EUTRA-Item", tableRows(extIEsCancelledCellsInTAIEUTRAItem), reflect.TypeFor[CancelledCellsInTAIEUTRAItem]()}, + {"CancelledCellsInTAI-NR-Item", tableRows(extIEsCancelledCellsInTAINRItem), reflect.TypeFor[CancelledCellsInTAINRItem]()}, + {"CandidateCellID", tableRows(extIEsCandidateCellID), reflect.TypeFor[CandidateCellID]()}, + {"CandidateCellItem", tableRows(extIEsCandidateCellItem), reflect.TypeFor[CandidateCellItem]()}, + {"CandidatePCI", tableRows(extIEsCandidatePCI), reflect.TypeFor[CandidatePCI]()}, + {"CandidateRelayUEInformationItem", tableRows(extIEsCandidateRelayUEInformationItem), reflect.TypeFor[CandidateRelayUEInformationItem]()}, + {"CellBasedMDT-EUTRA", tableRows(extIEsCellBasedMDTEUTRA), reflect.TypeFor[CellBasedMDTEUTRA]()}, + {"CellBasedMDT-NR", tableRows(extIEsCellBasedMDTNR), reflect.TypeFor[CellBasedMDTNR]()}, + {"CellBasedQMC", tableRows(extIEsCellBasedQMC), reflect.TypeFor[CellBasedQMC]()}, + {"CellIDBroadcastEUTRA-Item", tableRows(extIEsCellIDBroadcastEUTRAItem), reflect.TypeFor[CellIDBroadcastEUTRAItem]()}, + {"CellIDBroadcastNR-Item", tableRows(extIEsCellIDBroadcastNRItem), reflect.TypeFor[CellIDBroadcastNRItem]()}, + {"CellIDCancelledEUTRA-Item", tableRows(extIEsCellIDCancelledEUTRAItem), reflect.TypeFor[CellIDCancelledEUTRAItem]()}, + {"CellIDCancelledNR-Item", tableRows(extIEsCellIDCancelledNRItem), reflect.TypeFor[CellIDCancelledNRItem]()}, + {"CellType", tableRows(extIEsCellType), reflect.TypeFor[CellType]()}, + {"ClockQualityAcceptanceCriteria", tableRows(extIEsClockQualityAcceptanceCriteria), reflect.TypeFor[ClockQualityAcceptanceCriteria]()}, + {"ClockQualityAcceptanceIndication", tableRows(extIEsClockQualityAcceptanceIndication), reflect.TypeFor[ClockQualityAcceptanceIndication]()}, + {"ClockQualityReportingControlInfo", tableRows(extIEsClockQualityReportingControlInfo), reflect.TypeFor[ClockQualityReportingControlInfo]()}, + {"CompletedCellsInEAI-EUTRA-Item", tableRows(extIEsCompletedCellsInEAIEUTRAItem), reflect.TypeFor[CompletedCellsInEAIEUTRAItem]()}, + {"CompletedCellsInEAI-NR-Item", tableRows(extIEsCompletedCellsInEAINRItem), reflect.TypeFor[CompletedCellsInEAINRItem]()}, + {"CompletedCellsInTAI-EUTRA-Item", tableRows(extIEsCompletedCellsInTAIEUTRAItem), reflect.TypeFor[CompletedCellsInTAIEUTRAItem]()}, + {"CompletedCellsInTAI-NR-Item", tableRows(extIEsCompletedCellsInTAINRItem), reflect.TypeFor[CompletedCellsInTAINRItem]()}, + {"CompositeAvailableCapacity", tableRows(extIEsCompositeAvailableCapacity), reflect.TypeFor[CompositeAvailableCapacity]()}, + {"CoreNetworkAssistanceInformationForInactive", tableRows(extIEsCoreNetworkAssistanceInformationForInactive), reflect.TypeFor[CoreNetworkAssistanceInformationForInactive]()}, + {"CriticalityDiagnostics", tableRows(extIEsCriticalityDiagnostics), reflect.TypeFor[CriticalityDiagnostics]()}, + {"CriticalityDiagnostics-IE-Item", tableRows(extIEsCriticalityDiagnosticsIEItem), reflect.TypeFor[CriticalityDiagnosticsIEItem]()}, + {"DAPSRequestInfo", tableRows(extIEsDAPSRequestInfo), reflect.TypeFor[DAPSRequestInfo]()}, + {"DRBsToQosFlowsMappingItem", tableRows(extIEsDRBsToQosFlowsMappingItem), reflect.TypeFor[DRBsToQosFlowsMappingItem]()}, + {"DataForwardingResponseDRBItem", tableRows(extIEsDataForwardingResponseDRBItem), reflect.TypeFor[DataForwardingResponseDRBItem]()}, + {"DataForwardingResponseERABListItem", tableRows(extIEsDataForwardingResponseERABListItem), reflect.TypeFor[DataForwardingResponseERABListItem]()}, + {"Dynamic5QIDescriptor", tableRows(extIEsDynamic5QIDescriptor), reflect.TypeFor[Dynamic5QIDescriptor]()}, + {"ECNMarkingorCongestionInformationReportingStatus-Item", tableRows(extIEsECNMarkingorCongestionInformationReportingStatusItem), reflect.TypeFor[ECNMarkingorCongestionInformationReportingStatusItem]()}, + {"EPS-TAI", tableRows(extIEsEPSTAI), reflect.TypeFor[EPSTAI]()}, + {"E-RABInformationItem", tableRows(extIEsERABInformationItem), reflect.TypeFor[ERABInformationItem]()}, + {"EUTRA-CGI", tableRows(extIEsEUTRACGI), reflect.TypeFor[EUTRACGI]()}, + {"EUTRAN-CellReportItem", tableRows(extIEsEUTRANCellReportItem), reflect.TypeFor[EUTRANCellReportItem]()}, + {"EUTRAN-CellToReportItem", tableRows(extIEsEUTRANCellToReportItem), reflect.TypeFor[EUTRANCellToReportItem]()}, + {"EUTRAN-CompositeAvailableCapacityGroup", tableRows(extIEsEUTRANCompositeAvailableCapacityGroup), reflect.TypeFor[EUTRANCompositeAvailableCapacityGroup]()}, + {"EUTRAN-RadioResourceStatus", tableRows(extIEsEUTRANRadioResourceStatus), reflect.TypeFor[EUTRANRadioResourceStatus]()}, + {"EUTRAN-ReportingStatusIEs", tableRows(extIEsEUTRANReportingStatusIEs), reflect.TypeFor[EUTRANReportingStatusIEs]()}, + {"EUTRAN-ReportingSystemIEs", tableRows(extIEsEUTRANReportingSystemIEs), reflect.TypeFor[EUTRANReportingSystemIEs]()}, + {"EUTRA-PagingeDRXInformation", tableRows(extIEsEUTRAPagingeDRXInformation), reflect.TypeFor[EUTRAPagingeDRXInformation]()}, + {"EmergencyAreaIDBroadcastEUTRA-Item", tableRows(extIEsEmergencyAreaIDBroadcastEUTRAItem), reflect.TypeFor[EmergencyAreaIDBroadcastEUTRAItem]()}, + {"EmergencyAreaIDBroadcastNR-Item", tableRows(extIEsEmergencyAreaIDBroadcastNRItem), reflect.TypeFor[EmergencyAreaIDBroadcastNRItem]()}, + {"EmergencyAreaIDCancelledEUTRA-Item", tableRows(extIEsEmergencyAreaIDCancelledEUTRAItem), reflect.TypeFor[EmergencyAreaIDCancelledEUTRAItem]()}, + {"EmergencyAreaIDCancelledNR-Item", tableRows(extIEsEmergencyAreaIDCancelledNRItem), reflect.TypeFor[EmergencyAreaIDCancelledNRItem]()}, + {"EmergencyFallbackIndicator", tableRows(extIEsEmergencyFallbackIndicator), reflect.TypeFor[EmergencyFallbackIndicator]()}, + {"EndpointIPAddressAndPort", tableRows(extIEsEndpointIPAddressAndPort), reflect.TypeFor[EndpointIPAddressAndPort]()}, + {"EquivalentSNPNsItem", tableRows(extIEsEquivalentSNPNsItem), reflect.TypeFor[EquivalentSNPNsItem]()}, + {"EventBasedReportingIEs", tableRows(extIEsEventBasedReportingIEs), reflect.TypeFor[EventBasedReportingIEs]()}, + {"EventL1LoggedMDTConfig", tableRows(extIEsEventL1LoggedMDTConfig), reflect.TypeFor[EventL1LoggedMDTConfig]()}, + {"ExcessPacketDelayThresholdItem", tableRows(extIEsExcessPacketDelayThresholdItem), reflect.TypeFor[ExcessPacketDelayThresholdItem]()}, + {"ExpectedUEActivityBehaviour", tableRows(extIEsExpectedUEActivityBehaviour), reflect.TypeFor[ExpectedUEActivityBehaviour]()}, + {"ExpectedUEBehaviour", tableRows(extIEsExpectedUEBehaviour), reflect.TypeFor[ExpectedUEBehaviour]()}, + {"ExpectedUEMovingTrajectoryItem", tableRows(extIEsExpectedUEMovingTrajectoryItem), reflect.TypeFor[ExpectedUEMovingTrajectoryItem]()}, + {"Extended-AMFName", tableRows(extIEsExtendedAMFName), reflect.TypeFor[ExtendedAMFName]()}, + {"Extended-RANNodeName", tableRows(extIEsExtendedRANNodeName), reflect.TypeFor[ExtendedRANNodeName]()}, + {"ExtendedRATRestrictionInformation", tableRows(extIEsExtendedRATRestrictionInformation), reflect.TypeFor[ExtendedRATRestrictionInformation]()}, + {"FiveG-ProSeAuthorized", tableRows(extIEsFiveGProSeAuthorized), reflect.TypeFor[FiveGProSeAuthorized]()}, + {"FiveGProSePC5FlowBitRates", tableRows(extIEsFiveGProSePC5FlowBitRates), reflect.TypeFor[FiveGProSePC5FlowBitRates]()}, + {"FiveGProSePC5QoSFlowItem", tableRows(extIEsFiveGProSePC5QoSFlowItem), reflect.TypeFor[FiveGProSePC5QoSFlowItem]()}, + {"FiveG-ProSePC5QoSParameters", tableRows(extIEsFiveGProSePC5QoSParameters), reflect.TypeFor[FiveGProSePC5QoSParameters]()}, + {"FiveG-S-TMSI", tableRows(extIEsFiveGSTMSI), reflect.TypeFor[FiveGSTMSI]()}, + {"ForbiddenAreaInformation-Item", tableRows(extIEsForbiddenAreaInformationItem), reflect.TypeFor[ForbiddenAreaInformationItem]()}, + {"FromEUTRANtoNGRAN", tableRows(extIEsFromEUTRANtoNGRAN), reflect.TypeFor[FromEUTRANtoNGRAN]()}, + {"FromNGRANtoEUTRAN", tableRows(extIEsFromNGRANtoEUTRAN), reflect.TypeFor[FromNGRANtoEUTRAN]()}, + {"GBR-QosInformation", tableRows(extIEsGBRQosInformation), reflect.TypeFor[GBRQosInformation]()}, + {"GTPTunnel", tableRows(extIEsGTPTunnel), reflect.TypeFor[GTPTunnel]()}, + {"GUAMI", tableRows(extIEsGUAMI), reflect.TypeFor[GUAMI]()}, + {"GUAMIList-Item", tableRows(extIEsGUAMIListItem), reflect.TypeFor[GUAMIListItem]()}, + {"GeographyBasedMDT", tableRows(extIEsGeographyBasedMDT), reflect.TypeFor[GeographyBasedMDT]()}, + {"GlobalCable-ID-new", tableRows(extIEsGlobalCableIDNew), reflect.TypeFor[GlobalCableIDNew]()}, + {"GlobalENB-ID", tableRows(extIEsGlobalENBID), reflect.TypeFor[GlobalENBID]()}, + {"GlobalGNB-ID", tableRows(extIEsGlobalGNBID), reflect.TypeFor[GlobalGNBID]()}, + {"GlobalLine-ID", tableRows(extIEsGlobalLineID), reflect.TypeFor[GlobalLineID]()}, + {"GlobalN3IWF-ID", tableRows(extIEsGlobalN3IWFID), reflect.TypeFor[GlobalN3IWFID]()}, + {"GlobalNgENB-ID", tableRows(extIEsGlobalNgENBID), reflect.TypeFor[GlobalNgENBID]()}, + {"GlobalTNGF-ID", tableRows(extIEsGlobalTNGFID), reflect.TypeFor[GlobalTNGFID]()}, + {"GlobalTWIF-ID", tableRows(extIEsGlobalTWIFID), reflect.TypeFor[GlobalTWIFID]()}, + {"GlobalW-AGF-ID", tableRows(extIEsGlobalWAGFID), reflect.TypeFor[GlobalWAGFID]()}, + {"HFCNode-ID-new", tableRows(extIEsHFCNodeIDNew), reflect.TypeFor[HFCNodeIDNew]()}, + {"HandoverCommandTransfer", tableRows(extIEsHandoverCommandTransfer), reflect.TypeFor[HandoverCommandTransfer]()}, + {"HandoverPreparationUnsuccessfulTransfer", tableRows(extIEsHandoverPreparationUnsuccessfulTransfer), reflect.TypeFor[HandoverPreparationUnsuccessfulTransfer]()}, + {"HandoverRequestAcknowledgeTransfer", tableRows(extIEsHandoverRequestAcknowledgeTransfer), reflect.TypeFor[HandoverRequestAcknowledgeTransfer]()}, + {"HandoverRequiredTransfer", tableRows(extIEsHandoverRequiredTransfer), reflect.TypeFor[HandoverRequiredTransfer]()}, + {"HandoverResourceAllocationUnsuccessfulTransfer", tableRows(extIEsHandoverResourceAllocationUnsuccessfulTransfer), reflect.TypeFor[HandoverResourceAllocationUnsuccessfulTransfer]()}, + {"ImmediateMDTNr", tableRows(extIEsImmediateMDTNr), reflect.TypeFor[ImmediateMDTNr]()}, + {"InfoOnRecommendedCellsAndRANNodesForPaging", tableRows(extIEsInfoOnRecommendedCellsAndRANNodesForPaging), reflect.TypeFor[InfoOnRecommendedCellsAndRANNodesForPaging]()}, + {"InterSystemFailureIndication", tableRows(extIEsInterSystemFailureIndication), reflect.TypeFor[InterSystemFailureIndication]()}, + {"InterSystemHOReport", tableRows(extIEsInterSystemHOReport), reflect.TypeFor[InterSystemHOReport]()}, + {"IntersystemCellActivationReply", tableRows(extIEsIntersystemCellActivationReply), reflect.TypeFor[IntersystemCellActivationReply]()}, + {"IntersystemCellActivationRequest", tableRows(extIEsIntersystemCellActivationRequest), reflect.TypeFor[IntersystemCellActivationRequest]()}, + {"IntersystemCellStateIndication", tableRows(extIEsIntersystemCellStateIndication), reflect.TypeFor[IntersystemCellStateIndication]()}, + {"IntersystemMobilityFailureforVoiceFallback", tableRows(extIEsIntersystemMobilityFailureforVoiceFallback), reflect.TypeFor[IntersystemMobilityFailureforVoiceFallback]()}, + {"IntersystemResourceStatusReply", tableRows(extIEsIntersystemResourceStatusReply), reflect.TypeFor[IntersystemResourceStatusReply]()}, + {"IntersystemResourceStatusReport", tableRows(extIEsIntersystemResourceStatusReport), reflect.TypeFor[IntersystemResourceStatusReport]()}, + {"IntersystemResourceStatusRequest", tableRows(extIEsIntersystemResourceStatusRequest), reflect.TypeFor[IntersystemResourceStatusRequest]()}, + {"IntersystemSONConfigurationTransfer", tableRows(extIEsIntersystemSONConfigurationTransfer), reflect.TypeFor[IntersystemSONConfigurationTransfer]()}, + {"IntersystemSONNGRANnodeID", tableRows(extIEsIntersystemSONNGRANnodeID), reflect.TypeFor[IntersystemSONNGRANnodeID]()}, + {"IntersystemSONeNBID", tableRows(extIEsIntersystemSONeNBID), reflect.TypeFor[IntersystemSONeNBID]()}, + {"IntersystemUnnecessaryHO", tableRows(extIEsIntersystemUnnecessaryHO), reflect.TypeFor[IntersystemUnnecessaryHO]()}, + {"LAI", tableRows(extIEsLAI), reflect.TypeFor[LAI]()}, + {"LPWUSPSAssistanceInformation", tableRows(extIEsLPWUSPSAssistanceInformation), reflect.TypeFor[LPWUSPSAssistanceInformation]()}, + {"LTE-A2X-ServicesAuthorized", tableRows(extIEsLTEA2XServicesAuthorized), reflect.TypeFor[LTEA2XServicesAuthorized]()}, + {"LTEUESidelinkAggregateMaximumBitrate", tableRows(extIEsLTEUESidelinkAggregateMaximumBitrate), reflect.TypeFor[LTEUESidelinkAggregateMaximumBitrate]()}, + {"LTEV2XServicesAuthorized", tableRows(extIEsLTEV2XServicesAuthorized), reflect.TypeFor[LTEV2XServicesAuthorized]()}, + {"LastVisitedCellItem", tableRows(extIEsLastVisitedCellItem), reflect.TypeFor[LastVisitedCellItem]()}, + {"LastVisitedNGRANCellInformation", tableRows(extIEsLastVisitedNGRANCellInformation), reflect.TypeFor[LastVisitedNGRANCellInformation]()}, + {"LastVisitedPSCellInformation", tableRows(extIEsLastVisitedPSCellInformation), reflect.TypeFor[LastVisitedPSCellInformation]()}, + {"LocationReportingRequestType", tableRows(extIEsLocationReportingRequestType), reflect.TypeFor[LocationReportingRequestType]()}, + {"LoggedMDTNr", tableRows(extIEsLoggedMDTNr), reflect.TypeFor[LoggedMDTNr]()}, + {"M1Configuration", tableRows(extIEsM1Configuration), reflect.TypeFor[M1Configuration]()}, + {"M1PeriodicReporting", tableRows(extIEsM1PeriodicReporting), reflect.TypeFor[M1PeriodicReporting]()}, + {"M1ThresholdEventA2", tableRows(extIEsM1ThresholdEventA2), reflect.TypeFor[M1ThresholdEventA2]()}, + {"M4Configuration", tableRows(extIEsM4Configuration), reflect.TypeFor[M4Configuration]()}, + {"M5Configuration", tableRows(extIEsM5Configuration), reflect.TypeFor[M5Configuration]()}, + {"M6Configuration", tableRows(extIEsM6Configuration), reflect.TypeFor[M6Configuration]()}, + {"M7Configuration", tableRows(extIEsM7Configuration), reflect.TypeFor[M7Configuration]()}, + {"MBS-ActiveSessionInformation-SourcetoTargetItem", tableRows(extIEsMBSActiveSessionInformationSourcetoTargetItem), reflect.TypeFor[MBSActiveSessionInformationSourcetoTargetItem]()}, + {"MBS-MappingandDataForwardingRequestItem", tableRows(extIEsMBSMappingandDataForwardingRequestItem), reflect.TypeFor[MBSMappingandDataForwardingRequestItem]()}, + {"MBS-QoSFlowsToBeSetupItem", tableRows(extIEsMBSQoSFlowsToBeSetupItem), reflect.TypeFor[MBSQoSFlowsToBeSetupItem]()}, + {"MBS-ServiceAreaInformation", tableRows(extIEsMBSServiceAreaInformation), reflect.TypeFor[MBSServiceAreaInformation]()}, + {"MBS-ServiceAreaInformationItem", tableRows(extIEsMBSServiceAreaInformationItem), reflect.TypeFor[MBSServiceAreaInformationItem]()}, + {"MBSSessionFailedtoSetupItem", tableRows(extIEsMBSSessionFailedtoSetupItem), reflect.TypeFor[MBSSessionFailedtoSetupItem]()}, + {"MBS-SessionID", tableRows(extIEsMBSSessionID), reflect.TypeFor[MBSSessionID]()}, + {"MBSSessionSetupRequestItem", tableRows(extIEsMBSSessionSetupRequestItem), reflect.TypeFor[MBSSessionSetupRequestItem]()}, + {"MBSSessionSetupResponseItem", tableRows(extIEsMBSSessionSetupResponseItem), reflect.TypeFor[MBSSessionSetupResponseItem]()}, + {"MBSSessionSetuporModifyRequestItem", tableRows(extIEsMBSSessionSetuporModifyRequestItem), reflect.TypeFor[MBSSessionSetuporModifyRequestItem]()}, + {"MBSSessionToReleaseItem", tableRows(extIEsMBSSessionToReleaseItem), reflect.TypeFor[MBSSessionToReleaseItem]()}, + {"MDT-Configuration", tableRows(extIEsMDTConfiguration), reflect.TypeFor[MDTConfiguration]()}, + {"MDT-Configuration-EUTRA", tableRows(extIEsMDTConfigurationEUTRA), reflect.TypeFor[MDTConfigurationEUTRA]()}, + {"MDT-Configuration-NR", tableRows(extIEsMDTConfigurationNR), reflect.TypeFor[MDTConfigurationNR]()}, + {"MDT-Location-Info", tableRows(extIEsMDTLocationInfo), reflect.TypeFor[MDTLocationInfo]()}, + {"MDT-circle", tableRows(extIEsMDTcircle), reflect.TypeFor[MDTcircle]()}, + {"MobileIAB-MTUserLocationInformation", tableRows(extIEsMobileIABMTUserLocationInformation), reflect.TypeFor[MobileIABMTUserLocationInformation]()}, + {"MobilityRestrictionList", tableRows(extIEsMobilityRestrictionList), reflect.TypeFor[MobilityRestrictionList]()}, + {"MonitoringRequestonAvailableBitrate", tableRows(extIEsMonitoringRequestonAvailableBitrate), reflect.TypeFor[MonitoringRequestonAvailableBitrate]()}, + {"N6JitterInformation", tableRows(extIEsN6JitterInformation), reflect.TypeFor[N6JitterInformation]()}, + {"NB-IoT-Paging-eDRXInfo", tableRows(extIEsNBIoTPagingeDRXInfo), reflect.TypeFor[NBIoTPagingeDRXInfo]()}, + {"NGAPIESupportInformationRequestItem", tableRows(extIEsNGAPIESupportInformationRequestItem), reflect.TypeFor[NGAPIESupportInformationRequestItem]()}, + {"NGRAN-CellReportItem", tableRows(extIEsNGRANCellReportItem), reflect.TypeFor[NGRANCellReportItem]()}, + {"NGRAN-CellToReportItem", tableRows(extIEsNGRANCellToReportItem), reflect.TypeFor[NGRANCellToReportItem]()}, + {"NGRAN-RadioResourceStatus", tableRows(extIEsNGRANRadioResourceStatus), reflect.TypeFor[NGRANRadioResourceStatus]()}, + {"NGRAN-ReportingStatusIEs", tableRows(extIEsNGRANReportingStatusIEs), reflect.TypeFor[NGRANReportingStatusIEs]()}, + {"NGRAN-ReportingSystemIEs", tableRows(extIEsNGRANReportingSystemIEs), reflect.TypeFor[NGRANReportingSystemIEs]()}, + {"NGRAN-TNLAssociationToRemoveItem", tableRows(extIEsNGRANTNLAssociationToRemoveItem), reflect.TypeFor[NGRANTNLAssociationToRemoveItem]()}, + {"NR-A2X-ServicesAuthorized", tableRows(extIEsNRA2XServicesAuthorized), reflect.TypeFor[NRA2XServicesAuthorized]()}, + {"NR-CGI", tableRows(extIEsNRCGI), reflect.TypeFor[NRCGI]()}, + {"NRFrequencyBandItem", tableRows(extIEsNRFrequencyBandItem), reflect.TypeFor[NRFrequencyBandItem]()}, + {"NRFrequencyInfo", tableRows(extIEsNRFrequencyInfo), reflect.TypeFor[NRFrequencyInfo]()}, + {"NRNTNTAIInformation", tableRows(extIEsNRNTNTAIInformation), reflect.TypeFor[NRNTNTAIInformation]()}, + {"NR-PagingeDRXInformation", tableRows(extIEsNRPagingeDRXInformation), reflect.TypeFor[NRPagingeDRXInformation]()}, + {"NRUESidelinkAggregateMaximumBitrate", tableRows(extIEsNRUESidelinkAggregateMaximumBitrate), reflect.TypeFor[NRUESidelinkAggregateMaximumBitrate]()}, + {"NRV2XServicesAuthorized", tableRows(extIEsNRV2XServicesAuthorized), reflect.TypeFor[NRV2XServicesAuthorized]()}, + {"NetworkSliceAreaScopeofMDT", tableRows(extIEsNetworkSliceAreaScopeofMDT), reflect.TypeFor[NetworkSliceAreaScopeofMDT]()}, + {"NetworkSliceItemforMDT", tableRows(extIEsNetworkSliceItemforMDT), reflect.TypeFor[NetworkSliceItemforMDT]()}, + {"NonDynamic5QIDescriptor", tableRows(extIEsNonDynamic5QIDescriptor), reflect.TypeFor[NonDynamic5QIDescriptor]()}, + {"NotificationCell-Item", tableRows(extIEsNotificationCellItem), reflect.TypeFor[NotificationCellItem]()}, + {"OverloadStartNSSAIItem", tableRows(extIEsOverloadStartNSSAIItem), reflect.TypeFor[OverloadStartNSSAIItem]()}, + {"PC5FlowBitRates", tableRows(extIEsPC5FlowBitRates), reflect.TypeFor[PC5FlowBitRates]()}, + {"PC5QoSFlowItem", tableRows(extIEsPC5QoSFlowItem), reflect.TypeFor[PC5QoSFlowItem]()}, + {"PC5QoSParameters", tableRows(extIEsPC5QoSParameters), reflect.TypeFor[PC5QoSParameters]()}, + {"PDUSessionAggregateMaximumBitRate", tableRows(extIEsPDUSessionAggregateMaximumBitRate), reflect.TypeFor[PDUSessionAggregateMaximumBitRate]()}, + {"PDUSessionResourceAdmittedItem", tableRows(extIEsPDUSessionResourceAdmittedItem), reflect.TypeFor[PDUSessionResourceAdmittedItem]()}, + {"PDUSessionResourceFailedToModifyItemModCfm", tableRows(extIEsPDUSessionResourceFailedToModifyItemModCfm), reflect.TypeFor[PDUSessionResourceFailedToModifyItemModCfm]()}, + {"PDUSessionResourceFailedToModifyItemModRes", tableRows(extIEsPDUSessionResourceFailedToModifyItemModRes), reflect.TypeFor[PDUSessionResourceFailedToModifyItemModRes]()}, + {"PDUSessionResourceFailedToSetupItemCxtFail", tableRows(extIEsPDUSessionResourceFailedToSetupItemCxtFail), reflect.TypeFor[PDUSessionResourceFailedToSetupItemCxtFail]()}, + {"PDUSessionResourceFailedToSetupItemCxtRes", tableRows(extIEsPDUSessionResourceFailedToSetupItemCxtRes), reflect.TypeFor[PDUSessionResourceFailedToSetupItemCxtRes]()}, + {"PDUSessionResourceFailedToSetupItemHOAck", tableRows(extIEsPDUSessionResourceFailedToSetupItemHOAck), reflect.TypeFor[PDUSessionResourceFailedToSetupItemHOAck]()}, + {"PDUSessionResourceFailedToSetupItemPSReq", tableRows(extIEsPDUSessionResourceFailedToSetupItemPSReq), reflect.TypeFor[PDUSessionResourceFailedToSetupItemPSReq]()}, + {"PDUSessionResourceFailedToSetupItemSURes", tableRows(extIEsPDUSessionResourceFailedToSetupItemSURes), reflect.TypeFor[PDUSessionResourceFailedToSetupItemSURes]()}, + {"PDUSessionResourceHandoverItem", tableRows(extIEsPDUSessionResourceHandoverItem), reflect.TypeFor[PDUSessionResourceHandoverItem]()}, + {"PDUSessionResourceInformationItem", tableRows(extIEsPDUSessionResourceInformationItem), reflect.TypeFor[PDUSessionResourceInformationItem]()}, + {"PDUSessionResourceItemCxtRelCpl", tableRows(extIEsPDUSessionResourceItemCxtRelCpl), reflect.TypeFor[PDUSessionResourceItemCxtRelCpl]()}, + {"PDUSessionResourceItemCxtRelReq", tableRows(extIEsPDUSessionResourceItemCxtRelReq), reflect.TypeFor[PDUSessionResourceItemCxtRelReq]()}, + {"PDUSessionResourceItemHORqd", tableRows(extIEsPDUSessionResourceItemHORqd), reflect.TypeFor[PDUSessionResourceItemHORqd]()}, + {"PDUSessionResourceModifyConfirmTransfer", tableRows(extIEsPDUSessionResourceModifyConfirmTransfer), reflect.TypeFor[PDUSessionResourceModifyConfirmTransfer]()}, + {"PDUSessionResourceModifyIndicationTransfer", tableRows(extIEsPDUSessionResourceModifyIndicationTransfer), reflect.TypeFor[PDUSessionResourceModifyIndicationTransfer]()}, + {"PDUSessionResourceModifyIndicationUnsuccessfulTransfer", tableRows(extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer), reflect.TypeFor[PDUSessionResourceModifyIndicationUnsuccessfulTransfer]()}, + {"PDUSessionResourceModifyItemModCfm", tableRows(extIEsPDUSessionResourceModifyItemModCfm), reflect.TypeFor[PDUSessionResourceModifyItemModCfm]()}, + {"PDUSessionResourceModifyItemModInd", tableRows(extIEsPDUSessionResourceModifyItemModInd), reflect.TypeFor[PDUSessionResourceModifyItemModInd]()}, + {"PDUSessionResourceModifyItemModReq", tableRows(extIEsPDUSessionResourceModifyItemModReq), reflect.TypeFor[PDUSessionResourceModifyItemModReq]()}, + {"PDUSessionResourceModifyItemModRes", tableRows(extIEsPDUSessionResourceModifyItemModRes), reflect.TypeFor[PDUSessionResourceModifyItemModRes]()}, + {"PDUSessionResourceModifyResponseTransfer", tableRows(extIEsPDUSessionResourceModifyResponseTransfer), reflect.TypeFor[PDUSessionResourceModifyResponseTransfer]()}, + {"PDUSessionResourceModifyUnsuccessfulTransfer", tableRows(extIEsPDUSessionResourceModifyUnsuccessfulTransfer), reflect.TypeFor[PDUSessionResourceModifyUnsuccessfulTransfer]()}, + {"PDUSessionResourceNotifyItem", tableRows(extIEsPDUSessionResourceNotifyItem), reflect.TypeFor[PDUSessionResourceNotifyItem]()}, + {"PDUSessionResourceNotifyTransfer", tableRows(extIEsPDUSessionResourceNotifyTransfer), reflect.TypeFor[PDUSessionResourceNotifyTransfer]()}, + {"PDUSessionResourceReleaseCommandTransfer", tableRows(extIEsPDUSessionResourceReleaseCommandTransfer), reflect.TypeFor[PDUSessionResourceReleaseCommandTransfer]()}, + {"PDUSessionResourceReleaseResponseTransfer", tableRows(extIEsPDUSessionResourceReleaseResponseTransfer), reflect.TypeFor[PDUSessionResourceReleaseResponseTransfer]()}, + {"PDUSessionResourceReleasedItemNot", tableRows(extIEsPDUSessionResourceReleasedItemNot), reflect.TypeFor[PDUSessionResourceReleasedItemNot]()}, + {"PDUSessionResourceReleasedItemPSAck", tableRows(extIEsPDUSessionResourceReleasedItemPSAck), reflect.TypeFor[PDUSessionResourceReleasedItemPSAck]()}, + {"PDUSessionResourceReleasedItemPSFail", tableRows(extIEsPDUSessionResourceReleasedItemPSFail), reflect.TypeFor[PDUSessionResourceReleasedItemPSFail]()}, + {"PDUSessionResourceReleasedItemRelRes", tableRows(extIEsPDUSessionResourceReleasedItemRelRes), reflect.TypeFor[PDUSessionResourceReleasedItemRelRes]()}, + {"PDUSessionResourceSetupItemCxtReq", tableRows(extIEsPDUSessionResourceSetupItemCxtReq), reflect.TypeFor[PDUSessionResourceSetupItemCxtReq]()}, + {"PDUSessionResourceSetupItemCxtRes", tableRows(extIEsPDUSessionResourceSetupItemCxtRes), reflect.TypeFor[PDUSessionResourceSetupItemCxtRes]()}, + {"PDUSessionResourceSetupItemHOReq", tableRows(extIEsPDUSessionResourceSetupItemHOReq), reflect.TypeFor[PDUSessionResourceSetupItemHOReq]()}, + {"PDUSessionResourceSetupItemSUReq", tableRows(extIEsPDUSessionResourceSetupItemSUReq), reflect.TypeFor[PDUSessionResourceSetupItemSUReq]()}, + {"PDUSessionResourceSetupItemSURes", tableRows(extIEsPDUSessionResourceSetupItemSURes), reflect.TypeFor[PDUSessionResourceSetupItemSURes]()}, + {"PDUSessionResourceSetupResponseTransfer", tableRows(extIEsPDUSessionResourceSetupResponseTransfer), reflect.TypeFor[PDUSessionResourceSetupResponseTransfer]()}, + {"PDUSessionResourceSetupUnsuccessfulTransfer", tableRows(extIEsPDUSessionResourceSetupUnsuccessfulTransfer), reflect.TypeFor[PDUSessionResourceSetupUnsuccessfulTransfer]()}, + {"PDUSessionResourceSwitchedItem", tableRows(extIEsPDUSessionResourceSwitchedItem), reflect.TypeFor[PDUSessionResourceSwitchedItem]()}, + {"PDUSessionResourceToBeSwitchedDLItem", tableRows(extIEsPDUSessionResourceToBeSwitchedDLItem), reflect.TypeFor[PDUSessionResourceToBeSwitchedDLItem]()}, + {"PDUSessionResourceToReleaseItemHOCmd", tableRows(extIEsPDUSessionResourceToReleaseItemHOCmd), reflect.TypeFor[PDUSessionResourceToReleaseItemHOCmd]()}, + {"PDUSessionResourceToReleaseItemRelCmd", tableRows(extIEsPDUSessionResourceToReleaseItemRelCmd), reflect.TypeFor[PDUSessionResourceToReleaseItemRelCmd]()}, + {"PDUSessionUsageReport", tableRows(extIEsPDUSessionUsageReport), reflect.TypeFor[PDUSessionUsageReport]()}, + {"PDUsetQoSInformation", tableRows(extIEsPDUsetQoSInformation), reflect.TypeFor[PDUsetQoSInformation]()}, + {"PDUsetQoSParameters", tableRows(extIEsPDUsetQoSParameters), reflect.TypeFor[PDUsetQoSParameters]()}, + {"PEIPSassistanceInformation", tableRows(extIEsPEIPSassistanceInformation), reflect.TypeFor[PEIPSassistanceInformation]()}, + {"PLMNAreaBasedQMC", tableRows(extIEsPLMNAreaBasedQMC), reflect.TypeFor[PLMNAreaBasedQMC]()}, + {"PLMNSupportItem", tableRows(extIEsPLMNSupportItem), reflect.TypeFor[PLMNSupportItem]()}, + {"PNI-NPN-AreaScopeofMDT", tableRows(extIEsPNINPNAreaScopeofMDT), reflect.TypeFor[PNINPNAreaScopeofMDT]()}, + {"PNI-NPNBasedMDT", tableRows(extIEsPNINPNBasedMDT), reflect.TypeFor[PNINPNBasedMDT]()}, + {"PNI-NPN-MobilityInformation", tableRows(extIEsPNINPNMobilityInformation), reflect.TypeFor[PNINPNMobilityInformation]()}, + {"PacketErrorRate", tableRows(extIEsPacketErrorRate), reflect.TypeFor[PacketErrorRate]()}, + {"PagingAssisDataforCEcapabUE", tableRows(extIEsPagingAssisDataforCEcapabUE), reflect.TypeFor[PagingAssisDataforCEcapabUE]()}, + {"PagingAttemptInformation", tableRows(extIEsPagingAttemptInformation), reflect.TypeFor[PagingAttemptInformation]()}, + {"PartiallyAllowedNSSAI-Item", tableRows(extIEsPartiallyAllowedNSSAIItem), reflect.TypeFor[PartiallyAllowedNSSAIItem]()}, + {"PathSwitchRequestAcknowledgeTransfer", tableRows(extIEsPathSwitchRequestAcknowledgeTransfer), reflect.TypeFor[PathSwitchRequestAcknowledgeTransfer]()}, + {"PathSwitchRequestSetupFailedTransfer", tableRows(extIEsPathSwitchRequestSetupFailedTransfer), reflect.TypeFor[PathSwitchRequestSetupFailedTransfer]()}, + {"PathSwitchRequestTransfer", tableRows(extIEsPathSwitchRequestTransfer), reflect.TypeFor[PathSwitchRequestTransfer]()}, + {"PathSwitchRequestUnsuccessfulTransfer", tableRows(extIEsPathSwitchRequestUnsuccessfulTransfer), reflect.TypeFor[PathSwitchRequestUnsuccessfulTransfer]()}, + {"PeriodicReportingIEs", tableRows(extIEsPeriodicReportingIEs), reflect.TypeFor[PeriodicReportingIEs]()}, + {"PeriodicityBound", tableRows(extIEsPeriodicityBound), reflect.TypeFor[PeriodicityBound]()}, + {"QMCConfigInfo", tableRows(extIEsQMCConfigInfo), reflect.TypeFor[QMCConfigInfo]()}, + {"QMCDeactivation", tableRows(extIEsQMCDeactivation), reflect.TypeFor[QMCDeactivation]()}, + {"QoERVQoEReportingPaths", tableRows(extIEsQoERVQoEReportingPaths), reflect.TypeFor[QoERVQoEReportingPaths]()}, + {"QoSFlowTSCItem", tableRows(extIEsQoSFlowTSCItem), reflect.TypeFor[QoSFlowTSCItem]()}, + {"QoSFlowsUsageReport-Item", tableRows(extIEsQoSFlowsUsageReportItem), reflect.TypeFor[QoSFlowsUsageReportItem]()}, + {"QosFlowAcceptedItem", tableRows(extIEsQosFlowAcceptedItem), reflect.TypeFor[QosFlowAcceptedItem]()}, + {"QosFlowAddOrModifyRequestItem", tableRows(extIEsQosFlowAddOrModifyRequestItem), reflect.TypeFor[QosFlowAddOrModifyRequestItem]()}, + {"QosFlowAddOrModifyResponseItem", tableRows(extIEsQosFlowAddOrModifyResponseItem), reflect.TypeFor[QosFlowAddOrModifyResponseItem]()}, + {"QosFlowAdditionalInfoItemRelCom", tableRows(extIEsQosFlowAdditionalInfoItemRelCom), reflect.TypeFor[QosFlowAdditionalInfoItemRelCom]()}, + {"QosFlowAdditionalInfoItemRelRes", tableRows(extIEsQosFlowAdditionalInfoItemRelRes), reflect.TypeFor[QosFlowAdditionalInfoItemRelRes]()}, + {"QosFlowFeedbackItem", tableRows(extIEsQosFlowFeedbackItem), reflect.TypeFor[QosFlowFeedbackItem]()}, + {"QosFlowInformationItem", tableRows(extIEsQosFlowInformationItem), reflect.TypeFor[QosFlowInformationItem]()}, + {"QosFlowItemWithDataForwarding", tableRows(extIEsQosFlowItemWithDataForwarding), reflect.TypeFor[QosFlowItemWithDataForwarding]()}, + {"QosFlowLevelQosParameters", tableRows(extIEsQosFlowLevelQosParameters), reflect.TypeFor[QosFlowLevelQosParameters]()}, + {"QosFlowModifyConfirmItem", tableRows(extIEsQosFlowModifyConfirmItem), reflect.TypeFor[QosFlowModifyConfirmItem]()}, + {"QosFlowNotifyItem", tableRows(extIEsQosFlowNotifyItem), reflect.TypeFor[QosFlowNotifyItem]()}, + {"QosFlowParametersItem", tableRows(extIEsQosFlowParametersItem), reflect.TypeFor[QosFlowParametersItem]()}, + {"QosFlowPerTNLInformation", tableRows(extIEsQosFlowPerTNLInformation), reflect.TypeFor[QosFlowPerTNLInformation]()}, + {"QosFlowPerTNLInformationItem", tableRows(extIEsQosFlowPerTNLInformationItem), reflect.TypeFor[QosFlowPerTNLInformationItem]()}, + {"QosFlowSetupRequestItem", tableRows(extIEsQosFlowSetupRequestItem), reflect.TypeFor[QosFlowSetupRequestItem]()}, + {"QosFlowToBeForwardedItem", tableRows(extIEsQosFlowToBeForwardedItem), reflect.TypeFor[QosFlowToBeForwardedItem]()}, + {"QosFlowWithCauseItem", tableRows(extIEsQosFlowWithCauseItem), reflect.TypeFor[QosFlowWithCauseItem]()}, + {"RANfeedbacktype-proactive", tableRows(extIEsRANfeedbacktypeproactive), reflect.TypeFor[RANfeedbacktypeproactive]()}, + {"RANfeedbacktype-reactive", tableRows(extIEsRANfeedbacktypereactive), reflect.TypeFor[RANfeedbacktypereactive]()}, + {"RATRestrictions-Item", tableRows(extIEsRATRestrictionsItem), reflect.TypeFor[RATRestrictionsItem]()}, + {"RSPPFlowBitRates", tableRows(extIEsRSPPFlowBitRates), reflect.TypeFor[RSPPFlowBitRates]()}, + {"RSPPQoSFlowItem", tableRows(extIEsRSPPQoSFlowItem), reflect.TypeFor[RSPPQoSFlowItem]()}, + {"RecommendedCellItem", tableRows(extIEsRecommendedCellItem), reflect.TypeFor[RecommendedCellItem]()}, + {"RecommendedCellsForPaging", tableRows(extIEsRecommendedCellsForPaging), reflect.TypeFor[RecommendedCellsForPaging]()}, + {"RecommendedRANNodeItem", tableRows(extIEsRecommendedRANNodeItem), reflect.TypeFor[RecommendedRANNodeItem]()}, + {"RecommendedRANNodesForPaging", tableRows(extIEsRecommendedRANNodesForPaging), reflect.TypeFor[RecommendedRANNodesForPaging]()}, + {"RedundantPDUSessionInformation", tableRows(extIEsRedundantPDUSessionInformation), reflect.TypeFor[RedundantPDUSessionInformation]()}, + {"RequestedNSSAIItem", tableRows(extIEsRequestedNSSAIItem), reflect.TypeFor[RequestedNSSAIItem]()}, + {"SLPositioningRangingQoSParameters", tableRows(extIEsSLPositioningRangingQoSParameters), reflect.TypeFor[SLPositioningRangingQoSParameters]()}, + {"SLPositioningRangingServiceInfo", tableRows(extIEsSLPositioningRangingServiceInfo), reflect.TypeFor[SLPositioningRangingServiceInfo]()}, + {"SNPN-BasedMDT", tableRows(extIEsSNPNBasedMDT), reflect.TypeFor[SNPNBasedMDT]()}, + {"SNPN-CellBasedMDT", tableRows(extIEsSNPNCellBasedMDT), reflect.TypeFor[SNPNCellBasedMDT]()}, + {"SNPNCellIdListforMDTItem", tableRows(extIEsSNPNCellIdListforMDTItem), reflect.TypeFor[SNPNCellIdListforMDTItem]()}, + {"SNPNListforMDTItem", tableRows(extIEsSNPNListforMDTItem), reflect.TypeFor[SNPNListforMDTItem]()}, + {"SNPN-MobilityInformation", tableRows(extIEsSNPNMobilityInformation), reflect.TypeFor[SNPNMobilityInformation]()}, + {"SNPN-TAIBasedMDT", tableRows(extIEsSNPNTAIBasedMDT), reflect.TypeFor[SNPNTAIBasedMDT]()}, + {"SNPNTAIListforMDTItem", tableRows(extIEsSNPNTAIListforMDTItem), reflect.TypeFor[SNPNTAIListforMDTItem]()}, + {"S-NSSAI", tableRows(extIEsSNSSAI), reflect.TypeFor[SNSSAI]()}, + {"ScheduledCommunicationTime", tableRows(extIEsScheduledCommunicationTime), reflect.TypeFor[ScheduledCommunicationTime]()}, + {"SecondaryRATUsageInformation", tableRows(extIEsSecondaryRATUsageInformation), reflect.TypeFor[SecondaryRATUsageInformation]()}, + {"SecurityContext", tableRows(extIEsSecurityContext), reflect.TypeFor[SecurityContext]()}, + {"SecurityIndication", tableRows(extIEsSecurityIndication), reflect.TypeFor[SecurityIndication]()}, + {"SecurityResult", tableRows(extIEsSecurityResult), reflect.TypeFor[SecurityResult]()}, + {"SensorMeasConfigNameItem", tableRows(extIEsSensorMeasConfigNameItem), reflect.TypeFor[SensorMeasConfigNameItem]()}, + {"SensorMeasurementConfiguration", tableRows(extIEsSensorMeasurementConfiguration), reflect.TypeFor[SensorMeasurementConfiguration]()}, + {"ServedGUAMIItem", tableRows(extIEsServedGUAMIItem), reflect.TypeFor[ServedGUAMIItem]()}, + {"ServiceAreaInformation-Item", tableRows(extIEsServiceAreaInformationItem), reflect.TypeFor[ServiceAreaInformationItem]()}, + {"SliceMDTItem", tableRows(extIEsSliceMDTItem), reflect.TypeFor[SliceMDTItem]()}, + {"SliceOverloadItem", tableRows(extIEsSliceOverloadItem), reflect.TypeFor[SliceOverloadItem]()}, + {"SliceSupportItem", tableRows(extIEsSliceSupportItem), reflect.TypeFor[SliceSupportItem]()}, + {"SliceSupportQMC-Item", tableRows(extIEsSliceSupportQMCItem), reflect.TypeFor[SliceSupportQMCItem]()}, + {"SourceNGRANNode-ToTargetNGRANNode-TransparentContainer", tableRows(extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer), reflect.TypeFor[SourceNGRANNodeToTargetNGRANNodeTransparentContainer]()}, + {"SourceToTarget-AMFInformationReroute", tableRows(extIEsSourceToTargetAMFInformationReroute), reflect.TypeFor[SourceToTargetAMFInformationReroute]()}, + {"SupportedTAItem", tableRows(extIEsSupportedTAItem), reflect.TypeFor[SupportedTAItem]()}, + {"TABasedMDT", tableRows(extIEsTABasedMDT), reflect.TypeFor[TABasedMDT]()}, + {"TABasedQMC", tableRows(extIEsTABasedQMC), reflect.TypeFor[TABasedQMC]()}, + {"TAI", tableRows(extIEsTAI), reflect.TypeFor[TAI]()}, + {"TAIBasedMDT", tableRows(extIEsTAIBasedMDT), reflect.TypeFor[TAIBasedMDT]()}, + {"TAIBasedQMC", tableRows(extIEsTAIBasedQMC), reflect.TypeFor[TAIBasedQMC]()}, + {"TAIBroadcastEUTRA-Item", tableRows(extIEsTAIBroadcastEUTRAItem), reflect.TypeFor[TAIBroadcastEUTRAItem]()}, + {"TAIBroadcastNR-Item", tableRows(extIEsTAIBroadcastNRItem), reflect.TypeFor[TAIBroadcastNRItem]()}, + {"TAICancelledEUTRA-Item", tableRows(extIEsTAICancelledEUTRAItem), reflect.TypeFor[TAICancelledEUTRAItem]()}, + {"TAICancelledNR-Item", tableRows(extIEsTAICancelledNRItem), reflect.TypeFor[TAICancelledNRItem]()}, + {"TAIListForInactiveItem", tableRows(extIEsTAIListForInactiveItem), reflect.TypeFor[TAIListForInactiveItem]()}, + {"TAIListForPagingItem", tableRows(extIEsTAIListForPagingItem), reflect.TypeFor[TAIListForPagingItem]()}, + {"TAINSAGSupportItem", tableRows(extIEsTAINSAGSupportItem), reflect.TypeFor[TAINSAGSupportItem]()}, + {"TNLAssociationItem", tableRows(extIEsTNLAssociationItem), reflect.TypeFor[TNLAssociationItem]()}, + {"TSCAssistanceInformation", tableRows(extIEsTSCAssistanceInformation), reflect.TypeFor[TSCAssistanceInformation]()}, + {"TSCFeedbackInformation", tableRows(extIEsTSCFeedbackInformation), reflect.TypeFor[TSCFeedbackInformation]()}, + {"TSCTrafficCharacteristics", tableRows(extIEsTSCTrafficCharacteristics), reflect.TypeFor[TSCTrafficCharacteristics]()}, + {"TSCTrafficCharacteristicsFeedback", tableRows(extIEsTSCTrafficCharacteristicsFeedback), reflect.TypeFor[TSCTrafficCharacteristicsFeedback]()}, + {"TargetHomeENB-ID", tableRows(extIEsTargetHomeENBID), reflect.TypeFor[TargetHomeENBID]()}, + {"TargetNSSAIInformation", tableRows(extIEsTargetNSSAIInformation), reflect.TypeFor[TargetNSSAIInformation]()}, + {"TargetNSSAI-Item", tableRows(extIEsTargetNSSAIItem), reflect.TypeFor[TargetNSSAIItem]()}, + {"TargetRANNodeID", tableRows(extIEsTargetRANNodeID), reflect.TypeFor[TargetRANNodeID]()}, + {"TargetRANNodeID-SON", tableRows(extIEsTargetRANNodeIDSON), reflect.TypeFor[TargetRANNodeIDSON]()}, + {"TargetRNC-ID", tableRows(extIEsTargetRNCID), reflect.TypeFor[TargetRNCID]()}, + {"TargeteNB-ID", tableRows(extIEsTargeteNBID), reflect.TypeFor[TargeteNBID]()}, + {"TimeBasedHandoverInformation", tableRows(extIEsTimeBasedHandoverInformation), reflect.TypeFor[TimeBasedHandoverInformation]()}, + {"TimeSyncAssistanceInfo", tableRows(extIEsTimeSyncAssistanceInfo), reflect.TypeFor[TimeSyncAssistanceInfo]()}, + {"TooearlyIntersystemHO", tableRows(extIEsTooearlyIntersystemHO), reflect.TypeFor[TooearlyIntersystemHO]()}, + {"TraceActivation", tableRows(extIEsTraceActivation), reflect.TypeFor[TraceActivation]()}, + {"UEAggregateMaximumBitRate", tableRows(extIEsUEAggregateMaximumBitRate), reflect.TypeFor[UEAggregateMaximumBitRate]()}, + {"UEAppLayerMeasConfigInfo", tableRows(extIEsUEAppLayerMeasConfigInfo), reflect.TypeFor[UEAppLayerMeasConfigInfo]()}, + {"UEAppLayerMeasInfoItem", tableRows(extIEsUEAppLayerMeasInfoItem), reflect.TypeFor[UEAppLayerMeasInfoItem]()}, + {"UE-associatedLogicalNG-connectionItem", tableRows(extIEsUEAssociatedLogicalNGConnectionItem), reflect.TypeFor[UEAssociatedLogicalNGConnectionItem]()}, + {"UE-DifferentiationInfo", tableRows(extIEsUEDifferentiationInfo), reflect.TypeFor[UEDifferentiationInfo]()}, + {"UE-NGAP-ID-pair", tableRows(extIEsUENGAPIDPair), reflect.TypeFor[UENGAPIDPair]()}, + {"UEPresenceInAreaOfInterestItem", tableRows(extIEsUEPresenceInAreaOfInterestItem), reflect.TypeFor[UEPresenceInAreaOfInterestItem]()}, + {"UERadioCapabilityForPaging", tableRows(extIEsUERadioCapabilityForPaging), reflect.TypeFor[UERadioCapabilityForPaging]()}, + {"UESecurityCapabilities", tableRows(extIEsUESecurityCapabilities), reflect.TypeFor[UESecurityCapabilities]()}, + {"UESliceMaximumBitRateItem", tableRows(extIEsUESliceMaximumBitRateItem), reflect.TypeFor[UESliceMaximumBitRateItem]()}, + {"UL-NGU-UP-TNLModifyItem", tableRows(extIEsULNGUUPTNLModifyItem), reflect.TypeFor[ULNGUUPTNLModifyItem]()}, + {"UPTransportLayerInformationItem", tableRows(extIEsUPTransportLayerInformationItem), reflect.TypeFor[UPTransportLayerInformationItem]()}, + {"UPTransportLayerInformationPairItem", tableRows(extIEsUPTransportLayerInformationPairItem), reflect.TypeFor[UPTransportLayerInformationPairItem]()}, + {"UnavailableGUAMIItem", tableRows(extIEsUnavailableGUAMIItem), reflect.TypeFor[UnavailableGUAMIItem]()}, + {"UserLocationInformationEUTRA", tableRows(extIEsUserLocationInformationEUTRA), reflect.TypeFor[UserLocationInformationEUTRA]()}, + {"UserLocationInformationN3IWF-with-PortNumber", tableRows(extIEsUserLocationInformationN3IWFWithPortNumber), reflect.TypeFor[UserLocationInformationN3IWFWithPortNumber]()}, + {"UserLocationInformationN3IWF-without-PortNumber", tableRows(extIEsUserLocationInformationN3IWFWithoutPortNumber), reflect.TypeFor[UserLocationInformationN3IWFWithoutPortNumber]()}, + {"UserLocationInformationNR", tableRows(extIEsUserLocationInformationNR), reflect.TypeFor[UserLocationInformationNR]()}, + {"UserLocationInformationTNGF", tableRows(extIEsUserLocationInformationTNGF), reflect.TypeFor[UserLocationInformationTNGF]()}, + {"UserLocationInformationTWIF", tableRows(extIEsUserLocationInformationTWIF), reflect.TypeFor[UserLocationInformationTWIF]()}, + {"UserPlaneFailureIndication", tableRows(extIEsUserPlaneFailureIndication), reflect.TypeFor[UserPlaneFailureIndication]()}, + {"UserPlaneSecurityInformation", tableRows(extIEsUserPlaneSecurityInformation), reflect.TypeFor[UserPlaneSecurityInformation]()}, + {"VolumeTimedReport-Item", tableRows(extIEsVolumeTimedReportItem), reflect.TypeFor[VolumeTimedReportItem]()}, + {"WLANMeasConfigNameItem", tableRows(extIEsWLANMeasConfigNameItem), reflect.TypeFor[WLANMeasConfigNameItem]()}, + {"WLANMeasurementConfiguration", tableRows(extIEsWLANMeasurementConfiguration), reflect.TypeFor[WLANMeasurementConfiguration]()}, + {"WUS-Assistance-Information", tableRows(extIEsWUSAssistanceInformation), reflect.TypeFor[WUSAssistanceInformation]()}, + } +} + +type messageCase struct { + asn1 string + typ reflect.Type + parse func([]byte) (any, error) +} + +func messageCases() []messageCase { + return []messageCase{ + {"AMFConfigurationUpdate", reflect.TypeFor[AMFConfigurationUpdate](), func(b []byte) (any, error) { return ParseAMFConfigurationUpdate(b) }}, + {"AMFConfigurationUpdateAcknowledge", reflect.TypeFor[AMFConfigurationUpdateAcknowledge](), func(b []byte) (any, error) { return ParseAMFConfigurationUpdateAcknowledge(b) }}, + {"AMFConfigurationUpdateFailure", reflect.TypeFor[AMFConfigurationUpdateFailure](), func(b []byte) (any, error) { return ParseAMFConfigurationUpdateFailure(b) }}, + {"AMFStatusIndication", reflect.TypeFor[AMFStatusIndication](), func(b []byte) (any, error) { return ParseAMFStatusIndication(b) }}, + {"DownlinkNASTransport", reflect.TypeFor[DownlinkNASTransport](), func(b []byte) (any, error) { return ParseDownlinkNASTransport(b) }}, + {"DownlinkNonUEAssociatedNRPPaTransport", reflect.TypeFor[DownlinkNonUEAssociatedNRPPaTransport](), func(b []byte) (any, error) { return ParseDownlinkNonUEAssociatedNRPPaTransport(b) }}, + {"DownlinkRANConfigurationTransfer", reflect.TypeFor[DownlinkRANConfigurationTransfer](), func(b []byte) (any, error) { return ParseDownlinkRANConfigurationTransfer(b) }}, + {"DownlinkRANStatusTransfer", reflect.TypeFor[DownlinkRANStatusTransfer](), func(b []byte) (any, error) { return ParseDownlinkRANStatusTransfer(b) }}, + {"DownlinkUEAssociatedNRPPaTransport", reflect.TypeFor[DownlinkUEAssociatedNRPPaTransport](), func(b []byte) (any, error) { return ParseDownlinkUEAssociatedNRPPaTransport(b) }}, + {"ErrorIndication", reflect.TypeFor[ErrorIndication](), func(b []byte) (any, error) { return ParseErrorIndication(b) }}, + {"HandoverCancel", reflect.TypeFor[HandoverCancel](), func(b []byte) (any, error) { return ParseHandoverCancel(b) }}, + {"HandoverCancelAcknowledge", reflect.TypeFor[HandoverCancelAcknowledge](), func(b []byte) (any, error) { return ParseHandoverCancelAcknowledge(b) }}, + {"HandoverCommand", reflect.TypeFor[HandoverCommand](), func(b []byte) (any, error) { return ParseHandoverCommand(b) }}, + {"HandoverFailure", reflect.TypeFor[HandoverFailure](), func(b []byte) (any, error) { return ParseHandoverFailure(b) }}, + {"HandoverNotify", reflect.TypeFor[HandoverNotify](), func(b []byte) (any, error) { return ParseHandoverNotify(b) }}, + {"HandoverPreparationFailure", reflect.TypeFor[HandoverPreparationFailure](), func(b []byte) (any, error) { return ParseHandoverPreparationFailure(b) }}, + {"HandoverRequest", reflect.TypeFor[HandoverRequest](), func(b []byte) (any, error) { return ParseHandoverRequest(b) }}, + {"HandoverRequestAcknowledge", reflect.TypeFor[HandoverRequestAcknowledge](), func(b []byte) (any, error) { return ParseHandoverRequestAcknowledge(b) }}, + {"HandoverRequired", reflect.TypeFor[HandoverRequired](), func(b []byte) (any, error) { return ParseHandoverRequired(b) }}, + {"InitialContextSetupFailure", reflect.TypeFor[InitialContextSetupFailure](), func(b []byte) (any, error) { return ParseInitialContextSetupFailure(b) }}, + {"InitialContextSetupRequest", reflect.TypeFor[InitialContextSetupRequest](), func(b []byte) (any, error) { return ParseInitialContextSetupRequest(b) }}, + {"InitialContextSetupResponse", reflect.TypeFor[InitialContextSetupResponse](), func(b []byte) (any, error) { return ParseInitialContextSetupResponse(b) }}, + {"InitialUEMessage", reflect.TypeFor[InitialUEMessage](), func(b []byte) (any, error) { return ParseInitialUEMessage(b) }}, + {"LocationReport", reflect.TypeFor[LocationReport](), func(b []byte) (any, error) { return ParseLocationReport(b) }}, + {"LocationReportingControl", reflect.TypeFor[LocationReportingControl](), func(b []byte) (any, error) { return ParseLocationReportingControl(b) }}, + {"NASNonDeliveryIndication", reflect.TypeFor[NASNonDeliveryIndication](), func(b []byte) (any, error) { return ParseNASNonDeliveryIndication(b) }}, + {"NGReset", reflect.TypeFor[NGReset](), func(b []byte) (any, error) { return ParseNGReset(b) }}, + {"NGResetAcknowledge", reflect.TypeFor[NGResetAcknowledge](), func(b []byte) (any, error) { return ParseNGResetAcknowledge(b) }}, + {"NGSetupFailure", reflect.TypeFor[NGSetupFailure](), func(b []byte) (any, error) { return ParseNGSetupFailure(b) }}, + {"NGSetupRequest", reflect.TypeFor[NGSetupRequest](), func(b []byte) (any, error) { return ParseNGSetupRequest(b) }}, + {"NGSetupResponse", reflect.TypeFor[NGSetupResponse](), func(b []byte) (any, error) { return ParseNGSetupResponse(b) }}, + {"OverloadStart", reflect.TypeFor[OverloadStart](), func(b []byte) (any, error) { return ParseOverloadStart(b) }}, + {"OverloadStop", reflect.TypeFor[OverloadStop](), func(b []byte) (any, error) { return ParseOverloadStop(b) }}, + {"PDUSessionResourceModifyConfirm", reflect.TypeFor[PDUSessionResourceModifyConfirm](), func(b []byte) (any, error) { return ParsePDUSessionResourceModifyConfirm(b) }}, + {"PDUSessionResourceModifyIndication", reflect.TypeFor[PDUSessionResourceModifyIndication](), func(b []byte) (any, error) { return ParsePDUSessionResourceModifyIndication(b) }}, + {"PDUSessionResourceModifyRequest", reflect.TypeFor[PDUSessionResourceModifyRequest](), func(b []byte) (any, error) { return ParsePDUSessionResourceModifyRequest(b) }}, + {"PDUSessionResourceModifyResponse", reflect.TypeFor[PDUSessionResourceModifyResponse](), func(b []byte) (any, error) { return ParsePDUSessionResourceModifyResponse(b) }}, + {"PDUSessionResourceNotify", reflect.TypeFor[PDUSessionResourceNotify](), func(b []byte) (any, error) { return ParsePDUSessionResourceNotify(b) }}, + {"PDUSessionResourceReleaseCommand", reflect.TypeFor[PDUSessionResourceReleaseCommand](), func(b []byte) (any, error) { return ParsePDUSessionResourceReleaseCommand(b) }}, + {"PDUSessionResourceReleaseResponse", reflect.TypeFor[PDUSessionResourceReleaseResponse](), func(b []byte) (any, error) { return ParsePDUSessionResourceReleaseResponse(b) }}, + {"PDUSessionResourceSetupRequest", reflect.TypeFor[PDUSessionResourceSetupRequest](), func(b []byte) (any, error) { return ParsePDUSessionResourceSetupRequest(b) }}, + {"PDUSessionResourceSetupResponse", reflect.TypeFor[PDUSessionResourceSetupResponse](), func(b []byte) (any, error) { return ParsePDUSessionResourceSetupResponse(b) }}, + {"PWSCancelRequest", reflect.TypeFor[PWSCancelRequest](), func(b []byte) (any, error) { return ParsePWSCancelRequest(b) }}, + {"PWSCancelResponse", reflect.TypeFor[PWSCancelResponse](), func(b []byte) (any, error) { return ParsePWSCancelResponse(b) }}, + {"PWSFailureIndication", reflect.TypeFor[PWSFailureIndication](), func(b []byte) (any, error) { return ParsePWSFailureIndication(b) }}, + {"PWSRestartIndication", reflect.TypeFor[PWSRestartIndication](), func(b []byte) (any, error) { return ParsePWSRestartIndication(b) }}, + {"Paging", reflect.TypeFor[Paging](), func(b []byte) (any, error) { return ParsePaging(b) }}, + {"PathSwitchRequest", reflect.TypeFor[PathSwitchRequest](), func(b []byte) (any, error) { return ParsePathSwitchRequest(b) }}, + {"PathSwitchRequestAcknowledge", reflect.TypeFor[PathSwitchRequestAcknowledge](), func(b []byte) (any, error) { return ParsePathSwitchRequestAcknowledge(b) }}, + {"PathSwitchRequestFailure", reflect.TypeFor[PathSwitchRequestFailure](), func(b []byte) (any, error) { return ParsePathSwitchRequestFailure(b) }}, + {"RANConfigurationUpdate", reflect.TypeFor[RANConfigurationUpdate](), func(b []byte) (any, error) { return ParseRANConfigurationUpdate(b) }}, + {"RANConfigurationUpdateAcknowledge", reflect.TypeFor[RANConfigurationUpdateAcknowledge](), func(b []byte) (any, error) { return ParseRANConfigurationUpdateAcknowledge(b) }}, + {"RANConfigurationUpdateFailure", reflect.TypeFor[RANConfigurationUpdateFailure](), func(b []byte) (any, error) { return ParseRANConfigurationUpdateFailure(b) }}, + {"RerouteNASRequest", reflect.TypeFor[RerouteNASRequest](), func(b []byte) (any, error) { return ParseRerouteNASRequest(b) }}, + {"TraceFailureIndication", reflect.TypeFor[TraceFailureIndication](), func(b []byte) (any, error) { return ParseTraceFailureIndication(b) }}, + {"TraceStart", reflect.TypeFor[TraceStart](), func(b []byte) (any, error) { return ParseTraceStart(b) }}, + {"UEContextModificationFailure", reflect.TypeFor[UEContextModificationFailure](), func(b []byte) (any, error) { return ParseUEContextModificationFailure(b) }}, + {"UEContextModificationRequest", reflect.TypeFor[UEContextModificationRequest](), func(b []byte) (any, error) { return ParseUEContextModificationRequest(b) }}, + {"UEContextModificationResponse", reflect.TypeFor[UEContextModificationResponse](), func(b []byte) (any, error) { return ParseUEContextModificationResponse(b) }}, + {"UEContextReleaseCommand", reflect.TypeFor[UEContextReleaseCommand](), func(b []byte) (any, error) { return ParseUEContextReleaseCommand(b) }}, + {"UEContextReleaseComplete", reflect.TypeFor[UEContextReleaseComplete](), func(b []byte) (any, error) { return ParseUEContextReleaseComplete(b) }}, + {"UEContextReleaseRequest", reflect.TypeFor[UEContextReleaseRequest](), func(b []byte) (any, error) { return ParseUEContextReleaseRequest(b) }}, + {"UERadioCapabilityInfoIndication", reflect.TypeFor[UERadioCapabilityInfoIndication](), func(b []byte) (any, error) { return ParseUERadioCapabilityInfoIndication(b) }}, + {"UETNLABindingReleaseRequest", reflect.TypeFor[UETNLABindingReleaseRequest](), func(b []byte) (any, error) { return ParseUETNLABindingReleaseRequest(b) }}, + {"UplinkNASTransport", reflect.TypeFor[UplinkNASTransport](), func(b []byte) (any, error) { return ParseUplinkNASTransport(b) }}, + {"UplinkNonUEAssociatedNRPPaTransport", reflect.TypeFor[UplinkNonUEAssociatedNRPPaTransport](), func(b []byte) (any, error) { return ParseUplinkNonUEAssociatedNRPPaTransport(b) }}, + {"UplinkRANConfigurationTransfer", reflect.TypeFor[UplinkRANConfigurationTransfer](), func(b []byte) (any, error) { return ParseUplinkRANConfigurationTransfer(b) }}, + {"UplinkRANStatusTransfer", reflect.TypeFor[UplinkRANStatusTransfer](), func(b []byte) (any, error) { return ParseUplinkRANStatusTransfer(b) }}, + {"UplinkUEAssociatedNRPPaTransport", reflect.TypeFor[UplinkUEAssociatedNRPPaTransport](), func(b []byte) (any, error) { return ParseUplinkUEAssociatedNRPPaTransport(b) }}, + {"WriteReplaceWarningRequest", reflect.TypeFor[WriteReplaceWarningRequest](), func(b []byte) (any, error) { return ParseWriteReplaceWarningRequest(b) }}, + {"WriteReplaceWarningResponse", reflect.TypeFor[WriteReplaceWarningResponse](), func(b []byte) (any, error) { return ParseWriteReplaceWarningResponse(b) }}, + } +} diff --git a/ngap/coverage_test.go b/ngap/coverage_test.go new file mode 100644 index 0000000000..6d36af2bf2 --- /dev/null +++ b/ngap/coverage_test.go @@ -0,0 +1,413 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "reflect" + "slices" + "strings" + "testing" + "unsafe" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +var sampleValues = map[reflect.Type]any{ + reflect.TypeFor[GNBIDValue](): GNBIDValue{Value: 0x12345, Bits: 22}, + reflect.TypeFor[TransportLayerAddress](): tlaOf(10, 0, 0, 1), + reflect.TypeFor[PLMNIdentity](): PLMNIdentity{0x00, 0xf1, 0x10}, +} + +func isChoiceStruct(t reflect.Type) bool { + if t.Kind() != reflect.Struct { + return false + } + + alternatives := 0 + + for i := range t.NumField() { + f := t.Field(i) + if !f.IsExported() { + continue + } + + if !strings.Contains(f.Tag.Get("per"), "choice:") { + return false + } + + alternatives++ + } + + return alternatives > 0 +} + +func usable(v reflect.Value) bool { + if d, ok := v.Addr().Interface().(ap.Diagnosable[ProtocolIEID]); ok && d.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + return false + } + + m, ok := v.Addr().Interface().(per.Marshaler) + if !ok { + return true + } + + _, err := per.Marshal(m) + + return err == nil +} + +func fillSample(t *testing.T, v reflect.Value, depth int) { + t.Helper() + + if depth > 40 { + t.Fatalf("sample for %v nests too deep", v.Type()) + } + + if s, ok := sampleValues[v.Type()]; ok { + v.Set(reflect.ValueOf(s)) + + return + } + + switch v.Kind() { + case reflect.Pointer: + p := reflect.New(v.Type().Elem()) + fillSample(t, p.Elem(), depth+1) + v.Set(p) + case reflect.Struct: + if isChoiceStruct(v.Type()) { + for i := range v.NumField() { + f := v.Type().Field(i) + if f.IsExported() && !strings.Contains(f.Tag.Get("per"), "extie") && !strings.Contains(f.Tag.Get("per"), ",ext") { + fillSample(t, v.Field(i), depth+1) + + return + } + } + + t.Fatalf("%v has no root alternative", v.Type()) + } + + for i := range v.NumField() { + f := v.Type().Field(i) + tag := f.Tag.Get("per") + + if !f.IsExported() || strings.Contains(tag, "optional") || strings.Contains(tag, "extie") { + continue + } + + fillSample(t, v.Field(i), depth+1) + } + case reflect.Slice: + if v.Type().Elem().Kind() == reflect.Uint8 { + for n := 1; n <= 1024; n++ { + v.Set(reflect.ValueOf(bytes.Repeat([]byte{0x01}, n)).Convert(v.Type())) + + if usable(v) { + return + } + } + + t.Fatalf("no usable %v", v.Type()) + } + + s := reflect.MakeSlice(v.Type(), 1, 1) + fillSample(t, s.Index(0), depth+1) + v.Set(s) + case reflect.String: + v.SetString("a") + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + for _, n := range []int64{0, 1, 2, 3, 4096, 65536} { + v.SetInt(n) + + if usable(v) { + return + } + } + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + for _, n := range []uint64{0, 1, 2, 3, 4096, 65536} { + v.SetUint(n) + + if usable(v) { + return + } + } + } +} + +func roundTripValue(t *testing.T, in reflect.Value) reflect.Value { + t.Helper() + + b, err := per.Marshal(in.Addr().Interface().(per.Marshaler)) + if err != nil { + t.Fatalf("marshal %v: %v", in.Type(), err) + } + + out := reflect.New(in.Type()) + if err := per.Unmarshal(b, out.Interface().(per.Unmarshaler)); err != nil { + t.Fatalf("unmarshal %v: %v", in.Type(), err) + } + + re, err := per.Marshal(out.Interface().(per.Marshaler)) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, b) { + t.Fatalf("%v re-encode = % x, want % x", in.Type(), re, b) + } + + return out.Elem() +} + +func TestExtensionTablesMatchASN1(t *testing.T) { + for _, c := range extTableCases() { + t.Run(c.asn1, func(t *testing.T) { + if want := asn1Rows(t, c.asn1, "ProtocolExtensionContainer"); !slices.Equal(c.rows, want) { + t.Fatalf("rows\n %v\nwant\n %v", c.rows, want) + } + }) + } +} + +func TestEveryTypedExtensionRoundTrips(t *testing.T) { + for _, c := range extTableCases() { + for i := range c.typ.NumField() { + f := c.typ.Field(i) + if !strings.Contains(f.Tag.Get("per"), "extie:") { + continue + } + + t.Run(c.asn1+"/"+f.Name, func(t *testing.T) { + in := reflect.New(c.typ).Elem() + fillSample(t, in, 0) + fillSample(t, in.Field(i), 0) + + fillConditions(t, in) + + out := roundTripValue(t, in) + + if out.Field(i).IsZero() { + t.Fatalf("%s decoded empty", f.Name) + } + + if !out.Addr().MethodByName("Equal").IsValid() { + t.Fatalf("%v has no Equal", c.typ) + } + + if !out.MethodByName("Equal").Call([]reflect.Value{in})[0].Bool() { + t.Fatalf("round trip = %+v, want %+v", out.Interface(), in.Interface()) + } + + if d := ap.Diagnose[ProtocolIEID](out.Addr().Interface().(ap.Diagnosable[ProtocolIEID])); !d.Empty() { + t.Fatalf("diagnostics = %+v", d) + } + }) + } + } +} + +func fillConditions(t *testing.T, v reflect.Value) { + t.Helper() + + m, ok := v.Addr().Interface().(*M1Configuration) + if !ok { + return + } + + if m.BeamMeasurementsReportConfiguration != nil || m.IncludeBeamMeasurementsIndication != nil { + m.IncludeBeamMeasurementsIndication = Ptr(IncludeBeamMeasurementsIndicationTrue) + fillSample(t, reflect.ValueOf(&m.BeamMeasurementsReportConfiguration).Elem(), 0) + } +} + +func TestEveryMessageIERoundTrips(t *testing.T) { + for _, c := range messageCases() { + t.Run(c.asn1, func(t *testing.T) { + in := reflect.New(c.typ) + + for i := range c.typ.NumField() { + if f := c.typ.Field(i); f.IsExported() && !f.Anonymous { + fillSample(t, in.Elem().Field(i), 0) + } + } + + if m, ok := in.Interface().(*HandoverCommand); ok { + m.HandoverType = HandoverTypeFiveGSToEPS + } + + b, err := in.Interface().(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatalf("marshal: %v", err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + out, err := c.parse(pdu.value()) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if !equalByMethod(out, in.Interface()) { + t.Fatalf("decoded\n %+v\nwant\n %+v", out, in.Interface()) + } + + re, err := out.(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, b) { + t.Fatalf("re-encode = % x, want % x", re, b) + } + }) + } +} + +func preservedOf(t *testing.T, v reflect.Value) *extensionMeta { + t.Helper() + + f := v.FieldByName("iEExtensions") + if !f.IsValid() { + t.Fatalf("%v has no iEExtensions", v.Type()) + } + + return (*extensionMeta)(unsafe.Pointer(f.UnsafeAddr())) +} + +func typedExtensionFields(typ reflect.Type) []int { + var out []int + + for i := range typ.NumField() { + if strings.Contains(typ.Field(i).Tag.Get("per"), "extie:") && !strings.Contains(typ.Field(i).Tag.Get("per"), "conditional") { + out = append(out, i) + } + } + + return out +} + +func extensionID(t *testing.T, f reflect.StructField) (ProtocolIEID, Criticality) { + t.Helper() + + var ( + id ProtocolIEID + crit Criticality + ) + + for _, opt := range strings.Split(f.Tag.Get("per"), ",") { + switch { + case strings.HasPrefix(opt, "extie:"): + name := strings.TrimPrefix(opt, "extie:") + for i, n := range protocolIENames { + if "ID"+strings.NewReplacer("-", "", "_", "").Replace(n) == name { + id = i + } + } + case opt == "crit:reject": + crit = CriticalityReject + case opt == "crit:notify": + crit = CriticalityNotify + case opt == "crit:ignore": + crit = CriticalityIgnore + } + } + + if id == 0 && !strings.Contains(f.Tag.Get("per"), "extie:IDAllowedNSSAI") { + t.Fatalf("%s: no IE id for %q", f.Name, f.Tag.Get("per")) + } + + return id, crit +} + +func encodeMarshaler(t *testing.T, v reflect.Value) []byte { + t.Helper() + + m, ok := v.Interface().(per.Marshaler) + if !ok { + m = v.Addr().Interface().(per.Marshaler) + } + + b, err := per.Marshal(m) + if err != nil { + t.Fatal(err) + } + + return b +} + +func TestExtensionContainersAreLossless(t *testing.T) { + for _, c := range extTableCases() { + fields := typedExtensionFields(c.typ) + if len(fields) == 0 { + continue + } + + t.Run(c.asn1, func(t *testing.T) { + sample := reflect.New(c.typ).Elem() + fillSample(t, sample, 0) + + var raws []rawIE + + for _, i := range fields { + fv := reflect.New(c.typ.Field(i).Type).Elem() + fillSample(t, fv, 0) + + id, crit := extensionID(t, c.typ.Field(i)) + raws = append(raws, rawIE{ID: id, Criticality: crit, Value: encodeMarshaler(t, fv)}) + } + + cases := map[string][]rawIE{ + "unknown ignore and reject": { + {ID: 40000, Criticality: CriticalityIgnore, Value: []byte{0x01}}, + {ID: 40001, Criticality: CriticalityReject, Value: []byte{0x02, 0x03}}, + }, + "known out of order": slices.Concat(raws[len(raws)/2:], raws[:len(raws)/2]), + "duplicate": {raws[0], raws[0]}, + } + + for name, extra := range cases { + in := reflect.New(c.typ).Elem() + in.Set(sample) + + for _, r := range extra { + preservedOf(t, in).Append(r) + } + + wire := encodeMarshaler(t, in) + + out := reflect.New(c.typ) + if err := per.Unmarshal(wire, out.Interface().(per.Unmarshaler)); err != nil { + t.Fatalf("%s: decode: %v", name, err) + } + + if re := encodeMarshaler(t, out.Elem()); !bytes.Equal(re, wire) { + t.Fatalf("%s: re-encode = % x, want % x", name, re, wire) + } + + d := ap.Diagnose[ProtocolIEID](out.Interface().(ap.Diagnosable[ProtocolIEID])) + + switch name { + case "unknown ignore and reject": + if len(d.IEs) != 2 || d.IEs[1].ID != 40001 || d.IEs[1].Criticality != CriticalityReject { + t.Errorf("%s: diagnostics = %+v", name, d.IEs) + } + + if d.Check() == nil { + t.Errorf("%s: Check accepted a reject-criticality unknown extension", name) + } + case "duplicate": + if d.Empty() { + t.Errorf("%s: a duplicate extension went unreported", name) + } + } + } + }) + } +} diff --git a/ngap/criticality_diagnostics.go b/ngap/criticality_diagnostics.go index f2f83fa8f7..d4c2c38eeb 100644 --- a/ngap/criticality_diagnostics.go +++ b/ngap/criticality_diagnostics.go @@ -4,8 +4,6 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -22,115 +20,36 @@ const ( // CriticalityDiagnosticsIEItem reports one offending IE (TS 38.413 §9.3.1.3). type CriticalityDiagnosticsIEItem struct { - _ [0]struct{} `per:"extseq"` - IECriticality Criticality `per:"ENUMERATED,range:0..2"` - IEID ProtocolIEID `per:",range:0..65535"` - TypeOfError TypeOfError `per:"ENUMERATED,range:0..1,..."` - _ ieExtensions `per:",skip"` -} - -// CriticalityDiagnostics ::= SEQUENCE (extensible) with five optional fields. -// iE-Extensions is never emitted and is skipped on decode. -type CriticalityDiagnostics struct { - ProcedureCode *ProcedureCode - TriggeringMessage *TriggeringMessage - ProcedureCriticality *Criticality - IEsCriticalityDiagnostics []CriticalityDiagnosticsIEItem + extensions per.ExtensionAdditions `per:",extraw"` + IECriticality Criticality `per:"ENUMERATED,range:0..2"` + IEID ProtocolIEID `per:",range:0..65535"` + TypeOfError TypeOfError + iEExtensions extensionMeta `per:",exttable"` } -func (d CriticalityDiagnostics) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(d.ProcedureCode != nil) - w.WriteBit(d.TriggeringMessage != nil) - w.WriteBit(d.ProcedureCriticality != nil) - w.WriteBit(len(d.IEsCriticalityDiagnostics) > 0) - w.WriteBit(false) - - if d.ProcedureCode != nil { - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}, int64(*d.ProcedureCode)); err != nil { - return err - } - } +type CriticalityDiagnosticsIEList []CriticalityDiagnosticsIEItem - if d.TriggeringMessage != nil { - if err := per.EncodeEnumerated(w, enc, triggeringMessageRootCount, false, int64(*d.TriggeringMessage)); err != nil { - return err - } - } +func (l CriticalityDiagnosticsIEList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofErrors, []CriticalityDiagnosticsIEItem(l)) +} - if d.ProcedureCriticality != nil { - if err := per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(*d.ProcedureCriticality)); err != nil { - return err - } +func (l *CriticalityDiagnosticsIEList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CriticalityDiagnosticsIEItem](r, enc, 1, maxnoofErrors) + if err != nil { + return err } - if len(d.IEsCriticalityDiagnostics) > 0 { - if len(d.IEsCriticalityDiagnostics) > maxnoofErrors { - return fmt.Errorf("ngap: %d criticality-diagnostics items exceed maxnoofErrors", len(d.IEsCriticalityDiagnostics)) - } - - if err := marshalSeqOf(w, enc, 1, maxnoofErrors, d.IEsCriticalityDiagnostics); err != nil { - return err - } - } + *l = items return nil } -func (d *CriticalityDiagnostics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - var bits [6]bool - - for i := range bits { - b, err := r.ReadBit() - if err != nil { - return fmt.Errorf("ngap: criticality diagnostics preamble: %w", err) - } - - bits[i] = b - } - - extBit := bits[0] - - *d = CriticalityDiagnostics{} - - if bits[1] { - v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}) - if err != nil { - return fmt.Errorf("ngap: criticality diagnostics procedureCode: %w", err) - } - - pc := ProcedureCode(v) - d.ProcedureCode = &pc - } - - if bits[2] { - v, err := per.DecodeEnumerated(r, enc, triggeringMessageRootCount, false) - if err != nil { - return fmt.Errorf("ngap: criticality diagnostics triggeringMessage: %w", err) - } - - tm := TriggeringMessage(v) - d.TriggeringMessage = &tm - } - - if bits[3] { - v, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return fmt.Errorf("ngap: criticality diagnostics procedureCriticality: %w", err) - } - - c := Criticality(v) - d.ProcedureCriticality = &c - } - - if bits[4] { - items, err := unmarshalSeqOf[CriticalityDiagnosticsIEItem](r, enc, 1, maxnoofErrors) - if err != nil { - return err - } - - d.IEsCriticalityDiagnostics = items - } - - return skipSequenceExtensionsPER(r, enc, bits[5], extBit) +// CriticalityDiagnostics ::= SEQUENCE (extensible) with five optional fields. +type CriticalityDiagnostics struct { + ProcedureCode *ProcedureCode `per:",optional,range:0..255"` + TriggeringMessage *TriggeringMessage `per:",optional"` + ProcedureCriticality *Criticality `per:"ENUMERATED,optional,range:0..2"` + IEsCriticalityDiagnostics CriticalityDiagnosticsIEList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } diff --git a/ngap/criticality_diagnostics_test.go b/ngap/criticality_diagnostics_test.go index 5879d676ff..535fe9af11 100644 --- a/ngap/criticality_diagnostics_test.go +++ b/ngap/criticality_diagnostics_test.go @@ -13,7 +13,7 @@ import ( func TestCriticalityDiagnosticsEmpty(t *testing.T) { w := per.NewWriter() - if err := (CriticalityDiagnostics{}).MarshalPER(w, per.Aligned); err != nil { + if err := (&CriticalityDiagnostics{}).MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } @@ -136,7 +136,7 @@ func TestCriticalityDiagnosticsPartial(t *testing.T) { pc := ProcErrorIndication w := per.NewWriter() - if err := (CriticalityDiagnostics{ProcedureCode: &pc}).MarshalPER(w, per.Aligned); err != nil { + if err := (&CriticalityDiagnostics{ProcedureCode: &pc}).MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } diff --git a/ngap/decode_total_test.go b/ngap/decode_total_test.go new file mode 100644 index 0000000000..598c91f60d --- /dev/null +++ b/ngap/decode_total_test.go @@ -0,0 +1,161 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "errors" + "testing" + + "github.com/ellanetworks/core/per/ap" +) + +type totalCase struct { + name string + value []byte + decode func([]byte) (interface{ Marshal() ([]byte, error) }, error) + parse func([]byte) error + cause *CauseProtocol + ies []ProtocolIEID +} + +func checkTotal(t *testing.T, tc totalCase) { + t.Helper() + + m, err := tc.decode(tc.value) + if err != nil { + t.Fatalf("Decode: %v", err) + } + + b, err := m.Marshal() + if err != nil { + t.Fatalf("Marshal: %v", err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(pdu.value(), tc.value) { + t.Fatalf("Marshal(Decode(b))\n got %x\n want %x", pdu.value(), tc.value) + } + + err = tc.parse(tc.value) + if tc.cause == nil { + if err != nil { + t.Fatalf("Parse: %v", err) + } + + return + } + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) { + t.Fatalf("Parse = %v, want *AbstractSyntaxError", err) + } + + if !ase.Cause.Equal(tc.cause.Cause()) { + t.Fatalf("cause = %v, want %v", ase.Cause, *tc.cause) + } + + if len(ase.IEs) != len(tc.ies) { + t.Fatalf("IEs = %+v, want %v", ase.IEs, tc.ies) + } + + for i, id := range tc.ies { + if ase.IEs[i].IEID != id { + t.Fatalf("IEs = %+v, want %v", ase.IEs, tc.ies) + } + } +} + +func ngSetupCase(name string, fields []ieField, t *testing.T, cause *CauseProtocol, ies ...ProtocolIEID) totalCase { + return totalCase{ + name: name, + value: container(t, fields...), + decode: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return DecodeNGSetupRequest(b) + }, + parse: func(b []byte) error { + _, err := ParseNGSetupRequest(b) + return err + }, + cause: cause, + ies: ies, + } +} + +func TestDecodeIsTotalAndLossless(t *testing.T) { + reject := CauseProtocolAbstractSyntaxErrorReject + falsely := CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage + f := ngSetupFields() + + unknownIgnore := ieField{ID: 40000, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})} + unknownReject := ieField{ID: 40001, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x02})} + + item := goldAMFConfigurationUpdateRelay().PLMNSupportList[1] + item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityReject, Value: []byte{0x5a}}) + + nested, err := Unmarshal(marshalT(t, &AMFConfigurationUpdate{PLMNSupportList: PLMNSupportList{item}})) + if err != nil { + t.Fatal(err) + } + + cases := []totalCase{ + ngSetupCase("unknown ignore IE", []ieField{f[0], unknownIgnore, f[1], f[2], f[3]}, t, nil), + ngSetupCase("unknown reject IE", []ieField{f[0], f[1], f[2], unknownReject, f[3]}, t, &reject, 40001), + ngSetupCase("missing mandatory IE", []ieField{f[0], f[1], f[3]}, t, &reject, IDSupportedTAList), + ngSetupCase("duplicate IE", []ieField{f[0], f[0], f[1], f[2], f[3]}, t, &falsely), + ngSetupCase("wrong order", []ieField{f[2], f[0], f[1], f[3]}, t, &falsely), + { + name: "unknown reject extension nested in an item", + value: nested.value(), + decode: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return DecodeAMFConfigurationUpdate(b) + }, + parse: func(b []byte) error { + _, err := ParseAMFConfigurationUpdate(b) + return err + }, + cause: &reject, + ies: []ProtocolIEID{9999}, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { checkTotal(t, tc) }) + } +} + +func TestRawPDUUEIDAccessorRefusesDuplicate(t *testing.T) { + id := ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))} + + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUplinkNASTransport, Criticality: CriticalityIgnore, Value: container(t, id, id)}) + if err != nil { + t.Fatal(err) + } + + p, err := ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + if _, _, err := p.AMFUENGAPID(); !errors.Is(err, ErrDuplicateIE) { + t.Fatalf("AMFUENGAPID: %v", err) + } + + if err := p.SetAMFUENGAPID(2); !errors.Is(err, ErrDuplicateIE) { + t.Fatalf("SetAMFUENGAPID: %v", err) + } + + n := 0 + for range p.All(IDAMFUENGAPID) { + n++ + } + + if n != 2 { + t.Fatalf("All yielded %d occurrences, want 2", n) + } +} diff --git a/ngap/diagnostics_bound_test.go b/ngap/diagnostics_bound_test.go index 7edb068dbf..da56088493 100644 --- a/ngap/diagnostics_bound_test.go +++ b/ngap/diagnostics_bound_test.go @@ -6,6 +6,8 @@ package ngap import ( "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) // CriticalityDiagnostics-IE-List is SIZE(1..maxnoofErrors), so an untruncated @@ -14,9 +16,9 @@ func TestNotUnderstoodReportStaysSendable(t *testing.T) { fields := make([]ieField, 0, maxnoofErrors+64) for i := range cap(fields) { fields = append(fields, ieField{ - id: ProtocolIEID(40000 + i), // outside every id this version models - crit: CriticalityReject, - raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), // outside every id this version models + Criticality: CriticalityReject, + Value: ap.RawValue([]byte{0x00}), }) } diff --git a/ngap/enum_all_test.go b/ngap/enum_all_test.go new file mode 100644 index 0000000000..3a5b1c2bfb --- /dev/null +++ b/ngap/enum_all_test.go @@ -0,0 +1,1323 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +func moreExtensibleEnums() []enumCase { + return []enumCase{ + enumCaseOf("TypeOfError", &enumTypeOfError, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TypeOfError(v) + }), + enumCaseOf("UEPresence", &enumUEPresence, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEPresence(v) + }), + enumCaseOf("DelayCritical", &enumDelayCritical, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DelayCritical(v) + }), + enumCaseOf("ReflectiveQosAttribute", &enumReflectiveQosAttribute, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ReflectiveQosAttribute(v) + }), + enumCaseOf("AdditionalQosFlowInformation", &enumAdditionalQosFlowInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AdditionalQosFlowInformation(v) + }), + enumCaseOf("PreemptionCapability", &enumPreemptionCapability, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PreemptionCapability(v) + }), + enumCaseOf("PreemptionVulnerability", &enumPreemptionVulnerability, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PreemptionVulnerability(v) + }), + enumCaseOf("NotificationControl", &enumNotificationControl, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NotificationControl(v) + }), + enumCaseOf("QosFlowMappingIndication", &enumQosFlowMappingIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return QosFlowMappingIndication(v) + }), + enumCaseOf("DataForwardingAccepted", &enumDataForwardingAccepted, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DataForwardingAccepted(v) + }), + enumCaseOf("IntegrityProtectionIndication", &enumIntegrityProtectionIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IntegrityProtectionIndication(v) + }), + enumCaseOf("ConfidentialityProtectionIndication", &enumConfidentialityProtectionIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ConfidentialityProtectionIndication(v) + }), + enumCaseOf("MaximumIntegrityProtectedDataRate", &enumMaximumIntegrityProtectedDataRate, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MaximumIntegrityProtectedDataRate(v) + }), + enumCaseOf("IntegrityProtectionResult", &enumIntegrityProtectionResult, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IntegrityProtectionResult(v) + }), + enumCaseOf("ConfidentialityProtectionResult", &enumConfidentialityProtectionResult, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ConfidentialityProtectionResult(v) + }), + enumCaseOf("DirectForwardingPathAvailability", &enumDirectForwardingPathAvailability, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DirectForwardingPathAvailability(v) + }), + enumCaseOf("DLNGUTNLInformationReused", &enumDLNGUTNLInformationReused, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DLNGUTNLInformationReused(v) + }), + enumCaseOf("TimerApproachForGUAMIRemoval", &enumTimerApproachForGUAMIRemoval, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TimerApproachForGUAMIRemoval(v) + }), + enumCaseOf("ConcurrentWarningMessageInd", &enumConcurrentWarningMessageInd, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ConcurrentWarningMessageInd(v) + }), + enumCaseOf("CancelAllWarningMessages", &enumCancelAllWarningMessages, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CancelAllWarningMessages(v) + }), + enumCaseOf("ReportArea", &enumReportArea, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ReportArea(v) + }), + enumCaseOf("UEContextRequest", &enumUEContextRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEContextRequest(v) + }), + enumCaseOf("GWContextReleaseIndication", &enumGWContextReleaseIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return GWContextReleaseIndication(v) + }), + enumCaseOf("TNLAssociationUsage", &enumTNLAssociationUsage, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TNLAssociationUsage(v) + }), + enumCaseOf("PagingPriority", &enumPagingPriority, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingPriority(v) + }), + enumCaseOf("PagingOrigin", &enumPagingOrigin, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingOrigin(v) + }), + enumCaseOf("OnboardingSupport", &enumOnboardingSupport, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return OnboardingSupport(v) + }), + enumCaseOf("NotifySourceNGRANNode", &enumNotifySourceNGRANNode, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NotifySourceNGRANNode(v) + }), + enumCaseOf("OverloadAction", &enumOverloadAction, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return OverloadAction(v) + }), + enumCaseOf("UERetentionInformation", &enumUERetentionInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UERetentionInformation(v) + }), + enumCaseOf("NewSecurityContextInd", &enumNewSecurityContextInd, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NewSecurityContextInd(v) + }), + enumCaseOf("PDUSessionType", &enumPDUSessionType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PDUSessionType(v) + }), + enumCaseOf("DLForwarding", &enumDLForwarding, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DLForwarding(v) + }), + enumCaseOf("CellSize", &enumCellSize, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CellSize(v) + }), + enumCaseOf("DataForwardingNotPossible", &enumDataForwardingNotPossible, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DataForwardingNotPossible(v) + }), + enumCaseOf("UserPlaneFailureType", &enumUserPlaneFailureType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UserPlaneFailureType(v) + }), + enumCaseOf("ResetAll", &enumResetAll, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ResetAll(v) + }), + enumCaseOf("LineType", &enumLineType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LineType(v) + }), + enumCaseOf("ConfiguredTACIndication", &enumConfiguredTACIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ConfiguredTACIndication(v) + }), + enumCaseOf("RATInformation", &enumRATInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RATInformation(v) + }), + enumCaseOf("LocationReportingAdditionalInfo", &enumLocationReportingAdditionalInfo, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LocationReportingAdditionalInfo(v) + }), + enumCaseOf("AerialUEReportingPeriodicity", &enumAerialUEReportingPeriodicity, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AerialUEReportingPeriodicity(v) + }), + enumCaseOf("MBSSupportIndicator", &enumMBSSupportIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MBSSupportIndicator(v) + }), + enumCaseOf("PDUSetbasedHandlingIndicator", &enumPDUSetbasedHandlingIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PDUSetbasedHandlingIndicator(v) + }), + enumCaseOf("CNTypeRestrictionsForServing", &enumCNTypeRestrictionsForServing, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CNTypeRestrictionsForServing(v) + }), + enumCaseOf("QosMonitoringRequest", &enumQosMonitoringRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return QosMonitoringRequest(v) + }), + enumCaseOf("DLPDUSetInformationMarkingSupportIndication", &enumDLPDUSetInformationMarkingSupportIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DLPDUSetInformationMarkingSupportIndication(v) + }), + enumCaseOf("IndicationofBitrateAdaptation", &enumIndicationofBitrateAdaptation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IndicationofBitrateAdaptation(v) + }), + enumCaseOf("UserPlaneFailureIndicationReport", &enumUserPlaneFailureIndicationReport, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UserPlaneFailureIndicationReport(v) + }), + enumCaseOf("ULForwarding", &enumULForwarding, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ULForwarding(v) + }), + enumCaseOf("DAPSRequestInfoDAPSIndicator", &enumDAPSRequestInfoDAPSIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DAPSRequestInfoDAPSIndicator(v) + }), + enumCaseOf("RSN", &enumRSN, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RSN(v) + }), + enumCaseOf("CNTypeRestrictionsForEquivalentItemCnType", &enumCNTypeRestrictionsForEquivalentItemCnType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CNTypeRestrictionsForEquivalentItemCnType(v) + }), + enumCaseOf("SourceOfUEActivityBehaviourInformation", &enumSourceOfUEActivityBehaviourInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SourceOfUEActivityBehaviourInformation(v) + }), + enumCaseOf("PDUsetQoSInformationPduSetIntegratedHandlingInformation", &enumPDUsetQoSInformationPduSetIntegratedHandlingInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PDUsetQoSInformationPduSetIntegratedHandlingInformation(v) + }), + enumCaseOf("MonitoringRequest", &enumMonitoringRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MonitoringRequest(v) + }), + enumCaseOf("ECNMarkingAtRANRequest", &enumECNMarkingAtRANRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ECNMarkingAtRANRequest(v) + }), + enumCaseOf("ECNMarkingAtUPFRequest", &enumECNMarkingAtUPFRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ECNMarkingAtUPFRequest(v) + }), + enumCaseOf("CongestionInformationRequest", &enumCongestionInformationRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CongestionInformationRequest(v) + }), + enumCaseOf("PDUSessionUsageReportRATType", &enumPDUSessionUsageReportRATType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PDUSessionUsageReportRATType(v) + }), + enumCaseOf("MNonlyMDTcollection", &enumMNonlyMDTcollection, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MNonlyMDTcollection(v) + }), + enumCaseOf("ActivationStatus", &enumActivationStatus, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ActivationStatus(v) + }), + enumCaseOf("QoSFlowsUsageReportItemRATType", &enumQoSFlowsUsageReportItemRATType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return QoSFlowsUsageReportItemRATType(v) + }), + enumCaseOf("MDTActivation", &enumMDTActivation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MDTActivation(v) + }), + enumCaseOf("AllowedPNINPNItemPNINPNrestricted", &enumAllowedPNINPNItemPNINPNrestricted, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AllowedPNINPNItemPNINPNrestricted(v) + }), + enumCaseOf("RANfeedbacktypereactiveCapabilityForBATAdaptation", &enumRANfeedbacktypereactiveCapabilityForBATAdaptation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RANfeedbacktypereactiveCapabilityForBATAdaptation(v) + }), + enumCaseOf("UEAppLayerMeasConfigInfoQoEMeasurementStatus", &enumUEAppLayerMeasConfigInfoQoEMeasurementStatus, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEAppLayerMeasConfigInfoQoEMeasurementStatus(v) + }), + enumCaseOf("BluetoothMeasurementConfigurationBtrssi", &enumBluetoothMeasurementConfigurationBtrssi, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return BluetoothMeasurementConfigurationBtrssi(v) + }), + enumCaseOf("WLANMeasurementConfigurationWlanrssi", &enumWLANMeasurementConfigurationWlanrssi, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return WLANMeasurementConfigurationWlanrssi(v) + }), + enumCaseOf("WLANMeasurementConfigurationWlanrtt", &enumWLANMeasurementConfigurationWlanrtt, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return WLANMeasurementConfigurationWlanrtt(v) + }), + enumCaseOf("LoggingInterval", &enumLoggingInterval, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LoggingInterval(v) + }), + enumCaseOf("LoggingDuration", &enumLoggingDuration, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LoggingDuration(v) + }), + enumCaseOf("EarlyMeasurement", &enumEarlyMeasurement, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EarlyMeasurement(v) + }), + enumCaseOf("ServiceType", &enumServiceType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ServiceType(v) + }), + enumCaseOf("AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList", &enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList(v) + }), + enumCaseOf("AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup", &enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup(v) + }), + enumCaseOf("CommServiceType", &enumCommServiceType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CommServiceType(v) + }), + enumCaseOf("QoERVQoEReportingPathsQoEReportingPath", &enumQoERVQoEReportingPathsQoEReportingPath, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return QoERVQoEReportingPathsQoEReportingPath(v) + }), + enumCaseOf("QoERVQoEReportingPathsRVQoEReportingPath", &enumQoERVQoEReportingPathsRVQoEReportingPath, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return QoERVQoEReportingPathsRVQoEReportingPath(v) + }), + enumCaseOf("M1ReportingTrigger", &enumM1ReportingTrigger, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M1ReportingTrigger(v) + }), + enumCaseOf("IncludeBeamMeasurementsIndication", &enumIncludeBeamMeasurementsIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IncludeBeamMeasurementsIndication(v) + }), + enumCaseOf("M4period", &enumM4period, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M4period(v) + }), + enumCaseOf("Linkstolog", &enumLinkstolog, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return Linkstolog(v) + }), + enumCaseOf("M4ReportAmountMDT", &enumM4ReportAmountMDT, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M4ReportAmountMDT(v) + }), + enumCaseOf("M5period", &enumM5period, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M5period(v) + }), + enumCaseOf("M5ReportAmountMDT", &enumM5ReportAmountMDT, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M5ReportAmountMDT(v) + }), + enumCaseOf("M6reportInterval", &enumM6reportInterval, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M6reportInterval(v) + }), + enumCaseOf("M6ReportAmountMDT", &enumM6ReportAmountMDT, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M6ReportAmountMDT(v) + }), + enumCaseOf("M7ReportAmountMDT", &enumM7ReportAmountMDT, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return M7ReportAmountMDT(v) + }), + enumCaseOf("BluetoothMeasConfig", &enumBluetoothMeasConfig, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return BluetoothMeasConfig(v) + }), + enumCaseOf("WLANMeasConfig", &enumWLANMeasConfig, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return WLANMeasConfig(v) + }), + enumCaseOf("SensorMeasConfig", &enumSensorMeasConfig, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SensorMeasConfig(v) + }), + enumCaseOf("EventTriggerOutOfCoverage", &enumEventTriggerOutOfCoverage, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EventTriggerOutOfCoverage(v) + }), + enumCaseOf("ExtendedReportIntervalMDT", &enumExtendedReportIntervalMDT, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ExtendedReportIntervalMDT(v) + }), + enumCaseOf("BeamMeasurementsReportQuantityRSRP", &enumBeamMeasurementsReportQuantityRSRP, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return BeamMeasurementsReportQuantityRSRP(v) + }), + enumCaseOf("BeamMeasurementsReportQuantityRSRQ", &enumBeamMeasurementsReportQuantityRSRQ, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return BeamMeasurementsReportQuantityRSRQ(v) + }), + enumCaseOf("BeamMeasurementsReportQuantitySINR", &enumBeamMeasurementsReportQuantitySINR, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return BeamMeasurementsReportQuantitySINR(v) + }), + enumCaseOf("ExcessPacketDelayThresholdValue", &enumExcessPacketDelayThresholdValue, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ExcessPacketDelayThresholdValue(v) + }), + enumCaseOf("SensorNameConfigUncompensatedBarometricConfig", &enumSensorNameConfigUncompensatedBarometricConfig, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SensorNameConfigUncompensatedBarometricConfig(v) + }), + enumCaseOf("SensorNameConfigUeSpeedConfig", &enumSensorNameConfigUeSpeedConfig, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SensorNameConfigUeSpeedConfig(v) + }), + enumCaseOf("SensorNameConfigUeOrientationConfig", &enumSensorNameConfigUeOrientationConfig, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SensorNameConfigUeOrientationConfig(v) + }), + enumCaseOf("RRCInactiveTransitionReportRequest", &enumRRCInactiveTransitionReportRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RRCInactiveTransitionReportRequest(v) + }), + enumCaseOf("RedirectionVoiceFallback", &enumRedirectionVoiceFallback, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RedirectionVoiceFallback(v) + }), + enumCaseOf("SRVCCOperationPossible", &enumSRVCCOperationPossible, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SRVCCOperationPossible(v) + }), + enumCaseOf("IABAuthorized", &enumIABAuthorized, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IABAuthorized(v) + }), + enumCaseOf("EnhancedCoverageRestriction", &enumEnhancedCoverageRestriction, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EnhancedCoverageRestriction(v) + }), + enumCaseOf("UEDifferentiationInfoPeriodicCommunicationIndicator", &enumUEDifferentiationInfoPeriodicCommunicationIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEDifferentiationInfoPeriodicCommunicationIndicator(v) + }), + enumCaseOf("UEDifferentiationInfoStationaryIndication", &enumUEDifferentiationInfoStationaryIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEDifferentiationInfoStationaryIndication(v) + }), + enumCaseOf("UEDifferentiationInfoTrafficProfile", &enumUEDifferentiationInfoTrafficProfile, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEDifferentiationInfoTrafficProfile(v) + }), + enumCaseOf("UEDifferentiationInfoBatteryIndication", &enumUEDifferentiationInfoBatteryIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEDifferentiationInfoBatteryIndication(v) + }), + enumCaseOf("CEmodeBrestricted", &enumCEmodeBrestricted, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CEmodeBrestricted(v) + }), + enumCaseOf("UEUPCIoTSupport", &enumUEUPCIoTSupport, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEUPCIoTSupport(v) + }), + enumCaseOf("TimeSyncAssistanceInfoTimeDistributionIndication", &enumTimeSyncAssistanceInfoTimeDistributionIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TimeSyncAssistanceInfoTimeDistributionIndication(v) + }), + enumCaseOf("AerialUEsubscriptionInformation", &enumAerialUEsubscriptionInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AerialUEsubscriptionInformation(v) + }), + enumCaseOf("NRA2XServicesAuthorizedAerialUE", &enumNRA2XServicesAuthorizedAerialUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NRA2XServicesAuthorizedAerialUE(v) + }), + enumCaseOf("NRA2XServicesAuthorizedAerialControllerUE", &enumNRA2XServicesAuthorizedAerialControllerUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NRA2XServicesAuthorizedAerialControllerUE(v) + }), + enumCaseOf("LTEA2XServicesAuthorizedAerialUE", &enumLTEA2XServicesAuthorizedAerialUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LTEA2XServicesAuthorizedAerialUE(v) + }), + enumCaseOf("LTEA2XServicesAuthorizedAerialControllerUE", &enumLTEA2XServicesAuthorizedAerialControllerUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LTEA2XServicesAuthorizedAerialControllerUE(v) + }), + enumCaseOf("MobileIABAuthorized", &enumMobileIABAuthorized, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MobileIABAuthorized(v) + }), + enumCaseOf("NoPDUSessionIndication", &enumNoPDUSessionIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NoPDUSessionIndication(v) + }), + enumCaseOf("RedCapIndication", &enumRedCapIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RedCapIndication(v) + }), + enumCaseOf("ERedCapIndication", &enumERedCapIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ERedCapIndication(v) + }), + enumCaseOf("NetworkControlledRepeaterAuthorized", &enumNetworkControlledRepeaterAuthorized, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NetworkControlledRepeaterAuthorized(v) + }), + enumCaseOf("IABNodeIndication", &enumIABNodeIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IABNodeIndication(v) + }), + enumCaseOf("CEmodeBSupportIndicator", &enumCEmodeBSupportIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CEmodeBSupportIndicator(v) + }), + enumCaseOf("LTEMIndication", &enumLTEMIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LTEMIndication(v) + }), + enumCaseOf("EDTSession", &enumEDTSession, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EDTSession(v) + }), + enumCaseOf("AuthenticatedIndication", &enumAuthenticatedIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AuthenticatedIndication(v) + }), + enumCaseOf("MobileIABNodeIndication", &enumMobileIABNodeIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MobileIABNodeIndication(v) + }), + enumCaseOf("AUN3DeviceAccessInfoAUN3DeviceAccess", &enumAUN3DeviceAccessInfoAUN3DeviceAccess, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AUN3DeviceAccessInfoAUN3DeviceAccess(v) + }), + enumCaseOf("AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation", &enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation(v) + }), + enumCaseOf("UECapabilityInfoRequest", &enumUECapabilityInfoRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UECapabilityInfoRequest(v) + }), + enumCaseOf("EndIndication", &enumEndIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EndIndication(v) + }), + enumCaseOf("NBIoTDefaultPagingDRX", &enumNBIoTDefaultPagingDRX, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTDefaultPagingDRX(v) + }), + enumCaseOf("AIoTSupport", &enumAIoTSupport, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AIoTSupport(v) + }), + enumCaseOf("IABSupported", &enumIABSupported, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IABSupported(v) + }), + enumCaseOf("MobileIABSupported", &enumMobileIABSupported, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MobileIABSupported(v) + }), + enumCaseOf("NBIoTPagingDRX", &enumNBIoTPagingDRX, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTPagingDRX(v) + }), + enumCaseOf("PagingCause", &enumPagingCause, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingCause(v) + }), + enumCaseOf("LPWUSDisableIndication", &enumLPWUSDisableIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LPWUSDisableIndication(v) + }), + enumCaseOf("RRCState", &enumRRCState, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RRCState(v) + }), + enumCaseOf("XrDeviceWith2Rx", &enumXrDeviceWith2Rx, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return XrDeviceWith2Rx(v) + }), + enumCaseOf("MICOModeIndication", &enumMICOModeIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MICOModeIndication(v) + }), + enumCaseOf("MicoAllPLMN", &enumMicoAllPLMN, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MicoAllPLMN(v) + }), + enumCaseOf("PagingCauseIndicationForVoiceService", &enumPagingCauseIndicationForVoiceService, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingCauseIndicationForVoiceService(v) + }), + enumCaseOf("CNMTCommunicationHandling", &enumCNMTCommunicationHandling, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CNMTCommunicationHandling(v) + }), + enumCaseOf("VehicleUE", &enumVehicleUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return VehicleUE(v) + }), + enumCaseOf("PedestrianUE", &enumPedestrianUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PedestrianUE(v) + }), + enumCaseOf("FiveGProSeDirectDiscovery", &enumFiveGProSeDirectDiscovery, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeDirectDiscovery(v) + }), + enumCaseOf("FiveGProSeDirectCommunication", &enumFiveGProSeDirectCommunication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeDirectCommunication(v) + }), + enumCaseOf("FiveGProSeLayer2UEtoNetworkRelay", &enumFiveGProSeLayer2UEtoNetworkRelay, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2UEtoNetworkRelay(v) + }), + enumCaseOf("FiveGProSeLayer3UEtoNetworkRelay", &enumFiveGProSeLayer3UEtoNetworkRelay, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer3UEtoNetworkRelay(v) + }), + enumCaseOf("FiveGProSeLayer2RemoteUE", &enumFiveGProSeLayer2RemoteUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2RemoteUE(v) + }), + enumCaseOf("FiveGProSeLayer2Multipath", &enumFiveGProSeLayer2Multipath, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2Multipath(v) + }), + enumCaseOf("FiveGProSeLayer2UEtoUERelay", &enumFiveGProSeLayer2UEtoUERelay, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2UEtoUERelay(v) + }), + enumCaseOf("FiveGProSeLayer2UEtoUERemote", &enumFiveGProSeLayer2UEtoUERemote, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2UEtoUERemote(v) + }), + enumCaseOf("FiveGProSeLayer2MHUEtoNetworkRelay", &enumFiveGProSeLayer2MHUEtoNetworkRelay, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2MHUEtoNetworkRelay(v) + }), + enumCaseOf("FiveGProSeLayer2MHIntermediateUEtoNetworkRelay", &enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2MHIntermediateUEtoNetworkRelay(v) + }), + enumCaseOf("FiveGProSeLayer2MHRemote", &enumFiveGProSeLayer2MHRemote, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer2MHRemote(v) + }), + enumCaseOf("FiveGProSeLayer3MHUEtoNetworkRelay", &enumFiveGProSeLayer3MHUEtoNetworkRelay, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return FiveGProSeLayer3MHUEtoNetworkRelay(v) + }), + enumCaseOf("SLPositioningRangingAuthorized", &enumSLPositioningRangingAuthorized, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SLPositioningRangingAuthorized(v) + }), + enumCaseOf("EmergencyFallbackRequestIndicator", &enumEmergencyFallbackRequestIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EmergencyFallbackRequestIndicator(v) + }), + enumCaseOf("EmergencyServiceTargetCN", &enumEmergencyServiceTargetCN, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EmergencyServiceTargetCN(v) + }), + enumCaseOf("NBIoTPagingeDRXCycle", &enumNBIoTPagingeDRXCycle, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTPagingeDRXCycle(v) + }), + enumCaseOf("NBIoTPagingTimeWindow", &enumNBIoTPagingTimeWindow, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTPagingTimeWindow(v) + }), + enumCaseOf("PagingProbabilityInformation", &enumPagingProbabilityInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingProbabilityInformation(v) + }), + enumCaseOf("EUTRAPagingeDRXCycle", &enumEUTRAPagingeDRXCycle, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EUTRAPagingeDRXCycle(v) + }), + enumCaseOf("EUTRAPagingTimeWindow", &enumEUTRAPagingTimeWindow, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EUTRAPagingTimeWindow(v) + }), + enumCaseOf("NRPagingeDRXCycle", &enumNRPagingeDRXCycle, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NRPagingeDRXCycle(v) + }), + enumCaseOf("NRPagingTimeWindow", &enumNRPagingTimeWindow, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NRPagingTimeWindow(v) + }), + enumCaseOf("ExpectedHOInterval", &enumExpectedHOInterval, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ExpectedHOInterval(v) + }), + enumCaseOf("ExpectedUEMobility", &enumExpectedUEMobility, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ExpectedUEMobility(v) + }), + enumCaseOf("A2XPC5QoSFlowItemA2XRange", &enumA2XPC5QoSFlowItemA2XRange, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return A2XPC5QoSFlowItemA2XRange(v) + }), + enumCaseOf("NextPagingAreaScope", &enumNextPagingAreaScope, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NextPagingAreaScope(v) + }), + enumCaseOf("MBSAssistanceInformation", &enumMBSAssistanceInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MBSAssistanceInformation(v) + }), + enumCaseOf("RangeType", &enumRangeType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RangeType(v) + }), + enumCaseOf("ClockQualityAcceptanceCriteriaTraceabletoUTC", &enumClockQualityAcceptanceCriteriaTraceabletoUTC, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ClockQualityAcceptanceCriteriaTraceabletoUTC(v) + }), + enumCaseOf("ClockQualityAcceptanceCriteriaTraceabletoGNSS", &enumClockQualityAcceptanceCriteriaTraceabletoGNSS, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ClockQualityAcceptanceCriteriaTraceabletoGNSS(v) + }), + enumCaseOf("IntersystemUnnecessaryHOEarlyIRATHO", &enumIntersystemUnnecessaryHOEarlyIRATHO, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IntersystemUnnecessaryHOEarlyIRATHO(v) + }), + enumCaseOf("NotificationCellItemNotifyFlag", &enumNotificationCellItemNotifyFlag, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NotificationCellItemNotifyFlag(v) + }), + enumCaseOf("NumberOfMeasurementReportingLevels", &enumNumberOfMeasurementReportingLevels, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NumberOfMeasurementReportingLevels(v) + }), + enumCaseOf("ReportingPeriodicity", &enumReportingPeriodicity, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ReportingPeriodicity(v) + }), + enumCaseOf("CauseRadioNetwork", &enumCauseRadioNetwork, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseRadioNetwork(v) + }), + enumCaseOf("CauseTransport", &enumCauseTransport, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseTransport(v) + }), + enumCaseOf("CauseNas", &enumCauseNas, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseNas(v) + }), + enumCaseOf("CauseProtocol", &enumCauseProtocol, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseProtocol(v) + }), + enumCaseOf("CauseMisc", &enumCauseMisc, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseMisc(v) + }), + } +} diff --git a/ngap/enum_encode_test.go b/ngap/enum_encode_test.go index 67a741b917..bd5600b248 100644 --- a/ngap/enum_encode_test.go +++ b/ngap/enum_encode_test.go @@ -4,45 +4,150 @@ package ngap import ( + "bytes" + "fmt" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) -// A value outside an extensible ENUMERATED's root must not encode. Left to -// per.EncodeEnumerated it becomes the (v-nRoot)'th extension addition, putting -// a value TS 38.413 has not defined on the wire — the encode-side mirror of the -// decode guard in TestEnumExtensionIsNotComprehended. -func TestEnumOutsideRootIsNotEncoded(t *testing.T) { - tests := []struct { - name string - nRoot int64 - make func(int64) per.Marshaler - }{ - {"PagingDRX", pagingDRXRootCount, func(v int64) per.Marshaler { return PagingDRX(v) }}, - {"TimeToWait", timeToWaitRootCount, func(v int64) per.Marshaler { return TimeToWait(v) }}, - {"RRCEstablishmentCause", rrcEstablishmentCauseRootCount, func(v int64) per.Marshaler { return RRCEstablishmentCause(v) }}, - {"UEContextRequest", ueContextRequestRootCount, func(v int64) per.Marshaler { return UEContextRequest(v) }}, - {"GWContextReleaseIndication", gwContextReleaseIndicationRootCount, func(v int64) per.Marshaler { return GWContextReleaseIndication(v) }}, - {"GUAMIType", guamiTypeRootCount, func(v int64) per.Marshaler { return GUAMIType(v) }}, - {"TNLAssociationUsage", tnlAssociationUsageRootCount, func(v int64) per.Marshaler { return TNLAssociationUsage(v) }}, - {"OnboardingSupport", onboardingSupportRootCount, func(v int64) per.Marshaler { return OnboardingSupport(v) }}, - {"UERetentionInformation", ueRetentionInformationRootCount, func(v int64) per.Marshaler { return UERetentionInformation(v) }}, - {"TimerApproachForGUAMIRemoval", timerApproachForGUAMIRemovalRootCount, func(v int64) per.Marshaler { return TimerApproachForGUAMIRemoval(v) }}, +type enumCase struct { + name string + root int64 + known int64 + value func(int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool } + decode func([]byte) (int64, error) +} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // The last root value must still encode. - w := per.NewWriter() - if err := tt.make(tt.nRoot-1).MarshalPER(w, per.Aligned); err != nil { - t.Fatalf("root value %d: %v", tt.nRoot-1, err) - } +func enumCaseOf[T per.Integer, PT interface { + *T + per.Unmarshaler +}](name string, e *per.Enum[T], value func(int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool +}, +) enumCase { + return enumCase{ + name: name, + root: int64(len(e.Root)), + known: int64(len(e.Root) + len(e.Extension)), + value: value, + decode: func(b []byte) (int64, error) { + v := PT(new(T)) + err := v.UnmarshalPER(per.NewReader(b), per.Aligned) + + return int64(*v), err + }, + } +} + +func extensibleEnums() []enumCase { + return []enumCase{ + enumCaseOf("PagingDRX", &enumPagingDRX, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingDRX(v) + }), + enumCaseOf("TimeToWait", &enumTimeToWait, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TimeToWait(v) + }), + enumCaseOf("RRCEstablishmentCause", &enumRRCEstablishmentCause, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RRCEstablishmentCause(v) + }), + enumCaseOf("TraceDepth", &enumTraceDepth, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TraceDepth(v) + }), + enumCaseOf("NotificationCause", &enumNotificationCause, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NotificationCause(v) + }), + enumCaseOf("GUAMIType", &enumGUAMIType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return GUAMIType(v) + }), + enumCaseOf("HandoverType", &enumHandoverType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return HandoverType(v) + }), + enumCaseOf("EventType", &enumEventType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EventType(v) + }), + } +} + +func TestEnumValuesRoundTripAsIndices(t *testing.T) { + for _, tc := range append(extensibleEnums(), moreExtensibleEnums()...) { + t.Run(tc.name, func(t *testing.T) { + for _, v := range []int64{0, tc.root - 1, tc.root, tc.known - 1, tc.known, tc.known + 1, tc.root + 100} { + if v < 0 { + continue + } + + b, err := per.Marshal(tc.value(v), per.Aligned) + if err != nil { + t.Fatalf("encode %d: %v", v, err) + } + + want := extensionEnum(t, tc.root, v-tc.root) + if v < tc.root { + w := per.NewWriter() + if err := per.EncodeEnumerated(w, per.Aligned, tc.root, true, v); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + want = w.Bytes() + } + + if !bytes.Equal(b, want) { + t.Fatalf("encode %d = %x, want the X.691 index encoding %x", v, b, want) + } + + got, err := tc.decode(b) + if err != nil || got != v { + t.Fatalf("decode %x = %d, %v; want %d", b, got, err, v) + } + + unknown := v >= tc.known + if diagnosed := tc.value(v).Diagnose(&ap.Diagnosis[ProtocolIEID]{}); diagnosed != unknown { + t.Errorf("value %d: Diagnose = %v, want %v", v, diagnosed, unknown) + } - for _, v := range []int64{tt.nRoot, tt.nRoot + 1, tt.nRoot + 200} { - w := per.NewWriter() - if err := tt.make(v).MarshalPER(w, per.Aligned); err == nil { - t.Errorf("value %d outside the %d root values encoded as %x, want an error", v, tt.nRoot, w.Bytes()) + if name := tc.value(v).Name(); unknown != (name == fmt.Sprintf("unknown(%d)", v)) { + t.Errorf("value %d: Name = %q", v, name) } } }) diff --git a/ngap/enum_extension_test.go b/ngap/enum_extension_test.go index 6835131636..35182c36a2 100644 --- a/ngap/enum_extension_test.go +++ b/ngap/enum_extension_test.go @@ -4,10 +4,10 @@ package ngap import ( - "errors" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // The k'th extension addition of an ENUMERATED whose root holds nRoot values. @@ -31,24 +31,36 @@ func TestEnumExtensionIsNotComprehended(t *testing.T) { tests := []struct { name string nRoot int64 - decode func(*per.Reader) error + decode func(*per.Reader) (int64, bool, error) aliases string }{ - {"PagingDRX", pagingDRXRootCount, func(r *per.Reader) error { + {"PagingDRX", int64(len(enumPagingDRX.Root)), func(r *per.Reader) (int64, bool, error) { var v PagingDRX - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return int64(v), v.Diagnose(nil), err }, "a root paging cycle"}, - {"UERetentionInformation", ueRetentionInformationRootCount, func(r *per.Reader) error { + {"UERetentionInformation", int64(len(enumUERetentionInformation.Root)), func(r *per.Reader) (int64, bool, error) { var v UERetentionInformation - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return int64(v), v.Diagnose(nil), err }, "ues-retained"}, - {"TimeToWait", timeToWaitRootCount, func(r *per.Reader) error { + {"TimeToWait", int64(len(enumTimeToWait.Root)), func(r *per.Reader) (int64, bool, error) { var v TimeToWait - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return int64(v), v.Diagnose(nil), err }, "a root wait time"}, - {"TimerApproachForGUAMIRemoval", timerApproachForGUAMIRemovalRootCount, func(r *per.Reader) error { + {"TimerApproachForGUAMIRemoval", int64(len(enumTimerApproachForGUAMIRemoval.Root)), func(r *per.Reader) (int64, bool, error) { var v TimerApproachForGUAMIRemoval - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return int64(v), v.Diagnose(nil), err }, "apply-timer"}, } @@ -56,16 +68,16 @@ func TestEnumExtensionIsNotComprehended(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // Spans a same-byte extension and one needing the normally-small // length form. - for _, k := range []int64{0, 1, 255} { + for _, k := range []int64{0, 1, 64} { raw := extensionEnum(t, tt.nRoot, k) - err := tt.decode(per.NewReader(raw)) - if err == nil { - t.Fatalf("extension %d decoded, want it refused rather than read as %s", k, tt.aliases) + got, unknown, err := tt.decode(per.NewReader(raw)) + if err != nil { + t.Fatalf("extension %d: decode is lenient, got %v", k, err) } - if !errors.Is(err, errNotComprehended) { - t.Errorf("extension %d: err = %v, want errNotComprehended so criticality decides (§10.3.1 case 6)", k, err) + if got != tt.nRoot+k || !unknown { + t.Fatalf("extension %d decoded as %d (unknown %v), want index %d reported, not read as %s", k, got, unknown, tt.nRoot+k, tt.aliases) } } }) @@ -81,15 +93,15 @@ func TestPagingEnumExtensionsAreIgnored(t *testing.T) { nRoot int64 present func(*Paging) bool }{ - {"PagingPriority", IDPagingPriority, pagingPriorityRootCount, func(m *Paging) bool { return m.PagingPriority != nil }}, - {"PagingOrigin", IDPagingOrigin, pagingOriginRootCount, func(m *Paging) bool { return m.PagingOrigin != nil }}, + {"PagingPriority", IDPagingPriority, int64(len(enumPagingPriority.Root)), func(m *Paging) bool { return m.PagingPriority != nil }}, + {"PagingOrigin", IDPagingOrigin, int64(len(enumPagingOrigin.Root)), func(m *Paging) bool { return m.PagingOrigin != nil }}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { msg, err := ParsePaging(container(t, - ieField{id: IDPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, - ieField{id: tt.id, crit: CriticalityIgnore, raw: extensionEnum(t, tt.nRoot, 255)}, + ieField{ID: IDPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, + ieField{ID: tt.id, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, tt.nRoot, 64))}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -111,8 +123,8 @@ func TestPagingEnumExtensionsAreIgnored(t *testing.T) { // a zero that reads as DefaultPagingDRX v32. func TestNotComprehendedIEIsNotDelivered(t *testing.T) { msg, err := ParseRANConfigurationUpdate(container(t, - ieField{id: IDRANNodeName, crit: CriticalityIgnore, val: Name("ella-gnb")}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, raw: extensionEnum(t, pagingDRXRootCount, 255)}, + ieField{ID: IDRANNodeName, Criticality: CriticalityIgnore, Value: Name("ella-gnb")}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, int64(len(enumPagingDRX.Root)), 64))}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -136,26 +148,32 @@ func TestTaggedEnumExtensionIsNotComprehended(t *testing.T) { for _, tt := range []struct { name string encode func(*per.Writer) error - decode func(*per.Reader) error + decode func(*per.Reader) (ap.Diagnosable[ProtocolIEID], error) }{ {"SecurityResult/IntegrityProtectionResult", func(w *per.Writer) error { w.WriteBit(false) w.WriteBit(false) - return per.EncodeEnumerated(w, per.Aligned, integrityProtectionResultRootCount, true, integrityProtectionResultRootCount) - }, func(r *per.Reader) error { + return per.EncodeEnumerated(w, per.Aligned, int64(len(enumIntegrityProtectionResult.Root)), true, int64(len(enumIntegrityProtectionResult.Root))) + }, func(r *per.Reader) (ap.Diagnosable[ProtocolIEID], error) { var v SecurityResult - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return &v, err }}, {"SecurityIndication/IntegrityProtectionIndication", func(w *per.Writer) error { w.WriteBit(false) w.WriteBit(false) w.WriteBit(false) - return per.EncodeEnumerated(w, per.Aligned, integrityProtectionIndicationRootCount, true, integrityProtectionIndicationRootCount) - }, func(r *per.Reader) error { + return per.EncodeEnumerated(w, per.Aligned, int64(len(enumIntegrityProtectionIndication.Root)), true, int64(len(enumIntegrityProtectionIndication.Root))) + }, func(r *per.Reader) (ap.Diagnosable[ProtocolIEID], error) { var v SecurityIndication - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return &v, err }}, {"AllocationAndRetentionPriority/PreemptionCapability", func(w *per.Writer) error { w.WriteBit(false) @@ -165,10 +183,13 @@ func TestTaggedEnumExtensionIsNotComprehended(t *testing.T) { return err } - return per.EncodeEnumerated(w, per.Aligned, preemptionCapabilityRootCount, true, preemptionCapabilityRootCount) - }, func(r *per.Reader) error { + return per.EncodeEnumerated(w, per.Aligned, int64(len(enumPreemptionCapability.Root)), true, int64(len(enumPreemptionCapability.Root))) + }, func(r *per.Reader) (ap.Diagnosable[ProtocolIEID], error) { var v AllocationAndRetentionPriority - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return &v, err }}, {"AssociatedQosFlowItem/QosFlowMappingIndication", func(w *per.Writer) error { w.WriteBit(false) @@ -179,10 +200,13 @@ func TestTaggedEnumExtensionIsNotComprehended(t *testing.T) { return err } - return per.EncodeEnumerated(w, per.Aligned, qosFlowMappingIndicationRootCount, true, qosFlowMappingIndicationRootCount) - }, func(r *per.Reader) error { + return per.EncodeEnumerated(w, per.Aligned, int64(len(enumQosFlowMappingIndication.Root)), true, int64(len(enumQosFlowMappingIndication.Root))) + }, func(r *per.Reader) (ap.Diagnosable[ProtocolIEID], error) { var v AssociatedQosFlowItem - return v.UnmarshalPER(r, per.Aligned) + + err := v.UnmarshalPER(r, per.Aligned) + + return &v, err }}, } { t.Run(tt.name, func(t *testing.T) { @@ -193,13 +217,13 @@ func TestTaggedEnumExtensionIsNotComprehended(t *testing.T) { w.AlignToByte() - err := tt.decode(per.NewReader(w.Bytes())) - if err == nil { - t.Fatal("extension value decoded, want it refused rather than read as a root value") + v, err := tt.decode(per.NewReader(w.Bytes())) + if err != nil { + t.Fatalf("decode is lenient, got %v", err) } - if !errors.Is(err, errNotComprehended) { - t.Errorf("err = %v, want errNotComprehended so criticality decides (§10.3.1 case 6)", err) + if !v.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Error("extension value read as a root value instead of reported not comprehended") } }) } @@ -217,7 +241,7 @@ func TestTaggedEnumRootCountMatchesTag(t *testing.T) { nRoot int64 round func(*testing.T, int64) }{ - {"SecurityResult/IntegrityProtectionResult", integrityProtectionResultRootCount, func(t *testing.T, last int64) { + {"SecurityResult/IntegrityProtectionResult", int64(len(enumIntegrityProtectionResult.Root)), func(t *testing.T, last int64) { w := per.NewWriter() w.WriteBit(false) w.WriteBit(false) @@ -226,7 +250,7 @@ func TestTaggedEnumRootCountMatchesTag(t *testing.T) { t.Fatal(err) } - if err := per.EncodeEnumerated(w, per.Aligned, confidentialityProtectionResultRootCount, true, 0); err != nil { + if err := per.EncodeEnumerated(w, per.Aligned, int64(len(enumConfidentialityProtectionResult.Root)), true, 0); err != nil { t.Fatal(err) } @@ -241,7 +265,7 @@ func TestTaggedEnumRootCountMatchesTag(t *testing.T) { t.Errorf("IntegrityProtectionResult = %d, want %d — tag width disagrees with the RootCount constant", v.IntegrityProtectionResult, last) } }}, - {"SecurityIndication/IntegrityProtectionIndication", integrityProtectionIndicationRootCount, func(t *testing.T, last int64) { + {"SecurityIndication/IntegrityProtectionIndication", int64(len(enumIntegrityProtectionIndication.Root)), func(t *testing.T, last int64) { w := per.NewWriter() w.WriteBit(false) w.WriteBit(false) @@ -251,7 +275,7 @@ func TestTaggedEnumRootCountMatchesTag(t *testing.T) { t.Fatal(err) } - if err := per.EncodeEnumerated(w, per.Aligned, confidentialityProtectionIndicationRootCount, true, 0); err != nil { + if err := per.EncodeEnumerated(w, per.Aligned, int64(len(enumConfidentialityProtectionIndication.Root)), true, 0); err != nil { t.Fatal(err) } diff --git a/ngap/enum_names.go b/ngap/enum_names.go index cb684fe2a8..f819bd6f4f 100644 --- a/ngap/enum_names.go +++ b/ngap/enum_names.go @@ -3,196 +3,978 @@ package ngap -// ASN.1 enumeration item names from TS 38.413 §9.4.5 and §9.4.6. Each Name -// returns the empty string for a value the module does not name. +import "github.com/ellanetworks/core/per" -var criticalityNames = map[Criticality]string{ - CriticalityReject: "reject", - CriticalityIgnore: "ignore", - CriticalityNotify: "notify", +// ASN.1 enumeration item names from TS 38.413 §9.4.5 and §9.4.6. A Name backed +// by a map returns the empty string for a value the module does not name; one +// generated from a per.Enum returns "unknown(n)". + +var enumTriggeringMessage = per.Enum[TriggeringMessage]{ + Root: []string{"initiating-message", "successful-outcome", "unsuccessful-outcome"}, +} + +var enumTypeOfError = per.Enum[TypeOfError]{ + Root: []string{"not-understood", "missing"}, + Extensible: true, +} + +var enumUEPresence = per.Enum[UEPresence]{ + Root: []string{"in", "out", "unknown"}, + Extensible: true, +} + +var enumDelayCritical = per.Enum[DelayCritical]{ + Root: []string{"delay-critical", "non-delay-critical"}, + Extensible: true, +} + +var enumReflectiveQosAttribute = per.Enum[ReflectiveQosAttribute]{ + Root: []string{"subject-to"}, + Extensible: true, +} + +var enumAdditionalQosFlowInformation = per.Enum[AdditionalQosFlowInformation]{ + Root: []string{"more-likely"}, + Extensible: true, +} + +var enumPreemptionCapability = per.Enum[PreemptionCapability]{ + Root: []string{"shall-not-trigger-pre-emption", "may-trigger-pre-emption"}, + Extensible: true, +} + +var enumPreemptionVulnerability = per.Enum[PreemptionVulnerability]{ + Root: []string{"not-pre-emptable", "pre-emptable"}, + Extensible: true, +} + +var enumNotificationControl = per.Enum[NotificationControl]{ + Root: []string{"notification-requested"}, + Extensible: true, +} + +var enumQosFlowMappingIndication = per.Enum[QosFlowMappingIndication]{ + Root: []string{"ul", "dl"}, + Extensible: true, +} + +var enumDataForwardingAccepted = per.Enum[DataForwardingAccepted]{ + Root: []string{"data-forwarding-accepted"}, + Extensible: true, +} + +var enumIntegrityProtectionIndication = per.Enum[IntegrityProtectionIndication]{ + Root: []string{"required", "preferred", "not-needed"}, + Extensible: true, +} + +var enumConfidentialityProtectionIndication = per.Enum[ConfidentialityProtectionIndication]{ + Root: []string{"required", "preferred", "not-needed"}, + Extensible: true, +} + +var enumMaximumIntegrityProtectedDataRate = per.Enum[MaximumIntegrityProtectedDataRate]{ + Root: []string{"bitrate64kbs", "maximum-UE-rate"}, + Extensible: true, +} + +var enumIntegrityProtectionResult = per.Enum[IntegrityProtectionResult]{ + Root: []string{"performed", "not-performed"}, + Extensible: true, +} + +var enumConfidentialityProtectionResult = per.Enum[ConfidentialityProtectionResult]{ + Root: []string{"performed", "not-performed"}, + Extensible: true, +} + +var enumDirectForwardingPathAvailability = per.Enum[DirectForwardingPathAvailability]{ + Root: []string{"direct-path-available"}, + Extensible: true, +} + +var enumDLNGUTNLInformationReused = per.Enum[DLNGUTNLInformationReused]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumNotificationCause = per.Enum[NotificationCause]{ + Root: []string{"fulfilled", "not-fulfilled"}, + Extension: []string{"not-fulfilled-DL", "not-fulfilled-UL"}, +} + +var enumGUAMIType = per.Enum[GUAMIType]{ + Root: []string{"native", "mapped"}, + Extensible: true, +} + +var enumTimerApproachForGUAMIRemoval = per.Enum[TimerApproachForGUAMIRemoval]{ + Root: []string{"apply-timer"}, + Extensible: true, +} + +var enumConcurrentWarningMessageInd = per.Enum[ConcurrentWarningMessageInd]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumCancelAllWarningMessages = per.Enum[CancelAllWarningMessages]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumEventType = per.Enum[EventType]{ + Root: []string{"direct", "change-of-serve-cell", "ue-presence-in-area-of-interest", "stop-change-of-serve-cell", "stop-ue-presence-in-area-of-interest", "cancel-location-reporting-for-the-ue"}, + Extension: []string{"change-of-serving-cell-and-UE-presence-in-the-Area-of-Interest", "report-the-Aerial-UE-flight-information", "cancel-the-Aerial-UE-flight-information-reporting"}, +} + +var enumReportArea = per.Enum[ReportArea]{ + Root: []string{"cell"}, + Extensible: true, +} + +var enumRRCEstablishmentCause = per.Enum[RRCEstablishmentCause]{ + Root: []string{"emergency", "highPriorityAccess", "mt-Access", "mo-Signalling", "mo-Data", "mo-VoiceCall", "mo-VideoCall", "mo-SMS", "mps-PriorityAccess", "mcs-PriorityAccess"}, + Extension: []string{"notAvailable", "mo-ExceptionData"}, +} + +var enumUEContextRequest = per.Enum[UEContextRequest]{ + Root: []string{"requested"}, + Extensible: true, +} + +var enumGWContextReleaseIndication = per.Enum[GWContextReleaseIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumTNLAssociationUsage = per.Enum[TNLAssociationUsage]{ + Root: []string{"ue", "non-ue", "both"}, + Extensible: true, +} + +var enumPagingPriority = per.Enum[PagingPriority]{ + Root: []string{"priolevel1", "priolevel2", "priolevel3", "priolevel4", "priolevel5", "priolevel6", "priolevel7", "priolevel8"}, + Extensible: true, +} + +var enumPagingOrigin = per.Enum[PagingOrigin]{ + Root: []string{"non-3gpp"}, + Extensible: true, +} + +var enumOnboardingSupport = per.Enum[OnboardingSupport]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumNotifySourceNGRANNode = per.Enum[NotifySourceNGRANNode]{ + Root: []string{"notifySource"}, + Extensible: true, +} + +var enumOverloadAction = per.Enum[OverloadAction]{ + Root: []string{"reject-non-emergency-mo-dt", "reject-rrc-cr-signalling", "permit-emergency-sessions-and-mobile-terminated-services-only", "permit-high-priority-sessions-and-mobile-terminated-services-only"}, + Extensible: true, +} + +var enumTimeToWait = per.Enum[TimeToWait]{ + Root: []string{"v1s", "v2s", "v5s", "v10s", "v20s", "v60s"}, + Extensible: true, +} + +var enumTraceDepth = per.Enum[TraceDepth]{ + Root: []string{"minimum", "medium", "maximum", "minimumWithoutVendorSpecificExtension", "mediumWithoutVendorSpecificExtension", "maximumWithoutVendorSpecificExtension"}, + Extension: []string{"minimumOnlyVendorSpecificTraceRecord", "mediumOnlyVendorSpecificTraceRecord", "maximumOnlyVendorSpecificTraceRecord"}, +} + +var enumUERetentionInformation = per.Enum[UERetentionInformation]{ + Root: []string{"ues-retained"}, + Extensible: true, +} + +var enumPagingDRX = per.Enum[PagingDRX]{ + Root: []string{"v32", "v64", "v128", "v256"}, + Extensible: true, +} + +var enumHandoverType = per.Enum[HandoverType]{ + Root: []string{"intra5gs", "fivegs-to-eps", "eps-to-5gs"}, + Extension: []string{"fivegs-to-utran"}, +} + +var enumNewSecurityContextInd = per.Enum[NewSecurityContextInd]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumPDUSessionType = per.Enum[PDUSessionType]{ + Root: []string{"ipv4", "ipv6", "ipv4v6", "ethernet", "unstructured"}, + Extensible: true, +} + +var enumDLForwarding = per.Enum[DLForwarding]{ + Root: []string{"dl-forwarding-proposed"}, + Extensible: true, +} + +var enumCellSize = per.Enum[CellSize]{ + Root: []string{"verysmall", "small", "medium", "large"}, + Extensible: true, +} + +var enumDataForwardingNotPossible = per.Enum[DataForwardingNotPossible]{ + Root: []string{"data-forwarding-not-possible"}, + Extensible: true, +} + +var enumUserPlaneFailureType = per.Enum[UserPlaneFailureType]{ + Root: []string{"gtp-u-error-indication-received", "up-path-failure"}, + Extensible: true, +} + +var enumResetAll = per.Enum[ResetAll]{ + Root: []string{"reset-all"}, + Extensible: true, +} + +var enumLineType = per.Enum[LineType]{ + Root: []string{"dsl", "pon"}, + Extensible: true, +} + +var enumConfiguredTACIndication = per.Enum[ConfiguredTACIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumRATInformation = per.Enum[RATInformation]{ + Root: []string{"unlicensed", "nb-IoT"}, + Extension: []string{"nR-LEO", "nR-MEO", "nR-GEO", "nR-OTHERSAT"}, +} + +var enumLocationReportingAdditionalInfo = per.Enum[LocationReportingAdditionalInfo]{ + Root: []string{"includePSCell"}, + Extensible: true, +} + +var enumAerialUEReportingPeriodicity = per.Enum[AerialUEReportingPeriodicity]{ + Root: []string{"ms120", "ms240", "ms480", "ms640", "ms1024", "ms2048", "ms5120", "ms10240", "ms20480", "ms40960", "min1", "min6", "min12", "min30"}, + Extensible: true, +} + +var enumMBSSupportIndicator = per.Enum[MBSSupportIndicator]{ + Root: []string{"multicast-supported"}, + Extension: []string{"multicast-supported-with-reception-in-RRC-inactive"}, +} + +var enumPDUSetbasedHandlingIndicator = per.Enum[PDUSetbasedHandlingIndicator]{ + Root: []string{"supported"}, + Extensible: true, +} + +var enumCNTypeRestrictionsForServing = per.Enum[CNTypeRestrictionsForServing]{ + Root: []string{"epc-forbidden"}, + Extensible: true, +} + +var enumQosMonitoringRequest = per.Enum[QosMonitoringRequest]{ + Root: []string{"ul", "dl", "both"}, + Extension: []string{"stop"}, +} + +var enumDLPDUSetInformationMarkingSupportIndication = per.Enum[DLPDUSetInformationMarkingSupportIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumIndicationofBitrateAdaptation = per.Enum[IndicationofBitrateAdaptation]{ + Root: []string{"uplink"}, + Extensible: true, +} + +var enumRedundantQosFlowIndicator = per.Enum[RedundantQosFlowIndicator]{ + Root: []string{"true", "false"}, +} + +var enumUserPlaneFailureIndicationReport = per.Enum[UserPlaneFailureIndicationReport]{ + Root: []string{"qos-flows-and-tunnel-to-be-released", "qoS-flows-to-be-moved", "new-transport-address-allocated"}, + Extensible: true, +} + +var enumULForwarding = per.Enum[ULForwarding]{ + Root: []string{"ul-forwarding-proposed"}, + Extensible: true, +} + +var enumDAPSRequestInfoDAPSIndicator = per.Enum[DAPSRequestInfoDAPSIndicator]{ + Root: []string{"daps-ho-required"}, + Extensible: true, +} + +var enumRSN = per.Enum[RSN]{ + Root: []string{"v1", "v2"}, + Extensible: true, +} + +var enumCNTypeRestrictionsForEquivalentItemCnType = per.Enum[CNTypeRestrictionsForEquivalentItemCnType]{ + Root: []string{"epc-forbidden", "fiveGC-forbidden"}, + Extensible: true, +} + +var enumSourceOfUEActivityBehaviourInformation = per.Enum[SourceOfUEActivityBehaviourInformation]{ + Root: []string{"subscription-information", "statistics"}, + Extensible: true, +} + +var enumPDUsetQoSInformationPduSetIntegratedHandlingInformation = per.Enum[PDUsetQoSInformationPduSetIntegratedHandlingInformation]{ + Root: []string{"true", "false"}, + Extensible: true, +} + +var enumMonitoringRequest = per.Enum[MonitoringRequest]{ + Root: []string{"ul", "dl", "both", "stop"}, + Extensible: true, +} + +var enumECNMarkingAtRANRequest = per.Enum[ECNMarkingAtRANRequest]{ + Root: []string{"ul", "dl", "both", "stop"}, + Extensible: true, +} + +var enumECNMarkingAtUPFRequest = per.Enum[ECNMarkingAtUPFRequest]{ + Root: []string{"ul", "dl", "both", "stop"}, + Extensible: true, +} + +var enumCongestionInformationRequest = per.Enum[CongestionInformationRequest]{ + Root: []string{"ul", "dl", "both", "stop"}, + Extensible: true, +} + +var enumPDUSessionUsageReportRATType = per.Enum[PDUSessionUsageReportRATType]{ + Root: []string{"nr", "eutra"}, + Extension: []string{"nr-unlicensed", "e-utra-unlicensed"}, +} + +var enumMNonlyMDTcollection = per.Enum[MNonlyMDTcollection]{ + Root: []string{"mn-only"}, + Extensible: true, +} + +var enumActivationStatus = per.Enum[ActivationStatus]{ + Root: []string{"active", "not-active"}, + Extensible: true, +} + +var enumQoSFlowsUsageReportItemRATType = per.Enum[QoSFlowsUsageReportItemRATType]{ + Root: []string{"nr", "eutra"}, + Extension: []string{"nr-unlicensed", "e-utra-unlicensed"}, +} + +var enumMDTActivation = per.Enum[MDTActivation]{ + Root: []string{"immediate-MDT-only", "logged-MDT-only", "immediate-MDT-and-Trace"}, + Extensible: true, +} + +var enumAllowedPNINPNItemPNINPNrestricted = per.Enum[AllowedPNINPNItemPNINPNrestricted]{ + Root: []string{"restricted", "not-restricted"}, + Extensible: true, +} + +var enumRANfeedbacktypereactiveCapabilityForBATAdaptation = per.Enum[RANfeedbacktypereactiveCapabilityForBATAdaptation]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumUEAppLayerMeasConfigInfoQoEMeasurementStatus = per.Enum[UEAppLayerMeasConfigInfoQoEMeasurementStatus]{ + Root: []string{"ongoing"}, + Extensible: true, +} + +var enumBluetoothMeasurementConfigurationBtrssi = per.Enum[BluetoothMeasurementConfigurationBtrssi]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumWLANMeasurementConfigurationWlanrssi = per.Enum[WLANMeasurementConfigurationWlanrssi]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumWLANMeasurementConfigurationWlanrtt = per.Enum[WLANMeasurementConfigurationWlanrtt]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumLoggingInterval = per.Enum[LoggingInterval]{ + Root: []string{"ms320", "ms640", "ms1280", "ms2560", "ms5120", "ms10240", "ms20480", "ms30720", "ms40960", "ms61440", "infinity"}, + Extensible: true, +} + +var enumLoggingDuration = per.Enum[LoggingDuration]{ + Root: []string{"m10", "m20", "m40", "m60", "m90", "m120"}, + Extensible: true, +} + +var enumEarlyMeasurement = per.Enum[EarlyMeasurement]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumServiceType = per.Enum[ServiceType]{ + Root: []string{"streaming", "mTSI", "vR"}, + Extensible: true, +} + +var enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList = per.Enum[AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup = per.Enum[AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumCommServiceType = per.Enum[CommServiceType]{ + Root: []string{"mbs-broadcast", "mbs-multicast"}, + Extension: []string{"unicast"}, +} + +var enumQoERVQoEReportingPathsQoEReportingPath = per.Enum[QoERVQoEReportingPathsQoEReportingPath]{ + Root: []string{"srb4", "srb5"}, + Extensible: true, +} + +var enumQoERVQoEReportingPathsRVQoEReportingPath = per.Enum[QoERVQoEReportingPathsRVQoEReportingPath]{ + Root: []string{"srb4", "srb5"}, + Extensible: true, +} + +var enumM1ReportingTrigger = per.Enum[M1ReportingTrigger]{ + Root: []string{"periodic", "a2eventtriggered", "a2eventtriggered-periodic"}, + Extensible: true, +} + +var enumIncludeBeamMeasurementsIndication = per.Enum[IncludeBeamMeasurementsIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumM4period = per.Enum[M4period]{ + Root: []string{"ms1024", "ms2048", "ms5120", "ms10240", "min1"}, + Extensible: true, +} + +var enumLinkstolog = per.Enum[Linkstolog]{ + Root: []string{"uplink", "downlink", "both-uplink-and-downlink"}, + Extensible: true, +} + +var enumM4ReportAmountMDT = per.Enum[M4ReportAmountMDT]{ + Root: []string{"r1", "r2", "r4", "r8", "r16", "r32", "r64", "infinity"}, + Extensible: true, +} + +var enumM5period = per.Enum[M5period]{ + Root: []string{"ms1024", "ms2048", "ms5120", "ms10240", "min1"}, + Extensible: true, +} + +var enumM5ReportAmountMDT = per.Enum[M5ReportAmountMDT]{ + Root: []string{"r1", "r2", "r4", "r8", "r16", "r32", "r64", "infinity"}, + Extensible: true, +} + +var enumM6reportInterval = per.Enum[M6reportInterval]{ + Root: []string{"ms120", "ms240", "ms480", "ms640", "ms1024", "ms2048", "ms5120", "ms10240", "ms20480", "ms40960", "min1", "min6", "min12", "min30"}, + Extensible: true, +} + +var enumM6ReportAmountMDT = per.Enum[M6ReportAmountMDT]{ + Root: []string{"r1", "r2", "r4", "r8", "r16", "r32", "r64", "infinity"}, + Extensible: true, +} + +var enumM7ReportAmountMDT = per.Enum[M7ReportAmountMDT]{ + Root: []string{"r1", "r2", "r4", "r8", "r16", "r32", "r64", "infinity"}, + Extensible: true, +} + +var enumBluetoothMeasConfig = per.Enum[BluetoothMeasConfig]{ + Root: []string{"setup"}, + Extensible: true, +} + +var enumWLANMeasConfig = per.Enum[WLANMeasConfig]{ + Root: []string{"setup"}, + Extensible: true, +} + +var enumSensorMeasConfig = per.Enum[SensorMeasConfig]{ + Root: []string{"setup"}, + Extensible: true, +} + +var enumEventTriggerOutOfCoverage = per.Enum[EventTriggerOutOfCoverage]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumReportIntervalMDT = per.Enum[ReportIntervalMDT]{ + Root: []string{"ms120", "ms240", "ms480", "ms640", "ms1024", "ms2048", "ms5120", "ms10240", "min1", "min6", "min12", "min30", "min60"}, +} + +var enumReportAmountMDT = per.Enum[ReportAmountMDT]{ + Root: []string{"r1", "r2", "r4", "r8", "r16", "r32", "r64", "rinfinity"}, +} + +var enumExtendedReportIntervalMDT = per.Enum[ExtendedReportIntervalMDT]{ + Root: []string{"ms20480", "ms40960"}, + Extensible: true, +} + +var enumBeamMeasurementsReportQuantityRSRP = per.Enum[BeamMeasurementsReportQuantityRSRP]{ + Root: []string{"true"}, + Extension: []string{"false"}, +} + +var enumBeamMeasurementsReportQuantityRSRQ = per.Enum[BeamMeasurementsReportQuantityRSRQ]{ + Root: []string{"true"}, + Extension: []string{"false"}, +} + +var enumBeamMeasurementsReportQuantitySINR = per.Enum[BeamMeasurementsReportQuantitySINR]{ + Root: []string{"true"}, + Extension: []string{"false"}, +} + +var enumExcessPacketDelayThresholdValue = per.Enum[ExcessPacketDelayThresholdValue]{ + Root: []string{"ms0dot25", "ms0dot5", "ms1", "ms2", "ms4", "ms5", "ms10", "ms20", "ms30", "ms40", "ms50", "ms60", "ms70", "ms80", "ms90", "ms100", "ms150", "ms300", "ms500"}, + Extensible: true, +} + +var enumSensorNameConfigUncompensatedBarometricConfig = per.Enum[SensorNameConfigUncompensatedBarometricConfig]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumSensorNameConfigUeSpeedConfig = per.Enum[SensorNameConfigUeSpeedConfig]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumSensorNameConfigUeOrientationConfig = per.Enum[SensorNameConfigUeOrientationConfig]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumTimeToTrigger = per.Enum[TimeToTrigger]{ + Root: []string{"ms0", "ms40", "ms64", "ms80", "ms100", "ms128", "ms160", "ms256", "ms320", "ms480", "ms512", "ms640", "ms1024", "ms1280", "ms2560", "ms5120"}, +} + +var enumRRCInactiveTransitionReportRequest = per.Enum[RRCInactiveTransitionReportRequest]{ + Root: []string{"subsequent-state-transition-report", "single-rrc-connected-state-report", "cancel-report"}, + Extensible: true, +} + +var enumRedirectionVoiceFallback = per.Enum[RedirectionVoiceFallback]{ + Root: []string{"possible", "not-possible"}, + Extensible: true, +} + +var enumSRVCCOperationPossible = per.Enum[SRVCCOperationPossible]{ + Root: []string{"possible", "notPossible"}, + Extensible: true, +} + +var enumIABAuthorized = per.Enum[IABAuthorized]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumEnhancedCoverageRestriction = per.Enum[EnhancedCoverageRestriction]{ + Root: []string{"restricted"}, + Extensible: true, +} + +var enumUEDifferentiationInfoPeriodicCommunicationIndicator = per.Enum[UEDifferentiationInfoPeriodicCommunicationIndicator]{ + Root: []string{"periodically", "ondemand"}, + Extensible: true, +} + +var enumUEDifferentiationInfoStationaryIndication = per.Enum[UEDifferentiationInfoStationaryIndication]{ + Root: []string{"stationary", "mobile"}, + Extensible: true, +} + +var enumUEDifferentiationInfoTrafficProfile = per.Enum[UEDifferentiationInfoTrafficProfile]{ + Root: []string{"single-packet", "dual-packets", "multiple-packets"}, + Extensible: true, +} + +var enumUEDifferentiationInfoBatteryIndication = per.Enum[UEDifferentiationInfoBatteryIndication]{ + Root: []string{"battery-powered", "battery-powered-not-rechargeable-or-replaceable", "not-battery-powered"}, + Extensible: true, +} + +var enumCEmodeBrestricted = per.Enum[CEmodeBrestricted]{ + Root: []string{"restricted", "not-restricted"}, + Extensible: true, +} + +var enumUEUPCIoTSupport = per.Enum[UEUPCIoTSupport]{ + Root: []string{"supported"}, + Extensible: true, +} + +var enumTimeSyncAssistanceInfoTimeDistributionIndication = per.Enum[TimeSyncAssistanceInfoTimeDistributionIndication]{ + Root: []string{"enabled", "disabled"}, + Extensible: true, +} + +var enumAerialUEsubscriptionInformation = per.Enum[AerialUEsubscriptionInformation]{ + Root: []string{"allowed", "not-allowed"}, + Extensible: true, +} + +var enumNRA2XServicesAuthorizedAerialUE = per.Enum[NRA2XServicesAuthorizedAerialUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumNRA2XServicesAuthorizedAerialControllerUE = per.Enum[NRA2XServicesAuthorizedAerialControllerUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumLTEA2XServicesAuthorizedAerialUE = per.Enum[LTEA2XServicesAuthorizedAerialUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumLTEA2XServicesAuthorizedAerialControllerUE = per.Enum[LTEA2XServicesAuthorizedAerialControllerUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumMobileIABAuthorized = per.Enum[MobileIABAuthorized]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumNoPDUSessionIndication = per.Enum[NoPDUSessionIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumRedCapIndication = per.Enum[RedCapIndication]{ + Root: []string{"redcap"}, + Extensible: true, +} + +var enumERedCapIndication = per.Enum[ERedCapIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumNetworkControlledRepeaterAuthorized = per.Enum[NetworkControlledRepeaterAuthorized]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumIABNodeIndication = per.Enum[IABNodeIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumCEmodeBSupportIndicator = per.Enum[CEmodeBSupportIndicator]{ + Root: []string{"supported"}, + Extensible: true, +} + +var enumLTEMIndication = per.Enum[LTEMIndication]{ + Root: []string{"lte-m"}, + Extensible: true, +} + +var enumEDTSession = per.Enum[EDTSession]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumAuthenticatedIndication = per.Enum[AuthenticatedIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumMobileIABNodeIndication = per.Enum[MobileIABNodeIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumAUN3DeviceAccessInfoAUN3DeviceAccess = per.Enum[AUN3DeviceAccessInfoAUN3DeviceAccess]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation = per.Enum[AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation]{ + Root: []string{"true", "false"}, + Extensible: true, +} + +var enumUECapabilityInfoRequest = per.Enum[UECapabilityInfoRequest]{ + Root: []string{"requested"}, + Extensible: true, +} + +var enumEndIndication = per.Enum[EndIndication]{ + Root: []string{"no-further-data", "further-data-exists"}, + Extensible: true, +} + +var enumNBIoTDefaultPagingDRX = per.Enum[NBIoTDefaultPagingDRX]{ + Root: []string{"rf128", "rf256", "rf512", "rf1024"}, + Extensible: true, +} + +var enumAIoTSupport = per.Enum[AIoTSupport]{ + Root: []string{"aIoT-only", "aIoT-and-NRUu"}, + Extensible: true, } -func (c Criticality) Name() string { return criticalityNames[c] } +var enumIABSupported = per.Enum[IABSupported]{ + Root: []string{"true"}, + Extensible: true, +} -var triggeringMessageNames = map[TriggeringMessage]string{ - TriggeringInitiatingMessage: "initiating-message", - TriggeringSuccessfulOutcome: "successful-outcome", - TriggeringUnsuccessfulOutcome: "unsuccessful-outcome", +var enumMobileIABSupported = per.Enum[MobileIABSupported]{ + Root: []string{"true"}, + Extensible: true, } -func (t TriggeringMessage) Name() string { return triggeringMessageNames[t] } +var enumNBIoTPagingDRX = per.Enum[NBIoTPagingDRX]{ + Root: []string{"rf32", "rf64", "rf128", "rf256", "rf512", "rf1024"}, + Extensible: true, +} -var typeOfErrorNames = map[TypeOfError]string{ - TypeOfErrorNotUnderstood: "not-understood", - TypeOfErrorMissing: "missing", +var enumPagingCause = per.Enum[PagingCause]{ + Root: []string{"voice"}, + Extensible: true, } -func (t TypeOfError) Name() string { return typeOfErrorNames[t] } +var enumLPWUSDisableIndication = per.Enum[LPWUSDisableIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumRRCState = per.Enum[RRCState]{ + Root: []string{"inactive", "connected"}, + Extensible: true, +} -// Name returns the name of the Cause CHOICE alternative the group selects. -func (g CauseGroup) Name() string { return causeGroupNames[g] } +var enumXrDeviceWith2Rx = per.Enum[XrDeviceWith2Rx]{ + Root: []string{"true"}, + Extensible: true, +} -var pagingDRXNames = map[PagingDRX]string{ - PagingDRXv32: "v32", - PagingDRXv64: "v64", - PagingDRXv128: "v128", - PagingDRXv256: "v256", +var enumMICOModeIndication = per.Enum[MICOModeIndication]{ + Root: []string{"true"}, + Extensible: true, } -func (d PagingDRX) Name() string { return pagingDRXNames[d] } +var enumMicoAllPLMN = per.Enum[MicoAllPLMN]{ + Root: []string{"true"}, + Extensible: true, +} -var timeToWaitNames = map[TimeToWait]string{ - TimeToWaitV1s: "v1s", - TimeToWaitV2s: "v2s", - TimeToWaitV5s: "v5s", - TimeToWaitV10s: "v10s", - TimeToWaitV20s: "v20s", - TimeToWaitV60s: "v60s", +var enumPagingCauseIndicationForVoiceService = per.Enum[PagingCauseIndicationForVoiceService]{ + Root: []string{"supported"}, + Extensible: true, } -func (t TimeToWait) Name() string { return timeToWaitNames[t] } +var enumCNMTCommunicationHandling = per.Enum[CNMTCommunicationHandling]{ + Root: []string{"supported"}, + Extensible: true, +} -var rrcEstablishmentCauseNames = map[RRCEstablishmentCause]string{ - RRCCauseEmergency: "emergency", - RRCCauseHighPriorityAccess: "highPriorityAccess", - RRCCauseMTAccess: "mt-Access", - RRCCauseMOSignalling: "mo-Signalling", - RRCCauseMOData: "mo-Data", - RRCCauseMOVoiceCall: "mo-VoiceCall", - RRCCauseMOVideoCall: "mo-VideoCall", - RRCCauseMOSMS: "mo-SMS", - RRCCauseMPSPriorityAccess: "mps-PriorityAccess", - RRCCauseMCSPriorityAccess: "mcs-PriorityAccess", +var enumVehicleUE = per.Enum[VehicleUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (c RRCEstablishmentCause) Name() string { return rrcEstablishmentCauseNames[c] } +var enumPedestrianUE = per.Enum[PedestrianUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} -var ueContextRequestNames = map[UEContextRequest]string{ - UEContextRequested: "requested", +var enumFiveGProSeDirectDiscovery = per.Enum[FiveGProSeDirectDiscovery]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (u UEContextRequest) Name() string { return ueContextRequestNames[u] } +var enumFiveGProSeDirectCommunication = per.Enum[FiveGProSeDirectCommunication]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} -var ueRetentionInformationNames = map[UERetentionInformation]string{ - UERetentionUesRetained: "ues-retained", +var enumFiveGProSeLayer2UEtoNetworkRelay = per.Enum[FiveGProSeLayer2UEtoNetworkRelay]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (u UERetentionInformation) Name() string { return ueRetentionInformationNames[u] } +var enumFiveGProSeLayer3UEtoNetworkRelay = per.Enum[FiveGProSeLayer3UEtoNetworkRelay]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} -var pagingOriginNames = map[PagingOrigin]string{ - PagingOriginNon3GPP: "non-3gpp", +var enumFiveGProSeLayer2RemoteUE = per.Enum[FiveGProSeLayer2RemoteUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (o PagingOrigin) Name() string { return pagingOriginNames[o] } +var enumFiveGProSeLayer2Multipath = per.Enum[FiveGProSeLayer2Multipath]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} -var pagingPriorityNames = map[PagingPriority]string{ - PagingPriorityLevel1: "priolevel1", - PagingPriorityLevel2: "priolevel2", - PagingPriorityLevel3: "priolevel3", - PagingPriorityLevel4: "priolevel4", - PagingPriorityLevel5: "priolevel5", - PagingPriorityLevel6: "priolevel6", - PagingPriorityLevel7: "priolevel7", - PagingPriorityLevel8: "priolevel8", +var enumFiveGProSeLayer2UEtoUERelay = per.Enum[FiveGProSeLayer2UEtoUERelay]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (p PagingPriority) Name() string { return pagingPriorityNames[p] } +var enumFiveGProSeLayer2UEtoUERemote = per.Enum[FiveGProSeLayer2UEtoUERemote]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} -var pduSessionTypeNames = map[PDUSessionType]string{ - PDUSessionTypeIPv4: "ipv4", - PDUSessionTypeIPv6: "ipv6", - PDUSessionTypeIPv4v6: "ipv4v6", - PDUSessionTypeEthernet: "ethernet", - PDUSessionTypeUnstructured: "unstructured", +var enumFiveGProSeLayer2MHUEtoNetworkRelay = per.Enum[FiveGProSeLayer2MHUEtoNetworkRelay]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (t PDUSessionType) Name() string { return pduSessionTypeNames[t] } +var enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay = per.Enum[FiveGProSeLayer2MHIntermediateUEtoNetworkRelay]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} -var integrityProtectionResultNames = map[IntegrityProtectionResult]string{ - IntegrityProtectionPerformed: "performed", - IntegrityProtectionNotPerformed: "not-performed", +var enumFiveGProSeLayer2MHRemote = per.Enum[FiveGProSeLayer2MHRemote]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (i IntegrityProtectionResult) Name() string { return integrityProtectionResultNames[i] } +var enumFiveGProSeLayer3MHUEtoNetworkRelay = per.Enum[FiveGProSeLayer3MHUEtoNetworkRelay]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} -var confidentialityProtectionResultNames = map[ConfidentialityProtectionResult]string{ - ConfidentialityProtectionPerformed: "performed", - ConfidentialityProtectionNotPerformed: "not-performed", +var enumSLPositioningRangingAuthorized = per.Enum[SLPositioningRangingAuthorized]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, } -func (c ConfidentialityProtectionResult) Name() string { - return confidentialityProtectionResultNames[c] +var enumEmergencyFallbackRequestIndicator = per.Enum[EmergencyFallbackRequestIndicator]{ + Root: []string{"emergency-fallback-requested"}, + Extensible: true, } -var handoverTypeNames = map[HandoverType]string{ - HandoverTypeIntra5GS: "intra5gs", - HandoverTypeFiveGSToEPS: "fivegs-to-eps", - HandoverTypeEPSToFiveGS: "eps-to-5gs", +var enumEmergencyServiceTargetCN = per.Enum[EmergencyServiceTargetCN]{ + Root: []string{"fiveGC", "epc"}, + Extensible: true, } -func (h HandoverType) Name() string { return handoverTypeNames[h] } +var enumNBIoTPagingeDRXCycle = per.Enum[NBIoTPagingeDRXCycle]{ + Root: []string{"hf2", "hf4", "hf6", "hf8", "hf10", "hf12", "hf14", "hf16", "hf32", "hf64", "hf128", "hf256", "hf512", "hf1024"}, + Extensible: true, +} -var overloadActionNames = map[OverloadAction]string{ - OverloadActionRejectNonEmergencyMODT: "reject-non-emergency-mo-dt", - OverloadActionRejectRRCCRSignalling: "reject-rrc-cr-signalling", - OverloadActionPermitEmergencySessionsAndMTServicesOnly: "permit-emergency-sessions-and-mobile-terminated-services-only", - OverloadActionPermitHighPrioritySessionsAndMTServicesOnly: "permit-high-priority-sessions-and-mobile-terminated-services-only", +var enumNBIoTPagingTimeWindow = per.Enum[NBIoTPagingTimeWindow]{ + Root: []string{"s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s16"}, + Extensible: true, } -func (a OverloadAction) Name() string { return overloadActionNames[a] } +var enumPagingProbabilityInformation = per.Enum[PagingProbabilityInformation]{ + Root: []string{"p00", "p05", "p10", "p15", "p20", "p25", "p30", "p35", "p40", "p45", "p50", "p55", "p60", "p65", "p70", "p75", "p80", "p85", "p90", "p95", "p100"}, + Extensible: true, +} -var concurrentWarningMessageIndNames = map[ConcurrentWarningMessageInd]string{ - ConcurrentWarningMessageIndTrue: "true", +var enumEUTRAPagingeDRXCycle = per.Enum[EUTRAPagingeDRXCycle]{ + Root: []string{"hfhalf", "hf1", "hf2", "hf4", "hf6", "hf8", "hf10", "hf12", "hf14", "hf16", "hf32", "hf64", "hf128", "hf256"}, + Extensible: true, } -func (c ConcurrentWarningMessageInd) Name() string { return concurrentWarningMessageIndNames[c] } +var enumEUTRAPagingTimeWindow = per.Enum[EUTRAPagingTimeWindow]{ + Root: []string{"s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s16"}, + Extensible: true, +} -var cancelAllWarningMessagesNames = map[CancelAllWarningMessages]string{ - CancelAllWarningMessagesTrue: "true", +var enumNRPagingeDRXCycle = per.Enum[NRPagingeDRXCycle]{ + Root: []string{"hfquarter", "hfhalf", "hf1", "hf2", "hf4", "hf8", "hf16", "hf32", "hf64", "hf128", "hf256", "hf512", "hf1024"}, + Extensible: true, } -func (c CancelAllWarningMessages) Name() string { return cancelAllWarningMessagesNames[c] } +var enumNRPagingTimeWindow = per.Enum[NRPagingTimeWindow]{ + Root: []string{"s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s16"}, + Extension: []string{"s17", "s18", "s19", "s20", "s21", "s22", "s23", "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", "s32"}, +} -var guamiTypeNames = map[GUAMIType]string{ - GUAMITypeNative: "native", - GUAMITypeMapped: "mapped", +var enumExpectedHOInterval = per.Enum[ExpectedHOInterval]{ + Root: []string{"sec15", "sec30", "sec60", "sec90", "sec120", "sec180", "long-time"}, + Extensible: true, } -func (g GUAMIType) Name() string { return guamiTypeNames[g] } +var enumExpectedUEMobility = per.Enum[ExpectedUEMobility]{ + Root: []string{"stationary", "mobile"}, + Extensible: true, +} -var tnlAssociationUsageNames = map[TNLAssociationUsage]string{ - TNLAssociationUsageUE: "ue", - TNLAssociationUsageNonUE: "non-ue", - TNLAssociationUsageBoth: "both", +var enumA2XPC5QoSFlowItemA2XRange = per.Enum[A2XPC5QoSFlowItemA2XRange]{ + Root: []string{"m50", "m80", "m180", "m200", "m350", "m400", "m500", "m700", "m1000"}, + Extensible: true, } -func (u TNLAssociationUsage) Name() string { return tnlAssociationUsageNames[u] } +var enumNextPagingAreaScope = per.Enum[NextPagingAreaScope]{ + Root: []string{"same", "changed"}, + Extensible: true, +} -var dlForwardingNames = map[DLForwarding]string{ - DLForwardingProposed: "dl-forwarding-proposed", +var enumMBSAssistanceInformation = per.Enum[MBSAssistanceInformation]{ + Root: []string{"true"}, + Extensible: true, } -func (d DLForwarding) Name() string { return dlForwardingNames[d] } +var enumRangeType = per.Enum[RangeType]{ + Root: []string{"m50", "m80", "m180", "m200", "m350", "m400", "m500", "m700", "m1000"}, + Extensible: true, +} -var cellSizeNames = map[CellSize]string{ - CellSizeVerySmall: "verysmall", - CellSizeSmall: "small", - CellSizeMedium: "medium", - CellSizeLarge: "large", +var enumClockQualityAcceptanceCriteriaTraceabletoUTC = per.Enum[ClockQualityAcceptanceCriteriaTraceabletoUTC]{ + Root: []string{"true"}, + Extensible: true, } -func (c CellSize) Name() string { return cellSizeNames[c] } +var enumClockQualityAcceptanceCriteriaTraceabletoGNSS = per.Enum[ClockQualityAcceptanceCriteriaTraceabletoGNSS]{ + Root: []string{"true"}, + Extensible: true, +} -var qosFlowMappingIndicationNames = map[QosFlowMappingIndication]string{ - QosFlowMappingUL: "ul", - QosFlowMappingDL: "dl", +var enumIntersystemUnnecessaryHOEarlyIRATHO = per.Enum[IntersystemUnnecessaryHOEarlyIRATHO]{ + Root: []string{"true", "false"}, + Extensible: true, } -func (q QosFlowMappingIndication) Name() string { return qosFlowMappingIndicationNames[q] } +var enumNotificationCellItemNotifyFlag = per.Enum[NotificationCellItemNotifyFlag]{ + Root: []string{"activated", "deactivated"}, + Extensible: true, +} -var userPlaneFailureTypeNames = map[UserPlaneFailureType]string{ - UserPlaneFailureTypeGTPUErrorIndicationReceived: "gtp-u-error-indication-received", - UserPlaneFailureTypeUPPathFailure: "up-path-failure", +var enumNumberOfMeasurementReportingLevels = per.Enum[NumberOfMeasurementReportingLevels]{ + Root: []string{"n2", "n3", "n4", "n5", "n10"}, + Extension: []string{"n0"}, } -func (u UserPlaneFailureType) Name() string { return userPlaneFailureTypeNames[u] } +var enumReportingPeriodicity = per.Enum[ReportingPeriodicity]{ + Root: []string{"stop", "single", "ms1000", "ms2000", "ms5000", "ms10000"}, + Extensible: true, +} diff --git a/ngap/enum_names_test.go b/ngap/enum_names_test.go index 0d49cd7512..ab3f90d025 100644 --- a/ngap/enum_names_test.go +++ b/ngap/enum_names_test.go @@ -18,66 +18,66 @@ func TestEnumNames(t *testing.T) { {"Criticality(9)", Criticality(9).Name(), ""}, {"TriggeringInitiatingMessage", TriggeringInitiatingMessage.Name(), "initiating-message"}, - {"TriggeringMessage(9)", TriggeringMessage(9).Name(), ""}, + {"TriggeringMessage(9)", TriggeringMessage(9).Name(), "unknown(9)"}, {"TypeOfErrorMissing", TypeOfErrorMissing.Name(), "missing"}, - {"TypeOfError(9)", TypeOfError(9).Name(), ""}, + {"TypeOfError(9)", TypeOfError(9).Name(), "unknown(9)"}, - {"CauseGroupRadioNetwork", CauseGroupRadioNetwork.Name(), "radioNetwork"}, - {"CauseGroup(9)", CauseGroup(9).Name(), ""}, + {"CauseRadioNetworkRedirection", CauseRadioNetworkRedirection.Name(), "redirection"}, + {"CauseMisc(9)", CauseMisc(9).Name(), "unknown(9)"}, {"PagingDRXv128", PagingDRXv128.Name(), "v128"}, - {"PagingDRX(9)", PagingDRX(9).Name(), ""}, + {"PagingDRX(9)", PagingDRX(9).Name(), "unknown(9)"}, {"TimeToWaitV60s", TimeToWaitV60s.Name(), "v60s"}, - {"TimeToWait(9)", TimeToWait(9).Name(), ""}, + {"TimeToWait(9)", TimeToWait(9).Name(), "unknown(9)"}, {"RRCCauseMOSignalling", RRCCauseMOSignalling.Name(), "mo-Signalling"}, {"RRCCauseMCSPriorityAccess", RRCCauseMCSPriorityAccess.Name(), "mcs-PriorityAccess"}, - {"RRCEstablishmentCause(99)", RRCEstablishmentCause(99).Name(), ""}, + {"RRCEstablishmentCause(99)", RRCEstablishmentCause(99).Name(), "unknown(99)"}, {"UEContextRequested", UEContextRequested.Name(), "requested"}, - {"UEContextRequest(9)", UEContextRequest(9).Name(), ""}, + {"UEContextRequest(9)", UEContextRequest(9).Name(), "unknown(9)"}, {"UserPlaneFailureTypeGTPUErrorIndicationReceived", UserPlaneFailureTypeGTPUErrorIndicationReceived.Name(), "gtp-u-error-indication-received"}, {"UserPlaneFailureTypeUPPathFailure", UserPlaneFailureTypeUPPathFailure.Name(), "up-path-failure"}, - {"UserPlaneFailureType(9)", UserPlaneFailureType(9).Name(), ""}, + {"UserPlaneFailureType(9)", UserPlaneFailureType(9).Name(), "unknown(9)"}, {"GUAMITypeNative", GUAMITypeNative.Name(), "native"}, {"GUAMITypeMapped", GUAMITypeMapped.Name(), "mapped"}, - {"GUAMIType(9)", GUAMIType(9).Name(), ""}, + {"GUAMIType(9)", GUAMIType(9).Name(), "unknown(9)"}, {"TNLAssociationUsageUE", TNLAssociationUsageUE.Name(), "ue"}, {"TNLAssociationUsageNonUE", TNLAssociationUsageNonUE.Name(), "non-ue"}, {"TNLAssociationUsageBoth", TNLAssociationUsageBoth.Name(), "both"}, {"OverloadActionRejectRRCCRSignalling", OverloadActionRejectRRCCRSignalling.Name(), "reject-rrc-cr-signalling"}, - {"OverloadAction(9)", OverloadAction(9).Name(), ""}, + {"OverloadAction(9)", OverloadAction(9).Name(), "unknown(9)"}, {"ConcurrentWarningMessageIndTrue", ConcurrentWarningMessageIndTrue.Name(), "true"}, {"CancelAllWarningMessagesTrue", CancelAllWarningMessagesTrue.Name(), "true"}, - {"CancelAllWarningMessages(9)", CancelAllWarningMessages(9).Name(), ""}, + {"CancelAllWarningMessages(9)", CancelAllWarningMessages(9).Name(), "unknown(9)"}, {"UERetentionUesRetained", UERetentionUesRetained.Name(), "ues-retained"}, - {"UERetentionInformation(9)", UERetentionInformation(9).Name(), ""}, + {"UERetentionInformation(9)", UERetentionInformation(9).Name(), "unknown(9)"}, {"PagingOriginNon3GPP", PagingOriginNon3GPP.Name(), "non-3gpp"}, - {"PagingOrigin(9)", PagingOrigin(9).Name(), ""}, + {"PagingOrigin(9)", PagingOrigin(9).Name(), "unknown(9)"}, {"DLForwardingProposed", DLForwardingProposed.Name(), "dl-forwarding-proposed"}, - {"DLForwarding(9)", DLForwarding(9).Name(), ""}, + {"DLForwarding(9)", DLForwarding(9).Name(), "unknown(9)"}, {"CellSizeVerySmall", CellSizeVerySmall.Name(), "verysmall"}, {"CellSizeLarge", CellSizeLarge.Name(), "large"}, - {"CellSize(9)", CellSize(9).Name(), ""}, + {"CellSize(9)", CellSize(9).Name(), "unknown(9)"}, {"QosFlowMappingUL", QosFlowMappingUL.Name(), "ul"}, {"QosFlowMappingDL", QosFlowMappingDL.Name(), "dl"}, - {"QosFlowMappingIndication(9)", QosFlowMappingIndication(9).Name(), ""}, + {"QosFlowMappingIndication(9)", QosFlowMappingIndication(9).Name(), "unknown(9)"}, {"PagingPriorityLevel8", PagingPriorityLevel8.Name(), "priolevel8"}, - {"PagingPriority(99)", PagingPriority(99).Name(), ""}, + {"PagingPriority(99)", PagingPriority(99).Name(), "unknown(99)"}, {"PDUSessionTypeIPv4v6", PDUSessionTypeIPv4v6.Name(), "ipv4v6"}, - {"PDUSessionType(9)", PDUSessionType(9).Name(), ""}, + {"PDUSessionType(9)", PDUSessionType(9).Name(), "unknown(9)"}, } { if tc.got != tc.want { t.Errorf("%s.Name() = %q, want %q", tc.what, tc.got, tc.want) diff --git a/ngap/equal_test.go b/ngap/equal_test.go new file mode 100644 index 0000000000..43705bda9a --- /dev/null +++ b/ngap/equal_test.go @@ -0,0 +1,125 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "go/ast" + "go/parser" + "go/token" + "os" + "reflect" + "slices" + "strings" + "testing" +) + +func equalByMethod(got, want any) bool { + g, w := reflect.ValueOf(got), reflect.ValueOf(want) + if g.Type() != w.Type() { + return false + } + + if g.Kind() == reflect.Pointer { + if g.IsNil() || w.IsNil() { + return g.IsNil() == w.IsNil() + } + + g, w = g.Elem(), w.Elem() + } + + eq := g.MethodByName("Equal") + if !eq.IsValid() { + panic(g.Type().String() + " has no Equal method") + } + + return eq.Call([]reflect.Value{w})[0].Bool() +} + +var typesWithoutEqual = []string{"AbstractSyntaxError", "Diagnostics", "RawPDU"} + +func TestEveryModelTypeHasEqual(t *testing.T) { + fset := token.NewFileSet() + + entries, err := os.ReadDir(".") + if err != nil { + t.Fatal(err) + } + + var files []*ast.File + + for _, e := range entries { + if !strings.HasSuffix(e.Name(), ".go") || strings.HasSuffix(e.Name(), "_test.go") { + continue + } + + f, err := parser.ParseFile(fset, e.Name(), nil, parser.SkipObjectResolution) + if err != nil { + t.Fatal(err) + } + + files = append(files, f) + } + + structs := map[string]bool{} + lists := map[string]string{} + equal := map[string]bool{} + + for _, f := range files { + for _, decl := range f.Decls { + switch d := decl.(type) { + case *ast.GenDecl: + for _, spec := range d.Specs { + ts, ok := spec.(*ast.TypeSpec) + if !ok || ts.Assign.IsValid() || !ts.Name.IsExported() { + continue + } + + switch typ := ts.Type.(type) { + case *ast.StructType: + structs[ts.Name.Name] = true + case *ast.ArrayType: + if elem, ok := typ.Elt.(*ast.Ident); ok && typ.Len == nil { + lists[ts.Name.Name] = elem.Name + } + } + } + case *ast.FuncDecl: + if d.Recv == nil || d.Name.Name != "Equal" || len(d.Type.Params.List) != 1 || d.Type.Results == nil || len(d.Type.Results.List) != 1 { + continue + } + + recv := d.Recv.List[0].Type + if star, ok := recv.(*ast.StarExpr); ok { + recv = star.X + } + + name, ok := recv.(*ast.Ident) + param, pok := d.Type.Params.List[0].Type.(*ast.Ident) + res, rok := d.Type.Results.List[0].Type.(*ast.Ident) + + if ok && pok && rok && param.Name == name.Name && res.Name == "bool" { + equal[name.Name] = true + } + } + } + } + + for name := range structs { + if !equal[name] && !slices.Contains(typesWithoutEqual, name) { + t.Errorf("%s has no Equal(%s) bool: run go generate", name, name) + } + } + + for name, elem := range lists { + if structs[elem] && !equal[name] { + t.Errorf("SEQUENCE OF %s (%s) has no Equal(%s) bool: run go generate", elem, name, name) + } + } + + for _, name := range typesWithoutEqual { + if !structs[name] { + t.Errorf("%s is allowlisted but is not an exported struct type of this package", name) + } + } +} diff --git a/ngap/error_indication.go b/ngap/error_indication.go index 90b6216b97..f665fe722b 100644 --- a/ngap/error_indication.go +++ b/ngap/error_indication.go @@ -22,11 +22,11 @@ type ErrorIndication struct { var errorIndicationIEs = []ieSpec[ErrorIndication]{ { - id: IDAMFUENGAPID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("ngap: ErrorIndication AMF-UE-NGAP-ID: %w", err) } @@ -34,7 +34,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -43,11 +43,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDRANUENGAPID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("ngap: ErrorIndication RAN-UE-NGAP-ID: %w", err) } @@ -55,7 +55,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -64,11 +64,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDCause, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("ngap: ErrorIndication Cause: %w", err) } @@ -76,7 +76,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -85,11 +85,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("ngap: ErrorIndication CriticalityDiagnostics: %w", err) } @@ -97,7 +97,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -106,11 +106,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDFiveGSTMSI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDFiveGSTMSI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v FiveGSTMSI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("ngap: ErrorIndication FiveG-S-TMSI: %w", err) } @@ -118,7 +118,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.FiveGSTMSI == nil { return nil, false } @@ -157,3 +157,7 @@ func (m *ErrorIndication) Marshal() ([]byte, error) { func ParseErrorIndication(value []byte) (*ErrorIndication, error) { return parseMessageBody[ErrorIndication](ProcErrorIndication, TriggeringInitiatingMessage, errorIndicationIEs, value) } + +func DecodeErrorIndication(value []byte) (*ErrorIndication, error) { + return decodeMessageBody[ErrorIndication](ProcErrorIndication, errorIndicationIEs, value) +} diff --git a/ngap/error_indication_test.go b/ngap/error_indication_test.go index 1ee960255f..0145e2a9ee 100644 --- a/ngap/error_indication_test.go +++ b/ngap/error_indication_test.go @@ -21,7 +21,7 @@ func goldErrorIndication() *ErrorIndication { // The maximum AMF-UE-NGAP-ID exercises the 40-bit width end to end. AMFUENGAPID: Ptr(AMFUENGAPID(1099511627775)), RANUENGAPID: Ptr(RANUENGAPID(9)), - Cause: Ptr(Cause{Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject}), + Cause: Ptr(CauseProtocolAbstractSyntaxErrorReject.Cause()), } } @@ -92,7 +92,7 @@ func TestErrorIndicationGoldenDecode(t *testing.T) { t.Errorf("UE ids = %v/%v", msg.AMFUENGAPID, msg.RANUENGAPID) } - if deref(msg.Cause) != deref(want.Cause) { + if !deref(msg.Cause).Equal(deref(want.Cause)) { t.Errorf("cause = %v, want %v", deref(msg.Cause), deref(want.Cause)) } diff --git a/ngap/errors.go b/ngap/errors.go index daa005203a..252c0a796a 100644 --- a/ngap/errors.go +++ b/ngap/errors.go @@ -4,23 +4,15 @@ package ngap import ( - "errors" "fmt" "strings" + + "github.com/ellanetworks/core/per/ap" ) // Octets that are not a decodable PER encoding; nothing of the message is // recoverable (TS 38.413 §10.2). -type TransferSyntaxError struct { - Procedure ProcedureCode - Err error -} - -func (e *TransferSyntaxError) Error() string { - return fmt.Sprintf("ngap: %s: transfer syntax error: %v", e.Procedure, e.Err) -} - -func (e *TransferSyntaxError) Unwrap() error { return e.Err } +type TransferSyntaxError = ap.TransferSyntaxError[ProcedureCode] // A message that decoded but whose procedure must be rejected: a missing // reject-criticality IE (TS 38.413 §10.3.5), an unhandled reject-criticality IE @@ -126,115 +118,18 @@ func (e *AbstractSyntaxError) UEIDs() (*AMFUENGAPID, *RANUENGAPID) { return amfID, ranID } -// The abstract syntax errors that did not prevent delivery: IEs absent, or not -// comprehended, with ignore or notify criticality (TS 38.413 §10.3.5, -// §10.3.4.2). -// -// No IE in these tables carries notify criticality, so the notify paths below -// never fire today; they implement the protocol's rule, not this table's. type Diagnostics struct { - IEs []DiagnosticIE - - // Truncated reports that recording stopped at maxDiagnosticIEs. - Truncated bool - - // Set even where Truncated dropped the entry, so a report is never starved - // by ignore entries. - notify bool -} - -// A decode failure TS 38.413 §10.3.1 classifies as a not-comprehended IE (cases -// 1, 2 and 6), handled on criticality rather than by abandoning the message. -var errNotComprehended = errors.New("ngap: IE not comprehended") - -// §10.3.2 treats a not-comprehended item on its own criticality. For an -// unmodeled extension that item is the extension, not the IE containing it, so -// a reject extension rejects the procedure even inside an ignore IE. Decoders -// whose item is the containing IE return the bare sentinel instead. -type notComprehendedIE struct { - ID ProtocolIEID - Crit Criticality - What string + ap.Diagnostics[ProtocolIEID] } -func (e *notComprehendedIE) Error() string { - return fmt.Sprintf("%s: %s %s (criticality %s)", errNotComprehended, e.What, e.ID, e.Crit) -} - -func (e *notComprehendedIE) Unwrap() error { return errNotComprehended } - -type DiagnosticIE struct { - ID ProtocolIEID - Criticality Criticality - TypeOfError TypeOfError -} - -func (d Diagnostics) Empty() bool { return len(d.IEs) == 0 } - -// Only notify criticality obliges the receiver to tell the sender -// (§10.3.4.2, §10.3.5). -func (d Diagnostics) ReportRequired() bool { return d.notify } +type DiagnosticIE = ap.Diagnostic[ProtocolIEID] // §9.3.1.3 forbids reporting an IE Criticality of "ignore". func (d Diagnostics) Report() []CriticalityDiagnosticsIEItem { - out := make([]CriticalityDiagnosticsIEItem, 0, len(d.IEs)) - - for _, ie := range d.IEs { - if ie.Criticality != CriticalityNotify { - continue - } - - out = append(out, CriticalityDiagnosticsIEItem{ - IECriticality: ie.Criticality, - IEID: ie.ID, - TypeOfError: ie.TypeOfError, - }) - } - - if len(out) == 0 { - return nil - } - - return out -} - -func (d *Diagnostics) record(id ProtocolIEID, crit Criticality, kind TypeOfError) { - entry := DiagnosticIE{ID: id, Criticality: crit, TypeOfError: kind} - - if crit == CriticalityNotify { - d.notify = true - } - - if len(d.IEs) < maxDiagnosticIEs { - d.IEs = append(d.IEs, entry) - - return - } - - d.Truncated = true - - // §10.3.4.2 wants an entry per reported IE, so a notify entry displaces a - // silent one rather than being dropped behind the bound. - if crit != CriticalityNotify { - return - } - - for i, ie := range d.IEs { - if ie.Criticality != CriticalityNotify { - d.IEs[i] = entry - - return - } - } + return criticalityDiagnosticsItems(d.Notify()) } -func (t TypeOfError) String() string { - if name, ok := typeOfErrorNames[t]; ok { - return name - } - - return fmt.Sprintf("TypeOfError(%d)", uint8(t)) -} +func (t TypeOfError) String() string { return t.Name() } // PathSwitchSessions returns the sessions a rejected PATH SWITCH REQUEST asked // to switch. §9.2.3.10 makes the released list mandatory in PATH SWITCH REQUEST diff --git a/ngap/extension_criticality_test.go b/ngap/extension_criticality_test.go index 2095e9161a..8e4aa2ca8c 100644 --- a/ngap/extension_criticality_test.go +++ b/ngap/extension_criticality_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // A real extension id TAI does not model: TAI-ExtIEs is empty (TS 38.413 @@ -63,8 +64,8 @@ func extendedTAIList(t *testing.T, crit Criticality) []byte { // extension's id rather than the container's. func TestRejectExtensionInsideIgnoreIERejects(t *testing.T) { _, err := ParsePaging(container(t, - ieField{id: IDUEPagingIdentity, crit: CriticalityIgnore, val: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}}, - ieField{id: IDTAIListForPaging, crit: CriticalityIgnore, raw: extendedTAIList(t, CriticalityReject)}, + ieField{ID: IDUEPagingIdentity, Criticality: CriticalityIgnore, Value: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}}, + ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAIList(t, CriticalityReject))}, )) var ase *AbstractSyntaxError @@ -88,8 +89,8 @@ func TestRejectExtensionInsideIgnoreIERejects(t *testing.T) { // §10.3.4.2: an ignore extension is skipped and its IE still delivered. func TestIgnoreExtensionKeepsItsIE(t *testing.T) { msg, err := ParsePaging(container(t, - ieField{id: IDUEPagingIdentity, crit: CriticalityIgnore, val: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}}, - ieField{id: IDTAIListForPaging, crit: CriticalityIgnore, raw: extendedTAIList(t, CriticalityIgnore)}, + ieField{ID: IDUEPagingIdentity, Criticality: CriticalityIgnore, Value: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}}, + ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAIList(t, CriticalityIgnore))}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -99,7 +100,7 @@ func TestIgnoreExtensionKeepsItsIE(t *testing.T) { t.Fatalf("TAIListForPaging = %+v, thrown away over an extension its own criticality says to ignore", msg.TAIListForPaging) } - if msg.TAIListForPaging[0].TAC != 1 { - t.Errorf("TAI.TAC = %d, want 1", msg.TAIListForPaging[0].TAC) + if msg.TAIListForPaging[0].TAI.TAC != 1 { + t.Errorf("TAI.TAC = %d, want 1", msg.TAIListForPaging[0].TAI.TAC) } } diff --git a/ngap/golden_tshark_test.go b/ngap/golden_tshark_test.go index e1c705bcde..9ce477818f 100644 --- a/ngap/golden_tshark_test.go +++ b/ngap/golden_tshark_test.go @@ -7,12 +7,12 @@ import ( "bytes" "encoding/hex" "os/exec" - "reflect" "strconv" "strings" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) type goldenRoundTrip struct { @@ -39,7 +39,7 @@ func checkGoldenRoundTrip(t *testing.T, c goldenRoundTrip) { t.Fatal(err) } - if !reflect.DeepEqual(out, c.msg) { + if !equalByMethod(out, c.msg) { t.Fatalf("decoded\n got %+v\nwant %+v", out, c.msg) } @@ -82,12 +82,12 @@ func insertRawIEs(t *testing.T, pdu []byte, at int, extra ...ieField) []byte { fields := make([]ieField, 0, len(raw)+len(extra)) for _, f := range raw[:at] { - fields = append(fields, f.field()) + fields = append(fields, f.Encodable()) } fields = append(fields, extra...) for _, f := range raw[at:] { - fields = append(fields, f.field()) + fields = append(fields, f.Encodable()) } value := container(t, fields...) @@ -134,12 +134,8 @@ func checkWireCase(t *testing.T, c wireCase) { } } -func rawMaskedIMEISV() ieField { - return ieField{id: IDMaskedIMEISV, crit: CriticalityIgnore, raw: []byte{0x86, 0x65, 0x07, 0x04, 0x00, 0xff, 0xff, 0x01}} -} - -func rawRedirectionVoiceFallback() ieField { - return ieField{id: IDRedirectionVoiceFallback, crit: CriticalityIgnore, raw: []byte{0x00}} +func rawUnknownIE(id ProtocolIEID, value ...byte) ieField { + return ieField{ID: id, Criticality: CriticalityIgnore, Value: ap.RawValue(value)} } func marshalT(t *testing.T, m interface{ Marshal() ([]byte, error) }) []byte { diff --git a/ngap/handover_cancel.go b/ngap/handover_cancel.go index 1d73385c2c..87da2a8926 100644 --- a/ngap/handover_cancel.go +++ b/ngap/handover_cancel.go @@ -19,25 +19,25 @@ type HandoverCancel struct { var handoverCancelIEs = []ieSpec[HandoverCancel]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCancel, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCancel, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCancel, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCancel, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverCancel, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancel, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -45,7 +45,7 @@ var handoverCancelIEs = []ieSpec[HandoverCancel]{ return nil }, - encode: func(m *HandoverCancel) (per.Marshaler, bool) { + Encode: func(m *HandoverCancel) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -79,6 +79,10 @@ func ParseHandoverCancel(value []byte) (*HandoverCancel, error) { return parseMessageBody[HandoverCancel](ProcHandoverCancel, TriggeringInitiatingMessage, handoverCancelIEs, value) } +func DecodeHandoverCancel(value []byte) (*HandoverCancel, error) { + return decodeMessageBody[HandoverCancel](ProcHandoverCancel, handoverCancelIEs, value) +} + // TS 38.413 §9.2.3.12. TS 36.413 §9.1.5.12 is identical. type HandoverCancelAcknowledge struct { AMFUENGAPID *AMFUENGAPID @@ -90,11 +94,11 @@ type HandoverCancelAcknowledge struct { var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverCancelAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancelAcknowledge, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -102,7 +106,7 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ return nil }, - encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -111,11 +115,11 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverCancelAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancelAcknowledge, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -123,7 +127,7 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ return nil }, - encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -132,11 +136,11 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCancelAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancelAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -144,7 +148,7 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ return nil }, - encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -177,3 +181,7 @@ func (m *HandoverCancelAcknowledge) Marshal() ([]byte, error) { func ParseHandoverCancelAcknowledge(value []byte) (*HandoverCancelAcknowledge, error) { return parseMessageBody[HandoverCancelAcknowledge](ProcHandoverCancel, TriggeringSuccessfulOutcome, handoverCancelAcknowledgeIEs, value) } + +func DecodeHandoverCancelAcknowledge(value []byte) (*HandoverCancelAcknowledge, error) { + return decodeMessageBody[HandoverCancelAcknowledge](ProcHandoverCancel, handoverCancelAcknowledgeIEs, value) +} diff --git a/ngap/handover_cancel_test.go b/ngap/handover_cancel_test.go index 1a77a17ac9..dea52e366f 100644 --- a/ngap/handover_cancel_test.go +++ b/ngap/handover_cancel_test.go @@ -7,6 +7,8 @@ import ( "encoding/hex" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) const ( @@ -15,7 +17,7 @@ const ( ) func TestHandoverCancelGolden(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverCancelled} + cause := CauseRadioNetworkHandoverCancelled.Cause() in := HandoverCancel{AMFUENGAPID: 1, RANUENGAPID: 2, Cause: &cause} @@ -43,7 +45,7 @@ func TestHandoverCancelGolden(t *testing.T) { t.Fatal(err) } - if out.AMFUENGAPID != 1 || out.RANUENGAPID != 2 || out.Cause == nil || *out.Cause != cause { + if out.AMFUENGAPID != 1 || out.RANUENGAPID != 2 || out.Cause == nil || !(*out.Cause).Equal(cause) { t.Fatalf("round trip %+v, want 1/2 and %v", out, cause) } } @@ -90,8 +92,8 @@ func TestHandoverCancelAcknowledgeGolden(t *testing.T) { // continue without it; the AMF still has to see that it was missing. func TestHandoverCancelMissingCause(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) out, err := ParseHandoverCancel(value) @@ -103,15 +105,15 @@ func TestHandoverCancelMissingCause(t *testing.T) { t.Errorf("Cause = %+v, want nil", out.Cause) } - ies := out.meta().diagnostics.IEs - if len(ies) != 1 || ies[0].ID != IDCause || ies[0].TypeOfError != TypeOfErrorMissing { + ies := out.meta().Message.Diagnostics().IEs + if len(ies) != 1 || ies[0].ID != IDCause || typeOfError(ies[0]) != TypeOfErrorMissing { t.Errorf("diagnostics = %+v, want one missing entry for Cause", ies) } } func TestHandoverCancelMissingRANUENGAPID(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, ) _, err := ParseHandoverCancel(value) diff --git a/ngap/handover_notify.go b/ngap/handover_notify.go index f8e0e2aea0..000788d7ad 100644 --- a/ngap/handover_notify.go +++ b/ngap/handover_notify.go @@ -15,25 +15,8 @@ type NotifySourceNGRANNode uint8 const ( NotifySourceNGRANNodeNotifySource NotifySourceNGRANNode = iota - - notifySourceNGRANNodeRootCount = 1 ) -func (n NotifySourceNGRANNode) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, notifySourceNGRANNodeRootCount, int64(n), "NotifySourceNGRANNode") -} - -func (n *NotifySourceNGRANNode) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, notifySourceNGRANNodeRootCount, "NotifySourceNGRANNode") - if err != nil { - return err - } - - *n = NotifySourceNGRANNode(idx) - - return nil -} - // TS 38.413 §9.2.3.7. The target NG-RAN node reports that the UE arrived. // TS 36.413 §9.1.5.7 carries the same report but locates the UE with a separate // EUTRAN-CGI and TAI, where NGAP uses the UserLocationInformation CHOICE. @@ -48,25 +31,25 @@ type HandoverNotify struct { var handoverNotifyIEs = []ieSpec[HandoverNotify]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDUserLocationInformation, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { var v UserLocationInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -74,7 +57,7 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ return nil }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -83,11 +66,11 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ }, }, { - id: IDNotifySourceNGRANNode, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { + ID: IDNotifySourceNGRANNode, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { var v NotifySourceNGRANNode - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -95,7 +78,7 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ return nil }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { if m.NotifySourceNGRANNode == nil { return nil, false } @@ -128,3 +111,7 @@ func (m *HandoverNotify) Marshal() ([]byte, error) { func ParseHandoverNotify(value []byte) (*HandoverNotify, error) { return parseMessageBody[HandoverNotify](ProcHandoverNotification, TriggeringInitiatingMessage, handoverNotifyIEs, value) } + +func DecodeHandoverNotify(value []byte) (*HandoverNotify, error) { + return decodeMessageBody[HandoverNotify](ProcHandoverNotification, handoverNotifyIEs, value) +} diff --git a/ngap/handover_notify_test.go b/ngap/handover_notify_test.go index 3b23c7a1d3..2301922a8a 100644 --- a/ngap/handover_notify_test.go +++ b/ngap/handover_notify_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const ( @@ -21,10 +22,7 @@ const ( func handoverNotifyULI() *UserLocationInformation { plmn := PLMNIdentity{0x02, 0xf8, 0x39} - return &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x000000010, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - } + return &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x000000010)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}} } func TestHandoverNotifyGolden(t *testing.T) { @@ -72,8 +70,8 @@ func TestHandoverNotifyGolden(t *testing.T) { t.Errorf("UE NGAP IDs = %d/%d, want 1/2", out.AMFUENGAPID, out.RANUENGAPID) } - if out.UserLocationInformation == nil || out.UserLocationInformation.Kind != UserLocationNR || - out.UserLocationInformation.CellIdentity != 0x000000010 { + if out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || + out.UserLocationInformation.NR.NRCGI.NRCellIdentity != 0x000000010 { t.Errorf("UserLocationInformation = %+v, want the NR cell", out.UserLocationInformation) } @@ -89,8 +87,8 @@ func TestHandoverNotifyGolden(t *testing.T) { // still has to see that it was missing. func TestHandoverNotifyMissingUserLocation(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) out, err := ParseHandoverNotify(value) @@ -102,8 +100,8 @@ func TestHandoverNotifyMissingUserLocation(t *testing.T) { t.Errorf("UserLocationInformation = %+v, want nil", out.UserLocationInformation) } - ies := out.meta().diagnostics.IEs - if len(ies) != 1 || ies[0].ID != IDUserLocationInformation || ies[0].TypeOfError != TypeOfErrorMissing { + ies := out.meta().Message.Diagnostics().IEs + if len(ies) != 1 || ies[0].ID != IDUserLocationInformation || typeOfError(ies[0]) != TypeOfErrorMissing { t.Errorf("diagnostics = %+v, want one missing entry for UserLocationInformation", ies) } } @@ -111,7 +109,7 @@ func TestHandoverNotifyMissingUserLocation(t *testing.T) { // A missing mandatory reject IE rejects the procedure (§10.3.5). func TestHandoverNotifyMissingAMFUENGAPID(t *testing.T) { value := container(t, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) if _, err := ParseHandoverNotify(value); err == nil { @@ -125,27 +123,26 @@ func TestHandoverNotifyMissingAMFUENGAPID(t *testing.T) { } // NotifySourceNGRANNode has a single root value, so index 1 is the first -// extension and must be refused rather than read as notifySource. +// extension and must be kept as such rather than read as notifySource. func TestNotifySourceNGRANNodeExtensionIsNotComprehended(t *testing.T) { - raw := extensionEnum(t, notifySourceNGRANNodeRootCount, 0) + raw := extensionEnum(t, int64(len(enumNotifySourceNGRANNode.Root)), 0) var v NotifySourceNGRANNode - err := v.UnmarshalPER(per.NewReader(raw), per.Aligned) - if err == nil { - t.Fatal("extension value decoded as notifySource") + if err := v.UnmarshalPER(per.NewReader(raw), per.Aligned); err != nil { + t.Fatalf("decode is lenient, got %v", err) } - if !errors.Is(err, errNotComprehended) { - t.Errorf("err = %v, want errNotComprehended so criticality decides", err) + if v != NotifySourceNGRANNode(len(enumNotifySourceNGRANNode.Root)) || !v.Diagnose(nil) { + t.Fatalf("extension value decoded as %d, want it kept and reported", v) } } // Root counts 1 and 2 both encode index 0 as a zero octet, so no golden // separates them. The value is pinned against the ASN.1 instead. func TestNotifySourceNGRANNodeRootCountMatchesSpec(t *testing.T) { - if notifySourceNGRANNodeRootCount != 1 { + if int64(len(enumNotifySourceNGRANNode.Root)) != 1 { t.Errorf("root count is %d, TS 38.413 defines one member before the extension marker", - notifySourceNGRANNodeRootCount) + int64(len(enumNotifySourceNGRANNode.Root))) } } diff --git a/ngap/handover_preparation.go b/ngap/handover_preparation.go index 430db30f65..dca205c982 100644 --- a/ngap/handover_preparation.go +++ b/ngap/handover_preparation.go @@ -28,32 +28,32 @@ type HandoverRequired struct { var handoverRequiredIEs = []ieSpec[HandoverRequired]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDHandoverType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.HandoverType) + ID: IDHandoverType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.HandoverType) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.HandoverType, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.HandoverType, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -61,7 +61,7 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ return nil }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -70,18 +70,18 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ }, }, { - id: IDTargetID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargetID) + ID: IDTargetID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargetID) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.TargetID, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.TargetID, true }, }, { - id: IDDirectForwardingPathAvailability, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { + ID: IDDirectForwardingPathAvailability, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { var v DirectForwardingPathAvailability - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -89,7 +89,7 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ return nil }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { if m.DirectForwardingPathAvailability == nil { return nil, false } @@ -98,11 +98,11 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ }, }, { - id: IDPDUSessionResourceListHORqd, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceListHORqd) + ID: IDPDUSessionResourceListHORqd, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceListHORqd) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { if m.PDUSessionResourceListHORqd == nil { return nil, false } @@ -111,11 +111,11 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ }, }, { - id: IDSourceToTargetTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SourceToTargetTransparentContainer) + ID: IDSourceToTargetTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SourceToTargetTransparentContainer) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { if m.SourceToTargetTransparentContainer == nil { return nil, false } @@ -149,6 +149,10 @@ func ParseHandoverRequired(value []byte) (*HandoverRequired, error) { return parseMessageBody[HandoverRequired](ProcHandoverPreparation, TriggeringInitiatingMessage, handoverRequiredIEs, value) } +func DecodeHandoverRequired(value []byte) (*HandoverRequired, error) { + return decodeMessageBody[HandoverRequired](ProcHandoverPreparation, handoverRequiredIEs, value) +} + // TS 38.413 §9.2.3.2. The AMF tells the source NG-RAN node that the target has // resources ready. TS 36.413 §9.1.5.2 carries the same shape: the NAS security // parameters, the two per-bearer lists and the target container, differing only @@ -175,33 +179,33 @@ func handoverLeavesFiveGS(m *HandoverCommand) bool { var handoverCommandIEs = []ieSpec[HandoverCommand]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDHandoverType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.HandoverType) + ID: IDHandoverType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.HandoverType) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.HandoverType, true }, + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.HandoverType, true }, }, { - id: IDNASSecurityParametersFromNGRAN, presence: presenceConditional, crit: CriticalityReject, - condition: handoverLeavesFiveGS, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASSecurityParametersFromNGRAN) + ID: IDNASSecurityParametersFromNGRAN, Presence: presenceConditional, Criticality: CriticalityReject, + Condition: handoverLeavesFiveGS, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASSecurityParametersFromNGRAN) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.NASSecurityParametersFromNGRAN == nil { return nil, false } @@ -210,11 +214,11 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ }, }, { - id: IDPDUSessionResourceHandoverList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceHandoverList) + ID: IDPDUSessionResourceHandoverList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceHandoverList) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.PDUSessionResourceHandoverList == nil { return nil, false } @@ -223,11 +227,11 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ }, }, { - id: IDPDUSessionResourceToReleaseListHOCmd, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceToReleaseList) + ID: IDPDUSessionResourceToReleaseListHOCmd, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceToReleaseList) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.PDUSessionResourceToReleaseList == nil { return nil, false } @@ -236,11 +240,11 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ }, }, { - id: IDTargetToSourceTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargetToSourceTransparentContainer) + ID: IDTargetToSourceTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargetToSourceTransparentContainer) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.TargetToSourceTransparentContainer == nil { return nil, false } @@ -249,11 +253,11 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -261,7 +265,7 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ return nil }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -295,6 +299,10 @@ func ParseHandoverCommand(value []byte) (*HandoverCommand, error) { return parseMessageBody[HandoverCommand](ProcHandoverPreparation, TriggeringSuccessfulOutcome, handoverCommandIEs, value) } +func DecodeHandoverCommand(value []byte) (*HandoverCommand, error) { + return decodeMessageBody[HandoverCommand](ProcHandoverPreparation, handoverCommandIEs, value) +} + // TS 38.413 §9.2.3.3. TS 36.413 §9.1.5.3 carries the same four IEs with the // same criticality and presence. NGAP adds the target's failure container, // which reaches the AMF in HANDOVER FAILURE and which §8.4.1.3 has the AMF pass @@ -311,11 +319,11 @@ type HandoverPreparationFailure struct { var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -323,7 +331,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -332,11 +340,11 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -344,7 +352,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -353,11 +361,11 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -365,7 +373,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -374,11 +382,11 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -386,7 +394,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -395,11 +403,11 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ }, }, { - id: IDTargettoSourceFailureTransparentContainer, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargettoSourceFailureTransparentContainer) + ID: IDTargettoSourceFailureTransparentContainer, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargettoSourceFailureTransparentContainer) }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.TargettoSourceFailureTransparentContainer == nil { return nil, false } @@ -432,3 +440,7 @@ func (m *HandoverPreparationFailure) Marshal() ([]byte, error) { func ParseHandoverPreparationFailure(value []byte) (*HandoverPreparationFailure, error) { return parseMessageBody[HandoverPreparationFailure](ProcHandoverPreparation, TriggeringUnsuccessfulOutcome, handoverPreparationFailureIEs, value) } + +func DecodeHandoverPreparationFailure(value []byte) (*HandoverPreparationFailure, error) { + return decodeMessageBody[HandoverPreparationFailure](ProcHandoverPreparation, handoverPreparationFailureIEs, value) +} diff --git a/ngap/handover_preparation_test.go b/ngap/handover_preparation_test.go index f8cdc08a7f..b0a0e632fd 100644 --- a/ngap/handover_preparation_test.go +++ b/ngap/handover_preparation_test.go @@ -10,13 +10,14 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const goldenHandoverPreparationFailure = "400c0015000003000a40020001005540020002000f400201c0" func TestHandoverPreparationFailureGolden(t *testing.T) { amfID, ranID := AMFUENGAPID(1), RANUENGAPID(2) - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHOFailureInTarget} + cause := CauseRadioNetworkHOFailureInTarget.Cause() in := HandoverPreparationFailure{AMFUENGAPID: &amfID, RANUENGAPID: &ranID, Cause: &cause} @@ -45,7 +46,7 @@ func TestHandoverPreparationFailureGolden(t *testing.T) { } if out.AMFUENGAPID == nil || *out.AMFUENGAPID != 1 || out.RANUENGAPID == nil || *out.RANUENGAPID != 2 || - out.Cause == nil || *out.Cause != cause { + out.Cause == nil || !(*out.Cause).Equal(cause) { t.Fatalf("round trip %+v, want 1/2 and %v", out, cause) } @@ -66,14 +67,14 @@ func TestHandoverPreparationFailureMissingMandatoryIEsAreIgnored(t *testing.T) { t.Errorf("decoded %+v, want every field absent", out) } - ies := out.meta().diagnostics.IEs + ies := out.meta().Message.Diagnostics().IEs if len(ies) != 3 { t.Fatalf("diagnostics = %+v, want three missing entries", ies) } for _, ie := range ies { - if ie.TypeOfError != TypeOfErrorMissing { - t.Errorf("IE %v reported %v, want missing", ie.ID, ie.TypeOfError) + if typeOfError(ie) != TypeOfErrorMissing { + t.Errorf("IE %v reported %v, want missing", ie.ID, typeOfError(ie)) } } } @@ -94,7 +95,7 @@ const goldenHandoverRequired = "000c003d000007000a00020001005500020002001d000100 "69000f0002f839100000010002f839000001003d000500000501000065000302aabb" func TestHandoverRequiredGolden(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio} + cause := CauseRadioNetworkHandoverDesirableForRadio.Cause() plmn := PLMNIdentity{0x02, 0xf8, 0x39} transfer, err := (&HandoverRequiredTransfer{}).Marshal() @@ -107,7 +108,7 @@ func TestHandoverRequiredGolden(t *testing.T) { HandoverType: HandoverTypeIntra5GS, Cause: &cause, TargetID: TargetID{TargetRANNodeID: &TargetRANNodeID{ - GlobalRANNodeID: GlobalRANNodeID{Kind: RANNodeIDGNB, PLMNIdentity: plmn, Value: 1, Bits: 24}, + GlobalRANNodeID: NewGlobalGNBID(plmn, 1, 24), SelectedTAI: TAI{PLMNIdentity: plmn, TAC: 1}, }}, PDUSessionResourceListHORqd: PDUSessionResourceListHORqd{{PDUSessionID: 5, Transfer: transfer}}, @@ -152,7 +153,7 @@ func TestTargetIDTargetENBID(t *testing.T) { in := TargetID{TargeteNBID: &TargeteNBID{ GlobalENBID: GlobalNgENBID{ PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - NgENBID: NgENBID{Kind: NgENBIDMacro, Value: 0x00101}, + NgENBID: NgENBID{MacroNgENBID: Ptr(MacroNgENBID(0x00101))}, }, SelectedEPSTAI: EPSTAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 7}, }} @@ -177,7 +178,7 @@ func TestTargetIDTargetENBID(t *testing.T) { t.Errorf("selected EPS TAC = %d, want 7", out.TargeteNBID.SelectedEPSTAI.TAC) } - if got := out.TargeteNBID.GlobalENBID.NgENBID; got != in.TargeteNBID.GlobalENBID.NgENBID { + if got := out.TargeteNBID.GlobalENBID.NgENBID; !got.Equal(in.TargeteNBID.GlobalENBID.NgENBID) { t.Errorf("ng-eNB id = %+v, want %+v", got, in.TargeteNBID.GlobalENBID.NgENBID) } @@ -193,45 +194,55 @@ func TestTargetIDTargetENBID(t *testing.T) { } } -// choice-Extensions still names a target this AMF cannot reach, and is refused -// rather than misread. -func TestTargetIDRejectsChoiceExtensions(t *testing.T) { - w := per.NewWriter() - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, targetIDAlternatives-1, targetIDChoiceExtensions); err != nil { - t.Fatal(err) - } +func TestTargetIDTypedAndUnknownChoiceExtensions(t *testing.T) { + rnc := TargetID{TargetRNCID: &TargetRNCID{ + LAI: LAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, LAC: LAC{0x12, 0x34}}, + RNCID: 4095, + ExtendedRNCID: Ptr(ExtendedRNCID(4096)), + }} + home := TargetID{TargetHomeENBID: &TargetHomeENBID{ + PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, + HomeENBID: 0xfffffff, + SelectedEPSTAI: EPSTAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 0x0102}, + }} - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(IDTargetID)); err != nil { - t.Fatal(err) - } + for _, in := range []TargetID{rnc, home} { + w := per.NewWriter() + if err := in.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } - if err := per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(CriticalityReject)); err != nil { - t.Fatal(err) - } + out, err := unmarshalPERValue[TargetID](perBytes(w)) + if err != nil { + t.Fatal(err) + } - if err := per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x00}); err != nil { - t.Fatal(err) + if !out.Equal(in) { + t.Errorf("round trip = %+v, want %+v", out, in) + } } - w.AlignToByte() + wire := choiceExtensionValue(t, targetIDAlternatives, targetIDChoiceExtensions, 9999) - var v TargetID + out, err := unmarshalPERValue[TargetID](wire) + if err != nil { + t.Fatal(err) + } - err := v.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned) - if err == nil { - t.Fatal("choice-Extensions decoded") + if out.ChoiceExtension == nil || out.ChoiceExtension.ID != 9999 || out.TargetRNCID != nil { + t.Fatalf("decoded %+v, want the unknown choice-Extensions kept", out) } - if !errors.Is(err, errNotComprehended) { - t.Errorf("err = %v, want errNotComprehended so criticality decides", err) + if d := ap.Diagnose[ProtocolIEID](&out); len(d.IEs) != 1 || d.IEs[0].Criticality != CriticalityReject { + t.Errorf("diagnostics = %+v", d.IEs) } } // TS 38.413 gives HandoverType three root members; TS 36.413 gives its own // HandoverType five, with no shared wire values. func TestHandoverTypeRootCountMatchesSpec(t *testing.T) { - if handoverTypeRootCount != 3 { - t.Errorf("root count is %d, TS 38.413 §9.3.1.22 defines three members before the extension marker", handoverTypeRootCount) + if int64(len(enumHandoverType.Root)) != 3 { + t.Errorf("root count is %d, TS 38.413 §9.3.1.22 defines three members before the extension marker", int64(len(enumHandoverType.Root))) } } @@ -245,7 +256,7 @@ func TestHandoverCommandGolden(t *testing.T) { } refused, err := (&HandoverPreparationUnsuccessfulTransfer{ - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: CauseRadioNetworkHandoverDesirableForRadio.Cause(), }).Marshal() if err != nil { t.Fatal(err) @@ -294,8 +305,7 @@ func TestHandoverCommandGolden(t *testing.T) { t.Fatal(err) } - if unsuccessful.Cause.Group != CauseGroupRadioNetwork || - unsuccessful.Cause.Value != CauseRadioNetworkHandoverDesirableForRadio { + if !unsuccessful.Cause.Equal(CauseRadioNetworkHandoverDesirableForRadio.Cause()) { t.Errorf("nested cause %+v", unsuccessful.Cause) } } @@ -385,9 +395,19 @@ func TestHandoverCommandRejectsNASSecurityParametersWithoutCondition(t *testing. t.Fatalf("err = %v, want an AbstractSyntaxError", err) } - if abstract.Cause.Value != CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage { + if !abstract.Cause.Equal(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage.Cause()) { t.Errorf("cause %v, want falsely-constructed-message", abstract.Cause) } + + decoded, err := DecodeHandoverCommand(pdu.(*SuccessfulOutcome).Value) + if err != nil { + t.Fatalf("Decode: %v", err) + } + + again, err := decoded.Marshal() + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("Marshal(Decode(b)) = %x (%v), want %x", again, err, b) + } } // encodedHandoverTypeIE is the HandoverType IE exactly as a message body @@ -396,7 +416,7 @@ func encodedHandoverTypeIE(t *testing.T, v HandoverType) []byte { t.Helper() w := per.NewWriter() - if err := encodeContainerField(w, per.Aligned, ieField{id: IDHandoverType, crit: CriticalityReject, val: v}); err != nil { + if err := encodeContainerField(w, ieField{ID: IDHandoverType, Criticality: CriticalityReject, Value: v}); err != nil { t.Fatal(err) } diff --git a/ngap/handover_resource_allocation.go b/ngap/handover_resource_allocation.go index b099dab9bc..d8290201e0 100644 --- a/ngap/handover_resource_allocation.go +++ b/ngap/handover_resource_allocation.go @@ -39,34 +39,69 @@ type HandoverRequest struct { // when the list is absent and it cannot determine the serving PLMN otherwise. MobilityRestrictionList *MobilityRestrictionList - GUAMI GUAMI - AMFUENGAPID2 *AMFUENGAPID - TargetRANNodeID *GlobalRANNodeID + GUAMI GUAMI + AMFUENGAPID2 *AMFUENGAPID + TargetRANNodeID *GlobalRANNodeID + CoreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive + MaskedIMEISV *MaskedIMEISV + LocationReportingRequestType *LocationReportingRequestType + RRCInactiveTransitionReportRequest *RRCInactiveTransitionReportRequest + RedirectionVoiceFallback *RedirectionVoiceFallback + CNAssistedRANTuning *CNAssistedRANTuning + SRVCCOperationPossible *SRVCCOperationPossible + IABAuthorized *IABAuthorized + EnhancedCoverageRestriction *EnhancedCoverageRestriction + UEDifferentiationInfo *UEDifferentiationInfo + NRV2XServicesAuthorized *NRV2XServicesAuthorized + LTEV2XServicesAuthorized *LTEV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + LTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + CEmodeBrestricted *CEmodeBrestricted + UEUPCIoTSupport *UEUPCIoTSupport + ManagementBasedMDTPLMNList MDTPLMNList + UERadioCapabilityID *UERadioCapabilityID + ExtendedConnectedTime *ExtendedConnectedTime + TimeSyncAssistanceInfo *TimeSyncAssistanceInfo + UESliceMaximumBitRateList UESliceMaximumBitRateList + FiveGProSeAuthorized *FiveGProSeAuthorized + FiveGProSeUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + FiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + NRA2XServicesAuthorized *NRA2XServicesAuthorized + LTEA2XServicesAuthorized *LTEA2XServicesAuthorized + NRA2XUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + LTEA2XUEPC5AggregateMaximumBitRate *LTEUESidelinkAggregateMaximumBitrate + A2XPC5QoSParameters *A2XPC5QoSParameters + MobileIABAuthorized *MobileIABAuthorized + NoPDUSessionIndication *NoPDUSessionIndication + PartiallyAllowedNSSAI PartiallyAllowedNSSAI + SLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo messageMeta } var handoverRequestIEs = []ieSpec[HandoverRequest]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDHandoverType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.HandoverType) + ID: IDHandoverType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.HandoverType) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.HandoverType, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.HandoverType, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -74,7 +109,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -83,32 +118,35 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDUEAggregateMaximumBitRate, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UEAggregateMaximumBitRate) + ID: IDUEAggregateMaximumBitRate, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UEAggregateMaximumBitRate) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UEAggregateMaximumBitRate, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UEAggregateMaximumBitRate, true }, }, + optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *HandoverRequest) **CoreNetworkAssistanceInformationForInactive { + return &m.CoreNetworkAssistanceInformationForInactive + }), { - id: IDUESecurityCapabilities, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UESecurityCapabilities) + ID: IDUESecurityCapabilities, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UESecurityCapabilities) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UESecurityCapabilities, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UESecurityCapabilities, true }, }, { - id: IDSecurityContext, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SecurityContext) + ID: IDSecurityContext, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SecurityContext) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.SecurityContext, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.SecurityContext, true }, }, { - id: IDNewSecurityContextInd, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDNewSecurityContextInd, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v NewSecurityContextInd - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -116,7 +154,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.NewSecurityContextInd == nil { return nil, false } @@ -125,11 +163,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDNASC, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASC) + ID: IDNASC, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASC) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.NASC == nil { return nil, false } @@ -138,11 +176,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDPDUSessionResourceSetupListHOReq, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceSetupListHOReq) + ID: IDPDUSessionResourceSetupListHOReq, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceSetupListHOReq) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.PDUSessionResourceSetupListHOReq == nil { return nil, false } @@ -151,11 +189,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDAllowedNSSAI, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AllowedNSSAI) + ID: IDAllowedNSSAI, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AllowedNSSAI) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.AllowedNSSAI == nil { return nil, false } @@ -164,11 +202,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDTraceActivation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDTraceActivation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v TraceActivation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -176,7 +214,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.TraceActivation == nil { return nil, false } @@ -184,12 +222,13 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.TraceActivation, true }, }, + optionalExtension(IDMaskedIMEISV, CriticalityIgnore, func(m *HandoverRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), { - id: IDSourceToTargetTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SourceToTargetTransparentContainer) + ID: IDSourceToTargetTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SourceToTargetTransparentContainer) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.SourceToTargetTransparentContainer == nil { return nil, false } @@ -198,11 +237,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDMobilityRestrictionList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDMobilityRestrictionList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v MobilityRestrictionList - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -210,7 +249,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.MobilityRestrictionList == nil { return nil, false } @@ -218,19 +257,64 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.MobilityRestrictionList, true }, }, + optionalExtension(IDLocationReportingRequestType, CriticalityIgnore, func(m *HandoverRequest) **LocationReportingRequestType { return &m.LocationReportingRequestType }), + optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *HandoverRequest) **RRCInactiveTransitionReportRequest { + return &m.RRCInactiveTransitionReportRequest + }), { - id: IDGUAMI, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GUAMI) + ID: IDGUAMI, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GUAMI) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.GUAMI, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.GUAMI, true }, }, + optionalExtension(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *HandoverRequest) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), + optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *HandoverRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *HandoverRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + optionalExtension(IDIABAuthorized, CriticalityReject, func(m *HandoverRequest) **IABAuthorized { return &m.IABAuthorized }), + optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *HandoverRequest) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), + optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *HandoverRequest) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *HandoverRequest) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + optionalExtension(IDUEUPCIoTSupport, CriticalityIgnore, func(m *HandoverRequest) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), + listExtension(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *HandoverRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *HandoverRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *HandoverRequest) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *HandoverRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *HandoverRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), + optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *HandoverRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.FiveGProSeUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), + optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *HandoverRequest) **AerialUEsubscriptionInformation { return &m.AerialUEsubscriptionInformation }), + optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *HandoverRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + optionalExtension(IDNoPDUSessionIndication, CriticalityIgnore, func(m *HandoverRequest) **NoPDUSessionIndication { return &m.NoPDUSessionIndication }), + listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *HandoverRequest) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *HandoverRequest) **SLPositioningRangingServiceInfo { return &m.SLPositioningRangingServiceInfo }), { - id: IDAMFUENGAPID2, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID2, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -238,7 +322,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.AMFUENGAPID2 == nil { return nil, false } @@ -247,11 +331,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDTargetRANNodeID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDTargetRANNodeID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v GlobalRANNodeID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -259,7 +343,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.TargetRANNodeID == nil { return nil, false } @@ -293,6 +377,10 @@ func ParseHandoverRequest(value []byte) (*HandoverRequest, error) { return parseMessageBody[HandoverRequest](ProcHandoverResourceAllocation, TriggeringInitiatingMessage, handoverRequestIEs, value) } +func DecodeHandoverRequest(value []byte) (*HandoverRequest, error) { + return decodeMessageBody[HandoverRequest](ProcHandoverResourceAllocation, handoverRequestIEs, value) +} + // TS 38.413 §9.2.3.5. The target NG-RAN node reports what it admitted. // TS 36.413 §9.1.5.5 carries the same five IEs plus Criticality Diagnostics. type HandoverRequestAcknowledge struct { @@ -302,17 +390,20 @@ type HandoverRequestAcknowledge struct { PDUSessionResourceFailedToSetup PDUSessionResourceFailedToSetupListHOAck TargetToSourceTransparentContainer TargetToSourceTransparentContainer CriticalityDiagnostics *CriticalityDiagnostics + NPNAccessInformation *NPNAccessInformation + RedCapIndication *RedCapIndication + ERedCapIndication *ERedCapIndication messageMeta } var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -320,7 +411,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -329,11 +420,11 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -341,7 +432,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -350,11 +441,11 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDPDUSessionResourceAdmittedList, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceAdmittedList) + ID: IDPDUSessionResourceAdmittedList, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceAdmittedList) }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.PDUSessionResourceAdmittedList == nil { return nil, false } @@ -363,11 +454,11 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDPDUSessionResourceFailedToSetupListHOAck, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceFailedToSetup) + ID: IDPDUSessionResourceFailedToSetupListHOAck, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceFailedToSetup) }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.PDUSessionResourceFailedToSetup == nil { return nil, false } @@ -376,11 +467,11 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDTargetToSourceTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargetToSourceTransparentContainer) + ID: IDTargetToSourceTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargetToSourceTransparentContainer) }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.TargetToSourceTransparentContainer == nil { return nil, false } @@ -389,11 +480,11 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -401,7 +492,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -409,6 +500,9 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return m.CriticalityDiagnostics, true }, }, + optionalExtension(IDNPNAccessInformation, CriticalityReject, func(m *HandoverRequestAcknowledge) **NPNAccessInformation { return &m.NPNAccessInformation }), + optionalExtension(IDRedCapIndication, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **RedCapIndication { return &m.RedCapIndication }), + optionalExtension(IDERedCapIndication, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **ERedCapIndication { return &m.ERedCapIndication }), } func (m *HandoverRequestAcknowledge) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -435,6 +529,10 @@ func ParseHandoverRequestAcknowledge(value []byte) (*HandoverRequestAcknowledge, return parseMessageBody[HandoverRequestAcknowledge](ProcHandoverResourceAllocation, TriggeringSuccessfulOutcome, handoverRequestAcknowledgeIEs, value) } +func DecodeHandoverRequestAcknowledge(value []byte) (*HandoverRequestAcknowledge, error) { + return decodeMessageBody[HandoverRequestAcknowledge](ProcHandoverResourceAllocation, handoverRequestAcknowledgeIEs, value) +} + // TS 38.413 §9.2.3.6. The target NG-RAN node admitted nothing and holds no UE // context. TS 36.413 §9.1.5.6 carries the same three IEs; NGAP adds the failure // container, which has no S1AP counterpart. @@ -449,11 +547,11 @@ type HandoverFailure struct { var handoverFailureIEs = []ieSpec[HandoverFailure]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverFailure, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverFailure, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -461,7 +559,7 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ return nil }, - encode: func(m *HandoverFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverFailure) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -470,11 +568,11 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -482,7 +580,7 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ return nil }, - encode: func(m *HandoverFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -491,11 +589,11 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverFailure, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -503,7 +601,7 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ return nil }, - encode: func(m *HandoverFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -512,11 +610,11 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ }, }, { - id: IDTargettoSourceFailureTransparentContainer, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverFailure, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargettoSourceFailureTransparentContainer) + ID: IDTargettoSourceFailureTransparentContainer, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverFailure, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargettoSourceFailureTransparentContainer) }, - encode: func(m *HandoverFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverFailure) (per.Marshaler, bool) { if m.TargettoSourceFailureTransparentContainer == nil { return nil, false } @@ -549,3 +647,7 @@ func (m *HandoverFailure) Marshal() ([]byte, error) { func ParseHandoverFailure(value []byte) (*HandoverFailure, error) { return parseMessageBody[HandoverFailure](ProcHandoverResourceAllocation, TriggeringUnsuccessfulOutcome, handoverFailureIEs, value) } + +func DecodeHandoverFailure(value []byte) (*HandoverFailure, error) { + return decodeMessageBody[HandoverFailure](ProcHandoverResourceAllocation, handoverFailureIEs, value) +} diff --git a/ngap/handover_resource_allocation_test.go b/ngap/handover_resource_allocation_test.go index 25642c6002..4cad4e3282 100644 --- a/ngap/handover_resource_allocation_test.go +++ b/ngap/handover_resource_allocation_test.go @@ -6,7 +6,6 @@ package ngap import ( "bytes" "encoding/hex" - "reflect" "testing" ) @@ -17,14 +16,14 @@ func handoverSetupTransfer(t *testing.T) TransferContainer { t.Helper() b, err := (&PDUSessionResourceSetupRequestTransfer{ - ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, PDUSessionType: PDUSessionTypeIPv4, QosFlowSetupRequest: QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ - QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}}, + QosCharacteristics: QosCharacteristics{NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}}, AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, }, }}, @@ -46,9 +45,9 @@ func goldHandoverRequest(t *testing.T) *HandoverRequest { return &HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, - UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)}, SecurityContext: SecurityContext{NextHopChainingCount: 1}, PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: handoverSetupTransfer(t), @@ -67,7 +66,7 @@ func handoverRequestWireCases(t *testing.T) []wireCase { return []wireCase{{ name: "HandoverRequestAMFUENGAPID2AfterUnmodeledIE", - pdu: insertRawIEs(t, marshalT(t, m), 10, rawRedirectionVoiceFallback()), + pdu: insertRawIEs(t, marshalT(t, m), 10, rawUnknownIE(40001, 0x00)), parse: func(v []byte) (any, error) { return ParseHandoverRequest(v) }, notTshark: "the Source to Target Transparent Container is opaque test octets that tshark dissects as NR RRC", @@ -85,9 +84,9 @@ func handoverRequestWireCases(t *testing.T) []wireCase { func TestHandoverRequestGolden(t *testing.T) { in := HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, - UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)}, SecurityContext: SecurityContext{NextHopChainingCount: 1}, PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: handoverSetupTransfer(t), @@ -138,8 +137,8 @@ const goldenHandoverRequestAcknowledge = "200d0035000005000a40020001005540020002 func TestHandoverRequestAcknowledgeGolden(t *testing.T) { admitted, err := (&HandoverRequestAcknowledgeTransfer{ - DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 2}, GTPTEID: 2, + DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 2), GTPTEID: 2, }}, QosFlowSetupResponse: QosFlowListWithDataForwarding{{QosFlowIdentifier: 1}}, }).Marshal() @@ -148,7 +147,7 @@ func TestHandoverRequestAcknowledgeGolden(t *testing.T) { } refused, err := (&HandoverResourceAllocationUnsuccessfulTransfer{ - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHOFailureInTarget}, + Cause: CauseRadioNetworkHOFailureInTarget.Cause(), }).Marshal() if err != nil { t.Fatal(err) @@ -198,7 +197,7 @@ func TestHandoverRequestAcknowledgeGolden(t *testing.T) { t.Fatal(err) } - if unsuccessful.Cause.Group != CauseGroupRadioNetwork || unsuccessful.Cause.Value != CauseRadioNetworkHOFailureInTarget { + if !unsuccessful.Cause.Equal(CauseRadioNetworkHOFailureInTarget.Cause()) { t.Errorf("nested cause %+v", unsuccessful.Cause) } } @@ -210,7 +209,7 @@ func TestHandoverFailureGolden(t *testing.T) { in := HandoverFailure{ AMFUENGAPID: &amfID, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHOFailureInTarget}, + Cause: Ptr(CauseRadioNetworkHOFailureInTarget.Cause()), TargettoSourceFailureTransparentContainer: TargettoSourceFailureTransparentContainer{0xee, 0xff}, } @@ -239,7 +238,7 @@ func TestHandoverFailureGolden(t *testing.T) { } if out.AMFUENGAPID == nil || *out.AMFUENGAPID != 1 || out.Cause == nil || - out.Cause.Value != CauseRadioNetworkHOFailureInTarget || + !out.Cause.Equal(CauseRadioNetworkHOFailureInTarget.Cause()) || !bytes.Equal(out.TargettoSourceFailureTransparentContainer, []byte{0xee, 0xff}) { t.Fatalf("round trip %+v", out) } @@ -258,14 +257,14 @@ func TestHandoverFailureMissingMandatoryIEsAreIgnored(t *testing.T) { t.Errorf("decoded %+v, want every field absent", out) } - ies := out.meta().diagnostics.IEs + ies := out.meta().Message.Diagnostics().IEs if len(ies) != 2 { t.Fatalf("diagnostics = %+v, want two missing entries", ies) } for _, ie := range ies { - if ie.TypeOfError != TypeOfErrorMissing { - t.Errorf("IE %v reported %v, want missing", ie.ID, ie.TypeOfError) + if typeOfError(ie) != TypeOfErrorMissing { + t.Errorf("IE %v reported %v, want missing", ie.ID, typeOfError(ie)) } } } @@ -276,7 +275,7 @@ func TestHandoverRequestRefusesMissingMandatoryIEs(t *testing.T) { full := func() HandoverRequest { return HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1, UL: 1}, PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: handoverSetupTransfer(t), @@ -320,9 +319,9 @@ func TestHandoverRequestCarriesNASC(t *testing.T) { in := HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeEPSToFiveGS, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, - UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)}, SecurityContext: SecurityContext{NextHopChainingCount: 0}, NewSecurityContextInd: Ptr(NewSecurityContextIndTrue), NASC: nasc, @@ -404,9 +403,9 @@ func TestHandoverRequestCarriesMobilityRestrictionList(t *testing.T) { in := HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, - UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)}, SecurityContext: SecurityContext{NextHopChainingCount: 1}, PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: handoverSetupTransfer(t), @@ -418,7 +417,7 @@ func TestHandoverRequestCarriesMobilityRestrictionList(t *testing.T) { EquivalentPLMNs: EquivalentPLMNs{other}, RATRestrictions: RATRestrictions{{ PLMNIdentity: other, - RATRestrictionInformation: RATRestrictionEUTRA | RATRestrictionNRLEO, + RATRestrictionInformation: RATRestrictionInformationFrom(RATRestrictionEUTRA | RATRestrictionNRLEO), }}, ForbiddenAreaInformation: ForbiddenAreaInformation{{ PLMNIdentity: other, ForbiddenTACs: ForbiddenTACs{0x000007, 0xabcdef}, @@ -450,15 +449,15 @@ func TestHandoverRequestCarriesMobilityRestrictionList(t *testing.T) { t.Fatal("restriction list absent") } - if !reflect.DeepEqual(got, in.MobilityRestrictionList) { + if !got.Equal(*in.MobilityRestrictionList) { t.Fatalf("restriction list = %+v, want %+v", got, in.MobilityRestrictionList) } // The RAT restriction bitmap is a bit string, so its first bit in // transmission order is the most significant octet bit — getting that // backwards would restrict nR-OTHERSAT where e-UTRA was meant. - if want := RATRestrictionInformation(0b1001_0000); got.RATRestrictions[0].RATRestrictionInformation != want { - t.Errorf("RAT restriction = %08b, want %08b", got.RATRestrictions[0].RATRestrictionInformation, want) + if want := RATRestrictionFlags(0b1001_0000); got.RATRestrictions[0].RATRestrictionInformation.Flags != want { + t.Errorf("RAT restriction = %08b, want %08b", got.RATRestrictions[0].RATRestrictionInformation.Flags, want) } // Serving PLMN alone is the minimum §8.4.2.4 turns on, and the optional diff --git a/ngap/handover_transfer.go b/ngap/handover_transfer.go index b339d97f8e..c21a16a755 100644 --- a/ngap/handover_transfer.go +++ b/ngap/handover_transfer.go @@ -18,50 +18,16 @@ type DirectForwardingPathAvailability uint8 const ( DirectForwardingPathAvailable DirectForwardingPathAvailability = iota - - directForwardingPathAvailabilityRootCount = 1 ) -func (d DirectForwardingPathAvailability) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, directForwardingPathAvailabilityRootCount, int64(d), "DirectForwardingPathAvailability") -} - -func (d *DirectForwardingPathAvailability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, directForwardingPathAvailabilityRootCount, "DirectForwardingPathAvailability") - if err != nil { - return err - } - - *d = DirectForwardingPathAvailability(idx) - - return nil -} - // DL-NGU-TNLInformationReused ::= ENUMERATED { true, ... }. Signals that the // NG-RAN node kept the downlink tunnel it already had. type DLNGUTNLInformationReused uint8 const ( DLNGUTNLInformationReusedTrue DLNGUTNLInformationReused = iota - - dlNGUTNLInformationReusedRootCount = 1 ) -func (d DLNGUTNLInformationReused) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, dlNGUTNLInformationReusedRootCount, int64(d), "DL-NGU-TNLInformationReused") -} - -func (d *DLNGUTNLInformationReused) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, dlNGUTNLInformationReusedRootCount, "DL-NGU-TNLInformationReused") - if err != nil { - return err - } - - *d = DLNGUTNLInformationReused(idx) - - return nil -} - // UserPlaneSecurityInformation ::= SEQUENCE { securityResult, // securityIndication, iE-Extensions OPTIONAL } (extensible) — TS 38.413 // §9.3.1.60. Both fields are mandatory: the NG-RAN node reports what it applied @@ -69,7 +35,7 @@ func (d *DLNGUTNLInformationReused) UnmarshalPER(r *per.Reader, enc per.Encoding type UserPlaneSecurityInformation struct { SecurityResult SecurityResult SecurityIndication SecurityIndication - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -80,29 +46,15 @@ type HandoverCommandTransfer struct { DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` QosFlowToBeForwarded QosFlowToBeForwardedList `per:",optional"` DataForwardingResponseDRB DataForwardingResponseDRBList `per:",optional"` - AdditionalDLForwardingUPTNLInformation QosFlowPerTNLInformationList `per:"-"` - ULForwardingUPTNLInformation *UPTransportLayerInformation `per:"-"` - AdditionalULForwardingUPTNLInformation UPTransportLayerInformationList `per:"-"` - DataForwardingResponseERAB DataForwardingResponseERABList `per:"-"` - iEExtensions messageMeta `per:",exttable:handoverCommandTransferExtIEs"` + AdditionalDLForwardingUPTNLInformation QosFlowPerTNLInformationList `per:",extie:IDAdditionalDLForwardingUPTNLInformation,crit:ignore"` + ULForwardingUPTNLInformation *UPTransportLayerInformation `per:",extie:IDULForwardingUPTNLInformation,crit:reject"` + AdditionalULForwardingUPTNLInformation UPTransportLayerInformationList `per:",extie:IDAdditionalULForwardingUPTNLInformation,crit:reject"` + DataForwardingResponseERAB DataForwardingResponseERABList `per:",extie:IDDataForwardingResponseERABList,crit:ignore"` + QosFlowFailedToSetupList QosFlowListWithCause `per:",extie:IDQosFlowFailedToSetupList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -var handoverCommandTransferExtIEs = []ieSpec[HandoverCommandTransfer]{ - listExtension(IDAdditionalDLForwardingUPTNLInformation, CriticalityIgnore, func(m *HandoverCommandTransfer) *QosFlowPerTNLInformationList { - return &m.AdditionalDLForwardingUPTNLInformation - }), - optionalExtension(IDULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverCommandTransfer) **UPTransportLayerInformation { - return &m.ULForwardingUPTNLInformation - }), - listExtension(IDAdditionalULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverCommandTransfer) *UPTransportLayerInformationList { - return &m.AdditionalULForwardingUPTNLInformation - }), - listExtension(IDDataForwardingResponseERABList, CriticalityIgnore, func(m *HandoverCommandTransfer) *DataForwardingResponseERABList { - return &m.DataForwardingResponseERAB - }), -} - // Marshal encodes the transfer for the OCTET STRING that carries it. func (t *HandoverCommandTransfer) Marshal() (TransferContainer, error) { w := per.NewWriter() @@ -119,21 +71,21 @@ func (t *HandoverCommandTransfer) Marshal() (TransferContainer, error) { // ParseHandoverCommandTransfer decodes the transfer the SMF returns naming the // tunnels the source node may forward on. func ParseHandoverCommandTransfer(b TransferContainer) (*HandoverCommandTransfer, error) { - var t HandoverCommandTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[HandoverCommandTransfer](b) +} - return &t, nil +func DecodeHandoverCommandTransfer(b TransferContainer) (*HandoverCommandTransfer, error) { + return decodeTransfer[HandoverCommandTransfer](b) } +func (t *HandoverCommandTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // HandoverPreparationUnsuccessfulTransfer ::= SEQUENCE { cause, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.4.18. type HandoverPreparationUnsuccessfulTransfer struct { - _ [0]struct{} `per:"extseq"` - Cause Cause - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + Cause Cause + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -152,52 +104,39 @@ func (t *HandoverPreparationUnsuccessfulTransfer) Marshal() (TransferContainer, // ParseHandoverPreparationUnsuccessfulTransfer decodes the transfer naming why // a session could not be handed over. func ParseHandoverPreparationUnsuccessfulTransfer(b TransferContainer) (*HandoverPreparationUnsuccessfulTransfer, error) { - var t HandoverPreparationUnsuccessfulTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[HandoverPreparationUnsuccessfulTransfer](b) +} - return &t, nil +func DecodeHandoverPreparationUnsuccessfulTransfer(b TransferContainer) (*HandoverPreparationUnsuccessfulTransfer, error) { + return decodeTransfer[HandoverPreparationUnsuccessfulTransfer](b) } +func (t *HandoverPreparationUnsuccessfulTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // HandoverRequestAcknowledgeTransfer ::= SEQUENCE { dL-NGU-UP-TNLInformation, // dLForwardingUP-TNLInformation OPTIONAL, securityResult OPTIONAL, // qosFlowSetupResponseList, qosFlowFailedToSetupList OPTIONAL, // dataForwardingResponseDRBList OPTIONAL, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.4.11. type HandoverRequestAcknowledgeTransfer struct { - DLNGUUPTNLInformation UPTransportLayerInformation - DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` - SecurityResult *SecurityResult `per:",optional"` - QosFlowSetupResponse QosFlowListWithDataForwarding - QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` - DataForwardingResponseDRB DataForwardingResponseDRBList `per:",optional"` - AdditionalDLUPTNLInformationForHO AdditionalDLUPTNLInformationForHOList `per:"-"` - ULForwardingUPTNLInformation *UPTransportLayerInformation `per:"-"` - AdditionalULForwardingUPTNLInformation UPTransportLayerInformationList `per:"-"` - DataForwardingResponseERAB DataForwardingResponseERABList `per:"-"` - RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - iEExtensions messageMeta `per:",exttable:handoverRequestAcknowledgeTransferExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var handoverRequestAcknowledgeTransferExtIEs = []ieSpec[HandoverRequestAcknowledgeTransfer]{ - listExtension(IDAdditionalDLUPTNLInformationForHOList, CriticalityIgnore, func(m *HandoverRequestAcknowledgeTransfer) *AdditionalDLUPTNLInformationForHOList { - return &m.AdditionalDLUPTNLInformationForHO - }), - optionalExtension(IDULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverRequestAcknowledgeTransfer) **UPTransportLayerInformation { - return &m.ULForwardingUPTNLInformation - }), - listExtension(IDAdditionalULForwardingUPTNLInformation, CriticalityReject, func(m *HandoverRequestAcknowledgeTransfer) *UPTransportLayerInformationList { - return &m.AdditionalULForwardingUPTNLInformation - }), - listExtension(IDDataForwardingResponseERABList, CriticalityIgnore, func(m *HandoverRequestAcknowledgeTransfer) *DataForwardingResponseERABList { - return &m.DataForwardingResponseERAB - }), - optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *HandoverRequestAcknowledgeTransfer) **UPTransportLayerInformation { - return &m.RedundantDLNGUUPTNLInformation - }), + DLNGUUPTNLInformation UPTransportLayerInformation + DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` + SecurityResult *SecurityResult `per:",optional"` + QosFlowSetupResponse QosFlowListWithDataForwarding + QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` + DataForwardingResponseDRB DataForwardingResponseDRBList `per:",optional"` + AdditionalDLUPTNLInformationForHO AdditionalDLUPTNLInformationForHOList `per:",extie:IDAdditionalDLUPTNLInformationForHOList,crit:ignore"` + ULForwardingUPTNLInformation *UPTransportLayerInformation `per:",extie:IDULForwardingUPTNLInformation,crit:reject"` + AdditionalULForwardingUPTNLInformation UPTransportLayerInformationList `per:",extie:IDAdditionalULForwardingUPTNLInformation,crit:reject"` + DataForwardingResponseERAB DataForwardingResponseERABList `per:",extie:IDDataForwardingResponseERABList,crit:ignore"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantDLNGUUPTNLInformation,crit:ignore"` + UsedRSNInformation *RedundantPDUSessionInformation `per:",extie:IDUsedRSNInformation,crit:ignore"` + GlobalRANNodeID *GlobalRANNodeID `per:",extie:IDGlobalRANNodeID,crit:ignore"` + MBSSupportIndicator *MBSSupportIndicator `per:",extie:IDMBSSupportIndicator,crit:ignore"` + PDUSetbasedHandlingIndicator *PDUSetbasedHandlingIndicator `per:",extie:IDPDUSetbasedHandlingIndicator,crit:ignore"` + ECNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus `per:",extie:IDECNMarkingorCongestionInformationReportingStatus,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -216,23 +155,23 @@ func (t *HandoverRequestAcknowledgeTransfer) Marshal() (TransferContainer, error // ParseHandoverRequestAcknowledgeTransfer decodes the transfer the target // NG-RAN node returns for a session it admitted. func ParseHandoverRequestAcknowledgeTransfer(b TransferContainer) (*HandoverRequestAcknowledgeTransfer, error) { - var t HandoverRequestAcknowledgeTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[HandoverRequestAcknowledgeTransfer](b) +} - return &t, nil +func DecodeHandoverRequestAcknowledgeTransfer(b TransferContainer) (*HandoverRequestAcknowledgeTransfer, error) { + return decodeTransfer[HandoverRequestAcknowledgeTransfer](b) } +func (t *HandoverRequestAcknowledgeTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // HandoverResourceAllocationUnsuccessfulTransfer ::= SEQUENCE { cause, // criticalityDiagnostics OPTIONAL, iE-Extensions OPTIONAL } (extensible) — // TS 38.413 §9.3.4.19. type HandoverResourceAllocationUnsuccessfulTransfer struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` Cause Cause CriticalityDiagnostics *CriticalityDiagnostics `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -251,21 +190,23 @@ func (t *HandoverResourceAllocationUnsuccessfulTransfer) Marshal() (TransferCont // ParseHandoverResourceAllocationUnsuccessfulTransfer decodes the transfer the // target NG-RAN node returns for a session it could not admit. func ParseHandoverResourceAllocationUnsuccessfulTransfer(b TransferContainer) (*HandoverResourceAllocationUnsuccessfulTransfer, error) { - var t HandoverResourceAllocationUnsuccessfulTransfer + return parseTransfer[HandoverResourceAllocationUnsuccessfulTransfer](b) +} - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } +func DecodeHandoverResourceAllocationUnsuccessfulTransfer(b TransferContainer) (*HandoverResourceAllocationUnsuccessfulTransfer, error) { + return decodeTransfer[HandoverResourceAllocationUnsuccessfulTransfer](b) +} - return &t, nil +func (t *HandoverResourceAllocationUnsuccessfulTransfer) Diagnostics() Diagnostics { + return diagnosticsOf(t) } // HandoverRequiredTransfer ::= SEQUENCE { directForwardingPathAvailability // OPTIONAL, iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.4.14. type HandoverRequiredTransfer struct { - _ [0]struct{} `per:"extseq"` - DirectForwardingPathAvailability *DirectForwardingPathAvailability `per:"ENUMERATED,range:0..0,...,optional"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + DirectForwardingPathAvailability *DirectForwardingPathAvailability `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -284,45 +225,35 @@ func (t *HandoverRequiredTransfer) Marshal() (TransferContainer, error) { // ParseHandoverRequiredTransfer decodes the transfer the source NG-RAN node // sends per session when it asks for a handover. func ParseHandoverRequiredTransfer(b TransferContainer) (*HandoverRequiredTransfer, error) { - var t HandoverRequiredTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[HandoverRequiredTransfer](b) +} - return &t, nil +func DecodeHandoverRequiredTransfer(b TransferContainer) (*HandoverRequiredTransfer, error) { + return decodeTransfer[HandoverRequiredTransfer](b) } +func (t *HandoverRequiredTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // PathSwitchRequestTransfer ::= SEQUENCE { dL-NGU-UP-TNLInformation, // dL-NGU-TNLInformationReused OPTIONAL, userPlaneSecurityInformation OPTIONAL, // qosFlowAcceptedList, iE-Extensions OPTIONAL } (extensible) — TS 38.413 // §9.3.4.8. type PathSwitchRequestTransfer struct { - DLNGUUPTNLInformation UPTransportLayerInformation - DLNGUTNLInformationReused *DLNGUTNLInformationReused `per:"ENUMERATED,range:0..0,...,optional"` - UserPlaneSecurityInformation *UserPlaneSecurityInformation `per:",optional"` - QosFlowAccepted QosFlowAcceptedList - AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` - RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - RedundantDLNGUTNLInformationReused *DLNGUTNLInformationReused `per:"-"` - AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` - iEExtensions messageMeta `per:",exttable:pathSwitchRequestTransferExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var pathSwitchRequestTransferExtIEs = []ieSpec[PathSwitchRequestTransfer]{ - listExtension(IDAdditionalDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestTransfer) *QosFlowPerTNLInformationList { - return &m.AdditionalDLQosFlowPerTNLInformation - }), - optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestTransfer) **UPTransportLayerInformation { - return &m.RedundantDLNGUUPTNLInformation - }), - optionalExtension(IDRedundantDLNGUTNLInformationReused, CriticalityIgnore, func(m *PathSwitchRequestTransfer) **DLNGUTNLInformationReused { - return &m.RedundantDLNGUTNLInformationReused - }), - listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestTransfer) *QosFlowPerTNLInformationList { - return &m.AdditionalRedundantDLQosFlowPerTNLInformation - }), + DLNGUUPTNLInformation UPTransportLayerInformation + DLNGUTNLInformationReused *DLNGUTNLInformationReused `per:",optional"` + UserPlaneSecurityInformation *UserPlaneSecurityInformation `per:",optional"` + QosFlowAccepted QosFlowAcceptedList + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",extie:IDAdditionalDLQosFlowPerTNLInformation,crit:ignore"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantDLNGUUPTNLInformation,crit:ignore"` + RedundantDLNGUTNLInformationReused *DLNGUTNLInformationReused `per:",extie:IDRedundantDLNGUTNLInformationReused,crit:ignore"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",extie:IDAdditionalRedundantDLQosFlowPerTNLInformation,crit:ignore"` + UsedRSNInformation *RedundantPDUSessionInformation `per:",extie:IDUsedRSNInformation,crit:ignore"` + GlobalRANNodeID *GlobalRANNodeID `per:",extie:IDGlobalRANNodeID,crit:ignore"` + MBSSupportIndicator *MBSSupportIndicator `per:",extie:IDMBSSupportIndicator,crit:ignore"` + PDUSetbasedHandlingIndicator *PDUSetbasedHandlingIndicator `per:",extie:IDPDUSetbasedHandlingIndicator,crit:ignore"` + ECNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus `per:",extie:IDECNMarkingorCongestionInformationReportingStatus,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -341,40 +272,29 @@ func (t *PathSwitchRequestTransfer) Marshal() (TransferContainer, error) { // ParsePathSwitchRequestTransfer decodes the transfer the target NG-RAN node // sends per session when it takes over the downlink tunnel. func ParsePathSwitchRequestTransfer(b TransferContainer) (*PathSwitchRequestTransfer, error) { - var t PathSwitchRequestTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PathSwitchRequestTransfer](b) +} - return &t, nil +func DecodePathSwitchRequestTransfer(b TransferContainer) (*PathSwitchRequestTransfer, error) { + return decodeTransfer[PathSwitchRequestTransfer](b) } +func (t *PathSwitchRequestTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // PathSwitchRequestAcknowledgeTransfer ::= SEQUENCE { uL-NGU-UP-TNLInformation // OPTIONAL, securityIndication OPTIONAL, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.4.9. type PathSwitchRequestAcknowledgeTransfer struct { ULNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` SecurityIndication *SecurityIndication `per:",optional"` - AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` - RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` - iEExtensions messageMeta `per:",exttable:pathSwitchRequestAcknowledgeTransferExtIEs"` + AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:",extie:IDAdditionalNGUUPTNLInformation,crit:ignore"` + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantULNGUUPTNLInformation,crit:ignore"` + AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:",extie:IDAdditionalRedundantNGUUPTNLInformation,crit:ignore"` + QosFlowParametersList QosFlowParametersList `per:",extie:IDQosFlowParametersList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -var pathSwitchRequestAcknowledgeTransferExtIEs = []ieSpec[PathSwitchRequestAcknowledgeTransfer]{ - listExtension(IDAdditionalNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledgeTransfer) *UPTransportLayerInformationPairList { - return &m.AdditionalNGUUPTNLInformation - }), - optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledgeTransfer) **UPTransportLayerInformation { - return &m.RedundantULNGUUPTNLInformation - }), - listExtension(IDAdditionalRedundantNGUUPTNLInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledgeTransfer) *UPTransportLayerInformationPairList { - return &m.AdditionalRedundantNGUUPTNLInformation - }), -} - // Marshal encodes the transfer for the OCTET STRING that carries it. func (t *PathSwitchRequestAcknowledgeTransfer) Marshal() (TransferContainer, error) { w := per.NewWriter() @@ -391,21 +311,21 @@ func (t *PathSwitchRequestAcknowledgeTransfer) Marshal() (TransferContainer, err // ParsePathSwitchRequestAcknowledgeTransfer decodes the transfer the SMF // returns for a session whose path was switched. func ParsePathSwitchRequestAcknowledgeTransfer(b TransferContainer) (*PathSwitchRequestAcknowledgeTransfer, error) { - var t PathSwitchRequestAcknowledgeTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PathSwitchRequestAcknowledgeTransfer](b) +} - return &t, nil +func DecodePathSwitchRequestAcknowledgeTransfer(b TransferContainer) (*PathSwitchRequestAcknowledgeTransfer, error) { + return decodeTransfer[PathSwitchRequestAcknowledgeTransfer](b) } +func (t *PathSwitchRequestAcknowledgeTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // PathSwitchRequestSetupFailedTransfer ::= SEQUENCE { cause, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.4.15. type PathSwitchRequestSetupFailedTransfer struct { - _ [0]struct{} `per:"extseq"` - Cause Cause - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + Cause Cause + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -424,21 +344,21 @@ func (t *PathSwitchRequestSetupFailedTransfer) Marshal() (TransferContainer, err // ParsePathSwitchRequestSetupFailedTransfer decodes the transfer the SMF // returns for a session it could not switch. func ParsePathSwitchRequestSetupFailedTransfer(b TransferContainer) (*PathSwitchRequestSetupFailedTransfer, error) { - var t PathSwitchRequestSetupFailedTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PathSwitchRequestSetupFailedTransfer](b) +} - return &t, nil +func DecodePathSwitchRequestSetupFailedTransfer(b TransferContainer) (*PathSwitchRequestSetupFailedTransfer, error) { + return decodeTransfer[PathSwitchRequestSetupFailedTransfer](b) } +func (t *PathSwitchRequestSetupFailedTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // PathSwitchRequestUnsuccessfulTransfer ::= SEQUENCE { cause, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.4.20. type PathSwitchRequestUnsuccessfulTransfer struct { - _ [0]struct{} `per:"extseq"` - Cause Cause - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + Cause Cause + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -457,11 +377,11 @@ func (t *PathSwitchRequestUnsuccessfulTransfer) Marshal() (TransferContainer, er // ParsePathSwitchRequestUnsuccessfulTransfer decodes the transfer naming why a // session's path could not be switched. func ParsePathSwitchRequestUnsuccessfulTransfer(b TransferContainer) (*PathSwitchRequestUnsuccessfulTransfer, error) { - var t PathSwitchRequestUnsuccessfulTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PathSwitchRequestUnsuccessfulTransfer](b) +} - return &t, nil +func DecodePathSwitchRequestUnsuccessfulTransfer(b TransferContainer) (*PathSwitchRequestUnsuccessfulTransfer, error) { + return decodeTransfer[PathSwitchRequestUnsuccessfulTransfer](b) } + +func (t *PathSwitchRequestUnsuccessfulTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } diff --git a/ngap/handover_transfer_test.go b/ngap/handover_transfer_test.go index 93b1900021..9ced55483d 100644 --- a/ngap/handover_transfer_test.go +++ b/ngap/handover_transfer_test.go @@ -37,12 +37,12 @@ const ( ) func hoTunnel(a byte, teid GTPTEID) UPTransportLayerInformation { - addr := TransportLayerAddress{192, 168, 1, 1} + addr := tlaOf(192, 168, 1, 1) if a != 192 { - addr = TransportLayerAddress{10, 0, 0, 1} + addr = tlaOf(10, 0, 0, 1) } - return UPTransportLayerInformation{GTPTunnel: GTPTunnel{TransportLayerAddress: addr, GTPTEID: teid}} + return UPTransportLayerInformation{GTPTunnel: >PTunnel{TransportLayerAddress: addr, GTPTEID: teid}} } func TestHandoverAndPathSwitchTransferGoldens(t *testing.T) { @@ -131,10 +131,10 @@ func TestPathSwitchRequestSetupFailedTransferGolden(t *testing.T) { cause Cause golden string }{ - {"RadioNetworkUnspecified", Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, goldenPathSwitchRequestSetupFailedRadioNetwork}, - {"NASNormalRelease", Cause{Group: CauseGroupNAS, Value: CauseNASNormalRelease}, goldenPathSwitchRequestSetupFailedNAS}, - {"TransportUnavailable", Cause{Group: CauseGroupTransport, Value: CauseTransportResourceUnavailable}, goldenPathSwitchRequestSetupFailedTransport}, - {"RadioNetworkNGRANGenerated", Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkReleaseDueToNGRANGeneratedReason}, goldenPathSwitchRequestSetupFailedRadioNetwork3}, + {"RadioNetworkUnspecified", CauseRadioNetworkUnspecified.Cause(), goldenPathSwitchRequestSetupFailedRadioNetwork}, + {"NASNormalRelease", CauseNASNormalRelease.Cause(), goldenPathSwitchRequestSetupFailedNAS}, + {"TransportUnavailable", CauseTransportResourceUnavailable.Cause(), goldenPathSwitchRequestSetupFailedTransport}, + {"RadioNetworkNGRANGenerated", CauseRadioNetworkReleaseDueToNGRANGeneratedReason.Cause(), goldenPathSwitchRequestSetupFailedRadioNetwork3}, } { t.Run(c.name, func(t *testing.T) { in := PathSwitchRequestSetupFailedTransfer{Cause: c.cause} @@ -153,7 +153,7 @@ func TestPathSwitchRequestSetupFailedTransferGolden(t *testing.T) { t.Fatal(err) } - if out.Cause != c.cause { + if !out.Cause.Equal(c.cause) { t.Fatalf("round trip %+v, want %+v", out.Cause, c.cause) } }) @@ -179,7 +179,7 @@ func TestHandoverTransfersRoundTrip(t *testing.T) { }}, QosFlowFailedToSetup: QosFlowListWithCause{{ QosFlowIdentifier: 6, - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, + Cause: CauseRadioNetworkUnspecified.Cause(), }}, DataForwardingResponseDRB: DataForwardingResponseDRBList{{ DRBID: 32, DLForwardingUPTNLInformation: &tun, ULForwardingUPTNLInformation: &tun2, @@ -207,11 +207,3 @@ func TestHandoverTransfersRoundTrip(t *testing.T) { t.Fatalf("DRB item = %+v, want DRB-ID 32 with both tunnels", drb) } } - -// DRB-ID is (1..32, ...): zero is below the lower bound. -func TestDRBIDRejectsZero(t *testing.T) { - w := per.NewWriter() - if err := DRBID(0).MarshalPER(w, per.Aligned); err == nil { - t.Fatal("encoded a DRB-ID of 0") - } -} diff --git a/ngap/ie_common.go b/ngap/ie_common.go index 05886a02bc..ee9d5099da 100644 --- a/ngap/ie_common.go +++ b/ngap/ie_common.go @@ -4,10 +4,8 @@ package ngap import ( - "fmt" - "net/netip" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // nameMaxLen bounds AMFName / RANNodeName (PrintableString (SIZE(1..150,...))). @@ -72,7 +70,7 @@ func (n *AMFNameUTF8String) UnmarshalPER(r *per.Reader, enc per.Encoding) error type ExtendedAMFName struct { AMFNameVisibleString *AMFNameVisibleString `per:",optional"` AMFNameUTF8String *AMFNameUTF8String `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -99,53 +97,25 @@ func (t *GTPTEID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { type GTPTunnel struct { TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -// UPTransportLayerInformation CHOICE alternatives. The CHOICE is not -// extensible, so choice-Extensions is a plain alternative index. -const ( - upTransportLayerInformationGTPTunnel = iota - upTransportLayerInformationChoiceExtensions - - upTransportLayerInformationAlternatives = 2 -) - // UPTransportLayerInformation ::= CHOICE { gTPTunnel, choice-Extensions } — // TS 38.413 §9.3.2.2. S1AP carries the user-plane endpoint as a bare // TransportLayerAddress and GTP-TEID pair inside each E-RAB item instead. type UPTransportLayerInformation struct { - GTPTunnel GTPTunnel -} - -func (u UPTransportLayerInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, upTransportLayerInformationAlternatives-1, upTransportLayerInformationGTPTunnel); err != nil { - return err - } - - return u.GTPTunnel.MarshalPER(w, enc) -} - -func (u *UPTransportLayerInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, upTransportLayerInformationAlternatives-1) - if err != nil { - return err - } - - if idx == upTransportLayerInformationChoiceExtensions { - return decodeChoiceExtension(r, enc, "UPTransportLayerInformation") - } - - return u.GTPTunnel.UnmarshalPER(r, enc) + GTPTunnel *GTPTunnel `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` } // UPTransportLayerInformationItem ::= SEQUENCE { nGU-UP-TNLInformation, // iE-Extensions OPTIONAL } (extensible). type UPTransportLayerInformationItem struct { - NGUUPTNLInformation UPTransportLayerInformation - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + NGUUPTNLInformation UPTransportLayerInformation + CommonNetworkInstance *CommonNetworkInstance `per:",extie:IDCommonNetworkInstance,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // UPTransportLayerInformationList ::= SEQUENCE @@ -159,7 +129,7 @@ type UPTransportLayerInformationList []UPTransportLayerInformationItem type UPTransportLayerInformationPairItem struct { ULNGUUPTNLInformation UPTransportLayerInformation DLNGUUPTNLInformation UPTransportLayerInformation - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -175,21 +145,12 @@ type UPTransportLayerInformationPairList []UPTransportLayerInformationPairItem type ULNGUUPTNLModifyItem struct { ULNGUUPTNLInformation UPTransportLayerInformation DLNGUUPTNLInformation UPTransportLayerInformation - RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - iEExtensions messageMeta `per:",exttable:uLNGUUPTNLModifyItemExtIEs"` + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantULNGUUPTNLInformation,crit:ignore"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantDLNGUUPTNLInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -var uLNGUUPTNLModifyItemExtIEs = []ieSpec[ULNGUUPTNLModifyItem]{ - optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *ULNGUUPTNLModifyItem) **UPTransportLayerInformation { - return &m.RedundantULNGUUPTNLInformation - }), - optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *ULNGUUPTNLModifyItem) **UPTransportLayerInformation { - return &m.RedundantDLNGUUPTNLInformation - }), -} - // ULNGUUPTNLModifyList ::= SEQUENCE (SIZE(1..maxnoofMultiConnectivity)) OF // UL-NGU-UP-TNLModifyItem. type ULNGUUPTNLModifyList []ULNGUUPTNLModifyItem @@ -202,16 +163,18 @@ func (d DRBID) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (d *DRBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 1, 32, "DRB-ID") + v, err := decodeExtensibleInt[DRBID](r, enc, 1, 32) if err != nil { return err } - *d = DRBID(v) + *d = v return nil } +func (v DRBID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 1, 32) } + // DataForwardingResponseDRBItem ::= SEQUENCE { dRB-ID, // dLForwardingUP-TNLInformation OPTIONAL, uLForwardingUP-TNLInformation // OPTIONAL, iE-Extensions OPTIONAL } (extensible). @@ -219,7 +182,7 @@ type DataForwardingResponseDRBItem struct { DRBID DRBID DLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` ULForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -230,7 +193,7 @@ type DataForwardingResponseDRBList []DataForwardingResponseDRBItem type DataForwardingResponseERABListItem struct { ERABID ERABID DLForwardingUPTNLInformation UPTransportLayerInformation - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -255,17 +218,11 @@ type AdditionalDLUPTNLInformationForHOItem struct { AdditionalDLNGUUPTNLInformation UPTransportLayerInformation AdditionalQosFlowSetupResponse QosFlowListWithDataForwarding AdditionalDLForwardingUPTNLInformation *UPTransportLayerInformation `per:",optional"` - AdditionalRedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - iEExtensions messageMeta `per:",exttable:additionalDLUPTNLInformationForHOItemExtIEs"` + AdditionalRedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDAdditionalRedundantDLNGUUPTNLInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -var additionalDLUPTNLInformationForHOItemExtIEs = []ieSpec[AdditionalDLUPTNLInformationForHOItem]{ - optionalExtension(IDAdditionalRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *AdditionalDLUPTNLInformationForHOItem) **UPTransportLayerInformation { - return &m.AdditionalRedundantDLNGUUPTNLInformation - }), -} - type AdditionalDLUPTNLInformationForHOList []AdditionalDLUPTNLInformationForHOItem func (l AdditionalDLUPTNLInformationForHOList) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -288,63 +245,33 @@ type UserPlaneFailureType uint8 const ( UserPlaneFailureTypeGTPUErrorIndicationReceived UserPlaneFailureType = iota UserPlaneFailureTypeUPPathFailure - - userPlaneFailureTypeRootCount = 2 ) -func (u UserPlaneFailureType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, userPlaneFailureTypeRootCount, int64(u), "UserPlaneFailureType") -} - -func (u *UserPlaneFailureType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, userPlaneFailureTypeRootCount, "UserPlaneFailureType") - if err != nil { - return err - } - - *u = UserPlaneFailureType(idx) - - return nil -} - type UserPlaneFailureIndication struct { UserPlaneFailureType UserPlaneFailureType ULNGUUPTNLInformation UPTransportLayerInformation DLNGUUPTNLInformation UPTransportLayerInformation - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -// encodeExtensibleInt encodes an INTEGER whose constraint carries an extension -// marker but defines no extension additions: X.691 §13.1 spends one bit, then -// the root value follows. A value outside the root is refused rather than sent -// as an extension, because 3GPP has defined no such addition to send. func encodeExtensibleInt(w *per.Writer, enc per.Encoding, lb, ub, n int64) error { - if n < lb || n > ub { - return fmt.Errorf("value %d outside the extension root %d..%d", n, lb, ub) - } - - w.WriteBit(false) - - return per.EncodeInteger(w, enc, per.Bounds{LB: lb, HasLB: true, UB: ub, HasUB: true}, n) + return per.EncodeInteger(w, enc, per.Bounds{LB: lb, HasLB: true, UB: ub, HasUB: true, Extensible: true}, n) } -// decodeExtensibleInt consumes an extension value before reporting it, so the -// reader is left positioned after the field: X.691 §13.1 sends an out-of-root -// value as an unconstrained integer (§13.2.4-13.2.6), which carries its own -// length determinant and is therefore skippable without knowing the addition. -// Criticality then decides what to do with the enclosing IE (§10.3.1 case 6). -func decodeExtensibleInt(r *per.Reader, enc per.Encoding, lb, ub int64, name string) (int64, error) { +func outsideRoot(v, lb, ub int64) bool { return v < lb || v > ub } + +func decodeExtensibleInt[T per.Integer](r *per.Reader, enc per.Encoding, lb, ub int64) (T, error) { v, err := per.DecodeInteger(r, enc, per.Bounds{LB: lb, HasLB: true, UB: ub, HasUB: true, Extensible: true}) if err != nil { return 0, err } - if v < lb || v > ub { - return 0, fmt.Errorf("%w: %s extension value %d", errNotComprehended, name, v) + if t := T(v); int64(t) == v { + return t, nil } - return v, nil + return 0, per.ErrOverflow } // TransferContainer is an OCTET STRING (CONTAINING XxxTransfer): a nested PER @@ -367,47 +294,7 @@ func (c *TransferContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -// TransportLayerAddress ::= BIT STRING (SIZE(1..160, ...)). Holds the address -// octets (IPv4 = 4, IPv6 = 16). -type TransportLayerAddress []byte - -func (a TransportLayerAddress) MarshalPER(w *per.Writer, enc per.Encoding) error { - return per.EncodeBitString(w, enc, 1, 160, true, true, true, a, len(a)*8) -} - -func (a *TransportLayerAddress) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - b, nbits, err := per.DecodeBitString(r, enc, 1, 160, true, true, true) - if err != nil { - return err - } - - *a = TransportLayerAddress(b[:(nbits+7)/8]) - - return nil -} - -// IPs returns the addresses the bit string carries. TS 38.414 §5.1 packs an -// IPv4 address, an IPv6 address, or both with the IPv4 one first; a return is -// invalid when that address is absent. -func (a TransportLayerAddress) IPs() (ipv4, ipv6 netip.Addr) { - switch len(a) { - case 4: - ipv4, _ = netip.AddrFromSlice(a) - case 16: - ipv6, _ = netip.AddrFromSlice(a) - case 20: - ipv4, _ = netip.AddrFromSlice(a[:4]) - ipv6, _ = netip.AddrFromSlice(a[4:]) - } - - return ipv4, ipv6 -} - -func (a TransportLayerAddress) Valid() bool { - ipv4, ipv6 := a.IPs() - - return ipv4.IsValid() || ipv6.IsValid() -} +type TransportLayerAddress = ap.TransportLayerAddress // Most significant bit first, matching BIT STRING storage. func uintToBits(v uint64, nbits int) []byte { @@ -439,3 +326,53 @@ func bitsToUint(b []byte, nbits int) uint64 { return v } + +const uint64RangeOctets = 8 + +func encodeUint64Range(w *per.Writer, enc per.Encoding, v uint64) error { + if enc == per.Unaligned { + w.WriteBits(v, 64) + + return nil + } + + octets := 1 + for x := v >> 8; x != 0; x >>= 8 { + octets++ + } + + return per.EncodeLength(w, enc, 1, uint64RangeOctets, true, int64(octets), func(int64) error { + w.AlignToByte() + + for i := octets - 1; i >= 0; i-- { + w.WriteBits(v>>(8*i)&0xff, 8) + } + + return nil + }) +} + +func decodeUint64Range(r *per.Reader, enc per.Encoding) (uint64, error) { + if enc == per.Unaligned { + return r.ReadBits(64) + } + + var v uint64 + + err := per.DecodeLength(r, enc, 1, uint64RangeOctets, true, func(count int64) error { + r.AlignToByte() + + for range count { + b, err := r.ReadBits(8) + if err != nil { + return err + } + + v = v<<8 | b + } + + return nil + }) + + return v, err +} diff --git a/ngap/ie_ext_types.go b/ngap/ie_ext_types.go new file mode 100644 index 0000000000..1e87a579d8 --- /dev/null +++ b/ngap/ie_ext_types.go @@ -0,0 +1,6570 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +const ( + maxnoofCAGSperCell = 64 + maxnoofCandidateCells = 32 + maxnoofCellsUEMovingTrajectory = 16 + maxnoofCellsinNGRANNode = 16384 + maxnoofPC5QoSFlows = 2048 + maxnoofRSPPQoSFlows = 2048 + maxnoofRecommendedCells = 16 + maxnoofRecommendedRANNodes = 16 + maxnoofReportedCells = 256 + maxnoofTAIforInactive = 16 + maxnoofTargetSNSSAIs = 8 + maxNRARFCN = 3279165 + maxnoofAllowedCAGsperPLMN = 256 + maxnoofAreaNTN = 8 + maxnoofBluetoothName = 4 + maxnoofCAGforMDT = 256 + maxnoofCandidateRelayUEs = 32 + maxnoofCellIDforMDT = 32 + maxnoofCellIDforQMC = 32 + maxnoofCellsforMBS = 8192 + maxnoofESNPNs = 15 + maxnoofFreqforMDT = 8 + maxnoofIntendedAreasforMBS = 65536 + maxnoofMBSQoSFlows = 64 + maxnoofMBSServiceAreaInformation = 256 + maxnoofMBSSessions = 32 + maxnoofMBSSessionsofUE = 256 + maxnoofMDTPLMNs = 16 + maxnoofMDTSNPNs = 16 + maxnoofMRBs = 32 + maxnoofNGAPIESupportInfo = 32 + maxnoofNRCellBands = 32 + maxnoofNeighPCIforMDT = 32 + maxnoofPLMNforQMC = 16 + maxnoofPSCellsPerPrimaryCellinUEHistoryInfo = 8 + maxnoofPeriodicities = 8 + maxnoofQosParaSets = 8 + maxnoofSNSSAIforQMC = 16 + maxnoofSensorName = 3 + maxnoofSliceItemsforMDT = 1024 + maxnoofTAIforMBS = 1024 + maxnoofTAforMDT = 8 + maxnoofTAforQMC = 8 + maxnoofThresholds = 8 + maxnoofThresholdsForExcessPacketDelay = 255 + maxnoofTimePeriods = 2 + maxnoofUEAppLayerMeas = 16 + maxnoofWLANName = 4 +) + +type RedundantPDUSessionInformation struct { + RSN RSN + PDUSessionPairID *PDUSessionPairID `per:",extie:IDPDUSessionPairID,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSSupportIndicator uint8 + +const ( + MBSSupportIndicatorMulticastSupported MBSSupportIndicator = iota + MBSSupportIndicatorMulticastSupportedWithReceptionInRRCInactive +) + +type PDUSetbasedHandlingIndicator uint8 + +const ( + PDUSetbasedHandlingIndicatorSupported PDUSetbasedHandlingIndicator = iota +) + +type ECNMarkingorCongestionInformationReportingStatus []ECNMarkingorCongestionInformationReportingStatusItem + +func (l ECNMarkingorCongestionInformationReportingStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []ECNMarkingorCongestionInformationReportingStatusItem(l)) +} + +func (l *ECNMarkingorCongestionInformationReportingStatus) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ECNMarkingorCongestionInformationReportingStatusItem](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QosFlowParametersList []QosFlowParametersItem + +func (l QosFlowParametersList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QosFlowParametersItem(l)) +} + +func (l *QosFlowParametersList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QosFlowParametersItem](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type CommonNetworkInstance []byte + +func (v CommonNetworkInstance) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *CommonNetworkInstance) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type ExtendedRATRestrictionInformationPrimaryRATRestriction struct{ BitString } + +func (v ExtendedRATRestrictionInformationPrimaryRATRestriction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 8, 8) +} + +func (v *ExtendedRATRestrictionInformationPrimaryRATRestriction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 8, 8) + if err != nil { + return err + } + + *v = ExtendedRATRestrictionInformationPrimaryRATRestriction{b} + + return nil +} + +type ExtendedRATRestrictionInformationSecondaryRATRestriction struct{ BitString } + +func (v ExtendedRATRestrictionInformationSecondaryRATRestriction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 8, 8) +} + +func (v *ExtendedRATRestrictionInformationSecondaryRATRestriction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 8, 8) + if err != nil { + return err + } + + *v = ExtendedRATRestrictionInformationSecondaryRATRestriction{b} + + return nil +} + +type ExtendedRATRestrictionInformation struct { + PrimaryRATRestriction ExtendedRATRestrictionInformationPrimaryRATRestriction + SecondaryRATRestriction ExtendedRATRestrictionInformationSecondaryRATRestriction + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CNTypeRestrictionsForServing uint8 + +const ( + CNTypeRestrictionsForServingEPCForbidden CNTypeRestrictionsForServing = iota +) + +type CNTypeRestrictionsForEquivalent []CNTypeRestrictionsForEquivalentItem + +func (l CNTypeRestrictionsForEquivalent) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEPLMNs, []CNTypeRestrictionsForEquivalentItem(l)) +} + +func (l *CNTypeRestrictionsForEquivalent) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CNTypeRestrictionsForEquivalentItem](r, enc, 1, maxnoofEPLMNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NPNMobilityInformation struct { + SNPNMobilityInformation *SNPNMobilityInformation `per:",choice:0"` + PNINPNMobilityInformation *PNINPNMobilityInformation `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type ExpectedUEActivityBehaviour struct { + ExpectedActivityPeriod *ExpectedActivityPeriod `per:",optional"` + ExpectedIdlePeriod *ExpectedIdlePeriod `per:",optional"` + SourceOfUEActivityBehaviourInformation *SourceOfUEActivityBehaviourInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExtendedPacketDelayBudget int64 + +func (v ExtendedPacketDelayBudget) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 65535, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ExtendedPacketDelayBudget) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 65535, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ExtendedPacketDelayBudget(n) + + return nil +} + +func (v ExtendedPacketDelayBudget) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 109999) +} + +type QosMonitoringRequest uint8 + +const ( + QosMonitoringRequestUL QosMonitoringRequest = iota + QosMonitoringRequestDL + QosMonitoringRequestBoth + QosMonitoringRequestStop +) + +type QosMonitoringReportingFrequency int64 + +func (v QosMonitoringReportingFrequency) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 1800, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *QosMonitoringReportingFrequency) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 1800, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = QosMonitoringReportingFrequency(n) + + return nil +} + +func (v QosMonitoringReportingFrequency) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 1800) +} + +type PDUsetQoSParameters struct { + UlPDUSetQoSInformation *PDUsetQoSInformation `per:",optional"` + DlPDUSetQoSInformation *PDUsetQoSInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type DLPDUSetInformationMarkingSupportIndication uint8 + +const ( + DLPDUSetInformationMarkingSupportIndicationTrue DLPDUSetInformationMarkingSupportIndication = iota +) + +type MMSID []byte + +func (v MMSID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, 1, true, true, false, v) +} + +func (v *MMSID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, 1, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type IndicationofBitrateAdaptation uint8 + +const ( + IndicationofBitrateAdaptationUplink IndicationofBitrateAdaptation = iota +) + +type AlternativeQoSParaSetList []AlternativeQoSParaSetItem + +func (l AlternativeQoSParaSetList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosParaSets, []AlternativeQoSParaSetItem(l)) +} + +func (l *AlternativeQoSParaSetList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AlternativeQoSParaSetItem](r, enc, 1, maxnoofQosParaSets) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MonitoringRequestonAvailableBitrate struct { + MonitoringRequest MonitoringRequest + DlAvailableBitrateReportThresholds AvailableBitrateReportThresholdList `per:",optional"` + UlAvailableBitrateReportThresholds AvailableBitrateReportThresholdList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TSCTrafficCharacteristics struct { + TSCAssistanceInformationDL *TSCAssistanceInformation `per:",optional"` + TSCAssistanceInformationUL *TSCAssistanceInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RedundantQosFlowIndicator uint8 + +const ( + RedundantQosFlowIndicatorTrue RedundantQosFlowIndicator = iota + RedundantQosFlowIndicatorFalse +) + +type ECNMarkingorCongestionInformationReportingRequest struct { + ECNMarkingAtRANRequest *ECNMarkingAtRANRequest `per:",choice:0"` + ECNMarkingAtUPFRequest *ECNMarkingAtUPFRequest `per:",choice:1"` + CongestionInformationRequest *CongestionInformationRequest `per:",choice:2"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` +} + +type AlternativeQoSParaSetIndex int64 + +func (v AlternativeQoSParaSetIndex) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 8, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *AlternativeQoSParaSetIndex) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 8, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = AlternativeQoSParaSetIndex(n) + + return nil +} + +func (v AlternativeQoSParaSetIndex) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 8) +} + +type TLContainer []byte + +func (v TLContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *TLContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type TSCTrafficCharacteristicsFeedback struct { + TSCFeedbackInformationDL *TSCFeedbackInformation `per:",optional"` + TSCFeedbackInformationUL *TSCFeedbackInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SecondaryRATUsageInformation struct { + PDUSessionUsageReport *PDUSessionUsageReport `per:",optional"` + QosFlowsUsageReportList QoSFlowsUsageReportList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSSessionSetupResponseList []MBSSessionSetupResponseItem + +func (l MBSSessionSetupResponseList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSSessions, []MBSSessionSetupResponseItem(l)) +} + +func (l *MBSSessionSetupResponseList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSSessionSetupResponseItem](r, enc, 1, maxnoofMBSSessions) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSSessionFailedtoSetupList []MBSSessionFailedtoSetupItem + +func (l MBSSessionFailedtoSetupList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSSessions, []MBSSessionFailedtoSetupItem(l)) +} + +func (l *MBSSessionFailedtoSetupList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSSessionFailedtoSetupItem](r, enc, 1, maxnoofMBSSessions) + if err != nil { + return err + } + + *l = items + + return nil +} + +type UserPlaneFailureIndicationReport uint8 + +const ( + UserPlaneFailureIndicationReportQoSFlowsAndTunnelToBeReleased UserPlaneFailureIndicationReport = iota + UserPlaneFailureIndicationReportQoSFlowsToBeMoved + UserPlaneFailureIndicationReportNewTransportAddressAllocated +) + +type AlternativeQoSParaSetNotifyIndex int64 + +func (v AlternativeQoSParaSetNotifyIndex) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 8, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *AlternativeQoSParaSetNotifyIndex) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 8, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = AlternativeQoSParaSetNotifyIndex(n) + + return nil +} + +func (v AlternativeQoSParaSetNotifyIndex) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 8) +} + +type QosFlowFeedbackList []QosFlowFeedbackItem + +func (l QosFlowFeedbackList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QosFlowFeedbackItem(l)) +} + +func (l *QosFlowFeedbackList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QosFlowFeedbackItem](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QosFlowAdditionalInfoListRelCom []QosFlowAdditionalInfoItemRelCom + +func (l QosFlowAdditionalInfoListRelCom) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QosFlowAdditionalInfoItemRelCom(l)) +} + +func (l *QosFlowAdditionalInfoListRelCom) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QosFlowAdditionalInfoItemRelCom](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QosFlowAdditionalInfoListRelRes []QosFlowAdditionalInfoItemRelRes + +func (l QosFlowAdditionalInfoListRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QosFlowAdditionalInfoItemRelRes(l)) +} + +func (l *QosFlowAdditionalInfoListRelRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QosFlowAdditionalInfoItemRelRes](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QoSFlowTSCList []QoSFlowTSCItem + +func (l QoSFlowTSCList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QoSFlowTSCItem(l)) +} + +func (l *QoSFlowTSCList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QoSFlowTSCItem](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MDTConfiguration struct { + MdtConfigNR *MDTConfigurationNR `per:",optional"` + MdtConfigEUTRA *MDTConfigurationEUTRA `per:",optional"` + MNonlyMDTcollection *MNonlyMDTcollection `per:",extie:IDMNonlyMDTcollection,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SgNBUEX2APID uint32 + +func (v SgNBUEX2APID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4294967295, HasUB: true}, int64(v)) +} + +func (v *SgNBUEX2APID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4294967295, HasUB: true}) + if err != nil { + return err + } + + *v = SgNBUEX2APID(n) + + return nil +} + +type UEHistoryInformationFromTheUE struct { + NR *NRMobilityHistoryReport `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type SourceNodeID struct { + SourceengNBID *GlobalGNBID `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type MBSActiveSessionInformationSourcetoTargetList []MBSActiveSessionInformationSourcetoTargetItem + +func (l MBSActiveSessionInformationSourcetoTargetList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSSessionsofUE, []MBSActiveSessionInformationSourcetoTargetItem(l)) +} + +func (l *MBSActiveSessionInformationSourcetoTargetList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSActiveSessionInformationSourcetoTargetItem](r, enc, 1, maxnoofMBSSessionsofUE) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QMCConfigInfo struct { + UEAppLayerMeasInfoList UEAppLayerMeasInfoList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NGAPIESupportInformationRequestList []NGAPIESupportInformationRequestItem + +func (l NGAPIESupportInformationRequestList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofNGAPIESupportInfo, []NGAPIESupportInformationRequestItem(l)) +} + +func (l *NGAPIESupportInformationRequestList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NGAPIESupportInformationRequestItem](r, enc, 1, maxnoofNGAPIESupportInfo) + if err != nil { + return err + } + + *l = items + + return nil +} + +type CandidateRelayUEInformationList []CandidateRelayUEInformationItem + +func (l CandidateRelayUEInformationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCandidateRelayUEs, []CandidateRelayUEInformationItem(l)) +} + +func (l *CandidateRelayUEInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CandidateRelayUEInformationItem](r, enc, 1, maxnoofCandidateRelayUEs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TimeBasedHandoverInformation struct { + HOWindowStart HandoverWindowStart + HOWindowDuration HandoverWindowDuration + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ULForwarding uint8 + +const ( + ULForwardingULForwardingProposed ULForwarding = iota +) + +type DAPSRequestInfoDAPSIndicator uint8 + +const ( + DAPSRequestInfoDAPSIndicatorDapsHoRequired DAPSRequestInfoDAPSIndicator = iota +) + +type DAPSRequestInfo struct { + DAPSIndicator DAPSRequestInfoDAPSIndicator + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LastVisitedPSCellList []LastVisitedPSCellInformation + +func (l LastVisitedPSCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPSCellsPerPrimaryCellinUEHistoryInfo, []LastVisitedPSCellInformation(l)) +} + +func (l *LastVisitedPSCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[LastVisitedPSCellInformation](r, enc, 1, maxnoofPSCellsPerPrimaryCellinUEHistoryInfo) + if err != nil { + return err + } + + *l = items + + return nil +} + +type RSN uint8 + +const ( + RSNV1 RSN = iota + RSNV2 +) + +type PDUSessionPairID int64 + +func (v PDUSessionPairID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *PDUSessionPairID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = PDUSessionPairID(n) + + return nil +} + +func (v PDUSessionPairID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 255) +} + +type ECNMarkingorCongestionInformationReportingStatusItem struct { + QosFlowIdentifier QosFlowIdentifier + ActivationStatus ActivationStatus + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QosFlowParametersItem struct { + QosFlowIdentifier QosFlowIdentifier + AlternativeQoSParaSetList AlternativeQoSParaSetList `per:",optional"` + CNPacketDelayBudgetDL *ExtendedPacketDelayBudget `per:",extie:IDCNPacketDelayBudgetDL,crit:ignore"` + CNPacketDelayBudgetUL *ExtendedPacketDelayBudget `per:",extie:IDCNPacketDelayBudgetUL,crit:ignore"` + BurstArrivalTimeDownlink *BurstArrivalTime `per:",extie:IDBurstArrivalTimeDownlink,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CNTypeRestrictionsForEquivalentItemCnType uint8 + +const ( + CNTypeRestrictionsForEquivalentItemCnTypeEPCForbidden CNTypeRestrictionsForEquivalentItemCnType = iota + CNTypeRestrictionsForEquivalentItemCnTypeFiveGCForbidden +) + +type CNTypeRestrictionsForEquivalentItem struct { + PlmnIdentity PLMNIdentity + CnType CNTypeRestrictionsForEquivalentItemCnType + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SNPNMobilityInformation struct { + ServingNID NID + EquivalentSNPNsList EquivalentSNPNsList `per:",extie:IDEquivalentSNPNsList,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PNINPNMobilityInformation struct { + AllowedPNINPIList AllowedPNINPNList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExpectedActivityPeriod int64 + +func (v ExpectedActivityPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ExpectedActivityPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ExpectedActivityPeriod(n) + + return nil +} + +func (v ExpectedActivityPeriod) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 181) +} + +type ExpectedIdlePeriod int64 + +func (v ExpectedIdlePeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ExpectedIdlePeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ExpectedIdlePeriod(n) + + return nil +} + +func (v ExpectedIdlePeriod) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 181) +} + +type SourceOfUEActivityBehaviourInformation uint8 + +const ( + SourceOfUEActivityBehaviourInformationSubscriptionInformation SourceOfUEActivityBehaviourInformation = iota + SourceOfUEActivityBehaviourInformationStatistics +) + +type PDUsetQoSInformationPduSetIntegratedHandlingInformation uint8 + +const ( + PDUsetQoSInformationPduSetIntegratedHandlingInformationTrue PDUsetQoSInformationPduSetIntegratedHandlingInformation = iota + PDUsetQoSInformationPduSetIntegratedHandlingInformationFalse +) + +type PDUsetQoSInformation struct { + PduSetDelayBudget *ExtendedPacketDelayBudget `per:",optional"` + PduSetErrorRate *PacketErrorRate `per:",optional"` + PduSetIntegratedHandlingInformation *PDUsetQoSInformationPduSetIntegratedHandlingInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AlternativeQoSParaSetItem struct { + AlternativeQoSParaSetIndex AlternativeQoSParaSetIndex + GuaranteedFlowBitRateDL *BitRate `per:",optional"` + GuaranteedFlowBitRateUL *BitRate `per:",optional"` + PacketDelayBudget *PacketDelayBudget `per:",optional"` + PacketErrorRate *PacketErrorRate `per:",optional"` + MaximumDataBurstVolume *MaximumDataBurstVolume `per:",extie:IDMaximumDataBurstVolume,crit:ignore"` + PduSetDelayBudgetDownlink *ExtendedPacketDelayBudget `per:",extie:IDPduSetDelayBudgetDownlink,crit:ignore"` + PduSetDelayBudgetUplink *ExtendedPacketDelayBudget `per:",extie:IDPduSetDelayBudgetUplink,crit:ignore"` + PduSetErrorRateDownlink *PacketErrorRate `per:",extie:IDPduSetErrorRateDownlink,crit:ignore"` + PduSetErrorRateUplink *PacketErrorRate `per:",extie:IDPduSetErrorRateUplink,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MonitoringRequest uint8 + +const ( + MonitoringRequestUL MonitoringRequest = iota + MonitoringRequestDL + MonitoringRequestBoth + MonitoringRequestStop +) + +type AvailableBitrateReportThresholdList []AvailableBitrateReportThresholdItem + +func (l AvailableBitrateReportThresholdList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofThresholds, []AvailableBitrateReportThresholdItem(l)) +} + +func (l *AvailableBitrateReportThresholdList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AvailableBitrateReportThresholdItem](r, enc, 1, maxnoofThresholds) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TSCAssistanceInformation struct { + Periodicity Periodicity + BurstArrivalTime *BurstArrivalTime `per:",optional"` + SurvivalTime *SurvivalTime `per:",extie:IDSurvivalTime,crit:ignore"` + RANfeedbacktype *RANfeedbacktype `per:",extie:IDRANfeedbacktype,crit:ignore"` + N6JitterInformation *N6JitterInformation `per:",extie:IDN6JitterInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ECNMarkingAtRANRequest uint8 + +const ( + ECNMarkingAtRANRequestUL ECNMarkingAtRANRequest = iota + ECNMarkingAtRANRequestDL + ECNMarkingAtRANRequestBoth + ECNMarkingAtRANRequestStop +) + +type ECNMarkingAtUPFRequest uint8 + +const ( + ECNMarkingAtUPFRequestUL ECNMarkingAtUPFRequest = iota + ECNMarkingAtUPFRequestDL + ECNMarkingAtUPFRequestBoth + ECNMarkingAtUPFRequestStop +) + +type CongestionInformationRequest uint8 + +const ( + CongestionInformationRequestUL CongestionInformationRequest = iota + CongestionInformationRequestDL + CongestionInformationRequestBoth + CongestionInformationRequestStop +) + +type TSCFeedbackInformationBurstArrivalTimeOffset int64 + +func (v TSCFeedbackInformationBurstArrivalTimeOffset) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: -640000, HasLB: true, UB: 640000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *TSCFeedbackInformationBurstArrivalTimeOffset) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: -640000, HasLB: true, UB: 640000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = TSCFeedbackInformationBurstArrivalTimeOffset(n) + + return nil +} + +func (v TSCFeedbackInformationBurstArrivalTimeOffset) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), -640000, 640000) +} + +type TSCFeedbackInformation struct { + BurstArrivalTimeOffset TSCFeedbackInformationBurstArrivalTimeOffset + AdjustedPeriodicity *Periodicity `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PDUSessionUsageReportRATType uint8 + +const ( + PDUSessionUsageReportRATTypeNR PDUSessionUsageReportRATType = iota + PDUSessionUsageReportRATTypeEUTRA + PDUSessionUsageReportRATTypeNRUnlicensed + PDUSessionUsageReportRATTypeEUtraUnlicensed +) + +type PDUSessionUsageReport struct { + RATType PDUSessionUsageReportRATType + PDUSessionTimedReportList VolumeTimedReportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QoSFlowsUsageReportList []QoSFlowsUsageReportItem + +func (l QoSFlowsUsageReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QoSFlowsUsageReportItem(l)) +} + +func (l *QoSFlowsUsageReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QoSFlowsUsageReportItem](r, enc, 1, maxnoofQosFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSSessionSetupResponseItem struct { + MBSSessionID MBSSessionID + MBSAreaSessionID *MBSAreaSessionID `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSSessionFailedtoSetupItem struct { + MBSSessionID MBSSessionID + MBSAreaSessionID *MBSAreaSessionID `per:",optional"` + Cause Cause + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QosFlowFeedbackItem struct { + QosFlowIdentifier QosFlowIdentifier + UpdateFeedback *UpdateFeedback `per:",optional"` + CNpacketDelayBudgetDL *ExtendedPacketDelayBudget `per:",optional"` + CNpacketDelayBudgetUL *ExtendedPacketDelayBudget `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QosFlowAdditionalInfoItemRelCom struct { + QosFlowIdentifier QosFlowIdentifier + DownlinkTLContainer TLContainer `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QosFlowAdditionalInfoItemRelRes struct { + QosFlowIdentifier QosFlowIdentifier + UplinkTLContainer TLContainer `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QoSFlowTSCItem struct { + QosFlowIdentifier QosFlowIdentifier + TSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback `per:",optional"` + ANPacketDelayBudgetUL *ExtendedPacketDelayBudget `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MDTConfigurationNR struct { + MdtActivation MDTActivation + AreaScopeOfMDT AreaScopeOfMDTNR + MDTModeNr MDTModeNr + SignallingBasedMDTPLMNList MDTPLMNList `per:",optional"` + PNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT `per:",extie:IDPNINPNAreaScopeofMDT,crit:ignore"` + NetworkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT `per:",extie:IDNetworkSliceAreaScopeofMDT,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MDTConfigurationEUTRA struct { + MdtActivation MDTActivation + AreaScopeOfMDT AreaScopeOfMDTEUTRA + MDTMode MDTModeEutra + SignallingBasedMDTPLMNList MDTPLMNList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MNonlyMDTcollection uint8 + +const ( + MNonlyMDTcollectionMnOnly MNonlyMDTcollection = iota +) + +type NRMobilityHistoryReport []byte + +func (v NRMobilityHistoryReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *NRMobilityHistoryReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type MBSActiveSessionInformationSourcetoTargetItem struct { + MBSSessionID MBSSessionID + MBSAreaSessionID *MBSAreaSessionID `per:",optional"` + MBSServiceArea *MBSServiceArea `per:",optional"` + MBSQoSFlowsToBeSetupList MBSQoSFlowsToBeSetupList + MBSMappingandDataForwardingRequestList MBSMappingandDataForwardingRequestList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UEAppLayerMeasInfoList []UEAppLayerMeasInfoItem + +func (l UEAppLayerMeasInfoList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofUEAppLayerMeas, []UEAppLayerMeasInfoItem(l)) +} + +func (l *UEAppLayerMeasInfoList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[UEAppLayerMeasInfoItem](r, enc, 1, maxnoofUEAppLayerMeas) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NGAPIESupportInformationRequestItem struct { + NgapProtocolIEId ProtocolIEID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CandidateRelayUEInformationItem struct { + CandidateRelayUEId CandidateRelayUEID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type HandoverWindowStart uint64 + +func (v HandoverWindowStart) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 549755813887, HasUB: true}, int64(v)) +} + +func (v *HandoverWindowStart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 549755813887, HasUB: true}) + if err != nil { + return err + } + + *v = HandoverWindowStart(n) + + return nil +} + +type HandoverWindowDuration uint16 + +func (v HandoverWindowDuration) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 6000, HasUB: true}, int64(v)) +} + +func (v *HandoverWindowDuration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 6000, HasUB: true}) + if err != nil { + return err + } + + *v = HandoverWindowDuration(n) + + return nil +} + +type LastVisitedPSCellInformationTimeStay uint16 + +func (v LastVisitedPSCellInformationTimeStay) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}, int64(v)) +} + +func (v *LastVisitedPSCellInformationTimeStay) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}) + if err != nil { + return err + } + + *v = LastVisitedPSCellInformationTimeStay(n) + + return nil +} + +type LastVisitedPSCellInformation struct { + PSCellID *NGRANCGI `per:",optional"` + TimeStay LastVisitedPSCellInformationTimeStay + SCGActivationTime *SCGActivationTime `per:",extie:IDSCGActivationTime,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ActivationStatus uint8 + +const ( + ActivationStatusActive ActivationStatus = iota + ActivationStatusNotActive +) + +type BurstArrivalTime []byte + +func (v BurstArrivalTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *BurstArrivalTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type EquivalentSNPNsList []EquivalentSNPNsItem + +func (l EquivalentSNPNsList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofESNPNs, []EquivalentSNPNsItem(l)) +} + +func (l *EquivalentSNPNsList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EquivalentSNPNsItem](r, enc, 1, maxnoofESNPNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type AllowedPNINPNList []AllowedPNINPNItem + +func (l AllowedPNINPNList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEPLMNsPlusOne, []AllowedPNINPNItem(l)) +} + +func (l *AllowedPNINPNList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AllowedPNINPNItem](r, enc, 1, maxnoofEPLMNsPlusOne) + if err != nil { + return err + } + + *l = items + + return nil +} + +type AvailableBitrateReportThresholdItem struct { + ReportingThreshold ReportingThreshold + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type Periodicity int64 + +func (v Periodicity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 640000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *Periodicity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 640000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = Periodicity(n) + + return nil +} + +func (v Periodicity) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 640000) +} + +type SurvivalTime int64 + +func (v SurvivalTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 1920000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *SurvivalTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 1920000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = SurvivalTime(n) + + return nil +} + +func (v SurvivalTime) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 1920000) +} + +type RANfeedbacktype struct { + Proactive *RANfeedbacktypeproactive `per:",choice:0"` + Reactive *RANfeedbacktypereactive `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type N6JitterInformationN6JitterLowerBound int32 + +func (v N6JitterInformationN6JitterLowerBound) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: -127, HasLB: true, UB: 127, HasUB: true}, int64(v)) +} + +func (v *N6JitterInformationN6JitterLowerBound) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: -127, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + + *v = N6JitterInformationN6JitterLowerBound(n) + + return nil +} + +type N6JitterInformationN6JitterUpperBound int32 + +func (v N6JitterInformationN6JitterUpperBound) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: -127, HasLB: true, UB: 127, HasUB: true}, int64(v)) +} + +func (v *N6JitterInformationN6JitterUpperBound) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: -127, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + + *v = N6JitterInformationN6JitterUpperBound(n) + + return nil +} + +type N6JitterInformation struct { + N6JitterLowerBound N6JitterInformationN6JitterLowerBound + N6JitterUpperBound N6JitterInformationN6JitterUpperBound + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type VolumeTimedReportList []VolumeTimedReportItem + +func (l VolumeTimedReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTimePeriods, []VolumeTimedReportItem(l)) +} + +func (l *VolumeTimedReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[VolumeTimedReportItem](r, enc, 1, maxnoofTimePeriods) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QoSFlowsUsageReportItemRATType uint8 + +const ( + QoSFlowsUsageReportItemRATTypeNR QoSFlowsUsageReportItemRATType = iota + QoSFlowsUsageReportItemRATTypeEUTRA + QoSFlowsUsageReportItemRATTypeNRUnlicensed + QoSFlowsUsageReportItemRATTypeEUtraUnlicensed +) + +type QoSFlowsUsageReportItem struct { + QosFlowIdentifier QosFlowIdentifier + RATType QoSFlowsUsageReportItemRATType + QoSFlowsTimedReportList VolumeTimedReportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSSessionID struct { + TMGI TMGI + NID *NID `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSAreaSessionID int64 + +func (v MBSAreaSessionID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *MBSAreaSessionID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = MBSAreaSessionID(n) + + return nil +} + +func (v MBSAreaSessionID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 65535) +} + +type UpdateFeedback struct{ BitString } + +func (v UpdateFeedback) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 8, 8) +} + +func (v *UpdateFeedback) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 8, 8) + if err != nil { + return err + } + + *v = UpdateFeedback{b} + + return nil +} + +type MDTActivation uint8 + +const ( + MDTActivationImmediateMDTOnly MDTActivation = iota + MDTActivationLoggedMDTOnly + MDTActivationImmediateMDTAndTrace +) + +type AreaScopeOfMDTNR struct { + CellBased *CellBasedMDTNR `per:",choice:0"` + TABased *TABasedMDT `per:",choice:1"` + PLMNWide *per.Null `per:",choice:2"` + TAIBased *TAIBasedMDT `per:",choice:3"` + PNINPNBasedMDT *PNINPNBasedMDT `per:",choice:4,extie:IDPNINPNBasedMDT,crit:ignore"` + SNPNCellBasedMDT *SNPNCellBasedMDT `per:",choice:4,extie:IDSNPNCellBasedMDT,crit:ignore"` + SNPNTAIBasedMDT *SNPNTAIBasedMDT `per:",choice:4,extie:IDSNPNTAIBasedMDT,crit:ignore"` + SNPNBasedMDT *SNPNBasedMDT `per:",choice:4,extie:IDSNPNBasedMDT,crit:ignore"` + GeographyBasedMDT *GeographyBasedMDT `per:",choice:4,extie:IDGeographyBasedMDT,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:4,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} + +type MDTModeNr struct { + ImmediateMDTNr *ImmediateMDTNr `per:",choice:0"` + LoggedMDTNr *LoggedMDTNr `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type MDTPLMNList []PLMNIdentity + +func (l MDTPLMNList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMDTPLMNs, []PLMNIdentity(l)) +} + +func (l *MDTPLMNList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PLMNIdentity](r, enc, 1, maxnoofMDTPLMNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type PNINPNAreaScopeofMDT struct { + CAGListforMDT CAGListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NetworkSliceAreaScopeofMDT struct { + NetworkSliceListforMDT NetworkSliceListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AreaScopeOfMDTEUTRA struct { + CellBased *CellBasedMDTEUTRA `per:",choice:0"` + TABased *TABasedMDT `per:",choice:1"` + PLMNWide *per.Null `per:",choice:2"` + TAIBased *TAIBasedMDT `per:",choice:3"` + ChoiceExtension *SingleContainer `per:",choice:4,extie"` +} + +type MDTModeEutra []byte + +func (v MDTModeEutra) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *MDTModeEutra) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type MBSServiceArea struct { + Locationindependent *MBSServiceAreaInformation `per:",choice:0"` + Locationdependent *MBSServiceAreaInformationList `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type MBSQoSFlowsToBeSetupList []MBSQoSFlowsToBeSetupItem + +func (l MBSQoSFlowsToBeSetupList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSQoSFlows, []MBSQoSFlowsToBeSetupItem(l)) +} + +func (l *MBSQoSFlowsToBeSetupList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSQoSFlowsToBeSetupItem](r, enc, 1, maxnoofMBSQoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSMappingandDataForwardingRequestList []MBSMappingandDataForwardingRequestItem + +func (l MBSMappingandDataForwardingRequestList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMRBs, []MBSMappingandDataForwardingRequestItem(l)) +} + +func (l *MBSMappingandDataForwardingRequestList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSMappingandDataForwardingRequestItem](r, enc, 1, maxnoofMRBs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type UEAppLayerMeasInfoItem struct { + UEAppLayerMeasConfigInfo UEAppLayerMeasConfigInfo + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CandidateRelayUEID uint32 + +func (v CandidateRelayUEID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 24) +} + +func (v *CandidateRelayUEID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 24) + if err != nil { + return err + } + + *v = CandidateRelayUEID(n) + + return nil +} + +type SCGActivationTime uint16 + +func (v SCGActivationTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}, int64(v)) +} + +func (v *SCGActivationTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}) + if err != nil { + return err + } + + *v = SCGActivationTime(n) + + return nil +} + +type EquivalentSNPNsItem struct { + PlmnIdentity PLMNIdentity + NID NID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AllowedPNINPNItemPNINPNrestricted uint8 + +const ( + AllowedPNINPNItemPNINPNrestrictedRestricted AllowedPNINPNItemPNINPNrestricted = iota + AllowedPNINPNItemPNINPNrestrictedNotRestricted +) + +type AllowedPNINPNItem struct { + PLMNIdentity PLMNIdentity + PNINPNrestricted AllowedPNINPNItemPNINPNrestricted + AllowedCAGListperPLMN AllowedCAGListperPLMN + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ReportingThreshold int64 + +func (v ReportingThreshold) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4000000000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ReportingThreshold) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4000000000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ReportingThreshold(n) + + return nil +} + +func (v ReportingThreshold) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 4000000000) +} + +type RANfeedbacktypeproactive struct { + BurstArrivalTimeWindow BurstArrivalTimeWindow + PeriodicityRange *PeriodicityRange `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RANfeedbacktypereactiveCapabilityForBATAdaptation uint8 + +const ( + RANfeedbacktypereactiveCapabilityForBATAdaptationTrue RANfeedbacktypereactiveCapabilityForBATAdaptation = iota +) + +type RANfeedbacktypereactive struct { + CapabilityForBATAdaptation RANfeedbacktypereactiveCapabilityForBATAdaptation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type VolumeTimedReportItemStartTimeStamp []byte + +func (v VolumeTimedReportItemStartTimeStamp) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 4, 4, true, true, false, v) +} + +func (v *VolumeTimedReportItemStartTimeStamp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type VolumeTimedReportItemEndTimeStamp []byte + +func (v VolumeTimedReportItemEndTimeStamp) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 4, 4, true, true, false, v) +} + +func (v *VolumeTimedReportItemEndTimeStamp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type VolumeTimedReportItemUsageCountUL uint64 + +func (v VolumeTimedReportItemUsageCountUL) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeUint64Range(w, enc, uint64(v)) +} + +func (v *VolumeTimedReportItemUsageCountUL) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeUint64Range(r, enc) + *v = VolumeTimedReportItemUsageCountUL(n) + + return err +} + +type VolumeTimedReportItemUsageCountDL uint64 + +func (v VolumeTimedReportItemUsageCountDL) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeUint64Range(w, enc, uint64(v)) +} + +func (v *VolumeTimedReportItemUsageCountDL) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeUint64Range(r, enc) + *v = VolumeTimedReportItemUsageCountDL(n) + + return err +} + +type VolumeTimedReportItem struct { + StartTimeStamp VolumeTimedReportItemStartTimeStamp + EndTimeStamp VolumeTimedReportItemEndTimeStamp + UsageCountUL VolumeTimedReportItemUsageCountUL + UsageCountDL VolumeTimedReportItemUsageCountDL + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TMGI []byte + +func (v TMGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 6, 6, true, true, false, v) +} + +func (v *TMGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 6, 6, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type CellBasedMDTNR struct { + CellIdListforMDT CellIdListforMDTNR + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TABasedMDT struct { + TAListforMDT TAListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TAIBasedMDT struct { + TAIListforMDT TAIListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PNINPNBasedMDT struct { + CAGListforMDT CAGListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SNPNCellBasedMDT struct { + SNPNcellIdListforMDT SNPNCellIdListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SNPNTAIBasedMDT struct { + SNPNTAIListforMDT SNPNTAIListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SNPNBasedMDT struct { + SNPNListforMDT SNPNListforMDT + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type GeographyBasedMDT struct { + NTNGeographicalArea NTNGeographicalAreaList + NTNPLMNList MDTPLMNList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ImmediateMDTNr struct { + MeasurementsToActivate MeasurementsToActivate + M1Configuration *M1Configuration `per:",optional"` + M4Configuration *M4Configuration `per:",optional"` + M5Configuration *M5Configuration `per:",optional"` + M6Configuration *M6Configuration `per:",optional"` + M7Configuration *M7Configuration `per:",optional"` + BluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration `per:",optional"` + WLANMeasurementConfiguration *WLANMeasurementConfiguration `per:",optional"` + MDTLocationInfo *MDTLocationInfo `per:",optional"` + SensorMeasurementConfiguration *SensorMeasurementConfiguration `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LoggedMDTNr struct { + LoggingInterval LoggingInterval + LoggingDuration LoggingDuration + LoggedMDTTrigger LoggedMDTTrigger + BluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration `per:",optional"` + WLANMeasurementConfiguration *WLANMeasurementConfiguration `per:",optional"` + SensorMeasurementConfiguration *SensorMeasurementConfiguration `per:",optional"` + AreaScopeOfNeighCellsList AreaScopeOfNeighCellsList `per:",optional"` + EarlyMeasurement *EarlyMeasurement `per:",extie:IDEarlyMeasurement,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CAGListforMDT []CAGListforMDTItem + +func (l CAGListforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCAGforMDT, []CAGListforMDTItem(l)) +} + +func (l *CAGListforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CAGListforMDTItem](r, enc, 1, maxnoofCAGforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NetworkSliceListforMDT []NetworkSliceItemforMDT + +func (l NetworkSliceListforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMDTPLMNs, []NetworkSliceItemforMDT(l)) +} + +func (l *NetworkSliceListforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NetworkSliceItemforMDT](r, enc, 1, maxnoofMDTPLMNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type CellBasedMDTEUTRA struct { + CellIdListforMDT CellIdListforMDTEUTRA + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSServiceAreaInformation struct { + MBSServiceAreaCellList MBSServiceAreaCellList `per:",optional"` + MBSServiceAreaTAIList MBSServiceAreaTAIList `per:",optional"` + MBSIntendedServiceAreaList MBSIntendedServiceAreaList `per:",extie:IDMBSIntendedServiceAreaList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSServiceAreaInformationList []MBSServiceAreaInformationItem + +func (l MBSServiceAreaInformationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSServiceAreaInformation, []MBSServiceAreaInformationItem(l)) +} + +func (l *MBSServiceAreaInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSServiceAreaInformationItem](r, enc, 1, maxnoofMBSServiceAreaInformation) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSQoSFlowsToBeSetupItem struct { + MBSqosFlowIdentifier QosFlowIdentifier + MBSqosFlowLevelQosParameters QosFlowLevelQosParameters + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSMappingandDataForwardingRequestItem struct { + MRBID MRBID + MBSQoSFlowList MBSQoSFlowList + MRBProgressInformation *MRBProgressInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UEAppLayerMeasConfigInfoQoEMeasurementStatus uint8 + +const ( + UEAppLayerMeasConfigInfoQoEMeasurementStatusOngoing UEAppLayerMeasConfigInfoQoEMeasurementStatus = iota +) + +type UEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig []byte + +func (v UEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, 8000, true, true, false, v) +} + +func (v *UEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, 8000, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type UEAppLayerMeasConfigInfoMeasConfigAppLayerID int64 + +func (v UEAppLayerMeasConfigInfoMeasConfigAppLayerID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *UEAppLayerMeasConfigInfoMeasConfigAppLayerID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = UEAppLayerMeasConfigInfoMeasConfigAppLayerID(n) + + return nil +} + +func (v UEAppLayerMeasConfigInfoMeasConfigAppLayerID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 15) +} + +type UEAppLayerMeasConfigInfo struct { + QoEReference QoEReference + ServiceType ServiceType + AreaScopeOfQMC *AreaScopeOfQMC `per:",optional"` + MeasCollEntityIPAddress TransportLayerAddress + QoEMeasurementStatus *UEAppLayerMeasConfigInfoQoEMeasurementStatus `per:",optional"` + ContainerForAppLayerMeasConfig UEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig `per:",optional"` + MeasConfigAppLayerID *UEAppLayerMeasConfigInfoMeasConfigAppLayerID `per:",optional"` + SliceSupportListQMC SliceSupportListQMC `per:",optional"` + MDTAlignmentInfo *MDTAlignmentInfo `per:",optional"` + AvailableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics `per:",optional"` + AssistanceInformationQoEMeas *AssistanceInformationQoEMeas `per:",extie:IDAssistanceInformationQoEMeas,crit:ignore"` + CommServiceType *CommServiceType `per:",extie:IDCommServiceType,crit:ignore"` + QoERVQoEReportingPaths *QoERVQoEReportingPaths `per:",extie:IDQoERVQoEReportingPaths,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AllowedCAGListperPLMN []CAGID + +func (l AllowedCAGListperPLMN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofAllowedCAGsperPLMN, []CAGID(l)) +} + +func (l *AllowedCAGListperPLMN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CAGID](r, enc, 1, maxnoofAllowedCAGsperPLMN) + if err != nil { + return err + } + + *l = items + + return nil +} + +type BurstArrivalTimeWindowBurstArrivalTimeWindowStart int64 + +func (v BurstArrivalTimeWindowBurstArrivalTimeWindowStart) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 640000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *BurstArrivalTimeWindowBurstArrivalTimeWindowStart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 640000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = BurstArrivalTimeWindowBurstArrivalTimeWindowStart(n) + + return nil +} + +func (v BurstArrivalTimeWindowBurstArrivalTimeWindowStart) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 640000) +} + +type BurstArrivalTimeWindowBurstArrivalTimeWindowEnd int64 + +func (v BurstArrivalTimeWindowBurstArrivalTimeWindowEnd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 640000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *BurstArrivalTimeWindowBurstArrivalTimeWindowEnd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 640000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = BurstArrivalTimeWindowBurstArrivalTimeWindowEnd(n) + + return nil +} + +func (v BurstArrivalTimeWindowBurstArrivalTimeWindowEnd) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 640000) +} + +type BurstArrivalTimeWindow struct { + BurstArrivalTimeWindowStart BurstArrivalTimeWindowBurstArrivalTimeWindowStart + BurstArrivalTimeWindowEnd BurstArrivalTimeWindowBurstArrivalTimeWindowEnd + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PeriodicityRange struct { + PeriodicityBound *PeriodicityBound `per:",choice:0"` + PeriodicityList *AllowedPeriodicityList `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type CellIdListforMDTNR []NRCGI + +func (l CellIdListforMDTNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforMDT, []NRCGI(l)) +} + +func (l *CellIdListforMDTNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellIDforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TAListforMDT []TAC + +func (l TAListforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAforMDT, []TAC(l)) +} + +func (l *TAListforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAC](r, enc, 1, maxnoofTAforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TAIListforMDT []TAI + +func (l TAIListforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAforMDT, []TAI(l)) +} + +func (l *TAIListforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SNPNCellIdListforMDT []SNPNCellIdListforMDTItem + +func (l SNPNCellIdListforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforMDT, []SNPNCellIdListforMDTItem(l)) +} + +func (l *SNPNCellIdListforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[SNPNCellIdListforMDTItem](r, enc, 1, maxnoofCellIDforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SNPNTAIListforMDT []SNPNTAIListforMDTItem + +func (l SNPNTAIListforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAforMDT, []SNPNTAIListforMDTItem(l)) +} + +func (l *SNPNTAIListforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[SNPNTAIListforMDTItem](r, enc, 1, maxnoofTAforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SNPNListforMDT []SNPNListforMDTItem + +func (l SNPNListforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMDTSNPNs, []SNPNListforMDTItem(l)) +} + +func (l *SNPNListforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[SNPNListforMDTItem](r, enc, 1, maxnoofMDTSNPNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NTNGeographicalAreaList []NTNGeographicalAreaItem + +func (l NTNGeographicalAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofAreaNTN, []NTNGeographicalAreaItem(l)) +} + +func (l *NTNGeographicalAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NTNGeographicalAreaItem](r, enc, 1, maxnoofAreaNTN) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MeasurementsToActivate uint8 + +func (v MeasurementsToActivate) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 8) +} + +func (v *MeasurementsToActivate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 8) + if err != nil { + return err + } + + *v = MeasurementsToActivate(n) + + return nil +} + +type M1Configuration struct { + M1reportingTrigger M1ReportingTrigger + M1thresholdEventA2 *M1ThresholdEventA2 `per:",optional"` + M1periodicReporting *M1PeriodicReporting `per:",optional"` + IncludeBeamMeasurementsIndication *IncludeBeamMeasurementsIndication `per:",extie:IDIncludeBeamMeasurementsIndication,crit:ignore"` + BeamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration `per:",extie:IDBeamMeasurementsReportConfiguration,crit:ignore,presence:conditional,cond:m1IncludesBeamMeasurements"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type M4Configuration struct { + M4period M4period + M4linkstolog Linkstolog + M4ReportAmount *M4ReportAmountMDT `per:",extie:IDM4ReportAmount,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type M5Configuration struct { + M5period M5period + M5linkstolog Linkstolog + M5ReportAmount *M5ReportAmountMDT `per:",extie:IDM5ReportAmount,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type M6Configuration struct { + M6reportInterval M6reportInterval + M6linkstolog Linkstolog + M6ReportAmount *M6ReportAmountMDT `per:",extie:IDM6ReportAmount,crit:ignore"` + ExcessPacketDelayThresholdConfiguration ExcessPacketDelayThresholdConfiguration `per:",extie:IDExcessPacketDelayThresholdConfiguration,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type M7Configuration struct { + M7period M7period + M7linkstolog Linkstolog + M7ReportAmount *M7ReportAmountMDT `per:",extie:IDM7ReportAmount,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type BluetoothMeasurementConfigurationBtrssi uint8 + +const ( + BluetoothMeasurementConfigurationBtrssiTrue BluetoothMeasurementConfigurationBtrssi = iota +) + +type BluetoothMeasurementConfiguration struct { + BluetoothMeasConfig BluetoothMeasConfig + BluetoothMeasConfigNameList BluetoothMeasConfigNameList `per:",optional"` + Btrssi *BluetoothMeasurementConfigurationBtrssi `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type WLANMeasurementConfigurationWlanrssi uint8 + +const ( + WLANMeasurementConfigurationWlanrssiTrue WLANMeasurementConfigurationWlanrssi = iota +) + +type WLANMeasurementConfigurationWlanrtt uint8 + +const ( + WLANMeasurementConfigurationWlanrttTrue WLANMeasurementConfigurationWlanrtt = iota +) + +type WLANMeasurementConfiguration struct { + WlanMeasConfig WLANMeasConfig + WlanMeasConfigNameList WLANMeasConfigNameList `per:",optional"` + Wlanrssi *WLANMeasurementConfigurationWlanrssi `per:",optional"` + Wlanrtt *WLANMeasurementConfigurationWlanrtt `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MDTLocationInfo struct { + MDTLocationInformation MDTLocationInformation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SensorMeasurementConfiguration struct { + SensorMeasConfig SensorMeasConfig + SensorMeasConfigNameList SensorMeasConfigNameList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LoggingInterval uint8 + +const ( + LoggingIntervalMs320 LoggingInterval = iota + LoggingIntervalMs640 + LoggingIntervalMs1280 + LoggingIntervalMs2560 + LoggingIntervalMs5120 + LoggingIntervalMs10240 + LoggingIntervalMs20480 + LoggingIntervalMs30720 + LoggingIntervalMs40960 + LoggingIntervalMs61440 + LoggingIntervalInfinity +) + +type LoggingDuration uint8 + +const ( + LoggingDurationM10 LoggingDuration = iota + LoggingDurationM20 + LoggingDurationM40 + LoggingDurationM60 + LoggingDurationM90 + LoggingDurationM120 +) + +type LoggedMDTTrigger struct { + Periodical *per.Null `per:",choice:0"` + EventTrigger *EventTrigger `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type AreaScopeOfNeighCellsList []AreaScopeOfNeighCellsItem + +func (l AreaScopeOfNeighCellsList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofFreqforMDT, []AreaScopeOfNeighCellsItem(l)) +} + +func (l *AreaScopeOfNeighCellsList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AreaScopeOfNeighCellsItem](r, enc, 1, maxnoofFreqforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type EarlyMeasurement uint8 + +const ( + EarlyMeasurementTrue EarlyMeasurement = iota +) + +type CAGListforMDTItem struct { + PlmnID PLMNIdentity + CAGID CAGID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NetworkSliceItemforMDT struct { + PlmnID PLMNIdentity + SliceMDTList SliceMDTList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CellIdListforMDTEUTRA []EUTRACGI + +func (l CellIdListforMDTEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforMDT, []EUTRACGI(l)) +} + +func (l *CellIdListforMDTEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EUTRACGI](r, enc, 1, maxnoofCellIDforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSServiceAreaCellList []NRCGI + +func (l MBSServiceAreaCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsforMBS, []NRCGI(l)) +} + +func (l *MBSServiceAreaCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellsforMBS) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSServiceAreaTAIList []TAI + +func (l MBSServiceAreaTAIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforMBS, []TAI(l)) +} + +func (l *MBSServiceAreaTAIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforMBS) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSIntendedServiceAreaList []IntendedServiceAreaCoordinates + +func (l MBSIntendedServiceAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofIntendedAreasforMBS, []IntendedServiceAreaCoordinates(l)) +} + +func (l *MBSIntendedServiceAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[IntendedServiceAreaCoordinates](r, enc, 1, maxnoofIntendedAreasforMBS) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSServiceAreaInformationItem struct { + MBSAreaSessionID MBSAreaSessionID + MBSServiceAreaInformation MBSServiceAreaInformation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MRBID int64 + +func (v MRBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 512, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *MRBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 512, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = MRBID(n) + + return nil +} + +func (v MRBID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 1, 512) } + +type MBSQoSFlowList []QosFlowIdentifier + +func (l MBSQoSFlowList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSQoSFlows, []QosFlowIdentifier(l)) +} + +func (l *MBSQoSFlowList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QosFlowIdentifier](r, enc, 1, maxnoofMBSQoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MRBProgressInformationPDCPSNLength12 uint16 + +func (v MRBProgressInformationPDCPSNLength12) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(v)) +} + +func (v *MRBProgressInformationPDCPSNLength12) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + if err != nil { + return err + } + + *v = MRBProgressInformationPDCPSNLength12(n) + + return nil +} + +type MRBProgressInformationPDCPSNLength18 uint32 + +func (v MRBProgressInformationPDCPSNLength18) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 262143, HasUB: true}, int64(v)) +} + +func (v *MRBProgressInformationPDCPSNLength18) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 262143, HasUB: true}) + if err != nil { + return err + } + + *v = MRBProgressInformationPDCPSNLength18(n) + + return nil +} + +type MRBProgressInformation struct { + PDCPSNLength12 *MRBProgressInformationPDCPSNLength12 `per:",choice:0"` + PDCPSNLength18 *MRBProgressInformationPDCPSNLength18 `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type QoEReference []byte + +func (v QoEReference) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 6, 6, true, true, false, v) +} + +func (v *QoEReference) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 6, 6, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type ServiceType uint8 + +const ( + ServiceTypeStreaming ServiceType = iota + ServiceTypeMTSI + ServiceTypeVR +) + +type AreaScopeOfQMC struct { + CellBased *CellBasedQMC `per:",choice:0"` + TABased *TABasedQMC `per:",choice:1"` + TAIBased *TAIBasedQMC `per:",choice:2"` + PLMNAreaBased *PLMNAreaBasedQMC `per:",choice:3"` + ChoiceExtension *SingleContainer `per:",choice:4,extie"` +} + +type SliceSupportListQMC []SliceSupportQMCItem + +func (l SliceSupportListQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofSNSSAIforQMC, []SliceSupportQMCItem(l)) +} + +func (l *SliceSupportListQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[SliceSupportQMCItem](r, enc, 1, maxnoofSNSSAIforQMC) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MDTAlignmentInfo struct { + SbasedMDT *NGRANTraceID `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList uint8 + +const ( + AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelListTrue AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList = iota +) + +type AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup uint8 + +const ( + AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartupTrue AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup = iota +) + +type AvailableRANVisibleQoEMetrics struct { + ApplicationLayerBufferLevelList *AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList `per:",optional"` + PlayoutDelayForMediaStartup *AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AssistanceInformationQoEMeas int64 + +func (v AssistanceInformationQoEMeas) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *AssistanceInformationQoEMeas) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = AssistanceInformationQoEMeas(n) + + return nil +} + +func (v AssistanceInformationQoEMeas) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 16) +} + +type CommServiceType uint8 + +const ( + CommServiceTypeMBSBroadcast CommServiceType = iota + CommServiceTypeMBSMulticast + CommServiceTypeUnicast +) + +type QoERVQoEReportingPathsQoEReportingPath uint8 + +const ( + QoERVQoEReportingPathsQoEReportingPathSrb4 QoERVQoEReportingPathsQoEReportingPath = iota + QoERVQoEReportingPathsQoEReportingPathSrb5 +) + +type QoERVQoEReportingPathsRVQoEReportingPath uint8 + +const ( + QoERVQoEReportingPathsRVQoEReportingPathSrb4 QoERVQoEReportingPathsRVQoEReportingPath = iota + QoERVQoEReportingPathsRVQoEReportingPathSrb5 +) + +type QoERVQoEReportingPaths struct { + QoEReportingPath *QoERVQoEReportingPathsQoEReportingPath `per:",optional"` + RVQoEReportingPath *QoERVQoEReportingPathsRVQoEReportingPath `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CAGID uint32 + +func (v CAGID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 32) +} + +func (v *CAGID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 32) + if err != nil { + return err + } + + *v = CAGID(n) + + return nil +} + +type PeriodicityBound struct { + PeriodicityLowerBound Periodicity + PeriodicityUpperBound Periodicity + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AllowedPeriodicityList []Periodicity + +func (l AllowedPeriodicityList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPeriodicities, []Periodicity(l)) +} + +func (l *AllowedPeriodicityList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[Periodicity](r, enc, 1, maxnoofPeriodicities) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SNPNCellIdListforMDTItem struct { + NRCGI NRCGI + NID NID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SNPNTAIListforMDTItem struct { + TAI TAI + NID NID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SNPNListforMDTItem struct { + PLMNIdentity PLMNIdentity + NID NID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NTNGeographicalAreaItem struct { + Circle *MDTcircle `per:",choice:0"` + Polygon *MDTpolygon `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type M1ReportingTrigger uint8 + +const ( + M1ReportingTriggerPeriodic M1ReportingTrigger = iota + M1ReportingTriggerA2eventtriggered + M1ReportingTriggerA2eventtriggeredPeriodic +) + +type M1ThresholdEventA2 struct { + M1ThresholdType M1ThresholdType + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type M1PeriodicReporting struct { + ReportInterval ReportIntervalMDT + ReportAmount ReportAmountMDT + ExtendedReportIntervalMDT *ExtendedReportIntervalMDT `per:",extie:IDExtendedReportIntervalMDT,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IncludeBeamMeasurementsIndication uint8 + +const ( + IncludeBeamMeasurementsIndicationTrue IncludeBeamMeasurementsIndication = iota +) + +type BeamMeasurementsReportConfiguration struct { + BeamMeasurementsReportQuantity *BeamMeasurementsReportQuantity `per:",optional"` + MaxNrofRSIndexesToReport *MaxNrofRSIndexesToReport `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type M4period uint8 + +const ( + M4periodMs1024 M4period = iota + M4periodMs2048 + M4periodMs5120 + M4periodMs10240 + M4periodMin1 +) + +type Linkstolog uint8 + +const ( + LinkstologUplink Linkstolog = iota + LinkstologDownlink + LinkstologBothUplinkAndDownlink +) + +type M4ReportAmountMDT uint8 + +const ( + M4ReportAmountMDTR1 M4ReportAmountMDT = iota + M4ReportAmountMDTR2 + M4ReportAmountMDTR4 + M4ReportAmountMDTR8 + M4ReportAmountMDTR16 + M4ReportAmountMDTR32 + M4ReportAmountMDTR64 + M4ReportAmountMDTInfinity +) + +type M5period uint8 + +const ( + M5periodMs1024 M5period = iota + M5periodMs2048 + M5periodMs5120 + M5periodMs10240 + M5periodMin1 +) + +type M5ReportAmountMDT uint8 + +const ( + M5ReportAmountMDTR1 M5ReportAmountMDT = iota + M5ReportAmountMDTR2 + M5ReportAmountMDTR4 + M5ReportAmountMDTR8 + M5ReportAmountMDTR16 + M5ReportAmountMDTR32 + M5ReportAmountMDTR64 + M5ReportAmountMDTInfinity +) + +type M6reportInterval uint8 + +const ( + M6reportIntervalMs120 M6reportInterval = iota + M6reportIntervalMs240 + M6reportIntervalMs480 + M6reportIntervalMs640 + M6reportIntervalMs1024 + M6reportIntervalMs2048 + M6reportIntervalMs5120 + M6reportIntervalMs10240 + M6reportIntervalMs20480 + M6reportIntervalMs40960 + M6reportIntervalMin1 + M6reportIntervalMin6 + M6reportIntervalMin12 + M6reportIntervalMin30 +) + +type M6ReportAmountMDT uint8 + +const ( + M6ReportAmountMDTR1 M6ReportAmountMDT = iota + M6ReportAmountMDTR2 + M6ReportAmountMDTR4 + M6ReportAmountMDTR8 + M6ReportAmountMDTR16 + M6ReportAmountMDTR32 + M6ReportAmountMDTR64 + M6ReportAmountMDTInfinity +) + +type ExcessPacketDelayThresholdConfiguration []ExcessPacketDelayThresholdItem + +func (l ExcessPacketDelayThresholdConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofThresholdsForExcessPacketDelay, []ExcessPacketDelayThresholdItem(l)) +} + +func (l *ExcessPacketDelayThresholdConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ExcessPacketDelayThresholdItem](r, enc, 1, maxnoofThresholdsForExcessPacketDelay) + if err != nil { + return err + } + + *l = items + + return nil +} + +type M7period int64 + +func (v M7period) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 60, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *M7period) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 60, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = M7period(n) + + return nil +} + +func (v M7period) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 1, 60) } + +type M7ReportAmountMDT uint8 + +const ( + M7ReportAmountMDTR1 M7ReportAmountMDT = iota + M7ReportAmountMDTR2 + M7ReportAmountMDTR4 + M7ReportAmountMDTR8 + M7ReportAmountMDTR16 + M7ReportAmountMDTR32 + M7ReportAmountMDTR64 + M7ReportAmountMDTInfinity +) + +type BluetoothMeasConfig uint8 + +const ( + BluetoothMeasConfigSetup BluetoothMeasConfig = iota +) + +type BluetoothMeasConfigNameList []BluetoothMeasConfigNameItem + +func (l BluetoothMeasConfigNameList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofBluetoothName, []BluetoothMeasConfigNameItem(l)) +} + +func (l *BluetoothMeasConfigNameList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[BluetoothMeasConfigNameItem](r, enc, 1, maxnoofBluetoothName) + if err != nil { + return err + } + + *l = items + + return nil +} + +type WLANMeasConfig uint8 + +const ( + WLANMeasConfigSetup WLANMeasConfig = iota +) + +type WLANMeasConfigNameList []WLANMeasConfigNameItem + +func (l WLANMeasConfigNameList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofWLANName, []WLANMeasConfigNameItem(l)) +} + +func (l *WLANMeasConfigNameList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[WLANMeasConfigNameItem](r, enc, 1, maxnoofWLANName) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MDTLocationInformation uint8 + +func (v MDTLocationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 8) +} + +func (v *MDTLocationInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 8) + if err != nil { + return err + } + + *v = MDTLocationInformation(n) + + return nil +} + +type SensorMeasConfig uint8 + +const ( + SensorMeasConfigSetup SensorMeasConfig = iota +) + +type SensorMeasConfigNameList []SensorMeasConfigNameItem + +func (l SensorMeasConfigNameList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofSensorName, []SensorMeasConfigNameItem(l)) +} + +func (l *SensorMeasConfigNameList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[SensorMeasConfigNameItem](r, enc, 1, maxnoofSensorName) + if err != nil { + return err + } + + *l = items + + return nil +} + +type EventTriggerOutOfCoverage uint8 + +const ( + EventTriggerOutOfCoverageTrue EventTriggerOutOfCoverage = iota +) + +type EventTrigger struct { + OutOfCoverage *EventTriggerOutOfCoverage `per:",choice:0"` + EventL1LoggedMDTConfig *EventL1LoggedMDTConfig `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type AreaScopeOfNeighCellsItem struct { + NrFrequencyInfo NRFrequencyInfo + PciListForMDT PCIListForMDT `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SliceMDTList []SliceMDTItem + +func (l SliceMDTList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofSliceItemsforMDT, []SliceMDTItem(l)) +} + +func (l *SliceMDTList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[SliceMDTItem](r, enc, 1, maxnoofSliceItemsforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type IntendedServiceAreaCoordinates []byte + +func (v IntendedServiceAreaCoordinates) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *IntendedServiceAreaCoordinates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type CellBasedQMC struct { + CellIdListforQMC CellIdListforQMC + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TABasedQMC struct { + TAListforQMC TAListforQMC + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TAIBasedQMC struct { + TAIListforQMC TAIListforQMC + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PLMNAreaBasedQMC struct { + PlmnListforQMC PLMNListforQMC + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SliceSupportQMCItem struct { + SNSSAI SNSSAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MDTcircleReferencelocation []byte + +func (v MDTcircleReferencelocation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *MDTcircleReferencelocation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type MDTcircleDistanceradius uint16 + +func (v MDTcircleDistanceradius) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 65535, HasUB: true}, int64(v)) +} + +func (v *MDTcircleDistanceradius) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + + *v = MDTcircleDistanceradius(n) + + return nil +} + +type MDTcircle struct { + Referencelocation MDTcircleReferencelocation + Distanceradius MDTcircleDistanceradius + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MDTpolygon []byte + +func (v MDTpolygon) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *MDTpolygon) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type M1ThresholdType struct { + ThresholdRSRP *ThresholdRSRP `per:",choice:0"` + ThresholdRSRQ *ThresholdRSRQ `per:",choice:1"` + ThresholdSINR *ThresholdSINR `per:",choice:2"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` +} + +type ReportIntervalMDT uint8 + +const ( + ReportIntervalMDTMs120 ReportIntervalMDT = iota + ReportIntervalMDTMs240 + ReportIntervalMDTMs480 + ReportIntervalMDTMs640 + ReportIntervalMDTMs1024 + ReportIntervalMDTMs2048 + ReportIntervalMDTMs5120 + ReportIntervalMDTMs10240 + ReportIntervalMDTMin1 + ReportIntervalMDTMin6 + ReportIntervalMDTMin12 + ReportIntervalMDTMin30 + ReportIntervalMDTMin60 +) + +type ReportAmountMDT uint8 + +const ( + ReportAmountMDTR1 ReportAmountMDT = iota + ReportAmountMDTR2 + ReportAmountMDTR4 + ReportAmountMDTR8 + ReportAmountMDTR16 + ReportAmountMDTR32 + ReportAmountMDTR64 + ReportAmountMDTRinfinity +) + +type ExtendedReportIntervalMDT uint8 + +const ( + ExtendedReportIntervalMDTMs20480 ExtendedReportIntervalMDT = iota + ExtendedReportIntervalMDTMs40960 +) + +type BeamMeasurementsReportQuantityRSRP uint8 + +const ( + BeamMeasurementsReportQuantityRSRPTrue BeamMeasurementsReportQuantityRSRP = iota + BeamMeasurementsReportQuantityRSRPFalse +) + +type BeamMeasurementsReportQuantityRSRQ uint8 + +const ( + BeamMeasurementsReportQuantityRSRQTrue BeamMeasurementsReportQuantityRSRQ = iota + BeamMeasurementsReportQuantityRSRQFalse +) + +type BeamMeasurementsReportQuantitySINR uint8 + +const ( + BeamMeasurementsReportQuantitySINRTrue BeamMeasurementsReportQuantitySINR = iota + BeamMeasurementsReportQuantitySINRFalse +) + +type BeamMeasurementsReportQuantity struct { + RSRP BeamMeasurementsReportQuantityRSRP + RSRQ BeamMeasurementsReportQuantityRSRQ + SINR BeamMeasurementsReportQuantitySINR + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MaxNrofRSIndexesToReport int64 + +func (v MaxNrofRSIndexesToReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 64, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *MaxNrofRSIndexesToReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 64, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = MaxNrofRSIndexesToReport(n) + + return nil +} + +func (v MaxNrofRSIndexesToReport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 64) +} + +type ExcessPacketDelayThresholdItem struct { + FiveQi FiveQI + ExcessPacketDelayThresholdValue ExcessPacketDelayThresholdValue + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type BluetoothMeasConfigNameItem struct { + BluetoothName BluetoothName + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type WLANMeasConfigNameItem struct { + WLANName WLANName + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SensorMeasConfigNameItem struct { + SensorNameConfig SensorNameConfig + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EventL1LoggedMDTConfig struct { + L1Threshold MeasurementThresholdL1LoggedMDT + Hysteresis Hysteresis + TimeToTrigger TimeToTrigger + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRFrequencyInfo struct { + NrARFCN NRARFCN + FrequencyBandList NRFrequencyBandList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PCIListForMDT []NRPCI + +func (l PCIListForMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofNeighPCIforMDT, []NRPCI(l)) +} + +func (l *PCIListForMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NRPCI](r, enc, 1, maxnoofNeighPCIforMDT) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SliceMDTItem struct { + SNSSAI SNSSAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CellIdListforQMC []NGRANCGI + +func (l CellIdListforQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforQMC, []NGRANCGI(l)) +} + +func (l *CellIdListforQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NGRANCGI](r, enc, 1, maxnoofCellIDforQMC) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TAListforQMC []TAC + +func (l TAListforQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAforQMC, []TAC(l)) +} + +func (l *TAListforQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAC](r, enc, 1, maxnoofTAforQMC) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TAIListforQMC []TAI + +func (l TAIListforQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAforQMC, []TAI(l)) +} + +func (l *TAIListforQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAforQMC) + if err != nil { + return err + } + + *l = items + + return nil +} + +type PLMNListforQMC []PLMNIdentity + +func (l PLMNListforQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPLMNforQMC, []PLMNIdentity(l)) +} + +func (l *PLMNListforQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PLMNIdentity](r, enc, 1, maxnoofPLMNforQMC) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ThresholdRSRP uint8 + +func (v ThresholdRSRP) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64(v)) +} + +func (v *ThresholdRSRP) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + + *v = ThresholdRSRP(n) + + return nil +} + +type ThresholdRSRQ uint8 + +func (v ThresholdRSRQ) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64(v)) +} + +func (v *ThresholdRSRQ) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + + *v = ThresholdRSRQ(n) + + return nil +} + +type ThresholdSINR uint8 + +func (v ThresholdSINR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64(v)) +} + +func (v *ThresholdSINR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + + *v = ThresholdSINR(n) + + return nil +} + +type ExcessPacketDelayThresholdValue uint8 + +const ( + ExcessPacketDelayThresholdValueMs0dot25 ExcessPacketDelayThresholdValue = iota + ExcessPacketDelayThresholdValueMs0dot5 + ExcessPacketDelayThresholdValueMs1 + ExcessPacketDelayThresholdValueMs2 + ExcessPacketDelayThresholdValueMs4 + ExcessPacketDelayThresholdValueMs5 + ExcessPacketDelayThresholdValueMs10 + ExcessPacketDelayThresholdValueMs20 + ExcessPacketDelayThresholdValueMs30 + ExcessPacketDelayThresholdValueMs40 + ExcessPacketDelayThresholdValueMs50 + ExcessPacketDelayThresholdValueMs60 + ExcessPacketDelayThresholdValueMs70 + ExcessPacketDelayThresholdValueMs80 + ExcessPacketDelayThresholdValueMs90 + ExcessPacketDelayThresholdValueMs100 + ExcessPacketDelayThresholdValueMs150 + ExcessPacketDelayThresholdValueMs300 + ExcessPacketDelayThresholdValueMs500 +) + +type BluetoothName []byte + +func (v BluetoothName) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, 248, true, true, false, v) +} + +func (v *BluetoothName) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, 248, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type WLANName []byte + +func (v WLANName) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, 32, true, true, false, v) +} + +func (v *WLANName) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, 32, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type SensorNameConfigUncompensatedBarometricConfig uint8 + +const ( + SensorNameConfigUncompensatedBarometricConfigTrue SensorNameConfigUncompensatedBarometricConfig = iota +) + +type SensorNameConfigUeSpeedConfig uint8 + +const ( + SensorNameConfigUeSpeedConfigTrue SensorNameConfigUeSpeedConfig = iota +) + +type SensorNameConfigUeOrientationConfig uint8 + +const ( + SensorNameConfigUeOrientationConfigTrue SensorNameConfigUeOrientationConfig = iota +) + +type SensorNameConfig struct { + UncompensatedBarometricConfig *SensorNameConfigUncompensatedBarometricConfig `per:",choice:0"` + UeSpeedConfig *SensorNameConfigUeSpeedConfig `per:",choice:1"` + UeOrientationConfig *SensorNameConfigUeOrientationConfig `per:",choice:2"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` +} + +type MeasurementThresholdL1LoggedMDT struct { + ThresholdRSRP *ThresholdRSRP `per:",choice:0"` + ThresholdRSRQ *ThresholdRSRQ `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type Hysteresis uint8 + +func (v Hysteresis) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 30, HasUB: true}, int64(v)) +} + +func (v *Hysteresis) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 30, HasUB: true}) + if err != nil { + return err + } + + *v = Hysteresis(n) + + return nil +} + +type TimeToTrigger uint8 + +const ( + TimeToTriggerMs0 TimeToTrigger = iota + TimeToTriggerMs40 + TimeToTriggerMs64 + TimeToTriggerMs80 + TimeToTriggerMs100 + TimeToTriggerMs128 + TimeToTriggerMs160 + TimeToTriggerMs256 + TimeToTriggerMs320 + TimeToTriggerMs480 + TimeToTriggerMs512 + TimeToTriggerMs640 + TimeToTriggerMs1024 + TimeToTriggerMs1280 + TimeToTriggerMs2560 + TimeToTriggerMs5120 +) + +type NRARFCN uint32 + +func (v NRARFCN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: maxNRARFCN, HasUB: true}, int64(v)) +} + +func (v *NRARFCN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: maxNRARFCN, HasUB: true}) + if err != nil { + return err + } + + *v = NRARFCN(n) + + return nil +} + +type NRFrequencyBandList []NRFrequencyBandItem + +func (l NRFrequencyBandList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofNRCellBands, []NRFrequencyBandItem(l)) +} + +func (l *NRFrequencyBandList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NRFrequencyBandItem](r, enc, 1, maxnoofNRCellBands) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NRPCI int64 + +func (v NRPCI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 1007, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *NRPCI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 1007, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = NRPCI(n) + + return nil +} + +func (v NRPCI) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 0, 1007) } + +type NRFrequencyBandItem struct { + Nrfrequencyband NRFrequencyBand + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRFrequencyBand int64 + +func (v NRFrequencyBand) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *NRFrequencyBand) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = NRFrequencyBand(n) + + return nil +} + +func (v NRFrequencyBand) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 1024) +} + +type ENDCSONConfigurationTransfer []byte + +func (v ENDCSONConfigurationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *ENDCSONConfigurationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type IntersystemSONConfigurationTransfer struct { + TransferType IntersystemSONTransferType + IntersystemSONInformation IntersystemSONInformation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CoreNetworkAssistanceInformationForInactive struct { + UEIdentityIndexValue UEIdentityIndexValue + UESpecificDRX *PagingDRX `per:",optional"` + PeriodicRegistrationUpdateTimer PeriodicRegistrationUpdateTimer + MICOModeIndication *MICOModeIndication `per:",optional"` + TAIListForInactive TAIListForInactive + ExpectedUEBehaviour *ExpectedUEBehaviour `per:",optional"` + EUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation `per:",extie:IDEUTRAPagingeDRXInformation,crit:ignore"` + ExtendedUEIdentityIndexValue *ExtendedUEIdentityIndexValue `per:",extie:IDExtendedUEIdentityIndexValue,crit:ignore"` + UERadioCapabilityForPaging *UERadioCapabilityForPaging `per:",extie:IDUERadioCapabilityForPaging,crit:ignore"` + MicoAllPLMN *MicoAllPLMN `per:",extie:IDMicoAllPLMN,crit:ignore"` + NRPagingeDRXInformation *NRPagingeDRXInformation `per:",extie:IDNRPagingeDRXInformation,crit:ignore"` + PagingCauseIndicationForVoiceService *PagingCauseIndicationForVoiceService `per:",extie:IDPagingCauseIndicationForVoiceService,crit:ignore"` + PEIPSassistanceInformation *PEIPSassistanceInformation `per:",extie:IDPEIPSassistanceInformation,crit:ignore"` + HashedUEIdentityIndexValue *HashedUEIdentityIndexValue `per:",extie:IDHashedUEIdentityIndexValue,crit:ignore"` + CNMTCommunicationHandling *CNMTCommunicationHandling `per:",extie:IDCNMTCommunicationHandling,crit:ignore"` + LPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation `per:",extie:IDLPWUSPSAssistanceInformation,crit:ignore"` + FurtherExtendedUEIdentityIndexValue *FurtherExtendedUEIdentityIndexValue `per:",extie:IDFurtherExtendedUEIdentityIndexValue,crit:ignore"` + LPWUSDisableIndication *LPWUSDisableIndication `per:",extie:IDLPWUSDisableIndication,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MaskedIMEISV uint64 + +func (v MaskedIMEISV) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 64) +} + +func (v *MaskedIMEISV) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 64) + if err != nil { + return err + } + + *v = MaskedIMEISV(n) + + return nil +} + +type RRCInactiveTransitionReportRequest uint8 + +const ( + RRCInactiveTransitionReportRequestSubsequentStateTransitionReport RRCInactiveTransitionReportRequest = iota + RRCInactiveTransitionReportRequestSingleRRCConnectedStateReport + RRCInactiveTransitionReportRequestCancelReport +) + +type RedirectionVoiceFallback uint8 + +const ( + RedirectionVoiceFallbackPossible RedirectionVoiceFallback = iota + RedirectionVoiceFallbackNotPossible +) + +type CNAssistedRANTuning struct { + ExpectedUEBehaviour *ExpectedUEBehaviour `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SRVCCOperationPossible uint8 + +const ( + SRVCCOperationPossiblePossible SRVCCOperationPossible = iota + SRVCCOperationPossibleNotPossible +) + +type IABAuthorized uint8 + +const ( + IABAuthorizedAuthorized IABAuthorized = iota + IABAuthorizedNotAuthorized +) + +type EnhancedCoverageRestriction uint8 + +const ( + EnhancedCoverageRestrictionRestricted EnhancedCoverageRestriction = iota +) + +type UEDifferentiationInfoPeriodicCommunicationIndicator uint8 + +const ( + UEDifferentiationInfoPeriodicCommunicationIndicatorPeriodically UEDifferentiationInfoPeriodicCommunicationIndicator = iota + UEDifferentiationInfoPeriodicCommunicationIndicatorOndemand +) + +type UEDifferentiationInfoPeriodicTime int64 + +func (v UEDifferentiationInfoPeriodicTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 3600, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *UEDifferentiationInfoPeriodicTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 3600, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = UEDifferentiationInfoPeriodicTime(n) + + return nil +} + +func (v UEDifferentiationInfoPeriodicTime) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 3600) +} + +type UEDifferentiationInfoStationaryIndication uint8 + +const ( + UEDifferentiationInfoStationaryIndicationStationary UEDifferentiationInfoStationaryIndication = iota + UEDifferentiationInfoStationaryIndicationMobile +) + +type UEDifferentiationInfoTrafficProfile uint8 + +const ( + UEDifferentiationInfoTrafficProfileSinglePacket UEDifferentiationInfoTrafficProfile = iota + UEDifferentiationInfoTrafficProfileDualPackets + UEDifferentiationInfoTrafficProfileMultiplePackets +) + +type UEDifferentiationInfoBatteryIndication uint8 + +const ( + UEDifferentiationInfoBatteryIndicationBatteryPowered UEDifferentiationInfoBatteryIndication = iota + UEDifferentiationInfoBatteryIndicationBatteryPoweredNotRechargeableOrReplaceable + UEDifferentiationInfoBatteryIndicationNotBatteryPowered +) + +type UEDifferentiationInfo struct { + PeriodicCommunicationIndicator *UEDifferentiationInfoPeriodicCommunicationIndicator `per:",optional"` + PeriodicTime *UEDifferentiationInfoPeriodicTime `per:",optional"` + ScheduledCommunicationTime *ScheduledCommunicationTime `per:",optional"` + StationaryIndication *UEDifferentiationInfoStationaryIndication `per:",optional"` + TrafficProfile *UEDifferentiationInfoTrafficProfile `per:",optional"` + BatteryIndication *UEDifferentiationInfoBatteryIndication `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRV2XServicesAuthorized struct { + VehicleUE *VehicleUE `per:",optional"` + PedestrianUE *PedestrianUE `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LTEV2XServicesAuthorized struct { + VehicleUE *VehicleUE `per:",optional"` + PedestrianUE *PedestrianUE `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRUESidelinkAggregateMaximumBitrate struct { + UESidelinkAggregateMaximumBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LTEUESidelinkAggregateMaximumBitrate struct { + UESidelinkAggregateMaximumBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PC5QoSParameters struct { + Pc5QoSFlowList PC5QoSFlowList + Pc5LinkAggregateBitRates *BitRate `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CEmodeBrestricted uint8 + +const ( + CEmodeBrestrictedRestricted CEmodeBrestricted = iota + CEmodeBrestrictedNotRestricted +) + +type UEUPCIoTSupport uint8 + +const ( + UEUPCIoTSupportSupported UEUPCIoTSupport = iota +) + +type UERadioCapabilityID []byte + +func (v UERadioCapabilityID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *UERadioCapabilityID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type ExtendedConnectedTime uint8 + +func (v ExtendedConnectedTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}, int64(v)) +} + +func (v *ExtendedConnectedTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}) + if err != nil { + return err + } + + *v = ExtendedConnectedTime(n) + + return nil +} + +type TimeSyncAssistanceInfoTimeDistributionIndication uint8 + +const ( + TimeSyncAssistanceInfoTimeDistributionIndicationEnabled TimeSyncAssistanceInfoTimeDistributionIndication = iota + TimeSyncAssistanceInfoTimeDistributionIndicationDisabled +) + +type TimeSyncAssistanceInfoUUTimeSyncErrorBudget int64 + +func (v TimeSyncAssistanceInfoUUTimeSyncErrorBudget) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 1000000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *TimeSyncAssistanceInfoUUTimeSyncErrorBudget) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 1000000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = TimeSyncAssistanceInfoUUTimeSyncErrorBudget(n) + + return nil +} + +func (v TimeSyncAssistanceInfoUUTimeSyncErrorBudget) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 1000000) +} + +type TimeSyncAssistanceInfo struct { + TimeDistributionIndication TimeSyncAssistanceInfoTimeDistributionIndication + UUTimeSyncErrorBudget *TimeSyncAssistanceInfoUUTimeSyncErrorBudget `per:",optional"` + ClockQualityReportingControlInfo *ClockQualityReportingControlInfo `per:",extie:IDClockQualityReportingControlInfo,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UESliceMaximumBitRateList []UESliceMaximumBitRateItem + +func (l UESliceMaximumBitRateList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofAllowedSNSSAIs, []UESliceMaximumBitRateItem(l)) +} + +func (l *UESliceMaximumBitRateList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[UESliceMaximumBitRateItem](r, enc, 1, maxnoofAllowedSNSSAIs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type FiveGProSeAuthorized struct { + FiveGProSeDirectDiscovery *FiveGProSeDirectDiscovery `per:",optional"` + FiveGProSeDirectCommunication *FiveGProSeDirectCommunication `per:",optional"` + FiveGProSeLayer2UEtoNetworkRelay *FiveGProSeLayer2UEtoNetworkRelay `per:",optional"` + FiveGProSeLayer3UEtoNetworkRelay *FiveGProSeLayer3UEtoNetworkRelay `per:",optional"` + FiveGProSeLayer2RemoteUE *FiveGProSeLayer2RemoteUE `per:",optional"` + FiveGProSeLayer2Multipath *FiveGProSeLayer2Multipath `per:",extie:IDFiveGProSeLayer2Multipath,crit:ignore"` + FiveGProSeLayer2UEtoUERelay *FiveGProSeLayer2UEtoUERelay `per:",extie:IDFiveGProSeLayer2UEtoUERelay,crit:ignore"` + FiveGProSeLayer2UEtoUERemote *FiveGProSeLayer2UEtoUERemote `per:",extie:IDFiveGProSeLayer2UEtoUERemote,crit:ignore"` + FiveGProSeLayer2MHUEtoNetworkRelay *FiveGProSeLayer2MHUEtoNetworkRelay `per:",extie:IDFiveGProSeLayer2MHUEtoNetworkRelay,crit:ignore"` + FiveGProSeLayer2MHIntermediateUEtoNetworkRelay *FiveGProSeLayer2MHIntermediateUEtoNetworkRelay `per:",extie:IDFiveGProSeLayer2MHIntermediateUEtoNetworkRelay,crit:ignore"` + FiveGProSeLayer2MHRemote *FiveGProSeLayer2MHRemote `per:",extie:IDFiveGProSeLayer2MHRemote,crit:ignore"` + FiveGProSeLayer3MHUEtoNetworkRelay *FiveGProSeLayer3MHUEtoNetworkRelay `per:",extie:IDFiveGProSeLayer3MHUEtoNetworkRelay,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type FiveGProSePC5QoSParameters struct { + FiveGProSepc5QoSFlowList FiveGProSePC5QoSFlowList + FiveGProSepc5LinkAggregateBitRates *BitRate `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AerialUEsubscriptionInformation uint8 + +const ( + AerialUEsubscriptionInformationAllowed AerialUEsubscriptionInformation = iota + AerialUEsubscriptionInformationNotAllowed +) + +type NRA2XServicesAuthorizedAerialUE uint8 + +const ( + NRA2XServicesAuthorizedAerialUEAuthorized NRA2XServicesAuthorizedAerialUE = iota + NRA2XServicesAuthorizedAerialUENotAuthorized +) + +type NRA2XServicesAuthorizedAerialControllerUE uint8 + +const ( + NRA2XServicesAuthorizedAerialControllerUEAuthorized NRA2XServicesAuthorizedAerialControllerUE = iota + NRA2XServicesAuthorizedAerialControllerUENotAuthorized +) + +type NRA2XServicesAuthorized struct { + AerialUE *NRA2XServicesAuthorizedAerialUE `per:",optional"` + AerialControllerUE *NRA2XServicesAuthorizedAerialControllerUE `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LTEA2XServicesAuthorizedAerialUE uint8 + +const ( + LTEA2XServicesAuthorizedAerialUEAuthorized LTEA2XServicesAuthorizedAerialUE = iota + LTEA2XServicesAuthorizedAerialUENotAuthorized +) + +type LTEA2XServicesAuthorizedAerialControllerUE uint8 + +const ( + LTEA2XServicesAuthorizedAerialControllerUEAuthorized LTEA2XServicesAuthorizedAerialControllerUE = iota + LTEA2XServicesAuthorizedAerialControllerUENotAuthorized +) + +type LTEA2XServicesAuthorized struct { + AerialUE *LTEA2XServicesAuthorizedAerialUE `per:",optional"` + AerialControllerUE *LTEA2XServicesAuthorizedAerialControllerUE `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type A2XPC5QoSParameters struct { + A2XPC5QoSFlowList A2XPC5QoSFlowList + A2XPC5LinkAggregateBitRates *BitRate `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MobileIABAuthorized uint8 + +const ( + MobileIABAuthorizedAuthorized MobileIABAuthorized = iota + MobileIABAuthorizedNotAuthorized +) + +type NoPDUSessionIndication uint8 + +const ( + NoPDUSessionIndicationTrue NoPDUSessionIndication = iota +) + +type SLPositioningRangingServiceInfo struct { + SLPositioningRangingAuthorized SLPositioningRangingAuthorized + SLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NPNAccessInformation struct { + PNINPNAccessInformation *CellCAGList `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type RedCapIndication uint8 + +const ( + RedCapIndicationRedcap RedCapIndication = iota +) + +type ERedCapIndication uint8 + +const ( + ERedCapIndicationTrue ERedCapIndication = iota +) + +type EmergencyFallbackIndicator struct { + EmergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator + EmergencyServiceTargetCN *EmergencyServiceTargetCN `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RGLevelWirelineAccessCharacteristics []byte + +func (v RGLevelWirelineAccessCharacteristics) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *RGLevelWirelineAccessCharacteristics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type TargetNSSAIInformation struct { + TargetNSSAI TargetNSSAI + IndexToRFSP IndexToRFSP + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NetworkControlledRepeaterAuthorized uint8 + +const ( + NetworkControlledRepeaterAuthorizedAuthorized NetworkControlledRepeaterAuthorized = iota + NetworkControlledRepeaterAuthorizedNotAuthorized +) + +type IABNodeIndication uint8 + +const ( + IABNodeIndicationTrue IABNodeIndication = iota +) + +type CEmodeBSupportIndicator uint8 + +const ( + CEmodeBSupportIndicatorSupported CEmodeBSupportIndicator = iota +) + +type LTEMIndication uint8 + +const ( + LTEMIndicationLteM LTEMIndication = iota +) + +type EDTSession uint8 + +const ( + EDTSessionTrue EDTSession = iota +) + +type AuthenticatedIndication uint8 + +const ( + AuthenticatedIndicationTrue AuthenticatedIndication = iota +) + +type MobileIABNodeIndication uint8 + +const ( + MobileIABNodeIndicationTrue MobileIABNodeIndication = iota +) + +type AUN3DeviceAccessInfoAUN3DeviceAccess uint8 + +const ( + AUN3DeviceAccessInfoAUN3DeviceAccessTrue AUN3DeviceAccessInfoAUN3DeviceAccess = iota +) + +type AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation uint8 + +const ( + AUN3DeviceAccessInfoExistingNGConnectionwithSameLocationTrue AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation = iota + AUN3DeviceAccessInfoExistingNGConnectionwithSameLocationFalse +) + +type AUN3DeviceAccessInfo struct { + AUN3DeviceAccess AUN3DeviceAccessInfoAUN3DeviceAccess + ExistingNGConnectionwithSameLocation AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RANPagingPriority uint16 + +func (v RANPagingPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 256, HasUB: true}, int64(v)) +} + +func (v *RANPagingPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 256, HasUB: true}) + if err != nil { + return err + } + + *v = RANPagingPriority(n) + + return nil +} + +type UECapabilityInfoRequest uint8 + +const ( + UECapabilityInfoRequestRequested UECapabilityInfoRequest = iota +) + +type EndIndication uint8 + +const ( + EndIndicationNoFurtherData EndIndication = iota + EndIndicationFurtherDataExists +) + +type NBIoTDefaultPagingDRX uint8 + +const ( + NBIoTDefaultPagingDRXRf128 NBIoTDefaultPagingDRX = iota + NBIoTDefaultPagingDRXRf256 + NBIoTDefaultPagingDRXRf512 + NBIoTDefaultPagingDRXRf1024 +) + +type ExtendedRANNodeName struct { + RANNodeNameVisibleString *RANNodeNameVisibleString `per:",optional"` + RANNodeNameUTF8String *RANNodeNameUTF8String `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AIoTSupport uint8 + +const ( + AIoTSupportAIoTOnly AIoTSupport = iota + AIoTSupportAIoTAndNRUu +) + +type IABSupported uint8 + +const ( + IABSupportedTrue IABSupported = iota +) + +type MobileIABSupported uint8 + +const ( + MobileIABSupportedTrue MobileIABSupported = iota +) + +type AIOTFIdentifier []byte + +func (v AIOTFIdentifier) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 16, 36, true, true, true, v) +} + +func (v *AIOTFIdentifier) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 16, 36, true, true, true) + if err != nil { + return err + } + + *v = b + + return nil +} + +type AIOTFName struct { + AIOTFNameVisibleString *AIOTFNameVisibleString `per:",optional"` + AIOTFNameUTF8String *AIOTFNameUTF8String `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AssistanceDataForPaging struct { + AssistanceDataForRecommendedCells *AssistanceDataForRecommendedCells `per:",optional"` + PagingAttemptInformation *PagingAttemptInformation `per:",optional"` + NPNPagingAssistanceInformation *NPNPagingAssistanceInformation `per:",extie:IDNPNPagingAssistanceInformation,crit:ignore"` + PagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE `per:",extie:IDPagingAssisDataforCEcapabUE,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NBIoTPagingeDRXInfo struct { + NBIoTPagingeDRXCycle NBIoTPagingeDRXCycle + NBIoTPagingTimeWindow *NBIoTPagingTimeWindow `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NBIoTPagingDRX uint8 + +const ( + NBIoTPagingDRXRf32 NBIoTPagingDRX = iota + NBIoTPagingDRXRf64 + NBIoTPagingDRXRf128 + NBIoTPagingDRXRf256 + NBIoTPagingDRXRf512 + NBIoTPagingDRXRf1024 +) + +type WUSAssistanceInformation struct { + PagingProbabilityInformation PagingProbabilityInformation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EUTRAPagingeDRXInformation struct { + EUTRApagingeDRXCycle EUTRAPagingeDRXCycle + EUTRApagingTimeWindow *EUTRAPagingTimeWindow `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRPagingeDRXInformation struct { + NRpagingeDRXCycle NRPagingeDRXCycle + NRpagingTimeWindow *NRPagingTimeWindow `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PagingCause uint8 + +const ( + PagingCauseVoice PagingCause = iota +) + +type PEIPSassistanceInformation struct { + CNsubgroupID CNsubgroupID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LPWUSPSAssistanceInformation struct { + LPWUScNsubgroupID LPWUSCNsubgroupID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LPWUSDisableIndication uint8 + +const ( + LPWUSDisableIndicationTrue LPWUSDisableIndication = iota +) + +type MDTPLMNModificationList []PLMNIdentity + +func (l MDTPLMNModificationList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 0, maxnoofMDTPLMNs, []PLMNIdentity(l)) +} + +func (l *MDTPLMNModificationList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PLMNIdentity](r, enc, 0, maxnoofMDTPLMNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSSessionSetuporModifyRequestList []MBSSessionSetuporModifyRequestItem + +func (l MBSSessionSetuporModifyRequestList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSSessions, []MBSSessionSetuporModifyRequestItem(l)) +} + +func (l *MBSSessionSetuporModifyRequestList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSSessionSetuporModifyRequestItem](r, enc, 1, maxnoofMBSSessions) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSSessionToReleaseList []MBSSessionToReleaseItem + +func (l MBSSessionToReleaseList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSSessions, []MBSSessionToReleaseItem(l)) +} + +func (l *MBSSessionToReleaseList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSSessionToReleaseItem](r, enc, 1, maxnoofMBSSessions) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSSessionSetupRequestList []MBSSessionSetupRequestItem + +func (l MBSSessionSetupRequestList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSSessions, []MBSSessionSetupRequestItem(l)) +} + +func (l *MBSSessionSetupRequestList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[MBSSessionSetupRequestItem](r, enc, 1, maxnoofMBSSessions) + if err != nil { + return err + } + + *l = items + + return nil +} + +type QMCDeactivation struct { + QoEReferenceList QoEReferenceList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RRCState uint8 + +const ( + RRCStateInactive RRCState = iota + RRCStateConnected +) + +type InfoOnRecommendedCellsAndRANNodesForPaging struct { + RecommendedCellsForPaging RecommendedCellsForPaging + RecommendRANNodesForPaging RecommendedRANNodesForPaging + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PagingAssisDataforCEcapabUE struct { + EUTRACGI EUTRACGI + CoverageEnhancementLevel CoverageEnhancementLevel + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type XrDeviceWith2Rx uint8 + +const ( + XrDeviceWith2RxTrue XrDeviceWith2Rx = iota +) + +type IntersystemSONTransferType struct { + FromEUTRANtoNGRAN *FromEUTRANtoNGRAN `per:",choice:0"` + FromNGRANtoEUTRAN *FromNGRANtoEUTRAN `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type IntersystemSONInformation struct { + IntersystemSONInformationReport *IntersystemSONInformationReport `per:",choice:0"` + IntersystemSONInformationRequest *IntersystemSONInformationRequest `per:",choice:1,extie:IDIntersystemSONInformationRequest,crit:ignore"` + IntersystemSONInformationReply *IntersystemSONInformationReply `per:",choice:1,extie:IDIntersystemSONInformationReply,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} + +type UEIdentityIndexValueIndexLength10 uint16 + +func (v UEIdentityIndexValueIndexLength10) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 10) +} + +func (v *UEIdentityIndexValueIndexLength10) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 10) + if err != nil { + return err + } + + *v = UEIdentityIndexValueIndexLength10(n) + + return nil +} + +type UEIdentityIndexValue struct { + IndexLength10 *UEIdentityIndexValueIndexLength10 `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type PeriodicRegistrationUpdateTimer uint8 + +func (v PeriodicRegistrationUpdateTimer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 8) +} + +func (v *PeriodicRegistrationUpdateTimer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 8) + if err != nil { + return err + } + + *v = PeriodicRegistrationUpdateTimer(n) + + return nil +} + +type MICOModeIndication uint8 + +const ( + MICOModeIndicationTrue MICOModeIndication = iota +) + +type TAIListForInactive []TAIListForInactiveItem + +func (l TAIListForInactive) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforInactive, []TAIListForInactiveItem(l)) +} + +func (l *TAIListForInactive) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAIListForInactiveItem](r, enc, 1, maxnoofTAIforInactive) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ExpectedUEBehaviour struct { + ExpectedUEActivityBehaviour *ExpectedUEActivityBehaviour `per:",optional"` + ExpectedHOInterval *ExpectedHOInterval `per:",optional"` + ExpectedUEMobility *ExpectedUEMobility `per:",optional"` + ExpectedUEMovingTrajectory ExpectedUEMovingTrajectory `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExtendedUEIdentityIndexValue uint16 + +func (v ExtendedUEIdentityIndexValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 16) +} + +func (v *ExtendedUEIdentityIndexValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 16) + if err != nil { + return err + } + + *v = ExtendedUEIdentityIndexValue(n) + + return nil +} + +type MicoAllPLMN uint8 + +const ( + MicoAllPLMNTrue MicoAllPLMN = iota +) + +type PagingCauseIndicationForVoiceService uint8 + +const ( + PagingCauseIndicationForVoiceServiceSupported PagingCauseIndicationForVoiceService = iota +) + +type HashedUEIdentityIndexValue struct{ BitString } + +func (v HashedUEIdentityIndexValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 13, 13) +} + +func (v *HashedUEIdentityIndexValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 13, 13) + if err != nil { + return err + } + + *v = HashedUEIdentityIndexValue{b} + + return nil +} + +type CNMTCommunicationHandling uint8 + +const ( + CNMTCommunicationHandlingSupported CNMTCommunicationHandling = iota +) + +type FurtherExtendedUEIdentityIndexValue uint32 + +func (v FurtherExtendedUEIdentityIndexValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 20) +} + +func (v *FurtherExtendedUEIdentityIndexValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 20) + if err != nil { + return err + } + + *v = FurtherExtendedUEIdentityIndexValue(n) + + return nil +} + +type ScheduledCommunicationTimeDayofWeek uint8 + +func (v ScheduledCommunicationTimeDayofWeek) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 7) +} + +func (v *ScheduledCommunicationTimeDayofWeek) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 7) + if err != nil { + return err + } + + *v = ScheduledCommunicationTimeDayofWeek(n) + + return nil +} + +type ScheduledCommunicationTimeTimeofDayStart int64 + +func (v ScheduledCommunicationTimeTimeofDayStart) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ScheduledCommunicationTimeTimeofDayStart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ScheduledCommunicationTimeTimeofDayStart(n) + + return nil +} + +func (v ScheduledCommunicationTimeTimeofDayStart) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 86399) +} + +type ScheduledCommunicationTimeTimeofDayEnd int64 + +func (v ScheduledCommunicationTimeTimeofDayEnd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ScheduledCommunicationTimeTimeofDayEnd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ScheduledCommunicationTimeTimeofDayEnd(n) + + return nil +} + +func (v ScheduledCommunicationTimeTimeofDayEnd) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 86399) +} + +type ScheduledCommunicationTime struct { + DayofWeek *ScheduledCommunicationTimeDayofWeek `per:",optional"` + TimeofDayStart *ScheduledCommunicationTimeTimeofDayStart `per:",optional"` + TimeofDayEnd *ScheduledCommunicationTimeTimeofDayEnd `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type VehicleUE uint8 + +const ( + VehicleUEAuthorized VehicleUE = iota + VehicleUENotAuthorized +) + +type PedestrianUE uint8 + +const ( + PedestrianUEAuthorized PedestrianUE = iota + PedestrianUENotAuthorized +) + +type PC5QoSFlowList []PC5QoSFlowItem + +func (l PC5QoSFlowList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPC5QoSFlows, []PC5QoSFlowItem(l)) +} + +func (l *PC5QoSFlowList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PC5QoSFlowItem](r, enc, 1, maxnoofPC5QoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ClockQualityReportingControlInfo struct { + ClockQualityDetailLevel ClockQualityDetailLevel + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UESliceMaximumBitRateItem struct { + SNSSAI SNSSAI + UESliceMaximumBitRateDL BitRate + UESliceMaximumBitRateUL BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type FiveGProSeDirectDiscovery uint8 + +const ( + FiveGProSeDirectDiscoveryAuthorized FiveGProSeDirectDiscovery = iota + FiveGProSeDirectDiscoveryNotAuthorized +) + +type FiveGProSeDirectCommunication uint8 + +const ( + FiveGProSeDirectCommunicationAuthorized FiveGProSeDirectCommunication = iota + FiveGProSeDirectCommunicationNotAuthorized +) + +type FiveGProSeLayer2UEtoNetworkRelay uint8 + +const ( + FiveGProSeLayer2UEtoNetworkRelayAuthorized FiveGProSeLayer2UEtoNetworkRelay = iota + FiveGProSeLayer2UEtoNetworkRelayNotAuthorized +) + +type FiveGProSeLayer3UEtoNetworkRelay uint8 + +const ( + FiveGProSeLayer3UEtoNetworkRelayAuthorized FiveGProSeLayer3UEtoNetworkRelay = iota + FiveGProSeLayer3UEtoNetworkRelayNotAuthorized +) + +type FiveGProSeLayer2RemoteUE uint8 + +const ( + FiveGProSeLayer2RemoteUEAuthorized FiveGProSeLayer2RemoteUE = iota + FiveGProSeLayer2RemoteUENotAuthorized +) + +type FiveGProSeLayer2Multipath uint8 + +const ( + FiveGProSeLayer2MultipathAuthorized FiveGProSeLayer2Multipath = iota + FiveGProSeLayer2MultipathNotAuthorized +) + +type FiveGProSeLayer2UEtoUERelay uint8 + +const ( + FiveGProSeLayer2UEtoUERelayAuthorized FiveGProSeLayer2UEtoUERelay = iota + FiveGProSeLayer2UEtoUERelayNotAuthorized +) + +type FiveGProSeLayer2UEtoUERemote uint8 + +const ( + FiveGProSeLayer2UEtoUERemoteAuthorized FiveGProSeLayer2UEtoUERemote = iota + FiveGProSeLayer2UEtoUERemoteNotAuthorized +) + +type FiveGProSeLayer2MHUEtoNetworkRelay uint8 + +const ( + FiveGProSeLayer2MHUEtoNetworkRelayAuthorized FiveGProSeLayer2MHUEtoNetworkRelay = iota + FiveGProSeLayer2MHUEtoNetworkRelayNotAuthorized +) + +type FiveGProSeLayer2MHIntermediateUEtoNetworkRelay uint8 + +const ( + FiveGProSeLayer2MHIntermediateUEtoNetworkRelayAuthorized FiveGProSeLayer2MHIntermediateUEtoNetworkRelay = iota + FiveGProSeLayer2MHIntermediateUEtoNetworkRelayNotAuthorized +) + +type FiveGProSeLayer2MHRemote uint8 + +const ( + FiveGProSeLayer2MHRemoteAuthorized FiveGProSeLayer2MHRemote = iota + FiveGProSeLayer2MHRemoteNotAuthorized +) + +type FiveGProSeLayer3MHUEtoNetworkRelay uint8 + +const ( + FiveGProSeLayer3MHUEtoNetworkRelayAuthorized FiveGProSeLayer3MHUEtoNetworkRelay = iota + FiveGProSeLayer3MHUEtoNetworkRelayNotAuthorized +) + +type FiveGProSePC5QoSFlowList []FiveGProSePC5QoSFlowItem + +func (l FiveGProSePC5QoSFlowList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPC5QoSFlows, []FiveGProSePC5QoSFlowItem(l)) +} + +func (l *FiveGProSePC5QoSFlowList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[FiveGProSePC5QoSFlowItem](r, enc, 1, maxnoofPC5QoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type A2XPC5QoSFlowList []A2XPC5QoSFlowItem + +func (l A2XPC5QoSFlowList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPC5QoSFlows, []A2XPC5QoSFlowItem(l)) +} + +func (l *A2XPC5QoSFlowList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[A2XPC5QoSFlowItem](r, enc, 1, maxnoofPC5QoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SLPositioningRangingAuthorized uint8 + +const ( + SLPositioningRangingAuthorizedAuthorized SLPositioningRangingAuthorized = iota + SLPositioningRangingAuthorizedNotAuthorized +) + +type SLPositioningRangingQoSParameters struct { + RSPPQoSFlowList RSPPQoSFlowList + RSPPLinkAggregateBitRates *BitRate `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CellCAGList []CAGID + +func (l CellCAGList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCAGSperCell, []CAGID(l)) +} + +func (l *CellCAGList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CAGID](r, enc, 1, maxnoofCAGSperCell) + if err != nil { + return err + } + + *l = items + + return nil +} + +type EmergencyFallbackRequestIndicator uint8 + +const ( + EmergencyFallbackRequestIndicatorEmergencyFallbackRequested EmergencyFallbackRequestIndicator = iota +) + +type EmergencyServiceTargetCN uint8 + +const ( + EmergencyServiceTargetCNFiveGC EmergencyServiceTargetCN = iota + EmergencyServiceTargetCNEPC +) + +type TargetNSSAI []TargetNSSAIItem + +func (l TargetNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTargetSNSSAIs, []TargetNSSAIItem(l)) +} + +func (l *TargetNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TargetNSSAIItem](r, enc, 1, maxnoofTargetSNSSAIs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type RANNodeNameVisibleString string + +func (v RANNodeNameVisibleString) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeKnownMultiplierString(w, enc, per.CharVisibleString, 1, 150, true, true, true, string(v)) +} + +func (v *RANNodeNameVisibleString) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeKnownMultiplierString(r, enc, per.CharVisibleString, 1, 150, true, true, true) + if err != nil { + return err + } + + *v = RANNodeNameVisibleString(b) + + return nil +} + +type RANNodeNameUTF8String string + +func (v RANNodeNameUTF8String) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeString(w, enc, []byte(v)) +} + +func (v *RANNodeNameUTF8String) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeString(r, enc) + if err != nil { + return err + } + + *v = RANNodeNameUTF8String(string(b)) + + return nil +} + +type AIOTFNameVisibleString string + +func (v AIOTFNameVisibleString) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeKnownMultiplierString(w, enc, per.CharVisibleString, 1, 150, true, true, true, string(v)) +} + +func (v *AIOTFNameVisibleString) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeKnownMultiplierString(r, enc, per.CharVisibleString, 1, 150, true, true, true) + if err != nil { + return err + } + + *v = AIOTFNameVisibleString(b) + + return nil +} + +type AIOTFNameUTF8String string + +func (v AIOTFNameUTF8String) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeString(w, enc, []byte(v)) +} + +func (v *AIOTFNameUTF8String) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeString(r, enc) + if err != nil { + return err + } + + *v = AIOTFNameUTF8String(string(b)) + + return nil +} + +type AssistanceDataForRecommendedCells struct { + RecommendedCellsForPaging RecommendedCellsForPaging + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PagingAttemptInformation struct { + PagingAttemptCount PagingAttemptCount + IntendedNumberOfPagingAttempts IntendedNumberOfPagingAttempts + NextPagingAreaScope *NextPagingAreaScope `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NPNPagingAssistanceInformation struct { + PNINPNPagingAssistance *AllowedPNINPNList `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type NBIoTPagingeDRXCycle uint8 + +const ( + NBIoTPagingeDRXCycleHf2 NBIoTPagingeDRXCycle = iota + NBIoTPagingeDRXCycleHf4 + NBIoTPagingeDRXCycleHf6 + NBIoTPagingeDRXCycleHf8 + NBIoTPagingeDRXCycleHf10 + NBIoTPagingeDRXCycleHf12 + NBIoTPagingeDRXCycleHf14 + NBIoTPagingeDRXCycleHf16 + NBIoTPagingeDRXCycleHf32 + NBIoTPagingeDRXCycleHf64 + NBIoTPagingeDRXCycleHf128 + NBIoTPagingeDRXCycleHf256 + NBIoTPagingeDRXCycleHf512 + NBIoTPagingeDRXCycleHf1024 +) + +type NBIoTPagingTimeWindow uint8 + +const ( + NBIoTPagingTimeWindowS1 NBIoTPagingTimeWindow = iota + NBIoTPagingTimeWindowS2 + NBIoTPagingTimeWindowS3 + NBIoTPagingTimeWindowS4 + NBIoTPagingTimeWindowS5 + NBIoTPagingTimeWindowS6 + NBIoTPagingTimeWindowS7 + NBIoTPagingTimeWindowS8 + NBIoTPagingTimeWindowS9 + NBIoTPagingTimeWindowS10 + NBIoTPagingTimeWindowS11 + NBIoTPagingTimeWindowS12 + NBIoTPagingTimeWindowS13 + NBIoTPagingTimeWindowS14 + NBIoTPagingTimeWindowS15 + NBIoTPagingTimeWindowS16 +) + +type PagingProbabilityInformation uint8 + +const ( + PagingProbabilityInformationP00 PagingProbabilityInformation = iota + PagingProbabilityInformationP05 + PagingProbabilityInformationP10 + PagingProbabilityInformationP15 + PagingProbabilityInformationP20 + PagingProbabilityInformationP25 + PagingProbabilityInformationP30 + PagingProbabilityInformationP35 + PagingProbabilityInformationP40 + PagingProbabilityInformationP45 + PagingProbabilityInformationP50 + PagingProbabilityInformationP55 + PagingProbabilityInformationP60 + PagingProbabilityInformationP65 + PagingProbabilityInformationP70 + PagingProbabilityInformationP75 + PagingProbabilityInformationP80 + PagingProbabilityInformationP85 + PagingProbabilityInformationP90 + PagingProbabilityInformationP95 + PagingProbabilityInformationP100 +) + +type EUTRAPagingeDRXCycle uint8 + +const ( + EUTRAPagingeDRXCycleHfhalf EUTRAPagingeDRXCycle = iota + EUTRAPagingeDRXCycleHf1 + EUTRAPagingeDRXCycleHf2 + EUTRAPagingeDRXCycleHf4 + EUTRAPagingeDRXCycleHf6 + EUTRAPagingeDRXCycleHf8 + EUTRAPagingeDRXCycleHf10 + EUTRAPagingeDRXCycleHf12 + EUTRAPagingeDRXCycleHf14 + EUTRAPagingeDRXCycleHf16 + EUTRAPagingeDRXCycleHf32 + EUTRAPagingeDRXCycleHf64 + EUTRAPagingeDRXCycleHf128 + EUTRAPagingeDRXCycleHf256 +) + +type EUTRAPagingTimeWindow uint8 + +const ( + EUTRAPagingTimeWindowS1 EUTRAPagingTimeWindow = iota + EUTRAPagingTimeWindowS2 + EUTRAPagingTimeWindowS3 + EUTRAPagingTimeWindowS4 + EUTRAPagingTimeWindowS5 + EUTRAPagingTimeWindowS6 + EUTRAPagingTimeWindowS7 + EUTRAPagingTimeWindowS8 + EUTRAPagingTimeWindowS9 + EUTRAPagingTimeWindowS10 + EUTRAPagingTimeWindowS11 + EUTRAPagingTimeWindowS12 + EUTRAPagingTimeWindowS13 + EUTRAPagingTimeWindowS14 + EUTRAPagingTimeWindowS15 + EUTRAPagingTimeWindowS16 +) + +type NRPagingeDRXCycle uint8 + +const ( + NRPagingeDRXCycleHfquarter NRPagingeDRXCycle = iota + NRPagingeDRXCycleHfhalf + NRPagingeDRXCycleHf1 + NRPagingeDRXCycleHf2 + NRPagingeDRXCycleHf4 + NRPagingeDRXCycleHf8 + NRPagingeDRXCycleHf16 + NRPagingeDRXCycleHf32 + NRPagingeDRXCycleHf64 + NRPagingeDRXCycleHf128 + NRPagingeDRXCycleHf256 + NRPagingeDRXCycleHf512 + NRPagingeDRXCycleHf1024 +) + +type NRPagingTimeWindow uint8 + +const ( + NRPagingTimeWindowS1 NRPagingTimeWindow = iota + NRPagingTimeWindowS2 + NRPagingTimeWindowS3 + NRPagingTimeWindowS4 + NRPagingTimeWindowS5 + NRPagingTimeWindowS6 + NRPagingTimeWindowS7 + NRPagingTimeWindowS8 + NRPagingTimeWindowS9 + NRPagingTimeWindowS10 + NRPagingTimeWindowS11 + NRPagingTimeWindowS12 + NRPagingTimeWindowS13 + NRPagingTimeWindowS14 + NRPagingTimeWindowS15 + NRPagingTimeWindowS16 + NRPagingTimeWindowS17 + NRPagingTimeWindowS18 + NRPagingTimeWindowS19 + NRPagingTimeWindowS20 + NRPagingTimeWindowS21 + NRPagingTimeWindowS22 + NRPagingTimeWindowS23 + NRPagingTimeWindowS24 + NRPagingTimeWindowS25 + NRPagingTimeWindowS26 + NRPagingTimeWindowS27 + NRPagingTimeWindowS28 + NRPagingTimeWindowS29 + NRPagingTimeWindowS30 + NRPagingTimeWindowS31 + NRPagingTimeWindowS32 +) + +type CNsubgroupID int64 + +func (v CNsubgroupID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *CNsubgroupID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = CNsubgroupID(n) + + return nil +} + +func (v CNsubgroupID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 0, 7) } + +type LPWUSCNsubgroupID int64 + +func (v LPWUSCNsubgroupID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 30, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *LPWUSCNsubgroupID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 30, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = LPWUSCNsubgroupID(n) + + return nil +} + +func (v LPWUSCNsubgroupID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 30) +} + +type MBSSessionSetuporModifyRequestItem struct { + MBSSessionID MBSSessionID + MBSAreaSessionID *MBSAreaSessionID `per:",optional"` + AssociatedMBSQosFlowSetuporModifyRequestList AssociatedMBSQosFlowSetuporModifyRequestList `per:",optional"` + MBSQosFlowToReleaseList QosFlowListWithCause `per:",optional"` + MBSAssistanceInformation *MBSAssistanceInformation `per:",extie:IDMBSAssistanceInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSSessionToReleaseItem struct { + MBSSessionID MBSSessionID + Cause Cause + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MBSSessionSetupRequestItem struct { + MBSSessionID MBSSessionID + MBSAreaSessionID *MBSAreaSessionID `per:",optional"` + AssociatedMBSQosFlowSetupRequestList AssociatedMBSQosFlowSetupRequestList `per:",optional"` + MBSAssistanceInformation *MBSAssistanceInformation `per:",extie:IDMBSAssistanceInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type QoEReferenceList []QoEReference + +func (l QoEReferenceList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofUEAppLayerMeas, []QoEReference(l)) +} + +func (l *QoEReferenceList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[QoEReference](r, enc, 1, maxnoofUEAppLayerMeas) + if err != nil { + return err + } + + *l = items + + return nil +} + +type RecommendedCellsForPaging struct { + RecommendedCellList RecommendedCellList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RecommendedRANNodesForPaging struct { + RecommendedRANNodeList RecommendedRANNodeList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CoverageEnhancementLevel []byte + +func (v CoverageEnhancementLevel) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *CoverageEnhancementLevel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type FromEUTRANtoNGRAN struct { + SourceeNBID IntersystemSONeNBID + TargetNGRANnodeID IntersystemSONNGRANnodeID + iEExtensions extensionMeta `per:",exttable"` +} + +type FromNGRANtoEUTRAN struct { + SourceNGRANnodeID IntersystemSONNGRANnodeID + TargeteNBID IntersystemSONeNBID + iEExtensions extensionMeta `per:",exttable"` +} + +type IntersystemSONInformationReport struct { + HOReportInformation *InterSystemHOReport `per:",choice:0"` + FailureIndicationInformation *InterSystemFailureIndication `per:",choice:1"` + EnergySavingIndication *IntersystemCellStateIndication `per:",choice:2,extie:IDEnergySavingIndication,crit:ignore"` + IntersystemResourceStatusUpdate *IntersystemResourceStatusReport `per:",choice:2,extie:IDIntersystemResourceStatusUpdate,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} + +type IntersystemSONInformationRequest struct { + NGRANCellActivation *IntersystemCellActivationRequest `per:",choice:0"` + ResourceStatus *IntersystemResourceStatusRequest `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type IntersystemSONInformationReply struct { + NGRANCellActivation *IntersystemCellActivationReply `per:",choice:0"` + ResourceStatus *IntersystemResourceStatusReply `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type TAIListForInactiveItem struct { + TAI TAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExpectedHOInterval uint8 + +const ( + ExpectedHOIntervalSec15 ExpectedHOInterval = iota + ExpectedHOIntervalSec30 + ExpectedHOIntervalSec60 + ExpectedHOIntervalSec90 + ExpectedHOIntervalSec120 + ExpectedHOIntervalSec180 + ExpectedHOIntervalLongTime +) + +type ExpectedUEMobility uint8 + +const ( + ExpectedUEMobilityStationary ExpectedUEMobility = iota + ExpectedUEMobilityMobile +) + +type ExpectedUEMovingTrajectory []ExpectedUEMovingTrajectoryItem + +func (l ExpectedUEMovingTrajectory) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsUEMovingTrajectory, []ExpectedUEMovingTrajectoryItem(l)) +} + +func (l *ExpectedUEMovingTrajectory) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ExpectedUEMovingTrajectoryItem](r, enc, 1, maxnoofCellsUEMovingTrajectory) + if err != nil { + return err + } + + *l = items + + return nil +} + +type PC5QoSFlowItem struct { + PQI FiveQI + Pc5FlowBitRates *PC5FlowBitRates `per:",optional"` + Range *RangeType `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ClockQualityDetailLevel struct { + ClockQualityMetrics *per.Null `per:",choice:0"` + ClockQualityAcceptanceIndication *ClockQualityAcceptanceIndication `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type FiveGProSePC5QoSFlowItem struct { + FiveGproSepQI FiveQI + FiveGproSepc5FlowBitRates *FiveGProSePC5FlowBitRates `per:",optional"` + FiveGproSerange *RangeType `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type A2XPC5QoSFlowItemA2XPQI int64 + +func (v A2XPC5QoSFlowItemA2XPQI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *A2XPC5QoSFlowItemA2XPQI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = A2XPC5QoSFlowItemA2XPQI(n) + + return nil +} + +func (v A2XPC5QoSFlowItemA2XPQI) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 255) +} + +type A2XPC5QoSFlowItemA2XRange uint8 + +const ( + A2XPC5QoSFlowItemA2XRangeM50 A2XPC5QoSFlowItemA2XRange = iota + A2XPC5QoSFlowItemA2XRangeM80 + A2XPC5QoSFlowItemA2XRangeM180 + A2XPC5QoSFlowItemA2XRangeM200 + A2XPC5QoSFlowItemA2XRangeM350 + A2XPC5QoSFlowItemA2XRangeM400 + A2XPC5QoSFlowItemA2XRangeM500 + A2XPC5QoSFlowItemA2XRangeM700 + A2XPC5QoSFlowItemA2XRangeM1000 +) + +type A2XPC5QoSFlowItem struct { + A2XPQI A2XPC5QoSFlowItemA2XPQI + A2XPC5FlowBitRates *A2XPC5FlowBitRates `per:",optional"` + A2XRange *A2XPC5QoSFlowItemA2XRange `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RSPPQoSFlowList []RSPPQoSFlowItem + +func (l RSPPQoSFlowList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofRSPPQoSFlows, []RSPPQoSFlowItem(l)) +} + +func (l *RSPPQoSFlowList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[RSPPQoSFlowItem](r, enc, 1, maxnoofRSPPQoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type TargetNSSAIItem struct { + SNSSAI SNSSAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PagingAttemptCount int64 + +func (v PagingAttemptCount) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *PagingAttemptCount) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = PagingAttemptCount(n) + + return nil +} + +func (v PagingAttemptCount) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 16) +} + +type IntendedNumberOfPagingAttempts int64 + +func (v IntendedNumberOfPagingAttempts) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *IntendedNumberOfPagingAttempts) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = IntendedNumberOfPagingAttempts(n) + + return nil +} + +func (v IntendedNumberOfPagingAttempts) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 16) +} + +type NextPagingAreaScope uint8 + +const ( + NextPagingAreaScopeSame NextPagingAreaScope = iota + NextPagingAreaScopeChanged +) + +type AssociatedMBSQosFlowSetuporModifyRequestList []AssociatedMBSQosFlowSetuporModifyRequestItem + +func (l AssociatedMBSQosFlowSetuporModifyRequestList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSQoSFlows, []AssociatedMBSQosFlowSetuporModifyRequestItem(l)) +} + +func (l *AssociatedMBSQosFlowSetuporModifyRequestList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AssociatedMBSQosFlowSetuporModifyRequestItem](r, enc, 1, maxnoofMBSQoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MBSAssistanceInformation uint8 + +const ( + MBSAssistanceInformationTrue MBSAssistanceInformation = iota +) + +type AssociatedMBSQosFlowSetupRequestList []AssociatedMBSQosFlowSetupRequestItem + +func (l AssociatedMBSQosFlowSetupRequestList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMBSQoSFlows, []AssociatedMBSQosFlowSetupRequestItem(l)) +} + +func (l *AssociatedMBSQosFlowSetupRequestList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AssociatedMBSQosFlowSetupRequestItem](r, enc, 1, maxnoofMBSQoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type RecommendedCellList []RecommendedCellItem + +func (l RecommendedCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofRecommendedCells, []RecommendedCellItem(l)) +} + +func (l *RecommendedCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[RecommendedCellItem](r, enc, 1, maxnoofRecommendedCells) + if err != nil { + return err + } + + *l = items + + return nil +} + +type RecommendedRANNodeList []RecommendedRANNodeItem + +func (l RecommendedRANNodeList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofRecommendedRANNodes, []RecommendedRANNodeItem(l)) +} + +func (l *RecommendedRANNodeList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[RecommendedRANNodeItem](r, enc, 1, maxnoofRecommendedRANNodes) + if err != nil { + return err + } + + *l = items + + return nil +} + +type IntersystemSONeNBID struct { + GlobaleNBID GlobalENBID + SelectedEPSTAI EPSTAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemSONNGRANnodeID struct { + GlobalRANNodeID GlobalRANNodeID + SelectedTAI TAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type InterSystemHOReport struct { + HandoverReportType InterSystemHandoverReportType + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type InterSystemFailureIndication struct { + UERLFReportContainer *UERLFReportContainer `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemCellStateIndication struct { + NotificationCellList NotificationCellList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemResourceStatusReport struct { + ReportingSystem ResourceStatusReportingSystem + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemCellActivationRequestActivationID int64 + +func (v IntersystemCellActivationRequestActivationID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 16384, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *IntersystemCellActivationRequestActivationID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 16384, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = IntersystemCellActivationRequestActivationID(n) + + return nil +} + +func (v IntersystemCellActivationRequestActivationID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 16384) +} + +type IntersystemCellActivationRequest struct { + ActivationID IntersystemCellActivationRequestActivationID + CellsToActivateList CellsToActivateList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemResourceStatusRequest struct { + ReportingSystem ReportingSystem + ReportCharacteristics ReportCharacteristics + ReportType ReportType + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemCellActivationReplyActivationID int64 + +func (v IntersystemCellActivationReplyActivationID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 16384, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *IntersystemCellActivationReplyActivationID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 16384, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = IntersystemCellActivationReplyActivationID(n) + + return nil +} + +func (v IntersystemCellActivationReplyActivationID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 16384) +} + +type IntersystemCellActivationReply struct { + ActivatedCellList ActivatedCellList + ActivationID IntersystemCellActivationReplyActivationID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemResourceStatusReply struct { + Reportingsystem ReportingSystem + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExpectedUEMovingTrajectoryItemTimeStayedInCell uint16 + +func (v ExpectedUEMovingTrajectoryItemTimeStayedInCell) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(v)) +} + +func (v *ExpectedUEMovingTrajectoryItemTimeStayedInCell) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + if err != nil { + return err + } + + *v = ExpectedUEMovingTrajectoryItemTimeStayedInCell(n) + + return nil +} + +type ExpectedUEMovingTrajectoryItem struct { + NGRANCGI NGRANCGI + TimeStayedInCell *ExpectedUEMovingTrajectoryItemTimeStayedInCell `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PC5FlowBitRates struct { + GuaranteedFlowBitRate BitRate + MaximumFlowBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RangeType uint8 + +const ( + RangeTypeM50 RangeType = iota + RangeTypeM80 + RangeTypeM180 + RangeTypeM200 + RangeTypeM350 + RangeTypeM400 + RangeTypeM500 + RangeTypeM700 + RangeTypeM1000 +) + +type ClockQualityAcceptanceIndication struct { + ClockQualityAcceptanceCriteria ClockQualityAcceptanceCriteria + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type FiveGProSePC5FlowBitRates struct { + FiveGproSeguaranteedFlowBitRate BitRate + FiveGproSemaximumFlowBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type A2XPC5FlowBitRates struct { + A2XGuaranteedFlowBitRate BitRate + A2XMaximumFlowBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RSPPQoSFlowItem struct { + PQI FiveQI + RSPPFlowBitRates *RSPPFlowBitRates `per:",optional"` + Range *RangeType `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AssociatedMBSQosFlowSetuporModifyRequestItem struct { + MBSQosFlowIdentifier QosFlowIdentifier + AssociatedUnicastQosFlowIdentifier QosFlowIdentifier + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AssociatedMBSQosFlowSetupRequestItem struct { + MBSQosFlowIdentifier QosFlowIdentifier + AssociatedUnicastQosFlowIdentifier QosFlowIdentifier + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RecommendedCellItemTimeStayedInCell uint16 + +func (v RecommendedCellItemTimeStayedInCell) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(v)) +} + +func (v *RecommendedCellItemTimeStayedInCell) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + if err != nil { + return err + } + + *v = RecommendedCellItemTimeStayedInCell(n) + + return nil +} + +type RecommendedCellItem struct { + NGRANCGI NGRANCGI + TimeStayedInCell *RecommendedCellItemTimeStayedInCell `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RecommendedRANNodeItem struct { + AMFPagingTarget AMFPagingTarget + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type GlobalENBID struct { + PLMNidentity PLMNIdentity + ENBID ENBID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type InterSystemHandoverReportType struct { + TooearlyIntersystemHO *TooearlyIntersystemHO `per:",choice:0"` + IntersystemUnnecessaryHO *IntersystemUnnecessaryHO `per:",choice:1"` + IntersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback `per:",choice:2,extie:IDIntersystemMobilityFailureforVoiceFallback,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} + +type UERLFReportContainer struct { + NR *NRUERLFReportContainer `per:",choice:0"` + LTE *LTEUERLFReportContainer `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type NotificationCellList []NotificationCellItem + +func (l NotificationCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsinNGRANNode, []NotificationCellItem(l)) +} + +func (l *NotificationCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NotificationCellItem](r, enc, 1, maxnoofCellsinNGRANNode) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ResourceStatusReportingSystem struct { + EUTRANReportingStatus *EUTRANReportingStatusIEs `per:",choice:0"` + NGRANReportingStatus *NGRANReportingStatusIEs `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type CellsToActivateList []NGRANCGI + +func (l CellsToActivateList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsinNGRANNode, []NGRANCGI(l)) +} + +func (l *CellsToActivateList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NGRANCGI](r, enc, 1, maxnoofCellsinNGRANNode) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ReportingSystem struct { + EUTRAN *EUTRANReportingSystemIEs `per:",choice:0"` + NGRAN *NGRANReportingSystemIEs `per:",choice:1"` + NoReporting *per.Null `per:",choice:2"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` +} + +type ReportCharacteristics uint32 + +func (v ReportCharacteristics) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 32) +} + +func (v *ReportCharacteristics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 32) + if err != nil { + return err + } + + *v = ReportCharacteristics(n) + + return nil +} + +type ReportType struct { + EventBasedReporting *EventBasedReportingIEs `per:",choice:0"` + PeriodicReporting *PeriodicReportingIEs `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type ActivatedCellList []NGRANCGI + +func (l ActivatedCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsinNGRANNode, []NGRANCGI(l)) +} + +func (l *ActivatedCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NGRANCGI](r, enc, 1, maxnoofCellsinNGRANNode) + if err != nil { + return err + } + + *l = items + + return nil +} + +type ClockQualityAcceptanceCriteriaSynchronisationState struct{ BitString } + +func (v ClockQualityAcceptanceCriteriaSynchronisationState) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 8, 8) +} + +func (v *ClockQualityAcceptanceCriteriaSynchronisationState) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 8, 8) + if err != nil { + return err + } + + *v = ClockQualityAcceptanceCriteriaSynchronisationState{b} + + return nil +} + +type ClockQualityAcceptanceCriteriaTraceabletoUTC uint8 + +const ( + ClockQualityAcceptanceCriteriaTraceabletoUTCTrue ClockQualityAcceptanceCriteriaTraceabletoUTC = iota +) + +type ClockQualityAcceptanceCriteriaTraceabletoGNSS uint8 + +const ( + ClockQualityAcceptanceCriteriaTraceabletoGNSSTrue ClockQualityAcceptanceCriteriaTraceabletoGNSS = iota +) + +type ClockQualityAcceptanceCriteriaClockFrequencyStability uint16 + +func (v ClockQualityAcceptanceCriteriaClockFrequencyStability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 16) +} + +func (v *ClockQualityAcceptanceCriteriaClockFrequencyStability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 16) + if err != nil { + return err + } + + *v = ClockQualityAcceptanceCriteriaClockFrequencyStability(n) + + return nil +} + +type ClockQualityAcceptanceCriteriaClockAccuracy int64 + +func (v ClockQualityAcceptanceCriteriaClockAccuracy) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 40000000, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ClockQualityAcceptanceCriteriaClockAccuracy) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 40000000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ClockQualityAcceptanceCriteriaClockAccuracy(n) + + return nil +} + +func (v ClockQualityAcceptanceCriteriaClockAccuracy) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 40000000) +} + +type ClockQualityAcceptanceCriteriaParentTImeSource struct{ BitString } + +func (v ClockQualityAcceptanceCriteriaParentTImeSource) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 16, 16) +} + +func (v *ClockQualityAcceptanceCriteriaParentTImeSource) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 16, 16) + if err != nil { + return err + } + + *v = ClockQualityAcceptanceCriteriaParentTImeSource{b} + + return nil +} + +type ClockQualityAcceptanceCriteria struct { + SynchronisationState *ClockQualityAcceptanceCriteriaSynchronisationState `per:",optional"` + TraceabletoUTC *ClockQualityAcceptanceCriteriaTraceabletoUTC `per:",optional"` + TraceabletoGNSS *ClockQualityAcceptanceCriteriaTraceabletoGNSS `per:",optional"` + ClockFrequencyStability *ClockQualityAcceptanceCriteriaClockFrequencyStability `per:",optional"` + ClockAccuracy *ClockQualityAcceptanceCriteriaClockAccuracy `per:",optional"` + ParentTImeSource *ClockQualityAcceptanceCriteriaParentTImeSource `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RSPPFlowBitRates struct { + GuaranteedFlowBitRate BitRate + MaximumFlowBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AMFPagingTarget struct { + GlobalRANNodeID *GlobalRANNodeID `per:",choice:0"` + TAI *TAI `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type ENBIDMacroENBID uint32 + +func (v ENBIDMacroENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 20) +} + +func (v *ENBIDMacroENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 20) + if err != nil { + return err + } + + *v = ENBIDMacroENBID(n) + + return nil +} + +type ENBIDHomeENBID uint32 + +func (v ENBIDHomeENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 28) +} + +func (v *ENBIDHomeENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 28) + if err != nil { + return err + } + + *v = ENBIDHomeENBID(n) + + return nil +} + +type ENBIDShortmacroENBID uint32 + +func (v ENBIDShortmacroENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 18) +} + +func (v *ENBIDShortmacroENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 18) + if err != nil { + return err + } + + *v = ENBIDShortmacroENBID(n) + + return nil +} + +type ENBIDLongmacroENBID uint32 + +func (v ENBIDLongmacroENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 21) +} + +func (v *ENBIDLongmacroENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 21) + if err != nil { + return err + } + + *v = ENBIDLongmacroENBID(n) + + return nil +} + +type ENBID struct { + MacroENBID *ENBIDMacroENBID `per:",choice:0"` + HomeENBID *ENBIDHomeENBID `per:",choice:1"` + ShortmacroENBID *ENBIDShortmacroENBID `per:",choice:2"` + LongmacroENBID *ENBIDLongmacroENBID `per:",choice:3"` + ChoiceExtension *SingleContainer `per:",choice:4,extie"` +} + +type TooearlyIntersystemHO struct { + SourcecellID EUTRACGI + FailurecellID NGRANCGI + UERLFReportContainer *UERLFReportContainer `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemUnnecessaryHOEarlyIRATHO uint8 + +const ( + IntersystemUnnecessaryHOEarlyIRATHOTrue IntersystemUnnecessaryHOEarlyIRATHO = iota + IntersystemUnnecessaryHOEarlyIRATHOFalse +) + +type IntersystemUnnecessaryHO struct { + SourcecellID NGRANCGI + TargetcellID EUTRACGI + EarlyIRATHO IntersystemUnnecessaryHOEarlyIRATHO + CandidateCellList CandidateCellList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemMobilityFailureforVoiceFallback struct { + SourcecellID NGRANCGI + TargetcellID EUTRACGI + ReconnectCellID *EUTRACGI `per:",optional"` + UERLFReportContainer *UERLFReportContainer `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRUERLFReportContainer []byte + +func (v NRUERLFReportContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *NRUERLFReportContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type LTEUERLFReportContainer []byte + +func (v LTEUERLFReportContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *LTEUERLFReportContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type NotificationCellItemNotifyFlag uint8 + +const ( + NotificationCellItemNotifyFlagActivated NotificationCellItemNotifyFlag = iota + NotificationCellItemNotifyFlagDeactivated +) + +type NotificationCellItem struct { + NGRANCGI NGRANCGI + NotifyFlag NotificationCellItemNotifyFlag + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EUTRANReportingStatusIEs struct { + EUTRANCellReportList EUTRANCellReportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NGRANReportingStatusIEs struct { + NGRANCellReportList NGRANCellReportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EUTRANReportingSystemIEs struct { + EUTRANCellToReportList EUTRANCellToReportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NGRANReportingSystemIEs struct { + NGRANCellToReportList NGRANCellToReportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EventBasedReportingIEs struct { + IntersystemResourceThresholdLow IntersystemResourceThreshold + IntersystemResourceThresholdHigh IntersystemResourceThreshold + NumberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PeriodicReportingIEs struct { + ReportingPeriodicity ReportingPeriodicity + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CandidateCellList []CandidateCellItem + +func (l CandidateCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCandidateCells, []CandidateCellItem(l)) +} + +func (l *CandidateCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CandidateCellItem](r, enc, 1, maxnoofCandidateCells) + if err != nil { + return err + } + + *l = items + + return nil +} + +type EUTRANCellReportList []EUTRANCellReportItem + +func (l EUTRANCellReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofReportedCells, []EUTRANCellReportItem(l)) +} + +func (l *EUTRANCellReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EUTRANCellReportItem](r, enc, 1, maxnoofReportedCells) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NGRANCellReportList []NGRANCellReportItem + +func (l NGRANCellReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofReportedCells, []NGRANCellReportItem(l)) +} + +func (l *NGRANCellReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NGRANCellReportItem](r, enc, 1, maxnoofReportedCells) + if err != nil { + return err + } + + *l = items + + return nil +} + +type EUTRANCellToReportList []EUTRANCellToReportItem + +func (l EUTRANCellToReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofReportedCells, []EUTRANCellToReportItem(l)) +} + +func (l *EUTRANCellToReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EUTRANCellToReportItem](r, enc, 1, maxnoofReportedCells) + if err != nil { + return err + } + + *l = items + + return nil +} + +type NGRANCellToReportList []NGRANCellToReportItem + +func (l NGRANCellToReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofReportedCells, []NGRANCellToReportItem(l)) +} + +func (l *NGRANCellToReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NGRANCellToReportItem](r, enc, 1, maxnoofReportedCells) + if err != nil { + return err + } + + *l = items + + return nil +} + +type IntersystemResourceThreshold uint8 + +func (v IntersystemResourceThreshold) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *IntersystemResourceThreshold) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = IntersystemResourceThreshold(n) + + return nil +} + +type NumberOfMeasurementReportingLevels uint8 + +const ( + NumberOfMeasurementReportingLevelsN2 NumberOfMeasurementReportingLevels = iota + NumberOfMeasurementReportingLevelsN3 + NumberOfMeasurementReportingLevelsN4 + NumberOfMeasurementReportingLevelsN5 + NumberOfMeasurementReportingLevelsN10 + NumberOfMeasurementReportingLevelsN0 +) + +type ReportingPeriodicity uint8 + +const ( + ReportingPeriodicityStop ReportingPeriodicity = iota + ReportingPeriodicitySingle + ReportingPeriodicityMs1000 + ReportingPeriodicityMs2000 + ReportingPeriodicityMs5000 + ReportingPeriodicityMs10000 +) + +type CandidateCellItem struct { + CandidateCell CandidateCell + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EUTRANCellReportItem struct { + ECGI EUTRACGI + EUTRANCompositeAvailableCapacityGroup EUTRANCompositeAvailableCapacityGroup + EUTRANNumberOfActiveUEs *EUTRANNumberOfActiveUEs `per:",optional"` + EUTRANNoofRRCConnections *NGRANNoofRRCConnections `per:",optional"` + EUTRANRadioResourceStatus *EUTRANRadioResourceStatus `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NGRANCellReportItem struct { + NGRANCGI NGRANCGI + NGRANCompositeAvailableCapacityGroup EUTRANCompositeAvailableCapacityGroup + NGRANNumberOfActiveUEs *NGRANNumberOfActiveUEs `per:",optional"` + NGRANNoofRRCConnections *NGRANNoofRRCConnections `per:",optional"` + NGRANRadioResourceStatus *NGRANRadioResourceStatus `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EUTRANCellToReportItem struct { + ECGI EUTRACGI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NGRANCellToReportItem struct { + NGRANCGI NGRANCGI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CandidateCell struct { + CandidateCGI *CandidateCellID `per:",choice:0"` + CandidatePCI *CandidatePCI `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type EUTRANCompositeAvailableCapacityGroup struct { + DLCompositeAvailableCapacity CompositeAvailableCapacity + ULCompositeAvailableCapacity CompositeAvailableCapacity + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EUTRANNumberOfActiveUEs int64 + +func (v EUTRANNumberOfActiveUEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 16777215, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *EUTRANNumberOfActiveUEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 16777215, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = EUTRANNumberOfActiveUEs(n) + + return nil +} + +func (v EUTRANNumberOfActiveUEs) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 16777215) +} + +type NGRANNoofRRCConnections int64 + +func (v NGRANNoofRRCConnections) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 65536, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *NGRANNoofRRCConnections) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 65536, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = NGRANNoofRRCConnections(n) + + return nil +} + +func (v NGRANNoofRRCConnections) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 65536) +} + +type EUTRANRadioResourceStatusDLGBRPRBusage uint8 + +func (v EUTRANRadioResourceStatusDLGBRPRBusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusDLGBRPRBusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusDLGBRPRBusage(n) + + return nil +} + +type EUTRANRadioResourceStatusULGBRPRBusage uint8 + +func (v EUTRANRadioResourceStatusULGBRPRBusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusULGBRPRBusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusULGBRPRBusage(n) + + return nil +} + +type EUTRANRadioResourceStatusDLnonGBRPRBusage uint8 + +func (v EUTRANRadioResourceStatusDLnonGBRPRBusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusDLnonGBRPRBusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusDLnonGBRPRBusage(n) + + return nil +} + +type EUTRANRadioResourceStatusULnonGBRPRBusage uint8 + +func (v EUTRANRadioResourceStatusULnonGBRPRBusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusULnonGBRPRBusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusULnonGBRPRBusage(n) + + return nil +} + +type EUTRANRadioResourceStatusDLTotalPRBusage uint8 + +func (v EUTRANRadioResourceStatusDLTotalPRBusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusDLTotalPRBusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusDLTotalPRBusage(n) + + return nil +} + +type EUTRANRadioResourceStatusULTotalPRBusage uint8 + +func (v EUTRANRadioResourceStatusULTotalPRBusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusULTotalPRBusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusULTotalPRBusage(n) + + return nil +} + +type EUTRANRadioResourceStatusDLschedulingPDCCHCCEusage uint8 + +func (v EUTRANRadioResourceStatusDLschedulingPDCCHCCEusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusDLschedulingPDCCHCCEusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusDLschedulingPDCCHCCEusage(n) + + return nil +} + +type EUTRANRadioResourceStatusULschedulingPDCCHCCEusage uint8 + +func (v EUTRANRadioResourceStatusULschedulingPDCCHCCEusage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *EUTRANRadioResourceStatusULschedulingPDCCHCCEusage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = EUTRANRadioResourceStatusULschedulingPDCCHCCEusage(n) + + return nil +} + +type EUTRANRadioResourceStatus struct { + DLGBRPRBusage EUTRANRadioResourceStatusDLGBRPRBusage + ULGBRPRBusage EUTRANRadioResourceStatusULGBRPRBusage + DLnonGBRPRBusage EUTRANRadioResourceStatusDLnonGBRPRBusage + ULnonGBRPRBusage EUTRANRadioResourceStatusULnonGBRPRBusage + DLTotalPRBusage EUTRANRadioResourceStatusDLTotalPRBusage + ULTotalPRBusage EUTRANRadioResourceStatusULTotalPRBusage + DLschedulingPDCCHCCEusage *EUTRANRadioResourceStatusDLschedulingPDCCHCCEusage `per:",optional"` + ULschedulingPDCCHCCEusage *EUTRANRadioResourceStatusULschedulingPDCCHCCEusage `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NGRANNumberOfActiveUEs int64 + +func (v NGRANNumberOfActiveUEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 16777215, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *NGRANNumberOfActiveUEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 16777215, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = NGRANNumberOfActiveUEs(n) + + return nil +} + +func (v NGRANNumberOfActiveUEs) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 16777215) +} + +type NGRANRadioResourceStatusDLGBRPRBusageforMIMO uint8 + +func (v NGRANRadioResourceStatusDLGBRPRBusageforMIMO) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *NGRANRadioResourceStatusDLGBRPRBusageforMIMO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = NGRANRadioResourceStatusDLGBRPRBusageforMIMO(n) + + return nil +} + +type NGRANRadioResourceStatusULGBRPRBusageforMIMO uint8 + +func (v NGRANRadioResourceStatusULGBRPRBusageforMIMO) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *NGRANRadioResourceStatusULGBRPRBusageforMIMO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = NGRANRadioResourceStatusULGBRPRBusageforMIMO(n) + + return nil +} + +type NGRANRadioResourceStatusDLnonGBRPRBusageforMIMO uint8 + +func (v NGRANRadioResourceStatusDLnonGBRPRBusageforMIMO) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *NGRANRadioResourceStatusDLnonGBRPRBusageforMIMO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = NGRANRadioResourceStatusDLnonGBRPRBusageforMIMO(n) + + return nil +} + +type NGRANRadioResourceStatusULnonGBRPRBusageforMIMO uint8 + +func (v NGRANRadioResourceStatusULnonGBRPRBusageforMIMO) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *NGRANRadioResourceStatusULnonGBRPRBusageforMIMO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = NGRANRadioResourceStatusULnonGBRPRBusageforMIMO(n) + + return nil +} + +type NGRANRadioResourceStatusDLTotalPRBusageforMIMO uint8 + +func (v NGRANRadioResourceStatusDLTotalPRBusageforMIMO) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *NGRANRadioResourceStatusDLTotalPRBusageforMIMO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = NGRANRadioResourceStatusDLTotalPRBusageforMIMO(n) + + return nil +} + +type NGRANRadioResourceStatusULTotalPRBusageforMIMO uint8 + +func (v NGRANRadioResourceStatusULTotalPRBusageforMIMO) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *NGRANRadioResourceStatusULTotalPRBusageforMIMO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = NGRANRadioResourceStatusULTotalPRBusageforMIMO(n) + + return nil +} + +type NGRANRadioResourceStatus struct { + DLGBRPRBusageforMIMO NGRANRadioResourceStatusDLGBRPRBusageforMIMO + ULGBRPRBusageforMIMO NGRANRadioResourceStatusULGBRPRBusageforMIMO + DLnonGBRPRBusageforMIMO NGRANRadioResourceStatusDLnonGBRPRBusageforMIMO + ULnonGBRPRBusageforMIMO NGRANRadioResourceStatusULnonGBRPRBusageforMIMO + DLTotalPRBusageforMIMO NGRANRadioResourceStatusDLTotalPRBusageforMIMO + ULTotalPRBusageforMIMO NGRANRadioResourceStatusULTotalPRBusageforMIMO + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CandidateCellID struct { + CandidateCellID NRCGI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CandidatePCICandidatePCI int64 + +func (v CandidatePCICandidatePCI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 1007, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *CandidatePCICandidatePCI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 1007, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = CandidatePCICandidatePCI(n) + + return nil +} + +func (v CandidatePCICandidatePCI) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 1007) +} + +type CandidatePCICandidateNRARFCN uint32 + +func (v CandidatePCICandidateNRARFCN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: maxNRARFCN, HasUB: true}, int64(v)) +} + +func (v *CandidatePCICandidateNRARFCN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: maxNRARFCN, HasUB: true}) + if err != nil { + return err + } + + *v = CandidatePCICandidateNRARFCN(n) + + return nil +} + +type CandidatePCI struct { + CandidatePCI CandidatePCICandidatePCI + CandidateNRARFCN CandidatePCICandidateNRARFCN + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CompositeAvailableCapacityCellCapacityClassValue int64 + +func (v CompositeAvailableCapacityCellCapacityClassValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *CompositeAvailableCapacityCellCapacityClassValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = CompositeAvailableCapacityCellCapacityClassValue(n) + + return nil +} + +func (v CompositeAvailableCapacityCellCapacityClassValue) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 100) +} + +type CompositeAvailableCapacityCapacityValue uint8 + +func (v CompositeAvailableCapacityCapacityValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}, int64(v)) +} + +func (v *CompositeAvailableCapacityCapacityValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + + *v = CompositeAvailableCapacityCapacityValue(n) + + return nil +} + +type CompositeAvailableCapacity struct { + CellCapacityClassValue *CompositeAvailableCapacityCellCapacityClassValue `per:",optional"` + CapacityValue CompositeAvailableCapacityCapacityValue + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} diff --git a/ngap/ie_extensions.go b/ngap/ie_extensions.go index 1ec251e15b..79b174559d 100644 --- a/ngap/ie_extensions.go +++ b/ngap/ie_extensions.go @@ -4,122 +4,16 @@ package ngap import ( - "errors" - "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) -func extensionFields[M any](table []ieSpec[M], m *M, meta *messageMeta) []ieField { - typed := make([]*ieField, len(table)) - - for i, spec := range table { - if val, ok := spec.encode(m); ok { - typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} - } - } - - return orderFields(table, typed, meta) -} - func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - if len(fields) > maxProtocolExtensions { - return fmt.Errorf("ngap: %d extensions exceed maxProtocolExtensions", len(fields)) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, int64(len(fields))); err != nil { - return err - } - - for _, f := range fields { - if err := encodeContainerField(w, enc, f); err != nil { - return err - } - } - - return nil + return ap.EncodeExtensionContainer(profile, w, enc, fields) } -func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *messageMeta) error { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) - if err != nil { - return err - } - - if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { - return fmt.Errorf("ngap: extension container declares %d fields in %d bits", n, maxBits) - } - - var rejected *notComprehendedIE - - lastIdx := -1 - - for i := int64(0); i < n; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return err - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return err - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return err - } - - if len(val) == 0 { - return fmt.Errorf("ngap: extension %d has an empty open type", id) - } - - f := rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val} - - if idx, spec, ok := lookupIESpec(table, f.id); ok { - if idx <= lastIdx { - return fmt.Errorf("ngap: extension %s out of order or repeated", f.id) - } - - lastIdx = idx - - err := spec.decode(m, f.value, enc) - if err == nil { - meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) - - continue - } - - if !errors.Is(err, errNotComprehended) { - return err - } - - var inner *notComprehendedIE - if errors.As(err, &inner) && inner.Crit == CriticalityReject && rejected == nil { - rejected = inner - } - } - - if f.crit == CriticalityReject { - if rejected == nil { - rejected = ¬ComprehendedIE{ID: f.id, Crit: CriticalityReject, What: "iE-Extensions"} - } - - continue - } - - meta.preserveUpTo(f, maxProtocolExtensions) - } - - if rejected != nil { - return rejected - } - - if wireMatchesTable(table, meta.wire) { - meta.wire = nil - } - - return nil +func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *extensionMeta) error { + return ap.DecodeExtensionContainer(profile, r, enc, table, m, meta) } func optionalExtension[M any, T any, PT interface { @@ -129,11 +23,11 @@ func optionalExtension[M any, T any, PT interface { }](id ProtocolIEID, crit Criticality, field func(m *M) **T, ) ieSpec[M] { return ieSpec[M]{ - id: id, presence: presenceOptional, crit: crit, - decode: func(m *M, raw []byte, _ per.Encoding) error { + ID: id, Presence: presenceOptional, Criticality: crit, + Decode: func(m *M, r *per.Reader, _ per.Encoding) error { v := PT(new(T)) - if err := perIEDecode(raw, v); err != nil { + if err := decodeIE(r, v); err != nil { return err } @@ -141,7 +35,7 @@ func optionalExtension[M any, T any, PT interface { return nil }, - encode: func(m *M) (per.Marshaler, bool) { + Encode: func(m *M) (per.Marshaler, bool) { v := *field(m) if v == nil { return nil, false @@ -161,11 +55,11 @@ func listExtension[M any, L interface { }](id ProtocolIEID, crit Criticality, field func(m *M) *L, ) ieSpec[M] { return ieSpec[M]{ - id: id, presence: presenceOptional, crit: crit, - decode: func(m *M, raw []byte, _ per.Encoding) error { - return perIEDecode(raw, PL(field(m))) + ID: id, Presence: presenceOptional, Criticality: crit, + Decode: func(m *M, r *per.Reader, _ per.Encoding) error { + return decodeIE(r, PL(field(m))) }, - encode: func(m *M) (per.Marshaler, bool) { + Encode: func(m *M) (per.Marshaler, bool) { v := *field(m) if len(v) == 0 { return nil, false diff --git a/ngap/ie_guami.go b/ngap/ie_guami.go index e27c9fc889..30b0227cbb 100644 --- a/ngap/ie_guami.go +++ b/ngap/ie_guami.go @@ -28,12 +28,12 @@ type AMFPointer uint8 // GUAMI ::= SEQUENCE { pLMNIdentity, aMFRegionID, aMFSetID, aMFPointer, // iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.3.3. type GUAMI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity AMFRegionID AMFRegionID AMFSetID AMFSetID AMFPointer AMFPointer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type GUAMIType uint8 @@ -41,153 +41,17 @@ type GUAMIType uint8 const ( GUAMITypeNative GUAMIType = iota GUAMITypeMapped - - guamiTypeRootCount = 2 ) -func (g GUAMIType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, guamiTypeRootCount, int64(g), "GUAMIType") -} - -func (g *GUAMIType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, guamiTypeRootCount, "GUAMIType") - if err != nil { - return err - } - - *g = GUAMIType(idx) - - return nil -} - // ServedGUAMIItem ::= SEQUENCE { gUAMI, backupAMFName OPTIONAL, iE-Extensions // OPTIONAL } (extensible). type ServedGUAMIItem struct { GUAMI GUAMI - BackupAMFName *Name - GUAMIType *GUAMIType - ExtendedBackupAMFName *ExtendedAMFName - - iEExtensions messageMeta - extensions per.ExtensionAdditions -} - -var servedGUAMIItemExtIEs = []ieSpec[ServedGUAMIItem]{ - { - id: IDGUAMIType, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ServedGUAMIItem, raw []byte, enc per.Encoding) error { - var v GUAMIType - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.GUAMIType = &v - - return nil - }, - encode: func(m *ServedGUAMIItem) (per.Marshaler, bool) { - if m.GUAMIType == nil { - return nil, false - } - - return m.GUAMIType, true - }, - }, - { - id: IDExtendedBackupAMFName, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ServedGUAMIItem, raw []byte, enc per.Encoding) error { - var v ExtendedAMFName - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.ExtendedBackupAMFName = &v - - return nil - }, - encode: func(m *ServedGUAMIItem) (per.Marshaler, bool) { - if m.ExtendedBackupAMFName == nil { - return nil, false - } - - return m.ExtendedBackupAMFName, true - }, - }, -} - -func (s *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(servedGUAMIItemExtIEs, s, &s.iEExtensions) - - w.WriteBit(s.extensions.Present()) - w.WriteBit(s.BackupAMFName != nil) - w.WriteBit(len(ext) > 0) - - if err := s.GUAMI.MarshalPER(w, enc); err != nil { - return err - } - - if s.BackupAMFName != nil { - if err := s.BackupAMFName.MarshalPER(w, enc); err != nil { - return err - } - } - - if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { - return err - } - } - - if s.extensions.Present() { - return s.extensions.MarshalPER(w, enc) - } - - return nil -} - -func (s *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - backupAMFName, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - if err := s.GUAMI.UnmarshalPER(r, enc); err != nil { - return err - } - - if backupAMFName { - var v Name - - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - s.BackupAMFName = &v - } - - if extContainer { - if err := decodeExtensionContainer(r, enc, servedGUAMIItemExtIEs, s, &s.iEExtensions); err != nil { - return err - } - } - - if extBit { - return s.extensions.UnmarshalPER(r, enc) - } - - return nil + BackupAMFName *Name `per:",optional"` + GUAMIType *GUAMIType `per:",extie:IDGUAMIType,crit:ignore"` + ExtendedBackupAMFName *ExtendedAMFName `per:",extie:IDExtendedBackupAMFName,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // ServedGUAMIList ::= SEQUENCE (SIZE(1..maxnoofServedGUAMIs)) OF diff --git a/ngap/ie_handover.go b/ngap/ie_handover.go index fc9b1d21f5..c22b72ba3f 100644 --- a/ngap/ie_handover.go +++ b/ngap/ie_handover.go @@ -4,9 +4,8 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // HandoverType ::= ENUMERATED { intra5gs, fivegs-to-eps, eps-to-5gs, ..., @@ -19,25 +18,9 @@ const ( HandoverTypeIntra5GS HandoverType = iota HandoverTypeFiveGSToEPS HandoverTypeEPSToFiveGS - - handoverTypeRootCount = 3 + HandoverTypeFiveGSToUTRAN ) -func (h HandoverType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, handoverTypeRootCount, int64(h), "HandoverType") -} - -func (h *HandoverType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, handoverTypeRootCount, "HandoverType") - if err != nil { - return err - } - - *h = HandoverType(idx) - - return nil -} - // SourceToTargetTransparentContainer ::= OCTET STRING — TS 38.413 §9.3.1.20. // Opaque here: the octets are encoded per the target system's own spec. type SourceToTargetTransparentContainer []byte @@ -100,10 +83,11 @@ func (p *NASSecurityParametersFromNGRAN) UnmarshalPER(r *per.Reader, enc per.Enc // OPTIONAL } (extensible), the NG-RAN alternative of the Target ID IE // (TS 38.413 §9.3.1.25). type TargetRANNodeID struct { - _ [0]struct{} `per:"extseq"` - GlobalRANNodeID GlobalRANNodeID - SelectedTAI TAI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + GlobalRANNodeID GlobalRANNodeID + SelectedTAI TAI + SelectedTargetSNPNIdentity *NID `per:",extie:IDSelectedTargetSNPNIdentity,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` } // TargeteNB-ID ::= SEQUENCE { globalENB-ID GlobalNgENB-ID, selected-EPS-TAI @@ -113,92 +97,106 @@ type TargetRANNodeID struct { // despite naming an eNB attached to the EPC: TS 38.413 has no other shape for an // E-UTRAN node. type TargeteNBID struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` GlobalENBID GlobalNgENBID SelectedEPSTAI EPSTAI - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } -// TargetID CHOICE alternatives. The CHOICE is not extensible, so -// choice-Extensions is a plain alternative index. -const ( - targetIDTargetRANNodeID = iota - targetIDTargetENBID - targetIDChoiceExtensions - - targetIDAlternatives = 3 -) - // TargetID ::= CHOICE { targetRANNodeID, targeteNB-ID, choice-Extensions } — -// TS 38.413 §9.3.1.25. Two alternatives are modelled: targetRANNodeID for a -// handover within 5GS and targeteNB-ID for the 5GS to EPS one, which is what a -// source gNB names its target with when Handover Type is fivegs-to-eps. -// TS 36.413's TargetID is a different CHOICE entirely (targeteNB-ID, -// targetRNC-ID, cGI) whose alternatives do not correspond to these. +// TS 38.413 §9.3.1.25. TS 36.413's TargetID is a different CHOICE entirely +// (targeteNB-ID, targetRNC-ID, cGI) whose alternatives do not correspond to these. // -// Exactly one alternative is set; which one is derived from the pointers rather -// than stored, so the two can never disagree. Which one belongs is not free: -// TS 38.413 §9.2.3.1 pairs it with the Handover Type IE, and the message handler -// is what holds them together. +// Which alternative belongs is not free: TS 38.413 §9.2.3.1 pairs it with the +// Handover Type IE, and the message handler is what holds them together. type TargetID struct { - TargetRANNodeID *TargetRANNodeID - TargeteNBID *TargeteNBID -} - -func (t TargetID) MarshalPER(w *per.Writer, enc per.Encoding) error { - var ( - idx int64 - value per.Marshaler - ) - - switch { - case t.TargetRANNodeID != nil && t.TargeteNBID != nil: - return fmt.Errorf("ngap: TargetID names both an NG-RAN node and an eNB") - case t.TargetRANNodeID != nil: - idx, value = targetIDTargetRANNodeID, t.TargetRANNodeID - case t.TargeteNBID != nil: - idx, value = targetIDTargetENBID, t.TargeteNBID - default: - return fmt.Errorf("ngap: TargetID names no target") - } + TargetRANNodeID *TargetRANNodeID `per:",choice:0"` + TargeteNBID *TargeteNBID `per:",choice:1"` + TargetRNCID *TargetRNCID `per:",choice:2,extie:IDTargetRNCID,crit:reject"` + TargetHomeENBID *TargetHomeENBID `per:",choice:2,extie:IDTargetHomeENBID,crit:reject"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} + +type TargetRNCID struct { + LAI LAI + RNCID RNCID + ExtendedRNCID *ExtendedRNCID `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LAI struct { + PLMNIdentity PLMNIdentity + LAC LAC + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, targetIDAlternatives-1, idx); err != nil { - return err - } +type LAC [2]byte - return value.MarshalPER(w, enc) +func (l LAC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 2, 2, true, true, false, l[:]) } -func (t *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, targetIDAlternatives-1) +func (l *LAC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) if err != nil { return err } - switch idx { - case targetIDTargetRANNodeID: - var v TargetRANNodeID - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - *t = TargetID{TargetRANNodeID: &v} - - return nil - case targetIDTargetENBID: - var v TargeteNBID - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - *t = TargetID{TargeteNBID: &v} - - return nil - case targetIDChoiceExtensions: - return decodeChoiceExtension(r, enc, "TargetID") - default: - return fmt.Errorf("%w: TargetID alternative %d", errNotComprehended, idx) - } + copy(l[:], b) + + return nil +} + +type RNCID uint16 + +func (id RNCID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(id)) +} + +func (id *RNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + *id = RNCID(v) + + return err +} + +type ExtendedRNCID uint16 + +func (id ExtendedRNCID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 4096, HasLB: true, UB: 65535, HasUB: true}, int64(id)) +} + +func (id *ExtendedRNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 4096, HasLB: true, UB: 65535, HasUB: true}) + *id = ExtendedRNCID(v) + + return err +} + +type TargetHomeENBID struct { + PLMNIdentity PLMNIdentity + HomeENBID HomeENBID + SelectedEPSTAI EPSTAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +const homeENBIDBits = 28 + +type HomeENBID uint32 + +func (id HomeENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(id), homeENBIDBits) +} + +func (id *HomeENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, homeENBIDBits) + *id = HomeENBID(v) + + return err } // NewSecurityContextInd ::= ENUMERATED { true, ... } — TS 38.413 §9.3.1.55. The @@ -209,25 +207,8 @@ type NewSecurityContextInd uint8 const ( NewSecurityContextIndTrue NewSecurityContextInd = iota - - newSecurityContextIndRootCount = 1 ) -func (n NewSecurityContextInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, newSecurityContextIndRootCount, int64(n), "NewSecurityContextInd") -} - -func (n *NewSecurityContextInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, newSecurityContextIndRootCount, "NewSecurityContextInd") - if err != nil { - return err - } - - *n = NewSecurityContextInd(idx) - - return nil -} - // The Mobility Restriction List vocabulary (TS 38.413 §9.3.1.85). The list is // optional in the ASN.1 and not optional in practice: §8.4.2.4 has the target // NG-RAN node "reject the procedure using the HANDOVER FAILURE message" when the @@ -251,10 +232,10 @@ type ForbiddenTACs []TAC // ForbiddenAreaInformation-Item ::= SEQUENCE { pLMNIdentity, forbiddenTACs, // iE-Extensions OPTIONAL } (extensible). type ForbiddenAreaInformationItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity ForbiddenTACs ForbiddenTACs - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // ForbiddenAreaInformation ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF @@ -265,12 +246,22 @@ type ForbiddenAreaInformation []ForbiddenAreaInformationItem // §9.3.1.85. A bit set to 1 restricts the UE from that RAT; bit 7 is reserved. // The value is held as the eight bits in transmission order, with e-UTRA in the // most significant. -type RATRestrictionInformation uint8 +type RATRestrictionInformation struct { + Flags RATRestrictionFlags + extended bool + raw BitString +} + +type RATRestrictionFlags uint8 + +func RATRestrictionInformationFrom(f RATRestrictionFlags) RATRestrictionInformation { + return RATRestrictionInformation{Flags: f} +} // RAT restriction bit positions, counted from the first bit in transmission // order (TS 38.413 §9.3.1.85). const ( - RATRestrictionEUTRA RATRestrictionInformation = 1 << (7 - iota) + RATRestrictionEUTRA RATRestrictionFlags = 1 << (7 - iota) RATRestrictionNR RATRestrictionNRUnlicensed RATRestrictionNRLEO @@ -284,10 +275,11 @@ const ( // RATRestrictions-Item ::= SEQUENCE { pLMNIdentity, rATRestrictionInformation, // iE-Extensions OPTIONAL } (extensible). type RATRestrictionsItem struct { - _ [0]struct{} `per:"extseq"` - PLMNIdentity PLMNIdentity - RATRestrictionInformation RATRestrictionInformation - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + PLMNIdentity PLMNIdentity + RATRestrictionInformation RATRestrictionInformation + ExtendedRATRestrictionInformation *ExtendedRATRestrictionInformation `per:",extie:IDExtendedRATRestrictionInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // RATRestrictions ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF @@ -303,11 +295,11 @@ type NotAllowedTACs []TAC // ServiceAreaInformation-Item ::= SEQUENCE { pLMNIdentity, allowedTACs OPTIONAL, // notAllowedTACs OPTIONAL, iE-Extensions OPTIONAL } (extensible). type ServiceAreaInformationItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity AllowedTACs AllowedTACs `per:",optional"` NotAllowedTACs NotAllowedTACs `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // ServiceAreaInformation ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF @@ -329,22 +321,26 @@ const ( // TS 38.413 §9.3.1.85. Only the serving PLMN is mandatory, and it is the one // field §8.4.2.4 turns on. type MobilityRestrictionList struct { - _ [0]struct{} `per:"extseq"` - ServingPLMN PLMNIdentity - EquivalentPLMNs EquivalentPLMNs `per:",optional"` - RATRestrictions RATRestrictions `per:",optional"` - ForbiddenAreaInformation ForbiddenAreaInformation `per:",optional"` - ServiceAreaInformation ServiceAreaInformation `per:",optional"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ServingPLMN PLMNIdentity + EquivalentPLMNs EquivalentPLMNs `per:",optional"` + RATRestrictions RATRestrictions `per:",optional"` + ForbiddenAreaInformation ForbiddenAreaInformation `per:",optional"` + ServiceAreaInformation ServiceAreaInformation `per:",optional"` + LastEUTRANPLMNIdentity *PLMNIdentity `per:",extie:IDLastEUTRANPLMNIdentity,crit:ignore"` + CNTypeRestrictionsForServing *CNTypeRestrictionsForServing `per:",extie:IDCNTypeRestrictionsForServing,crit:ignore"` + CNTypeRestrictionsForEquivalent CNTypeRestrictionsForEquivalent `per:",extie:IDCNTypeRestrictionsForEquivalent,crit:ignore"` + NPNMobilityInformation *NPNMobilityInformation `per:",extie:IDNPNMobilityInformation,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceItemHORqd ::= SEQUENCE { pDUSessionID, // handoverRequiredTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceItemHORqd struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceListHORqd ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF @@ -357,7 +353,7 @@ type PDUSessionResourceListHORqd []PDUSessionResourceItemHORqd type PDUSessionResourceHandoverItem struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -369,10 +365,10 @@ type PDUSessionResourceHandoverList []PDUSessionResourceHandoverItem // handoverPreparationUnsuccessfulTransfer, iE-Extensions OPTIONAL } // (extensible). One entry per session the target refused. type PDUSessionResourceToReleaseItemHOCmd struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceToReleaseListHOCmd ::= SEQUENCE @@ -403,10 +399,10 @@ func (c *TargettoSourceFailureTransparentContainer) UnmarshalPER(r *per.Reader, // iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.1.88. The {NH, NCC} // pair the target derives its AS keys from (TS 33.501). type SecurityContext struct { - _ [0]struct{} `per:"extseq"` - NextHopChainingCount uint8 `per:",range:0..7"` + extensions per.ExtensionAdditions `per:",extraw"` + NextHopChainingCount uint8 `per:",range:0..7"` NextHopNH SecurityKey - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceSetupItemHOReq ::= SEQUENCE { pDUSessionID, s-NSSAI, @@ -414,11 +410,12 @@ type SecurityContext struct { // is a PDUSessionResourceSetupRequestTransfer, the same one the setup procedure // carries. type PDUSessionResourceSetupItemHOReq struct { - PDUSessionID PDUSessionID - SNSSAI SNSSAI - Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PDUSessionID PDUSessionID + SNSSAI SNSSAI + Transfer TransferContainer + PduSessionExpectedUEActivityBehaviour *ExpectedUEActivityBehaviour `per:",extie:IDPduSessionExpectedUEActivityBehaviour,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListHOReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -430,7 +427,7 @@ type PDUSessionResourceSetupListHOReq []PDUSessionResourceSetupItemHOReq type PDUSessionResourceAdmittedItem struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -442,10 +439,10 @@ type PDUSessionResourceAdmittedList []PDUSessionResourceAdmittedItem // handoverResourceAllocationUnsuccessfulTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceFailedToSetupItemHOAck struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceFailedToSetupListHOAck ::= SEQUENCE @@ -457,7 +454,7 @@ type PDUSessionResourceFailedToSetupListHOAck []PDUSessionResourceFailedToSetupI type PDUSessionResourceToBeSwitchedDLItem struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -468,10 +465,10 @@ type PDUSessionResourceToBeSwitchedDLList []PDUSessionResourceToBeSwitchedDLItem // PDUSessionResourceFailedToSetupItemPSReq ::= SEQUENCE { pDUSessionID, // pathSwitchRequestSetupFailedTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceFailedToSetupItemPSReq struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceFailedToSetupListPSReq ::= SEQUENCE @@ -481,10 +478,11 @@ type PDUSessionResourceFailedToSetupListPSReq []PDUSessionResourceFailedToSetupI // PDUSessionResourceSwitchedItem ::= SEQUENCE { pDUSessionID, // pathSwitchRequestAcknowledgeTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceSwitchedItem struct { - PDUSessionID PDUSessionID - Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PDUSessionID PDUSessionID + Transfer TransferContainer + PduSessionExpectedUEActivityBehaviour *ExpectedUEActivityBehaviour `per:",extie:IDPduSessionExpectedUEActivityBehaviour,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSwitchedList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF @@ -494,10 +492,10 @@ type PDUSessionResourceSwitchedList []PDUSessionResourceSwitchedItem // PDUSessionResourceReleasedItemPSAck ::= SEQUENCE { pDUSessionID, // pathSwitchRequestUnsuccessfulTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceReleasedItemPSAck struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceReleasedListPSAck ::= SEQUENCE @@ -507,10 +505,10 @@ type PDUSessionResourceReleasedListPSAck []PDUSessionResourceReleasedItemPSAck // PDUSessionResourceReleasedItemPSFail ::= SEQUENCE { pDUSessionID, // pathSwitchRequestUnsuccessfulTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceReleasedItemPSFail struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceReleasedListPSFail ::= SEQUENCE diff --git a/ngap/ie_ids.go b/ngap/ie_ids.go index 2815eb0874..6f1da71e96 100644 --- a/ngap/ie_ids.go +++ b/ngap/ie_ids.go @@ -279,3 +279,224 @@ const ( IDAdditionalULI ProtocolIEID = 483 IDLPWUSDisableIndication ProtocolIEID = 495 ) + +const ( + IDOldAssociatedQosFlowListULendmarkerexpected ProtocolIEID = 159 + IDCNTypeRestrictionsForEquivalent ProtocolIEID = 160 + IDCNTypeRestrictionsForServing ProtocolIEID = 161 + IDULForwarding ProtocolIEID = 163 + IDLocationReportingAdditionalInfo ProtocolIEID = 170 + IDSCTPTLAs ProtocolIEID = 173 + IDRIMInformationTransfer ProtocolIEID = 175 + IDTargetRNCID ProtocolIEID = 178 + IDRATInformation ProtocolIEID = 179 + IDExtendedRATRestrictionInformation ProtocolIEID = 180 + IDQosMonitoringRequest ProtocolIEID = 181 + IDSgNBUEX2APID ProtocolIEID = 182 + IDCNPacketDelayBudgetDL ProtocolIEID = 187 + IDCNPacketDelayBudgetUL ProtocolIEID = 188 + IDExtendedPacketDelayBudget ProtocolIEID = 189 + IDRedundantQosFlowIndicator ProtocolIEID = 194 + IDTSCTrafficCharacteristics ProtocolIEID = 196 + IDUsedRSNInformation ProtocolIEID = 198 + IDNBIoTUEPriority ProtocolIEID = 210 + IDULCPSecurityInformation ProtocolIEID = 211 + IDDLCPSecurityInformation ProtocolIEID = 212 + IDTAI ProtocolIEID = 213 + IDUERadioCapabilityForPagingOfNBIoT ProtocolIEID = 214 + IDAlternativeQoSParaSetList ProtocolIEID = 220 + IDCurrentQoSParaSetIndex ProtocolIEID = 221 + IDPDUSessionResourceFailedToResumeListRESReq ProtocolIEID = 229 + IDPDUSessionResourceFailedToResumeListRESRes ProtocolIEID = 230 + IDPDUSessionResourceSuspendListSUSReq ProtocolIEID = 231 + IDPDUSessionResourceResumeListRESReq ProtocolIEID = 232 + IDPDUSessionResourceResumeListRESRes ProtocolIEID = 233 + IDSuspendRequestIndication ProtocolIEID = 235 + IDSuspendResponseIndication ProtocolIEID = 236 + IDGlobalTNGFID ProtocolIEID = 240 + IDGlobalTWIFID ProtocolIEID = 241 + IDGlobalWAGFID ProtocolIEID = 242 + IDUserLocationInformationWAGF ProtocolIEID = 243 + IDUserLocationInformationTNGF ProtocolIEID = 244 + IDUserLocationInformationTWIF ProtocolIEID = 248 + IDSONInformationReport ProtocolIEID = 252 + IDUEHistoryInformationFromTheUE ProtocolIEID = 253 + IDMDTConfiguration ProtocolIEID = 255 + IDPrivacyIndicator ProtocolIEID = 256 + IDTraceCollectionEntityURI ProtocolIEID = 257 + IDNPNPagingAssistanceInformation ProtocolIEID = 260 + IDNPNMobilityInformation ProtocolIEID = 261 + IDNID ProtocolIEID = 263 + IDDAPSRequestInfo ProtocolIEID = 266 + IDDAPSResponseInfoList ProtocolIEID = 267 + IDEarlyStatusTransferTransparentContainer ProtocolIEID = 268 + IDExtendedTAISliceSupportList ProtocolIEID = 271 + IDConfiguredTACIndication ProtocolIEID = 272 + IDGlobalCableID ProtocolIEID = 275 + IDQosMonitoringReportingFrequency ProtocolIEID = 276 + IDQosFlowParametersList ProtocolIEID = 277 + IDQosFlowFeedbackList ProtocolIEID = 278 + IDBurstArrivalTimeDownlink ProtocolIEID = 279 + IDExtendedUEIdentityIndexValue ProtocolIEID = 280 + IDPduSessionExpectedUEActivityBehaviour ProtocolIEID = 281 + IDMicoAllPLMN ProtocolIEID = 282 + IDQosFlowFailedToSetupList ProtocolIEID = 283 + IDSourceTNLAddrInfo ProtocolIEID = 284 + IDExtendedReportIntervalMDT ProtocolIEID = 285 + IDSourceNodeID ProtocolIEID = 286 + IDNRNTNTAIInformation ProtocolIEID = 287 + IDUEContextReferenceAtSource ProtocolIEID = 288 + IDLastVisitedPSCellList ProtocolIEID = 289 + IDIntersystemSONInformationRequest ProtocolIEID = 290 + IDIntersystemSONInformationReply ProtocolIEID = 291 + IDEnergySavingIndication ProtocolIEID = 292 + IDIntersystemResourceStatusUpdate ProtocolIEID = 293 + IDSuccessfulHandoverReportList ProtocolIEID = 294 + IDMBSAreaSessionID ProtocolIEID = 295 + IDMBSQoSFlowsToBeSetupList ProtocolIEID = 296 + IDMBSQoSFlowsToBeSetupModList ProtocolIEID = 297 + IDMBSServiceArea ProtocolIEID = 298 + IDMBSSessionID ProtocolIEID = 299 + IDMBSDistributionReleaseRequestTransfer ProtocolIEID = 300 + IDMBSDistributionSetupRequestTransfer ProtocolIEID = 301 + IDMBSDistributionSetupResponseTransfer ProtocolIEID = 302 + IDMBSDistributionSetupUnsuccessfulTransfer ProtocolIEID = 303 + IDMulticastSessionActivationRequestTransfer ProtocolIEID = 304 + IDMulticastSessionDeactivationRequestTransfer ProtocolIEID = 305 + IDMulticastSessionUpdateRequestTransfer ProtocolIEID = 306 + IDMulticastGroupPagingAreaList ProtocolIEID = 307 + IDMBSSupportIndicator ProtocolIEID = 309 + IDMBSSessionFailedtoSetupList ProtocolIEID = 310 + IDMBSSessionFailedtoSetuporModifyList ProtocolIEID = 311 + IDMBSSessionSetupResponseList ProtocolIEID = 312 + IDMBSSessionSetuporModifyResponseList ProtocolIEID = 313 + IDMBSSessionSetupFailureTransfer ProtocolIEID = 314 + IDMBSSessionSetupRequestTransfer ProtocolIEID = 315 + IDMBSSessionSetupResponseTransfer ProtocolIEID = 316 + IDMBSActiveSessionInformationSourcetoTargetList ProtocolIEID = 323 + IDMBSActiveSessionInformationTargettoSourceList ProtocolIEID = 324 + IDSurvivalTime ProtocolIEID = 327 + IDPDUSessionPairID ProtocolIEID = 331 + IDM4ReportAmount ProtocolIEID = 336 + IDM5ReportAmount ProtocolIEID = 337 + IDM6ReportAmount ProtocolIEID = 338 + IDM7ReportAmount ProtocolIEID = 339 + IDIncludeBeamMeasurementsIndication ProtocolIEID = 340 + IDExcessPacketDelayThresholdConfiguration ProtocolIEID = 341 + IDPagingCauseIndicationForVoiceService ProtocolIEID = 343 + IDMBSSessionModificationFailureTransfer ProtocolIEID = 348 + IDMBSSessionModificationRequestTransfer ProtocolIEID = 349 + IDMBSSessionModificationResponseTransfer ProtocolIEID = 350 + IDMBSQoSFlowToReleaseList ProtocolIEID = 351 + IDMBSSessionTNLInfo5GC ProtocolIEID = 352 + IDTAINSAGSupportList ProtocolIEID = 353 + IDSourceNodeTNLAddrInfo ProtocolIEID = 354 + IDNGAPIESupportInformationRequestList ProtocolIEID = 355 + IDNGAPIESupportInformationResponseList ProtocolIEID = 356 + IDMBSSessionFSAIDList ProtocolIEID = 357 + IDMBSSessionReleaseResponseTransfer ProtocolIEID = 358 + IDEarlyMeasurement ProtocolIEID = 360 + IDBeamMeasurementsReportConfiguration ProtocolIEID = 361 + IDHFCNodeIDnew ProtocolIEID = 362 + IDGlobalCableIDnew ProtocolIEID = 363 + IDTargetHomeENBID ProtocolIEID = 364 + IDHashedUEIdentityIndexValue ProtocolIEID = 365 + IDExtendedMobilityInformation ProtocolIEID = 366 + IDAdditionalCancelledlocationReportingReferenceIDList ProtocolIEID = 368 + IDSelectedTargetSNPNIdentity ProtocolIEID = 369 + IDEquivalentSNPNsList ProtocolIEID = 370 + IDSupportedUETypeList ProtocolIEID = 372 + IDFiveGProSeLayer2Multipath ProtocolIEID = 379 + IDFiveGProSeLayer2UEtoUERelay ProtocolIEID = 380 + IDFiveGProSeLayer2UEtoUERemote ProtocolIEID = 381 + IDCandidateRelayUEInformationList ProtocolIEID = 382 + IDSuccessfulPSCellChangeReportList ProtocolIEID = 383 + IDIntersystemMobilityFailureforVoiceFallback ProtocolIEID = 384 + IDTargetCellCRNTI ProtocolIEID = 385 + IDTimeSinceFailure ProtocolIEID = 386 + IDRANTimingSynchronisationStatusInfo ProtocolIEID = 387 + IDRANTSSRequestType ProtocolIEID = 388 + IDRANTSSScope ProtocolIEID = 389 + IDClockQualityReportingControlInfo ProtocolIEID = 390 + IDRANfeedbacktype ProtocolIEID = 391 + IDQoSFlowTSCList ProtocolIEID = 392 + IDTSCTrafficCharacteristicsFeedback ProtocolIEID = 393 + IDUplinkTLContainer ProtocolIEID = 395 + IDANPacketDelayBudgetUL ProtocolIEID = 396 + IDQosFlowAdditionalInfoList ProtocolIEID = 397 + IDAssistanceInformationQoEMeas ProtocolIEID = 398 + IDCommServiceType ProtocolIEID = 399 + IDMobileIABMTUserLocationInformation ProtocolIEID = 401 + IDCNMTCommunicationHandling ProtocolIEID = 405 + IDFiveGCAction ProtocolIEID = 406 + IDPagingPolicyDifferentiation ProtocolIEID = 407 + IDDLSignalling ProtocolIEID = 408 + IDPNINPNAreaScopeofMDT ProtocolIEID = 409 + IDPNINPNBasedMDT ProtocolIEID = 410 + IDSNPNCellBasedMDT ProtocolIEID = 411 + IDSNPNTAIBasedMDT ProtocolIEID = 412 + IDSNPNBasedMDT ProtocolIEID = 413 + IDAssociatedSessionID ProtocolIEID = 415 + IDMBSAssistanceInformation ProtocolIEID = 416 + IDBroadcastTransportFailureTransfer ProtocolIEID = 417 + IDBroadcastTransportRequestTransfer ProtocolIEID = 418 + IDBroadcastTransportResponseTransfer ProtocolIEID = 419 + IDTimeBasedHandoverInformation ProtocolIEID = 420 + IDDLDiscarding ProtocolIEID = 421 + IDPDUsetQoSParameters ProtocolIEID = 422 + IDPDUSetbasedHandlingIndicator ProtocolIEID = 423 + IDN6JitterInformation ProtocolIEID = 424 + IDECNMarkingorCongestionInformationReportingRequest ProtocolIEID = 425 + IDECNMarkingorCongestionInformationReportingStatus ProtocolIEID = 426 + IDUserPlaneErrorIndicator ProtocolIEID = 429 + IDPDUSessionListMTCommHReq ProtocolIEID = 431 + IDMaximumDataBurstVolume ProtocolIEID = 432 + IDMNonlyMDTcollection ProtocolIEID = 433 + IDMBSNGUFailureIndication ProtocolIEID = 434 + IDUserPlaneFailureIndicationReport ProtocolIEID = 436 + IDSourceSNtoTargetSNQMCInfo ProtocolIEID = 437 + IDQoERVQoEReportingPaths ProtocolIEID = 438 + IDUserLocationInformationN3IWFwithoutPortNumber ProtocolIEID = 439 + IDTAIMBSSupportList ProtocolIEID = 441 + IDMBSUPFailureIndication ProtocolIEID = 444 + IDRequestedTNLInfo ProtocolIEID = 445 + IDAerialUEFlightInformationOngoingReportingfailed ProtocolIEID = 446 + IDNetworkSliceAreaScopeofMDT ProtocolIEID = 447 + IDGeographyBasedMDT ProtocolIEID = 448 + IDMBSIntendedServiceAreaList ProtocolIEID = 449 + IDInventoryRequestTransfer ProtocolIEID = 456 + IDInventoryResponseTransfer ProtocolIEID = 457 + IDInventoryFailureTransfer ProtocolIEID = 458 + IDInventoryReportTransfer ProtocolIEID = 459 + IDCommandRequestTransfer ProtocolIEID = 460 + IDCommandResponseTransfer ProtocolIEID = 461 + IDCommandFailureTransfer ProtocolIEID = 462 + IDAIOTSessionReleaseCommandTransfer ProtocolIEID = 463 + IDAIOTSessionReleaseCompleteTransfer ProtocolIEID = 464 + IDAIOTSessionReleaseRequestTransfer ProtocolIEID = 465 + IDAIoTCorrelationIdentifier ProtocolIEID = 466 + IDAIoTDeviceIdentificationRequested ProtocolIEID = 468 + IDAIoTRequestedServiceAreaInformation ProtocolIEID = 469 + IDAIoTInventoryAssistanceInformation ProtocolIEID = 470 + IDAIoTFollowonCommandIndication ProtocolIEID = 471 + IDRANAIOTDeviceNGAPID ProtocolIEID = 472 + IDAIoTCommandAssistanceInformation ProtocolIEID = 473 + IDAIoTNASPDU ProtocolIEID = 474 + IDFurtherExtendedUEIdentityIndexValue ProtocolIEID = 478 + IDFiveGProSeLayer2MHUEtoNetworkRelay ProtocolIEID = 479 + IDFiveGProSeLayer2MHIntermediateUEtoNetworkRelay ProtocolIEID = 480 + IDFiveGProSeLayer2MHRemote ProtocolIEID = 481 + IDFiveGProSeLayer3MHUEtoNetworkRelay ProtocolIEID = 482 + IDPduSetDelayBudgetDownlink ProtocolIEID = 484 + IDPduSetDelayBudgetUplink ProtocolIEID = 485 + IDPduSetErrorRateDownlink ProtocolIEID = 486 + IDPduSetErrorRateUplink ProtocolIEID = 487 + IDDLPDUSetInformationMarkingSupportIndication ProtocolIEID = 488 + IDMonitoringRequestonAvailableBitrate ProtocolIEID = 489 + IDMMSID ProtocolIEID = 490 + IDIndicationofBitrateAdaptation ProtocolIEID = 491 + IDSCGActivationTime ProtocolIEID = 492 + IDAerialUEFlightInformationReporting ProtocolIEID = 493 + IDAerialUEFlightInformationReportingControlList ProtocolIEID = 494 + IDAIoTSecurityInfo ProtocolIEID = 496 +) diff --git a/ngap/ie_names.go b/ngap/ie_names.go index cfa9e4e236..a2903c8899 100644 --- a/ngap/ie_names.go +++ b/ngap/ie_names.go @@ -13,279 +13,497 @@ import "fmt" // System (TS 38.413 §8.9), and its "key" pattern against SecurityKey, which // names the IE carrying the key, never a key value. var protocolIENames = map[ProtocolIEID]string{ - IDAllowedNSSAI: "AllowedNSSAI", - IDAMFName: "AMFName", - IDAMFOverloadResponse: "AMFOverloadResponse", - IDAMFSetID: "AMFSetID", - IDAMFTNLAssociationFailedToSetupList: "AMF-TNLAssociationFailedToSetupList", - IDAMFTNLAssociationSetupList: "AMF-TNLAssociationSetupList", - IDAMFTNLAssociationToAddList: "AMF-TNLAssociationToAddList", - IDAMFTNLAssociationToRemoveList: "AMF-TNLAssociationToRemoveList", - IDAMFTNLAssociationToUpdateList: "AMF-TNLAssociationToUpdateList", - IDAMFTrafficLoadReductionIndication: "AMFTrafficLoadReductionIndication", - IDAMFUENGAPID: "AMF-UE-NGAP-ID", - IDAssistanceDataForPaging: "AssistanceDataForPaging", - IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", - IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", - IDCancelAllWarningMessages: "CancelAllWarningMessages", - IDCause: "Cause", - IDCellIDListForRestart: "CellIDListForRestart", - IDConcurrentWarningMessageInd: "ConcurrentWarningMessageInd", - IDCoreNetworkAssistanceInformationForInactive: "CoreNetworkAssistanceInformationForInactive", - IDCriticalityDiagnostics: "CriticalityDiagnostics", - IDDataCodingScheme: "DataCodingScheme", - IDDefaultPagingDRX: "DefaultPagingDRX", - IDDirectForwardingPathAvailability: "DirectForwardingPathAvailability", - IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", - IDEmergencyFallbackIndicator: "EmergencyFallbackIndicator", - IDEUTRACGI: "EUTRA-CGI", - IDFiveGSTMSI: "FiveG-S-TMSI", - IDGlobalRANNodeID: "GlobalRANNodeID", - IDGUAMI: "GUAMI", - IDHandoverType: "HandoverType", - IDIMSVoiceSupportIndicator: "IMSVoiceSupportIndicator", - IDIndexToRFSP: "IndexToRFSP", - IDInfoOnRecommendedCellsAndRANNodesForPaging: "InfoOnRecommendedCellsAndRANNodesForPaging", - IDLocationReportingRequestType: "LocationReportingRequestType", - IDMaskedIMEISV: "MaskedIMEISV", - IDMessageIdentifier: "MessageIdentifier", - IDMobilityRestrictionList: "MobilityRestrictionList", - IDNASC: "NASC", - IDNASPDU: "NAS-PDU", - IDNASSecurityParametersFromNGRAN: "NASSecurityParametersFromNGRAN", - IDNewAMFUENGAPID: "NewAMF-UE-NGAP-ID", - IDNewSecurityContextInd: "NewSecurityContextInd", - IDNGAPMessage: "NGAP-Message", - IDNGRANCGI: "NGRAN-CGI", - IDNGRANTraceID: "NGRANTraceID", - IDNRCGI: "NR-CGI", - IDNRPPaPDU: "NRPPa-PDU", - IDNumberOfBroadcastsRequested: "NumberOfBroadcastsRequested", - IDOldAMF: "OldAMF", - IDOverloadStartNSSAIList: "OverloadStartNSSAIList", - IDPagingDRX: "PagingDRX", - IDPagingOrigin: "PagingOrigin", - IDPagingPriority: "PagingPriority", - IDPDUSessionResourceAdmittedList: "PDUSessionResourceAdmittedList", - IDPDUSessionResourceFailedToModifyListModRes: "PDUSessionResourceFailedToModifyListModRes", - IDPDUSessionResourceFailedToSetupListCxtRes: "PDUSessionResourceFailedToSetupListCxtRes", - IDPDUSessionResourceFailedToSetupListHOAck: "PDUSessionResourceFailedToSetupListHOAck", - IDPDUSessionResourceFailedToSetupListPSReq: "PDUSessionResourceFailedToSetupListPSReq", - IDPDUSessionResourceFailedToSetupListSURes: "PDUSessionResourceFailedToSetupListSURes", - IDPDUSessionResourceHandoverList: "PDUSessionResourceHandoverList", - IDPDUSessionResourceListCxtRelCpl: "PDUSessionResourceListCxtRelCpl", - IDPDUSessionResourceListHORqd: "PDUSessionResourceListHORqd", - IDPDUSessionResourceModifyListModCfm: "PDUSessionResourceModifyListModCfm", - IDPDUSessionResourceModifyListModInd: "PDUSessionResourceModifyListModInd", - IDPDUSessionResourceModifyListModReq: "PDUSessionResourceModifyListModReq", - IDPDUSessionResourceModifyListModRes: "PDUSessionResourceModifyListModRes", - IDPDUSessionResourceNotifyList: "PDUSessionResourceNotifyList", - IDPDUSessionResourceReleasedListNot: "PDUSessionResourceReleasedListNot", - IDPDUSessionResourceReleasedListPSAck: "PDUSessionResourceReleasedListPSAck", - IDPDUSessionResourceReleasedListPSFail: "PDUSessionResourceReleasedListPSFail", - IDPDUSessionResourceReleasedListRelRes: "PDUSessionResourceReleasedListRelRes", - IDPDUSessionResourceSetupListCxtReq: "PDUSessionResourceSetupListCxtReq", - IDPDUSessionResourceSetupListCxtRes: "PDUSessionResourceSetupListCxtRes", - IDPDUSessionResourceSetupListHOReq: "PDUSessionResourceSetupListHOReq", - IDPDUSessionResourceSetupListSUReq: "PDUSessionResourceSetupListSUReq", - IDPDUSessionResourceSetupListSURes: "PDUSessionResourceSetupListSURes", - IDPDUSessionResourceToBeSwitchedDLList: "PDUSessionResourceToBeSwitchedDLList", - IDPDUSessionResourceSwitchedList: "PDUSessionResourceSwitchedList", - IDPDUSessionResourceToReleaseListHOCmd: "PDUSessionResourceToReleaseListHOCmd", - IDPDUSessionResourceToReleaseListRelCmd: "PDUSessionResourceToReleaseListRelCmd", - IDPLMNSupportList: "PLMNSupportList", - IDPWSFailedCellIDList: "PWSFailedCellIDList", - IDRANNodeName: "RANNodeName", - IDRANPagingPriority: "RANPagingPriority", - IDRANStatusTransferTransparentContainer: "RANStatusTransfer-TransparentContainer", - IDRANUENGAPID: "RAN-UE-NGAP-ID", - IDRelativeAMFCapacity: "RelativeAMFCapacity", - IDRepetitionPeriod: "RepetitionPeriod", - IDResetType: "ResetType", - IDRoutingID: "RoutingID", - IDRRCEstablishmentCause: "RRCEstablishmentCause", - IDRRCInactiveTransitionReportRequest: "RRCInactiveTransitionReportRequest", - IDRRCState: "RRCState", - IDSecurityContext: "SecurityContext", - IDSecurityKey: "SecurityKey", - IDSerialNumber: "SerialNumber", - IDServedGUAMIList: "ServedGUAMIList", - IDSliceSupportList: "SliceSupportList", - IDSONConfigurationTransferDL: "SONConfigurationTransferDL", - IDSONConfigurationTransferUL: "SONConfigurationTransferUL", - IDSourceAMFUENGAPID: "SourceAMF-UE-NGAP-ID", - IDSourceToTargetTransparentContainer: "SourceToTarget-TransparentContainer", - IDSupportedTAList: "SupportedTAList", - IDTAIListForPaging: "TAIListForPaging", - IDTAIListForRestart: "TAIListForRestart", - IDTargetID: "TargetID", - IDTargetToSourceTransparentContainer: "TargetToSource-TransparentContainer", - IDTimeToWait: "TimeToWait", - IDTraceActivation: "TraceActivation", - IDTraceCollectionEntityIPAddress: "TraceCollectionEntityIPAddress", - IDUEAggregateMaximumBitRate: "UEAggregateMaximumBitRate", - IDUEAssociatedLogicalNGConnectionList: "UE-associatedLogicalNG-connectionList", - IDUEContextRequest: "UEContextRequest", - IDUENGAPIDs: "UE-NGAP-IDs", - IDUEPagingIdentity: "UEPagingIdentity", - IDUEPresenceInAreaOfInterestList: "UEPresenceInAreaOfInterestList", - IDUERadioCapability: "UERadioCapability", - IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", - IDUESecurityCapabilities: "UESecurityCapabilities", - IDUnavailableGUAMIList: "UnavailableGUAMIList", - IDUserLocationInformation: "UserLocationInformation", - IDWarningAreaList: "WarningAreaList", - IDWarningMessageContents: "WarningMessageContents", - IDWarningSecurityInfo: "WarningSecurityInfo", - IDWarningType: "WarningType", - IDAdditionalULNGUUPTNLInformation: "AdditionalUL-NGU-UP-TNLInformation", - IDDataForwardingNotPossible: "DataForwardingNotPossible", - IDDLNGUUPTNLInformation: "DL-NGU-UP-TNLInformation", - IDNetworkInstance: "NetworkInstance", - IDPDUSessionAggregateMaximumBitRate: "PDUSessionAggregateMaximumBitRate", - IDPDUSessionResourceFailedToModifyListModCfm: "PDUSessionResourceFailedToModifyListModCfm", - IDPDUSessionResourceFailedToSetupListCxtFail: "PDUSessionResourceFailedToSetupListCxtFail", - IDPDUSessionResourceListCxtRelReq: "PDUSessionResourceListCxtRelReq", - IDPDUSessionType: "PDUSessionType", - IDQosFlowAddOrModifyRequestList: "QosFlowAddOrModifyRequestList", - IDQosFlowSetupRequestList: "QosFlowSetupRequestList", - IDQosFlowToReleaseList: "QosFlowToReleaseList", - IDSecurityIndication: "SecurityIndication", - IDULNGUUPTNLInformation: "UL-NGU-UP-TNLInformation", - IDULNGUUPTNLModifyList: "UL-NGU-UP-TNLModifyList", - IDWarningAreaCoordinates: "WarningAreaCoordinates", - IDPDUSessionResourceSecondaryRATUsageList: "PDUSessionResourceSecondaryRATUsageList", - IDHandoverFlag: "HandoverFlag", - IDSecondaryRATUsageInformation: "SecondaryRATUsageInformation", - IDPDUSessionResourceReleaseResponseTransfer: "PDUSessionResourceReleaseResponseTransfer", - IDRedirectionVoiceFallback: "RedirectionVoiceFallback", - IDUERetentionInformation: "UERetentionInformation", - IDSNSSAI: "S-NSSAI", - IDPSCellInformation: "PSCellInformation", - IDLastEUTRANPLMNIdentity: "LastEUTRAN-PLMNIdentity", - IDMaximumIntegrityProtectedDataRateDL: "MaximumIntegrityProtectedDataRate-DL", - IDAdditionalDLForwardingUPTNLInformation: "AdditionalDLForwardingUPTNLInformation", - IDAdditionalDLUPTNLInformationForHOList: "AdditionalDLUPTNLInformationForHOList", - IDAdditionalNGUUPTNLInformation: "AdditionalNGU-UP-TNLInformation", - IDAdditionalDLQosFlowPerTNLInformation: "AdditionalDLQosFlowPerTNLInformation", - IDSecurityResult: "SecurityResult", - IDENDCSONConfigurationTransferDL: "ENDC-SONConfigurationTransferDL", - IDENDCSONConfigurationTransferUL: "ENDC-SONConfigurationTransferUL", - IDNewGUAMI: "NewGUAMI", - IDULForwardingUPTNLInformation: "ULForwardingUP-TNLInformation", - IDCNAssistedRANTuning: "CNAssistedRANTuning", - IDCommonNetworkInstance: "CommonNetworkInstance", - IDNGRANTNLAssociationToRemoveList: "NGRAN-TNLAssociationToRemoveList", - IDTNLAssociationTransportLayerAddressNGRAN: "TNLAssociationTransportLayerAddressNGRAN", - IDEndpointIPAddressAndPort: "EndpointIPAddressAndPort", - IDSourceToTargetAMFInformationReroute: "SourceToTarget-AMFInformationReroute", - IDAdditionalULForwardingUPTNLInformation: "AdditionalULForwardingUPTNLInformation", - IDSelectedPLMNIdentity: "SelectedPLMNIdentity", - IDGUAMIType: "GUAMIType", - IDSRVCCOperationPossible: "SRVCCOperationPossible", - IDAdditionalRedundantDLNGUUPTNLInformation: "AdditionalRedundantDL-NGU-UP-TNLInformation", - IDAdditionalRedundantDLQosFlowPerTNLInformation: "AdditionalRedundantDLQosFlowPerTNLInformation", - IDAdditionalRedundantNGUUPTNLInformation: "AdditionalRedundantNGU-UP-TNLInformation", - IDAdditionalRedundantULNGUUPTNLInformation: "AdditionalRedundantUL-NGU-UP-TNLInformation", - IDRedundantCommonNetworkInstance: "RedundantCommonNetworkInstance", - IDRedundantDLNGUTNLInformationReused: "RedundantDL-NGU-TNLInformationReused", - IDRedundantDLNGUUPTNLInformation: "RedundantDL-NGU-UP-TNLInformation", - IDRedundantDLQosFlowPerTNLInformation: "RedundantDLQosFlowPerTNLInformation", - IDRedundantULNGUUPTNLInformation: "RedundantUL-NGU-UP-TNLInformation", - IDRedundantPDUSessionInformation: "RedundantPDUSessionInformation", - IDIABAuthorized: "IAB-Authorized", - IDIABSupported: "IAB-Supported", - IDIABNodeIndication: "IABNodeIndication", - IDNBIoTPagingDRX: "NB-IoT-PagingDRX", - IDNBIoTPagingeDRXInfo: "NB-IoT-Paging-eDRXInfo", - IDNBIoTDefaultPagingDRX: "NB-IoT-DefaultPagingDRX", - IDEnhancedCoverageRestriction: "Enhanced-CoverageRestriction", - IDExtendedConnectedTime: "Extended-ConnectedTime", - IDPagingAssisDataforCEcapabUE: "PagingAssisDataforCEcapabUE", - IDWUSAssistanceInformation: "WUS-Assistance-Information", - IDUEDifferentiationInfo: "UE-DifferentiationInfo", - IDLTEV2XServicesAuthorized: "LTEV2XServicesAuthorized", - IDNRV2XServicesAuthorized: "NRV2XServicesAuthorized", - IDLTEUESidelinkAggregateMaximumBitrate: "LTEUESidelinkAggregateMaximumBitrate", - IDNRUESidelinkAggregateMaximumBitrate: "NRUESidelinkAggregateMaximumBitrate", - IDPC5QoSParameters: "PC5QoSParameters", - IDCEmodeBrestricted: "CEmodeBrestricted", - IDEUTRAPagingeDRXInformation: "EUTRA-PagingeDRXInformation", - IDCEmodeBSupportIndicator: "CEmodeBSupport-Indicator", - IDLTEMIndication: "LTEM-Indication", - IDEndIndication: "EndIndication", - IDEDTSession: "EDT-Session", - IDUECapabilityInfoRequest: "UECapabilityInfoRequest", - IDUEUPCIoTSupport: "UE-UP-CIoT-Support", - IDRRCResumeCause: "RRC-Resume-Cause", - IDRGLevelWirelineAccessCharacteristics: "RGLevelWirelineAccessCharacteristics", - IDWAGFIdentityInformation: "W-AGFIdentityInformation", - IDAuthenticatedIndication: "AuthenticatedIndication", - IDTNGFIdentityInformation: "TNGFIdentityInformation", - IDTWIFIdentityInformation: "TWIFIdentityInformation", - IDDataForwardingResponseERABList: "DataForwardingResponseERABList", - IDIntersystemSONConfigurationTransferDL: "IntersystemSONConfigurationTransferDL", - IDIntersystemSONConfigurationTransferUL: "IntersystemSONConfigurationTransferUL", - IDManagementBasedMDTPLMNList: "ManagementBasedMDTPLMNList", - IDNPNSupport: "NPN-Support", - IDNPNAccessInformation: "NPN-AccessInformation", - IDTargettoSourceFailureTransparentContainer: "TargettoSource-Failure-TransparentContainer", - IDUERadioCapabilityID: "UERadioCapabilityID", - IDUERadioCapabilityEUTRAFormat: "UERadioCapability-EUTRA-Format", - IDNotifySourceNGRANNode: "NotifySourceNGRANNode", - IDExtendedSliceSupportList: "ExtendedSliceSupportList", - IDExtendedRANNodeName: "Extended-RANNodeName", - IDExtendedAMFName: "Extended-AMFName", - IDMBSSessionToReleaseList: "MBSSessionToReleaseList", - IDMBSSessionSetupRequestList: "MBSSessionSetupRequestList", - IDMBSSessionSetuporModifyRequestList: "MBSSessionSetuporModifyRequestList", - IDOnboardingSupport: "OnboardingSupport", - IDTimeSyncAssistanceInfo: "TimeSyncAssistanceInfo", - IDQMCConfigInfo: "QMCConfigInfo", - IDQMCDeactivation: "QMCDeactivation", - IDNRPagingeDRXInformation: "NR-PagingeDRXInformation", - IDRedCapIndication: "RedCapIndication", - IDTargetNSSAIInformation: "TargetNSSAIInformation", - IDUESliceMaximumBitRateList: "UESliceMaximumBitRateList", - IDPagingCause: "PagingCause", - IDPEIPSassistanceInformation: "PEIPSassistanceInformation", - IDFiveGProSeAuthorized: "FiveG-ProSeAuthorized", - IDFiveGProSeUEPC5AggregateMaximumBitRate: "FiveG-ProSeUEPC5AggregateMaximumBitRate", - IDFiveGProSePC5QoSParameters: "FiveG-ProSePC5QoSParameters", - IDManagementBasedMDTPLMNModificationList: "ManagementBasedMDTPLMNModificationList", - IDNetworkControlledRepeaterAuthorized: "NetworkControlledRepeaterAuthorized", - IDSelectedNID: "SelectedNID", - IDAerialUEsubscriptionInformation: "AerialUEsubscriptionInformation", - IDNRA2XServicesAuthorized: "NR-A2X-ServicesAuthorized", - IDLTEA2XServicesAuthorized: "LTE-A2X-ServicesAuthorized", - IDNRA2XUEPC5AggregateMaximumBitRate: "NR-A2X-UE-PC5-AggregateMaximumBitRate", - IDLTEA2XUEPC5AggregateMaximumBitRate: "LTE-A2X-UE-PC5-AggregateMaximumBitRate", - IDA2XPC5QoSParameters: "A2X-PC5-QoS-Parameters", - IDDownlinkTLContainer: "DownlinkTLContainer", - IDMobileIABAuthorized: "MobileIAB-Authorized", - IDMobileIABNodeIndication: "MobileIABNodeIndication", - IDNoPDUSessionIndication: "NoPDUSessionIndication", - IDMobileIABSupported: "MobileIAB-Supported", - IDPartiallyAllowedNSSAI: "Partially-Allowed-NSSAI", - IDERedCapIndication: "ERedCapIndication", - IDXrDeviceWith2Rx: "XrDeviceWith2Rx", - IDSLPositioningRangingServiceInfo: "SLPositioningRangingServiceInfo", - IDUserPlaneFailureIndication: "UserPlaneFailureIndication", - IDAUN3DeviceAccessInfo: "AUN3DeviceAccessInfo", - IDExtendedBackupAMFName: "ExtendedBackupAMFName", - IDExtendedOldAMF: "ExtendedOldAMF", - IDAMFUENGAPID2: "AMF-UE-NGAP-ID2", - IDGUAMIList: "GUAMIList", - IDGWContextReleaseIndication: "GW-Context-Release-Indication", - IDSourceAMFGUAMI: "SourceAMF-GUAMI", - IDRequestedNSSAI: "RequestedNSSAI", - IDTargetRANNodeID: "Target-RAN-Node-ID", - IDAIOTFIdentifier: "AIOTFIdentifier", - IDAIoTSupport: "AIoT-Support", - IDAIOTFName: "AIOTFName", - IDLPWUSPSAssistanceInformation: "LPWUSPSAssistanceInformation", - IDAdditionalULI: "AdditionalULI", - IDLPWUSDisableIndication: "LPWUSDisableIndication", + IDAllowedNSSAI: "AllowedNSSAI", + IDAMFName: "AMFName", + IDAMFOverloadResponse: "AMFOverloadResponse", + IDAMFSetID: "AMFSetID", + IDAMFTNLAssociationFailedToSetupList: "AMF-TNLAssociationFailedToSetupList", + IDAMFTNLAssociationSetupList: "AMF-TNLAssociationSetupList", + IDAMFTNLAssociationToAddList: "AMF-TNLAssociationToAddList", + IDAMFTNLAssociationToRemoveList: "AMF-TNLAssociationToRemoveList", + IDAMFTNLAssociationToUpdateList: "AMF-TNLAssociationToUpdateList", + IDAMFTrafficLoadReductionIndication: "AMFTrafficLoadReductionIndication", + IDAMFUENGAPID: "AMF-UE-NGAP-ID", + IDAssistanceDataForPaging: "AssistanceDataForPaging", + IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", + IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", + IDCancelAllWarningMessages: "CancelAllWarningMessages", + IDCause: "Cause", + IDCellIDListForRestart: "CellIDListForRestart", + IDConcurrentWarningMessageInd: "ConcurrentWarningMessageInd", + IDCoreNetworkAssistanceInformationForInactive: "CoreNetworkAssistanceInformationForInactive", + IDCriticalityDiagnostics: "CriticalityDiagnostics", + IDDataCodingScheme: "DataCodingScheme", + IDDefaultPagingDRX: "DefaultPagingDRX", + IDDirectForwardingPathAvailability: "DirectForwardingPathAvailability", + IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", + IDEmergencyFallbackIndicator: "EmergencyFallbackIndicator", + IDEUTRACGI: "EUTRA-CGI", + IDFiveGSTMSI: "FiveG-S-TMSI", + IDGlobalRANNodeID: "GlobalRANNodeID", + IDGUAMI: "GUAMI", + IDHandoverType: "HandoverType", + IDIMSVoiceSupportIndicator: "IMSVoiceSupportIndicator", + IDIndexToRFSP: "IndexToRFSP", + IDInfoOnRecommendedCellsAndRANNodesForPaging: "InfoOnRecommendedCellsAndRANNodesForPaging", + IDLocationReportingRequestType: "LocationReportingRequestType", + IDMaskedIMEISV: "MaskedIMEISV", + IDMessageIdentifier: "MessageIdentifier", + IDMobilityRestrictionList: "MobilityRestrictionList", + IDNASC: "NASC", + IDNASPDU: "NAS-PDU", + IDNASSecurityParametersFromNGRAN: "NASSecurityParametersFromNGRAN", + IDNewAMFUENGAPID: "NewAMF-UE-NGAP-ID", + IDNewSecurityContextInd: "NewSecurityContextInd", + IDNGAPMessage: "NGAP-Message", + IDNGRANCGI: "NGRAN-CGI", + IDNGRANTraceID: "NGRANTraceID", + IDNRCGI: "NR-CGI", + IDNRPPaPDU: "NRPPa-PDU", + IDNumberOfBroadcastsRequested: "NumberOfBroadcastsRequested", + IDOldAMF: "OldAMF", + IDOverloadStartNSSAIList: "OverloadStartNSSAIList", + IDPagingDRX: "PagingDRX", + IDPagingOrigin: "PagingOrigin", + IDPagingPriority: "PagingPriority", + IDPDUSessionResourceAdmittedList: "PDUSessionResourceAdmittedList", + IDPDUSessionResourceFailedToModifyListModRes: "PDUSessionResourceFailedToModifyListModRes", + IDPDUSessionResourceFailedToSetupListCxtRes: "PDUSessionResourceFailedToSetupListCxtRes", + IDPDUSessionResourceFailedToSetupListHOAck: "PDUSessionResourceFailedToSetupListHOAck", + IDPDUSessionResourceFailedToSetupListPSReq: "PDUSessionResourceFailedToSetupListPSReq", + IDPDUSessionResourceFailedToSetupListSURes: "PDUSessionResourceFailedToSetupListSURes", + IDPDUSessionResourceHandoverList: "PDUSessionResourceHandoverList", + IDPDUSessionResourceListCxtRelCpl: "PDUSessionResourceListCxtRelCpl", + IDPDUSessionResourceListHORqd: "PDUSessionResourceListHORqd", + IDPDUSessionResourceModifyListModCfm: "PDUSessionResourceModifyListModCfm", + IDPDUSessionResourceModifyListModInd: "PDUSessionResourceModifyListModInd", + IDPDUSessionResourceModifyListModReq: "PDUSessionResourceModifyListModReq", + IDPDUSessionResourceModifyListModRes: "PDUSessionResourceModifyListModRes", + IDPDUSessionResourceNotifyList: "PDUSessionResourceNotifyList", + IDPDUSessionResourceReleasedListNot: "PDUSessionResourceReleasedListNot", + IDPDUSessionResourceReleasedListPSAck: "PDUSessionResourceReleasedListPSAck", + IDPDUSessionResourceReleasedListPSFail: "PDUSessionResourceReleasedListPSFail", + IDPDUSessionResourceReleasedListRelRes: "PDUSessionResourceReleasedListRelRes", + IDPDUSessionResourceSetupListCxtReq: "PDUSessionResourceSetupListCxtReq", + IDPDUSessionResourceSetupListCxtRes: "PDUSessionResourceSetupListCxtRes", + IDPDUSessionResourceSetupListHOReq: "PDUSessionResourceSetupListHOReq", + IDPDUSessionResourceSetupListSUReq: "PDUSessionResourceSetupListSUReq", + IDPDUSessionResourceSetupListSURes: "PDUSessionResourceSetupListSURes", + IDPDUSessionResourceToBeSwitchedDLList: "PDUSessionResourceToBeSwitchedDLList", + IDPDUSessionResourceSwitchedList: "PDUSessionResourceSwitchedList", + IDPDUSessionResourceToReleaseListHOCmd: "PDUSessionResourceToReleaseListHOCmd", + IDPDUSessionResourceToReleaseListRelCmd: "PDUSessionResourceToReleaseListRelCmd", + IDPLMNSupportList: "PLMNSupportList", + IDPWSFailedCellIDList: "PWSFailedCellIDList", + IDRANNodeName: "RANNodeName", + IDRANPagingPriority: "RANPagingPriority", + IDRANStatusTransferTransparentContainer: "RANStatusTransfer-TransparentContainer", + IDRANUENGAPID: "RAN-UE-NGAP-ID", + IDRelativeAMFCapacity: "RelativeAMFCapacity", + IDRepetitionPeriod: "RepetitionPeriod", + IDResetType: "ResetType", + IDRoutingID: "RoutingID", + IDRRCEstablishmentCause: "RRCEstablishmentCause", + IDRRCInactiveTransitionReportRequest: "RRCInactiveTransitionReportRequest", + IDRRCState: "RRCState", + IDSecurityContext: "SecurityContext", + IDSecurityKey: "SecurityKey", + IDSerialNumber: "SerialNumber", + IDServedGUAMIList: "ServedGUAMIList", + IDSliceSupportList: "SliceSupportList", + IDSONConfigurationTransferDL: "SONConfigurationTransferDL", + IDSONConfigurationTransferUL: "SONConfigurationTransferUL", + IDSourceAMFUENGAPID: "SourceAMF-UE-NGAP-ID", + IDSourceToTargetTransparentContainer: "SourceToTarget-TransparentContainer", + IDSupportedTAList: "SupportedTAList", + IDTAIListForPaging: "TAIListForPaging", + IDTAIListForRestart: "TAIListForRestart", + IDTargetID: "TargetID", + IDTargetToSourceTransparentContainer: "TargetToSource-TransparentContainer", + IDTimeToWait: "TimeToWait", + IDTraceActivation: "TraceActivation", + IDTraceCollectionEntityIPAddress: "TraceCollectionEntityIPAddress", + IDUEAggregateMaximumBitRate: "UEAggregateMaximumBitRate", + IDUEAssociatedLogicalNGConnectionList: "UE-associatedLogicalNG-connectionList", + IDUEContextRequest: "UEContextRequest", + IDUENGAPIDs: "UE-NGAP-IDs", + IDUEPagingIdentity: "UEPagingIdentity", + IDUEPresenceInAreaOfInterestList: "UEPresenceInAreaOfInterestList", + IDUERadioCapability: "UERadioCapability", + IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", + IDUESecurityCapabilities: "UESecurityCapabilities", + IDUnavailableGUAMIList: "UnavailableGUAMIList", + IDUserLocationInformation: "UserLocationInformation", + IDWarningAreaList: "WarningAreaList", + IDWarningMessageContents: "WarningMessageContents", + IDWarningSecurityInfo: "WarningSecurityInfo", + IDWarningType: "WarningType", + IDAdditionalULNGUUPTNLInformation: "AdditionalUL-NGU-UP-TNLInformation", + IDDataForwardingNotPossible: "DataForwardingNotPossible", + IDDLNGUUPTNLInformation: "DL-NGU-UP-TNLInformation", + IDNetworkInstance: "NetworkInstance", + IDPDUSessionAggregateMaximumBitRate: "PDUSessionAggregateMaximumBitRate", + IDPDUSessionResourceFailedToModifyListModCfm: "PDUSessionResourceFailedToModifyListModCfm", + IDPDUSessionResourceFailedToSetupListCxtFail: "PDUSessionResourceFailedToSetupListCxtFail", + IDPDUSessionResourceListCxtRelReq: "PDUSessionResourceListCxtRelReq", + IDPDUSessionType: "PDUSessionType", + IDQosFlowAddOrModifyRequestList: "QosFlowAddOrModifyRequestList", + IDQosFlowSetupRequestList: "QosFlowSetupRequestList", + IDQosFlowToReleaseList: "QosFlowToReleaseList", + IDSecurityIndication: "SecurityIndication", + IDULNGUUPTNLInformation: "UL-NGU-UP-TNLInformation", + IDULNGUUPTNLModifyList: "UL-NGU-UP-TNLModifyList", + IDWarningAreaCoordinates: "WarningAreaCoordinates", + IDPDUSessionResourceSecondaryRATUsageList: "PDUSessionResourceSecondaryRATUsageList", + IDHandoverFlag: "HandoverFlag", + IDSecondaryRATUsageInformation: "SecondaryRATUsageInformation", + IDPDUSessionResourceReleaseResponseTransfer: "PDUSessionResourceReleaseResponseTransfer", + IDRedirectionVoiceFallback: "RedirectionVoiceFallback", + IDUERetentionInformation: "UERetentionInformation", + IDSNSSAI: "S-NSSAI", + IDPSCellInformation: "PSCellInformation", + IDLastEUTRANPLMNIdentity: "LastEUTRAN-PLMNIdentity", + IDMaximumIntegrityProtectedDataRateDL: "MaximumIntegrityProtectedDataRate-DL", + IDAdditionalDLForwardingUPTNLInformation: "AdditionalDLForwardingUPTNLInformation", + IDAdditionalDLUPTNLInformationForHOList: "AdditionalDLUPTNLInformationForHOList", + IDAdditionalNGUUPTNLInformation: "AdditionalNGU-UP-TNLInformation", + IDAdditionalDLQosFlowPerTNLInformation: "AdditionalDLQosFlowPerTNLInformation", + IDSecurityResult: "SecurityResult", + IDENDCSONConfigurationTransferDL: "ENDC-SONConfigurationTransferDL", + IDENDCSONConfigurationTransferUL: "ENDC-SONConfigurationTransferUL", + IDNewGUAMI: "NewGUAMI", + IDULForwardingUPTNLInformation: "ULForwardingUP-TNLInformation", + IDCNAssistedRANTuning: "CNAssistedRANTuning", + IDCommonNetworkInstance: "CommonNetworkInstance", + IDNGRANTNLAssociationToRemoveList: "NGRAN-TNLAssociationToRemoveList", + IDTNLAssociationTransportLayerAddressNGRAN: "TNLAssociationTransportLayerAddressNGRAN", + IDEndpointIPAddressAndPort: "EndpointIPAddressAndPort", + IDSourceToTargetAMFInformationReroute: "SourceToTarget-AMFInformationReroute", + IDAdditionalULForwardingUPTNLInformation: "AdditionalULForwardingUPTNLInformation", + IDSelectedPLMNIdentity: "SelectedPLMNIdentity", + IDGUAMIType: "GUAMIType", + IDSRVCCOperationPossible: "SRVCCOperationPossible", + IDAdditionalRedundantDLNGUUPTNLInformation: "AdditionalRedundantDL-NGU-UP-TNLInformation", + IDAdditionalRedundantDLQosFlowPerTNLInformation: "AdditionalRedundantDLQosFlowPerTNLInformation", + IDAdditionalRedundantNGUUPTNLInformation: "AdditionalRedundantNGU-UP-TNLInformation", + IDAdditionalRedundantULNGUUPTNLInformation: "AdditionalRedundantUL-NGU-UP-TNLInformation", + IDRedundantCommonNetworkInstance: "RedundantCommonNetworkInstance", + IDRedundantDLNGUTNLInformationReused: "RedundantDL-NGU-TNLInformationReused", + IDRedundantDLNGUUPTNLInformation: "RedundantDL-NGU-UP-TNLInformation", + IDRedundantDLQosFlowPerTNLInformation: "RedundantDLQosFlowPerTNLInformation", + IDRedundantULNGUUPTNLInformation: "RedundantUL-NGU-UP-TNLInformation", + IDRedundantPDUSessionInformation: "RedundantPDUSessionInformation", + IDIABAuthorized: "IAB-Authorized", + IDIABSupported: "IAB-Supported", + IDIABNodeIndication: "IABNodeIndication", + IDNBIoTPagingDRX: "NB-IoT-PagingDRX", + IDNBIoTPagingeDRXInfo: "NB-IoT-Paging-eDRXInfo", + IDNBIoTDefaultPagingDRX: "NB-IoT-DefaultPagingDRX", + IDEnhancedCoverageRestriction: "Enhanced-CoverageRestriction", + IDExtendedConnectedTime: "Extended-ConnectedTime", + IDPagingAssisDataforCEcapabUE: "PagingAssisDataforCEcapabUE", + IDWUSAssistanceInformation: "WUS-Assistance-Information", + IDUEDifferentiationInfo: "UE-DifferentiationInfo", + IDLTEV2XServicesAuthorized: "LTEV2XServicesAuthorized", + IDNRV2XServicesAuthorized: "NRV2XServicesAuthorized", + IDLTEUESidelinkAggregateMaximumBitrate: "LTEUESidelinkAggregateMaximumBitrate", + IDNRUESidelinkAggregateMaximumBitrate: "NRUESidelinkAggregateMaximumBitrate", + IDPC5QoSParameters: "PC5QoSParameters", + IDCEmodeBrestricted: "CEmodeBrestricted", + IDEUTRAPagingeDRXInformation: "EUTRA-PagingeDRXInformation", + IDCEmodeBSupportIndicator: "CEmodeBSupport-Indicator", + IDLTEMIndication: "LTEM-Indication", + IDEndIndication: "EndIndication", + IDEDTSession: "EDT-Session", + IDUECapabilityInfoRequest: "UECapabilityInfoRequest", + IDUEUPCIoTSupport: "UE-UP-CIoT-Support", + IDRRCResumeCause: "RRC-Resume-Cause", + IDRGLevelWirelineAccessCharacteristics: "RGLevelWirelineAccessCharacteristics", + IDWAGFIdentityInformation: "W-AGFIdentityInformation", + IDAuthenticatedIndication: "AuthenticatedIndication", + IDTNGFIdentityInformation: "TNGFIdentityInformation", + IDTWIFIdentityInformation: "TWIFIdentityInformation", + IDDataForwardingResponseERABList: "DataForwardingResponseERABList", + IDIntersystemSONConfigurationTransferDL: "IntersystemSONConfigurationTransferDL", + IDIntersystemSONConfigurationTransferUL: "IntersystemSONConfigurationTransferUL", + IDManagementBasedMDTPLMNList: "ManagementBasedMDTPLMNList", + IDNPNSupport: "NPN-Support", + IDNPNAccessInformation: "NPN-AccessInformation", + IDTargettoSourceFailureTransparentContainer: "TargettoSource-Failure-TransparentContainer", + IDUERadioCapabilityID: "UERadioCapabilityID", + IDUERadioCapabilityEUTRAFormat: "UERadioCapability-EUTRA-Format", + IDNotifySourceNGRANNode: "NotifySourceNGRANNode", + IDExtendedSliceSupportList: "ExtendedSliceSupportList", + IDExtendedRANNodeName: "Extended-RANNodeName", + IDExtendedAMFName: "Extended-AMFName", + IDMBSSessionToReleaseList: "MBSSessionToReleaseList", + IDMBSSessionSetupRequestList: "MBSSessionSetupRequestList", + IDMBSSessionSetuporModifyRequestList: "MBSSessionSetuporModifyRequestList", + IDOnboardingSupport: "OnboardingSupport", + IDTimeSyncAssistanceInfo: "TimeSyncAssistanceInfo", + IDQMCConfigInfo: "QMCConfigInfo", + IDQMCDeactivation: "QMCDeactivation", + IDNRPagingeDRXInformation: "NR-PagingeDRXInformation", + IDRedCapIndication: "RedCapIndication", + IDTargetNSSAIInformation: "TargetNSSAIInformation", + IDUESliceMaximumBitRateList: "UESliceMaximumBitRateList", + IDPagingCause: "PagingCause", + IDPEIPSassistanceInformation: "PEIPSassistanceInformation", + IDFiveGProSeAuthorized: "FiveG-ProSeAuthorized", + IDFiveGProSeUEPC5AggregateMaximumBitRate: "FiveG-ProSeUEPC5AggregateMaximumBitRate", + IDFiveGProSePC5QoSParameters: "FiveG-ProSePC5QoSParameters", + IDManagementBasedMDTPLMNModificationList: "ManagementBasedMDTPLMNModificationList", + IDNetworkControlledRepeaterAuthorized: "NetworkControlledRepeaterAuthorized", + IDSelectedNID: "SelectedNID", + IDAerialUEsubscriptionInformation: "AerialUEsubscriptionInformation", + IDNRA2XServicesAuthorized: "NR-A2X-ServicesAuthorized", + IDLTEA2XServicesAuthorized: "LTE-A2X-ServicesAuthorized", + IDNRA2XUEPC5AggregateMaximumBitRate: "NR-A2X-UE-PC5-AggregateMaximumBitRate", + IDLTEA2XUEPC5AggregateMaximumBitRate: "LTE-A2X-UE-PC5-AggregateMaximumBitRate", + IDA2XPC5QoSParameters: "A2X-PC5-QoS-Parameters", + IDDownlinkTLContainer: "DownlinkTLContainer", + IDMobileIABAuthorized: "MobileIAB-Authorized", + IDMobileIABNodeIndication: "MobileIABNodeIndication", + IDNoPDUSessionIndication: "NoPDUSessionIndication", + IDMobileIABSupported: "MobileIAB-Supported", + IDPartiallyAllowedNSSAI: "Partially-Allowed-NSSAI", + IDERedCapIndication: "ERedCapIndication", + IDXrDeviceWith2Rx: "XrDeviceWith2Rx", + IDSLPositioningRangingServiceInfo: "SLPositioningRangingServiceInfo", + IDUserPlaneFailureIndication: "UserPlaneFailureIndication", + IDAUN3DeviceAccessInfo: "AUN3DeviceAccessInfo", + IDExtendedBackupAMFName: "ExtendedBackupAMFName", + IDExtendedOldAMF: "ExtendedOldAMF", + IDAMFUENGAPID2: "AMF-UE-NGAP-ID2", + IDGUAMIList: "GUAMIList", + IDGWContextReleaseIndication: "GW-Context-Release-Indication", + IDSourceAMFGUAMI: "SourceAMF-GUAMI", + IDRequestedNSSAI: "RequestedNSSAI", + IDTargetRANNodeID: "Target-RAN-Node-ID", + IDAIOTFIdentifier: "AIOTFIdentifier", + IDAIoTSupport: "AIoT-Support", + IDAIOTFName: "AIOTFName", + IDLPWUSPSAssistanceInformation: "LPWUSPSAssistanceInformation", + IDAdditionalULI: "AdditionalULI", + IDLPWUSDisableIndication: "LPWUSDisableIndication", + IDOldAssociatedQosFlowListULendmarkerexpected: "OldAssociatedQosFlowList-ULendmarkerexpected", + IDCNTypeRestrictionsForEquivalent: "CNTypeRestrictionsForEquivalent", + IDCNTypeRestrictionsForServing: "CNTypeRestrictionsForServing", + IDULForwarding: "ULForwarding", + IDLocationReportingAdditionalInfo: "LocationReportingAdditionalInfo", + IDSCTPTLAs: "SCTP-TLAs", + IDRIMInformationTransfer: "RIMInformationTransfer", + IDTargetRNCID: "TargetRNC-ID", + IDRATInformation: "RAT-Information", + IDExtendedRATRestrictionInformation: "ExtendedRATRestrictionInformation", + IDQosMonitoringRequest: "QosMonitoringRequest", + IDSgNBUEX2APID: "SgNB-UE-X2AP-ID", + IDCNPacketDelayBudgetDL: "CNPacketDelayBudgetDL", + IDCNPacketDelayBudgetUL: "CNPacketDelayBudgetUL", + IDExtendedPacketDelayBudget: "ExtendedPacketDelayBudget", + IDRedundantQosFlowIndicator: "RedundantQosFlowIndicator", + IDTSCTrafficCharacteristics: "TSCTrafficCharacteristics", + IDUsedRSNInformation: "UsedRSNInformation", + IDNBIoTUEPriority: "NB-IoT-UEPriority", + IDULCPSecurityInformation: "UL-CP-SecurityInformation", + IDDLCPSecurityInformation: "DL-CP-SecurityInformation", + IDTAI: "TAI", + IDUERadioCapabilityForPagingOfNBIoT: "UERadioCapabilityForPagingOfNB-IoT", + IDAlternativeQoSParaSetList: "AlternativeQoSParaSetList", + IDCurrentQoSParaSetIndex: "CurrentQoSParaSetIndex", + IDPDUSessionResourceFailedToResumeListRESReq: "PDUSessionResourceFailedToResumeListRESReq", + IDPDUSessionResourceFailedToResumeListRESRes: "PDUSessionResourceFailedToResumeListRESRes", + IDPDUSessionResourceSuspendListSUSReq: "PDUSessionResourceSuspendListSUSReq", + IDPDUSessionResourceResumeListRESReq: "PDUSessionResourceResumeListRESReq", + IDPDUSessionResourceResumeListRESRes: "PDUSessionResourceResumeListRESRes", + IDSuspendRequestIndication: "Suspend-Request-Indication", + IDSuspendResponseIndication: "Suspend-Response-Indication", + IDGlobalTNGFID: "GlobalTNGF-ID", + IDGlobalTWIFID: "GlobalTWIF-ID", + IDGlobalWAGFID: "GlobalW-AGF-ID", + IDUserLocationInformationWAGF: "UserLocationInformationW-AGF", + IDUserLocationInformationTNGF: "UserLocationInformationTNGF", + IDUserLocationInformationTWIF: "UserLocationInformationTWIF", + IDSONInformationReport: "SONInformationReport", + IDUEHistoryInformationFromTheUE: "UEHistoryInformationFromTheUE", + IDMDTConfiguration: "MDTConfiguration", + IDPrivacyIndicator: "PrivacyIndicator", + IDTraceCollectionEntityURI: "TraceCollectionEntityURI", + IDNPNPagingAssistanceInformation: "NPN-PagingAssistanceInformation", + IDNPNMobilityInformation: "NPN-MobilityInformation", + IDNID: "NID", + IDDAPSRequestInfo: "DAPSRequestInfo", + IDDAPSResponseInfoList: "DAPSResponseInfoList", + IDEarlyStatusTransferTransparentContainer: "EarlyStatusTransfer-TransparentContainer", + IDExtendedTAISliceSupportList: "ExtendedTAISliceSupportList", + IDConfiguredTACIndication: "ConfiguredTACIndication", + IDGlobalCableID: "GlobalCable-ID", + IDQosMonitoringReportingFrequency: "QosMonitoringReportingFrequency", + IDQosFlowParametersList: "QosFlowParametersList", + IDQosFlowFeedbackList: "QosFlowFeedbackList", + IDBurstArrivalTimeDownlink: "BurstArrivalTimeDownlink", + IDExtendedUEIdentityIndexValue: "ExtendedUEIdentityIndexValue", + IDPduSessionExpectedUEActivityBehaviour: "PduSessionExpectedUEActivityBehaviour", + IDMicoAllPLMN: "MicoAllPLMN", + IDQosFlowFailedToSetupList: "QosFlowFailedToSetupList", + IDSourceTNLAddrInfo: "SourceTNLAddrInfo", + IDExtendedReportIntervalMDT: "ExtendedReportIntervalMDT", + IDSourceNodeID: "SourceNodeID", + IDNRNTNTAIInformation: "NRNTNTAIInformation", + IDUEContextReferenceAtSource: "UEContextReferenceAtSource", + IDLastVisitedPSCellList: "LastVisitedPSCellList", + IDIntersystemSONInformationRequest: "IntersystemSONInformationRequest", + IDIntersystemSONInformationReply: "IntersystemSONInformationReply", + IDEnergySavingIndication: "EnergySavingIndication", + IDIntersystemResourceStatusUpdate: "IntersystemResourceStatusUpdate", + IDSuccessfulHandoverReportList: "SuccessfulHandoverReportList", + IDMBSAreaSessionID: "MBS-AreaSessionID", + IDMBSQoSFlowsToBeSetupList: "MBS-QoSFlowsToBeSetupList", + IDMBSQoSFlowsToBeSetupModList: "MBS-QoSFlowsToBeSetupModList", + IDMBSServiceArea: "MBS-ServiceArea", + IDMBSSessionID: "MBS-SessionID", + IDMBSDistributionReleaseRequestTransfer: "MBS-DistributionReleaseRequestTransfer", + IDMBSDistributionSetupRequestTransfer: "MBS-DistributionSetupRequestTransfer", + IDMBSDistributionSetupResponseTransfer: "MBS-DistributionSetupResponseTransfer", + IDMBSDistributionSetupUnsuccessfulTransfer: "MBS-DistributionSetupUnsuccessfulTransfer", + IDMulticastSessionActivationRequestTransfer: "MulticastSessionActivationRequestTransfer", + IDMulticastSessionDeactivationRequestTransfer: "MulticastSessionDeactivationRequestTransfer", + IDMulticastSessionUpdateRequestTransfer: "MulticastSessionUpdateRequestTransfer", + IDMulticastGroupPagingAreaList: "MulticastGroupPagingAreaList", + IDMBSSupportIndicator: "MBS-SupportIndicator", + IDMBSSessionFailedtoSetupList: "MBSSessionFailedtoSetupList", + IDMBSSessionFailedtoSetuporModifyList: "MBSSessionFailedtoSetuporModifyList", + IDMBSSessionSetupResponseList: "MBSSessionSetupResponseList", + IDMBSSessionSetuporModifyResponseList: "MBSSessionSetuporModifyResponseList", + IDMBSSessionSetupFailureTransfer: "MBSSessionSetupFailureTransfer", + IDMBSSessionSetupRequestTransfer: "MBSSessionSetupRequestTransfer", + IDMBSSessionSetupResponseTransfer: "MBSSessionSetupResponseTransfer", + IDMBSActiveSessionInformationSourcetoTargetList: "MBS-ActiveSessionInformation-SourcetoTargetList", + IDMBSActiveSessionInformationTargettoSourceList: "MBS-ActiveSessionInformation-TargettoSourceList", + IDSurvivalTime: "SurvivalTime", + IDPDUSessionPairID: "PDUSessionPairID", + IDM4ReportAmount: "M4ReportAmount", + IDM5ReportAmount: "M5ReportAmount", + IDM6ReportAmount: "M6ReportAmount", + IDM7ReportAmount: "M7ReportAmount", + IDIncludeBeamMeasurementsIndication: "IncludeBeamMeasurementsIndication", + IDExcessPacketDelayThresholdConfiguration: "ExcessPacketDelayThresholdConfiguration", + IDPagingCauseIndicationForVoiceService: "PagingCauseIndicationForVoiceService", + IDMBSSessionModificationFailureTransfer: "MBSSessionModificationFailureTransfer", + IDMBSSessionModificationRequestTransfer: "MBSSessionModificationRequestTransfer", + IDMBSSessionModificationResponseTransfer: "MBSSessionModificationResponseTransfer", + IDMBSQoSFlowToReleaseList: "MBS-QoSFlowToReleaseList", + IDMBSSessionTNLInfo5GC: "MBS-SessionTNLInfo5GC", + IDTAINSAGSupportList: "TAINSAGSupportList", + IDSourceNodeTNLAddrInfo: "SourceNodeTNLAddrInfo", + IDNGAPIESupportInformationRequestList: "NGAPIESupportInformationRequestList", + IDNGAPIESupportInformationResponseList: "NGAPIESupportInformationResponseList", + IDMBSSessionFSAIDList: "MBS-SessionFSAIDList", + IDMBSSessionReleaseResponseTransfer: "MBSSessionReleaseResponseTransfer", + IDEarlyMeasurement: "EarlyMeasurement", + IDBeamMeasurementsReportConfiguration: "BeamMeasurementsReportConfiguration", + IDHFCNodeIDnew: "HFCNode-ID-new", + IDGlobalCableIDnew: "GlobalCable-ID-new", + IDTargetHomeENBID: "TargetHomeENB-ID", + IDHashedUEIdentityIndexValue: "HashedUEIdentityIndexValue", + IDExtendedMobilityInformation: "ExtendedMobilityInformation", + IDAdditionalCancelledlocationReportingReferenceIDList: "AdditionalCancelledlocationReportingReferenceIDList", + IDSelectedTargetSNPNIdentity: "Selected-Target-SNPN-Identity", + IDEquivalentSNPNsList: "EquivalentSNPNsList", + IDSupportedUETypeList: "SupportedUETypeList", + IDFiveGProSeLayer2Multipath: "FiveGProSeLayer2Multipath", + IDFiveGProSeLayer2UEtoUERelay: "FiveGProSeLayer2UEtoUERelay", + IDFiveGProSeLayer2UEtoUERemote: "FiveGProSeLayer2UEtoUERemote", + IDCandidateRelayUEInformationList: "CandidateRelayUEInformationList", + IDSuccessfulPSCellChangeReportList: "SuccessfulPSCellChangeReportList", + IDIntersystemMobilityFailureforVoiceFallback: "IntersystemMobilityFailureforVoiceFallback", + IDTargetCellCRNTI: "TargetCellCRNTI", + IDTimeSinceFailure: "TimeSinceFailure", + IDRANTimingSynchronisationStatusInfo: "RANTimingSynchronisationStatusInfo", + IDRANTSSRequestType: "RAN-TSSRequestType", + IDRANTSSScope: "RAN-TSSScope", + IDClockQualityReportingControlInfo: "ClockQualityReportingControlInfo", + IDRANfeedbacktype: "RANfeedbacktype", + IDQoSFlowTSCList: "QoSFlowTSCList", + IDTSCTrafficCharacteristicsFeedback: "TSCTrafficCharacteristicsFeedback", + IDUplinkTLContainer: "UplinkTLContainer", + IDANPacketDelayBudgetUL: "ANPacketDelayBudgetUL", + IDQosFlowAdditionalInfoList: "QosFlowAdditionalInfoList", + IDAssistanceInformationQoEMeas: "AssistanceInformationQoE-Meas", + IDCommServiceType: "CommServiceType", + IDMobileIABMTUserLocationInformation: "MobileIAB-MTUserLocationInformation", + IDCNMTCommunicationHandling: "CN-MT-CommunicationHandling", + IDFiveGCAction: "FiveGCAction", + IDPagingPolicyDifferentiation: "PagingPolicyDifferentiation", + IDDLSignalling: "DL-Signalling", + IDPNINPNAreaScopeofMDT: "PNI-NPN-AreaScopeofMDT", + IDPNINPNBasedMDT: "PNI-NPNBasedMDT", + IDSNPNCellBasedMDT: "SNPN-CellBasedMDT", + IDSNPNTAIBasedMDT: "SNPN-TAIBasedMDT", + IDSNPNBasedMDT: "SNPN-BasedMDT", + IDAssociatedSessionID: "AssociatedSessionID", + IDMBSAssistanceInformation: "MBS-AssistanceInformation", + IDBroadcastTransportFailureTransfer: "BroadcastTransportFailureTransfer", + IDBroadcastTransportRequestTransfer: "BroadcastTransportRequestTransfer", + IDBroadcastTransportResponseTransfer: "BroadcastTransportResponseTransfer", + IDTimeBasedHandoverInformation: "TimeBasedHandoverInformation", + IDDLDiscarding: "DLDiscarding", + IDPDUsetQoSParameters: "PDUsetQoSParameters", + IDPDUSetbasedHandlingIndicator: "PDUSetbasedHandlingIndicator", + IDN6JitterInformation: "N6JitterInformation", + IDECNMarkingorCongestionInformationReportingRequest: "ECNMarkingorCongestionInformationReportingRequest", + IDECNMarkingorCongestionInformationReportingStatus: "ECNMarkingorCongestionInformationReportingStatus", + IDUserPlaneErrorIndicator: "UserPlaneErrorIndicator", + IDPDUSessionListMTCommHReq: "PDUSessionListMTCommHReq", + IDMaximumDataBurstVolume: "MaximumDataBurstVolume", + IDMNonlyMDTcollection: "MN-only-MDT-collection", + IDMBSNGUFailureIndication: "MBS-NGUFailureIndication", + IDUserPlaneFailureIndicationReport: "UserPlaneFailureIndicationReport", + IDSourceSNtoTargetSNQMCInfo: "SourceSN-to-TargetSN-QMCInfo", + IDQoERVQoEReportingPaths: "QoERVQoEReportingPaths", + IDUserLocationInformationN3IWFwithoutPortNumber: "UserLocationInformationN3IWF-without-PortNumber", + IDTAIMBSSupportList: "TAIMBSSupportList", + IDMBSUPFailureIndication: "MBS-UP-FailureIndication", + IDRequestedTNLInfo: "RequestedTNLInfo", + IDAerialUEFlightInformationOngoingReportingfailed: "Aerial-UE-FlightInformationOngoingReporting-failed", + IDNetworkSliceAreaScopeofMDT: "NetworkSliceAreaScopeofMDT", + IDGeographyBasedMDT: "GeographyBasedMDT", + IDMBSIntendedServiceAreaList: "MBS-IntendedServiceAreaList", + IDInventoryRequestTransfer: "InventoryRequestTransfer", + IDInventoryResponseTransfer: "InventoryResponseTransfer", + IDInventoryFailureTransfer: "InventoryFailureTransfer", + IDInventoryReportTransfer: "InventoryReportTransfer", + IDCommandRequestTransfer: "CommandRequestTransfer", + IDCommandResponseTransfer: "CommandResponseTransfer", + IDCommandFailureTransfer: "CommandFailureTransfer", + IDAIOTSessionReleaseCommandTransfer: "AIOTSessionReleaseCommandTransfer", + IDAIOTSessionReleaseCompleteTransfer: "AIOTSessionReleaseCompleteTransfer", + IDAIOTSessionReleaseRequestTransfer: "AIOTSessionReleaseRequestTransfer", + IDAIoTCorrelationIdentifier: "AIoT-CorrelationIdentifier", + IDAIoTDeviceIdentificationRequested: "AIoT-DeviceIdentificationRequested", + IDAIoTRequestedServiceAreaInformation: "AIoT-RequestedServiceAreaInformation", + IDAIoTInventoryAssistanceInformation: "AIoT-InventoryAssistanceInformation", + IDAIoTFollowonCommandIndication: "AIoT-FollowonCommandIndication", + IDRANAIOTDeviceNGAPID: "RAN-AIOT-Device-NGAP-ID", + IDAIoTCommandAssistanceInformation: "AIoT-CommandAssistanceInformation", + IDAIoTNASPDU: "AIoT-NASPDU", + IDFurtherExtendedUEIdentityIndexValue: "FurtherExtendedUEIdentityIndexValue", + IDFiveGProSeLayer2MHUEtoNetworkRelay: "FiveGProSeLayer2MHUEtoNetworkRelay", + IDFiveGProSeLayer2MHIntermediateUEtoNetworkRelay: "FiveGProSeLayer2MHIntermediateUEtoNetworkRelay", + IDFiveGProSeLayer2MHRemote: "FiveGProSeLayer2MHRemote", + IDFiveGProSeLayer3MHUEtoNetworkRelay: "FiveGProSeLayer3MHUEtoNetworkRelay", + IDPduSetDelayBudgetDownlink: "PduSetDelayBudgetDownlink", + IDPduSetDelayBudgetUplink: "PduSetDelayBudgetUplink", + IDPduSetErrorRateDownlink: "PduSetErrorRateDownlink", + IDPduSetErrorRateUplink: "PduSetErrorRateUplink", + IDDLPDUSetInformationMarkingSupportIndication: "DLPDUSetInformationMarkingSupportIndication", + IDMonitoringRequestonAvailableBitrate: "MonitoringRequestonAvailableBitrate", + IDMMSID: "MMSID", + IDIndicationofBitrateAdaptation: "Indication-of-Bitrate-Adaptation", + IDSCGActivationTime: "SCGActivationTime", + IDAerialUEFlightInformationReporting: "Aerial-UE-FlightInformationReporting", + IDAerialUEFlightInformationReportingControlList: "Aerial-UE-FlightInformationReportingControlList", + IDAIoTSecurityInfo: "AIoT-SecurityInfo", } // ProtocolIEIDName returns the TS 38.413 name of id, and whether it is known. diff --git a/ngap/ie_pws.go b/ngap/ie_pws.go index 4ffeab7ab0..28c96e57ed 100644 --- a/ngap/ie_pws.go +++ b/ngap/ie_pws.go @@ -4,8 +4,6 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -64,17 +62,17 @@ func (c *EUTRACellIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error } type NRCGI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity NRCellIdentity NRCellIdentity - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type EUTRACGI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity EUTRACellIdentity EUTRACellIdentity - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type MessageIdentifier uint16 @@ -234,25 +232,8 @@ type ConcurrentWarningMessageInd uint8 const ( ConcurrentWarningMessageIndTrue ConcurrentWarningMessageInd = iota - - concurrentWarningMessageIndRootCount = 1 ) -func (c ConcurrentWarningMessageInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, concurrentWarningMessageIndRootCount, int64(c), "ConcurrentWarningMessageInd") -} - -func (c *ConcurrentWarningMessageInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeRootEnumerated(r, enc, concurrentWarningMessageIndRootCount, "ConcurrentWarningMessageInd") - if err != nil { - return err - } - - *c = ConcurrentWarningMessageInd(v) - - return nil -} - type EmergencyAreaID [3]byte func (e EmergencyAreaID) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -270,472 +251,487 @@ func (e *EmergencyAreaID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func chosenAlternative(choice string, set ...bool) (int64, error) { - idx := int64(-1) +type WarningAreaList struct { + EUTRACGIListForWarning *EUTRACGIListForWarning `per:",choice:0"` + NRCGIListForWarning *NRCGIListForWarning `per:",choice:1"` + TAIListForWarning *TAIListForWarning `per:",choice:2"` + EmergencyAreaIDList *EmergencyAreaIDList `per:",choice:3"` + ChoiceExtension *SingleContainer `per:",choice:4,extie"` +} - for i, s := range set { - if !s { - continue - } +type EUTRACGIListForWarning []EUTRACGI - if idx >= 0 { - return 0, fmt.Errorf("ngap: %s has more than one alternative set", choice) - } +func (l EUTRACGIListForWarning) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, []EUTRACGI(l)) +} - idx = int64(i) +func (l *EUTRACGIListForWarning) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EUTRACGI](r, enc, 1, maxnoofCellIDforWarning) + if err != nil { + return err } - if idx < 0 { - return 0, fmt.Errorf("ngap: %s has no alternative set", choice) - } + *l = items - return idx, nil + return nil } -const ( - warningAreaListEUTRACGI = iota - warningAreaListNRCGI - warningAreaListTAI - warningAreaListEmergencyAreaID - warningAreaListChoiceExtensions +type NRCGIListForWarning []NRCGI - warningAreaListAlternatives = 5 -) - -type WarningAreaList struct { - EUTRACGIs []EUTRACGI - NRCGIs []NRCGI - TAIs []TAI - EmergencyAreaIDs []EmergencyAreaID +func (l NRCGIListForWarning) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, []NRCGI(l)) } -func (l WarningAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := chosenAlternative("WarningAreaList", len(l.EUTRACGIs) > 0, len(l.NRCGIs) > 0, len(l.TAIs) > 0, len(l.EmergencyAreaIDs) > 0) +func (l *NRCGIListForWarning) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellIDforWarning) if err != nil { return err } - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, warningAreaListAlternatives-1, idx); err != nil { - return err - } + *l = items - switch idx { - case warningAreaListEUTRACGI: - return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.EUTRACGIs) - case warningAreaListNRCGI: - return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.NRCGIs) - case warningAreaListTAI: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIs) - default: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDs) - } + return nil } -func (l *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, warningAreaListAlternatives-1) +type TAIListForWarning []TAI + +func (l TAIListForWarning) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAI(l)) +} + +func (l *TAIListForWarning) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforWarning) if err != nil { - return fmt.Errorf("ngap: WarningAreaList choice: %w", err) + return err } - var v WarningAreaList + *l = items - switch idx { - case warningAreaListEUTRACGI: - v.EUTRACGIs, err = unmarshalSeqOf[EUTRACGI](r, enc, 1, maxnoofCellIDforWarning) - case warningAreaListNRCGI: - v.NRCGIs, err = unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellIDforWarning) - case warningAreaListTAI: - v.TAIs, err = unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforWarning) - case warningAreaListEmergencyAreaID: - v.EmergencyAreaIDs, err = unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofEmergencyAreaID) - case warningAreaListChoiceExtensions: - return decodeChoiceExtension(r, enc, "WarningAreaList") - } + return nil +} + +type EmergencyAreaIDList []EmergencyAreaID +func (l EmergencyAreaIDList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaID(l)) +} + +func (l *EmergencyAreaIDList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofEmergencyAreaID) if err != nil { return err } - *l = v + *l = items return nil } type CellIDBroadcastEUTRAItem struct { - _ [0]struct{} `per:"extseq"` - EUTRACGI EUTRACGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + EUTRACGI EUTRACGI + iEExtensions extensionMeta `per:",exttable"` } type CompletedCellsInTAIEUTRAItem struct { - _ [0]struct{} `per:"extseq"` - EUTRACGI EUTRACGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + EUTRACGI EUTRACGI + iEExtensions extensionMeta `per:",exttable"` } type TAIBroadcastEUTRAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` TAI TAI CompletedCellsInTAI []CompletedCellsInTAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CompletedCellsInEAIEUTRAItem struct { - _ [0]struct{} `per:"extseq"` - EUTRACGI EUTRACGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + EUTRACGI EUTRACGI + iEExtensions extensionMeta `per:",exttable"` } type EmergencyAreaIDBroadcastEUTRAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EmergencyAreaID EmergencyAreaID CompletedCellsInEAI []CompletedCellsInEAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CellIDBroadcastNRItem struct { - _ [0]struct{} `per:"extseq"` - NRCGI NRCGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + NRCGI NRCGI + iEExtensions extensionMeta `per:",exttable"` } type CompletedCellsInTAINRItem struct { - _ [0]struct{} `per:"extseq"` - NRCGI NRCGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + NRCGI NRCGI + iEExtensions extensionMeta `per:",exttable"` } type TAIBroadcastNRItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` TAI TAI CompletedCellsInTAI []CompletedCellsInTAINRItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CompletedCellsInEAINRItem struct { - _ [0]struct{} `per:"extseq"` - NRCGI NRCGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + NRCGI NRCGI + iEExtensions extensionMeta `per:",exttable"` } type EmergencyAreaIDBroadcastNRItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EmergencyAreaID EmergencyAreaID CompletedCellsInEAI []CompletedCellsInEAINRItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } -const ( - broadcastAreaCellIDEUTRA = iota - broadcastAreaTAIEUTRA - broadcastAreaEmergencyAreaIDEUTRA - broadcastAreaCellIDNR - broadcastAreaTAINR - broadcastAreaEmergencyAreaIDNR - broadcastAreaChoiceExtensions - - broadcastAreaAlternatives = 7 -) - type BroadcastCompletedAreaList struct { - CellIDBroadcastEUTRA []CellIDBroadcastEUTRAItem - TAIBroadcastEUTRA []TAIBroadcastEUTRAItem - EmergencyAreaIDBroadcastEUTRA []EmergencyAreaIDBroadcastEUTRAItem - CellIDBroadcastNR []CellIDBroadcastNRItem - TAIBroadcastNR []TAIBroadcastNRItem - EmergencyAreaIDBroadcastNR []EmergencyAreaIDBroadcastNRItem + CellIDBroadcastEUTRA *CellIDBroadcastEUTRA `per:",choice:0"` + TAIBroadcastEUTRA *TAIBroadcastEUTRA `per:",choice:1"` + EmergencyAreaIDBroadcastEUTRA *EmergencyAreaIDBroadcastEUTRA `per:",choice:2"` + CellIDBroadcastNR *CellIDBroadcastNR `per:",choice:3"` + TAIBroadcastNR *TAIBroadcastNR `per:",choice:4"` + EmergencyAreaIDBroadcastNR *EmergencyAreaIDBroadcastNR `per:",choice:5"` + ChoiceExtension *SingleContainer `per:",choice:6,extie"` +} + +type CellIDBroadcastEUTRA []CellIDBroadcastEUTRAItem + +func (l CellIDBroadcastEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, []CellIDBroadcastEUTRAItem(l)) } -func (l BroadcastCompletedAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := chosenAlternative("BroadcastCompletedAreaList", - len(l.CellIDBroadcastEUTRA) > 0, len(l.TAIBroadcastEUTRA) > 0, len(l.EmergencyAreaIDBroadcastEUTRA) > 0, - len(l.CellIDBroadcastNR) > 0, len(l.TAIBroadcastNR) > 0, len(l.EmergencyAreaIDBroadcastNR) > 0) +func (l *CellIDBroadcastEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CellIDBroadcastEUTRAItem](r, enc, 1, maxnoofCellIDforWarning) if err != nil { return err } - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, broadcastAreaAlternatives-1, idx); err != nil { + *l = items + + return nil +} + +type TAIBroadcastEUTRA []TAIBroadcastEUTRAItem + +func (l TAIBroadcastEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAIBroadcastEUTRAItem(l)) +} + +func (l *TAIBroadcastEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAIBroadcastEUTRAItem](r, enc, 1, maxnoofTAIforWarning) + if err != nil { return err } - switch idx { - case broadcastAreaCellIDEUTRA: - return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDBroadcastEUTRA) - case broadcastAreaTAIEUTRA: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIBroadcastEUTRA) - case broadcastAreaEmergencyAreaIDEUTRA: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDBroadcastEUTRA) - case broadcastAreaCellIDNR: - return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDBroadcastNR) - case broadcastAreaTAINR: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIBroadcastNR) - default: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDBroadcastNR) - } + *l = items + + return nil } -func (l *BroadcastCompletedAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, broadcastAreaAlternatives-1) +type EmergencyAreaIDBroadcastEUTRA []EmergencyAreaIDBroadcastEUTRAItem + +func (l EmergencyAreaIDBroadcastEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaIDBroadcastEUTRAItem(l)) +} + +func (l *EmergencyAreaIDBroadcastEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaIDBroadcastEUTRAItem](r, enc, 1, maxnoofEmergencyAreaID) if err != nil { - return fmt.Errorf("ngap: BroadcastCompletedAreaList choice: %w", err) + return err } - var v BroadcastCompletedAreaList + *l = items - switch idx { - case broadcastAreaCellIDEUTRA: - v.CellIDBroadcastEUTRA, err = unmarshalSeqOf[CellIDBroadcastEUTRAItem](r, enc, 1, maxnoofCellIDforWarning) - case broadcastAreaTAIEUTRA: - v.TAIBroadcastEUTRA, err = unmarshalSeqOf[TAIBroadcastEUTRAItem](r, enc, 1, maxnoofTAIforWarning) - case broadcastAreaEmergencyAreaIDEUTRA: - v.EmergencyAreaIDBroadcastEUTRA, err = unmarshalSeqOf[EmergencyAreaIDBroadcastEUTRAItem](r, enc, 1, maxnoofEmergencyAreaID) - case broadcastAreaCellIDNR: - v.CellIDBroadcastNR, err = unmarshalSeqOf[CellIDBroadcastNRItem](r, enc, 1, maxnoofCellIDforWarning) - case broadcastAreaTAINR: - v.TAIBroadcastNR, err = unmarshalSeqOf[TAIBroadcastNRItem](r, enc, 1, maxnoofTAIforWarning) - case broadcastAreaEmergencyAreaIDNR: - v.EmergencyAreaIDBroadcastNR, err = unmarshalSeqOf[EmergencyAreaIDBroadcastNRItem](r, enc, 1, maxnoofEmergencyAreaID) - case broadcastAreaChoiceExtensions: - return decodeChoiceExtension(r, enc, "BroadcastCompletedAreaList") - } + return nil +} + +type CellIDBroadcastNR []CellIDBroadcastNRItem +func (l CellIDBroadcastNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, []CellIDBroadcastNRItem(l)) +} + +func (l *CellIDBroadcastNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CellIDBroadcastNRItem](r, enc, 1, maxnoofCellIDforWarning) if err != nil { return err } - *l = v + *l = items return nil } -type CancelAllWarningMessages uint8 +type TAIBroadcastNR []TAIBroadcastNRItem -const ( - CancelAllWarningMessagesTrue CancelAllWarningMessages = iota +func (l TAIBroadcastNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAIBroadcastNRItem(l)) +} - cancelAllWarningMessagesRootCount = 1 -) +func (l *TAIBroadcastNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAIBroadcastNRItem](r, enc, 1, maxnoofTAIforWarning) + if err != nil { + return err + } + + *l = items + + return nil +} -func (c CancelAllWarningMessages) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, cancelAllWarningMessagesRootCount, int64(c), "CancelAllWarningMessages") +type EmergencyAreaIDBroadcastNR []EmergencyAreaIDBroadcastNRItem + +func (l EmergencyAreaIDBroadcastNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaIDBroadcastNRItem(l)) } -func (c *CancelAllWarningMessages) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeRootEnumerated(r, enc, cancelAllWarningMessagesRootCount, "CancelAllWarningMessages") +func (l *EmergencyAreaIDBroadcastNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaIDBroadcastNRItem](r, enc, 1, maxnoofEmergencyAreaID) if err != nil { return err } - *c = CancelAllWarningMessages(v) + *l = items return nil } +type CancelAllWarningMessages uint8 + +const ( + CancelAllWarningMessagesTrue CancelAllWarningMessages = iota +) + type CellIDCancelledEUTRAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EUTRACGI EUTRACGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type CancelledCellsInTAIEUTRAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EUTRACGI EUTRACGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type TAICancelledEUTRAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` TAI TAI CancelledCellsInTAI []CancelledCellsInTAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CancelledCellsInEAIEUTRAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EUTRACGI EUTRACGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type EmergencyAreaIDCancelledEUTRAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EmergencyAreaID EmergencyAreaID CancelledCellsInEAI []CancelledCellsInEAIEUTRAItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CellIDCancelledNRItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` NRCGI NRCGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type CancelledCellsInTAINRItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` NRCGI NRCGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type TAICancelledNRItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` TAI TAI CancelledCellsInTAI []CancelledCellsInTAINRItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CancelledCellsInEAINRItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` NRCGI NRCGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type EmergencyAreaIDCancelledNRItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EmergencyAreaID EmergencyAreaID CancelledCellsInEAI []CancelledCellsInEAINRItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type BroadcastCancelledAreaList struct { - CellIDCancelledEUTRA []CellIDCancelledEUTRAItem - TAICancelledEUTRA []TAICancelledEUTRAItem - EmergencyAreaIDCancelledEUTRA []EmergencyAreaIDCancelledEUTRAItem - CellIDCancelledNR []CellIDCancelledNRItem - TAICancelledNR []TAICancelledNRItem - EmergencyAreaIDCancelledNR []EmergencyAreaIDCancelledNRItem + CellIDCancelledEUTRA *CellIDCancelledEUTRA `per:",choice:0"` + TAICancelledEUTRA *TAICancelledEUTRA `per:",choice:1"` + EmergencyAreaIDCancelledEUTRA *EmergencyAreaIDCancelledEUTRA `per:",choice:2"` + CellIDCancelledNR *CellIDCancelledNR `per:",choice:3"` + TAICancelledNR *TAICancelledNR `per:",choice:4"` + EmergencyAreaIDCancelledNR *EmergencyAreaIDCancelledNR `per:",choice:5"` + ChoiceExtension *SingleContainer `per:",choice:6,extie"` +} + +type CellIDCancelledEUTRA []CellIDCancelledEUTRAItem + +func (l CellIDCancelledEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, []CellIDCancelledEUTRAItem(l)) } -func (l BroadcastCancelledAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := chosenAlternative("BroadcastCancelledAreaList", - len(l.CellIDCancelledEUTRA) > 0, len(l.TAICancelledEUTRA) > 0, len(l.EmergencyAreaIDCancelledEUTRA) > 0, - len(l.CellIDCancelledNR) > 0, len(l.TAICancelledNR) > 0, len(l.EmergencyAreaIDCancelledNR) > 0) +func (l *CellIDCancelledEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CellIDCancelledEUTRAItem](r, enc, 1, maxnoofCellIDforWarning) if err != nil { return err } - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, broadcastAreaAlternatives-1, idx); err != nil { - return err - } + *l = items - switch idx { - case broadcastAreaCellIDEUTRA: - return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDCancelledEUTRA) - case broadcastAreaTAIEUTRA: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAICancelledEUTRA) - case broadcastAreaEmergencyAreaIDEUTRA: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDCancelledEUTRA) - case broadcastAreaCellIDNR: - return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, l.CellIDCancelledNR) - case broadcastAreaTAINR: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAICancelledNR) - default: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDCancelledNR) - } + return nil } -func (l *BroadcastCancelledAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, broadcastAreaAlternatives-1) +type TAICancelledEUTRA []TAICancelledEUTRAItem + +func (l TAICancelledEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAICancelledEUTRAItem(l)) +} + +func (l *TAICancelledEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAICancelledEUTRAItem](r, enc, 1, maxnoofTAIforWarning) if err != nil { - return fmt.Errorf("ngap: BroadcastCancelledAreaList choice: %w", err) + return err } - var v BroadcastCancelledAreaList + *l = items - switch idx { - case broadcastAreaCellIDEUTRA: - v.CellIDCancelledEUTRA, err = unmarshalSeqOf[CellIDCancelledEUTRAItem](r, enc, 1, maxnoofCellIDforWarning) - case broadcastAreaTAIEUTRA: - v.TAICancelledEUTRA, err = unmarshalSeqOf[TAICancelledEUTRAItem](r, enc, 1, maxnoofTAIforWarning) - case broadcastAreaEmergencyAreaIDEUTRA: - v.EmergencyAreaIDCancelledEUTRA, err = unmarshalSeqOf[EmergencyAreaIDCancelledEUTRAItem](r, enc, 1, maxnoofEmergencyAreaID) - case broadcastAreaCellIDNR: - v.CellIDCancelledNR, err = unmarshalSeqOf[CellIDCancelledNRItem](r, enc, 1, maxnoofCellIDforWarning) - case broadcastAreaTAINR: - v.TAICancelledNR, err = unmarshalSeqOf[TAICancelledNRItem](r, enc, 1, maxnoofTAIforWarning) - case broadcastAreaEmergencyAreaIDNR: - v.EmergencyAreaIDCancelledNR, err = unmarshalSeqOf[EmergencyAreaIDCancelledNRItem](r, enc, 1, maxnoofEmergencyAreaID) - case broadcastAreaChoiceExtensions: - return decodeChoiceExtension(r, enc, "BroadcastCancelledAreaList") - } + return nil +} + +type EmergencyAreaIDCancelledEUTRA []EmergencyAreaIDCancelledEUTRAItem +func (l EmergencyAreaIDCancelledEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaIDCancelledEUTRAItem(l)) +} + +func (l *EmergencyAreaIDCancelledEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaIDCancelledEUTRAItem](r, enc, 1, maxnoofEmergencyAreaID) if err != nil { return err } - *l = v + *l = items return nil } -const ( - maxnoofTAIforRestart = 2048 - maxnoofEAIforRestart = 256 -) +type CellIDCancelledNR []CellIDCancelledNRItem -const ( - cellListEUTRA = iota - cellListNR - cellListChoiceExtensions - - cellListAlternatives = 3 -) +func (l CellIDCancelledNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellIDforWarning, []CellIDCancelledNRItem(l)) +} -func marshalCellList(w *per.Writer, enc per.Encoding, choice string, eutra []EUTRACGI, nr []NRCGI) error { - idx, err := chosenAlternative(choice, len(eutra) > 0, len(nr) > 0) +func (l *CellIDCancelledNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CellIDCancelledNRItem](r, enc, 1, maxnoofCellIDforWarning) if err != nil { return err } - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, cellListAlternatives-1, idx); err != nil { + *l = items + + return nil +} + +type TAICancelledNR []TAICancelledNRItem + +func (l TAICancelledNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAICancelledNRItem(l)) +} + +func (l *TAICancelledNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAICancelledNRItem](r, enc, 1, maxnoofTAIforWarning) + if err != nil { return err } - if idx == cellListEUTRA { - return marshalSeqOf(w, enc, 1, maxnoofCellsinngeNB, eutra) - } + *l = items - return marshalSeqOf(w, enc, 1, maxnoofCellsingNB, nr) + return nil } -func unmarshalCellList(r *per.Reader, enc per.Encoding, choice string) ([]EUTRACGI, []NRCGI, error) { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, cellListAlternatives-1) +type EmergencyAreaIDCancelledNR []EmergencyAreaIDCancelledNRItem + +func (l EmergencyAreaIDCancelledNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaIDCancelledNRItem(l)) +} + +func (l *EmergencyAreaIDCancelledNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaIDCancelledNRItem](r, enc, 1, maxnoofEmergencyAreaID) if err != nil { - return nil, nil, fmt.Errorf("ngap: %s choice: %w", choice, err) + return err } - switch idx { - case cellListEUTRA: - eutra, err := unmarshalSeqOf[EUTRACGI](r, enc, 1, maxnoofCellsinngeNB) - return eutra, nil, err - case cellListNR: - nr, err := unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellsingNB) - return nil, nr, err - default: - return nil, nil, decodeChoiceExtension(r, enc, choice) - } + *l = items + + return nil } +const ( + maxnoofTAIforRestart = 2048 + maxnoofEAIforRestart = 256 +) + type CellIDListForRestart struct { - EUTRACGIs []EUTRACGI - NRCGIs []NRCGI + EUTRACGIListforRestart *EUTRACGIList `per:",choice:0"` + NRCGIListforRestart *NRCGIList `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` +} + +type EUTRACGIList []EUTRACGI + +func (l EUTRACGIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsinngeNB, []EUTRACGI(l)) } -func (l CellIDListForRestart) MarshalPER(w *per.Writer, enc per.Encoding) error { - return marshalCellList(w, enc, "CellIDListForRestart", l.EUTRACGIs, l.NRCGIs) +func (l *EUTRACGIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EUTRACGI](r, enc, 1, maxnoofCellsinngeNB) + if err != nil { + return err + } + + *l = items + + return nil } -func (l *CellIDListForRestart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - eutra, nr, err := unmarshalCellList(r, enc, "CellIDListForRestart") +type NRCGIList []NRCGI + +func (l NRCGIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellsingNB, []NRCGI(l)) +} + +func (l *NRCGIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[NRCGI](r, enc, 1, maxnoofCellsingNB) if err != nil { return err } - *l = CellIDListForRestart{EUTRACGIs: eutra, NRCGIs: nr} + *l = items return nil } @@ -775,21 +771,7 @@ func (l *EmergencyAreaIDListForRestart) UnmarshalPER(r *per.Reader, enc per.Enco } type PWSFailedCellIDList struct { - EUTRACGIs []EUTRACGI - NRCGIs []NRCGI -} - -func (l PWSFailedCellIDList) MarshalPER(w *per.Writer, enc per.Encoding) error { - return marshalCellList(w, enc, "PWSFailedCellIDList", l.EUTRACGIs, l.NRCGIs) -} - -func (l *PWSFailedCellIDList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - eutra, nr, err := unmarshalCellList(r, enc, "PWSFailedCellIDList") - if err != nil { - return err - } - - *l = PWSFailedCellIDList{EUTRACGIs: eutra, NRCGIs: nr} - - return nil + EUTRACGIPWSFailedList *EUTRACGIList `per:",choice:0"` + NRCGIPWSFailedList *NRCGIList `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` } diff --git a/ngap/ie_qos.go b/ngap/ie_qos.go index e2deec2dec..2ad0d346c5 100644 --- a/ngap/ie_qos.go +++ b/ngap/ie_qos.go @@ -4,9 +4,8 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // PriorityLevelARP ::= INTEGER (1..15) — TS 38.413 §9.3.1.19. S1AP's @@ -36,8 +35,6 @@ type PreemptionCapability uint8 const ( PreemptionShallNotTrigger PreemptionCapability = iota PreemptionMayTrigger - - preemptionCapabilityRootCount = 2 ) // Pre-emptionVulnerability ::= ENUMERATED { not-pre-emptable, pre-emptable, @@ -47,8 +44,6 @@ type PreemptionVulnerability uint8 const ( PreemptionNotPreemptable PreemptionVulnerability = iota PreemptionPreemptable - - preemptionVulnerabilityRootCount = 2 ) // NotificationControl ::= ENUMERATED { notification-requested, ... }. @@ -56,8 +51,6 @@ type NotificationControl uint8 const ( NotificationRequested NotificationControl = iota - - notificationControlRootCount = 1 ) // PacketLossRate ::= INTEGER (0..1000, ...) in tenths of a percent. @@ -68,16 +61,20 @@ func (p PacketLossRate) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (p *PacketLossRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 1000, "PacketLossRate") + v, err := decodeExtensibleInt[PacketLossRate](r, enc, 0, 1000) if err != nil { return err } - *p = PacketLossRate(v) + *p = v return nil } +func (v PacketLossRate) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 1000) +} + // FiveQI ::= INTEGER (0..255, ...). 3GPP gives 5QI no section of its own; it // is the first row of TS 38.413 §9.3.1.28. S1AP's counterpart // is QCI ::= INTEGER (0..255), which carries no extension marker, so the two @@ -89,16 +86,18 @@ func (f FiveQI) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (f *FiveQI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 255, "FiveQI") + v, err := decodeExtensibleInt[FiveQI](r, enc, 0, 255) if err != nil { return err } - *f = FiveQI(v) + *f = v return nil } +func (v FiveQI) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 0, 255) } + // PriorityLevelQos ::= INTEGER (1..127, ...) — TS 38.413 §9.3.1.84. Distinct // from PriorityLevelARP: this one ranks QoS flows, that one ranks allocation. type PriorityLevelQos uint8 @@ -108,16 +107,20 @@ func (p PriorityLevelQos) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (p *PriorityLevelQos) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 1, 127, "PriorityLevelQos") + v, err := decodeExtensibleInt[PriorityLevelQos](r, enc, 1, 127) if err != nil { return err } - *p = PriorityLevelQos(v) + *p = v return nil } +func (v PriorityLevelQos) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 127) +} + // PacketDelayBudget ::= INTEGER (0..1023, ...) in units of 0.5 ms. type PacketDelayBudget uint16 @@ -126,16 +129,20 @@ func (p PacketDelayBudget) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (p *PacketDelayBudget) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 1023, "PacketDelayBudget") + v, err := decodeExtensibleInt[PacketDelayBudget](r, enc, 0, 1023) if err != nil { return err } - *p = PacketDelayBudget(v) + *p = v return nil } +func (v PacketDelayBudget) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 1023) +} + // AveragingWindow ::= INTEGER (0..4095, ...) in milliseconds. type AveragingWindow uint16 @@ -144,16 +151,20 @@ func (a AveragingWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (a *AveragingWindow) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 4095, "AveragingWindow") + v, err := decodeExtensibleInt[AveragingWindow](r, enc, 0, 4095) if err != nil { return err } - *a = AveragingWindow(v) + *a = v return nil } +func (v AveragingWindow) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 4095) +} + // MaximumDataBurstVolume ::= INTEGER (0..4095, ..., 4096..2000000) in bytes. // Unlike its neighbours this constraint defines an extension range, so values // above the root are legitimate and encode unconstrained after a set extension @@ -166,43 +177,30 @@ const ( ) func (m MaximumDataBurstVolume) MarshalPER(w *per.Writer, enc per.Encoding) error { - if m > maximumDataBurstVolumeUB { - return fmt.Errorf("ngap: MaximumDataBurstVolume %d exceeds the extension range ceiling %d", uint32(m), maximumDataBurstVolumeUB) - } - - return per.EncodeInteger(w, enc, per.Bounds{ - LB: 0, HasLB: true, UB: maximumDataBurstVolumeRootUB, HasUB: true, Extensible: true, - }, int64(m)) + return encodeExtensibleInt(w, enc, 0, maximumDataBurstVolumeRootUB, int64(m)) } -// The extension branch decodes as an unconstrained integer, so the value -// arrives unbounded and signed; without this check a negative would land in -// the unsigned Go type as a very large burst volume. func (m *MaximumDataBurstVolume) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := per.DecodeInteger(r, enc, per.Bounds{ - LB: 0, HasLB: true, UB: maximumDataBurstVolumeRootUB, HasUB: true, Extensible: true, - }) + v, err := decodeExtensibleInt[MaximumDataBurstVolume](r, enc, 0, maximumDataBurstVolumeRootUB) if err != nil { return err } - if v < 0 || v > maximumDataBurstVolumeUB { - return fmt.Errorf("ngap: MaximumDataBurstVolume %d outside 0..%d", v, maximumDataBurstVolumeUB) - } - - *m = MaximumDataBurstVolume(v) + *m = v return nil } +func (m MaximumDataBurstVolume) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(m), 0, maximumDataBurstVolumeUB) +} + // DelayCritical ::= ENUMERATED { delay-critical, non-delay-critical, ... }. type DelayCritical uint8 const ( DelayCriticalYes DelayCritical = iota DelayCriticalNo - - delayCriticalRootCount = 2 ) // ReflectiveQosAttribute ::= ENUMERATED { subject-to, ... }. @@ -210,8 +208,6 @@ type ReflectiveQosAttribute uint8 const ( ReflectiveQosSubjectTo ReflectiveQosAttribute = iota - - reflectiveQosAttributeRootCount = 1 ) // AdditionalQosFlowInformation ::= ENUMERATED { more-likely, ... }. @@ -219,8 +215,6 @@ type AdditionalQosFlowInformation uint8 const ( AdditionalQosFlowMoreLikely AdditionalQosFlowInformation = iota - - additionalQosFlowInformationRootCount = 1 ) // PacketErrorRate ::= SEQUENCE { pERScalar INTEGER (0..9, ...), pERExponent @@ -229,7 +223,7 @@ const ( type PacketErrorRate struct { Scalar PERDigit Exponent PERDigit - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -241,26 +235,30 @@ func (d PERDigit) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (d *PERDigit) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 9, "PacketErrorRate digit") + v, err := decodeExtensibleInt[PERDigit](r, enc, 0, 9) if err != nil { return err } - *d = PERDigit(v) + *d = v return nil } +func (v PERDigit) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 0, 9) } + // NonDynamic5QIDescriptor ::= SEQUENCE { fiveQI, priorityLevelQos OPTIONAL, // averagingWindow OPTIONAL, maximumDataBurstVolume OPTIONAL, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.1.28. type NonDynamic5QIDescriptor struct { FiveQI FiveQI - PriorityLevelQos *PriorityLevelQos `per:",optional"` - AveragingWindow *AveragingWindow `per:",optional"` - MaximumDataBurstVolume *MaximumDataBurstVolume `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PriorityLevelQos *PriorityLevelQos `per:",optional"` + AveragingWindow *AveragingWindow `per:",optional"` + MaximumDataBurstVolume *MaximumDataBurstVolume `per:",optional"` + CNPacketDelayBudgetDL *ExtendedPacketDelayBudget `per:",extie:IDCNPacketDelayBudgetDL,crit:ignore"` + CNPacketDelayBudgetUL *ExtendedPacketDelayBudget `per:",extie:IDCNPacketDelayBudgetUL,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // Dynamic5QIDescriptor ::= SEQUENCE { priorityLevelQos, packetDelayBudget, @@ -270,28 +268,20 @@ type NonDynamic5QIDescriptor struct { // averagingWindow on the flow being GBR, and maximumDataBurstVolume on // delayCritical being "delay critical". type Dynamic5QIDescriptor struct { - PriorityLevelQos PriorityLevelQos - PacketDelayBudget PacketDelayBudget - PacketErrorRate PacketErrorRate - FiveQI *FiveQI `per:",optional"` - DelayCritical *DelayCritical `per:"ENUMERATED,range:0..1,...,optional"` - AveragingWindow *AveragingWindow `per:",optional"` - MaximumDataBurstVolume *MaximumDataBurstVolume `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PriorityLevelQos PriorityLevelQos + PacketDelayBudget PacketDelayBudget + PacketErrorRate PacketErrorRate + FiveQI *FiveQI `per:",optional"` + DelayCritical *DelayCritical `per:",optional"` + AveragingWindow *AveragingWindow `per:",optional"` + MaximumDataBurstVolume *MaximumDataBurstVolume `per:",optional"` + ExtendedPacketDelayBudget *ExtendedPacketDelayBudget `per:",extie:IDExtendedPacketDelayBudget,crit:ignore"` + CNPacketDelayBudgetDL *ExtendedPacketDelayBudget `per:",extie:IDCNPacketDelayBudgetDL,crit:ignore"` + CNPacketDelayBudgetUL *ExtendedPacketDelayBudget `per:",extie:IDCNPacketDelayBudgetUL,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -// QosCharacteristicsKind selects the QosCharacteristics CHOICE alternative. -type QosCharacteristicsKind uint8 - -const ( - QosCharacteristicsNonDynamic5QI QosCharacteristicsKind = iota - QosCharacteristicsDynamic5QI - - qosCharacteristicsChoiceExtensions = 2 - qosCharacteristicsAlternatives = 3 -) - // QosCharacteristics ::= CHOICE { nonDynamic5QI, dynamic5QI, choice-Extensions // } — the CHOICE row of TS 38.413 §9.3.1.12, which has no section of its // own. The two descriptors keep their own types rather @@ -299,44 +289,9 @@ const ( // mandatory and optional across the alternatives, and flattening would lose // that. S1AP has no counterpart — an E-RAB carries a bare QCI. type QosCharacteristics struct { - Kind QosCharacteristicsKind - NonDynamic5QI NonDynamic5QIDescriptor - Dynamic5QI Dynamic5QIDescriptor -} - -func (q QosCharacteristics) MarshalPER(w *per.Writer, enc per.Encoding) error { - if q.Kind > QosCharacteristicsDynamic5QI { - return fmt.Errorf("ngap: invalid QosCharacteristics kind %d", q.Kind) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, qosCharacteristicsAlternatives-1, int64(q.Kind)); err != nil { - return err - } - - if q.Kind == QosCharacteristicsNonDynamic5QI { - return q.NonDynamic5QI.MarshalPER(w, enc) - } - - return q.Dynamic5QI.MarshalPER(w, enc) -} - -func (q *QosCharacteristics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, qosCharacteristicsAlternatives-1) - if err != nil { - return err - } - - if idx == qosCharacteristicsChoiceExtensions { - return decodeChoiceExtension(r, enc, "QosCharacteristics") - } - - q.Kind = QosCharacteristicsKind(idx) - - if q.Kind == QosCharacteristicsNonDynamic5QI { - return q.NonDynamic5QI.UnmarshalPER(r, enc) - } - - return q.Dynamic5QI.UnmarshalPER(r, enc) + NonDynamic5QI *NonDynamic5QIDescriptor `per:",choice:0"` + Dynamic5QI *Dynamic5QIDescriptor `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` } // QosFlowLevelQosParameters ::= SEQUENCE { qosCharacteristics, @@ -346,13 +301,19 @@ func (q *QosCharacteristics) UnmarshalPER(r *per.Reader, enc per.Encoding) error // E-RABLevelQoSParameters is the counterpart: a QCI where this has a // QosCharacteristics CHOICE, and no reflective/additional fields. type QosFlowLevelQosParameters struct { - QosCharacteristics QosCharacteristics - AllocationAndRetentionPriority AllocationAndRetentionPriority - GBRQosInformation *GBRQosInformation `per:",optional"` - ReflectiveQosAttribute *ReflectiveQosAttribute `per:"ENUMERATED,range:0..0,...,optional"` - AdditionalQosFlowInformation *AdditionalQosFlowInformation `per:"ENUMERATED,range:0..0,...,optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + QosCharacteristics QosCharacteristics + AllocationAndRetentionPriority AllocationAndRetentionPriority + GBRQosInformation *GBRQosInformation `per:",optional"` + ReflectiveQosAttribute *ReflectiveQosAttribute `per:",optional"` + AdditionalQosFlowInformation *AdditionalQosFlowInformation `per:",optional"` + QosMonitoringRequest *QosMonitoringRequest `per:",extie:IDQosMonitoringRequest,crit:ignore"` + QosMonitoringReportingFrequency *QosMonitoringReportingFrequency `per:",extie:IDQosMonitoringReportingFrequency,crit:ignore"` + PDUsetQoSParameters *PDUsetQoSParameters `per:",extie:IDPDUsetQoSParameters,crit:ignore"` + DLPDUSetInformationMarkingSupportIndication *DLPDUSetInformationMarkingSupportIndication `per:",extie:IDDLPDUSetInformationMarkingSupportIndication,crit:ignore"` + MMSID *MMSID `per:",extie:IDMMSID,crit:ignore"` + IndicationofBitrateAdaptation *IndicationofBitrateAdaptation `per:",extie:IDIndicationofBitrateAdaptation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // AllocationAndRetentionPriority ::= SEQUENCE { priorityLevelARP, @@ -360,10 +321,10 @@ type QosFlowLevelQosParameters struct { // (extensible) — TS 38.413 §9.3.1.19. type AllocationAndRetentionPriority struct { PriorityLevelARP PriorityLevelARP - PreemptionCapability PreemptionCapability `per:"ENUMERATED,range:0..1,..."` - PreemptionVulnerability PreemptionVulnerability `per:"ENUMERATED,range:0..1,..."` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PreemptionCapability PreemptionCapability + PreemptionVulnerability PreemptionVulnerability + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // GBR-QosInformation ::= SEQUENCE { four BitRates, notificationControl @@ -374,15 +335,17 @@ type AllocationAndRetentionPriority struct { // an optional extension on E-RABLevelQoSParameters, and is non-extensible // there where NGAP's PacketLossRate is extensible. type GBRQosInformation struct { - MaximumFlowBitRateDL BitRate - MaximumFlowBitRateUL BitRate - GuaranteedFlowBitRateDL BitRate - GuaranteedFlowBitRateUL BitRate - NotificationControl *NotificationControl `per:"ENUMERATED,range:0..0,...,optional"` - MaximumPacketLossRateDL *PacketLossRate `per:",optional"` - MaximumPacketLossRateUL *PacketLossRate `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + MaximumFlowBitRateDL BitRate + MaximumFlowBitRateUL BitRate + GuaranteedFlowBitRateDL BitRate + GuaranteedFlowBitRateUL BitRate + NotificationControl *NotificationControl `per:",optional"` + MaximumPacketLossRateDL *PacketLossRate `per:",optional"` + MaximumPacketLossRateUL *PacketLossRate `per:",optional"` + AlternativeQoSParaSetList AlternativeQoSParaSetList `per:",extie:IDAlternativeQoSParaSetList,crit:ignore"` + MonitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate `per:",extie:IDMonitoringRequestonAvailableBitrate,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowIdentifier ::= INTEGER (0..63, ...) — TS 38.413 §9.3.1.51. @@ -393,16 +356,20 @@ func (q QosFlowIdentifier) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (q *QosFlowIdentifier) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 63, "QosFlowIdentifier") + v, err := decodeExtensibleInt[QosFlowIdentifier](r, enc, 0, 63) if err != nil { return err } - *q = QosFlowIdentifier(v) + *q = v return nil } +func (v QosFlowIdentifier) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, 63) +} + // ERABID ::= INTEGER (0..15, ...) — TS 38.413 §9.3.2.3. NGAP carries an E-RAB // ID so a QoS flow can be tied to the EPS bearer it maps to during // interworking; the definition matches TS 36.413 §9.2.1.2 exactly. @@ -413,16 +380,18 @@ func (id ERABID) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (id *ERABID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 15, "E-RAB-ID") + v, err := decodeExtensibleInt[ERABID](r, enc, 0, 15) if err != nil { return err } - *id = ERABID(v) + *id = v return nil } +func (v ERABID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 0, 15) } + // QosFlowMappingIndication ::= ENUMERATED { ul, dl, ... }, inlined in // AssociatedQosFlowItem. type QosFlowMappingIndication uint8 @@ -430,19 +399,20 @@ type QosFlowMappingIndication uint8 const ( QosFlowMappingUL QosFlowMappingIndication = iota QosFlowMappingDL - - qosFlowMappingIndicationRootCount = 2 ) // QosFlowSetupRequestItem ::= SEQUENCE { qosFlowIdentifier, // qosFlowLevelQosParameters, e-RAB-ID OPTIONAL, iE-Extensions OPTIONAL } // (extensible). type QosFlowSetupRequestItem struct { - QosFlowIdentifier QosFlowIdentifier - QosFlowLevelQosParameters QosFlowLevelQosParameters - ERABID *ERABID `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + QosFlowIdentifier QosFlowIdentifier + QosFlowLevelQosParameters QosFlowLevelQosParameters + ERABID *ERABID `per:",optional"` + TSCTrafficCharacteristics *TSCTrafficCharacteristics `per:",extie:IDTSCTrafficCharacteristics,crit:ignore"` + RedundantQosFlowIndicator *RedundantQosFlowIndicator `per:",extie:IDRedundantQosFlowIndicator,crit:ignore"` + ECNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionInformationReportingRequest `per:",extie:IDECNMarkingorCongestionInformationReportingRequest,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowSetupRequestList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -454,7 +424,7 @@ type QosFlowSetupRequestList []QosFlowSetupRequestItem type QosFlowWithCauseItem struct { QosFlowIdentifier QosFlowIdentifier Cause Cause - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -466,9 +436,10 @@ type QosFlowListWithCause []QosFlowWithCauseItem // qosFlowMappingIndication OPTIONAL, iE-Extensions OPTIONAL } (extensible). type AssociatedQosFlowItem struct { QosFlowIdentifier QosFlowIdentifier - QosFlowMappingIndication *QosFlowMappingIndication `per:"ENUMERATED,range:0..1,...,optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + QosFlowMappingIndication *QosFlowMappingIndication `per:",optional"` + CurrentQoSParaSetIndex *AlternativeQoSParaSetIndex `per:",extie:IDCurrentQoSParaSetIndex,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // AssociatedQosFlowList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -479,7 +450,7 @@ type AssociatedQosFlowList []AssociatedQosFlowItem // OPTIONAL } (extensible). type QosFlowModifyConfirmItem struct { QosFlowIdentifier QosFlowIdentifier - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -493,18 +464,16 @@ type QosFlowModifyConfirmList []QosFlowModifyConfirmItem // QosFlowSetupRequestItem has them mandatory: a modify may touch only the // E-RAB mapping. type QosFlowAddOrModifyRequestItem struct { - QosFlowIdentifier QosFlowIdentifier - QosFlowLevelQosParameters *QosFlowLevelQosParameters `per:",optional"` - ERABID *ERABID `per:",optional"` - ULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - iEExtensions messageMeta `per:",exttable:qosFlowAddOrModifyRequestItemExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var qosFlowAddOrModifyRequestItemExtIEs = []ieSpec[QosFlowAddOrModifyRequestItem]{ - optionalExtension(IDULNGUUPTNLInformation, CriticalityIgnore, func(m *QosFlowAddOrModifyRequestItem) **UPTransportLayerInformation { - return &m.ULNGUUPTNLInformation - }), + QosFlowIdentifier QosFlowIdentifier + QosFlowLevelQosParameters *QosFlowLevelQosParameters `per:",optional"` + ERABID *ERABID `per:",optional"` + TSCTrafficCharacteristics *TSCTrafficCharacteristics `per:",extie:IDTSCTrafficCharacteristics,crit:ignore"` + RedundantQosFlowIndicator *RedundantQosFlowIndicator `per:",extie:IDRedundantQosFlowIndicator,crit:ignore"` + ULNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDULNGUUPTNLInformation,crit:ignore"` + DownlinkTLContainer *TLContainer `per:",extie:IDDownlinkTLContainer,crit:ignore"` + ECNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionInformationReportingRequest `per:",extie:IDECNMarkingorCongestionInformationReportingRequest,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowAddOrModifyRequestList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -516,31 +485,15 @@ type DataForwardingAccepted uint8 const ( DataForwardingAcceptedTrue DataForwardingAccepted = iota - - dataForwardingAcceptedRootCount = 1 ) -func (d DataForwardingAccepted) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, dataForwardingAcceptedRootCount, int64(d), "DataForwardingAccepted") -} - -func (d *DataForwardingAccepted) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, dataForwardingAcceptedRootCount, "DataForwardingAccepted") - if err != nil { - return err - } - - *d = DataForwardingAccepted(idx) - - return nil -} - // QosFlowAcceptedItem ::= SEQUENCE { qosFlowIdentifier, iE-Extensions OPTIONAL // } (extensible). type QosFlowAcceptedItem struct { - QosFlowIdentifier QosFlowIdentifier - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + QosFlowIdentifier QosFlowIdentifier + CurrentQoSParaSetIndex *AlternativeQoSParaSetIndex `per:",extie:IDCurrentQoSParaSetIndex,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowAcceptedList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -551,7 +504,7 @@ type QosFlowAcceptedList []QosFlowAcceptedItem // OPTIONAL } (extensible). type QosFlowToBeForwardedItem struct { QosFlowIdentifier QosFlowIdentifier - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -563,9 +516,10 @@ type QosFlowToBeForwardedList []QosFlowToBeForwardedItem // dataForwardingAccepted OPTIONAL, iE-Extensions OPTIONAL } (extensible). type QosFlowItemWithDataForwarding struct { QosFlowIdentifier QosFlowIdentifier - DataForwardingAccepted *DataForwardingAccepted `per:"ENUMERATED,range:0..0,...,optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + DataForwardingAccepted *DataForwardingAccepted `per:",optional"` + CurrentQoSParaSetIndex *AlternativeQoSParaSetIndex `per:",extie:IDCurrentQoSParaSetIndex,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowListWithDataForwarding ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -578,7 +532,7 @@ type QosFlowListWithDataForwarding []QosFlowItemWithDataForwarding type QosFlowPerTNLInformation struct { UPTransportLayerInformation UPTransportLayerInformation AssociatedQosFlowList AssociatedQosFlowList - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -586,7 +540,7 @@ type QosFlowPerTNLInformation struct { // iE-Extensions OPTIONAL } (extensible). type QosFlowPerTNLInformationItem struct { QosFlowPerTNLInformation QosFlowPerTNLInformation - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -607,25 +561,8 @@ const ( PDUSessionTypeIPv4v6 PDUSessionTypeEthernet PDUSessionTypeUnstructured - - pduSessionTypeRootCount = 5 ) -func (p PDUSessionType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, pduSessionTypeRootCount, int64(p), "PDUSessionType") -} - -func (p *PDUSessionType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, pduSessionTypeRootCount, "PDUSessionType") - if err != nil { - return err - } - - *p = PDUSessionType(idx) - - return nil -} - // NetworkInstance ::= INTEGER (1..256, ...) — TS 38.413 §9.3.1.113. type NetworkInstance uint16 @@ -634,23 +571,27 @@ func (n NetworkInstance) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (n *NetworkInstance) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 1, 256, "NetworkInstance") + v, err := decodeExtensibleInt[NetworkInstance](r, enc, 1, 256) if err != nil { return err } - *n = NetworkInstance(v) + *n = v return nil } +func (v NetworkInstance) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, 256) +} + // PDUSessionAggregateMaximumBitRate ::= SEQUENCE { DL, UL, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.1.102. Session-level, where // UEAggregateMaximumBitRate is UE-level; S1AP has only the UE-level form. type PDUSessionAggregateMaximumBitRate struct { DL BitRate UL BitRate - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -664,8 +605,6 @@ const ( IntegrityProtectionRequired IntegrityProtectionIndication = iota IntegrityProtectionPreferred IntegrityProtectionNotNeeded - - integrityProtectionIndicationRootCount = 3 ) // ConfidentialityProtectionIndication ::= ENUMERATED { required, preferred, @@ -677,8 +616,6 @@ const ( ConfidentialityProtectionRequired ConfidentialityProtectionIndication = iota ConfidentialityProtectionPreferred ConfidentialityProtectionNotNeeded - - confidentialityProtectionIndicationRootCount = 3 ) // IntegrityProtectionResult ::= ENUMERATED { performed, not-performed, ... }. @@ -688,8 +625,6 @@ type IntegrityProtectionResult uint8 const ( IntegrityProtectionPerformed IntegrityProtectionResult = iota IntegrityProtectionNotPerformed - - integrityProtectionResultRootCount = 2 ) // ConfidentialityProtectionResult ::= ENUMERATED { performed, not-performed, @@ -700,8 +635,6 @@ type ConfidentialityProtectionResult uint8 const ( ConfidentialityProtectionPerformed ConfidentialityProtectionResult = iota ConfidentialityProtectionNotPerformed - - confidentialityProtectionResultRootCount = 2 ) // MaximumIntegrityProtectedDataRate ::= ENUMERATED { bitrate64kbs, @@ -711,8 +644,6 @@ type MaximumIntegrityProtectedDataRate uint8 const ( MaximumIntegrityProtectedDataRate64kbs MaximumIntegrityProtectedDataRate = iota MaximumIntegrityProtectedDataRateMaximumUERate - - maximumIntegrityProtectedDataRateRootCount = 2 ) // SecurityIndication ::= SEQUENCE { integrityProtectionIndication, @@ -723,11 +654,12 @@ const ( // and a decoder accepts whatever arrives. TS 36.413 §9.2.1.163 defines the // same IE carrying the integrity indication alone. type SecurityIndication struct { - IntegrityProtectionIndication IntegrityProtectionIndication `per:"ENUMERATED,range:0..2,..."` - ConfidentialityProtectionIndication ConfidentialityProtectionIndication `per:"ENUMERATED,range:0..2,..."` - MaximumIntegrityProtectedDataRateUL *MaximumIntegrityProtectedDataRate `per:"ENUMERATED,range:0..1,...,optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + IntegrityProtectionIndication IntegrityProtectionIndication + ConfidentialityProtectionIndication ConfidentialityProtectionIndication + MaximumIntegrityProtectedDataRateUL *MaximumIntegrityProtectedDataRate `per:",optional"` + MaximumIntegrityProtectedDataRateDL *MaximumIntegrityProtectedDataRate `per:",extie:IDMaximumIntegrityProtectedDataRateDL,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // SecurityResult ::= SEQUENCE { integrityProtectionResult, @@ -735,51 +667,8 @@ type SecurityIndication struct { // 38.413 §9.3.1.59. TS 36.413 §9.2.1.164 defines the same IE carrying the // integrity result alone. type SecurityResult struct { - IntegrityProtectionResult IntegrityProtectionResult `per:"ENUMERATED,range:0..1,..."` - ConfidentialityProtectionResult ConfidentialityProtectionResult `per:"ENUMERATED,range:0..1,..."` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -// Name returns the value's name in TS 38.413 §9.3.1.27, or the empty string for -// a value the spec's root does not name. -func (i IntegrityProtectionIndication) Name() string { - switch i { - case IntegrityProtectionRequired: - return "required" - case IntegrityProtectionPreferred: - return "preferred" - case IntegrityProtectionNotNeeded: - return "not-needed" - default: - return "" - } -} - -// Name returns the value's name in TS 38.413 §9.3.1.27, or the empty string for -// a value the spec's root does not name. -func (c ConfidentialityProtectionIndication) Name() string { - switch c { - case ConfidentialityProtectionRequired: - return "required" - case ConfidentialityProtectionPreferred: - return "preferred" - case ConfidentialityProtectionNotNeeded: - return "not-needed" - default: - return "" - } -} - -// Name returns the value's name in TS 38.413 §9.3.1.103, or the empty string for -// a value the spec's root does not name. -func (m MaximumIntegrityProtectedDataRate) Name() string { - switch m { - case MaximumIntegrityProtectedDataRate64kbs: - return "bitrate64kbs" - case MaximumIntegrityProtectedDataRateMaximumUERate: - return "maximum-UE-rate" - default: - return "" - } + IntegrityProtectionResult IntegrityProtectionResult + ConfidentialityProtectionResult ConfidentialityProtectionResult + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } diff --git a/ngap/ie_qos_test.go b/ngap/ie_qos_test.go index 001afbbb37..77e1057139 100644 --- a/ngap/ie_qos_test.go +++ b/ngap/ie_qos_test.go @@ -5,11 +5,11 @@ package ngap import ( "encoding/hex" - "errors" "reflect" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const ( @@ -45,7 +45,7 @@ func TestAllocationAndRetentionPriorityGolden(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(out, in) { + if !out.Equal(in) { t.Fatalf("round trip %+v, want %+v", out, in) } } @@ -149,20 +149,20 @@ func TestQosGoldens(t *testing.T) { {"MaximumDataBurstVolumeRoot", mdbv4095, goldenMaximumDataBurstVolumeRoot}, {"MaximumDataBurstVolumeExt", MaximumDataBurstVolume(100000), goldenMaximumDataBurstVolumeExt}, {"QosCharacteristicsNonDynamic", &QosCharacteristics{ - Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}, }, goldenQosCharacteristicsNonDynamic}, {"QosCharacteristicsDynamic", &QosCharacteristics{ - Kind: QosCharacteristicsDynamic5QI, Dynamic5QI: dyn, + Dynamic5QI: &dyn, }, goldenQosCharacteristicsDynamic}, {"QosFlowLevelQosParametersMin", &QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ - Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: arp, }, goldenQosFlowLevelQosParametersMin}, {"QosFlowLevelQosParametersFull", &QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ - Kind: QosCharacteristicsDynamic5QI, Dynamic5QI: dyn, + Dynamic5QI: &dyn, }, AllocationAndRetentionPriority: arp, ReflectiveQosAttribute: &reflective, @@ -209,30 +209,39 @@ func TestDynamic5QIRoundTrip(t *testing.T) { } if out.PriorityLevelQos != in.PriorityLevelQos || out.PacketDelayBudget != in.PacketDelayBudget || - !reflect.DeepEqual(out.PacketErrorRate, in.PacketErrorRate) || *out.FiveQI != fiveQI || + !out.PacketErrorRate.Equal(in.PacketErrorRate) || *out.FiveQI != fiveQI || *out.DelayCritical != delayCritical || *out.AveragingWindow != avg || *out.MaximumDataBurstVolume != mdbv { t.Fatalf("round trip %+v, want %+v", out, in) } } -// PriorityLevelQos is (1..127): zero is below the lower bound and must not -// encode as if it were the first root value. -func TestPriorityLevelQosRejectsZero(t *testing.T) { - w := per.NewWriter() - if err := PriorityLevelQos(0).MarshalPER(w, per.Aligned); err == nil { - t.Fatal("encoded a PriorityLevelQos of 0") +func TestQosCharacteristicsRejectsNoAlternative(t *testing.T) { + if err := (&QosCharacteristics{}).MarshalPER(per.NewWriter(), per.Aligned); err == nil { + t.Error("encoded a QosCharacteristics with no alternative") } } -func TestQosCharacteristicsRejectsUnknownKind(t *testing.T) { - // Kind 2 is the choice-Extensions index: encoding it would emit that index - // with a Dynamic5QI body. A far-out-of-range kind would pass a weaker guard. - for _, kind := range []QosCharacteristicsKind{qosCharacteristicsChoiceExtensions, 7} { - w := per.NewWriter() - if err := (QosCharacteristics{Kind: kind}).MarshalPER(w, per.Aligned); err == nil { - t.Errorf("encoded QosCharacteristics kind %d", kind) - } +func TestQosCharacteristicsKeepsChoiceExtension(t *testing.T) { + in := QosCharacteristics{ChoiceExtension: &SingleContainer{ID: 999, Criticality: CriticalityIgnore, Value: "\x01"}} + + b, err := per.Marshal(&in, per.Aligned) + if err != nil { + t.Fatal(err) + } + + var out QosCharacteristics + if err := per.Unmarshal(b, &out); err != nil { + t.Fatalf("decode is lenient, got %v", err) + } + + if out.ChoiceExtension == nil || *out.ChoiceExtension != *in.ChoiceExtension { + t.Fatalf("choice-Extensions = %+v, want %+v", out.ChoiceExtension, in.ChoiceExtension) + } + + d := ap.Diagnose[ProtocolIEID](&out) + if len(d.IEs) != 1 || d.IEs[0].ID != 999 || d.IEs[0].Kind != ap.KindNotComprehended { + t.Fatalf("diagnostics = %+v, want the unknown alternative", d.IEs) } } @@ -266,7 +275,7 @@ func TestQosFlowListGoldens(t *testing.T) { qp := QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ - Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: AllocationAndRetentionPriority{ PriorityLevelARP: 1, @@ -277,15 +286,15 @@ func TestQosFlowListGoldens(t *testing.T) { tnl := QosFlowPerTNLInformation{ UPTransportLayerInformation: UPTransportLayerInformation{ - GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, + GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }, }, AssociatedQosFlowList: AssociatedQosFlowList{{QosFlowIdentifier: 3}}, } - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified} + cause := CauseRadioNetworkUnspecified.Cause() for _, c := range []struct { name string @@ -343,15 +352,15 @@ func TestQosFlowListsRejectOversizedAndEmpty(t *testing.T) { QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ - Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, }, } tnl := QosFlowPerTNLInformationItem{QosFlowPerTNLInformation: QosFlowPerTNLInformation{ - UPTransportLayerInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + UPTransportLayerInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, AssociatedQosFlowList: AssociatedQosFlowList{{QosFlowIdentifier: 3}}, }} @@ -485,7 +494,7 @@ func TestPDUSessionTypeRootCount(t *testing.T) { {PDUSessionTypeUnstructured, "40"}, } { w := per.NewWriter() - if err := per.EncodeEnumerated(w, per.Aligned, pduSessionTypeRootCount, true, int64(c.v)); err != nil { + if err := per.EncodeEnumerated(w, per.Aligned, int64(len(enumPDUSessionType.Root)), true, int64(c.v)); err != nil { t.Fatal(err) } @@ -495,38 +504,25 @@ func TestPDUSessionTypeRootCount(t *testing.T) { } } -func TestNetworkInstanceRejectsZero(t *testing.T) { - w := per.NewWriter() - if err := NetworkInstance(0).MarshalPER(w, per.Aligned); err == nil { - t.Fatal("encoded a NetworkInstance of 0, lower bound is 1") - } -} - -// The ENUMERATED root counts are inlined into per_gen.go from the struct tags, -// so these constants document rather than drive. They cannot be pinned by a -// golden either: counts 3 and 4 share an X.691 §11.5.7.1 row, so every root -// value encodes identically under both, and a decoder built one wider simply -// reads fewer bits and misparses downstream instead of erroring. Pinning the -// values against the ASN.1 module is what is left. func TestQosEnumRootCountsMatchSpec(t *testing.T) { for _, c := range []struct { name string - got int - want int + got int64 + want int64 }{ - {"Pre-emptionCapability", preemptionCapabilityRootCount, 2}, - {"Pre-emptionVulnerability", preemptionVulnerabilityRootCount, 2}, - {"NotificationControl", notificationControlRootCount, 1}, - {"DelayCritical", delayCriticalRootCount, 2}, - {"ReflectiveQosAttribute", reflectiveQosAttributeRootCount, 1}, - {"AdditionalQosFlowInformation", additionalQosFlowInformationRootCount, 1}, - {"QosFlowMappingIndication", qosFlowMappingIndicationRootCount, 2}, - {"PDUSessionType", pduSessionTypeRootCount, 5}, - {"IntegrityProtectionIndication", integrityProtectionIndicationRootCount, 3}, - {"ConfidentialityProtectionIndication", confidentialityProtectionIndicationRootCount, 3}, - {"IntegrityProtectionResult", integrityProtectionResultRootCount, 2}, - {"ConfidentialityProtectionResult", confidentialityProtectionResultRootCount, 2}, - {"MaximumIntegrityProtectedDataRate", maximumIntegrityProtectedDataRateRootCount, 2}, + {"Pre-emptionCapability", int64(len(enumPreemptionCapability.Root)), 2}, + {"Pre-emptionVulnerability", int64(len(enumPreemptionVulnerability.Root)), 2}, + {"NotificationControl", int64(len(enumNotificationControl.Root)), 1}, + {"DelayCritical", int64(len(enumDelayCritical.Root)), 2}, + {"ReflectiveQosAttribute", int64(len(enumReflectiveQosAttribute.Root)), 1}, + {"AdditionalQosFlowInformation", int64(len(enumAdditionalQosFlowInformation.Root)), 1}, + {"QosFlowMappingIndication", int64(len(enumQosFlowMappingIndication.Root)), 2}, + {"PDUSessionType", int64(len(enumPDUSessionType.Root)), 5}, + {"IntegrityProtectionIndication", int64(len(enumIntegrityProtectionIndication.Root)), 3}, + {"ConfidentialityProtectionIndication", int64(len(enumConfidentialityProtectionIndication.Root)), 3}, + {"IntegrityProtectionResult", int64(len(enumIntegrityProtectionResult.Root)), 2}, + {"ConfidentialityProtectionResult", int64(len(enumConfidentialityProtectionResult.Root)), 2}, + {"MaximumIntegrityProtectedDataRate", int64(len(enumMaximumIntegrityProtectedDataRate.Root)), 2}, } { if c.got != c.want { t.Errorf("%s root count is %d, TS 38.413 ASN.1 says %d", c.name, c.got, c.want) @@ -557,13 +553,12 @@ func TestExtensibleIntConsumesExtensionValue(t *testing.T) { var pdb PacketDelayBudget - err := pdb.UnmarshalPER(r, per.Aligned) - if err == nil { - t.Fatal("extension value decoded as a root value") + if err := pdb.UnmarshalPER(r, per.Aligned); err != nil { + t.Fatal(err) } - if !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want errNotComprehended so criticality decides", err) + if pdb != 1024 || !pdb.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Fatalf("PacketDelayBudget = %d, want 1024 kept and reported not comprehended", pdb) } // The payload for the next field is only reachable if the extension value @@ -578,28 +573,45 @@ func TestExtensibleIntConsumesExtensionValue(t *testing.T) { } } -// 3GPP defines no extension addition for these constraints, so there is no -// legal out-of-root value to send. -func TestExtensibleIntRefusesOutOfRootOnEncode(t *testing.T) { - w := per.NewWriter() - if err := PacketDelayBudget(1024).MarshalPER(w, per.Aligned); err == nil { - t.Error("encoded a PacketDelayBudget above the root with no addition defined") - } +func TestExtensibleIntOutOfRootValuesRoundTripAndAreNotComprehended(t *testing.T) { + for _, v := range []interface { + per.Marshaler + ap.Diagnosable[ProtocolIEID] + }{ + PriorityLevelQos(0), + NetworkInstance(0), + PacketDelayBudget(1024), + DRBID(0), + FiveQI(255), + MaximumDataBurstVolume(2000001), + } { + w := per.NewWriter() + if err := v.MarshalPER(w, per.Aligned); err != nil { + t.Fatalf("%T(%v): %v", v, v, err) + } + + out := reflect.New(reflect.TypeOf(v)) + + if err := out.Interface().(per.Unmarshaler).UnmarshalPER(per.NewReader(perBytes(w)), per.Aligned); err != nil { + t.Fatalf("%T: decode: %v", v, err) + } - if n := len(perBytes(w)); n != 0 { - t.Errorf("wrote %d bytes on a refused encode, want none", n) + if got := out.Elem().Interface(); got != v { + t.Errorf("%T round trip = %v, want %v", v, got, v) + } + + _, isFiveQI := v.(FiveQI) + if got := v.Diagnose(&ap.Diagnosis[ProtocolIEID]{}); got == isFiveQI { + t.Errorf("%T(%v).Diagnose() = %v", v, v, got) + } } } -// MaximumDataBurstVolume ::= INTEGER (0..4095, ..., 4096..2000000): the -// extension branch is unconstrained on the wire, so both ends need bounding. -func TestMaximumDataBurstVolumeIsBounded(t *testing.T) { - w := per.NewWriter() - if err := MaximumDataBurstVolume(2000001).MarshalPER(w, per.Aligned); err == nil { - t.Error("encoded a value above the extension range ceiling") +func TestMaximumDataBurstVolumeExtensionRange(t *testing.T) { + if MaximumDataBurstVolume(2000000).Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Error("the top of the extension range is a known value") } - // Extension bit, one length octet, then 0xff — two's complement -1. neg := per.NewWriter() neg.WriteBit(true) neg.AlignToByte() diff --git a/ngap/ie_ran_node.go b/ngap/ie_ran_node.go index 082c78eb11..3aafd21bdc 100644 --- a/ngap/ie_ran_node.go +++ b/ngap/ie_ran_node.go @@ -5,129 +5,228 @@ package ngap import ( "fmt" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) -// GlobalRANNodeID ::= CHOICE { globalGNB-ID, globalNgENB-ID, globalN3IWF-ID, -// choice-Extensions } root alternatives (TS 38.413 §9.3.1.5). The CHOICE is -// not extensible, so choice-Extensions is a plain alternative index. -const ( - globalGNBID = iota - globalNgENBID - globalN3IWFID - globalRANNodeIDChoiceExtensions +type GlobalRANNodeID struct { + GlobalGNBID *GlobalGNBID `per:",choice:0"` + GlobalNgENBID *GlobalNgENBID `per:",choice:1"` + GlobalN3IWFID *GlobalN3IWFID `per:",choice:2"` + GlobalTNGFID *GlobalTNGFID `per:",choice:3,extie:IDGlobalTNGFID,crit:reject"` + GlobalTWIFID *GlobalTWIFID `per:",choice:3,extie:IDGlobalTWIFID,crit:reject"` + GlobalWAGFID *GlobalWAGFID `per:",choice:3,extie:IDGlobalWAGFID,crit:reject"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} - globalRANNodeIDAlternatives = 4 -) +type GlobalGNBID struct { + PLMNIdentity PLMNIdentity + GNBID GNBID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} -// Selects a GlobalRANNodeID alternative together with the nested node-id -// CHOICE alternative. The two levels are flattened because every combination -// names one kind of RAN node. -type RANNodeIDKind uint8 +type GNBID struct { + GNBID *GNBIDValue `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} -const ( - // RANNodeIDGNB is globalGNB-ID / gNB-ID: BIT STRING (SIZE(22..32)). - RANNodeIDGNB RANNodeIDKind = iota - // RANNodeIDMacroNgENB is globalNgENB-ID / macroNgENB-ID: SIZE(20). - RANNodeIDMacroNgENB - // RANNodeIDShortMacroNgENB is globalNgENB-ID / shortMacroNgENB-ID: SIZE(18). - RANNodeIDShortMacroNgENB - // RANNodeIDLongMacroNgENB is globalNgENB-ID / longMacroNgENB-ID: SIZE(21). - RANNodeIDLongMacroNgENB - // RANNodeIDN3IWF is globalN3IWF-ID / n3IWF-ID: BIT STRING (SIZE(16)). - RANNodeIDN3IWF -) +type GNBIDValue struct { + Value uint32 + Bits int +} + +type GlobalN3IWFID struct { + PLMNIdentity PLMNIdentity + N3IWFID N3IWFID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} -// How one kind sits on the wire. -type ranNodeIDShape struct { - outer int - inner int - lb, ub int +type N3IWFID struct { + N3IWFID *N3IWFIDValue `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` } -var ranNodeIDShapes = map[RANNodeIDKind]ranNodeIDShape{ - RANNodeIDGNB: {globalGNBID, 0, 22, 32}, - RANNodeIDMacroNgENB: {globalNgENBID, 0, 20, 20}, - RANNodeIDShortMacroNgENB: {globalNgENBID, 1, 18, 18}, - RANNodeIDLongMacroNgENB: {globalNgENBID, 2, 21, 21}, - RANNodeIDN3IWF: {globalN3IWFID, 0, 16, 16}, +type N3IWFIDValue uint16 + +type GlobalTNGFID struct { + PLMNIdentity PLMNIdentity + TNGFID TNGFID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -// nodeIDAlternatives is the number of alternatives in each Global*-ID's nested -// node-id CHOICE, including its choice-Extensions. None is extensible. -var nodeIDAlternatives = map[int]int{ - globalGNBID: 2, // gNB-ID, choice-Extensions - globalNgENBID: 4, // macroNgENB-ID, shortMacroNgENB-ID, longMacroNgENB-ID, choice-Extensions - globalN3IWFID: 2, // n3IWF-ID, choice-Extensions +type TNGFID struct { + TNGFID *TNGFIDValue `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` } -var nodeIDChoiceName = map[int]string{ - globalGNBID: "GNB-ID", - globalNgENBID: "NgENB-ID", - globalN3IWFID: "N3IWF-ID", +type TNGFIDValue struct{ BitString } + +type GlobalTWIFID struct { + PLMNIdentity PLMNIdentity + TWIFID TWIFID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -var kindForShape = func() map[[2]int]RANNodeIDKind { - m := make(map[[2]int]RANNodeIDKind, len(ranNodeIDShapes)) - for kind, s := range ranNodeIDShapes { - m[[2]int{s.outer, s.inner}] = kind - } +type TWIFID struct { + TWIFID *TWIFIDValue `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} - return m -}() +type TWIFIDValue struct{ BitString } -// TS 38.413 §9.3.1.5. Each of globalGNB-ID, globalNgENB-ID and globalN3IWF-ID -// is an extensible SEQUENCE of a PLMN identity and a node-id CHOICE, so the -// three flatten into one struct without losing anything the wire carries. -type GlobalRANNodeID struct { - Kind RANNodeIDKind +type GlobalWAGFID struct { PLMNIdentity PLMNIdentity + WAGFID WAGFID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} - // Value is the node identifier, right-aligned in Bits bits. - Value uint32 +type WAGFID struct { + WAGFID *WAGFIDValue `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type WAGFIDValue struct{ BitString } - // Only RANNodeIDGNB has a range to choose from (22..32); every other kind - // has one legal length, and encoding rejects anything else. - Bits int +// NgENB-ID ::= CHOICE { macroNgENB-ID, shortMacroNgENB-ID, longMacroNgENB-ID, +// choice-Extensions } — TS 38.413 §9.3.1.6. +type NgENBID struct { + MacroNgENBID *MacroNgENBID `per:",choice:0"` + ShortMacroNgENBID *ShortMacroNgENBID `per:",choice:1"` + LongMacroNgENBID *LongMacroNgENBID `per:",choice:2"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` } -// NgENBIDKind selects an NgENB-ID CHOICE alternative (TS 38.413 §9.3.1.6). The -// flattened GlobalRANNodeID above covers the same three alternatives as part of -// its own CHOICE; GlobalNgENB-ID is the standalone SEQUENCE TargeteNB-ID uses, -// which no GlobalRANNodeID sits inside. -type NgENBIDKind uint8 +type MacroNgENBID uint32 + +type ShortMacroNgENBID uint32 + +type LongMacroNgENBID uint32 const ( - NgENBIDMacro NgENBIDKind = iota // macroNgENB-ID: BIT STRING (SIZE(20)) - NgENBIDShortMacro // shortMacroNgENB-ID: SIZE(18) - NgENBIDLongMacro // longMacroNgENB-ID: SIZE(21) - - // ngENBIDAlternatives counts the three above plus choice-Extensions. The - // CHOICE is not extensible, so choice-Extensions is a plain alternative - // index. - ngENBIDAlternatives = 4 + gnbIDMinBits = 22 + gnbIDMaxBits = 32 + macroNgENBIDBits = 20 + shortMacroNgENBIDBits = 18 + longMacroNgENBIDBits = 21 + n3IWFIDBits = 16 + tngfIDBits = 32 + twifIDBits = 32 + wagfIDBits = 16 ) -var ngENBIDBits = map[NgENBIDKind]int{ - NgENBIDMacro: 20, - NgENBIDShortMacro: 18, - NgENBIDLongMacro: 21, +func NewGlobalGNBID(plmn PLMNIdentity, id uint32, bits int) GlobalRANNodeID { + return GlobalRANNodeID{GlobalGNBID: &GlobalGNBID{ + PLMNIdentity: plmn, + GNBID: GNBID{GNBID: &GNBIDValue{Value: id, Bits: bits}}, + }} } -// NgENB-ID ::= CHOICE { macroNgENB-ID, shortMacroNgENB-ID, longMacroNgENB-ID, -// choice-Extensions } — TS 38.413 §9.3.1.6. Each alternative fixes its own -// width, so the kind is what the width is read from. -type NgENBID struct { - Kind NgENBIDKind - Value uint32 +func NewGlobalNgENBID(plmn PLMNIdentity, id NgENBID) GlobalRANNodeID { + return GlobalRANNodeID{GlobalNgENBID: &GlobalNgENBID{PLMNIdentity: plmn, NgENBID: id}} +} + +func NewGlobalN3IWFID(plmn PLMNIdentity, id uint16) GlobalRANNodeID { + v := N3IWFIDValue(id) + + return GlobalRANNodeID{GlobalN3IWFID: &GlobalN3IWFID{PLMNIdentity: plmn, N3IWFID: N3IWFID{N3IWFID: &v}}} +} + +func NgENBIDOfBits(id uint32, bits int) (NgENBID, bool) { + switch bits { + case macroNgENBIDBits: + v := MacroNgENBID(id) + + return NgENBID{MacroNgENBID: &v}, true + case shortMacroNgENBIDBits: + v := ShortMacroNgENBID(id) + + return NgENBID{ShortMacroNgENBID: &v}, true + case longMacroNgENBIDBits: + v := LongMacroNgENBID(id) + + return NgENBID{LongMacroNgENBID: &v}, true + default: + return NgENBID{}, false + } +} + +func (n NgENBID) ID() (value uint32, bits int, ok bool) { + switch { + case n.MacroNgENBID != nil: + return uint32(*n.MacroNgENBID), macroNgENBIDBits, true + case n.ShortMacroNgENBID != nil: + return uint32(*n.ShortMacroNgENBID), shortMacroNgENBIDBits, true + case n.LongMacroNgENBID != nil: + return uint32(*n.LongMacroNgENBID), longMacroNgENBIDBits, true + default: + return 0, 0, false + } +} + +func (g GlobalRANNodeID) PLMNIdentity() (PLMNIdentity, bool) { + switch { + case g.GlobalGNBID != nil: + return g.GlobalGNBID.PLMNIdentity, true + case g.GlobalNgENBID != nil: + return g.GlobalNgENBID.PLMNIdentity, true + case g.GlobalN3IWFID != nil: + return g.GlobalN3IWFID.PLMNIdentity, true + case g.GlobalTNGFID != nil: + return g.GlobalTNGFID.PLMNIdentity, true + case g.GlobalTWIFID != nil: + return g.GlobalTWIFID.PLMNIdentity, true + case g.GlobalWAGFID != nil: + return g.GlobalWAGFID.PLMNIdentity, true + default: + return PLMNIdentity{}, false + } +} + +func (g GlobalRANNodeID) NodeID() (value uint64, bits int, ok bool) { + switch { + case g.GlobalGNBID != nil: + if v := g.GlobalGNBID.GNBID.GNBID; v != nil { + return uint64(v.Value), v.Bits, true + } + case g.GlobalNgENBID != nil: + v, n, ok := g.GlobalNgENBID.NgENBID.ID() + + return uint64(v), n, ok + case g.GlobalN3IWFID != nil: + if v := g.GlobalN3IWFID.N3IWFID.N3IWFID; v != nil { + return uint64(*v), n3IWFIDBits, true + } + case g.GlobalTNGFID != nil: + if v := g.GlobalTNGFID.TNGFID.TNGFID; v != nil && v.Bits() <= 64 { + return v.Uint64(), v.Bits(), true + } + case g.GlobalTWIFID != nil: + if v := g.GlobalTWIFID.TWIFID.TWIFID; v != nil && v.Bits() <= 64 { + return v.Uint64(), v.Bits(), true + } + case g.GlobalWAGFID != nil: + if v := g.GlobalWAGFID.WAGFID.WAGFID; v != nil && v.Bits() <= 64 { + return v.Uint64(), v.Bits(), true + } + } + + return 0, 0, false } // GlobalNgENB-ID ::= SEQUENCE { pLMNIdentity, ngENB-ID, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.1.8. type GlobalNgENBID struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity NgENBID NgENBID - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // EPS-TAC ::= OCTET STRING (SIZE(2)) — TS 38.413 §9.3.3.32, held as the 16-bit @@ -138,10 +237,10 @@ type EPSTAC uint16 // EPS-TAI ::= SEQUENCE { pLMNIdentity, ePS-TAC, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.3.31. type EPSTAI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity TAC EPSTAC - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // The library owns every conversion between a wire field and the sub-fields @@ -166,20 +265,21 @@ func (g GlobalRANNodeID) cellIdentity(cellID uint64, width int, kind string) (ui // Unlike S1AP, whose 28-bit Home eNB ID is itself the cell identity, no NGAP // node kind is as wide as either cell identity (gNB-ID tops out at 32 of 36, // ng-eNB at 21 of 28), so a node filling it is always an error. - if g.Bits <= 0 || g.Bits >= width { - return 0, fmt.Errorf("ngap: node id of %d bits leaves no room in a %d-bit %s cell identity", g.Bits, width, kind) + value, bits, _ := g.NodeID() + if bits <= 0 || bits >= width { + return 0, fmt.Errorf("ngap: node id of %d bits leaves no room in a %d-bit %s cell identity", bits, width, kind) } - cellBits := width - g.Bits + cellBits := width - bits if cellID >= 1<= 1<= 1<= width { + value, bits, _ := g.NodeID() + if bits <= 0 || bits >= width { return 0, false } - cellBits := width - g.Bits - if id>>uint(cellBits) != uint64(g.Value) { + cellBits := width - bits + if id>>uint(cellBits) != value { return 0, false } @@ -206,9 +307,10 @@ func (g GlobalRANNodeID) splitCellIdentity(id uint64, width int) (uint64, bool) } func (g GlobalRANNodeID) Hex() string { - if g.Bits <= 0 { + value, bits, _ := g.NodeID() + if bits <= 0 { return "" } - return fmt.Sprintf("%0*x", (g.Bits+3)/4, g.Value) + return fmt.Sprintf("%0*x", (bits+3)/4, value) } diff --git a/ngap/ie_ran_node_test.go b/ngap/ie_ran_node_test.go index 361f21be50..8ee04f14b0 100644 --- a/ngap/ie_ran_node_test.go +++ b/ngap/ie_ran_node_test.go @@ -4,22 +4,38 @@ package ngap import ( - "strings" + "bytes" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) +func testNgENBNodeID(t *testing.T, plmn PLMNIdentity, id uint32, bits int) GlobalRANNodeID { + t.Helper() + + n, ok := NgENBIDOfBits(id, bits) + if !ok { + t.Fatalf("no ng-eNB identity is %d bits wide", bits) + } + + return NewGlobalNgENBID(plmn, n) +} + func TestGlobalRANNodeIDRoundTrip(t *testing.T) { + tngf := TNGFIDValue{BitStringFromUint(0xdeadbeef, 32)} + wagf := WAGFIDValue{BitStringFrom([]byte{0xab, 0xcd, 0xe0}, 20)} + for _, g := range []GlobalRANNodeID{ - {Kind: RANNodeIDGNB, PLMNIdentity: goldPLMN(), Value: 0x000102, Bits: 24}, - // gNB-ID is SIZE(22..32), so both ends of the range must survive. - {Kind: RANNodeIDGNB, PLMNIdentity: goldPLMN(), Value: 0x3fffff, Bits: 22}, - {Kind: RANNodeIDGNB, PLMNIdentity: goldPLMN(), Value: 0xffffffff, Bits: 32}, - {Kind: RANNodeIDMacroNgENB, PLMNIdentity: goldPLMN(), Value: 0xabcde, Bits: 20}, - {Kind: RANNodeIDShortMacroNgENB, PLMNIdentity: goldPLMN(), Value: 0x3ffff, Bits: 18}, - {Kind: RANNodeIDLongMacroNgENB, PLMNIdentity: goldPLMN(), Value: 0x1abcde, Bits: 21}, - {Kind: RANNodeIDN3IWF, PLMNIdentity: goldPLMN(), Value: 0xbeef, Bits: 16}, + NewGlobalGNBID(goldPLMN(), 0x000102, 24), + NewGlobalGNBID(goldPLMN(), 0x3fffff, 22), + NewGlobalGNBID(goldPLMN(), 0xffffffff, 32), + testNgENBNodeID(t, goldPLMN(), 0xabcde, 20), + testNgENBNodeID(t, goldPLMN(), 0x3ffff, 18), + testNgENBNodeID(t, goldPLMN(), 0x1abcde, 21), + NewGlobalN3IWFID(goldPLMN(), 0xbeef), + {GlobalTNGFID: &GlobalTNGFID{PLMNIdentity: goldPLMN(), TNGFID: TNGFID{TNGFID: &tngf}}}, + {GlobalWAGFID: &GlobalWAGFID{PLMNIdentity: goldPLMN(), WAGFID: WAGFID{WAGFID: &wagf}}}, } { w := per.NewWriter() if err := g.MarshalPER(w, per.Aligned); err != nil { @@ -31,28 +47,66 @@ func TestGlobalRANNodeIDRoundTrip(t *testing.T) { t.Fatalf("%+v: unmarshal: %v", g, err) } - if got != g { + if !got.Equal(g) { t.Errorf("round trip = %+v, want %+v", got, g) } + + w2 := per.NewWriter() + if err := got.MarshalPER(w2, per.Aligned); err != nil { + t.Fatal(err) + } + + if !bytes.Equal(perBytes(w), perBytes(w2)) { + t.Errorf("re-encode = % x, want % x", perBytes(w2), perBytes(w)) + } + } +} + +func TestGlobalRANNodeIDTypedChoiceExtensionWireBytes(t *testing.T) { + v := TWIFIDValue{BitStringFromUint(0x01020304, 32)} + g := GlobalRANNodeID{GlobalTWIFID: &GlobalTWIFID{PLMNIdentity: goldPLMN(), TWIFID: TWIFID{TWIFID: &v}}} + + w := per.NewWriter() + if err := g.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } + + inner, err := per.Marshal(g.GlobalTWIFID) + if err != nil { + t.Fatal(err) + } + + want := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(want, per.Aligned, 0, 3, 3); err != nil { + t.Fatal(err) + } + + if err := encodeContainerField(want, ieField{ID: IDGlobalTWIFID, Criticality: CriticalityReject, Value: ap.RawValue(inner)}); err != nil { + t.Fatal(err) + } + + if !bytes.Equal(perBytes(w), perBytes(want)) { + t.Errorf("GlobalTWIF-ID = % x, want % x", perBytes(w), perBytes(want)) + } + + if id, bits, ok := g.NodeID(); !ok || id != 0x01020304 || bits != 32 { + t.Errorf("NodeID() = %x/%d/%v", id, bits, ok) } } -// Each kind but the gNB has exactly one legal BIT STRING length. Encoding -// rejects any other rather than padding or truncating to fit. func TestGlobalRANNodeIDRejectsWrongBitLength(t *testing.T) { + macro := MacroNgENBID(1 << 20) + for _, tc := range []struct { name string in GlobalRANNodeID }{ - {"gNB below SIZE(22..32)", GlobalRANNodeID{Kind: RANNodeIDGNB, Bits: 21}}, - {"gNB above SIZE(22..32)", GlobalRANNodeID{Kind: RANNodeIDGNB, Bits: 33}}, - {"macroNgENB not 20", GlobalRANNodeID{Kind: RANNodeIDMacroNgENB, Bits: 21}}, - {"shortMacroNgENB not 18", GlobalRANNodeID{Kind: RANNodeIDShortMacroNgENB, Bits: 20}}, - {"longMacroNgENB not 21", GlobalRANNodeID{Kind: RANNodeIDLongMacroNgENB, Bits: 20}}, - {"n3IWF not 16", GlobalRANNodeID{Kind: RANNodeIDN3IWF, Bits: 32}}, - // An unset Bits is the zero value, not a request for the default. - {"unset bit length", GlobalRANNodeID{Kind: RANNodeIDMacroNgENB}}, - {"unknown kind", GlobalRANNodeID{Kind: RANNodeIDKind(9), Bits: 20}}, + {"gNB below SIZE(22..32)", NewGlobalGNBID(goldPLMN(), 0, 21)}, + {"gNB above SIZE(22..32)", NewGlobalGNBID(goldPLMN(), 0, 33)}, + {"gNB value wider than its bits", NewGlobalGNBID(goldPLMN(), 1<<22, 22)}, + {"macroNgENB wider than 20 bits", NewGlobalNgENBID(goldPLMN(), NgENBID{MacroNgENBID: ¯o})}, + {"no alternative", GlobalRANNodeID{}}, + {"empty gNB-ID", GlobalRANNodeID{GlobalGNBID: &GlobalGNBID{}}}, } { t.Run(tc.name, func(t *testing.T) { w := per.NewWriter() @@ -63,28 +117,30 @@ func TestGlobalRANNodeIDRejectsWrongBitLength(t *testing.T) { } } -// TS 38.413 §9.3.1.5 closes GlobalRANNodeID and each nested node-id CHOICE -// with a choice-Extensions alternative. Selecting one names an alternative -// this version does not model, which must be an error and not a zero value. -func TestGlobalRANNodeIDChoiceExtensionIsRejected(t *testing.T) { +func TestGlobalRANNodeIDUnknownChoiceExtensionsArePreserved(t *testing.T) { tests := []struct { name string build func(*per.Writer) error - want string + check func(*testing.T, GlobalRANNodeID) }{ { "outer GlobalRANNodeID choice-Extensions", func(w *per.Writer) error { - return per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, - globalRANNodeIDAlternatives-1, globalRANNodeIDChoiceExtensions) + return per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 3, 3) + }, + func(t *testing.T, g GlobalRANNodeID) { + t.Helper() + + if g.ChoiceExtension == nil || g.ChoiceExtension.ID != 9999 { + t.Errorf("ChoiceExtension = %+v", g.ChoiceExtension) + } }, - "unsupported GlobalRANNodeID alternative", }, { "nested GNB-ID choice-Extensions", func(w *per.Writer) error { enc := per.Aligned - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, globalRANNodeIDAlternatives-1, globalGNBID); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { return err } @@ -95,15 +151,21 @@ func TestGlobalRANNodeIDChoiceExtensionIsRejected(t *testing.T) { return err } - return per.EncodeConstrainedWholeNumber(w, enc, 0, int64(nodeIDAlternatives[globalGNBID]-1), 1) + return per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1) + }, + func(t *testing.T, g GlobalRANNodeID) { + t.Helper() + + if g.GlobalGNBID == nil || g.GlobalGNBID.GNBID.ChoiceExtension == nil { + t.Errorf("GNB-ID choice-Extensions not kept: %+v", g.GlobalGNBID) + } }, - "unsupported GNB-ID alternative", }, { "nested NgENB-ID choice-Extensions", func(w *per.Writer) error { enc := per.Aligned - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, globalRANNodeIDAlternatives-1, globalNgENBID); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { return err } @@ -114,39 +176,129 @@ func TestGlobalRANNodeIDChoiceExtensionIsRejected(t *testing.T) { return err } - return per.EncodeConstrainedWholeNumber(w, enc, 0, int64(nodeIDAlternatives[globalNgENBID]-1), 3) + return per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3) + }, + func(t *testing.T, g GlobalRANNodeID) { + t.Helper() + + if g.GlobalNgENBID == nil || g.GlobalNgENBID.NgENBID.ChoiceExtension == nil { + t.Errorf("NgENB-ID choice-Extensions not kept: %+v", g.GlobalNgENBID) + } }, - "unsupported NgENB-ID alternative", }, } for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { + for _, crit := range []Criticality{CriticalityReject, CriticalityIgnore} { + t.Run(tt.name+"/"+crit.String(), func(t *testing.T) { + w := per.NewWriter() + if err := tt.build(w); err != nil { + t.Fatal(err) + } + + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: ap.RawValue([]byte{0x00})}); err != nil { + t.Fatal(err) + } + + wire := perBytes(w) + + got, err := unmarshalPERValue[GlobalRANNodeID](wire) + if err != nil { + t.Fatalf("decode: %v", err) + } + + tt.check(t, got) + + if _, _, ok := got.NodeID(); ok { + t.Error("NodeID() reported an identity for an unknown alternative") + } + + d := ap.Diagnose[ProtocolIEID](&got) + if len(d.IEs) != 1 || d.IEs[0].ID != 9999 || d.IEs[0].Criticality != crit { + t.Errorf("diagnostics = %+v, want the unknown IE on criticality %v", d.IEs, crit) + } + + w2 := per.NewWriter() + if err := got.MarshalPER(w2, per.Aligned); err != nil { + t.Fatal(err) + } + + if !bytes.Equal(perBytes(w2), wire) { + t.Errorf("re-encode = % x, want % x", perBytes(w2), wire) + } + }) + } + } +} + +func TestTypedChoiceExtensionsKeepWireCriticality(t *testing.T) { + tngf := TNGFIDValue{BitStringFromUint(0xcafe0001, 32)} + gTNGF := GlobalTNGFID{PLMNIdentity: goldPLMN(), TNGFID: TNGFID{TNGFID: &tngf}} + tai := TAI{PLMNIdentity: goldPLMN(), TAC: 9} + uTWIF := UserLocationInformationTWIF{TWAPID: TWAPID{0x01}, IPAddress: tlaOf(10, 1, 1, 1), TAI: &tai} + + for _, tc := range []struct { + name string + index int64 + ub int64 + id ProtocolIEID + value per.Marshaler + new func() interface { + per.Marshaler + per.Unmarshaler + } + typed func(any) bool + }{ + {"GlobalTNGF-ID", 3, 3, IDGlobalTNGFID, &gTNGF, func() interface { + per.Marshaler + per.Unmarshaler + } { + return &GlobalRANNodeID{} + }, func(v any) bool { + return v.(*GlobalRANNodeID).GlobalTNGFID != nil && v.(*GlobalRANNodeID).GlobalTNGFID.Equal(gTNGF) + }}, + {"UserLocationInformationTWIF", 3, 3, IDUserLocationInformationTWIF, &uTWIF, func() interface { + per.Marshaler + per.Unmarshaler + } { + return &UserLocationInformation{} + }, func(v any) bool { + return v.(*UserLocationInformation).TWIF != nil && v.(*UserLocationInformation).TWIF.Equal(uTWIF) + }}, + } { + t.Run(tc.name, func(t *testing.T) { + inner, err := per.Marshal(tc.value) + if err != nil { + t.Fatal(err) + } + w := per.NewWriter() - if err := tt.build(w); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, tc.ub, tc.index); err != nil { + t.Fatal(err) + } + + if err := encodeContainerField(w, ieField{ID: tc.id, Criticality: CriticalityNotify, Value: ap.RawValue(inner)}); err != nil { t.Fatal(err) } - // The alternative's own ProtocolIE-SingleContainer payload. - if err := encodeContainerField(w, per.Aligned, ieField{ - id: IDGlobalRANNodeID, - crit: CriticalityReject, - raw: []byte{0x00}, - }); err != nil { + wire := perBytes(w) + + v := tc.new() + if err := v.UnmarshalPER(per.NewReader(wire), per.Aligned); err != nil { t.Fatal(err) } - got, err := unmarshalPERValue[GlobalRANNodeID](perBytes(w)) - if err == nil { - t.Fatalf("decoded as %+v, want an error", got) + if !tc.typed(v) { + t.Fatalf("decoded %+v, want the typed alternative", v) } - if !strings.Contains(err.Error(), tt.want) { - t.Errorf("error = %q, want it to contain %q", err, tt.want) + re := per.NewWriter() + if err := v.MarshalPER(re, per.Aligned); err != nil { + t.Fatal(err) } - if got != (GlobalRANNodeID{}) { - t.Errorf("value = %+v, want it left untouched", got) + if !bytes.Equal(perBytes(re), wire) { + t.Errorf("re-encode = % x, want % x", perBytes(re), wire) } }) } diff --git a/ngap/ie_setup.go b/ngap/ie_setup.go index 9c4de9116f..313de9897b 100644 --- a/ngap/ie_setup.go +++ b/ngap/ie_setup.go @@ -4,8 +4,6 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -25,10 +23,13 @@ type TAC uint32 // BroadcastPLMNItem ::= SEQUENCE { pLMNIdentity, tAISliceSupportList, // iE-Extensions OPTIONAL } (extensible). type BroadcastPLMNItem struct { - _ [0]struct{} `per:"extseq"` - PLMNIdentity PLMNIdentity - TAISliceSupportList SliceSupportList - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + PLMNIdentity PLMNIdentity + TAISliceSupportList SliceSupportList + NPNSupport *NPNSupport `per:",extie:IDNPNSupport,crit:reject"` + ExtendedTAISliceSupportList ExtendedSliceSupportList `per:",extie:IDExtendedTAISliceSupportList,crit:reject"` + TAINSAGSupportList TAINSAGSupportList `per:",extie:IDTAINSAGSupportList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // BroadcastPLMNList ::= SEQUENCE (SIZE(1..maxnoofBPLMNs)) OF @@ -38,143 +39,72 @@ type BroadcastPLMNList []BroadcastPLMNItem // SupportedTAItem ::= SEQUENCE { tAC, broadcastPLMNList, iE-Extensions // OPTIONAL } (extensible). type SupportedTAItem struct { - _ [0]struct{} `per:"extseq"` - TAC TAC - BroadcastPLMNList BroadcastPLMNList - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + TAC TAC + BroadcastPLMNList BroadcastPLMNList + ConfiguredTACIndication *ConfiguredTACIndication `per:",extie:IDConfiguredTACIndication,crit:ignore"` + RATInformation *RATInformation `per:",extie:IDRATInformation,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` } -// SupportedTAList ::= SEQUENCE (SIZE(1..maxnoofTACs)) OF SupportedTAItem. -type SupportedTAList []SupportedTAItem - -// PLMNSupportItem ::= SEQUENCE { pLMNIdentity, sliceSupportList, -// iE-Extensions OPTIONAL } (extensible). -type PLMNSupportItem struct { - PLMNIdentity PLMNIdentity - SliceSupportList SliceSupportList - NPNSupport *NPNSupport - ExtendedSliceSupportList ExtendedSliceSupportList - OnboardingSupport *OnboardingSupport +type ConfiguredTACIndication uint8 - iEExtensions messageMeta - extensions per.ExtensionAdditions -} - -var pLMNSupportItemExtIEs = []ieSpec[PLMNSupportItem]{ - { - id: IDNPNSupport, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PLMNSupportItem, raw []byte, enc per.Encoding) error { - var v NPNSupport - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.NPNSupport = &v - - return nil - }, - encode: func(m *PLMNSupportItem) (per.Marshaler, bool) { - if m.NPNSupport == nil { - return nil, false - } - - return m.NPNSupport, true - }, - }, - { - id: IDExtendedSliceSupportList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PLMNSupportItem, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ExtendedSliceSupportList) - }, - encode: func(m *PLMNSupportItem) (per.Marshaler, bool) { - if len(m.ExtendedSliceSupportList) == 0 { - return nil, false - } - - return m.ExtendedSliceSupportList, true - }, - }, - { - id: IDOnboardingSupport, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PLMNSupportItem, raw []byte, enc per.Encoding) error { - var v OnboardingSupport - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.OnboardingSupport = &v - - return nil - }, - encode: func(m *PLMNSupportItem) (per.Marshaler, bool) { - if m.OnboardingSupport == nil { - return nil, false - } - - return m.OnboardingSupport, true - }, - }, -} +const ( + ConfiguredTACIndicationTrue ConfiguredTACIndication = iota +) -func (p *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pLMNSupportItemExtIEs, p, &p.iEExtensions) +type RATInformation uint8 - w.WriteBit(p.extensions.Present()) - w.WriteBit(len(ext) > 0) +const ( + RATInformationUnlicensed RATInformation = iota + RATInformationNBIoT + RATInformationNRLEO + RATInformationNRMEO + RATInformationNRGEO + RATInformationNROTHERSAT +) - if err := p.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } +const maxnoofNSAGs = 256 - if err := p.SliceSupportList.MarshalPER(w, enc); err != nil { - return err - } +type TAINSAGSupportItem struct { + NSAGID NSAGID `per:",range:0..255,..."` + NSAGSliceSupportList ExtendedSliceSupportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} - if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { - return err - } - } +type NSAGID uint16 - if p.extensions.Present() { - return p.extensions.MarshalPER(w, enc) - } +type TAINSAGSupportList []TAINSAGSupportItem - return nil +func (l TAINSAGSupportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofNSAGs, []TAINSAGSupportItem(l)) } -func (p *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (l *TAINSAGSupportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAINSAGSupportItem](r, enc, 1, maxnoofNSAGs) if err != nil { return err } - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - if err := p.PLMNIdentity.UnmarshalPER(r, enc); err != nil { - return err - } - - if err := p.SliceSupportList.UnmarshalPER(r, enc); err != nil { - return err - } + *l = items - if extContainer { - if err := decodeExtensionContainer(r, enc, pLMNSupportItemExtIEs, p, &p.iEExtensions); err != nil { - return err - } - } + return nil +} - if extBit { - return p.extensions.UnmarshalPER(r, enc) - } +// SupportedTAList ::= SEQUENCE (SIZE(1..maxnoofTACs)) OF SupportedTAItem. +type SupportedTAList []SupportedTAItem - return nil +// PLMNSupportItem ::= SEQUENCE { pLMNIdentity, sliceSupportList, +// iE-Extensions OPTIONAL } (extensible). +type PLMNSupportItem struct { + PLMNIdentity PLMNIdentity + SliceSupportList SliceSupportList + NPNSupport *NPNSupport `per:",extie:IDNPNSupport,crit:reject"` + ExtendedSliceSupportList ExtendedSliceSupportList `per:",extie:IDExtendedSliceSupportList,crit:reject"` + OnboardingSupport *OnboardingSupport `per:",extie:IDOnboardingSupport,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type NID uint64 @@ -196,36 +126,9 @@ func (n *NID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -const ( - npnSupportSNPN = iota - npnSupportChoiceExtensions - - npnSupportAlternatives = 2 -) - type NPNSupport struct { - SNPN NID -} - -func (n NPNSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, npnSupportAlternatives-1, npnSupportSNPN); err != nil { - return err - } - - return n.SNPN.MarshalPER(w, enc) -} - -func (n *NPNSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, npnSupportAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: NPN-Support choice: %w", err) - } - - if idx == npnSupportChoiceExtensions { - return decodeChoiceExtension(r, enc, "NPN-Support") - } - - return n.SNPN.UnmarshalPER(r, enc) + SNPN *NID `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` } type ExtendedSliceSupportList []SliceSupportItem @@ -249,25 +152,8 @@ type OnboardingSupport uint8 const ( OnboardingSupportTrue OnboardingSupport = iota - - onboardingSupportRootCount = 1 ) -func (o OnboardingSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, onboardingSupportRootCount, int64(o), "OnboardingSupport") -} - -func (o *OnboardingSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, onboardingSupportRootCount, "OnboardingSupport") - if err != nil { - return err - } - - *o = OnboardingSupport(idx) - - return nil -} - // PLMNSupportList ::= SEQUENCE (SIZE(1..maxnoofPLMNs)) OF PLMNSupportItem. type PLMNSupportList []PLMNSupportItem @@ -278,8 +164,6 @@ type UERetentionInformation uint8 const ( UERetentionUesRetained UERetentionInformation = iota - - ueRetentionInformationRootCount = 1 ) // PagingDRX ::= ENUMERATED { v32, v64, v128, v256, ... } (extensible). @@ -290,6 +174,4 @@ const ( PagingDRXv64 PagingDRXv128 PagingDRXv256 - - pagingDRXRootCount = 4 ) diff --git a/ngap/ie_slice.go b/ngap/ie_slice.go index c844398e3b..4ecbed6f78 100644 --- a/ngap/ie_slice.go +++ b/ngap/ie_slice.go @@ -9,7 +9,7 @@ const maxnoofRequestedSNSSAIs = 8 type RequestedNSSAIItem struct { SNSSAI SNSSAI - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -53,16 +53,16 @@ type SD [3]byte type SNSSAI struct { SST SST SD *SD `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } // SliceSupportItem ::= SEQUENCE { s-NSSAI, iE-Extensions OPTIONAL } // (extensible). type SliceSupportItem struct { - _ [0]struct{} `per:"extseq"` - SNSSAI SNSSAI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + SNSSAI SNSSAI + iEExtensions extensionMeta `per:",exttable"` } // SliceSupportList ::= SEQUENCE (SIZE(1..maxnoofSliceItems)) OF @@ -72,9 +72,9 @@ type SliceSupportList []SliceSupportItem // AllowedNSSAIItem ::= SEQUENCE { s-NSSAI, iE-Extensions OPTIONAL } // (extensible). type AllowedNSSAIItem struct { - _ [0]struct{} `per:"extseq"` - SNSSAI SNSSAI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + SNSSAI SNSSAI + iEExtensions extensionMeta `per:",exttable"` } // AllowedNSSAI ::= SEQUENCE (SIZE(1..maxnoofAllowedS-NSSAIs)) OF diff --git a/ngap/ie_stmsi.go b/ngap/ie_stmsi.go index c169341753..b22e8e8de0 100644 --- a/ngap/ie_stmsi.go +++ b/ngap/ie_stmsi.go @@ -3,6 +3,8 @@ package ngap +import "github.com/ellanetworks/core/per" + // FiveGTMSI ::= OCTET STRING (SIZE(4)). type FiveGTMSI uint32 @@ -14,9 +16,9 @@ type FiveGTMSI uint32 // fiveG-TMSI FiveG-TMSI, -- OCTET STRING (SIZE(4)) // iE-Extensions ... OPTIONAL } type FiveGSTMSI struct { - _ [0]struct{} `per:"extseq"` - AMFSetID AMFSetID - AMFPointer AMFPointer - FiveGTMSI FiveGTMSI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + AMFSetID AMFSetID + AMFPointer AMFPointer + FiveGTMSI FiveGTMSI + iEExtensions extensionMeta `per:",exttable"` } diff --git a/ngap/ie_table.go b/ngap/ie_table.go index cce4b34557..4455b8c18d 100644 --- a/ngap/ie_table.go +++ b/ngap/ie_table.go @@ -8,382 +8,189 @@ import ( "fmt" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) -// A peer chooses how many IEs to send, and both survive the decode that found -// them. -const ( - maxDiagnosticIEs = 64 - maxPreservedIEs = 32 -) - -// 16-bit id + 2-bit criticality + an open type of at least one length and one -// content octet. -const minIEFieldBits = 34 - // One row of a message's TS 38.413 §9.2/§9.3 IE table. -type ieSpec[M any] struct { - id ProtocolIEID - presence presence - crit Criticality +type ieSpec[M any] = ap.IESpec[ProtocolIEID, M] - // Set if and only if presence is presenceConditional. - condition func(m *M) bool - - decode func(m *M, raw []byte, enc per.Encoding) error - // encode reports false when the row's field is unset. - encode func(m *M) (per.Marshaler, bool) -} +const ( + presenceOptional = ap.PresenceOptional + presenceConditional = ap.PresenceConditional + presenceMandatory = ap.PresenceMandatory +) -// TS 38.413 §9.1.1 Presence. -func (s ieSpec[M]) required(m *M) bool { - switch s.presence { - case presenceMandatory: - return true - case presenceConditional: - return s.condition != nil && s.condition(m) - case presenceOptional: - return false - default: - return false - } +type messageMeta struct { + ap.Message[ProtocolIEID] } -// §10.3.5: only reject criticality stops an absent IE from being delivered, -// which is what lets a required reject IE be a value type. -func (s ieSpec[M]) deliverable() bool { return s.crit != CriticalityReject } +type extensionMeta = ap.Preserved[ProtocolIEID] func (u *messageMeta) meta() *messageMeta { return u } +func (u messageMeta) Diagnostics() Diagnostics { return Diagnostics{u.Message.Diagnostics()} } + type message interface { meta() *messageMeta } -// An unset required IE is an error: TS 38.413 §9.1.1 obliges the sender even -// where §10.3.5 lets a receiver carry on without it. func encodeMessageBody[M any, PM interface { *M message }](w *per.Writer, enc per.Encoding, procedure ProcedureCode, table []ieSpec[M], m PM, ) error { - if m.meta().dropped { - return fmt.Errorf("ngap: %s: unknown IEs were dropped on decode", procedure) - } - - w.WriteBit(m.meta().extensions.Present()) - - typed := make([]*ieField, len(table)) - - for i, spec := range table { - val, ok := spec.encode((*M)(m)) - required := spec.required((*M)(m)) - - if !ok { - if required { - return fmt.Errorf("ngap: %s: required IE %s is not set", procedure, spec.id) - } - - continue - } - - // §9.1.1: a conditional IE is carried only while its condition holds. - if spec.presence == presenceConditional && !required { - return fmt.Errorf("ngap: %s: conditional IE %s is set but its condition does not hold", procedure, spec.id) - } - - typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} - } - - if err := encodeIEContainer(w, enc, orderFields(table, typed, m.meta())); err != nil { - return err + if err := ap.EncodeMessage(profile, w, enc, table, (*M)(m), &m.meta().Message); err != nil { + return fmt.Errorf("ngap: %s: %w", procedure, err) } - return m.meta().extensions.MarshalPER(w, enc) + return nil } -func orderFields[M any](table []ieSpec[M], typed []*ieField, meta *messageMeta) []ieField { - fields := make([]ieField, 0, len(table)+len(meta.unknownIEs)) - - if meta.wire == nil { - for _, f := range typed { - if f != nil { - fields = append(fields, *f) - } - } - - for _, e := range meta.unknownIEs { - fields = append(fields, e.field()) - } - - return fields - } - - onWire := make([]bool, len(table)) - - for _, s := range meta.wire { - if idx, _, ok := lookupIESpec(table, s.id); ok && s.unknown < 0 { - onWire[idx] = true - } - } - - next := 0 - - flush := func(upto int) { - for ; next < upto; next++ { - if typed[next] != nil && !onWire[next] { - fields = append(fields, *typed[next]) - } - } - } - - for _, s := range meta.wire { - if s.unknown >= 0 { - fields = append(fields, meta.unknownIEs[s.unknown].field()) - - continue - } - - idx, _, ok := lookupIESpec(table, s.id) - if !ok { - continue - } - - flush(idx) - - if f := typed[idx]; f != nil { - fields = append(fields, ieField{id: f.id, crit: s.crit, val: f.val}) - } +func decodeMessageBody[M any, PM interface { + *M + message +}](procedure ProcedureCode, table []ieSpec[M], value []byte, +) (PM, error) { + m := PM(new(M)) - next = idx + 1 + if err := ap.DecodeMessage(profile, table, value, (*M)(m), &m.meta().Message); err != nil { + return nil, &TransferSyntaxError{Protocol: profile.Name, Procedure: procedure, Err: err} } - flush(len(table)) - - return fields + return m, nil } -// Applies the abstract syntax error handling of TS 38.413 §10.3.4.2, §10.3.5 and -// §10.3.6. Returns no message when the procedure must be rejected. func parseMessageBody[M any, PM interface { *M message }](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, ) (PM, error) { - return parseBoundedMessageBody[M, PM](procedure, trigger, table, value, maxPreservedIEs) -} - -func parseBoundedMessageBody[M any, PM interface { - *M - message -}](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, limit int, -) (PM, error) { - r := per.NewReader(value) - enc := per.Aligned - - extPresent, err := r.ReadBit() + m, err := decodeMessageBody[M, PM](procedure, table, value) if err != nil { - return nil, &TransferSyntaxError{Procedure: procedure, Err: fmt.Errorf("preamble: %w", err)} + return nil, err } - fields, err := decodeIEContainer(r, enc) - if err != nil { - return nil, &TransferSyntaxError{Procedure: procedure, Err: err} + if err := m.meta().Message.Diagnostics().Check(); err != nil { + return nil, newAbstractSyntaxError(procedure, trigger, err, table, value) } - var additions per.ExtensionAdditions + return m, nil +} - if extPresent { - if err := additions.UnmarshalPER(r, enc); err != nil { - return nil, &TransferSyntaxError{Procedure: procedure, Err: err} - } +func newAbstractSyntaxError[M any](procedure ProcedureCode, trigger TriggeringMessage, err error, table []ieSpec[M], value []byte) error { + var e *ap.AbstractSyntaxError[ProtocolIEID] + if !errors.As(err, &e) { + return err } - reject := func(cause int, ies []CriticalityDiagnosticsIEItem) error { - return &AbstractSyntaxError{ - Procedure: procedure, - Trigger: trigger, - Cause: Cause{Group: CauseGroupProtocol, Value: cause}, - IEs: ies, - decoded: modeledIEs(table, fields), - } + cause := CauseProtocolAbstractSyntaxErrorReject + if e.FalselyConstructed { + cause = CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage } - m := PM(new(M)) - meta := m.meta() - meta.extensions = additions - seen := make(map[ProtocolIEID]bool, len(table)) - lastIdx := -1 - - // Collected for one report naming them all (§10.3.4.2), truncated at the - // maxnoofErrors the list is bounded by so the report stays encodable. - var notUnderstood []CriticalityDiagnosticsIEItem - - reportNotUnderstood := func(id ProtocolIEID, crit Criticality) { - if len(notUnderstood) >= maxnoofErrors { - return - } - - notUnderstood = append(notUnderstood, CriticalityDiagnosticsIEItem{ - IECriticality: crit, - IEID: id, - TypeOfError: TypeOfErrorNotUnderstood, - }) + return &AbstractSyntaxError{ + Procedure: procedure, + Trigger: trigger, + Cause: cause.Cause(), + IEs: criticalityDiagnosticsItems(e.IEs), + decoded: modeledIEs(table, value), } +} - for _, f := range fields { - idx, spec, ok := lookupIESpec(table, f.id) - if !ok { - // §10.3.4.2: reject stops the procedure, the rest are carried - // past. §10.3.1 has the receiver read on either way, so the scan - // continues and reports every offender together. - if f.crit == CriticalityReject { - reportNotUnderstood(f.id, f.crit) - - continue - } - - meta.diagnostics.record(f.id, f.crit, TypeOfErrorNotUnderstood) - meta.preserveUpTo(f, limit) +func criticalityDiagnosticsItems(ds []DiagnosticIE) []CriticalityDiagnosticsIEItem { + var out []CriticalityDiagnosticsIEItem - continue + for _, d := range ds { + if len(out) >= maxnoofErrors { + break } - // §10.3.6: out of the order §9.2/§9.3 defines, or carried twice. Unknown - // ids do not advance the cursor. - if idx <= lastIdx { - // Abandoning the scan must not drop what it already collected. - return nil, reject(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage, notUnderstood) + kind := TypeOfErrorNotUnderstood + if d.Kind == ap.KindMissing { + kind = TypeOfErrorMissing } - lastIdx = idx - - if err := spec.decode((*M)(m), f.value, enc); err != nil { - // §10.3.1 cases 1, 2 and 6 are handled on criticality, not by - // abandoning the message. - if errors.Is(err, errNotComprehended) { - // §10.3.2 handles the item on its own criticality, which for an - // unmodeled extension is the extension's, not this IE's. - id, crit := f.id, f.crit - - var item *notComprehendedIE - if errors.As(err, &item) { - id, crit = item.ID, item.Crit - } - - if crit == CriticalityReject { - reportNotUnderstood(id, crit) - - continue - } - - meta.diagnostics.record(id, crit, TypeOfErrorNotUnderstood) - - continue - } - - return nil, &TransferSyntaxError{ - Procedure: procedure, - Err: fmt.Errorf("IE %s: %w", f.id, err), - } - } + out = append(out, CriticalityDiagnosticsIEItem{IECriticality: d.Criticality, IEID: d.ID, TypeOfError: kind}) + } - seen[f.id] = true + return out +} - meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) - } +func modeledIEs[M any](table []ieSpec[M], value []byte) []RawIE { + r := per.NewReader(value) - if wireMatchesTable(table, meta.wire) { - meta.wire = nil + if _, err := r.ReadBit(); err != nil { + return nil } - if len(notUnderstood) > 0 { - return nil, reject(CauseProtocolAbstractSyntaxErrorReject, notUnderstood) + fields, err := decodeIEContainer(r, per.Aligned) + if err != nil { + return nil } - // §10.3.5: absence is judged per IE, by the criticality §9.2/§9.3 assigns it. - var missingReject []CriticalityDiagnosticsIEItem - - for i := range table { - spec := table[i] - required := spec.required((*M)(m)) - - if seen[spec.id] { - // §10.3.6: a conditional IE carried when its condition is false. - if spec.presence == presenceConditional && !required { - return nil, reject(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage, nil) - } - - continue - } - - if !required { - continue - } + var out []RawIE - if spec.deliverable() { - meta.diagnostics.record(spec.id, spec.crit, TypeOfErrorMissing) + seen := make(map[ProtocolIEID]bool, len(table)) + for _, f := range fields { + if seen[f.ID] || !inTable(table, f.ID) { continue } - missingReject = append(missingReject, CriticalityDiagnosticsIEItem{ - IECriticality: spec.crit, - IEID: spec.id, - TypeOfError: TypeOfErrorMissing, - }) - } + seen[f.ID] = true - if len(missingReject) > 0 { - return nil, reject(CauseProtocolAbstractSyntaxErrorReject, missingReject) + out = append(out, f) } - return m, nil + return out } -func wireMatchesTable[M any](table []ieSpec[M], wire []wireSlot) bool { - for _, s := range wire { - if s.unknown >= 0 { - return false - } - - if _, spec, ok := lookupIESpec(table, s.id); !ok || spec.crit != s.crit { - return false +func inTable[M any](table []ieSpec[M], id ProtocolIEID) bool { + for i := range table { + if table[i].ID == id { + return true } } - return true + return false } -func lookupIESpec[M any](table []ieSpec[M], id ProtocolIEID) (int, ieSpec[M], bool) { - for i := range table { - if table[i].id == id { - return i, table[i], true - } +func decodeTransfer[T any, PT interface { + *T + per.Unmarshaler +}](b []byte, +) (PT, error) { + t := PT(new(T)) + + if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + return nil, err } - return -1, ieSpec[M]{}, false + return t, nil } -// First occurrence only, bounded by the table length so the peer does not -// choose the size. -func modeledIEs[M any](table []ieSpec[M], fields []rawIE) []RawIE { - var out []RawIE - - seen := make(map[ProtocolIEID]bool, len(table)) - - for _, f := range fields { - if seen[f.id] { - continue - } +func parseTransfer[T any, PT interface { + *T + per.Unmarshaler +}](b []byte, +) (PT, error) { + t, err := decodeTransfer[T, PT](b) + if err != nil { + return nil, err + } - if _, _, ok := lookupIESpec(table, f.id); !ok { - continue - } + if err := diagnosticsOf(t).Check(); err != nil { + return nil, fmt.Errorf("ngap: %w", err) + } - seen[f.id] = true + return t, nil +} - out = append(out, RawIE{ID: f.id, Criticality: f.crit, Value: f.value}) +func diagnosticsOf(v any) Diagnostics { + dv, ok := v.(ap.Diagnosable[ProtocolIEID]) + if !ok { + return Diagnostics{} } - return out + return Diagnostics{ap.Diagnose(dv)} } diff --git a/ngap/ie_tnl.go b/ngap/ie_tnl.go index 67c350230a..b767c19050 100644 --- a/ngap/ie_tnl.go +++ b/ngap/ie_tnl.go @@ -4,103 +4,26 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // TS 38.413, NGAP-Constants. const maxnoofTNLAssociations = 32 -// CPTransportLayerInformation alternatives (TS 38.413 §9.3.2.6). The CHOICE is -// closed by a choice-Extensions alternative rather than an extension marker, so -// the index is constrained across both. -const ( - cpTransportLayerInformationEndpointIPAddress = iota - cpTransportLayerInformationChoiceExtensions - - cpTransportLayerInformationAlternatives = 2 -) - // CPTransportLayerInformation ::= CHOICE { endpointIPAddress // TransportLayerAddress, choice-Extensions } (TS 38.413 §9.3.2.6). -// -// Only endpointIPAddress is modeled: the sole choice-Extensions alternative is -// EndpointIPAddressAndPort, which Ella Core neither sends nor acts on. type CPTransportLayerInformation struct { - EndpointIPAddress TransportLayerAddress - EndpointIPAddressAndPort *EndpointIPAddressAndPort - - endpointIPAddressAndPortCrit Criticality -} - -func (c CPTransportLayerInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - if c.EndpointIPAddressAndPort != nil { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, cpTransportLayerInformationAlternatives-1, - cpTransportLayerInformationChoiceExtensions); err != nil { - return err - } - - return encodeContainerField(w, enc, ieField{ - id: IDEndpointIPAddressAndPort, - crit: c.endpointIPAddressAndPortCrit, - val: c.EndpointIPAddressAndPort, - }) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, cpTransportLayerInformationAlternatives-1, - cpTransportLayerInformationEndpointIPAddress); err != nil { - return err - } - - return c.EndpointIPAddress.MarshalPER(w, enc) -} - -func (c *CPTransportLayerInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, cpTransportLayerInformationAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: CPTransportLayerInformation choice: %w", err) - } - - if idx == cpTransportLayerInformationEndpointIPAddress { - return c.EndpointIPAddress.UnmarshalPER(r, enc) - } - - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return fmt.Errorf("ngap: CPTransportLayerInformation alternative choice-Extensions id: %w", err) - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return fmt.Errorf("ngap: CPTransportLayerInformation alternative choice-Extensions criticality: %w", err) - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return fmt.Errorf("ngap: CPTransportLayerInformation alternative choice-Extensions value: %w", err) - } - - if ProtocolIEID(id) != IDEndpointIPAddressAndPort { - // A zero address must not read as one the peer selected. - return fmt.Errorf("%w: CPTransportLayerInformation alternative %s", errNotComprehended, ProtocolIEID(id)) - } - - var v EndpointIPAddressAndPort - if err := perIEDecode(val, &v); err != nil { - return err - } - - c.EndpointIPAddressAndPort = &v - c.endpointIPAddressAndPortCrit = Criticality(crit) - - return nil + EndpointIPAddress *TransportLayerAddress `per:",choice:0"` + EndpointIPAddressAndPort *EndpointIPAddressAndPort `per:",choice:1,extie:IDEndpointIPAddressAndPort,crit:reject"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` } type EndpointIPAddressAndPort struct { EndpointIPAddress TransportLayerAddress PortNumber PortNumber - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` } type TNLAssociationUsage uint8 @@ -109,25 +32,8 @@ const ( TNLAssociationUsageUE TNLAssociationUsage = iota TNLAssociationUsageNonUE TNLAssociationUsageBoth - - tnlAssociationUsageRootCount = 3 ) -func (u TNLAssociationUsage) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, tnlAssociationUsageRootCount, int64(u), "TNLAssociationUsage") -} - -func (u *TNLAssociationUsage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, tnlAssociationUsageRootCount, "TNLAssociationUsage") - if err != nil { - return err - } - - *u = TNLAssociationUsage(idx) - - return nil -} - type TNLAddressWeightFactor uint8 func (f TNLAddressWeightFactor) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -147,7 +53,7 @@ func (f *TNLAddressWeightFactor) UnmarshalPER(r *per.Reader, enc per.Encoding) e type AMFTNLAssociationSetupItem struct { AMFTNLAssociationAddress CPTransportLayerInformation - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -171,7 +77,7 @@ func (l *AMFTNLAssociationSetupList) UnmarshalPER(r *per.Reader, enc per.Encodin type TNLAssociationItem struct { TNLAssociationAddress CPTransportLayerInformation Cause Cause - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -196,7 +102,7 @@ type AMFTNLAssociationToAddItem struct { AMFTNLAssociationAddress CPTransportLayerInformation TNLAssociationUsage *TNLAssociationUsage `per:",optional"` TNLAddressWeightFactor TNLAddressWeightFactor - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -219,85 +125,9 @@ func (l *AMFTNLAssociationToAddList) UnmarshalPER(r *per.Reader, enc per.Encodin type AMFTNLAssociationToRemoveItem struct { AMFTNLAssociationAddress CPTransportLayerInformation - TNLAssociationTransportLayerAddressNGRAN *CPTransportLayerInformation - - iEExtensions messageMeta - extensions per.ExtensionAdditions -} - -var aMFTNLAssociationToRemoveItemExtIEs = []ieSpec[AMFTNLAssociationToRemoveItem]{ - { - id: IDTNLAssociationTransportLayerAddressNGRAN, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *AMFTNLAssociationToRemoveItem, raw []byte, enc per.Encoding) error { - var v CPTransportLayerInformation - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.TNLAssociationTransportLayerAddressNGRAN = &v - - return nil - }, - encode: func(m *AMFTNLAssociationToRemoveItem) (per.Marshaler, bool) { - if m.TNLAssociationTransportLayerAddressNGRAN == nil { - return nil, false - } - - return m.TNLAssociationTransportLayerAddressNGRAN, true - }, - }, -} - -func (i *AMFTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(aMFTNLAssociationToRemoveItemExtIEs, i, &i.iEExtensions) - - w.WriteBit(i.extensions.Present()) - w.WriteBit(len(ext) > 0) - - if err := i.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { - return err - } - - if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { - return err - } - } - - if i.extensions.Present() { - return i.extensions.MarshalPER(w, enc) - } - - return nil -} - -func (i *AMFTNLAssociationToRemoveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - if err := i.AMFTNLAssociationAddress.UnmarshalPER(r, enc); err != nil { - return err - } - - if extContainer { - if err := decodeExtensionContainer(r, enc, aMFTNLAssociationToRemoveItemExtIEs, i, &i.iEExtensions); err != nil { - return err - } - } - - if extBit { - return i.extensions.UnmarshalPER(r, enc) - } - - return nil + TNLAssociationTransportLayerAddressNGRAN *CPTransportLayerInformation `per:",extie:IDTNLAssociationTransportLayerAddressNGRAN,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type AMFTNLAssociationToRemoveList []AMFTNLAssociationToRemoveItem @@ -321,7 +151,7 @@ type AMFTNLAssociationToUpdateItem struct { AMFTNLAssociationAddress CPTransportLayerInformation TNLAssociationUsage *TNLAssociationUsage `per:",optional"` TNLAddressWeightFactor *TNLAddressWeightFactor `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -351,7 +181,7 @@ func (l *AMFTNLAssociationToUpdateList) UnmarshalPER(r *per.Reader, enc per.Enco type NGRANTNLAssociationToRemoveItem struct { TNLAssociationTransportLayerAddress CPTransportLayerInformation TNLAssociationTransportLayerAddressAMF *CPTransportLayerInformation `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // NGRANTNLAssociationToRemoveList ::= SEQUENCE diff --git a/ngap/ie_tnl_test.go b/ngap/ie_tnl_test.go index 1dc4ce8d04..da8ba73e53 100644 --- a/ngap/ie_tnl_test.go +++ b/ngap/ie_tnl_test.go @@ -5,7 +5,6 @@ package ngap import ( "bytes" - "strings" "testing" "github.com/ellanetworks/core/per" @@ -14,14 +13,14 @@ import ( func TestNGRANTNLAssociationToRemoveListRoundTrip(t *testing.T) { in := NGRANTNLAssociationToRemoveList{ { - TNLAssociationTransportLayerAddress: CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 3, 0, 3}}, - TNLAssociationTransportLayerAddressAMF: &CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 3, 0, 2}}, + TNLAssociationTransportLayerAddress: CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 3, 0, 3))}, + TNLAssociationTransportLayerAddressAMF: &CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 3, 0, 2))}, }, // The AMF-side address is optional; an item may name only its own. {TNLAssociationTransportLayerAddress: CPTransportLayerInformation{ - EndpointIPAddress: TransportLayerAddress{ + EndpointIPAddress: Ptr(tlaOf( 0x20, 0x01, 0x0d, 0xb8, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x11, - }, + )), }}, } @@ -40,8 +39,8 @@ func TestNGRANTNLAssociationToRemoveListRoundTrip(t *testing.T) { } for i := range in { - if !bytes.Equal(out[i].TNLAssociationTransportLayerAddress.EndpointIPAddress, - in[i].TNLAssociationTransportLayerAddress.EndpointIPAddress) { + if *out[i].TNLAssociationTransportLayerAddress.EndpointIPAddress != + *in[i].TNLAssociationTransportLayerAddress.EndpointIPAddress { t.Errorf("item %d address = %v, want %v", i, out[i].TNLAssociationTransportLayerAddress.EndpointIPAddress, in[i].TNLAssociationTransportLayerAddress.EndpointIPAddress) @@ -52,7 +51,7 @@ func TestNGRANTNLAssociationToRemoveListRoundTrip(t *testing.T) { t.Fatalf("item %d AMF address presence = %v, want %v", i, gotAMF, wantAMF) } - if wantAMF != nil && !bytes.Equal(gotAMF.EndpointIPAddress, wantAMF.EndpointIPAddress) { + if wantAMF != nil && *gotAMF.EndpointIPAddress != *wantAMF.EndpointIPAddress { t.Errorf("item %d AMF address = %v, want %v", i, gotAMF.EndpointIPAddress, wantAMF.EndpointIPAddress) } } @@ -72,7 +71,7 @@ func TestNGRANTNLAssociationToRemoveItemPreambleHasNoExtensionBit(t *testing.T) return perBytes(w) } - addr := CPTransportLayerInformation{EndpointIPAddress: TransportLayerAddress{10, 3, 0, 3}} + addr := CPTransportLayerInformation{EndpointIPAddress: Ptr(tlaOf(10, 3, 0, 3))} without := encode(t, NGRANTNLAssociationToRemoveItem{TNLAssociationTransportLayerAddress: addr}) with := encode(t, NGRANTNLAssociationToRemoveItem{ @@ -90,26 +89,59 @@ func TestNGRANTNLAssociationToRemoveItemPreambleHasNoExtensionBit(t *testing.T) } } -// §9.3.2.6 closes CPTransportLayerInformation with a choice-Extensions -// alternative, so selecting it must error rather than yield a zero address. -func TestCPTransportLayerInformationChoiceExtensionIsRejected(t *testing.T) { +func TestCPTransportLayerInformationChoiceExtensions(t *testing.T) { + port := EndpointIPAddressAndPort{EndpointIPAddress: tlaOf(192, 0, 2, 1), PortNumber: 38470} + + for _, c := range []struct { + name string + raw []byte + want func(CPTransportLayerInformation) bool + }{ + {"typed", ieRaw(t, &CPTransportLayerInformation{EndpointIPAddressAndPort: &port}), func(v CPTransportLayerInformation) bool { + return v.EndpointIPAddressAndPort != nil && v.ChoiceExtension == nil + }}, + {"unknown", choiceExtensionValue(t, 2, 1, IDAMFUENGAPID), func(v CPTransportLayerInformation) bool { + return v.ChoiceExtension != nil && v.ChoiceExtension.ID == IDAMFUENGAPID + }}, + } { + t.Run(c.name, func(t *testing.T) { + got, err := unmarshalPERValue[CPTransportLayerInformation](c.raw) + if err != nil { + t.Fatalf("decode is lenient, got %v", err) + } + + if !c.want(got) { + t.Fatalf("decoded %+v", got) + } + + if !bytes.Equal(ieRaw(t, &got), c.raw) { + t.Fatal("did not re-encode byte-exact") + } + }) + } +} + +func TestCPTransportLayerInformationKeepsWireCriticality(t *testing.T) { + port := EndpointIPAddressAndPort{EndpointIPAddress: tlaOf(192, 0, 2, 1), PortNumber: 38470} + w := per.NewWriter() - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, - cpTransportLayerInformationAlternatives-1, cpTransportLayerInformationChoiceExtensions); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 1, 1); err != nil { t.Fatal(err) } - got, err := unmarshalPERValue[CPTransportLayerInformation](perBytes(w)) - if err == nil { - t.Fatalf("decoded choice-Extensions as %+v, want an error", got) + if err := encodeContainerField(w, ieField{ID: IDEndpointIPAddressAndPort, Criticality: CriticalityIgnore, Value: &port}); err != nil { + t.Fatal(err) } - if !strings.Contains(err.Error(), "CPTransportLayerInformation alternative") { - t.Errorf("error = %q, want it to name the unsupported alternative", err) + raw := perBytes(w) + + got, err := unmarshalPERValue[CPTransportLayerInformation](raw) + if err != nil || got.EndpointIPAddressAndPort == nil { + t.Fatalf("decoded %+v, %v; want the typed alternative", got, err) } - if got.EndpointIPAddress != nil { - t.Errorf("EndpointIPAddress = %v, want it left untouched", got.EndpointIPAddress) + if !bytes.Equal(ieRaw(t, &got), raw) { + t.Fatal("the peer's criticality was not kept") } } diff --git a/ngap/ie_transport_test.go b/ngap/ie_transport_test.go index f4beaed68d..d5faf0afda 100644 --- a/ngap/ie_transport_test.go +++ b/ngap/ie_transport_test.go @@ -6,10 +6,10 @@ package ngap import ( "bytes" "encoding/hex" - "errors" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // Golden UPTransportLayerInformation carrying a GTP tunnel to 192.168.1.1 @@ -21,8 +21,8 @@ const goldenUPTransportLayerInformation = "01f0c0a8010100000001" func TestUPTransportLayerInformationGolden(t *testing.T) { in := UPTransportLayerInformation{ - GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, + GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }, } @@ -41,28 +41,30 @@ func TestUPTransportLayerInformationGolden(t *testing.T) { t.Fatal(err) } - if !bytes.Equal(out.GTPTunnel.TransportLayerAddress, in.GTPTunnel.TransportLayerAddress) || + if out.GTPTunnel.TransportLayerAddress != in.GTPTunnel.TransportLayerAddress || out.GTPTunnel.GTPTEID != in.GTPTunnel.GTPTEID { t.Fatalf("round trip: %+v, want %+v", out.GTPTunnel, in.GTPTunnel) } } -// The CHOICE is closed by choice-Extensions rather than an extension marker, so -// an unmodeled alternative is §10.3.1 case 6, handled on the carrying IE's -// criticality. func TestUPTransportLayerInformationChoiceExtension(t *testing.T) { - raw := choiceExtensionValue(t, upTransportLayerInformationAlternatives, - upTransportLayerInformationChoiceExtensions, IDAMFUENGAPID) + raw := choiceExtensionValue(t, 2, 1, IDAMFUENGAPID) - _, err := unmarshalPERValue[UPTransportLayerInformation](raw) - if err == nil { - t.Fatal("decoded an unmodeled choice-Extensions alternative") + got, err := unmarshalPERValue[UPTransportLayerInformation](raw) + if err != nil { + t.Fatalf("decode is lenient, got %v", err) + } + + if got.GTPTunnel != nil || got.ChoiceExtension == nil || got.ChoiceExtension.ID != IDAMFUENGAPID { + t.Fatalf("decoded %+v, want the unknown alternative kept", got) + } + + if !bytes.Equal(ieRaw(t, &got), raw) { + t.Fatal("unknown alternative did not re-encode byte-exact") } - // A transfer-syntax error here would abort the whole message instead of - // leaving criticality to decide, so the kind matters, not just that it - // failed. - if !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want errNotComprehended so criticality decides (§10.3.1 case 6)", err) + d := ap.Diagnose[ProtocolIEID](&got) + if len(d.IEs) != 1 || d.IEs[0].ID != IDAMFUENGAPID || d.IEs[0].Criticality != CriticalityReject { + t.Fatalf("diagnostics = %+v, want the alternative not comprehended on its own criticality", d.IEs) } } diff --git a/ngap/ie_ue.go b/ngap/ie_ue.go index b6c822f68a..c4b3c5678d 100644 --- a/ngap/ie_ue.go +++ b/ngap/ie_ue.go @@ -4,9 +4,8 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // UE NGAP ID ranges (TS 38.413 §9.3.3). The AMF id is 40 bits wide, so both @@ -73,25 +72,10 @@ const ( RRCCauseMOSMS RRCCauseMPSPriorityAccess RRCCauseMCSPriorityAccess - - rrcEstablishmentCauseRootCount = 10 + RRCCauseNotAvailable + RRCCauseMOExceptionData ) -func (c RRCEstablishmentCause) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, rrcEstablishmentCauseRootCount, int64(c), "RRCEstablishmentCause") -} - -func (c *RRCEstablishmentCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, rrcEstablishmentCauseRootCount, "RRCEstablishmentCause") - if err != nil { - return fmt.Errorf("ngap: rrc establishment cause: %w", err) - } - - *c = RRCEstablishmentCause(idx) - - return nil -} - // UEContextRequest ::= ENUMERATED { requested, ... } (extensible). No S1AP // counterpart: only NGAP lets the NG-RAN node ask for a UE context alongside // the initial NAS message (TS 38.413 §9.2.5.1). @@ -99,48 +83,14 @@ type UEContextRequest uint8 const ( UEContextRequested UEContextRequest = iota - - ueContextRequestRootCount = 1 ) -func (u UEContextRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, ueContextRequestRootCount, int64(u), "UEContextRequest") -} - -func (u *UEContextRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, ueContextRequestRootCount, "UEContextRequest") - if err != nil { - return err - } - - *u = UEContextRequest(idx) - - return nil -} - type GWContextReleaseIndication uint8 const ( GWContextReleaseIndicationTrue GWContextReleaseIndication = iota - - gwContextReleaseIndicationRootCount = 1 ) -func (g GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, gwContextReleaseIndicationRootCount, int64(g), "GWContextReleaseIndication") -} - -func (g *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, gwContextReleaseIndicationRootCount, "GWContextReleaseIndication") - if err != nil { - return err - } - - *g = GWContextReleaseIndication(idx) - - return nil -} - // Cell identity widths of the two 3GPP-access CGIs (TS 38.413 §9.3.1.7, // §9.3.1.9). S1AP has one, 28 bits wide. const ( @@ -148,31 +98,6 @@ const ( NRCellIdentityBits = 36 ) -// UserLocationInformation CHOICE alternatives (TS 38.413 §9.3.1.16). The CHOICE -// is closed by a choice-Extensions alternative rather than an extension marker, -// so the index is constrained across all four. -const ( - userLocationInformationEUTRA = iota - userLocationInformationNR - userLocationInformationN3IWF - userLocationInformationChoiceExtensions - - userLocationInformationAlternatives = 4 -) - -// UserLocationInformationKind selects which CGI the cell identity belongs to. -type UserLocationInformationKind uint8 - -const ( - // UserLocationEUTRA is userLocationInformationEUTRA: EUTRA-CGI, 28 bits. - UserLocationEUTRA UserLocationInformationKind = iota - // UserLocationNR is userLocationInformationNR: NR-CGI, 36 bits. - UserLocationNR - // UserLocationN3IWF is userLocationInformationN3IWF-with-PortNumber: an IP - // address and port instead of a cell. - UserLocationN3IWF -) - // PortNumber ::= OCTET STRING (SIZE(2)). type PortNumber uint16 @@ -195,38 +120,248 @@ func (p *PortNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // counterpart: the S1AP User Location Information carries no timestamp. type TimeStamp [4]byte +func (t TimeStamp) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 4, 4, true, true, false, t[:]) +} + +func (t *TimeStamp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) + if err != nil { + return err + } + + copy(t[:], b) + + return nil +} + // UserLocationInformation ::= CHOICE { userLocationInformationEUTRA, // userLocationInformationNR, userLocationInformationN3IWF-with-PortNumber, // choice-Extensions } — TS 38.413 §9.3.1.16. // -// The two 3GPP-access alternatives are an extensible SEQUENCE of a CGI, a TAI -// and an optional timeStamp, so they flatten into one struct: Kind says which -// CGI CellIdentity came from and therefore how wide it is. The N3IWF -// alternative reports an IP address and port instead, and uses IPAddress and -// PortNumber; Ella Core does not serve non-3GPP access, but modelling it lets an -// N3IWF's messages decode, which matters because the IE is mandatory-reject in -// INITIAL UE MESSAGE (§10.3.4.2). -// -// Only the with-PortNumber alternative decodes. The rest of the non-3GPP -// alternatives — TNGF, TWIF, W-AGF and N3IWF-without-PortNumber — are -// choice-Extensions, which decodeChoiceExtension consumes and reports as not -// comprehended, so the IE's own reject criticality rejects the procedure. -// // S1AP carries the same information as two separate mandatory IEs, E-UTRAN CGI // and TAI, with no CHOICE and no timestamp. type UserLocationInformation struct { - Kind UserLocationInformationKind + EUTRA *UserLocationInformationEUTRA `per:",choice:0"` + NR *UserLocationInformationNR `per:",choice:1"` + N3IWF *UserLocationInformationN3IWFWithPortNumber `per:",choice:2"` + TNGF *UserLocationInformationTNGF `per:",choice:3,extie:IDUserLocationInformationTNGF,crit:ignore"` + TWIF *UserLocationInformationTWIF `per:",choice:3,extie:IDUserLocationInformationTWIF,crit:ignore"` + WAGF *UserLocationInformationWAGF `per:",choice:3,extie:IDUserLocationInformationWAGF,crit:ignore"` + N3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber `per:",choice:3,extie:IDUserLocationInformationN3IWFwithoutPortNumber,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} - // Set for UserLocationEUTRA and UserLocationNR. - PLMNIdentity PLMNIdentity - // CellIdentity is right-aligned in the width Kind implies. - CellIdentity uint64 +type UserLocationInformationEUTRA struct { + EUTRACGI EUTRACGI + TAI TAI + TimeStamp *TimeStamp `per:",optional"` + PSCellInformation *NGRANCGI `per:",extie:IDPSCellInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UserLocationInformationNR struct { + NRCGI NRCGI + TAI TAI + TimeStamp *TimeStamp `per:",optional"` + PSCellInformation *NGRANCGI `per:",extie:IDPSCellInformation,crit:ignore"` + NID *NID `per:",extie:IDNID,crit:reject"` + NRNTNTAIInformation *NRNTNTAIInformation `per:",extie:IDNRNTNTAIInformation,crit:ignore"` + MobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation `per:",extie:IDMobileIABMTUserLocationInformation,crit:ignore"` + AdditionalULI *AdditionalULI `per:",extie:IDAdditionalULI,crit:ignore"` + AerialUEFlightInformationReporting *AerialUEFlightInformationReporting `per:",extie:IDAerialUEFlightInformationReporting,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UserLocationInformationN3IWFWithPortNumber struct { + IPAddress TransportLayerAddress + PortNumber PortNumber + TAI *TAI `per:",extie:IDTAI,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UserLocationInformationTNGF struct { + TNAPID TNAPID + IPAddress TransportLayerAddress + PortNumber *PortNumber `per:",optional"` + TAI *TAI `per:",extie:IDTAI,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UserLocationInformationTWIF struct { + TWAPID TWAPID + IPAddress TransportLayerAddress + PortNumber *PortNumber `per:",optional"` + TAI *TAI `per:",extie:IDTAI,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UserLocationInformationWAGF struct { + GlobalLineID *GlobalLineID `per:",choice:0"` + HFCNodeID *HFCNodeID `per:",choice:1"` + GlobalCableID *GlobalCableID `per:",choice:2,extie:IDGlobalCableID,crit:ignore"` + HFCNodeIDNew *HFCNodeIDNew `per:",choice:2,extie:IDHFCNodeIDnew,crit:ignore"` + GlobalCableIDNew *GlobalCableIDNew `per:",choice:2,extie:IDGlobalCableIDnew,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} + +type UserLocationInformationN3IWFWithoutPortNumber struct { + IPAddress TransportLayerAddress + TAI *TAI `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type GlobalLineID struct { + GlobalLineIdentity GlobalLineIdentity + LineType *LineType `per:",optional"` + TAI *TAI `per:",extie:IDTAI,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LineType uint8 + +const ( + LineTypeDSL LineType = iota + LineTypePON +) + +type HFCNodeIDNew struct { + HFCNodeID HFCNodeID + TAI TAI + GlobalCableID GlobalCableID `per:",extie:IDGlobalCableID,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type GlobalCableIDNew struct { + GlobalCableID GlobalCableID + TAI TAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRNTNTAIInformation struct { + ServingPLMN PLMNIdentity + TACListInNRNTN TACListInNRNTN + UELocationDerivedTACInNRNTN *TAC `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +const maxnoofTACsinNTN = 12 + +type TACListInNRNTN []TAC + +func (l TACListInNRNTN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTACsinNTN, []TAC(l)) +} + +func (l *TACListInNRNTN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAC](r, enc, 1, maxnoofTACsinNTN) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MobileIABMTUserLocationInformation struct { + NRCGI NRCGI TAI TAI - TimeStamp *TimeStamp + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AdditionalULI struct { + NRCGI NRCGI + TAI TAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AerialUEFlightInformationReporting struct { + Altitude Altitude `per:",range:-420..10000,..."` + TimeStamp TimeStamp + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type Altitude int32 + +type TNAPID []byte + +func (v TNAPID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *TNAPID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + *v = b + + return err +} + +type TWAPID []byte + +func (v TWAPID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *TWAPID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + *v = b + + return err +} + +type GlobalLineIdentity []byte + +func (v GlobalLineIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *GlobalLineIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + *v = b - // Set for UserLocationN3IWF. - IPAddress TransportLayerAddress - PortNumber PortNumber + return err +} + +type HFCNodeID []byte + +func (v HFCNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *HFCNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + *v = b + + return err +} + +type GlobalCableID []byte + +func (v GlobalCableID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *GlobalCableID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + *v = b + + return err } // NASPDU ::= OCTET STRING (unbounded), carried opaquely (TS 24.501). @@ -250,10 +385,10 @@ func (n *NASPDU) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // TAI ::= SEQUENCE { pLMNIdentity, tAC, iE-Extensions OPTIONAL } (extensible) // — TS 38.413 §9.3.3.11. type TAI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity TAC TAC - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionID ::= INTEGER (0..255) — TS 38.413 §9.3.1.50. @@ -285,23 +420,27 @@ func (b BitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (b *BitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, bitRateMax, "BitRate") + v, err := decodeExtensibleInt[BitRate](r, enc, 0, bitRateMax) if err != nil { return err } - *b = BitRate(v) + *b = v return nil } +func (v BitRate) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 0, bitRateMax) +} + // UEAggregateMaximumBitRate ::= SEQUENCE { ...DL, ...UL, iE-Extensions OPTIONAL } // (extensible) — TS 38.413 §9.3.1.58. type UEAggregateMaximumBitRate struct { - _ [0]struct{} `per:"extseq"` - DL BitRate - UL BitRate - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + DL BitRate + UL BitRate + iEExtensions extensionMeta `per:",exttable"` } // SecurityKey ::= BIT STRING (SIZE(256)) — the K_gNB. @@ -326,59 +465,43 @@ func (k *SecurityKey) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.1.86. Each field is // BIT STRING (SIZE(16, ...)). S1AP carries only the E-UTRA pair. type UESecurityCapabilities struct { - NREncryptionAlgorithms uint16 - NRIntegrityProtectionAlgorithms uint16 - EUTRAEncryptionAlgorithms uint16 - EUTRAIntegrityProtectionAlgorithms uint16 -} - -func (c UESecurityCapabilities) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - - for _, v := range [4]uint16{ - c.NREncryptionAlgorithms, c.NRIntegrityProtectionAlgorithms, - c.EUTRAEncryptionAlgorithms, c.EUTRAIntegrityProtectionAlgorithms, - } { - if err := per.EncodeBitString(w, enc, 16, 16, true, true, true, uintToBits(uint64(v), 16), 16); err != nil { - return err - } - } - - return nil + NREncryptionAlgorithms SecurityAlgorithms + NRIntegrityProtectionAlgorithms SecurityAlgorithms + EUTRAEncryptionAlgorithms SecurityAlgorithms + EUTRAIntegrityProtectionAlgorithms SecurityAlgorithms + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -func (c *UESecurityCapabilities) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } +const securityAlgorithmsBits = 16 - extContainer, err := r.ReadBit() - if err != nil { - return err - } +type SecurityAlgorithms struct { + Value uint16 + extended bool + raw BitString +} - var algs [4]uint16 +func SecurityAlgorithmsFrom(v uint16) SecurityAlgorithms { return SecurityAlgorithms{Value: v} } - for i := range algs { - b, nbits, err := per.DecodeBitString(r, enc, 16, 16, true, true, true) - if err != nil { - return err - } +func (a SecurityAlgorithms) Uint16() uint16 { return a.Value } - algs[i] = uint16(bitsToUint(b, nbits)) +func (a SecurityAlgorithms) MarshalPER(w *per.Writer, enc per.Encoding) error { + if a.extended { + return a.raw.encode(w, enc, securityAlgorithmsBits, securityAlgorithmsBits) } - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { + return BitStringFromUint(uint64(a.Value), securityAlgorithmsBits).encode(w, enc, securityAlgorithmsBits, securityAlgorithmsBits) +} + +func (a *SecurityAlgorithms) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, securityAlgorithmsBits, securityAlgorithmsBits) + if err != nil { return err } - *c = UESecurityCapabilities{ - NREncryptionAlgorithms: algs[0], - NRIntegrityProtectionAlgorithms: algs[1], - EUTRAEncryptionAlgorithms: algs[2], - EUTRAIntegrityProtectionAlgorithms: algs[3], + *a = SecurityAlgorithms{Value: uint16(BitStringFrom(append(b.Bytes(), 0, 0), securityAlgorithmsBits).Uint64())} + if b.Bits() != securityAlgorithmsBits { + a.extended, a.raw = true, b } return nil diff --git a/ngap/ies.go b/ngap/ies.go index 32a13d2cc0..90ebd4c4ec 100644 --- a/ngap/ies.go +++ b/ngap/ies.go @@ -4,9 +4,8 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // Container size bounds (TS 38.413, NGAP-Constants). @@ -15,186 +14,41 @@ const ( maxProtocolExtensions = 65535 ) -// Exactly one of val and raw is set; raw holds already-encoded open-type -// content, so an unmodeled IE round-trips verbatim. -type ieField struct { - id ProtocolIEID - crit Criticality - val per.Marshaler - raw []byte -} - -type rawIE struct { - id ProtocolIEID - crit Criticality - value []byte -} - -func (e rawIE) field() ieField { - return ieField{id: e.id, crit: e.crit, raw: e.value} -} - -// A ProtocolIE-Field the message type does not model; Value is open-type bytes. -type RawIE struct { - ID ProtocolIEID - Criticality Criticality - Value []byte -} - -// What the typed fields cannot carry: IEs this version does not model, and the -// abstract syntax errors that did not stop delivery. -type messageMeta struct { - unknownIEs []rawIE - wire []wireSlot - diagnostics Diagnostics - extensions per.ExtensionAdditions - dropped bool -} - -type wireSlot struct { - id ProtocolIEID - crit Criticality - unknown int -} - -// Bounded: a peer chooses both the count and the size of what we would retain. -func (u *messageMeta) preserve(f rawIE) { - u.preserveUpTo(f, maxPreservedIEs) -} - -func (u *messageMeta) preserveUpTo(f rawIE, limit int) { - if len(u.unknownIEs) >= limit { - u.diagnostics.Truncated = true - u.dropped = true - - return - } - - u.unknownIEs = append(u.unknownIEs, f) - u.wire = append(u.wire, wireSlot{id: f.id, crit: f.crit, unknown: len(u.unknownIEs) - 1}) -} - -// The abstract syntax errors §10.3.4.2 and §10.3.5 let the receiver carry on -// past. -func (u messageMeta) Diagnostics() Diagnostics { return u.diagnostics } - -// In wire order. -func (u messageMeta) UnknownIEs() []RawIE { - if len(u.unknownIEs) == 0 { - return nil - } - - out := make([]RawIE, len(u.unknownIEs)) - for i, e := range u.unknownIEs { - out[i] = RawIE{ID: e.id, Criticality: e.crit, Value: e.value} - } - - return out -} - -func encodeIEContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - if len(fields) > maxProtocolIEs { - return fmt.Errorf("ngap: %d IEs exceed maxProtocolIEs", len(fields)) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, maxProtocolIEs, int64(len(fields))); err != nil { - return err - } - - for _, f := range fields { - if err := encodeContainerField(w, enc, f); err != nil { - return err - } - } - - return nil +var profile = &ap.Profile{ + Name: "ngap", + MaxProtocolIEs: maxProtocolIEs, + MaxProtocolExtensions: maxProtocolExtensions, + OpaqueProcedures: []uint8{uint8(ProcPrivateMessage)}, + ProcedureName: func(pc uint8) string { return ProcedureCode(pc).String() }, + IEName: func(id uint16) string { return ProtocolIEID(id).String() }, } -func encodeContainerField(w *per.Writer, enc per.Encoding, f ieField) error { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, maxProtocolIEs, int64(f.id)); err != nil { - return err - } +type ieField = ap.FieldValue[ProtocolIEID] - if err := per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(f.crit)); err != nil { - return err - } +type SingleContainer = ap.SingleContainer[ProtocolIEID] - if f.raw != nil { - return per.EncodeOpenTypeBytes(w, enc, f.raw) - } +type rawIE = ap.Field[ProtocolIEID] - if f.val == nil { - return fmt.Errorf("ngap: IE %d has no value", f.id) - } - - if err := per.EncodeOpenType(w, enc, f.val); err != nil { - return fmt.Errorf("ngap: encode IE %d: %w", f.id, err) - } +// A ProtocolIE-Field the message type does not model; Value is open-type bytes. +type RawIE = ap.Field[ProtocolIEID] - return nil +func decodeIE(r *per.Reader, u per.Unmarshaler) error { + return u.UnmarshalPER(r, per.Aligned) } -// Reads the ProtocolIE-SingleContainer that closes an NGAP CHOICE (§9.3). -// Reporting the alternative by id beats returning a zero value the caller would -// read as a root alternative. -func decodeChoiceExtension(r *per.Reader, enc per.Encoding, choice string) error { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return fmt.Errorf("ngap: %s choice-Extensions id: %w", choice, err) - } +func restOctets(r *per.Reader) []byte { + b, _ := r.ReadOctets(r.Bits() / 8) - if _, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false); err != nil { - return fmt.Errorf("ngap: %s choice-Extensions criticality: %w", choice, err) - } - - if err := per.SkipOpenType(r, enc); err != nil { - return fmt.Errorf("ngap: %s choice-Extensions value: %w", choice, err) - } - - // §10.3.1 case 6, handled on criticality. The container was consumed above, - // so the decoder can carry on if criticality allows it. - return fmt.Errorf("%w: unsupported %s alternative %s", errNotComprehended, choice, ProtocolIEID(id)) + return b } // Keeps every field, including ids the caller does not model. // //nolint:unparam func decodeIEContainer(r *per.Reader, enc per.Encoding) ([]rawIE, error) { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return nil, fmt.Errorf("ngap: IE container length: %w", err) - } - - // A count the remaining octets cannot hold is bogus and must not be - // pre-allocated for. - if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { - return nil, fmt.Errorf("ngap: IE container declares %d IEs in %d bits", n, maxBits) - } - - fields := make([]rawIE, 0, n) - - for i := int64(0); i < n; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return nil, fmt.Errorf("ngap: IE %d id: %w", i, err) - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return nil, fmt.Errorf("ngap: IE %d criticality: %w", i, err) - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return nil, fmt.Errorf("ngap: IE %d value: %w", i, err) - } - - if len(val) == 0 { - return nil, fmt.Errorf("ngap: IE %d has an empty open type", i) - } - - fields = append(fields, rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val}) - } + return ap.DecodeIEContainer[ProtocolIEID](profile, r, enc) +} - return fields, nil +func perIEDecode(b []byte, u per.Unmarshaler) error { + return u.UnmarshalPER(per.NewReader(b), per.Aligned) } diff --git a/ngap/ies_test.go b/ngap/ies_test.go index 5624fc98cd..8929c957d2 100644 --- a/ngap/ies_test.go +++ b/ngap/ies_test.go @@ -8,15 +8,16 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestEncodeIEContainerKnownVector(t *testing.T) { w := per.NewWriter() err := encodeIEContainer(w, per.Aligned, []ieField{{ - id: 27, - crit: CriticalityIgnore, - raw: []byte{0xab, 0xcd}, + ID: 27, + Criticality: CriticalityIgnore, + Value: ap.RawValue([]byte{0xab, 0xcd}), }}) if err != nil { t.Fatal(err) @@ -53,9 +54,9 @@ func TestEmptyIEContainer(t *testing.T) { func TestIEContainerRoundTrip(t *testing.T) { in := []ieField{ - {id: 27, crit: CriticalityReject, raw: []byte{0x01, 0x02, 0x03}}, - {id: 1, crit: CriticalityIgnore, raw: []byte{0xff}}, - {id: 65535, crit: CriticalityNotify, val: per.MarshalerFunc(func(*per.Writer, per.Encoding) error { return nil })}, + {ID: 27, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x01, 0x02, 0x03})}, + {ID: 1, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xff})}, + {ID: 65535, Criticality: CriticalityNotify, Value: per.MarshalerFunc(func(*per.Writer, per.Encoding) error { return nil })}, } w := per.NewWriter() @@ -75,12 +76,12 @@ func TestIEContainerRoundTrip(t *testing.T) { wantValues := [][]byte{{0x01, 0x02, 0x03}, {0xff}, {0x00}} // empty body -> open type min 1 octet for i, f := range in { - if got[i].id != f.id || got[i].crit != f.crit { - t.Fatalf("IE %d: id/crit mismatch got {%d,%v}", i, got[i].id, got[i].crit) + if got[i].ID != f.ID || got[i].Criticality != f.Criticality { + t.Fatalf("IE %d: id/crit mismatch got {%d,%v}", i, got[i].ID, got[i].Criticality) } - if !bytes.Equal(got[i].value, wantValues[i]) { - t.Fatalf("IE %d: value % x, want % x", i, got[i].value, wantValues[i]) + if !bytes.Equal(got[i].Value, wantValues[i]) { + t.Fatalf("IE %d: value % x, want % x", i, got[i].Value, wantValues[i]) } } } @@ -88,8 +89,8 @@ func TestIEContainerRoundTrip(t *testing.T) { func TestRawIEReencodePreserves(t *testing.T) { // A container decoded and re-encoded from preserved raw IEs is byte-identical. original := []ieField{ - {id: 10, crit: CriticalityReject, raw: []byte{0xde, 0xad}}, - {id: 20, crit: CriticalityIgnore, raw: []byte{0xbe, 0xef, 0x00}}, + {ID: 10, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0xde, 0xad})}, + {ID: 20, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xbe, 0xef, 0x00})}, } w1 := per.NewWriter() @@ -104,7 +105,7 @@ func TestRawIEReencodePreserves(t *testing.T) { fields := make([]ieField, len(raw)) for i, e := range raw { - fields[i] = e.field() + fields[i] = e.Encodable() } w2 := per.NewWriter() diff --git a/ngap/initial_context_setup.go b/ngap/initial_context_setup.go index c24f2804e7..9f791d9b34 100644 --- a/ngap/initial_context_setup.go +++ b/ngap/initial_context_setup.go @@ -15,12 +15,13 @@ import ( // (§9.3.4.1). The AMF neither builds nor reads it — the SMF does — so it is // carried opaquely. type PDUSessionResourceSetupItemCxtReq struct { - PDUSessionID PDUSessionID - NASPDU *NASPDU `per:",optional"` - SNSSAI SNSSAI - Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PDUSessionID PDUSessionID + NASPDU *NASPDU `per:",optional"` + SNSSAI SNSSAI + Transfer TransferContainer + PduSessionExpectedUEActivityBehaviour *ExpectedUEActivityBehaviour `per:",extie:IDPduSessionExpectedUEActivityBehaviour,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListCxtReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -34,7 +35,7 @@ type PDUSessionResourceSetupListCxtReq []PDUSessionResourceSetupItemCxtReq type PDUSessionResourceSetupItemCxtRes struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -47,10 +48,10 @@ type PDUSessionResourceSetupListCxtRes []PDUSessionResourceSetupItemCxtRes // (extensible). The transfer contains a // PDUSessionResourceSetupUnsuccessfulTransfer (§9.3.4.16). type PDUSessionResourceFailedToSetupItemCxtRes struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceFailedToSetupListCxtRes ::= SEQUENCE @@ -60,10 +61,10 @@ type PDUSessionResourceFailedToSetupListCxtRes []PDUSessionResourceFailedToSetup // PDUSessionResourceFailedToSetupItemCxtFail has the same shape as its CxtRes // counterpart but its own ASN.1 type, so the two lists stay distinct. type PDUSessionResourceFailedToSetupItemCxtFail struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceFailedToSetupListCxtFail ::= SEQUENCE @@ -76,43 +77,87 @@ type InitialContextSetupRequest struct { RANUENGAPID RANUENGAPID // C-ifPDUSessionResourceSetup: present exactly when PDUSessionResourceSetup // is (§9.2.2.1). - UEAggregateMaximumBitRate *UEAggregateMaximumBitRate - GUAMI GUAMI - PDUSessionResourceSetup PDUSessionResourceSetupListCxtReq - AllowedNSSAI AllowedNSSAI - UESecurityCapabilities UESecurityCapabilities - SecurityKey SecurityKey - TraceActivation *TraceActivation - UERadioCapability UERadioCapability - NASPDU *NASPDU - UERadioCapabilityForPaging *UERadioCapabilityForPaging - AMFUENGAPID2 *AMFUENGAPID + UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + GUAMI GUAMI + PDUSessionResourceSetup PDUSessionResourceSetupListCxtReq + AllowedNSSAI AllowedNSSAI + UESecurityCapabilities UESecurityCapabilities + SecurityKey SecurityKey + TraceActivation *TraceActivation + UERadioCapability UERadioCapability + NASPDU *NASPDU + UERadioCapabilityForPaging *UERadioCapabilityForPaging + AMFUENGAPID2 *AMFUENGAPID + OldAMF *Name + CoreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive + MobilityRestrictionList *MobilityRestrictionList + IndexToRFSP *IndexToRFSP + MaskedIMEISV *MaskedIMEISV + EmergencyFallbackIndicator *EmergencyFallbackIndicator + RRCInactiveTransitionReportRequest *RRCInactiveTransitionReportRequest + RedirectionVoiceFallback *RedirectionVoiceFallback + LocationReportingRequestType *LocationReportingRequestType + CNAssistedRANTuning *CNAssistedRANTuning + SRVCCOperationPossible *SRVCCOperationPossible + IABAuthorized *IABAuthorized + EnhancedCoverageRestriction *EnhancedCoverageRestriction + ExtendedConnectedTime *ExtendedConnectedTime + UEDifferentiationInfo *UEDifferentiationInfo + NRV2XServicesAuthorized *NRV2XServicesAuthorized + LTEV2XServicesAuthorized *LTEV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + LTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + CEmodeBrestricted *CEmodeBrestricted + UEUPCIoTSupport *UEUPCIoTSupport + RGLevelWirelineAccessCharacteristics *RGLevelWirelineAccessCharacteristics + ManagementBasedMDTPLMNList MDTPLMNList + UERadioCapabilityID *UERadioCapabilityID + TimeSyncAssistanceInfo *TimeSyncAssistanceInfo + QMCConfigInfo *QMCConfigInfo + TargetNSSAIInformation *TargetNSSAIInformation + UESliceMaximumBitRateList UESliceMaximumBitRateList + FiveGProSeAuthorized *FiveGProSeAuthorized + FiveGProSeUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + FiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters + NetworkControlledRepeaterAuthorized *NetworkControlledRepeaterAuthorized + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + NRA2XServicesAuthorized *NRA2XServicesAuthorized + LTEA2XServicesAuthorized *LTEA2XServicesAuthorized + NRA2XUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + LTEA2XUEPC5AggregateMaximumBitRate *LTEUESidelinkAggregateMaximumBitrate + A2XPC5QoSParameters *A2XPC5QoSParameters + MobileIABAuthorized *MobileIABAuthorized + PartiallyAllowedNSSAI PartiallyAllowedNSSAI + SLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo + ExtendedOldAMF *ExtendedAMFName messageMeta } var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, + optionalExtension(IDOldAMF, CriticalityReject, func(m *InitialContextSetupRequest) **Name { return &m.OldAMF }), { - id: IDUEAggregateMaximumBitRate, presence: presenceConditional, crit: CriticalityReject, - condition: func(m *InitialContextSetupRequest) bool { return m.PDUSessionResourceSetup != nil }, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitRate, Presence: presenceConditional, Criticality: CriticalityReject, + Condition: func(m *InitialContextSetupRequest) bool { return m.PDUSessionResourceSetup != nil }, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var v UEAggregateMaximumBitRate - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -120,7 +165,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return nil }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -128,19 +173,22 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UEAggregateMaximumBitRate, true }, }, + optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *InitialContextSetupRequest) **CoreNetworkAssistanceInformationForInactive { + return &m.CoreNetworkAssistanceInformationForInactive + }), { - id: IDGUAMI, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GUAMI) + ID: IDGUAMI, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GUAMI) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.GUAMI, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.GUAMI, true }, }, { - id: IDPDUSessionResourceSetupListCxtReq, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceSetup) + ID: IDPDUSessionResourceSetupListCxtReq, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceSetup) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.PDUSessionResourceSetup == nil { return nil, false } @@ -149,11 +197,11 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ }, }, { - id: IDAllowedNSSAI, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AllowedNSSAI) + ID: IDAllowedNSSAI, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AllowedNSSAI) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.AllowedNSSAI == nil { return nil, false } @@ -162,27 +210,27 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ }, }, { - id: IDUESecurityCapabilities, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UESecurityCapabilities) + ID: IDUESecurityCapabilities, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UESecurityCapabilities) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.UESecurityCapabilities, true }, }, { - id: IDSecurityKey, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SecurityKey) + ID: IDSecurityKey, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SecurityKey) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.SecurityKey, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.SecurityKey, true }, }, { - id: IDTraceActivation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDTraceActivation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var v TraceActivation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -190,7 +238,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return nil }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.TraceActivation == nil { return nil, false } @@ -198,12 +246,13 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.TraceActivation, true }, }, + optionalExtension(IDMobilityRestrictionList, CriticalityIgnore, func(m *InitialContextSetupRequest) **MobilityRestrictionList { return &m.MobilityRestrictionList }), { - id: IDUERadioCapability, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UERadioCapability) + ID: IDUERadioCapability, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UERadioCapability) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.UERadioCapability == nil { return nil, false } @@ -211,12 +260,14 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UERadioCapability, true }, }, + optionalExtension(IDIndexToRFSP, CriticalityIgnore, func(m *InitialContextSetupRequest) **IndexToRFSP { return &m.IndexToRFSP }), + optionalExtension(IDMaskedIMEISV, CriticalityIgnore, func(m *InitialContextSetupRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), { - id: IDNASPDU, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDNASPDU, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var v NASPDU - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -224,7 +275,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return nil }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -232,12 +283,16 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.NASPDU, true }, }, + optionalExtension(IDEmergencyFallbackIndicator, CriticalityReject, func(m *InitialContextSetupRequest) **EmergencyFallbackIndicator { return &m.EmergencyFallbackIndicator }), + optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *InitialContextSetupRequest) **RRCInactiveTransitionReportRequest { + return &m.RRCInactiveTransitionReportRequest + }), { - id: IDUERadioCapabilityForPaging, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDUERadioCapabilityForPaging, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var v UERadioCapabilityForPaging - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -245,7 +300,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return nil }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.UERadioCapabilityForPaging == nil { return nil, false } @@ -253,12 +308,70 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UERadioCapabilityForPaging, true }, }, + optionalExtension(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *InitialContextSetupRequest) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), + optionalExtension(IDLocationReportingRequestType, CriticalityIgnore, func(m *InitialContextSetupRequest) **LocationReportingRequestType { + return &m.LocationReportingRequestType + }), + optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *InitialContextSetupRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *InitialContextSetupRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + optionalExtension(IDIABAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **IABAuthorized { return &m.IABAuthorized }), + optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *InitialContextSetupRequest) **EnhancedCoverageRestriction { + return &m.EnhancedCoverageRestriction + }), + optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *InitialContextSetupRequest) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *InitialContextSetupRequest) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + optionalExtension(IDUEUPCIoTSupport, CriticalityIgnore, func(m *InitialContextSetupRequest) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), + optionalExtension(IDRGLevelWirelineAccessCharacteristics, CriticalityIgnore, func(m *InitialContextSetupRequest) **RGLevelWirelineAccessCharacteristics { + return &m.RGLevelWirelineAccessCharacteristics + }), + listExtension(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *InitialContextSetupRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *InitialContextSetupRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + optionalExtension(IDQMCConfigInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **QMCConfigInfo { return &m.QMCConfigInfo }), + optionalExtension(IDTargetNSSAIInformation, CriticalityIgnore, func(m *InitialContextSetupRequest) **TargetNSSAIInformation { return &m.TargetNSSAIInformation }), + listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *InitialContextSetupRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), + optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.FiveGProSeUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), + optionalExtension(IDNetworkControlledRepeaterAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NetworkControlledRepeaterAuthorized { + return &m.NetworkControlledRepeaterAuthorized + }), + optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *InitialContextSetupRequest) **AerialUEsubscriptionInformation { + return &m.AerialUEsubscriptionInformation + }), + optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *InitialContextSetupRequest) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **SLPositioningRangingServiceInfo { + return &m.SLPositioningRangingServiceInfo + }), + optionalExtension(IDExtendedOldAMF, CriticalityIgnore, func(m *InitialContextSetupRequest) **ExtendedAMFName { return &m.ExtendedOldAMF }), { - id: IDAMFUENGAPID2, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID2, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -266,7 +379,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return nil }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.AMFUENGAPID2 == nil { return nil, false } @@ -300,6 +413,10 @@ func ParseInitialContextSetupRequest(value []byte) (*InitialContextSetupRequest, return parseMessageBody[InitialContextSetupRequest](ProcInitialContextSetup, TriggeringInitiatingMessage, initialContextSetupRequestIEs, value) } +func DecodeInitialContextSetupRequest(value []byte) (*InitialContextSetupRequest, error) { + return decodeMessageBody[InitialContextSetupRequest](ProcInitialContextSetup, initialContextSetupRequestIEs, value) +} + // TS 38.413 §9.2.2.2. type InitialContextSetupResponse struct { AMFUENGAPID *AMFUENGAPID @@ -313,11 +430,11 @@ type InitialContextSetupResponse struct { var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -325,7 +442,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -334,11 +451,11 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -346,7 +463,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -355,11 +472,11 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ }, }, { - id: IDPDUSessionResourceSetupListCxtRes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceSetup) + ID: IDPDUSessionResourceSetupListCxtRes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceSetup) }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.PDUSessionResourceSetup == nil { return nil, false } @@ -368,11 +485,11 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ }, }, { - id: IDPDUSessionResourceFailedToSetupListCxtRes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceFailed) + ID: IDPDUSessionResourceFailedToSetupListCxtRes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceFailed) }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.PDUSessionResourceFailed == nil { return nil, false } @@ -381,11 +498,11 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -393,7 +510,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -427,6 +544,10 @@ func ParseInitialContextSetupResponse(value []byte) (*InitialContextSetupRespons return parseMessageBody[InitialContextSetupResponse](ProcInitialContextSetup, TriggeringSuccessfulOutcome, initialContextSetupResponseIEs, value) } +func DecodeInitialContextSetupResponse(value []byte) (*InitialContextSetupResponse, error) { + return decodeMessageBody[InitialContextSetupResponse](ProcInitialContextSetup, initialContextSetupResponseIEs, value) +} + // TS 38.413 §9.2.2.3. type InitialContextSetupFailure struct { AMFUENGAPID *AMFUENGAPID @@ -440,11 +561,11 @@ type InitialContextSetupFailure struct { var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -452,7 +573,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -461,11 +582,11 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -473,7 +594,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -482,11 +603,11 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ }, }, { - id: IDPDUSessionResourceFailedToSetupListCxtFail, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceFailed) + ID: IDPDUSessionResourceFailedToSetupListCxtFail, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceFailed) }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.PDUSessionResourceFailed == nil { return nil, false } @@ -495,11 +616,11 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -507,7 +628,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -516,11 +637,11 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -528,7 +649,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -561,3 +682,7 @@ func (m *InitialContextSetupFailure) Marshal() ([]byte, error) { func ParseInitialContextSetupFailure(value []byte) (*InitialContextSetupFailure, error) { return parseMessageBody[InitialContextSetupFailure](ProcInitialContextSetup, TriggeringUnsuccessfulOutcome, initialContextSetupFailureIEs, value) } + +func DecodeInitialContextSetupFailure(value []byte) (*InitialContextSetupFailure, error) { + return decodeMessageBody[InitialContextSetupFailure](ProcInitialContextSetup, initialContextSetupFailureIEs, value) +} diff --git a/ngap/initial_context_setup_test.go b/ngap/initial_context_setup_test.go index efd1fb39a1..9861901ab7 100644 --- a/ngap/initial_context_setup_test.go +++ b/ngap/initial_context_setup_test.go @@ -7,6 +7,8 @@ import ( "errors" "slices" "testing" + + "github.com/ellanetworks/core/per/ap" ) const ( @@ -36,10 +38,10 @@ func goldSecurityKey() SecurityKey { func goldUESecurityCapabilities() UESecurityCapabilities { return UESecurityCapabilities{ - NREncryptionAlgorithms: 0x8000, - NRIntegrityProtectionAlgorithms: 0x4000, - EUTRAEncryptionAlgorithms: 0x2000, - EUTRAIntegrityProtectionAlgorithms: 0x1000, + NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), + NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x4000), + EUTRAEncryptionAlgorithms: SecurityAlgorithmsFrom(0x2000), + EUTRAIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x1000), } } @@ -107,7 +109,7 @@ func TestInitialContextSetupGoldenEncodings(t *testing.T) { PDUSessionResourceFailed: PDUSessionResourceFailedToSetupListCxtFail{{ PDUSessionID: 5, Transfer: TransferContainer{0xee}, }}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), }, goldenInitialContextSetupFailure, }, @@ -195,7 +197,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { }) t.Run("Failure", func(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified} + cause := CauseRadioNetworkUnspecified.Cause() in := &InitialContextSetupFailure{ AMFUENGAPID: Ptr(AMFUENGAPID(7)), RANUENGAPID: Ptr(RANUENGAPID(9)), @@ -212,7 +214,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { } out, err := ParseInitialContextSetupFailure(uo.Value) - if err != nil || deref(out.Cause) != cause { + if err != nil || !deref(out.Cause).Equal(cause) { t.Fatalf("got %+v err %v", out, err) } }) @@ -255,11 +257,11 @@ func TestInitialContextSetupRequestAMBRCondition(t *testing.T) { // (§10.3.5); the AMF cannot set up a context without them. func TestInitialContextSetupRequestMissingRejectIE(t *testing.T) { full := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, - ieField{id: IDGUAMI, crit: CriticalityReject, raw: ieRaw(t, Ptr(goldContextGUAMI()))}, - ieField{id: IDUESecurityCapabilities, crit: CriticalityReject, raw: ieRaw(t, Ptr(goldUESecurityCapabilities()))}, - ieField{id: IDSecurityKey, crit: CriticalityReject, raw: ieRaw(t, Ptr(goldSecurityKey()))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDGUAMI, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(goldContextGUAMI())))}, + ieField{ID: IDUESecurityCapabilities, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(goldUESecurityCapabilities())))}, + ieField{ID: IDSecurityKey, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(goldSecurityKey())))}, ) // Without the Allowed NSSAI the request is incomplete: it is mandatory and @@ -318,7 +320,7 @@ func initialContextSetupRequestWireCases(t *testing.T) []wireCase { return []wireCase{{ name: "InitialContextSetupRequestAMFUENGAPID2AfterUnmodeledIEs", - pdu: insertRawIEs(t, marshalT(t, m), 7, rawMaskedIMEISV(), rawRedirectionVoiceFallback()), + pdu: insertRawIEs(t, marshalT(t, m), 7, rawUnknownIE(40000, 0x86, 0x65, 0x07, 0x04, 0x00, 0xff, 0xff, 0x01), rawUnknownIE(40001, 0x00)), parse: func(v []byte) (any, error) { return ParseInitialContextSetupRequest(v) }, check: func(t *testing.T, a any) { t.Helper() @@ -332,7 +334,7 @@ func initialContextSetupRequestWireCases(t *testing.T) []wireCase { } func TestInitialContextSetupRequestAMFUENGAPID2SetAfterParseFollowsUnmodeledIEs(t *testing.T) { - pdu := insertRawIEs(t, marshalT(t, goldInitialContextSetupRequestTraceActivation()), 7, rawMaskedIMEISV(), rawRedirectionVoiceFallback()) + pdu := insertRawIEs(t, marshalT(t, goldInitialContextSetupRequestTraceActivation()), 7, rawUnknownIE(40000, 0x86, 0x65, 0x07, 0x04, 0x00, 0xff, 0xff, 0x01), rawUnknownIE(40001, 0x00)) p, err := Unmarshal(pdu) if err != nil { @@ -347,7 +349,7 @@ func TestInitialContextSetupRequestAMFUENGAPID2SetAfterParseFollowsUnmodeledIEs( m.AMFUENGAPID2 = Ptr(AMFUENGAPID(7)) ids := wireIDs(t, m.encodeBody) - if want := []ProtocolIEID{IDTraceActivation, IDMaskedIMEISV, IDRedirectionVoiceFallback, IDAMFUENGAPID2}; !slices.Equal(ids[len(ids)-4:], want) { + if want := []ProtocolIEID{IDTraceActivation, 40000, 40001, IDAMFUENGAPID2}; !slices.Equal(ids[len(ids)-4:], want) { t.Fatalf("IE order %v, want it to end %v", ids, want) } } diff --git a/ngap/interworking_cause_names_test.go b/ngap/interworking_cause_names_test.go index e2f5b2d3a8..b83c48952a 100644 --- a/ngap/interworking_cause_names_test.go +++ b/ngap/interworking_cause_names_test.go @@ -15,10 +15,10 @@ func TestInterworkingFailureCauseNames(t *testing.T) { cause ngap.Cause want string }{ - {ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkNoRadioResourcesInTargetCell}, "no-radio-resources-available-in-target-cell"}, - {ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported}, "encryption-and-or-integrity-protection-algorithms-not-supported"}, - {ngap.CauseInsufficientUECapabilities, "insufficient-ue-capabilities"}, - {ngap.Cause{Group: ngap.CauseGroupMisc, Value: ngap.CauseMiscOMIntervention}, "om-intervention"}, + {ngap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(), "no-radio-resources-available-in-target-cell"}, + {ngap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause(), "encryption-and-or-integrity-protection-algorithms-not-supported"}, + {ngap.CauseRadioNetworkInsufficientUECapabilities.Cause(), "insufficient-ue-capabilities"}, + {ngap.CauseMiscOMIntervention.Cause(), "om-intervention"}, } { if got := tc.cause.String(); !strings.Contains(got, tc.want) { t.Errorf("cause %+v = %q, want it to name %q", tc.cause, got, tc.want) diff --git a/ngap/location_report.go b/ngap/location_report.go index 6ffd257090..7fdb5bd276 100644 --- a/ngap/location_report.go +++ b/ngap/location_report.go @@ -4,9 +4,8 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // maxnoofAoI bounds the areas of interest one request may name. @@ -30,8 +29,9 @@ const ( EventTypeStopChangeOfServeCell EventTypeStopUEPresenceInAreaOfInterest EventTypeCancelLocationReportingForTheUE - - eventTypeRootCount = 6 + EventTypeChangeOfServingCellAndUEPresenceInAreaOfInterest + EventTypeReportAerialUEFlightInformation + EventTypeCancelAerialUEFlightInformationReporting ) // ReportArea ::= ENUMERATED { cell, ... }, likewise inline in TS 38.413 @@ -41,8 +41,6 @@ type ReportArea uint8 const ( ReportAreaCell ReportArea = iota - - reportAreaRootCount = 1 ) // LocationReportingReferenceID ::= INTEGER (1..64, ...) — TS 38.413 §9.3.1.76. @@ -53,129 +51,233 @@ func (id LocationReportingReferenceID) MarshalPER(w *per.Writer, enc per.Encodin } func (id *LocationReportingReferenceID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 1, maxnoofAoI, "LocationReportingReferenceID") + v, err := decodeExtensibleInt[LocationReportingReferenceID](r, enc, 1, maxnoofAoI) if err != nil { return err } - *id = LocationReportingReferenceID(v) + *id = v return nil } +func (v LocationReportingReferenceID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return outsideRoot(int64(v), 1, maxnoofAoI) +} + // LocationReportingRequestType ::= SEQUENCE { eventType, reportArea, // areaOfInterestList OPTIONAL, locationReportingReferenceIDToBeCancelled // OPTIONAL, iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.1.65. // TS 36.413 §9.2.1.34 names the same shape RequestType and has neither optional // field. -// -// The codec is hand-written because areaOfInterestList is deliberately not -// modelled: this AMF never asks for area-of-interest reporting, so a peer has -// no reason to name one back. Its preamble bit is still read, and a request -// that sets it is refused rather than silently misread. type LocationReportingRequestType struct { - EventType EventType - ReportArea ReportArea - LocationReportingReferenceIDToBeCancelled *LocationReportingReferenceID -} - -func (t LocationReportingRequestType) MarshalPER(w *per.Writer, enc per.Encoding) error { - // ifEventTypeisStopUEPresinAoI: the ASN.1 makes - // locationReportingReferenceIDToBeCancelled present exactly when Event Type - // is "stop UE presence in the area of interest" (§9.3.1.65). The message-level - // tables enforce their conditions in ieSpec; this one lives inside a SEQUENCE, - // so it is enforced here. - cancelling := t.EventType == EventTypeStopUEPresenceInAreaOfInterest - if cancelling != (t.LocationReportingReferenceIDToBeCancelled != nil) { - return fmt.Errorf( - "ngap: LocationReportingRequestType: event type %d %s a location reporting reference id to cancel", - t.EventType, map[bool]string{true: "requires", false: "must not carry"}[cancelling]) - } + EventType EventType + ReportArea ReportArea + AreaOfInterestList AreaOfInterestList `per:",optional"` + LocationReportingReferenceIDToBeCancelled *LocationReportingReferenceID `per:",optional"` + LocationReportingAdditionalInfo *LocationReportingAdditionalInfo `per:",extie:IDLocationReportingAdditionalInfo,crit:ignore"` + AdditionalCancelledlocationReportingReferenceIDList AdditionalCancelledlocationReportingReferenceIDList `per:",extie:IDAdditionalCancelledlocationReportingReferenceIDList,crit:reject"` + AerialUEFlightInformationReportingControlList AerialUEFlightInformationReportingControlList `per:",extie:IDAerialUEFlightInformationReportingControlList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} - w.WriteBit(false) - // areaOfInterestList, which this AMF never sends. - w.WriteBit(false) - w.WriteBit(t.LocationReportingReferenceIDToBeCancelled != nil) - // iE-Extensions. - w.WriteBit(false) +const ( + maxnoofAoIMinusOne = 63 + maxnoofTAIinAoI = 16 + maxnoofCellinAoI = 256 + maxnoofRANNodeinAoI = 64 + maxnoofFlightInfoReportControl = 64 +) - if err := encodeRootEnumerated(w, enc, eventTypeRootCount, int64(t.EventType), "EventType"); err != nil { - return err - } +type AreaOfInterestItem struct { + AreaOfInterest AreaOfInterest + LocationReportingReferenceID LocationReportingReferenceID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AreaOfInterestList []AreaOfInterestItem + +func (l AreaOfInterestList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofAoI, []AreaOfInterestItem(l)) +} - if err := encodeRootEnumerated(w, enc, reportAreaRootCount, int64(t.ReportArea), "ReportArea"); err != nil { +func (l *AreaOfInterestList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AreaOfInterestItem](r, enc, 1, maxnoofAoI) + if err != nil { return err } - if t.LocationReportingReferenceIDToBeCancelled != nil { - return t.LocationReportingReferenceIDToBeCancelled.MarshalPER(w, enc) - } + *l = items return nil } -func (t *LocationReportingRequestType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extPresent, err := r.ReadBit() - if err != nil { - return err - } +type AreaOfInterest struct { + AreaOfInterestTAIList AreaOfInterestTAIList `per:",optional"` + AreaOfInterestCellList AreaOfInterestCellList `per:",optional"` + AreaOfInterestRANNodeList AreaOfInterestRANNodeList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} - haveAreaOfInterest, err := r.ReadBit() - if err != nil { - return err - } +type AreaOfInterestTAIItem struct { + TAI TAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AreaOfInterestTAIList []AreaOfInterestTAIItem - haveReferenceID, err := r.ReadBit() +func (l AreaOfInterestTAIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIinAoI, []AreaOfInterestTAIItem(l)) +} + +func (l *AreaOfInterestTAIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AreaOfInterestTAIItem](r, enc, 1, maxnoofTAIinAoI) if err != nil { return err } - haveExtensions, err := r.ReadBit() + *l = items + + return nil +} + +type AreaOfInterestCellItem struct { + NGRANCGI NGRANCGI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AreaOfInterestCellList []AreaOfInterestCellItem + +func (l AreaOfInterestCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellinAoI, []AreaOfInterestCellItem(l)) +} + +func (l *AreaOfInterestCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AreaOfInterestCellItem](r, enc, 1, maxnoofCellinAoI) if err != nil { return err } - eventType, err := decodeRootEnumerated(r, enc, eventTypeRootCount, "EventType") + *l = items + + return nil +} + +type AreaOfInterestRANNodeItem struct { + GlobalRANNodeID GlobalRANNodeID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AreaOfInterestRANNodeList []AreaOfInterestRANNodeItem + +func (l AreaOfInterestRANNodeList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofRANNodeinAoI, []AreaOfInterestRANNodeItem(l)) +} + +func (l *AreaOfInterestRANNodeList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AreaOfInterestRANNodeItem](r, enc, 1, maxnoofRANNodeinAoI) if err != nil { return err } - t.EventType = EventType(eventType) + *l = items + + return nil +} + +type LocationReportingAdditionalInfo uint8 + +const ( + LocationReportingAdditionalInfoIncludePSCell LocationReportingAdditionalInfo = iota +) + +type AdditionalCancelledlocationReportingReferenceIDItem struct { + LocationReportingReferenceIDToBeCancelled LocationReportingReferenceID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AdditionalCancelledlocationReportingReferenceIDList []AdditionalCancelledlocationReportingReferenceIDItem - reportArea, err := decodeRootEnumerated(r, enc, reportAreaRootCount, "ReportArea") +func (l AdditionalCancelledlocationReportingReferenceIDList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofAoIMinusOne, []AdditionalCancelledlocationReportingReferenceIDItem(l)) +} + +func (l *AdditionalCancelledlocationReportingReferenceIDList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AdditionalCancelledlocationReportingReferenceIDItem](r, enc, 1, maxnoofAoIMinusOne) if err != nil { return err } - t.ReportArea = ReportArea(reportArea) + *l = items - if haveAreaOfInterest { - return fmt.Errorf("%w: LocationReportingRequestType areaOfInterestList", errNotComprehended) - } + return nil +} - if haveReferenceID { - var id LocationReportingReferenceID +type AerialUEFlightInformationReportingControlItem struct { + AerialUEFlightInformationReportingControl AerialUEFlightInformationReportingControl + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} - if err := id.UnmarshalPER(r, enc); err != nil { - return err - } +type AerialUEFlightInformationReportingControlList []AerialUEFlightInformationReportingControlItem - t.LocationReportingReferenceIDToBeCancelled = &id - } +func (l AerialUEFlightInformationReportingControlList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofFlightInfoReportControl, []AerialUEFlightInformationReportingControlItem(l)) +} - if haveExtensions { - if err := skipSequenceExtensionsPER(r, enc, true, false); err != nil { - return err - } +func (l *AerialUEFlightInformationReportingControlList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[AerialUEFlightInformationReportingControlItem](r, enc, 1, maxnoofFlightInfoReportControl) + if err != nil { + return err } - if extPresent { - return skipSequenceExtensionsPER(r, enc, false, true) - } + *l = items return nil } +type AerialUEFlightInformationReportingControl struct { + HigherAltitudeThreshold Altitude `per:",range:-420..10000,..."` + LowerAltitudeThreshold Altitude `per:",range:-420..10000,..."` + AerialUEReportPeriodicity *AerialUEReportingPeriodicity `per:",optional"` + AreaID AreaID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AerialUEReportingPeriodicity uint8 + +const ( + AerialUEReportingPeriodicityMs120 AerialUEReportingPeriodicity = iota + AerialUEReportingPeriodicityMs240 + AerialUEReportingPeriodicityMs480 + AerialUEReportingPeriodicityMs640 + AerialUEReportingPeriodicityMs1024 + AerialUEReportingPeriodicityMs2048 + AerialUEReportingPeriodicityMs5120 + AerialUEReportingPeriodicityMs10240 + AerialUEReportingPeriodicityMs20480 + AerialUEReportingPeriodicityMs40960 + AerialUEReportingPeriodicityMin1 + AerialUEReportingPeriodicityMin6 + AerialUEReportingPeriodicityMin12 + AerialUEReportingPeriodicityMin30 +) + +type AreaID struct { + TAI *TAI `per:",choice:0"` + GlobalRANNodeID *GlobalRANNodeID `per:",choice:1"` + NRCGI *NRCGI `per:",choice:2"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` +} + // UEPresence ::= ENUMERATED { in, out, unknown, ... }, an inline type of the // UE Presence in Area of Interest List IE (TS 38.413 §9.3.1.67). type UEPresence uint8 @@ -189,10 +291,10 @@ const ( // UEPresenceInAreaOfInterestItem ::= SEQUENCE { locationReportingReferenceID, // uEPresence, iE-Extensions OPTIONAL } (extensible). type UEPresenceInAreaOfInterestItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` LocationReportingReferenceID LocationReportingReferenceID - UEPresence UEPresence `per:"ENUMERATED,range:0..2,..."` - _ ieExtensions `per:",skip"` + UEPresence UEPresence + iEExtensions extensionMeta `per:",exttable"` } // UEPresenceInAreaOfInterestList ::= SEQUENCE (SIZE(1..maxnoofAoI)) OF @@ -215,25 +317,25 @@ type LocationReport struct { var locationReportIEs = []ieSpec[LocationReport]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDUserLocationInformation, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { var v UserLocationInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -241,7 +343,7 @@ var locationReportIEs = []ieSpec[LocationReport]{ return nil }, - encode: func(m *LocationReport) (per.Marshaler, bool) { + Encode: func(m *LocationReport) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -250,11 +352,11 @@ var locationReportIEs = []ieSpec[LocationReport]{ }, }, { - id: IDUEPresenceInAreaOfInterestList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UEPresenceInAreaOfInterestList) + ID: IDUEPresenceInAreaOfInterestList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UEPresenceInAreaOfInterestList) }, - encode: func(m *LocationReport) (per.Marshaler, bool) { + Encode: func(m *LocationReport) (per.Marshaler, bool) { if m.UEPresenceInAreaOfInterestList == nil { return nil, false } @@ -263,11 +365,11 @@ var locationReportIEs = []ieSpec[LocationReport]{ }, }, { - id: IDLocationReportingRequestType, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { + ID: IDLocationReportingRequestType, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { var v LocationReportingRequestType - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -275,7 +377,7 @@ var locationReportIEs = []ieSpec[LocationReport]{ return nil }, - encode: func(m *LocationReport) (per.Marshaler, bool) { + Encode: func(m *LocationReport) (per.Marshaler, bool) { if m.LocationReportingRequestType == nil { return nil, false } @@ -309,6 +411,10 @@ func ParseLocationReport(value []byte) (*LocationReport, error) { return parseMessageBody[LocationReport](ProcLocationReport, TriggeringInitiatingMessage, locationReportIEs, value) } +func DecodeLocationReport(value []byte) (*LocationReport, error) { + return decodeMessageBody[LocationReport](ProcLocationReport, locationReportIEs, value) +} + // TS 38.413 §9.2.11.1. The AMF asks the NG-RAN node to start, change or stop // reporting the UE's location. TS 36.413 §9.1.12.1 defines the same procedure // with the same three IEs, but this core only drives it from the 5G side. @@ -322,25 +428,25 @@ type LocationReportingControl struct { var locationReportingControlIEs = []ieSpec[LocationReportingControl]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *LocationReportingControl, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *LocationReportingControl, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *LocationReportingControl) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *LocationReportingControl) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *LocationReportingControl, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *LocationReportingControl, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *LocationReportingControl) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *LocationReportingControl) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDLocationReportingRequestType, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *LocationReportingControl, raw []byte, enc per.Encoding) error { + ID: IDLocationReportingRequestType, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *LocationReportingControl, r *per.Reader, enc per.Encoding) error { var v LocationReportingRequestType - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -348,7 +454,7 @@ var locationReportingControlIEs = []ieSpec[LocationReportingControl]{ return nil }, - encode: func(m *LocationReportingControl) (per.Marshaler, bool) { + Encode: func(m *LocationReportingControl) (per.Marshaler, bool) { if m.LocationReportingRequestType == nil { return nil, false } @@ -381,3 +487,7 @@ func (m *LocationReportingControl) Marshal() ([]byte, error) { func ParseLocationReportingControl(value []byte) (*LocationReportingControl, error) { return parseMessageBody[LocationReportingControl](ProcLocationReportingControl, TriggeringInitiatingMessage, locationReportingControlIEs, value) } + +func DecodeLocationReportingControl(value []byte) (*LocationReportingControl, error) { + return decodeMessageBody[LocationReportingControl](ProcLocationReportingControl, locationReportingControlIEs, value) +} diff --git a/ngap/location_report_test.go b/ngap/location_report_test.go index 3af62f56aa..d3b8dfd93b 100644 --- a/ngap/location_report_test.go +++ b/ngap/location_report_test.go @@ -5,19 +5,13 @@ package ngap import ( "encoding/hex" - "errors" "testing" "github.com/ellanetworks/core/per" ) func locationReportULI() UserLocationInformation { - return UserLocationInformation{ - Kind: UserLocationNR, - PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, - CellIdentity: 1, - TAI: TAI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, TAC: 1}, - } + return UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, NRCellIdentity: NRCellIdentity(1)}, TAI: TAI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, TAC: 1}}} } const goldenLocationReport = "0012402f000005000a000200010055000200020079400f4002f839000000001002" + @@ -58,7 +52,7 @@ func TestLocationReportGolden(t *testing.T) { t.Fatal(err) } - if out.UserLocationInformation == nil || out.UserLocationInformation.TAI.TAC != 1 || + if out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || out.UserLocationInformation.NR.TAI.TAC != 1 || out.LocationReportingRequestType == nil || out.LocationReportingRequestType.EventType != EventTypeDirect || len(out.UEPresenceInAreaOfInterestList) != 1 || out.UEPresenceInAreaOfInterestList[0].LocationReportingReferenceID != 3 || @@ -106,8 +100,8 @@ func TestLocationReportingControlGolden(t *testing.T) { // gives its own three, and the two agree only on the first two. A test that // pins the count is what stops a value being copied across. func TestEventTypeRootCountMatchesSpec(t *testing.T) { - if eventTypeRootCount != 6 { - t.Errorf("root count is %d, TS 38.413 §9.3.1.65 defines six members before the extension marker", eventTypeRootCount) + if int64(len(enumEventType.Root)) != 6 { + t.Errorf("root count is %d, TS 38.413 §9.3.1.65 defines six members before the extension marker", int64(len(enumEventType.Root))) } if EventTypeStopChangeOfServeCell != 3 { @@ -116,35 +110,33 @@ func TestEventTypeRootCountMatchesSpec(t *testing.T) { } } -// This AMF never asks for area-of-interest reporting, so a peer naming one back -// is refused rather than misread. The preamble bit must still be consumed, or -// every field after it would be read at the wrong offset. -func TestLocationReportingRequestTypeRefusesAreaOfInterest(t *testing.T) { - w := per.NewWriter() - w.WriteBit(false) // no extension - w.WriteBit(true) // areaOfInterestList present - w.WriteBit(false) // no locationReportingReferenceIDToBeCancelled - w.WriteBit(false) // no iE-Extensions - - if err := encodeRootEnumerated(w, per.Aligned, eventTypeRootCount, int64(EventTypeUEPresenceInAreaOfInterest), "EventType"); err != nil { - t.Fatal(err) +func TestLocationReportingRequestTypeAreaOfInterestRoundTrip(t *testing.T) { + tai := TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 3} + in := LocationReportingRequestType{ + EventType: EventTypeUEPresenceInAreaOfInterest, + ReportArea: ReportAreaCell, + AreaOfInterestList: AreaOfInterestList{{ + AreaOfInterest: AreaOfInterest{ + AreaOfInterestTAIList: AreaOfInterestTAIList{{TAI: tai}}, + AreaOfInterestRANNodeList: AreaOfInterestRANNodeList{{GlobalRANNodeID: NewGlobalGNBID(tai.PLMNIdentity, 0x1234, 22)}}, + }, + LocationReportingReferenceID: 5, + }}, + AdditionalCancelledlocationReportingReferenceIDList: AdditionalCancelledlocationReportingReferenceIDList{{LocationReportingReferenceIDToBeCancelled: 6}}, } - if err := encodeRootEnumerated(w, per.Aligned, reportAreaRootCount, int64(ReportAreaCell), "ReportArea"); err != nil { + w := per.NewWriter() + if err := in.MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } - w.AlignToByte() - - var v LocationReportingRequestType - - err := v.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned) - if err == nil { - t.Fatal("an areaOfInterestList decoded") + out, err := unmarshalPERValue[LocationReportingRequestType](perBytes(w)) + if err != nil { + t.Fatal(err) } - if !errors.Is(err, errNotComprehended) { - t.Errorf("err = %v, want errNotComprehended so criticality decides", err) + if !out.Equal(in) { + t.Fatalf("round trip = %+v, want %+v", out, in) } } @@ -176,32 +168,3 @@ func TestLocationReportingRequestTypeReferenceIDRoundTrip(t *testing.T) { t.Fatalf("round trip %+v", out) } } - -// The ASN.1 makes locationReportingReferenceIDToBeCancelled present exactly when -// Event Type is "stop UE presence in the area of interest" -// (ifEventTypeisStopUEPresinAoI, TS 38.413 §9.3.1.65). Both halves of the -// condition are enforced: a conforming gNB answers a violation with LOCATION -// REPORTING FAILURE INDICATION (§8.12.1.3). -func TestLocationReportingRequestTypeConditionalReferenceID(t *testing.T) { - id := LocationReportingReferenceID(7) - - tests := []struct { - name string - in LocationReportingRequestType - wantErr bool - }{ - {"direct without a reference id", LocationReportingRequestType{EventType: EventTypeDirect}, false}, - {"direct with a reference id", LocationReportingRequestType{EventType: EventTypeDirect, LocationReportingReferenceIDToBeCancelled: &id}, true}, - {"stop without a reference id", LocationReportingRequestType{EventType: EventTypeStopUEPresenceInAreaOfInterest}, true}, - {"stop with a reference id", LocationReportingRequestType{EventType: EventTypeStopUEPresenceInAreaOfInterest, LocationReportingReferenceIDToBeCancelled: &id}, false}, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.in.MarshalPER(per.NewWriter(), per.Aligned) - if (err != nil) != tt.wantErr { - t.Fatalf("err = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} diff --git a/ngap/names_test.go b/ngap/names_test.go index 50136331d1..191dd17ab1 100644 --- a/ngap/names_test.go +++ b/ngap/names_test.go @@ -88,7 +88,7 @@ func TestAbstractSyntaxErrorMessage(t *testing.T) { err := &AbstractSyntaxError{ Procedure: ProcNGSetup, Trigger: TriggeringInitiatingMessage, - Cause: Cause{Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject}, + Cause: CauseProtocolAbstractSyntaxErrorReject.Cause(), IEs: []CriticalityDiagnosticsIEItem{ {IEID: IDGlobalRANNodeID, IECriticality: CriticalityReject, TypeOfError: TypeOfErrorMissing}, {IEID: IDSupportedTAList, IECriticality: CriticalityReject, TypeOfError: TypeOfErrorNotUnderstood}, diff --git a/ngap/nas_non_delivery.go b/ngap/nas_non_delivery.go index afe53fb22e..1a28ab60c5 100644 --- a/ngap/nas_non_delivery.go +++ b/ngap/nas_non_delivery.go @@ -19,25 +19,25 @@ type NASNonDeliveryIndication struct { var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -46,11 +46,11 @@ var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -58,7 +58,7 @@ var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ return nil }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -91,3 +91,7 @@ func (m *NASNonDeliveryIndication) encodeBody(w *per.Writer, enc per.Encoding) e func ParseNASNonDeliveryIndication(value []byte) (*NASNonDeliveryIndication, error) { return parseMessageBody[NASNonDeliveryIndication](ProcNASNonDeliveryIndication, TriggeringInitiatingMessage, nASNonDeliveryIndicationIEs, value) } + +func DecodeNASNonDeliveryIndication(value []byte) (*NASNonDeliveryIndication, error) { + return decodeMessageBody[NASNonDeliveryIndication](ProcNASNonDeliveryIndication, nASNonDeliveryIndicationIEs, value) +} diff --git a/ngap/nas_non_delivery_test.go b/ngap/nas_non_delivery_test.go index 05cf0dacc2..07482106e7 100644 --- a/ngap/nas_non_delivery_test.go +++ b/ngap/nas_non_delivery_test.go @@ -20,7 +20,7 @@ func TestNASNonDeliveryIndicationRoundTrip(t *testing.T) { AMFUENGAPID: 42, RANUENGAPID: 1, NASPDU: NASPDU{0x7E, 0x00, 0x42}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkInconsistentRemoteUEID}), + Cause: Ptr(CauseRadioNetworkInconsistentRemoteUEID.Cause()), } b, err := in.Marshal() @@ -44,7 +44,7 @@ func TestNASNonDeliveryIndicationRoundTrip(t *testing.T) { } if out.AMFUENGAPID != in.AMFUENGAPID || out.RANUENGAPID != in.RANUENGAPID || - deref(out.Cause) != deref(in.Cause) || !bytes.Equal(out.NASPDU, in.NASPDU) { + !deref(out.Cause).Equal(deref(in.Cause)) || !bytes.Equal(out.NASPDU, in.NASPDU) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } } @@ -59,7 +59,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { "minimal", &NASNonDeliveryIndication{ AMFUENGAPID: 1, RANUENGAPID: 1, NASPDU: NASPDU{0x7e, 0x00}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), }, goldenNASNonDelivery, }, @@ -70,7 +70,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { &NASNonDeliveryIndication{ AMFUENGAPID: 0xffffffffff, RANUENGAPID: 0xffffffff, NASPDU: NASPDU{0x7e, 0x01, 0x02, 0x03, 0x04}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkInconsistentRemoteUEID}), + Cause: Ptr(CauseRadioNetworkInconsistentRemoteUEID.Cause()), }, goldenNASNonDeliveryWideIDs, }, @@ -78,7 +78,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { "nas cause group", &NASNonDeliveryIndication{ AMFUENGAPID: 42, RANUENGAPID: 7, NASPDU: NASPDU{0x7e}, - Cause: Ptr(Cause{Group: CauseGroupNAS, Value: CauseNASDeregister}), + Cause: Ptr(CauseNASDeregister.Cause()), }, goldenNASNonDeliveryNASCause, }, @@ -106,7 +106,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { } if out.AMFUENGAPID != tt.msg.AMFUENGAPID || out.RANUENGAPID != tt.msg.RANUENGAPID || - deref(out.Cause) != deref(tt.msg.Cause) || !bytes.Equal(out.NASPDU, tt.msg.NASPDU) { + !deref(out.Cause).Equal(deref(tt.msg.Cause)) || !bytes.Equal(out.NASPDU, tt.msg.NASPDU) { t.Fatalf("decode mismatch:\n got %+v\n want %+v", out, tt.msg) } }) @@ -121,15 +121,15 @@ func TestNASNonDeliveryIndicationMissingIEs(t *testing.T) { } if _, err := ParseNASNonDeliveryIndication(container(t, - ieField{id: IDNASPDU, crit: CriticalityIgnore, val: NASPDU{0x7e}}, - ieField{id: IDCause, crit: CriticalityIgnore, val: Cause{Group: CauseGroupNAS, Value: CauseNASDeregister}}, + ieField{ID: IDNASPDU, Criticality: CriticalityIgnore, Value: NASPDU{0x7e}}, + ieField{ID: IDCause, Criticality: CriticalityIgnore, Value: Ptr(CauseNASDeregister.Cause())}, )); err == nil { t.Error("decoded a message with neither UE id, want it rejected") } msg, err := ParseNASNonDeliveryIndication(container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: AMFUENGAPID(42)}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(7)}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: AMFUENGAPID(42)}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(7)}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -142,7 +142,7 @@ func TestNASNonDeliveryIndicationMissingIEs(t *testing.T) { var missing int for _, ie := range msg.Diagnostics().IEs { - if ie.TypeOfError == TypeOfErrorMissing && (ie.ID == IDNASPDU || ie.ID == IDCause) { + if typeOfError(ie) == TypeOfErrorMissing && (ie.ID == IDNASPDU || ie.ID == IDCause) { missing++ } } diff --git a/ngap/nas_transport.go b/ngap/nas_transport.go index cb8a130c70..6fd8c557c4 100644 --- a/ngap/nas_transport.go +++ b/ngap/nas_transport.go @@ -22,31 +22,45 @@ type InitialUEMessage struct { // it over the radio interface, and the AMF Set ID only on a message it has // rerouted, which the AMF acts on per TS 23.502. The AMF Set ID is not the // counterpart of S1AP's GUMMEI, which marks an eNB that does not run NNSF. - FiveGSTMSI *FiveGSTMSI - AMFSetID *AMFSetID - UEContextRequest *UEContextRequest - AllowedNSSAI AllowedNSSAI - GUAMI *GUAMI - GUAMIType *GUAMIType - RequestedNSSAI RequestedNSSAI + FiveGSTMSI *FiveGSTMSI + AMFSetID *AMFSetID + UEContextRequest *UEContextRequest + AllowedNSSAI AllowedNSSAI + GUAMI *GUAMI + GUAMIType *GUAMIType + RequestedNSSAI RequestedNSSAI + SourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute + SelectedPLMNIdentity *PLMNIdentity + IABNodeIndication *IABNodeIndication + CEmodeBSupportIndicator *CEmodeBSupportIndicator + LTEMIndication *LTEMIndication + EDTSession *EDTSession + AuthenticatedIndication *AuthenticatedIndication + NPNAccessInformation *NPNAccessInformation + RedCapIndication *RedCapIndication + SelectedNID *NID + MobileIABNodeIndication *MobileIABNodeIndication + PartiallyAllowedNSSAI PartiallyAllowedNSSAI + ERedCapIndication *ERedCapIndication + AUN3DeviceAccessInfo *AUN3DeviceAccessInfo messageMeta } var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -55,18 +69,18 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDUserLocationInformation, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UserLocationInformation) + ID: IDUserLocationInformation, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UserLocationInformation) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.UserLocationInformation, true }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.UserLocationInformation, true }, }, { - id: IDRRCEstablishmentCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDRRCEstablishmentCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v RRCEstablishmentCause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -74,7 +88,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.RRCEstablishmentCause == nil { return nil, false } @@ -83,11 +97,11 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDFiveGSTMSI, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDFiveGSTMSI, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v FiveGSTMSI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -95,7 +109,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.FiveGSTMSI == nil { return nil, false } @@ -104,11 +118,11 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDAMFSetID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDAMFSetID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v AMFSetID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -116,7 +130,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.AMFSetID == nil { return nil, false } @@ -125,11 +139,11 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDUEContextRequest, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDUEContextRequest, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v UEContextRequest - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -137,7 +151,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.UEContextRequest == nil { return nil, false } @@ -148,11 +162,11 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ { // Modeled but not acted on: the IE is reject, so not comprehending it // would reject an otherwise valid INITIAL UE MESSAGE (§10.3.4.2). - id: IDAllowedNSSAI, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AllowedNSSAI) + ID: IDAllowedNSSAI, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AllowedNSSAI) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.AllowedNSSAI == nil { return nil, false } @@ -160,12 +174,28 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return m.AllowedNSSAI, true }, }, + optionalExtension(IDSourceToTargetAMFInformationReroute, CriticalityIgnore, func(m *InitialUEMessage) **SourceToTargetAMFInformationReroute { + return &m.SourceToTargetAMFInformationReroute + }), + optionalExtension(IDSelectedPLMNIdentity, CriticalityIgnore, func(m *InitialUEMessage) **PLMNIdentity { return &m.SelectedPLMNIdentity }), + optionalExtension(IDIABNodeIndication, CriticalityReject, func(m *InitialUEMessage) **IABNodeIndication { return &m.IABNodeIndication }), + optionalExtension(IDCEmodeBSupportIndicator, CriticalityReject, func(m *InitialUEMessage) **CEmodeBSupportIndicator { return &m.CEmodeBSupportIndicator }), + optionalExtension(IDLTEMIndication, CriticalityIgnore, func(m *InitialUEMessage) **LTEMIndication { return &m.LTEMIndication }), + optionalExtension(IDEDTSession, CriticalityIgnore, func(m *InitialUEMessage) **EDTSession { return &m.EDTSession }), + optionalExtension(IDAuthenticatedIndication, CriticalityIgnore, func(m *InitialUEMessage) **AuthenticatedIndication { return &m.AuthenticatedIndication }), + optionalExtension(IDNPNAccessInformation, CriticalityReject, func(m *InitialUEMessage) **NPNAccessInformation { return &m.NPNAccessInformation }), + optionalExtension(IDRedCapIndication, CriticalityIgnore, func(m *InitialUEMessage) **RedCapIndication { return &m.RedCapIndication }), + optionalExtension(IDSelectedNID, CriticalityIgnore, func(m *InitialUEMessage) **NID { return &m.SelectedNID }), + optionalExtension(IDMobileIABNodeIndication, CriticalityReject, func(m *InitialUEMessage) **MobileIABNodeIndication { return &m.MobileIABNodeIndication }), + listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *InitialUEMessage) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + optionalExtension(IDERedCapIndication, CriticalityIgnore, func(m *InitialUEMessage) **ERedCapIndication { return &m.ERedCapIndication }), + optionalExtension(IDAUN3DeviceAccessInfo, CriticalityIgnore, func(m *InitialUEMessage) **AUN3DeviceAccessInfo { return &m.AUN3DeviceAccessInfo }), { - id: IDGUAMI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDGUAMI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v GUAMI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -173,7 +203,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.GUAMI == nil { return nil, false } @@ -182,11 +212,11 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDGUAMIType, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDGUAMIType, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v GUAMIType - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -194,7 +224,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.GUAMIType == nil { return nil, false } @@ -203,11 +233,11 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDRequestedNSSAI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RequestedNSSAI) + ID: IDRequestedNSSAI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RequestedNSSAI) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if len(m.RequestedNSSAI) == 0 { return nil, false } @@ -241,6 +271,10 @@ func ParseInitialUEMessage(value []byte) (*InitialUEMessage, error) { return parseMessageBody[InitialUEMessage](ProcInitialUEMessage, TriggeringInitiatingMessage, initialUEMessageIEs, value) } +func DecodeInitialUEMessage(value []byte) (*InitialUEMessage, error) { + return decodeMessageBody[InitialUEMessage](ProcInitialUEMessage, initialUEMessageIEs, value) +} + // TS 38.413 §9.2.5.3. // // S1AP carries the location as two mandatory IEs, E-UTRAN CGI and TAI; NGAP @@ -250,31 +284,47 @@ type UplinkNASTransport struct { RANUENGAPID RANUENGAPID NASPDU NASPDU UserLocationInformation *UserLocationInformation + WAGFIdentityInformation *IdentityInformation + TNGFIdentityInformation *IdentityInformation + TWIFIdentityInformation *IdentityInformation messageMeta } +type IdentityInformation []byte + +func (v IdentityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *IdentityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + *v = b + + return err +} + var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -283,11 +333,11 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ }, }, { - id: IDUserLocationInformation, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { var v UserLocationInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -295,7 +345,7 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ return nil }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -303,6 +353,9 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ return m.UserLocationInformation, true }, }, + optionalExtension(IDWAGFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.WAGFIdentityInformation }), + optionalExtension(IDTNGFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.TNGFIdentityInformation }), + optionalExtension(IDTWIFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.TWIFIdentityInformation }), } func (m *UplinkNASTransport) Marshal() ([]byte, error) { @@ -329,40 +382,66 @@ func ParseUplinkNASTransport(value []byte) (*UplinkNASTransport, error) { return parseMessageBody[UplinkNASTransport](ProcUplinkNASTransport, TriggeringInitiatingMessage, uplinkNASTransportIEs, value) } +func DecodeUplinkNASTransport(value []byte) (*UplinkNASTransport, error) { + return decodeMessageBody[UplinkNASTransport](ProcUplinkNASTransport, uplinkNASTransportIEs, value) +} + // TS 38.413 §9.2.5.2. // // NGAP places NAS-PDU after the optional Old AMF and RAN Paging Priority IEs // where S1AP puts it third, but neither optional IE is modeled, so the modeled // table order matches. type DownlinkNASTransport struct { - AMFUENGAPID AMFUENGAPID - RANUENGAPID RANUENGAPID - NASPDU NASPDU + AMFUENGAPID AMFUENGAPID + RANUENGAPID RANUENGAPID + NASPDU NASPDU + OldAMF *Name + RANPagingPriority *RANPagingPriority + MobilityRestrictionList *MobilityRestrictionList + IndexToRFSP *IndexToRFSP + UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + AllowedNSSAI AllowedNSSAI + SRVCCOperationPossible *SRVCCOperationPossible + EnhancedCoverageRestriction *EnhancedCoverageRestriction + ExtendedConnectedTime *ExtendedConnectedTime + UEDifferentiationInfo *UEDifferentiationInfo + CEmodeBrestricted *CEmodeBrestricted + UERadioCapability UERadioCapability + UECapabilityInfoRequest *UECapabilityInfoRequest + EndIndication *EndIndication + UERadioCapabilityID *UERadioCapabilityID + TargetNSSAIInformation *TargetNSSAIInformation + MaskedIMEISV *MaskedIMEISV + PartiallyAllowedNSSAI PartiallyAllowedNSSAI + MobileIABAuthorized *MobileIABAuthorized + ExtendedOldAMF *ExtendedAMFName messageMeta } var downlinkNASTransportIEs = []ieSpec[DownlinkNASTransport]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, + optionalExtension(IDOldAMF, CriticalityReject, func(m *DownlinkNASTransport) **Name { return &m.OldAMF }), + optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *DownlinkNASTransport) **RANPagingPriority { return &m.RANPagingPriority }), { - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { + Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -370,6 +449,24 @@ var downlinkNASTransportIEs = []ieSpec[DownlinkNASTransport]{ return &m.NASPDU, true }, }, + optionalExtension(IDMobilityRestrictionList, CriticalityIgnore, func(m *DownlinkNASTransport) **MobilityRestrictionList { return &m.MobilityRestrictionList }), + optionalExtension(IDIndexToRFSP, CriticalityIgnore, func(m *DownlinkNASTransport) **IndexToRFSP { return &m.IndexToRFSP }), + optionalExtension(IDUEAggregateMaximumBitRate, CriticalityIgnore, func(m *DownlinkNASTransport) **UEAggregateMaximumBitRate { return &m.UEAggregateMaximumBitRate }), + listExtension(IDAllowedNSSAI, CriticalityReject, func(m *DownlinkNASTransport) *AllowedNSSAI { return &m.AllowedNSSAI }), + optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *DownlinkNASTransport) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *DownlinkNASTransport) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), + optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *DownlinkNASTransport) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *DownlinkNASTransport) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *DownlinkNASTransport) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + listExtension(IDUERadioCapability, CriticalityIgnore, func(m *DownlinkNASTransport) *UERadioCapability { return &m.UERadioCapability }), + optionalExtension(IDUECapabilityInfoRequest, CriticalityIgnore, func(m *DownlinkNASTransport) **UECapabilityInfoRequest { return &m.UECapabilityInfoRequest }), + optionalExtension(IDEndIndication, CriticalityIgnore, func(m *DownlinkNASTransport) **EndIndication { return &m.EndIndication }), + optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *DownlinkNASTransport) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + optionalExtension(IDTargetNSSAIInformation, CriticalityIgnore, func(m *DownlinkNASTransport) **TargetNSSAIInformation { return &m.TargetNSSAIInformation }), + optionalExtension(IDMaskedIMEISV, CriticalityIgnore, func(m *DownlinkNASTransport) **MaskedIMEISV { return &m.MaskedIMEISV }), + listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *DownlinkNASTransport) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *DownlinkNASTransport) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + optionalExtension(IDExtendedOldAMF, CriticalityIgnore, func(m *DownlinkNASTransport) **ExtendedAMFName { return &m.ExtendedOldAMF }), } func (m *DownlinkNASTransport) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -395,3 +492,7 @@ func (m *DownlinkNASTransport) Marshal() ([]byte, error) { func ParseDownlinkNASTransport(value []byte) (*DownlinkNASTransport, error) { return parseMessageBody[DownlinkNASTransport](ProcDownlinkNASTransport, TriggeringInitiatingMessage, downlinkNASTransportIEs, value) } + +func DecodeDownlinkNASTransport(value []byte) (*DownlinkNASTransport, error) { + return decodeMessageBody[DownlinkNASTransport](ProcDownlinkNASTransport, downlinkNASTransportIEs, value) +} diff --git a/ngap/nas_transport_test.go b/ngap/nas_transport_test.go index e551694352..1146d1a73c 100644 --- a/ngap/nas_transport_test.go +++ b/ngap/nas_transport_test.go @@ -5,11 +5,10 @@ package ngap import ( "bytes" - "errors" - "reflect" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // Golden UPLINK NAS TRANSPORT PDUs @@ -30,13 +29,10 @@ func goldULITAI() TAI { func TestUplinkNASTransportRoundTrip(t *testing.T) { in := &UplinkNASTransport{ - AMFUENGAPID: 42, - RANUENGAPID: 1, - NASPDU: NASPDU{0x7e, 0x00, 0x41, 0x01}, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - CellIdentity: 0x123456789, TAI: goldULITAI(), - }, + AMFUENGAPID: 42, + RANUENGAPID: 1, + NASPDU: NASPDU{0x7e, 0x00, 0x41, 0x01}, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: goldULITAI()}}, } b, err := in.Marshal() @@ -60,7 +56,7 @@ func TestUplinkNASTransportRoundTrip(t *testing.T) { } if out.AMFUENGAPID != in.AMFUENGAPID || out.RANUENGAPID != in.RANUENGAPID || - !sameLocation(deref(out.UserLocationInformation), deref(in.UserLocationInformation)) || + !deref(out.UserLocationInformation).Equal(deref(in.UserLocationInformation)) || !bytes.Equal(out.NASPDU, in.NASPDU) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } @@ -76,10 +72,7 @@ func TestUplinkNASTransportGolden(t *testing.T) { "nr", &UplinkNASTransport{ AMFUENGAPID: 1, RANUENGAPID: 1, NASPDU: NASPDU{0x7e, 0x00}, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - CellIdentity: 0x123456789, TAI: goldULITAI(), - }, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: goldULITAI()}}, }, goldenUplinkNASTransportNR, }, @@ -89,11 +82,7 @@ func TestUplinkNASTransportGolden(t *testing.T) { "nr with timestamp", &UplinkNASTransport{ AMFUENGAPID: 0xffffffffff, RANUENGAPID: 0xffffffff, NASPDU: NASPDU{0x7e, 0x01, 0x02}, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - CellIdentity: 0xfffffffff, TAI: goldULITAI(), - TimeStamp: &TimeStamp{0x01, 0x02, 0x03, 0x04}, - }, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: NRCellIdentity(0xfffffffff)}, TAI: goldULITAI(), TimeStamp: &TimeStamp{0x01, 0x02, 0x03, 0x04}}}, }, goldenUplinkNASTransportNRTime, }, @@ -103,10 +92,7 @@ func TestUplinkNASTransportGolden(t *testing.T) { "eutra", &UplinkNASTransport{ AMFUENGAPID: 42, RANUENGAPID: 7, NASPDU: NASPDU{0x7e}, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationEUTRA, PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - CellIdentity: 0xabcde12, TAI: goldULITAI(), - }, + UserLocationInformation: &UserLocationInformation{EUTRA: &UserLocationInformationEUTRA{EUTRACGI: EUTRACGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, EUTRACellIdentity: EUTRACellIdentity(0xabcde12)}, TAI: goldULITAI()}}, }, goldenUplinkNASTransportEUTRA, }, @@ -139,14 +125,9 @@ func TestUplinkNASTransportGolden(t *testing.T) { } gotULI, wantULI := out.UserLocationInformation, tt.msg.UserLocationInformation - if gotULI.Kind != wantULI.Kind || gotULI.CellIdentity != wantULI.CellIdentity || - gotULI.PLMNIdentity != wantULI.PLMNIdentity || gotULI.TAI != wantULI.TAI { + if !gotULI.Equal(*wantULI) { t.Fatalf("location mismatch:\n got %+v\n want %+v", gotULI, wantULI) } - - if deref(gotULI.TimeStamp) != deref(wantULI.TimeStamp) { - t.Errorf("TimeStamp = %v, want %v", gotULI.TimeStamp, wantULI.TimeStamp) - } }) } } @@ -160,16 +141,16 @@ func TestUplinkNASTransportMissingIEs(t *testing.T) { } if _, err := ParseUplinkNASTransport(container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: AMFUENGAPID(42)}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(7)}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: AMFUENGAPID(42)}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(7)}, )); err == nil { t.Error("decoded a message with no NAS-PDU, want it rejected") } msg, err := ParseUplinkNASTransport(container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: AMFUENGAPID(42)}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(7)}, - ieField{id: IDNASPDU, crit: CriticalityReject, val: NASPDU{0x7e}}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: AMFUENGAPID(42)}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(7)}, + ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x7e}}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -182,7 +163,7 @@ func TestUplinkNASTransportMissingIEs(t *testing.T) { var missing int for _, ie := range msg.Diagnostics().IEs { - if ie.TypeOfError == TypeOfErrorMissing && ie.ID == IDUserLocationInformation { + if typeOfError(ie) == TypeOfErrorMissing && ie.ID == IDUserLocationInformation { missing++ } } @@ -192,62 +173,92 @@ func TestUplinkNASTransportMissingIEs(t *testing.T) { } } -// TS 38.413 §9.3.1.16 closes UserLocationInformation with a choice-Extensions -// alternative. Selecting it must be an explicit error, not a zero location that -// reads as one the peer reported. -func TestUserLocationInformationUnsupportedAlternatives(t *testing.T) { - // A complete ProtocolIE-SingleContainer, so the decoder reaches the - // not-comprehended path instead of failing on end-of-input. +func TestUserLocationInformationN3IWFWithoutPortNumberIsTyped(t *testing.T) { + tai := goldULITAI() + in := UserLocationInformation{N3IWFWithoutPortNumber: &UserLocationInformationN3IWFWithoutPortNumber{ + IPAddress: tlaOf(10, 0, 0, 1), TAI: &tai, + }} + w := per.NewWriter() - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, userLocationInformationAlternatives-1, userLocationInformationChoiceExtensions); err != nil { + if err := in.MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } - // id-UserLocationInformationN3IWF-without-PortNumber, a UserLocationInformation-ExtIEs - // alternative this package does not model. - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 65535, 439); err != nil { + inner, err := per.Marshal(in.N3IWFWithoutPortNumber) + if err != nil { t.Fatal(err) } - if err := per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(CriticalityIgnore)); err != nil { + want := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(want, per.Aligned, 0, 3, 3); err != nil { t.Fatal(err) } - if err := per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x00}); err != nil { + if err := encodeContainerField(want, ieField{ID: IDUserLocationInformationN3IWFwithoutPortNumber, Criticality: CriticalityIgnore, Value: ap.RawValue(inner)}); err != nil { t.Fatal(err) } - w.AlignToByte() - - var uli UserLocationInformation + if !bytes.Equal(perBytes(w), perBytes(want)) { + t.Fatalf("encoding = % x, want % x", perBytes(w), perBytes(want)) + } - err := uli.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned) - if !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want errNotComprehended", err) + got, err := unmarshalPERValue[UserLocationInformation](perBytes(w)) + if err != nil { + t.Fatal(err) } - if !sameLocation(uli, UserLocationInformation{}) { - t.Errorf("choice-Extensions left a partial value %+v", uli) + if !got.Equal(in) { + t.Errorf("round trip = %+v, want %+v", got, in) } } -// Each kind's cell identity has its own width; a value too wide for the kind is -// an error rather than a silent truncation to another cell. -func TestUserLocationInformationCellIdentityWidth(t *testing.T) { - tests := []struct { - kind UserLocationInformationKind - cell uint64 - }{ - {UserLocationEUTRA, 1 << EUTRACellIdentityBits}, - {UserLocationNR, 1 << NRCellIdentityBits}, +func TestUserLocationInformationUnknownChoiceExtensionIsPreserved(t *testing.T) { + for _, crit := range []Criticality{CriticalityReject, CriticalityIgnore} { + w := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 3, 3); err != nil { + t.Fatal(err) + } + + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: ap.RawValue([]byte{0x00})}); err != nil { + t.Fatal(err) + } + + wire := perBytes(w) + + uli, err := unmarshalPERValue[UserLocationInformation](wire) + if err != nil { + t.Fatalf("decode: %v", err) + } + + if uli.ChoiceExtension == nil || uli.ChoiceExtension.ID != 9999 || uli.NR != nil || uli.EUTRA != nil { + t.Fatalf("decoded %+v, want only the raw choice-Extensions", uli) + } + + d := ap.Diagnose[ProtocolIEID](&uli) + if len(d.IEs) != 1 || d.IEs[0].Criticality != crit { + t.Errorf("diagnostics = %+v, want one entry on criticality %v", d.IEs, crit) + } + + w2 := per.NewWriter() + if err := uli.MarshalPER(w2, per.Aligned); err != nil { + t.Fatal(err) + } + + if !bytes.Equal(perBytes(w2), wire) { + t.Errorf("re-encode = % x, want % x", perBytes(w2), wire) + } } +} - for _, tt := range tests { - uli := UserLocationInformation{Kind: tt.kind, CellIdentity: tt.cell, TAI: goldULITAI()} +func TestUserLocationInformationCellIdentityWidth(t *testing.T) { + for _, uli := range []UserLocationInformation{ + {EUTRA: &UserLocationInformationEUTRA{EUTRACGI: EUTRACGI{EUTRACellIdentity: 1 << EUTRACellIdentityBits}, TAI: goldULITAI()}}, + {NR: &UserLocationInformationNR{NRCGI: NRCGI{NRCellIdentity: 1 << NRCellIdentityBits}, TAI: goldULITAI()}}, + } { if _, err := (&UplinkNASTransport{ AMFUENGAPID: 1, RANUENGAPID: 1, NASPDU: NASPDU{0x7e}, UserLocationInformation: &uli, }).Marshal(); err == nil { - t.Errorf("kind %d encoded cell identity %#x, want a width error", tt.kind, tt.cell) + t.Errorf("%+v encoded an over-wide cell identity, want a width error", uli) } } } @@ -351,27 +362,15 @@ func TestDownlinkNASTransportMissingIEs(t *testing.T) { } if _, err := ParseDownlinkNASTransport(container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: AMFUENGAPID(42)}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(7)}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: AMFUENGAPID(42)}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(7)}, )); err == nil { t.Error("decoded a message with no NAS-PDU, want it rejected") } } -// sameLocation compares two locations; UserLocationInformation holds a slice -// for the N3IWF alternative, so it is not comparable with ==. -func sameLocation(a, b UserLocationInformation) bool { - return a.Kind == b.Kind && a.PLMNIdentity == b.PLMNIdentity && - a.CellIdentity == b.CellIdentity && a.TAI == b.TAI && - deref(a.TimeStamp) == deref(b.TimeStamp) && - bytes.Equal(a.IPAddress, b.IPAddress) && a.PortNumber == b.PortNumber -} - func goldInitialULI() UserLocationInformation { - return UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - CellIdentity: 0x123456789, TAI: goldULITAI(), - } + return UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: goldULITAI()}} } func TestInitialUEMessageGolden(t *testing.T) { @@ -427,7 +426,7 @@ func TestInitialUEMessageGolden(t *testing.T) { } if out.RANUENGAPID != tt.msg.RANUENGAPID || !bytes.Equal(out.NASPDU, tt.msg.NASPDU) || - !sameLocation(out.UserLocationInformation, tt.msg.UserLocationInformation) || + !out.UserLocationInformation.Equal(tt.msg.UserLocationInformation) || deref(out.RRCEstablishmentCause) != deref(tt.msg.RRCEstablishmentCause) || deref(out.FiveGSTMSI) != deref(tt.msg.FiveGSTMSI) || deref(out.AMFSetID) != deref(tt.msg.AMFSetID) || @@ -443,8 +442,8 @@ func TestInitialUEMessageGolden(t *testing.T) { // the other. §10.3.5 stops this message when it is absent. func TestInitialUEMessageLocationIsRequired(t *testing.T) { if _, err := ParseInitialUEMessage(container(t, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(1)}, - ieField{id: IDNASPDU, crit: CriticalityReject, val: NASPDU{0x7e}}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(1)}, + ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x7e}}, )); err == nil { t.Error("decoded a message with no User Location Information, want it rejected") } @@ -452,9 +451,9 @@ func TestInitialUEMessageLocationIsRequired(t *testing.T) { // RRC Establishment Cause is mandatory-ignore, so its absence is reported // and the message still delivered. msg, err := ParseInitialUEMessage(container(t, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(1)}, - ieField{id: IDNASPDU, crit: CriticalityReject, val: NASPDU{0x7e}}, - ieField{id: IDUserLocationInformation, crit: CriticalityReject, val: goldInitialULI()}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(1)}, + ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x7e}}, + ieField{ID: IDUserLocationInformation, Criticality: CriticalityReject, Value: Ptr(goldInitialULI())}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -467,7 +466,7 @@ func TestInitialUEMessageLocationIsRequired(t *testing.T) { var missing int for _, ie := range msg.Diagnostics().IEs { - if ie.TypeOfError == TypeOfErrorMissing && ie.ID == IDRRCEstablishmentCause { + if typeOfError(ie) == TypeOfErrorMissing && ie.ID == IDRRCEstablishmentCause { missing++ } } @@ -498,12 +497,16 @@ func TestRRCEstablishmentCauseNGAPOnlyValues(t *testing.T) { } } - // notAvailable and mo-ExceptionData are extension additions. - raw := extensionEnum(t, rrcEstablishmentCauseRootCount, 0) + for k, want := range map[int64]RRCEstablishmentCause{0: RRCCauseNotAvailable, 1: RRCCauseMOExceptionData} { + var got RRCEstablishmentCause + if err := got.UnmarshalPER(per.NewReader(extensionEnum(t, int64(len(enumRRCEstablishmentCause.Root)), k)), per.Aligned); err != nil || got != want || got.Diagnose(nil) { + t.Errorf("extension addition %d = %d, %v; want %s", k, got, err, want.Name()) + } + } var got RRCEstablishmentCause - if err := got.UnmarshalPER(per.NewReader(raw), per.Aligned); !errors.Is(err, errNotComprehended) { - t.Errorf("extension addition: err = %v, want errNotComprehended", err) + if err := got.UnmarshalPER(per.NewReader(extensionEnum(t, int64(len(enumRRCEstablishmentCause.Root)), 2)), per.Aligned); err != nil || !got.Diagnose(nil) { + t.Errorf("unknown extension addition = %d, %v; want it kept and reported", got, err) } } @@ -526,13 +529,13 @@ func TestInitialUEMessageN3IWFLocation(t *testing.T) { t.Fatalf("an N3IWF location was rejected: %v", err) } - uli := msg.UserLocationInformation - if uli.Kind != UserLocationN3IWF { - t.Fatalf("Kind = %d, want UserLocationN3IWF", uli.Kind) + uli := msg.UserLocationInformation.N3IWF + if uli == nil { + t.Fatalf("location = %+v, want the N3IWF alternative", msg.UserLocationInformation) } - if !bytes.Equal(uli.IPAddress, []byte{0xc0, 0xa8, 0x01, 0x01}) { - t.Errorf("IPAddress = %x, want c0a80101", uli.IPAddress) + if uli.IPAddress != tlaOf(0xc0, 0xa8, 0x01, 0x01) { + t.Errorf("IPAddress = %v, want 192.168.1.1", uli.IPAddress) } if uli.PortNumber != 0x1f90 { @@ -615,7 +618,7 @@ func initialUEMessageWireCases(t *testing.T) []wireCase { check: func(t *testing.T, a any) { t.Helper() - if !reflect.DeepEqual(a, goldInitialUEMessageFemto()) { + if !equalByMethod(a, goldInitialUEMessageFemto()) { t.Fatalf("decoded %+v", a) } }, @@ -623,13 +626,14 @@ func initialUEMessageWireCases(t *testing.T) []wireCase { { name: "InitialUEMessageGUAMIAfterSelectedPLMNIdentity", pdu: insertRawIEs(t, marshalT(t, goldInitialUEMessageFemto()), 4, - ieField{id: IDSelectedPLMNIdentity, crit: CriticalityIgnore, raw: []byte{0x00, 0xf1, 0x10}}), + ieField{ID: IDSelectedPLMNIdentity, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00, 0xf1, 0x10})}), parse: func(v []byte) (any, error) { return ParseInitialUEMessage(v) }, check: func(t *testing.T, a any) { t.Helper() m := a.(*InitialUEMessage) - if m.GUAMI == nil || deref(m.GUAMIType) != GUAMITypeMapped || len(m.RequestedNSSAI) != 2 || len(m.UnknownIEs()) != 1 { + if m.GUAMI == nil || deref(m.GUAMIType) != GUAMITypeMapped || len(m.RequestedNSSAI) != 2 || + deref(m.SelectedPLMNIdentity) != (PLMNIdentity{0x00, 0xf1, 0x10}) || len(m.UnknownIEs()) != 0 { t.Fatalf("decoded %+v", m) } }, diff --git a/ngap/ng_reset.go b/ngap/ng_reset.go index d4becba746..a530e2e0eb 100644 --- a/ngap/ng_reset.go +++ b/ngap/ng_reset.go @@ -4,34 +4,23 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" ) // TS 38.413, NGAP-Constants. const maxnoofNGConnectionsToReset = 65536 -// ResetType CHOICE alternatives, defined inline in the NG RESET of TS 38.413 -// §9.2.6.11 rather than in a clause of its own. The CHOICE is not -// extensible, so choice-Extensions is a plain alternative index. -const ( - resetTypeNGInterface = iota - resetTypePartOfNGInterface - resetTypeChoiceExtensions - - resetTypeAlternatives = 3 -) - // ResetAll ::= ENUMERATED { reset-all, ... }. -const resetAllRootCount = 1 +type ResetAll uint8 + +const ResetAllResetAll ResetAll = 0 // TS 38.413 §9.3.3.25. Both identities are optional; an item may carry either // or both. type UEAssociatedLogicalNGConnectionItem struct { AMFUENGAPID *AMFUENGAPID `per:",optional"` RANUENGAPID *RANUENGAPID `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -40,56 +29,10 @@ type UEAssociatedLogicalNGConnectionItem struct { // A plain SEQUENCE OF: the items are not in a ProtocolIE-SingleContainer. type UEAssociatedLogicalNGConnectionList []UEAssociatedLogicalNGConnectionItem -// All selects nG-Interface, resetting the whole interface; otherwise Part -// selects partOfNG-Interface, the connections to reset. type ResetType struct { - All bool - Part UEAssociatedLogicalNGConnectionList -} - -func (t ResetType) MarshalPER(w *per.Writer, enc per.Encoding) error { - if t.All { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, resetTypeAlternatives-1, resetTypeNGInterface); err != nil { - return err - } - - return encodeRootEnumerated(w, enc, resetAllRootCount, 0, "ResetAll") - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, resetTypeAlternatives-1, resetTypePartOfNGInterface); err != nil { - return err - } - - return t.Part.MarshalPER(w, enc) -} - -func (t *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, resetTypeAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: ResetType choice: %w", err) - } - - switch idx { - case resetTypeNGInterface: - if _, err := decodeRootEnumerated(r, enc, resetAllRootCount, "ResetAll"); err != nil { - return fmt.Errorf("ngap: ResetAll: %w", err) - } - - *t = ResetType{All: true} - - return nil - case resetTypeChoiceExtensions: - return decodeChoiceExtension(r, enc, "ResetType") - default: - var items UEAssociatedLogicalNGConnectionList - if err := items.UnmarshalPER(r, enc); err != nil { - return err - } - - *t = ResetType{Part: items} - - return nil - } + NGInterface *ResetAll `per:",choice:0"` + PartOfNGInterface *UEAssociatedLogicalNGConnectionList `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` } // TS 38.413 §9.2.6.11. @@ -102,11 +45,11 @@ type NGReset struct { var nGResetIEs = []ieSpec[NGReset]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NGReset, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NGReset, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -114,7 +57,7 @@ var nGResetIEs = []ieSpec[NGReset]{ return nil }, - encode: func(m *NGReset) (per.Marshaler, bool) { + Encode: func(m *NGReset) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -123,11 +66,11 @@ var nGResetIEs = []ieSpec[NGReset]{ }, }, { - id: IDResetType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NGReset, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ResetType) + ID: IDResetType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NGReset, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ResetType) }, - encode: func(m *NGReset) (per.Marshaler, bool) { return &m.ResetType, true }, + Encode: func(m *NGReset) (per.Marshaler, bool) { return &m.ResetType, true }, }, } @@ -155,6 +98,10 @@ func ParseNGReset(value []byte) (*NGReset, error) { return parseMessageBody[NGReset](ProcNGReset, TriggeringInitiatingMessage, nGResetIEs, value) } +func DecodeNGReset(value []byte) (*NGReset, error) { + return decodeMessageBody[NGReset](ProcNGReset, nGResetIEs, value) +} + // TS 38.413 §9.2.6.12. type NGResetAcknowledge struct { ConnectionList UEAssociatedLogicalNGConnectionList @@ -166,11 +113,11 @@ type NGResetAcknowledge struct { // The message has no mandatory IE. var nGResetAcknowledgeIEs = []ieSpec[NGResetAcknowledge]{ { - id: IDUEAssociatedLogicalNGConnectionList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGResetAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ConnectionList) + ID: IDUEAssociatedLogicalNGConnectionList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGResetAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ConnectionList) }, - encode: func(m *NGResetAcknowledge) (per.Marshaler, bool) { + Encode: func(m *NGResetAcknowledge) (per.Marshaler, bool) { if len(m.ConnectionList) == 0 { return nil, false } @@ -179,10 +126,10 @@ var nGResetAcknowledgeIEs = []ieSpec[NGResetAcknowledge]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGResetAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGResetAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -190,7 +137,7 @@ var nGResetAcknowledgeIEs = []ieSpec[NGResetAcknowledge]{ return nil }, - encode: func(m *NGResetAcknowledge) (per.Marshaler, bool) { + Encode: func(m *NGResetAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -223,3 +170,7 @@ func (m *NGResetAcknowledge) Marshal() ([]byte, error) { func ParseNGResetAcknowledge(value []byte) (*NGResetAcknowledge, error) { return parseMessageBody[NGResetAcknowledge](ProcNGReset, TriggeringSuccessfulOutcome, nGResetAcknowledgeIEs, value) } + +func DecodeNGResetAcknowledge(value []byte) (*NGResetAcknowledge, error) { + return decodeMessageBody[NGResetAcknowledge](ProcNGReset, nGResetAcknowledgeIEs, value) +} diff --git a/ngap/ng_reset_test.go b/ngap/ng_reset_test.go index e6f779bdc2..5b52c34490 100644 --- a/ngap/ng_reset_test.go +++ b/ngap/ng_reset_test.go @@ -5,10 +5,10 @@ package ngap import ( "bytes" - "strings" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // Golden NG RESET PDUs @@ -20,15 +20,15 @@ const ( func goldNGResetAll() *NGReset { return &NGReset{ - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: CauseMiscOMIntervention}), - ResetType: ResetType{All: true}, + Cause: Ptr(CauseMiscOMIntervention.Cause()), + ResetType: ResetType{NGInterface: Ptr(ResetAllResetAll)}, } } func goldNGResetPart() *NGReset { return &NGReset{ - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: CauseMiscOMIntervention}), - ResetType: ResetType{Part: UEAssociatedLogicalNGConnectionList{ + Cause: Ptr(CauseMiscOMIntervention.Cause()), + ResetType: ResetType{PartOfNGInterface: &UEAssociatedLogicalNGConnectionList{ {AMFUENGAPID: Ptr(AMFUENGAPID(7)), RANUENGAPID: Ptr(RANUENGAPID(9))}, // An item may carry either identity alone. {RANUENGAPID: Ptr(RANUENGAPID(11))}, @@ -96,20 +96,21 @@ func TestNGResetGoldenDecode(t *testing.T) { t.Fatalf("parse: %v", err) } - if deref(msg.Cause) != deref(tt.want.Cause) { + if !deref(msg.Cause).Equal(deref(tt.want.Cause)) { t.Errorf("cause = %v, want %v", deref(msg.Cause), deref(tt.want.Cause)) } - if msg.ResetType.All != tt.want.ResetType.All { - t.Fatalf("All = %v, want %v", msg.ResetType.All, tt.want.ResetType.All) + if (msg.ResetType.NGInterface == nil) != (tt.want.ResetType.NGInterface == nil) { + t.Fatalf("NGInterface = %v, want %v", msg.ResetType.NGInterface, tt.want.ResetType.NGInterface) } - if len(msg.ResetType.Part) != len(tt.want.ResetType.Part) { - t.Fatalf("Part = %+v, want %d items", msg.ResetType.Part, len(tt.want.ResetType.Part)) + gotPart, wantPart := deref(msg.ResetType.PartOfNGInterface), deref(tt.want.ResetType.PartOfNGInterface) + if len(gotPart) != len(wantPart) { + t.Fatalf("Part = %+v, want %d items", gotPart, len(wantPart)) } - for i, item := range msg.ResetType.Part { - w := tt.want.ResetType.Part[i] + for i, item := range gotPart { + w := wantPart[i] if deref(item.AMFUENGAPID) != deref(w.AMFUENGAPID) || deref(item.RANUENGAPID) != deref(w.RANUENGAPID) { t.Errorf("item %d = %+v, want %+v", i, item, w) } @@ -172,36 +173,40 @@ func TestNGResetAcknowledgeEmpty(t *testing.T) { } } -// TS 38.413 §9.3.1.16 closes ResetType with a choice-Extensions alternative -// rather than an extension marker, so selecting it must be an explicit error -// and not a zero ResetType that reads as "reset the whole interface". -func TestResetTypeChoiceExtensionIsRejected(t *testing.T) { +func TestResetTypeChoiceExtensionIsPreserved(t *testing.T) { w := per.NewWriter() enc := per.Aligned - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, resetTypeAlternatives-1, resetTypeChoiceExtensions); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { t.Fatal(err) } - if err := encodeContainerField(w, enc, ieField{ - id: IDResetType, - crit: CriticalityReject, - raw: []byte{0x00}, - }); err != nil { + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}); err != nil { t.Fatal(err) } - got, err := unmarshalPERValue[ResetType](perBytes(w)) - if err == nil { - t.Fatalf("decoded choice-Extensions as %+v, want an error", got) + wire := perBytes(w) + + got, err := unmarshalPERValue[ResetType](wire) + if err != nil { + t.Fatalf("decode: %v", err) + } + + if got.NGInterface != nil || got.PartOfNGInterface != nil || got.ChoiceExtension == nil { + t.Fatalf("ResetType = %+v, want only the raw choice-Extensions", got) } - if !strings.Contains(err.Error(), "unsupported ResetType alternative") { - t.Errorf("error = %q, want it to name the unsupported alternative", err) + if d := ap.Diagnose[ProtocolIEID](&got); len(d.IEs) != 1 || d.IEs[0].Criticality != CriticalityReject { + t.Errorf("diagnostics = %+v", d.IEs) + } + + w2 := per.NewWriter() + if err := got.MarshalPER(w2, enc); err != nil { + t.Fatal(err) } - if got.All || got.Part != nil { - t.Errorf("ResetType = %+v, want it left untouched", got) + if !bytes.Equal(perBytes(w2), wire) { + t.Errorf("re-encode = % x, want % x", perBytes(w2), wire) } } @@ -209,7 +214,7 @@ func TestResetTypeChoiceExtensionIsRejected(t *testing.T) { // SIZE(1..maxnoofNGConnectionsToReset), so an empty one cannot be encoded. func TestResetTypeRejectsEmptyPart(t *testing.T) { w := per.NewWriter() - if err := (ResetType{Part: UEAssociatedLogicalNGConnectionList{}}).MarshalPER(w, per.Aligned); err == nil { + if err := (&ResetType{PartOfNGInterface: &UEAssociatedLogicalNGConnectionList{}}).MarshalPER(w, per.Aligned); err == nil { t.Fatal("encode accepted an empty partOfNG-Interface list") } } diff --git a/ngap/ng_setup.go b/ngap/ng_setup.go index b1409373bf..0857fe542e 100644 --- a/ngap/ng_setup.go +++ b/ngap/ng_setup.go @@ -14,33 +14,37 @@ type NGSetupRequest struct { SupportedTAList SupportedTAList DefaultPagingDRX *PagingDRX UERetentionInformation *UERetentionInformation + NBIoTDefaultPagingDRX *NBIoTDefaultPagingDRX + ExtendedRANNodeName *ExtendedRANNodeName + AIoTSupport *AIoTSupport + AdditionalULI *AdditionalULI messageMeta } var nGSetupRequestIEs = []ieSpec[NGSetupRequest]{ { - id: IDGlobalRANNodeID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NGSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GlobalRANNodeID) + ID: IDGlobalRANNodeID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NGSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GlobalRANNodeID) }, - encode: func(m *NGSetupRequest) (per.Marshaler, bool) { return &m.GlobalRANNodeID, true }, + Encode: func(m *NGSetupRequest) (per.Marshaler, bool) { return &m.GlobalRANNodeID, true }, }, { - id: IDRANNodeName, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDRANNodeName, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupRequest, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { name := string(n) m.RANNodeName = &name } return err }, - encode: func(m *NGSetupRequest) (per.Marshaler, bool) { + Encode: func(m *NGSetupRequest) (per.Marshaler, bool) { if m.RANNodeName == nil { return nil, false } @@ -49,18 +53,18 @@ var nGSetupRequestIEs = []ieSpec[NGSetupRequest]{ }, }, { - id: IDSupportedTAList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NGSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SupportedTAList) + ID: IDSupportedTAList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NGSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SupportedTAList) }, - encode: func(m *NGSetupRequest) (per.Marshaler, bool) { return m.SupportedTAList, true }, + Encode: func(m *NGSetupRequest) (per.Marshaler, bool) { return m.SupportedTAList, true }, }, { - id: IDDefaultPagingDRX, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NGSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDDefaultPagingDRX, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupRequest, r *per.Reader, enc per.Encoding) error { var v PagingDRX - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -68,7 +72,7 @@ var nGSetupRequestIEs = []ieSpec[NGSetupRequest]{ return nil }, - encode: func(m *NGSetupRequest) (per.Marshaler, bool) { + Encode: func(m *NGSetupRequest) (per.Marshaler, bool) { if m.DefaultPagingDRX == nil { return nil, false } @@ -77,11 +81,11 @@ var nGSetupRequestIEs = []ieSpec[NGSetupRequest]{ }, }, { - id: IDUERetentionInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDUERetentionInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupRequest, r *per.Reader, enc per.Encoding) error { var v UERetentionInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -89,7 +93,7 @@ var nGSetupRequestIEs = []ieSpec[NGSetupRequest]{ return nil }, - encode: func(m *NGSetupRequest) (per.Marshaler, bool) { + Encode: func(m *NGSetupRequest) (per.Marshaler, bool) { if m.UERetentionInformation == nil { return nil, false } @@ -97,6 +101,10 @@ var nGSetupRequestIEs = []ieSpec[NGSetupRequest]{ return m.UERetentionInformation, true }, }, + optionalExtension(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *NGSetupRequest) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), + optionalExtension(IDExtendedRANNodeName, CriticalityIgnore, func(m *NGSetupRequest) **ExtendedRANNodeName { return &m.ExtendedRANNodeName }), + optionalExtension(IDAIoTSupport, CriticalityReject, func(m *NGSetupRequest) **AIoTSupport { return &m.AIoTSupport }), + optionalExtension(IDAdditionalULI, CriticalityIgnore, func(m *NGSetupRequest) **AdditionalULI { return &m.AdditionalULI }), } func (m *NGSetupRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -122,3 +130,7 @@ func (m *NGSetupRequest) Marshal() ([]byte, error) { func ParseNGSetupRequest(value []byte) (*NGSetupRequest, error) { return parseMessageBody[NGSetupRequest](ProcNGSetup, TriggeringInitiatingMessage, nGSetupRequestIEs, value) } + +func DecodeNGSetupRequest(value []byte) (*NGSetupRequest, error) { + return decodeMessageBody[NGSetupRequest](ProcNGSetup, nGSetupRequestIEs, value) +} diff --git a/ngap/ng_setup_failure.go b/ngap/ng_setup_failure.go index 4e0c4289ce..17f2fcdc56 100644 --- a/ngap/ng_setup_failure.go +++ b/ngap/ng_setup_failure.go @@ -17,25 +17,8 @@ const ( TimeToWaitV10s TimeToWaitV20s TimeToWaitV60s - - timeToWaitRootCount = 6 ) -func (t TimeToWait) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, timeToWaitRootCount, int64(t), "TimeToWait") -} - -func (t *TimeToWait) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, timeToWaitRootCount, "TimeToWait") - if err != nil { - return err - } - - *t = TimeToWait(idx) - - return nil -} - // TS 38.413 §9.2.6.3. type NGSetupFailure struct { Cause *Cause @@ -47,11 +30,11 @@ type NGSetupFailure struct { var nGSetupFailureIEs = []ieSpec[NGSetupFailure]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NGSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -59,7 +42,7 @@ var nGSetupFailureIEs = []ieSpec[NGSetupFailure]{ return nil }, - encode: func(m *NGSetupFailure) (per.Marshaler, bool) { + Encode: func(m *NGSetupFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -68,11 +51,11 @@ var nGSetupFailureIEs = []ieSpec[NGSetupFailure]{ }, }, { - id: IDTimeToWait, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDTimeToWait, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupFailure, r *per.Reader, enc per.Encoding) error { var ttw TimeToWait - if err := perIEDecode(raw, &ttw); err != nil { + if err := decodeIE(r, &ttw); err != nil { return err } @@ -80,7 +63,7 @@ var nGSetupFailureIEs = []ieSpec[NGSetupFailure]{ return nil }, - encode: func(m *NGSetupFailure) (per.Marshaler, bool) { + Encode: func(m *NGSetupFailure) (per.Marshaler, bool) { if m.TimeToWait == nil { return nil, false } @@ -89,11 +72,11 @@ var nGSetupFailureIEs = []ieSpec[NGSetupFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -101,7 +84,7 @@ var nGSetupFailureIEs = []ieSpec[NGSetupFailure]{ return nil }, - encode: func(m *NGSetupFailure) (per.Marshaler, bool) { + Encode: func(m *NGSetupFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -134,3 +117,7 @@ func (m *NGSetupFailure) Marshal() ([]byte, error) { func ParseNGSetupFailure(value []byte) (*NGSetupFailure, error) { return parseMessageBody[NGSetupFailure](ProcNGSetup, TriggeringUnsuccessfulOutcome, nGSetupFailureIEs, value) } + +func DecodeNGSetupFailure(value []byte) (*NGSetupFailure, error) { + return decodeMessageBody[NGSetupFailure](ProcNGSetup, nGSetupFailureIEs, value) +} diff --git a/ngap/ng_setup_failure_test.go b/ngap/ng_setup_failure_test.go index 39a17129f0..436b83dd27 100644 --- a/ngap/ng_setup_failure_test.go +++ b/ngap/ng_setup_failure_test.go @@ -23,8 +23,8 @@ func TestNGSetupFailureGoldenDecode(t *testing.T) { t.Fatalf("parse: %v", err) } - want := Cause{Group: CauseGroupMisc, Value: CauseMiscUnknownPLMNOrSNPN} - if deref(fail.Cause) != want { + want := CauseMiscUnknownPLMNOrSNPN.Cause() + if !deref(fail.Cause).Equal(want) { t.Errorf("cause = %v, want %v", deref(fail.Cause), want) } @@ -34,7 +34,7 @@ func TestNGSetupFailureGoldenDecode(t *testing.T) { } func TestNGSetupFailureCauseOnly(t *testing.T) { - in := &NGSetupFailure{Cause: Ptr(Cause{Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject})} + in := &NGSetupFailure{Cause: Ptr(CauseProtocolAbstractSyntaxErrorReject.Cause())} b, err := in.Marshal() if err != nil { @@ -56,7 +56,7 @@ func TestNGSetupFailureCauseOnly(t *testing.T) { t.Fatal(err) } - if deref(out.Cause) != deref(in.Cause) || out.TimeToWait != nil || out.CriticalityDiagnostics != nil { + if !deref(out.Cause).Equal(deref(in.Cause)) || out.TimeToWait != nil || out.CriticalityDiagnostics != nil { t.Fatalf("got %+v", out) } } @@ -74,7 +74,7 @@ func TestNGSetupFailureWithoutCauseIsDelivered(t *testing.T) { } diag := out.Diagnostics() - if len(diag.IEs) != 1 || diag.IEs[0].ID != IDCause || diag.IEs[0].TypeOfError != TypeOfErrorMissing { + if len(diag.IEs) != 1 || diag.IEs[0].ID != IDCause || typeOfError(diag.IEs[0]) != TypeOfErrorMissing { t.Fatalf("diagnostics = %+v", diag.IEs) } } diff --git a/ngap/ng_setup_resp.go b/ngap/ng_setup_resp.go index 79bc5a6a13..3241eb61ee 100644 --- a/ngap/ng_setup_resp.go +++ b/ngap/ng_setup_resp.go @@ -16,6 +16,10 @@ type NGSetupResponse struct { CriticalityDiagnostics *CriticalityDiagnostics UERetentionInformation *UERetentionInformation ExtendedAMFName *ExtendedAMFName + IABSupported *IABSupported + MobileIABSupported *MobileIABSupported + AIOTFIdentifier *AIOTFIdentifier + AIOTFName *AIOTFName messageMeta } @@ -25,31 +29,31 @@ var relativeAMFCapacityBounds = per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: t var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ { - id: IDAMFName, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDAMFName, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { m.AMFName = string(n) } return err }, - encode: func(m *NGSetupResponse) (per.Marshaler, bool) { return Name(m.AMFName), true }, + Encode: func(m *NGSetupResponse) (per.Marshaler, bool) { return Name(m.AMFName), true }, }, { - id: IDServedGUAMIList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ServedGUAMIList) + ID: IDServedGUAMIList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ServedGUAMIList) }, - encode: func(m *NGSetupResponse) (per.Marshaler, bool) { return m.ServedGUAMIList, true }, + Encode: func(m *NGSetupResponse) (per.Marshaler, bool) { return m.ServedGUAMIList, true }, }, { - id: IDRelativeAMFCapacity, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { - v, err := per.DecodeInteger(per.NewReader(raw), enc, relativeAMFCapacityBounds) + ID: IDRelativeAMFCapacity, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, relativeAMFCapacityBounds) if err != nil { return err } @@ -59,7 +63,7 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return nil }, - encode: func(m *NGSetupResponse) (per.Marshaler, bool) { + Encode: func(m *NGSetupResponse) (per.Marshaler, bool) { if m.RelativeAMFCapacity == nil { return nil, false } @@ -70,18 +74,18 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ }, }, { - id: IDPLMNSupportList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PLMNSupportList) + ID: IDPLMNSupportList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PLMNSupportList) }, - encode: func(m *NGSetupResponse) (per.Marshaler, bool) { return m.PLMNSupportList, true }, + Encode: func(m *NGSetupResponse) (per.Marshaler, bool) { return m.PLMNSupportList, true }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -89,7 +93,7 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return nil }, - encode: func(m *NGSetupResponse) (per.Marshaler, bool) { + Encode: func(m *NGSetupResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -98,11 +102,11 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ }, }, { - id: IDUERetentionInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDUERetentionInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { var v UERetentionInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -110,7 +114,7 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return nil }, - encode: func(m *NGSetupResponse) (per.Marshaler, bool) { + Encode: func(m *NGSetupResponse) (per.Marshaler, bool) { if m.UERetentionInformation == nil { return nil, false } @@ -118,12 +122,13 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return m.UERetentionInformation, true }, }, + optionalExtension(IDIABSupported, CriticalityIgnore, func(m *NGSetupResponse) **IABSupported { return &m.IABSupported }), { - id: IDExtendedAMFName, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *NGSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDExtendedAMFName, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { var v ExtendedAMFName - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -131,7 +136,7 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return nil }, - encode: func(m *NGSetupResponse) (per.Marshaler, bool) { + Encode: func(m *NGSetupResponse) (per.Marshaler, bool) { if m.ExtendedAMFName == nil { return nil, false } @@ -139,6 +144,9 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return m.ExtendedAMFName, true }, }, + optionalExtension(IDMobileIABSupported, CriticalityIgnore, func(m *NGSetupResponse) **MobileIABSupported { return &m.MobileIABSupported }), + optionalExtension(IDAIOTFIdentifier, CriticalityReject, func(m *NGSetupResponse) **AIOTFIdentifier { return &m.AIOTFIdentifier }), + optionalExtension(IDAIOTFName, CriticalityReject, func(m *NGSetupResponse) **AIOTFName { return &m.AIOTFName }), } func (m *NGSetupResponse) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -164,3 +172,7 @@ func (m *NGSetupResponse) Marshal() ([]byte, error) { func ParseNGSetupResponse(value []byte) (*NGSetupResponse, error) { return parseMessageBody[NGSetupResponse](ProcNGSetup, TriggeringSuccessfulOutcome, nGSetupResponseIEs, value) } + +func DecodeNGSetupResponse(value []byte) (*NGSetupResponse, error) { + return decodeMessageBody[NGSetupResponse](ProcNGSetup, nGSetupResponseIEs, value) +} diff --git a/ngap/ng_setup_test.go b/ngap/ng_setup_test.go index 320201ea27..92ddff0697 100644 --- a/ngap/ng_setup_test.go +++ b/ngap/ng_setup_test.go @@ -36,13 +36,8 @@ func goldPLMN() PLMNIdentity { return PLMNIdentity{0x02, 0xf8, 0x39} } func goldRequest() *NGSetupRequest { return &NGSetupRequest{ - GlobalRANNodeID: GlobalRANNodeID{ - Kind: RANNodeIDGNB, - PLMNIdentity: goldPLMN(), - Value: 0x000102, - Bits: 24, - }, - RANNodeName: Ptr("ella-gnb"), + GlobalRANNodeID: NewGlobalGNBID(goldPLMN(), 0x000102, 24), + RANNodeName: Ptr("ella-gnb"), SupportedTAList: SupportedTAList{{ TAC: 0x000001, BroadcastPLMNList: BroadcastPLMNList{{ @@ -78,7 +73,7 @@ func goldResponse() *NGSetupResponse { func goldFailure() *NGSetupFailure { return &NGSetupFailure{ - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: CauseMiscUnknownPLMNOrSNPN}), + Cause: Ptr(CauseMiscUnknownPLMNOrSNPN.Cause()), TimeToWait: Ptr(TimeToWaitV10s), } } @@ -101,7 +96,7 @@ func TestNGSetupRequestGoldenDecode(t *testing.T) { want := goldRequest() - if req.GlobalRANNodeID != want.GlobalRANNodeID { + if !req.GlobalRANNodeID.Equal(want.GlobalRANNodeID) { t.Errorf("GlobalRANNodeID = %+v, want %+v", req.GlobalRANNodeID, want.GlobalRANNodeID) } @@ -177,7 +172,7 @@ func TestNGSetupRequestRoundTrip(t *testing.T) { t.Fatal(err) } - if out.GlobalRANNodeID != in.GlobalRANNodeID || + if !out.GlobalRANNodeID.Equal(in.GlobalRANNodeID) || deref(out.RANNodeName) != deref(in.RANNodeName) || deref(out.DefaultPagingDRX) != deref(in.DefaultPagingDRX) || len(out.SupportedTAList) != 1 || @@ -198,16 +193,16 @@ func encodePartialNGSetup(t *testing.T, globalRANNodeID, supportedTAList, paging src := goldRequest() if globalRANNodeID { - fields = append(fields, ieField{id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}) + fields = append(fields, ieField{ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}) } if supportedTAList { - fields = append(fields, ieField{id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}) + fields = append(fields, ieField{ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}) } if pagingDRX { d := PagingDRXv128 - fields = append(fields, ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: d}) + fields = append(fields, ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: d}) } if err := encodeIEContainer(w, per.Aligned, fields); err != nil { @@ -263,8 +258,8 @@ func TestParseNGSetupRequestMissingMandatoryIE(t *testing.T) { t.Errorf("procedure = %d, want ProcNGSetup", ase.Procedure) } - want := Cause{Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject} - if ase.Cause != want { + want := CauseProtocolAbstractSyntaxErrorReject.Cause() + if !ase.Cause.Equal(want) { t.Errorf("cause = %v, want %v", ase.Cause, want) } diff --git a/ngap/not_comprehended_test.go b/ngap/not_comprehended_test.go index 9f160e1a69..5517cdb30e 100644 --- a/ngap/not_comprehended_test.go +++ b/ngap/not_comprehended_test.go @@ -4,23 +4,31 @@ package ngap import ( + "bytes" "errors" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // A CHOICE selecting its choice-Extensions alternative, carrying one entry. func choiceExtensionValue(t *testing.T, alternatives, index int, id ProtocolIEID) []byte { t.Helper() + return choiceExtensionValueCrit(t, alternatives, index, id, CriticalityReject) +} + +func choiceExtensionValueCrit(t *testing.T, alternatives, index int, id ProtocolIEID, crit Criticality) []byte { + t.Helper() + w := per.NewWriter() if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, int64(alternatives-1), int64(index)); err != nil { t.Fatal(err) } - if err := encodeContainerField(w, per.Aligned, ieField{ - id: id, crit: CriticalityReject, raw: []byte{0x00}, + if err := encodeContainerField(w, ieField{ + ID: id, Criticality: crit, Value: ap.RawValue([]byte{0x00}), }); err != nil { t.Fatal(err) } @@ -34,9 +42,9 @@ func TestChoiceExtensionOnRejectIEIsAbstractSyntaxError(t *testing.T) { // A TNGF, TWIF or W-AGF identifies itself through GlobalRANNodeID's // choice-Extensions, which this library does not model. value := container(t, ieField{ - id: IDGlobalRANNodeID, - crit: CriticalityReject, - raw: choiceExtensionValue(t, globalRANNodeIDAlternatives, globalRANNodeIDChoiceExtensions, IDGlobalRANNodeID), + ID: IDGlobalRANNodeID, + Criticality: CriticalityReject, + Value: ap.RawValue(choiceExtensionValue(t, globalRANNodeIDAlternatives, globalRANNodeIDChoiceExtensions, IDGlobalRANNodeID)), }) _, err := ParseNGSetupRequest(value) @@ -49,7 +57,7 @@ func TestChoiceExtensionOnRejectIEIsAbstractSyntaxError(t *testing.T) { t.Fatalf("error = %T (%v), want *AbstractSyntaxError so the reject is reported in NG SETUP FAILURE", err, err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorReject { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorReject.Cause()) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } @@ -59,41 +67,65 @@ func TestChoiceExtensionOnRejectIEIsAbstractSyntaxError(t *testing.T) { } } -// §10.3.4.2: ignore the content, report it, continue with the procedure. -func TestChoiceExtensionOnIgnoreIEIsIgnored(t *testing.T) { - // id-Cause is CRITICALITY ignore in NGResetIEs. - value := container(t, - ieField{ - id: IDCause, - crit: CriticalityIgnore, - raw: choiceExtensionValue(t, causeAlternatives, causeChoiceExtensions, IDCause), - }, - ieField{id: IDResetType, crit: CriticalityReject, val: ResetType{All: true}}, - ) +func TestChoiceExtensionInsideIgnoreIEIsJudgedOnItsOwnCriticality(t *testing.T) { + for _, crit := range []Criticality{CriticalityIgnore, CriticalityReject} { + value := container(t, + ieField{ + ID: IDCause, + Criticality: CriticalityIgnore, + Value: ap.RawValue(choiceExtensionValueCrit(t, causeAlternatives, causeChoiceExtensions, 9999, crit)), + }, + ieField{ID: IDResetType, Criticality: CriticalityReject, Value: &ResetType{NGInterface: Ptr(ResetAllResetAll)}}, + ) + + msg, err := ParseNGReset(value) + + if crit == CriticalityReject { + var ase *AbstractSyntaxError + if !errors.As(err, &ase) { + t.Fatalf("reject choice-Extensions: err = %v, want *AbstractSyntaxError", err) + } + + continue + } - msg, err := ParseNGReset(value) - if err != nil { - t.Fatalf("parse: %v, want the message delivered with the IE ignored", err) - } + if err != nil { + t.Fatalf("parse: %v, want the message delivered", err) + } - if msg.Cause != nil { - t.Errorf("Cause = %v, want nil (content ignored)", msg.Cause) - } + if msg.Cause == nil || msg.Cause.ChoiceExtension == nil || msg.Cause.ChoiceExtension.ID != 9999 { + t.Errorf("Cause = %+v, want the unknown choice-Extensions kept", msg.Cause) + } - if !msg.ResetType.All { - t.Error("ResetType lost, want the rest of the message still decoded") - } + if msg.ResetType.NGInterface == nil { + t.Error("ResetType lost, want the rest of the message still decoded") + } - var reported bool + var reported bool - for _, ie := range msg.Diagnostics().IEs { - if ie.ID == IDCause && ie.TypeOfError == TypeOfErrorNotUnderstood { - reported = true + for _, ie := range msg.Diagnostics().IEs { + if ie.ID == 9999 && ie.Criticality == CriticalityIgnore { + reported = true + } + } + + if !reported { + t.Errorf("unknown choice-Extensions IE missing from diagnostics: %+v", msg.Diagnostics().IEs) } - } - if !reported { - t.Errorf("not-comprehended Cause missing from diagnostics: %+v", msg.Diagnostics().IEs) + b, err := msg.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(pdu.value(), value) { + t.Errorf("re-encode = % x, want % x", pdu.value(), value) + } } } @@ -101,8 +133,8 @@ func TestChoiceExtensionOnIgnoreIEIsIgnored(t *testing.T) { // produce two entries, not just the first. func TestAllNotComprehendedRejectIEsAreReported(t *testing.T) { value := container(t, - ieField{id: ProtocolIEID(40001), crit: CriticalityReject, raw: []byte{0x00}}, - ieField{id: ProtocolIEID(40002), crit: CriticalityReject, raw: []byte{0x00}}, + ieField{ID: ProtocolIEID(40001), Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}, + ieField{ID: ProtocolIEID(40002), Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}, ) _, err := ParseNGSetupRequest(value) diff --git a/ngap/nrppa_transport.go b/ngap/nrppa_transport.go index 25b9846026..5569800972 100644 --- a/ngap/nrppa_transport.go +++ b/ngap/nrppa_transport.go @@ -65,19 +65,19 @@ func nrppaTransportIEs[M any]( ) []ieSpec[M] { return []ieSpec[M]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, amf(m)) }, - encode: func(m *M) (per.Marshaler, bool) { return amf(m), true }, + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, amf(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { return amf(m), true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, ran(m)) }, - encode: func(m *M) (per.Marshaler, bool) { return ran(m), true }, + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, ran(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { return ran(m), true }, }, { - id: IDRoutingID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, routing(m)) }, - encode: func(m *M) (per.Marshaler, bool) { + ID: IDRoutingID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, routing(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { if *routing(m) == nil { return nil, false } @@ -86,9 +86,9 @@ func nrppaTransportIEs[M any]( }, }, { - id: IDNRPPaPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, pdu(m)) }, - encode: func(m *M) (per.Marshaler, bool) { + ID: IDNRPPaPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, pdu(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { if *pdu(m) == nil { return nil, false } @@ -141,6 +141,10 @@ func ParseDownlinkUEAssociatedNRPPaTransport(value []byte) (*DownlinkUEAssociate return parseMessageBody[DownlinkUEAssociatedNRPPaTransport](ProcDownlinkUEAssociatedNRPPaTransport, TriggeringInitiatingMessage, downlinkUEAssociatedNRPPaTransportIEs, value) } +func DecodeDownlinkUEAssociatedNRPPaTransport(value []byte) (*DownlinkUEAssociatedNRPPaTransport, error) { + return decodeMessageBody[DownlinkUEAssociatedNRPPaTransport](ProcDownlinkUEAssociatedNRPPaTransport, downlinkUEAssociatedNRPPaTransportIEs, value) +} + // TS 38.413 §9.2.9.2. type UplinkUEAssociatedNRPPaTransport struct { AMFUENGAPID AMFUENGAPID @@ -171,6 +175,10 @@ func ParseUplinkUEAssociatedNRPPaTransport(value []byte) (*UplinkUEAssociatedNRP return parseMessageBody[UplinkUEAssociatedNRPPaTransport](ProcUplinkUEAssociatedNRPPaTransport, TriggeringInitiatingMessage, uplinkUEAssociatedNRPPaTransportIEs, value) } +func DecodeUplinkUEAssociatedNRPPaTransport(value []byte) (*UplinkUEAssociatedNRPPaTransport, error) { + return decodeMessageBody[UplinkUEAssociatedNRPPaTransport](ProcUplinkUEAssociatedNRPPaTransport, uplinkUEAssociatedNRPPaTransportIEs, value) +} + // The non-UE-associated pair carries only the routing id and the payload: with // no UE context, there are no UE NGAP IDs to name. func nonUEAssociatedNRPPaTransportIEs[M any]( @@ -179,9 +187,9 @@ func nonUEAssociatedNRPPaTransportIEs[M any]( ) []ieSpec[M] { return []ieSpec[M]{ { - id: IDRoutingID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, routing(m)) }, - encode: func(m *M) (per.Marshaler, bool) { + ID: IDRoutingID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, routing(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { if *routing(m) == nil { return nil, false } @@ -190,9 +198,9 @@ func nonUEAssociatedNRPPaTransportIEs[M any]( }, }, { - id: IDNRPPaPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, pdu(m)) }, - encode: func(m *M) (per.Marshaler, bool) { + ID: IDNRPPaPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, pdu(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { if *pdu(m) == nil { return nil, false } @@ -257,6 +265,10 @@ func ParseDownlinkNonUEAssociatedNRPPaTransport(value []byte) (*DownlinkNonUEAss return parseMessageBody[DownlinkNonUEAssociatedNRPPaTransport](ProcDownlinkNonUEAssociatedNRPPaTransport, TriggeringInitiatingMessage, downlinkNonUEAssociatedNRPPaTransportIEs, value) } +func DecodeDownlinkNonUEAssociatedNRPPaTransport(value []byte) (*DownlinkNonUEAssociatedNRPPaTransport, error) { + return decodeMessageBody[DownlinkNonUEAssociatedNRPPaTransport](ProcDownlinkNonUEAssociatedNRPPaTransport, downlinkNonUEAssociatedNRPPaTransportIEs, value) +} + func (m *UplinkNonUEAssociatedNRPPaTransport) Marshal() ([]byte, error) { w := per.NewWriter() @@ -276,3 +288,7 @@ func (m *UplinkNonUEAssociatedNRPPaTransport) Marshal() ([]byte, error) { func ParseUplinkNonUEAssociatedNRPPaTransport(value []byte) (*UplinkNonUEAssociatedNRPPaTransport, error) { return parseMessageBody[UplinkNonUEAssociatedNRPPaTransport](ProcUplinkNonUEAssociatedNRPPaTransport, TriggeringInitiatingMessage, uplinkNonUEAssociatedNRPPaTransportIEs, value) } + +func DecodeUplinkNonUEAssociatedNRPPaTransport(value []byte) (*UplinkNonUEAssociatedNRPPaTransport, error) { + return decodeMessageBody[UplinkNonUEAssociatedNRPPaTransport](ProcUplinkNonUEAssociatedNRPPaTransport, uplinkNonUEAssociatedNRPPaTransportIEs, value) +} diff --git a/ngap/overload.go b/ngap/overload.go index bc88b22d73..fb954a9569 100644 --- a/ngap/overload.go +++ b/ngap/overload.go @@ -4,8 +4,6 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -16,55 +14,11 @@ const ( OverloadActionRejectRRCCRSignalling OverloadActionPermitEmergencySessionsAndMTServicesOnly OverloadActionPermitHighPrioritySessionsAndMTServicesOnly - - overloadActionRootCount = 4 -) - -func (a OverloadAction) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, overloadActionRootCount, int64(a), "OverloadAction") -} - -func (a *OverloadAction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeRootEnumerated(r, enc, overloadActionRootCount, "OverloadAction") - if err != nil { - return err - } - - *a = OverloadAction(v) - - return nil -} - -const ( - overloadResponseOverloadAction = iota - overloadResponseChoiceExtensions - - overloadResponseAlternatives = 2 ) type OverloadResponse struct { - OverloadAction OverloadAction -} - -func (o OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, overloadResponseAlternatives-1, overloadResponseOverloadAction); err != nil { - return err - } - - return o.OverloadAction.MarshalPER(w, enc) -} - -func (o *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, overloadResponseAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: OverloadResponse choice: %w", err) - } - - if idx == overloadResponseChoiceExtensions { - return decodeChoiceExtension(r, enc, "OverloadResponse") - } - - return o.OverloadAction.UnmarshalPER(r, enc) + OverloadAction *OverloadAction `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` } const ( @@ -90,17 +44,17 @@ func (t *TrafficLoadReductionIndication) UnmarshalPER(r *per.Reader, enc per.Enc } type SliceOverloadItem struct { - _ [0]struct{} `per:"extseq"` - SNSSAI SNSSAI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + SNSSAI SNSSAI + iEExtensions extensionMeta `per:",exttable"` } type OverloadStartNSSAIItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` SliceOverloadList []SliceOverloadItem `per:"SEQUENCE-OF,size:1..1024"` SliceOverloadResponse *OverloadResponse `per:",optional"` SliceTrafficLoadReductionIndication *TrafficLoadReductionIndication `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type OverloadStartNSSAIList []OverloadStartNSSAIItem @@ -124,7 +78,7 @@ const maxnoofGUAMIs = 1024 type GUAMIListItem struct { GUAMI GUAMI - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -156,11 +110,11 @@ type OverloadStart struct { var overloadStartIEs = []ieSpec[OverloadStart]{ { - id: IDAMFOverloadResponse, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + ID: IDAMFOverloadResponse, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *OverloadStart, r *per.Reader, enc per.Encoding) error { var v OverloadResponse - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -168,7 +122,7 @@ var overloadStartIEs = []ieSpec[OverloadStart]{ return nil }, - encode: func(m *OverloadStart) (per.Marshaler, bool) { + Encode: func(m *OverloadStart) (per.Marshaler, bool) { if m.AMFOverloadResponse == nil { return nil, false } @@ -177,11 +131,11 @@ var overloadStartIEs = []ieSpec[OverloadStart]{ }, }, { - id: IDAMFTrafficLoadReductionIndication, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + ID: IDAMFTrafficLoadReductionIndication, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *OverloadStart, r *per.Reader, enc per.Encoding) error { var v TrafficLoadReductionIndication - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -189,7 +143,7 @@ var overloadStartIEs = []ieSpec[OverloadStart]{ return nil }, - encode: func(m *OverloadStart) (per.Marshaler, bool) { + Encode: func(m *OverloadStart) (per.Marshaler, bool) { if m.AMFTrafficLoadReductionIndication == nil { return nil, false } @@ -198,11 +152,11 @@ var overloadStartIEs = []ieSpec[OverloadStart]{ }, }, { - id: IDOverloadStartNSSAIList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.OverloadStartNSSAIList) + ID: IDOverloadStartNSSAIList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *OverloadStart, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.OverloadStartNSSAIList) }, - encode: func(m *OverloadStart) (per.Marshaler, bool) { + Encode: func(m *OverloadStart) (per.Marshaler, bool) { if len(m.OverloadStartNSSAIList) == 0 { return nil, false } @@ -211,11 +165,11 @@ var overloadStartIEs = []ieSpec[OverloadStart]{ }, }, { - id: IDGUAMIList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GUAMIList) + ID: IDGUAMIList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *OverloadStart, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GUAMIList) }, - encode: func(m *OverloadStart) (per.Marshaler, bool) { + Encode: func(m *OverloadStart) (per.Marshaler, bool) { if len(m.GUAMIList) == 0 { return nil, false } @@ -249,6 +203,10 @@ func ParseOverloadStart(value []byte) (*OverloadStart, error) { return parseMessageBody[OverloadStart](ProcOverloadStart, TriggeringInitiatingMessage, overloadStartIEs, value) } +func DecodeOverloadStart(value []byte) (*OverloadStart, error) { + return decodeMessageBody[OverloadStart](ProcOverloadStart, overloadStartIEs, value) +} + type OverloadStop struct { GUAMIList GUAMIList @@ -257,11 +215,11 @@ type OverloadStop struct { var overloadStopIEs = []ieSpec[OverloadStop]{ { - id: IDGUAMIList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *OverloadStop, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GUAMIList) + ID: IDGUAMIList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *OverloadStop, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GUAMIList) }, - encode: func(m *OverloadStop) (per.Marshaler, bool) { + Encode: func(m *OverloadStop) (per.Marshaler, bool) { if len(m.GUAMIList) == 0 { return nil, false } @@ -294,3 +252,7 @@ func (m *OverloadStop) Marshal() ([]byte, error) { func ParseOverloadStop(value []byte) (*OverloadStop, error) { return parseMessageBody[OverloadStop](ProcOverloadStop, TriggeringInitiatingMessage, overloadStopIEs, value) } + +func DecodeOverloadStop(value []byte) (*OverloadStop, error) { + return decodeMessageBody[OverloadStop](ProcOverloadStop, overloadStopIEs, value) +} diff --git a/ngap/paging.go b/ngap/paging.go index f5c3eb19c9..2af1cd51c9 100644 --- a/ngap/paging.go +++ b/ngap/paging.go @@ -4,22 +4,16 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" ) // maxnoofTAIforPaging bounds TAIListForPaging (TS 38.413, NGAP-Constants). const maxnoofTAIforPaging = 16 -// UEPagingIdentity alternatives (TS 38.413 §9.3.3.18). One identity, closed by -// a choice-Extensions alternative rather than an extension marker. -const ( - uePagingIdentityFiveGSTMSI = iota - uePagingIdentityChoiceExtensions - - uePagingIdentityAlternatives = 2 -) +type UEPagingIdentity struct { + FiveGSTMSI *FiveGSTMSI `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} // PagingPriority ::= ENUMERATED { priolevel1..priolevel8, ... } — §9.3.1.78. type PagingPriority uint8 @@ -33,8 +27,6 @@ const ( PagingPriorityLevel6 PagingPriorityLevel7 PagingPriorityLevel8 - - pagingPriorityRootCount = 8 ) // PagingOrigin ::= ENUMERATED { non-3gpp, ... } — §9.3.1.79. Present only for @@ -43,26 +35,42 @@ type PagingOrigin uint8 const ( PagingOriginNon3GPP PagingOrigin = iota - - pagingOriginRootCount = 1 ) -// taiListForPagingItem ::= SEQUENCE { tAI, iE-Extensions OPTIONAL } +// TAIListForPagingItem ::= SEQUENCE { tAI, iE-Extensions OPTIONAL } // (extensible). The TAI is TS 38.413 §9.3.3.11. -type taiListForPagingItem struct { - _ [0]struct{} `per:"extseq"` - TAI TAI - _ ieExtensions `per:",skip"` +type TAIListForPagingItem struct { + extensions per.ExtensionAdditions `per:",extraw"` + TAI TAI + iEExtensions extensionMeta `per:",exttable"` +} + +type TAIListForPaging []TAIListForPagingItem + +func (l TAIListForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforPaging, []TAIListForPagingItem(l)) +} + +func (l *TAIListForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAIListForPagingItem](r, enc, 1, maxnoofTAIforPaging) + if err != nil { + return err + } + + *l = items + + return nil } // UERadioCapabilityForPaging ::= SEQUENCE { // uERadioCapabilityForPagingOfNR OPTIONAL, uERadioCapabilityForPagingOfEUTRA // OPTIONAL, iE-Extensions OPTIONAL } (extensible) — §9.3.1.68. type UERadioCapabilityForPaging struct { - _ [0]struct{} `per:"extseq"` - NR *UERadioCapabilityForPagingOfNR `per:",optional"` - EUTRA *UERadioCapabilityForPagingOfEUTRA `per:",optional"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + NR *UERadioCapabilityForPagingOfNR `per:",optional"` + EUTRA *UERadioCapabilityForPagingOfEUTRA `per:",optional"` + NBIoT *UERadioCapabilityForPagingOfNBIoT `per:",extie:IDUERadioCapabilityForPagingOfNBIoT,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // UERadioCapabilityForPagingOfNR ::= OCTET STRING (unconstrained). @@ -101,63 +109,70 @@ func (c *UERadioCapabilityForPagingOfEUTRA) UnmarshalPER(r *per.Reader, enc per. return nil } +type UERadioCapabilityForPagingOfNBIoT []byte + +func (c UERadioCapabilityForPagingOfNBIoT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, c) +} + +func (c *UERadioCapabilityForPagingOfNBIoT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + *c = b + + return err +} + // TS 38.413 §9.2.4.1. Every IE is ignore criticality, so none is a value type. type Paging struct { - FiveGSTMSI *FiveGSTMSI - PagingDRX *PagingDRX - TAIListForPaging []TAI - PagingPriority *PagingPriority - UERadioCapabilityForPaging *UERadioCapabilityForPaging - PagingOrigin *PagingOrigin + UEPagingIdentity *UEPagingIdentity + PagingDRX *PagingDRX + TAIListForPaging TAIListForPaging + PagingPriority *PagingPriority + UERadioCapabilityForPaging *UERadioCapabilityForPaging + PagingOrigin *PagingOrigin + AssistanceDataForPaging *AssistanceDataForPaging + NBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo + NBIoTPagingDRX *NBIoTPagingDRX + EnhancedCoverageRestriction *EnhancedCoverageRestriction + WUSAssistanceInformation *WUSAssistanceInformation + EUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation + CEmodeBrestricted *CEmodeBrestricted + NRPagingeDRXInformation *NRPagingeDRXInformation + PagingCause *PagingCause + PEIPSassistanceInformation *PEIPSassistanceInformation + LPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation + LPWUSDisableIndication *LPWUSDisableIndication messageMeta } var pagingIEs = []ieSpec[Paging]{ { - id: IDUEPagingIdentity, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - sub := per.NewReader(raw) - - index, err := per.DecodeConstrainedWholeNumber(sub, enc, 0, uePagingIdentityAlternatives-1) - if err != nil { + ID: IDUEPagingIdentity, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + var v UEPagingIdentity + if err := v.UnmarshalPER(r, enc); err != nil { return err } - if index != uePagingIdentityFiveGSTMSI { - return decodeChoiceExtension(sub, enc, "UEPagingIdentity") - } - - var v FiveGSTMSI - if err := v.UnmarshalPER(sub, enc); err != nil { - return err - } - - m.FiveGSTMSI = &v + m.UEPagingIdentity = &v return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { - if m.FiveGSTMSI == nil { + Encode: func(m *Paging) (per.Marshaler, bool) { + if m.UEPagingIdentity == nil { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, - uePagingIdentityAlternatives-1, uePagingIdentityFiveGSTMSI); err != nil { - return err - } - - return m.FiveGSTMSI.MarshalPER(w, enc) - }), true + return m.UEPagingIdentity, true }, }, { - id: IDPagingDRX, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { + ID: IDPagingDRX, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { var drx PagingDRX - if err := perIEDecode(raw, &drx); err != nil { + if err := decodeIE(r, &drx); err != nil { return err } @@ -165,7 +180,7 @@ var pagingIEs = []ieSpec[Paging]{ return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if m.PagingDRX == nil { return nil, false } @@ -174,68 +189,44 @@ var pagingIEs = []ieSpec[Paging]{ }, }, { - id: IDTAIListForPaging, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - items, err := unmarshalSeqOf[taiListForPagingItem](per.NewReader(raw), enc, 1, maxnoofTAIforPaging) - if err != nil { - return err - } - - m.TAIListForPaging = make([]TAI, len(items)) - for i, it := range items { - m.TAIListForPaging[i] = it.TAI - } - - return nil + ID: IDTAIListForPaging, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + return m.TAIListForPaging.UnmarshalPER(r, enc) }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if len(m.TAIListForPaging) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - items := make([]taiListForPagingItem, len(m.TAIListForPaging)) - for i, tai := range m.TAIListForPaging { - items[i] = taiListForPagingItem{TAI: tai} - } - - return marshalSeqOf(w, enc, 1, maxnoofTAIforPaging, items) - }), true + return m.TAIListForPaging, true }, }, { - id: IDPagingPriority, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - v, err := decodeRootEnumerated(per.NewReader(raw), enc, pagingPriorityRootCount, "PagingPriority") - if err != nil { + ID: IDPagingPriority, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + var v PagingPriority + if err := v.UnmarshalPER(r, enc); err != nil { return err } - p := PagingPriority(v) - m.PagingPriority = &p + m.PagingPriority = &v return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if m.PagingPriority == nil { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - if int(*m.PagingPriority) >= pagingPriorityRootCount { - return fmt.Errorf("ngap: PagingPriority %d outside the root values", *m.PagingPriority) - } - - return encodeRootEnumerated(w, enc, pagingPriorityRootCount, int64(*m.PagingPriority), "PagingPriority") - }), true + return m.PagingPriority, true }, }, { - id: IDUERadioCapabilityForPaging, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { + ID: IDUERadioCapabilityForPaging, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { var v UERadioCapabilityForPaging - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -243,7 +234,7 @@ var pagingIEs = []ieSpec[Paging]{ return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if m.UERadioCapabilityForPaging == nil { return nil, false } @@ -252,32 +243,37 @@ var pagingIEs = []ieSpec[Paging]{ }, }, { - id: IDPagingOrigin, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - v, err := decodeRootEnumerated(per.NewReader(raw), enc, pagingOriginRootCount, "PagingOrigin") - if err != nil { + ID: IDPagingOrigin, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + var v PagingOrigin + if err := v.UnmarshalPER(r, enc); err != nil { return err } - o := PagingOrigin(v) - m.PagingOrigin = &o + m.PagingOrigin = &v return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if m.PagingOrigin == nil { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - if int(*m.PagingOrigin) >= pagingOriginRootCount { - return fmt.Errorf("ngap: PagingOrigin %d outside the root values", *m.PagingOrigin) - } - - return encodeRootEnumerated(w, enc, pagingOriginRootCount, int64(*m.PagingOrigin), "PagingOrigin") - }), true + return m.PagingOrigin, true }, }, + optionalExtension(IDAssistanceDataForPaging, CriticalityIgnore, func(m *Paging) **AssistanceDataForPaging { return &m.AssistanceDataForPaging }), + optionalExtension(IDNBIoTPagingeDRXInfo, CriticalityIgnore, func(m *Paging) **NBIoTPagingeDRXInfo { return &m.NBIoTPagingeDRXInfo }), + optionalExtension(IDNBIoTPagingDRX, CriticalityIgnore, func(m *Paging) **NBIoTPagingDRX { return &m.NBIoTPagingDRX }), + optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *Paging) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), + optionalExtension(IDWUSAssistanceInformation, CriticalityIgnore, func(m *Paging) **WUSAssistanceInformation { return &m.WUSAssistanceInformation }), + optionalExtension(IDEUTRAPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **EUTRAPagingeDRXInformation { return &m.EUTRAPagingeDRXInformation }), + optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *Paging) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + optionalExtension(IDNRPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **NRPagingeDRXInformation { return &m.NRPagingeDRXInformation }), + optionalExtension(IDPagingCause, CriticalityIgnore, func(m *Paging) **PagingCause { return &m.PagingCause }), + optionalExtension(IDPEIPSassistanceInformation, CriticalityIgnore, func(m *Paging) **PEIPSassistanceInformation { return &m.PEIPSassistanceInformation }), + optionalExtension(IDLPWUSPSAssistanceInformation, CriticalityIgnore, func(m *Paging) **LPWUSPSAssistanceInformation { return &m.LPWUSPSAssistanceInformation }), + optionalExtension(IDLPWUSDisableIndication, CriticalityIgnore, func(m *Paging) **LPWUSDisableIndication { return &m.LPWUSDisableIndication }), } func (m *Paging) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -303,3 +299,7 @@ func (m *Paging) Marshal() ([]byte, error) { func ParsePaging(value []byte) (*Paging, error) { return parseMessageBody[Paging](ProcPaging, TriggeringInitiatingMessage, pagingIEs, value) } + +func DecodePaging(value []byte) (*Paging, error) { + return decodeMessageBody[Paging](ProcPaging, pagingIEs, value) +} diff --git a/ngap/paging_test.go b/ngap/paging_test.go index f7236a9adb..dd29e82472 100644 --- a/ngap/paging_test.go +++ b/ngap/paging_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // Golden PAGING PDUs @@ -19,10 +20,10 @@ const ( func goldPagingMinimal() *Paging { return &Paging{ - FiveGSTMSI: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}, - TAIListForPaging: []TAI{ - {PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, - {PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 2}, + UEPagingIdentity: &UEPagingIdentity{FiveGSTMSI: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}}, + TAIListForPaging: TAIListForPaging{ + {TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}, + {TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 2}}, }, } } @@ -81,12 +82,12 @@ func TestPagingGoldenDecode(t *testing.T) { want := goldPagingFull() - if msg.FiveGSTMSI == nil || *msg.FiveGSTMSI != *want.FiveGSTMSI { - t.Errorf("FiveGSTMSI = %+v, want %+v", msg.FiveGSTMSI, want.FiveGSTMSI) + if msg.UEPagingIdentity == nil || !msg.UEPagingIdentity.Equal(*want.UEPagingIdentity) { + t.Errorf("UEPagingIdentity = %+v, want %+v", msg.UEPagingIdentity, want.UEPagingIdentity) } if len(msg.TAIListForPaging) != 2 || - msg.TAIListForPaging[0].TAC != 1 || msg.TAIListForPaging[1].TAC != 2 { + msg.TAIListForPaging[0].TAI.TAC != 1 || msg.TAIListForPaging[1].TAI.TAC != 2 { t.Fatalf("TAIListForPaging = %+v", msg.TAIListForPaging) } @@ -121,20 +122,20 @@ func TestPagingMissingMandatoryIEs(t *testing.T) { } msg, err := ParsePaging(container(t, - ieField{id: IDPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + ieField{ID: IDPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, )) if err != nil { t.Fatalf("parse: %v", err) } - if msg.FiveGSTMSI != nil || msg.TAIListForPaging != nil { + if msg.UEPagingIdentity != nil || msg.TAIListForPaging != nil { t.Errorf("absent IEs decoded to non-nil: %+v", msg) } var missing int for _, ie := range msg.Diagnostics().IEs { - if ie.TypeOfError == TypeOfErrorMissing && + if typeOfError(ie) == TypeOfErrorMissing && (ie.ID == IDUEPagingIdentity || ie.ID == IDTAIListForPaging) { missing++ } @@ -145,44 +146,98 @@ func TestPagingMissingMandatoryIEs(t *testing.T) { } } -// §9.3.3.18 closes UEPagingIdentity with a choice-Extensions alternative, so -// selecting it must error rather than yield a zero identity. -func TestUEPagingIdentityChoiceExtensionIsRejected(t *testing.T) { +func TestUEPagingIdentityChoiceExtensionIsPreserved(t *testing.T) { w := per.NewWriter() if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, uePagingIdentityAlternatives-1, uePagingIdentityChoiceExtensions); err != nil { t.Fatal(err) } - if err := encodeContainerField(w, per.Aligned, ieField{ - id: IDUEPagingIdentity, crit: CriticalityReject, raw: []byte{0x00}, + if err := encodeContainerField(w, ieField{ + ID: 9999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), }); err != nil { t.Fatal(err) } value := container(t, - ieField{id: IDUEPagingIdentity, crit: CriticalityIgnore, raw: perBytes(w)}, - ieField{id: IDTAIListForPaging, crit: CriticalityIgnore, val: per.MarshalerFunc( - func(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofTAIforPaging, []taiListForPagingItem{ - {TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}, - }) - })}, + ieField{ID: IDUEPagingIdentity, Criticality: CriticalityIgnore, Value: ap.RawValue(perBytes(w))}, + ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: &TAIListForPaging{ + {TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}, + }}, ) - // Ignore criticality, so §10.3.4.2 drops the content and carries on. msg, err := ParsePaging(value) if err != nil { t.Fatalf("parse: %v", err) } - if msg.FiveGSTMSI != nil { - t.Errorf("FiveGSTMSI = %+v, want nil for an unsupported alternative", msg.FiveGSTMSI) + if msg.UEPagingIdentity == nil || msg.UEPagingIdentity.ChoiceExtension == nil || msg.UEPagingIdentity.FiveGSTMSI != nil { + t.Errorf("UEPagingIdentity = %+v, want the raw choice-Extensions kept", msg.UEPagingIdentity) } if len(msg.TAIListForPaging) != 1 { t.Errorf("rest of the message lost: %+v", msg.TAIListForPaging) } + + b, err := msg.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(pdu.value(), value) { + t.Errorf("re-encode = % x, want % x", pdu.value(), value) + } +} + +func TestTAIListForPagingItemKeepsItemExtensions(t *testing.T) { + tai := TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 7} + item := TAIListForPagingItem{TAI: tai} + item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityIgnore, Value: []byte{0x01, 0x02}}) + + in := goldPagingMinimal() + in.TAIListForPaging = TAIListForPaging{item} + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + msg, err := ParsePaging(pdu.value()) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if len(msg.TAIListForPaging) != 1 || msg.TAIListForPaging[0].TAI != tai { + t.Fatalf("TAIListForPaging = %+v", msg.TAIListForPaging) + } + + unknown := msg.TAIListForPaging[0].iEExtensions.UnknownIEs() + if len(unknown) != 1 || unknown[0].ID != 9999 || !bytes.Equal(unknown[0].Value, []byte{0x01, 0x02}) { + t.Fatalf("item extensions = %+v, want the unknown IE kept", unknown) + } + + if !msg.TAIListForPaging.Equal(in.TAIListForPaging) { + t.Errorf("decoded list %+v, want %+v", msg.TAIListForPaging, in.TAIListForPaging) + } + + re, err := msg.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, b) { + t.Errorf("re-encode = % x, want % x", re, b) + } } // The list is SIZE(1..maxnoofTAIforPaging), so an empty one cannot be encoded @@ -195,9 +250,9 @@ func TestPagingTAIListBounds(t *testing.T) { t.Error("encoded a Paging with no TAI for paging") } - m.TAIListForPaging = make([]TAI, maxnoofTAIforPaging+1) + m.TAIListForPaging = make(TAIListForPaging, maxnoofTAIforPaging+1) for i := range m.TAIListForPaging { - m.TAIListForPaging[i] = TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(i)} + m.TAIListForPaging[i] = TAIListForPagingItem{TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(i)}} } _, err := m.Marshal() diff --git a/ngap/path_switch.go b/ngap/path_switch.go index 3688d522ab..fc99794b21 100644 --- a/ngap/path_switch.go +++ b/ngap/path_switch.go @@ -20,31 +20,34 @@ type PathSwitchRequest struct { PDUSessionResourceToBeSwitchedDLList PDUSessionResourceToBeSwitchedDLList PDUSessionResourceFailedToSetup PDUSessionResourceFailedToSetupListPSReq SourceAMFGUAMI *GUAMI + RRCResumeCause *RRCEstablishmentCause + RedCapIndication *RedCapIndication + ERedCapIndication *ERedCapIndication messageMeta } var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDSourceAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SourceAMFUENGAPID) + ID: IDSourceAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SourceAMFUENGAPID) }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.SourceAMFUENGAPID, true }, + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.SourceAMFUENGAPID, true }, }, { - id: IDUserLocationInformation, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var v UserLocationInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -52,7 +55,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return nil }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -61,11 +64,11 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ }, }, { - id: IDUESecurityCapabilities, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDUESecurityCapabilities, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var v UESecurityCapabilities - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -73,7 +76,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return nil }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.UESecurityCapabilities == nil { return nil, false } @@ -82,11 +85,11 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ }, }, { - id: IDPDUSessionResourceToBeSwitchedDLList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceToBeSwitchedDLList) + ID: IDPDUSessionResourceToBeSwitchedDLList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceToBeSwitchedDLList) }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.PDUSessionResourceToBeSwitchedDLList == nil { return nil, false } @@ -95,11 +98,11 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ }, }, { - id: IDPDUSessionResourceFailedToSetupListPSReq, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceFailedToSetup) + ID: IDPDUSessionResourceFailedToSetupListPSReq, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceFailedToSetup) }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.PDUSessionResourceFailedToSetup == nil { return nil, false } @@ -107,12 +110,15 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return m.PDUSessionResourceFailedToSetup, true }, }, + optionalExtension(IDRRCResumeCause, CriticalityIgnore, func(m *PathSwitchRequest) **RRCEstablishmentCause { return &m.RRCResumeCause }), + optionalExtension(IDRedCapIndication, CriticalityIgnore, func(m *PathSwitchRequest) **RedCapIndication { return &m.RedCapIndication }), + optionalExtension(IDERedCapIndication, CriticalityIgnore, func(m *PathSwitchRequest) **ERedCapIndication { return &m.ERedCapIndication }), { - id: IDSourceAMFGUAMI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDSourceAMFGUAMI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var v GUAMI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -120,7 +126,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return nil }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.SourceAMFGUAMI == nil { return nil, false } @@ -154,6 +160,10 @@ func ParsePathSwitchRequest(value []byte) (*PathSwitchRequest, error) { return parseMessageBody[PathSwitchRequest](ProcPathSwitchRequest, TriggeringInitiatingMessage, pathSwitchRequestIEs, value) } +func DecodePathSwitchRequest(value []byte) (*PathSwitchRequest, error) { + return decodeMessageBody[PathSwitchRequest](ProcPathSwitchRequest, pathSwitchRequestIEs, value) +} + // TS 38.413 §9.2.3.9. The AMF confirms the switch and hands the target the // {NH, NCC} pair for its next key derivation. TS 36.413 §9.1.5.9 carries a // UEAggregateMaximumBitRate NGAP does not, and NGAP carries an AllowedNSSAI @@ -166,21 +176,54 @@ type PathSwitchRequestAcknowledge struct { PDUSessionResourceSwitchedList PDUSessionResourceSwitchedList // Sessions the AMF could not switch, whose resources the NG-RAN node // releases (§8.4.4.2). - PDUSessionResourceReleased PDUSessionResourceReleasedListPSAck - AllowedNSSAI AllowedNSSAI - CriticalityDiagnostics *CriticalityDiagnostics - AMFUENGAPID2 *AMFUENGAPID + PDUSessionResourceReleased PDUSessionResourceReleasedListPSAck + AllowedNSSAI AllowedNSSAI + CriticalityDiagnostics *CriticalityDiagnostics + AMFUENGAPID2 *AMFUENGAPID + NewSecurityContextInd *NewSecurityContextInd + CoreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive + RRCInactiveTransitionReportRequest *RRCInactiveTransitionReportRequest + RedirectionVoiceFallback *RedirectionVoiceFallback + CNAssistedRANTuning *CNAssistedRANTuning + SRVCCOperationPossible *SRVCCOperationPossible + EnhancedCoverageRestriction *EnhancedCoverageRestriction + ExtendedConnectedTime *ExtendedConnectedTime + UEDifferentiationInfo *UEDifferentiationInfo + NRV2XServicesAuthorized *NRV2XServicesAuthorized + LTEV2XServicesAuthorized *LTEV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + LTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + CEmodeBrestricted *CEmodeBrestricted + UEUPCIoTSupport *UEUPCIoTSupport + UERadioCapabilityID *UERadioCapabilityID + ManagementBasedMDTPLMNList MDTPLMNList + TimeSyncAssistanceInfo *TimeSyncAssistanceInfo + FiveGProSeAuthorized *FiveGProSeAuthorized + FiveGProSeUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + FiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters + ManagementBasedMDTPLMNModificationList MDTPLMNModificationList + IABAuthorized *IABAuthorized + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + NRA2XServicesAuthorized *NRA2XServicesAuthorized + LTEA2XServicesAuthorized *LTEA2XServicesAuthorized + NRA2XUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + LTEA2XUEPC5AggregateMaximumBitRate *LTEUESidelinkAggregateMaximumBitrate + A2XPC5QoSParameters *A2XPC5QoSParameters + MobileIABAuthorized *MobileIABAuthorized + PartiallyAllowedNSSAI PartiallyAllowedNSSAI + SLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo messageMeta } var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -188,7 +231,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -197,11 +240,11 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -209,7 +252,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -218,11 +261,11 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDUESecurityCapabilities, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDUESecurityCapabilities, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v UESecurityCapabilities - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -230,7 +273,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.UESecurityCapabilities == nil { return nil, false } @@ -239,18 +282,19 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDSecurityContext, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SecurityContext) + ID: IDSecurityContext, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SecurityContext) }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return &m.SecurityContext, true }, + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return &m.SecurityContext, true }, }, + optionalExtension(IDNewSecurityContextInd, CriticalityReject, func(m *PathSwitchRequestAcknowledge) **NewSecurityContextInd { return &m.NewSecurityContextInd }), { - id: IDPDUSessionResourceSwitchedList, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceSwitchedList) + ID: IDPDUSessionResourceSwitchedList, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceSwitchedList) }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.PDUSessionResourceSwitchedList == nil { return nil, false } @@ -259,11 +303,11 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDPDUSessionResourceReleasedListPSAck, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceReleased) + ID: IDPDUSessionResourceReleasedListPSAck, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceReleased) }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.PDUSessionResourceReleased == nil { return nil, false } @@ -272,11 +316,11 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDAllowedNSSAI, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AllowedNSSAI) + ID: IDAllowedNSSAI, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AllowedNSSAI) }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.AllowedNSSAI == nil { return nil, false } @@ -284,12 +328,18 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.AllowedNSSAI, true }, }, + optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CoreNetworkAssistanceInformationForInactive { + return &m.CoreNetworkAssistanceInformationForInactive + }), + optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **RRCInactiveTransitionReportRequest { + return &m.RRCInactiveTransitionReportRequest + }), { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -297,7 +347,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -305,12 +355,62 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.CriticalityDiagnostics, true }, }, + optionalExtension(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), + optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **EnhancedCoverageRestriction { + return &m.EnhancedCoverageRestriction + }), + optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **PC5QoSParameters { return &m.PC5QoSParameters }), + optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + optionalExtension(IDUEUPCIoTSupport, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), + optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *PathSwitchRequestAcknowledge) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + listExtension(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { + return &m.FiveGProSeUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **FiveGProSePC5QoSParameters { + return &m.FiveGProSePC5QoSParameters + }), + listExtension(IDManagementBasedMDTPLMNModificationList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *MDTPLMNModificationList { + return &m.ManagementBasedMDTPLMNModificationList + }), + optionalExtension(IDIABAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **IABAuthorized { return &m.IABAuthorized }), + optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **AerialUEsubscriptionInformation { + return &m.AerialUEsubscriptionInformation + }), + optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **SLPositioningRangingServiceInfo { + return &m.SLPositioningRangingServiceInfo + }), { - id: IDAMFUENGAPID2, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID2, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -318,7 +418,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.AMFUENGAPID2 == nil { return nil, false } @@ -352,6 +452,10 @@ func ParsePathSwitchRequestAcknowledge(value []byte) (*PathSwitchRequestAcknowle return parseMessageBody[PathSwitchRequestAcknowledge](ProcPathSwitchRequest, TriggeringSuccessfulOutcome, pathSwitchRequestAcknowledgeIEs, value) } +func DecodePathSwitchRequestAcknowledge(value []byte) (*PathSwitchRequestAcknowledge, error) { + return decodeMessageBody[PathSwitchRequestAcknowledge](ProcPathSwitchRequest, pathSwitchRequestAcknowledgeIEs, value) +} + // TS 38.413 §9.2.3.10. The AMF refuses the switch. Where TS 36.413 §9.1.5.10 // names one Cause for the whole message, NGAP reports per session: every // session in the request is released, each with its own cause inside a @@ -367,11 +471,11 @@ type PathSwitchRequestFailure struct { var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -379,7 +483,7 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ return nil }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -388,11 +492,11 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -400,7 +504,7 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ return nil }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -409,11 +513,11 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ }, }, { - id: IDPDUSessionResourceReleasedListPSFail, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceReleased) + ID: IDPDUSessionResourceReleasedListPSFail, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceReleased) }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.PDUSessionResourceReleased == nil { return nil, false } @@ -422,11 +526,11 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -434,7 +538,7 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ return nil }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -467,3 +571,7 @@ func (m *PathSwitchRequestFailure) Marshal() ([]byte, error) { func ParsePathSwitchRequestFailure(value []byte) (*PathSwitchRequestFailure, error) { return parseMessageBody[PathSwitchRequestFailure](ProcPathSwitchRequest, TriggeringUnsuccessfulOutcome, pathSwitchRequestFailureIEs, value) } + +func DecodePathSwitchRequestFailure(value []byte) (*PathSwitchRequestFailure, error) { + return decodeMessageBody[PathSwitchRequestFailure](ProcPathSwitchRequest, pathSwitchRequestFailureIEs, value) +} diff --git a/ngap/path_switch_test.go b/ngap/path_switch_test.go index 24cf9511ed..4bd55e1a77 100644 --- a/ngap/path_switch_test.go +++ b/ngap/path_switch_test.go @@ -10,12 +10,7 @@ import ( ) func pathSwitchULI() UserLocationInformation { - return UserLocationInformation{ - Kind: UserLocationNR, - PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, - CellIdentity: 1, - TAI: TAI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, TAC: 1}, - } + return UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, NRCellIdentity: NRCellIdentity(1)}, TAI: TAI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, TAC: 1}}} } const goldenPathSwitchRequest = "001900430000050055000200020064000200010079400f4002f839000000001002" + @@ -23,8 +18,8 @@ const goldenPathSwitchRequest = "001900430000050055000200020064000200010079400f4 func TestPathSwitchRequestGolden(t *testing.T) { transfer, err := (&PathSwitchRequestTransfer{ - DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, QosFlowAccepted: QosFlowAcceptedList{{QosFlowIdentifier: 1}}, }).Marshal() @@ -33,7 +28,7 @@ func TestPathSwitchRequestGolden(t *testing.T) { } uli := pathSwitchULI() - caps := UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000} + caps := UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)} in := PathSwitchRequest{ RANUENGAPID: 2, SourceAMFUENGAPID: 1, @@ -67,7 +62,7 @@ func TestPathSwitchRequestGolden(t *testing.T) { } if out.RANUENGAPID != 2 || out.SourceAMFUENGAPID != 1 || - out.UserLocationInformation == nil || out.UserLocationInformation.TAI.TAC != 1 || + out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || out.UserLocationInformation.NR.TAI.TAC != 1 || len(out.PDUSessionResourceToBeSwitchedDLList) != 1 || out.PDUSessionResourceToBeSwitchedDLList[0].PDUSessionID != 5 { t.Fatalf("round trip %+v", out) } @@ -132,7 +127,7 @@ const goldenPathSwitchRequestFailure = "40190019000003000a4002000100554002000200 // PathSwitchRequestUnsuccessfulTransfer. func TestPathSwitchRequestFailureGolden(t *testing.T) { transfer, err := (&PathSwitchRequestUnsuccessfulTransfer{ - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnknownPDUSessionID}, + Cause: CauseRadioNetworkUnknownPDUSessionID.Cause(), }).Marshal() if err != nil { t.Fatal(err) @@ -178,7 +173,7 @@ func TestPathSwitchRequestFailureGolden(t *testing.T) { t.Fatal(err) } - if released.Cause.Group != CauseGroupRadioNetwork || released.Cause.Value != CauseRadioNetworkUnknownPDUSessionID { + if !released.Cause.Equal(CauseRadioNetworkUnknownPDUSessionID.Cause()) { t.Errorf("nested cause %+v", released.Cause) } } @@ -224,8 +219,8 @@ func TestPathSwitchRequestAcknowledgeRefusesMissingMandatoryIEs(t *testing.T) { // decode still collected. func TestPathSwitchSessionsSurviveRejection(t *testing.T) { transfer, err := (&PathSwitchRequestTransfer{ - DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, QosFlowAccepted: QosFlowAcceptedList{{QosFlowIdentifier: 1}}, }).Marshal() @@ -234,15 +229,15 @@ func TestPathSwitchSessionsSurviveRejection(t *testing.T) { } uli := pathSwitchULI() - caps := UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000} + caps := UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)} sessions := PDUSessionResourceToBeSwitchedDLList{{PDUSessionID: 5, Transfer: transfer}} fields := []ieField{ - {id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(2)}, - {id: IDSourceAMFUENGAPID, crit: CriticalityReject, val: AMFUENGAPID(1)}, - {id: IDUserLocationInformation, crit: CriticalityIgnore, val: &uli}, - {id: IDUESecurityCapabilities, crit: CriticalityIgnore, val: &caps}, - {id: IDPDUSessionResourceToBeSwitchedDLList, crit: CriticalityReject, val: sessions}, + {ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(2)}, + {ID: IDSourceAMFUENGAPID, Criticality: CriticalityReject, Value: AMFUENGAPID(1)}, + {ID: IDUserLocationInformation, Criticality: CriticalityIgnore, Value: &uli}, + {ID: IDUESecurityCapabilities, Criticality: CriticalityIgnore, Value: &caps}, + {ID: IDPDUSessionResourceToBeSwitchedDLList, Criticality: CriticalityReject, Value: sessions}, } // §10.3.6: the same IE twice is a falsely constructed message. @@ -272,9 +267,9 @@ func TestPathSwitchSessionsAbsent(t *testing.T) { uli := pathSwitchULI() value := container(t, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: RANUENGAPID(2)}, - ieField{id: IDSourceAMFUENGAPID, crit: CriticalityReject, val: AMFUENGAPID(1)}, - ieField{id: IDUserLocationInformation, crit: CriticalityIgnore, val: &uli}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: RANUENGAPID(2)}, + ieField{ID: IDSourceAMFUENGAPID, Criticality: CriticalityReject, Value: AMFUENGAPID(1)}, + ieField{ID: IDUserLocationInformation, Criticality: CriticalityIgnore, Value: &uli}, ) _, err := ParsePathSwitchRequest(value) @@ -307,7 +302,7 @@ func pathSwitchRequestAcknowledgeWireCases(t *testing.T) []wireCase { return []wireCase{{ name: "PathSwitchRequestAcknowledgeAMFUENGAPID2AfterUnmodeledIE", - pdu: insertRawIEs(t, marshalT(t, m), 5, rawRedirectionVoiceFallback()), + pdu: insertRawIEs(t, marshalT(t, m), 5, rawUnknownIE(40001, 0x00)), parse: func(v []byte) (any, error) { return ParsePathSwitchRequestAcknowledge(v) }, check: func(t *testing.T, a any) { t.Helper() diff --git a/ngap/pdu.go b/ngap/pdu.go index a5f5cbc886..aec76811a3 100644 --- a/ngap/pdu.go +++ b/ngap/pdu.go @@ -4,9 +4,10 @@ package ngap import ( + "bytes" "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // NGAP-PDU CHOICE root alternatives (TS 38.413), in declaration order. @@ -14,8 +15,6 @@ const ( pduInitiatingMessage = iota pduSuccessfulOutcome pduUnsuccessfulOutcome - - pduRootCount = 3 ) // PDU is the top-level NGAP-PDU CHOICE: one of [InitiatingMessage], @@ -59,6 +58,18 @@ func (m *UnsuccessfulOutcome) criticality() Criticality { return m.Criticali func (m *UnsuccessfulOutcome) value() []byte { return m.Value } func (m *UnsuccessfulOutcome) choiceIndex() int { return pduUnsuccessfulOutcome } +func (m InitiatingMessage) Equal(o InitiatingMessage) bool { + return m.ProcedureCode == o.ProcedureCode && m.Criticality == o.Criticality && bytes.Equal(m.Value, o.Value) +} + +func (m SuccessfulOutcome) Equal(o SuccessfulOutcome) bool { + return m.ProcedureCode == o.ProcedureCode && m.Criticality == o.Criticality && bytes.Equal(m.Value, o.Value) +} + +func (m UnsuccessfulOutcome) Equal(o UnsuccessfulOutcome) bool { + return m.ProcedureCode == o.ProcedureCode && m.Criticality == o.Criticality && bytes.Equal(m.Value, o.Value) +} + // Each alternative is a non-extensible SEQUENCE with no optional fields, so it // carries no preamble; value is wrapped as an open type. func Marshal(pdu PDU) ([]byte, error) { @@ -66,84 +77,29 @@ func Marshal(pdu PDU) ([]byte, error) { return nil, fmt.Errorf("ngap: nil PDU") } - w := per.NewWriter() - enc := per.Aligned - - w.WriteBit(false) - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, pduRootCount-1, int64(pdu.choiceIndex())); err != nil { - return nil, err - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 255, int64(pdu.procedureCode())); err != nil { - return nil, err - } - - if err := per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(pdu.criticality())); err != nil { - return nil, err - } - - if err := per.EncodeOpenTypeBytes(w, enc, pdu.value()); err != nil { - return nil, err - } - - w.AlignToByte() - - return w.Bytes(), nil + return profile.EncodePDU(ap.Envelope{ + Choice: pdu.choiceIndex(), + ProcedureCode: uint8(pdu.procedureCode()), + Criticality: pdu.criticality(), + Value: pdu.value(), + }) } // The open-type payload is left in Value for the message layer. func Unmarshal(b []byte) (PDU, error) { - r := per.NewReader(b) - - isExt, err := r.ReadBit() - if err != nil { - return nil, fmt.Errorf("ngap: PDU choice: %w", err) - } - - if isExt { - return nil, fmt.Errorf("ngap: unsupported NGAP-PDU extension alternative") - } - - idx, err := per.DecodeConstrainedWholeNumber(r, per.Aligned, 0, pduRootCount-1) - if err != nil { - return nil, fmt.Errorf("ngap: PDU choice: %w", err) - } - - pc, crit, val, err := decodeMessageFields(r) + e, err := profile.DecodePDU(b) if err != nil { return nil, err } - switch idx { + pc := ProcedureCode(e.ProcedureCode) + + switch e.Choice { case pduInitiatingMessage: - return &InitiatingMessage{ProcedureCode: pc, Criticality: crit, Value: val}, nil + return &InitiatingMessage{ProcedureCode: pc, Criticality: e.Criticality, Value: e.Value}, nil case pduSuccessfulOutcome: - return &SuccessfulOutcome{ProcedureCode: pc, Criticality: crit, Value: val}, nil - case pduUnsuccessfulOutcome: - return &UnsuccessfulOutcome{ProcedureCode: pc, Criticality: crit, Value: val}, nil + return &SuccessfulOutcome{ProcedureCode: pc, Criticality: e.Criticality, Value: e.Value}, nil default: - return nil, fmt.Errorf("ngap: unreachable PDU index %d", idx) - } -} - -func decodeMessageFields(r *per.Reader) (ProcedureCode, Criticality, []byte, error) { - enc := per.Aligned - - pc, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 255) - if err != nil { - return 0, 0, nil, fmt.Errorf("ngap: procedureCode: %w", err) + return &UnsuccessfulOutcome{ProcedureCode: pc, Criticality: e.Criticality, Value: e.Value}, nil } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return 0, 0, nil, fmt.Errorf("ngap: criticality: %w", err) - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return 0, 0, nil, fmt.Errorf("ngap: value: %w", err) - } - - return ProcedureCode(pc), Criticality(crit), val, nil } diff --git a/ngap/pdu_session_resource_modify.go b/ngap/pdu_session_resource_modify.go index 2732793c39..c87b9813c7 100644 --- a/ngap/pdu_session_resource_modify.go +++ b/ngap/pdu_session_resource_modify.go @@ -11,18 +11,13 @@ import ( // OPTIONAL, pDUSessionResourceModifyRequestTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceModifyItemModReq struct { - PDUSessionID PDUSessionID - NASPDU *NASPDU `per:",optional"` - Transfer TransferContainer - SNSSAI *SNSSAI `per:"-"` - iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyItemModReqExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var pDUSessionResourceModifyItemModReqExtIEs = []ieSpec[PDUSessionResourceModifyItemModReq]{ - optionalExtension(IDSNSSAI, CriticalityReject, func(m *PDUSessionResourceModifyItemModReq) **SNSSAI { - return &m.SNSSAI - }), + PDUSessionID PDUSessionID + NASPDU *NASPDU `per:",optional"` + Transfer TransferContainer + SNSSAI *SNSSAI `per:",extie:IDSNSSAI,crit:reject"` + PduSessionExpectedUEActivityBehaviour *ExpectedUEActivityBehaviour `per:",extie:IDPduSessionExpectedUEActivityBehaviour,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceModifyListModReq ::= SEQUENCE @@ -35,7 +30,7 @@ type PDUSessionResourceModifyListModReq []PDUSessionResourceModifyItemModReq type PDUSessionResourceModifyItemModRes struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -47,10 +42,10 @@ type PDUSessionResourceModifyListModRes []PDUSessionResourceModifyItemModRes // pDUSessionResourceModifyUnsuccessfulTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceFailedToModifyItemModRes struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceFailedToModifyListModRes ::= SEQUENCE @@ -62,31 +57,33 @@ type PDUSessionResourceModifyRequest struct { AMFUENGAPID AMFUENGAPID RANUENGAPID RANUENGAPID PDUSessionResourceModify PDUSessionResourceModifyListModReq + RANPagingPriority *RANPagingPriority messageMeta } var pDUSessionResourceModifyRequestIEs = []ieSpec[PDUSessionResourceModifyRequest]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *PDUSessionResourceModifyRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *PDUSessionResourceModifyRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *PDUSessionResourceModifyRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *PDUSessionResourceModifyRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, + optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceModifyRequest) **RANPagingPriority { return &m.RANPagingPriority }), { - id: IDPDUSessionResourceModifyListModReq, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceModify) + ID: IDPDUSessionResourceModifyListModReq, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceModify) }, - encode: func(m *PDUSessionResourceModifyRequest) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyRequest) (per.Marshaler, bool) { if m.PDUSessionResourceModify == nil { return nil, false } @@ -120,6 +117,10 @@ func ParsePDUSessionResourceModifyRequest(value []byte) (*PDUSessionResourceModi return parseMessageBody[PDUSessionResourceModifyRequest](ProcPDUSessionResourceModify, TriggeringInitiatingMessage, pDUSessionResourceModifyRequestIEs, value) } +func DecodePDUSessionResourceModifyRequest(value []byte) (*PDUSessionResourceModifyRequest, error) { + return decodeMessageBody[PDUSessionResourceModifyRequest](ProcPDUSessionResourceModify, pDUSessionResourceModifyRequestIEs, value) +} + // TS 38.413 §9.2.1.6. type PDUSessionResourceModifyResponse struct { AMFUENGAPID *AMFUENGAPID @@ -134,11 +135,11 @@ type PDUSessionResourceModifyResponse struct { var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyResponse]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyResponse, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -146,7 +147,7 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo return nil }, - encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -155,11 +156,11 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyResponse, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -167,7 +168,7 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo return nil }, - encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -176,11 +177,11 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo }, }, { - id: IDPDUSessionResourceModifyListModRes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceModify) + ID: IDPDUSessionResourceModifyListModRes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceModify) }, - encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { if m.PDUSessionResourceModify == nil { return nil, false } @@ -189,11 +190,11 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo }, }, { - id: IDPDUSessionResourceFailedToModifyListModRes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceFailed) + ID: IDPDUSessionResourceFailedToModifyListModRes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceFailed) }, - encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { if m.PDUSessionResourceFailed == nil { return nil, false } @@ -202,11 +203,11 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyResponse, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -214,7 +215,7 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo return nil }, - encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -223,11 +224,11 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -235,7 +236,7 @@ var pDUSessionResourceModifyResponseIEs = []ieSpec[PDUSessionResourceModifyRespo return nil }, - encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -269,6 +270,10 @@ func ParsePDUSessionResourceModifyResponse(value []byte) (*PDUSessionResourceMod return parseMessageBody[PDUSessionResourceModifyResponse](ProcPDUSessionResourceModify, TriggeringSuccessfulOutcome, pDUSessionResourceModifyResponseIEs, value) } +func DecodePDUSessionResourceModifyResponse(value []byte) (*PDUSessionResourceModifyResponse, error) { + return decodeMessageBody[PDUSessionResourceModifyResponse](ProcPDUSessionResourceModify, pDUSessionResourceModifyResponseIEs, value) +} + // PDUSessionResourceModifyRequestTransfer ::= SEQUENCE { protocolIEs // ProtocolIE-Container } (extensible) — TS 38.413 §9.3.4.3. An IE container // like the setup request transfer. Every IE is optional: a modify carries only @@ -284,17 +289,22 @@ type PDUSessionResourceModifyRequestTransfer struct { AdditionalRedundantULNGUUPTNLInformation UPTransportLayerInformationList RedundantULNGUUPTNLInformation *UPTransportLayerInformation UserPlaneFailureIndication *UserPlaneFailureIndication + CommonNetworkInstance CommonNetworkInstance + RedundantCommonNetworkInstance CommonNetworkInstance + SecurityIndication *SecurityIndication + MBSSessionSetuporModifyRequestList MBSSessionSetuporModifyRequestList + MBSSessionToReleaseList MBSSessionToReleaseList messageMeta } var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModifyRequestTransfer]{ { - id: IDPDUSessionAggregateMaximumBitRate, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequestTransfer, raw []byte, enc per.Encoding) error { + ID: IDPDUSessionAggregateMaximumBitRate, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequestTransfer, r *per.Reader, enc per.Encoding) error { var v PDUSessionAggregateMaximumBitRate - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -302,7 +312,7 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi return nil }, - encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { if m.PDUSessionAggregateMaximumBitRate == nil { return nil, false } @@ -311,11 +321,11 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi }, }, { - id: IDULNGUUPTNLModifyList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ULNGUUPTNLModify) + ID: IDULNGUUPTNLModifyList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ULNGUUPTNLModify) }, - encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { if m.ULNGUUPTNLModify == nil { return nil, false } @@ -324,11 +334,11 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi }, }, { - id: IDNetworkInstance, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequestTransfer, raw []byte, enc per.Encoding) error { + ID: IDNetworkInstance, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequestTransfer, r *per.Reader, enc per.Encoding) error { var v NetworkInstance - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -336,7 +346,7 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi return nil }, - encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { if m.NetworkInstance == nil { return nil, false } @@ -345,11 +355,11 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi }, }, { - id: IDQosFlowAddOrModifyRequestList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.QosFlowAddOrModifyRequest) + ID: IDQosFlowAddOrModifyRequestList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.QosFlowAddOrModifyRequest) }, - encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { if m.QosFlowAddOrModifyRequest == nil { return nil, false } @@ -358,11 +368,11 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi }, }, { - id: IDQosFlowToReleaseList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.QosFlowToRelease) + ID: IDQosFlowToReleaseList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.QosFlowToRelease) }, - encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { if m.QosFlowToRelease == nil { return nil, false } @@ -371,11 +381,11 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi }, }, { - id: IDAdditionalULNGUUPTNLInformation, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AdditionalULNGUUPTNLInformation) + ID: IDAdditionalULNGUUPTNLInformation, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AdditionalULNGUUPTNLInformation) }, - encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyRequestTransfer) (per.Marshaler, bool) { if m.AdditionalULNGUUPTNLInformation == nil { return nil, false } @@ -383,12 +393,25 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi return m.AdditionalULNGUUPTNLInformation, true }, }, + listExtension(IDCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *CommonNetworkInstance { + return &m.CommonNetworkInstance + }), listExtension(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *UPTransportLayerInformationList { return &m.AdditionalRedundantULNGUUPTNLInformation }), + listExtension(IDRedundantCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *CommonNetworkInstance { + return &m.RedundantCommonNetworkInstance + }), optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UPTransportLayerInformation { return &m.RedundantULNGUUPTNLInformation }), + optionalExtension(IDSecurityIndication, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **SecurityIndication { return &m.SecurityIndication }), + listExtension(IDMBSSessionSetuporModifyRequestList, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *MBSSessionSetuporModifyRequestList { + return &m.MBSSessionSetuporModifyRequestList + }), + listExtension(IDMBSSessionToReleaseList, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *MBSSessionToReleaseList { + return &m.MBSSessionToReleaseList + }), optionalExtension(IDUserPlaneFailureIndication, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UserPlaneFailureIndication { return &m.UserPlaneFailureIndication }), @@ -410,23 +433,25 @@ func (t *PDUSessionResourceModifyRequestTransfer) Marshal() (TransferContainer, // ParsePDUSessionResourceModifyRequestTransfer decodes the transfer the SMF // sends for a session the NG-RAN node is to modify. func ParsePDUSessionResourceModifyRequestTransfer(b TransferContainer) (*PDUSessionResourceModifyRequestTransfer, error) { - return parseBoundedMessageBody[PDUSessionResourceModifyRequestTransfer](ProcPDUSessionResourceModify, TriggeringInitiatingMessage, pDUSessionResourceModifyRequestTransferIEs, b, maxProtocolIEs) + return parseMessageBody[PDUSessionResourceModifyRequestTransfer](ProcPDUSessionResourceModify, TriggeringInitiatingMessage, pDUSessionResourceModifyRequestTransferIEs, b) +} + +func DecodePDUSessionResourceModifyRequestTransfer(b TransferContainer) (*PDUSessionResourceModifyRequestTransfer, error) { + return decodeMessageBody[PDUSessionResourceModifyRequestTransfer](ProcPDUSessionResourceModify, pDUSessionResourceModifyRequestTransferIEs, b) } // QosFlowAddOrModifyResponseItem ::= SEQUENCE { qosFlowIdentifier, // iE-Extensions OPTIONAL } (extensible), an inline type of the TS 38.413 // §9.3.4.4 table. type QosFlowAddOrModifyResponseItem struct { - QosFlowIdentifier QosFlowIdentifier - DLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - iEExtensions messageMeta `per:",exttable:qosFlowAddOrModifyResponseItemExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var qosFlowAddOrModifyResponseItemExtIEs = []ieSpec[QosFlowAddOrModifyResponseItem]{ - optionalExtension(IDDLNGUUPTNLInformation, CriticalityIgnore, func(m *QosFlowAddOrModifyResponseItem) **UPTransportLayerInformation { - return &m.DLNGUUPTNLInformation - }), + QosFlowIdentifier QosFlowIdentifier + CurrentQoSParaSetIndex *AlternativeQoSParaSetIndex `per:",extie:IDCurrentQoSParaSetIndex,crit:ignore"` + TSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback `per:",extie:IDTSCTrafficCharacteristicsFeedback,crit:ignore"` + UplinkTLContainer *TLContainer `per:",extie:IDUplinkTLContainer,crit:ignore"` + DLNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDDLNGUUPTNLInformation,crit:ignore"` + ANPacketDelayBudgetUL *ExtendedPacketDelayBudget `per:",extie:IDANPacketDelayBudgetUL,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // QosFlowAddOrModifyResponseList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF @@ -440,36 +465,25 @@ type QosFlowAddOrModifyResponseList []QosFlowAddOrModifyResponseItem // (extensible) — TS 38.413 §9.3.4.4. Every field is optional: an NG-RAN node // that accepted a modification without changing a tunnel sends it empty. type PDUSessionResourceModifyResponseTransfer struct { - DLNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` - ULNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` - QosFlowAddOrModifyResponse QosFlowAddOrModifyResponseList `per:",optional"` - AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` - QosFlowFailedToAddOrModify QosFlowListWithCause `per:",optional"` - AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` - RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` - AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` - iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyResponseTransferExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var pDUSessionResourceModifyResponseTransferExtIEs = []ieSpec[PDUSessionResourceModifyResponseTransfer]{ - listExtension(IDAdditionalNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) *UPTransportLayerInformationPairList { - return &m.AdditionalNGUUPTNLInformation - }), - optionalExtension(IDRedundantDLNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) **UPTransportLayerInformation { - return &m.RedundantDLNGUUPTNLInformation - }), - optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) **UPTransportLayerInformation { - return &m.RedundantULNGUUPTNLInformation - }), - listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) *QosFlowPerTNLInformationList { - return &m.AdditionalRedundantDLQosFlowPerTNLInformation - }), - listExtension(IDAdditionalRedundantNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyResponseTransfer) *UPTransportLayerInformationPairList { - return &m.AdditionalRedundantNGUUPTNLInformation - }), + DLNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` + ULNGUUPTNLInformation *UPTransportLayerInformation `per:",optional"` + QosFlowAddOrModifyResponse QosFlowAddOrModifyResponseList `per:",optional"` + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` + QosFlowFailedToAddOrModify QosFlowListWithCause `per:",optional"` + AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:",extie:IDAdditionalNGUUPTNLInformation,crit:ignore"` + RedundantDLNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantDLNGUUPTNLInformation,crit:ignore"` + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantULNGUUPTNLInformation,crit:ignore"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",extie:IDAdditionalRedundantDLQosFlowPerTNLInformation,crit:ignore"` + AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:",extie:IDAdditionalRedundantNGUUPTNLInformation,crit:ignore"` + SecondaryRATUsageInformation *SecondaryRATUsageInformation `per:",extie:IDSecondaryRATUsageInformation,crit:ignore"` + MBSSupportIndicator *MBSSupportIndicator `per:",extie:IDMBSSupportIndicator,crit:ignore"` + MBSSessionSetuporModifyResponseList MBSSessionSetupResponseList `per:",extie:IDMBSSessionSetuporModifyResponseList,crit:ignore"` + MBSSessionFailedtoSetuporModifyList MBSSessionFailedtoSetupList `per:",extie:IDMBSSessionFailedtoSetuporModifyList,crit:ignore"` + ECNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus `per:",extie:IDECNMarkingorCongestionInformationReportingStatus,crit:ignore"` + PDUSetbasedHandlingIndicator *PDUSetbasedHandlingIndicator `per:",extie:IDPDUSetbasedHandlingIndicator,crit:ignore"` + UserPlaneFailureIndicationReport *UserPlaneFailureIndicationReport `per:",extie:IDUserPlaneFailureIndicationReport,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -490,10 +504,10 @@ func (t *PDUSessionResourceModifyResponseTransfer) Marshal() (TransferContainer, // TS 38.413 §9.3.4.17. Carried in the Failed to Modify list of the modify // response. type PDUSessionResourceModifyUnsuccessfulTransfer struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` Cause Cause CriticalityDiagnostics *CriticalityDiagnostics `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -512,23 +526,25 @@ func (t *PDUSessionResourceModifyUnsuccessfulTransfer) Marshal() (TransferContai // ParsePDUSessionResourceModifyUnsuccessfulTransfer decodes the transfer an // NG-RAN node returns for a session it could not modify. func ParsePDUSessionResourceModifyUnsuccessfulTransfer(b TransferContainer) (*PDUSessionResourceModifyUnsuccessfulTransfer, error) { - var t PDUSessionResourceModifyUnsuccessfulTransfer + return parseTransfer[PDUSessionResourceModifyUnsuccessfulTransfer](b) +} - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } +func DecodePDUSessionResourceModifyUnsuccessfulTransfer(b TransferContainer) (*PDUSessionResourceModifyUnsuccessfulTransfer, error) { + return decodeTransfer[PDUSessionResourceModifyUnsuccessfulTransfer](b) +} - return &t, nil +func (t *PDUSessionResourceModifyUnsuccessfulTransfer) Diagnostics() Diagnostics { + return diagnosticsOf(t) } // ParsePDUSessionResourceModifyResponseTransfer decodes the transfer the NG-RAN // node returns for a modified session. func ParsePDUSessionResourceModifyResponseTransfer(b TransferContainer) (*PDUSessionResourceModifyResponseTransfer, error) { - var t PDUSessionResourceModifyResponseTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PDUSessionResourceModifyResponseTransfer](b) +} - return &t, nil +func DecodePDUSessionResourceModifyResponseTransfer(b TransferContainer) (*PDUSessionResourceModifyResponseTransfer, error) { + return decodeTransfer[PDUSessionResourceModifyResponseTransfer](b) } + +func (t *PDUSessionResourceModifyResponseTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } diff --git a/ngap/pdu_session_resource_modify_indication.go b/ngap/pdu_session_resource_modify_indication.go index 6fc413ed47..7f335e107c 100644 --- a/ngap/pdu_session_resource_modify_indication.go +++ b/ngap/pdu_session_resource_modify_indication.go @@ -13,7 +13,7 @@ import ( type PDUSessionResourceModifyItemModInd struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -27,7 +27,7 @@ type PDUSessionResourceModifyListModInd []PDUSessionResourceModifyItemModInd type PDUSessionResourceModifyItemModCfm struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -39,10 +39,10 @@ type PDUSessionResourceModifyListModCfm []PDUSessionResourceModifyItemModCfm // pDUSessionResourceModifyIndicationUnsuccessfulTransfer, iE-Extensions // OPTIONAL } (extensible). type PDUSessionResourceFailedToModifyItemModCfm struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceFailedToModifyListModCfm ::= SEQUENCE @@ -54,9 +54,9 @@ type PDUSessionResourceFailedToModifyListModCfm []PDUSessionResourceFailedToModi // §9.3.4 transfers modelled: the AMF builds this one itself when it cannot hand // a session to the SMF, so it cannot stay opaque. type PDUSessionResourceModifyIndicationUnsuccessfulTransfer struct { - _ [0]struct{} `per:"extseq"` - Cause Cause - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + Cause Cause + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -75,13 +75,15 @@ func (t *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) Marshal() (Tran // ParsePDUSessionResourceModifyIndicationUnsuccessfulTransfer decodes the // transfer the AMF returns for a session it could not hand to the SMF. func ParsePDUSessionResourceModifyIndicationUnsuccessfulTransfer(b TransferContainer) (*PDUSessionResourceModifyIndicationUnsuccessfulTransfer, error) { - var t PDUSessionResourceModifyIndicationUnsuccessfulTransfer + return parseTransfer[PDUSessionResourceModifyIndicationUnsuccessfulTransfer](b) +} - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } +func DecodePDUSessionResourceModifyIndicationUnsuccessfulTransfer(b TransferContainer) (*PDUSessionResourceModifyIndicationUnsuccessfulTransfer, error) { + return decodeTransfer[PDUSessionResourceModifyIndicationUnsuccessfulTransfer](b) +} - return &t, nil +func (t *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) Diagnostics() Diagnostics { + return diagnosticsOf(t) } // TS 38.413 §9.2.1.8. @@ -96,25 +98,25 @@ type PDUSessionResourceModifyIndication struct { var pDUSessionResourceModifyIndicationIEs = []ieSpec[PDUSessionResourceModifyIndication]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDPDUSessionResourceModifyListModInd, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceModifyIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceModify) + ID: IDPDUSessionResourceModifyListModInd, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceModifyIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceModify) }, - encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { if m.PDUSessionResourceModify == nil { return nil, false } @@ -123,11 +125,11 @@ var pDUSessionResourceModifyIndicationIEs = []ieSpec[PDUSessionResourceModifyInd }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyIndication, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyIndication, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -135,7 +137,7 @@ var pDUSessionResourceModifyIndicationIEs = []ieSpec[PDUSessionResourceModifyInd return nil }, - encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyIndication) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -169,6 +171,10 @@ func ParsePDUSessionResourceModifyIndication(value []byte) (*PDUSessionResourceM return parseMessageBody[PDUSessionResourceModifyIndication](ProcPDUSessionResourceModifyIndication, TriggeringInitiatingMessage, pDUSessionResourceModifyIndicationIEs, value) } +func DecodePDUSessionResourceModifyIndication(value []byte) (*PDUSessionResourceModifyIndication, error) { + return decodeMessageBody[PDUSessionResourceModifyIndication](ProcPDUSessionResourceModifyIndication, pDUSessionResourceModifyIndicationIEs, value) +} + // TS 38.413 §9.2.1.9. type PDUSessionResourceModifyConfirm struct { AMFUENGAPID *AMFUENGAPID @@ -182,11 +188,11 @@ type PDUSessionResourceModifyConfirm struct { var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfirm]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyConfirm, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyConfirm, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -194,7 +200,7 @@ var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfir return nil }, - encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -203,11 +209,11 @@ var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfir }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyConfirm, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyConfirm, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -215,7 +221,7 @@ var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfir return nil }, - encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -224,11 +230,11 @@ var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfir }, }, { - id: IDPDUSessionResourceModifyListModCfm, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyConfirm, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceModify) + ID: IDPDUSessionResourceModifyListModCfm, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyConfirm, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceModify) }, - encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { if m.PDUSessionResourceModify == nil { return nil, false } @@ -237,11 +243,11 @@ var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfir }, }, { - id: IDPDUSessionResourceFailedToModifyListModCfm, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyConfirm, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceFailed) + ID: IDPDUSessionResourceFailedToModifyListModCfm, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyConfirm, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceFailed) }, - encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { if m.PDUSessionResourceFailed == nil { return nil, false } @@ -250,11 +256,11 @@ var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfir }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceModifyConfirm, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceModifyConfirm, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -262,7 +268,7 @@ var pDUSessionResourceModifyConfirmIEs = []ieSpec[PDUSessionResourceModifyConfir return nil }, - encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceModifyConfirm) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -296,26 +302,25 @@ func ParsePDUSessionResourceModifyConfirm(value []byte) (*PDUSessionResourceModi return parseMessageBody[PDUSessionResourceModifyConfirm](ProcPDUSessionResourceModifyIndication, TriggeringSuccessfulOutcome, pDUSessionResourceModifyConfirmIEs, value) } +func DecodePDUSessionResourceModifyConfirm(value []byte) (*PDUSessionResourceModifyConfirm, error) { + return decodeMessageBody[PDUSessionResourceModifyConfirm](ProcPDUSessionResourceModifyIndication, pDUSessionResourceModifyConfirmIEs, value) +} + // PDUSessionResourceModifyIndicationTransfer ::= SEQUENCE { // dLQosFlowPerTNLInformation, additionalDLQosFlowPerTNLInformation OPTIONAL, // iE-Extensions OPTIONAL } (extensible) — TS 38.413 §9.3.4.6. The NG-RAN node // builds it; the SMF consumes it. type PDUSessionResourceModifyIndicationTransfer struct { - DLQosFlowPerTNLInformation QosFlowPerTNLInformation - AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` - RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `per:"-"` - AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` - iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyIndicationTransferExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var pDUSessionResourceModifyIndicationTransferExtIEs = []ieSpec[PDUSessionResourceModifyIndicationTransfer]{ - optionalExtension(IDRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyIndicationTransfer) **QosFlowPerTNLInformation { - return &m.RedundantDLQosFlowPerTNLInformation - }), - listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyIndicationTransfer) *QosFlowPerTNLInformationList { - return &m.AdditionalRedundantDLQosFlowPerTNLInformation - }), + DLQosFlowPerTNLInformation QosFlowPerTNLInformation + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` + SecondaryRATUsageInformation *SecondaryRATUsageInformation `per:",extie:IDSecondaryRATUsageInformation,crit:ignore"` + SecurityResult *SecurityResult `per:",extie:IDSecurityResult,crit:ignore"` + RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `per:",extie:IDRedundantDLQosFlowPerTNLInformation,crit:ignore"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",extie:IDAdditionalRedundantDLQosFlowPerTNLInformation,crit:ignore"` + GlobalRANNodeID *GlobalRANNodeID `per:",extie:IDGlobalRANNodeID,crit:ignore"` + ECNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus `per:",extie:IDECNMarkingorCongestionInformationReportingStatus,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -334,13 +339,15 @@ func (t *PDUSessionResourceModifyIndicationTransfer) Marshal() (TransferContaine // ParsePDUSessionResourceModifyIndicationTransfer decodes the transfer an // NG-RAN node sends when it changes a session's downlink tunnel. func ParsePDUSessionResourceModifyIndicationTransfer(b TransferContainer) (*PDUSessionResourceModifyIndicationTransfer, error) { - var t PDUSessionResourceModifyIndicationTransfer + return parseTransfer[PDUSessionResourceModifyIndicationTransfer](b) +} - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } +func DecodePDUSessionResourceModifyIndicationTransfer(b TransferContainer) (*PDUSessionResourceModifyIndicationTransfer, error) { + return decodeTransfer[PDUSessionResourceModifyIndicationTransfer](b) +} - return &t, nil +func (t *PDUSessionResourceModifyIndicationTransfer) Diagnostics() Diagnostics { + return diagnosticsOf(t) } // PDUSessionResourceModifyConfirmTransfer ::= SEQUENCE { @@ -353,21 +360,12 @@ type PDUSessionResourceModifyConfirmTransfer struct { ULNGUUPTNLInformation UPTransportLayerInformation AdditionalNGUUPTNLInformation UPTransportLayerInformationPairList `per:",optional"` QosFlowFailedToModify QosFlowListWithCause `per:",optional"` - RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:"-"` - AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:"-"` - iEExtensions messageMeta `per:",exttable:pDUSessionResourceModifyConfirmTransferExtIEs"` + RedundantULNGUUPTNLInformation *UPTransportLayerInformation `per:",extie:IDRedundantULNGUUPTNLInformation,crit:ignore"` + AdditionalRedundantNGUUPTNLInformation UPTransportLayerInformationPairList `per:",extie:IDAdditionalRedundantNGUUPTNLInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -var pDUSessionResourceModifyConfirmTransferExtIEs = []ieSpec[PDUSessionResourceModifyConfirmTransfer]{ - optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyConfirmTransfer) **UPTransportLayerInformation { - return &m.RedundantULNGUUPTNLInformation - }), - listExtension(IDAdditionalRedundantNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyConfirmTransfer) *UPTransportLayerInformationPairList { - return &m.AdditionalRedundantNGUUPTNLInformation - }), -} - // Marshal encodes the transfer for the OCTET STRING that carries it. func (t *PDUSessionResourceModifyConfirmTransfer) Marshal() (TransferContainer, error) { w := per.NewWriter() @@ -384,11 +382,11 @@ func (t *PDUSessionResourceModifyConfirmTransfer) Marshal() (TransferContainer, // ParsePDUSessionResourceModifyConfirmTransfer decodes the transfer the SMF // returns confirming a modification. func ParsePDUSessionResourceModifyConfirmTransfer(b TransferContainer) (*PDUSessionResourceModifyConfirmTransfer, error) { - var t PDUSessionResourceModifyConfirmTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PDUSessionResourceModifyConfirmTransfer](b) +} - return &t, nil +func DecodePDUSessionResourceModifyConfirmTransfer(b TransferContainer) (*PDUSessionResourceModifyConfirmTransfer, error) { + return decodeTransfer[PDUSessionResourceModifyConfirmTransfer](b) } + +func (t *PDUSessionResourceModifyConfirmTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } diff --git a/ngap/pdu_session_resource_modify_indication_test.go b/ngap/pdu_session_resource_modify_indication_test.go index 989b44ddf3..0f1533f101 100644 --- a/ngap/pdu_session_resource_modify_indication_test.go +++ b/ngap/pdu_session_resource_modify_indication_test.go @@ -7,6 +7,8 @@ import ( "encoding/hex" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) const ( @@ -54,10 +56,7 @@ func TestPDUSessionResourceModifyIndicationRoundTrips(t *testing.T) { t.Run("Indication", func(t *testing.T) { plmn := PLMNIdentity{0x00, 0xf1, 0x10} in := goldPDUSessionResourceModifyIndication() - in.UserLocationInformation = &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - } + in.UserLocationInformation = &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}} b, err := in.Marshal() if err != nil { @@ -83,7 +82,7 @@ func TestPDUSessionResourceModifyIndicationRoundTrips(t *testing.T) { t.Fatalf("modify list = %+v", out.PDUSessionResourceModify) } - if out.UserLocationInformation == nil || out.UserLocationInformation.CellIdentity != 0x123456789 { + if out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || out.UserLocationInformation.NR.NRCGI.NRCellIdentity != 0x123456789 { t.Fatalf("ULI = %+v", out.UserLocationInformation) } }) @@ -115,8 +114,8 @@ func TestPDUSessionResourceModifyIndicationRoundTrips(t *testing.T) { // modifies nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceModifyIndicationMissingList(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceModifyIndication(value) @@ -139,7 +138,7 @@ func TestPDUSessionResourceModifyIndicationMissingList(t *testing.T) { // round-trips, so a peer's copy decodes to the same cause. func TestPDUSessionResourceModifyIndicationUnsuccessfulTransferRoundTrip(t *testing.T) { in := &PDUSessionResourceModifyIndicationUnsuccessfulTransfer{ - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnknownPDUSessionID}, + Cause: CauseRadioNetworkUnknownPDUSessionID.Cause(), } b, err := in.Marshal() @@ -152,7 +151,7 @@ func TestPDUSessionResourceModifyIndicationUnsuccessfulTransferRoundTrip(t *test t.Fatal(err) } - if out.Cause != in.Cause { + if !out.Cause.Equal(in.Cause) { t.Fatalf("cause = %+v, want %+v", out.Cause, in.Cause) } } @@ -165,8 +164,8 @@ const ( ) func modifyTransferTunnel() UPTransportLayerInformation { - return UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, + return UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }} } @@ -207,7 +206,7 @@ func TestPDUSessionResourceModifyIndicationTransferGolden(t *testing.T) { func TestPDUSessionResourceModifyConfirmTransferGolden(t *testing.T) { failed := QosFlowListWithCause{{ QosFlowIdentifier: 2, - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, + Cause: CauseRadioNetworkUnspecified.Cause(), }} for _, c := range []struct { diff --git a/ngap/pdu_session_resource_modify_test.go b/ngap/pdu_session_resource_modify_test.go index 00ac650785..0d6a00485e 100644 --- a/ngap/pdu_session_resource_modify_test.go +++ b/ngap/pdu_session_resource_modify_test.go @@ -8,6 +8,8 @@ import ( "encoding/hex" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) // Golden PDU SESSION RESOURCE MODIFY PDUs. @@ -96,10 +98,7 @@ func TestPDUSessionResourceModifyRoundTrips(t *testing.T) { AMFUENGAPID: Ptr(AMFUENGAPID(7)), RANUENGAPID: Ptr(RANUENGAPID(9)), PDUSessionResourceModify: PDUSessionResourceModifyListModRes{{PDUSessionID: 1, Transfer: TransferContainer{0x01}}}, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - }, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}}, } b, _ := in.Marshal() @@ -116,7 +115,7 @@ func TestPDUSessionResourceModifyRoundTrips(t *testing.T) { t.Fatalf("got %+v err %v", out, err) } - if out.UserLocationInformation == nil || out.UserLocationInformation.CellIdentity != 0x123456789 { + if out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || out.UserLocationInformation.NR.NRCGI.NRCellIdentity != 0x123456789 { t.Fatalf("ULI = %+v", out.UserLocationInformation) } }) @@ -126,8 +125,8 @@ func TestPDUSessionResourceModifyRoundTrips(t *testing.T) { // modifies nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceModifyRequestMissingList(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceModifyRequest(value) @@ -157,7 +156,7 @@ const ( func TestPDUSessionResourceModifyRequestTransferGolden(t *testing.T) { qp := QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ - Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, } @@ -166,17 +165,17 @@ func TestPDUSessionResourceModifyRequestTransferGolden(t *testing.T) { full := PDUSessionResourceModifyRequestTransfer{ ULNGUUPTNLModify: ULNGUUPTNLModifyList{{ - ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, - DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{10, 0, 0, 1}, GTPTEID: 2, + DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(10, 0, 0, 1), GTPTEID: 2, }}, }}, QosFlowAddOrModifyRequest: addOrModify, QosFlowToRelease: QosFlowListWithCause{{ QosFlowIdentifier: 2, - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, + Cause: CauseRadioNetworkUnspecified.Cause(), }}, } @@ -270,11 +269,11 @@ func TestQosFlowAddOrModifyRequestItemWithoutQosParameters(t *testing.T) { // separates them — only a list of exactly four does. func TestULNGUUPTNLModifyListAcceptsFourLegs(t *testing.T) { item := ULNGUUPTNLModifyItem{ - ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, - DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{10, 0, 0, 1}, GTPTEID: 2, + DLNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(10, 0, 0, 1), GTPTEID: 2, }}, } @@ -306,7 +305,7 @@ func TestULNGUUPTNLModifyListAcceptsFourLegs(t *testing.T) { } func TestModifyUnsuccessfulTransferRoundTrip(t *testing.T) { - in := PDUSessionResourceModifyUnsuccessfulTransfer{Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkIMSVoiceEPSFallbackTriggered}} + in := PDUSessionResourceModifyUnsuccessfulTransfer{Cause: CauseRadioNetworkIMSVoiceEPSFallbackTriggered.Cause()} b, err := in.Marshal() if err != nil { @@ -314,7 +313,7 @@ func TestModifyUnsuccessfulTransferRoundTrip(t *testing.T) { } out, err := ParsePDUSessionResourceModifyUnsuccessfulTransfer(b) - if err != nil || out.Cause != in.Cause { + if err != nil || !out.Cause.Equal(in.Cause) { t.Fatalf("decoded %+v (%v), want cause %+v", out, err, in.Cause) } } @@ -322,7 +321,7 @@ func TestModifyUnsuccessfulTransferRoundTrip(t *testing.T) { func TestNotifyTransferRoundTrip(t *testing.T) { in := PDUSessionResourceNotifyTransfer{ QosFlowNotify: QosFlowNotifyList{{QosFlowIdentifier: 2, NotificationCause: NotificationCauseNotFulfilled}}, - QosFlowReleased: QosFlowListWithCause{{QosFlowIdentifier: 3, Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkRadioConnectionWithUELost}}}, + QosFlowReleased: QosFlowListWithCause{{QosFlowIdentifier: 3, Cause: CauseRadioNetworkRadioConnectionWithUELost.Cause()}}, } b, err := in.Marshal() @@ -338,7 +337,7 @@ func TestNotifyTransferRoundTrip(t *testing.T) { } func TestModifyUnsuccessfulTransferEncoding(t *testing.T) { - b, err := (&PDUSessionResourceModifyUnsuccessfulTransfer{Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkIMSVoiceEPSFallbackTriggered}}).Marshal() + b, err := (&PDUSessionResourceModifyUnsuccessfulTransfer{Cause: CauseRadioNetworkIMSVoiceEPSFallbackTriggered.Cause()}).Marshal() if err != nil || !bytes.Equal(b, []byte{0x01, 0x20}) { t.Fatalf("encoded % x (%v), want 01 20", b, err) } diff --git a/ngap/pdu_session_resource_notify.go b/ngap/pdu_session_resource_notify.go index bfd10aacf5..bb478b3669 100644 --- a/ngap/pdu_session_resource_notify.go +++ b/ngap/pdu_session_resource_notify.go @@ -10,10 +10,10 @@ import ( // PDUSessionResourceNotifyItem ::= SEQUENCE { pDUSessionID, // pDUSessionResourceNotifyTransfer, iE-Extensions OPTIONAL } (extensible). type PDUSessionResourceNotifyItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceNotifyList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF @@ -24,10 +24,10 @@ type PDUSessionResourceNotifyList []PDUSessionResourceNotifyItem // pDUSessionResourceNotifyReleasedTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceReleasedItemNot struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceReleasedListNot ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -50,25 +50,25 @@ type PDUSessionResourceNotify struct { var pDUSessionResourceNotifyIEs = []ieSpec[PDUSessionResourceNotify]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDPDUSessionResourceNotifyList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceNotify) + ID: IDPDUSessionResourceNotifyList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceNotify) }, - encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { if m.PDUSessionResourceNotify == nil { return nil, false } @@ -77,11 +77,11 @@ var pDUSessionResourceNotifyIEs = []ieSpec[PDUSessionResourceNotify]{ }, }, { - id: IDPDUSessionResourceReleasedListNot, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceReleased) + ID: IDPDUSessionResourceReleasedListNot, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceReleased) }, - encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { if m.PDUSessionResourceReleased == nil { return nil, false } @@ -90,11 +90,11 @@ var pDUSessionResourceNotifyIEs = []ieSpec[PDUSessionResourceNotify]{ }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceNotify, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceNotify, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -102,7 +102,7 @@ var pDUSessionResourceNotifyIEs = []ieSpec[PDUSessionResourceNotify]{ return nil }, - encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceNotify) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -136,22 +136,30 @@ func ParsePDUSessionResourceNotify(value []byte) (*PDUSessionResourceNotify, err return parseMessageBody[PDUSessionResourceNotify](ProcPDUSessionResourceNotify, TriggeringInitiatingMessage, pDUSessionResourceNotifyIEs, value) } +func DecodePDUSessionResourceNotify(value []byte) (*PDUSessionResourceNotify, error) { + return decodeMessageBody[PDUSessionResourceNotify](ProcPDUSessionResourceNotify, pDUSessionResourceNotifyIEs, value) +} + // NotificationCause ::= ENUMERATED { fulfilled, not-fulfilled, ... } — // TS 38.413 §9.3.4.5. type NotificationCause uint8 const ( - NotificationCauseFulfilled NotificationCause = 0 - NotificationCauseNotFulfilled NotificationCause = 1 + NotificationCauseFulfilled NotificationCause = 0 + NotificationCauseNotFulfilled NotificationCause = 1 + NotificationCauseNotFulfilledDL NotificationCause = 2 + NotificationCauseNotFulfilledUL NotificationCause = 3 ) // QosFlowNotifyItem ::= SEQUENCE { qosFlowIdentifier, notificationCause, // iE-Extensions OPTIONAL } (extensible). type QosFlowNotifyItem struct { - _ [0]struct{} `per:"extseq"` - QosFlowIdentifier QosFlowIdentifier - NotificationCause NotificationCause `per:"ENUMERATED,range:0..1,..."` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + QosFlowIdentifier QosFlowIdentifier + NotificationCause NotificationCause + CurrentQoSParaSetIndex *AlternativeQoSParaSetNotifyIndex `per:",extie:IDCurrentQoSParaSetIndex,crit:ignore"` + TSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback `per:",extie:IDTSCTrafficCharacteristicsFeedback,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // QosFlowNotifyList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowNotifyItem. @@ -161,10 +169,12 @@ type QosFlowNotifyList []QosFlowNotifyItem // qosFlowReleasedList OPTIONAL, iE-Extensions OPTIONAL } (extensible) — // TS 38.413 §9.3.4.5. type PDUSessionResourceNotifyTransfer struct { - _ [0]struct{} `per:"extseq"` - QosFlowNotify QosFlowNotifyList `per:",optional"` - QosFlowReleased QosFlowListWithCause `per:",optional"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + QosFlowNotify QosFlowNotifyList `per:",optional"` + QosFlowReleased QosFlowListWithCause `per:",optional"` + SecondaryRATUsageInformation *SecondaryRATUsageInformation `per:",extie:IDSecondaryRATUsageInformation,crit:ignore"` + QosFlowFeedbackList QosFlowFeedbackList `per:",extie:IDQosFlowFeedbackList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -183,11 +193,11 @@ func (t *PDUSessionResourceNotifyTransfer) Marshal() (TransferContainer, error) // ParsePDUSessionResourceNotifyTransfer decodes the QoS flow notifications an // NG-RAN node reports for a PDU session. func ParsePDUSessionResourceNotifyTransfer(b TransferContainer) (*PDUSessionResourceNotifyTransfer, error) { - var t PDUSessionResourceNotifyTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PDUSessionResourceNotifyTransfer](b) +} - return &t, nil +func DecodePDUSessionResourceNotifyTransfer(b TransferContainer) (*PDUSessionResourceNotifyTransfer, error) { + return decodeTransfer[PDUSessionResourceNotifyTransfer](b) } + +func (t *PDUSessionResourceNotifyTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } diff --git a/ngap/pdu_session_resource_notify_test.go b/ngap/pdu_session_resource_notify_test.go index 59dcdd27a7..e62926f9ce 100644 --- a/ngap/pdu_session_resource_notify_test.go +++ b/ngap/pdu_session_resource_notify_test.go @@ -26,10 +26,7 @@ func TestPDUSessionResourceNotifyGoldenEncoding(t *testing.T) { func TestPDUSessionResourceNotifyRoundTrip(t *testing.T) { plmn := PLMNIdentity{0x00, 0xf1, 0x10} in := goldPDUSessionResourceNotify() - in.UserLocationInformation = &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - } + in.UserLocationInformation = &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}} b, err := in.Marshal() if err != nil { @@ -59,7 +56,7 @@ func TestPDUSessionResourceNotifyRoundTrip(t *testing.T) { t.Fatalf("released list = %+v", out.PDUSessionResourceReleased) } - if out.UserLocationInformation == nil || out.UserLocationInformation.CellIdentity != 0x123456789 { + if out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || out.UserLocationInformation.NR.NRCGI.NRCellIdentity != 0x123456789 { t.Fatalf("ULI = %+v", out.UserLocationInformation) } } diff --git a/ngap/pdu_session_resource_release.go b/ngap/pdu_session_resource_release.go index 4143ea371d..cdc8fb374d 100644 --- a/ngap/pdu_session_resource_release.go +++ b/ngap/pdu_session_resource_release.go @@ -11,10 +11,10 @@ import ( // pDUSessionResourceReleaseCommandTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceToReleaseItemRelCmd struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceToReleaseListRelCmd ::= SEQUENCE @@ -25,10 +25,10 @@ type PDUSessionResourceToReleaseListRelCmd []PDUSessionResourceToReleaseItemRelC // pDUSessionResourceReleaseResponseTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceReleasedItemRelRes struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceReleasedListRelRes ::= SEQUENCE @@ -41,31 +41,33 @@ type PDUSessionResourceReleaseCommand struct { RANUENGAPID RANUENGAPID NASPDU *NASPDU PDUSessionResourceRelease PDUSessionResourceToReleaseListRelCmd + RANPagingPriority *RANPagingPriority messageMeta } var pDUSessionResourceReleaseCommandIEs = []ieSpec[PDUSessionResourceReleaseCommand]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, + optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceReleaseCommand) **RANPagingPriority { return &m.RANPagingPriority }), { - id: IDNASPDU, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceReleaseCommand, raw []byte, enc per.Encoding) error { + ID: IDNASPDU, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceReleaseCommand, r *per.Reader, enc per.Encoding) error { var v NASPDU - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -73,7 +75,7 @@ var pDUSessionResourceReleaseCommandIEs = []ieSpec[PDUSessionResourceReleaseComm return nil }, - encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -82,11 +84,11 @@ var pDUSessionResourceReleaseCommandIEs = []ieSpec[PDUSessionResourceReleaseComm }, }, { - id: IDPDUSessionResourceToReleaseListRelCmd, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceRelease) + ID: IDPDUSessionResourceToReleaseListRelCmd, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceRelease) }, - encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { if m.PDUSessionResourceRelease == nil { return nil, false } @@ -120,6 +122,10 @@ func ParsePDUSessionResourceReleaseCommand(value []byte) (*PDUSessionResourceRel return parseMessageBody[PDUSessionResourceReleaseCommand](ProcPDUSessionResourceRelease, TriggeringInitiatingMessage, pDUSessionResourceReleaseCommandIEs, value) } +func DecodePDUSessionResourceReleaseCommand(value []byte) (*PDUSessionResourceReleaseCommand, error) { + return decodeMessageBody[PDUSessionResourceReleaseCommand](ProcPDUSessionResourceRelease, pDUSessionResourceReleaseCommandIEs, value) +} + // TS 38.413 §9.2.1.4. type PDUSessionResourceReleaseResponse struct { AMFUENGAPID *AMFUENGAPID @@ -133,11 +139,11 @@ type PDUSessionResourceReleaseResponse struct { var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseResponse]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceReleaseResponse, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -145,7 +151,7 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes return nil }, - encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -154,11 +160,11 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceReleaseResponse, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -166,7 +172,7 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes return nil }, - encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -175,11 +181,11 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes }, }, { - id: IDPDUSessionResourceReleasedListRelRes, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceReleaseResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceReleased) + ID: IDPDUSessionResourceReleasedListRelRes, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceReleaseResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceReleased) }, - encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { if m.PDUSessionResourceReleased == nil { return nil, false } @@ -188,11 +194,11 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceReleaseResponse, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -200,7 +206,7 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes return nil }, - encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -209,11 +215,11 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceReleaseResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -221,7 +227,7 @@ var pDUSessionResourceReleaseResponseIEs = []ieSpec[PDUSessionResourceReleaseRes return nil }, - encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceReleaseResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -255,13 +261,18 @@ func ParsePDUSessionResourceReleaseResponse(value []byte) (*PDUSessionResourceRe return parseMessageBody[PDUSessionResourceReleaseResponse](ProcPDUSessionResourceRelease, TriggeringSuccessfulOutcome, pDUSessionResourceReleaseResponseIEs, value) } +func DecodePDUSessionResourceReleaseResponse(value []byte) (*PDUSessionResourceReleaseResponse, error) { + return decodeMessageBody[PDUSessionResourceReleaseResponse](ProcPDUSessionResourceRelease, pDUSessionResourceReleaseResponseIEs, value) +} + // PDUSessionResourceReleaseCommandTransfer ::= SEQUENCE { cause, iE-Extensions // OPTIONAL } (extensible) — TS 38.413 §9.3.4.12. The SMF builds it; the NG-RAN // node consumes it. type PDUSessionResourceReleaseCommandTransfer struct { - _ [0]struct{} `per:"extseq"` - Cause Cause - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + Cause Cause + QosFlowAdditionalInfoList QosFlowAdditionalInfoListRelCom `per:",extie:IDQosFlowAdditionalInfoList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -280,22 +291,24 @@ func (t *PDUSessionResourceReleaseCommandTransfer) Marshal() (TransferContainer, // ParsePDUSessionResourceReleaseCommandTransfer decodes the transfer the SMF // sends to release a session. func ParsePDUSessionResourceReleaseCommandTransfer(b TransferContainer) (*PDUSessionResourceReleaseCommandTransfer, error) { - var t PDUSessionResourceReleaseCommandTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PDUSessionResourceReleaseCommandTransfer](b) +} - return &t, nil +func DecodePDUSessionResourceReleaseCommandTransfer(b TransferContainer) (*PDUSessionResourceReleaseCommandTransfer, error) { + return decodeTransfer[PDUSessionResourceReleaseCommandTransfer](b) } +func (t *PDUSessionResourceReleaseCommandTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } + // PDUSessionResourceReleaseResponseTransfer ::= SEQUENCE { iE-Extensions // OPTIONAL, ... } (extensible) — TS 38.413 §9.3.4.21. Every field is optional, // so the NG-RAN node normally sends it empty; it exists so the AMF can relay a // session's release confirmation to the SMF. type PDUSessionResourceReleaseResponseTransfer struct { - _ [0]struct{} `per:"extseq"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + SecondaryRATUsageInformation *SecondaryRATUsageInformation `per:",extie:IDSecondaryRATUsageInformation,crit:ignore"` + QosFlowAdditionalInfoList QosFlowAdditionalInfoListRelRes `per:",extie:IDQosFlowAdditionalInfoList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -314,11 +327,13 @@ func (t *PDUSessionResourceReleaseResponseTransfer) Marshal() (TransferContainer // ParsePDUSessionResourceReleaseResponseTransfer decodes the transfer the // NG-RAN node returns for a released session. func ParsePDUSessionResourceReleaseResponseTransfer(b TransferContainer) (*PDUSessionResourceReleaseResponseTransfer, error) { - var t PDUSessionResourceReleaseResponseTransfer + return parseTransfer[PDUSessionResourceReleaseResponseTransfer](b) +} - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } +func DecodePDUSessionResourceReleaseResponseTransfer(b TransferContainer) (*PDUSessionResourceReleaseResponseTransfer, error) { + return decodeTransfer[PDUSessionResourceReleaseResponseTransfer](b) +} - return &t, nil +func (t *PDUSessionResourceReleaseResponseTransfer) Diagnostics() Diagnostics { + return diagnosticsOf(t) } diff --git a/ngap/pdu_session_resource_release_test.go b/ngap/pdu_session_resource_release_test.go index 4a9bc6f012..87683a7d82 100644 --- a/ngap/pdu_session_resource_release_test.go +++ b/ngap/pdu_session_resource_release_test.go @@ -7,6 +7,8 @@ import ( "encoding/hex" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) // Golden PDU SESSION RESOURCE RELEASE PDUs. @@ -86,10 +88,7 @@ func TestPDUSessionResourceReleaseRoundTrips(t *testing.T) { AMFUENGAPID: Ptr(AMFUENGAPID(7)), RANUENGAPID: Ptr(RANUENGAPID(9)), PDUSessionResourceReleased: PDUSessionResourceReleasedListRelRes{{PDUSessionID: 1, Transfer: TransferContainer{0x01}}}, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - }, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}}, } b, _ := in.Marshal() @@ -106,7 +105,7 @@ func TestPDUSessionResourceReleaseRoundTrips(t *testing.T) { t.Fatalf("got %+v err %v", out, err) } - if out.UserLocationInformation == nil || out.UserLocationInformation.CellIdentity != 0x123456789 { + if out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || out.UserLocationInformation.NR.NRCGI.NRCellIdentity != 0x123456789 { t.Fatalf("ULI = %+v", out.UserLocationInformation) } }) @@ -116,8 +115,8 @@ func TestPDUSessionResourceReleaseRoundTrips(t *testing.T) { // releases nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceReleaseCommandMissingList(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceReleaseCommand(value) @@ -140,8 +139,8 @@ func TestPDUSessionResourceReleaseCommandMissingList(t *testing.T) { // it is still delivered and the absence reported (§10.3.5). func TestPDUSessionResourceReleaseResponseMissingList(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityIgnore, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityIgnore, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) msg, err := ParsePDUSessionResourceReleaseResponse(value) @@ -151,7 +150,7 @@ func TestPDUSessionResourceReleaseResponseMissingList(t *testing.T) { d := msg.Diagnostics() if len(d.IEs) != 1 || d.IEs[0].ID != IDPDUSessionResourceReleasedListRelRes || - d.IEs[0].TypeOfError != TypeOfErrorMissing { + typeOfError(d.IEs[0]) != TypeOfErrorMissing { t.Errorf("diagnostics = %+v, want one missing entry for the released list", d.IEs) } } @@ -171,9 +170,9 @@ func TestPDUSessionResourceReleaseCommandTransferGolden(t *testing.T) { cause Cause golden string }{ - {"RadioNetworkUnspecified", Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, goldenReleaseCommandTransferRadioNetwork}, - {"NASNormalRelease", Cause{Group: CauseGroupNAS, Value: CauseNASNormalRelease}, goldenReleaseCommandTransferNAS}, - {"RadioNetworkNGRANGenerated", Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkReleaseDueToNGRANGeneratedReason}, goldenReleaseCommandTransferRadioNetwork3}, + {"RadioNetworkUnspecified", CauseRadioNetworkUnspecified.Cause(), goldenReleaseCommandTransferRadioNetwork}, + {"NASNormalRelease", CauseNASNormalRelease.Cause(), goldenReleaseCommandTransferNAS}, + {"RadioNetworkNGRANGenerated", CauseRadioNetworkReleaseDueToNGRANGeneratedReason.Cause(), goldenReleaseCommandTransferRadioNetwork3}, } { t.Run(c.name, func(t *testing.T) { in := PDUSessionResourceReleaseCommandTransfer{Cause: c.cause} @@ -192,7 +191,7 @@ func TestPDUSessionResourceReleaseCommandTransferGolden(t *testing.T) { t.Fatal(err) } - if out.Cause != c.cause { + if !out.Cause.Equal(c.cause) { t.Fatalf("round trip %+v, want %+v", out.Cause, c.cause) } }) diff --git a/ngap/pdu_session_resource_setup.go b/ngap/pdu_session_resource_setup.go index 72182014c7..d6888cb0fb 100644 --- a/ngap/pdu_session_resource_setup.go +++ b/ngap/pdu_session_resource_setup.go @@ -12,12 +12,13 @@ import ( // iE-Extensions OPTIONAL } (extensible). Its own ASN.1 type, so it stays // distinct from the identically shaped CxtReq item. type PDUSessionResourceSetupItemSUReq struct { - PDUSessionID PDUSessionID - NASPDU *NASPDU `per:",optional"` - SNSSAI SNSSAI - Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PDUSessionID PDUSessionID + NASPDU *NASPDU `per:",optional"` + SNSSAI SNSSAI + Transfer TransferContainer + PduSessionExpectedUEActivityBehaviour *ExpectedUEActivityBehaviour `per:",extie:IDPduSessionExpectedUEActivityBehaviour,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceSetupListSUReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) @@ -30,7 +31,7 @@ type PDUSessionResourceSetupListSUReq []PDUSessionResourceSetupItemSUReq type PDUSessionResourceSetupItemSURes struct { PDUSessionID PDUSessionID Transfer TransferContainer - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -42,10 +43,10 @@ type PDUSessionResourceSetupListSURes []PDUSessionResourceSetupItemSURes // pDUSessionResourceSetupUnsuccessfulTransfer, iE-Extensions OPTIONAL } // (extensible). type PDUSessionResourceFailedToSetupItemSURes struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID Transfer TransferContainer - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceFailedToSetupListSURes ::= SEQUENCE @@ -57,10 +58,10 @@ type PDUSessionResourceFailedToSetupListSURes []PDUSessionResourceFailedToSetupI // TS 38.413 §9.3.4.16. Carried in the Failed to Setup lists of both the setup // response and the initial context setup response. type PDUSessionResourceSetupUnsuccessfulTransfer struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` Cause Cause CriticalityDiagnostics *CriticalityDiagnostics `per:",optional"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -79,13 +80,15 @@ func (t *PDUSessionResourceSetupUnsuccessfulTransfer) Marshal() (TransferContain // ParsePDUSessionResourceSetupUnsuccessfulTransfer decodes the transfer an // NG-RAN node returns for a session it could not set up. func ParsePDUSessionResourceSetupUnsuccessfulTransfer(b TransferContainer) (*PDUSessionResourceSetupUnsuccessfulTransfer, error) { - var t PDUSessionResourceSetupUnsuccessfulTransfer + return parseTransfer[PDUSessionResourceSetupUnsuccessfulTransfer](b) +} - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } +func DecodePDUSessionResourceSetupUnsuccessfulTransfer(b TransferContainer) (*PDUSessionResourceSetupUnsuccessfulTransfer, error) { + return decodeTransfer[PDUSessionResourceSetupUnsuccessfulTransfer](b) +} - return &t, nil +func (t *PDUSessionResourceSetupUnsuccessfulTransfer) Diagnostics() Diagnostics { + return diagnosticsOf(t) } // TS 38.413 §9.2.1.1. @@ -97,31 +100,34 @@ type PDUSessionResourceSetupRequest struct { NASPDU *NASPDU PDUSessionResourceSetup PDUSessionResourceSetupListSUReq UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + RANPagingPriority *RANPagingPriority + UESliceMaximumBitRateList UESliceMaximumBitRateList messageMeta } var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, + optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceSetupRequest) **RANPagingPriority { return &m.RANPagingPriority }), { - id: IDNASPDU, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDNASPDU, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequest, r *per.Reader, enc per.Encoding) error { var v NASPDU - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -129,7 +135,7 @@ var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest] return nil }, - encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -138,11 +144,11 @@ var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest] }, }, { - id: IDPDUSessionResourceSetupListSUReq, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceSetup) + ID: IDPDUSessionResourceSetupListSUReq, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceSetup) }, - encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { if m.PDUSessionResourceSetup == nil { return nil, false } @@ -151,11 +157,11 @@ var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest] }, }, { - id: IDUEAggregateMaximumBitRate, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitRate, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupRequest, r *per.Reader, enc per.Encoding) error { var v UEAggregateMaximumBitRate - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -163,7 +169,7 @@ var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest] return nil }, - encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -171,6 +177,9 @@ var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest] return m.UEAggregateMaximumBitRate, true }, }, + listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *PDUSessionResourceSetupRequest) *UESliceMaximumBitRateList { + return &m.UESliceMaximumBitRateList + }), } func (m *PDUSessionResourceSetupRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -197,6 +206,10 @@ func ParsePDUSessionResourceSetupRequest(value []byte) (*PDUSessionResourceSetup return parseMessageBody[PDUSessionResourceSetupRequest](ProcPDUSessionResourceSetup, TriggeringInitiatingMessage, pDUSessionResourceSetupRequestIEs, value) } +func DecodePDUSessionResourceSetupRequest(value []byte) (*PDUSessionResourceSetupRequest, error) { + return decodeMessageBody[PDUSessionResourceSetupRequest](ProcPDUSessionResourceSetup, pDUSessionResourceSetupRequestIEs, value) +} + // TS 38.413 §9.2.1.2. type PDUSessionResourceSetupResponse struct { AMFUENGAPID *AMFUENGAPID @@ -211,11 +224,11 @@ type PDUSessionResourceSetupResponse struct { var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupResponse]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupResponse, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -223,7 +236,7 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons return nil }, - encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -232,11 +245,11 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupResponse, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -244,7 +257,7 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons return nil }, - encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -253,11 +266,11 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons }, }, { - id: IDPDUSessionResourceSetupListSURes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceSetup) + ID: IDPDUSessionResourceSetupListSURes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceSetup) }, - encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { if m.PDUSessionResourceSetup == nil { return nil, false } @@ -266,11 +279,11 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons }, }, { - id: IDPDUSessionResourceFailedToSetupListSURes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceFailed) + ID: IDPDUSessionResourceFailedToSetupListSURes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceFailed) }, - encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { if m.PDUSessionResourceFailed == nil { return nil, false } @@ -279,11 +292,11 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -291,7 +304,7 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons return nil }, - encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -300,11 +313,11 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupResponse, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -312,7 +325,7 @@ var pDUSessionResourceSetupResponseIEs = []ieSpec[PDUSessionResourceSetupRespons return nil }, - encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupResponse) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -346,31 +359,18 @@ func ParsePDUSessionResourceSetupResponse(value []byte) (*PDUSessionResourceSetu return parseMessageBody[PDUSessionResourceSetupResponse](ProcPDUSessionResourceSetup, TriggeringSuccessfulOutcome, pDUSessionResourceSetupResponseIEs, value) } +func DecodePDUSessionResourceSetupResponse(value []byte) (*PDUSessionResourceSetupResponse, error) { + return decodeMessageBody[PDUSessionResourceSetupResponse](ProcPDUSessionResourceSetup, pDUSessionResourceSetupResponseIEs, value) +} + // DataForwardingNotPossible ::= ENUMERATED { data-forwarding-not-possible, // ... }. type DataForwardingNotPossible uint8 const ( DataForwardingNotPossibleTrue DataForwardingNotPossible = iota - - dataForwardingNotPossibleRootCount = 1 ) -func (d DataForwardingNotPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, dataForwardingNotPossibleRootCount, int64(d), "DataForwardingNotPossible") -} - -func (d *DataForwardingNotPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, dataForwardingNotPossibleRootCount, "DataForwardingNotPossible") - if err != nil { - return err - } - - *d = DataForwardingNotPossible(idx) - - return nil -} - // PDUSessionResourceSetupRequestTransfer ::= SEQUENCE { protocolIEs // ProtocolIE-Container } (extensible) — TS 38.413 §9.3.4.1. Unlike the // unsuccessful transfers this one is an IE container, not a plain SEQUENCE, so @@ -388,17 +388,22 @@ type PDUSessionResourceSetupRequestTransfer struct { DirectForwardingPathAvailability *DirectForwardingPathAvailability RedundantULNGUUPTNLInformation *UPTransportLayerInformation AdditionalRedundantULNGUUPTNLInformation UPTransportLayerInformationList + CommonNetworkInstance CommonNetworkInstance + RedundantCommonNetworkInstance CommonNetworkInstance + RedundantPDUSessionInformation *RedundantPDUSessionInformation + MBSSessionSetupRequestList MBSSessionSetupRequestList + DownlinkTLContainer TLContainer messageMeta } var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetupRequestTransfer]{ { - id: IDPDUSessionAggregateMaximumBitRate, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { + ID: IDPDUSessionAggregateMaximumBitRate, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { var v PDUSessionAggregateMaximumBitRate - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -406,7 +411,7 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return nil }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { if m.PDUSessionAggregateMaximumBitRate == nil { return nil, false } @@ -415,20 +420,20 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup }, }, { - id: IDULNGUUPTNLInformation, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ULNGUUPTNLInformation) + ID: IDULNGUUPTNLInformation, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ULNGUUPTNLInformation) }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { return &m.ULNGUUPTNLInformation, true }, }, { - id: IDAdditionalULNGUUPTNLInformation, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AdditionalULNGUUPTNLInformation) + ID: IDAdditionalULNGUUPTNLInformation, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AdditionalULNGUUPTNLInformation) }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { if m.AdditionalULNGUUPTNLInformation == nil { return nil, false } @@ -437,11 +442,11 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup }, }, { - id: IDDataForwardingNotPossible, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { + ID: IDDataForwardingNotPossible, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { var d DataForwardingNotPossible - if err := perIEDecode(raw, &d); err != nil { + if err := decodeIE(r, &d); err != nil { return err } @@ -449,7 +454,7 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return nil }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { if m.DataForwardingNotPossible == nil { return nil, false } @@ -458,20 +463,20 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup }, }, { - id: IDPDUSessionType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionType) + ID: IDPDUSessionType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionType) }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { return &m.PDUSessionType, true }, }, { - id: IDSecurityIndication, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { + ID: IDSecurityIndication, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { var v SecurityIndication - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -479,7 +484,7 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return nil }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { if m.SecurityIndication == nil { return nil, false } @@ -488,11 +493,11 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup }, }, { - id: IDNetworkInstance, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { + ID: IDNetworkInstance, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { var v NetworkInstance - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -500,7 +505,7 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return nil }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { if m.NetworkInstance == nil { return nil, false } @@ -509,11 +514,11 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup }, }, { - id: IDQosFlowSetupRequestList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.QosFlowSetupRequest) + ID: IDQosFlowSetupRequestList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.QosFlowSetupRequest) }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { if m.QosFlowSetupRequest == nil { return nil, false } @@ -521,12 +526,15 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return m.QosFlowSetupRequest, true }, }, + listExtension(IDCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *CommonNetworkInstance { + return &m.CommonNetworkInstance + }), { - id: IDDirectForwardingPathAvailability, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PDUSessionResourceSetupRequestTransfer, raw []byte, enc per.Encoding) error { + ID: IDDirectForwardingPathAvailability, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PDUSessionResourceSetupRequestTransfer, r *per.Reader, enc per.Encoding) error { var v DirectForwardingPathAvailability - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -534,7 +542,7 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return nil }, - encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { + Encode: func(m *PDUSessionResourceSetupRequestTransfer) (per.Marshaler, bool) { if m.DirectForwardingPathAvailability == nil { return nil, false } @@ -548,6 +556,16 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup listExtension(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *UPTransportLayerInformationList { return &m.AdditionalRedundantULNGUUPTNLInformation }), + listExtension(IDRedundantCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *CommonNetworkInstance { + return &m.RedundantCommonNetworkInstance + }), + optionalExtension(IDRedundantPDUSessionInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) **RedundantPDUSessionInformation { + return &m.RedundantPDUSessionInformation + }), + listExtension(IDMBSSessionSetupRequestList, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *MBSSessionSetupRequestList { + return &m.MBSSessionSetupRequestList + }), + listExtension(IDDownlinkTLContainer, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *TLContainer { return &m.DownlinkTLContainer }), } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -567,7 +585,11 @@ func (t *PDUSessionResourceSetupRequestTransfer) Marshal() (TransferContainer, e // sends for a session the NG-RAN node is to set up. Errors carry the enclosing // procedure, which is what the AMF reports in Criticality Diagnostics. func ParsePDUSessionResourceSetupRequestTransfer(b TransferContainer) (*PDUSessionResourceSetupRequestTransfer, error) { - return parseBoundedMessageBody[PDUSessionResourceSetupRequestTransfer](ProcPDUSessionResourceSetup, TriggeringInitiatingMessage, pDUSessionResourceSetupRequestTransferIEs, b, maxProtocolIEs) + return parseMessageBody[PDUSessionResourceSetupRequestTransfer](ProcPDUSessionResourceSetup, TriggeringInitiatingMessage, pDUSessionResourceSetupRequestTransferIEs, b) +} + +func DecodePDUSessionResourceSetupRequestTransfer(b TransferContainer) (*PDUSessionResourceSetupRequestTransfer, error) { + return decodeMessageBody[PDUSessionResourceSetupRequestTransfer](ProcPDUSessionResourceSetup, pDUSessionResourceSetupRequestTransferIEs, b) } // PDUSessionResourceSetupResponseTransfer ::= SEQUENCE { @@ -576,23 +598,23 @@ func ParsePDUSessionResourceSetupRequestTransfer(b TransferContainer) (*PDUSessi // OPTIONAL } (extensible) — TS 38.413 §9.3.4.2. A plain SEQUENCE, unlike the // request transfer. The NG-RAN node builds it; the SMF consumes it. type PDUSessionResourceSetupResponseTransfer struct { - DLQosFlowPerTNLInformation QosFlowPerTNLInformation - AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` - SecurityResult *SecurityResult `per:",optional"` - QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` - RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `per:"-"` - AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:"-"` - iEExtensions messageMeta `per:",exttable:pDUSessionResourceSetupResponseTransferExtIEs"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -var pDUSessionResourceSetupResponseTransferExtIEs = []ieSpec[PDUSessionResourceSetupResponseTransfer]{ - optionalExtension(IDRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupResponseTransfer) **QosFlowPerTNLInformation { - return &m.RedundantDLQosFlowPerTNLInformation - }), - listExtension(IDAdditionalRedundantDLQosFlowPerTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupResponseTransfer) *QosFlowPerTNLInformationList { - return &m.AdditionalRedundantDLQosFlowPerTNLInformation - }), + DLQosFlowPerTNLInformation QosFlowPerTNLInformation + AdditionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",optional"` + SecurityResult *SecurityResult `per:",optional"` + QosFlowFailedToSetup QosFlowListWithCause `per:",optional"` + RedundantDLQosFlowPerTNLInformation *QosFlowPerTNLInformation `per:",extie:IDRedundantDLQosFlowPerTNLInformation,crit:ignore"` + AdditionalRedundantDLQosFlowPerTNLInformation QosFlowPerTNLInformationList `per:",extie:IDAdditionalRedundantDLQosFlowPerTNLInformation,crit:ignore"` + UsedRSNInformation *RedundantPDUSessionInformation `per:",extie:IDUsedRSNInformation,crit:ignore"` + GlobalRANNodeID *GlobalRANNodeID `per:",extie:IDGlobalRANNodeID,crit:ignore"` + MBSSupportIndicator *MBSSupportIndicator `per:",extie:IDMBSSupportIndicator,crit:ignore"` + MBSSessionSetupResponseList MBSSessionSetupResponseList `per:",extie:IDMBSSessionSetupResponseList,crit:ignore"` + MBSSessionFailedtoSetupList MBSSessionFailedtoSetupList `per:",extie:IDMBSSessionFailedtoSetupList,crit:ignore"` + QoSFlowTSCList QoSFlowTSCList `per:",extie:IDQoSFlowTSCList,crit:ignore"` + UplinkTLContainer *TLContainer `per:",extie:IDUplinkTLContainer,crit:ignore"` + ECNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus `per:",extie:IDECNMarkingorCongestionInformationReportingStatus,crit:ignore"` + PDUSetbasedHandlingIndicator *PDUSetbasedHandlingIndicator `per:",extie:IDPDUSetbasedHandlingIndicator,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // Marshal encodes the transfer for the OCTET STRING that carries it. @@ -611,11 +633,11 @@ func (t *PDUSessionResourceSetupResponseTransfer) Marshal() (TransferContainer, // ParsePDUSessionResourceSetupResponseTransfer decodes the transfer an NG-RAN // node returns for a session it set up. func ParsePDUSessionResourceSetupResponseTransfer(b TransferContainer) (*PDUSessionResourceSetupResponseTransfer, error) { - var t PDUSessionResourceSetupResponseTransfer - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } + return parseTransfer[PDUSessionResourceSetupResponseTransfer](b) +} - return &t, nil +func DecodePDUSessionResourceSetupResponseTransfer(b TransferContainer) (*PDUSessionResourceSetupResponseTransfer, error) { + return decodeTransfer[PDUSessionResourceSetupResponseTransfer](b) } + +func (t *PDUSessionResourceSetupResponseTransfer) Diagnostics() Diagnostics { return diagnosticsOf(t) } diff --git a/ngap/pdu_session_resource_setup_test.go b/ngap/pdu_session_resource_setup_test.go index 9e73810adc..4bcb3e5956 100644 --- a/ngap/pdu_session_resource_setup_test.go +++ b/ngap/pdu_session_resource_setup_test.go @@ -7,6 +7,8 @@ import ( "encoding/hex" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) // Golden PDU SESSION RESOURCE SETUP PDUs. @@ -111,10 +113,7 @@ func TestPDUSessionResourceSetupRoundTrips(t *testing.T) { PDUSessionResourceSetup: PDUSessionResourceSetupListSURes{ {PDUSessionID: 1, Transfer: TransferContainer{0x01}}, }, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - }, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}}, } b, _ := in.Marshal() @@ -131,7 +130,7 @@ func TestPDUSessionResourceSetupRoundTrips(t *testing.T) { t.Fatalf("got %+v err %v", out, err) } - if out.UserLocationInformation == nil || out.UserLocationInformation.CellIdentity != 0x123456789 { + if out.UserLocationInformation == nil || out.UserLocationInformation.NR == nil || out.UserLocationInformation.NR.NRCGI.NRCellIdentity != 0x123456789 { t.Fatalf("ULI = %+v", out.UserLocationInformation) } }) @@ -141,8 +140,8 @@ func TestPDUSessionResourceSetupRoundTrips(t *testing.T) { // sets up nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceSetupRequestMissingSessionList(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceSetupRequest(value) @@ -177,7 +176,7 @@ const goldenSetupUnsuccessfulTransfer = "0000" func TestPDUSessionResourceSetupUnsuccessfulTransferRoundTrip(t *testing.T) { in := &PDUSessionResourceSetupUnsuccessfulTransfer{ - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, + Cause: CauseRadioNetworkUnspecified.Cause(), } b, err := in.Marshal() @@ -194,7 +193,7 @@ func TestPDUSessionResourceSetupUnsuccessfulTransferRoundTrip(t *testing.T) { t.Fatal(err) } - if out.Cause != in.Cause { + if !out.Cause.Equal(in.Cause) { t.Fatalf("cause = %+v, want %+v", out.Cause, in.Cause) } } @@ -219,8 +218,8 @@ const ( ) func setupTransferTunnel() UPTransportLayerInformation { - return UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, + return UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }} } @@ -233,7 +232,7 @@ func TestPDUSessionResourceSetupRequestTransferGolden(t *testing.T) { QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ - Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, }, @@ -262,7 +261,7 @@ func TestPDUSessionResourceSetupRequestTransferGolden(t *testing.T) { t.Errorf("QosFlowSetupRequest = %+v, want one flow with identifier 1", out.QosFlowSetupRequest) } - ipv4, _ := out.ULNGUUPTNLInformation.GTPTunnel.TransportLayerAddress.IPs() + ipv4 := out.ULNGUUPTNLInformation.GTPTunnel.TransportLayerAddress.IPv4() if ipv4.String() != "192.168.1.1" || out.ULNGUUPTNLInformation.GTPTunnel.GTPTEID != 1 { t.Errorf("tunnel = %s/%d, want 192.168.1.1/1", ipv4, out.ULNGUUPTNLInformation.GTPTunnel.GTPTEID) } @@ -307,7 +306,7 @@ func TestPDUSessionResourceSetupResponseTransferGolden(t *testing.T) { }, QosFlowFailedToSetup: QosFlowListWithCause{{ QosFlowIdentifier: 2, - Cause: Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, + Cause: CauseRadioNetworkUnspecified.Cause(), }}, }, goldenSetupResponseTransferFull}, } { @@ -355,16 +354,16 @@ func TestPDUSessionResourceSetupResponseTransferGolden(t *testing.T) { // the missing IE named in Criticality Diagnostics. func TestPDUSessionResourceSetupRequestTransferMissingTunnel(t *testing.T) { value := container(t, - ieField{id: IDPDUSessionType, crit: CriticalityReject, raw: ieRaw(t, Ptr(PDUSessionTypeIPv4))}, - ieField{id: IDQosFlowSetupRequestList, crit: CriticalityReject, raw: ieRaw(t, QosFlowSetupRequestList{{ + ieField{ID: IDPDUSessionType, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(PDUSessionTypeIPv4)))}, + ieField{ID: IDQosFlowSetupRequestList, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ - Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}, + NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}, }, AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, }, - }})}, + }}))}, ) _, err := ParsePDUSessionResourceSetupRequestTransfer(value) @@ -385,14 +384,14 @@ func TestPDUSessionResourceSetupRequestTransferMissingTunnel(t *testing.T) { func TestPDUSessionResourceSetupRequestTransferDirectForwardingPathAvailability(t *testing.T) { in := PDUSessionResourceSetupRequestTransfer{ - ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, PDUSessionType: PDUSessionTypeIPv4, QosFlowSetupRequest: QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ - QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}}, + QosCharacteristics: QosCharacteristics{NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}}, AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, }, }}, diff --git a/ngap/per_gen.go b/ngap/per_gen.go index ff74239b08..b5362ec1bd 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -4,28 +4,37 @@ package ngap -import "github.com/ellanetworks/core/per" - -func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(aMFTNLAssociationSetupItem.extensions.Present()) - w.WriteBit(aMFTNLAssociationSetupItem.iEExtensions != nil) - if err := aMFTNLAssociationSetupItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" + "slices" +) + +func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, a2XPC5FlowBitRates.iEExtensions) + w.WriteBit(a2XPC5FlowBitRates.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := a2XPC5FlowBitRates.A2XGuaranteedFlowBitRate.MarshalPER(w, enc); err != nil { + return err + } + if err := a2XPC5FlowBitRates.A2XMaximumFlowBitRate.MarshalPER(w, enc); err != nil { return err } - if aMFTNLAssociationSetupItem.iEExtensions != nil { - if err := (*aMFTNLAssociationSetupItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if aMFTNLAssociationSetupItem.extensions.Present() { - if err := aMFTNLAssociationSetupItem.extensions.MarshalPER(w, enc); err != nil { + if a2XPC5FlowBitRates.extensions.Present() { + if err := a2XPC5FlowBitRates.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *a2XPC5FlowBitRates = A2XPC5FlowBitRates{} extBit, err := r.ReadBit() if err != nil { return err @@ -34,58 +43,82 @@ func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) UnmarshalPER(r *pe if err != nil { return err } - if err := (&aMFTNLAssociationSetupItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + if err := (&a2XPC5FlowBitRates.A2XGuaranteedFlowBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&a2XPC5FlowBitRates.A2XMaximumFlowBitRate).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, &a2XPC5FlowBitRates.iEExtensions); err != nil { return err } - aMFTNLAssociationSetupItem.iEExtensions = &v } if extBit { - if err := aMFTNLAssociationSetupItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := a2XPC5FlowBitRates.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(aMFTNLAssociationToAddItem.extensions.Present()) - w.WriteBit(aMFTNLAssociationToAddItem.TNLAssociationUsage != nil) - w.WriteBit(aMFTNLAssociationToAddItem.iEExtensions != nil) - if err := aMFTNLAssociationToAddItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { +var extIEsA2XPC5FlowBitRates []ap.IESpec[ProtocolIEID, A2XPC5FlowBitRates] + +func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if a2XPC5FlowBitRates.A2XGuaranteedFlowBitRate.Diagnose(d) { + notComprehended = true + } + if a2XPC5FlowBitRates.A2XMaximumFlowBitRate.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, a2XPC5FlowBitRates.iEExtensions) + return notComprehended +} + +func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, a2XPC5QoSFlowItem.iEExtensions) + w.WriteBit(a2XPC5QoSFlowItem.extensions.Present()) + w.WriteBit(a2XPC5QoSFlowItem.A2XPC5FlowBitRates != nil) + w.WriteBit(a2XPC5QoSFlowItem.A2XRange != nil) + w.WriteBit(len(ext) > 0) + if err := a2XPC5QoSFlowItem.A2XPQI.MarshalPER(w, enc); err != nil { return err } - if aMFTNLAssociationToAddItem.TNLAssociationUsage != nil { - if err := (*aMFTNLAssociationToAddItem.TNLAssociationUsage).MarshalPER(w, enc); err != nil { + if a2XPC5QoSFlowItem.A2XPC5FlowBitRates != nil { + if err := (*a2XPC5QoSFlowItem.A2XPC5FlowBitRates).MarshalPER(w, enc); err != nil { return err } } - if err := aMFTNLAssociationToAddItem.TNLAddressWeightFactor.MarshalPER(w, enc); err != nil { - return err + if a2XPC5QoSFlowItem.A2XRange != nil { + if err := (*a2XPC5QoSFlowItem.A2XRange).MarshalPER(w, enc); err != nil { + return err + } } - if aMFTNLAssociationToAddItem.iEExtensions != nil { - if err := (*aMFTNLAssociationToAddItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if aMFTNLAssociationToAddItem.extensions.Present() { - if err := aMFTNLAssociationToAddItem.extensions.MarshalPER(w, enc); err != nil { + if a2XPC5QoSFlowItem.extensions.Present() { + if err := a2XPC5QoSFlowItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *a2XPC5QoSFlowItem = A2XPC5QoSFlowItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_TNLAssociationUsage, err := r.ReadBit() + p_A2XPC5FlowBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_A2XRange, err := r.ReadBit() if err != nil { return err } @@ -93,75 +126,107 @@ func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) UnmarshalPER(r *pe if err != nil { return err } - if err := (&aMFTNLAssociationToAddItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + if err := (&a2XPC5QoSFlowItem.A2XPQI).UnmarshalPER(r, enc); err != nil { return err } - if p_TNLAssociationUsage { - var v TNLAssociationUsage + if p_A2XPC5FlowBitRates { + var v A2XPC5FlowBitRates if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - aMFTNLAssociationToAddItem.TNLAssociationUsage = &v + a2XPC5QoSFlowItem.A2XPC5FlowBitRates = &v } - if err := (&aMFTNLAssociationToAddItem.TNLAddressWeightFactor).UnmarshalPER(r, enc); err != nil { - return err + if p_A2XRange { + var v A2XPC5QoSFlowItemA2XRange + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + a2XPC5QoSFlowItem.A2XRange = &v } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, &a2XPC5QoSFlowItem.iEExtensions); err != nil { return err } - aMFTNLAssociationToAddItem.iEExtensions = &v } if extBit { - if err := aMFTNLAssociationToAddItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := a2XPC5QoSFlowItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(aMFTNLAssociationToUpdateItem.extensions.Present()) - w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil) - w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor != nil) - w.WriteBit(aMFTNLAssociationToUpdateItem.iEExtensions != nil) - if err := aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { +var extIEsA2XPC5QoSFlowItem []ap.IESpec[ProtocolIEID, A2XPC5QoSFlowItem] + +func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if a2XPC5QoSFlowItem.A2XPQI.Diagnose(d) { + notComprehended = true + } + if a2XPC5QoSFlowItem.A2XPC5FlowBitRates != nil && a2XPC5QoSFlowItem.A2XPC5FlowBitRates.Diagnose(d) { + notComprehended = true + } + if a2XPC5QoSFlowItem.A2XRange != nil && a2XPC5QoSFlowItem.A2XRange.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, a2XPC5QoSFlowItem.iEExtensions) + return notComprehended +} + +func (a2XPC5QoSFlowItemA2XRange A2XPC5QoSFlowItemA2XRange) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumA2XPC5QoSFlowItemA2XRange.Encode(w, enc, a2XPC5QoSFlowItemA2XRange) +} + +func (a2XPC5QoSFlowItemA2XRange *A2XPC5QoSFlowItemA2XRange) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumA2XPC5QoSFlowItemA2XRange.Decode(r, enc) + if err != nil { return err } - if aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil { - if err := (*aMFTNLAssociationToUpdateItem.TNLAssociationUsage).MarshalPER(w, enc); err != nil { - return err - } + *a2XPC5QoSFlowItemA2XRange = v + return nil +} + +func (a2XPC5QoSFlowItemA2XRange A2XPC5QoSFlowItemA2XRange) Name() string { + return enumA2XPC5QoSFlowItemA2XRange.Name(a2XPC5QoSFlowItemA2XRange) +} + +func (a2XPC5QoSFlowItemA2XRange A2XPC5QoSFlowItemA2XRange) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumA2XPC5QoSFlowItemA2XRange.Known(a2XPC5QoSFlowItemA2XRange) +} + +func (a2XPC5QoSParameters *A2XPC5QoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, a2XPC5QoSParameters.iEExtensions) + w.WriteBit(a2XPC5QoSParameters.extensions.Present()) + w.WriteBit(a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates != nil) + w.WriteBit(len(ext) > 0) + if err := a2XPC5QoSParameters.A2XPC5QoSFlowList.MarshalPER(w, enc); err != nil { + return err } - if aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor != nil { - if err := (*aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor).MarshalPER(w, enc); err != nil { + if a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates != nil { + if err := (*a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates).MarshalPER(w, enc); err != nil { return err } } - if aMFTNLAssociationToUpdateItem.iEExtensions != nil { - if err := (*aMFTNLAssociationToUpdateItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if aMFTNLAssociationToUpdateItem.extensions.Present() { - if err := aMFTNLAssociationToUpdateItem.extensions.MarshalPER(w, enc); err != nil { + if a2XPC5QoSParameters.extensions.Present() { + if err := a2XPC5QoSParameters.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (a2XPC5QoSParameters *A2XPC5QoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *a2XPC5QoSParameters = A2XPC5QoSParameters{} extBit, err := r.ReadBit() if err != nil { return err } - p_TNLAssociationUsage, err := r.ReadBit() - if err != nil { - return err - } - p_TNLAddressWeightFactor, err := r.ReadBit() + p_A2XPC5LinkAggregateBitRates, err := r.ReadBit() if err != nil { return err } @@ -169,253 +234,321 @@ func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) UnmarshalPER if err != nil { return err } - if err := (&aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + if err := (&a2XPC5QoSParameters.A2XPC5QoSFlowList).UnmarshalPER(r, enc); err != nil { return err } - if p_TNLAssociationUsage { - var v TNLAssociationUsage - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - aMFTNLAssociationToUpdateItem.TNLAssociationUsage = &v - } - if p_TNLAddressWeightFactor { - var v TNLAddressWeightFactor + if p_A2XPC5LinkAggregateBitRates { + var v BitRate if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor = &v + a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates = &v } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, &a2XPC5QoSParameters.iEExtensions); err != nil { return err } - aMFTNLAssociationToUpdateItem.iEExtensions = &v } if extBit { - if err := aMFTNLAssociationToUpdateItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := a2XPC5QoSParameters.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(additionalDLUPTNLInformationForHOItemExtIEs, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions) - w.WriteBit(additionalDLUPTNLInformationForHOItem.extensions.Present()) - w.WriteBit(additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil) - w.WriteBit(len(ext) > 0) - if err := additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { - return err +var extIEsA2XPC5QoSParameters []ap.IESpec[ProtocolIEID, A2XPC5QoSParameters] + +func (a2XPC5QoSParameters *A2XPC5QoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if a2XPC5QoSParameters.A2XPC5QoSFlowList.Diagnose(d) { + notComprehended = true } - if err := additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse.MarshalPER(w, enc); err != nil { - return err + if a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates != nil && a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates.Diagnose(d) { + notComprehended = true } - if additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil { - if err := (*additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, a2XPC5QoSParameters.iEExtensions) + return notComprehended +} + +func (aIOTFName *AIOTFName) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAIOTFName, aIOTFName, aIOTFName.iEExtensions) + w.WriteBit(aIOTFName.extensions.Present()) + w.WriteBit(aIOTFName.AIOTFNameVisibleString != nil) + w.WriteBit(aIOTFName.AIOTFNameUTF8String != nil) + w.WriteBit(len(ext) > 0) + if aIOTFName.AIOTFNameVisibleString != nil { + if err := (*aIOTFName.AIOTFNameVisibleString).MarshalPER(w, enc); err != nil { + return err + } + } + if aIOTFName.AIOTFNameUTF8String != nil { + if err := (*aIOTFName.AIOTFNameUTF8String).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if additionalDLUPTNLInformationForHOItem.extensions.Present() { - if err := additionalDLUPTNLInformationForHOItem.extensions.MarshalPER(w, enc); err != nil { + if aIOTFName.extensions.Present() { + if err := aIOTFName.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aIOTFName *AIOTFName) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aIOTFName = AIOTFName{} extBit, err := r.ReadBit() if err != nil { return err } - p_AdditionalDLForwardingUPTNLInformation, err := r.ReadBit() + p_AIOTFNameVisibleString, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_AIOTFNameUTF8String, err := r.ReadBit() if err != nil { return err } - if err := (&additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse).UnmarshalPER(r, enc); err != nil { - return err + if p_AIOTFNameVisibleString { + var v AIOTFNameVisibleString + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + aIOTFName.AIOTFNameVisibleString = &v } - if p_AdditionalDLForwardingUPTNLInformation { - var v UPTransportLayerInformation + if p_AIOTFNameUTF8String { + var v AIOTFNameUTF8String if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation = &v + aIOTFName.AIOTFNameUTF8String = &v } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, additionalDLUPTNLInformationForHOItemExtIEs, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAIOTFName, aIOTFName, &aIOTFName.iEExtensions); err != nil { return err } } if extBit { - if err := additionalDLUPTNLInformationForHOItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := aIOTFName.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(allocationAndRetentionPriority.extensions.Present()) - w.WriteBit(allocationAndRetentionPriority.iEExtensions != nil) - if err := allocationAndRetentionPriority.PriorityLevelARP.MarshalPER(w, enc); err != nil { +var extIEsAIOTFName []ap.IESpec[ProtocolIEID, AIOTFName] + +func (aIOTFName *AIOTFName) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsAIOTFName, aIOTFName, aIOTFName.iEExtensions) + return notComprehended +} + +func (aIoTSupport AIoTSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAIoTSupport.Encode(w, enc, aIoTSupport) +} + +func (aIoTSupport *AIoTSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAIoTSupport.Decode(r, enc) + if err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(allocationAndRetentionPriority.PreemptionCapability), "PreemptionCapability"); err != nil { - return err + *aIoTSupport = v + return nil +} + +func (aIoTSupport AIoTSupport) Name() string { + return enumAIoTSupport.Name(aIoTSupport) +} + +func (aIoTSupport AIoTSupport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAIoTSupport.Known(aIoTSupport) +} + +func (aMFPagingTarget *AMFPagingTarget) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{aMFPagingTarget.GlobalRANNodeID != nil, aMFPagingTarget.TAI != nil, aMFPagingTarget.ChoiceExtension != nil} { + if ok { + set++ + } } - if err := encodeRootEnumerated(w, enc, 2, int64(allocationAndRetentionPriority.PreemptionVulnerability), "PreemptionVulnerability"); err != nil { - return err + if set > 1 { + return per.ErrChoice } - if allocationAndRetentionPriority.iEExtensions != nil { - if err := (*allocationAndRetentionPriority.iEExtensions).MarshalPER(w, enc); err != nil { + switch { + case aMFPagingTarget.GlobalRANNodeID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { return err } - } - if allocationAndRetentionPriority.extensions.Present() { - if err := allocationAndRetentionPriority.extensions.MarshalPER(w, enc); err != nil { + if err := (*aMFPagingTarget.GlobalRANNodeID).MarshalPER(w, enc); err != nil { + return err + } + case aMFPagingTarget.TAI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { return err } + if err := (*aMFPagingTarget.TAI).MarshalPER(w, enc); err != nil { + return err + } + case aMFPagingTarget.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, aMFPagingTarget.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err - } - if err := (&allocationAndRetentionPriority.PriorityLevelARP).UnmarshalPER(r, enc); err != nil { - return err - } - e1, err := decodeRootEnumerated(r, enc, 2, "PreemptionCapability") +func (aMFPagingTarget *AMFPagingTarget) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aMFPagingTarget = AMFPagingTarget{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) if err != nil { return err } - allocationAndRetentionPriority.PreemptionCapability = PreemptionCapability(e1) - e2, err := decodeRootEnumerated(r, enc, 2, "PreemptionVulnerability") - if err != nil { - return err - } - allocationAndRetentionPriority.PreemptionVulnerability = PreemptionVulnerability(e2) - if p_iEExtensions { - var v rawIEExtensions + switch idx { + case 0: + var v GlobalRANNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - allocationAndRetentionPriority.iEExtensions = &v - } - if extBit { - if err := allocationAndRetentionPriority.extensions.UnmarshalPER(r, enc); err != nil { + aMFPagingTarget.GlobalRANNodeID = &v + case 1: + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + aMFPagingTarget.TAI = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + aMFPagingTarget.ChoiceExtension = &f + } + default: + return per.ErrOverflow } return nil } -func (allowedNSSAIItem *AllowedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := allowedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { +func (aMFPagingTarget *AMFPagingTarget) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case aMFPagingTarget.GlobalRANNodeID != nil: + return aMFPagingTarget.GlobalRANNodeID.Diagnose(d) + case aMFPagingTarget.TAI != nil: + return aMFPagingTarget.TAI.Diagnose(d) + case aMFPagingTarget.ChoiceExtension != nil: + d.Unknown(aMFPagingTarget.ChoiceExtension.ID, aMFPagingTarget.ChoiceExtension.Criticality) + } + return false +} + +func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem.iEExtensions) + w.WriteBit(aMFTNLAssociationSetupItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := aMFTNLAssociationSetupItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if aMFTNLAssociationSetupItem.extensions.Present() { + if err := aMFTNLAssociationSetupItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (allowedNSSAIItem *AllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aMFTNLAssociationSetupItem = AMFTNLAssociationSetupItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&allowedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + if err := (&aMFTNLAssociationSetupItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, &aMFTNLAssociationSetupItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := aMFTNLAssociationSetupItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (associatedQosFlowItem *AssociatedQosFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(associatedQosFlowItem.extensions.Present()) - w.WriteBit(associatedQosFlowItem.QosFlowMappingIndication != nil) - w.WriteBit(associatedQosFlowItem.iEExtensions != nil) - if err := associatedQosFlowItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { +var extIEsAMFTNLAssociationSetupItem []ap.IESpec[ProtocolIEID, AMFTNLAssociationSetupItem] + +func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if aMFTNLAssociationSetupItem.AMFTNLAssociationAddress.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem.iEExtensions) + return notComprehended +} + +func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem.iEExtensions) + w.WriteBit(aMFTNLAssociationToAddItem.extensions.Present()) + w.WriteBit(aMFTNLAssociationToAddItem.TNLAssociationUsage != nil) + w.WriteBit(len(ext) > 0) + if err := aMFTNLAssociationToAddItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { return err } - if associatedQosFlowItem.QosFlowMappingIndication != nil { - if err := encodeRootEnumerated(w, enc, 2, int64((*associatedQosFlowItem.QosFlowMappingIndication)), "QosFlowMappingIndication"); err != nil { + if aMFTNLAssociationToAddItem.TNLAssociationUsage != nil { + if err := (*aMFTNLAssociationToAddItem.TNLAssociationUsage).MarshalPER(w, enc); err != nil { return err } } - if associatedQosFlowItem.iEExtensions != nil { - if err := (*associatedQosFlowItem.iEExtensions).MarshalPER(w, enc); err != nil { + if err := aMFTNLAssociationToAddItem.TNLAddressWeightFactor.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if associatedQosFlowItem.extensions.Present() { - if err := associatedQosFlowItem.extensions.MarshalPER(w, enc); err != nil { + if aMFTNLAssociationToAddItem.extensions.Present() { + if err := aMFTNLAssociationToAddItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (associatedQosFlowItem *AssociatedQosFlowItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aMFTNLAssociationToAddItem = AMFTNLAssociationToAddItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_QosFlowMappingIndication, err := r.ReadBit() + p_TNLAssociationUsage, err := r.ReadBit() if err != nil { return err } @@ -423,1000 +556,1132 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) UnmarshalPER(r *per.Reader, if err != nil { return err } - if err := (&associatedQosFlowItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&aMFTNLAssociationToAddItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { return err } - if p_QosFlowMappingIndication { - var v QosFlowMappingIndication - e1, err := decodeRootEnumerated(r, enc, 2, "QosFlowMappingIndication") - if err != nil { + if p_TNLAssociationUsage { + var v TNLAssociationUsage + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - v = QosFlowMappingIndication(e1) - associatedQosFlowItem.QosFlowMappingIndication = &v + aMFTNLAssociationToAddItem.TNLAssociationUsage = &v + } + if err := (&aMFTNLAssociationToAddItem.TNLAddressWeightFactor).UnmarshalPER(r, enc); err != nil { + return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, &aMFTNLAssociationToAddItem.iEExtensions); err != nil { return err } - associatedQosFlowItem.iEExtensions = &v } if extBit { - if err := associatedQosFlowItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := aMFTNLAssociationToAddItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (broadcastPLMNItem *BroadcastPLMNItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := broadcastPLMNItem.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err +var extIEsAMFTNLAssociationToAddItem []ap.IESpec[ProtocolIEID, AMFTNLAssociationToAddItem] + +func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if aMFTNLAssociationToAddItem.AMFTNLAssociationAddress.Diagnose(d) { + notComprehended = true } - if err := broadcastPLMNItem.TAISliceSupportList.MarshalPER(w, enc); err != nil { + if aMFTNLAssociationToAddItem.TNLAssociationUsage != nil && aMFTNLAssociationToAddItem.TNLAssociationUsage.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem.iEExtensions) + return notComprehended +} + +func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem.iEExtensions) + w.WriteBit(aMFTNLAssociationToRemoveItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := aMFTNLAssociationToRemoveItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if aMFTNLAssociationToRemoveItem.extensions.Present() { + if err := aMFTNLAssociationToRemoveItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (broadcastPLMNItem *BroadcastPLMNItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aMFTNLAssociationToRemoveItem = AMFTNLAssociationToRemoveItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&broadcastPLMNItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&broadcastPLMNItem.TAISliceSupportList).UnmarshalPER(r, enc); err != nil { + if err := (&aMFTNLAssociationToRemoveItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, &aMFTNLAssociationToRemoveItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := aMFTNLAssociationToRemoveItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { + } + return nil +} + +var extIEsAMFTNLAssociationToRemoveItem = []ap.IESpec[ProtocolIEID, AMFTNLAssociationToRemoveItem]{ + { + ID: IDTNLAssociationTransportLayerAddressNGRAN, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *AMFTNLAssociationToRemoveItem, r *per.Reader, enc per.Encoding) error { + var v CPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } + x.TNLAssociationTransportLayerAddressNGRAN = &v + return nil + }, + Encode: func(x *AMFTNLAssociationToRemoveItem) (per.Marshaler, bool) { + if x.TNLAssociationTransportLayerAddressNGRAN == nil { + return nil, false + } + return x.TNLAssociationTransportLayerAddressNGRAN, true + }, + }, +} + +func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if aMFTNLAssociationToRemoveItem.AMFTNLAssociationAddress.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem.iEExtensions) + return notComprehended } -func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cancelledCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { +func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem.iEExtensions) + w.WriteBit(aMFTNLAssociationToUpdateItem.extensions.Present()) + w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil) + w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor != nil) + w.WriteBit(len(ext) > 0) + if err := aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInEAIEUTRAItem.NumberOfBroadcasts)); err != nil { - return err + if aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil { + if err := (*aMFTNLAssociationToUpdateItem.TNLAssociationUsage).MarshalPER(w, enc); err != nil { + return err + } + } + if aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor != nil { + if err := (*aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if aMFTNLAssociationToUpdateItem.extensions.Present() { + if err := aMFTNLAssociationToUpdateItem.extensions.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aMFTNLAssociationToUpdateItem = AMFTNLAssociationToUpdateItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_TNLAssociationUsage, err := r.ReadBit() if err != nil { return err } - if err := (&cancelledCellsInEAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { + p_TNLAddressWeightFactor, err := r.ReadBit() + if err != nil { return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - cancelledCellsInEAIEUTRAItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions + if err := (&aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TNLAssociationUsage { + var v TNLAssociationUsage if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + aMFTNLAssociationToUpdateItem.TNLAssociationUsage = &v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_TNLAddressWeightFactor { + var v TNLAddressWeightFactor + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, &aMFTNLAssociationToUpdateItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := aMFTNLAssociationToUpdateItem.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } -func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cancelledCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { +var extIEsAMFTNLAssociationToUpdateItem []ap.IESpec[ProtocolIEID, AMFTNLAssociationToUpdateItem] + +func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress.Diagnose(d) { + notComprehended = true + } + if aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil && aMFTNLAssociationToUpdateItem.TNLAssociationUsage.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem.iEExtensions) + return notComprehended +} + +func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, aUN3DeviceAccessInfo.iEExtensions) + w.WriteBit(aUN3DeviceAccessInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := aUN3DeviceAccessInfo.AUN3DeviceAccess.MarshalPER(w, enc); err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInEAINRItem.NumberOfBroadcasts)); err != nil { + if err := aUN3DeviceAccessInfo.ExistingNGConnectionwithSameLocation.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if aUN3DeviceAccessInfo.extensions.Present() { + if err := aUN3DeviceAccessInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aUN3DeviceAccessInfo = AUN3DeviceAccessInfo{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&cancelledCellsInEAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { + if err := (&aUN3DeviceAccessInfo.AUN3DeviceAccess).UnmarshalPER(r, enc); err != nil { return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + if err := (&aUN3DeviceAccessInfo.ExistingNGConnectionwithSameLocation).UnmarshalPER(r, enc); err != nil { return err } - cancelledCellsInEAINRItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, &aUN3DeviceAccessInfo.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := aUN3DeviceAccessInfo.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cancelledCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { - return err +var extIEsAUN3DeviceAccessInfo []ap.IESpec[ProtocolIEID, AUN3DeviceAccessInfo] + +func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if aUN3DeviceAccessInfo.AUN3DeviceAccess.Diagnose(d) { + notComprehended = true } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInTAIEUTRAItem.NumberOfBroadcasts)); err != nil { - return err + if aUN3DeviceAccessInfo.ExistingNGConnectionwithSameLocation.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, aUN3DeviceAccessInfo.iEExtensions) + return notComprehended } -func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (aUN3DeviceAccessInfoAUN3DeviceAccess AUN3DeviceAccessInfoAUN3DeviceAccess) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAUN3DeviceAccessInfoAUN3DeviceAccess.Encode(w, enc, aUN3DeviceAccessInfoAUN3DeviceAccess) +} + +func (aUN3DeviceAccessInfoAUN3DeviceAccess *AUN3DeviceAccessInfoAUN3DeviceAccess) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAUN3DeviceAccessInfoAUN3DeviceAccess.Decode(r, enc) if err != nil { return err } - p_f2, err := r.ReadBit() + *aUN3DeviceAccessInfoAUN3DeviceAccess = v + return nil +} + +func (aUN3DeviceAccessInfoAUN3DeviceAccess AUN3DeviceAccessInfoAUN3DeviceAccess) Name() string { + return enumAUN3DeviceAccessInfoAUN3DeviceAccess.Name(aUN3DeviceAccessInfoAUN3DeviceAccess) +} + +func (aUN3DeviceAccessInfoAUN3DeviceAccess AUN3DeviceAccessInfoAUN3DeviceAccess) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAUN3DeviceAccessInfoAUN3DeviceAccess.Known(aUN3DeviceAccessInfoAUN3DeviceAccess) +} + +func (aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation.Encode(w, enc, aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) +} + +func (aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation *AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation.Decode(r, enc) if err != nil { return err } - if err := (&cancelledCellsInTAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { + *aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation = v + return nil +} + +func (aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) Name() string { + return enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation.Name(aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) +} + +func (aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation.Known(aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) +} + +func (activationStatus ActivationStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumActivationStatus.Encode(w, enc, activationStatus) +} + +func (activationStatus *ActivationStatus) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumActivationStatus.Decode(r, enc) + if err != nil { return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + *activationStatus = v + return nil +} + +func (activationStatus ActivationStatus) Name() string { + return enumActivationStatus.Name(activationStatus) +} + +func (activationStatus ActivationStatus) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumActivationStatus.Known(activationStatus) +} + +func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlocationReportingReferenceIDItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem.iEExtensions) + w.WriteBit(additionalCancelledlocationReportingReferenceIDItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := additionalCancelledlocationReportingReferenceIDItem.LocationReportingReferenceIDToBeCancelled.MarshalPER(w, enc); err != nil { return err } - cancelledCellsInTAIEUTRAItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if additionalCancelledlocationReportingReferenceIDItem.extensions.Present() { + if err := additionalCancelledlocationReportingReferenceIDItem.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - -func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cancelledCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { - return err - } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInTAINRItem.NumberOfBroadcasts)); err != nil { - return err } return nil } -func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlocationReportingReferenceIDItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *additionalCancelledlocationReportingReferenceIDItem = AdditionalCancelledlocationReportingReferenceIDItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&cancelledCellsInTAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { - return err - } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + if err := (&additionalCancelledlocationReportingReferenceIDItem.LocationReportingReferenceIDToBeCancelled).UnmarshalPER(r, enc); err != nil { return err } - cancelledCellsInTAINRItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, &additionalCancelledlocationReportingReferenceIDItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := additionalCancelledlocationReportingReferenceIDItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cellIDBroadcastEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { - return err +var extIEsAdditionalCancelledlocationReportingReferenceIDItem []ap.IESpec[ProtocolIEID, AdditionalCancelledlocationReportingReferenceIDItem] + +func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlocationReportingReferenceIDItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if additionalCancelledlocationReportingReferenceIDItem.LocationReportingReferenceIDToBeCancelled.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem.iEExtensions) + return notComprehended } -func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f1, err := r.ReadBit() - if err != nil { +func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem.iEExtensions) + w.WriteBit(additionalDLUPTNLInformationForHOItem.extensions.Present()) + w.WriteBit(additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil) + w.WriteBit(len(ext) > 0) + if err := additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } - if err := (&cellIDBroadcastEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { + if err := additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse.MarshalPER(w, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil { + if err := (*additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } - return nil -} - -func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cellIDBroadcastNRItem.NRCGI.MarshalPER(w, enc); err != nil { - return err + if additionalDLUPTNLInformationForHOItem.extensions.Present() { + if err := additionalDLUPTNLInformationForHOItem.extensions.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *additionalDLUPTNLInformationForHOItem = AdditionalDLUPTNLInformationForHOItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_AdditionalDLForwardingUPTNLInformation, err := r.ReadBit() if err != nil { return err } - if err := (&cellIDBroadcastNRItem.NRCGI).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_AdditionalDLForwardingUPTNLInformation { + var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions); err != nil { + return err + } } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := additionalDLUPTNLInformationForHOItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { + } + return nil +} + +var extIEsAdditionalDLUPTNLInformationForHOItem = []ap.IESpec[ProtocolIEID, AdditionalDLUPTNLInformationForHOItem]{ + { + ID: IDAdditionalRedundantDLNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AdditionalDLUPTNLInformationForHOItem, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } + x.AdditionalRedundantDLNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *AdditionalDLUPTNLInformationForHOItem) (per.Marshaler, bool) { + if x.AdditionalRedundantDLNGUUPTNLInformation == nil { + return nil, false + } + return x.AdditionalRedundantDLNGUUPTNLInformation, true + }, + }, +} + +func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse.Diagnose(d) { + notComprehended = true + } + if additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil && additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem.iEExtensions) + return notComprehended +} + +func (additionalQosFlowInformation AdditionalQosFlowInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAdditionalQosFlowInformation.Encode(w, enc, additionalQosFlowInformation) +} + +func (additionalQosFlowInformation *AdditionalQosFlowInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAdditionalQosFlowInformation.Decode(r, enc) + if err != nil { + return err } + *additionalQosFlowInformation = v return nil } -func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cellIDCancelledEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { +func (additionalQosFlowInformation AdditionalQosFlowInformation) Name() string { + return enumAdditionalQosFlowInformation.Name(additionalQosFlowInformation) +} + +func (additionalQosFlowInformation AdditionalQosFlowInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAdditionalQosFlowInformation.Known(additionalQosFlowInformation) +} + +func (additionalULI *AdditionalULI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAdditionalULI, additionalULI, additionalULI.iEExtensions) + w.WriteBit(additionalULI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := additionalULI.NRCGI.MarshalPER(w, enc); err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledEUTRAItem.NumberOfBroadcasts)); err != nil { + if err := additionalULI.TAI.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if additionalULI.extensions.Present() { + if err := additionalULI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (additionalULI *AdditionalULI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *additionalULI = AdditionalULI{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&cellIDCancelledEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { + if err := (&additionalULI.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + if err := (&additionalULI.TAI).UnmarshalPER(r, enc); err != nil { return err } - cellIDCancelledEUTRAItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalULI, additionalULI, &additionalULI.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := additionalULI.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (cellIDCancelledNRItem *CellIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cellIDCancelledNRItem.NRCGI.MarshalPER(w, enc); err != nil { +var extIEsAdditionalULI []ap.IESpec[ProtocolIEID, AdditionalULI] + +func (additionalULI *AdditionalULI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if additionalULI.NRCGI.Diagnose(d) { + notComprehended = true + } + if additionalULI.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAdditionalULI, additionalULI, additionalULI.iEExtensions) + return notComprehended +} + +func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, aerialUEFlightInformationReporting.iEExtensions) + w.WriteBit(aerialUEFlightInformationReporting.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: -420, HasLB: true, UB: 10000, HasUB: true, Extensible: true}, int64(aerialUEFlightInformationReporting.Altitude)); err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledNRItem.NumberOfBroadcasts)); err != nil { + if err := aerialUEFlightInformationReporting.TimeStamp.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if aerialUEFlightInformationReporting.extensions.Present() { + if err := aerialUEFlightInformationReporting.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (cellIDCancelledNRItem *CellIDCancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aerialUEFlightInformationReporting = AerialUEFlightInformationReporting{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&cellIDCancelledNRItem.NRCGI).UnmarshalPER(r, enc); err != nil { + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: -420, HasLB: true, UB: 10000, HasUB: true, Extensible: true}) + if err != nil { return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + aerialUEFlightInformationReporting.Altitude = Altitude(n0) + if err := (&aerialUEFlightInformationReporting.TimeStamp).UnmarshalPER(r, enc); err != nil { return err } - cellIDCancelledNRItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, &aerialUEFlightInformationReporting.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := aerialUEFlightInformationReporting.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(cellType.extensions.Present()) - w.WriteBit(cellType.iEExtensions != nil) - if err := cellType.CellSize.MarshalPER(w, enc); err != nil { +var extIEsAerialUEFlightInformationReporting []ap.IESpec[ProtocolIEID, AerialUEFlightInformationReporting] + +func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, aerialUEFlightInformationReporting.iEExtensions) + return notComprehended +} + +func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReportingControl) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl.iEExtensions) + w.WriteBit(aerialUEFlightInformationReportingControl.extensions.Present()) + w.WriteBit(aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity != nil) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: -420, HasLB: true, UB: 10000, HasUB: true, Extensible: true}, int64(aerialUEFlightInformationReportingControl.HigherAltitudeThreshold)); err != nil { return err } - if cellType.iEExtensions != nil { - if err := (*cellType.iEExtensions).MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: -420, HasLB: true, UB: 10000, HasUB: true, Extensible: true}, int64(aerialUEFlightInformationReportingControl.LowerAltitudeThreshold)); err != nil { + return err + } + if aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity != nil { + if err := (*aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity).MarshalPER(w, enc); err != nil { return err } } - if cellType.extensions.Present() { - if err := cellType.extensions.MarshalPER(w, enc); err != nil { + if err := aerialUEFlightInformationReportingControl.AreaID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if aerialUEFlightInformationReportingControl.extensions.Present() { + if err := aerialUEFlightInformationReportingControl.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReportingControl) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aerialUEFlightInformationReportingControl = AerialUEFlightInformationReportingControl{} extBit, err := r.ReadBit() if err != nil { return err } + p_AerialUEReportPeriodicity, err := r.ReadBit() + if err != nil { + return err + } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&cellType.CellSize).UnmarshalPER(r, enc); err != nil { + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: -420, HasLB: true, UB: 10000, HasUB: true, Extensible: true}) + if err != nil { return err } - if p_iEExtensions { - var v transparentIEExtensions + aerialUEFlightInformationReportingControl.HigherAltitudeThreshold = Altitude(n0) + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: -420, HasLB: true, UB: 10000, HasUB: true, Extensible: true}) + if err != nil { + return err + } + aerialUEFlightInformationReportingControl.LowerAltitudeThreshold = Altitude(n1) + if p_AerialUEReportPeriodicity { + var v AerialUEReportingPeriodicity if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - cellType.iEExtensions = &v + aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity = &v + } + if err := (&aerialUEFlightInformationReportingControl.AreaID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, &aerialUEFlightInformationReportingControl.iEExtensions); err != nil { + return err + } } if extBit { - if err := cellType.extensions.UnmarshalPER(r, enc); err != nil { + if err := aerialUEFlightInformationReportingControl.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := completedCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { +var extIEsAerialUEFlightInformationReportingControl []ap.IESpec[ProtocolIEID, AerialUEFlightInformationReportingControl] + +func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReportingControl) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity != nil && aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity.Diagnose(d) { + notComprehended = true + } + if aerialUEFlightInformationReportingControl.AreaID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl.iEExtensions) + return notComprehended +} + +func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationReportingControlItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem.iEExtensions) + w.WriteBit(aerialUEFlightInformationReportingControlItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := aerialUEFlightInformationReportingControlItem.AerialUEFlightInformationReportingControl.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if aerialUEFlightInformationReportingControlItem.extensions.Present() { + if err := aerialUEFlightInformationReportingControlItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationReportingControlItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *aerialUEFlightInformationReportingControlItem = AerialUEFlightInformationReportingControlItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&completedCellsInEAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { + if err := (&aerialUEFlightInformationReportingControlItem.AerialUEFlightInformationReportingControl).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, &aerialUEFlightInformationReportingControlItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := aerialUEFlightInformationReportingControlItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := completedCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { +var extIEsAerialUEFlightInformationReportingControlItem []ap.IESpec[ProtocolIEID, AerialUEFlightInformationReportingControlItem] + +func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationReportingControlItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if aerialUEFlightInformationReportingControlItem.AerialUEFlightInformationReportingControl.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem.iEExtensions) + return notComprehended +} + +func (aerialUEReportingPeriodicity AerialUEReportingPeriodicity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAerialUEReportingPeriodicity.Encode(w, enc, aerialUEReportingPeriodicity) +} + +func (aerialUEReportingPeriodicity *AerialUEReportingPeriodicity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAerialUEReportingPeriodicity.Decode(r, enc) + if err != nil { return err } + *aerialUEReportingPeriodicity = v return nil } -func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (aerialUEReportingPeriodicity AerialUEReportingPeriodicity) Name() string { + return enumAerialUEReportingPeriodicity.Name(aerialUEReportingPeriodicity) +} + +func (aerialUEReportingPeriodicity AerialUEReportingPeriodicity) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAerialUEReportingPeriodicity.Known(aerialUEReportingPeriodicity) +} + +func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAerialUEsubscriptionInformation.Encode(w, enc, aerialUEsubscriptionInformation) +} + +func (aerialUEsubscriptionInformation *AerialUEsubscriptionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAerialUEsubscriptionInformation.Decode(r, enc) if err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { + *aerialUEsubscriptionInformation = v + return nil +} + +func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) Name() string { + return enumAerialUEsubscriptionInformation.Name(aerialUEsubscriptionInformation) +} + +func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAerialUEsubscriptionInformation.Known(aerialUEsubscriptionInformation) +} + +func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) + w.WriteBit(allocationAndRetentionPriority.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := allocationAndRetentionPriority.PriorityLevelARP.MarshalPER(w, enc); err != nil { return err } - if err := (&completedCellsInEAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { + if err := allocationAndRetentionPriority.PreemptionCapability.MarshalPER(w, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := allocationAndRetentionPriority.PreemptionVulnerability.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if allocationAndRetentionPriority.extensions.Present() { + if err := allocationAndRetentionPriority.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := completedCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { - return err - } - return nil -} - -func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *allocationAndRetentionPriority = AllocationAndRetentionPriority{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&completedCellsInTAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { + if err := (&allocationAndRetentionPriority.PriorityLevelARP).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&allocationAndRetentionPriority.PreemptionCapability).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&allocationAndRetentionPriority.PreemptionVulnerability).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := allocationAndRetentionPriority.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := completedCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { +var extIEsAllocationAndRetentionPriority []ap.IESpec[ProtocolIEID, AllocationAndRetentionPriority] + +func (allocationAndRetentionPriority *AllocationAndRetentionPriority) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if allocationAndRetentionPriority.PreemptionCapability.Diagnose(d) { + notComprehended = true + } + if allocationAndRetentionPriority.PreemptionVulnerability.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) + return notComprehended +} + +func (allowedNSSAIItem *AllowedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAllowedNSSAIItem, allowedNSSAIItem, allowedNSSAIItem.iEExtensions) + w.WriteBit(allowedNSSAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := allowedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if allowedNSSAIItem.extensions.Present() { + if err := allowedNSSAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (allowedNSSAIItem *AllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *allowedNSSAIItem = AllowedNSSAIItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&completedCellsInTAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { + if err := (&allowedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllowedNSSAIItem, allowedNSSAIItem, &allowedNSSAIItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := allowedNSSAIItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { +var extIEsAllowedNSSAIItem []ap.IESpec[ProtocolIEID, AllowedNSSAIItem] + +func (allowedNSSAIItem *AllowedNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if allowedNSSAIItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAllowedNSSAIItem, allowedNSSAIItem, allowedNSSAIItem.iEExtensions) + return notComprehended +} + +func (allowedPNINPNItem *AllowedPNINPNItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAllowedPNINPNItem, allowedPNINPNItem, allowedPNINPNItem.iEExtensions) + w.WriteBit(allowedPNINPNItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := allowedPNINPNItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(criticalityDiagnosticsIEItem.IEID)); err != nil { + if err := allowedPNINPNItem.PNINPNrestricted.MarshalPER(w, enc); err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(criticalityDiagnosticsIEItem.TypeOfError), "TypeOfError"); err != nil { + if err := allowedPNINPNItem.AllowedCAGListperPLMN.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if allowedPNINPNItem.extensions.Present() { + if err := allowedPNINPNItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (allowedPNINPNItem *AllowedPNINPNItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *allowedPNINPNItem = AllowedPNINPNItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - e0, err := per.DecodeEnumerated(r, enc, 3, false) - if err != nil { + if err := (&allowedPNINPNItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - criticalityDiagnosticsIEItem.IECriticality = Criticality(e0) - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + if err := (&allowedPNINPNItem.PNINPNrestricted).UnmarshalPER(r, enc); err != nil { return err } - criticalityDiagnosticsIEItem.IEID = ProtocolIEID(n1) - e2, err := decodeRootEnumerated(r, enc, 2, "TypeOfError") - if err != nil { + if err := (&allowedPNINPNItem.AllowedCAGListperPLMN).UnmarshalPER(r, enc); err != nil { return err } - criticalityDiagnosticsIEItem.TypeOfError = TypeOfError(e2) - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllowedPNINPNItem, allowedPNINPNItem, &allowedPNINPNItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := allowedPNINPNItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(dRBsToQosFlowsMappingItem.extensions.Present()) - w.WriteBit(dRBsToQosFlowsMappingItem.iEExtensions != nil) - if err := dRBsToQosFlowsMappingItem.DRBID.MarshalPER(w, enc); err != nil { - return err - } - if err := dRBsToQosFlowsMappingItem.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { - return err - } - if dRBsToQosFlowsMappingItem.iEExtensions != nil { - if err := (*dRBsToQosFlowsMappingItem.iEExtensions).MarshalPER(w, enc); err != nil { - return err - } - } - if dRBsToQosFlowsMappingItem.extensions.Present() { - if err := dRBsToQosFlowsMappingItem.extensions.MarshalPER(w, enc); err != nil { - return err - } +var extIEsAllowedPNINPNItem []ap.IESpec[ProtocolIEID, AllowedPNINPNItem] + +func (allowedPNINPNItem *AllowedPNINPNItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if allowedPNINPNItem.PNINPNrestricted.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsAllowedPNINPNItem, allowedPNINPNItem, allowedPNINPNItem.iEExtensions) + return notComprehended } -func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() +func (allowedPNINPNItemPNINPNrestricted AllowedPNINPNItemPNINPNrestricted) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAllowedPNINPNItemPNINPNrestricted.Encode(w, enc, allowedPNINPNItemPNINPNrestricted) +} + +func (allowedPNINPNItemPNINPNrestricted *AllowedPNINPNItemPNINPNrestricted) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAllowedPNINPNItemPNINPNrestricted.Decode(r, enc) if err != nil { return err } - if err := (&dRBsToQosFlowsMappingItem.DRBID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&dRBsToQosFlowsMappingItem.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { + *allowedPNINPNItemPNINPNrestricted = v + return nil +} + +func (allowedPNINPNItemPNINPNrestricted AllowedPNINPNItemPNINPNrestricted) Name() string { + return enumAllowedPNINPNItemPNINPNrestricted.Name(allowedPNINPNItemPNINPNrestricted) +} + +func (allowedPNINPNItemPNINPNrestricted AllowedPNINPNItemPNINPNrestricted) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAllowedPNINPNItemPNINPNrestricted.Known(allowedPNINPNItemPNINPNrestricted) +} + +func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, alternativeQoSParaSetItem.iEExtensions) + w.WriteBit(alternativeQoSParaSetItem.extensions.Present()) + w.WriteBit(alternativeQoSParaSetItem.GuaranteedFlowBitRateDL != nil) + w.WriteBit(alternativeQoSParaSetItem.GuaranteedFlowBitRateUL != nil) + w.WriteBit(alternativeQoSParaSetItem.PacketDelayBudget != nil) + w.WriteBit(alternativeQoSParaSetItem.PacketErrorRate != nil) + w.WriteBit(len(ext) > 0) + if err := alternativeQoSParaSetItem.AlternativeQoSParaSetIndex.MarshalPER(w, enc); err != nil { return err } - if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if alternativeQoSParaSetItem.GuaranteedFlowBitRateDL != nil { + if err := (*alternativeQoSParaSetItem.GuaranteedFlowBitRateDL).MarshalPER(w, enc); err != nil { return err } - dRBsToQosFlowsMappingItem.iEExtensions = &v } - if extBit { - if err := dRBsToQosFlowsMappingItem.extensions.UnmarshalPER(r, enc); err != nil { + if alternativeQoSParaSetItem.GuaranteedFlowBitRateUL != nil { + if err := (*alternativeQoSParaSetItem.GuaranteedFlowBitRateUL).MarshalPER(w, enc); err != nil { return err } } - return nil -} - -func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(dataForwardingResponseDRBItem.extensions.Present()) - w.WriteBit(dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil) - w.WriteBit(dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil) - w.WriteBit(dataForwardingResponseDRBItem.iEExtensions != nil) - if err := dataForwardingResponseDRBItem.DRBID.MarshalPER(w, enc); err != nil { - return err - } - if dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil { - if err := (*dataForwardingResponseDRBItem.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + if alternativeQoSParaSetItem.PacketDelayBudget != nil { + if err := (*alternativeQoSParaSetItem.PacketDelayBudget).MarshalPER(w, enc); err != nil { return err } } - if dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil { - if err := (*dataForwardingResponseDRBItem.ULForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + if alternativeQoSParaSetItem.PacketErrorRate != nil { + if err := (*alternativeQoSParaSetItem.PacketErrorRate).MarshalPER(w, enc); err != nil { return err } } - if dataForwardingResponseDRBItem.iEExtensions != nil { - if err := (*dataForwardingResponseDRBItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if dataForwardingResponseDRBItem.extensions.Present() { - if err := dataForwardingResponseDRBItem.extensions.MarshalPER(w, enc); err != nil { + if alternativeQoSParaSetItem.extensions.Present() { + if err := alternativeQoSParaSetItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *alternativeQoSParaSetItem = AlternativeQoSParaSetItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwardingUPTNLInformation, err := r.ReadBit() + p_GuaranteedFlowBitRateDL, err := r.ReadBit() if err != nil { return err } - p_ULForwardingUPTNLInformation, err := r.ReadBit() + p_GuaranteedFlowBitRateUL, err := r.ReadBit() + if err != nil { + return err + } + p_PacketDelayBudget, err := r.ReadBit() + if err != nil { + return err + } + p_PacketErrorRate, err := r.ReadBit() if err != nil { return err } @@ -1424,157 +1689,316 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER if err != nil { return err } - if err := (&dataForwardingResponseDRBItem.DRBID).UnmarshalPER(r, enc); err != nil { + if err := (&alternativeQoSParaSetItem.AlternativeQoSParaSetIndex).UnmarshalPER(r, enc); err != nil { return err } - if p_DLForwardingUPTNLInformation { - var v UPTransportLayerInformation + if p_GuaranteedFlowBitRateDL { + var v BitRate if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - dataForwardingResponseDRBItem.DLForwardingUPTNLInformation = &v + alternativeQoSParaSetItem.GuaranteedFlowBitRateDL = &v } - if p_ULForwardingUPTNLInformation { - var v UPTransportLayerInformation + if p_GuaranteedFlowBitRateUL { + var v BitRate if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - dataForwardingResponseDRBItem.ULForwardingUPTNLInformation = &v + alternativeQoSParaSetItem.GuaranteedFlowBitRateUL = &v } - if p_iEExtensions { - var v rawIEExtensions + if p_PacketDelayBudget { + var v PacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + alternativeQoSParaSetItem.PacketDelayBudget = &v + } + if p_PacketErrorRate { + var v PacketErrorRate if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - dataForwardingResponseDRBItem.iEExtensions = &v + alternativeQoSParaSetItem.PacketErrorRate = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, &alternativeQoSParaSetItem.iEExtensions); err != nil { + return err + } } if extBit { - if err := dataForwardingResponseDRBItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := alternativeQoSParaSetItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(dataForwardingResponseERABListItem.extensions.Present()) - w.WriteBit(dataForwardingResponseERABListItem.iEExtensions != nil) - if err := dataForwardingResponseERABListItem.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsAlternativeQoSParaSetItem = []ap.IESpec[ProtocolIEID, AlternativeQoSParaSetItem]{ + { + ID: IDMaximumDataBurstVolume, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { + var v MaximumDataBurstVolume + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MaximumDataBurstVolume = &v + return nil + }, + Encode: func(x *AlternativeQoSParaSetItem) (per.Marshaler, bool) { + if x.MaximumDataBurstVolume == nil { + return nil, false + } + return x.MaximumDataBurstVolume, true + }, + }, + { + ID: IDPduSetDelayBudgetDownlink, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSetDelayBudgetDownlink = &v + return nil + }, + Encode: func(x *AlternativeQoSParaSetItem) (per.Marshaler, bool) { + if x.PduSetDelayBudgetDownlink == nil { + return nil, false + } + return x.PduSetDelayBudgetDownlink, true + }, + }, + { + ID: IDPduSetDelayBudgetUplink, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSetDelayBudgetUplink = &v + return nil + }, + Encode: func(x *AlternativeQoSParaSetItem) (per.Marshaler, bool) { + if x.PduSetDelayBudgetUplink == nil { + return nil, false + } + return x.PduSetDelayBudgetUplink, true + }, + }, + { + ID: IDPduSetErrorRateDownlink, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { + var v PacketErrorRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSetErrorRateDownlink = &v + return nil + }, + Encode: func(x *AlternativeQoSParaSetItem) (per.Marshaler, bool) { + if x.PduSetErrorRateDownlink == nil { + return nil, false + } + return x.PduSetErrorRateDownlink, true + }, + }, + { + ID: IDPduSetErrorRateUplink, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { + var v PacketErrorRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSetErrorRateUplink = &v + return nil + }, + Encode: func(x *AlternativeQoSParaSetItem) (per.Marshaler, bool) { + if x.PduSetErrorRateUplink == nil { + return nil, false + } + return x.PduSetErrorRateUplink, true + }, + }, +} + +func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if alternativeQoSParaSetItem.AlternativeQoSParaSetIndex.Diagnose(d) { + notComprehended = true } - if err := dataForwardingResponseERABListItem.DLForwardingUPTNLInformation.MarshalPER(w, enc); err != nil { - return err + if alternativeQoSParaSetItem.GuaranteedFlowBitRateDL != nil && alternativeQoSParaSetItem.GuaranteedFlowBitRateDL.Diagnose(d) { + notComprehended = true } - if dataForwardingResponseERABListItem.iEExtensions != nil { - if err := (*dataForwardingResponseERABListItem.iEExtensions).MarshalPER(w, enc); err != nil { - return err + if alternativeQoSParaSetItem.GuaranteedFlowBitRateUL != nil && alternativeQoSParaSetItem.GuaranteedFlowBitRateUL.Diagnose(d) { + notComprehended = true + } + if alternativeQoSParaSetItem.PacketDelayBudget != nil && alternativeQoSParaSetItem.PacketDelayBudget.Diagnose(d) { + notComprehended = true + } + if alternativeQoSParaSetItem.PacketErrorRate != nil && alternativeQoSParaSetItem.PacketErrorRate.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, alternativeQoSParaSetItem.iEExtensions) + return notComprehended +} + +func (areaID *AreaID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{areaID.TAI != nil, areaID.GlobalRANNodeID != nil, areaID.NRCGI != nil, areaID.ChoiceExtension != nil} { + if ok { + set++ } } - if dataForwardingResponseERABListItem.extensions.Present() { - if err := dataForwardingResponseERABListItem.extensions.MarshalPER(w, enc); err != nil { + if set > 1 { + return per.ErrChoice + } + switch { + case areaID.TAI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { + return err + } + if err := (*areaID.TAI).MarshalPER(w, enc); err != nil { + return err + } + case areaID.GlobalRANNodeID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { + return err + } + if err := (*areaID.GlobalRANNodeID).MarshalPER(w, enc); err != nil { + return err + } + case areaID.NRCGI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { return err } + if err := (*areaID.NRCGI).MarshalPER(w, enc); err != nil { + return err + } + case areaID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, areaID.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() +func (areaID *AreaID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaID = AreaID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) if err != nil { return err } - if err := (&dataForwardingResponseERABListItem.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&dataForwardingResponseERABListItem.DLForwardingUPTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - if p_iEExtensions { - var v rawIEExtensions + switch idx { + case 0: + var v TAI if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - dataForwardingResponseERABListItem.iEExtensions = &v - } - if extBit { - if err := dataForwardingResponseERABListItem.extensions.UnmarshalPER(r, enc); err != nil { + areaID.TAI = &v + case 1: + var v GlobalRANNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaID.GlobalRANNodeID = &v + case 2: + var v NRCGI + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + areaID.NRCGI = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + areaID.ChoiceExtension = &f + } + default: + return per.ErrOverflow } return nil } -func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(dynamic5QIDescriptor.extensions.Present()) - w.WriteBit(dynamic5QIDescriptor.FiveQI != nil) - w.WriteBit(dynamic5QIDescriptor.DelayCritical != nil) - w.WriteBit(dynamic5QIDescriptor.AveragingWindow != nil) - w.WriteBit(dynamic5QIDescriptor.MaximumDataBurstVolume != nil) - w.WriteBit(dynamic5QIDescriptor.iEExtensions != nil) - if err := dynamic5QIDescriptor.PriorityLevelQos.MarshalPER(w, enc); err != nil { - return err - } - if err := dynamic5QIDescriptor.PacketDelayBudget.MarshalPER(w, enc); err != nil { - return err - } - if err := dynamic5QIDescriptor.PacketErrorRate.MarshalPER(w, enc); err != nil { - return err - } - if dynamic5QIDescriptor.FiveQI != nil { - if err := (*dynamic5QIDescriptor.FiveQI).MarshalPER(w, enc); err != nil { - return err - } +func (areaID *AreaID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case areaID.TAI != nil: + return areaID.TAI.Diagnose(d) + case areaID.GlobalRANNodeID != nil: + return areaID.GlobalRANNodeID.Diagnose(d) + case areaID.NRCGI != nil: + return areaID.NRCGI.Diagnose(d) + case areaID.ChoiceExtension != nil: + d.Unknown(areaID.ChoiceExtension.ID, areaID.ChoiceExtension.Criticality) } - if dynamic5QIDescriptor.DelayCritical != nil { - if err := encodeRootEnumerated(w, enc, 2, int64((*dynamic5QIDescriptor.DelayCritical)), "DelayCritical"); err != nil { + return false +} + +func (areaOfInterest *AreaOfInterest) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAreaOfInterest, areaOfInterest, areaOfInterest.iEExtensions) + w.WriteBit(areaOfInterest.extensions.Present()) + w.WriteBit(areaOfInterest.AreaOfInterestTAIList != nil) + w.WriteBit(areaOfInterest.AreaOfInterestCellList != nil) + w.WriteBit(areaOfInterest.AreaOfInterestRANNodeList != nil) + w.WriteBit(len(ext) > 0) + if areaOfInterest.AreaOfInterestTAIList != nil { + if err := areaOfInterest.AreaOfInterestTAIList.MarshalPER(w, enc); err != nil { return err } } - if dynamic5QIDescriptor.AveragingWindow != nil { - if err := (*dynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { + if areaOfInterest.AreaOfInterestCellList != nil { + if err := areaOfInterest.AreaOfInterestCellList.MarshalPER(w, enc); err != nil { return err } } - if dynamic5QIDescriptor.MaximumDataBurstVolume != nil { - if err := (*dynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { + if areaOfInterest.AreaOfInterestRANNodeList != nil { + if err := areaOfInterest.AreaOfInterestRANNodeList.MarshalPER(w, enc); err != nil { return err } } - if dynamic5QIDescriptor.iEExtensions != nil { - if err := (*dynamic5QIDescriptor.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if dynamic5QIDescriptor.extensions.Present() { - if err := dynamic5QIDescriptor.extensions.MarshalPER(w, enc); err != nil { + if areaOfInterest.extensions.Present() { + if err := areaOfInterest.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (areaOfInterest *AreaOfInterest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaOfInterest = AreaOfInterest{} extBit, err := r.ReadBit() if err != nil { return err } - p_FiveQI, err := r.ReadBit() - if err != nil { - return err - } - p_DelayCritical, err := r.ReadBit() + p_AreaOfInterestTAIList, err := r.ReadBit() if err != nil { return err } - p_AveragingWindow, err := r.ReadBit() + p_AreaOfInterestCellList, err := r.ReadBit() if err != nil { return err } - p_MaximumDataBurstVolume, err := r.ReadBit() + p_AreaOfInterestRANNodeList, err := r.ReadBit() if err != nil { return err } @@ -1582,638 +2006,827 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, en if err != nil { return err } - if err := (&dynamic5QIDescriptor.PriorityLevelQos).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&dynamic5QIDescriptor.PacketDelayBudget).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&dynamic5QIDescriptor.PacketErrorRate).UnmarshalPER(r, enc); err != nil { - return err - } - if p_FiveQI { - var v FiveQI - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - dynamic5QIDescriptor.FiveQI = &v - } - if p_DelayCritical { - var v DelayCritical - e4, err := decodeRootEnumerated(r, enc, 2, "DelayCritical") - if err != nil { + if p_AreaOfInterestTAIList { + if err := (&areaOfInterest.AreaOfInterestTAIList).UnmarshalPER(r, enc); err != nil { return err } - v = DelayCritical(e4) - dynamic5QIDescriptor.DelayCritical = &v } - if p_AveragingWindow { - var v AveragingWindow - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_AreaOfInterestCellList { + if err := (&areaOfInterest.AreaOfInterestCellList).UnmarshalPER(r, enc); err != nil { return err } - dynamic5QIDescriptor.AveragingWindow = &v } - if p_MaximumDataBurstVolume { - var v MaximumDataBurstVolume - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_AreaOfInterestRANNodeList { + if err := (&areaOfInterest.AreaOfInterestRANNodeList).UnmarshalPER(r, enc); err != nil { return err } - dynamic5QIDescriptor.MaximumDataBurstVolume = &v } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterest, areaOfInterest, &areaOfInterest.iEExtensions); err != nil { return err } - dynamic5QIDescriptor.iEExtensions = &v } if extBit { - if err := dynamic5QIDescriptor.extensions.UnmarshalPER(r, enc); err != nil { + if err := areaOfInterest.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (ePSTAI *EPSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := ePSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err +var extIEsAreaOfInterest []ap.IESpec[ProtocolIEID, AreaOfInterest] + +func (areaOfInterest *AreaOfInterest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if areaOfInterest.AreaOfInterestTAIList.Diagnose(d) { + notComprehended = true } - if err := ePSTAI.TAC.MarshalPER(w, enc); err != nil { + if areaOfInterest.AreaOfInterestCellList.Diagnose(d) { + notComprehended = true + } + if areaOfInterest.AreaOfInterestRANNodeList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAreaOfInterest, areaOfInterest, areaOfInterest.iEExtensions) + return notComprehended +} + +func (areaOfInterestCellItem *AreaOfInterestCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAreaOfInterestCellItem, areaOfInterestCellItem, areaOfInterestCellItem.iEExtensions) + w.WriteBit(areaOfInterestCellItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := areaOfInterestCellItem.NGRANCGI.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if areaOfInterestCellItem.extensions.Present() { + if err := areaOfInterestCellItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (areaOfInterestCellItem *AreaOfInterestCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaOfInterestCellItem = AreaOfInterestCellItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&ePSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&ePSTAI.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&areaOfInterestCellItem.NGRANCGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestCellItem, areaOfInterestCellItem, &areaOfInterestCellItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := areaOfInterestCellItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (eRABInformationItem *ERABInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABInformationItem.extensions.Present()) - w.WriteBit(eRABInformationItem.DLForwarding != nil) - w.WriteBit(eRABInformationItem.iEExtensions != nil) - if err := eRABInformationItem.ERABID.MarshalPER(w, enc); err != nil { +var extIEsAreaOfInterestCellItem []ap.IESpec[ProtocolIEID, AreaOfInterestCellItem] + +func (areaOfInterestCellItem *AreaOfInterestCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if areaOfInterestCellItem.NGRANCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAreaOfInterestCellItem, areaOfInterestCellItem, areaOfInterestCellItem.iEExtensions) + return notComprehended +} + +func (areaOfInterestItem *AreaOfInterestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAreaOfInterestItem, areaOfInterestItem, areaOfInterestItem.iEExtensions) + w.WriteBit(areaOfInterestItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := areaOfInterestItem.AreaOfInterest.MarshalPER(w, enc); err != nil { return err } - if eRABInformationItem.DLForwarding != nil { - if err := (*eRABInformationItem.DLForwarding).MarshalPER(w, enc); err != nil { - return err - } + if err := areaOfInterestItem.LocationReportingReferenceID.MarshalPER(w, enc); err != nil { + return err } - if eRABInformationItem.iEExtensions != nil { - if err := (*eRABInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABInformationItem.extensions.Present() { - if err := eRABInformationItem.extensions.MarshalPER(w, enc); err != nil { + if areaOfInterestItem.extensions.Present() { + if err := areaOfInterestItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABInformationItem *ERABInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (areaOfInterestItem *AreaOfInterestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaOfInterestItem = AreaOfInterestItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwarding, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&eRABInformationItem.ERABID).UnmarshalPER(r, enc); err != nil { + if err := (&areaOfInterestItem.AreaOfInterest).UnmarshalPER(r, enc); err != nil { return err } - if p_DLForwarding { - var v DLForwarding - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABInformationItem.DLForwarding = &v + if err := (&areaOfInterestItem.LocationReportingReferenceID).UnmarshalPER(r, enc); err != nil { + return err } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestItem, areaOfInterestItem, &areaOfInterestItem.iEExtensions); err != nil { return err } - eRABInformationItem.iEExtensions = &v } if extBit { - if err := eRABInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := areaOfInterestItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eUTRACGI *EUTRACGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := eUTRACGI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err +var extIEsAreaOfInterestItem []ap.IESpec[ProtocolIEID, AreaOfInterestItem] + +func (areaOfInterestItem *AreaOfInterestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if areaOfInterestItem.AreaOfInterest.Diagnose(d) { + notComprehended = true } - if err := eUTRACGI.EUTRACellIdentity.MarshalPER(w, enc); err != nil { + if areaOfInterestItem.LocationReportingReferenceID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAreaOfInterestItem, areaOfInterestItem, areaOfInterestItem.iEExtensions) + return notComprehended +} + +func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, areaOfInterestRANNodeItem.iEExtensions) + w.WriteBit(areaOfInterestRANNodeItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := areaOfInterestRANNodeItem.GlobalRANNodeID.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if areaOfInterestRANNodeItem.extensions.Present() { + if err := areaOfInterestRANNodeItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (eUTRACGI *EUTRACGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaOfInterestRANNodeItem = AreaOfInterestRANNodeItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&eUTRACGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eUTRACGI.EUTRACellIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&areaOfInterestRANNodeItem.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, &areaOfInterestRANNodeItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := areaOfInterestRANNodeItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { +var extIEsAreaOfInterestRANNodeItem []ap.IESpec[ProtocolIEID, AreaOfInterestRANNodeItem] + +func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if areaOfInterestRANNodeItem.GlobalRANNodeID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, areaOfInterestRANNodeItem.iEExtensions) + return notComprehended +} + +func (areaOfInterestTAIItem *AreaOfInterestTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, areaOfInterestTAIItem.iEExtensions) + w.WriteBit(areaOfInterestTAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := areaOfInterestTAIItem.TAI.MarshalPER(w, enc); err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[i].MarshalPER(w, enc); err != nil { - return err - } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if areaOfInterestTAIItem.extensions.Present() { + if err := areaOfInterestTAIItem.extensions.MarshalPER(w, enc); err != nil { + return err } - off1 = end - return nil - }); err != nil { - return err } return nil } -func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (areaOfInterestTAIItem *AreaOfInterestTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaOfInterestTAIItem = AreaOfInterestTAIItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { - return err - } - emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI) - emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI = append(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI, make([]CompletedCellsInEAIEUTRAItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&areaOfInterestTAIItem.TAI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, &areaOfInterestTAIItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := areaOfInterestTAIItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := emergencyAreaIDBroadcastNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { - return err - } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { - return err +var extIEsAreaOfInterestTAIItem []ap.IESpec[ProtocolIEID, AreaOfInterestTAIItem] + +func (areaOfInterestTAIItem *AreaOfInterestTAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if areaOfInterestTAIItem.TAI.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, areaOfInterestTAIItem.iEExtensions) + return notComprehended } -func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { - return err +func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{areaScopeOfMDTEUTRA.CellBased != nil, areaScopeOfMDTEUTRA.TABased != nil, areaScopeOfMDTEUTRA.PLMNWide != nil, areaScopeOfMDTEUTRA.TAIBased != nil, areaScopeOfMDTEUTRA.ChoiceExtension != nil} { + if ok { + set++ + } } - if err := (&emergencyAreaIDBroadcastNRItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { - return err + if set > 1 { + return per.ErrChoice } - emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI) - emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI = append(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI, make([]CompletedCellsInEAINRItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } + switch { + case areaScopeOfMDTEUTRA.CellBased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 0); err != nil { + return err } - return nil - }); err != nil { - return err - } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (*areaScopeOfMDTEUTRA.CellBased).MarshalPER(w, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + case areaScopeOfMDTEUTRA.TABased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 1); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + if err := (*areaScopeOfMDTEUTRA.TABased).MarshalPER(w, enc); err != nil { + return err } - } - return nil -} - -func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { - return err - } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[i].MarshalPER(w, enc); err != nil { - return err - } + case areaScopeOfMDTEUTRA.PLMNWide != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 2); err != nil { + return err } - off1 = end - return nil - }); err != nil { - return err + if err := (*areaScopeOfMDTEUTRA.PLMNWide).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfMDTEUTRA.TAIBased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 3); err != nil { + return err + } + if err := (*areaScopeOfMDTEUTRA.TAIBased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfMDTEUTRA.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, areaScopeOfMDTEUTRA.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaScopeOfMDTEUTRA = AreaScopeOfMDTEUTRA{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 4) if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { - return err - } - emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI) - emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI = append(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI, make([]CancelledCellsInEAIEUTRAItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } + switch idx { + case 0: + var v CellBasedMDTEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err } - return nil - }); err != nil { - return err - } - if p_f2 { - var v ieExtensions + areaScopeOfMDTEUTRA.CellBased = &v + case 1: + var v TABasedMDT if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + areaScopeOfMDTEUTRA.TABased = &v + case 2: + var v per.Null + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + areaScopeOfMDTEUTRA.PLMNWide = &v + case 3: + var v TAIBasedMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfMDTEUTRA.TAIBased = &v + case 4: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + areaScopeOfMDTEUTRA.ChoiceExtension = &f } + default: + return per.ErrOverflow } return nil } -func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := emergencyAreaIDCancelledNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { +func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case areaScopeOfMDTEUTRA.CellBased != nil: + return areaScopeOfMDTEUTRA.CellBased.Diagnose(d) + case areaScopeOfMDTEUTRA.TABased != nil: + return areaScopeOfMDTEUTRA.TABased.Diagnose(d) + case areaScopeOfMDTEUTRA.PLMNWide != nil: + case areaScopeOfMDTEUTRA.TAIBased != nil: + return areaScopeOfMDTEUTRA.TAIBased.Diagnose(d) + case areaScopeOfMDTEUTRA.ChoiceExtension != nil: + d.Unknown(areaScopeOfMDTEUTRA.ChoiceExtension.ID, areaScopeOfMDTEUTRA.ChoiceExtension.Criticality) + } + return false +} + +func (areaScopeOfMDTNR *AreaScopeOfMDTNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{areaScopeOfMDTNR.CellBased != nil, areaScopeOfMDTNR.TABased != nil, areaScopeOfMDTNR.PLMNWide != nil, areaScopeOfMDTNR.TAIBased != nil, areaScopeOfMDTNR.PNINPNBasedMDT != nil, areaScopeOfMDTNR.SNPNCellBasedMDT != nil, areaScopeOfMDTNR.SNPNTAIBasedMDT != nil, areaScopeOfMDTNR.SNPNBasedMDT != nil, areaScopeOfMDTNR.GeographyBasedMDT != nil, areaScopeOfMDTNR.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case areaScopeOfMDTNR.CellBased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 0); err != nil { + return err + } + if err := (*areaScopeOfMDTNR.CellBased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfMDTNR.TABased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 1); err != nil { + return err + } + if err := (*areaScopeOfMDTNR.TABased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfMDTNR.PLMNWide != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 2); err != nil { + return err + } + if err := (*areaScopeOfMDTNR.PLMNWide).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfMDTNR.TAIBased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 3); err != nil { + return err + } + if err := (*areaScopeOfMDTNR.TAIBased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfMDTNR.PNINPNBasedMDT != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDPNINPNBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.PNINPNBasedMDT}) + case areaScopeOfMDTNR.SNPNCellBasedMDT != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSNPNCellBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNCellBasedMDT}) + case areaScopeOfMDTNR.SNPNTAIBasedMDT != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSNPNTAIBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNTAIBasedMDT}) + case areaScopeOfMDTNR.SNPNBasedMDT != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSNPNBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNBasedMDT}) + case areaScopeOfMDTNR.GeographyBasedMDT != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGeographyBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.GeographyBasedMDT}) + case areaScopeOfMDTNR.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, areaScopeOfMDTNR.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (areaScopeOfMDTNR *AreaScopeOfMDTNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaScopeOfMDTNR = AreaScopeOfMDTNR{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 4) + if err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[i].MarshalPER(w, enc); err != nil { + switch idx { + case 0: + var v CellBasedMDTNR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfMDTNR.CellBased = &v + case 1: + var v TABasedMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfMDTNR.TABased = &v + case 2: + var v per.Null + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfMDTNR.PLMNWide = &v + case 3: + var v TAIBasedMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfMDTNR.TAIBased = &v + case 4: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDPNINPNBasedMDT: + var v PNINPNBasedMDT + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { return err } - } - off1 = end - return nil - }); err != nil { + if !ap.Comprehended[ProtocolIEID](&v) { + areaScopeOfMDTNR.ChoiceExtension = &f + break + } + areaScopeOfMDTNR.PNINPNBasedMDT = &v + areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDSNPNCellBasedMDT: + var v SNPNCellBasedMDT + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + areaScopeOfMDTNR.ChoiceExtension = &f + break + } + areaScopeOfMDTNR.SNPNCellBasedMDT = &v + areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDSNPNTAIBasedMDT: + var v SNPNTAIBasedMDT + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + areaScopeOfMDTNR.ChoiceExtension = &f + break + } + areaScopeOfMDTNR.SNPNTAIBasedMDT = &v + areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDSNPNBasedMDT: + var v SNPNBasedMDT + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + areaScopeOfMDTNR.ChoiceExtension = &f + break + } + areaScopeOfMDTNR.SNPNBasedMDT = &v + areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDGeographyBasedMDT: + var v GeographyBasedMDT + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + areaScopeOfMDTNR.ChoiceExtension = &f + break + } + areaScopeOfMDTNR.GeographyBasedMDT = &v + areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + default: + areaScopeOfMDTNR.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (areaScopeOfMDTNR *AreaScopeOfMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case areaScopeOfMDTNR.CellBased != nil: + return areaScopeOfMDTNR.CellBased.Diagnose(d) + case areaScopeOfMDTNR.TABased != nil: + return areaScopeOfMDTNR.TABased.Diagnose(d) + case areaScopeOfMDTNR.PLMNWide != nil: + case areaScopeOfMDTNR.TAIBased != nil: + return areaScopeOfMDTNR.TAIBased.Diagnose(d) + case areaScopeOfMDTNR.PNINPNBasedMDT != nil: + d.IE(IDPNINPNBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.PNINPNBasedMDT) + case areaScopeOfMDTNR.SNPNCellBasedMDT != nil: + d.IE(IDSNPNCellBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.SNPNCellBasedMDT) + case areaScopeOfMDTNR.SNPNTAIBasedMDT != nil: + d.IE(IDSNPNTAIBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.SNPNTAIBasedMDT) + case areaScopeOfMDTNR.SNPNBasedMDT != nil: + d.IE(IDSNPNBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.SNPNBasedMDT) + case areaScopeOfMDTNR.GeographyBasedMDT != nil: + d.IE(IDGeographyBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.GeographyBasedMDT) + case areaScopeOfMDTNR.ChoiceExtension != nil: + d.Unknown(areaScopeOfMDTNR.ChoiceExtension.ID, areaScopeOfMDTNR.ChoiceExtension.Criticality) + } + return false +} + +func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem.iEExtensions) + w.WriteBit(areaScopeOfNeighCellsItem.extensions.Present()) + w.WriteBit(areaScopeOfNeighCellsItem.PciListForMDT != nil) + w.WriteBit(len(ext) > 0) + if err := areaScopeOfNeighCellsItem.NrFrequencyInfo.MarshalPER(w, enc); err != nil { return err } + if areaScopeOfNeighCellsItem.PciListForMDT != nil { + if err := areaScopeOfNeighCellsItem.PciListForMDT.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if areaScopeOfNeighCellsItem.extensions.Present() { + if err := areaScopeOfNeighCellsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaScopeOfNeighCellsItem = AreaScopeOfNeighCellsItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_PciListForMDT, err := r.ReadBit() if err != nil { return err } - if err := (&emergencyAreaIDCancelledNRItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - emergencyAreaIDCancelledNRItem.CancelledCellsInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI) - emergencyAreaIDCancelledNRItem.CancelledCellsInEAI = append(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI, make([]CancelledCellsInEAINRItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&areaScopeOfNeighCellsItem.NrFrequencyInfo).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_PciListForMDT { + if err := (&areaScopeOfNeighCellsItem.PciListForMDT).UnmarshalPER(r, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, &areaScopeOfNeighCellsItem.iEExtensions); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if extBit { + if err := areaScopeOfNeighCellsItem.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } -func (endpointIPAddressAndPort *EndpointIPAddressAndPort) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(endpointIPAddressAndPort.iEExtensions != nil) - if err := endpointIPAddressAndPort.EndpointIPAddress.MarshalPER(w, enc); err != nil { - return err +var extIEsAreaScopeOfNeighCellsItem []ap.IESpec[ProtocolIEID, AreaScopeOfNeighCellsItem] + +func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if areaScopeOfNeighCellsItem.NrFrequencyInfo.Diagnose(d) { + notComprehended = true } - if err := endpointIPAddressAndPort.PortNumber.MarshalPER(w, enc); err != nil { - return err + if areaScopeOfNeighCellsItem.PciListForMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem.iEExtensions) + return notComprehended +} + +func (areaScopeOfQMC *AreaScopeOfQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{areaScopeOfQMC.CellBased != nil, areaScopeOfQMC.TABased != nil, areaScopeOfQMC.TAIBased != nil, areaScopeOfQMC.PLMNAreaBased != nil, areaScopeOfQMC.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice } - if endpointIPAddressAndPort.iEExtensions != nil { - if err := (*endpointIPAddressAndPort.iEExtensions).MarshalPER(w, enc); err != nil { + switch { + case areaScopeOfQMC.CellBased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 0); err != nil { + return err + } + if err := (*areaScopeOfQMC.CellBased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfQMC.TABased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 1); err != nil { return err } + if err := (*areaScopeOfQMC.TABased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfQMC.TAIBased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 2); err != nil { + return err + } + if err := (*areaScopeOfQMC.TAIBased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfQMC.PLMNAreaBased != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 3); err != nil { + return err + } + if err := (*areaScopeOfQMC.PLMNAreaBased).MarshalPER(w, enc); err != nil { + return err + } + case areaScopeOfQMC.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, areaScopeOfQMC.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (endpointIPAddressAndPort *EndpointIPAddressAndPort) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - p_iEExtensions, err := r.ReadBit() +func (areaScopeOfQMC *AreaScopeOfQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *areaScopeOfQMC = AreaScopeOfQMC{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 4) if err != nil { return err } - if err := (&endpointIPAddressAndPort.EndpointIPAddress).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&endpointIPAddressAndPort.PortNumber).UnmarshalPER(r, enc); err != nil { - return err - } - if p_iEExtensions { - var v rawIEExtensions + switch idx { + case 0: + var v CellBasedQMC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfQMC.CellBased = &v + case 1: + var v TABasedQMC if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - endpointIPAddressAndPort.iEExtensions = &v + areaScopeOfQMC.TABased = &v + case 2: + var v TAIBasedQMC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfQMC.TAIBased = &v + case 3: + var v PLMNAreaBasedQMC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + areaScopeOfQMC.PLMNAreaBased = &v + case 4: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + areaScopeOfQMC.ChoiceExtension = &f + } + default: + return per.ErrOverflow } return nil } -func (extendedAMFName *ExtendedAMFName) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(extendedAMFName.extensions.Present()) - w.WriteBit(extendedAMFName.AMFNameVisibleString != nil) - w.WriteBit(extendedAMFName.AMFNameUTF8String != nil) - w.WriteBit(extendedAMFName.iEExtensions != nil) - if extendedAMFName.AMFNameVisibleString != nil { - if err := (*extendedAMFName.AMFNameVisibleString).MarshalPER(w, enc); err != nil { +func (areaScopeOfQMC *AreaScopeOfQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case areaScopeOfQMC.CellBased != nil: + return areaScopeOfQMC.CellBased.Diagnose(d) + case areaScopeOfQMC.TABased != nil: + return areaScopeOfQMC.TABased.Diagnose(d) + case areaScopeOfQMC.TAIBased != nil: + return areaScopeOfQMC.TAIBased.Diagnose(d) + case areaScopeOfQMC.PLMNAreaBased != nil: + return areaScopeOfQMC.PLMNAreaBased.Diagnose(d) + case areaScopeOfQMC.ChoiceExtension != nil: + d.Unknown(areaScopeOfQMC.ChoiceExtension.ID, areaScopeOfQMC.ChoiceExtension.Criticality) + } + return false +} + +func (assistanceDataForPaging *AssistanceDataForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAssistanceDataForPaging, assistanceDataForPaging, assistanceDataForPaging.iEExtensions) + w.WriteBit(assistanceDataForPaging.extensions.Present()) + w.WriteBit(assistanceDataForPaging.AssistanceDataForRecommendedCells != nil) + w.WriteBit(assistanceDataForPaging.PagingAttemptInformation != nil) + w.WriteBit(len(ext) > 0) + if assistanceDataForPaging.AssistanceDataForRecommendedCells != nil { + if err := (*assistanceDataForPaging.AssistanceDataForRecommendedCells).MarshalPER(w, enc); err != nil { return err } } - if extendedAMFName.AMFNameUTF8String != nil { - if err := (*extendedAMFName.AMFNameUTF8String).MarshalPER(w, enc); err != nil { + if assistanceDataForPaging.PagingAttemptInformation != nil { + if err := (*assistanceDataForPaging.PagingAttemptInformation).MarshalPER(w, enc); err != nil { return err } } - if extendedAMFName.iEExtensions != nil { - if err := (*extendedAMFName.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if extendedAMFName.extensions.Present() { - if err := extendedAMFName.extensions.MarshalPER(w, enc); err != nil { + if assistanceDataForPaging.extensions.Present() { + if err := assistanceDataForPaging.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (extendedAMFName *ExtendedAMFName) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (assistanceDataForPaging *AssistanceDataForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *assistanceDataForPaging = AssistanceDataForPaging{} extBit, err := r.ReadBit() if err != nil { return err } - p_AMFNameVisibleString, err := r.ReadBit() + p_AssistanceDataForRecommendedCells, err := r.ReadBit() if err != nil { return err } - p_AMFNameUTF8String, err := r.ReadBit() + p_PagingAttemptInformation, err := r.ReadBit() if err != nil { return err } @@ -2221,422 +2834,415 @@ func (extendedAMFName *ExtendedAMFName) UnmarshalPER(r *per.Reader, enc per.Enco if err != nil { return err } - if p_AMFNameVisibleString { - var v AMFNameVisibleString + if p_AssistanceDataForRecommendedCells { + var v AssistanceDataForRecommendedCells if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - extendedAMFName.AMFNameVisibleString = &v + assistanceDataForPaging.AssistanceDataForRecommendedCells = &v } - if p_AMFNameUTF8String { - var v AMFNameUTF8String + if p_PagingAttemptInformation { + var v PagingAttemptInformation if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - extendedAMFName.AMFNameUTF8String = &v + assistanceDataForPaging.PagingAttemptInformation = &v } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForPaging, assistanceDataForPaging, &assistanceDataForPaging.iEExtensions); err != nil { return err } - extendedAMFName.iEExtensions = &v } if extBit { - if err := extendedAMFName.extensions.UnmarshalPER(r, enc); err != nil { + if err := assistanceDataForPaging.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (fiveGSTMSI *FiveGSTMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := fiveGSTMSI.AMFSetID.MarshalPER(w, enc); err != nil { - return err +var extIEsAssistanceDataForPaging = []ap.IESpec[ProtocolIEID, AssistanceDataForPaging]{ + { + ID: IDNPNPagingAssistanceInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AssistanceDataForPaging, r *per.Reader, enc per.Encoding) error { + var v NPNPagingAssistanceInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NPNPagingAssistanceInformation = &v + return nil + }, + Encode: func(x *AssistanceDataForPaging) (per.Marshaler, bool) { + if x.NPNPagingAssistanceInformation == nil { + return nil, false + } + return x.NPNPagingAssistanceInformation, true + }, + }, + { + ID: IDPagingAssisDataforCEcapabUE, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AssistanceDataForPaging, r *per.Reader, enc per.Encoding) error { + var v PagingAssisDataforCEcapabUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PagingAssisDataforCEcapabUE = &v + return nil + }, + Encode: func(x *AssistanceDataForPaging) (per.Marshaler, bool) { + if x.PagingAssisDataforCEcapabUE == nil { + return nil, false + } + return x.PagingAssisDataforCEcapabUE, true + }, + }, +} + +func (assistanceDataForPaging *AssistanceDataForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if assistanceDataForPaging.AssistanceDataForRecommendedCells != nil && assistanceDataForPaging.AssistanceDataForRecommendedCells.Diagnose(d) { + notComprehended = true } - if err := fiveGSTMSI.AMFPointer.MarshalPER(w, enc); err != nil { - return err + if assistanceDataForPaging.PagingAttemptInformation != nil && assistanceDataForPaging.PagingAttemptInformation.Diagnose(d) { + notComprehended = true } - if err := fiveGSTMSI.FiveGTMSI.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsAssistanceDataForPaging, assistanceDataForPaging, assistanceDataForPaging.iEExtensions) + return notComprehended +} + +func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, assistanceDataForRecommendedCells.iEExtensions) + w.WriteBit(assistanceDataForRecommendedCells.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := assistanceDataForRecommendedCells.RecommendedCellsForPaging.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if assistanceDataForRecommendedCells.extensions.Present() { + if err := assistanceDataForRecommendedCells.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (fiveGSTMSI *FiveGSTMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *assistanceDataForRecommendedCells = AssistanceDataForRecommendedCells{} extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&fiveGSTMSI.AMFSetID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&fiveGSTMSI.AMFPointer).UnmarshalPER(r, enc); err != nil { + if err := (&assistanceDataForRecommendedCells.RecommendedCellsForPaging).UnmarshalPER(r, enc); err != nil { return err } - if err := (&fiveGSTMSI.FiveGTMSI).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, &assistanceDataForRecommendedCells.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := assistanceDataForRecommendedCells.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := forbiddenAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { +var extIEsAssistanceDataForRecommendedCells []ap.IESpec[ProtocolIEID, AssistanceDataForRecommendedCells] + +func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if assistanceDataForRecommendedCells.RecommendedCellsForPaging.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, assistanceDataForRecommendedCells.iEExtensions) + return notComprehended +} + +func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem.iEExtensions) + w.WriteBit(associatedMBSQosFlowSetupRequestItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := associatedMBSQosFlowSetupRequestItem.MBSQosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if err := forbiddenAreaInformationItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { + if err := associatedMBSQosFlowSetupRequestItem.AssociatedUnicastQosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if associatedMBSQosFlowSetupRequestItem.extensions.Present() { + if err := associatedMBSQosFlowSetupRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *associatedMBSQosFlowSetupRequestItem = AssociatedMBSQosFlowSetupRequestItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&forbiddenAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&associatedMBSQosFlowSetupRequestItem.MBSQosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if err := (&forbiddenAreaInformationItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { + if err := (&associatedMBSQosFlowSetupRequestItem.AssociatedUnicastQosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, &associatedMBSQosFlowSetupRequestItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := associatedMBSQosFlowSetupRequestItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(gBRQosInformation.extensions.Present()) - w.WriteBit(gBRQosInformation.NotificationControl != nil) - w.WriteBit(gBRQosInformation.MaximumPacketLossRateDL != nil) - w.WriteBit(gBRQosInformation.MaximumPacketLossRateUL != nil) - w.WriteBit(gBRQosInformation.iEExtensions != nil) - if err := gBRQosInformation.MaximumFlowBitRateDL.MarshalPER(w, enc); err != nil { - return err +var extIEsAssociatedMBSQosFlowSetupRequestItem []ap.IESpec[ProtocolIEID, AssociatedMBSQosFlowSetupRequestItem] + +func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if associatedMBSQosFlowSetupRequestItem.MBSQosFlowIdentifier.Diagnose(d) { + notComprehended = true } - if err := gBRQosInformation.MaximumFlowBitRateUL.MarshalPER(w, enc); err != nil { - return err + if associatedMBSQosFlowSetupRequestItem.AssociatedUnicastQosFlowIdentifier.Diagnose(d) { + notComprehended = true } - if err := gBRQosInformation.GuaranteedFlowBitRateDL.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem.iEExtensions) + return notComprehended +} + +func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions) + w.WriteBit(associatedMBSQosFlowSetuporModifyRequestItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := associatedMBSQosFlowSetuporModifyRequestItem.MBSQosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if err := gBRQosInformation.GuaranteedFlowBitRateUL.MarshalPER(w, enc); err != nil { + if err := associatedMBSQosFlowSetuporModifyRequestItem.AssociatedUnicastQosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if gBRQosInformation.NotificationControl != nil { - if err := encodeRootEnumerated(w, enc, 1, int64((*gBRQosInformation.NotificationControl)), "NotificationControl"); err != nil { - return err - } - } - if gBRQosInformation.MaximumPacketLossRateDL != nil { - if err := (*gBRQosInformation.MaximumPacketLossRateDL).MarshalPER(w, enc); err != nil { - return err - } - } - if gBRQosInformation.MaximumPacketLossRateUL != nil { - if err := (*gBRQosInformation.MaximumPacketLossRateUL).MarshalPER(w, enc); err != nil { - return err - } - } - if gBRQosInformation.iEExtensions != nil { - if err := (*gBRQosInformation.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if gBRQosInformation.extensions.Present() { - if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { + if associatedMBSQosFlowSetuporModifyRequestItem.extensions.Present() { + if err := associatedMBSQosFlowSetuporModifyRequestItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporModifyRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *associatedMBSQosFlowSetuporModifyRequestItem = AssociatedMBSQosFlowSetuporModifyRequestItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_NotificationControl, err := r.ReadBit() - if err != nil { - return err - } - p_MaximumPacketLossRateDL, err := r.ReadBit() - if err != nil { - return err - } - p_MaximumPacketLossRateUL, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&gBRQosInformation.MaximumFlowBitRateDL).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gBRQosInformation.MaximumFlowBitRateUL).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gBRQosInformation.GuaranteedFlowBitRateDL).UnmarshalPER(r, enc); err != nil { + if err := (&associatedMBSQosFlowSetuporModifyRequestItem.MBSQosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gBRQosInformation.GuaranteedFlowBitRateUL).UnmarshalPER(r, enc); err != nil { + if err := (&associatedMBSQosFlowSetuporModifyRequestItem.AssociatedUnicastQosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_NotificationControl { - var v NotificationControl - e4, err := decodeRootEnumerated(r, enc, 1, "NotificationControl") - if err != nil { - return err - } - v = NotificationControl(e4) - gBRQosInformation.NotificationControl = &v - } - if p_MaximumPacketLossRateDL { - var v PacketLossRate - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - gBRQosInformation.MaximumPacketLossRateDL = &v - } - if p_MaximumPacketLossRateUL { - var v PacketLossRate - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - gBRQosInformation.MaximumPacketLossRateUL = &v - } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, &associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions); err != nil { return err } - gBRQosInformation.iEExtensions = &v } if extBit { - if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := associatedMBSQosFlowSetuporModifyRequestItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (gTPTunnel *GTPTunnel) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(gTPTunnel.extensions.Present()) - w.WriteBit(gTPTunnel.iEExtensions != nil) - if err := gTPTunnel.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err +var extIEsAssociatedMBSQosFlowSetuporModifyRequestItem []ap.IESpec[ProtocolIEID, AssociatedMBSQosFlowSetuporModifyRequestItem] + +func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporModifyRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if associatedMBSQosFlowSetuporModifyRequestItem.MBSQosFlowIdentifier.Diagnose(d) { + notComprehended = true } - if err := gTPTunnel.GTPTEID.MarshalPER(w, enc); err != nil { + if associatedMBSQosFlowSetuporModifyRequestItem.AssociatedUnicastQosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions) + return notComprehended +} + +func (associatedQosFlowItem *AssociatedQosFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAssociatedQosFlowItem, associatedQosFlowItem, associatedQosFlowItem.iEExtensions) + w.WriteBit(associatedQosFlowItem.extensions.Present()) + w.WriteBit(associatedQosFlowItem.QosFlowMappingIndication != nil) + w.WriteBit(len(ext) > 0) + if err := associatedQosFlowItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if gTPTunnel.iEExtensions != nil { - if err := (*gTPTunnel.iEExtensions).MarshalPER(w, enc); err != nil { + if associatedQosFlowItem.QosFlowMappingIndication != nil { + if err := (*associatedQosFlowItem.QosFlowMappingIndication).MarshalPER(w, enc); err != nil { return err } } - if gTPTunnel.extensions.Present() { - if err := gTPTunnel.extensions.MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if associatedQosFlowItem.extensions.Present() { + if err := associatedQosFlowItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (associatedQosFlowItem *AssociatedQosFlowItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *associatedQosFlowItem = AssociatedQosFlowItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_QosFlowMappingIndication, err := r.ReadBit() if err != nil { return err } - if err := (&gTPTunnel.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&gTPTunnel.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&associatedQosFlowItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions + if p_QosFlowMappingIndication { + var v QosFlowMappingIndication if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - gTPTunnel.iEExtensions = &v + associatedQosFlowItem.QosFlowMappingIndication = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedQosFlowItem, associatedQosFlowItem, &associatedQosFlowItem.iEExtensions); err != nil { + return err + } } if extBit { - if err := gTPTunnel.extensions.UnmarshalPER(r, enc); err != nil { + if err := associatedQosFlowItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (gUAMI *GUAMI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := gUAMI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := gUAMI.AMFRegionID.MarshalPER(w, enc); err != nil { - return err - } - if err := gUAMI.AMFSetID.MarshalPER(w, enc); err != nil { - return err +var extIEsAssociatedQosFlowItem = []ap.IESpec[ProtocolIEID, AssociatedQosFlowItem]{ + { + ID: IDCurrentQoSParaSetIndex, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *AssociatedQosFlowItem, r *per.Reader, enc per.Encoding) error { + var v AlternativeQoSParaSetIndex + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CurrentQoSParaSetIndex = &v + return nil + }, + Encode: func(x *AssociatedQosFlowItem) (per.Marshaler, bool) { + if x.CurrentQoSParaSetIndex == nil { + return nil, false + } + return x.CurrentQoSParaSetIndex, true + }, + }, +} + +func (associatedQosFlowItem *AssociatedQosFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if associatedQosFlowItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true } - if err := gUAMI.AMFPointer.MarshalPER(w, enc); err != nil { - return err + if associatedQosFlowItem.QosFlowMappingIndication != nil && associatedQosFlowItem.QosFlowMappingIndication.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsAssociatedQosFlowItem, associatedQosFlowItem, associatedQosFlowItem.iEExtensions) + return notComprehended } -func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f4, err := r.ReadBit() +func (authenticatedIndication AuthenticatedIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAuthenticatedIndication.Encode(w, enc, authenticatedIndication) +} + +func (authenticatedIndication *AuthenticatedIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAuthenticatedIndication.Decode(r, enc) if err != nil { return err } - if err := (&gUAMI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gUAMI.AMFRegionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gUAMI.AMFSetID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gUAMI.AMFPointer).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f4 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } + *authenticatedIndication = v return nil } -func (gUAMIListItem *GUAMIListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(gUAMIListItem.extensions.Present()) - w.WriteBit(gUAMIListItem.iEExtensions != nil) - if err := gUAMIListItem.GUAMI.MarshalPER(w, enc); err != nil { +func (authenticatedIndication AuthenticatedIndication) Name() string { + return enumAuthenticatedIndication.Name(authenticatedIndication) +} + +func (authenticatedIndication AuthenticatedIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAuthenticatedIndication.Known(authenticatedIndication) +} + +func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, availableBitrateReportThresholdItem.iEExtensions) + w.WriteBit(availableBitrateReportThresholdItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := availableBitrateReportThresholdItem.ReportingThreshold.MarshalPER(w, enc); err != nil { return err } - if gUAMIListItem.iEExtensions != nil { - if err := (*gUAMIListItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if gUAMIListItem.extensions.Present() { - if err := gUAMIListItem.extensions.MarshalPER(w, enc); err != nil { + if availableBitrateReportThresholdItem.extensions.Present() { + if err := availableBitrateReportThresholdItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (gUAMIListItem *GUAMIListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *availableBitrateReportThresholdItem = AvailableBitrateReportThresholdItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -2645,133 +3251,73 @@ func (gUAMIListItem *GUAMIListItem) UnmarshalPER(r *per.Reader, enc per.Encoding if err != nil { return err } - if err := (&gUAMIListItem.GUAMI).UnmarshalPER(r, enc); err != nil { + if err := (&availableBitrateReportThresholdItem.ReportingThreshold).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, &availableBitrateReportThresholdItem.iEExtensions); err != nil { return err } - gUAMIListItem.iEExtensions = &v } if extBit { - if err := gUAMIListItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := availableBitrateReportThresholdItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (globalNgENBID *GlobalNgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := globalNgENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := globalNgENBID.NgENBID.MarshalPER(w, enc); err != nil { - return err - } - return nil -} +var extIEsAvailableBitrateReportThresholdItem []ap.IESpec[ProtocolIEID, AvailableBitrateReportThresholdItem] -func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&globalNgENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&globalNgENBID.NgENBID).UnmarshalPER(r, enc); err != nil { - return err +func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if availableBitrateReportThresholdItem.ReportingThreshold.Diagnose(d) { + notComprehended = true } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil + ap.DiagnoseExtensions(d, extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, availableBitrateReportThresholdItem.iEExtensions) + return notComprehended } -func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(handoverCommandTransferExtIEs, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions) - w.WriteBit(handoverCommandTransfer.extensions.Present()) - w.WriteBit(handoverCommandTransfer.DLForwardingUPTNLInformation != nil) - w.WriteBit(handoverCommandTransfer.QosFlowToBeForwarded != nil) - w.WriteBit(handoverCommandTransfer.DataForwardingResponseDRB != nil) +func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics.iEExtensions) + w.WriteBit(availableRANVisibleQoEMetrics.extensions.Present()) + w.WriteBit(availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList != nil) + w.WriteBit(availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup != nil) w.WriteBit(len(ext) > 0) - if handoverCommandTransfer.DLForwardingUPTNLInformation != nil { - if err := (*handoverCommandTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if handoverCommandTransfer.QosFlowToBeForwarded != nil { - if err := handoverCommandTransfer.QosFlowToBeForwarded.MarshalPER(w, enc); err != nil { + if availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList != nil { + if err := (*availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList).MarshalPER(w, enc); err != nil { return err } } - if handoverCommandTransfer.DataForwardingResponseDRB != nil { - if err := handoverCommandTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { + if availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup != nil { + if err := (*availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if handoverCommandTransfer.extensions.Present() { - if err := handoverCommandTransfer.extensions.MarshalPER(w, enc); err != nil { + if availableRANVisibleQoEMetrics.extensions.Present() { + if err := availableRANVisibleQoEMetrics.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *availableRANVisibleQoEMetrics = AvailableRANVisibleQoEMetrics{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwardingUPTNLInformation, err := r.ReadBit() - if err != nil { - return err - } - p_QosFlowToBeForwarded, err := r.ReadBit() + p_ApplicationLayerBufferLevelList, err := r.ReadBit() if err != nil { return err } - p_DataForwardingResponseDRB, err := r.ReadBit() + p_PlayoutDelayForMediaStartup, err := r.ReadBit() if err != nil { return err } @@ -2779,155 +3325,129 @@ func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Read if err != nil { return err } - if p_DLForwardingUPTNLInformation { - var v UPTransportLayerInformation + if p_ApplicationLayerBufferLevelList { + var v AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - handoverCommandTransfer.DLForwardingUPTNLInformation = &v + availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList = &v } - if p_QosFlowToBeForwarded { - if err := (&handoverCommandTransfer.QosFlowToBeForwarded).UnmarshalPER(r, enc); err != nil { + if p_PlayoutDelayForMediaStartup { + var v AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup = &v } - if p_DataForwardingResponseDRB { - if err := (&handoverCommandTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, handoverCommandTransferExtIEs, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, &availableRANVisibleQoEMetrics.iEExtensions); err != nil { return err } } if extBit { - if err := handoverCommandTransfer.extensions.UnmarshalPER(r, enc); err != nil { + if err := availableRANVisibleQoEMetrics.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := handoverPreparationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { - return err +var extIEsAvailableRANVisibleQoEMetrics []ap.IESpec[ProtocolIEID, AvailableRANVisibleQoEMetrics] + +func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList != nil && availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList.Diagnose(d) { + notComprehended = true } - return nil + if availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup != nil && availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics.iEExtensions) + return notComprehended } -func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (availableRANVisibleQoEMetricsApplicationLayerBufferLevelList AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList.Encode(w, enc, availableRANVisibleQoEMetricsApplicationLayerBufferLevelList) +} + +func (availableRANVisibleQoEMetricsApplicationLayerBufferLevelList *AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList.Decode(r, enc) if err != nil { return err } - p_f1, err := r.ReadBit() + *availableRANVisibleQoEMetricsApplicationLayerBufferLevelList = v + return nil +} + +func (availableRANVisibleQoEMetricsApplicationLayerBufferLevelList AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList) Name() string { + return enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList.Name(availableRANVisibleQoEMetricsApplicationLayerBufferLevelList) +} + +func (availableRANVisibleQoEMetricsApplicationLayerBufferLevelList AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList.Known(availableRANVisibleQoEMetricsApplicationLayerBufferLevelList) +} + +func (availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup.Encode(w, enc, availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) +} + +func (availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup *AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup.Decode(r, enc) if err != nil { return err } - if err := (&handoverPreparationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } + *availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup = v return nil } -func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(handoverRequestAcknowledgeTransferExtIEs, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions) - w.WriteBit(handoverRequestAcknowledgeTransfer.extensions.Present()) - w.WriteBit(handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil) - w.WriteBit(handoverRequestAcknowledgeTransfer.SecurityResult != nil) - w.WriteBit(handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil) - w.WriteBit(handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil) +func (availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) Name() string { + return enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup.Name(availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) +} + +func (availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup.Known(availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) +} + +func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration.iEExtensions) + w.WriteBit(beamMeasurementsReportConfiguration.extensions.Present()) + w.WriteBit(beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity != nil) + w.WriteBit(beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport != nil) w.WriteBit(len(ext) > 0) - if err := handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { - return err - } - if handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil { - if err := (*handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if handoverRequestAcknowledgeTransfer.SecurityResult != nil { - if err := (*handoverRequestAcknowledgeTransfer.SecurityResult).MarshalPER(w, enc); err != nil { - return err - } - } - if err := handoverRequestAcknowledgeTransfer.QosFlowSetupResponse.MarshalPER(w, enc); err != nil { - return err - } - if handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil { - if err := handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { + if beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity != nil { + if err := (*beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity).MarshalPER(w, enc); err != nil { return err } } - if handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil { - if err := handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { + if beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport != nil { + if err := (*beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if handoverRequestAcknowledgeTransfer.extensions.Present() { - if err := handoverRequestAcknowledgeTransfer.extensions.MarshalPER(w, enc); err != nil { + if beamMeasurementsReportConfiguration.extensions.Present() { + if err := beamMeasurementsReportConfiguration.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *beamMeasurementsReportConfiguration = BeamMeasurementsReportConfiguration{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwardingUPTNLInformation, err := r.ReadBit() - if err != nil { - return err - } - p_SecurityResult, err := r.ReadBit() - if err != nil { - return err - } - p_QosFlowFailedToSetup, err := r.ReadBit() + p_BeamMeasurementsReportQuantity, err := r.ReadBit() if err != nil { return err } - p_DataForwardingResponseDRB, err := r.ReadBit() + p_MaxNrofRSIndexesToReport, err := r.ReadBit() if err != nil { return err } @@ -2935,205 +3455,228 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un if err != nil { return err } - if err := (&handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - if p_DLForwardingUPTNLInformation { - var v UPTransportLayerInformation + if p_BeamMeasurementsReportQuantity { + var v BeamMeasurementsReportQuantity if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation = &v + beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity = &v } - if p_SecurityResult { - var v SecurityResult + if p_MaxNrofRSIndexesToReport { + var v MaxNrofRSIndexesToReport if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - handoverRequestAcknowledgeTransfer.SecurityResult = &v - } - if err := (&handoverRequestAcknowledgeTransfer.QosFlowSetupResponse).UnmarshalPER(r, enc); err != nil { - return err - } - if p_QosFlowFailedToSetup { - if err := (&handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_DataForwardingResponseDRB { - if err := (&handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { - return err - } + beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport = &v } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, handoverRequestAcknowledgeTransferExtIEs, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, &beamMeasurementsReportConfiguration.iEExtensions); err != nil { return err } } if extBit { - if err := handoverRequestAcknowledgeTransfer.extensions.UnmarshalPER(r, enc); err != nil { + if err := beamMeasurementsReportConfiguration.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (handoverRequiredTransfer *HandoverRequiredTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(handoverRequiredTransfer.DirectForwardingPathAvailability != nil) - w.WriteBit(false) - if handoverRequiredTransfer.DirectForwardingPathAvailability != nil { - if err := (*handoverRequiredTransfer.DirectForwardingPathAvailability).MarshalPER(w, enc); err != nil { +var extIEsBeamMeasurementsReportConfiguration []ap.IESpec[ProtocolIEID, BeamMeasurementsReportConfiguration] + +func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity != nil && beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity.Diagnose(d) { + notComprehended = true + } + if beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport != nil && beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration.iEExtensions) + return notComprehended +} + +func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, beamMeasurementsReportQuantity.iEExtensions) + w.WriteBit(beamMeasurementsReportQuantity.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := beamMeasurementsReportQuantity.RSRP.MarshalPER(w, enc); err != nil { + return err + } + if err := beamMeasurementsReportQuantity.RSRQ.MarshalPER(w, enc); err != nil { + return err + } + if err := beamMeasurementsReportQuantity.SINR.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if beamMeasurementsReportQuantity.extensions.Present() { + if err := beamMeasurementsReportQuantity.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (handoverRequiredTransfer *HandoverRequiredTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *beamMeasurementsReportQuantity = BeamMeasurementsReportQuantity{} extBit, err := r.ReadBit() if err != nil { return err } - p_DirectForwardingPathAvailability, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { + if err := (&beamMeasurementsReportQuantity.RSRP).UnmarshalPER(r, enc); err != nil { return err } - if p_DirectForwardingPathAvailability { - var v DirectForwardingPathAvailability - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - handoverRequiredTransfer.DirectForwardingPathAvailability = &v + if err := (&beamMeasurementsReportQuantity.RSRQ).UnmarshalPER(r, enc); err != nil { + return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&beamMeasurementsReportQuantity.SINR).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, &beamMeasurementsReportQuantity.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := beamMeasurementsReportQuantity.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil) - w.WriteBit(false) - if err := handoverResourceAllocationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { - return err +var extIEsBeamMeasurementsReportQuantity []ap.IESpec[ProtocolIEID, BeamMeasurementsReportQuantity] + +func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if beamMeasurementsReportQuantity.RSRP.Diagnose(d) { + notComprehended = true } - if handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil { - if err := (*handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { - return err - } + if beamMeasurementsReportQuantity.RSRQ.Diagnose(d) { + notComprehended = true } - return nil + if beamMeasurementsReportQuantity.SINR.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, beamMeasurementsReportQuantity.iEExtensions) + return notComprehended } -func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (beamMeasurementsReportQuantityRSRP BeamMeasurementsReportQuantityRSRP) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumBeamMeasurementsReportQuantityRSRP.Encode(w, enc, beamMeasurementsReportQuantityRSRP) +} + +func (beamMeasurementsReportQuantityRSRP *BeamMeasurementsReportQuantityRSRP) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumBeamMeasurementsReportQuantityRSRP.Decode(r, enc) if err != nil { return err } - p_CriticalityDiagnostics, err := r.ReadBit() + *beamMeasurementsReportQuantityRSRP = v + return nil +} + +func (beamMeasurementsReportQuantityRSRP BeamMeasurementsReportQuantityRSRP) Name() string { + return enumBeamMeasurementsReportQuantityRSRP.Name(beamMeasurementsReportQuantityRSRP) +} + +func (beamMeasurementsReportQuantityRSRP BeamMeasurementsReportQuantityRSRP) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumBeamMeasurementsReportQuantityRSRP.Known(beamMeasurementsReportQuantityRSRP) +} + +func (beamMeasurementsReportQuantityRSRQ BeamMeasurementsReportQuantityRSRQ) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumBeamMeasurementsReportQuantityRSRQ.Encode(w, enc, beamMeasurementsReportQuantityRSRQ) +} + +func (beamMeasurementsReportQuantityRSRQ *BeamMeasurementsReportQuantityRSRQ) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumBeamMeasurementsReportQuantityRSRQ.Decode(r, enc) if err != nil { return err } - p_f2, err := r.ReadBit() + *beamMeasurementsReportQuantityRSRQ = v + return nil +} + +func (beamMeasurementsReportQuantityRSRQ BeamMeasurementsReportQuantityRSRQ) Name() string { + return enumBeamMeasurementsReportQuantityRSRQ.Name(beamMeasurementsReportQuantityRSRQ) +} + +func (beamMeasurementsReportQuantityRSRQ BeamMeasurementsReportQuantityRSRQ) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumBeamMeasurementsReportQuantityRSRQ.Known(beamMeasurementsReportQuantityRSRQ) +} + +func (beamMeasurementsReportQuantitySINR BeamMeasurementsReportQuantitySINR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumBeamMeasurementsReportQuantitySINR.Encode(w, enc, beamMeasurementsReportQuantitySINR) +} + +func (beamMeasurementsReportQuantitySINR *BeamMeasurementsReportQuantitySINR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumBeamMeasurementsReportQuantitySINR.Decode(r, enc) if err != nil { return err } - if err := (&handoverResourceAllocationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + *beamMeasurementsReportQuantitySINR = v + return nil +} + +func (beamMeasurementsReportQuantitySINR BeamMeasurementsReportQuantitySINR) Name() string { + return enumBeamMeasurementsReportQuantitySINR.Name(beamMeasurementsReportQuantitySINR) +} + +func (beamMeasurementsReportQuantitySINR BeamMeasurementsReportQuantitySINR) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumBeamMeasurementsReportQuantitySINR.Known(beamMeasurementsReportQuantitySINR) +} + +func (bluetoothMeasConfig BluetoothMeasConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumBluetoothMeasConfig.Encode(w, enc, bluetoothMeasConfig) +} + +func (bluetoothMeasConfig *BluetoothMeasConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumBluetoothMeasConfig.Decode(r, enc) + if err != nil { return err } - if p_CriticalityDiagnostics { - var v CriticalityDiagnostics - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics = &v - } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } + *bluetoothMeasConfig = v return nil } -func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(lastVisitedCellItem.extensions.Present()) - w.WriteBit(lastVisitedCellItem.iEExtensions != nil) - if err := lastVisitedCellItem.LastVisitedCellInformation.MarshalPER(w, enc); err != nil { +func (bluetoothMeasConfig BluetoothMeasConfig) Name() string { + return enumBluetoothMeasConfig.Name(bluetoothMeasConfig) +} + +func (bluetoothMeasConfig BluetoothMeasConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumBluetoothMeasConfig.Known(bluetoothMeasConfig) +} + +func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem.iEExtensions) + w.WriteBit(bluetoothMeasConfigNameItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := bluetoothMeasConfigNameItem.BluetoothName.MarshalPER(w, enc); err != nil { return err } - if lastVisitedCellItem.iEExtensions != nil { - if err := (*lastVisitedCellItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if lastVisitedCellItem.extensions.Present() { - if err := lastVisitedCellItem.extensions.MarshalPER(w, enc); err != nil { + if bluetoothMeasConfigNameItem.extensions.Present() { + if err := bluetoothMeasConfigNameItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *bluetoothMeasConfigNameItem = BluetoothMeasConfigNameItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -3142,71 +3685,73 @@ func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc if err != nil { return err } - if err := (&lastVisitedCellItem.LastVisitedCellInformation).UnmarshalPER(r, enc); err != nil { + if err := (&bluetoothMeasConfigNameItem.BluetoothName).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, &bluetoothMeasConfigNameItem.iEExtensions); err != nil { return err } - lastVisitedCellItem.iEExtensions = &v } if extBit { - if err := lastVisitedCellItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := bluetoothMeasConfigNameItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(lastVisitedNGRANCellInformation.extensions.Present()) - w.WriteBit(lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity != nil) - w.WriteBit(lastVisitedNGRANCellInformation.HOCauseValue != nil) - w.WriteBit(lastVisitedNGRANCellInformation.iEExtensions != nil) - if err := lastVisitedNGRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { - return err - } - if err := lastVisitedNGRANCellInformation.CellType.MarshalPER(w, enc); err != nil { - return err - } - if err := lastVisitedNGRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { +var extIEsBluetoothMeasConfigNameItem []ap.IESpec[ProtocolIEID, BluetoothMeasConfigNameItem] + +func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem.iEExtensions) + return notComprehended +} + +func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration.iEExtensions) + w.WriteBit(bluetoothMeasurementConfiguration.extensions.Present()) + w.WriteBit(bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList != nil) + w.WriteBit(bluetoothMeasurementConfiguration.Btrssi != nil) + w.WriteBit(len(ext) > 0) + if err := bluetoothMeasurementConfiguration.BluetoothMeasConfig.MarshalPER(w, enc); err != nil { return err } - if lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity != nil { - if err := (*lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity).MarshalPER(w, enc); err != nil { + if bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList != nil { + if err := bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList.MarshalPER(w, enc); err != nil { return err } } - if lastVisitedNGRANCellInformation.HOCauseValue != nil { - if err := (*lastVisitedNGRANCellInformation.HOCauseValue).MarshalPER(w, enc); err != nil { + if bluetoothMeasurementConfiguration.Btrssi != nil { + if err := (*bluetoothMeasurementConfiguration.Btrssi).MarshalPER(w, enc); err != nil { return err } } - if lastVisitedNGRANCellInformation.iEExtensions != nil { - if err := (*lastVisitedNGRANCellInformation.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if lastVisitedNGRANCellInformation.extensions.Present() { - if err := lastVisitedNGRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + if bluetoothMeasurementConfiguration.extensions.Present() { + if err := bluetoothMeasurementConfiguration.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *bluetoothMeasurementConfiguration = BluetoothMeasurementConfiguration{} extBit, err := r.ReadBit() if err != nil { return err } - p_TimeUEStayedInCellEnhancedGranularity, err := r.ReadBit() + p_BluetoothMeasConfigNameList, err := r.ReadBit() if err != nil { return err } - p_HOCauseValue, err := r.ReadBit() + p_Btrssi, err := r.ReadBit() if err != nil { return err } @@ -3214,541 +3759,759 @@ func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) Unmarsha if err != nil { return err } - if err := (&lastVisitedNGRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { + if err := (&bluetoothMeasurementConfiguration.BluetoothMeasConfig).UnmarshalPER(r, enc); err != nil { return err } - if err := (&lastVisitedNGRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&lastVisitedNGRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { - return err - } - if p_TimeUEStayedInCellEnhancedGranularity { - var v TimeUEStayedInCellEnhancedGranularity - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_BluetoothMeasConfigNameList { + if err := (&bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList).UnmarshalPER(r, enc); err != nil { return err } - lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity = &v } - if p_HOCauseValue { - var v Cause + if p_Btrssi { + var v BluetoothMeasurementConfigurationBtrssi if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - lastVisitedNGRANCellInformation.HOCauseValue = &v + bluetoothMeasurementConfiguration.Btrssi = &v } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, &bluetoothMeasurementConfiguration.iEExtensions); err != nil { return err } - lastVisitedNGRANCellInformation.iEExtensions = &v } if extBit { - if err := lastVisitedNGRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := bluetoothMeasurementConfiguration.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (mobilityRestrictionList *MobilityRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(mobilityRestrictionList.EquivalentPLMNs != nil) - w.WriteBit(mobilityRestrictionList.RATRestrictions != nil) - w.WriteBit(mobilityRestrictionList.ForbiddenAreaInformation != nil) - w.WriteBit(mobilityRestrictionList.ServiceAreaInformation != nil) - w.WriteBit(false) - if err := mobilityRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { +var extIEsBluetoothMeasurementConfiguration []ap.IESpec[ProtocolIEID, BluetoothMeasurementConfiguration] + +func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if bluetoothMeasurementConfiguration.BluetoothMeasConfig.Diagnose(d) { + notComprehended = true + } + if bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList.Diagnose(d) { + notComprehended = true + } + if bluetoothMeasurementConfiguration.Btrssi != nil && bluetoothMeasurementConfiguration.Btrssi.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration.iEExtensions) + return notComprehended +} + +func (bluetoothMeasurementConfigurationBtrssi BluetoothMeasurementConfigurationBtrssi) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumBluetoothMeasurementConfigurationBtrssi.Encode(w, enc, bluetoothMeasurementConfigurationBtrssi) +} + +func (bluetoothMeasurementConfigurationBtrssi *BluetoothMeasurementConfigurationBtrssi) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumBluetoothMeasurementConfigurationBtrssi.Decode(r, enc) + if err != nil { return err } - if mobilityRestrictionList.EquivalentPLMNs != nil { - if err := mobilityRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { - return err + *bluetoothMeasurementConfigurationBtrssi = v + return nil +} + +func (bluetoothMeasurementConfigurationBtrssi BluetoothMeasurementConfigurationBtrssi) Name() string { + return enumBluetoothMeasurementConfigurationBtrssi.Name(bluetoothMeasurementConfigurationBtrssi) +} + +func (bluetoothMeasurementConfigurationBtrssi BluetoothMeasurementConfigurationBtrssi) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumBluetoothMeasurementConfigurationBtrssi.Known(bluetoothMeasurementConfigurationBtrssi) +} + +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{broadcastCancelledAreaList.CellIDCancelledEUTRA != nil, broadcastCancelledAreaList.TAICancelledEUTRA != nil, broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA != nil, broadcastCancelledAreaList.CellIDCancelledNR != nil, broadcastCancelledAreaList.TAICancelledNR != nil, broadcastCancelledAreaList.EmergencyAreaIDCancelledNR != nil, broadcastCancelledAreaList.ChoiceExtension != nil} { + if ok { + set++ } } - if mobilityRestrictionList.RATRestrictions != nil { - if err := mobilityRestrictionList.RATRestrictions.MarshalPER(w, enc); err != nil { + if set > 1 { + return per.ErrChoice + } + switch { + case broadcastCancelledAreaList.CellIDCancelledEUTRA != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 0); err != nil { return err } - } - if mobilityRestrictionList.ForbiddenAreaInformation != nil { - if err := mobilityRestrictionList.ForbiddenAreaInformation.MarshalPER(w, enc); err != nil { + if err := (*broadcastCancelledAreaList.CellIDCancelledEUTRA).MarshalPER(w, enc); err != nil { return err } - } - if mobilityRestrictionList.ServiceAreaInformation != nil { - if err := mobilityRestrictionList.ServiceAreaInformation.MarshalPER(w, enc); err != nil { + case broadcastCancelledAreaList.TAICancelledEUTRA != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 1); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.TAICancelledEUTRA).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 2); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.CellIDCancelledNR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 3); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.CellIDCancelledNR).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.TAICancelledNR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 4); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.TAICancelledNR).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.EmergencyAreaIDCancelledNR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 5); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.EmergencyAreaIDCancelledNR).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 6); err != nil { return err } + return ap.EncodeField(profile, w, enc, broadcastCancelledAreaList.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (mobilityRestrictionList *MobilityRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_EquivalentPLMNs, err := r.ReadBit() - if err != nil { - return err - } - p_RATRestrictions, err := r.ReadBit() - if err != nil { - return err - } - p_ForbiddenAreaInformation, err := r.ReadBit() - if err != nil { - return err - } - p_ServiceAreaInformation, err := r.ReadBit() - if err != nil { - return err - } - p_f5, err := r.ReadBit() +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *broadcastCancelledAreaList = BroadcastCancelledAreaList{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 6) if err != nil { return err } - if err := (&mobilityRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { - return err - } - if p_EquivalentPLMNs { - if err := (&mobilityRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { + switch idx { + case 0: + var v CellIDCancelledEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - if p_RATRestrictions { - if err := (&mobilityRestrictionList.RATRestrictions).UnmarshalPER(r, enc); err != nil { + broadcastCancelledAreaList.CellIDCancelledEUTRA = &v + case 1: + var v TAICancelledEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - if p_ForbiddenAreaInformation { - if err := (&mobilityRestrictionList.ForbiddenAreaInformation).UnmarshalPER(r, enc); err != nil { + broadcastCancelledAreaList.TAICancelledEUTRA = &v + case 2: + var v EmergencyAreaIDCancelledEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - if p_ServiceAreaInformation { - if err := (&mobilityRestrictionList.ServiceAreaInformation).UnmarshalPER(r, enc); err != nil { + broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA = &v + case 3: + var v CellIDCancelledNR + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - if p_f5 { - var v ieExtensions + broadcastCancelledAreaList.CellIDCancelledNR = &v + case 4: + var v TAICancelledNR if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + broadcastCancelledAreaList.TAICancelledNR = &v + case 5: + var v EmergencyAreaIDCancelledNR + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + broadcastCancelledAreaList.EmergencyAreaIDCancelledNR = &v + case 6: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + broadcastCancelledAreaList.ChoiceExtension = &f } + default: + return per.ErrOverflow } return nil } -func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil) - w.WriteBit(false) - if err := nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.MarshalPER(w, enc); err != nil { - return err +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case broadcastCancelledAreaList.CellIDCancelledEUTRA != nil: + return broadcastCancelledAreaList.CellIDCancelledEUTRA.Diagnose(d) + case broadcastCancelledAreaList.TAICancelledEUTRA != nil: + return broadcastCancelledAreaList.TAICancelledEUTRA.Diagnose(d) + case broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA != nil: + return broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA.Diagnose(d) + case broadcastCancelledAreaList.CellIDCancelledNR != nil: + return broadcastCancelledAreaList.CellIDCancelledNR.Diagnose(d) + case broadcastCancelledAreaList.TAICancelledNR != nil: + return broadcastCancelledAreaList.TAICancelledNR.Diagnose(d) + case broadcastCancelledAreaList.EmergencyAreaIDCancelledNR != nil: + return broadcastCancelledAreaList.EmergencyAreaIDCancelledNR.Diagnose(d) + case broadcastCancelledAreaList.ChoiceExtension != nil: + d.Unknown(broadcastCancelledAreaList.ChoiceExtension.ID, broadcastCancelledAreaList.ChoiceExtension.Criticality) } - if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil { - if err := (*nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF).MarshalPER(w, enc); err != nil { + return false +} + +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{broadcastCompletedAreaList.CellIDBroadcastEUTRA != nil, broadcastCompletedAreaList.TAIBroadcastEUTRA != nil, broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA != nil, broadcastCompletedAreaList.CellIDBroadcastNR != nil, broadcastCompletedAreaList.TAIBroadcastNR != nil, broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR != nil, broadcastCompletedAreaList.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case broadcastCompletedAreaList.CellIDBroadcastEUTRA != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 0); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.CellIDBroadcastEUTRA).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.TAIBroadcastEUTRA != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 1); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.TAIBroadcastEUTRA).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 2); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.CellIDBroadcastNR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 3); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.CellIDBroadcastNR).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.TAIBroadcastNR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 4); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.TAIBroadcastNR).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 5); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 6); err != nil { return err } + return ap.EncodeField(profile, w, enc, broadcastCompletedAreaList.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - p_TNLAssociationTransportLayerAddressAMF, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *broadcastCompletedAreaList = BroadcastCompletedAreaList{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 6) if err != nil { return err } - if err := (&nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress).UnmarshalPER(r, enc); err != nil { - return err - } - if p_TNLAssociationTransportLayerAddressAMF { - var v CPTransportLayerInformation + switch idx { + case 0: + var v CellIDBroadcastEUTRA if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF = &v - } - if p_f2 { - var v ieExtensions + broadcastCompletedAreaList.CellIDBroadcastEUTRA = &v + case 1: + var v TAIBroadcastEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + broadcastCompletedAreaList.TAIBroadcastEUTRA = &v + case 2: + var v EmergencyAreaIDBroadcastEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA = &v + case 3: + var v CellIDBroadcastNR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + broadcastCompletedAreaList.CellIDBroadcastNR = &v + case 4: + var v TAIBroadcastNR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + broadcastCompletedAreaList.TAIBroadcastNR = &v + case 5: + var v EmergencyAreaIDBroadcastNR if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR = &v + case 6: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + broadcastCompletedAreaList.ChoiceExtension = &f + } + default: + return per.ErrOverflow } return nil } -func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := nRCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case broadcastCompletedAreaList.CellIDBroadcastEUTRA != nil: + return broadcastCompletedAreaList.CellIDBroadcastEUTRA.Diagnose(d) + case broadcastCompletedAreaList.TAIBroadcastEUTRA != nil: + return broadcastCompletedAreaList.TAIBroadcastEUTRA.Diagnose(d) + case broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA != nil: + return broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA.Diagnose(d) + case broadcastCompletedAreaList.CellIDBroadcastNR != nil: + return broadcastCompletedAreaList.CellIDBroadcastNR.Diagnose(d) + case broadcastCompletedAreaList.TAIBroadcastNR != nil: + return broadcastCompletedAreaList.TAIBroadcastNR.Diagnose(d) + case broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR != nil: + return broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR.Diagnose(d) + case broadcastCompletedAreaList.ChoiceExtension != nil: + d.Unknown(broadcastCompletedAreaList.ChoiceExtension.ID, broadcastCompletedAreaList.ChoiceExtension.Criticality) + } + return false +} + +func (broadcastPLMNItem *BroadcastPLMNItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsBroadcastPLMNItem, broadcastPLMNItem, broadcastPLMNItem.iEExtensions) + w.WriteBit(broadcastPLMNItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := broadcastPLMNItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := nRCGI.NRCellIdentity.MarshalPER(w, enc); err != nil { + if err := broadcastPLMNItem.TAISliceSupportList.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if broadcastPLMNItem.extensions.Present() { + if err := broadcastPLMNItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (broadcastPLMNItem *BroadcastPLMNItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *broadcastPLMNItem = BroadcastPLMNItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&nRCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&broadcastPLMNItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&nRCGI.NRCellIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&broadcastPLMNItem.TAISliceSupportList).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBroadcastPLMNItem, broadcastPLMNItem, &broadcastPLMNItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := broadcastPLMNItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue + } + return nil +} + +var extIEsBroadcastPLMNItem = []ap.IESpec[ProtocolIEID, BroadcastPLMNItem]{ + { + ID: IDNPNSupport, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *BroadcastPLMNItem, r *per.Reader, enc per.Encoding) error { + var v NPNSupport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NPNSupport = &v + return nil + }, + Encode: func(x *BroadcastPLMNItem) (per.Marshaler, bool) { + if x.NPNSupport == nil { + return nil, false } - if err := per.SkipOpenType(r, enc); err != nil { + return x.NPNSupport, true + }, + }, + { + ID: IDExtendedTAISliceSupportList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *BroadcastPLMNItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedSliceSupportList + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } + x.ExtendedTAISliceSupportList = v + return nil + }, + Encode: func(x *BroadcastPLMNItem) (per.Marshaler, bool) { + if len(x.ExtendedTAISliceSupportList) == 0 { + return nil, false + } + return x.ExtendedTAISliceSupportList, true + }, + }, + { + ID: IDTAINSAGSupportList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *BroadcastPLMNItem, r *per.Reader, enc per.Encoding) error { + var v TAINSAGSupportList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TAINSAGSupportList = v + return nil + }, + Encode: func(x *BroadcastPLMNItem) (per.Marshaler, bool) { + if len(x.TAINSAGSupportList) == 0 { + return nil, false + } + return x.TAINSAGSupportList, true + }, + }, +} + +func (broadcastPLMNItem *BroadcastPLMNItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if broadcastPLMNItem.TAISliceSupportList.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsBroadcastPLMNItem, broadcastPLMNItem, broadcastPLMNItem.iEExtensions) + return notComprehended } -func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(nonDynamic5QIDescriptor.extensions.Present()) - w.WriteBit(nonDynamic5QIDescriptor.PriorityLevelQos != nil) - w.WriteBit(nonDynamic5QIDescriptor.AveragingWindow != nil) - w.WriteBit(nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil) - w.WriteBit(nonDynamic5QIDescriptor.iEExtensions != nil) - if err := nonDynamic5QIDescriptor.FiveQI.MarshalPER(w, enc); err != nil { +func (burstArrivalTimeWindow *BurstArrivalTimeWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, burstArrivalTimeWindow.iEExtensions) + w.WriteBit(burstArrivalTimeWindow.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := burstArrivalTimeWindow.BurstArrivalTimeWindowStart.MarshalPER(w, enc); err != nil { return err } - if nonDynamic5QIDescriptor.PriorityLevelQos != nil { - if err := (*nonDynamic5QIDescriptor.PriorityLevelQos).MarshalPER(w, enc); err != nil { - return err - } - } - if nonDynamic5QIDescriptor.AveragingWindow != nil { - if err := (*nonDynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { - return err - } - } - if nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil { - if err := (*nonDynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { - return err - } + if err := burstArrivalTimeWindow.BurstArrivalTimeWindowEnd.MarshalPER(w, enc); err != nil { + return err } - if nonDynamic5QIDescriptor.iEExtensions != nil { - if err := (*nonDynamic5QIDescriptor.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if nonDynamic5QIDescriptor.extensions.Present() { - if err := nonDynamic5QIDescriptor.extensions.MarshalPER(w, enc); err != nil { + if burstArrivalTimeWindow.extensions.Present() { + if err := burstArrivalTimeWindow.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (burstArrivalTimeWindow *BurstArrivalTimeWindow) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *burstArrivalTimeWindow = BurstArrivalTimeWindow{} extBit, err := r.ReadBit() if err != nil { return err } - p_PriorityLevelQos, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_AveragingWindow, err := r.ReadBit() - if err != nil { + if err := (&burstArrivalTimeWindow.BurstArrivalTimeWindowStart).UnmarshalPER(r, enc); err != nil { return err } - p_MaximumDataBurstVolume, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err - } - if err := (&nonDynamic5QIDescriptor.FiveQI).UnmarshalPER(r, enc); err != nil { + if err := (&burstArrivalTimeWindow.BurstArrivalTimeWindowEnd).UnmarshalPER(r, enc); err != nil { return err } - if p_PriorityLevelQos { - var v PriorityLevelQos - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - nonDynamic5QIDescriptor.PriorityLevelQos = &v - } - if p_AveragingWindow { - var v AveragingWindow - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - nonDynamic5QIDescriptor.AveragingWindow = &v - } - if p_MaximumDataBurstVolume { - var v MaximumDataBurstVolume - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - nonDynamic5QIDescriptor.MaximumDataBurstVolume = &v - } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, &burstArrivalTimeWindow.iEExtensions); err != nil { return err } - nonDynamic5QIDescriptor.iEExtensions = &v } if extBit { - if err := nonDynamic5QIDescriptor.extensions.UnmarshalPER(r, enc); err != nil { + if err := burstArrivalTimeWindow.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (overloadStartNSSAIItem *OverloadStartNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(overloadStartNSSAIItem.SliceOverloadResponse != nil) - w.WriteBit(overloadStartNSSAIItem.SliceTrafficLoadReductionIndication != nil) - w.WriteBit(false) - off0 := 0 - if err := per.EncodeLength(w, enc, 1, 1024, true, int64(len(overloadStartNSSAIItem.SliceOverloadList)), func(count int64) error { - end := off0 + int(count) - for i := off0; i < end; i++ { - if err := overloadStartNSSAIItem.SliceOverloadList[i].MarshalPER(w, enc); err != nil { - return err - } - } - off0 = end - return nil - }); err != nil { +var extIEsBurstArrivalTimeWindow []ap.IESpec[ProtocolIEID, BurstArrivalTimeWindow] + +func (burstArrivalTimeWindow *BurstArrivalTimeWindow) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if burstArrivalTimeWindow.BurstArrivalTimeWindowStart.Diagnose(d) { + notComprehended = true + } + if burstArrivalTimeWindow.BurstArrivalTimeWindowEnd.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, burstArrivalTimeWindow.iEExtensions) + return notComprehended +} + +func (cAGListforMDTItem *CAGListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCAGListforMDTItem, cAGListforMDTItem, cAGListforMDTItem.iEExtensions) + w.WriteBit(cAGListforMDTItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cAGListforMDTItem.PlmnID.MarshalPER(w, enc); err != nil { return err } - if overloadStartNSSAIItem.SliceOverloadResponse != nil { - if err := (*overloadStartNSSAIItem.SliceOverloadResponse).MarshalPER(w, enc); err != nil { + if err := cAGListforMDTItem.CAGID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if overloadStartNSSAIItem.SliceTrafficLoadReductionIndication != nil { - if err := (*overloadStartNSSAIItem.SliceTrafficLoadReductionIndication).MarshalPER(w, enc); err != nil { + if cAGListforMDTItem.extensions.Present() { + if err := cAGListforMDTItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (overloadStartNSSAIItem *OverloadStartNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cAGListforMDTItem *CAGListforMDTItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cAGListforMDTItem = CAGListforMDTItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_SliceOverloadResponse, err := r.ReadBit() - if err != nil { - return err - } - p_SliceTrafficLoadReductionIndication, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() - if err != nil { + if err := (&cAGListforMDTItem.PlmnID).UnmarshalPER(r, enc); err != nil { return err } - overloadStartNSSAIItem.SliceOverloadList = nil - if err := per.DecodeLength(r, enc, 1, 1024, true, func(count int64) error { - start := len(overloadStartNSSAIItem.SliceOverloadList) - overloadStartNSSAIItem.SliceOverloadList = append(overloadStartNSSAIItem.SliceOverloadList, make([]SliceOverloadItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&overloadStartNSSAIItem.SliceOverloadList[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&cAGListforMDTItem.CAGID).UnmarshalPER(r, enc); err != nil { return err } - if p_SliceOverloadResponse { - var v OverloadResponse - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - overloadStartNSSAIItem.SliceOverloadResponse = &v - } - if p_SliceTrafficLoadReductionIndication { - var v TrafficLoadReductionIndication - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - overloadStartNSSAIItem.SliceTrafficLoadReductionIndication = &v - } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCAGListforMDTItem, cAGListforMDTItem, &cAGListforMDTItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cAGListforMDTItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionAggregateMaximumBitRate.extensions.Present()) - w.WriteBit(pDUSessionAggregateMaximumBitRate.iEExtensions != nil) - if err := pDUSessionAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { +var extIEsCAGListforMDTItem []ap.IESpec[ProtocolIEID, CAGListforMDTItem] + +func (cAGListforMDTItem *CAGListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsCAGListforMDTItem, cAGListforMDTItem, cAGListforMDTItem.iEExtensions) + return notComprehended +} + +func (cEmodeBSupportIndicator CEmodeBSupportIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCEmodeBSupportIndicator.Encode(w, enc, cEmodeBSupportIndicator) +} + +func (cEmodeBSupportIndicator *CEmodeBSupportIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCEmodeBSupportIndicator.Decode(r, enc) + if err != nil { return err } - if err := pDUSessionAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { + *cEmodeBSupportIndicator = v + return nil +} + +func (cEmodeBSupportIndicator CEmodeBSupportIndicator) Name() string { + return enumCEmodeBSupportIndicator.Name(cEmodeBSupportIndicator) +} + +func (cEmodeBSupportIndicator CEmodeBSupportIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCEmodeBSupportIndicator.Known(cEmodeBSupportIndicator) +} + +func (cEmodeBrestricted CEmodeBrestricted) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCEmodeBrestricted.Encode(w, enc, cEmodeBrestricted) +} + +func (cEmodeBrestricted *CEmodeBrestricted) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCEmodeBrestricted.Decode(r, enc) + if err != nil { return err } - if pDUSessionAggregateMaximumBitRate.iEExtensions != nil { - if err := (*pDUSessionAggregateMaximumBitRate.iEExtensions).MarshalPER(w, enc); err != nil { + *cEmodeBrestricted = v + return nil +} + +func (cEmodeBrestricted CEmodeBrestricted) Name() string { + return enumCEmodeBrestricted.Name(cEmodeBrestricted) +} + +func (cEmodeBrestricted CEmodeBrestricted) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCEmodeBrestricted.Known(cEmodeBrestricted) +} + +func (cNAssistedRANTuning *CNAssistedRANTuning) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCNAssistedRANTuning, cNAssistedRANTuning, cNAssistedRANTuning.iEExtensions) + w.WriteBit(cNAssistedRANTuning.extensions.Present()) + w.WriteBit(cNAssistedRANTuning.ExpectedUEBehaviour != nil) + w.WriteBit(len(ext) > 0) + if cNAssistedRANTuning.ExpectedUEBehaviour != nil { + if err := (*cNAssistedRANTuning.ExpectedUEBehaviour).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionAggregateMaximumBitRate.extensions.Present() { - if err := pDUSessionAggregateMaximumBitRate.extensions.MarshalPER(w, enc); err != nil { + if cNAssistedRANTuning.extensions.Present() { + if err := cNAssistedRANTuning.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cNAssistedRANTuning *CNAssistedRANTuning) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cNAssistedRANTuning = CNAssistedRANTuning{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_ExpectedUEBehaviour, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { - return err + if p_ExpectedUEBehaviour { + var v ExpectedUEBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cNAssistedRANTuning.ExpectedUEBehaviour = &v } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCNAssistedRANTuning, cNAssistedRANTuning, &cNAssistedRANTuning.iEExtensions); err != nil { return err } - pDUSessionAggregateMaximumBitRate.iEExtensions = &v } if extBit { - if err := pDUSessionAggregateMaximumBitRate.extensions.UnmarshalPER(r, enc); err != nil { + if err := cNAssistedRANTuning.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceAdmittedItem.extensions.Present()) - w.WriteBit(pDUSessionResourceAdmittedItem.iEExtensions != nil) - if err := pDUSessionResourceAdmittedItem.PDUSessionID.MarshalPER(w, enc); err != nil { +var extIEsCNAssistedRANTuning []ap.IESpec[ProtocolIEID, CNAssistedRANTuning] + +func (cNAssistedRANTuning *CNAssistedRANTuning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cNAssistedRANTuning.ExpectedUEBehaviour != nil && cNAssistedRANTuning.ExpectedUEBehaviour.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCNAssistedRANTuning, cNAssistedRANTuning, cNAssistedRANTuning.iEExtensions) + return notComprehended +} + +func (cNMTCommunicationHandling CNMTCommunicationHandling) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCNMTCommunicationHandling.Encode(w, enc, cNMTCommunicationHandling) +} + +func (cNMTCommunicationHandling *CNMTCommunicationHandling) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCNMTCommunicationHandling.Decode(r, enc) + if err != nil { return err } - if err := pDUSessionResourceAdmittedItem.Transfer.MarshalPER(w, enc); err != nil { + *cNMTCommunicationHandling = v + return nil +} + +func (cNMTCommunicationHandling CNMTCommunicationHandling) Name() string { + return enumCNMTCommunicationHandling.Name(cNMTCommunicationHandling) +} + +func (cNMTCommunicationHandling CNMTCommunicationHandling) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCNMTCommunicationHandling.Known(cNMTCommunicationHandling) +} + +func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem.iEExtensions) + w.WriteBit(cNTypeRestrictionsForEquivalentItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cNTypeRestrictionsForEquivalentItem.PlmnIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := cNTypeRestrictionsForEquivalentItem.CnType.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceAdmittedItem.iEExtensions != nil { - if err := (*pDUSessionResourceAdmittedItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceAdmittedItem.extensions.Present() { - if err := pDUSessionResourceAdmittedItem.extensions.MarshalPER(w, enc); err != nil { + if cNTypeRestrictionsForEquivalentItem.extensions.Present() { + if err := cNTypeRestrictionsForEquivalentItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cNTypeRestrictionsForEquivalentItem = CNTypeRestrictionsForEquivalentItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -3757,470 +4520,547 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalP if err != nil { return err } - if err := (&pDUSessionResourceAdmittedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&cNTypeRestrictionsForEquivalentItem.PlmnIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceAdmittedItem.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&cNTypeRestrictionsForEquivalentItem.CnType).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, &cNTypeRestrictionsForEquivalentItem.iEExtensions); err != nil { return err } - pDUSessionResourceAdmittedItem.iEExtensions = &v } if extBit { - if err := pDUSessionResourceAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := cNTypeRestrictionsForEquivalentItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceFailedToModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { - return err +var extIEsCNTypeRestrictionsForEquivalentItem []ap.IESpec[ProtocolIEID, CNTypeRestrictionsForEquivalentItem] + +func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cNTypeRestrictionsForEquivalentItem.CnType.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem.iEExtensions) + return notComprehended } -func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (cNTypeRestrictionsForEquivalentItemCnType CNTypeRestrictionsForEquivalentItemCnType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCNTypeRestrictionsForEquivalentItemCnType.Encode(w, enc, cNTypeRestrictionsForEquivalentItemCnType) +} + +func (cNTypeRestrictionsForEquivalentItemCnType *CNTypeRestrictionsForEquivalentItemCnType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCNTypeRestrictionsForEquivalentItemCnType.Decode(r, enc) if err != nil { return err } - p_f2, err := r.ReadBit() + *cNTypeRestrictionsForEquivalentItemCnType = v + return nil +} + +func (cNTypeRestrictionsForEquivalentItemCnType CNTypeRestrictionsForEquivalentItemCnType) Name() string { + return enumCNTypeRestrictionsForEquivalentItemCnType.Name(cNTypeRestrictionsForEquivalentItemCnType) +} + +func (cNTypeRestrictionsForEquivalentItemCnType CNTypeRestrictionsForEquivalentItemCnType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCNTypeRestrictionsForEquivalentItemCnType.Known(cNTypeRestrictionsForEquivalentItemCnType) +} + +func (cNTypeRestrictionsForServing CNTypeRestrictionsForServing) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCNTypeRestrictionsForServing.Encode(w, enc, cNTypeRestrictionsForServing) +} + +func (cNTypeRestrictionsForServing *CNTypeRestrictionsForServing) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCNTypeRestrictionsForServing.Decode(r, enc) if err != nil { return err } - if err := (&pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err + *cNTypeRestrictionsForServing = v + return nil +} + +func (cNTypeRestrictionsForServing CNTypeRestrictionsForServing) Name() string { + return enumCNTypeRestrictionsForServing.Name(cNTypeRestrictionsForServing) +} + +func (cNTypeRestrictionsForServing CNTypeRestrictionsForServing) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCNTypeRestrictionsForServing.Known(cNTypeRestrictionsForServing) +} + +func (cPTransportLayerInformation *CPTransportLayerInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{cPTransportLayerInformation.EndpointIPAddress != nil, cPTransportLayerInformation.EndpointIPAddressAndPort != nil, cPTransportLayerInformation.ChoiceExtension != nil} { + if ok { + set++ + } } - if err := (&pDUSessionResourceFailedToModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { - return err + if set > 1 { + return per.ErrChoice } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + switch { + case cPTransportLayerInformation.EndpointIPAddress != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := (*cPTransportLayerInformation.EndpointIPAddress).MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + case cPTransportLayerInformation.EndpointIPAddressAndPort != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDEndpointIPAddressAndPort, Criticality: cPTransportLayerInformation.choiceCriticality.Of(ap.CriticalityReject), Value: cPTransportLayerInformation.EndpointIPAddressAndPort}) + case cPTransportLayerInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, cPTransportLayerInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceFailedToModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceFailedToModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { - return err - } - return nil -} - -func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() +func (cPTransportLayerInformation *CPTransportLayerInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cPTransportLayerInformation = CPTransportLayerInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) if err != nil { return err } - if err := (&pDUSessionResourceFailedToModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceFailedToModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f2 { - var v ieExtensions + switch idx { + case 0: + var v TransportLayerAddress if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + cPTransportLayerInformation.EndpointIPAddress = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { + switch f.ID { + case IDEndpointIPAddressAndPort: + var v EndpointIPAddressAndPort + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { return err } + if !ap.Comprehended[ProtocolIEID](&v) { + cPTransportLayerInformation.ChoiceExtension = &f + break + } + cPTransportLayerInformation.EndpointIPAddressAndPort = &v + cPTransportLayerInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + default: + cPTransportLayerInformation.ChoiceExtension = &f } + default: + return per.ErrOverflow } return nil } -func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +func (cPTransportLayerInformation *CPTransportLayerInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case cPTransportLayerInformation.EndpointIPAddress != nil: + case cPTransportLayerInformation.EndpointIPAddressAndPort != nil: + d.IE(IDEndpointIPAddressAndPort, cPTransportLayerInformation.choiceCriticality.Of(ap.CriticalityReject), cPTransportLayerInformation.EndpointIPAddressAndPort) + case cPTransportLayerInformation.ChoiceExtension != nil: + d.Unknown(cPTransportLayerInformation.ChoiceExtension.ID, cPTransportLayerInformation.ChoiceExtension.Criticality) } - if err := pDUSessionResourceFailedToSetupItemCxtFail.Transfer.MarshalPER(w, enc); err != nil { + return false +} + +func (cancelAllWarningMessages CancelAllWarningMessages) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCancelAllWarningMessages.Encode(w, enc, cancelAllWarningMessages) +} + +func (cancelAllWarningMessages *CancelAllWarningMessages) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCancelAllWarningMessages.Decode(r, enc) + if err != nil { return err } + *cancelAllWarningMessages = v return nil } -func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelAllWarningMessages CancelAllWarningMessages) Name() string { + return enumCancelAllWarningMessages.Name(cancelAllWarningMessages) +} + +func (cancelAllWarningMessages CancelAllWarningMessages) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCancelAllWarningMessages.Known(cancelAllWarningMessages) +} + +func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem.iEExtensions) + w.WriteBit(cancelledCellsInEAIEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInEAIEUTRAItem.NumberOfBroadcasts)); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cancelledCellsInEAIEUTRAItem.extensions.Present() { + if err := cancelledCellsInEAIEUTRAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellsInEAIEUTRAItem = CancelledCellsInEAIEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&cancelledCellsInEAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemCxtFail.Transfer).UnmarshalPER(r, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + cancelledCellsInEAIEUTRAItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, &cancelledCellsInEAIEUTRAItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cancelledCellsInEAIEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { +var extIEsCancelledCellsInEAIEUTRAItem []ap.IESpec[ProtocolIEID, CancelledCellsInEAIEUTRAItem] + +func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cancelledCellsInEAIEUTRAItem.EUTRACGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem.iEExtensions) + return notComprehended +} + +func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, cancelledCellsInEAINRItem.iEExtensions) + w.WriteBit(cancelledCellsInEAINRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInEAINRItem.NumberOfBroadcasts)); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cancelledCellsInEAINRItem.extensions.Present() { + if err := cancelledCellsInEAINRItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellsInEAINRItem = CancelledCellsInEAINRItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&cancelledCellsInEAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + cancelledCellsInEAINRItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, &cancelledCellsInEAINRItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cancelledCellsInEAINRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID.MarshalPER(w, enc); err != nil { +var extIEsCancelledCellsInEAINRItem []ap.IESpec[ProtocolIEID, CancelledCellsInEAINRItem] + +func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cancelledCellsInEAINRItem.NRCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, cancelledCellsInEAINRItem.iEExtensions) + return notComprehended +} + +func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem.iEExtensions) + w.WriteBit(cancelledCellsInTAIEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToSetupItemHOAck.Transfer.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInTAIEUTRAItem.NumberOfBroadcasts)); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cancelledCellsInTAIEUTRAItem.extensions.Present() { + if err := cancelledCellsInTAIEUTRAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellsInTAIEUTRAItem = CancelledCellsInTAIEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&cancelledCellsInTAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemHOAck.Transfer).UnmarshalPER(r, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + cancelledCellsInTAIEUTRAItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, &cancelledCellsInTAIEUTRAItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cancelledCellsInTAIEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID.MarshalPER(w, enc); err != nil { +var extIEsCancelledCellsInTAIEUTRAItem []ap.IESpec[ProtocolIEID, CancelledCellsInTAIEUTRAItem] + +func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cancelledCellsInTAIEUTRAItem.EUTRACGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem.iEExtensions) + return notComprehended +} + +func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, cancelledCellsInTAINRItem.iEExtensions) + w.WriteBit(cancelledCellsInTAINRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceFailedToSetupItemPSReq.Transfer.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellsInTAINRItem.NumberOfBroadcasts)); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cancelledCellsInTAINRItem.extensions.Present() { + if err := cancelledCellsInTAINRItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellsInTAINRItem = CancelledCellsInTAINRItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&cancelledCellsInTAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceFailedToSetupItemPSReq.Transfer).UnmarshalPER(r, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + cancelledCellsInTAINRItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, &cancelledCellsInTAINRItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cancelledCellsInTAINRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceFailedToSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceFailedToSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { - return err +var extIEsCancelledCellsInTAINRItem []ap.IESpec[ProtocolIEID, CancelledCellsInTAINRItem] + +func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cancelledCellsInTAINRItem.NRCGI.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, cancelledCellsInTAINRItem.iEExtensions) + return notComprehended } -func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err +func (candidateCell *CandidateCell) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{candidateCell.CandidateCGI != nil, candidateCell.CandidatePCI != nil, candidateCell.ChoiceExtension != nil} { + if ok { + set++ + } } - p_f2, err := r.ReadBit() - if err != nil { - return err + if set > 1 { + return per.ErrChoice } - if err := (&pDUSessionResourceFailedToSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err + switch { + case candidateCell.CandidateCGI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*candidateCell.CandidateCGI).MarshalPER(w, enc); err != nil { + return err + } + case candidateCell.CandidatePCI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*candidateCell.CandidatePCI).MarshalPER(w, enc); err != nil { + return err + } + case candidateCell.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, candidateCell.ChoiceExtension.Field()) + default: + return per.ErrEmpty } - if err := (&pDUSessionResourceFailedToSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { + return nil +} + +func (candidateCell *CandidateCell) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *candidateCell = CandidateCell{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { return err } - if p_f2 { - var v ieExtensions + switch idx { + case 0: + var v CandidateCellID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + candidateCell.CandidateCGI = &v + case 1: + var v CandidatePCI + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + candidateCell.CandidatePCI = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err } + switch f.ID { + default: + candidateCell.ChoiceExtension = &f + } + default: + return per.ErrOverflow } return nil } -func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceHandoverItem.extensions.Present()) - w.WriteBit(pDUSessionResourceHandoverItem.iEExtensions != nil) - if err := pDUSessionResourceHandoverItem.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +func (candidateCell *CandidateCell) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case candidateCell.CandidateCGI != nil: + return candidateCell.CandidateCGI.Diagnose(d) + case candidateCell.CandidatePCI != nil: + return candidateCell.CandidatePCI.Diagnose(d) + case candidateCell.ChoiceExtension != nil: + d.Unknown(candidateCell.ChoiceExtension.ID, candidateCell.ChoiceExtension.Criticality) } - if err := pDUSessionResourceHandoverItem.Transfer.MarshalPER(w, enc); err != nil { + return false +} + +func (candidateCellID *CandidateCellID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCandidateCellID, candidateCellID, candidateCellID.iEExtensions) + w.WriteBit(candidateCellID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := candidateCellID.CandidateCellID.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceHandoverItem.iEExtensions != nil { - if err := (*pDUSessionResourceHandoverItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceHandoverItem.extensions.Present() { - if err := pDUSessionResourceHandoverItem.extensions.MarshalPER(w, enc); err != nil { + if candidateCellID.extensions.Present() { + if err := candidateCellID.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (candidateCellID *CandidateCellID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *candidateCellID = CandidateCellID{} extBit, err := r.ReadBit() if err != nil { return err @@ -4229,480 +5069,575 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalP if err != nil { return err } - if err := (&pDUSessionResourceHandoverItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceHandoverItem.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&candidateCellID.CandidateCellID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidateCellID, candidateCellID, &candidateCellID.iEExtensions); err != nil { return err } - pDUSessionResourceHandoverItem.iEExtensions = &v } if extBit { - if err := pDUSessionResourceHandoverItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := candidateCellID.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceInformationItem.extensions.Present()) - w.WriteBit(pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList != nil) - w.WriteBit(pDUSessionResourceInformationItem.iEExtensions != nil) - if err := pDUSessionResourceInformationItem.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCandidateCellID []ap.IESpec[ProtocolIEID, CandidateCellID] + +func (candidateCellID *CandidateCellID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if candidateCellID.CandidateCellID.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceInformationItem.QosFlowInformationList.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCandidateCellID, candidateCellID, candidateCellID.iEExtensions) + return notComprehended +} + +func (candidateCellItem *CandidateCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCandidateCellItem, candidateCellItem, candidateCellItem.iEExtensions) + w.WriteBit(candidateCellItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := candidateCellItem.CandidateCell.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList != nil { - if err := pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList.MarshalPER(w, enc); err != nil { - return err - } - } - if pDUSessionResourceInformationItem.iEExtensions != nil { - if err := (*pDUSessionResourceInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceInformationItem.extensions.Present() { - if err := pDUSessionResourceInformationItem.extensions.MarshalPER(w, enc); err != nil { + if candidateCellItem.extensions.Present() { + if err := candidateCellItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (candidateCellItem *CandidateCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *candidateCellItem = CandidateCellItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_DRBsToQosFlowsMappingList, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceInformationItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceInformationItem.QosFlowInformationList).UnmarshalPER(r, enc); err != nil { + if err := (&candidateCellItem.CandidateCell).UnmarshalPER(r, enc); err != nil { return err } - if p_DRBsToQosFlowsMappingList { - if err := (&pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList).UnmarshalPER(r, enc); err != nil { - return err - } - } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidateCellItem, candidateCellItem, &candidateCellItem.iEExtensions); err != nil { return err } - pDUSessionResourceInformationItem.iEExtensions = &v } if extBit { - if err := pDUSessionResourceInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := candidateCellItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceItemCxtRelCpl.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCandidateCellItem []ap.IESpec[ProtocolIEID, CandidateCellItem] + +func (candidateCellItem *CandidateCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if candidateCellItem.CandidateCell.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsCandidateCellItem, candidateCellItem, candidateCellItem.iEExtensions) + return notComprehended } -func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (candidatePCI *CandidatePCI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCandidatePCI, candidatePCI, candidatePCI.iEExtensions) + w.WriteBit(candidatePCI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := candidatePCI.CandidatePCI.MarshalPER(w, enc); err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { + if err := candidatePCI.CandidateNRARFCN.MarshalPER(w, enc); err != nil { return err } - if err := (&pDUSessionResourceItemCxtRelCpl.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if candidatePCI.extensions.Present() { + if err := candidatePCI.extensions.MarshalPER(w, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - -func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceItemCxtRelReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err } return nil } -func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (candidatePCI *CandidatePCI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *candidatePCI = CandidatePCI{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceItemCxtRelReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&candidatePCI.CandidatePCI).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&candidatePCI.CandidateNRARFCN).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidatePCI, candidatePCI, &candidatePCI.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := candidatePCI.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceItemHORqd.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCandidatePCI []ap.IESpec[ProtocolIEID, CandidatePCI] + +func (candidatePCI *CandidatePCI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if candidatePCI.CandidatePCI.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceItemHORqd.Transfer.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCandidatePCI, candidatePCI, candidatePCI.iEExtensions) + return notComprehended +} + +func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, candidateRelayUEInformationItem.iEExtensions) + w.WriteBit(candidateRelayUEInformationItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := candidateRelayUEInformationItem.CandidateRelayUEId.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if candidateRelayUEInformationItem.extensions.Present() { + if err := candidateRelayUEInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *candidateRelayUEInformationItem = CandidateRelayUEInformationItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceItemHORqd.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceItemHORqd.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&candidateRelayUEInformationItem.CandidateRelayUEId).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, &candidateRelayUEInformationItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := candidateRelayUEInformationItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pDUSessionResourceModifyConfirmTransferExtIEs, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions) - w.WriteBit(pDUSessionResourceModifyConfirmTransfer.extensions.Present()) - w.WriteBit(pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil) - w.WriteBit(len(ext) > 0) - if err := pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.MarshalPER(w, enc); err != nil { - return err +var extIEsCandidateRelayUEInformationItem []ap.IESpec[ProtocolIEID, CandidateRelayUEInformationItem] + +func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, candidateRelayUEInformationItem.iEExtensions) + return notComprehended +} + +func (cause *Cause) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{cause.RadioNetwork != nil, cause.Transport != nil, cause.NAS != nil, cause.Protocol != nil, cause.Misc != nil, cause.ChoiceExtension != nil} { + if ok { + set++ + } } - if err := pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { - return err + if set > 1 { + return per.ErrChoice } - if pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil { - if err := pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + switch { + case cause.RadioNetwork != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 5, 0); err != nil { return err } - } - if pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil { - if err := pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify.MarshalPER(w, enc); err != nil { + if err := (*cause.RadioNetwork).MarshalPER(w, enc); err != nil { return err } - } - if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + case cause.Transport != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 5, 1); err != nil { return err } - } - if pDUSessionResourceModifyConfirmTransfer.extensions.Present() { - if err := pDUSessionResourceModifyConfirmTransfer.extensions.MarshalPER(w, enc); err != nil { + if err := (*cause.Transport).MarshalPER(w, enc); err != nil { + return err + } + case cause.NAS != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 5, 2); err != nil { + return err + } + if err := (*cause.NAS).MarshalPER(w, enc); err != nil { + return err + } + case cause.Protocol != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 5, 3); err != nil { + return err + } + if err := (*cause.Protocol).MarshalPER(w, enc); err != nil { + return err + } + case cause.Misc != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 5, 4); err != nil { + return err + } + if err := (*cause.Misc).MarshalPER(w, enc); err != nil { + return err + } + case cause.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 5, 5); err != nil { return err } + return ap.EncodeField(profile, w, enc, cause.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (cause *Cause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cause = Cause{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 5) if err != nil { return err } - p_AdditionalNGUUPTNLInformation, err := r.ReadBit() + switch idx { + case 0: + var v CauseRadioNetwork + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.RadioNetwork = &v + case 1: + var v CauseTransport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.Transport = &v + case 2: + var v CauseNas + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.NAS = &v + case 3: + var v CauseProtocol + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.Protocol = &v + case 4: + var v CauseMisc + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.Misc = &v + case 5: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + cause.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (cause *Cause) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case cause.RadioNetwork != nil: + return cause.RadioNetwork.Diagnose(d) + case cause.Transport != nil: + return cause.Transport.Diagnose(d) + case cause.NAS != nil: + return cause.NAS.Diagnose(d) + case cause.Protocol != nil: + return cause.Protocol.Diagnose(d) + case cause.Misc != nil: + return cause.Misc.Diagnose(d) + case cause.ChoiceExtension != nil: + d.Unknown(cause.ChoiceExtension.ID, cause.ChoiceExtension.Criticality) + } + return false +} + +func (causeMisc CauseMisc) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseMisc.Encode(w, enc, causeMisc) +} + +func (causeMisc *CauseMisc) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseMisc.Decode(r, enc) if err != nil { return err } - p_QosFlowFailedToModify, err := r.ReadBit() + *causeMisc = v + return nil +} + +func (causeMisc CauseMisc) Name() string { + return enumCauseMisc.Name(causeMisc) +} + +func (causeMisc CauseMisc) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseMisc.Known(causeMisc) +} + +func (causeNas CauseNas) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseNas.Encode(w, enc, causeNas) +} + +func (causeNas *CauseNas) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseNas.Decode(r, enc) if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + *causeNas = v + return nil +} + +func (causeNas CauseNas) Name() string { + return enumCauseNas.Name(causeNas) +} + +func (causeNas CauseNas) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseNas.Known(causeNas) +} + +func (causeProtocol CauseProtocol) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseProtocol.Encode(w, enc, causeProtocol) +} + +func (causeProtocol *CauseProtocol) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseProtocol.Decode(r, enc) if err != nil { return err } - if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm).UnmarshalPER(r, enc); err != nil { + *causeProtocol = v + return nil +} + +func (causeProtocol CauseProtocol) Name() string { + return enumCauseProtocol.Name(causeProtocol) +} + +func (causeProtocol CauseProtocol) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseProtocol.Known(causeProtocol) +} + +func (causeRadioNetwork CauseRadioNetwork) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseRadioNetwork.Encode(w, enc, causeRadioNetwork) +} + +func (causeRadioNetwork *CauseRadioNetwork) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseRadioNetwork.Decode(r, enc) + if err != nil { return err } - if err := (&pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + *causeRadioNetwork = v + return nil +} + +func (causeRadioNetwork CauseRadioNetwork) Name() string { + return enumCauseRadioNetwork.Name(causeRadioNetwork) +} + +func (causeRadioNetwork CauseRadioNetwork) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseRadioNetwork.Known(causeRadioNetwork) +} + +func (causeTransport CauseTransport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseTransport.Encode(w, enc, causeTransport) +} + +func (causeTransport *CauseTransport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseTransport.Decode(r, enc) + if err != nil { return err } - if p_AdditionalNGUUPTNLInformation { - if err := (&pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_QosFlowFailedToModify { - if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyConfirmTransferExtIEs, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions); err != nil { - return err - } - } - if extBit { - if err := pDUSessionResourceModifyConfirmTransfer.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } + *causeTransport = v return nil } -func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pDUSessionResourceModifyIndicationTransferExtIEs, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions) - w.WriteBit(pDUSessionResourceModifyIndicationTransfer.extensions.Present()) - w.WriteBit(pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil) +func (causeTransport CauseTransport) Name() string { + return enumCauseTransport.Name(causeTransport) +} + +func (causeTransport CauseTransport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseTransport.Known(causeTransport) +} + +func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, cellBasedMDTEUTRA.iEExtensions) + w.WriteBit(cellBasedMDTEUTRA.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + if err := cellBasedMDTEUTRA.CellIdListforMDT.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil { - if err := pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { - return err - } - } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceModifyIndicationTransfer.extensions.Present() { - if err := pDUSessionResourceModifyIndicationTransfer.extensions.MarshalPER(w, enc); err != nil { + if cellBasedMDTEUTRA.extensions.Present() { + if err := cellBasedMDTEUTRA.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellBasedMDTEUTRA = CellBasedMDTEUTRA{} extBit, err := r.ReadBit() if err != nil { return err } - p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&cellBasedMDTEUTRA.CellIdListforMDT).UnmarshalPER(r, enc); err != nil { return err } - if p_AdditionalDLQosFlowPerTNLInformation { - if err := (&pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyIndicationTransferExtIEs, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, &cellBasedMDTEUTRA.iEExtensions); err != nil { return err } } if extBit { - if err := pDUSessionResourceModifyIndicationTransfer.extensions.UnmarshalPER(r, enc); err != nil { + if err := cellBasedMDTEUTRA.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { +var extIEsCellBasedMDTEUTRA []ap.IESpec[ProtocolIEID, CellBasedMDTEUTRA] + +func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellBasedMDTEUTRA.CellIdListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, cellBasedMDTEUTRA.iEExtensions) + return notComprehended +} + +func (cellBasedMDTNR *CellBasedMDTNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellBasedMDTNR, cellBasedMDTNR, cellBasedMDTNR.iEExtensions) + w.WriteBit(cellBasedMDTNR.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellBasedMDTNR.CellIdListforMDT.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cellBasedMDTNR.extensions.Present() { + if err := cellBasedMDTNR.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellBasedMDTNR *CellBasedMDTNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellBasedMDTNR = CellBasedMDTNR{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&cellBasedMDTNR.CellIdListforMDT).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedMDTNR, cellBasedMDTNR, &cellBasedMDTNR.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cellBasedMDTNR.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceModifyItemModCfm.extensions.Present()) - w.WriteBit(pDUSessionResourceModifyItemModCfm.iEExtensions != nil) - if err := pDUSessionResourceModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCellBasedMDTNR []ap.IESpec[ProtocolIEID, CellBasedMDTNR] + +func (cellBasedMDTNR *CellBasedMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellBasedMDTNR.CellIdListforMDT.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCellBasedMDTNR, cellBasedMDTNR, cellBasedMDTNR.iEExtensions) + return notComprehended +} + +func (cellBasedQMC *CellBasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellBasedQMC, cellBasedQMC, cellBasedQMC.iEExtensions) + w.WriteBit(cellBasedQMC.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellBasedQMC.CellIdListforQMC.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceModifyItemModCfm.iEExtensions != nil { - if err := (*pDUSessionResourceModifyItemModCfm.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceModifyItemModCfm.extensions.Present() { - if err := pDUSessionResourceModifyItemModCfm.extensions.MarshalPER(w, enc); err != nil { + if cellBasedQMC.extensions.Present() { + if err := cellBasedQMC.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellBasedQMC *CellBasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellBasedQMC = CellBasedQMC{} extBit, err := r.ReadBit() if err != nil { return err @@ -4711,50 +5646,55 @@ func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Un if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&cellBasedQMC.CellIdListforQMC).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedQMC, cellBasedQMC, &cellBasedQMC.iEExtensions); err != nil { return err } - pDUSessionResourceModifyItemModCfm.iEExtensions = &v } if extBit { - if err := pDUSessionResourceModifyItemModCfm.extensions.UnmarshalPER(r, enc); err != nil { + if err := cellBasedQMC.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceModifyItemModInd.extensions.Present()) - w.WriteBit(pDUSessionResourceModifyItemModInd.iEExtensions != nil) - if err := pDUSessionResourceModifyItemModInd.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCellBasedQMC []ap.IESpec[ProtocolIEID, CellBasedQMC] + +func (cellBasedQMC *CellBasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellBasedQMC.CellIdListforQMC.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceModifyItemModInd.Transfer.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCellBasedQMC, cellBasedQMC, cellBasedQMC.iEExtensions) + return notComprehended +} + +func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem.iEExtensions) + w.WriteBit(cellIDBroadcastEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellIDBroadcastEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceModifyItemModInd.iEExtensions != nil { - if err := (*pDUSessionResourceModifyItemModInd.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceModifyItemModInd.extensions.Present() { - if err := pDUSessionResourceModifyItemModInd.extensions.MarshalPER(w, enc); err != nil { + if cellIDBroadcastEUTRAItem.extensions.Present() { + if err := cellIDBroadcastEUTRAItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIDBroadcastEUTRAItem = CellIDBroadcastEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -4763,118 +5703,115 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Un if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModInd.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceModifyItemModInd.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&cellIDBroadcastEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, &cellIDBroadcastEUTRAItem.iEExtensions); err != nil { return err } - pDUSessionResourceModifyItemModInd.iEExtensions = &v } if extBit { - if err := pDUSessionResourceModifyItemModInd.extensions.UnmarshalPER(r, enc); err != nil { + if err := cellIDBroadcastEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pDUSessionResourceModifyItemModReqExtIEs, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions) - w.WriteBit(pDUSessionResourceModifyItemModReq.extensions.Present()) - w.WriteBit(pDUSessionResourceModifyItemModReq.NASPDU != nil) - w.WriteBit(len(ext) > 0) - if err := pDUSessionResourceModifyItemModReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if pDUSessionResourceModifyItemModReq.NASPDU != nil { - if err := (*pDUSessionResourceModifyItemModReq.NASPDU).MarshalPER(w, enc); err != nil { - return err - } +var extIEsCellIDBroadcastEUTRAItem []ap.IESpec[ProtocolIEID, CellIDBroadcastEUTRAItem] + +func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellIDBroadcastEUTRAItem.EUTRACGI.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceModifyItemModReq.Transfer.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem.iEExtensions) + return notComprehended +} + +func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, cellIDBroadcastNRItem.iEExtensions) + w.WriteBit(cellIDBroadcastNRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellIDBroadcastNRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceModifyItemModReq.extensions.Present() { - if err := pDUSessionResourceModifyItemModReq.extensions.MarshalPER(w, enc); err != nil { + if cellIDBroadcastNRItem.extensions.Present() { + if err := cellIDBroadcastNRItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIDBroadcastNRItem = CellIDBroadcastNRItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if p_NASPDU { - var v NASPDU - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceModifyItemModReq.NASPDU = &v - } - if err := (&pDUSessionResourceModifyItemModReq.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&cellIDBroadcastNRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyItemModReqExtIEs, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, &cellIDBroadcastNRItem.iEExtensions); err != nil { return err } } if extBit { - if err := pDUSessionResourceModifyItemModReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := cellIDBroadcastNRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceModifyItemModRes.extensions.Present()) - w.WriteBit(pDUSessionResourceModifyItemModRes.iEExtensions != nil) - if err := pDUSessionResourceModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { +var extIEsCellIDBroadcastNRItem []ap.IESpec[ProtocolIEID, CellIDBroadcastNRItem] + +func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellIDBroadcastNRItem.NRCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, cellIDBroadcastNRItem.iEExtensions) + return notComprehended +} + +func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem.iEExtensions) + w.WriteBit(cellIDCancelledEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellIDCancelledEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } - if err := pDUSessionResourceModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledEUTRAItem.NumberOfBroadcasts)); err != nil { return err } - if pDUSessionResourceModifyItemModRes.iEExtensions != nil { - if err := (*pDUSessionResourceModifyItemModRes.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceModifyItemModRes.extensions.Present() { - if err := pDUSessionResourceModifyItemModRes.extensions.MarshalPER(w, enc); err != nil { + if cellIDCancelledEUTRAItem.extensions.Present() { + if err := cellIDCancelledEUTRAItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIDCancelledEUTRAItem = CellIDCancelledEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -4883,794 +5820,816 @@ func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Un if err != nil { return err } - if err := (&pDUSessionResourceModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := (&cellIDCancelledEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&pDUSessionResourceModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } + cellIDCancelledEUTRAItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, &cellIDCancelledEUTRAItem.iEExtensions); err != nil { return err } - pDUSessionResourceModifyItemModRes.iEExtensions = &v } if extBit { - if err := pDUSessionResourceModifyItemModRes.extensions.UnmarshalPER(r, enc); err != nil { + if err := cellIDCancelledEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pDUSessionResourceModifyResponseTransferExtIEs, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.extensions.Present()) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) - w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil) - w.WriteBit(len(ext) > 0) - if pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil { - if err := (*pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil { - if err := (*pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } - } - if pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil { - if err := pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse.MarshalPER(w, enc); err != nil { - return err - } +var extIEsCellIDCancelledEUTRAItem []ap.IESpec[ProtocolIEID, CellIDCancelledEUTRAItem] + +func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellIDCancelledEUTRAItem.EUTRACGI.Diagnose(d) { + notComprehended = true } - if pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { - if err := pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { - return err - } + ap.DiagnoseExtensions(d, extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem.iEExtensions) + return notComprehended +} + +func (cellIDCancelledNRItem *CellIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, cellIDCancelledNRItem.iEExtensions) + w.WriteBit(cellIDCancelledNRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellIDCancelledNRItem.NRCGI.MarshalPER(w, enc); err != nil { + return err } - if pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil { - if err := pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify.MarshalPER(w, enc); err != nil { - return err - } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledNRItem.NumberOfBroadcasts)); err != nil { + return err } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceModifyResponseTransfer.extensions.Present() { - if err := pDUSessionResourceModifyResponseTransfer.extensions.MarshalPER(w, enc); err != nil { + if cellIDCancelledNRItem.extensions.Present() { + if err := cellIDCancelledNRItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellIDCancelledNRItem *CellIDCancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIDCancelledNRItem = CellIDCancelledNRItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLNGUUPTNLInformation, err := r.ReadBit() - if err != nil { - return err - } - p_ULNGUUPTNLInformation, err := r.ReadBit() - if err != nil { - return err - } - p_QosFlowAddOrModifyResponse, err := r.ReadBit() - if err != nil { - return err - } - p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_QosFlowFailedToAddOrModify, err := r.ReadBit() - if err != nil { + if err := (&cellIDCancelledNRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } - p_iEExtensions, err := r.ReadBit() + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) if err != nil { return err } - if p_DLNGUUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { + cellIDCancelledNRItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, &cellIDCancelledNRItem.iEExtensions); err != nil { return err } - pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation = &v } - if p_ULNGUUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { + if extBit { + if err := cellIDCancelledNRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation = &v } - if p_QosFlowAddOrModifyResponse { - if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse).UnmarshalPER(r, enc); err != nil { - return err + return nil +} + +var extIEsCellIDCancelledNRItem []ap.IESpec[ProtocolIEID, CellIDCancelledNRItem] + +func (cellIDCancelledNRItem *CellIDCancelledNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellIDCancelledNRItem.NRCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, cellIDCancelledNRItem.iEExtensions) + return notComprehended +} + +func (cellIDListForRestart *CellIDListForRestart) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{cellIDListForRestart.EUTRACGIListforRestart != nil, cellIDListForRestart.NRCGIListforRestart != nil, cellIDListForRestart.ChoiceExtension != nil} { + if ok { + set++ } } - if p_AdditionalDLQosFlowPerTNLInformation { - if err := (&pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + if set > 1 { + return per.ErrChoice + } + switch { + case cellIDListForRestart.EUTRACGIListforRestart != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { return err } - } - if p_QosFlowFailedToAddOrModify { - if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify).UnmarshalPER(r, enc); err != nil { + if err := (*cellIDListForRestart.EUTRACGIListforRestart).MarshalPER(w, enc); err != nil { return err } - } - if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, pDUSessionResourceModifyResponseTransferExtIEs, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions); err != nil { + case cellIDListForRestart.NRCGIListforRestart != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { return err } - } - if extBit { - if err := pDUSessionResourceModifyResponseTransfer.extensions.UnmarshalPER(r, enc); err != nil { + if err := (*cellIDListForRestart.NRCGIListforRestart).MarshalPER(w, enc); err != nil { return err } - } - return nil -} - -func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil) - w.WriteBit(false) - if err := pDUSessionResourceModifyUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { - return err - } - if pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil { - if err := (*pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { + case cellIDListForRestart.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } + return ap.EncodeField(profile, w, enc, cellIDListForRestart.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_CriticalityDiagnostics, err := r.ReadBit() +func (cellIDListForRestart *CellIDListForRestart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIDListForRestart = CellIDListForRestart{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&pDUSessionResourceModifyUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { - return err - } - if p_CriticalityDiagnostics { - var v CriticalityDiagnostics + switch idx { + case 0: + var v EUTRACGIList if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics = &v - } - if p_f2 { - var v ieExtensions + cellIDListForRestart.EUTRACGIListforRestart = &v + case 1: + var v NRCGIList if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + cellIDListForRestart.NRCGIListforRestart = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + switch f.ID { + default: + cellIDListForRestart.ChoiceExtension = &f } + default: + return per.ErrOverflow } return nil } -func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceNotifyItem.PDUSessionID.MarshalPER(w, enc); err != nil { +func (cellIDListForRestart *CellIDListForRestart) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case cellIDListForRestart.EUTRACGIListforRestart != nil: + return cellIDListForRestart.EUTRACGIListforRestart.Diagnose(d) + case cellIDListForRestart.NRCGIListforRestart != nil: + return cellIDListForRestart.NRCGIListforRestart.Diagnose(d) + case cellIDListForRestart.ChoiceExtension != nil: + d.Unknown(cellIDListForRestart.ChoiceExtension.ID, cellIDListForRestart.ChoiceExtension.Criticality) + } + return false +} + +func (cellSize CellSize) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCellSize.Encode(w, enc, cellSize) +} + +func (cellSize *CellSize) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCellSize.Decode(r, enc) + if err != nil { return err } - if err := pDUSessionResourceNotifyItem.Transfer.MarshalPER(w, enc); err != nil { + *cellSize = v + return nil +} + +func (cellSize CellSize) Name() string { + return enumCellSize.Name(cellSize) +} + +func (cellSize CellSize) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCellSize.Known(cellSize) +} + +func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellType, cellType, cellType.iEExtensions) + w.WriteBit(cellType.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellType.CellSize.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cellType.extensions.Present() { + if err := cellType.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellType = CellType{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceNotifyItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceNotifyItem.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&cellType.CellSize).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellType, cellType, &cellType.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cellType.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowNotify != nil) - w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowReleased != nil) - w.WriteBit(false) - if pDUSessionResourceNotifyTransfer.QosFlowNotify != nil { - if err := pDUSessionResourceNotifyTransfer.QosFlowNotify.MarshalPER(w, enc); err != nil { +var extIEsCellType []ap.IESpec[ProtocolIEID, CellType] + +func (cellType *CellType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellType.CellSize.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCellType, cellType, cellType.iEExtensions) + return notComprehended +} + +func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria.iEExtensions) + w.WriteBit(clockQualityAcceptanceCriteria.extensions.Present()) + w.WriteBit(clockQualityAcceptanceCriteria.SynchronisationState != nil) + w.WriteBit(clockQualityAcceptanceCriteria.TraceabletoUTC != nil) + w.WriteBit(clockQualityAcceptanceCriteria.TraceabletoGNSS != nil) + w.WriteBit(clockQualityAcceptanceCriteria.ClockFrequencyStability != nil) + w.WriteBit(clockQualityAcceptanceCriteria.ClockAccuracy != nil) + w.WriteBit(clockQualityAcceptanceCriteria.ParentTImeSource != nil) + w.WriteBit(len(ext) > 0) + if clockQualityAcceptanceCriteria.SynchronisationState != nil { + if err := (*clockQualityAcceptanceCriteria.SynchronisationState).MarshalPER(w, enc); err != nil { return err } } - if pDUSessionResourceNotifyTransfer.QosFlowReleased != nil { - if err := pDUSessionResourceNotifyTransfer.QosFlowReleased.MarshalPER(w, enc); err != nil { + if clockQualityAcceptanceCriteria.TraceabletoUTC != nil { + if err := (*clockQualityAcceptanceCriteria.TraceabletoUTC).MarshalPER(w, enc); err != nil { + return err + } + } + if clockQualityAcceptanceCriteria.TraceabletoGNSS != nil { + if err := (*clockQualityAcceptanceCriteria.TraceabletoGNSS).MarshalPER(w, enc); err != nil { + return err + } + } + if clockQualityAcceptanceCriteria.ClockFrequencyStability != nil { + if err := (*clockQualityAcceptanceCriteria.ClockFrequencyStability).MarshalPER(w, enc); err != nil { + return err + } + } + if clockQualityAcceptanceCriteria.ClockAccuracy != nil { + if err := (*clockQualityAcceptanceCriteria.ClockAccuracy).MarshalPER(w, enc); err != nil { + return err + } + } + if clockQualityAcceptanceCriteria.ParentTImeSource != nil { + if err := (*clockQualityAcceptanceCriteria.ParentTImeSource).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if clockQualityAcceptanceCriteria.extensions.Present() { + if err := clockQualityAcceptanceCriteria.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *clockQualityAcceptanceCriteria = ClockQualityAcceptanceCriteria{} extBit, err := r.ReadBit() if err != nil { return err } - p_QosFlowNotify, err := r.ReadBit() + p_SynchronisationState, err := r.ReadBit() if err != nil { return err } - p_QosFlowReleased, err := r.ReadBit() + p_TraceabletoUTC, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_TraceabletoGNSS, err := r.ReadBit() if err != nil { return err } - if p_QosFlowNotify { - if err := (&pDUSessionResourceNotifyTransfer.QosFlowNotify).UnmarshalPER(r, enc); err != nil { + p_ClockFrequencyStability, err := r.ReadBit() + if err != nil { + return err + } + p_ClockAccuracy, err := r.ReadBit() + if err != nil { + return err + } + p_ParentTImeSource, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_SynchronisationState { + var v ClockQualityAcceptanceCriteriaSynchronisationState + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + clockQualityAcceptanceCriteria.SynchronisationState = &v } - if p_QosFlowReleased { - if err := (&pDUSessionResourceNotifyTransfer.QosFlowReleased).UnmarshalPER(r, enc); err != nil { + if p_TraceabletoUTC { + var v ClockQualityAcceptanceCriteriaTraceabletoUTC + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + clockQualityAcceptanceCriteria.TraceabletoUTC = &v } - if p_f2 { - var v ieExtensions + if p_TraceabletoGNSS { + var v ClockQualityAcceptanceCriteriaTraceabletoGNSS if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + clockQualityAcceptanceCriteria.TraceabletoGNSS = &v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_ClockFrequencyStability { + var v ClockQualityAcceptanceCriteriaClockFrequencyStability + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + clockQualityAcceptanceCriteria.ClockFrequencyStability = &v + } + if p_ClockAccuracy { + var v ClockQualityAcceptanceCriteriaClockAccuracy + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + clockQualityAcceptanceCriteria.ClockAccuracy = &v + } + if p_ParentTImeSource { + var v ClockQualityAcceptanceCriteriaParentTImeSource + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + clockQualityAcceptanceCriteria.ParentTImeSource = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, &clockQualityAcceptanceCriteria.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := clockQualityAcceptanceCriteria.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } -func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceReleaseCommandTransfer.Cause.MarshalPER(w, enc); err != nil { - return err +var extIEsClockQualityAcceptanceCriteria []ap.IESpec[ProtocolIEID, ClockQualityAcceptanceCriteria] + +func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if clockQualityAcceptanceCriteria.TraceabletoUTC != nil && clockQualityAcceptanceCriteria.TraceabletoUTC.Diagnose(d) { + notComprehended = true } - return nil + if clockQualityAcceptanceCriteria.TraceabletoGNSS != nil && clockQualityAcceptanceCriteria.TraceabletoGNSS.Diagnose(d) { + notComprehended = true + } + if clockQualityAcceptanceCriteria.ClockAccuracy != nil && clockQualityAcceptanceCriteria.ClockAccuracy.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria.iEExtensions) + return notComprehended } -func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (clockQualityAcceptanceCriteriaTraceabletoGNSS ClockQualityAcceptanceCriteriaTraceabletoGNSS) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumClockQualityAcceptanceCriteriaTraceabletoGNSS.Encode(w, enc, clockQualityAcceptanceCriteriaTraceabletoGNSS) +} + +func (clockQualityAcceptanceCriteriaTraceabletoGNSS *ClockQualityAcceptanceCriteriaTraceabletoGNSS) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumClockQualityAcceptanceCriteriaTraceabletoGNSS.Decode(r, enc) if err != nil { return err } - p_f1, err := r.ReadBit() + *clockQualityAcceptanceCriteriaTraceabletoGNSS = v + return nil +} + +func (clockQualityAcceptanceCriteriaTraceabletoGNSS ClockQualityAcceptanceCriteriaTraceabletoGNSS) Name() string { + return enumClockQualityAcceptanceCriteriaTraceabletoGNSS.Name(clockQualityAcceptanceCriteriaTraceabletoGNSS) +} + +func (clockQualityAcceptanceCriteriaTraceabletoGNSS ClockQualityAcceptanceCriteriaTraceabletoGNSS) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumClockQualityAcceptanceCriteriaTraceabletoGNSS.Known(clockQualityAcceptanceCriteriaTraceabletoGNSS) +} + +func (clockQualityAcceptanceCriteriaTraceabletoUTC ClockQualityAcceptanceCriteriaTraceabletoUTC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumClockQualityAcceptanceCriteriaTraceabletoUTC.Encode(w, enc, clockQualityAcceptanceCriteriaTraceabletoUTC) +} + +func (clockQualityAcceptanceCriteriaTraceabletoUTC *ClockQualityAcceptanceCriteriaTraceabletoUTC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumClockQualityAcceptanceCriteriaTraceabletoUTC.Decode(r, enc) if err != nil { return err } - if err := (&pDUSessionResourceReleaseCommandTransfer.Cause).UnmarshalPER(r, enc); err != nil { + *clockQualityAcceptanceCriteriaTraceabletoUTC = v + return nil +} + +func (clockQualityAcceptanceCriteriaTraceabletoUTC ClockQualityAcceptanceCriteriaTraceabletoUTC) Name() string { + return enumClockQualityAcceptanceCriteriaTraceabletoUTC.Name(clockQualityAcceptanceCriteriaTraceabletoUTC) +} + +func (clockQualityAcceptanceCriteriaTraceabletoUTC ClockQualityAcceptanceCriteriaTraceabletoUTC) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumClockQualityAcceptanceCriteriaTraceabletoUTC.Known(clockQualityAcceptanceCriteriaTraceabletoUTC) +} + +func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, clockQualityAcceptanceIndication.iEExtensions) + w.WriteBit(clockQualityAcceptanceIndication.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := clockQualityAcceptanceIndication.ClockQualityAcceptanceCriteria.MarshalPER(w, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if clockQualityAcceptanceIndication.extensions.Present() { + if err := clockQualityAcceptanceIndication.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - return nil -} - -func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *clockQualityAcceptanceIndication = ClockQualityAcceptanceIndication{} extBit, err := r.ReadBit() if err != nil { return err } - p_f0, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if p_f0 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&clockQualityAcceptanceIndication.ClockQualityAcceptanceCriteria).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, &clockQualityAcceptanceIndication.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := clockQualityAcceptanceIndication.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceReleasedItemNot.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceReleasedItemNot.Transfer.MarshalPER(w, enc); err != nil { - return err +var extIEsClockQualityAcceptanceIndication []ap.IESpec[ProtocolIEID, ClockQualityAcceptanceIndication] + +func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if clockQualityAcceptanceIndication.ClockQualityAcceptanceCriteria.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, clockQualityAcceptanceIndication.iEExtensions) + return notComprehended } -func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err +func (clockQualityDetailLevel *ClockQualityDetailLevel) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{clockQualityDetailLevel.ClockQualityMetrics != nil, clockQualityDetailLevel.ClockQualityAcceptanceIndication != nil, clockQualityDetailLevel.ChoiceExtension != nil} { + if ok { + set++ + } } - p_f2, err := r.ReadBit() - if err != nil { - return err + if set > 1 { + return per.ErrChoice } - if err := (&pDUSessionResourceReleasedItemNot.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err + switch { + case clockQualityDetailLevel.ClockQualityMetrics != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*clockQualityDetailLevel.ClockQualityMetrics).MarshalPER(w, enc); err != nil { + return err + } + case clockQualityDetailLevel.ClockQualityAcceptanceIndication != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*clockQualityDetailLevel.ClockQualityAcceptanceIndication).MarshalPER(w, enc); err != nil { + return err + } + case clockQualityDetailLevel.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, clockQualityDetailLevel.ChoiceExtension.Field()) + default: + return per.ErrEmpty } - if err := (&pDUSessionResourceReleasedItemNot.Transfer).UnmarshalPER(r, enc); err != nil { + return nil +} + +func (clockQualityDetailLevel *ClockQualityDetailLevel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *clockQualityDetailLevel = ClockQualityDetailLevel{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { return err } - if p_f2 { - var v ieExtensions + switch idx { + case 0: + var v per.Null if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + clockQualityDetailLevel.ClockQualityMetrics = &v + case 1: + var v ClockQualityAcceptanceIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + clockQualityDetailLevel.ClockQualityAcceptanceIndication = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + clockQualityDetailLevel.ChoiceExtension = &f } + default: + return per.ErrOverflow } return nil } -func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceReleasedItemPSAck.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +func (clockQualityDetailLevel *ClockQualityDetailLevel) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case clockQualityDetailLevel.ClockQualityMetrics != nil: + case clockQualityDetailLevel.ClockQualityAcceptanceIndication != nil: + return clockQualityDetailLevel.ClockQualityAcceptanceIndication.Diagnose(d) + case clockQualityDetailLevel.ChoiceExtension != nil: + d.Unknown(clockQualityDetailLevel.ChoiceExtension.ID, clockQualityDetailLevel.ChoiceExtension.Criticality) } - if err := pDUSessionResourceReleasedItemPSAck.Transfer.MarshalPER(w, enc); err != nil { + return false +} + +func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, clockQualityReportingControlInfo.iEExtensions) + w.WriteBit(clockQualityReportingControlInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := clockQualityReportingControlInfo.ClockQualityDetailLevel.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if clockQualityReportingControlInfo.extensions.Present() { + if err := clockQualityReportingControlInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *clockQualityReportingControlInfo = ClockQualityReportingControlInfo{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceReleasedItemPSAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceReleasedItemPSAck.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&clockQualityReportingControlInfo.ClockQualityDetailLevel).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, &clockQualityReportingControlInfo.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := clockQualityReportingControlInfo.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceReleasedItemPSFail.PDUSessionID.MarshalPER(w, enc); err != nil { +var extIEsClockQualityReportingControlInfo []ap.IESpec[ProtocolIEID, ClockQualityReportingControlInfo] + +func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if clockQualityReportingControlInfo.ClockQualityDetailLevel.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, clockQualityReportingControlInfo.iEExtensions) + return notComprehended +} + +func (commServiceType CommServiceType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCommServiceType.Encode(w, enc, commServiceType) +} + +func (commServiceType *CommServiceType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCommServiceType.Decode(r, enc) + if err != nil { return err } - if err := pDUSessionResourceReleasedItemPSFail.Transfer.MarshalPER(w, enc); err != nil { + *commServiceType = v + return nil +} + +func (commServiceType CommServiceType) Name() string { + return enumCommServiceType.Name(commServiceType) +} + +func (commServiceType CommServiceType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCommServiceType.Known(commServiceType) +} + +func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem.iEExtensions) + w.WriteBit(completedCellsInEAIEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := completedCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if completedCellsInEAIEUTRAItem.extensions.Present() { + if err := completedCellsInEAIEUTRAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *completedCellsInEAIEUTRAItem = CompletedCellsInEAIEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceReleasedItemPSFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceReleasedItemPSFail.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellsInEAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, &completedCellsInEAIEUTRAItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := completedCellsInEAIEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceReleasedItemRelRes.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCompletedCellsInEAIEUTRAItem []ap.IESpec[ProtocolIEID, CompletedCellsInEAIEUTRAItem] + +func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if completedCellsInEAIEUTRAItem.EUTRACGI.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceReleasedItemRelRes.Transfer.MarshalPER(w, enc); err != nil { - return err - } - return nil -} - -func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&pDUSessionResourceReleasedItemRelRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceReleasedItemRelRes.Transfer).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil + ap.DiagnoseExtensions(d, extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem.iEExtensions) + return notComprehended } -func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceSetupItemCxtReq.extensions.Present()) - w.WriteBit(pDUSessionResourceSetupItemCxtReq.NASPDU != nil) - w.WriteBit(pDUSessionResourceSetupItemCxtReq.iEExtensions != nil) - if err := pDUSessionResourceSetupItemCxtReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if pDUSessionResourceSetupItemCxtReq.NASPDU != nil { - if err := (*pDUSessionResourceSetupItemCxtReq.NASPDU).MarshalPER(w, enc); err != nil { - return err - } - } - if err := pDUSessionResourceSetupItemCxtReq.SNSSAI.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceSetupItemCxtReq.Transfer.MarshalPER(w, enc); err != nil { +func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, completedCellsInEAINRItem.iEExtensions) + w.WriteBit(completedCellsInEAINRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := completedCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupItemCxtReq.iEExtensions != nil { - if err := (*pDUSessionResourceSetupItemCxtReq.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceSetupItemCxtReq.extensions.Present() { - if err := pDUSessionResourceSetupItemCxtReq.extensions.MarshalPER(w, enc); err != nil { + if completedCellsInEAINRItem.extensions.Present() { + if err := completedCellsInEAINRItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *completedCellsInEAINRItem = CompletedCellsInEAINRItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSetupItemCxtReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if p_NASPDU { - var v NASPDU - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceSetupItemCxtReq.NASPDU = &v - } - if err := (&pDUSessionResourceSetupItemCxtReq.SNSSAI).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSetupItemCxtReq.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellsInEAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, &completedCellsInEAINRItem.iEExtensions); err != nil { return err } - pDUSessionResourceSetupItemCxtReq.iEExtensions = &v } if extBit { - if err := pDUSessionResourceSetupItemCxtReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := completedCellsInEAINRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceSetupItemCxtRes.extensions.Present()) - w.WriteBit(pDUSessionResourceSetupItemCxtRes.iEExtensions != nil) - if err := pDUSessionResourceSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCompletedCellsInEAINRItem []ap.IESpec[ProtocolIEID, CompletedCellsInEAINRItem] + +func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if completedCellsInEAINRItem.NRCGI.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, completedCellsInEAINRItem.iEExtensions) + return notComprehended +} + +func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem.iEExtensions) + w.WriteBit(completedCellsInTAIEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := completedCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupItemCxtRes.iEExtensions != nil { - if err := (*pDUSessionResourceSetupItemCxtRes.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceSetupItemCxtRes.extensions.Present() { - if err := pDUSessionResourceSetupItemCxtRes.extensions.MarshalPER(w, enc); err != nil { + if completedCellsInTAIEUTRAItem.extensions.Present() { + if err := completedCellsInTAIEUTRAItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *completedCellsInTAIEUTRAItem = CompletedCellsInTAIEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -5679,53 +6638,55 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Unma if err != nil { return err } - if err := (&pDUSessionResourceSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellsInTAIEUTRAItem.EUTRACGI).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, &completedCellsInTAIEUTRAItem.iEExtensions); err != nil { return err } - pDUSessionResourceSetupItemCxtRes.iEExtensions = &v } if extBit { - if err := pDUSessionResourceSetupItemCxtRes.extensions.UnmarshalPER(r, enc); err != nil { + if err := completedCellsInTAIEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceSetupItemHOReq.extensions.Present()) - w.WriteBit(pDUSessionResourceSetupItemHOReq.iEExtensions != nil) - if err := pDUSessionResourceSetupItemHOReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceSetupItemHOReq.SNSSAI.MarshalPER(w, enc); err != nil { - return err +var extIEsCompletedCellsInTAIEUTRAItem []ap.IESpec[ProtocolIEID, CompletedCellsInTAIEUTRAItem] + +func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if completedCellsInTAIEUTRAItem.EUTRACGI.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceSetupItemHOReq.Transfer.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem.iEExtensions) + return notComprehended +} + +func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, completedCellsInTAINRItem.iEExtensions) + w.WriteBit(completedCellsInTAINRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := completedCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupItemHOReq.iEExtensions != nil { - if err := (*pDUSessionResourceSetupItemHOReq.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceSetupItemHOReq.extensions.Present() { - if err := pDUSessionResourceSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { + if completedCellsInTAINRItem.extensions.Present() { + if err := completedCellsInTAINRItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *completedCellsInTAINRItem = CompletedCellsInTAINRItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -5734,67 +6695,66 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Unmars if err != nil { return err } - if err := (&pDUSessionResourceSetupItemHOReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSetupItemHOReq.SNSSAI).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSetupItemHOReq.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellsInTAINRItem.NRCGI).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, &completedCellsInTAINRItem.iEExtensions); err != nil { return err } - pDUSessionResourceSetupItemHOReq.iEExtensions = &v } if extBit { - if err := pDUSessionResourceSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := completedCellsInTAINRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceSetupItemSUReq.extensions.Present()) - w.WriteBit(pDUSessionResourceSetupItemSUReq.NASPDU != nil) - w.WriteBit(pDUSessionResourceSetupItemSUReq.iEExtensions != nil) - if err := pDUSessionResourceSetupItemSUReq.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCompletedCellsInTAINRItem []ap.IESpec[ProtocolIEID, CompletedCellsInTAINRItem] + +func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if completedCellsInTAINRItem.NRCGI.Diagnose(d) { + notComprehended = true } - if pDUSessionResourceSetupItemSUReq.NASPDU != nil { - if err := (*pDUSessionResourceSetupItemSUReq.NASPDU).MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, completedCellsInTAINRItem.iEExtensions) + return notComprehended +} + +func (compositeAvailableCapacity *CompositeAvailableCapacity) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCompositeAvailableCapacity, compositeAvailableCapacity, compositeAvailableCapacity.iEExtensions) + w.WriteBit(compositeAvailableCapacity.extensions.Present()) + w.WriteBit(compositeAvailableCapacity.CellCapacityClassValue != nil) + w.WriteBit(len(ext) > 0) + if compositeAvailableCapacity.CellCapacityClassValue != nil { + if err := (*compositeAvailableCapacity.CellCapacityClassValue).MarshalPER(w, enc); err != nil { return err } } - if err := pDUSessionResourceSetupItemSUReq.SNSSAI.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceSetupItemSUReq.Transfer.MarshalPER(w, enc); err != nil { + if err := compositeAvailableCapacity.CapacityValue.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupItemSUReq.iEExtensions != nil { - if err := (*pDUSessionResourceSetupItemSUReq.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceSetupItemSUReq.extensions.Present() { - if err := pDUSessionResourceSetupItemSUReq.extensions.MarshalPER(w, enc); err != nil { + if compositeAvailableCapacity.extensions.Present() { + if err := compositeAvailableCapacity.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (compositeAvailableCapacity *CompositeAvailableCapacity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *compositeAvailableCapacity = CompositeAvailableCapacity{} extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() + p_CellCapacityClassValue, err := r.ReadBit() if err != nil { return err } @@ -5802,141 +6762,204 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Unmars if err != nil { return err } - if err := (&pDUSessionResourceSetupItemSUReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err - } - if p_NASPDU { - var v NASPDU + if p_CellCapacityClassValue { + var v CompositeAvailableCapacityCellCapacityClassValue if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pDUSessionResourceSetupItemSUReq.NASPDU = &v + compositeAvailableCapacity.CellCapacityClassValue = &v } - if err := (&pDUSessionResourceSetupItemSUReq.SNSSAI).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&pDUSessionResourceSetupItemSUReq.Transfer).UnmarshalPER(r, enc); err != nil { + if err := (&compositeAvailableCapacity.CapacityValue).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompositeAvailableCapacity, compositeAvailableCapacity, &compositeAvailableCapacity.iEExtensions); err != nil { return err } - pDUSessionResourceSetupItemSUReq.iEExtensions = &v } if extBit { - if err := pDUSessionResourceSetupItemSUReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := compositeAvailableCapacity.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceSetupItemSURes.extensions.Present()) - w.WriteBit(pDUSessionResourceSetupItemSURes.iEExtensions != nil) - if err := pDUSessionResourceSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { - return err +var extIEsCompositeAvailableCapacity []ap.IESpec[ProtocolIEID, CompositeAvailableCapacity] + +func (compositeAvailableCapacity *CompositeAvailableCapacity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if compositeAvailableCapacity.CellCapacityClassValue != nil && compositeAvailableCapacity.CellCapacityClassValue.Diagnose(d) { + notComprehended = true } - if err := pDUSessionResourceSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCompositeAvailableCapacity, compositeAvailableCapacity, compositeAvailableCapacity.iEExtensions) + return notComprehended +} + +func (concurrentWarningMessageInd ConcurrentWarningMessageInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumConcurrentWarningMessageInd.Encode(w, enc, concurrentWarningMessageInd) +} + +func (concurrentWarningMessageInd *ConcurrentWarningMessageInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumConcurrentWarningMessageInd.Decode(r, enc) + if err != nil { return err } - if pDUSessionResourceSetupItemSURes.iEExtensions != nil { - if err := (*pDUSessionResourceSetupItemSURes.iEExtensions).MarshalPER(w, enc); err != nil { - return err - } - } - if pDUSessionResourceSetupItemSURes.extensions.Present() { - if err := pDUSessionResourceSetupItemSURes.extensions.MarshalPER(w, enc); err != nil { - return err - } - } + *concurrentWarningMessageInd = v return nil } -func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (concurrentWarningMessageInd ConcurrentWarningMessageInd) Name() string { + return enumConcurrentWarningMessageInd.Name(concurrentWarningMessageInd) +} + +func (concurrentWarningMessageInd ConcurrentWarningMessageInd) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumConcurrentWarningMessageInd.Known(concurrentWarningMessageInd) +} + +func (confidentialityProtectionIndication ConfidentialityProtectionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumConfidentialityProtectionIndication.Encode(w, enc, confidentialityProtectionIndication) +} + +func (confidentialityProtectionIndication *ConfidentialityProtectionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumConfidentialityProtectionIndication.Decode(r, enc) if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + *confidentialityProtectionIndication = v + return nil +} + +func (confidentialityProtectionIndication ConfidentialityProtectionIndication) Name() string { + return enumConfidentialityProtectionIndication.Name(confidentialityProtectionIndication) +} + +func (confidentialityProtectionIndication ConfidentialityProtectionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumConfidentialityProtectionIndication.Known(confidentialityProtectionIndication) +} + +func (confidentialityProtectionResult ConfidentialityProtectionResult) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumConfidentialityProtectionResult.Encode(w, enc, confidentialityProtectionResult) +} + +func (confidentialityProtectionResult *ConfidentialityProtectionResult) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumConfidentialityProtectionResult.Decode(r, enc) if err != nil { return err } - if err := (&pDUSessionResourceSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + *confidentialityProtectionResult = v + return nil +} + +func (confidentialityProtectionResult ConfidentialityProtectionResult) Name() string { + return enumConfidentialityProtectionResult.Name(confidentialityProtectionResult) +} + +func (confidentialityProtectionResult ConfidentialityProtectionResult) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumConfidentialityProtectionResult.Known(confidentialityProtectionResult) +} + +func (configuredTACIndication ConfiguredTACIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumConfiguredTACIndication.Encode(w, enc, configuredTACIndication) +} + +func (configuredTACIndication *ConfiguredTACIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumConfiguredTACIndication.Decode(r, enc) + if err != nil { return err } - if err := (&pDUSessionResourceSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { + *configuredTACIndication = v + return nil +} + +func (configuredTACIndication ConfiguredTACIndication) Name() string { + return enumConfiguredTACIndication.Name(configuredTACIndication) +} + +func (configuredTACIndication ConfiguredTACIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumConfiguredTACIndication.Known(configuredTACIndication) +} + +func (congestionInformationRequest CongestionInformationRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCongestionInformationRequest.Encode(w, enc, congestionInformationRequest) +} + +func (congestionInformationRequest *CongestionInformationRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCongestionInformationRequest.Decode(r, enc) + if err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceSetupItemSURes.iEExtensions = &v - } - if extBit { - if err := pDUSessionResourceSetupItemSURes.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } + *congestionInformationRequest = v return nil } -func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pDUSessionResourceSetupResponseTransferExtIEs, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions) - w.WriteBit(pDUSessionResourceSetupResponseTransfer.extensions.Present()) - w.WriteBit(pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) - w.WriteBit(pDUSessionResourceSetupResponseTransfer.SecurityResult != nil) - w.WriteBit(pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil) +func (congestionInformationRequest CongestionInformationRequest) Name() string { + return enumCongestionInformationRequest.Name(congestionInformationRequest) +} + +func (congestionInformationRequest CongestionInformationRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCongestionInformationRequest.Known(congestionInformationRequest) +} + +func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive.iEExtensions) + w.WriteBit(coreNetworkAssistanceInformationForInactive.extensions.Present()) + w.WriteBit(coreNetworkAssistanceInformationForInactive.UESpecificDRX != nil) + w.WriteBit(coreNetworkAssistanceInformationForInactive.MICOModeIndication != nil) + w.WriteBit(coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour != nil) w.WriteBit(len(ext) > 0) - if err := pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + if err := coreNetworkAssistanceInformationForInactive.UEIdentityIndexValue.MarshalPER(w, enc); err != nil { return err } - if pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { - if err := pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + if coreNetworkAssistanceInformationForInactive.UESpecificDRX != nil { + if err := (*coreNetworkAssistanceInformationForInactive.UESpecificDRX).MarshalPER(w, enc); err != nil { return err } } - if pDUSessionResourceSetupResponseTransfer.SecurityResult != nil { - if err := (*pDUSessionResourceSetupResponseTransfer.SecurityResult).MarshalPER(w, enc); err != nil { + if err := coreNetworkAssistanceInformationForInactive.PeriodicRegistrationUpdateTimer.MarshalPER(w, enc); err != nil { + return err + } + if coreNetworkAssistanceInformationForInactive.MICOModeIndication != nil { + if err := (*coreNetworkAssistanceInformationForInactive.MICOModeIndication).MarshalPER(w, enc); err != nil { return err } } - if pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil { - if err := pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { + if err := coreNetworkAssistanceInformationForInactive.TAIListForInactive.MarshalPER(w, enc); err != nil { + return err + } + if coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour != nil { + if err := (*coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceSetupResponseTransfer.extensions.Present() { - if err := pDUSessionResourceSetupResponseTransfer.extensions.MarshalPER(w, enc); err != nil { + if coreNetworkAssistanceInformationForInactive.extensions.Present() { + if err := coreNetworkAssistanceInformationForInactive.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *coreNetworkAssistanceInformationForInactive = CoreNetworkAssistanceInformationForInactive{} extBit, err := r.ReadBit() if err != nil { return err } - p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() + p_UESpecificDRX, err := r.ReadBit() if err != nil { return err } - p_SecurityResult, err := r.ReadBit() + p_MICOModeIndication, err := r.ReadBit() if err != nil { return err } - p_QosFlowFailedToSetup, err := r.ReadBit() + p_ExpectedUEBehaviour, err := r.ReadBit() if err != nil { return err } @@ -5944,357 +6967,517 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr if err != nil { return err } - if err := (&pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&coreNetworkAssistanceInformationForInactive.UEIdentityIndexValue).UnmarshalPER(r, enc); err != nil { return err } - if p_AdditionalDLQosFlowPerTNLInformation { - if err := (&pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + if p_UESpecificDRX { + var v PagingDRX + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + coreNetworkAssistanceInformationForInactive.UESpecificDRX = &v } - if p_SecurityResult { - var v SecurityResult + if err := (&coreNetworkAssistanceInformationForInactive.PeriodicRegistrationUpdateTimer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MICOModeIndication { + var v MICOModeIndication if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pDUSessionResourceSetupResponseTransfer.SecurityResult = &v + coreNetworkAssistanceInformationForInactive.MICOModeIndication = &v } - if p_QosFlowFailedToSetup { - if err := (&pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { + if err := (&coreNetworkAssistanceInformationForInactive.TAIListForInactive).UnmarshalPER(r, enc); err != nil { + return err + } + if p_ExpectedUEBehaviour { + var v ExpectedUEBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour = &v } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, pDUSessionResourceSetupResponseTransferExtIEs, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, &coreNetworkAssistanceInformationForInactive.iEExtensions); err != nil { return err } } if extBit { - if err := pDUSessionResourceSetupResponseTransfer.extensions.UnmarshalPER(r, enc); err != nil { + if err := coreNetworkAssistanceInformationForInactive.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil) - w.WriteBit(false) - if err := pDUSessionResourceSetupUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { - return err - } - if pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil { - if err := (*pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { - return err - } - } - return nil +var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID, CoreNetworkAssistanceInformationForInactive]{ + { + ID: IDEUTRAPagingeDRXInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v EUTRAPagingeDRXInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EUTRAPagingeDRXInformation = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.EUTRAPagingeDRXInformation == nil { + return nil, false + } + return x.EUTRAPagingeDRXInformation, true + }, + }, + { + ID: IDExtendedUEIdentityIndexValue, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v ExtendedUEIdentityIndexValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedUEIdentityIndexValue = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.ExtendedUEIdentityIndexValue == nil { + return nil, false + } + return x.ExtendedUEIdentityIndexValue, true + }, + }, + { + ID: IDUERadioCapabilityForPaging, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v UERadioCapabilityForPaging + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UERadioCapabilityForPaging = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.UERadioCapabilityForPaging == nil { + return nil, false + } + return x.UERadioCapabilityForPaging, true + }, + }, + { + ID: IDMicoAllPLMN, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v MicoAllPLMN + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MicoAllPLMN = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.MicoAllPLMN == nil { + return nil, false + } + return x.MicoAllPLMN, true + }, + }, + { + ID: IDNRPagingeDRXInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v NRPagingeDRXInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NRPagingeDRXInformation = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.NRPagingeDRXInformation == nil { + return nil, false + } + return x.NRPagingeDRXInformation, true + }, + }, + { + ID: IDPagingCauseIndicationForVoiceService, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v PagingCauseIndicationForVoiceService + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PagingCauseIndicationForVoiceService = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.PagingCauseIndicationForVoiceService == nil { + return nil, false + } + return x.PagingCauseIndicationForVoiceService, true + }, + }, + { + ID: IDPEIPSassistanceInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v PEIPSassistanceInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PEIPSassistanceInformation = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.PEIPSassistanceInformation == nil { + return nil, false + } + return x.PEIPSassistanceInformation, true + }, + }, + { + ID: IDHashedUEIdentityIndexValue, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v HashedUEIdentityIndexValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.HashedUEIdentityIndexValue = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.HashedUEIdentityIndexValue == nil { + return nil, false + } + return x.HashedUEIdentityIndexValue, true + }, + }, + { + ID: IDCNMTCommunicationHandling, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v CNMTCommunicationHandling + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNMTCommunicationHandling = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.CNMTCommunicationHandling == nil { + return nil, false + } + return x.CNMTCommunicationHandling, true + }, + }, + { + ID: IDLPWUSPSAssistanceInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v LPWUSPSAssistanceInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LPWUSPSAssistanceInformation = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.LPWUSPSAssistanceInformation == nil { + return nil, false + } + return x.LPWUSPSAssistanceInformation, true + }, + }, + { + ID: IDFurtherExtendedUEIdentityIndexValue, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v FurtherExtendedUEIdentityIndexValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FurtherExtendedUEIdentityIndexValue = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.FurtherExtendedUEIdentityIndexValue == nil { + return nil, false + } + return x.FurtherExtendedUEIdentityIndexValue, true + }, + }, + { + ID: IDLPWUSDisableIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { + var v LPWUSDisableIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LPWUSDisableIndication = &v + return nil + }, + Encode: func(x *CoreNetworkAssistanceInformationForInactive) (per.Marshaler, bool) { + if x.LPWUSDisableIndication == nil { + return nil, false + } + return x.LPWUSDisableIndication, true + }, + }, } -func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err +func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if coreNetworkAssistanceInformationForInactive.UEIdentityIndexValue.Diagnose(d) { + notComprehended = true } - p_CriticalityDiagnostics, err := r.ReadBit() - if err != nil { - return err + if coreNetworkAssistanceInformationForInactive.UESpecificDRX != nil && coreNetworkAssistanceInformationForInactive.UESpecificDRX.Diagnose(d) { + notComprehended = true } - p_f2, err := r.ReadBit() - if err != nil { - return err + if coreNetworkAssistanceInformationForInactive.MICOModeIndication != nil && coreNetworkAssistanceInformationForInactive.MICOModeIndication.Diagnose(d) { + notComprehended = true } - if err := (&pDUSessionResourceSetupUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { - return err + if coreNetworkAssistanceInformationForInactive.TAIListForInactive.Diagnose(d) { + notComprehended = true } - if p_CriticalityDiagnostics { - var v CriticalityDiagnostics - if err := (&v).UnmarshalPER(r, enc); err != nil { + if coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour != nil && coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive.iEExtensions) + return notComprehended +} + +func (criticalityDiagnostics *CriticalityDiagnostics) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + w.WriteBit(criticalityDiagnostics.extensions.Present()) + w.WriteBit(criticalityDiagnostics.ProcedureCode != nil) + w.WriteBit(criticalityDiagnostics.TriggeringMessage != nil) + w.WriteBit(criticalityDiagnostics.ProcedureCriticality != nil) + w.WriteBit(criticalityDiagnostics.IEsCriticalityDiagnostics != nil) + w.WriteBit(len(ext) > 0) + if criticalityDiagnostics.ProcedureCode != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}, int64((*criticalityDiagnostics.ProcedureCode))); err != nil { return err } - pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics = &v } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if criticalityDiagnostics.TriggeringMessage != nil { + if err := (*criticalityDiagnostics.TriggeringMessage).MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if criticalityDiagnostics.ProcedureCriticality != nil { + if err := per.EncodeEnumerated(w, enc, 3, false, int64((*criticalityDiagnostics.ProcedureCriticality))); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - -func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceSwitchedItem.extensions.Present()) - w.WriteBit(pDUSessionResourceSwitchedItem.iEExtensions != nil) - if err := pDUSessionResourceSwitchedItem.PDUSessionID.MarshalPER(w, enc); err != nil { - return err } - if err := pDUSessionResourceSwitchedItem.Transfer.MarshalPER(w, enc); err != nil { - return err + if criticalityDiagnostics.IEsCriticalityDiagnostics != nil { + if err := criticalityDiagnostics.IEsCriticalityDiagnostics.MarshalPER(w, enc); err != nil { + return err + } } - if pDUSessionResourceSwitchedItem.iEExtensions != nil { - if err := (*pDUSessionResourceSwitchedItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pDUSessionResourceSwitchedItem.extensions.Present() { - if err := pDUSessionResourceSwitchedItem.extensions.MarshalPER(w, enc); err != nil { + if criticalityDiagnostics.extensions.Present() { + if err := criticalityDiagnostics.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (criticalityDiagnostics *CriticalityDiagnostics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *criticalityDiagnostics = CriticalityDiagnostics{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_ProcedureCode, err := r.ReadBit() if err != nil { return err } - if err := (&pDUSessionResourceSwitchedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + p_TriggeringMessage, err := r.ReadBit() + if err != nil { return err } - if err := (&pDUSessionResourceSwitchedItem.Transfer).UnmarshalPER(r, enc); err != nil { + p_ProcedureCriticality, err := r.ReadBit() + if err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pDUSessionResourceSwitchedItem.iEExtensions = &v - } - if extBit { - if err := pDUSessionResourceSwitchedItem.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil -} - -func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(pDUSessionResourceToBeSwitchedDLItem.extensions.Present()) - w.WriteBit(pDUSessionResourceToBeSwitchedDLItem.iEExtensions != nil) - if err := pDUSessionResourceToBeSwitchedDLItem.PDUSessionID.MarshalPER(w, enc); err != nil { + p_IEsCriticalityDiagnostics, err := r.ReadBit() + if err != nil { return err } - if err := pDUSessionResourceToBeSwitchedDLItem.Transfer.MarshalPER(w, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if pDUSessionResourceToBeSwitchedDLItem.iEExtensions != nil { - if err := (*pDUSessionResourceToBeSwitchedDLItem.iEExtensions).MarshalPER(w, enc); err != nil { + if p_ProcedureCode { + var v ProcedureCode + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}) + if err != nil { return err } + v = ProcedureCode(n0) + criticalityDiagnostics.ProcedureCode = &v } - if pDUSessionResourceToBeSwitchedDLItem.extensions.Present() { - if err := pDUSessionResourceToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { + if p_TriggeringMessage { + var v TriggeringMessage + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + criticalityDiagnostics.TriggeringMessage = &v } - return nil -} - -func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err - } - if err := (&pDUSessionResourceToBeSwitchedDLItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { - return err + if p_ProcedureCriticality { + var v Criticality + e2, err := per.DecodeEnumerated(r, enc, 3, false) + if err != nil { + return err + } + v = Criticality(e2) + criticalityDiagnostics.ProcedureCriticality = &v } - if err := (&pDUSessionResourceToBeSwitchedDLItem.Transfer).UnmarshalPER(r, enc); err != nil { - return err + if p_IEsCriticalityDiagnostics { + if err := (&criticalityDiagnostics.IEsCriticalityDiagnostics).UnmarshalPER(r, enc); err != nil { + return err + } } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions); err != nil { return err } - pDUSessionResourceToBeSwitchedDLItem.iEExtensions = &v } if extBit { - if err := pDUSessionResourceToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := criticalityDiagnostics.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceToReleaseItemHOCmd.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceToReleaseItemHOCmd.Transfer.MarshalPER(w, enc); err != nil { - return err +var extIEsCriticalityDiagnostics []ap.IESpec[ProtocolIEID, CriticalityDiagnostics] + +func (criticalityDiagnostics *CriticalityDiagnostics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if criticalityDiagnostics.IEsCriticalityDiagnostics.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + return notComprehended } -func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + w.WriteBit(criticalityDiagnosticsIEItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { return err } - if err := (&pDUSessionResourceToReleaseItemHOCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(criticalityDiagnosticsIEItem.IEID)); err != nil { return err } - if err := (&pDUSessionResourceToReleaseItemHOCmd.Transfer).UnmarshalPER(r, enc); err != nil { + if err := criticalityDiagnosticsIEItem.TypeOfError.MarshalPER(w, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if criticalityDiagnosticsIEItem.extensions.Present() { + if err := criticalityDiagnosticsIEItem.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pDUSessionResourceToReleaseItemRelCmd.PDUSessionID.MarshalPER(w, enc); err != nil { - return err - } - if err := pDUSessionResourceToReleaseItemRelCmd.Transfer.MarshalPER(w, enc); err != nil { +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *criticalityDiagnosticsIEItem = CriticalityDiagnosticsIEItem{} + extBit, err := r.ReadBit() + if err != nil { return err } - return nil -} - -func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + e0, err := per.DecodeEnumerated(r, enc, 3, false) if err != nil { return err } - if err := (&pDUSessionResourceToReleaseItemRelCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + criticalityDiagnosticsIEItem.IECriticality = Criticality(e0) + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } - if err := (&pDUSessionResourceToReleaseItemRelCmd.Transfer).UnmarshalPER(r, enc); err != nil { + criticalityDiagnosticsIEItem.IEID = ProtocolIEID(n1) + if err := (&criticalityDiagnosticsIEItem.TypeOfError).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := criticalityDiagnosticsIEItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(packetErrorRate.extensions.Present()) - w.WriteBit(packetErrorRate.iEExtensions != nil) - if err := packetErrorRate.Scalar.MarshalPER(w, enc); err != nil { - return err +var extIEsCriticalityDiagnosticsIEItem []ap.IESpec[ProtocolIEID, CriticalityDiagnosticsIEItem] + +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if criticalityDiagnosticsIEItem.TypeOfError.Diagnose(d) { + notComprehended = true } - if err := packetErrorRate.Exponent.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + return notComprehended +} + +func (dAPSRequestInfo *DAPSRequestInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + w.WriteBit(dAPSRequestInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := dAPSRequestInfo.DAPSIndicator.MarshalPER(w, enc); err != nil { return err } - if packetErrorRate.iEExtensions != nil { - if err := (*packetErrorRate.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if packetErrorRate.extensions.Present() { - if err := packetErrorRate.extensions.MarshalPER(w, enc); err != nil { + if dAPSRequestInfo.extensions.Present() { + if err := dAPSRequestInfo.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (dAPSRequestInfo *DAPSRequestInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *dAPSRequestInfo = DAPSRequestInfo{} extBit, err := r.ReadBit() if err != nil { return err @@ -6303,253 +7486,288 @@ func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Enco if err != nil { return err } - if err := (&packetErrorRate.Scalar).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&packetErrorRate.Exponent).UnmarshalPER(r, enc); err != nil { + if err := (&dAPSRequestInfo.DAPSIndicator).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions); err != nil { return err } - packetErrorRate.iEExtensions = &v } if extBit { - if err := packetErrorRate.extensions.UnmarshalPER(r, enc); err != nil { + if err := dAPSRequestInfo.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := partiallyAllowedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { - return err +var extIEsDAPSRequestInfo []ap.IESpec[ProtocolIEID, DAPSRequestInfo] + +func (dAPSRequestInfo *DAPSRequestInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if dAPSRequestInfo.DAPSIndicator.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + return notComprehended } -func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (dAPSRequestInfoDAPSIndicator DAPSRequestInfoDAPSIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDAPSRequestInfoDAPSIndicator.Encode(w, enc, dAPSRequestInfoDAPSIndicator) +} + +func (dAPSRequestInfoDAPSIndicator *DAPSRequestInfoDAPSIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDAPSRequestInfoDAPSIndicator.Decode(r, enc) if err != nil { return err } - p_f1, err := r.ReadBit() + *dAPSRequestInfoDAPSIndicator = v + return nil +} + +func (dAPSRequestInfoDAPSIndicator DAPSRequestInfoDAPSIndicator) Name() string { + return enumDAPSRequestInfoDAPSIndicator.Name(dAPSRequestInfoDAPSIndicator) +} + +func (dAPSRequestInfoDAPSIndicator DAPSRequestInfoDAPSIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDAPSRequestInfoDAPSIndicator.Known(dAPSRequestInfoDAPSIndicator) +} + +func (dLForwarding DLForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDLForwarding.Encode(w, enc, dLForwarding) +} + +func (dLForwarding *DLForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDLForwarding.Decode(r, enc) if err != nil { return err } - if err := (&partiallyAllowedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + *dLForwarding = v + return nil +} + +func (dLForwarding DLForwarding) Name() string { + return enumDLForwarding.Name(dLForwarding) +} + +func (dLForwarding DLForwarding) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDLForwarding.Known(dLForwarding) +} + +func (dLNGUTNLInformationReused DLNGUTNLInformationReused) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDLNGUTNLInformationReused.Encode(w, enc, dLNGUTNLInformationReused) +} + +func (dLNGUTNLInformationReused *DLNGUTNLInformationReused) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDLNGUTNLInformationReused.Decode(r, enc) + if err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } + *dLNGUTNLInformationReused = v + return nil +} + +func (dLNGUTNLInformationReused DLNGUTNLInformationReused) Name() string { + return enumDLNGUTNLInformationReused.Name(dLNGUTNLInformationReused) +} + +func (dLNGUTNLInformationReused DLNGUTNLInformationReused) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDLNGUTNLInformationReused.Known(dLNGUTNLInformationReused) +} + +func (dLPDUSetInformationMarkingSupportIndication DLPDUSetInformationMarkingSupportIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDLPDUSetInformationMarkingSupportIndication.Encode(w, enc, dLPDUSetInformationMarkingSupportIndication) +} + +func (dLPDUSetInformationMarkingSupportIndication *DLPDUSetInformationMarkingSupportIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDLPDUSetInformationMarkingSupportIndication.Decode(r, enc) + if err != nil { + return err } + *dLPDUSetInformationMarkingSupportIndication = v return nil } -func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pathSwitchRequestAcknowledgeTransferExtIEs, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions) - w.WriteBit(pathSwitchRequestAcknowledgeTransfer.extensions.Present()) - w.WriteBit(pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil) - w.WriteBit(pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil) +func (dLPDUSetInformationMarkingSupportIndication DLPDUSetInformationMarkingSupportIndication) Name() string { + return enumDLPDUSetInformationMarkingSupportIndication.Name(dLPDUSetInformationMarkingSupportIndication) +} + +func (dLPDUSetInformationMarkingSupportIndication DLPDUSetInformationMarkingSupportIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDLPDUSetInformationMarkingSupportIndication.Known(dLPDUSetInformationMarkingSupportIndication) +} + +func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem.iEExtensions) + w.WriteBit(dRBsToQosFlowsMappingItem.extensions.Present()) w.WriteBit(len(ext) > 0) - if pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil { - if err := (*pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { - return err - } + if err := dRBsToQosFlowsMappingItem.DRBID.MarshalPER(w, enc); err != nil { + return err } - if pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil { - if err := (*pathSwitchRequestAcknowledgeTransfer.SecurityIndication).MarshalPER(w, enc); err != nil { - return err - } + if err := dRBsToQosFlowsMappingItem.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { + return err } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pathSwitchRequestAcknowledgeTransfer.extensions.Present() { - if err := pathSwitchRequestAcknowledgeTransfer.extensions.MarshalPER(w, enc); err != nil { + if dRBsToQosFlowsMappingItem.extensions.Present() { + if err := dRBsToQosFlowsMappingItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *dRBsToQosFlowsMappingItem = DRBsToQosFlowsMappingItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_ULNGUUPTNLInformation, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_SecurityIndication, err := r.ReadBit() - if err != nil { + if err := (&dRBsToQosFlowsMappingItem.DRBID).UnmarshalPER(r, enc); err != nil { return err } - p_iEExtensions, err := r.ReadBit() - if err != nil { + if err := (&dRBsToQosFlowsMappingItem.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { return err } - if p_ULNGUUPTNLInformation { - var v UPTransportLayerInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation = &v - } - if p_SecurityIndication { - var v SecurityIndication - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - pathSwitchRequestAcknowledgeTransfer.SecurityIndication = &v - } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, pathSwitchRequestAcknowledgeTransferExtIEs, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, &dRBsToQosFlowsMappingItem.iEExtensions); err != nil { return err } } if extBit { - if err := pathSwitchRequestAcknowledgeTransfer.extensions.UnmarshalPER(r, enc); err != nil { + if err := dRBsToQosFlowsMappingItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pathSwitchRequestSetupFailedTransfer.Cause.MarshalPER(w, enc); err != nil { - return err +var extIEsDRBsToQosFlowsMappingItem = []ap.IESpec[ProtocolIEID, DRBsToQosFlowsMappingItem]{ + { + ID: IDDAPSRequestInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *DRBsToQosFlowsMappingItem, r *per.Reader, enc per.Encoding) error { + var v DAPSRequestInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DAPSRequestInfo = &v + return nil + }, + Encode: func(x *DRBsToQosFlowsMappingItem) (per.Marshaler, bool) { + if x.DAPSRequestInfo == nil { + return nil, false + } + return x.DAPSRequestInfo, true + }, + }, +} + +func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if dRBsToQosFlowsMappingItem.DRBID.Diagnose(d) { + notComprehended = true } - return nil + if dRBsToQosFlowsMappingItem.AssociatedQosFlowList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem.iEExtensions) + return notComprehended } -func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (dataForwardingAccepted DataForwardingAccepted) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDataForwardingAccepted.Encode(w, enc, dataForwardingAccepted) +} + +func (dataForwardingAccepted *DataForwardingAccepted) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDataForwardingAccepted.Decode(r, enc) if err != nil { return err } - p_f1, err := r.ReadBit() + *dataForwardingAccepted = v + return nil +} + +func (dataForwardingAccepted DataForwardingAccepted) Name() string { + return enumDataForwardingAccepted.Name(dataForwardingAccepted) +} + +func (dataForwardingAccepted DataForwardingAccepted) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDataForwardingAccepted.Known(dataForwardingAccepted) +} + +func (dataForwardingNotPossible DataForwardingNotPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDataForwardingNotPossible.Encode(w, enc, dataForwardingNotPossible) +} + +func (dataForwardingNotPossible *DataForwardingNotPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDataForwardingNotPossible.Decode(r, enc) if err != nil { return err } - if err := (&pathSwitchRequestSetupFailedTransfer.Cause).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } + *dataForwardingNotPossible = v return nil } -func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(pathSwitchRequestTransferExtIEs, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions) - w.WriteBit(pathSwitchRequestTransfer.extensions.Present()) - w.WriteBit(pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil) - w.WriteBit(pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil) +func (dataForwardingNotPossible DataForwardingNotPossible) Name() string { + return enumDataForwardingNotPossible.Name(dataForwardingNotPossible) +} + +func (dataForwardingNotPossible DataForwardingNotPossible) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDataForwardingNotPossible.Known(dataForwardingNotPossible) +} + +func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, dataForwardingResponseDRBItem.iEExtensions) + w.WriteBit(dataForwardingResponseDRBItem.extensions.Present()) + w.WriteBit(dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil) + w.WriteBit(dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil) w.WriteBit(len(ext) > 0) - if err := pathSwitchRequestTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + if err := dataForwardingResponseDRBItem.DRBID.MarshalPER(w, enc); err != nil { return err } - if pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil { - if err := (*pathSwitchRequestTransfer.DLNGUTNLInformationReused).MarshalPER(w, enc); err != nil { + if dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil { + if err := (*dataForwardingResponseDRBItem.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { return err } } - if pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil { - if err := (*pathSwitchRequestTransfer.UserPlaneSecurityInformation).MarshalPER(w, enc); err != nil { + if dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil { + if err := (*dataForwardingResponseDRBItem.ULForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { return err } } - if err := pathSwitchRequestTransfer.QosFlowAccepted.MarshalPER(w, enc); err != nil { - return err - } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pathSwitchRequestTransfer.extensions.Present() { - if err := pathSwitchRequestTransfer.extensions.MarshalPER(w, enc); err != nil { + if dataForwardingResponseDRBItem.extensions.Present() { + if err := dataForwardingResponseDRBItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *dataForwardingResponseDRBItem = DataForwardingResponseDRBItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLNGUTNLInformationReused, err := r.ReadBit() + p_DLForwardingUPTNLInformation, err := r.ReadBit() if err != nil { return err } - p_UserPlaneSecurityInformation, err := r.ReadBit() + p_ULForwardingUPTNLInformation, err := r.ReadBit() if err != nil { return err } @@ -6557,113 +7775,78 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per. if err != nil { return err } - if err := (&pathSwitchRequestTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&dataForwardingResponseDRBItem.DRBID).UnmarshalPER(r, enc); err != nil { return err } - if p_DLNGUTNLInformationReused { - var v DLNGUTNLInformationReused + if p_DLForwardingUPTNLInformation { + var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pathSwitchRequestTransfer.DLNGUTNLInformationReused = &v + dataForwardingResponseDRBItem.DLForwardingUPTNLInformation = &v } - if p_UserPlaneSecurityInformation { - var v UserPlaneSecurityInformation + if p_ULForwardingUPTNLInformation { + var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - pathSwitchRequestTransfer.UserPlaneSecurityInformation = &v - } - if err := (&pathSwitchRequestTransfer.QosFlowAccepted).UnmarshalPER(r, enc); err != nil { - return err + dataForwardingResponseDRBItem.ULForwardingUPTNLInformation = &v } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, pathSwitchRequestTransferExtIEs, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, &dataForwardingResponseDRBItem.iEExtensions); err != nil { return err } } if extBit { - if err := pathSwitchRequestTransfer.extensions.UnmarshalPER(r, enc); err != nil { + if err := dataForwardingResponseDRBItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := pathSwitchRequestUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { - return err - } - return nil -} +var extIEsDataForwardingResponseDRBItem []ap.IESpec[ProtocolIEID, DataForwardingResponseDRBItem] -func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f1, err := r.ReadBit() - if err != nil { - return err +func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if dataForwardingResponseDRBItem.DRBID.Diagnose(d) { + notComprehended = true } - if err := (&pathSwitchRequestUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { - return err - } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v + if dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil && dataForwardingResponseDRBItem.DLForwardingUPTNLInformation.Diagnose(d) { + notComprehended = true } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } + if dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil && dataForwardingResponseDRBItem.ULForwardingUPTNLInformation.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, dataForwardingResponseDRBItem.iEExtensions) + return notComprehended } -func (qosFlowAcceptedItem *QosFlowAcceptedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowAcceptedItem.extensions.Present()) - w.WriteBit(qosFlowAcceptedItem.iEExtensions != nil) - if err := qosFlowAcceptedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { +func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, dataForwardingResponseERABListItem.iEExtensions) + w.WriteBit(dataForwardingResponseERABListItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := dataForwardingResponseERABListItem.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if err := dataForwardingResponseERABListItem.DLForwardingUPTNLInformation.MarshalPER(w, enc); err != nil { return err } - if qosFlowAcceptedItem.iEExtensions != nil { - if err := (*qosFlowAcceptedItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowAcceptedItem.extensions.Present() { - if err := qosFlowAcceptedItem.extensions.MarshalPER(w, enc); err != nil { + if dataForwardingResponseERABListItem.extensions.Present() { + if err := dataForwardingResponseERABListItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *dataForwardingResponseERABListItem = DataForwardingResponseERABListItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -6672,66 +7855,150 @@ func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc if err != nil { return err } - if err := (&qosFlowAcceptedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&dataForwardingResponseERABListItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&dataForwardingResponseERABListItem.DLForwardingUPTNLInformation).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, &dataForwardingResponseERABListItem.iEExtensions); err != nil { return err } - qosFlowAcceptedItem.iEExtensions = &v } if extBit { - if err := qosFlowAcceptedItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := dataForwardingResponseERABListItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(qosFlowAddOrModifyRequestItemExtIEs, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions) - w.WriteBit(qosFlowAddOrModifyRequestItem.extensions.Present()) - w.WriteBit(qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil) - w.WriteBit(qosFlowAddOrModifyRequestItem.ERABID != nil) - w.WriteBit(len(ext) > 0) - if err := qosFlowAddOrModifyRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { - return err +var extIEsDataForwardingResponseERABListItem []ap.IESpec[ProtocolIEID, DataForwardingResponseERABListItem] + +func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if dataForwardingResponseERABListItem.ERABID.Diagnose(d) { + notComprehended = true } - if qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil { - if err := (*qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters).MarshalPER(w, enc); err != nil { - return err + if dataForwardingResponseERABListItem.DLForwardingUPTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, dataForwardingResponseERABListItem.iEExtensions) + return notComprehended +} + +func (delayCritical DelayCritical) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDelayCritical.Encode(w, enc, delayCritical) +} + +func (delayCritical *DelayCritical) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDelayCritical.Decode(r, enc) + if err != nil { + return err + } + *delayCritical = v + return nil +} + +func (delayCritical DelayCritical) Name() string { + return enumDelayCritical.Name(delayCritical) +} + +func (delayCritical DelayCritical) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDelayCritical.Known(delayCritical) +} + +func (directForwardingPathAvailability DirectForwardingPathAvailability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDirectForwardingPathAvailability.Encode(w, enc, directForwardingPathAvailability) +} + +func (directForwardingPathAvailability *DirectForwardingPathAvailability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDirectForwardingPathAvailability.Decode(r, enc) + if err != nil { + return err + } + *directForwardingPathAvailability = v + return nil +} + +func (directForwardingPathAvailability DirectForwardingPathAvailability) Name() string { + return enumDirectForwardingPathAvailability.Name(directForwardingPathAvailability) +} + +func (directForwardingPathAvailability DirectForwardingPathAvailability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDirectForwardingPathAvailability.Known(directForwardingPathAvailability) +} + +func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, dynamic5QIDescriptor.iEExtensions) + w.WriteBit(dynamic5QIDescriptor.extensions.Present()) + w.WriteBit(dynamic5QIDescriptor.FiveQI != nil) + w.WriteBit(dynamic5QIDescriptor.DelayCritical != nil) + w.WriteBit(dynamic5QIDescriptor.AveragingWindow != nil) + w.WriteBit(dynamic5QIDescriptor.MaximumDataBurstVolume != nil) + w.WriteBit(len(ext) > 0) + if err := dynamic5QIDescriptor.PriorityLevelQos.MarshalPER(w, enc); err != nil { + return err + } + if err := dynamic5QIDescriptor.PacketDelayBudget.MarshalPER(w, enc); err != nil { + return err + } + if err := dynamic5QIDescriptor.PacketErrorRate.MarshalPER(w, enc); err != nil { + return err + } + if dynamic5QIDescriptor.FiveQI != nil { + if err := (*dynamic5QIDescriptor.FiveQI).MarshalPER(w, enc); err != nil { + return err } } - if qosFlowAddOrModifyRequestItem.ERABID != nil { - if err := (*qosFlowAddOrModifyRequestItem.ERABID).MarshalPER(w, enc); err != nil { + if dynamic5QIDescriptor.DelayCritical != nil { + if err := (*dynamic5QIDescriptor.DelayCritical).MarshalPER(w, enc); err != nil { + return err + } + } + if dynamic5QIDescriptor.AveragingWindow != nil { + if err := (*dynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { + return err + } + } + if dynamic5QIDescriptor.MaximumDataBurstVolume != nil { + if err := (*dynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowAddOrModifyRequestItem.extensions.Present() { - if err := qosFlowAddOrModifyRequestItem.extensions.MarshalPER(w, enc); err != nil { + if dynamic5QIDescriptor.extensions.Present() { + if err := dynamic5QIDescriptor.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *dynamic5QIDescriptor = Dynamic5QIDescriptor{} extBit, err := r.ReadBit() if err != nil { return err } - p_QosFlowLevelQosParameters, err := r.ReadBit() + p_FiveQI, err := r.ReadBit() if err != nil { return err } - p_ERABID, err := r.ReadBit() + p_DelayCritical, err := r.ReadBit() + if err != nil { + return err + } + p_AveragingWindow, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumDataBurstVolume, err := r.ReadBit() if err != nil { return err } @@ -6739,334 +8006,502 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER if err != nil { return err } - if err := (&qosFlowAddOrModifyRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&dynamic5QIDescriptor.PriorityLevelQos).UnmarshalPER(r, enc); err != nil { return err } - if p_QosFlowLevelQosParameters { - var v QosFlowLevelQosParameters + if err := (&dynamic5QIDescriptor.PacketDelayBudget).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&dynamic5QIDescriptor.PacketErrorRate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_FiveQI { + var v FiveQI if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters = &v + dynamic5QIDescriptor.FiveQI = &v } - if p_ERABID { - var v ERABID + if p_DelayCritical { + var v DelayCritical if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowAddOrModifyRequestItem.ERABID = &v + dynamic5QIDescriptor.DelayCritical = &v + } + if p_AveragingWindow { + var v AveragingWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + dynamic5QIDescriptor.AveragingWindow = &v + } + if p_MaximumDataBurstVolume { + var v MaximumDataBurstVolume + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + dynamic5QIDescriptor.MaximumDataBurstVolume = &v } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, qosFlowAddOrModifyRequestItemExtIEs, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, &dynamic5QIDescriptor.iEExtensions); err != nil { return err } } if extBit { - if err := qosFlowAddOrModifyRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := dynamic5QIDescriptor.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(qosFlowAddOrModifyResponseItemExtIEs, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions) - w.WriteBit(qosFlowAddOrModifyResponseItem.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := qosFlowAddOrModifyResponseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { - return err +var extIEsDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, Dynamic5QIDescriptor]{ + { + ID: IDExtendedPacketDelayBudget, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *Dynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedPacketDelayBudget = &v + return nil + }, + Encode: func(x *Dynamic5QIDescriptor) (per.Marshaler, bool) { + if x.ExtendedPacketDelayBudget == nil { + return nil, false + } + return x.ExtendedPacketDelayBudget, true + }, + }, + { + ID: IDCNPacketDelayBudgetDL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *Dynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNPacketDelayBudgetDL = &v + return nil + }, + Encode: func(x *Dynamic5QIDescriptor) (per.Marshaler, bool) { + if x.CNPacketDelayBudgetDL == nil { + return nil, false + } + return x.CNPacketDelayBudgetDL, true + }, + }, + { + ID: IDCNPacketDelayBudgetUL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *Dynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNPacketDelayBudgetUL = &v + return nil + }, + Encode: func(x *Dynamic5QIDescriptor) (per.Marshaler, bool) { + if x.CNPacketDelayBudgetUL == nil { + return nil, false + } + return x.CNPacketDelayBudgetUL, true + }, + }, +} + +func (dynamic5QIDescriptor *Dynamic5QIDescriptor) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if dynamic5QIDescriptor.PriorityLevelQos.Diagnose(d) { + notComprehended = true } - if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { - return err - } + if dynamic5QIDescriptor.PacketDelayBudget.Diagnose(d) { + notComprehended = true } - if qosFlowAddOrModifyResponseItem.extensions.Present() { - if err := qosFlowAddOrModifyResponseItem.extensions.MarshalPER(w, enc); err != nil { - return err - } + if dynamic5QIDescriptor.PacketErrorRate.Diagnose(d) { + notComprehended = true } - return nil + if dynamic5QIDescriptor.FiveQI != nil && dynamic5QIDescriptor.FiveQI.Diagnose(d) { + notComprehended = true + } + if dynamic5QIDescriptor.DelayCritical != nil && dynamic5QIDescriptor.DelayCritical.Diagnose(d) { + notComprehended = true + } + if dynamic5QIDescriptor.AveragingWindow != nil && dynamic5QIDescriptor.AveragingWindow.Diagnose(d) { + notComprehended = true + } + if dynamic5QIDescriptor.MaximumDataBurstVolume != nil && dynamic5QIDescriptor.MaximumDataBurstVolume.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, dynamic5QIDescriptor.iEExtensions) + return notComprehended } -func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (eCNMarkingAtRANRequest ECNMarkingAtRANRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumECNMarkingAtRANRequest.Encode(w, enc, eCNMarkingAtRANRequest) +} + +func (eCNMarkingAtRANRequest *ECNMarkingAtRANRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumECNMarkingAtRANRequest.Decode(r, enc) if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + *eCNMarkingAtRANRequest = v + return nil +} + +func (eCNMarkingAtRANRequest ECNMarkingAtRANRequest) Name() string { + return enumECNMarkingAtRANRequest.Name(eCNMarkingAtRANRequest) +} + +func (eCNMarkingAtRANRequest ECNMarkingAtRANRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumECNMarkingAtRANRequest.Known(eCNMarkingAtRANRequest) +} + +func (eCNMarkingAtUPFRequest ECNMarkingAtUPFRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumECNMarkingAtUPFRequest.Encode(w, enc, eCNMarkingAtUPFRequest) +} + +func (eCNMarkingAtUPFRequest *ECNMarkingAtUPFRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumECNMarkingAtUPFRequest.Decode(r, enc) if err != nil { return err } - if err := (&qosFlowAddOrModifyResponseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { - return err + *eCNMarkingAtUPFRequest = v + return nil +} + +func (eCNMarkingAtUPFRequest ECNMarkingAtUPFRequest) Name() string { + return enumECNMarkingAtUPFRequest.Name(eCNMarkingAtUPFRequest) +} + +func (eCNMarkingAtUPFRequest ECNMarkingAtUPFRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumECNMarkingAtUPFRequest.Known(eCNMarkingAtUPFRequest) +} + +func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionInformationReportingRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest != nil, eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest != nil, eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest != nil, eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension != nil} { + if ok { + set++ + } } - if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, qosFlowAddOrModifyResponseItemExtIEs, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions); err != nil { + if set > 1 { + return per.ErrChoice + } + switch { + case eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { return err } - } - if extBit { - if err := qosFlowAddOrModifyResponseItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := (*eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest).MarshalPER(w, enc); err != nil { return err } - } - return nil -} - -func (qosFlowInformationItem *QosFlowInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowInformationItem.extensions.Present()) - w.WriteBit(qosFlowInformationItem.DLForwarding != nil) - w.WriteBit(qosFlowInformationItem.iEExtensions != nil) - if err := qosFlowInformationItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { - return err - } - if qosFlowInformationItem.DLForwarding != nil { - if err := (*qosFlowInformationItem.DLForwarding).MarshalPER(w, enc); err != nil { + case eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { return err } - } - if qosFlowInformationItem.iEExtensions != nil { - if err := (*qosFlowInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + if err := (*eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest).MarshalPER(w, enc); err != nil { return err } - } - if qosFlowInformationItem.extensions.Present() { - if err := qosFlowInformationItem.extensions.MarshalPER(w, enc); err != nil { + case eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { + return err + } + if err := (*eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest).MarshalPER(w, enc); err != nil { + return err + } + case eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } + return ap.EncodeField(profile, w, enc, eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (qosFlowInformationItem *QosFlowInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_DLForwarding, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() +func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionInformationReportingRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eCNMarkingorCongestionInformationReportingRequest = ECNMarkingorCongestionInformationReportingRequest{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) if err != nil { return err } - if err := (&qosFlowInformationItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { - return err - } - if p_DLForwarding { - var v DLForwarding + switch idx { + case 0: + var v ECNMarkingAtRANRequest if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowInformationItem.DLForwarding = &v - } - if p_iEExtensions { - var v transparentIEExtensions + eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest = &v + case 1: + var v ECNMarkingAtUPFRequest if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowInformationItem.iEExtensions = &v - } - if extBit { - if err := qosFlowInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest = &v + case 2: + var v CongestionInformationRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { return err } + switch f.ID { + default: + eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension = &f + } + default: + return per.ErrOverflow } return nil } -func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowItemWithDataForwarding.extensions.Present()) - w.WriteBit(qosFlowItemWithDataForwarding.DataForwardingAccepted != nil) - w.WriteBit(qosFlowItemWithDataForwarding.iEExtensions != nil) - if err := qosFlowItemWithDataForwarding.QosFlowIdentifier.MarshalPER(w, enc); err != nil { +func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionInformationReportingRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest != nil: + return eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest.Diagnose(d) + case eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest != nil: + return eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest.Diagnose(d) + case eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest != nil: + return eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest.Diagnose(d) + case eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension != nil: + d.Unknown(eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension.ID, eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension.Criticality) + } + return false +} + +func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongestionInformationReportingStatusItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions) + w.WriteBit(eCNMarkingorCongestionInformationReportingStatusItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eCNMarkingorCongestionInformationReportingStatusItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } - if qosFlowItemWithDataForwarding.DataForwardingAccepted != nil { - if err := (*qosFlowItemWithDataForwarding.DataForwardingAccepted).MarshalPER(w, enc); err != nil { - return err - } + if err := eCNMarkingorCongestionInformationReportingStatusItem.ActivationStatus.MarshalPER(w, enc); err != nil { + return err } - if qosFlowItemWithDataForwarding.iEExtensions != nil { - if err := (*qosFlowItemWithDataForwarding.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowItemWithDataForwarding.extensions.Present() { - if err := qosFlowItemWithDataForwarding.extensions.MarshalPER(w, enc); err != nil { + if eCNMarkingorCongestionInformationReportingStatusItem.extensions.Present() { + if err := eCNMarkingorCongestionInformationReportingStatusItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongestionInformationReportingStatusItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eCNMarkingorCongestionInformationReportingStatusItem = ECNMarkingorCongestionInformationReportingStatusItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_DataForwardingAccepted, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowItemWithDataForwarding.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&eCNMarkingorCongestionInformationReportingStatusItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { return err } - if p_DataForwardingAccepted { - var v DataForwardingAccepted - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - qosFlowItemWithDataForwarding.DataForwardingAccepted = &v + if err := (&eCNMarkingorCongestionInformationReportingStatusItem.ActivationStatus).UnmarshalPER(r, enc); err != nil { + return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, &eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions); err != nil { return err } - qosFlowItemWithDataForwarding.iEExtensions = &v } if extBit { - if err := qosFlowItemWithDataForwarding.extensions.UnmarshalPER(r, enc); err != nil { + if err := eCNMarkingorCongestionInformationReportingStatusItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowLevelQosParameters.extensions.Present()) - w.WriteBit(qosFlowLevelQosParameters.GBRQosInformation != nil) - w.WriteBit(qosFlowLevelQosParameters.ReflectiveQosAttribute != nil) - w.WriteBit(qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil) - w.WriteBit(qosFlowLevelQosParameters.iEExtensions != nil) - if err := qosFlowLevelQosParameters.QosCharacteristics.MarshalPER(w, enc); err != nil { - return err +var extIEsECNMarkingorCongestionInformationReportingStatusItem []ap.IESpec[ProtocolIEID, ECNMarkingorCongestionInformationReportingStatusItem] + +func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongestionInformationReportingStatusItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eCNMarkingorCongestionInformationReportingStatusItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true } - if err := qosFlowLevelQosParameters.AllocationAndRetentionPriority.MarshalPER(w, enc); err != nil { + if eCNMarkingorCongestionInformationReportingStatusItem.ActivationStatus.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions) + return notComprehended +} + +func (eDTSession EDTSession) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEDTSession.Encode(w, enc, eDTSession) +} + +func (eDTSession *EDTSession) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEDTSession.Decode(r, enc) + if err != nil { return err } - if qosFlowLevelQosParameters.GBRQosInformation != nil { - if err := (*qosFlowLevelQosParameters.GBRQosInformation).MarshalPER(w, enc); err != nil { - return err + *eDTSession = v + return nil +} + +func (eDTSession EDTSession) Name() string { + return enumEDTSession.Name(eDTSession) +} + +func (eDTSession EDTSession) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEDTSession.Known(eDTSession) +} + +func (eNBID *ENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{eNBID.MacroENBID != nil, eNBID.HomeENBID != nil, eNBID.ShortmacroENBID != nil, eNBID.LongmacroENBID != nil, eNBID.ChoiceExtension != nil} { + if ok { + set++ } } - if qosFlowLevelQosParameters.ReflectiveQosAttribute != nil { - if err := encodeRootEnumerated(w, enc, 1, int64((*qosFlowLevelQosParameters.ReflectiveQosAttribute)), "ReflectiveQosAttribute"); err != nil { + if set > 1 { + return per.ErrChoice + } + switch { + case eNBID.MacroENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 0); err != nil { return err } - } - if qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil { - if err := encodeRootEnumerated(w, enc, 1, int64((*qosFlowLevelQosParameters.AdditionalQosFlowInformation)), "AdditionalQosFlowInformation"); err != nil { + if err := (*eNBID.MacroENBID).MarshalPER(w, enc); err != nil { return err } - } - if qosFlowLevelQosParameters.iEExtensions != nil { - if err := (*qosFlowLevelQosParameters.iEExtensions).MarshalPER(w, enc); err != nil { + case eNBID.HomeENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 1); err != nil { return err } - } - if qosFlowLevelQosParameters.extensions.Present() { - if err := qosFlowLevelQosParameters.extensions.MarshalPER(w, enc); err != nil { + if err := (*eNBID.HomeENBID).MarshalPER(w, enc); err != nil { + return err + } + case eNBID.ShortmacroENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 2); err != nil { + return err + } + if err := (*eNBID.ShortmacroENBID).MarshalPER(w, enc); err != nil { + return err + } + case eNBID.LongmacroENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 3); err != nil { + return err + } + if err := (*eNBID.LongmacroENBID).MarshalPER(w, enc); err != nil { + return err + } + case eNBID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } + return ap.EncodeField(profile, w, enc, eNBID.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_GBRQosInformation, err := r.ReadBit() - if err != nil { - return err - } - p_ReflectiveQosAttribute, err := r.ReadBit() - if err != nil { - return err - } - p_AdditionalQosFlowInformation, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() +func (eNBID *ENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNBID = ENBID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 4) if err != nil { return err } - if err := (&qosFlowLevelQosParameters.QosCharacteristics).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&qosFlowLevelQosParameters.AllocationAndRetentionPriority).UnmarshalPER(r, enc); err != nil { - return err - } - if p_GBRQosInformation { - var v GBRQosInformation + switch idx { + case 0: + var v ENBIDMacroENBID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowLevelQosParameters.GBRQosInformation = &v - } - if p_ReflectiveQosAttribute { - var v ReflectiveQosAttribute - e3, err := decodeRootEnumerated(r, enc, 1, "ReflectiveQosAttribute") - if err != nil { + eNBID.MacroENBID = &v + case 1: + var v ENBIDHomeENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - v = ReflectiveQosAttribute(e3) - qosFlowLevelQosParameters.ReflectiveQosAttribute = &v - } - if p_AdditionalQosFlowInformation { - var v AdditionalQosFlowInformation - e4, err := decodeRootEnumerated(r, enc, 1, "AdditionalQosFlowInformation") - if err != nil { + eNBID.HomeENBID = &v + case 2: + var v ENBIDShortmacroENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - v = AdditionalQosFlowInformation(e4) - qosFlowLevelQosParameters.AdditionalQosFlowInformation = &v - } - if p_iEExtensions { - var v rawIEExtensions + eNBID.ShortmacroENBID = &v + case 3: + var v ENBIDLongmacroENBID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowLevelQosParameters.iEExtensions = &v - } - if extBit { - if err := qosFlowLevelQosParameters.extensions.UnmarshalPER(r, enc); err != nil { + eNBID.LongmacroENBID = &v + case 4: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { return err } + switch f.ID { + default: + eNBID.ChoiceExtension = &f + } + default: + return per.ErrOverflow } return nil } -func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowModifyConfirmItem.extensions.Present()) - w.WriteBit(qosFlowModifyConfirmItem.iEExtensions != nil) - if err := qosFlowModifyConfirmItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { +func (eNBID *ENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case eNBID.MacroENBID != nil: + case eNBID.HomeENBID != nil: + case eNBID.ShortmacroENBID != nil: + case eNBID.LongmacroENBID != nil: + case eNBID.ChoiceExtension != nil: + d.Unknown(eNBID.ChoiceExtension.ID, eNBID.ChoiceExtension.Criticality) + } + return false +} + +func (ePSTAI *EPSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEPSTAI, ePSTAI, ePSTAI.iEExtensions) + w.WriteBit(ePSTAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := ePSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if qosFlowModifyConfirmItem.iEExtensions != nil { - if err := (*qosFlowModifyConfirmItem.iEExtensions).MarshalPER(w, enc); err != nil { + if err := ePSTAI.TAC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowModifyConfirmItem.extensions.Present() { - if err := qosFlowModifyConfirmItem.extensions.MarshalPER(w, enc); err != nil { + if ePSTAI.extensions.Present() { + if err := ePSTAI.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *ePSTAI = EPSTAI{} extBit, err := r.ReadBit() if err != nil { return err @@ -7075,109 +8510,195 @@ func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Re if err != nil { return err } - if err := (&qosFlowModifyConfirmItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&ePSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&ePSTAI.TAC).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEPSTAI, ePSTAI, &ePSTAI.iEExtensions); err != nil { return err } - qosFlowModifyConfirmItem.iEExtensions = &v } if extBit { - if err := qosFlowModifyConfirmItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := ePSTAI.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (qosFlowNotifyItem *QosFlowNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := qosFlowNotifyItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { +var extIEsEPSTAI []ap.IESpec[ProtocolIEID, EPSTAI] + +func (ePSTAI *EPSTAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsEPSTAI, ePSTAI, ePSTAI.iEExtensions) + return notComprehended +} + +func (eRABInformationItem *ERABInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABInformationItem, eRABInformationItem, eRABInformationItem.iEExtensions) + w.WriteBit(eRABInformationItem.extensions.Present()) + w.WriteBit(eRABInformationItem.DLForwarding != nil) + w.WriteBit(len(ext) > 0) + if err := eRABInformationItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(qosFlowNotifyItem.NotificationCause), "NotificationCause"); err != nil { - return err + if eRABInformationItem.DLForwarding != nil { + if err := (*eRABInformationItem.DLForwarding).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABInformationItem.extensions.Present() { + if err := eRABInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABInformationItem *ERABInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABInformationItem = ERABInformationItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_DLForwarding, err := r.ReadBit() if err != nil { return err } - if err := (&qosFlowNotifyItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - e1, err := decodeRootEnumerated(r, enc, 2, "NotificationCause") - if err != nil { + if err := (&eRABInformationItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - qosFlowNotifyItem.NotificationCause = NotificationCause(e1) - if p_f2 { - var v ieExtensions + if p_DLForwarding { + var v DLForwarding if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + eRABInformationItem.DLForwarding = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABInformationItem, eRABInformationItem, &eRABInformationItem.iEExtensions); err != nil { + return err + } } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABInformationItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue + } + return nil +} + +var extIEsERABInformationItem = []ap.IESpec[ProtocolIEID, ERABInformationItem]{ + { + ID: IDSourceTNLAddrInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABInformationItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceTNLAddrInfo = &v + return nil + }, + Encode: func(x *ERABInformationItem) (per.Marshaler, bool) { + if x.SourceTNLAddrInfo == nil { + return nil, false } - if err := per.SkipOpenType(r, enc); err != nil { + return x.SourceTNLAddrInfo, true + }, + }, + { + ID: IDSourceNodeTNLAddrInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABInformationItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } + x.SourceNodeTNLAddrInfo = &v + return nil + }, + Encode: func(x *ERABInformationItem) (per.Marshaler, bool) { + if x.SourceNodeTNLAddrInfo == nil { + return nil, false + } + return x.SourceNodeTNLAddrInfo, true + }, + }, +} + +func (eRABInformationItem *ERABInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABInformationItem.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABInformationItem.DLForwarding != nil && eRABInformationItem.DLForwarding.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABInformationItem, eRABInformationItem, eRABInformationItem.iEExtensions) + return notComprehended +} + +func (eRedCapIndication ERedCapIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumERedCapIndication.Encode(w, enc, eRedCapIndication) +} + +func (eRedCapIndication *ERedCapIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumERedCapIndication.Decode(r, enc) + if err != nil { + return err } + *eRedCapIndication = v return nil } -func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowPerTNLInformation.extensions.Present()) - w.WriteBit(qosFlowPerTNLInformation.iEExtensions != nil) - if err := qosFlowPerTNLInformation.UPTransportLayerInformation.MarshalPER(w, enc); err != nil { +func (eRedCapIndication ERedCapIndication) Name() string { + return enumERedCapIndication.Name(eRedCapIndication) +} + +func (eRedCapIndication ERedCapIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumERedCapIndication.Known(eRedCapIndication) +} + +func (eUTRACGI *EUTRACGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRACGI, eUTRACGI, eUTRACGI.iEExtensions) + w.WriteBit(eUTRACGI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eUTRACGI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := qosFlowPerTNLInformation.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { + if err := eUTRACGI.EUTRACellIdentity.MarshalPER(w, enc); err != nil { return err } - if qosFlowPerTNLInformation.iEExtensions != nil { - if err := (*qosFlowPerTNLInformation.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowPerTNLInformation.extensions.Present() { - if err := qosFlowPerTNLInformation.extensions.MarshalPER(w, enc); err != nil { + if eUTRACGI.extensions.Present() { + if err := eUTRACGI.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRACGI *EUTRACGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRACGI = EUTRACGI{} extBit, err := r.ReadBit() if err != nil { return err @@ -7186,107 +8707,89 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Re if err != nil { return err } - if err := (&qosFlowPerTNLInformation.UPTransportLayerInformation).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRACGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&qosFlowPerTNLInformation.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRACGI.EUTRACellIdentity).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRACGI, eUTRACGI, &eUTRACGI.iEExtensions); err != nil { return err } - qosFlowPerTNLInformation.iEExtensions = &v } if extBit { - if err := qosFlowPerTNLInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := eUTRACGI.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowPerTNLInformationItem.extensions.Present()) - w.WriteBit(qosFlowPerTNLInformationItem.iEExtensions != nil) - if err := qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { - return err - } - if qosFlowPerTNLInformationItem.iEExtensions != nil { - if err := (*qosFlowPerTNLInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { - return err - } - } - if qosFlowPerTNLInformationItem.extensions.Present() { - if err := qosFlowPerTNLInformationItem.extensions.MarshalPER(w, enc); err != nil { - return err - } - } - return nil +var extIEsEUTRACGI []ap.IESpec[ProtocolIEID, EUTRACGI] + +func (eUTRACGI *EUTRACGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsEUTRACGI, eUTRACGI, eUTRACGI.iEExtensions) + return notComprehended } -func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { +func (eUTRANCellReportItem *EUTRANCellReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRANCellReportItem, eUTRANCellReportItem, eUTRANCellReportItem.iEExtensions) + w.WriteBit(eUTRANCellReportItem.extensions.Present()) + w.WriteBit(eUTRANCellReportItem.EUTRANNumberOfActiveUEs != nil) + w.WriteBit(eUTRANCellReportItem.EUTRANNoofRRCConnections != nil) + w.WriteBit(eUTRANCellReportItem.EUTRANRadioResourceStatus != nil) + w.WriteBit(len(ext) > 0) + if err := eUTRANCellReportItem.ECGI.MarshalPER(w, enc); err != nil { return err } - if err := (&qosFlowPerTNLInformationItem.QosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := eUTRANCellReportItem.EUTRANCompositeAvailableCapacityGroup.MarshalPER(w, enc); err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if eUTRANCellReportItem.EUTRANNumberOfActiveUEs != nil { + if err := (*eUTRANCellReportItem.EUTRANNumberOfActiveUEs).MarshalPER(w, enc); err != nil { return err } - qosFlowPerTNLInformationItem.iEExtensions = &v } - if extBit { - if err := qosFlowPerTNLInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + if eUTRANCellReportItem.EUTRANNoofRRCConnections != nil { + if err := (*eUTRANCellReportItem.EUTRANNoofRRCConnections).MarshalPER(w, enc); err != nil { return err } } - return nil -} - -func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowSetupRequestItem.extensions.Present()) - w.WriteBit(qosFlowSetupRequestItem.ERABID != nil) - w.WriteBit(qosFlowSetupRequestItem.iEExtensions != nil) - if err := qosFlowSetupRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { - return err - } - if err := qosFlowSetupRequestItem.QosFlowLevelQosParameters.MarshalPER(w, enc); err != nil { - return err - } - if qosFlowSetupRequestItem.ERABID != nil { - if err := (*qosFlowSetupRequestItem.ERABID).MarshalPER(w, enc); err != nil { + if eUTRANCellReportItem.EUTRANRadioResourceStatus != nil { + if err := (*eUTRANCellReportItem.EUTRANRadioResourceStatus).MarshalPER(w, enc); err != nil { return err } } - if qosFlowSetupRequestItem.iEExtensions != nil { - if err := (*qosFlowSetupRequestItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowSetupRequestItem.extensions.Present() { - if err := qosFlowSetupRequestItem.extensions.MarshalPER(w, enc); err != nil { + if eUTRANCellReportItem.extensions.Present() { + if err := eUTRANCellReportItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRANCellReportItem *EUTRANCellReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANCellReportItem = EUTRANCellReportItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_ERABID, err := r.ReadBit() + p_EUTRANNumberOfActiveUEs, err := r.ReadBit() + if err != nil { + return err + } + p_EUTRANNoofRRCConnections, err := r.ReadBit() + if err != nil { + return err + } + p_EUTRANRadioResourceStatus, err := r.ReadBit() if err != nil { return err } @@ -7294,54 +8797,91 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Read if err != nil { return err } - if err := (&qosFlowSetupRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCellReportItem.ECGI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&qosFlowSetupRequestItem.QosFlowLevelQosParameters).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCellReportItem.EUTRANCompositeAvailableCapacityGroup).UnmarshalPER(r, enc); err != nil { return err } - if p_ERABID { - var v ERABID + if p_EUTRANNumberOfActiveUEs { + var v EUTRANNumberOfActiveUEs if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowSetupRequestItem.ERABID = &v + eUTRANCellReportItem.EUTRANNumberOfActiveUEs = &v } - if p_iEExtensions { - var v rawIEExtensions + if p_EUTRANNoofRRCConnections { + var v NGRANNoofRRCConnections if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - qosFlowSetupRequestItem.iEExtensions = &v + eUTRANCellReportItem.EUTRANNoofRRCConnections = &v } - if extBit { - if err := qosFlowSetupRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + if p_EUTRANRadioResourceStatus { + var v EUTRANRadioResourceStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + eUTRANCellReportItem.EUTRANRadioResourceStatus = &v } - return nil -} + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCellReportItem, eUTRANCellReportItem, &eUTRANCellReportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := eUTRANCellReportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} -func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowToBeForwardedItem.extensions.Present()) - w.WriteBit(qosFlowToBeForwardedItem.iEExtensions != nil) - if err := qosFlowToBeForwardedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { +var extIEsEUTRANCellReportItem []ap.IESpec[ProtocolIEID, EUTRANCellReportItem] + +func (eUTRANCellReportItem *EUTRANCellReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eUTRANCellReportItem.ECGI.Diagnose(d) { + notComprehended = true + } + if eUTRANCellReportItem.EUTRANCompositeAvailableCapacityGroup.Diagnose(d) { + notComprehended = true + } + if eUTRANCellReportItem.EUTRANNumberOfActiveUEs != nil && eUTRANCellReportItem.EUTRANNumberOfActiveUEs.Diagnose(d) { + notComprehended = true + } + if eUTRANCellReportItem.EUTRANNoofRRCConnections != nil && eUTRANCellReportItem.EUTRANNoofRRCConnections.Diagnose(d) { + notComprehended = true + } + if eUTRANCellReportItem.EUTRANRadioResourceStatus != nil && eUTRANCellReportItem.EUTRANRadioResourceStatus.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsEUTRANCellReportItem, eUTRANCellReportItem, eUTRANCellReportItem.iEExtensions) + return notComprehended +} + +func (eUTRANCellToReportItem *EUTRANCellToReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, eUTRANCellToReportItem.iEExtensions) + w.WriteBit(eUTRANCellToReportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eUTRANCellToReportItem.ECGI.MarshalPER(w, enc); err != nil { return err } - if qosFlowToBeForwardedItem.iEExtensions != nil { - if err := (*qosFlowToBeForwardedItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowToBeForwardedItem.extensions.Present() { - if err := qosFlowToBeForwardedItem.extensions.MarshalPER(w, enc); err != nil { + if eUTRANCellToReportItem.extensions.Present() { + if err := eUTRANCellToReportItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRANCellToReportItem *EUTRANCellToReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANCellToReportItem = EUTRANCellToReportItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -7350,47 +8890,58 @@ func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Re if err != nil { return err } - if err := (&qosFlowToBeForwardedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCellToReportItem.ECGI).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, &eUTRANCellToReportItem.iEExtensions); err != nil { return err } - qosFlowToBeForwardedItem.iEExtensions = &v } if extBit { - if err := qosFlowToBeForwardedItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eUTRANCellToReportItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (qosFlowWithCauseItem *QosFlowWithCauseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(qosFlowWithCauseItem.extensions.Present()) - w.WriteBit(qosFlowWithCauseItem.iEExtensions != nil) - if err := qosFlowWithCauseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { +var extIEsEUTRANCellToReportItem []ap.IESpec[ProtocolIEID, EUTRANCellToReportItem] + +func (eUTRANCellToReportItem *EUTRANCellToReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eUTRANCellToReportItem.ECGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, eUTRANCellToReportItem.iEExtensions) + return notComprehended +} + +func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGroup) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup.iEExtensions) + w.WriteBit(eUTRANCompositeAvailableCapacityGroup.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eUTRANCompositeAvailableCapacityGroup.DLCompositeAvailableCapacity.MarshalPER(w, enc); err != nil { return err } - if err := qosFlowWithCauseItem.Cause.MarshalPER(w, enc); err != nil { + if err := eUTRANCompositeAvailableCapacityGroup.ULCompositeAvailableCapacity.MarshalPER(w, enc); err != nil { return err } - if qosFlowWithCauseItem.iEExtensions != nil { - if err := (*qosFlowWithCauseItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if qosFlowWithCauseItem.extensions.Present() { - if err := qosFlowWithCauseItem.extensions.MarshalPER(w, enc); err != nil { + if eUTRANCompositeAvailableCapacityGroup.extensions.Present() { + if err := eUTRANCompositeAvailableCapacityGroup.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGroup) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANCompositeAvailableCapacityGroup = EUTRANCompositeAvailableCapacityGroup{} extBit, err := r.ReadBit() if err != nil { return err @@ -7399,292 +8950,346 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, en if err != nil { return err } - if err := (&qosFlowWithCauseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCompositeAvailableCapacityGroup.DLCompositeAvailableCapacity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&qosFlowWithCauseItem.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCompositeAvailableCapacityGroup.ULCompositeAvailableCapacity).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, &eUTRANCompositeAvailableCapacityGroup.iEExtensions); err != nil { return err } - qosFlowWithCauseItem.iEExtensions = &v } if extBit { - if err := qosFlowWithCauseItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eUTRANCompositeAvailableCapacityGroup.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := rATRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err +var extIEsEUTRANCompositeAvailableCapacityGroup []ap.IESpec[ProtocolIEID, EUTRANCompositeAvailableCapacityGroup] + +func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGroup) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eUTRANCompositeAvailableCapacityGroup.DLCompositeAvailableCapacity.Diagnose(d) { + notComprehended = true } - if err := rATRestrictionsItem.RATRestrictionInformation.MarshalPER(w, enc); err != nil { - return err + if eUTRANCompositeAvailableCapacityGroup.ULCompositeAvailableCapacity.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup.iEExtensions) + return notComprehended } -func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, eUTRANRadioResourceStatus.iEExtensions) + w.WriteBit(eUTRANRadioResourceStatus.extensions.Present()) + w.WriteBit(eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage != nil) + w.WriteBit(eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage != nil) + w.WriteBit(len(ext) > 0) + if err := eUTRANRadioResourceStatus.DLGBRPRBusage.MarshalPER(w, enc); err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { + if err := eUTRANRadioResourceStatus.ULGBRPRBusage.MarshalPER(w, enc); err != nil { return err } - if err := (&rATRestrictionsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := eUTRANRadioResourceStatus.DLnonGBRPRBusage.MarshalPER(w, enc); err != nil { return err } - if err := (&rATRestrictionsItem.RATRestrictionInformation).UnmarshalPER(r, enc); err != nil { + if err := eUTRANRadioResourceStatus.ULnonGBRPRBusage.MarshalPER(w, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := eUTRANRadioResourceStatus.DLTotalPRBusage.MarshalPER(w, enc); err != nil { + return err + } + if err := eUTRANRadioResourceStatus.ULTotalPRBusage.MarshalPER(w, enc); err != nil { + return err + } + if eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage != nil { + if err := (*eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage).MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage != nil { + if err := (*eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage).MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - -func (requestedNSSAIItem *RequestedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(requestedNSSAIItem.extensions.Present()) - w.WriteBit(requestedNSSAIItem.iEExtensions != nil) - if err := requestedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { - return err } - if requestedNSSAIItem.iEExtensions != nil { - if err := (*requestedNSSAIItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if requestedNSSAIItem.extensions.Present() { - if err := requestedNSSAIItem.extensions.MarshalPER(w, enc); err != nil { + if eUTRANRadioResourceStatus.extensions.Present() { + if err := eUTRANRadioResourceStatus.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (requestedNSSAIItem *RequestedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANRadioResourceStatus = EUTRANRadioResourceStatus{} extBit, err := r.ReadBit() if err != nil { return err } + p_DLschedulingPDCCHCCEusage, err := r.ReadBit() + if err != nil { + return err + } + p_ULschedulingPDCCHCCEusage, err := r.ReadBit() + if err != nil { + return err + } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&requestedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANRadioResourceStatus.DLGBRPRBusage).UnmarshalPER(r, enc); err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions + if err := (&eUTRANRadioResourceStatus.ULGBRPRBusage).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eUTRANRadioResourceStatus.DLnonGBRPRBusage).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eUTRANRadioResourceStatus.ULnonGBRPRBusage).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eUTRANRadioResourceStatus.DLTotalPRBusage).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eUTRANRadioResourceStatus.ULTotalPRBusage).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLschedulingPDCCHCCEusage { + var v EUTRANRadioResourceStatusDLschedulingPDCCHCCEusage + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage = &v + } + if p_ULschedulingPDCCHCCEusage { + var v EUTRANRadioResourceStatusULschedulingPDCCHCCEusage if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - requestedNSSAIItem.iEExtensions = &v + eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, &eUTRANRadioResourceStatus.iEExtensions); err != nil { + return err + } } if extBit { - if err := requestedNSSAIItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eUTRANRadioResourceStatus.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(sNSSAI.extensions.Present()) - w.WriteBit(sNSSAI.SD != nil) - w.WriteBit(sNSSAI.iEExtensions != nil) - if err := sNSSAI.SST.MarshalPER(w, enc); err != nil { +var extIEsEUTRANRadioResourceStatus []ap.IESpec[ProtocolIEID, EUTRANRadioResourceStatus] + +func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, eUTRANRadioResourceStatus.iEExtensions) + return notComprehended +} + +func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, eUTRANReportingStatusIEs.iEExtensions) + w.WriteBit(eUTRANReportingStatusIEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eUTRANReportingStatusIEs.EUTRANCellReportList.MarshalPER(w, enc); err != nil { return err } - if sNSSAI.SD != nil { - if err := (*sNSSAI.SD).MarshalPER(w, enc); err != nil { - return err - } - } - if sNSSAI.iEExtensions != nil { - if err := (*sNSSAI.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if sNSSAI.extensions.Present() { - if err := sNSSAI.extensions.MarshalPER(w, enc); err != nil { + if eUTRANReportingStatusIEs.extensions.Present() { + if err := eUTRANReportingStatusIEs.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANReportingStatusIEs = EUTRANReportingStatusIEs{} extBit, err := r.ReadBit() if err != nil { return err } - p_SD, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&sNSSAI.SST).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANReportingStatusIEs.EUTRANCellReportList).UnmarshalPER(r, enc); err != nil { return err } - if p_SD { - var v SD - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - sNSSAI.SD = &v - } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, &eUTRANReportingStatusIEs.iEExtensions); err != nil { return err } - sNSSAI.iEExtensions = &v } if extBit { - if err := sNSSAI.extensions.UnmarshalPER(r, enc); err != nil { + if err := eUTRANReportingStatusIEs.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { - return err +var extIEsEUTRANReportingStatusIEs []ap.IESpec[ProtocolIEID, EUTRANReportingStatusIEs] + +func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eUTRANReportingStatusIEs.EUTRANCellReportList.Diagnose(d) { + notComprehended = true } - if err := securityContext.NextHopNH.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, eUTRANReportingStatusIEs.iEExtensions) + return notComprehended +} + +func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, eUTRANReportingSystemIEs.iEExtensions) + w.WriteBit(eUTRANReportingSystemIEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eUTRANReportingSystemIEs.EUTRANCellToReportList.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eUTRANReportingSystemIEs.extensions.Present() { + if err := eUTRANReportingSystemIEs.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANReportingSystemIEs = EUTRANReportingSystemIEs{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}) + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - securityContext.NextHopChainingCount = uint8(n0) - if err := (&securityContext.NextHopNH).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANReportingSystemIEs.EUTRANCellToReportList).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, &eUTRANReportingSystemIEs.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eUTRANReportingSystemIEs.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(securityIndication.extensions.Present()) - w.WriteBit(securityIndication.MaximumIntegrityProtectedDataRateUL != nil) - w.WriteBit(securityIndication.iEExtensions != nil) - if err := encodeRootEnumerated(w, enc, 3, int64(securityIndication.IntegrityProtectionIndication), "IntegrityProtectionIndication"); err != nil { +var extIEsEUTRANReportingSystemIEs []ap.IESpec[ProtocolIEID, EUTRANReportingSystemIEs] + +func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eUTRANReportingSystemIEs.EUTRANCellToReportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, eUTRANReportingSystemIEs.iEExtensions) + return notComprehended +} + +func (eUTRAPagingTimeWindow EUTRAPagingTimeWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEUTRAPagingTimeWindow.Encode(w, enc, eUTRAPagingTimeWindow) +} + +func (eUTRAPagingTimeWindow *EUTRAPagingTimeWindow) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEUTRAPagingTimeWindow.Decode(r, enc) + if err != nil { + return err + } + *eUTRAPagingTimeWindow = v + return nil +} + +func (eUTRAPagingTimeWindow EUTRAPagingTimeWindow) Name() string { + return enumEUTRAPagingTimeWindow.Name(eUTRAPagingTimeWindow) +} + +func (eUTRAPagingTimeWindow EUTRAPagingTimeWindow) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEUTRAPagingTimeWindow.Known(eUTRAPagingTimeWindow) +} + +func (eUTRAPagingeDRXCycle EUTRAPagingeDRXCycle) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEUTRAPagingeDRXCycle.Encode(w, enc, eUTRAPagingeDRXCycle) +} + +func (eUTRAPagingeDRXCycle *EUTRAPagingeDRXCycle) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEUTRAPagingeDRXCycle.Decode(r, enc) + if err != nil { return err } - if err := encodeRootEnumerated(w, enc, 3, int64(securityIndication.ConfidentialityProtectionIndication), "ConfidentialityProtectionIndication"); err != nil { + *eUTRAPagingeDRXCycle = v + return nil +} + +func (eUTRAPagingeDRXCycle EUTRAPagingeDRXCycle) Name() string { + return enumEUTRAPagingeDRXCycle.Name(eUTRAPagingeDRXCycle) +} + +func (eUTRAPagingeDRXCycle EUTRAPagingeDRXCycle) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEUTRAPagingeDRXCycle.Known(eUTRAPagingeDRXCycle) +} + +func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation.iEExtensions) + w.WriteBit(eUTRAPagingeDRXInformation.extensions.Present()) + w.WriteBit(eUTRAPagingeDRXInformation.EUTRApagingTimeWindow != nil) + w.WriteBit(len(ext) > 0) + if err := eUTRAPagingeDRXInformation.EUTRApagingeDRXCycle.MarshalPER(w, enc); err != nil { return err } - if securityIndication.MaximumIntegrityProtectedDataRateUL != nil { - if err := encodeRootEnumerated(w, enc, 2, int64((*securityIndication.MaximumIntegrityProtectedDataRateUL)), "MaximumIntegrityProtectedDataRate"); err != nil { + if eUTRAPagingeDRXInformation.EUTRApagingTimeWindow != nil { + if err := (*eUTRAPagingeDRXInformation.EUTRApagingTimeWindow).MarshalPER(w, enc); err != nil { return err } } - if securityIndication.iEExtensions != nil { - if err := (*securityIndication.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if securityIndication.extensions.Present() { - if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + if eUTRAPagingeDRXInformation.extensions.Present() { + if err := eUTRAPagingeDRXInformation.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRAPagingeDRXInformation = EUTRAPagingeDRXInformation{} extBit, err := r.ReadBit() if err != nil { return err } - p_MaximumIntegrityProtectedDataRateUL, err := r.ReadBit() + p_EUTRApagingTimeWindow, err := r.ReadBit() if err != nil { return err } @@ -7692,63 +9297,99 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe if err != nil { return err } - e0, err := decodeRootEnumerated(r, enc, 3, "IntegrityProtectionIndication") - if err != nil { - return err - } - securityIndication.IntegrityProtectionIndication = IntegrityProtectionIndication(e0) - e1, err := decodeRootEnumerated(r, enc, 3, "ConfidentialityProtectionIndication") - if err != nil { + if err := (&eUTRAPagingeDRXInformation.EUTRApagingeDRXCycle).UnmarshalPER(r, enc); err != nil { return err } - securityIndication.ConfidentialityProtectionIndication = ConfidentialityProtectionIndication(e1) - if p_MaximumIntegrityProtectedDataRateUL { - var v MaximumIntegrityProtectedDataRate - e2, err := decodeRootEnumerated(r, enc, 2, "MaximumIntegrityProtectedDataRate") - if err != nil { + if p_EUTRApagingTimeWindow { + var v EUTRAPagingTimeWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - v = MaximumIntegrityProtectedDataRate(e2) - securityIndication.MaximumIntegrityProtectedDataRateUL = &v + eUTRAPagingeDRXInformation.EUTRApagingTimeWindow = &v } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, &eUTRAPagingeDRXInformation.iEExtensions); err != nil { return err } - securityIndication.iEExtensions = &v } if extBit { - if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { + if err := eUTRAPagingeDRXInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (securityResult *SecurityResult) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(securityResult.extensions.Present()) - w.WriteBit(securityResult.iEExtensions != nil) - if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.IntegrityProtectionResult), "IntegrityProtectionResult"); err != nil { +var extIEsEUTRAPagingeDRXInformation []ap.IESpec[ProtocolIEID, EUTRAPagingeDRXInformation] + +func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eUTRAPagingeDRXInformation.EUTRApagingeDRXCycle.Diagnose(d) { + notComprehended = true + } + if eUTRAPagingeDRXInformation.EUTRApagingTimeWindow != nil && eUTRAPagingeDRXInformation.EUTRApagingTimeWindow.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation.iEExtensions) + return notComprehended +} + +func (earlyMeasurement EarlyMeasurement) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEarlyMeasurement.Encode(w, enc, earlyMeasurement) +} + +func (earlyMeasurement *EarlyMeasurement) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEarlyMeasurement.Decode(r, enc) + if err != nil { + return err + } + *earlyMeasurement = v + return nil +} + +func (earlyMeasurement EarlyMeasurement) Name() string { + return enumEarlyMeasurement.Name(earlyMeasurement) +} + +func (earlyMeasurement EarlyMeasurement) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEarlyMeasurement.Known(earlyMeasurement) +} + +func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem.iEExtensions) + w.WriteBit(emergencyAreaIDBroadcastEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(securityResult.ConfidentialityProtectionResult), "ConfidentialityProtectionResult"); err != nil { + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } - if securityResult.iEExtensions != nil { - if err := (*securityResult.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if securityResult.extensions.Present() { - if err := securityResult.extensions.MarshalPER(w, enc); err != nil { + if emergencyAreaIDBroadcastEUTRAItem.extensions.Present() { + if err := emergencyAreaIDBroadcastEUTRAItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDBroadcastEUTRAItem = EmergencyAreaIDBroadcastEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -7757,280 +9398,336 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi if err != nil { return err } - e0, err := decodeRootEnumerated(r, enc, 2, "IntegrityProtectionResult") - if err != nil { + if err := (&emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { return err } - securityResult.IntegrityProtectionResult = IntegrityProtectionResult(e0) - e1, err := decodeRootEnumerated(r, enc, 2, "ConfidentialityProtectionResult") - if err != nil { + emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI) + emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI = append(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI, make([]CompletedCellsInEAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } - securityResult.ConfidentialityProtectionResult = ConfidentialityProtectionResult(e1) if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, &emergencyAreaIDBroadcastEUTRAItem.iEExtensions); err != nil { return err } - securityResult.iEExtensions = &v } if extBit { - if err := securityResult.extensions.UnmarshalPER(r, enc); err != nil { + if err := emergencyAreaIDBroadcastEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (serviceAreaInformationItem *ServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(serviceAreaInformationItem.AllowedTACs != nil) - w.WriteBit(serviceAreaInformationItem.NotAllowedTACs != nil) - w.WriteBit(false) - if err := serviceAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { +var extIEsEmergencyAreaIDBroadcastEUTRAItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastEUTRAItem] + +func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI { + if emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem.iEExtensions) + return notComprehended +} + +func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem.iEExtensions) + w.WriteBit(emergencyAreaIDBroadcastNRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDBroadcastNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { return err } - if serviceAreaInformationItem.AllowedTACs != nil { - if err := serviceAreaInformationItem.AllowedTACs.MarshalPER(w, enc); err != nil { + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if serviceAreaInformationItem.NotAllowedTACs != nil { - if err := serviceAreaInformationItem.NotAllowedTACs.MarshalPER(w, enc); err != nil { + if emergencyAreaIDBroadcastNRItem.extensions.Present() { + if err := emergencyAreaIDBroadcastNRItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (serviceAreaInformationItem *ServiceAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDBroadcastNRItem = EmergencyAreaIDBroadcastNRItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_AllowedTACs, err := r.ReadBit() - if err != nil { - return err - } - p_NotAllowedTACs, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() - if err != nil { + if err := (&emergencyAreaIDBroadcastNRItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&serviceAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI) + emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI = append(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI, make([]CompletedCellsInEAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } - if p_AllowedTACs { - if err := (&serviceAreaInformationItem.AllowedTACs).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, &emergencyAreaIDBroadcastNRItem.iEExtensions); err != nil { return err } } - if p_NotAllowedTACs { - if err := (&serviceAreaInformationItem.NotAllowedTACs).UnmarshalPER(r, enc); err != nil { + if extBit { + if err := emergencyAreaIDBroadcastNRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err + return nil +} + +var extIEsEmergencyAreaIDBroadcastNRItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastNRItem] + +func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI { + if emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[i].Diagnose(d) { + notComprehended = true } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem.iEExtensions) + return notComprehended +} + +func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem.iEExtensions) + w.WriteBit(emergencyAreaIDCancelledEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[i].MarshalPER(w, enc); err != nil { return err } } - } - return nil -} - -func (sliceOverloadItem *SliceOverloadItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := sliceOverloadItem.SNSSAI.MarshalPER(w, enc); err != nil { + off1 = end + return nil + }); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if emergencyAreaIDCancelledEUTRAItem.extensions.Present() { + if err := emergencyAreaIDCancelledEUTRAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (sliceOverloadItem *SliceOverloadItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDCancelledEUTRAItem = EmergencyAreaIDCancelledEUTRAItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&sliceOverloadItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + if err := (&emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI) + emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI = append(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI, make([]CancelledCellsInEAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, &emergencyAreaIDCancelledEUTRAItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := emergencyAreaIDCancelledEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (sliceSupportItem *SliceSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := sliceSupportItem.SNSSAI.MarshalPER(w, enc); err != nil { +var extIEsEmergencyAreaIDCancelledEUTRAItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDCancelledEUTRAItem] + +func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI { + if emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem.iEExtensions) + return notComprehended +} + +func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem.iEExtensions) + w.WriteBit(emergencyAreaIDCancelledNRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDCancelledNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if emergencyAreaIDCancelledNRItem.extensions.Present() { + if err := emergencyAreaIDCancelledNRItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDCancelledNRItem = EmergencyAreaIDCancelledNRItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&sliceSupportItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + if err := (&emergencyAreaIDCancelledNRItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + emergencyAreaIDCancelledNRItem.CancelledCellsInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI) + emergencyAreaIDCancelledNRItem.CancelledCellsInEAI = append(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI, make([]CancelledCellsInEAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, &emergencyAreaIDCancelledNRItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := emergencyAreaIDCancelledNRItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.Present()) - w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList != nil) - w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList != nil) - w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP != nil) - w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions != nil) - if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.RRCContainer.MarshalPER(w, enc); err != nil { - return err - } - if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList != nil { - if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList.MarshalPER(w, enc); err != nil { - return err - } - } - if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList != nil { - if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList.MarshalPER(w, enc); err != nil { - return err +var extIEsEmergencyAreaIDCancelledNRItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDCancelledNRItem] + +func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDCancelledNRItem.CancelledCellsInEAI { + if emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[i].Diagnose(d) { + notComprehended = true } } - if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem.iEExtensions) + return notComprehended +} + +func (emergencyFallbackIndicator *EmergencyFallbackIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, emergencyFallbackIndicator.iEExtensions) + w.WriteBit(emergencyFallbackIndicator.extensions.Present()) + w.WriteBit(emergencyFallbackIndicator.EmergencyServiceTargetCN != nil) + w.WriteBit(len(ext) > 0) + if err := emergencyFallbackIndicator.EmergencyFallbackRequestIndicator.MarshalPER(w, enc); err != nil { return err } - if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP != nil { - if err := (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP).MarshalPER(w, enc); err != nil { + if emergencyFallbackIndicator.EmergencyServiceTargetCN != nil { + if err := (*emergencyFallbackIndicator.EmergencyServiceTargetCN).MarshalPER(w, enc); err != nil { return err } } - if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation.MarshalPER(w, enc); err != nil { - return err - } - if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions != nil { - if err := (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.Present() { - if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.MarshalPER(w, enc); err != nil { + if emergencyFallbackIndicator.extensions.Present() { + if err := emergencyFallbackIndicator.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyFallbackIndicator *EmergencyFallbackIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyFallbackIndicator = EmergencyFallbackIndicator{} extBit, err := r.ReadBit() if err != nil { return err } - p_PDUSessionResourceInformationList, err := r.ReadBit() - if err != nil { - return err - } - p_ERABInformationList, err := r.ReadBit() - if err != nil { - return err - } - p_IndexToRFSP, err := r.ReadBit() + p_EmergencyServiceTargetCN, err := r.ReadBit() if err != nil { return err } @@ -8038,916 +9735,971 @@ func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTar if err != nil { return err } - if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.RRCContainer).UnmarshalPER(r, enc); err != nil { + if err := (&emergencyFallbackIndicator.EmergencyFallbackRequestIndicator).UnmarshalPER(r, enc); err != nil { return err } - if p_PDUSessionResourceInformationList { - if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList).UnmarshalPER(r, enc); err != nil { + if p_EmergencyServiceTargetCN { + var v EmergencyServiceTargetCN + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + emergencyFallbackIndicator.EmergencyServiceTargetCN = &v } - if p_ERABInformationList { - if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, &emergencyFallbackIndicator.iEExtensions); err != nil { return err } } - if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID).UnmarshalPER(r, enc); err != nil { - return err - } - if p_IndexToRFSP { - var v IndexToRFSP - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP = &v - } - if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation).UnmarshalPER(r, enc); err != nil { - return err - } - if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions = &v - } - if extBit { - if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.UnmarshalPER(r, enc); err != nil { + if extBit { + if err := emergencyFallbackIndicator.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil) - w.WriteBit(sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN != nil) - w.WriteBit(sourceToTargetAMFInformationReroute.RejectedNSSAIinTA != nil) - w.WriteBit(false) - if sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil { - if err := (*sourceToTargetAMFInformationReroute.ConfiguredNSSAI).MarshalPER(w, enc); err != nil { - return err - } - } - if sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN != nil { - if err := (*sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN).MarshalPER(w, enc); err != nil { - return err - } +var extIEsEmergencyFallbackIndicator []ap.IESpec[ProtocolIEID, EmergencyFallbackIndicator] + +func (emergencyFallbackIndicator *EmergencyFallbackIndicator) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if emergencyFallbackIndicator.EmergencyFallbackRequestIndicator.Diagnose(d) { + notComprehended = true } - if sourceToTargetAMFInformationReroute.RejectedNSSAIinTA != nil { - if err := (*sourceToTargetAMFInformationReroute.RejectedNSSAIinTA).MarshalPER(w, enc); err != nil { - return err - } + if emergencyFallbackIndicator.EmergencyServiceTargetCN != nil && emergencyFallbackIndicator.EmergencyServiceTargetCN.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, emergencyFallbackIndicator.iEExtensions) + return notComprehended } -func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (emergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEmergencyFallbackRequestIndicator.Encode(w, enc, emergencyFallbackRequestIndicator) +} + +func (emergencyFallbackRequestIndicator *EmergencyFallbackRequestIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEmergencyFallbackRequestIndicator.Decode(r, enc) if err != nil { return err } - p_ConfiguredNSSAI, err := r.ReadBit() + *emergencyFallbackRequestIndicator = v + return nil +} + +func (emergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator) Name() string { + return enumEmergencyFallbackRequestIndicator.Name(emergencyFallbackRequestIndicator) +} + +func (emergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEmergencyFallbackRequestIndicator.Known(emergencyFallbackRequestIndicator) +} + +func (emergencyServiceTargetCN EmergencyServiceTargetCN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEmergencyServiceTargetCN.Encode(w, enc, emergencyServiceTargetCN) +} + +func (emergencyServiceTargetCN *EmergencyServiceTargetCN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEmergencyServiceTargetCN.Decode(r, enc) if err != nil { return err } - p_RejectedNSSAIinPLMN, err := r.ReadBit() + *emergencyServiceTargetCN = v + return nil +} + +func (emergencyServiceTargetCN EmergencyServiceTargetCN) Name() string { + return enumEmergencyServiceTargetCN.Name(emergencyServiceTargetCN) +} + +func (emergencyServiceTargetCN EmergencyServiceTargetCN) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEmergencyServiceTargetCN.Known(emergencyServiceTargetCN) +} + +func (endIndication EndIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEndIndication.Encode(w, enc, endIndication) +} + +func (endIndication *EndIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEndIndication.Decode(r, enc) if err != nil { return err } - p_RejectedNSSAIinTA, err := r.ReadBit() - if err != nil { + *endIndication = v + return nil +} + +func (endIndication EndIndication) Name() string { + return enumEndIndication.Name(endIndication) +} + +func (endIndication EndIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEndIndication.Known(endIndication) +} + +func (endpointIPAddressAndPort *EndpointIPAddressAndPort) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, endpointIPAddressAndPort.iEExtensions) + w.WriteBit(len(ext) > 0) + if err := endpointIPAddressAndPort.EndpointIPAddress.MarshalPER(w, enc); err != nil { return err } - p_f3, err := r.ReadBit() - if err != nil { + if err := endpointIPAddressAndPort.PortNumber.MarshalPER(w, enc); err != nil { return err } - if p_ConfiguredNSSAI { - var v ConfiguredNSSAI - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - sourceToTargetAMFInformationReroute.ConfiguredNSSAI = &v } - if p_RejectedNSSAIinPLMN { - var v RejectedNSSAIinPLMN - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN = &v + return nil +} + +func (endpointIPAddressAndPort *EndpointIPAddressAndPort) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *endpointIPAddressAndPort = EndpointIPAddressAndPort{} + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err } - if p_RejectedNSSAIinTA { - var v RejectedNSSAIinTA - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - sourceToTargetAMFInformationReroute.RejectedNSSAIinTA = &v + if err := (&endpointIPAddressAndPort.EndpointIPAddress).UnmarshalPER(r, enc); err != nil { + return err } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - _ = v + if err := (&endpointIPAddressAndPort.PortNumber).UnmarshalPER(r, enc); err != nil { + return err } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, &endpointIPAddressAndPort.iEExtensions); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { +var extIEsEndpointIPAddressAndPort []ap.IESpec[ProtocolIEID, EndpointIPAddressAndPort] + +func (endpointIPAddressAndPort *EndpointIPAddressAndPort) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, endpointIPAddressAndPort.iEExtensions) + return notComprehended +} + +func (enhancedCoverageRestriction EnhancedCoverageRestriction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEnhancedCoverageRestriction.Encode(w, enc, enhancedCoverageRestriction) +} + +func (enhancedCoverageRestriction *EnhancedCoverageRestriction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEnhancedCoverageRestriction.Decode(r, enc) + if err != nil { return err } - if err := supportedTAItem.BroadcastPLMNList.MarshalPER(w, enc); err != nil { + *enhancedCoverageRestriction = v + return nil +} + +func (enhancedCoverageRestriction EnhancedCoverageRestriction) Name() string { + return enumEnhancedCoverageRestriction.Name(enhancedCoverageRestriction) +} + +func (enhancedCoverageRestriction EnhancedCoverageRestriction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEnhancedCoverageRestriction.Known(enhancedCoverageRestriction) +} + +func (equivalentSNPNsItem *EquivalentSNPNsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEquivalentSNPNsItem, equivalentSNPNsItem, equivalentSNPNsItem.iEExtensions) + w.WriteBit(equivalentSNPNsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := equivalentSNPNsItem.PlmnIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := equivalentSNPNsItem.NID.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if equivalentSNPNsItem.extensions.Present() { + if err := equivalentSNPNsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (equivalentSNPNsItem *EquivalentSNPNsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *equivalentSNPNsItem = EquivalentSNPNsItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&supportedTAItem.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&equivalentSNPNsItem.PlmnIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&supportedTAItem.BroadcastPLMNList).UnmarshalPER(r, enc); err != nil { + if err := (&equivalentSNPNsItem.NID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEquivalentSNPNsItem, equivalentSNPNsItem, &equivalentSNPNsItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := equivalentSNPNsItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { +var extIEsEquivalentSNPNsItem []ap.IESpec[ProtocolIEID, EquivalentSNPNsItem] + +func (equivalentSNPNsItem *EquivalentSNPNsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsEquivalentSNPNsItem, equivalentSNPNsItem, equivalentSNPNsItem.iEExtensions) + return notComprehended +} + +func (eventBasedReportingIEs *EventBasedReportingIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEventBasedReportingIEs, eventBasedReportingIEs, eventBasedReportingIEs.iEExtensions) + w.WriteBit(eventBasedReportingIEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eventBasedReportingIEs.IntersystemResourceThresholdLow.MarshalPER(w, enc); err != nil { return err } - if err := tAI.TAC.MarshalPER(w, enc); err != nil { + if err := eventBasedReportingIEs.IntersystemResourceThresholdHigh.MarshalPER(w, enc); err != nil { + return err + } + if err := eventBasedReportingIEs.NumberOfMeasurementReportingLevels.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eventBasedReportingIEs.extensions.Present() { + if err := eventBasedReportingIEs.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eventBasedReportingIEs *EventBasedReportingIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eventBasedReportingIEs = EventBasedReportingIEs{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&tAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eventBasedReportingIEs.IntersystemResourceThresholdLow).UnmarshalPER(r, enc); err != nil { return err } - if err := (&tAI.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&eventBasedReportingIEs.IntersystemResourceThresholdHigh).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&eventBasedReportingIEs.NumberOfMeasurementReportingLevels).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEventBasedReportingIEs, eventBasedReportingIEs, &eventBasedReportingIEs.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eventBasedReportingIEs.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAIBroadcastEUTRAItem.TAI.MarshalPER(w, enc); err != nil { +var extIEsEventBasedReportingIEs []ap.IESpec[ProtocolIEID, EventBasedReportingIEs] + +func (eventBasedReportingIEs *EventBasedReportingIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eventBasedReportingIEs.NumberOfMeasurementReportingLevels.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsEventBasedReportingIEs, eventBasedReportingIEs, eventBasedReportingIEs.iEExtensions) + return notComprehended +} + +func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, eventL1LoggedMDTConfig.iEExtensions) + w.WriteBit(eventL1LoggedMDTConfig.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eventL1LoggedMDTConfig.L1Threshold.MarshalPER(w, enc); err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastEUTRAItem.CompletedCellsInTAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := tAIBroadcastEUTRAItem.CompletedCellsInTAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { + if err := eventL1LoggedMDTConfig.Hysteresis.MarshalPER(w, enc); err != nil { + return err + } + if err := eventL1LoggedMDTConfig.TimeToTrigger.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eventL1LoggedMDTConfig.extensions.Present() { + if err := eventL1LoggedMDTConfig.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eventL1LoggedMDTConfig = EventL1LoggedMDTConfig{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&tAIBroadcastEUTRAItem.TAI).UnmarshalPER(r, enc); err != nil { + if err := (&eventL1LoggedMDTConfig.L1Threshold).UnmarshalPER(r, enc); err != nil { return err } - tAIBroadcastEUTRAItem.CompletedCellsInTAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(tAIBroadcastEUTRAItem.CompletedCellsInTAI) - tAIBroadcastEUTRAItem.CompletedCellsInTAI = append(tAIBroadcastEUTRAItem.CompletedCellsInTAI, make([]CompletedCellsInTAIEUTRAItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&tAIBroadcastEUTRAItem.CompletedCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&eventL1LoggedMDTConfig.Hysteresis).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&eventL1LoggedMDTConfig.TimeToTrigger).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, &eventL1LoggedMDTConfig.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eventL1LoggedMDTConfig.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (tAIBroadcastNRItem *TAIBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAIBroadcastNRItem.TAI.MarshalPER(w, enc); err != nil { - return err +var extIEsEventL1LoggedMDTConfig []ap.IESpec[ProtocolIEID, EventL1LoggedMDTConfig] + +func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eventL1LoggedMDTConfig.L1Threshold.Diagnose(d) { + notComprehended = true } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastNRItem.CompletedCellsInTAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := tAIBroadcastNRItem.CompletedCellsInTAI[i].MarshalPER(w, enc); err != nil { - return err - } + ap.DiagnoseExtensions(d, extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, eventL1LoggedMDTConfig.iEExtensions) + return notComprehended +} + +func (eventTrigger *EventTrigger) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{eventTrigger.OutOfCoverage != nil, eventTrigger.EventL1LoggedMDTConfig != nil, eventTrigger.ChoiceExtension != nil} { + if ok { + set++ } - off1 = end - return nil - }); err != nil { - return err + } + if set > 1 { + return per.ErrChoice + } + switch { + case eventTrigger.OutOfCoverage != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*eventTrigger.OutOfCoverage).MarshalPER(w, enc); err != nil { + return err + } + case eventTrigger.EventL1LoggedMDTConfig != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*eventTrigger.EventL1LoggedMDTConfig).MarshalPER(w, enc); err != nil { + return err + } + case eventTrigger.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, eventTrigger.ChoiceExtension.Field()) + default: + return per.ErrEmpty } return nil } -func (tAIBroadcastNRItem *TAIBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (eventTrigger *EventTrigger) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eventTrigger = EventTrigger{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&tAIBroadcastNRItem.TAI).UnmarshalPER(r, enc); err != nil { - return err - } - tAIBroadcastNRItem.CompletedCellsInTAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(tAIBroadcastNRItem.CompletedCellsInTAI) - tAIBroadcastNRItem.CompletedCellsInTAI = append(tAIBroadcastNRItem.CompletedCellsInTAI, make([]CompletedCellsInTAINRItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&tAIBroadcastNRItem.CompletedCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } + switch idx { + case 0: + var v EventTriggerOutOfCoverage + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err } - return nil - }); err != nil { - return err - } - if p_f2 { - var v ieExtensions + eventTrigger.OutOfCoverage = &v + case 1: + var v EventL1LoggedMDTConfig if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + eventTrigger.EventL1LoggedMDTConfig = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + switch f.ID { + default: + eventTrigger.ChoiceExtension = &f } + default: + return per.ErrOverflow } return nil } -func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAICancelledEUTRAItem.TAI.MarshalPER(w, enc); err != nil { - return err - } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledEUTRAItem.CancelledCellsInTAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := tAICancelledEUTRAItem.CancelledCellsInTAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { - return err +func (eventTrigger *EventTrigger) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case eventTrigger.OutOfCoverage != nil: + return eventTrigger.OutOfCoverage.Diagnose(d) + case eventTrigger.EventL1LoggedMDTConfig != nil: + return eventTrigger.EventL1LoggedMDTConfig.Diagnose(d) + case eventTrigger.ChoiceExtension != nil: + d.Unknown(eventTrigger.ChoiceExtension.ID, eventTrigger.ChoiceExtension.Criticality) } - return nil + return false } -func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (eventTriggerOutOfCoverage EventTriggerOutOfCoverage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEventTriggerOutOfCoverage.Encode(w, enc, eventTriggerOutOfCoverage) +} + +func (eventTriggerOutOfCoverage *EventTriggerOutOfCoverage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEventTriggerOutOfCoverage.Decode(r, enc) if err != nil { return err } - p_f2, err := r.ReadBit() + *eventTriggerOutOfCoverage = v + return nil +} + +func (eventTriggerOutOfCoverage EventTriggerOutOfCoverage) Name() string { + return enumEventTriggerOutOfCoverage.Name(eventTriggerOutOfCoverage) +} + +func (eventTriggerOutOfCoverage EventTriggerOutOfCoverage) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEventTriggerOutOfCoverage.Known(eventTriggerOutOfCoverage) +} + +func (eventType EventType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEventType.Encode(w, enc, eventType) +} + +func (eventType *EventType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEventType.Decode(r, enc) if err != nil { return err } - if err := (&tAICancelledEUTRAItem.TAI).UnmarshalPER(r, enc); err != nil { + *eventType = v + return nil +} + +func (eventType EventType) Name() string { + return enumEventType.Name(eventType) +} + +func (eventType EventType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEventType.Known(eventType) +} + +func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, excessPacketDelayThresholdItem.iEExtensions) + w.WriteBit(excessPacketDelayThresholdItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := excessPacketDelayThresholdItem.FiveQi.MarshalPER(w, enc); err != nil { return err } - tAICancelledEUTRAItem.CancelledCellsInTAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(tAICancelledEUTRAItem.CancelledCellsInTAI) - tAICancelledEUTRAItem.CancelledCellsInTAI = append(tAICancelledEUTRAItem.CancelledCellsInTAI, make([]CancelledCellsInTAIEUTRAItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&tAICancelledEUTRAItem.CancelledCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := excessPacketDelayThresholdItem.ExcessPacketDelayThresholdValue.MarshalPER(w, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if excessPacketDelayThresholdItem.extensions.Present() { + if err := excessPacketDelayThresholdItem.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - -func (tAICancelledNRItem *TAICancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAICancelledNRItem.TAI.MarshalPER(w, enc); err != nil { - return err - } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledNRItem.CancelledCellsInTAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := tAICancelledNRItem.CancelledCellsInTAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { - return err } return nil } -func (tAICancelledNRItem *TAICancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *excessPacketDelayThresholdItem = ExcessPacketDelayThresholdItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&tAICancelledNRItem.TAI).UnmarshalPER(r, enc); err != nil { + if err := (&excessPacketDelayThresholdItem.FiveQi).UnmarshalPER(r, enc); err != nil { return err } - tAICancelledNRItem.CancelledCellsInTAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(tAICancelledNRItem.CancelledCellsInTAI) - tAICancelledNRItem.CancelledCellsInTAI = append(tAICancelledNRItem.CancelledCellsInTAI, make([]CancelledCellsInTAINRItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&tAICancelledNRItem.CancelledCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&excessPacketDelayThresholdItem.ExcessPacketDelayThresholdValue).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, &excessPacketDelayThresholdItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := excessPacketDelayThresholdItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (tNLAssociationItem *TNLAssociationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(tNLAssociationItem.extensions.Present()) - w.WriteBit(tNLAssociationItem.iEExtensions != nil) - if err := tNLAssociationItem.TNLAssociationAddress.MarshalPER(w, enc); err != nil { +var extIEsExcessPacketDelayThresholdItem []ap.IESpec[ProtocolIEID, ExcessPacketDelayThresholdItem] + +func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if excessPacketDelayThresholdItem.FiveQi.Diagnose(d) { + notComprehended = true + } + if excessPacketDelayThresholdItem.ExcessPacketDelayThresholdValue.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, excessPacketDelayThresholdItem.iEExtensions) + return notComprehended +} + +func (excessPacketDelayThresholdValue ExcessPacketDelayThresholdValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumExcessPacketDelayThresholdValue.Encode(w, enc, excessPacketDelayThresholdValue) +} + +func (excessPacketDelayThresholdValue *ExcessPacketDelayThresholdValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumExcessPacketDelayThresholdValue.Decode(r, enc) + if err != nil { return err } - if err := tNLAssociationItem.Cause.MarshalPER(w, enc); err != nil { + *excessPacketDelayThresholdValue = v + return nil +} + +func (excessPacketDelayThresholdValue ExcessPacketDelayThresholdValue) Name() string { + return enumExcessPacketDelayThresholdValue.Name(excessPacketDelayThresholdValue) +} + +func (excessPacketDelayThresholdValue ExcessPacketDelayThresholdValue) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumExcessPacketDelayThresholdValue.Known(excessPacketDelayThresholdValue) +} + +func (expectedHOInterval ExpectedHOInterval) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumExpectedHOInterval.Encode(w, enc, expectedHOInterval) +} + +func (expectedHOInterval *ExpectedHOInterval) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumExpectedHOInterval.Decode(r, enc) + if err != nil { return err } - if tNLAssociationItem.iEExtensions != nil { - if err := (*tNLAssociationItem.iEExtensions).MarshalPER(w, enc); err != nil { + *expectedHOInterval = v + return nil +} + +func (expectedHOInterval ExpectedHOInterval) Name() string { + return enumExpectedHOInterval.Name(expectedHOInterval) +} + +func (expectedHOInterval ExpectedHOInterval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumExpectedHOInterval.Known(expectedHOInterval) +} + +func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, expectedUEActivityBehaviour.iEExtensions) + w.WriteBit(expectedUEActivityBehaviour.extensions.Present()) + w.WriteBit(expectedUEActivityBehaviour.ExpectedActivityPeriod != nil) + w.WriteBit(expectedUEActivityBehaviour.ExpectedIdlePeriod != nil) + w.WriteBit(expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation != nil) + w.WriteBit(len(ext) > 0) + if expectedUEActivityBehaviour.ExpectedActivityPeriod != nil { + if err := (*expectedUEActivityBehaviour.ExpectedActivityPeriod).MarshalPER(w, enc); err != nil { return err } } - if tNLAssociationItem.extensions.Present() { - if err := tNLAssociationItem.extensions.MarshalPER(w, enc); err != nil { + if expectedUEActivityBehaviour.ExpectedIdlePeriod != nil { + if err := (*expectedUEActivityBehaviour.ExpectedIdlePeriod).MarshalPER(w, enc); err != nil { + return err + } + } + if expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation != nil { + if err := (*expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if expectedUEActivityBehaviour.extensions.Present() { + if err := expectedUEActivityBehaviour.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (tNLAssociationItem *TNLAssociationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *expectedUEActivityBehaviour = ExpectedUEActivityBehaviour{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_ExpectedActivityPeriod, err := r.ReadBit() if err != nil { return err } - if err := (&tNLAssociationItem.TNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + p_ExpectedIdlePeriod, err := r.ReadBit() + if err != nil { return err } - if err := (&tNLAssociationItem.Cause).UnmarshalPER(r, enc); err != nil { + p_SourceOfUEActivityBehaviourInformation, err := r.ReadBit() + if err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_ExpectedActivityPeriod { + var v ExpectedActivityPeriod + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEActivityBehaviour.ExpectedActivityPeriod = &v + } + if p_ExpectedIdlePeriod { + var v ExpectedIdlePeriod + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEActivityBehaviour.ExpectedIdlePeriod = &v + } + if p_SourceOfUEActivityBehaviourInformation { + var v SourceOfUEActivityBehaviourInformation if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - tNLAssociationItem.iEExtensions = &v + expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, &expectedUEActivityBehaviour.iEExtensions); err != nil { + return err + } } if extBit { - if err := tNLAssociationItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := expectedUEActivityBehaviour.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (targetRANNodeID *TargetRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := targetRANNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { - return err +var extIEsExpectedUEActivityBehaviour []ap.IESpec[ProtocolIEID, ExpectedUEActivityBehaviour] + +func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if expectedUEActivityBehaviour.ExpectedActivityPeriod != nil && expectedUEActivityBehaviour.ExpectedActivityPeriod.Diagnose(d) { + notComprehended = true } - if err := targetRANNodeID.SelectedTAI.MarshalPER(w, enc); err != nil { - return err + if expectedUEActivityBehaviour.ExpectedIdlePeriod != nil && expectedUEActivityBehaviour.ExpectedIdlePeriod.Diagnose(d) { + notComprehended = true } - return nil + if expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation != nil && expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, expectedUEActivityBehaviour.iEExtensions) + return notComprehended } -func (targetRANNodeID *TargetRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { - return err +func (expectedUEBehaviour *ExpectedUEBehaviour) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsExpectedUEBehaviour, expectedUEBehaviour, expectedUEBehaviour.iEExtensions) + w.WriteBit(expectedUEBehaviour.extensions.Present()) + w.WriteBit(expectedUEBehaviour.ExpectedUEActivityBehaviour != nil) + w.WriteBit(expectedUEBehaviour.ExpectedHOInterval != nil) + w.WriteBit(expectedUEBehaviour.ExpectedUEMobility != nil) + w.WriteBit(expectedUEBehaviour.ExpectedUEMovingTrajectory != nil) + w.WriteBit(len(ext) > 0) + if expectedUEBehaviour.ExpectedUEActivityBehaviour != nil { + if err := (*expectedUEBehaviour.ExpectedUEActivityBehaviour).MarshalPER(w, enc); err != nil { + return err + } } - if err := (&targetRANNodeID.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { - return err + if expectedUEBehaviour.ExpectedHOInterval != nil { + if err := (*expectedUEBehaviour.ExpectedHOInterval).MarshalPER(w, enc); err != nil { + return err + } } - if err := (&targetRANNodeID.SelectedTAI).UnmarshalPER(r, enc); err != nil { - return err + if expectedUEBehaviour.ExpectedUEMobility != nil { + if err := (*expectedUEBehaviour.ExpectedUEMobility).MarshalPER(w, enc); err != nil { + return err + } } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if expectedUEBehaviour.ExpectedUEMovingTrajectory != nil { + if err := expectedUEBehaviour.ExpectedUEMovingTrajectory.MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if expectedUEBehaviour.extensions.Present() { + if err := expectedUEBehaviour.extensions.MarshalPER(w, enc); err != nil { + return err } } return nil } -func (targetRANNodeIDSON *TargetRANNodeIDSON) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := targetRANNodeIDSON.GlobalRANNodeID.MarshalPER(w, enc); err != nil { +func (expectedUEBehaviour *ExpectedUEBehaviour) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *expectedUEBehaviour = ExpectedUEBehaviour{} + extBit, err := r.ReadBit() + if err != nil { return err } - if err := targetRANNodeIDSON.SelectedTAI.MarshalPER(w, enc); err != nil { + p_ExpectedUEActivityBehaviour, err := r.ReadBit() + if err != nil { return err } - return nil -} - -func (targetRANNodeIDSON *TargetRANNodeIDSON) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() + p_ExpectedHOInterval, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_ExpectedUEMobility, err := r.ReadBit() if err != nil { return err } - if err := (&targetRANNodeIDSON.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { + p_ExpectedUEMovingTrajectory, err := r.ReadBit() + if err != nil { return err } - if err := (&targetRANNodeIDSON.SelectedTAI).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if p_f2 { - var v ieExtensions + if p_ExpectedUEActivityBehaviour { + var v ExpectedUEActivityBehaviour if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + expectedUEBehaviour.ExpectedUEActivityBehaviour = &v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_ExpectedHOInterval { + var v ExpectedHOInterval + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + expectedUEBehaviour.ExpectedHOInterval = &v + } + if p_ExpectedUEMobility { + var v ExpectedUEMobility + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEBehaviour.ExpectedUEMobility = &v + } + if p_ExpectedUEMovingTrajectory { + if err := (&expectedUEBehaviour.ExpectedUEMovingTrajectory).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEBehaviour, expectedUEBehaviour, &expectedUEBehaviour.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := expectedUEBehaviour.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } -func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := targeteNBID.GlobalENBID.MarshalPER(w, enc); err != nil { - return err +var extIEsExpectedUEBehaviour []ap.IESpec[ProtocolIEID, ExpectedUEBehaviour] + +func (expectedUEBehaviour *ExpectedUEBehaviour) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if expectedUEBehaviour.ExpectedUEActivityBehaviour != nil && expectedUEBehaviour.ExpectedUEActivityBehaviour.Diagnose(d) { + notComprehended = true } - if err := targeteNBID.SelectedEPSTAI.MarshalPER(w, enc); err != nil { - return err + if expectedUEBehaviour.ExpectedHOInterval != nil && expectedUEBehaviour.ExpectedHOInterval.Diagnose(d) { + notComprehended = true } - return nil + if expectedUEBehaviour.ExpectedUEMobility != nil && expectedUEBehaviour.ExpectedUEMobility.Diagnose(d) { + notComprehended = true + } + if expectedUEBehaviour.ExpectedUEMovingTrajectory.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsExpectedUEBehaviour, expectedUEBehaviour, expectedUEBehaviour.iEExtensions) + return notComprehended } -func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() +func (expectedUEMobility ExpectedUEMobility) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumExpectedUEMobility.Encode(w, enc, expectedUEMobility) +} + +func (expectedUEMobility *ExpectedUEMobility) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumExpectedUEMobility.Decode(r, enc) if err != nil { return err } - if err := (&targeteNBID.GlobalENBID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&targeteNBID.SelectedEPSTAI).UnmarshalPER(r, enc); err != nil { + *expectedUEMobility = v + return nil +} + +func (expectedUEMobility ExpectedUEMobility) Name() string { + return enumExpectedUEMobility.Name(expectedUEMobility) +} + +func (expectedUEMobility ExpectedUEMobility) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumExpectedUEMobility.Known(expectedUEMobility) +} + +func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem.iEExtensions) + w.WriteBit(expectedUEMovingTrajectoryItem.extensions.Present()) + w.WriteBit(expectedUEMovingTrajectoryItem.TimeStayedInCell != nil) + w.WriteBit(len(ext) > 0) + if err := expectedUEMovingTrajectoryItem.NGRANCGI.MarshalPER(w, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if expectedUEMovingTrajectoryItem.TimeStayedInCell != nil { + if err := (*expectedUEMovingTrajectoryItem.TimeStayedInCell).MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } - return nil -} - -func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := uEAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { - return err - } - if err := uEAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { - return err + if expectedUEMovingTrajectoryItem.extensions.Present() { + if err := expectedUEMovingTrajectoryItem.extensions.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *expectedUEMovingTrajectoryItem = ExpectedUEMovingTrajectoryItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_TimeStayedInCell, err := r.ReadBit() if err != nil { return err } - if err := (&uEAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&uEAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { + if err := (&expectedUEMovingTrajectoryItem.NGRANCGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_TimeStayedInCell { + var v ExpectedUEMovingTrajectoryItemTimeStayedInCell if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + expectedUEMovingTrajectoryItem.TimeStayedInCell = &v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, &expectedUEMovingTrajectoryItem.iEExtensions); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if extBit { + if err := expectedUEMovingTrajectoryItem.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } -func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(uEAssociatedLogicalNGConnectionItem.extensions.Present()) - w.WriteBit(uEAssociatedLogicalNGConnectionItem.AMFUENGAPID != nil) - w.WriteBit(uEAssociatedLogicalNGConnectionItem.RANUENGAPID != nil) - w.WriteBit(uEAssociatedLogicalNGConnectionItem.iEExtensions != nil) - if uEAssociatedLogicalNGConnectionItem.AMFUENGAPID != nil { - if err := (*uEAssociatedLogicalNGConnectionItem.AMFUENGAPID).MarshalPER(w, enc); err != nil { +var extIEsExpectedUEMovingTrajectoryItem []ap.IESpec[ProtocolIEID, ExpectedUEMovingTrajectoryItem] + +func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if expectedUEMovingTrajectoryItem.NGRANCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem.iEExtensions) + return notComprehended +} + +func (extendedAMFName *ExtendedAMFName) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsExtendedAMFName, extendedAMFName, extendedAMFName.iEExtensions) + w.WriteBit(extendedAMFName.extensions.Present()) + w.WriteBit(extendedAMFName.AMFNameVisibleString != nil) + w.WriteBit(extendedAMFName.AMFNameUTF8String != nil) + w.WriteBit(len(ext) > 0) + if extendedAMFName.AMFNameVisibleString != nil { + if err := (*extendedAMFName.AMFNameVisibleString).MarshalPER(w, enc); err != nil { return err } } - if uEAssociatedLogicalNGConnectionItem.RANUENGAPID != nil { - if err := (*uEAssociatedLogicalNGConnectionItem.RANUENGAPID).MarshalPER(w, enc); err != nil { + if extendedAMFName.AMFNameUTF8String != nil { + if err := (*extendedAMFName.AMFNameUTF8String).MarshalPER(w, enc); err != nil { return err } } - if uEAssociatedLogicalNGConnectionItem.iEExtensions != nil { - if err := (*uEAssociatedLogicalNGConnectionItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if uEAssociatedLogicalNGConnectionItem.extensions.Present() { - if err := uEAssociatedLogicalNGConnectionItem.extensions.MarshalPER(w, enc); err != nil { + if extendedAMFName.extensions.Present() { + if err := extendedAMFName.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (extendedAMFName *ExtendedAMFName) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *extendedAMFName = ExtendedAMFName{} extBit, err := r.ReadBit() if err != nil { return err } - p_AMFUENGAPID, err := r.ReadBit() + p_AMFNameVisibleString, err := r.ReadBit() if err != nil { return err } - p_RANUENGAPID, err := r.ReadBit() + p_AMFNameUTF8String, err := r.ReadBit() if err != nil { return err } @@ -8955,203 +10707,148 @@ func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) if err != nil { return err } - if p_AMFUENGAPID { - var v AMFUENGAPID + if p_AMFNameVisibleString { + var v AMFNameVisibleString if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - uEAssociatedLogicalNGConnectionItem.AMFUENGAPID = &v + extendedAMFName.AMFNameVisibleString = &v } - if p_RANUENGAPID { - var v RANUENGAPID + if p_AMFNameUTF8String { + var v AMFNameUTF8String if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - uEAssociatedLogicalNGConnectionItem.RANUENGAPID = &v + extendedAMFName.AMFNameUTF8String = &v } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExtendedAMFName, extendedAMFName, &extendedAMFName.iEExtensions); err != nil { return err } - uEAssociatedLogicalNGConnectionItem.iEExtensions = &v } if extBit { - if err := uEAssociatedLogicalNGConnectionItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := extendedAMFName.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := uEPresenceInAreaOfInterestItem.LocationReportingReferenceID.MarshalPER(w, enc); err != nil { - return err - } - if err := encodeRootEnumerated(w, enc, 3, int64(uEPresenceInAreaOfInterestItem.UEPresence), "UEPresence"); err != nil { - return err - } - return nil +var extIEsExtendedAMFName []ap.IESpec[ProtocolIEID, ExtendedAMFName] + +func (extendedAMFName *ExtendedAMFName) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsExtendedAMFName, extendedAMFName, extendedAMFName.iEExtensions) + return notComprehended } -func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() - if err != nil { - return err - } - if err := (&uEPresenceInAreaOfInterestItem.LocationReportingReferenceID).UnmarshalPER(r, enc); err != nil { - return err - } - e1, err := decodeRootEnumerated(r, enc, 3, "UEPresence") - if err != nil { - return err - } - uEPresenceInAreaOfInterestItem.UEPresence = UEPresence(e1) - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { +func (extendedRANNodeName *ExtendedRANNodeName) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsExtendedRANNodeName, extendedRANNodeName, extendedRANNodeName.iEExtensions) + w.WriteBit(extendedRANNodeName.extensions.Present()) + w.WriteBit(extendedRANNodeName.RANNodeNameVisibleString != nil) + w.WriteBit(extendedRANNodeName.RANNodeNameUTF8String != nil) + w.WriteBit(len(ext) > 0) + if extendedRANNodeName.RANNodeNameVisibleString != nil { + if err := (*extendedRANNodeName.RANNodeNameVisibleString).MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if extendedRANNodeName.RANNodeNameUTF8String != nil { + if err := (*extendedRANNodeName.RANNodeNameUTF8String).MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } - return nil -} - -func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(uERadioCapabilityForPaging.NR != nil) - w.WriteBit(uERadioCapabilityForPaging.EUTRA != nil) - w.WriteBit(false) - if uERadioCapabilityForPaging.NR != nil { - if err := (*uERadioCapabilityForPaging.NR).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if uERadioCapabilityForPaging.EUTRA != nil { - if err := (*uERadioCapabilityForPaging.EUTRA).MarshalPER(w, enc); err != nil { + if extendedRANNodeName.extensions.Present() { + if err := extendedRANNodeName.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (extendedRANNodeName *ExtendedRANNodeName) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *extendedRANNodeName = ExtendedRANNodeName{} extBit, err := r.ReadBit() if err != nil { return err } - p_NR, err := r.ReadBit() + p_RANNodeNameVisibleString, err := r.ReadBit() if err != nil { return err } - p_EUTRA, err := r.ReadBit() + p_RANNodeNameUTF8String, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if p_NR { - var v UERadioCapabilityForPagingOfNR + if p_RANNodeNameVisibleString { + var v RANNodeNameVisibleString if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - uERadioCapabilityForPaging.NR = &v + extendedRANNodeName.RANNodeNameVisibleString = &v } - if p_EUTRA { - var v UERadioCapabilityForPagingOfEUTRA + if p_RANNodeNameUTF8String { + var v RANNodeNameUTF8String if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - uERadioCapabilityForPaging.EUTRA = &v + extendedRANNodeName.RANNodeNameUTF8String = &v } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExtendedRANNodeName, extendedRANNodeName, &extendedRANNodeName.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := extendedRANNodeName.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(uLNGUUPTNLModifyItemExtIEs, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions) - w.WriteBit(uLNGUUPTNLModifyItem.extensions.Present()) +var extIEsExtendedRANNodeName []ap.IESpec[ProtocolIEID, ExtendedRANNodeName] + +func (extendedRANNodeName *ExtendedRANNodeName) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsExtendedRANNodeName, extendedRANNodeName, extendedRANNodeName.iEExtensions) + return notComprehended +} + +func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, extendedRATRestrictionInformation.iEExtensions) + w.WriteBit(extendedRATRestrictionInformation.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := uLNGUUPTNLModifyItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + if err := extendedRATRestrictionInformation.PrimaryRATRestriction.MarshalPER(w, enc); err != nil { return err } - if err := uLNGUUPTNLModifyItem.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + if err := extendedRATRestrictionInformation.SecondaryRATRestriction.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if uLNGUUPTNLModifyItem.extensions.Present() { - if err := uLNGUUPTNLModifyItem.extensions.MarshalPER(w, enc); err != nil { + if extendedRATRestrictionInformation.extensions.Present() { + if err := extendedRATRestrictionInformation.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *extendedRATRestrictionInformation = ExtendedRATRestrictionInformation{} extBit, err := r.ReadBit() if err != nil { return err @@ -9160,204 +10857,613 @@ func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) UnmarshalPER(r *per.Reader, en if err != nil { return err } - if err := (&uLNGUUPTNLModifyItem.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&extendedRATRestrictionInformation.PrimaryRATRestriction).UnmarshalPER(r, enc); err != nil { return err } - if err := (&uLNGUUPTNLModifyItem.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + if err := (&extendedRATRestrictionInformation.SecondaryRATRestriction).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, uLNGUUPTNLModifyItemExtIEs, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, &extendedRATRestrictionInformation.iEExtensions); err != nil { return err } } if extBit { - if err := uLNGUUPTNLModifyItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := extendedRATRestrictionInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(uPTransportLayerInformationItem.extensions.Present()) - w.WriteBit(uPTransportLayerInformationItem.iEExtensions != nil) - if err := uPTransportLayerInformationItem.NGUUPTNLInformation.MarshalPER(w, enc); err != nil { +var extIEsExtendedRATRestrictionInformation []ap.IESpec[ProtocolIEID, ExtendedRATRestrictionInformation] + +func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, extendedRATRestrictionInformation.iEExtensions) + return notComprehended +} + +func (extendedReportIntervalMDT ExtendedReportIntervalMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumExtendedReportIntervalMDT.Encode(w, enc, extendedReportIntervalMDT) +} + +func (extendedReportIntervalMDT *ExtendedReportIntervalMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumExtendedReportIntervalMDT.Decode(r, enc) + if err != nil { return err } - if uPTransportLayerInformationItem.iEExtensions != nil { - if err := (*uPTransportLayerInformationItem.iEExtensions).MarshalPER(w, enc); err != nil { + *extendedReportIntervalMDT = v + return nil +} + +func (extendedReportIntervalMDT ExtendedReportIntervalMDT) Name() string { + return enumExtendedReportIntervalMDT.Name(extendedReportIntervalMDT) +} + +func (extendedReportIntervalMDT ExtendedReportIntervalMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumExtendedReportIntervalMDT.Known(extendedReportIntervalMDT) +} + +func (fiveGProSeAuthorized *FiveGProSeAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, fiveGProSeAuthorized.iEExtensions) + w.WriteBit(fiveGProSeAuthorized.extensions.Present()) + w.WriteBit(fiveGProSeAuthorized.FiveGProSeDirectDiscovery != nil) + w.WriteBit(fiveGProSeAuthorized.FiveGProSeDirectCommunication != nil) + w.WriteBit(fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay != nil) + w.WriteBit(fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay != nil) + w.WriteBit(fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE != nil) + w.WriteBit(len(ext) > 0) + if fiveGProSeAuthorized.FiveGProSeDirectDiscovery != nil { + if err := (*fiveGProSeAuthorized.FiveGProSeDirectDiscovery).MarshalPER(w, enc); err != nil { return err } } - if uPTransportLayerInformationItem.extensions.Present() { - if err := uPTransportLayerInformationItem.extensions.MarshalPER(w, enc); err != nil { + if fiveGProSeAuthorized.FiveGProSeDirectCommunication != nil { + if err := (*fiveGProSeAuthorized.FiveGProSeDirectCommunication).MarshalPER(w, enc); err != nil { return err } } - return nil -} - -func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err - } - if err := (&uPTransportLayerInformationItem.NGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { - return err - } - if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay != nil { + if err := (*fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay).MarshalPER(w, enc); err != nil { return err } - uPTransportLayerInformationItem.iEExtensions = &v } - if extBit { - if err := uPTransportLayerInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + if fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay != nil { + if err := (*fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay).MarshalPER(w, enc); err != nil { return err } } - return nil -} - -func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(uPTransportLayerInformationPairItem.extensions.Present()) - w.WriteBit(uPTransportLayerInformationPairItem.iEExtensions != nil) - if err := uPTransportLayerInformationPairItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { - return err - } - if err := uPTransportLayerInformationPairItem.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { - return err + if fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE != nil { + if err := (*fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE).MarshalPER(w, enc); err != nil { + return err + } } - if uPTransportLayerInformationPairItem.iEExtensions != nil { - if err := (*uPTransportLayerInformationPairItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if uPTransportLayerInformationPairItem.extensions.Present() { - if err := uPTransportLayerInformationPairItem.extensions.MarshalPER(w, enc); err != nil { + if fiveGProSeAuthorized.extensions.Present() { + if err := fiveGProSeAuthorized.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (fiveGProSeAuthorized *FiveGProSeAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fiveGProSeAuthorized = FiveGProSeAuthorized{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_FiveGProSeDirectDiscovery, err := r.ReadBit() if err != nil { return err } - if err := (&uPTransportLayerInformationPairItem.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + p_FiveGProSeDirectCommunication, err := r.ReadBit() + if err != nil { return err } - if err := (&uPTransportLayerInformationPairItem.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + p_FiveGProSeLayer2UEtoNetworkRelay, err := r.ReadBit() + if err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err + p_FiveGProSeLayer3UEtoNetworkRelay, err := r.ReadBit() + if err != nil { + return err + } + p_FiveGProSeLayer2RemoteUE, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_FiveGProSeDirectDiscovery { + var v FiveGProSeDirectDiscovery + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + fiveGProSeAuthorized.FiveGProSeDirectDiscovery = &v + } + if p_FiveGProSeDirectCommunication { + var v FiveGProSeDirectCommunication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + fiveGProSeAuthorized.FiveGProSeDirectCommunication = &v + } + if p_FiveGProSeLayer2UEtoNetworkRelay { + var v FiveGProSeLayer2UEtoNetworkRelay + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay = &v + } + if p_FiveGProSeLayer3UEtoNetworkRelay { + var v FiveGProSeLayer3UEtoNetworkRelay + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay = &v + } + if p_FiveGProSeLayer2RemoteUE { + var v FiveGProSeLayer2RemoteUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, &fiveGProSeAuthorized.iEExtensions); err != nil { + return err } - uPTransportLayerInformationPairItem.iEExtensions = &v } if extBit { - if err := uPTransportLayerInformationPairItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := fiveGProSeAuthorized.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (userPlaneFailureIndication *UserPlaneFailureIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(userPlaneFailureIndication.extensions.Present()) - w.WriteBit(userPlaneFailureIndication.iEExtensions != nil) - if err := userPlaneFailureIndication.UserPlaneFailureType.MarshalPER(w, enc); err != nil { +var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized]{ + { + ID: IDFiveGProSeLayer2Multipath, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v FiveGProSeLayer2Multipath + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FiveGProSeLayer2Multipath = &v + return nil + }, + Encode: func(x *FiveGProSeAuthorized) (per.Marshaler, bool) { + if x.FiveGProSeLayer2Multipath == nil { + return nil, false + } + return x.FiveGProSeLayer2Multipath, true + }, + }, + { + ID: IDFiveGProSeLayer2UEtoUERelay, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v FiveGProSeLayer2UEtoUERelay + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FiveGProSeLayer2UEtoUERelay = &v + return nil + }, + Encode: func(x *FiveGProSeAuthorized) (per.Marshaler, bool) { + if x.FiveGProSeLayer2UEtoUERelay == nil { + return nil, false + } + return x.FiveGProSeLayer2UEtoUERelay, true + }, + }, + { + ID: IDFiveGProSeLayer2UEtoUERemote, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v FiveGProSeLayer2UEtoUERemote + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FiveGProSeLayer2UEtoUERemote = &v + return nil + }, + Encode: func(x *FiveGProSeAuthorized) (per.Marshaler, bool) { + if x.FiveGProSeLayer2UEtoUERemote == nil { + return nil, false + } + return x.FiveGProSeLayer2UEtoUERemote, true + }, + }, + { + ID: IDFiveGProSeLayer2MHUEtoNetworkRelay, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v FiveGProSeLayer2MHUEtoNetworkRelay + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FiveGProSeLayer2MHUEtoNetworkRelay = &v + return nil + }, + Encode: func(x *FiveGProSeAuthorized) (per.Marshaler, bool) { + if x.FiveGProSeLayer2MHUEtoNetworkRelay == nil { + return nil, false + } + return x.FiveGProSeLayer2MHUEtoNetworkRelay, true + }, + }, + { + ID: IDFiveGProSeLayer2MHIntermediateUEtoNetworkRelay, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v FiveGProSeLayer2MHIntermediateUEtoNetworkRelay + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay = &v + return nil + }, + Encode: func(x *FiveGProSeAuthorized) (per.Marshaler, bool) { + if x.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay == nil { + return nil, false + } + return x.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay, true + }, + }, + { + ID: IDFiveGProSeLayer2MHRemote, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v FiveGProSeLayer2MHRemote + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FiveGProSeLayer2MHRemote = &v + return nil + }, + Encode: func(x *FiveGProSeAuthorized) (per.Marshaler, bool) { + if x.FiveGProSeLayer2MHRemote == nil { + return nil, false + } + return x.FiveGProSeLayer2MHRemote, true + }, + }, + { + ID: IDFiveGProSeLayer3MHUEtoNetworkRelay, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v FiveGProSeLayer3MHUEtoNetworkRelay + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.FiveGProSeLayer3MHUEtoNetworkRelay = &v + return nil + }, + Encode: func(x *FiveGProSeAuthorized) (per.Marshaler, bool) { + if x.FiveGProSeLayer3MHUEtoNetworkRelay == nil { + return nil, false + } + return x.FiveGProSeLayer3MHUEtoNetworkRelay, true + }, + }, +} + +func (fiveGProSeAuthorized *FiveGProSeAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if fiveGProSeAuthorized.FiveGProSeDirectDiscovery != nil && fiveGProSeAuthorized.FiveGProSeDirectDiscovery.Diagnose(d) { + notComprehended = true + } + if fiveGProSeAuthorized.FiveGProSeDirectCommunication != nil && fiveGProSeAuthorized.FiveGProSeDirectCommunication.Diagnose(d) { + notComprehended = true + } + if fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay != nil && fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay.Diagnose(d) { + notComprehended = true + } + if fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay != nil && fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay.Diagnose(d) { + notComprehended = true + } + if fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE != nil && fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, fiveGProSeAuthorized.iEExtensions) + return notComprehended +} + +func (fiveGProSeDirectCommunication FiveGProSeDirectCommunication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeDirectCommunication.Encode(w, enc, fiveGProSeDirectCommunication) +} + +func (fiveGProSeDirectCommunication *FiveGProSeDirectCommunication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeDirectCommunication.Decode(r, enc) + if err != nil { return err } - if err := userPlaneFailureIndication.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + *fiveGProSeDirectCommunication = v + return nil +} + +func (fiveGProSeDirectCommunication FiveGProSeDirectCommunication) Name() string { + return enumFiveGProSeDirectCommunication.Name(fiveGProSeDirectCommunication) +} + +func (fiveGProSeDirectCommunication FiveGProSeDirectCommunication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeDirectCommunication.Known(fiveGProSeDirectCommunication) +} + +func (fiveGProSeDirectDiscovery FiveGProSeDirectDiscovery) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeDirectDiscovery.Encode(w, enc, fiveGProSeDirectDiscovery) +} + +func (fiveGProSeDirectDiscovery *FiveGProSeDirectDiscovery) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeDirectDiscovery.Decode(r, enc) + if err != nil { return err } - if err := userPlaneFailureIndication.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + *fiveGProSeDirectDiscovery = v + return nil +} + +func (fiveGProSeDirectDiscovery FiveGProSeDirectDiscovery) Name() string { + return enumFiveGProSeDirectDiscovery.Name(fiveGProSeDirectDiscovery) +} + +func (fiveGProSeDirectDiscovery FiveGProSeDirectDiscovery) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeDirectDiscovery.Known(fiveGProSeDirectDiscovery) +} + +func (fiveGProSeLayer2MHIntermediateUEtoNetworkRelay FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay.Encode(w, enc, fiveGProSeLayer2MHIntermediateUEtoNetworkRelay) +} + +func (fiveGProSeLayer2MHIntermediateUEtoNetworkRelay *FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay.Decode(r, enc) + if err != nil { return err } - if userPlaneFailureIndication.iEExtensions != nil { - if err := (*userPlaneFailureIndication.iEExtensions).MarshalPER(w, enc); err != nil { - return err - } + *fiveGProSeLayer2MHIntermediateUEtoNetworkRelay = v + return nil +} + +func (fiveGProSeLayer2MHIntermediateUEtoNetworkRelay FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) Name() string { + return enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay.Name(fiveGProSeLayer2MHIntermediateUEtoNetworkRelay) +} + +func (fiveGProSeLayer2MHIntermediateUEtoNetworkRelay FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay.Known(fiveGProSeLayer2MHIntermediateUEtoNetworkRelay) +} + +func (fiveGProSeLayer2MHRemote FiveGProSeLayer2MHRemote) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2MHRemote.Encode(w, enc, fiveGProSeLayer2MHRemote) +} + +func (fiveGProSeLayer2MHRemote *FiveGProSeLayer2MHRemote) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2MHRemote.Decode(r, enc) + if err != nil { + return err } - if userPlaneFailureIndication.extensions.Present() { - if err := userPlaneFailureIndication.extensions.MarshalPER(w, enc); err != nil { - return err - } + *fiveGProSeLayer2MHRemote = v + return nil +} + +func (fiveGProSeLayer2MHRemote FiveGProSeLayer2MHRemote) Name() string { + return enumFiveGProSeLayer2MHRemote.Name(fiveGProSeLayer2MHRemote) +} + +func (fiveGProSeLayer2MHRemote FiveGProSeLayer2MHRemote) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2MHRemote.Known(fiveGProSeLayer2MHRemote) +} + +func (fiveGProSeLayer2MHUEtoNetworkRelay FiveGProSeLayer2MHUEtoNetworkRelay) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2MHUEtoNetworkRelay.Encode(w, enc, fiveGProSeLayer2MHUEtoNetworkRelay) +} + +func (fiveGProSeLayer2MHUEtoNetworkRelay *FiveGProSeLayer2MHUEtoNetworkRelay) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2MHUEtoNetworkRelay.Decode(r, enc) + if err != nil { + return err } + *fiveGProSeLayer2MHUEtoNetworkRelay = v return nil } -func (userPlaneFailureIndication *UserPlaneFailureIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (fiveGProSeLayer2MHUEtoNetworkRelay FiveGProSeLayer2MHUEtoNetworkRelay) Name() string { + return enumFiveGProSeLayer2MHUEtoNetworkRelay.Name(fiveGProSeLayer2MHUEtoNetworkRelay) +} + +func (fiveGProSeLayer2MHUEtoNetworkRelay FiveGProSeLayer2MHUEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2MHUEtoNetworkRelay.Known(fiveGProSeLayer2MHUEtoNetworkRelay) +} + +func (fiveGProSeLayer2Multipath FiveGProSeLayer2Multipath) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2Multipath.Encode(w, enc, fiveGProSeLayer2Multipath) +} + +func (fiveGProSeLayer2Multipath *FiveGProSeLayer2Multipath) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2Multipath.Decode(r, enc) if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + *fiveGProSeLayer2Multipath = v + return nil +} + +func (fiveGProSeLayer2Multipath FiveGProSeLayer2Multipath) Name() string { + return enumFiveGProSeLayer2Multipath.Name(fiveGProSeLayer2Multipath) +} + +func (fiveGProSeLayer2Multipath FiveGProSeLayer2Multipath) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2Multipath.Known(fiveGProSeLayer2Multipath) +} + +func (fiveGProSeLayer2RemoteUE FiveGProSeLayer2RemoteUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2RemoteUE.Encode(w, enc, fiveGProSeLayer2RemoteUE) +} + +func (fiveGProSeLayer2RemoteUE *FiveGProSeLayer2RemoteUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2RemoteUE.Decode(r, enc) if err != nil { return err } - if err := (&userPlaneFailureIndication.UserPlaneFailureType).UnmarshalPER(r, enc); err != nil { + *fiveGProSeLayer2RemoteUE = v + return nil +} + +func (fiveGProSeLayer2RemoteUE FiveGProSeLayer2RemoteUE) Name() string { + return enumFiveGProSeLayer2RemoteUE.Name(fiveGProSeLayer2RemoteUE) +} + +func (fiveGProSeLayer2RemoteUE FiveGProSeLayer2RemoteUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2RemoteUE.Known(fiveGProSeLayer2RemoteUE) +} + +func (fiveGProSeLayer2UEtoNetworkRelay FiveGProSeLayer2UEtoNetworkRelay) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2UEtoNetworkRelay.Encode(w, enc, fiveGProSeLayer2UEtoNetworkRelay) +} + +func (fiveGProSeLayer2UEtoNetworkRelay *FiveGProSeLayer2UEtoNetworkRelay) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2UEtoNetworkRelay.Decode(r, enc) + if err != nil { return err } - if err := (&userPlaneFailureIndication.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + *fiveGProSeLayer2UEtoNetworkRelay = v + return nil +} + +func (fiveGProSeLayer2UEtoNetworkRelay FiveGProSeLayer2UEtoNetworkRelay) Name() string { + return enumFiveGProSeLayer2UEtoNetworkRelay.Name(fiveGProSeLayer2UEtoNetworkRelay) +} + +func (fiveGProSeLayer2UEtoNetworkRelay FiveGProSeLayer2UEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2UEtoNetworkRelay.Known(fiveGProSeLayer2UEtoNetworkRelay) +} + +func (fiveGProSeLayer2UEtoUERelay FiveGProSeLayer2UEtoUERelay) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2UEtoUERelay.Encode(w, enc, fiveGProSeLayer2UEtoUERelay) +} + +func (fiveGProSeLayer2UEtoUERelay *FiveGProSeLayer2UEtoUERelay) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2UEtoUERelay.Decode(r, enc) + if err != nil { return err } - if err := (&userPlaneFailureIndication.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + *fiveGProSeLayer2UEtoUERelay = v + return nil +} + +func (fiveGProSeLayer2UEtoUERelay FiveGProSeLayer2UEtoUERelay) Name() string { + return enumFiveGProSeLayer2UEtoUERelay.Name(fiveGProSeLayer2UEtoUERelay) +} + +func (fiveGProSeLayer2UEtoUERelay FiveGProSeLayer2UEtoUERelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2UEtoUERelay.Known(fiveGProSeLayer2UEtoUERelay) +} + +func (fiveGProSeLayer2UEtoUERemote FiveGProSeLayer2UEtoUERemote) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer2UEtoUERemote.Encode(w, enc, fiveGProSeLayer2UEtoUERemote) +} + +func (fiveGProSeLayer2UEtoUERemote *FiveGProSeLayer2UEtoUERemote) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer2UEtoUERemote.Decode(r, enc) + if err != nil { return err } - if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - userPlaneFailureIndication.iEExtensions = &v + *fiveGProSeLayer2UEtoUERemote = v + return nil +} + +func (fiveGProSeLayer2UEtoUERemote FiveGProSeLayer2UEtoUERemote) Name() string { + return enumFiveGProSeLayer2UEtoUERemote.Name(fiveGProSeLayer2UEtoUERemote) +} + +func (fiveGProSeLayer2UEtoUERemote FiveGProSeLayer2UEtoUERemote) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer2UEtoUERemote.Known(fiveGProSeLayer2UEtoUERemote) +} + +func (fiveGProSeLayer3MHUEtoNetworkRelay FiveGProSeLayer3MHUEtoNetworkRelay) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer3MHUEtoNetworkRelay.Encode(w, enc, fiveGProSeLayer3MHUEtoNetworkRelay) +} + +func (fiveGProSeLayer3MHUEtoNetworkRelay *FiveGProSeLayer3MHUEtoNetworkRelay) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer3MHUEtoNetworkRelay.Decode(r, enc) + if err != nil { + return err } - if extBit { - if err := userPlaneFailureIndication.extensions.UnmarshalPER(r, enc); err != nil { - return err - } + *fiveGProSeLayer3MHUEtoNetworkRelay = v + return nil +} + +func (fiveGProSeLayer3MHUEtoNetworkRelay FiveGProSeLayer3MHUEtoNetworkRelay) Name() string { + return enumFiveGProSeLayer3MHUEtoNetworkRelay.Name(fiveGProSeLayer3MHUEtoNetworkRelay) +} + +func (fiveGProSeLayer3MHUEtoNetworkRelay FiveGProSeLayer3MHUEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer3MHUEtoNetworkRelay.Known(fiveGProSeLayer3MHUEtoNetworkRelay) +} + +func (fiveGProSeLayer3UEtoNetworkRelay FiveGProSeLayer3UEtoNetworkRelay) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumFiveGProSeLayer3UEtoNetworkRelay.Encode(w, enc, fiveGProSeLayer3UEtoNetworkRelay) +} + +func (fiveGProSeLayer3UEtoNetworkRelay *FiveGProSeLayer3UEtoNetworkRelay) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumFiveGProSeLayer3UEtoNetworkRelay.Decode(r, enc) + if err != nil { + return err } + *fiveGProSeLayer3UEtoNetworkRelay = v return nil } -func (userPlaneSecurityInformation *UserPlaneSecurityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(userPlaneSecurityInformation.extensions.Present()) - w.WriteBit(userPlaneSecurityInformation.iEExtensions != nil) - if err := userPlaneSecurityInformation.SecurityResult.MarshalPER(w, enc); err != nil { +func (fiveGProSeLayer3UEtoNetworkRelay FiveGProSeLayer3UEtoNetworkRelay) Name() string { + return enumFiveGProSeLayer3UEtoNetworkRelay.Name(fiveGProSeLayer3UEtoNetworkRelay) +} + +func (fiveGProSeLayer3UEtoNetworkRelay FiveGProSeLayer3UEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumFiveGProSeLayer3UEtoNetworkRelay.Known(fiveGProSeLayer3UEtoNetworkRelay) +} + +func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates.iEExtensions) + w.WriteBit(fiveGProSePC5FlowBitRates.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := fiveGProSePC5FlowBitRates.FiveGproSeguaranteedFlowBitRate.MarshalPER(w, enc); err != nil { return err } - if err := userPlaneSecurityInformation.SecurityIndication.MarshalPER(w, enc); err != nil { + if err := fiveGProSePC5FlowBitRates.FiveGproSemaximumFlowBitRate.MarshalPER(w, enc); err != nil { return err } - if userPlaneSecurityInformation.iEExtensions != nil { - if err := (*userPlaneSecurityInformation.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if userPlaneSecurityInformation.extensions.Present() { - if err := userPlaneSecurityInformation.extensions.MarshalPER(w, enc); err != nil { + if fiveGProSePC5FlowBitRates.extensions.Present() { + if err := fiveGProSePC5FlowBitRates.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (userPlaneSecurityInformation *UserPlaneSecurityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fiveGProSePC5FlowBitRates = FiveGProSePC5FlowBitRates{} extBit, err := r.ReadBit() if err != nil { return err @@ -9366,77 +11472,39162 @@ func (userPlaneSecurityInformation *UserPlaneSecurityInformation) UnmarshalPER(r if err != nil { return err } - if err := (&userPlaneSecurityInformation.SecurityResult).UnmarshalPER(r, enc); err != nil { + if err := (&fiveGProSePC5FlowBitRates.FiveGproSeguaranteedFlowBitRate).UnmarshalPER(r, enc); err != nil { return err } - if err := (&userPlaneSecurityInformation.SecurityIndication).UnmarshalPER(r, enc); err != nil { + if err := (&fiveGProSePC5FlowBitRates.FiveGproSemaximumFlowBitRate).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, &fiveGProSePC5FlowBitRates.iEExtensions); err != nil { return err } - userPlaneSecurityInformation.iEExtensions = &v } if extBit { - if err := userPlaneSecurityInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := fiveGProSePC5FlowBitRates.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (taiListForPagingItem *taiListForPagingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := taiListForPagingItem.TAI.MarshalPER(w, enc); err != nil { +var extIEsFiveGProSePC5FlowBitRates []ap.IESpec[ProtocolIEID, FiveGProSePC5FlowBitRates] + +func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if fiveGProSePC5FlowBitRates.FiveGproSeguaranteedFlowBitRate.Diagnose(d) { + notComprehended = true + } + if fiveGProSePC5FlowBitRates.FiveGproSemaximumFlowBitRate.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates.iEExtensions) + return notComprehended +} + +func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem.iEExtensions) + w.WriteBit(fiveGProSePC5QoSFlowItem.extensions.Present()) + w.WriteBit(fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates != nil) + w.WriteBit(fiveGProSePC5QoSFlowItem.FiveGproSerange != nil) + w.WriteBit(len(ext) > 0) + if err := fiveGProSePC5QoSFlowItem.FiveGproSepQI.MarshalPER(w, enc); err != nil { return err } + if fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates != nil { + if err := (*fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates).MarshalPER(w, enc); err != nil { + return err + } + } + if fiveGProSePC5QoSFlowItem.FiveGproSerange != nil { + if err := (*fiveGProSePC5QoSFlowItem.FiveGproSerange).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if fiveGProSePC5QoSFlowItem.extensions.Present() { + if err := fiveGProSePC5QoSFlowItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (taiListForPagingItem *taiListForPagingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fiveGProSePC5QoSFlowItem = FiveGProSePC5QoSFlowItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_FiveGproSepc5FlowBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_FiveGproSerange, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&taiListForPagingItem.TAI).UnmarshalPER(r, enc); err != nil { + if err := (&fiveGProSePC5QoSFlowItem.FiveGproSepQI).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_FiveGproSepc5FlowBitRates { + var v FiveGProSePC5FlowBitRates if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates = &v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_FiveGproSerange { + var v RangeType + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + fiveGProSePC5QoSFlowItem.FiveGproSerange = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, &fiveGProSePC5QoSFlowItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := fiveGProSePC5QoSFlowItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsFiveGProSePC5QoSFlowItem []ap.IESpec[ProtocolIEID, FiveGProSePC5QoSFlowItem] + +func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if fiveGProSePC5QoSFlowItem.FiveGproSepQI.Diagnose(d) { + notComprehended = true + } + if fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates != nil && fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates.Diagnose(d) { + notComprehended = true + } + if fiveGProSePC5QoSFlowItem.FiveGproSerange != nil && fiveGProSePC5QoSFlowItem.FiveGproSerange.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem.iEExtensions) + return notComprehended +} + +func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters.iEExtensions) + w.WriteBit(fiveGProSePC5QoSParameters.extensions.Present()) + w.WriteBit(fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates != nil) + w.WriteBit(len(ext) > 0) + if err := fiveGProSePC5QoSParameters.FiveGProSepc5QoSFlowList.MarshalPER(w, enc); err != nil { + return err + } + if fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates != nil { + if err := (*fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if fiveGProSePC5QoSParameters.extensions.Present() { + if err := fiveGProSePC5QoSParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fiveGProSePC5QoSParameters = FiveGProSePC5QoSParameters{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_FiveGProSepc5LinkAggregateBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&fiveGProSePC5QoSParameters.FiveGProSepc5QoSFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_FiveGProSepc5LinkAggregateBitRates { + var v BitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, &fiveGProSePC5QoSParameters.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := fiveGProSePC5QoSParameters.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsFiveGProSePC5QoSParameters []ap.IESpec[ProtocolIEID, FiveGProSePC5QoSParameters] + +func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if fiveGProSePC5QoSParameters.FiveGProSepc5QoSFlowList.Diagnose(d) { + notComprehended = true + } + if fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates != nil && fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters.iEExtensions) + return notComprehended +} + +func (fiveGSTMSI *FiveGSTMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFiveGSTMSI, fiveGSTMSI, fiveGSTMSI.iEExtensions) + w.WriteBit(fiveGSTMSI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := fiveGSTMSI.AMFSetID.MarshalPER(w, enc); err != nil { + return err + } + if err := fiveGSTMSI.AMFPointer.MarshalPER(w, enc); err != nil { + return err + } + if err := fiveGSTMSI.FiveGTMSI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if fiveGSTMSI.extensions.Present() { + if err := fiveGSTMSI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (fiveGSTMSI *FiveGSTMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fiveGSTMSI = FiveGSTMSI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&fiveGSTMSI.AMFSetID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&fiveGSTMSI.AMFPointer).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&fiveGSTMSI.FiveGTMSI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGSTMSI, fiveGSTMSI, &fiveGSTMSI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := fiveGSTMSI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsFiveGSTMSI []ap.IESpec[ProtocolIEID, FiveGSTMSI] + +func (fiveGSTMSI *FiveGSTMSI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsFiveGSTMSI, fiveGSTMSI, fiveGSTMSI.iEExtensions) + return notComprehended +} + +func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, forbiddenAreaInformationItem.iEExtensions) + w.WriteBit(forbiddenAreaInformationItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := forbiddenAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := forbiddenAreaInformationItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if forbiddenAreaInformationItem.extensions.Present() { + if err := forbiddenAreaInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *forbiddenAreaInformationItem = ForbiddenAreaInformationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&forbiddenAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&forbiddenAreaInformationItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, &forbiddenAreaInformationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := forbiddenAreaInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsForbiddenAreaInformationItem []ap.IESpec[ProtocolIEID, ForbiddenAreaInformationItem] + +func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, forbiddenAreaInformationItem.iEExtensions) + return notComprehended +} + +func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, fromEUTRANtoNGRAN.iEExtensions) + w.WriteBit(len(ext) > 0) + if err := fromEUTRANtoNGRAN.SourceeNBID.MarshalPER(w, enc); err != nil { + return err + } + if err := fromEUTRANtoNGRAN.TargetNGRANnodeID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + return nil +} + +func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fromEUTRANtoNGRAN = FromEUTRANtoNGRAN{} + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&fromEUTRANtoNGRAN.SourceeNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&fromEUTRANtoNGRAN.TargetNGRANnodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, &fromEUTRANtoNGRAN.iEExtensions); err != nil { + return err + } + } + return nil +} + +var extIEsFromEUTRANtoNGRAN []ap.IESpec[ProtocolIEID, FromEUTRANtoNGRAN] + +func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if fromEUTRANtoNGRAN.SourceeNBID.Diagnose(d) { + notComprehended = true + } + if fromEUTRANtoNGRAN.TargetNGRANnodeID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, fromEUTRANtoNGRAN.iEExtensions) + return notComprehended +} + +func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, fromNGRANtoEUTRAN.iEExtensions) + w.WriteBit(len(ext) > 0) + if err := fromNGRANtoEUTRAN.SourceNGRANnodeID.MarshalPER(w, enc); err != nil { + return err + } + if err := fromNGRANtoEUTRAN.TargeteNBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + return nil +} + +func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fromNGRANtoEUTRAN = FromNGRANtoEUTRAN{} + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&fromNGRANtoEUTRAN.SourceNGRANnodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&fromNGRANtoEUTRAN.TargeteNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, &fromNGRANtoEUTRAN.iEExtensions); err != nil { + return err } } return nil } + +var extIEsFromNGRANtoEUTRAN []ap.IESpec[ProtocolIEID, FromNGRANtoEUTRAN] + +func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if fromNGRANtoEUTRAN.SourceNGRANnodeID.Diagnose(d) { + notComprehended = true + } + if fromNGRANtoEUTRAN.TargeteNBID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, fromNGRANtoEUTRAN.iEExtensions) + return notComprehended +} + +func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) + w.WriteBit(gBRQosInformation.extensions.Present()) + w.WriteBit(gBRQosInformation.NotificationControl != nil) + w.WriteBit(gBRQosInformation.MaximumPacketLossRateDL != nil) + w.WriteBit(gBRQosInformation.MaximumPacketLossRateUL != nil) + w.WriteBit(len(ext) > 0) + if err := gBRQosInformation.MaximumFlowBitRateDL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.MaximumFlowBitRateUL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.GuaranteedFlowBitRateDL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.GuaranteedFlowBitRateUL.MarshalPER(w, enc); err != nil { + return err + } + if gBRQosInformation.NotificationControl != nil { + if err := (*gBRQosInformation.NotificationControl).MarshalPER(w, enc); err != nil { + return err + } + } + if gBRQosInformation.MaximumPacketLossRateDL != nil { + if err := (*gBRQosInformation.MaximumPacketLossRateDL).MarshalPER(w, enc); err != nil { + return err + } + } + if gBRQosInformation.MaximumPacketLossRateUL != nil { + if err := (*gBRQosInformation.MaximumPacketLossRateUL).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gBRQosInformation.extensions.Present() { + if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gBRQosInformation = GBRQosInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NotificationControl, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumPacketLossRateDL, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumPacketLossRateUL, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gBRQosInformation.MaximumFlowBitRateDL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.MaximumFlowBitRateUL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.GuaranteedFlowBitRateDL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.GuaranteedFlowBitRateUL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NotificationControl { + var v NotificationControl + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + gBRQosInformation.NotificationControl = &v + } + if p_MaximumPacketLossRateDL { + var v PacketLossRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + gBRQosInformation.MaximumPacketLossRateDL = &v + } + if p_MaximumPacketLossRateUL { + var v PacketLossRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + gBRQosInformation.MaximumPacketLossRateUL = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGBRQosInformation = []ap.IESpec[ProtocolIEID, GBRQosInformation]{ + { + ID: IDAlternativeQoSParaSetList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v AlternativeQoSParaSetList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AlternativeQoSParaSetList = v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if len(x.AlternativeQoSParaSetList) == 0 { + return nil, false + } + return x.AlternativeQoSParaSetList, true + }, + }, + { + ID: IDMonitoringRequestonAvailableBitrate, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v MonitoringRequestonAvailableBitrate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MonitoringRequestonAvailableBitrate = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.MonitoringRequestonAvailableBitrate == nil { + return nil, false + } + return x.MonitoringRequestonAvailableBitrate, true + }, + }, +} + +func (gBRQosInformation *GBRQosInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if gBRQosInformation.MaximumFlowBitRateDL.Diagnose(d) { + notComprehended = true + } + if gBRQosInformation.MaximumFlowBitRateUL.Diagnose(d) { + notComprehended = true + } + if gBRQosInformation.GuaranteedFlowBitRateDL.Diagnose(d) { + notComprehended = true + } + if gBRQosInformation.GuaranteedFlowBitRateUL.Diagnose(d) { + notComprehended = true + } + if gBRQosInformation.NotificationControl != nil && gBRQosInformation.NotificationControl.Diagnose(d) { + notComprehended = true + } + if gBRQosInformation.MaximumPacketLossRateDL != nil && gBRQosInformation.MaximumPacketLossRateDL.Diagnose(d) { + notComprehended = true + } + if gBRQosInformation.MaximumPacketLossRateUL != nil && gBRQosInformation.MaximumPacketLossRateUL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) + return notComprehended +} + +func (gNBID *GNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{gNBID.GNBID != nil, gNBID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case gNBID.GNBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*gNBID.GNBID).MarshalPER(w, enc); err != nil { + return err + } + case gNBID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, gNBID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (gNBID *GNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gNBID = GNBID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v GNBIDValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + gNBID.GNBID = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + gNBID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (gNBID *GNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case gNBID.GNBID != nil: + case gNBID.ChoiceExtension != nil: + d.Unknown(gNBID.ChoiceExtension.ID, gNBID.ChoiceExtension.Criticality) + } + return false +} + +func (gTPTunnel *GTPTunnel) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGTPTunnel, gTPTunnel, gTPTunnel.iEExtensions) + w.WriteBit(gTPTunnel.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gTPTunnel.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := gTPTunnel.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gTPTunnel.extensions.Present() { + if err := gTPTunnel.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gTPTunnel = GTPTunnel{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gTPTunnel.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gTPTunnel.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGTPTunnel, gTPTunnel, &gTPTunnel.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := gTPTunnel.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGTPTunnel []ap.IESpec[ProtocolIEID, GTPTunnel] + +func (gTPTunnel *GTPTunnel) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsGTPTunnel, gTPTunnel, gTPTunnel.iEExtensions) + return notComprehended +} + +func (gUAMI *GUAMI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGUAMI, gUAMI, gUAMI.iEExtensions) + w.WriteBit(gUAMI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gUAMI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := gUAMI.AMFRegionID.MarshalPER(w, enc); err != nil { + return err + } + if err := gUAMI.AMFSetID.MarshalPER(w, enc); err != nil { + return err + } + if err := gUAMI.AMFPointer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gUAMI.extensions.Present() { + if err := gUAMI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gUAMI = GUAMI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gUAMI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUAMI.AMFRegionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUAMI.AMFSetID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUAMI.AMFPointer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGUAMI, gUAMI, &gUAMI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := gUAMI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGUAMI []ap.IESpec[ProtocolIEID, GUAMI] + +func (gUAMI *GUAMI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsGUAMI, gUAMI, gUAMI.iEExtensions) + return notComprehended +} + +func (gUAMIListItem *GUAMIListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGUAMIListItem, gUAMIListItem, gUAMIListItem.iEExtensions) + w.WriteBit(gUAMIListItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gUAMIListItem.GUAMI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gUAMIListItem.extensions.Present() { + if err := gUAMIListItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gUAMIListItem *GUAMIListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gUAMIListItem = GUAMIListItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gUAMIListItem.GUAMI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGUAMIListItem, gUAMIListItem, &gUAMIListItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := gUAMIListItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGUAMIListItem []ap.IESpec[ProtocolIEID, GUAMIListItem] + +func (gUAMIListItem *GUAMIListItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if gUAMIListItem.GUAMI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGUAMIListItem, gUAMIListItem, gUAMIListItem.iEExtensions) + return notComprehended +} + +func (gUAMIType GUAMIType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumGUAMIType.Encode(w, enc, gUAMIType) +} + +func (gUAMIType *GUAMIType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumGUAMIType.Decode(r, enc) + if err != nil { + return err + } + *gUAMIType = v + return nil +} + +func (gUAMIType GUAMIType) Name() string { + return enumGUAMIType.Name(gUAMIType) +} + +func (gUAMIType GUAMIType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumGUAMIType.Known(gUAMIType) +} + +func (gWContextReleaseIndication GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumGWContextReleaseIndication.Encode(w, enc, gWContextReleaseIndication) +} + +func (gWContextReleaseIndication *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumGWContextReleaseIndication.Decode(r, enc) + if err != nil { + return err + } + *gWContextReleaseIndication = v + return nil +} + +func (gWContextReleaseIndication GWContextReleaseIndication) Name() string { + return enumGWContextReleaseIndication.Name(gWContextReleaseIndication) +} + +func (gWContextReleaseIndication GWContextReleaseIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumGWContextReleaseIndication.Known(gWContextReleaseIndication) +} + +func (geographyBasedMDT *GeographyBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGeographyBasedMDT, geographyBasedMDT, geographyBasedMDT.iEExtensions) + w.WriteBit(geographyBasedMDT.extensions.Present()) + w.WriteBit(geographyBasedMDT.NTNPLMNList != nil) + w.WriteBit(len(ext) > 0) + if err := geographyBasedMDT.NTNGeographicalArea.MarshalPER(w, enc); err != nil { + return err + } + if geographyBasedMDT.NTNPLMNList != nil { + if err := geographyBasedMDT.NTNPLMNList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if geographyBasedMDT.extensions.Present() { + if err := geographyBasedMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (geographyBasedMDT *GeographyBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *geographyBasedMDT = GeographyBasedMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NTNPLMNList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&geographyBasedMDT.NTNGeographicalArea).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NTNPLMNList { + if err := (&geographyBasedMDT.NTNPLMNList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGeographyBasedMDT, geographyBasedMDT, &geographyBasedMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := geographyBasedMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGeographyBasedMDT []ap.IESpec[ProtocolIEID, GeographyBasedMDT] + +func (geographyBasedMDT *GeographyBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if geographyBasedMDT.NTNGeographicalArea.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGeographyBasedMDT, geographyBasedMDT, geographyBasedMDT.iEExtensions) + return notComprehended +} + +func (globalCableIDNew *GlobalCableIDNew) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalCableIDNew, globalCableIDNew, globalCableIDNew.iEExtensions) + w.WriteBit(globalCableIDNew.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalCableIDNew.GlobalCableID.MarshalPER(w, enc); err != nil { + return err + } + if err := globalCableIDNew.TAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalCableIDNew.extensions.Present() { + if err := globalCableIDNew.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalCableIDNew *GlobalCableIDNew) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalCableIDNew = GlobalCableIDNew{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalCableIDNew.GlobalCableID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalCableIDNew.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalCableIDNew, globalCableIDNew, &globalCableIDNew.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalCableIDNew.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalCableIDNew []ap.IESpec[ProtocolIEID, GlobalCableIDNew] + +func (globalCableIDNew *GlobalCableIDNew) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalCableIDNew.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalCableIDNew, globalCableIDNew, globalCableIDNew.iEExtensions) + return notComprehended +} + +func (globalENBID *GlobalENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + w.WriteBit(globalENBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalENBID.PLMNidentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalENBID.ENBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalENBID.extensions.Present() { + if err := globalENBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalENBID = GlobalENBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalENBID.PLMNidentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalENBID.ENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalENBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalENBID []ap.IESpec[ProtocolIEID, GlobalENBID] + +func (globalENBID *GlobalENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalENBID.ENBID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + return notComprehended +} + +func (globalGNBID *GlobalGNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + w.WriteBit(globalGNBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalGNBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalGNBID.GNBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalGNBID.extensions.Present() { + if err := globalGNBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalGNBID *GlobalGNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalGNBID = GlobalGNBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalGNBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalGNBID.GNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalGNBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalGNBID []ap.IESpec[ProtocolIEID, GlobalGNBID] + +func (globalGNBID *GlobalGNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalGNBID.GNBID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + return notComprehended +} + +func (globalLineID *GlobalLineID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalLineID, globalLineID, globalLineID.iEExtensions) + w.WriteBit(globalLineID.extensions.Present()) + w.WriteBit(globalLineID.LineType != nil) + w.WriteBit(len(ext) > 0) + if err := globalLineID.GlobalLineIdentity.MarshalPER(w, enc); err != nil { + return err + } + if globalLineID.LineType != nil { + if err := (*globalLineID.LineType).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalLineID.extensions.Present() { + if err := globalLineID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalLineID *GlobalLineID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalLineID = GlobalLineID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_LineType, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalLineID.GlobalLineIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_LineType { + var v LineType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + globalLineID.LineType = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalLineID, globalLineID, &globalLineID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalLineID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalLineID = []ap.IESpec[ProtocolIEID, GlobalLineID]{ + { + ID: IDTAI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *GlobalLineID, r *per.Reader, enc per.Encoding) error { + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TAI = &v + return nil + }, + Encode: func(x *GlobalLineID) (per.Marshaler, bool) { + if x.TAI == nil { + return nil, false + } + return x.TAI, true + }, + }, +} + +func (globalLineID *GlobalLineID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalLineID.LineType != nil && globalLineID.LineType.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalLineID, globalLineID, globalLineID.iEExtensions) + return notComprehended +} + +func (globalN3IWFID *GlobalN3IWFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalN3IWFID, globalN3IWFID, globalN3IWFID.iEExtensions) + w.WriteBit(globalN3IWFID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalN3IWFID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalN3IWFID.N3IWFID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalN3IWFID.extensions.Present() { + if err := globalN3IWFID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalN3IWFID *GlobalN3IWFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalN3IWFID = GlobalN3IWFID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalN3IWFID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalN3IWFID.N3IWFID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalN3IWFID, globalN3IWFID, &globalN3IWFID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalN3IWFID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalN3IWFID []ap.IESpec[ProtocolIEID, GlobalN3IWFID] + +func (globalN3IWFID *GlobalN3IWFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalN3IWFID.N3IWFID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalN3IWFID, globalN3IWFID, globalN3IWFID.iEExtensions) + return notComprehended +} + +func (globalNgENBID *GlobalNgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalNgENBID, globalNgENBID, globalNgENBID.iEExtensions) + w.WriteBit(globalNgENBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalNgENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalNgENBID.NgENBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalNgENBID.extensions.Present() { + if err := globalNgENBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalNgENBID = GlobalNgENBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalNgENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalNgENBID.NgENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalNgENBID, globalNgENBID, &globalNgENBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalNgENBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalNgENBID []ap.IESpec[ProtocolIEID, GlobalNgENBID] + +func (globalNgENBID *GlobalNgENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalNgENBID.NgENBID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalNgENBID, globalNgENBID, globalNgENBID.iEExtensions) + return notComprehended +} + +func (globalRANNodeID *GlobalRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{globalRANNodeID.GlobalGNBID != nil, globalRANNodeID.GlobalNgENBID != nil, globalRANNodeID.GlobalN3IWFID != nil, globalRANNodeID.GlobalTNGFID != nil, globalRANNodeID.GlobalTWIFID != nil, globalRANNodeID.GlobalWAGFID != nil, globalRANNodeID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case globalRANNodeID.GlobalGNBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { + return err + } + if err := (*globalRANNodeID.GlobalGNBID).MarshalPER(w, enc); err != nil { + return err + } + case globalRANNodeID.GlobalNgENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { + return err + } + if err := (*globalRANNodeID.GlobalNgENBID).MarshalPER(w, enc); err != nil { + return err + } + case globalRANNodeID.GlobalN3IWFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { + return err + } + if err := (*globalRANNodeID.GlobalN3IWFID).MarshalPER(w, enc); err != nil { + return err + } + case globalRANNodeID.GlobalTNGFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalTNGFID, Criticality: globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), Value: globalRANNodeID.GlobalTNGFID}) + case globalRANNodeID.GlobalTWIFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalTWIFID, Criticality: globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), Value: globalRANNodeID.GlobalTWIFID}) + case globalRANNodeID.GlobalWAGFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalWAGFID, Criticality: globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), Value: globalRANNodeID.GlobalWAGFID}) + case globalRANNodeID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, globalRANNodeID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (globalRANNodeID *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalRANNodeID = GlobalRANNodeID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) + if err != nil { + return err + } + switch idx { + case 0: + var v GlobalGNBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + globalRANNodeID.GlobalGNBID = &v + case 1: + var v GlobalNgENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + globalRANNodeID.GlobalNgENBID = &v + case 2: + var v GlobalN3IWFID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + globalRANNodeID.GlobalN3IWFID = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDGlobalTNGFID: + var v GlobalTNGFID + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + globalRANNodeID.ChoiceExtension = &f + break + } + globalRANNodeID.GlobalTNGFID = &v + globalRANNodeID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + case IDGlobalTWIFID: + var v GlobalTWIFID + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + globalRANNodeID.ChoiceExtension = &f + break + } + globalRANNodeID.GlobalTWIFID = &v + globalRANNodeID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + case IDGlobalWAGFID: + var v GlobalWAGFID + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + globalRANNodeID.ChoiceExtension = &f + break + } + globalRANNodeID.GlobalWAGFID = &v + globalRANNodeID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + default: + globalRANNodeID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (globalRANNodeID *GlobalRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case globalRANNodeID.GlobalGNBID != nil: + return globalRANNodeID.GlobalGNBID.Diagnose(d) + case globalRANNodeID.GlobalNgENBID != nil: + return globalRANNodeID.GlobalNgENBID.Diagnose(d) + case globalRANNodeID.GlobalN3IWFID != nil: + return globalRANNodeID.GlobalN3IWFID.Diagnose(d) + case globalRANNodeID.GlobalTNGFID != nil: + d.IE(IDGlobalTNGFID, globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), globalRANNodeID.GlobalTNGFID) + case globalRANNodeID.GlobalTWIFID != nil: + d.IE(IDGlobalTWIFID, globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), globalRANNodeID.GlobalTWIFID) + case globalRANNodeID.GlobalWAGFID != nil: + d.IE(IDGlobalWAGFID, globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), globalRANNodeID.GlobalWAGFID) + case globalRANNodeID.ChoiceExtension != nil: + d.Unknown(globalRANNodeID.ChoiceExtension.ID, globalRANNodeID.ChoiceExtension.Criticality) + } + return false +} + +func (globalTNGFID *GlobalTNGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalTNGFID, globalTNGFID, globalTNGFID.iEExtensions) + w.WriteBit(globalTNGFID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalTNGFID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalTNGFID.TNGFID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalTNGFID.extensions.Present() { + if err := globalTNGFID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalTNGFID *GlobalTNGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalTNGFID = GlobalTNGFID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalTNGFID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalTNGFID.TNGFID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalTNGFID, globalTNGFID, &globalTNGFID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalTNGFID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalTNGFID []ap.IESpec[ProtocolIEID, GlobalTNGFID] + +func (globalTNGFID *GlobalTNGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalTNGFID.TNGFID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalTNGFID, globalTNGFID, globalTNGFID.iEExtensions) + return notComprehended +} + +func (globalTWIFID *GlobalTWIFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalTWIFID, globalTWIFID, globalTWIFID.iEExtensions) + w.WriteBit(globalTWIFID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalTWIFID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalTWIFID.TWIFID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalTWIFID.extensions.Present() { + if err := globalTWIFID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalTWIFID *GlobalTWIFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalTWIFID = GlobalTWIFID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalTWIFID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalTWIFID.TWIFID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalTWIFID, globalTWIFID, &globalTWIFID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalTWIFID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalTWIFID []ap.IESpec[ProtocolIEID, GlobalTWIFID] + +func (globalTWIFID *GlobalTWIFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalTWIFID.TWIFID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalTWIFID, globalTWIFID, globalTWIFID.iEExtensions) + return notComprehended +} + +func (globalWAGFID *GlobalWAGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalWAGFID, globalWAGFID, globalWAGFID.iEExtensions) + w.WriteBit(globalWAGFID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalWAGFID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalWAGFID.WAGFID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalWAGFID.extensions.Present() { + if err := globalWAGFID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalWAGFID *GlobalWAGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalWAGFID = GlobalWAGFID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalWAGFID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalWAGFID.WAGFID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalWAGFID, globalWAGFID, &globalWAGFID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalWAGFID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalWAGFID []ap.IESpec[ProtocolIEID, GlobalWAGFID] + +func (globalWAGFID *GlobalWAGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalWAGFID.WAGFID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsGlobalWAGFID, globalWAGFID, globalWAGFID.iEExtensions) + return notComprehended +} + +func (hFCNodeIDNew *HFCNodeIDNew) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsHFCNodeIDNew, hFCNodeIDNew, hFCNodeIDNew.iEExtensions) + w.WriteBit(hFCNodeIDNew.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := hFCNodeIDNew.HFCNodeID.MarshalPER(w, enc); err != nil { + return err + } + if err := hFCNodeIDNew.TAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if hFCNodeIDNew.extensions.Present() { + if err := hFCNodeIDNew.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (hFCNodeIDNew *HFCNodeIDNew) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *hFCNodeIDNew = HFCNodeIDNew{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&hFCNodeIDNew.HFCNodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&hFCNodeIDNew.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHFCNodeIDNew, hFCNodeIDNew, &hFCNodeIDNew.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := hFCNodeIDNew.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsHFCNodeIDNew = []ap.IESpec[ProtocolIEID, HFCNodeIDNew]{ + { + ID: IDGlobalCableID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HFCNodeIDNew, r *per.Reader, enc per.Encoding) error { + var v GlobalCableID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.GlobalCableID = v + return nil + }, + Encode: func(x *HFCNodeIDNew) (per.Marshaler, bool) { + if len(x.GlobalCableID) == 0 { + return nil, false + } + return x.GlobalCableID, true + }, + }, +} + +func (hFCNodeIDNew *HFCNodeIDNew) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if hFCNodeIDNew.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsHFCNodeIDNew, hFCNodeIDNew, hFCNodeIDNew.iEExtensions) + return notComprehended +} + +func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsHandoverCommandTransfer, handoverCommandTransfer, handoverCommandTransfer.iEExtensions) + w.WriteBit(handoverCommandTransfer.extensions.Present()) + w.WriteBit(handoverCommandTransfer.DLForwardingUPTNLInformation != nil) + w.WriteBit(handoverCommandTransfer.QosFlowToBeForwarded != nil) + w.WriteBit(handoverCommandTransfer.DataForwardingResponseDRB != nil) + w.WriteBit(len(ext) > 0) + if handoverCommandTransfer.DLForwardingUPTNLInformation != nil { + if err := (*handoverCommandTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if handoverCommandTransfer.QosFlowToBeForwarded != nil { + if err := handoverCommandTransfer.QosFlowToBeForwarded.MarshalPER(w, enc); err != nil { + return err + } + } + if handoverCommandTransfer.DataForwardingResponseDRB != nil { + if err := handoverCommandTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if handoverCommandTransfer.extensions.Present() { + if err := handoverCommandTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *handoverCommandTransfer = HandoverCommandTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwardingUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowToBeForwarded, err := r.ReadBit() + if err != nil { + return err + } + p_DataForwardingResponseDRB, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_DLForwardingUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverCommandTransfer.DLForwardingUPTNLInformation = &v + } + if p_QosFlowToBeForwarded { + if err := (&handoverCommandTransfer.QosFlowToBeForwarded).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_DataForwardingResponseDRB { + if err := (&handoverCommandTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverCommandTransfer, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := handoverCommandTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsHandoverCommandTransfer = []ap.IESpec[ProtocolIEID, HandoverCommandTransfer]{ + { + ID: IDAdditionalDLForwardingUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalDLForwardingUPTNLInformation = v + return nil + }, + Encode: func(x *HandoverCommandTransfer) (per.Marshaler, bool) { + if len(x.AdditionalDLForwardingUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalDLForwardingUPTNLInformation, true + }, + }, + { + ID: IDULForwardingUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ULForwardingUPTNLInformation = &v + return nil + }, + Encode: func(x *HandoverCommandTransfer) (per.Marshaler, bool) { + if x.ULForwardingUPTNLInformation == nil { + return nil, false + } + return x.ULForwardingUPTNLInformation, true + }, + }, + { + ID: IDAdditionalULForwardingUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalULForwardingUPTNLInformation = v + return nil + }, + Encode: func(x *HandoverCommandTransfer) (per.Marshaler, bool) { + if len(x.AdditionalULForwardingUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalULForwardingUPTNLInformation, true + }, + }, + { + ID: IDDataForwardingResponseERABList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { + var v DataForwardingResponseERABList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DataForwardingResponseERAB = v + return nil + }, + Encode: func(x *HandoverCommandTransfer) (per.Marshaler, bool) { + if len(x.DataForwardingResponseERAB) == 0 { + return nil, false + } + return x.DataForwardingResponseERAB, true + }, + }, + { + ID: IDQosFlowFailedToSetupList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowListWithCause + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QosFlowFailedToSetupList = v + return nil + }, + Encode: func(x *HandoverCommandTransfer) (per.Marshaler, bool) { + if len(x.QosFlowFailedToSetupList) == 0 { + return nil, false + } + return x.QosFlowFailedToSetupList, true + }, + }, +} + +func (handoverCommandTransfer *HandoverCommandTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if handoverCommandTransfer.DLForwardingUPTNLInformation != nil && handoverCommandTransfer.DLForwardingUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if handoverCommandTransfer.QosFlowToBeForwarded.Diagnose(d) { + notComprehended = true + } + if handoverCommandTransfer.DataForwardingResponseDRB.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsHandoverCommandTransfer, handoverCommandTransfer, handoverCommandTransfer.iEExtensions) + return notComprehended +} + +func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer.iEExtensions) + w.WriteBit(handoverPreparationUnsuccessfulTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := handoverPreparationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if handoverPreparationUnsuccessfulTransfer.extensions.Present() { + if err := handoverPreparationUnsuccessfulTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *handoverPreparationUnsuccessfulTransfer = HandoverPreparationUnsuccessfulTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&handoverPreparationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, &handoverPreparationUnsuccessfulTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := handoverPreparationUnsuccessfulTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsHandoverPreparationUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, HandoverPreparationUnsuccessfulTransfer] + +func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if handoverPreparationUnsuccessfulTransfer.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer.iEExtensions) + return notComprehended +} + +func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer.iEExtensions) + w.WriteBit(handoverRequestAcknowledgeTransfer.extensions.Present()) + w.WriteBit(handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil) + w.WriteBit(handoverRequestAcknowledgeTransfer.SecurityResult != nil) + w.WriteBit(handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil) + w.WriteBit(handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil) + w.WriteBit(len(ext) > 0) + if err := handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil { + if err := (*handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if handoverRequestAcknowledgeTransfer.SecurityResult != nil { + if err := (*handoverRequestAcknowledgeTransfer.SecurityResult).MarshalPER(w, enc); err != nil { + return err + } + } + if err := handoverRequestAcknowledgeTransfer.QosFlowSetupResponse.MarshalPER(w, enc); err != nil { + return err + } + if handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup != nil { + if err := handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { + return err + } + } + if handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB != nil { + if err := handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if handoverRequestAcknowledgeTransfer.extensions.Present() { + if err := handoverRequestAcknowledgeTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *handoverRequestAcknowledgeTransfer = HandoverRequestAcknowledgeTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwardingUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_SecurityResult, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowFailedToSetup, err := r.ReadBit() + if err != nil { + return err + } + p_DataForwardingResponseDRB, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLForwardingUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation = &v + } + if p_SecurityResult { + var v SecurityResult + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverRequestAcknowledgeTransfer.SecurityResult = &v + } + if err := (&handoverRequestAcknowledgeTransfer.QosFlowSetupResponse).UnmarshalPER(r, enc); err != nil { + return err + } + if p_QosFlowFailedToSetup { + if err := (&handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_DataForwardingResponseDRB { + if err := (&handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := handoverRequestAcknowledgeTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, HandoverRequestAcknowledgeTransfer]{ + { + ID: IDAdditionalDLUPTNLInformationForHOList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v AdditionalDLUPTNLInformationForHOList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalDLUPTNLInformationForHO = v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if len(x.AdditionalDLUPTNLInformationForHO) == 0 { + return nil, false + } + return x.AdditionalDLUPTNLInformationForHO, true + }, + }, + { + ID: IDULForwardingUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ULForwardingUPTNLInformation = &v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if x.ULForwardingUPTNLInformation == nil { + return nil, false + } + return x.ULForwardingUPTNLInformation, true + }, + }, + { + ID: IDAdditionalULForwardingUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalULForwardingUPTNLInformation = v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if len(x.AdditionalULForwardingUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalULForwardingUPTNLInformation, true + }, + }, + { + ID: IDDataForwardingResponseERABList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v DataForwardingResponseERABList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DataForwardingResponseERAB = v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if len(x.DataForwardingResponseERAB) == 0 { + return nil, false + } + return x.DataForwardingResponseERAB, true + }, + }, + { + ID: IDRedundantDLNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantDLNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if x.RedundantDLNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantDLNGUUPTNLInformation, true + }, + }, + { + ID: IDUsedRSNInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v RedundantPDUSessionInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UsedRSNInformation = &v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if x.UsedRSNInformation == nil { + return nil, false + } + return x.UsedRSNInformation, true + }, + }, + { + ID: IDGlobalRANNodeID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v GlobalRANNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.GlobalRANNodeID = &v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if x.GlobalRANNodeID == nil { + return nil, false + } + return x.GlobalRANNodeID, true + }, + }, + { + ID: IDMBSSupportIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSupportIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSupportIndicator = &v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if x.MBSSupportIndicator == nil { + return nil, false + } + return x.MBSSupportIndicator, true + }, + }, + { + ID: IDPDUSetbasedHandlingIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v PDUSetbasedHandlingIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PDUSetbasedHandlingIndicator = &v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if x.PDUSetbasedHandlingIndicator == nil { + return nil, false + } + return x.PDUSetbasedHandlingIndicator, true + }, + }, + { + ID: IDECNMarkingorCongestionInformationReportingStatus, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v ECNMarkingorCongestionInformationReportingStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ECNMarkingorCongestionInformationReportingStatus = v + return nil + }, + Encode: func(x *HandoverRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if len(x.ECNMarkingorCongestionInformationReportingStatus) == 0 { + return nil, false + } + return x.ECNMarkingorCongestionInformationReportingStatus, true + }, + }, +} + +func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil && handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if handoverRequestAcknowledgeTransfer.SecurityResult != nil && handoverRequestAcknowledgeTransfer.SecurityResult.Diagnose(d) { + notComprehended = true + } + if handoverRequestAcknowledgeTransfer.QosFlowSetupResponse.Diagnose(d) { + notComprehended = true + } + if handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup.Diagnose(d) { + notComprehended = true + } + if handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer.iEExtensions) + return notComprehended +} + +func (handoverRequiredTransfer *HandoverRequiredTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsHandoverRequiredTransfer, handoverRequiredTransfer, handoverRequiredTransfer.iEExtensions) + w.WriteBit(handoverRequiredTransfer.extensions.Present()) + w.WriteBit(handoverRequiredTransfer.DirectForwardingPathAvailability != nil) + w.WriteBit(len(ext) > 0) + if handoverRequiredTransfer.DirectForwardingPathAvailability != nil { + if err := (*handoverRequiredTransfer.DirectForwardingPathAvailability).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if handoverRequiredTransfer.extensions.Present() { + if err := handoverRequiredTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverRequiredTransfer *HandoverRequiredTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *handoverRequiredTransfer = HandoverRequiredTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DirectForwardingPathAvailability, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_DirectForwardingPathAvailability { + var v DirectForwardingPathAvailability + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverRequiredTransfer.DirectForwardingPathAvailability = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRequiredTransfer, handoverRequiredTransfer, &handoverRequiredTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := handoverRequiredTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsHandoverRequiredTransfer []ap.IESpec[ProtocolIEID, HandoverRequiredTransfer] + +func (handoverRequiredTransfer *HandoverRequiredTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if handoverRequiredTransfer.DirectForwardingPathAvailability != nil && handoverRequiredTransfer.DirectForwardingPathAvailability.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsHandoverRequiredTransfer, handoverRequiredTransfer, handoverRequiredTransfer.iEExtensions) + return notComprehended +} + +func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer.iEExtensions) + w.WriteBit(handoverResourceAllocationUnsuccessfulTransfer.extensions.Present()) + w.WriteBit(handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil) + w.WriteBit(len(ext) > 0) + if err := handoverResourceAllocationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil { + if err := (*handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if handoverResourceAllocationUnsuccessfulTransfer.extensions.Present() { + if err := handoverResourceAllocationUnsuccessfulTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *handoverResourceAllocationUnsuccessfulTransfer = HandoverResourceAllocationUnsuccessfulTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_CriticalityDiagnostics, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&handoverResourceAllocationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_CriticalityDiagnostics { + var v CriticalityDiagnostics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, &handoverResourceAllocationUnsuccessfulTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := handoverResourceAllocationUnsuccessfulTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsHandoverResourceAllocationUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, HandoverResourceAllocationUnsuccessfulTransfer] + +func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if handoverResourceAllocationUnsuccessfulTransfer.Cause.Diagnose(d) { + notComprehended = true + } + if handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil && handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer.iEExtensions) + return notComprehended +} + +func (handoverType HandoverType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumHandoverType.Encode(w, enc, handoverType) +} + +func (handoverType *HandoverType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumHandoverType.Decode(r, enc) + if err != nil { + return err + } + *handoverType = v + return nil +} + +func (handoverType HandoverType) Name() string { + return enumHandoverType.Name(handoverType) +} + +func (handoverType HandoverType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumHandoverType.Known(handoverType) +} + +func (iABAuthorized IABAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIABAuthorized.Encode(w, enc, iABAuthorized) +} + +func (iABAuthorized *IABAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIABAuthorized.Decode(r, enc) + if err != nil { + return err + } + *iABAuthorized = v + return nil +} + +func (iABAuthorized IABAuthorized) Name() string { + return enumIABAuthorized.Name(iABAuthorized) +} + +func (iABAuthorized IABAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIABAuthorized.Known(iABAuthorized) +} + +func (iABNodeIndication IABNodeIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIABNodeIndication.Encode(w, enc, iABNodeIndication) +} + +func (iABNodeIndication *IABNodeIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIABNodeIndication.Decode(r, enc) + if err != nil { + return err + } + *iABNodeIndication = v + return nil +} + +func (iABNodeIndication IABNodeIndication) Name() string { + return enumIABNodeIndication.Name(iABNodeIndication) +} + +func (iABNodeIndication IABNodeIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIABNodeIndication.Known(iABNodeIndication) +} + +func (iABSupported IABSupported) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIABSupported.Encode(w, enc, iABSupported) +} + +func (iABSupported *IABSupported) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIABSupported.Decode(r, enc) + if err != nil { + return err + } + *iABSupported = v + return nil +} + +func (iABSupported IABSupported) Name() string { + return enumIABSupported.Name(iABSupported) +} + +func (iABSupported IABSupported) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIABSupported.Known(iABSupported) +} + +func (immediateMDTNr *ImmediateMDTNr) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsImmediateMDTNr, immediateMDTNr, immediateMDTNr.iEExtensions) + w.WriteBit(immediateMDTNr.extensions.Present()) + w.WriteBit(immediateMDTNr.M1Configuration != nil) + w.WriteBit(immediateMDTNr.M4Configuration != nil) + w.WriteBit(immediateMDTNr.M5Configuration != nil) + w.WriteBit(immediateMDTNr.M6Configuration != nil) + w.WriteBit(immediateMDTNr.M7Configuration != nil) + w.WriteBit(immediateMDTNr.BluetoothMeasurementConfiguration != nil) + w.WriteBit(immediateMDTNr.WLANMeasurementConfiguration != nil) + w.WriteBit(immediateMDTNr.MDTLocationInfo != nil) + w.WriteBit(immediateMDTNr.SensorMeasurementConfiguration != nil) + w.WriteBit(len(ext) > 0) + if err := immediateMDTNr.MeasurementsToActivate.MarshalPER(w, enc); err != nil { + return err + } + if immediateMDTNr.M1Configuration != nil { + if err := (*immediateMDTNr.M1Configuration).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.M4Configuration != nil { + if err := (*immediateMDTNr.M4Configuration).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.M5Configuration != nil { + if err := (*immediateMDTNr.M5Configuration).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.M6Configuration != nil { + if err := (*immediateMDTNr.M6Configuration).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.M7Configuration != nil { + if err := (*immediateMDTNr.M7Configuration).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.BluetoothMeasurementConfiguration != nil { + if err := (*immediateMDTNr.BluetoothMeasurementConfiguration).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.WLANMeasurementConfiguration != nil { + if err := (*immediateMDTNr.WLANMeasurementConfiguration).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.MDTLocationInfo != nil { + if err := (*immediateMDTNr.MDTLocationInfo).MarshalPER(w, enc); err != nil { + return err + } + } + if immediateMDTNr.SensorMeasurementConfiguration != nil { + if err := (*immediateMDTNr.SensorMeasurementConfiguration).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if immediateMDTNr.extensions.Present() { + if err := immediateMDTNr.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (immediateMDTNr *ImmediateMDTNr) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *immediateMDTNr = ImmediateMDTNr{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_M1Configuration, err := r.ReadBit() + if err != nil { + return err + } + p_M4Configuration, err := r.ReadBit() + if err != nil { + return err + } + p_M5Configuration, err := r.ReadBit() + if err != nil { + return err + } + p_M6Configuration, err := r.ReadBit() + if err != nil { + return err + } + p_M7Configuration, err := r.ReadBit() + if err != nil { + return err + } + p_BluetoothMeasurementConfiguration, err := r.ReadBit() + if err != nil { + return err + } + p_WLANMeasurementConfiguration, err := r.ReadBit() + if err != nil { + return err + } + p_MDTLocationInfo, err := r.ReadBit() + if err != nil { + return err + } + p_SensorMeasurementConfiguration, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&immediateMDTNr.MeasurementsToActivate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_M1Configuration { + var v M1Configuration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.M1Configuration = &v + } + if p_M4Configuration { + var v M4Configuration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.M4Configuration = &v + } + if p_M5Configuration { + var v M5Configuration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.M5Configuration = &v + } + if p_M6Configuration { + var v M6Configuration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.M6Configuration = &v + } + if p_M7Configuration { + var v M7Configuration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.M7Configuration = &v + } + if p_BluetoothMeasurementConfiguration { + var v BluetoothMeasurementConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.BluetoothMeasurementConfiguration = &v + } + if p_WLANMeasurementConfiguration { + var v WLANMeasurementConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.WLANMeasurementConfiguration = &v + } + if p_MDTLocationInfo { + var v MDTLocationInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.MDTLocationInfo = &v + } + if p_SensorMeasurementConfiguration { + var v SensorMeasurementConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + immediateMDTNr.SensorMeasurementConfiguration = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsImmediateMDTNr, immediateMDTNr, &immediateMDTNr.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := immediateMDTNr.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsImmediateMDTNr []ap.IESpec[ProtocolIEID, ImmediateMDTNr] + +func (immediateMDTNr *ImmediateMDTNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if immediateMDTNr.M1Configuration != nil && immediateMDTNr.M1Configuration.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.M4Configuration != nil && immediateMDTNr.M4Configuration.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.M5Configuration != nil && immediateMDTNr.M5Configuration.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.M6Configuration != nil && immediateMDTNr.M6Configuration.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.M7Configuration != nil && immediateMDTNr.M7Configuration.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.BluetoothMeasurementConfiguration != nil && immediateMDTNr.BluetoothMeasurementConfiguration.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.WLANMeasurementConfiguration != nil && immediateMDTNr.WLANMeasurementConfiguration.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.MDTLocationInfo != nil && immediateMDTNr.MDTLocationInfo.Diagnose(d) { + notComprehended = true + } + if immediateMDTNr.SensorMeasurementConfiguration != nil && immediateMDTNr.SensorMeasurementConfiguration.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsImmediateMDTNr, immediateMDTNr, immediateMDTNr.iEExtensions) + return notComprehended +} + +func (includeBeamMeasurementsIndication IncludeBeamMeasurementsIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIncludeBeamMeasurementsIndication.Encode(w, enc, includeBeamMeasurementsIndication) +} + +func (includeBeamMeasurementsIndication *IncludeBeamMeasurementsIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIncludeBeamMeasurementsIndication.Decode(r, enc) + if err != nil { + return err + } + *includeBeamMeasurementsIndication = v + return nil +} + +func (includeBeamMeasurementsIndication IncludeBeamMeasurementsIndication) Name() string { + return enumIncludeBeamMeasurementsIndication.Name(includeBeamMeasurementsIndication) +} + +func (includeBeamMeasurementsIndication IncludeBeamMeasurementsIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIncludeBeamMeasurementsIndication.Known(includeBeamMeasurementsIndication) +} + +func (indicationofBitrateAdaptation IndicationofBitrateAdaptation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIndicationofBitrateAdaptation.Encode(w, enc, indicationofBitrateAdaptation) +} + +func (indicationofBitrateAdaptation *IndicationofBitrateAdaptation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIndicationofBitrateAdaptation.Decode(r, enc) + if err != nil { + return err + } + *indicationofBitrateAdaptation = v + return nil +} + +func (indicationofBitrateAdaptation IndicationofBitrateAdaptation) Name() string { + return enumIndicationofBitrateAdaptation.Name(indicationofBitrateAdaptation) +} + +func (indicationofBitrateAdaptation IndicationofBitrateAdaptation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIndicationofBitrateAdaptation.Known(indicationofBitrateAdaptation) +} + +func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNodesForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions) + w.WriteBit(infoOnRecommendedCellsAndRANNodesForPaging.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := infoOnRecommendedCellsAndRANNodesForPaging.RecommendedCellsForPaging.MarshalPER(w, enc); err != nil { + return err + } + if err := infoOnRecommendedCellsAndRANNodesForPaging.RecommendRANNodesForPaging.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if infoOnRecommendedCellsAndRANNodesForPaging.extensions.Present() { + if err := infoOnRecommendedCellsAndRANNodesForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNodesForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *infoOnRecommendedCellsAndRANNodesForPaging = InfoOnRecommendedCellsAndRANNodesForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&infoOnRecommendedCellsAndRANNodesForPaging.RecommendedCellsForPaging).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&infoOnRecommendedCellsAndRANNodesForPaging.RecommendRANNodesForPaging).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, &infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := infoOnRecommendedCellsAndRANNodesForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsInfoOnRecommendedCellsAndRANNodesForPaging []ap.IESpec[ProtocolIEID, InfoOnRecommendedCellsAndRANNodesForPaging] + +func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNodesForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if infoOnRecommendedCellsAndRANNodesForPaging.RecommendedCellsForPaging.Diagnose(d) { + notComprehended = true + } + if infoOnRecommendedCellsAndRANNodesForPaging.RecommendRANNodesForPaging.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions) + return notComprehended +} + +func (integrityProtectionIndication IntegrityProtectionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIntegrityProtectionIndication.Encode(w, enc, integrityProtectionIndication) +} + +func (integrityProtectionIndication *IntegrityProtectionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIntegrityProtectionIndication.Decode(r, enc) + if err != nil { + return err + } + *integrityProtectionIndication = v + return nil +} + +func (integrityProtectionIndication IntegrityProtectionIndication) Name() string { + return enumIntegrityProtectionIndication.Name(integrityProtectionIndication) +} + +func (integrityProtectionIndication IntegrityProtectionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIntegrityProtectionIndication.Known(integrityProtectionIndication) +} + +func (integrityProtectionResult IntegrityProtectionResult) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIntegrityProtectionResult.Encode(w, enc, integrityProtectionResult) +} + +func (integrityProtectionResult *IntegrityProtectionResult) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIntegrityProtectionResult.Decode(r, enc) + if err != nil { + return err + } + *integrityProtectionResult = v + return nil +} + +func (integrityProtectionResult IntegrityProtectionResult) Name() string { + return enumIntegrityProtectionResult.Name(integrityProtectionResult) +} + +func (integrityProtectionResult IntegrityProtectionResult) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIntegrityProtectionResult.Known(integrityProtectionResult) +} + +func (interSystemFailureIndication *InterSystemFailureIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsInterSystemFailureIndication, interSystemFailureIndication, interSystemFailureIndication.iEExtensions) + w.WriteBit(interSystemFailureIndication.extensions.Present()) + w.WriteBit(interSystemFailureIndication.UERLFReportContainer != nil) + w.WriteBit(len(ext) > 0) + if interSystemFailureIndication.UERLFReportContainer != nil { + if err := (*interSystemFailureIndication.UERLFReportContainer).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if interSystemFailureIndication.extensions.Present() { + if err := interSystemFailureIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (interSystemFailureIndication *InterSystemFailureIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *interSystemFailureIndication = InterSystemFailureIndication{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UERLFReportContainer, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_UERLFReportContainer { + var v UERLFReportContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + interSystemFailureIndication.UERLFReportContainer = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemFailureIndication, interSystemFailureIndication, &interSystemFailureIndication.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := interSystemFailureIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsInterSystemFailureIndication []ap.IESpec[ProtocolIEID, InterSystemFailureIndication] + +func (interSystemFailureIndication *InterSystemFailureIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if interSystemFailureIndication.UERLFReportContainer != nil && interSystemFailureIndication.UERLFReportContainer.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsInterSystemFailureIndication, interSystemFailureIndication, interSystemFailureIndication.iEExtensions) + return notComprehended +} + +func (interSystemHOReport *InterSystemHOReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsInterSystemHOReport, interSystemHOReport, interSystemHOReport.iEExtensions) + w.WriteBit(interSystemHOReport.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := interSystemHOReport.HandoverReportType.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if interSystemHOReport.extensions.Present() { + if err := interSystemHOReport.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (interSystemHOReport *InterSystemHOReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *interSystemHOReport = InterSystemHOReport{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&interSystemHOReport.HandoverReportType).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemHOReport, interSystemHOReport, &interSystemHOReport.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := interSystemHOReport.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsInterSystemHOReport []ap.IESpec[ProtocolIEID, InterSystemHOReport] + +func (interSystemHOReport *InterSystemHOReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if interSystemHOReport.HandoverReportType.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsInterSystemHOReport, interSystemHOReport, interSystemHOReport.iEExtensions) + return notComprehended +} + +func (interSystemHandoverReportType *InterSystemHandoverReportType) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{interSystemHandoverReportType.TooearlyIntersystemHO != nil, interSystemHandoverReportType.IntersystemUnnecessaryHO != nil, interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback != nil, interSystemHandoverReportType.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case interSystemHandoverReportType.TooearlyIntersystemHO != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*interSystemHandoverReportType.TooearlyIntersystemHO).MarshalPER(w, enc); err != nil { + return err + } + case interSystemHandoverReportType.IntersystemUnnecessaryHO != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*interSystemHandoverReportType.IntersystemUnnecessaryHO).MarshalPER(w, enc); err != nil { + return err + } + case interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemMobilityFailureforVoiceFallback, Criticality: interSystemHandoverReportType.choiceCriticality.Of(ap.CriticalityIgnore), Value: interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback}) + case interSystemHandoverReportType.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, interSystemHandoverReportType.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (interSystemHandoverReportType *InterSystemHandoverReportType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *interSystemHandoverReportType = InterSystemHandoverReportType{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v TooearlyIntersystemHO + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + interSystemHandoverReportType.TooearlyIntersystemHO = &v + case 1: + var v IntersystemUnnecessaryHO + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + interSystemHandoverReportType.IntersystemUnnecessaryHO = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDIntersystemMobilityFailureforVoiceFallback: + var v IntersystemMobilityFailureforVoiceFallback + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + interSystemHandoverReportType.ChoiceExtension = &f + break + } + interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback = &v + interSystemHandoverReportType.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + default: + interSystemHandoverReportType.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (interSystemHandoverReportType *InterSystemHandoverReportType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case interSystemHandoverReportType.TooearlyIntersystemHO != nil: + return interSystemHandoverReportType.TooearlyIntersystemHO.Diagnose(d) + case interSystemHandoverReportType.IntersystemUnnecessaryHO != nil: + return interSystemHandoverReportType.IntersystemUnnecessaryHO.Diagnose(d) + case interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback != nil: + d.IE(IDIntersystemMobilityFailureforVoiceFallback, interSystemHandoverReportType.choiceCriticality.Of(ap.CriticalityIgnore), interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback) + case interSystemHandoverReportType.ChoiceExtension != nil: + d.Unknown(interSystemHandoverReportType.ChoiceExtension.ID, interSystemHandoverReportType.ChoiceExtension.Criticality) + } + return false +} + +func (intersystemCellActivationReply *IntersystemCellActivationReply) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemCellActivationReply, intersystemCellActivationReply, intersystemCellActivationReply.iEExtensions) + w.WriteBit(intersystemCellActivationReply.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemCellActivationReply.ActivatedCellList.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemCellActivationReply.ActivationID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemCellActivationReply.extensions.Present() { + if err := intersystemCellActivationReply.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemCellActivationReply *IntersystemCellActivationReply) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemCellActivationReply = IntersystemCellActivationReply{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemCellActivationReply.ActivatedCellList).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemCellActivationReply.ActivationID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellActivationReply, intersystemCellActivationReply, &intersystemCellActivationReply.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemCellActivationReply.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemCellActivationReply []ap.IESpec[ProtocolIEID, IntersystemCellActivationReply] + +func (intersystemCellActivationReply *IntersystemCellActivationReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemCellActivationReply.ActivatedCellList.Diagnose(d) { + notComprehended = true + } + if intersystemCellActivationReply.ActivationID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemCellActivationReply, intersystemCellActivationReply, intersystemCellActivationReply.iEExtensions) + return notComprehended +} + +func (intersystemCellActivationRequest *IntersystemCellActivationRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, intersystemCellActivationRequest.iEExtensions) + w.WriteBit(intersystemCellActivationRequest.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemCellActivationRequest.ActivationID.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemCellActivationRequest.CellsToActivateList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemCellActivationRequest.extensions.Present() { + if err := intersystemCellActivationRequest.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemCellActivationRequest *IntersystemCellActivationRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemCellActivationRequest = IntersystemCellActivationRequest{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemCellActivationRequest.ActivationID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemCellActivationRequest.CellsToActivateList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, &intersystemCellActivationRequest.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemCellActivationRequest.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemCellActivationRequest []ap.IESpec[ProtocolIEID, IntersystemCellActivationRequest] + +func (intersystemCellActivationRequest *IntersystemCellActivationRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemCellActivationRequest.ActivationID.Diagnose(d) { + notComprehended = true + } + if intersystemCellActivationRequest.CellsToActivateList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, intersystemCellActivationRequest.iEExtensions) + return notComprehended +} + +func (intersystemCellStateIndication *IntersystemCellStateIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemCellStateIndication, intersystemCellStateIndication, intersystemCellStateIndication.iEExtensions) + w.WriteBit(intersystemCellStateIndication.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemCellStateIndication.NotificationCellList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemCellStateIndication.extensions.Present() { + if err := intersystemCellStateIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemCellStateIndication *IntersystemCellStateIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemCellStateIndication = IntersystemCellStateIndication{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemCellStateIndication.NotificationCellList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellStateIndication, intersystemCellStateIndication, &intersystemCellStateIndication.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemCellStateIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemCellStateIndication []ap.IESpec[ProtocolIEID, IntersystemCellStateIndication] + +func (intersystemCellStateIndication *IntersystemCellStateIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemCellStateIndication.NotificationCellList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemCellStateIndication, intersystemCellStateIndication, intersystemCellStateIndication.iEExtensions) + return notComprehended +} + +func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback.iEExtensions) + w.WriteBit(intersystemMobilityFailureforVoiceFallback.extensions.Present()) + w.WriteBit(intersystemMobilityFailureforVoiceFallback.ReconnectCellID != nil) + w.WriteBit(intersystemMobilityFailureforVoiceFallback.UERLFReportContainer != nil) + w.WriteBit(len(ext) > 0) + if err := intersystemMobilityFailureforVoiceFallback.SourcecellID.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemMobilityFailureforVoiceFallback.TargetcellID.MarshalPER(w, enc); err != nil { + return err + } + if intersystemMobilityFailureforVoiceFallback.ReconnectCellID != nil { + if err := (*intersystemMobilityFailureforVoiceFallback.ReconnectCellID).MarshalPER(w, enc); err != nil { + return err + } + } + if intersystemMobilityFailureforVoiceFallback.UERLFReportContainer != nil { + if err := (*intersystemMobilityFailureforVoiceFallback.UERLFReportContainer).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemMobilityFailureforVoiceFallback.extensions.Present() { + if err := intersystemMobilityFailureforVoiceFallback.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemMobilityFailureforVoiceFallback = IntersystemMobilityFailureforVoiceFallback{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ReconnectCellID, err := r.ReadBit() + if err != nil { + return err + } + p_UERLFReportContainer, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemMobilityFailureforVoiceFallback.SourcecellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemMobilityFailureforVoiceFallback.TargetcellID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_ReconnectCellID { + var v EUTRACGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemMobilityFailureforVoiceFallback.ReconnectCellID = &v + } + if p_UERLFReportContainer { + var v UERLFReportContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemMobilityFailureforVoiceFallback.UERLFReportContainer = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, &intersystemMobilityFailureforVoiceFallback.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemMobilityFailureforVoiceFallback.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemMobilityFailureforVoiceFallback []ap.IESpec[ProtocolIEID, IntersystemMobilityFailureforVoiceFallback] + +func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemMobilityFailureforVoiceFallback.SourcecellID.Diagnose(d) { + notComprehended = true + } + if intersystemMobilityFailureforVoiceFallback.TargetcellID.Diagnose(d) { + notComprehended = true + } + if intersystemMobilityFailureforVoiceFallback.ReconnectCellID != nil && intersystemMobilityFailureforVoiceFallback.ReconnectCellID.Diagnose(d) { + notComprehended = true + } + if intersystemMobilityFailureforVoiceFallback.UERLFReportContainer != nil && intersystemMobilityFailureforVoiceFallback.UERLFReportContainer.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback.iEExtensions) + return notComprehended +} + +func (intersystemResourceStatusReply *IntersystemResourceStatusReply) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, intersystemResourceStatusReply.iEExtensions) + w.WriteBit(intersystemResourceStatusReply.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemResourceStatusReply.Reportingsystem.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemResourceStatusReply.extensions.Present() { + if err := intersystemResourceStatusReply.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemResourceStatusReply *IntersystemResourceStatusReply) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemResourceStatusReply = IntersystemResourceStatusReply{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemResourceStatusReply.Reportingsystem).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, &intersystemResourceStatusReply.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemResourceStatusReply.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemResourceStatusReply []ap.IESpec[ProtocolIEID, IntersystemResourceStatusReply] + +func (intersystemResourceStatusReply *IntersystemResourceStatusReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemResourceStatusReply.Reportingsystem.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, intersystemResourceStatusReply.iEExtensions) + return notComprehended +} + +func (intersystemResourceStatusReport *IntersystemResourceStatusReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, intersystemResourceStatusReport.iEExtensions) + w.WriteBit(intersystemResourceStatusReport.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemResourceStatusReport.ReportingSystem.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemResourceStatusReport.extensions.Present() { + if err := intersystemResourceStatusReport.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemResourceStatusReport *IntersystemResourceStatusReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemResourceStatusReport = IntersystemResourceStatusReport{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemResourceStatusReport.ReportingSystem).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, &intersystemResourceStatusReport.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemResourceStatusReport.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemResourceStatusReport []ap.IESpec[ProtocolIEID, IntersystemResourceStatusReport] + +func (intersystemResourceStatusReport *IntersystemResourceStatusReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemResourceStatusReport.ReportingSystem.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, intersystemResourceStatusReport.iEExtensions) + return notComprehended +} + +func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, intersystemResourceStatusRequest.iEExtensions) + w.WriteBit(intersystemResourceStatusRequest.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemResourceStatusRequest.ReportingSystem.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemResourceStatusRequest.ReportCharacteristics.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemResourceStatusRequest.ReportType.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemResourceStatusRequest.extensions.Present() { + if err := intersystemResourceStatusRequest.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemResourceStatusRequest = IntersystemResourceStatusRequest{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemResourceStatusRequest.ReportingSystem).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemResourceStatusRequest.ReportCharacteristics).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemResourceStatusRequest.ReportType).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, &intersystemResourceStatusRequest.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemResourceStatusRequest.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemResourceStatusRequest []ap.IESpec[ProtocolIEID, IntersystemResourceStatusRequest] + +func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemResourceStatusRequest.ReportingSystem.Diagnose(d) { + notComprehended = true + } + if intersystemResourceStatusRequest.ReportType.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, intersystemResourceStatusRequest.iEExtensions) + return notComprehended +} + +func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer.iEExtensions) + w.WriteBit(intersystemSONConfigurationTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemSONConfigurationTransfer.TransferType.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemSONConfigurationTransfer.IntersystemSONInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemSONConfigurationTransfer.extensions.Present() { + if err := intersystemSONConfigurationTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONConfigurationTransfer = IntersystemSONConfigurationTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemSONConfigurationTransfer.TransferType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemSONConfigurationTransfer.IntersystemSONInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, &intersystemSONConfigurationTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemSONConfigurationTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemSONConfigurationTransfer []ap.IESpec[ProtocolIEID, IntersystemSONConfigurationTransfer] + +func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemSONConfigurationTransfer.TransferType.Diagnose(d) { + notComprehended = true + } + if intersystemSONConfigurationTransfer.IntersystemSONInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer.iEExtensions) + return notComprehended +} + +func (intersystemSONInformation *IntersystemSONInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{intersystemSONInformation.IntersystemSONInformationReport != nil, intersystemSONInformation.IntersystemSONInformationRequest != nil, intersystemSONInformation.IntersystemSONInformationReply != nil, intersystemSONInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case intersystemSONInformation.IntersystemSONInformationReport != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*intersystemSONInformation.IntersystemSONInformationReport).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONInformation.IntersystemSONInformationRequest != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemSONInformationRequest, Criticality: intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformation.IntersystemSONInformationRequest}) + case intersystemSONInformation.IntersystemSONInformationReply != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemSONInformationReply, Criticality: intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformation.IntersystemSONInformationReply}) + case intersystemSONInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, intersystemSONInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (intersystemSONInformation *IntersystemSONInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONInformation = IntersystemSONInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v IntersystemSONInformationReport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONInformation.IntersystemSONInformationReport = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDIntersystemSONInformationRequest: + var v IntersystemSONInformationRequest + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + intersystemSONInformation.ChoiceExtension = &f + break + } + intersystemSONInformation.IntersystemSONInformationRequest = &v + intersystemSONInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDIntersystemSONInformationReply: + var v IntersystemSONInformationReply + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + intersystemSONInformation.ChoiceExtension = &f + break + } + intersystemSONInformation.IntersystemSONInformationReply = &v + intersystemSONInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + default: + intersystemSONInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (intersystemSONInformation *IntersystemSONInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case intersystemSONInformation.IntersystemSONInformationReport != nil: + return intersystemSONInformation.IntersystemSONInformationReport.Diagnose(d) + case intersystemSONInformation.IntersystemSONInformationRequest != nil: + d.IE(IDIntersystemSONInformationRequest, intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformation.IntersystemSONInformationRequest) + case intersystemSONInformation.IntersystemSONInformationReply != nil: + d.IE(IDIntersystemSONInformationReply, intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformation.IntersystemSONInformationReply) + case intersystemSONInformation.ChoiceExtension != nil: + d.Unknown(intersystemSONInformation.ChoiceExtension.ID, intersystemSONInformation.ChoiceExtension.Criticality) + } + return false +} + +func (intersystemSONInformationReply *IntersystemSONInformationReply) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{intersystemSONInformationReply.NGRANCellActivation != nil, intersystemSONInformationReply.ResourceStatus != nil, intersystemSONInformationReply.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case intersystemSONInformationReply.NGRANCellActivation != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*intersystemSONInformationReply.NGRANCellActivation).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONInformationReply.ResourceStatus != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*intersystemSONInformationReply.ResourceStatus).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONInformationReply.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, intersystemSONInformationReply.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (intersystemSONInformationReply *IntersystemSONInformationReply) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONInformationReply = IntersystemSONInformationReply{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v IntersystemCellActivationReply + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONInformationReply.NGRANCellActivation = &v + case 1: + var v IntersystemResourceStatusReply + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONInformationReply.ResourceStatus = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + intersystemSONInformationReply.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (intersystemSONInformationReply *IntersystemSONInformationReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case intersystemSONInformationReply.NGRANCellActivation != nil: + return intersystemSONInformationReply.NGRANCellActivation.Diagnose(d) + case intersystemSONInformationReply.ResourceStatus != nil: + return intersystemSONInformationReply.ResourceStatus.Diagnose(d) + case intersystemSONInformationReply.ChoiceExtension != nil: + d.Unknown(intersystemSONInformationReply.ChoiceExtension.ID, intersystemSONInformationReply.ChoiceExtension.Criticality) + } + return false +} + +func (intersystemSONInformationReport *IntersystemSONInformationReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{intersystemSONInformationReport.HOReportInformation != nil, intersystemSONInformationReport.FailureIndicationInformation != nil, intersystemSONInformationReport.EnergySavingIndication != nil, intersystemSONInformationReport.IntersystemResourceStatusUpdate != nil, intersystemSONInformationReport.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case intersystemSONInformationReport.HOReportInformation != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*intersystemSONInformationReport.HOReportInformation).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONInformationReport.FailureIndicationInformation != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*intersystemSONInformationReport.FailureIndicationInformation).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONInformationReport.EnergySavingIndication != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDEnergySavingIndication, Criticality: intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformationReport.EnergySavingIndication}) + case intersystemSONInformationReport.IntersystemResourceStatusUpdate != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemResourceStatusUpdate, Criticality: intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformationReport.IntersystemResourceStatusUpdate}) + case intersystemSONInformationReport.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, intersystemSONInformationReport.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (intersystemSONInformationReport *IntersystemSONInformationReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONInformationReport = IntersystemSONInformationReport{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v InterSystemHOReport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONInformationReport.HOReportInformation = &v + case 1: + var v InterSystemFailureIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONInformationReport.FailureIndicationInformation = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDEnergySavingIndication: + var v IntersystemCellStateIndication + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + intersystemSONInformationReport.ChoiceExtension = &f + break + } + intersystemSONInformationReport.EnergySavingIndication = &v + intersystemSONInformationReport.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDIntersystemResourceStatusUpdate: + var v IntersystemResourceStatusReport + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + intersystemSONInformationReport.ChoiceExtension = &f + break + } + intersystemSONInformationReport.IntersystemResourceStatusUpdate = &v + intersystemSONInformationReport.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + default: + intersystemSONInformationReport.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (intersystemSONInformationReport *IntersystemSONInformationReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case intersystemSONInformationReport.HOReportInformation != nil: + return intersystemSONInformationReport.HOReportInformation.Diagnose(d) + case intersystemSONInformationReport.FailureIndicationInformation != nil: + return intersystemSONInformationReport.FailureIndicationInformation.Diagnose(d) + case intersystemSONInformationReport.EnergySavingIndication != nil: + d.IE(IDEnergySavingIndication, intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformationReport.EnergySavingIndication) + case intersystemSONInformationReport.IntersystemResourceStatusUpdate != nil: + d.IE(IDIntersystemResourceStatusUpdate, intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformationReport.IntersystemResourceStatusUpdate) + case intersystemSONInformationReport.ChoiceExtension != nil: + d.Unknown(intersystemSONInformationReport.ChoiceExtension.ID, intersystemSONInformationReport.ChoiceExtension.Criticality) + } + return false +} + +func (intersystemSONInformationRequest *IntersystemSONInformationRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{intersystemSONInformationRequest.NGRANCellActivation != nil, intersystemSONInformationRequest.ResourceStatus != nil, intersystemSONInformationRequest.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case intersystemSONInformationRequest.NGRANCellActivation != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*intersystemSONInformationRequest.NGRANCellActivation).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONInformationRequest.ResourceStatus != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*intersystemSONInformationRequest.ResourceStatus).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONInformationRequest.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, intersystemSONInformationRequest.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (intersystemSONInformationRequest *IntersystemSONInformationRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONInformationRequest = IntersystemSONInformationRequest{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v IntersystemCellActivationRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONInformationRequest.NGRANCellActivation = &v + case 1: + var v IntersystemResourceStatusRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONInformationRequest.ResourceStatus = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + intersystemSONInformationRequest.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (intersystemSONInformationRequest *IntersystemSONInformationRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case intersystemSONInformationRequest.NGRANCellActivation != nil: + return intersystemSONInformationRequest.NGRANCellActivation.Diagnose(d) + case intersystemSONInformationRequest.ResourceStatus != nil: + return intersystemSONInformationRequest.ResourceStatus.Diagnose(d) + case intersystemSONInformationRequest.ChoiceExtension != nil: + d.Unknown(intersystemSONInformationRequest.ChoiceExtension.ID, intersystemSONInformationRequest.ChoiceExtension.Criticality) + } + return false +} + +func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, intersystemSONNGRANnodeID.iEExtensions) + w.WriteBit(intersystemSONNGRANnodeID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemSONNGRANnodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemSONNGRANnodeID.SelectedTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemSONNGRANnodeID.extensions.Present() { + if err := intersystemSONNGRANnodeID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONNGRANnodeID = IntersystemSONNGRANnodeID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemSONNGRANnodeID.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemSONNGRANnodeID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, &intersystemSONNGRANnodeID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemSONNGRANnodeID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemSONNGRANnodeID []ap.IESpec[ProtocolIEID, IntersystemSONNGRANnodeID] + +func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemSONNGRANnodeID.GlobalRANNodeID.Diagnose(d) { + notComprehended = true + } + if intersystemSONNGRANnodeID.SelectedTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, intersystemSONNGRANnodeID.iEExtensions) + return notComprehended +} + +func (intersystemSONTransferType *IntersystemSONTransferType) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{intersystemSONTransferType.FromEUTRANtoNGRAN != nil, intersystemSONTransferType.FromNGRANtoEUTRAN != nil, intersystemSONTransferType.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case intersystemSONTransferType.FromEUTRANtoNGRAN != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*intersystemSONTransferType.FromEUTRANtoNGRAN).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONTransferType.FromNGRANtoEUTRAN != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*intersystemSONTransferType.FromNGRANtoEUTRAN).MarshalPER(w, enc); err != nil { + return err + } + case intersystemSONTransferType.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, intersystemSONTransferType.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (intersystemSONTransferType *IntersystemSONTransferType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONTransferType = IntersystemSONTransferType{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v FromEUTRANtoNGRAN + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONTransferType.FromEUTRANtoNGRAN = &v + case 1: + var v FromNGRANtoEUTRAN + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + intersystemSONTransferType.FromNGRANtoEUTRAN = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + intersystemSONTransferType.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (intersystemSONTransferType *IntersystemSONTransferType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case intersystemSONTransferType.FromEUTRANtoNGRAN != nil: + return intersystemSONTransferType.FromEUTRANtoNGRAN.Diagnose(d) + case intersystemSONTransferType.FromNGRANtoEUTRAN != nil: + return intersystemSONTransferType.FromNGRANtoEUTRAN.Diagnose(d) + case intersystemSONTransferType.ChoiceExtension != nil: + d.Unknown(intersystemSONTransferType.ChoiceExtension.ID, intersystemSONTransferType.ChoiceExtension.Criticality) + } + return false +} + +func (intersystemSONeNBID *IntersystemSONeNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemSONeNBID, intersystemSONeNBID, intersystemSONeNBID.iEExtensions) + w.WriteBit(intersystemSONeNBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemSONeNBID.GlobaleNBID.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemSONeNBID.SelectedEPSTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemSONeNBID.extensions.Present() { + if err := intersystemSONeNBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemSONeNBID *IntersystemSONeNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemSONeNBID = IntersystemSONeNBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemSONeNBID.GlobaleNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemSONeNBID.SelectedEPSTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONeNBID, intersystemSONeNBID, &intersystemSONeNBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemSONeNBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemSONeNBID []ap.IESpec[ProtocolIEID, IntersystemSONeNBID] + +func (intersystemSONeNBID *IntersystemSONeNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemSONeNBID.GlobaleNBID.Diagnose(d) { + notComprehended = true + } + if intersystemSONeNBID.SelectedEPSTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemSONeNBID, intersystemSONeNBID, intersystemSONeNBID.iEExtensions) + return notComprehended +} + +func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, intersystemUnnecessaryHO.iEExtensions) + w.WriteBit(intersystemUnnecessaryHO.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := intersystemUnnecessaryHO.SourcecellID.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemUnnecessaryHO.TargetcellID.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemUnnecessaryHO.EarlyIRATHO.MarshalPER(w, enc); err != nil { + return err + } + if err := intersystemUnnecessaryHO.CandidateCellList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemUnnecessaryHO.extensions.Present() { + if err := intersystemUnnecessaryHO.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemUnnecessaryHO = IntersystemUnnecessaryHO{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&intersystemUnnecessaryHO.SourcecellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemUnnecessaryHO.TargetcellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemUnnecessaryHO.EarlyIRATHO).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&intersystemUnnecessaryHO.CandidateCellList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, &intersystemUnnecessaryHO.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemUnnecessaryHO.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemUnnecessaryHO []ap.IESpec[ProtocolIEID, IntersystemUnnecessaryHO] + +func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemUnnecessaryHO.SourcecellID.Diagnose(d) { + notComprehended = true + } + if intersystemUnnecessaryHO.TargetcellID.Diagnose(d) { + notComprehended = true + } + if intersystemUnnecessaryHO.EarlyIRATHO.Diagnose(d) { + notComprehended = true + } + if intersystemUnnecessaryHO.CandidateCellList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, intersystemUnnecessaryHO.iEExtensions) + return notComprehended +} + +func (intersystemUnnecessaryHOEarlyIRATHO IntersystemUnnecessaryHOEarlyIRATHO) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIntersystemUnnecessaryHOEarlyIRATHO.Encode(w, enc, intersystemUnnecessaryHOEarlyIRATHO) +} + +func (intersystemUnnecessaryHOEarlyIRATHO *IntersystemUnnecessaryHOEarlyIRATHO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIntersystemUnnecessaryHOEarlyIRATHO.Decode(r, enc) + if err != nil { + return err + } + *intersystemUnnecessaryHOEarlyIRATHO = v + return nil +} + +func (intersystemUnnecessaryHOEarlyIRATHO IntersystemUnnecessaryHOEarlyIRATHO) Name() string { + return enumIntersystemUnnecessaryHOEarlyIRATHO.Name(intersystemUnnecessaryHOEarlyIRATHO) +} + +func (intersystemUnnecessaryHOEarlyIRATHO IntersystemUnnecessaryHOEarlyIRATHO) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIntersystemUnnecessaryHOEarlyIRATHO.Known(intersystemUnnecessaryHOEarlyIRATHO) +} + +func (lAI *LAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLAI, lAI, lAI.iEExtensions) + w.WriteBit(lAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := lAI.LAC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lAI.extensions.Present() { + if err := lAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lAI *LAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lAI = LAI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lAI.LAC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLAI, lAI, &lAI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lAI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLAI []ap.IESpec[ProtocolIEID, LAI] + +func (lAI *LAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsLAI, lAI, lAI.iEExtensions) + return notComprehended +} + +func (lPWUSDisableIndication LPWUSDisableIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLPWUSDisableIndication.Encode(w, enc, lPWUSDisableIndication) +} + +func (lPWUSDisableIndication *LPWUSDisableIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLPWUSDisableIndication.Decode(r, enc) + if err != nil { + return err + } + *lPWUSDisableIndication = v + return nil +} + +func (lPWUSDisableIndication LPWUSDisableIndication) Name() string { + return enumLPWUSDisableIndication.Name(lPWUSDisableIndication) +} + +func (lPWUSDisableIndication LPWUSDisableIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLPWUSDisableIndication.Known(lPWUSDisableIndication) +} + +func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation.iEExtensions) + w.WriteBit(lPWUSPSAssistanceInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lPWUSPSAssistanceInformation.LPWUScNsubgroupID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lPWUSPSAssistanceInformation.extensions.Present() { + if err := lPWUSPSAssistanceInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lPWUSPSAssistanceInformation = LPWUSPSAssistanceInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lPWUSPSAssistanceInformation.LPWUScNsubgroupID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, &lPWUSPSAssistanceInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lPWUSPSAssistanceInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLPWUSPSAssistanceInformation []ap.IESpec[ProtocolIEID, LPWUSPSAssistanceInformation] + +func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lPWUSPSAssistanceInformation.LPWUScNsubgroupID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation.iEExtensions) + return notComprehended +} + +func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, lTEA2XServicesAuthorized.iEExtensions) + w.WriteBit(lTEA2XServicesAuthorized.extensions.Present()) + w.WriteBit(lTEA2XServicesAuthorized.AerialUE != nil) + w.WriteBit(lTEA2XServicesAuthorized.AerialControllerUE != nil) + w.WriteBit(len(ext) > 0) + if lTEA2XServicesAuthorized.AerialUE != nil { + if err := (*lTEA2XServicesAuthorized.AerialUE).MarshalPER(w, enc); err != nil { + return err + } + } + if lTEA2XServicesAuthorized.AerialControllerUE != nil { + if err := (*lTEA2XServicesAuthorized.AerialControllerUE).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lTEA2XServicesAuthorized.extensions.Present() { + if err := lTEA2XServicesAuthorized.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lTEA2XServicesAuthorized = LTEA2XServicesAuthorized{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AerialUE, err := r.ReadBit() + if err != nil { + return err + } + p_AerialControllerUE, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_AerialUE { + var v LTEA2XServicesAuthorizedAerialUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lTEA2XServicesAuthorized.AerialUE = &v + } + if p_AerialControllerUE { + var v LTEA2XServicesAuthorizedAerialControllerUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lTEA2XServicesAuthorized.AerialControllerUE = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, &lTEA2XServicesAuthorized.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lTEA2XServicesAuthorized.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLTEA2XServicesAuthorized []ap.IESpec[ProtocolIEID, LTEA2XServicesAuthorized] + +func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lTEA2XServicesAuthorized.AerialUE != nil && lTEA2XServicesAuthorized.AerialUE.Diagnose(d) { + notComprehended = true + } + if lTEA2XServicesAuthorized.AerialControllerUE != nil && lTEA2XServicesAuthorized.AerialControllerUE.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, lTEA2XServicesAuthorized.iEExtensions) + return notComprehended +} + +func (lTEA2XServicesAuthorizedAerialControllerUE LTEA2XServicesAuthorizedAerialControllerUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLTEA2XServicesAuthorizedAerialControllerUE.Encode(w, enc, lTEA2XServicesAuthorizedAerialControllerUE) +} + +func (lTEA2XServicesAuthorizedAerialControllerUE *LTEA2XServicesAuthorizedAerialControllerUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLTEA2XServicesAuthorizedAerialControllerUE.Decode(r, enc) + if err != nil { + return err + } + *lTEA2XServicesAuthorizedAerialControllerUE = v + return nil +} + +func (lTEA2XServicesAuthorizedAerialControllerUE LTEA2XServicesAuthorizedAerialControllerUE) Name() string { + return enumLTEA2XServicesAuthorizedAerialControllerUE.Name(lTEA2XServicesAuthorizedAerialControllerUE) +} + +func (lTEA2XServicesAuthorizedAerialControllerUE LTEA2XServicesAuthorizedAerialControllerUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLTEA2XServicesAuthorizedAerialControllerUE.Known(lTEA2XServicesAuthorizedAerialControllerUE) +} + +func (lTEA2XServicesAuthorizedAerialUE LTEA2XServicesAuthorizedAerialUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLTEA2XServicesAuthorizedAerialUE.Encode(w, enc, lTEA2XServicesAuthorizedAerialUE) +} + +func (lTEA2XServicesAuthorizedAerialUE *LTEA2XServicesAuthorizedAerialUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLTEA2XServicesAuthorizedAerialUE.Decode(r, enc) + if err != nil { + return err + } + *lTEA2XServicesAuthorizedAerialUE = v + return nil +} + +func (lTEA2XServicesAuthorizedAerialUE LTEA2XServicesAuthorizedAerialUE) Name() string { + return enumLTEA2XServicesAuthorizedAerialUE.Name(lTEA2XServicesAuthorizedAerialUE) +} + +func (lTEA2XServicesAuthorizedAerialUE LTEA2XServicesAuthorizedAerialUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLTEA2XServicesAuthorizedAerialUE.Known(lTEA2XServicesAuthorizedAerialUE) +} + +func (lTEMIndication LTEMIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLTEMIndication.Encode(w, enc, lTEMIndication) +} + +func (lTEMIndication *LTEMIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLTEMIndication.Decode(r, enc) + if err != nil { + return err + } + *lTEMIndication = v + return nil +} + +func (lTEMIndication LTEMIndication) Name() string { + return enumLTEMIndication.Name(lTEMIndication) +} + +func (lTEMIndication LTEMIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLTEMIndication.Known(lTEMIndication) +} + +func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate.iEExtensions) + w.WriteBit(lTEUESidelinkAggregateMaximumBitrate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lTEUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lTEUESidelinkAggregateMaximumBitrate.extensions.Present() { + if err := lTEUESidelinkAggregateMaximumBitrate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lTEUESidelinkAggregateMaximumBitrate = LTEUESidelinkAggregateMaximumBitrate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lTEUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, &lTEUESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lTEUESidelinkAggregateMaximumBitrate.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLTEUESidelinkAggregateMaximumBitrate []ap.IESpec[ProtocolIEID, LTEUESidelinkAggregateMaximumBitrate] + +func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lTEUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate.iEExtensions) + return notComprehended +} + +func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, lTEV2XServicesAuthorized.iEExtensions) + w.WriteBit(lTEV2XServicesAuthorized.extensions.Present()) + w.WriteBit(lTEV2XServicesAuthorized.VehicleUE != nil) + w.WriteBit(lTEV2XServicesAuthorized.PedestrianUE != nil) + w.WriteBit(len(ext) > 0) + if lTEV2XServicesAuthorized.VehicleUE != nil { + if err := (*lTEV2XServicesAuthorized.VehicleUE).MarshalPER(w, enc); err != nil { + return err + } + } + if lTEV2XServicesAuthorized.PedestrianUE != nil { + if err := (*lTEV2XServicesAuthorized.PedestrianUE).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lTEV2XServicesAuthorized.extensions.Present() { + if err := lTEV2XServicesAuthorized.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lTEV2XServicesAuthorized = LTEV2XServicesAuthorized{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_VehicleUE, err := r.ReadBit() + if err != nil { + return err + } + p_PedestrianUE, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_VehicleUE { + var v VehicleUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lTEV2XServicesAuthorized.VehicleUE = &v + } + if p_PedestrianUE { + var v PedestrianUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lTEV2XServicesAuthorized.PedestrianUE = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, &lTEV2XServicesAuthorized.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lTEV2XServicesAuthorized.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLTEV2XServicesAuthorized []ap.IESpec[ProtocolIEID, LTEV2XServicesAuthorized] + +func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lTEV2XServicesAuthorized.VehicleUE != nil && lTEV2XServicesAuthorized.VehicleUE.Diagnose(d) { + notComprehended = true + } + if lTEV2XServicesAuthorized.PedestrianUE != nil && lTEV2XServicesAuthorized.PedestrianUE.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, lTEV2XServicesAuthorized.iEExtensions) + return notComprehended +} + +func (lastVisitedCellInformation *LastVisitedCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{lastVisitedCellInformation.NGRANCell != nil, lastVisitedCellInformation.EUTRANCell != nil, lastVisitedCellInformation.UTRANCell != nil, lastVisitedCellInformation.GERANCell != nil, lastVisitedCellInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case lastVisitedCellInformation.NGRANCell != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 0); err != nil { + return err + } + if err := (*lastVisitedCellInformation.NGRANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellInformation.EUTRANCell != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 1); err != nil { + return err + } + if err := (*lastVisitedCellInformation.EUTRANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellInformation.UTRANCell != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 2); err != nil { + return err + } + if err := (*lastVisitedCellInformation.UTRANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellInformation.GERANCell != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 3); err != nil { + return err + } + if err := (*lastVisitedCellInformation.GERANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, lastVisitedCellInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (lastVisitedCellInformation *LastVisitedCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedCellInformation = LastVisitedCellInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 4) + if err != nil { + return err + } + switch idx { + case 0: + var v LastVisitedNGRANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellInformation.NGRANCell = &v + case 1: + var v LastVisitedEUTRANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellInformation.EUTRANCell = &v + case 2: + var v LastVisitedUTRANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellInformation.UTRANCell = &v + case 3: + var v LastVisitedGERANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellInformation.GERANCell = &v + case 4: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + lastVisitedCellInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (lastVisitedCellInformation *LastVisitedCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case lastVisitedCellInformation.NGRANCell != nil: + return lastVisitedCellInformation.NGRANCell.Diagnose(d) + case lastVisitedCellInformation.EUTRANCell != nil: + case lastVisitedCellInformation.UTRANCell != nil: + case lastVisitedCellInformation.GERANCell != nil: + case lastVisitedCellInformation.ChoiceExtension != nil: + d.Unknown(lastVisitedCellInformation.ChoiceExtension.ID, lastVisitedCellInformation.ChoiceExtension.Criticality) + } + return false +} + +func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLastVisitedCellItem, lastVisitedCellItem, lastVisitedCellItem.iEExtensions) + w.WriteBit(lastVisitedCellItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lastVisitedCellItem.LastVisitedCellInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lastVisitedCellItem.extensions.Present() { + if err := lastVisitedCellItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedCellItem = LastVisitedCellItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lastVisitedCellItem.LastVisitedCellInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedCellItem, lastVisitedCellItem, &lastVisitedCellItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lastVisitedCellItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLastVisitedCellItem []ap.IESpec[ProtocolIEID, LastVisitedCellItem] + +func (lastVisitedCellItem *LastVisitedCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lastVisitedCellItem.LastVisitedCellInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLastVisitedCellItem, lastVisitedCellItem, lastVisitedCellItem.iEExtensions) + return notComprehended +} + +func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation.iEExtensions) + w.WriteBit(lastVisitedNGRANCellInformation.extensions.Present()) + w.WriteBit(lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity != nil) + w.WriteBit(lastVisitedNGRANCellInformation.HOCauseValue != nil) + w.WriteBit(len(ext) > 0) + if err := lastVisitedNGRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedNGRANCellInformation.CellType.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedNGRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { + return err + } + if lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity != nil { + if err := (*lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity).MarshalPER(w, enc); err != nil { + return err + } + } + if lastVisitedNGRANCellInformation.HOCauseValue != nil { + if err := (*lastVisitedNGRANCellInformation.HOCauseValue).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lastVisitedNGRANCellInformation.extensions.Present() { + if err := lastVisitedNGRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedNGRANCellInformation = LastVisitedNGRANCellInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TimeUEStayedInCellEnhancedGranularity, err := r.ReadBit() + if err != nil { + return err + } + p_HOCauseValue, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lastVisitedNGRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedNGRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedNGRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TimeUEStayedInCellEnhancedGranularity { + var v TimeUEStayedInCellEnhancedGranularity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity = &v + } + if p_HOCauseValue { + var v Cause + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedNGRANCellInformation.HOCauseValue = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, &lastVisitedNGRANCellInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lastVisitedNGRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLastVisitedNGRANCellInformation = []ap.IESpec[ProtocolIEID, LastVisitedNGRANCellInformation]{ + { + ID: IDLastVisitedPSCellList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LastVisitedNGRANCellInformation, r *per.Reader, enc per.Encoding) error { + var v LastVisitedPSCellList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LastVisitedPSCellList = v + return nil + }, + Encode: func(x *LastVisitedNGRANCellInformation) (per.Marshaler, bool) { + if len(x.LastVisitedPSCellList) == 0 { + return nil, false + } + return x.LastVisitedPSCellList, true + }, + }, +} + +func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lastVisitedNGRANCellInformation.GlobalCellID.Diagnose(d) { + notComprehended = true + } + if lastVisitedNGRANCellInformation.CellType.Diagnose(d) { + notComprehended = true + } + if lastVisitedNGRANCellInformation.HOCauseValue != nil && lastVisitedNGRANCellInformation.HOCauseValue.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation.iEExtensions) + return notComprehended +} + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + w.WriteBit(lastVisitedPSCellInformation.extensions.Present()) + w.WriteBit(lastVisitedPSCellInformation.PSCellID != nil) + w.WriteBit(len(ext) > 0) + if lastVisitedPSCellInformation.PSCellID != nil { + if err := (*lastVisitedPSCellInformation.PSCellID).MarshalPER(w, enc); err != nil { + return err + } + } + if err := lastVisitedPSCellInformation.TimeStay.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lastVisitedPSCellInformation.extensions.Present() { + if err := lastVisitedPSCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedPSCellInformation = LastVisitedPSCellInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PSCellID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_PSCellID { + var v NGRANCGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedPSCellInformation.PSCellID = &v + } + if err := (&lastVisitedPSCellInformation.TimeStay).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lastVisitedPSCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLastVisitedPSCellInformation = []ap.IESpec[ProtocolIEID, LastVisitedPSCellInformation]{ + { + ID: IDSCGActivationTime, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LastVisitedPSCellInformation, r *per.Reader, enc per.Encoding) error { + var v SCGActivationTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SCGActivationTime = &v + return nil + }, + Encode: func(x *LastVisitedPSCellInformation) (per.Marshaler, bool) { + if x.SCGActivationTime == nil { + return nil, false + } + return x.SCGActivationTime, true + }, + }, +} + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lastVisitedPSCellInformation.PSCellID != nil && lastVisitedPSCellInformation.PSCellID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + return notComprehended +} + +func (lineType LineType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLineType.Encode(w, enc, lineType) +} + +func (lineType *LineType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLineType.Decode(r, enc) + if err != nil { + return err + } + *lineType = v + return nil +} + +func (lineType LineType) Name() string { + return enumLineType.Name(lineType) +} + +func (lineType LineType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLineType.Known(lineType) +} + +func (linkstolog Linkstolog) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLinkstolog.Encode(w, enc, linkstolog) +} + +func (linkstolog *Linkstolog) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLinkstolog.Decode(r, enc) + if err != nil { + return err + } + *linkstolog = v + return nil +} + +func (linkstolog Linkstolog) Name() string { + return enumLinkstolog.Name(linkstolog) +} + +func (linkstolog Linkstolog) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLinkstolog.Known(linkstolog) +} + +func (locationReportingAdditionalInfo LocationReportingAdditionalInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLocationReportingAdditionalInfo.Encode(w, enc, locationReportingAdditionalInfo) +} + +func (locationReportingAdditionalInfo *LocationReportingAdditionalInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLocationReportingAdditionalInfo.Decode(r, enc) + if err != nil { + return err + } + *locationReportingAdditionalInfo = v + return nil +} + +func (locationReportingAdditionalInfo LocationReportingAdditionalInfo) Name() string { + return enumLocationReportingAdditionalInfo.Name(locationReportingAdditionalInfo) +} + +func (locationReportingAdditionalInfo LocationReportingAdditionalInfo) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLocationReportingAdditionalInfo.Known(locationReportingAdditionalInfo) +} + +func (locationReportingRequestType *LocationReportingRequestType) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLocationReportingRequestType, locationReportingRequestType, locationReportingRequestType.iEExtensions) + w.WriteBit(locationReportingRequestType.extensions.Present()) + w.WriteBit(locationReportingRequestType.AreaOfInterestList != nil) + w.WriteBit(locationReportingRequestType.LocationReportingReferenceIDToBeCancelled != nil) + w.WriteBit(len(ext) > 0) + if err := locationReportingRequestType.EventType.MarshalPER(w, enc); err != nil { + return err + } + if err := locationReportingRequestType.ReportArea.MarshalPER(w, enc); err != nil { + return err + } + if locationReportingRequestType.AreaOfInterestList != nil { + if err := locationReportingRequestType.AreaOfInterestList.MarshalPER(w, enc); err != nil { + return err + } + } + if locationReportingRequestType.LocationReportingReferenceIDToBeCancelled != nil { + if err := (*locationReportingRequestType.LocationReportingReferenceIDToBeCancelled).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if locationReportingRequestType.extensions.Present() { + if err := locationReportingRequestType.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (locationReportingRequestType *LocationReportingRequestType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *locationReportingRequestType = LocationReportingRequestType{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AreaOfInterestList, err := r.ReadBit() + if err != nil { + return err + } + p_LocationReportingReferenceIDToBeCancelled, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&locationReportingRequestType.EventType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&locationReportingRequestType.ReportArea).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AreaOfInterestList { + if err := (&locationReportingRequestType.AreaOfInterestList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_LocationReportingReferenceIDToBeCancelled { + var v LocationReportingReferenceID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + locationReportingRequestType.LocationReportingReferenceIDToBeCancelled = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLocationReportingRequestType, locationReportingRequestType, &locationReportingRequestType.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := locationReportingRequestType.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLocationReportingRequestType = []ap.IESpec[ProtocolIEID, LocationReportingRequestType]{ + { + ID: IDLocationReportingAdditionalInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LocationReportingRequestType, r *per.Reader, enc per.Encoding) error { + var v LocationReportingAdditionalInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LocationReportingAdditionalInfo = &v + return nil + }, + Encode: func(x *LocationReportingRequestType) (per.Marshaler, bool) { + if x.LocationReportingAdditionalInfo == nil { + return nil, false + } + return x.LocationReportingAdditionalInfo, true + }, + }, + { + ID: IDAdditionalCancelledlocationReportingReferenceIDList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *LocationReportingRequestType, r *per.Reader, enc per.Encoding) error { + var v AdditionalCancelledlocationReportingReferenceIDList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalCancelledlocationReportingReferenceIDList = v + return nil + }, + Encode: func(x *LocationReportingRequestType) (per.Marshaler, bool) { + if len(x.AdditionalCancelledlocationReportingReferenceIDList) == 0 { + return nil, false + } + return x.AdditionalCancelledlocationReportingReferenceIDList, true + }, + }, + { + ID: IDAerialUEFlightInformationReportingControlList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LocationReportingRequestType, r *per.Reader, enc per.Encoding) error { + var v AerialUEFlightInformationReportingControlList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AerialUEFlightInformationReportingControlList = v + return nil + }, + Encode: func(x *LocationReportingRequestType) (per.Marshaler, bool) { + if len(x.AerialUEFlightInformationReportingControlList) == 0 { + return nil, false + } + return x.AerialUEFlightInformationReportingControlList, true + }, + }, +} + +func (locationReportingRequestType *LocationReportingRequestType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if locationReportingRequestType.EventType.Diagnose(d) { + notComprehended = true + } + if locationReportingRequestType.ReportArea.Diagnose(d) { + notComprehended = true + } + if locationReportingRequestType.AreaOfInterestList.Diagnose(d) { + notComprehended = true + } + if locationReportingRequestType.LocationReportingReferenceIDToBeCancelled != nil && locationReportingRequestType.LocationReportingReferenceIDToBeCancelled.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLocationReportingRequestType, locationReportingRequestType, locationReportingRequestType.iEExtensions) + return notComprehended +} + +func (loggedMDTNr *LoggedMDTNr) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLoggedMDTNr, loggedMDTNr, loggedMDTNr.iEExtensions) + w.WriteBit(loggedMDTNr.extensions.Present()) + w.WriteBit(loggedMDTNr.BluetoothMeasurementConfiguration != nil) + w.WriteBit(loggedMDTNr.WLANMeasurementConfiguration != nil) + w.WriteBit(loggedMDTNr.SensorMeasurementConfiguration != nil) + w.WriteBit(loggedMDTNr.AreaScopeOfNeighCellsList != nil) + w.WriteBit(len(ext) > 0) + if err := loggedMDTNr.LoggingInterval.MarshalPER(w, enc); err != nil { + return err + } + if err := loggedMDTNr.LoggingDuration.MarshalPER(w, enc); err != nil { + return err + } + if err := loggedMDTNr.LoggedMDTTrigger.MarshalPER(w, enc); err != nil { + return err + } + if loggedMDTNr.BluetoothMeasurementConfiguration != nil { + if err := (*loggedMDTNr.BluetoothMeasurementConfiguration).MarshalPER(w, enc); err != nil { + return err + } + } + if loggedMDTNr.WLANMeasurementConfiguration != nil { + if err := (*loggedMDTNr.WLANMeasurementConfiguration).MarshalPER(w, enc); err != nil { + return err + } + } + if loggedMDTNr.SensorMeasurementConfiguration != nil { + if err := (*loggedMDTNr.SensorMeasurementConfiguration).MarshalPER(w, enc); err != nil { + return err + } + } + if loggedMDTNr.AreaScopeOfNeighCellsList != nil { + if err := loggedMDTNr.AreaScopeOfNeighCellsList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if loggedMDTNr.extensions.Present() { + if err := loggedMDTNr.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (loggedMDTNr *LoggedMDTNr) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *loggedMDTNr = LoggedMDTNr{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_BluetoothMeasurementConfiguration, err := r.ReadBit() + if err != nil { + return err + } + p_WLANMeasurementConfiguration, err := r.ReadBit() + if err != nil { + return err + } + p_SensorMeasurementConfiguration, err := r.ReadBit() + if err != nil { + return err + } + p_AreaScopeOfNeighCellsList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&loggedMDTNr.LoggingInterval).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&loggedMDTNr.LoggingDuration).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&loggedMDTNr.LoggedMDTTrigger).UnmarshalPER(r, enc); err != nil { + return err + } + if p_BluetoothMeasurementConfiguration { + var v BluetoothMeasurementConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + loggedMDTNr.BluetoothMeasurementConfiguration = &v + } + if p_WLANMeasurementConfiguration { + var v WLANMeasurementConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + loggedMDTNr.WLANMeasurementConfiguration = &v + } + if p_SensorMeasurementConfiguration { + var v SensorMeasurementConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + loggedMDTNr.SensorMeasurementConfiguration = &v + } + if p_AreaScopeOfNeighCellsList { + if err := (&loggedMDTNr.AreaScopeOfNeighCellsList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLoggedMDTNr, loggedMDTNr, &loggedMDTNr.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := loggedMDTNr.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLoggedMDTNr = []ap.IESpec[ProtocolIEID, LoggedMDTNr]{ + { + ID: IDEarlyMeasurement, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LoggedMDTNr, r *per.Reader, enc per.Encoding) error { + var v EarlyMeasurement + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EarlyMeasurement = &v + return nil + }, + Encode: func(x *LoggedMDTNr) (per.Marshaler, bool) { + if x.EarlyMeasurement == nil { + return nil, false + } + return x.EarlyMeasurement, true + }, + }, +} + +func (loggedMDTNr *LoggedMDTNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if loggedMDTNr.LoggingInterval.Diagnose(d) { + notComprehended = true + } + if loggedMDTNr.LoggingDuration.Diagnose(d) { + notComprehended = true + } + if loggedMDTNr.LoggedMDTTrigger.Diagnose(d) { + notComprehended = true + } + if loggedMDTNr.BluetoothMeasurementConfiguration != nil && loggedMDTNr.BluetoothMeasurementConfiguration.Diagnose(d) { + notComprehended = true + } + if loggedMDTNr.WLANMeasurementConfiguration != nil && loggedMDTNr.WLANMeasurementConfiguration.Diagnose(d) { + notComprehended = true + } + if loggedMDTNr.SensorMeasurementConfiguration != nil && loggedMDTNr.SensorMeasurementConfiguration.Diagnose(d) { + notComprehended = true + } + if loggedMDTNr.AreaScopeOfNeighCellsList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLoggedMDTNr, loggedMDTNr, loggedMDTNr.iEExtensions) + return notComprehended +} + +func (loggedMDTTrigger *LoggedMDTTrigger) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{loggedMDTTrigger.Periodical != nil, loggedMDTTrigger.EventTrigger != nil, loggedMDTTrigger.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case loggedMDTTrigger.Periodical != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*loggedMDTTrigger.Periodical).MarshalPER(w, enc); err != nil { + return err + } + case loggedMDTTrigger.EventTrigger != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*loggedMDTTrigger.EventTrigger).MarshalPER(w, enc); err != nil { + return err + } + case loggedMDTTrigger.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, loggedMDTTrigger.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (loggedMDTTrigger *LoggedMDTTrigger) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *loggedMDTTrigger = LoggedMDTTrigger{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v per.Null + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + loggedMDTTrigger.Periodical = &v + case 1: + var v EventTrigger + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + loggedMDTTrigger.EventTrigger = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + loggedMDTTrigger.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (loggedMDTTrigger *LoggedMDTTrigger) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case loggedMDTTrigger.Periodical != nil: + case loggedMDTTrigger.EventTrigger != nil: + return loggedMDTTrigger.EventTrigger.Diagnose(d) + case loggedMDTTrigger.ChoiceExtension != nil: + d.Unknown(loggedMDTTrigger.ChoiceExtension.ID, loggedMDTTrigger.ChoiceExtension.Criticality) + } + return false +} + +func (loggingDuration LoggingDuration) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLoggingDuration.Encode(w, enc, loggingDuration) +} + +func (loggingDuration *LoggingDuration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLoggingDuration.Decode(r, enc) + if err != nil { + return err + } + *loggingDuration = v + return nil +} + +func (loggingDuration LoggingDuration) Name() string { + return enumLoggingDuration.Name(loggingDuration) +} + +func (loggingDuration LoggingDuration) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLoggingDuration.Known(loggingDuration) +} + +func (loggingInterval LoggingInterval) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLoggingInterval.Encode(w, enc, loggingInterval) +} + +func (loggingInterval *LoggingInterval) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLoggingInterval.Decode(r, enc) + if err != nil { + return err + } + *loggingInterval = v + return nil +} + +func (loggingInterval LoggingInterval) Name() string { + return enumLoggingInterval.Name(loggingInterval) +} + +func (loggingInterval LoggingInterval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumLoggingInterval.Known(loggingInterval) +} + +func (m1Configuration *M1Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsM1Configuration, m1Configuration, m1Configuration.iEExtensions) + w.WriteBit(m1Configuration.extensions.Present()) + w.WriteBit(m1Configuration.M1thresholdEventA2 != nil) + w.WriteBit(m1Configuration.M1periodicReporting != nil) + w.WriteBit(len(ext) > 0) + if err := m1Configuration.M1reportingTrigger.MarshalPER(w, enc); err != nil { + return err + } + if m1Configuration.M1thresholdEventA2 != nil { + if err := (*m1Configuration.M1thresholdEventA2).MarshalPER(w, enc); err != nil { + return err + } + } + if m1Configuration.M1periodicReporting != nil { + if err := (*m1Configuration.M1periodicReporting).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if m1Configuration.extensions.Present() { + if err := m1Configuration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (m1Configuration *M1Configuration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m1Configuration = M1Configuration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_M1thresholdEventA2, err := r.ReadBit() + if err != nil { + return err + } + p_M1periodicReporting, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&m1Configuration.M1reportingTrigger).UnmarshalPER(r, enc); err != nil { + return err + } + if p_M1thresholdEventA2 { + var v M1ThresholdEventA2 + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + m1Configuration.M1thresholdEventA2 = &v + } + if p_M1periodicReporting { + var v M1PeriodicReporting + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + m1Configuration.M1periodicReporting = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM1Configuration, m1Configuration, &m1Configuration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := m1Configuration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsM1Configuration = []ap.IESpec[ProtocolIEID, M1Configuration]{ + { + ID: IDIncludeBeamMeasurementsIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *M1Configuration, r *per.Reader, enc per.Encoding) error { + var v IncludeBeamMeasurementsIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.IncludeBeamMeasurementsIndication = &v + return nil + }, + Encode: func(x *M1Configuration) (per.Marshaler, bool) { + if x.IncludeBeamMeasurementsIndication == nil { + return nil, false + } + return x.IncludeBeamMeasurementsIndication, true + }, + }, + { + ID: IDBeamMeasurementsReportConfiguration, + Presence: ap.PresenceConditional, + Criticality: ap.CriticalityIgnore, + Condition: m1IncludesBeamMeasurements, + Decode: func(x *M1Configuration, r *per.Reader, enc per.Encoding) error { + var v BeamMeasurementsReportConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.BeamMeasurementsReportConfiguration = &v + return nil + }, + Encode: func(x *M1Configuration) (per.Marshaler, bool) { + if x.BeamMeasurementsReportConfiguration == nil { + return nil, false + } + return x.BeamMeasurementsReportConfiguration, true + }, + }, +} + +func (m1Configuration *M1Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if m1Configuration.M1reportingTrigger.Diagnose(d) { + notComprehended = true + } + if m1Configuration.M1thresholdEventA2 != nil && m1Configuration.M1thresholdEventA2.Diagnose(d) { + notComprehended = true + } + if m1Configuration.M1periodicReporting != nil && m1Configuration.M1periodicReporting.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsM1Configuration, m1Configuration, m1Configuration.iEExtensions) + return notComprehended +} + +func (m1PeriodicReporting *M1PeriodicReporting) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsM1PeriodicReporting, m1PeriodicReporting, m1PeriodicReporting.iEExtensions) + w.WriteBit(m1PeriodicReporting.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := m1PeriodicReporting.ReportInterval.MarshalPER(w, enc); err != nil { + return err + } + if err := m1PeriodicReporting.ReportAmount.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if m1PeriodicReporting.extensions.Present() { + if err := m1PeriodicReporting.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (m1PeriodicReporting *M1PeriodicReporting) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m1PeriodicReporting = M1PeriodicReporting{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&m1PeriodicReporting.ReportInterval).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&m1PeriodicReporting.ReportAmount).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM1PeriodicReporting, m1PeriodicReporting, &m1PeriodicReporting.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := m1PeriodicReporting.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsM1PeriodicReporting = []ap.IESpec[ProtocolIEID, M1PeriodicReporting]{ + { + ID: IDExtendedReportIntervalMDT, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *M1PeriodicReporting, r *per.Reader, enc per.Encoding) error { + var v ExtendedReportIntervalMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedReportIntervalMDT = &v + return nil + }, + Encode: func(x *M1PeriodicReporting) (per.Marshaler, bool) { + if x.ExtendedReportIntervalMDT == nil { + return nil, false + } + return x.ExtendedReportIntervalMDT, true + }, + }, +} + +func (m1PeriodicReporting *M1PeriodicReporting) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsM1PeriodicReporting, m1PeriodicReporting, m1PeriodicReporting.iEExtensions) + return notComprehended +} + +func (m1ReportingTrigger M1ReportingTrigger) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM1ReportingTrigger.Encode(w, enc, m1ReportingTrigger) +} + +func (m1ReportingTrigger *M1ReportingTrigger) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM1ReportingTrigger.Decode(r, enc) + if err != nil { + return err + } + *m1ReportingTrigger = v + return nil +} + +func (m1ReportingTrigger M1ReportingTrigger) Name() string { + return enumM1ReportingTrigger.Name(m1ReportingTrigger) +} + +func (m1ReportingTrigger M1ReportingTrigger) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM1ReportingTrigger.Known(m1ReportingTrigger) +} + +func (m1ThresholdEventA2 *M1ThresholdEventA2) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsM1ThresholdEventA2, m1ThresholdEventA2, m1ThresholdEventA2.iEExtensions) + w.WriteBit(m1ThresholdEventA2.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := m1ThresholdEventA2.M1ThresholdType.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if m1ThresholdEventA2.extensions.Present() { + if err := m1ThresholdEventA2.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (m1ThresholdEventA2 *M1ThresholdEventA2) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m1ThresholdEventA2 = M1ThresholdEventA2{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&m1ThresholdEventA2.M1ThresholdType).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM1ThresholdEventA2, m1ThresholdEventA2, &m1ThresholdEventA2.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := m1ThresholdEventA2.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsM1ThresholdEventA2 []ap.IESpec[ProtocolIEID, M1ThresholdEventA2] + +func (m1ThresholdEventA2 *M1ThresholdEventA2) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if m1ThresholdEventA2.M1ThresholdType.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsM1ThresholdEventA2, m1ThresholdEventA2, m1ThresholdEventA2.iEExtensions) + return notComprehended +} + +func (m1ThresholdType *M1ThresholdType) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{m1ThresholdType.ThresholdRSRP != nil, m1ThresholdType.ThresholdRSRQ != nil, m1ThresholdType.ThresholdSINR != nil, m1ThresholdType.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case m1ThresholdType.ThresholdRSRP != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { + return err + } + if err := (*m1ThresholdType.ThresholdRSRP).MarshalPER(w, enc); err != nil { + return err + } + case m1ThresholdType.ThresholdRSRQ != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { + return err + } + if err := (*m1ThresholdType.ThresholdRSRQ).MarshalPER(w, enc); err != nil { + return err + } + case m1ThresholdType.ThresholdSINR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { + return err + } + if err := (*m1ThresholdType.ThresholdSINR).MarshalPER(w, enc); err != nil { + return err + } + case m1ThresholdType.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, m1ThresholdType.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (m1ThresholdType *M1ThresholdType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m1ThresholdType = M1ThresholdType{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) + if err != nil { + return err + } + switch idx { + case 0: + var v ThresholdRSRP + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + m1ThresholdType.ThresholdRSRP = &v + case 1: + var v ThresholdRSRQ + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + m1ThresholdType.ThresholdRSRQ = &v + case 2: + var v ThresholdSINR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + m1ThresholdType.ThresholdSINR = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + m1ThresholdType.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (m1ThresholdType *M1ThresholdType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case m1ThresholdType.ThresholdRSRP != nil: + case m1ThresholdType.ThresholdRSRQ != nil: + case m1ThresholdType.ThresholdSINR != nil: + case m1ThresholdType.ChoiceExtension != nil: + d.Unknown(m1ThresholdType.ChoiceExtension.ID, m1ThresholdType.ChoiceExtension.Criticality) + } + return false +} + +func (m4Configuration *M4Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsM4Configuration, m4Configuration, m4Configuration.iEExtensions) + w.WriteBit(m4Configuration.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := m4Configuration.M4period.MarshalPER(w, enc); err != nil { + return err + } + if err := m4Configuration.M4linkstolog.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if m4Configuration.extensions.Present() { + if err := m4Configuration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (m4Configuration *M4Configuration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m4Configuration = M4Configuration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&m4Configuration.M4period).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&m4Configuration.M4linkstolog).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM4Configuration, m4Configuration, &m4Configuration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := m4Configuration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsM4Configuration = []ap.IESpec[ProtocolIEID, M4Configuration]{ + { + ID: IDM4ReportAmount, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *M4Configuration, r *per.Reader, enc per.Encoding) error { + var v M4ReportAmountMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.M4ReportAmount = &v + return nil + }, + Encode: func(x *M4Configuration) (per.Marshaler, bool) { + if x.M4ReportAmount == nil { + return nil, false + } + return x.M4ReportAmount, true + }, + }, +} + +func (m4Configuration *M4Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if m4Configuration.M4period.Diagnose(d) { + notComprehended = true + } + if m4Configuration.M4linkstolog.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsM4Configuration, m4Configuration, m4Configuration.iEExtensions) + return notComprehended +} + +func (m4ReportAmountMDT M4ReportAmountMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM4ReportAmountMDT.Encode(w, enc, m4ReportAmountMDT) +} + +func (m4ReportAmountMDT *M4ReportAmountMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM4ReportAmountMDT.Decode(r, enc) + if err != nil { + return err + } + *m4ReportAmountMDT = v + return nil +} + +func (m4ReportAmountMDT M4ReportAmountMDT) Name() string { + return enumM4ReportAmountMDT.Name(m4ReportAmountMDT) +} + +func (m4ReportAmountMDT M4ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM4ReportAmountMDT.Known(m4ReportAmountMDT) +} + +func (m4period M4period) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM4period.Encode(w, enc, m4period) +} + +func (m4period *M4period) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM4period.Decode(r, enc) + if err != nil { + return err + } + *m4period = v + return nil +} + +func (m4period M4period) Name() string { + return enumM4period.Name(m4period) +} + +func (m4period M4period) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM4period.Known(m4period) +} + +func (m5Configuration *M5Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsM5Configuration, m5Configuration, m5Configuration.iEExtensions) + w.WriteBit(m5Configuration.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := m5Configuration.M5period.MarshalPER(w, enc); err != nil { + return err + } + if err := m5Configuration.M5linkstolog.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if m5Configuration.extensions.Present() { + if err := m5Configuration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (m5Configuration *M5Configuration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m5Configuration = M5Configuration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&m5Configuration.M5period).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&m5Configuration.M5linkstolog).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM5Configuration, m5Configuration, &m5Configuration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := m5Configuration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsM5Configuration = []ap.IESpec[ProtocolIEID, M5Configuration]{ + { + ID: IDM5ReportAmount, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *M5Configuration, r *per.Reader, enc per.Encoding) error { + var v M5ReportAmountMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.M5ReportAmount = &v + return nil + }, + Encode: func(x *M5Configuration) (per.Marshaler, bool) { + if x.M5ReportAmount == nil { + return nil, false + } + return x.M5ReportAmount, true + }, + }, +} + +func (m5Configuration *M5Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if m5Configuration.M5period.Diagnose(d) { + notComprehended = true + } + if m5Configuration.M5linkstolog.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsM5Configuration, m5Configuration, m5Configuration.iEExtensions) + return notComprehended +} + +func (m5ReportAmountMDT M5ReportAmountMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM5ReportAmountMDT.Encode(w, enc, m5ReportAmountMDT) +} + +func (m5ReportAmountMDT *M5ReportAmountMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM5ReportAmountMDT.Decode(r, enc) + if err != nil { + return err + } + *m5ReportAmountMDT = v + return nil +} + +func (m5ReportAmountMDT M5ReportAmountMDT) Name() string { + return enumM5ReportAmountMDT.Name(m5ReportAmountMDT) +} + +func (m5ReportAmountMDT M5ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM5ReportAmountMDT.Known(m5ReportAmountMDT) +} + +func (m5period M5period) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM5period.Encode(w, enc, m5period) +} + +func (m5period *M5period) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM5period.Decode(r, enc) + if err != nil { + return err + } + *m5period = v + return nil +} + +func (m5period M5period) Name() string { + return enumM5period.Name(m5period) +} + +func (m5period M5period) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM5period.Known(m5period) +} + +func (m6Configuration *M6Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsM6Configuration, m6Configuration, m6Configuration.iEExtensions) + w.WriteBit(m6Configuration.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := m6Configuration.M6reportInterval.MarshalPER(w, enc); err != nil { + return err + } + if err := m6Configuration.M6linkstolog.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if m6Configuration.extensions.Present() { + if err := m6Configuration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (m6Configuration *M6Configuration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m6Configuration = M6Configuration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&m6Configuration.M6reportInterval).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&m6Configuration.M6linkstolog).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM6Configuration, m6Configuration, &m6Configuration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := m6Configuration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsM6Configuration = []ap.IESpec[ProtocolIEID, M6Configuration]{ + { + ID: IDM6ReportAmount, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *M6Configuration, r *per.Reader, enc per.Encoding) error { + var v M6ReportAmountMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.M6ReportAmount = &v + return nil + }, + Encode: func(x *M6Configuration) (per.Marshaler, bool) { + if x.M6ReportAmount == nil { + return nil, false + } + return x.M6ReportAmount, true + }, + }, + { + ID: IDExcessPacketDelayThresholdConfiguration, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *M6Configuration, r *per.Reader, enc per.Encoding) error { + var v ExcessPacketDelayThresholdConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExcessPacketDelayThresholdConfiguration = v + return nil + }, + Encode: func(x *M6Configuration) (per.Marshaler, bool) { + if len(x.ExcessPacketDelayThresholdConfiguration) == 0 { + return nil, false + } + return x.ExcessPacketDelayThresholdConfiguration, true + }, + }, +} + +func (m6Configuration *M6Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if m6Configuration.M6reportInterval.Diagnose(d) { + notComprehended = true + } + if m6Configuration.M6linkstolog.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsM6Configuration, m6Configuration, m6Configuration.iEExtensions) + return notComprehended +} + +func (m6ReportAmountMDT M6ReportAmountMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM6ReportAmountMDT.Encode(w, enc, m6ReportAmountMDT) +} + +func (m6ReportAmountMDT *M6ReportAmountMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM6ReportAmountMDT.Decode(r, enc) + if err != nil { + return err + } + *m6ReportAmountMDT = v + return nil +} + +func (m6ReportAmountMDT M6ReportAmountMDT) Name() string { + return enumM6ReportAmountMDT.Name(m6ReportAmountMDT) +} + +func (m6ReportAmountMDT M6ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM6ReportAmountMDT.Known(m6ReportAmountMDT) +} + +func (m6reportInterval M6reportInterval) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM6reportInterval.Encode(w, enc, m6reportInterval) +} + +func (m6reportInterval *M6reportInterval) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM6reportInterval.Decode(r, enc) + if err != nil { + return err + } + *m6reportInterval = v + return nil +} + +func (m6reportInterval M6reportInterval) Name() string { + return enumM6reportInterval.Name(m6reportInterval) +} + +func (m6reportInterval M6reportInterval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM6reportInterval.Known(m6reportInterval) +} + +func (m7Configuration *M7Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsM7Configuration, m7Configuration, m7Configuration.iEExtensions) + w.WriteBit(m7Configuration.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := m7Configuration.M7period.MarshalPER(w, enc); err != nil { + return err + } + if err := m7Configuration.M7linkstolog.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if m7Configuration.extensions.Present() { + if err := m7Configuration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (m7Configuration *M7Configuration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *m7Configuration = M7Configuration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&m7Configuration.M7period).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&m7Configuration.M7linkstolog).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM7Configuration, m7Configuration, &m7Configuration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := m7Configuration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsM7Configuration = []ap.IESpec[ProtocolIEID, M7Configuration]{ + { + ID: IDM7ReportAmount, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *M7Configuration, r *per.Reader, enc per.Encoding) error { + var v M7ReportAmountMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.M7ReportAmount = &v + return nil + }, + Encode: func(x *M7Configuration) (per.Marshaler, bool) { + if x.M7ReportAmount == nil { + return nil, false + } + return x.M7ReportAmount, true + }, + }, +} + +func (m7Configuration *M7Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if m7Configuration.M7period.Diagnose(d) { + notComprehended = true + } + if m7Configuration.M7linkstolog.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsM7Configuration, m7Configuration, m7Configuration.iEExtensions) + return notComprehended +} + +func (m7ReportAmountMDT M7ReportAmountMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumM7ReportAmountMDT.Encode(w, enc, m7ReportAmountMDT) +} + +func (m7ReportAmountMDT *M7ReportAmountMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumM7ReportAmountMDT.Decode(r, enc) + if err != nil { + return err + } + *m7ReportAmountMDT = v + return nil +} + +func (m7ReportAmountMDT M7ReportAmountMDT) Name() string { + return enumM7ReportAmountMDT.Name(m7ReportAmountMDT) +} + +func (m7ReportAmountMDT M7ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumM7ReportAmountMDT.Known(m7ReportAmountMDT) +} + +func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformationSourcetoTargetItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem.iEExtensions) + w.WriteBit(mBSActiveSessionInformationSourcetoTargetItem.extensions.Present()) + w.WriteBit(mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID != nil) + w.WriteBit(mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea != nil) + w.WriteBit(mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList != nil) + w.WriteBit(len(ext) > 0) + if err := mBSActiveSessionInformationSourcetoTargetItem.MBSSessionID.MarshalPER(w, enc); err != nil { + return err + } + if mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID != nil { + if err := (*mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID).MarshalPER(w, enc); err != nil { + return err + } + } + if mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea != nil { + if err := (*mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea).MarshalPER(w, enc); err != nil { + return err + } + } + if err := mBSActiveSessionInformationSourcetoTargetItem.MBSQoSFlowsToBeSetupList.MarshalPER(w, enc); err != nil { + return err + } + if mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList != nil { + if err := mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSActiveSessionInformationSourcetoTargetItem.extensions.Present() { + if err := mBSActiveSessionInformationSourcetoTargetItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformationSourcetoTargetItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSActiveSessionInformationSourcetoTargetItem = MBSActiveSessionInformationSourcetoTargetItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MBSAreaSessionID, err := r.ReadBit() + if err != nil { + return err + } + p_MBSServiceArea, err := r.ReadBit() + if err != nil { + return err + } + p_MBSMappingandDataForwardingRequestList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSActiveSessionInformationSourcetoTargetItem.MBSSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MBSAreaSessionID { + var v MBSAreaSessionID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID = &v + } + if p_MBSServiceArea { + var v MBSServiceArea + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea = &v + } + if err := (&mBSActiveSessionInformationSourcetoTargetItem.MBSQoSFlowsToBeSetupList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MBSMappingandDataForwardingRequestList { + if err := (&mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, &mBSActiveSessionInformationSourcetoTargetItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSActiveSessionInformationSourcetoTargetItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSActiveSessionInformationSourcetoTargetItem []ap.IESpec[ProtocolIEID, MBSActiveSessionInformationSourcetoTargetItem] + +func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformationSourcetoTargetItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSActiveSessionInformationSourcetoTargetItem.MBSSessionID.Diagnose(d) { + notComprehended = true + } + if mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID != nil && mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID.Diagnose(d) { + notComprehended = true + } + if mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea != nil && mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea.Diagnose(d) { + notComprehended = true + } + if mBSActiveSessionInformationSourcetoTargetItem.MBSQoSFlowsToBeSetupList.Diagnose(d) { + notComprehended = true + } + if mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem.iEExtensions) + return notComprehended +} + +func (mBSAssistanceInformation MBSAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMBSAssistanceInformation.Encode(w, enc, mBSAssistanceInformation) +} + +func (mBSAssistanceInformation *MBSAssistanceInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMBSAssistanceInformation.Decode(r, enc) + if err != nil { + return err + } + *mBSAssistanceInformation = v + return nil +} + +func (mBSAssistanceInformation MBSAssistanceInformation) Name() string { + return enumMBSAssistanceInformation.Name(mBSAssistanceInformation) +} + +func (mBSAssistanceInformation MBSAssistanceInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMBSAssistanceInformation.Known(mBSAssistanceInformation) +} + +func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem.iEExtensions) + w.WriteBit(mBSMappingandDataForwardingRequestItem.extensions.Present()) + w.WriteBit(mBSMappingandDataForwardingRequestItem.MRBProgressInformation != nil) + w.WriteBit(len(ext) > 0) + if err := mBSMappingandDataForwardingRequestItem.MRBID.MarshalPER(w, enc); err != nil { + return err + } + if err := mBSMappingandDataForwardingRequestItem.MBSQoSFlowList.MarshalPER(w, enc); err != nil { + return err + } + if mBSMappingandDataForwardingRequestItem.MRBProgressInformation != nil { + if err := (*mBSMappingandDataForwardingRequestItem.MRBProgressInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSMappingandDataForwardingRequestItem.extensions.Present() { + if err := mBSMappingandDataForwardingRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSMappingandDataForwardingRequestItem = MBSMappingandDataForwardingRequestItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MRBProgressInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSMappingandDataForwardingRequestItem.MRBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mBSMappingandDataForwardingRequestItem.MBSQoSFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MRBProgressInformation { + var v MRBProgressInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSMappingandDataForwardingRequestItem.MRBProgressInformation = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, &mBSMappingandDataForwardingRequestItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSMappingandDataForwardingRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSMappingandDataForwardingRequestItem []ap.IESpec[ProtocolIEID, MBSMappingandDataForwardingRequestItem] + +func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSMappingandDataForwardingRequestItem.MRBID.Diagnose(d) { + notComprehended = true + } + if mBSMappingandDataForwardingRequestItem.MBSQoSFlowList.Diagnose(d) { + notComprehended = true + } + if mBSMappingandDataForwardingRequestItem.MRBProgressInformation != nil && mBSMappingandDataForwardingRequestItem.MRBProgressInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem.iEExtensions) + return notComprehended +} + +func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem.iEExtensions) + w.WriteBit(mBSQoSFlowsToBeSetupItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := mBSQoSFlowsToBeSetupItem.MBSqosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if err := mBSQoSFlowsToBeSetupItem.MBSqosFlowLevelQosParameters.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSQoSFlowsToBeSetupItem.extensions.Present() { + if err := mBSQoSFlowsToBeSetupItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSQoSFlowsToBeSetupItem = MBSQoSFlowsToBeSetupItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSQoSFlowsToBeSetupItem.MBSqosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mBSQoSFlowsToBeSetupItem.MBSqosFlowLevelQosParameters).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, &mBSQoSFlowsToBeSetupItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSQoSFlowsToBeSetupItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSQoSFlowsToBeSetupItem []ap.IESpec[ProtocolIEID, MBSQoSFlowsToBeSetupItem] + +func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSQoSFlowsToBeSetupItem.MBSqosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if mBSQoSFlowsToBeSetupItem.MBSqosFlowLevelQosParameters.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem.iEExtensions) + return notComprehended +} + +func (mBSServiceArea *MBSServiceArea) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{mBSServiceArea.Locationindependent != nil, mBSServiceArea.Locationdependent != nil, mBSServiceArea.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case mBSServiceArea.Locationindependent != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*mBSServiceArea.Locationindependent).MarshalPER(w, enc); err != nil { + return err + } + case mBSServiceArea.Locationdependent != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*mBSServiceArea.Locationdependent).MarshalPER(w, enc); err != nil { + return err + } + case mBSServiceArea.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, mBSServiceArea.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (mBSServiceArea *MBSServiceArea) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSServiceArea = MBSServiceArea{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v MBSServiceAreaInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSServiceArea.Locationindependent = &v + case 1: + var v MBSServiceAreaInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSServiceArea.Locationdependent = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + mBSServiceArea.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (mBSServiceArea *MBSServiceArea) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case mBSServiceArea.Locationindependent != nil: + return mBSServiceArea.Locationindependent.Diagnose(d) + case mBSServiceArea.Locationdependent != nil: + return mBSServiceArea.Locationdependent.Diagnose(d) + case mBSServiceArea.ChoiceExtension != nil: + d.Unknown(mBSServiceArea.ChoiceExtension.ID, mBSServiceArea.ChoiceExtension.Criticality) + } + return false +} + +func (mBSServiceAreaInformation *MBSServiceAreaInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, mBSServiceAreaInformation.iEExtensions) + w.WriteBit(mBSServiceAreaInformation.extensions.Present()) + w.WriteBit(mBSServiceAreaInformation.MBSServiceAreaCellList != nil) + w.WriteBit(mBSServiceAreaInformation.MBSServiceAreaTAIList != nil) + w.WriteBit(len(ext) > 0) + if mBSServiceAreaInformation.MBSServiceAreaCellList != nil { + if err := mBSServiceAreaInformation.MBSServiceAreaCellList.MarshalPER(w, enc); err != nil { + return err + } + } + if mBSServiceAreaInformation.MBSServiceAreaTAIList != nil { + if err := mBSServiceAreaInformation.MBSServiceAreaTAIList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSServiceAreaInformation.extensions.Present() { + if err := mBSServiceAreaInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSServiceAreaInformation *MBSServiceAreaInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSServiceAreaInformation = MBSServiceAreaInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MBSServiceAreaCellList, err := r.ReadBit() + if err != nil { + return err + } + p_MBSServiceAreaTAIList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_MBSServiceAreaCellList { + if err := (&mBSServiceAreaInformation.MBSServiceAreaCellList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_MBSServiceAreaTAIList { + if err := (&mBSServiceAreaInformation.MBSServiceAreaTAIList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, &mBSServiceAreaInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSServiceAreaInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSServiceAreaInformation = []ap.IESpec[ProtocolIEID, MBSServiceAreaInformation]{ + { + ID: IDMBSIntendedServiceAreaList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MBSServiceAreaInformation, r *per.Reader, enc per.Encoding) error { + var v MBSIntendedServiceAreaList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSIntendedServiceAreaList = v + return nil + }, + Encode: func(x *MBSServiceAreaInformation) (per.Marshaler, bool) { + if len(x.MBSIntendedServiceAreaList) == 0 { + return nil, false + } + return x.MBSIntendedServiceAreaList, true + }, + }, +} + +func (mBSServiceAreaInformation *MBSServiceAreaInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSServiceAreaInformation.MBSServiceAreaCellList.Diagnose(d) { + notComprehended = true + } + if mBSServiceAreaInformation.MBSServiceAreaTAIList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, mBSServiceAreaInformation.iEExtensions) + return notComprehended +} + +func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, mBSServiceAreaInformationItem.iEExtensions) + w.WriteBit(mBSServiceAreaInformationItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := mBSServiceAreaInformationItem.MBSAreaSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := mBSServiceAreaInformationItem.MBSServiceAreaInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSServiceAreaInformationItem.extensions.Present() { + if err := mBSServiceAreaInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSServiceAreaInformationItem = MBSServiceAreaInformationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSServiceAreaInformationItem.MBSAreaSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mBSServiceAreaInformationItem.MBSServiceAreaInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, &mBSServiceAreaInformationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSServiceAreaInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSServiceAreaInformationItem []ap.IESpec[ProtocolIEID, MBSServiceAreaInformationItem] + +func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSServiceAreaInformationItem.MBSAreaSessionID.Diagnose(d) { + notComprehended = true + } + if mBSServiceAreaInformationItem.MBSServiceAreaInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, mBSServiceAreaInformationItem.iEExtensions) + return notComprehended +} + +func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem.iEExtensions) + w.WriteBit(mBSSessionFailedtoSetupItem.extensions.Present()) + w.WriteBit(mBSSessionFailedtoSetupItem.MBSAreaSessionID != nil) + w.WriteBit(len(ext) > 0) + if err := mBSSessionFailedtoSetupItem.MBSSessionID.MarshalPER(w, enc); err != nil { + return err + } + if mBSSessionFailedtoSetupItem.MBSAreaSessionID != nil { + if err := (*mBSSessionFailedtoSetupItem.MBSAreaSessionID).MarshalPER(w, enc); err != nil { + return err + } + } + if err := mBSSessionFailedtoSetupItem.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSSessionFailedtoSetupItem.extensions.Present() { + if err := mBSSessionFailedtoSetupItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSSessionFailedtoSetupItem = MBSSessionFailedtoSetupItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MBSAreaSessionID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSSessionFailedtoSetupItem.MBSSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MBSAreaSessionID { + var v MBSAreaSessionID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSSessionFailedtoSetupItem.MBSAreaSessionID = &v + } + if err := (&mBSSessionFailedtoSetupItem.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, &mBSSessionFailedtoSetupItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSSessionFailedtoSetupItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSSessionFailedtoSetupItem []ap.IESpec[ProtocolIEID, MBSSessionFailedtoSetupItem] + +func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSSessionFailedtoSetupItem.MBSSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionFailedtoSetupItem.MBSAreaSessionID != nil && mBSSessionFailedtoSetupItem.MBSAreaSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionFailedtoSetupItem.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem.iEExtensions) + return notComprehended +} + +func (mBSSessionID *MBSSessionID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSSessionID, mBSSessionID, mBSSessionID.iEExtensions) + w.WriteBit(mBSSessionID.extensions.Present()) + w.WriteBit(mBSSessionID.NID != nil) + w.WriteBit(len(ext) > 0) + if err := mBSSessionID.TMGI.MarshalPER(w, enc); err != nil { + return err + } + if mBSSessionID.NID != nil { + if err := (*mBSSessionID.NID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSSessionID.extensions.Present() { + if err := mBSSessionID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSSessionID *MBSSessionID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSSessionID = MBSSessionID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSSessionID.TMGI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NID { + var v NID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSSessionID.NID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionID, mBSSessionID, &mBSSessionID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSSessionID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSSessionID []ap.IESpec[ProtocolIEID, MBSSessionID] + +func (mBSSessionID *MBSSessionID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsMBSSessionID, mBSSessionID, mBSSessionID.iEExtensions) + return notComprehended +} + +func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, mBSSessionSetupRequestItem.iEExtensions) + w.WriteBit(mBSSessionSetupRequestItem.extensions.Present()) + w.WriteBit(mBSSessionSetupRequestItem.MBSAreaSessionID != nil) + w.WriteBit(mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList != nil) + w.WriteBit(len(ext) > 0) + if err := mBSSessionSetupRequestItem.MBSSessionID.MarshalPER(w, enc); err != nil { + return err + } + if mBSSessionSetupRequestItem.MBSAreaSessionID != nil { + if err := (*mBSSessionSetupRequestItem.MBSAreaSessionID).MarshalPER(w, enc); err != nil { + return err + } + } + if mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList != nil { + if err := mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSSessionSetupRequestItem.extensions.Present() { + if err := mBSSessionSetupRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSSessionSetupRequestItem = MBSSessionSetupRequestItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MBSAreaSessionID, err := r.ReadBit() + if err != nil { + return err + } + p_AssociatedMBSQosFlowSetupRequestList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSSessionSetupRequestItem.MBSSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MBSAreaSessionID { + var v MBSAreaSessionID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSSessionSetupRequestItem.MBSAreaSessionID = &v + } + if p_AssociatedMBSQosFlowSetupRequestList { + if err := (&mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, &mBSSessionSetupRequestItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSSessionSetupRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSSessionSetupRequestItem = []ap.IESpec[ProtocolIEID, MBSSessionSetupRequestItem]{ + { + ID: IDMBSAssistanceInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MBSSessionSetupRequestItem, r *per.Reader, enc per.Encoding) error { + var v MBSAssistanceInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSAssistanceInformation = &v + return nil + }, + Encode: func(x *MBSSessionSetupRequestItem) (per.Marshaler, bool) { + if x.MBSAssistanceInformation == nil { + return nil, false + } + return x.MBSAssistanceInformation, true + }, + }, +} + +func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSSessionSetupRequestItem.MBSSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionSetupRequestItem.MBSAreaSessionID != nil && mBSSessionSetupRequestItem.MBSAreaSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, mBSSessionSetupRequestItem.iEExtensions) + return notComprehended +} + +func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, mBSSessionSetupResponseItem.iEExtensions) + w.WriteBit(mBSSessionSetupResponseItem.extensions.Present()) + w.WriteBit(mBSSessionSetupResponseItem.MBSAreaSessionID != nil) + w.WriteBit(len(ext) > 0) + if err := mBSSessionSetupResponseItem.MBSSessionID.MarshalPER(w, enc); err != nil { + return err + } + if mBSSessionSetupResponseItem.MBSAreaSessionID != nil { + if err := (*mBSSessionSetupResponseItem.MBSAreaSessionID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSSessionSetupResponseItem.extensions.Present() { + if err := mBSSessionSetupResponseItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSSessionSetupResponseItem = MBSSessionSetupResponseItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MBSAreaSessionID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSSessionSetupResponseItem.MBSSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MBSAreaSessionID { + var v MBSAreaSessionID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSSessionSetupResponseItem.MBSAreaSessionID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, &mBSSessionSetupResponseItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSSessionSetupResponseItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSSessionSetupResponseItem []ap.IESpec[ProtocolIEID, MBSSessionSetupResponseItem] + +func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSSessionSetupResponseItem.MBSSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionSetupResponseItem.MBSAreaSessionID != nil && mBSSessionSetupResponseItem.MBSAreaSessionID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, mBSSessionSetupResponseItem.iEExtensions) + return notComprehended +} + +func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem.iEExtensions) + w.WriteBit(mBSSessionSetuporModifyRequestItem.extensions.Present()) + w.WriteBit(mBSSessionSetuporModifyRequestItem.MBSAreaSessionID != nil) + w.WriteBit(mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList != nil) + w.WriteBit(mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList != nil) + w.WriteBit(len(ext) > 0) + if err := mBSSessionSetuporModifyRequestItem.MBSSessionID.MarshalPER(w, enc); err != nil { + return err + } + if mBSSessionSetuporModifyRequestItem.MBSAreaSessionID != nil { + if err := (*mBSSessionSetuporModifyRequestItem.MBSAreaSessionID).MarshalPER(w, enc); err != nil { + return err + } + } + if mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList != nil { + if err := mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList.MarshalPER(w, enc); err != nil { + return err + } + } + if mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList != nil { + if err := mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSSessionSetuporModifyRequestItem.extensions.Present() { + if err := mBSSessionSetuporModifyRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSSessionSetuporModifyRequestItem = MBSSessionSetuporModifyRequestItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MBSAreaSessionID, err := r.ReadBit() + if err != nil { + return err + } + p_AssociatedMBSQosFlowSetuporModifyRequestList, err := r.ReadBit() + if err != nil { + return err + } + p_MBSQosFlowToReleaseList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSSessionSetuporModifyRequestItem.MBSSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MBSAreaSessionID { + var v MBSAreaSessionID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mBSSessionSetuporModifyRequestItem.MBSAreaSessionID = &v + } + if p_AssociatedMBSQosFlowSetuporModifyRequestList { + if err := (&mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_MBSQosFlowToReleaseList { + if err := (&mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, &mBSSessionSetuporModifyRequestItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSSessionSetuporModifyRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSSessionSetuporModifyRequestItem = []ap.IESpec[ProtocolIEID, MBSSessionSetuporModifyRequestItem]{ + { + ID: IDMBSAssistanceInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MBSSessionSetuporModifyRequestItem, r *per.Reader, enc per.Encoding) error { + var v MBSAssistanceInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSAssistanceInformation = &v + return nil + }, + Encode: func(x *MBSSessionSetuporModifyRequestItem) (per.Marshaler, bool) { + if x.MBSAssistanceInformation == nil { + return nil, false + } + return x.MBSAssistanceInformation, true + }, + }, +} + +func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSSessionSetuporModifyRequestItem.MBSSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionSetuporModifyRequestItem.MBSAreaSessionID != nil && mBSSessionSetuporModifyRequestItem.MBSAreaSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList.Diagnose(d) { + notComprehended = true + } + if mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem.iEExtensions) + return notComprehended +} + +func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, mBSSessionToReleaseItem.iEExtensions) + w.WriteBit(mBSSessionToReleaseItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := mBSSessionToReleaseItem.MBSSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := mBSSessionToReleaseItem.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mBSSessionToReleaseItem.extensions.Present() { + if err := mBSSessionToReleaseItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mBSSessionToReleaseItem = MBSSessionToReleaseItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mBSSessionToReleaseItem.MBSSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mBSSessionToReleaseItem.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, &mBSSessionToReleaseItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mBSSessionToReleaseItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMBSSessionToReleaseItem []ap.IESpec[ProtocolIEID, MBSSessionToReleaseItem] + +func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mBSSessionToReleaseItem.MBSSessionID.Diagnose(d) { + notComprehended = true + } + if mBSSessionToReleaseItem.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, mBSSessionToReleaseItem.iEExtensions) + return notComprehended +} + +func (mBSSupportIndicator MBSSupportIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMBSSupportIndicator.Encode(w, enc, mBSSupportIndicator) +} + +func (mBSSupportIndicator *MBSSupportIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMBSSupportIndicator.Decode(r, enc) + if err != nil { + return err + } + *mBSSupportIndicator = v + return nil +} + +func (mBSSupportIndicator MBSSupportIndicator) Name() string { + return enumMBSSupportIndicator.Name(mBSSupportIndicator) +} + +func (mBSSupportIndicator MBSSupportIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMBSSupportIndicator.Known(mBSSupportIndicator) +} + +func (mDTActivation MDTActivation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMDTActivation.Encode(w, enc, mDTActivation) +} + +func (mDTActivation *MDTActivation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMDTActivation.Decode(r, enc) + if err != nil { + return err + } + *mDTActivation = v + return nil +} + +func (mDTActivation MDTActivation) Name() string { + return enumMDTActivation.Name(mDTActivation) +} + +func (mDTActivation MDTActivation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMDTActivation.Known(mDTActivation) +} + +func (mDTAlignmentInfo *MDTAlignmentInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{mDTAlignmentInfo.SbasedMDT != nil, mDTAlignmentInfo.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case mDTAlignmentInfo.SbasedMDT != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*mDTAlignmentInfo.SbasedMDT).MarshalPER(w, enc); err != nil { + return err + } + case mDTAlignmentInfo.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, mDTAlignmentInfo.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (mDTAlignmentInfo *MDTAlignmentInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mDTAlignmentInfo = MDTAlignmentInfo{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v NGRANTraceID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mDTAlignmentInfo.SbasedMDT = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + mDTAlignmentInfo.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (mDTAlignmentInfo *MDTAlignmentInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case mDTAlignmentInfo.SbasedMDT != nil: + case mDTAlignmentInfo.ChoiceExtension != nil: + d.Unknown(mDTAlignmentInfo.ChoiceExtension.ID, mDTAlignmentInfo.ChoiceExtension.Criticality) + } + return false +} + +func (mDTConfiguration *MDTConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMDTConfiguration, mDTConfiguration, mDTConfiguration.iEExtensions) + w.WriteBit(mDTConfiguration.extensions.Present()) + w.WriteBit(mDTConfiguration.MdtConfigNR != nil) + w.WriteBit(mDTConfiguration.MdtConfigEUTRA != nil) + w.WriteBit(len(ext) > 0) + if mDTConfiguration.MdtConfigNR != nil { + if err := (*mDTConfiguration.MdtConfigNR).MarshalPER(w, enc); err != nil { + return err + } + } + if mDTConfiguration.MdtConfigEUTRA != nil { + if err := (*mDTConfiguration.MdtConfigEUTRA).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mDTConfiguration.extensions.Present() { + if err := mDTConfiguration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mDTConfiguration *MDTConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mDTConfiguration = MDTConfiguration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MdtConfigNR, err := r.ReadBit() + if err != nil { + return err + } + p_MdtConfigEUTRA, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_MdtConfigNR { + var v MDTConfigurationNR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mDTConfiguration.MdtConfigNR = &v + } + if p_MdtConfigEUTRA { + var v MDTConfigurationEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mDTConfiguration.MdtConfigEUTRA = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfiguration, mDTConfiguration, &mDTConfiguration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mDTConfiguration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMDTConfiguration = []ap.IESpec[ProtocolIEID, MDTConfiguration]{ + { + ID: IDMNonlyMDTcollection, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MDTConfiguration, r *per.Reader, enc per.Encoding) error { + var v MNonlyMDTcollection + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MNonlyMDTcollection = &v + return nil + }, + Encode: func(x *MDTConfiguration) (per.Marshaler, bool) { + if x.MNonlyMDTcollection == nil { + return nil, false + } + return x.MNonlyMDTcollection, true + }, + }, +} + +func (mDTConfiguration *MDTConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mDTConfiguration.MdtConfigNR != nil && mDTConfiguration.MdtConfigNR.Diagnose(d) { + notComprehended = true + } + if mDTConfiguration.MdtConfigEUTRA != nil && mDTConfiguration.MdtConfigEUTRA.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMDTConfiguration, mDTConfiguration, mDTConfiguration.iEExtensions) + return notComprehended +} + +func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, mDTConfigurationEUTRA.iEExtensions) + w.WriteBit(mDTConfigurationEUTRA.extensions.Present()) + w.WriteBit(mDTConfigurationEUTRA.SignallingBasedMDTPLMNList != nil) + w.WriteBit(len(ext) > 0) + if err := mDTConfigurationEUTRA.MdtActivation.MarshalPER(w, enc); err != nil { + return err + } + if err := mDTConfigurationEUTRA.AreaScopeOfMDT.MarshalPER(w, enc); err != nil { + return err + } + if err := mDTConfigurationEUTRA.MDTMode.MarshalPER(w, enc); err != nil { + return err + } + if mDTConfigurationEUTRA.SignallingBasedMDTPLMNList != nil { + if err := mDTConfigurationEUTRA.SignallingBasedMDTPLMNList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mDTConfigurationEUTRA.extensions.Present() { + if err := mDTConfigurationEUTRA.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mDTConfigurationEUTRA = MDTConfigurationEUTRA{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SignallingBasedMDTPLMNList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mDTConfigurationEUTRA.MdtActivation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mDTConfigurationEUTRA.AreaScopeOfMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mDTConfigurationEUTRA.MDTMode).UnmarshalPER(r, enc); err != nil { + return err + } + if p_SignallingBasedMDTPLMNList { + if err := (&mDTConfigurationEUTRA.SignallingBasedMDTPLMNList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, &mDTConfigurationEUTRA.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mDTConfigurationEUTRA.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMDTConfigurationEUTRA []ap.IESpec[ProtocolIEID, MDTConfigurationEUTRA] + +func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mDTConfigurationEUTRA.MdtActivation.Diagnose(d) { + notComprehended = true + } + if mDTConfigurationEUTRA.AreaScopeOfMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, mDTConfigurationEUTRA.iEExtensions) + return notComprehended +} + +func (mDTConfigurationNR *MDTConfigurationNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMDTConfigurationNR, mDTConfigurationNR, mDTConfigurationNR.iEExtensions) + w.WriteBit(mDTConfigurationNR.extensions.Present()) + w.WriteBit(mDTConfigurationNR.SignallingBasedMDTPLMNList != nil) + w.WriteBit(len(ext) > 0) + if err := mDTConfigurationNR.MdtActivation.MarshalPER(w, enc); err != nil { + return err + } + if err := mDTConfigurationNR.AreaScopeOfMDT.MarshalPER(w, enc); err != nil { + return err + } + if err := mDTConfigurationNR.MDTModeNr.MarshalPER(w, enc); err != nil { + return err + } + if mDTConfigurationNR.SignallingBasedMDTPLMNList != nil { + if err := mDTConfigurationNR.SignallingBasedMDTPLMNList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mDTConfigurationNR.extensions.Present() { + if err := mDTConfigurationNR.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mDTConfigurationNR *MDTConfigurationNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mDTConfigurationNR = MDTConfigurationNR{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SignallingBasedMDTPLMNList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mDTConfigurationNR.MdtActivation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mDTConfigurationNR.AreaScopeOfMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mDTConfigurationNR.MDTModeNr).UnmarshalPER(r, enc); err != nil { + return err + } + if p_SignallingBasedMDTPLMNList { + if err := (&mDTConfigurationNR.SignallingBasedMDTPLMNList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfigurationNR, mDTConfigurationNR, &mDTConfigurationNR.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mDTConfigurationNR.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMDTConfigurationNR = []ap.IESpec[ProtocolIEID, MDTConfigurationNR]{ + { + ID: IDPNINPNAreaScopeofMDT, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MDTConfigurationNR, r *per.Reader, enc per.Encoding) error { + var v PNINPNAreaScopeofMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PNINPNAreaScopeofMDT = &v + return nil + }, + Encode: func(x *MDTConfigurationNR) (per.Marshaler, bool) { + if x.PNINPNAreaScopeofMDT == nil { + return nil, false + } + return x.PNINPNAreaScopeofMDT, true + }, + }, + { + ID: IDNetworkSliceAreaScopeofMDT, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MDTConfigurationNR, r *per.Reader, enc per.Encoding) error { + var v NetworkSliceAreaScopeofMDT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NetworkSliceAreaScopeofMDT = &v + return nil + }, + Encode: func(x *MDTConfigurationNR) (per.Marshaler, bool) { + if x.NetworkSliceAreaScopeofMDT == nil { + return nil, false + } + return x.NetworkSliceAreaScopeofMDT, true + }, + }, +} + +func (mDTConfigurationNR *MDTConfigurationNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mDTConfigurationNR.MdtActivation.Diagnose(d) { + notComprehended = true + } + if mDTConfigurationNR.AreaScopeOfMDT.Diagnose(d) { + notComprehended = true + } + if mDTConfigurationNR.MDTModeNr.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMDTConfigurationNR, mDTConfigurationNR, mDTConfigurationNR.iEExtensions) + return notComprehended +} + +func (mDTLocationInfo *MDTLocationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMDTLocationInfo, mDTLocationInfo, mDTLocationInfo.iEExtensions) + w.WriteBit(mDTLocationInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := mDTLocationInfo.MDTLocationInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mDTLocationInfo.extensions.Present() { + if err := mDTLocationInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mDTLocationInfo *MDTLocationInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mDTLocationInfo = MDTLocationInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mDTLocationInfo.MDTLocationInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTLocationInfo, mDTLocationInfo, &mDTLocationInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mDTLocationInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMDTLocationInfo []ap.IESpec[ProtocolIEID, MDTLocationInfo] + +func (mDTLocationInfo *MDTLocationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsMDTLocationInfo, mDTLocationInfo, mDTLocationInfo.iEExtensions) + return notComprehended +} + +func (mDTModeNr *MDTModeNr) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{mDTModeNr.ImmediateMDTNr != nil, mDTModeNr.LoggedMDTNr != nil, mDTModeNr.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case mDTModeNr.ImmediateMDTNr != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*mDTModeNr.ImmediateMDTNr).MarshalPER(w, enc); err != nil { + return err + } + case mDTModeNr.LoggedMDTNr != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*mDTModeNr.LoggedMDTNr).MarshalPER(w, enc); err != nil { + return err + } + case mDTModeNr.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, mDTModeNr.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (mDTModeNr *MDTModeNr) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mDTModeNr = MDTModeNr{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v ImmediateMDTNr + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mDTModeNr.ImmediateMDTNr = &v + case 1: + var v LoggedMDTNr + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mDTModeNr.LoggedMDTNr = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + mDTModeNr.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (mDTModeNr *MDTModeNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case mDTModeNr.ImmediateMDTNr != nil: + return mDTModeNr.ImmediateMDTNr.Diagnose(d) + case mDTModeNr.LoggedMDTNr != nil: + return mDTModeNr.LoggedMDTNr.Diagnose(d) + case mDTModeNr.ChoiceExtension != nil: + d.Unknown(mDTModeNr.ChoiceExtension.ID, mDTModeNr.ChoiceExtension.Criticality) + } + return false +} + +func (mDTcircle *MDTcircle) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMDTcircle, mDTcircle, mDTcircle.iEExtensions) + w.WriteBit(mDTcircle.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := mDTcircle.Referencelocation.MarshalPER(w, enc); err != nil { + return err + } + if err := mDTcircle.Distanceradius.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mDTcircle.extensions.Present() { + if err := mDTcircle.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mDTcircle *MDTcircle) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mDTcircle = MDTcircle{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mDTcircle.Referencelocation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mDTcircle.Distanceradius).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTcircle, mDTcircle, &mDTcircle.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mDTcircle.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMDTcircle []ap.IESpec[ProtocolIEID, MDTcircle] + +func (mDTcircle *MDTcircle) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsMDTcircle, mDTcircle, mDTcircle.iEExtensions) + return notComprehended +} + +func (mICOModeIndication MICOModeIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMICOModeIndication.Encode(w, enc, mICOModeIndication) +} + +func (mICOModeIndication *MICOModeIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMICOModeIndication.Decode(r, enc) + if err != nil { + return err + } + *mICOModeIndication = v + return nil +} + +func (mICOModeIndication MICOModeIndication) Name() string { + return enumMICOModeIndication.Name(mICOModeIndication) +} + +func (mICOModeIndication MICOModeIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMICOModeIndication.Known(mICOModeIndication) +} + +func (mNonlyMDTcollection MNonlyMDTcollection) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMNonlyMDTcollection.Encode(w, enc, mNonlyMDTcollection) +} + +func (mNonlyMDTcollection *MNonlyMDTcollection) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMNonlyMDTcollection.Decode(r, enc) + if err != nil { + return err + } + *mNonlyMDTcollection = v + return nil +} + +func (mNonlyMDTcollection MNonlyMDTcollection) Name() string { + return enumMNonlyMDTcollection.Name(mNonlyMDTcollection) +} + +func (mNonlyMDTcollection MNonlyMDTcollection) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMNonlyMDTcollection.Known(mNonlyMDTcollection) +} + +func (mRBProgressInformation *MRBProgressInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{mRBProgressInformation.PDCPSNLength12 != nil, mRBProgressInformation.PDCPSNLength18 != nil, mRBProgressInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case mRBProgressInformation.PDCPSNLength12 != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*mRBProgressInformation.PDCPSNLength12).MarshalPER(w, enc); err != nil { + return err + } + case mRBProgressInformation.PDCPSNLength18 != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*mRBProgressInformation.PDCPSNLength18).MarshalPER(w, enc); err != nil { + return err + } + case mRBProgressInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, mRBProgressInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (mRBProgressInformation *MRBProgressInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mRBProgressInformation = MRBProgressInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v MRBProgressInformationPDCPSNLength12 + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mRBProgressInformation.PDCPSNLength12 = &v + case 1: + var v MRBProgressInformationPDCPSNLength18 + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mRBProgressInformation.PDCPSNLength18 = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + mRBProgressInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (mRBProgressInformation *MRBProgressInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case mRBProgressInformation.PDCPSNLength12 != nil: + case mRBProgressInformation.PDCPSNLength18 != nil: + case mRBProgressInformation.ChoiceExtension != nil: + d.Unknown(mRBProgressInformation.ChoiceExtension.ID, mRBProgressInformation.ChoiceExtension.Criticality) + } + return false +} + +func (maximumIntegrityProtectedDataRate MaximumIntegrityProtectedDataRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMaximumIntegrityProtectedDataRate.Encode(w, enc, maximumIntegrityProtectedDataRate) +} + +func (maximumIntegrityProtectedDataRate *MaximumIntegrityProtectedDataRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMaximumIntegrityProtectedDataRate.Decode(r, enc) + if err != nil { + return err + } + *maximumIntegrityProtectedDataRate = v + return nil +} + +func (maximumIntegrityProtectedDataRate MaximumIntegrityProtectedDataRate) Name() string { + return enumMaximumIntegrityProtectedDataRate.Name(maximumIntegrityProtectedDataRate) +} + +func (maximumIntegrityProtectedDataRate MaximumIntegrityProtectedDataRate) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMaximumIntegrityProtectedDataRate.Known(maximumIntegrityProtectedDataRate) +} + +func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{measurementThresholdL1LoggedMDT.ThresholdRSRP != nil, measurementThresholdL1LoggedMDT.ThresholdRSRQ != nil, measurementThresholdL1LoggedMDT.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case measurementThresholdL1LoggedMDT.ThresholdRSRP != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*measurementThresholdL1LoggedMDT.ThresholdRSRP).MarshalPER(w, enc); err != nil { + return err + } + case measurementThresholdL1LoggedMDT.ThresholdRSRQ != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*measurementThresholdL1LoggedMDT.ThresholdRSRQ).MarshalPER(w, enc); err != nil { + return err + } + case measurementThresholdL1LoggedMDT.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, measurementThresholdL1LoggedMDT.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *measurementThresholdL1LoggedMDT = MeasurementThresholdL1LoggedMDT{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v ThresholdRSRP + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + measurementThresholdL1LoggedMDT.ThresholdRSRP = &v + case 1: + var v ThresholdRSRQ + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + measurementThresholdL1LoggedMDT.ThresholdRSRQ = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + measurementThresholdL1LoggedMDT.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case measurementThresholdL1LoggedMDT.ThresholdRSRP != nil: + case measurementThresholdL1LoggedMDT.ThresholdRSRQ != nil: + case measurementThresholdL1LoggedMDT.ChoiceExtension != nil: + d.Unknown(measurementThresholdL1LoggedMDT.ChoiceExtension.ID, measurementThresholdL1LoggedMDT.ChoiceExtension.Criticality) + } + return false +} + +func (micoAllPLMN MicoAllPLMN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMicoAllPLMN.Encode(w, enc, micoAllPLMN) +} + +func (micoAllPLMN *MicoAllPLMN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMicoAllPLMN.Decode(r, enc) + if err != nil { + return err + } + *micoAllPLMN = v + return nil +} + +func (micoAllPLMN MicoAllPLMN) Name() string { + return enumMicoAllPLMN.Name(micoAllPLMN) +} + +func (micoAllPLMN MicoAllPLMN) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMicoAllPLMN.Known(micoAllPLMN) +} + +func (mobileIABAuthorized MobileIABAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMobileIABAuthorized.Encode(w, enc, mobileIABAuthorized) +} + +func (mobileIABAuthorized *MobileIABAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMobileIABAuthorized.Decode(r, enc) + if err != nil { + return err + } + *mobileIABAuthorized = v + return nil +} + +func (mobileIABAuthorized MobileIABAuthorized) Name() string { + return enumMobileIABAuthorized.Name(mobileIABAuthorized) +} + +func (mobileIABAuthorized MobileIABAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMobileIABAuthorized.Known(mobileIABAuthorized) +} + +func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation.iEExtensions) + w.WriteBit(mobileIABMTUserLocationInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := mobileIABMTUserLocationInformation.NRCGI.MarshalPER(w, enc); err != nil { + return err + } + if err := mobileIABMTUserLocationInformation.TAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mobileIABMTUserLocationInformation.extensions.Present() { + if err := mobileIABMTUserLocationInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mobileIABMTUserLocationInformation = MobileIABMTUserLocationInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mobileIABMTUserLocationInformation.NRCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&mobileIABMTUserLocationInformation.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, &mobileIABMTUserLocationInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mobileIABMTUserLocationInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMobileIABMTUserLocationInformation []ap.IESpec[ProtocolIEID, MobileIABMTUserLocationInformation] + +func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mobileIABMTUserLocationInformation.NRCGI.Diagnose(d) { + notComprehended = true + } + if mobileIABMTUserLocationInformation.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation.iEExtensions) + return notComprehended +} + +func (mobileIABNodeIndication MobileIABNodeIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMobileIABNodeIndication.Encode(w, enc, mobileIABNodeIndication) +} + +func (mobileIABNodeIndication *MobileIABNodeIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMobileIABNodeIndication.Decode(r, enc) + if err != nil { + return err + } + *mobileIABNodeIndication = v + return nil +} + +func (mobileIABNodeIndication MobileIABNodeIndication) Name() string { + return enumMobileIABNodeIndication.Name(mobileIABNodeIndication) +} + +func (mobileIABNodeIndication MobileIABNodeIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMobileIABNodeIndication.Known(mobileIABNodeIndication) +} + +func (mobileIABSupported MobileIABSupported) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMobileIABSupported.Encode(w, enc, mobileIABSupported) +} + +func (mobileIABSupported *MobileIABSupported) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMobileIABSupported.Decode(r, enc) + if err != nil { + return err + } + *mobileIABSupported = v + return nil +} + +func (mobileIABSupported MobileIABSupported) Name() string { + return enumMobileIABSupported.Name(mobileIABSupported) +} + +func (mobileIABSupported MobileIABSupported) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMobileIABSupported.Known(mobileIABSupported) +} + +func (mobilityRestrictionList *MobilityRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMobilityRestrictionList, mobilityRestrictionList, mobilityRestrictionList.iEExtensions) + w.WriteBit(mobilityRestrictionList.extensions.Present()) + w.WriteBit(mobilityRestrictionList.EquivalentPLMNs != nil) + w.WriteBit(mobilityRestrictionList.RATRestrictions != nil) + w.WriteBit(mobilityRestrictionList.ForbiddenAreaInformation != nil) + w.WriteBit(mobilityRestrictionList.ServiceAreaInformation != nil) + w.WriteBit(len(ext) > 0) + if err := mobilityRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { + return err + } + if mobilityRestrictionList.EquivalentPLMNs != nil { + if err := mobilityRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { + return err + } + } + if mobilityRestrictionList.RATRestrictions != nil { + if err := mobilityRestrictionList.RATRestrictions.MarshalPER(w, enc); err != nil { + return err + } + } + if mobilityRestrictionList.ForbiddenAreaInformation != nil { + if err := mobilityRestrictionList.ForbiddenAreaInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if mobilityRestrictionList.ServiceAreaInformation != nil { + if err := mobilityRestrictionList.ServiceAreaInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mobilityRestrictionList.extensions.Present() { + if err := mobilityRestrictionList.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mobilityRestrictionList *MobilityRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mobilityRestrictionList = MobilityRestrictionList{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_EquivalentPLMNs, err := r.ReadBit() + if err != nil { + return err + } + p_RATRestrictions, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenAreaInformation, err := r.ReadBit() + if err != nil { + return err + } + p_ServiceAreaInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mobilityRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { + return err + } + if p_EquivalentPLMNs { + if err := (&mobilityRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_RATRestrictions { + if err := (&mobilityRestrictionList.RATRestrictions).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenAreaInformation { + if err := (&mobilityRestrictionList.ForbiddenAreaInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ServiceAreaInformation { + if err := (&mobilityRestrictionList.ServiceAreaInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMobilityRestrictionList, mobilityRestrictionList, &mobilityRestrictionList.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mobilityRestrictionList.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMobilityRestrictionList = []ap.IESpec[ProtocolIEID, MobilityRestrictionList]{ + { + ID: IDLastEUTRANPLMNIdentity, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { + var v PLMNIdentity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LastEUTRANPLMNIdentity = &v + return nil + }, + Encode: func(x *MobilityRestrictionList) (per.Marshaler, bool) { + if x.LastEUTRANPLMNIdentity == nil { + return nil, false + } + return x.LastEUTRANPLMNIdentity, true + }, + }, + { + ID: IDCNTypeRestrictionsForServing, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { + var v CNTypeRestrictionsForServing + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNTypeRestrictionsForServing = &v + return nil + }, + Encode: func(x *MobilityRestrictionList) (per.Marshaler, bool) { + if x.CNTypeRestrictionsForServing == nil { + return nil, false + } + return x.CNTypeRestrictionsForServing, true + }, + }, + { + ID: IDCNTypeRestrictionsForEquivalent, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { + var v CNTypeRestrictionsForEquivalent + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNTypeRestrictionsForEquivalent = v + return nil + }, + Encode: func(x *MobilityRestrictionList) (per.Marshaler, bool) { + if len(x.CNTypeRestrictionsForEquivalent) == 0 { + return nil, false + } + return x.CNTypeRestrictionsForEquivalent, true + }, + }, + { + ID: IDNPNMobilityInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { + var v NPNMobilityInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NPNMobilityInformation = &v + return nil + }, + Encode: func(x *MobilityRestrictionList) (per.Marshaler, bool) { + if x.NPNMobilityInformation == nil { + return nil, false + } + return x.NPNMobilityInformation, true + }, + }, +} + +func (mobilityRestrictionList *MobilityRestrictionList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mobilityRestrictionList.RATRestrictions.Diagnose(d) { + notComprehended = true + } + if mobilityRestrictionList.ForbiddenAreaInformation.Diagnose(d) { + notComprehended = true + } + if mobilityRestrictionList.ServiceAreaInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMobilityRestrictionList, mobilityRestrictionList, mobilityRestrictionList.iEExtensions) + return notComprehended +} + +func (monitoringRequest MonitoringRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMonitoringRequest.Encode(w, enc, monitoringRequest) +} + +func (monitoringRequest *MonitoringRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMonitoringRequest.Decode(r, enc) + if err != nil { + return err + } + *monitoringRequest = v + return nil +} + +func (monitoringRequest MonitoringRequest) Name() string { + return enumMonitoringRequest.Name(monitoringRequest) +} + +func (monitoringRequest MonitoringRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMonitoringRequest.Known(monitoringRequest) +} + +func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate.iEExtensions) + w.WriteBit(monitoringRequestonAvailableBitrate.extensions.Present()) + w.WriteBit(monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds != nil) + w.WriteBit(monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds != nil) + w.WriteBit(len(ext) > 0) + if err := monitoringRequestonAvailableBitrate.MonitoringRequest.MarshalPER(w, enc); err != nil { + return err + } + if monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds != nil { + if err := monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds.MarshalPER(w, enc); err != nil { + return err + } + } + if monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds != nil { + if err := monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if monitoringRequestonAvailableBitrate.extensions.Present() { + if err := monitoringRequestonAvailableBitrate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *monitoringRequestonAvailableBitrate = MonitoringRequestonAvailableBitrate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DlAvailableBitrateReportThresholds, err := r.ReadBit() + if err != nil { + return err + } + p_UlAvailableBitrateReportThresholds, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&monitoringRequestonAvailableBitrate.MonitoringRequest).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DlAvailableBitrateReportThresholds { + if err := (&monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_UlAvailableBitrateReportThresholds { + if err := (&monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, &monitoringRequestonAvailableBitrate.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := monitoringRequestonAvailableBitrate.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMonitoringRequestonAvailableBitrate []ap.IESpec[ProtocolIEID, MonitoringRequestonAvailableBitrate] + +func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if monitoringRequestonAvailableBitrate.MonitoringRequest.Diagnose(d) { + notComprehended = true + } + if monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds.Diagnose(d) { + notComprehended = true + } + if monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate.iEExtensions) + return notComprehended +} + +func (n3IWFID *N3IWFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{n3IWFID.N3IWFID != nil, n3IWFID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case n3IWFID.N3IWFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*n3IWFID.N3IWFID).MarshalPER(w, enc); err != nil { + return err + } + case n3IWFID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, n3IWFID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (n3IWFID *N3IWFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *n3IWFID = N3IWFID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v N3IWFIDValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + n3IWFID.N3IWFID = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + n3IWFID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (n3IWFID *N3IWFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case n3IWFID.N3IWFID != nil: + case n3IWFID.ChoiceExtension != nil: + d.Unknown(n3IWFID.ChoiceExtension.ID, n3IWFID.ChoiceExtension.Criticality) + } + return false +} + +func (n6JitterInformation *N6JitterInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsN6JitterInformation, n6JitterInformation, n6JitterInformation.iEExtensions) + w.WriteBit(n6JitterInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := n6JitterInformation.N6JitterLowerBound.MarshalPER(w, enc); err != nil { + return err + } + if err := n6JitterInformation.N6JitterUpperBound.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if n6JitterInformation.extensions.Present() { + if err := n6JitterInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (n6JitterInformation *N6JitterInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *n6JitterInformation = N6JitterInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&n6JitterInformation.N6JitterLowerBound).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&n6JitterInformation.N6JitterUpperBound).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsN6JitterInformation, n6JitterInformation, &n6JitterInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := n6JitterInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsN6JitterInformation []ap.IESpec[ProtocolIEID, N6JitterInformation] + +func (n6JitterInformation *N6JitterInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsN6JitterInformation, n6JitterInformation, n6JitterInformation.iEExtensions) + return notComprehended +} + +func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTDefaultPagingDRX.Encode(w, enc, nBIoTDefaultPagingDRX) +} + +func (nBIoTDefaultPagingDRX *NBIoTDefaultPagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTDefaultPagingDRX.Decode(r, enc) + if err != nil { + return err + } + *nBIoTDefaultPagingDRX = v + return nil +} + +func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) Name() string { + return enumNBIoTDefaultPagingDRX.Name(nBIoTDefaultPagingDRX) +} + +func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTDefaultPagingDRX.Known(nBIoTDefaultPagingDRX) +} + +func (nBIoTPagingDRX NBIoTPagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTPagingDRX.Encode(w, enc, nBIoTPagingDRX) +} + +func (nBIoTPagingDRX *NBIoTPagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTPagingDRX.Decode(r, enc) + if err != nil { + return err + } + *nBIoTPagingDRX = v + return nil +} + +func (nBIoTPagingDRX NBIoTPagingDRX) Name() string { + return enumNBIoTPagingDRX.Name(nBIoTPagingDRX) +} + +func (nBIoTPagingDRX NBIoTPagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTPagingDRX.Known(nBIoTPagingDRX) +} + +func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTPagingTimeWindow.Encode(w, enc, nBIoTPagingTimeWindow) +} + +func (nBIoTPagingTimeWindow *NBIoTPagingTimeWindow) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTPagingTimeWindow.Decode(r, enc) + if err != nil { + return err + } + *nBIoTPagingTimeWindow = v + return nil +} + +func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) Name() string { + return enumNBIoTPagingTimeWindow.Name(nBIoTPagingTimeWindow) +} + +func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTPagingTimeWindow.Known(nBIoTPagingTimeWindow) +} + +func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTPagingeDRXCycle.Encode(w, enc, nBIoTPagingeDRXCycle) +} + +func (nBIoTPagingeDRXCycle *NBIoTPagingeDRXCycle) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTPagingeDRXCycle.Decode(r, enc) + if err != nil { + return err + } + *nBIoTPagingeDRXCycle = v + return nil +} + +func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) Name() string { + return enumNBIoTPagingeDRXCycle.Name(nBIoTPagingeDRXCycle) +} + +func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTPagingeDRXCycle.Known(nBIoTPagingeDRXCycle) +} + +func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo.iEExtensions) + w.WriteBit(nBIoTPagingeDRXInfo.extensions.Present()) + w.WriteBit(nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow != nil) + w.WriteBit(len(ext) > 0) + if err := nBIoTPagingeDRXInfo.NBIoTPagingeDRXCycle.MarshalPER(w, enc); err != nil { + return err + } + if nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow != nil { + if err := (*nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nBIoTPagingeDRXInfo.extensions.Present() { + if err := nBIoTPagingeDRXInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nBIoTPagingeDRXInfo = NBIoTPagingeDRXInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NBIoTPagingTimeWindow, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nBIoTPagingeDRXInfo.NBIoTPagingeDRXCycle).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NBIoTPagingTimeWindow { + var v NBIoTPagingTimeWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, &nBIoTPagingeDRXInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nBIoTPagingeDRXInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNBIoTPagingeDRXInfo []ap.IESpec[ProtocolIEID, NBIoTPagingeDRXInfo] + +func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nBIoTPagingeDRXInfo.NBIoTPagingeDRXCycle.Diagnose(d) { + notComprehended = true + } + if nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow != nil && nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo.iEExtensions) + return notComprehended +} + +func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem.iEExtensions) + w.WriteBit(nGAPIESupportInformationRequestItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{}, int64(nGAPIESupportInformationRequestItem.NgapProtocolIEId)); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nGAPIESupportInformationRequestItem.extensions.Present() { + if err := nGAPIESupportInformationRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGAPIESupportInformationRequestItem = NGAPIESupportInformationRequestItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{}) + if err != nil { + return err + } + nGAPIESupportInformationRequestItem.NgapProtocolIEId = ProtocolIEID(n0) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, &nGAPIESupportInformationRequestItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nGAPIESupportInformationRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNGAPIESupportInformationRequestItem []ap.IESpec[ProtocolIEID, NGAPIESupportInformationRequestItem] + +func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem.iEExtensions) + return notComprehended +} + +func (nGRANCGI *NGRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{nGRANCGI.NRCGI != nil, nGRANCGI.EUTRACGI != nil, nGRANCGI.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case nGRANCGI.NRCGI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*nGRANCGI.NRCGI).MarshalPER(w, enc); err != nil { + return err + } + case nGRANCGI.EUTRACGI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*nGRANCGI.EUTRACGI).MarshalPER(w, enc); err != nil { + return err + } + case nGRANCGI.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, nGRANCGI.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (nGRANCGI *NGRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGRANCGI = NGRANCGI{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v NRCGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nGRANCGI.NRCGI = &v + case 1: + var v EUTRACGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nGRANCGI.EUTRACGI = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + nGRANCGI.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (nGRANCGI *NGRANCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case nGRANCGI.NRCGI != nil: + return nGRANCGI.NRCGI.Diagnose(d) + case nGRANCGI.EUTRACGI != nil: + return nGRANCGI.EUTRACGI.Diagnose(d) + case nGRANCGI.ChoiceExtension != nil: + d.Unknown(nGRANCGI.ChoiceExtension.ID, nGRANCGI.ChoiceExtension.Criticality) + } + return false +} + +func (nGRANCellReportItem *NGRANCellReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNGRANCellReportItem, nGRANCellReportItem, nGRANCellReportItem.iEExtensions) + w.WriteBit(nGRANCellReportItem.extensions.Present()) + w.WriteBit(nGRANCellReportItem.NGRANNumberOfActiveUEs != nil) + w.WriteBit(nGRANCellReportItem.NGRANNoofRRCConnections != nil) + w.WriteBit(nGRANCellReportItem.NGRANRadioResourceStatus != nil) + w.WriteBit(len(ext) > 0) + if err := nGRANCellReportItem.NGRANCGI.MarshalPER(w, enc); err != nil { + return err + } + if err := nGRANCellReportItem.NGRANCompositeAvailableCapacityGroup.MarshalPER(w, enc); err != nil { + return err + } + if nGRANCellReportItem.NGRANNumberOfActiveUEs != nil { + if err := (*nGRANCellReportItem.NGRANNumberOfActiveUEs).MarshalPER(w, enc); err != nil { + return err + } + } + if nGRANCellReportItem.NGRANNoofRRCConnections != nil { + if err := (*nGRANCellReportItem.NGRANNoofRRCConnections).MarshalPER(w, enc); err != nil { + return err + } + } + if nGRANCellReportItem.NGRANRadioResourceStatus != nil { + if err := (*nGRANCellReportItem.NGRANRadioResourceStatus).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nGRANCellReportItem.extensions.Present() { + if err := nGRANCellReportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nGRANCellReportItem *NGRANCellReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGRANCellReportItem = NGRANCellReportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NGRANNumberOfActiveUEs, err := r.ReadBit() + if err != nil { + return err + } + p_NGRANNoofRRCConnections, err := r.ReadBit() + if err != nil { + return err + } + p_NGRANRadioResourceStatus, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nGRANCellReportItem.NGRANCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nGRANCellReportItem.NGRANCompositeAvailableCapacityGroup).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NGRANNumberOfActiveUEs { + var v NGRANNumberOfActiveUEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nGRANCellReportItem.NGRANNumberOfActiveUEs = &v + } + if p_NGRANNoofRRCConnections { + var v NGRANNoofRRCConnections + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nGRANCellReportItem.NGRANNoofRRCConnections = &v + } + if p_NGRANRadioResourceStatus { + var v NGRANRadioResourceStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nGRANCellReportItem.NGRANRadioResourceStatus = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANCellReportItem, nGRANCellReportItem, &nGRANCellReportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nGRANCellReportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNGRANCellReportItem []ap.IESpec[ProtocolIEID, NGRANCellReportItem] + +func (nGRANCellReportItem *NGRANCellReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nGRANCellReportItem.NGRANCGI.Diagnose(d) { + notComprehended = true + } + if nGRANCellReportItem.NGRANCompositeAvailableCapacityGroup.Diagnose(d) { + notComprehended = true + } + if nGRANCellReportItem.NGRANNumberOfActiveUEs != nil && nGRANCellReportItem.NGRANNumberOfActiveUEs.Diagnose(d) { + notComprehended = true + } + if nGRANCellReportItem.NGRANNoofRRCConnections != nil && nGRANCellReportItem.NGRANNoofRRCConnections.Diagnose(d) { + notComprehended = true + } + if nGRANCellReportItem.NGRANRadioResourceStatus != nil && nGRANCellReportItem.NGRANRadioResourceStatus.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNGRANCellReportItem, nGRANCellReportItem, nGRANCellReportItem.iEExtensions) + return notComprehended +} + +func (nGRANCellToReportItem *NGRANCellToReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNGRANCellToReportItem, nGRANCellToReportItem, nGRANCellToReportItem.iEExtensions) + w.WriteBit(nGRANCellToReportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nGRANCellToReportItem.NGRANCGI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nGRANCellToReportItem.extensions.Present() { + if err := nGRANCellToReportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nGRANCellToReportItem *NGRANCellToReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGRANCellToReportItem = NGRANCellToReportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nGRANCellToReportItem.NGRANCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANCellToReportItem, nGRANCellToReportItem, &nGRANCellToReportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nGRANCellToReportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNGRANCellToReportItem []ap.IESpec[ProtocolIEID, NGRANCellToReportItem] + +func (nGRANCellToReportItem *NGRANCellToReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nGRANCellToReportItem.NGRANCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNGRANCellToReportItem, nGRANCellToReportItem, nGRANCellToReportItem.iEExtensions) + return notComprehended +} + +func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, nGRANRadioResourceStatus.iEExtensions) + w.WriteBit(nGRANRadioResourceStatus.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nGRANRadioResourceStatus.DLGBRPRBusageforMIMO.MarshalPER(w, enc); err != nil { + return err + } + if err := nGRANRadioResourceStatus.ULGBRPRBusageforMIMO.MarshalPER(w, enc); err != nil { + return err + } + if err := nGRANRadioResourceStatus.DLnonGBRPRBusageforMIMO.MarshalPER(w, enc); err != nil { + return err + } + if err := nGRANRadioResourceStatus.ULnonGBRPRBusageforMIMO.MarshalPER(w, enc); err != nil { + return err + } + if err := nGRANRadioResourceStatus.DLTotalPRBusageforMIMO.MarshalPER(w, enc); err != nil { + return err + } + if err := nGRANRadioResourceStatus.ULTotalPRBusageforMIMO.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nGRANRadioResourceStatus.extensions.Present() { + if err := nGRANRadioResourceStatus.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGRANRadioResourceStatus = NGRANRadioResourceStatus{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nGRANRadioResourceStatus.DLGBRPRBusageforMIMO).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nGRANRadioResourceStatus.ULGBRPRBusageforMIMO).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nGRANRadioResourceStatus.DLnonGBRPRBusageforMIMO).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nGRANRadioResourceStatus.ULnonGBRPRBusageforMIMO).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nGRANRadioResourceStatus.DLTotalPRBusageforMIMO).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nGRANRadioResourceStatus.ULTotalPRBusageforMIMO).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, &nGRANRadioResourceStatus.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nGRANRadioResourceStatus.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNGRANRadioResourceStatus []ap.IESpec[ProtocolIEID, NGRANRadioResourceStatus] + +func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, nGRANRadioResourceStatus.iEExtensions) + return notComprehended +} + +func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, nGRANReportingStatusIEs.iEExtensions) + w.WriteBit(nGRANReportingStatusIEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nGRANReportingStatusIEs.NGRANCellReportList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nGRANReportingStatusIEs.extensions.Present() { + if err := nGRANReportingStatusIEs.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGRANReportingStatusIEs = NGRANReportingStatusIEs{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nGRANReportingStatusIEs.NGRANCellReportList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, &nGRANReportingStatusIEs.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nGRANReportingStatusIEs.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNGRANReportingStatusIEs []ap.IESpec[ProtocolIEID, NGRANReportingStatusIEs] + +func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nGRANReportingStatusIEs.NGRANCellReportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, nGRANReportingStatusIEs.iEExtensions) + return notComprehended +} + +func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, nGRANReportingSystemIEs.iEExtensions) + w.WriteBit(nGRANReportingSystemIEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nGRANReportingSystemIEs.NGRANCellToReportList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nGRANReportingSystemIEs.extensions.Present() { + if err := nGRANReportingSystemIEs.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGRANReportingSystemIEs = NGRANReportingSystemIEs{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nGRANReportingSystemIEs.NGRANCellToReportList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, &nGRANReportingSystemIEs.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nGRANReportingSystemIEs.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNGRANReportingSystemIEs []ap.IESpec[ProtocolIEID, NGRANReportingSystemIEs] + +func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nGRANReportingSystemIEs.NGRANCellToReportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, nGRANReportingSystemIEs.iEExtensions) + return notComprehended +} + +func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem.iEExtensions) + w.WriteBit(nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil) + w.WriteBit(len(ext) > 0) + if err := nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil { + if err := (*nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + return nil +} + +func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nGRANTNLAssociationToRemoveItem = NGRANTNLAssociationToRemoveItem{} + p_TNLAssociationTransportLayerAddressAMF, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TNLAssociationTransportLayerAddressAMF { + var v CPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, &nGRANTNLAssociationToRemoveItem.iEExtensions); err != nil { + return err + } + } + return nil +} + +var extIEsNGRANTNLAssociationToRemoveItem []ap.IESpec[ProtocolIEID, NGRANTNLAssociationToRemoveItem] + +func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.Diagnose(d) { + notComprehended = true + } + if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil && nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem.iEExtensions) + return notComprehended +} + +func (nPNAccessInformation *NPNAccessInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{nPNAccessInformation.PNINPNAccessInformation != nil, nPNAccessInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case nPNAccessInformation.PNINPNAccessInformation != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*nPNAccessInformation.PNINPNAccessInformation).MarshalPER(w, enc); err != nil { + return err + } + case nPNAccessInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, nPNAccessInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (nPNAccessInformation *NPNAccessInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nPNAccessInformation = NPNAccessInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v CellCAGList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nPNAccessInformation.PNINPNAccessInformation = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + nPNAccessInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (nPNAccessInformation *NPNAccessInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case nPNAccessInformation.PNINPNAccessInformation != nil: + case nPNAccessInformation.ChoiceExtension != nil: + d.Unknown(nPNAccessInformation.ChoiceExtension.ID, nPNAccessInformation.ChoiceExtension.Criticality) + } + return false +} + +func (nPNMobilityInformation *NPNMobilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{nPNMobilityInformation.SNPNMobilityInformation != nil, nPNMobilityInformation.PNINPNMobilityInformation != nil, nPNMobilityInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case nPNMobilityInformation.SNPNMobilityInformation != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*nPNMobilityInformation.SNPNMobilityInformation).MarshalPER(w, enc); err != nil { + return err + } + case nPNMobilityInformation.PNINPNMobilityInformation != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*nPNMobilityInformation.PNINPNMobilityInformation).MarshalPER(w, enc); err != nil { + return err + } + case nPNMobilityInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, nPNMobilityInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (nPNMobilityInformation *NPNMobilityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nPNMobilityInformation = NPNMobilityInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v SNPNMobilityInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nPNMobilityInformation.SNPNMobilityInformation = &v + case 1: + var v PNINPNMobilityInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nPNMobilityInformation.PNINPNMobilityInformation = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + nPNMobilityInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (nPNMobilityInformation *NPNMobilityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case nPNMobilityInformation.SNPNMobilityInformation != nil: + return nPNMobilityInformation.SNPNMobilityInformation.Diagnose(d) + case nPNMobilityInformation.PNINPNMobilityInformation != nil: + return nPNMobilityInformation.PNINPNMobilityInformation.Diagnose(d) + case nPNMobilityInformation.ChoiceExtension != nil: + d.Unknown(nPNMobilityInformation.ChoiceExtension.ID, nPNMobilityInformation.ChoiceExtension.Criticality) + } + return false +} + +func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{nPNPagingAssistanceInformation.PNINPNPagingAssistance != nil, nPNPagingAssistanceInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case nPNPagingAssistanceInformation.PNINPNPagingAssistance != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*nPNPagingAssistanceInformation.PNINPNPagingAssistance).MarshalPER(w, enc); err != nil { + return err + } + case nPNPagingAssistanceInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, nPNPagingAssistanceInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nPNPagingAssistanceInformation = NPNPagingAssistanceInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v AllowedPNINPNList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nPNPagingAssistanceInformation.PNINPNPagingAssistance = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + nPNPagingAssistanceInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case nPNPagingAssistanceInformation.PNINPNPagingAssistance != nil: + return nPNPagingAssistanceInformation.PNINPNPagingAssistance.Diagnose(d) + case nPNPagingAssistanceInformation.ChoiceExtension != nil: + d.Unknown(nPNPagingAssistanceInformation.ChoiceExtension.ID, nPNPagingAssistanceInformation.ChoiceExtension.Criticality) + } + return false +} + +func (nPNSupport *NPNSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{nPNSupport.SNPN != nil, nPNSupport.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case nPNSupport.SNPN != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*nPNSupport.SNPN).MarshalPER(w, enc); err != nil { + return err + } + case nPNSupport.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, nPNSupport.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (nPNSupport *NPNSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nPNSupport = NPNSupport{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v NID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nPNSupport.SNPN = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + nPNSupport.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (nPNSupport *NPNSupport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case nPNSupport.SNPN != nil: + case nPNSupport.ChoiceExtension != nil: + d.Unknown(nPNSupport.ChoiceExtension.ID, nPNSupport.ChoiceExtension.Criticality) + } + return false +} + +func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, nRA2XServicesAuthorized.iEExtensions) + w.WriteBit(nRA2XServicesAuthorized.extensions.Present()) + w.WriteBit(nRA2XServicesAuthorized.AerialUE != nil) + w.WriteBit(nRA2XServicesAuthorized.AerialControllerUE != nil) + w.WriteBit(len(ext) > 0) + if nRA2XServicesAuthorized.AerialUE != nil { + if err := (*nRA2XServicesAuthorized.AerialUE).MarshalPER(w, enc); err != nil { + return err + } + } + if nRA2XServicesAuthorized.AerialControllerUE != nil { + if err := (*nRA2XServicesAuthorized.AerialControllerUE).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRA2XServicesAuthorized.extensions.Present() { + if err := nRA2XServicesAuthorized.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRA2XServicesAuthorized = NRA2XServicesAuthorized{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AerialUE, err := r.ReadBit() + if err != nil { + return err + } + p_AerialControllerUE, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_AerialUE { + var v NRA2XServicesAuthorizedAerialUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRA2XServicesAuthorized.AerialUE = &v + } + if p_AerialControllerUE { + var v NRA2XServicesAuthorizedAerialControllerUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRA2XServicesAuthorized.AerialControllerUE = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, &nRA2XServicesAuthorized.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRA2XServicesAuthorized.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRA2XServicesAuthorized []ap.IESpec[ProtocolIEID, NRA2XServicesAuthorized] + +func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nRA2XServicesAuthorized.AerialUE != nil && nRA2XServicesAuthorized.AerialUE.Diagnose(d) { + notComprehended = true + } + if nRA2XServicesAuthorized.AerialControllerUE != nil && nRA2XServicesAuthorized.AerialControllerUE.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, nRA2XServicesAuthorized.iEExtensions) + return notComprehended +} + +func (nRA2XServicesAuthorizedAerialControllerUE NRA2XServicesAuthorizedAerialControllerUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRA2XServicesAuthorizedAerialControllerUE.Encode(w, enc, nRA2XServicesAuthorizedAerialControllerUE) +} + +func (nRA2XServicesAuthorizedAerialControllerUE *NRA2XServicesAuthorizedAerialControllerUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRA2XServicesAuthorizedAerialControllerUE.Decode(r, enc) + if err != nil { + return err + } + *nRA2XServicesAuthorizedAerialControllerUE = v + return nil +} + +func (nRA2XServicesAuthorizedAerialControllerUE NRA2XServicesAuthorizedAerialControllerUE) Name() string { + return enumNRA2XServicesAuthorizedAerialControllerUE.Name(nRA2XServicesAuthorizedAerialControllerUE) +} + +func (nRA2XServicesAuthorizedAerialControllerUE NRA2XServicesAuthorizedAerialControllerUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNRA2XServicesAuthorizedAerialControllerUE.Known(nRA2XServicesAuthorizedAerialControllerUE) +} + +func (nRA2XServicesAuthorizedAerialUE NRA2XServicesAuthorizedAerialUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRA2XServicesAuthorizedAerialUE.Encode(w, enc, nRA2XServicesAuthorizedAerialUE) +} + +func (nRA2XServicesAuthorizedAerialUE *NRA2XServicesAuthorizedAerialUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRA2XServicesAuthorizedAerialUE.Decode(r, enc) + if err != nil { + return err + } + *nRA2XServicesAuthorizedAerialUE = v + return nil +} + +func (nRA2XServicesAuthorizedAerialUE NRA2XServicesAuthorizedAerialUE) Name() string { + return enumNRA2XServicesAuthorizedAerialUE.Name(nRA2XServicesAuthorizedAerialUE) +} + +func (nRA2XServicesAuthorizedAerialUE NRA2XServicesAuthorizedAerialUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNRA2XServicesAuthorizedAerialUE.Known(nRA2XServicesAuthorizedAerialUE) +} + +func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + w.WriteBit(nRCGI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nRCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := nRCGI.NRCellIdentity.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRCGI.extensions.Present() { + if err := nRCGI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRCGI = NRCGI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nRCGI.NRCellIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRCGI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRCGI []ap.IESpec[ProtocolIEID, NRCGI] + +func (nRCGI *NRCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + return notComprehended +} + +func (nRFrequencyBandItem *NRFrequencyBandItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRFrequencyBandItem, nRFrequencyBandItem, nRFrequencyBandItem.iEExtensions) + w.WriteBit(nRFrequencyBandItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nRFrequencyBandItem.Nrfrequencyband.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRFrequencyBandItem.extensions.Present() { + if err := nRFrequencyBandItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRFrequencyBandItem *NRFrequencyBandItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRFrequencyBandItem = NRFrequencyBandItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRFrequencyBandItem.Nrfrequencyband).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRFrequencyBandItem, nRFrequencyBandItem, &nRFrequencyBandItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRFrequencyBandItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRFrequencyBandItem []ap.IESpec[ProtocolIEID, NRFrequencyBandItem] + +func (nRFrequencyBandItem *NRFrequencyBandItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nRFrequencyBandItem.Nrfrequencyband.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNRFrequencyBandItem, nRFrequencyBandItem, nRFrequencyBandItem.iEExtensions) + return notComprehended +} + +func (nRFrequencyInfo *NRFrequencyInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRFrequencyInfo, nRFrequencyInfo, nRFrequencyInfo.iEExtensions) + w.WriteBit(nRFrequencyInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nRFrequencyInfo.NrARFCN.MarshalPER(w, enc); err != nil { + return err + } + if err := nRFrequencyInfo.FrequencyBandList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRFrequencyInfo.extensions.Present() { + if err := nRFrequencyInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRFrequencyInfo *NRFrequencyInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRFrequencyInfo = NRFrequencyInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRFrequencyInfo.NrARFCN).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nRFrequencyInfo.FrequencyBandList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRFrequencyInfo, nRFrequencyInfo, &nRFrequencyInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRFrequencyInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRFrequencyInfo []ap.IESpec[ProtocolIEID, NRFrequencyInfo] + +func (nRFrequencyInfo *NRFrequencyInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nRFrequencyInfo.FrequencyBandList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNRFrequencyInfo, nRFrequencyInfo, nRFrequencyInfo.iEExtensions) + return notComprehended +} + +func (nRNTNTAIInformation *NRNTNTAIInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRNTNTAIInformation, nRNTNTAIInformation, nRNTNTAIInformation.iEExtensions) + w.WriteBit(nRNTNTAIInformation.extensions.Present()) + w.WriteBit(nRNTNTAIInformation.UELocationDerivedTACInNRNTN != nil) + w.WriteBit(len(ext) > 0) + if err := nRNTNTAIInformation.ServingPLMN.MarshalPER(w, enc); err != nil { + return err + } + if err := nRNTNTAIInformation.TACListInNRNTN.MarshalPER(w, enc); err != nil { + return err + } + if nRNTNTAIInformation.UELocationDerivedTACInNRNTN != nil { + if err := (*nRNTNTAIInformation.UELocationDerivedTACInNRNTN).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRNTNTAIInformation.extensions.Present() { + if err := nRNTNTAIInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRNTNTAIInformation *NRNTNTAIInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRNTNTAIInformation = NRNTNTAIInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UELocationDerivedTACInNRNTN, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRNTNTAIInformation.ServingPLMN).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nRNTNTAIInformation.TACListInNRNTN).UnmarshalPER(r, enc); err != nil { + return err + } + if p_UELocationDerivedTACInNRNTN { + var v TAC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRNTNTAIInformation.UELocationDerivedTACInNRNTN = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRNTNTAIInformation, nRNTNTAIInformation, &nRNTNTAIInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRNTNTAIInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRNTNTAIInformation []ap.IESpec[ProtocolIEID, NRNTNTAIInformation] + +func (nRNTNTAIInformation *NRNTNTAIInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsNRNTNTAIInformation, nRNTNTAIInformation, nRNTNTAIInformation.iEExtensions) + return notComprehended +} + +func (nRPagingTimeWindow NRPagingTimeWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRPagingTimeWindow.Encode(w, enc, nRPagingTimeWindow) +} + +func (nRPagingTimeWindow *NRPagingTimeWindow) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRPagingTimeWindow.Decode(r, enc) + if err != nil { + return err + } + *nRPagingTimeWindow = v + return nil +} + +func (nRPagingTimeWindow NRPagingTimeWindow) Name() string { + return enumNRPagingTimeWindow.Name(nRPagingTimeWindow) +} + +func (nRPagingTimeWindow NRPagingTimeWindow) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNRPagingTimeWindow.Known(nRPagingTimeWindow) +} + +func (nRPagingeDRXCycle NRPagingeDRXCycle) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRPagingeDRXCycle.Encode(w, enc, nRPagingeDRXCycle) +} + +func (nRPagingeDRXCycle *NRPagingeDRXCycle) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRPagingeDRXCycle.Decode(r, enc) + if err != nil { + return err + } + *nRPagingeDRXCycle = v + return nil +} + +func (nRPagingeDRXCycle NRPagingeDRXCycle) Name() string { + return enumNRPagingeDRXCycle.Name(nRPagingeDRXCycle) +} + +func (nRPagingeDRXCycle NRPagingeDRXCycle) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNRPagingeDRXCycle.Known(nRPagingeDRXCycle) +} + +func (nRPagingeDRXInformation *NRPagingeDRXInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, nRPagingeDRXInformation.iEExtensions) + w.WriteBit(nRPagingeDRXInformation.extensions.Present()) + w.WriteBit(nRPagingeDRXInformation.NRpagingTimeWindow != nil) + w.WriteBit(len(ext) > 0) + if err := nRPagingeDRXInformation.NRpagingeDRXCycle.MarshalPER(w, enc); err != nil { + return err + } + if nRPagingeDRXInformation.NRpagingTimeWindow != nil { + if err := (*nRPagingeDRXInformation.NRpagingTimeWindow).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRPagingeDRXInformation.extensions.Present() { + if err := nRPagingeDRXInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRPagingeDRXInformation *NRPagingeDRXInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRPagingeDRXInformation = NRPagingeDRXInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NRpagingTimeWindow, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRPagingeDRXInformation.NRpagingeDRXCycle).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NRpagingTimeWindow { + var v NRPagingTimeWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRPagingeDRXInformation.NRpagingTimeWindow = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, &nRPagingeDRXInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRPagingeDRXInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRPagingeDRXInformation []ap.IESpec[ProtocolIEID, NRPagingeDRXInformation] + +func (nRPagingeDRXInformation *NRPagingeDRXInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nRPagingeDRXInformation.NRpagingeDRXCycle.Diagnose(d) { + notComprehended = true + } + if nRPagingeDRXInformation.NRpagingTimeWindow != nil && nRPagingeDRXInformation.NRpagingTimeWindow.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, nRPagingeDRXInformation.iEExtensions) + return notComprehended +} + +func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate.iEExtensions) + w.WriteBit(nRUESidelinkAggregateMaximumBitrate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nRUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRUESidelinkAggregateMaximumBitrate.extensions.Present() { + if err := nRUESidelinkAggregateMaximumBitrate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRUESidelinkAggregateMaximumBitrate = NRUESidelinkAggregateMaximumBitrate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, &nRUESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRUESidelinkAggregateMaximumBitrate.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRUESidelinkAggregateMaximumBitrate []ap.IESpec[ProtocolIEID, NRUESidelinkAggregateMaximumBitrate] + +func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nRUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate.iEExtensions) + return notComprehended +} + +func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, nRV2XServicesAuthorized.iEExtensions) + w.WriteBit(nRV2XServicesAuthorized.extensions.Present()) + w.WriteBit(nRV2XServicesAuthorized.VehicleUE != nil) + w.WriteBit(nRV2XServicesAuthorized.PedestrianUE != nil) + w.WriteBit(len(ext) > 0) + if nRV2XServicesAuthorized.VehicleUE != nil { + if err := (*nRV2XServicesAuthorized.VehicleUE).MarshalPER(w, enc); err != nil { + return err + } + } + if nRV2XServicesAuthorized.PedestrianUE != nil { + if err := (*nRV2XServicesAuthorized.PedestrianUE).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRV2XServicesAuthorized.extensions.Present() { + if err := nRV2XServicesAuthorized.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRV2XServicesAuthorized = NRV2XServicesAuthorized{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_VehicleUE, err := r.ReadBit() + if err != nil { + return err + } + p_PedestrianUE, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_VehicleUE { + var v VehicleUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRV2XServicesAuthorized.VehicleUE = &v + } + if p_PedestrianUE { + var v PedestrianUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRV2XServicesAuthorized.PedestrianUE = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, &nRV2XServicesAuthorized.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRV2XServicesAuthorized.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRV2XServicesAuthorized []ap.IESpec[ProtocolIEID, NRV2XServicesAuthorized] + +func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nRV2XServicesAuthorized.VehicleUE != nil && nRV2XServicesAuthorized.VehicleUE.Diagnose(d) { + notComprehended = true + } + if nRV2XServicesAuthorized.PedestrianUE != nil && nRV2XServicesAuthorized.PedestrianUE.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, nRV2XServicesAuthorized.iEExtensions) + return notComprehended +} + +func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{nTNGeographicalAreaItem.Circle != nil, nTNGeographicalAreaItem.Polygon != nil, nTNGeographicalAreaItem.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case nTNGeographicalAreaItem.Circle != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*nTNGeographicalAreaItem.Circle).MarshalPER(w, enc); err != nil { + return err + } + case nTNGeographicalAreaItem.Polygon != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*nTNGeographicalAreaItem.Polygon).MarshalPER(w, enc); err != nil { + return err + } + case nTNGeographicalAreaItem.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, nTNGeographicalAreaItem.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nTNGeographicalAreaItem = NTNGeographicalAreaItem{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v MDTcircle + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nTNGeographicalAreaItem.Circle = &v + case 1: + var v MDTpolygon + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nTNGeographicalAreaItem.Polygon = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + nTNGeographicalAreaItem.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case nTNGeographicalAreaItem.Circle != nil: + return nTNGeographicalAreaItem.Circle.Diagnose(d) + case nTNGeographicalAreaItem.Polygon != nil: + case nTNGeographicalAreaItem.ChoiceExtension != nil: + d.Unknown(nTNGeographicalAreaItem.ChoiceExtension.ID, nTNGeographicalAreaItem.ChoiceExtension.Criticality) + } + return false +} + +func (networkControlledRepeaterAuthorized NetworkControlledRepeaterAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNetworkControlledRepeaterAuthorized.Encode(w, enc, networkControlledRepeaterAuthorized) +} + +func (networkControlledRepeaterAuthorized *NetworkControlledRepeaterAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNetworkControlledRepeaterAuthorized.Decode(r, enc) + if err != nil { + return err + } + *networkControlledRepeaterAuthorized = v + return nil +} + +func (networkControlledRepeaterAuthorized NetworkControlledRepeaterAuthorized) Name() string { + return enumNetworkControlledRepeaterAuthorized.Name(networkControlledRepeaterAuthorized) +} + +func (networkControlledRepeaterAuthorized NetworkControlledRepeaterAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNetworkControlledRepeaterAuthorized.Known(networkControlledRepeaterAuthorized) +} + +func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT.iEExtensions) + w.WriteBit(networkSliceAreaScopeofMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := networkSliceAreaScopeofMDT.NetworkSliceListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if networkSliceAreaScopeofMDT.extensions.Present() { + if err := networkSliceAreaScopeofMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *networkSliceAreaScopeofMDT = NetworkSliceAreaScopeofMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&networkSliceAreaScopeofMDT.NetworkSliceListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, &networkSliceAreaScopeofMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := networkSliceAreaScopeofMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNetworkSliceAreaScopeofMDT []ap.IESpec[ProtocolIEID, NetworkSliceAreaScopeofMDT] + +func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if networkSliceAreaScopeofMDT.NetworkSliceListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT.iEExtensions) + return notComprehended +} + +func (networkSliceItemforMDT *NetworkSliceItemforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, networkSliceItemforMDT.iEExtensions) + w.WriteBit(networkSliceItemforMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := networkSliceItemforMDT.PlmnID.MarshalPER(w, enc); err != nil { + return err + } + if err := networkSliceItemforMDT.SliceMDTList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if networkSliceItemforMDT.extensions.Present() { + if err := networkSliceItemforMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (networkSliceItemforMDT *NetworkSliceItemforMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *networkSliceItemforMDT = NetworkSliceItemforMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&networkSliceItemforMDT.PlmnID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&networkSliceItemforMDT.SliceMDTList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, &networkSliceItemforMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := networkSliceItemforMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNetworkSliceItemforMDT []ap.IESpec[ProtocolIEID, NetworkSliceItemforMDT] + +func (networkSliceItemforMDT *NetworkSliceItemforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if networkSliceItemforMDT.SliceMDTList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, networkSliceItemforMDT.iEExtensions) + return notComprehended +} + +func (newSecurityContextInd NewSecurityContextInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNewSecurityContextInd.Encode(w, enc, newSecurityContextInd) +} + +func (newSecurityContextInd *NewSecurityContextInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNewSecurityContextInd.Decode(r, enc) + if err != nil { + return err + } + *newSecurityContextInd = v + return nil +} + +func (newSecurityContextInd NewSecurityContextInd) Name() string { + return enumNewSecurityContextInd.Name(newSecurityContextInd) +} + +func (newSecurityContextInd NewSecurityContextInd) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNewSecurityContextInd.Known(newSecurityContextInd) +} + +func (nextPagingAreaScope NextPagingAreaScope) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNextPagingAreaScope.Encode(w, enc, nextPagingAreaScope) +} + +func (nextPagingAreaScope *NextPagingAreaScope) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNextPagingAreaScope.Decode(r, enc) + if err != nil { + return err + } + *nextPagingAreaScope = v + return nil +} + +func (nextPagingAreaScope NextPagingAreaScope) Name() string { + return enumNextPagingAreaScope.Name(nextPagingAreaScope) +} + +func (nextPagingAreaScope NextPagingAreaScope) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNextPagingAreaScope.Known(nextPagingAreaScope) +} + +func (ngENBID *NgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{ngENBID.MacroNgENBID != nil, ngENBID.ShortMacroNgENBID != nil, ngENBID.LongMacroNgENBID != nil, ngENBID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case ngENBID.MacroNgENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { + return err + } + if err := (*ngENBID.MacroNgENBID).MarshalPER(w, enc); err != nil { + return err + } + case ngENBID.ShortMacroNgENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { + return err + } + if err := (*ngENBID.ShortMacroNgENBID).MarshalPER(w, enc); err != nil { + return err + } + case ngENBID.LongMacroNgENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { + return err + } + if err := (*ngENBID.LongMacroNgENBID).MarshalPER(w, enc); err != nil { + return err + } + case ngENBID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ngENBID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (ngENBID *NgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *ngENBID = NgENBID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) + if err != nil { + return err + } + switch idx { + case 0: + var v MacroNgENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + ngENBID.MacroNgENBID = &v + case 1: + var v ShortMacroNgENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + ngENBID.ShortMacroNgENBID = &v + case 2: + var v LongMacroNgENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + ngENBID.LongMacroNgENBID = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + ngENBID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (ngENBID *NgENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case ngENBID.MacroNgENBID != nil: + case ngENBID.ShortMacroNgENBID != nil: + case ngENBID.LongMacroNgENBID != nil: + case ngENBID.ChoiceExtension != nil: + d.Unknown(ngENBID.ChoiceExtension.ID, ngENBID.ChoiceExtension.Criticality) + } + return false +} + +func (noPDUSessionIndication NoPDUSessionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNoPDUSessionIndication.Encode(w, enc, noPDUSessionIndication) +} + +func (noPDUSessionIndication *NoPDUSessionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNoPDUSessionIndication.Decode(r, enc) + if err != nil { + return err + } + *noPDUSessionIndication = v + return nil +} + +func (noPDUSessionIndication NoPDUSessionIndication) Name() string { + return enumNoPDUSessionIndication.Name(noPDUSessionIndication) +} + +func (noPDUSessionIndication NoPDUSessionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNoPDUSessionIndication.Known(noPDUSessionIndication) +} + +func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, nonDynamic5QIDescriptor.iEExtensions) + w.WriteBit(nonDynamic5QIDescriptor.extensions.Present()) + w.WriteBit(nonDynamic5QIDescriptor.PriorityLevelQos != nil) + w.WriteBit(nonDynamic5QIDescriptor.AveragingWindow != nil) + w.WriteBit(nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil) + w.WriteBit(len(ext) > 0) + if err := nonDynamic5QIDescriptor.FiveQI.MarshalPER(w, enc); err != nil { + return err + } + if nonDynamic5QIDescriptor.PriorityLevelQos != nil { + if err := (*nonDynamic5QIDescriptor.PriorityLevelQos).MarshalPER(w, enc); err != nil { + return err + } + } + if nonDynamic5QIDescriptor.AveragingWindow != nil { + if err := (*nonDynamic5QIDescriptor.AveragingWindow).MarshalPER(w, enc); err != nil { + return err + } + } + if nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil { + if err := (*nonDynamic5QIDescriptor.MaximumDataBurstVolume).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nonDynamic5QIDescriptor.extensions.Present() { + if err := nonDynamic5QIDescriptor.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nonDynamic5QIDescriptor = NonDynamic5QIDescriptor{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PriorityLevelQos, err := r.ReadBit() + if err != nil { + return err + } + p_AveragingWindow, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumDataBurstVolume, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nonDynamic5QIDescriptor.FiveQI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_PriorityLevelQos { + var v PriorityLevelQos + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nonDynamic5QIDescriptor.PriorityLevelQos = &v + } + if p_AveragingWindow { + var v AveragingWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nonDynamic5QIDescriptor.AveragingWindow = &v + } + if p_MaximumDataBurstVolume { + var v MaximumDataBurstVolume + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nonDynamic5QIDescriptor.MaximumDataBurstVolume = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, &nonDynamic5QIDescriptor.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nonDynamic5QIDescriptor.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNonDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, NonDynamic5QIDescriptor]{ + { + ID: IDCNPacketDelayBudgetDL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *NonDynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNPacketDelayBudgetDL = &v + return nil + }, + Encode: func(x *NonDynamic5QIDescriptor) (per.Marshaler, bool) { + if x.CNPacketDelayBudgetDL == nil { + return nil, false + } + return x.CNPacketDelayBudgetDL, true + }, + }, + { + ID: IDCNPacketDelayBudgetUL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *NonDynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNPacketDelayBudgetUL = &v + return nil + }, + Encode: func(x *NonDynamic5QIDescriptor) (per.Marshaler, bool) { + if x.CNPacketDelayBudgetUL == nil { + return nil, false + } + return x.CNPacketDelayBudgetUL, true + }, + }, +} + +func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if nonDynamic5QIDescriptor.FiveQI.Diagnose(d) { + notComprehended = true + } + if nonDynamic5QIDescriptor.PriorityLevelQos != nil && nonDynamic5QIDescriptor.PriorityLevelQos.Diagnose(d) { + notComprehended = true + } + if nonDynamic5QIDescriptor.AveragingWindow != nil && nonDynamic5QIDescriptor.AveragingWindow.Diagnose(d) { + notComprehended = true + } + if nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil && nonDynamic5QIDescriptor.MaximumDataBurstVolume.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, nonDynamic5QIDescriptor.iEExtensions) + return notComprehended +} + +func (notificationCause NotificationCause) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNotificationCause.Encode(w, enc, notificationCause) +} + +func (notificationCause *NotificationCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNotificationCause.Decode(r, enc) + if err != nil { + return err + } + *notificationCause = v + return nil +} + +func (notificationCause NotificationCause) Name() string { + return enumNotificationCause.Name(notificationCause) +} + +func (notificationCause NotificationCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNotificationCause.Known(notificationCause) +} + +func (notificationCellItem *NotificationCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNotificationCellItem, notificationCellItem, notificationCellItem.iEExtensions) + w.WriteBit(notificationCellItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := notificationCellItem.NGRANCGI.MarshalPER(w, enc); err != nil { + return err + } + if err := notificationCellItem.NotifyFlag.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if notificationCellItem.extensions.Present() { + if err := notificationCellItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (notificationCellItem *NotificationCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *notificationCellItem = NotificationCellItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (¬ificationCellItem.NGRANCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (¬ificationCellItem.NotifyFlag).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNotificationCellItem, notificationCellItem, ¬ificationCellItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := notificationCellItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNotificationCellItem []ap.IESpec[ProtocolIEID, NotificationCellItem] + +func (notificationCellItem *NotificationCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if notificationCellItem.NGRANCGI.Diagnose(d) { + notComprehended = true + } + if notificationCellItem.NotifyFlag.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNotificationCellItem, notificationCellItem, notificationCellItem.iEExtensions) + return notComprehended +} + +func (notificationCellItemNotifyFlag NotificationCellItemNotifyFlag) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNotificationCellItemNotifyFlag.Encode(w, enc, notificationCellItemNotifyFlag) +} + +func (notificationCellItemNotifyFlag *NotificationCellItemNotifyFlag) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNotificationCellItemNotifyFlag.Decode(r, enc) + if err != nil { + return err + } + *notificationCellItemNotifyFlag = v + return nil +} + +func (notificationCellItemNotifyFlag NotificationCellItemNotifyFlag) Name() string { + return enumNotificationCellItemNotifyFlag.Name(notificationCellItemNotifyFlag) +} + +func (notificationCellItemNotifyFlag NotificationCellItemNotifyFlag) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNotificationCellItemNotifyFlag.Known(notificationCellItemNotifyFlag) +} + +func (notificationControl NotificationControl) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNotificationControl.Encode(w, enc, notificationControl) +} + +func (notificationControl *NotificationControl) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNotificationControl.Decode(r, enc) + if err != nil { + return err + } + *notificationControl = v + return nil +} + +func (notificationControl NotificationControl) Name() string { + return enumNotificationControl.Name(notificationControl) +} + +func (notificationControl NotificationControl) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNotificationControl.Known(notificationControl) +} + +func (notifySourceNGRANNode NotifySourceNGRANNode) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNotifySourceNGRANNode.Encode(w, enc, notifySourceNGRANNode) +} + +func (notifySourceNGRANNode *NotifySourceNGRANNode) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNotifySourceNGRANNode.Decode(r, enc) + if err != nil { + return err + } + *notifySourceNGRANNode = v + return nil +} + +func (notifySourceNGRANNode NotifySourceNGRANNode) Name() string { + return enumNotifySourceNGRANNode.Name(notifySourceNGRANNode) +} + +func (notifySourceNGRANNode NotifySourceNGRANNode) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNotifySourceNGRANNode.Known(notifySourceNGRANNode) +} + +func (numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNumberOfMeasurementReportingLevels.Encode(w, enc, numberOfMeasurementReportingLevels) +} + +func (numberOfMeasurementReportingLevels *NumberOfMeasurementReportingLevels) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNumberOfMeasurementReportingLevels.Decode(r, enc) + if err != nil { + return err + } + *numberOfMeasurementReportingLevels = v + return nil +} + +func (numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels) Name() string { + return enumNumberOfMeasurementReportingLevels.Name(numberOfMeasurementReportingLevels) +} + +func (numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNumberOfMeasurementReportingLevels.Known(numberOfMeasurementReportingLevels) +} + +func (onboardingSupport OnboardingSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumOnboardingSupport.Encode(w, enc, onboardingSupport) +} + +func (onboardingSupport *OnboardingSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumOnboardingSupport.Decode(r, enc) + if err != nil { + return err + } + *onboardingSupport = v + return nil +} + +func (onboardingSupport OnboardingSupport) Name() string { + return enumOnboardingSupport.Name(onboardingSupport) +} + +func (onboardingSupport OnboardingSupport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumOnboardingSupport.Known(onboardingSupport) +} + +func (overloadAction OverloadAction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumOverloadAction.Encode(w, enc, overloadAction) +} + +func (overloadAction *OverloadAction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumOverloadAction.Decode(r, enc) + if err != nil { + return err + } + *overloadAction = v + return nil +} + +func (overloadAction OverloadAction) Name() string { + return enumOverloadAction.Name(overloadAction) +} + +func (overloadAction OverloadAction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumOverloadAction.Known(overloadAction) +} + +func (overloadResponse *OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{overloadResponse.OverloadAction != nil, overloadResponse.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case overloadResponse.OverloadAction != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*overloadResponse.OverloadAction).MarshalPER(w, enc); err != nil { + return err + } + case overloadResponse.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, overloadResponse.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (overloadResponse *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *overloadResponse = OverloadResponse{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v OverloadAction + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + overloadResponse.OverloadAction = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + overloadResponse.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (overloadResponse *OverloadResponse) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case overloadResponse.OverloadAction != nil: + return overloadResponse.OverloadAction.Diagnose(d) + case overloadResponse.ChoiceExtension != nil: + d.Unknown(overloadResponse.ChoiceExtension.ID, overloadResponse.ChoiceExtension.Criticality) + } + return false +} + +func (overloadStartNSSAIItem *OverloadStartNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, overloadStartNSSAIItem.iEExtensions) + w.WriteBit(overloadStartNSSAIItem.extensions.Present()) + w.WriteBit(overloadStartNSSAIItem.SliceOverloadResponse != nil) + w.WriteBit(overloadStartNSSAIItem.SliceTrafficLoadReductionIndication != nil) + w.WriteBit(len(ext) > 0) + off0 := 0 + if err := per.EncodeLength(w, enc, 1, 1024, true, int64(len(overloadStartNSSAIItem.SliceOverloadList)), func(count int64) error { + end := off0 + int(count) + for i := off0; i < end; i++ { + if err := overloadStartNSSAIItem.SliceOverloadList[i].MarshalPER(w, enc); err != nil { + return err + } + } + off0 = end + return nil + }); err != nil { + return err + } + if overloadStartNSSAIItem.SliceOverloadResponse != nil { + if err := (*overloadStartNSSAIItem.SliceOverloadResponse).MarshalPER(w, enc); err != nil { + return err + } + } + if overloadStartNSSAIItem.SliceTrafficLoadReductionIndication != nil { + if err := (*overloadStartNSSAIItem.SliceTrafficLoadReductionIndication).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if overloadStartNSSAIItem.extensions.Present() { + if err := overloadStartNSSAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (overloadStartNSSAIItem *OverloadStartNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *overloadStartNSSAIItem = OverloadStartNSSAIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SliceOverloadResponse, err := r.ReadBit() + if err != nil { + return err + } + p_SliceTrafficLoadReductionIndication, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + overloadStartNSSAIItem.SliceOverloadList = nil + if err := per.DecodeLength(r, enc, 1, 1024, true, func(count int64) error { + start := len(overloadStartNSSAIItem.SliceOverloadList) + overloadStartNSSAIItem.SliceOverloadList = append(overloadStartNSSAIItem.SliceOverloadList, make([]SliceOverloadItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&overloadStartNSSAIItem.SliceOverloadList[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_SliceOverloadResponse { + var v OverloadResponse + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + overloadStartNSSAIItem.SliceOverloadResponse = &v + } + if p_SliceTrafficLoadReductionIndication { + var v TrafficLoadReductionIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + overloadStartNSSAIItem.SliceTrafficLoadReductionIndication = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, &overloadStartNSSAIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := overloadStartNSSAIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsOverloadStartNSSAIItem []ap.IESpec[ProtocolIEID, OverloadStartNSSAIItem] + +func (overloadStartNSSAIItem *OverloadStartNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range overloadStartNSSAIItem.SliceOverloadList { + if overloadStartNSSAIItem.SliceOverloadList[i].Diagnose(d) { + notComprehended = true + } + } + if overloadStartNSSAIItem.SliceOverloadResponse != nil && overloadStartNSSAIItem.SliceOverloadResponse.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, overloadStartNSSAIItem.iEExtensions) + return notComprehended +} + +func (pC5FlowBitRates *PC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPC5FlowBitRates, pC5FlowBitRates, pC5FlowBitRates.iEExtensions) + w.WriteBit(pC5FlowBitRates.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pC5FlowBitRates.GuaranteedFlowBitRate.MarshalPER(w, enc); err != nil { + return err + } + if err := pC5FlowBitRates.MaximumFlowBitRate.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pC5FlowBitRates.extensions.Present() { + if err := pC5FlowBitRates.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pC5FlowBitRates *PC5FlowBitRates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pC5FlowBitRates = PC5FlowBitRates{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pC5FlowBitRates.GuaranteedFlowBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pC5FlowBitRates.MaximumFlowBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPC5FlowBitRates, pC5FlowBitRates, &pC5FlowBitRates.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pC5FlowBitRates.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPC5FlowBitRates []ap.IESpec[ProtocolIEID, PC5FlowBitRates] + +func (pC5FlowBitRates *PC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pC5FlowBitRates.GuaranteedFlowBitRate.Diagnose(d) { + notComprehended = true + } + if pC5FlowBitRates.MaximumFlowBitRate.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPC5FlowBitRates, pC5FlowBitRates, pC5FlowBitRates.iEExtensions) + return notComprehended +} + +func (pC5QoSFlowItem *PC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPC5QoSFlowItem, pC5QoSFlowItem, pC5QoSFlowItem.iEExtensions) + w.WriteBit(pC5QoSFlowItem.extensions.Present()) + w.WriteBit(pC5QoSFlowItem.Pc5FlowBitRates != nil) + w.WriteBit(pC5QoSFlowItem.Range != nil) + w.WriteBit(len(ext) > 0) + if err := pC5QoSFlowItem.PQI.MarshalPER(w, enc); err != nil { + return err + } + if pC5QoSFlowItem.Pc5FlowBitRates != nil { + if err := (*pC5QoSFlowItem.Pc5FlowBitRates).MarshalPER(w, enc); err != nil { + return err + } + } + if pC5QoSFlowItem.Range != nil { + if err := (*pC5QoSFlowItem.Range).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pC5QoSFlowItem.extensions.Present() { + if err := pC5QoSFlowItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pC5QoSFlowItem *PC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pC5QoSFlowItem = PC5QoSFlowItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_Pc5FlowBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_Range, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pC5QoSFlowItem.PQI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_Pc5FlowBitRates { + var v PC5FlowBitRates + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pC5QoSFlowItem.Pc5FlowBitRates = &v + } + if p_Range { + var v RangeType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pC5QoSFlowItem.Range = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSFlowItem, pC5QoSFlowItem, &pC5QoSFlowItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pC5QoSFlowItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPC5QoSFlowItem []ap.IESpec[ProtocolIEID, PC5QoSFlowItem] + +func (pC5QoSFlowItem *PC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pC5QoSFlowItem.PQI.Diagnose(d) { + notComprehended = true + } + if pC5QoSFlowItem.Pc5FlowBitRates != nil && pC5QoSFlowItem.Pc5FlowBitRates.Diagnose(d) { + notComprehended = true + } + if pC5QoSFlowItem.Range != nil && pC5QoSFlowItem.Range.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPC5QoSFlowItem, pC5QoSFlowItem, pC5QoSFlowItem.iEExtensions) + return notComprehended +} + +func (pC5QoSParameters *PC5QoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPC5QoSParameters, pC5QoSParameters, pC5QoSParameters.iEExtensions) + w.WriteBit(pC5QoSParameters.extensions.Present()) + w.WriteBit(pC5QoSParameters.Pc5LinkAggregateBitRates != nil) + w.WriteBit(len(ext) > 0) + if err := pC5QoSParameters.Pc5QoSFlowList.MarshalPER(w, enc); err != nil { + return err + } + if pC5QoSParameters.Pc5LinkAggregateBitRates != nil { + if err := (*pC5QoSParameters.Pc5LinkAggregateBitRates).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pC5QoSParameters.extensions.Present() { + if err := pC5QoSParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pC5QoSParameters *PC5QoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pC5QoSParameters = PC5QoSParameters{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_Pc5LinkAggregateBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pC5QoSParameters.Pc5QoSFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_Pc5LinkAggregateBitRates { + var v BitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pC5QoSParameters.Pc5LinkAggregateBitRates = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSParameters, pC5QoSParameters, &pC5QoSParameters.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pC5QoSParameters.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPC5QoSParameters []ap.IESpec[ProtocolIEID, PC5QoSParameters] + +func (pC5QoSParameters *PC5QoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pC5QoSParameters.Pc5QoSFlowList.Diagnose(d) { + notComprehended = true + } + if pC5QoSParameters.Pc5LinkAggregateBitRates != nil && pC5QoSParameters.Pc5LinkAggregateBitRates.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPC5QoSParameters, pC5QoSParameters, pC5QoSParameters.iEExtensions) + return notComprehended +} + +func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate.iEExtensions) + w.WriteBit(pDUSessionAggregateMaximumBitRate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionAggregateMaximumBitRate.extensions.Present() { + if err := pDUSessionAggregateMaximumBitRate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionAggregateMaximumBitRate = PDUSessionAggregateMaximumBitRate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, &pDUSessionAggregateMaximumBitRate.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionAggregateMaximumBitRate.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionAggregateMaximumBitRate []ap.IESpec[ProtocolIEID, PDUSessionAggregateMaximumBitRate] + +func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionAggregateMaximumBitRate.DL.Diagnose(d) { + notComprehended = true + } + if pDUSessionAggregateMaximumBitRate.UL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem.iEExtensions) + w.WriteBit(pDUSessionResourceAdmittedItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceAdmittedItem.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceAdmittedItem.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceAdmittedItem.extensions.Present() { + if err := pDUSessionResourceAdmittedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceAdmittedItem = PDUSessionResourceAdmittedItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceAdmittedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceAdmittedItem.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, &pDUSessionResourceAdmittedItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceAdmittedItem []ap.IESpec[ProtocolIEID, PDUSessionResourceAdmittedItem] + +func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm.iEExtensions) + w.WriteBit(pDUSessionResourceFailedToModifyItemModCfm.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceFailedToModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceFailedToModifyItemModCfm.extensions.Present() { + if err := pDUSessionResourceFailedToModifyItemModCfm.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceFailedToModifyItemModCfm = PDUSessionResourceFailedToModifyItemModCfm{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceFailedToModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, &pDUSessionResourceFailedToModifyItemModCfm.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceFailedToModifyItemModCfm.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceFailedToModifyItemModCfm []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToModifyItemModCfm] + +func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes.iEExtensions) + w.WriteBit(pDUSessionResourceFailedToModifyItemModRes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceFailedToModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceFailedToModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceFailedToModifyItemModRes.extensions.Present() { + if err := pDUSessionResourceFailedToModifyItemModRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceFailedToModifyItemModRes = PDUSessionResourceFailedToModifyItemModRes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceFailedToModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceFailedToModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, &pDUSessionResourceFailedToModifyItemModRes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceFailedToModifyItemModRes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceFailedToModifyItemModRes []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToModifyItemModRes] + +func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions) + w.WriteBit(pDUSessionResourceFailedToSetupItemCxtFail.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceFailedToSetupItemCxtFail.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceFailedToSetupItemCxtFail.extensions.Present() { + if err := pDUSessionResourceFailedToSetupItemCxtFail.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceFailedToSetupItemCxtFail = PDUSessionResourceFailedToSetupItemCxtFail{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemCxtFail.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, &pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceFailedToSetupItemCxtFail.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceFailedToSetupItemCxtFail []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemCxtFail] + +func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions) + w.WriteBit(pDUSessionResourceFailedToSetupItemCxtRes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceFailedToSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceFailedToSetupItemCxtRes.extensions.Present() { + if err := pDUSessionResourceFailedToSetupItemCxtRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceFailedToSetupItemCxtRes = PDUSessionResourceFailedToSetupItemCxtRes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, &pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceFailedToSetupItemCxtRes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceFailedToSetupItemCxtRes []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemCxtRes] + +func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck.iEExtensions) + w.WriteBit(pDUSessionResourceFailedToSetupItemHOAck.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceFailedToSetupItemHOAck.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceFailedToSetupItemHOAck.extensions.Present() { + if err := pDUSessionResourceFailedToSetupItemHOAck.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceFailedToSetupItemHOAck = PDUSessionResourceFailedToSetupItemHOAck{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemHOAck.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, &pDUSessionResourceFailedToSetupItemHOAck.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceFailedToSetupItemHOAck.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceFailedToSetupItemHOAck []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemHOAck] + +func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq.iEExtensions) + w.WriteBit(pDUSessionResourceFailedToSetupItemPSReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceFailedToSetupItemPSReq.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceFailedToSetupItemPSReq.extensions.Present() { + if err := pDUSessionResourceFailedToSetupItemPSReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceFailedToSetupItemPSReq = PDUSessionResourceFailedToSetupItemPSReq{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemPSReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, &pDUSessionResourceFailedToSetupItemPSReq.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceFailedToSetupItemPSReq.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceFailedToSetupItemPSReq []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemPSReq] + +func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes.iEExtensions) + w.WriteBit(pDUSessionResourceFailedToSetupItemSURes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceFailedToSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceFailedToSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceFailedToSetupItemSURes.extensions.Present() { + if err := pDUSessionResourceFailedToSetupItemSURes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceFailedToSetupItemSURes = PDUSessionResourceFailedToSetupItemSURes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceFailedToSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, &pDUSessionResourceFailedToSetupItemSURes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceFailedToSetupItemSURes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceFailedToSetupItemSURes []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemSURes] + +func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem.iEExtensions) + w.WriteBit(pDUSessionResourceHandoverItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceHandoverItem.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceHandoverItem.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceHandoverItem.extensions.Present() { + if err := pDUSessionResourceHandoverItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceHandoverItem = PDUSessionResourceHandoverItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceHandoverItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceHandoverItem.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, &pDUSessionResourceHandoverItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceHandoverItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceHandoverItem []ap.IESpec[ProtocolIEID, PDUSessionResourceHandoverItem] + +func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, pDUSessionResourceInformationItem.iEExtensions) + w.WriteBit(pDUSessionResourceInformationItem.extensions.Present()) + w.WriteBit(pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceInformationItem.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceInformationItem.QosFlowInformationList.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList != nil { + if err := pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceInformationItem.extensions.Present() { + if err := pDUSessionResourceInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceInformationItem = PDUSessionResourceInformationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DRBsToQosFlowsMappingList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceInformationItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceInformationItem.QosFlowInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DRBsToQosFlowsMappingList { + if err := (&pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, &pDUSessionResourceInformationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceInformationItem []ap.IESpec[ProtocolIEID, PDUSessionResourceInformationItem] + +func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceInformationItem.QosFlowInformationList.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, pDUSessionResourceInformationItem.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl.iEExtensions) + w.WriteBit(pDUSessionResourceItemCxtRelCpl.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceItemCxtRelCpl.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceItemCxtRelCpl.extensions.Present() { + if err := pDUSessionResourceItemCxtRelCpl.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceItemCxtRelCpl = PDUSessionResourceItemCxtRelCpl{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceItemCxtRelCpl.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, &pDUSessionResourceItemCxtRelCpl.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceItemCxtRelCpl.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceItemCxtRelCpl = []ap.IESpec[ProtocolIEID, PDUSessionResourceItemCxtRelCpl]{ + { + ID: IDPDUSessionResourceReleaseResponseTransfer, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceItemCxtRelCpl, r *per.Reader, enc per.Encoding) error { + var v TransferContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PDUSessionResourceReleaseResponseTransfer = &v + return nil + }, + Encode: func(x *PDUSessionResourceItemCxtRelCpl) (per.Marshaler, bool) { + if x.PDUSessionResourceReleaseResponseTransfer == nil { + return nil, false + } + return x.PDUSessionResourceReleaseResponseTransfer, true + }, + }, +} + +func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq.iEExtensions) + w.WriteBit(pDUSessionResourceItemCxtRelReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceItemCxtRelReq.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceItemCxtRelReq.extensions.Present() { + if err := pDUSessionResourceItemCxtRelReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceItemCxtRelReq = PDUSessionResourceItemCxtRelReq{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceItemCxtRelReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, &pDUSessionResourceItemCxtRelReq.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceItemCxtRelReq.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceItemCxtRelReq []ap.IESpec[ProtocolIEID, PDUSessionResourceItemCxtRelReq] + +func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd.iEExtensions) + w.WriteBit(pDUSessionResourceItemHORqd.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceItemHORqd.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceItemHORqd.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceItemHORqd.extensions.Present() { + if err := pDUSessionResourceItemHORqd.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceItemHORqd = PDUSessionResourceItemHORqd{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceItemHORqd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceItemHORqd.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, &pDUSessionResourceItemHORqd.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceItemHORqd.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceItemHORqd []ap.IESpec[ProtocolIEID, PDUSessionResourceItemHORqd] + +func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyConfirmTransfer.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil { + if err := pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil { + if err := pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyConfirmTransfer.extensions.Present() { + if err := pDUSessionResourceModifyConfirmTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyConfirmTransfer = PDUSessionResourceModifyConfirmTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AdditionalNGUUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowFailedToModify, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AdditionalNGUUPTNLInformation { + if err := (&pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_QosFlowFailedToModify { + if err := (&pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyConfirmTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyConfirmTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyConfirmTransfer]{ + { + ID: IDRedundantULNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyConfirmTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantULNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyConfirmTransfer) (per.Marshaler, bool) { + if x.RedundantULNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantULNGUUPTNLInformation, true + }, + }, + { + ID: IDAdditionalRedundantNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyConfirmTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformationPairList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRedundantNGUUPTNLInformation = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyConfirmTransfer) (per.Marshaler, bool) { + if len(x.AdditionalRedundantNGUUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalRedundantNGUUPTNLInformation, true + }, + }, +} + +func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyIndicationTransfer.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil { + if err := pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyIndicationTransfer.extensions.Present() { + if err := pDUSessionResourceModifyIndicationTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyIndicationTransfer = PDUSessionResourceModifyIndicationTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AdditionalDLQosFlowPerTNLInformation { + if err := (&pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyIndicationTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyIndicationTransfer]{ + { + ID: IDSecondaryRATUsageInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { + var v SecondaryRATUsageInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecondaryRATUsageInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyIndicationTransfer) (per.Marshaler, bool) { + if x.SecondaryRATUsageInformation == nil { + return nil, false + } + return x.SecondaryRATUsageInformation, true + }, + }, + { + ID: IDSecurityResult, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { + var v SecurityResult + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityResult = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyIndicationTransfer) (per.Marshaler, bool) { + if x.SecurityResult == nil { + return nil, false + } + return x.SecurityResult, true + }, + }, + { + ID: IDRedundantDLQosFlowPerTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantDLQosFlowPerTNLInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyIndicationTransfer) (per.Marshaler, bool) { + if x.RedundantDLQosFlowPerTNLInformation == nil { + return nil, false + } + return x.RedundantDLQosFlowPerTNLInformation, true + }, + }, + { + ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRedundantDLQosFlowPerTNLInformation = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyIndicationTransfer) (per.Marshaler, bool) { + if len(x.AdditionalRedundantDLQosFlowPerTNLInformation) == 0 { + return nil, false + } + return x.AdditionalRedundantDLQosFlowPerTNLInformation, true + }, + }, + { + ID: IDGlobalRANNodeID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { + var v GlobalRANNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.GlobalRANNodeID = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyIndicationTransfer) (per.Marshaler, bool) { + if x.GlobalRANNodeID == nil { + return nil, false + } + return x.GlobalRANNodeID, true + }, + }, + { + ID: IDECNMarkingorCongestionInformationReportingStatus, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { + var v ECNMarkingorCongestionInformationReportingStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ECNMarkingorCongestionInformationReportingStatus = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyIndicationTransfer) (per.Marshaler, bool) { + if len(x.ECNMarkingorCongestionInformationReportingStatus) == 0 { + return nil, false + } + return x.ECNMarkingorCongestionInformationReportingStatus, true + }, + }, +} + +func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyIndicationUnsuccessfulTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyIndicationUnsuccessfulTransfer.extensions.Present() { + if err := pDUSessionResourceModifyIndicationUnsuccessfulTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyIndicationUnsuccessfulTransfer = PDUSessionResourceModifyIndicationUnsuccessfulTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, &pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyIndicationUnsuccessfulTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyIndicationUnsuccessfulTransfer] + +func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm.iEExtensions) + w.WriteBit(pDUSessionResourceModifyItemModCfm.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceModifyItemModCfm.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModCfm.extensions.Present() { + if err := pDUSessionResourceModifyItemModCfm.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyItemModCfm = PDUSessionResourceModifyItemModCfm{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyItemModCfm.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceModifyItemModCfm.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, &pDUSessionResourceModifyItemModCfm.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyItemModCfm.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyItemModCfm []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModCfm] + +func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd.iEExtensions) + w.WriteBit(pDUSessionResourceModifyItemModInd.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyItemModInd.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceModifyItemModInd.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModInd.extensions.Present() { + if err := pDUSessionResourceModifyItemModInd.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyItemModInd = PDUSessionResourceModifyItemModInd{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyItemModInd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceModifyItemModInd.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, &pDUSessionResourceModifyItemModInd.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyItemModInd.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyItemModInd []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModInd] + +func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq.iEExtensions) + w.WriteBit(pDUSessionResourceModifyItemModReq.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyItemModReq.NASPDU != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyItemModReq.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceModifyItemModReq.NASPDU != nil { + if err := (*pDUSessionResourceModifyItemModReq.NASPDU).MarshalPER(w, enc); err != nil { + return err + } + } + if err := pDUSessionResourceModifyItemModReq.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModReq.extensions.Present() { + if err := pDUSessionResourceModifyItemModReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyItemModReq = PDUSessionResourceModifyItemModReq{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NASPDU, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyItemModReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NASPDU { + var v NASPDU + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceModifyItemModReq.NASPDU = &v + } + if err := (&pDUSessionResourceModifyItemModReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyItemModReq.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyItemModReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModReq]{ + { + ID: IDSNSSAI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *PDUSessionResourceModifyItemModReq, r *per.Reader, enc per.Encoding) error { + var v SNSSAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SNSSAI = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyItemModReq) (per.Marshaler, bool) { + if x.SNSSAI == nil { + return nil, false + } + return x.SNSSAI, true + }, + }, + { + ID: IDPduSessionExpectedUEActivityBehaviour, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyItemModReq, r *per.Reader, enc per.Encoding) error { + var v ExpectedUEActivityBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSessionExpectedUEActivityBehaviour = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyItemModReq) (per.Marshaler, bool) { + if x.PduSessionExpectedUEActivityBehaviour == nil { + return nil, false + } + return x.PduSessionExpectedUEActivityBehaviour, true + }, + }, +} + +func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes.iEExtensions) + w.WriteBit(pDUSessionResourceModifyItemModRes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceModifyItemModRes.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyItemModRes.extensions.Present() { + if err := pDUSessionResourceModifyItemModRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyItemModRes = PDUSessionResourceModifyItemModRes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyItemModRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceModifyItemModRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, &pDUSessionResourceModifyItemModRes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyItemModRes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyItemModRes []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModRes] + +func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) + w.WriteBit(pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil) + w.WriteBit(len(ext) > 0) + if pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil { + if err := (*pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil { + if err := (*pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse != nil { + if err := pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { + if err := pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify != nil { + if err := pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyResponseTransfer.extensions.Present() { + if err := pDUSessionResourceModifyResponseTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyResponseTransfer = PDUSessionResourceModifyResponseTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLNGUUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_ULNGUUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowAddOrModifyResponse, err := r.ReadBit() + if err != nil { + return err + } + p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowFailedToAddOrModify, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_DLNGUUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation = &v + } + if p_ULNGUUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation = &v + } + if p_QosFlowAddOrModifyResponse { + if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_AdditionalDLQosFlowPerTNLInformation { + if err := (&pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_QosFlowFailedToAddOrModify { + if err := (&pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyResponseTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyResponseTransfer]{ + { + ID: IDAdditionalNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformationPairList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalNGUUPTNLInformation = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if len(x.AdditionalNGUUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalNGUUPTNLInformation, true + }, + }, + { + ID: IDRedundantDLNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantDLNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if x.RedundantDLNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantDLNGUUPTNLInformation, true + }, + }, + { + ID: IDRedundantULNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantULNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if x.RedundantULNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantULNGUUPTNLInformation, true + }, + }, + { + ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRedundantDLQosFlowPerTNLInformation = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if len(x.AdditionalRedundantDLQosFlowPerTNLInformation) == 0 { + return nil, false + } + return x.AdditionalRedundantDLQosFlowPerTNLInformation, true + }, + }, + { + ID: IDAdditionalRedundantNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformationPairList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRedundantNGUUPTNLInformation = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if len(x.AdditionalRedundantNGUUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalRedundantNGUUPTNLInformation, true + }, + }, + { + ID: IDSecondaryRATUsageInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v SecondaryRATUsageInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecondaryRATUsageInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if x.SecondaryRATUsageInformation == nil { + return nil, false + } + return x.SecondaryRATUsageInformation, true + }, + }, + { + ID: IDMBSSupportIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSupportIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSupportIndicator = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if x.MBSSupportIndicator == nil { + return nil, false + } + return x.MBSSupportIndicator, true + }, + }, + { + ID: IDMBSSessionSetuporModifyResponseList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSessionSetupResponseList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSessionSetuporModifyResponseList = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if len(x.MBSSessionSetuporModifyResponseList) == 0 { + return nil, false + } + return x.MBSSessionSetuporModifyResponseList, true + }, + }, + { + ID: IDMBSSessionFailedtoSetuporModifyList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSessionFailedtoSetupList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSessionFailedtoSetuporModifyList = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if len(x.MBSSessionFailedtoSetuporModifyList) == 0 { + return nil, false + } + return x.MBSSessionFailedtoSetuporModifyList, true + }, + }, + { + ID: IDECNMarkingorCongestionInformationReportingStatus, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v ECNMarkingorCongestionInformationReportingStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ECNMarkingorCongestionInformationReportingStatus = v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if len(x.ECNMarkingorCongestionInformationReportingStatus) == 0 { + return nil, false + } + return x.ECNMarkingorCongestionInformationReportingStatus, true + }, + }, + { + ID: IDPDUSetbasedHandlingIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v PDUSetbasedHandlingIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PDUSetbasedHandlingIndicator = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if x.PDUSetbasedHandlingIndicator == nil { + return nil, false + } + return x.PDUSetbasedHandlingIndicator, true + }, + }, + { + ID: IDUserPlaneFailureIndicationReport, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v UserPlaneFailureIndicationReport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UserPlaneFailureIndicationReport = &v + return nil + }, + Encode: func(x *PDUSessionResourceModifyResponseTransfer) (per.Marshaler, bool) { + if x.UserPlaneFailureIndicationReport == nil { + return nil, false + } + return x.UserPlaneFailureIndicationReport, true + }, + }, +} + +func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil && pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil && pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceModifyUnsuccessfulTransfer.extensions.Present()) + w.WriteBit(pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceModifyUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil { + if err := (*pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceModifyUnsuccessfulTransfer.extensions.Present() { + if err := pDUSessionResourceModifyUnsuccessfulTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceModifyUnsuccessfulTransfer = PDUSessionResourceModifyUnsuccessfulTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_CriticalityDiagnostics, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceModifyUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_CriticalityDiagnostics { + var v CriticalityDiagnostics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, &pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceModifyUnsuccessfulTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceModifyUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyUnsuccessfulTransfer] + +func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceModifyUnsuccessfulTransfer.Cause.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil && pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem.iEExtensions) + w.WriteBit(pDUSessionResourceNotifyItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceNotifyItem.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceNotifyItem.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceNotifyItem.extensions.Present() { + if err := pDUSessionResourceNotifyItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceNotifyItem = PDUSessionResourceNotifyItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceNotifyItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceNotifyItem.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, &pDUSessionResourceNotifyItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceNotifyItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceNotifyItem []ap.IESpec[ProtocolIEID, PDUSessionResourceNotifyItem] + +func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceNotifyTransfer.extensions.Present()) + w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowNotify != nil) + w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowReleased != nil) + w.WriteBit(len(ext) > 0) + if pDUSessionResourceNotifyTransfer.QosFlowNotify != nil { + if err := pDUSessionResourceNotifyTransfer.QosFlowNotify.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceNotifyTransfer.QosFlowReleased != nil { + if err := pDUSessionResourceNotifyTransfer.QosFlowReleased.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceNotifyTransfer.extensions.Present() { + if err := pDUSessionResourceNotifyTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceNotifyTransfer = PDUSessionResourceNotifyTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowNotify, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowReleased, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_QosFlowNotify { + if err := (&pDUSessionResourceNotifyTransfer.QosFlowNotify).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_QosFlowReleased { + if err := (&pDUSessionResourceNotifyTransfer.QosFlowReleased).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, &pDUSessionResourceNotifyTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceNotifyTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceNotifyTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceNotifyTransfer]{ + { + ID: IDSecondaryRATUsageInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceNotifyTransfer, r *per.Reader, enc per.Encoding) error { + var v SecondaryRATUsageInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecondaryRATUsageInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceNotifyTransfer) (per.Marshaler, bool) { + if x.SecondaryRATUsageInformation == nil { + return nil, false + } + return x.SecondaryRATUsageInformation, true + }, + }, + { + ID: IDQosFlowFeedbackList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceNotifyTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowFeedbackList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QosFlowFeedbackList = v + return nil + }, + Encode: func(x *PDUSessionResourceNotifyTransfer) (per.Marshaler, bool) { + if len(x.QosFlowFeedbackList) == 0 { + return nil, false + } + return x.QosFlowFeedbackList, true + }, + }, +} + +func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceNotifyTransfer.QosFlowNotify.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceNotifyTransfer.QosFlowReleased.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceReleaseCommandTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceReleaseCommandTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceReleaseCommandTransfer.extensions.Present() { + if err := pDUSessionResourceReleaseCommandTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceReleaseCommandTransfer = PDUSessionResourceReleaseCommandTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceReleaseCommandTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, &pDUSessionResourceReleaseCommandTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceReleaseCommandTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceReleaseCommandTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceReleaseCommandTransfer]{ + { + ID: IDQosFlowAdditionalInfoList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceReleaseCommandTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowAdditionalInfoListRelCom + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QosFlowAdditionalInfoList = v + return nil + }, + Encode: func(x *PDUSessionResourceReleaseCommandTransfer) (per.Marshaler, bool) { + if len(x.QosFlowAdditionalInfoList) == 0 { + return nil, false + } + return x.QosFlowAdditionalInfoList, true + }, + }, +} + +func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceReleaseCommandTransfer.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceReleaseResponseTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceReleaseResponseTransfer.extensions.Present() { + if err := pDUSessionResourceReleaseResponseTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceReleaseResponseTransfer = PDUSessionResourceReleaseResponseTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, &pDUSessionResourceReleaseResponseTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceReleaseResponseTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceReleaseResponseTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceReleaseResponseTransfer]{ + { + ID: IDSecondaryRATUsageInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceReleaseResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v SecondaryRATUsageInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecondaryRATUsageInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceReleaseResponseTransfer) (per.Marshaler, bool) { + if x.SecondaryRATUsageInformation == nil { + return nil, false + } + return x.SecondaryRATUsageInformation, true + }, + }, + { + ID: IDQosFlowAdditionalInfoList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceReleaseResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowAdditionalInfoListRelRes + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QosFlowAdditionalInfoList = v + return nil + }, + Encode: func(x *PDUSessionResourceReleaseResponseTransfer) (per.Marshaler, bool) { + if len(x.QosFlowAdditionalInfoList) == 0 { + return nil, false + } + return x.QosFlowAdditionalInfoList, true + }, + }, +} + +func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot.iEExtensions) + w.WriteBit(pDUSessionResourceReleasedItemNot.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceReleasedItemNot.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceReleasedItemNot.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceReleasedItemNot.extensions.Present() { + if err := pDUSessionResourceReleasedItemNot.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceReleasedItemNot = PDUSessionResourceReleasedItemNot{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemNot.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemNot.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, &pDUSessionResourceReleasedItemNot.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceReleasedItemNot.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceReleasedItemNot []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemNot] + +func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck.iEExtensions) + w.WriteBit(pDUSessionResourceReleasedItemPSAck.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceReleasedItemPSAck.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceReleasedItemPSAck.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceReleasedItemPSAck.extensions.Present() { + if err := pDUSessionResourceReleasedItemPSAck.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceReleasedItemPSAck = PDUSessionResourceReleasedItemPSAck{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemPSAck.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemPSAck.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, &pDUSessionResourceReleasedItemPSAck.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceReleasedItemPSAck.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceReleasedItemPSAck []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemPSAck] + +func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail.iEExtensions) + w.WriteBit(pDUSessionResourceReleasedItemPSFail.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceReleasedItemPSFail.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceReleasedItemPSFail.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceReleasedItemPSFail.extensions.Present() { + if err := pDUSessionResourceReleasedItemPSFail.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceReleasedItemPSFail = PDUSessionResourceReleasedItemPSFail{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemPSFail.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemPSFail.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, &pDUSessionResourceReleasedItemPSFail.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceReleasedItemPSFail.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceReleasedItemPSFail []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemPSFail] + +func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes.iEExtensions) + w.WriteBit(pDUSessionResourceReleasedItemRelRes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceReleasedItemRelRes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceReleasedItemRelRes.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceReleasedItemRelRes.extensions.Present() { + if err := pDUSessionResourceReleasedItemRelRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceReleasedItemRelRes = PDUSessionResourceReleasedItemRelRes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemRelRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceReleasedItemRelRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, &pDUSessionResourceReleasedItemRelRes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceReleasedItemRelRes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceReleasedItemRelRes []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemRelRes] + +func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq.iEExtensions) + w.WriteBit(pDUSessionResourceSetupItemCxtReq.extensions.Present()) + w.WriteBit(pDUSessionResourceSetupItemCxtReq.NASPDU != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSetupItemCxtReq.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceSetupItemCxtReq.NASPDU != nil { + if err := (*pDUSessionResourceSetupItemCxtReq.NASPDU).MarshalPER(w, enc); err != nil { + return err + } + } + if err := pDUSessionResourceSetupItemCxtReq.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemCxtReq.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupItemCxtReq.extensions.Present() { + if err := pDUSessionResourceSetupItemCxtReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSetupItemCxtReq = PDUSessionResourceSetupItemCxtReq{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NASPDU, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemCxtReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NASPDU { + var v NASPDU + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceSetupItemCxtReq.NASPDU = &v + } + if err := (&pDUSessionResourceSetupItemCxtReq.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemCxtReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, &pDUSessionResourceSetupItemCxtReq.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSetupItemCxtReq.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSetupItemCxtReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemCxtReq]{ + { + ID: IDPduSessionExpectedUEActivityBehaviour, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupItemCxtReq, r *per.Reader, enc per.Encoding) error { + var v ExpectedUEActivityBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSessionExpectedUEActivityBehaviour = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupItemCxtReq) (per.Marshaler, bool) { + if x.PduSessionExpectedUEActivityBehaviour == nil { + return nil, false + } + return x.PduSessionExpectedUEActivityBehaviour, true + }, + }, +} + +func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceSetupItemCxtReq.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes.iEExtensions) + w.WriteBit(pDUSessionResourceSetupItemCxtRes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemCxtRes.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupItemCxtRes.extensions.Present() { + if err := pDUSessionResourceSetupItemCxtRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSetupItemCxtRes = PDUSessionResourceSetupItemCxtRes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemCxtRes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemCxtRes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, &pDUSessionResourceSetupItemCxtRes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSetupItemCxtRes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSetupItemCxtRes []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemCxtRes] + +func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq.iEExtensions) + w.WriteBit(pDUSessionResourceSetupItemHOReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSetupItemHOReq.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemHOReq.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemHOReq.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupItemHOReq.extensions.Present() { + if err := pDUSessionResourceSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSetupItemHOReq = PDUSessionResourceSetupItemHOReq{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemHOReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemHOReq.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemHOReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, &pDUSessionResourceSetupItemHOReq.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSetupItemHOReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemHOReq]{ + { + ID: IDPduSessionExpectedUEActivityBehaviour, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v ExpectedUEActivityBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSessionExpectedUEActivityBehaviour = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupItemHOReq) (per.Marshaler, bool) { + if x.PduSessionExpectedUEActivityBehaviour == nil { + return nil, false + } + return x.PduSessionExpectedUEActivityBehaviour, true + }, + }, +} + +func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceSetupItemHOReq.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq.iEExtensions) + w.WriteBit(pDUSessionResourceSetupItemSUReq.extensions.Present()) + w.WriteBit(pDUSessionResourceSetupItemSUReq.NASPDU != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSetupItemSUReq.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceSetupItemSUReq.NASPDU != nil { + if err := (*pDUSessionResourceSetupItemSUReq.NASPDU).MarshalPER(w, enc); err != nil { + return err + } + } + if err := pDUSessionResourceSetupItemSUReq.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemSUReq.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupItemSUReq.extensions.Present() { + if err := pDUSessionResourceSetupItemSUReq.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSetupItemSUReq = PDUSessionResourceSetupItemSUReq{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NASPDU, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemSUReq.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NASPDU { + var v NASPDU + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceSetupItemSUReq.NASPDU = &v + } + if err := (&pDUSessionResourceSetupItemSUReq.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemSUReq.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, &pDUSessionResourceSetupItemSUReq.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSetupItemSUReq.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSetupItemSUReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemSUReq]{ + { + ID: IDPduSessionExpectedUEActivityBehaviour, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupItemSUReq, r *per.Reader, enc per.Encoding) error { + var v ExpectedUEActivityBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSessionExpectedUEActivityBehaviour = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupItemSUReq) (per.Marshaler, bool) { + if x.PduSessionExpectedUEActivityBehaviour == nil { + return nil, false + } + return x.PduSessionExpectedUEActivityBehaviour, true + }, + }, +} + +func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceSetupItemSUReq.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes.iEExtensions) + w.WriteBit(pDUSessionResourceSetupItemSURes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSetupItemSURes.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupItemSURes.extensions.Present() { + if err := pDUSessionResourceSetupItemSURes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSetupItemSURes = PDUSessionResourceSetupItemSURes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemSURes.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSetupItemSURes.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, &pDUSessionResourceSetupItemSURes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSetupItemSURes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSetupItemSURes []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemSURes] + +func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.extensions.Present()) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.SecurityResult != nil) + w.WriteBit(pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil { + if err := pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupResponseTransfer.SecurityResult != nil { + if err := (*pDUSessionResourceSetupResponseTransfer.SecurityResult).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup != nil { + if err := pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupResponseTransfer.extensions.Present() { + if err := pDUSessionResourceSetupResponseTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSetupResponseTransfer = PDUSessionResourceSetupResponseTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AdditionalDLQosFlowPerTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_SecurityResult, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowFailedToSetup, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AdditionalDLQosFlowPerTNLInformation { + if err := (&pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_SecurityResult { + var v SecurityResult + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceSetupResponseTransfer.SecurityResult = &v + } + if p_QosFlowFailedToSetup { + if err := (&pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSetupResponseTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupResponseTransfer]{ + { + ID: IDRedundantDLQosFlowPerTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantDLQosFlowPerTNLInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if x.RedundantDLQosFlowPerTNLInformation == nil { + return nil, false + } + return x.RedundantDLQosFlowPerTNLInformation, true + }, + }, + { + ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRedundantDLQosFlowPerTNLInformation = v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if len(x.AdditionalRedundantDLQosFlowPerTNLInformation) == 0 { + return nil, false + } + return x.AdditionalRedundantDLQosFlowPerTNLInformation, true + }, + }, + { + ID: IDUsedRSNInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v RedundantPDUSessionInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UsedRSNInformation = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if x.UsedRSNInformation == nil { + return nil, false + } + return x.UsedRSNInformation, true + }, + }, + { + ID: IDGlobalRANNodeID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v GlobalRANNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.GlobalRANNodeID = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if x.GlobalRANNodeID == nil { + return nil, false + } + return x.GlobalRANNodeID, true + }, + }, + { + ID: IDMBSSupportIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSupportIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSupportIndicator = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if x.MBSSupportIndicator == nil { + return nil, false + } + return x.MBSSupportIndicator, true + }, + }, + { + ID: IDMBSSessionSetupResponseList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSessionSetupResponseList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSessionSetupResponseList = v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if len(x.MBSSessionSetupResponseList) == 0 { + return nil, false + } + return x.MBSSessionSetupResponseList, true + }, + }, + { + ID: IDMBSSessionFailedtoSetupList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSessionFailedtoSetupList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSessionFailedtoSetupList = v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if len(x.MBSSessionFailedtoSetupList) == 0 { + return nil, false + } + return x.MBSSessionFailedtoSetupList, true + }, + }, + { + ID: IDQoSFlowTSCList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v QoSFlowTSCList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QoSFlowTSCList = v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if len(x.QoSFlowTSCList) == 0 { + return nil, false + } + return x.QoSFlowTSCList, true + }, + }, + { + ID: IDUplinkTLContainer, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v TLContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UplinkTLContainer = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if x.UplinkTLContainer == nil { + return nil, false + } + return x.UplinkTLContainer, true + }, + }, + { + ID: IDECNMarkingorCongestionInformationReportingStatus, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v ECNMarkingorCongestionInformationReportingStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ECNMarkingorCongestionInformationReportingStatus = v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if len(x.ECNMarkingorCongestionInformationReportingStatus) == 0 { + return nil, false + } + return x.ECNMarkingorCongestionInformationReportingStatus, true + }, + }, + { + ID: IDPDUSetbasedHandlingIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { + var v PDUSetbasedHandlingIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PDUSetbasedHandlingIndicator = &v + return nil + }, + Encode: func(x *PDUSessionResourceSetupResponseTransfer) (per.Marshaler, bool) { + if x.PDUSetbasedHandlingIndicator == nil { + return nil, false + } + return x.PDUSetbasedHandlingIndicator, true + }, + }, +} + +func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceSetupResponseTransfer.SecurityResult != nil && pDUSessionResourceSetupResponseTransfer.SecurityResult.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions) + w.WriteBit(pDUSessionResourceSetupUnsuccessfulTransfer.extensions.Present()) + w.WriteBit(pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSetupUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil { + if err := (*pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSetupUnsuccessfulTransfer.extensions.Present() { + if err := pDUSessionResourceSetupUnsuccessfulTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSetupUnsuccessfulTransfer = PDUSessionResourceSetupUnsuccessfulTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_CriticalityDiagnostics, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSetupUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_CriticalityDiagnostics { + var v CriticalityDiagnostics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, &pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSetupUnsuccessfulTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSetupUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupUnsuccessfulTransfer] + +func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionResourceSetupUnsuccessfulTransfer.Cause.Diagnose(d) { + notComprehended = true + } + if pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil && pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem.iEExtensions) + w.WriteBit(pDUSessionResourceSwitchedItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceSwitchedItem.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceSwitchedItem.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceSwitchedItem.extensions.Present() { + if err := pDUSessionResourceSwitchedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceSwitchedItem = PDUSessionResourceSwitchedItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceSwitchedItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceSwitchedItem.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, &pDUSessionResourceSwitchedItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceSwitchedItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceSwitchedItem = []ap.IESpec[ProtocolIEID, PDUSessionResourceSwitchedItem]{ + { + ID: IDPduSessionExpectedUEActivityBehaviour, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PDUSessionResourceSwitchedItem, r *per.Reader, enc per.Encoding) error { + var v ExpectedUEActivityBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PduSessionExpectedUEActivityBehaviour = &v + return nil + }, + Encode: func(x *PDUSessionResourceSwitchedItem) (per.Marshaler, bool) { + if x.PduSessionExpectedUEActivityBehaviour == nil { + return nil, false + } + return x.PduSessionExpectedUEActivityBehaviour, true + }, + }, +} + +func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem.iEExtensions) + w.WriteBit(pDUSessionResourceToBeSwitchedDLItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceToBeSwitchedDLItem.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceToBeSwitchedDLItem.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceToBeSwitchedDLItem.extensions.Present() { + if err := pDUSessionResourceToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceToBeSwitchedDLItem = PDUSessionResourceToBeSwitchedDLItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceToBeSwitchedDLItem.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceToBeSwitchedDLItem.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, &pDUSessionResourceToBeSwitchedDLItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceToBeSwitchedDLItem []ap.IESpec[ProtocolIEID, PDUSessionResourceToBeSwitchedDLItem] + +func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd.iEExtensions) + w.WriteBit(pDUSessionResourceToReleaseItemHOCmd.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceToReleaseItemHOCmd.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceToReleaseItemHOCmd.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceToReleaseItemHOCmd.extensions.Present() { + if err := pDUSessionResourceToReleaseItemHOCmd.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceToReleaseItemHOCmd = PDUSessionResourceToReleaseItemHOCmd{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceToReleaseItemHOCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceToReleaseItemHOCmd.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, &pDUSessionResourceToReleaseItemHOCmd.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceToReleaseItemHOCmd.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceToReleaseItemHOCmd []ap.IESpec[ProtocolIEID, PDUSessionResourceToReleaseItemHOCmd] + +func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd.iEExtensions) + return notComprehended +} + +func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd.iEExtensions) + w.WriteBit(pDUSessionResourceToReleaseItemRelCmd.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionResourceToReleaseItemRelCmd.PDUSessionID.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionResourceToReleaseItemRelCmd.Transfer.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionResourceToReleaseItemRelCmd.extensions.Present() { + if err := pDUSessionResourceToReleaseItemRelCmd.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionResourceToReleaseItemRelCmd = PDUSessionResourceToReleaseItemRelCmd{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionResourceToReleaseItemRelCmd.PDUSessionID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionResourceToReleaseItemRelCmd.Transfer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, &pDUSessionResourceToReleaseItemRelCmd.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionResourceToReleaseItemRelCmd.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionResourceToReleaseItemRelCmd []ap.IESpec[ProtocolIEID, PDUSessionResourceToReleaseItemRelCmd] + +func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd.iEExtensions) + return notComprehended +} + +func (pDUSessionType PDUSessionType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPDUSessionType.Encode(w, enc, pDUSessionType) +} + +func (pDUSessionType *PDUSessionType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPDUSessionType.Decode(r, enc) + if err != nil { + return err + } + *pDUSessionType = v + return nil +} + +func (pDUSessionType PDUSessionType) Name() string { + return enumPDUSessionType.Name(pDUSessionType) +} + +func (pDUSessionType PDUSessionType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPDUSessionType.Known(pDUSessionType) +} + +func (pDUSessionUsageReport *PDUSessionUsageReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUSessionUsageReport, pDUSessionUsageReport, pDUSessionUsageReport.iEExtensions) + w.WriteBit(pDUSessionUsageReport.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pDUSessionUsageReport.RATType.MarshalPER(w, enc); err != nil { + return err + } + if err := pDUSessionUsageReport.PDUSessionTimedReportList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUSessionUsageReport.extensions.Present() { + if err := pDUSessionUsageReport.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUSessionUsageReport *PDUSessionUsageReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUSessionUsageReport = PDUSessionUsageReport{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pDUSessionUsageReport.RATType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pDUSessionUsageReport.PDUSessionTimedReportList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionUsageReport, pDUSessionUsageReport, &pDUSessionUsageReport.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUSessionUsageReport.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUSessionUsageReport []ap.IESpec[ProtocolIEID, PDUSessionUsageReport] + +func (pDUSessionUsageReport *PDUSessionUsageReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUSessionUsageReport.RATType.Diagnose(d) { + notComprehended = true + } + if pDUSessionUsageReport.PDUSessionTimedReportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUSessionUsageReport, pDUSessionUsageReport, pDUSessionUsageReport.iEExtensions) + return notComprehended +} + +func (pDUSessionUsageReportRATType PDUSessionUsageReportRATType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPDUSessionUsageReportRATType.Encode(w, enc, pDUSessionUsageReportRATType) +} + +func (pDUSessionUsageReportRATType *PDUSessionUsageReportRATType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPDUSessionUsageReportRATType.Decode(r, enc) + if err != nil { + return err + } + *pDUSessionUsageReportRATType = v + return nil +} + +func (pDUSessionUsageReportRATType PDUSessionUsageReportRATType) Name() string { + return enumPDUSessionUsageReportRATType.Name(pDUSessionUsageReportRATType) +} + +func (pDUSessionUsageReportRATType PDUSessionUsageReportRATType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPDUSessionUsageReportRATType.Known(pDUSessionUsageReportRATType) +} + +func (pDUSetbasedHandlingIndicator PDUSetbasedHandlingIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPDUSetbasedHandlingIndicator.Encode(w, enc, pDUSetbasedHandlingIndicator) +} + +func (pDUSetbasedHandlingIndicator *PDUSetbasedHandlingIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPDUSetbasedHandlingIndicator.Decode(r, enc) + if err != nil { + return err + } + *pDUSetbasedHandlingIndicator = v + return nil +} + +func (pDUSetbasedHandlingIndicator PDUSetbasedHandlingIndicator) Name() string { + return enumPDUSetbasedHandlingIndicator.Name(pDUSetbasedHandlingIndicator) +} + +func (pDUSetbasedHandlingIndicator PDUSetbasedHandlingIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPDUSetbasedHandlingIndicator.Known(pDUSetbasedHandlingIndicator) +} + +func (pDUsetQoSInformation *PDUsetQoSInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUsetQoSInformation, pDUsetQoSInformation, pDUsetQoSInformation.iEExtensions) + w.WriteBit(pDUsetQoSInformation.extensions.Present()) + w.WriteBit(pDUsetQoSInformation.PduSetDelayBudget != nil) + w.WriteBit(pDUsetQoSInformation.PduSetErrorRate != nil) + w.WriteBit(pDUsetQoSInformation.PduSetIntegratedHandlingInformation != nil) + w.WriteBit(len(ext) > 0) + if pDUsetQoSInformation.PduSetDelayBudget != nil { + if err := (*pDUsetQoSInformation.PduSetDelayBudget).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUsetQoSInformation.PduSetErrorRate != nil { + if err := (*pDUsetQoSInformation.PduSetErrorRate).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUsetQoSInformation.PduSetIntegratedHandlingInformation != nil { + if err := (*pDUsetQoSInformation.PduSetIntegratedHandlingInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUsetQoSInformation.extensions.Present() { + if err := pDUsetQoSInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUsetQoSInformation *PDUsetQoSInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUsetQoSInformation = PDUsetQoSInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PduSetDelayBudget, err := r.ReadBit() + if err != nil { + return err + } + p_PduSetErrorRate, err := r.ReadBit() + if err != nil { + return err + } + p_PduSetIntegratedHandlingInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_PduSetDelayBudget { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUsetQoSInformation.PduSetDelayBudget = &v + } + if p_PduSetErrorRate { + var v PacketErrorRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUsetQoSInformation.PduSetErrorRate = &v + } + if p_PduSetIntegratedHandlingInformation { + var v PDUsetQoSInformationPduSetIntegratedHandlingInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUsetQoSInformation.PduSetIntegratedHandlingInformation = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUsetQoSInformation, pDUsetQoSInformation, &pDUsetQoSInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUsetQoSInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUsetQoSInformation []ap.IESpec[ProtocolIEID, PDUsetQoSInformation] + +func (pDUsetQoSInformation *PDUsetQoSInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUsetQoSInformation.PduSetDelayBudget != nil && pDUsetQoSInformation.PduSetDelayBudget.Diagnose(d) { + notComprehended = true + } + if pDUsetQoSInformation.PduSetErrorRate != nil && pDUsetQoSInformation.PduSetErrorRate.Diagnose(d) { + notComprehended = true + } + if pDUsetQoSInformation.PduSetIntegratedHandlingInformation != nil && pDUsetQoSInformation.PduSetIntegratedHandlingInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUsetQoSInformation, pDUsetQoSInformation, pDUsetQoSInformation.iEExtensions) + return notComprehended +} + +func (pDUsetQoSInformationPduSetIntegratedHandlingInformation PDUsetQoSInformationPduSetIntegratedHandlingInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPDUsetQoSInformationPduSetIntegratedHandlingInformation.Encode(w, enc, pDUsetQoSInformationPduSetIntegratedHandlingInformation) +} + +func (pDUsetQoSInformationPduSetIntegratedHandlingInformation *PDUsetQoSInformationPduSetIntegratedHandlingInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPDUsetQoSInformationPduSetIntegratedHandlingInformation.Decode(r, enc) + if err != nil { + return err + } + *pDUsetQoSInformationPduSetIntegratedHandlingInformation = v + return nil +} + +func (pDUsetQoSInformationPduSetIntegratedHandlingInformation PDUsetQoSInformationPduSetIntegratedHandlingInformation) Name() string { + return enumPDUsetQoSInformationPduSetIntegratedHandlingInformation.Name(pDUsetQoSInformationPduSetIntegratedHandlingInformation) +} + +func (pDUsetQoSInformationPduSetIntegratedHandlingInformation PDUsetQoSInformationPduSetIntegratedHandlingInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPDUsetQoSInformationPduSetIntegratedHandlingInformation.Known(pDUsetQoSInformationPduSetIntegratedHandlingInformation) +} + +func (pDUsetQoSParameters *PDUsetQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPDUsetQoSParameters, pDUsetQoSParameters, pDUsetQoSParameters.iEExtensions) + w.WriteBit(pDUsetQoSParameters.extensions.Present()) + w.WriteBit(pDUsetQoSParameters.UlPDUSetQoSInformation != nil) + w.WriteBit(pDUsetQoSParameters.DlPDUSetQoSInformation != nil) + w.WriteBit(len(ext) > 0) + if pDUsetQoSParameters.UlPDUSetQoSInformation != nil { + if err := (*pDUsetQoSParameters.UlPDUSetQoSInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if pDUsetQoSParameters.DlPDUSetQoSInformation != nil { + if err := (*pDUsetQoSParameters.DlPDUSetQoSInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pDUsetQoSParameters.extensions.Present() { + if err := pDUsetQoSParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pDUsetQoSParameters *PDUsetQoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pDUsetQoSParameters = PDUsetQoSParameters{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UlPDUSetQoSInformation, err := r.ReadBit() + if err != nil { + return err + } + p_DlPDUSetQoSInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_UlPDUSetQoSInformation { + var v PDUsetQoSInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUsetQoSParameters.UlPDUSetQoSInformation = &v + } + if p_DlPDUSetQoSInformation { + var v PDUsetQoSInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pDUsetQoSParameters.DlPDUSetQoSInformation = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUsetQoSParameters, pDUsetQoSParameters, &pDUsetQoSParameters.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pDUsetQoSParameters.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPDUsetQoSParameters []ap.IESpec[ProtocolIEID, PDUsetQoSParameters] + +func (pDUsetQoSParameters *PDUsetQoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pDUsetQoSParameters.UlPDUSetQoSInformation != nil && pDUsetQoSParameters.UlPDUSetQoSInformation.Diagnose(d) { + notComprehended = true + } + if pDUsetQoSParameters.DlPDUSetQoSInformation != nil && pDUsetQoSParameters.DlPDUSetQoSInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPDUsetQoSParameters, pDUsetQoSParameters, pDUsetQoSParameters.iEExtensions) + return notComprehended +} + +func (pEIPSassistanceInformation *PEIPSassistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, pEIPSassistanceInformation.iEExtensions) + w.WriteBit(pEIPSassistanceInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pEIPSassistanceInformation.CNsubgroupID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pEIPSassistanceInformation.extensions.Present() { + if err := pEIPSassistanceInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pEIPSassistanceInformation *PEIPSassistanceInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pEIPSassistanceInformation = PEIPSassistanceInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pEIPSassistanceInformation.CNsubgroupID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, &pEIPSassistanceInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pEIPSassistanceInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPEIPSassistanceInformation []ap.IESpec[ProtocolIEID, PEIPSassistanceInformation] + +func (pEIPSassistanceInformation *PEIPSassistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pEIPSassistanceInformation.CNsubgroupID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, pEIPSassistanceInformation.iEExtensions) + return notComprehended +} + +func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, pLMNAreaBasedQMC.iEExtensions) + w.WriteBit(pLMNAreaBasedQMC.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pLMNAreaBasedQMC.PlmnListforQMC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pLMNAreaBasedQMC.extensions.Present() { + if err := pLMNAreaBasedQMC.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pLMNAreaBasedQMC = PLMNAreaBasedQMC{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pLMNAreaBasedQMC.PlmnListforQMC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, &pLMNAreaBasedQMC.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pLMNAreaBasedQMC.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPLMNAreaBasedQMC []ap.IESpec[ProtocolIEID, PLMNAreaBasedQMC] + +func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, pLMNAreaBasedQMC.iEExtensions) + return notComprehended +} + +func (pLMNSupportItem *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPLMNSupportItem, pLMNSupportItem, pLMNSupportItem.iEExtensions) + w.WriteBit(pLMNSupportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pLMNSupportItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := pLMNSupportItem.SliceSupportList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pLMNSupportItem.extensions.Present() { + if err := pLMNSupportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pLMNSupportItem *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pLMNSupportItem = PLMNSupportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pLMNSupportItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pLMNSupportItem.SliceSupportList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPLMNSupportItem, pLMNSupportItem, &pLMNSupportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pLMNSupportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPLMNSupportItem = []ap.IESpec[ProtocolIEID, PLMNSupportItem]{ + { + ID: IDNPNSupport, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *PLMNSupportItem, r *per.Reader, enc per.Encoding) error { + var v NPNSupport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NPNSupport = &v + return nil + }, + Encode: func(x *PLMNSupportItem) (per.Marshaler, bool) { + if x.NPNSupport == nil { + return nil, false + } + return x.NPNSupport, true + }, + }, + { + ID: IDExtendedSliceSupportList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *PLMNSupportItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedSliceSupportList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedSliceSupportList = v + return nil + }, + Encode: func(x *PLMNSupportItem) (per.Marshaler, bool) { + if len(x.ExtendedSliceSupportList) == 0 { + return nil, false + } + return x.ExtendedSliceSupportList, true + }, + }, + { + ID: IDOnboardingSupport, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PLMNSupportItem, r *per.Reader, enc per.Encoding) error { + var v OnboardingSupport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.OnboardingSupport = &v + return nil + }, + Encode: func(x *PLMNSupportItem) (per.Marshaler, bool) { + if x.OnboardingSupport == nil { + return nil, false + } + return x.OnboardingSupport, true + }, + }, +} + +func (pLMNSupportItem *PLMNSupportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pLMNSupportItem.SliceSupportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPLMNSupportItem, pLMNSupportItem, pLMNSupportItem.iEExtensions) + return notComprehended +} + +func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT.iEExtensions) + w.WriteBit(pNINPNAreaScopeofMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pNINPNAreaScopeofMDT.CAGListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pNINPNAreaScopeofMDT.extensions.Present() { + if err := pNINPNAreaScopeofMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pNINPNAreaScopeofMDT = PNINPNAreaScopeofMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pNINPNAreaScopeofMDT.CAGListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, &pNINPNAreaScopeofMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pNINPNAreaScopeofMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPNINPNAreaScopeofMDT []ap.IESpec[ProtocolIEID, PNINPNAreaScopeofMDT] + +func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pNINPNAreaScopeofMDT.CAGListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT.iEExtensions) + return notComprehended +} + +func (pNINPNBasedMDT *PNINPNBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPNINPNBasedMDT, pNINPNBasedMDT, pNINPNBasedMDT.iEExtensions) + w.WriteBit(pNINPNBasedMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pNINPNBasedMDT.CAGListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pNINPNBasedMDT.extensions.Present() { + if err := pNINPNBasedMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pNINPNBasedMDT *PNINPNBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pNINPNBasedMDT = PNINPNBasedMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pNINPNBasedMDT.CAGListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNBasedMDT, pNINPNBasedMDT, &pNINPNBasedMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pNINPNBasedMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPNINPNBasedMDT []ap.IESpec[ProtocolIEID, PNINPNBasedMDT] + +func (pNINPNBasedMDT *PNINPNBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pNINPNBasedMDT.CAGListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPNINPNBasedMDT, pNINPNBasedMDT, pNINPNBasedMDT.iEExtensions) + return notComprehended +} + +func (pNINPNMobilityInformation *PNINPNMobilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, pNINPNMobilityInformation.iEExtensions) + w.WriteBit(pNINPNMobilityInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pNINPNMobilityInformation.AllowedPNINPIList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pNINPNMobilityInformation.extensions.Present() { + if err := pNINPNMobilityInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pNINPNMobilityInformation *PNINPNMobilityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pNINPNMobilityInformation = PNINPNMobilityInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pNINPNMobilityInformation.AllowedPNINPIList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, &pNINPNMobilityInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pNINPNMobilityInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPNINPNMobilityInformation []ap.IESpec[ProtocolIEID, PNINPNMobilityInformation] + +func (pNINPNMobilityInformation *PNINPNMobilityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pNINPNMobilityInformation.AllowedPNINPIList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, pNINPNMobilityInformation.iEExtensions) + return notComprehended +} + +func (pWSFailedCellIDList *PWSFailedCellIDList) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{pWSFailedCellIDList.EUTRACGIPWSFailedList != nil, pWSFailedCellIDList.NRCGIPWSFailedList != nil, pWSFailedCellIDList.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case pWSFailedCellIDList.EUTRACGIPWSFailedList != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*pWSFailedCellIDList.EUTRACGIPWSFailedList).MarshalPER(w, enc); err != nil { + return err + } + case pWSFailedCellIDList.NRCGIPWSFailedList != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*pWSFailedCellIDList.NRCGIPWSFailedList).MarshalPER(w, enc); err != nil { + return err + } + case pWSFailedCellIDList.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, pWSFailedCellIDList.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (pWSFailedCellIDList *PWSFailedCellIDList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pWSFailedCellIDList = PWSFailedCellIDList{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v EUTRACGIList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pWSFailedCellIDList.EUTRACGIPWSFailedList = &v + case 1: + var v NRCGIList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pWSFailedCellIDList.NRCGIPWSFailedList = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + pWSFailedCellIDList.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (pWSFailedCellIDList *PWSFailedCellIDList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case pWSFailedCellIDList.EUTRACGIPWSFailedList != nil: + return pWSFailedCellIDList.EUTRACGIPWSFailedList.Diagnose(d) + case pWSFailedCellIDList.NRCGIPWSFailedList != nil: + return pWSFailedCellIDList.NRCGIPWSFailedList.Diagnose(d) + case pWSFailedCellIDList.ChoiceExtension != nil: + d.Unknown(pWSFailedCellIDList.ChoiceExtension.ID, pWSFailedCellIDList.ChoiceExtension.Criticality) + } + return false +} + +func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPacketErrorRate, packetErrorRate, packetErrorRate.iEExtensions) + w.WriteBit(packetErrorRate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := packetErrorRate.Scalar.MarshalPER(w, enc); err != nil { + return err + } + if err := packetErrorRate.Exponent.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if packetErrorRate.extensions.Present() { + if err := packetErrorRate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *packetErrorRate = PacketErrorRate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&packetErrorRate.Scalar).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&packetErrorRate.Exponent).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPacketErrorRate, packetErrorRate, &packetErrorRate.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := packetErrorRate.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPacketErrorRate []ap.IESpec[ProtocolIEID, PacketErrorRate] + +func (packetErrorRate *PacketErrorRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if packetErrorRate.Scalar.Diagnose(d) { + notComprehended = true + } + if packetErrorRate.Exponent.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPacketErrorRate, packetErrorRate, packetErrorRate.iEExtensions) + return notComprehended +} + +func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE.iEExtensions) + w.WriteBit(pagingAssisDataforCEcapabUE.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pagingAssisDataforCEcapabUE.EUTRACGI.MarshalPER(w, enc); err != nil { + return err + } + if err := pagingAssisDataforCEcapabUE.CoverageEnhancementLevel.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pagingAssisDataforCEcapabUE.extensions.Present() { + if err := pagingAssisDataforCEcapabUE.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pagingAssisDataforCEcapabUE = PagingAssisDataforCEcapabUE{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pagingAssisDataforCEcapabUE.EUTRACGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pagingAssisDataforCEcapabUE.CoverageEnhancementLevel).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, &pagingAssisDataforCEcapabUE.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pagingAssisDataforCEcapabUE.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPagingAssisDataforCEcapabUE []ap.IESpec[ProtocolIEID, PagingAssisDataforCEcapabUE] + +func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pagingAssisDataforCEcapabUE.EUTRACGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE.iEExtensions) + return notComprehended +} + +func (pagingAttemptInformation *PagingAttemptInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPagingAttemptInformation, pagingAttemptInformation, pagingAttemptInformation.iEExtensions) + w.WriteBit(pagingAttemptInformation.extensions.Present()) + w.WriteBit(pagingAttemptInformation.NextPagingAreaScope != nil) + w.WriteBit(len(ext) > 0) + if err := pagingAttemptInformation.PagingAttemptCount.MarshalPER(w, enc); err != nil { + return err + } + if err := pagingAttemptInformation.IntendedNumberOfPagingAttempts.MarshalPER(w, enc); err != nil { + return err + } + if pagingAttemptInformation.NextPagingAreaScope != nil { + if err := (*pagingAttemptInformation.NextPagingAreaScope).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pagingAttemptInformation.extensions.Present() { + if err := pagingAttemptInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pagingAttemptInformation *PagingAttemptInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pagingAttemptInformation = PagingAttemptInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NextPagingAreaScope, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pagingAttemptInformation.PagingAttemptCount).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pagingAttemptInformation.IntendedNumberOfPagingAttempts).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NextPagingAreaScope { + var v NextPagingAreaScope + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pagingAttemptInformation.NextPagingAreaScope = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPagingAttemptInformation, pagingAttemptInformation, &pagingAttemptInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pagingAttemptInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPagingAttemptInformation []ap.IESpec[ProtocolIEID, PagingAttemptInformation] + +func (pagingAttemptInformation *PagingAttemptInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pagingAttemptInformation.PagingAttemptCount.Diagnose(d) { + notComprehended = true + } + if pagingAttemptInformation.IntendedNumberOfPagingAttempts.Diagnose(d) { + notComprehended = true + } + if pagingAttemptInformation.NextPagingAreaScope != nil && pagingAttemptInformation.NextPagingAreaScope.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPagingAttemptInformation, pagingAttemptInformation, pagingAttemptInformation.iEExtensions) + return notComprehended +} + +func (pagingCause PagingCause) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingCause.Encode(w, enc, pagingCause) +} + +func (pagingCause *PagingCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingCause.Decode(r, enc) + if err != nil { + return err + } + *pagingCause = v + return nil +} + +func (pagingCause PagingCause) Name() string { + return enumPagingCause.Name(pagingCause) +} + +func (pagingCause PagingCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingCause.Known(pagingCause) +} + +func (pagingCauseIndicationForVoiceService PagingCauseIndicationForVoiceService) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingCauseIndicationForVoiceService.Encode(w, enc, pagingCauseIndicationForVoiceService) +} + +func (pagingCauseIndicationForVoiceService *PagingCauseIndicationForVoiceService) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingCauseIndicationForVoiceService.Decode(r, enc) + if err != nil { + return err + } + *pagingCauseIndicationForVoiceService = v + return nil +} + +func (pagingCauseIndicationForVoiceService PagingCauseIndicationForVoiceService) Name() string { + return enumPagingCauseIndicationForVoiceService.Name(pagingCauseIndicationForVoiceService) +} + +func (pagingCauseIndicationForVoiceService PagingCauseIndicationForVoiceService) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingCauseIndicationForVoiceService.Known(pagingCauseIndicationForVoiceService) +} + +func (pagingDRX PagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingDRX.Encode(w, enc, pagingDRX) +} + +func (pagingDRX *PagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingDRX.Decode(r, enc) + if err != nil { + return err + } + *pagingDRX = v + return nil +} + +func (pagingDRX PagingDRX) Name() string { + return enumPagingDRX.Name(pagingDRX) +} + +func (pagingDRX PagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingDRX.Known(pagingDRX) +} + +func (pagingOrigin PagingOrigin) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingOrigin.Encode(w, enc, pagingOrigin) +} + +func (pagingOrigin *PagingOrigin) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingOrigin.Decode(r, enc) + if err != nil { + return err + } + *pagingOrigin = v + return nil +} + +func (pagingOrigin PagingOrigin) Name() string { + return enumPagingOrigin.Name(pagingOrigin) +} + +func (pagingOrigin PagingOrigin) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingOrigin.Known(pagingOrigin) +} + +func (pagingPriority PagingPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingPriority.Encode(w, enc, pagingPriority) +} + +func (pagingPriority *PagingPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingPriority.Decode(r, enc) + if err != nil { + return err + } + *pagingPriority = v + return nil +} + +func (pagingPriority PagingPriority) Name() string { + return enumPagingPriority.Name(pagingPriority) +} + +func (pagingPriority PagingPriority) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingPriority.Known(pagingPriority) +} + +func (pagingProbabilityInformation PagingProbabilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingProbabilityInformation.Encode(w, enc, pagingProbabilityInformation) +} + +func (pagingProbabilityInformation *PagingProbabilityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingProbabilityInformation.Decode(r, enc) + if err != nil { + return err + } + *pagingProbabilityInformation = v + return nil +} + +func (pagingProbabilityInformation PagingProbabilityInformation) Name() string { + return enumPagingProbabilityInformation.Name(pagingProbabilityInformation) +} + +func (pagingProbabilityInformation PagingProbabilityInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingProbabilityInformation.Known(pagingProbabilityInformation) +} + +func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem.iEExtensions) + w.WriteBit(partiallyAllowedNSSAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := partiallyAllowedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if partiallyAllowedNSSAIItem.extensions.Present() { + if err := partiallyAllowedNSSAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *partiallyAllowedNSSAIItem = PartiallyAllowedNSSAIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&partiallyAllowedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, &partiallyAllowedNSSAIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := partiallyAllowedNSSAIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPartiallyAllowedNSSAIItem []ap.IESpec[ProtocolIEID, PartiallyAllowedNSSAIItem] + +func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if partiallyAllowedNSSAIItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem.iEExtensions) + return notComprehended +} + +func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer.iEExtensions) + w.WriteBit(pathSwitchRequestAcknowledgeTransfer.extensions.Present()) + w.WriteBit(pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil) + w.WriteBit(pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil) + w.WriteBit(len(ext) > 0) + if pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil { + if err := (*pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil { + if err := (*pathSwitchRequestAcknowledgeTransfer.SecurityIndication).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pathSwitchRequestAcknowledgeTransfer.extensions.Present() { + if err := pathSwitchRequestAcknowledgeTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pathSwitchRequestAcknowledgeTransfer = PathSwitchRequestAcknowledgeTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ULNGUUPTNLInformation, err := r.ReadBit() + if err != nil { + return err + } + p_SecurityIndication, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_ULNGUUPTNLInformation { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation = &v + } + if p_SecurityIndication { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestAcknowledgeTransfer.SecurityIndication = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pathSwitchRequestAcknowledgeTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPathSwitchRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, PathSwitchRequestAcknowledgeTransfer]{ + { + ID: IDAdditionalNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformationPairList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalNGUUPTNLInformation = v + return nil + }, + Encode: func(x *PathSwitchRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if len(x.AdditionalNGUUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalNGUUPTNLInformation, true + }, + }, + { + ID: IDRedundantULNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantULNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *PathSwitchRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if x.RedundantULNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantULNGUUPTNLInformation, true + }, + }, + { + ID: IDAdditionalRedundantNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformationPairList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRedundantNGUUPTNLInformation = v + return nil + }, + Encode: func(x *PathSwitchRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if len(x.AdditionalRedundantNGUUPTNLInformation) == 0 { + return nil, false + } + return x.AdditionalRedundantNGUUPTNLInformation, true + }, + }, + { + ID: IDQosFlowParametersList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowParametersList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QosFlowParametersList = v + return nil + }, + Encode: func(x *PathSwitchRequestAcknowledgeTransfer) (per.Marshaler, bool) { + if len(x.QosFlowParametersList) == 0 { + return nil, false + } + return x.QosFlowParametersList, true + }, + }, +} + +func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil && pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil && pathSwitchRequestAcknowledgeTransfer.SecurityIndication.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer.iEExtensions) + return notComprehended +} + +func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer.iEExtensions) + w.WriteBit(pathSwitchRequestSetupFailedTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pathSwitchRequestSetupFailedTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pathSwitchRequestSetupFailedTransfer.extensions.Present() { + if err := pathSwitchRequestSetupFailedTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pathSwitchRequestSetupFailedTransfer = PathSwitchRequestSetupFailedTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pathSwitchRequestSetupFailedTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, &pathSwitchRequestSetupFailedTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pathSwitchRequestSetupFailedTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPathSwitchRequestSetupFailedTransfer []ap.IESpec[ProtocolIEID, PathSwitchRequestSetupFailedTransfer] + +func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pathSwitchRequestSetupFailedTransfer.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer.iEExtensions) + return notComprehended +} + +func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, pathSwitchRequestTransfer.iEExtensions) + w.WriteBit(pathSwitchRequestTransfer.extensions.Present()) + w.WriteBit(pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil) + w.WriteBit(pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil) + w.WriteBit(len(ext) > 0) + if err := pathSwitchRequestTransfer.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil { + if err := (*pathSwitchRequestTransfer.DLNGUTNLInformationReused).MarshalPER(w, enc); err != nil { + return err + } + } + if pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil { + if err := (*pathSwitchRequestTransfer.UserPlaneSecurityInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if err := pathSwitchRequestTransfer.QosFlowAccepted.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pathSwitchRequestTransfer.extensions.Present() { + if err := pathSwitchRequestTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pathSwitchRequestTransfer = PathSwitchRequestTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLNGUTNLInformationReused, err := r.ReadBit() + if err != nil { + return err + } + p_UserPlaneSecurityInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pathSwitchRequestTransfer.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLNGUTNLInformationReused { + var v DLNGUTNLInformationReused + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestTransfer.DLNGUTNLInformationReused = &v + } + if p_UserPlaneSecurityInformation { + var v UserPlaneSecurityInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pathSwitchRequestTransfer.UserPlaneSecurityInformation = &v + } + if err := (&pathSwitchRequestTransfer.QosFlowAccepted).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pathSwitchRequestTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchRequestTransfer]{ + { + ID: IDAdditionalDLQosFlowPerTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalDLQosFlowPerTNLInformation = v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if len(x.AdditionalDLQosFlowPerTNLInformation) == 0 { + return nil, false + } + return x.AdditionalDLQosFlowPerTNLInformation, true + }, + }, + { + ID: IDRedundantDLNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantDLNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if x.RedundantDLNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantDLNGUUPTNLInformation, true + }, + }, + { + ID: IDRedundantDLNGUTNLInformationReused, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v DLNGUTNLInformationReused + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantDLNGUTNLInformationReused = &v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if x.RedundantDLNGUTNLInformationReused == nil { + return nil, false + } + return x.RedundantDLNGUTNLInformationReused, true + }, + }, + { + ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v QosFlowPerTNLInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRedundantDLQosFlowPerTNLInformation = v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if len(x.AdditionalRedundantDLQosFlowPerTNLInformation) == 0 { + return nil, false + } + return x.AdditionalRedundantDLQosFlowPerTNLInformation, true + }, + }, + { + ID: IDUsedRSNInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v RedundantPDUSessionInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UsedRSNInformation = &v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if x.UsedRSNInformation == nil { + return nil, false + } + return x.UsedRSNInformation, true + }, + }, + { + ID: IDGlobalRANNodeID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v GlobalRANNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.GlobalRANNodeID = &v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if x.GlobalRANNodeID == nil { + return nil, false + } + return x.GlobalRANNodeID, true + }, + }, + { + ID: IDMBSSupportIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v MBSSupportIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSSupportIndicator = &v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if x.MBSSupportIndicator == nil { + return nil, false + } + return x.MBSSupportIndicator, true + }, + }, + { + ID: IDPDUSetbasedHandlingIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v PDUSetbasedHandlingIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PDUSetbasedHandlingIndicator = &v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if x.PDUSetbasedHandlingIndicator == nil { + return nil, false + } + return x.PDUSetbasedHandlingIndicator, true + }, + }, + { + ID: IDECNMarkingorCongestionInformationReportingStatus, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { + var v ECNMarkingorCongestionInformationReportingStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ECNMarkingorCongestionInformationReportingStatus = v + return nil + }, + Encode: func(x *PathSwitchRequestTransfer) (per.Marshaler, bool) { + if len(x.ECNMarkingorCongestionInformationReportingStatus) == 0 { + return nil, false + } + return x.ECNMarkingorCongestionInformationReportingStatus, true + }, + }, +} + +func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pathSwitchRequestTransfer.DLNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil && pathSwitchRequestTransfer.DLNGUTNLInformationReused.Diagnose(d) { + notComprehended = true + } + if pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil && pathSwitchRequestTransfer.UserPlaneSecurityInformation.Diagnose(d) { + notComprehended = true + } + if pathSwitchRequestTransfer.QosFlowAccepted.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, pathSwitchRequestTransfer.iEExtensions) + return notComprehended +} + +func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer.iEExtensions) + w.WriteBit(pathSwitchRequestUnsuccessfulTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pathSwitchRequestUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pathSwitchRequestUnsuccessfulTransfer.extensions.Present() { + if err := pathSwitchRequestUnsuccessfulTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pathSwitchRequestUnsuccessfulTransfer = PathSwitchRequestUnsuccessfulTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pathSwitchRequestUnsuccessfulTransfer.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, &pathSwitchRequestUnsuccessfulTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pathSwitchRequestUnsuccessfulTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPathSwitchRequestUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PathSwitchRequestUnsuccessfulTransfer] + +func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pathSwitchRequestUnsuccessfulTransfer.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer.iEExtensions) + return notComprehended +} + +func (pedestrianUE PedestrianUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPedestrianUE.Encode(w, enc, pedestrianUE) +} + +func (pedestrianUE *PedestrianUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPedestrianUE.Decode(r, enc) + if err != nil { + return err + } + *pedestrianUE = v + return nil +} + +func (pedestrianUE PedestrianUE) Name() string { + return enumPedestrianUE.Name(pedestrianUE) +} + +func (pedestrianUE PedestrianUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPedestrianUE.Known(pedestrianUE) +} + +func (periodicReportingIEs *PeriodicReportingIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPeriodicReportingIEs, periodicReportingIEs, periodicReportingIEs.iEExtensions) + w.WriteBit(periodicReportingIEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := periodicReportingIEs.ReportingPeriodicity.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if periodicReportingIEs.extensions.Present() { + if err := periodicReportingIEs.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (periodicReportingIEs *PeriodicReportingIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *periodicReportingIEs = PeriodicReportingIEs{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&periodicReportingIEs.ReportingPeriodicity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPeriodicReportingIEs, periodicReportingIEs, &periodicReportingIEs.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := periodicReportingIEs.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPeriodicReportingIEs []ap.IESpec[ProtocolIEID, PeriodicReportingIEs] + +func (periodicReportingIEs *PeriodicReportingIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if periodicReportingIEs.ReportingPeriodicity.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPeriodicReportingIEs, periodicReportingIEs, periodicReportingIEs.iEExtensions) + return notComprehended +} + +func (periodicityBound *PeriodicityBound) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPeriodicityBound, periodicityBound, periodicityBound.iEExtensions) + w.WriteBit(periodicityBound.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := periodicityBound.PeriodicityLowerBound.MarshalPER(w, enc); err != nil { + return err + } + if err := periodicityBound.PeriodicityUpperBound.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if periodicityBound.extensions.Present() { + if err := periodicityBound.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (periodicityBound *PeriodicityBound) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *periodicityBound = PeriodicityBound{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&periodicityBound.PeriodicityLowerBound).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&periodicityBound.PeriodicityUpperBound).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPeriodicityBound, periodicityBound, &periodicityBound.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := periodicityBound.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPeriodicityBound []ap.IESpec[ProtocolIEID, PeriodicityBound] + +func (periodicityBound *PeriodicityBound) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if periodicityBound.PeriodicityLowerBound.Diagnose(d) { + notComprehended = true + } + if periodicityBound.PeriodicityUpperBound.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPeriodicityBound, periodicityBound, periodicityBound.iEExtensions) + return notComprehended +} + +func (periodicityRange *PeriodicityRange) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{periodicityRange.PeriodicityBound != nil, periodicityRange.PeriodicityList != nil, periodicityRange.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case periodicityRange.PeriodicityBound != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*periodicityRange.PeriodicityBound).MarshalPER(w, enc); err != nil { + return err + } + case periodicityRange.PeriodicityList != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*periodicityRange.PeriodicityList).MarshalPER(w, enc); err != nil { + return err + } + case periodicityRange.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, periodicityRange.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (periodicityRange *PeriodicityRange) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *periodicityRange = PeriodicityRange{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v PeriodicityBound + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + periodicityRange.PeriodicityBound = &v + case 1: + var v AllowedPeriodicityList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + periodicityRange.PeriodicityList = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + periodicityRange.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (periodicityRange *PeriodicityRange) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case periodicityRange.PeriodicityBound != nil: + return periodicityRange.PeriodicityBound.Diagnose(d) + case periodicityRange.PeriodicityList != nil: + return periodicityRange.PeriodicityList.Diagnose(d) + case periodicityRange.ChoiceExtension != nil: + d.Unknown(periodicityRange.ChoiceExtension.ID, periodicityRange.ChoiceExtension.Criticality) + } + return false +} + +func (preemptionCapability PreemptionCapability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPreemptionCapability.Encode(w, enc, preemptionCapability) +} + +func (preemptionCapability *PreemptionCapability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPreemptionCapability.Decode(r, enc) + if err != nil { + return err + } + *preemptionCapability = v + return nil +} + +func (preemptionCapability PreemptionCapability) Name() string { + return enumPreemptionCapability.Name(preemptionCapability) +} + +func (preemptionCapability PreemptionCapability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPreemptionCapability.Known(preemptionCapability) +} + +func (preemptionVulnerability PreemptionVulnerability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPreemptionVulnerability.Encode(w, enc, preemptionVulnerability) +} + +func (preemptionVulnerability *PreemptionVulnerability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPreemptionVulnerability.Decode(r, enc) + if err != nil { + return err + } + *preemptionVulnerability = v + return nil +} + +func (preemptionVulnerability PreemptionVulnerability) Name() string { + return enumPreemptionVulnerability.Name(preemptionVulnerability) +} + +func (preemptionVulnerability PreemptionVulnerability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPreemptionVulnerability.Known(preemptionVulnerability) +} + +func (qMCConfigInfo *QMCConfigInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQMCConfigInfo, qMCConfigInfo, qMCConfigInfo.iEExtensions) + w.WriteBit(qMCConfigInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qMCConfigInfo.UEAppLayerMeasInfoList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qMCConfigInfo.extensions.Present() { + if err := qMCConfigInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qMCConfigInfo *QMCConfigInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qMCConfigInfo = QMCConfigInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qMCConfigInfo.UEAppLayerMeasInfoList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQMCConfigInfo, qMCConfigInfo, &qMCConfigInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qMCConfigInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQMCConfigInfo []ap.IESpec[ProtocolIEID, QMCConfigInfo] + +func (qMCConfigInfo *QMCConfigInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qMCConfigInfo.UEAppLayerMeasInfoList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQMCConfigInfo, qMCConfigInfo, qMCConfigInfo.iEExtensions) + return notComprehended +} + +func (qMCDeactivation *QMCDeactivation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQMCDeactivation, qMCDeactivation, qMCDeactivation.iEExtensions) + w.WriteBit(qMCDeactivation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qMCDeactivation.QoEReferenceList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qMCDeactivation.extensions.Present() { + if err := qMCDeactivation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qMCDeactivation *QMCDeactivation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qMCDeactivation = QMCDeactivation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qMCDeactivation.QoEReferenceList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQMCDeactivation, qMCDeactivation, &qMCDeactivation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qMCDeactivation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQMCDeactivation []ap.IESpec[ProtocolIEID, QMCDeactivation] + +func (qMCDeactivation *QMCDeactivation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsQMCDeactivation, qMCDeactivation, qMCDeactivation.iEExtensions) + return notComprehended +} + +func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, qoERVQoEReportingPaths.iEExtensions) + w.WriteBit(qoERVQoEReportingPaths.extensions.Present()) + w.WriteBit(qoERVQoEReportingPaths.QoEReportingPath != nil) + w.WriteBit(qoERVQoEReportingPaths.RVQoEReportingPath != nil) + w.WriteBit(len(ext) > 0) + if qoERVQoEReportingPaths.QoEReportingPath != nil { + if err := (*qoERVQoEReportingPaths.QoEReportingPath).MarshalPER(w, enc); err != nil { + return err + } + } + if qoERVQoEReportingPaths.RVQoEReportingPath != nil { + if err := (*qoERVQoEReportingPaths.RVQoEReportingPath).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qoERVQoEReportingPaths.extensions.Present() { + if err := qoERVQoEReportingPaths.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qoERVQoEReportingPaths = QoERVQoEReportingPaths{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_QoEReportingPath, err := r.ReadBit() + if err != nil { + return err + } + p_RVQoEReportingPath, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_QoEReportingPath { + var v QoERVQoEReportingPathsQoEReportingPath + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qoERVQoEReportingPaths.QoEReportingPath = &v + } + if p_RVQoEReportingPath { + var v QoERVQoEReportingPathsRVQoEReportingPath + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qoERVQoEReportingPaths.RVQoEReportingPath = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, &qoERVQoEReportingPaths.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qoERVQoEReportingPaths.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQoERVQoEReportingPaths []ap.IESpec[ProtocolIEID, QoERVQoEReportingPaths] + +func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qoERVQoEReportingPaths.QoEReportingPath != nil && qoERVQoEReportingPaths.QoEReportingPath.Diagnose(d) { + notComprehended = true + } + if qoERVQoEReportingPaths.RVQoEReportingPath != nil && qoERVQoEReportingPaths.RVQoEReportingPath.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, qoERVQoEReportingPaths.iEExtensions) + return notComprehended +} + +func (qoERVQoEReportingPathsQoEReportingPath QoERVQoEReportingPathsQoEReportingPath) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumQoERVQoEReportingPathsQoEReportingPath.Encode(w, enc, qoERVQoEReportingPathsQoEReportingPath) +} + +func (qoERVQoEReportingPathsQoEReportingPath *QoERVQoEReportingPathsQoEReportingPath) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumQoERVQoEReportingPathsQoEReportingPath.Decode(r, enc) + if err != nil { + return err + } + *qoERVQoEReportingPathsQoEReportingPath = v + return nil +} + +func (qoERVQoEReportingPathsQoEReportingPath QoERVQoEReportingPathsQoEReportingPath) Name() string { + return enumQoERVQoEReportingPathsQoEReportingPath.Name(qoERVQoEReportingPathsQoEReportingPath) +} + +func (qoERVQoEReportingPathsQoEReportingPath QoERVQoEReportingPathsQoEReportingPath) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumQoERVQoEReportingPathsQoEReportingPath.Known(qoERVQoEReportingPathsQoEReportingPath) +} + +func (qoERVQoEReportingPathsRVQoEReportingPath QoERVQoEReportingPathsRVQoEReportingPath) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumQoERVQoEReportingPathsRVQoEReportingPath.Encode(w, enc, qoERVQoEReportingPathsRVQoEReportingPath) +} + +func (qoERVQoEReportingPathsRVQoEReportingPath *QoERVQoEReportingPathsRVQoEReportingPath) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumQoERVQoEReportingPathsRVQoEReportingPath.Decode(r, enc) + if err != nil { + return err + } + *qoERVQoEReportingPathsRVQoEReportingPath = v + return nil +} + +func (qoERVQoEReportingPathsRVQoEReportingPath QoERVQoEReportingPathsRVQoEReportingPath) Name() string { + return enumQoERVQoEReportingPathsRVQoEReportingPath.Name(qoERVQoEReportingPathsRVQoEReportingPath) +} + +func (qoERVQoEReportingPathsRVQoEReportingPath QoERVQoEReportingPathsRVQoEReportingPath) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumQoERVQoEReportingPathsRVQoEReportingPath.Known(qoERVQoEReportingPathsRVQoEReportingPath) +} + +func (qoSFlowTSCItem *QoSFlowTSCItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQoSFlowTSCItem, qoSFlowTSCItem, qoSFlowTSCItem.iEExtensions) + w.WriteBit(qoSFlowTSCItem.extensions.Present()) + w.WriteBit(qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback != nil) + w.WriteBit(qoSFlowTSCItem.ANPacketDelayBudgetUL != nil) + w.WriteBit(len(ext) > 0) + if err := qoSFlowTSCItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback != nil { + if err := (*qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback).MarshalPER(w, enc); err != nil { + return err + } + } + if qoSFlowTSCItem.ANPacketDelayBudgetUL != nil { + if err := (*qoSFlowTSCItem.ANPacketDelayBudgetUL).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qoSFlowTSCItem.extensions.Present() { + if err := qoSFlowTSCItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qoSFlowTSCItem *QoSFlowTSCItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qoSFlowTSCItem = QoSFlowTSCItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TSCTrafficCharacteristicsFeedback, err := r.ReadBit() + if err != nil { + return err + } + p_ANPacketDelayBudgetUL, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qoSFlowTSCItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TSCTrafficCharacteristicsFeedback { + var v TSCTrafficCharacteristicsFeedback + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback = &v + } + if p_ANPacketDelayBudgetUL { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qoSFlowTSCItem.ANPacketDelayBudgetUL = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQoSFlowTSCItem, qoSFlowTSCItem, &qoSFlowTSCItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qoSFlowTSCItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQoSFlowTSCItem []ap.IESpec[ProtocolIEID, QoSFlowTSCItem] + +func (qoSFlowTSCItem *QoSFlowTSCItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qoSFlowTSCItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback != nil && qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback.Diagnose(d) { + notComprehended = true + } + if qoSFlowTSCItem.ANPacketDelayBudgetUL != nil && qoSFlowTSCItem.ANPacketDelayBudgetUL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQoSFlowTSCItem, qoSFlowTSCItem, qoSFlowTSCItem.iEExtensions) + return notComprehended +} + +func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, qoSFlowsUsageReportItem.iEExtensions) + w.WriteBit(qoSFlowsUsageReportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qoSFlowsUsageReportItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if err := qoSFlowsUsageReportItem.RATType.MarshalPER(w, enc); err != nil { + return err + } + if err := qoSFlowsUsageReportItem.QoSFlowsTimedReportList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qoSFlowsUsageReportItem.extensions.Present() { + if err := qoSFlowsUsageReportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qoSFlowsUsageReportItem = QoSFlowsUsageReportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qoSFlowsUsageReportItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qoSFlowsUsageReportItem.RATType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qoSFlowsUsageReportItem.QoSFlowsTimedReportList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, &qoSFlowsUsageReportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qoSFlowsUsageReportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQoSFlowsUsageReportItem []ap.IESpec[ProtocolIEID, QoSFlowsUsageReportItem] + +func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qoSFlowsUsageReportItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qoSFlowsUsageReportItem.RATType.Diagnose(d) { + notComprehended = true + } + if qoSFlowsUsageReportItem.QoSFlowsTimedReportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, qoSFlowsUsageReportItem.iEExtensions) + return notComprehended +} + +func (qoSFlowsUsageReportItemRATType QoSFlowsUsageReportItemRATType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumQoSFlowsUsageReportItemRATType.Encode(w, enc, qoSFlowsUsageReportItemRATType) +} + +func (qoSFlowsUsageReportItemRATType *QoSFlowsUsageReportItemRATType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumQoSFlowsUsageReportItemRATType.Decode(r, enc) + if err != nil { + return err + } + *qoSFlowsUsageReportItemRATType = v + return nil +} + +func (qoSFlowsUsageReportItemRATType QoSFlowsUsageReportItemRATType) Name() string { + return enumQoSFlowsUsageReportItemRATType.Name(qoSFlowsUsageReportItemRATType) +} + +func (qoSFlowsUsageReportItemRATType QoSFlowsUsageReportItemRATType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumQoSFlowsUsageReportItemRATType.Known(qoSFlowsUsageReportItemRATType) +} + +func (qosCharacteristics *QosCharacteristics) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{qosCharacteristics.NonDynamic5QI != nil, qosCharacteristics.Dynamic5QI != nil, qosCharacteristics.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case qosCharacteristics.NonDynamic5QI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*qosCharacteristics.NonDynamic5QI).MarshalPER(w, enc); err != nil { + return err + } + case qosCharacteristics.Dynamic5QI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*qosCharacteristics.Dynamic5QI).MarshalPER(w, enc); err != nil { + return err + } + case qosCharacteristics.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, qosCharacteristics.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (qosCharacteristics *QosCharacteristics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosCharacteristics = QosCharacteristics{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v NonDynamic5QIDescriptor + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosCharacteristics.NonDynamic5QI = &v + case 1: + var v Dynamic5QIDescriptor + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosCharacteristics.Dynamic5QI = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + qosCharacteristics.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (qosCharacteristics *QosCharacteristics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case qosCharacteristics.NonDynamic5QI != nil: + return qosCharacteristics.NonDynamic5QI.Diagnose(d) + case qosCharacteristics.Dynamic5QI != nil: + return qosCharacteristics.Dynamic5QI.Diagnose(d) + case qosCharacteristics.ChoiceExtension != nil: + d.Unknown(qosCharacteristics.ChoiceExtension.ID, qosCharacteristics.ChoiceExtension.Criticality) + } + return false +} + +func (qosFlowAcceptedItem *QosFlowAcceptedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, qosFlowAcceptedItem.iEExtensions) + w.WriteBit(qosFlowAcceptedItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowAcceptedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowAcceptedItem.extensions.Present() { + if err := qosFlowAcceptedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowAcceptedItem = QosFlowAcceptedItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowAcceptedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, &qosFlowAcceptedItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowAcceptedItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowAcceptedItem = []ap.IESpec[ProtocolIEID, QosFlowAcceptedItem]{ + { + ID: IDCurrentQoSParaSetIndex, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAcceptedItem, r *per.Reader, enc per.Encoding) error { + var v AlternativeQoSParaSetIndex + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CurrentQoSParaSetIndex = &v + return nil + }, + Encode: func(x *QosFlowAcceptedItem) (per.Marshaler, bool) { + if x.CurrentQoSParaSetIndex == nil { + return nil, false + } + return x.CurrentQoSParaSetIndex, true + }, + }, +} + +func (qosFlowAcceptedItem *QosFlowAcceptedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowAcceptedItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, qosFlowAcceptedItem.iEExtensions) + return notComprehended +} + +func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem.iEExtensions) + w.WriteBit(qosFlowAddOrModifyRequestItem.extensions.Present()) + w.WriteBit(qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil) + w.WriteBit(qosFlowAddOrModifyRequestItem.ERABID != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowAddOrModifyRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil { + if err := (*qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowAddOrModifyRequestItem.ERABID != nil { + if err := (*qosFlowAddOrModifyRequestItem.ERABID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowAddOrModifyRequestItem.extensions.Present() { + if err := qosFlowAddOrModifyRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowAddOrModifyRequestItem = QosFlowAddOrModifyRequestItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowLevelQosParameters, err := r.ReadBit() + if err != nil { + return err + } + p_ERABID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowAddOrModifyRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_QosFlowLevelQosParameters { + var v QosFlowLevelQosParameters + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters = &v + } + if p_ERABID { + var v ERABID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowAddOrModifyRequestItem.ERABID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowAddOrModifyRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowAddOrModifyRequestItem = []ap.IESpec[ProtocolIEID, QosFlowAddOrModifyRequestItem]{ + { + ID: IDTSCTrafficCharacteristics, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { + var v TSCTrafficCharacteristics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TSCTrafficCharacteristics = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyRequestItem) (per.Marshaler, bool) { + if x.TSCTrafficCharacteristics == nil { + return nil, false + } + return x.TSCTrafficCharacteristics, true + }, + }, + { + ID: IDRedundantQosFlowIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { + var v RedundantQosFlowIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantQosFlowIndicator = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyRequestItem) (per.Marshaler, bool) { + if x.RedundantQosFlowIndicator == nil { + return nil, false + } + return x.RedundantQosFlowIndicator, true + }, + }, + { + ID: IDULNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ULNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyRequestItem) (per.Marshaler, bool) { + if x.ULNGUUPTNLInformation == nil { + return nil, false + } + return x.ULNGUUPTNLInformation, true + }, + }, + { + ID: IDDownlinkTLContainer, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { + var v TLContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DownlinkTLContainer = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyRequestItem) (per.Marshaler, bool) { + if x.DownlinkTLContainer == nil { + return nil, false + } + return x.DownlinkTLContainer, true + }, + }, + { + ID: IDECNMarkingorCongestionInformationReportingRequest, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { + var v ECNMarkingorCongestionInformationReportingRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ECNMarkingorCongestionInformationReportingRequest = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyRequestItem) (per.Marshaler, bool) { + if x.ECNMarkingorCongestionInformationReportingRequest == nil { + return nil, false + } + return x.ECNMarkingorCongestionInformationReportingRequest, true + }, + }, +} + +func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowAddOrModifyRequestItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil && qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters.Diagnose(d) { + notComprehended = true + } + if qosFlowAddOrModifyRequestItem.ERABID != nil && qosFlowAddOrModifyRequestItem.ERABID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem.iEExtensions) + return notComprehended +} + +func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem.iEExtensions) + w.WriteBit(qosFlowAddOrModifyResponseItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowAddOrModifyResponseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowAddOrModifyResponseItem.extensions.Present() { + if err := qosFlowAddOrModifyResponseItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowAddOrModifyResponseItem = QosFlowAddOrModifyResponseItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowAddOrModifyResponseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowAddOrModifyResponseItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowAddOrModifyResponseItem = []ap.IESpec[ProtocolIEID, QosFlowAddOrModifyResponseItem]{ + { + ID: IDCurrentQoSParaSetIndex, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { + var v AlternativeQoSParaSetIndex + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CurrentQoSParaSetIndex = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyResponseItem) (per.Marshaler, bool) { + if x.CurrentQoSParaSetIndex == nil { + return nil, false + } + return x.CurrentQoSParaSetIndex, true + }, + }, + { + ID: IDTSCTrafficCharacteristicsFeedback, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { + var v TSCTrafficCharacteristicsFeedback + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TSCTrafficCharacteristicsFeedback = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyResponseItem) (per.Marshaler, bool) { + if x.TSCTrafficCharacteristicsFeedback == nil { + return nil, false + } + return x.TSCTrafficCharacteristicsFeedback, true + }, + }, + { + ID: IDUplinkTLContainer, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { + var v TLContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UplinkTLContainer = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyResponseItem) (per.Marshaler, bool) { + if x.UplinkTLContainer == nil { + return nil, false + } + return x.UplinkTLContainer, true + }, + }, + { + ID: IDDLNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DLNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyResponseItem) (per.Marshaler, bool) { + if x.DLNGUUPTNLInformation == nil { + return nil, false + } + return x.DLNGUUPTNLInformation, true + }, + }, + { + ID: IDANPacketDelayBudgetUL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ANPacketDelayBudgetUL = &v + return nil + }, + Encode: func(x *QosFlowAddOrModifyResponseItem) (per.Marshaler, bool) { + if x.ANPacketDelayBudgetUL == nil { + return nil, false + } + return x.ANPacketDelayBudgetUL, true + }, + }, +} + +func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowAddOrModifyResponseItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem.iEExtensions) + return notComprehended +} + +func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom.iEExtensions) + w.WriteBit(qosFlowAdditionalInfoItemRelCom.extensions.Present()) + w.WriteBit(qosFlowAdditionalInfoItemRelCom.DownlinkTLContainer != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowAdditionalInfoItemRelCom.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowAdditionalInfoItemRelCom.DownlinkTLContainer != nil { + if err := qosFlowAdditionalInfoItemRelCom.DownlinkTLContainer.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowAdditionalInfoItemRelCom.extensions.Present() { + if err := qosFlowAdditionalInfoItemRelCom.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowAdditionalInfoItemRelCom = QosFlowAdditionalInfoItemRelCom{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DownlinkTLContainer, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowAdditionalInfoItemRelCom.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DownlinkTLContainer { + if err := (&qosFlowAdditionalInfoItemRelCom.DownlinkTLContainer).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, &qosFlowAdditionalInfoItemRelCom.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowAdditionalInfoItemRelCom.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowAdditionalInfoItemRelCom []ap.IESpec[ProtocolIEID, QosFlowAdditionalInfoItemRelCom] + +func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowAdditionalInfoItemRelCom.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom.iEExtensions) + return notComprehended +} + +func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes.iEExtensions) + w.WriteBit(qosFlowAdditionalInfoItemRelRes.extensions.Present()) + w.WriteBit(qosFlowAdditionalInfoItemRelRes.UplinkTLContainer != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowAdditionalInfoItemRelRes.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowAdditionalInfoItemRelRes.UplinkTLContainer != nil { + if err := qosFlowAdditionalInfoItemRelRes.UplinkTLContainer.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowAdditionalInfoItemRelRes.extensions.Present() { + if err := qosFlowAdditionalInfoItemRelRes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowAdditionalInfoItemRelRes = QosFlowAdditionalInfoItemRelRes{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UplinkTLContainer, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowAdditionalInfoItemRelRes.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_UplinkTLContainer { + if err := (&qosFlowAdditionalInfoItemRelRes.UplinkTLContainer).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, &qosFlowAdditionalInfoItemRelRes.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowAdditionalInfoItemRelRes.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowAdditionalInfoItemRelRes []ap.IESpec[ProtocolIEID, QosFlowAdditionalInfoItemRelRes] + +func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowAdditionalInfoItemRelRes.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes.iEExtensions) + return notComprehended +} + +func (qosFlowFeedbackItem *QosFlowFeedbackItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, qosFlowFeedbackItem.iEExtensions) + w.WriteBit(qosFlowFeedbackItem.extensions.Present()) + w.WriteBit(qosFlowFeedbackItem.UpdateFeedback != nil) + w.WriteBit(qosFlowFeedbackItem.CNpacketDelayBudgetDL != nil) + w.WriteBit(qosFlowFeedbackItem.CNpacketDelayBudgetUL != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowFeedbackItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowFeedbackItem.UpdateFeedback != nil { + if err := (*qosFlowFeedbackItem.UpdateFeedback).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowFeedbackItem.CNpacketDelayBudgetDL != nil { + if err := (*qosFlowFeedbackItem.CNpacketDelayBudgetDL).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowFeedbackItem.CNpacketDelayBudgetUL != nil { + if err := (*qosFlowFeedbackItem.CNpacketDelayBudgetUL).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowFeedbackItem.extensions.Present() { + if err := qosFlowFeedbackItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowFeedbackItem *QosFlowFeedbackItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowFeedbackItem = QosFlowFeedbackItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UpdateFeedback, err := r.ReadBit() + if err != nil { + return err + } + p_CNpacketDelayBudgetDL, err := r.ReadBit() + if err != nil { + return err + } + p_CNpacketDelayBudgetUL, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowFeedbackItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_UpdateFeedback { + var v UpdateFeedback + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowFeedbackItem.UpdateFeedback = &v + } + if p_CNpacketDelayBudgetDL { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowFeedbackItem.CNpacketDelayBudgetDL = &v + } + if p_CNpacketDelayBudgetUL { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowFeedbackItem.CNpacketDelayBudgetUL = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, &qosFlowFeedbackItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowFeedbackItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowFeedbackItem []ap.IESpec[ProtocolIEID, QosFlowFeedbackItem] + +func (qosFlowFeedbackItem *QosFlowFeedbackItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowFeedbackItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowFeedbackItem.CNpacketDelayBudgetDL != nil && qosFlowFeedbackItem.CNpacketDelayBudgetDL.Diagnose(d) { + notComprehended = true + } + if qosFlowFeedbackItem.CNpacketDelayBudgetUL != nil && qosFlowFeedbackItem.CNpacketDelayBudgetUL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, qosFlowFeedbackItem.iEExtensions) + return notComprehended +} + +func (qosFlowInformationItem *QosFlowInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowInformationItem, qosFlowInformationItem, qosFlowInformationItem.iEExtensions) + w.WriteBit(qosFlowInformationItem.extensions.Present()) + w.WriteBit(qosFlowInformationItem.DLForwarding != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowInformationItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowInformationItem.DLForwarding != nil { + if err := (*qosFlowInformationItem.DLForwarding).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowInformationItem.extensions.Present() { + if err := qosFlowInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowInformationItem *QosFlowInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowInformationItem = QosFlowInformationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DLForwarding, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowInformationItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLForwarding { + var v DLForwarding + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowInformationItem.DLForwarding = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowInformationItem, qosFlowInformationItem, &qosFlowInformationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowInformationItem = []ap.IESpec[ProtocolIEID, QosFlowInformationItem]{ + { + ID: IDULForwarding, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowInformationItem, r *per.Reader, enc per.Encoding) error { + var v ULForwarding + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ULForwarding = &v + return nil + }, + Encode: func(x *QosFlowInformationItem) (per.Marshaler, bool) { + if x.ULForwarding == nil { + return nil, false + } + return x.ULForwarding, true + }, + }, + { + ID: IDSourceTNLAddrInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowInformationItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceTNLAddrInfo = &v + return nil + }, + Encode: func(x *QosFlowInformationItem) (per.Marshaler, bool) { + if x.SourceTNLAddrInfo == nil { + return nil, false + } + return x.SourceTNLAddrInfo, true + }, + }, + { + ID: IDSourceNodeTNLAddrInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowInformationItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceNodeTNLAddrInfo = &v + return nil + }, + Encode: func(x *QosFlowInformationItem) (per.Marshaler, bool) { + if x.SourceNodeTNLAddrInfo == nil { + return nil, false + } + return x.SourceNodeTNLAddrInfo, true + }, + }, +} + +func (qosFlowInformationItem *QosFlowInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowInformationItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowInformationItem.DLForwarding != nil && qosFlowInformationItem.DLForwarding.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowInformationItem, qosFlowInformationItem, qosFlowInformationItem.iEExtensions) + return notComprehended +} + +func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding.iEExtensions) + w.WriteBit(qosFlowItemWithDataForwarding.extensions.Present()) + w.WriteBit(qosFlowItemWithDataForwarding.DataForwardingAccepted != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowItemWithDataForwarding.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowItemWithDataForwarding.DataForwardingAccepted != nil { + if err := (*qosFlowItemWithDataForwarding.DataForwardingAccepted).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowItemWithDataForwarding.extensions.Present() { + if err := qosFlowItemWithDataForwarding.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowItemWithDataForwarding = QosFlowItemWithDataForwarding{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DataForwardingAccepted, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowItemWithDataForwarding.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DataForwardingAccepted { + var v DataForwardingAccepted + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowItemWithDataForwarding.DataForwardingAccepted = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, &qosFlowItemWithDataForwarding.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowItemWithDataForwarding.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowItemWithDataForwarding = []ap.IESpec[ProtocolIEID, QosFlowItemWithDataForwarding]{ + { + ID: IDCurrentQoSParaSetIndex, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowItemWithDataForwarding, r *per.Reader, enc per.Encoding) error { + var v AlternativeQoSParaSetIndex + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CurrentQoSParaSetIndex = &v + return nil + }, + Encode: func(x *QosFlowItemWithDataForwarding) (per.Marshaler, bool) { + if x.CurrentQoSParaSetIndex == nil { + return nil, false + } + return x.CurrentQoSParaSetIndex, true + }, + }, +} + +func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowItemWithDataForwarding.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowItemWithDataForwarding.DataForwardingAccepted != nil && qosFlowItemWithDataForwarding.DataForwardingAccepted.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding.iEExtensions) + return notComprehended +} + +func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, qosFlowLevelQosParameters.iEExtensions) + w.WriteBit(qosFlowLevelQosParameters.extensions.Present()) + w.WriteBit(qosFlowLevelQosParameters.GBRQosInformation != nil) + w.WriteBit(qosFlowLevelQosParameters.ReflectiveQosAttribute != nil) + w.WriteBit(qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowLevelQosParameters.QosCharacteristics.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowLevelQosParameters.AllocationAndRetentionPriority.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowLevelQosParameters.GBRQosInformation != nil { + if err := (*qosFlowLevelQosParameters.GBRQosInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowLevelQosParameters.ReflectiveQosAttribute != nil { + if err := (*qosFlowLevelQosParameters.ReflectiveQosAttribute).MarshalPER(w, enc); err != nil { + return err + } + } + if qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil { + if err := (*qosFlowLevelQosParameters.AdditionalQosFlowInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowLevelQosParameters.extensions.Present() { + if err := qosFlowLevelQosParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowLevelQosParameters = QosFlowLevelQosParameters{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_GBRQosInformation, err := r.ReadBit() + if err != nil { + return err + } + p_ReflectiveQosAttribute, err := r.ReadBit() + if err != nil { + return err + } + p_AdditionalQosFlowInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowLevelQosParameters.QosCharacteristics).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qosFlowLevelQosParameters.AllocationAndRetentionPriority).UnmarshalPER(r, enc); err != nil { + return err + } + if p_GBRQosInformation { + var v GBRQosInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowLevelQosParameters.GBRQosInformation = &v + } + if p_ReflectiveQosAttribute { + var v ReflectiveQosAttribute + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowLevelQosParameters.ReflectiveQosAttribute = &v + } + if p_AdditionalQosFlowInformation { + var v AdditionalQosFlowInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowLevelQosParameters.AdditionalQosFlowInformation = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, &qosFlowLevelQosParameters.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowLevelQosParameters.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosParameters]{ + { + ID: IDQosMonitoringRequest, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { + var v QosMonitoringRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QosMonitoringRequest = &v + return nil + }, + Encode: func(x *QosFlowLevelQosParameters) (per.Marshaler, bool) { + if x.QosMonitoringRequest == nil { + return nil, false + } + return x.QosMonitoringRequest, true + }, + }, + { + ID: IDQosMonitoringReportingFrequency, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { + var v QosMonitoringReportingFrequency + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QosMonitoringReportingFrequency = &v + return nil + }, + Encode: func(x *QosFlowLevelQosParameters) (per.Marshaler, bool) { + if x.QosMonitoringReportingFrequency == nil { + return nil, false + } + return x.QosMonitoringReportingFrequency, true + }, + }, + { + ID: IDPDUsetQoSParameters, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { + var v PDUsetQoSParameters + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PDUsetQoSParameters = &v + return nil + }, + Encode: func(x *QosFlowLevelQosParameters) (per.Marshaler, bool) { + if x.PDUsetQoSParameters == nil { + return nil, false + } + return x.PDUsetQoSParameters, true + }, + }, + { + ID: IDDLPDUSetInformationMarkingSupportIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { + var v DLPDUSetInformationMarkingSupportIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DLPDUSetInformationMarkingSupportIndication = &v + return nil + }, + Encode: func(x *QosFlowLevelQosParameters) (per.Marshaler, bool) { + if x.DLPDUSetInformationMarkingSupportIndication == nil { + return nil, false + } + return x.DLPDUSetInformationMarkingSupportIndication, true + }, + }, + { + ID: IDMMSID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { + var v MMSID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MMSID = &v + return nil + }, + Encode: func(x *QosFlowLevelQosParameters) (per.Marshaler, bool) { + if x.MMSID == nil { + return nil, false + } + return x.MMSID, true + }, + }, + { + ID: IDIndicationofBitrateAdaptation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { + var v IndicationofBitrateAdaptation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.IndicationofBitrateAdaptation = &v + return nil + }, + Encode: func(x *QosFlowLevelQosParameters) (per.Marshaler, bool) { + if x.IndicationofBitrateAdaptation == nil { + return nil, false + } + return x.IndicationofBitrateAdaptation, true + }, + }, +} + +func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowLevelQosParameters.QosCharacteristics.Diagnose(d) { + notComprehended = true + } + if qosFlowLevelQosParameters.AllocationAndRetentionPriority.Diagnose(d) { + notComprehended = true + } + if qosFlowLevelQosParameters.GBRQosInformation != nil && qosFlowLevelQosParameters.GBRQosInformation.Diagnose(d) { + notComprehended = true + } + if qosFlowLevelQosParameters.ReflectiveQosAttribute != nil && qosFlowLevelQosParameters.ReflectiveQosAttribute.Diagnose(d) { + notComprehended = true + } + if qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil && qosFlowLevelQosParameters.AdditionalQosFlowInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, qosFlowLevelQosParameters.iEExtensions) + return notComprehended +} + +func (qosFlowMappingIndication QosFlowMappingIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumQosFlowMappingIndication.Encode(w, enc, qosFlowMappingIndication) +} + +func (qosFlowMappingIndication *QosFlowMappingIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumQosFlowMappingIndication.Decode(r, enc) + if err != nil { + return err + } + *qosFlowMappingIndication = v + return nil +} + +func (qosFlowMappingIndication QosFlowMappingIndication) Name() string { + return enumQosFlowMappingIndication.Name(qosFlowMappingIndication) +} + +func (qosFlowMappingIndication QosFlowMappingIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumQosFlowMappingIndication.Known(qosFlowMappingIndication) +} + +func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, qosFlowModifyConfirmItem.iEExtensions) + w.WriteBit(qosFlowModifyConfirmItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowModifyConfirmItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowModifyConfirmItem.extensions.Present() { + if err := qosFlowModifyConfirmItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowModifyConfirmItem = QosFlowModifyConfirmItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowModifyConfirmItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, &qosFlowModifyConfirmItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowModifyConfirmItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowModifyConfirmItem []ap.IESpec[ProtocolIEID, QosFlowModifyConfirmItem] + +func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowModifyConfirmItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, qosFlowModifyConfirmItem.iEExtensions) + return notComprehended +} + +func (qosFlowNotifyItem *QosFlowNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowNotifyItem, qosFlowNotifyItem, qosFlowNotifyItem.iEExtensions) + w.WriteBit(qosFlowNotifyItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowNotifyItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowNotifyItem.NotificationCause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowNotifyItem.extensions.Present() { + if err := qosFlowNotifyItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowNotifyItem = QosFlowNotifyItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowNotifyItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qosFlowNotifyItem.NotificationCause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowNotifyItem, qosFlowNotifyItem, &qosFlowNotifyItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowNotifyItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowNotifyItem = []ap.IESpec[ProtocolIEID, QosFlowNotifyItem]{ + { + ID: IDCurrentQoSParaSetIndex, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowNotifyItem, r *per.Reader, enc per.Encoding) error { + var v AlternativeQoSParaSetNotifyIndex + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CurrentQoSParaSetIndex = &v + return nil + }, + Encode: func(x *QosFlowNotifyItem) (per.Marshaler, bool) { + if x.CurrentQoSParaSetIndex == nil { + return nil, false + } + return x.CurrentQoSParaSetIndex, true + }, + }, + { + ID: IDTSCTrafficCharacteristicsFeedback, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowNotifyItem, r *per.Reader, enc per.Encoding) error { + var v TSCTrafficCharacteristicsFeedback + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TSCTrafficCharacteristicsFeedback = &v + return nil + }, + Encode: func(x *QosFlowNotifyItem) (per.Marshaler, bool) { + if x.TSCTrafficCharacteristicsFeedback == nil { + return nil, false + } + return x.TSCTrafficCharacteristicsFeedback, true + }, + }, +} + +func (qosFlowNotifyItem *QosFlowNotifyItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowNotifyItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowNotifyItem.NotificationCause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowNotifyItem, qosFlowNotifyItem, qosFlowNotifyItem.iEExtensions) + return notComprehended +} + +func (qosFlowParametersItem *QosFlowParametersItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowParametersItem, qosFlowParametersItem, qosFlowParametersItem.iEExtensions) + w.WriteBit(qosFlowParametersItem.extensions.Present()) + w.WriteBit(qosFlowParametersItem.AlternativeQoSParaSetList != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowParametersItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowParametersItem.AlternativeQoSParaSetList != nil { + if err := qosFlowParametersItem.AlternativeQoSParaSetList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowParametersItem.extensions.Present() { + if err := qosFlowParametersItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowParametersItem *QosFlowParametersItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowParametersItem = QosFlowParametersItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AlternativeQoSParaSetList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowParametersItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AlternativeQoSParaSetList { + if err := (&qosFlowParametersItem.AlternativeQoSParaSetList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowParametersItem, qosFlowParametersItem, &qosFlowParametersItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowParametersItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowParametersItem = []ap.IESpec[ProtocolIEID, QosFlowParametersItem]{ + { + ID: IDCNPacketDelayBudgetDL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowParametersItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNPacketDelayBudgetDL = &v + return nil + }, + Encode: func(x *QosFlowParametersItem) (per.Marshaler, bool) { + if x.CNPacketDelayBudgetDL == nil { + return nil, false + } + return x.CNPacketDelayBudgetDL, true + }, + }, + { + ID: IDCNPacketDelayBudgetUL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowParametersItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedPacketDelayBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNPacketDelayBudgetUL = &v + return nil + }, + Encode: func(x *QosFlowParametersItem) (per.Marshaler, bool) { + if x.CNPacketDelayBudgetUL == nil { + return nil, false + } + return x.CNPacketDelayBudgetUL, true + }, + }, + { + ID: IDBurstArrivalTimeDownlink, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowParametersItem, r *per.Reader, enc per.Encoding) error { + var v BurstArrivalTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.BurstArrivalTimeDownlink = &v + return nil + }, + Encode: func(x *QosFlowParametersItem) (per.Marshaler, bool) { + if x.BurstArrivalTimeDownlink == nil { + return nil, false + } + return x.BurstArrivalTimeDownlink, true + }, + }, +} + +func (qosFlowParametersItem *QosFlowParametersItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowParametersItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowParametersItem.AlternativeQoSParaSetList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowParametersItem, qosFlowParametersItem, qosFlowParametersItem.iEExtensions) + return notComprehended +} + +func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, qosFlowPerTNLInformation.iEExtensions) + w.WriteBit(qosFlowPerTNLInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowPerTNLInformation.UPTransportLayerInformation.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowPerTNLInformation.AssociatedQosFlowList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowPerTNLInformation.extensions.Present() { + if err := qosFlowPerTNLInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowPerTNLInformation = QosFlowPerTNLInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowPerTNLInformation.UPTransportLayerInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qosFlowPerTNLInformation.AssociatedQosFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, &qosFlowPerTNLInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowPerTNLInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowPerTNLInformation []ap.IESpec[ProtocolIEID, QosFlowPerTNLInformation] + +func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowPerTNLInformation.UPTransportLayerInformation.Diagnose(d) { + notComprehended = true + } + if qosFlowPerTNLInformation.AssociatedQosFlowList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, qosFlowPerTNLInformation.iEExtensions) + return notComprehended +} + +func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem.iEExtensions) + w.WriteBit(qosFlowPerTNLInformationItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowPerTNLInformationItem.extensions.Present() { + if err := qosFlowPerTNLInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowPerTNLInformationItem = QosFlowPerTNLInformationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowPerTNLInformationItem.QosFlowPerTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, &qosFlowPerTNLInformationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowPerTNLInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowPerTNLInformationItem []ap.IESpec[ProtocolIEID, QosFlowPerTNLInformationItem] + +func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem.iEExtensions) + return notComprehended +} + +func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, qosFlowSetupRequestItem.iEExtensions) + w.WriteBit(qosFlowSetupRequestItem.extensions.Present()) + w.WriteBit(qosFlowSetupRequestItem.ERABID != nil) + w.WriteBit(len(ext) > 0) + if err := qosFlowSetupRequestItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowSetupRequestItem.QosFlowLevelQosParameters.MarshalPER(w, enc); err != nil { + return err + } + if qosFlowSetupRequestItem.ERABID != nil { + if err := (*qosFlowSetupRequestItem.ERABID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowSetupRequestItem.extensions.Present() { + if err := qosFlowSetupRequestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowSetupRequestItem = QosFlowSetupRequestItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ERABID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowSetupRequestItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qosFlowSetupRequestItem.QosFlowLevelQosParameters).UnmarshalPER(r, enc); err != nil { + return err + } + if p_ERABID { + var v ERABID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + qosFlowSetupRequestItem.ERABID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, &qosFlowSetupRequestItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowSetupRequestItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowSetupRequestItem = []ap.IESpec[ProtocolIEID, QosFlowSetupRequestItem]{ + { + ID: IDTSCTrafficCharacteristics, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowSetupRequestItem, r *per.Reader, enc per.Encoding) error { + var v TSCTrafficCharacteristics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TSCTrafficCharacteristics = &v + return nil + }, + Encode: func(x *QosFlowSetupRequestItem) (per.Marshaler, bool) { + if x.TSCTrafficCharacteristics == nil { + return nil, false + } + return x.TSCTrafficCharacteristics, true + }, + }, + { + ID: IDRedundantQosFlowIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowSetupRequestItem, r *per.Reader, enc per.Encoding) error { + var v RedundantQosFlowIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantQosFlowIndicator = &v + return nil + }, + Encode: func(x *QosFlowSetupRequestItem) (per.Marshaler, bool) { + if x.RedundantQosFlowIndicator == nil { + return nil, false + } + return x.RedundantQosFlowIndicator, true + }, + }, + { + ID: IDECNMarkingorCongestionInformationReportingRequest, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *QosFlowSetupRequestItem, r *per.Reader, enc per.Encoding) error { + var v ECNMarkingorCongestionInformationReportingRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ECNMarkingorCongestionInformationReportingRequest = &v + return nil + }, + Encode: func(x *QosFlowSetupRequestItem) (per.Marshaler, bool) { + if x.ECNMarkingorCongestionInformationReportingRequest == nil { + return nil, false + } + return x.ECNMarkingorCongestionInformationReportingRequest, true + }, + }, +} + +func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowSetupRequestItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowSetupRequestItem.QosFlowLevelQosParameters.Diagnose(d) { + notComprehended = true + } + if qosFlowSetupRequestItem.ERABID != nil && qosFlowSetupRequestItem.ERABID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, qosFlowSetupRequestItem.iEExtensions) + return notComprehended +} + +func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, qosFlowToBeForwardedItem.iEExtensions) + w.WriteBit(qosFlowToBeForwardedItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowToBeForwardedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowToBeForwardedItem.extensions.Present() { + if err := qosFlowToBeForwardedItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowToBeForwardedItem = QosFlowToBeForwardedItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowToBeForwardedItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, &qosFlowToBeForwardedItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowToBeForwardedItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowToBeForwardedItem []ap.IESpec[ProtocolIEID, QosFlowToBeForwardedItem] + +func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowToBeForwardedItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, qosFlowToBeForwardedItem.iEExtensions) + return notComprehended +} + +func (qosFlowWithCauseItem *QosFlowWithCauseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, qosFlowWithCauseItem.iEExtensions) + w.WriteBit(qosFlowWithCauseItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := qosFlowWithCauseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { + return err + } + if err := qosFlowWithCauseItem.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if qosFlowWithCauseItem.extensions.Present() { + if err := qosFlowWithCauseItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *qosFlowWithCauseItem = QosFlowWithCauseItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&qosFlowWithCauseItem.QosFlowIdentifier).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&qosFlowWithCauseItem.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, &qosFlowWithCauseItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := qosFlowWithCauseItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsQosFlowWithCauseItem []ap.IESpec[ProtocolIEID, QosFlowWithCauseItem] + +func (qosFlowWithCauseItem *QosFlowWithCauseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if qosFlowWithCauseItem.QosFlowIdentifier.Diagnose(d) { + notComprehended = true + } + if qosFlowWithCauseItem.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, qosFlowWithCauseItem.iEExtensions) + return notComprehended +} + +func (qosMonitoringRequest QosMonitoringRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumQosMonitoringRequest.Encode(w, enc, qosMonitoringRequest) +} + +func (qosMonitoringRequest *QosMonitoringRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumQosMonitoringRequest.Decode(r, enc) + if err != nil { + return err + } + *qosMonitoringRequest = v + return nil +} + +func (qosMonitoringRequest QosMonitoringRequest) Name() string { + return enumQosMonitoringRequest.Name(qosMonitoringRequest) +} + +func (qosMonitoringRequest QosMonitoringRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumQosMonitoringRequest.Known(qosMonitoringRequest) +} + +func (rANfeedbacktype *RANfeedbacktype) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{rANfeedbacktype.Proactive != nil, rANfeedbacktype.Reactive != nil, rANfeedbacktype.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case rANfeedbacktype.Proactive != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*rANfeedbacktype.Proactive).MarshalPER(w, enc); err != nil { + return err + } + case rANfeedbacktype.Reactive != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*rANfeedbacktype.Reactive).MarshalPER(w, enc); err != nil { + return err + } + case rANfeedbacktype.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, rANfeedbacktype.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (rANfeedbacktype *RANfeedbacktype) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rANfeedbacktype = RANfeedbacktype{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v RANfeedbacktypeproactive + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + rANfeedbacktype.Proactive = &v + case 1: + var v RANfeedbacktypereactive + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + rANfeedbacktype.Reactive = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + rANfeedbacktype.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (rANfeedbacktype *RANfeedbacktype) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case rANfeedbacktype.Proactive != nil: + return rANfeedbacktype.Proactive.Diagnose(d) + case rANfeedbacktype.Reactive != nil: + return rANfeedbacktype.Reactive.Diagnose(d) + case rANfeedbacktype.ChoiceExtension != nil: + d.Unknown(rANfeedbacktype.ChoiceExtension.ID, rANfeedbacktype.ChoiceExtension.Criticality) + } + return false +} + +func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, rANfeedbacktypeproactive.iEExtensions) + w.WriteBit(rANfeedbacktypeproactive.extensions.Present()) + w.WriteBit(rANfeedbacktypeproactive.PeriodicityRange != nil) + w.WriteBit(len(ext) > 0) + if err := rANfeedbacktypeproactive.BurstArrivalTimeWindow.MarshalPER(w, enc); err != nil { + return err + } + if rANfeedbacktypeproactive.PeriodicityRange != nil { + if err := (*rANfeedbacktypeproactive.PeriodicityRange).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if rANfeedbacktypeproactive.extensions.Present() { + if err := rANfeedbacktypeproactive.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rANfeedbacktypeproactive = RANfeedbacktypeproactive{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PeriodicityRange, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&rANfeedbacktypeproactive.BurstArrivalTimeWindow).UnmarshalPER(r, enc); err != nil { + return err + } + if p_PeriodicityRange { + var v PeriodicityRange + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + rANfeedbacktypeproactive.PeriodicityRange = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, &rANfeedbacktypeproactive.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := rANfeedbacktypeproactive.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRANfeedbacktypeproactive []ap.IESpec[ProtocolIEID, RANfeedbacktypeproactive] + +func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if rANfeedbacktypeproactive.BurstArrivalTimeWindow.Diagnose(d) { + notComprehended = true + } + if rANfeedbacktypeproactive.PeriodicityRange != nil && rANfeedbacktypeproactive.PeriodicityRange.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, rANfeedbacktypeproactive.iEExtensions) + return notComprehended +} + +func (rANfeedbacktypereactive *RANfeedbacktypereactive) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, rANfeedbacktypereactive.iEExtensions) + w.WriteBit(rANfeedbacktypereactive.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := rANfeedbacktypereactive.CapabilityForBATAdaptation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if rANfeedbacktypereactive.extensions.Present() { + if err := rANfeedbacktypereactive.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (rANfeedbacktypereactive *RANfeedbacktypereactive) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rANfeedbacktypereactive = RANfeedbacktypereactive{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&rANfeedbacktypereactive.CapabilityForBATAdaptation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, &rANfeedbacktypereactive.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := rANfeedbacktypereactive.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRANfeedbacktypereactive []ap.IESpec[ProtocolIEID, RANfeedbacktypereactive] + +func (rANfeedbacktypereactive *RANfeedbacktypereactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if rANfeedbacktypereactive.CapabilityForBATAdaptation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, rANfeedbacktypereactive.iEExtensions) + return notComprehended +} + +func (rANfeedbacktypereactiveCapabilityForBATAdaptation RANfeedbacktypereactiveCapabilityForBATAdaptation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRANfeedbacktypereactiveCapabilityForBATAdaptation.Encode(w, enc, rANfeedbacktypereactiveCapabilityForBATAdaptation) +} + +func (rANfeedbacktypereactiveCapabilityForBATAdaptation *RANfeedbacktypereactiveCapabilityForBATAdaptation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRANfeedbacktypereactiveCapabilityForBATAdaptation.Decode(r, enc) + if err != nil { + return err + } + *rANfeedbacktypereactiveCapabilityForBATAdaptation = v + return nil +} + +func (rANfeedbacktypereactiveCapabilityForBATAdaptation RANfeedbacktypereactiveCapabilityForBATAdaptation) Name() string { + return enumRANfeedbacktypereactiveCapabilityForBATAdaptation.Name(rANfeedbacktypereactiveCapabilityForBATAdaptation) +} + +func (rANfeedbacktypereactiveCapabilityForBATAdaptation RANfeedbacktypereactiveCapabilityForBATAdaptation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRANfeedbacktypereactiveCapabilityForBATAdaptation.Known(rANfeedbacktypereactiveCapabilityForBATAdaptation) +} + +func (rATInformation RATInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRATInformation.Encode(w, enc, rATInformation) +} + +func (rATInformation *RATInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRATInformation.Decode(r, enc) + if err != nil { + return err + } + *rATInformation = v + return nil +} + +func (rATInformation RATInformation) Name() string { + return enumRATInformation.Name(rATInformation) +} + +func (rATInformation RATInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRATInformation.Known(rATInformation) +} + +func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + w.WriteBit(rATRestrictionsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := rATRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := rATRestrictionsItem.RATRestrictionInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if rATRestrictionsItem.extensions.Present() { + if err := rATRestrictionsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rATRestrictionsItem = RATRestrictionsItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&rATRestrictionsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&rATRestrictionsItem.RATRestrictionInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := rATRestrictionsItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRATRestrictionsItem = []ap.IESpec[ProtocolIEID, RATRestrictionsItem]{ + { + ID: IDExtendedRATRestrictionInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *RATRestrictionsItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedRATRestrictionInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedRATRestrictionInformation = &v + return nil + }, + Encode: func(x *RATRestrictionsItem) (per.Marshaler, bool) { + if x.ExtendedRATRestrictionInformation == nil { + return nil, false + } + return x.ExtendedRATRestrictionInformation, true + }, + }, +} + +func (rATRestrictionsItem *RATRestrictionsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + return notComprehended +} + +func (rRCEstablishmentCause RRCEstablishmentCause) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRRCEstablishmentCause.Encode(w, enc, rRCEstablishmentCause) +} + +func (rRCEstablishmentCause *RRCEstablishmentCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRRCEstablishmentCause.Decode(r, enc) + if err != nil { + return err + } + *rRCEstablishmentCause = v + return nil +} + +func (rRCEstablishmentCause RRCEstablishmentCause) Name() string { + return enumRRCEstablishmentCause.Name(rRCEstablishmentCause) +} + +func (rRCEstablishmentCause RRCEstablishmentCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRRCEstablishmentCause.Known(rRCEstablishmentCause) +} + +func (rRCInactiveTransitionReportRequest RRCInactiveTransitionReportRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRRCInactiveTransitionReportRequest.Encode(w, enc, rRCInactiveTransitionReportRequest) +} + +func (rRCInactiveTransitionReportRequest *RRCInactiveTransitionReportRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRRCInactiveTransitionReportRequest.Decode(r, enc) + if err != nil { + return err + } + *rRCInactiveTransitionReportRequest = v + return nil +} + +func (rRCInactiveTransitionReportRequest RRCInactiveTransitionReportRequest) Name() string { + return enumRRCInactiveTransitionReportRequest.Name(rRCInactiveTransitionReportRequest) +} + +func (rRCInactiveTransitionReportRequest RRCInactiveTransitionReportRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRRCInactiveTransitionReportRequest.Known(rRCInactiveTransitionReportRequest) +} + +func (rRCState RRCState) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRRCState.Encode(w, enc, rRCState) +} + +func (rRCState *RRCState) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRRCState.Decode(r, enc) + if err != nil { + return err + } + *rRCState = v + return nil +} + +func (rRCState RRCState) Name() string { + return enumRRCState.Name(rRCState) +} + +func (rRCState RRCState) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRRCState.Known(rRCState) +} + +func (rSN RSN) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRSN.Encode(w, enc, rSN) +} + +func (rSN *RSN) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRSN.Decode(r, enc) + if err != nil { + return err + } + *rSN = v + return nil +} + +func (rSN RSN) Name() string { + return enumRSN.Name(rSN) +} + +func (rSN RSN) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRSN.Known(rSN) +} + +func (rSPPFlowBitRates *RSPPFlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRSPPFlowBitRates, rSPPFlowBitRates, rSPPFlowBitRates.iEExtensions) + w.WriteBit(rSPPFlowBitRates.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := rSPPFlowBitRates.GuaranteedFlowBitRate.MarshalPER(w, enc); err != nil { + return err + } + if err := rSPPFlowBitRates.MaximumFlowBitRate.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if rSPPFlowBitRates.extensions.Present() { + if err := rSPPFlowBitRates.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (rSPPFlowBitRates *RSPPFlowBitRates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rSPPFlowBitRates = RSPPFlowBitRates{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&rSPPFlowBitRates.GuaranteedFlowBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&rSPPFlowBitRates.MaximumFlowBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRSPPFlowBitRates, rSPPFlowBitRates, &rSPPFlowBitRates.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := rSPPFlowBitRates.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRSPPFlowBitRates []ap.IESpec[ProtocolIEID, RSPPFlowBitRates] + +func (rSPPFlowBitRates *RSPPFlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if rSPPFlowBitRates.GuaranteedFlowBitRate.Diagnose(d) { + notComprehended = true + } + if rSPPFlowBitRates.MaximumFlowBitRate.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRSPPFlowBitRates, rSPPFlowBitRates, rSPPFlowBitRates.iEExtensions) + return notComprehended +} + +func (rSPPQoSFlowItem *RSPPQoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, rSPPQoSFlowItem.iEExtensions) + w.WriteBit(rSPPQoSFlowItem.extensions.Present()) + w.WriteBit(rSPPQoSFlowItem.RSPPFlowBitRates != nil) + w.WriteBit(rSPPQoSFlowItem.Range != nil) + w.WriteBit(len(ext) > 0) + if err := rSPPQoSFlowItem.PQI.MarshalPER(w, enc); err != nil { + return err + } + if rSPPQoSFlowItem.RSPPFlowBitRates != nil { + if err := (*rSPPQoSFlowItem.RSPPFlowBitRates).MarshalPER(w, enc); err != nil { + return err + } + } + if rSPPQoSFlowItem.Range != nil { + if err := (*rSPPQoSFlowItem.Range).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if rSPPQoSFlowItem.extensions.Present() { + if err := rSPPQoSFlowItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (rSPPQoSFlowItem *RSPPQoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rSPPQoSFlowItem = RSPPQoSFlowItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_RSPPFlowBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_Range, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&rSPPQoSFlowItem.PQI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_RSPPFlowBitRates { + var v RSPPFlowBitRates + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + rSPPQoSFlowItem.RSPPFlowBitRates = &v + } + if p_Range { + var v RangeType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + rSPPQoSFlowItem.Range = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, &rSPPQoSFlowItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := rSPPQoSFlowItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRSPPQoSFlowItem []ap.IESpec[ProtocolIEID, RSPPQoSFlowItem] + +func (rSPPQoSFlowItem *RSPPQoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if rSPPQoSFlowItem.PQI.Diagnose(d) { + notComprehended = true + } + if rSPPQoSFlowItem.RSPPFlowBitRates != nil && rSPPQoSFlowItem.RSPPFlowBitRates.Diagnose(d) { + notComprehended = true + } + if rSPPQoSFlowItem.Range != nil && rSPPQoSFlowItem.Range.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, rSPPQoSFlowItem.iEExtensions) + return notComprehended +} + +func (rangeType RangeType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRangeType.Encode(w, enc, rangeType) +} + +func (rangeType *RangeType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRangeType.Decode(r, enc) + if err != nil { + return err + } + *rangeType = v + return nil +} + +func (rangeType RangeType) Name() string { + return enumRangeType.Name(rangeType) +} + +func (rangeType RangeType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRangeType.Known(rangeType) +} + +func (recommendedCellItem *RecommendedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRecommendedCellItem, recommendedCellItem, recommendedCellItem.iEExtensions) + w.WriteBit(recommendedCellItem.extensions.Present()) + w.WriteBit(recommendedCellItem.TimeStayedInCell != nil) + w.WriteBit(len(ext) > 0) + if err := recommendedCellItem.NGRANCGI.MarshalPER(w, enc); err != nil { + return err + } + if recommendedCellItem.TimeStayedInCell != nil { + if err := (*recommendedCellItem.TimeStayedInCell).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedCellItem.extensions.Present() { + if err := recommendedCellItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedCellItem *RecommendedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedCellItem = RecommendedCellItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TimeStayedInCell, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedCellItem.NGRANCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TimeStayedInCell { + var v RecommendedCellItemTimeStayedInCell + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + recommendedCellItem.TimeStayedInCell = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellItem, recommendedCellItem, &recommendedCellItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedCellItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedCellItem []ap.IESpec[ProtocolIEID, RecommendedCellItem] + +func (recommendedCellItem *RecommendedCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if recommendedCellItem.NGRANCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRecommendedCellItem, recommendedCellItem, recommendedCellItem.iEExtensions) + return notComprehended +} + +func (recommendedCellsForPaging *RecommendedCellsForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRecommendedCellsForPaging, recommendedCellsForPaging, recommendedCellsForPaging.iEExtensions) + w.WriteBit(recommendedCellsForPaging.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := recommendedCellsForPaging.RecommendedCellList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedCellsForPaging.extensions.Present() { + if err := recommendedCellsForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedCellsForPaging *RecommendedCellsForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedCellsForPaging = RecommendedCellsForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedCellsForPaging.RecommendedCellList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, &recommendedCellsForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedCellsForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedCellsForPaging []ap.IESpec[ProtocolIEID, RecommendedCellsForPaging] + +func (recommendedCellsForPaging *RecommendedCellsForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if recommendedCellsForPaging.RecommendedCellList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, recommendedCellsForPaging.iEExtensions) + return notComprehended +} + +func (recommendedRANNodeItem *RecommendedRANNodeItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRecommendedRANNodeItem, recommendedRANNodeItem, recommendedRANNodeItem.iEExtensions) + w.WriteBit(recommendedRANNodeItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := recommendedRANNodeItem.AMFPagingTarget.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedRANNodeItem.extensions.Present() { + if err := recommendedRANNodeItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedRANNodeItem *RecommendedRANNodeItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedRANNodeItem = RecommendedRANNodeItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedRANNodeItem.AMFPagingTarget).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedRANNodeItem, recommendedRANNodeItem, &recommendedRANNodeItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedRANNodeItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedRANNodeItem []ap.IESpec[ProtocolIEID, RecommendedRANNodeItem] + +func (recommendedRANNodeItem *RecommendedRANNodeItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if recommendedRANNodeItem.AMFPagingTarget.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRecommendedRANNodeItem, recommendedRANNodeItem, recommendedRANNodeItem.iEExtensions) + return notComprehended +} + +func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, recommendedRANNodesForPaging.iEExtensions) + w.WriteBit(recommendedRANNodesForPaging.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := recommendedRANNodesForPaging.RecommendedRANNodeList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedRANNodesForPaging.extensions.Present() { + if err := recommendedRANNodesForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedRANNodesForPaging = RecommendedRANNodesForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedRANNodesForPaging.RecommendedRANNodeList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, &recommendedRANNodesForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedRANNodesForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedRANNodesForPaging []ap.IESpec[ProtocolIEID, RecommendedRANNodesForPaging] + +func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if recommendedRANNodesForPaging.RecommendedRANNodeList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, recommendedRANNodesForPaging.iEExtensions) + return notComprehended +} + +func (redCapIndication RedCapIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRedCapIndication.Encode(w, enc, redCapIndication) +} + +func (redCapIndication *RedCapIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRedCapIndication.Decode(r, enc) + if err != nil { + return err + } + *redCapIndication = v + return nil +} + +func (redCapIndication RedCapIndication) Name() string { + return enumRedCapIndication.Name(redCapIndication) +} + +func (redCapIndication RedCapIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRedCapIndication.Known(redCapIndication) +} + +func (redirectionVoiceFallback RedirectionVoiceFallback) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRedirectionVoiceFallback.Encode(w, enc, redirectionVoiceFallback) +} + +func (redirectionVoiceFallback *RedirectionVoiceFallback) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRedirectionVoiceFallback.Decode(r, enc) + if err != nil { + return err + } + *redirectionVoiceFallback = v + return nil +} + +func (redirectionVoiceFallback RedirectionVoiceFallback) Name() string { + return enumRedirectionVoiceFallback.Name(redirectionVoiceFallback) +} + +func (redirectionVoiceFallback RedirectionVoiceFallback) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRedirectionVoiceFallback.Known(redirectionVoiceFallback) +} + +func (redundantPDUSessionInformation *RedundantPDUSessionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, redundantPDUSessionInformation.iEExtensions) + w.WriteBit(redundantPDUSessionInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := redundantPDUSessionInformation.RSN.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if redundantPDUSessionInformation.extensions.Present() { + if err := redundantPDUSessionInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (redundantPDUSessionInformation *RedundantPDUSessionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *redundantPDUSessionInformation = RedundantPDUSessionInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&redundantPDUSessionInformation.RSN).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, &redundantPDUSessionInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := redundantPDUSessionInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRedundantPDUSessionInformation = []ap.IESpec[ProtocolIEID, RedundantPDUSessionInformation]{ + { + ID: IDPDUSessionPairID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *RedundantPDUSessionInformation, r *per.Reader, enc per.Encoding) error { + var v PDUSessionPairID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PDUSessionPairID = &v + return nil + }, + Encode: func(x *RedundantPDUSessionInformation) (per.Marshaler, bool) { + if x.PDUSessionPairID == nil { + return nil, false + } + return x.PDUSessionPairID, true + }, + }, +} + +func (redundantPDUSessionInformation *RedundantPDUSessionInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if redundantPDUSessionInformation.RSN.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, redundantPDUSessionInformation.iEExtensions) + return notComprehended +} + +func (redundantQosFlowIndicator RedundantQosFlowIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRedundantQosFlowIndicator.Encode(w, enc, redundantQosFlowIndicator) +} + +func (redundantQosFlowIndicator *RedundantQosFlowIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRedundantQosFlowIndicator.Decode(r, enc) + if err != nil { + return err + } + *redundantQosFlowIndicator = v + return nil +} + +func (redundantQosFlowIndicator RedundantQosFlowIndicator) Name() string { + return enumRedundantQosFlowIndicator.Name(redundantQosFlowIndicator) +} + +func (reflectiveQosAttribute ReflectiveQosAttribute) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumReflectiveQosAttribute.Encode(w, enc, reflectiveQosAttribute) +} + +func (reflectiveQosAttribute *ReflectiveQosAttribute) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumReflectiveQosAttribute.Decode(r, enc) + if err != nil { + return err + } + *reflectiveQosAttribute = v + return nil +} + +func (reflectiveQosAttribute ReflectiveQosAttribute) Name() string { + return enumReflectiveQosAttribute.Name(reflectiveQosAttribute) +} + +func (reflectiveQosAttribute ReflectiveQosAttribute) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumReflectiveQosAttribute.Known(reflectiveQosAttribute) +} + +func (reportAmountMDT ReportAmountMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumReportAmountMDT.Encode(w, enc, reportAmountMDT) +} + +func (reportAmountMDT *ReportAmountMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumReportAmountMDT.Decode(r, enc) + if err != nil { + return err + } + *reportAmountMDT = v + return nil +} + +func (reportAmountMDT ReportAmountMDT) Name() string { + return enumReportAmountMDT.Name(reportAmountMDT) +} + +func (reportArea ReportArea) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumReportArea.Encode(w, enc, reportArea) +} + +func (reportArea *ReportArea) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumReportArea.Decode(r, enc) + if err != nil { + return err + } + *reportArea = v + return nil +} + +func (reportArea ReportArea) Name() string { + return enumReportArea.Name(reportArea) +} + +func (reportArea ReportArea) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumReportArea.Known(reportArea) +} + +func (reportIntervalMDT ReportIntervalMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumReportIntervalMDT.Encode(w, enc, reportIntervalMDT) +} + +func (reportIntervalMDT *ReportIntervalMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumReportIntervalMDT.Decode(r, enc) + if err != nil { + return err + } + *reportIntervalMDT = v + return nil +} + +func (reportIntervalMDT ReportIntervalMDT) Name() string { + return enumReportIntervalMDT.Name(reportIntervalMDT) +} + +func (reportType *ReportType) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{reportType.EventBasedReporting != nil, reportType.PeriodicReporting != nil, reportType.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case reportType.EventBasedReporting != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*reportType.EventBasedReporting).MarshalPER(w, enc); err != nil { + return err + } + case reportType.PeriodicReporting != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*reportType.PeriodicReporting).MarshalPER(w, enc); err != nil { + return err + } + case reportType.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, reportType.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (reportType *ReportType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *reportType = ReportType{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v EventBasedReportingIEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + reportType.EventBasedReporting = &v + case 1: + var v PeriodicReportingIEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + reportType.PeriodicReporting = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + reportType.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (reportType *ReportType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case reportType.EventBasedReporting != nil: + return reportType.EventBasedReporting.Diagnose(d) + case reportType.PeriodicReporting != nil: + return reportType.PeriodicReporting.Diagnose(d) + case reportType.ChoiceExtension != nil: + d.Unknown(reportType.ChoiceExtension.ID, reportType.ChoiceExtension.Criticality) + } + return false +} + +func (reportingPeriodicity ReportingPeriodicity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumReportingPeriodicity.Encode(w, enc, reportingPeriodicity) +} + +func (reportingPeriodicity *ReportingPeriodicity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumReportingPeriodicity.Decode(r, enc) + if err != nil { + return err + } + *reportingPeriodicity = v + return nil +} + +func (reportingPeriodicity ReportingPeriodicity) Name() string { + return enumReportingPeriodicity.Name(reportingPeriodicity) +} + +func (reportingPeriodicity ReportingPeriodicity) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumReportingPeriodicity.Known(reportingPeriodicity) +} + +func (reportingSystem *ReportingSystem) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{reportingSystem.EUTRAN != nil, reportingSystem.NGRAN != nil, reportingSystem.NoReporting != nil, reportingSystem.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case reportingSystem.EUTRAN != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { + return err + } + if err := (*reportingSystem.EUTRAN).MarshalPER(w, enc); err != nil { + return err + } + case reportingSystem.NGRAN != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { + return err + } + if err := (*reportingSystem.NGRAN).MarshalPER(w, enc); err != nil { + return err + } + case reportingSystem.NoReporting != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { + return err + } + if err := (*reportingSystem.NoReporting).MarshalPER(w, enc); err != nil { + return err + } + case reportingSystem.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, reportingSystem.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (reportingSystem *ReportingSystem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *reportingSystem = ReportingSystem{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) + if err != nil { + return err + } + switch idx { + case 0: + var v EUTRANReportingSystemIEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + reportingSystem.EUTRAN = &v + case 1: + var v NGRANReportingSystemIEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + reportingSystem.NGRAN = &v + case 2: + var v per.Null + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + reportingSystem.NoReporting = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + reportingSystem.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (reportingSystem *ReportingSystem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case reportingSystem.EUTRAN != nil: + return reportingSystem.EUTRAN.Diagnose(d) + case reportingSystem.NGRAN != nil: + return reportingSystem.NGRAN.Diagnose(d) + case reportingSystem.NoReporting != nil: + case reportingSystem.ChoiceExtension != nil: + d.Unknown(reportingSystem.ChoiceExtension.ID, reportingSystem.ChoiceExtension.Criticality) + } + return false +} + +func (requestedNSSAIItem *RequestedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRequestedNSSAIItem, requestedNSSAIItem, requestedNSSAIItem.iEExtensions) + w.WriteBit(requestedNSSAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := requestedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if requestedNSSAIItem.extensions.Present() { + if err := requestedNSSAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (requestedNSSAIItem *RequestedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *requestedNSSAIItem = RequestedNSSAIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&requestedNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRequestedNSSAIItem, requestedNSSAIItem, &requestedNSSAIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := requestedNSSAIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRequestedNSSAIItem []ap.IESpec[ProtocolIEID, RequestedNSSAIItem] + +func (requestedNSSAIItem *RequestedNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if requestedNSSAIItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRequestedNSSAIItem, requestedNSSAIItem, requestedNSSAIItem.iEExtensions) + return notComprehended +} + +func (resetAll ResetAll) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumResetAll.Encode(w, enc, resetAll) +} + +func (resetAll *ResetAll) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumResetAll.Decode(r, enc) + if err != nil { + return err + } + *resetAll = v + return nil +} + +func (resetAll ResetAll) Name() string { + return enumResetAll.Name(resetAll) +} + +func (resetAll ResetAll) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumResetAll.Known(resetAll) +} + +func (resetType *ResetType) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{resetType.NGInterface != nil, resetType.PartOfNGInterface != nil, resetType.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case resetType.NGInterface != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*resetType.NGInterface).MarshalPER(w, enc); err != nil { + return err + } + case resetType.PartOfNGInterface != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*resetType.PartOfNGInterface).MarshalPER(w, enc); err != nil { + return err + } + case resetType.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, resetType.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (resetType *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *resetType = ResetType{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v ResetAll + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + resetType.NGInterface = &v + case 1: + var v UEAssociatedLogicalNGConnectionList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + resetType.PartOfNGInterface = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + resetType.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (resetType *ResetType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case resetType.NGInterface != nil: + return resetType.NGInterface.Diagnose(d) + case resetType.PartOfNGInterface != nil: + return resetType.PartOfNGInterface.Diagnose(d) + case resetType.ChoiceExtension != nil: + d.Unknown(resetType.ChoiceExtension.ID, resetType.ChoiceExtension.Criticality) + } + return false +} + +func (resourceStatusReportingSystem *ResourceStatusReportingSystem) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{resourceStatusReportingSystem.EUTRANReportingStatus != nil, resourceStatusReportingSystem.NGRANReportingStatus != nil, resourceStatusReportingSystem.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case resourceStatusReportingSystem.EUTRANReportingStatus != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*resourceStatusReportingSystem.EUTRANReportingStatus).MarshalPER(w, enc); err != nil { + return err + } + case resourceStatusReportingSystem.NGRANReportingStatus != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*resourceStatusReportingSystem.NGRANReportingStatus).MarshalPER(w, enc); err != nil { + return err + } + case resourceStatusReportingSystem.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, resourceStatusReportingSystem.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (resourceStatusReportingSystem *ResourceStatusReportingSystem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *resourceStatusReportingSystem = ResourceStatusReportingSystem{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v EUTRANReportingStatusIEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + resourceStatusReportingSystem.EUTRANReportingStatus = &v + case 1: + var v NGRANReportingStatusIEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + resourceStatusReportingSystem.NGRANReportingStatus = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + resourceStatusReportingSystem.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (resourceStatusReportingSystem *ResourceStatusReportingSystem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case resourceStatusReportingSystem.EUTRANReportingStatus != nil: + return resourceStatusReportingSystem.EUTRANReportingStatus.Diagnose(d) + case resourceStatusReportingSystem.NGRANReportingStatus != nil: + return resourceStatusReportingSystem.NGRANReportingStatus.Diagnose(d) + case resourceStatusReportingSystem.ChoiceExtension != nil: + d.Unknown(resourceStatusReportingSystem.ChoiceExtension.ID, resourceStatusReportingSystem.ChoiceExtension.Criticality) + } + return false +} + +func (sLPositioningRangingAuthorized SLPositioningRangingAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSLPositioningRangingAuthorized.Encode(w, enc, sLPositioningRangingAuthorized) +} + +func (sLPositioningRangingAuthorized *SLPositioningRangingAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSLPositioningRangingAuthorized.Decode(r, enc) + if err != nil { + return err + } + *sLPositioningRangingAuthorized = v + return nil +} + +func (sLPositioningRangingAuthorized SLPositioningRangingAuthorized) Name() string { + return enumSLPositioningRangingAuthorized.Name(sLPositioningRangingAuthorized) +} + +func (sLPositioningRangingAuthorized SLPositioningRangingAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSLPositioningRangingAuthorized.Known(sLPositioningRangingAuthorized) +} + +func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters.iEExtensions) + w.WriteBit(sLPositioningRangingQoSParameters.extensions.Present()) + w.WriteBit(sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates != nil) + w.WriteBit(len(ext) > 0) + if err := sLPositioningRangingQoSParameters.RSPPQoSFlowList.MarshalPER(w, enc); err != nil { + return err + } + if sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates != nil { + if err := (*sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sLPositioningRangingQoSParameters.extensions.Present() { + if err := sLPositioningRangingQoSParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sLPositioningRangingQoSParameters = SLPositioningRangingQoSParameters{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_RSPPLinkAggregateBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sLPositioningRangingQoSParameters.RSPPQoSFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_RSPPLinkAggregateBitRates { + var v BitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, &sLPositioningRangingQoSParameters.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sLPositioningRangingQoSParameters.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSLPositioningRangingQoSParameters []ap.IESpec[ProtocolIEID, SLPositioningRangingQoSParameters] + +func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sLPositioningRangingQoSParameters.RSPPQoSFlowList.Diagnose(d) { + notComprehended = true + } + if sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates != nil && sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters.iEExtensions) + return notComprehended +} + +func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo.iEExtensions) + w.WriteBit(sLPositioningRangingServiceInfo.extensions.Present()) + w.WriteBit(sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters != nil) + w.WriteBit(len(ext) > 0) + if err := sLPositioningRangingServiceInfo.SLPositioningRangingAuthorized.MarshalPER(w, enc); err != nil { + return err + } + if sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters != nil { + if err := (*sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sLPositioningRangingServiceInfo.extensions.Present() { + if err := sLPositioningRangingServiceInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sLPositioningRangingServiceInfo = SLPositioningRangingServiceInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SLPositioningRangingQoSParameters, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sLPositioningRangingServiceInfo.SLPositioningRangingAuthorized).UnmarshalPER(r, enc); err != nil { + return err + } + if p_SLPositioningRangingQoSParameters { + var v SLPositioningRangingQoSParameters + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, &sLPositioningRangingServiceInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sLPositioningRangingServiceInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSLPositioningRangingServiceInfo []ap.IESpec[ProtocolIEID, SLPositioningRangingServiceInfo] + +func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sLPositioningRangingServiceInfo.SLPositioningRangingAuthorized.Diagnose(d) { + notComprehended = true + } + if sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters != nil && sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo.iEExtensions) + return notComprehended +} + +func (sNPNBasedMDT *SNPNBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNPNBasedMDT, sNPNBasedMDT, sNPNBasedMDT.iEExtensions) + w.WriteBit(sNPNBasedMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sNPNBasedMDT.SNPNListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNPNBasedMDT.extensions.Present() { + if err := sNPNBasedMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNPNBasedMDT *SNPNBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNPNBasedMDT = SNPNBasedMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNPNBasedMDT.SNPNListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNBasedMDT, sNPNBasedMDT, &sNPNBasedMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNPNBasedMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNPNBasedMDT []ap.IESpec[ProtocolIEID, SNPNBasedMDT] + +func (sNPNBasedMDT *SNPNBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sNPNBasedMDT.SNPNListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSNPNBasedMDT, sNPNBasedMDT, sNPNBasedMDT.iEExtensions) + return notComprehended +} + +func (sNPNCellBasedMDT *SNPNCellBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, sNPNCellBasedMDT.iEExtensions) + w.WriteBit(sNPNCellBasedMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sNPNCellBasedMDT.SNPNcellIdListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNPNCellBasedMDT.extensions.Present() { + if err := sNPNCellBasedMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNPNCellBasedMDT *SNPNCellBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNPNCellBasedMDT = SNPNCellBasedMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNPNCellBasedMDT.SNPNcellIdListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, &sNPNCellBasedMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNPNCellBasedMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNPNCellBasedMDT []ap.IESpec[ProtocolIEID, SNPNCellBasedMDT] + +func (sNPNCellBasedMDT *SNPNCellBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sNPNCellBasedMDT.SNPNcellIdListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, sNPNCellBasedMDT.iEExtensions) + return notComprehended +} + +func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem.iEExtensions) + w.WriteBit(sNPNCellIdListforMDTItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sNPNCellIdListforMDTItem.NRCGI.MarshalPER(w, enc); err != nil { + return err + } + if err := sNPNCellIdListforMDTItem.NID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNPNCellIdListforMDTItem.extensions.Present() { + if err := sNPNCellIdListforMDTItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNPNCellIdListforMDTItem = SNPNCellIdListforMDTItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNPNCellIdListforMDTItem.NRCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sNPNCellIdListforMDTItem.NID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, &sNPNCellIdListforMDTItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNPNCellIdListforMDTItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNPNCellIdListforMDTItem []ap.IESpec[ProtocolIEID, SNPNCellIdListforMDTItem] + +func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sNPNCellIdListforMDTItem.NRCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem.iEExtensions) + return notComprehended +} + +func (sNPNListforMDTItem *SNPNListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNPNListforMDTItem, sNPNListforMDTItem, sNPNListforMDTItem.iEExtensions) + w.WriteBit(sNPNListforMDTItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sNPNListforMDTItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := sNPNListforMDTItem.NID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNPNListforMDTItem.extensions.Present() { + if err := sNPNListforMDTItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNPNListforMDTItem *SNPNListforMDTItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNPNListforMDTItem = SNPNListforMDTItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNPNListforMDTItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sNPNListforMDTItem.NID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNListforMDTItem, sNPNListforMDTItem, &sNPNListforMDTItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNPNListforMDTItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNPNListforMDTItem []ap.IESpec[ProtocolIEID, SNPNListforMDTItem] + +func (sNPNListforMDTItem *SNPNListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSNPNListforMDTItem, sNPNListforMDTItem, sNPNListforMDTItem.iEExtensions) + return notComprehended +} + +func (sNPNMobilityInformation *SNPNMobilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNPNMobilityInformation, sNPNMobilityInformation, sNPNMobilityInformation.iEExtensions) + w.WriteBit(sNPNMobilityInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sNPNMobilityInformation.ServingNID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNPNMobilityInformation.extensions.Present() { + if err := sNPNMobilityInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNPNMobilityInformation *SNPNMobilityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNPNMobilityInformation = SNPNMobilityInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNPNMobilityInformation.ServingNID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNMobilityInformation, sNPNMobilityInformation, &sNPNMobilityInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNPNMobilityInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNPNMobilityInformation = []ap.IESpec[ProtocolIEID, SNPNMobilityInformation]{ + { + ID: IDEquivalentSNPNsList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *SNPNMobilityInformation, r *per.Reader, enc per.Encoding) error { + var v EquivalentSNPNsList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EquivalentSNPNsList = v + return nil + }, + Encode: func(x *SNPNMobilityInformation) (per.Marshaler, bool) { + if len(x.EquivalentSNPNsList) == 0 { + return nil, false + } + return x.EquivalentSNPNsList, true + }, + }, +} + +func (sNPNMobilityInformation *SNPNMobilityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSNPNMobilityInformation, sNPNMobilityInformation, sNPNMobilityInformation.iEExtensions) + return notComprehended +} + +func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, sNPNTAIBasedMDT.iEExtensions) + w.WriteBit(sNPNTAIBasedMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sNPNTAIBasedMDT.SNPNTAIListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNPNTAIBasedMDT.extensions.Present() { + if err := sNPNTAIBasedMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNPNTAIBasedMDT = SNPNTAIBasedMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNPNTAIBasedMDT.SNPNTAIListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, &sNPNTAIBasedMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNPNTAIBasedMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNPNTAIBasedMDT []ap.IESpec[ProtocolIEID, SNPNTAIBasedMDT] + +func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sNPNTAIBasedMDT.SNPNTAIListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, sNPNTAIBasedMDT.iEExtensions) + return notComprehended +} + +func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, sNPNTAIListforMDTItem.iEExtensions) + w.WriteBit(sNPNTAIListforMDTItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sNPNTAIListforMDTItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + if err := sNPNTAIListforMDTItem.NID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNPNTAIListforMDTItem.extensions.Present() { + if err := sNPNTAIListforMDTItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNPNTAIListforMDTItem = SNPNTAIListforMDTItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNPNTAIListforMDTItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sNPNTAIListforMDTItem.NID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, &sNPNTAIListforMDTItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNPNTAIListforMDTItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNPNTAIListforMDTItem []ap.IESpec[ProtocolIEID, SNPNTAIListforMDTItem] + +func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sNPNTAIListforMDTItem.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, sNPNTAIListforMDTItem.iEExtensions) + return notComprehended +} + +func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSNSSAI, sNSSAI, sNSSAI.iEExtensions) + w.WriteBit(sNSSAI.extensions.Present()) + w.WriteBit(sNSSAI.SD != nil) + w.WriteBit(len(ext) > 0) + if err := sNSSAI.SST.MarshalPER(w, enc); err != nil { + return err + } + if sNSSAI.SD != nil { + if err := (*sNSSAI.SD).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sNSSAI.extensions.Present() { + if err := sNSSAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sNSSAI = SNSSAI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SD, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sNSSAI.SST).UnmarshalPER(r, enc); err != nil { + return err + } + if p_SD { + var v SD + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sNSSAI.SD = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNSSAI, sNSSAI, &sNSSAI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sNSSAI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSNSSAI []ap.IESpec[ProtocolIEID, SNSSAI] + +func (sNSSAI *SNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSNSSAI, sNSSAI, sNSSAI.iEExtensions) + return notComprehended +} + +func (sRVCCOperationPossible SRVCCOperationPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSRVCCOperationPossible.Encode(w, enc, sRVCCOperationPossible) +} + +func (sRVCCOperationPossible *SRVCCOperationPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSRVCCOperationPossible.Decode(r, enc) + if err != nil { + return err + } + *sRVCCOperationPossible = v + return nil +} + +func (sRVCCOperationPossible SRVCCOperationPossible) Name() string { + return enumSRVCCOperationPossible.Name(sRVCCOperationPossible) +} + +func (sRVCCOperationPossible SRVCCOperationPossible) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSRVCCOperationPossible.Known(sRVCCOperationPossible) +} + +func (scheduledCommunicationTime *ScheduledCommunicationTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsScheduledCommunicationTime, scheduledCommunicationTime, scheduledCommunicationTime.iEExtensions) + w.WriteBit(scheduledCommunicationTime.extensions.Present()) + w.WriteBit(scheduledCommunicationTime.DayofWeek != nil) + w.WriteBit(scheduledCommunicationTime.TimeofDayStart != nil) + w.WriteBit(scheduledCommunicationTime.TimeofDayEnd != nil) + w.WriteBit(len(ext) > 0) + if scheduledCommunicationTime.DayofWeek != nil { + if err := (*scheduledCommunicationTime.DayofWeek).MarshalPER(w, enc); err != nil { + return err + } + } + if scheduledCommunicationTime.TimeofDayStart != nil { + if err := (*scheduledCommunicationTime.TimeofDayStart).MarshalPER(w, enc); err != nil { + return err + } + } + if scheduledCommunicationTime.TimeofDayEnd != nil { + if err := (*scheduledCommunicationTime.TimeofDayEnd).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if scheduledCommunicationTime.extensions.Present() { + if err := scheduledCommunicationTime.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (scheduledCommunicationTime *ScheduledCommunicationTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *scheduledCommunicationTime = ScheduledCommunicationTime{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DayofWeek, err := r.ReadBit() + if err != nil { + return err + } + p_TimeofDayStart, err := r.ReadBit() + if err != nil { + return err + } + p_TimeofDayEnd, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_DayofWeek { + var v ScheduledCommunicationTimeDayofWeek + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + scheduledCommunicationTime.DayofWeek = &v + } + if p_TimeofDayStart { + var v ScheduledCommunicationTimeTimeofDayStart + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + scheduledCommunicationTime.TimeofDayStart = &v + } + if p_TimeofDayEnd { + var v ScheduledCommunicationTimeTimeofDayEnd + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + scheduledCommunicationTime.TimeofDayEnd = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsScheduledCommunicationTime, scheduledCommunicationTime, &scheduledCommunicationTime.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := scheduledCommunicationTime.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsScheduledCommunicationTime []ap.IESpec[ProtocolIEID, ScheduledCommunicationTime] + +func (scheduledCommunicationTime *ScheduledCommunicationTime) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if scheduledCommunicationTime.TimeofDayStart != nil && scheduledCommunicationTime.TimeofDayStart.Diagnose(d) { + notComprehended = true + } + if scheduledCommunicationTime.TimeofDayEnd != nil && scheduledCommunicationTime.TimeofDayEnd.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsScheduledCommunicationTime, scheduledCommunicationTime, scheduledCommunicationTime.iEExtensions) + return notComprehended +} + +func (secondaryRATUsageInformation *SecondaryRATUsageInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, secondaryRATUsageInformation.iEExtensions) + w.WriteBit(secondaryRATUsageInformation.extensions.Present()) + w.WriteBit(secondaryRATUsageInformation.PDUSessionUsageReport != nil) + w.WriteBit(secondaryRATUsageInformation.QosFlowsUsageReportList != nil) + w.WriteBit(len(ext) > 0) + if secondaryRATUsageInformation.PDUSessionUsageReport != nil { + if err := (*secondaryRATUsageInformation.PDUSessionUsageReport).MarshalPER(w, enc); err != nil { + return err + } + } + if secondaryRATUsageInformation.QosFlowsUsageReportList != nil { + if err := secondaryRATUsageInformation.QosFlowsUsageReportList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if secondaryRATUsageInformation.extensions.Present() { + if err := secondaryRATUsageInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (secondaryRATUsageInformation *SecondaryRATUsageInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *secondaryRATUsageInformation = SecondaryRATUsageInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PDUSessionUsageReport, err := r.ReadBit() + if err != nil { + return err + } + p_QosFlowsUsageReportList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_PDUSessionUsageReport { + var v PDUSessionUsageReport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + secondaryRATUsageInformation.PDUSessionUsageReport = &v + } + if p_QosFlowsUsageReportList { + if err := (&secondaryRATUsageInformation.QosFlowsUsageReportList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, &secondaryRATUsageInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := secondaryRATUsageInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecondaryRATUsageInformation []ap.IESpec[ProtocolIEID, SecondaryRATUsageInformation] + +func (secondaryRATUsageInformation *SecondaryRATUsageInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if secondaryRATUsageInformation.PDUSessionUsageReport != nil && secondaryRATUsageInformation.PDUSessionUsageReport.Diagnose(d) { + notComprehended = true + } + if secondaryRATUsageInformation.QosFlowsUsageReportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, secondaryRATUsageInformation.iEExtensions) + return notComprehended +} + +func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSecurityContext, securityContext, securityContext.iEExtensions) + w.WriteBit(securityContext.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { + return err + } + if err := securityContext.NextHopNH.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if securityContext.extensions.Present() { + if err := securityContext.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *securityContext = SecurityContext{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}) + if err != nil { + return err + } + securityContext.NextHopChainingCount = uint8(n0) + if err := (&securityContext.NextHopNH).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityContext, securityContext, &securityContext.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := securityContext.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecurityContext []ap.IESpec[ProtocolIEID, SecurityContext] + +func (securityContext *SecurityContext) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSecurityContext, securityContext, securityContext.iEExtensions) + return notComprehended +} + +func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + w.WriteBit(securityIndication.extensions.Present()) + w.WriteBit(securityIndication.MaximumIntegrityProtectedDataRateUL != nil) + w.WriteBit(len(ext) > 0) + if err := securityIndication.IntegrityProtectionIndication.MarshalPER(w, enc); err != nil { + return err + } + if err := securityIndication.ConfidentialityProtectionIndication.MarshalPER(w, enc); err != nil { + return err + } + if securityIndication.MaximumIntegrityProtectedDataRateUL != nil { + if err := (*securityIndication.MaximumIntegrityProtectedDataRateUL).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if securityIndication.extensions.Present() { + if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *securityIndication = SecurityIndication{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MaximumIntegrityProtectedDataRateUL, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&securityIndication.IntegrityProtectionIndication).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&securityIndication.ConfidentialityProtectionIndication).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MaximumIntegrityProtectedDataRateUL { + var v MaximumIntegrityProtectedDataRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + securityIndication.MaximumIntegrityProtectedDataRateUL = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecurityIndication = []ap.IESpec[ProtocolIEID, SecurityIndication]{ + { + ID: IDMaximumIntegrityProtectedDataRateDL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SecurityIndication, r *per.Reader, enc per.Encoding) error { + var v MaximumIntegrityProtectedDataRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MaximumIntegrityProtectedDataRateDL = &v + return nil + }, + Encode: func(x *SecurityIndication) (per.Marshaler, bool) { + if x.MaximumIntegrityProtectedDataRateDL == nil { + return nil, false + } + return x.MaximumIntegrityProtectedDataRateDL, true + }, + }, +} + +func (securityIndication *SecurityIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if securityIndication.IntegrityProtectionIndication.Diagnose(d) { + notComprehended = true + } + if securityIndication.ConfidentialityProtectionIndication.Diagnose(d) { + notComprehended = true + } + if securityIndication.MaximumIntegrityProtectedDataRateUL != nil && securityIndication.MaximumIntegrityProtectedDataRateUL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + return notComprehended +} + +func (securityResult *SecurityResult) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSecurityResult, securityResult, securityResult.iEExtensions) + w.WriteBit(securityResult.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := securityResult.IntegrityProtectionResult.MarshalPER(w, enc); err != nil { + return err + } + if err := securityResult.ConfidentialityProtectionResult.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if securityResult.extensions.Present() { + if err := securityResult.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *securityResult = SecurityResult{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&securityResult.IntegrityProtectionResult).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&securityResult.ConfidentialityProtectionResult).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityResult, securityResult, &securityResult.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := securityResult.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecurityResult []ap.IESpec[ProtocolIEID, SecurityResult] + +func (securityResult *SecurityResult) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if securityResult.IntegrityProtectionResult.Diagnose(d) { + notComprehended = true + } + if securityResult.ConfidentialityProtectionResult.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSecurityResult, securityResult, securityResult.iEExtensions) + return notComprehended +} + +func (sensorMeasConfig SensorMeasConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSensorMeasConfig.Encode(w, enc, sensorMeasConfig) +} + +func (sensorMeasConfig *SensorMeasConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSensorMeasConfig.Decode(r, enc) + if err != nil { + return err + } + *sensorMeasConfig = v + return nil +} + +func (sensorMeasConfig SensorMeasConfig) Name() string { + return enumSensorMeasConfig.Name(sensorMeasConfig) +} + +func (sensorMeasConfig SensorMeasConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSensorMeasConfig.Known(sensorMeasConfig) +} + +func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, sensorMeasConfigNameItem.iEExtensions) + w.WriteBit(sensorMeasConfigNameItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sensorMeasConfigNameItem.SensorNameConfig.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sensorMeasConfigNameItem.extensions.Present() { + if err := sensorMeasConfigNameItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sensorMeasConfigNameItem = SensorMeasConfigNameItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sensorMeasConfigNameItem.SensorNameConfig).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, &sensorMeasConfigNameItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sensorMeasConfigNameItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSensorMeasConfigNameItem []ap.IESpec[ProtocolIEID, SensorMeasConfigNameItem] + +func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sensorMeasConfigNameItem.SensorNameConfig.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, sensorMeasConfigNameItem.iEExtensions) + return notComprehended +} + +func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, sensorMeasurementConfiguration.iEExtensions) + w.WriteBit(sensorMeasurementConfiguration.extensions.Present()) + w.WriteBit(sensorMeasurementConfiguration.SensorMeasConfigNameList != nil) + w.WriteBit(len(ext) > 0) + if err := sensorMeasurementConfiguration.SensorMeasConfig.MarshalPER(w, enc); err != nil { + return err + } + if sensorMeasurementConfiguration.SensorMeasConfigNameList != nil { + if err := sensorMeasurementConfiguration.SensorMeasConfigNameList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sensorMeasurementConfiguration.extensions.Present() { + if err := sensorMeasurementConfiguration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sensorMeasurementConfiguration = SensorMeasurementConfiguration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SensorMeasConfigNameList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sensorMeasurementConfiguration.SensorMeasConfig).UnmarshalPER(r, enc); err != nil { + return err + } + if p_SensorMeasConfigNameList { + if err := (&sensorMeasurementConfiguration.SensorMeasConfigNameList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, &sensorMeasurementConfiguration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sensorMeasurementConfiguration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSensorMeasurementConfiguration []ap.IESpec[ProtocolIEID, SensorMeasurementConfiguration] + +func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sensorMeasurementConfiguration.SensorMeasConfig.Diagnose(d) { + notComprehended = true + } + if sensorMeasurementConfiguration.SensorMeasConfigNameList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, sensorMeasurementConfiguration.iEExtensions) + return notComprehended +} + +func (sensorNameConfig *SensorNameConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{sensorNameConfig.UncompensatedBarometricConfig != nil, sensorNameConfig.UeSpeedConfig != nil, sensorNameConfig.UeOrientationConfig != nil, sensorNameConfig.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case sensorNameConfig.UncompensatedBarometricConfig != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { + return err + } + if err := (*sensorNameConfig.UncompensatedBarometricConfig).MarshalPER(w, enc); err != nil { + return err + } + case sensorNameConfig.UeSpeedConfig != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { + return err + } + if err := (*sensorNameConfig.UeSpeedConfig).MarshalPER(w, enc); err != nil { + return err + } + case sensorNameConfig.UeOrientationConfig != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { + return err + } + if err := (*sensorNameConfig.UeOrientationConfig).MarshalPER(w, enc); err != nil { + return err + } + case sensorNameConfig.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, sensorNameConfig.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (sensorNameConfig *SensorNameConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sensorNameConfig = SensorNameConfig{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) + if err != nil { + return err + } + switch idx { + case 0: + var v SensorNameConfigUncompensatedBarometricConfig + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sensorNameConfig.UncompensatedBarometricConfig = &v + case 1: + var v SensorNameConfigUeSpeedConfig + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sensorNameConfig.UeSpeedConfig = &v + case 2: + var v SensorNameConfigUeOrientationConfig + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sensorNameConfig.UeOrientationConfig = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + sensorNameConfig.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (sensorNameConfig *SensorNameConfig) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case sensorNameConfig.UncompensatedBarometricConfig != nil: + return sensorNameConfig.UncompensatedBarometricConfig.Diagnose(d) + case sensorNameConfig.UeSpeedConfig != nil: + return sensorNameConfig.UeSpeedConfig.Diagnose(d) + case sensorNameConfig.UeOrientationConfig != nil: + return sensorNameConfig.UeOrientationConfig.Diagnose(d) + case sensorNameConfig.ChoiceExtension != nil: + d.Unknown(sensorNameConfig.ChoiceExtension.ID, sensorNameConfig.ChoiceExtension.Criticality) + } + return false +} + +func (sensorNameConfigUeOrientationConfig SensorNameConfigUeOrientationConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSensorNameConfigUeOrientationConfig.Encode(w, enc, sensorNameConfigUeOrientationConfig) +} + +func (sensorNameConfigUeOrientationConfig *SensorNameConfigUeOrientationConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSensorNameConfigUeOrientationConfig.Decode(r, enc) + if err != nil { + return err + } + *sensorNameConfigUeOrientationConfig = v + return nil +} + +func (sensorNameConfigUeOrientationConfig SensorNameConfigUeOrientationConfig) Name() string { + return enumSensorNameConfigUeOrientationConfig.Name(sensorNameConfigUeOrientationConfig) +} + +func (sensorNameConfigUeOrientationConfig SensorNameConfigUeOrientationConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSensorNameConfigUeOrientationConfig.Known(sensorNameConfigUeOrientationConfig) +} + +func (sensorNameConfigUeSpeedConfig SensorNameConfigUeSpeedConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSensorNameConfigUeSpeedConfig.Encode(w, enc, sensorNameConfigUeSpeedConfig) +} + +func (sensorNameConfigUeSpeedConfig *SensorNameConfigUeSpeedConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSensorNameConfigUeSpeedConfig.Decode(r, enc) + if err != nil { + return err + } + *sensorNameConfigUeSpeedConfig = v + return nil +} + +func (sensorNameConfigUeSpeedConfig SensorNameConfigUeSpeedConfig) Name() string { + return enumSensorNameConfigUeSpeedConfig.Name(sensorNameConfigUeSpeedConfig) +} + +func (sensorNameConfigUeSpeedConfig SensorNameConfigUeSpeedConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSensorNameConfigUeSpeedConfig.Known(sensorNameConfigUeSpeedConfig) +} + +func (sensorNameConfigUncompensatedBarometricConfig SensorNameConfigUncompensatedBarometricConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSensorNameConfigUncompensatedBarometricConfig.Encode(w, enc, sensorNameConfigUncompensatedBarometricConfig) +} + +func (sensorNameConfigUncompensatedBarometricConfig *SensorNameConfigUncompensatedBarometricConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSensorNameConfigUncompensatedBarometricConfig.Decode(r, enc) + if err != nil { + return err + } + *sensorNameConfigUncompensatedBarometricConfig = v + return nil +} + +func (sensorNameConfigUncompensatedBarometricConfig SensorNameConfigUncompensatedBarometricConfig) Name() string { + return enumSensorNameConfigUncompensatedBarometricConfig.Name(sensorNameConfigUncompensatedBarometricConfig) +} + +func (sensorNameConfigUncompensatedBarometricConfig SensorNameConfigUncompensatedBarometricConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSensorNameConfigUncompensatedBarometricConfig.Known(sensorNameConfigUncompensatedBarometricConfig) +} + +func (servedGUAMIItem *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsServedGUAMIItem, servedGUAMIItem, servedGUAMIItem.iEExtensions) + w.WriteBit(servedGUAMIItem.extensions.Present()) + w.WriteBit(servedGUAMIItem.BackupAMFName != nil) + w.WriteBit(len(ext) > 0) + if err := servedGUAMIItem.GUAMI.MarshalPER(w, enc); err != nil { + return err + } + if servedGUAMIItem.BackupAMFName != nil { + if err := (*servedGUAMIItem.BackupAMFName).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if servedGUAMIItem.extensions.Present() { + if err := servedGUAMIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (servedGUAMIItem *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *servedGUAMIItem = ServedGUAMIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_BackupAMFName, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&servedGUAMIItem.GUAMI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_BackupAMFName { + var v Name + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + servedGUAMIItem.BackupAMFName = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsServedGUAMIItem, servedGUAMIItem, &servedGUAMIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := servedGUAMIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsServedGUAMIItem = []ap.IESpec[ProtocolIEID, ServedGUAMIItem]{ + { + ID: IDGUAMIType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ServedGUAMIItem, r *per.Reader, enc per.Encoding) error { + var v GUAMIType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.GUAMIType = &v + return nil + }, + Encode: func(x *ServedGUAMIItem) (per.Marshaler, bool) { + if x.GUAMIType == nil { + return nil, false + } + return x.GUAMIType, true + }, + }, + { + ID: IDExtendedBackupAMFName, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ServedGUAMIItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedAMFName + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedBackupAMFName = &v + return nil + }, + Encode: func(x *ServedGUAMIItem) (per.Marshaler, bool) { + if x.ExtendedBackupAMFName == nil { + return nil, false + } + return x.ExtendedBackupAMFName, true + }, + }, +} + +func (servedGUAMIItem *ServedGUAMIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if servedGUAMIItem.GUAMI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsServedGUAMIItem, servedGUAMIItem, servedGUAMIItem.iEExtensions) + return notComprehended +} + +func (serviceAreaInformationItem *ServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsServiceAreaInformationItem, serviceAreaInformationItem, serviceAreaInformationItem.iEExtensions) + w.WriteBit(serviceAreaInformationItem.extensions.Present()) + w.WriteBit(serviceAreaInformationItem.AllowedTACs != nil) + w.WriteBit(serviceAreaInformationItem.NotAllowedTACs != nil) + w.WriteBit(len(ext) > 0) + if err := serviceAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if serviceAreaInformationItem.AllowedTACs != nil { + if err := serviceAreaInformationItem.AllowedTACs.MarshalPER(w, enc); err != nil { + return err + } + } + if serviceAreaInformationItem.NotAllowedTACs != nil { + if err := serviceAreaInformationItem.NotAllowedTACs.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if serviceAreaInformationItem.extensions.Present() { + if err := serviceAreaInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (serviceAreaInformationItem *ServiceAreaInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *serviceAreaInformationItem = ServiceAreaInformationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AllowedTACs, err := r.ReadBit() + if err != nil { + return err + } + p_NotAllowedTACs, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&serviceAreaInformationItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AllowedTACs { + if err := (&serviceAreaInformationItem.AllowedTACs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_NotAllowedTACs { + if err := (&serviceAreaInformationItem.NotAllowedTACs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsServiceAreaInformationItem, serviceAreaInformationItem, &serviceAreaInformationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := serviceAreaInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsServiceAreaInformationItem []ap.IESpec[ProtocolIEID, ServiceAreaInformationItem] + +func (serviceAreaInformationItem *ServiceAreaInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsServiceAreaInformationItem, serviceAreaInformationItem, serviceAreaInformationItem.iEExtensions) + return notComprehended +} + +func (serviceType ServiceType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumServiceType.Encode(w, enc, serviceType) +} + +func (serviceType *ServiceType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumServiceType.Decode(r, enc) + if err != nil { + return err + } + *serviceType = v + return nil +} + +func (serviceType ServiceType) Name() string { + return enumServiceType.Name(serviceType) +} + +func (serviceType ServiceType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumServiceType.Known(serviceType) +} + +func (sliceMDTItem *SliceMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSliceMDTItem, sliceMDTItem, sliceMDTItem.iEExtensions) + w.WriteBit(sliceMDTItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sliceMDTItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sliceMDTItem.extensions.Present() { + if err := sliceMDTItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sliceMDTItem *SliceMDTItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sliceMDTItem = SliceMDTItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sliceMDTItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceMDTItem, sliceMDTItem, &sliceMDTItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sliceMDTItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSliceMDTItem []ap.IESpec[ProtocolIEID, SliceMDTItem] + +func (sliceMDTItem *SliceMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sliceMDTItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSliceMDTItem, sliceMDTItem, sliceMDTItem.iEExtensions) + return notComprehended +} + +func (sliceOverloadItem *SliceOverloadItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSliceOverloadItem, sliceOverloadItem, sliceOverloadItem.iEExtensions) + w.WriteBit(sliceOverloadItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sliceOverloadItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sliceOverloadItem.extensions.Present() { + if err := sliceOverloadItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sliceOverloadItem *SliceOverloadItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sliceOverloadItem = SliceOverloadItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sliceOverloadItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceOverloadItem, sliceOverloadItem, &sliceOverloadItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sliceOverloadItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSliceOverloadItem []ap.IESpec[ProtocolIEID, SliceOverloadItem] + +func (sliceOverloadItem *SliceOverloadItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sliceOverloadItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSliceOverloadItem, sliceOverloadItem, sliceOverloadItem.iEExtensions) + return notComprehended +} + +func (sliceSupportItem *SliceSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSliceSupportItem, sliceSupportItem, sliceSupportItem.iEExtensions) + w.WriteBit(sliceSupportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sliceSupportItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sliceSupportItem.extensions.Present() { + if err := sliceSupportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sliceSupportItem = SliceSupportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sliceSupportItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceSupportItem, sliceSupportItem, &sliceSupportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sliceSupportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSliceSupportItem []ap.IESpec[ProtocolIEID, SliceSupportItem] + +func (sliceSupportItem *SliceSupportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sliceSupportItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSliceSupportItem, sliceSupportItem, sliceSupportItem.iEExtensions) + return notComprehended +} + +func (sliceSupportQMCItem *SliceSupportQMCItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSliceSupportQMCItem, sliceSupportQMCItem, sliceSupportQMCItem.iEExtensions) + w.WriteBit(sliceSupportQMCItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sliceSupportQMCItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sliceSupportQMCItem.extensions.Present() { + if err := sliceSupportQMCItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sliceSupportQMCItem *SliceSupportQMCItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sliceSupportQMCItem = SliceSupportQMCItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sliceSupportQMCItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceSupportQMCItem, sliceSupportQMCItem, &sliceSupportQMCItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sliceSupportQMCItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSliceSupportQMCItem []ap.IESpec[ProtocolIEID, SliceSupportQMCItem] + +func (sliceSupportQMCItem *SliceSupportQMCItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sliceSupportQMCItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSliceSupportQMCItem, sliceSupportQMCItem, sliceSupportQMCItem.iEExtensions) + return notComprehended +} + +func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.Present()) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList != nil) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList != nil) + w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP != nil) + w.WriteBit(len(ext) > 0) + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.RRCContainer.MarshalPER(w, enc); err != nil { + return err + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList != nil { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList.MarshalPER(w, enc); err != nil { + return err + } + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList != nil { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList.MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID.MarshalPER(w, enc); err != nil { + return err + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP != nil { + if err := (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP).MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.Present() { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sourceNGRANNodeToTargetNGRANNodeTransparentContainer = SourceNGRANNodeToTargetNGRANNodeTransparentContainer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PDUSessionResourceInformationList, err := r.ReadBit() + if err != nil { + return err + } + p_ERABInformationList, err := r.ReadBit() + if err != nil { + return err + } + p_IndexToRFSP, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.RRCContainer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_PDUSessionResourceInformationList { + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ERABInformationList { + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_IndexToRFSP { + var v IndexToRFSP + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP = &v + } + if err := (&sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, &sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[ProtocolIEID, SourceNGRANNodeToTargetNGRANNodeTransparentContainer]{ + { + ID: IDSgNBUEX2APID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v SgNBUEX2APID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SgNBUEX2APID = &v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if x.SgNBUEX2APID == nil { + return nil, false + } + return x.SgNBUEX2APID, true + }, + }, + { + ID: IDUEHistoryInformationFromTheUE, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v UEHistoryInformationFromTheUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UEHistoryInformationFromTheUE = &v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if x.UEHistoryInformationFromTheUE == nil { + return nil, false + } + return x.UEHistoryInformationFromTheUE, true + }, + }, + { + ID: IDSourceNodeID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v SourceNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceNodeID = &v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if x.SourceNodeID == nil { + return nil, false + } + return x.SourceNodeID, true + }, + }, + { + ID: IDUEContextReferenceAtSource, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v RANUENGAPID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UEContextReferenceAtSource = &v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if x.UEContextReferenceAtSource == nil { + return nil, false + } + return x.UEContextReferenceAtSource, true + }, + }, + { + ID: IDMBSActiveSessionInformationSourcetoTargetList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v MBSActiveSessionInformationSourcetoTargetList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MBSActiveSessionInformationSourcetoTargetList = v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if len(x.MBSActiveSessionInformationSourcetoTargetList) == 0 { + return nil, false + } + return x.MBSActiveSessionInformationSourcetoTargetList, true + }, + }, + { + ID: IDQMCConfigInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v QMCConfigInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QMCConfigInfo = &v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if x.QMCConfigInfo == nil { + return nil, false + } + return x.QMCConfigInfo, true + }, + }, + { + ID: IDNGAPIESupportInformationRequestList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v NGAPIESupportInformationRequestList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NGAPIESupportInformationRequestList = v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if len(x.NGAPIESupportInformationRequestList) == 0 { + return nil, false + } + return x.NGAPIESupportInformationRequestList, true + }, + }, + { + ID: IDCandidateRelayUEInformationList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v CandidateRelayUEInformationList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CandidateRelayUEInformationList = v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if len(x.CandidateRelayUEInformationList) == 0 { + return nil, false + } + return x.CandidateRelayUEInformationList, true + }, + }, + { + ID: IDTimeBasedHandoverInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v TimeBasedHandoverInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TimeBasedHandoverInformation = &v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if x.TimeBasedHandoverInformation == nil { + return nil, false + } + return x.TimeBasedHandoverInformation, true + }, + }, + { + ID: IDSourceSNtoTargetSNQMCInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v QMCConfigInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceSNtoTargetSNQMCInfo = &v + return nil + }, + Encode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) (per.Marshaler, bool) { + if x.SourceSNtoTargetSNQMCInfo == nil { + return nil, false + } + return x.SourceSNtoTargetSNQMCInfo, true + }, + }, +} + +func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList.Diagnose(d) { + notComprehended = true + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList.Diagnose(d) { + notComprehended = true + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID.Diagnose(d) { + notComprehended = true + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP != nil && sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP.Diagnose(d) { + notComprehended = true + } + if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions) + return notComprehended +} + +func (sourceNodeID *SourceNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{sourceNodeID.SourceengNBID != nil, sourceNodeID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case sourceNodeID.SourceengNBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*sourceNodeID.SourceengNBID).MarshalPER(w, enc); err != nil { + return err + } + case sourceNodeID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, sourceNodeID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (sourceNodeID *SourceNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sourceNodeID = SourceNodeID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v GlobalGNBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceNodeID.SourceengNBID = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + sourceNodeID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (sourceNodeID *SourceNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case sourceNodeID.SourceengNBID != nil: + return sourceNodeID.SourceengNBID.Diagnose(d) + case sourceNodeID.ChoiceExtension != nil: + d.Unknown(sourceNodeID.ChoiceExtension.ID, sourceNodeID.ChoiceExtension.Criticality) + } + return false +} + +func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSourceOfUEActivityBehaviourInformation.Encode(w, enc, sourceOfUEActivityBehaviourInformation) +} + +func (sourceOfUEActivityBehaviourInformation *SourceOfUEActivityBehaviourInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSourceOfUEActivityBehaviourInformation.Decode(r, enc) + if err != nil { + return err + } + *sourceOfUEActivityBehaviourInformation = v + return nil +} + +func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) Name() string { + return enumSourceOfUEActivityBehaviourInformation.Name(sourceOfUEActivityBehaviourInformation) +} + +func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSourceOfUEActivityBehaviourInformation.Known(sourceOfUEActivityBehaviourInformation) +} + +func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute.iEExtensions) + w.WriteBit(sourceToTargetAMFInformationReroute.extensions.Present()) + w.WriteBit(sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil) + w.WriteBit(sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN != nil) + w.WriteBit(sourceToTargetAMFInformationReroute.RejectedNSSAIinTA != nil) + w.WriteBit(len(ext) > 0) + if sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil { + if err := (*sourceToTargetAMFInformationReroute.ConfiguredNSSAI).MarshalPER(w, enc); err != nil { + return err + } + } + if sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN != nil { + if err := (*sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN).MarshalPER(w, enc); err != nil { + return err + } + } + if sourceToTargetAMFInformationReroute.RejectedNSSAIinTA != nil { + if err := (*sourceToTargetAMFInformationReroute.RejectedNSSAIinTA).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sourceToTargetAMFInformationReroute.extensions.Present() { + if err := sourceToTargetAMFInformationReroute.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sourceToTargetAMFInformationReroute = SourceToTargetAMFInformationReroute{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ConfiguredNSSAI, err := r.ReadBit() + if err != nil { + return err + } + p_RejectedNSSAIinPLMN, err := r.ReadBit() + if err != nil { + return err + } + p_RejectedNSSAIinTA, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_ConfiguredNSSAI { + var v ConfiguredNSSAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceToTargetAMFInformationReroute.ConfiguredNSSAI = &v + } + if p_RejectedNSSAIinPLMN { + var v RejectedNSSAIinPLMN + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN = &v + } + if p_RejectedNSSAIinTA { + var v RejectedNSSAIinTA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceToTargetAMFInformationReroute.RejectedNSSAIinTA = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, &sourceToTargetAMFInformationReroute.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sourceToTargetAMFInformationReroute.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSourceToTargetAMFInformationReroute []ap.IESpec[ProtocolIEID, SourceToTargetAMFInformationReroute] + +func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute.iEExtensions) + return notComprehended +} + +func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + w.WriteBit(supportedTAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { + return err + } + if err := supportedTAItem.BroadcastPLMNList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if supportedTAItem.extensions.Present() { + if err := supportedTAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *supportedTAItem = SupportedTAItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&supportedTAItem.TAC).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&supportedTAItem.BroadcastPLMNList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := supportedTAItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSupportedTAItem = []ap.IESpec[ProtocolIEID, SupportedTAItem]{ + { + ID: IDConfiguredTACIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SupportedTAItem, r *per.Reader, enc per.Encoding) error { + var v ConfiguredTACIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ConfiguredTACIndication = &v + return nil + }, + Encode: func(x *SupportedTAItem) (per.Marshaler, bool) { + if x.ConfiguredTACIndication == nil { + return nil, false + } + return x.ConfiguredTACIndication, true + }, + }, + { + ID: IDRATInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *SupportedTAItem, r *per.Reader, enc per.Encoding) error { + var v RATInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RATInformation = &v + return nil + }, + Encode: func(x *SupportedTAItem) (per.Marshaler, bool) { + if x.RATInformation == nil { + return nil, false + } + return x.RATInformation, true + }, + }, +} + +func (supportedTAItem *SupportedTAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if supportedTAItem.BroadcastPLMNList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + return notComprehended +} + +func (tABasedMDT *TABasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTABasedMDT, tABasedMDT, tABasedMDT.iEExtensions) + w.WriteBit(tABasedMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tABasedMDT.TAListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tABasedMDT.extensions.Present() { + if err := tABasedMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tABasedMDT *TABasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tABasedMDT = TABasedMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tABasedMDT.TAListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTABasedMDT, tABasedMDT, &tABasedMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tABasedMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTABasedMDT []ap.IESpec[ProtocolIEID, TABasedMDT] + +func (tABasedMDT *TABasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsTABasedMDT, tABasedMDT, tABasedMDT.iEExtensions) + return notComprehended +} + +func (tABasedQMC *TABasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTABasedQMC, tABasedQMC, tABasedQMC.iEExtensions) + w.WriteBit(tABasedQMC.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tABasedQMC.TAListforQMC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tABasedQMC.extensions.Present() { + if err := tABasedQMC.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tABasedQMC *TABasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tABasedQMC = TABasedQMC{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tABasedQMC.TAListforQMC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTABasedQMC, tABasedQMC, &tABasedQMC.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tABasedQMC.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTABasedQMC []ap.IESpec[ProtocolIEID, TABasedQMC] + +func (tABasedQMC *TABasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsTABasedQMC, tABasedQMC, tABasedQMC.iEExtensions) + return notComprehended +} + +func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAI, tAI, tAI.iEExtensions) + w.WriteBit(tAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := tAI.TAC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAI.extensions.Present() { + if err := tAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAI = TAI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&tAI.TAC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAI, tAI, &tAI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAI []ap.IESpec[ProtocolIEID, TAI] + +func (tAI *TAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsTAI, tAI, tAI.iEExtensions) + return notComprehended +} + +func (tAIBasedMDT *TAIBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIBasedMDT, tAIBasedMDT, tAIBasedMDT.iEExtensions) + w.WriteBit(tAIBasedMDT.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIBasedMDT.TAIListforMDT.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIBasedMDT.extensions.Present() { + if err := tAIBasedMDT.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIBasedMDT *TAIBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIBasedMDT = TAIBasedMDT{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIBasedMDT.TAIListforMDT).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBasedMDT, tAIBasedMDT, &tAIBasedMDT.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIBasedMDT.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIBasedMDT []ap.IESpec[ProtocolIEID, TAIBasedMDT] + +func (tAIBasedMDT *TAIBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIBasedMDT.TAIListforMDT.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTAIBasedMDT, tAIBasedMDT, tAIBasedMDT.iEExtensions) + return notComprehended +} + +func (tAIBasedQMC *TAIBasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIBasedQMC, tAIBasedQMC, tAIBasedQMC.iEExtensions) + w.WriteBit(tAIBasedQMC.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIBasedQMC.TAIListforQMC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIBasedQMC.extensions.Present() { + if err := tAIBasedQMC.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIBasedQMC *TAIBasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIBasedQMC = TAIBasedQMC{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIBasedQMC.TAIListforQMC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBasedQMC, tAIBasedQMC, &tAIBasedQMC.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIBasedQMC.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIBasedQMC []ap.IESpec[ProtocolIEID, TAIBasedQMC] + +func (tAIBasedQMC *TAIBasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIBasedQMC.TAIListforQMC.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTAIBasedQMC, tAIBasedQMC, tAIBasedQMC.iEExtensions) + return notComprehended +} + +func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem.iEExtensions) + w.WriteBit(tAIBroadcastEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIBroadcastEUTRAItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastEUTRAItem.CompletedCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAIBroadcastEUTRAItem.CompletedCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIBroadcastEUTRAItem.extensions.Present() { + if err := tAIBroadcastEUTRAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIBroadcastEUTRAItem = TAIBroadcastEUTRAItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIBroadcastEUTRAItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAIBroadcastEUTRAItem.CompletedCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAIBroadcastEUTRAItem.CompletedCellsInTAI) + tAIBroadcastEUTRAItem.CompletedCellsInTAI = append(tAIBroadcastEUTRAItem.CompletedCellsInTAI, make([]CompletedCellsInTAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAIBroadcastEUTRAItem.CompletedCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, &tAIBroadcastEUTRAItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIBroadcastEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIBroadcastEUTRAItem []ap.IESpec[ProtocolIEID, TAIBroadcastEUTRAItem] + +func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIBroadcastEUTRAItem.TAI.Diagnose(d) { + notComprehended = true + } + for i := range tAIBroadcastEUTRAItem.CompletedCellsInTAI { + if tAIBroadcastEUTRAItem.CompletedCellsInTAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem.iEExtensions) + return notComprehended +} + +func (tAIBroadcastNRItem *TAIBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, tAIBroadcastNRItem.iEExtensions) + w.WriteBit(tAIBroadcastNRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIBroadcastNRItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastNRItem.CompletedCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAIBroadcastNRItem.CompletedCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIBroadcastNRItem.extensions.Present() { + if err := tAIBroadcastNRItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIBroadcastNRItem *TAIBroadcastNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIBroadcastNRItem = TAIBroadcastNRItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIBroadcastNRItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAIBroadcastNRItem.CompletedCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAIBroadcastNRItem.CompletedCellsInTAI) + tAIBroadcastNRItem.CompletedCellsInTAI = append(tAIBroadcastNRItem.CompletedCellsInTAI, make([]CompletedCellsInTAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAIBroadcastNRItem.CompletedCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, &tAIBroadcastNRItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIBroadcastNRItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIBroadcastNRItem []ap.IESpec[ProtocolIEID, TAIBroadcastNRItem] + +func (tAIBroadcastNRItem *TAIBroadcastNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIBroadcastNRItem.TAI.Diagnose(d) { + notComprehended = true + } + for i := range tAIBroadcastNRItem.CompletedCellsInTAI { + if tAIBroadcastNRItem.CompletedCellsInTAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, tAIBroadcastNRItem.iEExtensions) + return notComprehended +} + +func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, tAICancelledEUTRAItem.iEExtensions) + w.WriteBit(tAICancelledEUTRAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAICancelledEUTRAItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledEUTRAItem.CancelledCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAICancelledEUTRAItem.CancelledCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAICancelledEUTRAItem.extensions.Present() { + if err := tAICancelledEUTRAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAICancelledEUTRAItem = TAICancelledEUTRAItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAICancelledEUTRAItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAICancelledEUTRAItem.CancelledCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAICancelledEUTRAItem.CancelledCellsInTAI) + tAICancelledEUTRAItem.CancelledCellsInTAI = append(tAICancelledEUTRAItem.CancelledCellsInTAI, make([]CancelledCellsInTAIEUTRAItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAICancelledEUTRAItem.CancelledCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, &tAICancelledEUTRAItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAICancelledEUTRAItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAICancelledEUTRAItem []ap.IESpec[ProtocolIEID, TAICancelledEUTRAItem] + +func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAICancelledEUTRAItem.TAI.Diagnose(d) { + notComprehended = true + } + for i := range tAICancelledEUTRAItem.CancelledCellsInTAI { + if tAICancelledEUTRAItem.CancelledCellsInTAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, tAICancelledEUTRAItem.iEExtensions) + return notComprehended +} + +func (tAICancelledNRItem *TAICancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAICancelledNRItem, tAICancelledNRItem, tAICancelledNRItem.iEExtensions) + w.WriteBit(tAICancelledNRItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAICancelledNRItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledNRItem.CancelledCellsInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAICancelledNRItem.CancelledCellsInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAICancelledNRItem.extensions.Present() { + if err := tAICancelledNRItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAICancelledNRItem *TAICancelledNRItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAICancelledNRItem = TAICancelledNRItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAICancelledNRItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAICancelledNRItem.CancelledCellsInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAICancelledNRItem.CancelledCellsInTAI) + tAICancelledNRItem.CancelledCellsInTAI = append(tAICancelledNRItem.CancelledCellsInTAI, make([]CancelledCellsInTAINRItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAICancelledNRItem.CancelledCellsInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledNRItem, tAICancelledNRItem, &tAICancelledNRItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAICancelledNRItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAICancelledNRItem []ap.IESpec[ProtocolIEID, TAICancelledNRItem] + +func (tAICancelledNRItem *TAICancelledNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAICancelledNRItem.TAI.Diagnose(d) { + notComprehended = true + } + for i := range tAICancelledNRItem.CancelledCellsInTAI { + if tAICancelledNRItem.CancelledCellsInTAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsTAICancelledNRItem, tAICancelledNRItem, tAICancelledNRItem.iEExtensions) + return notComprehended +} + +func (tAIListForInactiveItem *TAIListForInactiveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIListForInactiveItem, tAIListForInactiveItem, tAIListForInactiveItem.iEExtensions) + w.WriteBit(tAIListForInactiveItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIListForInactiveItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIListForInactiveItem.extensions.Present() { + if err := tAIListForInactiveItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIListForInactiveItem *TAIListForInactiveItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIListForInactiveItem = TAIListForInactiveItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIListForInactiveItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIListForInactiveItem, tAIListForInactiveItem, &tAIListForInactiveItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIListForInactiveItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIListForInactiveItem []ap.IESpec[ProtocolIEID, TAIListForInactiveItem] + +func (tAIListForInactiveItem *TAIListForInactiveItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIListForInactiveItem.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTAIListForInactiveItem, tAIListForInactiveItem, tAIListForInactiveItem.iEExtensions) + return notComprehended +} + +func (tAIListForPagingItem *TAIListForPagingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIListForPagingItem, tAIListForPagingItem, tAIListForPagingItem.iEExtensions) + w.WriteBit(tAIListForPagingItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIListForPagingItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIListForPagingItem.extensions.Present() { + if err := tAIListForPagingItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIListForPagingItem *TAIListForPagingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIListForPagingItem = TAIListForPagingItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIListForPagingItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIListForPagingItem, tAIListForPagingItem, &tAIListForPagingItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIListForPagingItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIListForPagingItem []ap.IESpec[ProtocolIEID, TAIListForPagingItem] + +func (tAIListForPagingItem *TAIListForPagingItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIListForPagingItem.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTAIListForPagingItem, tAIListForPagingItem, tAIListForPagingItem.iEExtensions) + return notComprehended +} + +func (tAINSAGSupportItem *TAINSAGSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAINSAGSupportItem, tAINSAGSupportItem, tAINSAGSupportItem.iEExtensions) + w.WriteBit(tAINSAGSupportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}, int64(tAINSAGSupportItem.NSAGID)); err != nil { + return err + } + if err := tAINSAGSupportItem.NSAGSliceSupportList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAINSAGSupportItem.extensions.Present() { + if err := tAINSAGSupportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAINSAGSupportItem *TAINSAGSupportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAINSAGSupportItem = TAINSAGSupportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}) + if err != nil { + return err + } + tAINSAGSupportItem.NSAGID = NSAGID(n0) + if err := (&tAINSAGSupportItem.NSAGSliceSupportList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAINSAGSupportItem, tAINSAGSupportItem, &tAINSAGSupportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAINSAGSupportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAINSAGSupportItem []ap.IESpec[ProtocolIEID, TAINSAGSupportItem] + +func (tAINSAGSupportItem *TAINSAGSupportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAINSAGSupportItem.NSAGSliceSupportList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTAINSAGSupportItem, tAINSAGSupportItem, tAINSAGSupportItem.iEExtensions) + return notComprehended +} + +func (tNGFID *TNGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{tNGFID.TNGFID != nil, tNGFID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case tNGFID.TNGFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*tNGFID.TNGFID).MarshalPER(w, enc); err != nil { + return err + } + case tNGFID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, tNGFID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (tNGFID *TNGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tNGFID = TNGFID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v TNGFIDValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tNGFID.TNGFID = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + tNGFID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (tNGFID *TNGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case tNGFID.TNGFID != nil: + case tNGFID.ChoiceExtension != nil: + d.Unknown(tNGFID.ChoiceExtension.ID, tNGFID.ChoiceExtension.Criticality) + } + return false +} + +func (tNLAssociationItem *TNLAssociationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTNLAssociationItem, tNLAssociationItem, tNLAssociationItem.iEExtensions) + w.WriteBit(tNLAssociationItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tNLAssociationItem.TNLAssociationAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := tNLAssociationItem.Cause.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tNLAssociationItem.extensions.Present() { + if err := tNLAssociationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tNLAssociationItem *TNLAssociationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tNLAssociationItem = TNLAssociationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tNLAssociationItem.TNLAssociationAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&tNLAssociationItem.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTNLAssociationItem, tNLAssociationItem, &tNLAssociationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tNLAssociationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTNLAssociationItem []ap.IESpec[ProtocolIEID, TNLAssociationItem] + +func (tNLAssociationItem *TNLAssociationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tNLAssociationItem.TNLAssociationAddress.Diagnose(d) { + notComprehended = true + } + if tNLAssociationItem.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTNLAssociationItem, tNLAssociationItem, tNLAssociationItem.iEExtensions) + return notComprehended +} + +func (tNLAssociationUsage TNLAssociationUsage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTNLAssociationUsage.Encode(w, enc, tNLAssociationUsage) +} + +func (tNLAssociationUsage *TNLAssociationUsage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTNLAssociationUsage.Decode(r, enc) + if err != nil { + return err + } + *tNLAssociationUsage = v + return nil +} + +func (tNLAssociationUsage TNLAssociationUsage) Name() string { + return enumTNLAssociationUsage.Name(tNLAssociationUsage) +} + +func (tNLAssociationUsage TNLAssociationUsage) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTNLAssociationUsage.Known(tNLAssociationUsage) +} + +func (tSCAssistanceInformation *TSCAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTSCAssistanceInformation, tSCAssistanceInformation, tSCAssistanceInformation.iEExtensions) + w.WriteBit(tSCAssistanceInformation.extensions.Present()) + w.WriteBit(tSCAssistanceInformation.BurstArrivalTime != nil) + w.WriteBit(len(ext) > 0) + if err := tSCAssistanceInformation.Periodicity.MarshalPER(w, enc); err != nil { + return err + } + if tSCAssistanceInformation.BurstArrivalTime != nil { + if err := (*tSCAssistanceInformation.BurstArrivalTime).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tSCAssistanceInformation.extensions.Present() { + if err := tSCAssistanceInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tSCAssistanceInformation *TSCAssistanceInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tSCAssistanceInformation = TSCAssistanceInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_BurstArrivalTime, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tSCAssistanceInformation.Periodicity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_BurstArrivalTime { + var v BurstArrivalTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tSCAssistanceInformation.BurstArrivalTime = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCAssistanceInformation, tSCAssistanceInformation, &tSCAssistanceInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tSCAssistanceInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTSCAssistanceInformation = []ap.IESpec[ProtocolIEID, TSCAssistanceInformation]{ + { + ID: IDSurvivalTime, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TSCAssistanceInformation, r *per.Reader, enc per.Encoding) error { + var v SurvivalTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SurvivalTime = &v + return nil + }, + Encode: func(x *TSCAssistanceInformation) (per.Marshaler, bool) { + if x.SurvivalTime == nil { + return nil, false + } + return x.SurvivalTime, true + }, + }, + { + ID: IDRANfeedbacktype, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TSCAssistanceInformation, r *per.Reader, enc per.Encoding) error { + var v RANfeedbacktype + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RANfeedbacktype = &v + return nil + }, + Encode: func(x *TSCAssistanceInformation) (per.Marshaler, bool) { + if x.RANfeedbacktype == nil { + return nil, false + } + return x.RANfeedbacktype, true + }, + }, + { + ID: IDN6JitterInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TSCAssistanceInformation, r *per.Reader, enc per.Encoding) error { + var v N6JitterInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.N6JitterInformation = &v + return nil + }, + Encode: func(x *TSCAssistanceInformation) (per.Marshaler, bool) { + if x.N6JitterInformation == nil { + return nil, false + } + return x.N6JitterInformation, true + }, + }, +} + +func (tSCAssistanceInformation *TSCAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tSCAssistanceInformation.Periodicity.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTSCAssistanceInformation, tSCAssistanceInformation, tSCAssistanceInformation.iEExtensions) + return notComprehended +} + +func (tSCFeedbackInformation *TSCFeedbackInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTSCFeedbackInformation, tSCFeedbackInformation, tSCFeedbackInformation.iEExtensions) + w.WriteBit(tSCFeedbackInformation.extensions.Present()) + w.WriteBit(tSCFeedbackInformation.AdjustedPeriodicity != nil) + w.WriteBit(len(ext) > 0) + if err := tSCFeedbackInformation.BurstArrivalTimeOffset.MarshalPER(w, enc); err != nil { + return err + } + if tSCFeedbackInformation.AdjustedPeriodicity != nil { + if err := (*tSCFeedbackInformation.AdjustedPeriodicity).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tSCFeedbackInformation.extensions.Present() { + if err := tSCFeedbackInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tSCFeedbackInformation *TSCFeedbackInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tSCFeedbackInformation = TSCFeedbackInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AdjustedPeriodicity, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tSCFeedbackInformation.BurstArrivalTimeOffset).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AdjustedPeriodicity { + var v Periodicity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tSCFeedbackInformation.AdjustedPeriodicity = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCFeedbackInformation, tSCFeedbackInformation, &tSCFeedbackInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tSCFeedbackInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTSCFeedbackInformation []ap.IESpec[ProtocolIEID, TSCFeedbackInformation] + +func (tSCFeedbackInformation *TSCFeedbackInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tSCFeedbackInformation.BurstArrivalTimeOffset.Diagnose(d) { + notComprehended = true + } + if tSCFeedbackInformation.AdjustedPeriodicity != nil && tSCFeedbackInformation.AdjustedPeriodicity.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTSCFeedbackInformation, tSCFeedbackInformation, tSCFeedbackInformation.iEExtensions) + return notComprehended +} + +func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, tSCTrafficCharacteristics.iEExtensions) + w.WriteBit(tSCTrafficCharacteristics.extensions.Present()) + w.WriteBit(tSCTrafficCharacteristics.TSCAssistanceInformationDL != nil) + w.WriteBit(tSCTrafficCharacteristics.TSCAssistanceInformationUL != nil) + w.WriteBit(len(ext) > 0) + if tSCTrafficCharacteristics.TSCAssistanceInformationDL != nil { + if err := (*tSCTrafficCharacteristics.TSCAssistanceInformationDL).MarshalPER(w, enc); err != nil { + return err + } + } + if tSCTrafficCharacteristics.TSCAssistanceInformationUL != nil { + if err := (*tSCTrafficCharacteristics.TSCAssistanceInformationUL).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tSCTrafficCharacteristics.extensions.Present() { + if err := tSCTrafficCharacteristics.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tSCTrafficCharacteristics = TSCTrafficCharacteristics{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TSCAssistanceInformationDL, err := r.ReadBit() + if err != nil { + return err + } + p_TSCAssistanceInformationUL, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_TSCAssistanceInformationDL { + var v TSCAssistanceInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tSCTrafficCharacteristics.TSCAssistanceInformationDL = &v + } + if p_TSCAssistanceInformationUL { + var v TSCAssistanceInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tSCTrafficCharacteristics.TSCAssistanceInformationUL = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, &tSCTrafficCharacteristics.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tSCTrafficCharacteristics.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTSCTrafficCharacteristics []ap.IESpec[ProtocolIEID, TSCTrafficCharacteristics] + +func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tSCTrafficCharacteristics.TSCAssistanceInformationDL != nil && tSCTrafficCharacteristics.TSCAssistanceInformationDL.Diagnose(d) { + notComprehended = true + } + if tSCTrafficCharacteristics.TSCAssistanceInformationUL != nil && tSCTrafficCharacteristics.TSCAssistanceInformationUL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, tSCTrafficCharacteristics.iEExtensions) + return notComprehended +} + +func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback.iEExtensions) + w.WriteBit(tSCTrafficCharacteristicsFeedback.extensions.Present()) + w.WriteBit(tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL != nil) + w.WriteBit(tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL != nil) + w.WriteBit(len(ext) > 0) + if tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL != nil { + if err := (*tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL).MarshalPER(w, enc); err != nil { + return err + } + } + if tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL != nil { + if err := (*tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tSCTrafficCharacteristicsFeedback.extensions.Present() { + if err := tSCTrafficCharacteristicsFeedback.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tSCTrafficCharacteristicsFeedback = TSCTrafficCharacteristicsFeedback{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TSCFeedbackInformationDL, err := r.ReadBit() + if err != nil { + return err + } + p_TSCFeedbackInformationUL, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_TSCFeedbackInformationDL { + var v TSCFeedbackInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL = &v + } + if p_TSCFeedbackInformationUL { + var v TSCFeedbackInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, &tSCTrafficCharacteristicsFeedback.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tSCTrafficCharacteristicsFeedback.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTSCTrafficCharacteristicsFeedback []ap.IESpec[ProtocolIEID, TSCTrafficCharacteristicsFeedback] + +func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL != nil && tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL.Diagnose(d) { + notComprehended = true + } + if tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL != nil && tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback.iEExtensions) + return notComprehended +} + +func (tWIFID *TWIFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{tWIFID.TWIFID != nil, tWIFID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case tWIFID.TWIFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*tWIFID.TWIFID).MarshalPER(w, enc); err != nil { + return err + } + case tWIFID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, tWIFID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (tWIFID *TWIFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tWIFID = TWIFID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v TWIFIDValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tWIFID.TWIFID = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + tWIFID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (tWIFID *TWIFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case tWIFID.TWIFID != nil: + case tWIFID.ChoiceExtension != nil: + d.Unknown(tWIFID.ChoiceExtension.ID, tWIFID.ChoiceExtension.Criticality) + } + return false +} + +func (targetHomeENBID *TargetHomeENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetHomeENBID, targetHomeENBID, targetHomeENBID.iEExtensions) + w.WriteBit(targetHomeENBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targetHomeENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := targetHomeENBID.HomeENBID.MarshalPER(w, enc); err != nil { + return err + } + if err := targetHomeENBID.SelectedEPSTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetHomeENBID.extensions.Present() { + if err := targetHomeENBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetHomeENBID *TargetHomeENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetHomeENBID = TargetHomeENBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetHomeENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targetHomeENBID.HomeENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targetHomeENBID.SelectedEPSTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetHomeENBID, targetHomeENBID, &targetHomeENBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetHomeENBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetHomeENBID []ap.IESpec[ProtocolIEID, TargetHomeENBID] + +func (targetHomeENBID *TargetHomeENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetHomeENBID.SelectedEPSTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetHomeENBID, targetHomeENBID, targetHomeENBID.iEExtensions) + return notComprehended +} + +func (targetID *TargetID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{targetID.TargetRANNodeID != nil, targetID.TargeteNBID != nil, targetID.TargetRNCID != nil, targetID.TargetHomeENBID != nil, targetID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case targetID.TargetRANNodeID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*targetID.TargetRANNodeID).MarshalPER(w, enc); err != nil { + return err + } + case targetID.TargeteNBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*targetID.TargeteNBID).MarshalPER(w, enc); err != nil { + return err + } + case targetID.TargetRNCID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDTargetRNCID, Criticality: targetID.choiceCriticality.Of(ap.CriticalityReject), Value: targetID.TargetRNCID}) + case targetID.TargetHomeENBID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDTargetHomeENBID, Criticality: targetID.choiceCriticality.Of(ap.CriticalityReject), Value: targetID.TargetHomeENBID}) + case targetID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, targetID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (targetID *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetID = TargetID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v TargetRANNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + targetID.TargetRANNodeID = &v + case 1: + var v TargeteNBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + targetID.TargeteNBID = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDTargetRNCID: + var v TargetRNCID + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + targetID.ChoiceExtension = &f + break + } + targetID.TargetRNCID = &v + targetID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + case IDTargetHomeENBID: + var v TargetHomeENBID + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + targetID.ChoiceExtension = &f + break + } + targetID.TargetHomeENBID = &v + targetID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + default: + targetID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (targetID *TargetID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case targetID.TargetRANNodeID != nil: + return targetID.TargetRANNodeID.Diagnose(d) + case targetID.TargeteNBID != nil: + return targetID.TargeteNBID.Diagnose(d) + case targetID.TargetRNCID != nil: + d.IE(IDTargetRNCID, targetID.choiceCriticality.Of(ap.CriticalityReject), targetID.TargetRNCID) + case targetID.TargetHomeENBID != nil: + d.IE(IDTargetHomeENBID, targetID.choiceCriticality.Of(ap.CriticalityReject), targetID.TargetHomeENBID) + case targetID.ChoiceExtension != nil: + d.Unknown(targetID.ChoiceExtension.ID, targetID.ChoiceExtension.Criticality) + } + return false +} + +func (targetNSSAIInformation *TargetNSSAIInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetNSSAIInformation, targetNSSAIInformation, targetNSSAIInformation.iEExtensions) + w.WriteBit(targetNSSAIInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targetNSSAIInformation.TargetNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := targetNSSAIInformation.IndexToRFSP.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetNSSAIInformation.extensions.Present() { + if err := targetNSSAIInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetNSSAIInformation *TargetNSSAIInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetNSSAIInformation = TargetNSSAIInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetNSSAIInformation.TargetNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targetNSSAIInformation.IndexToRFSP).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetNSSAIInformation, targetNSSAIInformation, &targetNSSAIInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetNSSAIInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetNSSAIInformation []ap.IESpec[ProtocolIEID, TargetNSSAIInformation] + +func (targetNSSAIInformation *TargetNSSAIInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetNSSAIInformation.TargetNSSAI.Diagnose(d) { + notComprehended = true + } + if targetNSSAIInformation.IndexToRFSP.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetNSSAIInformation, targetNSSAIInformation, targetNSSAIInformation.iEExtensions) + return notComprehended +} + +func (targetNSSAIItem *TargetNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetNSSAIItem, targetNSSAIItem, targetNSSAIItem.iEExtensions) + w.WriteBit(targetNSSAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targetNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetNSSAIItem.extensions.Present() { + if err := targetNSSAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetNSSAIItem *TargetNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetNSSAIItem = TargetNSSAIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetNSSAIItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetNSSAIItem, targetNSSAIItem, &targetNSSAIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetNSSAIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetNSSAIItem []ap.IESpec[ProtocolIEID, TargetNSSAIItem] + +func (targetNSSAIItem *TargetNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetNSSAIItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetNSSAIItem, targetNSSAIItem, targetNSSAIItem.iEExtensions) + return notComprehended +} + +func (targetRANNodeID *TargetRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetRANNodeID, targetRANNodeID, targetRANNodeID.iEExtensions) + w.WriteBit(targetRANNodeID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targetRANNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { + return err + } + if err := targetRANNodeID.SelectedTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetRANNodeID.extensions.Present() { + if err := targetRANNodeID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetRANNodeID *TargetRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetRANNodeID = TargetRANNodeID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetRANNodeID.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targetRANNodeID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRANNodeID, targetRANNodeID, &targetRANNodeID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetRANNodeID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetRANNodeID = []ap.IESpec[ProtocolIEID, TargetRANNodeID]{ + { + ID: IDSelectedTargetSNPNIdentity, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *TargetRANNodeID, r *per.Reader, enc per.Encoding) error { + var v NID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SelectedTargetSNPNIdentity = &v + return nil + }, + Encode: func(x *TargetRANNodeID) (per.Marshaler, bool) { + if x.SelectedTargetSNPNIdentity == nil { + return nil, false + } + return x.SelectedTargetSNPNIdentity, true + }, + }, +} + +func (targetRANNodeID *TargetRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetRANNodeID.GlobalRANNodeID.Diagnose(d) { + notComprehended = true + } + if targetRANNodeID.SelectedTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetRANNodeID, targetRANNodeID, targetRANNodeID.iEExtensions) + return notComprehended +} + +func (targetRANNodeIDSON *TargetRANNodeIDSON) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetRANNodeIDSON, targetRANNodeIDSON, targetRANNodeIDSON.iEExtensions) + w.WriteBit(targetRANNodeIDSON.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targetRANNodeIDSON.GlobalRANNodeID.MarshalPER(w, enc); err != nil { + return err + } + if err := targetRANNodeIDSON.SelectedTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetRANNodeIDSON.extensions.Present() { + if err := targetRANNodeIDSON.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetRANNodeIDSON *TargetRANNodeIDSON) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetRANNodeIDSON = TargetRANNodeIDSON{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetRANNodeIDSON.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targetRANNodeIDSON.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRANNodeIDSON, targetRANNodeIDSON, &targetRANNodeIDSON.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetRANNodeIDSON.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetRANNodeIDSON = []ap.IESpec[ProtocolIEID, TargetRANNodeIDSON]{ + { + ID: IDNRCGI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TargetRANNodeIDSON, r *per.Reader, enc per.Encoding) error { + var v NRCGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NRCGI = &v + return nil + }, + Encode: func(x *TargetRANNodeIDSON) (per.Marshaler, bool) { + if x.NRCGI == nil { + return nil, false + } + return x.NRCGI, true + }, + }, +} + +func (targetRANNodeIDSON *TargetRANNodeIDSON) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetRANNodeIDSON.GlobalRANNodeID.Diagnose(d) { + notComprehended = true + } + if targetRANNodeIDSON.SelectedTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetRANNodeIDSON, targetRANNodeIDSON, targetRANNodeIDSON.iEExtensions) + return notComprehended +} + +func (targetRNCID *TargetRNCID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + w.WriteBit(targetRNCID.extensions.Present()) + w.WriteBit(targetRNCID.ExtendedRNCID != nil) + w.WriteBit(len(ext) > 0) + if err := targetRNCID.LAI.MarshalPER(w, enc); err != nil { + return err + } + if err := targetRNCID.RNCID.MarshalPER(w, enc); err != nil { + return err + } + if targetRNCID.ExtendedRNCID != nil { + if err := (*targetRNCID.ExtendedRNCID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetRNCID.extensions.Present() { + if err := targetRNCID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetRNCID *TargetRNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetRNCID = TargetRNCID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ExtendedRNCID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetRNCID.LAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targetRNCID.RNCID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_ExtendedRNCID { + var v ExtendedRNCID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + targetRNCID.ExtendedRNCID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetRNCID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetRNCID []ap.IESpec[ProtocolIEID, TargetRNCID] + +func (targetRNCID *TargetRNCID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetRNCID.LAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + return notComprehended +} + +func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + w.WriteBit(targeteNBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targeteNBID.GlobalENBID.MarshalPER(w, enc); err != nil { + return err + } + if err := targeteNBID.SelectedEPSTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targeteNBID.extensions.Present() { + if err := targeteNBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targeteNBID = TargeteNBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targeteNBID.GlobalENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targeteNBID.SelectedEPSTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targeteNBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargeteNBID []ap.IESpec[ProtocolIEID, TargeteNBID] + +func (targeteNBID *TargeteNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targeteNBID.GlobalENBID.Diagnose(d) { + notComprehended = true + } + if targeteNBID.SelectedEPSTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + return notComprehended +} + +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + w.WriteBit(timeBasedHandoverInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := timeBasedHandoverInformation.HOWindowStart.MarshalPER(w, enc); err != nil { + return err + } + if err := timeBasedHandoverInformation.HOWindowDuration.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if timeBasedHandoverInformation.extensions.Present() { + if err := timeBasedHandoverInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *timeBasedHandoverInformation = TimeBasedHandoverInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&timeBasedHandoverInformation.HOWindowStart).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&timeBasedHandoverInformation.HOWindowDuration).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := timeBasedHandoverInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTimeBasedHandoverInformation []ap.IESpec[ProtocolIEID, TimeBasedHandoverInformation] + +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + return notComprehended +} + +func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, timeSyncAssistanceInfo.iEExtensions) + w.WriteBit(timeSyncAssistanceInfo.extensions.Present()) + w.WriteBit(timeSyncAssistanceInfo.UUTimeSyncErrorBudget != nil) + w.WriteBit(len(ext) > 0) + if err := timeSyncAssistanceInfo.TimeDistributionIndication.MarshalPER(w, enc); err != nil { + return err + } + if timeSyncAssistanceInfo.UUTimeSyncErrorBudget != nil { + if err := (*timeSyncAssistanceInfo.UUTimeSyncErrorBudget).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if timeSyncAssistanceInfo.extensions.Present() { + if err := timeSyncAssistanceInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *timeSyncAssistanceInfo = TimeSyncAssistanceInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UUTimeSyncErrorBudget, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&timeSyncAssistanceInfo.TimeDistributionIndication).UnmarshalPER(r, enc); err != nil { + return err + } + if p_UUTimeSyncErrorBudget { + var v TimeSyncAssistanceInfoUUTimeSyncErrorBudget + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + timeSyncAssistanceInfo.UUTimeSyncErrorBudget = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, &timeSyncAssistanceInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := timeSyncAssistanceInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTimeSyncAssistanceInfo = []ap.IESpec[ProtocolIEID, TimeSyncAssistanceInfo]{ + { + ID: IDClockQualityReportingControlInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TimeSyncAssistanceInfo, r *per.Reader, enc per.Encoding) error { + var v ClockQualityReportingControlInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ClockQualityReportingControlInfo = &v + return nil + }, + Encode: func(x *TimeSyncAssistanceInfo) (per.Marshaler, bool) { + if x.ClockQualityReportingControlInfo == nil { + return nil, false + } + return x.ClockQualityReportingControlInfo, true + }, + }, +} + +func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if timeSyncAssistanceInfo.TimeDistributionIndication.Diagnose(d) { + notComprehended = true + } + if timeSyncAssistanceInfo.UUTimeSyncErrorBudget != nil && timeSyncAssistanceInfo.UUTimeSyncErrorBudget.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, timeSyncAssistanceInfo.iEExtensions) + return notComprehended +} + +func (timeSyncAssistanceInfoTimeDistributionIndication TimeSyncAssistanceInfoTimeDistributionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTimeSyncAssistanceInfoTimeDistributionIndication.Encode(w, enc, timeSyncAssistanceInfoTimeDistributionIndication) +} + +func (timeSyncAssistanceInfoTimeDistributionIndication *TimeSyncAssistanceInfoTimeDistributionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTimeSyncAssistanceInfoTimeDistributionIndication.Decode(r, enc) + if err != nil { + return err + } + *timeSyncAssistanceInfoTimeDistributionIndication = v + return nil +} + +func (timeSyncAssistanceInfoTimeDistributionIndication TimeSyncAssistanceInfoTimeDistributionIndication) Name() string { + return enumTimeSyncAssistanceInfoTimeDistributionIndication.Name(timeSyncAssistanceInfoTimeDistributionIndication) +} + +func (timeSyncAssistanceInfoTimeDistributionIndication TimeSyncAssistanceInfoTimeDistributionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTimeSyncAssistanceInfoTimeDistributionIndication.Known(timeSyncAssistanceInfoTimeDistributionIndication) +} + +func (timeToTrigger TimeToTrigger) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTimeToTrigger.Encode(w, enc, timeToTrigger) +} + +func (timeToTrigger *TimeToTrigger) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTimeToTrigger.Decode(r, enc) + if err != nil { + return err + } + *timeToTrigger = v + return nil +} + +func (timeToTrigger TimeToTrigger) Name() string { + return enumTimeToTrigger.Name(timeToTrigger) +} + +func (timeToWait TimeToWait) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTimeToWait.Encode(w, enc, timeToWait) +} + +func (timeToWait *TimeToWait) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTimeToWait.Decode(r, enc) + if err != nil { + return err + } + *timeToWait = v + return nil +} + +func (timeToWait TimeToWait) Name() string { + return enumTimeToWait.Name(timeToWait) +} + +func (timeToWait TimeToWait) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTimeToWait.Known(timeToWait) +} + +func (timerApproachForGUAMIRemoval TimerApproachForGUAMIRemoval) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTimerApproachForGUAMIRemoval.Encode(w, enc, timerApproachForGUAMIRemoval) +} + +func (timerApproachForGUAMIRemoval *TimerApproachForGUAMIRemoval) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTimerApproachForGUAMIRemoval.Decode(r, enc) + if err != nil { + return err + } + *timerApproachForGUAMIRemoval = v + return nil +} + +func (timerApproachForGUAMIRemoval TimerApproachForGUAMIRemoval) Name() string { + return enumTimerApproachForGUAMIRemoval.Name(timerApproachForGUAMIRemoval) +} + +func (timerApproachForGUAMIRemoval TimerApproachForGUAMIRemoval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTimerApproachForGUAMIRemoval.Known(timerApproachForGUAMIRemoval) +} + +func (tooearlyIntersystemHO *TooearlyIntersystemHO) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, tooearlyIntersystemHO.iEExtensions) + w.WriteBit(tooearlyIntersystemHO.extensions.Present()) + w.WriteBit(tooearlyIntersystemHO.UERLFReportContainer != nil) + w.WriteBit(len(ext) > 0) + if err := tooearlyIntersystemHO.SourcecellID.MarshalPER(w, enc); err != nil { + return err + } + if err := tooearlyIntersystemHO.FailurecellID.MarshalPER(w, enc); err != nil { + return err + } + if tooearlyIntersystemHO.UERLFReportContainer != nil { + if err := (*tooearlyIntersystemHO.UERLFReportContainer).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tooearlyIntersystemHO.extensions.Present() { + if err := tooearlyIntersystemHO.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tooearlyIntersystemHO *TooearlyIntersystemHO) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tooearlyIntersystemHO = TooearlyIntersystemHO{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UERLFReportContainer, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tooearlyIntersystemHO.SourcecellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&tooearlyIntersystemHO.FailurecellID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_UERLFReportContainer { + var v UERLFReportContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tooearlyIntersystemHO.UERLFReportContainer = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, &tooearlyIntersystemHO.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tooearlyIntersystemHO.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTooearlyIntersystemHO []ap.IESpec[ProtocolIEID, TooearlyIntersystemHO] + +func (tooearlyIntersystemHO *TooearlyIntersystemHO) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tooearlyIntersystemHO.SourcecellID.Diagnose(d) { + notComprehended = true + } + if tooearlyIntersystemHO.FailurecellID.Diagnose(d) { + notComprehended = true + } + if tooearlyIntersystemHO.UERLFReportContainer != nil && tooearlyIntersystemHO.UERLFReportContainer.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, tooearlyIntersystemHO.iEExtensions) + return notComprehended +} + +func (traceActivation *TraceActivation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + w.WriteBit(traceActivation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := traceActivation.NGRANTraceID.MarshalPER(w, enc); err != nil { + return err + } + if err := traceActivation.InterfacesToTrace.MarshalPER(w, enc); err != nil { + return err + } + if err := traceActivation.TraceDepth.MarshalPER(w, enc); err != nil { + return err + } + if err := traceActivation.TraceCollectionEntityIPAddress.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if traceActivation.extensions.Present() { + if err := traceActivation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (traceActivation *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *traceActivation = TraceActivation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&traceActivation.NGRANTraceID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&traceActivation.InterfacesToTrace).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&traceActivation.TraceDepth).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&traceActivation.TraceCollectionEntityIPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := traceActivation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ + { + ID: IDMDTConfiguration, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { + var v MDTConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MDTConfiguration = &v + return nil + }, + Encode: func(x *TraceActivation) (per.Marshaler, bool) { + if x.MDTConfiguration == nil { + return nil, false + } + return x.MDTConfiguration, true + }, + }, + { + ID: IDTraceCollectionEntityURI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { + var v URIAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TraceCollectionEntityURI = &v + return nil + }, + Encode: func(x *TraceActivation) (per.Marshaler, bool) { + if x.TraceCollectionEntityURI == nil { + return nil, false + } + return x.TraceCollectionEntityURI, true + }, + }, +} + +func (traceActivation *TraceActivation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if traceActivation.TraceDepth.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + return notComprehended +} + +func (traceDepth TraceDepth) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTraceDepth.Encode(w, enc, traceDepth) +} + +func (traceDepth *TraceDepth) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTraceDepth.Decode(r, enc) + if err != nil { + return err + } + *traceDepth = v + return nil +} + +func (traceDepth TraceDepth) Name() string { + return enumTraceDepth.Name(traceDepth) +} + +func (traceDepth TraceDepth) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTraceDepth.Known(traceDepth) +} + +func (triggeringMessage TriggeringMessage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTriggeringMessage.Encode(w, enc, triggeringMessage) +} + +func (triggeringMessage *TriggeringMessage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTriggeringMessage.Decode(r, enc) + if err != nil { + return err + } + *triggeringMessage = v + return nil +} + +func (triggeringMessage TriggeringMessage) Name() string { + return enumTriggeringMessage.Name(triggeringMessage) +} + +func (typeOfError TypeOfError) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTypeOfError.Encode(w, enc, typeOfError) +} + +func (typeOfError *TypeOfError) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTypeOfError.Decode(r, enc) + if err != nil { + return err + } + *typeOfError = v + return nil +} + +func (typeOfError TypeOfError) Name() string { + return enumTypeOfError.Name(typeOfError) +} + +func (typeOfError TypeOfError) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTypeOfError.Known(typeOfError) +} + +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + w.WriteBit(uEAggregateMaximumBitRate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uEAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { + return err + } + if err := uEAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEAggregateMaximumBitRate.extensions.Present() { + if err := uEAggregateMaximumBitRate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEAggregateMaximumBitRate = UEAggregateMaximumBitRate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uEAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uEAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEAggregateMaximumBitRate.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEAggregateMaximumBitRate []ap.IESpec[ProtocolIEID, UEAggregateMaximumBitRate] + +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uEAggregateMaximumBitRate.DL.Diagnose(d) { + notComprehended = true + } + if uEAggregateMaximumBitRate.UL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + return notComprehended +} + +func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo.iEExtensions) + w.WriteBit(uEAppLayerMeasConfigInfo.extensions.Present()) + w.WriteBit(uEAppLayerMeasConfigInfo.AreaScopeOfQMC != nil) + w.WriteBit(uEAppLayerMeasConfigInfo.QoEMeasurementStatus != nil) + w.WriteBit(uEAppLayerMeasConfigInfo.ContainerForAppLayerMeasConfig != nil) + w.WriteBit(uEAppLayerMeasConfigInfo.MeasConfigAppLayerID != nil) + w.WriteBit(uEAppLayerMeasConfigInfo.SliceSupportListQMC != nil) + w.WriteBit(uEAppLayerMeasConfigInfo.MDTAlignmentInfo != nil) + w.WriteBit(uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics != nil) + w.WriteBit(len(ext) > 0) + if err := uEAppLayerMeasConfigInfo.QoEReference.MarshalPER(w, enc); err != nil { + return err + } + if err := uEAppLayerMeasConfigInfo.ServiceType.MarshalPER(w, enc); err != nil { + return err + } + if uEAppLayerMeasConfigInfo.AreaScopeOfQMC != nil { + if err := (*uEAppLayerMeasConfigInfo.AreaScopeOfQMC).MarshalPER(w, enc); err != nil { + return err + } + } + if err := uEAppLayerMeasConfigInfo.MeasCollEntityIPAddress.MarshalPER(w, enc); err != nil { + return err + } + if uEAppLayerMeasConfigInfo.QoEMeasurementStatus != nil { + if err := (*uEAppLayerMeasConfigInfo.QoEMeasurementStatus).MarshalPER(w, enc); err != nil { + return err + } + } + if uEAppLayerMeasConfigInfo.ContainerForAppLayerMeasConfig != nil { + if err := uEAppLayerMeasConfigInfo.ContainerForAppLayerMeasConfig.MarshalPER(w, enc); err != nil { + return err + } + } + if uEAppLayerMeasConfigInfo.MeasConfigAppLayerID != nil { + if err := (*uEAppLayerMeasConfigInfo.MeasConfigAppLayerID).MarshalPER(w, enc); err != nil { + return err + } + } + if uEAppLayerMeasConfigInfo.SliceSupportListQMC != nil { + if err := uEAppLayerMeasConfigInfo.SliceSupportListQMC.MarshalPER(w, enc); err != nil { + return err + } + } + if uEAppLayerMeasConfigInfo.MDTAlignmentInfo != nil { + if err := (*uEAppLayerMeasConfigInfo.MDTAlignmentInfo).MarshalPER(w, enc); err != nil { + return err + } + } + if uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics != nil { + if err := (*uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEAppLayerMeasConfigInfo.extensions.Present() { + if err := uEAppLayerMeasConfigInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEAppLayerMeasConfigInfo = UEAppLayerMeasConfigInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AreaScopeOfQMC, err := r.ReadBit() + if err != nil { + return err + } + p_QoEMeasurementStatus, err := r.ReadBit() + if err != nil { + return err + } + p_ContainerForAppLayerMeasConfig, err := r.ReadBit() + if err != nil { + return err + } + p_MeasConfigAppLayerID, err := r.ReadBit() + if err != nil { + return err + } + p_SliceSupportListQMC, err := r.ReadBit() + if err != nil { + return err + } + p_MDTAlignmentInfo, err := r.ReadBit() + if err != nil { + return err + } + p_AvailableRANVisibleQoEMetrics, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uEAppLayerMeasConfigInfo.QoEReference).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uEAppLayerMeasConfigInfo.ServiceType).UnmarshalPER(r, enc); err != nil { + return err + } + if p_AreaScopeOfQMC { + var v AreaScopeOfQMC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAppLayerMeasConfigInfo.AreaScopeOfQMC = &v + } + if err := (&uEAppLayerMeasConfigInfo.MeasCollEntityIPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_QoEMeasurementStatus { + var v UEAppLayerMeasConfigInfoQoEMeasurementStatus + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAppLayerMeasConfigInfo.QoEMeasurementStatus = &v + } + if p_ContainerForAppLayerMeasConfig { + if err := (&uEAppLayerMeasConfigInfo.ContainerForAppLayerMeasConfig).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_MeasConfigAppLayerID { + var v UEAppLayerMeasConfigInfoMeasConfigAppLayerID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAppLayerMeasConfigInfo.MeasConfigAppLayerID = &v + } + if p_SliceSupportListQMC { + if err := (&uEAppLayerMeasConfigInfo.SliceSupportListQMC).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_MDTAlignmentInfo { + var v MDTAlignmentInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAppLayerMeasConfigInfo.MDTAlignmentInfo = &v + } + if p_AvailableRANVisibleQoEMetrics { + var v AvailableRANVisibleQoEMetrics + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, &uEAppLayerMeasConfigInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEAppLayerMeasConfigInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEAppLayerMeasConfigInfo = []ap.IESpec[ProtocolIEID, UEAppLayerMeasConfigInfo]{ + { + ID: IDAssistanceInformationQoEMeas, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UEAppLayerMeasConfigInfo, r *per.Reader, enc per.Encoding) error { + var v AssistanceInformationQoEMeas + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AssistanceInformationQoEMeas = &v + return nil + }, + Encode: func(x *UEAppLayerMeasConfigInfo) (per.Marshaler, bool) { + if x.AssistanceInformationQoEMeas == nil { + return nil, false + } + return x.AssistanceInformationQoEMeas, true + }, + }, + { + ID: IDCommServiceType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UEAppLayerMeasConfigInfo, r *per.Reader, enc per.Encoding) error { + var v CommServiceType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CommServiceType = &v + return nil + }, + Encode: func(x *UEAppLayerMeasConfigInfo) (per.Marshaler, bool) { + if x.CommServiceType == nil { + return nil, false + } + return x.CommServiceType, true + }, + }, + { + ID: IDQoERVQoEReportingPaths, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UEAppLayerMeasConfigInfo, r *per.Reader, enc per.Encoding) error { + var v QoERVQoEReportingPaths + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.QoERVQoEReportingPaths = &v + return nil + }, + Encode: func(x *UEAppLayerMeasConfigInfo) (per.Marshaler, bool) { + if x.QoERVQoEReportingPaths == nil { + return nil, false + } + return x.QoERVQoEReportingPaths, true + }, + }, +} + +func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uEAppLayerMeasConfigInfo.ServiceType.Diagnose(d) { + notComprehended = true + } + if uEAppLayerMeasConfigInfo.AreaScopeOfQMC != nil && uEAppLayerMeasConfigInfo.AreaScopeOfQMC.Diagnose(d) { + notComprehended = true + } + if uEAppLayerMeasConfigInfo.QoEMeasurementStatus != nil && uEAppLayerMeasConfigInfo.QoEMeasurementStatus.Diagnose(d) { + notComprehended = true + } + if uEAppLayerMeasConfigInfo.MeasConfigAppLayerID != nil && uEAppLayerMeasConfigInfo.MeasConfigAppLayerID.Diagnose(d) { + notComprehended = true + } + if uEAppLayerMeasConfigInfo.SliceSupportListQMC.Diagnose(d) { + notComprehended = true + } + if uEAppLayerMeasConfigInfo.MDTAlignmentInfo != nil && uEAppLayerMeasConfigInfo.MDTAlignmentInfo.Diagnose(d) { + notComprehended = true + } + if uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics != nil && uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo.iEExtensions) + return notComprehended +} + +func (uEAppLayerMeasConfigInfoQoEMeasurementStatus UEAppLayerMeasConfigInfoQoEMeasurementStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEAppLayerMeasConfigInfoQoEMeasurementStatus.Encode(w, enc, uEAppLayerMeasConfigInfoQoEMeasurementStatus) +} + +func (uEAppLayerMeasConfigInfoQoEMeasurementStatus *UEAppLayerMeasConfigInfoQoEMeasurementStatus) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEAppLayerMeasConfigInfoQoEMeasurementStatus.Decode(r, enc) + if err != nil { + return err + } + *uEAppLayerMeasConfigInfoQoEMeasurementStatus = v + return nil +} + +func (uEAppLayerMeasConfigInfoQoEMeasurementStatus UEAppLayerMeasConfigInfoQoEMeasurementStatus) Name() string { + return enumUEAppLayerMeasConfigInfoQoEMeasurementStatus.Name(uEAppLayerMeasConfigInfoQoEMeasurementStatus) +} + +func (uEAppLayerMeasConfigInfoQoEMeasurementStatus UEAppLayerMeasConfigInfoQoEMeasurementStatus) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEAppLayerMeasConfigInfoQoEMeasurementStatus.Known(uEAppLayerMeasConfigInfoQoEMeasurementStatus) +} + +func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem.iEExtensions) + w.WriteBit(uEAppLayerMeasInfoItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uEAppLayerMeasInfoItem.UEAppLayerMeasConfigInfo.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEAppLayerMeasInfoItem.extensions.Present() { + if err := uEAppLayerMeasInfoItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEAppLayerMeasInfoItem = UEAppLayerMeasInfoItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uEAppLayerMeasInfoItem.UEAppLayerMeasConfigInfo).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, &uEAppLayerMeasInfoItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEAppLayerMeasInfoItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEAppLayerMeasInfoItem []ap.IESpec[ProtocolIEID, UEAppLayerMeasInfoItem] + +func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uEAppLayerMeasInfoItem.UEAppLayerMeasConfigInfo.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem.iEExtensions) + return notComprehended +} + +func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem.iEExtensions) + w.WriteBit(uEAssociatedLogicalNGConnectionItem.extensions.Present()) + w.WriteBit(uEAssociatedLogicalNGConnectionItem.AMFUENGAPID != nil) + w.WriteBit(uEAssociatedLogicalNGConnectionItem.RANUENGAPID != nil) + w.WriteBit(len(ext) > 0) + if uEAssociatedLogicalNGConnectionItem.AMFUENGAPID != nil { + if err := (*uEAssociatedLogicalNGConnectionItem.AMFUENGAPID).MarshalPER(w, enc); err != nil { + return err + } + } + if uEAssociatedLogicalNGConnectionItem.RANUENGAPID != nil { + if err := (*uEAssociatedLogicalNGConnectionItem.RANUENGAPID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEAssociatedLogicalNGConnectionItem.extensions.Present() { + if err := uEAssociatedLogicalNGConnectionItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEAssociatedLogicalNGConnectionItem = UEAssociatedLogicalNGConnectionItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AMFUENGAPID, err := r.ReadBit() + if err != nil { + return err + } + p_RANUENGAPID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_AMFUENGAPID { + var v AMFUENGAPID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAssociatedLogicalNGConnectionItem.AMFUENGAPID = &v + } + if p_RANUENGAPID { + var v RANUENGAPID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAssociatedLogicalNGConnectionItem.RANUENGAPID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, &uEAssociatedLogicalNGConnectionItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEAssociatedLogicalNGConnectionItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEAssociatedLogicalNGConnectionItem []ap.IESpec[ProtocolIEID, UEAssociatedLogicalNGConnectionItem] + +func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem.iEExtensions) + return notComprehended +} + +func (uECapabilityInfoRequest UECapabilityInfoRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUECapabilityInfoRequest.Encode(w, enc, uECapabilityInfoRequest) +} + +func (uECapabilityInfoRequest *UECapabilityInfoRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUECapabilityInfoRequest.Decode(r, enc) + if err != nil { + return err + } + *uECapabilityInfoRequest = v + return nil +} + +func (uECapabilityInfoRequest UECapabilityInfoRequest) Name() string { + return enumUECapabilityInfoRequest.Name(uECapabilityInfoRequest) +} + +func (uECapabilityInfoRequest UECapabilityInfoRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUECapabilityInfoRequest.Known(uECapabilityInfoRequest) +} + +func (uEContextRequest UEContextRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEContextRequest.Encode(w, enc, uEContextRequest) +} + +func (uEContextRequest *UEContextRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEContextRequest.Decode(r, enc) + if err != nil { + return err + } + *uEContextRequest = v + return nil +} + +func (uEContextRequest UEContextRequest) Name() string { + return enumUEContextRequest.Name(uEContextRequest) +} + +func (uEContextRequest UEContextRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEContextRequest.Known(uEContextRequest) +} + +func (uEDifferentiationInfo *UEDifferentiationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEDifferentiationInfo, uEDifferentiationInfo, uEDifferentiationInfo.iEExtensions) + w.WriteBit(uEDifferentiationInfo.extensions.Present()) + w.WriteBit(uEDifferentiationInfo.PeriodicCommunicationIndicator != nil) + w.WriteBit(uEDifferentiationInfo.PeriodicTime != nil) + w.WriteBit(uEDifferentiationInfo.ScheduledCommunicationTime != nil) + w.WriteBit(uEDifferentiationInfo.StationaryIndication != nil) + w.WriteBit(uEDifferentiationInfo.TrafficProfile != nil) + w.WriteBit(uEDifferentiationInfo.BatteryIndication != nil) + w.WriteBit(len(ext) > 0) + if uEDifferentiationInfo.PeriodicCommunicationIndicator != nil { + if err := (*uEDifferentiationInfo.PeriodicCommunicationIndicator).MarshalPER(w, enc); err != nil { + return err + } + } + if uEDifferentiationInfo.PeriodicTime != nil { + if err := (*uEDifferentiationInfo.PeriodicTime).MarshalPER(w, enc); err != nil { + return err + } + } + if uEDifferentiationInfo.ScheduledCommunicationTime != nil { + if err := (*uEDifferentiationInfo.ScheduledCommunicationTime).MarshalPER(w, enc); err != nil { + return err + } + } + if uEDifferentiationInfo.StationaryIndication != nil { + if err := (*uEDifferentiationInfo.StationaryIndication).MarshalPER(w, enc); err != nil { + return err + } + } + if uEDifferentiationInfo.TrafficProfile != nil { + if err := (*uEDifferentiationInfo.TrafficProfile).MarshalPER(w, enc); err != nil { + return err + } + } + if uEDifferentiationInfo.BatteryIndication != nil { + if err := (*uEDifferentiationInfo.BatteryIndication).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEDifferentiationInfo.extensions.Present() { + if err := uEDifferentiationInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEDifferentiationInfo *UEDifferentiationInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEDifferentiationInfo = UEDifferentiationInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PeriodicCommunicationIndicator, err := r.ReadBit() + if err != nil { + return err + } + p_PeriodicTime, err := r.ReadBit() + if err != nil { + return err + } + p_ScheduledCommunicationTime, err := r.ReadBit() + if err != nil { + return err + } + p_StationaryIndication, err := r.ReadBit() + if err != nil { + return err + } + p_TrafficProfile, err := r.ReadBit() + if err != nil { + return err + } + p_BatteryIndication, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_PeriodicCommunicationIndicator { + var v UEDifferentiationInfoPeriodicCommunicationIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEDifferentiationInfo.PeriodicCommunicationIndicator = &v + } + if p_PeriodicTime { + var v UEDifferentiationInfoPeriodicTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEDifferentiationInfo.PeriodicTime = &v + } + if p_ScheduledCommunicationTime { + var v ScheduledCommunicationTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEDifferentiationInfo.ScheduledCommunicationTime = &v + } + if p_StationaryIndication { + var v UEDifferentiationInfoStationaryIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEDifferentiationInfo.StationaryIndication = &v + } + if p_TrafficProfile { + var v UEDifferentiationInfoTrafficProfile + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEDifferentiationInfo.TrafficProfile = &v + } + if p_BatteryIndication { + var v UEDifferentiationInfoBatteryIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEDifferentiationInfo.BatteryIndication = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEDifferentiationInfo, uEDifferentiationInfo, &uEDifferentiationInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEDifferentiationInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEDifferentiationInfo []ap.IESpec[ProtocolIEID, UEDifferentiationInfo] + +func (uEDifferentiationInfo *UEDifferentiationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uEDifferentiationInfo.PeriodicCommunicationIndicator != nil && uEDifferentiationInfo.PeriodicCommunicationIndicator.Diagnose(d) { + notComprehended = true + } + if uEDifferentiationInfo.PeriodicTime != nil && uEDifferentiationInfo.PeriodicTime.Diagnose(d) { + notComprehended = true + } + if uEDifferentiationInfo.ScheduledCommunicationTime != nil && uEDifferentiationInfo.ScheduledCommunicationTime.Diagnose(d) { + notComprehended = true + } + if uEDifferentiationInfo.StationaryIndication != nil && uEDifferentiationInfo.StationaryIndication.Diagnose(d) { + notComprehended = true + } + if uEDifferentiationInfo.TrafficProfile != nil && uEDifferentiationInfo.TrafficProfile.Diagnose(d) { + notComprehended = true + } + if uEDifferentiationInfo.BatteryIndication != nil && uEDifferentiationInfo.BatteryIndication.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUEDifferentiationInfo, uEDifferentiationInfo, uEDifferentiationInfo.iEExtensions) + return notComprehended +} + +func (uEDifferentiationInfoBatteryIndication UEDifferentiationInfoBatteryIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEDifferentiationInfoBatteryIndication.Encode(w, enc, uEDifferentiationInfoBatteryIndication) +} + +func (uEDifferentiationInfoBatteryIndication *UEDifferentiationInfoBatteryIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEDifferentiationInfoBatteryIndication.Decode(r, enc) + if err != nil { + return err + } + *uEDifferentiationInfoBatteryIndication = v + return nil +} + +func (uEDifferentiationInfoBatteryIndication UEDifferentiationInfoBatteryIndication) Name() string { + return enumUEDifferentiationInfoBatteryIndication.Name(uEDifferentiationInfoBatteryIndication) +} + +func (uEDifferentiationInfoBatteryIndication UEDifferentiationInfoBatteryIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEDifferentiationInfoBatteryIndication.Known(uEDifferentiationInfoBatteryIndication) +} + +func (uEDifferentiationInfoPeriodicCommunicationIndicator UEDifferentiationInfoPeriodicCommunicationIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEDifferentiationInfoPeriodicCommunicationIndicator.Encode(w, enc, uEDifferentiationInfoPeriodicCommunicationIndicator) +} + +func (uEDifferentiationInfoPeriodicCommunicationIndicator *UEDifferentiationInfoPeriodicCommunicationIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEDifferentiationInfoPeriodicCommunicationIndicator.Decode(r, enc) + if err != nil { + return err + } + *uEDifferentiationInfoPeriodicCommunicationIndicator = v + return nil +} + +func (uEDifferentiationInfoPeriodicCommunicationIndicator UEDifferentiationInfoPeriodicCommunicationIndicator) Name() string { + return enumUEDifferentiationInfoPeriodicCommunicationIndicator.Name(uEDifferentiationInfoPeriodicCommunicationIndicator) +} + +func (uEDifferentiationInfoPeriodicCommunicationIndicator UEDifferentiationInfoPeriodicCommunicationIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEDifferentiationInfoPeriodicCommunicationIndicator.Known(uEDifferentiationInfoPeriodicCommunicationIndicator) +} + +func (uEDifferentiationInfoStationaryIndication UEDifferentiationInfoStationaryIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEDifferentiationInfoStationaryIndication.Encode(w, enc, uEDifferentiationInfoStationaryIndication) +} + +func (uEDifferentiationInfoStationaryIndication *UEDifferentiationInfoStationaryIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEDifferentiationInfoStationaryIndication.Decode(r, enc) + if err != nil { + return err + } + *uEDifferentiationInfoStationaryIndication = v + return nil +} + +func (uEDifferentiationInfoStationaryIndication UEDifferentiationInfoStationaryIndication) Name() string { + return enumUEDifferentiationInfoStationaryIndication.Name(uEDifferentiationInfoStationaryIndication) +} + +func (uEDifferentiationInfoStationaryIndication UEDifferentiationInfoStationaryIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEDifferentiationInfoStationaryIndication.Known(uEDifferentiationInfoStationaryIndication) +} + +func (uEDifferentiationInfoTrafficProfile UEDifferentiationInfoTrafficProfile) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEDifferentiationInfoTrafficProfile.Encode(w, enc, uEDifferentiationInfoTrafficProfile) +} + +func (uEDifferentiationInfoTrafficProfile *UEDifferentiationInfoTrafficProfile) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEDifferentiationInfoTrafficProfile.Decode(r, enc) + if err != nil { + return err + } + *uEDifferentiationInfoTrafficProfile = v + return nil +} + +func (uEDifferentiationInfoTrafficProfile UEDifferentiationInfoTrafficProfile) Name() string { + return enumUEDifferentiationInfoTrafficProfile.Name(uEDifferentiationInfoTrafficProfile) +} + +func (uEDifferentiationInfoTrafficProfile UEDifferentiationInfoTrafficProfile) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEDifferentiationInfoTrafficProfile.Known(uEDifferentiationInfoTrafficProfile) +} + +func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uEHistoryInformationFromTheUE.NR != nil, uEHistoryInformationFromTheUE.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uEHistoryInformationFromTheUE.NR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*uEHistoryInformationFromTheUE.NR).MarshalPER(w, enc); err != nil { + return err + } + case uEHistoryInformationFromTheUE.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, uEHistoryInformationFromTheUE.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEHistoryInformationFromTheUE = UEHistoryInformationFromTheUE{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v NRMobilityHistoryReport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEHistoryInformationFromTheUE.NR = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + uEHistoryInformationFromTheUE.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uEHistoryInformationFromTheUE.NR != nil: + case uEHistoryInformationFromTheUE.ChoiceExtension != nil: + d.Unknown(uEHistoryInformationFromTheUE.ChoiceExtension.ID, uEHistoryInformationFromTheUE.ChoiceExtension.Criticality) + } + return false +} + +func (uEIdentityIndexValue *UEIdentityIndexValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uEIdentityIndexValue.IndexLength10 != nil, uEIdentityIndexValue.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uEIdentityIndexValue.IndexLength10 != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*uEIdentityIndexValue.IndexLength10).MarshalPER(w, enc); err != nil { + return err + } + case uEIdentityIndexValue.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, uEIdentityIndexValue.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (uEIdentityIndexValue *UEIdentityIndexValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEIdentityIndexValue = UEIdentityIndexValue{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v UEIdentityIndexValueIndexLength10 + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEIdentityIndexValue.IndexLength10 = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + uEIdentityIndexValue.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (uEIdentityIndexValue *UEIdentityIndexValue) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uEIdentityIndexValue.IndexLength10 != nil: + case uEIdentityIndexValue.ChoiceExtension != nil: + d.Unknown(uEIdentityIndexValue.ChoiceExtension.ID, uEIdentityIndexValue.ChoiceExtension.Criticality) + } + return false +} + +func (uENGAPIDPair *UENGAPIDPair) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUENGAPIDPair, uENGAPIDPair, uENGAPIDPair.iEExtensions) + w.WriteBit(uENGAPIDPair.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uENGAPIDPair.AMFUENGAPID.MarshalPER(w, enc); err != nil { + return err + } + if err := uENGAPIDPair.RANUENGAPID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uENGAPIDPair.extensions.Present() { + if err := uENGAPIDPair.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uENGAPIDPair *UENGAPIDPair) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uENGAPIDPair = UENGAPIDPair{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uENGAPIDPair.AMFUENGAPID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uENGAPIDPair.RANUENGAPID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUENGAPIDPair, uENGAPIDPair, &uENGAPIDPair.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uENGAPIDPair.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUENGAPIDPair []ap.IESpec[ProtocolIEID, UENGAPIDPair] + +func (uENGAPIDPair *UENGAPIDPair) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUENGAPIDPair, uENGAPIDPair, uENGAPIDPair.iEExtensions) + return notComprehended +} + +func (uENGAPIDs *UENGAPIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uENGAPIDs.UENGAPIDPair != nil, uENGAPIDs.AMFUENGAPID != nil, uENGAPIDs.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uENGAPIDs.UENGAPIDPair != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*uENGAPIDs.UENGAPIDPair).MarshalPER(w, enc); err != nil { + return err + } + case uENGAPIDs.AMFUENGAPID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*uENGAPIDs.AMFUENGAPID).MarshalPER(w, enc); err != nil { + return err + } + case uENGAPIDs.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, uENGAPIDs.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (uENGAPIDs *UENGAPIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uENGAPIDs = UENGAPIDs{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v UENGAPIDPair + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uENGAPIDs.UENGAPIDPair = &v + case 1: + var v AMFUENGAPID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uENGAPIDs.AMFUENGAPID = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + uENGAPIDs.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (uENGAPIDs *UENGAPIDs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uENGAPIDs.UENGAPIDPair != nil: + return uENGAPIDs.UENGAPIDPair.Diagnose(d) + case uENGAPIDs.AMFUENGAPID != nil: + case uENGAPIDs.ChoiceExtension != nil: + d.Unknown(uENGAPIDs.ChoiceExtension.ID, uENGAPIDs.ChoiceExtension.Criticality) + } + return false +} + +func (uEPagingIdentity *UEPagingIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uEPagingIdentity.FiveGSTMSI != nil, uEPagingIdentity.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uEPagingIdentity.FiveGSTMSI != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*uEPagingIdentity.FiveGSTMSI).MarshalPER(w, enc); err != nil { + return err + } + case uEPagingIdentity.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, uEPagingIdentity.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (uEPagingIdentity *UEPagingIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEPagingIdentity = UEPagingIdentity{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v FiveGSTMSI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEPagingIdentity.FiveGSTMSI = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + uEPagingIdentity.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (uEPagingIdentity *UEPagingIdentity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uEPagingIdentity.FiveGSTMSI != nil: + return uEPagingIdentity.FiveGSTMSI.Diagnose(d) + case uEPagingIdentity.ChoiceExtension != nil: + d.Unknown(uEPagingIdentity.ChoiceExtension.ID, uEPagingIdentity.ChoiceExtension.Criticality) + } + return false +} + +func (uEPresence UEPresence) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEPresence.Encode(w, enc, uEPresence) +} + +func (uEPresence *UEPresence) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEPresence.Decode(r, enc) + if err != nil { + return err + } + *uEPresence = v + return nil +} + +func (uEPresence UEPresence) Name() string { + return enumUEPresence.Name(uEPresence) +} + +func (uEPresence UEPresence) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEPresence.Known(uEPresence) +} + +func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem.iEExtensions) + w.WriteBit(uEPresenceInAreaOfInterestItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uEPresenceInAreaOfInterestItem.LocationReportingReferenceID.MarshalPER(w, enc); err != nil { + return err + } + if err := uEPresenceInAreaOfInterestItem.UEPresence.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEPresenceInAreaOfInterestItem.extensions.Present() { + if err := uEPresenceInAreaOfInterestItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEPresenceInAreaOfInterestItem = UEPresenceInAreaOfInterestItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uEPresenceInAreaOfInterestItem.LocationReportingReferenceID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uEPresenceInAreaOfInterestItem.UEPresence).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, &uEPresenceInAreaOfInterestItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEPresenceInAreaOfInterestItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEPresenceInAreaOfInterestItem []ap.IESpec[ProtocolIEID, UEPresenceInAreaOfInterestItem] + +func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uEPresenceInAreaOfInterestItem.LocationReportingReferenceID.Diagnose(d) { + notComprehended = true + } + if uEPresenceInAreaOfInterestItem.UEPresence.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem.iEExtensions) + return notComprehended +} + +func (uERLFReportContainer *UERLFReportContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uERLFReportContainer.NR != nil, uERLFReportContainer.LTE != nil, uERLFReportContainer.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uERLFReportContainer.NR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*uERLFReportContainer.NR).MarshalPER(w, enc); err != nil { + return err + } + case uERLFReportContainer.LTE != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*uERLFReportContainer.LTE).MarshalPER(w, enc); err != nil { + return err + } + case uERLFReportContainer.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, uERLFReportContainer.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (uERLFReportContainer *UERLFReportContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uERLFReportContainer = UERLFReportContainer{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v NRUERLFReportContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uERLFReportContainer.NR = &v + case 1: + var v LTEUERLFReportContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uERLFReportContainer.LTE = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + uERLFReportContainer.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (uERLFReportContainer *UERLFReportContainer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uERLFReportContainer.NR != nil: + case uERLFReportContainer.LTE != nil: + case uERLFReportContainer.ChoiceExtension != nil: + d.Unknown(uERLFReportContainer.ChoiceExtension.ID, uERLFReportContainer.ChoiceExtension.Criticality) + } + return false +} + +func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, uERadioCapabilityForPaging.iEExtensions) + w.WriteBit(uERadioCapabilityForPaging.extensions.Present()) + w.WriteBit(uERadioCapabilityForPaging.NR != nil) + w.WriteBit(uERadioCapabilityForPaging.EUTRA != nil) + w.WriteBit(len(ext) > 0) + if uERadioCapabilityForPaging.NR != nil { + if err := (*uERadioCapabilityForPaging.NR).MarshalPER(w, enc); err != nil { + return err + } + } + if uERadioCapabilityForPaging.EUTRA != nil { + if err := (*uERadioCapabilityForPaging.EUTRA).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uERadioCapabilityForPaging.extensions.Present() { + if err := uERadioCapabilityForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uERadioCapabilityForPaging = UERadioCapabilityForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NR, err := r.ReadBit() + if err != nil { + return err + } + p_EUTRA, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_NR { + var v UERadioCapabilityForPagingOfNR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uERadioCapabilityForPaging.NR = &v + } + if p_EUTRA { + var v UERadioCapabilityForPagingOfEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uERadioCapabilityForPaging.EUTRA = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, &uERadioCapabilityForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uERadioCapabilityForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUERadioCapabilityForPaging = []ap.IESpec[ProtocolIEID, UERadioCapabilityForPaging]{ + { + ID: IDUERadioCapabilityForPagingOfNBIoT, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UERadioCapabilityForPaging, r *per.Reader, enc per.Encoding) error { + var v UERadioCapabilityForPagingOfNBIoT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NBIoT = &v + return nil + }, + Encode: func(x *UERadioCapabilityForPaging) (per.Marshaler, bool) { + if x.NBIoT == nil { + return nil, false + } + return x.NBIoT, true + }, + }, +} + +func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, uERadioCapabilityForPaging.iEExtensions) + return notComprehended +} + +func (uERetentionInformation UERetentionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUERetentionInformation.Encode(w, enc, uERetentionInformation) +} + +func (uERetentionInformation *UERetentionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUERetentionInformation.Decode(r, enc) + if err != nil { + return err + } + *uERetentionInformation = v + return nil +} + +func (uERetentionInformation UERetentionInformation) Name() string { + return enumUERetentionInformation.Name(uERetentionInformation) +} + +func (uERetentionInformation UERetentionInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUERetentionInformation.Known(uERetentionInformation) +} + +func (uESecurityCapabilities *UESecurityCapabilities) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + w.WriteBit(uESecurityCapabilities.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uESecurityCapabilities.NREncryptionAlgorithms.MarshalPER(w, enc); err != nil { + return err + } + if err := uESecurityCapabilities.NRIntegrityProtectionAlgorithms.MarshalPER(w, enc); err != nil { + return err + } + if err := uESecurityCapabilities.EUTRAEncryptionAlgorithms.MarshalPER(w, enc); err != nil { + return err + } + if err := uESecurityCapabilities.EUTRAIntegrityProtectionAlgorithms.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uESecurityCapabilities.extensions.Present() { + if err := uESecurityCapabilities.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uESecurityCapabilities *UESecurityCapabilities) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uESecurityCapabilities = UESecurityCapabilities{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uESecurityCapabilities.NREncryptionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uESecurityCapabilities.NRIntegrityProtectionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uESecurityCapabilities.EUTRAEncryptionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uESecurityCapabilities.EUTRAIntegrityProtectionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uESecurityCapabilities.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUESecurityCapabilities []ap.IESpec[ProtocolIEID, UESecurityCapabilities] + +func (uESecurityCapabilities *UESecurityCapabilities) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + return notComprehended +} + +func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, uESliceMaximumBitRateItem.iEExtensions) + w.WriteBit(uESliceMaximumBitRateItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uESliceMaximumBitRateItem.SNSSAI.MarshalPER(w, enc); err != nil { + return err + } + if err := uESliceMaximumBitRateItem.UESliceMaximumBitRateDL.MarshalPER(w, enc); err != nil { + return err + } + if err := uESliceMaximumBitRateItem.UESliceMaximumBitRateUL.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uESliceMaximumBitRateItem.extensions.Present() { + if err := uESliceMaximumBitRateItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uESliceMaximumBitRateItem = UESliceMaximumBitRateItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uESliceMaximumBitRateItem.SNSSAI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uESliceMaximumBitRateItem.UESliceMaximumBitRateDL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uESliceMaximumBitRateItem.UESliceMaximumBitRateUL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, &uESliceMaximumBitRateItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uESliceMaximumBitRateItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUESliceMaximumBitRateItem []ap.IESpec[ProtocolIEID, UESliceMaximumBitRateItem] + +func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uESliceMaximumBitRateItem.SNSSAI.Diagnose(d) { + notComprehended = true + } + if uESliceMaximumBitRateItem.UESliceMaximumBitRateDL.Diagnose(d) { + notComprehended = true + } + if uESliceMaximumBitRateItem.UESliceMaximumBitRateUL.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, uESliceMaximumBitRateItem.iEExtensions) + return notComprehended +} + +func (uEUPCIoTSupport UEUPCIoTSupport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEUPCIoTSupport.Encode(w, enc, uEUPCIoTSupport) +} + +func (uEUPCIoTSupport *UEUPCIoTSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEUPCIoTSupport.Decode(r, enc) + if err != nil { + return err + } + *uEUPCIoTSupport = v + return nil +} + +func (uEUPCIoTSupport UEUPCIoTSupport) Name() string { + return enumUEUPCIoTSupport.Name(uEUPCIoTSupport) +} + +func (uEUPCIoTSupport UEUPCIoTSupport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUEUPCIoTSupport.Known(uEUPCIoTSupport) +} + +func (uLForwarding ULForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumULForwarding.Encode(w, enc, uLForwarding) +} + +func (uLForwarding *ULForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumULForwarding.Decode(r, enc) + if err != nil { + return err + } + *uLForwarding = v + return nil +} + +func (uLForwarding ULForwarding) Name() string { + return enumULForwarding.Name(uLForwarding) +} + +func (uLForwarding ULForwarding) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumULForwarding.Known(uLForwarding) +} + +func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, uLNGUUPTNLModifyItem.iEExtensions) + w.WriteBit(uLNGUUPTNLModifyItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uLNGUUPTNLModifyItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if err := uLNGUUPTNLModifyItem.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uLNGUUPTNLModifyItem.extensions.Present() { + if err := uLNGUUPTNLModifyItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uLNGUUPTNLModifyItem = ULNGUUPTNLModifyItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uLNGUUPTNLModifyItem.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uLNGUUPTNLModifyItem.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uLNGUUPTNLModifyItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsULNGUUPTNLModifyItem = []ap.IESpec[ProtocolIEID, ULNGUUPTNLModifyItem]{ + { + ID: IDRedundantULNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ULNGUUPTNLModifyItem, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantULNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *ULNGUUPTNLModifyItem) (per.Marshaler, bool) { + if x.RedundantULNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantULNGUUPTNLInformation, true + }, + }, + { + ID: IDRedundantDLNGUUPTNLInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ULNGUUPTNLModifyItem, r *per.Reader, enc per.Encoding) error { + var v UPTransportLayerInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RedundantDLNGUUPTNLInformation = &v + return nil + }, + Encode: func(x *ULNGUUPTNLModifyItem) (per.Marshaler, bool) { + if x.RedundantDLNGUUPTNLInformation == nil { + return nil, false + } + return x.RedundantDLNGUUPTNLInformation, true + }, + }, +} + +func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uLNGUUPTNLModifyItem.ULNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if uLNGUUPTNLModifyItem.DLNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, uLNGUUPTNLModifyItem.iEExtensions) + return notComprehended +} + +func (uPTransportLayerInformation *UPTransportLayerInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uPTransportLayerInformation.GTPTunnel != nil, uPTransportLayerInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uPTransportLayerInformation.GTPTunnel != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*uPTransportLayerInformation.GTPTunnel).MarshalPER(w, enc); err != nil { + return err + } + case uPTransportLayerInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, uPTransportLayerInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (uPTransportLayerInformation *UPTransportLayerInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uPTransportLayerInformation = UPTransportLayerInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v GTPTunnel + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uPTransportLayerInformation.GTPTunnel = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + uPTransportLayerInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (uPTransportLayerInformation *UPTransportLayerInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uPTransportLayerInformation.GTPTunnel != nil: + return uPTransportLayerInformation.GTPTunnel.Diagnose(d) + case uPTransportLayerInformation.ChoiceExtension != nil: + d.Unknown(uPTransportLayerInformation.ChoiceExtension.ID, uPTransportLayerInformation.ChoiceExtension.Criticality) + } + return false +} + +func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, uPTransportLayerInformationItem.iEExtensions) + w.WriteBit(uPTransportLayerInformationItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uPTransportLayerInformationItem.NGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uPTransportLayerInformationItem.extensions.Present() { + if err := uPTransportLayerInformationItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uPTransportLayerInformationItem = UPTransportLayerInformationItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uPTransportLayerInformationItem.NGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, &uPTransportLayerInformationItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uPTransportLayerInformationItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUPTransportLayerInformationItem = []ap.IESpec[ProtocolIEID, UPTransportLayerInformationItem]{ + { + ID: IDCommonNetworkInstance, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UPTransportLayerInformationItem, r *per.Reader, enc per.Encoding) error { + var v CommonNetworkInstance + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CommonNetworkInstance = &v + return nil + }, + Encode: func(x *UPTransportLayerInformationItem) (per.Marshaler, bool) { + if x.CommonNetworkInstance == nil { + return nil, false + } + return x.CommonNetworkInstance, true + }, + }, +} + +func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uPTransportLayerInformationItem.NGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, uPTransportLayerInformationItem.iEExtensions) + return notComprehended +} + +func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem.iEExtensions) + w.WriteBit(uPTransportLayerInformationPairItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uPTransportLayerInformationPairItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if err := uPTransportLayerInformationPairItem.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uPTransportLayerInformationPairItem.extensions.Present() { + if err := uPTransportLayerInformationPairItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uPTransportLayerInformationPairItem = UPTransportLayerInformationPairItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uPTransportLayerInformationPairItem.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uPTransportLayerInformationPairItem.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, &uPTransportLayerInformationPairItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uPTransportLayerInformationPairItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUPTransportLayerInformationPairItem []ap.IESpec[ProtocolIEID, UPTransportLayerInformationPairItem] + +func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if uPTransportLayerInformationPairItem.ULNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if uPTransportLayerInformationPairItem.DLNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem.iEExtensions) + return notComprehended +} + +func (unavailableGUAMIItem *UnavailableGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUnavailableGUAMIItem, unavailableGUAMIItem, unavailableGUAMIItem.iEExtensions) + w.WriteBit(unavailableGUAMIItem.extensions.Present()) + w.WriteBit(unavailableGUAMIItem.TimerApproachForGUAMIRemoval != nil) + w.WriteBit(unavailableGUAMIItem.BackupAMFName != nil) + w.WriteBit(len(ext) > 0) + if err := unavailableGUAMIItem.GUAMI.MarshalPER(w, enc); err != nil { + return err + } + if unavailableGUAMIItem.TimerApproachForGUAMIRemoval != nil { + if err := (*unavailableGUAMIItem.TimerApproachForGUAMIRemoval).MarshalPER(w, enc); err != nil { + return err + } + } + if unavailableGUAMIItem.BackupAMFName != nil { + if err := (*unavailableGUAMIItem.BackupAMFName).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if unavailableGUAMIItem.extensions.Present() { + if err := unavailableGUAMIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (unavailableGUAMIItem *UnavailableGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *unavailableGUAMIItem = UnavailableGUAMIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TimerApproachForGUAMIRemoval, err := r.ReadBit() + if err != nil { + return err + } + p_BackupAMFName, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&unavailableGUAMIItem.GUAMI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TimerApproachForGUAMIRemoval { + var v TimerApproachForGUAMIRemoval + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + unavailableGUAMIItem.TimerApproachForGUAMIRemoval = &v + } + if p_BackupAMFName { + var v Name + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + unavailableGUAMIItem.BackupAMFName = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUnavailableGUAMIItem, unavailableGUAMIItem, &unavailableGUAMIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := unavailableGUAMIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUnavailableGUAMIItem = []ap.IESpec[ProtocolIEID, UnavailableGUAMIItem]{ + { + ID: IDExtendedBackupAMFName, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UnavailableGUAMIItem, r *per.Reader, enc per.Encoding) error { + var v ExtendedAMFName + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedBackupAMFName = &v + return nil + }, + Encode: func(x *UnavailableGUAMIItem) (per.Marshaler, bool) { + if x.ExtendedBackupAMFName == nil { + return nil, false + } + return x.ExtendedBackupAMFName, true + }, + }, +} + +func (unavailableGUAMIItem *UnavailableGUAMIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if unavailableGUAMIItem.GUAMI.Diagnose(d) { + notComprehended = true + } + if unavailableGUAMIItem.TimerApproachForGUAMIRemoval != nil && unavailableGUAMIItem.TimerApproachForGUAMIRemoval.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUnavailableGUAMIItem, unavailableGUAMIItem, unavailableGUAMIItem.iEExtensions) + return notComprehended +} + +func (userLocationInformation *UserLocationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{userLocationInformation.EUTRA != nil, userLocationInformation.NR != nil, userLocationInformation.N3IWF != nil, userLocationInformation.TNGF != nil, userLocationInformation.TWIF != nil, userLocationInformation.WAGF != nil, userLocationInformation.N3IWFWithoutPortNumber != nil, userLocationInformation.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case userLocationInformation.EUTRA != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 0); err != nil { + return err + } + if err := (*userLocationInformation.EUTRA).MarshalPER(w, enc); err != nil { + return err + } + case userLocationInformation.NR != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 1); err != nil { + return err + } + if err := (*userLocationInformation.NR).MarshalPER(w, enc); err != nil { + return err + } + case userLocationInformation.N3IWF != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 2); err != nil { + return err + } + if err := (*userLocationInformation.N3IWF).MarshalPER(w, enc); err != nil { + return err + } + case userLocationInformation.TNGF != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationTNGF, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.TNGF}) + case userLocationInformation.TWIF != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationTWIF, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.TWIF}) + case userLocationInformation.WAGF != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationWAGF, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.WAGF}) + case userLocationInformation.N3IWFWithoutPortNumber != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationN3IWFwithoutPortNumber, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.N3IWFWithoutPortNumber}) + case userLocationInformation.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, userLocationInformation.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (userLocationInformation *UserLocationInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformation = UserLocationInformation{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 3) + if err != nil { + return err + } + switch idx { + case 0: + var v UserLocationInformationEUTRA + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformation.EUTRA = &v + case 1: + var v UserLocationInformationNR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformation.NR = &v + case 2: + var v UserLocationInformationN3IWFWithPortNumber + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformation.N3IWF = &v + case 3: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDUserLocationInformationTNGF: + var v UserLocationInformationTNGF + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + userLocationInformation.ChoiceExtension = &f + break + } + userLocationInformation.TNGF = &v + userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDUserLocationInformationTWIF: + var v UserLocationInformationTWIF + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + userLocationInformation.ChoiceExtension = &f + break + } + userLocationInformation.TWIF = &v + userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDUserLocationInformationWAGF: + var v UserLocationInformationWAGF + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + userLocationInformation.ChoiceExtension = &f + break + } + userLocationInformation.WAGF = &v + userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDUserLocationInformationN3IWFwithoutPortNumber: + var v UserLocationInformationN3IWFWithoutPortNumber + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + userLocationInformation.ChoiceExtension = &f + break + } + userLocationInformation.N3IWFWithoutPortNumber = &v + userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + default: + userLocationInformation.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (userLocationInformation *UserLocationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case userLocationInformation.EUTRA != nil: + return userLocationInformation.EUTRA.Diagnose(d) + case userLocationInformation.NR != nil: + return userLocationInformation.NR.Diagnose(d) + case userLocationInformation.N3IWF != nil: + return userLocationInformation.N3IWF.Diagnose(d) + case userLocationInformation.TNGF != nil: + d.IE(IDUserLocationInformationTNGF, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.TNGF) + case userLocationInformation.TWIF != nil: + d.IE(IDUserLocationInformationTWIF, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.TWIF) + case userLocationInformation.WAGF != nil: + d.IE(IDUserLocationInformationWAGF, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.WAGF) + case userLocationInformation.N3IWFWithoutPortNumber != nil: + d.IE(IDUserLocationInformationN3IWFwithoutPortNumber, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.N3IWFWithoutPortNumber) + case userLocationInformation.ChoiceExtension != nil: + d.Unknown(userLocationInformation.ChoiceExtension.ID, userLocationInformation.ChoiceExtension.Criticality) + } + return false +} + +func (userLocationInformationEUTRA *UserLocationInformationEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, userLocationInformationEUTRA.iEExtensions) + w.WriteBit(userLocationInformationEUTRA.extensions.Present()) + w.WriteBit(userLocationInformationEUTRA.TimeStamp != nil) + w.WriteBit(len(ext) > 0) + if err := userLocationInformationEUTRA.EUTRACGI.MarshalPER(w, enc); err != nil { + return err + } + if err := userLocationInformationEUTRA.TAI.MarshalPER(w, enc); err != nil { + return err + } + if userLocationInformationEUTRA.TimeStamp != nil { + if err := (*userLocationInformationEUTRA.TimeStamp).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userLocationInformationEUTRA.extensions.Present() { + if err := userLocationInformationEUTRA.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userLocationInformationEUTRA *UserLocationInformationEUTRA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformationEUTRA = UserLocationInformationEUTRA{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TimeStamp, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userLocationInformationEUTRA.EUTRACGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userLocationInformationEUTRA.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TimeStamp { + var v TimeStamp + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformationEUTRA.TimeStamp = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, &userLocationInformationEUTRA.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userLocationInformationEUTRA.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserLocationInformationEUTRA = []ap.IESpec[ProtocolIEID, UserLocationInformationEUTRA]{ + { + ID: IDPSCellInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationEUTRA, r *per.Reader, enc per.Encoding) error { + var v NGRANCGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PSCellInformation = &v + return nil + }, + Encode: func(x *UserLocationInformationEUTRA) (per.Marshaler, bool) { + if x.PSCellInformation == nil { + return nil, false + } + return x.PSCellInformation, true + }, + }, +} + +func (userLocationInformationEUTRA *UserLocationInformationEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if userLocationInformationEUTRA.EUTRACGI.Diagnose(d) { + notComprehended = true + } + if userLocationInformationEUTRA.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, userLocationInformationEUTRA.iEExtensions) + return notComprehended +} + +func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWithPortNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber.iEExtensions) + w.WriteBit(userLocationInformationN3IWFWithPortNumber.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := userLocationInformationN3IWFWithPortNumber.IPAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := userLocationInformationN3IWFWithPortNumber.PortNumber.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userLocationInformationN3IWFWithPortNumber.extensions.Present() { + if err := userLocationInformationN3IWFWithPortNumber.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWithPortNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformationN3IWFWithPortNumber = UserLocationInformationN3IWFWithPortNumber{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userLocationInformationN3IWFWithPortNumber.IPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userLocationInformationN3IWFWithPortNumber.PortNumber).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, &userLocationInformationN3IWFWithPortNumber.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userLocationInformationN3IWFWithPortNumber.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserLocationInformationN3IWFWithPortNumber = []ap.IESpec[ProtocolIEID, UserLocationInformationN3IWFWithPortNumber]{ + { + ID: IDTAI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationN3IWFWithPortNumber, r *per.Reader, enc per.Encoding) error { + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TAI = &v + return nil + }, + Encode: func(x *UserLocationInformationN3IWFWithPortNumber) (per.Marshaler, bool) { + if x.TAI == nil { + return nil, false + } + return x.TAI, true + }, + }, +} + +func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWithPortNumber) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber.iEExtensions) + return notComprehended +} + +func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber.iEExtensions) + w.WriteBit(userLocationInformationN3IWFWithoutPortNumber.extensions.Present()) + w.WriteBit(userLocationInformationN3IWFWithoutPortNumber.TAI != nil) + w.WriteBit(len(ext) > 0) + if err := userLocationInformationN3IWFWithoutPortNumber.IPAddress.MarshalPER(w, enc); err != nil { + return err + } + if userLocationInformationN3IWFWithoutPortNumber.TAI != nil { + if err := (*userLocationInformationN3IWFWithoutPortNumber.TAI).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userLocationInformationN3IWFWithoutPortNumber.extensions.Present() { + if err := userLocationInformationN3IWFWithoutPortNumber.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformationN3IWFWithoutPortNumber = UserLocationInformationN3IWFWithoutPortNumber{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TAI, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userLocationInformationN3IWFWithoutPortNumber.IPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TAI { + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformationN3IWFWithoutPortNumber.TAI = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, &userLocationInformationN3IWFWithoutPortNumber.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userLocationInformationN3IWFWithoutPortNumber.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserLocationInformationN3IWFWithoutPortNumber []ap.IESpec[ProtocolIEID, UserLocationInformationN3IWFWithoutPortNumber] + +func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if userLocationInformationN3IWFWithoutPortNumber.TAI != nil && userLocationInformationN3IWFWithoutPortNumber.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber.iEExtensions) + return notComprehended +} + +func (userLocationInformationNR *UserLocationInformationNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserLocationInformationNR, userLocationInformationNR, userLocationInformationNR.iEExtensions) + w.WriteBit(userLocationInformationNR.extensions.Present()) + w.WriteBit(userLocationInformationNR.TimeStamp != nil) + w.WriteBit(len(ext) > 0) + if err := userLocationInformationNR.NRCGI.MarshalPER(w, enc); err != nil { + return err + } + if err := userLocationInformationNR.TAI.MarshalPER(w, enc); err != nil { + return err + } + if userLocationInformationNR.TimeStamp != nil { + if err := (*userLocationInformationNR.TimeStamp).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userLocationInformationNR.extensions.Present() { + if err := userLocationInformationNR.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userLocationInformationNR *UserLocationInformationNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformationNR = UserLocationInformationNR{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TimeStamp, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userLocationInformationNR.NRCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userLocationInformationNR.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TimeStamp { + var v TimeStamp + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformationNR.TimeStamp = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationNR, userLocationInformationNR, &userLocationInformationNR.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userLocationInformationNR.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInformationNR]{ + { + ID: IDPSCellInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { + var v NGRANCGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PSCellInformation = &v + return nil + }, + Encode: func(x *UserLocationInformationNR) (per.Marshaler, bool) { + if x.PSCellInformation == nil { + return nil, false + } + return x.PSCellInformation, true + }, + }, + { + ID: IDNID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { + var v NID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NID = &v + return nil + }, + Encode: func(x *UserLocationInformationNR) (per.Marshaler, bool) { + if x.NID == nil { + return nil, false + } + return x.NID, true + }, + }, + { + ID: IDNRNTNTAIInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { + var v NRNTNTAIInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NRNTNTAIInformation = &v + return nil + }, + Encode: func(x *UserLocationInformationNR) (per.Marshaler, bool) { + if x.NRNTNTAIInformation == nil { + return nil, false + } + return x.NRNTNTAIInformation, true + }, + }, + { + ID: IDMobileIABMTUserLocationInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { + var v MobileIABMTUserLocationInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MobileIABMTUserLocationInformation = &v + return nil + }, + Encode: func(x *UserLocationInformationNR) (per.Marshaler, bool) { + if x.MobileIABMTUserLocationInformation == nil { + return nil, false + } + return x.MobileIABMTUserLocationInformation, true + }, + }, + { + ID: IDAdditionalULI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { + var v AdditionalULI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalULI = &v + return nil + }, + Encode: func(x *UserLocationInformationNR) (per.Marshaler, bool) { + if x.AdditionalULI == nil { + return nil, false + } + return x.AdditionalULI, true + }, + }, + { + ID: IDAerialUEFlightInformationReporting, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { + var v AerialUEFlightInformationReporting + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AerialUEFlightInformationReporting = &v + return nil + }, + Encode: func(x *UserLocationInformationNR) (per.Marshaler, bool) { + if x.AerialUEFlightInformationReporting == nil { + return nil, false + } + return x.AerialUEFlightInformationReporting, true + }, + }, +} + +func (userLocationInformationNR *UserLocationInformationNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if userLocationInformationNR.NRCGI.Diagnose(d) { + notComprehended = true + } + if userLocationInformationNR.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUserLocationInformationNR, userLocationInformationNR, userLocationInformationNR.iEExtensions) + return notComprehended +} + +func (userLocationInformationTNGF *UserLocationInformationTNGF) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserLocationInformationTNGF, userLocationInformationTNGF, userLocationInformationTNGF.iEExtensions) + w.WriteBit(userLocationInformationTNGF.extensions.Present()) + w.WriteBit(userLocationInformationTNGF.PortNumber != nil) + w.WriteBit(len(ext) > 0) + if err := userLocationInformationTNGF.TNAPID.MarshalPER(w, enc); err != nil { + return err + } + if err := userLocationInformationTNGF.IPAddress.MarshalPER(w, enc); err != nil { + return err + } + if userLocationInformationTNGF.PortNumber != nil { + if err := (*userLocationInformationTNGF.PortNumber).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userLocationInformationTNGF.extensions.Present() { + if err := userLocationInformationTNGF.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userLocationInformationTNGF *UserLocationInformationTNGF) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformationTNGF = UserLocationInformationTNGF{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PortNumber, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userLocationInformationTNGF.TNAPID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userLocationInformationTNGF.IPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_PortNumber { + var v PortNumber + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformationTNGF.PortNumber = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationTNGF, userLocationInformationTNGF, &userLocationInformationTNGF.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userLocationInformationTNGF.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserLocationInformationTNGF = []ap.IESpec[ProtocolIEID, UserLocationInformationTNGF]{ + { + ID: IDTAI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationTNGF, r *per.Reader, enc per.Encoding) error { + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TAI = &v + return nil + }, + Encode: func(x *UserLocationInformationTNGF) (per.Marshaler, bool) { + if x.TAI == nil { + return nil, false + } + return x.TAI, true + }, + }, +} + +func (userLocationInformationTNGF *UserLocationInformationTNGF) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUserLocationInformationTNGF, userLocationInformationTNGF, userLocationInformationTNGF.iEExtensions) + return notComprehended +} + +func (userLocationInformationTWIF *UserLocationInformationTWIF) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserLocationInformationTWIF, userLocationInformationTWIF, userLocationInformationTWIF.iEExtensions) + w.WriteBit(userLocationInformationTWIF.extensions.Present()) + w.WriteBit(userLocationInformationTWIF.PortNumber != nil) + w.WriteBit(len(ext) > 0) + if err := userLocationInformationTWIF.TWAPID.MarshalPER(w, enc); err != nil { + return err + } + if err := userLocationInformationTWIF.IPAddress.MarshalPER(w, enc); err != nil { + return err + } + if userLocationInformationTWIF.PortNumber != nil { + if err := (*userLocationInformationTWIF.PortNumber).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userLocationInformationTWIF.extensions.Present() { + if err := userLocationInformationTWIF.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userLocationInformationTWIF *UserLocationInformationTWIF) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformationTWIF = UserLocationInformationTWIF{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PortNumber, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userLocationInformationTWIF.TWAPID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userLocationInformationTWIF.IPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_PortNumber { + var v PortNumber + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformationTWIF.PortNumber = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationTWIF, userLocationInformationTWIF, &userLocationInformationTWIF.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userLocationInformationTWIF.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserLocationInformationTWIF = []ap.IESpec[ProtocolIEID, UserLocationInformationTWIF]{ + { + ID: IDTAI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformationTWIF, r *per.Reader, enc per.Encoding) error { + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TAI = &v + return nil + }, + Encode: func(x *UserLocationInformationTWIF) (per.Marshaler, bool) { + if x.TAI == nil { + return nil, false + } + return x.TAI, true + }, + }, +} + +func (userLocationInformationTWIF *UserLocationInformationTWIF) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUserLocationInformationTWIF, userLocationInformationTWIF, userLocationInformationTWIF.iEExtensions) + return notComprehended +} + +func (userLocationInformationWAGF *UserLocationInformationWAGF) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{userLocationInformationWAGF.GlobalLineID != nil, userLocationInformationWAGF.HFCNodeID != nil, userLocationInformationWAGF.GlobalCableID != nil, userLocationInformationWAGF.HFCNodeIDNew != nil, userLocationInformationWAGF.GlobalCableIDNew != nil, userLocationInformationWAGF.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case userLocationInformationWAGF.GlobalLineID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*userLocationInformationWAGF.GlobalLineID).MarshalPER(w, enc); err != nil { + return err + } + case userLocationInformationWAGF.HFCNodeID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*userLocationInformationWAGF.HFCNodeID).MarshalPER(w, enc); err != nil { + return err + } + case userLocationInformationWAGF.GlobalCableID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalCableID, Criticality: userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformationWAGF.GlobalCableID}) + case userLocationInformationWAGF.HFCNodeIDNew != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDHFCNodeIDnew, Criticality: userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformationWAGF.HFCNodeIDNew}) + case userLocationInformationWAGF.GlobalCableIDNew != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalCableIDnew, Criticality: userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformationWAGF.GlobalCableIDNew}) + case userLocationInformationWAGF.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, userLocationInformationWAGF.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (userLocationInformationWAGF *UserLocationInformationWAGF) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformationWAGF = UserLocationInformationWAGF{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v GlobalLineID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformationWAGF.GlobalLineID = &v + case 1: + var v HFCNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + userLocationInformationWAGF.HFCNodeID = &v + case 2: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDGlobalCableID: + var v GlobalCableID + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + userLocationInformationWAGF.ChoiceExtension = &f + break + } + userLocationInformationWAGF.GlobalCableID = &v + userLocationInformationWAGF.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDHFCNodeIDnew: + var v HFCNodeIDNew + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + userLocationInformationWAGF.ChoiceExtension = &f + break + } + userLocationInformationWAGF.HFCNodeIDNew = &v + userLocationInformationWAGF.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + case IDGlobalCableIDnew: + var v GlobalCableIDNew + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + userLocationInformationWAGF.ChoiceExtension = &f + break + } + userLocationInformationWAGF.GlobalCableIDNew = &v + userLocationInformationWAGF.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + default: + userLocationInformationWAGF.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (userLocationInformationWAGF *UserLocationInformationWAGF) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case userLocationInformationWAGF.GlobalLineID != nil: + return userLocationInformationWAGF.GlobalLineID.Diagnose(d) + case userLocationInformationWAGF.HFCNodeID != nil: + case userLocationInformationWAGF.GlobalCableID != nil: + d.IE(IDGlobalCableID, userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformationWAGF.GlobalCableID) + case userLocationInformationWAGF.HFCNodeIDNew != nil: + d.IE(IDHFCNodeIDnew, userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformationWAGF.HFCNodeIDNew) + case userLocationInformationWAGF.GlobalCableIDNew != nil: + d.IE(IDGlobalCableIDnew, userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformationWAGF.GlobalCableIDNew) + case userLocationInformationWAGF.ChoiceExtension != nil: + d.Unknown(userLocationInformationWAGF.ChoiceExtension.ID, userLocationInformationWAGF.ChoiceExtension.Criticality) + } + return false +} + +func (userPlaneFailureIndication *UserPlaneFailureIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserPlaneFailureIndication, userPlaneFailureIndication, userPlaneFailureIndication.iEExtensions) + w.WriteBit(userPlaneFailureIndication.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := userPlaneFailureIndication.UserPlaneFailureType.MarshalPER(w, enc); err != nil { + return err + } + if err := userPlaneFailureIndication.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if err := userPlaneFailureIndication.DLNGUUPTNLInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userPlaneFailureIndication.extensions.Present() { + if err := userPlaneFailureIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userPlaneFailureIndication *UserPlaneFailureIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userPlaneFailureIndication = UserPlaneFailureIndication{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userPlaneFailureIndication.UserPlaneFailureType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userPlaneFailureIndication.ULNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userPlaneFailureIndication.DLNGUUPTNLInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserPlaneFailureIndication, userPlaneFailureIndication, &userPlaneFailureIndication.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userPlaneFailureIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserPlaneFailureIndication []ap.IESpec[ProtocolIEID, UserPlaneFailureIndication] + +func (userPlaneFailureIndication *UserPlaneFailureIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if userPlaneFailureIndication.UserPlaneFailureType.Diagnose(d) { + notComprehended = true + } + if userPlaneFailureIndication.ULNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + if userPlaneFailureIndication.DLNGUUPTNLInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUserPlaneFailureIndication, userPlaneFailureIndication, userPlaneFailureIndication.iEExtensions) + return notComprehended +} + +func (userPlaneFailureIndicationReport UserPlaneFailureIndicationReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUserPlaneFailureIndicationReport.Encode(w, enc, userPlaneFailureIndicationReport) +} + +func (userPlaneFailureIndicationReport *UserPlaneFailureIndicationReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUserPlaneFailureIndicationReport.Decode(r, enc) + if err != nil { + return err + } + *userPlaneFailureIndicationReport = v + return nil +} + +func (userPlaneFailureIndicationReport UserPlaneFailureIndicationReport) Name() string { + return enumUserPlaneFailureIndicationReport.Name(userPlaneFailureIndicationReport) +} + +func (userPlaneFailureIndicationReport UserPlaneFailureIndicationReport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUserPlaneFailureIndicationReport.Known(userPlaneFailureIndicationReport) +} + +func (userPlaneFailureType UserPlaneFailureType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUserPlaneFailureType.Encode(w, enc, userPlaneFailureType) +} + +func (userPlaneFailureType *UserPlaneFailureType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUserPlaneFailureType.Decode(r, enc) + if err != nil { + return err + } + *userPlaneFailureType = v + return nil +} + +func (userPlaneFailureType UserPlaneFailureType) Name() string { + return enumUserPlaneFailureType.Name(userPlaneFailureType) +} + +func (userPlaneFailureType UserPlaneFailureType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUserPlaneFailureType.Known(userPlaneFailureType) +} + +func (userPlaneSecurityInformation *UserPlaneSecurityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, userPlaneSecurityInformation.iEExtensions) + w.WriteBit(userPlaneSecurityInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := userPlaneSecurityInformation.SecurityResult.MarshalPER(w, enc); err != nil { + return err + } + if err := userPlaneSecurityInformation.SecurityIndication.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userPlaneSecurityInformation.extensions.Present() { + if err := userPlaneSecurityInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userPlaneSecurityInformation *UserPlaneSecurityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userPlaneSecurityInformation = UserPlaneSecurityInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userPlaneSecurityInformation.SecurityResult).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userPlaneSecurityInformation.SecurityIndication).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, &userPlaneSecurityInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userPlaneSecurityInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserPlaneSecurityInformation []ap.IESpec[ProtocolIEID, UserPlaneSecurityInformation] + +func (userPlaneSecurityInformation *UserPlaneSecurityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if userPlaneSecurityInformation.SecurityResult.Diagnose(d) { + notComprehended = true + } + if userPlaneSecurityInformation.SecurityIndication.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, userPlaneSecurityInformation.iEExtensions) + return notComprehended +} + +func (vehicleUE VehicleUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumVehicleUE.Encode(w, enc, vehicleUE) +} + +func (vehicleUE *VehicleUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumVehicleUE.Decode(r, enc) + if err != nil { + return err + } + *vehicleUE = v + return nil +} + +func (vehicleUE VehicleUE) Name() string { + return enumVehicleUE.Name(vehicleUE) +} + +func (vehicleUE VehicleUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumVehicleUE.Known(vehicleUE) +} + +func (volumeTimedReportItem *VolumeTimedReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsVolumeTimedReportItem, volumeTimedReportItem, volumeTimedReportItem.iEExtensions) + w.WriteBit(volumeTimedReportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := volumeTimedReportItem.StartTimeStamp.MarshalPER(w, enc); err != nil { + return err + } + if err := volumeTimedReportItem.EndTimeStamp.MarshalPER(w, enc); err != nil { + return err + } + if err := volumeTimedReportItem.UsageCountUL.MarshalPER(w, enc); err != nil { + return err + } + if err := volumeTimedReportItem.UsageCountDL.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if volumeTimedReportItem.extensions.Present() { + if err := volumeTimedReportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (volumeTimedReportItem *VolumeTimedReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *volumeTimedReportItem = VolumeTimedReportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&volumeTimedReportItem.StartTimeStamp).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&volumeTimedReportItem.EndTimeStamp).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&volumeTimedReportItem.UsageCountUL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&volumeTimedReportItem.UsageCountDL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsVolumeTimedReportItem, volumeTimedReportItem, &volumeTimedReportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := volumeTimedReportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsVolumeTimedReportItem []ap.IESpec[ProtocolIEID, VolumeTimedReportItem] + +func (volumeTimedReportItem *VolumeTimedReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsVolumeTimedReportItem, volumeTimedReportItem, volumeTimedReportItem.iEExtensions) + return notComprehended +} + +func (wAGFID *WAGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{wAGFID.WAGFID != nil, wAGFID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case wAGFID.WAGFID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*wAGFID.WAGFID).MarshalPER(w, enc); err != nil { + return err + } + case wAGFID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, wAGFID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (wAGFID *WAGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *wAGFID = WAGFID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v WAGFIDValue + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + wAGFID.WAGFID = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + wAGFID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (wAGFID *WAGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case wAGFID.WAGFID != nil: + case wAGFID.ChoiceExtension != nil: + d.Unknown(wAGFID.ChoiceExtension.ID, wAGFID.ChoiceExtension.Criticality) + } + return false +} + +func (wLANMeasConfig WLANMeasConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumWLANMeasConfig.Encode(w, enc, wLANMeasConfig) +} + +func (wLANMeasConfig *WLANMeasConfig) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumWLANMeasConfig.Decode(r, enc) + if err != nil { + return err + } + *wLANMeasConfig = v + return nil +} + +func (wLANMeasConfig WLANMeasConfig) Name() string { + return enumWLANMeasConfig.Name(wLANMeasConfig) +} + +func (wLANMeasConfig WLANMeasConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumWLANMeasConfig.Known(wLANMeasConfig) +} + +func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, wLANMeasConfigNameItem.iEExtensions) + w.WriteBit(wLANMeasConfigNameItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := wLANMeasConfigNameItem.WLANName.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if wLANMeasConfigNameItem.extensions.Present() { + if err := wLANMeasConfigNameItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *wLANMeasConfigNameItem = WLANMeasConfigNameItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&wLANMeasConfigNameItem.WLANName).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, &wLANMeasConfigNameItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := wLANMeasConfigNameItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsWLANMeasConfigNameItem []ap.IESpec[ProtocolIEID, WLANMeasConfigNameItem] + +func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, wLANMeasConfigNameItem.iEExtensions) + return notComprehended +} + +func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, wLANMeasurementConfiguration.iEExtensions) + w.WriteBit(wLANMeasurementConfiguration.extensions.Present()) + w.WriteBit(wLANMeasurementConfiguration.WlanMeasConfigNameList != nil) + w.WriteBit(wLANMeasurementConfiguration.Wlanrssi != nil) + w.WriteBit(wLANMeasurementConfiguration.Wlanrtt != nil) + w.WriteBit(len(ext) > 0) + if err := wLANMeasurementConfiguration.WlanMeasConfig.MarshalPER(w, enc); err != nil { + return err + } + if wLANMeasurementConfiguration.WlanMeasConfigNameList != nil { + if err := wLANMeasurementConfiguration.WlanMeasConfigNameList.MarshalPER(w, enc); err != nil { + return err + } + } + if wLANMeasurementConfiguration.Wlanrssi != nil { + if err := (*wLANMeasurementConfiguration.Wlanrssi).MarshalPER(w, enc); err != nil { + return err + } + } + if wLANMeasurementConfiguration.Wlanrtt != nil { + if err := (*wLANMeasurementConfiguration.Wlanrtt).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if wLANMeasurementConfiguration.extensions.Present() { + if err := wLANMeasurementConfiguration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *wLANMeasurementConfiguration = WLANMeasurementConfiguration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_WlanMeasConfigNameList, err := r.ReadBit() + if err != nil { + return err + } + p_Wlanrssi, err := r.ReadBit() + if err != nil { + return err + } + p_Wlanrtt, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&wLANMeasurementConfiguration.WlanMeasConfig).UnmarshalPER(r, enc); err != nil { + return err + } + if p_WlanMeasConfigNameList { + if err := (&wLANMeasurementConfiguration.WlanMeasConfigNameList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_Wlanrssi { + var v WLANMeasurementConfigurationWlanrssi + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + wLANMeasurementConfiguration.Wlanrssi = &v + } + if p_Wlanrtt { + var v WLANMeasurementConfigurationWlanrtt + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + wLANMeasurementConfiguration.Wlanrtt = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, &wLANMeasurementConfiguration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := wLANMeasurementConfiguration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsWLANMeasurementConfiguration []ap.IESpec[ProtocolIEID, WLANMeasurementConfiguration] + +func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if wLANMeasurementConfiguration.WlanMeasConfig.Diagnose(d) { + notComprehended = true + } + if wLANMeasurementConfiguration.WlanMeasConfigNameList.Diagnose(d) { + notComprehended = true + } + if wLANMeasurementConfiguration.Wlanrssi != nil && wLANMeasurementConfiguration.Wlanrssi.Diagnose(d) { + notComprehended = true + } + if wLANMeasurementConfiguration.Wlanrtt != nil && wLANMeasurementConfiguration.Wlanrtt.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, wLANMeasurementConfiguration.iEExtensions) + return notComprehended +} + +func (wLANMeasurementConfigurationWlanrssi WLANMeasurementConfigurationWlanrssi) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumWLANMeasurementConfigurationWlanrssi.Encode(w, enc, wLANMeasurementConfigurationWlanrssi) +} + +func (wLANMeasurementConfigurationWlanrssi *WLANMeasurementConfigurationWlanrssi) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumWLANMeasurementConfigurationWlanrssi.Decode(r, enc) + if err != nil { + return err + } + *wLANMeasurementConfigurationWlanrssi = v + return nil +} + +func (wLANMeasurementConfigurationWlanrssi WLANMeasurementConfigurationWlanrssi) Name() string { + return enumWLANMeasurementConfigurationWlanrssi.Name(wLANMeasurementConfigurationWlanrssi) +} + +func (wLANMeasurementConfigurationWlanrssi WLANMeasurementConfigurationWlanrssi) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumWLANMeasurementConfigurationWlanrssi.Known(wLANMeasurementConfigurationWlanrssi) +} + +func (wLANMeasurementConfigurationWlanrtt WLANMeasurementConfigurationWlanrtt) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumWLANMeasurementConfigurationWlanrtt.Encode(w, enc, wLANMeasurementConfigurationWlanrtt) +} + +func (wLANMeasurementConfigurationWlanrtt *WLANMeasurementConfigurationWlanrtt) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumWLANMeasurementConfigurationWlanrtt.Decode(r, enc) + if err != nil { + return err + } + *wLANMeasurementConfigurationWlanrtt = v + return nil +} + +func (wLANMeasurementConfigurationWlanrtt WLANMeasurementConfigurationWlanrtt) Name() string { + return enumWLANMeasurementConfigurationWlanrtt.Name(wLANMeasurementConfigurationWlanrtt) +} + +func (wLANMeasurementConfigurationWlanrtt WLANMeasurementConfigurationWlanrtt) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumWLANMeasurementConfigurationWlanrtt.Known(wLANMeasurementConfigurationWlanrtt) +} + +func (wUSAssistanceInformation *WUSAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsWUSAssistanceInformation, wUSAssistanceInformation, wUSAssistanceInformation.iEExtensions) + w.WriteBit(wUSAssistanceInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := wUSAssistanceInformation.PagingProbabilityInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if wUSAssistanceInformation.extensions.Present() { + if err := wUSAssistanceInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (wUSAssistanceInformation *WUSAssistanceInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *wUSAssistanceInformation = WUSAssistanceInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&wUSAssistanceInformation.PagingProbabilityInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsWUSAssistanceInformation, wUSAssistanceInformation, &wUSAssistanceInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := wUSAssistanceInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsWUSAssistanceInformation []ap.IESpec[ProtocolIEID, WUSAssistanceInformation] + +func (wUSAssistanceInformation *WUSAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if wUSAssistanceInformation.PagingProbabilityInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsWUSAssistanceInformation, wUSAssistanceInformation, wUSAssistanceInformation.iEExtensions) + return notComprehended +} + +func (warningAreaList *WarningAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{warningAreaList.EUTRACGIListForWarning != nil, warningAreaList.NRCGIListForWarning != nil, warningAreaList.TAIListForWarning != nil, warningAreaList.EmergencyAreaIDList != nil, warningAreaList.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case warningAreaList.EUTRACGIListForWarning != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 0); err != nil { + return err + } + if err := (*warningAreaList.EUTRACGIListForWarning).MarshalPER(w, enc); err != nil { + return err + } + case warningAreaList.NRCGIListForWarning != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 1); err != nil { + return err + } + if err := (*warningAreaList.NRCGIListForWarning).MarshalPER(w, enc); err != nil { + return err + } + case warningAreaList.TAIListForWarning != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 2); err != nil { + return err + } + if err := (*warningAreaList.TAIListForWarning).MarshalPER(w, enc); err != nil { + return err + } + case warningAreaList.EmergencyAreaIDList != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 3); err != nil { + return err + } + if err := (*warningAreaList.EmergencyAreaIDList).MarshalPER(w, enc); err != nil { + return err + } + case warningAreaList.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, warningAreaList.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (warningAreaList *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *warningAreaList = WarningAreaList{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 4) + if err != nil { + return err + } + switch idx { + case 0: + var v EUTRACGIListForWarning + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + warningAreaList.EUTRACGIListForWarning = &v + case 1: + var v NRCGIListForWarning + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + warningAreaList.NRCGIListForWarning = &v + case 2: + var v TAIListForWarning + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + warningAreaList.TAIListForWarning = &v + case 3: + var v EmergencyAreaIDList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + warningAreaList.EmergencyAreaIDList = &v + case 4: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + warningAreaList.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (warningAreaList *WarningAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case warningAreaList.EUTRACGIListForWarning != nil: + return warningAreaList.EUTRACGIListForWarning.Diagnose(d) + case warningAreaList.NRCGIListForWarning != nil: + return warningAreaList.NRCGIListForWarning.Diagnose(d) + case warningAreaList.TAIListForWarning != nil: + return warningAreaList.TAIListForWarning.Diagnose(d) + case warningAreaList.EmergencyAreaIDList != nil: + case warningAreaList.ChoiceExtension != nil: + d.Unknown(warningAreaList.ChoiceExtension.ID, warningAreaList.ChoiceExtension.Criticality) + } + return false +} + +func (xrDeviceWith2Rx XrDeviceWith2Rx) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumXrDeviceWith2Rx.Encode(w, enc, xrDeviceWith2Rx) +} + +func (xrDeviceWith2Rx *XrDeviceWith2Rx) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumXrDeviceWith2Rx.Decode(r, enc) + if err != nil { + return err + } + *xrDeviceWith2Rx = v + return nil +} + +func (xrDeviceWith2Rx XrDeviceWith2Rx) Name() string { + return enumXrDeviceWith2Rx.Name(xrDeviceWith2Rx) +} + +func (xrDeviceWith2Rx XrDeviceWith2Rx) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumXrDeviceWith2Rx.Known(xrDeviceWith2Rx) +} + +func (a2XPC5QoSFlowList A2XPC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range a2XPC5QoSFlowList { + if a2XPC5QoSFlowList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (aMFTNLAssociationSetupList AMFTNLAssociationSetupList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range aMFTNLAssociationSetupList { + if aMFTNLAssociationSetupList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (aMFTNLAssociationToAddList AMFTNLAssociationToAddList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range aMFTNLAssociationToAddList { + if aMFTNLAssociationToAddList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (aMFTNLAssociationToRemoveList AMFTNLAssociationToRemoveList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range aMFTNLAssociationToRemoveList { + if aMFTNLAssociationToRemoveList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (aMFTNLAssociationToUpdateList AMFTNLAssociationToUpdateList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range aMFTNLAssociationToUpdateList { + if aMFTNLAssociationToUpdateList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (activatedCellList ActivatedCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range activatedCellList { + if activatedCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (additionalCancelledlocationReportingReferenceIDList AdditionalCancelledlocationReportingReferenceIDList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range additionalCancelledlocationReportingReferenceIDList { + if additionalCancelledlocationReportingReferenceIDList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (additionalDLUPTNLInformationForHOList AdditionalDLUPTNLInformationForHOList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range additionalDLUPTNLInformationForHOList { + if additionalDLUPTNLInformationForHOList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (aerialUEFlightInformationReportingControlList AerialUEFlightInformationReportingControlList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range aerialUEFlightInformationReportingControlList { + if aerialUEFlightInformationReportingControlList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (allowedNSSAI AllowedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range allowedNSSAI { + if allowedNSSAI[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (allowedPNINPNList AllowedPNINPNList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range allowedPNINPNList { + if allowedPNINPNList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (allowedPeriodicityList AllowedPeriodicityList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range allowedPeriodicityList { + if allowedPeriodicityList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (alternativeQoSParaSetList AlternativeQoSParaSetList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range alternativeQoSParaSetList { + if alternativeQoSParaSetList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (areaOfInterestCellList AreaOfInterestCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range areaOfInterestCellList { + if areaOfInterestCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (areaOfInterestList AreaOfInterestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range areaOfInterestList { + if areaOfInterestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (areaOfInterestRANNodeList AreaOfInterestRANNodeList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range areaOfInterestRANNodeList { + if areaOfInterestRANNodeList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (areaOfInterestTAIList AreaOfInterestTAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range areaOfInterestTAIList { + if areaOfInterestTAIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (areaScopeOfNeighCellsList AreaScopeOfNeighCellsList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range areaScopeOfNeighCellsList { + if areaScopeOfNeighCellsList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (associatedMBSQosFlowSetupRequestList AssociatedMBSQosFlowSetupRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range associatedMBSQosFlowSetupRequestList { + if associatedMBSQosFlowSetupRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (associatedMBSQosFlowSetuporModifyRequestList AssociatedMBSQosFlowSetuporModifyRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range associatedMBSQosFlowSetuporModifyRequestList { + if associatedMBSQosFlowSetuporModifyRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (associatedQosFlowList AssociatedQosFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range associatedQosFlowList { + if associatedQosFlowList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (availableBitrateReportThresholdList AvailableBitrateReportThresholdList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range availableBitrateReportThresholdList { + if availableBitrateReportThresholdList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (bluetoothMeasConfigNameList BluetoothMeasConfigNameList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range bluetoothMeasConfigNameList { + if bluetoothMeasConfigNameList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (broadcastPLMNList BroadcastPLMNList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range broadcastPLMNList { + if broadcastPLMNList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cAGListforMDT CAGListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cAGListforMDT { + if cAGListforMDT[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cNTypeRestrictionsForEquivalent CNTypeRestrictionsForEquivalent) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cNTypeRestrictionsForEquivalent { + if cNTypeRestrictionsForEquivalent[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (candidateCellList CandidateCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range candidateCellList { + if candidateCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (candidateRelayUEInformationList CandidateRelayUEInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range candidateRelayUEInformationList { + if candidateRelayUEInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIDBroadcastEUTRA CellIDBroadcastEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIDBroadcastEUTRA { + if cellIDBroadcastEUTRA[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIDBroadcastNR CellIDBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIDBroadcastNR { + if cellIDBroadcastNR[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIDCancelledEUTRA CellIDCancelledEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIDCancelledEUTRA { + if cellIDCancelledEUTRA[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIDCancelledNR CellIDCancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIDCancelledNR { + if cellIDCancelledNR[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIdListforMDTEUTRA CellIdListforMDTEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIdListforMDTEUTRA { + if cellIdListforMDTEUTRA[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIdListforMDTNR CellIdListforMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIdListforMDTNR { + if cellIdListforMDTNR[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIdListforQMC CellIdListforQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIdListforQMC { + if cellIdListforQMC[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellsToActivateList CellsToActivateList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellsToActivateList { + if cellsToActivateList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (criticalityDiagnosticsIEList CriticalityDiagnosticsIEList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range criticalityDiagnosticsIEList { + if criticalityDiagnosticsIEList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (dRBsToQosFlowsMappingList DRBsToQosFlowsMappingList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range dRBsToQosFlowsMappingList { + if dRBsToQosFlowsMappingList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (dataForwardingResponseDRBList DataForwardingResponseDRBList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range dataForwardingResponseDRBList { + if dataForwardingResponseDRBList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (dataForwardingResponseERABList DataForwardingResponseERABList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range dataForwardingResponseERABList { + if dataForwardingResponseERABList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eCNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eCNMarkingorCongestionInformationReportingStatus { + if eCNMarkingorCongestionInformationReportingStatus[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABInformationList ERABInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABInformationList { + if eRABInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eUTRACGIList EUTRACGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eUTRACGIList { + if eUTRACGIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eUTRACGIListForWarning EUTRACGIListForWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eUTRACGIListForWarning { + if eUTRACGIListForWarning[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eUTRANCellReportList EUTRANCellReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eUTRANCellReportList { + if eUTRANCellReportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eUTRANCellToReportList EUTRANCellToReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eUTRANCellToReportList { + if eUTRANCellToReportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (emergencyAreaIDBroadcastEUTRA EmergencyAreaIDBroadcastEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDBroadcastEUTRA { + if emergencyAreaIDBroadcastEUTRA[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (emergencyAreaIDBroadcastNR EmergencyAreaIDBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDBroadcastNR { + if emergencyAreaIDBroadcastNR[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (emergencyAreaIDCancelledEUTRA EmergencyAreaIDCancelledEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDCancelledEUTRA { + if emergencyAreaIDCancelledEUTRA[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (emergencyAreaIDCancelledNR EmergencyAreaIDCancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDCancelledNR { + if emergencyAreaIDCancelledNR[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (equivalentSNPNsList EquivalentSNPNsList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range equivalentSNPNsList { + if equivalentSNPNsList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (excessPacketDelayThresholdConfiguration ExcessPacketDelayThresholdConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range excessPacketDelayThresholdConfiguration { + if excessPacketDelayThresholdConfiguration[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (expectedUEMovingTrajectory ExpectedUEMovingTrajectory) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range expectedUEMovingTrajectory { + if expectedUEMovingTrajectory[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (extendedSliceSupportList ExtendedSliceSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range extendedSliceSupportList { + if extendedSliceSupportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (fiveGProSePC5QoSFlowList FiveGProSePC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range fiveGProSePC5QoSFlowList { + if fiveGProSePC5QoSFlowList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (forbiddenAreaInformation ForbiddenAreaInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range forbiddenAreaInformation { + if forbiddenAreaInformation[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (gUAMIList GUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range gUAMIList { + if gUAMIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range lastVisitedPSCellList { + if lastVisitedPSCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSActiveSessionInformationSourcetoTargetList MBSActiveSessionInformationSourcetoTargetList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSActiveSessionInformationSourcetoTargetList { + if mBSActiveSessionInformationSourcetoTargetList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSMappingandDataForwardingRequestList MBSMappingandDataForwardingRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSMappingandDataForwardingRequestList { + if mBSMappingandDataForwardingRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSQoSFlowList MBSQoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSQoSFlowList { + if mBSQoSFlowList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSQoSFlowsToBeSetupList MBSQoSFlowsToBeSetupList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSQoSFlowsToBeSetupList { + if mBSQoSFlowsToBeSetupList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSServiceAreaCellList MBSServiceAreaCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSServiceAreaCellList { + if mBSServiceAreaCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSServiceAreaInformationList MBSServiceAreaInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSServiceAreaInformationList { + if mBSServiceAreaInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSServiceAreaTAIList MBSServiceAreaTAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSServiceAreaTAIList { + if mBSServiceAreaTAIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSSessionFailedtoSetupList MBSSessionFailedtoSetupList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSSessionFailedtoSetupList { + if mBSSessionFailedtoSetupList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSSessionSetupRequestList MBSSessionSetupRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSSessionSetupRequestList { + if mBSSessionSetupRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSSessionSetupResponseList MBSSessionSetupResponseList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSSessionSetupResponseList { + if mBSSessionSetupResponseList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSSessionSetuporModifyRequestList MBSSessionSetuporModifyRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSSessionSetuporModifyRequestList { + if mBSSessionSetuporModifyRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (mBSSessionToReleaseList MBSSessionToReleaseList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range mBSSessionToReleaseList { + if mBSSessionToReleaseList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nGAPIESupportInformationRequestList NGAPIESupportInformationRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nGAPIESupportInformationRequestList { + if nGAPIESupportInformationRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nGRANCellReportList NGRANCellReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nGRANCellReportList { + if nGRANCellReportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nGRANCellToReportList NGRANCellToReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nGRANCellToReportList { + if nGRANCellToReportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nGRANTNLAssociationToRemoveList NGRANTNLAssociationToRemoveList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nGRANTNLAssociationToRemoveList { + if nGRANTNLAssociationToRemoveList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nRCGIList NRCGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nRCGIList { + if nRCGIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nRCGIListForWarning NRCGIListForWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nRCGIListForWarning { + if nRCGIListForWarning[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nRFrequencyBandList NRFrequencyBandList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nRFrequencyBandList { + if nRFrequencyBandList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (nTNGeographicalAreaList NTNGeographicalAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range nTNGeographicalAreaList { + if nTNGeographicalAreaList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (networkSliceListforMDT NetworkSliceListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range networkSliceListforMDT { + if networkSliceListforMDT[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (notificationCellList NotificationCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range notificationCellList { + if notificationCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (overloadStartNSSAIList OverloadStartNSSAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range overloadStartNSSAIList { + if overloadStartNSSAIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pC5QoSFlowList PC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pC5QoSFlowList { + if pC5QoSFlowList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pCIListForMDT PCIListForMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pCIListForMDT { + if pCIListForMDT[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceAdmittedList PDUSessionResourceAdmittedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceAdmittedList { + if pDUSessionResourceAdmittedList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceFailedToModifyListModCfm PDUSessionResourceFailedToModifyListModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceFailedToModifyListModCfm { + if pDUSessionResourceFailedToModifyListModCfm[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceFailedToModifyListModRes PDUSessionResourceFailedToModifyListModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceFailedToModifyListModRes { + if pDUSessionResourceFailedToModifyListModRes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceFailedToSetupListCxtFail PDUSessionResourceFailedToSetupListCxtFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceFailedToSetupListCxtFail { + if pDUSessionResourceFailedToSetupListCxtFail[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceFailedToSetupListCxtRes PDUSessionResourceFailedToSetupListCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceFailedToSetupListCxtRes { + if pDUSessionResourceFailedToSetupListCxtRes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceFailedToSetupListHOAck PDUSessionResourceFailedToSetupListHOAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceFailedToSetupListHOAck { + if pDUSessionResourceFailedToSetupListHOAck[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceFailedToSetupListPSReq PDUSessionResourceFailedToSetupListPSReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceFailedToSetupListPSReq { + if pDUSessionResourceFailedToSetupListPSReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceFailedToSetupListSURes PDUSessionResourceFailedToSetupListSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceFailedToSetupListSURes { + if pDUSessionResourceFailedToSetupListSURes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceHandoverList PDUSessionResourceHandoverList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceHandoverList { + if pDUSessionResourceHandoverList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceInformationList PDUSessionResourceInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceInformationList { + if pDUSessionResourceInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceListCxtRelCpl PDUSessionResourceListCxtRelCpl) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceListCxtRelCpl { + if pDUSessionResourceListCxtRelCpl[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceListCxtRelReq PDUSessionResourceListCxtRelReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceListCxtRelReq { + if pDUSessionResourceListCxtRelReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceListHORqd PDUSessionResourceListHORqd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceListHORqd { + if pDUSessionResourceListHORqd[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceModifyListModCfm PDUSessionResourceModifyListModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceModifyListModCfm { + if pDUSessionResourceModifyListModCfm[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceModifyListModInd PDUSessionResourceModifyListModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceModifyListModInd { + if pDUSessionResourceModifyListModInd[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceModifyListModReq PDUSessionResourceModifyListModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceModifyListModReq { + if pDUSessionResourceModifyListModReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceModifyListModRes PDUSessionResourceModifyListModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceModifyListModRes { + if pDUSessionResourceModifyListModRes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceNotifyList PDUSessionResourceNotifyList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceNotifyList { + if pDUSessionResourceNotifyList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceReleasedListNot PDUSessionResourceReleasedListNot) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceReleasedListNot { + if pDUSessionResourceReleasedListNot[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceReleasedListPSAck PDUSessionResourceReleasedListPSAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceReleasedListPSAck { + if pDUSessionResourceReleasedListPSAck[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceReleasedListPSFail PDUSessionResourceReleasedListPSFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceReleasedListPSFail { + if pDUSessionResourceReleasedListPSFail[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceReleasedListRelRes PDUSessionResourceReleasedListRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceReleasedListRelRes { + if pDUSessionResourceReleasedListRelRes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceSetupListCxtReq PDUSessionResourceSetupListCxtReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceSetupListCxtReq { + if pDUSessionResourceSetupListCxtReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceSetupListCxtRes PDUSessionResourceSetupListCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceSetupListCxtRes { + if pDUSessionResourceSetupListCxtRes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceSetupListHOReq PDUSessionResourceSetupListHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceSetupListHOReq { + if pDUSessionResourceSetupListHOReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceSetupListSUReq PDUSessionResourceSetupListSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceSetupListSUReq { + if pDUSessionResourceSetupListSUReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceSetupListSURes PDUSessionResourceSetupListSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceSetupListSURes { + if pDUSessionResourceSetupListSURes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceSwitchedList PDUSessionResourceSwitchedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceSwitchedList { + if pDUSessionResourceSwitchedList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceToBeSwitchedDLList PDUSessionResourceToBeSwitchedDLList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceToBeSwitchedDLList { + if pDUSessionResourceToBeSwitchedDLList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceToReleaseListHOCmd PDUSessionResourceToReleaseListHOCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceToReleaseListHOCmd { + if pDUSessionResourceToReleaseListHOCmd[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pDUSessionResourceToReleaseListRelCmd PDUSessionResourceToReleaseListRelCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pDUSessionResourceToReleaseListRelCmd { + if pDUSessionResourceToReleaseListRelCmd[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (pLMNSupportList PLMNSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range pLMNSupportList { + if pLMNSupportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (partiallyAllowedNSSAI PartiallyAllowedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range partiallyAllowedNSSAI { + if partiallyAllowedNSSAI[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qoSFlowTSCList QoSFlowTSCList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qoSFlowTSCList { + if qoSFlowTSCList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qoSFlowsUsageReportList QoSFlowsUsageReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qoSFlowsUsageReportList { + if qoSFlowsUsageReportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowAcceptedList QosFlowAcceptedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowAcceptedList { + if qosFlowAcceptedList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowAddOrModifyRequestList QosFlowAddOrModifyRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowAddOrModifyRequestList { + if qosFlowAddOrModifyRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowAddOrModifyResponseList QosFlowAddOrModifyResponseList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowAddOrModifyResponseList { + if qosFlowAddOrModifyResponseList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowAdditionalInfoListRelCom QosFlowAdditionalInfoListRelCom) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowAdditionalInfoListRelCom { + if qosFlowAdditionalInfoListRelCom[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowAdditionalInfoListRelRes QosFlowAdditionalInfoListRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowAdditionalInfoListRelRes { + if qosFlowAdditionalInfoListRelRes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowFeedbackList QosFlowFeedbackList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowFeedbackList { + if qosFlowFeedbackList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowInformationList QosFlowInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowInformationList { + if qosFlowInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowListWithCause QosFlowListWithCause) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowListWithCause { + if qosFlowListWithCause[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowListWithDataForwarding QosFlowListWithDataForwarding) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowListWithDataForwarding { + if qosFlowListWithDataForwarding[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowModifyConfirmList QosFlowModifyConfirmList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowModifyConfirmList { + if qosFlowModifyConfirmList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowNotifyList QosFlowNotifyList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowNotifyList { + if qosFlowNotifyList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowParametersList QosFlowParametersList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowParametersList { + if qosFlowParametersList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowPerTNLInformationList QosFlowPerTNLInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowPerTNLInformationList { + if qosFlowPerTNLInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowSetupRequestList QosFlowSetupRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowSetupRequestList { + if qosFlowSetupRequestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (qosFlowToBeForwardedList QosFlowToBeForwardedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range qosFlowToBeForwardedList { + if qosFlowToBeForwardedList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (rATRestrictions RATRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range rATRestrictions { + if rATRestrictions[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (rSPPQoSFlowList RSPPQoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range rSPPQoSFlowList { + if rSPPQoSFlowList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (recommendedCellList RecommendedCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range recommendedCellList { + if recommendedCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (recommendedRANNodeList RecommendedRANNodeList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range recommendedRANNodeList { + if recommendedRANNodeList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (requestedNSSAI RequestedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range requestedNSSAI { + if requestedNSSAI[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (sNPNCellIdListforMDT SNPNCellIdListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range sNPNCellIdListforMDT { + if sNPNCellIdListforMDT[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (sNPNListforMDT SNPNListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range sNPNListforMDT { + if sNPNListforMDT[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (sNPNTAIListforMDT SNPNTAIListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range sNPNTAIListforMDT { + if sNPNTAIListforMDT[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (sensorMeasConfigNameList SensorMeasConfigNameList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range sensorMeasConfigNameList { + if sensorMeasConfigNameList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (servedGUAMIList ServedGUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range servedGUAMIList { + if servedGUAMIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (serviceAreaInformation ServiceAreaInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range serviceAreaInformation { + if serviceAreaInformation[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (sliceMDTList SliceMDTList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range sliceMDTList { + if sliceMDTList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (sliceSupportList SliceSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range sliceSupportList { + if sliceSupportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (sliceSupportListQMC SliceSupportListQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range sliceSupportListQMC { + if sliceSupportListQMC[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (supportedTAList SupportedTAList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range supportedTAList { + if supportedTAList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIBroadcastEUTRA TAIBroadcastEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIBroadcastEUTRA { + if tAIBroadcastEUTRA[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIBroadcastNR TAIBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIBroadcastNR { + if tAIBroadcastNR[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAICancelledEUTRA TAICancelledEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAICancelledEUTRA { + if tAICancelledEUTRA[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAICancelledNR TAICancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAICancelledNR { + if tAICancelledNR[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIListForInactive TAIListForInactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIListForInactive { + if tAIListForInactive[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIListForPaging TAIListForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIListForPaging { + if tAIListForPaging[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIListForRestart TAIListForRestart) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIListForRestart { + if tAIListForRestart[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIListForWarning TAIListForWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIListForWarning { + if tAIListForWarning[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIListforMDT TAIListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIListforMDT { + if tAIListforMDT[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIListforQMC TAIListforQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIListforQMC { + if tAIListforQMC[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAINSAGSupportList TAINSAGSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAINSAGSupportList { + if tAINSAGSupportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tNLAssociationList TNLAssociationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tNLAssociationList { + if tNLAssociationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (targetNSSAI TargetNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range targetNSSAI { + if targetNSSAI[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uEAppLayerMeasInfoList UEAppLayerMeasInfoList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uEAppLayerMeasInfoList { + if uEAppLayerMeasInfoList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uEAssociatedLogicalNGConnectionList UEAssociatedLogicalNGConnectionList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uEAssociatedLogicalNGConnectionList { + if uEAssociatedLogicalNGConnectionList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uEHistoryInformation UEHistoryInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uEHistoryInformation { + if uEHistoryInformation[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uEPresenceInAreaOfInterestList UEPresenceInAreaOfInterestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uEPresenceInAreaOfInterestList { + if uEPresenceInAreaOfInterestList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uESliceMaximumBitRateList UESliceMaximumBitRateList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uESliceMaximumBitRateList { + if uESliceMaximumBitRateList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uLNGUUPTNLModifyList ULNGUUPTNLModifyList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uLNGUUPTNLModifyList { + if uLNGUUPTNLModifyList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uPTransportLayerInformationList UPTransportLayerInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uPTransportLayerInformationList { + if uPTransportLayerInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uPTransportLayerInformationPairList UPTransportLayerInformationPairList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uPTransportLayerInformationPairList { + if uPTransportLayerInformationPairList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (unavailableGUAMIList UnavailableGUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range unavailableGUAMIList { + if unavailableGUAMIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (volumeTimedReportList VolumeTimedReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range volumeTimedReportList { + if volumeTimedReportList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (wLANMeasConfigNameList WLANMeasConfigNameList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range wLANMeasConfigNameList { + if wLANMeasConfigNameList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (a2XPC5FlowBitRates A2XPC5FlowBitRates) Equal(y A2XPC5FlowBitRates) bool { + return a2XPC5FlowBitRates == y +} + +func (a2XPC5QoSFlowItem A2XPC5QoSFlowItem) Equal(y A2XPC5QoSFlowItem) bool { + return a2XPC5QoSFlowItem.A2XPQI == y.A2XPQI && + (a2XPC5QoSFlowItem.A2XPC5FlowBitRates == nil) == (y.A2XPC5FlowBitRates == nil) && (a2XPC5QoSFlowItem.A2XPC5FlowBitRates == nil || (*a2XPC5QoSFlowItem.A2XPC5FlowBitRates).Equal(*y.A2XPC5FlowBitRates)) && + (a2XPC5QoSFlowItem.A2XRange == nil) == (y.A2XRange == nil) && (a2XPC5QoSFlowItem.A2XRange == nil || (*a2XPC5QoSFlowItem.A2XRange) == *y.A2XRange) && + a2XPC5QoSFlowItem.iEExtensions == y.iEExtensions && + a2XPC5QoSFlowItem.extensions == y.extensions +} + +func (a2XPC5QoSFlowList A2XPC5QoSFlowList) Equal(y A2XPC5QoSFlowList) bool { + if len(a2XPC5QoSFlowList) != len(y) { + return false + } + for i := range a2XPC5QoSFlowList { + if !(a2XPC5QoSFlowList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (a2XPC5QoSParameters A2XPC5QoSParameters) Equal(y A2XPC5QoSParameters) bool { + return a2XPC5QoSParameters.A2XPC5QoSFlowList.Equal(y.A2XPC5QoSFlowList) && + (a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates == nil) == (y.A2XPC5LinkAggregateBitRates == nil) && (a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates == nil || (*a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates) == *y.A2XPC5LinkAggregateBitRates) && + a2XPC5QoSParameters.iEExtensions == y.iEExtensions && + a2XPC5QoSParameters.extensions == y.extensions +} + +func (aIOTFIdentifier AIOTFIdentifier) Equal(y AIOTFIdentifier) bool { + if len(aIOTFIdentifier) != len(y) { + return false + } + for i := range aIOTFIdentifier { + if !(aIOTFIdentifier[i] == y[i]) { + return false + } + } + return true +} + +func (aIOTFName AIOTFName) Equal(y AIOTFName) bool { + return (aIOTFName.AIOTFNameVisibleString == nil) == (y.AIOTFNameVisibleString == nil) && (aIOTFName.AIOTFNameVisibleString == nil || (*aIOTFName.AIOTFNameVisibleString) == *y.AIOTFNameVisibleString) && + (aIOTFName.AIOTFNameUTF8String == nil) == (y.AIOTFNameUTF8String == nil) && (aIOTFName.AIOTFNameUTF8String == nil || (*aIOTFName.AIOTFNameUTF8String) == *y.AIOTFNameUTF8String) && + aIOTFName.iEExtensions == y.iEExtensions && + aIOTFName.extensions == y.extensions +} + +func (aMFConfigurationUpdate AMFConfigurationUpdate) Equal(y AMFConfigurationUpdate) bool { + return (aMFConfigurationUpdate.AMFName == nil) == (y.AMFName == nil) && (aMFConfigurationUpdate.AMFName == nil || (*aMFConfigurationUpdate.AMFName) == *y.AMFName) && + aMFConfigurationUpdate.ServedGUAMIList.Equal(y.ServedGUAMIList) && + (aMFConfigurationUpdate.RelativeAMFCapacity == nil) == (y.RelativeAMFCapacity == nil) && (aMFConfigurationUpdate.RelativeAMFCapacity == nil || (*aMFConfigurationUpdate.RelativeAMFCapacity) == *y.RelativeAMFCapacity) && + aMFConfigurationUpdate.PLMNSupportList.Equal(y.PLMNSupportList) && + aMFConfigurationUpdate.AMFTNLAssociationToAddList.Equal(y.AMFTNLAssociationToAddList) && + aMFConfigurationUpdate.AMFTNLAssociationToRemoveList.Equal(y.AMFTNLAssociationToRemoveList) && + aMFConfigurationUpdate.AMFTNLAssociationToUpdateList.Equal(y.AMFTNLAssociationToUpdateList) && + (aMFConfigurationUpdate.ExtendedAMFName == nil) == (y.ExtendedAMFName == nil) && (aMFConfigurationUpdate.ExtendedAMFName == nil || (*aMFConfigurationUpdate.ExtendedAMFName).Equal(*y.ExtendedAMFName)) && + aMFConfigurationUpdate.messageMeta.Equal(y.messageMeta) +} + +func (aMFConfigurationUpdateAcknowledge AMFConfigurationUpdateAcknowledge) Equal(y AMFConfigurationUpdateAcknowledge) bool { + return aMFConfigurationUpdateAcknowledge.AMFTNLAssociationSetupList.Equal(y.AMFTNLAssociationSetupList) && + aMFConfigurationUpdateAcknowledge.AMFTNLAssociationFailedToSetupList.Equal(y.AMFTNLAssociationFailedToSetupList) && + (aMFConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (aMFConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil || (*aMFConfigurationUpdateAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + aMFConfigurationUpdateAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (aMFConfigurationUpdateFailure AMFConfigurationUpdateFailure) Equal(y AMFConfigurationUpdateFailure) bool { + return (aMFConfigurationUpdateFailure.Cause == nil) == (y.Cause == nil) && (aMFConfigurationUpdateFailure.Cause == nil || (*aMFConfigurationUpdateFailure.Cause).Equal(*y.Cause)) && + (aMFConfigurationUpdateFailure.TimeToWait == nil) == (y.TimeToWait == nil) && (aMFConfigurationUpdateFailure.TimeToWait == nil || (*aMFConfigurationUpdateFailure.TimeToWait) == *y.TimeToWait) && + (aMFConfigurationUpdateFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (aMFConfigurationUpdateFailure.CriticalityDiagnostics == nil || (*aMFConfigurationUpdateFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + aMFConfigurationUpdateFailure.messageMeta.Equal(y.messageMeta) +} + +func (aMFPagingTarget AMFPagingTarget) Equal(y AMFPagingTarget) bool { + return (aMFPagingTarget.GlobalRANNodeID == nil) == (y.GlobalRANNodeID == nil) && (aMFPagingTarget.GlobalRANNodeID == nil || (*aMFPagingTarget.GlobalRANNodeID).Equal(*y.GlobalRANNodeID)) && + (aMFPagingTarget.TAI == nil) == (y.TAI == nil) && (aMFPagingTarget.TAI == nil || (*aMFPagingTarget.TAI).Equal(*y.TAI)) && + (aMFPagingTarget.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (aMFPagingTarget.ChoiceExtension == nil || (*aMFPagingTarget.ChoiceExtension) == *y.ChoiceExtension) +} + +func (aMFStatusIndication AMFStatusIndication) Equal(y AMFStatusIndication) bool { + return aMFStatusIndication.UnavailableGUAMIList.Equal(y.UnavailableGUAMIList) && + aMFStatusIndication.messageMeta.Equal(y.messageMeta) +} + +func (aMFTNLAssociationSetupItem AMFTNLAssociationSetupItem) Equal(y AMFTNLAssociationSetupItem) bool { + return aMFTNLAssociationSetupItem.AMFTNLAssociationAddress.Equal(y.AMFTNLAssociationAddress) && + aMFTNLAssociationSetupItem.iEExtensions == y.iEExtensions && + aMFTNLAssociationSetupItem.extensions == y.extensions +} + +func (aMFTNLAssociationSetupList AMFTNLAssociationSetupList) Equal(y AMFTNLAssociationSetupList) bool { + if len(aMFTNLAssociationSetupList) != len(y) { + return false + } + for i := range aMFTNLAssociationSetupList { + if !(aMFTNLAssociationSetupList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (aMFTNLAssociationToAddItem AMFTNLAssociationToAddItem) Equal(y AMFTNLAssociationToAddItem) bool { + return aMFTNLAssociationToAddItem.AMFTNLAssociationAddress.Equal(y.AMFTNLAssociationAddress) && + (aMFTNLAssociationToAddItem.TNLAssociationUsage == nil) == (y.TNLAssociationUsage == nil) && (aMFTNLAssociationToAddItem.TNLAssociationUsage == nil || (*aMFTNLAssociationToAddItem.TNLAssociationUsage) == *y.TNLAssociationUsage) && + aMFTNLAssociationToAddItem.TNLAddressWeightFactor == y.TNLAddressWeightFactor && + aMFTNLAssociationToAddItem.iEExtensions == y.iEExtensions && + aMFTNLAssociationToAddItem.extensions == y.extensions +} + +func (aMFTNLAssociationToAddList AMFTNLAssociationToAddList) Equal(y AMFTNLAssociationToAddList) bool { + if len(aMFTNLAssociationToAddList) != len(y) { + return false + } + for i := range aMFTNLAssociationToAddList { + if !(aMFTNLAssociationToAddList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (aMFTNLAssociationToRemoveItem AMFTNLAssociationToRemoveItem) Equal(y AMFTNLAssociationToRemoveItem) bool { + return aMFTNLAssociationToRemoveItem.AMFTNLAssociationAddress.Equal(y.AMFTNLAssociationAddress) && + (aMFTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressNGRAN == nil) == (y.TNLAssociationTransportLayerAddressNGRAN == nil) && (aMFTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressNGRAN == nil || (*aMFTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressNGRAN).Equal(*y.TNLAssociationTransportLayerAddressNGRAN)) && + aMFTNLAssociationToRemoveItem.iEExtensions == y.iEExtensions && + aMFTNLAssociationToRemoveItem.extensions == y.extensions +} + +func (aMFTNLAssociationToRemoveList AMFTNLAssociationToRemoveList) Equal(y AMFTNLAssociationToRemoveList) bool { + if len(aMFTNLAssociationToRemoveList) != len(y) { + return false + } + for i := range aMFTNLAssociationToRemoveList { + if !(aMFTNLAssociationToRemoveList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (aMFTNLAssociationToUpdateItem AMFTNLAssociationToUpdateItem) Equal(y AMFTNLAssociationToUpdateItem) bool { + return aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress.Equal(y.AMFTNLAssociationAddress) && + (aMFTNLAssociationToUpdateItem.TNLAssociationUsage == nil) == (y.TNLAssociationUsage == nil) && (aMFTNLAssociationToUpdateItem.TNLAssociationUsage == nil || (*aMFTNLAssociationToUpdateItem.TNLAssociationUsage) == *y.TNLAssociationUsage) && + (aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor == nil) == (y.TNLAddressWeightFactor == nil) && (aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor == nil || (*aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor) == *y.TNLAddressWeightFactor) && + aMFTNLAssociationToUpdateItem.iEExtensions == y.iEExtensions && + aMFTNLAssociationToUpdateItem.extensions == y.extensions +} + +func (aMFTNLAssociationToUpdateList AMFTNLAssociationToUpdateList) Equal(y AMFTNLAssociationToUpdateList) bool { + if len(aMFTNLAssociationToUpdateList) != len(y) { + return false + } + for i := range aMFTNLAssociationToUpdateList { + if !(aMFTNLAssociationToUpdateList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (aUN3DeviceAccessInfo AUN3DeviceAccessInfo) Equal(y AUN3DeviceAccessInfo) bool { + return aUN3DeviceAccessInfo == y +} + +func (activatedCellList ActivatedCellList) Equal(y ActivatedCellList) bool { + if len(activatedCellList) != len(y) { + return false + } + for i := range activatedCellList { + if !(activatedCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (additionalCancelledlocationReportingReferenceIDItem AdditionalCancelledlocationReportingReferenceIDItem) Equal(y AdditionalCancelledlocationReportingReferenceIDItem) bool { + return additionalCancelledlocationReportingReferenceIDItem == y +} + +func (additionalCancelledlocationReportingReferenceIDList AdditionalCancelledlocationReportingReferenceIDList) Equal(y AdditionalCancelledlocationReportingReferenceIDList) bool { + if len(additionalCancelledlocationReportingReferenceIDList) != len(y) { + return false + } + for i := range additionalCancelledlocationReportingReferenceIDList { + if !(additionalCancelledlocationReportingReferenceIDList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (additionalDLUPTNLInformationForHOItem AdditionalDLUPTNLInformationForHOItem) Equal(y AdditionalDLUPTNLInformationForHOItem) bool { + return additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation.Equal(y.AdditionalDLNGUUPTNLInformation) && + additionalDLUPTNLInformationForHOItem.AdditionalQosFlowSetupResponse.Equal(y.AdditionalQosFlowSetupResponse) && + (additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation == nil) == (y.AdditionalDLForwardingUPTNLInformation == nil) && (additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation == nil || (*additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation).Equal(*y.AdditionalDLForwardingUPTNLInformation)) && + (additionalDLUPTNLInformationForHOItem.AdditionalRedundantDLNGUUPTNLInformation == nil) == (y.AdditionalRedundantDLNGUUPTNLInformation == nil) && (additionalDLUPTNLInformationForHOItem.AdditionalRedundantDLNGUUPTNLInformation == nil || (*additionalDLUPTNLInformationForHOItem.AdditionalRedundantDLNGUUPTNLInformation).Equal(*y.AdditionalRedundantDLNGUUPTNLInformation)) && + additionalDLUPTNLInformationForHOItem.iEExtensions == y.iEExtensions && + additionalDLUPTNLInformationForHOItem.extensions == y.extensions +} + +func (additionalDLUPTNLInformationForHOList AdditionalDLUPTNLInformationForHOList) Equal(y AdditionalDLUPTNLInformationForHOList) bool { + if len(additionalDLUPTNLInformationForHOList) != len(y) { + return false + } + for i := range additionalDLUPTNLInformationForHOList { + if !(additionalDLUPTNLInformationForHOList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (additionalULI AdditionalULI) Equal(y AdditionalULI) bool { + return additionalULI == y +} + +func (aerialUEFlightInformationReporting AerialUEFlightInformationReporting) Equal(y AerialUEFlightInformationReporting) bool { + return aerialUEFlightInformationReporting == y +} + +func (aerialUEFlightInformationReportingControl AerialUEFlightInformationReportingControl) Equal(y AerialUEFlightInformationReportingControl) bool { + return aerialUEFlightInformationReportingControl.HigherAltitudeThreshold == y.HigherAltitudeThreshold && + aerialUEFlightInformationReportingControl.LowerAltitudeThreshold == y.LowerAltitudeThreshold && + (aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity == nil) == (y.AerialUEReportPeriodicity == nil) && (aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity == nil || (*aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity) == *y.AerialUEReportPeriodicity) && + aerialUEFlightInformationReportingControl.AreaID.Equal(y.AreaID) && + aerialUEFlightInformationReportingControl.iEExtensions == y.iEExtensions && + aerialUEFlightInformationReportingControl.extensions == y.extensions +} + +func (aerialUEFlightInformationReportingControlItem AerialUEFlightInformationReportingControlItem) Equal(y AerialUEFlightInformationReportingControlItem) bool { + return aerialUEFlightInformationReportingControlItem.AerialUEFlightInformationReportingControl.Equal(y.AerialUEFlightInformationReportingControl) && + aerialUEFlightInformationReportingControlItem.iEExtensions == y.iEExtensions && + aerialUEFlightInformationReportingControlItem.extensions == y.extensions +} + +func (aerialUEFlightInformationReportingControlList AerialUEFlightInformationReportingControlList) Equal(y AerialUEFlightInformationReportingControlList) bool { + if len(aerialUEFlightInformationReportingControlList) != len(y) { + return false + } + for i := range aerialUEFlightInformationReportingControlList { + if !(aerialUEFlightInformationReportingControlList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (allocationAndRetentionPriority AllocationAndRetentionPriority) Equal(y AllocationAndRetentionPriority) bool { + return allocationAndRetentionPriority == y +} + +func (allowedCAGListperPLMN AllowedCAGListperPLMN) Equal(y AllowedCAGListperPLMN) bool { + if len(allowedCAGListperPLMN) != len(y) { + return false + } + for i := range allowedCAGListperPLMN { + if !(allowedCAGListperPLMN[i] == y[i]) { + return false + } + } + return true +} + +func (allowedNSSAI AllowedNSSAI) Equal(y AllowedNSSAI) bool { + if len(allowedNSSAI) != len(y) { + return false + } + for i := range allowedNSSAI { + if !(allowedNSSAI[i].Equal(y[i])) { + return false + } + } + return true +} + +func (allowedNSSAIItem AllowedNSSAIItem) Equal(y AllowedNSSAIItem) bool { + return allowedNSSAIItem.extensions == y.extensions && + allowedNSSAIItem.SNSSAI.Equal(y.SNSSAI) && + allowedNSSAIItem.iEExtensions == y.iEExtensions +} + +func (allowedPNINPNItem AllowedPNINPNItem) Equal(y AllowedPNINPNItem) bool { + return allowedPNINPNItem.PLMNIdentity == y.PLMNIdentity && + allowedPNINPNItem.PNINPNrestricted == y.PNINPNrestricted && + allowedPNINPNItem.AllowedCAGListperPLMN.Equal(y.AllowedCAGListperPLMN) && + allowedPNINPNItem.iEExtensions == y.iEExtensions && + allowedPNINPNItem.extensions == y.extensions +} + +func (allowedPNINPNList AllowedPNINPNList) Equal(y AllowedPNINPNList) bool { + if len(allowedPNINPNList) != len(y) { + return false + } + for i := range allowedPNINPNList { + if !(allowedPNINPNList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (allowedPeriodicityList AllowedPeriodicityList) Equal(y AllowedPeriodicityList) bool { + if len(allowedPeriodicityList) != len(y) { + return false + } + for i := range allowedPeriodicityList { + if !(allowedPeriodicityList[i] == y[i]) { + return false + } + } + return true +} + +func (allowedTACs AllowedTACs) Equal(y AllowedTACs) bool { + if len(allowedTACs) != len(y) { + return false + } + for i := range allowedTACs { + if !(allowedTACs[i] == y[i]) { + return false + } + } + return true +} + +func (alternativeQoSParaSetItem AlternativeQoSParaSetItem) Equal(y AlternativeQoSParaSetItem) bool { + return alternativeQoSParaSetItem.AlternativeQoSParaSetIndex == y.AlternativeQoSParaSetIndex && + (alternativeQoSParaSetItem.GuaranteedFlowBitRateDL == nil) == (y.GuaranteedFlowBitRateDL == nil) && (alternativeQoSParaSetItem.GuaranteedFlowBitRateDL == nil || (*alternativeQoSParaSetItem.GuaranteedFlowBitRateDL) == *y.GuaranteedFlowBitRateDL) && + (alternativeQoSParaSetItem.GuaranteedFlowBitRateUL == nil) == (y.GuaranteedFlowBitRateUL == nil) && (alternativeQoSParaSetItem.GuaranteedFlowBitRateUL == nil || (*alternativeQoSParaSetItem.GuaranteedFlowBitRateUL) == *y.GuaranteedFlowBitRateUL) && + (alternativeQoSParaSetItem.PacketDelayBudget == nil) == (y.PacketDelayBudget == nil) && (alternativeQoSParaSetItem.PacketDelayBudget == nil || (*alternativeQoSParaSetItem.PacketDelayBudget) == *y.PacketDelayBudget) && + (alternativeQoSParaSetItem.PacketErrorRate == nil) == (y.PacketErrorRate == nil) && (alternativeQoSParaSetItem.PacketErrorRate == nil || (*alternativeQoSParaSetItem.PacketErrorRate).Equal(*y.PacketErrorRate)) && + (alternativeQoSParaSetItem.MaximumDataBurstVolume == nil) == (y.MaximumDataBurstVolume == nil) && (alternativeQoSParaSetItem.MaximumDataBurstVolume == nil || (*alternativeQoSParaSetItem.MaximumDataBurstVolume) == *y.MaximumDataBurstVolume) && + (alternativeQoSParaSetItem.PduSetDelayBudgetDownlink == nil) == (y.PduSetDelayBudgetDownlink == nil) && (alternativeQoSParaSetItem.PduSetDelayBudgetDownlink == nil || (*alternativeQoSParaSetItem.PduSetDelayBudgetDownlink) == *y.PduSetDelayBudgetDownlink) && + (alternativeQoSParaSetItem.PduSetDelayBudgetUplink == nil) == (y.PduSetDelayBudgetUplink == nil) && (alternativeQoSParaSetItem.PduSetDelayBudgetUplink == nil || (*alternativeQoSParaSetItem.PduSetDelayBudgetUplink) == *y.PduSetDelayBudgetUplink) && + (alternativeQoSParaSetItem.PduSetErrorRateDownlink == nil) == (y.PduSetErrorRateDownlink == nil) && (alternativeQoSParaSetItem.PduSetErrorRateDownlink == nil || (*alternativeQoSParaSetItem.PduSetErrorRateDownlink).Equal(*y.PduSetErrorRateDownlink)) && + (alternativeQoSParaSetItem.PduSetErrorRateUplink == nil) == (y.PduSetErrorRateUplink == nil) && (alternativeQoSParaSetItem.PduSetErrorRateUplink == nil || (*alternativeQoSParaSetItem.PduSetErrorRateUplink).Equal(*y.PduSetErrorRateUplink)) && + alternativeQoSParaSetItem.iEExtensions == y.iEExtensions && + alternativeQoSParaSetItem.extensions == y.extensions +} + +func (alternativeQoSParaSetList AlternativeQoSParaSetList) Equal(y AlternativeQoSParaSetList) bool { + if len(alternativeQoSParaSetList) != len(y) { + return false + } + for i := range alternativeQoSParaSetList { + if !(alternativeQoSParaSetList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (areaID AreaID) Equal(y AreaID) bool { + return (areaID.TAI == nil) == (y.TAI == nil) && (areaID.TAI == nil || (*areaID.TAI).Equal(*y.TAI)) && + (areaID.GlobalRANNodeID == nil) == (y.GlobalRANNodeID == nil) && (areaID.GlobalRANNodeID == nil || (*areaID.GlobalRANNodeID).Equal(*y.GlobalRANNodeID)) && + (areaID.NRCGI == nil) == (y.NRCGI == nil) && (areaID.NRCGI == nil || (*areaID.NRCGI).Equal(*y.NRCGI)) && + (areaID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (areaID.ChoiceExtension == nil || (*areaID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (areaOfInterest AreaOfInterest) Equal(y AreaOfInterest) bool { + return (areaOfInterest.AreaOfInterestTAIList == nil) == (y.AreaOfInterestTAIList == nil) && areaOfInterest.AreaOfInterestTAIList.Equal(y.AreaOfInterestTAIList) && + (areaOfInterest.AreaOfInterestCellList == nil) == (y.AreaOfInterestCellList == nil) && areaOfInterest.AreaOfInterestCellList.Equal(y.AreaOfInterestCellList) && + (areaOfInterest.AreaOfInterestRANNodeList == nil) == (y.AreaOfInterestRANNodeList == nil) && areaOfInterest.AreaOfInterestRANNodeList.Equal(y.AreaOfInterestRANNodeList) && + areaOfInterest.iEExtensions == y.iEExtensions && + areaOfInterest.extensions == y.extensions +} + +func (areaOfInterestCellItem AreaOfInterestCellItem) Equal(y AreaOfInterestCellItem) bool { + return areaOfInterestCellItem.NGRANCGI.Equal(y.NGRANCGI) && + areaOfInterestCellItem.iEExtensions == y.iEExtensions && + areaOfInterestCellItem.extensions == y.extensions +} + +func (areaOfInterestCellList AreaOfInterestCellList) Equal(y AreaOfInterestCellList) bool { + if len(areaOfInterestCellList) != len(y) { + return false + } + for i := range areaOfInterestCellList { + if !(areaOfInterestCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (areaOfInterestItem AreaOfInterestItem) Equal(y AreaOfInterestItem) bool { + return areaOfInterestItem.AreaOfInterest.Equal(y.AreaOfInterest) && + areaOfInterestItem.LocationReportingReferenceID == y.LocationReportingReferenceID && + areaOfInterestItem.iEExtensions == y.iEExtensions && + areaOfInterestItem.extensions == y.extensions +} + +func (areaOfInterestList AreaOfInterestList) Equal(y AreaOfInterestList) bool { + if len(areaOfInterestList) != len(y) { + return false + } + for i := range areaOfInterestList { + if !(areaOfInterestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (areaOfInterestRANNodeItem AreaOfInterestRANNodeItem) Equal(y AreaOfInterestRANNodeItem) bool { + return areaOfInterestRANNodeItem.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + areaOfInterestRANNodeItem.iEExtensions == y.iEExtensions && + areaOfInterestRANNodeItem.extensions == y.extensions +} + +func (areaOfInterestRANNodeList AreaOfInterestRANNodeList) Equal(y AreaOfInterestRANNodeList) bool { + if len(areaOfInterestRANNodeList) != len(y) { + return false + } + for i := range areaOfInterestRANNodeList { + if !(areaOfInterestRANNodeList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (areaOfInterestTAIItem AreaOfInterestTAIItem) Equal(y AreaOfInterestTAIItem) bool { + return areaOfInterestTAIItem == y +} + +func (areaOfInterestTAIList AreaOfInterestTAIList) Equal(y AreaOfInterestTAIList) bool { + if len(areaOfInterestTAIList) != len(y) { + return false + } + for i := range areaOfInterestTAIList { + if !(areaOfInterestTAIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (areaScopeOfMDTEUTRA AreaScopeOfMDTEUTRA) Equal(y AreaScopeOfMDTEUTRA) bool { + return (areaScopeOfMDTEUTRA.CellBased == nil) == (y.CellBased == nil) && (areaScopeOfMDTEUTRA.CellBased == nil || (*areaScopeOfMDTEUTRA.CellBased).Equal(*y.CellBased)) && + (areaScopeOfMDTEUTRA.TABased == nil) == (y.TABased == nil) && (areaScopeOfMDTEUTRA.TABased == nil || (*areaScopeOfMDTEUTRA.TABased).Equal(*y.TABased)) && + (areaScopeOfMDTEUTRA.PLMNWide == nil) == (y.PLMNWide == nil) && (areaScopeOfMDTEUTRA.PLMNWide == nil || (*areaScopeOfMDTEUTRA.PLMNWide) == *y.PLMNWide) && + (areaScopeOfMDTEUTRA.TAIBased == nil) == (y.TAIBased == nil) && (areaScopeOfMDTEUTRA.TAIBased == nil || (*areaScopeOfMDTEUTRA.TAIBased).Equal(*y.TAIBased)) && + (areaScopeOfMDTEUTRA.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (areaScopeOfMDTEUTRA.ChoiceExtension == nil || (*areaScopeOfMDTEUTRA.ChoiceExtension) == *y.ChoiceExtension) +} + +func (areaScopeOfMDTNR AreaScopeOfMDTNR) Equal(y AreaScopeOfMDTNR) bool { + return (areaScopeOfMDTNR.CellBased == nil) == (y.CellBased == nil) && (areaScopeOfMDTNR.CellBased == nil || (*areaScopeOfMDTNR.CellBased).Equal(*y.CellBased)) && + (areaScopeOfMDTNR.TABased == nil) == (y.TABased == nil) && (areaScopeOfMDTNR.TABased == nil || (*areaScopeOfMDTNR.TABased).Equal(*y.TABased)) && + (areaScopeOfMDTNR.PLMNWide == nil) == (y.PLMNWide == nil) && (areaScopeOfMDTNR.PLMNWide == nil || (*areaScopeOfMDTNR.PLMNWide) == *y.PLMNWide) && + (areaScopeOfMDTNR.TAIBased == nil) == (y.TAIBased == nil) && (areaScopeOfMDTNR.TAIBased == nil || (*areaScopeOfMDTNR.TAIBased).Equal(*y.TAIBased)) && + (areaScopeOfMDTNR.PNINPNBasedMDT == nil) == (y.PNINPNBasedMDT == nil) && (areaScopeOfMDTNR.PNINPNBasedMDT == nil || (*areaScopeOfMDTNR.PNINPNBasedMDT).Equal(*y.PNINPNBasedMDT)) && + (areaScopeOfMDTNR.SNPNCellBasedMDT == nil) == (y.SNPNCellBasedMDT == nil) && (areaScopeOfMDTNR.SNPNCellBasedMDT == nil || (*areaScopeOfMDTNR.SNPNCellBasedMDT).Equal(*y.SNPNCellBasedMDT)) && + (areaScopeOfMDTNR.SNPNTAIBasedMDT == nil) == (y.SNPNTAIBasedMDT == nil) && (areaScopeOfMDTNR.SNPNTAIBasedMDT == nil || (*areaScopeOfMDTNR.SNPNTAIBasedMDT).Equal(*y.SNPNTAIBasedMDT)) && + (areaScopeOfMDTNR.SNPNBasedMDT == nil) == (y.SNPNBasedMDT == nil) && (areaScopeOfMDTNR.SNPNBasedMDT == nil || (*areaScopeOfMDTNR.SNPNBasedMDT).Equal(*y.SNPNBasedMDT)) && + (areaScopeOfMDTNR.GeographyBasedMDT == nil) == (y.GeographyBasedMDT == nil) && (areaScopeOfMDTNR.GeographyBasedMDT == nil || (*areaScopeOfMDTNR.GeographyBasedMDT).Equal(*y.GeographyBasedMDT)) && + (areaScopeOfMDTNR.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (areaScopeOfMDTNR.ChoiceExtension == nil || (*areaScopeOfMDTNR.ChoiceExtension) == *y.ChoiceExtension) && + areaScopeOfMDTNR.choiceCriticality == y.choiceCriticality +} + +func (areaScopeOfNeighCellsItem AreaScopeOfNeighCellsItem) Equal(y AreaScopeOfNeighCellsItem) bool { + return areaScopeOfNeighCellsItem.NrFrequencyInfo.Equal(y.NrFrequencyInfo) && + (areaScopeOfNeighCellsItem.PciListForMDT == nil) == (y.PciListForMDT == nil) && areaScopeOfNeighCellsItem.PciListForMDT.Equal(y.PciListForMDT) && + areaScopeOfNeighCellsItem.iEExtensions == y.iEExtensions && + areaScopeOfNeighCellsItem.extensions == y.extensions +} + +func (areaScopeOfNeighCellsList AreaScopeOfNeighCellsList) Equal(y AreaScopeOfNeighCellsList) bool { + if len(areaScopeOfNeighCellsList) != len(y) { + return false + } + for i := range areaScopeOfNeighCellsList { + if !(areaScopeOfNeighCellsList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (areaScopeOfQMC AreaScopeOfQMC) Equal(y AreaScopeOfQMC) bool { + return (areaScopeOfQMC.CellBased == nil) == (y.CellBased == nil) && (areaScopeOfQMC.CellBased == nil || (*areaScopeOfQMC.CellBased).Equal(*y.CellBased)) && + (areaScopeOfQMC.TABased == nil) == (y.TABased == nil) && (areaScopeOfQMC.TABased == nil || (*areaScopeOfQMC.TABased).Equal(*y.TABased)) && + (areaScopeOfQMC.TAIBased == nil) == (y.TAIBased == nil) && (areaScopeOfQMC.TAIBased == nil || (*areaScopeOfQMC.TAIBased).Equal(*y.TAIBased)) && + (areaScopeOfQMC.PLMNAreaBased == nil) == (y.PLMNAreaBased == nil) && (areaScopeOfQMC.PLMNAreaBased == nil || (*areaScopeOfQMC.PLMNAreaBased).Equal(*y.PLMNAreaBased)) && + (areaScopeOfQMC.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (areaScopeOfQMC.ChoiceExtension == nil || (*areaScopeOfQMC.ChoiceExtension) == *y.ChoiceExtension) +} + +func (assistanceDataForPaging AssistanceDataForPaging) Equal(y AssistanceDataForPaging) bool { + return (assistanceDataForPaging.AssistanceDataForRecommendedCells == nil) == (y.AssistanceDataForRecommendedCells == nil) && (assistanceDataForPaging.AssistanceDataForRecommendedCells == nil || (*assistanceDataForPaging.AssistanceDataForRecommendedCells).Equal(*y.AssistanceDataForRecommendedCells)) && + (assistanceDataForPaging.PagingAttemptInformation == nil) == (y.PagingAttemptInformation == nil) && (assistanceDataForPaging.PagingAttemptInformation == nil || (*assistanceDataForPaging.PagingAttemptInformation).Equal(*y.PagingAttemptInformation)) && + (assistanceDataForPaging.NPNPagingAssistanceInformation == nil) == (y.NPNPagingAssistanceInformation == nil) && (assistanceDataForPaging.NPNPagingAssistanceInformation == nil || (*assistanceDataForPaging.NPNPagingAssistanceInformation).Equal(*y.NPNPagingAssistanceInformation)) && + (assistanceDataForPaging.PagingAssisDataforCEcapabUE == nil) == (y.PagingAssisDataforCEcapabUE == nil) && (assistanceDataForPaging.PagingAssisDataforCEcapabUE == nil || (*assistanceDataForPaging.PagingAssisDataforCEcapabUE).Equal(*y.PagingAssisDataforCEcapabUE)) && + assistanceDataForPaging.iEExtensions == y.iEExtensions && + assistanceDataForPaging.extensions == y.extensions +} + +func (assistanceDataForRecommendedCells AssistanceDataForRecommendedCells) Equal(y AssistanceDataForRecommendedCells) bool { + return assistanceDataForRecommendedCells.RecommendedCellsForPaging.Equal(y.RecommendedCellsForPaging) && + assistanceDataForRecommendedCells.iEExtensions == y.iEExtensions && + assistanceDataForRecommendedCells.extensions == y.extensions +} + +func (associatedMBSQosFlowSetupRequestItem AssociatedMBSQosFlowSetupRequestItem) Equal(y AssociatedMBSQosFlowSetupRequestItem) bool { + return associatedMBSQosFlowSetupRequestItem == y +} + +func (associatedMBSQosFlowSetupRequestList AssociatedMBSQosFlowSetupRequestList) Equal(y AssociatedMBSQosFlowSetupRequestList) bool { + if len(associatedMBSQosFlowSetupRequestList) != len(y) { + return false + } + for i := range associatedMBSQosFlowSetupRequestList { + if !(associatedMBSQosFlowSetupRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (associatedMBSQosFlowSetuporModifyRequestItem AssociatedMBSQosFlowSetuporModifyRequestItem) Equal(y AssociatedMBSQosFlowSetuporModifyRequestItem) bool { + return associatedMBSQosFlowSetuporModifyRequestItem == y +} + +func (associatedMBSQosFlowSetuporModifyRequestList AssociatedMBSQosFlowSetuporModifyRequestList) Equal(y AssociatedMBSQosFlowSetuporModifyRequestList) bool { + if len(associatedMBSQosFlowSetuporModifyRequestList) != len(y) { + return false + } + for i := range associatedMBSQosFlowSetuporModifyRequestList { + if !(associatedMBSQosFlowSetuporModifyRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (associatedQosFlowItem AssociatedQosFlowItem) Equal(y AssociatedQosFlowItem) bool { + return associatedQosFlowItem.QosFlowIdentifier == y.QosFlowIdentifier && + (associatedQosFlowItem.QosFlowMappingIndication == nil) == (y.QosFlowMappingIndication == nil) && (associatedQosFlowItem.QosFlowMappingIndication == nil || (*associatedQosFlowItem.QosFlowMappingIndication) == *y.QosFlowMappingIndication) && + (associatedQosFlowItem.CurrentQoSParaSetIndex == nil) == (y.CurrentQoSParaSetIndex == nil) && (associatedQosFlowItem.CurrentQoSParaSetIndex == nil || (*associatedQosFlowItem.CurrentQoSParaSetIndex) == *y.CurrentQoSParaSetIndex) && + associatedQosFlowItem.iEExtensions == y.iEExtensions && + associatedQosFlowItem.extensions == y.extensions +} + +func (associatedQosFlowList AssociatedQosFlowList) Equal(y AssociatedQosFlowList) bool { + if len(associatedQosFlowList) != len(y) { + return false + } + for i := range associatedQosFlowList { + if !(associatedQosFlowList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (availableBitrateReportThresholdItem AvailableBitrateReportThresholdItem) Equal(y AvailableBitrateReportThresholdItem) bool { + return availableBitrateReportThresholdItem == y +} + +func (availableBitrateReportThresholdList AvailableBitrateReportThresholdList) Equal(y AvailableBitrateReportThresholdList) bool { + if len(availableBitrateReportThresholdList) != len(y) { + return false + } + for i := range availableBitrateReportThresholdList { + if !(availableBitrateReportThresholdList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (availableRANVisibleQoEMetrics AvailableRANVisibleQoEMetrics) Equal(y AvailableRANVisibleQoEMetrics) bool { + return (availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList == nil) == (y.ApplicationLayerBufferLevelList == nil) && (availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList == nil || (*availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList) == *y.ApplicationLayerBufferLevelList) && + (availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup == nil) == (y.PlayoutDelayForMediaStartup == nil) && (availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup == nil || (*availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup) == *y.PlayoutDelayForMediaStartup) && + availableRANVisibleQoEMetrics.iEExtensions == y.iEExtensions && + availableRANVisibleQoEMetrics.extensions == y.extensions +} + +func (beamMeasurementsReportConfiguration BeamMeasurementsReportConfiguration) Equal(y BeamMeasurementsReportConfiguration) bool { + return (beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity == nil) == (y.BeamMeasurementsReportQuantity == nil) && (beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity == nil || (*beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity).Equal(*y.BeamMeasurementsReportQuantity)) && + (beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport == nil) == (y.MaxNrofRSIndexesToReport == nil) && (beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport == nil || (*beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport) == *y.MaxNrofRSIndexesToReport) && + beamMeasurementsReportConfiguration.iEExtensions == y.iEExtensions && + beamMeasurementsReportConfiguration.extensions == y.extensions +} + +func (beamMeasurementsReportQuantity BeamMeasurementsReportQuantity) Equal(y BeamMeasurementsReportQuantity) bool { + return beamMeasurementsReportQuantity == y +} + +func (bluetoothMeasConfigNameItem BluetoothMeasConfigNameItem) Equal(y BluetoothMeasConfigNameItem) bool { + return bluetoothMeasConfigNameItem.BluetoothName.Equal(y.BluetoothName) && + bluetoothMeasConfigNameItem.iEExtensions == y.iEExtensions && + bluetoothMeasConfigNameItem.extensions == y.extensions +} + +func (bluetoothMeasConfigNameList BluetoothMeasConfigNameList) Equal(y BluetoothMeasConfigNameList) bool { + if len(bluetoothMeasConfigNameList) != len(y) { + return false + } + for i := range bluetoothMeasConfigNameList { + if !(bluetoothMeasConfigNameList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (bluetoothMeasurementConfiguration BluetoothMeasurementConfiguration) Equal(y BluetoothMeasurementConfiguration) bool { + return bluetoothMeasurementConfiguration.BluetoothMeasConfig == y.BluetoothMeasConfig && + (bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList == nil) == (y.BluetoothMeasConfigNameList == nil) && bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList.Equal(y.BluetoothMeasConfigNameList) && + (bluetoothMeasurementConfiguration.Btrssi == nil) == (y.Btrssi == nil) && (bluetoothMeasurementConfiguration.Btrssi == nil || (*bluetoothMeasurementConfiguration.Btrssi) == *y.Btrssi) && + bluetoothMeasurementConfiguration.iEExtensions == y.iEExtensions && + bluetoothMeasurementConfiguration.extensions == y.extensions +} + +func (bluetoothName BluetoothName) Equal(y BluetoothName) bool { + if len(bluetoothName) != len(y) { + return false + } + for i := range bluetoothName { + if !(bluetoothName[i] == y[i]) { + return false + } + } + return true +} + +func (broadcastCancelledAreaList BroadcastCancelledAreaList) Equal(y BroadcastCancelledAreaList) bool { + return (broadcastCancelledAreaList.CellIDCancelledEUTRA == nil) == (y.CellIDCancelledEUTRA == nil) && (broadcastCancelledAreaList.CellIDCancelledEUTRA == nil || (*broadcastCancelledAreaList.CellIDCancelledEUTRA).Equal(*y.CellIDCancelledEUTRA)) && + (broadcastCancelledAreaList.TAICancelledEUTRA == nil) == (y.TAICancelledEUTRA == nil) && (broadcastCancelledAreaList.TAICancelledEUTRA == nil || (*broadcastCancelledAreaList.TAICancelledEUTRA).Equal(*y.TAICancelledEUTRA)) && + (broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA == nil) == (y.EmergencyAreaIDCancelledEUTRA == nil) && (broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA == nil || (*broadcastCancelledAreaList.EmergencyAreaIDCancelledEUTRA).Equal(*y.EmergencyAreaIDCancelledEUTRA)) && + (broadcastCancelledAreaList.CellIDCancelledNR == nil) == (y.CellIDCancelledNR == nil) && (broadcastCancelledAreaList.CellIDCancelledNR == nil || (*broadcastCancelledAreaList.CellIDCancelledNR).Equal(*y.CellIDCancelledNR)) && + (broadcastCancelledAreaList.TAICancelledNR == nil) == (y.TAICancelledNR == nil) && (broadcastCancelledAreaList.TAICancelledNR == nil || (*broadcastCancelledAreaList.TAICancelledNR).Equal(*y.TAICancelledNR)) && + (broadcastCancelledAreaList.EmergencyAreaIDCancelledNR == nil) == (y.EmergencyAreaIDCancelledNR == nil) && (broadcastCancelledAreaList.EmergencyAreaIDCancelledNR == nil || (*broadcastCancelledAreaList.EmergencyAreaIDCancelledNR).Equal(*y.EmergencyAreaIDCancelledNR)) && + (broadcastCancelledAreaList.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (broadcastCancelledAreaList.ChoiceExtension == nil || (*broadcastCancelledAreaList.ChoiceExtension) == *y.ChoiceExtension) +} + +func (broadcastCompletedAreaList BroadcastCompletedAreaList) Equal(y BroadcastCompletedAreaList) bool { + return (broadcastCompletedAreaList.CellIDBroadcastEUTRA == nil) == (y.CellIDBroadcastEUTRA == nil) && (broadcastCompletedAreaList.CellIDBroadcastEUTRA == nil || (*broadcastCompletedAreaList.CellIDBroadcastEUTRA).Equal(*y.CellIDBroadcastEUTRA)) && + (broadcastCompletedAreaList.TAIBroadcastEUTRA == nil) == (y.TAIBroadcastEUTRA == nil) && (broadcastCompletedAreaList.TAIBroadcastEUTRA == nil || (*broadcastCompletedAreaList.TAIBroadcastEUTRA).Equal(*y.TAIBroadcastEUTRA)) && + (broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA == nil) == (y.EmergencyAreaIDBroadcastEUTRA == nil) && (broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA == nil || (*broadcastCompletedAreaList.EmergencyAreaIDBroadcastEUTRA).Equal(*y.EmergencyAreaIDBroadcastEUTRA)) && + (broadcastCompletedAreaList.CellIDBroadcastNR == nil) == (y.CellIDBroadcastNR == nil) && (broadcastCompletedAreaList.CellIDBroadcastNR == nil || (*broadcastCompletedAreaList.CellIDBroadcastNR).Equal(*y.CellIDBroadcastNR)) && + (broadcastCompletedAreaList.TAIBroadcastNR == nil) == (y.TAIBroadcastNR == nil) && (broadcastCompletedAreaList.TAIBroadcastNR == nil || (*broadcastCompletedAreaList.TAIBroadcastNR).Equal(*y.TAIBroadcastNR)) && + (broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR == nil) == (y.EmergencyAreaIDBroadcastNR == nil) && (broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR == nil || (*broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR).Equal(*y.EmergencyAreaIDBroadcastNR)) && + (broadcastCompletedAreaList.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (broadcastCompletedAreaList.ChoiceExtension == nil || (*broadcastCompletedAreaList.ChoiceExtension) == *y.ChoiceExtension) +} + +func (broadcastPLMNItem BroadcastPLMNItem) Equal(y BroadcastPLMNItem) bool { + return broadcastPLMNItem.extensions == y.extensions && + broadcastPLMNItem.PLMNIdentity == y.PLMNIdentity && + broadcastPLMNItem.TAISliceSupportList.Equal(y.TAISliceSupportList) && + (broadcastPLMNItem.NPNSupport == nil) == (y.NPNSupport == nil) && (broadcastPLMNItem.NPNSupport == nil || (*broadcastPLMNItem.NPNSupport).Equal(*y.NPNSupport)) && + broadcastPLMNItem.ExtendedTAISliceSupportList.Equal(y.ExtendedTAISliceSupportList) && + broadcastPLMNItem.TAINSAGSupportList.Equal(y.TAINSAGSupportList) && + broadcastPLMNItem.iEExtensions == y.iEExtensions +} + +func (broadcastPLMNList BroadcastPLMNList) Equal(y BroadcastPLMNList) bool { + if len(broadcastPLMNList) != len(y) { + return false + } + for i := range broadcastPLMNList { + if !(broadcastPLMNList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (burstArrivalTime BurstArrivalTime) Equal(y BurstArrivalTime) bool { + if len(burstArrivalTime) != len(y) { + return false + } + for i := range burstArrivalTime { + if !(burstArrivalTime[i] == y[i]) { + return false + } + } + return true +} + +func (burstArrivalTimeWindow BurstArrivalTimeWindow) Equal(y BurstArrivalTimeWindow) bool { + return burstArrivalTimeWindow == y +} + +func (cAGListforMDT CAGListforMDT) Equal(y CAGListforMDT) bool { + if len(cAGListforMDT) != len(y) { + return false + } + for i := range cAGListforMDT { + if !(cAGListforMDT[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cAGListforMDTItem CAGListforMDTItem) Equal(y CAGListforMDTItem) bool { + return cAGListforMDTItem == y +} + +func (cNAssistedRANTuning CNAssistedRANTuning) Equal(y CNAssistedRANTuning) bool { + return (cNAssistedRANTuning.ExpectedUEBehaviour == nil) == (y.ExpectedUEBehaviour == nil) && (cNAssistedRANTuning.ExpectedUEBehaviour == nil || (*cNAssistedRANTuning.ExpectedUEBehaviour).Equal(*y.ExpectedUEBehaviour)) && + cNAssistedRANTuning.iEExtensions == y.iEExtensions && + cNAssistedRANTuning.extensions == y.extensions +} + +func (cNTypeRestrictionsForEquivalent CNTypeRestrictionsForEquivalent) Equal(y CNTypeRestrictionsForEquivalent) bool { + if len(cNTypeRestrictionsForEquivalent) != len(y) { + return false + } + for i := range cNTypeRestrictionsForEquivalent { + if !(cNTypeRestrictionsForEquivalent[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cNTypeRestrictionsForEquivalentItem CNTypeRestrictionsForEquivalentItem) Equal(y CNTypeRestrictionsForEquivalentItem) bool { + return cNTypeRestrictionsForEquivalentItem == y +} + +func (cPTransportLayerInformation CPTransportLayerInformation) Equal(y CPTransportLayerInformation) bool { + return (cPTransportLayerInformation.EndpointIPAddress == nil) == (y.EndpointIPAddress == nil) && (cPTransportLayerInformation.EndpointIPAddress == nil || (*cPTransportLayerInformation.EndpointIPAddress) == *y.EndpointIPAddress) && + (cPTransportLayerInformation.EndpointIPAddressAndPort == nil) == (y.EndpointIPAddressAndPort == nil) && (cPTransportLayerInformation.EndpointIPAddressAndPort == nil || (*cPTransportLayerInformation.EndpointIPAddressAndPort).Equal(*y.EndpointIPAddressAndPort)) && + (cPTransportLayerInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (cPTransportLayerInformation.ChoiceExtension == nil || (*cPTransportLayerInformation.ChoiceExtension) == *y.ChoiceExtension) && + cPTransportLayerInformation.choiceCriticality == y.choiceCriticality +} + +func (cancelledCellsInEAIEUTRAItem CancelledCellsInEAIEUTRAItem) Equal(y CancelledCellsInEAIEUTRAItem) bool { + return cancelledCellsInEAIEUTRAItem == y +} + +func (cancelledCellsInEAINRItem CancelledCellsInEAINRItem) Equal(y CancelledCellsInEAINRItem) bool { + return cancelledCellsInEAINRItem == y +} + +func (cancelledCellsInTAIEUTRAItem CancelledCellsInTAIEUTRAItem) Equal(y CancelledCellsInTAIEUTRAItem) bool { + return cancelledCellsInTAIEUTRAItem == y +} + +func (cancelledCellsInTAINRItem CancelledCellsInTAINRItem) Equal(y CancelledCellsInTAINRItem) bool { + return cancelledCellsInTAINRItem == y +} + +func (candidateCell CandidateCell) Equal(y CandidateCell) bool { + return (candidateCell.CandidateCGI == nil) == (y.CandidateCGI == nil) && (candidateCell.CandidateCGI == nil || (*candidateCell.CandidateCGI).Equal(*y.CandidateCGI)) && + (candidateCell.CandidatePCI == nil) == (y.CandidatePCI == nil) && (candidateCell.CandidatePCI == nil || (*candidateCell.CandidatePCI).Equal(*y.CandidatePCI)) && + (candidateCell.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (candidateCell.ChoiceExtension == nil || (*candidateCell.ChoiceExtension) == *y.ChoiceExtension) +} + +func (candidateCellID CandidateCellID) Equal(y CandidateCellID) bool { + return candidateCellID == y +} + +func (candidateCellItem CandidateCellItem) Equal(y CandidateCellItem) bool { + return candidateCellItem.CandidateCell.Equal(y.CandidateCell) && + candidateCellItem.iEExtensions == y.iEExtensions && + candidateCellItem.extensions == y.extensions +} + +func (candidateCellList CandidateCellList) Equal(y CandidateCellList) bool { + if len(candidateCellList) != len(y) { + return false + } + for i := range candidateCellList { + if !(candidateCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (candidatePCI CandidatePCI) Equal(y CandidatePCI) bool { + return candidatePCI == y +} + +func (candidateRelayUEInformationItem CandidateRelayUEInformationItem) Equal(y CandidateRelayUEInformationItem) bool { + return candidateRelayUEInformationItem == y +} + +func (candidateRelayUEInformationList CandidateRelayUEInformationList) Equal(y CandidateRelayUEInformationList) bool { + if len(candidateRelayUEInformationList) != len(y) { + return false + } + for i := range candidateRelayUEInformationList { + if !(candidateRelayUEInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cause Cause) Equal(y Cause) bool { + return (cause.RadioNetwork == nil) == (y.RadioNetwork == nil) && (cause.RadioNetwork == nil || (*cause.RadioNetwork) == *y.RadioNetwork) && + (cause.Transport == nil) == (y.Transport == nil) && (cause.Transport == nil || (*cause.Transport) == *y.Transport) && + (cause.NAS == nil) == (y.NAS == nil) && (cause.NAS == nil || (*cause.NAS) == *y.NAS) && + (cause.Protocol == nil) == (y.Protocol == nil) && (cause.Protocol == nil || (*cause.Protocol) == *y.Protocol) && + (cause.Misc == nil) == (y.Misc == nil) && (cause.Misc == nil || (*cause.Misc) == *y.Misc) && + (cause.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (cause.ChoiceExtension == nil || (*cause.ChoiceExtension) == *y.ChoiceExtension) +} + +func (cellBasedMDTEUTRA CellBasedMDTEUTRA) Equal(y CellBasedMDTEUTRA) bool { + return cellBasedMDTEUTRA.CellIdListforMDT.Equal(y.CellIdListforMDT) && + cellBasedMDTEUTRA.iEExtensions == y.iEExtensions && + cellBasedMDTEUTRA.extensions == y.extensions +} + +func (cellBasedMDTNR CellBasedMDTNR) Equal(y CellBasedMDTNR) bool { + return cellBasedMDTNR.CellIdListforMDT.Equal(y.CellIdListforMDT) && + cellBasedMDTNR.iEExtensions == y.iEExtensions && + cellBasedMDTNR.extensions == y.extensions +} + +func (cellBasedQMC CellBasedQMC) Equal(y CellBasedQMC) bool { + return cellBasedQMC.CellIdListforQMC.Equal(y.CellIdListforQMC) && + cellBasedQMC.iEExtensions == y.iEExtensions && + cellBasedQMC.extensions == y.extensions +} + +func (cellCAGList CellCAGList) Equal(y CellCAGList) bool { + if len(cellCAGList) != len(y) { + return false + } + for i := range cellCAGList { + if !(cellCAGList[i] == y[i]) { + return false + } + } + return true +} + +func (cellIDBroadcastEUTRA CellIDBroadcastEUTRA) Equal(y CellIDBroadcastEUTRA) bool { + if len(cellIDBroadcastEUTRA) != len(y) { + return false + } + for i := range cellIDBroadcastEUTRA { + if !(cellIDBroadcastEUTRA[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIDBroadcastEUTRAItem CellIDBroadcastEUTRAItem) Equal(y CellIDBroadcastEUTRAItem) bool { + return cellIDBroadcastEUTRAItem == y +} + +func (cellIDBroadcastNR CellIDBroadcastNR) Equal(y CellIDBroadcastNR) bool { + if len(cellIDBroadcastNR) != len(y) { + return false + } + for i := range cellIDBroadcastNR { + if !(cellIDBroadcastNR[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIDBroadcastNRItem CellIDBroadcastNRItem) Equal(y CellIDBroadcastNRItem) bool { + return cellIDBroadcastNRItem == y +} + +func (cellIDCancelledEUTRA CellIDCancelledEUTRA) Equal(y CellIDCancelledEUTRA) bool { + if len(cellIDCancelledEUTRA) != len(y) { + return false + } + for i := range cellIDCancelledEUTRA { + if !(cellIDCancelledEUTRA[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIDCancelledEUTRAItem CellIDCancelledEUTRAItem) Equal(y CellIDCancelledEUTRAItem) bool { + return cellIDCancelledEUTRAItem == y +} + +func (cellIDCancelledNR CellIDCancelledNR) Equal(y CellIDCancelledNR) bool { + if len(cellIDCancelledNR) != len(y) { + return false + } + for i := range cellIDCancelledNR { + if !(cellIDCancelledNR[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIDCancelledNRItem CellIDCancelledNRItem) Equal(y CellIDCancelledNRItem) bool { + return cellIDCancelledNRItem == y +} + +func (cellIDListForRestart CellIDListForRestart) Equal(y CellIDListForRestart) bool { + return (cellIDListForRestart.EUTRACGIListforRestart == nil) == (y.EUTRACGIListforRestart == nil) && (cellIDListForRestart.EUTRACGIListforRestart == nil || (*cellIDListForRestart.EUTRACGIListforRestart).Equal(*y.EUTRACGIListforRestart)) && + (cellIDListForRestart.NRCGIListforRestart == nil) == (y.NRCGIListforRestart == nil) && (cellIDListForRestart.NRCGIListforRestart == nil || (*cellIDListForRestart.NRCGIListforRestart).Equal(*y.NRCGIListforRestart)) && + (cellIDListForRestart.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (cellIDListForRestart.ChoiceExtension == nil || (*cellIDListForRestart.ChoiceExtension) == *y.ChoiceExtension) +} + +func (cellIdListforMDTEUTRA CellIdListforMDTEUTRA) Equal(y CellIdListforMDTEUTRA) bool { + if len(cellIdListforMDTEUTRA) != len(y) { + return false + } + for i := range cellIdListforMDTEUTRA { + if !(cellIdListforMDTEUTRA[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIdListforMDTNR CellIdListforMDTNR) Equal(y CellIdListforMDTNR) bool { + if len(cellIdListforMDTNR) != len(y) { + return false + } + for i := range cellIdListforMDTNR { + if !(cellIdListforMDTNR[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIdListforQMC CellIdListforQMC) Equal(y CellIdListforQMC) bool { + if len(cellIdListforQMC) != len(y) { + return false + } + for i := range cellIdListforQMC { + if !(cellIdListforQMC[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellType CellType) Equal(y CellType) bool { + return cellType == y +} + +func (cellsToActivateList CellsToActivateList) Equal(y CellsToActivateList) bool { + if len(cellsToActivateList) != len(y) { + return false + } + for i := range cellsToActivateList { + if !(cellsToActivateList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (clockQualityAcceptanceCriteria ClockQualityAcceptanceCriteria) Equal(y ClockQualityAcceptanceCriteria) bool { + return (clockQualityAcceptanceCriteria.SynchronisationState == nil) == (y.SynchronisationState == nil) && (clockQualityAcceptanceCriteria.SynchronisationState == nil || (*clockQualityAcceptanceCriteria.SynchronisationState).Equal(*y.SynchronisationState)) && + (clockQualityAcceptanceCriteria.TraceabletoUTC == nil) == (y.TraceabletoUTC == nil) && (clockQualityAcceptanceCriteria.TraceabletoUTC == nil || (*clockQualityAcceptanceCriteria.TraceabletoUTC) == *y.TraceabletoUTC) && + (clockQualityAcceptanceCriteria.TraceabletoGNSS == nil) == (y.TraceabletoGNSS == nil) && (clockQualityAcceptanceCriteria.TraceabletoGNSS == nil || (*clockQualityAcceptanceCriteria.TraceabletoGNSS) == *y.TraceabletoGNSS) && + (clockQualityAcceptanceCriteria.ClockFrequencyStability == nil) == (y.ClockFrequencyStability == nil) && (clockQualityAcceptanceCriteria.ClockFrequencyStability == nil || (*clockQualityAcceptanceCriteria.ClockFrequencyStability) == *y.ClockFrequencyStability) && + (clockQualityAcceptanceCriteria.ClockAccuracy == nil) == (y.ClockAccuracy == nil) && (clockQualityAcceptanceCriteria.ClockAccuracy == nil || (*clockQualityAcceptanceCriteria.ClockAccuracy) == *y.ClockAccuracy) && + (clockQualityAcceptanceCriteria.ParentTImeSource == nil) == (y.ParentTImeSource == nil) && (clockQualityAcceptanceCriteria.ParentTImeSource == nil || (*clockQualityAcceptanceCriteria.ParentTImeSource).Equal(*y.ParentTImeSource)) && + clockQualityAcceptanceCriteria.iEExtensions == y.iEExtensions && + clockQualityAcceptanceCriteria.extensions == y.extensions +} + +func (clockQualityAcceptanceCriteriaParentTImeSource ClockQualityAcceptanceCriteriaParentTImeSource) Equal(y ClockQualityAcceptanceCriteriaParentTImeSource) bool { + return clockQualityAcceptanceCriteriaParentTImeSource == y +} + +func (clockQualityAcceptanceCriteriaSynchronisationState ClockQualityAcceptanceCriteriaSynchronisationState) Equal(y ClockQualityAcceptanceCriteriaSynchronisationState) bool { + return clockQualityAcceptanceCriteriaSynchronisationState == y +} + +func (clockQualityAcceptanceIndication ClockQualityAcceptanceIndication) Equal(y ClockQualityAcceptanceIndication) bool { + return clockQualityAcceptanceIndication.ClockQualityAcceptanceCriteria.Equal(y.ClockQualityAcceptanceCriteria) && + clockQualityAcceptanceIndication.iEExtensions == y.iEExtensions && + clockQualityAcceptanceIndication.extensions == y.extensions +} + +func (clockQualityDetailLevel ClockQualityDetailLevel) Equal(y ClockQualityDetailLevel) bool { + return (clockQualityDetailLevel.ClockQualityMetrics == nil) == (y.ClockQualityMetrics == nil) && (clockQualityDetailLevel.ClockQualityMetrics == nil || (*clockQualityDetailLevel.ClockQualityMetrics) == *y.ClockQualityMetrics) && + (clockQualityDetailLevel.ClockQualityAcceptanceIndication == nil) == (y.ClockQualityAcceptanceIndication == nil) && (clockQualityDetailLevel.ClockQualityAcceptanceIndication == nil || (*clockQualityDetailLevel.ClockQualityAcceptanceIndication).Equal(*y.ClockQualityAcceptanceIndication)) && + (clockQualityDetailLevel.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (clockQualityDetailLevel.ChoiceExtension == nil || (*clockQualityDetailLevel.ChoiceExtension) == *y.ChoiceExtension) +} + +func (clockQualityReportingControlInfo ClockQualityReportingControlInfo) Equal(y ClockQualityReportingControlInfo) bool { + return clockQualityReportingControlInfo.ClockQualityDetailLevel.Equal(y.ClockQualityDetailLevel) && + clockQualityReportingControlInfo.iEExtensions == y.iEExtensions && + clockQualityReportingControlInfo.extensions == y.extensions +} + +func (commonNetworkInstance CommonNetworkInstance) Equal(y CommonNetworkInstance) bool { + if len(commonNetworkInstance) != len(y) { + return false + } + for i := range commonNetworkInstance { + if !(commonNetworkInstance[i] == y[i]) { + return false + } + } + return true +} + +func (completedCellsInEAIEUTRAItem CompletedCellsInEAIEUTRAItem) Equal(y CompletedCellsInEAIEUTRAItem) bool { + return completedCellsInEAIEUTRAItem == y +} + +func (completedCellsInEAINRItem CompletedCellsInEAINRItem) Equal(y CompletedCellsInEAINRItem) bool { + return completedCellsInEAINRItem == y +} + +func (completedCellsInTAIEUTRAItem CompletedCellsInTAIEUTRAItem) Equal(y CompletedCellsInTAIEUTRAItem) bool { + return completedCellsInTAIEUTRAItem == y +} + +func (completedCellsInTAINRItem CompletedCellsInTAINRItem) Equal(y CompletedCellsInTAINRItem) bool { + return completedCellsInTAINRItem == y +} + +func (compositeAvailableCapacity CompositeAvailableCapacity) Equal(y CompositeAvailableCapacity) bool { + return (compositeAvailableCapacity.CellCapacityClassValue == nil) == (y.CellCapacityClassValue == nil) && (compositeAvailableCapacity.CellCapacityClassValue == nil || (*compositeAvailableCapacity.CellCapacityClassValue) == *y.CellCapacityClassValue) && + compositeAvailableCapacity.CapacityValue == y.CapacityValue && + compositeAvailableCapacity.iEExtensions == y.iEExtensions && + compositeAvailableCapacity.extensions == y.extensions +} + +func (coreNetworkAssistanceInformationForInactive CoreNetworkAssistanceInformationForInactive) Equal(y CoreNetworkAssistanceInformationForInactive) bool { + return coreNetworkAssistanceInformationForInactive.UEIdentityIndexValue.Equal(y.UEIdentityIndexValue) && + (coreNetworkAssistanceInformationForInactive.UESpecificDRX == nil) == (y.UESpecificDRX == nil) && (coreNetworkAssistanceInformationForInactive.UESpecificDRX == nil || (*coreNetworkAssistanceInformationForInactive.UESpecificDRX) == *y.UESpecificDRX) && + coreNetworkAssistanceInformationForInactive.PeriodicRegistrationUpdateTimer == y.PeriodicRegistrationUpdateTimer && + (coreNetworkAssistanceInformationForInactive.MICOModeIndication == nil) == (y.MICOModeIndication == nil) && (coreNetworkAssistanceInformationForInactive.MICOModeIndication == nil || (*coreNetworkAssistanceInformationForInactive.MICOModeIndication) == *y.MICOModeIndication) && + coreNetworkAssistanceInformationForInactive.TAIListForInactive.Equal(y.TAIListForInactive) && + (coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour == nil) == (y.ExpectedUEBehaviour == nil) && (coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour == nil || (*coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour).Equal(*y.ExpectedUEBehaviour)) && + (coreNetworkAssistanceInformationForInactive.EUTRAPagingeDRXInformation == nil) == (y.EUTRAPagingeDRXInformation == nil) && (coreNetworkAssistanceInformationForInactive.EUTRAPagingeDRXInformation == nil || (*coreNetworkAssistanceInformationForInactive.EUTRAPagingeDRXInformation).Equal(*y.EUTRAPagingeDRXInformation)) && + (coreNetworkAssistanceInformationForInactive.ExtendedUEIdentityIndexValue == nil) == (y.ExtendedUEIdentityIndexValue == nil) && (coreNetworkAssistanceInformationForInactive.ExtendedUEIdentityIndexValue == nil || (*coreNetworkAssistanceInformationForInactive.ExtendedUEIdentityIndexValue) == *y.ExtendedUEIdentityIndexValue) && + (coreNetworkAssistanceInformationForInactive.UERadioCapabilityForPaging == nil) == (y.UERadioCapabilityForPaging == nil) && (coreNetworkAssistanceInformationForInactive.UERadioCapabilityForPaging == nil || (*coreNetworkAssistanceInformationForInactive.UERadioCapabilityForPaging).Equal(*y.UERadioCapabilityForPaging)) && + (coreNetworkAssistanceInformationForInactive.MicoAllPLMN == nil) == (y.MicoAllPLMN == nil) && (coreNetworkAssistanceInformationForInactive.MicoAllPLMN == nil || (*coreNetworkAssistanceInformationForInactive.MicoAllPLMN) == *y.MicoAllPLMN) && + (coreNetworkAssistanceInformationForInactive.NRPagingeDRXInformation == nil) == (y.NRPagingeDRXInformation == nil) && (coreNetworkAssistanceInformationForInactive.NRPagingeDRXInformation == nil || (*coreNetworkAssistanceInformationForInactive.NRPagingeDRXInformation).Equal(*y.NRPagingeDRXInformation)) && + (coreNetworkAssistanceInformationForInactive.PagingCauseIndicationForVoiceService == nil) == (y.PagingCauseIndicationForVoiceService == nil) && (coreNetworkAssistanceInformationForInactive.PagingCauseIndicationForVoiceService == nil || (*coreNetworkAssistanceInformationForInactive.PagingCauseIndicationForVoiceService) == *y.PagingCauseIndicationForVoiceService) && + (coreNetworkAssistanceInformationForInactive.PEIPSassistanceInformation == nil) == (y.PEIPSassistanceInformation == nil) && (coreNetworkAssistanceInformationForInactive.PEIPSassistanceInformation == nil || (*coreNetworkAssistanceInformationForInactive.PEIPSassistanceInformation).Equal(*y.PEIPSassistanceInformation)) && + (coreNetworkAssistanceInformationForInactive.HashedUEIdentityIndexValue == nil) == (y.HashedUEIdentityIndexValue == nil) && (coreNetworkAssistanceInformationForInactive.HashedUEIdentityIndexValue == nil || (*coreNetworkAssistanceInformationForInactive.HashedUEIdentityIndexValue).Equal(*y.HashedUEIdentityIndexValue)) && + (coreNetworkAssistanceInformationForInactive.CNMTCommunicationHandling == nil) == (y.CNMTCommunicationHandling == nil) && (coreNetworkAssistanceInformationForInactive.CNMTCommunicationHandling == nil || (*coreNetworkAssistanceInformationForInactive.CNMTCommunicationHandling) == *y.CNMTCommunicationHandling) && + (coreNetworkAssistanceInformationForInactive.LPWUSPSAssistanceInformation == nil) == (y.LPWUSPSAssistanceInformation == nil) && (coreNetworkAssistanceInformationForInactive.LPWUSPSAssistanceInformation == nil || (*coreNetworkAssistanceInformationForInactive.LPWUSPSAssistanceInformation).Equal(*y.LPWUSPSAssistanceInformation)) && + (coreNetworkAssistanceInformationForInactive.FurtherExtendedUEIdentityIndexValue == nil) == (y.FurtherExtendedUEIdentityIndexValue == nil) && (coreNetworkAssistanceInformationForInactive.FurtherExtendedUEIdentityIndexValue == nil || (*coreNetworkAssistanceInformationForInactive.FurtherExtendedUEIdentityIndexValue) == *y.FurtherExtendedUEIdentityIndexValue) && + (coreNetworkAssistanceInformationForInactive.LPWUSDisableIndication == nil) == (y.LPWUSDisableIndication == nil) && (coreNetworkAssistanceInformationForInactive.LPWUSDisableIndication == nil || (*coreNetworkAssistanceInformationForInactive.LPWUSDisableIndication) == *y.LPWUSDisableIndication) && + coreNetworkAssistanceInformationForInactive.iEExtensions == y.iEExtensions && + coreNetworkAssistanceInformationForInactive.extensions == y.extensions +} + +func (coverageEnhancementLevel CoverageEnhancementLevel) Equal(y CoverageEnhancementLevel) bool { + if len(coverageEnhancementLevel) != len(y) { + return false + } + for i := range coverageEnhancementLevel { + if !(coverageEnhancementLevel[i] == y[i]) { + return false + } + } + return true +} + +func (criticalityDiagnostics CriticalityDiagnostics) Equal(y CriticalityDiagnostics) bool { + return (criticalityDiagnostics.ProcedureCode == nil) == (y.ProcedureCode == nil) && (criticalityDiagnostics.ProcedureCode == nil || (*criticalityDiagnostics.ProcedureCode) == *y.ProcedureCode) && + (criticalityDiagnostics.TriggeringMessage == nil) == (y.TriggeringMessage == nil) && (criticalityDiagnostics.TriggeringMessage == nil || (*criticalityDiagnostics.TriggeringMessage) == *y.TriggeringMessage) && + (criticalityDiagnostics.ProcedureCriticality == nil) == (y.ProcedureCriticality == nil) && (criticalityDiagnostics.ProcedureCriticality == nil || (*criticalityDiagnostics.ProcedureCriticality) == *y.ProcedureCriticality) && + (criticalityDiagnostics.IEsCriticalityDiagnostics == nil) == (y.IEsCriticalityDiagnostics == nil) && criticalityDiagnostics.IEsCriticalityDiagnostics.Equal(y.IEsCriticalityDiagnostics) && + criticalityDiagnostics.iEExtensions == y.iEExtensions && + criticalityDiagnostics.extensions == y.extensions +} + +func (criticalityDiagnosticsIEItem CriticalityDiagnosticsIEItem) Equal(y CriticalityDiagnosticsIEItem) bool { + return criticalityDiagnosticsIEItem == y +} + +func (criticalityDiagnosticsIEList CriticalityDiagnosticsIEList) Equal(y CriticalityDiagnosticsIEList) bool { + if len(criticalityDiagnosticsIEList) != len(y) { + return false + } + for i := range criticalityDiagnosticsIEList { + if !(criticalityDiagnosticsIEList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (dAPSRequestInfo DAPSRequestInfo) Equal(y DAPSRequestInfo) bool { + return dAPSRequestInfo == y +} + +func (dRBsToQosFlowsMappingItem DRBsToQosFlowsMappingItem) Equal(y DRBsToQosFlowsMappingItem) bool { + return dRBsToQosFlowsMappingItem.DRBID == y.DRBID && + dRBsToQosFlowsMappingItem.AssociatedQosFlowList.Equal(y.AssociatedQosFlowList) && + (dRBsToQosFlowsMappingItem.DAPSRequestInfo == nil) == (y.DAPSRequestInfo == nil) && (dRBsToQosFlowsMappingItem.DAPSRequestInfo == nil || (*dRBsToQosFlowsMappingItem.DAPSRequestInfo).Equal(*y.DAPSRequestInfo)) && + dRBsToQosFlowsMappingItem.iEExtensions == y.iEExtensions && + dRBsToQosFlowsMappingItem.extensions == y.extensions +} + +func (dRBsToQosFlowsMappingList DRBsToQosFlowsMappingList) Equal(y DRBsToQosFlowsMappingList) bool { + if len(dRBsToQosFlowsMappingList) != len(y) { + return false + } + for i := range dRBsToQosFlowsMappingList { + if !(dRBsToQosFlowsMappingList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (dataForwardingResponseDRBItem DataForwardingResponseDRBItem) Equal(y DataForwardingResponseDRBItem) bool { + return dataForwardingResponseDRBItem.DRBID == y.DRBID && + (dataForwardingResponseDRBItem.DLForwardingUPTNLInformation == nil) == (y.DLForwardingUPTNLInformation == nil) && (dataForwardingResponseDRBItem.DLForwardingUPTNLInformation == nil || (*dataForwardingResponseDRBItem.DLForwardingUPTNLInformation).Equal(*y.DLForwardingUPTNLInformation)) && + (dataForwardingResponseDRBItem.ULForwardingUPTNLInformation == nil) == (y.ULForwardingUPTNLInformation == nil) && (dataForwardingResponseDRBItem.ULForwardingUPTNLInformation == nil || (*dataForwardingResponseDRBItem.ULForwardingUPTNLInformation).Equal(*y.ULForwardingUPTNLInformation)) && + dataForwardingResponseDRBItem.iEExtensions == y.iEExtensions && + dataForwardingResponseDRBItem.extensions == y.extensions +} + +func (dataForwardingResponseDRBList DataForwardingResponseDRBList) Equal(y DataForwardingResponseDRBList) bool { + if len(dataForwardingResponseDRBList) != len(y) { + return false + } + for i := range dataForwardingResponseDRBList { + if !(dataForwardingResponseDRBList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (dataForwardingResponseERABList DataForwardingResponseERABList) Equal(y DataForwardingResponseERABList) bool { + if len(dataForwardingResponseERABList) != len(y) { + return false + } + for i := range dataForwardingResponseERABList { + if !(dataForwardingResponseERABList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (dataForwardingResponseERABListItem DataForwardingResponseERABListItem) Equal(y DataForwardingResponseERABListItem) bool { + return dataForwardingResponseERABListItem.ERABID == y.ERABID && + dataForwardingResponseERABListItem.DLForwardingUPTNLInformation.Equal(y.DLForwardingUPTNLInformation) && + dataForwardingResponseERABListItem.iEExtensions == y.iEExtensions && + dataForwardingResponseERABListItem.extensions == y.extensions +} + +func (downlinkNASTransport DownlinkNASTransport) Equal(y DownlinkNASTransport) bool { + return downlinkNASTransport.AMFUENGAPID == y.AMFUENGAPID && + downlinkNASTransport.RANUENGAPID == y.RANUENGAPID && + downlinkNASTransport.NASPDU.Equal(y.NASPDU) && + (downlinkNASTransport.OldAMF == nil) == (y.OldAMF == nil) && (downlinkNASTransport.OldAMF == nil || (*downlinkNASTransport.OldAMF) == *y.OldAMF) && + (downlinkNASTransport.RANPagingPriority == nil) == (y.RANPagingPriority == nil) && (downlinkNASTransport.RANPagingPriority == nil || (*downlinkNASTransport.RANPagingPriority) == *y.RANPagingPriority) && + (downlinkNASTransport.MobilityRestrictionList == nil) == (y.MobilityRestrictionList == nil) && (downlinkNASTransport.MobilityRestrictionList == nil || (*downlinkNASTransport.MobilityRestrictionList).Equal(*y.MobilityRestrictionList)) && + (downlinkNASTransport.IndexToRFSP == nil) == (y.IndexToRFSP == nil) && (downlinkNASTransport.IndexToRFSP == nil || (*downlinkNASTransport.IndexToRFSP) == *y.IndexToRFSP) && + (downlinkNASTransport.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (downlinkNASTransport.UEAggregateMaximumBitRate == nil || (*downlinkNASTransport.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + downlinkNASTransport.AllowedNSSAI.Equal(y.AllowedNSSAI) && + (downlinkNASTransport.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (downlinkNASTransport.SRVCCOperationPossible == nil || (*downlinkNASTransport.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (downlinkNASTransport.EnhancedCoverageRestriction == nil) == (y.EnhancedCoverageRestriction == nil) && (downlinkNASTransport.EnhancedCoverageRestriction == nil || (*downlinkNASTransport.EnhancedCoverageRestriction) == *y.EnhancedCoverageRestriction) && + (downlinkNASTransport.ExtendedConnectedTime == nil) == (y.ExtendedConnectedTime == nil) && (downlinkNASTransport.ExtendedConnectedTime == nil || (*downlinkNASTransport.ExtendedConnectedTime) == *y.ExtendedConnectedTime) && + (downlinkNASTransport.UEDifferentiationInfo == nil) == (y.UEDifferentiationInfo == nil) && (downlinkNASTransport.UEDifferentiationInfo == nil || (*downlinkNASTransport.UEDifferentiationInfo).Equal(*y.UEDifferentiationInfo)) && + (downlinkNASTransport.CEmodeBrestricted == nil) == (y.CEmodeBrestricted == nil) && (downlinkNASTransport.CEmodeBrestricted == nil || (*downlinkNASTransport.CEmodeBrestricted) == *y.CEmodeBrestricted) && + downlinkNASTransport.UERadioCapability.Equal(y.UERadioCapability) && + (downlinkNASTransport.UECapabilityInfoRequest == nil) == (y.UECapabilityInfoRequest == nil) && (downlinkNASTransport.UECapabilityInfoRequest == nil || (*downlinkNASTransport.UECapabilityInfoRequest) == *y.UECapabilityInfoRequest) && + (downlinkNASTransport.EndIndication == nil) == (y.EndIndication == nil) && (downlinkNASTransport.EndIndication == nil || (*downlinkNASTransport.EndIndication) == *y.EndIndication) && + (downlinkNASTransport.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (downlinkNASTransport.UERadioCapabilityID == nil || (*downlinkNASTransport.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && + (downlinkNASTransport.TargetNSSAIInformation == nil) == (y.TargetNSSAIInformation == nil) && (downlinkNASTransport.TargetNSSAIInformation == nil || (*downlinkNASTransport.TargetNSSAIInformation).Equal(*y.TargetNSSAIInformation)) && + (downlinkNASTransport.MaskedIMEISV == nil) == (y.MaskedIMEISV == nil) && (downlinkNASTransport.MaskedIMEISV == nil || (*downlinkNASTransport.MaskedIMEISV) == *y.MaskedIMEISV) && + downlinkNASTransport.PartiallyAllowedNSSAI.Equal(y.PartiallyAllowedNSSAI) && + (downlinkNASTransport.MobileIABAuthorized == nil) == (y.MobileIABAuthorized == nil) && (downlinkNASTransport.MobileIABAuthorized == nil || (*downlinkNASTransport.MobileIABAuthorized) == *y.MobileIABAuthorized) && + (downlinkNASTransport.ExtendedOldAMF == nil) == (y.ExtendedOldAMF == nil) && (downlinkNASTransport.ExtendedOldAMF == nil || (*downlinkNASTransport.ExtendedOldAMF).Equal(*y.ExtendedOldAMF)) && + downlinkNASTransport.messageMeta.Equal(y.messageMeta) +} + +func (downlinkNonUEAssociatedNRPPaTransport DownlinkNonUEAssociatedNRPPaTransport) Equal(y DownlinkNonUEAssociatedNRPPaTransport) bool { + return downlinkNonUEAssociatedNRPPaTransport.RoutingID.Equal(y.RoutingID) && + downlinkNonUEAssociatedNRPPaTransport.NRPPaPDU.Equal(y.NRPPaPDU) && + downlinkNonUEAssociatedNRPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (downlinkRANConfigurationTransfer DownlinkRANConfigurationTransfer) Equal(y DownlinkRANConfigurationTransfer) bool { + return downlinkRANConfigurationTransfer.SONConfigurationTransfer.Equal(y.SONConfigurationTransfer) && + (downlinkRANConfigurationTransfer.ENDCSONConfigurationTransferDL == nil) == (y.ENDCSONConfigurationTransferDL == nil) && (downlinkRANConfigurationTransfer.ENDCSONConfigurationTransferDL == nil || (*downlinkRANConfigurationTransfer.ENDCSONConfigurationTransferDL).Equal(*y.ENDCSONConfigurationTransferDL)) && + (downlinkRANConfigurationTransfer.IntersystemSONConfigurationTransferDL == nil) == (y.IntersystemSONConfigurationTransferDL == nil) && (downlinkRANConfigurationTransfer.IntersystemSONConfigurationTransferDL == nil || (*downlinkRANConfigurationTransfer.IntersystemSONConfigurationTransferDL).Equal(*y.IntersystemSONConfigurationTransferDL)) && + downlinkRANConfigurationTransfer.messageMeta.Equal(y.messageMeta) +} + +func (downlinkRANStatusTransfer DownlinkRANStatusTransfer) Equal(y DownlinkRANStatusTransfer) bool { + return downlinkRANStatusTransfer.AMFUENGAPID == y.AMFUENGAPID && + downlinkRANStatusTransfer.RANUENGAPID == y.RANUENGAPID && + downlinkRANStatusTransfer.Container.Equal(y.Container) && + downlinkRANStatusTransfer.messageMeta.Equal(y.messageMeta) +} + +func (downlinkUEAssociatedNRPPaTransport DownlinkUEAssociatedNRPPaTransport) Equal(y DownlinkUEAssociatedNRPPaTransport) bool { + return downlinkUEAssociatedNRPPaTransport.AMFUENGAPID == y.AMFUENGAPID && + downlinkUEAssociatedNRPPaTransport.RANUENGAPID == y.RANUENGAPID && + downlinkUEAssociatedNRPPaTransport.RoutingID.Equal(y.RoutingID) && + downlinkUEAssociatedNRPPaTransport.NRPPaPDU.Equal(y.NRPPaPDU) && + downlinkUEAssociatedNRPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (dynamic5QIDescriptor Dynamic5QIDescriptor) Equal(y Dynamic5QIDescriptor) bool { + return dynamic5QIDescriptor.PriorityLevelQos == y.PriorityLevelQos && + dynamic5QIDescriptor.PacketDelayBudget == y.PacketDelayBudget && + dynamic5QIDescriptor.PacketErrorRate.Equal(y.PacketErrorRate) && + (dynamic5QIDescriptor.FiveQI == nil) == (y.FiveQI == nil) && (dynamic5QIDescriptor.FiveQI == nil || (*dynamic5QIDescriptor.FiveQI) == *y.FiveQI) && + (dynamic5QIDescriptor.DelayCritical == nil) == (y.DelayCritical == nil) && (dynamic5QIDescriptor.DelayCritical == nil || (*dynamic5QIDescriptor.DelayCritical) == *y.DelayCritical) && + (dynamic5QIDescriptor.AveragingWindow == nil) == (y.AveragingWindow == nil) && (dynamic5QIDescriptor.AveragingWindow == nil || (*dynamic5QIDescriptor.AveragingWindow) == *y.AveragingWindow) && + (dynamic5QIDescriptor.MaximumDataBurstVolume == nil) == (y.MaximumDataBurstVolume == nil) && (dynamic5QIDescriptor.MaximumDataBurstVolume == nil || (*dynamic5QIDescriptor.MaximumDataBurstVolume) == *y.MaximumDataBurstVolume) && + (dynamic5QIDescriptor.ExtendedPacketDelayBudget == nil) == (y.ExtendedPacketDelayBudget == nil) && (dynamic5QIDescriptor.ExtendedPacketDelayBudget == nil || (*dynamic5QIDescriptor.ExtendedPacketDelayBudget) == *y.ExtendedPacketDelayBudget) && + (dynamic5QIDescriptor.CNPacketDelayBudgetDL == nil) == (y.CNPacketDelayBudgetDL == nil) && (dynamic5QIDescriptor.CNPacketDelayBudgetDL == nil || (*dynamic5QIDescriptor.CNPacketDelayBudgetDL) == *y.CNPacketDelayBudgetDL) && + (dynamic5QIDescriptor.CNPacketDelayBudgetUL == nil) == (y.CNPacketDelayBudgetUL == nil) && (dynamic5QIDescriptor.CNPacketDelayBudgetUL == nil || (*dynamic5QIDescriptor.CNPacketDelayBudgetUL) == *y.CNPacketDelayBudgetUL) && + dynamic5QIDescriptor.iEExtensions == y.iEExtensions && + dynamic5QIDescriptor.extensions == y.extensions +} + +func (eCNMarkingorCongestionInformationReportingRequest ECNMarkingorCongestionInformationReportingRequest) Equal(y ECNMarkingorCongestionInformationReportingRequest) bool { + return (eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest == nil) == (y.ECNMarkingAtRANRequest == nil) && (eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest == nil || (*eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest) == *y.ECNMarkingAtRANRequest) && + (eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest == nil) == (y.ECNMarkingAtUPFRequest == nil) && (eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest == nil || (*eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtUPFRequest) == *y.ECNMarkingAtUPFRequest) && + (eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest == nil) == (y.CongestionInformationRequest == nil) && (eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest == nil || (*eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest) == *y.CongestionInformationRequest) && + (eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension == nil || (*eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension) == *y.ChoiceExtension) +} + +func (eCNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus) Equal(y ECNMarkingorCongestionInformationReportingStatus) bool { + if len(eCNMarkingorCongestionInformationReportingStatus) != len(y) { + return false + } + for i := range eCNMarkingorCongestionInformationReportingStatus { + if !(eCNMarkingorCongestionInformationReportingStatus[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eCNMarkingorCongestionInformationReportingStatusItem ECNMarkingorCongestionInformationReportingStatusItem) Equal(y ECNMarkingorCongestionInformationReportingStatusItem) bool { + return eCNMarkingorCongestionInformationReportingStatusItem == y +} + +func (eNBID ENBID) Equal(y ENBID) bool { + return (eNBID.MacroENBID == nil) == (y.MacroENBID == nil) && (eNBID.MacroENBID == nil || (*eNBID.MacroENBID) == *y.MacroENBID) && + (eNBID.HomeENBID == nil) == (y.HomeENBID == nil) && (eNBID.HomeENBID == nil || (*eNBID.HomeENBID) == *y.HomeENBID) && + (eNBID.ShortmacroENBID == nil) == (y.ShortmacroENBID == nil) && (eNBID.ShortmacroENBID == nil || (*eNBID.ShortmacroENBID) == *y.ShortmacroENBID) && + (eNBID.LongmacroENBID == nil) == (y.LongmacroENBID == nil) && (eNBID.LongmacroENBID == nil || (*eNBID.LongmacroENBID) == *y.LongmacroENBID) && + (eNBID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (eNBID.ChoiceExtension == nil || (*eNBID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (eNDCSONConfigurationTransfer ENDCSONConfigurationTransfer) Equal(y ENDCSONConfigurationTransfer) bool { + if len(eNDCSONConfigurationTransfer) != len(y) { + return false + } + for i := range eNDCSONConfigurationTransfer { + if !(eNDCSONConfigurationTransfer[i] == y[i]) { + return false + } + } + return true +} + +func (ePSTAI EPSTAI) Equal(y EPSTAI) bool { + return ePSTAI == y +} + +func (eRABInformationItem ERABInformationItem) Equal(y ERABInformationItem) bool { + return eRABInformationItem.ERABID == y.ERABID && + (eRABInformationItem.DLForwarding == nil) == (y.DLForwarding == nil) && (eRABInformationItem.DLForwarding == nil || (*eRABInformationItem.DLForwarding) == *y.DLForwarding) && + (eRABInformationItem.SourceTNLAddrInfo == nil) == (y.SourceTNLAddrInfo == nil) && (eRABInformationItem.SourceTNLAddrInfo == nil || (*eRABInformationItem.SourceTNLAddrInfo) == *y.SourceTNLAddrInfo) && + (eRABInformationItem.SourceNodeTNLAddrInfo == nil) == (y.SourceNodeTNLAddrInfo == nil) && (eRABInformationItem.SourceNodeTNLAddrInfo == nil || (*eRABInformationItem.SourceNodeTNLAddrInfo) == *y.SourceNodeTNLAddrInfo) && + eRABInformationItem.iEExtensions == y.iEExtensions && + eRABInformationItem.extensions == y.extensions +} + +func (eRABInformationList ERABInformationList) Equal(y ERABInformationList) bool { + if len(eRABInformationList) != len(y) { + return false + } + for i := range eRABInformationList { + if !(eRABInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eUTRACGI EUTRACGI) Equal(y EUTRACGI) bool { + return eUTRACGI == y +} + +func (eUTRACGIList EUTRACGIList) Equal(y EUTRACGIList) bool { + if len(eUTRACGIList) != len(y) { + return false + } + for i := range eUTRACGIList { + if !(eUTRACGIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eUTRACGIListForWarning EUTRACGIListForWarning) Equal(y EUTRACGIListForWarning) bool { + if len(eUTRACGIListForWarning) != len(y) { + return false + } + for i := range eUTRACGIListForWarning { + if !(eUTRACGIListForWarning[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eUTRANCellReportItem EUTRANCellReportItem) Equal(y EUTRANCellReportItem) bool { + return eUTRANCellReportItem.ECGI.Equal(y.ECGI) && + eUTRANCellReportItem.EUTRANCompositeAvailableCapacityGroup.Equal(y.EUTRANCompositeAvailableCapacityGroup) && + (eUTRANCellReportItem.EUTRANNumberOfActiveUEs == nil) == (y.EUTRANNumberOfActiveUEs == nil) && (eUTRANCellReportItem.EUTRANNumberOfActiveUEs == nil || (*eUTRANCellReportItem.EUTRANNumberOfActiveUEs) == *y.EUTRANNumberOfActiveUEs) && + (eUTRANCellReportItem.EUTRANNoofRRCConnections == nil) == (y.EUTRANNoofRRCConnections == nil) && (eUTRANCellReportItem.EUTRANNoofRRCConnections == nil || (*eUTRANCellReportItem.EUTRANNoofRRCConnections) == *y.EUTRANNoofRRCConnections) && + (eUTRANCellReportItem.EUTRANRadioResourceStatus == nil) == (y.EUTRANRadioResourceStatus == nil) && (eUTRANCellReportItem.EUTRANRadioResourceStatus == nil || (*eUTRANCellReportItem.EUTRANRadioResourceStatus).Equal(*y.EUTRANRadioResourceStatus)) && + eUTRANCellReportItem.iEExtensions == y.iEExtensions && + eUTRANCellReportItem.extensions == y.extensions +} + +func (eUTRANCellReportList EUTRANCellReportList) Equal(y EUTRANCellReportList) bool { + if len(eUTRANCellReportList) != len(y) { + return false + } + for i := range eUTRANCellReportList { + if !(eUTRANCellReportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eUTRANCellToReportItem EUTRANCellToReportItem) Equal(y EUTRANCellToReportItem) bool { + return eUTRANCellToReportItem == y +} + +func (eUTRANCellToReportList EUTRANCellToReportList) Equal(y EUTRANCellToReportList) bool { + if len(eUTRANCellToReportList) != len(y) { + return false + } + for i := range eUTRANCellToReportList { + if !(eUTRANCellToReportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eUTRANCompositeAvailableCapacityGroup EUTRANCompositeAvailableCapacityGroup) Equal(y EUTRANCompositeAvailableCapacityGroup) bool { + return eUTRANCompositeAvailableCapacityGroup.DLCompositeAvailableCapacity.Equal(y.DLCompositeAvailableCapacity) && + eUTRANCompositeAvailableCapacityGroup.ULCompositeAvailableCapacity.Equal(y.ULCompositeAvailableCapacity) && + eUTRANCompositeAvailableCapacityGroup.iEExtensions == y.iEExtensions && + eUTRANCompositeAvailableCapacityGroup.extensions == y.extensions +} + +func (eUTRANRadioResourceStatus EUTRANRadioResourceStatus) Equal(y EUTRANRadioResourceStatus) bool { + return eUTRANRadioResourceStatus.DLGBRPRBusage == y.DLGBRPRBusage && + eUTRANRadioResourceStatus.ULGBRPRBusage == y.ULGBRPRBusage && + eUTRANRadioResourceStatus.DLnonGBRPRBusage == y.DLnonGBRPRBusage && + eUTRANRadioResourceStatus.ULnonGBRPRBusage == y.ULnonGBRPRBusage && + eUTRANRadioResourceStatus.DLTotalPRBusage == y.DLTotalPRBusage && + eUTRANRadioResourceStatus.ULTotalPRBusage == y.ULTotalPRBusage && + (eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage == nil) == (y.DLschedulingPDCCHCCEusage == nil) && (eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage == nil || (*eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage) == *y.DLschedulingPDCCHCCEusage) && + (eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage == nil) == (y.ULschedulingPDCCHCCEusage == nil) && (eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage == nil || (*eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage) == *y.ULschedulingPDCCHCCEusage) && + eUTRANRadioResourceStatus.iEExtensions == y.iEExtensions && + eUTRANRadioResourceStatus.extensions == y.extensions +} + +func (eUTRANReportingStatusIEs EUTRANReportingStatusIEs) Equal(y EUTRANReportingStatusIEs) bool { + return eUTRANReportingStatusIEs.EUTRANCellReportList.Equal(y.EUTRANCellReportList) && + eUTRANReportingStatusIEs.iEExtensions == y.iEExtensions && + eUTRANReportingStatusIEs.extensions == y.extensions +} + +func (eUTRANReportingSystemIEs EUTRANReportingSystemIEs) Equal(y EUTRANReportingSystemIEs) bool { + return eUTRANReportingSystemIEs.EUTRANCellToReportList.Equal(y.EUTRANCellToReportList) && + eUTRANReportingSystemIEs.iEExtensions == y.iEExtensions && + eUTRANReportingSystemIEs.extensions == y.extensions +} + +func (eUTRAPagingeDRXInformation EUTRAPagingeDRXInformation) Equal(y EUTRAPagingeDRXInformation) bool { + return eUTRAPagingeDRXInformation.EUTRApagingeDRXCycle == y.EUTRApagingeDRXCycle && + (eUTRAPagingeDRXInformation.EUTRApagingTimeWindow == nil) == (y.EUTRApagingTimeWindow == nil) && (eUTRAPagingeDRXInformation.EUTRApagingTimeWindow == nil || (*eUTRAPagingeDRXInformation.EUTRApagingTimeWindow) == *y.EUTRApagingTimeWindow) && + eUTRAPagingeDRXInformation.iEExtensions == y.iEExtensions && + eUTRAPagingeDRXInformation.extensions == y.extensions +} + +func (emergencyAreaIDBroadcastEUTRA EmergencyAreaIDBroadcastEUTRA) Equal(y EmergencyAreaIDBroadcastEUTRA) bool { + if len(emergencyAreaIDBroadcastEUTRA) != len(y) { + return false + } + for i := range emergencyAreaIDBroadcastEUTRA { + if !(emergencyAreaIDBroadcastEUTRA[i].Equal(y[i])) { + return false + } + } + return true +} + +func (emergencyAreaIDBroadcastEUTRAItem EmergencyAreaIDBroadcastEUTRAItem) Equal(y EmergencyAreaIDBroadcastEUTRAItem) bool { + return emergencyAreaIDBroadcastEUTRAItem.extensions == y.extensions && + emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID == y.EmergencyAreaID && + slices.Equal(emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI, y.CompletedCellsInEAI) && + emergencyAreaIDBroadcastEUTRAItem.iEExtensions == y.iEExtensions +} + +func (emergencyAreaIDBroadcastNR EmergencyAreaIDBroadcastNR) Equal(y EmergencyAreaIDBroadcastNR) bool { + if len(emergencyAreaIDBroadcastNR) != len(y) { + return false + } + for i := range emergencyAreaIDBroadcastNR { + if !(emergencyAreaIDBroadcastNR[i].Equal(y[i])) { + return false + } + } + return true +} + +func (emergencyAreaIDBroadcastNRItem EmergencyAreaIDBroadcastNRItem) Equal(y EmergencyAreaIDBroadcastNRItem) bool { + return emergencyAreaIDBroadcastNRItem.extensions == y.extensions && + emergencyAreaIDBroadcastNRItem.EmergencyAreaID == y.EmergencyAreaID && + slices.Equal(emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI, y.CompletedCellsInEAI) && + emergencyAreaIDBroadcastNRItem.iEExtensions == y.iEExtensions +} + +func (emergencyAreaIDCancelledEUTRA EmergencyAreaIDCancelledEUTRA) Equal(y EmergencyAreaIDCancelledEUTRA) bool { + if len(emergencyAreaIDCancelledEUTRA) != len(y) { + return false + } + for i := range emergencyAreaIDCancelledEUTRA { + if !(emergencyAreaIDCancelledEUTRA[i].Equal(y[i])) { + return false + } + } + return true +} + +func (emergencyAreaIDCancelledEUTRAItem EmergencyAreaIDCancelledEUTRAItem) Equal(y EmergencyAreaIDCancelledEUTRAItem) bool { + return emergencyAreaIDCancelledEUTRAItem.extensions == y.extensions && + emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID == y.EmergencyAreaID && + slices.Equal(emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI, y.CancelledCellsInEAI) && + emergencyAreaIDCancelledEUTRAItem.iEExtensions == y.iEExtensions +} + +func (emergencyAreaIDCancelledNR EmergencyAreaIDCancelledNR) Equal(y EmergencyAreaIDCancelledNR) bool { + if len(emergencyAreaIDCancelledNR) != len(y) { + return false + } + for i := range emergencyAreaIDCancelledNR { + if !(emergencyAreaIDCancelledNR[i].Equal(y[i])) { + return false + } + } + return true +} + +func (emergencyAreaIDCancelledNRItem EmergencyAreaIDCancelledNRItem) Equal(y EmergencyAreaIDCancelledNRItem) bool { + return emergencyAreaIDCancelledNRItem.extensions == y.extensions && + emergencyAreaIDCancelledNRItem.EmergencyAreaID == y.EmergencyAreaID && + slices.Equal(emergencyAreaIDCancelledNRItem.CancelledCellsInEAI, y.CancelledCellsInEAI) && + emergencyAreaIDCancelledNRItem.iEExtensions == y.iEExtensions +} + +func (emergencyAreaIDList EmergencyAreaIDList) Equal(y EmergencyAreaIDList) bool { + if len(emergencyAreaIDList) != len(y) { + return false + } + for i := range emergencyAreaIDList { + if !(emergencyAreaIDList[i] == y[i]) { + return false + } + } + return true +} + +func (emergencyAreaIDListForRestart EmergencyAreaIDListForRestart) Equal(y EmergencyAreaIDListForRestart) bool { + if len(emergencyAreaIDListForRestart) != len(y) { + return false + } + for i := range emergencyAreaIDListForRestart { + if !(emergencyAreaIDListForRestart[i] == y[i]) { + return false + } + } + return true +} + +func (emergencyFallbackIndicator EmergencyFallbackIndicator) Equal(y EmergencyFallbackIndicator) bool { + return emergencyFallbackIndicator.EmergencyFallbackRequestIndicator == y.EmergencyFallbackRequestIndicator && + (emergencyFallbackIndicator.EmergencyServiceTargetCN == nil) == (y.EmergencyServiceTargetCN == nil) && (emergencyFallbackIndicator.EmergencyServiceTargetCN == nil || (*emergencyFallbackIndicator.EmergencyServiceTargetCN) == *y.EmergencyServiceTargetCN) && + emergencyFallbackIndicator.iEExtensions == y.iEExtensions && + emergencyFallbackIndicator.extensions == y.extensions +} + +func (endpointIPAddressAndPort EndpointIPAddressAndPort) Equal(y EndpointIPAddressAndPort) bool { + return endpointIPAddressAndPort == y +} + +func (equivalentPLMNs EquivalentPLMNs) Equal(y EquivalentPLMNs) bool { + if len(equivalentPLMNs) != len(y) { + return false + } + for i := range equivalentPLMNs { + if !(equivalentPLMNs[i] == y[i]) { + return false + } + } + return true +} + +func (equivalentSNPNsItem EquivalentSNPNsItem) Equal(y EquivalentSNPNsItem) bool { + return equivalentSNPNsItem == y +} + +func (equivalentSNPNsList EquivalentSNPNsList) Equal(y EquivalentSNPNsList) bool { + if len(equivalentSNPNsList) != len(y) { + return false + } + for i := range equivalentSNPNsList { + if !(equivalentSNPNsList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (errorIndication ErrorIndication) Equal(y ErrorIndication) bool { + return (errorIndication.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (errorIndication.AMFUENGAPID == nil || (*errorIndication.AMFUENGAPID) == *y.AMFUENGAPID) && + (errorIndication.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (errorIndication.RANUENGAPID == nil || (*errorIndication.RANUENGAPID) == *y.RANUENGAPID) && + (errorIndication.Cause == nil) == (y.Cause == nil) && (errorIndication.Cause == nil || (*errorIndication.Cause).Equal(*y.Cause)) && + (errorIndication.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (errorIndication.CriticalityDiagnostics == nil || (*errorIndication.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (errorIndication.FiveGSTMSI == nil) == (y.FiveGSTMSI == nil) && (errorIndication.FiveGSTMSI == nil || (*errorIndication.FiveGSTMSI).Equal(*y.FiveGSTMSI)) && + errorIndication.messageMeta.Equal(y.messageMeta) +} + +func (eventBasedReportingIEs EventBasedReportingIEs) Equal(y EventBasedReportingIEs) bool { + return eventBasedReportingIEs == y +} + +func (eventL1LoggedMDTConfig EventL1LoggedMDTConfig) Equal(y EventL1LoggedMDTConfig) bool { + return eventL1LoggedMDTConfig.L1Threshold.Equal(y.L1Threshold) && + eventL1LoggedMDTConfig.Hysteresis == y.Hysteresis && + eventL1LoggedMDTConfig.TimeToTrigger == y.TimeToTrigger && + eventL1LoggedMDTConfig.iEExtensions == y.iEExtensions && + eventL1LoggedMDTConfig.extensions == y.extensions +} + +func (eventTrigger EventTrigger) Equal(y EventTrigger) bool { + return (eventTrigger.OutOfCoverage == nil) == (y.OutOfCoverage == nil) && (eventTrigger.OutOfCoverage == nil || (*eventTrigger.OutOfCoverage) == *y.OutOfCoverage) && + (eventTrigger.EventL1LoggedMDTConfig == nil) == (y.EventL1LoggedMDTConfig == nil) && (eventTrigger.EventL1LoggedMDTConfig == nil || (*eventTrigger.EventL1LoggedMDTConfig).Equal(*y.EventL1LoggedMDTConfig)) && + (eventTrigger.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (eventTrigger.ChoiceExtension == nil || (*eventTrigger.ChoiceExtension) == *y.ChoiceExtension) +} + +func (excessPacketDelayThresholdConfiguration ExcessPacketDelayThresholdConfiguration) Equal(y ExcessPacketDelayThresholdConfiguration) bool { + if len(excessPacketDelayThresholdConfiguration) != len(y) { + return false + } + for i := range excessPacketDelayThresholdConfiguration { + if !(excessPacketDelayThresholdConfiguration[i].Equal(y[i])) { + return false + } + } + return true +} + +func (excessPacketDelayThresholdItem ExcessPacketDelayThresholdItem) Equal(y ExcessPacketDelayThresholdItem) bool { + return excessPacketDelayThresholdItem == y +} + +func (expectedUEActivityBehaviour ExpectedUEActivityBehaviour) Equal(y ExpectedUEActivityBehaviour) bool { + return (expectedUEActivityBehaviour.ExpectedActivityPeriod == nil) == (y.ExpectedActivityPeriod == nil) && (expectedUEActivityBehaviour.ExpectedActivityPeriod == nil || (*expectedUEActivityBehaviour.ExpectedActivityPeriod) == *y.ExpectedActivityPeriod) && + (expectedUEActivityBehaviour.ExpectedIdlePeriod == nil) == (y.ExpectedIdlePeriod == nil) && (expectedUEActivityBehaviour.ExpectedIdlePeriod == nil || (*expectedUEActivityBehaviour.ExpectedIdlePeriod) == *y.ExpectedIdlePeriod) && + (expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation == nil) == (y.SourceOfUEActivityBehaviourInformation == nil) && (expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation == nil || (*expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation) == *y.SourceOfUEActivityBehaviourInformation) && + expectedUEActivityBehaviour.iEExtensions == y.iEExtensions && + expectedUEActivityBehaviour.extensions == y.extensions +} + +func (expectedUEBehaviour ExpectedUEBehaviour) Equal(y ExpectedUEBehaviour) bool { + return (expectedUEBehaviour.ExpectedUEActivityBehaviour == nil) == (y.ExpectedUEActivityBehaviour == nil) && (expectedUEBehaviour.ExpectedUEActivityBehaviour == nil || (*expectedUEBehaviour.ExpectedUEActivityBehaviour).Equal(*y.ExpectedUEActivityBehaviour)) && + (expectedUEBehaviour.ExpectedHOInterval == nil) == (y.ExpectedHOInterval == nil) && (expectedUEBehaviour.ExpectedHOInterval == nil || (*expectedUEBehaviour.ExpectedHOInterval) == *y.ExpectedHOInterval) && + (expectedUEBehaviour.ExpectedUEMobility == nil) == (y.ExpectedUEMobility == nil) && (expectedUEBehaviour.ExpectedUEMobility == nil || (*expectedUEBehaviour.ExpectedUEMobility) == *y.ExpectedUEMobility) && + (expectedUEBehaviour.ExpectedUEMovingTrajectory == nil) == (y.ExpectedUEMovingTrajectory == nil) && expectedUEBehaviour.ExpectedUEMovingTrajectory.Equal(y.ExpectedUEMovingTrajectory) && + expectedUEBehaviour.iEExtensions == y.iEExtensions && + expectedUEBehaviour.extensions == y.extensions +} + +func (expectedUEMovingTrajectory ExpectedUEMovingTrajectory) Equal(y ExpectedUEMovingTrajectory) bool { + if len(expectedUEMovingTrajectory) != len(y) { + return false + } + for i := range expectedUEMovingTrajectory { + if !(expectedUEMovingTrajectory[i].Equal(y[i])) { + return false + } + } + return true +} + +func (expectedUEMovingTrajectoryItem ExpectedUEMovingTrajectoryItem) Equal(y ExpectedUEMovingTrajectoryItem) bool { + return expectedUEMovingTrajectoryItem.NGRANCGI.Equal(y.NGRANCGI) && + (expectedUEMovingTrajectoryItem.TimeStayedInCell == nil) == (y.TimeStayedInCell == nil) && (expectedUEMovingTrajectoryItem.TimeStayedInCell == nil || (*expectedUEMovingTrajectoryItem.TimeStayedInCell) == *y.TimeStayedInCell) && + expectedUEMovingTrajectoryItem.iEExtensions == y.iEExtensions && + expectedUEMovingTrajectoryItem.extensions == y.extensions +} + +func (extendedAMFName ExtendedAMFName) Equal(y ExtendedAMFName) bool { + return (extendedAMFName.AMFNameVisibleString == nil) == (y.AMFNameVisibleString == nil) && (extendedAMFName.AMFNameVisibleString == nil || (*extendedAMFName.AMFNameVisibleString) == *y.AMFNameVisibleString) && + (extendedAMFName.AMFNameUTF8String == nil) == (y.AMFNameUTF8String == nil) && (extendedAMFName.AMFNameUTF8String == nil || (*extendedAMFName.AMFNameUTF8String) == *y.AMFNameUTF8String) && + extendedAMFName.iEExtensions == y.iEExtensions && + extendedAMFName.extensions == y.extensions +} + +func (extendedRANNodeName ExtendedRANNodeName) Equal(y ExtendedRANNodeName) bool { + return (extendedRANNodeName.RANNodeNameVisibleString == nil) == (y.RANNodeNameVisibleString == nil) && (extendedRANNodeName.RANNodeNameVisibleString == nil || (*extendedRANNodeName.RANNodeNameVisibleString) == *y.RANNodeNameVisibleString) && + (extendedRANNodeName.RANNodeNameUTF8String == nil) == (y.RANNodeNameUTF8String == nil) && (extendedRANNodeName.RANNodeNameUTF8String == nil || (*extendedRANNodeName.RANNodeNameUTF8String) == *y.RANNodeNameUTF8String) && + extendedRANNodeName.iEExtensions == y.iEExtensions && + extendedRANNodeName.extensions == y.extensions +} + +func (extendedRATRestrictionInformation ExtendedRATRestrictionInformation) Equal(y ExtendedRATRestrictionInformation) bool { + return extendedRATRestrictionInformation == y +} + +func (extendedRATRestrictionInformationPrimaryRATRestriction ExtendedRATRestrictionInformationPrimaryRATRestriction) Equal(y ExtendedRATRestrictionInformationPrimaryRATRestriction) bool { + return extendedRATRestrictionInformationPrimaryRATRestriction == y +} + +func (extendedRATRestrictionInformationSecondaryRATRestriction ExtendedRATRestrictionInformationSecondaryRATRestriction) Equal(y ExtendedRATRestrictionInformationSecondaryRATRestriction) bool { + return extendedRATRestrictionInformationSecondaryRATRestriction == y +} + +func (extendedSliceSupportList ExtendedSliceSupportList) Equal(y ExtendedSliceSupportList) bool { + if len(extendedSliceSupportList) != len(y) { + return false + } + for i := range extendedSliceSupportList { + if !(extendedSliceSupportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (fiveGProSeAuthorized FiveGProSeAuthorized) Equal(y FiveGProSeAuthorized) bool { + return (fiveGProSeAuthorized.FiveGProSeDirectDiscovery == nil) == (y.FiveGProSeDirectDiscovery == nil) && (fiveGProSeAuthorized.FiveGProSeDirectDiscovery == nil || (*fiveGProSeAuthorized.FiveGProSeDirectDiscovery) == *y.FiveGProSeDirectDiscovery) && + (fiveGProSeAuthorized.FiveGProSeDirectCommunication == nil) == (y.FiveGProSeDirectCommunication == nil) && (fiveGProSeAuthorized.FiveGProSeDirectCommunication == nil || (*fiveGProSeAuthorized.FiveGProSeDirectCommunication) == *y.FiveGProSeDirectCommunication) && + (fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay == nil) == (y.FiveGProSeLayer2UEtoNetworkRelay == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2UEtoNetworkRelay) == *y.FiveGProSeLayer2UEtoNetworkRelay) && + (fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay == nil) == (y.FiveGProSeLayer3UEtoNetworkRelay == nil) && (fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay == nil || (*fiveGProSeAuthorized.FiveGProSeLayer3UEtoNetworkRelay) == *y.FiveGProSeLayer3UEtoNetworkRelay) && + (fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE == nil) == (y.FiveGProSeLayer2RemoteUE == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE) == *y.FiveGProSeLayer2RemoteUE) && + (fiveGProSeAuthorized.FiveGProSeLayer2Multipath == nil) == (y.FiveGProSeLayer2Multipath == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2Multipath == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2Multipath) == *y.FiveGProSeLayer2Multipath) && + (fiveGProSeAuthorized.FiveGProSeLayer2UEtoUERelay == nil) == (y.FiveGProSeLayer2UEtoUERelay == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2UEtoUERelay == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2UEtoUERelay) == *y.FiveGProSeLayer2UEtoUERelay) && + (fiveGProSeAuthorized.FiveGProSeLayer2UEtoUERemote == nil) == (y.FiveGProSeLayer2UEtoUERemote == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2UEtoUERemote == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2UEtoUERemote) == *y.FiveGProSeLayer2UEtoUERemote) && + (fiveGProSeAuthorized.FiveGProSeLayer2MHUEtoNetworkRelay == nil) == (y.FiveGProSeLayer2MHUEtoNetworkRelay == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2MHUEtoNetworkRelay == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2MHUEtoNetworkRelay) == *y.FiveGProSeLayer2MHUEtoNetworkRelay) && + (fiveGProSeAuthorized.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay == nil) == (y.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) == *y.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) && + (fiveGProSeAuthorized.FiveGProSeLayer2MHRemote == nil) == (y.FiveGProSeLayer2MHRemote == nil) && (fiveGProSeAuthorized.FiveGProSeLayer2MHRemote == nil || (*fiveGProSeAuthorized.FiveGProSeLayer2MHRemote) == *y.FiveGProSeLayer2MHRemote) && + (fiveGProSeAuthorized.FiveGProSeLayer3MHUEtoNetworkRelay == nil) == (y.FiveGProSeLayer3MHUEtoNetworkRelay == nil) && (fiveGProSeAuthorized.FiveGProSeLayer3MHUEtoNetworkRelay == nil || (*fiveGProSeAuthorized.FiveGProSeLayer3MHUEtoNetworkRelay) == *y.FiveGProSeLayer3MHUEtoNetworkRelay) && + fiveGProSeAuthorized.iEExtensions == y.iEExtensions && + fiveGProSeAuthorized.extensions == y.extensions +} + +func (fiveGProSePC5FlowBitRates FiveGProSePC5FlowBitRates) Equal(y FiveGProSePC5FlowBitRates) bool { + return fiveGProSePC5FlowBitRates == y +} + +func (fiveGProSePC5QoSFlowItem FiveGProSePC5QoSFlowItem) Equal(y FiveGProSePC5QoSFlowItem) bool { + return fiveGProSePC5QoSFlowItem.FiveGproSepQI == y.FiveGproSepQI && + (fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates == nil) == (y.FiveGproSepc5FlowBitRates == nil) && (fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates == nil || (*fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates).Equal(*y.FiveGproSepc5FlowBitRates)) && + (fiveGProSePC5QoSFlowItem.FiveGproSerange == nil) == (y.FiveGproSerange == nil) && (fiveGProSePC5QoSFlowItem.FiveGproSerange == nil || (*fiveGProSePC5QoSFlowItem.FiveGproSerange) == *y.FiveGproSerange) && + fiveGProSePC5QoSFlowItem.iEExtensions == y.iEExtensions && + fiveGProSePC5QoSFlowItem.extensions == y.extensions +} + +func (fiveGProSePC5QoSFlowList FiveGProSePC5QoSFlowList) Equal(y FiveGProSePC5QoSFlowList) bool { + if len(fiveGProSePC5QoSFlowList) != len(y) { + return false + } + for i := range fiveGProSePC5QoSFlowList { + if !(fiveGProSePC5QoSFlowList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (fiveGProSePC5QoSParameters FiveGProSePC5QoSParameters) Equal(y FiveGProSePC5QoSParameters) bool { + return fiveGProSePC5QoSParameters.FiveGProSepc5QoSFlowList.Equal(y.FiveGProSepc5QoSFlowList) && + (fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates == nil) == (y.FiveGProSepc5LinkAggregateBitRates == nil) && (fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates == nil || (*fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates) == *y.FiveGProSepc5LinkAggregateBitRates) && + fiveGProSePC5QoSParameters.iEExtensions == y.iEExtensions && + fiveGProSePC5QoSParameters.extensions == y.extensions +} + +func (fiveGSTMSI FiveGSTMSI) Equal(y FiveGSTMSI) bool { + return fiveGSTMSI == y +} + +func (forbiddenAreaInformation ForbiddenAreaInformation) Equal(y ForbiddenAreaInformation) bool { + if len(forbiddenAreaInformation) != len(y) { + return false + } + for i := range forbiddenAreaInformation { + if !(forbiddenAreaInformation[i].Equal(y[i])) { + return false + } + } + return true +} + +func (forbiddenAreaInformationItem ForbiddenAreaInformationItem) Equal(y ForbiddenAreaInformationItem) bool { + return forbiddenAreaInformationItem.extensions == y.extensions && + forbiddenAreaInformationItem.PLMNIdentity == y.PLMNIdentity && + forbiddenAreaInformationItem.ForbiddenTACs.Equal(y.ForbiddenTACs) && + forbiddenAreaInformationItem.iEExtensions == y.iEExtensions +} + +func (forbiddenTACs ForbiddenTACs) Equal(y ForbiddenTACs) bool { + if len(forbiddenTACs) != len(y) { + return false + } + for i := range forbiddenTACs { + if !(forbiddenTACs[i] == y[i]) { + return false + } + } + return true +} + +func (fromEUTRANtoNGRAN FromEUTRANtoNGRAN) Equal(y FromEUTRANtoNGRAN) bool { + return fromEUTRANtoNGRAN.SourceeNBID.Equal(y.SourceeNBID) && + fromEUTRANtoNGRAN.TargetNGRANnodeID.Equal(y.TargetNGRANnodeID) && + fromEUTRANtoNGRAN.iEExtensions == y.iEExtensions +} + +func (fromNGRANtoEUTRAN FromNGRANtoEUTRAN) Equal(y FromNGRANtoEUTRAN) bool { + return fromNGRANtoEUTRAN.SourceNGRANnodeID.Equal(y.SourceNGRANnodeID) && + fromNGRANtoEUTRAN.TargeteNBID.Equal(y.TargeteNBID) && + fromNGRANtoEUTRAN.iEExtensions == y.iEExtensions +} + +func (gBRQosInformation GBRQosInformation) Equal(y GBRQosInformation) bool { + return gBRQosInformation.MaximumFlowBitRateDL == y.MaximumFlowBitRateDL && + gBRQosInformation.MaximumFlowBitRateUL == y.MaximumFlowBitRateUL && + gBRQosInformation.GuaranteedFlowBitRateDL == y.GuaranteedFlowBitRateDL && + gBRQosInformation.GuaranteedFlowBitRateUL == y.GuaranteedFlowBitRateUL && + (gBRQosInformation.NotificationControl == nil) == (y.NotificationControl == nil) && (gBRQosInformation.NotificationControl == nil || (*gBRQosInformation.NotificationControl) == *y.NotificationControl) && + (gBRQosInformation.MaximumPacketLossRateDL == nil) == (y.MaximumPacketLossRateDL == nil) && (gBRQosInformation.MaximumPacketLossRateDL == nil || (*gBRQosInformation.MaximumPacketLossRateDL) == *y.MaximumPacketLossRateDL) && + (gBRQosInformation.MaximumPacketLossRateUL == nil) == (y.MaximumPacketLossRateUL == nil) && (gBRQosInformation.MaximumPacketLossRateUL == nil || (*gBRQosInformation.MaximumPacketLossRateUL) == *y.MaximumPacketLossRateUL) && + gBRQosInformation.AlternativeQoSParaSetList.Equal(y.AlternativeQoSParaSetList) && + (gBRQosInformation.MonitoringRequestonAvailableBitrate == nil) == (y.MonitoringRequestonAvailableBitrate == nil) && (gBRQosInformation.MonitoringRequestonAvailableBitrate == nil || (*gBRQosInformation.MonitoringRequestonAvailableBitrate).Equal(*y.MonitoringRequestonAvailableBitrate)) && + gBRQosInformation.iEExtensions == y.iEExtensions && + gBRQosInformation.extensions == y.extensions +} + +func (gNBID GNBID) Equal(y GNBID) bool { + return (gNBID.GNBID == nil) == (y.GNBID == nil) && (gNBID.GNBID == nil || (*gNBID.GNBID).Equal(*y.GNBID)) && + (gNBID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (gNBID.ChoiceExtension == nil || (*gNBID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (gNBIDValue GNBIDValue) Equal(y GNBIDValue) bool { + return gNBIDValue == y +} + +func (gTPTunnel GTPTunnel) Equal(y GTPTunnel) bool { + return gTPTunnel == y +} + +func (gUAMI GUAMI) Equal(y GUAMI) bool { + return gUAMI == y +} + +func (gUAMIList GUAMIList) Equal(y GUAMIList) bool { + if len(gUAMIList) != len(y) { + return false + } + for i := range gUAMIList { + if !(gUAMIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (gUAMIListItem GUAMIListItem) Equal(y GUAMIListItem) bool { + return gUAMIListItem == y +} + +func (geographyBasedMDT GeographyBasedMDT) Equal(y GeographyBasedMDT) bool { + return geographyBasedMDT.NTNGeographicalArea.Equal(y.NTNGeographicalArea) && + (geographyBasedMDT.NTNPLMNList == nil) == (y.NTNPLMNList == nil) && geographyBasedMDT.NTNPLMNList.Equal(y.NTNPLMNList) && + geographyBasedMDT.iEExtensions == y.iEExtensions && + geographyBasedMDT.extensions == y.extensions +} + +func (globalCableID GlobalCableID) Equal(y GlobalCableID) bool { + if len(globalCableID) != len(y) { + return false + } + for i := range globalCableID { + if !(globalCableID[i] == y[i]) { + return false + } + } + return true +} + +func (globalCableIDNew GlobalCableIDNew) Equal(y GlobalCableIDNew) bool { + return globalCableIDNew.GlobalCableID.Equal(y.GlobalCableID) && + globalCableIDNew.TAI.Equal(y.TAI) && + globalCableIDNew.iEExtensions == y.iEExtensions && + globalCableIDNew.extensions == y.extensions +} + +func (globalENBID GlobalENBID) Equal(y GlobalENBID) bool { + return globalENBID.PLMNidentity == y.PLMNidentity && + globalENBID.ENBID.Equal(y.ENBID) && + globalENBID.iEExtensions == y.iEExtensions && + globalENBID.extensions == y.extensions +} + +func (globalGNBID GlobalGNBID) Equal(y GlobalGNBID) bool { + return globalGNBID.PLMNIdentity == y.PLMNIdentity && + globalGNBID.GNBID.Equal(y.GNBID) && + globalGNBID.iEExtensions == y.iEExtensions && + globalGNBID.extensions == y.extensions +} + +func (globalLineID GlobalLineID) Equal(y GlobalLineID) bool { + return globalLineID.GlobalLineIdentity.Equal(y.GlobalLineIdentity) && + (globalLineID.LineType == nil) == (y.LineType == nil) && (globalLineID.LineType == nil || (*globalLineID.LineType) == *y.LineType) && + (globalLineID.TAI == nil) == (y.TAI == nil) && (globalLineID.TAI == nil || (*globalLineID.TAI).Equal(*y.TAI)) && + globalLineID.iEExtensions == y.iEExtensions && + globalLineID.extensions == y.extensions +} + +func (globalLineIdentity GlobalLineIdentity) Equal(y GlobalLineIdentity) bool { + if len(globalLineIdentity) != len(y) { + return false + } + for i := range globalLineIdentity { + if !(globalLineIdentity[i] == y[i]) { + return false + } + } + return true +} + +func (globalN3IWFID GlobalN3IWFID) Equal(y GlobalN3IWFID) bool { + return globalN3IWFID.PLMNIdentity == y.PLMNIdentity && + globalN3IWFID.N3IWFID.Equal(y.N3IWFID) && + globalN3IWFID.iEExtensions == y.iEExtensions && + globalN3IWFID.extensions == y.extensions +} + +func (globalNgENBID GlobalNgENBID) Equal(y GlobalNgENBID) bool { + return globalNgENBID.extensions == y.extensions && + globalNgENBID.PLMNIdentity == y.PLMNIdentity && + globalNgENBID.NgENBID.Equal(y.NgENBID) && + globalNgENBID.iEExtensions == y.iEExtensions +} + +func (globalRANNodeID GlobalRANNodeID) Equal(y GlobalRANNodeID) bool { + return (globalRANNodeID.GlobalGNBID == nil) == (y.GlobalGNBID == nil) && (globalRANNodeID.GlobalGNBID == nil || (*globalRANNodeID.GlobalGNBID).Equal(*y.GlobalGNBID)) && + (globalRANNodeID.GlobalNgENBID == nil) == (y.GlobalNgENBID == nil) && (globalRANNodeID.GlobalNgENBID == nil || (*globalRANNodeID.GlobalNgENBID).Equal(*y.GlobalNgENBID)) && + (globalRANNodeID.GlobalN3IWFID == nil) == (y.GlobalN3IWFID == nil) && (globalRANNodeID.GlobalN3IWFID == nil || (*globalRANNodeID.GlobalN3IWFID).Equal(*y.GlobalN3IWFID)) && + (globalRANNodeID.GlobalTNGFID == nil) == (y.GlobalTNGFID == nil) && (globalRANNodeID.GlobalTNGFID == nil || (*globalRANNodeID.GlobalTNGFID).Equal(*y.GlobalTNGFID)) && + (globalRANNodeID.GlobalTWIFID == nil) == (y.GlobalTWIFID == nil) && (globalRANNodeID.GlobalTWIFID == nil || (*globalRANNodeID.GlobalTWIFID).Equal(*y.GlobalTWIFID)) && + (globalRANNodeID.GlobalWAGFID == nil) == (y.GlobalWAGFID == nil) && (globalRANNodeID.GlobalWAGFID == nil || (*globalRANNodeID.GlobalWAGFID).Equal(*y.GlobalWAGFID)) && + (globalRANNodeID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (globalRANNodeID.ChoiceExtension == nil || (*globalRANNodeID.ChoiceExtension) == *y.ChoiceExtension) && + globalRANNodeID.choiceCriticality == y.choiceCriticality +} + +func (globalTNGFID GlobalTNGFID) Equal(y GlobalTNGFID) bool { + return globalTNGFID.PLMNIdentity == y.PLMNIdentity && + globalTNGFID.TNGFID.Equal(y.TNGFID) && + globalTNGFID.iEExtensions == y.iEExtensions && + globalTNGFID.extensions == y.extensions +} + +func (globalTWIFID GlobalTWIFID) Equal(y GlobalTWIFID) bool { + return globalTWIFID.PLMNIdentity == y.PLMNIdentity && + globalTWIFID.TWIFID.Equal(y.TWIFID) && + globalTWIFID.iEExtensions == y.iEExtensions && + globalTWIFID.extensions == y.extensions +} + +func (globalWAGFID GlobalWAGFID) Equal(y GlobalWAGFID) bool { + return globalWAGFID.PLMNIdentity == y.PLMNIdentity && + globalWAGFID.WAGFID.Equal(y.WAGFID) && + globalWAGFID.iEExtensions == y.iEExtensions && + globalWAGFID.extensions == y.extensions +} + +func (hFCNodeID HFCNodeID) Equal(y HFCNodeID) bool { + if len(hFCNodeID) != len(y) { + return false + } + for i := range hFCNodeID { + if !(hFCNodeID[i] == y[i]) { + return false + } + } + return true +} + +func (hFCNodeIDNew HFCNodeIDNew) Equal(y HFCNodeIDNew) bool { + return hFCNodeIDNew.HFCNodeID.Equal(y.HFCNodeID) && + hFCNodeIDNew.TAI.Equal(y.TAI) && + hFCNodeIDNew.GlobalCableID.Equal(y.GlobalCableID) && + hFCNodeIDNew.iEExtensions == y.iEExtensions && + hFCNodeIDNew.extensions == y.extensions +} + +func (handoverCancel HandoverCancel) Equal(y HandoverCancel) bool { + return handoverCancel.AMFUENGAPID == y.AMFUENGAPID && + handoverCancel.RANUENGAPID == y.RANUENGAPID && + (handoverCancel.Cause == nil) == (y.Cause == nil) && (handoverCancel.Cause == nil || (*handoverCancel.Cause).Equal(*y.Cause)) && + handoverCancel.messageMeta.Equal(y.messageMeta) +} + +func (handoverCancelAcknowledge HandoverCancelAcknowledge) Equal(y HandoverCancelAcknowledge) bool { + return (handoverCancelAcknowledge.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (handoverCancelAcknowledge.AMFUENGAPID == nil || (*handoverCancelAcknowledge.AMFUENGAPID) == *y.AMFUENGAPID) && + (handoverCancelAcknowledge.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (handoverCancelAcknowledge.RANUENGAPID == nil || (*handoverCancelAcknowledge.RANUENGAPID) == *y.RANUENGAPID) && + (handoverCancelAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverCancelAcknowledge.CriticalityDiagnostics == nil || (*handoverCancelAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverCancelAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (handoverCommand HandoverCommand) Equal(y HandoverCommand) bool { + return handoverCommand.AMFUENGAPID == y.AMFUENGAPID && + handoverCommand.RANUENGAPID == y.RANUENGAPID && + handoverCommand.HandoverType == y.HandoverType && + handoverCommand.NASSecurityParametersFromNGRAN.Equal(y.NASSecurityParametersFromNGRAN) && + handoverCommand.PDUSessionResourceHandoverList.Equal(y.PDUSessionResourceHandoverList) && + handoverCommand.PDUSessionResourceToReleaseList.Equal(y.PDUSessionResourceToReleaseList) && + handoverCommand.TargetToSourceTransparentContainer.Equal(y.TargetToSourceTransparentContainer) && + (handoverCommand.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverCommand.CriticalityDiagnostics == nil || (*handoverCommand.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverCommand.messageMeta.Equal(y.messageMeta) +} + +func (handoverCommandTransfer HandoverCommandTransfer) Equal(y HandoverCommandTransfer) bool { + return (handoverCommandTransfer.DLForwardingUPTNLInformation == nil) == (y.DLForwardingUPTNLInformation == nil) && (handoverCommandTransfer.DLForwardingUPTNLInformation == nil || (*handoverCommandTransfer.DLForwardingUPTNLInformation).Equal(*y.DLForwardingUPTNLInformation)) && + (handoverCommandTransfer.QosFlowToBeForwarded == nil) == (y.QosFlowToBeForwarded == nil) && handoverCommandTransfer.QosFlowToBeForwarded.Equal(y.QosFlowToBeForwarded) && + (handoverCommandTransfer.DataForwardingResponseDRB == nil) == (y.DataForwardingResponseDRB == nil) && handoverCommandTransfer.DataForwardingResponseDRB.Equal(y.DataForwardingResponseDRB) && + handoverCommandTransfer.AdditionalDLForwardingUPTNLInformation.Equal(y.AdditionalDLForwardingUPTNLInformation) && + (handoverCommandTransfer.ULForwardingUPTNLInformation == nil) == (y.ULForwardingUPTNLInformation == nil) && (handoverCommandTransfer.ULForwardingUPTNLInformation == nil || (*handoverCommandTransfer.ULForwardingUPTNLInformation).Equal(*y.ULForwardingUPTNLInformation)) && + handoverCommandTransfer.AdditionalULForwardingUPTNLInformation.Equal(y.AdditionalULForwardingUPTNLInformation) && + handoverCommandTransfer.DataForwardingResponseERAB.Equal(y.DataForwardingResponseERAB) && + handoverCommandTransfer.QosFlowFailedToSetupList.Equal(y.QosFlowFailedToSetupList) && + handoverCommandTransfer.iEExtensions == y.iEExtensions && + handoverCommandTransfer.extensions == y.extensions +} + +func (handoverFailure HandoverFailure) Equal(y HandoverFailure) bool { + return (handoverFailure.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (handoverFailure.AMFUENGAPID == nil || (*handoverFailure.AMFUENGAPID) == *y.AMFUENGAPID) && + (handoverFailure.Cause == nil) == (y.Cause == nil) && (handoverFailure.Cause == nil || (*handoverFailure.Cause).Equal(*y.Cause)) && + (handoverFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverFailure.CriticalityDiagnostics == nil || (*handoverFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverFailure.TargettoSourceFailureTransparentContainer.Equal(y.TargettoSourceFailureTransparentContainer) && + handoverFailure.messageMeta.Equal(y.messageMeta) +} + +func (handoverNotify HandoverNotify) Equal(y HandoverNotify) bool { + return handoverNotify.AMFUENGAPID == y.AMFUENGAPID && + handoverNotify.RANUENGAPID == y.RANUENGAPID && + (handoverNotify.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (handoverNotify.UserLocationInformation == nil || (*handoverNotify.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (handoverNotify.NotifySourceNGRANNode == nil) == (y.NotifySourceNGRANNode == nil) && (handoverNotify.NotifySourceNGRANNode == nil || (*handoverNotify.NotifySourceNGRANNode) == *y.NotifySourceNGRANNode) && + handoverNotify.messageMeta.Equal(y.messageMeta) +} + +func (handoverPreparationFailure HandoverPreparationFailure) Equal(y HandoverPreparationFailure) bool { + return (handoverPreparationFailure.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (handoverPreparationFailure.AMFUENGAPID == nil || (*handoverPreparationFailure.AMFUENGAPID) == *y.AMFUENGAPID) && + (handoverPreparationFailure.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (handoverPreparationFailure.RANUENGAPID == nil || (*handoverPreparationFailure.RANUENGAPID) == *y.RANUENGAPID) && + (handoverPreparationFailure.Cause == nil) == (y.Cause == nil) && (handoverPreparationFailure.Cause == nil || (*handoverPreparationFailure.Cause).Equal(*y.Cause)) && + (handoverPreparationFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverPreparationFailure.CriticalityDiagnostics == nil || (*handoverPreparationFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverPreparationFailure.TargettoSourceFailureTransparentContainer.Equal(y.TargettoSourceFailureTransparentContainer) && + handoverPreparationFailure.messageMeta.Equal(y.messageMeta) +} + +func (handoverPreparationUnsuccessfulTransfer HandoverPreparationUnsuccessfulTransfer) Equal(y HandoverPreparationUnsuccessfulTransfer) bool { + return handoverPreparationUnsuccessfulTransfer.extensions == y.extensions && + handoverPreparationUnsuccessfulTransfer.Cause.Equal(y.Cause) && + handoverPreparationUnsuccessfulTransfer.iEExtensions == y.iEExtensions +} + +func (handoverRequest HandoverRequest) Equal(y HandoverRequest) bool { + return handoverRequest.AMFUENGAPID == y.AMFUENGAPID && + handoverRequest.HandoverType == y.HandoverType && + (handoverRequest.Cause == nil) == (y.Cause == nil) && (handoverRequest.Cause == nil || (*handoverRequest.Cause).Equal(*y.Cause)) && + handoverRequest.UEAggregateMaximumBitRate.Equal(y.UEAggregateMaximumBitRate) && + handoverRequest.UESecurityCapabilities.Equal(y.UESecurityCapabilities) && + handoverRequest.SecurityContext.Equal(y.SecurityContext) && + (handoverRequest.NewSecurityContextInd == nil) == (y.NewSecurityContextInd == nil) && (handoverRequest.NewSecurityContextInd == nil || (*handoverRequest.NewSecurityContextInd) == *y.NewSecurityContextInd) && + handoverRequest.NASC.Equal(y.NASC) && + handoverRequest.PDUSessionResourceSetupListHOReq.Equal(y.PDUSessionResourceSetupListHOReq) && + handoverRequest.AllowedNSSAI.Equal(y.AllowedNSSAI) && + (handoverRequest.TraceActivation == nil) == (y.TraceActivation == nil) && (handoverRequest.TraceActivation == nil || (*handoverRequest.TraceActivation).Equal(*y.TraceActivation)) && + handoverRequest.SourceToTargetTransparentContainer.Equal(y.SourceToTargetTransparentContainer) && + (handoverRequest.MobilityRestrictionList == nil) == (y.MobilityRestrictionList == nil) && (handoverRequest.MobilityRestrictionList == nil || (*handoverRequest.MobilityRestrictionList).Equal(*y.MobilityRestrictionList)) && + handoverRequest.GUAMI.Equal(y.GUAMI) && + (handoverRequest.AMFUENGAPID2 == nil) == (y.AMFUENGAPID2 == nil) && (handoverRequest.AMFUENGAPID2 == nil || (*handoverRequest.AMFUENGAPID2) == *y.AMFUENGAPID2) && + (handoverRequest.TargetRANNodeID == nil) == (y.TargetRANNodeID == nil) && (handoverRequest.TargetRANNodeID == nil || (*handoverRequest.TargetRANNodeID).Equal(*y.TargetRANNodeID)) && + (handoverRequest.CoreNetworkAssistanceInformationForInactive == nil) == (y.CoreNetworkAssistanceInformationForInactive == nil) && (handoverRequest.CoreNetworkAssistanceInformationForInactive == nil || (*handoverRequest.CoreNetworkAssistanceInformationForInactive).Equal(*y.CoreNetworkAssistanceInformationForInactive)) && + (handoverRequest.MaskedIMEISV == nil) == (y.MaskedIMEISV == nil) && (handoverRequest.MaskedIMEISV == nil || (*handoverRequest.MaskedIMEISV) == *y.MaskedIMEISV) && + (handoverRequest.LocationReportingRequestType == nil) == (y.LocationReportingRequestType == nil) && (handoverRequest.LocationReportingRequestType == nil || (*handoverRequest.LocationReportingRequestType).Equal(*y.LocationReportingRequestType)) && + (handoverRequest.RRCInactiveTransitionReportRequest == nil) == (y.RRCInactiveTransitionReportRequest == nil) && (handoverRequest.RRCInactiveTransitionReportRequest == nil || (*handoverRequest.RRCInactiveTransitionReportRequest) == *y.RRCInactiveTransitionReportRequest) && + (handoverRequest.RedirectionVoiceFallback == nil) == (y.RedirectionVoiceFallback == nil) && (handoverRequest.RedirectionVoiceFallback == nil || (*handoverRequest.RedirectionVoiceFallback) == *y.RedirectionVoiceFallback) && + (handoverRequest.CNAssistedRANTuning == nil) == (y.CNAssistedRANTuning == nil) && (handoverRequest.CNAssistedRANTuning == nil || (*handoverRequest.CNAssistedRANTuning).Equal(*y.CNAssistedRANTuning)) && + (handoverRequest.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (handoverRequest.SRVCCOperationPossible == nil || (*handoverRequest.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (handoverRequest.IABAuthorized == nil) == (y.IABAuthorized == nil) && (handoverRequest.IABAuthorized == nil || (*handoverRequest.IABAuthorized) == *y.IABAuthorized) && + (handoverRequest.EnhancedCoverageRestriction == nil) == (y.EnhancedCoverageRestriction == nil) && (handoverRequest.EnhancedCoverageRestriction == nil || (*handoverRequest.EnhancedCoverageRestriction) == *y.EnhancedCoverageRestriction) && + (handoverRequest.UEDifferentiationInfo == nil) == (y.UEDifferentiationInfo == nil) && (handoverRequest.UEDifferentiationInfo == nil || (*handoverRequest.UEDifferentiationInfo).Equal(*y.UEDifferentiationInfo)) && + (handoverRequest.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (handoverRequest.NRV2XServicesAuthorized == nil || (*handoverRequest.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (handoverRequest.LTEV2XServicesAuthorized == nil) == (y.LTEV2XServicesAuthorized == nil) && (handoverRequest.LTEV2XServicesAuthorized == nil || (*handoverRequest.LTEV2XServicesAuthorized).Equal(*y.LTEV2XServicesAuthorized)) && + (handoverRequest.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (handoverRequest.NRUESidelinkAggregateMaximumBitrate == nil || (*handoverRequest.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (handoverRequest.LTEUESidelinkAggregateMaximumBitrate == nil) == (y.LTEUESidelinkAggregateMaximumBitrate == nil) && (handoverRequest.LTEUESidelinkAggregateMaximumBitrate == nil || (*handoverRequest.LTEUESidelinkAggregateMaximumBitrate).Equal(*y.LTEUESidelinkAggregateMaximumBitrate)) && + (handoverRequest.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (handoverRequest.PC5QoSParameters == nil || (*handoverRequest.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (handoverRequest.CEmodeBrestricted == nil) == (y.CEmodeBrestricted == nil) && (handoverRequest.CEmodeBrestricted == nil || (*handoverRequest.CEmodeBrestricted) == *y.CEmodeBrestricted) && + (handoverRequest.UEUPCIoTSupport == nil) == (y.UEUPCIoTSupport == nil) && (handoverRequest.UEUPCIoTSupport == nil || (*handoverRequest.UEUPCIoTSupport) == *y.UEUPCIoTSupport) && + handoverRequest.ManagementBasedMDTPLMNList.Equal(y.ManagementBasedMDTPLMNList) && + (handoverRequest.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (handoverRequest.UERadioCapabilityID == nil || (*handoverRequest.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && + (handoverRequest.ExtendedConnectedTime == nil) == (y.ExtendedConnectedTime == nil) && (handoverRequest.ExtendedConnectedTime == nil || (*handoverRequest.ExtendedConnectedTime) == *y.ExtendedConnectedTime) && + (handoverRequest.TimeSyncAssistanceInfo == nil) == (y.TimeSyncAssistanceInfo == nil) && (handoverRequest.TimeSyncAssistanceInfo == nil || (*handoverRequest.TimeSyncAssistanceInfo).Equal(*y.TimeSyncAssistanceInfo)) && + handoverRequest.UESliceMaximumBitRateList.Equal(y.UESliceMaximumBitRateList) && + (handoverRequest.FiveGProSeAuthorized == nil) == (y.FiveGProSeAuthorized == nil) && (handoverRequest.FiveGProSeAuthorized == nil || (*handoverRequest.FiveGProSeAuthorized).Equal(*y.FiveGProSeAuthorized)) && + (handoverRequest.FiveGProSeUEPC5AggregateMaximumBitRate == nil) == (y.FiveGProSeUEPC5AggregateMaximumBitRate == nil) && (handoverRequest.FiveGProSeUEPC5AggregateMaximumBitRate == nil || (*handoverRequest.FiveGProSeUEPC5AggregateMaximumBitRate).Equal(*y.FiveGProSeUEPC5AggregateMaximumBitRate)) && + (handoverRequest.FiveGProSePC5QoSParameters == nil) == (y.FiveGProSePC5QoSParameters == nil) && (handoverRequest.FiveGProSePC5QoSParameters == nil || (*handoverRequest.FiveGProSePC5QoSParameters).Equal(*y.FiveGProSePC5QoSParameters)) && + (handoverRequest.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (handoverRequest.AerialUEsubscriptionInformation == nil || (*handoverRequest.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (handoverRequest.NRA2XServicesAuthorized == nil) == (y.NRA2XServicesAuthorized == nil) && (handoverRequest.NRA2XServicesAuthorized == nil || (*handoverRequest.NRA2XServicesAuthorized).Equal(*y.NRA2XServicesAuthorized)) && + (handoverRequest.LTEA2XServicesAuthorized == nil) == (y.LTEA2XServicesAuthorized == nil) && (handoverRequest.LTEA2XServicesAuthorized == nil || (*handoverRequest.LTEA2XServicesAuthorized).Equal(*y.LTEA2XServicesAuthorized)) && + (handoverRequest.NRA2XUEPC5AggregateMaximumBitRate == nil) == (y.NRA2XUEPC5AggregateMaximumBitRate == nil) && (handoverRequest.NRA2XUEPC5AggregateMaximumBitRate == nil || (*handoverRequest.NRA2XUEPC5AggregateMaximumBitRate).Equal(*y.NRA2XUEPC5AggregateMaximumBitRate)) && + (handoverRequest.LTEA2XUEPC5AggregateMaximumBitRate == nil) == (y.LTEA2XUEPC5AggregateMaximumBitRate == nil) && (handoverRequest.LTEA2XUEPC5AggregateMaximumBitRate == nil || (*handoverRequest.LTEA2XUEPC5AggregateMaximumBitRate).Equal(*y.LTEA2XUEPC5AggregateMaximumBitRate)) && + (handoverRequest.A2XPC5QoSParameters == nil) == (y.A2XPC5QoSParameters == nil) && (handoverRequest.A2XPC5QoSParameters == nil || (*handoverRequest.A2XPC5QoSParameters).Equal(*y.A2XPC5QoSParameters)) && + (handoverRequest.MobileIABAuthorized == nil) == (y.MobileIABAuthorized == nil) && (handoverRequest.MobileIABAuthorized == nil || (*handoverRequest.MobileIABAuthorized) == *y.MobileIABAuthorized) && + (handoverRequest.NoPDUSessionIndication == nil) == (y.NoPDUSessionIndication == nil) && (handoverRequest.NoPDUSessionIndication == nil || (*handoverRequest.NoPDUSessionIndication) == *y.NoPDUSessionIndication) && + handoverRequest.PartiallyAllowedNSSAI.Equal(y.PartiallyAllowedNSSAI) && + (handoverRequest.SLPositioningRangingServiceInfo == nil) == (y.SLPositioningRangingServiceInfo == nil) && (handoverRequest.SLPositioningRangingServiceInfo == nil || (*handoverRequest.SLPositioningRangingServiceInfo).Equal(*y.SLPositioningRangingServiceInfo)) && + handoverRequest.messageMeta.Equal(y.messageMeta) +} + +func (handoverRequestAcknowledge HandoverRequestAcknowledge) Equal(y HandoverRequestAcknowledge) bool { + return (handoverRequestAcknowledge.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (handoverRequestAcknowledge.AMFUENGAPID == nil || (*handoverRequestAcknowledge.AMFUENGAPID) == *y.AMFUENGAPID) && + (handoverRequestAcknowledge.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (handoverRequestAcknowledge.RANUENGAPID == nil || (*handoverRequestAcknowledge.RANUENGAPID) == *y.RANUENGAPID) && + handoverRequestAcknowledge.PDUSessionResourceAdmittedList.Equal(y.PDUSessionResourceAdmittedList) && + handoverRequestAcknowledge.PDUSessionResourceFailedToSetup.Equal(y.PDUSessionResourceFailedToSetup) && + handoverRequestAcknowledge.TargetToSourceTransparentContainer.Equal(y.TargetToSourceTransparentContainer) && + (handoverRequestAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverRequestAcknowledge.CriticalityDiagnostics == nil || (*handoverRequestAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (handoverRequestAcknowledge.NPNAccessInformation == nil) == (y.NPNAccessInformation == nil) && (handoverRequestAcknowledge.NPNAccessInformation == nil || (*handoverRequestAcknowledge.NPNAccessInformation).Equal(*y.NPNAccessInformation)) && + (handoverRequestAcknowledge.RedCapIndication == nil) == (y.RedCapIndication == nil) && (handoverRequestAcknowledge.RedCapIndication == nil || (*handoverRequestAcknowledge.RedCapIndication) == *y.RedCapIndication) && + (handoverRequestAcknowledge.ERedCapIndication == nil) == (y.ERedCapIndication == nil) && (handoverRequestAcknowledge.ERedCapIndication == nil || (*handoverRequestAcknowledge.ERedCapIndication) == *y.ERedCapIndication) && + handoverRequestAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (handoverRequestAcknowledgeTransfer HandoverRequestAcknowledgeTransfer) Equal(y HandoverRequestAcknowledgeTransfer) bool { + return handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.Equal(y.DLNGUUPTNLInformation) && + (handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation == nil) == (y.DLForwardingUPTNLInformation == nil) && (handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation == nil || (*handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation).Equal(*y.DLForwardingUPTNLInformation)) && + (handoverRequestAcknowledgeTransfer.SecurityResult == nil) == (y.SecurityResult == nil) && (handoverRequestAcknowledgeTransfer.SecurityResult == nil || (*handoverRequestAcknowledgeTransfer.SecurityResult).Equal(*y.SecurityResult)) && + handoverRequestAcknowledgeTransfer.QosFlowSetupResponse.Equal(y.QosFlowSetupResponse) && + (handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup == nil) == (y.QosFlowFailedToSetup == nil) && handoverRequestAcknowledgeTransfer.QosFlowFailedToSetup.Equal(y.QosFlowFailedToSetup) && + (handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB == nil) == (y.DataForwardingResponseDRB == nil) && handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB.Equal(y.DataForwardingResponseDRB) && + handoverRequestAcknowledgeTransfer.AdditionalDLUPTNLInformationForHO.Equal(y.AdditionalDLUPTNLInformationForHO) && + (handoverRequestAcknowledgeTransfer.ULForwardingUPTNLInformation == nil) == (y.ULForwardingUPTNLInformation == nil) && (handoverRequestAcknowledgeTransfer.ULForwardingUPTNLInformation == nil || (*handoverRequestAcknowledgeTransfer.ULForwardingUPTNLInformation).Equal(*y.ULForwardingUPTNLInformation)) && + handoverRequestAcknowledgeTransfer.AdditionalULForwardingUPTNLInformation.Equal(y.AdditionalULForwardingUPTNLInformation) && + handoverRequestAcknowledgeTransfer.DataForwardingResponseERAB.Equal(y.DataForwardingResponseERAB) && + (handoverRequestAcknowledgeTransfer.RedundantDLNGUUPTNLInformation == nil) == (y.RedundantDLNGUUPTNLInformation == nil) && (handoverRequestAcknowledgeTransfer.RedundantDLNGUUPTNLInformation == nil || (*handoverRequestAcknowledgeTransfer.RedundantDLNGUUPTNLInformation).Equal(*y.RedundantDLNGUUPTNLInformation)) && + (handoverRequestAcknowledgeTransfer.UsedRSNInformation == nil) == (y.UsedRSNInformation == nil) && (handoverRequestAcknowledgeTransfer.UsedRSNInformation == nil || (*handoverRequestAcknowledgeTransfer.UsedRSNInformation).Equal(*y.UsedRSNInformation)) && + (handoverRequestAcknowledgeTransfer.GlobalRANNodeID == nil) == (y.GlobalRANNodeID == nil) && (handoverRequestAcknowledgeTransfer.GlobalRANNodeID == nil || (*handoverRequestAcknowledgeTransfer.GlobalRANNodeID).Equal(*y.GlobalRANNodeID)) && + (handoverRequestAcknowledgeTransfer.MBSSupportIndicator == nil) == (y.MBSSupportIndicator == nil) && (handoverRequestAcknowledgeTransfer.MBSSupportIndicator == nil || (*handoverRequestAcknowledgeTransfer.MBSSupportIndicator) == *y.MBSSupportIndicator) && + (handoverRequestAcknowledgeTransfer.PDUSetbasedHandlingIndicator == nil) == (y.PDUSetbasedHandlingIndicator == nil) && (handoverRequestAcknowledgeTransfer.PDUSetbasedHandlingIndicator == nil || (*handoverRequestAcknowledgeTransfer.PDUSetbasedHandlingIndicator) == *y.PDUSetbasedHandlingIndicator) && + handoverRequestAcknowledgeTransfer.ECNMarkingorCongestionInformationReportingStatus.Equal(y.ECNMarkingorCongestionInformationReportingStatus) && + handoverRequestAcknowledgeTransfer.iEExtensions == y.iEExtensions && + handoverRequestAcknowledgeTransfer.extensions == y.extensions +} + +func (handoverRequired HandoverRequired) Equal(y HandoverRequired) bool { + return handoverRequired.AMFUENGAPID == y.AMFUENGAPID && + handoverRequired.RANUENGAPID == y.RANUENGAPID && + handoverRequired.HandoverType == y.HandoverType && + (handoverRequired.Cause == nil) == (y.Cause == nil) && (handoverRequired.Cause == nil || (*handoverRequired.Cause).Equal(*y.Cause)) && + handoverRequired.TargetID.Equal(y.TargetID) && + (handoverRequired.DirectForwardingPathAvailability == nil) == (y.DirectForwardingPathAvailability == nil) && (handoverRequired.DirectForwardingPathAvailability == nil || (*handoverRequired.DirectForwardingPathAvailability) == *y.DirectForwardingPathAvailability) && + handoverRequired.PDUSessionResourceListHORqd.Equal(y.PDUSessionResourceListHORqd) && + handoverRequired.SourceToTargetTransparentContainer.Equal(y.SourceToTargetTransparentContainer) && + handoverRequired.messageMeta.Equal(y.messageMeta) +} + +func (handoverRequiredTransfer HandoverRequiredTransfer) Equal(y HandoverRequiredTransfer) bool { + return handoverRequiredTransfer.extensions == y.extensions && + (handoverRequiredTransfer.DirectForwardingPathAvailability == nil) == (y.DirectForwardingPathAvailability == nil) && (handoverRequiredTransfer.DirectForwardingPathAvailability == nil || (*handoverRequiredTransfer.DirectForwardingPathAvailability) == *y.DirectForwardingPathAvailability) && + handoverRequiredTransfer.iEExtensions == y.iEExtensions +} + +func (handoverResourceAllocationUnsuccessfulTransfer HandoverResourceAllocationUnsuccessfulTransfer) Equal(y HandoverResourceAllocationUnsuccessfulTransfer) bool { + return handoverResourceAllocationUnsuccessfulTransfer.extensions == y.extensions && + handoverResourceAllocationUnsuccessfulTransfer.Cause.Equal(y.Cause) && + (handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics == nil || (*handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverResourceAllocationUnsuccessfulTransfer.iEExtensions == y.iEExtensions +} + +func (hashedUEIdentityIndexValue HashedUEIdentityIndexValue) Equal(y HashedUEIdentityIndexValue) bool { + return hashedUEIdentityIndexValue == y +} + +func (identityInformation IdentityInformation) Equal(y IdentityInformation) bool { + if len(identityInformation) != len(y) { + return false + } + for i := range identityInformation { + if !(identityInformation[i] == y[i]) { + return false + } + } + return true +} + +func (immediateMDTNr ImmediateMDTNr) Equal(y ImmediateMDTNr) bool { + return immediateMDTNr.MeasurementsToActivate == y.MeasurementsToActivate && + (immediateMDTNr.M1Configuration == nil) == (y.M1Configuration == nil) && (immediateMDTNr.M1Configuration == nil || (*immediateMDTNr.M1Configuration).Equal(*y.M1Configuration)) && + (immediateMDTNr.M4Configuration == nil) == (y.M4Configuration == nil) && (immediateMDTNr.M4Configuration == nil || (*immediateMDTNr.M4Configuration).Equal(*y.M4Configuration)) && + (immediateMDTNr.M5Configuration == nil) == (y.M5Configuration == nil) && (immediateMDTNr.M5Configuration == nil || (*immediateMDTNr.M5Configuration).Equal(*y.M5Configuration)) && + (immediateMDTNr.M6Configuration == nil) == (y.M6Configuration == nil) && (immediateMDTNr.M6Configuration == nil || (*immediateMDTNr.M6Configuration).Equal(*y.M6Configuration)) && + (immediateMDTNr.M7Configuration == nil) == (y.M7Configuration == nil) && (immediateMDTNr.M7Configuration == nil || (*immediateMDTNr.M7Configuration).Equal(*y.M7Configuration)) && + (immediateMDTNr.BluetoothMeasurementConfiguration == nil) == (y.BluetoothMeasurementConfiguration == nil) && (immediateMDTNr.BluetoothMeasurementConfiguration == nil || (*immediateMDTNr.BluetoothMeasurementConfiguration).Equal(*y.BluetoothMeasurementConfiguration)) && + (immediateMDTNr.WLANMeasurementConfiguration == nil) == (y.WLANMeasurementConfiguration == nil) && (immediateMDTNr.WLANMeasurementConfiguration == nil || (*immediateMDTNr.WLANMeasurementConfiguration).Equal(*y.WLANMeasurementConfiguration)) && + (immediateMDTNr.MDTLocationInfo == nil) == (y.MDTLocationInfo == nil) && (immediateMDTNr.MDTLocationInfo == nil || (*immediateMDTNr.MDTLocationInfo).Equal(*y.MDTLocationInfo)) && + (immediateMDTNr.SensorMeasurementConfiguration == nil) == (y.SensorMeasurementConfiguration == nil) && (immediateMDTNr.SensorMeasurementConfiguration == nil || (*immediateMDTNr.SensorMeasurementConfiguration).Equal(*y.SensorMeasurementConfiguration)) && + immediateMDTNr.iEExtensions == y.iEExtensions && + immediateMDTNr.extensions == y.extensions +} + +func (infoOnRecommendedCellsAndRANNodesForPaging InfoOnRecommendedCellsAndRANNodesForPaging) Equal(y InfoOnRecommendedCellsAndRANNodesForPaging) bool { + return infoOnRecommendedCellsAndRANNodesForPaging.RecommendedCellsForPaging.Equal(y.RecommendedCellsForPaging) && + infoOnRecommendedCellsAndRANNodesForPaging.RecommendRANNodesForPaging.Equal(y.RecommendRANNodesForPaging) && + infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions == y.iEExtensions && + infoOnRecommendedCellsAndRANNodesForPaging.extensions == y.extensions +} + +func (initialContextSetupFailure InitialContextSetupFailure) Equal(y InitialContextSetupFailure) bool { + return (initialContextSetupFailure.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (initialContextSetupFailure.AMFUENGAPID == nil || (*initialContextSetupFailure.AMFUENGAPID) == *y.AMFUENGAPID) && + (initialContextSetupFailure.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (initialContextSetupFailure.RANUENGAPID == nil || (*initialContextSetupFailure.RANUENGAPID) == *y.RANUENGAPID) && + initialContextSetupFailure.PDUSessionResourceFailed.Equal(y.PDUSessionResourceFailed) && + (initialContextSetupFailure.Cause == nil) == (y.Cause == nil) && (initialContextSetupFailure.Cause == nil || (*initialContextSetupFailure.Cause).Equal(*y.Cause)) && + (initialContextSetupFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (initialContextSetupFailure.CriticalityDiagnostics == nil || (*initialContextSetupFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + initialContextSetupFailure.messageMeta.Equal(y.messageMeta) +} + +func (initialContextSetupRequest InitialContextSetupRequest) Equal(y InitialContextSetupRequest) bool { + return initialContextSetupRequest.AMFUENGAPID == y.AMFUENGAPID && + initialContextSetupRequest.RANUENGAPID == y.RANUENGAPID && + (initialContextSetupRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (initialContextSetupRequest.UEAggregateMaximumBitRate == nil || (*initialContextSetupRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + initialContextSetupRequest.GUAMI.Equal(y.GUAMI) && + initialContextSetupRequest.PDUSessionResourceSetup.Equal(y.PDUSessionResourceSetup) && + initialContextSetupRequest.AllowedNSSAI.Equal(y.AllowedNSSAI) && + initialContextSetupRequest.UESecurityCapabilities.Equal(y.UESecurityCapabilities) && + initialContextSetupRequest.SecurityKey == y.SecurityKey && + (initialContextSetupRequest.TraceActivation == nil) == (y.TraceActivation == nil) && (initialContextSetupRequest.TraceActivation == nil || (*initialContextSetupRequest.TraceActivation).Equal(*y.TraceActivation)) && + initialContextSetupRequest.UERadioCapability.Equal(y.UERadioCapability) && + (initialContextSetupRequest.NASPDU == nil) == (y.NASPDU == nil) && (initialContextSetupRequest.NASPDU == nil || (*initialContextSetupRequest.NASPDU).Equal(*y.NASPDU)) && + (initialContextSetupRequest.UERadioCapabilityForPaging == nil) == (y.UERadioCapabilityForPaging == nil) && (initialContextSetupRequest.UERadioCapabilityForPaging == nil || (*initialContextSetupRequest.UERadioCapabilityForPaging).Equal(*y.UERadioCapabilityForPaging)) && + (initialContextSetupRequest.AMFUENGAPID2 == nil) == (y.AMFUENGAPID2 == nil) && (initialContextSetupRequest.AMFUENGAPID2 == nil || (*initialContextSetupRequest.AMFUENGAPID2) == *y.AMFUENGAPID2) && + (initialContextSetupRequest.OldAMF == nil) == (y.OldAMF == nil) && (initialContextSetupRequest.OldAMF == nil || (*initialContextSetupRequest.OldAMF) == *y.OldAMF) && + (initialContextSetupRequest.CoreNetworkAssistanceInformationForInactive == nil) == (y.CoreNetworkAssistanceInformationForInactive == nil) && (initialContextSetupRequest.CoreNetworkAssistanceInformationForInactive == nil || (*initialContextSetupRequest.CoreNetworkAssistanceInformationForInactive).Equal(*y.CoreNetworkAssistanceInformationForInactive)) && + (initialContextSetupRequest.MobilityRestrictionList == nil) == (y.MobilityRestrictionList == nil) && (initialContextSetupRequest.MobilityRestrictionList == nil || (*initialContextSetupRequest.MobilityRestrictionList).Equal(*y.MobilityRestrictionList)) && + (initialContextSetupRequest.IndexToRFSP == nil) == (y.IndexToRFSP == nil) && (initialContextSetupRequest.IndexToRFSP == nil || (*initialContextSetupRequest.IndexToRFSP) == *y.IndexToRFSP) && + (initialContextSetupRequest.MaskedIMEISV == nil) == (y.MaskedIMEISV == nil) && (initialContextSetupRequest.MaskedIMEISV == nil || (*initialContextSetupRequest.MaskedIMEISV) == *y.MaskedIMEISV) && + (initialContextSetupRequest.EmergencyFallbackIndicator == nil) == (y.EmergencyFallbackIndicator == nil) && (initialContextSetupRequest.EmergencyFallbackIndicator == nil || (*initialContextSetupRequest.EmergencyFallbackIndicator).Equal(*y.EmergencyFallbackIndicator)) && + (initialContextSetupRequest.RRCInactiveTransitionReportRequest == nil) == (y.RRCInactiveTransitionReportRequest == nil) && (initialContextSetupRequest.RRCInactiveTransitionReportRequest == nil || (*initialContextSetupRequest.RRCInactiveTransitionReportRequest) == *y.RRCInactiveTransitionReportRequest) && + (initialContextSetupRequest.RedirectionVoiceFallback == nil) == (y.RedirectionVoiceFallback == nil) && (initialContextSetupRequest.RedirectionVoiceFallback == nil || (*initialContextSetupRequest.RedirectionVoiceFallback) == *y.RedirectionVoiceFallback) && + (initialContextSetupRequest.LocationReportingRequestType == nil) == (y.LocationReportingRequestType == nil) && (initialContextSetupRequest.LocationReportingRequestType == nil || (*initialContextSetupRequest.LocationReportingRequestType).Equal(*y.LocationReportingRequestType)) && + (initialContextSetupRequest.CNAssistedRANTuning == nil) == (y.CNAssistedRANTuning == nil) && (initialContextSetupRequest.CNAssistedRANTuning == nil || (*initialContextSetupRequest.CNAssistedRANTuning).Equal(*y.CNAssistedRANTuning)) && + (initialContextSetupRequest.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (initialContextSetupRequest.SRVCCOperationPossible == nil || (*initialContextSetupRequest.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (initialContextSetupRequest.IABAuthorized == nil) == (y.IABAuthorized == nil) && (initialContextSetupRequest.IABAuthorized == nil || (*initialContextSetupRequest.IABAuthorized) == *y.IABAuthorized) && + (initialContextSetupRequest.EnhancedCoverageRestriction == nil) == (y.EnhancedCoverageRestriction == nil) && (initialContextSetupRequest.EnhancedCoverageRestriction == nil || (*initialContextSetupRequest.EnhancedCoverageRestriction) == *y.EnhancedCoverageRestriction) && + (initialContextSetupRequest.ExtendedConnectedTime == nil) == (y.ExtendedConnectedTime == nil) && (initialContextSetupRequest.ExtendedConnectedTime == nil || (*initialContextSetupRequest.ExtendedConnectedTime) == *y.ExtendedConnectedTime) && + (initialContextSetupRequest.UEDifferentiationInfo == nil) == (y.UEDifferentiationInfo == nil) && (initialContextSetupRequest.UEDifferentiationInfo == nil || (*initialContextSetupRequest.UEDifferentiationInfo).Equal(*y.UEDifferentiationInfo)) && + (initialContextSetupRequest.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (initialContextSetupRequest.NRV2XServicesAuthorized == nil || (*initialContextSetupRequest.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (initialContextSetupRequest.LTEV2XServicesAuthorized == nil) == (y.LTEV2XServicesAuthorized == nil) && (initialContextSetupRequest.LTEV2XServicesAuthorized == nil || (*initialContextSetupRequest.LTEV2XServicesAuthorized).Equal(*y.LTEV2XServicesAuthorized)) && + (initialContextSetupRequest.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (initialContextSetupRequest.NRUESidelinkAggregateMaximumBitrate == nil || (*initialContextSetupRequest.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (initialContextSetupRequest.LTEUESidelinkAggregateMaximumBitrate == nil) == (y.LTEUESidelinkAggregateMaximumBitrate == nil) && (initialContextSetupRequest.LTEUESidelinkAggregateMaximumBitrate == nil || (*initialContextSetupRequest.LTEUESidelinkAggregateMaximumBitrate).Equal(*y.LTEUESidelinkAggregateMaximumBitrate)) && + (initialContextSetupRequest.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (initialContextSetupRequest.PC5QoSParameters == nil || (*initialContextSetupRequest.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (initialContextSetupRequest.CEmodeBrestricted == nil) == (y.CEmodeBrestricted == nil) && (initialContextSetupRequest.CEmodeBrestricted == nil || (*initialContextSetupRequest.CEmodeBrestricted) == *y.CEmodeBrestricted) && + (initialContextSetupRequest.UEUPCIoTSupport == nil) == (y.UEUPCIoTSupport == nil) && (initialContextSetupRequest.UEUPCIoTSupport == nil || (*initialContextSetupRequest.UEUPCIoTSupport) == *y.UEUPCIoTSupport) && + (initialContextSetupRequest.RGLevelWirelineAccessCharacteristics == nil) == (y.RGLevelWirelineAccessCharacteristics == nil) && (initialContextSetupRequest.RGLevelWirelineAccessCharacteristics == nil || (*initialContextSetupRequest.RGLevelWirelineAccessCharacteristics).Equal(*y.RGLevelWirelineAccessCharacteristics)) && + initialContextSetupRequest.ManagementBasedMDTPLMNList.Equal(y.ManagementBasedMDTPLMNList) && + (initialContextSetupRequest.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (initialContextSetupRequest.UERadioCapabilityID == nil || (*initialContextSetupRequest.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && + (initialContextSetupRequest.TimeSyncAssistanceInfo == nil) == (y.TimeSyncAssistanceInfo == nil) && (initialContextSetupRequest.TimeSyncAssistanceInfo == nil || (*initialContextSetupRequest.TimeSyncAssistanceInfo).Equal(*y.TimeSyncAssistanceInfo)) && + (initialContextSetupRequest.QMCConfigInfo == nil) == (y.QMCConfigInfo == nil) && (initialContextSetupRequest.QMCConfigInfo == nil || (*initialContextSetupRequest.QMCConfigInfo).Equal(*y.QMCConfigInfo)) && + (initialContextSetupRequest.TargetNSSAIInformation == nil) == (y.TargetNSSAIInformation == nil) && (initialContextSetupRequest.TargetNSSAIInformation == nil || (*initialContextSetupRequest.TargetNSSAIInformation).Equal(*y.TargetNSSAIInformation)) && + initialContextSetupRequest.UESliceMaximumBitRateList.Equal(y.UESliceMaximumBitRateList) && + (initialContextSetupRequest.FiveGProSeAuthorized == nil) == (y.FiveGProSeAuthorized == nil) && (initialContextSetupRequest.FiveGProSeAuthorized == nil || (*initialContextSetupRequest.FiveGProSeAuthorized).Equal(*y.FiveGProSeAuthorized)) && + (initialContextSetupRequest.FiveGProSeUEPC5AggregateMaximumBitRate == nil) == (y.FiveGProSeUEPC5AggregateMaximumBitRate == nil) && (initialContextSetupRequest.FiveGProSeUEPC5AggregateMaximumBitRate == nil || (*initialContextSetupRequest.FiveGProSeUEPC5AggregateMaximumBitRate).Equal(*y.FiveGProSeUEPC5AggregateMaximumBitRate)) && + (initialContextSetupRequest.FiveGProSePC5QoSParameters == nil) == (y.FiveGProSePC5QoSParameters == nil) && (initialContextSetupRequest.FiveGProSePC5QoSParameters == nil || (*initialContextSetupRequest.FiveGProSePC5QoSParameters).Equal(*y.FiveGProSePC5QoSParameters)) && + (initialContextSetupRequest.NetworkControlledRepeaterAuthorized == nil) == (y.NetworkControlledRepeaterAuthorized == nil) && (initialContextSetupRequest.NetworkControlledRepeaterAuthorized == nil || (*initialContextSetupRequest.NetworkControlledRepeaterAuthorized) == *y.NetworkControlledRepeaterAuthorized) && + (initialContextSetupRequest.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (initialContextSetupRequest.AerialUEsubscriptionInformation == nil || (*initialContextSetupRequest.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (initialContextSetupRequest.NRA2XServicesAuthorized == nil) == (y.NRA2XServicesAuthorized == nil) && (initialContextSetupRequest.NRA2XServicesAuthorized == nil || (*initialContextSetupRequest.NRA2XServicesAuthorized).Equal(*y.NRA2XServicesAuthorized)) && + (initialContextSetupRequest.LTEA2XServicesAuthorized == nil) == (y.LTEA2XServicesAuthorized == nil) && (initialContextSetupRequest.LTEA2XServicesAuthorized == nil || (*initialContextSetupRequest.LTEA2XServicesAuthorized).Equal(*y.LTEA2XServicesAuthorized)) && + (initialContextSetupRequest.NRA2XUEPC5AggregateMaximumBitRate == nil) == (y.NRA2XUEPC5AggregateMaximumBitRate == nil) && (initialContextSetupRequest.NRA2XUEPC5AggregateMaximumBitRate == nil || (*initialContextSetupRequest.NRA2XUEPC5AggregateMaximumBitRate).Equal(*y.NRA2XUEPC5AggregateMaximumBitRate)) && + (initialContextSetupRequest.LTEA2XUEPC5AggregateMaximumBitRate == nil) == (y.LTEA2XUEPC5AggregateMaximumBitRate == nil) && (initialContextSetupRequest.LTEA2XUEPC5AggregateMaximumBitRate == nil || (*initialContextSetupRequest.LTEA2XUEPC5AggregateMaximumBitRate).Equal(*y.LTEA2XUEPC5AggregateMaximumBitRate)) && + (initialContextSetupRequest.A2XPC5QoSParameters == nil) == (y.A2XPC5QoSParameters == nil) && (initialContextSetupRequest.A2XPC5QoSParameters == nil || (*initialContextSetupRequest.A2XPC5QoSParameters).Equal(*y.A2XPC5QoSParameters)) && + (initialContextSetupRequest.MobileIABAuthorized == nil) == (y.MobileIABAuthorized == nil) && (initialContextSetupRequest.MobileIABAuthorized == nil || (*initialContextSetupRequest.MobileIABAuthorized) == *y.MobileIABAuthorized) && + initialContextSetupRequest.PartiallyAllowedNSSAI.Equal(y.PartiallyAllowedNSSAI) && + (initialContextSetupRequest.SLPositioningRangingServiceInfo == nil) == (y.SLPositioningRangingServiceInfo == nil) && (initialContextSetupRequest.SLPositioningRangingServiceInfo == nil || (*initialContextSetupRequest.SLPositioningRangingServiceInfo).Equal(*y.SLPositioningRangingServiceInfo)) && + (initialContextSetupRequest.ExtendedOldAMF == nil) == (y.ExtendedOldAMF == nil) && (initialContextSetupRequest.ExtendedOldAMF == nil || (*initialContextSetupRequest.ExtendedOldAMF).Equal(*y.ExtendedOldAMF)) && + initialContextSetupRequest.messageMeta.Equal(y.messageMeta) +} + +func (initialContextSetupResponse InitialContextSetupResponse) Equal(y InitialContextSetupResponse) bool { + return (initialContextSetupResponse.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (initialContextSetupResponse.AMFUENGAPID == nil || (*initialContextSetupResponse.AMFUENGAPID) == *y.AMFUENGAPID) && + (initialContextSetupResponse.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (initialContextSetupResponse.RANUENGAPID == nil || (*initialContextSetupResponse.RANUENGAPID) == *y.RANUENGAPID) && + initialContextSetupResponse.PDUSessionResourceSetup.Equal(y.PDUSessionResourceSetup) && + initialContextSetupResponse.PDUSessionResourceFailed.Equal(y.PDUSessionResourceFailed) && + (initialContextSetupResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (initialContextSetupResponse.CriticalityDiagnostics == nil || (*initialContextSetupResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + initialContextSetupResponse.messageMeta.Equal(y.messageMeta) +} + +func (initialUEMessage InitialUEMessage) Equal(y InitialUEMessage) bool { + return initialUEMessage.RANUENGAPID == y.RANUENGAPID && + initialUEMessage.NASPDU.Equal(y.NASPDU) && + initialUEMessage.UserLocationInformation.Equal(y.UserLocationInformation) && + (initialUEMessage.RRCEstablishmentCause == nil) == (y.RRCEstablishmentCause == nil) && (initialUEMessage.RRCEstablishmentCause == nil || (*initialUEMessage.RRCEstablishmentCause) == *y.RRCEstablishmentCause) && + (initialUEMessage.FiveGSTMSI == nil) == (y.FiveGSTMSI == nil) && (initialUEMessage.FiveGSTMSI == nil || (*initialUEMessage.FiveGSTMSI).Equal(*y.FiveGSTMSI)) && + (initialUEMessage.AMFSetID == nil) == (y.AMFSetID == nil) && (initialUEMessage.AMFSetID == nil || (*initialUEMessage.AMFSetID) == *y.AMFSetID) && + (initialUEMessage.UEContextRequest == nil) == (y.UEContextRequest == nil) && (initialUEMessage.UEContextRequest == nil || (*initialUEMessage.UEContextRequest) == *y.UEContextRequest) && + initialUEMessage.AllowedNSSAI.Equal(y.AllowedNSSAI) && + (initialUEMessage.GUAMI == nil) == (y.GUAMI == nil) && (initialUEMessage.GUAMI == nil || (*initialUEMessage.GUAMI).Equal(*y.GUAMI)) && + (initialUEMessage.GUAMIType == nil) == (y.GUAMIType == nil) && (initialUEMessage.GUAMIType == nil || (*initialUEMessage.GUAMIType) == *y.GUAMIType) && + initialUEMessage.RequestedNSSAI.Equal(y.RequestedNSSAI) && + (initialUEMessage.SourceToTargetAMFInformationReroute == nil) == (y.SourceToTargetAMFInformationReroute == nil) && (initialUEMessage.SourceToTargetAMFInformationReroute == nil || (*initialUEMessage.SourceToTargetAMFInformationReroute).Equal(*y.SourceToTargetAMFInformationReroute)) && + (initialUEMessage.SelectedPLMNIdentity == nil) == (y.SelectedPLMNIdentity == nil) && (initialUEMessage.SelectedPLMNIdentity == nil || (*initialUEMessage.SelectedPLMNIdentity) == *y.SelectedPLMNIdentity) && + (initialUEMessage.IABNodeIndication == nil) == (y.IABNodeIndication == nil) && (initialUEMessage.IABNodeIndication == nil || (*initialUEMessage.IABNodeIndication) == *y.IABNodeIndication) && + (initialUEMessage.CEmodeBSupportIndicator == nil) == (y.CEmodeBSupportIndicator == nil) && (initialUEMessage.CEmodeBSupportIndicator == nil || (*initialUEMessage.CEmodeBSupportIndicator) == *y.CEmodeBSupportIndicator) && + (initialUEMessage.LTEMIndication == nil) == (y.LTEMIndication == nil) && (initialUEMessage.LTEMIndication == nil || (*initialUEMessage.LTEMIndication) == *y.LTEMIndication) && + (initialUEMessage.EDTSession == nil) == (y.EDTSession == nil) && (initialUEMessage.EDTSession == nil || (*initialUEMessage.EDTSession) == *y.EDTSession) && + (initialUEMessage.AuthenticatedIndication == nil) == (y.AuthenticatedIndication == nil) && (initialUEMessage.AuthenticatedIndication == nil || (*initialUEMessage.AuthenticatedIndication) == *y.AuthenticatedIndication) && + (initialUEMessage.NPNAccessInformation == nil) == (y.NPNAccessInformation == nil) && (initialUEMessage.NPNAccessInformation == nil || (*initialUEMessage.NPNAccessInformation).Equal(*y.NPNAccessInformation)) && + (initialUEMessage.RedCapIndication == nil) == (y.RedCapIndication == nil) && (initialUEMessage.RedCapIndication == nil || (*initialUEMessage.RedCapIndication) == *y.RedCapIndication) && + (initialUEMessage.SelectedNID == nil) == (y.SelectedNID == nil) && (initialUEMessage.SelectedNID == nil || (*initialUEMessage.SelectedNID) == *y.SelectedNID) && + (initialUEMessage.MobileIABNodeIndication == nil) == (y.MobileIABNodeIndication == nil) && (initialUEMessage.MobileIABNodeIndication == nil || (*initialUEMessage.MobileIABNodeIndication) == *y.MobileIABNodeIndication) && + initialUEMessage.PartiallyAllowedNSSAI.Equal(y.PartiallyAllowedNSSAI) && + (initialUEMessage.ERedCapIndication == nil) == (y.ERedCapIndication == nil) && (initialUEMessage.ERedCapIndication == nil || (*initialUEMessage.ERedCapIndication) == *y.ERedCapIndication) && + (initialUEMessage.AUN3DeviceAccessInfo == nil) == (y.AUN3DeviceAccessInfo == nil) && (initialUEMessage.AUN3DeviceAccessInfo == nil || (*initialUEMessage.AUN3DeviceAccessInfo).Equal(*y.AUN3DeviceAccessInfo)) && + initialUEMessage.messageMeta.Equal(y.messageMeta) +} + +func (intendedServiceAreaCoordinates IntendedServiceAreaCoordinates) Equal(y IntendedServiceAreaCoordinates) bool { + if len(intendedServiceAreaCoordinates) != len(y) { + return false + } + for i := range intendedServiceAreaCoordinates { + if !(intendedServiceAreaCoordinates[i] == y[i]) { + return false + } + } + return true +} + +func (interSystemFailureIndication InterSystemFailureIndication) Equal(y InterSystemFailureIndication) bool { + return (interSystemFailureIndication.UERLFReportContainer == nil) == (y.UERLFReportContainer == nil) && (interSystemFailureIndication.UERLFReportContainer == nil || (*interSystemFailureIndication.UERLFReportContainer).Equal(*y.UERLFReportContainer)) && + interSystemFailureIndication.iEExtensions == y.iEExtensions && + interSystemFailureIndication.extensions == y.extensions +} + +func (interSystemHOReport InterSystemHOReport) Equal(y InterSystemHOReport) bool { + return interSystemHOReport.HandoverReportType.Equal(y.HandoverReportType) && + interSystemHOReport.iEExtensions == y.iEExtensions && + interSystemHOReport.extensions == y.extensions +} + +func (interSystemHandoverReportType InterSystemHandoverReportType) Equal(y InterSystemHandoverReportType) bool { + return (interSystemHandoverReportType.TooearlyIntersystemHO == nil) == (y.TooearlyIntersystemHO == nil) && (interSystemHandoverReportType.TooearlyIntersystemHO == nil || (*interSystemHandoverReportType.TooearlyIntersystemHO).Equal(*y.TooearlyIntersystemHO)) && + (interSystemHandoverReportType.IntersystemUnnecessaryHO == nil) == (y.IntersystemUnnecessaryHO == nil) && (interSystemHandoverReportType.IntersystemUnnecessaryHO == nil || (*interSystemHandoverReportType.IntersystemUnnecessaryHO).Equal(*y.IntersystemUnnecessaryHO)) && + (interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback == nil) == (y.IntersystemMobilityFailureforVoiceFallback == nil) && (interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback == nil || (*interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback).Equal(*y.IntersystemMobilityFailureforVoiceFallback)) && + (interSystemHandoverReportType.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (interSystemHandoverReportType.ChoiceExtension == nil || (*interSystemHandoverReportType.ChoiceExtension) == *y.ChoiceExtension) && + interSystemHandoverReportType.choiceCriticality == y.choiceCriticality +} + +func (intersystemCellActivationReply IntersystemCellActivationReply) Equal(y IntersystemCellActivationReply) bool { + return intersystemCellActivationReply.ActivatedCellList.Equal(y.ActivatedCellList) && + intersystemCellActivationReply.ActivationID == y.ActivationID && + intersystemCellActivationReply.iEExtensions == y.iEExtensions && + intersystemCellActivationReply.extensions == y.extensions +} + +func (intersystemCellActivationRequest IntersystemCellActivationRequest) Equal(y IntersystemCellActivationRequest) bool { + return intersystemCellActivationRequest.ActivationID == y.ActivationID && + intersystemCellActivationRequest.CellsToActivateList.Equal(y.CellsToActivateList) && + intersystemCellActivationRequest.iEExtensions == y.iEExtensions && + intersystemCellActivationRequest.extensions == y.extensions +} + +func (intersystemCellStateIndication IntersystemCellStateIndication) Equal(y IntersystemCellStateIndication) bool { + return intersystemCellStateIndication.NotificationCellList.Equal(y.NotificationCellList) && + intersystemCellStateIndication.iEExtensions == y.iEExtensions && + intersystemCellStateIndication.extensions == y.extensions +} + +func (intersystemMobilityFailureforVoiceFallback IntersystemMobilityFailureforVoiceFallback) Equal(y IntersystemMobilityFailureforVoiceFallback) bool { + return intersystemMobilityFailureforVoiceFallback.SourcecellID.Equal(y.SourcecellID) && + intersystemMobilityFailureforVoiceFallback.TargetcellID.Equal(y.TargetcellID) && + (intersystemMobilityFailureforVoiceFallback.ReconnectCellID == nil) == (y.ReconnectCellID == nil) && (intersystemMobilityFailureforVoiceFallback.ReconnectCellID == nil || (*intersystemMobilityFailureforVoiceFallback.ReconnectCellID).Equal(*y.ReconnectCellID)) && + (intersystemMobilityFailureforVoiceFallback.UERLFReportContainer == nil) == (y.UERLFReportContainer == nil) && (intersystemMobilityFailureforVoiceFallback.UERLFReportContainer == nil || (*intersystemMobilityFailureforVoiceFallback.UERLFReportContainer).Equal(*y.UERLFReportContainer)) && + intersystemMobilityFailureforVoiceFallback.iEExtensions == y.iEExtensions && + intersystemMobilityFailureforVoiceFallback.extensions == y.extensions +} + +func (intersystemResourceStatusReply IntersystemResourceStatusReply) Equal(y IntersystemResourceStatusReply) bool { + return intersystemResourceStatusReply.Reportingsystem.Equal(y.Reportingsystem) && + intersystemResourceStatusReply.iEExtensions == y.iEExtensions && + intersystemResourceStatusReply.extensions == y.extensions +} + +func (intersystemResourceStatusReport IntersystemResourceStatusReport) Equal(y IntersystemResourceStatusReport) bool { + return intersystemResourceStatusReport.ReportingSystem.Equal(y.ReportingSystem) && + intersystemResourceStatusReport.iEExtensions == y.iEExtensions && + intersystemResourceStatusReport.extensions == y.extensions +} + +func (intersystemResourceStatusRequest IntersystemResourceStatusRequest) Equal(y IntersystemResourceStatusRequest) bool { + return intersystemResourceStatusRequest.ReportingSystem.Equal(y.ReportingSystem) && + intersystemResourceStatusRequest.ReportCharacteristics == y.ReportCharacteristics && + intersystemResourceStatusRequest.ReportType.Equal(y.ReportType) && + intersystemResourceStatusRequest.iEExtensions == y.iEExtensions && + intersystemResourceStatusRequest.extensions == y.extensions +} + +func (intersystemSONConfigurationTransfer IntersystemSONConfigurationTransfer) Equal(y IntersystemSONConfigurationTransfer) bool { + return intersystemSONConfigurationTransfer.TransferType.Equal(y.TransferType) && + intersystemSONConfigurationTransfer.IntersystemSONInformation.Equal(y.IntersystemSONInformation) && + intersystemSONConfigurationTransfer.iEExtensions == y.iEExtensions && + intersystemSONConfigurationTransfer.extensions == y.extensions +} + +func (intersystemSONInformation IntersystemSONInformation) Equal(y IntersystemSONInformation) bool { + return (intersystemSONInformation.IntersystemSONInformationReport == nil) == (y.IntersystemSONInformationReport == nil) && (intersystemSONInformation.IntersystemSONInformationReport == nil || (*intersystemSONInformation.IntersystemSONInformationReport).Equal(*y.IntersystemSONInformationReport)) && + (intersystemSONInformation.IntersystemSONInformationRequest == nil) == (y.IntersystemSONInformationRequest == nil) && (intersystemSONInformation.IntersystemSONInformationRequest == nil || (*intersystemSONInformation.IntersystemSONInformationRequest).Equal(*y.IntersystemSONInformationRequest)) && + (intersystemSONInformation.IntersystemSONInformationReply == nil) == (y.IntersystemSONInformationReply == nil) && (intersystemSONInformation.IntersystemSONInformationReply == nil || (*intersystemSONInformation.IntersystemSONInformationReply).Equal(*y.IntersystemSONInformationReply)) && + (intersystemSONInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (intersystemSONInformation.ChoiceExtension == nil || (*intersystemSONInformation.ChoiceExtension) == *y.ChoiceExtension) && + intersystemSONInformation.choiceCriticality == y.choiceCriticality +} + +func (intersystemSONInformationReply IntersystemSONInformationReply) Equal(y IntersystemSONInformationReply) bool { + return (intersystemSONInformationReply.NGRANCellActivation == nil) == (y.NGRANCellActivation == nil) && (intersystemSONInformationReply.NGRANCellActivation == nil || (*intersystemSONInformationReply.NGRANCellActivation).Equal(*y.NGRANCellActivation)) && + (intersystemSONInformationReply.ResourceStatus == nil) == (y.ResourceStatus == nil) && (intersystemSONInformationReply.ResourceStatus == nil || (*intersystemSONInformationReply.ResourceStatus).Equal(*y.ResourceStatus)) && + (intersystemSONInformationReply.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (intersystemSONInformationReply.ChoiceExtension == nil || (*intersystemSONInformationReply.ChoiceExtension) == *y.ChoiceExtension) +} + +func (intersystemSONInformationReport IntersystemSONInformationReport) Equal(y IntersystemSONInformationReport) bool { + return (intersystemSONInformationReport.HOReportInformation == nil) == (y.HOReportInformation == nil) && (intersystemSONInformationReport.HOReportInformation == nil || (*intersystemSONInformationReport.HOReportInformation).Equal(*y.HOReportInformation)) && + (intersystemSONInformationReport.FailureIndicationInformation == nil) == (y.FailureIndicationInformation == nil) && (intersystemSONInformationReport.FailureIndicationInformation == nil || (*intersystemSONInformationReport.FailureIndicationInformation).Equal(*y.FailureIndicationInformation)) && + (intersystemSONInformationReport.EnergySavingIndication == nil) == (y.EnergySavingIndication == nil) && (intersystemSONInformationReport.EnergySavingIndication == nil || (*intersystemSONInformationReport.EnergySavingIndication).Equal(*y.EnergySavingIndication)) && + (intersystemSONInformationReport.IntersystemResourceStatusUpdate == nil) == (y.IntersystemResourceStatusUpdate == nil) && (intersystemSONInformationReport.IntersystemResourceStatusUpdate == nil || (*intersystemSONInformationReport.IntersystemResourceStatusUpdate).Equal(*y.IntersystemResourceStatusUpdate)) && + (intersystemSONInformationReport.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (intersystemSONInformationReport.ChoiceExtension == nil || (*intersystemSONInformationReport.ChoiceExtension) == *y.ChoiceExtension) && + intersystemSONInformationReport.choiceCriticality == y.choiceCriticality +} + +func (intersystemSONInformationRequest IntersystemSONInformationRequest) Equal(y IntersystemSONInformationRequest) bool { + return (intersystemSONInformationRequest.NGRANCellActivation == nil) == (y.NGRANCellActivation == nil) && (intersystemSONInformationRequest.NGRANCellActivation == nil || (*intersystemSONInformationRequest.NGRANCellActivation).Equal(*y.NGRANCellActivation)) && + (intersystemSONInformationRequest.ResourceStatus == nil) == (y.ResourceStatus == nil) && (intersystemSONInformationRequest.ResourceStatus == nil || (*intersystemSONInformationRequest.ResourceStatus).Equal(*y.ResourceStatus)) && + (intersystemSONInformationRequest.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (intersystemSONInformationRequest.ChoiceExtension == nil || (*intersystemSONInformationRequest.ChoiceExtension) == *y.ChoiceExtension) +} + +func (intersystemSONNGRANnodeID IntersystemSONNGRANnodeID) Equal(y IntersystemSONNGRANnodeID) bool { + return intersystemSONNGRANnodeID.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + intersystemSONNGRANnodeID.SelectedTAI.Equal(y.SelectedTAI) && + intersystemSONNGRANnodeID.iEExtensions == y.iEExtensions && + intersystemSONNGRANnodeID.extensions == y.extensions +} + +func (intersystemSONTransferType IntersystemSONTransferType) Equal(y IntersystemSONTransferType) bool { + return (intersystemSONTransferType.FromEUTRANtoNGRAN == nil) == (y.FromEUTRANtoNGRAN == nil) && (intersystemSONTransferType.FromEUTRANtoNGRAN == nil || (*intersystemSONTransferType.FromEUTRANtoNGRAN).Equal(*y.FromEUTRANtoNGRAN)) && + (intersystemSONTransferType.FromNGRANtoEUTRAN == nil) == (y.FromNGRANtoEUTRAN == nil) && (intersystemSONTransferType.FromNGRANtoEUTRAN == nil || (*intersystemSONTransferType.FromNGRANtoEUTRAN).Equal(*y.FromNGRANtoEUTRAN)) && + (intersystemSONTransferType.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (intersystemSONTransferType.ChoiceExtension == nil || (*intersystemSONTransferType.ChoiceExtension) == *y.ChoiceExtension) +} + +func (intersystemSONeNBID IntersystemSONeNBID) Equal(y IntersystemSONeNBID) bool { + return intersystemSONeNBID.GlobaleNBID.Equal(y.GlobaleNBID) && + intersystemSONeNBID.SelectedEPSTAI.Equal(y.SelectedEPSTAI) && + intersystemSONeNBID.iEExtensions == y.iEExtensions && + intersystemSONeNBID.extensions == y.extensions +} + +func (intersystemUnnecessaryHO IntersystemUnnecessaryHO) Equal(y IntersystemUnnecessaryHO) bool { + return intersystemUnnecessaryHO.SourcecellID.Equal(y.SourcecellID) && + intersystemUnnecessaryHO.TargetcellID.Equal(y.TargetcellID) && + intersystemUnnecessaryHO.EarlyIRATHO == y.EarlyIRATHO && + intersystemUnnecessaryHO.CandidateCellList.Equal(y.CandidateCellList) && + intersystemUnnecessaryHO.iEExtensions == y.iEExtensions && + intersystemUnnecessaryHO.extensions == y.extensions +} + +func (lAI LAI) Equal(y LAI) bool { + return lAI == y +} + +func (lPWUSPSAssistanceInformation LPWUSPSAssistanceInformation) Equal(y LPWUSPSAssistanceInformation) bool { + return lPWUSPSAssistanceInformation == y +} + +func (lTEA2XServicesAuthorized LTEA2XServicesAuthorized) Equal(y LTEA2XServicesAuthorized) bool { + return (lTEA2XServicesAuthorized.AerialUE == nil) == (y.AerialUE == nil) && (lTEA2XServicesAuthorized.AerialUE == nil || (*lTEA2XServicesAuthorized.AerialUE) == *y.AerialUE) && + (lTEA2XServicesAuthorized.AerialControllerUE == nil) == (y.AerialControllerUE == nil) && (lTEA2XServicesAuthorized.AerialControllerUE == nil || (*lTEA2XServicesAuthorized.AerialControllerUE) == *y.AerialControllerUE) && + lTEA2XServicesAuthorized.iEExtensions == y.iEExtensions && + lTEA2XServicesAuthorized.extensions == y.extensions +} + +func (lTEUERLFReportContainer LTEUERLFReportContainer) Equal(y LTEUERLFReportContainer) bool { + if len(lTEUERLFReportContainer) != len(y) { + return false + } + for i := range lTEUERLFReportContainer { + if !(lTEUERLFReportContainer[i] == y[i]) { + return false + } + } + return true +} + +func (lTEUESidelinkAggregateMaximumBitrate LTEUESidelinkAggregateMaximumBitrate) Equal(y LTEUESidelinkAggregateMaximumBitrate) bool { + return lTEUESidelinkAggregateMaximumBitrate == y +} + +func (lTEV2XServicesAuthorized LTEV2XServicesAuthorized) Equal(y LTEV2XServicesAuthorized) bool { + return (lTEV2XServicesAuthorized.VehicleUE == nil) == (y.VehicleUE == nil) && (lTEV2XServicesAuthorized.VehicleUE == nil || (*lTEV2XServicesAuthorized.VehicleUE) == *y.VehicleUE) && + (lTEV2XServicesAuthorized.PedestrianUE == nil) == (y.PedestrianUE == nil) && (lTEV2XServicesAuthorized.PedestrianUE == nil || (*lTEV2XServicesAuthorized.PedestrianUE) == *y.PedestrianUE) && + lTEV2XServicesAuthorized.iEExtensions == y.iEExtensions && + lTEV2XServicesAuthorized.extensions == y.extensions +} + +func (lastVisitedCellInformation LastVisitedCellInformation) Equal(y LastVisitedCellInformation) bool { + return (lastVisitedCellInformation.NGRANCell == nil) == (y.NGRANCell == nil) && (lastVisitedCellInformation.NGRANCell == nil || (*lastVisitedCellInformation.NGRANCell).Equal(*y.NGRANCell)) && + (lastVisitedCellInformation.EUTRANCell == nil) == (y.EUTRANCell == nil) && (lastVisitedCellInformation.EUTRANCell == nil || (*lastVisitedCellInformation.EUTRANCell).Equal(*y.EUTRANCell)) && + (lastVisitedCellInformation.UTRANCell == nil) == (y.UTRANCell == nil) && (lastVisitedCellInformation.UTRANCell == nil || (*lastVisitedCellInformation.UTRANCell).Equal(*y.UTRANCell)) && + (lastVisitedCellInformation.GERANCell == nil) == (y.GERANCell == nil) && (lastVisitedCellInformation.GERANCell == nil || (*lastVisitedCellInformation.GERANCell).Equal(*y.GERANCell)) && + (lastVisitedCellInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (lastVisitedCellInformation.ChoiceExtension == nil || (*lastVisitedCellInformation.ChoiceExtension) == *y.ChoiceExtension) +} + +func (lastVisitedCellItem LastVisitedCellItem) Equal(y LastVisitedCellItem) bool { + return lastVisitedCellItem.LastVisitedCellInformation.Equal(y.LastVisitedCellInformation) && + lastVisitedCellItem.iEExtensions == y.iEExtensions && + lastVisitedCellItem.extensions == y.extensions +} + +func (lastVisitedEUTRANCellInformation LastVisitedEUTRANCellInformation) Equal(y LastVisitedEUTRANCellInformation) bool { + if len(lastVisitedEUTRANCellInformation) != len(y) { + return false + } + for i := range lastVisitedEUTRANCellInformation { + if !(lastVisitedEUTRANCellInformation[i] == y[i]) { + return false + } + } + return true +} + +func (lastVisitedGERANCellInformation LastVisitedGERANCellInformation) Equal(y LastVisitedGERANCellInformation) bool { + if len(lastVisitedGERANCellInformation) != len(y) { + return false + } + for i := range lastVisitedGERANCellInformation { + if !(lastVisitedGERANCellInformation[i] == y[i]) { + return false + } + } + return true +} + +func (lastVisitedNGRANCellInformation LastVisitedNGRANCellInformation) Equal(y LastVisitedNGRANCellInformation) bool { + return lastVisitedNGRANCellInformation.GlobalCellID.Equal(y.GlobalCellID) && + lastVisitedNGRANCellInformation.CellType.Equal(y.CellType) && + lastVisitedNGRANCellInformation.TimeUEStayedInCell == y.TimeUEStayedInCell && + (lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity == nil) == (y.TimeUEStayedInCellEnhancedGranularity == nil) && (lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity == nil || (*lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity) == *y.TimeUEStayedInCellEnhancedGranularity) && + (lastVisitedNGRANCellInformation.HOCauseValue == nil) == (y.HOCauseValue == nil) && (lastVisitedNGRANCellInformation.HOCauseValue == nil || (*lastVisitedNGRANCellInformation.HOCauseValue).Equal(*y.HOCauseValue)) && + lastVisitedNGRANCellInformation.LastVisitedPSCellList.Equal(y.LastVisitedPSCellList) && + lastVisitedNGRANCellInformation.iEExtensions == y.iEExtensions && + lastVisitedNGRANCellInformation.extensions == y.extensions +} + +func (lastVisitedPSCellInformation LastVisitedPSCellInformation) Equal(y LastVisitedPSCellInformation) bool { + return (lastVisitedPSCellInformation.PSCellID == nil) == (y.PSCellID == nil) && (lastVisitedPSCellInformation.PSCellID == nil || (*lastVisitedPSCellInformation.PSCellID).Equal(*y.PSCellID)) && + lastVisitedPSCellInformation.TimeStay == y.TimeStay && + (lastVisitedPSCellInformation.SCGActivationTime == nil) == (y.SCGActivationTime == nil) && (lastVisitedPSCellInformation.SCGActivationTime == nil || (*lastVisitedPSCellInformation.SCGActivationTime) == *y.SCGActivationTime) && + lastVisitedPSCellInformation.iEExtensions == y.iEExtensions && + lastVisitedPSCellInformation.extensions == y.extensions +} + +func (lastVisitedPSCellList LastVisitedPSCellList) Equal(y LastVisitedPSCellList) bool { + if len(lastVisitedPSCellList) != len(y) { + return false + } + for i := range lastVisitedPSCellList { + if !(lastVisitedPSCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (lastVisitedUTRANCellInformation LastVisitedUTRANCellInformation) Equal(y LastVisitedUTRANCellInformation) bool { + if len(lastVisitedUTRANCellInformation) != len(y) { + return false + } + for i := range lastVisitedUTRANCellInformation { + if !(lastVisitedUTRANCellInformation[i] == y[i]) { + return false + } + } + return true +} + +func (locationReport LocationReport) Equal(y LocationReport) bool { + return locationReport.AMFUENGAPID == y.AMFUENGAPID && + locationReport.RANUENGAPID == y.RANUENGAPID && + (locationReport.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (locationReport.UserLocationInformation == nil || (*locationReport.UserLocationInformation).Equal(*y.UserLocationInformation)) && + locationReport.UEPresenceInAreaOfInterestList.Equal(y.UEPresenceInAreaOfInterestList) && + (locationReport.LocationReportingRequestType == nil) == (y.LocationReportingRequestType == nil) && (locationReport.LocationReportingRequestType == nil || (*locationReport.LocationReportingRequestType).Equal(*y.LocationReportingRequestType)) && + locationReport.messageMeta.Equal(y.messageMeta) +} + +func (locationReportingControl LocationReportingControl) Equal(y LocationReportingControl) bool { + return locationReportingControl.AMFUENGAPID == y.AMFUENGAPID && + locationReportingControl.RANUENGAPID == y.RANUENGAPID && + (locationReportingControl.LocationReportingRequestType == nil) == (y.LocationReportingRequestType == nil) && (locationReportingControl.LocationReportingRequestType == nil || (*locationReportingControl.LocationReportingRequestType).Equal(*y.LocationReportingRequestType)) && + locationReportingControl.messageMeta.Equal(y.messageMeta) +} + +func (locationReportingRequestType LocationReportingRequestType) Equal(y LocationReportingRequestType) bool { + return locationReportingRequestType.EventType == y.EventType && + locationReportingRequestType.ReportArea == y.ReportArea && + (locationReportingRequestType.AreaOfInterestList == nil) == (y.AreaOfInterestList == nil) && locationReportingRequestType.AreaOfInterestList.Equal(y.AreaOfInterestList) && + (locationReportingRequestType.LocationReportingReferenceIDToBeCancelled == nil) == (y.LocationReportingReferenceIDToBeCancelled == nil) && (locationReportingRequestType.LocationReportingReferenceIDToBeCancelled == nil || (*locationReportingRequestType.LocationReportingReferenceIDToBeCancelled) == *y.LocationReportingReferenceIDToBeCancelled) && + (locationReportingRequestType.LocationReportingAdditionalInfo == nil) == (y.LocationReportingAdditionalInfo == nil) && (locationReportingRequestType.LocationReportingAdditionalInfo == nil || (*locationReportingRequestType.LocationReportingAdditionalInfo) == *y.LocationReportingAdditionalInfo) && + locationReportingRequestType.AdditionalCancelledlocationReportingReferenceIDList.Equal(y.AdditionalCancelledlocationReportingReferenceIDList) && + locationReportingRequestType.AerialUEFlightInformationReportingControlList.Equal(y.AerialUEFlightInformationReportingControlList) && + locationReportingRequestType.iEExtensions == y.iEExtensions && + locationReportingRequestType.extensions == y.extensions +} + +func (loggedMDTNr LoggedMDTNr) Equal(y LoggedMDTNr) bool { + return loggedMDTNr.LoggingInterval == y.LoggingInterval && + loggedMDTNr.LoggingDuration == y.LoggingDuration && + loggedMDTNr.LoggedMDTTrigger.Equal(y.LoggedMDTTrigger) && + (loggedMDTNr.BluetoothMeasurementConfiguration == nil) == (y.BluetoothMeasurementConfiguration == nil) && (loggedMDTNr.BluetoothMeasurementConfiguration == nil || (*loggedMDTNr.BluetoothMeasurementConfiguration).Equal(*y.BluetoothMeasurementConfiguration)) && + (loggedMDTNr.WLANMeasurementConfiguration == nil) == (y.WLANMeasurementConfiguration == nil) && (loggedMDTNr.WLANMeasurementConfiguration == nil || (*loggedMDTNr.WLANMeasurementConfiguration).Equal(*y.WLANMeasurementConfiguration)) && + (loggedMDTNr.SensorMeasurementConfiguration == nil) == (y.SensorMeasurementConfiguration == nil) && (loggedMDTNr.SensorMeasurementConfiguration == nil || (*loggedMDTNr.SensorMeasurementConfiguration).Equal(*y.SensorMeasurementConfiguration)) && + (loggedMDTNr.AreaScopeOfNeighCellsList == nil) == (y.AreaScopeOfNeighCellsList == nil) && loggedMDTNr.AreaScopeOfNeighCellsList.Equal(y.AreaScopeOfNeighCellsList) && + (loggedMDTNr.EarlyMeasurement == nil) == (y.EarlyMeasurement == nil) && (loggedMDTNr.EarlyMeasurement == nil || (*loggedMDTNr.EarlyMeasurement) == *y.EarlyMeasurement) && + loggedMDTNr.iEExtensions == y.iEExtensions && + loggedMDTNr.extensions == y.extensions +} + +func (loggedMDTTrigger LoggedMDTTrigger) Equal(y LoggedMDTTrigger) bool { + return (loggedMDTTrigger.Periodical == nil) == (y.Periodical == nil) && (loggedMDTTrigger.Periodical == nil || (*loggedMDTTrigger.Periodical) == *y.Periodical) && + (loggedMDTTrigger.EventTrigger == nil) == (y.EventTrigger == nil) && (loggedMDTTrigger.EventTrigger == nil || (*loggedMDTTrigger.EventTrigger).Equal(*y.EventTrigger)) && + (loggedMDTTrigger.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (loggedMDTTrigger.ChoiceExtension == nil || (*loggedMDTTrigger.ChoiceExtension) == *y.ChoiceExtension) +} + +func (m1Configuration M1Configuration) Equal(y M1Configuration) bool { + return m1Configuration.M1reportingTrigger == y.M1reportingTrigger && + (m1Configuration.M1thresholdEventA2 == nil) == (y.M1thresholdEventA2 == nil) && (m1Configuration.M1thresholdEventA2 == nil || (*m1Configuration.M1thresholdEventA2).Equal(*y.M1thresholdEventA2)) && + (m1Configuration.M1periodicReporting == nil) == (y.M1periodicReporting == nil) && (m1Configuration.M1periodicReporting == nil || (*m1Configuration.M1periodicReporting).Equal(*y.M1periodicReporting)) && + (m1Configuration.IncludeBeamMeasurementsIndication == nil) == (y.IncludeBeamMeasurementsIndication == nil) && (m1Configuration.IncludeBeamMeasurementsIndication == nil || (*m1Configuration.IncludeBeamMeasurementsIndication) == *y.IncludeBeamMeasurementsIndication) && + (m1Configuration.BeamMeasurementsReportConfiguration == nil) == (y.BeamMeasurementsReportConfiguration == nil) && (m1Configuration.BeamMeasurementsReportConfiguration == nil || (*m1Configuration.BeamMeasurementsReportConfiguration).Equal(*y.BeamMeasurementsReportConfiguration)) && + m1Configuration.iEExtensions == y.iEExtensions && + m1Configuration.extensions == y.extensions +} + +func (m1PeriodicReporting M1PeriodicReporting) Equal(y M1PeriodicReporting) bool { + return m1PeriodicReporting.ReportInterval == y.ReportInterval && + m1PeriodicReporting.ReportAmount == y.ReportAmount && + (m1PeriodicReporting.ExtendedReportIntervalMDT == nil) == (y.ExtendedReportIntervalMDT == nil) && (m1PeriodicReporting.ExtendedReportIntervalMDT == nil || (*m1PeriodicReporting.ExtendedReportIntervalMDT) == *y.ExtendedReportIntervalMDT) && + m1PeriodicReporting.iEExtensions == y.iEExtensions && + m1PeriodicReporting.extensions == y.extensions +} + +func (m1ThresholdEventA2 M1ThresholdEventA2) Equal(y M1ThresholdEventA2) bool { + return m1ThresholdEventA2.M1ThresholdType.Equal(y.M1ThresholdType) && + m1ThresholdEventA2.iEExtensions == y.iEExtensions && + m1ThresholdEventA2.extensions == y.extensions +} + +func (m1ThresholdType M1ThresholdType) Equal(y M1ThresholdType) bool { + return (m1ThresholdType.ThresholdRSRP == nil) == (y.ThresholdRSRP == nil) && (m1ThresholdType.ThresholdRSRP == nil || (*m1ThresholdType.ThresholdRSRP) == *y.ThresholdRSRP) && + (m1ThresholdType.ThresholdRSRQ == nil) == (y.ThresholdRSRQ == nil) && (m1ThresholdType.ThresholdRSRQ == nil || (*m1ThresholdType.ThresholdRSRQ) == *y.ThresholdRSRQ) && + (m1ThresholdType.ThresholdSINR == nil) == (y.ThresholdSINR == nil) && (m1ThresholdType.ThresholdSINR == nil || (*m1ThresholdType.ThresholdSINR) == *y.ThresholdSINR) && + (m1ThresholdType.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (m1ThresholdType.ChoiceExtension == nil || (*m1ThresholdType.ChoiceExtension) == *y.ChoiceExtension) +} + +func (m4Configuration M4Configuration) Equal(y M4Configuration) bool { + return m4Configuration.M4period == y.M4period && + m4Configuration.M4linkstolog == y.M4linkstolog && + (m4Configuration.M4ReportAmount == nil) == (y.M4ReportAmount == nil) && (m4Configuration.M4ReportAmount == nil || (*m4Configuration.M4ReportAmount) == *y.M4ReportAmount) && + m4Configuration.iEExtensions == y.iEExtensions && + m4Configuration.extensions == y.extensions +} + +func (m5Configuration M5Configuration) Equal(y M5Configuration) bool { + return m5Configuration.M5period == y.M5period && + m5Configuration.M5linkstolog == y.M5linkstolog && + (m5Configuration.M5ReportAmount == nil) == (y.M5ReportAmount == nil) && (m5Configuration.M5ReportAmount == nil || (*m5Configuration.M5ReportAmount) == *y.M5ReportAmount) && + m5Configuration.iEExtensions == y.iEExtensions && + m5Configuration.extensions == y.extensions +} + +func (m6Configuration M6Configuration) Equal(y M6Configuration) bool { + return m6Configuration.M6reportInterval == y.M6reportInterval && + m6Configuration.M6linkstolog == y.M6linkstolog && + (m6Configuration.M6ReportAmount == nil) == (y.M6ReportAmount == nil) && (m6Configuration.M6ReportAmount == nil || (*m6Configuration.M6ReportAmount) == *y.M6ReportAmount) && + m6Configuration.ExcessPacketDelayThresholdConfiguration.Equal(y.ExcessPacketDelayThresholdConfiguration) && + m6Configuration.iEExtensions == y.iEExtensions && + m6Configuration.extensions == y.extensions +} + +func (m7Configuration M7Configuration) Equal(y M7Configuration) bool { + return m7Configuration.M7period == y.M7period && + m7Configuration.M7linkstolog == y.M7linkstolog && + (m7Configuration.M7ReportAmount == nil) == (y.M7ReportAmount == nil) && (m7Configuration.M7ReportAmount == nil || (*m7Configuration.M7ReportAmount) == *y.M7ReportAmount) && + m7Configuration.iEExtensions == y.iEExtensions && + m7Configuration.extensions == y.extensions +} + +func (mBSActiveSessionInformationSourcetoTargetItem MBSActiveSessionInformationSourcetoTargetItem) Equal(y MBSActiveSessionInformationSourcetoTargetItem) bool { + return mBSActiveSessionInformationSourcetoTargetItem.MBSSessionID.Equal(y.MBSSessionID) && + (mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID == nil) == (y.MBSAreaSessionID == nil) && (mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID == nil || (*mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID) == *y.MBSAreaSessionID) && + (mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea == nil) == (y.MBSServiceArea == nil) && (mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea == nil || (*mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea).Equal(*y.MBSServiceArea)) && + mBSActiveSessionInformationSourcetoTargetItem.MBSQoSFlowsToBeSetupList.Equal(y.MBSQoSFlowsToBeSetupList) && + (mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList == nil) == (y.MBSMappingandDataForwardingRequestList == nil) && mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList.Equal(y.MBSMappingandDataForwardingRequestList) && + mBSActiveSessionInformationSourcetoTargetItem.iEExtensions == y.iEExtensions && + mBSActiveSessionInformationSourcetoTargetItem.extensions == y.extensions +} + +func (mBSActiveSessionInformationSourcetoTargetList MBSActiveSessionInformationSourcetoTargetList) Equal(y MBSActiveSessionInformationSourcetoTargetList) bool { + if len(mBSActiveSessionInformationSourcetoTargetList) != len(y) { + return false + } + for i := range mBSActiveSessionInformationSourcetoTargetList { + if !(mBSActiveSessionInformationSourcetoTargetList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSIntendedServiceAreaList MBSIntendedServiceAreaList) Equal(y MBSIntendedServiceAreaList) bool { + if len(mBSIntendedServiceAreaList) != len(y) { + return false + } + for i := range mBSIntendedServiceAreaList { + if !(mBSIntendedServiceAreaList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSMappingandDataForwardingRequestItem MBSMappingandDataForwardingRequestItem) Equal(y MBSMappingandDataForwardingRequestItem) bool { + return mBSMappingandDataForwardingRequestItem.MRBID == y.MRBID && + mBSMappingandDataForwardingRequestItem.MBSQoSFlowList.Equal(y.MBSQoSFlowList) && + (mBSMappingandDataForwardingRequestItem.MRBProgressInformation == nil) == (y.MRBProgressInformation == nil) && (mBSMappingandDataForwardingRequestItem.MRBProgressInformation == nil || (*mBSMappingandDataForwardingRequestItem.MRBProgressInformation).Equal(*y.MRBProgressInformation)) && + mBSMappingandDataForwardingRequestItem.iEExtensions == y.iEExtensions && + mBSMappingandDataForwardingRequestItem.extensions == y.extensions +} + +func (mBSMappingandDataForwardingRequestList MBSMappingandDataForwardingRequestList) Equal(y MBSMappingandDataForwardingRequestList) bool { + if len(mBSMappingandDataForwardingRequestList) != len(y) { + return false + } + for i := range mBSMappingandDataForwardingRequestList { + if !(mBSMappingandDataForwardingRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSQoSFlowList MBSQoSFlowList) Equal(y MBSQoSFlowList) bool { + if len(mBSQoSFlowList) != len(y) { + return false + } + for i := range mBSQoSFlowList { + if !(mBSQoSFlowList[i] == y[i]) { + return false + } + } + return true +} + +func (mBSQoSFlowsToBeSetupItem MBSQoSFlowsToBeSetupItem) Equal(y MBSQoSFlowsToBeSetupItem) bool { + return mBSQoSFlowsToBeSetupItem.MBSqosFlowIdentifier == y.MBSqosFlowIdentifier && + mBSQoSFlowsToBeSetupItem.MBSqosFlowLevelQosParameters.Equal(y.MBSqosFlowLevelQosParameters) && + mBSQoSFlowsToBeSetupItem.iEExtensions == y.iEExtensions && + mBSQoSFlowsToBeSetupItem.extensions == y.extensions +} + +func (mBSQoSFlowsToBeSetupList MBSQoSFlowsToBeSetupList) Equal(y MBSQoSFlowsToBeSetupList) bool { + if len(mBSQoSFlowsToBeSetupList) != len(y) { + return false + } + for i := range mBSQoSFlowsToBeSetupList { + if !(mBSQoSFlowsToBeSetupList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSServiceArea MBSServiceArea) Equal(y MBSServiceArea) bool { + return (mBSServiceArea.Locationindependent == nil) == (y.Locationindependent == nil) && (mBSServiceArea.Locationindependent == nil || (*mBSServiceArea.Locationindependent).Equal(*y.Locationindependent)) && + (mBSServiceArea.Locationdependent == nil) == (y.Locationdependent == nil) && (mBSServiceArea.Locationdependent == nil || (*mBSServiceArea.Locationdependent).Equal(*y.Locationdependent)) && + (mBSServiceArea.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (mBSServiceArea.ChoiceExtension == nil || (*mBSServiceArea.ChoiceExtension) == *y.ChoiceExtension) +} + +func (mBSServiceAreaCellList MBSServiceAreaCellList) Equal(y MBSServiceAreaCellList) bool { + if len(mBSServiceAreaCellList) != len(y) { + return false + } + for i := range mBSServiceAreaCellList { + if !(mBSServiceAreaCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSServiceAreaInformation MBSServiceAreaInformation) Equal(y MBSServiceAreaInformation) bool { + return (mBSServiceAreaInformation.MBSServiceAreaCellList == nil) == (y.MBSServiceAreaCellList == nil) && mBSServiceAreaInformation.MBSServiceAreaCellList.Equal(y.MBSServiceAreaCellList) && + (mBSServiceAreaInformation.MBSServiceAreaTAIList == nil) == (y.MBSServiceAreaTAIList == nil) && mBSServiceAreaInformation.MBSServiceAreaTAIList.Equal(y.MBSServiceAreaTAIList) && + mBSServiceAreaInformation.MBSIntendedServiceAreaList.Equal(y.MBSIntendedServiceAreaList) && + mBSServiceAreaInformation.iEExtensions == y.iEExtensions && + mBSServiceAreaInformation.extensions == y.extensions +} + +func (mBSServiceAreaInformationItem MBSServiceAreaInformationItem) Equal(y MBSServiceAreaInformationItem) bool { + return mBSServiceAreaInformationItem.MBSAreaSessionID == y.MBSAreaSessionID && + mBSServiceAreaInformationItem.MBSServiceAreaInformation.Equal(y.MBSServiceAreaInformation) && + mBSServiceAreaInformationItem.iEExtensions == y.iEExtensions && + mBSServiceAreaInformationItem.extensions == y.extensions +} + +func (mBSServiceAreaInformationList MBSServiceAreaInformationList) Equal(y MBSServiceAreaInformationList) bool { + if len(mBSServiceAreaInformationList) != len(y) { + return false + } + for i := range mBSServiceAreaInformationList { + if !(mBSServiceAreaInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSServiceAreaTAIList MBSServiceAreaTAIList) Equal(y MBSServiceAreaTAIList) bool { + if len(mBSServiceAreaTAIList) != len(y) { + return false + } + for i := range mBSServiceAreaTAIList { + if !(mBSServiceAreaTAIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSSessionFailedtoSetupItem MBSSessionFailedtoSetupItem) Equal(y MBSSessionFailedtoSetupItem) bool { + return mBSSessionFailedtoSetupItem.MBSSessionID.Equal(y.MBSSessionID) && + (mBSSessionFailedtoSetupItem.MBSAreaSessionID == nil) == (y.MBSAreaSessionID == nil) && (mBSSessionFailedtoSetupItem.MBSAreaSessionID == nil || (*mBSSessionFailedtoSetupItem.MBSAreaSessionID) == *y.MBSAreaSessionID) && + mBSSessionFailedtoSetupItem.Cause.Equal(y.Cause) && + mBSSessionFailedtoSetupItem.iEExtensions == y.iEExtensions && + mBSSessionFailedtoSetupItem.extensions == y.extensions +} + +func (mBSSessionFailedtoSetupList MBSSessionFailedtoSetupList) Equal(y MBSSessionFailedtoSetupList) bool { + if len(mBSSessionFailedtoSetupList) != len(y) { + return false + } + for i := range mBSSessionFailedtoSetupList { + if !(mBSSessionFailedtoSetupList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSSessionID MBSSessionID) Equal(y MBSSessionID) bool { + return mBSSessionID.TMGI.Equal(y.TMGI) && + (mBSSessionID.NID == nil) == (y.NID == nil) && (mBSSessionID.NID == nil || (*mBSSessionID.NID) == *y.NID) && + mBSSessionID.iEExtensions == y.iEExtensions && + mBSSessionID.extensions == y.extensions +} + +func (mBSSessionSetupRequestItem MBSSessionSetupRequestItem) Equal(y MBSSessionSetupRequestItem) bool { + return mBSSessionSetupRequestItem.MBSSessionID.Equal(y.MBSSessionID) && + (mBSSessionSetupRequestItem.MBSAreaSessionID == nil) == (y.MBSAreaSessionID == nil) && (mBSSessionSetupRequestItem.MBSAreaSessionID == nil || (*mBSSessionSetupRequestItem.MBSAreaSessionID) == *y.MBSAreaSessionID) && + (mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList == nil) == (y.AssociatedMBSQosFlowSetupRequestList == nil) && mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList.Equal(y.AssociatedMBSQosFlowSetupRequestList) && + (mBSSessionSetupRequestItem.MBSAssistanceInformation == nil) == (y.MBSAssistanceInformation == nil) && (mBSSessionSetupRequestItem.MBSAssistanceInformation == nil || (*mBSSessionSetupRequestItem.MBSAssistanceInformation) == *y.MBSAssistanceInformation) && + mBSSessionSetupRequestItem.iEExtensions == y.iEExtensions && + mBSSessionSetupRequestItem.extensions == y.extensions +} + +func (mBSSessionSetupRequestList MBSSessionSetupRequestList) Equal(y MBSSessionSetupRequestList) bool { + if len(mBSSessionSetupRequestList) != len(y) { + return false + } + for i := range mBSSessionSetupRequestList { + if !(mBSSessionSetupRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSSessionSetupResponseItem MBSSessionSetupResponseItem) Equal(y MBSSessionSetupResponseItem) bool { + return mBSSessionSetupResponseItem.MBSSessionID.Equal(y.MBSSessionID) && + (mBSSessionSetupResponseItem.MBSAreaSessionID == nil) == (y.MBSAreaSessionID == nil) && (mBSSessionSetupResponseItem.MBSAreaSessionID == nil || (*mBSSessionSetupResponseItem.MBSAreaSessionID) == *y.MBSAreaSessionID) && + mBSSessionSetupResponseItem.iEExtensions == y.iEExtensions && + mBSSessionSetupResponseItem.extensions == y.extensions +} + +func (mBSSessionSetupResponseList MBSSessionSetupResponseList) Equal(y MBSSessionSetupResponseList) bool { + if len(mBSSessionSetupResponseList) != len(y) { + return false + } + for i := range mBSSessionSetupResponseList { + if !(mBSSessionSetupResponseList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSSessionSetuporModifyRequestItem MBSSessionSetuporModifyRequestItem) Equal(y MBSSessionSetuporModifyRequestItem) bool { + return mBSSessionSetuporModifyRequestItem.MBSSessionID.Equal(y.MBSSessionID) && + (mBSSessionSetuporModifyRequestItem.MBSAreaSessionID == nil) == (y.MBSAreaSessionID == nil) && (mBSSessionSetuporModifyRequestItem.MBSAreaSessionID == nil || (*mBSSessionSetuporModifyRequestItem.MBSAreaSessionID) == *y.MBSAreaSessionID) && + (mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList == nil) == (y.AssociatedMBSQosFlowSetuporModifyRequestList == nil) && mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList.Equal(y.AssociatedMBSQosFlowSetuporModifyRequestList) && + (mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList == nil) == (y.MBSQosFlowToReleaseList == nil) && mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList.Equal(y.MBSQosFlowToReleaseList) && + (mBSSessionSetuporModifyRequestItem.MBSAssistanceInformation == nil) == (y.MBSAssistanceInformation == nil) && (mBSSessionSetuporModifyRequestItem.MBSAssistanceInformation == nil || (*mBSSessionSetuporModifyRequestItem.MBSAssistanceInformation) == *y.MBSAssistanceInformation) && + mBSSessionSetuporModifyRequestItem.iEExtensions == y.iEExtensions && + mBSSessionSetuporModifyRequestItem.extensions == y.extensions +} + +func (mBSSessionSetuporModifyRequestList MBSSessionSetuporModifyRequestList) Equal(y MBSSessionSetuporModifyRequestList) bool { + if len(mBSSessionSetuporModifyRequestList) != len(y) { + return false + } + for i := range mBSSessionSetuporModifyRequestList { + if !(mBSSessionSetuporModifyRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mBSSessionToReleaseItem MBSSessionToReleaseItem) Equal(y MBSSessionToReleaseItem) bool { + return mBSSessionToReleaseItem.MBSSessionID.Equal(y.MBSSessionID) && + mBSSessionToReleaseItem.Cause.Equal(y.Cause) && + mBSSessionToReleaseItem.iEExtensions == y.iEExtensions && + mBSSessionToReleaseItem.extensions == y.extensions +} + +func (mBSSessionToReleaseList MBSSessionToReleaseList) Equal(y MBSSessionToReleaseList) bool { + if len(mBSSessionToReleaseList) != len(y) { + return false + } + for i := range mBSSessionToReleaseList { + if !(mBSSessionToReleaseList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (mDTAlignmentInfo MDTAlignmentInfo) Equal(y MDTAlignmentInfo) bool { + return (mDTAlignmentInfo.SbasedMDT == nil) == (y.SbasedMDT == nil) && (mDTAlignmentInfo.SbasedMDT == nil || (*mDTAlignmentInfo.SbasedMDT) == *y.SbasedMDT) && + (mDTAlignmentInfo.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (mDTAlignmentInfo.ChoiceExtension == nil || (*mDTAlignmentInfo.ChoiceExtension) == *y.ChoiceExtension) +} + +func (mDTConfiguration MDTConfiguration) Equal(y MDTConfiguration) bool { + return (mDTConfiguration.MdtConfigNR == nil) == (y.MdtConfigNR == nil) && (mDTConfiguration.MdtConfigNR == nil || (*mDTConfiguration.MdtConfigNR).Equal(*y.MdtConfigNR)) && + (mDTConfiguration.MdtConfigEUTRA == nil) == (y.MdtConfigEUTRA == nil) && (mDTConfiguration.MdtConfigEUTRA == nil || (*mDTConfiguration.MdtConfigEUTRA).Equal(*y.MdtConfigEUTRA)) && + (mDTConfiguration.MNonlyMDTcollection == nil) == (y.MNonlyMDTcollection == nil) && (mDTConfiguration.MNonlyMDTcollection == nil || (*mDTConfiguration.MNonlyMDTcollection) == *y.MNonlyMDTcollection) && + mDTConfiguration.iEExtensions == y.iEExtensions && + mDTConfiguration.extensions == y.extensions +} + +func (mDTConfigurationEUTRA MDTConfigurationEUTRA) Equal(y MDTConfigurationEUTRA) bool { + return mDTConfigurationEUTRA.MdtActivation == y.MdtActivation && + mDTConfigurationEUTRA.AreaScopeOfMDT.Equal(y.AreaScopeOfMDT) && + mDTConfigurationEUTRA.MDTMode.Equal(y.MDTMode) && + (mDTConfigurationEUTRA.SignallingBasedMDTPLMNList == nil) == (y.SignallingBasedMDTPLMNList == nil) && mDTConfigurationEUTRA.SignallingBasedMDTPLMNList.Equal(y.SignallingBasedMDTPLMNList) && + mDTConfigurationEUTRA.iEExtensions == y.iEExtensions && + mDTConfigurationEUTRA.extensions == y.extensions +} + +func (mDTConfigurationNR MDTConfigurationNR) Equal(y MDTConfigurationNR) bool { + return mDTConfigurationNR.MdtActivation == y.MdtActivation && + mDTConfigurationNR.AreaScopeOfMDT.Equal(y.AreaScopeOfMDT) && + mDTConfigurationNR.MDTModeNr.Equal(y.MDTModeNr) && + (mDTConfigurationNR.SignallingBasedMDTPLMNList == nil) == (y.SignallingBasedMDTPLMNList == nil) && mDTConfigurationNR.SignallingBasedMDTPLMNList.Equal(y.SignallingBasedMDTPLMNList) && + (mDTConfigurationNR.PNINPNAreaScopeofMDT == nil) == (y.PNINPNAreaScopeofMDT == nil) && (mDTConfigurationNR.PNINPNAreaScopeofMDT == nil || (*mDTConfigurationNR.PNINPNAreaScopeofMDT).Equal(*y.PNINPNAreaScopeofMDT)) && + (mDTConfigurationNR.NetworkSliceAreaScopeofMDT == nil) == (y.NetworkSliceAreaScopeofMDT == nil) && (mDTConfigurationNR.NetworkSliceAreaScopeofMDT == nil || (*mDTConfigurationNR.NetworkSliceAreaScopeofMDT).Equal(*y.NetworkSliceAreaScopeofMDT)) && + mDTConfigurationNR.iEExtensions == y.iEExtensions && + mDTConfigurationNR.extensions == y.extensions +} + +func (mDTLocationInfo MDTLocationInfo) Equal(y MDTLocationInfo) bool { + return mDTLocationInfo == y +} + +func (mDTModeEutra MDTModeEutra) Equal(y MDTModeEutra) bool { + if len(mDTModeEutra) != len(y) { + return false + } + for i := range mDTModeEutra { + if !(mDTModeEutra[i] == y[i]) { + return false + } + } + return true +} + +func (mDTModeNr MDTModeNr) Equal(y MDTModeNr) bool { + return (mDTModeNr.ImmediateMDTNr == nil) == (y.ImmediateMDTNr == nil) && (mDTModeNr.ImmediateMDTNr == nil || (*mDTModeNr.ImmediateMDTNr).Equal(*y.ImmediateMDTNr)) && + (mDTModeNr.LoggedMDTNr == nil) == (y.LoggedMDTNr == nil) && (mDTModeNr.LoggedMDTNr == nil || (*mDTModeNr.LoggedMDTNr).Equal(*y.LoggedMDTNr)) && + (mDTModeNr.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (mDTModeNr.ChoiceExtension == nil || (*mDTModeNr.ChoiceExtension) == *y.ChoiceExtension) +} + +func (mDTPLMNList MDTPLMNList) Equal(y MDTPLMNList) bool { + if len(mDTPLMNList) != len(y) { + return false + } + for i := range mDTPLMNList { + if !(mDTPLMNList[i] == y[i]) { + return false + } + } + return true +} + +func (mDTPLMNModificationList MDTPLMNModificationList) Equal(y MDTPLMNModificationList) bool { + if len(mDTPLMNModificationList) != len(y) { + return false + } + for i := range mDTPLMNModificationList { + if !(mDTPLMNModificationList[i] == y[i]) { + return false + } + } + return true +} + +func (mDTcircle MDTcircle) Equal(y MDTcircle) bool { + return mDTcircle.Referencelocation.Equal(y.Referencelocation) && + mDTcircle.Distanceradius == y.Distanceradius && + mDTcircle.iEExtensions == y.iEExtensions && + mDTcircle.extensions == y.extensions +} + +func (mDTcircleReferencelocation MDTcircleReferencelocation) Equal(y MDTcircleReferencelocation) bool { + if len(mDTcircleReferencelocation) != len(y) { + return false + } + for i := range mDTcircleReferencelocation { + if !(mDTcircleReferencelocation[i] == y[i]) { + return false + } + } + return true +} + +func (mDTpolygon MDTpolygon) Equal(y MDTpolygon) bool { + if len(mDTpolygon) != len(y) { + return false + } + for i := range mDTpolygon { + if !(mDTpolygon[i] == y[i]) { + return false + } + } + return true +} + +func (mMSID MMSID) Equal(y MMSID) bool { + if len(mMSID) != len(y) { + return false + } + for i := range mMSID { + if !(mMSID[i] == y[i]) { + return false + } + } + return true +} + +func (mRBProgressInformation MRBProgressInformation) Equal(y MRBProgressInformation) bool { + return (mRBProgressInformation.PDCPSNLength12 == nil) == (y.PDCPSNLength12 == nil) && (mRBProgressInformation.PDCPSNLength12 == nil || (*mRBProgressInformation.PDCPSNLength12) == *y.PDCPSNLength12) && + (mRBProgressInformation.PDCPSNLength18 == nil) == (y.PDCPSNLength18 == nil) && (mRBProgressInformation.PDCPSNLength18 == nil || (*mRBProgressInformation.PDCPSNLength18) == *y.PDCPSNLength18) && + (mRBProgressInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (mRBProgressInformation.ChoiceExtension == nil || (*mRBProgressInformation.ChoiceExtension) == *y.ChoiceExtension) +} + +func (measurementThresholdL1LoggedMDT MeasurementThresholdL1LoggedMDT) Equal(y MeasurementThresholdL1LoggedMDT) bool { + return (measurementThresholdL1LoggedMDT.ThresholdRSRP == nil) == (y.ThresholdRSRP == nil) && (measurementThresholdL1LoggedMDT.ThresholdRSRP == nil || (*measurementThresholdL1LoggedMDT.ThresholdRSRP) == *y.ThresholdRSRP) && + (measurementThresholdL1LoggedMDT.ThresholdRSRQ == nil) == (y.ThresholdRSRQ == nil) && (measurementThresholdL1LoggedMDT.ThresholdRSRQ == nil || (*measurementThresholdL1LoggedMDT.ThresholdRSRQ) == *y.ThresholdRSRQ) && + (measurementThresholdL1LoggedMDT.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (measurementThresholdL1LoggedMDT.ChoiceExtension == nil || (*measurementThresholdL1LoggedMDT.ChoiceExtension) == *y.ChoiceExtension) +} + +func (mobileIABMTUserLocationInformation MobileIABMTUserLocationInformation) Equal(y MobileIABMTUserLocationInformation) bool { + return mobileIABMTUserLocationInformation == y +} + +func (mobilityRestrictionList MobilityRestrictionList) Equal(y MobilityRestrictionList) bool { + return mobilityRestrictionList.extensions == y.extensions && + mobilityRestrictionList.ServingPLMN == y.ServingPLMN && + (mobilityRestrictionList.EquivalentPLMNs == nil) == (y.EquivalentPLMNs == nil) && mobilityRestrictionList.EquivalentPLMNs.Equal(y.EquivalentPLMNs) && + (mobilityRestrictionList.RATRestrictions == nil) == (y.RATRestrictions == nil) && mobilityRestrictionList.RATRestrictions.Equal(y.RATRestrictions) && + (mobilityRestrictionList.ForbiddenAreaInformation == nil) == (y.ForbiddenAreaInformation == nil) && mobilityRestrictionList.ForbiddenAreaInformation.Equal(y.ForbiddenAreaInformation) && + (mobilityRestrictionList.ServiceAreaInformation == nil) == (y.ServiceAreaInformation == nil) && mobilityRestrictionList.ServiceAreaInformation.Equal(y.ServiceAreaInformation) && + (mobilityRestrictionList.LastEUTRANPLMNIdentity == nil) == (y.LastEUTRANPLMNIdentity == nil) && (mobilityRestrictionList.LastEUTRANPLMNIdentity == nil || (*mobilityRestrictionList.LastEUTRANPLMNIdentity) == *y.LastEUTRANPLMNIdentity) && + (mobilityRestrictionList.CNTypeRestrictionsForServing == nil) == (y.CNTypeRestrictionsForServing == nil) && (mobilityRestrictionList.CNTypeRestrictionsForServing == nil || (*mobilityRestrictionList.CNTypeRestrictionsForServing) == *y.CNTypeRestrictionsForServing) && + mobilityRestrictionList.CNTypeRestrictionsForEquivalent.Equal(y.CNTypeRestrictionsForEquivalent) && + (mobilityRestrictionList.NPNMobilityInformation == nil) == (y.NPNMobilityInformation == nil) && (mobilityRestrictionList.NPNMobilityInformation == nil || (*mobilityRestrictionList.NPNMobilityInformation).Equal(*y.NPNMobilityInformation)) && + mobilityRestrictionList.iEExtensions == y.iEExtensions +} + +func (monitoringRequestonAvailableBitrate MonitoringRequestonAvailableBitrate) Equal(y MonitoringRequestonAvailableBitrate) bool { + return monitoringRequestonAvailableBitrate.MonitoringRequest == y.MonitoringRequest && + (monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds == nil) == (y.DlAvailableBitrateReportThresholds == nil) && monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds.Equal(y.DlAvailableBitrateReportThresholds) && + (monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds == nil) == (y.UlAvailableBitrateReportThresholds == nil) && monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds.Equal(y.UlAvailableBitrateReportThresholds) && + monitoringRequestonAvailableBitrate.iEExtensions == y.iEExtensions && + monitoringRequestonAvailableBitrate.extensions == y.extensions +} + +func (n3IWFID N3IWFID) Equal(y N3IWFID) bool { + return (n3IWFID.N3IWFID == nil) == (y.N3IWFID == nil) && (n3IWFID.N3IWFID == nil || (*n3IWFID.N3IWFID) == *y.N3IWFID) && + (n3IWFID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (n3IWFID.ChoiceExtension == nil || (*n3IWFID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (n6JitterInformation N6JitterInformation) Equal(y N6JitterInformation) bool { + return n6JitterInformation == y +} + +func (nASNonDeliveryIndication NASNonDeliveryIndication) Equal(y NASNonDeliveryIndication) bool { + return nASNonDeliveryIndication.AMFUENGAPID == y.AMFUENGAPID && + nASNonDeliveryIndication.RANUENGAPID == y.RANUENGAPID && + nASNonDeliveryIndication.NASPDU.Equal(y.NASPDU) && + (nASNonDeliveryIndication.Cause == nil) == (y.Cause == nil) && (nASNonDeliveryIndication.Cause == nil || (*nASNonDeliveryIndication.Cause).Equal(*y.Cause)) && + nASNonDeliveryIndication.messageMeta.Equal(y.messageMeta) +} + +func (nASPDU NASPDU) Equal(y NASPDU) bool { + if len(nASPDU) != len(y) { + return false + } + for i := range nASPDU { + if !(nASPDU[i] == y[i]) { + return false + } + } + return true +} + +func (nASSecurityParametersFromNGRAN NASSecurityParametersFromNGRAN) Equal(y NASSecurityParametersFromNGRAN) bool { + if len(nASSecurityParametersFromNGRAN) != len(y) { + return false + } + for i := range nASSecurityParametersFromNGRAN { + if !(nASSecurityParametersFromNGRAN[i] == y[i]) { + return false + } + } + return true +} + +func (nBIoTPagingeDRXInfo NBIoTPagingeDRXInfo) Equal(y NBIoTPagingeDRXInfo) bool { + return nBIoTPagingeDRXInfo.NBIoTPagingeDRXCycle == y.NBIoTPagingeDRXCycle && + (nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow == nil) == (y.NBIoTPagingTimeWindow == nil) && (nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow == nil || (*nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow) == *y.NBIoTPagingTimeWindow) && + nBIoTPagingeDRXInfo.iEExtensions == y.iEExtensions && + nBIoTPagingeDRXInfo.extensions == y.extensions +} + +func (nGAPIESupportInformationRequestItem NGAPIESupportInformationRequestItem) Equal(y NGAPIESupportInformationRequestItem) bool { + return nGAPIESupportInformationRequestItem == y +} + +func (nGAPIESupportInformationRequestList NGAPIESupportInformationRequestList) Equal(y NGAPIESupportInformationRequestList) bool { + if len(nGAPIESupportInformationRequestList) != len(y) { + return false + } + for i := range nGAPIESupportInformationRequestList { + if !(nGAPIESupportInformationRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (nGAPMessage NGAPMessage) Equal(y NGAPMessage) bool { + if len(nGAPMessage) != len(y) { + return false + } + for i := range nGAPMessage { + if !(nGAPMessage[i] == y[i]) { + return false + } + } + return true +} + +func (nGRANCGI NGRANCGI) Equal(y NGRANCGI) bool { + return (nGRANCGI.NRCGI == nil) == (y.NRCGI == nil) && (nGRANCGI.NRCGI == nil || (*nGRANCGI.NRCGI).Equal(*y.NRCGI)) && + (nGRANCGI.EUTRACGI == nil) == (y.EUTRACGI == nil) && (nGRANCGI.EUTRACGI == nil || (*nGRANCGI.EUTRACGI).Equal(*y.EUTRACGI)) && + (nGRANCGI.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (nGRANCGI.ChoiceExtension == nil || (*nGRANCGI.ChoiceExtension) == *y.ChoiceExtension) +} + +func (nGRANCellReportItem NGRANCellReportItem) Equal(y NGRANCellReportItem) bool { + return nGRANCellReportItem.NGRANCGI.Equal(y.NGRANCGI) && + nGRANCellReportItem.NGRANCompositeAvailableCapacityGroup.Equal(y.NGRANCompositeAvailableCapacityGroup) && + (nGRANCellReportItem.NGRANNumberOfActiveUEs == nil) == (y.NGRANNumberOfActiveUEs == nil) && (nGRANCellReportItem.NGRANNumberOfActiveUEs == nil || (*nGRANCellReportItem.NGRANNumberOfActiveUEs) == *y.NGRANNumberOfActiveUEs) && + (nGRANCellReportItem.NGRANNoofRRCConnections == nil) == (y.NGRANNoofRRCConnections == nil) && (nGRANCellReportItem.NGRANNoofRRCConnections == nil || (*nGRANCellReportItem.NGRANNoofRRCConnections) == *y.NGRANNoofRRCConnections) && + (nGRANCellReportItem.NGRANRadioResourceStatus == nil) == (y.NGRANRadioResourceStatus == nil) && (nGRANCellReportItem.NGRANRadioResourceStatus == nil || (*nGRANCellReportItem.NGRANRadioResourceStatus).Equal(*y.NGRANRadioResourceStatus)) && + nGRANCellReportItem.iEExtensions == y.iEExtensions && + nGRANCellReportItem.extensions == y.extensions +} + +func (nGRANCellReportList NGRANCellReportList) Equal(y NGRANCellReportList) bool { + if len(nGRANCellReportList) != len(y) { + return false + } + for i := range nGRANCellReportList { + if !(nGRANCellReportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (nGRANCellToReportItem NGRANCellToReportItem) Equal(y NGRANCellToReportItem) bool { + return nGRANCellToReportItem.NGRANCGI.Equal(y.NGRANCGI) && + nGRANCellToReportItem.iEExtensions == y.iEExtensions && + nGRANCellToReportItem.extensions == y.extensions +} + +func (nGRANCellToReportList NGRANCellToReportList) Equal(y NGRANCellToReportList) bool { + if len(nGRANCellToReportList) != len(y) { + return false + } + for i := range nGRANCellToReportList { + if !(nGRANCellToReportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (nGRANRadioResourceStatus NGRANRadioResourceStatus) Equal(y NGRANRadioResourceStatus) bool { + return nGRANRadioResourceStatus == y +} + +func (nGRANReportingStatusIEs NGRANReportingStatusIEs) Equal(y NGRANReportingStatusIEs) bool { + return nGRANReportingStatusIEs.NGRANCellReportList.Equal(y.NGRANCellReportList) && + nGRANReportingStatusIEs.iEExtensions == y.iEExtensions && + nGRANReportingStatusIEs.extensions == y.extensions +} + +func (nGRANReportingSystemIEs NGRANReportingSystemIEs) Equal(y NGRANReportingSystemIEs) bool { + return nGRANReportingSystemIEs.NGRANCellToReportList.Equal(y.NGRANCellToReportList) && + nGRANReportingSystemIEs.iEExtensions == y.iEExtensions && + nGRANReportingSystemIEs.extensions == y.extensions +} + +func (nGRANTNLAssociationToRemoveItem NGRANTNLAssociationToRemoveItem) Equal(y NGRANTNLAssociationToRemoveItem) bool { + return nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.Equal(y.TNLAssociationTransportLayerAddress) && + (nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF == nil) == (y.TNLAssociationTransportLayerAddressAMF == nil) && (nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF == nil || (*nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF).Equal(*y.TNLAssociationTransportLayerAddressAMF)) && + nGRANTNLAssociationToRemoveItem.iEExtensions == y.iEExtensions +} + +func (nGRANTNLAssociationToRemoveList NGRANTNLAssociationToRemoveList) Equal(y NGRANTNLAssociationToRemoveList) bool { + if len(nGRANTNLAssociationToRemoveList) != len(y) { + return false + } + for i := range nGRANTNLAssociationToRemoveList { + if !(nGRANTNLAssociationToRemoveList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (nGReset NGReset) Equal(y NGReset) bool { + return (nGReset.Cause == nil) == (y.Cause == nil) && (nGReset.Cause == nil || (*nGReset.Cause).Equal(*y.Cause)) && + nGReset.ResetType.Equal(y.ResetType) && + nGReset.messageMeta.Equal(y.messageMeta) +} + +func (nGResetAcknowledge NGResetAcknowledge) Equal(y NGResetAcknowledge) bool { + return nGResetAcknowledge.ConnectionList.Equal(y.ConnectionList) && + (nGResetAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (nGResetAcknowledge.CriticalityDiagnostics == nil || (*nGResetAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + nGResetAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (nGSetupFailure NGSetupFailure) Equal(y NGSetupFailure) bool { + return (nGSetupFailure.Cause == nil) == (y.Cause == nil) && (nGSetupFailure.Cause == nil || (*nGSetupFailure.Cause).Equal(*y.Cause)) && + (nGSetupFailure.TimeToWait == nil) == (y.TimeToWait == nil) && (nGSetupFailure.TimeToWait == nil || (*nGSetupFailure.TimeToWait) == *y.TimeToWait) && + (nGSetupFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (nGSetupFailure.CriticalityDiagnostics == nil || (*nGSetupFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + nGSetupFailure.messageMeta.Equal(y.messageMeta) +} + +func (nGSetupRequest NGSetupRequest) Equal(y NGSetupRequest) bool { + return nGSetupRequest.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + (nGSetupRequest.RANNodeName == nil) == (y.RANNodeName == nil) && (nGSetupRequest.RANNodeName == nil || (*nGSetupRequest.RANNodeName) == *y.RANNodeName) && + nGSetupRequest.SupportedTAList.Equal(y.SupportedTAList) && + (nGSetupRequest.DefaultPagingDRX == nil) == (y.DefaultPagingDRX == nil) && (nGSetupRequest.DefaultPagingDRX == nil || (*nGSetupRequest.DefaultPagingDRX) == *y.DefaultPagingDRX) && + (nGSetupRequest.UERetentionInformation == nil) == (y.UERetentionInformation == nil) && (nGSetupRequest.UERetentionInformation == nil || (*nGSetupRequest.UERetentionInformation) == *y.UERetentionInformation) && + (nGSetupRequest.NBIoTDefaultPagingDRX == nil) == (y.NBIoTDefaultPagingDRX == nil) && (nGSetupRequest.NBIoTDefaultPagingDRX == nil || (*nGSetupRequest.NBIoTDefaultPagingDRX) == *y.NBIoTDefaultPagingDRX) && + (nGSetupRequest.ExtendedRANNodeName == nil) == (y.ExtendedRANNodeName == nil) && (nGSetupRequest.ExtendedRANNodeName == nil || (*nGSetupRequest.ExtendedRANNodeName).Equal(*y.ExtendedRANNodeName)) && + (nGSetupRequest.AIoTSupport == nil) == (y.AIoTSupport == nil) && (nGSetupRequest.AIoTSupport == nil || (*nGSetupRequest.AIoTSupport) == *y.AIoTSupport) && + (nGSetupRequest.AdditionalULI == nil) == (y.AdditionalULI == nil) && (nGSetupRequest.AdditionalULI == nil || (*nGSetupRequest.AdditionalULI).Equal(*y.AdditionalULI)) && + nGSetupRequest.messageMeta.Equal(y.messageMeta) +} + +func (nGSetupResponse NGSetupResponse) Equal(y NGSetupResponse) bool { + return nGSetupResponse.AMFName == y.AMFName && + nGSetupResponse.ServedGUAMIList.Equal(y.ServedGUAMIList) && + (nGSetupResponse.RelativeAMFCapacity == nil) == (y.RelativeAMFCapacity == nil) && (nGSetupResponse.RelativeAMFCapacity == nil || (*nGSetupResponse.RelativeAMFCapacity) == *y.RelativeAMFCapacity) && + nGSetupResponse.PLMNSupportList.Equal(y.PLMNSupportList) && + (nGSetupResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (nGSetupResponse.CriticalityDiagnostics == nil || (*nGSetupResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (nGSetupResponse.UERetentionInformation == nil) == (y.UERetentionInformation == nil) && (nGSetupResponse.UERetentionInformation == nil || (*nGSetupResponse.UERetentionInformation) == *y.UERetentionInformation) && + (nGSetupResponse.ExtendedAMFName == nil) == (y.ExtendedAMFName == nil) && (nGSetupResponse.ExtendedAMFName == nil || (*nGSetupResponse.ExtendedAMFName).Equal(*y.ExtendedAMFName)) && + (nGSetupResponse.IABSupported == nil) == (y.IABSupported == nil) && (nGSetupResponse.IABSupported == nil || (*nGSetupResponse.IABSupported) == *y.IABSupported) && + (nGSetupResponse.MobileIABSupported == nil) == (y.MobileIABSupported == nil) && (nGSetupResponse.MobileIABSupported == nil || (*nGSetupResponse.MobileIABSupported) == *y.MobileIABSupported) && + (nGSetupResponse.AIOTFIdentifier == nil) == (y.AIOTFIdentifier == nil) && (nGSetupResponse.AIOTFIdentifier == nil || (*nGSetupResponse.AIOTFIdentifier).Equal(*y.AIOTFIdentifier)) && + (nGSetupResponse.AIOTFName == nil) == (y.AIOTFName == nil) && (nGSetupResponse.AIOTFName == nil || (*nGSetupResponse.AIOTFName).Equal(*y.AIOTFName)) && + nGSetupResponse.messageMeta.Equal(y.messageMeta) +} + +func (nPNAccessInformation NPNAccessInformation) Equal(y NPNAccessInformation) bool { + return (nPNAccessInformation.PNINPNAccessInformation == nil) == (y.PNINPNAccessInformation == nil) && (nPNAccessInformation.PNINPNAccessInformation == nil || (*nPNAccessInformation.PNINPNAccessInformation).Equal(*y.PNINPNAccessInformation)) && + (nPNAccessInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (nPNAccessInformation.ChoiceExtension == nil || (*nPNAccessInformation.ChoiceExtension) == *y.ChoiceExtension) +} + +func (nPNMobilityInformation NPNMobilityInformation) Equal(y NPNMobilityInformation) bool { + return (nPNMobilityInformation.SNPNMobilityInformation == nil) == (y.SNPNMobilityInformation == nil) && (nPNMobilityInformation.SNPNMobilityInformation == nil || (*nPNMobilityInformation.SNPNMobilityInformation).Equal(*y.SNPNMobilityInformation)) && + (nPNMobilityInformation.PNINPNMobilityInformation == nil) == (y.PNINPNMobilityInformation == nil) && (nPNMobilityInformation.PNINPNMobilityInformation == nil || (*nPNMobilityInformation.PNINPNMobilityInformation).Equal(*y.PNINPNMobilityInformation)) && + (nPNMobilityInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (nPNMobilityInformation.ChoiceExtension == nil || (*nPNMobilityInformation.ChoiceExtension) == *y.ChoiceExtension) +} + +func (nPNPagingAssistanceInformation NPNPagingAssistanceInformation) Equal(y NPNPagingAssistanceInformation) bool { + return (nPNPagingAssistanceInformation.PNINPNPagingAssistance == nil) == (y.PNINPNPagingAssistance == nil) && (nPNPagingAssistanceInformation.PNINPNPagingAssistance == nil || (*nPNPagingAssistanceInformation.PNINPNPagingAssistance).Equal(*y.PNINPNPagingAssistance)) && + (nPNPagingAssistanceInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (nPNPagingAssistanceInformation.ChoiceExtension == nil || (*nPNPagingAssistanceInformation.ChoiceExtension) == *y.ChoiceExtension) +} + +func (nPNSupport NPNSupport) Equal(y NPNSupport) bool { + return (nPNSupport.SNPN == nil) == (y.SNPN == nil) && (nPNSupport.SNPN == nil || (*nPNSupport.SNPN) == *y.SNPN) && + (nPNSupport.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (nPNSupport.ChoiceExtension == nil || (*nPNSupport.ChoiceExtension) == *y.ChoiceExtension) +} + +func (nRA2XServicesAuthorized NRA2XServicesAuthorized) Equal(y NRA2XServicesAuthorized) bool { + return (nRA2XServicesAuthorized.AerialUE == nil) == (y.AerialUE == nil) && (nRA2XServicesAuthorized.AerialUE == nil || (*nRA2XServicesAuthorized.AerialUE) == *y.AerialUE) && + (nRA2XServicesAuthorized.AerialControllerUE == nil) == (y.AerialControllerUE == nil) && (nRA2XServicesAuthorized.AerialControllerUE == nil || (*nRA2XServicesAuthorized.AerialControllerUE) == *y.AerialControllerUE) && + nRA2XServicesAuthorized.iEExtensions == y.iEExtensions && + nRA2XServicesAuthorized.extensions == y.extensions +} + +func (nRCGI NRCGI) Equal(y NRCGI) bool { + return nRCGI == y +} + +func (nRCGIList NRCGIList) Equal(y NRCGIList) bool { + if len(nRCGIList) != len(y) { + return false + } + for i := range nRCGIList { + if !(nRCGIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (nRCGIListForWarning NRCGIListForWarning) Equal(y NRCGIListForWarning) bool { + if len(nRCGIListForWarning) != len(y) { + return false + } + for i := range nRCGIListForWarning { + if !(nRCGIListForWarning[i].Equal(y[i])) { + return false + } + } + return true +} + +func (nRFrequencyBandItem NRFrequencyBandItem) Equal(y NRFrequencyBandItem) bool { + return nRFrequencyBandItem == y +} + +func (nRFrequencyBandList NRFrequencyBandList) Equal(y NRFrequencyBandList) bool { + if len(nRFrequencyBandList) != len(y) { + return false + } + for i := range nRFrequencyBandList { + if !(nRFrequencyBandList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (nRFrequencyInfo NRFrequencyInfo) Equal(y NRFrequencyInfo) bool { + return nRFrequencyInfo.NrARFCN == y.NrARFCN && + nRFrequencyInfo.FrequencyBandList.Equal(y.FrequencyBandList) && + nRFrequencyInfo.iEExtensions == y.iEExtensions && + nRFrequencyInfo.extensions == y.extensions +} + +func (nRMobilityHistoryReport NRMobilityHistoryReport) Equal(y NRMobilityHistoryReport) bool { + if len(nRMobilityHistoryReport) != len(y) { + return false + } + for i := range nRMobilityHistoryReport { + if !(nRMobilityHistoryReport[i] == y[i]) { + return false + } + } + return true +} + +func (nRNTNTAIInformation NRNTNTAIInformation) Equal(y NRNTNTAIInformation) bool { + return nRNTNTAIInformation.ServingPLMN == y.ServingPLMN && + nRNTNTAIInformation.TACListInNRNTN.Equal(y.TACListInNRNTN) && + (nRNTNTAIInformation.UELocationDerivedTACInNRNTN == nil) == (y.UELocationDerivedTACInNRNTN == nil) && (nRNTNTAIInformation.UELocationDerivedTACInNRNTN == nil || (*nRNTNTAIInformation.UELocationDerivedTACInNRNTN) == *y.UELocationDerivedTACInNRNTN) && + nRNTNTAIInformation.iEExtensions == y.iEExtensions && + nRNTNTAIInformation.extensions == y.extensions +} + +func (nRPPaPDU NRPPaPDU) Equal(y NRPPaPDU) bool { + if len(nRPPaPDU) != len(y) { + return false + } + for i := range nRPPaPDU { + if !(nRPPaPDU[i] == y[i]) { + return false + } + } + return true +} + +func (nRPagingeDRXInformation NRPagingeDRXInformation) Equal(y NRPagingeDRXInformation) bool { + return nRPagingeDRXInformation.NRpagingeDRXCycle == y.NRpagingeDRXCycle && + (nRPagingeDRXInformation.NRpagingTimeWindow == nil) == (y.NRpagingTimeWindow == nil) && (nRPagingeDRXInformation.NRpagingTimeWindow == nil || (*nRPagingeDRXInformation.NRpagingTimeWindow) == *y.NRpagingTimeWindow) && + nRPagingeDRXInformation.iEExtensions == y.iEExtensions && + nRPagingeDRXInformation.extensions == y.extensions +} + +func (nRUERLFReportContainer NRUERLFReportContainer) Equal(y NRUERLFReportContainer) bool { + if len(nRUERLFReportContainer) != len(y) { + return false + } + for i := range nRUERLFReportContainer { + if !(nRUERLFReportContainer[i] == y[i]) { + return false + } + } + return true +} + +func (nRUESidelinkAggregateMaximumBitrate NRUESidelinkAggregateMaximumBitrate) Equal(y NRUESidelinkAggregateMaximumBitrate) bool { + return nRUESidelinkAggregateMaximumBitrate == y +} + +func (nRV2XServicesAuthorized NRV2XServicesAuthorized) Equal(y NRV2XServicesAuthorized) bool { + return (nRV2XServicesAuthorized.VehicleUE == nil) == (y.VehicleUE == nil) && (nRV2XServicesAuthorized.VehicleUE == nil || (*nRV2XServicesAuthorized.VehicleUE) == *y.VehicleUE) && + (nRV2XServicesAuthorized.PedestrianUE == nil) == (y.PedestrianUE == nil) && (nRV2XServicesAuthorized.PedestrianUE == nil || (*nRV2XServicesAuthorized.PedestrianUE) == *y.PedestrianUE) && + nRV2XServicesAuthorized.iEExtensions == y.iEExtensions && + nRV2XServicesAuthorized.extensions == y.extensions +} + +func (nTNGeographicalAreaItem NTNGeographicalAreaItem) Equal(y NTNGeographicalAreaItem) bool { + return (nTNGeographicalAreaItem.Circle == nil) == (y.Circle == nil) && (nTNGeographicalAreaItem.Circle == nil || (*nTNGeographicalAreaItem.Circle).Equal(*y.Circle)) && + (nTNGeographicalAreaItem.Polygon == nil) == (y.Polygon == nil) && (nTNGeographicalAreaItem.Polygon == nil || (*nTNGeographicalAreaItem.Polygon).Equal(*y.Polygon)) && + (nTNGeographicalAreaItem.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (nTNGeographicalAreaItem.ChoiceExtension == nil || (*nTNGeographicalAreaItem.ChoiceExtension) == *y.ChoiceExtension) +} + +func (nTNGeographicalAreaList NTNGeographicalAreaList) Equal(y NTNGeographicalAreaList) bool { + if len(nTNGeographicalAreaList) != len(y) { + return false + } + for i := range nTNGeographicalAreaList { + if !(nTNGeographicalAreaList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (networkSliceAreaScopeofMDT NetworkSliceAreaScopeofMDT) Equal(y NetworkSliceAreaScopeofMDT) bool { + return networkSliceAreaScopeofMDT.NetworkSliceListforMDT.Equal(y.NetworkSliceListforMDT) && + networkSliceAreaScopeofMDT.iEExtensions == y.iEExtensions && + networkSliceAreaScopeofMDT.extensions == y.extensions +} + +func (networkSliceItemforMDT NetworkSliceItemforMDT) Equal(y NetworkSliceItemforMDT) bool { + return networkSliceItemforMDT.PlmnID == y.PlmnID && + networkSliceItemforMDT.SliceMDTList.Equal(y.SliceMDTList) && + networkSliceItemforMDT.iEExtensions == y.iEExtensions && + networkSliceItemforMDT.extensions == y.extensions +} + +func (networkSliceListforMDT NetworkSliceListforMDT) Equal(y NetworkSliceListforMDT) bool { + if len(networkSliceListforMDT) != len(y) { + return false + } + for i := range networkSliceListforMDT { + if !(networkSliceListforMDT[i].Equal(y[i])) { + return false + } + } + return true +} + +func (ngENBID NgENBID) Equal(y NgENBID) bool { + return (ngENBID.MacroNgENBID == nil) == (y.MacroNgENBID == nil) && (ngENBID.MacroNgENBID == nil || (*ngENBID.MacroNgENBID) == *y.MacroNgENBID) && + (ngENBID.ShortMacroNgENBID == nil) == (y.ShortMacroNgENBID == nil) && (ngENBID.ShortMacroNgENBID == nil || (*ngENBID.ShortMacroNgENBID) == *y.ShortMacroNgENBID) && + (ngENBID.LongMacroNgENBID == nil) == (y.LongMacroNgENBID == nil) && (ngENBID.LongMacroNgENBID == nil || (*ngENBID.LongMacroNgENBID) == *y.LongMacroNgENBID) && + (ngENBID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (ngENBID.ChoiceExtension == nil || (*ngENBID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (nonDynamic5QIDescriptor NonDynamic5QIDescriptor) Equal(y NonDynamic5QIDescriptor) bool { + return nonDynamic5QIDescriptor.FiveQI == y.FiveQI && + (nonDynamic5QIDescriptor.PriorityLevelQos == nil) == (y.PriorityLevelQos == nil) && (nonDynamic5QIDescriptor.PriorityLevelQos == nil || (*nonDynamic5QIDescriptor.PriorityLevelQos) == *y.PriorityLevelQos) && + (nonDynamic5QIDescriptor.AveragingWindow == nil) == (y.AveragingWindow == nil) && (nonDynamic5QIDescriptor.AveragingWindow == nil || (*nonDynamic5QIDescriptor.AveragingWindow) == *y.AveragingWindow) && + (nonDynamic5QIDescriptor.MaximumDataBurstVolume == nil) == (y.MaximumDataBurstVolume == nil) && (nonDynamic5QIDescriptor.MaximumDataBurstVolume == nil || (*nonDynamic5QIDescriptor.MaximumDataBurstVolume) == *y.MaximumDataBurstVolume) && + (nonDynamic5QIDescriptor.CNPacketDelayBudgetDL == nil) == (y.CNPacketDelayBudgetDL == nil) && (nonDynamic5QIDescriptor.CNPacketDelayBudgetDL == nil || (*nonDynamic5QIDescriptor.CNPacketDelayBudgetDL) == *y.CNPacketDelayBudgetDL) && + (nonDynamic5QIDescriptor.CNPacketDelayBudgetUL == nil) == (y.CNPacketDelayBudgetUL == nil) && (nonDynamic5QIDescriptor.CNPacketDelayBudgetUL == nil || (*nonDynamic5QIDescriptor.CNPacketDelayBudgetUL) == *y.CNPacketDelayBudgetUL) && + nonDynamic5QIDescriptor.iEExtensions == y.iEExtensions && + nonDynamic5QIDescriptor.extensions == y.extensions +} + +func (notAllowedTACs NotAllowedTACs) Equal(y NotAllowedTACs) bool { + if len(notAllowedTACs) != len(y) { + return false + } + for i := range notAllowedTACs { + if !(notAllowedTACs[i] == y[i]) { + return false + } + } + return true +} + +func (notificationCellItem NotificationCellItem) Equal(y NotificationCellItem) bool { + return notificationCellItem.NGRANCGI.Equal(y.NGRANCGI) && + notificationCellItem.NotifyFlag == y.NotifyFlag && + notificationCellItem.iEExtensions == y.iEExtensions && + notificationCellItem.extensions == y.extensions +} + +func (notificationCellList NotificationCellList) Equal(y NotificationCellList) bool { + if len(notificationCellList) != len(y) { + return false + } + for i := range notificationCellList { + if !(notificationCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (overloadResponse OverloadResponse) Equal(y OverloadResponse) bool { + return (overloadResponse.OverloadAction == nil) == (y.OverloadAction == nil) && (overloadResponse.OverloadAction == nil || (*overloadResponse.OverloadAction) == *y.OverloadAction) && + (overloadResponse.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (overloadResponse.ChoiceExtension == nil || (*overloadResponse.ChoiceExtension) == *y.ChoiceExtension) +} + +func (overloadStart OverloadStart) Equal(y OverloadStart) bool { + return (overloadStart.AMFOverloadResponse == nil) == (y.AMFOverloadResponse == nil) && (overloadStart.AMFOverloadResponse == nil || (*overloadStart.AMFOverloadResponse).Equal(*y.AMFOverloadResponse)) && + (overloadStart.AMFTrafficLoadReductionIndication == nil) == (y.AMFTrafficLoadReductionIndication == nil) && (overloadStart.AMFTrafficLoadReductionIndication == nil || (*overloadStart.AMFTrafficLoadReductionIndication) == *y.AMFTrafficLoadReductionIndication) && + overloadStart.OverloadStartNSSAIList.Equal(y.OverloadStartNSSAIList) && + overloadStart.GUAMIList.Equal(y.GUAMIList) && + overloadStart.messageMeta.Equal(y.messageMeta) +} + +func (overloadStartNSSAIItem OverloadStartNSSAIItem) Equal(y OverloadStartNSSAIItem) bool { + return overloadStartNSSAIItem.extensions == y.extensions && + slices.EqualFunc(overloadStartNSSAIItem.SliceOverloadList, y.SliceOverloadList, SliceOverloadItem.Equal) && + (overloadStartNSSAIItem.SliceOverloadResponse == nil) == (y.SliceOverloadResponse == nil) && (overloadStartNSSAIItem.SliceOverloadResponse == nil || (*overloadStartNSSAIItem.SliceOverloadResponse).Equal(*y.SliceOverloadResponse)) && + (overloadStartNSSAIItem.SliceTrafficLoadReductionIndication == nil) == (y.SliceTrafficLoadReductionIndication == nil) && (overloadStartNSSAIItem.SliceTrafficLoadReductionIndication == nil || (*overloadStartNSSAIItem.SliceTrafficLoadReductionIndication) == *y.SliceTrafficLoadReductionIndication) && + overloadStartNSSAIItem.iEExtensions == y.iEExtensions +} + +func (overloadStartNSSAIList OverloadStartNSSAIList) Equal(y OverloadStartNSSAIList) bool { + if len(overloadStartNSSAIList) != len(y) { + return false + } + for i := range overloadStartNSSAIList { + if !(overloadStartNSSAIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (overloadStop OverloadStop) Equal(y OverloadStop) bool { + return overloadStop.GUAMIList.Equal(y.GUAMIList) && + overloadStop.messageMeta.Equal(y.messageMeta) +} + +func (pC5FlowBitRates PC5FlowBitRates) Equal(y PC5FlowBitRates) bool { + return pC5FlowBitRates == y +} + +func (pC5QoSFlowItem PC5QoSFlowItem) Equal(y PC5QoSFlowItem) bool { + return pC5QoSFlowItem.PQI == y.PQI && + (pC5QoSFlowItem.Pc5FlowBitRates == nil) == (y.Pc5FlowBitRates == nil) && (pC5QoSFlowItem.Pc5FlowBitRates == nil || (*pC5QoSFlowItem.Pc5FlowBitRates).Equal(*y.Pc5FlowBitRates)) && + (pC5QoSFlowItem.Range == nil) == (y.Range == nil) && (pC5QoSFlowItem.Range == nil || (*pC5QoSFlowItem.Range) == *y.Range) && + pC5QoSFlowItem.iEExtensions == y.iEExtensions && + pC5QoSFlowItem.extensions == y.extensions +} + +func (pC5QoSFlowList PC5QoSFlowList) Equal(y PC5QoSFlowList) bool { + if len(pC5QoSFlowList) != len(y) { + return false + } + for i := range pC5QoSFlowList { + if !(pC5QoSFlowList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pC5QoSParameters PC5QoSParameters) Equal(y PC5QoSParameters) bool { + return pC5QoSParameters.Pc5QoSFlowList.Equal(y.Pc5QoSFlowList) && + (pC5QoSParameters.Pc5LinkAggregateBitRates == nil) == (y.Pc5LinkAggregateBitRates == nil) && (pC5QoSParameters.Pc5LinkAggregateBitRates == nil || (*pC5QoSParameters.Pc5LinkAggregateBitRates) == *y.Pc5LinkAggregateBitRates) && + pC5QoSParameters.iEExtensions == y.iEExtensions && + pC5QoSParameters.extensions == y.extensions +} + +func (pCIListForMDT PCIListForMDT) Equal(y PCIListForMDT) bool { + if len(pCIListForMDT) != len(y) { + return false + } + for i := range pCIListForMDT { + if !(pCIListForMDT[i] == y[i]) { + return false + } + } + return true +} + +func (pDUSessionAggregateMaximumBitRate PDUSessionAggregateMaximumBitRate) Equal(y PDUSessionAggregateMaximumBitRate) bool { + return pDUSessionAggregateMaximumBitRate == y +} + +func (pDUSessionResourceAdmittedItem PDUSessionResourceAdmittedItem) Equal(y PDUSessionResourceAdmittedItem) bool { + return pDUSessionResourceAdmittedItem.PDUSessionID == y.PDUSessionID && + pDUSessionResourceAdmittedItem.Transfer.Equal(y.Transfer) && + pDUSessionResourceAdmittedItem.iEExtensions == y.iEExtensions && + pDUSessionResourceAdmittedItem.extensions == y.extensions +} + +func (pDUSessionResourceAdmittedList PDUSessionResourceAdmittedList) Equal(y PDUSessionResourceAdmittedList) bool { + if len(pDUSessionResourceAdmittedList) != len(y) { + return false + } + for i := range pDUSessionResourceAdmittedList { + if !(pDUSessionResourceAdmittedList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceFailedToModifyItemModCfm PDUSessionResourceFailedToModifyItemModCfm) Equal(y PDUSessionResourceFailedToModifyItemModCfm) bool { + return pDUSessionResourceFailedToModifyItemModCfm.extensions == y.extensions && + pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID == y.PDUSessionID && + pDUSessionResourceFailedToModifyItemModCfm.Transfer.Equal(y.Transfer) && + pDUSessionResourceFailedToModifyItemModCfm.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceFailedToModifyItemModRes PDUSessionResourceFailedToModifyItemModRes) Equal(y PDUSessionResourceFailedToModifyItemModRes) bool { + return pDUSessionResourceFailedToModifyItemModRes.extensions == y.extensions && + pDUSessionResourceFailedToModifyItemModRes.PDUSessionID == y.PDUSessionID && + pDUSessionResourceFailedToModifyItemModRes.Transfer.Equal(y.Transfer) && + pDUSessionResourceFailedToModifyItemModRes.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceFailedToModifyListModCfm PDUSessionResourceFailedToModifyListModCfm) Equal(y PDUSessionResourceFailedToModifyListModCfm) bool { + if len(pDUSessionResourceFailedToModifyListModCfm) != len(y) { + return false + } + for i := range pDUSessionResourceFailedToModifyListModCfm { + if !(pDUSessionResourceFailedToModifyListModCfm[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceFailedToModifyListModRes PDUSessionResourceFailedToModifyListModRes) Equal(y PDUSessionResourceFailedToModifyListModRes) bool { + if len(pDUSessionResourceFailedToModifyListModRes) != len(y) { + return false + } + for i := range pDUSessionResourceFailedToModifyListModRes { + if !(pDUSessionResourceFailedToModifyListModRes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceFailedToSetupItemCxtFail PDUSessionResourceFailedToSetupItemCxtFail) Equal(y PDUSessionResourceFailedToSetupItemCxtFail) bool { + return pDUSessionResourceFailedToSetupItemCxtFail.extensions == y.extensions && + pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID == y.PDUSessionID && + pDUSessionResourceFailedToSetupItemCxtFail.Transfer.Equal(y.Transfer) && + pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceFailedToSetupItemCxtRes PDUSessionResourceFailedToSetupItemCxtRes) Equal(y PDUSessionResourceFailedToSetupItemCxtRes) bool { + return pDUSessionResourceFailedToSetupItemCxtRes.extensions == y.extensions && + pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID == y.PDUSessionID && + pDUSessionResourceFailedToSetupItemCxtRes.Transfer.Equal(y.Transfer) && + pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceFailedToSetupItemHOAck PDUSessionResourceFailedToSetupItemHOAck) Equal(y PDUSessionResourceFailedToSetupItemHOAck) bool { + return pDUSessionResourceFailedToSetupItemHOAck.extensions == y.extensions && + pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID == y.PDUSessionID && + pDUSessionResourceFailedToSetupItemHOAck.Transfer.Equal(y.Transfer) && + pDUSessionResourceFailedToSetupItemHOAck.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceFailedToSetupItemPSReq PDUSessionResourceFailedToSetupItemPSReq) Equal(y PDUSessionResourceFailedToSetupItemPSReq) bool { + return pDUSessionResourceFailedToSetupItemPSReq.extensions == y.extensions && + pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID == y.PDUSessionID && + pDUSessionResourceFailedToSetupItemPSReq.Transfer.Equal(y.Transfer) && + pDUSessionResourceFailedToSetupItemPSReq.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceFailedToSetupItemSURes PDUSessionResourceFailedToSetupItemSURes) Equal(y PDUSessionResourceFailedToSetupItemSURes) bool { + return pDUSessionResourceFailedToSetupItemSURes.extensions == y.extensions && + pDUSessionResourceFailedToSetupItemSURes.PDUSessionID == y.PDUSessionID && + pDUSessionResourceFailedToSetupItemSURes.Transfer.Equal(y.Transfer) && + pDUSessionResourceFailedToSetupItemSURes.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceFailedToSetupListCxtFail PDUSessionResourceFailedToSetupListCxtFail) Equal(y PDUSessionResourceFailedToSetupListCxtFail) bool { + if len(pDUSessionResourceFailedToSetupListCxtFail) != len(y) { + return false + } + for i := range pDUSessionResourceFailedToSetupListCxtFail { + if !(pDUSessionResourceFailedToSetupListCxtFail[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceFailedToSetupListCxtRes PDUSessionResourceFailedToSetupListCxtRes) Equal(y PDUSessionResourceFailedToSetupListCxtRes) bool { + if len(pDUSessionResourceFailedToSetupListCxtRes) != len(y) { + return false + } + for i := range pDUSessionResourceFailedToSetupListCxtRes { + if !(pDUSessionResourceFailedToSetupListCxtRes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceFailedToSetupListHOAck PDUSessionResourceFailedToSetupListHOAck) Equal(y PDUSessionResourceFailedToSetupListHOAck) bool { + if len(pDUSessionResourceFailedToSetupListHOAck) != len(y) { + return false + } + for i := range pDUSessionResourceFailedToSetupListHOAck { + if !(pDUSessionResourceFailedToSetupListHOAck[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceFailedToSetupListPSReq PDUSessionResourceFailedToSetupListPSReq) Equal(y PDUSessionResourceFailedToSetupListPSReq) bool { + if len(pDUSessionResourceFailedToSetupListPSReq) != len(y) { + return false + } + for i := range pDUSessionResourceFailedToSetupListPSReq { + if !(pDUSessionResourceFailedToSetupListPSReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceFailedToSetupListSURes PDUSessionResourceFailedToSetupListSURes) Equal(y PDUSessionResourceFailedToSetupListSURes) bool { + if len(pDUSessionResourceFailedToSetupListSURes) != len(y) { + return false + } + for i := range pDUSessionResourceFailedToSetupListSURes { + if !(pDUSessionResourceFailedToSetupListSURes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceHandoverItem PDUSessionResourceHandoverItem) Equal(y PDUSessionResourceHandoverItem) bool { + return pDUSessionResourceHandoverItem.PDUSessionID == y.PDUSessionID && + pDUSessionResourceHandoverItem.Transfer.Equal(y.Transfer) && + pDUSessionResourceHandoverItem.iEExtensions == y.iEExtensions && + pDUSessionResourceHandoverItem.extensions == y.extensions +} + +func (pDUSessionResourceHandoverList PDUSessionResourceHandoverList) Equal(y PDUSessionResourceHandoverList) bool { + if len(pDUSessionResourceHandoverList) != len(y) { + return false + } + for i := range pDUSessionResourceHandoverList { + if !(pDUSessionResourceHandoverList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceInformationItem PDUSessionResourceInformationItem) Equal(y PDUSessionResourceInformationItem) bool { + return pDUSessionResourceInformationItem.PDUSessionID == y.PDUSessionID && + pDUSessionResourceInformationItem.QosFlowInformationList.Equal(y.QosFlowInformationList) && + (pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList == nil) == (y.DRBsToQosFlowsMappingList == nil) && pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList.Equal(y.DRBsToQosFlowsMappingList) && + pDUSessionResourceInformationItem.iEExtensions == y.iEExtensions && + pDUSessionResourceInformationItem.extensions == y.extensions +} + +func (pDUSessionResourceInformationList PDUSessionResourceInformationList) Equal(y PDUSessionResourceInformationList) bool { + if len(pDUSessionResourceInformationList) != len(y) { + return false + } + for i := range pDUSessionResourceInformationList { + if !(pDUSessionResourceInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceItemCxtRelCpl PDUSessionResourceItemCxtRelCpl) Equal(y PDUSessionResourceItemCxtRelCpl) bool { + return pDUSessionResourceItemCxtRelCpl.extensions == y.extensions && + pDUSessionResourceItemCxtRelCpl.PDUSessionID == y.PDUSessionID && + (pDUSessionResourceItemCxtRelCpl.PDUSessionResourceReleaseResponseTransfer == nil) == (y.PDUSessionResourceReleaseResponseTransfer == nil) && (pDUSessionResourceItemCxtRelCpl.PDUSessionResourceReleaseResponseTransfer == nil || (*pDUSessionResourceItemCxtRelCpl.PDUSessionResourceReleaseResponseTransfer).Equal(*y.PDUSessionResourceReleaseResponseTransfer)) && + pDUSessionResourceItemCxtRelCpl.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceItemCxtRelReq PDUSessionResourceItemCxtRelReq) Equal(y PDUSessionResourceItemCxtRelReq) bool { + return pDUSessionResourceItemCxtRelReq == y +} + +func (pDUSessionResourceItemHORqd PDUSessionResourceItemHORqd) Equal(y PDUSessionResourceItemHORqd) bool { + return pDUSessionResourceItemHORqd.extensions == y.extensions && + pDUSessionResourceItemHORqd.PDUSessionID == y.PDUSessionID && + pDUSessionResourceItemHORqd.Transfer.Equal(y.Transfer) && + pDUSessionResourceItemHORqd.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceListCxtRelCpl PDUSessionResourceListCxtRelCpl) Equal(y PDUSessionResourceListCxtRelCpl) bool { + if len(pDUSessionResourceListCxtRelCpl) != len(y) { + return false + } + for i := range pDUSessionResourceListCxtRelCpl { + if !(pDUSessionResourceListCxtRelCpl[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceListCxtRelReq PDUSessionResourceListCxtRelReq) Equal(y PDUSessionResourceListCxtRelReq) bool { + if len(pDUSessionResourceListCxtRelReq) != len(y) { + return false + } + for i := range pDUSessionResourceListCxtRelReq { + if !(pDUSessionResourceListCxtRelReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceListHORqd PDUSessionResourceListHORqd) Equal(y PDUSessionResourceListHORqd) bool { + if len(pDUSessionResourceListHORqd) != len(y) { + return false + } + for i := range pDUSessionResourceListHORqd { + if !(pDUSessionResourceListHORqd[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceModifyConfirm PDUSessionResourceModifyConfirm) Equal(y PDUSessionResourceModifyConfirm) bool { + return (pDUSessionResourceModifyConfirm.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (pDUSessionResourceModifyConfirm.AMFUENGAPID == nil || (*pDUSessionResourceModifyConfirm.AMFUENGAPID) == *y.AMFUENGAPID) && + (pDUSessionResourceModifyConfirm.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (pDUSessionResourceModifyConfirm.RANUENGAPID == nil || (*pDUSessionResourceModifyConfirm.RANUENGAPID) == *y.RANUENGAPID) && + pDUSessionResourceModifyConfirm.PDUSessionResourceModify.Equal(y.PDUSessionResourceModify) && + pDUSessionResourceModifyConfirm.PDUSessionResourceFailed.Equal(y.PDUSessionResourceFailed) && + (pDUSessionResourceModifyConfirm.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pDUSessionResourceModifyConfirm.CriticalityDiagnostics == nil || (*pDUSessionResourceModifyConfirm.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pDUSessionResourceModifyConfirm.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceModifyConfirmTransfer PDUSessionResourceModifyConfirmTransfer) Equal(y PDUSessionResourceModifyConfirmTransfer) bool { + return pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.Equal(y.QosFlowModifyConfirm) && + pDUSessionResourceModifyConfirmTransfer.ULNGUUPTNLInformation.Equal(y.ULNGUUPTNLInformation) && + (pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation == nil) == (y.AdditionalNGUUPTNLInformation == nil) && pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation.Equal(y.AdditionalNGUUPTNLInformation) && + (pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify == nil) == (y.QosFlowFailedToModify == nil) && pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify.Equal(y.QosFlowFailedToModify) && + (pDUSessionResourceModifyConfirmTransfer.RedundantULNGUUPTNLInformation == nil) == (y.RedundantULNGUUPTNLInformation == nil) && (pDUSessionResourceModifyConfirmTransfer.RedundantULNGUUPTNLInformation == nil || (*pDUSessionResourceModifyConfirmTransfer.RedundantULNGUUPTNLInformation).Equal(*y.RedundantULNGUUPTNLInformation)) && + pDUSessionResourceModifyConfirmTransfer.AdditionalRedundantNGUUPTNLInformation.Equal(y.AdditionalRedundantNGUUPTNLInformation) && + pDUSessionResourceModifyConfirmTransfer.iEExtensions == y.iEExtensions && + pDUSessionResourceModifyConfirmTransfer.extensions == y.extensions +} + +func (pDUSessionResourceModifyIndication PDUSessionResourceModifyIndication) Equal(y PDUSessionResourceModifyIndication) bool { + return pDUSessionResourceModifyIndication.AMFUENGAPID == y.AMFUENGAPID && + pDUSessionResourceModifyIndication.RANUENGAPID == y.RANUENGAPID && + pDUSessionResourceModifyIndication.PDUSessionResourceModify.Equal(y.PDUSessionResourceModify) && + (pDUSessionResourceModifyIndication.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (pDUSessionResourceModifyIndication.UserLocationInformation == nil || (*pDUSessionResourceModifyIndication.UserLocationInformation).Equal(*y.UserLocationInformation)) && + pDUSessionResourceModifyIndication.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceModifyIndicationTransfer PDUSessionResourceModifyIndicationTransfer) Equal(y PDUSessionResourceModifyIndicationTransfer) bool { + return pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.Equal(y.DLQosFlowPerTNLInformation) && + (pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation == nil) == (y.AdditionalDLQosFlowPerTNLInformation == nil) && pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation.Equal(y.AdditionalDLQosFlowPerTNLInformation) && + (pDUSessionResourceModifyIndicationTransfer.SecondaryRATUsageInformation == nil) == (y.SecondaryRATUsageInformation == nil) && (pDUSessionResourceModifyIndicationTransfer.SecondaryRATUsageInformation == nil || (*pDUSessionResourceModifyIndicationTransfer.SecondaryRATUsageInformation).Equal(*y.SecondaryRATUsageInformation)) && + (pDUSessionResourceModifyIndicationTransfer.SecurityResult == nil) == (y.SecurityResult == nil) && (pDUSessionResourceModifyIndicationTransfer.SecurityResult == nil || (*pDUSessionResourceModifyIndicationTransfer.SecurityResult).Equal(*y.SecurityResult)) && + (pDUSessionResourceModifyIndicationTransfer.RedundantDLQosFlowPerTNLInformation == nil) == (y.RedundantDLQosFlowPerTNLInformation == nil) && (pDUSessionResourceModifyIndicationTransfer.RedundantDLQosFlowPerTNLInformation == nil || (*pDUSessionResourceModifyIndicationTransfer.RedundantDLQosFlowPerTNLInformation).Equal(*y.RedundantDLQosFlowPerTNLInformation)) && + pDUSessionResourceModifyIndicationTransfer.AdditionalRedundantDLQosFlowPerTNLInformation.Equal(y.AdditionalRedundantDLQosFlowPerTNLInformation) && + (pDUSessionResourceModifyIndicationTransfer.GlobalRANNodeID == nil) == (y.GlobalRANNodeID == nil) && (pDUSessionResourceModifyIndicationTransfer.GlobalRANNodeID == nil || (*pDUSessionResourceModifyIndicationTransfer.GlobalRANNodeID).Equal(*y.GlobalRANNodeID)) && + pDUSessionResourceModifyIndicationTransfer.ECNMarkingorCongestionInformationReportingStatus.Equal(y.ECNMarkingorCongestionInformationReportingStatus) && + pDUSessionResourceModifyIndicationTransfer.iEExtensions == y.iEExtensions && + pDUSessionResourceModifyIndicationTransfer.extensions == y.extensions +} + +func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer PDUSessionResourceModifyIndicationUnsuccessfulTransfer) Equal(y PDUSessionResourceModifyIndicationUnsuccessfulTransfer) bool { + return pDUSessionResourceModifyIndicationUnsuccessfulTransfer.extensions == y.extensions && + pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.Equal(y.Cause) && + pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceModifyItemModCfm PDUSessionResourceModifyItemModCfm) Equal(y PDUSessionResourceModifyItemModCfm) bool { + return pDUSessionResourceModifyItemModCfm.PDUSessionID == y.PDUSessionID && + pDUSessionResourceModifyItemModCfm.Transfer.Equal(y.Transfer) && + pDUSessionResourceModifyItemModCfm.iEExtensions == y.iEExtensions && + pDUSessionResourceModifyItemModCfm.extensions == y.extensions +} + +func (pDUSessionResourceModifyItemModInd PDUSessionResourceModifyItemModInd) Equal(y PDUSessionResourceModifyItemModInd) bool { + return pDUSessionResourceModifyItemModInd.PDUSessionID == y.PDUSessionID && + pDUSessionResourceModifyItemModInd.Transfer.Equal(y.Transfer) && + pDUSessionResourceModifyItemModInd.iEExtensions == y.iEExtensions && + pDUSessionResourceModifyItemModInd.extensions == y.extensions +} + +func (pDUSessionResourceModifyItemModReq PDUSessionResourceModifyItemModReq) Equal(y PDUSessionResourceModifyItemModReq) bool { + return pDUSessionResourceModifyItemModReq.PDUSessionID == y.PDUSessionID && + (pDUSessionResourceModifyItemModReq.NASPDU == nil) == (y.NASPDU == nil) && (pDUSessionResourceModifyItemModReq.NASPDU == nil || (*pDUSessionResourceModifyItemModReq.NASPDU).Equal(*y.NASPDU)) && + pDUSessionResourceModifyItemModReq.Transfer.Equal(y.Transfer) && + (pDUSessionResourceModifyItemModReq.SNSSAI == nil) == (y.SNSSAI == nil) && (pDUSessionResourceModifyItemModReq.SNSSAI == nil || (*pDUSessionResourceModifyItemModReq.SNSSAI).Equal(*y.SNSSAI)) && + (pDUSessionResourceModifyItemModReq.PduSessionExpectedUEActivityBehaviour == nil) == (y.PduSessionExpectedUEActivityBehaviour == nil) && (pDUSessionResourceModifyItemModReq.PduSessionExpectedUEActivityBehaviour == nil || (*pDUSessionResourceModifyItemModReq.PduSessionExpectedUEActivityBehaviour).Equal(*y.PduSessionExpectedUEActivityBehaviour)) && + pDUSessionResourceModifyItemModReq.iEExtensions == y.iEExtensions && + pDUSessionResourceModifyItemModReq.extensions == y.extensions +} + +func (pDUSessionResourceModifyItemModRes PDUSessionResourceModifyItemModRes) Equal(y PDUSessionResourceModifyItemModRes) bool { + return pDUSessionResourceModifyItemModRes.PDUSessionID == y.PDUSessionID && + pDUSessionResourceModifyItemModRes.Transfer.Equal(y.Transfer) && + pDUSessionResourceModifyItemModRes.iEExtensions == y.iEExtensions && + pDUSessionResourceModifyItemModRes.extensions == y.extensions +} + +func (pDUSessionResourceModifyListModCfm PDUSessionResourceModifyListModCfm) Equal(y PDUSessionResourceModifyListModCfm) bool { + if len(pDUSessionResourceModifyListModCfm) != len(y) { + return false + } + for i := range pDUSessionResourceModifyListModCfm { + if !(pDUSessionResourceModifyListModCfm[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceModifyListModInd PDUSessionResourceModifyListModInd) Equal(y PDUSessionResourceModifyListModInd) bool { + if len(pDUSessionResourceModifyListModInd) != len(y) { + return false + } + for i := range pDUSessionResourceModifyListModInd { + if !(pDUSessionResourceModifyListModInd[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceModifyListModReq PDUSessionResourceModifyListModReq) Equal(y PDUSessionResourceModifyListModReq) bool { + if len(pDUSessionResourceModifyListModReq) != len(y) { + return false + } + for i := range pDUSessionResourceModifyListModReq { + if !(pDUSessionResourceModifyListModReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceModifyListModRes PDUSessionResourceModifyListModRes) Equal(y PDUSessionResourceModifyListModRes) bool { + if len(pDUSessionResourceModifyListModRes) != len(y) { + return false + } + for i := range pDUSessionResourceModifyListModRes { + if !(pDUSessionResourceModifyListModRes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceModifyRequest PDUSessionResourceModifyRequest) Equal(y PDUSessionResourceModifyRequest) bool { + return pDUSessionResourceModifyRequest.AMFUENGAPID == y.AMFUENGAPID && + pDUSessionResourceModifyRequest.RANUENGAPID == y.RANUENGAPID && + pDUSessionResourceModifyRequest.PDUSessionResourceModify.Equal(y.PDUSessionResourceModify) && + (pDUSessionResourceModifyRequest.RANPagingPriority == nil) == (y.RANPagingPriority == nil) && (pDUSessionResourceModifyRequest.RANPagingPriority == nil || (*pDUSessionResourceModifyRequest.RANPagingPriority) == *y.RANPagingPriority) && + pDUSessionResourceModifyRequest.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceModifyRequestTransfer PDUSessionResourceModifyRequestTransfer) Equal(y PDUSessionResourceModifyRequestTransfer) bool { + return (pDUSessionResourceModifyRequestTransfer.PDUSessionAggregateMaximumBitRate == nil) == (y.PDUSessionAggregateMaximumBitRate == nil) && (pDUSessionResourceModifyRequestTransfer.PDUSessionAggregateMaximumBitRate == nil || (*pDUSessionResourceModifyRequestTransfer.PDUSessionAggregateMaximumBitRate).Equal(*y.PDUSessionAggregateMaximumBitRate)) && + pDUSessionResourceModifyRequestTransfer.ULNGUUPTNLModify.Equal(y.ULNGUUPTNLModify) && + (pDUSessionResourceModifyRequestTransfer.NetworkInstance == nil) == (y.NetworkInstance == nil) && (pDUSessionResourceModifyRequestTransfer.NetworkInstance == nil || (*pDUSessionResourceModifyRequestTransfer.NetworkInstance) == *y.NetworkInstance) && + pDUSessionResourceModifyRequestTransfer.QosFlowAddOrModifyRequest.Equal(y.QosFlowAddOrModifyRequest) && + pDUSessionResourceModifyRequestTransfer.QosFlowToRelease.Equal(y.QosFlowToRelease) && + pDUSessionResourceModifyRequestTransfer.AdditionalULNGUUPTNLInformation.Equal(y.AdditionalULNGUUPTNLInformation) && + pDUSessionResourceModifyRequestTransfer.AdditionalRedundantULNGUUPTNLInformation.Equal(y.AdditionalRedundantULNGUUPTNLInformation) && + (pDUSessionResourceModifyRequestTransfer.RedundantULNGUUPTNLInformation == nil) == (y.RedundantULNGUUPTNLInformation == nil) && (pDUSessionResourceModifyRequestTransfer.RedundantULNGUUPTNLInformation == nil || (*pDUSessionResourceModifyRequestTransfer.RedundantULNGUUPTNLInformation).Equal(*y.RedundantULNGUUPTNLInformation)) && + (pDUSessionResourceModifyRequestTransfer.UserPlaneFailureIndication == nil) == (y.UserPlaneFailureIndication == nil) && (pDUSessionResourceModifyRequestTransfer.UserPlaneFailureIndication == nil || (*pDUSessionResourceModifyRequestTransfer.UserPlaneFailureIndication).Equal(*y.UserPlaneFailureIndication)) && + pDUSessionResourceModifyRequestTransfer.CommonNetworkInstance.Equal(y.CommonNetworkInstance) && + pDUSessionResourceModifyRequestTransfer.RedundantCommonNetworkInstance.Equal(y.RedundantCommonNetworkInstance) && + (pDUSessionResourceModifyRequestTransfer.SecurityIndication == nil) == (y.SecurityIndication == nil) && (pDUSessionResourceModifyRequestTransfer.SecurityIndication == nil || (*pDUSessionResourceModifyRequestTransfer.SecurityIndication).Equal(*y.SecurityIndication)) && + pDUSessionResourceModifyRequestTransfer.MBSSessionSetuporModifyRequestList.Equal(y.MBSSessionSetuporModifyRequestList) && + pDUSessionResourceModifyRequestTransfer.MBSSessionToReleaseList.Equal(y.MBSSessionToReleaseList) && + pDUSessionResourceModifyRequestTransfer.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceModifyResponse PDUSessionResourceModifyResponse) Equal(y PDUSessionResourceModifyResponse) bool { + return (pDUSessionResourceModifyResponse.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (pDUSessionResourceModifyResponse.AMFUENGAPID == nil || (*pDUSessionResourceModifyResponse.AMFUENGAPID) == *y.AMFUENGAPID) && + (pDUSessionResourceModifyResponse.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (pDUSessionResourceModifyResponse.RANUENGAPID == nil || (*pDUSessionResourceModifyResponse.RANUENGAPID) == *y.RANUENGAPID) && + pDUSessionResourceModifyResponse.PDUSessionResourceModify.Equal(y.PDUSessionResourceModify) && + pDUSessionResourceModifyResponse.PDUSessionResourceFailed.Equal(y.PDUSessionResourceFailed) && + (pDUSessionResourceModifyResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (pDUSessionResourceModifyResponse.UserLocationInformation == nil || (*pDUSessionResourceModifyResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (pDUSessionResourceModifyResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pDUSessionResourceModifyResponse.CriticalityDiagnostics == nil || (*pDUSessionResourceModifyResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pDUSessionResourceModifyResponse.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceModifyResponseTransfer PDUSessionResourceModifyResponseTransfer) Equal(y PDUSessionResourceModifyResponseTransfer) bool { + return (pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation == nil) == (y.DLNGUUPTNLInformation == nil) && (pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation == nil || (*pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation).Equal(*y.DLNGUUPTNLInformation)) && + (pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation == nil) == (y.ULNGUUPTNLInformation == nil) && (pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation == nil || (*pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation).Equal(*y.ULNGUUPTNLInformation)) && + (pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse == nil) == (y.QosFlowAddOrModifyResponse == nil) && pDUSessionResourceModifyResponseTransfer.QosFlowAddOrModifyResponse.Equal(y.QosFlowAddOrModifyResponse) && + (pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation == nil) == (y.AdditionalDLQosFlowPerTNLInformation == nil) && pDUSessionResourceModifyResponseTransfer.AdditionalDLQosFlowPerTNLInformation.Equal(y.AdditionalDLQosFlowPerTNLInformation) && + (pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify == nil) == (y.QosFlowFailedToAddOrModify == nil) && pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify.Equal(y.QosFlowFailedToAddOrModify) && + pDUSessionResourceModifyResponseTransfer.AdditionalNGUUPTNLInformation.Equal(y.AdditionalNGUUPTNLInformation) && + (pDUSessionResourceModifyResponseTransfer.RedundantDLNGUUPTNLInformation == nil) == (y.RedundantDLNGUUPTNLInformation == nil) && (pDUSessionResourceModifyResponseTransfer.RedundantDLNGUUPTNLInformation == nil || (*pDUSessionResourceModifyResponseTransfer.RedundantDLNGUUPTNLInformation).Equal(*y.RedundantDLNGUUPTNLInformation)) && + (pDUSessionResourceModifyResponseTransfer.RedundantULNGUUPTNLInformation == nil) == (y.RedundantULNGUUPTNLInformation == nil) && (pDUSessionResourceModifyResponseTransfer.RedundantULNGUUPTNLInformation == nil || (*pDUSessionResourceModifyResponseTransfer.RedundantULNGUUPTNLInformation).Equal(*y.RedundantULNGUUPTNLInformation)) && + pDUSessionResourceModifyResponseTransfer.AdditionalRedundantDLQosFlowPerTNLInformation.Equal(y.AdditionalRedundantDLQosFlowPerTNLInformation) && + pDUSessionResourceModifyResponseTransfer.AdditionalRedundantNGUUPTNLInformation.Equal(y.AdditionalRedundantNGUUPTNLInformation) && + (pDUSessionResourceModifyResponseTransfer.SecondaryRATUsageInformation == nil) == (y.SecondaryRATUsageInformation == nil) && (pDUSessionResourceModifyResponseTransfer.SecondaryRATUsageInformation == nil || (*pDUSessionResourceModifyResponseTransfer.SecondaryRATUsageInformation).Equal(*y.SecondaryRATUsageInformation)) && + (pDUSessionResourceModifyResponseTransfer.MBSSupportIndicator == nil) == (y.MBSSupportIndicator == nil) && (pDUSessionResourceModifyResponseTransfer.MBSSupportIndicator == nil || (*pDUSessionResourceModifyResponseTransfer.MBSSupportIndicator) == *y.MBSSupportIndicator) && + pDUSessionResourceModifyResponseTransfer.MBSSessionSetuporModifyResponseList.Equal(y.MBSSessionSetuporModifyResponseList) && + pDUSessionResourceModifyResponseTransfer.MBSSessionFailedtoSetuporModifyList.Equal(y.MBSSessionFailedtoSetuporModifyList) && + pDUSessionResourceModifyResponseTransfer.ECNMarkingorCongestionInformationReportingStatus.Equal(y.ECNMarkingorCongestionInformationReportingStatus) && + (pDUSessionResourceModifyResponseTransfer.PDUSetbasedHandlingIndicator == nil) == (y.PDUSetbasedHandlingIndicator == nil) && (pDUSessionResourceModifyResponseTransfer.PDUSetbasedHandlingIndicator == nil || (*pDUSessionResourceModifyResponseTransfer.PDUSetbasedHandlingIndicator) == *y.PDUSetbasedHandlingIndicator) && + (pDUSessionResourceModifyResponseTransfer.UserPlaneFailureIndicationReport == nil) == (y.UserPlaneFailureIndicationReport == nil) && (pDUSessionResourceModifyResponseTransfer.UserPlaneFailureIndicationReport == nil || (*pDUSessionResourceModifyResponseTransfer.UserPlaneFailureIndicationReport) == *y.UserPlaneFailureIndicationReport) && + pDUSessionResourceModifyResponseTransfer.iEExtensions == y.iEExtensions && + pDUSessionResourceModifyResponseTransfer.extensions == y.extensions +} + +func (pDUSessionResourceModifyUnsuccessfulTransfer PDUSessionResourceModifyUnsuccessfulTransfer) Equal(y PDUSessionResourceModifyUnsuccessfulTransfer) bool { + return pDUSessionResourceModifyUnsuccessfulTransfer.extensions == y.extensions && + pDUSessionResourceModifyUnsuccessfulTransfer.Cause.Equal(y.Cause) && + (pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics == nil || (*pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceNotify PDUSessionResourceNotify) Equal(y PDUSessionResourceNotify) bool { + return pDUSessionResourceNotify.AMFUENGAPID == y.AMFUENGAPID && + pDUSessionResourceNotify.RANUENGAPID == y.RANUENGAPID && + pDUSessionResourceNotify.PDUSessionResourceNotify.Equal(y.PDUSessionResourceNotify) && + pDUSessionResourceNotify.PDUSessionResourceReleased.Equal(y.PDUSessionResourceReleased) && + (pDUSessionResourceNotify.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (pDUSessionResourceNotify.UserLocationInformation == nil || (*pDUSessionResourceNotify.UserLocationInformation).Equal(*y.UserLocationInformation)) && + pDUSessionResourceNotify.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceNotifyItem PDUSessionResourceNotifyItem) Equal(y PDUSessionResourceNotifyItem) bool { + return pDUSessionResourceNotifyItem.extensions == y.extensions && + pDUSessionResourceNotifyItem.PDUSessionID == y.PDUSessionID && + pDUSessionResourceNotifyItem.Transfer.Equal(y.Transfer) && + pDUSessionResourceNotifyItem.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceNotifyList PDUSessionResourceNotifyList) Equal(y PDUSessionResourceNotifyList) bool { + if len(pDUSessionResourceNotifyList) != len(y) { + return false + } + for i := range pDUSessionResourceNotifyList { + if !(pDUSessionResourceNotifyList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceNotifyTransfer PDUSessionResourceNotifyTransfer) Equal(y PDUSessionResourceNotifyTransfer) bool { + return pDUSessionResourceNotifyTransfer.extensions == y.extensions && + (pDUSessionResourceNotifyTransfer.QosFlowNotify == nil) == (y.QosFlowNotify == nil) && pDUSessionResourceNotifyTransfer.QosFlowNotify.Equal(y.QosFlowNotify) && + (pDUSessionResourceNotifyTransfer.QosFlowReleased == nil) == (y.QosFlowReleased == nil) && pDUSessionResourceNotifyTransfer.QosFlowReleased.Equal(y.QosFlowReleased) && + (pDUSessionResourceNotifyTransfer.SecondaryRATUsageInformation == nil) == (y.SecondaryRATUsageInformation == nil) && (pDUSessionResourceNotifyTransfer.SecondaryRATUsageInformation == nil || (*pDUSessionResourceNotifyTransfer.SecondaryRATUsageInformation).Equal(*y.SecondaryRATUsageInformation)) && + pDUSessionResourceNotifyTransfer.QosFlowFeedbackList.Equal(y.QosFlowFeedbackList) && + pDUSessionResourceNotifyTransfer.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceReleaseCommand PDUSessionResourceReleaseCommand) Equal(y PDUSessionResourceReleaseCommand) bool { + return pDUSessionResourceReleaseCommand.AMFUENGAPID == y.AMFUENGAPID && + pDUSessionResourceReleaseCommand.RANUENGAPID == y.RANUENGAPID && + (pDUSessionResourceReleaseCommand.NASPDU == nil) == (y.NASPDU == nil) && (pDUSessionResourceReleaseCommand.NASPDU == nil || (*pDUSessionResourceReleaseCommand.NASPDU).Equal(*y.NASPDU)) && + pDUSessionResourceReleaseCommand.PDUSessionResourceRelease.Equal(y.PDUSessionResourceRelease) && + (pDUSessionResourceReleaseCommand.RANPagingPriority == nil) == (y.RANPagingPriority == nil) && (pDUSessionResourceReleaseCommand.RANPagingPriority == nil || (*pDUSessionResourceReleaseCommand.RANPagingPriority) == *y.RANPagingPriority) && + pDUSessionResourceReleaseCommand.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceReleaseCommandTransfer PDUSessionResourceReleaseCommandTransfer) Equal(y PDUSessionResourceReleaseCommandTransfer) bool { + return pDUSessionResourceReleaseCommandTransfer.extensions == y.extensions && + pDUSessionResourceReleaseCommandTransfer.Cause.Equal(y.Cause) && + pDUSessionResourceReleaseCommandTransfer.QosFlowAdditionalInfoList.Equal(y.QosFlowAdditionalInfoList) && + pDUSessionResourceReleaseCommandTransfer.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceReleaseResponse PDUSessionResourceReleaseResponse) Equal(y PDUSessionResourceReleaseResponse) bool { + return (pDUSessionResourceReleaseResponse.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (pDUSessionResourceReleaseResponse.AMFUENGAPID == nil || (*pDUSessionResourceReleaseResponse.AMFUENGAPID) == *y.AMFUENGAPID) && + (pDUSessionResourceReleaseResponse.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (pDUSessionResourceReleaseResponse.RANUENGAPID == nil || (*pDUSessionResourceReleaseResponse.RANUENGAPID) == *y.RANUENGAPID) && + pDUSessionResourceReleaseResponse.PDUSessionResourceReleased.Equal(y.PDUSessionResourceReleased) && + (pDUSessionResourceReleaseResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (pDUSessionResourceReleaseResponse.UserLocationInformation == nil || (*pDUSessionResourceReleaseResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (pDUSessionResourceReleaseResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pDUSessionResourceReleaseResponse.CriticalityDiagnostics == nil || (*pDUSessionResourceReleaseResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pDUSessionResourceReleaseResponse.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceReleaseResponseTransfer PDUSessionResourceReleaseResponseTransfer) Equal(y PDUSessionResourceReleaseResponseTransfer) bool { + return pDUSessionResourceReleaseResponseTransfer.extensions == y.extensions && + (pDUSessionResourceReleaseResponseTransfer.SecondaryRATUsageInformation == nil) == (y.SecondaryRATUsageInformation == nil) && (pDUSessionResourceReleaseResponseTransfer.SecondaryRATUsageInformation == nil || (*pDUSessionResourceReleaseResponseTransfer.SecondaryRATUsageInformation).Equal(*y.SecondaryRATUsageInformation)) && + pDUSessionResourceReleaseResponseTransfer.QosFlowAdditionalInfoList.Equal(y.QosFlowAdditionalInfoList) && + pDUSessionResourceReleaseResponseTransfer.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceReleasedItemNot PDUSessionResourceReleasedItemNot) Equal(y PDUSessionResourceReleasedItemNot) bool { + return pDUSessionResourceReleasedItemNot.extensions == y.extensions && + pDUSessionResourceReleasedItemNot.PDUSessionID == y.PDUSessionID && + pDUSessionResourceReleasedItemNot.Transfer.Equal(y.Transfer) && + pDUSessionResourceReleasedItemNot.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceReleasedItemPSAck PDUSessionResourceReleasedItemPSAck) Equal(y PDUSessionResourceReleasedItemPSAck) bool { + return pDUSessionResourceReleasedItemPSAck.extensions == y.extensions && + pDUSessionResourceReleasedItemPSAck.PDUSessionID == y.PDUSessionID && + pDUSessionResourceReleasedItemPSAck.Transfer.Equal(y.Transfer) && + pDUSessionResourceReleasedItemPSAck.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceReleasedItemPSFail PDUSessionResourceReleasedItemPSFail) Equal(y PDUSessionResourceReleasedItemPSFail) bool { + return pDUSessionResourceReleasedItemPSFail.extensions == y.extensions && + pDUSessionResourceReleasedItemPSFail.PDUSessionID == y.PDUSessionID && + pDUSessionResourceReleasedItemPSFail.Transfer.Equal(y.Transfer) && + pDUSessionResourceReleasedItemPSFail.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceReleasedItemRelRes PDUSessionResourceReleasedItemRelRes) Equal(y PDUSessionResourceReleasedItemRelRes) bool { + return pDUSessionResourceReleasedItemRelRes.extensions == y.extensions && + pDUSessionResourceReleasedItemRelRes.PDUSessionID == y.PDUSessionID && + pDUSessionResourceReleasedItemRelRes.Transfer.Equal(y.Transfer) && + pDUSessionResourceReleasedItemRelRes.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceReleasedListNot PDUSessionResourceReleasedListNot) Equal(y PDUSessionResourceReleasedListNot) bool { + if len(pDUSessionResourceReleasedListNot) != len(y) { + return false + } + for i := range pDUSessionResourceReleasedListNot { + if !(pDUSessionResourceReleasedListNot[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceReleasedListPSAck PDUSessionResourceReleasedListPSAck) Equal(y PDUSessionResourceReleasedListPSAck) bool { + if len(pDUSessionResourceReleasedListPSAck) != len(y) { + return false + } + for i := range pDUSessionResourceReleasedListPSAck { + if !(pDUSessionResourceReleasedListPSAck[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceReleasedListPSFail PDUSessionResourceReleasedListPSFail) Equal(y PDUSessionResourceReleasedListPSFail) bool { + if len(pDUSessionResourceReleasedListPSFail) != len(y) { + return false + } + for i := range pDUSessionResourceReleasedListPSFail { + if !(pDUSessionResourceReleasedListPSFail[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceReleasedListRelRes PDUSessionResourceReleasedListRelRes) Equal(y PDUSessionResourceReleasedListRelRes) bool { + if len(pDUSessionResourceReleasedListRelRes) != len(y) { + return false + } + for i := range pDUSessionResourceReleasedListRelRes { + if !(pDUSessionResourceReleasedListRelRes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceSetupItemCxtReq PDUSessionResourceSetupItemCxtReq) Equal(y PDUSessionResourceSetupItemCxtReq) bool { + return pDUSessionResourceSetupItemCxtReq.PDUSessionID == y.PDUSessionID && + (pDUSessionResourceSetupItemCxtReq.NASPDU == nil) == (y.NASPDU == nil) && (pDUSessionResourceSetupItemCxtReq.NASPDU == nil || (*pDUSessionResourceSetupItemCxtReq.NASPDU).Equal(*y.NASPDU)) && + pDUSessionResourceSetupItemCxtReq.SNSSAI.Equal(y.SNSSAI) && + pDUSessionResourceSetupItemCxtReq.Transfer.Equal(y.Transfer) && + (pDUSessionResourceSetupItemCxtReq.PduSessionExpectedUEActivityBehaviour == nil) == (y.PduSessionExpectedUEActivityBehaviour == nil) && (pDUSessionResourceSetupItemCxtReq.PduSessionExpectedUEActivityBehaviour == nil || (*pDUSessionResourceSetupItemCxtReq.PduSessionExpectedUEActivityBehaviour).Equal(*y.PduSessionExpectedUEActivityBehaviour)) && + pDUSessionResourceSetupItemCxtReq.iEExtensions == y.iEExtensions && + pDUSessionResourceSetupItemCxtReq.extensions == y.extensions +} + +func (pDUSessionResourceSetupItemCxtRes PDUSessionResourceSetupItemCxtRes) Equal(y PDUSessionResourceSetupItemCxtRes) bool { + return pDUSessionResourceSetupItemCxtRes.PDUSessionID == y.PDUSessionID && + pDUSessionResourceSetupItemCxtRes.Transfer.Equal(y.Transfer) && + pDUSessionResourceSetupItemCxtRes.iEExtensions == y.iEExtensions && + pDUSessionResourceSetupItemCxtRes.extensions == y.extensions +} + +func (pDUSessionResourceSetupItemHOReq PDUSessionResourceSetupItemHOReq) Equal(y PDUSessionResourceSetupItemHOReq) bool { + return pDUSessionResourceSetupItemHOReq.PDUSessionID == y.PDUSessionID && + pDUSessionResourceSetupItemHOReq.SNSSAI.Equal(y.SNSSAI) && + pDUSessionResourceSetupItemHOReq.Transfer.Equal(y.Transfer) && + (pDUSessionResourceSetupItemHOReq.PduSessionExpectedUEActivityBehaviour == nil) == (y.PduSessionExpectedUEActivityBehaviour == nil) && (pDUSessionResourceSetupItemHOReq.PduSessionExpectedUEActivityBehaviour == nil || (*pDUSessionResourceSetupItemHOReq.PduSessionExpectedUEActivityBehaviour).Equal(*y.PduSessionExpectedUEActivityBehaviour)) && + pDUSessionResourceSetupItemHOReq.iEExtensions == y.iEExtensions && + pDUSessionResourceSetupItemHOReq.extensions == y.extensions +} + +func (pDUSessionResourceSetupItemSUReq PDUSessionResourceSetupItemSUReq) Equal(y PDUSessionResourceSetupItemSUReq) bool { + return pDUSessionResourceSetupItemSUReq.PDUSessionID == y.PDUSessionID && + (pDUSessionResourceSetupItemSUReq.NASPDU == nil) == (y.NASPDU == nil) && (pDUSessionResourceSetupItemSUReq.NASPDU == nil || (*pDUSessionResourceSetupItemSUReq.NASPDU).Equal(*y.NASPDU)) && + pDUSessionResourceSetupItemSUReq.SNSSAI.Equal(y.SNSSAI) && + pDUSessionResourceSetupItemSUReq.Transfer.Equal(y.Transfer) && + (pDUSessionResourceSetupItemSUReq.PduSessionExpectedUEActivityBehaviour == nil) == (y.PduSessionExpectedUEActivityBehaviour == nil) && (pDUSessionResourceSetupItemSUReq.PduSessionExpectedUEActivityBehaviour == nil || (*pDUSessionResourceSetupItemSUReq.PduSessionExpectedUEActivityBehaviour).Equal(*y.PduSessionExpectedUEActivityBehaviour)) && + pDUSessionResourceSetupItemSUReq.iEExtensions == y.iEExtensions && + pDUSessionResourceSetupItemSUReq.extensions == y.extensions +} + +func (pDUSessionResourceSetupItemSURes PDUSessionResourceSetupItemSURes) Equal(y PDUSessionResourceSetupItemSURes) bool { + return pDUSessionResourceSetupItemSURes.PDUSessionID == y.PDUSessionID && + pDUSessionResourceSetupItemSURes.Transfer.Equal(y.Transfer) && + pDUSessionResourceSetupItemSURes.iEExtensions == y.iEExtensions && + pDUSessionResourceSetupItemSURes.extensions == y.extensions +} + +func (pDUSessionResourceSetupListCxtReq PDUSessionResourceSetupListCxtReq) Equal(y PDUSessionResourceSetupListCxtReq) bool { + if len(pDUSessionResourceSetupListCxtReq) != len(y) { + return false + } + for i := range pDUSessionResourceSetupListCxtReq { + if !(pDUSessionResourceSetupListCxtReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceSetupListCxtRes PDUSessionResourceSetupListCxtRes) Equal(y PDUSessionResourceSetupListCxtRes) bool { + if len(pDUSessionResourceSetupListCxtRes) != len(y) { + return false + } + for i := range pDUSessionResourceSetupListCxtRes { + if !(pDUSessionResourceSetupListCxtRes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceSetupListHOReq PDUSessionResourceSetupListHOReq) Equal(y PDUSessionResourceSetupListHOReq) bool { + if len(pDUSessionResourceSetupListHOReq) != len(y) { + return false + } + for i := range pDUSessionResourceSetupListHOReq { + if !(pDUSessionResourceSetupListHOReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceSetupListSUReq PDUSessionResourceSetupListSUReq) Equal(y PDUSessionResourceSetupListSUReq) bool { + if len(pDUSessionResourceSetupListSUReq) != len(y) { + return false + } + for i := range pDUSessionResourceSetupListSUReq { + if !(pDUSessionResourceSetupListSUReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceSetupListSURes PDUSessionResourceSetupListSURes) Equal(y PDUSessionResourceSetupListSURes) bool { + if len(pDUSessionResourceSetupListSURes) != len(y) { + return false + } + for i := range pDUSessionResourceSetupListSURes { + if !(pDUSessionResourceSetupListSURes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceSetupRequest PDUSessionResourceSetupRequest) Equal(y PDUSessionResourceSetupRequest) bool { + return pDUSessionResourceSetupRequest.AMFUENGAPID == y.AMFUENGAPID && + pDUSessionResourceSetupRequest.RANUENGAPID == y.RANUENGAPID && + (pDUSessionResourceSetupRequest.NASPDU == nil) == (y.NASPDU == nil) && (pDUSessionResourceSetupRequest.NASPDU == nil || (*pDUSessionResourceSetupRequest.NASPDU).Equal(*y.NASPDU)) && + pDUSessionResourceSetupRequest.PDUSessionResourceSetup.Equal(y.PDUSessionResourceSetup) && + (pDUSessionResourceSetupRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (pDUSessionResourceSetupRequest.UEAggregateMaximumBitRate == nil || (*pDUSessionResourceSetupRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + (pDUSessionResourceSetupRequest.RANPagingPriority == nil) == (y.RANPagingPriority == nil) && (pDUSessionResourceSetupRequest.RANPagingPriority == nil || (*pDUSessionResourceSetupRequest.RANPagingPriority) == *y.RANPagingPriority) && + pDUSessionResourceSetupRequest.UESliceMaximumBitRateList.Equal(y.UESliceMaximumBitRateList) && + pDUSessionResourceSetupRequest.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceSetupRequestTransfer PDUSessionResourceSetupRequestTransfer) Equal(y PDUSessionResourceSetupRequestTransfer) bool { + return (pDUSessionResourceSetupRequestTransfer.PDUSessionAggregateMaximumBitRate == nil) == (y.PDUSessionAggregateMaximumBitRate == nil) && (pDUSessionResourceSetupRequestTransfer.PDUSessionAggregateMaximumBitRate == nil || (*pDUSessionResourceSetupRequestTransfer.PDUSessionAggregateMaximumBitRate).Equal(*y.PDUSessionAggregateMaximumBitRate)) && + pDUSessionResourceSetupRequestTransfer.ULNGUUPTNLInformation.Equal(y.ULNGUUPTNLInformation) && + pDUSessionResourceSetupRequestTransfer.AdditionalULNGUUPTNLInformation.Equal(y.AdditionalULNGUUPTNLInformation) && + (pDUSessionResourceSetupRequestTransfer.DataForwardingNotPossible == nil) == (y.DataForwardingNotPossible == nil) && (pDUSessionResourceSetupRequestTransfer.DataForwardingNotPossible == nil || (*pDUSessionResourceSetupRequestTransfer.DataForwardingNotPossible) == *y.DataForwardingNotPossible) && + pDUSessionResourceSetupRequestTransfer.PDUSessionType == y.PDUSessionType && + (pDUSessionResourceSetupRequestTransfer.SecurityIndication == nil) == (y.SecurityIndication == nil) && (pDUSessionResourceSetupRequestTransfer.SecurityIndication == nil || (*pDUSessionResourceSetupRequestTransfer.SecurityIndication).Equal(*y.SecurityIndication)) && + (pDUSessionResourceSetupRequestTransfer.NetworkInstance == nil) == (y.NetworkInstance == nil) && (pDUSessionResourceSetupRequestTransfer.NetworkInstance == nil || (*pDUSessionResourceSetupRequestTransfer.NetworkInstance) == *y.NetworkInstance) && + pDUSessionResourceSetupRequestTransfer.QosFlowSetupRequest.Equal(y.QosFlowSetupRequest) && + (pDUSessionResourceSetupRequestTransfer.DirectForwardingPathAvailability == nil) == (y.DirectForwardingPathAvailability == nil) && (pDUSessionResourceSetupRequestTransfer.DirectForwardingPathAvailability == nil || (*pDUSessionResourceSetupRequestTransfer.DirectForwardingPathAvailability) == *y.DirectForwardingPathAvailability) && + (pDUSessionResourceSetupRequestTransfer.RedundantULNGUUPTNLInformation == nil) == (y.RedundantULNGUUPTNLInformation == nil) && (pDUSessionResourceSetupRequestTransfer.RedundantULNGUUPTNLInformation == nil || (*pDUSessionResourceSetupRequestTransfer.RedundantULNGUUPTNLInformation).Equal(*y.RedundantULNGUUPTNLInformation)) && + pDUSessionResourceSetupRequestTransfer.AdditionalRedundantULNGUUPTNLInformation.Equal(y.AdditionalRedundantULNGUUPTNLInformation) && + pDUSessionResourceSetupRequestTransfer.CommonNetworkInstance.Equal(y.CommonNetworkInstance) && + pDUSessionResourceSetupRequestTransfer.RedundantCommonNetworkInstance.Equal(y.RedundantCommonNetworkInstance) && + (pDUSessionResourceSetupRequestTransfer.RedundantPDUSessionInformation == nil) == (y.RedundantPDUSessionInformation == nil) && (pDUSessionResourceSetupRequestTransfer.RedundantPDUSessionInformation == nil || (*pDUSessionResourceSetupRequestTransfer.RedundantPDUSessionInformation).Equal(*y.RedundantPDUSessionInformation)) && + pDUSessionResourceSetupRequestTransfer.MBSSessionSetupRequestList.Equal(y.MBSSessionSetupRequestList) && + pDUSessionResourceSetupRequestTransfer.DownlinkTLContainer.Equal(y.DownlinkTLContainer) && + pDUSessionResourceSetupRequestTransfer.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceSetupResponse PDUSessionResourceSetupResponse) Equal(y PDUSessionResourceSetupResponse) bool { + return (pDUSessionResourceSetupResponse.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (pDUSessionResourceSetupResponse.AMFUENGAPID == nil || (*pDUSessionResourceSetupResponse.AMFUENGAPID) == *y.AMFUENGAPID) && + (pDUSessionResourceSetupResponse.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (pDUSessionResourceSetupResponse.RANUENGAPID == nil || (*pDUSessionResourceSetupResponse.RANUENGAPID) == *y.RANUENGAPID) && + pDUSessionResourceSetupResponse.PDUSessionResourceSetup.Equal(y.PDUSessionResourceSetup) && + pDUSessionResourceSetupResponse.PDUSessionResourceFailed.Equal(y.PDUSessionResourceFailed) && + (pDUSessionResourceSetupResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pDUSessionResourceSetupResponse.CriticalityDiagnostics == nil || (*pDUSessionResourceSetupResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (pDUSessionResourceSetupResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (pDUSessionResourceSetupResponse.UserLocationInformation == nil || (*pDUSessionResourceSetupResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + pDUSessionResourceSetupResponse.messageMeta.Equal(y.messageMeta) +} + +func (pDUSessionResourceSetupResponseTransfer PDUSessionResourceSetupResponseTransfer) Equal(y PDUSessionResourceSetupResponseTransfer) bool { + return pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.Equal(y.DLQosFlowPerTNLInformation) && + (pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation == nil) == (y.AdditionalDLQosFlowPerTNLInformation == nil) && pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation.Equal(y.AdditionalDLQosFlowPerTNLInformation) && + (pDUSessionResourceSetupResponseTransfer.SecurityResult == nil) == (y.SecurityResult == nil) && (pDUSessionResourceSetupResponseTransfer.SecurityResult == nil || (*pDUSessionResourceSetupResponseTransfer.SecurityResult).Equal(*y.SecurityResult)) && + (pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup == nil) == (y.QosFlowFailedToSetup == nil) && pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup.Equal(y.QosFlowFailedToSetup) && + (pDUSessionResourceSetupResponseTransfer.RedundantDLQosFlowPerTNLInformation == nil) == (y.RedundantDLQosFlowPerTNLInformation == nil) && (pDUSessionResourceSetupResponseTransfer.RedundantDLQosFlowPerTNLInformation == nil || (*pDUSessionResourceSetupResponseTransfer.RedundantDLQosFlowPerTNLInformation).Equal(*y.RedundantDLQosFlowPerTNLInformation)) && + pDUSessionResourceSetupResponseTransfer.AdditionalRedundantDLQosFlowPerTNLInformation.Equal(y.AdditionalRedundantDLQosFlowPerTNLInformation) && + (pDUSessionResourceSetupResponseTransfer.UsedRSNInformation == nil) == (y.UsedRSNInformation == nil) && (pDUSessionResourceSetupResponseTransfer.UsedRSNInformation == nil || (*pDUSessionResourceSetupResponseTransfer.UsedRSNInformation).Equal(*y.UsedRSNInformation)) && + (pDUSessionResourceSetupResponseTransfer.GlobalRANNodeID == nil) == (y.GlobalRANNodeID == nil) && (pDUSessionResourceSetupResponseTransfer.GlobalRANNodeID == nil || (*pDUSessionResourceSetupResponseTransfer.GlobalRANNodeID).Equal(*y.GlobalRANNodeID)) && + (pDUSessionResourceSetupResponseTransfer.MBSSupportIndicator == nil) == (y.MBSSupportIndicator == nil) && (pDUSessionResourceSetupResponseTransfer.MBSSupportIndicator == nil || (*pDUSessionResourceSetupResponseTransfer.MBSSupportIndicator) == *y.MBSSupportIndicator) && + pDUSessionResourceSetupResponseTransfer.MBSSessionSetupResponseList.Equal(y.MBSSessionSetupResponseList) && + pDUSessionResourceSetupResponseTransfer.MBSSessionFailedtoSetupList.Equal(y.MBSSessionFailedtoSetupList) && + pDUSessionResourceSetupResponseTransfer.QoSFlowTSCList.Equal(y.QoSFlowTSCList) && + (pDUSessionResourceSetupResponseTransfer.UplinkTLContainer == nil) == (y.UplinkTLContainer == nil) && (pDUSessionResourceSetupResponseTransfer.UplinkTLContainer == nil || (*pDUSessionResourceSetupResponseTransfer.UplinkTLContainer).Equal(*y.UplinkTLContainer)) && + pDUSessionResourceSetupResponseTransfer.ECNMarkingorCongestionInformationReportingStatus.Equal(y.ECNMarkingorCongestionInformationReportingStatus) && + (pDUSessionResourceSetupResponseTransfer.PDUSetbasedHandlingIndicator == nil) == (y.PDUSetbasedHandlingIndicator == nil) && (pDUSessionResourceSetupResponseTransfer.PDUSetbasedHandlingIndicator == nil || (*pDUSessionResourceSetupResponseTransfer.PDUSetbasedHandlingIndicator) == *y.PDUSetbasedHandlingIndicator) && + pDUSessionResourceSetupResponseTransfer.iEExtensions == y.iEExtensions && + pDUSessionResourceSetupResponseTransfer.extensions == y.extensions +} + +func (pDUSessionResourceSetupUnsuccessfulTransfer PDUSessionResourceSetupUnsuccessfulTransfer) Equal(y PDUSessionResourceSetupUnsuccessfulTransfer) bool { + return pDUSessionResourceSetupUnsuccessfulTransfer.extensions == y.extensions && + pDUSessionResourceSetupUnsuccessfulTransfer.Cause.Equal(y.Cause) && + (pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics == nil || (*pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceSwitchedItem PDUSessionResourceSwitchedItem) Equal(y PDUSessionResourceSwitchedItem) bool { + return pDUSessionResourceSwitchedItem.PDUSessionID == y.PDUSessionID && + pDUSessionResourceSwitchedItem.Transfer.Equal(y.Transfer) && + (pDUSessionResourceSwitchedItem.PduSessionExpectedUEActivityBehaviour == nil) == (y.PduSessionExpectedUEActivityBehaviour == nil) && (pDUSessionResourceSwitchedItem.PduSessionExpectedUEActivityBehaviour == nil || (*pDUSessionResourceSwitchedItem.PduSessionExpectedUEActivityBehaviour).Equal(*y.PduSessionExpectedUEActivityBehaviour)) && + pDUSessionResourceSwitchedItem.iEExtensions == y.iEExtensions && + pDUSessionResourceSwitchedItem.extensions == y.extensions +} + +func (pDUSessionResourceSwitchedList PDUSessionResourceSwitchedList) Equal(y PDUSessionResourceSwitchedList) bool { + if len(pDUSessionResourceSwitchedList) != len(y) { + return false + } + for i := range pDUSessionResourceSwitchedList { + if !(pDUSessionResourceSwitchedList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceToBeSwitchedDLItem PDUSessionResourceToBeSwitchedDLItem) Equal(y PDUSessionResourceToBeSwitchedDLItem) bool { + return pDUSessionResourceToBeSwitchedDLItem.PDUSessionID == y.PDUSessionID && + pDUSessionResourceToBeSwitchedDLItem.Transfer.Equal(y.Transfer) && + pDUSessionResourceToBeSwitchedDLItem.iEExtensions == y.iEExtensions && + pDUSessionResourceToBeSwitchedDLItem.extensions == y.extensions +} + +func (pDUSessionResourceToBeSwitchedDLList PDUSessionResourceToBeSwitchedDLList) Equal(y PDUSessionResourceToBeSwitchedDLList) bool { + if len(pDUSessionResourceToBeSwitchedDLList) != len(y) { + return false + } + for i := range pDUSessionResourceToBeSwitchedDLList { + if !(pDUSessionResourceToBeSwitchedDLList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceToReleaseItemHOCmd PDUSessionResourceToReleaseItemHOCmd) Equal(y PDUSessionResourceToReleaseItemHOCmd) bool { + return pDUSessionResourceToReleaseItemHOCmd.extensions == y.extensions && + pDUSessionResourceToReleaseItemHOCmd.PDUSessionID == y.PDUSessionID && + pDUSessionResourceToReleaseItemHOCmd.Transfer.Equal(y.Transfer) && + pDUSessionResourceToReleaseItemHOCmd.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceToReleaseItemRelCmd PDUSessionResourceToReleaseItemRelCmd) Equal(y PDUSessionResourceToReleaseItemRelCmd) bool { + return pDUSessionResourceToReleaseItemRelCmd.extensions == y.extensions && + pDUSessionResourceToReleaseItemRelCmd.PDUSessionID == y.PDUSessionID && + pDUSessionResourceToReleaseItemRelCmd.Transfer.Equal(y.Transfer) && + pDUSessionResourceToReleaseItemRelCmd.iEExtensions == y.iEExtensions +} + +func (pDUSessionResourceToReleaseListHOCmd PDUSessionResourceToReleaseListHOCmd) Equal(y PDUSessionResourceToReleaseListHOCmd) bool { + if len(pDUSessionResourceToReleaseListHOCmd) != len(y) { + return false + } + for i := range pDUSessionResourceToReleaseListHOCmd { + if !(pDUSessionResourceToReleaseListHOCmd[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionResourceToReleaseListRelCmd PDUSessionResourceToReleaseListRelCmd) Equal(y PDUSessionResourceToReleaseListRelCmd) bool { + if len(pDUSessionResourceToReleaseListRelCmd) != len(y) { + return false + } + for i := range pDUSessionResourceToReleaseListRelCmd { + if !(pDUSessionResourceToReleaseListRelCmd[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pDUSessionUsageReport PDUSessionUsageReport) Equal(y PDUSessionUsageReport) bool { + return pDUSessionUsageReport.RATType == y.RATType && + pDUSessionUsageReport.PDUSessionTimedReportList.Equal(y.PDUSessionTimedReportList) && + pDUSessionUsageReport.iEExtensions == y.iEExtensions && + pDUSessionUsageReport.extensions == y.extensions +} + +func (pDUsetQoSInformation PDUsetQoSInformation) Equal(y PDUsetQoSInformation) bool { + return (pDUsetQoSInformation.PduSetDelayBudget == nil) == (y.PduSetDelayBudget == nil) && (pDUsetQoSInformation.PduSetDelayBudget == nil || (*pDUsetQoSInformation.PduSetDelayBudget) == *y.PduSetDelayBudget) && + (pDUsetQoSInformation.PduSetErrorRate == nil) == (y.PduSetErrorRate == nil) && (pDUsetQoSInformation.PduSetErrorRate == nil || (*pDUsetQoSInformation.PduSetErrorRate).Equal(*y.PduSetErrorRate)) && + (pDUsetQoSInformation.PduSetIntegratedHandlingInformation == nil) == (y.PduSetIntegratedHandlingInformation == nil) && (pDUsetQoSInformation.PduSetIntegratedHandlingInformation == nil || (*pDUsetQoSInformation.PduSetIntegratedHandlingInformation) == *y.PduSetIntegratedHandlingInformation) && + pDUsetQoSInformation.iEExtensions == y.iEExtensions && + pDUsetQoSInformation.extensions == y.extensions +} + +func (pDUsetQoSParameters PDUsetQoSParameters) Equal(y PDUsetQoSParameters) bool { + return (pDUsetQoSParameters.UlPDUSetQoSInformation == nil) == (y.UlPDUSetQoSInformation == nil) && (pDUsetQoSParameters.UlPDUSetQoSInformation == nil || (*pDUsetQoSParameters.UlPDUSetQoSInformation).Equal(*y.UlPDUSetQoSInformation)) && + (pDUsetQoSParameters.DlPDUSetQoSInformation == nil) == (y.DlPDUSetQoSInformation == nil) && (pDUsetQoSParameters.DlPDUSetQoSInformation == nil || (*pDUsetQoSParameters.DlPDUSetQoSInformation).Equal(*y.DlPDUSetQoSInformation)) && + pDUsetQoSParameters.iEExtensions == y.iEExtensions && + pDUsetQoSParameters.extensions == y.extensions +} + +func (pEIPSassistanceInformation PEIPSassistanceInformation) Equal(y PEIPSassistanceInformation) bool { + return pEIPSassistanceInformation == y +} + +func (pLMNAreaBasedQMC PLMNAreaBasedQMC) Equal(y PLMNAreaBasedQMC) bool { + return pLMNAreaBasedQMC.PlmnListforQMC.Equal(y.PlmnListforQMC) && + pLMNAreaBasedQMC.iEExtensions == y.iEExtensions && + pLMNAreaBasedQMC.extensions == y.extensions +} + +func (pLMNListforQMC PLMNListforQMC) Equal(y PLMNListforQMC) bool { + if len(pLMNListforQMC) != len(y) { + return false + } + for i := range pLMNListforQMC { + if !(pLMNListforQMC[i] == y[i]) { + return false + } + } + return true +} + +func (pLMNSupportItem PLMNSupportItem) Equal(y PLMNSupportItem) bool { + return pLMNSupportItem.PLMNIdentity == y.PLMNIdentity && + pLMNSupportItem.SliceSupportList.Equal(y.SliceSupportList) && + (pLMNSupportItem.NPNSupport == nil) == (y.NPNSupport == nil) && (pLMNSupportItem.NPNSupport == nil || (*pLMNSupportItem.NPNSupport).Equal(*y.NPNSupport)) && + pLMNSupportItem.ExtendedSliceSupportList.Equal(y.ExtendedSliceSupportList) && + (pLMNSupportItem.OnboardingSupport == nil) == (y.OnboardingSupport == nil) && (pLMNSupportItem.OnboardingSupport == nil || (*pLMNSupportItem.OnboardingSupport) == *y.OnboardingSupport) && + pLMNSupportItem.iEExtensions == y.iEExtensions && + pLMNSupportItem.extensions == y.extensions +} + +func (pLMNSupportList PLMNSupportList) Equal(y PLMNSupportList) bool { + if len(pLMNSupportList) != len(y) { + return false + } + for i := range pLMNSupportList { + if !(pLMNSupportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pNINPNAreaScopeofMDT PNINPNAreaScopeofMDT) Equal(y PNINPNAreaScopeofMDT) bool { + return pNINPNAreaScopeofMDT.CAGListforMDT.Equal(y.CAGListforMDT) && + pNINPNAreaScopeofMDT.iEExtensions == y.iEExtensions && + pNINPNAreaScopeofMDT.extensions == y.extensions +} + +func (pNINPNBasedMDT PNINPNBasedMDT) Equal(y PNINPNBasedMDT) bool { + return pNINPNBasedMDT.CAGListforMDT.Equal(y.CAGListforMDT) && + pNINPNBasedMDT.iEExtensions == y.iEExtensions && + pNINPNBasedMDT.extensions == y.extensions +} + +func (pNINPNMobilityInformation PNINPNMobilityInformation) Equal(y PNINPNMobilityInformation) bool { + return pNINPNMobilityInformation.AllowedPNINPIList.Equal(y.AllowedPNINPIList) && + pNINPNMobilityInformation.iEExtensions == y.iEExtensions && + pNINPNMobilityInformation.extensions == y.extensions +} + +func (pWSCancelRequest PWSCancelRequest) Equal(y PWSCancelRequest) bool { + return pWSCancelRequest.MessageIdentifier == y.MessageIdentifier && + pWSCancelRequest.SerialNumber == y.SerialNumber && + (pWSCancelRequest.WarningAreaList == nil) == (y.WarningAreaList == nil) && (pWSCancelRequest.WarningAreaList == nil || (*pWSCancelRequest.WarningAreaList).Equal(*y.WarningAreaList)) && + (pWSCancelRequest.CancelAllWarningMessages == nil) == (y.CancelAllWarningMessages == nil) && (pWSCancelRequest.CancelAllWarningMessages == nil || (*pWSCancelRequest.CancelAllWarningMessages) == *y.CancelAllWarningMessages) && + pWSCancelRequest.messageMeta.Equal(y.messageMeta) +} + +func (pWSCancelResponse PWSCancelResponse) Equal(y PWSCancelResponse) bool { + return pWSCancelResponse.MessageIdentifier == y.MessageIdentifier && + pWSCancelResponse.SerialNumber == y.SerialNumber && + (pWSCancelResponse.BroadcastCancelledAreaList == nil) == (y.BroadcastCancelledAreaList == nil) && (pWSCancelResponse.BroadcastCancelledAreaList == nil || (*pWSCancelResponse.BroadcastCancelledAreaList).Equal(*y.BroadcastCancelledAreaList)) && + (pWSCancelResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pWSCancelResponse.CriticalityDiagnostics == nil || (*pWSCancelResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pWSCancelResponse.messageMeta.Equal(y.messageMeta) +} + +func (pWSFailedCellIDList PWSFailedCellIDList) Equal(y PWSFailedCellIDList) bool { + return (pWSFailedCellIDList.EUTRACGIPWSFailedList == nil) == (y.EUTRACGIPWSFailedList == nil) && (pWSFailedCellIDList.EUTRACGIPWSFailedList == nil || (*pWSFailedCellIDList.EUTRACGIPWSFailedList).Equal(*y.EUTRACGIPWSFailedList)) && + (pWSFailedCellIDList.NRCGIPWSFailedList == nil) == (y.NRCGIPWSFailedList == nil) && (pWSFailedCellIDList.NRCGIPWSFailedList == nil || (*pWSFailedCellIDList.NRCGIPWSFailedList).Equal(*y.NRCGIPWSFailedList)) && + (pWSFailedCellIDList.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (pWSFailedCellIDList.ChoiceExtension == nil || (*pWSFailedCellIDList.ChoiceExtension) == *y.ChoiceExtension) +} + +func (pWSFailureIndication PWSFailureIndication) Equal(y PWSFailureIndication) bool { + return pWSFailureIndication.PWSFailedCellIDList.Equal(y.PWSFailedCellIDList) && + pWSFailureIndication.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + pWSFailureIndication.messageMeta.Equal(y.messageMeta) +} + +func (pWSRestartIndication PWSRestartIndication) Equal(y PWSRestartIndication) bool { + return pWSRestartIndication.CellIDListForRestart.Equal(y.CellIDListForRestart) && + pWSRestartIndication.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + pWSRestartIndication.TAIListForRestart.Equal(y.TAIListForRestart) && + pWSRestartIndication.EmergencyAreaIDListForRestart.Equal(y.EmergencyAreaIDListForRestart) && + pWSRestartIndication.messageMeta.Equal(y.messageMeta) +} + +func (packetErrorRate PacketErrorRate) Equal(y PacketErrorRate) bool { + return packetErrorRate == y +} + +func (paging Paging) Equal(y Paging) bool { + return (paging.UEPagingIdentity == nil) == (y.UEPagingIdentity == nil) && (paging.UEPagingIdentity == nil || (*paging.UEPagingIdentity).Equal(*y.UEPagingIdentity)) && + (paging.PagingDRX == nil) == (y.PagingDRX == nil) && (paging.PagingDRX == nil || (*paging.PagingDRX) == *y.PagingDRX) && + paging.TAIListForPaging.Equal(y.TAIListForPaging) && + (paging.PagingPriority == nil) == (y.PagingPriority == nil) && (paging.PagingPriority == nil || (*paging.PagingPriority) == *y.PagingPriority) && + (paging.UERadioCapabilityForPaging == nil) == (y.UERadioCapabilityForPaging == nil) && (paging.UERadioCapabilityForPaging == nil || (*paging.UERadioCapabilityForPaging).Equal(*y.UERadioCapabilityForPaging)) && + (paging.PagingOrigin == nil) == (y.PagingOrigin == nil) && (paging.PagingOrigin == nil || (*paging.PagingOrigin) == *y.PagingOrigin) && + (paging.AssistanceDataForPaging == nil) == (y.AssistanceDataForPaging == nil) && (paging.AssistanceDataForPaging == nil || (*paging.AssistanceDataForPaging).Equal(*y.AssistanceDataForPaging)) && + (paging.NBIoTPagingeDRXInfo == nil) == (y.NBIoTPagingeDRXInfo == nil) && (paging.NBIoTPagingeDRXInfo == nil || (*paging.NBIoTPagingeDRXInfo).Equal(*y.NBIoTPagingeDRXInfo)) && + (paging.NBIoTPagingDRX == nil) == (y.NBIoTPagingDRX == nil) && (paging.NBIoTPagingDRX == nil || (*paging.NBIoTPagingDRX) == *y.NBIoTPagingDRX) && + (paging.EnhancedCoverageRestriction == nil) == (y.EnhancedCoverageRestriction == nil) && (paging.EnhancedCoverageRestriction == nil || (*paging.EnhancedCoverageRestriction) == *y.EnhancedCoverageRestriction) && + (paging.WUSAssistanceInformation == nil) == (y.WUSAssistanceInformation == nil) && (paging.WUSAssistanceInformation == nil || (*paging.WUSAssistanceInformation).Equal(*y.WUSAssistanceInformation)) && + (paging.EUTRAPagingeDRXInformation == nil) == (y.EUTRAPagingeDRXInformation == nil) && (paging.EUTRAPagingeDRXInformation == nil || (*paging.EUTRAPagingeDRXInformation).Equal(*y.EUTRAPagingeDRXInformation)) && + (paging.CEmodeBrestricted == nil) == (y.CEmodeBrestricted == nil) && (paging.CEmodeBrestricted == nil || (*paging.CEmodeBrestricted) == *y.CEmodeBrestricted) && + (paging.NRPagingeDRXInformation == nil) == (y.NRPagingeDRXInformation == nil) && (paging.NRPagingeDRXInformation == nil || (*paging.NRPagingeDRXInformation).Equal(*y.NRPagingeDRXInformation)) && + (paging.PagingCause == nil) == (y.PagingCause == nil) && (paging.PagingCause == nil || (*paging.PagingCause) == *y.PagingCause) && + (paging.PEIPSassistanceInformation == nil) == (y.PEIPSassistanceInformation == nil) && (paging.PEIPSassistanceInformation == nil || (*paging.PEIPSassistanceInformation).Equal(*y.PEIPSassistanceInformation)) && + (paging.LPWUSPSAssistanceInformation == nil) == (y.LPWUSPSAssistanceInformation == nil) && (paging.LPWUSPSAssistanceInformation == nil || (*paging.LPWUSPSAssistanceInformation).Equal(*y.LPWUSPSAssistanceInformation)) && + (paging.LPWUSDisableIndication == nil) == (y.LPWUSDisableIndication == nil) && (paging.LPWUSDisableIndication == nil || (*paging.LPWUSDisableIndication) == *y.LPWUSDisableIndication) && + paging.messageMeta.Equal(y.messageMeta) +} + +func (pagingAssisDataforCEcapabUE PagingAssisDataforCEcapabUE) Equal(y PagingAssisDataforCEcapabUE) bool { + return pagingAssisDataforCEcapabUE.EUTRACGI.Equal(y.EUTRACGI) && + pagingAssisDataforCEcapabUE.CoverageEnhancementLevel.Equal(y.CoverageEnhancementLevel) && + pagingAssisDataforCEcapabUE.iEExtensions == y.iEExtensions && + pagingAssisDataforCEcapabUE.extensions == y.extensions +} + +func (pagingAttemptInformation PagingAttemptInformation) Equal(y PagingAttemptInformation) bool { + return pagingAttemptInformation.PagingAttemptCount == y.PagingAttemptCount && + pagingAttemptInformation.IntendedNumberOfPagingAttempts == y.IntendedNumberOfPagingAttempts && + (pagingAttemptInformation.NextPagingAreaScope == nil) == (y.NextPagingAreaScope == nil) && (pagingAttemptInformation.NextPagingAreaScope == nil || (*pagingAttemptInformation.NextPagingAreaScope) == *y.NextPagingAreaScope) && + pagingAttemptInformation.iEExtensions == y.iEExtensions && + pagingAttemptInformation.extensions == y.extensions +} + +func (partiallyAllowedNSSAI PartiallyAllowedNSSAI) Equal(y PartiallyAllowedNSSAI) bool { + if len(partiallyAllowedNSSAI) != len(y) { + return false + } + for i := range partiallyAllowedNSSAI { + if !(partiallyAllowedNSSAI[i].Equal(y[i])) { + return false + } + } + return true +} + +func (partiallyAllowedNSSAIItem PartiallyAllowedNSSAIItem) Equal(y PartiallyAllowedNSSAIItem) bool { + return partiallyAllowedNSSAIItem.extensions == y.extensions && + partiallyAllowedNSSAIItem.SNSSAI.Equal(y.SNSSAI) && + partiallyAllowedNSSAIItem.iEExtensions == y.iEExtensions +} + +func (pathSwitchRequest PathSwitchRequest) Equal(y PathSwitchRequest) bool { + return pathSwitchRequest.RANUENGAPID == y.RANUENGAPID && + pathSwitchRequest.SourceAMFUENGAPID == y.SourceAMFUENGAPID && + (pathSwitchRequest.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (pathSwitchRequest.UserLocationInformation == nil || (*pathSwitchRequest.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (pathSwitchRequest.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (pathSwitchRequest.UESecurityCapabilities == nil || (*pathSwitchRequest.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && + pathSwitchRequest.PDUSessionResourceToBeSwitchedDLList.Equal(y.PDUSessionResourceToBeSwitchedDLList) && + pathSwitchRequest.PDUSessionResourceFailedToSetup.Equal(y.PDUSessionResourceFailedToSetup) && + (pathSwitchRequest.SourceAMFGUAMI == nil) == (y.SourceAMFGUAMI == nil) && (pathSwitchRequest.SourceAMFGUAMI == nil || (*pathSwitchRequest.SourceAMFGUAMI).Equal(*y.SourceAMFGUAMI)) && + (pathSwitchRequest.RRCResumeCause == nil) == (y.RRCResumeCause == nil) && (pathSwitchRequest.RRCResumeCause == nil || (*pathSwitchRequest.RRCResumeCause) == *y.RRCResumeCause) && + (pathSwitchRequest.RedCapIndication == nil) == (y.RedCapIndication == nil) && (pathSwitchRequest.RedCapIndication == nil || (*pathSwitchRequest.RedCapIndication) == *y.RedCapIndication) && + (pathSwitchRequest.ERedCapIndication == nil) == (y.ERedCapIndication == nil) && (pathSwitchRequest.ERedCapIndication == nil || (*pathSwitchRequest.ERedCapIndication) == *y.ERedCapIndication) && + pathSwitchRequest.messageMeta.Equal(y.messageMeta) +} + +func (pathSwitchRequestAcknowledge PathSwitchRequestAcknowledge) Equal(y PathSwitchRequestAcknowledge) bool { + return (pathSwitchRequestAcknowledge.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (pathSwitchRequestAcknowledge.AMFUENGAPID == nil || (*pathSwitchRequestAcknowledge.AMFUENGAPID) == *y.AMFUENGAPID) && + (pathSwitchRequestAcknowledge.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (pathSwitchRequestAcknowledge.RANUENGAPID == nil || (*pathSwitchRequestAcknowledge.RANUENGAPID) == *y.RANUENGAPID) && + (pathSwitchRequestAcknowledge.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (pathSwitchRequestAcknowledge.UESecurityCapabilities == nil || (*pathSwitchRequestAcknowledge.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && + pathSwitchRequestAcknowledge.SecurityContext.Equal(y.SecurityContext) && + pathSwitchRequestAcknowledge.PDUSessionResourceSwitchedList.Equal(y.PDUSessionResourceSwitchedList) && + pathSwitchRequestAcknowledge.PDUSessionResourceReleased.Equal(y.PDUSessionResourceReleased) && + pathSwitchRequestAcknowledge.AllowedNSSAI.Equal(y.AllowedNSSAI) && + (pathSwitchRequestAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pathSwitchRequestAcknowledge.CriticalityDiagnostics == nil || (*pathSwitchRequestAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (pathSwitchRequestAcknowledge.AMFUENGAPID2 == nil) == (y.AMFUENGAPID2 == nil) && (pathSwitchRequestAcknowledge.AMFUENGAPID2 == nil || (*pathSwitchRequestAcknowledge.AMFUENGAPID2) == *y.AMFUENGAPID2) && + (pathSwitchRequestAcknowledge.NewSecurityContextInd == nil) == (y.NewSecurityContextInd == nil) && (pathSwitchRequestAcknowledge.NewSecurityContextInd == nil || (*pathSwitchRequestAcknowledge.NewSecurityContextInd) == *y.NewSecurityContextInd) && + (pathSwitchRequestAcknowledge.CoreNetworkAssistanceInformationForInactive == nil) == (y.CoreNetworkAssistanceInformationForInactive == nil) && (pathSwitchRequestAcknowledge.CoreNetworkAssistanceInformationForInactive == nil || (*pathSwitchRequestAcknowledge.CoreNetworkAssistanceInformationForInactive).Equal(*y.CoreNetworkAssistanceInformationForInactive)) && + (pathSwitchRequestAcknowledge.RRCInactiveTransitionReportRequest == nil) == (y.RRCInactiveTransitionReportRequest == nil) && (pathSwitchRequestAcknowledge.RRCInactiveTransitionReportRequest == nil || (*pathSwitchRequestAcknowledge.RRCInactiveTransitionReportRequest) == *y.RRCInactiveTransitionReportRequest) && + (pathSwitchRequestAcknowledge.RedirectionVoiceFallback == nil) == (y.RedirectionVoiceFallback == nil) && (pathSwitchRequestAcknowledge.RedirectionVoiceFallback == nil || (*pathSwitchRequestAcknowledge.RedirectionVoiceFallback) == *y.RedirectionVoiceFallback) && + (pathSwitchRequestAcknowledge.CNAssistedRANTuning == nil) == (y.CNAssistedRANTuning == nil) && (pathSwitchRequestAcknowledge.CNAssistedRANTuning == nil || (*pathSwitchRequestAcknowledge.CNAssistedRANTuning).Equal(*y.CNAssistedRANTuning)) && + (pathSwitchRequestAcknowledge.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (pathSwitchRequestAcknowledge.SRVCCOperationPossible == nil || (*pathSwitchRequestAcknowledge.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (pathSwitchRequestAcknowledge.EnhancedCoverageRestriction == nil) == (y.EnhancedCoverageRestriction == nil) && (pathSwitchRequestAcknowledge.EnhancedCoverageRestriction == nil || (*pathSwitchRequestAcknowledge.EnhancedCoverageRestriction) == *y.EnhancedCoverageRestriction) && + (pathSwitchRequestAcknowledge.ExtendedConnectedTime == nil) == (y.ExtendedConnectedTime == nil) && (pathSwitchRequestAcknowledge.ExtendedConnectedTime == nil || (*pathSwitchRequestAcknowledge.ExtendedConnectedTime) == *y.ExtendedConnectedTime) && + (pathSwitchRequestAcknowledge.UEDifferentiationInfo == nil) == (y.UEDifferentiationInfo == nil) && (pathSwitchRequestAcknowledge.UEDifferentiationInfo == nil || (*pathSwitchRequestAcknowledge.UEDifferentiationInfo).Equal(*y.UEDifferentiationInfo)) && + (pathSwitchRequestAcknowledge.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (pathSwitchRequestAcknowledge.NRV2XServicesAuthorized == nil || (*pathSwitchRequestAcknowledge.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (pathSwitchRequestAcknowledge.LTEV2XServicesAuthorized == nil) == (y.LTEV2XServicesAuthorized == nil) && (pathSwitchRequestAcknowledge.LTEV2XServicesAuthorized == nil || (*pathSwitchRequestAcknowledge.LTEV2XServicesAuthorized).Equal(*y.LTEV2XServicesAuthorized)) && + (pathSwitchRequestAcknowledge.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (pathSwitchRequestAcknowledge.NRUESidelinkAggregateMaximumBitrate == nil || (*pathSwitchRequestAcknowledge.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (pathSwitchRequestAcknowledge.LTEUESidelinkAggregateMaximumBitrate == nil) == (y.LTEUESidelinkAggregateMaximumBitrate == nil) && (pathSwitchRequestAcknowledge.LTEUESidelinkAggregateMaximumBitrate == nil || (*pathSwitchRequestAcknowledge.LTEUESidelinkAggregateMaximumBitrate).Equal(*y.LTEUESidelinkAggregateMaximumBitrate)) && + (pathSwitchRequestAcknowledge.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (pathSwitchRequestAcknowledge.PC5QoSParameters == nil || (*pathSwitchRequestAcknowledge.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (pathSwitchRequestAcknowledge.CEmodeBrestricted == nil) == (y.CEmodeBrestricted == nil) && (pathSwitchRequestAcknowledge.CEmodeBrestricted == nil || (*pathSwitchRequestAcknowledge.CEmodeBrestricted) == *y.CEmodeBrestricted) && + (pathSwitchRequestAcknowledge.UEUPCIoTSupport == nil) == (y.UEUPCIoTSupport == nil) && (pathSwitchRequestAcknowledge.UEUPCIoTSupport == nil || (*pathSwitchRequestAcknowledge.UEUPCIoTSupport) == *y.UEUPCIoTSupport) && + (pathSwitchRequestAcknowledge.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (pathSwitchRequestAcknowledge.UERadioCapabilityID == nil || (*pathSwitchRequestAcknowledge.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && + pathSwitchRequestAcknowledge.ManagementBasedMDTPLMNList.Equal(y.ManagementBasedMDTPLMNList) && + (pathSwitchRequestAcknowledge.TimeSyncAssistanceInfo == nil) == (y.TimeSyncAssistanceInfo == nil) && (pathSwitchRequestAcknowledge.TimeSyncAssistanceInfo == nil || (*pathSwitchRequestAcknowledge.TimeSyncAssistanceInfo).Equal(*y.TimeSyncAssistanceInfo)) && + (pathSwitchRequestAcknowledge.FiveGProSeAuthorized == nil) == (y.FiveGProSeAuthorized == nil) && (pathSwitchRequestAcknowledge.FiveGProSeAuthorized == nil || (*pathSwitchRequestAcknowledge.FiveGProSeAuthorized).Equal(*y.FiveGProSeAuthorized)) && + (pathSwitchRequestAcknowledge.FiveGProSeUEPC5AggregateMaximumBitRate == nil) == (y.FiveGProSeUEPC5AggregateMaximumBitRate == nil) && (pathSwitchRequestAcknowledge.FiveGProSeUEPC5AggregateMaximumBitRate == nil || (*pathSwitchRequestAcknowledge.FiveGProSeUEPC5AggregateMaximumBitRate).Equal(*y.FiveGProSeUEPC5AggregateMaximumBitRate)) && + (pathSwitchRequestAcknowledge.FiveGProSePC5QoSParameters == nil) == (y.FiveGProSePC5QoSParameters == nil) && (pathSwitchRequestAcknowledge.FiveGProSePC5QoSParameters == nil || (*pathSwitchRequestAcknowledge.FiveGProSePC5QoSParameters).Equal(*y.FiveGProSePC5QoSParameters)) && + pathSwitchRequestAcknowledge.ManagementBasedMDTPLMNModificationList.Equal(y.ManagementBasedMDTPLMNModificationList) && + (pathSwitchRequestAcknowledge.IABAuthorized == nil) == (y.IABAuthorized == nil) && (pathSwitchRequestAcknowledge.IABAuthorized == nil || (*pathSwitchRequestAcknowledge.IABAuthorized) == *y.IABAuthorized) && + (pathSwitchRequestAcknowledge.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (pathSwitchRequestAcknowledge.AerialUEsubscriptionInformation == nil || (*pathSwitchRequestAcknowledge.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (pathSwitchRequestAcknowledge.NRA2XServicesAuthorized == nil) == (y.NRA2XServicesAuthorized == nil) && (pathSwitchRequestAcknowledge.NRA2XServicesAuthorized == nil || (*pathSwitchRequestAcknowledge.NRA2XServicesAuthorized).Equal(*y.NRA2XServicesAuthorized)) && + (pathSwitchRequestAcknowledge.LTEA2XServicesAuthorized == nil) == (y.LTEA2XServicesAuthorized == nil) && (pathSwitchRequestAcknowledge.LTEA2XServicesAuthorized == nil || (*pathSwitchRequestAcknowledge.LTEA2XServicesAuthorized).Equal(*y.LTEA2XServicesAuthorized)) && + (pathSwitchRequestAcknowledge.NRA2XUEPC5AggregateMaximumBitRate == nil) == (y.NRA2XUEPC5AggregateMaximumBitRate == nil) && (pathSwitchRequestAcknowledge.NRA2XUEPC5AggregateMaximumBitRate == nil || (*pathSwitchRequestAcknowledge.NRA2XUEPC5AggregateMaximumBitRate).Equal(*y.NRA2XUEPC5AggregateMaximumBitRate)) && + (pathSwitchRequestAcknowledge.LTEA2XUEPC5AggregateMaximumBitRate == nil) == (y.LTEA2XUEPC5AggregateMaximumBitRate == nil) && (pathSwitchRequestAcknowledge.LTEA2XUEPC5AggregateMaximumBitRate == nil || (*pathSwitchRequestAcknowledge.LTEA2XUEPC5AggregateMaximumBitRate).Equal(*y.LTEA2XUEPC5AggregateMaximumBitRate)) && + (pathSwitchRequestAcknowledge.A2XPC5QoSParameters == nil) == (y.A2XPC5QoSParameters == nil) && (pathSwitchRequestAcknowledge.A2XPC5QoSParameters == nil || (*pathSwitchRequestAcknowledge.A2XPC5QoSParameters).Equal(*y.A2XPC5QoSParameters)) && + (pathSwitchRequestAcknowledge.MobileIABAuthorized == nil) == (y.MobileIABAuthorized == nil) && (pathSwitchRequestAcknowledge.MobileIABAuthorized == nil || (*pathSwitchRequestAcknowledge.MobileIABAuthorized) == *y.MobileIABAuthorized) && + pathSwitchRequestAcknowledge.PartiallyAllowedNSSAI.Equal(y.PartiallyAllowedNSSAI) && + (pathSwitchRequestAcknowledge.SLPositioningRangingServiceInfo == nil) == (y.SLPositioningRangingServiceInfo == nil) && (pathSwitchRequestAcknowledge.SLPositioningRangingServiceInfo == nil || (*pathSwitchRequestAcknowledge.SLPositioningRangingServiceInfo).Equal(*y.SLPositioningRangingServiceInfo)) && + pathSwitchRequestAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (pathSwitchRequestAcknowledgeTransfer PathSwitchRequestAcknowledgeTransfer) Equal(y PathSwitchRequestAcknowledgeTransfer) bool { + return (pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation == nil) == (y.ULNGUUPTNLInformation == nil) && (pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation == nil || (*pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation).Equal(*y.ULNGUUPTNLInformation)) && + (pathSwitchRequestAcknowledgeTransfer.SecurityIndication == nil) == (y.SecurityIndication == nil) && (pathSwitchRequestAcknowledgeTransfer.SecurityIndication == nil || (*pathSwitchRequestAcknowledgeTransfer.SecurityIndication).Equal(*y.SecurityIndication)) && + pathSwitchRequestAcknowledgeTransfer.AdditionalNGUUPTNLInformation.Equal(y.AdditionalNGUUPTNLInformation) && + (pathSwitchRequestAcknowledgeTransfer.RedundantULNGUUPTNLInformation == nil) == (y.RedundantULNGUUPTNLInformation == nil) && (pathSwitchRequestAcknowledgeTransfer.RedundantULNGUUPTNLInformation == nil || (*pathSwitchRequestAcknowledgeTransfer.RedundantULNGUUPTNLInformation).Equal(*y.RedundantULNGUUPTNLInformation)) && + pathSwitchRequestAcknowledgeTransfer.AdditionalRedundantNGUUPTNLInformation.Equal(y.AdditionalRedundantNGUUPTNLInformation) && + pathSwitchRequestAcknowledgeTransfer.QosFlowParametersList.Equal(y.QosFlowParametersList) && + pathSwitchRequestAcknowledgeTransfer.iEExtensions == y.iEExtensions && + pathSwitchRequestAcknowledgeTransfer.extensions == y.extensions +} + +func (pathSwitchRequestFailure PathSwitchRequestFailure) Equal(y PathSwitchRequestFailure) bool { + return (pathSwitchRequestFailure.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (pathSwitchRequestFailure.AMFUENGAPID == nil || (*pathSwitchRequestFailure.AMFUENGAPID) == *y.AMFUENGAPID) && + (pathSwitchRequestFailure.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (pathSwitchRequestFailure.RANUENGAPID == nil || (*pathSwitchRequestFailure.RANUENGAPID) == *y.RANUENGAPID) && + pathSwitchRequestFailure.PDUSessionResourceReleased.Equal(y.PDUSessionResourceReleased) && + (pathSwitchRequestFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pathSwitchRequestFailure.CriticalityDiagnostics == nil || (*pathSwitchRequestFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pathSwitchRequestFailure.messageMeta.Equal(y.messageMeta) +} + +func (pathSwitchRequestSetupFailedTransfer PathSwitchRequestSetupFailedTransfer) Equal(y PathSwitchRequestSetupFailedTransfer) bool { + return pathSwitchRequestSetupFailedTransfer.extensions == y.extensions && + pathSwitchRequestSetupFailedTransfer.Cause.Equal(y.Cause) && + pathSwitchRequestSetupFailedTransfer.iEExtensions == y.iEExtensions +} + +func (pathSwitchRequestTransfer PathSwitchRequestTransfer) Equal(y PathSwitchRequestTransfer) bool { + return pathSwitchRequestTransfer.DLNGUUPTNLInformation.Equal(y.DLNGUUPTNLInformation) && + (pathSwitchRequestTransfer.DLNGUTNLInformationReused == nil) == (y.DLNGUTNLInformationReused == nil) && (pathSwitchRequestTransfer.DLNGUTNLInformationReused == nil || (*pathSwitchRequestTransfer.DLNGUTNLInformationReused) == *y.DLNGUTNLInformationReused) && + (pathSwitchRequestTransfer.UserPlaneSecurityInformation == nil) == (y.UserPlaneSecurityInformation == nil) && (pathSwitchRequestTransfer.UserPlaneSecurityInformation == nil || (*pathSwitchRequestTransfer.UserPlaneSecurityInformation).Equal(*y.UserPlaneSecurityInformation)) && + pathSwitchRequestTransfer.QosFlowAccepted.Equal(y.QosFlowAccepted) && + pathSwitchRequestTransfer.AdditionalDLQosFlowPerTNLInformation.Equal(y.AdditionalDLQosFlowPerTNLInformation) && + (pathSwitchRequestTransfer.RedundantDLNGUUPTNLInformation == nil) == (y.RedundantDLNGUUPTNLInformation == nil) && (pathSwitchRequestTransfer.RedundantDLNGUUPTNLInformation == nil || (*pathSwitchRequestTransfer.RedundantDLNGUUPTNLInformation).Equal(*y.RedundantDLNGUUPTNLInformation)) && + (pathSwitchRequestTransfer.RedundantDLNGUTNLInformationReused == nil) == (y.RedundantDLNGUTNLInformationReused == nil) && (pathSwitchRequestTransfer.RedundantDLNGUTNLInformationReused == nil || (*pathSwitchRequestTransfer.RedundantDLNGUTNLInformationReused) == *y.RedundantDLNGUTNLInformationReused) && + pathSwitchRequestTransfer.AdditionalRedundantDLQosFlowPerTNLInformation.Equal(y.AdditionalRedundantDLQosFlowPerTNLInformation) && + (pathSwitchRequestTransfer.UsedRSNInformation == nil) == (y.UsedRSNInformation == nil) && (pathSwitchRequestTransfer.UsedRSNInformation == nil || (*pathSwitchRequestTransfer.UsedRSNInformation).Equal(*y.UsedRSNInformation)) && + (pathSwitchRequestTransfer.GlobalRANNodeID == nil) == (y.GlobalRANNodeID == nil) && (pathSwitchRequestTransfer.GlobalRANNodeID == nil || (*pathSwitchRequestTransfer.GlobalRANNodeID).Equal(*y.GlobalRANNodeID)) && + (pathSwitchRequestTransfer.MBSSupportIndicator == nil) == (y.MBSSupportIndicator == nil) && (pathSwitchRequestTransfer.MBSSupportIndicator == nil || (*pathSwitchRequestTransfer.MBSSupportIndicator) == *y.MBSSupportIndicator) && + (pathSwitchRequestTransfer.PDUSetbasedHandlingIndicator == nil) == (y.PDUSetbasedHandlingIndicator == nil) && (pathSwitchRequestTransfer.PDUSetbasedHandlingIndicator == nil || (*pathSwitchRequestTransfer.PDUSetbasedHandlingIndicator) == *y.PDUSetbasedHandlingIndicator) && + pathSwitchRequestTransfer.ECNMarkingorCongestionInformationReportingStatus.Equal(y.ECNMarkingorCongestionInformationReportingStatus) && + pathSwitchRequestTransfer.iEExtensions == y.iEExtensions && + pathSwitchRequestTransfer.extensions == y.extensions +} + +func (pathSwitchRequestUnsuccessfulTransfer PathSwitchRequestUnsuccessfulTransfer) Equal(y PathSwitchRequestUnsuccessfulTransfer) bool { + return pathSwitchRequestUnsuccessfulTransfer.extensions == y.extensions && + pathSwitchRequestUnsuccessfulTransfer.Cause.Equal(y.Cause) && + pathSwitchRequestUnsuccessfulTransfer.iEExtensions == y.iEExtensions +} + +func (periodicReportingIEs PeriodicReportingIEs) Equal(y PeriodicReportingIEs) bool { + return periodicReportingIEs == y +} + +func (periodicityBound PeriodicityBound) Equal(y PeriodicityBound) bool { + return periodicityBound == y +} + +func (periodicityRange PeriodicityRange) Equal(y PeriodicityRange) bool { + return (periodicityRange.PeriodicityBound == nil) == (y.PeriodicityBound == nil) && (periodicityRange.PeriodicityBound == nil || (*periodicityRange.PeriodicityBound).Equal(*y.PeriodicityBound)) && + (periodicityRange.PeriodicityList == nil) == (y.PeriodicityList == nil) && (periodicityRange.PeriodicityList == nil || (*periodicityRange.PeriodicityList).Equal(*y.PeriodicityList)) && + (periodicityRange.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (periodicityRange.ChoiceExtension == nil || (*periodicityRange.ChoiceExtension) == *y.ChoiceExtension) +} + +func (qMCConfigInfo QMCConfigInfo) Equal(y QMCConfigInfo) bool { + return qMCConfigInfo.UEAppLayerMeasInfoList.Equal(y.UEAppLayerMeasInfoList) && + qMCConfigInfo.iEExtensions == y.iEExtensions && + qMCConfigInfo.extensions == y.extensions +} + +func (qMCDeactivation QMCDeactivation) Equal(y QMCDeactivation) bool { + return qMCDeactivation.QoEReferenceList.Equal(y.QoEReferenceList) && + qMCDeactivation.iEExtensions == y.iEExtensions && + qMCDeactivation.extensions == y.extensions +} + +func (qoERVQoEReportingPaths QoERVQoEReportingPaths) Equal(y QoERVQoEReportingPaths) bool { + return (qoERVQoEReportingPaths.QoEReportingPath == nil) == (y.QoEReportingPath == nil) && (qoERVQoEReportingPaths.QoEReportingPath == nil || (*qoERVQoEReportingPaths.QoEReportingPath) == *y.QoEReportingPath) && + (qoERVQoEReportingPaths.RVQoEReportingPath == nil) == (y.RVQoEReportingPath == nil) && (qoERVQoEReportingPaths.RVQoEReportingPath == nil || (*qoERVQoEReportingPaths.RVQoEReportingPath) == *y.RVQoEReportingPath) && + qoERVQoEReportingPaths.iEExtensions == y.iEExtensions && + qoERVQoEReportingPaths.extensions == y.extensions +} + +func (qoEReference QoEReference) Equal(y QoEReference) bool { + if len(qoEReference) != len(y) { + return false + } + for i := range qoEReference { + if !(qoEReference[i] == y[i]) { + return false + } + } + return true +} + +func (qoEReferenceList QoEReferenceList) Equal(y QoEReferenceList) bool { + if len(qoEReferenceList) != len(y) { + return false + } + for i := range qoEReferenceList { + if !(qoEReferenceList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qoSFlowTSCItem QoSFlowTSCItem) Equal(y QoSFlowTSCItem) bool { + return qoSFlowTSCItem.QosFlowIdentifier == y.QosFlowIdentifier && + (qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback == nil) == (y.TSCTrafficCharacteristicsFeedback == nil) && (qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback == nil || (*qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback).Equal(*y.TSCTrafficCharacteristicsFeedback)) && + (qoSFlowTSCItem.ANPacketDelayBudgetUL == nil) == (y.ANPacketDelayBudgetUL == nil) && (qoSFlowTSCItem.ANPacketDelayBudgetUL == nil || (*qoSFlowTSCItem.ANPacketDelayBudgetUL) == *y.ANPacketDelayBudgetUL) && + qoSFlowTSCItem.iEExtensions == y.iEExtensions && + qoSFlowTSCItem.extensions == y.extensions +} + +func (qoSFlowTSCList QoSFlowTSCList) Equal(y QoSFlowTSCList) bool { + if len(qoSFlowTSCList) != len(y) { + return false + } + for i := range qoSFlowTSCList { + if !(qoSFlowTSCList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qoSFlowsUsageReportItem QoSFlowsUsageReportItem) Equal(y QoSFlowsUsageReportItem) bool { + return qoSFlowsUsageReportItem.QosFlowIdentifier == y.QosFlowIdentifier && + qoSFlowsUsageReportItem.RATType == y.RATType && + qoSFlowsUsageReportItem.QoSFlowsTimedReportList.Equal(y.QoSFlowsTimedReportList) && + qoSFlowsUsageReportItem.iEExtensions == y.iEExtensions && + qoSFlowsUsageReportItem.extensions == y.extensions +} + +func (qoSFlowsUsageReportList QoSFlowsUsageReportList) Equal(y QoSFlowsUsageReportList) bool { + if len(qoSFlowsUsageReportList) != len(y) { + return false + } + for i := range qoSFlowsUsageReportList { + if !(qoSFlowsUsageReportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosCharacteristics QosCharacteristics) Equal(y QosCharacteristics) bool { + return (qosCharacteristics.NonDynamic5QI == nil) == (y.NonDynamic5QI == nil) && (qosCharacteristics.NonDynamic5QI == nil || (*qosCharacteristics.NonDynamic5QI).Equal(*y.NonDynamic5QI)) && + (qosCharacteristics.Dynamic5QI == nil) == (y.Dynamic5QI == nil) && (qosCharacteristics.Dynamic5QI == nil || (*qosCharacteristics.Dynamic5QI).Equal(*y.Dynamic5QI)) && + (qosCharacteristics.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (qosCharacteristics.ChoiceExtension == nil || (*qosCharacteristics.ChoiceExtension) == *y.ChoiceExtension) +} + +func (qosFlowAcceptedItem QosFlowAcceptedItem) Equal(y QosFlowAcceptedItem) bool { + return qosFlowAcceptedItem.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowAcceptedItem.CurrentQoSParaSetIndex == nil) == (y.CurrentQoSParaSetIndex == nil) && (qosFlowAcceptedItem.CurrentQoSParaSetIndex == nil || (*qosFlowAcceptedItem.CurrentQoSParaSetIndex) == *y.CurrentQoSParaSetIndex) && + qosFlowAcceptedItem.iEExtensions == y.iEExtensions && + qosFlowAcceptedItem.extensions == y.extensions +} + +func (qosFlowAcceptedList QosFlowAcceptedList) Equal(y QosFlowAcceptedList) bool { + if len(qosFlowAcceptedList) != len(y) { + return false + } + for i := range qosFlowAcceptedList { + if !(qosFlowAcceptedList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowAddOrModifyRequestItem QosFlowAddOrModifyRequestItem) Equal(y QosFlowAddOrModifyRequestItem) bool { + return qosFlowAddOrModifyRequestItem.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters == nil) == (y.QosFlowLevelQosParameters == nil) && (qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters == nil || (*qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters).Equal(*y.QosFlowLevelQosParameters)) && + (qosFlowAddOrModifyRequestItem.ERABID == nil) == (y.ERABID == nil) && (qosFlowAddOrModifyRequestItem.ERABID == nil || (*qosFlowAddOrModifyRequestItem.ERABID) == *y.ERABID) && + (qosFlowAddOrModifyRequestItem.TSCTrafficCharacteristics == nil) == (y.TSCTrafficCharacteristics == nil) && (qosFlowAddOrModifyRequestItem.TSCTrafficCharacteristics == nil || (*qosFlowAddOrModifyRequestItem.TSCTrafficCharacteristics).Equal(*y.TSCTrafficCharacteristics)) && + (qosFlowAddOrModifyRequestItem.RedundantQosFlowIndicator == nil) == (y.RedundantQosFlowIndicator == nil) && (qosFlowAddOrModifyRequestItem.RedundantQosFlowIndicator == nil || (*qosFlowAddOrModifyRequestItem.RedundantQosFlowIndicator) == *y.RedundantQosFlowIndicator) && + (qosFlowAddOrModifyRequestItem.ULNGUUPTNLInformation == nil) == (y.ULNGUUPTNLInformation == nil) && (qosFlowAddOrModifyRequestItem.ULNGUUPTNLInformation == nil || (*qosFlowAddOrModifyRequestItem.ULNGUUPTNLInformation).Equal(*y.ULNGUUPTNLInformation)) && + (qosFlowAddOrModifyRequestItem.DownlinkTLContainer == nil) == (y.DownlinkTLContainer == nil) && (qosFlowAddOrModifyRequestItem.DownlinkTLContainer == nil || (*qosFlowAddOrModifyRequestItem.DownlinkTLContainer).Equal(*y.DownlinkTLContainer)) && + (qosFlowAddOrModifyRequestItem.ECNMarkingorCongestionInformationReportingRequest == nil) == (y.ECNMarkingorCongestionInformationReportingRequest == nil) && (qosFlowAddOrModifyRequestItem.ECNMarkingorCongestionInformationReportingRequest == nil || (*qosFlowAddOrModifyRequestItem.ECNMarkingorCongestionInformationReportingRequest).Equal(*y.ECNMarkingorCongestionInformationReportingRequest)) && + qosFlowAddOrModifyRequestItem.iEExtensions == y.iEExtensions && + qosFlowAddOrModifyRequestItem.extensions == y.extensions +} + +func (qosFlowAddOrModifyRequestList QosFlowAddOrModifyRequestList) Equal(y QosFlowAddOrModifyRequestList) bool { + if len(qosFlowAddOrModifyRequestList) != len(y) { + return false + } + for i := range qosFlowAddOrModifyRequestList { + if !(qosFlowAddOrModifyRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowAddOrModifyResponseItem QosFlowAddOrModifyResponseItem) Equal(y QosFlowAddOrModifyResponseItem) bool { + return qosFlowAddOrModifyResponseItem.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowAddOrModifyResponseItem.CurrentQoSParaSetIndex == nil) == (y.CurrentQoSParaSetIndex == nil) && (qosFlowAddOrModifyResponseItem.CurrentQoSParaSetIndex == nil || (*qosFlowAddOrModifyResponseItem.CurrentQoSParaSetIndex) == *y.CurrentQoSParaSetIndex) && + (qosFlowAddOrModifyResponseItem.TSCTrafficCharacteristicsFeedback == nil) == (y.TSCTrafficCharacteristicsFeedback == nil) && (qosFlowAddOrModifyResponseItem.TSCTrafficCharacteristicsFeedback == nil || (*qosFlowAddOrModifyResponseItem.TSCTrafficCharacteristicsFeedback).Equal(*y.TSCTrafficCharacteristicsFeedback)) && + (qosFlowAddOrModifyResponseItem.UplinkTLContainer == nil) == (y.UplinkTLContainer == nil) && (qosFlowAddOrModifyResponseItem.UplinkTLContainer == nil || (*qosFlowAddOrModifyResponseItem.UplinkTLContainer).Equal(*y.UplinkTLContainer)) && + (qosFlowAddOrModifyResponseItem.DLNGUUPTNLInformation == nil) == (y.DLNGUUPTNLInformation == nil) && (qosFlowAddOrModifyResponseItem.DLNGUUPTNLInformation == nil || (*qosFlowAddOrModifyResponseItem.DLNGUUPTNLInformation).Equal(*y.DLNGUUPTNLInformation)) && + (qosFlowAddOrModifyResponseItem.ANPacketDelayBudgetUL == nil) == (y.ANPacketDelayBudgetUL == nil) && (qosFlowAddOrModifyResponseItem.ANPacketDelayBudgetUL == nil || (*qosFlowAddOrModifyResponseItem.ANPacketDelayBudgetUL) == *y.ANPacketDelayBudgetUL) && + qosFlowAddOrModifyResponseItem.iEExtensions == y.iEExtensions && + qosFlowAddOrModifyResponseItem.extensions == y.extensions +} + +func (qosFlowAddOrModifyResponseList QosFlowAddOrModifyResponseList) Equal(y QosFlowAddOrModifyResponseList) bool { + if len(qosFlowAddOrModifyResponseList) != len(y) { + return false + } + for i := range qosFlowAddOrModifyResponseList { + if !(qosFlowAddOrModifyResponseList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowAdditionalInfoItemRelCom QosFlowAdditionalInfoItemRelCom) Equal(y QosFlowAdditionalInfoItemRelCom) bool { + return qosFlowAdditionalInfoItemRelCom.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowAdditionalInfoItemRelCom.DownlinkTLContainer == nil) == (y.DownlinkTLContainer == nil) && qosFlowAdditionalInfoItemRelCom.DownlinkTLContainer.Equal(y.DownlinkTLContainer) && + qosFlowAdditionalInfoItemRelCom.iEExtensions == y.iEExtensions && + qosFlowAdditionalInfoItemRelCom.extensions == y.extensions +} + +func (qosFlowAdditionalInfoItemRelRes QosFlowAdditionalInfoItemRelRes) Equal(y QosFlowAdditionalInfoItemRelRes) bool { + return qosFlowAdditionalInfoItemRelRes.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowAdditionalInfoItemRelRes.UplinkTLContainer == nil) == (y.UplinkTLContainer == nil) && qosFlowAdditionalInfoItemRelRes.UplinkTLContainer.Equal(y.UplinkTLContainer) && + qosFlowAdditionalInfoItemRelRes.iEExtensions == y.iEExtensions && + qosFlowAdditionalInfoItemRelRes.extensions == y.extensions +} + +func (qosFlowAdditionalInfoListRelCom QosFlowAdditionalInfoListRelCom) Equal(y QosFlowAdditionalInfoListRelCom) bool { + if len(qosFlowAdditionalInfoListRelCom) != len(y) { + return false + } + for i := range qosFlowAdditionalInfoListRelCom { + if !(qosFlowAdditionalInfoListRelCom[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowAdditionalInfoListRelRes QosFlowAdditionalInfoListRelRes) Equal(y QosFlowAdditionalInfoListRelRes) bool { + if len(qosFlowAdditionalInfoListRelRes) != len(y) { + return false + } + for i := range qosFlowAdditionalInfoListRelRes { + if !(qosFlowAdditionalInfoListRelRes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowFeedbackItem QosFlowFeedbackItem) Equal(y QosFlowFeedbackItem) bool { + return qosFlowFeedbackItem.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowFeedbackItem.UpdateFeedback == nil) == (y.UpdateFeedback == nil) && (qosFlowFeedbackItem.UpdateFeedback == nil || (*qosFlowFeedbackItem.UpdateFeedback).Equal(*y.UpdateFeedback)) && + (qosFlowFeedbackItem.CNpacketDelayBudgetDL == nil) == (y.CNpacketDelayBudgetDL == nil) && (qosFlowFeedbackItem.CNpacketDelayBudgetDL == nil || (*qosFlowFeedbackItem.CNpacketDelayBudgetDL) == *y.CNpacketDelayBudgetDL) && + (qosFlowFeedbackItem.CNpacketDelayBudgetUL == nil) == (y.CNpacketDelayBudgetUL == nil) && (qosFlowFeedbackItem.CNpacketDelayBudgetUL == nil || (*qosFlowFeedbackItem.CNpacketDelayBudgetUL) == *y.CNpacketDelayBudgetUL) && + qosFlowFeedbackItem.iEExtensions == y.iEExtensions && + qosFlowFeedbackItem.extensions == y.extensions +} + +func (qosFlowFeedbackList QosFlowFeedbackList) Equal(y QosFlowFeedbackList) bool { + if len(qosFlowFeedbackList) != len(y) { + return false + } + for i := range qosFlowFeedbackList { + if !(qosFlowFeedbackList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowInformationItem QosFlowInformationItem) Equal(y QosFlowInformationItem) bool { + return qosFlowInformationItem.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowInformationItem.DLForwarding == nil) == (y.DLForwarding == nil) && (qosFlowInformationItem.DLForwarding == nil || (*qosFlowInformationItem.DLForwarding) == *y.DLForwarding) && + (qosFlowInformationItem.ULForwarding == nil) == (y.ULForwarding == nil) && (qosFlowInformationItem.ULForwarding == nil || (*qosFlowInformationItem.ULForwarding) == *y.ULForwarding) && + (qosFlowInformationItem.SourceTNLAddrInfo == nil) == (y.SourceTNLAddrInfo == nil) && (qosFlowInformationItem.SourceTNLAddrInfo == nil || (*qosFlowInformationItem.SourceTNLAddrInfo) == *y.SourceTNLAddrInfo) && + (qosFlowInformationItem.SourceNodeTNLAddrInfo == nil) == (y.SourceNodeTNLAddrInfo == nil) && (qosFlowInformationItem.SourceNodeTNLAddrInfo == nil || (*qosFlowInformationItem.SourceNodeTNLAddrInfo) == *y.SourceNodeTNLAddrInfo) && + qosFlowInformationItem.iEExtensions == y.iEExtensions && + qosFlowInformationItem.extensions == y.extensions +} + +func (qosFlowInformationList QosFlowInformationList) Equal(y QosFlowInformationList) bool { + if len(qosFlowInformationList) != len(y) { + return false + } + for i := range qosFlowInformationList { + if !(qosFlowInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowItemWithDataForwarding QosFlowItemWithDataForwarding) Equal(y QosFlowItemWithDataForwarding) bool { + return qosFlowItemWithDataForwarding.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowItemWithDataForwarding.DataForwardingAccepted == nil) == (y.DataForwardingAccepted == nil) && (qosFlowItemWithDataForwarding.DataForwardingAccepted == nil || (*qosFlowItemWithDataForwarding.DataForwardingAccepted) == *y.DataForwardingAccepted) && + (qosFlowItemWithDataForwarding.CurrentQoSParaSetIndex == nil) == (y.CurrentQoSParaSetIndex == nil) && (qosFlowItemWithDataForwarding.CurrentQoSParaSetIndex == nil || (*qosFlowItemWithDataForwarding.CurrentQoSParaSetIndex) == *y.CurrentQoSParaSetIndex) && + qosFlowItemWithDataForwarding.iEExtensions == y.iEExtensions && + qosFlowItemWithDataForwarding.extensions == y.extensions +} + +func (qosFlowLevelQosParameters QosFlowLevelQosParameters) Equal(y QosFlowLevelQosParameters) bool { + return qosFlowLevelQosParameters.QosCharacteristics.Equal(y.QosCharacteristics) && + qosFlowLevelQosParameters.AllocationAndRetentionPriority.Equal(y.AllocationAndRetentionPriority) && + (qosFlowLevelQosParameters.GBRQosInformation == nil) == (y.GBRQosInformation == nil) && (qosFlowLevelQosParameters.GBRQosInformation == nil || (*qosFlowLevelQosParameters.GBRQosInformation).Equal(*y.GBRQosInformation)) && + (qosFlowLevelQosParameters.ReflectiveQosAttribute == nil) == (y.ReflectiveQosAttribute == nil) && (qosFlowLevelQosParameters.ReflectiveQosAttribute == nil || (*qosFlowLevelQosParameters.ReflectiveQosAttribute) == *y.ReflectiveQosAttribute) && + (qosFlowLevelQosParameters.AdditionalQosFlowInformation == nil) == (y.AdditionalQosFlowInformation == nil) && (qosFlowLevelQosParameters.AdditionalQosFlowInformation == nil || (*qosFlowLevelQosParameters.AdditionalQosFlowInformation) == *y.AdditionalQosFlowInformation) && + (qosFlowLevelQosParameters.QosMonitoringRequest == nil) == (y.QosMonitoringRequest == nil) && (qosFlowLevelQosParameters.QosMonitoringRequest == nil || (*qosFlowLevelQosParameters.QosMonitoringRequest) == *y.QosMonitoringRequest) && + (qosFlowLevelQosParameters.QosMonitoringReportingFrequency == nil) == (y.QosMonitoringReportingFrequency == nil) && (qosFlowLevelQosParameters.QosMonitoringReportingFrequency == nil || (*qosFlowLevelQosParameters.QosMonitoringReportingFrequency) == *y.QosMonitoringReportingFrequency) && + (qosFlowLevelQosParameters.PDUsetQoSParameters == nil) == (y.PDUsetQoSParameters == nil) && (qosFlowLevelQosParameters.PDUsetQoSParameters == nil || (*qosFlowLevelQosParameters.PDUsetQoSParameters).Equal(*y.PDUsetQoSParameters)) && + (qosFlowLevelQosParameters.DLPDUSetInformationMarkingSupportIndication == nil) == (y.DLPDUSetInformationMarkingSupportIndication == nil) && (qosFlowLevelQosParameters.DLPDUSetInformationMarkingSupportIndication == nil || (*qosFlowLevelQosParameters.DLPDUSetInformationMarkingSupportIndication) == *y.DLPDUSetInformationMarkingSupportIndication) && + (qosFlowLevelQosParameters.MMSID == nil) == (y.MMSID == nil) && (qosFlowLevelQosParameters.MMSID == nil || (*qosFlowLevelQosParameters.MMSID).Equal(*y.MMSID)) && + (qosFlowLevelQosParameters.IndicationofBitrateAdaptation == nil) == (y.IndicationofBitrateAdaptation == nil) && (qosFlowLevelQosParameters.IndicationofBitrateAdaptation == nil || (*qosFlowLevelQosParameters.IndicationofBitrateAdaptation) == *y.IndicationofBitrateAdaptation) && + qosFlowLevelQosParameters.iEExtensions == y.iEExtensions && + qosFlowLevelQosParameters.extensions == y.extensions +} + +func (qosFlowListWithCause QosFlowListWithCause) Equal(y QosFlowListWithCause) bool { + if len(qosFlowListWithCause) != len(y) { + return false + } + for i := range qosFlowListWithCause { + if !(qosFlowListWithCause[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowListWithDataForwarding QosFlowListWithDataForwarding) Equal(y QosFlowListWithDataForwarding) bool { + if len(qosFlowListWithDataForwarding) != len(y) { + return false + } + for i := range qosFlowListWithDataForwarding { + if !(qosFlowListWithDataForwarding[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowModifyConfirmItem QosFlowModifyConfirmItem) Equal(y QosFlowModifyConfirmItem) bool { + return qosFlowModifyConfirmItem == y +} + +func (qosFlowModifyConfirmList QosFlowModifyConfirmList) Equal(y QosFlowModifyConfirmList) bool { + if len(qosFlowModifyConfirmList) != len(y) { + return false + } + for i := range qosFlowModifyConfirmList { + if !(qosFlowModifyConfirmList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowNotifyItem QosFlowNotifyItem) Equal(y QosFlowNotifyItem) bool { + return qosFlowNotifyItem.extensions == y.extensions && + qosFlowNotifyItem.QosFlowIdentifier == y.QosFlowIdentifier && + qosFlowNotifyItem.NotificationCause == y.NotificationCause && + (qosFlowNotifyItem.CurrentQoSParaSetIndex == nil) == (y.CurrentQoSParaSetIndex == nil) && (qosFlowNotifyItem.CurrentQoSParaSetIndex == nil || (*qosFlowNotifyItem.CurrentQoSParaSetIndex) == *y.CurrentQoSParaSetIndex) && + (qosFlowNotifyItem.TSCTrafficCharacteristicsFeedback == nil) == (y.TSCTrafficCharacteristicsFeedback == nil) && (qosFlowNotifyItem.TSCTrafficCharacteristicsFeedback == nil || (*qosFlowNotifyItem.TSCTrafficCharacteristicsFeedback).Equal(*y.TSCTrafficCharacteristicsFeedback)) && + qosFlowNotifyItem.iEExtensions == y.iEExtensions +} + +func (qosFlowNotifyList QosFlowNotifyList) Equal(y QosFlowNotifyList) bool { + if len(qosFlowNotifyList) != len(y) { + return false + } + for i := range qosFlowNotifyList { + if !(qosFlowNotifyList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowParametersItem QosFlowParametersItem) Equal(y QosFlowParametersItem) bool { + return qosFlowParametersItem.QosFlowIdentifier == y.QosFlowIdentifier && + (qosFlowParametersItem.AlternativeQoSParaSetList == nil) == (y.AlternativeQoSParaSetList == nil) && qosFlowParametersItem.AlternativeQoSParaSetList.Equal(y.AlternativeQoSParaSetList) && + (qosFlowParametersItem.CNPacketDelayBudgetDL == nil) == (y.CNPacketDelayBudgetDL == nil) && (qosFlowParametersItem.CNPacketDelayBudgetDL == nil || (*qosFlowParametersItem.CNPacketDelayBudgetDL) == *y.CNPacketDelayBudgetDL) && + (qosFlowParametersItem.CNPacketDelayBudgetUL == nil) == (y.CNPacketDelayBudgetUL == nil) && (qosFlowParametersItem.CNPacketDelayBudgetUL == nil || (*qosFlowParametersItem.CNPacketDelayBudgetUL) == *y.CNPacketDelayBudgetUL) && + (qosFlowParametersItem.BurstArrivalTimeDownlink == nil) == (y.BurstArrivalTimeDownlink == nil) && (qosFlowParametersItem.BurstArrivalTimeDownlink == nil || (*qosFlowParametersItem.BurstArrivalTimeDownlink).Equal(*y.BurstArrivalTimeDownlink)) && + qosFlowParametersItem.iEExtensions == y.iEExtensions && + qosFlowParametersItem.extensions == y.extensions +} + +func (qosFlowParametersList QosFlowParametersList) Equal(y QosFlowParametersList) bool { + if len(qosFlowParametersList) != len(y) { + return false + } + for i := range qosFlowParametersList { + if !(qosFlowParametersList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowPerTNLInformation QosFlowPerTNLInformation) Equal(y QosFlowPerTNLInformation) bool { + return qosFlowPerTNLInformation.UPTransportLayerInformation.Equal(y.UPTransportLayerInformation) && + qosFlowPerTNLInformation.AssociatedQosFlowList.Equal(y.AssociatedQosFlowList) && + qosFlowPerTNLInformation.iEExtensions == y.iEExtensions && + qosFlowPerTNLInformation.extensions == y.extensions +} + +func (qosFlowPerTNLInformationItem QosFlowPerTNLInformationItem) Equal(y QosFlowPerTNLInformationItem) bool { + return qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.Equal(y.QosFlowPerTNLInformation) && + qosFlowPerTNLInformationItem.iEExtensions == y.iEExtensions && + qosFlowPerTNLInformationItem.extensions == y.extensions +} + +func (qosFlowPerTNLInformationList QosFlowPerTNLInformationList) Equal(y QosFlowPerTNLInformationList) bool { + if len(qosFlowPerTNLInformationList) != len(y) { + return false + } + for i := range qosFlowPerTNLInformationList { + if !(qosFlowPerTNLInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowSetupRequestItem QosFlowSetupRequestItem) Equal(y QosFlowSetupRequestItem) bool { + return qosFlowSetupRequestItem.QosFlowIdentifier == y.QosFlowIdentifier && + qosFlowSetupRequestItem.QosFlowLevelQosParameters.Equal(y.QosFlowLevelQosParameters) && + (qosFlowSetupRequestItem.ERABID == nil) == (y.ERABID == nil) && (qosFlowSetupRequestItem.ERABID == nil || (*qosFlowSetupRequestItem.ERABID) == *y.ERABID) && + (qosFlowSetupRequestItem.TSCTrafficCharacteristics == nil) == (y.TSCTrafficCharacteristics == nil) && (qosFlowSetupRequestItem.TSCTrafficCharacteristics == nil || (*qosFlowSetupRequestItem.TSCTrafficCharacteristics).Equal(*y.TSCTrafficCharacteristics)) && + (qosFlowSetupRequestItem.RedundantQosFlowIndicator == nil) == (y.RedundantQosFlowIndicator == nil) && (qosFlowSetupRequestItem.RedundantQosFlowIndicator == nil || (*qosFlowSetupRequestItem.RedundantQosFlowIndicator) == *y.RedundantQosFlowIndicator) && + (qosFlowSetupRequestItem.ECNMarkingorCongestionInformationReportingRequest == nil) == (y.ECNMarkingorCongestionInformationReportingRequest == nil) && (qosFlowSetupRequestItem.ECNMarkingorCongestionInformationReportingRequest == nil || (*qosFlowSetupRequestItem.ECNMarkingorCongestionInformationReportingRequest).Equal(*y.ECNMarkingorCongestionInformationReportingRequest)) && + qosFlowSetupRequestItem.iEExtensions == y.iEExtensions && + qosFlowSetupRequestItem.extensions == y.extensions +} + +func (qosFlowSetupRequestList QosFlowSetupRequestList) Equal(y QosFlowSetupRequestList) bool { + if len(qosFlowSetupRequestList) != len(y) { + return false + } + for i := range qosFlowSetupRequestList { + if !(qosFlowSetupRequestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowToBeForwardedItem QosFlowToBeForwardedItem) Equal(y QosFlowToBeForwardedItem) bool { + return qosFlowToBeForwardedItem == y +} + +func (qosFlowToBeForwardedList QosFlowToBeForwardedList) Equal(y QosFlowToBeForwardedList) bool { + if len(qosFlowToBeForwardedList) != len(y) { + return false + } + for i := range qosFlowToBeForwardedList { + if !(qosFlowToBeForwardedList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (qosFlowWithCauseItem QosFlowWithCauseItem) Equal(y QosFlowWithCauseItem) bool { + return qosFlowWithCauseItem.QosFlowIdentifier == y.QosFlowIdentifier && + qosFlowWithCauseItem.Cause.Equal(y.Cause) && + qosFlowWithCauseItem.iEExtensions == y.iEExtensions && + qosFlowWithCauseItem.extensions == y.extensions +} + +func (rANConfigurationUpdate RANConfigurationUpdate) Equal(y RANConfigurationUpdate) bool { + return (rANConfigurationUpdate.RANNodeName == nil) == (y.RANNodeName == nil) && (rANConfigurationUpdate.RANNodeName == nil || (*rANConfigurationUpdate.RANNodeName) == *y.RANNodeName) && + rANConfigurationUpdate.SupportedTAList.Equal(y.SupportedTAList) && + (rANConfigurationUpdate.DefaultPagingDRX == nil) == (y.DefaultPagingDRX == nil) && (rANConfigurationUpdate.DefaultPagingDRX == nil || (*rANConfigurationUpdate.DefaultPagingDRX) == *y.DefaultPagingDRX) && + (rANConfigurationUpdate.GlobalRANNodeID == nil) == (y.GlobalRANNodeID == nil) && (rANConfigurationUpdate.GlobalRANNodeID == nil || (*rANConfigurationUpdate.GlobalRANNodeID).Equal(*y.GlobalRANNodeID)) && + rANConfigurationUpdate.NGRANTNLAssociationToRemoveList.Equal(y.NGRANTNLAssociationToRemoveList) && + (rANConfigurationUpdate.NBIoTDefaultPagingDRX == nil) == (y.NBIoTDefaultPagingDRX == nil) && (rANConfigurationUpdate.NBIoTDefaultPagingDRX == nil || (*rANConfigurationUpdate.NBIoTDefaultPagingDRX) == *y.NBIoTDefaultPagingDRX) && + (rANConfigurationUpdate.ExtendedRANNodeName == nil) == (y.ExtendedRANNodeName == nil) && (rANConfigurationUpdate.ExtendedRANNodeName == nil || (*rANConfigurationUpdate.ExtendedRANNodeName).Equal(*y.ExtendedRANNodeName)) && + (rANConfigurationUpdate.AdditionalULI == nil) == (y.AdditionalULI == nil) && (rANConfigurationUpdate.AdditionalULI == nil || (*rANConfigurationUpdate.AdditionalULI).Equal(*y.AdditionalULI)) && + (rANConfigurationUpdate.AIoTSupport == nil) == (y.AIoTSupport == nil) && (rANConfigurationUpdate.AIoTSupport == nil || (*rANConfigurationUpdate.AIoTSupport) == *y.AIoTSupport) && + rANConfigurationUpdate.messageMeta.Equal(y.messageMeta) +} + +func (rANConfigurationUpdateAcknowledge RANConfigurationUpdateAcknowledge) Equal(y RANConfigurationUpdateAcknowledge) bool { + return (rANConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (rANConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil || (*rANConfigurationUpdateAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + rANConfigurationUpdateAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (rANConfigurationUpdateFailure RANConfigurationUpdateFailure) Equal(y RANConfigurationUpdateFailure) bool { + return (rANConfigurationUpdateFailure.Cause == nil) == (y.Cause == nil) && (rANConfigurationUpdateFailure.Cause == nil || (*rANConfigurationUpdateFailure.Cause).Equal(*y.Cause)) && + (rANConfigurationUpdateFailure.TimeToWait == nil) == (y.TimeToWait == nil) && (rANConfigurationUpdateFailure.TimeToWait == nil || (*rANConfigurationUpdateFailure.TimeToWait) == *y.TimeToWait) && + (rANConfigurationUpdateFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (rANConfigurationUpdateFailure.CriticalityDiagnostics == nil || (*rANConfigurationUpdateFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + rANConfigurationUpdateFailure.messageMeta.Equal(y.messageMeta) +} + +func (rANfeedbacktype RANfeedbacktype) Equal(y RANfeedbacktype) bool { + return (rANfeedbacktype.Proactive == nil) == (y.Proactive == nil) && (rANfeedbacktype.Proactive == nil || (*rANfeedbacktype.Proactive).Equal(*y.Proactive)) && + (rANfeedbacktype.Reactive == nil) == (y.Reactive == nil) && (rANfeedbacktype.Reactive == nil || (*rANfeedbacktype.Reactive).Equal(*y.Reactive)) && + (rANfeedbacktype.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (rANfeedbacktype.ChoiceExtension == nil || (*rANfeedbacktype.ChoiceExtension) == *y.ChoiceExtension) +} + +func (rANfeedbacktypeproactive RANfeedbacktypeproactive) Equal(y RANfeedbacktypeproactive) bool { + return rANfeedbacktypeproactive.BurstArrivalTimeWindow.Equal(y.BurstArrivalTimeWindow) && + (rANfeedbacktypeproactive.PeriodicityRange == nil) == (y.PeriodicityRange == nil) && (rANfeedbacktypeproactive.PeriodicityRange == nil || (*rANfeedbacktypeproactive.PeriodicityRange).Equal(*y.PeriodicityRange)) && + rANfeedbacktypeproactive.iEExtensions == y.iEExtensions && + rANfeedbacktypeproactive.extensions == y.extensions +} + +func (rANfeedbacktypereactive RANfeedbacktypereactive) Equal(y RANfeedbacktypereactive) bool { + return rANfeedbacktypereactive == y +} + +func (rATRestrictionInformation RATRestrictionInformation) Equal(y RATRestrictionInformation) bool { + return rATRestrictionInformation == y +} + +func (rATRestrictions RATRestrictions) Equal(y RATRestrictions) bool { + if len(rATRestrictions) != len(y) { + return false + } + for i := range rATRestrictions { + if !(rATRestrictions[i].Equal(y[i])) { + return false + } + } + return true +} + +func (rATRestrictionsItem RATRestrictionsItem) Equal(y RATRestrictionsItem) bool { + return rATRestrictionsItem.extensions == y.extensions && + rATRestrictionsItem.PLMNIdentity == y.PLMNIdentity && + rATRestrictionsItem.RATRestrictionInformation.Equal(y.RATRestrictionInformation) && + (rATRestrictionsItem.ExtendedRATRestrictionInformation == nil) == (y.ExtendedRATRestrictionInformation == nil) && (rATRestrictionsItem.ExtendedRATRestrictionInformation == nil || (*rATRestrictionsItem.ExtendedRATRestrictionInformation).Equal(*y.ExtendedRATRestrictionInformation)) && + rATRestrictionsItem.iEExtensions == y.iEExtensions +} + +func (rGLevelWirelineAccessCharacteristics RGLevelWirelineAccessCharacteristics) Equal(y RGLevelWirelineAccessCharacteristics) bool { + if len(rGLevelWirelineAccessCharacteristics) != len(y) { + return false + } + for i := range rGLevelWirelineAccessCharacteristics { + if !(rGLevelWirelineAccessCharacteristics[i] == y[i]) { + return false + } + } + return true +} + +func (rRCContainer RRCContainer) Equal(y RRCContainer) bool { + if len(rRCContainer) != len(y) { + return false + } + for i := range rRCContainer { + if !(rRCContainer[i] == y[i]) { + return false + } + } + return true +} + +func (rSPPFlowBitRates RSPPFlowBitRates) Equal(y RSPPFlowBitRates) bool { + return rSPPFlowBitRates == y +} + +func (rSPPQoSFlowItem RSPPQoSFlowItem) Equal(y RSPPQoSFlowItem) bool { + return rSPPQoSFlowItem.PQI == y.PQI && + (rSPPQoSFlowItem.RSPPFlowBitRates == nil) == (y.RSPPFlowBitRates == nil) && (rSPPQoSFlowItem.RSPPFlowBitRates == nil || (*rSPPQoSFlowItem.RSPPFlowBitRates).Equal(*y.RSPPFlowBitRates)) && + (rSPPQoSFlowItem.Range == nil) == (y.Range == nil) && (rSPPQoSFlowItem.Range == nil || (*rSPPQoSFlowItem.Range) == *y.Range) && + rSPPQoSFlowItem.iEExtensions == y.iEExtensions && + rSPPQoSFlowItem.extensions == y.extensions +} + +func (rSPPQoSFlowList RSPPQoSFlowList) Equal(y RSPPQoSFlowList) bool { + if len(rSPPQoSFlowList) != len(y) { + return false + } + for i := range rSPPQoSFlowList { + if !(rSPPQoSFlowList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (recommendedCellItem RecommendedCellItem) Equal(y RecommendedCellItem) bool { + return recommendedCellItem.NGRANCGI.Equal(y.NGRANCGI) && + (recommendedCellItem.TimeStayedInCell == nil) == (y.TimeStayedInCell == nil) && (recommendedCellItem.TimeStayedInCell == nil || (*recommendedCellItem.TimeStayedInCell) == *y.TimeStayedInCell) && + recommendedCellItem.iEExtensions == y.iEExtensions && + recommendedCellItem.extensions == y.extensions +} + +func (recommendedCellList RecommendedCellList) Equal(y RecommendedCellList) bool { + if len(recommendedCellList) != len(y) { + return false + } + for i := range recommendedCellList { + if !(recommendedCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (recommendedCellsForPaging RecommendedCellsForPaging) Equal(y RecommendedCellsForPaging) bool { + return recommendedCellsForPaging.RecommendedCellList.Equal(y.RecommendedCellList) && + recommendedCellsForPaging.iEExtensions == y.iEExtensions && + recommendedCellsForPaging.extensions == y.extensions +} + +func (recommendedRANNodeItem RecommendedRANNodeItem) Equal(y RecommendedRANNodeItem) bool { + return recommendedRANNodeItem.AMFPagingTarget.Equal(y.AMFPagingTarget) && + recommendedRANNodeItem.iEExtensions == y.iEExtensions && + recommendedRANNodeItem.extensions == y.extensions +} + +func (recommendedRANNodeList RecommendedRANNodeList) Equal(y RecommendedRANNodeList) bool { + if len(recommendedRANNodeList) != len(y) { + return false + } + for i := range recommendedRANNodeList { + if !(recommendedRANNodeList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (recommendedRANNodesForPaging RecommendedRANNodesForPaging) Equal(y RecommendedRANNodesForPaging) bool { + return recommendedRANNodesForPaging.RecommendedRANNodeList.Equal(y.RecommendedRANNodeList) && + recommendedRANNodesForPaging.iEExtensions == y.iEExtensions && + recommendedRANNodesForPaging.extensions == y.extensions +} + +func (redundantPDUSessionInformation RedundantPDUSessionInformation) Equal(y RedundantPDUSessionInformation) bool { + return redundantPDUSessionInformation.RSN == y.RSN && + (redundantPDUSessionInformation.PDUSessionPairID == nil) == (y.PDUSessionPairID == nil) && (redundantPDUSessionInformation.PDUSessionPairID == nil || (*redundantPDUSessionInformation.PDUSessionPairID) == *y.PDUSessionPairID) && + redundantPDUSessionInformation.iEExtensions == y.iEExtensions && + redundantPDUSessionInformation.extensions == y.extensions +} + +func (reportType ReportType) Equal(y ReportType) bool { + return (reportType.EventBasedReporting == nil) == (y.EventBasedReporting == nil) && (reportType.EventBasedReporting == nil || (*reportType.EventBasedReporting).Equal(*y.EventBasedReporting)) && + (reportType.PeriodicReporting == nil) == (y.PeriodicReporting == nil) && (reportType.PeriodicReporting == nil || (*reportType.PeriodicReporting).Equal(*y.PeriodicReporting)) && + (reportType.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (reportType.ChoiceExtension == nil || (*reportType.ChoiceExtension) == *y.ChoiceExtension) +} + +func (reportingSystem ReportingSystem) Equal(y ReportingSystem) bool { + return (reportingSystem.EUTRAN == nil) == (y.EUTRAN == nil) && (reportingSystem.EUTRAN == nil || (*reportingSystem.EUTRAN).Equal(*y.EUTRAN)) && + (reportingSystem.NGRAN == nil) == (y.NGRAN == nil) && (reportingSystem.NGRAN == nil || (*reportingSystem.NGRAN).Equal(*y.NGRAN)) && + (reportingSystem.NoReporting == nil) == (y.NoReporting == nil) && (reportingSystem.NoReporting == nil || (*reportingSystem.NoReporting) == *y.NoReporting) && + (reportingSystem.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (reportingSystem.ChoiceExtension == nil || (*reportingSystem.ChoiceExtension) == *y.ChoiceExtension) +} + +func (requestedNSSAI RequestedNSSAI) Equal(y RequestedNSSAI) bool { + if len(requestedNSSAI) != len(y) { + return false + } + for i := range requestedNSSAI { + if !(requestedNSSAI[i].Equal(y[i])) { + return false + } + } + return true +} + +func (requestedNSSAIItem RequestedNSSAIItem) Equal(y RequestedNSSAIItem) bool { + return requestedNSSAIItem.SNSSAI.Equal(y.SNSSAI) && + requestedNSSAIItem.iEExtensions == y.iEExtensions && + requestedNSSAIItem.extensions == y.extensions +} + +func (rerouteNASRequest RerouteNASRequest) Equal(y RerouteNASRequest) bool { + return rerouteNASRequest.RANUENGAPID == y.RANUENGAPID && + (rerouteNASRequest.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (rerouteNASRequest.AMFUENGAPID == nil || (*rerouteNASRequest.AMFUENGAPID) == *y.AMFUENGAPID) && + rerouteNASRequest.NGAPMessage.Equal(y.NGAPMessage) && + rerouteNASRequest.AMFSetID == y.AMFSetID && + rerouteNASRequest.AllowedNSSAI.Equal(y.AllowedNSSAI) && + (rerouteNASRequest.SourceToTargetAMFInformationReroute == nil) == (y.SourceToTargetAMFInformationReroute == nil) && (rerouteNASRequest.SourceToTargetAMFInformationReroute == nil || (*rerouteNASRequest.SourceToTargetAMFInformationReroute).Equal(*y.SourceToTargetAMFInformationReroute)) && + rerouteNASRequest.PartiallyAllowedNSSAI.Equal(y.PartiallyAllowedNSSAI) && + rerouteNASRequest.messageMeta.Equal(y.messageMeta) +} + +func (resetType ResetType) Equal(y ResetType) bool { + return (resetType.NGInterface == nil) == (y.NGInterface == nil) && (resetType.NGInterface == nil || (*resetType.NGInterface) == *y.NGInterface) && + (resetType.PartOfNGInterface == nil) == (y.PartOfNGInterface == nil) && (resetType.PartOfNGInterface == nil || (*resetType.PartOfNGInterface).Equal(*y.PartOfNGInterface)) && + (resetType.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (resetType.ChoiceExtension == nil || (*resetType.ChoiceExtension) == *y.ChoiceExtension) +} + +func (resourceStatusReportingSystem ResourceStatusReportingSystem) Equal(y ResourceStatusReportingSystem) bool { + return (resourceStatusReportingSystem.EUTRANReportingStatus == nil) == (y.EUTRANReportingStatus == nil) && (resourceStatusReportingSystem.EUTRANReportingStatus == nil || (*resourceStatusReportingSystem.EUTRANReportingStatus).Equal(*y.EUTRANReportingStatus)) && + (resourceStatusReportingSystem.NGRANReportingStatus == nil) == (y.NGRANReportingStatus == nil) && (resourceStatusReportingSystem.NGRANReportingStatus == nil || (*resourceStatusReportingSystem.NGRANReportingStatus).Equal(*y.NGRANReportingStatus)) && + (resourceStatusReportingSystem.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (resourceStatusReportingSystem.ChoiceExtension == nil || (*resourceStatusReportingSystem.ChoiceExtension) == *y.ChoiceExtension) +} + +func (routingID RoutingID) Equal(y RoutingID) bool { + if len(routingID) != len(y) { + return false + } + for i := range routingID { + if !(routingID[i] == y[i]) { + return false + } + } + return true +} + +func (sLPositioningRangingQoSParameters SLPositioningRangingQoSParameters) Equal(y SLPositioningRangingQoSParameters) bool { + return sLPositioningRangingQoSParameters.RSPPQoSFlowList.Equal(y.RSPPQoSFlowList) && + (sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates == nil) == (y.RSPPLinkAggregateBitRates == nil) && (sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates == nil || (*sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates) == *y.RSPPLinkAggregateBitRates) && + sLPositioningRangingQoSParameters.iEExtensions == y.iEExtensions && + sLPositioningRangingQoSParameters.extensions == y.extensions +} + +func (sLPositioningRangingServiceInfo SLPositioningRangingServiceInfo) Equal(y SLPositioningRangingServiceInfo) bool { + return sLPositioningRangingServiceInfo.SLPositioningRangingAuthorized == y.SLPositioningRangingAuthorized && + (sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters == nil) == (y.SLPositioningRangingQoSParameters == nil) && (sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters == nil || (*sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters).Equal(*y.SLPositioningRangingQoSParameters)) && + sLPositioningRangingServiceInfo.iEExtensions == y.iEExtensions && + sLPositioningRangingServiceInfo.extensions == y.extensions +} + +func (sNPNBasedMDT SNPNBasedMDT) Equal(y SNPNBasedMDT) bool { + return sNPNBasedMDT.SNPNListforMDT.Equal(y.SNPNListforMDT) && + sNPNBasedMDT.iEExtensions == y.iEExtensions && + sNPNBasedMDT.extensions == y.extensions +} + +func (sNPNCellBasedMDT SNPNCellBasedMDT) Equal(y SNPNCellBasedMDT) bool { + return sNPNCellBasedMDT.SNPNcellIdListforMDT.Equal(y.SNPNcellIdListforMDT) && + sNPNCellBasedMDT.iEExtensions == y.iEExtensions && + sNPNCellBasedMDT.extensions == y.extensions +} + +func (sNPNCellIdListforMDT SNPNCellIdListforMDT) Equal(y SNPNCellIdListforMDT) bool { + if len(sNPNCellIdListforMDT) != len(y) { + return false + } + for i := range sNPNCellIdListforMDT { + if !(sNPNCellIdListforMDT[i].Equal(y[i])) { + return false + } + } + return true +} + +func (sNPNCellIdListforMDTItem SNPNCellIdListforMDTItem) Equal(y SNPNCellIdListforMDTItem) bool { + return sNPNCellIdListforMDTItem == y +} + +func (sNPNListforMDT SNPNListforMDT) Equal(y SNPNListforMDT) bool { + if len(sNPNListforMDT) != len(y) { + return false + } + for i := range sNPNListforMDT { + if !(sNPNListforMDT[i].Equal(y[i])) { + return false + } + } + return true +} + +func (sNPNListforMDTItem SNPNListforMDTItem) Equal(y SNPNListforMDTItem) bool { + return sNPNListforMDTItem == y +} + +func (sNPNMobilityInformation SNPNMobilityInformation) Equal(y SNPNMobilityInformation) bool { + return sNPNMobilityInformation.ServingNID == y.ServingNID && + sNPNMobilityInformation.EquivalentSNPNsList.Equal(y.EquivalentSNPNsList) && + sNPNMobilityInformation.iEExtensions == y.iEExtensions && + sNPNMobilityInformation.extensions == y.extensions +} + +func (sNPNTAIBasedMDT SNPNTAIBasedMDT) Equal(y SNPNTAIBasedMDT) bool { + return sNPNTAIBasedMDT.SNPNTAIListforMDT.Equal(y.SNPNTAIListforMDT) && + sNPNTAIBasedMDT.iEExtensions == y.iEExtensions && + sNPNTAIBasedMDT.extensions == y.extensions +} + +func (sNPNTAIListforMDT SNPNTAIListforMDT) Equal(y SNPNTAIListforMDT) bool { + if len(sNPNTAIListforMDT) != len(y) { + return false + } + for i := range sNPNTAIListforMDT { + if !(sNPNTAIListforMDT[i].Equal(y[i])) { + return false + } + } + return true +} + +func (sNPNTAIListforMDTItem SNPNTAIListforMDTItem) Equal(y SNPNTAIListforMDTItem) bool { + return sNPNTAIListforMDTItem == y +} + +func (sNSSAI SNSSAI) Equal(y SNSSAI) bool { + return sNSSAI.SST == y.SST && + (sNSSAI.SD == nil) == (y.SD == nil) && (sNSSAI.SD == nil || (*sNSSAI.SD) == *y.SD) && + sNSSAI.iEExtensions == y.iEExtensions && + sNSSAI.extensions == y.extensions +} + +func (sONConfigurationTransfer SONConfigurationTransfer) Equal(y SONConfigurationTransfer) bool { + if len(sONConfigurationTransfer) != len(y) { + return false + } + for i := range sONConfigurationTransfer { + if !(sONConfigurationTransfer[i] == y[i]) { + return false + } + } + return true +} + +func (scheduledCommunicationTime ScheduledCommunicationTime) Equal(y ScheduledCommunicationTime) bool { + return (scheduledCommunicationTime.DayofWeek == nil) == (y.DayofWeek == nil) && (scheduledCommunicationTime.DayofWeek == nil || (*scheduledCommunicationTime.DayofWeek) == *y.DayofWeek) && + (scheduledCommunicationTime.TimeofDayStart == nil) == (y.TimeofDayStart == nil) && (scheduledCommunicationTime.TimeofDayStart == nil || (*scheduledCommunicationTime.TimeofDayStart) == *y.TimeofDayStart) && + (scheduledCommunicationTime.TimeofDayEnd == nil) == (y.TimeofDayEnd == nil) && (scheduledCommunicationTime.TimeofDayEnd == nil || (*scheduledCommunicationTime.TimeofDayEnd) == *y.TimeofDayEnd) && + scheduledCommunicationTime.iEExtensions == y.iEExtensions && + scheduledCommunicationTime.extensions == y.extensions +} + +func (secondaryRATUsageInformation SecondaryRATUsageInformation) Equal(y SecondaryRATUsageInformation) bool { + return (secondaryRATUsageInformation.PDUSessionUsageReport == nil) == (y.PDUSessionUsageReport == nil) && (secondaryRATUsageInformation.PDUSessionUsageReport == nil || (*secondaryRATUsageInformation.PDUSessionUsageReport).Equal(*y.PDUSessionUsageReport)) && + (secondaryRATUsageInformation.QosFlowsUsageReportList == nil) == (y.QosFlowsUsageReportList == nil) && secondaryRATUsageInformation.QosFlowsUsageReportList.Equal(y.QosFlowsUsageReportList) && + secondaryRATUsageInformation.iEExtensions == y.iEExtensions && + secondaryRATUsageInformation.extensions == y.extensions +} + +func (securityAlgorithms SecurityAlgorithms) Equal(y SecurityAlgorithms) bool { + return securityAlgorithms == y +} + +func (securityContext SecurityContext) Equal(y SecurityContext) bool { + return securityContext == y +} + +func (securityIndication SecurityIndication) Equal(y SecurityIndication) bool { + return securityIndication.IntegrityProtectionIndication == y.IntegrityProtectionIndication && + securityIndication.ConfidentialityProtectionIndication == y.ConfidentialityProtectionIndication && + (securityIndication.MaximumIntegrityProtectedDataRateUL == nil) == (y.MaximumIntegrityProtectedDataRateUL == nil) && (securityIndication.MaximumIntegrityProtectedDataRateUL == nil || (*securityIndication.MaximumIntegrityProtectedDataRateUL) == *y.MaximumIntegrityProtectedDataRateUL) && + (securityIndication.MaximumIntegrityProtectedDataRateDL == nil) == (y.MaximumIntegrityProtectedDataRateDL == nil) && (securityIndication.MaximumIntegrityProtectedDataRateDL == nil || (*securityIndication.MaximumIntegrityProtectedDataRateDL) == *y.MaximumIntegrityProtectedDataRateDL) && + securityIndication.iEExtensions == y.iEExtensions && + securityIndication.extensions == y.extensions +} + +func (securityResult SecurityResult) Equal(y SecurityResult) bool { + return securityResult == y +} + +func (sensorMeasConfigNameItem SensorMeasConfigNameItem) Equal(y SensorMeasConfigNameItem) bool { + return sensorMeasConfigNameItem.SensorNameConfig.Equal(y.SensorNameConfig) && + sensorMeasConfigNameItem.iEExtensions == y.iEExtensions && + sensorMeasConfigNameItem.extensions == y.extensions +} + +func (sensorMeasConfigNameList SensorMeasConfigNameList) Equal(y SensorMeasConfigNameList) bool { + if len(sensorMeasConfigNameList) != len(y) { + return false + } + for i := range sensorMeasConfigNameList { + if !(sensorMeasConfigNameList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (sensorMeasurementConfiguration SensorMeasurementConfiguration) Equal(y SensorMeasurementConfiguration) bool { + return sensorMeasurementConfiguration.SensorMeasConfig == y.SensorMeasConfig && + (sensorMeasurementConfiguration.SensorMeasConfigNameList == nil) == (y.SensorMeasConfigNameList == nil) && sensorMeasurementConfiguration.SensorMeasConfigNameList.Equal(y.SensorMeasConfigNameList) && + sensorMeasurementConfiguration.iEExtensions == y.iEExtensions && + sensorMeasurementConfiguration.extensions == y.extensions +} + +func (sensorNameConfig SensorNameConfig) Equal(y SensorNameConfig) bool { + return (sensorNameConfig.UncompensatedBarometricConfig == nil) == (y.UncompensatedBarometricConfig == nil) && (sensorNameConfig.UncompensatedBarometricConfig == nil || (*sensorNameConfig.UncompensatedBarometricConfig) == *y.UncompensatedBarometricConfig) && + (sensorNameConfig.UeSpeedConfig == nil) == (y.UeSpeedConfig == nil) && (sensorNameConfig.UeSpeedConfig == nil || (*sensorNameConfig.UeSpeedConfig) == *y.UeSpeedConfig) && + (sensorNameConfig.UeOrientationConfig == nil) == (y.UeOrientationConfig == nil) && (sensorNameConfig.UeOrientationConfig == nil || (*sensorNameConfig.UeOrientationConfig) == *y.UeOrientationConfig) && + (sensorNameConfig.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (sensorNameConfig.ChoiceExtension == nil || (*sensorNameConfig.ChoiceExtension) == *y.ChoiceExtension) +} + +func (servedGUAMIItem ServedGUAMIItem) Equal(y ServedGUAMIItem) bool { + return servedGUAMIItem.GUAMI.Equal(y.GUAMI) && + (servedGUAMIItem.BackupAMFName == nil) == (y.BackupAMFName == nil) && (servedGUAMIItem.BackupAMFName == nil || (*servedGUAMIItem.BackupAMFName) == *y.BackupAMFName) && + (servedGUAMIItem.GUAMIType == nil) == (y.GUAMIType == nil) && (servedGUAMIItem.GUAMIType == nil || (*servedGUAMIItem.GUAMIType) == *y.GUAMIType) && + (servedGUAMIItem.ExtendedBackupAMFName == nil) == (y.ExtendedBackupAMFName == nil) && (servedGUAMIItem.ExtendedBackupAMFName == nil || (*servedGUAMIItem.ExtendedBackupAMFName).Equal(*y.ExtendedBackupAMFName)) && + servedGUAMIItem.iEExtensions == y.iEExtensions && + servedGUAMIItem.extensions == y.extensions +} + +func (servedGUAMIList ServedGUAMIList) Equal(y ServedGUAMIList) bool { + if len(servedGUAMIList) != len(y) { + return false + } + for i := range servedGUAMIList { + if !(servedGUAMIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (serviceAreaInformation ServiceAreaInformation) Equal(y ServiceAreaInformation) bool { + if len(serviceAreaInformation) != len(y) { + return false + } + for i := range serviceAreaInformation { + if !(serviceAreaInformation[i].Equal(y[i])) { + return false + } + } + return true +} + +func (serviceAreaInformationItem ServiceAreaInformationItem) Equal(y ServiceAreaInformationItem) bool { + return serviceAreaInformationItem.extensions == y.extensions && + serviceAreaInformationItem.PLMNIdentity == y.PLMNIdentity && + (serviceAreaInformationItem.AllowedTACs == nil) == (y.AllowedTACs == nil) && serviceAreaInformationItem.AllowedTACs.Equal(y.AllowedTACs) && + (serviceAreaInformationItem.NotAllowedTACs == nil) == (y.NotAllowedTACs == nil) && serviceAreaInformationItem.NotAllowedTACs.Equal(y.NotAllowedTACs) && + serviceAreaInformationItem.iEExtensions == y.iEExtensions +} + +func (sliceMDTItem SliceMDTItem) Equal(y SliceMDTItem) bool { + return sliceMDTItem.SNSSAI.Equal(y.SNSSAI) && + sliceMDTItem.iEExtensions == y.iEExtensions && + sliceMDTItem.extensions == y.extensions +} + +func (sliceMDTList SliceMDTList) Equal(y SliceMDTList) bool { + if len(sliceMDTList) != len(y) { + return false + } + for i := range sliceMDTList { + if !(sliceMDTList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (sliceOverloadItem SliceOverloadItem) Equal(y SliceOverloadItem) bool { + return sliceOverloadItem.extensions == y.extensions && + sliceOverloadItem.SNSSAI.Equal(y.SNSSAI) && + sliceOverloadItem.iEExtensions == y.iEExtensions +} + +func (sliceSupportItem SliceSupportItem) Equal(y SliceSupportItem) bool { + return sliceSupportItem.extensions == y.extensions && + sliceSupportItem.SNSSAI.Equal(y.SNSSAI) && + sliceSupportItem.iEExtensions == y.iEExtensions +} + +func (sliceSupportList SliceSupportList) Equal(y SliceSupportList) bool { + if len(sliceSupportList) != len(y) { + return false + } + for i := range sliceSupportList { + if !(sliceSupportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (sliceSupportListQMC SliceSupportListQMC) Equal(y SliceSupportListQMC) bool { + if len(sliceSupportListQMC) != len(y) { + return false + } + for i := range sliceSupportListQMC { + if !(sliceSupportListQMC[i].Equal(y[i])) { + return false + } + } + return true +} + +func (sliceSupportQMCItem SliceSupportQMCItem) Equal(y SliceSupportQMCItem) bool { + return sliceSupportQMCItem.SNSSAI.Equal(y.SNSSAI) && + sliceSupportQMCItem.iEExtensions == y.iEExtensions && + sliceSupportQMCItem.extensions == y.extensions +} + +func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Equal(y SourceNGRANNodeToTargetNGRANNodeTransparentContainer) bool { + return sourceNGRANNodeToTargetNGRANNodeTransparentContainer.RRCContainer.Equal(y.RRCContainer) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList == nil) == (y.PDUSessionResourceInformationList == nil) && sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList.Equal(y.PDUSessionResourceInformationList) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList == nil) == (y.ERABInformationList == nil) && sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList.Equal(y.ERABInformationList) && + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TargetCellID.Equal(y.TargetCellID) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP == nil) == (y.IndexToRFSP == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.IndexToRFSP) == *y.IndexToRFSP) && + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation.Equal(y.UEHistoryInformation) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SgNBUEX2APID == nil) == (y.SgNBUEX2APID == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SgNBUEX2APID == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SgNBUEX2APID) == *y.SgNBUEX2APID) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformationFromTheUE == nil) == (y.UEHistoryInformationFromTheUE == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformationFromTheUE == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformationFromTheUE).Equal(*y.UEHistoryInformationFromTheUE)) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SourceNodeID == nil) == (y.SourceNodeID == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SourceNodeID == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SourceNodeID).Equal(*y.SourceNodeID)) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEContextReferenceAtSource == nil) == (y.UEContextReferenceAtSource == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEContextReferenceAtSource == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEContextReferenceAtSource) == *y.UEContextReferenceAtSource) && + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.MBSActiveSessionInformationSourcetoTargetList.Equal(y.MBSActiveSessionInformationSourcetoTargetList) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.QMCConfigInfo == nil) == (y.QMCConfigInfo == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.QMCConfigInfo == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.QMCConfigInfo).Equal(*y.QMCConfigInfo)) && + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.NGAPIESupportInformationRequestList.Equal(y.NGAPIESupportInformationRequestList) && + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.CandidateRelayUEInformationList.Equal(y.CandidateRelayUEInformationList) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TimeBasedHandoverInformation == nil) == (y.TimeBasedHandoverInformation == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TimeBasedHandoverInformation == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.TimeBasedHandoverInformation).Equal(*y.TimeBasedHandoverInformation)) && + (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SourceSNtoTargetSNQMCInfo == nil) == (y.SourceSNtoTargetSNQMCInfo == nil) && (sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SourceSNtoTargetSNQMCInfo == nil || (*sourceNGRANNodeToTargetNGRANNodeTransparentContainer.SourceSNtoTargetSNQMCInfo).Equal(*y.SourceSNtoTargetSNQMCInfo)) && + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions == y.iEExtensions && + sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions == y.extensions +} + +func (sourceNodeID SourceNodeID) Equal(y SourceNodeID) bool { + return (sourceNodeID.SourceengNBID == nil) == (y.SourceengNBID == nil) && (sourceNodeID.SourceengNBID == nil || (*sourceNodeID.SourceengNBID).Equal(*y.SourceengNBID)) && + (sourceNodeID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (sourceNodeID.ChoiceExtension == nil || (*sourceNodeID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (sourceToTargetAMFInformationReroute SourceToTargetAMFInformationReroute) Equal(y SourceToTargetAMFInformationReroute) bool { + return sourceToTargetAMFInformationReroute.extensions == y.extensions && + (sourceToTargetAMFInformationReroute.ConfiguredNSSAI == nil) == (y.ConfiguredNSSAI == nil) && (sourceToTargetAMFInformationReroute.ConfiguredNSSAI == nil || (*sourceToTargetAMFInformationReroute.ConfiguredNSSAI) == *y.ConfiguredNSSAI) && + (sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN == nil) == (y.RejectedNSSAIinPLMN == nil) && (sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN == nil || (*sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN) == *y.RejectedNSSAIinPLMN) && + (sourceToTargetAMFInformationReroute.RejectedNSSAIinTA == nil) == (y.RejectedNSSAIinTA == nil) && (sourceToTargetAMFInformationReroute.RejectedNSSAIinTA == nil || (*sourceToTargetAMFInformationReroute.RejectedNSSAIinTA) == *y.RejectedNSSAIinTA) && + sourceToTargetAMFInformationReroute.iEExtensions == y.iEExtensions +} + +func (sourceToTargetTransparentContainer SourceToTargetTransparentContainer) Equal(y SourceToTargetTransparentContainer) bool { + if len(sourceToTargetTransparentContainer) != len(y) { + return false + } + for i := range sourceToTargetTransparentContainer { + if !(sourceToTargetTransparentContainer[i] == y[i]) { + return false + } + } + return true +} + +func (statusTransferContainer StatusTransferContainer) Equal(y StatusTransferContainer) bool { + if len(statusTransferContainer) != len(y) { + return false + } + for i := range statusTransferContainer { + if !(statusTransferContainer[i] == y[i]) { + return false + } + } + return true +} + +func (supportedTAItem SupportedTAItem) Equal(y SupportedTAItem) bool { + return supportedTAItem.extensions == y.extensions && + supportedTAItem.TAC == y.TAC && + supportedTAItem.BroadcastPLMNList.Equal(y.BroadcastPLMNList) && + (supportedTAItem.ConfiguredTACIndication == nil) == (y.ConfiguredTACIndication == nil) && (supportedTAItem.ConfiguredTACIndication == nil || (*supportedTAItem.ConfiguredTACIndication) == *y.ConfiguredTACIndication) && + (supportedTAItem.RATInformation == nil) == (y.RATInformation == nil) && (supportedTAItem.RATInformation == nil || (*supportedTAItem.RATInformation) == *y.RATInformation) && + supportedTAItem.iEExtensions == y.iEExtensions +} + +func (supportedTAList SupportedTAList) Equal(y SupportedTAList) bool { + if len(supportedTAList) != len(y) { + return false + } + for i := range supportedTAList { + if !(supportedTAList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tABasedMDT TABasedMDT) Equal(y TABasedMDT) bool { + return tABasedMDT.TAListforMDT.Equal(y.TAListforMDT) && + tABasedMDT.iEExtensions == y.iEExtensions && + tABasedMDT.extensions == y.extensions +} + +func (tABasedQMC TABasedQMC) Equal(y TABasedQMC) bool { + return tABasedQMC.TAListforQMC.Equal(y.TAListforQMC) && + tABasedQMC.iEExtensions == y.iEExtensions && + tABasedQMC.extensions == y.extensions +} + +func (tACListInNRNTN TACListInNRNTN) Equal(y TACListInNRNTN) bool { + if len(tACListInNRNTN) != len(y) { + return false + } + for i := range tACListInNRNTN { + if !(tACListInNRNTN[i] == y[i]) { + return false + } + } + return true +} + +func (tAI TAI) Equal(y TAI) bool { + return tAI == y +} + +func (tAIBasedMDT TAIBasedMDT) Equal(y TAIBasedMDT) bool { + return tAIBasedMDT.TAIListforMDT.Equal(y.TAIListforMDT) && + tAIBasedMDT.iEExtensions == y.iEExtensions && + tAIBasedMDT.extensions == y.extensions +} + +func (tAIBasedQMC TAIBasedQMC) Equal(y TAIBasedQMC) bool { + return tAIBasedQMC.TAIListforQMC.Equal(y.TAIListforQMC) && + tAIBasedQMC.iEExtensions == y.iEExtensions && + tAIBasedQMC.extensions == y.extensions +} + +func (tAIBroadcastEUTRA TAIBroadcastEUTRA) Equal(y TAIBroadcastEUTRA) bool { + if len(tAIBroadcastEUTRA) != len(y) { + return false + } + for i := range tAIBroadcastEUTRA { + if !(tAIBroadcastEUTRA[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIBroadcastEUTRAItem TAIBroadcastEUTRAItem) Equal(y TAIBroadcastEUTRAItem) bool { + return tAIBroadcastEUTRAItem.extensions == y.extensions && + tAIBroadcastEUTRAItem.TAI.Equal(y.TAI) && + slices.Equal(tAIBroadcastEUTRAItem.CompletedCellsInTAI, y.CompletedCellsInTAI) && + tAIBroadcastEUTRAItem.iEExtensions == y.iEExtensions +} + +func (tAIBroadcastNR TAIBroadcastNR) Equal(y TAIBroadcastNR) bool { + if len(tAIBroadcastNR) != len(y) { + return false + } + for i := range tAIBroadcastNR { + if !(tAIBroadcastNR[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIBroadcastNRItem TAIBroadcastNRItem) Equal(y TAIBroadcastNRItem) bool { + return tAIBroadcastNRItem.extensions == y.extensions && + tAIBroadcastNRItem.TAI.Equal(y.TAI) && + slices.Equal(tAIBroadcastNRItem.CompletedCellsInTAI, y.CompletedCellsInTAI) && + tAIBroadcastNRItem.iEExtensions == y.iEExtensions +} + +func (tAICancelledEUTRA TAICancelledEUTRA) Equal(y TAICancelledEUTRA) bool { + if len(tAICancelledEUTRA) != len(y) { + return false + } + for i := range tAICancelledEUTRA { + if !(tAICancelledEUTRA[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAICancelledEUTRAItem TAICancelledEUTRAItem) Equal(y TAICancelledEUTRAItem) bool { + return tAICancelledEUTRAItem.extensions == y.extensions && + tAICancelledEUTRAItem.TAI.Equal(y.TAI) && + slices.Equal(tAICancelledEUTRAItem.CancelledCellsInTAI, y.CancelledCellsInTAI) && + tAICancelledEUTRAItem.iEExtensions == y.iEExtensions +} + +func (tAICancelledNR TAICancelledNR) Equal(y TAICancelledNR) bool { + if len(tAICancelledNR) != len(y) { + return false + } + for i := range tAICancelledNR { + if !(tAICancelledNR[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAICancelledNRItem TAICancelledNRItem) Equal(y TAICancelledNRItem) bool { + return tAICancelledNRItem.extensions == y.extensions && + tAICancelledNRItem.TAI.Equal(y.TAI) && + slices.Equal(tAICancelledNRItem.CancelledCellsInTAI, y.CancelledCellsInTAI) && + tAICancelledNRItem.iEExtensions == y.iEExtensions +} + +func (tAIListForInactive TAIListForInactive) Equal(y TAIListForInactive) bool { + if len(tAIListForInactive) != len(y) { + return false + } + for i := range tAIListForInactive { + if !(tAIListForInactive[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIListForInactiveItem TAIListForInactiveItem) Equal(y TAIListForInactiveItem) bool { + return tAIListForInactiveItem == y +} + +func (tAIListForPaging TAIListForPaging) Equal(y TAIListForPaging) bool { + if len(tAIListForPaging) != len(y) { + return false + } + for i := range tAIListForPaging { + if !(tAIListForPaging[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIListForPagingItem TAIListForPagingItem) Equal(y TAIListForPagingItem) bool { + return tAIListForPagingItem == y +} + +func (tAIListForRestart TAIListForRestart) Equal(y TAIListForRestart) bool { + if len(tAIListForRestart) != len(y) { + return false + } + for i := range tAIListForRestart { + if !(tAIListForRestart[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIListForWarning TAIListForWarning) Equal(y TAIListForWarning) bool { + if len(tAIListForWarning) != len(y) { + return false + } + for i := range tAIListForWarning { + if !(tAIListForWarning[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIListforMDT TAIListforMDT) Equal(y TAIListforMDT) bool { + if len(tAIListforMDT) != len(y) { + return false + } + for i := range tAIListforMDT { + if !(tAIListforMDT[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIListforQMC TAIListforQMC) Equal(y TAIListforQMC) bool { + if len(tAIListforQMC) != len(y) { + return false + } + for i := range tAIListforQMC { + if !(tAIListforQMC[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAINSAGSupportItem TAINSAGSupportItem) Equal(y TAINSAGSupportItem) bool { + return tAINSAGSupportItem.NSAGID == y.NSAGID && + tAINSAGSupportItem.NSAGSliceSupportList.Equal(y.NSAGSliceSupportList) && + tAINSAGSupportItem.iEExtensions == y.iEExtensions && + tAINSAGSupportItem.extensions == y.extensions +} + +func (tAINSAGSupportList TAINSAGSupportList) Equal(y TAINSAGSupportList) bool { + if len(tAINSAGSupportList) != len(y) { + return false + } + for i := range tAINSAGSupportList { + if !(tAINSAGSupportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAListforMDT TAListforMDT) Equal(y TAListforMDT) bool { + if len(tAListforMDT) != len(y) { + return false + } + for i := range tAListforMDT { + if !(tAListforMDT[i] == y[i]) { + return false + } + } + return true +} + +func (tAListforQMC TAListforQMC) Equal(y TAListforQMC) bool { + if len(tAListforQMC) != len(y) { + return false + } + for i := range tAListforQMC { + if !(tAListforQMC[i] == y[i]) { + return false + } + } + return true +} + +func (tLContainer TLContainer) Equal(y TLContainer) bool { + if len(tLContainer) != len(y) { + return false + } + for i := range tLContainer { + if !(tLContainer[i] == y[i]) { + return false + } + } + return true +} + +func (tMGI TMGI) Equal(y TMGI) bool { + if len(tMGI) != len(y) { + return false + } + for i := range tMGI { + if !(tMGI[i] == y[i]) { + return false + } + } + return true +} + +func (tNAPID TNAPID) Equal(y TNAPID) bool { + if len(tNAPID) != len(y) { + return false + } + for i := range tNAPID { + if !(tNAPID[i] == y[i]) { + return false + } + } + return true +} + +func (tNGFID TNGFID) Equal(y TNGFID) bool { + return (tNGFID.TNGFID == nil) == (y.TNGFID == nil) && (tNGFID.TNGFID == nil || (*tNGFID.TNGFID).Equal(*y.TNGFID)) && + (tNGFID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (tNGFID.ChoiceExtension == nil || (*tNGFID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (tNGFIDValue TNGFIDValue) Equal(y TNGFIDValue) bool { + return tNGFIDValue == y +} + +func (tNLAssociationItem TNLAssociationItem) Equal(y TNLAssociationItem) bool { + return tNLAssociationItem.TNLAssociationAddress.Equal(y.TNLAssociationAddress) && + tNLAssociationItem.Cause.Equal(y.Cause) && + tNLAssociationItem.iEExtensions == y.iEExtensions && + tNLAssociationItem.extensions == y.extensions +} + +func (tNLAssociationList TNLAssociationList) Equal(y TNLAssociationList) bool { + if len(tNLAssociationList) != len(y) { + return false + } + for i := range tNLAssociationList { + if !(tNLAssociationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tSCAssistanceInformation TSCAssistanceInformation) Equal(y TSCAssistanceInformation) bool { + return tSCAssistanceInformation.Periodicity == y.Periodicity && + (tSCAssistanceInformation.BurstArrivalTime == nil) == (y.BurstArrivalTime == nil) && (tSCAssistanceInformation.BurstArrivalTime == nil || (*tSCAssistanceInformation.BurstArrivalTime).Equal(*y.BurstArrivalTime)) && + (tSCAssistanceInformation.SurvivalTime == nil) == (y.SurvivalTime == nil) && (tSCAssistanceInformation.SurvivalTime == nil || (*tSCAssistanceInformation.SurvivalTime) == *y.SurvivalTime) && + (tSCAssistanceInformation.RANfeedbacktype == nil) == (y.RANfeedbacktype == nil) && (tSCAssistanceInformation.RANfeedbacktype == nil || (*tSCAssistanceInformation.RANfeedbacktype).Equal(*y.RANfeedbacktype)) && + (tSCAssistanceInformation.N6JitterInformation == nil) == (y.N6JitterInformation == nil) && (tSCAssistanceInformation.N6JitterInformation == nil || (*tSCAssistanceInformation.N6JitterInformation).Equal(*y.N6JitterInformation)) && + tSCAssistanceInformation.iEExtensions == y.iEExtensions && + tSCAssistanceInformation.extensions == y.extensions +} + +func (tSCFeedbackInformation TSCFeedbackInformation) Equal(y TSCFeedbackInformation) bool { + return tSCFeedbackInformation.BurstArrivalTimeOffset == y.BurstArrivalTimeOffset && + (tSCFeedbackInformation.AdjustedPeriodicity == nil) == (y.AdjustedPeriodicity == nil) && (tSCFeedbackInformation.AdjustedPeriodicity == nil || (*tSCFeedbackInformation.AdjustedPeriodicity) == *y.AdjustedPeriodicity) && + tSCFeedbackInformation.iEExtensions == y.iEExtensions && + tSCFeedbackInformation.extensions == y.extensions +} + +func (tSCTrafficCharacteristics TSCTrafficCharacteristics) Equal(y TSCTrafficCharacteristics) bool { + return (tSCTrafficCharacteristics.TSCAssistanceInformationDL == nil) == (y.TSCAssistanceInformationDL == nil) && (tSCTrafficCharacteristics.TSCAssistanceInformationDL == nil || (*tSCTrafficCharacteristics.TSCAssistanceInformationDL).Equal(*y.TSCAssistanceInformationDL)) && + (tSCTrafficCharacteristics.TSCAssistanceInformationUL == nil) == (y.TSCAssistanceInformationUL == nil) && (tSCTrafficCharacteristics.TSCAssistanceInformationUL == nil || (*tSCTrafficCharacteristics.TSCAssistanceInformationUL).Equal(*y.TSCAssistanceInformationUL)) && + tSCTrafficCharacteristics.iEExtensions == y.iEExtensions && + tSCTrafficCharacteristics.extensions == y.extensions +} + +func (tSCTrafficCharacteristicsFeedback TSCTrafficCharacteristicsFeedback) Equal(y TSCTrafficCharacteristicsFeedback) bool { + return (tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL == nil) == (y.TSCFeedbackInformationDL == nil) && (tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL == nil || (*tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL).Equal(*y.TSCFeedbackInformationDL)) && + (tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL == nil) == (y.TSCFeedbackInformationUL == nil) && (tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL == nil || (*tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL).Equal(*y.TSCFeedbackInformationUL)) && + tSCTrafficCharacteristicsFeedback.iEExtensions == y.iEExtensions && + tSCTrafficCharacteristicsFeedback.extensions == y.extensions +} + +func (tWAPID TWAPID) Equal(y TWAPID) bool { + if len(tWAPID) != len(y) { + return false + } + for i := range tWAPID { + if !(tWAPID[i] == y[i]) { + return false + } + } + return true +} + +func (tWIFID TWIFID) Equal(y TWIFID) bool { + return (tWIFID.TWIFID == nil) == (y.TWIFID == nil) && (tWIFID.TWIFID == nil || (*tWIFID.TWIFID).Equal(*y.TWIFID)) && + (tWIFID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (tWIFID.ChoiceExtension == nil || (*tWIFID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (tWIFIDValue TWIFIDValue) Equal(y TWIFIDValue) bool { + return tWIFIDValue == y +} + +func (targetHomeENBID TargetHomeENBID) Equal(y TargetHomeENBID) bool { + return targetHomeENBID == y +} + +func (targetID TargetID) Equal(y TargetID) bool { + return (targetID.TargetRANNodeID == nil) == (y.TargetRANNodeID == nil) && (targetID.TargetRANNodeID == nil || (*targetID.TargetRANNodeID).Equal(*y.TargetRANNodeID)) && + (targetID.TargeteNBID == nil) == (y.TargeteNBID == nil) && (targetID.TargeteNBID == nil || (*targetID.TargeteNBID).Equal(*y.TargeteNBID)) && + (targetID.TargetRNCID == nil) == (y.TargetRNCID == nil) && (targetID.TargetRNCID == nil || (*targetID.TargetRNCID).Equal(*y.TargetRNCID)) && + (targetID.TargetHomeENBID == nil) == (y.TargetHomeENBID == nil) && (targetID.TargetHomeENBID == nil || (*targetID.TargetHomeENBID).Equal(*y.TargetHomeENBID)) && + (targetID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (targetID.ChoiceExtension == nil || (*targetID.ChoiceExtension) == *y.ChoiceExtension) && + targetID.choiceCriticality == y.choiceCriticality +} + +func (targetNSSAI TargetNSSAI) Equal(y TargetNSSAI) bool { + if len(targetNSSAI) != len(y) { + return false + } + for i := range targetNSSAI { + if !(targetNSSAI[i].Equal(y[i])) { + return false + } + } + return true +} + +func (targetNSSAIInformation TargetNSSAIInformation) Equal(y TargetNSSAIInformation) bool { + return targetNSSAIInformation.TargetNSSAI.Equal(y.TargetNSSAI) && + targetNSSAIInformation.IndexToRFSP == y.IndexToRFSP && + targetNSSAIInformation.iEExtensions == y.iEExtensions && + targetNSSAIInformation.extensions == y.extensions +} + +func (targetNSSAIItem TargetNSSAIItem) Equal(y TargetNSSAIItem) bool { + return targetNSSAIItem.SNSSAI.Equal(y.SNSSAI) && + targetNSSAIItem.iEExtensions == y.iEExtensions && + targetNSSAIItem.extensions == y.extensions +} + +func (targetRANNodeID TargetRANNodeID) Equal(y TargetRANNodeID) bool { + return targetRANNodeID.extensions == y.extensions && + targetRANNodeID.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + targetRANNodeID.SelectedTAI.Equal(y.SelectedTAI) && + (targetRANNodeID.SelectedTargetSNPNIdentity == nil) == (y.SelectedTargetSNPNIdentity == nil) && (targetRANNodeID.SelectedTargetSNPNIdentity == nil || (*targetRANNodeID.SelectedTargetSNPNIdentity) == *y.SelectedTargetSNPNIdentity) && + targetRANNodeID.iEExtensions == y.iEExtensions +} + +func (targetRANNodeIDSON TargetRANNodeIDSON) Equal(y TargetRANNodeIDSON) bool { + return targetRANNodeIDSON.extensions == y.extensions && + targetRANNodeIDSON.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + targetRANNodeIDSON.SelectedTAI.Equal(y.SelectedTAI) && + (targetRANNodeIDSON.NRCGI == nil) == (y.NRCGI == nil) && (targetRANNodeIDSON.NRCGI == nil || (*targetRANNodeIDSON.NRCGI).Equal(*y.NRCGI)) && + targetRANNodeIDSON.iEExtensions == y.iEExtensions +} + +func (targetRNCID TargetRNCID) Equal(y TargetRNCID) bool { + return targetRNCID.LAI.Equal(y.LAI) && + targetRNCID.RNCID == y.RNCID && + (targetRNCID.ExtendedRNCID == nil) == (y.ExtendedRNCID == nil) && (targetRNCID.ExtendedRNCID == nil || (*targetRNCID.ExtendedRNCID) == *y.ExtendedRNCID) && + targetRNCID.iEExtensions == y.iEExtensions && + targetRNCID.extensions == y.extensions +} + +func (targetToSourceTransparentContainer TargetToSourceTransparentContainer) Equal(y TargetToSourceTransparentContainer) bool { + if len(targetToSourceTransparentContainer) != len(y) { + return false + } + for i := range targetToSourceTransparentContainer { + if !(targetToSourceTransparentContainer[i] == y[i]) { + return false + } + } + return true +} + +func (targeteNBID TargeteNBID) Equal(y TargeteNBID) bool { + return targeteNBID.extensions == y.extensions && + targeteNBID.GlobalENBID.Equal(y.GlobalENBID) && + targeteNBID.SelectedEPSTAI.Equal(y.SelectedEPSTAI) && + targeteNBID.iEExtensions == y.iEExtensions +} + +func (targettoSourceFailureTransparentContainer TargettoSourceFailureTransparentContainer) Equal(y TargettoSourceFailureTransparentContainer) bool { + if len(targettoSourceFailureTransparentContainer) != len(y) { + return false + } + for i := range targettoSourceFailureTransparentContainer { + if !(targettoSourceFailureTransparentContainer[i] == y[i]) { + return false + } + } + return true +} + +func (timeBasedHandoverInformation TimeBasedHandoverInformation) Equal(y TimeBasedHandoverInformation) bool { + return timeBasedHandoverInformation == y +} + +func (timeSyncAssistanceInfo TimeSyncAssistanceInfo) Equal(y TimeSyncAssistanceInfo) bool { + return timeSyncAssistanceInfo.TimeDistributionIndication == y.TimeDistributionIndication && + (timeSyncAssistanceInfo.UUTimeSyncErrorBudget == nil) == (y.UUTimeSyncErrorBudget == nil) && (timeSyncAssistanceInfo.UUTimeSyncErrorBudget == nil || (*timeSyncAssistanceInfo.UUTimeSyncErrorBudget) == *y.UUTimeSyncErrorBudget) && + (timeSyncAssistanceInfo.ClockQualityReportingControlInfo == nil) == (y.ClockQualityReportingControlInfo == nil) && (timeSyncAssistanceInfo.ClockQualityReportingControlInfo == nil || (*timeSyncAssistanceInfo.ClockQualityReportingControlInfo).Equal(*y.ClockQualityReportingControlInfo)) && + timeSyncAssistanceInfo.iEExtensions == y.iEExtensions && + timeSyncAssistanceInfo.extensions == y.extensions +} + +func (tooearlyIntersystemHO TooearlyIntersystemHO) Equal(y TooearlyIntersystemHO) bool { + return tooearlyIntersystemHO.SourcecellID.Equal(y.SourcecellID) && + tooearlyIntersystemHO.FailurecellID.Equal(y.FailurecellID) && + (tooearlyIntersystemHO.UERLFReportContainer == nil) == (y.UERLFReportContainer == nil) && (tooearlyIntersystemHO.UERLFReportContainer == nil || (*tooearlyIntersystemHO.UERLFReportContainer).Equal(*y.UERLFReportContainer)) && + tooearlyIntersystemHO.iEExtensions == y.iEExtensions && + tooearlyIntersystemHO.extensions == y.extensions +} + +func (traceActivation TraceActivation) Equal(y TraceActivation) bool { + return traceActivation.NGRANTraceID == y.NGRANTraceID && + traceActivation.InterfacesToTrace == y.InterfacesToTrace && + traceActivation.TraceDepth == y.TraceDepth && + traceActivation.TraceCollectionEntityIPAddress == y.TraceCollectionEntityIPAddress && + (traceActivation.MDTConfiguration == nil) == (y.MDTConfiguration == nil) && (traceActivation.MDTConfiguration == nil || (*traceActivation.MDTConfiguration).Equal(*y.MDTConfiguration)) && + (traceActivation.TraceCollectionEntityURI == nil) == (y.TraceCollectionEntityURI == nil) && (traceActivation.TraceCollectionEntityURI == nil || (*traceActivation.TraceCollectionEntityURI) == *y.TraceCollectionEntityURI) && + traceActivation.iEExtensions == y.iEExtensions && + traceActivation.extensions == y.extensions +} + +func (traceFailureIndication TraceFailureIndication) Equal(y TraceFailureIndication) bool { + return traceFailureIndication.AMFUENGAPID == y.AMFUENGAPID && + traceFailureIndication.RANUENGAPID == y.RANUENGAPID && + (traceFailureIndication.NGRANTraceID == nil) == (y.NGRANTraceID == nil) && (traceFailureIndication.NGRANTraceID == nil || (*traceFailureIndication.NGRANTraceID) == *y.NGRANTraceID) && + (traceFailureIndication.Cause == nil) == (y.Cause == nil) && (traceFailureIndication.Cause == nil || (*traceFailureIndication.Cause).Equal(*y.Cause)) && + traceFailureIndication.messageMeta.Equal(y.messageMeta) +} + +func (traceStart TraceStart) Equal(y TraceStart) bool { + return traceStart.AMFUENGAPID == y.AMFUENGAPID && + traceStart.RANUENGAPID == y.RANUENGAPID && + (traceStart.TraceActivation == nil) == (y.TraceActivation == nil) && (traceStart.TraceActivation == nil || (*traceStart.TraceActivation).Equal(*y.TraceActivation)) && + traceStart.messageMeta.Equal(y.messageMeta) +} + +func (transferContainer TransferContainer) Equal(y TransferContainer) bool { + if len(transferContainer) != len(y) { + return false + } + for i := range transferContainer { + if !(transferContainer[i] == y[i]) { + return false + } + } + return true +} + +func (uEAggregateMaximumBitRate UEAggregateMaximumBitRate) Equal(y UEAggregateMaximumBitRate) bool { + return uEAggregateMaximumBitRate == y +} + +func (uEAppLayerMeasConfigInfo UEAppLayerMeasConfigInfo) Equal(y UEAppLayerMeasConfigInfo) bool { + return uEAppLayerMeasConfigInfo.QoEReference.Equal(y.QoEReference) && + uEAppLayerMeasConfigInfo.ServiceType == y.ServiceType && + (uEAppLayerMeasConfigInfo.AreaScopeOfQMC == nil) == (y.AreaScopeOfQMC == nil) && (uEAppLayerMeasConfigInfo.AreaScopeOfQMC == nil || (*uEAppLayerMeasConfigInfo.AreaScopeOfQMC).Equal(*y.AreaScopeOfQMC)) && + uEAppLayerMeasConfigInfo.MeasCollEntityIPAddress == y.MeasCollEntityIPAddress && + (uEAppLayerMeasConfigInfo.QoEMeasurementStatus == nil) == (y.QoEMeasurementStatus == nil) && (uEAppLayerMeasConfigInfo.QoEMeasurementStatus == nil || (*uEAppLayerMeasConfigInfo.QoEMeasurementStatus) == *y.QoEMeasurementStatus) && + (uEAppLayerMeasConfigInfo.ContainerForAppLayerMeasConfig == nil) == (y.ContainerForAppLayerMeasConfig == nil) && uEAppLayerMeasConfigInfo.ContainerForAppLayerMeasConfig.Equal(y.ContainerForAppLayerMeasConfig) && + (uEAppLayerMeasConfigInfo.MeasConfigAppLayerID == nil) == (y.MeasConfigAppLayerID == nil) && (uEAppLayerMeasConfigInfo.MeasConfigAppLayerID == nil || (*uEAppLayerMeasConfigInfo.MeasConfigAppLayerID) == *y.MeasConfigAppLayerID) && + (uEAppLayerMeasConfigInfo.SliceSupportListQMC == nil) == (y.SliceSupportListQMC == nil) && uEAppLayerMeasConfigInfo.SliceSupportListQMC.Equal(y.SliceSupportListQMC) && + (uEAppLayerMeasConfigInfo.MDTAlignmentInfo == nil) == (y.MDTAlignmentInfo == nil) && (uEAppLayerMeasConfigInfo.MDTAlignmentInfo == nil || (*uEAppLayerMeasConfigInfo.MDTAlignmentInfo).Equal(*y.MDTAlignmentInfo)) && + (uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics == nil) == (y.AvailableRANVisibleQoEMetrics == nil) && (uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics == nil || (*uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics).Equal(*y.AvailableRANVisibleQoEMetrics)) && + (uEAppLayerMeasConfigInfo.AssistanceInformationQoEMeas == nil) == (y.AssistanceInformationQoEMeas == nil) && (uEAppLayerMeasConfigInfo.AssistanceInformationQoEMeas == nil || (*uEAppLayerMeasConfigInfo.AssistanceInformationQoEMeas) == *y.AssistanceInformationQoEMeas) && + (uEAppLayerMeasConfigInfo.CommServiceType == nil) == (y.CommServiceType == nil) && (uEAppLayerMeasConfigInfo.CommServiceType == nil || (*uEAppLayerMeasConfigInfo.CommServiceType) == *y.CommServiceType) && + (uEAppLayerMeasConfigInfo.QoERVQoEReportingPaths == nil) == (y.QoERVQoEReportingPaths == nil) && (uEAppLayerMeasConfigInfo.QoERVQoEReportingPaths == nil || (*uEAppLayerMeasConfigInfo.QoERVQoEReportingPaths).Equal(*y.QoERVQoEReportingPaths)) && + uEAppLayerMeasConfigInfo.iEExtensions == y.iEExtensions && + uEAppLayerMeasConfigInfo.extensions == y.extensions +} + +func (uEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig UEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig) Equal(y UEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig) bool { + if len(uEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig) != len(y) { + return false + } + for i := range uEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig { + if !(uEAppLayerMeasConfigInfoContainerForAppLayerMeasConfig[i] == y[i]) { + return false + } + } + return true +} + +func (uEAppLayerMeasInfoItem UEAppLayerMeasInfoItem) Equal(y UEAppLayerMeasInfoItem) bool { + return uEAppLayerMeasInfoItem.UEAppLayerMeasConfigInfo.Equal(y.UEAppLayerMeasConfigInfo) && + uEAppLayerMeasInfoItem.iEExtensions == y.iEExtensions && + uEAppLayerMeasInfoItem.extensions == y.extensions +} + +func (uEAppLayerMeasInfoList UEAppLayerMeasInfoList) Equal(y UEAppLayerMeasInfoList) bool { + if len(uEAppLayerMeasInfoList) != len(y) { + return false + } + for i := range uEAppLayerMeasInfoList { + if !(uEAppLayerMeasInfoList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uEAssociatedLogicalNGConnectionItem UEAssociatedLogicalNGConnectionItem) Equal(y UEAssociatedLogicalNGConnectionItem) bool { + return (uEAssociatedLogicalNGConnectionItem.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (uEAssociatedLogicalNGConnectionItem.AMFUENGAPID == nil || (*uEAssociatedLogicalNGConnectionItem.AMFUENGAPID) == *y.AMFUENGAPID) && + (uEAssociatedLogicalNGConnectionItem.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (uEAssociatedLogicalNGConnectionItem.RANUENGAPID == nil || (*uEAssociatedLogicalNGConnectionItem.RANUENGAPID) == *y.RANUENGAPID) && + uEAssociatedLogicalNGConnectionItem.iEExtensions == y.iEExtensions && + uEAssociatedLogicalNGConnectionItem.extensions == y.extensions +} + +func (uEAssociatedLogicalNGConnectionList UEAssociatedLogicalNGConnectionList) Equal(y UEAssociatedLogicalNGConnectionList) bool { + if len(uEAssociatedLogicalNGConnectionList) != len(y) { + return false + } + for i := range uEAssociatedLogicalNGConnectionList { + if !(uEAssociatedLogicalNGConnectionList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uEContextModificationFailure UEContextModificationFailure) Equal(y UEContextModificationFailure) bool { + return (uEContextModificationFailure.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (uEContextModificationFailure.AMFUENGAPID == nil || (*uEContextModificationFailure.AMFUENGAPID) == *y.AMFUENGAPID) && + (uEContextModificationFailure.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (uEContextModificationFailure.RANUENGAPID == nil || (*uEContextModificationFailure.RANUENGAPID) == *y.RANUENGAPID) && + (uEContextModificationFailure.Cause == nil) == (y.Cause == nil) && (uEContextModificationFailure.Cause == nil || (*uEContextModificationFailure.Cause).Equal(*y.Cause)) && + (uEContextModificationFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (uEContextModificationFailure.CriticalityDiagnostics == nil || (*uEContextModificationFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + uEContextModificationFailure.messageMeta.Equal(y.messageMeta) +} + +func (uEContextModificationRequest UEContextModificationRequest) Equal(y UEContextModificationRequest) bool { + return uEContextModificationRequest.AMFUENGAPID == y.AMFUENGAPID && + uEContextModificationRequest.RANUENGAPID == y.RANUENGAPID && + (uEContextModificationRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (uEContextModificationRequest.UEAggregateMaximumBitRate == nil || (*uEContextModificationRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + (uEContextModificationRequest.NewAMFUENGAPID == nil) == (y.NewAMFUENGAPID == nil) && (uEContextModificationRequest.NewAMFUENGAPID == nil || (*uEContextModificationRequest.NewAMFUENGAPID) == *y.NewAMFUENGAPID) && + (uEContextModificationRequest.RANPagingPriority == nil) == (y.RANPagingPriority == nil) && (uEContextModificationRequest.RANPagingPriority == nil || (*uEContextModificationRequest.RANPagingPriority) == *y.RANPagingPriority) && + (uEContextModificationRequest.SecurityKey == nil) == (y.SecurityKey == nil) && (uEContextModificationRequest.SecurityKey == nil || (*uEContextModificationRequest.SecurityKey) == *y.SecurityKey) && + (uEContextModificationRequest.IndexToRFSP == nil) == (y.IndexToRFSP == nil) && (uEContextModificationRequest.IndexToRFSP == nil || (*uEContextModificationRequest.IndexToRFSP) == *y.IndexToRFSP) && + (uEContextModificationRequest.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (uEContextModificationRequest.UESecurityCapabilities == nil || (*uEContextModificationRequest.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && + (uEContextModificationRequest.CoreNetworkAssistanceInformationForInactive == nil) == (y.CoreNetworkAssistanceInformationForInactive == nil) && (uEContextModificationRequest.CoreNetworkAssistanceInformationForInactive == nil || (*uEContextModificationRequest.CoreNetworkAssistanceInformationForInactive).Equal(*y.CoreNetworkAssistanceInformationForInactive)) && + (uEContextModificationRequest.EmergencyFallbackIndicator == nil) == (y.EmergencyFallbackIndicator == nil) && (uEContextModificationRequest.EmergencyFallbackIndicator == nil || (*uEContextModificationRequest.EmergencyFallbackIndicator).Equal(*y.EmergencyFallbackIndicator)) && + (uEContextModificationRequest.RRCInactiveTransitionReportRequest == nil) == (y.RRCInactiveTransitionReportRequest == nil) && (uEContextModificationRequest.RRCInactiveTransitionReportRequest == nil || (*uEContextModificationRequest.RRCInactiveTransitionReportRequest) == *y.RRCInactiveTransitionReportRequest) && + (uEContextModificationRequest.NewGUAMI == nil) == (y.NewGUAMI == nil) && (uEContextModificationRequest.NewGUAMI == nil || (*uEContextModificationRequest.NewGUAMI).Equal(*y.NewGUAMI)) && + (uEContextModificationRequest.CNAssistedRANTuning == nil) == (y.CNAssistedRANTuning == nil) && (uEContextModificationRequest.CNAssistedRANTuning == nil || (*uEContextModificationRequest.CNAssistedRANTuning).Equal(*y.CNAssistedRANTuning)) && + (uEContextModificationRequest.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (uEContextModificationRequest.SRVCCOperationPossible == nil || (*uEContextModificationRequest.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (uEContextModificationRequest.IABAuthorized == nil) == (y.IABAuthorized == nil) && (uEContextModificationRequest.IABAuthorized == nil || (*uEContextModificationRequest.IABAuthorized) == *y.IABAuthorized) && + (uEContextModificationRequest.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (uEContextModificationRequest.NRV2XServicesAuthorized == nil || (*uEContextModificationRequest.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (uEContextModificationRequest.LTEV2XServicesAuthorized == nil) == (y.LTEV2XServicesAuthorized == nil) && (uEContextModificationRequest.LTEV2XServicesAuthorized == nil || (*uEContextModificationRequest.LTEV2XServicesAuthorized).Equal(*y.LTEV2XServicesAuthorized)) && + (uEContextModificationRequest.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (uEContextModificationRequest.NRUESidelinkAggregateMaximumBitrate == nil || (*uEContextModificationRequest.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (uEContextModificationRequest.LTEUESidelinkAggregateMaximumBitrate == nil) == (y.LTEUESidelinkAggregateMaximumBitrate == nil) && (uEContextModificationRequest.LTEUESidelinkAggregateMaximumBitrate == nil || (*uEContextModificationRequest.LTEUESidelinkAggregateMaximumBitrate).Equal(*y.LTEUESidelinkAggregateMaximumBitrate)) && + (uEContextModificationRequest.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (uEContextModificationRequest.PC5QoSParameters == nil || (*uEContextModificationRequest.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (uEContextModificationRequest.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (uEContextModificationRequest.UERadioCapabilityID == nil || (*uEContextModificationRequest.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && + (uEContextModificationRequest.RGLevelWirelineAccessCharacteristics == nil) == (y.RGLevelWirelineAccessCharacteristics == nil) && (uEContextModificationRequest.RGLevelWirelineAccessCharacteristics == nil || (*uEContextModificationRequest.RGLevelWirelineAccessCharacteristics).Equal(*y.RGLevelWirelineAccessCharacteristics)) && + (uEContextModificationRequest.TimeSyncAssistanceInfo == nil) == (y.TimeSyncAssistanceInfo == nil) && (uEContextModificationRequest.TimeSyncAssistanceInfo == nil || (*uEContextModificationRequest.TimeSyncAssistanceInfo).Equal(*y.TimeSyncAssistanceInfo)) && + (uEContextModificationRequest.QMCConfigInfo == nil) == (y.QMCConfigInfo == nil) && (uEContextModificationRequest.QMCConfigInfo == nil || (*uEContextModificationRequest.QMCConfigInfo).Equal(*y.QMCConfigInfo)) && + (uEContextModificationRequest.QMCDeactivation == nil) == (y.QMCDeactivation == nil) && (uEContextModificationRequest.QMCDeactivation == nil || (*uEContextModificationRequest.QMCDeactivation).Equal(*y.QMCDeactivation)) && + uEContextModificationRequest.UESliceMaximumBitRateList.Equal(y.UESliceMaximumBitRateList) && + uEContextModificationRequest.ManagementBasedMDTPLMNModificationList.Equal(y.ManagementBasedMDTPLMNModificationList) && + (uEContextModificationRequest.FiveGProSeAuthorized == nil) == (y.FiveGProSeAuthorized == nil) && (uEContextModificationRequest.FiveGProSeAuthorized == nil || (*uEContextModificationRequest.FiveGProSeAuthorized).Equal(*y.FiveGProSeAuthorized)) && + (uEContextModificationRequest.FiveGProSeUEPC5AggregateMaximumBitRate == nil) == (y.FiveGProSeUEPC5AggregateMaximumBitRate == nil) && (uEContextModificationRequest.FiveGProSeUEPC5AggregateMaximumBitRate == nil || (*uEContextModificationRequest.FiveGProSeUEPC5AggregateMaximumBitRate).Equal(*y.FiveGProSeUEPC5AggregateMaximumBitRate)) && + (uEContextModificationRequest.FiveGProSePC5QoSParameters == nil) == (y.FiveGProSePC5QoSParameters == nil) && (uEContextModificationRequest.FiveGProSePC5QoSParameters == nil || (*uEContextModificationRequest.FiveGProSePC5QoSParameters).Equal(*y.FiveGProSePC5QoSParameters)) && + (uEContextModificationRequest.NetworkControlledRepeaterAuthorized == nil) == (y.NetworkControlledRepeaterAuthorized == nil) && (uEContextModificationRequest.NetworkControlledRepeaterAuthorized == nil || (*uEContextModificationRequest.NetworkControlledRepeaterAuthorized) == *y.NetworkControlledRepeaterAuthorized) && + (uEContextModificationRequest.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (uEContextModificationRequest.AerialUEsubscriptionInformation == nil || (*uEContextModificationRequest.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (uEContextModificationRequest.NRA2XServicesAuthorized == nil) == (y.NRA2XServicesAuthorized == nil) && (uEContextModificationRequest.NRA2XServicesAuthorized == nil || (*uEContextModificationRequest.NRA2XServicesAuthorized).Equal(*y.NRA2XServicesAuthorized)) && + (uEContextModificationRequest.LTEA2XServicesAuthorized == nil) == (y.LTEA2XServicesAuthorized == nil) && (uEContextModificationRequest.LTEA2XServicesAuthorized == nil || (*uEContextModificationRequest.LTEA2XServicesAuthorized).Equal(*y.LTEA2XServicesAuthorized)) && + (uEContextModificationRequest.NRA2XUEPC5AggregateMaximumBitRate == nil) == (y.NRA2XUEPC5AggregateMaximumBitRate == nil) && (uEContextModificationRequest.NRA2XUEPC5AggregateMaximumBitRate == nil || (*uEContextModificationRequest.NRA2XUEPC5AggregateMaximumBitRate).Equal(*y.NRA2XUEPC5AggregateMaximumBitRate)) && + (uEContextModificationRequest.LTEA2XUEPC5AggregateMaximumBitRate == nil) == (y.LTEA2XUEPC5AggregateMaximumBitRate == nil) && (uEContextModificationRequest.LTEA2XUEPC5AggregateMaximumBitRate == nil || (*uEContextModificationRequest.LTEA2XUEPC5AggregateMaximumBitRate).Equal(*y.LTEA2XUEPC5AggregateMaximumBitRate)) && + (uEContextModificationRequest.A2XPC5QoSParameters == nil) == (y.A2XPC5QoSParameters == nil) && (uEContextModificationRequest.A2XPC5QoSParameters == nil || (*uEContextModificationRequest.A2XPC5QoSParameters).Equal(*y.A2XPC5QoSParameters)) && + (uEContextModificationRequest.MobileIABAuthorized == nil) == (y.MobileIABAuthorized == nil) && (uEContextModificationRequest.MobileIABAuthorized == nil || (*uEContextModificationRequest.MobileIABAuthorized) == *y.MobileIABAuthorized) && + (uEContextModificationRequest.SLPositioningRangingServiceInfo == nil) == (y.SLPositioningRangingServiceInfo == nil) && (uEContextModificationRequest.SLPositioningRangingServiceInfo == nil || (*uEContextModificationRequest.SLPositioningRangingServiceInfo).Equal(*y.SLPositioningRangingServiceInfo)) && + uEContextModificationRequest.messageMeta.Equal(y.messageMeta) +} + +func (uEContextModificationResponse UEContextModificationResponse) Equal(y UEContextModificationResponse) bool { + return (uEContextModificationResponse.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (uEContextModificationResponse.AMFUENGAPID == nil || (*uEContextModificationResponse.AMFUENGAPID) == *y.AMFUENGAPID) && + (uEContextModificationResponse.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (uEContextModificationResponse.RANUENGAPID == nil || (*uEContextModificationResponse.RANUENGAPID) == *y.RANUENGAPID) && + (uEContextModificationResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (uEContextModificationResponse.UserLocationInformation == nil || (*uEContextModificationResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (uEContextModificationResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (uEContextModificationResponse.CriticalityDiagnostics == nil || (*uEContextModificationResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (uEContextModificationResponse.RRCState == nil) == (y.RRCState == nil) && (uEContextModificationResponse.RRCState == nil || (*uEContextModificationResponse.RRCState) == *y.RRCState) && + uEContextModificationResponse.messageMeta.Equal(y.messageMeta) +} + +func (uEContextReleaseCommand UEContextReleaseCommand) Equal(y UEContextReleaseCommand) bool { + return uEContextReleaseCommand.UENGAPIDs.Equal(y.UENGAPIDs) && + (uEContextReleaseCommand.Cause == nil) == (y.Cause == nil) && (uEContextReleaseCommand.Cause == nil || (*uEContextReleaseCommand.Cause).Equal(*y.Cause)) && + uEContextReleaseCommand.messageMeta.Equal(y.messageMeta) +} + +func (uEContextReleaseComplete UEContextReleaseComplete) Equal(y UEContextReleaseComplete) bool { + return (uEContextReleaseComplete.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (uEContextReleaseComplete.AMFUENGAPID == nil || (*uEContextReleaseComplete.AMFUENGAPID) == *y.AMFUENGAPID) && + (uEContextReleaseComplete.RANUENGAPID == nil) == (y.RANUENGAPID == nil) && (uEContextReleaseComplete.RANUENGAPID == nil || (*uEContextReleaseComplete.RANUENGAPID) == *y.RANUENGAPID) && + (uEContextReleaseComplete.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (uEContextReleaseComplete.UserLocationInformation == nil || (*uEContextReleaseComplete.UserLocationInformation).Equal(*y.UserLocationInformation)) && + uEContextReleaseComplete.PDUSessionResourceList.Equal(y.PDUSessionResourceList) && + (uEContextReleaseComplete.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (uEContextReleaseComplete.CriticalityDiagnostics == nil || (*uEContextReleaseComplete.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (uEContextReleaseComplete.InfoOnRecommendedCellsAndRANNodesForPaging == nil) == (y.InfoOnRecommendedCellsAndRANNodesForPaging == nil) && (uEContextReleaseComplete.InfoOnRecommendedCellsAndRANNodesForPaging == nil || (*uEContextReleaseComplete.InfoOnRecommendedCellsAndRANNodesForPaging).Equal(*y.InfoOnRecommendedCellsAndRANNodesForPaging)) && + (uEContextReleaseComplete.PagingAssisDataforCEcapabUE == nil) == (y.PagingAssisDataforCEcapabUE == nil) && (uEContextReleaseComplete.PagingAssisDataforCEcapabUE == nil || (*uEContextReleaseComplete.PagingAssisDataforCEcapabUE).Equal(*y.PagingAssisDataforCEcapabUE)) && + uEContextReleaseComplete.messageMeta.Equal(y.messageMeta) +} + +func (uEContextReleaseRequest UEContextReleaseRequest) Equal(y UEContextReleaseRequest) bool { + return uEContextReleaseRequest.AMFUENGAPID == y.AMFUENGAPID && + uEContextReleaseRequest.RANUENGAPID == y.RANUENGAPID && + uEContextReleaseRequest.PDUSessionResourceList.Equal(y.PDUSessionResourceList) && + (uEContextReleaseRequest.Cause == nil) == (y.Cause == nil) && (uEContextReleaseRequest.Cause == nil || (*uEContextReleaseRequest.Cause).Equal(*y.Cause)) && + (uEContextReleaseRequest.GWContextReleaseIndication == nil) == (y.GWContextReleaseIndication == nil) && (uEContextReleaseRequest.GWContextReleaseIndication == nil || (*uEContextReleaseRequest.GWContextReleaseIndication) == *y.GWContextReleaseIndication) && + uEContextReleaseRequest.messageMeta.Equal(y.messageMeta) +} + +func (uEDifferentiationInfo UEDifferentiationInfo) Equal(y UEDifferentiationInfo) bool { + return (uEDifferentiationInfo.PeriodicCommunicationIndicator == nil) == (y.PeriodicCommunicationIndicator == nil) && (uEDifferentiationInfo.PeriodicCommunicationIndicator == nil || (*uEDifferentiationInfo.PeriodicCommunicationIndicator) == *y.PeriodicCommunicationIndicator) && + (uEDifferentiationInfo.PeriodicTime == nil) == (y.PeriodicTime == nil) && (uEDifferentiationInfo.PeriodicTime == nil || (*uEDifferentiationInfo.PeriodicTime) == *y.PeriodicTime) && + (uEDifferentiationInfo.ScheduledCommunicationTime == nil) == (y.ScheduledCommunicationTime == nil) && (uEDifferentiationInfo.ScheduledCommunicationTime == nil || (*uEDifferentiationInfo.ScheduledCommunicationTime).Equal(*y.ScheduledCommunicationTime)) && + (uEDifferentiationInfo.StationaryIndication == nil) == (y.StationaryIndication == nil) && (uEDifferentiationInfo.StationaryIndication == nil || (*uEDifferentiationInfo.StationaryIndication) == *y.StationaryIndication) && + (uEDifferentiationInfo.TrafficProfile == nil) == (y.TrafficProfile == nil) && (uEDifferentiationInfo.TrafficProfile == nil || (*uEDifferentiationInfo.TrafficProfile) == *y.TrafficProfile) && + (uEDifferentiationInfo.BatteryIndication == nil) == (y.BatteryIndication == nil) && (uEDifferentiationInfo.BatteryIndication == nil || (*uEDifferentiationInfo.BatteryIndication) == *y.BatteryIndication) && + uEDifferentiationInfo.iEExtensions == y.iEExtensions && + uEDifferentiationInfo.extensions == y.extensions +} + +func (uEHistoryInformation UEHistoryInformation) Equal(y UEHistoryInformation) bool { + if len(uEHistoryInformation) != len(y) { + return false + } + for i := range uEHistoryInformation { + if !(uEHistoryInformation[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uEHistoryInformationFromTheUE UEHistoryInformationFromTheUE) Equal(y UEHistoryInformationFromTheUE) bool { + return (uEHistoryInformationFromTheUE.NR == nil) == (y.NR == nil) && (uEHistoryInformationFromTheUE.NR == nil || (*uEHistoryInformationFromTheUE.NR).Equal(*y.NR)) && + (uEHistoryInformationFromTheUE.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (uEHistoryInformationFromTheUE.ChoiceExtension == nil || (*uEHistoryInformationFromTheUE.ChoiceExtension) == *y.ChoiceExtension) +} + +func (uEIdentityIndexValue UEIdentityIndexValue) Equal(y UEIdentityIndexValue) bool { + return (uEIdentityIndexValue.IndexLength10 == nil) == (y.IndexLength10 == nil) && (uEIdentityIndexValue.IndexLength10 == nil || (*uEIdentityIndexValue.IndexLength10) == *y.IndexLength10) && + (uEIdentityIndexValue.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (uEIdentityIndexValue.ChoiceExtension == nil || (*uEIdentityIndexValue.ChoiceExtension) == *y.ChoiceExtension) +} + +func (uENGAPIDPair UENGAPIDPair) Equal(y UENGAPIDPair) bool { + return uENGAPIDPair == y +} + +func (uENGAPIDs UENGAPIDs) Equal(y UENGAPIDs) bool { + return (uENGAPIDs.UENGAPIDPair == nil) == (y.UENGAPIDPair == nil) && (uENGAPIDs.UENGAPIDPair == nil || (*uENGAPIDs.UENGAPIDPair).Equal(*y.UENGAPIDPair)) && + (uENGAPIDs.AMFUENGAPID == nil) == (y.AMFUENGAPID == nil) && (uENGAPIDs.AMFUENGAPID == nil || (*uENGAPIDs.AMFUENGAPID) == *y.AMFUENGAPID) && + (uENGAPIDs.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (uENGAPIDs.ChoiceExtension == nil || (*uENGAPIDs.ChoiceExtension) == *y.ChoiceExtension) +} + +func (uEPagingIdentity UEPagingIdentity) Equal(y UEPagingIdentity) bool { + return (uEPagingIdentity.FiveGSTMSI == nil) == (y.FiveGSTMSI == nil) && (uEPagingIdentity.FiveGSTMSI == nil || (*uEPagingIdentity.FiveGSTMSI).Equal(*y.FiveGSTMSI)) && + (uEPagingIdentity.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (uEPagingIdentity.ChoiceExtension == nil || (*uEPagingIdentity.ChoiceExtension) == *y.ChoiceExtension) +} + +func (uEPresenceInAreaOfInterestItem UEPresenceInAreaOfInterestItem) Equal(y UEPresenceInAreaOfInterestItem) bool { + return uEPresenceInAreaOfInterestItem == y +} + +func (uEPresenceInAreaOfInterestList UEPresenceInAreaOfInterestList) Equal(y UEPresenceInAreaOfInterestList) bool { + if len(uEPresenceInAreaOfInterestList) != len(y) { + return false + } + for i := range uEPresenceInAreaOfInterestList { + if !(uEPresenceInAreaOfInterestList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uERLFReportContainer UERLFReportContainer) Equal(y UERLFReportContainer) bool { + return (uERLFReportContainer.NR == nil) == (y.NR == nil) && (uERLFReportContainer.NR == nil || (*uERLFReportContainer.NR).Equal(*y.NR)) && + (uERLFReportContainer.LTE == nil) == (y.LTE == nil) && (uERLFReportContainer.LTE == nil || (*uERLFReportContainer.LTE).Equal(*y.LTE)) && + (uERLFReportContainer.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (uERLFReportContainer.ChoiceExtension == nil || (*uERLFReportContainer.ChoiceExtension) == *y.ChoiceExtension) +} + +func (uERadioCapability UERadioCapability) Equal(y UERadioCapability) bool { + if len(uERadioCapability) != len(y) { + return false + } + for i := range uERadioCapability { + if !(uERadioCapability[i] == y[i]) { + return false + } + } + return true +} + +func (uERadioCapabilityForPaging UERadioCapabilityForPaging) Equal(y UERadioCapabilityForPaging) bool { + return uERadioCapabilityForPaging.extensions == y.extensions && + (uERadioCapabilityForPaging.NR == nil) == (y.NR == nil) && (uERadioCapabilityForPaging.NR == nil || (*uERadioCapabilityForPaging.NR).Equal(*y.NR)) && + (uERadioCapabilityForPaging.EUTRA == nil) == (y.EUTRA == nil) && (uERadioCapabilityForPaging.EUTRA == nil || (*uERadioCapabilityForPaging.EUTRA).Equal(*y.EUTRA)) && + (uERadioCapabilityForPaging.NBIoT == nil) == (y.NBIoT == nil) && (uERadioCapabilityForPaging.NBIoT == nil || (*uERadioCapabilityForPaging.NBIoT).Equal(*y.NBIoT)) && + uERadioCapabilityForPaging.iEExtensions == y.iEExtensions +} + +func (uERadioCapabilityForPagingOfEUTRA UERadioCapabilityForPagingOfEUTRA) Equal(y UERadioCapabilityForPagingOfEUTRA) bool { + if len(uERadioCapabilityForPagingOfEUTRA) != len(y) { + return false + } + for i := range uERadioCapabilityForPagingOfEUTRA { + if !(uERadioCapabilityForPagingOfEUTRA[i] == y[i]) { + return false + } + } + return true +} + +func (uERadioCapabilityForPagingOfNBIoT UERadioCapabilityForPagingOfNBIoT) Equal(y UERadioCapabilityForPagingOfNBIoT) bool { + if len(uERadioCapabilityForPagingOfNBIoT) != len(y) { + return false + } + for i := range uERadioCapabilityForPagingOfNBIoT { + if !(uERadioCapabilityForPagingOfNBIoT[i] == y[i]) { + return false + } + } + return true +} + +func (uERadioCapabilityForPagingOfNR UERadioCapabilityForPagingOfNR) Equal(y UERadioCapabilityForPagingOfNR) bool { + if len(uERadioCapabilityForPagingOfNR) != len(y) { + return false + } + for i := range uERadioCapabilityForPagingOfNR { + if !(uERadioCapabilityForPagingOfNR[i] == y[i]) { + return false + } + } + return true +} + +func (uERadioCapabilityID UERadioCapabilityID) Equal(y UERadioCapabilityID) bool { + if len(uERadioCapabilityID) != len(y) { + return false + } + for i := range uERadioCapabilityID { + if !(uERadioCapabilityID[i] == y[i]) { + return false + } + } + return true +} + +func (uERadioCapabilityInfoIndication UERadioCapabilityInfoIndication) Equal(y UERadioCapabilityInfoIndication) bool { + return uERadioCapabilityInfoIndication.AMFUENGAPID == y.AMFUENGAPID && + uERadioCapabilityInfoIndication.RANUENGAPID == y.RANUENGAPID && + uERadioCapabilityInfoIndication.UERadioCapability.Equal(y.UERadioCapability) && + (uERadioCapabilityInfoIndication.UERadioCapabilityForPaging == nil) == (y.UERadioCapabilityForPaging == nil) && (uERadioCapabilityInfoIndication.UERadioCapabilityForPaging == nil || (*uERadioCapabilityInfoIndication.UERadioCapabilityForPaging).Equal(*y.UERadioCapabilityForPaging)) && + uERadioCapabilityInfoIndication.UERadioCapabilityEUTRAFormat.Equal(y.UERadioCapabilityEUTRAFormat) && + (uERadioCapabilityInfoIndication.XrDeviceWith2Rx == nil) == (y.XrDeviceWith2Rx == nil) && (uERadioCapabilityInfoIndication.XrDeviceWith2Rx == nil || (*uERadioCapabilityInfoIndication.XrDeviceWith2Rx) == *y.XrDeviceWith2Rx) && + uERadioCapabilityInfoIndication.messageMeta.Equal(y.messageMeta) +} + +func (uESecurityCapabilities UESecurityCapabilities) Equal(y UESecurityCapabilities) bool { + return uESecurityCapabilities == y +} + +func (uESliceMaximumBitRateItem UESliceMaximumBitRateItem) Equal(y UESliceMaximumBitRateItem) bool { + return uESliceMaximumBitRateItem.SNSSAI.Equal(y.SNSSAI) && + uESliceMaximumBitRateItem.UESliceMaximumBitRateDL == y.UESliceMaximumBitRateDL && + uESliceMaximumBitRateItem.UESliceMaximumBitRateUL == y.UESliceMaximumBitRateUL && + uESliceMaximumBitRateItem.iEExtensions == y.iEExtensions && + uESliceMaximumBitRateItem.extensions == y.extensions +} + +func (uESliceMaximumBitRateList UESliceMaximumBitRateList) Equal(y UESliceMaximumBitRateList) bool { + if len(uESliceMaximumBitRateList) != len(y) { + return false + } + for i := range uESliceMaximumBitRateList { + if !(uESliceMaximumBitRateList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uETNLABindingReleaseRequest UETNLABindingReleaseRequest) Equal(y UETNLABindingReleaseRequest) bool { + return uETNLABindingReleaseRequest.AMFUENGAPID == y.AMFUENGAPID && + uETNLABindingReleaseRequest.RANUENGAPID == y.RANUENGAPID && + uETNLABindingReleaseRequest.messageMeta.Equal(y.messageMeta) +} + +func (uLNGUUPTNLModifyItem ULNGUUPTNLModifyItem) Equal(y ULNGUUPTNLModifyItem) bool { + return uLNGUUPTNLModifyItem.ULNGUUPTNLInformation.Equal(y.ULNGUUPTNLInformation) && + uLNGUUPTNLModifyItem.DLNGUUPTNLInformation.Equal(y.DLNGUUPTNLInformation) && + (uLNGUUPTNLModifyItem.RedundantULNGUUPTNLInformation == nil) == (y.RedundantULNGUUPTNLInformation == nil) && (uLNGUUPTNLModifyItem.RedundantULNGUUPTNLInformation == nil || (*uLNGUUPTNLModifyItem.RedundantULNGUUPTNLInformation).Equal(*y.RedundantULNGUUPTNLInformation)) && + (uLNGUUPTNLModifyItem.RedundantDLNGUUPTNLInformation == nil) == (y.RedundantDLNGUUPTNLInformation == nil) && (uLNGUUPTNLModifyItem.RedundantDLNGUUPTNLInformation == nil || (*uLNGUUPTNLModifyItem.RedundantDLNGUUPTNLInformation).Equal(*y.RedundantDLNGUUPTNLInformation)) && + uLNGUUPTNLModifyItem.iEExtensions == y.iEExtensions && + uLNGUUPTNLModifyItem.extensions == y.extensions +} + +func (uLNGUUPTNLModifyList ULNGUUPTNLModifyList) Equal(y ULNGUUPTNLModifyList) bool { + if len(uLNGUUPTNLModifyList) != len(y) { + return false + } + for i := range uLNGUUPTNLModifyList { + if !(uLNGUUPTNLModifyList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uPTransportLayerInformation UPTransportLayerInformation) Equal(y UPTransportLayerInformation) bool { + return (uPTransportLayerInformation.GTPTunnel == nil) == (y.GTPTunnel == nil) && (uPTransportLayerInformation.GTPTunnel == nil || (*uPTransportLayerInformation.GTPTunnel).Equal(*y.GTPTunnel)) && + (uPTransportLayerInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (uPTransportLayerInformation.ChoiceExtension == nil || (*uPTransportLayerInformation.ChoiceExtension) == *y.ChoiceExtension) +} + +func (uPTransportLayerInformationItem UPTransportLayerInformationItem) Equal(y UPTransportLayerInformationItem) bool { + return uPTransportLayerInformationItem.NGUUPTNLInformation.Equal(y.NGUUPTNLInformation) && + (uPTransportLayerInformationItem.CommonNetworkInstance == nil) == (y.CommonNetworkInstance == nil) && (uPTransportLayerInformationItem.CommonNetworkInstance == nil || (*uPTransportLayerInformationItem.CommonNetworkInstance).Equal(*y.CommonNetworkInstance)) && + uPTransportLayerInformationItem.iEExtensions == y.iEExtensions && + uPTransportLayerInformationItem.extensions == y.extensions +} + +func (uPTransportLayerInformationList UPTransportLayerInformationList) Equal(y UPTransportLayerInformationList) bool { + if len(uPTransportLayerInformationList) != len(y) { + return false + } + for i := range uPTransportLayerInformationList { + if !(uPTransportLayerInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uPTransportLayerInformationPairItem UPTransportLayerInformationPairItem) Equal(y UPTransportLayerInformationPairItem) bool { + return uPTransportLayerInformationPairItem.ULNGUUPTNLInformation.Equal(y.ULNGUUPTNLInformation) && + uPTransportLayerInformationPairItem.DLNGUUPTNLInformation.Equal(y.DLNGUUPTNLInformation) && + uPTransportLayerInformationPairItem.iEExtensions == y.iEExtensions && + uPTransportLayerInformationPairItem.extensions == y.extensions +} + +func (uPTransportLayerInformationPairList UPTransportLayerInformationPairList) Equal(y UPTransportLayerInformationPairList) bool { + if len(uPTransportLayerInformationPairList) != len(y) { + return false + } + for i := range uPTransportLayerInformationPairList { + if !(uPTransportLayerInformationPairList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (unavailableGUAMIItem UnavailableGUAMIItem) Equal(y UnavailableGUAMIItem) bool { + return unavailableGUAMIItem.GUAMI.Equal(y.GUAMI) && + (unavailableGUAMIItem.TimerApproachForGUAMIRemoval == nil) == (y.TimerApproachForGUAMIRemoval == nil) && (unavailableGUAMIItem.TimerApproachForGUAMIRemoval == nil || (*unavailableGUAMIItem.TimerApproachForGUAMIRemoval) == *y.TimerApproachForGUAMIRemoval) && + (unavailableGUAMIItem.BackupAMFName == nil) == (y.BackupAMFName == nil) && (unavailableGUAMIItem.BackupAMFName == nil || (*unavailableGUAMIItem.BackupAMFName) == *y.BackupAMFName) && + (unavailableGUAMIItem.ExtendedBackupAMFName == nil) == (y.ExtendedBackupAMFName == nil) && (unavailableGUAMIItem.ExtendedBackupAMFName == nil || (*unavailableGUAMIItem.ExtendedBackupAMFName).Equal(*y.ExtendedBackupAMFName)) && + unavailableGUAMIItem.iEExtensions == y.iEExtensions && + unavailableGUAMIItem.extensions == y.extensions +} + +func (unavailableGUAMIList UnavailableGUAMIList) Equal(y UnavailableGUAMIList) bool { + if len(unavailableGUAMIList) != len(y) { + return false + } + for i := range unavailableGUAMIList { + if !(unavailableGUAMIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (updateFeedback UpdateFeedback) Equal(y UpdateFeedback) bool { + return updateFeedback == y +} + +func (uplinkNASTransport UplinkNASTransport) Equal(y UplinkNASTransport) bool { + return uplinkNASTransport.AMFUENGAPID == y.AMFUENGAPID && + uplinkNASTransport.RANUENGAPID == y.RANUENGAPID && + uplinkNASTransport.NASPDU.Equal(y.NASPDU) && + (uplinkNASTransport.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (uplinkNASTransport.UserLocationInformation == nil || (*uplinkNASTransport.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (uplinkNASTransport.WAGFIdentityInformation == nil) == (y.WAGFIdentityInformation == nil) && (uplinkNASTransport.WAGFIdentityInformation == nil || (*uplinkNASTransport.WAGFIdentityInformation).Equal(*y.WAGFIdentityInformation)) && + (uplinkNASTransport.TNGFIdentityInformation == nil) == (y.TNGFIdentityInformation == nil) && (uplinkNASTransport.TNGFIdentityInformation == nil || (*uplinkNASTransport.TNGFIdentityInformation).Equal(*y.TNGFIdentityInformation)) && + (uplinkNASTransport.TWIFIdentityInformation == nil) == (y.TWIFIdentityInformation == nil) && (uplinkNASTransport.TWIFIdentityInformation == nil || (*uplinkNASTransport.TWIFIdentityInformation).Equal(*y.TWIFIdentityInformation)) && + uplinkNASTransport.messageMeta.Equal(y.messageMeta) +} + +func (uplinkNonUEAssociatedNRPPaTransport UplinkNonUEAssociatedNRPPaTransport) Equal(y UplinkNonUEAssociatedNRPPaTransport) bool { + return uplinkNonUEAssociatedNRPPaTransport.RoutingID.Equal(y.RoutingID) && + uplinkNonUEAssociatedNRPPaTransport.NRPPaPDU.Equal(y.NRPPaPDU) && + uplinkNonUEAssociatedNRPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (uplinkRANConfigurationTransfer UplinkRANConfigurationTransfer) Equal(y UplinkRANConfigurationTransfer) bool { + return uplinkRANConfigurationTransfer.SONConfigurationTransfer.Equal(y.SONConfigurationTransfer) && + (uplinkRANConfigurationTransfer.ENDCSONConfigurationTransferUL == nil) == (y.ENDCSONConfigurationTransferUL == nil) && (uplinkRANConfigurationTransfer.ENDCSONConfigurationTransferUL == nil || (*uplinkRANConfigurationTransfer.ENDCSONConfigurationTransferUL).Equal(*y.ENDCSONConfigurationTransferUL)) && + (uplinkRANConfigurationTransfer.IntersystemSONConfigurationTransferUL == nil) == (y.IntersystemSONConfigurationTransferUL == nil) && (uplinkRANConfigurationTransfer.IntersystemSONConfigurationTransferUL == nil || (*uplinkRANConfigurationTransfer.IntersystemSONConfigurationTransferUL).Equal(*y.IntersystemSONConfigurationTransferUL)) && + uplinkRANConfigurationTransfer.messageMeta.Equal(y.messageMeta) +} + +func (uplinkRANStatusTransfer UplinkRANStatusTransfer) Equal(y UplinkRANStatusTransfer) bool { + return uplinkRANStatusTransfer.AMFUENGAPID == y.AMFUENGAPID && + uplinkRANStatusTransfer.RANUENGAPID == y.RANUENGAPID && + uplinkRANStatusTransfer.Container.Equal(y.Container) && + uplinkRANStatusTransfer.messageMeta.Equal(y.messageMeta) +} + +func (uplinkUEAssociatedNRPPaTransport UplinkUEAssociatedNRPPaTransport) Equal(y UplinkUEAssociatedNRPPaTransport) bool { + return uplinkUEAssociatedNRPPaTransport.AMFUENGAPID == y.AMFUENGAPID && + uplinkUEAssociatedNRPPaTransport.RANUENGAPID == y.RANUENGAPID && + uplinkUEAssociatedNRPPaTransport.RoutingID.Equal(y.RoutingID) && + uplinkUEAssociatedNRPPaTransport.NRPPaPDU.Equal(y.NRPPaPDU) && + uplinkUEAssociatedNRPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (userLocationInformation UserLocationInformation) Equal(y UserLocationInformation) bool { + return (userLocationInformation.EUTRA == nil) == (y.EUTRA == nil) && (userLocationInformation.EUTRA == nil || (*userLocationInformation.EUTRA).Equal(*y.EUTRA)) && + (userLocationInformation.NR == nil) == (y.NR == nil) && (userLocationInformation.NR == nil || (*userLocationInformation.NR).Equal(*y.NR)) && + (userLocationInformation.N3IWF == nil) == (y.N3IWF == nil) && (userLocationInformation.N3IWF == nil || (*userLocationInformation.N3IWF).Equal(*y.N3IWF)) && + (userLocationInformation.TNGF == nil) == (y.TNGF == nil) && (userLocationInformation.TNGF == nil || (*userLocationInformation.TNGF).Equal(*y.TNGF)) && + (userLocationInformation.TWIF == nil) == (y.TWIF == nil) && (userLocationInformation.TWIF == nil || (*userLocationInformation.TWIF).Equal(*y.TWIF)) && + (userLocationInformation.WAGF == nil) == (y.WAGF == nil) && (userLocationInformation.WAGF == nil || (*userLocationInformation.WAGF).Equal(*y.WAGF)) && + (userLocationInformation.N3IWFWithoutPortNumber == nil) == (y.N3IWFWithoutPortNumber == nil) && (userLocationInformation.N3IWFWithoutPortNumber == nil || (*userLocationInformation.N3IWFWithoutPortNumber).Equal(*y.N3IWFWithoutPortNumber)) && + (userLocationInformation.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (userLocationInformation.ChoiceExtension == nil || (*userLocationInformation.ChoiceExtension) == *y.ChoiceExtension) && + userLocationInformation.choiceCriticality == y.choiceCriticality +} + +func (userLocationInformationEUTRA UserLocationInformationEUTRA) Equal(y UserLocationInformationEUTRA) bool { + return userLocationInformationEUTRA.EUTRACGI.Equal(y.EUTRACGI) && + userLocationInformationEUTRA.TAI.Equal(y.TAI) && + (userLocationInformationEUTRA.TimeStamp == nil) == (y.TimeStamp == nil) && (userLocationInformationEUTRA.TimeStamp == nil || (*userLocationInformationEUTRA.TimeStamp) == *y.TimeStamp) && + (userLocationInformationEUTRA.PSCellInformation == nil) == (y.PSCellInformation == nil) && (userLocationInformationEUTRA.PSCellInformation == nil || (*userLocationInformationEUTRA.PSCellInformation).Equal(*y.PSCellInformation)) && + userLocationInformationEUTRA.iEExtensions == y.iEExtensions && + userLocationInformationEUTRA.extensions == y.extensions +} + +func (userLocationInformationN3IWFWithPortNumber UserLocationInformationN3IWFWithPortNumber) Equal(y UserLocationInformationN3IWFWithPortNumber) bool { + return userLocationInformationN3IWFWithPortNumber.IPAddress == y.IPAddress && + userLocationInformationN3IWFWithPortNumber.PortNumber == y.PortNumber && + (userLocationInformationN3IWFWithPortNumber.TAI == nil) == (y.TAI == nil) && (userLocationInformationN3IWFWithPortNumber.TAI == nil || (*userLocationInformationN3IWFWithPortNumber.TAI).Equal(*y.TAI)) && + userLocationInformationN3IWFWithPortNumber.iEExtensions == y.iEExtensions && + userLocationInformationN3IWFWithPortNumber.extensions == y.extensions +} + +func (userLocationInformationN3IWFWithoutPortNumber UserLocationInformationN3IWFWithoutPortNumber) Equal(y UserLocationInformationN3IWFWithoutPortNumber) bool { + return userLocationInformationN3IWFWithoutPortNumber.IPAddress == y.IPAddress && + (userLocationInformationN3IWFWithoutPortNumber.TAI == nil) == (y.TAI == nil) && (userLocationInformationN3IWFWithoutPortNumber.TAI == nil || (*userLocationInformationN3IWFWithoutPortNumber.TAI).Equal(*y.TAI)) && + userLocationInformationN3IWFWithoutPortNumber.iEExtensions == y.iEExtensions && + userLocationInformationN3IWFWithoutPortNumber.extensions == y.extensions +} + +func (userLocationInformationNR UserLocationInformationNR) Equal(y UserLocationInformationNR) bool { + return userLocationInformationNR.NRCGI.Equal(y.NRCGI) && + userLocationInformationNR.TAI.Equal(y.TAI) && + (userLocationInformationNR.TimeStamp == nil) == (y.TimeStamp == nil) && (userLocationInformationNR.TimeStamp == nil || (*userLocationInformationNR.TimeStamp) == *y.TimeStamp) && + (userLocationInformationNR.PSCellInformation == nil) == (y.PSCellInformation == nil) && (userLocationInformationNR.PSCellInformation == nil || (*userLocationInformationNR.PSCellInformation).Equal(*y.PSCellInformation)) && + (userLocationInformationNR.NID == nil) == (y.NID == nil) && (userLocationInformationNR.NID == nil || (*userLocationInformationNR.NID) == *y.NID) && + (userLocationInformationNR.NRNTNTAIInformation == nil) == (y.NRNTNTAIInformation == nil) && (userLocationInformationNR.NRNTNTAIInformation == nil || (*userLocationInformationNR.NRNTNTAIInformation).Equal(*y.NRNTNTAIInformation)) && + (userLocationInformationNR.MobileIABMTUserLocationInformation == nil) == (y.MobileIABMTUserLocationInformation == nil) && (userLocationInformationNR.MobileIABMTUserLocationInformation == nil || (*userLocationInformationNR.MobileIABMTUserLocationInformation).Equal(*y.MobileIABMTUserLocationInformation)) && + (userLocationInformationNR.AdditionalULI == nil) == (y.AdditionalULI == nil) && (userLocationInformationNR.AdditionalULI == nil || (*userLocationInformationNR.AdditionalULI).Equal(*y.AdditionalULI)) && + (userLocationInformationNR.AerialUEFlightInformationReporting == nil) == (y.AerialUEFlightInformationReporting == nil) && (userLocationInformationNR.AerialUEFlightInformationReporting == nil || (*userLocationInformationNR.AerialUEFlightInformationReporting).Equal(*y.AerialUEFlightInformationReporting)) && + userLocationInformationNR.iEExtensions == y.iEExtensions && + userLocationInformationNR.extensions == y.extensions +} + +func (userLocationInformationTNGF UserLocationInformationTNGF) Equal(y UserLocationInformationTNGF) bool { + return userLocationInformationTNGF.TNAPID.Equal(y.TNAPID) && + userLocationInformationTNGF.IPAddress == y.IPAddress && + (userLocationInformationTNGF.PortNumber == nil) == (y.PortNumber == nil) && (userLocationInformationTNGF.PortNumber == nil || (*userLocationInformationTNGF.PortNumber) == *y.PortNumber) && + (userLocationInformationTNGF.TAI == nil) == (y.TAI == nil) && (userLocationInformationTNGF.TAI == nil || (*userLocationInformationTNGF.TAI).Equal(*y.TAI)) && + userLocationInformationTNGF.iEExtensions == y.iEExtensions && + userLocationInformationTNGF.extensions == y.extensions +} + +func (userLocationInformationTWIF UserLocationInformationTWIF) Equal(y UserLocationInformationTWIF) bool { + return userLocationInformationTWIF.TWAPID.Equal(y.TWAPID) && + userLocationInformationTWIF.IPAddress == y.IPAddress && + (userLocationInformationTWIF.PortNumber == nil) == (y.PortNumber == nil) && (userLocationInformationTWIF.PortNumber == nil || (*userLocationInformationTWIF.PortNumber) == *y.PortNumber) && + (userLocationInformationTWIF.TAI == nil) == (y.TAI == nil) && (userLocationInformationTWIF.TAI == nil || (*userLocationInformationTWIF.TAI).Equal(*y.TAI)) && + userLocationInformationTWIF.iEExtensions == y.iEExtensions && + userLocationInformationTWIF.extensions == y.extensions +} + +func (userLocationInformationWAGF UserLocationInformationWAGF) Equal(y UserLocationInformationWAGF) bool { + return (userLocationInformationWAGF.GlobalLineID == nil) == (y.GlobalLineID == nil) && (userLocationInformationWAGF.GlobalLineID == nil || (*userLocationInformationWAGF.GlobalLineID).Equal(*y.GlobalLineID)) && + (userLocationInformationWAGF.HFCNodeID == nil) == (y.HFCNodeID == nil) && (userLocationInformationWAGF.HFCNodeID == nil || (*userLocationInformationWAGF.HFCNodeID).Equal(*y.HFCNodeID)) && + (userLocationInformationWAGF.GlobalCableID == nil) == (y.GlobalCableID == nil) && (userLocationInformationWAGF.GlobalCableID == nil || (*userLocationInformationWAGF.GlobalCableID).Equal(*y.GlobalCableID)) && + (userLocationInformationWAGF.HFCNodeIDNew == nil) == (y.HFCNodeIDNew == nil) && (userLocationInformationWAGF.HFCNodeIDNew == nil || (*userLocationInformationWAGF.HFCNodeIDNew).Equal(*y.HFCNodeIDNew)) && + (userLocationInformationWAGF.GlobalCableIDNew == nil) == (y.GlobalCableIDNew == nil) && (userLocationInformationWAGF.GlobalCableIDNew == nil || (*userLocationInformationWAGF.GlobalCableIDNew).Equal(*y.GlobalCableIDNew)) && + (userLocationInformationWAGF.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (userLocationInformationWAGF.ChoiceExtension == nil || (*userLocationInformationWAGF.ChoiceExtension) == *y.ChoiceExtension) && + userLocationInformationWAGF.choiceCriticality == y.choiceCriticality +} + +func (userPlaneFailureIndication UserPlaneFailureIndication) Equal(y UserPlaneFailureIndication) bool { + return userPlaneFailureIndication.UserPlaneFailureType == y.UserPlaneFailureType && + userPlaneFailureIndication.ULNGUUPTNLInformation.Equal(y.ULNGUUPTNLInformation) && + userPlaneFailureIndication.DLNGUUPTNLInformation.Equal(y.DLNGUUPTNLInformation) && + userPlaneFailureIndication.iEExtensions == y.iEExtensions && + userPlaneFailureIndication.extensions == y.extensions +} + +func (userPlaneSecurityInformation UserPlaneSecurityInformation) Equal(y UserPlaneSecurityInformation) bool { + return userPlaneSecurityInformation.SecurityResult.Equal(y.SecurityResult) && + userPlaneSecurityInformation.SecurityIndication.Equal(y.SecurityIndication) && + userPlaneSecurityInformation.iEExtensions == y.iEExtensions && + userPlaneSecurityInformation.extensions == y.extensions +} + +func (volumeTimedReportItem VolumeTimedReportItem) Equal(y VolumeTimedReportItem) bool { + return volumeTimedReportItem.StartTimeStamp.Equal(y.StartTimeStamp) && + volumeTimedReportItem.EndTimeStamp.Equal(y.EndTimeStamp) && + volumeTimedReportItem.UsageCountUL == y.UsageCountUL && + volumeTimedReportItem.UsageCountDL == y.UsageCountDL && + volumeTimedReportItem.iEExtensions == y.iEExtensions && + volumeTimedReportItem.extensions == y.extensions +} + +func (volumeTimedReportItemEndTimeStamp VolumeTimedReportItemEndTimeStamp) Equal(y VolumeTimedReportItemEndTimeStamp) bool { + if len(volumeTimedReportItemEndTimeStamp) != len(y) { + return false + } + for i := range volumeTimedReportItemEndTimeStamp { + if !(volumeTimedReportItemEndTimeStamp[i] == y[i]) { + return false + } + } + return true +} + +func (volumeTimedReportItemStartTimeStamp VolumeTimedReportItemStartTimeStamp) Equal(y VolumeTimedReportItemStartTimeStamp) bool { + if len(volumeTimedReportItemStartTimeStamp) != len(y) { + return false + } + for i := range volumeTimedReportItemStartTimeStamp { + if !(volumeTimedReportItemStartTimeStamp[i] == y[i]) { + return false + } + } + return true +} + +func (volumeTimedReportList VolumeTimedReportList) Equal(y VolumeTimedReportList) bool { + if len(volumeTimedReportList) != len(y) { + return false + } + for i := range volumeTimedReportList { + if !(volumeTimedReportList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (wAGFID WAGFID) Equal(y WAGFID) bool { + return (wAGFID.WAGFID == nil) == (y.WAGFID == nil) && (wAGFID.WAGFID == nil || (*wAGFID.WAGFID).Equal(*y.WAGFID)) && + (wAGFID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (wAGFID.ChoiceExtension == nil || (*wAGFID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (wAGFIDValue WAGFIDValue) Equal(y WAGFIDValue) bool { + return wAGFIDValue == y +} + +func (wLANMeasConfigNameItem WLANMeasConfigNameItem) Equal(y WLANMeasConfigNameItem) bool { + return wLANMeasConfigNameItem.WLANName.Equal(y.WLANName) && + wLANMeasConfigNameItem.iEExtensions == y.iEExtensions && + wLANMeasConfigNameItem.extensions == y.extensions +} + +func (wLANMeasConfigNameList WLANMeasConfigNameList) Equal(y WLANMeasConfigNameList) bool { + if len(wLANMeasConfigNameList) != len(y) { + return false + } + for i := range wLANMeasConfigNameList { + if !(wLANMeasConfigNameList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (wLANMeasurementConfiguration WLANMeasurementConfiguration) Equal(y WLANMeasurementConfiguration) bool { + return wLANMeasurementConfiguration.WlanMeasConfig == y.WlanMeasConfig && + (wLANMeasurementConfiguration.WlanMeasConfigNameList == nil) == (y.WlanMeasConfigNameList == nil) && wLANMeasurementConfiguration.WlanMeasConfigNameList.Equal(y.WlanMeasConfigNameList) && + (wLANMeasurementConfiguration.Wlanrssi == nil) == (y.Wlanrssi == nil) && (wLANMeasurementConfiguration.Wlanrssi == nil || (*wLANMeasurementConfiguration.Wlanrssi) == *y.Wlanrssi) && + (wLANMeasurementConfiguration.Wlanrtt == nil) == (y.Wlanrtt == nil) && (wLANMeasurementConfiguration.Wlanrtt == nil || (*wLANMeasurementConfiguration.Wlanrtt) == *y.Wlanrtt) && + wLANMeasurementConfiguration.iEExtensions == y.iEExtensions && + wLANMeasurementConfiguration.extensions == y.extensions +} + +func (wLANName WLANName) Equal(y WLANName) bool { + if len(wLANName) != len(y) { + return false + } + for i := range wLANName { + if !(wLANName[i] == y[i]) { + return false + } + } + return true +} + +func (wUSAssistanceInformation WUSAssistanceInformation) Equal(y WUSAssistanceInformation) bool { + return wUSAssistanceInformation == y +} + +func (warningAreaCoordinates WarningAreaCoordinates) Equal(y WarningAreaCoordinates) bool { + if len(warningAreaCoordinates) != len(y) { + return false + } + for i := range warningAreaCoordinates { + if !(warningAreaCoordinates[i] == y[i]) { + return false + } + } + return true +} + +func (warningAreaList WarningAreaList) Equal(y WarningAreaList) bool { + return (warningAreaList.EUTRACGIListForWarning == nil) == (y.EUTRACGIListForWarning == nil) && (warningAreaList.EUTRACGIListForWarning == nil || (*warningAreaList.EUTRACGIListForWarning).Equal(*y.EUTRACGIListForWarning)) && + (warningAreaList.NRCGIListForWarning == nil) == (y.NRCGIListForWarning == nil) && (warningAreaList.NRCGIListForWarning == nil || (*warningAreaList.NRCGIListForWarning).Equal(*y.NRCGIListForWarning)) && + (warningAreaList.TAIListForWarning == nil) == (y.TAIListForWarning == nil) && (warningAreaList.TAIListForWarning == nil || (*warningAreaList.TAIListForWarning).Equal(*y.TAIListForWarning)) && + (warningAreaList.EmergencyAreaIDList == nil) == (y.EmergencyAreaIDList == nil) && (warningAreaList.EmergencyAreaIDList == nil || (*warningAreaList.EmergencyAreaIDList).Equal(*y.EmergencyAreaIDList)) && + (warningAreaList.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (warningAreaList.ChoiceExtension == nil || (*warningAreaList.ChoiceExtension) == *y.ChoiceExtension) +} + +func (warningMessageContents WarningMessageContents) Equal(y WarningMessageContents) bool { + if len(warningMessageContents) != len(y) { + return false + } + for i := range warningMessageContents { + if !(warningMessageContents[i] == y[i]) { + return false + } + } + return true +} + +func (writeReplaceWarningRequest WriteReplaceWarningRequest) Equal(y WriteReplaceWarningRequest) bool { + return writeReplaceWarningRequest.MessageIdentifier == y.MessageIdentifier && + writeReplaceWarningRequest.SerialNumber == y.SerialNumber && + (writeReplaceWarningRequest.WarningAreaList == nil) == (y.WarningAreaList == nil) && (writeReplaceWarningRequest.WarningAreaList == nil || (*writeReplaceWarningRequest.WarningAreaList).Equal(*y.WarningAreaList)) && + writeReplaceWarningRequest.RepetitionPeriod == y.RepetitionPeriod && + writeReplaceWarningRequest.NumberOfBroadcastsRequested == y.NumberOfBroadcastsRequested && + (writeReplaceWarningRequest.WarningType == nil) == (y.WarningType == nil) && (writeReplaceWarningRequest.WarningType == nil || (*writeReplaceWarningRequest.WarningType) == *y.WarningType) && + (writeReplaceWarningRequest.WarningSecurityInfo == nil) == (y.WarningSecurityInfo == nil) && (writeReplaceWarningRequest.WarningSecurityInfo == nil || (*writeReplaceWarningRequest.WarningSecurityInfo) == *y.WarningSecurityInfo) && + (writeReplaceWarningRequest.DataCodingScheme == nil) == (y.DataCodingScheme == nil) && (writeReplaceWarningRequest.DataCodingScheme == nil || (*writeReplaceWarningRequest.DataCodingScheme) == *y.DataCodingScheme) && + writeReplaceWarningRequest.WarningMessageContents.Equal(y.WarningMessageContents) && + (writeReplaceWarningRequest.ConcurrentWarningMessageInd == nil) == (y.ConcurrentWarningMessageInd == nil) && (writeReplaceWarningRequest.ConcurrentWarningMessageInd == nil || (*writeReplaceWarningRequest.ConcurrentWarningMessageInd) == *y.ConcurrentWarningMessageInd) && + writeReplaceWarningRequest.WarningAreaCoordinates.Equal(y.WarningAreaCoordinates) && + writeReplaceWarningRequest.messageMeta.Equal(y.messageMeta) +} + +func (writeReplaceWarningResponse WriteReplaceWarningResponse) Equal(y WriteReplaceWarningResponse) bool { + return writeReplaceWarningResponse.MessageIdentifier == y.MessageIdentifier && + writeReplaceWarningResponse.SerialNumber == y.SerialNumber && + (writeReplaceWarningResponse.BroadcastCompletedAreaList == nil) == (y.BroadcastCompletedAreaList == nil) && (writeReplaceWarningResponse.BroadcastCompletedAreaList == nil || (*writeReplaceWarningResponse.BroadcastCompletedAreaList).Equal(*y.BroadcastCompletedAreaList)) && + (writeReplaceWarningResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (writeReplaceWarningResponse.CriticalityDiagnostics == nil || (*writeReplaceWarningResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + writeReplaceWarningResponse.messageMeta.Equal(y.messageMeta) +} + +func (x messageMeta) Equal(y messageMeta) bool { + return x.Message.Equal(y.Message) +} diff --git a/ngap/per_gen_test.go b/ngap/per_gen_test.go new file mode 100644 index 0000000000..df3e4c986b --- /dev/null +++ b/ngap/per_gen_test.go @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "os" + "slices" + "testing" + + "github.com/ellanetworks/core/per/pergen" +) + +var pergenConfig = pergen.Config{Dir: ".", Output: "per_gen.go", Profile: "profile", IEID: "ProtocolIEID"} + +func TestGeneratedCodecsAreUpToDate(t *testing.T) { + want, err := pergen.Generate(t.Context(), pergenConfig) + if err != nil { + t.Fatal(err) + } + + got, err := os.ReadFile("per_gen.go") + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(got, want) { + t.Fatal("per_gen.go is stale: run go generate") + } +} + +var undiagnosedHandWrittenTypes = []string{"AbstractSyntaxError"} + +func TestEveryTypeHoldingDiagnosableStateIsDiagnosed(t *testing.T) { + got, err := pergen.Undiagnosed(t.Context(), pergenConfig) + if err != nil { + t.Fatal(err) + } + + if !slices.Equal(got, undiagnosedHandWrittenTypes) { + t.Fatalf("types that hold diagnosable state without a Diagnose method:\n got %q\nwant %q", got, undiagnosedHandWrittenTypes) + } +} diff --git a/ngap/per_leaf.go b/ngap/per_leaf.go index 1a094bdd8d..9536706e11 100644 --- a/ngap/per_leaf.go +++ b/ngap/per_leaf.go @@ -3,9 +3,7 @@ package ngap -// pergen loads this package through the root module, which therefore requires -// and replaces it. -//go:generate sh -c "cd .. && go run ./cmd/pergen -o ngap/per_gen.go github.com/ellanetworks/core/ngap" +//go:generate go run github.com/ellanetworks/core/per/cmd/pergen -profile profile -ieid ProtocolIEID import ( "encoding/binary" @@ -70,71 +68,127 @@ func (t *EPSTAC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -// NgENB-ID ::= CHOICE { macroNgENB-ID, shortMacroNgENB-ID, longMacroNgENB-ID, -// choice-Extensions }: three fixed-width bit strings and an open container. -func (n NgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - bits, ok := ngENBIDBits[n.Kind] - if !ok { - return fmt.Errorf("ngap: invalid NgENB-ID kind %d", n.Kind) +func (v GNBIDValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + if v.Bits < gnbIDMinBits || v.Bits > gnbIDMaxBits { + return fmt.Errorf("ngap: gNB-ID of %d bits outside SIZE(%d..%d)", v.Bits, gnbIDMinBits, gnbIDMaxBits) } - if uint64(n.Value) >= 1<= 1<> 8), byte(u.PortNumber)}) - } - - shape, ok := userLocationCellIDBits[u.Kind] - if !ok { - return fmt.Errorf("ngap: invalid UserLocationInformation kind %d", u.Kind) - } - - if shape.bits < 64 && u.CellIdentity >= 1<, tAI, timeStamp OPTIONAL, - // iE-Extensions OPTIONAL, ... }: extension bit, then a presence bit each for - // timeStamp and iE-Extensions. - w.WriteBit(false) - w.WriteBit(u.TimeStamp != nil) - w.WriteBit(false) - - // Xxx-CGI ::= SEQUENCE { pLMNIdentity, , iE-Extensions - // OPTIONAL, ... }: its own extension bit and presence bit. - w.WriteBit(false) - w.WriteBit(false) - - if err := u.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - - if err := encodeBitStringUint(w, enc, u.CellIdentity, shape.bits); err != nil { - return err - } - - if err := u.TAI.MarshalPER(w, enc); err != nil { - return err - } - - if u.TimeStamp != nil { - return per.EncodeOctetString(w, enc, 4, 4, true, true, false, u.TimeStamp[:]) - } - - return nil -} - -func (u *UserLocationInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - alt, err := per.DecodeConstrainedWholeNumber(r, enc, 0, userLocationInformationAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: UserLocationInformation choice: %w", err) - } - - var kind UserLocationInformationKind - - switch alt { - case userLocationInformationEUTRA: - kind = UserLocationEUTRA - case userLocationInformationNR: - kind = UserLocationNR - case userLocationInformationN3IWF: - return u.unmarshalN3IWF(r, enc) - case userLocationInformationChoiceExtensions: - return decodeChoiceExtension(r, enc, "UserLocationInformation") - default: - // Leave the value untouched: a zero location must not read as one the - // peer reported. - return fmt.Errorf("%w: UserLocationInformation alternative %d", errNotComprehended, alt) - } - - bits := userLocationCellIDBits[kind].bits - - extBit, err := r.ReadBit() - if err != nil { - return err - } - - hasTimeStamp, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - cgiExtBit, err := r.ReadBit() - if err != nil { - return err - } - - cgiExtContainer, err := r.ReadBit() - if err != nil { - return err - } - - var out UserLocationInformation - - out.Kind = kind - - if err := out.PLMNIdentity.UnmarshalPER(r, enc); err != nil { - return err - } - - if out.CellIdentity, err = decodeBitStringUint(r, enc, bits); err != nil { - return err - } - - if err := skipSequenceExtensionsPER(r, enc, cgiExtContainer, cgiExtBit); err != nil { - return err - } - - if err := out.TAI.UnmarshalPER(r, enc); err != nil { - return err - } - - if hasTimeStamp { - b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) - if err != nil { - return err - } - - var ts TimeStamp - - copy(ts[:], b) - - out.TimeStamp = &ts - } - - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err - } - - *u = out - - return nil -} - -func (u *UserLocationInformation) unmarshalN3IWF(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - var out UserLocationInformation - - out.Kind = UserLocationN3IWF - - if err := out.IPAddress.UnmarshalPER(r, enc); err != nil { - return err - } - - port, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) - if err != nil { - return err - } - - out.PortNumber = PortNumber(uint16(port[0])<<8 | uint16(port[1])) - - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err - } - - *u = out - - return nil -} - -func (g GlobalRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - shape, ok := ranNodeIDShapes[g.Kind] - if !ok { - return fmt.Errorf("ngap: invalid GlobalRANNodeID kind %d", g.Kind) - } - - if g.Bits < shape.lb || g.Bits > shape.ub { - return fmt.Errorf("ngap: GlobalRANNodeID kind %d: %d bits outside SIZE(%d..%d)", - g.Kind, g.Bits, shape.lb, shape.ub) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, globalRANNodeIDAlternatives-1, int64(shape.outer)); err != nil { - return err - } - - // Global*-ID ::= SEQUENCE { pLMNIdentity, , iE-Extensions - // OPTIONAL, ... }: extension bit, then the OPTIONAL field's presence bit. - w.WriteBit(false) - w.WriteBit(false) - - if err := g.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, int64(nodeIDAlternatives[shape.outer]-1), int64(shape.inner)); err != nil { - return err - } - - return per.EncodeBitString(w, enc, int64(shape.lb), int64(shape.ub), true, true, false, - uintToBits(uint64(g.Value), g.Bits), g.Bits) -} - -func (g *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - outer, err := per.DecodeConstrainedWholeNumber(r, enc, 0, globalRANNodeIDAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: GlobalRANNodeID choice: %w", err) - } - - if outer == globalRANNodeIDChoiceExtensions { - return decodeChoiceExtension(r, enc, "GlobalRANNodeID") - } - - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - var plmn PLMNIdentity - if err := plmn.UnmarshalPER(r, enc); err != nil { - return err - } - - alternatives := nodeIDAlternatives[int(outer)] - - inner, err := per.DecodeConstrainedWholeNumber(r, enc, 0, int64(alternatives-1)) - if err != nil { - return fmt.Errorf("ngap: %s choice: %w", nodeIDChoiceName[int(outer)], err) - } - - // The last alternative of each nested CHOICE is its choice-Extensions. - if int(inner) == alternatives-1 { - return decodeChoiceExtension(r, enc, nodeIDChoiceName[int(outer)]) - } - - kind, ok := kindForShape[[2]int{int(outer), int(inner)}] - if !ok { - return fmt.Errorf("ngap: unreachable GlobalRANNodeID alternative %d/%d", outer, inner) - } - - shape := ranNodeIDShapes[kind] - - b, nbits, err := per.DecodeBitString(r, enc, int64(shape.lb), int64(shape.ub), true, true, false) - if err != nil { - return err - } - - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err - } - - *g = GlobalRANNodeID{ - Kind: kind, - PLMNIdentity: plmn, - Value: uint32(bitsToUint(b, nbits)), - Bits: nbits, - } - - return nil -} - -func (u UERetentionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, ueRetentionInformationRootCount, int64(u), "UERetentionInformation") -} - -func (u *UERetentionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, ueRetentionInformationRootCount, "UERetentionInformation") - if err != nil { - return err - } - - *u = UERetentionInformation(idx) - - return nil -} - -func (p PagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, pagingDRXRootCount, int64(p), "PagingDRX") -} - -func (p *PagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, pagingDRXRootCount, "PagingDRX") - if err != nil { - return err - } - - *p = PagingDRX(idx) - - return nil -} - func (a AllowedNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { return marshalSeqOf(w, enc, 1, maxnoofAllowedSNSSAIs, []AllowedNSSAIItem(a)) } @@ -1104,99 +832,6 @@ func (p *PLMNSupportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -// A ProtocolExtensionContainer: never encoded, and on decode only its -// criticality is acted on. -type ieExtensions struct{} - -func (ieExtensions) MarshalPER(*per.Writer, per.Encoding) error { - return fmt.Errorf("ngap: unmodeled iE-Extensions cannot be encoded") -} - -func (*ieExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) - if err != nil { - return err - } - - var rejected ProtocolIEID - - comprehended := true - - for i := int64(0); i < n; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return err - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return err - } - - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - - // §10.3.4.2: an unmodeled extension marked reject stops the procedure; - // ignore and notify are skipped and the IE holding them still - // delivered. The container is consumed either way so the reader stays - // aligned. A notify extension should also be reported back, which a - // leaf decoder has no diagnostics sink to do. - if Criticality(crit) == CriticalityReject && comprehended { - comprehended, rejected = false, ProtocolIEID(id) - } - } - - if !comprehended { - return ¬ComprehendedIE{ID: rejected, Crit: CriticalityReject, What: "iE-Extensions"} - } - - return nil -} - -func skipSequenceExtensionsPER(r *per.Reader, enc per.Encoding, extContainer, extAdditions bool) error { - if extContainer { - var e ieExtensions - if err := e.UnmarshalPER(r, enc); err != nil { - return err - } - } - - if !extAdditions { - return nil - } - - var present []bool - - // A bitmap wider than 64 bits arrives fragmented (X.691 §19.7 via §11.9.3), - // so the callback runs once per fragment and the bits accumulate. - err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for range count { - b, err := r.ReadBit() - if err != nil { - return err - } - - present = append(present, b) - } - - return nil - }) - if err != nil { - return err - } - - for _, p := range present { - if p { - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - - return nil -} - func marshalSeqOf[T any](w *per.Writer, enc per.Encoding, lb, ub int64, items []T) error { off := 0 @@ -1246,10 +881,6 @@ func unmarshalSeqOf[T any](r *per.Reader, enc per.Encoding, lb, ub int64) ([]T, return items, nil } -func perIEDecode(b []byte, u per.Unmarshaler) error { - return u.UnmarshalPER(per.NewReader(b), per.Aligned) -} - func (l QosFlowSetupRequestList) MarshalPER(w *per.Writer, enc per.Encoding) error { return marshalSeqOf(w, enc, 1, maxnoofQosFlows, []QosFlowSetupRequestItem(l)) } @@ -1654,40 +1285,3 @@ func (l *QosFlowNotifyList) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } - -type rawIEExtensions struct { - data []byte - nbits int -} - -func (e *rawIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { - if enc == per.Aligned { - w.AlignToByte() - } - - w.WriteBitString(e.data, e.nbits) - - return nil -} - -func (e *rawIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - if enc == per.Aligned { - r.AlignToByte() - } - - start := r.Offset() - - var c ieExtensions - if err := c.UnmarshalPER(r, enc); err != nil { - return err - } - - data, nbits, err := r.Since(start) - if err != nil { - return err - } - - e.data, e.nbits = data, nbits - - return nil -} diff --git a/ngap/per_test_helpers_test.go b/ngap/per_test_helpers_test.go index 833cca9161..662a3172b1 100644 --- a/ngap/per_test_helpers_test.go +++ b/ngap/per_test_helpers_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func unmarshalPERValue[T any](b []byte) (T, error) { @@ -45,3 +46,58 @@ func deref[T any](p *T) T { return *p } + +//nolint:unparam +func encodeIEContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { + return ap.EncodeIEContainer(profile, w, enc, fields) +} + +func typeOfError(d DiagnosticIE) TypeOfError { + if d.Kind == ap.KindMissing { + return TypeOfErrorMissing + } + + return TypeOfErrorNotUnderstood +} + +const paddingIEs = 64 + +func firstIndex(p *RawPDU, id ProtocolIEID) int { + i, err := p.Index(id) + if err != nil { + return -1 + } + + return i +} + +func swapTable[M any](table *[]ieSpec[M], rows ...ieSpec[M]) func() { + saved := *table + *table = rows + + return func() { *table = saved } +} + +func rawRow[M any](id ProtocolIEID, crit Criticality, value []byte) ieSpec[M] { + return ieSpec[M]{ + ID: id, Presence: presenceOptional, Criticality: crit, + Decode: func(*M, *per.Reader, per.Encoding) error { return nil }, + Encode: func(*M) (per.Marshaler, bool) { return ap.RawValue(value), true }, + } +} + +func tableRow[M any](table []ieSpec[M], id ProtocolIEID, crit Criticality) ieSpec[M] { + for _, r := range table { + if r.ID == id { + r.Criticality = crit + + return r + } + } + + panic("no row") +} + +func encodeContainerField(w *per.Writer, f ieField) error { + return ap.EncodeField(profile, w, per.Aligned, f) +} diff --git a/ngap/pws.go b/ngap/pws.go index 17091ffe1a..87af7b86a3 100644 --- a/ngap/pws.go +++ b/ngap/pws.go @@ -23,25 +23,25 @@ type WriteReplaceWarningRequest struct { var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.SerialNumber, true }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.SerialNumber, true }, }, { - id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + ID: IDWarningAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { var v WarningAreaList - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -49,7 +49,7 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ return nil }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if m.WarningAreaList == nil { return nil, false } @@ -58,25 +58,25 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ }, }, { - id: IDRepetitionPeriod, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RepetitionPeriod) + ID: IDRepetitionPeriod, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RepetitionPeriod) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.RepetitionPeriod, true }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.RepetitionPeriod, true }, }, { - id: IDNumberOfBroadcastsRequested, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NumberOfBroadcastsRequested) + ID: IDNumberOfBroadcastsRequested, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NumberOfBroadcastsRequested) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.NumberOfBroadcastsRequested, true }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return m.NumberOfBroadcastsRequested, true }, }, { - id: IDWarningType, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + ID: IDWarningType, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { var v WarningType - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -84,7 +84,7 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ return nil }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if m.WarningType == nil { return nil, false } @@ -93,11 +93,11 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ }, }, { - id: IDWarningSecurityInfo, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + ID: IDWarningSecurityInfo, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { var v WarningSecurityInfo - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -105,7 +105,7 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ return nil }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if m.WarningSecurityInfo == nil { return nil, false } @@ -114,11 +114,11 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ }, }, { - id: IDDataCodingScheme, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + ID: IDDataCodingScheme, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { var v DataCodingScheme - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -126,7 +126,7 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ return nil }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if m.DataCodingScheme == nil { return nil, false } @@ -135,11 +135,11 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ }, }, { - id: IDWarningMessageContents, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.WarningMessageContents) + ID: IDWarningMessageContents, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.WarningMessageContents) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if len(m.WarningMessageContents) == 0 { return nil, false } @@ -148,11 +148,11 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ }, }, { - id: IDConcurrentWarningMessageInd, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { + ID: IDConcurrentWarningMessageInd, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { var v ConcurrentWarningMessageInd - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -160,7 +160,7 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ return nil }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if m.ConcurrentWarningMessageInd == nil { return nil, false } @@ -169,11 +169,11 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ }, }, { - id: IDWarningAreaCoordinates, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.WarningAreaCoordinates) + ID: IDWarningAreaCoordinates, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.WarningAreaCoordinates) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if len(m.WarningAreaCoordinates) == 0 { return nil, false } @@ -207,6 +207,10 @@ func ParseWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, return parseMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, TriggeringInitiatingMessage, writeReplaceWarningRequestIEs, value) } +func DecodeWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, error) { + return decodeMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, writeReplaceWarningRequestIEs, value) +} + type WriteReplaceWarningResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -218,25 +222,25 @@ type WriteReplaceWarningResponse struct { var writeReplaceWarningResponseIEs = []ieSpec[WriteReplaceWarningResponse]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return m.SerialNumber, true }, + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return m.SerialNumber, true }, }, { - id: IDBroadcastCompletedAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + ID: IDBroadcastCompletedAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { var v BroadcastCompletedAreaList - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -244,7 +248,7 @@ var writeReplaceWarningResponseIEs = []ieSpec[WriteReplaceWarningResponse]{ return nil }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { if m.BroadcastCompletedAreaList == nil { return nil, false } @@ -253,11 +257,11 @@ var writeReplaceWarningResponseIEs = []ieSpec[WriteReplaceWarningResponse]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -265,7 +269,7 @@ var writeReplaceWarningResponseIEs = []ieSpec[WriteReplaceWarningResponse]{ return nil }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -299,6 +303,10 @@ func ParseWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningRespons return parseMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, TriggeringSuccessfulOutcome, writeReplaceWarningResponseIEs, value) } +func DecodeWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningResponse, error) { + return decodeMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, writeReplaceWarningResponseIEs, value) +} + type PWSCancelRequest struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -310,25 +318,25 @@ type PWSCancelRequest struct { var pWSCancelRequestIEs = []ieSpec[PWSCancelRequest]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSCancelRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + Encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { return m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSCancelRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { return m.SerialNumber, true }, + Encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { return m.SerialNumber, true }, }, { - id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { + ID: IDWarningAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PWSCancelRequest, r *per.Reader, enc per.Encoding) error { var v WarningAreaList - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -336,7 +344,7 @@ var pWSCancelRequestIEs = []ieSpec[PWSCancelRequest]{ return nil }, - encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { + Encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { if m.WarningAreaList == nil { return nil, false } @@ -345,11 +353,11 @@ var pWSCancelRequestIEs = []ieSpec[PWSCancelRequest]{ }, }, { - id: IDCancelAllWarningMessages, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PWSCancelRequest, raw []byte, enc per.Encoding) error { + ID: IDCancelAllWarningMessages, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PWSCancelRequest, r *per.Reader, enc per.Encoding) error { var v CancelAllWarningMessages - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -357,7 +365,7 @@ var pWSCancelRequestIEs = []ieSpec[PWSCancelRequest]{ return nil }, - encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { + Encode: func(m *PWSCancelRequest) (per.Marshaler, bool) { if m.CancelAllWarningMessages == nil { return nil, false } @@ -391,6 +399,10 @@ func ParsePWSCancelRequest(value []byte) (*PWSCancelRequest, error) { return parseMessageBody[PWSCancelRequest](ProcPWSCancel, TriggeringInitiatingMessage, pWSCancelRequestIEs, value) } +func DecodePWSCancelRequest(value []byte) (*PWSCancelRequest, error) { + return decodeMessageBody[PWSCancelRequest](ProcPWSCancel, pWSCancelRequestIEs, value) +} + type PWSCancelResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -402,25 +414,25 @@ type PWSCancelResponse struct { var pWSCancelResponseIEs = []ieSpec[PWSCancelResponse]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSCancelResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { return m.MessageIdentifier, true }, + Encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { return m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSCancelResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { return m.SerialNumber, true }, + Encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { return m.SerialNumber, true }, }, { - id: IDBroadcastCancelledAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { + ID: IDBroadcastCancelledAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PWSCancelResponse, r *per.Reader, enc per.Encoding) error { var v BroadcastCancelledAreaList - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -428,7 +440,7 @@ var pWSCancelResponseIEs = []ieSpec[PWSCancelResponse]{ return nil }, - encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { + Encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { if m.BroadcastCancelledAreaList == nil { return nil, false } @@ -437,11 +449,11 @@ var pWSCancelResponseIEs = []ieSpec[PWSCancelResponse]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PWSCancelResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PWSCancelResponse, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -449,7 +461,7 @@ var pWSCancelResponseIEs = []ieSpec[PWSCancelResponse]{ return nil }, - encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { + Encode: func(m *PWSCancelResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -483,6 +495,10 @@ func ParsePWSCancelResponse(value []byte) (*PWSCancelResponse, error) { return parseMessageBody[PWSCancelResponse](ProcPWSCancel, TriggeringSuccessfulOutcome, pWSCancelResponseIEs, value) } +func DecodePWSCancelResponse(value []byte) (*PWSCancelResponse, error) { + return decodeMessageBody[PWSCancelResponse](ProcPWSCancel, pWSCancelResponseIEs, value) +} + type PWSRestartIndication struct { CellIDListForRestart CellIDListForRestart GlobalRANNodeID GlobalRANNodeID @@ -494,32 +510,32 @@ type PWSRestartIndication struct { var pWSRestartIndicationIEs = []ieSpec[PWSRestartIndication]{ { - id: IDCellIDListForRestart, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.CellIDListForRestart) + ID: IDCellIDListForRestart, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.CellIDListForRestart) }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return m.CellIDListForRestart, true }, + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return &m.CellIDListForRestart, true }, }, { - id: IDGlobalRANNodeID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GlobalRANNodeID) + ID: IDGlobalRANNodeID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GlobalRANNodeID) }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return m.GlobalRANNodeID, true }, + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return &m.GlobalRANNodeID, true }, }, { - id: IDTAIListForRestart, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TAIListForRestart) + ID: IDTAIListForRestart, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TAIListForRestart) }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return m.TAIListForRestart, true }, + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return m.TAIListForRestart, true }, }, { - id: IDEmergencyAreaIDListForRestart, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.EmergencyAreaIDListForRestart) + ID: IDEmergencyAreaIDListForRestart, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.EmergencyAreaIDListForRestart) }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { if len(m.EmergencyAreaIDListForRestart) == 0 { return nil, false } @@ -553,6 +569,10 @@ func ParsePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { return parseMessageBody[PWSRestartIndication](ProcPWSRestartIndication, TriggeringInitiatingMessage, pWSRestartIndicationIEs, value) } +func DecodePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { + return decodeMessageBody[PWSRestartIndication](ProcPWSRestartIndication, pWSRestartIndicationIEs, value) +} + type PWSFailureIndication struct { PWSFailedCellIDList PWSFailedCellIDList GlobalRANNodeID GlobalRANNodeID @@ -562,18 +582,18 @@ type PWSFailureIndication struct { var pWSFailureIndicationIEs = []ieSpec[PWSFailureIndication]{ { - id: IDPWSFailedCellIDList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PWSFailedCellIDList) + ID: IDPWSFailedCellIDList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSFailureIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PWSFailedCellIDList) }, - encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return m.PWSFailedCellIDList, true }, + Encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return &m.PWSFailedCellIDList, true }, }, { - id: IDGlobalRANNodeID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GlobalRANNodeID) + ID: IDGlobalRANNodeID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSFailureIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GlobalRANNodeID) }, - encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return m.GlobalRANNodeID, true }, + Encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return &m.GlobalRANNodeID, true }, }, } @@ -600,3 +620,7 @@ func (m *PWSFailureIndication) Marshal() ([]byte, error) { func ParsePWSFailureIndication(value []byte) (*PWSFailureIndication, error) { return parseMessageBody[PWSFailureIndication](ProcPWSFailureIndication, TriggeringInitiatingMessage, pWSFailureIndicationIEs, value) } + +func DecodePWSFailureIndication(value []byte) (*PWSFailureIndication, error) { + return decodeMessageBody[PWSFailureIndication](ProcPWSFailureIndication, pWSFailureIndicationIEs, value) +} diff --git a/ngap/pws_overload_test.go b/ngap/pws_overload_test.go index 075fff9fc0..a73e2b7181 100644 --- a/ngap/pws_overload_test.go +++ b/ngap/pws_overload_test.go @@ -4,12 +4,12 @@ package ngap import ( + "bytes" "encoding/hex" - "errors" - "reflect" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func pwsPLMN() PLMNIdentity { return PLMNIdentity{0x00, 0xf1, 0x10} } @@ -28,16 +28,16 @@ func pwsCBSData() WarningMessageContents { } func pwsGNB() GlobalRANNodeID { - return GlobalRANNodeID{Kind: RANNodeIDGNB, PLMNIdentity: pwsPLMN(), Value: 1, Bits: 22} + return NewGlobalGNBID(pwsPLMN(), 1, 22) } func goldOverloadStart() *OverloadStart { return &OverloadStart{ - AMFOverloadResponse: &OverloadResponse{OverloadAction: OverloadActionRejectRRCCRSignalling}, + AMFOverloadResponse: &OverloadResponse{OverloadAction: Ptr(OverloadActionRejectRRCCRSignalling)}, AMFTrafficLoadReductionIndication: Ptr(TrafficLoadReductionIndication(50)), OverloadStartNSSAIList: OverloadStartNSSAIList{{ SliceOverloadList: []SliceOverloadItem{{SNSSAI: SNSSAI{SST: 1, SD: &SD{0x00, 0x00, 0x01}}}}, - SliceOverloadResponse: &OverloadResponse{OverloadAction: OverloadActionPermitEmergencySessionsAndMTServicesOnly}, + SliceOverloadResponse: &OverloadResponse{OverloadAction: Ptr(OverloadActionPermitEmergencySessionsAndMTServicesOnly)}, SliceTrafficLoadReductionIndication: Ptr(TrafficLoadReductionIndication(20)), }}, } @@ -65,7 +65,7 @@ func goldWriteReplaceWarningRequest() *WriteReplaceWarningRequest { return &WriteReplaceWarningRequest{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - WarningAreaList: &WarningAreaList{NRCGIs: []NRCGI{pwsNRCGI()}}, + WarningAreaList: &WarningAreaList{NRCGIListForWarning: &NRCGIListForWarning{pwsNRCGI()}}, RepetitionPeriod: 10, NumberOfBroadcastsRequested: 1, WarningType: &WarningType{0x05, 0x80}, @@ -80,7 +80,7 @@ func goldWriteReplaceWarningResponse() *WriteReplaceWarningResponse { return &WriteReplaceWarningResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - BroadcastCompletedAreaList: &BroadcastCompletedAreaList{TAIBroadcastNR: []TAIBroadcastNRItem{{ + BroadcastCompletedAreaList: &BroadcastCompletedAreaList{TAIBroadcastNR: &TAIBroadcastNR{{ TAI: pwsTAI(), CompletedCellsInTAI: []CompletedCellsInTAINRItem{{NRCGI: pwsNRCGI()}}, }}}, @@ -91,7 +91,7 @@ func goldPWSCancelRequest() *PWSCancelRequest { return &PWSCancelRequest{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - WarningAreaList: &WarningAreaList{TAIs: []TAI{pwsTAI()}}, + WarningAreaList: &WarningAreaList{TAIListForWarning: &TAIListForWarning{pwsTAI()}}, CancelAllWarningMessages: Ptr(CancelAllWarningMessagesTrue), } } @@ -100,7 +100,7 @@ func goldPWSCancelResponse() *PWSCancelResponse { return &PWSCancelResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3456, - BroadcastCancelledAreaList: &BroadcastCancelledAreaList{CellIDCancelledNR: []CellIDCancelledNRItem{{ + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{CellIDCancelledNR: &CellIDCancelledNR{{ NRCGI: pwsNRCGI(), NumberOfBroadcasts: 3, }}}, @@ -109,7 +109,7 @@ func goldPWSCancelResponse() *PWSCancelResponse { func goldPWSRestartIndication() *PWSRestartIndication { return &PWSRestartIndication{ - CellIDListForRestart: CellIDListForRestart{NRCGIs: []NRCGI{pwsNRCGI()}}, + CellIDListForRestart: CellIDListForRestart{NRCGIListforRestart: &NRCGIList{pwsNRCGI()}}, GlobalRANNodeID: pwsGNB(), TAIListForRestart: TAIListForRestart{pwsTAI()}, EmergencyAreaIDListForRestart: EmergencyAreaIDListForRestart{{0x01, 0x02, 0x03}}, @@ -118,7 +118,7 @@ func goldPWSRestartIndication() *PWSRestartIndication { func goldPWSFailureIndication() *PWSFailureIndication { return &PWSFailureIndication{ - PWSFailedCellIDList: PWSFailedCellIDList{EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}}, + PWSFailedCellIDList: PWSFailedCellIDList{EUTRACGIPWSFailedList: &EUTRACGIList{pwsEUTRACGI()}}, GlobalRANNodeID: pwsGNB(), } } @@ -183,7 +183,7 @@ func TestPWSOverloadRoundTripGolden(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(got, c.want) { + if !equalByMethod(got, c.want) { t.Errorf("round trip = %+v, want %+v", got, c.want) } }) @@ -297,8 +297,8 @@ func TestPWSOverloadWireCriticality(t *testing.T) { } for i, w := range tt.want { - if got[i].id != w.id || got[i].crit != w.crit { - t.Errorf("IE %d: got %v/%v, want %v/%v", i, got[i].id, got[i].crit, w.id, w.crit) + if got[i].ID != w.id || got[i].Criticality != w.crit { + t.Errorf("IE %d: got %v/%v, want %v/%v", i, got[i].ID, got[i].Criticality, w.id, w.crit) } } }) @@ -322,7 +322,7 @@ func pwsRoundTrip[T any, PT interface { t.Fatal(err) } - if !reflect.DeepEqual(out, in) { + if !equalByMethod(out, in) { t.Errorf("round trip = %+v, want %+v", out, in) } } @@ -331,48 +331,48 @@ func TestPWSAreaListAlternativesRoundTrip(t *testing.T) { eai := EmergencyAreaID{0x0a, 0x0b, 0x0c} for _, l := range []WarningAreaList{ - {EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}}, - {NRCGIs: []NRCGI{pwsNRCGI()}}, - {TAIs: []TAI{pwsTAI()}}, - {EmergencyAreaIDs: []EmergencyAreaID{eai}}, + {EUTRACGIListForWarning: &EUTRACGIListForWarning{pwsEUTRACGI()}}, + {NRCGIListForWarning: &NRCGIListForWarning{pwsNRCGI()}}, + {TAIListForWarning: &TAIListForWarning{pwsTAI()}}, + {EmergencyAreaIDList: &EmergencyAreaIDList{eai}}, } { pwsRoundTrip(t, &l) } for _, l := range []BroadcastCompletedAreaList{ - {CellIDBroadcastEUTRA: []CellIDBroadcastEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}, - {TAIBroadcastEUTRA: []TAIBroadcastEUTRAItem{{TAI: pwsTAI(), CompletedCellsInTAI: []CompletedCellsInTAIEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}}}, - {EmergencyAreaIDBroadcastEUTRA: []EmergencyAreaIDBroadcastEUTRAItem{{EmergencyAreaID: eai, CompletedCellsInEAI: []CompletedCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}}}, - {CellIDBroadcastNR: []CellIDBroadcastNRItem{{NRCGI: pwsNRCGI()}}}, - {TAIBroadcastNR: []TAIBroadcastNRItem{{TAI: pwsTAI(), CompletedCellsInTAI: []CompletedCellsInTAINRItem{{NRCGI: pwsNRCGI()}}}}}, - {EmergencyAreaIDBroadcastNR: []EmergencyAreaIDBroadcastNRItem{{EmergencyAreaID: eai, CompletedCellsInEAI: []CompletedCellsInEAINRItem{{NRCGI: pwsNRCGI()}}}}}, + {CellIDBroadcastEUTRA: &CellIDBroadcastEUTRA{{EUTRACGI: pwsEUTRACGI()}}}, + {TAIBroadcastEUTRA: &TAIBroadcastEUTRA{{TAI: pwsTAI(), CompletedCellsInTAI: []CompletedCellsInTAIEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}}}, + {EmergencyAreaIDBroadcastEUTRA: &EmergencyAreaIDBroadcastEUTRA{{EmergencyAreaID: eai, CompletedCellsInEAI: []CompletedCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI()}}}}}, + {CellIDBroadcastNR: &CellIDBroadcastNR{{NRCGI: pwsNRCGI()}}}, + {TAIBroadcastNR: &TAIBroadcastNR{{TAI: pwsTAI(), CompletedCellsInTAI: []CompletedCellsInTAINRItem{{NRCGI: pwsNRCGI()}}}}}, + {EmergencyAreaIDBroadcastNR: &EmergencyAreaIDBroadcastNR{{EmergencyAreaID: eai, CompletedCellsInEAI: []CompletedCellsInEAINRItem{{NRCGI: pwsNRCGI()}}}}}, } { pwsRoundTrip(t, &l) } for _, l := range []BroadcastCancelledAreaList{ - {CellIDCancelledEUTRA: []CellIDCancelledEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 1}}}, - {TAICancelledEUTRA: []TAICancelledEUTRAItem{{TAI: pwsTAI(), CancelledCellsInTAI: []CancelledCellsInTAIEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 2}}}}}, - {EmergencyAreaIDCancelledEUTRA: []EmergencyAreaIDCancelledEUTRAItem{{EmergencyAreaID: eai, CancelledCellsInEAI: []CancelledCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 3}}}}}, - {CellIDCancelledNR: []CellIDCancelledNRItem{{NRCGI: pwsNRCGI(), NumberOfBroadcasts: 65535}}}, - {TAICancelledNR: []TAICancelledNRItem{{TAI: pwsTAI(), CancelledCellsInTAI: []CancelledCellsInTAINRItem{{NRCGI: pwsNRCGI()}}}}}, - {EmergencyAreaIDCancelledNR: []EmergencyAreaIDCancelledNRItem{{EmergencyAreaID: eai, CancelledCellsInEAI: []CancelledCellsInEAINRItem{{NRCGI: pwsNRCGI()}}}}}, + {CellIDCancelledEUTRA: &CellIDCancelledEUTRA{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 1}}}, + {TAICancelledEUTRA: &TAICancelledEUTRA{{TAI: pwsTAI(), CancelledCellsInTAI: []CancelledCellsInTAIEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 2}}}}}, + {EmergencyAreaIDCancelledEUTRA: &EmergencyAreaIDCancelledEUTRA{{EmergencyAreaID: eai, CancelledCellsInEAI: []CancelledCellsInEAIEUTRAItem{{EUTRACGI: pwsEUTRACGI(), NumberOfBroadcasts: 3}}}}}, + {CellIDCancelledNR: &CellIDCancelledNR{{NRCGI: pwsNRCGI(), NumberOfBroadcasts: 65535}}}, + {TAICancelledNR: &TAICancelledNR{{TAI: pwsTAI(), CancelledCellsInTAI: []CancelledCellsInTAINRItem{{NRCGI: pwsNRCGI()}}}}}, + {EmergencyAreaIDCancelledNR: &EmergencyAreaIDCancelledNR{{EmergencyAreaID: eai, CancelledCellsInEAI: []CancelledCellsInEAINRItem{{NRCGI: pwsNRCGI()}}}}}, } { pwsRoundTrip(t, &l) } - pwsRoundTrip(t, &CellIDListForRestart{EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}}) - pwsRoundTrip(t, &PWSFailedCellIDList{NRCGIs: []NRCGI{pwsNRCGI()}}) + pwsRoundTrip(t, &CellIDListForRestart{EUTRACGIListforRestart: &EUTRACGIList{pwsEUTRACGI()}}) + pwsRoundTrip(t, &PWSFailedCellIDList{NRCGIPWSFailedList: &NRCGIList{pwsNRCGI()}}) } func TestPWSChoiceNeedsExactlyOneAlternative(t *testing.T) { for _, m := range []per.Marshaler{ - WarningAreaList{}, - WarningAreaList{TAIs: []TAI{pwsTAI()}, NRCGIs: []NRCGI{pwsNRCGI()}}, - BroadcastCompletedAreaList{}, - BroadcastCancelledAreaList{}, - CellIDListForRestart{}, - PWSFailedCellIDList{EUTRACGIs: []EUTRACGI{pwsEUTRACGI()}, NRCGIs: []NRCGI{pwsNRCGI()}}, + &WarningAreaList{}, + &WarningAreaList{TAIListForWarning: &TAIListForWarning{pwsTAI()}, NRCGIListForWarning: &NRCGIListForWarning{pwsNRCGI()}}, + &BroadcastCompletedAreaList{}, + &BroadcastCancelledAreaList{}, + &CellIDListForRestart{}, + &PWSFailedCellIDList{EUTRACGIPWSFailedList: &EUTRACGIList{pwsEUTRACGI()}, NRCGIPWSFailedList: &NRCGIList{pwsNRCGI()}}, } { if err := m.MarshalPER(per.NewWriter(), per.Aligned); err == nil { t.Errorf("%T %+v: Marshal accepted it", m, m) @@ -380,19 +380,36 @@ func TestPWSChoiceNeedsExactlyOneAlternative(t *testing.T) { } } -func TestPWSChoiceExtensionsNotComprehended(t *testing.T) { +func TestOverloadResponseKeepsChoiceExtension(t *testing.T) { + in := OverloadResponse{ChoiceExtension: &SingleContainer{ID: 999, Criticality: CriticalityIgnore, Value: "\x00"}} + + b, err := per.Marshal(&in, per.Aligned) + if err != nil { + t.Fatal(err) + } + + var out OverloadResponse + if err := per.Unmarshal(b, &out); err != nil || out.ChoiceExtension == nil || *out.ChoiceExtension != *in.ChoiceExtension { + t.Fatalf("decoded %+v, %v; want the choice-Extensions alternative kept", out, err) + } +} + +func TestPWSChoiceExtensionsArePreserved(t *testing.T) { cases := []struct { name string - u per.Unmarshaler - idx int64 - ub int64 + u interface { + per.Unmarshaler + per.Marshaler + ap.Diagnosable[ProtocolIEID] + } + idx int64 + ub int64 }{ {"WarningAreaList", &WarningAreaList{}, warningAreaListChoiceExtensions, warningAreaListAlternatives - 1}, {"BroadcastCompletedAreaList", &BroadcastCompletedAreaList{}, broadcastAreaChoiceExtensions, broadcastAreaAlternatives - 1}, {"BroadcastCancelledAreaList", &BroadcastCancelledAreaList{}, broadcastAreaChoiceExtensions, broadcastAreaAlternatives - 1}, {"CellIDListForRestart", &CellIDListForRestart{}, cellListChoiceExtensions, cellListAlternatives - 1}, {"PWSFailedCellIDList", &PWSFailedCellIDList{}, cellListChoiceExtensions, cellListAlternatives - 1}, - {"OverloadResponse", &OverloadResponse{}, overloadResponseChoiceExtensions, overloadResponseAlternatives - 1}, } for _, c := range cases { @@ -402,21 +419,28 @@ func TestPWSChoiceExtensionsNotComprehended(t *testing.T) { t.Fatal(err) } - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, 999); err != nil { + if err := encodeContainerField(w, ieField{ID: 999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00})}); err != nil { t.Fatal(err) } - if err := per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(CriticalityIgnore)); err != nil { - t.Fatal(err) + wire := perBytes(w) + + if err := c.u.UnmarshalPER(per.NewReader(wire), per.Aligned); err != nil { + t.Fatalf("decode: %v", err) + } + + d := ap.Diagnose[ProtocolIEID](c.u) + if len(d.IEs) != 1 || d.IEs[0].ID != 999 || d.IEs[0].Criticality != CriticalityIgnore { + t.Errorf("diagnostics = %+v", d.IEs) } - if err := per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x00}); err != nil { + out := per.NewWriter() + if err := c.u.MarshalPER(out, per.Aligned); err != nil { t.Fatal(err) } - err := c.u.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned) - if !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want errNotComprehended", err) + if !bytes.Equal(perBytes(out), wire) { + t.Errorf("re-encode = % x, want % x", perBytes(out), wire) } }) } diff --git a/ngap/ran_config_update.go b/ngap/ran_config_update.go index ef25f49102..cd61c7fe04 100644 --- a/ngap/ran_config_update.go +++ b/ngap/ran_config_update.go @@ -15,26 +15,30 @@ type RANConfigurationUpdate struct { DefaultPagingDRX *PagingDRX GlobalRANNodeID *GlobalRANNodeID NGRANTNLAssociationToRemoveList NGRANTNLAssociationToRemoveList + NBIoTDefaultPagingDRX *NBIoTDefaultPagingDRX + ExtendedRANNodeName *ExtendedRANNodeName + AdditionalULI *AdditionalULI + AIoTSupport *AIoTSupport messageMeta } var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ { - id: IDRANNodeName, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RANConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDRANNodeName, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RANConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { name := string(n) m.RANNodeName = &name } return err }, - encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { if m.RANNodeName == nil { return nil, false } @@ -43,11 +47,11 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ }, }, { - id: IDSupportedTAList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *RANConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SupportedTAList) + ID: IDSupportedTAList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *RANConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SupportedTAList) }, - encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { if len(m.SupportedTAList) == 0 { return nil, false } @@ -56,11 +60,11 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ }, }, { - id: IDDefaultPagingDRX, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RANConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDDefaultPagingDRX, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RANConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var drx PagingDRX - if err := perIEDecode(raw, &drx); err != nil { + if err := decodeIE(r, &drx); err != nil { return err } @@ -68,7 +72,7 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ return nil }, - encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { if m.DefaultPagingDRX == nil { return nil, false } @@ -77,11 +81,11 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ }, }, { - id: IDGlobalRANNodeID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RANConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDGlobalRANNodeID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RANConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var v GlobalRANNodeID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -89,7 +93,7 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ return nil }, - encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { if m.GlobalRANNodeID == nil { return nil, false } @@ -100,11 +104,11 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ { // Modeled but not acted on: the IE is reject, so not comprehending it // would reject an otherwise valid update (§10.3.4.2). - id: IDNGRANTNLAssociationToRemoveList, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *RANConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NGRANTNLAssociationToRemoveList) + ID: IDNGRANTNLAssociationToRemoveList, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *RANConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NGRANTNLAssociationToRemoveList) }, - encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdate) (per.Marshaler, bool) { if len(m.NGRANTNLAssociationToRemoveList) == 0 { return nil, false } @@ -112,6 +116,10 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ return m.NGRANTNLAssociationToRemoveList, true }, }, + optionalExtension(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *RANConfigurationUpdate) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), + optionalExtension(IDExtendedRANNodeName, CriticalityIgnore, func(m *RANConfigurationUpdate) **ExtendedRANNodeName { return &m.ExtendedRANNodeName }), + optionalExtension(IDAdditionalULI, CriticalityIgnore, func(m *RANConfigurationUpdate) **AdditionalULI { return &m.AdditionalULI }), + optionalExtension(IDAIoTSupport, CriticalityReject, func(m *RANConfigurationUpdate) **AIoTSupport { return &m.AIoTSupport }), } func (m *RANConfigurationUpdate) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -138,6 +146,10 @@ func ParseRANConfigurationUpdate(value []byte) (*RANConfigurationUpdate, error) return parseMessageBody[RANConfigurationUpdate](ProcRANConfigurationUpdate, TriggeringInitiatingMessage, rANConfigurationUpdateIEs, value) } +func DecodeRANConfigurationUpdate(value []byte) (*RANConfigurationUpdate, error) { + return decodeMessageBody[RANConfigurationUpdate](ProcRANConfigurationUpdate, rANConfigurationUpdateIEs, value) +} + // TS 38.413 §9.2.6.5. type RANConfigurationUpdateAcknowledge struct { CriticalityDiagnostics *CriticalityDiagnostics @@ -147,11 +159,11 @@ type RANConfigurationUpdateAcknowledge struct { var rANConfigurationUpdateAcknowledgeIEs = []ieSpec[RANConfigurationUpdateAcknowledge]{ { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RANConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RANConfigurationUpdateAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -159,7 +171,7 @@ var rANConfigurationUpdateAcknowledgeIEs = []ieSpec[RANConfigurationUpdateAcknow return nil }, - encode: func(m *RANConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdateAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -193,6 +205,10 @@ func ParseRANConfigurationUpdateAcknowledge(value []byte) (*RANConfigurationUpda return parseMessageBody[RANConfigurationUpdateAcknowledge](ProcRANConfigurationUpdate, TriggeringSuccessfulOutcome, rANConfigurationUpdateAcknowledgeIEs, value) } +func DecodeRANConfigurationUpdateAcknowledge(value []byte) (*RANConfigurationUpdateAcknowledge, error) { + return decodeMessageBody[RANConfigurationUpdateAcknowledge](ProcRANConfigurationUpdate, rANConfigurationUpdateAcknowledgeIEs, value) +} + // TS 38.413 §9.2.6.6. type RANConfigurationUpdateFailure struct { Cause *Cause @@ -204,11 +220,11 @@ type RANConfigurationUpdateFailure struct { var rANConfigurationUpdateFailureIEs = []ieSpec[RANConfigurationUpdateFailure]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *RANConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *RANConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -216,7 +232,7 @@ var rANConfigurationUpdateFailureIEs = []ieSpec[RANConfigurationUpdateFailure]{ return nil }, - encode: func(m *RANConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdateFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -225,11 +241,11 @@ var rANConfigurationUpdateFailureIEs = []ieSpec[RANConfigurationUpdateFailure]{ }, }, { - id: IDTimeToWait, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RANConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDTimeToWait, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RANConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var ttw TimeToWait - if err := perIEDecode(raw, &ttw); err != nil { + if err := decodeIE(r, &ttw); err != nil { return err } @@ -237,7 +253,7 @@ var rANConfigurationUpdateFailureIEs = []ieSpec[RANConfigurationUpdateFailure]{ return nil }, - encode: func(m *RANConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdateFailure) (per.Marshaler, bool) { if m.TimeToWait == nil { return nil, false } @@ -246,11 +262,11 @@ var rANConfigurationUpdateFailureIEs = []ieSpec[RANConfigurationUpdateFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RANConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RANConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -258,7 +274,7 @@ var rANConfigurationUpdateFailureIEs = []ieSpec[RANConfigurationUpdateFailure]{ return nil }, - encode: func(m *RANConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *RANConfigurationUpdateFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -291,3 +307,7 @@ func (m *RANConfigurationUpdateFailure) Marshal() ([]byte, error) { func ParseRANConfigurationUpdateFailure(value []byte) (*RANConfigurationUpdateFailure, error) { return parseMessageBody[RANConfigurationUpdateFailure](ProcRANConfigurationUpdate, TriggeringUnsuccessfulOutcome, rANConfigurationUpdateFailureIEs, value) } + +func DecodeRANConfigurationUpdateFailure(value []byte) (*RANConfigurationUpdateFailure, error) { + return decodeMessageBody[RANConfigurationUpdateFailure](ProcRANConfigurationUpdate, rANConfigurationUpdateFailureIEs, value) +} diff --git a/ngap/ran_config_update_test.go b/ngap/ran_config_update_test.go index 5c464d8901..2798e574c9 100644 --- a/ngap/ran_config_update_test.go +++ b/ngap/ran_config_update_test.go @@ -27,12 +27,7 @@ func goldRANConfigUpdate() *RANConfigurationUpdate { }}, }}, DefaultPagingDRX: Ptr(PagingDRXv128), - GlobalRANNodeID: Ptr(GlobalRANNodeID{ - Kind: RANNodeIDGNB, - PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - Value: 0x000102, - Bits: 24, - }), + GlobalRANNodeID: Ptr(NewGlobalGNBID(PLMNIdentity{0x00, 0xf1, 0x10}, 0x000102, 24)), } } @@ -48,7 +43,7 @@ func TestRANConfigurationUpdateGoldenEncode(t *testing.T) { { "failure", (&RANConfigurationUpdateFailure{ - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: CauseMiscUnknownPLMNOrSNPN}), + Cause: Ptr(CauseMiscUnknownPLMNOrSNPN.Cause()), TimeToWait: Ptr(TimeToWaitV10s), }).Marshal, goldenRANConfigUpdateFailure, @@ -103,7 +98,7 @@ func TestRANConfigurationUpdateGoldenDecode(t *testing.T) { t.Fatal("GlobalRANNodeID = nil") } - if got := *msg.GlobalRANNodeID; got != deref(want.GlobalRANNodeID) { + if got := *msg.GlobalRANNodeID; !got.Equal(deref(want.GlobalRANNodeID)) { t.Errorf("GlobalRANNodeID = %+v, want %+v", got, deref(want.GlobalRANNodeID)) } } @@ -168,8 +163,8 @@ func TestRANConfigurationUpdateFailureGoldenDecode(t *testing.T) { t.Fatalf("parse: %v", err) } - want := Cause{Group: CauseGroupMisc, Value: CauseMiscUnknownPLMNOrSNPN} - if deref(msg.Cause) != want { + want := CauseMiscUnknownPLMNOrSNPN.Cause() + if !deref(msg.Cause).Equal(want) { t.Errorf("cause = %v, want %v", deref(msg.Cause), want) } @@ -185,7 +180,7 @@ func TestRANConfigurationUpdateFailureMissingCause(t *testing.T) { t.Error("Marshal() = nil error, want a required-IE error for the absent Cause") } - value := container(t, ieField{id: IDTimeToWait, crit: CriticalityIgnore, val: TimeToWaitV10s}) + value := container(t, ieField{ID: IDTimeToWait, Criticality: CriticalityIgnore, Value: TimeToWaitV10s}) msg, err := ParseRANConfigurationUpdateFailure(value) if err != nil { @@ -201,7 +196,7 @@ func TestRANConfigurationUpdateFailureMissingCause(t *testing.T) { var reported bool for _, ie := range diag.IEs { - if ie.ID == IDCause && ie.TypeOfError == TypeOfErrorMissing { + if ie.ID == IDCause && typeOfError(ie) == TypeOfErrorMissing { reported = true } } diff --git a/ngap/raw_pdu.go b/ngap/raw_pdu.go index b50ee17517..c16f7a9adf 100644 --- a/ngap/raw_pdu.go +++ b/ngap/raw_pdu.go @@ -4,23 +4,25 @@ package ngap import ( - "errors" - "fmt" + "iter" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/protocolie" + "github.com/ellanetworks/core/per/ap" ) -var ErrIENotPresent = errors.New("ngap: IE not present") +var ( + ErrIENotPresent = ap.ErrIENotPresent + ErrDuplicateIE = ap.ErrDuplicateIE +) type RawPDU struct { - m *protocolie.Message + m *ap.RawPDU[ProtocolIEID] } func ParseRawPDU(b []byte) (*RawPDU, error) { - m, err := protocolie.Parse(b, func(pc uint8) bool { return ProcedureCode(pc) == ProcPrivateMessage }) + m, err := ap.ParseRawPDU[ProtocolIEID](profile, b) if err != nil { - return nil, fmt.Errorf("ngap: %w", err) + return nil, err } return &RawPDU{m: m}, nil @@ -30,93 +32,30 @@ func (p *RawPDU) Trigger() TriggeringMessage { return TriggeringMessage(p.m.Choi func (p *RawPDU) ProcedureCode() ProcedureCode { return ProcedureCode(p.m.ProcedureCode()) } -func (p *RawPDU) Criticality() Criticality { return Criticality(p.m.Criticality()) } - -func (p *RawPDU) Len() int { return p.m.Len() } - -func (p *RawPDU) IE(i int) (RawIE, error) { - f, err := p.m.Field(i) - if err != nil { - return RawIE{}, fmt.Errorf("ngap: %w", err) - } - - return RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value}, nil -} - -func (p *RawPDU) IEs() []RawIE { - fields := p.m.Fields() +func (p *RawPDU) Criticality() Criticality { return p.m.Criticality() } - out := make([]RawIE, len(fields)) - for i, f := range fields { - out[i] = RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value} - } - - return out -} +func (p *RawPDU) Opaque() bool { return p.m.Opaque() } -func (p *RawPDU) Index(id ProtocolIEID) int { return p.m.Index(uint16(id)) } - -func (p *RawPDU) SetValue(i int, value []byte) error { - if err := p.m.SetValue(i, value); err != nil { - return fmt.Errorf("ngap: %w", err) - } - - return nil -} - -func (p *RawPDU) Insert(i int, ie RawIE) error { - if err := p.m.Insert(i, protocolie.Field{ID: uint16(ie.ID), Criticality: uint8(ie.Criticality), Value: ie.Value}); err != nil { - return fmt.Errorf("ngap: %w", err) - } +func (p *RawPDU) Body() []byte { return p.m.Body() } - return nil -} +func (p *RawPDU) Len() int { return p.m.Len() } -func (p *RawPDU) Remove(i int) error { - if err := p.m.Remove(i); err != nil { - return fmt.Errorf("ngap: %w", err) - } +func (p *RawPDU) IE(i int) (RawIE, error) { return p.m.Field(i) } - return nil -} +func (p *RawPDU) IEs() []RawIE { return p.m.Fields() } -func (p *RawPDU) Marshal() ([]byte, error) { - b, err := p.m.Bytes() - if err != nil { - return nil, fmt.Errorf("ngap: %w", err) - } +func (p *RawPDU) All(id ProtocolIEID) iter.Seq2[int, RawIE] { return p.m.All(id) } - return b, nil -} +func (p *RawPDU) Index(id ProtocolIEID) (int, error) { return p.m.Index(id) } -func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { - i := p.m.Index(uint16(id)) - if i < 0 { - return false, nil - } +func (p *RawPDU) SetValue(i int, value []byte) error { return p.m.SetValue(i, value) } - f, err := p.m.Field(i) - if err != nil { - return false, fmt.Errorf("ngap: %w", err) - } - - if err := perIEDecode(f.Value, v); err != nil { - return false, fmt.Errorf("ngap: IE %s: %w", id, err) - } +func (p *RawPDU) Insert(i int, ie RawIE) error { return p.m.Insert(i, ie) } - return true, nil -} +func (p *RawPDU) Remove(i int) error { return p.m.Remove(i) } -func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { - i := p.m.Index(uint16(id)) - if i < 0 { - return fmt.Errorf("%w: %s", ErrIENotPresent, id) - } +func (p *RawPDU) Marshal() ([]byte, error) { return p.m.Marshal() } - b, err := per.Marshal(v, per.Aligned) - if err != nil { - return fmt.Errorf("ngap: IE %s: %w", id, err) - } +func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { return p.m.Get(id, v) } - return p.SetValue(i, b) -} +func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { return p.m.Set(id, v) } diff --git a/ngap/raw_pdu_test.go b/ngap/raw_pdu_test.go index 13a0408751..988edcba11 100644 --- a/ngap/raw_pdu_test.go +++ b/ngap/raw_pdu_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) type corpusPDU struct { @@ -167,7 +168,7 @@ func TestRawPDUCorpusIdentity(t *testing.T) { } for i := range ies { - if got[i].ID != ies[i].id || got[i].Criticality != ies[i].crit || !bytes.Equal(got[i].Value, ies[i].value) { + if got[i].ID != ies[i].ID || got[i].Criticality != ies[i].Criticality || !bytes.Equal(got[i].Value, ies[i].Value) { t.Errorf("%s: IE %d differs from decodeIEContainer", c.source, i) } } @@ -202,13 +203,13 @@ func ueIDSetters() []idSetter { field: "AMFUENGAPID", set: func(p *RawPDU, v uint64) error { return p.SetAMFUENGAPID(AMFUENGAPID(v)) }, value: func(v uint64) reflect.Value { return reflect.ValueOf(AMFUENGAPID(v)) }, - has: func(p *RawPDU) bool { return p.Index(IDAMFUENGAPID) >= 0 }, + has: func(p *RawPDU) bool { return firstIndex(p, IDAMFUENGAPID) >= 0 }, }, { field: "RANUENGAPID", set: func(p *RawPDU, v uint64) error { return p.SetRANUENGAPID(RANUENGAPID(v)) }, value: func(v uint64) reflect.Value { return reflect.ValueOf(RANUENGAPID(v)) }, - has: func(p *RawPDU) bool { return p.Index(IDRANUENGAPID) >= 0 }, + has: func(p *RawPDU) bool { return firstIndex(p, IDRANUENGAPID) >= 0 }, }, } } @@ -461,7 +462,7 @@ func TestRawPDUSpliceLocality(t *testing.T) { continue } - target := p.Index(map[string]ProtocolIEID{"AMFUENGAPID": IDAMFUENGAPID, "RANUENGAPID": IDRANUENGAPID}[s.field]) + target := firstIndex(p, map[string]ProtocolIEID{"AMFUENGAPID": IDAMFUENGAPID, "RANUENGAPID": IDRANUENGAPID}[s.field]) if err := s.set(p, v); err != nil { t.Fatal(err) @@ -581,7 +582,7 @@ func TestRawPDUTshark(t *testing.T) { e := expect{source: c.source} - if p.Index(IDAMFUENGAPID) >= 0 { + if firstIndex(p, IDAMFUENGAPID) >= 0 { if err := p.SetAMFUENGAPID(1099511627775); err != nil { t.Fatal(err) } @@ -589,7 +590,7 @@ func TestRawPDUTshark(t *testing.T) { e.id1 = strconv.FormatUint(1099511627775, 10) } - if p.Index(IDRANUENGAPID) >= 0 { + if firstIndex(p, IDRANUENGAPID) >= 0 { if err := p.SetRANUENGAPID(4294967295 - 1); err != nil { t.Fatal(err) } @@ -653,14 +654,30 @@ func hexSpaced(b []byte) string { return strings.Join(parts, " ") } -func TestRawPDURefusesPrivateMessage(t *testing.T) { - b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcPrivateMessage, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x00, 0x00}}) +func TestRawPDUPrivateMessageIsOpaque(t *testing.T) { + body := []byte{0x00, 0x00, 0x00} + + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcPrivateMessage, Criticality: CriticalityIgnore, Value: body}) + if err != nil { + t.Fatal(err) + } + + p, err := ParseRawPDU(b) if err != nil { t.Fatal(err) } - if _, err := ParseRawPDU(b); err == nil { - t.Fatal("PrivateMessage accepted as a ProtocolIE-Container") + if !p.Opaque() || p.ProcedureCode() != ProcPrivateMessage || p.Len() != 0 || !bytes.Equal(p.Body(), body) { + t.Fatalf("opaque = %v, procedure = %s, len = %d, body = %x", p.Opaque(), p.ProcedureCode(), p.Len(), p.Body()) + } + + if err := p.Insert(0, RawIE{ID: 1, Criticality: CriticalityIgnore, Value: []byte{0x00}}); err == nil { + t.Fatal("Insert into an opaque body succeeded") + } + + out, err := p.Marshal() + if err != nil || !bytes.Equal(out, b) { + t.Fatalf("Marshal = %x (%v), want %x", out, err, b) } } @@ -702,9 +719,9 @@ func TestRawPDUUnmodeledProcedure(t *testing.T) { body.WriteBit(false) if err := encodeIEContainer(body, per.Aligned, []ieField{ - {id: 60000, crit: CriticalityNotify, raw: []byte{0xde, 0xad}}, - {id: IDAMFUENGAPID, crit: CriticalityReject, raw: id}, - {id: 60001, crit: CriticalityIgnore, raw: bytes.Repeat([]byte{0xbe}, 200)}, + {ID: 60000, Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0xde, 0xad})}, + {ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(id)}, + {ID: 60001, Criticality: CriticalityIgnore, Value: ap.RawValue(bytes.Repeat([]byte{0xbe}, 200))}, }); err != nil { t.Fatal(err) } @@ -786,7 +803,7 @@ func FuzzRawPDU(f *testing.F) { t.Fatalf("same-value replace: %v", err) } - if p.Index(IDAMFUENGAPID) < 0 { + if firstIndex(p, IDAMFUENGAPID) < 0 { return } diff --git a/ngap/raw_pdu_ue_ids.go b/ngap/raw_pdu_ue_ids.go index ffe9600399..80a52020a1 100644 --- a/ngap/raw_pdu_ue_ids.go +++ b/ngap/raw_pdu_ue_ids.go @@ -51,4 +51,4 @@ func (p *RawPDU) UENGAPIDs() (UENGAPIDs, bool, error) { return v, ok, err } -func (p *RawPDU) SetUENGAPIDs(v UENGAPIDs) error { return p.Set(IDUENGAPIDs, v) } +func (p *RawPDU) SetUENGAPIDs(v UENGAPIDs) error { return p.Set(IDUENGAPIDs, &v) } diff --git a/ngap/raw_pdu_ue_ids_test.go b/ngap/raw_pdu_ue_ids_test.go index b59b0967f5..047de5a96a 100644 --- a/ngap/raw_pdu_ue_ids_test.go +++ b/ngap/raw_pdu_ue_ids_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func handUEContextReleaseCommand(t *testing.T, ran uint32) []byte { @@ -33,14 +34,14 @@ func handUEContextReleaseCommand(t *testing.T, ran uint32) []byte { })) mustNil(t, per.EncodeOpenTypeBytes(ids, enc, []byte{0x11, 0x22})) - cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + cause, err := per.Marshal(Ptr(CauseMisc(0).Cause())) mustNil(t, err) body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, enc, []ieField{ - {id: IDUENGAPIDs, crit: CriticalityReject, raw: ids.Bytes()}, - {id: IDCause, crit: CriticalityIgnore, raw: cause}, + {ID: IDUENGAPIDs, Criticality: CriticalityReject, Value: ap.RawValue(ids.Bytes())}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUEContextRelease, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -60,7 +61,7 @@ func TestRawPDUUENGAPIDsKeepPairExtensions(t *testing.T) { t.Fatalf("UENGAPIDs() = %v, %v", ok, err) } - if !ids.Pair || ids.AMFUENGAPID != 7 || ids.RANUENGAPID != 1 { + if ids.UENGAPIDPair == nil || ids.UENGAPIDPair.AMFUENGAPID != 7 || ids.UENGAPIDPair.RANUENGAPID != 1 { t.Fatalf("UENGAPIDs() = %+v", ids) } @@ -73,7 +74,7 @@ func TestRawPDUUENGAPIDsKeepPairExtensions(t *testing.T) { t.Fatalf("unchanged set:\n got %x\nwant %x", got, in) } - ids.RANUENGAPID = 9 + ids.UENGAPIDPair.RANUENGAPID = 9 mustNil(t, p.SetUENGAPIDs(ids)) got, err = p.Marshal() diff --git a/ngap/reroute_nas.go b/ngap/reroute_nas.go index f894bb1311..bbf7dc2da0 100644 --- a/ngap/reroute_nas.go +++ b/ngap/reroute_nas.go @@ -81,17 +81,17 @@ func (n *RejectedNSSAIinTA) UnmarshalPER(r *per.Reader, enc per.Encoding) error } type SourceToTargetAMFInformationReroute struct { - _ [0]struct{} `per:"extseq"` - ConfiguredNSSAI *ConfiguredNSSAI `per:",optional"` - RejectedNSSAIinPLMN *RejectedNSSAIinPLMN `per:",optional"` - RejectedNSSAIinTA *RejectedNSSAIinTA `per:",optional"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ConfiguredNSSAI *ConfiguredNSSAI `per:",optional"` + RejectedNSSAIinPLMN *RejectedNSSAIinPLMN `per:",optional"` + RejectedNSSAIinTA *RejectedNSSAIinTA `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` } type PartiallyAllowedNSSAIItem struct { - _ [0]struct{} `per:"extseq"` - SNSSAI SNSSAI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + SNSSAI SNSSAI + iEExtensions extensionMeta `per:",exttable"` } type PartiallyAllowedNSSAI []PartiallyAllowedNSSAIItem @@ -125,18 +125,18 @@ type RerouteNASRequest struct { var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.RANUENGAPID, true }, + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.RANUENGAPID, true }, }, { - id: IDAMFUENGAPID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -144,7 +144,7 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ return nil }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -153,25 +153,25 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ }, }, { - id: IDNGAPMessage, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NGAPMessage) + ID: IDNGAPMessage, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NGAPMessage) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.NGAPMessage, true }, + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.NGAPMessage, true }, }, { - id: IDAMFSetID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFSetID) + ID: IDAMFSetID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFSetID) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.AMFSetID, true }, + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return m.AMFSetID, true }, }, { - id: IDAllowedNSSAI, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AllowedNSSAI) + ID: IDAllowedNSSAI, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AllowedNSSAI) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { if len(m.AllowedNSSAI) == 0 { return nil, false } @@ -180,11 +180,11 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ }, }, { - id: IDSourceToTargetAMFInformationReroute, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + ID: IDSourceToTargetAMFInformationReroute, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { var v SourceToTargetAMFInformationReroute - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -192,7 +192,7 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ return nil }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { if m.SourceToTargetAMFInformationReroute == nil { return nil, false } @@ -201,11 +201,11 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ }, }, { - id: IDPartiallyAllowedNSSAI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PartiallyAllowedNSSAI) + ID: IDPartiallyAllowedNSSAI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PartiallyAllowedNSSAI) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { if len(m.PartiallyAllowedNSSAI) == 0 { return nil, false } @@ -238,3 +238,7 @@ func (m *RerouteNASRequest) Marshal() ([]byte, error) { func ParseRerouteNASRequest(value []byte) (*RerouteNASRequest, error) { return parseMessageBody[RerouteNASRequest](ProcRerouteNASRequest, TriggeringInitiatingMessage, rerouteNASRequestIEs, value) } + +func DecodeRerouteNASRequest(value []byte) (*RerouteNASRequest, error) { + return decodeMessageBody[RerouteNASRequest](ProcRerouteNASRequest, rerouteNASRequestIEs, value) +} diff --git a/ngap/reset_extensions_test.go b/ngap/reset_extensions_test.go index e1d9d40d58..a272a30a9a 100644 --- a/ngap/reset_extensions_test.go +++ b/ngap/reset_extensions_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) type handItem struct { @@ -86,14 +87,14 @@ func handNGReset(t *testing.T, items []handItem) []byte { mustNil(t, per.EncodeConstrainedWholeNumber(rt, per.Aligned, 0, resetTypeAlternatives-1, resetTypePartOfNGInterface)) encodeHandList(t, rt, items) - cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + cause, err := per.Marshal(Ptr(CauseMisc(0).Cause())) mustNil(t, err) body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {id: IDCause, crit: CriticalityIgnore, raw: cause}, - {id: IDResetType, crit: CriticalityReject, raw: rt.Bytes()}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, + {ID: IDResetType, Criticality: CriticalityReject, Value: ap.RawValue(rt.Bytes())}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcNGReset, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -111,7 +112,7 @@ func handNGResetAck(t *testing.T, items []handItem) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {id: IDUEAssociatedLogicalNGConnectionList, crit: CriticalityIgnore, raw: list.Bytes()}, + {ID: IDUEAssociatedLogicalNGConnectionList, Criticality: CriticalityIgnore, Value: ap.RawValue(list.Bytes())}, })) b, err := Marshal(&SuccessfulOutcome{ProcedureCode: ProcNGReset, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -148,10 +149,11 @@ func TestNGResetPreservesItemExtensions(t *testing.T) { t.Fatalf("unmodified NG Reset re-encoded differently\n got % x\nwant % x", out, in) } - for i := range m.ResetType.Part { - if m.ResetType.Part[i].AMFUENGAPID != nil { - v := *m.ResetType.Part[i].AMFUENGAPID - 5 + 0xFFFFFFFFFF - 2 - m.ResetType.Part[i].AMFUENGAPID = &v + part := *m.ResetType.PartOfNGInterface + for i := range part { + if part[i].AMFUENGAPID != nil { + v := *part[i].AMFUENGAPID - 5 + 0xFFFFFFFFFF - 2 + part[i].AMFUENGAPID = &v } } diff --git a/ngap/status_transfer.go b/ngap/status_transfer.go index 6d42c56793..a24bc6bbf1 100644 --- a/ngap/status_transfer.go +++ b/ngap/status_transfer.go @@ -27,27 +27,27 @@ type UplinkRANStatusTransfer struct { var uplinkRANStatusTransferIEs = []ieSpec[UplinkRANStatusTransfer]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkRANStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkRANStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *UplinkRANStatusTransfer) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *UplinkRANStatusTransfer) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkRANStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkRANStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *UplinkRANStatusTransfer) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *UplinkRANStatusTransfer) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDRANStatusTransferTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkRANStatusTransfer, raw []byte, enc per.Encoding) error { - m.Container = StatusTransferContainer(raw) + ID: IDRANStatusTransferTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkRANStatusTransfer, r *per.Reader, enc per.Encoding) error { + m.Container = StatusTransferContainer(restOctets(r)) return nil }, - encode: func(m *UplinkRANStatusTransfer) (per.Marshaler, bool) { + Encode: func(m *UplinkRANStatusTransfer) (per.Marshaler, bool) { if m.Container == nil { return nil, false } @@ -81,6 +81,10 @@ func ParseUplinkRANStatusTransfer(value []byte) (*UplinkRANStatusTransfer, error return parseMessageBody[UplinkRANStatusTransfer](ProcUplinkRANStatusTransfer, TriggeringInitiatingMessage, uplinkRANStatusTransferIEs, value) } +func DecodeUplinkRANStatusTransfer(value []byte) (*UplinkRANStatusTransfer, error) { + return decodeMessageBody[UplinkRANStatusTransfer](ProcUplinkRANStatusTransfer, uplinkRANStatusTransferIEs, value) +} + // TS 38.413 §9.2.3.14. TS 36.413 §9.1.5.14 names the same message MME Status // Transfer and carries the same three IEs with the same criticality. type DownlinkRANStatusTransfer struct { @@ -93,27 +97,27 @@ type DownlinkRANStatusTransfer struct { var downlinkRANStatusTransferIEs = []ieSpec[DownlinkRANStatusTransfer]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkRANStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkRANStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *DownlinkRANStatusTransfer) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *DownlinkRANStatusTransfer) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkRANStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkRANStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *DownlinkRANStatusTransfer) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *DownlinkRANStatusTransfer) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDRANStatusTransferTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkRANStatusTransfer, raw []byte, enc per.Encoding) error { - m.Container = StatusTransferContainer(raw) + ID: IDRANStatusTransferTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkRANStatusTransfer, r *per.Reader, enc per.Encoding) error { + m.Container = StatusTransferContainer(restOctets(r)) return nil }, - encode: func(m *DownlinkRANStatusTransfer) (per.Marshaler, bool) { + Encode: func(m *DownlinkRANStatusTransfer) (per.Marshaler, bool) { if m.Container == nil { return nil, false } @@ -146,3 +150,7 @@ func (m *DownlinkRANStatusTransfer) Marshal() ([]byte, error) { func ParseDownlinkRANStatusTransfer(value []byte) (*DownlinkRANStatusTransfer, error) { return parseMessageBody[DownlinkRANStatusTransfer](ProcDownlinkRANStatusTransfer, TriggeringInitiatingMessage, downlinkRANStatusTransferIEs, value) } + +func DecodeDownlinkRANStatusTransfer(value []byte) (*DownlinkRANStatusTransfer, error) { + return decodeMessageBody[DownlinkRANStatusTransfer](ProcDownlinkRANStatusTransfer, downlinkRANStatusTransferIEs, value) +} diff --git a/ngap/symmetry_test.go b/ngap/symmetry_test.go deleted file mode 100644 index 306862b1da..0000000000 --- a/ngap/symmetry_test.go +++ /dev/null @@ -1,491 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package ngap - -import ( - "go/ast" - "go/parser" - "go/token" - "os" - "path/filepath" - "slices" - "sort" - "strings" - "testing" -) - -const s1apDir = "../s1ap" - -// The files the two specs share a design for. Their declarations are named for -// the machinery rather than either protocol, so a faithful transposition uses -// identical names. Message and IE files are absent: each is its own vocabulary. -var engineFiles = []string{ - "cause.go", - "common.go", - "criticality_diagnostics.go", - "errors.go", - "ie_table.go", - "ies.go", - "pdu.go", -} - -// Declarations allowed on one side only. An entry is a claim that 3GPP requires -// the asymmetry; anything else is drift. -var mandatedDeviations = map[string]string{ - // TS 38.413 §9.3 closes its CHOICEs with a choice-Extensions alternative - // carrying an open IE container, where TS 36.413 marks them extensible. - "ngap only: func decodeChoiceExtension": "NGAP choice-Extensions (TS 38.413 §9.3)", - - // NGAP lists are plain SEQUENCE OF Item; S1AP wraps its E-RAB list items - // in ProtocolIE-SingleContainer, which needs a list codec NGAP has no use - // for (TS 36.413 §9.1.3 vs TS 38.413 §9.3.1). - "s1ap only: func encodeSingleContainerList": "S1AP ProtocolIE-SingleContainer lists (TS 36.413 §9.1.3)", - "s1ap only: func decodeItemList": "S1AP ProtocolIE-SingleContainer lists (TS 36.413 §9.1.3)", - "s1ap only: type containerCrit": "S1AP E-RAB-IE-ContainerList elements carry their own criticality (TS 36.413 §9.3, E-RAB-IE-ContainerList)", - "s1ap only: type containerCritical": "S1AP E-RAB-IE-ContainerList elements carry their own criticality (TS 36.413 §9.3, E-RAB-IE-ContainerList)", - "s1ap only: func (containerCrit) wireCriticality": "S1AP E-RAB-IE-ContainerList elements carry their own criticality (TS 36.413 §9.3, E-RAB-IE-ContainerList)", - - // PATH SWITCH REQUEST FAILURE reports a mandatory released session list in - // NGAP (TS 38.413 §9.2.3.10) and a mandatory Cause with no list in S1AP - // (TS 36.413 §9.1.5.10), so only NGAP has to recover the sessions from a - // rejected request to build the message at all. - "ngap only: func (AbstractSyntaxError) PathSwitchSessions": "NGAP PathSwitchRequestFailure released list is mandatory (TS 38.413 §9.2.3.10)", -} - -// ngapOnlyFiles' mirror, so a file added to one side and forgotten on the other -// is caught whichever side it landed on. -var s1apOnlyFiles = map[string]string{ - "erab_lists.go": "E-RAB-IE-ContainerList of ProtocolIE-SingleContainer per user-plane E-RAB list; NGAP lists are plain SEQUENCE OF (TS 36.413 §9.3, TS 38.413 §9.3)", -} - -// S1AP files whose NGAP counterparts are not written yet — outstanding work, -// not a mandated asymmetry. Entries are deleted as counterparts appear, so the -// list empties itself. A file that exists on both sides under different names -// belongs in renamedFiles, which is consulted first and actually verifies the -// counterpart; an entry here would never be reached. -var pendingNGAPMigration = map[string]struct{}{} - -// Same thing, different name per spec. Both sides must still exist. -var renamedFiles = map[string]string{ - // TS 38.413 names the procedure NG Reset where TS 36.413 names it Reset. - "ng_reset.go": "reset.go", - "ng_reset_test.go": "reset_test.go", - "ng_setup.go": "s1_setup.go", - "ng_setup_resp.go": "s1_setup_resp.go", - "ng_setup_failure.go": "s1_setup_failure.go", - "ng_setup_test.go": "s1_setup_test.go", - "ng_setup_resp_test.go": "s1_setup_resp_test.go", - "ng_setup_failure_test.go": "s1_setup_failure_test.go", - - // TS 38.413 carries user plane in PDU sessions where TS 36.413 carries it in - // E-RABs, so each session-oriented procedure is named after its own bearer. - "pdu_session_resource_setup.go": "erab_setup.go", - "pdu_session_resource_release.go": "erab_release.go", - "pdu_session_resource_modify.go": "erab_modify.go", - "pdu_session_resource_modify_indication.go": "erab_modification.go", - "pdu_session_resource_modify_indication_test.go": "erab_modification_test.go", - "pdu_session_resource_modify_test.go": "erab_modify_test.go", - "pdu_session_resource_release_test.go": "erab_release_test.go", - "pdu_session_resource_setup_test.go": "erab_setup_test.go", - - // TS 38.413 names the procedure UE Radio Capability Info Indication where - // TS 36.413 names it UE Capability Info Indication. - "ue_radio_capability.go": "ue_capability.go", - "ue_radio_capability_test.go": "ue_capability_test.go", - - // TS 38.413 carries LMF signalling as NRPPa where TS 36.413 carries the - // E-SMLC's as LPPa (TS 38.455 / TS 36.455). - "nrppa_transport.go": "lppa_transport.go", - "nrppa_transport_test.go": "lppa_transport_test.go", - - // TS 38.413 names the NG-RAN node's update RAN Configuration Update where - // TS 36.413 names the eNB's ENB Configuration Update. - "ran_config_update.go": "enb_config_update.go", - "ran_config_update_test.go": "enb_config_update_test.go", - - "amf_config_update.go": "mme_config_update.go", - "amf_config_update_test.go": "mme_config_update_test.go", - - // GUAMI replaces GUMMEI and is bit-string rather than octet shaped - // (TS 38.413 §9.3.3.3). - "ie_guami.go": "ie_gummei.go", - - // 3GPP scopes these QoS parameters to E-RABs in TS 36.413 and to QoS flows - // in TS 38.413, so each library names the file after its own bearer. - "ie_qos.go": "ie_erab.go", - "ie_qos_test.go": "ie_erab_test.go", -} - -// NGAP-only IE vocabulary, and message files for procedures 3GPP defines only -// for NGAP. Nothing else. -var ngapOnlyFiles = map[string]string{ - "ie_slice.go": "S-NSSAI and the slice support lists have no S1AP counterpart (TS 38.413 §9.3.1.24)", - "pdu_session_resource_notify.go": "TS 36.413 defines no E-RAB Notify: an eNB reports a changed bearer through E-RAB Modification Indication and a self-initiated release through E-RAB Release Indication (TS 38.413 §8.2.6)", - - "pdu_session_resource_notify_test.go": "tests for pdu_session_resource_notify.go", - "handover_transfer.go": "the §9.3.4 transfers have no S1AP counterpart: TS 36.413 defines no OCTET STRING (CONTAINING ...) at all and carries the forwarding tunnels as plain IEs in the message body (TS 38.413 §9.3.4)", - "handover_transfer_test.go": "tests for handover_transfer.go", - "ie_tnl.go": "NG-RAN TNL association removal has no S1AP counterpart: ENB CONFIGURATION UPDATE cannot remove SCTP endpoints (TS 38.413 §9.3.2.6, §9.2.6.4)", - "ie_tnl_test.go": "tests for ie_tnl.go", - "ie_transport_test.go": "UPTransportLayerInformation is a CHOICE closed by choice-Extensions; S1AP carries the user-plane endpoint as a bare address and GTP-TEID pair inside each E-RAB item (TS 38.413 §9.3.2.1)", - "amf_status_indication.go": "TS 36.413 defines no procedure signalling that core-network identities are unavailable: mMEStatusTransfer is UE-associated handover status and Overload Start/Stop is overload control (TS 38.413 §8.7.6)", - "amf_status_indication_test.go": "tests for amf_status_indication.go", - "not_comprehended_test.go": "§10.3.1 case 6 reached through choice-Extensions, which only NGAP has (TS 38.413 §9.3)", - "symmetry_test.go": "this file: the checker lives on one side", - "ue_tnla_binding_release.go": "TS 36.413 defines no UE TNLA binding and so no procedure to release one (TS 38.413 §8.13.1)", - "ue_tnla_binding_release_test.go": "tests for ue_tnla_binding_release.go", -} - -// A type on both sides must live in the same-named file, so the two can be read -// side by side. -func TestFileNamesAreSymmetric(t *testing.T) { - if _, err := os.Stat(s1apDir); err != nil { - t.Skipf("s1ap module not present at %s: %v", s1apDir, err) - } - - theirs := map[string]bool{} - for _, n := range goFiles(t, s1apDir) { - theirs[n] = true - } - - for _, name := range goFiles(t, ".") { - if theirs[name] { - continue - } - - if counterpart, ok := renamedFiles[name]; ok { - if !theirs[counterpart] { - t.Errorf("ngap/%s is mapped to s1ap/%s, which does not exist", name, counterpart) - } - - continue - } - - if reason, ok := ngapOnlyFiles[name]; ok { - t.Logf("permitted ngap-only file — %s: %s", name, reason) - - continue - } - - t.Errorf("ngap/%s has no s1ap counterpart.\n"+ - "\tEither name it after the file s1ap keeps the same types in, or add it to "+ - "ngapOnlyFiles with the reason it is NGAP-only.", name) - } - - for name, reason := range ngapOnlyFiles { - if theirs[name] { - t.Errorf("ngapOnlyFiles claims %s is NGAP-only (%q), but s1ap has it too", name, reason) - } - } - - // The same check the other way. - ours := map[string]bool{} - for _, n := range goFiles(t, ".") { - ours[n] = true - } - - renamedToNGAP := map[string]string{} - for ngapName, s1apName := range renamedFiles { - renamedToNGAP[s1apName] = ngapName - } - - for _, name := range goFiles(t, s1apDir) { - if ours[name] { - continue - } - - if counterpart, ok := renamedToNGAP[name]; ok { - if !ours[counterpart] { - t.Errorf("s1ap/%s is mapped to ngap/%s, which does not exist", name, counterpart) - } - - continue - } - - if reason, ok := s1apOnlyFiles[name]; ok { - t.Logf("permitted s1ap-only file — %s: %s", name, reason) - - continue - } - - if _, ok := pendingNGAPMigration[name]; ok { - continue - } - - t.Errorf("s1ap/%s has no ngap counterpart.\n"+ - "\tEither name it after the file ngap keeps the same types in, or add it to "+ - "s1apOnlyFiles with the reason it is S1AP-only.", name) - } - - for name, reason := range s1apOnlyFiles { - if ours[name] { - t.Errorf("s1apOnlyFiles claims %s is S1AP-only (%q), but ngap has it too", name, reason) - } - } - - for name := range pendingNGAPMigration { - if ours[name] { - t.Errorf("ngap/%s now exists; drop %s from pendingNGAPMigration", name, name) - } - } -} - -// per_gen.go is excluded: it tracks whatever pergen was pointed at. -func goFiles(t *testing.T, dir string) []string { - t.Helper() - - entries, err := os.ReadDir(dir) - if err != nil { - t.Fatalf("read %s: %v", dir, err) - } - - var out []string - - for _, e := range entries { - name := e.Name() - if e.IsDir() || filepath.Ext(name) != ".go" || name == "per_gen.go" { - continue - } - - out = append(out, name) - } - - sort.Strings(out) - - return out -} - -// The machine-checked half of the rule that ngap and s1ap are one design over -// two specifications. -func TestEngineIsSymmetricWithS1AP(t *testing.T) { - if _, err := os.Stat(s1apDir); err != nil { - t.Skipf("s1ap module not present at %s: %v", s1apDir, err) - } - - ours := engineDecls(t, ".") - theirs := engineDecls(t, s1apDir) - - var unexplained []string - - for _, d := range ours { - if !slices.Contains(theirs, d) { - unexplained = append(unexplained, check(t, "ngap only: "+d)) - } - } - - for _, d := range theirs { - if !slices.Contains(ours, d) { - unexplained = append(unexplained, check(t, "s1ap only: "+d)) - } - } - - for _, u := range unexplained { - if u == "" { - continue - } - - t.Errorf("%s\n\tThe engine files are meant to be the same design in both libraries. "+ - "Either make the change in both, or add the declaration to mandatedDeviations "+ - "with the TS clause that forces it.", u) - } -} - -// check reports the deviation unless it is one 3GPP mandates. -func check(t *testing.T, key string) string { - t.Helper() - - if reason, ok := mandatedDeviations[key]; ok { - t.Logf("permitted asymmetry — %s: %s", key, reason) - - return "" - } - - return key -} - -// So the allowlist cannot rot into a blanket excuse. -func TestMandatedDeviationsAreAllReal(t *testing.T) { - if _, err := os.Stat(s1apDir); err != nil { - t.Skipf("s1ap module not present at %s: %v", s1apDir, err) - } - - ours := engineDecls(t, ".") - theirs := engineDecls(t, s1apDir) - - for key := range mandatedDeviations { - side, decl, ok := strings.Cut(key, " only: ") - if !ok { - t.Errorf("malformed allowlist key %q, want \" only: \"", key) - - continue - } - - var have, lack []string - - switch side { - case "ngap": - have, lack = ours, theirs - case "s1ap": - have, lack = theirs, ours - default: - t.Errorf("allowlist key %q names unknown library %q", key, side) - - continue - } - - if !slices.Contains(have, decl) { - t.Errorf("allowlist claims %s declares %q, but it does not — remove the entry", side, decl) - } - - if slices.Contains(lack, decl) { - t.Errorf("allowlist claims only %s declares %q, but both do — remove the entry", side, decl) - } - } -} - -// Type methods in these files are each protocol's own vocabulary; their free -// functions are shared plumbing, and one library growing a helper the other -// open-codes is drift. -var helperFiles = []string{ - "ie_common.go", - "per_leaf.go", -} - -func TestHelperFuncsAreSymmetric(t *testing.T) { - if _, err := os.Stat(s1apDir); err != nil { - t.Skipf("s1ap module not present at %s: %v", s1apDir, err) - } - - ours := helperFuncs(t, ".") - theirs := helperFuncs(t, s1apDir) - - var unexplained []string - - for _, d := range ours { - if !slices.Contains(theirs, d) { - unexplained = append(unexplained, check(t, "ngap only: "+d)) - } - } - - for _, d := range theirs { - if !slices.Contains(ours, d) { - unexplained = append(unexplained, check(t, "s1ap only: "+d)) - } - } - - for _, u := range unexplained { - if u == "" { - continue - } - - t.Errorf("%s\n\tShared helpers are meant to exist in both libraries. Either add it "+ - "to the other side, or add the declaration to mandatedDeviations with the TS "+ - "clause that forces it.", u) - } -} - -// Methods are skipped: their receiver is a protocol-specific IE type. -func helperFuncs(t *testing.T, dir string) []string { - t.Helper() - - var out []string - - fset := token.NewFileSet() - - for _, name := range helperFiles { - path := filepath.Join(dir, name) - - src, err := os.ReadFile(path) - if err != nil { - t.Errorf("read %s: %v", path, err) - - continue - } - - f, err := parser.ParseFile(fset, path, src, 0) - if err != nil { - t.Fatalf("parse %s: %v", path, err) - } - - for _, decl := range f.Decls { - d, ok := decl.(*ast.FuncDecl) - if !ok || d.Recv != nil { - continue - } - - out = append(out, funcDecl(d)) - } - } - - sort.Strings(out) - - return out -} - -// Types and functions only: constants and variables hold each protocol's own -// procedure codes, IE ids and cause values, which the ground-truth tests pin. -func engineDecls(t *testing.T, dir string) []string { - t.Helper() - - var out []string - - fset := token.NewFileSet() - - for _, name := range engineFiles { - path := filepath.Join(dir, name) - - src, err := os.ReadFile(path) - if err != nil { - // A file one library has and the other does not is itself drift. - t.Errorf("read %s: %v", path, err) - - continue - } - - f, err := parser.ParseFile(fset, path, src, 0) - if err != nil { - t.Fatalf("parse %s: %v", path, err) - } - - for _, decl := range f.Decls { - switch d := decl.(type) { - case *ast.FuncDecl: - out = append(out, funcDecl(d)) - case *ast.GenDecl: - if d.Tok != token.TYPE { - continue - } - - for _, spec := range d.Specs { - if ts, ok := spec.(*ast.TypeSpec); ok { - out = append(out, "type "+ts.Name.Name) - } - } - } - } - } - - sort.Strings(out) - - return out -} - -// The receiver's pointer-ness is dropped: a Go choice, not a design one. -func funcDecl(d *ast.FuncDecl) string { - if d.Recv == nil || len(d.Recv.List) == 0 { - return "func " + d.Name.Name - } - - recv := d.Recv.List[0].Type - if star, ok := recv.(*ast.StarExpr); ok { - recv = star.X - } - - name := "?" - if id, ok := recv.(*ast.Ident); ok { - name = id.Name - } - - return "func (" + name + ") " + d.Name.Name -} diff --git a/ngap/table_order_test.go b/ngap/table_order_test.go index e29cb7117a..780c5feb84 100644 --- a/ngap/table_order_test.go +++ b/ngap/table_order_test.go @@ -4,6 +4,7 @@ package ngap import ( + "slices" "testing" ) @@ -12,117 +13,104 @@ import ( // is the order encode emits them in. IEs a table does not model are not pinned. func TestTableOrderMatchesASN1(t *testing.T) { tests := []struct { - name string - got []ProtocolIEID - want []ProtocolIEID + name string + got []tableRowSpec + asn1 string + container string }{ - {"AMFStatusIndication", tableIDs(aMFStatusIndicationIEs), []ProtocolIEID{IDUnavailableGUAMIList}}, - {"ErrorIndication", tableIDs(errorIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCause, IDCriticalityDiagnostics, IDFiveGSTMSI}}, - {"NGReset", tableIDs(nGResetIEs), []ProtocolIEID{IDCause, IDResetType}}, - {"NGResetAcknowledge", tableIDs(nGResetAcknowledgeIEs), []ProtocolIEID{IDUEAssociatedLogicalNGConnectionList, IDCriticalityDiagnostics}}, - {"NGSetupRequest", tableIDs(nGSetupRequestIEs), []ProtocolIEID{IDGlobalRANNodeID, IDRANNodeName, IDSupportedTAList, IDDefaultPagingDRX, IDUERetentionInformation}}, - {"NGSetupResponse", tableIDs(nGSetupResponseIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList, IDCriticalityDiagnostics, IDUERetentionInformation, IDExtendedAMFName}}, - {"NGSetupFailure", tableIDs(nGSetupFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, - {"NASNonDeliveryIndication", tableIDs(nASNonDeliveryIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDCause}}, - {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDRANUENGAPID, IDNASPDU, IDUserLocationInformation, IDRRCEstablishmentCause, IDFiveGSTMSI, IDAMFSetID, IDUEContextRequest, IDAllowedNSSAI, IDGUAMI, IDGUAMIType, IDRequestedNSSAI}}, - {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU}}, - {"UplinkNASTransport", tableIDs(uplinkNASTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDUserLocationInformation}}, - {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate, IDGUAMI, IDPDUSessionResourceSetupListCxtReq, IDAllowedNSSAI, IDUESecurityCapabilities, IDSecurityKey, IDTraceActivation, IDUERadioCapability, IDNASPDU, IDUERadioCapabilityForPaging, IDAMFUENGAPID2}}, - {"InitialContextSetupResponse", tableIDs(initialContextSetupResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceSetupListCxtRes, IDPDUSessionResourceFailedToSetupListCxtRes, IDCriticalityDiagnostics}}, - {"InitialContextSetupFailure", tableIDs(initialContextSetupFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceFailedToSetupListCxtFail, IDCause, IDCriticalityDiagnostics}}, - {"HandoverRequired", tableIDs(handoverRequiredIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDHandoverType, IDCause, IDTargetID, IDDirectForwardingPathAvailability, IDPDUSessionResourceListHORqd, IDSourceToTargetTransparentContainer}}, - {"HandoverCommand", tableIDs(handoverCommandIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDHandoverType, IDNASSecurityParametersFromNGRAN, IDPDUSessionResourceHandoverList, IDPDUSessionResourceToReleaseListHOCmd, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, - {"HandoverPreparationFailure", tableIDs(handoverPreparationFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCause, IDCriticalityDiagnostics, IDTargettoSourceFailureTransparentContainer}}, - {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDHandoverType, IDCause, IDUEAggregateMaximumBitRate, IDUESecurityCapabilities, IDSecurityContext, IDNewSecurityContextInd, IDNASC, IDPDUSessionResourceSetupListHOReq, IDAllowedNSSAI, IDTraceActivation, IDSourceToTargetTransparentContainer, IDMobilityRestrictionList, IDGUAMI, IDAMFUENGAPID2, IDTargetRANNodeID}}, - {"HandoverRequestAcknowledge", tableIDs(handoverRequestAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceAdmittedList, IDPDUSessionResourceFailedToSetupListHOAck, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, - {"HandoverFailure", tableIDs(handoverFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDCause, IDCriticalityDiagnostics, IDTargettoSourceFailureTransparentContainer}}, - {"DownlinkUEAssociatedNRPPaTransport", tableIDs(downlinkUEAssociatedNRPPaTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRoutingID, IDNRPPaPDU}}, - {"UplinkUEAssociatedNRPPaTransport", tableIDs(uplinkUEAssociatedNRPPaTransportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRoutingID, IDNRPPaPDU}}, - {"DownlinkNonUEAssociatedNRPPaTransport", tableIDs(downlinkNonUEAssociatedNRPPaTransportIEs), []ProtocolIEID{IDRoutingID, IDNRPPaPDU}}, - {"UplinkNonUEAssociatedNRPPaTransport", tableIDs(uplinkNonUEAssociatedNRPPaTransportIEs), []ProtocolIEID{IDRoutingID, IDNRPPaPDU}}, - {"LocationReport", tableIDs(locationReportIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDUEPresenceInAreaOfInterestList, IDLocationReportingRequestType}}, - {"LocationReportingControl", tableIDs(locationReportingControlIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDLocationReportingRequestType}}, - {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDRANUENGAPID, IDSourceAMFUENGAPID, IDUserLocationInformation, IDUESecurityCapabilities, IDPDUSessionResourceToBeSwitchedDLList, IDPDUSessionResourceFailedToSetupListPSReq, IDSourceAMFGUAMI}}, - {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUESecurityCapabilities, IDSecurityContext, IDPDUSessionResourceSwitchedList, IDPDUSessionResourceReleasedListPSAck, IDAllowedNSSAI, IDCriticalityDiagnostics, IDAMFUENGAPID2}}, - {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceReleasedListPSFail, IDCriticalityDiagnostics}}, - {"UplinkRANStatusTransfer", tableIDs(uplinkRANStatusTransferIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRANStatusTransferTransparentContainer}}, - {"DownlinkRANStatusTransfer", tableIDs(downlinkRANStatusTransferIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDRANStatusTransferTransparentContainer}}, - {"HandoverNotify", tableIDs(handoverNotifyIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDNotifySourceNGRANNode}}, - {"TraceStart", tableIDs(traceStartIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDTraceActivation}}, - {"TraceFailureIndication", tableIDs(traceFailureIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNGRANTraceID, IDCause}}, - {"HandoverCancel", tableIDs(handoverCancelIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCause}}, - {"HandoverCancelAcknowledge", tableIDs(handoverCancelAcknowledgeIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCriticalityDiagnostics}}, - {"PDUSessionResourceNotify", tableIDs(pDUSessionResourceNotifyIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceNotifyList, IDPDUSessionResourceReleasedListNot, IDUserLocationInformation}}, - {"PDUSessionResourceModifyIndication", tableIDs(pDUSessionResourceModifyIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceModifyListModInd, IDUserLocationInformation}}, - {"PDUSessionResourceModifyConfirm", tableIDs(pDUSessionResourceModifyConfirmIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceModifyListModCfm, IDPDUSessionResourceFailedToModifyListModCfm, IDCriticalityDiagnostics}}, - {"PDUSessionResourceModifyRequest", tableIDs(pDUSessionResourceModifyRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceModifyListModReq}}, - {"PDUSessionResourceModifyResponse", tableIDs(pDUSessionResourceModifyResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceModifyListModRes, IDPDUSessionResourceFailedToModifyListModRes, IDUserLocationInformation, IDCriticalityDiagnostics}}, - {"PDUSessionResourceReleaseCommand", tableIDs(pDUSessionResourceReleaseCommandIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDPDUSessionResourceToReleaseListRelCmd}}, - {"PDUSessionResourceReleaseResponse", tableIDs(pDUSessionResourceReleaseResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceReleasedListRelRes, IDUserLocationInformation, IDCriticalityDiagnostics}}, - {"PDUSessionResourceSetupRequest", tableIDs(pDUSessionResourceSetupRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDNASPDU, IDPDUSessionResourceSetupListSUReq, IDUEAggregateMaximumBitRate}}, - {"PDUSessionResourceSetupResponse", tableIDs(pDUSessionResourceSetupResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceSetupListSURes, IDPDUSessionResourceFailedToSetupListSURes, IDCriticalityDiagnostics, IDUserLocationInformation}}, - {"UERadioCapabilityInfoIndication", tableIDs(uERadioCapabilityInfoIndicationIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUERadioCapability, IDUERadioCapabilityForPaging}}, - {"UEContextModificationRequest", tableIDs(uEContextModificationRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUEAggregateMaximumBitRate, IDNewAMFUENGAPID}}, - {"UEContextModificationResponse", tableIDs(uEContextModificationResponseIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDCriticalityDiagnostics}}, - {"UEContextModificationFailure", tableIDs(uEContextModificationFailureIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDCause, IDCriticalityDiagnostics}}, - {"UEContextReleaseRequest", tableIDs(uEContextReleaseRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDPDUSessionResourceListCxtRelReq, IDCause, IDGWContextReleaseIndication}}, - {"UEContextReleaseCommand", tableIDs(uEContextReleaseCommandIEs), []ProtocolIEID{IDUENGAPIDs, IDCause}}, - {"UEContextReleaseComplete", tableIDs(uEContextReleaseCompleteIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID, IDUserLocationInformation, IDPDUSessionResourceListCxtRelCpl, IDCriticalityDiagnostics}}, - {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEPagingIdentity, IDPagingDRX, IDTAIListForPaging, IDPagingPriority, IDUERadioCapabilityForPaging, IDPagingOrigin}}, - {"RANConfigurationUpdate", tableIDs(rANConfigurationUpdateIEs), []ProtocolIEID{IDRANNodeName, IDSupportedTAList, IDDefaultPagingDRX, IDGlobalRANNodeID, IDNGRANTNLAssociationToRemoveList}}, - {"AMFConfigurationUpdate", tableIDs(aMFConfigurationUpdateIEs), []ProtocolIEID{IDAMFName, IDServedGUAMIList, IDRelativeAMFCapacity, IDPLMNSupportList, IDAMFTNLAssociationToAddList, IDAMFTNLAssociationToRemoveList, IDAMFTNLAssociationToUpdateList, IDExtendedAMFName}}, - {"PLMNSupportItem extensions", tableIDs(pLMNSupportItemExtIEs), []ProtocolIEID{IDNPNSupport, IDExtendedSliceSupportList, IDOnboardingSupport}}, - {"AMFTNLAssociationToRemoveItem extensions", tableIDs(aMFTNLAssociationToRemoveItemExtIEs), []ProtocolIEID{IDTNLAssociationTransportLayerAddressNGRAN}}, - {"ServedGUAMIItem extensions", tableIDs(servedGUAMIItemExtIEs), []ProtocolIEID{IDGUAMIType, IDExtendedBackupAMFName}}, - {"UnavailableGUAMIItem extensions", tableIDs(unavailableGUAMIItemExtIEs), []ProtocolIEID{IDExtendedBackupAMFName}}, - {"OverloadStart", tableIDs(overloadStartIEs), []ProtocolIEID{IDAMFOverloadResponse, IDAMFTrafficLoadReductionIndication, IDOverloadStartNSSAIList, IDGUAMIList}}, - {"OverloadStop", tableIDs(overloadStopIEs), []ProtocolIEID{IDGUAMIList}}, - {"AMFConfigurationUpdateAcknowledge", tableIDs(aMFConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDAMFTNLAssociationSetupList, IDAMFTNLAssociationFailedToSetupList, IDCriticalityDiagnostics}}, - {"UETNLABindingReleaseRequest", tableIDs(uETNLABindingReleaseRequestIEs), []ProtocolIEID{IDAMFUENGAPID, IDRANUENGAPID}}, - {"AMFConfigurationUpdateFailure", tableIDs(aMFConfigurationUpdateFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, - {"RANConfigurationUpdateAcknowledge", tableIDs(rANConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, - {"UplinkRANConfigurationTransfer", tableIDs(uplinkRANConfigurationTransferIEs), []ProtocolIEID{IDSONConfigurationTransferUL}}, - {"DownlinkRANConfigurationTransfer", tableIDs(downlinkRANConfigurationTransferIEs), []ProtocolIEID{IDSONConfigurationTransferDL}}, - {"RANConfigurationUpdateFailure", tableIDs(rANConfigurationUpdateFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, + {"AMFStatusIndication", tableRows(aMFStatusIndicationIEs), "AMFStatusIndication", "ProtocolIE-Container"}, + {"ErrorIndication", tableRows(errorIndicationIEs), "ErrorIndication", "ProtocolIE-Container"}, + {"NGReset", tableRows(nGResetIEs), "NGReset", "ProtocolIE-Container"}, + {"NGResetAcknowledge", tableRows(nGResetAcknowledgeIEs), "NGResetAcknowledge", "ProtocolIE-Container"}, + {"NGSetupRequest", tableRows(nGSetupRequestIEs), "NGSetupRequest", "ProtocolIE-Container"}, + {"NGSetupResponse", tableRows(nGSetupResponseIEs), "NGSetupResponse", "ProtocolIE-Container"}, + {"NGSetupFailure", tableRows(nGSetupFailureIEs), "NGSetupFailure", "ProtocolIE-Container"}, + {"NASNonDeliveryIndication", tableRows(nASNonDeliveryIndicationIEs), "NASNonDeliveryIndication", "ProtocolIE-Container"}, + {"InitialUEMessage", tableRows(initialUEMessageIEs), "InitialUEMessage", "ProtocolIE-Container"}, + {"DownlinkNASTransport", tableRows(downlinkNASTransportIEs), "DownlinkNASTransport", "ProtocolIE-Container"}, + {"UplinkNASTransport", tableRows(uplinkNASTransportIEs), "UplinkNASTransport", "ProtocolIE-Container"}, + {"InitialContextSetupRequest", tableRows(initialContextSetupRequestIEs), "InitialContextSetupRequest", "ProtocolIE-Container"}, + {"InitialContextSetupResponse", tableRows(initialContextSetupResponseIEs), "InitialContextSetupResponse", "ProtocolIE-Container"}, + {"InitialContextSetupFailure", tableRows(initialContextSetupFailureIEs), "InitialContextSetupFailure", "ProtocolIE-Container"}, + {"HandoverRequired", tableRows(handoverRequiredIEs), "HandoverRequired", "ProtocolIE-Container"}, + {"HandoverCommand", tableRows(handoverCommandIEs), "HandoverCommand", "ProtocolIE-Container"}, + {"HandoverPreparationFailure", tableRows(handoverPreparationFailureIEs), "HandoverPreparationFailure", "ProtocolIE-Container"}, + {"HandoverRequest", tableRows(handoverRequestIEs), "HandoverRequest", "ProtocolIE-Container"}, + {"HandoverRequestAcknowledge", tableRows(handoverRequestAcknowledgeIEs), "HandoverRequestAcknowledge", "ProtocolIE-Container"}, + {"HandoverFailure", tableRows(handoverFailureIEs), "HandoverFailure", "ProtocolIE-Container"}, + {"DownlinkUEAssociatedNRPPaTransport", tableRows(downlinkUEAssociatedNRPPaTransportIEs), "DownlinkUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, + {"UplinkUEAssociatedNRPPaTransport", tableRows(uplinkUEAssociatedNRPPaTransportIEs), "UplinkUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, + {"DownlinkNonUEAssociatedNRPPaTransport", tableRows(downlinkNonUEAssociatedNRPPaTransportIEs), "DownlinkNonUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, + {"UplinkNonUEAssociatedNRPPaTransport", tableRows(uplinkNonUEAssociatedNRPPaTransportIEs), "UplinkNonUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, + {"LocationReport", tableRows(locationReportIEs), "LocationReport", "ProtocolIE-Container"}, + {"LocationReportingControl", tableRows(locationReportingControlIEs), "LocationReportingControl", "ProtocolIE-Container"}, + {"PathSwitchRequest", tableRows(pathSwitchRequestIEs), "PathSwitchRequest", "ProtocolIE-Container"}, + {"PathSwitchRequestAcknowledge", tableRows(pathSwitchRequestAcknowledgeIEs), "PathSwitchRequestAcknowledge", "ProtocolIE-Container"}, + {"PathSwitchRequestFailure", tableRows(pathSwitchRequestFailureIEs), "PathSwitchRequestFailure", "ProtocolIE-Container"}, + {"UplinkRANStatusTransfer", tableRows(uplinkRANStatusTransferIEs), "UplinkRANStatusTransfer", "ProtocolIE-Container"}, + {"DownlinkRANStatusTransfer", tableRows(downlinkRANStatusTransferIEs), "DownlinkRANStatusTransfer", "ProtocolIE-Container"}, + {"HandoverNotify", tableRows(handoverNotifyIEs), "HandoverNotify", "ProtocolIE-Container"}, + {"TraceStart", tableRows(traceStartIEs), "TraceStart", "ProtocolIE-Container"}, + {"TraceFailureIndication", tableRows(traceFailureIndicationIEs), "TraceFailureIndication", "ProtocolIE-Container"}, + {"HandoverCancel", tableRows(handoverCancelIEs), "HandoverCancel", "ProtocolIE-Container"}, + {"HandoverCancelAcknowledge", tableRows(handoverCancelAcknowledgeIEs), "HandoverCancelAcknowledge", "ProtocolIE-Container"}, + {"PDUSessionResourceNotify", tableRows(pDUSessionResourceNotifyIEs), "PDUSessionResourceNotify", "ProtocolIE-Container"}, + {"PDUSessionResourceModifyIndication", tableRows(pDUSessionResourceModifyIndicationIEs), "PDUSessionResourceModifyIndication", "ProtocolIE-Container"}, + {"PDUSessionResourceModifyConfirm", tableRows(pDUSessionResourceModifyConfirmIEs), "PDUSessionResourceModifyConfirm", "ProtocolIE-Container"}, + {"PDUSessionResourceModifyRequest", tableRows(pDUSessionResourceModifyRequestIEs), "PDUSessionResourceModifyRequest", "ProtocolIE-Container"}, + {"PDUSessionResourceModifyResponse", tableRows(pDUSessionResourceModifyResponseIEs), "PDUSessionResourceModifyResponse", "ProtocolIE-Container"}, + {"PDUSessionResourceReleaseCommand", tableRows(pDUSessionResourceReleaseCommandIEs), "PDUSessionResourceReleaseCommand", "ProtocolIE-Container"}, + {"PDUSessionResourceReleaseResponse", tableRows(pDUSessionResourceReleaseResponseIEs), "PDUSessionResourceReleaseResponse", "ProtocolIE-Container"}, + {"PDUSessionResourceSetupRequest", tableRows(pDUSessionResourceSetupRequestIEs), "PDUSessionResourceSetupRequest", "ProtocolIE-Container"}, + {"PDUSessionResourceSetupResponse", tableRows(pDUSessionResourceSetupResponseIEs), "PDUSessionResourceSetupResponse", "ProtocolIE-Container"}, + {"UERadioCapabilityInfoIndication", tableRows(uERadioCapabilityInfoIndicationIEs), "UERadioCapabilityInfoIndication", "ProtocolIE-Container"}, + {"UEContextModificationRequest", tableRows(uEContextModificationRequestIEs), "UEContextModificationRequest", "ProtocolIE-Container"}, + {"UEContextModificationResponse", tableRows(uEContextModificationResponseIEs), "UEContextModificationResponse", "ProtocolIE-Container"}, + {"UEContextModificationFailure", tableRows(uEContextModificationFailureIEs), "UEContextModificationFailure", "ProtocolIE-Container"}, + {"UEContextReleaseRequest", tableRows(uEContextReleaseRequestIEs), "UEContextReleaseRequest", "ProtocolIE-Container"}, + {"UEContextReleaseCommand", tableRows(uEContextReleaseCommandIEs), "UEContextReleaseCommand", "ProtocolIE-Container"}, + {"UEContextReleaseComplete", tableRows(uEContextReleaseCompleteIEs), "UEContextReleaseComplete", "ProtocolIE-Container"}, + {"Paging", tableRows(pagingIEs), "Paging", "ProtocolIE-Container"}, + {"RANConfigurationUpdate", tableRows(rANConfigurationUpdateIEs), "RANConfigurationUpdate", "ProtocolIE-Container"}, + {"AMFConfigurationUpdate", tableRows(aMFConfigurationUpdateIEs), "AMFConfigurationUpdate", "ProtocolIE-Container"}, + {"PLMNSupportItem extensions", tableRows(extIEsPLMNSupportItem), "PLMNSupportItem", "ProtocolExtensionContainer"}, + {"AMFTNLAssociationToRemoveItem extensions", tableRows(extIEsAMFTNLAssociationToRemoveItem), "AMF-TNLAssociationToRemoveItem", "ProtocolExtensionContainer"}, + {"ServedGUAMIItem extensions", tableRows(extIEsServedGUAMIItem), "ServedGUAMIItem", "ProtocolExtensionContainer"}, + {"UnavailableGUAMIItem extensions", tableRows(extIEsUnavailableGUAMIItem), "UnavailableGUAMIItem", "ProtocolExtensionContainer"}, + {"OverloadStart", tableRows(overloadStartIEs), "OverloadStart", "ProtocolIE-Container"}, + {"OverloadStop", tableRows(overloadStopIEs), "OverloadStop", "ProtocolIE-Container"}, + {"AMFConfigurationUpdateAcknowledge", tableRows(aMFConfigurationUpdateAcknowledgeIEs), "AMFConfigurationUpdateAcknowledge", "ProtocolIE-Container"}, + {"UETNLABindingReleaseRequest", tableRows(uETNLABindingReleaseRequestIEs), "UETNLABindingReleaseRequest", "ProtocolIE-Container"}, + {"AMFConfigurationUpdateFailure", tableRows(aMFConfigurationUpdateFailureIEs), "AMFConfigurationUpdateFailure", "ProtocolIE-Container"}, + {"RANConfigurationUpdateAcknowledge", tableRows(rANConfigurationUpdateAcknowledgeIEs), "RANConfigurationUpdateAcknowledge", "ProtocolIE-Container"}, + {"UplinkRANConfigurationTransfer", tableRows(uplinkRANConfigurationTransferIEs), "UplinkRANConfigurationTransfer", "ProtocolIE-Container"}, + {"DownlinkRANConfigurationTransfer", tableRows(downlinkRANConfigurationTransferIEs), "DownlinkRANConfigurationTransfer", "ProtocolIE-Container"}, + {"RANConfigurationUpdateFailure", tableRows(rANConfigurationUpdateFailureIEs), "RANConfigurationUpdateFailure", "ProtocolIE-Container"}, // The §9.3.4 transfer containers reuse the ProtocolIE-Container shape, so // their rows are ordered by the same rule. - {"PDUSessionResourceSetupRequestTransfer", tableIDs(pDUSessionResourceSetupRequestTransferIEs), []ProtocolIEID{IDPDUSessionAggregateMaximumBitRate, IDULNGUUPTNLInformation, IDAdditionalULNGUUPTNLInformation, IDDataForwardingNotPossible, IDPDUSessionType, IDSecurityIndication, IDNetworkInstance, IDQosFlowSetupRequestList, IDDirectForwardingPathAvailability, IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantULNGUUPTNLInformation}}, - {"PDUSessionResourceModifyRequestTransfer", tableIDs(pDUSessionResourceModifyRequestTransferIEs), []ProtocolIEID{IDPDUSessionAggregateMaximumBitRate, IDULNGUUPTNLModifyList, IDNetworkInstance, IDQosFlowAddOrModifyRequestList, IDQosFlowToReleaseList, IDAdditionalULNGUUPTNLInformation, IDAdditionalRedundantULNGUUPTNLInformation, IDRedundantULNGUUPTNLInformation, IDUserPlaneFailureIndication}}, - {"PDUSessionResourceSetupResponseTransfer extensions", tableIDs(pDUSessionResourceSetupResponseTransferExtIEs), []ProtocolIEID{IDRedundantDLQosFlowPerTNLInformation, IDAdditionalRedundantDLQosFlowPerTNLInformation}}, - {"PDUSessionResourceModifyResponseTransfer extensions", tableIDs(pDUSessionResourceModifyResponseTransferExtIEs), []ProtocolIEID{IDAdditionalNGUUPTNLInformation, IDRedundantDLNGUUPTNLInformation, IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantDLQosFlowPerTNLInformation, IDAdditionalRedundantNGUUPTNLInformation}}, - {"PDUSessionResourceModifyIndicationTransfer extensions", tableIDs(pDUSessionResourceModifyIndicationTransferExtIEs), []ProtocolIEID{IDRedundantDLQosFlowPerTNLInformation, IDAdditionalRedundantDLQosFlowPerTNLInformation}}, - {"PDUSessionResourceModifyConfirmTransfer extensions", tableIDs(pDUSessionResourceModifyConfirmTransferExtIEs), []ProtocolIEID{IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantNGUUPTNLInformation}}, - {"PathSwitchRequestTransfer extensions", tableIDs(pathSwitchRequestTransferExtIEs), []ProtocolIEID{IDAdditionalDLQosFlowPerTNLInformation, IDRedundantDLNGUUPTNLInformation, IDRedundantDLNGUTNLInformationReused, IDAdditionalRedundantDLQosFlowPerTNLInformation}}, - {"PathSwitchRequestAcknowledgeTransfer extensions", tableIDs(pathSwitchRequestAcknowledgeTransferExtIEs), []ProtocolIEID{IDAdditionalNGUUPTNLInformation, IDRedundantULNGUUPTNLInformation, IDAdditionalRedundantNGUUPTNLInformation}}, - {"HandoverRequestAcknowledgeTransfer extensions", tableIDs(handoverRequestAcknowledgeTransferExtIEs), []ProtocolIEID{IDAdditionalDLUPTNLInformationForHOList, IDULForwardingUPTNLInformation, IDAdditionalULForwardingUPTNLInformation, IDDataForwardingResponseERABList, IDRedundantDLNGUUPTNLInformation}}, - {"HandoverCommandTransfer extensions", tableIDs(handoverCommandTransferExtIEs), []ProtocolIEID{IDAdditionalDLForwardingUPTNLInformation, IDULForwardingUPTNLInformation, IDAdditionalULForwardingUPTNLInformation, IDDataForwardingResponseERABList}}, - {"UL-NGU-UP-TNLModifyItem extensions", tableIDs(uLNGUUPTNLModifyItemExtIEs), []ProtocolIEID{IDRedundantULNGUUPTNLInformation, IDRedundantDLNGUUPTNLInformation}}, - {"AdditionalDLUPTNLInformationForHOItem extensions", tableIDs(additionalDLUPTNLInformationForHOItemExtIEs), []ProtocolIEID{IDAdditionalRedundantDLNGUUPTNLInformation}}, - {"QosFlowAddOrModifyRequestItem extensions", tableIDs(qosFlowAddOrModifyRequestItemExtIEs), []ProtocolIEID{IDULNGUUPTNLInformation}}, - {"QosFlowAddOrModifyResponseItem extensions", tableIDs(qosFlowAddOrModifyResponseItemExtIEs), []ProtocolIEID{IDDLNGUUPTNLInformation}}, + {"PDUSessionResourceSetupRequestTransfer", tableRows(pDUSessionResourceSetupRequestTransferIEs), "PDUSessionResourceSetupRequestTransfer", "ProtocolIE-Container"}, + {"PDUSessionResourceModifyRequestTransfer", tableRows(pDUSessionResourceModifyRequestTransferIEs), "PDUSessionResourceModifyRequestTransfer", "ProtocolIE-Container"}, + {"PDUSessionResourceSetupResponseTransfer extensions", tableRows(extIEsPDUSessionResourceSetupResponseTransfer), "PDUSessionResourceSetupResponseTransfer", "ProtocolExtensionContainer"}, + {"PDUSessionResourceModifyResponseTransfer extensions", tableRows(extIEsPDUSessionResourceModifyResponseTransfer), "PDUSessionResourceModifyResponseTransfer", "ProtocolExtensionContainer"}, + {"PDUSessionResourceModifyIndicationTransfer extensions", tableRows(extIEsPDUSessionResourceModifyIndicationTransfer), "PDUSessionResourceModifyIndicationTransfer", "ProtocolExtensionContainer"}, + {"PDUSessionResourceModifyConfirmTransfer extensions", tableRows(extIEsPDUSessionResourceModifyConfirmTransfer), "PDUSessionResourceModifyConfirmTransfer", "ProtocolExtensionContainer"}, + {"PathSwitchRequestTransfer extensions", tableRows(extIEsPathSwitchRequestTransfer), "PathSwitchRequestTransfer", "ProtocolExtensionContainer"}, + {"PathSwitchRequestAcknowledgeTransfer extensions", tableRows(extIEsPathSwitchRequestAcknowledgeTransfer), "PathSwitchRequestAcknowledgeTransfer", "ProtocolExtensionContainer"}, + {"HandoverRequestAcknowledgeTransfer extensions", tableRows(extIEsHandoverRequestAcknowledgeTransfer), "HandoverRequestAcknowledgeTransfer", "ProtocolExtensionContainer"}, + {"HandoverCommandTransfer extensions", tableRows(extIEsHandoverCommandTransfer), "HandoverCommandTransfer", "ProtocolExtensionContainer"}, + {"UL-NGU-UP-TNLModifyItem extensions", tableRows(extIEsULNGUUPTNLModifyItem), "UL-NGU-UP-TNLModifyItem", "ProtocolExtensionContainer"}, + {"AdditionalDLUPTNLInformationForHOItem extensions", tableRows(extIEsAdditionalDLUPTNLInformationForHOItem), "AdditionalDLUPTNLInformationForHOItem", "ProtocolExtensionContainer"}, + {"QosFlowAddOrModifyRequestItem extensions", tableRows(extIEsQosFlowAddOrModifyRequestItem), "QosFlowAddOrModifyRequestItem", "ProtocolExtensionContainer"}, + {"QosFlowAddOrModifyResponseItem extensions", tableRows(extIEsQosFlowAddOrModifyResponseItem), "QosFlowAddOrModifyResponseItem", "ProtocolExtensionContainer"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if len(tt.got) != len(tt.want) { - t.Fatalf("%d IEs, want %d: %v vs %v", len(tt.got), len(tt.want), tt.got, tt.want) - } - - for i := range tt.got { - if tt.got[i] != tt.want[i] { - t.Errorf("row %d = %s, want %s", i, tt.got[i], tt.want[i]) - } + want := asn1Rows(t, tt.asn1, tt.container) + if !slices.Equal(tt.got, want) { + t.Fatalf("rows\n %v\nwant\n %v", tt.got, want) } }) } } - -func tableIDs[M any](table []ieSpec[M]) []ProtocolIEID { - ids := make([]ProtocolIEID, len(table)) - for i := range table { - ids[i] = table[i].id - } - - return ids -} diff --git a/ngap/testdata/asn1/NGAP-CommonDataTypes.asn b/ngap/testdata/asn1/NGAP-CommonDataTypes.asn new file mode 100644 index 0000000000..ad5b5bb08a --- /dev/null +++ b/ngap/testdata/asn1/NGAP-CommonDataTypes.asn @@ -0,0 +1,32 @@ +-- ************************************************************** +-- +-- Common definitions +-- +-- ************************************************************** + +NGAP-CommonDataTypes { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-Access (22) modules (3) ngap (1) version1 (1) ngap-CommonDataTypes (3) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +Criticality ::= ENUMERATED { reject, ignore, notify } + +Presence ::= ENUMERATED { optional, conditional, mandatory } + +PrivateIE-ID ::= CHOICE { + local INTEGER (0..65535), + global OBJECT IDENTIFIER +} + +ProcedureCode ::= INTEGER (0..255) + +ProtocolExtensionID ::= INTEGER (0..65535) + +ProtocolIE-ID ::= INTEGER (0..65535) + +TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessful-outcome } + +END diff --git a/ngap/testdata/asn1/NGAP-Constants.asn b/ngap/testdata/asn1/NGAP-Constants.asn new file mode 100644 index 0000000000..fb251628ac --- /dev/null +++ b/ngap/testdata/asn1/NGAP-Constants.asn @@ -0,0 +1,749 @@ +-- ************************************************************** +-- +-- Constant definitions +-- +-- ************************************************************** + +NGAP-Constants { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-Access (22) modules (3) ngap (1) version1 (1) ngap-Constants (4) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + + ProcedureCode, + ProtocolIE-ID +FROM NGAP-CommonDataTypes; + + +-- ************************************************************** +-- +-- Elementary Procedures +-- +-- ************************************************************** + +id-AMFConfigurationUpdate ProcedureCode ::= 0 +id-AMFStatusIndication ProcedureCode ::= 1 +id-CellTrafficTrace ProcedureCode ::= 2 +id-DeactivateTrace ProcedureCode ::= 3 +id-DownlinkNASTransport ProcedureCode ::= 4 +id-DownlinkNonUEAssociatedNRPPaTransport ProcedureCode ::= 5 +id-DownlinkRANConfigurationTransfer ProcedureCode ::= 6 +id-DownlinkRANStatusTransfer ProcedureCode ::= 7 +id-DownlinkUEAssociatedNRPPaTransport ProcedureCode ::= 8 +id-ErrorIndication ProcedureCode ::= 9 +id-HandoverCancel ProcedureCode ::= 10 +id-HandoverNotification ProcedureCode ::= 11 +id-HandoverPreparation ProcedureCode ::= 12 +id-HandoverResourceAllocation ProcedureCode ::= 13 +id-InitialContextSetup ProcedureCode ::= 14 +id-InitialUEMessage ProcedureCode ::= 15 +id-LocationReportingControl ProcedureCode ::= 16 +id-LocationReportingFailureIndication ProcedureCode ::= 17 +id-LocationReport ProcedureCode ::= 18 +id-NASNonDeliveryIndication ProcedureCode ::= 19 +id-NGReset ProcedureCode ::= 20 +id-NGSetup ProcedureCode ::= 21 +id-OverloadStart ProcedureCode ::= 22 +id-OverloadStop ProcedureCode ::= 23 +id-Paging ProcedureCode ::= 24 +id-PathSwitchRequest ProcedureCode ::= 25 +id-PDUSessionResourceModify ProcedureCode ::= 26 +id-PDUSessionResourceModifyIndication ProcedureCode ::= 27 +id-PDUSessionResourceRelease ProcedureCode ::= 28 +id-PDUSessionResourceSetup ProcedureCode ::= 29 +id-PDUSessionResourceNotify ProcedureCode ::= 30 +id-PrivateMessage ProcedureCode ::= 31 +id-PWSCancel ProcedureCode ::= 32 +id-PWSFailureIndication ProcedureCode ::= 33 +id-PWSRestartIndication ProcedureCode ::= 34 +id-RANConfigurationUpdate ProcedureCode ::= 35 +id-RerouteNASRequest ProcedureCode ::= 36 +id-RRCInactiveTransitionReport ProcedureCode ::= 37 +id-TraceFailureIndication ProcedureCode ::= 38 +id-TraceStart ProcedureCode ::= 39 +id-UEContextModification ProcedureCode ::= 40 +id-UEContextRelease ProcedureCode ::= 41 +id-UEContextReleaseRequest ProcedureCode ::= 42 +id-UERadioCapabilityCheck ProcedureCode ::= 43 +id-UERadioCapabilityInfoIndication ProcedureCode ::= 44 +id-UETNLABindingRelease ProcedureCode ::= 45 +id-UplinkNASTransport ProcedureCode ::= 46 +id-UplinkNonUEAssociatedNRPPaTransport ProcedureCode ::= 47 +id-UplinkRANConfigurationTransfer ProcedureCode ::= 48 +id-UplinkRANStatusTransfer ProcedureCode ::= 49 +id-UplinkUEAssociatedNRPPaTransport ProcedureCode ::= 50 +id-WriteReplaceWarning ProcedureCode ::= 51 +id-SecondaryRATDataUsageReport ProcedureCode ::= 52 +id-UplinkRIMInformationTransfer ProcedureCode ::= 53 +id-DownlinkRIMInformationTransfer ProcedureCode ::= 54 +id-RetrieveUEInformation ProcedureCode ::= 55 +id-UEInformationTransfer ProcedureCode ::= 56 +id-RANCPRelocationIndication ProcedureCode ::= 57 +id-UEContextResume ProcedureCode ::= 58 +id-UEContextSuspend ProcedureCode ::= 59 +id-UERadioCapabilityIDMapping ProcedureCode ::= 60 +id-HandoverSuccess ProcedureCode ::= 61 +id-UplinkRANEarlyStatusTransfer ProcedureCode ::= 62 +id-DownlinkRANEarlyStatusTransfer ProcedureCode ::= 63 +id-AMFCPRelocationIndication ProcedureCode ::= 64 +id-ConnectionEstablishmentIndication ProcedureCode ::= 65 +id-BroadcastSessionModification ProcedureCode ::= 66 +id-BroadcastSessionRelease ProcedureCode ::= 67 +id-BroadcastSessionSetup ProcedureCode ::= 68 +id-DistributionSetup ProcedureCode ::= 69 +id-DistributionRelease ProcedureCode ::= 70 +id-MulticastSessionActivation ProcedureCode ::= 71 +id-MulticastSessionDeactivation ProcedureCode ::= 72 +id-MulticastSessionUpdate ProcedureCode ::= 73 +id-MulticastGroupPaging ProcedureCode ::= 74 +id-BroadcastSessionReleaseRequired ProcedureCode ::= 75 +id-TimingSynchronisationStatus ProcedureCode ::= 76 +id-TimingSynchronisationStatusReport ProcedureCode ::= 77 +id-MTCommunicationHandling ProcedureCode ::= 78 +id-RANPagingRequest ProcedureCode ::= 79 +id-BroadcastSessionTransport ProcedureCode ::= 80 +id-NGRemoval ProcedureCode ::= 81 +id-InventoryRequest ProcedureCode ::= 82 +id-InventoryReport ProcedureCode ::= 83 +id-CommandRequest ProcedureCode ::= 84 +id-AIOTSessionRelease ProcedureCode ::= 85 +id-AIOTSessionReleaseRequest ProcedureCode ::= 86 + + + +-- ************************************************************** +-- +-- Extension constants +-- +-- ************************************************************** + +maxPrivateIEs INTEGER ::= 65535 +maxProtocolExtensions INTEGER ::= 65535 +maxProtocolIEs INTEGER ::= 65535 + +-- ************************************************************** +-- +-- Lists +-- +-- ************************************************************** + + maxnoofAllowedAreas INTEGER ::= 16 + maxnoofAllowedCAGsperPLMN INTEGER ::= 256 + maxnoofAllowedS-NSSAIs INTEGER ::= 8 + maxnoofBluetoothName INTEGER ::= 4 + maxnoofBPLMNs INTEGER ::= 12 + maxnoofCAGSperCell INTEGER ::= 64 + maxnoofCellIDforMDT INTEGER ::= 32 + maxnoofCellIDforWarning INTEGER ::= 65535 + maxnoofCellinAoI INTEGER ::= 256 + maxnoofCellinEAI INTEGER ::= 65535 + maxnoofCellinTAI INTEGER ::= 65535 + maxnoofCellsforMBS INTEGER ::= 8192 + maxnoofCellsingNB INTEGER ::= 16384 + maxnoofCellsinngeNB INTEGER ::= 256 + maxnoofCellsinNGRANNode INTEGER ::= 16384 + maxnoofCellsinUEHistoryInfo INTEGER ::= 16 + maxnoofCellsUEMovingTrajectory INTEGER ::= 16 + maxnoofDRBs INTEGER ::= 32 + maxnoofEmergencyAreaID INTEGER ::= 65535 + maxnoofEAIforRestart INTEGER ::= 256 + maxnoofEPLMNs INTEGER ::= 15 + maxnoofEPLMNsPlusOne INTEGER ::= 16 + maxnoofE-RABs INTEGER ::= 256 + maxnoofErrors INTEGER ::= 256 + maxnoofExtSliceItems INTEGER ::= 65535 + maxnoofForbTACs INTEGER ::= 4096 + maxnoofFreqforMDT INTEGER ::= 8 + maxnoofGUAMIs INTEGER ::= 1024 + maxnoofMBSAreaSessionIDs INTEGER ::= 256 + maxnoofMBSFSAs INTEGER ::= 64 + maxnoofMBSQoSFlows INTEGER ::= 64 + maxnoofMBSSessions INTEGER ::= 32 + maxnoofMBSSessionsofUE INTEGER ::= 256 + maxnoofMBSServiceAreaInformation INTEGER ::= 256 + maxnoofMDTPLMNs INTEGER ::= 16 + maxnoofMRBs INTEGER ::= 32 + maxnoofMultiConnectivity INTEGER ::= 4 + maxnoofMultiConnectivityMinusOne INTEGER ::= 3 + maxnoofNeighPCIforMDT INTEGER ::= 32 + maxnoofNGAPIESupportInfo INTEGER ::= 32 + maxnoofNGConnectionsToReset INTEGER ::= 65536 + maxnoofNRCellBands INTEGER ::= 32 + maxnoofNSAGs INTEGER ::= 256 + maxnoofPagingAreas INTEGER ::= 64 + maxnoofPC5QoSFlows INTEGER ::= 2048 + maxnoofPDUSessions INTEGER ::= 256 + maxnoofPLMNs INTEGER ::= 12 + maxnoofPSCellsPerPrimaryCellinUEHistoryInfo INTEGER ::= 8 + maxnoofQosFlows INTEGER ::= 64 + maxnoofQosParaSets INTEGER ::= 8 + maxnoofRANNodeinAoI INTEGER ::= 64 + maxnoofRecommendedCells INTEGER ::= 16 + maxnoofRecommendedRANNodes INTEGER ::= 16 + maxnoofAoI INTEGER ::= 64 + maxnoofAoIMinusOne INTEGER ::= 63 + maxnoofFlightInfoReportControl INTEGER ::= 64 + maxnoofReportedCells INTEGER ::= 256 + maxnoofSensorName INTEGER ::= 3 + maxnoofServedGUAMIs INTEGER ::= 256 + maxnoofSliceItems INTEGER ::= 1024 + maxnoofSuccessfulHOReports INTEGER ::= 64 + maxnoofTACs INTEGER ::= 256 + maxnoofTACsinNTN INTEGER ::= 12 + maxnoofTAforMDT INTEGER ::= 8 + maxnoofTAIforInactive INTEGER ::= 16 + maxnoofSupportedTAIforMBS INTEGER ::= 256 + maxnoofTAIforMBS INTEGER ::= 1024 + maxnoofTAIforPaging INTEGER ::= 16 + maxnoofTAIforRestart INTEGER ::= 2048 + maxnoofTAIforWarning INTEGER ::= 65535 + maxnoofTAIinAoI INTEGER ::= 16 + maxnoofTimePeriods INTEGER ::= 2 + maxnoofTNLAssociations INTEGER ::= 32 + maxnoofUEsforPaging INTEGER ::= 4096 + maxnoofUETypes INTEGER ::= 8 + maxnoofWLANName INTEGER ::= 4 + maxnoofXnExtTLAs INTEGER ::= 16 + maxnoofXnGTP-TLAs INTEGER ::= 16 + maxnoofXnTLAs INTEGER ::= 2 + maxnoofCandidateCells INTEGER ::= 32 + maxnoofTargetS-NSSAIs INTEGER ::= 8 + maxNRARFCN INTEGER ::= 3279165 + maxnoofCellIDforQMC INTEGER ::= 32 + maxnoofPLMNforQMC INTEGER ::= 16 + maxnoofUEAppLayerMeas INTEGER ::= 16 + maxnoofSNSSAIforQMC INTEGER ::= 16 + maxnoofTAforQMC INTEGER ::= 8 + maxnoofThresholdsForExcessPacketDelay INTEGER ::= 255 + maxnoofESNPNs INTEGER ::= 15 + maxnoofCandidateRelayUEs INTEGER ::= 32 + maxnoofSuccessfulPSCellChangeReports INTEGER ::= 64 + maxnoofCellsTSS INTEGER ::= 16384 + maxnoofPeriodicities INTEGER ::= 8 + maxnoofCAGforMDT INTEGER ::= 256 + maxnoofMDTSNPNs INTEGER ::= 16 + maxnoofPartiallyAllowedS-NSSAIs INTEGER ::= 8 + maxnoofRSPPQoSFlows INTEGER ::= 2048 + maxnoofSliceItemsforMDT INTEGER ::= 1024 + maxnoofAreaNTN INTEGER ::= 8 + maxnoofIntendedAreasforMBS INTEGER ::= 65536 + maxnoofRequestedSNSSAIs INTEGER ::= 8 + maxnoofReaders INTEGER ::= 65535 + maxnoofDevices INTEGER ::= 65535 + maxnoofAIoTAreas INTEGER ::= 256 + maxnoofThresholds INTEGER ::= 8 + + + +-- ************************************************************** +-- +-- IEs +-- +-- ************************************************************** + + id-AllowedNSSAI ProtocolIE-ID ::= 0 + id-AMFName ProtocolIE-ID ::= 1 + id-AMFOverloadResponse ProtocolIE-ID ::= 2 + id-AMFSetID ProtocolIE-ID ::= 3 + id-AMF-TNLAssociationFailedToSetupList ProtocolIE-ID ::= 4 + id-AMF-TNLAssociationSetupList ProtocolIE-ID ::= 5 + id-AMF-TNLAssociationToAddList ProtocolIE-ID ::= 6 + id-AMF-TNLAssociationToRemoveList ProtocolIE-ID ::= 7 + id-AMF-TNLAssociationToUpdateList ProtocolIE-ID ::= 8 + id-AMFTrafficLoadReductionIndication ProtocolIE-ID ::= 9 + id-AMF-UE-NGAP-ID ProtocolIE-ID ::= 10 + id-AssistanceDataForPaging ProtocolIE-ID ::= 11 + id-BroadcastCancelledAreaList ProtocolIE-ID ::= 12 + id-BroadcastCompletedAreaList ProtocolIE-ID ::= 13 + id-CancelAllWarningMessages ProtocolIE-ID ::= 14 + id-Cause ProtocolIE-ID ::= 15 + id-CellIDListForRestart ProtocolIE-ID ::= 16 + id-ConcurrentWarningMessageInd ProtocolIE-ID ::= 17 + id-CoreNetworkAssistanceInformationForInactive ProtocolIE-ID ::= 18 + id-CriticalityDiagnostics ProtocolIE-ID ::= 19 + id-DataCodingScheme ProtocolIE-ID ::= 20 + id-DefaultPagingDRX ProtocolIE-ID ::= 21 + id-DirectForwardingPathAvailability ProtocolIE-ID ::= 22 + id-EmergencyAreaIDListForRestart ProtocolIE-ID ::= 23 + id-EmergencyFallbackIndicator ProtocolIE-ID ::= 24 + id-EUTRA-CGI ProtocolIE-ID ::= 25 + id-FiveG-S-TMSI ProtocolIE-ID ::= 26 + id-GlobalRANNodeID ProtocolIE-ID ::= 27 + id-GUAMI ProtocolIE-ID ::= 28 + id-HandoverType ProtocolIE-ID ::= 29 + id-IMSVoiceSupportIndicator ProtocolIE-ID ::= 30 + id-IndexToRFSP ProtocolIE-ID ::= 31 + id-InfoOnRecommendedCellsAndRANNodesForPaging ProtocolIE-ID ::= 32 + id-LocationReportingRequestType ProtocolIE-ID ::= 33 + id-MaskedIMEISV ProtocolIE-ID ::= 34 + id-MessageIdentifier ProtocolIE-ID ::= 35 + id-MobilityRestrictionList ProtocolIE-ID ::= 36 + id-NASC ProtocolIE-ID ::= 37 + id-NAS-PDU ProtocolIE-ID ::= 38 + id-NASSecurityParametersFromNGRAN ProtocolIE-ID ::= 39 + id-NewAMF-UE-NGAP-ID ProtocolIE-ID ::= 40 + id-NewSecurityContextInd ProtocolIE-ID ::= 41 + id-NGAP-Message ProtocolIE-ID ::= 42 + id-NGRAN-CGI ProtocolIE-ID ::= 43 + id-NGRANTraceID ProtocolIE-ID ::= 44 + id-NR-CGI ProtocolIE-ID ::= 45 + id-NRPPa-PDU ProtocolIE-ID ::= 46 + id-NumberOfBroadcastsRequested ProtocolIE-ID ::= 47 + id-OldAMF ProtocolIE-ID ::= 48 + id-OverloadStartNSSAIList ProtocolIE-ID ::= 49 + id-PagingDRX ProtocolIE-ID ::= 50 + id-PagingOrigin ProtocolIE-ID ::= 51 + id-PagingPriority ProtocolIE-ID ::= 52 + id-PDUSessionResourceAdmittedList ProtocolIE-ID ::= 53 + id-PDUSessionResourceFailedToModifyListModRes ProtocolIE-ID ::= 54 + id-PDUSessionResourceFailedToSetupListCxtRes ProtocolIE-ID ::= 55 + id-PDUSessionResourceFailedToSetupListHOAck ProtocolIE-ID ::= 56 + id-PDUSessionResourceFailedToSetupListPSReq ProtocolIE-ID ::= 57 + id-PDUSessionResourceFailedToSetupListSURes ProtocolIE-ID ::= 58 + id-PDUSessionResourceHandoverList ProtocolIE-ID ::= 59 + id-PDUSessionResourceListCxtRelCpl ProtocolIE-ID ::= 60 + id-PDUSessionResourceListHORqd ProtocolIE-ID ::= 61 + id-PDUSessionResourceModifyListModCfm ProtocolIE-ID ::= 62 + id-PDUSessionResourceModifyListModInd ProtocolIE-ID ::= 63 + id-PDUSessionResourceModifyListModReq ProtocolIE-ID ::= 64 + id-PDUSessionResourceModifyListModRes ProtocolIE-ID ::= 65 + id-PDUSessionResourceNotifyList ProtocolIE-ID ::= 66 + id-PDUSessionResourceReleasedListNot ProtocolIE-ID ::= 67 + id-PDUSessionResourceReleasedListPSAck ProtocolIE-ID ::= 68 + id-PDUSessionResourceReleasedListPSFail ProtocolIE-ID ::= 69 + id-PDUSessionResourceReleasedListRelRes ProtocolIE-ID ::= 70 + id-PDUSessionResourceSetupListCxtReq ProtocolIE-ID ::= 71 + id-PDUSessionResourceSetupListCxtRes ProtocolIE-ID ::= 72 + id-PDUSessionResourceSetupListHOReq ProtocolIE-ID ::= 73 + id-PDUSessionResourceSetupListSUReq ProtocolIE-ID ::= 74 + id-PDUSessionResourceSetupListSURes ProtocolIE-ID ::= 75 + id-PDUSessionResourceToBeSwitchedDLList ProtocolIE-ID ::= 76 + id-PDUSessionResourceSwitchedList ProtocolIE-ID ::= 77 + id-PDUSessionResourceToReleaseListHOCmd ProtocolIE-ID ::= 78 + id-PDUSessionResourceToReleaseListRelCmd ProtocolIE-ID ::= 79 + id-PLMNSupportList ProtocolIE-ID ::= 80 + id-PWSFailedCellIDList ProtocolIE-ID ::= 81 + id-RANNodeName ProtocolIE-ID ::= 82 + id-RANPagingPriority ProtocolIE-ID ::= 83 + id-RANStatusTransfer-TransparentContainer ProtocolIE-ID ::= 84 + id-RAN-UE-NGAP-ID ProtocolIE-ID ::= 85 + id-RelativeAMFCapacity ProtocolIE-ID ::= 86 + id-RepetitionPeriod ProtocolIE-ID ::= 87 + id-ResetType ProtocolIE-ID ::= 88 + id-RoutingID ProtocolIE-ID ::= 89 + id-RRCEstablishmentCause ProtocolIE-ID ::= 90 + id-RRCInactiveTransitionReportRequest ProtocolIE-ID ::= 91 + id-RRCState ProtocolIE-ID ::= 92 + id-SecurityContext ProtocolIE-ID ::= 93 + id-SecurityKey ProtocolIE-ID ::= 94 + id-SerialNumber ProtocolIE-ID ::= 95 + id-ServedGUAMIList ProtocolIE-ID ::= 96 + id-SliceSupportList ProtocolIE-ID ::= 97 + id-SONConfigurationTransferDL ProtocolIE-ID ::= 98 + id-SONConfigurationTransferUL ProtocolIE-ID ::= 99 + id-SourceAMF-UE-NGAP-ID ProtocolIE-ID ::= 100 + id-SourceToTarget-TransparentContainer ProtocolIE-ID ::= 101 + id-SupportedTAList ProtocolIE-ID ::= 102 + id-TAIListForPaging ProtocolIE-ID ::= 103 + id-TAIListForRestart ProtocolIE-ID ::= 104 + id-TargetID ProtocolIE-ID ::= 105 + id-TargetToSource-TransparentContainer ProtocolIE-ID ::= 106 + id-TimeToWait ProtocolIE-ID ::= 107 + id-TraceActivation ProtocolIE-ID ::= 108 + id-TraceCollectionEntityIPAddress ProtocolIE-ID ::= 109 + id-UEAggregateMaximumBitRate ProtocolIE-ID ::= 110 + id-UE-associatedLogicalNG-connectionList ProtocolIE-ID ::= 111 + id-UEContextRequest ProtocolIE-ID ::= 112 + id-UE-NGAP-IDs ProtocolIE-ID ::= 114 + id-UEPagingIdentity ProtocolIE-ID ::= 115 + id-UEPresenceInAreaOfInterestList ProtocolIE-ID ::= 116 + id-UERadioCapability ProtocolIE-ID ::= 117 + id-UERadioCapabilityForPaging ProtocolIE-ID ::= 118 + id-UESecurityCapabilities ProtocolIE-ID ::= 119 + id-UnavailableGUAMIList ProtocolIE-ID ::= 120 + id-UserLocationInformation ProtocolIE-ID ::= 121 + id-WarningAreaList ProtocolIE-ID ::= 122 + id-WarningMessageContents ProtocolIE-ID ::= 123 + id-WarningSecurityInfo ProtocolIE-ID ::= 124 + id-WarningType ProtocolIE-ID ::= 125 + id-AdditionalUL-NGU-UP-TNLInformation ProtocolIE-ID ::= 126 + id-DataForwardingNotPossible ProtocolIE-ID ::= 127 + id-DL-NGU-UP-TNLInformation ProtocolIE-ID ::= 128 + id-NetworkInstance ProtocolIE-ID ::= 129 + id-PDUSessionAggregateMaximumBitRate ProtocolIE-ID ::= 130 + id-PDUSessionResourceFailedToModifyListModCfm ProtocolIE-ID ::= 131 + id-PDUSessionResourceFailedToSetupListCxtFail ProtocolIE-ID ::= 132 + id-PDUSessionResourceListCxtRelReq ProtocolIE-ID ::= 133 + id-PDUSessionType ProtocolIE-ID ::= 134 + id-QosFlowAddOrModifyRequestList ProtocolIE-ID ::= 135 + id-QosFlowSetupRequestList ProtocolIE-ID ::= 136 + id-QosFlowToReleaseList ProtocolIE-ID ::= 137 + id-SecurityIndication ProtocolIE-ID ::= 138 + id-UL-NGU-UP-TNLInformation ProtocolIE-ID ::= 139 + id-UL-NGU-UP-TNLModifyList ProtocolIE-ID ::= 140 + id-WarningAreaCoordinates ProtocolIE-ID ::= 141 + id-PDUSessionResourceSecondaryRATUsageList ProtocolIE-ID ::= 142 + id-HandoverFlag ProtocolIE-ID ::= 143 + id-SecondaryRATUsageInformation ProtocolIE-ID ::= 144 + id-PDUSessionResourceReleaseResponseTransfer ProtocolIE-ID ::= 145 + id-RedirectionVoiceFallback ProtocolIE-ID ::= 146 + id-UERetentionInformation ProtocolIE-ID ::= 147 + id-S-NSSAI ProtocolIE-ID ::= 148 + id-PSCellInformation ProtocolIE-ID ::= 149 + id-LastEUTRAN-PLMNIdentity ProtocolIE-ID ::= 150 + id-MaximumIntegrityProtectedDataRate-DL ProtocolIE-ID ::= 151 + id-AdditionalDLForwardingUPTNLInformation ProtocolIE-ID ::= 152 + id-AdditionalDLUPTNLInformationForHOList ProtocolIE-ID ::= 153 + id-AdditionalNGU-UP-TNLInformation ProtocolIE-ID ::= 154 + id-AdditionalDLQosFlowPerTNLInformation ProtocolIE-ID ::= 155 + id-SecurityResult ProtocolIE-ID ::= 156 + id-ENDC-SONConfigurationTransferDL ProtocolIE-ID ::= 157 + id-ENDC-SONConfigurationTransferUL ProtocolIE-ID ::= 158 + id-OldAssociatedQosFlowList-ULendmarkerexpected ProtocolIE-ID ::= 159 + id-CNTypeRestrictionsForEquivalent ProtocolIE-ID ::= 160 + id-CNTypeRestrictionsForServing ProtocolIE-ID ::= 161 + id-NewGUAMI ProtocolIE-ID ::= 162 + id-ULForwarding ProtocolIE-ID ::= 163 + id-ULForwardingUP-TNLInformation ProtocolIE-ID ::= 164 + id-CNAssistedRANTuning ProtocolIE-ID ::= 165 + id-CommonNetworkInstance ProtocolIE-ID ::= 166 + id-NGRAN-TNLAssociationToRemoveList ProtocolIE-ID ::= 167 + id-TNLAssociationTransportLayerAddressNGRAN ProtocolIE-ID ::= 168 + id-EndpointIPAddressAndPort ProtocolIE-ID ::= 169 + id-LocationReportingAdditionalInfo ProtocolIE-ID ::= 170 + id-SourceToTarget-AMFInformationReroute ProtocolIE-ID ::= 171 + id-AdditionalULForwardingUPTNLInformation ProtocolIE-ID ::= 172 + id-SCTP-TLAs ProtocolIE-ID ::= 173 + id-SelectedPLMNIdentity ProtocolIE-ID ::= 174 + id-RIMInformationTransfer ProtocolIE-ID ::= 175 + id-GUAMIType ProtocolIE-ID ::= 176 + id-SRVCCOperationPossible ProtocolIE-ID ::= 177 + id-TargetRNC-ID ProtocolIE-ID ::= 178 + id-RAT-Information ProtocolIE-ID ::= 179 + id-ExtendedRATRestrictionInformation ProtocolIE-ID ::= 180 + id-QosMonitoringRequest ProtocolIE-ID ::= 181 + id-SgNB-UE-X2AP-ID ProtocolIE-ID ::= 182 + id-AdditionalRedundantDL-NGU-UP-TNLInformation ProtocolIE-ID ::= 183 + id-AdditionalRedundantDLQosFlowPerTNLInformation ProtocolIE-ID ::= 184 + id-AdditionalRedundantNGU-UP-TNLInformation ProtocolIE-ID ::= 185 + id-AdditionalRedundantUL-NGU-UP-TNLInformation ProtocolIE-ID ::= 186 + id-CNPacketDelayBudgetDL ProtocolIE-ID ::= 187 + id-CNPacketDelayBudgetUL ProtocolIE-ID ::= 188 + id-ExtendedPacketDelayBudget ProtocolIE-ID ::= 189 + id-RedundantCommonNetworkInstance ProtocolIE-ID ::= 190 + id-RedundantDL-NGU-TNLInformationReused ProtocolIE-ID ::= 191 + id-RedundantDL-NGU-UP-TNLInformation ProtocolIE-ID ::= 192 + id-RedundantDLQosFlowPerTNLInformation ProtocolIE-ID ::= 193 + id-RedundantQosFlowIndicator ProtocolIE-ID ::= 194 + id-RedundantUL-NGU-UP-TNLInformation ProtocolIE-ID ::= 195 + id-TSCTrafficCharacteristics ProtocolIE-ID ::= 196 + id-RedundantPDUSessionInformation ProtocolIE-ID ::= 197 + id-UsedRSNInformation ProtocolIE-ID ::= 198 + id-IAB-Authorized ProtocolIE-ID ::= 199 + id-IAB-Supported ProtocolIE-ID ::= 200 + id-IABNodeIndication ProtocolIE-ID ::= 201 + id-NB-IoT-PagingDRX ProtocolIE-ID ::= 202 + id-NB-IoT-Paging-eDRXInfo ProtocolIE-ID ::= 203 + id-NB-IoT-DefaultPagingDRX ProtocolIE-ID ::= 204 + id-Enhanced-CoverageRestriction ProtocolIE-ID ::= 205 + id-Extended-ConnectedTime ProtocolIE-ID ::= 206 + id-PagingAssisDataforCEcapabUE ProtocolIE-ID ::= 207 + id-WUS-Assistance-Information ProtocolIE-ID ::= 208 + id-UE-DifferentiationInfo ProtocolIE-ID ::= 209 + id-NB-IoT-UEPriority ProtocolIE-ID ::= 210 + id-UL-CP-SecurityInformation ProtocolIE-ID ::= 211 + id-DL-CP-SecurityInformation ProtocolIE-ID ::= 212 + id-TAI ProtocolIE-ID ::= 213 + id-UERadioCapabilityForPagingOfNB-IoT ProtocolIE-ID ::= 214 + id-LTEV2XServicesAuthorized ProtocolIE-ID ::= 215 + id-NRV2XServicesAuthorized ProtocolIE-ID ::= 216 + id-LTEUESidelinkAggregateMaximumBitrate ProtocolIE-ID ::= 217 + id-NRUESidelinkAggregateMaximumBitrate ProtocolIE-ID ::= 218 + id-PC5QoSParameters ProtocolIE-ID ::= 219 + id-AlternativeQoSParaSetList ProtocolIE-ID ::= 220 + id-CurrentQoSParaSetIndex ProtocolIE-ID ::= 221 + id-CEmodeBrestricted ProtocolIE-ID ::= 222 + id-EUTRA-PagingeDRXInformation ProtocolIE-ID ::= 223 + id-CEmodeBSupport-Indicator ProtocolIE-ID ::= 224 + id-LTEM-Indication ProtocolIE-ID ::= 225 + id-EndIndication ProtocolIE-ID ::= 226 + id-EDT-Session ProtocolIE-ID ::= 227 + id-UECapabilityInfoRequest ProtocolIE-ID ::= 228 + id-PDUSessionResourceFailedToResumeListRESReq ProtocolIE-ID ::= 229 + id-PDUSessionResourceFailedToResumeListRESRes ProtocolIE-ID ::= 230 + id-PDUSessionResourceSuspendListSUSReq ProtocolIE-ID ::= 231 + id-PDUSessionResourceResumeListRESReq ProtocolIE-ID ::= 232 + id-PDUSessionResourceResumeListRESRes ProtocolIE-ID ::= 233 + id-UE-UP-CIoT-Support ProtocolIE-ID ::= 234 + id-Suspend-Request-Indication ProtocolIE-ID ::= 235 + id-Suspend-Response-Indication ProtocolIE-ID ::= 236 + id-RRC-Resume-Cause ProtocolIE-ID ::= 237 + id-RGLevelWirelineAccessCharacteristics ProtocolIE-ID ::= 238 + id-W-AGFIdentityInformation ProtocolIE-ID ::= 239 + id-GlobalTNGF-ID ProtocolIE-ID ::= 240 + id-GlobalTWIF-ID ProtocolIE-ID ::= 241 + id-GlobalW-AGF-ID ProtocolIE-ID ::= 242 + id-UserLocationInformationW-AGF ProtocolIE-ID ::= 243 + id-UserLocationInformationTNGF ProtocolIE-ID ::= 244 + id-AuthenticatedIndication ProtocolIE-ID ::= 245 + id-TNGFIdentityInformation ProtocolIE-ID ::= 246 + id-TWIFIdentityInformation ProtocolIE-ID ::= 247 + id-UserLocationInformationTWIF ProtocolIE-ID ::= 248 + id-DataForwardingResponseERABList ProtocolIE-ID ::= 249 + id-IntersystemSONConfigurationTransferDL ProtocolIE-ID ::= 250 + id-IntersystemSONConfigurationTransferUL ProtocolIE-ID ::= 251 + id-SONInformationReport ProtocolIE-ID ::= 252 + id-UEHistoryInformationFromTheUE ProtocolIE-ID ::= 253 + id-ManagementBasedMDTPLMNList ProtocolIE-ID ::= 254 + id-MDTConfiguration ProtocolIE-ID ::= 255 + id-PrivacyIndicator ProtocolIE-ID ::= 256 + id-TraceCollectionEntityURI ProtocolIE-ID ::= 257 + id-NPN-Support ProtocolIE-ID ::= 258 + id-NPN-AccessInformation ProtocolIE-ID ::= 259 + id-NPN-PagingAssistanceInformation ProtocolIE-ID ::= 260 + id-NPN-MobilityInformation ProtocolIE-ID ::= 261 + id-TargettoSource-Failure-TransparentContainer ProtocolIE-ID ::= 262 + id-NID ProtocolIE-ID ::= 263 + id-UERadioCapabilityID ProtocolIE-ID ::= 264 + id-UERadioCapability-EUTRA-Format ProtocolIE-ID ::= 265 + id-DAPSRequestInfo ProtocolIE-ID ::= 266 + id-DAPSResponseInfoList ProtocolIE-ID ::= 267 + id-EarlyStatusTransfer-TransparentContainer ProtocolIE-ID ::= 268 + id-NotifySourceNGRANNode ProtocolIE-ID ::= 269 + id-ExtendedSliceSupportList ProtocolIE-ID ::= 270 + id-ExtendedTAISliceSupportList ProtocolIE-ID ::= 271 + id-ConfiguredTACIndication ProtocolIE-ID ::= 272 + id-Extended-RANNodeName ProtocolIE-ID ::= 273 + id-Extended-AMFName ProtocolIE-ID ::= 274 + id-GlobalCable-ID ProtocolIE-ID ::= 275 + id-QosMonitoringReportingFrequency ProtocolIE-ID ::= 276 + id-QosFlowParametersList ProtocolIE-ID ::= 277 + id-QosFlowFeedbackList ProtocolIE-ID ::= 278 + id-BurstArrivalTimeDownlink ProtocolIE-ID ::= 279 + id-ExtendedUEIdentityIndexValue ProtocolIE-ID ::= 280 + id-PduSessionExpectedUEActivityBehaviour ProtocolIE-ID ::= 281 + id-MicoAllPLMN ProtocolIE-ID ::= 282 + id-QosFlowFailedToSetupList ProtocolIE-ID ::= 283 + id-SourceTNLAddrInfo ProtocolIE-ID ::= 284 + id-ExtendedReportIntervalMDT ProtocolIE-ID ::= 285 + id-SourceNodeID ProtocolIE-ID ::= 286 + id-NRNTNTAIInformation ProtocolIE-ID ::= 287 + id-UEContextReferenceAtSource ProtocolIE-ID ::= 288 + id-LastVisitedPSCellList ProtocolIE-ID ::= 289 + id-IntersystemSONInformationRequest ProtocolIE-ID ::= 290 + id-IntersystemSONInformationReply ProtocolIE-ID ::= 291 + id-EnergySavingIndication ProtocolIE-ID ::= 292 + id-IntersystemResourceStatusUpdate ProtocolIE-ID ::= 293 + id-SuccessfulHandoverReportList ProtocolIE-ID ::= 294 + id-MBS-AreaSessionID ProtocolIE-ID ::= 295 + id-MBS-QoSFlowsToBeSetupList ProtocolIE-ID ::= 296 + id-MBS-QoSFlowsToBeSetupModList ProtocolIE-ID ::= 297 + id-MBS-ServiceArea ProtocolIE-ID ::= 298 + id-MBS-SessionID ProtocolIE-ID ::= 299 + id-MBS-DistributionReleaseRequestTransfer ProtocolIE-ID ::= 300 + id-MBS-DistributionSetupRequestTransfer ProtocolIE-ID ::= 301 + id-MBS-DistributionSetupResponseTransfer ProtocolIE-ID ::= 302 + id-MBS-DistributionSetupUnsuccessfulTransfer ProtocolIE-ID ::= 303 + id-MulticastSessionActivationRequestTransfer ProtocolIE-ID ::= 304 + id-MulticastSessionDeactivationRequestTransfer ProtocolIE-ID ::= 305 + id-MulticastSessionUpdateRequestTransfer ProtocolIE-ID ::= 306 + id-MulticastGroupPagingAreaList ProtocolIE-ID ::= 307 + id-MBS-SupportIndicator ProtocolIE-ID ::= 309 + id-MBSSessionFailedtoSetupList ProtocolIE-ID ::= 310 + id-MBSSessionFailedtoSetuporModifyList ProtocolIE-ID ::= 311 + id-MBSSessionSetupResponseList ProtocolIE-ID ::= 312 + id-MBSSessionSetuporModifyResponseList ProtocolIE-ID ::= 313 + id-MBSSessionSetupFailureTransfer ProtocolIE-ID ::= 314 + id-MBSSessionSetupRequestTransfer ProtocolIE-ID ::= 315 + id-MBSSessionSetupResponseTransfer ProtocolIE-ID ::= 316 + id-MBSSessionToReleaseList ProtocolIE-ID ::= 317 + id-MBSSessionSetupRequestList ProtocolIE-ID ::= 318 + id-MBSSessionSetuporModifyRequestList ProtocolIE-ID ::= 319 + id-MBS-ActiveSessionInformation-SourcetoTargetList ProtocolIE-ID ::= 323 + id-MBS-ActiveSessionInformation-TargettoSourceList ProtocolIE-ID ::= 324 + id-OnboardingSupport ProtocolIE-ID ::= 325 + id-TimeSyncAssistanceInfo ProtocolIE-ID ::= 326 + id-SurvivalTime ProtocolIE-ID ::= 327 + id-QMCConfigInfo ProtocolIE-ID ::= 328 + id-QMCDeactivation ProtocolIE-ID ::= 329 + id-PDUSessionPairID ProtocolIE-ID ::= 331 + id-NR-PagingeDRXInformation ProtocolIE-ID ::= 332 + id-RedCapIndication ProtocolIE-ID ::= 333 + id-TargetNSSAIInformation ProtocolIE-ID ::= 334 + id-UESliceMaximumBitRateList ProtocolIE-ID ::= 335 + id-M4ReportAmount ProtocolIE-ID ::= 336 + id-M5ReportAmount ProtocolIE-ID ::= 337 + id-M6ReportAmount ProtocolIE-ID ::= 338 + id-M7ReportAmount ProtocolIE-ID ::= 339 + id-IncludeBeamMeasurementsIndication ProtocolIE-ID ::= 340 + id-ExcessPacketDelayThresholdConfiguration ProtocolIE-ID ::= 341 + id-PagingCause ProtocolIE-ID ::= 342 + id-PagingCauseIndicationForVoiceService ProtocolIE-ID ::= 343 + id-PEIPSassistanceInformation ProtocolIE-ID ::= 344 + id-FiveG-ProSeAuthorized ProtocolIE-ID ::= 345 + id-FiveG-ProSeUEPC5AggregateMaximumBitRate ProtocolIE-ID ::= 346 + id-FiveG-ProSePC5QoSParameters ProtocolIE-ID ::= 347 + id-MBSSessionModificationFailureTransfer ProtocolIE-ID ::= 348 + id-MBSSessionModificationRequestTransfer ProtocolIE-ID ::= 349 + id-MBSSessionModificationResponseTransfer ProtocolIE-ID ::= 350 + id-MBS-QoSFlowToReleaseList ProtocolIE-ID ::= 351 + id-MBS-SessionTNLInfo5GC ProtocolIE-ID ::= 352 + id-TAINSAGSupportList ProtocolIE-ID ::= 353 + id-SourceNodeTNLAddrInfo ProtocolIE-ID ::= 354 + id-NGAPIESupportInformationRequestList ProtocolIE-ID ::= 355 + id-NGAPIESupportInformationResponseList ProtocolIE-ID ::= 356 + id-MBS-SessionFSAIDList ProtocolIE-ID ::= 357 + id-MBSSessionReleaseResponseTransfer ProtocolIE-ID ::= 358 + id-ManagementBasedMDTPLMNModificationList ProtocolIE-ID ::= 359 + id-EarlyMeasurement ProtocolIE-ID ::= 360 + id-BeamMeasurementsReportConfiguration ProtocolIE-ID ::= 361 + id-HFCNode-ID-new ProtocolIE-ID ::= 362 + id-GlobalCable-ID-new ProtocolIE-ID ::= 363 + id-TargetHomeENB-ID ProtocolIE-ID ::= 364 + id-HashedUEIdentityIndexValue ProtocolIE-ID ::= 365 + id-ExtendedMobilityInformation ProtocolIE-ID ::= 366 + id-NetworkControlledRepeaterAuthorized ProtocolIE-ID ::= 367 + id-AdditionalCancelledlocationReportingReferenceIDList ProtocolIE-ID ::= 368 + id-Selected-Target-SNPN-Identity ProtocolIE-ID ::= 369 + id-EquivalentSNPNsList ProtocolIE-ID ::= 370 + id-SelectedNID ProtocolIE-ID ::= 371 + id-SupportedUETypeList ProtocolIE-ID ::= 372 + id-AerialUEsubscriptionInformation ProtocolIE-ID ::= 373 + id-NR-A2X-ServicesAuthorized ProtocolIE-ID ::= 374 + id-LTE-A2X-ServicesAuthorized ProtocolIE-ID ::= 375 + id-NR-A2X-UE-PC5-AggregateMaximumBitRate ProtocolIE-ID ::= 376 + id-LTE-A2X-UE-PC5-AggregateMaximumBitRate ProtocolIE-ID ::= 377 + id-A2X-PC5-QoS-Parameters ProtocolIE-ID ::= 378 + id-FiveGProSeLayer2Multipath ProtocolIE-ID ::= 379 + id-FiveGProSeLayer2UEtoUERelay ProtocolIE-ID ::= 380 + id-FiveGProSeLayer2UEtoUERemote ProtocolIE-ID ::= 381 + id-CandidateRelayUEInformationList ProtocolIE-ID ::= 382 + id-SuccessfulPSCellChangeReportList ProtocolIE-ID ::= 383 + id-IntersystemMobilityFailureforVoiceFallback ProtocolIE-ID ::= 384 + id-TargetCellCRNTI ProtocolIE-ID ::= 385 + id-TimeSinceFailure ProtocolIE-ID ::= 386 + id-RANTimingSynchronisationStatusInfo ProtocolIE-ID ::= 387 + id-RAN-TSSRequestType ProtocolIE-ID ::= 388 + id-RAN-TSSScope ProtocolIE-ID ::= 389 + id-ClockQualityReportingControlInfo ProtocolIE-ID ::= 390 + id-RANfeedbacktype ProtocolIE-ID ::= 391 + id-QoSFlowTSCList ProtocolIE-ID ::= 392 + id-TSCTrafficCharacteristicsFeedback ProtocolIE-ID ::= 393 + id-DownlinkTLContainer ProtocolIE-ID ::= 394 + id-UplinkTLContainer ProtocolIE-ID ::= 395 + id-ANPacketDelayBudgetUL ProtocolIE-ID ::= 396 + id-QosFlowAdditionalInfoList ProtocolIE-ID ::= 397 + id-AssistanceInformationQoE-Meas ProtocolIE-ID ::= 398 + id-CommServiceType ProtocolIE-ID ::= 399 + id-MobileIAB-Authorized ProtocolIE-ID ::= 400 + id-MobileIAB-MTUserLocationInformation ProtocolIE-ID ::= 401 + id-MobileIABNodeIndication ProtocolIE-ID ::= 402 + id-NoPDUSessionIndication ProtocolIE-ID ::= 403 + id-MobileIAB-Supported ProtocolIE-ID ::= 404 + id-CN-MT-CommunicationHandling ProtocolIE-ID ::= 405 + id-FiveGCAction ProtocolIE-ID ::= 406 + id-PagingPolicyDifferentiation ProtocolIE-ID ::= 407 + id-DL-Signalling ProtocolIE-ID ::= 408 + id-PNI-NPN-AreaScopeofMDT ProtocolIE-ID ::= 409 + id-PNI-NPNBasedMDT ProtocolIE-ID ::= 410 + id-SNPN-CellBasedMDT ProtocolIE-ID ::= 411 + id-SNPN-TAIBasedMDT ProtocolIE-ID ::= 412 + id-SNPN-BasedMDT ProtocolIE-ID ::= 413 + id-Partially-Allowed-NSSAI ProtocolIE-ID ::= 414 + id-AssociatedSessionID ProtocolIE-ID ::= 415 + id-MBS-AssistanceInformation ProtocolIE-ID ::= 416 + id-BroadcastTransportFailureTransfer ProtocolIE-ID ::= 417 + id-BroadcastTransportRequestTransfer ProtocolIE-ID ::= 418 + id-BroadcastTransportResponseTransfer ProtocolIE-ID ::= 419 + id-TimeBasedHandoverInformation ProtocolIE-ID ::= 420 + id-DLDiscarding ProtocolIE-ID ::= 421 + id-PDUsetQoSParameters ProtocolIE-ID ::= 422 + id-PDUSetbasedHandlingIndicator ProtocolIE-ID ::= 423 + id-N6JitterInformation ProtocolIE-ID ::= 424 + id-ECNMarkingorCongestionInformationReportingRequest ProtocolIE-ID ::= 425 + id-ECNMarkingorCongestionInformationReportingStatus ProtocolIE-ID ::= 426 + id-ERedCapIndication ProtocolIE-ID ::= 427 + id-XrDeviceWith2Rx ProtocolIE-ID ::= 428 + id-UserPlaneErrorIndicator ProtocolIE-ID ::= 429 + id-SLPositioningRangingServiceInfo ProtocolIE-ID ::= 430 + id-PDUSessionListMTCommHReq ProtocolIE-ID ::= 431 + id-MaximumDataBurstVolume ProtocolIE-ID ::= 432 + id-MN-only-MDT-collection ProtocolIE-ID ::= 433 + id-MBS-NGUFailureIndication ProtocolIE-ID ::= 434 + id-UserPlaneFailureIndication ProtocolIE-ID ::= 435 + id-UserPlaneFailureIndicationReport ProtocolIE-ID ::= 436 + id-SourceSN-to-TargetSN-QMCInfo ProtocolIE-ID ::= 437 + id-QoERVQoEReportingPaths ProtocolIE-ID ::= 438 + id-UserLocationInformationN3IWF-without-PortNumber ProtocolIE-ID ::= 439 + id-AUN3DeviceAccessInfo ProtocolIE-ID ::= 440 + id-TAIMBSSupportList ProtocolIE-ID ::= 441 + id-ExtendedBackupAMFName ProtocolIE-ID ::= 442 + id-ExtendedOldAMF ProtocolIE-ID ::= 443 + id-MBS-UP-FailureIndication ProtocolIE-ID ::= 444 + id-RequestedTNLInfo ProtocolIE-ID ::= 445 + id-Aerial-UE-FlightInformationOngoingReporting-failed ProtocolIE-ID ::= 446 + id-NetworkSliceAreaScopeofMDT ProtocolIE-ID ::= 447 + id-GeographyBasedMDT ProtocolIE-ID ::= 448 + id-MBS-IntendedServiceAreaList ProtocolIE-ID ::= 449 + id-AMF-UE-NGAP-ID2 ProtocolIE-ID ::= 450 + id-GUAMIList ProtocolIE-ID ::= 451 + id-GW-Context-Release-Indication ProtocolIE-ID ::= 452 + id-SourceAMF-GUAMI ProtocolIE-ID ::= 453 + id-RequestedNSSAI ProtocolIE-ID ::= 454 + id-Target-RAN-Node-ID ProtocolIE-ID ::= 455 + id-InventoryRequestTransfer ProtocolIE-ID ::= 456 + id-InventoryResponseTransfer ProtocolIE-ID ::= 457 + id-InventoryFailureTransfer ProtocolIE-ID ::= 458 + id-InventoryReportTransfer ProtocolIE-ID ::= 459 + id-CommandRequestTransfer ProtocolIE-ID ::= 460 + id-CommandResponseTransfer ProtocolIE-ID ::= 461 + id-CommandFailureTransfer ProtocolIE-ID ::= 462 + id-AIOTSessionReleaseCommandTransfer ProtocolIE-ID ::= 463 + id-AIOTSessionReleaseCompleteTransfer ProtocolIE-ID ::= 464 + id-AIOTSessionReleaseRequestTransfer ProtocolIE-ID ::= 465 + id-AIoT-CorrelationIdentifier ProtocolIE-ID ::= 466 + id-AIOTFIdentifier ProtocolIE-ID ::= 467 + id-AIoT-DeviceIdentificationRequested ProtocolIE-ID ::= 468 + id-AIoT-RequestedServiceAreaInformation ProtocolIE-ID ::= 469 + id-AIoT-InventoryAssistanceInformation ProtocolIE-ID ::= 470 + id-AIoT-FollowonCommandIndication ProtocolIE-ID ::= 471 + id-RAN-AIOT-Device-NGAP-ID ProtocolIE-ID ::= 472 + id-AIoT-CommandAssistanceInformation ProtocolIE-ID ::= 473 + id-AIoT-NASPDU ProtocolIE-ID ::= 474 + id-AIoT-Support ProtocolIE-ID ::= 475 + id-AIOTFName ProtocolIE-ID ::= 476 + id-LPWUSPSAssistanceInformation ProtocolIE-ID ::= 477 + id-FurtherExtendedUEIdentityIndexValue ProtocolIE-ID ::= 478 + id-FiveGProSeLayer2MHUEtoNetworkRelay ProtocolIE-ID ::= 479 + id-FiveGProSeLayer2MHIntermediateUEtoNetworkRelay ProtocolIE-ID ::= 480 + id-FiveGProSeLayer2MHRemote ProtocolIE-ID ::= 481 + id-FiveGProSeLayer3MHUEtoNetworkRelay ProtocolIE-ID ::= 482 + id-AdditionalULI ProtocolIE-ID ::= 483 + id-PduSetDelayBudgetDownlink ProtocolIE-ID ::= 484 + id-PduSetDelayBudgetUplink ProtocolIE-ID ::= 485 + id-PduSetErrorRateDownlink ProtocolIE-ID ::= 486 + id-PduSetErrorRateUplink ProtocolIE-ID ::= 487 + id-DLPDUSetInformationMarkingSupportIndication ProtocolIE-ID ::= 488 + id-MonitoringRequestonAvailableBitrate ProtocolIE-ID ::= 489 + id-MMSID ProtocolIE-ID ::= 490 + id-Indication-of-Bitrate-Adaptation ProtocolIE-ID ::= 491 + id-SCGActivationTime ProtocolIE-ID ::= 492 + id-Aerial-UE-FlightInformationReporting ProtocolIE-ID ::= 493 + id-Aerial-UE-FlightInformationReportingControlList ProtocolIE-ID ::= 494 + id-LPWUSDisableIndication ProtocolIE-ID ::= 495 + id-AIoT-SecurityInfo ProtocolIE-ID ::= 496 + + + + +END diff --git a/ngap/testdata/asn1/NGAP-Containers.asn b/ngap/testdata/asn1/NGAP-Containers.asn new file mode 100644 index 0000000000..54df767322 --- /dev/null +++ b/ngap/testdata/asn1/NGAP-Containers.asn @@ -0,0 +1,198 @@ +-- ************************************************************** +-- +-- Container definitions +-- +-- ************************************************************** + +NGAP-Containers { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-Access (22) modules (3) ngap (1) version1 (1) ngap-Containers (5) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + + Criticality, + Presence, + PrivateIE-ID, + ProtocolExtensionID, + ProtocolIE-ID +FROM NGAP-CommonDataTypes + + maxPrivateIEs, + maxProtocolExtensions, + maxProtocolIEs +FROM NGAP-Constants; + +-- ************************************************************** +-- +-- Class Definition for Protocol IEs +-- +-- ************************************************************** + +NGAP-PROTOCOL-IES ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Protocol IEs +-- +-- ************************************************************** + +NGAP-PROTOCOL-IES-PAIR ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &firstCriticality Criticality, + &FirstValue, + &secondCriticality Criticality, + &SecondValue, + &presence Presence +} +WITH SYNTAX { + ID &id + FIRST CRITICALITY &firstCriticality + FIRST TYPE &FirstValue + SECOND CRITICALITY &secondCriticality + SECOND TYPE &SecondValue + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Protocol Extensions +-- +-- ************************************************************** + +NGAP-PROTOCOL-EXTENSION ::= CLASS { + &id ProtocolExtensionID UNIQUE, + &criticality Criticality, + &Extension, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + EXTENSION &Extension + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Private IEs +-- +-- ************************************************************** + +NGAP-PRIVATE-IES ::= CLASS { + &id PrivateIE-ID, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Container for Protocol IEs +-- +-- ************************************************************** + +ProtocolIE-Container {NGAP-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (0..maxProtocolIEs)) OF + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-SingleContainer {NGAP-PROTOCOL-IES : IEsSetParam} ::= + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-Field {NGAP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE { + id NGAP-PROTOCOL-IES.&id ({IEsSetParam}), + criticality NGAP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}), + value NGAP-PROTOCOL-IES.&Value ({IEsSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Protocol IE Pairs +-- +-- ************************************************************** + +ProtocolIE-ContainerPair {NGAP-PROTOCOL-IES-PAIR : IEsSetParam} ::= + SEQUENCE (SIZE (0..maxProtocolIEs)) OF + ProtocolIE-FieldPair {{IEsSetParam}} + +ProtocolIE-FieldPair {NGAP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE { + id NGAP-PROTOCOL-IES-PAIR.&id ({IEsSetParam}), + firstCriticality NGAP-PROTOCOL-IES-PAIR.&firstCriticality ({IEsSetParam}{@id}), + firstValue NGAP-PROTOCOL-IES-PAIR.&FirstValue ({IEsSetParam}{@id}), + secondCriticality NGAP-PROTOCOL-IES-PAIR.&secondCriticality ({IEsSetParam}{@id}), + secondValue NGAP-PROTOCOL-IES-PAIR.&SecondValue ({IEsSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container Lists for Protocol IE Containers +-- +-- ************************************************************** + +ProtocolIE-ContainerList {INTEGER : lowerBound, INTEGER : upperBound, NGAP-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (lowerBound..upperBound)) OF + ProtocolIE-SingleContainer {{IEsSetParam}} + +ProtocolIE-ContainerPairList {INTEGER : lowerBound, INTEGER : upperBound, NGAP-PROTOCOL-IES-PAIR : IEsSetParam} ::= + SEQUENCE (SIZE (lowerBound..upperBound)) OF + ProtocolIE-ContainerPair {{IEsSetParam}} + +-- ************************************************************** +-- +-- Container for Protocol Extensions +-- +-- ************************************************************** + +ProtocolExtensionContainer {NGAP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= + SEQUENCE (SIZE (1..maxProtocolExtensions)) OF + ProtocolExtensionField {{ExtensionSetParam}} + +ProtocolExtensionField {NGAP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= SEQUENCE { + id NGAP-PROTOCOL-EXTENSION.&id ({ExtensionSetParam}), + criticality NGAP-PROTOCOL-EXTENSION.&criticality ({ExtensionSetParam}{@id}), + extensionValue NGAP-PROTOCOL-EXTENSION.&Extension ({ExtensionSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Private IEs +-- +-- ************************************************************** + +PrivateIE-Container {NGAP-PRIVATE-IES : IEsSetParam } ::= + SEQUENCE (SIZE (1..maxPrivateIEs)) OF + PrivateIE-Field {{IEsSetParam}} + +PrivateIE-Field {NGAP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE { + id NGAP-PRIVATE-IES.&id ({IEsSetParam}), + criticality NGAP-PRIVATE-IES.&criticality ({IEsSetParam}{@id}), + value NGAP-PRIVATE-IES.&Value ({IEsSetParam}{@id}) +} + +END diff --git a/ngap/testdata/asn1/NGAP-IEs.asn b/ngap/testdata/asn1/NGAP-IEs.asn new file mode 100644 index 0000000000..c21baebed7 --- /dev/null +++ b/ngap/testdata/asn1/NGAP-IEs.asn @@ -0,0 +1,8704 @@ +-- ************************************************************** +-- +-- Information Element Definitions +-- +-- ************************************************************** + +NGAP-IEs { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-Access (22) modules (3) ngap (1) version1 (1) ngap-IEs (2) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + + id-AdditionalDLForwardingUPTNLInformation, + id-AdditionalULForwardingUPTNLInformation, + id-AdditionalDLQosFlowPerTNLInformation, + id-AdditionalDLUPTNLInformationForHOList, + id-AdditionalNGU-UP-TNLInformation, + id-AdditionalRedundantDL-NGU-UP-TNLInformation, + id-AdditionalRedundantDLQosFlowPerTNLInformation, + id-AdditionalRedundantNGU-UP-TNLInformation, + id-AdditionalRedundantUL-NGU-UP-TNLInformation, + id-AdditionalUL-NGU-UP-TNLInformation, + id-AIOTFIdentifier, + id-AIoT-CorrelationIdentifier, + id-AIoT-DeviceIdentificationRequested, + id-AIoT-SecurityInfo, + id-AIoT-RequestedServiceAreaInformation, + id-AIoT-InventoryAssistanceInformation, + id-AIoT-FollowonCommandIndication, + id-RAN-AIOT-Device-NGAP-ID, + id-AIoT-CommandAssistanceInformation, + id-AIoT-NASPDU, + id-AlternativeQoSParaSetList, + id-AssistanceInformationQoE-Meas, + id-AdditionalCancelledlocationReportingReferenceIDList, + id-BurstArrivalTimeDownlink, + id-Cause, + id-CNPacketDelayBudgetDL, + id-CNPacketDelayBudgetUL, + id-CNTypeRestrictionsForEquivalent, + id-CNTypeRestrictionsForServing, + id-CommonNetworkInstance, + id-ConfiguredTACIndication, + id-CN-MT-CommunicationHandling, + id-CurrentQoSParaSetIndex, + id-DAPSRequestInfo, + id-DAPSResponseInfoList, + id-DataForwardingNotPossible, + id-DataForwardingResponseERABList, + id-DirectForwardingPathAvailability, + id-DL-NGU-UP-TNLInformation, + id-DownlinkTLContainer, + id-EndpointIPAddressAndPort, + id-EnergySavingIndication, + id-ExtendedMobilityInformation, + id-ExtendedPacketDelayBudget, + id-ExtendedRATRestrictionInformation, + id-ExtendedReportIntervalMDT, + id-ExtendedSliceSupportList, + id-ExtendedTAISliceSupportList, + id-ExtendedUEIdentityIndexValue, + id-EUTRA-PagingeDRXInformation, + id-EquivalentSNPNsList, + id-FurtherExtendedUEIdentityIndexValue, + id-GeographyBasedMDT, + id-GlobalCable-ID, + id-GlobalRANNodeID, + id-GlobalTNGF-ID, + id-GlobalTWIF-ID, + id-GlobalW-AGF-ID, + id-GUAMIType, + id-HashedUEIdentityIndexValue, + id-IncludeBeamMeasurementsIndication, + id-IntersystemSONInformationRequest, + id-IntersystemSONInformationReply, + id-IntersystemResourceStatusUpdate, + id-IntersystemMobilityFailureforVoiceFallback, + id-LastEUTRAN-PLMNIdentity, + id-LastVisitedPSCellList, + id-LocationReportingAdditionalInfo, + id-LPWUSPSAssistanceInformation, + id-LPWUSDisableIndication, + id-M4ReportAmount, + id-M5ReportAmount, + id-M6ReportAmount, + id-ExcessPacketDelayThresholdConfiguration, + id-M7ReportAmount, + id-MaximumIntegrityProtectedDataRate-DL, + id-MBS-AreaSessionID, + id-MBS-QoSFlowsToBeSetupList, + id-MBS-QoSFlowsToBeSetupModList, + id-MBS-QoSFlowToReleaseList, + id-MBS-ServiceArea, + id-MBS-SessionFSAIDList, + id-MBS-SessionID, + id-MBS-ActiveSessionInformation-SourcetoTargetList, + id-MBS-ActiveSessionInformation-TargettoSourceList, + id-MBS-AssistanceInformation, + id-MBS-IntendedServiceAreaList, + id-MBS-SessionTNLInfo5GC, + id-MBS-SupportIndicator, + id-MBSSessionFailedtoSetupList, + id-MBSSessionFailedtoSetuporModifyList, + id-MBSSessionSetupResponseList, + id-MBSSessionSetuporModifyResponseList, + id-MBSSessionToReleaseList, + id-MBSSessionSetupRequestList, + id-MBSSessionSetuporModifyRequestList, + id-MDTConfiguration, + id-MicoAllPLMN, + id-NetworkInstance, + id-NetworkSliceAreaScopeofMDT, + id-NGAPIESupportInformationRequestList, + id-NGAPIESupportInformationResponseList, + id-NID, + id-NR-CGI, + id-NRNTNTAIInformation, + id-NPN-MobilityInformation, + id-NPN-PagingAssistanceInformation, + id-NPN-Support, + id-NR-PagingeDRXInformation, + id-OldAssociatedQosFlowList-ULendmarkerexpected, + id-OnboardingSupport, + id-PagingAssisDataforCEcapabUE, + id-PagingCauseIndicationForVoiceService, + id-PDUSessionAggregateMaximumBitRate, + id-PduSessionExpectedUEActivityBehaviour, + id-PDUSessionPairID, + id-PDUSessionResourceFailedToSetupListCxtFail, + id-PDUSessionResourceReleaseResponseTransfer, + id-PDUSessionType, + id-PEIPSassistanceInformation, + id-PSCellInformation, + id-PNI-NPNBasedMDT, + id-PNI-NPN-AreaScopeofMDT, + id-QMCConfigInfo, + id-QosFlowAdditionalInfoList, + id-QosFlowAddOrModifyRequestList, + id-QosFlowFailedToSetupList, + id-QosFlowFeedbackList, + id-QosFlowParametersList, + id-QosFlowSetupRequestList, + id-QosFlowToReleaseList, + id-QosMonitoringRequest, + id-QosMonitoringReportingFrequency, + id-SNPN-CellBasedMDT, + id-SNPN-TAIBasedMDT, + id-SNPN-BasedMDT, + id-SuccessfulHandoverReportList, + id-SupportedUETypeList, + id-UEContextReferenceAtSource, + id-RAT-Information, + id-RedundantCommonNetworkInstance, + id-RedundantDL-NGU-TNLInformationReused, + id-RedundantDL-NGU-UP-TNLInformation, + id-RedundantDLQosFlowPerTNLInformation, + id-RedundantPDUSessionInformation, + id-RedundantQosFlowIndicator, + id-RedundantUL-NGU-UP-TNLInformation, + id-SCTP-TLAs, + id-SecondaryRATUsageInformation, + id-SecurityIndication, + id-SecurityResult, + id-SgNB-UE-X2AP-ID, + id-S-NSSAI, + id-SONInformationReport, + id-SourceNodeID, + id-SourceNodeTNLAddrInfo, + id-SourceSN-to-TargetSN-QMCInfo, + id-SourceTNLAddrInfo, + id-SurvivalTime, + id-Selected-Target-SNPN-Identity, + id-TNLAssociationTransportLayerAddressNGRAN, + id-TAIMBSSupportList, + id-TAINSAGSupportList, + id-TargetHomeENB-ID, + id-TargetRNC-ID, + id-TimeBasedHandoverInformation, + id-TraceCollectionEntityURI, + id-TSCTrafficCharacteristics, + id-UEHistoryInformationFromTheUE, + id-UERadioCapabilityForPaging, + id-UERadioCapabilityForPagingOfNB-IoT, + id-UL-NGU-UP-TNLInformation, + id-UL-NGU-UP-TNLModifyList, + id-ULForwarding, + id-ULForwardingUP-TNLInformation, + id-UplinkTLContainer, + id-UsedRSNInformation, + id-UserLocationInformationTNGF, + id-UserLocationInformationTWIF, + id-UserLocationInformationW-AGF, + id-UserPlaneErrorIndicator, + id-EarlyMeasurement, + id-BeamMeasurementsReportConfiguration, + id-DLDiscarding, + id-TAI, + id-HFCNode-ID-new, + id-GlobalCable-ID-new, + id-FiveGProSeLayer2Multipath, + id-CandidateRelayUEInformationList, + id-FiveGProSeLayer2UEtoUERelay, + id-FiveGProSeLayer2UEtoUERemote, + id-SuccessfulPSCellChangeReportList, + id-TargetCellCRNTI, + id-TimeSinceFailure, + id-ClockQualityReportingControlInfo, + id-RANfeedbacktype, + id-QoSFlowTSCList, + id-TSCTrafficCharacteristicsFeedback, + id-ANPacketDelayBudgetUL, + id-CommServiceType, + id-MobileIAB-MTUserLocationInformation, + id-PDUsetQoSParameters, + id-PDUSetbasedHandlingIndicator, + id-N6JitterInformation, + id-ECNMarkingorCongestionInformationReportingRequest, + id-ECNMarkingorCongestionInformationReportingStatus, + id-MN-only-MDT-collection, + id-XrDeviceWith2Rx, + id-MaximumDataBurstVolume, + id-MBS-NGUFailureIndication, + id-UserPlaneFailureIndication, + id-UserPlaneFailureIndicationReport, + id-QoERVQoEReportingPaths, + id-UserLocationInformationN3IWF-without-PortNumber, + id-ExtendedBackupAMFName, + id-MBS-UP-FailureIndication, + id-RequestedTNLInfo, + id-FiveGProSeLayer2MHUEtoNetworkRelay, + id-FiveGProSeLayer2MHIntermediateUEtoNetworkRelay, + id-FiveGProSeLayer2MHRemote, + id-FiveGProSeLayer3MHUEtoNetworkRelay, + id-AdditionalULI, + id-PduSetDelayBudgetDownlink, + id-PduSetDelayBudgetUplink, + id-PduSetErrorRateDownlink, + id-PduSetErrorRateUplink, + id-DLPDUSetInformationMarkingSupportIndication, + id-MonitoringRequestonAvailableBitrate, + id-MMSID, + id-Indication-of-Bitrate-Adaptation, + id-SCGActivationTime, + id-Aerial-UE-FlightInformationReporting, + id-Aerial-UE-FlightInformationReportingControlList, + maxnoofAIoTAreas, + maxnoofAllowedAreas, + maxnoofAllowedCAGsperPLMN, + maxnoofAllowedS-NSSAIs, + maxnoofAreaNTN, + maxnoofAoIMinusOne, + maxnoofBluetoothName, + maxnoofBPLMNs, + maxnoofCAGforMDT, + maxnoofCAGSperCell, + maxnoofCandidateCells, + maxnoofCellIDforMDT, + maxnoofCellIDforQMC, + maxnoofCellIDforWarning, + maxnoofCellinAoI, + maxnoofCellinEAI, + maxnoofCellsforMBS, + maxnoofCellsingNB, + maxnoofCellsinngeNB, + maxnoofCellsinNGRANNode, + maxnoofCellinTAI, + maxnoofCellsinUEHistoryInfo, + maxnoofCellsUEMovingTrajectory, + maxnoofDevices, + maxnoofDRBs, + maxnoofEmergencyAreaID, + maxnoofEAIforRestart, + maxnoofEPLMNs, + maxnoofEPLMNsPlusOne, + maxnoofE-RABs, + maxnoofErrors, + maxnoofExtSliceItems, + maxnoofESNPNs, + maxnoofForbTACs, + maxnoofFreqforMDT, + maxnoofGUAMIs, + maxnoofMBSFSAs, + maxnoofMBSQoSFlows, + maxnoofMBSServiceAreaInformation, + maxnoofMBSAreaSessionIDs, + maxnoofMBSSessions, + maxnoofMBSSessionsofUE, + maxnoofMDTPLMNs, + maxnoofMRBs, + maxnoofMultiConnectivity, + maxnoofMultiConnectivityMinusOne, + maxnoofNeighPCIforMDT, + maxnoofNGAPIESupportInfo, + maxnoofNGConnectionsToReset, + maxNRARFCN, + maxnoofNRCellBands, + maxnoofNSAGs, + maxnoofPagingAreas, + maxnoofPC5QoSFlows, + maxnoofPDUSessions, + maxnoofPLMNs, + maxnoofPLMNforQMC, + maxnoofQosFlows, + maxnoofQosParaSets, + maxnoofRANNodeinAoI, + maxnoofReaders, + maxnoofRecommendedCells, + maxnoofRecommendedRANNodes, + maxnoofAoI, + maxnoofFlightInfoReportControl, + maxnoofPSCellsPerPrimaryCellinUEHistoryInfo, + maxnoofReportedCells, + maxnoofSensorName, + maxnoofServedGUAMIs, + maxnoofSliceItems, + maxnoofMDTSNPNs, + maxnoofSNSSAIforQMC, + maxnoofSuccessfulHOReports, + maxnoofTACs, + maxnoofTACsinNTN, + maxnoofTAforMDT, + maxnoofTAforQMC, + maxnoofTAIforInactive, + maxnoofSupportedTAIforMBS, + maxnoofTAIforMBS, + maxnoofTAIforPaging, + maxnoofTAIforRestart, + maxnoofTAIforWarning, + maxnoofTAIinAoI, + maxnoofTargetS-NSSAIs, + maxnoofTimePeriods, + maxnoofTNLAssociations, + maxnoofUEAppLayerMeas, + maxnoofUEsforPaging, + maxnoofUETypes, + maxnoofWLANName, + maxnoofXnExtTLAs, + maxnoofXnGTP-TLAs, + maxnoofXnTLAs, + maxnoofThresholdsForExcessPacketDelay, + maxnoofCandidateRelayUEs, + maxnoofSuccessfulPSCellChangeReports, + maxnoofCellsTSS, + maxnoofPeriodicities, + maxnoofPartiallyAllowedS-NSSAIs, + maxnoofRSPPQoSFlows, + maxnoofSliceItemsforMDT, + maxnoofIntendedAreasforMBS, + maxnoofRequestedSNSSAIs, + maxnoofThresholds + + + +FROM NGAP-Constants + + Criticality, + ProcedureCode, + ProtocolIE-ID, + TriggeringMessage +FROM NGAP-CommonDataTypes + + ProtocolExtensionContainer{}, + ProtocolIE-Container{}, + NGAP-PROTOCOL-EXTENSION, + ProtocolIE-SingleContainer{}, + NGAP-PROTOCOL-IES +FROM NGAP-Containers; + +-- A + +AdditionalDLUPTNLInformationForHOList ::= SEQUENCE (SIZE(1..maxnoofMultiConnectivityMinusOne)) OF AdditionalDLUPTNLInformationForHOItem + +AdditionalDLUPTNLInformationForHOItem ::= SEQUENCE { + additionalDL-NGU-UP-TNLInformation UPTransportLayerInformation, + additionalQosFlowSetupResponseList QosFlowListWithDataForwarding, + additionalDLForwardingUPTNLInformation UPTransportLayerInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AdditionalDLUPTNLInformationForHOItem-ExtIEs} } OPTIONAL, + ... +} + +AdditionalDLUPTNLInformationForHOItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-AdditionalRedundantDL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }, + ... +} + +AdditionalQosFlowInformation ::= ENUMERATED { + more-likely, + ... +} + +AerialUEsubscriptionInformation ::= ENUMERATED { + allowed, + not-allowed, + ... +} + +AdditionalULI ::= SEQUENCE { + nRCGI NR-CGI, + tAI TAI, + iE-Extensions ProtocolExtensionContainer { { AdditionalULI-ExtIEs} } OPTIONAL, + ... +} + +AdditionalULI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +A2X-PC5-FlowBitRates ::= SEQUENCE { + a2X-GuaranteedFlowBitRate BitRate, + a2X-MaximumFlowBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { {A2X-PC5-FlowBitRates-ExtIEs} } OPTIONAL, + ... +} + +A2X-PC5-FlowBitRates-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +A2X-PC5-QoS-Flow-List ::= SEQUENCE (SIZE(1..maxnoofPC5QoSFlows)) OF A2X-PC5-QoS-Flow-Item + +A2X-PC5-QoS-Flow-Item ::= SEQUENCE { + a2X-PQI INTEGER (0..255, ...), + a2X-PC5-FlowBitRates A2X-PC5-FlowBitRates OPTIONAL, + a2X-Range ENUMERATED {m50, m80, m180, m200, + m350, m400, m500, m700, + m1000, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {A2X-PC5-QoS-Flow-Item-ExtIEs} } OPTIONAL, + ... +} + +A2X-PC5-QoS-Flow-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +A2X-PC5-QoS-Parameters ::= SEQUENCE { + a2X-PC5-QoS-Flow-List A2X-PC5-QoS-Flow-List, + a2X-PC5-LinkAggregateBitRates BitRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {A2X-PC5-QoS-Parameters-ExtIEs} } OPTIONAL, + ... +} + +A2X-PC5-QoS-Parameters-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AdditionalCancelledlocationReportingReferenceIDList ::= SEQUENCE (SIZE(1.. maxnoofAoIMinusOne)) OF AdditionalCancelledlocationReportingReferenceIDItem + +AdditionalCancelledlocationReportingReferenceIDItem ::= SEQUENCE { + locationReportingReferenceIDToBeCancelled LocationReportingReferenceID, + iE-Extensions ProtocolExtensionContainer { { AdditionalCancelledlocationReportingReferenceIDItem-ExtIEs} } OPTIONAL, + ... +} + +AdditionalCancelledlocationReportingReferenceIDItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIoTAreaID ::= SEQUENCE { + pLMNidentity PLMNIdentity, + nID NID OPTIONAL, + aIoTAreaCode OCTET STRING (SIZE (3)), + iE-Extensions ProtocolExtensionContainer { { AIoTAreaID-ExtIEs} } OPTIONAL, + ... +} + +AIoTAreaID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIoT-CorrelationIdentifier ::= INTEGER (0..65535, ...) + +AIoT-FollowonCommandIndication ::= ENUMERATED {true, ...} + +RAN-AIOT-Device-NGAP-ID ::= INTEGER (0..4294967295) + +AIoT-CommandAssistanceInformation ::= SEQUENCE { + estimateofExpectedD2RMsgSize INTEGER (1..256, ...), + iE-Extensions ProtocolExtensionContainer { { AIoT-CommandAssistanceInformation-ExtIEs} } OPTIONAL, + ... +} + +AIoT-CommandAssistanceInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIoT-DeviceIdentificationRequested ::= CHOICE { + singleDevice BIT STRING (SIZE(1..1024, ...)), + groupDevices BIT STRING (SIZE(1..1024, ...)), + allDevices NULL, + choice-Extensions ProtocolIE-SingleContainer { { AIoT-DeviceIdentificationRequested-ExtIEs} } +} + +AIoT-DeviceIdentificationRequested-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +AIoT-DeviceReportList ::= SEQUENCE (SIZE(1..maxnoofDevices)) OF AIoT-DeviceReportItem + +AIoT-DeviceReportItem ::= SEQUENCE { + aIoT-NASPDU AIoT-NASPDU, + rAN-AIOT-Device-NGAP-ID RAN-AIOT-Device-NGAP-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AIoT-DeviceReportItem-ExtIEs} } OPTIONAL, + ... +} + +AIoT-DeviceReportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIOTFIdentifier ::= OCTET STRING (SIZE(16..36, ...)) + +AIOTFName ::= SEQUENCE { + aIOTFNameVisibleString AIOTFNameVisibleString OPTIONAL, + aIOTFNameUTF8String AIOTFNameUTF8String OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AIOTFName-ExtIEs } } OPTIONAL, + ... +} + +AIOTFName-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIOTFNameVisibleString ::= VisibleString (SIZE(1..150, ...)) + +AIOTFNameUTF8String ::= UTF8String (SIZE(1..150, ...)) + +AIoT-InventoryAssistanceInformation ::= SEQUENCE { + expectedD2RMsgSize INTEGER (1..256, ...), + approximateNoofTargetDevices INTEGER (1..65535, ...) OPTIONAL, + timeInterval INTEGER (1..256, ...) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AIoT-InventoryAssistanceInformation-ExtIEs} } OPTIONAL, + ... +} + +AIoT-InventoryAssistanceInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIoT-NASPDU ::= OCTET STRING + +AIoT-SecurityInfo ::= CHOICE { + a-IoT-RAND-n BIT STRING (SIZE(128, ...)), + choice-Extensions ProtocolIE-SingleContainer { {AIoT-SecurityInfo-ExtIEs} } +} + +AIoT-SecurityInfo-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + + +AIoT-ReaderReportList ::= SEQUENCE (SIZE(1..maxnoofReaders)) OF AIoT-ReaderReportItem + +AIoT-ReaderReportItem ::= SEQUENCE { + readerIndex AIoT-ReaderIndex, + deviceReportList AIoT-DeviceReportList, + iE-Extensions ProtocolExtensionContainer { { AIoT-ReaderReportItem-ExtIEs} } OPTIONAL, + ... +} + +AIoT-ReaderReportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIoT-ReaderIndex ::= INTEGER (1..65535, ...) + +AIoT-RequestedReaderList ::= SEQUENCE (SIZE(1..maxnoofReaders)) OF AIoT-RequestedReaderItem + +AIoT-RequestedReaderItem ::= SEQUENCE { + globalgNB-ID GlobalGNB-ID, + readerIndex AIoT-ReaderIndex, + iE-Extensions ProtocolExtensionContainer { { AIoT-RequestedReaderItem-ExtIEs} } OPTIONAL, + ... +} + +AIoT-RequestedReaderItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIoT-RequestedAIoTAreaList ::= SEQUENCE (SIZE(1..maxnoofAIoTAreas)) OF AIoTAreaID + +AIoT-RequestedServiceAreaInformation ::= SEQUENCE { + requestedReaderList AIoT-RequestedReaderList OPTIONAL, + requestedAIoTAreaList AIoT-RequestedAIoTAreaList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AIoT-RequestedServiceAreaInformation-ExtIEs} } OPTIONAL, + ... +} + +AIoT-RequestedServiceAreaInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIOTSessionReleaseCommandTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AIOTSessionReleaseCommandTransferIEs} }, + ... +} + +AIOTSessionReleaseCommandTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +AIOTSessionReleaseCompleteTransfer ::= SEQUENCE { + correlationIdentifier AIoT-CorrelationIdentifier, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {AIOTSessionReleaseCompleteTransfer-ExtIEs} } OPTIONAL, + ... +} + +AIOTSessionReleaseCompleteTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIOTSessionReleaseRequestTransfer ::= SEQUENCE { + correlationIdentifier AIoT-CorrelationIdentifier, + cause Cause, + iE-Extensions ProtocolExtensionContainer { {AIOTSessionReleaseRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +AIOTSessionReleaseRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AIoT-Support ::= ENUMERATED {aIoT-only, aIoT-and-NRUu, ...} + +AllocationAndRetentionPriority ::= SEQUENCE { + priorityLevelARP PriorityLevelARP, + pre-emptionCapability Pre-emptionCapability, + pre-emptionVulnerability Pre-emptionVulnerability, + iE-Extensions ProtocolExtensionContainer { {AllocationAndRetentionPriority-ExtIEs} } OPTIONAL, + ... +} + +AllocationAndRetentionPriority-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Allowed-CAG-List-per-PLMN ::= SEQUENCE (SIZE(1..maxnoofAllowedCAGsperPLMN)) OF CAG-ID + +AllowedNSSAI ::= SEQUENCE (SIZE(1..maxnoofAllowedS-NSSAIs)) OF AllowedNSSAI-Item + +AllowedNSSAI-Item ::= SEQUENCE { + s-NSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { {AllowedNSSAI-Item-ExtIEs} } OPTIONAL, + ... +} + +AllowedNSSAI-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Allowed-PNI-NPN-List ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF Allowed-PNI-NPN-Item + +Allowed-PNI-NPN-Item ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + pNI-NPN-restricted ENUMERATED {restricted, not-restricted, ...}, + allowed-CAG-List-per-PLMN Allowed-CAG-List-per-PLMN, + iE-Extensions ProtocolExtensionContainer { {Allowed-PNI-NPN-Item-ExtIEs} } OPTIONAL, + ... +} + +Allowed-PNI-NPN-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AllowedTACs ::= SEQUENCE (SIZE(1..maxnoofAllowedAreas)) OF TAC + +AlternativeQoSParaSetIndex ::= INTEGER (1..8, ...) + +AlternativeQoSParaSetNotifyIndex ::= INTEGER (0..8, ...) + +AlternativeQoSParaSetList ::= SEQUENCE (SIZE(1..maxnoofQosParaSets)) OF AlternativeQoSParaSetItem + +AlternativeQoSParaSetItem ::= SEQUENCE { + alternativeQoSParaSetIndex AlternativeQoSParaSetIndex, + guaranteedFlowBitRateDL BitRate OPTIONAL, + guaranteedFlowBitRateUL BitRate OPTIONAL, + packetDelayBudget PacketDelayBudget OPTIONAL, + packetErrorRate PacketErrorRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {AlternativeQoSParaSetItem-ExtIEs} } OPTIONAL, + ... +} + +AlternativeQoSParaSetItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-MaximumDataBurstVolume CRITICALITY ignore EXTENSION MaximumDataBurstVolume PRESENCE optional }| + { ID id-PduSetDelayBudgetDownlink CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }| + { ID id-PduSetDelayBudgetUplink CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }| + { ID id-PduSetErrorRateDownlink CRITICALITY ignore EXTENSION PacketErrorRate PRESENCE optional }| + { ID id-PduSetErrorRateUplink CRITICALITY ignore EXTENSION PacketErrorRate PRESENCE optional }, + ... +} + +AssistanceInformationQoE-Meas ::= INTEGER (1..16, ...) + +AMFName ::= PrintableString (SIZE(1..150, ...)) + +AMFNameVisibleString ::= VisibleString (SIZE(1..150, ...)) + +AMFNameUTF8String ::= UTF8String (SIZE(1..150, ...)) + +AMFPagingTarget ::= CHOICE { + globalRANNodeID GlobalRANNodeID, + tAI TAI, + choice-Extensions ProtocolIE-SingleContainer { {AMFPagingTarget-ExtIEs} } +} + +AMFPagingTarget-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +AMFPointer ::= BIT STRING (SIZE(6)) + +AMFRegionID ::= BIT STRING (SIZE(8)) + +AMFSetID ::= BIT STRING (SIZE(10)) + +AMF-TNLAssociationSetupList ::= SEQUENCE (SIZE(1..maxnoofTNLAssociations)) OF AMF-TNLAssociationSetupItem + +AMF-TNLAssociationSetupItem ::= SEQUENCE { + aMF-TNLAssociationAddress CPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { {AMF-TNLAssociationSetupItem-ExtIEs} } OPTIONAL, + ... +} + +AMF-TNLAssociationSetupItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AMF-TNLAssociationToAddList ::= SEQUENCE (SIZE(1..maxnoofTNLAssociations)) OF AMF-TNLAssociationToAddItem + +AMF-TNLAssociationToAddItem ::= SEQUENCE { + aMF-TNLAssociationAddress CPTransportLayerInformation, + tNLAssociationUsage TNLAssociationUsage OPTIONAL, + tNLAddressWeightFactor TNLAddressWeightFactor, + iE-Extensions ProtocolExtensionContainer { {AMF-TNLAssociationToAddItem-ExtIEs} } OPTIONAL, + ... +} + +AMF-TNLAssociationToAddItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AMF-TNLAssociationToRemoveList ::= SEQUENCE (SIZE(1..maxnoofTNLAssociations)) OF AMF-TNLAssociationToRemoveItem + +AMF-TNLAssociationToRemoveItem ::= SEQUENCE { + aMF-TNLAssociationAddress CPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { {AMF-TNLAssociationToRemoveItem-ExtIEs} } OPTIONAL, + ... +} + +AMF-TNLAssociationToRemoveItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-TNLAssociationTransportLayerAddressNGRAN CRITICALITY reject EXTENSION CPTransportLayerInformation PRESENCE optional}, + ... +} + +AMF-TNLAssociationToUpdateList ::= SEQUENCE (SIZE(1..maxnoofTNLAssociations)) OF AMF-TNLAssociationToUpdateItem + +AMF-TNLAssociationToUpdateItem ::= SEQUENCE { + aMF-TNLAssociationAddress CPTransportLayerInformation, + tNLAssociationUsage TNLAssociationUsage OPTIONAL, + tNLAddressWeightFactor TNLAddressWeightFactor OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {AMF-TNLAssociationToUpdateItem-ExtIEs} } OPTIONAL, + ... +} + +AMF-TNLAssociationToUpdateItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AMF-UE-NGAP-ID ::= INTEGER (0..1099511627775) + +AreaOfInterest ::= SEQUENCE { + areaOfInterestTAIList AreaOfInterestTAIList OPTIONAL, + areaOfInterestCellList AreaOfInterestCellList OPTIONAL, + areaOfInterestRANNodeList AreaOfInterestRANNodeList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {AreaOfInterest-ExtIEs} } OPTIONAL, + ... +} + +AreaOfInterest-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AreaOfInterestCellList ::= SEQUENCE (SIZE(1..maxnoofCellinAoI)) OF AreaOfInterestCellItem + +AreaOfInterestCellItem ::= SEQUENCE { + nGRAN-CGI NGRAN-CGI, + iE-Extensions ProtocolExtensionContainer { {AreaOfInterestCellItem-ExtIEs} } OPTIONAL, + ... +} + +AreaOfInterestCellItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AreaOfInterestList ::= SEQUENCE (SIZE(1..maxnoofAoI)) OF AreaOfInterestItem + +AreaOfInterestItem ::= SEQUENCE { + areaOfInterest AreaOfInterest, + locationReportingReferenceID LocationReportingReferenceID, + iE-Extensions ProtocolExtensionContainer { {AreaOfInterestItem-ExtIEs} } OPTIONAL, + ... +} + +AreaOfInterestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AreaOfInterestRANNodeList ::= SEQUENCE (SIZE(1..maxnoofRANNodeinAoI)) OF AreaOfInterestRANNodeItem + +AreaOfInterestRANNodeItem ::= SEQUENCE { + globalRANNodeID GlobalRANNodeID, + iE-Extensions ProtocolExtensionContainer { {AreaOfInterestRANNodeItem-ExtIEs} } OPTIONAL, + ... +} + +AreaOfInterestRANNodeItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AreaOfInterestTAIList ::= SEQUENCE (SIZE(1..maxnoofTAIinAoI)) OF AreaOfInterestTAIItem + +AreaOfInterestTAIItem ::= SEQUENCE { + tAI TAI, + iE-Extensions ProtocolExtensionContainer { {AreaOfInterestTAIItem-ExtIEs} } OPTIONAL, + ... +} + +AreaOfInterestTAIItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AssistanceDataForPaging ::= SEQUENCE { + assistanceDataForRecommendedCells AssistanceDataForRecommendedCells OPTIONAL, + pagingAttemptInformation PagingAttemptInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {AssistanceDataForPaging-ExtIEs} } OPTIONAL, + ... +} + +AssistanceDataForPaging-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-NPN-PagingAssistanceInformation CRITICALITY ignore EXTENSION NPN-PagingAssistanceInformation PRESENCE optional }| + { ID id-PagingAssisDataforCEcapabUE CRITICALITY ignore EXTENSION PagingAssisDataforCEcapabUE PRESENCE optional }, + ... +} + +AssistanceDataForRecommendedCells ::= SEQUENCE { + recommendedCellsForPaging RecommendedCellsForPaging, + iE-Extensions ProtocolExtensionContainer { {AssistanceDataForRecommendedCells-ExtIEs} } OPTIONAL, + ... +} + +AssistanceDataForRecommendedCells-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AssociatedMBSQosFlowSetupRequestList ::= SEQUENCE (SIZE(1..maxnoofMBSQoSFlows)) OF AssociatedMBSQosFlowSetupRequestItem + +AssociatedMBSQosFlowSetupRequestItem ::= SEQUENCE { + mBS-QosFlowIdentifier QosFlowIdentifier, + associatedUnicastQosFlowIdentifier QosFlowIdentifier, + iE-Extensions ProtocolExtensionContainer { { AssociatedMBSQosFlowSetupRequestItem-ExtIEs} } OPTIONAL, + ... +} + +AssociatedMBSQosFlowSetupRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AssociatedMBSQosFlowSetuporModifyRequestList ::= SEQUENCE (SIZE(1..maxnoofMBSQoSFlows)) OF AssociatedMBSQosFlowSetuporModifyRequestItem + +AssociatedMBSQosFlowSetuporModifyRequestItem ::= SEQUENCE { + mBS-QosFlowIdentifier QosFlowIdentifier, + associatedUnicastQosFlowIdentifier QosFlowIdentifier, + iE-Extensions ProtocolExtensionContainer { { AssociatedMBSQosFlowSetuporModifyRequestItem-ExtIEs} } OPTIONAL, + ... +} + +AssociatedMBSQosFlowSetuporModifyRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AssociatedQosFlowList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF AssociatedQosFlowItem + +AssociatedQosFlowItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + qosFlowMappingIndication ENUMERATED {ul, dl, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {AssociatedQosFlowItem-ExtIEs} } OPTIONAL, + ... +} + +AssociatedQosFlowItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CurrentQoSParaSetIndex CRITICALITY ignore EXTENSION AlternativeQoSParaSetIndex PRESENCE optional }, + ... +} + +AssociatedSessionID ::= OCTET STRING + +AUN3DeviceAccessInfo ::= SEQUENCE { + aUN3DeviceAccess ENUMERATED {true, ...}, + existingNGConnectionwithSameLocation ENUMERATED {true, false, ...}, + iE-Extensions ProtocolExtensionContainer { { AUN3DeviceAccessInfo-ExtIEs} } OPTIONAL, + ... +} + +AUN3DeviceAccessInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +AuthenticatedIndication ::= ENUMERATED {true, ...} + +AveragingWindow ::= INTEGER (0..4095, ...) + +AreaScopeOfMDT-NR ::= CHOICE { + cellBased CellBasedMDT-NR, + tABased TABasedMDT, + pLMNWide NULL, + tAIBased TAIBasedMDT, + choice-Extensions ProtocolIE-SingleContainer { {AreaScopeOfMDT-NR-ExtIEs} } +} + +AreaScopeOfMDT-NR-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-PNI-NPNBasedMDT CRITICALITY ignore TYPE PNI-NPNBasedMDT PRESENCE mandatory }| + { ID id-SNPN-CellBasedMDT CRITICALITY ignore TYPE SNPN-CellBasedMDT PRESENCE mandatory }| + { ID id-SNPN-TAIBasedMDT CRITICALITY ignore TYPE SNPN-TAIBasedMDT PRESENCE mandatory }| + { ID id-SNPN-BasedMDT CRITICALITY ignore TYPE SNPN-BasedMDT PRESENCE mandatory }| + { ID id-GeographyBasedMDT CRITICALITY ignore TYPE GeographyBasedMDT PRESENCE optional }, + ... +} + +AreaScopeOfMDT-EUTRA ::= CHOICE { + cellBased CellBasedMDT-EUTRA, + tABased TABasedMDT, + pLMNWide NULL, + tAIBased TAIBasedMDT, + choice-Extensions ProtocolIE-SingleContainer { {AreaScopeOfMDT-EUTRA-ExtIEs} } +} + +AreaScopeOfMDT-EUTRA-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +AreaScopeOfNeighCellsList ::= SEQUENCE (SIZE(1..maxnoofFreqforMDT)) OF AreaScopeOfNeighCellsItem +AreaScopeOfNeighCellsItem ::= SEQUENCE { + nrFrequencyInfo NRFrequencyInfo, + pciListForMDT PCIListForMDT OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AreaScopeOfNeighCellsItem-ExtIEs} } OPTIONAL, + ... +} + +AreaScopeOfNeighCellsItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AreaScopeOfQMC ::= CHOICE { + cellBased CellBasedQMC, + tABased TABasedQMC, + tAIBased TAIBasedQMC, + pLMNAreaBased PLMNAreaBasedQMC, + choice-Extensions ProtocolIE-SingleContainer { { AreaScopeOfQMC-ExtIEs} } +} + +AreaScopeOfQMC-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +AvailableBitrateReportThresholdList ::= SEQUENCE (SIZE(1..maxnoofThresholds)) OF AvailableBitrateReportThresholdItem + +AvailableBitrateReportThresholdItem ::= SEQUENCE { + reportingThreshold ReportingThreshold, + iE-Extensions ProtocolExtensionContainer { { AvailableBitrateReportThresholdItem-ExtIEs} } OPTIONAL, + ... +} + +AvailableBitrateReportThresholdItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AvailableRANVisibleQoEMetrics ::= SEQUENCE { + applicationLayerBufferLevelList ENUMERATED {true, ...} OPTIONAL, + playoutDelayForMediaStartup ENUMERATED {true, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AvailableRANVisibleQoEMetrics-ExtIEs} } OPTIONAL, + ... +} + +AvailableRANVisibleQoEMetrics-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +-- B + +BeamMeasurementsReportConfiguration ::= SEQUENCE { + beamMeasurementsReportQuantity BeamMeasurementsReportQuantity OPTIONAL, + maxNrofRS-IndexesToReport MaxNrofRS-IndexesToReport OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { BeamMeasurementsReportConfiguration-ExtIEs} } OPTIONAL, + ... +} + +BeamMeasurementsReportConfiguration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +BeamMeasurementsReportQuantity ::= SEQUENCE { + rSRP ENUMERATED {true, ..., false}, + rSRQ ENUMERATED {true, ..., false}, + sINR ENUMERATED {true, ..., false}, + iE-Extensions ProtocolExtensionContainer { { BeamMeasurementsReportQuantity-ExtIEs} } OPTIONAL, + ... +} + +BeamMeasurementsReportQuantity-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +BitRate ::= INTEGER (0..4000000000000, ...) + +BroadcastCancelledAreaList ::= CHOICE { + cellIDCancelledEUTRA CellIDCancelledEUTRA, + tAICancelledEUTRA TAICancelledEUTRA, + emergencyAreaIDCancelledEUTRA EmergencyAreaIDCancelledEUTRA, + cellIDCancelledNR CellIDCancelledNR, + tAICancelledNR TAICancelledNR, + emergencyAreaIDCancelledNR EmergencyAreaIDCancelledNR, + choice-Extensions ProtocolIE-SingleContainer { {BroadcastCancelledAreaList-ExtIEs} } +} + +BroadcastCancelledAreaList-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +BroadcastCompletedAreaList ::= CHOICE { + cellIDBroadcastEUTRA CellIDBroadcastEUTRA, + tAIBroadcastEUTRA TAIBroadcastEUTRA, + emergencyAreaIDBroadcastEUTRA EmergencyAreaIDBroadcastEUTRA, + cellIDBroadcastNR CellIDBroadcastNR, + tAIBroadcastNR TAIBroadcastNR, + emergencyAreaIDBroadcastNR EmergencyAreaIDBroadcastNR, + choice-Extensions ProtocolIE-SingleContainer { {BroadcastCompletedAreaList-ExtIEs} } +} + +BroadcastCompletedAreaList-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +BroadcastPLMNList ::= SEQUENCE (SIZE(1..maxnoofBPLMNs)) OF BroadcastPLMNItem + +BroadcastPLMNItem ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + tAISliceSupportList SliceSupportList, + iE-Extensions ProtocolExtensionContainer { {BroadcastPLMNItem-ExtIEs} } OPTIONAL, + ... +} + +BroadcastPLMNItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-NPN-Support CRITICALITY reject EXTENSION NPN-Support PRESENCE optional}| + {ID id-ExtendedTAISliceSupportList CRITICALITY reject EXTENSION ExtendedSliceSupportList PRESENCE optional}| + {ID id-TAINSAGSupportList CRITICALITY ignore EXTENSION TAINSAGSupportList PRESENCE optional}, + ... +} + +BroadcastTransportFailureTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { BroadcastTransportFailureTransfer-ExtIEs} } OPTIONAL, + ... +} + +BroadcastTransportFailureTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +BroadcastTransportRequestTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-SessionTNLInfoNGRAN MBS-SessionTNLInfoNGRAN, + iE-Extensions ProtocolExtensionContainer { {BroadcastTransportRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +BroadcastTransportRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +BroadcastTransportResponseTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + iE-Extensions ProtocolExtensionContainer { {BroadcastTransportResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +BroadcastTransportResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +BluetoothMeasurementConfiguration ::= SEQUENCE { + bluetoothMeasConfig BluetoothMeasConfig, + bluetoothMeasConfigNameList BluetoothMeasConfigNameList OPTIONAL, + bt-rssi ENUMERATED {true, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { BluetoothMeasurementConfiguration-ExtIEs } } OPTIONAL, + ... +} + +BluetoothMeasurementConfiguration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +BluetoothMeasConfigNameList ::= SEQUENCE (SIZE(1..maxnoofBluetoothName)) OF BluetoothMeasConfigNameItem + +BluetoothMeasConfigNameItem ::= SEQUENCE { + bluetoothName BluetoothName, + iE-Extensions ProtocolExtensionContainer { { BluetoothMeasConfigNameItem-ExtIEs } } OPTIONAL, + ... +} + +BluetoothMeasConfigNameItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +BluetoothMeasConfig::= ENUMERATED {setup,...} + +BluetoothName ::= OCTET STRING (SIZE (1..248)) + +BurstArrivalTime ::= OCTET STRING + +BurstArrivalTimeWindow ::= SEQUENCE { + burstArrivalTimeWindowStart INTEGER (0..640000, ...), + burstArrivalTimeWindowEnd INTEGER (0..640000, ...), + iE-Extension ProtocolExtensionContainer { {BurstArrivalTimeWindow-ExtIEs} } OPTIONAL, + ... +} + +BurstArrivalTimeWindow-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- C + +CAG-ID ::= BIT STRING (SIZE(32)) + +CandidateRelayUEInformationList ::= SEQUENCE (SIZE(1.. maxnoofCandidateRelayUEs)) OF CandidateRelayUEInformationItem + +CandidateRelayUEInformationItem ::= SEQUENCE { + candidateRelayUE-Id CandidateRelayUE-ID, + iE-Extensions ProtocolExtensionContainer { { CandidateRelayUEInformationItem-ExtIEs} } OPTIONAL, + ... +} + +CandidateRelayUEInformationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CandidateRelayUE-ID ::= BIT STRING (SIZE(24)) + +CancelAllWarningMessages ::= ENUMERATED { + true, + ... +} + +CancelledCellsInEAI-EUTRA ::= SEQUENCE (SIZE(1..maxnoofCellinEAI)) OF CancelledCellsInEAI-EUTRA-Item + +CancelledCellsInEAI-EUTRA-Item ::= SEQUENCE { + eUTRA-CGI EUTRA-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CancelledCellsInEAI-EUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +CancelledCellsInEAI-EUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CancelledCellsInEAI-NR ::= SEQUENCE (SIZE(1..maxnoofCellinEAI)) OF CancelledCellsInEAI-NR-Item + +CancelledCellsInEAI-NR-Item ::= SEQUENCE { + nR-CGI NR-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CancelledCellsInEAI-NR-Item-ExtIEs} } OPTIONAL, + ... +} + +CancelledCellsInEAI-NR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CancelledCellsInTAI-EUTRA ::= SEQUENCE (SIZE(1..maxnoofCellinTAI)) OF CancelledCellsInTAI-EUTRA-Item + +CancelledCellsInTAI-EUTRA-Item ::= SEQUENCE { + eUTRA-CGI EUTRA-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CancelledCellsInTAI-EUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +CancelledCellsInTAI-EUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CancelledCellsInTAI-NR ::= SEQUENCE (SIZE(1..maxnoofCellinTAI)) OF CancelledCellsInTAI-NR-Item + +CancelledCellsInTAI-NR-Item ::= SEQUENCE{ + nR-CGI NR-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CancelledCellsInTAI-NR-Item-ExtIEs} } OPTIONAL, + ... +} + +CancelledCellsInTAI-NR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CandidateCellList ::= SEQUENCE (SIZE(1.. maxnoofCandidateCells)) OF CandidateCellItem + +CandidateCellItem ::= SEQUENCE{ + candidateCell CandidateCell, + iE-Extensions ProtocolExtensionContainer { {CandidateCellItem-ExtIEs} } OPTIONAL, + ... +} + +CandidateCellItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CandidateCell::= CHOICE { + candidateCGI CandidateCellID, + candidatePCI CandidatePCI, + choice-Extensions ProtocolIE-SingleContainer { { CandidateCell-ExtIEs} } +} + +CandidateCell-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + + +CandidateCellID::= SEQUENCE { + candidateCellID NR-CGI, + iE-Extensions ProtocolExtensionContainer { { CandidateCellID-ExtIEs} } OPTIONAL, + ... +} + +CandidateCellID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CandidatePCI::= SEQUENCE { + candidatePCI INTEGER (0..1007, ...), + candidateNRARFCN INTEGER (0..maxNRARFCN), + iE-Extensions ProtocolExtensionContainer { { CandidatePCI-ExtIEs} } OPTIONAL, + ... +} + +CandidatePCI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Cause ::= CHOICE { + radioNetwork CauseRadioNetwork, + transport CauseTransport, + nas CauseNas, + protocol CauseProtocol, + misc CauseMisc, + choice-Extensions ProtocolIE-SingleContainer { {Cause-ExtIEs} } +} + +Cause-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +CauseMisc ::= ENUMERATED { + control-processing-overload, + not-enough-user-plane-processing-resources, + hardware-failure, + om-intervention, + unknown-PLMN-or-SNPN, + unspecified, + ... +} + +CauseNas ::= ENUMERATED { + normal-release, + authentication-failure, + deregister, + unspecified, + ..., + uE-not-in-PLMN-serving-area, + mobile-IAB-not-authorized, + iAB-not-authorized, + no-aiot-NAS-response +} + +CauseProtocol ::= ENUMERATED { + transfer-syntax-error, + abstract-syntax-error-reject, + abstract-syntax-error-ignore-and-notify, + message-not-compatible-with-receiver-state, + semantic-error, + abstract-syntax-error-falsely-constructed-message, + unspecified, + ... +} + +CauseRadioNetwork ::= ENUMERATED { + unspecified, + txnrelocoverall-expiry, + successful-handover, + release-due-to-ngran-generated-reason, + release-due-to-5gc-generated-reason, + handover-cancelled, + partial-handover, + ho-failure-in-target-5GC-ngran-node-or-target-system, + ho-target-not-allowed, + tngrelocoverall-expiry, + tngrelocprep-expiry, + cell-not-available, + unknown-targetID, + no-radio-resources-available-in-target-cell, + unknown-local-UE-NGAP-ID, + inconsistent-remote-UE-NGAP-ID, + handover-desirable-for-radio-reason, + time-critical-handover, + resource-optimisation-handover, + reduce-load-in-serving-cell, + user-inactivity, + radio-connection-with-ue-lost, + radio-resources-not-available, + invalid-qos-combination, + failure-in-radio-interface-procedure, + interaction-with-other-procedure, + unknown-PDU-session-ID, + unkown-qos-flow-ID, + multiple-PDU-session-ID-instances, + multiple-qos-flow-ID-instances, + encryption-and-or-integrity-protection-algorithms-not-supported, + ng-intra-system-handover-triggered, + ng-inter-system-handover-triggered, + xn-handover-triggered, + not-supported-5QI-value, + ue-context-transfer, + ims-voice-eps-fallback-or-rat-fallback-triggered, + up-integrity-protection-not-possible, + up-confidentiality-protection-not-possible, + slice-not-supported, + ue-in-rrc-inactive-state-not-reachable, + redirection, + resources-not-available-for-the-slice, + ue-max-integrity-protected-data-rate-reason, + release-due-to-cn-detected-mobility, + ..., + n26-interface-not-available, + release-due-to-pre-emption, + multiple-location-reporting-reference-ID-instances, + rsn-not-available-for-the-up, + npn-access-denied, + cag-only-access-denied, + insufficient-ue-capabilities, + redcap-ue-not-supported, + unknown-MBS-Session-ID, + indicated-MBS-session-area-information-not-served-by-the-gNB, + inconsistent-slice-info-for-the-session, + misaligned-association-for-multicast-unicast, + eredcap-ue-not-supported, + two-rx-xr-ue-not-supported, + aerial-ue-flight-information-reporting-initiation-failure, + unknown-RAN-AIoT-Device-NGAP-ID, + requested-AIoT-service-area-information-not-served-by-the-gNB, + unknown-AIoT-session, + aiot-device-not-reachable, + multiple-AIoT-session-ID-instances +} + +CauseTransport ::= ENUMERATED { + transport-resource-unavailable, + unspecified, + ... +} + +Cell-CAGInformation ::= SEQUENCE { + nGRAN-CGI NGRAN-CGI, + cellCAGList CellCAGList, + iE-Extensions ProtocolExtensionContainer { {Cell-CAGInformation-ExtIEs} } OPTIONAL, + ... +} + +Cell-CAGInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +CellCAGList ::= SEQUENCE (SIZE(1..maxnoofCAGSperCell)) OF CAG-ID + +CellIDBroadcastEUTRA ::= SEQUENCE (SIZE(1..maxnoofCellIDforWarning)) OF CellIDBroadcastEUTRA-Item + +CellIDBroadcastEUTRA-Item ::= SEQUENCE { + eUTRA-CGI EUTRA-CGI, + iE-Extensions ProtocolExtensionContainer { {CellIDBroadcastEUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +CellIDBroadcastEUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIDBroadcastNR ::= SEQUENCE (SIZE(1..maxnoofCellIDforWarning)) OF CellIDBroadcastNR-Item + +CellIDBroadcastNR-Item ::= SEQUENCE { + nR-CGI NR-CGI, + iE-Extensions ProtocolExtensionContainer { {CellIDBroadcastNR-Item-ExtIEs} } OPTIONAL, + ... +} + +CellIDBroadcastNR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIDCancelledEUTRA ::= SEQUENCE (SIZE(1..maxnoofCellIDforWarning)) OF CellIDCancelledEUTRA-Item + +CellIDCancelledEUTRA-Item ::= SEQUENCE { + eUTRA-CGI EUTRA-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CellIDCancelledEUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +CellIDCancelledEUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIDCancelledNR ::= SEQUENCE (SIZE(1..maxnoofCellIDforWarning)) OF CellIDCancelledNR-Item + +CellIDCancelledNR-Item ::= SEQUENCE { + nR-CGI NR-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CellIDCancelledNR-Item-ExtIEs} } OPTIONAL, + ... +} + +CellIDCancelledNR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIDListForRestart ::= CHOICE { + eUTRA-CGIListforRestart EUTRA-CGIList, + nR-CGIListforRestart NR-CGIList, + choice-Extensions ProtocolIE-SingleContainer { {CellIDListForRestart-ExtIEs} } +} + +CellIDListForRestart-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +CellSize ::= ENUMERATED {verysmall, small, medium, large, ...} + + +CellType ::= SEQUENCE { + cellSize CellSize, + iE-Extensions ProtocolExtensionContainer { {CellType-ExtIEs} } OPTIONAL, + ... +} + +CellType-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CEmodeBSupport-Indicator ::= ENUMERATED {supported,...} + + +CEmodeBrestricted ::= ENUMERATED { + restricted, + not-restricted, + ... +} + +ClockAccuracy ::= CHOICE { + clockAccuracyValue INTEGER (1..40000000, ...), + clockAccuracyIndex INTEGER (32..47, ...), + choice-Extensions ProtocolIE-SingleContainer { { ClockAccuracy-ExtIEs} } +} + +ClockAccuracy-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +ClockQualityAcceptanceIndication ::= SEQUENCE { + clockQualityAcceptanceCriteria ClockQualityAcceptanceCriteria, + iE-Extensions ProtocolExtensionContainer { {ClockQualityAcceptanceIndication-ExtIEs} } OPTIONAL, + ... +} + +ClockQualityAcceptanceIndication-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ClockQualityAcceptanceCriteria ::= SEQUENCE { + synchronisationState BIT STRING (SIZE(8, ...)) OPTIONAL, + traceabletoUTC ENUMERATED {true, ...} OPTIONAL, + traceabletoGNSS ENUMERATED {true, ...} OPTIONAL, + clockFrequencyStability BIT STRING (SIZE(16)) OPTIONAL, + clockAccuracy INTEGER (1..40000000, ...) OPTIONAL, + parentTImeSource BIT STRING (SIZE(16, ...)) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ClockQualityAcceptanceCriteria-ExtIEs} } OPTIONAL, + ... +} + +ClockQualityAcceptanceCriteria-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ClockQualityReportingControlInfo ::= SEQUENCE { + clockQualityDetailLevel ClockQualityDetailLevel, + iE-Extensions ProtocolExtensionContainer { {ClockQualityReportingControlInfo-ExtIEs} } OPTIONAL, + ... +} + +ClockQualityReportingControlInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ClockQualityDetailLevel ::= CHOICE { + clockQualityMetrics NULL, + clockQualityAcceptanceIndication ClockQualityAcceptanceIndication, + choice-extensions ProtocolIE-SingleContainer { {ClockQualityDetailLevel-ExtIEs} } +} + +ClockQualityDetailLevel-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +CNAssistedRANTuning ::= SEQUENCE { + expectedUEBehaviour ExpectedUEBehaviour OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {CNAssistedRANTuning-ExtIEs} } OPTIONAL, + ... +} + +CNAssistedRANTuning-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CNsubgroupID ::= INTEGER (0..7, ...) + +CNTypeRestrictionsForEquivalent ::= SEQUENCE (SIZE(1..maxnoofEPLMNs)) OF CNTypeRestrictionsForEquivalentItem + +CNTypeRestrictionsForEquivalentItem ::= SEQUENCE { + plmnIdentity PLMNIdentity, + cn-Type ENUMERATED {epc-forbidden, fiveGC-forbidden, ...}, + iE-Extensions ProtocolExtensionContainer { {CNTypeRestrictionsForEquivalentItem-ExtIEs} } OPTIONAL, + ... +} + +CNTypeRestrictionsForEquivalentItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::={ + ... +} + +CNTypeRestrictionsForServing ::= ENUMERATED { + epc-forbidden, + ... +} + +CommandRequestTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { CommandRequestTransferIEs} }, + ... +} + +CommandRequestTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-RAN-AIOT-Device-NGAP-ID CRITICALITY reject TYPE RAN-AIOT-Device-NGAP-ID PRESENCE mandatory }| + { ID id-AIoT-NASPDU CRITICALITY reject TYPE AIoT-NASPDU PRESENCE mandatory }| + { ID id-AIoT-CommandAssistanceInformation CRITICALITY reject TYPE AIoT-CommandAssistanceInformation PRESENCE mandatory }, + ... +} + +CommandResponseTransfer ::= SEQUENCE { + correlationIdentifier AIoT-CorrelationIdentifier, + rAN-AIOT-Device-NGAP-ID RAN-AIOT-Device-NGAP-ID, + aIoT-NASPDU AIoT-NASPDU, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { CommandResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +CommandResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CommandFailureTransfer ::= SEQUENCE { + correlationIdentifier AIoT-CorrelationIdentifier, + rAN-AIOT-Device-NGAP-ID RAN-AIOT-Device-NGAP-ID, + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { CommandFailureTransfer-ExtIEs} } OPTIONAL, + ... +} + +CommandFailureTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CommonNetworkInstance ::= OCTET STRING + +CompletedCellsInEAI-EUTRA ::= SEQUENCE (SIZE(1..maxnoofCellinEAI)) OF CompletedCellsInEAI-EUTRA-Item + +CompletedCellsInEAI-EUTRA-Item ::= SEQUENCE { + eUTRA-CGI EUTRA-CGI, + iE-Extensions ProtocolExtensionContainer { {CompletedCellsInEAI-EUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +CompletedCellsInEAI-EUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CompletedCellsInEAI-NR ::= SEQUENCE (SIZE(1..maxnoofCellinEAI)) OF CompletedCellsInEAI-NR-Item + +CompletedCellsInEAI-NR-Item ::= SEQUENCE { + nR-CGI NR-CGI, + iE-Extensions ProtocolExtensionContainer { {CompletedCellsInEAI-NR-Item-ExtIEs} } OPTIONAL, + ... +} + +CompletedCellsInEAI-NR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CompletedCellsInTAI-EUTRA ::= SEQUENCE (SIZE(1..maxnoofCellinTAI)) OF CompletedCellsInTAI-EUTRA-Item + +CompletedCellsInTAI-EUTRA-Item ::= SEQUENCE{ + eUTRA-CGI EUTRA-CGI, + iE-Extensions ProtocolExtensionContainer { {CompletedCellsInTAI-EUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +CompletedCellsInTAI-EUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CompletedCellsInTAI-NR ::= SEQUENCE (SIZE(1..maxnoofCellinTAI)) OF CompletedCellsInTAI-NR-Item + +CompletedCellsInTAI-NR-Item ::= SEQUENCE{ + nR-CGI NR-CGI, + iE-Extensions ProtocolExtensionContainer { {CompletedCellsInTAI-NR-Item-ExtIEs} } OPTIONAL, + ... +} + +CompletedCellsInTAI-NR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ConcurrentWarningMessageInd ::= ENUMERATED { + true, + ... +} + +ConfidentialityProtectionIndication ::= ENUMERATED { + required, + preferred, + not-needed, + ... +} + +ConfidentialityProtectionResult ::= ENUMERATED { + performed, + not-performed, + ... +} + +ConfiguredTACIndication ::= ENUMERATED { + true, + ... +} + +CoreNetworkAssistanceInformationForInactive ::= SEQUENCE { + uEIdentityIndexValue UEIdentityIndexValue, + uESpecificDRX PagingDRX OPTIONAL, + periodicRegistrationUpdateTimer PeriodicRegistrationUpdateTimer, + mICOModeIndication MICOModeIndication OPTIONAL, + tAIListForInactive TAIListForInactive, + expectedUEBehaviour ExpectedUEBehaviour OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {CoreNetworkAssistanceInformationForInactive-ExtIEs} } OPTIONAL, + ... +} + +CoreNetworkAssistanceInformationForInactive-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-EUTRA-PagingeDRXInformation CRITICALITY ignore EXTENSION EUTRA-PagingeDRXInformation PRESENCE optional }| + { ID id-ExtendedUEIdentityIndexValue CRITICALITY ignore EXTENSION ExtendedUEIdentityIndexValue PRESENCE optional }| + { ID id-UERadioCapabilityForPaging CRITICALITY ignore EXTENSION UERadioCapabilityForPaging PRESENCE optional }| + { ID id-MicoAllPLMN CRITICALITY ignore EXTENSION MicoAllPLMN PRESENCE optional }| + { ID id-NR-PagingeDRXInformation CRITICALITY ignore EXTENSION NR-PagingeDRXInformation PRESENCE optional }| + { ID id-PagingCauseIndicationForVoiceService CRITICALITY ignore EXTENSION PagingCauseIndicationForVoiceService PRESENCE optional }| + { ID id-PEIPSassistanceInformation CRITICALITY ignore EXTENSION PEIPSassistanceInformation PRESENCE optional }| + { ID id-HashedUEIdentityIndexValue CRITICALITY ignore EXTENSION HashedUEIdentityIndexValue PRESENCE optional }| + { ID id-CN-MT-CommunicationHandling CRITICALITY ignore EXTENSION CN-MT-CommunicationHandling PRESENCE optional }| + { ID id-LPWUSPSAssistanceInformation CRITICALITY ignore EXTENSION LPWUSPSAssistanceInformation PRESENCE optional }| + { ID id-FurtherExtendedUEIdentityIndexValue CRITICALITY ignore EXTENSION FurtherExtendedUEIdentityIndexValue PRESENCE optional }| + { ID id-LPWUSDisableIndication CRITICALITY ignore EXTENSION LPWUSDisableIndication PRESENCE optional }, + ... +} + +CN-MT-CommunicationHandling ::= ENUMERATED {supported, ...} + +COUNTValueForPDCP-SN12 ::= SEQUENCE { + pDCP-SN12 INTEGER (0..4095), + hFN-PDCP-SN12 INTEGER (0..1048575), + iE-Extensions ProtocolExtensionContainer { {COUNTValueForPDCP-SN12-ExtIEs} } OPTIONAL, + ... +} + +COUNTValueForPDCP-SN12-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +COUNTValueForPDCP-SN18 ::= SEQUENCE { + pDCP-SN18 INTEGER (0..262143), + hFN-PDCP-SN18 INTEGER (0..16383), + iE-Extensions ProtocolExtensionContainer { {COUNTValueForPDCP-SN18-ExtIEs} } OPTIONAL, + ... +} + +COUNTValueForPDCP-SN18-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CoverageEnhancementLevel ::= OCTET STRING + +CPTransportLayerInformation ::= CHOICE { + endpointIPAddress TransportLayerAddress, + choice-Extensions ProtocolIE-SingleContainer { {CPTransportLayerInformation-ExtIEs} } +} + +CPTransportLayerInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-EndpointIPAddressAndPort CRITICALITY reject TYPE EndpointIPAddressAndPort PRESENCE mandatory }, + ... +} + +CriticalityDiagnostics ::= SEQUENCE { + procedureCode ProcedureCode OPTIONAL, + triggeringMessage TriggeringMessage OPTIONAL, + procedureCriticality Criticality OPTIONAL, + iEsCriticalityDiagnostics CriticalityDiagnostics-IE-List OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-ExtIEs}} OPTIONAL, + ... +} + +CriticalityDiagnostics-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CriticalityDiagnostics-IE-List ::= SEQUENCE (SIZE(1..maxnoofErrors)) OF CriticalityDiagnostics-IE-Item + +CriticalityDiagnostics-IE-Item ::= SEQUENCE { + iECriticality Criticality, + iE-ID ProtocolIE-ID, + typeOfError TypeOfError, + iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-IE-Item-ExtIEs}} OPTIONAL, + ... +} + +CriticalityDiagnostics-IE-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +C-RNTI ::= BIT STRING (SIZE(16)) + +CellBasedMDT-NR::= SEQUENCE { + cellIdListforMDT CellIdListforMDT-NR, + iE-Extensions ProtocolExtensionContainer { {CellBasedMDT-NR-ExtIEs} } OPTIONAL, + ... +} + +CellBasedMDT-NR-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIdListforMDT-NR ::= SEQUENCE (SIZE(1..maxnoofCellIDforMDT)) OF NR-CGI + + +CellBasedMDT-EUTRA::= SEQUENCE { + cellIdListforMDT CellIdListforMDT-EUTRA, + iE-Extensions ProtocolExtensionContainer { {CellBasedMDT-EUTRA-ExtIEs} } OPTIONAL, + ... +} + +CellBasedMDT-EUTRA-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellBasedQMC ::= SEQUENCE { + cellIdListforQMC CellIdListforQMC, + iE-Extensions ProtocolExtensionContainer { {CellBasedQMC-ExtIEs} } OPTIONAL, + ... +} + +CellBasedQMC-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIdListforQMC ::= SEQUENCE (SIZE(1..maxnoofCellIDforQMC)) OF NGRAN-CGI + +CellIdListforMDT-EUTRA ::= SEQUENCE (SIZE(1..maxnoofCellIDforMDT)) OF EUTRA-CGI + +CAGListforMDT ::= SEQUENCE (SIZE(1.. maxnoofCAGforMDT)) OF CAGListforMDTItem + +CAGListforMDTItem ::= SEQUENCE { + plmnID PLMNIdentity, + cAGID CAG-ID, + iE-Extensions ProtocolExtensionContainer { {CAGListforMDTItem-ExtIEs} } OPTIONAL, + ... +} + +CAGListforMDTItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::={ + ... +} + + +-- D + +DataCodingScheme ::= BIT STRING (SIZE(8)) + +DataForwardingAccepted ::= ENUMERATED { + data-forwarding-accepted, + ... +} + +DataForwardingNotPossible ::= ENUMERATED { + data-forwarding-not-possible, + ... +} + +DataForwardingResponseDRBList ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF DataForwardingResponseDRBItem + +DataForwardingResponseDRBItem ::= SEQUENCE { + dRB-ID DRB-ID, + dLForwardingUP-TNLInformation UPTransportLayerInformation OPTIONAL, + uLForwardingUP-TNLInformation UPTransportLayerInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{DataForwardingResponseDRBItem-ExtIEs}} OPTIONAL, + ... +} + +DataForwardingResponseDRBItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DAPSRequestInfo ::= SEQUENCE { + dAPSIndicator ENUMERATED {daps-ho-required, ...}, + iE-Extensions ProtocolExtensionContainer { {DAPSRequestInfo-ExtIEs} } OPTIONAL, + ... +} + +DAPSRequestInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DAPSResponseInfoList ::= SEQUENCE (SIZE(1.. maxnoofDRBs)) OF DAPSResponseInfoItem + +DAPSResponseInfoItem ::= SEQUENCE { + dRB-ID DRB-ID, + dAPSResponseInfo DAPSResponseInfo, + iE-Extension ProtocolExtensionContainer { {DAPSResponseInfoItem-ExtIEs} } OPTIONAL, + ... +} + +DAPSResponseInfoItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DAPSResponseInfo ::= SEQUENCE { + dapsresponseindicator ENUMERATED {daps-ho-accepted, daps-ho-not-accepted, ...}, + iE-Extensions ProtocolExtensionContainer { { DAPSResponseInfo-ExtIEs} } OPTIONAL, + ... +} + +DAPSResponseInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +DataForwardingResponseERABList ::= SEQUENCE (SIZE(1..maxnoofE-RABs)) OF DataForwardingResponseERABListItem + +DataForwardingResponseERABListItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + dLForwardingUP-TNLInformation UPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { {DataForwardingResponseERABListItem-ExtIEs} } OPTIONAL, + ... +} + +DataForwardingResponseERABListItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DelayCritical ::= ENUMERATED { + delay-critical, + non-delay-critical, + ... +} + +DL-CP-SecurityInformation ::= SEQUENCE { + dl-NAS-MAC DL-NAS-MAC, + iE-Extensions ProtocolExtensionContainer { { DL-CP-SecurityInformation-ExtIEs} } OPTIONAL, + ... +} + +DL-CP-SecurityInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DL-Signalling ::= ENUMERATED {true, ...} + + +DL-NAS-MAC ::= BIT STRING (SIZE (16)) + +DLForwarding ::= ENUMERATED { + dl-forwarding-proposed, + ... +} + +DL-NGU-TNLInformationReused ::= ENUMERATED { + true, + ... +} + +DLPDUSetInformationMarkingSupportIndication ::= ENUMERATED {true, ...} + +DirectForwardingPathAvailability ::= ENUMERATED { + direct-path-available, + ... +} + +DRB-ID ::= INTEGER (1..32, ...) + +DRBsSubjectToStatusTransferList ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF DRBsSubjectToStatusTransferItem + +DRBsSubjectToStatusTransferItem ::= SEQUENCE { + dRB-ID DRB-ID, + dRBStatusUL DRBStatusUL, + dRBStatusDL DRBStatusDL, + iE-Extension ProtocolExtensionContainer { {DRBsSubjectToStatusTransferItem-ExtIEs} } OPTIONAL, + ... +} + +DRBsSubjectToStatusTransferItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-OldAssociatedQosFlowList-ULendmarkerexpected CRITICALITY ignore EXTENSION AssociatedQosFlowList PRESENCE optional }, + ... +} + +DRBStatusDL ::= CHOICE { + dRBStatusDL12 DRBStatusDL12, + dRBStatusDL18 DRBStatusDL18, + choice-Extensions ProtocolIE-SingleContainer { {DRBStatusDL-ExtIEs} } +} + +DRBStatusDL-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +DRBStatusDL12 ::= SEQUENCE { + dL-COUNTValue COUNTValueForPDCP-SN12, + iE-Extension ProtocolExtensionContainer { {DRBStatusDL12-ExtIEs} } OPTIONAL, + ... +} + +DRBStatusDL12-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBStatusDL18 ::= SEQUENCE { + dL-COUNTValue COUNTValueForPDCP-SN18, + iE-Extension ProtocolExtensionContainer { {DRBStatusDL18-ExtIEs} } OPTIONAL, + ... +} + +DRBStatusDL18-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBStatusUL ::= CHOICE { + dRBStatusUL12 DRBStatusUL12, + dRBStatusUL18 DRBStatusUL18, + choice-Extensions ProtocolIE-SingleContainer { {DRBStatusUL-ExtIEs} } +} + +DRBStatusUL-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +DRBStatusUL12 ::= SEQUENCE { + uL-COUNTValue COUNTValueForPDCP-SN12, + receiveStatusOfUL-PDCP-SDUs BIT STRING (SIZE(1..2048)) OPTIONAL, + iE-Extension ProtocolExtensionContainer { {DRBStatusUL12-ExtIEs} } OPTIONAL, + ... +} + +DRBStatusUL12-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBStatusUL18 ::= SEQUENCE { + uL-COUNTValue COUNTValueForPDCP-SN18, + receiveStatusOfUL-PDCP-SDUs BIT STRING (SIZE(1..131072)) OPTIONAL, + iE-Extension ProtocolExtensionContainer { {DRBStatusUL18-ExtIEs} } OPTIONAL, + ... +} + +DRBStatusUL18-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBsToQosFlowsMappingList ::= SEQUENCE (SIZE(1..maxnoofDRBs)) OF DRBsToQosFlowsMappingItem + +DRBsToQosFlowsMappingItem ::= SEQUENCE { + dRB-ID DRB-ID, + associatedQosFlowList AssociatedQosFlowList, + iE-Extensions ProtocolExtensionContainer { {DRBsToQosFlowsMappingItem-ExtIEs} } OPTIONAL, + ... +} + +DRBsToQosFlowsMappingItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-DAPSRequestInfo CRITICALITY ignore EXTENSION DAPSRequestInfo PRESENCE optional }, + ... +} + +Dynamic5QIDescriptor ::= SEQUENCE { + priorityLevelQos PriorityLevelQos, + packetDelayBudget PacketDelayBudget, + packetErrorRate PacketErrorRate, + fiveQI FiveQI OPTIONAL, + delayCritical DelayCritical OPTIONAL, +-- The above IE shall be present in case of GBR QoS flow + averagingWindow AveragingWindow OPTIONAL, +-- The above IE shall be present in case of GBR QoS flow + maximumDataBurstVolume MaximumDataBurstVolume OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {Dynamic5QIDescriptor-ExtIEs} } OPTIONAL, + ... +} + +Dynamic5QIDescriptor-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-ExtendedPacketDelayBudget CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }| + { ID id-CNPacketDelayBudgetDL CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }| + { ID id-CNPacketDelayBudgetUL CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }, + ... +} + +-- E + +EarlyMeasurement ::= ENUMERATED {true, ...} + +EarlyStatusTransfer-TransparentContainer ::= SEQUENCE { + procedureStage ProcedureStageChoice, + iE-Extensions ProtocolExtensionContainer { {EarlyStatusTransfer-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} + +EarlyStatusTransfer-TransparentContainer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ProcedureStageChoice ::= CHOICE { + first-dl-count FirstDLCount, + choice-Extensions ProtocolIE-SingleContainer { {ProcedureStageChoice-ExtIEs} } +} + +ProcedureStageChoice-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-DLDiscarding CRITICALITY ignore TYPE DLDiscarding PRESENCE mandatory }, + ... +} + +DLDiscarding ::= SEQUENCE { + dRBsSubjectToDLDiscarding DRBsSubjectToDLDiscarding-List, + iE-Extension ProtocolExtensionContainer { {DLDiscarding-ExtIEs} } OPTIONAL, + ... +} + +DLDiscarding-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBsSubjectToDLDiscarding-List ::= SEQUENCE (SIZE (1..maxnoofDRBs)) OF DRBsSubjectToDLDiscarding-Item + +DRBsSubjectToDLDiscarding-Item ::= SEQUENCE { + drbID DRB-ID, + dlCount DLCountChoice, + iE-Extension ProtocolExtensionContainer { { DRBsSubjectToDLDiscarding-Item-ExtIEs} } OPTIONAL, + ... +} + +DRBsSubjectToDLDiscarding-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DLCountChoice ::= CHOICE { + count12bits COUNTValueForPDCP-SN12, + count18bits COUNTValueForPDCP-SN18, + choice-extension ProtocolIE-SingleContainer { {DLCountChoice-ExtIEs} } +} + +DLCountChoice-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +FirstDLCount ::= SEQUENCE { + dRBsSubjectToEarlyStatusTransfer DRBsSubjectToEarlyStatusTransfer-List, + iE-Extension ProtocolExtensionContainer { {FirstDLCount-ExtIEs} } OPTIONAL, + ... +} + +FirstDLCount-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +DRBsSubjectToEarlyStatusTransfer-List ::= SEQUENCE (SIZE (1.. maxnoofDRBs)) OF DRBsSubjectToEarlyStatusTransfer-Item + +DRBsSubjectToEarlyStatusTransfer-Item ::= SEQUENCE { + dRB-ID DRB-ID, + firstDLCOUNT DRBStatusDL, + iE-Extension ProtocolExtensionContainer { { DRBsSubjectToEarlyStatusTransfer-Item-ExtIEs} } OPTIONAL, + ... +} + +DRBsSubjectToEarlyStatusTransfer-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ECNMarkingorCongestionInformationReportingRequest ::= CHOICE { + eCNMarkingAtRANRequest ECNMarkingAtRANRequest, + eCNMarkingAtUPFRequest ECNMarkingAtUPFRequest, + congestionInformationRequest CongestionInformationRequest, + choice-Extensions ProtocolIE-SingleContainer { {ECNMarkingorCongestionInformationReportingRequest-ExtIEs} } +} + +ECNMarkingorCongestionInformationReportingRequest-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +ECNMarkingAtRANRequest ::= ENUMERATED {ul, dl, both, stop, ...} + +ECNMarkingAtUPFRequest ::= ENUMERATED {ul, dl, both, stop, ...} + +CongestionInformationRequest ::= ENUMERATED {ul, dl, both, stop, ...} + +ECNMarkingorCongestionInformationReportingStatus ::= SEQUENCE (SIZE (1..maxnoofQosFlows)) OF ECNMarkingorCongestionInformationReportingStatus-Item + +ECNMarkingorCongestionInformationReportingStatus-Item ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + activationStatus ActivationStatus, + iE-Extension ProtocolExtensionContainer { { ECNMarkingorCongestionInformationReportingStatus-Item-ExtIEs} } OPTIONAL, + ... +} + +ECNMarkingorCongestionInformationReportingStatus-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ActivationStatus ::= ENUMERATED { + active, + not-active, + ... +} + +EDT-Session ::= ENUMERATED { + true, + ... +} + +EmergencyAreaID ::= OCTET STRING (SIZE(3)) + +EmergencyAreaIDBroadcastEUTRA ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaIDBroadcastEUTRA-Item + +EmergencyAreaIDBroadcastEUTRA-Item ::= SEQUENCE { + emergencyAreaID EmergencyAreaID, + completedCellsInEAI-EUTRA CompletedCellsInEAI-EUTRA, + iE-Extensions ProtocolExtensionContainer { {EmergencyAreaIDBroadcastEUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +EmergencyAreaIDBroadcastEUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EmergencyAreaIDBroadcastNR ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaIDBroadcastNR-Item + +EmergencyAreaIDBroadcastNR-Item ::= SEQUENCE { + emergencyAreaID EmergencyAreaID, + completedCellsInEAI-NR CompletedCellsInEAI-NR, + iE-Extensions ProtocolExtensionContainer { {EmergencyAreaIDBroadcastNR-Item-ExtIEs} } OPTIONAL, + ... +} + +EmergencyAreaIDBroadcastNR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EmergencyAreaIDCancelledEUTRA ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaIDCancelledEUTRA-Item + +EmergencyAreaIDCancelledEUTRA-Item ::= SEQUENCE { + emergencyAreaID EmergencyAreaID, + cancelledCellsInEAI-EUTRA CancelledCellsInEAI-EUTRA, + iE-Extensions ProtocolExtensionContainer { {EmergencyAreaIDCancelledEUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +EmergencyAreaIDCancelledEUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EmergencyAreaIDCancelledNR ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaIDCancelledNR-Item + +EmergencyAreaIDCancelledNR-Item ::= SEQUENCE { + emergencyAreaID EmergencyAreaID, + cancelledCellsInEAI-NR CancelledCellsInEAI-NR, + iE-Extensions ProtocolExtensionContainer { {EmergencyAreaIDCancelledNR-Item-ExtIEs} } OPTIONAL, + ... +} + +EmergencyAreaIDCancelledNR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EmergencyAreaIDList ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaID + +EmergencyAreaIDListForRestart ::= SEQUENCE (SIZE(1..maxnoofEAIforRestart)) OF EmergencyAreaID + +EmergencyFallbackIndicator ::= SEQUENCE { + emergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator, + emergencyServiceTargetCN EmergencyServiceTargetCN OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {EmergencyFallbackIndicator-ExtIEs} } OPTIONAL, + ... +} + +EmergencyFallbackIndicator-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EmergencyFallbackRequestIndicator ::= ENUMERATED { + emergency-fallback-requested, + ... +} + +EmergencyServiceTargetCN ::= ENUMERATED { + fiveGC, + epc, + ... +} + +ENB-ID ::= CHOICE { + macroENB-ID BIT STRING (SIZE(20)), + homeENB-ID BIT STRING (SIZE(28)), + short-macroENB-ID BIT STRING (SIZE(18)), + long-macroENB-ID BIT STRING (SIZE(21)), + choice-Extensions ProtocolIE-SingleContainer { { ENB-ID-ExtIEs} } +} + +ENB-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + + +Enhanced-CoverageRestriction ::= ENUMERATED {restricted, ... } + + +Extended-ConnectedTime ::= INTEGER (0..255) + +EN-DCSONConfigurationTransfer ::= OCTET STRING + +EndpointIPAddressAndPort ::=SEQUENCE { + endpointIPAddress TransportLayerAddress, + portNumber PortNumber, + iE-Extensions ProtocolExtensionContainer { { EndpointIPAddressAndPort-ExtIEs} } OPTIONAL +} + +EndIndication ::= ENUMERATED { + no-further-data, + further-data-exists, + ... +} + +EndpointIPAddressAndPort-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EquivalentPLMNs ::= SEQUENCE (SIZE(1..maxnoofEPLMNs)) OF PLMNIdentity + +EPS-TAC ::= OCTET STRING (SIZE(2)) + +EPS-TAI ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + ePS-TAC EPS-TAC, + iE-Extensions ProtocolExtensionContainer { {EPS-TAI-ExtIEs} } OPTIONAL, + ... +} + +EPS-TAI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +E-RAB-ID ::= INTEGER (0..15, ...) + +E-RABInformationList ::= SEQUENCE (SIZE(1..maxnoofE-RABs)) OF E-RABInformationItem + +E-RABInformationItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + dLForwarding DLForwarding OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {E-RABInformationItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABInformationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-SourceTNLAddrInfo CRITICALITY ignore EXTENSION TransportLayerAddress PRESENCE optional}| + {ID id-SourceNodeTNLAddrInfo CRITICALITY ignore EXTENSION TransportLayerAddress PRESENCE optional}, + ... +} + +ERedCapIndication ::= ENUMERATED { + true, + ... +} + +EUTRACellIdentity ::= BIT STRING (SIZE(28)) + +EUTRA-CGI ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + eUTRACellIdentity EUTRACellIdentity, + iE-Extensions ProtocolExtensionContainer { {EUTRA-CGI-ExtIEs} } OPTIONAL, + ... +} + +EUTRA-CGI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRA-CGIList ::= SEQUENCE (SIZE(1..maxnoofCellsinngeNB)) OF EUTRA-CGI + +EUTRA-CGIListForWarning ::= SEQUENCE (SIZE(1..maxnoofCellIDforWarning)) OF EUTRA-CGI + +EUTRA-PagingeDRXInformation ::= SEQUENCE { + eUTRA-paging-eDRX-Cycle EUTRA-Paging-eDRX-Cycle, + eUTRA-paging-Time-Window EUTRA-Paging-Time-Window OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {EUTRA-PagingeDRXInformation-ExtIEs} } OPTIONAL, + ... +} + +EUTRA-PagingeDRXInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRA-Paging-eDRX-Cycle ::= ENUMERATED { + hfhalf, hf1, hf2, hf4, hf6, + hf8, hf10, hf12, hf14, hf16, + hf32, hf64, hf128, hf256, + ... +} + +EUTRA-Paging-Time-Window ::= ENUMERATED { + s1, s2, s3, s4, s5, + s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, + ... +} + +EUTRAencryptionAlgorithms ::= BIT STRING (SIZE(16, ...)) + +EUTRAintegrityProtectionAlgorithms ::= BIT STRING (SIZE(16, ...)) + +EventType ::= ENUMERATED { + direct, + change-of-serve-cell, + ue-presence-in-area-of-interest, + stop-change-of-serve-cell, + stop-ue-presence-in-area-of-interest, + cancel-location-reporting-for-the-ue, + ..., + change-of-serving-cell-and-UE-presence-in-the-Area-of-Interest, + report-the-Aerial-UE-flight-information, + cancel-the-Aerial-UE-flight-information-reporting +} + +ExcessPacketDelayThresholdConfiguration ::= SEQUENCE (SIZE(1..maxnoofThresholdsForExcessPacketDelay)) OF ExcessPacketDelayThresholdItem + +ExcessPacketDelayThresholdItem ::= SEQUENCE { + fiveQi FiveQI, + excessPacketDelayThresholdValue ExcessPacketDelayThresholdValue, + iE-Extensions ProtocolExtensionContainer { { ExcessPacketDelayThresholdItem-ExtIEs} } OPTIONAL, + ... +} + +ExcessPacketDelayThresholdItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ExcessPacketDelayThresholdValue ::= ENUMERATED { +ms0dot25, ms0dot5, ms1, ms2, ms4, ms5, ms10, ms20, ms30, ms40, ms50, ms60, ms70, ms80, ms90, ms100, ms150, ms300, ms500, + ... +} + +ExpectedActivityPeriod ::= INTEGER (1..30|40|50|60|80|100|120|150|180|181, ...) + +ExpectedHOInterval ::= ENUMERATED { + sec15, sec30, sec60, sec90, sec120, sec180, long-time, + ... +} + +ExpectedIdlePeriod ::= INTEGER (1..30|40|50|60|80|100|120|150|180|181, ...) + +ExpectedUEActivityBehaviour ::= SEQUENCE { + expectedActivityPeriod ExpectedActivityPeriod OPTIONAL, + expectedIdlePeriod ExpectedIdlePeriod OPTIONAL, + sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {ExpectedUEActivityBehaviour-ExtIEs} } OPTIONAL, + ... +} + +ExpectedUEActivityBehaviour-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ExpectedUEBehaviour ::= SEQUENCE { + expectedUEActivityBehaviour ExpectedUEActivityBehaviour OPTIONAL, + expectedHOInterval ExpectedHOInterval OPTIONAL, + expectedUEMobility ExpectedUEMobility OPTIONAL, + expectedUEMovingTrajectory ExpectedUEMovingTrajectory OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {ExpectedUEBehaviour-ExtIEs} } OPTIONAL, + ... +} + +ExpectedUEBehaviour-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ExpectedUEMobility ::= ENUMERATED { + stationary, + mobile, + ... +} + +ExpectedUEMovingTrajectory ::= SEQUENCE (SIZE(1..maxnoofCellsUEMovingTrajectory)) OF ExpectedUEMovingTrajectoryItem + +ExpectedUEMovingTrajectoryItem ::= SEQUENCE { + nGRAN-CGI NGRAN-CGI, + timeStayedInCell INTEGER (0..4095) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {ExpectedUEMovingTrajectoryItem-ExtIEs} } OPTIONAL, + ... +} + +ExpectedUEMovingTrajectoryItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Extended-AMFName ::= SEQUENCE { + aMFNameVisibleString AMFNameVisibleString OPTIONAL, + aMFNameUTF8String AMFNameUTF8String OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { Extended-AMFName-ExtIEs } } OPTIONAL, + ... +} + +Extended-AMFName-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ExtendedPacketDelayBudget ::= INTEGER (1..65535, ..., 65536..109999) + + +Extended-RANNodeName ::= SEQUENCE { + rANNodeNameVisibleString RANNodeNameVisibleString OPTIONAL, + rANNodeNameUTF8String RANNodeNameUTF8String OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { Extended-RANNodeName-ExtIEs } } OPTIONAL, + ... +} + +Extended-RANNodeName-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ExtendedRATRestrictionInformation ::= SEQUENCE { + primaryRATRestriction BIT STRING (SIZE(8, ..., 16)), + secondaryRATRestriction BIT STRING (SIZE(8, ...)), + iE-Extensions ProtocolExtensionContainer { {ExtendedRATRestrictionInformation-ExtIEs} } OPTIONAL, + ... +} + +ExtendedRATRestrictionInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ExtendedRNC-ID ::= INTEGER (4096..65535) + +ExtendedSliceSupportList ::= SEQUENCE (SIZE(1..maxnoofExtSliceItems)) OF SliceSupportItem + +ExtendedUEIdentityIndexValue ::= BIT STRING (SIZE(16)) + +EventTrigger::= CHOICE { + outOfCoverage ENUMERATED {true, ...}, + eventL1LoggedMDTConfig EventL1LoggedMDTConfig, + choice-Extensions ProtocolIE-SingleContainer { { EventTrigger-ExtIEs} } +} + +EventTrigger-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +EventL1LoggedMDTConfig ::= SEQUENCE { + l1Threshold MeasurementThresholdL1LoggedMDT, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger, + iE-Extensions ProtocolExtensionContainer { { EventL1LoggedMDTConfig-ExtIEs} } OPTIONAL, + ... +} + +EventL1LoggedMDTConfig-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MeasurementThresholdL1LoggedMDT ::= CHOICE { + threshold-RSRP Threshold-RSRP, + threshold-RSRQ Threshold-RSRQ, + choice-Extensions ProtocolIE-SingleContainer { { MeasurementThresholdL1LoggedMDT-ExtIEs} } +} + +MeasurementThresholdL1LoggedMDT-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +EquivalentSNPNsList ::= SEQUENCE (SIZE(1..maxnoofESNPNs)) OF EquivalentSNPNsItem + +EquivalentSNPNsItem ::= SEQUENCE { + plmnIdentity PLMNIdentity, + nID NID, + iE-Extensions ProtocolExtensionContainer { {EquivalentSNPNsItem-ExtIEs} } OPTIONAL, + ... +} + +EquivalentSNPNsItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::={ + ... +} + +-- F + +FailureIndication ::= SEQUENCE { + uERLFReportContainer UERLFReportContainer, + iE-Extensions ProtocolExtensionContainer { { FailureIndication-ExtIEs} } OPTIONAL, + ... +} + +FailureIndication-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +FiveGCAction ::= CHOICE { + hLComActivate HLComActivate, + hLComDeactivate HLComDeactivate, + choice-Extensions ProtocolIE-SingleContainer { {FiveGCAction-ExtIEs} } +} + +FiveGCAction-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +FiveG-ProSeAuthorized ::= SEQUENCE { + fiveGProSeDirectDiscovery FiveGProSeDirectDiscovery OPTIONAL, + fiveGProSeDirectCommunication FiveGProSeDirectCommunication OPTIONAL, + fiveGProSeLayer2UEtoNetworkRelay FiveGProSeLayer2UEtoNetworkRelay OPTIONAL, + fiveGProSeLayer3UEtoNetworkRelay FiveGProSeLayer3UEtoNetworkRelay OPTIONAL, + fiveGProSeLayer2RemoteUE FiveGProSeLayer2RemoteUE OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {FiveG-ProSeAuthorized-ExtIEs} } OPTIONAL, + ... +} + +FiveG-ProSeAuthorized-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-FiveGProSeLayer2Multipath CRITICALITY ignore EXTENSION FiveGProSeLayer2Multipath PRESENCE optional }| + { ID id-FiveGProSeLayer2UEtoUERelay CRITICALITY ignore EXTENSION FiveGProSeLayer2UEtoUERelay PRESENCE optional }| + { ID id-FiveGProSeLayer2UEtoUERemote CRITICALITY ignore EXTENSION FiveGProSeLayer2UEtoUERemote PRESENCE optional }| + { ID id-FiveGProSeLayer2MHUEtoNetworkRelay CRITICALITY ignore EXTENSION FiveGProSeLayer2MHUEtoNetworkRelay PRESENCE optional}| + { ID id-FiveGProSeLayer2MHIntermediateUEtoNetworkRelay CRITICALITY ignore EXTENSION FiveGProSeLayer2MHIntermediateUEtoNetworkRelay PRESENCE optional}| + { ID id-FiveGProSeLayer2MHRemote CRITICALITY ignore EXTENSION FiveGProSeLayer2MHRemote PRESENCE optional}| + { ID id-FiveGProSeLayer3MHUEtoNetworkRelay CRITICALITY ignore EXTENSION FiveGProSeLayer3MHUEtoNetworkRelay PRESENCE optional}, + ... +} + +FiveGProSeDirectDiscovery ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeDirectCommunication ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2UEtoNetworkRelay ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer3UEtoNetworkRelay ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2RemoteUE ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2Multipath ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2UEtoUERelay ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2UEtoUERemote ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2MHUEtoNetworkRelay ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2MHIntermediateUEtoNetworkRelay ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer2MHRemote ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +FiveGProSeLayer3MHUEtoNetworkRelay ::= ENUMERATED { + authorized, + not-authorized, + ... +} + + +FiveG-ProSePC5QoSParameters ::= SEQUENCE { + fiveGProSepc5QoSFlowList FiveGProSePC5QoSFlowList, + fiveGProSepc5LinkAggregateBitRates BitRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { FiveG-ProSePC5QoSParameters-ExtIEs} } OPTIONAL, + ... +} + +FiveG-ProSePC5QoSParameters-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +FiveGProSePC5QoSFlowList ::= SEQUENCE (SIZE(1..maxnoofPC5QoSFlows)) OF FiveGProSePC5QoSFlowItem + +FiveGProSePC5QoSFlowItem ::= SEQUENCE { + fiveGproSepQI FiveQI, + fiveGproSepc5FlowBitRates FiveGProSePC5FlowBitRates OPTIONAL, + fiveGproSerange Range OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { FiveGProSePC5QoSFlowItem-ExtIEs} } OPTIONAL, + ... +} + +FiveGProSePC5QoSFlowItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +FiveGProSePC5FlowBitRates ::= SEQUENCE { + fiveGproSeguaranteedFlowBitRate BitRate, + fiveGproSemaximumFlowBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { { FiveGProSePC5FlowBitRates-ExtIEs} } OPTIONAL, + ... +} + +FiveGProSePC5FlowBitRates-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +FiveG-S-TMSI ::= SEQUENCE { + aMFSetID AMFSetID, + aMFPointer AMFPointer, + fiveG-TMSI FiveG-TMSI, + iE-Extensions ProtocolExtensionContainer { {FiveG-S-TMSI-ExtIEs} } OPTIONAL, + ... +} + +FiveG-S-TMSI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +FiveG-TMSI ::= OCTET STRING (SIZE(4)) + +FiveQI ::= INTEGER (0..255, ...) + +ForbiddenAreaInformation ::= SEQUENCE (SIZE(1.. maxnoofEPLMNsPlusOne)) OF ForbiddenAreaInformation-Item + +ForbiddenAreaInformation-Item ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + forbiddenTACs ForbiddenTACs, + iE-Extensions ProtocolExtensionContainer { {ForbiddenAreaInformation-Item-ExtIEs} } OPTIONAL, + ... +} + +ForbiddenAreaInformation-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ForbiddenTACs ::= SEQUENCE (SIZE(1..maxnoofForbTACs)) OF TAC + +FromEUTRANtoNGRAN ::= SEQUENCE { + sourceeNBID IntersystemSONeNBID, + targetNGRANnodeID IntersystemSONNGRANnodeID, + iE-Extensions ProtocolExtensionContainer { { FromEUTRANtoNGRAN-ExtIEs} } OPTIONAL +} + +FromEUTRANtoNGRAN-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +FromNGRANtoEUTRAN ::= SEQUENCE { + sourceNGRANnodeID IntersystemSONNGRANnodeID, + targeteNBID IntersystemSONeNBID, + iE-Extensions ProtocolExtensionContainer { { FromNGRANtoEUTRAN-ExtIEs} } OPTIONAL +} + +FromNGRANtoEUTRAN-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +FurtherExtendedUEIdentityIndexValue ::= BIT STRING (SIZE(20)) + +-- G + +GBR-QosInformation ::= SEQUENCE { + maximumFlowBitRateDL BitRate, + maximumFlowBitRateUL BitRate, + guaranteedFlowBitRateDL BitRate, + guaranteedFlowBitRateUL BitRate, + notificationControl NotificationControl OPTIONAL, + maximumPacketLossRateDL PacketLossRate OPTIONAL, + maximumPacketLossRateUL PacketLossRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {GBR-QosInformation-ExtIEs} } OPTIONAL, + ... +} + +GBR-QosInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-AlternativeQoSParaSetList CRITICALITY ignore EXTENSION AlternativeQoSParaSetList PRESENCE optional }| + { ID id-MonitoringRequestonAvailableBitrate CRITICALITY ignore EXTENSION MonitoringRequestonAvailableBitrate PRESENCE optional}, + ... +} + +GeographyBasedMDT ::= SEQUENCE { + nTN-Geographical-Area NTN-Geographical-Area-List, + nTN-PLMN-List MDTPLMNList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {GeographyBasedMDT-ExtIEs} } OPTIONAL, + ... +} + +GeographyBasedMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +GlobalCable-ID ::= OCTET STRING + +GlobalCable-ID-new ::= SEQUENCE { + globalCable-ID GlobalCable-ID, + tAI TAI, + iE-Extensions ProtocolExtensionContainer { { GlobalCable-ID-new-ExtIEs} } OPTIONAL, + ... +} + +GlobalCable-ID-new-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GlobalENB-ID ::= SEQUENCE { + pLMNidentity PLMNIdentity, + eNB-ID ENB-ID, + iE-Extensions ProtocolExtensionContainer { {GlobalENB-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalENB-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +GlobalGNB-ID ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + gNB-ID GNB-ID, + iE-Extensions ProtocolExtensionContainer { {GlobalGNB-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalGNB-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GlobalN3IWF-ID ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + n3IWF-ID N3IWF-ID, + iE-Extensions ProtocolExtensionContainer { {GlobalN3IWF-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalN3IWF-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GlobalLine-ID ::= SEQUENCE { + globalLineIdentity GlobalLineIdentity, + lineType LineType OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {GlobalLine-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalLine-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-TAI CRITICALITY ignore EXTENSION TAI PRESENCE optional }, + ... +} + +GlobalLineIdentity ::= OCTET STRING + +GlobalNgENB-ID ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + ngENB-ID NgENB-ID, + iE-Extensions ProtocolExtensionContainer { {GlobalNgENB-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalNgENB-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GlobalRANNodeID ::= CHOICE { + globalGNB-ID GlobalGNB-ID, + globalNgENB-ID GlobalNgENB-ID, + globalN3IWF-ID GlobalN3IWF-ID, + choice-Extensions ProtocolIE-SingleContainer { {GlobalRANNodeID-ExtIEs} } +} + +GlobalRANNodeID-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-GlobalTNGF-ID CRITICALITY reject TYPE GlobalTNGF-ID PRESENCE mandatory }| + { ID id-GlobalTWIF-ID CRITICALITY reject TYPE GlobalTWIF-ID PRESENCE mandatory }| + { ID id-GlobalW-AGF-ID CRITICALITY reject TYPE GlobalW-AGF-ID PRESENCE mandatory }, + ... +} + +GlobalTNGF-ID ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + tNGF-ID TNGF-ID, + iE-Extensions ProtocolExtensionContainer { { GlobalTNGF-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalTNGF-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +GlobalTWIF-ID ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + tWIF-ID TWIF-ID, + iE-Extensions ProtocolExtensionContainer { { GlobalTWIF-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalTWIF-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +GlobalW-AGF-ID ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + w-AGF-ID W-AGF-ID, + iE-Extensions ProtocolExtensionContainer { { GlobalW-AGF-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalW-AGF-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-ID ::= CHOICE { + gNB-ID BIT STRING (SIZE(22..32)), + choice-Extensions ProtocolIE-SingleContainer { {GNB-ID-ExtIEs} } +} + +GNB-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +GTP-TEID ::= OCTET STRING (SIZE(4)) + +GTPTunnel ::= SEQUENCE { + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { {GTPTunnel-ExtIEs} } OPTIONAL, + ... +} + +GTPTunnel-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GUAMI ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + aMFRegionID AMFRegionID, + aMFSetID AMFSetID, + aMFPointer AMFPointer, + iE-Extensions ProtocolExtensionContainer { {GUAMI-ExtIEs} } OPTIONAL, + ... +} + +GUAMI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GUAMIType ::= ENUMERATED {native, mapped, ...} + +GUAMIList ::= SEQUENCE (SIZE(1..maxnoofGUAMIs)) OF GUAMIList-Item + +GUAMIList-Item ::= SEQUENCE { + gUAMI GUAMI, + iE-Extensions ProtocolExtensionContainer { {GUAMIList-Item-ExtIEs} } OPTIONAL, + ... +} + +GUAMIList-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GW-Context-Release-Indication ::= ENUMERATED {true, ...} + +-- H + +HandoverCommandTransfer ::= SEQUENCE { + dLForwardingUP-TNLInformation UPTransportLayerInformation OPTIONAL, + qosFlowToBeForwardedList QosFlowToBeForwardedList OPTIONAL, + dataForwardingResponseDRBList DataForwardingResponseDRBList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {HandoverCommandTransfer-ExtIEs} } OPTIONAL, + ... +} + +HandoverCommandTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-AdditionalDLForwardingUPTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformationList PRESENCE optional }| + { ID id-ULForwardingUP-TNLInformation CRITICALITY reject EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-AdditionalULForwardingUPTNLInformation CRITICALITY reject EXTENSION UPTransportLayerInformationList PRESENCE optional }| + { ID id-DataForwardingResponseERABList CRITICALITY ignore EXTENSION DataForwardingResponseERABList PRESENCE optional }| + { ID id-QosFlowFailedToSetupList CRITICALITY ignore EXTENSION QosFlowListWithCause PRESENCE optional }, + ... +} + +HandoverFlag ::= ENUMERATED { + handover-preparation, + ... +} + +HandoverPreparationUnsuccessfulTransfer ::= SEQUENCE { + cause Cause, + iE-Extensions ProtocolExtensionContainer { {HandoverPreparationUnsuccessfulTransfer-ExtIEs} } OPTIONAL, + ... +} + +HandoverPreparationUnsuccessfulTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +HandoverRequestAcknowledgeTransfer ::= SEQUENCE { + dL-NGU-UP-TNLInformation UPTransportLayerInformation, + dLForwardingUP-TNLInformation UPTransportLayerInformation OPTIONAL, + securityResult SecurityResult OPTIONAL, + qosFlowSetupResponseList QosFlowListWithDataForwarding, + qosFlowFailedToSetupList QosFlowListWithCause OPTIONAL, + dataForwardingResponseDRBList DataForwardingResponseDRBList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {HandoverRequestAcknowledgeTransfer-ExtIEs} } OPTIONAL, + ... +} + +HandoverRequestAcknowledgeTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-AdditionalDLUPTNLInformationForHOList CRITICALITY ignore EXTENSION AdditionalDLUPTNLInformationForHOList PRESENCE optional }| + { ID id-ULForwardingUP-TNLInformation CRITICALITY reject EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-AdditionalULForwardingUPTNLInformation CRITICALITY reject EXTENSION UPTransportLayerInformationList PRESENCE optional }| + { ID id-DataForwardingResponseERABList CRITICALITY ignore EXTENSION DataForwardingResponseERABList PRESENCE optional }| + { ID id-RedundantDL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-UsedRSNInformation CRITICALITY ignore EXTENSION RedundantPDUSessionInformation PRESENCE optional }| + { ID id-GlobalRANNodeID CRITICALITY ignore EXTENSION GlobalRANNodeID PRESENCE optional }| + { ID id-MBS-SupportIndicator CRITICALITY ignore EXTENSION MBS-SupportIndicator PRESENCE optional }| + { ID id-PDUSetbasedHandlingIndicator CRITICALITY ignore EXTENSION PDUSetbasedHandlingIndicator PRESENCE optional }| + { ID id-ECNMarkingorCongestionInformationReportingStatus CRITICALITY ignore EXTENSION ECNMarkingorCongestionInformationReportingStatus PRESENCE optional }, + ... +} + +HandoverRequiredTransfer ::= SEQUENCE { + directForwardingPathAvailability DirectForwardingPathAvailability OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {HandoverRequiredTransfer-ExtIEs} } OPTIONAL, + ... +} + +HandoverRequiredTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +HandoverResourceAllocationUnsuccessfulTransfer ::= SEQUENCE { + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {HandoverResourceAllocationUnsuccessfulTransfer-ExtIEs} } OPTIONAL, + ... +} + +HandoverResourceAllocationUnsuccessfulTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +HandoverType ::= ENUMERATED { + intra5gs, + fivegs-to-eps, + eps-to-5gs, + ..., + fivegs-to-utran +} + +HashedUEIdentityIndexValue ::= BIT STRING (SIZE(13, ...)) + + +HFCNode-ID ::= OCTET STRING + +HFCNode-ID-new ::= SEQUENCE { + hFCNode-ID HFCNode-ID, + tAI TAI, + iE-Extensions ProtocolExtensionContainer { { HFCNode-ID-new-ExtIEs} } OPTIONAL, + ... +} + +HFCNode-ID-new-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-GlobalCable-ID CRITICALITY ignore EXTENSION GlobalCable-ID PRESENCE optional }, + ... +} + +HLComActivate ::= SEQUENCE { + nR-Paging-Long-eDRX-Information-for-RRC-INACTIVE NR-Paging-Long-eDRX-Information-for-RRC-INACTIVE, + iE-Extensions ProtocolExtensionContainer { { HLComActivate-ExtIEs} } OPTIONAL, + ... +} + +HLComActivate-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +HLComDeactivate ::= SEQUENCE { + uEReachabilityIndication ENUMERATED {true, ...}, + iE-Extensions ProtocolExtensionContainer { { HLComDeactivate-ExtIEs} } OPTIONAL, + ... +} + +HLComDeactivate-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +HOReport::= SEQUENCE { + handoverReportType ENUMERATED {ho-too-early, ho-to-wrong-cell, intersystem-ping-pong, ...}, + handoverCause Cause, + sourcecellCGI NGRAN-CGI, + targetcellCGI NGRAN-CGI, + reestablishmentcellCGI NGRAN-CGI OPTIONAL, +-- The above IE shall be present if the Handover Report Type IE is set to the value “HO to wrong cell” + sourcecellC-RNTI BIT STRING (SIZE(16)) OPTIONAL, + targetcellinE-UTRAN EUTRA-CGI OPTIONAL, +-- The above IE shall be present if the Handover Report Type IE is set to the value “Inter System ping-pong” + mobilityInformation MobilityInformation OPTIONAL, + uERLFReportContainer UERLFReportContainer OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { HOReport-ExtIEs} } OPTIONAL, + ... +} + +HOReport-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-ExtendedMobilityInformation CRITICALITY ignore EXTENSION ExtendedMobilityInformation PRESENCE optional }| + { ID id-TargetCellCRNTI CRITICALITY ignore EXTENSION C-RNTI PRESENCE optional }| + { ID id-TimeSinceFailure CRITICALITY ignore EXTENSION TimeSinceFailure PRESENCE optional }, + ... +} + + +Hysteresis ::= INTEGER (0..30) + +-- I + +IAB-Authorized ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +MobileIAB-MTUserLocationInformation ::= SEQUENCE { + nRCGI NR-CGI, + tAI TAI, + iE-Extensions ProtocolExtensionContainer { { MobileIAB-MTUserLocationInformation-ExtIEs} } OPTIONAL, + ... +} + +MobileIAB-MTUserLocationInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +IAB-Supported ::= ENUMERATED { + true, + ... +} + +IABNodeIndication ::= ENUMERATED { + true, + ... +} + +IMSVoiceSupportIndicator ::= ENUMERATED { + supported, + not-supported, + ... +} + +IndexToRFSP ::= INTEGER (1..256, ...) + +Indication-of-Bitrate-Adaptation ::= ENUMERATED {uplink, ...} + +InfoOnRecommendedCellsAndRANNodesForPaging ::= SEQUENCE { + recommendedCellsForPaging RecommendedCellsForPaging, + recommendRANNodesForPaging RecommendedRANNodesForPaging, + iE-Extensions ProtocolExtensionContainer { {InfoOnRecommendedCellsAndRANNodesForPaging-ExtIEs} } OPTIONAL, + ... +} + +InfoOnRecommendedCellsAndRANNodesForPaging-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +IntegrityProtectionIndication ::= ENUMERATED { + required, + preferred, + not-needed, + ... +} + +IntegrityProtectionResult ::= ENUMERATED { + performed, + not-performed, + ... +} + +IntendedNumberOfPagingAttempts ::= INTEGER (1..16, ...) + +InterfacesToTrace ::= BIT STRING (SIZE(8)) + +ImmediateMDTNr ::= SEQUENCE { + measurementsToActivate MeasurementsToActivate, + m1Configuration M1Configuration OPTIONAL, +-- The above IE shall be present if the Measurements to Activate IE has the first bit set to “1” + m4Configuration M4Configuration OPTIONAL, +-- The above IE shall be present if the Measurements to Activate IE has the third bit set to “1” + m5Configuration M5Configuration OPTIONAL, +-- The above IE shall be present if the Measurements to Activate IE has the fourth bit set to “1” + m6Configuration M6Configuration OPTIONAL, +-- The above IE shall be present if the Measurements to Activate IE has the fifth bit set to “1” + m7Configuration M7Configuration OPTIONAL, +-- The above IE shall be present if the Measurements to Activate IE has the sixth bit set to “1” + bluetoothMeasurementConfiguration BluetoothMeasurementConfiguration OPTIONAL, + wLANMeasurementConfiguration WLANMeasurementConfiguration OPTIONAL, + mDT-Location-Info MDT-Location-Info OPTIONAL, + sensorMeasurementConfiguration SensorMeasurementConfiguration OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ImmediateMDTNr-ExtIEs} } OPTIONAL, + ... +} + +ImmediateMDTNr-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +InterSystemFailureIndication ::= SEQUENCE { + uERLFReportContainer UERLFReportContainer OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { InterSystemFailureIndication-ExtIEs} } OPTIONAL, + ... +} + +InterSystemFailureIndication-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +IntersystemSONConfigurationTransfer ::= SEQUENCE { + transferType IntersystemSONTransferType, + intersystemSONInformation IntersystemSONInformation, + iE-Extensions ProtocolExtensionContainer { { IntersystemSONConfigurationTransfer-ExtIEs} } OPTIONAL, + ... +} + +IntersystemSONConfigurationTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +IntersystemSONTransferType ::= CHOICE { + fromEUTRANtoNGRAN FromEUTRANtoNGRAN, + fromNGRANtoEUTRAN FromNGRANtoEUTRAN, + choice-Extensions ProtocolIE-SingleContainer { { IntersystemSONTransferType-ExtIEs} } +} + +IntersystemSONTransferType-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +IntersystemSONeNBID ::= SEQUENCE { + globaleNBID GlobalENB-ID, + selectedEPSTAI EPS-TAI, + iE-Extensions ProtocolExtensionContainer { { IntersystemSONeNBID-ExtIEs} } OPTIONAL, + ... +} + +IntersystemSONeNBID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +IntersystemSONNGRANnodeID ::= SEQUENCE { + globalRANNodeID GlobalRANNodeID, + selectedTAI TAI, + iE-Extensions ProtocolExtensionContainer { { IntersystemSONNGRANnodeID-ExtIEs} } OPTIONAL, + ... +} + +IntersystemSONNGRANnodeID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +IntersystemSONInformation ::= CHOICE { + intersystemSONInformationReport IntersystemSONInformationReport, + choice-Extensions ProtocolIE-SingleContainer { { IntersystemSONInformation-ExtIEs} } +} + +IntersystemSONInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-IntersystemSONInformationRequest CRITICALITY ignore TYPE IntersystemSONInformationRequest PRESENCE mandatory }| + { ID id-IntersystemSONInformationReply CRITICALITY ignore TYPE IntersystemSONInformationReply PRESENCE mandatory }, + ... +} + +-- -------------------------------------------------------------------- +-- INTER SYSTEM SON INFORMATION REQUEST +-- -------------------------------------------------------------------- + +IntersystemSONInformationRequest ::= CHOICE { + nGRAN-CellActivation IntersystemCellActivationRequest, + resourceStatus IntersystemResourceStatusRequest, + choice-Extensions ProtocolIE-SingleContainer { { IntersystemSONInformationRequest-ExtIEs} } +} + +IntersystemSONInformationRequest-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +IntersystemCellActivationRequest ::= SEQUENCE { + activationID INTEGER (0..16384, ...), + cellsToActivateList CellsToActivateList, + iE-Extensions ProtocolExtensionContainer { { IntersystemCellActivationRequest-ExtIEs} } OPTIONAL, + ... +} + +IntersystemCellActivationRequest-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CellsToActivateList ::= SEQUENCE (SIZE(1..maxnoofCellsinNGRANNode)) OF NGRAN-CGI + + +-- -------------------------------------------------------------------- +-- Inter System Resource Status Request +-- -------------------------------------------------------------------- + +IntersystemResourceStatusRequest ::= SEQUENCE { + reportingSystem ReportingSystem, + reportCharacteristics ReportCharacteristics, + reportType ReportType, + iE-Extensions ProtocolExtensionContainer { { IntersystemResourceStatusRequest-ExtIEs} } OPTIONAL, + ... +} + +IntersystemResourceStatusRequest-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ReportingSystem ::= CHOICE { + eUTRAN EUTRAN-ReportingSystemIEs, + nGRAN NGRAN-ReportingSystemIEs, + noReporting NULL, + choice-Extensions ProtocolIE-SingleContainer { { ReportingSystem-ExtIEs}} +} + +ReportingSystem-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +EUTRAN-ReportingSystemIEs::= SEQUENCE { + eUTRAN-CellToReportList EUTRAN-CellToReportList, + iE-Extensions ProtocolExtensionContainer { {EUTRAN-ReportingSystemIEs-ExtIEs} } OPTIONAL, + ... +} + +EUTRAN-ReportingSystemIEs-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NGRAN-ReportingSystemIEs ::= SEQUENCE { + nGRAN-CellToReportList NGRAN-CellToReportList, + iE-Extensions ProtocolExtensionContainer { {NGRAN-ReportingSystemIEs-ExtIEs} } OPTIONAL, + ... +} + +NGRAN-ReportingSystemIEs-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRAN-CellToReportList ::= SEQUENCE (SIZE(1..maxnoofReportedCells)) OF EUTRAN-CellToReportItem + +EUTRAN-CellToReportItem::= SEQUENCE { + eCGI EUTRA-CGI, + iE-Extensions ProtocolExtensionContainer { {EUTRAN-CellToReportItem-ExtIEs} } OPTIONAL, + ... +} + +EUTRAN-CellToReportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +NGRAN-CellToReportList ::= SEQUENCE (SIZE(1.. maxnoofReportedCells)) OF NGRAN-CellToReportItem + +NGRAN-CellToReportItem::= SEQUENCE { + nGRAN-CGI NGRAN-CGI, + iE-Extensions ProtocolExtensionContainer { {NGRAN-CellToReportItem-ExtIEs} } OPTIONAL, + ... +} + +NGRAN-CellToReportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ReportCharacteristics ::= BIT STRING(SIZE(32)) + +ReportType ::= CHOICE { + eventBasedReporting EventBasedReportingIEs, + periodicReporting PeriodicReportingIEs, + choice-Extensions ProtocolIE-SingleContainer { { ReportType-ExtIEs}} +} + +ReportType-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +EventBasedReportingIEs ::= SEQUENCE { + intersystemResourceThresholdLow IntersystemResourceThreshold, + intersystemResourceThresholdHigh IntersystemResourceThreshold, + numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels, + iE-Extensions ProtocolExtensionContainer { {EventBasedReportingIEs-ExtIEs} } OPTIONAL, + ... +} + +EventBasedReportingIEs-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +IntersystemResourceThreshold ::= INTEGER(0..100) + +NumberOfMeasurementReportingLevels ::= ENUMERATED {n2, n3, n4, n5, n10, ..., n0} + +PeriodicReportingIEs ::= SEQUENCE { + reportingPeriodicity ReportingPeriodicity, + iE-Extensions ProtocolExtensionContainer { {PeriodicReportingIEs-ExtIEs} } OPTIONAL, + ... +} + +PeriodicReportingIEs-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ReportingPeriodicity ::= ENUMERATED { + stop, + single, + ms1000, + ms2000, + ms5000, + ms10000, + ... +} + + +-- -------------------------------------------------------------------- +-- INTER SYSTEM SON INFORMATION REPLY +-- -------------------------------------------------------------------- + +IntersystemSONInformationReply ::= CHOICE { + nGRAN-CellActivation IntersystemCellActivationReply, + resourceStatus IntersystemResourceStatusReply, + choice-Extensions ProtocolIE-SingleContainer { { IntersystemSONInformationReply-ExtIEs} } +} + +IntersystemSONInformationReply-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +IntersystemCellActivationReply ::= SEQUENCE { + activatedCellList ActivatedCellList, + activation-ID INTEGER(0..16384, ...), + iE-Extensions ProtocolExtensionContainer { { IntersystemCellActivationReply-ExtIEs} } OPTIONAL, + ... +} + +IntersystemCellActivationReply-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ActivatedCellList ::= SEQUENCE (SIZE(1..maxnoofCellsinNGRANNode)) OF NGRAN-CGI + + +-- -------------------------------------------------------------------- +-- Inter System Resource Status Reply +-- -------------------------------------------------------------------- + +IntersystemResourceStatusReply ::= SEQUENCE { + reportingsystem ReportingSystem, + iE-Extensions ProtocolExtensionContainer { { IntersystemResourceStatusReply-ExtIEs} } OPTIONAL, + ... +} + +IntersystemResourceStatusReply-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +-- -------------------------------------------------------------------- +-- INTER SYSTEM SON INFORMATION REPORT +-- -------------------------------------------------------------------- + +IntersystemSONInformationReport::= CHOICE { + hOReportInformation InterSystemHOReport, + failureIndicationInformation InterSystemFailureIndication, + choice-Extensions ProtocolIE-SingleContainer { { IntersystemSONInformationReport-ExtIEs} } +} + +IntersystemSONInformationReport-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-EnergySavingIndication CRITICALITY ignore TYPE IntersystemCellStateIndication PRESENCE mandatory }| + { ID id-IntersystemResourceStatusUpdate CRITICALITY ignore TYPE IntersystemResourceStatusReport PRESENCE mandatory }, + ... +} + +IntersystemCellStateIndication ::= SEQUENCE { + notificationCellList NotificationCellList, + iE-Extensions ProtocolExtensionContainer { { IntersystemCellStateIndication-ExtIEs} } OPTIONAL, + ... +} + +IntersystemCellStateIndication-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NotificationCellList ::= SEQUENCE (SIZE(1.. maxnoofCellsinNGRANNode)) OF NotificationCell-Item + +NotificationCell-Item ::= SEQUENCE { + nGRAN-CGI NGRAN-CGI, + notifyFlag ENUMERATED {activated, deactivated, ...}, + iE-Extensions ProtocolExtensionContainer { { NotificationCell-Item-ExtIEs} } OPTIONAL, + ... +} + +NotificationCell-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- -------------------------------------------------------------------- +-- Inter System Resource Status Report +-- -------------------------------------------------------------------- + +IntersystemResourceStatusReport ::= SEQUENCE { + reportingSystem ResourceStatusReportingSystem, + iE-Extensions ProtocolExtensionContainer { { IntersystemResourceStatusReport-ExtIEs} } OPTIONAL, + ... +} + +IntersystemResourceStatusReport-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ResourceStatusReportingSystem ::= CHOICE { + eUTRAN-ReportingStatus EUTRAN-ReportingStatusIEs, + nGRAN-ReportingStatus NGRAN-ReportingStatusIEs, + choice-Extensions ProtocolIE-SingleContainer { { ResourceStatusReportingSystem-ExtIEs}} +} + +ResourceStatusReportingSystem-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +EUTRAN-ReportingStatusIEs::= SEQUENCE { + eUTRAN-CellReportList EUTRAN-CellReportList, + iE-Extensions ProtocolExtensionContainer { {EUTRAN-ReportingStatusIEs-ExtIEs} } OPTIONAL, + ... +} + +EUTRAN-ReportingStatusIEs-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRAN-CellReportList ::= SEQUENCE (SIZE(1..maxnoofReportedCells)) OF EUTRAN-CellReportItem + +EUTRAN-CellReportItem ::= SEQUENCE { + eCGI EUTRA-CGI, + eUTRAN-CompositeAvailableCapacityGroup EUTRAN-CompositeAvailableCapacityGroup, + eUTRAN-NumberOfActiveUEs EUTRAN-NumberOfActiveUEs OPTIONAL, + eUTRAN-NoofRRCConnections NGRAN-NoofRRCConnections OPTIONAL, + eUTRAN-RadioResourceStatus EUTRAN-RadioResourceStatus OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {EUTRAN-CellReportItem-ExtIEs} } OPTIONAL, + ... +} + +EUTRAN-CellReportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +EUTRAN-CompositeAvailableCapacityGroup ::= SEQUENCE { + dL-CompositeAvailableCapacity CompositeAvailableCapacity, + uL-CompositeAvailableCapacity CompositeAvailableCapacity, + iE-Extensions ProtocolExtensionContainer { { EUTRAN-CompositeAvailableCapacityGroup-ExtIEs} } OPTIONAL, + ... +} + +EUTRAN-CompositeAvailableCapacityGroup-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +CompositeAvailableCapacity ::= SEQUENCE { + cellCapacityClassValue INTEGER (1..100, ...) OPTIONAL, + capacityValue INTEGER (0..100), + iE-Extensions ProtocolExtensionContainer { {CompositeAvailableCapacity-ExtIEs} } OPTIONAL, + ... +} + +CompositeAvailableCapacity-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRAN-NumberOfActiveUEs ::= INTEGER (0..16777215, ...) + +EUTRAN-RadioResourceStatus ::= SEQUENCE { + dL-GBR-PRB-usage INTEGER (0..100), + uL-GBR-PRB-usage INTEGER (0..100), + dL-non-GBR-PRB-usage INTEGER (0..100), + uL-non-GBR-PRB-usage INTEGER (0..100), + dL-Total-PRB-usage INTEGER (0..100), + uL-Total-PRB-usage INTEGER (0..100), + dL-scheduling-PDCCH-CCE-usage INTEGER (0..100) OPTIONAL, + uL-scheduling-PDCCH-CCE-usage INTEGER (0..100) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {EUTRAN-RadioResourceStatus-ExtIEs} } OPTIONAL, + ... +} + +EUTRAN-RadioResourceStatus-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NGRAN-ReportingStatusIEs ::= SEQUENCE { + nGRAN-CellReportList NGRAN-CellReportList, + iE-Extensions ProtocolExtensionContainer { {NGRAN-ReportingStatusIEs-ExtIEs} } OPTIONAL, + ... +} + +NGRAN-ReportingStatusIEs-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NGRAN-CellReportList ::= SEQUENCE (SIZE(1..maxnoofReportedCells)) OF NGRAN-CellReportItem + +NGRAN-CellReportItem ::= SEQUENCE { + nGRAN-CGI NGRAN-CGI, + nGRAN-CompositeAvailableCapacityGroup EUTRAN-CompositeAvailableCapacityGroup, + nGRAN-NumberOfActiveUEs NGRAN-NumberOfActiveUEs OPTIONAL, + nGRAN-NoofRRCConnections NGRAN-NoofRRCConnections OPTIONAL, + nGRAN-RadioResourceStatus NGRAN-RadioResourceStatus OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {NGRAN-CellReportItem-ExtIEs} } OPTIONAL, + ... +} + +NGRAN-CellReportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +NGRAN-NumberOfActiveUEs ::= INTEGER (0..16777215, ...) + +NGRAN-NoofRRCConnections ::= INTEGER (1..65536, ...) + +NGRAN-RadioResourceStatus ::= SEQUENCE { + dL-GBR-PRB-usage-for-MIMO INTEGER (0..100), + uL-GBR-PRB-usage-for-MIMO INTEGER (0..100), + dL-non-GBR-PRB-usage-for-MIMO INTEGER (0..100), + uL-non-GBR-PRB-usage-for-MIMO INTEGER (0..100), + dL-Total-PRB-usage-for-MIMO INTEGER (0..100), + uL-Total-PRB-usage-for-MIMO INTEGER (0..100), + iE-Extensions ProtocolExtensionContainer { { NGRAN-RadioResourceStatus-ExtIEs} } OPTIONAL, + ... +} + +NGRAN-RadioResourceStatus-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +InterSystemHOReport ::= SEQUENCE { + handoverReportType InterSystemHandoverReportType, + iE-Extensions ProtocolExtensionContainer { { InterSystemHOReport-ExtIEs} } OPTIONAL, + ... +} + +InterSystemHOReport-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +InterSystemHandoverReportType ::= CHOICE { + tooearlyIntersystemHO TooearlyIntersystemHO, + intersystemUnnecessaryHO IntersystemUnnecessaryHO, + choice-Extensions ProtocolIE-SingleContainer { { InterSystemHandoverReportType-ExtIEs} } +} + +InterSystemHandoverReportType-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-IntersystemMobilityFailureforVoiceFallback CRITICALITY ignore TYPE IntersystemMobilityFailureforVoiceFallback PRESENCE mandatory }, + ... +} + +IntersystemMobilityFailureforVoiceFallback ::= SEQUENCE { + sourcecellID NGRAN-CGI, + targetcellID EUTRA-CGI, + reconnectCellID EUTRA-CGI OPTIONAL, + uERLFReportContainer UERLFReportContainer OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { IntersystemMobilityFailureforVoiceFallback-ExtIEs} } OPTIONAL, + ... +} + +IntersystemMobilityFailureforVoiceFallback-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +IntersystemUnnecessaryHO ::= SEQUENCE { + sourcecellID NGRAN-CGI, + targetcellID EUTRA-CGI, + earlyIRATHO ENUMERATED {true, false, ...}, + candidateCellList CandidateCellList, + iE-Extensions ProtocolExtensionContainer { { IntersystemUnnecessaryHO-ExtIEs} } OPTIONAL, + ... +} + +IntersystemUnnecessaryHO-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +InventoryRequestTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { InventoryRequestTransferIEs} }, + ... +} + +InventoryRequestTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-AIoT-DeviceIdentificationRequested CRITICALITY reject TYPE AIoT-DeviceIdentificationRequested PRESENCE mandatory }| + { ID id-AIoT-RequestedServiceAreaInformation CRITICALITY reject TYPE AIoT-RequestedServiceAreaInformation PRESENCE mandatory }| + { ID id-AIoT-InventoryAssistanceInformation CRITICALITY reject TYPE AIoT-InventoryAssistanceInformation PRESENCE mandatory }| + { ID id-AIoT-FollowonCommandIndication CRITICALITY reject TYPE AIoT-FollowonCommandIndication PRESENCE optional }| + { ID id-AIoT-SecurityInfo CRITICALITY reject TYPE AIoT-SecurityInfo PRESENCE mandatory }, + ... +} + +InventoryResponseTransfer ::= SEQUENCE { + correlationIdentifier AIoT-CorrelationIdentifier, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { InventoryResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +InventoryResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +InventoryFailureTransfer ::= SEQUENCE { + correlationIdentifier AIoT-CorrelationIdentifier, + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { InventoryFailureTransfer-ExtIEs} } OPTIONAL, + ... +} + +InventoryFailureTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +InventoryReportTransfer ::= SEQUENCE { + correlationIdentifier AIoT-CorrelationIdentifier, + globalgNB-ID GlobalGNB-ID, + readerReportList AIoT-ReaderReportList OPTIONAL, + inventoryCompleteIndication ENUMERATED {true, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { InventoryReportTransfer-ExtIEs} } OPTIONAL, + ... +} + +InventoryReportTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- J +-- K +-- L + +LAC ::= OCTET STRING (SIZE (2)) + +LAI ::= SEQUENCE { + pLMNidentity PLMNIdentity, + lAC LAC, + iE-Extensions ProtocolExtensionContainer { {LAI-ExtIEs} } OPTIONAL, + ... +} + +LAI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +LastVisitedCellInformation ::= CHOICE { + nGRANCell LastVisitedNGRANCellInformation, + eUTRANCell LastVisitedEUTRANCellInformation, + uTRANCell LastVisitedUTRANCellInformation, + gERANCell LastVisitedGERANCellInformation, + choice-Extensions ProtocolIE-SingleContainer { {LastVisitedCellInformation-ExtIEs} } +} + +LastVisitedCellInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +LastVisitedCellItem ::= SEQUENCE { + lastVisitedCellInformation LastVisitedCellInformation, + iE-Extensions ProtocolExtensionContainer { {LastVisitedCellItem-ExtIEs} } OPTIONAL, + ... +} + +LastVisitedCellItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +LastVisitedEUTRANCellInformation ::= OCTET STRING + +LastVisitedGERANCellInformation ::= OCTET STRING + +LastVisitedNGRANCellInformation::= SEQUENCE { + globalCellID NGRAN-CGI, + cellType CellType, + timeUEStayedInCell TimeUEStayedInCell, + timeUEStayedInCellEnhancedGranularity TimeUEStayedInCellEnhancedGranularity OPTIONAL, + hOCauseValue Cause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {LastVisitedNGRANCellInformation-ExtIEs} } OPTIONAL, + ... +} + +LastVisitedNGRANCellInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-LastVisitedPSCellList CRITICALITY ignore EXTENSION LastVisitedPSCellList PRESENCE optional }, + ... +} + +LastVisitedPSCellList ::= SEQUENCE (SIZE(1..maxnoofPSCellsPerPrimaryCellinUEHistoryInfo)) OF LastVisitedPSCellInformation + +LastVisitedPSCellInformation ::= SEQUENCE { + pSCellID NGRAN-CGI OPTIONAL, + timeStay INTEGER (0..40950), + iE-Extensions ProtocolExtensionContainer { {LastVisitedPSCellInformation-ExtIEs} } OPTIONAL, + ... +} + +LastVisitedPSCellInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SCGActivationTime CRITICALITY ignore EXTENSION SCGActivationTime PRESENCE optional }, + ... +} + +LastVisitedUTRANCellInformation ::= OCTET STRING + +LineType ::= ENUMERATED { + dsl, + pon, + ... +} + + +LocationReportingAdditionalInfo ::= ENUMERATED { + includePSCell, + ... +} + +LocationReportingReferenceID ::= INTEGER (1..64, ...) + +LocationReportingRequestType ::= SEQUENCE { + eventType EventType, + reportArea ReportArea, + areaOfInterestList AreaOfInterestList OPTIONAL, + locationReportingReferenceIDToBeCancelled LocationReportingReferenceID OPTIONAL, +-- The above IE shall be present if the Event Type IE is set to the value “stop UE presence in the area of interest” + iE-Extensions ProtocolExtensionContainer { {LocationReportingRequestType-ExtIEs} } OPTIONAL, + ... +} + +LocationReportingRequestType-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-LocationReportingAdditionalInfo CRITICALITY ignore EXTENSION LocationReportingAdditionalInfo PRESENCE optional }| + { ID id-AdditionalCancelledlocationReportingReferenceIDList CRITICALITY reject EXTENSION AdditionalCancelledlocationReportingReferenceIDList PRESENCE optional }| + { ID id-Aerial-UE-FlightInformationReportingControlList CRITICALITY ignore EXTENSION Aerial-UE-FlightInformationReportingControlList PRESENCE optional}, + ... +} + + +Aerial-UE-FlightInformationReportingControl ::= SEQUENCE { + higher-Altitude-Threshold Altitude, + lower-Altitude-Threshold Altitude, + aerial-UE-report-periodicity AerialUEReportingPeriodicity OPTIONAL, + areaID Area-ID, + iE-Extensions ProtocolExtensionContainer { {Aerial-UE-FlightInformationReportingControl-ExtIEs}} OPTIONAL, + ... +} + +Aerial-UE-FlightInformationReportingControl-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Aerial-UE-FlightInformationReportingControlList::= SEQUENCE (SIZE(1.. maxnoofFlightInfoReportControl)) OF Aerial-UE-FlightInformationReportingControlItem + +Aerial-UE-FlightInformationReportingControlItem ::= SEQUENCE { + aerial-UE-FlightInformationReportingControl Aerial-UE-FlightInformationReportingControl, + iE-Extensions ProtocolExtensionContainer { {Aerial-UE-FlightInformationReportingControlItem-ExtIEs}} OPTIONAL, + ... +} + + +Aerial-UE-FlightInformationReportingControlItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +Area-ID ::= CHOICE { +tAI TAI, +globalRANNodeID GlobalRANNodeID, + nR-CGI NR-CGI, + choice-Extensions ProtocolIE-SingleContainer { {Area-ID-ExtIEs} } +} + +Area-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + + +LoggedMDTNr ::= SEQUENCE { + loggingInterval LoggingInterval, + loggingDuration LoggingDuration, + loggedMDTTrigger LoggedMDTTrigger, + bluetoothMeasurementConfiguration BluetoothMeasurementConfiguration OPTIONAL, + wLANMeasurementConfiguration WLANMeasurementConfiguration OPTIONAL, + sensorMeasurementConfiguration SensorMeasurementConfiguration OPTIONAL, + areaScopeOfNeighCellsList AreaScopeOfNeighCellsList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {LoggedMDTNr-ExtIEs} } OPTIONAL, + ... +} + +LoggedMDTNr-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-EarlyMeasurement CRITICALITY ignore EXTENSION EarlyMeasurement PRESENCE optional }, + ... +} + +LoggingInterval ::= ENUMERATED { + ms320, ms640, ms1280, ms2560, ms5120, ms10240, ms20480, ms30720, ms40960, ms61440, + infinity, + ... +} + +LoggingDuration ::= ENUMERATED {m10, m20, m40, m60, m90, m120, ...} + +Links-to-log ::= ENUMERATED { + uplink, + downlink, + both-uplink-and-downlink, + ... +} + +LoggedMDTTrigger ::= CHOICE{ + periodical NULL, + eventTrigger EventTrigger, + choice-Extensions ProtocolIE-SingleContainer { {LoggedMDTTrigger-ExtIEs} } +} + +LoggedMDTTrigger-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +LPWUSPSAssistanceInformation ::= SEQUENCE { + lPWUScNsubgroupID LPWUSCNsubgroupID, + iE-Extensions ProtocolExtensionContainer { {LPWUSPSAssistanceInformation-ExtIEs} } OPTIONAL, + ... +} + +LPWUSPSAssistanceInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +LPWUSCNsubgroupID ::= INTEGER (0..30, ...) + +LPWUSDisableIndication ::= ENUMERATED {true, ...} + +LTEM-Indication ::= ENUMERATED {lte-m,...} + +LTEUERLFReportContainer ::= OCTET STRING + +LTEV2XServicesAuthorized ::= SEQUENCE { + vehicleUE VehicleUE OPTIONAL, + pedestrianUE PedestrianUE OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {LTEV2XServicesAuthorized-ExtIEs} } OPTIONAL, + ... +} + +LTEV2XServicesAuthorized-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +LTEUESidelinkAggregateMaximumBitrate ::= SEQUENCE { + uESidelinkAggregateMaximumBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { {LTEUE-Sidelink-Aggregate-MaximumBitrates-ExtIEs} } OPTIONAL, + ... +} + +LTEUE-Sidelink-Aggregate-MaximumBitrates-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +LTE-A2X-ServicesAuthorized ::= SEQUENCE { + aerialUE ENUMERATED {authorized, not-authorized, ...} OPTIONAL, + aerialControllerUE ENUMERATED {authorized, not-authorized, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {LTE-A2X-ServicesAuthorized-ExtIEs} } OPTIONAL, + ... +} + +LTE-A2X-ServicesAuthorized-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- M + +MaskedIMEISV ::= BIT STRING (SIZE(64)) + +MaximumDataBurstVolume ::= INTEGER (0..4095, ..., 4096.. 2000000) + +MessageIdentifier ::= BIT STRING (SIZE(16)) + +MaximumIntegrityProtectedDataRate ::= ENUMERATED { + bitrate64kbs, + maximum-UE-rate, + ... +} + + +MBS-AreaSessionID ::= INTEGER (0..65535, ...) + +CommServiceType ::= ENUMERATED {mbs-broadcast, mbs-multicast, ..., unicast} + +MBS-DataForwardingResponseMRBList ::= SEQUENCE (SIZE(1..maxnoofMRBs)) OF MBS-DataForwardingResponseMRBItem + +MBS-DataForwardingResponseMRBItem ::= SEQUENCE { + mRB-ID MRB-ID, + dL-Forwarding-UPTNLInformation UPTransportLayerInformation, + mRB-ProgressInformation MRB-ProgressInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBS-DataForwardingResponseMRBItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-DataForwardingResponseMRBItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-MappingandDataForwardingRequestList ::= SEQUENCE (SIZE(1..maxnoofMRBs)) OF MBS-MappingandDataForwardingRequestItem + +MBS-MappingandDataForwardingRequestItem ::= SEQUENCE { + mRB-ID MRB-ID, + mBS-QoSFlowList MBS-QoSFlowList, + mRB-ProgressInformation MRB-ProgressInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBS-MappingandDataForwardingRequestItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-MappingandDataForwardingRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-QoSFlowList ::= SEQUENCE (SIZE(1..maxnoofMBSQoSFlows)) OF QosFlowIdentifier + +MRB-ProgressInformation ::= CHOICE { + pDCP-SN-Length12 INTEGER (0..4095), + pDCP-SN-Length18 INTEGER (0..262143), + choice-Extensions ProtocolIE-SingleContainer { { MRB-ProgressInformation-ExtIEs} } +} + +MRB-ProgressInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +MBS-QoSFlowsToBeSetupList ::= SEQUENCE (SIZE(1.. maxnoofMBSQoSFlows)) OF MBS-QoSFlowsToBeSetupItem + +MBS-QoSFlowsToBeSetupItem ::= SEQUENCE { + mBSqosFlowIdentifier QosFlowIdentifier, + mBSqosFlowLevelQosParameters QosFlowLevelQosParameters, + iE-Extensions ProtocolExtensionContainer { {MBS-QoSFlowsToBeSetupItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-QoSFlowsToBeSetupItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +MBS-ServiceArea ::= CHOICE { + locationindependent MBS-ServiceAreaInformation, + locationdependent MBS-ServiceAreaInformationList, + choice-Extensions ProtocolIE-SingleContainer { {MBS-ServiceArea-ExtIEs} } +} + +MBS-ServiceArea-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +MBS-ServiceAreaInformationList ::= SEQUENCE (SIZE(1..maxnoofMBSServiceAreaInformation)) OF MBS-ServiceAreaInformationItem + + +MBS-ServiceAreaInformationItem ::= SEQUENCE { + mBS-AreaSessionID MBS-AreaSessionID, + mBS-ServiceAreaInformation MBS-ServiceAreaInformation, + iE-Extensions ProtocolExtensionContainer { {MBS-ServiceAreaInformationItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-ServiceAreaInformationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-ServiceAreaInformation ::= SEQUENCE { + mBS-ServiceAreaCellList MBS-ServiceAreaCellList OPTIONAL, + mBS-ServiceAreaTAIList MBS-ServiceAreaTAIList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MBS-ServiceAreaInformation-ExtIEs} } OPTIONAL, + ... +} + +MBS-ServiceAreaInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-MBS-IntendedServiceAreaList CRITICALITY ignore EXTENSION MBS-IntendedServiceAreaList PRESENCE optional }, + ... +} + +MBS-ServiceAreaCellList ::= SEQUENCE (SIZE(1.. maxnoofCellsforMBS)) OF NR-CGI + +MBS-ServiceAreaTAIList ::= SEQUENCE (SIZE(1.. maxnoofTAIforMBS)) OF TAI + +MBS-IntendedServiceAreaList ::= SEQUENCE (SIZE(1..maxnoofIntendedAreasforMBS)) OF IntendedServiceAreaCoordinates + +IntendedServiceAreaCoordinates ::= OCTET STRING + +MBS-SessionID ::= SEQUENCE { + tMGI TMGI, + nID NID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MBS-SessionID-ExtIEs} } OPTIONAL, + ... +} + +MBS-SessionID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBSSessionFailedtoSetupList ::= SEQUENCE (SIZE(1.. maxnoofMBSSessions)) OF MBSSessionFailedtoSetupItem + +MBSSessionFailedtoSetupItem ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + cause Cause, + iE-Extensions ProtocolExtensionContainer { { MBSSessionFailedtoSetupItem-ExtIEs} } OPTIONAL, + ... +} + +MBSSessionFailedtoSetupItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-ActiveSessionInformation-SourcetoTargetList ::= SEQUENCE (SIZE(1..maxnoofMBSSessionsofUE)) OF MBS-ActiveSessionInformation-SourcetoTargetItem + +MBS-ActiveSessionInformation-SourcetoTargetItem ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + mBS-ServiceArea MBS-ServiceArea OPTIONAL, + mBS-QoSFlowsToBeSetupList MBS-QoSFlowsToBeSetupList, + mBS-MappingandDataForwardingRequestList MBS-MappingandDataForwardingRequestList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBS-ActiveSessionInformation-SourcetoTargetItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-ActiveSessionInformation-SourcetoTargetItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-ActiveSessionInformation-TargettoSourceList ::= SEQUENCE (SIZE(1..maxnoofMBSSessionsofUE)) OF MBS-ActiveSessionInformation-TargettoSourceItem + +MBS-ActiveSessionInformation-TargettoSourceItem ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-DataForwardingResponseMRBList MBS-DataForwardingResponseMRBList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBS-ActiveSessionInformation-TargettoSourceItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-ActiveSessionInformation-TargettoSourceItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-AssistanceInformation ::= ENUMERATED {true, ...} + +MBSSessionSetupOrModFailureTransfer ::= SEQUENCE { + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBSSessionSetupOrModFailureTransfer-ExtIEs} } OPTIONAL, + ... +} + +MBSSessionSetupOrModFailureTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBSSessionSetupResponseList ::= SEQUENCE (SIZE(1.. maxnoofMBSSessions)) OF MBSSessionSetupResponseItem + +MBSSessionSetupResponseItem ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBSSessionSetupResponseItem-ExtIEs} } OPTIONAL, + ... +} + +MBSSessionSetupResponseItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBSSessionSetupOrModRequestTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MBSSessionSetupOrModRequestTransferIEs} }, + ... +} + +MBSSessionSetupOrModRequestTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionTNLInfo5GC CRITICALITY reject TYPE MBS-SessionTNLInfo5GC PRESENCE optional }| + { ID id-MBS-QoSFlowsToBeSetupModList CRITICALITY reject TYPE MBS-QoSFlowsToBeSetupList PRESENCE mandatory }| + { ID id-MBS-SessionFSAIDList CRITICALITY ignore TYPE MBS-SessionFSAIDList PRESENCE optional }| + { ID id-SupportedUETypeList CRITICALITY ignore TYPE SupportedUETypeList PRESENCE optional }| + { ID id-MBS-NGUFailureIndication CRITICALITY reject TYPE MBS-NGUFailureIndication PRESENCE optional }, + ... +} +SupportedUETypeList ::= SEQUENCE (SIZE(1.. maxnoofUETypes)) OF SupportedUEType + +SupportedUEType ::= ENUMERATED {non-RedCap-eRedCap-UE, redCap-eRedCap-UE, ...} + +MBS-SessionFSAIDList ::= SEQUENCE (SIZE(1.. maxnoofMBSFSAs)) OF MBS-SessionFSAID + +MBS-SessionFSAID ::= OCTET STRING (SIZE(3)) + +MBSSessionReleaseResponseTransfer ::= SEQUENCE { + mBS-SessionTNLInfoNGRAN MBS-SessionTNLInfoNGRAN OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MBSSessionReleaseResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +MBSSessionReleaseResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBSSessionSetupOrModResponseTransfer ::= SEQUENCE { + mBS-SessionTNLInfoNGRAN MBS-SessionTNLInfoNGRAN OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MBSSessionSetupOrModResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +MBSSessionSetupOrModResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-SupportIndicator ::= ENUMERATED { + multicast-supported, + ..., + multicast-supported-with-reception-in-RRC-inactive +} + +MBS-SessionTNLInfo5GC ::= CHOICE { + locationindependent SharedNGU-MulticastTNLInformation, + locationdependent MBS-SessionTNLInfo5GCList, + choice-Extensions ProtocolIE-SingleContainer { {MBS-SessionTNLInfo5GC-ExtIEs} } +} + +MBS-SessionTNLInfo5GC-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +MBS-SessionTNLInfo5GCList ::= SEQUENCE (SIZE(1..maxnoofMBSServiceAreaInformation)) OF MBS-SessionTNLInfo5GCItem + +MBS-SessionTNLInfo5GCItem ::= SEQUENCE { + mBS-AreaSessionID MBS-AreaSessionID, + sharedNGU-MulticastTNLInformation SharedNGU-MulticastTNLInformation, + iE-Extensions ProtocolExtensionContainer { {MBS-SessionTNLInfo5GCItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-SessionTNLInfo5GCItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-SessionTNLInfoNGRAN ::= CHOICE { + locationindependent UPTransportLayerInformation, + locationdependent MBS-SessionTNLInfoNGRANList, + choice-Extensions ProtocolIE-SingleContainer { {MBS-SessionTNLInfoNGRAN-ExtIEs} } +} + +MBS-SessionTNLInfoNGRAN-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +MBS-SessionTNLInfoNGRANList ::= SEQUENCE (SIZE(1..maxnoofMBSServiceAreaInformation)) OF MBS-SessionTNLInfoNGRANItem + +MBS-SessionTNLInfoNGRANItem ::= SEQUENCE { + mBS-AreaSessionID MBS-AreaSessionID, + sharedNGU-UnicastTNLInformation UPTransportLayerInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MBS-SessionTNLInfoNGRANItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-SessionTNLInfoNGRANItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-DistributionReleaseRequestTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + sharedNGU-UnicastTNLInformation UPTransportLayerInformation OPTIONAL, + cause Cause, + iE-Extensions ProtocolExtensionContainer { { MBS-DistributionReleaseRequesTransfer-ExtIEs} } OPTIONAL, + ... +} + +MBS-DistributionReleaseRequesTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-DistributionSetupRequestTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + sharedNGU-UnicastTNLInformation UPTransportLayerInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBS-DistributionSetupRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +MBS-DistributionSetupRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { +{ ID id-TAIMBSSupportList CRITICALITY ignore EXTENSION TAIMBSSupportList PRESENCE optional }, + ... +} + +MBS-DistributionSetupResponseTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + sharedNGU-MulticastTNLInformation SharedNGU-MulticastTNLInformation OPTIONAL, + mBS-QoSFlowsToBeSetupList MBS-QoSFlowsToBeSetupList, + mBSSessionStatus MBSSessionStatus, + mBS-ServiceArea MBS-ServiceArea OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MBS-DistributionSetupResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +MBS-DistributionSetupResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +MBS-DistributionSetupUnsuccessfulTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBS-DistributionSetupUnsuccessfulTransfer-ExtIEs} } OPTIONAL, + ... +} + +MBS-DistributionSetupUnsuccessfulTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-NGUFailureIndication ::= CHOICE { + locationindependent MBS-UP-FailureIndication, + locationdependent MBS-UP-FailureIndicationList, + choice-Extensions ProtocolIE-SingleContainer { {MBS-NGUFailureIndication-ExtIEs} } +} + +MBS-NGUFailureIndication-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +MBS-UP-FailureIndicationList ::= SEQUENCE (SIZE(1..maxnoofMBSServiceAreaInformation)) OF MBS-UP-FailureIndicationItem + +MBS-UP-FailureIndicationItem ::= SEQUENCE { + mBS-AreaSessionID MBS-AreaSessionID, + mBS-UP-FailureIndication MBS-UP-FailureIndication, + iE-Extensions ProtocolExtensionContainer { {MBS-UP-FailureIndicationItem-ExtIEs} } OPTIONAL, + ... +} + +MBS-UP-FailureIndicationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-UP-FailureIndication ::= ENUMERATED {ng-u-path-failure-detected, ...} + +MBSSessionSetupRequestList ::= SEQUENCE (SIZE(1..maxnoofMBSSessions)) OF MBSSessionSetupRequestItem + +MBSSessionSetupRequestItem ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + associatedMBSQosFlowSetupRequestList AssociatedMBSQosFlowSetupRequestList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MBSSessionSetupRequestItem-ExtIEs} } OPTIONAL, + ... +} + +MBSSessionSetupRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-MBS-AssistanceInformation CRITICALITY ignore EXTENSION MBS-AssistanceInformation PRESENCE optional }, + ... +} + +MBSSessionSetuporModifyRequestList ::= SEQUENCE (SIZE(1..maxnoofMBSSessions)) OF MBSSessionSetuporModifyRequestItem + +MBSSessionSetuporModifyRequestItem ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + mBS-AreaSessionID MBS-AreaSessionID OPTIONAL, + associatedMBSQosFlowSetuporModifyRequestList AssociatedMBSQosFlowSetuporModifyRequestList OPTIONAL, + mBS-QosFlowToReleaseList QosFlowListWithCause OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{MBSSessionSetuporModifyRequestItem-ExtIEs}} OPTIONAL, + ... +} + +MBSSessionSetuporModifyRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-MBS-AssistanceInformation CRITICALITY ignore EXTENSION MBS-AssistanceInformation PRESENCE optional }, + ... +} + + +MBSSessionToReleaseList ::= SEQUENCE (SIZE(1..maxnoofMBSSessions)) OF MBSSessionToReleaseItem + +MBSSessionToReleaseItem ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + cause Cause, + iE-Extensions ProtocolExtensionContainer { { MBSSessionToReleaseItem-ExtIEs} } OPTIONAL, + ... +} + +MBSSessionToReleaseItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBSSessionStatus ::= ENUMERATED { + activated, + deactivated, + ... +} + +MicoAllPLMN ::= ENUMERATED { + true, + ... +} + + +MICOModeIndication ::= ENUMERATED { + true, + ... +} + +MobilityInformation ::= BIT STRING (SIZE(16)) + +ExtendedMobilityInformation ::= BIT STRING (SIZE(32)) + +MobilityRestrictionList ::= SEQUENCE { + servingPLMN PLMNIdentity, + equivalentPLMNs EquivalentPLMNs OPTIONAL, + rATRestrictions RATRestrictions OPTIONAL, + forbiddenAreaInformation ForbiddenAreaInformation OPTIONAL, + serviceAreaInformation ServiceAreaInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MobilityRestrictionList-ExtIEs} } OPTIONAL, + ... +} + +MobilityRestrictionList-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-LastEUTRAN-PLMNIdentity CRITICALITY ignore EXTENSION PLMNIdentity PRESENCE optional }| + { ID id-CNTypeRestrictionsForServing CRITICALITY ignore EXTENSION CNTypeRestrictionsForServing PRESENCE optional }| + { ID id-CNTypeRestrictionsForEquivalent CRITICALITY ignore EXTENSION CNTypeRestrictionsForEquivalent PRESENCE optional }| + { ID id-NPN-MobilityInformation CRITICALITY reject EXTENSION NPN-MobilityInformation PRESENCE optional }, + ... +} + +MDT-AlignmentInfo ::= CHOICE { + s-basedMDT NGRANTraceID, + choice-Extensions ProtocolIE-SingleContainer { { MDT-AlignmentInfo-ExtIEs} } +} + +MDT-AlignmentInfo-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +MDTPLMNList ::= SEQUENCE (SIZE(1..maxnoofMDTPLMNs)) OF PLMNIdentity + +MDTPLMNModificationList ::= SEQUENCE (SIZE(0..maxnoofMDTPLMNs)) OF PLMNIdentity + +MDT-Configuration ::= SEQUENCE { + mdt-Config-NR MDT-Configuration-NR OPTIONAL, + mdt-Config-EUTRA MDT-Configuration-EUTRA OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MDT-Configuration-ExtIEs} } OPTIONAL, + ... +} + +MDT-Configuration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-MN-only-MDT-collection CRITICALITY ignore EXTENSION MN-only-MDT-collection PRESENCE optional }, + ... +} + +MN-only-MDT-collection ::= ENUMERATED {mn-only, ...} + +MDT-Configuration-NR ::= SEQUENCE { + mdt-Activation MDT-Activation, + areaScopeOfMDT AreaScopeOfMDT-NR, + mDTModeNr MDTModeNr, + signallingBasedMDTPLMNList MDTPLMNList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MDT-Configuration-NR-ExtIEs} } OPTIONAL, + ... +} + +MDT-Configuration-NR-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PNI-NPN-AreaScopeofMDT CRITICALITY ignore EXTENSION PNI-NPN-AreaScopeofMDT PRESENCE optional }| + { ID id-NetworkSliceAreaScopeofMDT CRITICALITY ignore EXTENSION NetworkSliceAreaScopeofMDT PRESENCE optional }, + ... +} + +MDT-Configuration-EUTRA ::= SEQUENCE { + mdt-Activation MDT-Activation, + areaScopeOfMDT AreaScopeOfMDT-EUTRA, + mDTMode MDTModeEutra, + signallingBasedMDTPLMNList MDTPLMNList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MDT-Configuration-EUTRA-ExtIEs} } OPTIONAL, + ... +} + +MDT-Configuration-EUTRA-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MDT-Activation ::= ENUMERATED { + immediate-MDT-only, + logged-MDT-only, + immediate-MDT-and-Trace, + ... +} + +MDTModeNr ::= CHOICE { + immediateMDTNr ImmediateMDTNr, + loggedMDTNr LoggedMDTNr, + choice-Extensions ProtocolIE-SingleContainer { {MDTModeNr-ExtIEs} } +} + +MDTModeNr-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +MDTModeEutra ::= OCTET STRING + +MeasurementsToActivate ::= BIT STRING(SIZE(8)) + +MobileIAB-Authorized ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +MobileIABNodeIndication ::= ENUMERATED { + true, + ... +} + +MobileIAB-Supported ::= ENUMERATED { + true, + ... +} + +MonitoringRequestonAvailableBitrate ::= SEQUENCE { + monitoringRequest MonitoringRequest, + dlAvailableBitrateReportThresholds AvailableBitrateReportThresholdList OPTIONAL, +-- The above IE shall be present if the Monitoring Request IE is set to the value “dl” or “both” + ulAvailableBitrateReportThresholds AvailableBitrateReportThresholdList OPTIONAL, +-- The above IE shall be present if the Monitoring Request IE is set to the value “ul” or “both” + iE-Extensions ProtocolExtensionContainer { { MonitoringRequestonAvailableBitrate-ExtIEs} } OPTIONAL, + ... +} + +MonitoringRequestonAvailableBitrate-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MonitoringRequest ::= ENUMERATED {ul, dl, both, stop,...} + +MRB-ID ::= INTEGER (1..512, ...) + +MulticastSessionActivationRequestTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + iE-Extensions ProtocolExtensionContainer { { MulticastSessionActivationRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +MulticastSessionActivationRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MulticastSessionDeactivationRequestTransfer ::= SEQUENCE { + mBS-SessionID MBS-SessionID, + iE-Extensions ProtocolExtensionContainer { { MulticastSessionDeactivationRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +MulticastSessionDeactivationRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MulticastSessionUpdateRequestTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionUpdateRequestTransferIEs} }, + ... +} + +MulticastSessionUpdateRequestTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-ServiceArea CRITICALITY reject TYPE MBS-ServiceArea PRESENCE optional }| + { ID id-MBS-QoSFlowsToBeSetupModList CRITICALITY reject TYPE MBS-QoSFlowsToBeSetupList PRESENCE optional }| + { ID id-MBS-QoSFlowToReleaseList CRITICALITY reject TYPE QosFlowListWithCause PRESENCE optional }| + { ID id-MBS-SessionTNLInfo5GC CRITICALITY reject TYPE MBS-SessionTNLInfo5GC PRESENCE optional }| + { ID id-MBS-UP-FailureIndication CRITICALITY reject TYPE MBS-UP-FailureIndication PRESENCE optional }, + ... +} + + +MulticastGroupPagingAreaList ::= SEQUENCE (SIZE(1..maxnoofPagingAreas)) OF MulticastGroupPagingAreaItem + +MulticastGroupPagingAreaItem ::= SEQUENCE { + multicastGroupPagingArea MulticastGroupPagingArea, + uE-PagingList UE-PagingList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { MulticastGroupPagingAreaItem-ExtIEs} } OPTIONAL, + ... +} + +MulticastGroupPagingAreaItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MBS-AreaTAIList ::= SEQUENCE (SIZE(1..maxnoofTAIforPaging)) OF TAI + +MulticastGroupPagingArea ::= SEQUENCE { + mBS-AreaTAIList MBS-AreaTAIList, + iE-Extensions ProtocolExtensionContainer { { MulticastGroupPagingArea-ExtIEs} } OPTIONAL, + ... +} + +MulticastGroupPagingArea-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UE-PagingList ::= SEQUENCE (SIZE(1..maxnoofUEsforPaging)) OF UE-PagingItem + +UE-PagingItem ::= SEQUENCE { + uEIdentityIndexValue UEIdentityIndexValue, + pagingDRX PagingDRX OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { UE-PagingItem-ExtIEs} } OPTIONAL, + ... +} + +UE-PagingItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +M1Configuration ::= SEQUENCE { + m1reportingTrigger M1ReportingTrigger, + m1thresholdEventA2 M1ThresholdEventA2 OPTIONAL, +-- The above IE shall be present if the M1 Reporting Trigger IE is set to the value “A2event-triggered” or “A2event-triggered periodic” + m1periodicReporting M1PeriodicReporting OPTIONAL, +-- The above IE shall be present if the M1 Reporting Trigger IE is set to the value “periodic” or “A2event-triggered periodic” + iE-Extensions ProtocolExtensionContainer { { M1Configuration-ExtIEs} } OPTIONAL, + ... +} + +M1Configuration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-IncludeBeamMeasurementsIndication CRITICALITY ignore EXTENSION IncludeBeamMeasurementsIndication PRESENCE optional }| + { ID id-BeamMeasurementsReportConfiguration CRITICALITY ignore EXTENSION BeamMeasurementsReportConfiguration PRESENCE conditional }, +-- The above IE shall be present if the Include Beam Measurements Indication IE is set to the value “true” + ... +} + +IncludeBeamMeasurementsIndication ::= ENUMERATED { + true, + ... +} + +MaxNrofRS-IndexesToReport ::= INTEGER (1..64, ...) + +M1ReportingTrigger ::= ENUMERATED { + periodic, + a2eventtriggered, + a2eventtriggered-periodic, + ... +} + +M1ThresholdEventA2 ::= SEQUENCE { + m1ThresholdType M1ThresholdType, + iE-Extensions ProtocolExtensionContainer { { M1ThresholdEventA2-ExtIEs} } OPTIONAL, + ... +} + +M1ThresholdEventA2-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +M1ThresholdType ::= CHOICE { + threshold-RSRP Threshold-RSRP, + threshold-RSRQ Threshold-RSRQ, + threshold-SINR Threshold-SINR, + choice-Extensions ProtocolIE-SingleContainer { {M1ThresholdType-ExtIEs} } +} + +M1ThresholdType-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +M1PeriodicReporting ::= SEQUENCE { + reportInterval ReportIntervalMDT, + reportAmount ReportAmountMDT, + iE-Extensions ProtocolExtensionContainer { { M1PeriodicReporting-ExtIEs} } OPTIONAL, + ... +} + +M1PeriodicReporting-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-ExtendedReportIntervalMDT CRITICALITY ignore EXTENSION ExtendedReportIntervalMDT PRESENCE optional}, + ... +} + +M4Configuration ::= SEQUENCE { + m4period M4period, + m4-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M4Configuration-ExtIEs} } OPTIONAL, + ... +} + +M4Configuration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-M4ReportAmount CRITICALITY ignore EXTENSION M4ReportAmountMDT PRESENCE optional }, + ... +} + +M4ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + +M4period ::= ENUMERATED {ms1024, ms2048, ms5120, ms10240, min1, ... } + +M5Configuration ::= SEQUENCE { + m5period M5period, + m5-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M5Configuration-ExtIEs} } OPTIONAL, + ... +} + +M5Configuration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-M5ReportAmount CRITICALITY ignore EXTENSION M5ReportAmountMDT PRESENCE optional }, + ... +} + +M5ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + + +M5period ::= ENUMERATED {ms1024, ms2048, ms5120, ms10240, min1, ... } + +M6Configuration ::= SEQUENCE { + m6report-Interval M6report-Interval, + m6-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M6Configuration-ExtIEs} } OPTIONAL, + ... +} + +M6Configuration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-M6ReportAmount CRITICALITY ignore EXTENSION M6ReportAmountMDT PRESENCE optional }| + { ID id-ExcessPacketDelayThresholdConfiguration CRITICALITY ignore EXTENSION ExcessPacketDelayThresholdConfiguration PRESENCE optional }, + ... +} + + +M6ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + +M6report-Interval ::= ENUMERATED { + ms120, ms240, ms480, ms640, ms1024, ms2048, ms5120, ms10240, ms20480, ms40960, min1, min6, min12, min30, + ... +} + + +M7Configuration ::= SEQUENCE { + m7period M7period, + m7-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M7Configuration-ExtIEs} } OPTIONAL, + ... +} + +M7Configuration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-M7ReportAmount CRITICALITY ignore EXTENSION M7ReportAmountMDT PRESENCE optional }, + ... +} + +M7ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + +M7period ::= INTEGER(1..60, ...) + +MDT-circle ::= SEQUENCE { + reference-location OCTET STRING, + distance-radius INTEGER(1..65535), + iE-Extensions ProtocolExtensionContainer { {MDT-circle-ExtIEs} } OPTIONAL, + ... +} + +MDT-circle-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MDT-Location-Info ::= SEQUENCE { + mDT-Location-Information MDT-Location-Information, + iE-Extensions ProtocolExtensionContainer { { MDT-Location-Info-ExtIEs} } OPTIONAL, + ... +} + +MDT-Location-Info-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +MDT-Location-Information::= BIT STRING (SIZE (8)) + +MDT-polygon ::= OCTET STRING + +MMSID ::= OCTET STRING (SIZE (1)) + +-- N + +N3IWF-ID ::= CHOICE { + n3IWF-ID BIT STRING (SIZE(16)), + choice-Extensions ProtocolIE-SingleContainer { {N3IWF-ID-ExtIEs} } +} + +N3IWF-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +N6JitterInformation ::= SEQUENCE { + n6JitterLowerBound INTEGER (-127..127), + n6JitterUpperBound INTEGER (-127..127), + iE-Extensions ProtocolExtensionContainer { { N6JitterInformation-ExtIEs} } OPTIONAL, + ... +} + +N6JitterInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NAS-PDU ::= OCTET STRING + +NASSecurityParametersFromNGRAN ::= OCTET STRING + +NB-IoT-DefaultPagingDRX ::= ENUMERATED { + rf128, rf256, rf512, rf1024, + ... +} + +NB-IoT-PagingDRX ::= ENUMERATED { + rf32, rf64, rf128, rf256, rf512, rf1024, + ... +} + +NB-IoT-Paging-eDRXCycle ::= ENUMERATED { + hf2, hf4, hf6, hf8, hf10, hf12, hf14, hf16, hf32, hf64, hf128, hf256, hf512, hf1024, + ... +} + +NB-IoT-Paging-TimeWindow ::= ENUMERATED { + s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, + ... +} + +NB-IoT-Paging-eDRXInfo ::= SEQUENCE { + nB-IoT-Paging-eDRXCycle NB-IoT-Paging-eDRXCycle, + nB-IoT-Paging-TimeWindow NB-IoT-Paging-TimeWindow OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { NB-IoT-Paging-eDRXInfo-ExtIEs} } OPTIONAL, + ... +} + +NB-IoT-Paging-eDRXInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NB-IoT-UEPriority ::= INTEGER (0..255, ...) + +NetworkControlledRepeaterAuthorized ::= ENUMERATED {authorized, not-authorized, ...} + +NetworkInstance ::= INTEGER (1..256, ...) + + +NetworkSliceListforMDT ::= SEQUENCE (SIZE(1.. maxnoofMDTPLMNs)) OF NetworkSliceItemforMDT + +NetworkSliceItemforMDT ::= SEQUENCE { + plmnID PLMNIdentity, + sliceMDTList SliceMDTList, + iE-Extensions ProtocolExtensionContainer { {NetworkSliceItemforMDT-ExtIEs} } OPTIONAL, + ... +} + +NetworkSliceItemforMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::={ + ... +} + +NetworkSliceAreaScopeofMDT ::= SEQUENCE { + networkSliceListforMDT NetworkSliceListforMDT, + iE-Extensions ProtocolExtensionContainer { {NetworkSliceAreaScopeofMDT-ExtIEs} } OPTIONAL, + ... +} + +NetworkSliceAreaScopeofMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SliceMDTList ::= SEQUENCE (SIZE(1.. maxnoofSliceItemsforMDT)) OF SliceMDTItem + +SliceMDTItem ::= SEQUENCE { + sNSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { { SliceMDTItem-ExtIEs} } OPTIONAL, + ... +} + +SliceMDTItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::={ + ... +} + + +NewSecurityContextInd ::= ENUMERATED { + true, + ... +} + +NextHopChainingCount ::= INTEGER (0..7) + +NextPagingAreaScope ::= ENUMERATED { + same, + changed, + ... +} + +NGAPIESupportInformationRequestList ::= SEQUENCE (SIZE(1.. maxnoofNGAPIESupportInfo)) OF NGAPIESupportInformationRequestItem + +NGAPIESupportInformationRequestItem ::= SEQUENCE { + ngap-ProtocolIE-Id ProtocolIE-ID, + iE-Extensions ProtocolExtensionContainer { { NGAPIESupportInformationRequestItem-ExtIEs} } OPTIONAL, + ... +} + +NGAPIESupportInformationRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NGAPIESupportInformationResponseList ::= SEQUENCE (SIZE(1.. maxnoofNGAPIESupportInfo)) OF NGAPIESupportInformationResponseItem + +NGAPIESupportInformationResponseItem ::= SEQUENCE { + ngap-ProtocolIE-Id ProtocolIE-ID, + ngap-ProtocolIESupportInfo ENUMERATED {supported, not-supported, ...}, + ngap-ProtocolIEPresenceInfo ENUMERATED {present, not-present, ...}, + iE-Extensions ProtocolExtensionContainer { { NGAPIESupportInformationResponseItem-ExtIEs} } OPTIONAL, + ... +} + +NGAPIESupportInformationResponseItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NgENB-ID ::= CHOICE { + macroNgENB-ID BIT STRING (SIZE(20)), + shortMacroNgENB-ID BIT STRING (SIZE(18)), + longMacroNgENB-ID BIT STRING (SIZE(21)), + choice-Extensions ProtocolIE-SingleContainer { {NgENB-ID-ExtIEs} } +} + +NgENB-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +NotifySourceNGRANNode ::= ENUMERATED { + notifySource, + ... +} + +NGRAN-CGI ::= CHOICE { + nR-CGI NR-CGI, + eUTRA-CGI EUTRA-CGI, + choice-Extensions ProtocolIE-SingleContainer { {NGRAN-CGI-ExtIEs} } +} + +NGRAN-CGI-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +NGRAN-TNLAssociationToRemoveList ::= SEQUENCE (SIZE(1..maxnoofTNLAssociations)) OF NGRAN-TNLAssociationToRemoveItem + +NGRAN-TNLAssociationToRemoveItem::= SEQUENCE { + tNLAssociationTransportLayerAddress CPTransportLayerInformation, + tNLAssociationTransportLayerAddressAMF CPTransportLayerInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { NGRAN-TNLAssociationToRemoveItem-ExtIEs} } OPTIONAL +} + +NGRAN-TNLAssociationToRemoveItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NGRANTraceID ::= OCTET STRING (SIZE(8)) + +NID ::= BIT STRING (SIZE(44)) + +NonDynamic5QIDescriptor ::= SEQUENCE { + fiveQI FiveQI, + priorityLevelQos PriorityLevelQos OPTIONAL, + averagingWindow AveragingWindow OPTIONAL, + maximumDataBurstVolume MaximumDataBurstVolume OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {NonDynamic5QIDescriptor-ExtIEs} } OPTIONAL, + ... +} + +NonDynamic5QIDescriptor-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CNPacketDelayBudgetDL CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }| + { ID id-CNPacketDelayBudgetUL CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }, + ... +} + +NoPDUSessionIndication ::= ENUMERATED {true, ...} + +NotAllowedTACs ::= SEQUENCE (SIZE(1..maxnoofAllowedAreas)) OF TAC + +NotificationCause ::= ENUMERATED { + fulfilled, + not-fulfilled, + ... , + not-fulfilled-DL, + not-fulfilled-UL +} + +NotificationControl ::= ENUMERATED { + notification-requested, + ... +} + +NPN-AccessInformation ::= CHOICE { + pNI-NPN-Access-Information CellCAGList, + choice-Extensions ProtocolIE-SingleContainer { {NPN-AccessInformation-ExtIEs} } +} + +NPN-AccessInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +NPN-MobilityInformation ::= CHOICE { + sNPN-MobilityInformation SNPN-MobilityInformation, + pNI-NPN-MobilityInformation PNI-NPN-MobilityInformation, + choice-Extensions ProtocolIE-SingleContainer { {NPN-MobilityInformation-ExtIEs} } +} + +NPN-MobilityInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + + +NPN-PagingAssistanceInformation ::= CHOICE { + pNI-NPN-PagingAssistance Allowed-PNI-NPN-List, + choice-Extensions ProtocolIE-SingleContainer { {NPN-PagingAssistanceInformation-ExtIEs} } +} + +NPN-PagingAssistanceInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +NPN-Support ::= CHOICE { + sNPN NID, + choice-Extensions ProtocolIE-SingleContainer { {NPN-Support-ExtIEs} } +} + +NPN-Support-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +NRCellIdentity ::= BIT STRING (SIZE(36)) + +NR-CGI ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + nRCellIdentity NRCellIdentity, + iE-Extensions ProtocolExtensionContainer { {NR-CGI-ExtIEs} } OPTIONAL, + ... +} + +NR-CGI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NR-CGIList ::= SEQUENCE (SIZE(1..maxnoofCellsingNB)) OF NR-CGI + +NR-CGIListForWarning ::= SEQUENCE (SIZE(1..maxnoofCellIDforWarning)) OF NR-CGI + +NR-PagingeDRXInformation ::= SEQUENCE { + nR-paging-eDRX-Cycle NR-Paging-eDRX-Cycle, + nR-paging-Time-Window NR-Paging-Time-Window OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {NR-PagingeDRXInformation-ExtIEs} } OPTIONAL, + ... +} + +NR-PagingeDRXInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NR-Paging-eDRX-Cycle ::= ENUMERATED { + hfquarter, hfhalf, hf1, hf2, hf4, hf8, hf16, + hf32, hf64, hf128, hf256, hf512, hf1024, + ... +} + +NR-Paging-Long-eDRX-Information-for-RRC-INACTIVE ::= SEQUENCE { + nR-paging-Long-eDRX-Cycle-for-RRC-INACTIVE NR-Paging-Long-eDRX-Cycle-for-RRC-INACTIVE, + nR-paging-Time-Window-for-RRC-INACTIVE NR-Paging-Time-Window-for-RRC-INACTIVE, + iE-Extensions ProtocolExtensionContainer { {NR-Paging-Long-eDRX-Information-for-RRC-INACTIVE-ExtIEs} } OPTIONAL, + ... +} + +NR-Paging-Long-eDRX-Information-for-RRC-INACTIVE-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NR-Paging-Long-eDRX-Cycle-for-RRC-INACTIVE ::= ENUMERATED { + hf2, hf4, hf8, hf16, + hf32, hf64, hf128, hf256, hf512, hf1024, + ... +} + +NR-Paging-Time-Window ::= ENUMERATED { + s1, s2, s3, s4, s5, + s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, + ..., + s17, s18, s19, s20, s21, s22, s23, s24, + s25, s26, s27, s28, s29, s30, s31, s32 +} + +NR-Paging-Time-Window-for-RRC-INACTIVE ::= ENUMERATED { + s1, s2, s3, s4, s5, + s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, + s17, s18, s19, s20, s21, s22, s23, s24, + s25, s26, s27, s28, s29, s30, s31, s32, + ... +} + +NRencryptionAlgorithms ::= BIT STRING (SIZE(16, ...)) + +NRintegrityProtectionAlgorithms ::= BIT STRING (SIZE(16, ...)) + +NRMobilityHistoryReport ::= OCTET STRING + +NRPPa-PDU ::= OCTET STRING + +NRUERLFReportContainer ::= OCTET STRING + +NRNTNTAIInformation ::= SEQUENCE { + servingPLMN PLMNIdentity, + tACListInNRNTN TACListInNRNTN, + uELocationDerivedTACInNRNTN TAC OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { NRNTNTAIInformation-ExtIEs} } OPTIONAL, + ... +} + +NRNTNTAIInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +NumberOfBroadcasts ::= INTEGER (0..65535) + +NumberOfBroadcastsRequested ::= INTEGER (0..65535) + +NRARFCN ::= INTEGER (0.. maxNRARFCN) + +NRFrequencyBand ::= INTEGER (1..1024, ...) + +NRFrequencyBand-List ::= SEQUENCE (SIZE(1..maxnoofNRCellBands)) OF NRFrequencyBandItem + +NRFrequencyBandItem ::= SEQUENCE { + nr-frequency-band NRFrequencyBand, + iE-Extension ProtocolExtensionContainer { {NRFrequencyBandItem-ExtIEs} } OPTIONAL, + ... +} + +NRFrequencyBandItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NRFrequencyInfo ::= SEQUENCE { + nrARFCN NRARFCN, + frequencyBand-List NRFrequencyBand-List, + iE-Extension ProtocolExtensionContainer { {NRFrequencyInfo-ExtIEs} } OPTIONAL, + ... +} + +NRFrequencyInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NR-PCI ::= INTEGER (0..1007, ...) + +NRV2XServicesAuthorized ::= SEQUENCE { + vehicleUE VehicleUE OPTIONAL, + pedestrianUE PedestrianUE OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {NRV2XServicesAuthorized-ExtIEs} } OPTIONAL, + ... +} + +NRV2XServicesAuthorized-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +VehicleUE ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +PedestrianUE ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +NRUESidelinkAggregateMaximumBitrate ::= SEQUENCE { + uESidelinkAggregateMaximumBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { {NRUESidelinkAggregateMaximumBitrate-ExtIEs} } OPTIONAL, + ... +} + +NRUESidelinkAggregateMaximumBitrate-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NSAG-ID ::= INTEGER (0..255, ...) + +NR-A2X-ServicesAuthorized ::= SEQUENCE { + aerialUE ENUMERATED {authorized, not-authorized, ...} OPTIONAL, + aerialControllerUE ENUMERATED {authorized, not-authorized, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {NR-A2X-ServicesAuthorized-ExtIEs} } OPTIONAL, + ... +} + +NR-A2X-ServicesAuthorized-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +NTN-Geographical-Area-List ::= SEQUENCE (SIZE(1..maxnoofAreaNTN)) OF NTN-Geographical-Area-Item + +NTN-Geographical-Area-Item ::= CHOICE { + circle MDT-circle, + polygon MDT-polygon, + choice-Extensions ProtocolIE-SingleContainer { {NTN-Geographicla-Area-Item-ExtIEs} } +} + +NTN-Geographicla-Area-Item-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +-- O + +OnboardingSupport ::= ENUMERATED { + true, + ... +} + +OverloadAction ::= ENUMERATED { + reject-non-emergency-mo-dt, + reject-rrc-cr-signalling, + permit-emergency-sessions-and-mobile-terminated-services-only, + permit-high-priority-sessions-and-mobile-terminated-services-only, + ... +} + +OverloadResponse ::= CHOICE { + overloadAction OverloadAction, + choice-Extensions ProtocolIE-SingleContainer { {OverloadResponse-ExtIEs} } +} + +OverloadResponse-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +OverloadStartNSSAIList ::= SEQUENCE (SIZE (1..maxnoofSliceItems)) OF OverloadStartNSSAIItem + +OverloadStartNSSAIItem ::= SEQUENCE { + sliceOverloadList SliceOverloadList, + sliceOverloadResponse OverloadResponse OPTIONAL, + sliceTrafficLoadReductionIndication TrafficLoadReductionIndication OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {OverloadStartNSSAIItem-ExtIEs} } OPTIONAL, + ... +} + +OverloadStartNSSAIItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- P + +PacketDelayBudget ::= INTEGER (0..1023, ...) + +PacketErrorRate ::= SEQUENCE { + pERScalar INTEGER (0..9, ...), + pERExponent INTEGER (0..9, ...), + iE-Extensions ProtocolExtensionContainer { {PacketErrorRate-ExtIEs} } OPTIONAL, + ... +} + +PacketErrorRate-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PacketLossRate ::= INTEGER (0..1000, ...) + +PagingAssisDataforCEcapabUE ::= SEQUENCE { + eUTRA-CGI EUTRA-CGI, + coverageEnhancementLevel CoverageEnhancementLevel, + iE-Extensions ProtocolExtensionContainer { { PagingAssisDataforCEcapabUE-ExtIEs} } OPTIONAL, + ... +} + +PagingAssisDataforCEcapabUE-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PagingAttemptInformation ::= SEQUENCE { + pagingAttemptCount PagingAttemptCount, + intendedNumberOfPagingAttempts IntendedNumberOfPagingAttempts, + nextPagingAreaScope NextPagingAreaScope OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PagingAttemptInformation-ExtIEs} } OPTIONAL, + ... +} + +PagingAttemptInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PagingAttemptCount ::= INTEGER (1..16, ...) + +PagingCause ::= ENUMERATED { + voice, + ... +} + +PagingCauseIndicationForVoiceService ::= ENUMERATED { + supported, + ... +} + +PagingDRX ::= ENUMERATED { + v32, + v64, + v128, + v256, + ... +} + +PagingOrigin ::= ENUMERATED { + non-3gpp, + ... +} + + +PagingPolicyDifferentiation ::= SEQUENCE { + pDUSessionForPagingList PDUSessionForPagingList, + iE-Extensions ProtocolExtensionContainer { { PagingPolicyDifferentiation-ExtIEs} } OPTIONAL, + ... +} + +PagingPolicyDifferentiation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionForPagingList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionForPagingItem + +PDUSessionForPagingItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + pagingPolicyDifferentiationList PagingPolicyDifferentiationList, + iE-Extensions ProtocolExtensionContainer { { PDUSessionForPagingItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionForPagingItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PagingPolicyDifferentiationList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF PagingPolicyDifferentiationItem + +PagingPolicyDifferentiationItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier OPTIONAL, + pagingPolicyIndicator PagingPolicyIndicator OPTIONAL, + allocationAndRetentionPriority AllocationAndRetentionPriority OPTIONAL, + fiveQI FiveQI OPTIONAL, + dl-DataSize INTEGER (0..96000, ...) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PagingPolicyDifferentiationItem-ExtIEs} } OPTIONAL, + ... +} + +PagingPolicyDifferentiationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PagingPolicyIndicator ::= INTEGER (0..7, ...) + +PagingPriority ::= ENUMERATED { + priolevel1, + priolevel2, + priolevel3, + priolevel4, + priolevel5, + priolevel6, + priolevel7, + priolevel8, + ... +} + +PagingProbabilityInformation ::= ENUMERATED { + p00, p05, p10, p15, p20, p25, p30, p35, p40, p45, p50, p55, p60, p65, p70, p75, p80, p85, p90, p95, p100, + ... +} + +ParentTImeSource ::= ENUMERATED {synce, ptp, gnss, atomicclock, terrestrialradio, serialtimecode, ntp, handset, other, ...} + +Partially-Allowed-NSSAI ::= SEQUENCE (SIZE(1.. maxnoofPartiallyAllowedS-NSSAIs)) OF PartiallyAllowedNSSAI-Item + +PartiallyAllowedNSSAI-Item ::= SEQUENCE { + s-NSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { {PartiallyAllowedNSSAI-Item-ExtIEs} } OPTIONAL, + ... +} + +PartiallyAllowedNSSAI-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PathSwitchRequestAcknowledgeTransfer ::= SEQUENCE { + uL-NGU-UP-TNLInformation UPTransportLayerInformation OPTIONAL, + securityIndication SecurityIndication OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PathSwitchRequestAcknowledgeTransfer-ExtIEs} } OPTIONAL, + ... +} + +PathSwitchRequestAcknowledgeTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-AdditionalNGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformationPairList PRESENCE optional }| + { ID id-RedundantUL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-AdditionalRedundantNGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformationPairList PRESENCE optional }| + { ID id-QosFlowParametersList CRITICALITY ignore EXTENSION QosFlowParametersList PRESENCE optional }, + ... +} + +PathSwitchRequestSetupFailedTransfer ::= SEQUENCE { + cause Cause, + iE-Extensions ProtocolExtensionContainer { {PathSwitchRequestSetupFailedTransfer-ExtIEs} } OPTIONAL, + ... +} + +PathSwitchRequestSetupFailedTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PathSwitchRequestTransfer ::= SEQUENCE { + dL-NGU-UP-TNLInformation UPTransportLayerInformation, + dL-NGU-TNLInformationReused DL-NGU-TNLInformationReused OPTIONAL, + userPlaneSecurityInformation UserPlaneSecurityInformation OPTIONAL, + qosFlowAcceptedList QosFlowAcceptedList, + iE-Extensions ProtocolExtensionContainer { {PathSwitchRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +PathSwitchRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-AdditionalDLQosFlowPerTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformationList PRESENCE optional }| + { ID id-RedundantDL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-RedundantDL-NGU-TNLInformationReused CRITICALITY ignore EXTENSION DL-NGU-TNLInformationReused PRESENCE optional }| + { ID id-AdditionalRedundantDLQosFlowPerTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformationList PRESENCE optional }| + { ID id-UsedRSNInformation CRITICALITY ignore EXTENSION RedundantPDUSessionInformation PRESENCE optional }| + { ID id-GlobalRANNodeID CRITICALITY ignore EXTENSION GlobalRANNodeID PRESENCE optional }| + { ID id-MBS-SupportIndicator CRITICALITY ignore EXTENSION MBS-SupportIndicator PRESENCE optional }| + { ID id-PDUSetbasedHandlingIndicator CRITICALITY ignore EXTENSION PDUSetbasedHandlingIndicator PRESENCE optional }| + { ID id-ECNMarkingorCongestionInformationReportingStatus CRITICALITY ignore EXTENSION ECNMarkingorCongestionInformationReportingStatus PRESENCE optional }, + ... +} + +PathSwitchRequestUnsuccessfulTransfer ::= SEQUENCE { + cause Cause, + iE-Extensions ProtocolExtensionContainer { {PathSwitchRequestUnsuccessfulTransfer-ExtIEs} } OPTIONAL, + ... +} + +PathSwitchRequestUnsuccessfulTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PC5QoSParameters ::= SEQUENCE { + pc5QoSFlowList PC5QoSFlowList, + pc5LinkAggregateBitRates BitRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PC5QoSParameters-ExtIEs} } OPTIONAL, + ... +} + +PC5QoSParameters-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PC5QoSFlowList ::= SEQUENCE (SIZE(1..maxnoofPC5QoSFlows)) OF PC5QoSFlowItem + +PC5QoSFlowItem::= SEQUENCE { + pQI FiveQI, + pc5FlowBitRates PC5FlowBitRates OPTIONAL, + range Range OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PC5QoSFlowItem-ExtIEs} } OPTIONAL, + ... +} + +PC5QoSFlowItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PC5FlowBitRates ::= SEQUENCE { + guaranteedFlowBitRate BitRate, + maximumFlowBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { { PC5FlowBitRates-ExtIEs} } OPTIONAL, + ... +} + +PC5FlowBitRates-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +PCIListForMDT ::= SEQUENCE (SIZE(1.. maxnoofNeighPCIforMDT)) OF NR-PCI + +PrivacyIndicator ::= ENUMERATED { + immediate-MDT, + logged-MDT, + ... +} + +PDUSessionAggregateMaximumBitRate ::= SEQUENCE { + pDUSessionAggregateMaximumBitRateDL BitRate, + pDUSessionAggregateMaximumBitRateUL BitRate, + iE-Extensions ProtocolExtensionContainer { {PDUSessionAggregateMaximumBitRate-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionAggregateMaximumBitRate-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionID ::= INTEGER (0..255) + +PDUSessionPairID ::= INTEGER (0..255, ...) + +PDUSessionResourceAdmittedList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceAdmittedItem + +PDUSessionResourceAdmittedItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + handoverRequestAcknowledgeTransfer OCTET STRING (CONTAINING HandoverRequestAcknowledgeTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceAdmittedItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceAdmittedItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToModifyListModCfm ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToModifyItemModCfm + +PDUSessionResourceFailedToModifyItemModCfm ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceModifyIndicationUnsuccessfulTransfer OCTET STRING (CONTAINING PDUSessionResourceModifyIndicationUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToModifyItemModCfm-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToModifyItemModCfm-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToModifyListModRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToModifyItemModRes + +PDUSessionResourceFailedToModifyItemModRes ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceModifyUnsuccessfulTransfer OCTET STRING (CONTAINING PDUSessionResourceModifyUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToModifyItemModRes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToModifyItemModRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToResumeListRESReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToResumeItemRESReq + +PDUSessionResourceFailedToResumeItemRESReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + cause Cause, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToResumeItemRESReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToResumeItemRESReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +PDUSessionResourceFailedToResumeListRESRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToResumeItemRESRes + +PDUSessionResourceFailedToResumeItemRESRes ::= SEQUENCE { + pDUSessionID PDUSessionID, + cause Cause, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToResumeItemRESRes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToResumeItemRESRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToSetupListCxtFail ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToSetupItemCxtFail + +PDUSessionResourceFailedToSetupItemCxtFail ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceSetupUnsuccessfulTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToSetupItemCxtFail-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToSetupItemCxtFail-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToSetupListCxtRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToSetupItemCxtRes + +PDUSessionResourceFailedToSetupItemCxtRes ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceSetupUnsuccessfulTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToSetupItemCxtRes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToSetupItemCxtRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToSetupListHOAck ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToSetupItemHOAck + +PDUSessionResourceFailedToSetupItemHOAck ::= SEQUENCE { + pDUSessionID PDUSessionID, + handoverResourceAllocationUnsuccessfulTransfer OCTET STRING (CONTAINING HandoverResourceAllocationUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToSetupItemHOAck-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToSetupItemHOAck-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToSetupListPSReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToSetupItemPSReq + +PDUSessionResourceFailedToSetupItemPSReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + pathSwitchRequestSetupFailedTransfer OCTET STRING (CONTAINING PathSwitchRequestSetupFailedTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToSetupItemPSReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToSetupItemPSReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceFailedToSetupListSURes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceFailedToSetupItemSURes + +PDUSessionResourceFailedToSetupItemSURes ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceSetupUnsuccessfulTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceFailedToSetupItemSURes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceFailedToSetupItemSURes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceHandoverList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceHandoverItem + +PDUSessionResourceHandoverItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + handoverCommandTransfer OCTET STRING (CONTAINING HandoverCommandTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceHandoverItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceHandoverItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceInformationList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceInformationItem + +PDUSessionResourceInformationItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + qosFlowInformationList QosFlowInformationList, + dRBsToQosFlowsMappingList DRBsToQosFlowsMappingList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceInformationItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceInformationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceListCxtRelCpl ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceItemCxtRelCpl + +PDUSessionResourceItemCxtRelCpl ::= SEQUENCE { + pDUSessionID PDUSessionID, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceItemCxtRelCpl-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceItemCxtRelCpl-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PDUSessionResourceReleaseResponseTransfer CRITICALITY ignore EXTENSION OCTET STRING (CONTAINING PDUSessionResourceReleaseResponseTransfer) PRESENCE optional }, + ... +} + +PDUSessionResourceListCxtRelReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceItemCxtRelReq + +PDUSessionResourceItemCxtRelReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceItemCxtRelReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceItemCxtRelReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceListHORqd ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceItemHORqd + +PDUSessionResourceItemHORqd ::= SEQUENCE { + pDUSessionID PDUSessionID, + handoverRequiredTransfer OCTET STRING (CONTAINING HandoverRequiredTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceItemHORqd-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceItemHORqd-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionListMTCommHReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionListMTCommHReq-Item + +PDUSessionListMTCommHReq-Item ::= SEQUENCE { + pDUSessionID PDUSessionID, + iE-Extensions ProtocolExtensionContainer { { PDUSessionListMTCommHReq-Item-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionListMTCommHReq-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceModifyConfirmTransfer ::= SEQUENCE { + qosFlowModifyConfirmList QosFlowModifyConfirmList, + uLNGU-UP-TNLInformation UPTransportLayerInformation, + additionalNG-UUPTNLInformation UPTransportLayerInformationPairList OPTIONAL, + qosFlowFailedToModifyList QosFlowListWithCause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyConfirmTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyConfirmTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-RedundantUL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-AdditionalRedundantNGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformationPairList PRESENCE optional }, + ... +} + +PDUSessionResourceModifyIndicationUnsuccessfulTransfer ::= SEQUENCE { + cause Cause, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyIndicationUnsuccessfulTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyIndicationUnsuccessfulTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceModifyRequestTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceModifyRequestTransferIEs} }, + ... +} + +PDUSessionResourceModifyRequestTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-PDUSessionAggregateMaximumBitRate CRITICALITY reject TYPE PDUSessionAggregateMaximumBitRate PRESENCE optional }| + { ID id-UL-NGU-UP-TNLModifyList CRITICALITY reject TYPE UL-NGU-UP-TNLModifyList PRESENCE optional }| + { ID id-NetworkInstance CRITICALITY reject TYPE NetworkInstance PRESENCE optional }| + { ID id-QosFlowAddOrModifyRequestList CRITICALITY reject TYPE QosFlowAddOrModifyRequestList PRESENCE optional }| + { ID id-QosFlowToReleaseList CRITICALITY reject TYPE QosFlowListWithCause PRESENCE optional }| + { ID id-AdditionalUL-NGU-UP-TNLInformation CRITICALITY reject TYPE UPTransportLayerInformationList PRESENCE optional }| + { ID id-CommonNetworkInstance CRITICALITY ignore TYPE CommonNetworkInstance PRESENCE optional }| + { ID id-AdditionalRedundantUL-NGU-UP-TNLInformation CRITICALITY ignore TYPE UPTransportLayerInformationList PRESENCE optional }| + { ID id-RedundantCommonNetworkInstance CRITICALITY ignore TYPE CommonNetworkInstance PRESENCE optional }| + { ID id-RedundantUL-NGU-UP-TNLInformation CRITICALITY ignore TYPE UPTransportLayerInformation PRESENCE optional }| + { ID id-SecurityIndication CRITICALITY ignore TYPE SecurityIndication PRESENCE optional }| + { ID id-MBSSessionSetuporModifyRequestList CRITICALITY ignore TYPE MBSSessionSetuporModifyRequestList PRESENCE optional }| + { ID id-MBSSessionToReleaseList CRITICALITY ignore TYPE MBSSessionToReleaseList PRESENCE optional }| + { ID id-UserPlaneFailureIndication CRITICALITY ignore TYPE UserPlaneFailureIndication PRESENCE optional }, + ... +} + +PDUSessionResourceModifyResponseTransfer ::= SEQUENCE { + dL-NGU-UP-TNLInformation UPTransportLayerInformation OPTIONAL, + uL-NGU-UP-TNLInformation UPTransportLayerInformation OPTIONAL, + qosFlowAddOrModifyResponseList QosFlowAddOrModifyResponseList OPTIONAL, + additionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList OPTIONAL, + qosFlowFailedToAddOrModifyList QosFlowListWithCause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-AdditionalNGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformationPairList PRESENCE optional }| + { ID id-RedundantDL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-RedundantUL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-AdditionalRedundantDLQosFlowPerTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformationList PRESENCE optional }| + { ID id-AdditionalRedundantNGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformationPairList PRESENCE optional }| + { ID id-SecondaryRATUsageInformation CRITICALITY ignore EXTENSION SecondaryRATUsageInformation PRESENCE optional }| + { ID id-MBS-SupportIndicator CRITICALITY ignore EXTENSION MBS-SupportIndicator PRESENCE optional }| + { ID id-MBSSessionSetuporModifyResponseList CRITICALITY ignore EXTENSION MBSSessionSetupResponseList PRESENCE optional }| + { ID id-MBSSessionFailedtoSetuporModifyList CRITICALITY ignore EXTENSION MBSSessionFailedtoSetupList PRESENCE optional }| + { ID id-ECNMarkingorCongestionInformationReportingStatus CRITICALITY ignore EXTENSION ECNMarkingorCongestionInformationReportingStatus PRESENCE optional }| + { ID id-PDUSetbasedHandlingIndicator CRITICALITY ignore EXTENSION PDUSetbasedHandlingIndicator PRESENCE optional }| + { ID id-UserPlaneFailureIndicationReport CRITICALITY ignore EXTENSION UserPlaneFailureIndicationReport PRESENCE optional }, + ... +} + +PDUSessionResourceModifyIndicationTransfer ::= SEQUENCE { + dLQosFlowPerTNLInformation QosFlowPerTNLInformation, + additionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyIndicationTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyIndicationTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SecondaryRATUsageInformation CRITICALITY ignore EXTENSION SecondaryRATUsageInformation PRESENCE optional }| + { ID id-SecurityResult CRITICALITY ignore EXTENSION SecurityResult PRESENCE optional }| + { ID id-RedundantDLQosFlowPerTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformation PRESENCE optional }| + { ID id-AdditionalRedundantDLQosFlowPerTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformationList PRESENCE optional }| + { ID id-GlobalRANNodeID CRITICALITY ignore EXTENSION GlobalRANNodeID PRESENCE optional }| + { ID id-ECNMarkingorCongestionInformationReportingStatus CRITICALITY ignore EXTENSION ECNMarkingorCongestionInformationReportingStatus PRESENCE optional }, + ... +} + +PDUSessionResourceModifyListModCfm ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceModifyItemModCfm + +PDUSessionResourceModifyItemModCfm ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceModifyConfirmTransfer OCTET STRING (CONTAINING PDUSessionResourceModifyConfirmTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyItemModCfm-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyItemModCfm-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceModifyListModInd ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceModifyItemModInd + +PDUSessionResourceModifyItemModInd ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceModifyIndicationTransfer OCTET STRING (CONTAINING PDUSessionResourceModifyIndicationTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyItemModInd-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyItemModInd-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceModifyListModReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceModifyItemModReq + +PDUSessionResourceModifyItemModReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + nAS-PDU NAS-PDU OPTIONAL, + pDUSessionResourceModifyRequestTransfer OCTET STRING (CONTAINING PDUSessionResourceModifyRequestTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyItemModReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyItemModReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-S-NSSAI CRITICALITY reject EXTENSION S-NSSAI PRESENCE optional }| + { ID id-PduSessionExpectedUEActivityBehaviour CRITICALITY ignore EXTENSION ExpectedUEActivityBehaviour PRESENCE optional }, + ... +} + +PDUSessionResourceModifyListModRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceModifyItemModRes + +PDUSessionResourceModifyItemModRes ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceModifyResponseTransfer OCTET STRING (CONTAINING PDUSessionResourceModifyResponseTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyItemModRes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyItemModRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceModifyUnsuccessfulTransfer ::= SEQUENCE { + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceModifyUnsuccessfulTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceModifyUnsuccessfulTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceNotifyList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceNotifyItem + +PDUSessionResourceNotifyItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceNotifyTransfer OCTET STRING (CONTAINING PDUSessionResourceNotifyTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceNotifyItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceNotifyItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceNotifyReleasedTransfer ::= SEQUENCE { + cause Cause, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceNotifyReleasedTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceNotifyReleasedTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SecondaryRATUsageInformation CRITICALITY ignore EXTENSION SecondaryRATUsageInformation PRESENCE optional }| + { ID id-UserPlaneErrorIndicator CRITICALITY ignore EXTENSION UserPlaneErrorIndicator PRESENCE optional }, + ... +} + +UserPlaneErrorIndicator ::= ENUMERATED { + gTP-U-error-indication-received, + ... +} + +PDUSessionResourceNotifyTransfer ::= SEQUENCE { + qosFlowNotifyList QosFlowNotifyList OPTIONAL, + qosFlowReleasedList QosFlowListWithCause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceNotifyTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceNotifyTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SecondaryRATUsageInformation CRITICALITY ignore EXTENSION SecondaryRATUsageInformation PRESENCE optional }| + { ID id-QosFlowFeedbackList CRITICALITY ignore EXTENSION QosFlowFeedbackList PRESENCE optional }, + ... +} + +PDUSessionResourceReleaseCommandTransfer ::= SEQUENCE { + cause Cause, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceReleaseCommandTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceReleaseCommandTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-QosFlowAdditionalInfoList CRITICALITY ignore EXTENSION QosFlowAdditionalInfoListRelCom PRESENCE optional }, + ... +} + +PDUSessionResourceReleasedListNot ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceReleasedItemNot + +PDUSessionResourceReleasedItemNot ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceNotifyReleasedTransfer OCTET STRING (CONTAINING PDUSessionResourceNotifyReleasedTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceReleasedItemNot-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceReleasedItemNot-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceReleasedListPSAck ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceReleasedItemPSAck + +PDUSessionResourceReleasedItemPSAck ::= SEQUENCE { + pDUSessionID PDUSessionID, + pathSwitchRequestUnsuccessfulTransfer OCTET STRING (CONTAINING PathSwitchRequestUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceReleasedItemPSAck-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceReleasedItemPSAck-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceReleasedListPSFail ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceReleasedItemPSFail + +PDUSessionResourceReleasedItemPSFail ::= SEQUENCE { + pDUSessionID PDUSessionID, + pathSwitchRequestUnsuccessfulTransfer OCTET STRING (CONTAINING PathSwitchRequestUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceReleasedItemPSFail-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceReleasedItemPSFail-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceReleasedListRelRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceReleasedItemRelRes + +PDUSessionResourceReleasedItemRelRes ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceReleaseResponseTransfer OCTET STRING (CONTAINING PDUSessionResourceReleaseResponseTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceReleasedItemRelRes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceReleasedItemRelRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceReleaseResponseTransfer ::= SEQUENCE { + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceReleaseResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceReleaseResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SecondaryRATUsageInformation CRITICALITY ignore EXTENSION SecondaryRATUsageInformation PRESENCE optional }| + { ID id-QosFlowAdditionalInfoList CRITICALITY ignore EXTENSION QosFlowAdditionalInfoListRelRes PRESENCE optional }, + ... +} + +PDUSessionResourceResumeListRESReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceResumeItemRESReq + +PDUSessionResourceResumeItemRESReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + uEContextResumeRequestTransfer OCTET STRING (CONTAINING UEContextResumeRequestTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceResumeItemRESReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceResumeItemRESReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceResumeListRESRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceResumeItemRESRes + +PDUSessionResourceResumeItemRESRes ::= SEQUENCE { + pDUSessionID PDUSessionID, + uEContextResumeResponseTransfer OCTET STRING (CONTAINING UEContextResumeResponseTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceResumeItemRESRes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceResumeItemRESRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceSecondaryRATUsageList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSecondaryRATUsageItem + +PDUSessionResourceSecondaryRATUsageItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + secondaryRATDataUsageReportTransfer OCTET STRING (CONTAINING SecondaryRATDataUsageReportTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSecondaryRATUsageItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSecondaryRATUsageItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceSetupListCxtReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSetupItemCxtReq + +PDUSessionResourceSetupItemCxtReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + nAS-PDU NAS-PDU OPTIONAL, + s-NSSAI S-NSSAI, + pDUSessionResourceSetupRequestTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupRequestTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSetupItemCxtReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSetupItemCxtReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PduSessionExpectedUEActivityBehaviour CRITICALITY ignore EXTENSION ExpectedUEActivityBehaviour PRESENCE optional }, + ... +} + +PDUSessionResourceSetupListCxtRes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSetupItemCxtRes + +PDUSessionResourceSetupItemCxtRes ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceSetupResponseTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupResponseTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSetupItemCxtRes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSetupItemCxtRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceSetupListHOReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSetupItemHOReq + +PDUSessionResourceSetupItemHOReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + s-NSSAI S-NSSAI, + handoverRequestTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupRequestTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSetupItemHOReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSetupItemHOReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PduSessionExpectedUEActivityBehaviour CRITICALITY ignore EXTENSION ExpectedUEActivityBehaviour PRESENCE optional }, + ... +} + +PDUSessionResourceSetupListSUReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSetupItemSUReq + +PDUSessionResourceSetupItemSUReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionNAS-PDU NAS-PDU OPTIONAL, + s-NSSAI S-NSSAI, + pDUSessionResourceSetupRequestTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupRequestTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSetupItemSUReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSetupItemSUReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PduSessionExpectedUEActivityBehaviour CRITICALITY ignore EXTENSION ExpectedUEActivityBehaviour PRESENCE optional }, + ... +} + +PDUSessionResourceSetupListSURes ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSetupItemSURes + +PDUSessionResourceSetupItemSURes ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceSetupResponseTransfer OCTET STRING (CONTAINING PDUSessionResourceSetupResponseTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSetupItemSURes-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSetupItemSURes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceSetupRequestTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceSetupRequestTransferIEs} }, + ... +} + +PDUSessionResourceSetupRequestTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-PDUSessionAggregateMaximumBitRate CRITICALITY reject TYPE PDUSessionAggregateMaximumBitRate PRESENCE optional }| + { ID id-UL-NGU-UP-TNLInformation CRITICALITY reject TYPE UPTransportLayerInformation PRESENCE mandatory }| + { ID id-AdditionalUL-NGU-UP-TNLInformation CRITICALITY reject TYPE UPTransportLayerInformationList PRESENCE optional }| + { ID id-DataForwardingNotPossible CRITICALITY reject TYPE DataForwardingNotPossible PRESENCE optional }| + { ID id-PDUSessionType CRITICALITY reject TYPE PDUSessionType PRESENCE mandatory }| + { ID id-SecurityIndication CRITICALITY reject TYPE SecurityIndication PRESENCE optional }| + { ID id-NetworkInstance CRITICALITY reject TYPE NetworkInstance PRESENCE optional }| + { ID id-QosFlowSetupRequestList CRITICALITY reject TYPE QosFlowSetupRequestList PRESENCE mandatory }| + { ID id-CommonNetworkInstance CRITICALITY ignore TYPE CommonNetworkInstance PRESENCE optional }| + { ID id-DirectForwardingPathAvailability CRITICALITY ignore TYPE DirectForwardingPathAvailability PRESENCE optional }| + { ID id-RedundantUL-NGU-UP-TNLInformation CRITICALITY ignore TYPE UPTransportLayerInformation PRESENCE optional }| + { ID id-AdditionalRedundantUL-NGU-UP-TNLInformation CRITICALITY ignore TYPE UPTransportLayerInformationList PRESENCE optional }| + { ID id-RedundantCommonNetworkInstance CRITICALITY ignore TYPE CommonNetworkInstance PRESENCE optional }| + { ID id-RedundantPDUSessionInformation CRITICALITY ignore TYPE RedundantPDUSessionInformation PRESENCE optional }| + { ID id-MBSSessionSetupRequestList CRITICALITY ignore TYPE MBSSessionSetupRequestList PRESENCE optional }| + { ID id-DownlinkTLContainer CRITICALITY ignore TYPE TLContainer PRESENCE optional }, + ... +} + +PDUSessionResourceSetupResponseTransfer ::= SEQUENCE { + dLQosFlowPerTNLInformation QosFlowPerTNLInformation, + additionalDLQosFlowPerTNLInformation QosFlowPerTNLInformationList OPTIONAL, + securityResult SecurityResult OPTIONAL, + qosFlowFailedToSetupList QosFlowListWithCause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSetupResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSetupResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-RedundantDLQosFlowPerTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformation PRESENCE optional }| + { ID id-AdditionalRedundantDLQosFlowPerTNLInformation CRITICALITY ignore EXTENSION QosFlowPerTNLInformationList PRESENCE optional }| + { ID id-UsedRSNInformation CRITICALITY ignore EXTENSION RedundantPDUSessionInformation PRESENCE optional }| + { ID id-GlobalRANNodeID CRITICALITY ignore EXTENSION GlobalRANNodeID PRESENCE optional }| + { ID id-MBS-SupportIndicator CRITICALITY ignore EXTENSION MBS-SupportIndicator PRESENCE optional }| + { ID id-MBSSessionSetupResponseList CRITICALITY ignore EXTENSION MBSSessionSetupResponseList PRESENCE optional }| + { ID id-MBSSessionFailedtoSetupList CRITICALITY ignore EXTENSION MBSSessionFailedtoSetupList PRESENCE optional }| + { ID id-QoSFlowTSCList CRITICALITY ignore EXTENSION QoSFlowTSCList PRESENCE optional }| + { ID id-UplinkTLContainer CRITICALITY ignore EXTENSION TLContainer PRESENCE optional }| + { ID id-ECNMarkingorCongestionInformationReportingStatus CRITICALITY ignore EXTENSION ECNMarkingorCongestionInformationReportingStatus PRESENCE optional }| + { ID id-PDUSetbasedHandlingIndicator CRITICALITY ignore EXTENSION PDUSetbasedHandlingIndicator PRESENCE optional }, + ... +} + +PDUSessionResourceSetupUnsuccessfulTransfer ::= SEQUENCE { + cause Cause, + criticalityDiagnostics CriticalityDiagnostics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSetupUnsuccessfulTransfer-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSetupUnsuccessfulTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceSuspendListSUSReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSuspendItemSUSReq + +PDUSessionResourceSuspendItemSUSReq ::= SEQUENCE { + pDUSessionID PDUSessionID, + uEContextSuspendRequestTransfer OCTET STRING (CONTAINING UEContextSuspendRequestTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceSuspendItemSUSReq-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSuspendItemSUSReq-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceSwitchedList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceSwitchedItem + +PDUSessionResourceSwitchedItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + pathSwitchRequestAcknowledgeTransfer OCTET STRING (CONTAINING PathSwitchRequestAcknowledgeTransfer), + iE-Extensions ProtocolExtensionContainer { { PDUSessionResourceSwitchedItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceSwitchedItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PduSessionExpectedUEActivityBehaviour CRITICALITY ignore EXTENSION ExpectedUEActivityBehaviour PRESENCE optional }, + ... +} + +PDUSessionResourceToBeSwitchedDLList ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceToBeSwitchedDLItem + +PDUSessionResourceToBeSwitchedDLItem ::= SEQUENCE { + pDUSessionID PDUSessionID, + pathSwitchRequestTransfer OCTET STRING (CONTAINING PathSwitchRequestTransfer), + iE-Extensions ProtocolExtensionContainer { { PDUSessionResourceToBeSwitchedDLItem-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceToBeSwitchedDLItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceToReleaseListHOCmd ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceToReleaseItemHOCmd + +PDUSessionResourceToReleaseItemHOCmd ::= SEQUENCE { + pDUSessionID PDUSessionID, + handoverPreparationUnsuccessfulTransfer OCTET STRING (CONTAINING HandoverPreparationUnsuccessfulTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceToReleaseItemHOCmd-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceToReleaseItemHOCmd-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionResourceToReleaseListRelCmd ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF PDUSessionResourceToReleaseItemRelCmd + +PDUSessionResourceToReleaseItemRelCmd ::= SEQUENCE { + pDUSessionID PDUSessionID, + pDUSessionResourceReleaseCommandTransfer OCTET STRING (CONTAINING PDUSessionResourceReleaseCommandTransfer), + iE-Extensions ProtocolExtensionContainer { {PDUSessionResourceToReleaseItemRelCmd-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionResourceToReleaseItemRelCmd-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSessionType ::= ENUMERATED { + ipv4, + ipv6, + ipv4v6, + ethernet, + unstructured, + ... +} + +PDUSessionUsageReport ::= SEQUENCE { + rATType ENUMERATED {nr, eutra, ..., nr-unlicensed, e-utra-unlicensed}, + pDUSessionTimedReportList VolumeTimedReportList, + iE-Extensions ProtocolExtensionContainer { {PDUSessionUsageReport-ExtIEs} } OPTIONAL, + ... +} + +PDUSessionUsageReport-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUsetQoSParameters ::= SEQUENCE { + ulPDUSetQoSInformation PDUsetQoSInformation OPTIONAL, + dlPDUSetQoSInformation PDUsetQoSInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PDUsetQoSParameters-ExtIEs } } OPTIONAL, + ... +} + +PDUsetQoSParameters-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUsetQoSInformation ::= SEQUENCE { + pduSetDelayBudget ExtendedPacketDelayBudget OPTIONAL, + pduSetErrorRate PacketErrorRate OPTIONAL, + pduSetIntegratedHandlingInformation ENUMERATED {true, false, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PDUsetQoSInformation-ExtIEs } } OPTIONAL, + ... +} + +PDUsetQoSInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PDUSetbasedHandlingIndicator ::= ENUMERATED {supported, ...} + +PEIPSassistanceInformation ::= SEQUENCE { + cNsubgroupID CNsubgroupID, + iE-Extensions ProtocolExtensionContainer { {PEIPSassistanceInformation-ExtIEs} } OPTIONAL, + ... +} + +PEIPSassistanceInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Periodicity ::= INTEGER (0..640000, ...) + +PeriodicityBound ::= SEQUENCE { + periodicityLowerBound Periodicity, + periodicityUpperBound Periodicity, + iE-Extensions ProtocolExtensionContainer { {PeriodicityBound-ExtIEs} } OPTIONAL, + ... +} + +PeriodicityBound-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PeriodicityList ::= SEQUENCE { + allowedPeriodicityList AllowedPeriodicityList, + iE-Extensions ProtocolExtensionContainer { {PeriodicityList-ExtIEs} } OPTIONAL, + ... +} + +PeriodicityList-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +AllowedPeriodicityList ::= SEQUENCE (SIZE(1..maxnoofPeriodicities)) OF Periodicity + +PeriodicityRange ::= CHOICE { + periodicityBound PeriodicityBound, + periodicityList AllowedPeriodicityList, + choice-extensions ProtocolIE-SingleContainer { {PeriodicityRange-ExtIEs} } +} + +PeriodicityRange-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +PeriodicRegistrationUpdateTimer ::= BIT STRING (SIZE(8)) + +PLMNIdentity ::= OCTET STRING (SIZE(3)) + +PLMNAreaBasedQMC ::= SEQUENCE { + plmnListforQMC PLMNListforQMC, + iE-Extensions ProtocolExtensionContainer { {PLMNAreaBasedQMC-ExtIEs} } OPTIONAL, + ... +} + +PLMNAreaBasedQMC-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PLMNListforQMC ::= SEQUENCE (SIZE(1..maxnoofPLMNforQMC)) OF PLMNIdentity + +PLMNSupportList ::= SEQUENCE (SIZE(1..maxnoofPLMNs)) OF PLMNSupportItem + +PLMNSupportItem ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + sliceSupportList SliceSupportList, + iE-Extensions ProtocolExtensionContainer { {PLMNSupportItem-ExtIEs} } OPTIONAL, + ... +} + +PLMNSupportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-NPN-Support CRITICALITY reject EXTENSION NPN-Support PRESENCE optional }| + { ID id-ExtendedSliceSupportList CRITICALITY reject EXTENSION ExtendedSliceSupportList PRESENCE optional }| + { ID id-OnboardingSupport CRITICALITY ignore EXTENSION OnboardingSupport PRESENCE optional }, + ... +} + +PNI-NPN-MobilityInformation ::= SEQUENCE { + allowed-PNI-NPI-List Allowed-PNI-NPN-List, + iE-Extensions ProtocolExtensionContainer { {PNI-NPN-MobilityInformation-ExtIEs} } OPTIONAL, + ... +} + +PNI-NPN-MobilityInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PortNumber ::= OCTET STRING (SIZE(2)) + +Pre-emptionCapability ::= ENUMERATED { + shall-not-trigger-pre-emption, + may-trigger-pre-emption, + ... +} + +Pre-emptionVulnerability ::= ENUMERATED { + not-pre-emptable, + pre-emptable, + ... +} + +PriorityLevelARP ::= INTEGER (1..15) + +PriorityLevelQos ::= INTEGER (1..127, ...) + +PWSFailedCellIDList ::= CHOICE { + eUTRA-CGI-PWSFailedList EUTRA-CGIList, + nR-CGI-PWSFailedList NR-CGIList, + choice-Extensions ProtocolIE-SingleContainer { {PWSFailedCellIDList-ExtIEs} } +} + +PWSFailedCellIDList-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +PNI-NPN-AreaScopeofMDT ::= SEQUENCE { + cAGListforMDT CAGListforMDT, + iE-Extensions ProtocolExtensionContainer { {PNI-NPN-AreaScopeofMDT-ExtIEs} } OPTIONAL, + ... +} + +PNI-NPN-AreaScopeofMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +PNI-NPNBasedMDT::= SEQUENCE { + cAGListforMDT CAGListforMDT, + iE-Extensions ProtocolExtensionContainer { {PNI-NPNBasedMDT-ExtIEs} } OPTIONAL, + ... +} + +PNI-NPNBasedMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- Q + +QMCConfigInfo ::= SEQUENCE { + uEAppLayerMeasInfoList UEAppLayerMeasInfoList, + iE-Extensions ProtocolExtensionContainer { { QMCConfigInfo-ExtIEs} } OPTIONAL, + ... +} + +QMCConfigInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QMCDeactivation ::= SEQUENCE { + qoEReferenceList QoEReferenceList, + iE-Extensions ProtocolExtensionContainer { { QMCDeactivation-ExtIEs} } OPTIONAL, + ... +} + +QMCDeactivation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QoEReferenceList ::= SEQUENCE (SIZE(1..maxnoofUEAppLayerMeas)) OF QoEReference + +QoEReference ::= OCTET STRING (SIZE(6)) + +QoERVQoEReportingPaths ::= SEQUENCE { + qoEReportingPath ENUMERATED{srb4, srb5, ...} OPTIONAL, + rVQoEReportingPath ENUMERATED{srb4, srb5, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QoERVQoEReportingPaths-ExtIEs} } OPTIONAL, + ... +} + +QoERVQoEReportingPaths-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +QosCharacteristics ::= CHOICE { + nonDynamic5QI NonDynamic5QIDescriptor, + dynamic5QI Dynamic5QIDescriptor, + choice-Extensions ProtocolIE-SingleContainer { {QosCharacteristics-ExtIEs} } +} + +QosCharacteristics-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +QosFlowAcceptedList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowAcceptedItem + +QosFlowAcceptedItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + iE-Extensions ProtocolExtensionContainer { {QosFlowAcceptedItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowAcceptedItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CurrentQoSParaSetIndex CRITICALITY ignore EXTENSION AlternativeQoSParaSetIndex PRESENCE optional }, + ... +} + +QosFlowAdditionalInfoListRelCom ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowAdditionalInfoItemRelCom + +QosFlowAdditionalInfoItemRelCom ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + downlinkTLContainer TLContainer OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowAdditionalInfoItemRelCom-ExtIEs} } OPTIONAL, + ... +} + +QosFlowAdditionalInfoItemRelCom-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QosFlowAdditionalInfoListRelRes ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowAdditionalInfoItemRelRes + +QosFlowAdditionalInfoItemRelRes ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + uplinkTLContainer TLContainer OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowAdditionalInfoItemRelRes-ExtIEs} } OPTIONAL, + ... +} + +QosFlowAdditionalInfoItemRelRes-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +QosFlowAddOrModifyRequestList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowAddOrModifyRequestItem + +QosFlowAddOrModifyRequestItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + qosFlowLevelQosParameters QosFlowLevelQosParameters OPTIONAL, + e-RAB-ID E-RAB-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowAddOrModifyRequestItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowAddOrModifyRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-TSCTrafficCharacteristics CRITICALITY ignore EXTENSION TSCTrafficCharacteristics PRESENCE optional }| + {ID id-RedundantQosFlowIndicator CRITICALITY ignore EXTENSION RedundantQosFlowIndicator PRESENCE optional }| + {ID id-UL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + {ID id-DownlinkTLContainer CRITICALITY ignore EXTENSION TLContainer PRESENCE optional }| + {ID id-ECNMarkingorCongestionInformationReportingRequest CRITICALITY ignore EXTENSION ECNMarkingorCongestionInformationReportingRequest PRESENCE optional }, + ... +} + +QosFlowAddOrModifyResponseList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowAddOrModifyResponseItem + +QosFlowAddOrModifyResponseItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + iE-Extensions ProtocolExtensionContainer { {QosFlowAddOrModifyResponseItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowAddOrModifyResponseItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CurrentQoSParaSetIndex CRITICALITY ignore EXTENSION AlternativeQoSParaSetIndex PRESENCE optional }| + { ID id-TSCTrafficCharacteristicsFeedback CRITICALITY ignore EXTENSION TSCTrafficCharacteristicsFeedback PRESENCE optional }| + { ID id-UplinkTLContainer CRITICALITY ignore EXTENSION TLContainer PRESENCE optional }| + { ID id-DL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-ANPacketDelayBudgetUL CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }, + ... +} + +QosFlowFeedbackList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowFeedbackItem + +QosFlowFeedbackItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + updateFeedback UpdateFeedback OPTIONAL, + cNpacketDelayBudgetDL ExtendedPacketDelayBudget OPTIONAL, + cNpacketDelayBudgetUL ExtendedPacketDelayBudget OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowFeedbackItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowFeedbackItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QosFlowIdentifier ::= INTEGER (0..63, ...) + +QosFlowInformationList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowInformationItem + +QosFlowInformationItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + dLForwarding DLForwarding OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowInformationItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowInformationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-ULForwarding CRITICALITY ignore EXTENSION ULForwarding PRESENCE optional}| + {ID id-SourceTNLAddrInfo CRITICALITY ignore EXTENSION TransportLayerAddress PRESENCE optional}| + {ID id-SourceNodeTNLAddrInfo CRITICALITY ignore EXTENSION TransportLayerAddress PRESENCE optional}, + ... +} + +QosFlowLevelQosParameters ::= SEQUENCE { + qosCharacteristics QosCharacteristics, + allocationAndRetentionPriority AllocationAndRetentionPriority, + gBR-QosInformation GBR-QosInformation OPTIONAL, + reflectiveQosAttribute ReflectiveQosAttribute OPTIONAL, + additionalQosFlowInformation AdditionalQosFlowInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowLevelQosParameters-ExtIEs} } OPTIONAL, + ... +} + +QosFlowLevelQosParameters-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-QosMonitoringRequest CRITICALITY ignore EXTENSION QosMonitoringRequest PRESENCE optional}| + {ID id-QosMonitoringReportingFrequency CRITICALITY ignore EXTENSION QosMonitoringReportingFrequency PRESENCE optional}| + {ID id-PDUsetQoSParameters CRITICALITY ignore EXTENSION PDUsetQoSParameters PRESENCE optional}| + {ID id-DLPDUSetInformationMarkingSupportIndication CRITICALITY ignore EXTENSION DLPDUSetInformationMarkingSupportIndication PRESENCE optional}| + { ID id-MMSID CRITICALITY ignore EXTENSION MMSID PRESENCE optional}| + { ID id-Indication-of-Bitrate-Adaptation CRITICALITY ignore EXTENSION Indication-of-Bitrate-Adaptation PRESENCE optional}, + ... +} + + +QosMonitoringRequest ::= ENUMERATED {ul, dl, both, ..., stop} + +QosMonitoringReportingFrequency ::= INTEGER (1..1800, ...) + +QoSFlowList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowIdentifier + +QosFlowListWithCause ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowWithCauseItem + +QosFlowWithCauseItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + cause Cause, + iE-Extensions ProtocolExtensionContainer { {QosFlowWithCauseItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowWithCauseItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QosFlowModifyConfirmList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowModifyConfirmItem + +QosFlowModifyConfirmItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + iE-Extensions ProtocolExtensionContainer { {QosFlowModifyConfirmItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowModifyConfirmItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QosFlowNotifyList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowNotifyItem + +QosFlowNotifyItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + notificationCause NotificationCause, + iE-Extensions ProtocolExtensionContainer { {QosFlowNotifyItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowNotifyItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CurrentQoSParaSetIndex CRITICALITY ignore EXTENSION AlternativeQoSParaSetNotifyIndex PRESENCE optional }| + { ID id-TSCTrafficCharacteristicsFeedback CRITICALITY ignore EXTENSION TSCTrafficCharacteristicsFeedback PRESENCE optional }, + ... +} +QosFlowParametersList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowParametersItem + +QosFlowParametersItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + alternativeQoSParaSetList AlternativeQoSParaSetList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowParametersItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowParametersItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CNPacketDelayBudgetDL CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }| + { ID id-CNPacketDelayBudgetUL CRITICALITY ignore EXTENSION ExtendedPacketDelayBudget PRESENCE optional }| + { ID id-BurstArrivalTimeDownlink CRITICALITY ignore EXTENSION BurstArrivalTime PRESENCE optional }, + ... +} + +QosFlowPerTNLInformation ::= SEQUENCE { + uPTransportLayerInformation UPTransportLayerInformation, + associatedQosFlowList AssociatedQosFlowList, + iE-Extensions ProtocolExtensionContainer { { QosFlowPerTNLInformation-ExtIEs} } OPTIONAL, + ... +} + +QosFlowPerTNLInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QosFlowPerTNLInformationList ::= SEQUENCE (SIZE(1..maxnoofMultiConnectivityMinusOne)) OF QosFlowPerTNLInformationItem + +QosFlowPerTNLInformationItem ::= SEQUENCE { + qosFlowPerTNLInformation QosFlowPerTNLInformation, + iE-Extensions ProtocolExtensionContainer { { QosFlowPerTNLInformationItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowPerTNLInformationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QosFlowSetupRequestList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowSetupRequestItem + +QosFlowSetupRequestItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + qosFlowLevelQosParameters QosFlowLevelQosParameters, + e-RAB-ID E-RAB-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowSetupRequestItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowSetupRequestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-TSCTrafficCharacteristics CRITICALITY ignore EXTENSION TSCTrafficCharacteristics PRESENCE optional }| + {ID id-RedundantQosFlowIndicator CRITICALITY ignore EXTENSION RedundantQosFlowIndicator PRESENCE optional }| + {ID id-ECNMarkingorCongestionInformationReportingRequest CRITICALITY ignore EXTENSION ECNMarkingorCongestionInformationReportingRequest PRESENCE optional }, + ... +} + +QosFlowListWithDataForwarding ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowItemWithDataForwarding + +QosFlowItemWithDataForwarding ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + dataForwardingAccepted DataForwardingAccepted OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QosFlowItemWithDataForwarding-ExtIEs} } OPTIONAL, + ... +} + +QosFlowItemWithDataForwarding-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CurrentQoSParaSetIndex CRITICALITY ignore EXTENSION AlternativeQoSParaSetIndex PRESENCE optional }, + ... +} + +QosFlowToBeForwardedList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QosFlowToBeForwardedItem + +QosFlowToBeForwardedItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + iE-Extensions ProtocolExtensionContainer { {QosFlowToBeForwardedItem-ExtIEs} } OPTIONAL, + ... +} + +QosFlowToBeForwardedItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QoSFlowTSCList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QoSFlowTSCItem + +QoSFlowTSCItem ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + tSCTrafficCharacteristicsFeedback TSCTrafficCharacteristicsFeedback OPTIONAL, + aNPacketDelayBudgetUL ExtendedPacketDelayBudget OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {QoSFlowTSCItem-ExtIEs} } OPTIONAL, + ... +} + +QoSFlowTSCItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +QoSFlowsUsageReportList ::= SEQUENCE (SIZE(1..maxnoofQosFlows)) OF QoSFlowsUsageReport-Item + +QoSFlowsUsageReport-Item ::= SEQUENCE { + qosFlowIdentifier QosFlowIdentifier, + rATType ENUMERATED {nr, eutra, ..., nr-unlicensed, e-utra-unlicensed}, + qoSFlowsTimedReportList VolumeTimedReportList, + iE-Extensions ProtocolExtensionContainer { {QoSFlowsUsageReport-Item-ExtIEs} } OPTIONAL, + ... +} + +QoSFlowsUsageReport-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- R + +RANfeedbacktype ::= CHOICE { + proactive RANfeedbacktype-proactive, + reactive RANfeedbacktype-reactive, + choice-extensions ProtocolIE-SingleContainer { {RANfeedbacktype-ExtIEs} } +} + +RANfeedbacktype-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +RANfeedbacktype-proactive ::= SEQUENCE { + burstArrivalTimeWindow BurstArrivalTimeWindow, + periodicityRange PeriodicityRange OPTIONAL, + iE-Extension ProtocolExtensionContainer { {RANfeedbacktype-proactive-ExtIEs} } OPTIONAL, + ... +} + +RANfeedbacktype-proactive-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RANfeedbacktype-reactive ::= SEQUENCE { + capabilityForBATAdaptation ENUMERATED {true, ...}, + iE-Extension ProtocolExtensionContainer { {RANfeedbacktype-reactive-ExtIEs} } OPTIONAL, + ... +} + +RANfeedbacktype-reactive-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Range ::= ENUMERATED {m50, m80, m180, m200, m350, m400, m500, m700, m1000, ...} + +RANNodeName ::= PrintableString (SIZE(1..150, ...)) + +RANNodeNameVisibleString ::= VisibleString (SIZE(1..150, ...)) + +RANNodeNameUTF8String ::= UTF8String (SIZE(1..150, ...)) + +RANPagingPriority ::= INTEGER (1..256) + +RANStatusTransfer-TransparentContainer ::= SEQUENCE { + dRBsSubjectToStatusTransferList DRBsSubjectToStatusTransferList, + iE-Extensions ProtocolExtensionContainer { {RANStatusTransfer-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} + +RANStatusTransfer-TransparentContainer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RANTimingSynchronisationStatusInfo ::= SEQUENCE { + synchronisationState ENUMERATED {locked, holdover, freerun, ...} OPTIONAL, + traceabletoUTC ENUMERATED {true, false, ...} OPTIONAL, + traceabletoGNSS ENUMERATED {true, false, ...} OPTIONAL, + clockFrequencyStability BIT STRING (SIZE(16)) OPTIONAL, + clockAccuracy ClockAccuracy OPTIONAL, + parentTImeSource ParentTImeSource OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {RANTimingSynchronisationStatusInfo-ExtIEs} } OPTIONAL, + ... +} + +RANTimingSynchronisationStatusInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RAN-TSSRequestType ::= ENUMERATED {start, stop, ...} + + +RAN-TSSScope ::= CHOICE { + rANNodeLevel GlobalGNB-ID, + cellListLevel RANTSSCellList, + choice-Extensions ProtocolIE-SingleContainer { { RAN-TSSScope-ExtIEs} } +} + +RAN-TSSScope-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +RANTSSCellList ::= SEQUENCE (SIZE(1..maxnoofCellsTSS)) OF RANTSSCellItem + +RANTSSCellItem ::= SEQUENCE { + nRCGI NR-CGI, + iE-Extensions ProtocolExtensionContainer { {RANTSSCellItem-ExtIEs} } OPTIONAL, + ... +} + +RANTSSCellItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RAN-UE-NGAP-ID ::= INTEGER (0..4294967295) + +RAT-Information ::= ENUMERATED { + unlicensed, + nb-IoT, + ..., + nR-LEO, + nR-MEO, + nR-GEO, + nR-OTHERSAT +} + +RATRestrictions ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF RATRestrictions-Item + +RATRestrictions-Item ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + rATRestrictionInformation RATRestrictionInformation, + iE-Extensions ProtocolExtensionContainer { {RATRestrictions-Item-ExtIEs} } OPTIONAL, + ... +} + +RATRestrictions-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-ExtendedRATRestrictionInformation CRITICALITY ignore EXTENSION ExtendedRATRestrictionInformation PRESENCE optional }, + ... +} + +RATRestrictionInformation ::= BIT STRING (SIZE(8, ...)) + +RecommendedCellsForPaging ::= SEQUENCE { + recommendedCellList RecommendedCellList, + iE-Extensions ProtocolExtensionContainer { {RecommendedCellsForPaging-ExtIEs} } OPTIONAL, + ... +} + +RecommendedCellsForPaging-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RecommendedCellList ::= SEQUENCE (SIZE(1..maxnoofRecommendedCells)) OF RecommendedCellItem + +RecommendedCellItem ::= SEQUENCE { + nGRAN-CGI NGRAN-CGI, + timeStayedInCell INTEGER (0..4095) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {RecommendedCellItem-ExtIEs} } OPTIONAL, + ... +} + +RecommendedCellItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RecommendedRANNodesForPaging ::= SEQUENCE { + recommendedRANNodeList RecommendedRANNodeList, + iE-Extensions ProtocolExtensionContainer { {RecommendedRANNodesForPaging-ExtIEs} } OPTIONAL, + ... +} + +RecommendedRANNodesForPaging-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RecommendedRANNodeList::= SEQUENCE (SIZE(1..maxnoofRecommendedRANNodes)) OF RecommendedRANNodeItem + +RecommendedRANNodeItem ::= SEQUENCE { + aMFPagingTarget AMFPagingTarget, + iE-Extensions ProtocolExtensionContainer { {RecommendedRANNodeItem-ExtIEs} } OPTIONAL, + ... +} + +RecommendedRANNodeItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RedCapIndication ::= ENUMERATED { + redcap, + ... +} + +RedirectionVoiceFallback ::= ENUMERATED { + possible, + not-possible, + ... +} + +RedundantPDUSessionInformation ::= SEQUENCE { + rSN RSN, + iE-Extensions ProtocolExtensionContainer { {RedundantPDUSessionInformation-ExtIEs} } OPTIONAL, + ... +} + +RedundantPDUSessionInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PDUSessionPairID CRITICALITY ignore EXTENSION PDUSessionPairID PRESENCE optional }, + ... +} + +RedundantQosFlowIndicator ::= ENUMERATED {true, false} + +ReflectiveQosAttribute ::= ENUMERATED { + subject-to, + ... +} + +RelativeAMFCapacity ::= INTEGER (0..255) + +ReportArea ::= ENUMERATED { + cell, + ... +} + +ReportingThreshold ::= INTEGER (0.. 4000000000, ...) + +RepetitionPeriod ::= INTEGER (0..131071) + +ResetAll ::= ENUMERATED { + reset-all, + ... +} + +ReportAmountMDT ::= ENUMERATED { + r1, r2, r4, r8, r16, r32, r64, rinfinity +} + +ReportIntervalMDT ::= ENUMERATED { + ms120, ms240, ms480, ms640, ms1024, ms2048, ms5120, ms10240, min1, min6, min12, min30, min60 +} + +ExtendedReportIntervalMDT ::= ENUMERATED { + ms20480, ms40960, ... +} + +RequestedNSSAI ::= SEQUENCE (SIZE(1..maxnoofRequestedSNSSAIs)) OF RequestedNSSAIItem + +RequestedNSSAIItem ::= SEQUENCE { + s-NSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { {RequestedNSSAIItem-ExtIEs} } OPTIONAL, + ... +} + +RequestedNSSAIItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ResetType ::= CHOICE { + nG-Interface ResetAll, + partOfNG-Interface UE-associatedLogicalNG-connectionList, + choice-Extensions ProtocolIE-SingleContainer { {ResetType-ExtIEs} } +} + +ResetType-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +RGLevelWirelineAccessCharacteristics ::= OCTET STRING + +RNC-ID ::= INTEGER (0..4095) + +RoutingID ::= OCTET STRING + +RRCContainer ::= OCTET STRING + +RRCEstablishmentCause ::= ENUMERATED { + emergency, + highPriorityAccess, + mt-Access, + mo-Signalling, + mo-Data, + mo-VoiceCall, + mo-VideoCall, + mo-SMS, + mps-PriorityAccess, + mcs-PriorityAccess, + ..., + notAvailable, + mo-ExceptionData +} + +RRCInactiveTransitionReportRequest ::= ENUMERATED { + subsequent-state-transition-report, + single-rrc-connected-state-report, + cancel-report, + ... +} + +RRCState ::= ENUMERATED { + inactive, + connected, + ... +} + +RSN ::= ENUMERATED {v1, v2, ...} + +RIMInformationTransfer ::= SEQUENCE { + targetRANNodeID-RIM TargetRANNodeID-RIM, + sourceRANNodeID SourceRANNodeID, + rIMInformation RIMInformation, + iE-Extensions ProtocolExtensionContainer { {RIMInformationTransfer-ExtIEs} } OPTIONAL, + ... +} + +RIMInformationTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +RIMInformation ::= SEQUENCE { + targetgNBSetID GNBSetID, + rIM-RSDetection ENUMERATED {rs-detected, rs-disappeared, ...}, + iE-Extensions ProtocolExtensionContainer { {RIMInformation-ExtIEs} } OPTIONAL, + ... +} + +RIMInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +GNBSetID ::= BIT STRING (SIZE(22)) + +RSPPQoSFlowList ::= SEQUENCE (SIZE(1..maxnoofRSPPQoSFlows)) OF RSPPQoSFlowItem + +RSPPQoSFlowItem ::= SEQUENCE { + pQI FiveQI, + rSPPFlowBitRates RSPPFlowBitRates OPTIONAL, + range Range OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { RSPPQoSFlowItem-ExtIEs} } OPTIONAL, + ... +} + +RSPPQoSFlowItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RSPPFlowBitRates ::= SEQUENCE { + guaranteedFlowBitRate BitRate, + maximumFlowBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { { RSPPFlowBitRates-ExtIEs} } OPTIONAL, + ... +} + +RSPPFlowBitRates-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +RequestedTNLInfo ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + iE-Extensions ProtocolExtensionContainer { { RequestedTNLInfo-ExtIEs} } OPTIONAL, + ... +} + +RequestedTNLInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + + +-- S + +ScheduledCommunicationTime ::= SEQUENCE { + dayofWeek BIT STRING (SIZE(7)) OPTIONAL, + timeofDayStart INTEGER (0..86399, ...) OPTIONAL, + timeofDayEnd INTEGER (0..86399, ...) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ScheduledCommunicationTime-ExtIEs}} OPTIONAL, + ... +} + +ScheduledCommunicationTime-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SCTP-TLAs ::= SEQUENCE (SIZE(1..maxnoofXnTLAs)) OF TransportLayerAddress + +SD ::= OCTET STRING (SIZE(3)) + +SecondaryRATUsageInformation ::= SEQUENCE { + pDUSessionUsageReport PDUSessionUsageReport OPTIONAL, + qosFlowsUsageReportList QoSFlowsUsageReportList OPTIONAL, + iE-Extension ProtocolExtensionContainer { {SecondaryRATUsageInformation-ExtIEs} } OPTIONAL, + ... +} + +SecondaryRATUsageInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SecondaryRATDataUsageReportTransfer ::= SEQUENCE { + secondaryRATUsageInformation SecondaryRATUsageInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SecondaryRATDataUsageReportTransfer-ExtIEs} } OPTIONAL, + ... +} + +SecondaryRATDataUsageReportTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SecurityContext ::= SEQUENCE { + nextHopChainingCount NextHopChainingCount, + nextHopNH SecurityKey, + iE-Extensions ProtocolExtensionContainer { {SecurityContext-ExtIEs} } OPTIONAL, + ... +} + +SecurityContext-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SecurityIndication ::= SEQUENCE { + integrityProtectionIndication IntegrityProtectionIndication, + confidentialityProtectionIndication ConfidentialityProtectionIndication, + maximumIntegrityProtectedDataRate-UL MaximumIntegrityProtectedDataRate OPTIONAL, +-- The above IE shall be present if the Integrity Protection Indication IE is set to the value “required” or “preferred” + iE-Extensions ProtocolExtensionContainer { {SecurityIndication-ExtIEs} } OPTIONAL, + ... +} + +SecurityIndication-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-MaximumIntegrityProtectedDataRate-DL CRITICALITY ignore EXTENSION MaximumIntegrityProtectedDataRate PRESENCE optional }, + ... +} + +SecurityKey ::= BIT STRING (SIZE(256)) + +SecurityResult ::= SEQUENCE { + integrityProtectionResult IntegrityProtectionResult, + confidentialityProtectionResult ConfidentialityProtectionResult, + iE-Extensions ProtocolExtensionContainer { {SecurityResult-ExtIEs} } OPTIONAL, + ... +} + +SecurityResult-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SensorMeasurementConfiguration ::= SEQUENCE { + sensorMeasConfig SensorMeasConfig, + sensorMeasConfigNameList SensorMeasConfigNameList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SensorMeasurementConfiguration-ExtIEs} } OPTIONAL, + ... +} + +SensorMeasurementConfiguration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SensorMeasConfigNameList ::= SEQUENCE (SIZE(1..maxnoofSensorName)) OF SensorMeasConfigNameItem + +SensorMeasConfigNameItem ::= SEQUENCE { + sensorNameConfig SensorNameConfig, + iE-Extensions ProtocolExtensionContainer { { SensorMeasConfigNameItem-ExtIEs } } OPTIONAL, + ... +} + +SensorMeasConfigNameItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SensorMeasConfig::= ENUMERATED {setup,...} + +SensorNameConfig ::= CHOICE { + uncompensatedBarometricConfig ENUMERATED {true, ...}, + ueSpeedConfig ENUMERATED {true, ...}, + ueOrientationConfig ENUMERATED {true, ...}, + choice-Extensions ProtocolIE-SingleContainer { {SensorNameConfig-ExtIEs} } +} + +SensorNameConfig-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +SerialNumber ::= BIT STRING (SIZE(16)) + +ServedGUAMIList ::= SEQUENCE (SIZE(1..maxnoofServedGUAMIs)) OF ServedGUAMIItem + +ServedGUAMIItem ::= SEQUENCE { + gUAMI GUAMI, + backupAMFName AMFName OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {ServedGUAMIItem-ExtIEs} } OPTIONAL, + ... +} + +ServedGUAMIItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-GUAMIType CRITICALITY ignore EXTENSION GUAMIType PRESENCE optional }| + {ID id-ExtendedBackupAMFName CRITICALITY ignore EXTENSION Extended-AMFName PRESENCE optional}, + ... +} + +ServiceAreaInformation ::= SEQUENCE (SIZE(1.. maxnoofEPLMNsPlusOne)) OF ServiceAreaInformation-Item + +ServiceAreaInformation-Item ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + allowedTACs AllowedTACs OPTIONAL, + notAllowedTACs NotAllowedTACs OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {ServiceAreaInformation-Item-ExtIEs} } OPTIONAL, + ... +} + +ServiceAreaInformation-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +ServiceType ::= ENUMERATED {streaming, mTSI, vR, ...} + +SgNB-UE-X2AP-ID ::= INTEGER (0..4294967295) + +SharedNGU-MulticastTNLInformation ::= SEQUENCE { + iP-MulticastAddress TransportLayerAddress, + iP-SourceAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { {SharedNGU-MulticastTNLInformation-ExtIEs} } OPTIONAL, + ... +} + +SharedNGU-MulticastTNLInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SliceOverloadList ::= SEQUENCE (SIZE(1..maxnoofSliceItems)) OF SliceOverloadItem + +SliceOverloadItem ::= SEQUENCE { + s-NSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { {SliceOverloadItem-ExtIEs} } OPTIONAL, + ... +} + +SliceOverloadItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SliceSupportList ::= SEQUENCE (SIZE(1..maxnoofSliceItems)) OF SliceSupportItem + +SliceSupportItem ::= SEQUENCE { + s-NSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { {SliceSupportItem-ExtIEs} } OPTIONAL, + ... +} + +SliceSupportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SliceSupportListQMC ::= SEQUENCE (SIZE(1..maxnoofSNSSAIforQMC)) OF SliceSupportQMC-Item + +SliceSupportQMC-Item ::= SEQUENCE { + s-NSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { {SliceSupportQMC-Item-ExtIEs} } OPTIONAL, + ... +} + +SliceSupportQMC-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SNPN-MobilityInformation ::= SEQUENCE { + serving-NID NID, + iE-Extensions ProtocolExtensionContainer { {SNPN-MobilityInformation-ExtIEs} } OPTIONAL, + ... +} + +SNPN-MobilityInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-EquivalentSNPNsList CRITICALITY reject EXTENSION EquivalentSNPNsList PRESENCE optional}, + ... +} + +S-NSSAI ::= SEQUENCE { + sST SST, + sD SD OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { S-NSSAI-ExtIEs} } OPTIONAL, + ... +} + +S-NSSAI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SONConfigurationTransfer ::= SEQUENCE { + targetRANNodeID-SON TargetRANNodeID-SON, + sourceRANNodeID SourceRANNodeID, + sONInformation SONInformation, + xnTNLConfigurationInfo XnTNLConfigurationInfo OPTIONAL, +-- The above IE shall be present if the SON Information IE contains the SON Information Request IE set to the value “Xn TNL Configuration Info” + iE-Extensions ProtocolExtensionContainer { {SONConfigurationTransfer-ExtIEs} } OPTIONAL, + ... +} + +SONConfigurationTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-RequestedTNLInfo CRITICALITY ignore EXTENSION RequestedTNLInfo PRESENCE optional}, + ... +} + +SONInformation ::= CHOICE { + sONInformationRequest SONInformationRequest, + sONInformationReply SONInformationReply, + choice-Extensions ProtocolIE-SingleContainer { {SONInformation-ExtIEs} } +} + +SONInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-SONInformationReport CRITICALITY ignore TYPE SONInformationReport PRESENCE mandatory }, + ... +} + +SONInformationReply ::= SEQUENCE { + xnTNLConfigurationInfo XnTNLConfigurationInfo OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SONInformationReply-ExtIEs} } OPTIONAL, + ... +} + +SONInformationReply-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SONInformationReport::= CHOICE { + failureIndicationInformation FailureIndication, + hOReportInformation HOReport, + choice-Extensions ProtocolIE-SingleContainer { { SONInformationReport-ExtIEs} } +} + +SONInformationReport-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-SuccessfulHandoverReportList CRITICALITY ignore TYPE SuccessfulHandoverReportList PRESENCE mandatory }| + { ID id-SuccessfulPSCellChangeReportList CRITICALITY ignore TYPE SuccessfulPSCellChangeReportList PRESENCE mandatory }, + ... +} + +SNPN-CellBasedMDT::= SEQUENCE { + sNPNcellIdListforMDT SNPNCellIdListforMDT, + iE-Extensions ProtocolExtensionContainer { {SNPN-CellBasedMDT-ExtIEs} } OPTIONAL, + ... +} + +SNPN-CellBasedMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SNPNCellIdListforMDT ::= SEQUENCE (SIZE(1..maxnoofCellIDforMDT)) OF SNPNCellIdListforMDTItem + +SNPNCellIdListforMDTItem ::= SEQUENCE { + nR-CGI NR-CGI, + nID NID, + iE-Extensions ProtocolExtensionContainer {{ SNPNCellIdListforMDTItem-ExtIEs}} OPTIONAL, + ... +} + +SNPNCellIdListforMDTItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +SNPN-TAIBasedMDT::= SEQUENCE { + sNPNTAIListforMDT SNPNTAIListforMDT, + iE-Extensions ProtocolExtensionContainer { {SNPN-TAIBasedMDT-ExtIEs} } OPTIONAL, + ... +} + +SNPN-TAIBasedMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SNPNTAIListforMDT ::= SEQUENCE (SIZE(1.. maxnoofTAforMDT)) OF SNPNTAIListforMDTItem + +SNPNTAIListforMDTItem ::= SEQUENCE { + tAI TAI, + nID NID, + iE-Extensions ProtocolExtensionContainer {{ SNPNTAIListforMDTItem-ExtIEs}} OPTIONAL, + ... +} + +SNPNTAIListforMDTItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SNPN-BasedMDT::= SEQUENCE { + sNPNListforMDT SNPNListforMDT, + iE-Extensions ProtocolExtensionContainer { {SNPN-BasedMDT-ExtIEs} } OPTIONAL, + ... +} + +SNPN-BasedMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SNPNListforMDT ::= SEQUENCE (SIZE(1.. maxnoofMDTSNPNs)) OF SNPNListforMDTItem + +SNPNListforMDTItem ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + nID NID, + iE-Extensions ProtocolExtensionContainer {{ SNPNListforMDTItem-ExtIEs}} OPTIONAL, + ... +} + +SNPNListforMDTItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- -------------------------------------------------------------------- +-- SON Information Report +-- -------------------------------------------------------------------- + +SuccessfulHandoverReportList ::= SEQUENCE (SIZE(1..maxnoofSuccessfulHOReports)) OF SuccessfulHandoverReport-Item + +SuccessfulHandoverReport-Item ::= SEQUENCE { + successfulHOReportContainer OCTET STRING, + iE-Extensions ProtocolExtensionContainer { { SuccessfulHandoverReport-Item-ExtIEs} } OPTIONAL, + ... +} + +SuccessfulHandoverReport-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SuccessfulPSCellChangeReportList ::= SEQUENCE (SIZE(1..maxnoofSuccessfulPSCellChangeReports)) OF SuccessfulPSCellChangeReport-Item + +SuccessfulPSCellChangeReport-Item ::= SEQUENCE { + successfulPSCellChangeReportContainer OCTET STRING, + iE-Extensions ProtocolExtensionContainer { { SuccessfulPSCellChangeReport-Item-ExtIEs} } OPTIONAL, + ... +} + +SuccessfulPSCellChangeReport-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SONInformationRequest ::= ENUMERATED { + xn-TNL-configuration-info, + ... +} + +SourceNGRANNode-ToTargetNGRANNode-TransparentContainer ::= SEQUENCE { + rRCContainer RRCContainer, + pDUSessionResourceInformationList PDUSessionResourceInformationList OPTIONAL, + e-RABInformationList E-RABInformationList OPTIONAL, + targetCell-ID NGRAN-CGI, + indexToRFSP IndexToRFSP OPTIONAL, + uEHistoryInformation UEHistoryInformation, + iE-Extensions ProtocolExtensionContainer { {SourceNGRANNode-ToTargetNGRANNode-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} + +SourceNGRANNode-ToTargetNGRANNode-TransparentContainer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SgNB-UE-X2AP-ID CRITICALITY ignore EXTENSION SgNB-UE-X2AP-ID PRESENCE optional }| + { ID id-UEHistoryInformationFromTheUE CRITICALITY ignore EXTENSION UEHistoryInformationFromTheUE PRESENCE optional }| + { ID id-SourceNodeID CRITICALITY ignore EXTENSION SourceNodeID PRESENCE optional }| + { ID id-UEContextReferenceAtSource CRITICALITY ignore EXTENSION RAN-UE-NGAP-ID PRESENCE optional }| + { ID id-MBS-ActiveSessionInformation-SourcetoTargetList CRITICALITY ignore EXTENSION MBS-ActiveSessionInformation-SourcetoTargetList PRESENCE optional }| + { ID id-QMCConfigInfo CRITICALITY ignore EXTENSION QMCConfigInfo PRESENCE optional }| + { ID id-NGAPIESupportInformationRequestList CRITICALITY ignore EXTENSION NGAPIESupportInformationRequestList PRESENCE optional }| + { ID id-CandidateRelayUEInformationList CRITICALITY reject EXTENSION CandidateRelayUEInformationList PRESENCE optional }| + { ID id-TimeBasedHandoverInformation CRITICALITY ignore EXTENSION TimeBasedHandoverInformation PRESENCE optional }| + { ID id-SourceSN-to-TargetSN-QMCInfo CRITICALITY ignore EXTENSION QMCConfigInfo PRESENCE optional }, + ... +} + +SourceNodeID ::= CHOICE { + sourceengNB-ID GlobalGNB-ID, + choice-Extensions ProtocolIE-SingleContainer { { SourceNodeID-ExtIEs} } +} + +SourceNodeID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +SourceOfUEActivityBehaviourInformation ::= ENUMERATED { + subscription-information, + statistics, + ... +} + +SourceRANNodeID ::= SEQUENCE { + globalRANNodeID GlobalRANNodeID, + selectedTAI TAI, + iE-Extensions ProtocolExtensionContainer { {SourceRANNodeID-ExtIEs} } OPTIONAL, + ... +} + +SourceRANNodeID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SourceToTarget-TransparentContainer ::= OCTET STRING +-- This IE includes a transparent container from the source RAN node to the target RAN node. +-- The octets of the OCTET STRING are encoded according to the specifications of the target system. + +SourceToTarget-AMFInformationReroute ::= SEQUENCE { + configuredNSSAI ConfiguredNSSAI OPTIONAL, + rejectedNSSAIinPLMN RejectedNSSAIinPLMN OPTIONAL, + rejectedNSSAIinTA RejectedNSSAIinTA OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SourceToTarget-AMFInformationReroute-ExtIEs} } OPTIONAL, + ... +} + +SourceToTarget-AMFInformationReroute-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- This IE includes information from the source Core node to the target Core node for reroute information provide by NSSF. +-- The octets of the OCTET STRING are encoded according to the specifications of the Core network. + +SRVCCOperationPossible ::= ENUMERATED { + possible, + notPossible, + ... +} + +ConfiguredNSSAI ::= OCTET STRING (SIZE(128)) + +RejectedNSSAIinPLMN ::= OCTET STRING (SIZE(32)) + +RejectedNSSAIinTA ::= OCTET STRING (SIZE(32)) + +SST ::= OCTET STRING (SIZE(1)) + +SupportedTAList ::= SEQUENCE (SIZE(1..maxnoofTACs)) OF SupportedTAItem + +SupportedTAItem ::= SEQUENCE { + tAC TAC, + broadcastPLMNList BroadcastPLMNList, + iE-Extensions ProtocolExtensionContainer { {SupportedTAItem-ExtIEs} } OPTIONAL, + ... +} + +SupportedTAItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-ConfiguredTACIndication CRITICALITY ignore EXTENSION ConfiguredTACIndication PRESENCE optional }| + {ID id-RAT-Information CRITICALITY reject EXTENSION RAT-Information PRESENCE optional }, + ... +} + +SuspendIndicator ::= ENUMERATED { + true, + ... +} + +Suspend-Request-Indication ::= ENUMERATED { + suspend-requested, + ... +} + +Suspend-Response-Indication ::= ENUMERATED { + suspend-indicated, + ... +} + +SurvivalTime ::= INTEGER (0..1920000, ...) + +SLPositioningRangingServiceInfo ::= SEQUENCE{ + sLPositioningRangingAuthorized SLPositioningRangingAuthorized, + sLPositioningRangingQoSParameters SLPositioningRangingQoSParameters OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SLPositioningRangingServiceInfo-ExtIEs} } OPTIONAL, + ... +} + +SLPositioningRangingServiceInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +SLPositioningRangingAuthorized ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +SLPositioningRangingQoSParameters ::= SEQUENCE { + rSPPQoSFlowList RSPPQoSFlowList, + rSPPLinkAggregateBitRates BitRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { SLPositioningRangingQoSParameters-ExtIEs} } OPTIONAL, + ... +} + +SLPositioningRangingQoSParameters-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +SCGActivationTime ::= INTEGER (0..40950) + +-- T + +TAC ::= OCTET STRING (SIZE(3)) + +TACListInNRNTN ::= SEQUENCE (SIZE(1..maxnoofTACsinNTN)) OF TAC + +TAI ::= SEQUENCE { + pLMNIdentity PLMNIdentity, + tAC TAC, + iE-Extensions ProtocolExtensionContainer { {TAI-ExtIEs} } OPTIONAL, + ... +} + +TAI-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIBroadcastEUTRA ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAIBroadcastEUTRA-Item + +TAIBroadcastEUTRA-Item ::= SEQUENCE { + tAI TAI, + completedCellsInTAI-EUTRA CompletedCellsInTAI-EUTRA, + iE-Extensions ProtocolExtensionContainer { {TAIBroadcastEUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +TAIBroadcastEUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIBroadcastNR ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAIBroadcastNR-Item + +TAIBroadcastNR-Item ::= SEQUENCE { + tAI TAI, + completedCellsInTAI-NR CompletedCellsInTAI-NR, + iE-Extensions ProtocolExtensionContainer { {TAIBroadcastNR-Item-ExtIEs} } OPTIONAL, + ... +} + +TAIBroadcastNR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAICancelledEUTRA ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAICancelledEUTRA-Item + +TAICancelledEUTRA-Item ::= SEQUENCE { + tAI TAI, + cancelledCellsInTAI-EUTRA CancelledCellsInTAI-EUTRA, + iE-Extensions ProtocolExtensionContainer { {TAICancelledEUTRA-Item-ExtIEs} } OPTIONAL, + ... +} + +TAICancelledEUTRA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAICancelledNR ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAICancelledNR-Item + +TAICancelledNR-Item ::= SEQUENCE { + tAI TAI, + cancelledCellsInTAI-NR CancelledCellsInTAI-NR, + iE-Extensions ProtocolExtensionContainer { {TAICancelledNR-Item-ExtIEs} } OPTIONAL, + ... +} + +TAICancelledNR-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIListForInactive ::= SEQUENCE (SIZE(1..maxnoofTAIforInactive)) OF TAIListForInactiveItem + +TAIListForInactiveItem ::= SEQUENCE { + tAI TAI, + iE-Extensions ProtocolExtensionContainer { {TAIListForInactiveItem-ExtIEs} } OPTIONAL, + ... +} + +TAIListForInactiveItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIListForPaging ::= SEQUENCE (SIZE(1..maxnoofTAIforPaging)) OF TAIListForPagingItem + +TAIListForPagingItem ::= SEQUENCE { + tAI TAI, + iE-Extensions ProtocolExtensionContainer { {TAIListForPagingItem-ExtIEs} } OPTIONAL, + ... +} + +TAIListForPagingItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIListForRestart ::= SEQUENCE (SIZE(1..maxnoofTAIforRestart)) OF TAI + +TAIListForWarning ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAI + +TAINSAGSupportList ::= SEQUENCE (SIZE(1..maxnoofNSAGs)) OF TAINSAGSupportItem + +TAINSAGSupportItem ::= SEQUENCE { + nSAG-ID NSAG-ID, + nSAGSliceSupportList ExtendedSliceSupportList, + iE-Extensions ProtocolExtensionContainer { {TAINSAGSupportItem-ExtIEs} } OPTIONAL, + ... +} + +TAINSAGSupportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIMBSSupportItem ::= SEQUENCE { + tAI TAI, + iE-Extensions ProtocolExtensionContainer { {TAIMBSSupportItem-ExtIEs} } OPTIONAL, + ... +} + +TAIMBSSupportItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +TAIMBSSupportList ::= SEQUENCE (SIZE(1..maxnoofSupportedTAIforMBS)) OF TAIMBSSupportItem + +TargeteNB-ID ::= SEQUENCE { + globalENB-ID GlobalNgENB-ID, + selected-EPS-TAI EPS-TAI, + iE-Extensions ProtocolExtensionContainer { {TargeteNB-ID-ExtIEs} } OPTIONAL, + ... +} + +TargeteNB-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetHomeENB-ID ::= SEQUENCE { + pLMNidentity PLMNIdentity, + homeENB-ID BIT STRING (SIZE(28)), + selected-EPS-TAI EPS-TAI, + iE-Extensions ProtocolExtensionContainer { {TargetHomeENB-ID-ExtIEs} } OPTIONAL, + ... +} + +TargetHomeENB-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetID ::= CHOICE { + targetRANNodeID TargetRANNodeID, + targeteNB-ID TargeteNB-ID, + choice-Extensions ProtocolIE-SingleContainer { {TargetID-ExtIEs} } +} + +TargetID-ExtIEs NGAP-PROTOCOL-IES ::= { + {ID id-TargetRNC-ID CRITICALITY reject TYPE TargetRNC-ID PRESENCE mandatory }| + {ID id-TargetHomeENB-ID CRITICALITY reject TYPE TargetHomeENB-ID PRESENCE mandatory }, + ... +} + +TargetNGRANNode-ToSourceNGRANNode-TransparentContainer ::= SEQUENCE { + rRCContainer RRCContainer, + iE-Extensions ProtocolExtensionContainer { {TargetNGRANNode-ToSourceNGRANNode-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} + +TargetNGRANNode-ToSourceNGRANNode-TransparentContainer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-DAPSResponseInfoList CRITICALITY ignore EXTENSION DAPSResponseInfoList PRESENCE optional }| + { ID id-DirectForwardingPathAvailability CRITICALITY ignore EXTENSION DirectForwardingPathAvailability PRESENCE optional }| + { ID id-MBS-ActiveSessionInformation-TargettoSourceList CRITICALITY ignore EXTENSION MBS-ActiveSessionInformation-TargettoSourceList PRESENCE optional }| + { ID id-NGAPIESupportInformationResponseList CRITICALITY ignore EXTENSION NGAPIESupportInformationResponseList PRESENCE optional }, + ... +} + +TargetNGRANNode-ToSourceNGRANNode-FailureTransparentContainer ::= SEQUENCE { + cell-CAGInformation Cell-CAGInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {TargetNGRANNode-ToSourceNGRANNode-FailureTransparentContainer-ExtIEs} } OPTIONAL, + ... +} + +TargetNGRANNode-ToSourceNGRANNode-FailureTransparentContainer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-NGAPIESupportInformationResponseList CRITICALITY ignore EXTENSION NGAPIESupportInformationResponseList PRESENCE optional }, + ... +} + +TargetNSSAI ::= SEQUENCE (SIZE(1..maxnoofTargetS-NSSAIs)) OF TargetNSSAI-Item + +TargetNSSAI-Item ::= SEQUENCE { + s-NSSAI S-NSSAI, + iE-Extensions ProtocolExtensionContainer { {TargetNSSAI-Item-ExtIEs} } OPTIONAL, + ... +} + +TargetNSSAI-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetNSSAIInformation ::= SEQUENCE { + targetNSSAI TargetNSSAI, + indexToRFSP IndexToRFSP, + iE-Extensions ProtocolExtensionContainer { {TargetNSSAIInformation-Item-ExtIEs} } OPTIONAL, + ... +} + +TargetNSSAIInformation-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetRANNodeID ::= SEQUENCE { + globalRANNodeID GlobalRANNodeID, + selectedTAI TAI, + iE-Extensions ProtocolExtensionContainer { {TargetRANNodeID-ExtIEs} } OPTIONAL, + ... +} + +TargetRANNodeID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-Selected-Target-SNPN-Identity CRITICALITY reject EXTENSION NID PRESENCE optional }, + ... +} + +TargetRANNodeID-RIM ::= SEQUENCE { + globalRANNodeID GlobalRANNodeID, + selectedTAI TAI, + iE-Extensions ProtocolExtensionContainer { {TargetRANNodeID-RIM-ExtIEs} } OPTIONAL, + ... +} + +TargetRANNodeID-RIM-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetRANNodeID-SON ::= SEQUENCE { + globalRANNodeID GlobalRANNodeID, + selectedTAI TAI, + iE-Extensions ProtocolExtensionContainer { {TargetRANNodeID-SON-ExtIEs} } OPTIONAL, + ... +} + +TargetRANNodeID-SON-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-NR-CGI CRITICALITY ignore EXTENSION NR-CGI PRESENCE optional }, + ... +} + +TargetRNC-ID ::= SEQUENCE { + lAI LAI, + rNC-ID RNC-ID, + extendedRNC-ID ExtendedRNC-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {TargetRNC-ID-ExtIEs} } OPTIONAL, + ... +} + +TargetRNC-ID-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetToSource-TransparentContainer ::= OCTET STRING +-- This IE includes a transparent container from the target RAN node to the source RAN node. +-- The octets of the OCTET STRING are encoded according to the specifications of the target system. + +TargettoSource-Failure-TransparentContainer ::= OCTET STRING +-- This IE includes a transparent container from the target RAN node to the source RAN node. +-- The octets of the OCTET STRING are encoded according to the specifications of the target system (if applicable). + +TimeBasedHandoverInformation ::= SEQUENCE { + hOWindowStart HandoverWindowStart, + hOWindowDuration HandoverWindowDuration, + iE-Extensions ProtocolExtensionContainer { {TimeBasedHandoverInformation-ExtIEs} } OPTIONAL, + ... +} + +TimeBasedHandoverInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +HandoverWindowStart ::= INTEGER (0..549755813887) + +HandoverWindowDuration ::= INTEGER (1..6000) + +TimerApproachForGUAMIRemoval ::= ENUMERATED { + apply-timer, + ... +} + +TimeSinceFailure ::= INTEGER (0..172800, ...) + +TimeStamp ::= OCTET STRING (SIZE(4)) + +TimeSyncAssistanceInfo ::= SEQUENCE { + timeDistributionIndication ENUMERATED {enabled, disabled, ...}, + uUTimeSyncErrorBudget INTEGER (1..1000000, ...) OPTIONAL, +-- The above IE shall be present if the Time Distribution Indication IE is set to the value “enabled” + iE-Extensions ProtocolExtensionContainer { {TimeSyncAssistanceInfo-ExtIEs} } OPTIONAL, + ... +} + +TimeSyncAssistanceInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-ClockQualityReportingControlInfo CRITICALITY ignore EXTENSION ClockQualityReportingControlInfo PRESENCE optional}, + ... +} + +TimeToWait ::= ENUMERATED {v1s, v2s, v5s, v10s, v20s, v60s, ...} + +TimeUEStayedInCell ::= INTEGER (0..4095) + +TimeUEStayedInCellEnhancedGranularity ::= INTEGER (0..40950) + +TMGI ::= OCTET STRING (SIZE(6)) + +TNAP-ID ::= OCTET STRING + +TNGF-ID ::= CHOICE { + tNGF-ID BIT STRING (SIZE(32, ...)), + choice-Extensions ProtocolIE-SingleContainer { {TNGF-ID-ExtIEs} } +} + +TNGF-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +TNLAddressWeightFactor ::= INTEGER (0..255) + +TNLAssociationList ::= SEQUENCE (SIZE(1..maxnoofTNLAssociations)) OF TNLAssociationItem + +TNLAssociationItem ::= SEQUENCE { + tNLAssociationAddress CPTransportLayerInformation, + cause Cause, + iE-Extensions ProtocolExtensionContainer { {TNLAssociationItem-ExtIEs} } OPTIONAL, + ... +} + +TNLAssociationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TNLAssociationUsage ::= ENUMERATED { + ue, + non-ue, + both, + ... +} + +TooearlyIntersystemHO::= SEQUENCE { + sourcecellID EUTRA-CGI, + failurecellID NGRAN-CGI, + uERLFReportContainer UERLFReportContainer OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { TooearlyIntersystemHO-ExtIEs} } OPTIONAL, + ... +} + +TooearlyIntersystemHO-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TraceActivation ::= SEQUENCE { + nGRANTraceID NGRANTraceID, + interfacesToTrace InterfacesToTrace, + traceDepth TraceDepth, + traceCollectionEntityIPAddress TransportLayerAddress, + iE-Extensions ProtocolExtensionContainer { {TraceActivation-ExtIEs} } OPTIONAL, + ... +} + +TraceActivation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-MDTConfiguration CRITICALITY ignore EXTENSION MDT-Configuration PRESENCE optional }| + { ID id-TraceCollectionEntityURI CRITICALITY ignore EXTENSION URI-address PRESENCE optional }, + ... +} + +TraceDepth ::= ENUMERATED { + minimum, + medium, + maximum, + minimumWithoutVendorSpecificExtension, + mediumWithoutVendorSpecificExtension, + maximumWithoutVendorSpecificExtension, + ... , + minimumOnlyVendorSpecificTraceRecord, + mediumOnlyVendorSpecificTraceRecord, + maximumOnlyVendorSpecificTraceRecord +} + +TrafficLoadReductionIndication ::= INTEGER (1..99) + +TransportLayerAddress ::= BIT STRING (SIZE(1..160, ...)) + +TypeOfError ::= ENUMERATED { + not-understood, + missing, + ... +} + +TAIBasedMDT ::= SEQUENCE { + tAIListforMDT TAIListforMDT, + iE-Extensions ProtocolExtensionContainer { {TAIBasedMDT-ExtIEs} } OPTIONAL, + ... +} + +TAIBasedMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIListforMDT ::= SEQUENCE (SIZE(1..maxnoofTAforMDT)) OF TAI + +TAIBasedQMC ::= SEQUENCE { + tAIListforQMC TAIListforQMC, + iE-Extensions ProtocolExtensionContainer { {TAIBasedQMC-ExtIEs} } OPTIONAL, + ... +} + +TAIBasedQMC-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIListforQMC ::= SEQUENCE (SIZE(1..maxnoofTAforQMC)) OF TAI + +TABasedQMC ::= SEQUENCE { + tAListforQMC TAListforQMC, + iE-Extensions ProtocolExtensionContainer { {TABasedQMC-ExtIEs} } OPTIONAL, + ... +} + +TABasedQMC-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAListforQMC ::= SEQUENCE (SIZE(1..maxnoofTAforQMC)) OF TAC + + +TABasedMDT ::= SEQUENCE { + tAListforMDT TAListforMDT, + iE-Extensions ProtocolExtensionContainer { {TABasedMDT-ExtIEs} } OPTIONAL, + ... +} + +TABasedMDT-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TAListforMDT ::= SEQUENCE (SIZE(1..maxnoofTAforMDT)) OF TAC + +Threshold-RSRP ::= INTEGER(0..127) + +Threshold-RSRQ ::= INTEGER(0..127) + +Threshold-SINR ::= INTEGER(0..127) + +TimeToTrigger ::= ENUMERATED {ms0, ms40, ms64, ms80, ms100, ms128, ms160, ms256, ms320, ms480, ms512, ms640, ms1024, ms1280, ms2560, ms5120} + +TLContainer ::= OCTET STRING + + +TWAP-ID ::= OCTET STRING + +TWIF-ID ::= CHOICE { + tWIF-ID BIT STRING (SIZE(32, ...)), + choice-Extensions ProtocolIE-SingleContainer { {TWIF-ID-ExtIEs} } +} + +TWIF-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +TSCAssistanceInformation ::= SEQUENCE { + periodicity Periodicity, + burstArrivalTime BurstArrivalTime OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {TSCAssistanceInformation-ExtIEs} } OPTIONAL, + ... +} + +TSCAssistanceInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SurvivalTime CRITICALITY ignore EXTENSION SurvivalTime PRESENCE optional}| + { ID id-RANfeedbacktype CRITICALITY ignore EXTENSION RANfeedbacktype PRESENCE optional}| + { ID id-N6JitterInformation CRITICALITY ignore EXTENSION N6JitterInformation PRESENCE optional}, + ... +} + +TSCTrafficCharacteristics ::= SEQUENCE { + tSCAssistanceInformationDL TSCAssistanceInformation OPTIONAL, + tSCAssistanceInformationUL TSCAssistanceInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {TSCTrafficCharacteristics-ExtIEs} } OPTIONAL, + ... +} + +TSCTrafficCharacteristics-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TSCTrafficCharacteristicsFeedback ::= SEQUENCE { + tSCFeedbackInformationDL TSCFeedbackInformation OPTIONAL, + tSCFeedbackInformationUL TSCFeedbackInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { TSCTrafficCharacteristicsFeedback-ExtIEs} } OPTIONAL, + ... +} + +TSCTrafficCharacteristicsFeedback-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +TSCFeedbackInformation ::= SEQUENCE { + burstArrivalTimeOffset INTEGER (-640000..640000, ...), + adjustedPeriodicity Periodicity OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { TSCFeedbackInformation-ExtIEs} } OPTIONAL, + ... +} + +TSCFeedbackInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- U + +UEAggregateMaximumBitRate ::= SEQUENCE { + uEAggregateMaximumBitRateDL BitRate, + uEAggregateMaximumBitRateUL BitRate, + iE-Extensions ProtocolExtensionContainer { {UEAggregateMaximumBitRate-ExtIEs} } OPTIONAL, + ... +} + +UEAggregateMaximumBitRate-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UEAppLayerMeasInfoList ::= SEQUENCE (SIZE(1..maxnoofUEAppLayerMeas)) OF UEAppLayerMeasInfoItem + +UEAppLayerMeasInfoItem ::= SEQUENCE { + uEAppLayerMeasConfigInfo UEAppLayerMeasConfigInfo, + iE-Extensions ProtocolExtensionContainer { { UEAppLayerMeasInfoItem-ExtIEs} } OPTIONAL, + ... +} + +UEAppLayerMeasInfoItem-ExtIEs NGAP-PROTOCOL-EXTENSION::= { + ... +} + +UEAppLayerMeasConfigInfo ::= SEQUENCE { + qoEReference QoEReference, + serviceType ServiceType, + areaScopeOfQMC AreaScopeOfQMC OPTIONAL, + measCollEntityIPAddress TransportLayerAddress, + qoEMeasurementStatus ENUMERATED {ongoing,...} OPTIONAL, + containerForAppLayerMeasConfig OCTET STRING (SIZE(1..8000)) OPTIONAL, + measConfigAppLayerID INTEGER (0..15, ...) OPTIONAL, + sliceSupportListQMC SliceSupportListQMC OPTIONAL, + mDT-AlignmentInfo MDT-AlignmentInfo OPTIONAL, + availableRANVisibleQoEMetrics AvailableRANVisibleQoEMetrics OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { UEAppLayerMeasConfigInfo-ExtIEs} } OPTIONAL, + ... +} + +UEAppLayerMeasConfigInfo-ExtIEs NGAP-PROTOCOL-EXTENSION::= { + { ID id-AssistanceInformationQoE-Meas CRITICALITY ignore EXTENSION AssistanceInformationQoE-Meas PRESENCE optional }| + { ID id-CommServiceType CRITICALITY ignore EXTENSION CommServiceType PRESENCE optional }| + { ID id-QoERVQoEReportingPaths CRITICALITY ignore EXTENSION QoERVQoEReportingPaths PRESENCE optional }, + ... +} + +UE-associatedLogicalNG-connectionList ::= SEQUENCE (SIZE(1..maxnoofNGConnectionsToReset)) OF UE-associatedLogicalNG-connectionItem + +UE-associatedLogicalNG-connectionItem ::= SEQUENCE { + aMF-UE-NGAP-ID AMF-UE-NGAP-ID OPTIONAL, + rAN-UE-NGAP-ID RAN-UE-NGAP-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UE-associatedLogicalNG-connectionItem-ExtIEs} } OPTIONAL, + ... +} + +UE-associatedLogicalNG-connectionItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UECapabilityInfoRequest ::= ENUMERATED { + requested, + ... +} + +UEContextRequest ::= ENUMERATED {requested, ...} + + +UEContextResumeRequestTransfer ::= SEQUENCE { + qosFlowFailedToResumeList QosFlowListWithCause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UEContextResumeRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +UEContextResumeRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UEContextResumeResponseTransfer ::= SEQUENCE { + qosFlowFailedToResumeList QosFlowListWithCause OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UEContextResumeResponseTransfer-ExtIEs} } OPTIONAL, + ... +} + +UEContextResumeResponseTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UEContextSuspendRequestTransfer ::= SEQUENCE { + suspendIndicator SuspendIndicator OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UEContextSuspendRequestTransfer-ExtIEs} } OPTIONAL, + ... +} + +UEContextSuspendRequestTransfer-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UE-DifferentiationInfo ::= SEQUENCE { + periodicCommunicationIndicator ENUMERATED {periodically, ondemand, ... } OPTIONAL, + periodicTime INTEGER (1..3600, ...) OPTIONAL, + scheduledCommunicationTime ScheduledCommunicationTime OPTIONAL, + stationaryIndication ENUMERATED {stationary, mobile, ...} OPTIONAL, + trafficProfile ENUMERATED {single-packet, dual-packets, multiple-packets, ...} OPTIONAL, + batteryIndication ENUMERATED {battery-powered, battery-powered-not-rechargeable-or-replaceable, not-battery-powered, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { UE-DifferentiationInfo-ExtIEs} } OPTIONAL, + ... +} + +UE-DifferentiationInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UEHistoryInformation ::= SEQUENCE (SIZE(1..maxnoofCellsinUEHistoryInfo)) OF LastVisitedCellItem + +UEHistoryInformationFromTheUE ::= CHOICE { + nR NRMobilityHistoryReport, + choice-Extensions ProtocolIE-SingleContainer { {UEHistoryInformationFromTheUE-ExtIEs} } +} + +UEHistoryInformationFromTheUE-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +UEIdentityIndexValue ::= CHOICE { + indexLength10 BIT STRING (SIZE(10)), + choice-Extensions ProtocolIE-SingleContainer { {UEIdentityIndexValue-ExtIEs} } +} + +UEIdentityIndexValue-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +UE-NGAP-IDs ::= CHOICE { + uE-NGAP-ID-pair UE-NGAP-ID-pair, + aMF-UE-NGAP-ID AMF-UE-NGAP-ID, + choice-Extensions ProtocolIE-SingleContainer { {UE-NGAP-IDs-ExtIEs} } +} + +UE-NGAP-IDs-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +UE-NGAP-ID-pair ::= SEQUENCE{ + aMF-UE-NGAP-ID AMF-UE-NGAP-ID, + rAN-UE-NGAP-ID RAN-UE-NGAP-ID, + iE-Extensions ProtocolExtensionContainer { {UE-NGAP-ID-pair-ExtIEs} } OPTIONAL, + ... +} + +UE-NGAP-ID-pair-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UEPagingIdentity ::= CHOICE { + fiveG-S-TMSI FiveG-S-TMSI, + choice-Extensions ProtocolIE-SingleContainer { {UEPagingIdentity-ExtIEs} } + } + +UEPagingIdentity-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +UEPresence ::= ENUMERATED {in, out, unknown, ...} + +UEPresenceInAreaOfInterestList ::= SEQUENCE (SIZE(1..maxnoofAoI)) OF UEPresenceInAreaOfInterestItem + +UEPresenceInAreaOfInterestItem ::= SEQUENCE { + locationReportingReferenceID LocationReportingReferenceID, + uEPresence UEPresence, + iE-Extensions ProtocolExtensionContainer { {UEPresenceInAreaOfInterestItem-ExtIEs} } OPTIONAL, + ... +} + +UEPresenceInAreaOfInterestItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UERadioCapability ::= OCTET STRING + +UERadioCapabilityForPaging ::= SEQUENCE { + uERadioCapabilityForPagingOfNR UERadioCapabilityForPagingOfNR OPTIONAL, + uERadioCapabilityForPagingOfEUTRA UERadioCapabilityForPagingOfEUTRA OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UERadioCapabilityForPaging-ExtIEs} } OPTIONAL, + ... +} + +UERadioCapabilityForPaging-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-UERadioCapabilityForPagingOfNB-IoT CRITICALITY ignore EXTENSION UERadioCapabilityForPagingOfNB-IoT PRESENCE optional }, + ... +} + +UERadioCapabilityForPagingOfNB-IoT ::= OCTET STRING + +UERadioCapabilityForPagingOfNR ::= OCTET STRING + +UERadioCapabilityForPagingOfEUTRA ::= OCTET STRING + +UERadioCapabilityID ::= OCTET STRING + +UERetentionInformation ::= ENUMERATED { + ues-retained, + ... +} + +UERLFReportContainer ::= CHOICE { + nR NRUERLFReportContainer, + lTE LTEUERLFReportContainer, + choice-Extensions ProtocolIE-SingleContainer { {UERLFReportContainer-ExtIEs} } +} + +UERLFReportContainer-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +UESecurityCapabilities ::= SEQUENCE { + nRencryptionAlgorithms NRencryptionAlgorithms, + nRintegrityProtectionAlgorithms NRintegrityProtectionAlgorithms, + eUTRAencryptionAlgorithms EUTRAencryptionAlgorithms, + eUTRAintegrityProtectionAlgorithms EUTRAintegrityProtectionAlgorithms, + iE-Extensions ProtocolExtensionContainer { {UESecurityCapabilities-ExtIEs} } OPTIONAL, + ... +} + +UESecurityCapabilities-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UESliceMaximumBitRateList ::= SEQUENCE (SIZE(1..maxnoofAllowedS-NSSAIs)) OF UESliceMaximumBitRateItem + +UESliceMaximumBitRateItem ::= SEQUENCE { + s-NSSAI S-NSSAI, + uESliceMaximumBitRateDL BitRate, + uESliceMaximumBitRateUL BitRate, + iE-Extensions ProtocolExtensionContainer { { UESliceMaximumBitRateItem-ExtIEs} } OPTIONAL, + ... +} + +UESliceMaximumBitRateItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + + +UE-UP-CIoT-Support ::= ENUMERATED {supported, ...} + +UL-CP-SecurityInformation ::= SEQUENCE { + ul-NAS-MAC UL-NAS-MAC, + ul-NAS-Count UL-NAS-Count, + iE-Extensions ProtocolExtensionContainer { { UL-CP-SecurityInformation-ExtIEs} } OPTIONAL, + ... +} + +UL-CP-SecurityInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UL-NAS-MAC ::= BIT STRING (SIZE (16)) + +UL-NAS-Count ::= BIT STRING (SIZE (5)) + +UL-NGU-UP-TNLModifyList ::= SEQUENCE (SIZE(1..maxnoofMultiConnectivity)) OF UL-NGU-UP-TNLModifyItem + +UL-NGU-UP-TNLModifyItem ::= SEQUENCE { + uL-NGU-UP-TNLInformation UPTransportLayerInformation, + dL-NGU-UP-TNLInformation UPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { {UL-NGU-UP-TNLModifyItem-ExtIEs} } OPTIONAL, + ... +} + +UL-NGU-UP-TNLModifyItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-RedundantUL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }| + { ID id-RedundantDL-NGU-UP-TNLInformation CRITICALITY ignore EXTENSION UPTransportLayerInformation PRESENCE optional }, + ... +} + +UnavailableGUAMIList ::= SEQUENCE (SIZE(1..maxnoofServedGUAMIs)) OF UnavailableGUAMIItem + +UnavailableGUAMIItem ::= SEQUENCE { + gUAMI GUAMI, + timerApproachForGUAMIRemoval TimerApproachForGUAMIRemoval OPTIONAL, + backupAMFName AMFName OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UnavailableGUAMIItem-ExtIEs} } OPTIONAL, + ... +} + +UnavailableGUAMIItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + {ID id-ExtendedBackupAMFName CRITICALITY ignore EXTENSION Extended-AMFName PRESENCE optional}, + ... +} + +ULForwarding ::= ENUMERATED { + ul-forwarding-proposed, + ... +} + +UpdateFeedback ::= BIT STRING (SIZE(8, ...)) + +UPTransportLayerInformation ::= CHOICE { + gTPTunnel GTPTunnel, + choice-Extensions ProtocolIE-SingleContainer { {UPTransportLayerInformation-ExtIEs} } +} + +UPTransportLayerInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +UPTransportLayerInformationList ::= SEQUENCE (SIZE(1..maxnoofMultiConnectivityMinusOne)) OF UPTransportLayerInformationItem + +UPTransportLayerInformationItem ::= SEQUENCE { + nGU-UP-TNLInformation UPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { {UPTransportLayerInformationItem-ExtIEs} } OPTIONAL, + ... +} + +UPTransportLayerInformationItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-CommonNetworkInstance CRITICALITY ignore EXTENSION CommonNetworkInstance PRESENCE optional }, + ... +} + + +UPTransportLayerInformationPairList ::= SEQUENCE (SIZE(1..maxnoofMultiConnectivityMinusOne)) OF UPTransportLayerInformationPairItem + +UPTransportLayerInformationPairItem ::= SEQUENCE { + uL-NGU-UP-TNLInformation UPTransportLayerInformation, + dL-NGU-UP-TNLInformation UPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { {UPTransportLayerInformationPairItem-ExtIEs} } OPTIONAL, + ... +} + +UPTransportLayerInformationPairItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +URI-address ::= VisibleString + +UserLocationInformation ::= CHOICE { + userLocationInformationEUTRA UserLocationInformationEUTRA, + userLocationInformationNR UserLocationInformationNR, + userLocationInformationN3IWF-with-PortNumber UserLocationInformationN3IWF-with-PortNumber, + choice-Extensions ProtocolIE-SingleContainer { {UserLocationInformation-ExtIEs} } +} + +UserLocationInformation-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-UserLocationInformationTNGF CRITICALITY ignore TYPE UserLocationInformationTNGF PRESENCE mandatory }| + { ID id-UserLocationInformationTWIF CRITICALITY ignore TYPE UserLocationInformationTWIF PRESENCE mandatory }| + { ID id-UserLocationInformationW-AGF CRITICALITY ignore TYPE UserLocationInformationW-AGF PRESENCE mandatory }| + { ID id-UserLocationInformationN3IWF-without-PortNumber CRITICALITY ignore TYPE UserLocationInformationN3IWF-without-PortNumber PRESENCE mandatory }, + ... +} + +UserLocationInformationEUTRA ::= SEQUENCE { + eUTRA-CGI EUTRA-CGI, + tAI TAI, + timeStamp TimeStamp OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UserLocationInformationEUTRA-ExtIEs} } OPTIONAL, + ... +} + +UserLocationInformationEUTRA-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PSCellInformation CRITICALITY ignore EXTENSION NGRAN-CGI PRESENCE optional}, + ... +} + +UserLocationInformationN3IWF-with-PortNumber ::= SEQUENCE { + iPAddress TransportLayerAddress, + portNumber PortNumber, + iE-Extensions ProtocolExtensionContainer { {UserLocationInformationN3IWF-with-PortNumber-ExtIEs} } OPTIONAL, + ... +} + +UserLocationInformationN3IWF-with-PortNumber-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-TAI CRITICALITY ignore EXTENSION TAI PRESENCE optional }, + ... +} +UserLocationInformationN3IWF-without-PortNumber ::= SEQUENCE { + iPAddress TransportLayerAddress, + tAI TAI OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { UserLocationInformationN3IWF-without-PortNumber-ExtIEs} } OPTIONAL, + ... +} + +UserLocationInformationN3IWF-without-PortNumber-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UserLocationInformationTNGF ::= SEQUENCE { + tNAP-ID TNAP-ID, + iPAddress TransportLayerAddress, + portNumber PortNumber OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UserLocationInformationTNGF-ExtIEs} } OPTIONAL, + ... +} + +UserLocationInformationTNGF-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-TAI CRITICALITY ignore EXTENSION TAI PRESENCE optional }, + ... +} + +UserLocationInformationTWIF ::= SEQUENCE { + tWAP-ID TWAP-ID, + iPAddress TransportLayerAddress, + portNumber PortNumber OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UserLocationInformationTWIF-ExtIEs} } OPTIONAL, + ... +} + +UserLocationInformationTWIF-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-TAI CRITICALITY ignore EXTENSION TAI PRESENCE optional }, + ... +} + +UserLocationInformationW-AGF ::= CHOICE { + globalLine-ID GlobalLine-ID, + hFCNode-ID HFCNode-ID, + choice-Extensions ProtocolIE-SingleContainer { { UserLocationInformationW-AGF-ExtIEs} } +} + +UserLocationInformationW-AGF-ExtIEs NGAP-PROTOCOL-IES ::= { + { ID id-GlobalCable-ID CRITICALITY ignore TYPE GlobalCable-ID PRESENCE mandatory }| + { ID id-HFCNode-ID-new CRITICALITY ignore TYPE HFCNode-ID-new PRESENCE mandatory }| + { ID id-GlobalCable-ID-new CRITICALITY ignore TYPE GlobalCable-ID-new PRESENCE mandatory }, + ... +} + +UserLocationInformationNR ::= SEQUENCE { + nR-CGI NR-CGI, + tAI TAI, + timeStamp TimeStamp OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {UserLocationInformationNR-ExtIEs} } OPTIONAL, + ... +} + +UserLocationInformationNR-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-PSCellInformation CRITICALITY ignore EXTENSION NGRAN-CGI PRESENCE optional }| + { ID id-NID CRITICALITY reject EXTENSION NID PRESENCE optional }| + { ID id-NRNTNTAIInformation CRITICALITY ignore EXTENSION NRNTNTAIInformation PRESENCE optional }| + { ID id-MobileIAB-MTUserLocationInformation CRITICALITY ignore EXTENSION MobileIAB-MTUserLocationInformation PRESENCE optional }| + { ID id-AdditionalULI CRITICALITY ignore EXTENSION AdditionalULI PRESENCE optional }| + { ID id-Aerial-UE-FlightInformationReporting CRITICALITY ignore EXTENSION Aerial-UE-FlightInformationReporting PRESENCE optional }, + ... +} + +Aerial-UE-FlightInformationReporting ::= SEQUENCE { + altitude Altitude, + timeStamp TimeStamp, + iE-Extensions ProtocolExtensionContainer { {Aerial-UE-FlightInformationReporting-ExtIEs} } OPTIONAL, + ... +} + + +Aerial-UE-FlightInformationReporting-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +Altitude ::= INTEGER (-420..10000, ...) + +AerialUEReportingPeriodicity ::= ENUMERATED {ms120, ms240, ms480, ms640, ms1024, ms2048, ms5120, ms10240, ms20480, ms40960, min1, min6, min12, min30, ...} + +UserPlaneFailureIndication ::= SEQUENCE { + userPlaneFailureType UserPlaneFailureType, + uL-NGU-UP-TNLInformation UPTransportLayerInformation, + dL-NGU-UP-TNLInformation UPTransportLayerInformation, + iE-Extensions ProtocolExtensionContainer { { UserPlaneFailureIndication-ExtIEs} } OPTIONAL, + ... +} + +UserPlaneFailureIndication-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +UserPlaneFailureIndicationReport ::= ENUMERATED { + qos-flows-and-tunnel-to-be-released, + qoS-flows-to-be-moved, + new-transport-address-allocated, + ... +} + + +UserPlaneFailureType ::= ENUMERATED { + gtp-u-error-indication-received, + up-path-failure, + ... +} + +UserPlaneSecurityInformation ::= SEQUENCE { + securityResult SecurityResult, + securityIndication SecurityIndication, + iE-Extensions ProtocolExtensionContainer { {UserPlaneSecurityInformation-ExtIEs} } OPTIONAL, + ... +} + +UserPlaneSecurityInformation-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- V + +VolumeTimedReportList ::= SEQUENCE (SIZE(1..maxnoofTimePeriods)) OF VolumeTimedReport-Item + +VolumeTimedReport-Item ::= SEQUENCE { + startTimeStamp OCTET STRING (SIZE(4)), + endTimeStamp OCTET STRING (SIZE(4)), + usageCountUL INTEGER (0..18446744073709551615), + usageCountDL INTEGER (0..18446744073709551615), + iE-Extensions ProtocolExtensionContainer { {VolumeTimedReport-Item-ExtIEs} } OPTIONAL, + ... +} + +VolumeTimedReport-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- W + +W-AGF-ID ::= CHOICE { + w-AGF-ID BIT STRING (SIZE(16, ...)), + choice-Extensions ProtocolIE-SingleContainer { {W-AGF-ID-ExtIEs} } +} + +W-AGF-ID-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +WarningAreaCoordinates ::= OCTET STRING (SIZE(1..1024)) + +WarningAreaList ::= CHOICE { + eUTRA-CGIListForWarning EUTRA-CGIListForWarning, + nR-CGIListForWarning NR-CGIListForWarning, + tAIListForWarning TAIListForWarning, + emergencyAreaIDList EmergencyAreaIDList, + choice-Extensions ProtocolIE-SingleContainer { {WarningAreaList-ExtIEs} } +} + +WarningAreaList-ExtIEs NGAP-PROTOCOL-IES ::= { + ... +} + +WarningMessageContents ::= OCTET STRING (SIZE(1..9600)) + +WarningSecurityInfo ::= OCTET STRING (SIZE(50)) + +WarningType ::= OCTET STRING (SIZE(2)) + +WLANMeasurementConfiguration ::= SEQUENCE { + wlanMeasConfig WLANMeasConfig, + wlanMeasConfigNameList WLANMeasConfigNameList OPTIONAL, + wlan-rssi ENUMERATED {true, ...} OPTIONAL, + wlan-rtt ENUMERATED {true, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { WLANMeasurementConfiguration-ExtIEs } } OPTIONAL, + ... +} + +WLANMeasurementConfiguration-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +WLANMeasConfigNameList ::= SEQUENCE (SIZE(1..maxnoofWLANName)) OF WLANMeasConfigNameItem + +WLANMeasConfigNameItem ::= SEQUENCE { + wLANName WLANName, + iE-Extensions ProtocolExtensionContainer { { WLANMeasConfigNameItem-ExtIEs } } OPTIONAL, + ... +} + +WLANMeasConfigNameItem-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +WLANMeasConfig::= ENUMERATED {setup,...} + +WLANName ::= OCTET STRING (SIZE (1..32)) + +WUS-Assistance-Information ::= SEQUENCE { + pagingProbabilityInformation PagingProbabilityInformation, + iE-Extensions ProtocolExtensionContainer { { WUS-Assistance-Information-ExtIEs } } OPTIONAL, + ... +} + +WUS-Assistance-Information-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +-- X + +XnExtTLAs ::= SEQUENCE (SIZE(1..maxnoofXnExtTLAs)) OF XnExtTLA-Item + +XnExtTLA-Item ::= SEQUENCE { + iPsecTLA TransportLayerAddress OPTIONAL, + gTP-TLAs XnGTP-TLAs OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {XnExtTLA-Item-ExtIEs} } OPTIONAL, + ... +} + +XnExtTLA-Item-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + { ID id-SCTP-TLAs CRITICALITY ignore EXTENSION SCTP-TLAs PRESENCE optional }, + ... +} + +XnGTP-TLAs ::= SEQUENCE (SIZE(1..maxnoofXnGTP-TLAs)) OF TransportLayerAddress + +XnTLAs ::= SEQUENCE (SIZE(1..maxnoofXnTLAs)) OF TransportLayerAddress + +XnTNLConfigurationInfo ::= SEQUENCE { + xnTransportLayerAddresses XnTLAs, + xnExtendedTransportLayerAddresses XnExtTLAs OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {XnTNLConfigurationInfo-ExtIEs} } OPTIONAL, + ... +} + +XnTNLConfigurationInfo-ExtIEs NGAP-PROTOCOL-EXTENSION ::= { + ... +} + +XrDeviceWith2Rx ::= ENUMERATED {true, ...} + +-- Y +-- Z + +END diff --git a/ngap/testdata/asn1/NGAP-PDU-Contents.asn b/ngap/testdata/asn1/NGAP-PDU-Contents.asn new file mode 100644 index 0000000000..c5949a3ef1 --- /dev/null +++ b/ngap/testdata/asn1/NGAP-PDU-Contents.asn @@ -0,0 +1,4026 @@ +-- ************************************************************** +-- +-- PDU definitions for NGAP. +-- +-- ************************************************************** + +NGAP-PDU-Contents { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-Access (22) modules (3) ngap (1) version1 (1) ngap-PDU-Contents (1) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + + A2X-PC5-QoS-Parameters, + AerialUEsubscriptionInformation, + AdditionalULI, + AIoT-CorrelationIdentifier, + AIOTFIdentifier, + AIOTFName, + AIOTSessionReleaseCommandTransfer, + AIOTSessionReleaseCompleteTransfer, + AIOTSessionReleaseRequestTransfer, + AIoT-Support, + AllowedNSSAI, + AMFName, + AMFSetID, + AMF-TNLAssociationSetupList, + AMF-TNLAssociationToAddList, + AMF-TNLAssociationToRemoveList, + AMF-TNLAssociationToUpdateList, + AMF-UE-NGAP-ID, + AssistanceDataForPaging, + AssociatedSessionID, + AUN3DeviceAccessInfo, + AuthenticatedIndication, + BroadcastCancelledAreaList, + BroadcastCompletedAreaList, + BroadcastTransportFailureTransfer, + BroadcastTransportRequestTransfer, + BroadcastTransportResponseTransfer, + CancelAllWarningMessages, + Cause, + CellIDListForRestart, + CEmodeBrestricted, + CEmodeBSupport-Indicator, + CNAssistedRANTuning, + CommandRequestTransfer, + CommandResponseTransfer, + CommandFailureTransfer, ConcurrentWarningMessageInd, + CoreNetworkAssistanceInformationForInactive, + CPTransportLayerInformation, + CriticalityDiagnostics, + DataCodingScheme, + DirectForwardingPathAvailability, + DL-CP-SecurityInformation, + DL-Signalling, + EarlyStatusTransfer-TransparentContainer, + EDT-Session, + EmergencyAreaIDListForRestart, + EmergencyFallbackIndicator, + EN-DCSONConfigurationTransfer, + EndIndication, + Enhanced-CoverageRestriction, + ERedCapIndication, + EUTRA-CGI, + EUTRA-PagingeDRXInformation, + Extended-AMFName, + Extended-ConnectedTime, + Extended-RANNodeName, + FiveGCAction, + FiveG-ProSeAuthorized, + FiveG-ProSePC5QoSParameters, + FiveG-S-TMSI, + GlobalRANNodeID, + GUAMI, + GUAMIList, + GUAMIType, + GW-Context-Release-Indication, + HandoverFlag, + HandoverType, + IAB-Authorized, + IABNodeIndication, + IAB-Supported, + IMSVoiceSupportIndicator, + IndexToRFSP, + InfoOnRecommendedCellsAndRANNodesForPaging, + IntersystemSONConfigurationTransfer, + InventoryRequestTransfer, + InventoryResponseTransfer, + InventoryFailureTransfer, + InventoryReportTransfer, + LAI, + LocationReportingRequestType, + LPWUSPSAssistanceInformation, + LPWUSDisableIndication, + LTE-A2X-ServicesAuthorized, + LTEM-Indication, + LTEUESidelinkAggregateMaximumBitrate, + LTEV2XServicesAuthorized, + MaskedIMEISV, + MBS-AreaSessionID, + MBS-DistributionReleaseRequestTransfer, + MBS-DistributionSetupRequestTransfer, + MBS-DistributionSetupResponseTransfer, + MBS-DistributionSetupUnsuccessfulTransfer, + MBS-ServiceArea, + MBS-SessionID, + MBSSessionReleaseResponseTransfer, + MBSSessionSetupOrModFailureTransfer, + MBSSessionSetupOrModRequestTransfer, + MBSSessionSetupOrModResponseTransfer, + MDTPLMNList, + MDTPLMNModificationList, + MessageIdentifier, + MobileIAB-Authorized, + MobileIABNodeIndication, + MobileIAB-Supported, + MobilityRestrictionList, + MulticastGroupPagingAreaList, + MulticastSessionActivationRequestTransfer, + MulticastSessionDeactivationRequestTransfer, + MulticastSessionUpdateRequestTransfer, + NAS-PDU, + NASSecurityParametersFromNGRAN, + NB-IoT-DefaultPagingDRX, + NB-IoT-PagingDRX, + NB-IoT-Paging-eDRXInfo, + NB-IoT-UEPriority, + NetworkControlledRepeaterAuthorized, + NewSecurityContextInd, + NGRAN-CGI, + NGRAN-TNLAssociationToRemoveList, + NGRANTraceID, + NID, + NoPDUSessionIndication, + NotifySourceNGRANNode, + NPN-AccessInformation, + NR-A2X-ServicesAuthorized, + NR-CGI, + NR-PagingeDRXInformation, + NRPPa-PDU, + NRUESidelinkAggregateMaximumBitrate, + NRV2XServicesAuthorized, + NumberOfBroadcastsRequested, + OverloadResponse, + OverloadStartNSSAIList, + PagingAssisDataforCEcapabUE, + PagingCause, + PagingDRX, + PagingOrigin, + PagingPolicyDifferentiation, + PagingPriority, + Partially-Allowed-NSSAI, + PC5QoSParameters, + PDUSessionAggregateMaximumBitRate, + PDUSessionListMTCommHReq, + PDUSessionResourceAdmittedList, + PDUSessionResourceFailedToModifyListModCfm, + PDUSessionResourceFailedToModifyListModRes, + PDUSessionResourceFailedToResumeListRESReq, + PDUSessionResourceFailedToResumeListRESRes, + PDUSessionResourceFailedToSetupListCxtFail, + PDUSessionResourceFailedToSetupListCxtRes, + PDUSessionResourceFailedToSetupListHOAck, + PDUSessionResourceFailedToSetupListPSReq, + PDUSessionResourceFailedToSetupListSURes, + PDUSessionResourceHandoverList, + PDUSessionResourceListCxtRelCpl, + PDUSessionResourceListCxtRelReq, + PDUSessionResourceListHORqd, + PDUSessionResourceModifyListModCfm, + PDUSessionResourceModifyListModInd, + PDUSessionResourceModifyListModReq, + PDUSessionResourceModifyListModRes, + PDUSessionResourceNotifyList, + PDUSessionResourceReleasedListNot, + PDUSessionResourceReleasedListPSAck, + PDUSessionResourceReleasedListPSFail, + PDUSessionResourceReleasedListRelRes, + PDUSessionResourceResumeListRESReq, + PDUSessionResourceResumeListRESRes, + PDUSessionResourceSecondaryRATUsageList, + PDUSessionResourceSetupListCxtReq, + PDUSessionResourceSetupListCxtRes, + PDUSessionResourceSetupListHOReq, + PDUSessionResourceSetupListSUReq, + PDUSessionResourceSetupListSURes, + PDUSessionResourceSuspendListSUSReq, + PDUSessionResourceSwitchedList, + PDUSessionResourceToBeSwitchedDLList, + PDUSessionResourceToReleaseListHOCmd, + PDUSessionResourceToReleaseListRelCmd, + PEIPSassistanceInformation, + PLMNIdentity, + PLMNSupportList, + PrivacyIndicator, + PWSFailedCellIDList, + QMCConfigInfo, + QMCDeactivation, + RAN-AIOT-Device-NGAP-ID, + RANNodeName, + RANPagingPriority, + RANStatusTransfer-TransparentContainer, + RANTimingSynchronisationStatusInfo, + RAN-TSSRequestType, + RAN-TSSScope, + RAN-UE-NGAP-ID, + RedCapIndication, + RedirectionVoiceFallback, + RelativeAMFCapacity, + RepetitionPeriod, + RequestedNSSAI, + ResetType, + RGLevelWirelineAccessCharacteristics, + RIMInformationTransfer, + RoutingID, + RRCEstablishmentCause, + RRCInactiveTransitionReportRequest, + RRCState, + SecurityContext, + SecurityKey, + SerialNumber, + ServedGUAMIList, + SliceSupportList, + SLPositioningRangingServiceInfo, + S-NSSAI, + SONConfigurationTransfer, + SourceToTarget-AMFInformationReroute, + SourceToTarget-TransparentContainer, + SRVCCOperationPossible, + SupportedTAList, + Suspend-Request-Indication, + Suspend-Response-Indication, + TAI, + TAIListForPaging, + TAIListForRestart, + TargetID, + TargetNSSAIInformation, + TargettoSource-Failure-TransparentContainer, + TargetToSource-TransparentContainer, + TimeSyncAssistanceInfo, + TimeToWait, + TNLAssociationList, + TraceActivation, + TrafficLoadReductionIndication, + TransportLayerAddress, + UEAggregateMaximumBitRate, + UE-associatedLogicalNG-connectionList, + UECapabilityInfoRequest, + UEContextRequest, + UE-DifferentiationInfo, + UE-NGAP-IDs, + UEPagingIdentity, + UEPresenceInAreaOfInterestList, + UERadioCapability, + UERadioCapabilityForPaging, + UERadioCapabilityID, + UERetentionInformation, + UESecurityCapabilities, + UESliceMaximumBitRateList, + UE-UP-CIoT-Support, + UL-CP-SecurityInformation, + UnavailableGUAMIList, + URI-address, + UserLocationInformation, + WarningAreaCoordinates, + WarningAreaList, + WarningMessageContents, + WarningSecurityInfo, + WarningType, + WUS-Assistance-Information, + XrDeviceWith2Rx + +FROM NGAP-IEs + + PrivateIE-Container{}, + ProtocolExtensionContainer{}, + ProtocolIE-Container{}, + ProtocolIE-ContainerList{}, + ProtocolIE-ContainerPair{}, + ProtocolIE-SingleContainer{}, + NGAP-PRIVATE-IES, + NGAP-PROTOCOL-EXTENSION, + NGAP-PROTOCOL-IES, + NGAP-PROTOCOL-IES-PAIR + +FROM NGAP-Containers + + id-A2X-PC5-QoS-Parameters, + id-AerialUEsubscriptionInformation, + id-AdditionalULI, + id-AIoT-CorrelationIdentifier, + id-AIOTFIdentifier, + id-AIOTFName, + id-AIOTSessionReleaseCommandTransfer, + id-AIOTSessionReleaseCompleteTransfer, + id-AIOTSessionReleaseRequestTransfer, + id-AIoT-Support, + id-AllowedNSSAI, + id-AMFName, + id-AMFOverloadResponse, + id-AMFSetID, + id-AMF-TNLAssociationFailedToSetupList, + id-AMF-TNLAssociationSetupList, + id-AMF-TNLAssociationToAddList, + id-AMF-TNLAssociationToRemoveList, + id-AMF-TNLAssociationToUpdateList, + id-AMFTrafficLoadReductionIndication, + id-AMF-UE-NGAP-ID, + id-AMF-UE-NGAP-ID2, + id-AssistanceDataForPaging, + id-AssociatedSessionID, + id-AUN3DeviceAccessInfo, + id-AuthenticatedIndication, + id-BroadcastCancelledAreaList, + id-BroadcastCompletedAreaList, + id-BroadcastTransportFailureTransfer, + id-BroadcastTransportRequestTransfer, + id-BroadcastTransportResponseTransfer, + id-CancelAllWarningMessages, + id-Cause, + id-CellIDListForRestart, + id-CEmodeBrestricted, + id-CEmodeBSupport-Indicator, + id-CNAssistedRANTuning, + id-CommandRequestTransfer, + id-CommandResponseTransfer, + id-CommandFailureTransfer, + id-ConcurrentWarningMessageInd, + id-CoreNetworkAssistanceInformationForInactive, + id-CriticalityDiagnostics, + id-DataCodingScheme, + id-DefaultPagingDRX, + id-DirectForwardingPathAvailability, + id-DL-CP-SecurityInformation, + id-DL-Signalling, + id-EarlyStatusTransfer-TransparentContainer, + id-EDT-Session, + id-EmergencyAreaIDListForRestart, + id-EmergencyFallbackIndicator, + id-ENDC-SONConfigurationTransferDL, + id-ENDC-SONConfigurationTransferUL, + id-EndIndication, + id-Enhanced-CoverageRestriction, + id-ERedCapIndication, + id-EUTRA-CGI, + id-EUTRA-PagingeDRXInformation, + id-Extended-AMFName, + id-Extended-ConnectedTime, + id-Extended-RANNodeName, + id-FiveGCAction, + id-FiveG-ProSeAuthorized, + id-FiveG-ProSePC5QoSParameters, + id-FiveG-ProSeUEPC5AggregateMaximumBitRate, + id-FiveG-S-TMSI, + id-GlobalRANNodeID, + id-GUAMI, + id-GUAMIList, + id-GUAMIType, + id-GW-Context-Release-Indication, + id-HandoverFlag, + id-HandoverType, + id-IAB-Authorized, + id-IABNodeIndication, + id-IAB-Supported, + id-IMSVoiceSupportIndicator, + id-IndexToRFSP, + id-InfoOnRecommendedCellsAndRANNodesForPaging, + id-IntersystemSONConfigurationTransferDL, + id-IntersystemSONConfigurationTransferUL, + id-InventoryRequestTransfer, + id-InventoryResponseTransfer, + id-InventoryFailureTransfer, + id-InventoryReportTransfer, + id-LocationReportingRequestType, + id-LPWUSPSAssistanceInformation, + id-LPWUSDisableIndication, + id-LTE-A2X-ServicesAuthorized, + id-LTE-A2X-UE-PC5-AggregateMaximumBitRate, + id-LTEM-Indication, + id-LTEUESidelinkAggregateMaximumBitrate, + id-LTEV2XServicesAuthorized, + id-ManagementBasedMDTPLMNList, + id-ManagementBasedMDTPLMNModificationList, + id-MaskedIMEISV, + id-MBS-AreaSessionID, + id-MBS-DistributionReleaseRequestTransfer, + id-MBS-DistributionSetupRequestTransfer, + id-MBS-DistributionSetupResponseTransfer, + id-MBS-DistributionSetupUnsuccessfulTransfer, + id-MBS-ServiceArea, + id-MBS-SessionID, + id-MBSSessionModificationFailureTransfer, + id-MBSSessionModificationRequestTransfer, + id-MBSSessionModificationResponseTransfer, + id-MBSSessionReleaseResponseTransfer, + id-MBSSessionSetupFailureTransfer, + id-MBSSessionSetupRequestTransfer, + id-MBSSessionSetupResponseTransfer, + id-MessageIdentifier, + id-MobileIAB-Authorized, + id-MobileIABNodeIndication, + id-MobileIAB-Supported, + id-MobilityRestrictionList, + id-MulticastGroupPagingAreaList, + id-MulticastSessionActivationRequestTransfer, + id-MulticastSessionDeactivationRequestTransfer, + id-MulticastSessionUpdateRequestTransfer, + id-NASC, + id-NAS-PDU, + id-NASSecurityParametersFromNGRAN, + id-NB-IoT-DefaultPagingDRX, + id-NB-IoT-PagingDRX, + id-NB-IoT-Paging-eDRXInfo, + id-NB-IoT-UEPriority, + id-NetworkControlledRepeaterAuthorized, + id-NewAMF-UE-NGAP-ID, + id-NewGUAMI, + id-NewSecurityContextInd, + id-NGAP-Message, + id-NGRAN-CGI, + id-NGRAN-TNLAssociationToRemoveList, + id-NGRANTraceID, + id-NoPDUSessionIndication, + id-NotifySourceNGRANNode, + id-NPN-AccessInformation, + id-NR-A2X-ServicesAuthorized, + id-NR-A2X-UE-PC5-AggregateMaximumBitRate, + id-NR-PagingeDRXInformation, + id-NRPPa-PDU, + id-NRUESidelinkAggregateMaximumBitrate, + id-NRV2XServicesAuthorized, + id-NumberOfBroadcastsRequested, + id-OldAMF, + id-OverloadStartNSSAIList, + id-PagingAssisDataforCEcapabUE, + id-PagingCause, + id-PagingDRX, + id-PagingOrigin, + id-PagingPolicyDifferentiation, + id-PagingPriority, + id-Partially-Allowed-NSSAI, + id-PC5QoSParameters, + id-PDUSessionListMTCommHReq, + id-PDUSessionResourceAdmittedList, + id-PDUSessionResourceFailedToModifyListModCfm, + id-PDUSessionResourceFailedToModifyListModRes, + id-PDUSessionResourceFailedToResumeListRESReq, + id-PDUSessionResourceFailedToResumeListRESRes, + id-PDUSessionResourceFailedToSetupListCxtFail, + id-PDUSessionResourceFailedToSetupListCxtRes, + id-PDUSessionResourceFailedToSetupListHOAck, + id-PDUSessionResourceFailedToSetupListPSReq, + id-PDUSessionResourceFailedToSetupListSURes, + id-PDUSessionResourceHandoverList, + id-PDUSessionResourceListCxtRelCpl, + id-PDUSessionResourceListCxtRelReq, + id-PDUSessionResourceListHORqd, + id-PDUSessionResourceModifyListModCfm, + id-PDUSessionResourceModifyListModInd, + id-PDUSessionResourceModifyListModReq, + id-PDUSessionResourceModifyListModRes, + id-PDUSessionResourceNotifyList, + id-PDUSessionResourceReleasedListNot, + id-PDUSessionResourceReleasedListPSAck, + id-PDUSessionResourceReleasedListPSFail, + id-PDUSessionResourceReleasedListRelRes, + id-PDUSessionResourceResumeListRESReq, + id-PDUSessionResourceResumeListRESRes, + id-PDUSessionResourceSecondaryRATUsageList, + id-PDUSessionResourceSetupListCxtReq, + id-PDUSessionResourceSetupListCxtRes, + id-PDUSessionResourceSetupListHOReq, + id-PDUSessionResourceSetupListSUReq, + id-PDUSessionResourceSetupListSURes, + id-PDUSessionResourceSuspendListSUSReq, + id-PDUSessionResourceSwitchedList, + id-PDUSessionResourceToBeSwitchedDLList, + id-PDUSessionResourceToReleaseListHOCmd, + id-PDUSessionResourceToReleaseListRelCmd, + id-PEIPSassistanceInformation, + id-PLMNSupportList, + id-PrivacyIndicator, + id-PWSFailedCellIDList, + id-QMCConfigInfo, + id-QMCDeactivation, + id-RAN-AIOT-Device-NGAP-ID, + id-RANNodeName, + id-RANPagingPriority, + id-RANStatusTransfer-TransparentContainer, + id-RANTimingSynchronisationStatusInfo, + id-RAN-TSSRequestType, + id-RAN-TSSScope, + id-RAN-UE-NGAP-ID, + id-RedCapIndication, + id-RedirectionVoiceFallback, + id-RelativeAMFCapacity, + id-RepetitionPeriod, + id-RequestedNSSAI, + id-ResetType, + id-RGLevelWirelineAccessCharacteristics, + id-RIMInformationTransfer, + id-RoutingID, + id-RRCEstablishmentCause, + id-RRCInactiveTransitionReportRequest, + id-RRC-Resume-Cause, + id-RRCState, + id-SecurityContext, + id-SecurityKey, + id-SelectedNID, + id-SelectedPLMNIdentity, + id-SerialNumber, + id-ServedGUAMIList, + id-SliceSupportList, + id-S-NSSAI, + id-SONConfigurationTransferDL, + id-SONConfigurationTransferUL, + id-SourceAMF-GUAMI, + id-SourceAMF-UE-NGAP-ID, + id-SourceToTarget-AMFInformationReroute, + id-SourceToTarget-TransparentContainer, + id-SRVCCOperationPossible, + id-SupportedTAList, + id-Suspend-Request-Indication, + id-Suspend-Response-Indication, + id-Target-RAN-Node-ID, + id-TAI, + id-TAIListForPaging, + id-TAIListForRestart, + id-TargetID, + id-TargetNSSAIInformation, + id-TargettoSource-Failure-TransparentContainer, + id-TargetToSource-TransparentContainer, + id-TimeSyncAssistanceInfo, + id-TimeToWait, + id-TNGFIdentityInformation, + id-TraceActivation, + id-TraceCollectionEntityIPAddress, + id-TraceCollectionEntityURI, + id-TWIFIdentityInformation, + id-UEAggregateMaximumBitRate, + id-UE-associatedLogicalNG-connectionList, + id-UECapabilityInfoRequest, + id-UEContextRequest, + id-UE-DifferentiationInfo, + id-UE-NGAP-IDs, + id-UEPagingIdentity, + id-UEPresenceInAreaOfInterestList, + id-UERadioCapability, + id-UERadioCapability-EUTRA-Format, + id-UERadioCapabilityForPaging, + id-UERadioCapabilityID, + id-UERetentionInformation, + id-UESecurityCapabilities, + id-UESliceMaximumBitRateList, + id-UE-UP-CIoT-Support, + id-UL-CP-SecurityInformation, + id-UnavailableGUAMIList, + id-UserLocationInformation, + id-W-AGFIdentityInformation, + id-WarningAreaCoordinates, + id-WarningAreaList, + id-WarningMessageContents, + id-WarningSecurityInfo, + id-WarningType, + id-WUS-Assistance-Information, + id-XrDeviceWith2Rx, + id-SLPositioningRangingServiceInfo, + id-ExtendedOldAMF, + id-Aerial-UE-FlightInformationOngoingReporting-failed + + +FROM NGAP-Constants; + +-- ************************************************************** +-- +-- PDU SESSION MANAGEMENT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PDU Session Resource Setup Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE SETUP REQUEST +-- +-- ************************************************************** + +PDUSessionResourceSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceSetupRequestIEs} }, + ... +} + +PDUSessionResourceSetupRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RANPagingPriority CRITICALITY ignore TYPE RANPagingPriority PRESENCE optional }| + { ID id-NAS-PDU CRITICALITY reject TYPE NAS-PDU PRESENCE optional }| + { ID id-PDUSessionResourceSetupListSUReq CRITICALITY reject TYPE PDUSessionResourceSetupListSUReq PRESENCE mandatory }| + { ID id-UEAggregateMaximumBitRate CRITICALITY ignore TYPE UEAggregateMaximumBitRate PRESENCE optional }| + { ID id-UESliceMaximumBitRateList CRITICALITY ignore TYPE UESliceMaximumBitRateList PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE SETUP RESPONSE +-- +-- ************************************************************** + +PDUSessionResourceSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceSetupResponseIEs} }, + ... +} + +PDUSessionResourceSetupResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceSetupListSURes CRITICALITY ignore TYPE PDUSessionResourceSetupListSURes PRESENCE optional }| + { ID id-PDUSessionResourceFailedToSetupListSURes CRITICALITY ignore TYPE PDUSessionResourceFailedToSetupListSURes PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- PDU Session Resource Release Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE RELEASE COMMAND +-- +-- ************************************************************** + +PDUSessionResourceReleaseCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceReleaseCommandIEs} }, + ... +} + +PDUSessionResourceReleaseCommandIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RANPagingPriority CRITICALITY ignore TYPE RANPagingPriority PRESENCE optional }| + { ID id-NAS-PDU CRITICALITY ignore TYPE NAS-PDU PRESENCE optional }| + { ID id-PDUSessionResourceToReleaseListRelCmd CRITICALITY reject TYPE PDUSessionResourceToReleaseListRelCmd PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE RELEASE RESPONSE +-- +-- ************************************************************** + +PDUSessionResourceReleaseResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceReleaseResponseIEs} }, + ... +} + +PDUSessionResourceReleaseResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceReleasedListRelRes CRITICALITY ignore TYPE PDUSessionResourceReleasedListRelRes PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PDU Session Resource Modify Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE MODIFY REQUEST +-- +-- ************************************************************** + +PDUSessionResourceModifyRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceModifyRequestIEs} }, + ... +} + +PDUSessionResourceModifyRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RANPagingPriority CRITICALITY ignore TYPE RANPagingPriority PRESENCE optional }| + { ID id-PDUSessionResourceModifyListModReq CRITICALITY reject TYPE PDUSessionResourceModifyListModReq PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE MODIFY RESPONSE +-- +-- ************************************************************** + +PDUSessionResourceModifyResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceModifyResponseIEs} }, + ... +} + +PDUSessionResourceModifyResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceModifyListModRes CRITICALITY ignore TYPE PDUSessionResourceModifyListModRes PRESENCE optional }| + { ID id-PDUSessionResourceFailedToModifyListModRes CRITICALITY ignore TYPE PDUSessionResourceFailedToModifyListModRes PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- PDU Session Resource Notify Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE NOTIFY +-- +-- ************************************************************** + +PDUSessionResourceNotify ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceNotifyIEs} }, + ... +} + +PDUSessionResourceNotifyIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceNotifyList CRITICALITY reject TYPE PDUSessionResourceNotifyList PRESENCE optional }| + { ID id-PDUSessionResourceReleasedListNot CRITICALITY ignore TYPE PDUSessionResourceReleasedListNot PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- PDU Session Resource Modify Indication Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE MODIFY INDICATION +-- +-- ************************************************************** + +PDUSessionResourceModifyIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceModifyIndicationIEs} }, + ... +} + +PDUSessionResourceModifyIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceModifyListModInd CRITICALITY reject TYPE PDUSessionResourceModifyListModInd PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PDU SESSION RESOURCE MODIFY CONFIRM +-- +-- ************************************************************** + +PDUSessionResourceModifyConfirm ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PDUSessionResourceModifyConfirmIEs} }, + ... +} + +PDUSessionResourceModifyConfirmIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceModifyListModCfm CRITICALITY ignore TYPE PDUSessionResourceModifyListModCfm PRESENCE optional }| + { ID id-PDUSessionResourceFailedToModifyListModCfm CRITICALITY ignore TYPE PDUSessionResourceFailedToModifyListModCfm PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT MANAGEMENT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Initial Context Setup Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- INITIAL CONTEXT SETUP REQUEST +-- +-- ************************************************************** + +InitialContextSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InitialContextSetupRequestIEs} }, + ... +} + +InitialContextSetupRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-OldAMF CRITICALITY reject TYPE AMFName PRESENCE optional }| + { ID id-UEAggregateMaximumBitRate CRITICALITY reject TYPE UEAggregateMaximumBitRate PRESENCE conditional }| +-- The above IE shall be present if the PDU Session Resource Setup List IE is present + { ID id-CoreNetworkAssistanceInformationForInactive CRITICALITY ignore TYPE CoreNetworkAssistanceInformationForInactive PRESENCE optional }| + { ID id-GUAMI CRITICALITY reject TYPE GUAMI PRESENCE mandatory }| + { ID id-PDUSessionResourceSetupListCxtReq CRITICALITY reject TYPE PDUSessionResourceSetupListCxtReq PRESENCE optional }| + { ID id-AllowedNSSAI CRITICALITY reject TYPE AllowedNSSAI PRESENCE mandatory }| + { ID id-UESecurityCapabilities CRITICALITY reject TYPE UESecurityCapabilities PRESENCE mandatory }| + { ID id-SecurityKey CRITICALITY reject TYPE SecurityKey PRESENCE mandatory }| + { ID id-TraceActivation CRITICALITY ignore TYPE TraceActivation PRESENCE optional }| + { ID id-MobilityRestrictionList CRITICALITY ignore TYPE MobilityRestrictionList PRESENCE optional }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-IndexToRFSP CRITICALITY ignore TYPE IndexToRFSP PRESENCE optional }| + { ID id-MaskedIMEISV CRITICALITY ignore TYPE MaskedIMEISV PRESENCE optional }| + { ID id-NAS-PDU CRITICALITY ignore TYPE NAS-PDU PRESENCE optional }| + { ID id-EmergencyFallbackIndicator CRITICALITY reject TYPE EmergencyFallbackIndicator PRESENCE optional }| + { ID id-RRCInactiveTransitionReportRequest CRITICALITY ignore TYPE RRCInactiveTransitionReportRequest PRESENCE optional }| + { ID id-UERadioCapabilityForPaging CRITICALITY ignore TYPE UERadioCapabilityForPaging PRESENCE optional }| + { ID id-RedirectionVoiceFallback CRITICALITY ignore TYPE RedirectionVoiceFallback PRESENCE optional }| + { ID id-LocationReportingRequestType CRITICALITY ignore TYPE LocationReportingRequestType PRESENCE optional }| + { ID id-CNAssistedRANTuning CRITICALITY ignore TYPE CNAssistedRANTuning PRESENCE optional }| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional }| + { ID id-IAB-Authorized CRITICALITY ignore TYPE IAB-Authorized PRESENCE optional }| + { ID id-Enhanced-CoverageRestriction CRITICALITY ignore TYPE Enhanced-CoverageRestriction PRESENCE optional }| + { ID id-Extended-ConnectedTime CRITICALITY ignore TYPE Extended-ConnectedTime PRESENCE optional }| + { ID id-UE-DifferentiationInfo CRITICALITY ignore TYPE UE-DifferentiationInfo PRESENCE optional }| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-LTEV2XServicesAuthorized CRITICALITY ignore TYPE LTEV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTEUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-CEmodeBrestricted CRITICALITY ignore TYPE CEmodeBrestricted PRESENCE optional }| + { ID id-UE-UP-CIoT-Support CRITICALITY ignore TYPE UE-UP-CIoT-Support PRESENCE optional }| + { ID id-RGLevelWirelineAccessCharacteristics CRITICALITY ignore TYPE RGLevelWirelineAccessCharacteristics PRESENCE optional }| + { ID id-ManagementBasedMDTPLMNList CRITICALITY ignore TYPE MDTPLMNList PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }| + { ID id-TimeSyncAssistanceInfo CRITICALITY ignore TYPE TimeSyncAssistanceInfo PRESENCE optional }| + { ID id-QMCConfigInfo CRITICALITY ignore TYPE QMCConfigInfo PRESENCE optional }| + { ID id-TargetNSSAIInformation CRITICALITY ignore TYPE TargetNSSAIInformation PRESENCE optional }| + { ID id-UESliceMaximumBitRateList CRITICALITY ignore TYPE UESliceMaximumBitRateList PRESENCE optional }| + { ID id-FiveG-ProSeAuthorized CRITICALITY ignore TYPE FiveG-ProSeAuthorized PRESENCE optional }| + { ID id-FiveG-ProSeUEPC5AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-FiveG-ProSePC5QoSParameters CRITICALITY ignore TYPE FiveG-ProSePC5QoSParameters PRESENCE optional }| + { ID id-NetworkControlledRepeaterAuthorized CRITICALITY ignore TYPE NetworkControlledRepeaterAuthorized PRESENCE optional }| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional }| + { ID id-NR-A2X-ServicesAuthorized CRITICALITY ignore TYPE NR-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-LTE-A2X-ServicesAuthorized CRITICALITY ignore TYPE LTE-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-NR-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTE-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-A2X-PC5-QoS-Parameters CRITICALITY ignore TYPE A2X-PC5-QoS-Parameters PRESENCE optional }| + { ID id-MobileIAB-Authorized CRITICALITY ignore TYPE MobileIAB-Authorized PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }| + { ID id-SLPositioningRangingServiceInfo CRITICALITY ignore TYPE SLPositioningRangingServiceInfo PRESENCE optional }| + { ID id-ExtendedOldAMF CRITICALITY ignore TYPE Extended-AMFName PRESENCE optional }| + { ID id-AMF-UE-NGAP-ID2 CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- INITIAL CONTEXT SETUP RESPONSE +-- +-- ************************************************************** + +InitialContextSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InitialContextSetupResponseIEs} }, + ... +} + +InitialContextSetupResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceSetupListCxtRes CRITICALITY ignore TYPE PDUSessionResourceSetupListCxtRes PRESENCE optional }| + { ID id-PDUSessionResourceFailedToSetupListCxtRes CRITICALITY ignore TYPE PDUSessionResourceFailedToSetupListCxtRes PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- INITIAL CONTEXT SETUP FAILURE +-- +-- ************************************************************** + +InitialContextSetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InitialContextSetupFailureIEs} }, + ... +} + +InitialContextSetupFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceFailedToSetupListCxtFail CRITICALITY ignore TYPE PDUSessionResourceFailedToSetupListCxtFail PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Context Release Request Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT RELEASE REQUEST +-- +-- ************************************************************** + +UEContextReleaseRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextReleaseRequest-IEs} }, + ... +} + +UEContextReleaseRequest-IEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceListCxtRelReq CRITICALITY reject TYPE PDUSessionResourceListCxtRelReq PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-GW-Context-Release-Indication CRITICALITY reject TYPE GW-Context-Release-Indication PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Context Release Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT RELEASE COMMAND +-- +-- ************************************************************** + +UEContextReleaseCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextReleaseCommand-IEs} }, + ... +} + +UEContextReleaseCommand-IEs NGAP-PROTOCOL-IES ::= { + { ID id-UE-NGAP-IDs CRITICALITY reject TYPE UE-NGAP-IDs PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT RELEASE COMPLETE +-- +-- ************************************************************** + +UEContextReleaseComplete ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextReleaseComplete-IEs} }, + ... +} + +UEContextReleaseComplete-IEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }| + { ID id-InfoOnRecommendedCellsAndRANNodesForPaging CRITICALITY ignore TYPE InfoOnRecommendedCellsAndRANNodesForPaging PRESENCE optional }| + { ID id-PDUSessionResourceListCxtRelCpl CRITICALITY reject TYPE PDUSessionResourceListCxtRelCpl PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-PagingAssisDataforCEcapabUE CRITICALITY ignore TYPE PagingAssisDataforCEcapabUE PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Context Resume Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT RESUME REQUEST +-- +-- ************************************************************** + +UEContextResumeRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextResumeRequestIEs} }, + ... +} + +UEContextResumeRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RRC-Resume-Cause CRITICALITY ignore TYPE RRCEstablishmentCause PRESENCE mandatory }| + { ID id-PDUSessionResourceResumeListRESReq CRITICALITY reject TYPE PDUSessionResourceResumeListRESReq PRESENCE optional }| + { ID id-PDUSessionResourceFailedToResumeListRESReq CRITICALITY reject TYPE PDUSessionResourceFailedToResumeListRESReq PRESENCE optional }| + { ID id-Suspend-Request-Indication CRITICALITY ignore TYPE Suspend-Request-Indication PRESENCE optional }| + { ID id-InfoOnRecommendedCellsAndRANNodesForPaging CRITICALITY ignore TYPE InfoOnRecommendedCellsAndRANNodesForPaging PRESENCE optional }| + { ID id-PagingAssisDataforCEcapabUE CRITICALITY ignore TYPE PagingAssisDataforCEcapabUE PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT RESUME RESPONSE +-- +-- ************************************************************** + +UEContextResumeResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextResumeResponseIEs} }, + ... +} + +UEContextResumeResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceResumeListRESRes CRITICALITY reject TYPE PDUSessionResourceResumeListRESRes PRESENCE optional }| + { ID id-PDUSessionResourceFailedToResumeListRESRes CRITICALITY reject TYPE PDUSessionResourceFailedToResumeListRESRes PRESENCE optional }| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE optional }| + { ID id-Suspend-Response-Indication CRITICALITY ignore TYPE Suspend-Response-Indication PRESENCE optional }| + { ID id-Extended-ConnectedTime CRITICALITY ignore TYPE Extended-ConnectedTime PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT RESUME FAILURE +-- +-- ************************************************************** + +UEContextResumeFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextResumeFailureIEs} }, + ... +} + +UEContextResumeFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- UE Context Suspend Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT SUSPEND REQUEST +-- +-- ************************************************************** + +UEContextSuspendRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextSuspendRequestIEs} }, + ... +} + +UEContextSuspendRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-InfoOnRecommendedCellsAndRANNodesForPaging CRITICALITY ignore TYPE InfoOnRecommendedCellsAndRANNodesForPaging PRESENCE optional }| + { ID id-PagingAssisDataforCEcapabUE CRITICALITY ignore TYPE PagingAssisDataforCEcapabUE PRESENCE optional }| + { ID id-PDUSessionResourceSuspendListSUSReq CRITICALITY reject TYPE PDUSessionResourceSuspendListSUSReq PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT SUSPEND RESPONSE +-- +-- ************************************************************** + +UEContextSuspendResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextSuspendResponseIEs} }, + ... +} + +UEContextSuspendResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT SUSPEND FAILURE +-- +-- ************************************************************** + +UEContextSuspendFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextSuspendFailureIEs} }, + ... +} + +UEContextSuspendFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Context Modification Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION REQUEST +-- +-- ************************************************************** + +UEContextModificationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextModificationRequestIEs} }, + ... +} + +UEContextModificationRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RANPagingPriority CRITICALITY ignore TYPE RANPagingPriority PRESENCE optional }| + { ID id-SecurityKey CRITICALITY reject TYPE SecurityKey PRESENCE optional }| + { ID id-IndexToRFSP CRITICALITY ignore TYPE IndexToRFSP PRESENCE optional }| + { ID id-UEAggregateMaximumBitRate CRITICALITY ignore TYPE UEAggregateMaximumBitRate PRESENCE optional }| + { ID id-UESecurityCapabilities CRITICALITY reject TYPE UESecurityCapabilities PRESENCE optional }| + { ID id-CoreNetworkAssistanceInformationForInactive CRITICALITY ignore TYPE CoreNetworkAssistanceInformationForInactive PRESENCE optional }| + { ID id-EmergencyFallbackIndicator CRITICALITY reject TYPE EmergencyFallbackIndicator PRESENCE optional }| + { ID id-NewAMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE optional }| + { ID id-RRCInactiveTransitionReportRequest CRITICALITY ignore TYPE RRCInactiveTransitionReportRequest PRESENCE optional }| + { ID id-NewGUAMI CRITICALITY reject TYPE GUAMI PRESENCE optional }| + { ID id-CNAssistedRANTuning CRITICALITY ignore TYPE CNAssistedRANTuning PRESENCE optional }| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional }| + { ID id-IAB-Authorized CRITICALITY ignore TYPE IAB-Authorized PRESENCE optional }| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-LTEV2XServicesAuthorized CRITICALITY ignore TYPE LTEV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTEUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }| + { ID id-RGLevelWirelineAccessCharacteristics CRITICALITY ignore TYPE RGLevelWirelineAccessCharacteristics PRESENCE optional }| + { ID id-TimeSyncAssistanceInfo CRITICALITY ignore TYPE TimeSyncAssistanceInfo PRESENCE optional }| + { ID id-QMCConfigInfo CRITICALITY ignore TYPE QMCConfigInfo PRESENCE optional }| + { ID id-QMCDeactivation CRITICALITY ignore TYPE QMCDeactivation PRESENCE optional }| + { ID id-UESliceMaximumBitRateList CRITICALITY ignore TYPE UESliceMaximumBitRateList PRESENCE optional }| + { ID id-ManagementBasedMDTPLMNModificationList CRITICALITY ignore TYPE MDTPLMNModificationList PRESENCE optional }| + { ID id-FiveG-ProSeAuthorized CRITICALITY ignore TYPE FiveG-ProSeAuthorized PRESENCE optional }| + { ID id-FiveG-ProSeUEPC5AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-FiveG-ProSePC5QoSParameters CRITICALITY ignore TYPE FiveG-ProSePC5QoSParameters PRESENCE optional }| + { ID id-NetworkControlledRepeaterAuthorized CRITICALITY ignore TYPE NetworkControlledRepeaterAuthorized PRESENCE optional }| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional }| + { ID id-NR-A2X-ServicesAuthorized CRITICALITY ignore TYPE NR-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-LTE-A2X-ServicesAuthorized CRITICALITY ignore TYPE LTE-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-NR-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTE-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-A2X-PC5-QoS-Parameters CRITICALITY ignore TYPE A2X-PC5-QoS-Parameters PRESENCE optional }| + { ID id-MobileIAB-Authorized CRITICALITY ignore TYPE MobileIAB-Authorized PRESENCE optional }| + { ID id-SLPositioningRangingServiceInfo CRITICALITY ignore TYPE SLPositioningRangingServiceInfo PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION RESPONSE +-- +-- ************************************************************** + +UEContextModificationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextModificationResponseIEs} }, + ... +} + +UEContextModificationResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RRCState CRITICALITY ignore TYPE RRCState PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION FAILURE +-- +-- ************************************************************** + +UEContextModificationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextModificationFailureIEs} }, + ... +} + +UEContextModificationFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- RRC INACTIVE TRANSITION REPORT +-- +-- ************************************************************** + +RRCInactiveTransitionReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {RRCInactiveTransitionReportIEs} }, + ... +} + +RRCInactiveTransitionReportIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RRCState CRITICALITY ignore TYPE RRCState PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Retrieve UE Information +-- +-- ************************************************************** + +RetrieveUEInformation ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { RetrieveUEInformationIEs} }, + ... +} + +RetrieveUEInformationIEs NGAP-PROTOCOL-IES ::= { + { ID id-FiveG-S-TMSI CRITICALITY reject TYPE FiveG-S-TMSI PRESENCE mandatory }, + ... + +} + +-- ************************************************************** + +-- UE Information Transfer +-- +-- ************************************************************** + +UEInformationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEInformationTransferIEs} }, + ... +} + +UEInformationTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-FiveG-S-TMSI CRITICALITY reject TYPE FiveG-S-TMSI PRESENCE mandatory }| + { ID id-NB-IoT-UEPriority CRITICALITY ignore TYPE NB-IoT-UEPriority PRESENCE optional }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-S-NSSAI CRITICALITY ignore TYPE S-NSSAI PRESENCE optional }| + { ID id-AllowedNSSAI CRITICALITY ignore TYPE AllowedNSSAI PRESENCE optional }| + { ID id-UE-DifferentiationInfo CRITICALITY ignore TYPE UE-DifferentiationInfo PRESENCE optional }| + { ID id-MaskedIMEISV CRITICALITY ignore TYPE MaskedIMEISV PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- RAN CP Relocation Indication +-- +-- ************************************************************** + +RANCPRelocationIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { RANCPRelocationIndicationIEs} }, + ... +} + +RANCPRelocationIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-FiveG-S-TMSI CRITICALITY reject TYPE FiveG-S-TMSI PRESENCE mandatory }| + { ID id-EUTRA-CGI CRITICALITY ignore TYPE EUTRA-CGI PRESENCE mandatory }| + { ID id-TAI CRITICALITY ignore TYPE TAI PRESENCE mandatory }| + { ID id-UL-CP-SecurityInformation CRITICALITY reject TYPE UL-CP-SecurityInformation PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE MOBILITY MANAGEMENT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Handover Preparation Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- HANDOVER REQUIRED +-- +-- ************************************************************** + +HandoverRequired ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {HandoverRequiredIEs} }, + ... +} + +HandoverRequiredIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-HandoverType CRITICALITY reject TYPE HandoverType PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TargetID CRITICALITY reject TYPE TargetID PRESENCE mandatory }| + { ID id-DirectForwardingPathAvailability CRITICALITY ignore TYPE DirectForwardingPathAvailability PRESENCE optional }| + { ID id-PDUSessionResourceListHORqd CRITICALITY reject TYPE PDUSessionResourceListHORqd PRESENCE mandatory }| + { ID id-SourceToTarget-TransparentContainer CRITICALITY reject TYPE SourceToTarget-TransparentContainer PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER COMMAND +-- +-- ************************************************************** + +HandoverCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {HandoverCommandIEs} }, + ... +} + +HandoverCommandIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-HandoverType CRITICALITY reject TYPE HandoverType PRESENCE mandatory }| + { ID id-NASSecurityParametersFromNGRAN CRITICALITY reject TYPE NASSecurityParametersFromNGRAN PRESENCE conditional }| +-- The above IE shall be present if the HandoverType IE is set to the value “5GStoEPPS” or “5GStoUTRAN” + { ID id-PDUSessionResourceHandoverList CRITICALITY ignore TYPE PDUSessionResourceHandoverList PRESENCE optional }| + { ID id-PDUSessionResourceToReleaseListHOCmd CRITICALITY ignore TYPE PDUSessionResourceToReleaseListHOCmd PRESENCE optional }| + { ID id-TargetToSource-TransparentContainer CRITICALITY reject TYPE TargetToSource-TransparentContainer PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- HANDOVER PREPARATION FAILURE +-- +-- ************************************************************** + +HandoverPreparationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {HandoverPreparationFailureIEs} }, + ... +} + +HandoverPreparationFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-TargettoSource-Failure-TransparentContainer CRITICALITY ignore TYPE TargettoSource-Failure-TransparentContainer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Handover Resource Allocation Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- HANDOVER REQUEST +-- +-- ************************************************************** + +HandoverRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {HandoverRequestIEs} }, + ... +} + +HandoverRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-HandoverType CRITICALITY reject TYPE HandoverType PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-UEAggregateMaximumBitRate CRITICALITY reject TYPE UEAggregateMaximumBitRate PRESENCE mandatory }| + { ID id-CoreNetworkAssistanceInformationForInactive CRITICALITY ignore TYPE CoreNetworkAssistanceInformationForInactive PRESENCE optional }| + { ID id-UESecurityCapabilities CRITICALITY reject TYPE UESecurityCapabilities PRESENCE mandatory }| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE mandatory }| + { ID id-NewSecurityContextInd CRITICALITY reject TYPE NewSecurityContextInd PRESENCE optional }| + { ID id-NASC CRITICALITY reject TYPE NAS-PDU PRESENCE optional }| + { ID id-PDUSessionResourceSetupListHOReq CRITICALITY reject TYPE PDUSessionResourceSetupListHOReq PRESENCE mandatory }| + { ID id-AllowedNSSAI CRITICALITY reject TYPE AllowedNSSAI PRESENCE mandatory }| + { ID id-TraceActivation CRITICALITY ignore TYPE TraceActivation PRESENCE optional }| + { ID id-MaskedIMEISV CRITICALITY ignore TYPE MaskedIMEISV PRESENCE optional }| + { ID id-SourceToTarget-TransparentContainer CRITICALITY reject TYPE SourceToTarget-TransparentContainer PRESENCE mandatory }| + { ID id-MobilityRestrictionList CRITICALITY ignore TYPE MobilityRestrictionList PRESENCE optional }| + { ID id-LocationReportingRequestType CRITICALITY ignore TYPE LocationReportingRequestType PRESENCE optional }| + { ID id-RRCInactiveTransitionReportRequest CRITICALITY ignore TYPE RRCInactiveTransitionReportRequest PRESENCE optional }| + { ID id-GUAMI CRITICALITY reject TYPE GUAMI PRESENCE mandatory }| + { ID id-RedirectionVoiceFallback CRITICALITY ignore TYPE RedirectionVoiceFallback PRESENCE optional }| + { ID id-CNAssistedRANTuning CRITICALITY ignore TYPE CNAssistedRANTuning PRESENCE optional }| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional }| + { ID id-IAB-Authorized CRITICALITY reject TYPE IAB-Authorized PRESENCE optional }| + { ID id-Enhanced-CoverageRestriction CRITICALITY ignore TYPE Enhanced-CoverageRestriction PRESENCE optional }| + { ID id-UE-DifferentiationInfo CRITICALITY ignore TYPE UE-DifferentiationInfo PRESENCE optional }| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-LTEV2XServicesAuthorized CRITICALITY ignore TYPE LTEV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTEUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-CEmodeBrestricted CRITICALITY ignore TYPE CEmodeBrestricted PRESENCE optional }| + { ID id-UE-UP-CIoT-Support CRITICALITY ignore TYPE UE-UP-CIoT-Support PRESENCE optional }| + { ID id-ManagementBasedMDTPLMNList CRITICALITY ignore TYPE MDTPLMNList PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }| + { ID id-Extended-ConnectedTime CRITICALITY ignore TYPE Extended-ConnectedTime PRESENCE optional }| + { ID id-TimeSyncAssistanceInfo CRITICALITY ignore TYPE TimeSyncAssistanceInfo PRESENCE optional }| + { ID id-UESliceMaximumBitRateList CRITICALITY ignore TYPE UESliceMaximumBitRateList PRESENCE optional }| + { ID id-FiveG-ProSeAuthorized CRITICALITY ignore TYPE FiveG-ProSeAuthorized PRESENCE optional }| + { ID id-FiveG-ProSeUEPC5AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-FiveG-ProSePC5QoSParameters CRITICALITY ignore TYPE FiveG-ProSePC5QoSParameters PRESENCE optional }| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional }| + { ID id-NR-A2X-ServicesAuthorized CRITICALITY ignore TYPE NR-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-LTE-A2X-ServicesAuthorized CRITICALITY ignore TYPE LTE-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-NR-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTE-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-A2X-PC5-QoS-Parameters CRITICALITY ignore TYPE A2X-PC5-QoS-Parameters PRESENCE optional }| + { ID id-MobileIAB-Authorized CRITICALITY ignore TYPE MobileIAB-Authorized PRESENCE optional }| + { ID id-NoPDUSessionIndication CRITICALITY ignore TYPE NoPDUSessionIndication PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }| + { ID id-SLPositioningRangingServiceInfo CRITICALITY ignore TYPE SLPositioningRangingServiceInfo PRESENCE optional }| + { ID id-AMF-UE-NGAP-ID2 CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE optional }| + { ID id-Target-RAN-Node-ID CRITICALITY ignore TYPE GlobalRANNodeID PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER REQUEST ACKNOWLEDGE +-- +-- ************************************************************** + +HandoverRequestAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {HandoverRequestAcknowledgeIEs} }, + ... +} + +HandoverRequestAcknowledgeIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceAdmittedList CRITICALITY ignore TYPE PDUSessionResourceAdmittedList PRESENCE mandatory }| + { ID id-PDUSessionResourceFailedToSetupListHOAck CRITICALITY ignore TYPE PDUSessionResourceFailedToSetupListHOAck PRESENCE optional }| + { ID id-TargetToSource-TransparentContainer CRITICALITY reject TYPE TargetToSource-TransparentContainer PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-NPN-AccessInformation CRITICALITY reject TYPE NPN-AccessInformation PRESENCE optional }| + { ID id-RedCapIndication CRITICALITY ignore TYPE RedCapIndication PRESENCE optional }| + { ID id-ERedCapIndication CRITICALITY ignore TYPE ERedCapIndication PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- HANDOVER FAILURE +-- +-- ************************************************************** + +HandoverFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverFailureIEs} }, + ... +} + +HandoverFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-TargettoSource-Failure-TransparentContainer CRITICALITY ignore TYPE TargettoSource-Failure-TransparentContainer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Handover Notification Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- HANDOVER NOTIFY +-- +-- ************************************************************** + +HandoverNotify ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverNotifyIEs} }, + ... +} + +HandoverNotifyIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE mandatory }| + { ID id-NotifySourceNGRANNode CRITICALITY ignore TYPE NotifySourceNGRANNode PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Path Switch Request Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PATH SWITCH REQUEST +-- +-- ************************************************************** + +PathSwitchRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PathSwitchRequestIEs} }, + ... +} + +PathSwitchRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-SourceAMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE mandatory }| + { ID id-UESecurityCapabilities CRITICALITY ignore TYPE UESecurityCapabilities PRESENCE mandatory }| + { ID id-PDUSessionResourceToBeSwitchedDLList CRITICALITY reject TYPE PDUSessionResourceToBeSwitchedDLList PRESENCE mandatory }| + { ID id-PDUSessionResourceFailedToSetupListPSReq CRITICALITY ignore TYPE PDUSessionResourceFailedToSetupListPSReq PRESENCE optional }| + { ID id-RRC-Resume-Cause CRITICALITY ignore TYPE RRCEstablishmentCause PRESENCE optional }| + { ID id-RedCapIndication CRITICALITY ignore TYPE RedCapIndication PRESENCE optional }| + { ID id-ERedCapIndication CRITICALITY ignore TYPE ERedCapIndication PRESENCE optional }| + { ID id-SourceAMF-GUAMI CRITICALITY ignore TYPE GUAMI PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- PATH SWITCH REQUEST ACKNOWLEDGE +-- +-- ************************************************************** + +PathSwitchRequestAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PathSwitchRequestAcknowledgeIEs} }, + ... +} + +PathSwitchRequestAcknowledgeIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UESecurityCapabilities CRITICALITY reject TYPE UESecurityCapabilities PRESENCE optional }| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE mandatory }| + { ID id-NewSecurityContextInd CRITICALITY reject TYPE NewSecurityContextInd PRESENCE optional }| + { ID id-PDUSessionResourceSwitchedList CRITICALITY ignore TYPE PDUSessionResourceSwitchedList PRESENCE mandatory }| + { ID id-PDUSessionResourceReleasedListPSAck CRITICALITY ignore TYPE PDUSessionResourceReleasedListPSAck PRESENCE optional }| + { ID id-AllowedNSSAI CRITICALITY reject TYPE AllowedNSSAI PRESENCE mandatory }| + { ID id-CoreNetworkAssistanceInformationForInactive CRITICALITY ignore TYPE CoreNetworkAssistanceInformationForInactive PRESENCE optional }| + { ID id-RRCInactiveTransitionReportRequest CRITICALITY ignore TYPE RRCInactiveTransitionReportRequest PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-RedirectionVoiceFallback CRITICALITY ignore TYPE RedirectionVoiceFallback PRESENCE optional }| + { ID id-CNAssistedRANTuning CRITICALITY ignore TYPE CNAssistedRANTuning PRESENCE optional }| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional }| + { ID id-Enhanced-CoverageRestriction CRITICALITY ignore TYPE Enhanced-CoverageRestriction PRESENCE optional }| + { ID id-Extended-ConnectedTime CRITICALITY ignore TYPE Extended-ConnectedTime PRESENCE optional }| + { ID id-UE-DifferentiationInfo CRITICALITY ignore TYPE UE-DifferentiationInfo PRESENCE optional }| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-LTEV2XServicesAuthorized CRITICALITY ignore TYPE LTEV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTEUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-CEmodeBrestricted CRITICALITY ignore TYPE CEmodeBrestricted PRESENCE optional }| + { ID id-UE-UP-CIoT-Support CRITICALITY ignore TYPE UE-UP-CIoT-Support PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }| + { ID id-ManagementBasedMDTPLMNList CRITICALITY ignore TYPE MDTPLMNList PRESENCE optional }| + { ID id-TimeSyncAssistanceInfo CRITICALITY ignore TYPE TimeSyncAssistanceInfo PRESENCE optional }| + { ID id-FiveG-ProSeAuthorized CRITICALITY ignore TYPE FiveG-ProSeAuthorized PRESENCE optional }| + { ID id-FiveG-ProSeUEPC5AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-FiveG-ProSePC5QoSParameters CRITICALITY ignore TYPE FiveG-ProSePC5QoSParameters PRESENCE optional }| + { ID id-ManagementBasedMDTPLMNModificationList CRITICALITY ignore TYPE MDTPLMNModificationList PRESENCE optional }| + { ID id-IAB-Authorized CRITICALITY ignore TYPE IAB-Authorized PRESENCE optional }| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional }| + { ID id-NR-A2X-ServicesAuthorized CRITICALITY ignore TYPE NR-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-LTE-A2X-ServicesAuthorized CRITICALITY ignore TYPE LTE-A2X-ServicesAuthorized PRESENCE optional }| + { ID id-NR-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-LTE-A2X-UE-PC5-AggregateMaximumBitRate CRITICALITY ignore TYPE LTEUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-A2X-PC5-QoS-Parameters CRITICALITY ignore TYPE A2X-PC5-QoS-Parameters PRESENCE optional }| + { ID id-MobileIAB-Authorized CRITICALITY ignore TYPE MobileIAB-Authorized PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }| + { ID id-SLPositioningRangingServiceInfo CRITICALITY ignore TYPE SLPositioningRangingServiceInfo PRESENCE optional }| + { ID id-AMF-UE-NGAP-ID2 CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- PATH SWITCH REQUEST FAILURE +-- +-- ************************************************************** + +PathSwitchRequestFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PathSwitchRequestFailureIEs} }, + ... +} + +PathSwitchRequestFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceReleasedListPSFail CRITICALITY ignore TYPE PDUSessionResourceReleasedListPSFail PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Handover Cancellation Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- HANDOVER CANCEL +-- +-- ************************************************************** + +HandoverCancel ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverCancelIEs} }, + ... +} + +HandoverCancelIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER CANCEL ACKNOWLEDGE +-- +-- ************************************************************** + +HandoverCancelAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverCancelAcknowledgeIEs} }, + ... +} + +HandoverCancelAcknowledgeIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER SUCCESS ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- HANDOVER SUCCESS +-- +-- ************************************************************** + +HandoverSuccess ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverSuccessIEs} }, + ... +} + +HandoverSuccessIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UPLINK RAN EARLY STATUS TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Uplink RAN Early Status Transfer +-- +-- ************************************************************** + +UplinkRANEarlyStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkRANEarlyStatusTransferIEs} }, + ... +} + +UplinkRANEarlyStatusTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-EarlyStatusTransfer-TransparentContainer CRITICALITY reject TYPE EarlyStatusTransfer-TransparentContainer PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- DOWNLINK RAN EARLY STATUS TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Downlink RAN Early Status Transfer +-- +-- ************************************************************** + +DownlinkRANEarlyStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkRANEarlyStatusTransferIEs} }, + ... +} + +DownlinkRANEarlyStatusTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-EarlyStatusTransfer-TransparentContainer CRITICALITY reject TYPE EarlyStatusTransfer-TransparentContainer PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- Uplink RAN Status Transfer Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UPLINK RAN STATUS TRANSFER +-- +-- ************************************************************** + +UplinkRANStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkRANStatusTransferIEs} }, + ... +} + +UplinkRANStatusTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RANStatusTransfer-TransparentContainer CRITICALITY reject TYPE RANStatusTransfer-TransparentContainer PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Downlink RAN Status Transfer Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- DOWNLINK RAN STATUS TRANSFER +-- +-- ************************************************************** + +DownlinkRANStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkRANStatusTransferIEs} }, + ... +} + +DownlinkRANStatusTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RANStatusTransfer-TransparentContainer CRITICALITY reject TYPE RANStatusTransfer-TransparentContainer PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- PAGING ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PAGING +-- +-- ************************************************************** + +Paging ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PagingIEs} }, + ... +} + +PagingIEs NGAP-PROTOCOL-IES ::= { + { ID id-UEPagingIdentity CRITICALITY ignore TYPE UEPagingIdentity PRESENCE mandatory }| + { ID id-PagingDRX CRITICALITY ignore TYPE PagingDRX PRESENCE optional }| + { ID id-TAIListForPaging CRITICALITY ignore TYPE TAIListForPaging PRESENCE mandatory }| + { ID id-PagingPriority CRITICALITY ignore TYPE PagingPriority PRESENCE optional }| + { ID id-UERadioCapabilityForPaging CRITICALITY ignore TYPE UERadioCapabilityForPaging PRESENCE optional }| + { ID id-PagingOrigin CRITICALITY ignore TYPE PagingOrigin PRESENCE optional }| + { ID id-AssistanceDataForPaging CRITICALITY ignore TYPE AssistanceDataForPaging PRESENCE optional }| + { ID id-NB-IoT-Paging-eDRXInfo CRITICALITY ignore TYPE NB-IoT-Paging-eDRXInfo PRESENCE optional }| + { ID id-NB-IoT-PagingDRX CRITICALITY ignore TYPE NB-IoT-PagingDRX PRESENCE optional }| + { ID id-Enhanced-CoverageRestriction CRITICALITY ignore TYPE Enhanced-CoverageRestriction PRESENCE optional }| + { ID id-WUS-Assistance-Information CRITICALITY ignore TYPE WUS-Assistance-Information PRESENCE optional }| + { ID id-EUTRA-PagingeDRXInformation CRITICALITY ignore TYPE EUTRA-PagingeDRXInformation PRESENCE optional }| + { ID id-CEmodeBrestricted CRITICALITY ignore TYPE CEmodeBrestricted PRESENCE optional }| + { ID id-NR-PagingeDRXInformation CRITICALITY ignore TYPE NR-PagingeDRXInformation PRESENCE optional }| + { ID id-PagingCause CRITICALITY ignore TYPE PagingCause PRESENCE optional }| + { ID id-PEIPSassistanceInformation CRITICALITY ignore TYPE PEIPSassistanceInformation PRESENCE optional }| + { ID id-LPWUSPSAssistanceInformation CRITICALITY ignore TYPE LPWUSPSAssistanceInformation PRESENCE optional }| + { ID id-LPWUSDisableIndication CRITICALITY ignore TYPE LPWUSDisableIndication PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- NAS TRANSPORT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- INITIAL UE MESSAGE +-- +-- ************************************************************** + +InitialUEMessage ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InitialUEMessage-IEs} }, + ... +} + +InitialUEMessage-IEs NGAP-PROTOCOL-IES ::= { + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-NAS-PDU CRITICALITY reject TYPE NAS-PDU PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY reject TYPE UserLocationInformation PRESENCE mandatory }| + { ID id-RRCEstablishmentCause CRITICALITY ignore TYPE RRCEstablishmentCause PRESENCE mandatory }| + { ID id-FiveG-S-TMSI CRITICALITY reject TYPE FiveG-S-TMSI PRESENCE optional }| + { ID id-AMFSetID CRITICALITY ignore TYPE AMFSetID PRESENCE optional }| + { ID id-UEContextRequest CRITICALITY ignore TYPE UEContextRequest PRESENCE optional }| + { ID id-AllowedNSSAI CRITICALITY reject TYPE AllowedNSSAI PRESENCE optional }| + { ID id-SourceToTarget-AMFInformationReroute CRITICALITY ignore TYPE SourceToTarget-AMFInformationReroute PRESENCE optional }| + { ID id-SelectedPLMNIdentity CRITICALITY ignore TYPE PLMNIdentity PRESENCE optional }| + { ID id-IABNodeIndication CRITICALITY reject TYPE IABNodeIndication PRESENCE optional }| + { ID id-CEmodeBSupport-Indicator CRITICALITY reject TYPE CEmodeBSupport-Indicator PRESENCE optional }| + { ID id-LTEM-Indication CRITICALITY ignore TYPE LTEM-Indication PRESENCE optional }| + { ID id-EDT-Session CRITICALITY ignore TYPE EDT-Session PRESENCE optional }| + { ID id-AuthenticatedIndication CRITICALITY ignore TYPE AuthenticatedIndication PRESENCE optional }| + { ID id-NPN-AccessInformation CRITICALITY reject TYPE NPN-AccessInformation PRESENCE optional }| + { ID id-RedCapIndication CRITICALITY ignore TYPE RedCapIndication PRESENCE optional }| + { ID id-SelectedNID CRITICALITY ignore TYPE NID PRESENCE optional }| + { ID id-MobileIABNodeIndication CRITICALITY reject TYPE MobileIABNodeIndication PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }| + { ID id-ERedCapIndication CRITICALITY ignore TYPE ERedCapIndication PRESENCE optional }| + { ID id-AUN3DeviceAccessInfo CRITICALITY ignore TYPE AUN3DeviceAccessInfo PRESENCE optional }| + { ID id-GUAMI CRITICALITY ignore TYPE GUAMI PRESENCE optional }| + { ID id-GUAMIType CRITICALITY ignore TYPE GUAMIType PRESENCE optional }| + { ID id-RequestedNSSAI CRITICALITY ignore TYPE RequestedNSSAI PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- DOWNLINK NAS TRANSPORT +-- +-- ************************************************************** + +DownlinkNASTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkNASTransport-IEs} }, + ... +} + +DownlinkNASTransport-IEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-OldAMF CRITICALITY reject TYPE AMFName PRESENCE optional }| + { ID id-RANPagingPriority CRITICALITY ignore TYPE RANPagingPriority PRESENCE optional }| + { ID id-NAS-PDU CRITICALITY reject TYPE NAS-PDU PRESENCE mandatory }| + { ID id-MobilityRestrictionList CRITICALITY ignore TYPE MobilityRestrictionList PRESENCE optional }| + { ID id-IndexToRFSP CRITICALITY ignore TYPE IndexToRFSP PRESENCE optional }| + { ID id-UEAggregateMaximumBitRate CRITICALITY ignore TYPE UEAggregateMaximumBitRate PRESENCE optional }| + { ID id-AllowedNSSAI CRITICALITY reject TYPE AllowedNSSAI PRESENCE optional }| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional }| + { ID id-Enhanced-CoverageRestriction CRITICALITY ignore TYPE Enhanced-CoverageRestriction PRESENCE optional }| + { ID id-Extended-ConnectedTime CRITICALITY ignore TYPE Extended-ConnectedTime PRESENCE optional }| + { ID id-UE-DifferentiationInfo CRITICALITY ignore TYPE UE-DifferentiationInfo PRESENCE optional }| + { ID id-CEmodeBrestricted CRITICALITY ignore TYPE CEmodeBrestricted PRESENCE optional }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-UECapabilityInfoRequest CRITICALITY ignore TYPE UECapabilityInfoRequest PRESENCE optional }| + { ID id-EndIndication CRITICALITY ignore TYPE EndIndication PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }| + { ID id-TargetNSSAIInformation CRITICALITY ignore TYPE TargetNSSAIInformation PRESENCE optional }| + { ID id-MaskedIMEISV CRITICALITY ignore TYPE MaskedIMEISV PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }| + { ID id-MobileIAB-Authorized CRITICALITY ignore TYPE MobileIAB-Authorized PRESENCE optional }| + { ID id-ExtendedOldAMF CRITICALITY ignore TYPE Extended-AMFName PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UPLINK NAS TRANSPORT +-- +-- ************************************************************** + +UplinkNASTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkNASTransport-IEs} }, + ... +} + +UplinkNASTransport-IEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-NAS-PDU CRITICALITY reject TYPE NAS-PDU PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE mandatory }| + { ID id-W-AGFIdentityInformation CRITICALITY reject TYPE OCTET STRING PRESENCE optional }| + { ID id-TNGFIdentityInformation CRITICALITY reject TYPE OCTET STRING PRESENCE optional }| + { ID id-TWIFIdentityInformation CRITICALITY reject TYPE OCTET STRING PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- NAS NON DELIVERY INDICATION +-- +-- ************************************************************** + +NASNonDeliveryIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NASNonDeliveryIndication-IEs} }, + ... +} + +NASNonDeliveryIndication-IEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-NAS-PDU CRITICALITY ignore TYPE NAS-PDU PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- REROUTE NAS REQUEST +-- +-- ************************************************************** + +RerouteNASRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {RerouteNASRequest-IEs} }, + ... +} + +RerouteNASRequest-IEs NGAP-PROTOCOL-IES ::= { + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE optional }| + { ID id-NGAP-Message CRITICALITY reject TYPE OCTET STRING PRESENCE mandatory }| + { ID id-AMFSetID CRITICALITY reject TYPE AMFSetID PRESENCE mandatory }| + { ID id-AllowedNSSAI CRITICALITY reject TYPE AllowedNSSAI PRESENCE optional }| + { ID id-SourceToTarget-AMFInformationReroute CRITICALITY ignore TYPE SourceToTarget-AMFInformationReroute PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- INTERFACE MANAGEMENT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- NG Removal Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- NG REMOVAL REQUEST +-- +-- ************************************************************** + +NGRemovalRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGRemovalRequestIEs} }, + ... +} + +NGRemovalRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-GlobalRANNodeID CRITICALITY reject TYPE GlobalRANNodeID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- NG REMOVAL RESPONSE +-- +-- ************************************************************** + +NGRemovalResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGRemovalResponseIEs} }, + ... +} + +NGRemovalResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMFName CRITICALITY reject TYPE AMFName PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-Extended-AMFName CRITICALITY ignore TYPE Extended-AMFName PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- NG REMOVAL FAILURE +-- +-- ************************************************************** + +NGRemovalFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGRemovalFailureIEs} }, + ... +} + +NGRemovalFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- NG Setup Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- NG SETUP REQUEST +-- +-- ************************************************************** + +NGSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGSetupRequestIEs} }, + ... +} + +NGSetupRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-GlobalRANNodeID CRITICALITY reject TYPE GlobalRANNodeID PRESENCE mandatory }| + { ID id-RANNodeName CRITICALITY ignore TYPE RANNodeName PRESENCE optional }| + { ID id-SupportedTAList CRITICALITY reject TYPE SupportedTAList PRESENCE mandatory }| + { ID id-DefaultPagingDRX CRITICALITY ignore TYPE PagingDRX PRESENCE mandatory }| + { ID id-UERetentionInformation CRITICALITY ignore TYPE UERetentionInformation PRESENCE optional }| + { ID id-NB-IoT-DefaultPagingDRX CRITICALITY ignore TYPE NB-IoT-DefaultPagingDRX PRESENCE optional }| + { ID id-Extended-RANNodeName CRITICALITY ignore TYPE Extended-RANNodeName PRESENCE optional }| + { ID id-AIoT-Support CRITICALITY reject TYPE AIoT-Support PRESENCE optional }| + { ID id-AdditionalULI CRITICALITY ignore TYPE AdditionalULI PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- NG SETUP RESPONSE +-- +-- ************************************************************** + +NGSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGSetupResponseIEs} }, + ... +} + +NGSetupResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMFName CRITICALITY reject TYPE AMFName PRESENCE mandatory }| + { ID id-ServedGUAMIList CRITICALITY reject TYPE ServedGUAMIList PRESENCE mandatory }| + { ID id-RelativeAMFCapacity CRITICALITY ignore TYPE RelativeAMFCapacity PRESENCE mandatory }| + { ID id-PLMNSupportList CRITICALITY reject TYPE PLMNSupportList PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-UERetentionInformation CRITICALITY ignore TYPE UERetentionInformation PRESENCE optional }| + { ID id-IAB-Supported CRITICALITY ignore TYPE IAB-Supported PRESENCE optional }| + { ID id-Extended-AMFName CRITICALITY ignore TYPE Extended-AMFName PRESENCE optional }| + { ID id-MobileIAB-Supported CRITICALITY ignore TYPE MobileIAB-Supported PRESENCE optional }| + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE optional }| + { ID id-AIOTFName CRITICALITY reject TYPE AIOTFName PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- NG SETUP FAILURE +-- +-- ************************************************************** + +NGSetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGSetupFailureIEs} }, + ... +} + +NGSetupFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- RAN Configuration Update Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- RAN CONFIGURATION UPDATE +-- +-- ************************************************************** + +RANConfigurationUpdate ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {RANConfigurationUpdateIEs} }, + ... +} + +RANConfigurationUpdateIEs NGAP-PROTOCOL-IES ::= { + { ID id-RANNodeName CRITICALITY ignore TYPE RANNodeName PRESENCE optional }| + { ID id-SupportedTAList CRITICALITY reject TYPE SupportedTAList PRESENCE optional }| + { ID id-DefaultPagingDRX CRITICALITY ignore TYPE PagingDRX PRESENCE optional }| + { ID id-GlobalRANNodeID CRITICALITY ignore TYPE GlobalRANNodeID PRESENCE optional }| + { ID id-NGRAN-TNLAssociationToRemoveList CRITICALITY reject TYPE NGRAN-TNLAssociationToRemoveList PRESENCE optional }| + { ID id-NB-IoT-DefaultPagingDRX CRITICALITY ignore TYPE NB-IoT-DefaultPagingDRX PRESENCE optional }| + { ID id-Extended-RANNodeName CRITICALITY ignore TYPE Extended-RANNodeName PRESENCE optional }| + { ID id-AdditionalULI CRITICALITY ignore TYPE AdditionalULI PRESENCE optional }| + { ID id-AIoT-Support CRITICALITY reject TYPE AIoT-Support PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- RAN CONFIGURATION UPDATE ACKNOWLEDGE +-- +-- ************************************************************** + +RANConfigurationUpdateAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {RANConfigurationUpdateAcknowledgeIEs} }, + ... +} + +RANConfigurationUpdateAcknowledgeIEs NGAP-PROTOCOL-IES ::= { + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- RAN CONFIGURATION UPDATE FAILURE +-- +-- ************************************************************** + +RANConfigurationUpdateFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {RANConfigurationUpdateFailureIEs} }, + ... +} + +RANConfigurationUpdateFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, +... +} + +-- ************************************************************** +-- +-- AMF Configuration Update Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- AMF CONFIGURATION UPDATE +-- +-- ************************************************************** + +AMFConfigurationUpdate ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AMFConfigurationUpdateIEs} }, + ... +} + +AMFConfigurationUpdateIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMFName CRITICALITY reject TYPE AMFName PRESENCE optional }| + { ID id-ServedGUAMIList CRITICALITY reject TYPE ServedGUAMIList PRESENCE optional }| + { ID id-RelativeAMFCapacity CRITICALITY ignore TYPE RelativeAMFCapacity PRESENCE optional }| + { ID id-PLMNSupportList CRITICALITY reject TYPE PLMNSupportList PRESENCE optional }| + { ID id-AMF-TNLAssociationToAddList CRITICALITY ignore TYPE AMF-TNLAssociationToAddList PRESENCE optional }| + { ID id-AMF-TNLAssociationToRemoveList CRITICALITY ignore TYPE AMF-TNLAssociationToRemoveList PRESENCE optional }| + { ID id-AMF-TNLAssociationToUpdateList CRITICALITY ignore TYPE AMF-TNLAssociationToUpdateList PRESENCE optional }| + { ID id-Extended-AMFName CRITICALITY ignore TYPE Extended-AMFName PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- AMF CONFIGURATION UPDATE ACKNOWLEDGE +-- +-- ************************************************************** + +AMFConfigurationUpdateAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AMFConfigurationUpdateAcknowledgeIEs} }, + ... +} + +AMFConfigurationUpdateAcknowledgeIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-TNLAssociationSetupList CRITICALITY ignore TYPE AMF-TNLAssociationSetupList PRESENCE optional }| + { ID id-AMF-TNLAssociationFailedToSetupList CRITICALITY ignore TYPE TNLAssociationList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- AMF CONFIGURATION UPDATE FAILURE +-- +-- ************************************************************** + +AMFConfigurationUpdateFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AMFConfigurationUpdateFailureIEs} }, + ... +} + +AMFConfigurationUpdateFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- AMF Status Indication Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- AMF STATUS INDICATION +-- +-- ************************************************************** + +AMFStatusIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AMFStatusIndicationIEs} }, + ... +} + +AMFStatusIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-UnavailableGUAMIList CRITICALITY reject TYPE UnavailableGUAMIList PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- NG Reset Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- NG RESET +-- +-- ************************************************************** + +NGReset ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGResetIEs} }, + ... +} + +NGResetIEs NGAP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-ResetType CRITICALITY reject TYPE ResetType PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- NG RESET ACKNOWLEDGE +-- +-- ************************************************************** + +NGResetAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {NGResetAcknowledgeIEs} }, + ... +} + +NGResetAcknowledgeIEs NGAP-PROTOCOL-IES ::= { + { ID id-UE-associatedLogicalNG-connectionList CRITICALITY ignore TYPE UE-associatedLogicalNG-connectionList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Error Indication Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- ERROR INDICATION +-- +-- ************************************************************** + +ErrorIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ErrorIndicationIEs} }, + ... +} + +ErrorIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE optional }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-FiveG-S-TMSI CRITICALITY ignore TYPE FiveG-S-TMSI PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- OVERLOAD START +-- +-- ************************************************************** + +OverloadStart ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {OverloadStartIEs} }, + ... +} + +OverloadStartIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMFOverloadResponse CRITICALITY reject TYPE OverloadResponse PRESENCE optional }| + { ID id-AMFTrafficLoadReductionIndication CRITICALITY ignore TYPE TrafficLoadReductionIndication PRESENCE optional }| + { ID id-OverloadStartNSSAIList CRITICALITY ignore TYPE OverloadStartNSSAIList PRESENCE optional }| + { ID id-GUAMIList CRITICALITY ignore TYPE GUAMIList PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- OVERLOAD STOP +-- +-- ************************************************************** + +OverloadStop ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {OverloadStopIEs} }, + ... +} + +OverloadStopIEs NGAP-PROTOCOL-IES ::= { + { ID id-GUAMIList CRITICALITY ignore TYPE GUAMIList PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- CONFIGURATION TRANSFER ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UPLINK RAN CONFIGURATION TRANSFER +-- +-- ************************************************************** + +UplinkRANConfigurationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkRANConfigurationTransferIEs} }, + ... +} + +UplinkRANConfigurationTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-SONConfigurationTransferUL CRITICALITY ignore TYPE SONConfigurationTransfer PRESENCE optional }| + { ID id-ENDC-SONConfigurationTransferUL CRITICALITY ignore TYPE EN-DCSONConfigurationTransfer PRESENCE optional }| + { ID id-IntersystemSONConfigurationTransferUL CRITICALITY ignore TYPE IntersystemSONConfigurationTransfer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- DOWNLINK RAN CONFIGURATION TRANSFER +-- +-- ************************************************************** + +DownlinkRANConfigurationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkRANConfigurationTransferIEs} }, + ... +} + +DownlinkRANConfigurationTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-SONConfigurationTransferDL CRITICALITY ignore TYPE SONConfigurationTransfer PRESENCE optional }| + { ID id-ENDC-SONConfigurationTransferDL CRITICALITY ignore TYPE EN-DCSONConfigurationTransfer PRESENCE optional }| + { ID id-IntersystemSONConfigurationTransferDL CRITICALITY ignore TYPE IntersystemSONConfigurationTransfer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- WARNING MESSAGE TRANSMISSION ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Write-Replace Warning Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- WRITE-REPLACE WARNING REQUEST +-- +-- ************************************************************** + +WriteReplaceWarningRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {WriteReplaceWarningRequestIEs} }, + ... +} + +WriteReplaceWarningRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory }| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory }| + { ID id-WarningAreaList CRITICALITY ignore TYPE WarningAreaList PRESENCE optional }| + { ID id-RepetitionPeriod CRITICALITY reject TYPE RepetitionPeriod PRESENCE mandatory }| + { ID id-NumberOfBroadcastsRequested CRITICALITY reject TYPE NumberOfBroadcastsRequested PRESENCE mandatory }| + { ID id-WarningType CRITICALITY ignore TYPE WarningType PRESENCE optional }| + { ID id-WarningSecurityInfo CRITICALITY ignore TYPE WarningSecurityInfo PRESENCE optional }| + { ID id-DataCodingScheme CRITICALITY ignore TYPE DataCodingScheme PRESENCE optional }| + { ID id-WarningMessageContents CRITICALITY ignore TYPE WarningMessageContents PRESENCE optional }| + { ID id-ConcurrentWarningMessageInd CRITICALITY reject TYPE ConcurrentWarningMessageInd PRESENCE optional }| + { ID id-WarningAreaCoordinates CRITICALITY ignore TYPE WarningAreaCoordinates PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- WRITE-REPLACE WARNING RESPONSE +-- +-- ************************************************************** + +WriteReplaceWarningResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {WriteReplaceWarningResponseIEs} }, + ... +} + +WriteReplaceWarningResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory }| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory }| + { ID id-BroadcastCompletedAreaList CRITICALITY ignore TYPE BroadcastCompletedAreaList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PWS Cancel Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PWS CANCEL REQUEST +-- +-- ************************************************************** + +PWSCancelRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PWSCancelRequestIEs} }, + ... +} + +PWSCancelRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory }| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory }| + { ID id-WarningAreaList CRITICALITY ignore TYPE WarningAreaList PRESENCE optional }| + { ID id-CancelAllWarningMessages CRITICALITY reject TYPE CancelAllWarningMessages PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PWS CANCEL RESPONSE +-- +-- ************************************************************** + +PWSCancelResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PWSCancelResponseIEs} }, + ... +} + +PWSCancelResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory }| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory }| + { ID id-BroadcastCancelledAreaList CRITICALITY ignore TYPE BroadcastCancelledAreaList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PWS Restart Indication Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PWS RESTART INDICATION +-- +-- ************************************************************** + +PWSRestartIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PWSRestartIndicationIEs} }, + ... +} + +PWSRestartIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-CellIDListForRestart CRITICALITY reject TYPE CellIDListForRestart PRESENCE mandatory }| + { ID id-GlobalRANNodeID CRITICALITY reject TYPE GlobalRANNodeID PRESENCE mandatory }| + { ID id-TAIListForRestart CRITICALITY reject TYPE TAIListForRestart PRESENCE mandatory }| + { ID id-EmergencyAreaIDListForRestart CRITICALITY reject TYPE EmergencyAreaIDListForRestart PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PWS Failure Indication Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PWS FAILURE INDICATION +-- +-- ************************************************************** + +PWSFailureIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {PWSFailureIndicationIEs} }, + ... +} + +PWSFailureIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-PWSFailedCellIDList CRITICALITY reject TYPE PWSFailedCellIDList PRESENCE mandatory }| + { ID id-GlobalRANNodeID CRITICALITY reject TYPE GlobalRANNodeID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- NRPPA TRANSPORT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- DOWNLINK UE ASSOCIATED NRPPA TRANSPORT +-- +-- ************************************************************** + +DownlinkUEAssociatedNRPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkUEAssociatedNRPPaTransportIEs} }, + ... +} + +DownlinkUEAssociatedNRPPaTransportIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RoutingID CRITICALITY reject TYPE RoutingID PRESENCE mandatory }| + { ID id-NRPPa-PDU CRITICALITY reject TYPE NRPPa-PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UPLINK UE ASSOCIATED NRPPA TRANSPORT +-- +-- ************************************************************** + +UplinkUEAssociatedNRPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkUEAssociatedNRPPaTransportIEs} }, + ... +} + +UplinkUEAssociatedNRPPaTransportIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RoutingID CRITICALITY reject TYPE RoutingID PRESENCE mandatory }| + { ID id-NRPPa-PDU CRITICALITY reject TYPE NRPPa-PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- DOWNLINK NON UE ASSOCIATED NRPPA TRANSPORT +-- +-- ************************************************************** + +DownlinkNonUEAssociatedNRPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkNonUEAssociatedNRPPaTransportIEs} }, + ... +} + +DownlinkNonUEAssociatedNRPPaTransportIEs NGAP-PROTOCOL-IES ::= { + { ID id-RoutingID CRITICALITY reject TYPE RoutingID PRESENCE mandatory }| + { ID id-NRPPa-PDU CRITICALITY reject TYPE NRPPa-PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UPLINK NON UE ASSOCIATED NRPPA TRANSPORT +-- +-- ************************************************************** + +UplinkNonUEAssociatedNRPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkNonUEAssociatedNRPPaTransportIEs} }, + ... +} + +UplinkNonUEAssociatedNRPPaTransportIEs NGAP-PROTOCOL-IES ::= { + { ID id-RoutingID CRITICALITY reject TYPE RoutingID PRESENCE mandatory }| + { ID id-NRPPa-PDU CRITICALITY reject TYPE NRPPa-PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- TRACE ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- TRACE START +-- +-- ************************************************************** + +TraceStart ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {TraceStartIEs} }, + ... +} + +TraceStartIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-TraceActivation CRITICALITY ignore TYPE TraceActivation PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- TRACE FAILURE INDICATION +-- +-- ************************************************************** + +TraceFailureIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {TraceFailureIndicationIEs} }, + ... +} + +TraceFailureIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-NGRANTraceID CRITICALITY ignore TYPE NGRANTraceID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- DEACTIVATE TRACE +-- +-- ************************************************************** + +DeactivateTrace ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DeactivateTraceIEs} }, + ... +} + +DeactivateTraceIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-NGRANTraceID CRITICALITY ignore TYPE NGRANTraceID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- CELL TRAFFIC TRACE +-- +-- ************************************************************** + +CellTrafficTrace ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {CellTrafficTraceIEs} }, + ... +} + +CellTrafficTraceIEs NGAP-PROTOCOL-IES ::= { + {ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + {ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + {ID id-NGRANTraceID CRITICALITY ignore TYPE NGRANTraceID PRESENCE mandatory }| + {ID id-NGRAN-CGI CRITICALITY ignore TYPE NGRAN-CGI PRESENCE mandatory }| + {ID id-TraceCollectionEntityIPAddress CRITICALITY ignore TYPE TransportLayerAddress PRESENCE mandatory }| + {ID id-PrivacyIndicator CRITICALITY ignore TYPE PrivacyIndicator PRESENCE optional }| + {ID id-TraceCollectionEntityURI CRITICALITY ignore TYPE URI-address PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- LOCATION REPORTING ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- LOCATION REPORTING CONTROL +-- +-- ************************************************************** + +LocationReportingControl ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {LocationReportingControlIEs} }, + ... +} + +LocationReportingControlIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-LocationReportingRequestType CRITICALITY ignore TYPE LocationReportingRequestType PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- LOCATION REPORTING FAILURE INDICATION +-- +-- ************************************************************** + +LocationReportingFailureIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {LocationReportingFailureIndicationIEs} }, + ... +} + +LocationReportingFailureIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-Aerial-UE-FlightInformationOngoingReporting-failed CRITICALITY ignore TYPE Aerial-UE-FlightInformationOngoingReporting-failed PRESENCE optional}, + ... +} + + +Aerial-UE-FlightInformationOngoingReporting-failed::= ENUMERATED { + true, + ... +} + +-- ************************************************************** +-- +-- LOCATION REPORT +-- +-- ************************************************************** + +LocationReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {LocationReportIEs} }, + ... +} + +LocationReportIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE mandatory }| + { ID id-UEPresenceInAreaOfInterestList CRITICALITY ignore TYPE UEPresenceInAreaOfInterestList PRESENCE optional }| + { ID id-LocationReportingRequestType CRITICALITY ignore TYPE LocationReportingRequestType PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE TNLA BINDING ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE TNLA BINDING RELEASE REQUEST +-- +-- ************************************************************** + +UETNLABindingReleaseRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UETNLABindingReleaseRequestIEs} }, + ... +} + +UETNLABindingReleaseRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY MANAGEMENT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY INFO INDICATION +-- +-- ************************************************************** + +UERadioCapabilityInfoIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UERadioCapabilityInfoIndicationIEs} }, + ... +} + +UERadioCapabilityInfoIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE mandatory }| + { ID id-UERadioCapabilityForPaging CRITICALITY ignore TYPE UERadioCapabilityForPaging PRESENCE optional }| + { ID id-UERadioCapability-EUTRA-Format CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-XrDeviceWith2Rx CRITICALITY ignore TYPE XrDeviceWith2Rx PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Radio Capability Check Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY CHECK REQUEST +-- +-- ************************************************************** + +UERadioCapabilityCheckRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UERadioCapabilityCheckRequestIEs} }, + ... +} + +UERadioCapabilityCheckRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY CHECK RESPONSE +-- +-- ************************************************************** + +UERadioCapabilityCheckResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UERadioCapabilityCheckResponseIEs} }, + ... +} + +UERadioCapabilityCheckResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-IMSVoiceSupportIndicator CRITICALITY reject TYPE IMSVoiceSupportIndicator PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PRIVATE MESSAGE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- PRIVATE MESSAGE +-- +-- ************************************************************** + +PrivateMessage ::= SEQUENCE { + privateIEs PrivateIE-Container { { PrivateMessageIEs } }, + ... +} + +PrivateMessageIEs NGAP-PRIVATE-IES ::= { + ... +} + + +-- ************************************************************** +-- +-- DATA USAGE REPORTING ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- SECONDARY RAT DATA USAGE REPORT +-- +-- ************************************************************** + +SecondaryRATDataUsageReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {SecondaryRATDataUsageReportIEs} }, + ... +} + +SecondaryRATDataUsageReportIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PDUSessionResourceSecondaryRATUsageList CRITICALITY ignore TYPE PDUSessionResourceSecondaryRATUsageList PRESENCE mandatory }| + { ID id-HandoverFlag CRITICALITY ignore TYPE HandoverFlag PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- RIM INFORMATION TRANSFER ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UPLINK RIM INFORMATION TRANSFER +-- +-- ************************************************************** + +UplinkRIMInformationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkRIMInformationTransferIEs} }, + ... +} + +UplinkRIMInformationTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-RIMInformationTransfer CRITICALITY ignore TYPE RIMInformationTransfer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- DOWNLINK RIM INFORMATION TRANSFER +-- +-- ************************************************************** + +DownlinkRIMInformationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkRIMInformationTransferIEs} }, + ... +} + +DownlinkRIMInformationTransferIEs NGAP-PROTOCOL-IES ::= { + { ID id-RIMInformationTransfer CRITICALITY ignore TYPE RIMInformationTransfer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Connection Establishment Indication +-- +-- ************************************************************** + +ConnectionEstablishmentIndication::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ConnectionEstablishmentIndicationIEs} }, + ... +} + +ConnectionEstablishmentIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-EndIndication CRITICALITY ignore TYPE EndIndication PRESENCE optional }| + { ID id-S-NSSAI CRITICALITY ignore TYPE S-NSSAI PRESENCE optional }| + { ID id-AllowedNSSAI CRITICALITY ignore TYPE AllowedNSSAI PRESENCE optional }| + { ID id-UE-DifferentiationInfo CRITICALITY ignore TYPE UE-DifferentiationInfo PRESENCE optional }| + { ID id-DL-CP-SecurityInformation CRITICALITY ignore TYPE DL-CP-SecurityInformation PRESENCE optional }| + { ID id-NB-IoT-UEPriority CRITICALITY ignore TYPE NB-IoT-UEPriority PRESENCE optional }| + { ID id-Enhanced-CoverageRestriction CRITICALITY ignore TYPE Enhanced-CoverageRestriction PRESENCE optional }| + { ID id-CEmodeBrestricted CRITICALITY ignore TYPE CEmodeBrestricted PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }| + { ID id-MaskedIMEISV CRITICALITY ignore TYPE MaskedIMEISV PRESENCE optional }| + { ID id-OldAMF CRITICALITY reject TYPE AMFName PRESENCE optional }| + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }| + { ID id-ExtendedOldAMF CRITICALITY ignore TYPE Extended-AMFName PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY ID MAPPING ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY ID MAPPING REQUEST +-- +-- ************************************************************** + +UERadioCapabilityIDMappingRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UERadioCapabilityIDMappingRequestIEs} }, + ... +} + +UERadioCapabilityIDMappingRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY ID MAPPING RESPONSE +-- +-- ************************************************************** + +UERadioCapabilityIDMappingResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UERadioCapabilityIDMappingResponseIEs} }, + ... +} + +UERadioCapabilityIDMappingResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE mandatory }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- AMF CP Relocation Indication +-- +-- ************************************************************** + +AMFCPRelocationIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { AMFCPRelocationIndicationIEs} }, + ... +} + +AMFCPRelocationIndicationIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-S-NSSAI CRITICALITY ignore TYPE S-NSSAI PRESENCE optional }| --this IE is not used and ignored + { ID id-AllowedNSSAI CRITICALITY ignore TYPE AllowedNSSAI PRESENCE optional }| --this IE is not used and ignored + { ID id-Partially-Allowed-NSSAI CRITICALITY ignore TYPE Partially-Allowed-NSSAI PRESENCE optional }, --this IE is not used and ignored + ... +} + +-- ************************************************************** +-- +-- MBS SESSION MANAGEMENT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Broadcast Session Setup Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- BROADCAST SESSION SETUP REQUEST +-- +-- ************************************************************** + +BroadcastSessionSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionSetupRequestIEs} }, + ... +} + +BroadcastSessionSetupRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-S-NSSAI CRITICALITY reject TYPE S-NSSAI PRESENCE mandatory }| + { ID id-MBS-ServiceArea CRITICALITY reject TYPE MBS-ServiceArea PRESENCE mandatory }| + { ID id-MBSSessionSetupRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MBSSessionSetupOrModRequestTransfer) PRESENCE mandatory }| + { ID id-AssociatedSessionID CRITICALITY ignore TYPE AssociatedSessionID PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- BROADCAST SESSION SETUP RESPONSE +-- +-- ************************************************************** + +BroadcastSessionSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionSetupResponseIEs} }, + ... +} + +BroadcastSessionSetupResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBSSessionSetupResponseTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MBSSessionSetupOrModResponseTransfer) PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- BROADCAST SESSION SETUP FAILURE +-- +-- ************************************************************** + +BroadcastSessionSetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionSetupFailureIEs} }, + ... +} + +BroadcastSessionSetupFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBSSessionSetupFailureTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING MBSSessionSetupOrModFailureTransfer ) PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Broadcast Session Modification Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- BROADCAST SESSION MODIFICATION REQUEST +-- +-- ************************************************************** + +BroadcastSessionModificationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionModificationRequestIEs} }, + ... +} + +BroadcastSessionModificationRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-ServiceArea CRITICALITY reject TYPE MBS-ServiceArea PRESENCE optional }| + { ID id-MBSSessionModificationRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MBSSessionSetupOrModRequestTransfer) PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- BROADCAST SESSION MODIFICATION RESPONSE +-- +-- ************************************************************** + +BroadcastSessionModificationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionModificationResponseIEs} }, + ... +} + +BroadcastSessionModificationResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBSSessionModificationResponseTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MBSSessionSetupOrModResponseTransfer) PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- BROADCAST SESSION MODIFICATION FAILURE +-- +-- ************************************************************** + +BroadcastSessionModificationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionModificationFailureIEs} }, + ... +} + +BroadcastSessionModificationFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBSSessionModificationFailureTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING MBSSessionSetupOrModFailureTransfer) PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Broadcast Session Release Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- BROADCAST SESSION RELEASE REQUEST +-- +-- ************************************************************** + +BroadcastSessionReleaseRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionReleaseRequestIEs} }, + ... +} + +BroadcastSessionReleaseRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Broadcast Session Release Required Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- BROADCAST SESSION RELEASE REQUIRED +-- +-- ************************************************************** + +BroadcastSessionReleaseRequired ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionReleaseRequiredIEs} }, + ... +} + +BroadcastSessionReleaseRequiredIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- BROADCAST SESSION RELEASE RESPONSE +-- +-- ************************************************************** + +BroadcastSessionReleaseResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionReleaseResponseIEs} }, + ... +} + +BroadcastSessionReleaseResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBSSessionReleaseResponseTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING MBSSessionReleaseResponseTransfer) PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- Broadcast Session Transport Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- BROADCAST SESSION TRANSPORT REQUEST +-- +-- ************************************************************** + +BroadcastSessionTransportRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionTransportRequestIEs} }, + ... +} + +BroadcastSessionTransportRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-BroadcastTransportRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING BroadcastTransportRequestTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- BROADCAST SESSION TRANSPORT RESPONSE +-- +-- ************************************************************** + +BroadcastSessionTransportResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionTransportResponseIEs} }, + ... +} + +BroadcastSessionTransportResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-BroadcastTransportResponseTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING BroadcastTransportResponseTransfer) PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- BROADCAST SESSION TRANSPORT FAILURE +-- +-- ************************************************************** + +BroadcastSessionTransportFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {BroadcastSessionTransportFailureIEs} }, + ... +} + +BroadcastSessionTransportFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-BroadcastTransportFailureTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING BroadcastTransportFailureTransfer) PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + + +-- ************************************************************** +-- +-- Distribution Setup Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- DISTRIBUTION SETUP REQUEST +-- +-- ************************************************************** + +DistributionSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DistributionSetupRequestIEs} }, + ... +} + +DistributionSetupRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-MBS-DistributionSetupRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MBS-DistributionSetupRequestTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- DISTRIBUTION SETUP RESPONSE +-- +-- ************************************************************** + +DistributionSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DistributionSetupResponseIEs} }, + ... +} + +DistributionSetupResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-MBS-DistributionSetupResponseTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MBS-DistributionSetupResponseTransfer) PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- DISTRIBUTION SETUP FAILURE +-- +-- ************************************************************** + +DistributionSetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DistributionSetupFailureIEs} }, + ... +} + +DistributionSetupFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-MBS-DistributionSetupUnsuccessfulTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING MBS-DistributionSetupUnsuccessfulTransfer) PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Distribution Release Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- DISTRIBUTION RELEASE REQUEST +-- +-- ************************************************************** + +DistributionReleaseRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DistributionReleaseRequestIEs} }, + ... +} + +DistributionReleaseRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-MBS-DistributionReleaseRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MBS-DistributionReleaseRequestTransfer) PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- DISTRIBUTION RELEASE RESPONSE +-- +-- ************************************************************** + +DistributionReleaseResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DistributionReleaseResponseIEs} }, + ... +} + +DistributionReleaseResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Multicast Session Activation Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MULTICAST SESSION ACTIVATION REQUEST +-- +-- ************************************************************** + +MulticastSessionActivationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionActivationRequestIEs} }, + ... +} + +MulticastSessionActivationRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MulticastSessionActivationRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MulticastSessionActivationRequestTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- MULTICAST SESSION ACTIVATION RESPONSE +-- +-- ************************************************************** + +MulticastSessionActivationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionActivationResponseIEs} }, + ... +} + +MulticastSessionActivationResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- MULTICAST SESSION ACTIVATION FAILURE +-- +-- ************************************************************** + +MulticastSessionActivationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionActivationFailureIEs} }, + ... +} + +MulticastSessionActivationFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Multicast Session Deactivation Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MULTICAST SESSION DEACTIVATION REQUEST +-- +-- ************************************************************** + +MulticastSessionDeactivationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionDeactivationRequestIEs} }, + ... +} + +MulticastSessionDeactivationRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MulticastSessionDeactivationRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MulticastSessionDeactivationRequestTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- MULTICAST SESSION DEACTIVATION RESPONSE +-- +-- ************************************************************** + +MulticastSessionDeactivationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionDeactivationResponseIEs} }, + ... +} + +MulticastSessionDeactivationResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Multicast Session Update Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MULTICAST SESSION UPDATE REQUEST +-- +-- ************************************************************** + +MulticastSessionUpdateRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionUpdateRequestIEs} }, + ... +} + +MulticastSessionUpdateRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-MulticastSessionUpdateRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING MulticastSessionUpdateRequestTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- MULTICAST SESSION UPDATE RESPONSE +-- +-- ************************************************************** + +MulticastSessionUpdateResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionUpdateResponseIEs} }, + ... +} + +MulticastSessionUpdateResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- MULTICAST SESSION UPDATE FAILURE +-- +-- ************************************************************** + +MulticastSessionUpdateFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastSessionUpdateFailureIEs} }, + ... +} + +MulticastSessionUpdateFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY reject TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-AreaSessionID CRITICALITY reject TYPE MBS-AreaSessionID PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- MULTICAST GROUP PAGING ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MULTICAST GROUP PAGING +-- +-- ************************************************************** + +MulticastGroupPaging ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MulticastGroupPagingIEs} }, + ... +} + +MulticastGroupPagingIEs NGAP-PROTOCOL-IES ::= { + { ID id-MBS-SessionID CRITICALITY ignore TYPE MBS-SessionID PRESENCE mandatory }| + { ID id-MBS-ServiceArea CRITICALITY ignore TYPE MBS-ServiceArea PRESENCE optional }| + { ID id-MulticastGroupPagingAreaList CRITICALITY ignore TYPE MulticastGroupPagingAreaList PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- TIMING SYNCHRONISATION STATUS REPORTING ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Timing Synchronisation Status Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- TIMING SYNCHRONISATION STATUS REQUEST +-- +-- ************************************************************** + +TimingSynchronisationStatusRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {TimingSynchronisationStatusRequestIEs} }, + ... +} + +TimingSynchronisationStatusRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-RoutingID CRITICALITY reject TYPE RoutingID PRESENCE mandatory }| + { ID id-RAN-TSSRequestType CRITICALITY reject TYPE RAN-TSSRequestType PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- TIMING SYNCHRONISATION STATUS RESPONSE +-- +-- ************************************************************** + +TimingSynchronisationStatusResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {TimingSynchronisationStatusResponseIEs} }, + ... +} + +TimingSynchronisationStatusResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-RoutingID CRITICALITY ignore TYPE RoutingID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- TIMING SYNCHRONISATION STATUS FAILURE +-- +-- ************************************************************** + +TimingSynchronisationStatusFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { TimingSynchronisationStatusFailureIEs} }, + ... +} + +TimingSynchronisationStatusFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-RoutingID CRITICALITY ignore TYPE RoutingID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- Timing Synchronisation Status Reporting Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- TIMING SYNCHRONISATION STATUS REPORT +-- +-- ************************************************************** + +TimingSynchronisationStatusReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {TimingSynchronisationStatusReportIEs} }, + ... +} + +TimingSynchronisationStatusReportIEs NGAP-PROTOCOL-IES ::= { + { ID id-RoutingID CRITICALITY ignore TYPE RoutingID PRESENCE mandatory }| + { ID id-RANTimingSynchronisationStatusInfo CRITICALITY ignore TYPE RANTimingSynchronisationStatusInfo PRESENCE mandatory }| + { ID id-RAN-TSSScope CRITICALITY ignore TYPE RAN-TSSScope PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- MT Communication Handling Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MT COMMUNICATION HANDLING REQUEST +-- +-- ************************************************************** + +MTCommunicationHandlingRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { MTCommunicationHandlingRequestIEs} }, + ... +} + +MTCommunicationHandlingRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-FiveGCAction CRITICALITY reject TYPE FiveGCAction PRESENCE mandatory }| + { ID id-PDUSessionListMTCommHReq CRITICALITY reject TYPE PDUSessionListMTCommHReq PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- MT COMMUNICATION HANDLING RESPONSE +-- +-- ************************************************************** + +MTCommunicationHandlingResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MTCommunicationHandlingResponseIEs} }, + ... +} + +MTCommunicationHandlingResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- MT COMMUNICATION HANDLING FAILURE +-- +-- ************************************************************** + +MTCommunicationHandlingFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { MTCommunicationHandlingFailureIEs} }, + ... +} + +MTCommunicationHandlingFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY reject TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY reject TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** + +-- RAN Paging Request procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- RAN PAGING REQUEST +-- +-- ************************************************************** + +RANPagingRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { RANPagingRequestIEs} }, + ... +} + +RANPagingRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AMF-UE-NGAP-ID CRITICALITY ignore TYPE AMF-UE-NGAP-ID PRESENCE mandatory }| + { ID id-RAN-UE-NGAP-ID CRITICALITY ignore TYPE RAN-UE-NGAP-ID PRESENCE mandatory }| + { ID id-PagingPolicyDifferentiation CRITICALITY ignore TYPE PagingPolicyDifferentiation PRESENCE optional }| + { ID id-DL-Signalling CRITICALITY ignore TYPE DL-Signalling PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- A-IoT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Inventory Request Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- INVENTORY REQUEST +-- +-- ************************************************************** + +InventoryRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InventoryRequestIEs} }, + ... +} + +InventoryRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-InventoryRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING InventoryRequestTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- INVENTORY RESPONSE +-- +-- ************************************************************** + +InventoryResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InventoryResponseIEs} }, + ... +} + +InventoryResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-InventoryResponseTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING InventoryResponseTransfer) PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- INVENTORY FAILURE +-- +-- ************************************************************** + +InventoryFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InventoryFailureIEs} }, + ... +} + +InventoryFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY ignore TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY ignore TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-InventoryFailureTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING InventoryFailureTransfer ) PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** + +-- Inventory Report procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- INVENTORY REPORT +-- +-- ************************************************************** + +InventoryReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { InventoryReportIEs} }, + ... +} + +InventoryReportIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-InventoryReportTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING InventoryReportTransfer ) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Command Request Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- COMMAND REQUEST +-- +-- ************************************************************** + +CommandRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {CommandRequestIEs} }, + ... +} + +CommandRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-RAN-AIOT-Device-NGAP-ID CRITICALITY reject TYPE RAN-AIOT-Device-NGAP-ID PRESENCE mandatory }| + { ID id-CommandRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING CommandRequestTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- COMMAND RESPONSE +-- +-- ************************************************************** + +CommandResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {CommandResponseIEs} }, + ... +} + +CommandResponseIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-RAN-AIOT-Device-NGAP-ID CRITICALITY reject TYPE RAN-AIOT-Device-NGAP-ID PRESENCE mandatory }| + { ID id-CommandResponseTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING CommandResponseTransfer) PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- COMMAND FAILURE +-- +-- ************************************************************** + +CommandFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {CommandFailureIEs} }, + ... +} + +CommandFailureIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY ignore TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY ignore TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-RAN-AIOT-Device-NGAP-ID CRITICALITY ignore TYPE RAN-AIOT-Device-NGAP-ID PRESENCE mandatory }| + { ID id-CommandFailureTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING CommandFailureTransfer ) PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- A-IoT Session Release Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- AIOT SESSION RELEASE COMMAND +-- +-- ************************************************************** + +AIOTSessionReleaseCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AIOTSessionReleaseCommandIEs} }, + ... +} + +AIOTSessionReleaseCommandIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-AIOTSessionReleaseCommandTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING AIOTSessionReleaseCommandTransfer) PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- AIOT SESSION RELEASE COMPLETE +-- +-- ************************************************************** + +AIOTSessionReleaseComplete ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AIOTSessionReleaseCompleteIEs} }, + ... +} + +AIOTSessionReleaseCompleteIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY ignore TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY ignore TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-AIOTSessionReleaseCompleteTransfer CRITICALITY ignore TYPE OCTET STRING (CONTAINING AIOTSessionReleaseCompleteTransfer) PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- A-IoT Session Release Request Elementary Procedure +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- AIOT SESSION RELEASE REQUEST +-- +-- ************************************************************** + +AIOTSessionReleaseRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {AIOTSessionReleaseRequestIEs} }, + ... +} + +AIOTSessionReleaseRequestIEs NGAP-PROTOCOL-IES ::= { + { ID id-AIOTFIdentifier CRITICALITY reject TYPE AIOTFIdentifier PRESENCE mandatory }| + { ID id-AIoT-CorrelationIdentifier CRITICALITY reject TYPE AIoT-CorrelationIdentifier PRESENCE mandatory }| + { ID id-AIOTSessionReleaseRequestTransfer CRITICALITY reject TYPE OCTET STRING (CONTAINING AIOTSessionReleaseRequestTransfer) PRESENCE mandatory }, + ... +} + +END diff --git a/ngap/testdata/asn1/NGAP-PDU-Descriptions.asn b/ngap/testdata/asn1/NGAP-PDU-Descriptions.asn new file mode 100644 index 0000000000..8eabc6a04d --- /dev/null +++ b/ngap/testdata/asn1/NGAP-PDU-Descriptions.asn @@ -0,0 +1,1012 @@ +-- ************************************************************** +-- +-- Elementary Procedure definitions +-- +-- ************************************************************** + +NGAP-PDU-Descriptions { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +ngran-Access (22) modules (3) ngap (1) version1 (1) ngap-PDU-Descriptions (0)} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + + Criticality, + ProcedureCode +FROM NGAP-CommonDataTypes + + AMFConfigurationUpdate, + AMFConfigurationUpdateAcknowledge, + AMFConfigurationUpdateFailure, + AMFCPRelocationIndication, + AMFStatusIndication, + BroadcastSessionModificationFailure, + BroadcastSessionModificationRequest, + BroadcastSessionModificationResponse, + BroadcastSessionReleaseRequest, + BroadcastSessionReleaseRequired, + BroadcastSessionReleaseResponse, + BroadcastSessionSetupFailure, + BroadcastSessionSetupRequest, + BroadcastSessionSetupResponse, + BroadcastSessionTransportFailure, + BroadcastSessionTransportRequest, + BroadcastSessionTransportResponse, + CellTrafficTrace, + ConnectionEstablishmentIndication, + DeactivateTrace, + DistributionReleaseRequest, + DistributionReleaseResponse, + DistributionSetupFailure, + DistributionSetupRequest, + DistributionSetupResponse, + DownlinkNASTransport, + DownlinkNonUEAssociatedNRPPaTransport, + DownlinkRANConfigurationTransfer, + DownlinkRANEarlyStatusTransfer, + DownlinkRANStatusTransfer, + DownlinkUEAssociatedNRPPaTransport, + ErrorIndication, + HandoverCancel, + HandoverCancelAcknowledge, + HandoverCommand, + HandoverFailure, + HandoverNotify, + HandoverPreparationFailure, + HandoverRequest, + HandoverRequestAcknowledge, + HandoverRequired, + HandoverSuccess, + InitialContextSetupFailure, + InitialContextSetupRequest, + InitialContextSetupResponse, + InitialUEMessage, + LocationReport, + LocationReportingControl, + LocationReportingFailureIndication, + MTCommunicationHandlingRequest, + MTCommunicationHandlingResponse, + MTCommunicationHandlingFailure, + MulticastSessionActivationFailure, + MulticastSessionActivationRequest, + MulticastSessionActivationResponse, + MulticastSessionDeactivationRequest, + MulticastSessionDeactivationResponse, + MulticastSessionUpdateFailure, + MulticastSessionUpdateRequest, + MulticastSessionUpdateResponse, + MulticastGroupPaging, + NASNonDeliveryIndication, + NGReset, + NGResetAcknowledge, + NGRemovalFailure, + NGRemovalRequest, + NGRemovalResponse, + NGSetupFailure, + NGSetupRequest, + NGSetupResponse, + OverloadStart, + OverloadStop, + Paging, + PathSwitchRequest, + PathSwitchRequestAcknowledge, + PathSwitchRequestFailure, + PDUSessionResourceModifyConfirm, + PDUSessionResourceModifyIndication, + PDUSessionResourceModifyRequest, + PDUSessionResourceModifyResponse, + PDUSessionResourceNotify, + PDUSessionResourceReleaseCommand, + PDUSessionResourceReleaseResponse, + PDUSessionResourceSetupRequest, + PDUSessionResourceSetupResponse, + PrivateMessage, + PWSCancelRequest, + PWSCancelResponse, + PWSFailureIndication, + PWSRestartIndication, + RANConfigurationUpdate, + RANConfigurationUpdateAcknowledge, + RANConfigurationUpdateFailure, + RANCPRelocationIndication, + RANPagingRequest, + RerouteNASRequest, + RetrieveUEInformation, + RRCInactiveTransitionReport, + SecondaryRATDataUsageReport, + TimingSynchronisationStatusRequest, + TimingSynchronisationStatusResponse, + TimingSynchronisationStatusFailure, + TimingSynchronisationStatusReport, + TraceFailureIndication, + TraceStart, + UEContextModificationFailure, + UEContextModificationRequest, + UEContextModificationResponse, + UEContextReleaseCommand, + UEContextReleaseComplete, + UEContextReleaseRequest, + UEContextResumeRequest, + UEContextResumeResponse, + UEContextResumeFailure, + UEContextSuspendRequest, + UEContextSuspendResponse, + UEContextSuspendFailure, + UEInformationTransfer, + UERadioCapabilityCheckRequest, + UERadioCapabilityCheckResponse, + UERadioCapabilityIDMappingRequest, + UERadioCapabilityIDMappingResponse, + UERadioCapabilityInfoIndication, + UETNLABindingReleaseRequest, + UplinkNASTransport, + UplinkNonUEAssociatedNRPPaTransport, + UplinkRANConfigurationTransfer, + UplinkRANEarlyStatusTransfer, + UplinkRANStatusTransfer, + UplinkUEAssociatedNRPPaTransport, + WriteReplaceWarningRequest, + WriteReplaceWarningResponse, + UplinkRIMInformationTransfer, + DownlinkRIMInformationTransfer, + InventoryRequest, + InventoryResponse, + InventoryFailure, + InventoryReport, + CommandRequest, + CommandResponse, + CommandFailure, + AIOTSessionReleaseCommand, + AIOTSessionReleaseComplete, + AIOTSessionReleaseRequest + + +FROM NGAP-PDU-Contents + + id-AMFConfigurationUpdate, + id-AMFCPRelocationIndication, + id-AMFStatusIndication, + id-BroadcastSessionModification, + id-BroadcastSessionRelease, + id-BroadcastSessionReleaseRequired, + id-BroadcastSessionSetup, + id-BroadcastSessionTransport, + id-CellTrafficTrace, + id-ConnectionEstablishmentIndication, + id-DeactivateTrace, + id-DistributionRelease, + id-DistributionSetup, + id-DownlinkNASTransport, + id-DownlinkNonUEAssociatedNRPPaTransport, + id-DownlinkRANConfigurationTransfer, + id-DownlinkRANEarlyStatusTransfer, + id-DownlinkRANStatusTransfer, + id-DownlinkRIMInformationTransfer, + id-DownlinkUEAssociatedNRPPaTransport, + id-ErrorIndication, + id-HandoverCancel, + id-HandoverNotification, + id-HandoverPreparation, + id-HandoverResourceAllocation, + id-HandoverSuccess, + id-InitialContextSetup, + id-InitialUEMessage, + id-LocationReport, + id-LocationReportingControl, + id-LocationReportingFailureIndication, + id-MTCommunicationHandling, + id-MulticastGroupPaging, + id-MulticastSessionActivation, + id-MulticastSessionDeactivation, + id-MulticastSessionUpdate, + id-NASNonDeliveryIndication, + id-NGReset, + id-NGRemoval, + id-NGSetup, + id-OverloadStart, + id-OverloadStop, + id-Paging, + id-PathSwitchRequest, + id-PDUSessionResourceModify, + id-PDUSessionResourceModifyIndication, + id-PDUSessionResourceNotify, + id-PDUSessionResourceRelease, + id-PDUSessionResourceSetup, + id-PrivateMessage, + id-PWSCancel, + id-PWSFailureIndication, + id-PWSRestartIndication, + id-RANConfigurationUpdate, + id-RANCPRelocationIndication, + id-RANPagingRequest, + id-RerouteNASRequest, + id-RetrieveUEInformation, + id-RRCInactiveTransitionReport, + id-SecondaryRATDataUsageReport, + id-TimingSynchronisationStatus, + id-TimingSynchronisationStatusReport, + id-TraceFailureIndication, + id-TraceStart, + id-UEContextModification, + id-UEContextRelease, + id-UEContextReleaseRequest, + id-UEContextResume, + id-UEContextSuspend, + id-UEInformationTransfer, + id-UERadioCapabilityCheck, + id-UERadioCapabilityIDMapping, + id-UERadioCapabilityInfoIndication, + id-UETNLABindingRelease, + id-UplinkNASTransport, + id-UplinkNonUEAssociatedNRPPaTransport, + id-UplinkRANConfigurationTransfer, + id-UplinkRANEarlyStatusTransfer, + id-UplinkRANStatusTransfer, + id-UplinkRIMInformationTransfer, + id-UplinkUEAssociatedNRPPaTransport, + id-WriteReplaceWarning, + id-InventoryRequest, + id-InventoryReport, + id-CommandRequest, + id-AIOTSessionRelease, + id-AIOTSessionReleaseRequest + + +FROM NGAP-Constants; + +-- ************************************************************** +-- +-- Interface Elementary Procedure Class +-- +-- ************************************************************** + +NGAP-ELEMENTARY-PROCEDURE ::= CLASS { + &InitiatingMessage , + &SuccessfulOutcome OPTIONAL, + &UnsuccessfulOutcome OPTIONAL, + &procedureCode ProcedureCode UNIQUE, + &criticality Criticality DEFAULT ignore +} + +WITH SYNTAX { + INITIATING MESSAGE &InitiatingMessage + [SUCCESSFUL OUTCOME &SuccessfulOutcome] + [UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome] + PROCEDURE CODE &procedureCode + [CRITICALITY &criticality] +} + +-- ************************************************************** +-- +-- Interface PDU Definition +-- +-- ************************************************************** + +NGAP-PDU ::= CHOICE { + initiatingMessage InitiatingMessage, + successfulOutcome SuccessfulOutcome, + unsuccessfulOutcome UnsuccessfulOutcome, + ... +} + +InitiatingMessage ::= SEQUENCE { + procedureCode NGAP-ELEMENTARY-PROCEDURE.&procedureCode ({NGAP-ELEMENTARY-PROCEDURES}), + criticality NGAP-ELEMENTARY-PROCEDURE.&criticality ({NGAP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value NGAP-ELEMENTARY-PROCEDURE.&InitiatingMessage ({NGAP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +SuccessfulOutcome ::= SEQUENCE { + procedureCode NGAP-ELEMENTARY-PROCEDURE.&procedureCode ({NGAP-ELEMENTARY-PROCEDURES}), + criticality NGAP-ELEMENTARY-PROCEDURE.&criticality ({NGAP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value NGAP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({NGAP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +UnsuccessfulOutcome ::= SEQUENCE { + procedureCode NGAP-ELEMENTARY-PROCEDURE.&procedureCode ({NGAP-ELEMENTARY-PROCEDURES}), + criticality NGAP-ELEMENTARY-PROCEDURE.&criticality ({NGAP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value NGAP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({NGAP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +-- ************************************************************** +-- +-- Interface Elementary Procedure List +-- +-- ************************************************************** + +NGAP-ELEMENTARY-PROCEDURES NGAP-ELEMENTARY-PROCEDURE ::= { + NGAP-ELEMENTARY-PROCEDURES-CLASS-1 | + NGAP-ELEMENTARY-PROCEDURES-CLASS-2, + ... +} + +NGAP-ELEMENTARY-PROCEDURES-CLASS-1 NGAP-ELEMENTARY-PROCEDURE ::= { + aMFConfigurationUpdate | + broadcastSessionModification | + broadcastSessionRelease | + broadcastSessionSetup | + broadcastSessionTransport | + distributionSetup | + distributionRelease | + handoverCancel | + handoverPreparation | + handoverResourceAllocation | + initialContextSetup | + mTCommunicationHandling | + multicastSessionActivation | + multicastSessionDeactivation | + multicastSessionUpdate | + nGReset | + nGSetup | + pathSwitchRequest | + pDUSessionResourceModify | + pDUSessionResourceModifyIndication | + pDUSessionResourceRelease | + pDUSessionResourceSetup | + pWSCancel | + rANConfigurationUpdate | + timingSynchronisationStatus | + uEContextModification | + uEContextRelease | + uEContextResume | + uEContextSuspend | + uERadioCapabilityCheck | + uERadioCapabilityIDMapping | + writeReplaceWarning | + nGRemoval | + inventoryRequest | + commandRequest | + aIOTSessionRelease , + ... +} + +NGAP-ELEMENTARY-PROCEDURES-CLASS-2 NGAP-ELEMENTARY-PROCEDURE ::= { + aMFCPRelocationIndication | + aMFStatusIndication | + broadcastSessionReleaseRequired | + cellTrafficTrace | + connectionEstablishmentIndication | + deactivateTrace | + downlinkNASTransport | + downlinkNonUEAssociatedNRPPaTransport | + downlinkRANConfigurationTransfer | + downlinkRANEarlyStatusTransfer | + downlinkRANStatusTransfer | + downlinkRIMInformationTransfer | + downlinkUEAssociatedNRPPaTransport | + errorIndication | + handoverNotification | + handoverSuccess | + initialUEMessage | + locationReport | + locationReportingControl | + locationReportingFailureIndication | + multicastGroupPaging | + nASNonDeliveryIndication | + overloadStart | + overloadStop | + paging | + pDUSessionResourceNotify | + privateMessage | + pWSFailureIndication | + pWSRestartIndication | + rANCPRelocationIndication | + rANPagingRequest | + rerouteNASRequest | + retrieveUEInformation | + rRCInactiveTransitionReport | + secondaryRATDataUsageReport | + timingSynchronisationStatusReport | + traceFailureIndication | + traceStart | + uEContextReleaseRequest | + uEInformationTransfer | + uERadioCapabilityInfoIndication | + uETNLABindingRelease | + uplinkNASTransport | + uplinkNonUEAssociatedNRPPaTransport | + uplinkRANConfigurationTransfer | + uplinkRANEarlyStatusTransfer | + uplinkRANStatusTransfer | + uplinkRIMInformationTransfer | + uplinkUEAssociatedNRPPaTransport | + inventoryReport | + aIOTSessionReleaseRequest , + ... + +} + +-- ************************************************************** +-- +-- Interface Elementary Procedures +-- +-- ************************************************************** + +aMFConfigurationUpdate NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE AMFConfigurationUpdate + SUCCESSFUL OUTCOME AMFConfigurationUpdateAcknowledge + UNSUCCESSFUL OUTCOME AMFConfigurationUpdateFailure + PROCEDURE CODE id-AMFConfigurationUpdate + CRITICALITY reject +} + +aMFCPRelocationIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE AMFCPRelocationIndication + PROCEDURE CODE id-AMFCPRelocationIndication + CRITICALITY reject +} + +aMFStatusIndication NGAP-ELEMENTARY-PROCEDURE ::={ + INITIATING MESSAGE AMFStatusIndication + PROCEDURE CODE id-AMFStatusIndication + CRITICALITY ignore +} + +broadcastSessionModification NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE BroadcastSessionModificationRequest + SUCCESSFUL OUTCOME BroadcastSessionModificationResponse + UNSUCCESSFUL OUTCOME BroadcastSessionModificationFailure + PROCEDURE CODE id-BroadcastSessionModification + CRITICALITY reject +} + +broadcastSessionRelease NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE BroadcastSessionReleaseRequest + SUCCESSFUL OUTCOME BroadcastSessionReleaseResponse + PROCEDURE CODE id-BroadcastSessionRelease + CRITICALITY reject +} + +broadcastSessionReleaseRequired NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE BroadcastSessionReleaseRequired + PROCEDURE CODE id-BroadcastSessionReleaseRequired + CRITICALITY reject +} + +broadcastSessionSetup NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE BroadcastSessionSetupRequest + SUCCESSFUL OUTCOME BroadcastSessionSetupResponse + UNSUCCESSFUL OUTCOME BroadcastSessionSetupFailure + PROCEDURE CODE id-BroadcastSessionSetup + CRITICALITY reject +} + +broadcastSessionTransport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE BroadcastSessionTransportRequest + SUCCESSFUL OUTCOME BroadcastSessionTransportResponse + UNSUCCESSFUL OUTCOME BroadcastSessionTransportFailure + PROCEDURE CODE id-BroadcastSessionTransport + CRITICALITY reject +} + +cellTrafficTrace NGAP-ELEMENTARY-PROCEDURE ::={ + INITIATING MESSAGE CellTrafficTrace + PROCEDURE CODE id-CellTrafficTrace + CRITICALITY ignore +} + +connectionEstablishmentIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ConnectionEstablishmentIndication + PROCEDURE CODE id-ConnectionEstablishmentIndication + CRITICALITY reject +} + +deactivateTrace NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DeactivateTrace + PROCEDURE CODE id-DeactivateTrace + CRITICALITY ignore +} + +distributionSetup NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DistributionSetupRequest + SUCCESSFUL OUTCOME DistributionSetupResponse + UNSUCCESSFUL OUTCOME DistributionSetupFailure + PROCEDURE CODE id-DistributionSetup + CRITICALITY reject +} + +distributionRelease NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DistributionReleaseRequest + SUCCESSFUL OUTCOME DistributionReleaseResponse + PROCEDURE CODE id-DistributionRelease + CRITICALITY reject +} + +downlinkNASTransport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkNASTransport + PROCEDURE CODE id-DownlinkNASTransport + CRITICALITY ignore +} + +downlinkNonUEAssociatedNRPPaTransport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkNonUEAssociatedNRPPaTransport + PROCEDURE CODE id-DownlinkNonUEAssociatedNRPPaTransport + CRITICALITY ignore +} + +downlinkRANConfigurationTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkRANConfigurationTransfer + PROCEDURE CODE id-DownlinkRANConfigurationTransfer + CRITICALITY ignore +} + +downlinkRANEarlyStatusTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkRANEarlyStatusTransfer + PROCEDURE CODE id-DownlinkRANEarlyStatusTransfer + CRITICALITY ignore +} + +downlinkRANStatusTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkRANStatusTransfer + PROCEDURE CODE id-DownlinkRANStatusTransfer + CRITICALITY ignore +} + +downlinkUEAssociatedNRPPaTransport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkUEAssociatedNRPPaTransport + PROCEDURE CODE id-DownlinkUEAssociatedNRPPaTransport + CRITICALITY ignore +} + +errorIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ErrorIndication + PROCEDURE CODE id-ErrorIndication + CRITICALITY ignore +} + +handoverCancel NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverCancel + SUCCESSFUL OUTCOME HandoverCancelAcknowledge + PROCEDURE CODE id-HandoverCancel + CRITICALITY reject +} + +handoverNotification NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverNotify + PROCEDURE CODE id-HandoverNotification + CRITICALITY ignore +} + +handoverPreparation NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverRequired + SUCCESSFUL OUTCOME HandoverCommand + UNSUCCESSFUL OUTCOME HandoverPreparationFailure + PROCEDURE CODE id-HandoverPreparation + CRITICALITY reject +} + +handoverResourceAllocation NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverRequest + SUCCESSFUL OUTCOME HandoverRequestAcknowledge + UNSUCCESSFUL OUTCOME HandoverFailure + PROCEDURE CODE id-HandoverResourceAllocation + CRITICALITY reject +} + +handoverSuccess NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverSuccess + PROCEDURE CODE id-HandoverSuccess + CRITICALITY ignore +} + +initialContextSetup NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE InitialContextSetupRequest + SUCCESSFUL OUTCOME InitialContextSetupResponse + UNSUCCESSFUL OUTCOME InitialContextSetupFailure + PROCEDURE CODE id-InitialContextSetup + CRITICALITY reject +} + +initialUEMessage NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE InitialUEMessage + PROCEDURE CODE id-InitialUEMessage + CRITICALITY ignore +} + +locationReport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE LocationReport + PROCEDURE CODE id-LocationReport + CRITICALITY ignore +} + +locationReportingControl NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE LocationReportingControl + PROCEDURE CODE id-LocationReportingControl + CRITICALITY ignore +} + +locationReportingFailureIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE LocationReportingFailureIndication + PROCEDURE CODE id-LocationReportingFailureIndication + CRITICALITY ignore +} + +mTCommunicationHandling NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MTCommunicationHandlingRequest + SUCCESSFUL OUTCOME MTCommunicationHandlingResponse + UNSUCCESSFUL OUTCOME MTCommunicationHandlingFailure + PROCEDURE CODE id-MTCommunicationHandling + CRITICALITY reject +} + +multicastSessionActivation NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MulticastSessionActivationRequest + SUCCESSFUL OUTCOME MulticastSessionActivationResponse + UNSUCCESSFUL OUTCOME MulticastSessionActivationFailure + PROCEDURE CODE id-MulticastSessionActivation + CRITICALITY reject +} + +multicastSessionDeactivation NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MulticastSessionDeactivationRequest + SUCCESSFUL OUTCOME MulticastSessionDeactivationResponse + PROCEDURE CODE id-MulticastSessionDeactivation + CRITICALITY reject +} + +multicastSessionUpdate NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MulticastSessionUpdateRequest + SUCCESSFUL OUTCOME MulticastSessionUpdateResponse + UNSUCCESSFUL OUTCOME MulticastSessionUpdateFailure + PROCEDURE CODE id-MulticastSessionUpdate + CRITICALITY reject +} + +multicastGroupPaging NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MulticastGroupPaging + PROCEDURE CODE id-MulticastGroupPaging + CRITICALITY ignore +} + +nASNonDeliveryIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE NASNonDeliveryIndication + PROCEDURE CODE id-NASNonDeliveryIndication + CRITICALITY ignore +} + +nGReset NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE NGReset + SUCCESSFUL OUTCOME NGResetAcknowledge + PROCEDURE CODE id-NGReset + CRITICALITY reject +} + +nGSetup NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE NGSetupRequest + SUCCESSFUL OUTCOME NGSetupResponse + UNSUCCESSFUL OUTCOME NGSetupFailure + PROCEDURE CODE id-NGSetup + CRITICALITY reject +} + +nGRemoval NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE NGRemovalRequest + SUCCESSFUL OUTCOME NGRemovalResponse + UNSUCCESSFUL OUTCOME NGRemovalFailure + PROCEDURE CODE id-NGRemoval + CRITICALITY reject +} + +overloadStart NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE OverloadStart + PROCEDURE CODE id-OverloadStart + CRITICALITY ignore +} + +overloadStop NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE OverloadStop + PROCEDURE CODE id-OverloadStop + CRITICALITY reject +} + +paging NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE Paging + PROCEDURE CODE id-Paging + CRITICALITY ignore +} + +pathSwitchRequest NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PathSwitchRequest + SUCCESSFUL OUTCOME PathSwitchRequestAcknowledge + UNSUCCESSFUL OUTCOME PathSwitchRequestFailure + PROCEDURE CODE id-PathSwitchRequest + CRITICALITY reject +} + +pDUSessionResourceModify NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PDUSessionResourceModifyRequest + SUCCESSFUL OUTCOME PDUSessionResourceModifyResponse + PROCEDURE CODE id-PDUSessionResourceModify + CRITICALITY reject +} + +pDUSessionResourceModifyIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PDUSessionResourceModifyIndication + SUCCESSFUL OUTCOME PDUSessionResourceModifyConfirm + PROCEDURE CODE id-PDUSessionResourceModifyIndication + CRITICALITY reject +} + +pDUSessionResourceNotify NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PDUSessionResourceNotify + PROCEDURE CODE id-PDUSessionResourceNotify + CRITICALITY ignore +} + +pDUSessionResourceRelease NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PDUSessionResourceReleaseCommand + SUCCESSFUL OUTCOME PDUSessionResourceReleaseResponse + PROCEDURE CODE id-PDUSessionResourceRelease + CRITICALITY reject +} + +pDUSessionResourceSetup NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PDUSessionResourceSetupRequest + SUCCESSFUL OUTCOME PDUSessionResourceSetupResponse + PROCEDURE CODE id-PDUSessionResourceSetup + CRITICALITY reject +} + +privateMessage NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PrivateMessage + PROCEDURE CODE id-PrivateMessage + CRITICALITY ignore +} + +pWSCancel NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSCancelRequest + SUCCESSFUL OUTCOME PWSCancelResponse + PROCEDURE CODE id-PWSCancel + CRITICALITY reject +} + +pWSFailureIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSFailureIndication + PROCEDURE CODE id-PWSFailureIndication + CRITICALITY ignore +} + +pWSRestartIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSRestartIndication + PROCEDURE CODE id-PWSRestartIndication + CRITICALITY ignore +} + +rANConfigurationUpdate NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RANConfigurationUpdate + SUCCESSFUL OUTCOME RANConfigurationUpdateAcknowledge + UNSUCCESSFUL OUTCOME RANConfigurationUpdateFailure + PROCEDURE CODE id-RANConfigurationUpdate + CRITICALITY reject +} + +rANCPRelocationIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RANCPRelocationIndication + PROCEDURE CODE id-RANCPRelocationIndication + CRITICALITY reject +} + +rANPagingRequest NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RANPagingRequest + PROCEDURE CODE id-RANPagingRequest + CRITICALITY ignore +} + +rerouteNASRequest NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RerouteNASRequest + PROCEDURE CODE id-RerouteNASRequest + CRITICALITY reject +} + +retrieveUEInformation NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RetrieveUEInformation + PROCEDURE CODE id-RetrieveUEInformation + CRITICALITY reject +} + +rRCInactiveTransitionReport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RRCInactiveTransitionReport + PROCEDURE CODE id-RRCInactiveTransitionReport + CRITICALITY ignore +} + +secondaryRATDataUsageReport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE SecondaryRATDataUsageReport + PROCEDURE CODE id-SecondaryRATDataUsageReport + CRITICALITY ignore +} + +timingSynchronisationStatus NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE TimingSynchronisationStatusRequest + SUCCESSFUL OUTCOME TimingSynchronisationStatusResponse + UNSUCCESSFUL OUTCOME TimingSynchronisationStatusFailure + PROCEDURE CODE id-TimingSynchronisationStatus + CRITICALITY reject +} + +timingSynchronisationStatusReport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE TimingSynchronisationStatusReport + PROCEDURE CODE id-TimingSynchronisationStatusReport + CRITICALITY ignore +} + +traceFailureIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE TraceFailureIndication + PROCEDURE CODE id-TraceFailureIndication + CRITICALITY ignore +} + +traceStart NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE TraceStart + PROCEDURE CODE id-TraceStart + CRITICALITY ignore +} + +uEContextModification NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextModificationRequest + SUCCESSFUL OUTCOME UEContextModificationResponse + UNSUCCESSFUL OUTCOME UEContextModificationFailure + PROCEDURE CODE id-UEContextModification + CRITICALITY reject +} + +uEContextRelease NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextReleaseCommand + SUCCESSFUL OUTCOME UEContextReleaseComplete + PROCEDURE CODE id-UEContextRelease + CRITICALITY reject +} + +uEContextReleaseRequest NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextReleaseRequest + PROCEDURE CODE id-UEContextReleaseRequest + CRITICALITY ignore +} + +uEContextResume NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextResumeRequest + SUCCESSFUL OUTCOME UEContextResumeResponse + UNSUCCESSFUL OUTCOME UEContextResumeFailure + PROCEDURE CODE id-UEContextResume + CRITICALITY reject +} + +uEContextSuspend NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextSuspendRequest + SUCCESSFUL OUTCOME UEContextSuspendResponse + UNSUCCESSFUL OUTCOME UEContextSuspendFailure + PROCEDURE CODE id-UEContextSuspend + CRITICALITY reject +} + +uEInformationTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEInformationTransfer + PROCEDURE CODE id-UEInformationTransfer + CRITICALITY reject +} + +uERadioCapabilityCheck NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UERadioCapabilityCheckRequest + SUCCESSFUL OUTCOME UERadioCapabilityCheckResponse + PROCEDURE CODE id-UERadioCapabilityCheck + CRITICALITY reject +} + +uERadioCapabilityIDMapping NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UERadioCapabilityIDMappingRequest + SUCCESSFUL OUTCOME UERadioCapabilityIDMappingResponse + PROCEDURE CODE id-UERadioCapabilityIDMapping + CRITICALITY reject +} + +uERadioCapabilityInfoIndication NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UERadioCapabilityInfoIndication + PROCEDURE CODE id-UERadioCapabilityInfoIndication + CRITICALITY ignore +} + +uETNLABindingRelease NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UETNLABindingReleaseRequest + PROCEDURE CODE id-UETNLABindingRelease + CRITICALITY ignore +} + +uplinkNASTransport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkNASTransport + PROCEDURE CODE id-UplinkNASTransport + CRITICALITY ignore +} + +uplinkNonUEAssociatedNRPPaTransport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkNonUEAssociatedNRPPaTransport + PROCEDURE CODE id-UplinkNonUEAssociatedNRPPaTransport + CRITICALITY ignore +} + +uplinkRANConfigurationTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkRANConfigurationTransfer + PROCEDURE CODE id-UplinkRANConfigurationTransfer + CRITICALITY ignore +} + +uplinkRANEarlyStatusTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkRANEarlyStatusTransfer + PROCEDURE CODE id-UplinkRANEarlyStatusTransfer + CRITICALITY reject +} + +uplinkRANStatusTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkRANStatusTransfer + PROCEDURE CODE id-UplinkRANStatusTransfer + CRITICALITY ignore +} + +uplinkUEAssociatedNRPPaTransport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkUEAssociatedNRPPaTransport + PROCEDURE CODE id-UplinkUEAssociatedNRPPaTransport + CRITICALITY ignore +} + +writeReplaceWarning NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE WriteReplaceWarningRequest + SUCCESSFUL OUTCOME WriteReplaceWarningResponse + PROCEDURE CODE id-WriteReplaceWarning + CRITICALITY reject +} + +uplinkRIMInformationTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkRIMInformationTransfer + PROCEDURE CODE id-UplinkRIMInformationTransfer + CRITICALITY ignore +} + +downlinkRIMInformationTransfer NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkRIMInformationTransfer + PROCEDURE CODE id-DownlinkRIMInformationTransfer + CRITICALITY ignore +} + +inventoryRequest NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE InventoryRequest + SUCCESSFUL OUTCOME InventoryResponse + UNSUCCESSFUL OUTCOME InventoryFailure + PROCEDURE CODE id-InventoryRequest + CRITICALITY reject +} + +inventoryReport NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE InventoryReport + PROCEDURE CODE id-InventoryReport + CRITICALITY reject +} + +commandRequest NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE CommandRequest + SUCCESSFUL OUTCOME CommandResponse + UNSUCCESSFUL OUTCOME CommandFailure + PROCEDURE CODE id-CommandRequest + CRITICALITY reject +} + +aIOTSessionRelease NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE AIOTSessionReleaseCommand + SUCCESSFUL OUTCOME AIOTSessionReleaseComplete + PROCEDURE CODE id-AIOTSessionRelease + CRITICALITY reject +} + +aIOTSessionReleaseRequest NGAP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE AIOTSessionReleaseRequest + PROCEDURE CODE id-AIOTSessionReleaseRequest + CRITICALITY reject +} + +END diff --git a/ngap/tnl_lossless_test.go b/ngap/tnl_lossless_test.go index b77a37ceff..8b1e5af5c2 100644 --- a/ngap/tnl_lossless_test.go +++ b/ngap/tnl_lossless_test.go @@ -15,13 +15,14 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const unknownExtensionID ProtocolIEID = 65000 func upTNL(host byte, teid uint32) UPTransportLayerInformation { - return UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{10, 0, 0, host}, + return UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(10, 0, 0, host), GTPTEID: GTPTEID(teid), }} } @@ -61,7 +62,7 @@ func tnlSetupRequestTransfer() *PDUSessionResourceSetupRequestTransfer { QosFlowSetupRequest: QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ - QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}}, + QosCharacteristics: QosCharacteristics{NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}}, AllocationAndRetentionPriority: AllocationAndRetentionPriority{ PriorityLevelARP: 8, PreemptionCapability: PreemptionShallNotTrigger, @@ -337,7 +338,7 @@ func tnlTransferCases() []tnlTransferCase { return &PathSwitchRequest{ RANUENGAPID: 2, SourceAMFUENGAPID: 1, - UserLocationInformation: &UserLocationInformation{Kind: UserLocationNR, PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}}, UESecurityCapabilities: &UESecurityCapabilities{}, PDUSessionResourceToBeSwitchedDLList: PDUSessionResourceToBeSwitchedDLList{{PDUSessionID: 5, Transfer: b}}, } @@ -433,7 +434,7 @@ func TestTNLExtensionGoldenRoundTrip(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(out, c.transfer) { + if !equalByMethod(out, c.transfer) { t.Fatalf("decoded\n got %+v\nwant %+v", out, c.transfer) } @@ -507,7 +508,7 @@ func TestTNLExtensionCriticality(t *testing.T) { out := make([]Criticality, v.Len()) for i := range out { - out[i] = Criticality(v.Index(i).FieldByName("crit").Uint()) + out[i] = Criticality(v.Index(i).FieldByName("Criticality").Uint()) } return out @@ -518,7 +519,7 @@ func TestTNLExtensionCriticality(t *testing.T) { out := make([]ProtocolIEID, v.Len()) for i := range out { - out[i] = ProtocolIEID(v.Index(i).FieldByName("id").Uint()) + out[i] = ProtocolIEID(v.Index(i).FieldByName("ID").Uint()) } return out @@ -555,57 +556,65 @@ func TestTNLExtensionCriticality(t *testing.T) { {IDRedundantULNGUUPTNLInformation, ig}, {IDUserPlaneFailureIndication, ig}, }}, - {"PDUSessionResourceSetupResponseTransfer-ExtIEs", pDUSessionResourceSetupResponseTransferExtIEs, []row{ + {"PDUSessionResourceSetupResponseTransfer-ExtIEs", extIEsPDUSessionResourceSetupResponseTransfer, []row{ {IDRedundantDLQosFlowPerTNLInformation, ig}, {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, }}, - {"PDUSessionResourceModifyResponseTransfer-ExtIEs", pDUSessionResourceModifyResponseTransferExtIEs, []row{ + {"PDUSessionResourceModifyResponseTransfer-ExtIEs", extIEsPDUSessionResourceModifyResponseTransfer, []row{ {IDAdditionalNGUUPTNLInformation, ig}, {IDRedundantDLNGUUPTNLInformation, ig}, {IDRedundantULNGUUPTNLInformation, ig}, {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, {IDAdditionalRedundantNGUUPTNLInformation, ig}, }}, - {"PDUSessionResourceModifyIndicationTransfer-ExtIEs", pDUSessionResourceModifyIndicationTransferExtIEs, []row{ + {"PDUSessionResourceModifyIndicationTransfer-ExtIEs", extIEsPDUSessionResourceModifyIndicationTransfer, []row{ {IDRedundantDLQosFlowPerTNLInformation, ig}, {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, }}, - {"PDUSessionResourceModifyConfirmTransfer-ExtIEs", pDUSessionResourceModifyConfirmTransferExtIEs, []row{ + {"PDUSessionResourceModifyConfirmTransfer-ExtIEs", extIEsPDUSessionResourceModifyConfirmTransfer, []row{ {IDRedundantULNGUUPTNLInformation, ig}, {IDAdditionalRedundantNGUUPTNLInformation, ig}, }}, - {"PathSwitchRequestTransfer-ExtIEs", pathSwitchRequestTransferExtIEs, []row{ + {"PathSwitchRequestTransfer-ExtIEs", extIEsPathSwitchRequestTransfer, []row{ {IDAdditionalDLQosFlowPerTNLInformation, ig}, {IDRedundantDLNGUUPTNLInformation, ig}, {IDRedundantDLNGUTNLInformationReused, ig}, {IDAdditionalRedundantDLQosFlowPerTNLInformation, ig}, }}, - {"PathSwitchRequestAcknowledgeTransfer-ExtIEs", pathSwitchRequestAcknowledgeTransferExtIEs, []row{ + {"PathSwitchRequestAcknowledgeTransfer-ExtIEs", extIEsPathSwitchRequestAcknowledgeTransfer, []row{ {IDAdditionalNGUUPTNLInformation, ig}, {IDRedundantULNGUUPTNLInformation, ig}, {IDAdditionalRedundantNGUUPTNLInformation, ig}, }}, - {"HandoverRequestAcknowledgeTransfer-ExtIEs", handoverRequestAcknowledgeTransferExtIEs, []row{ + {"HandoverRequestAcknowledgeTransfer-ExtIEs", extIEsHandoverRequestAcknowledgeTransfer, []row{ {IDAdditionalDLUPTNLInformationForHOList, ig}, {IDULForwardingUPTNLInformation, rj}, {IDAdditionalULForwardingUPTNLInformation, rj}, {IDDataForwardingResponseERABList, ig}, {IDRedundantDLNGUUPTNLInformation, ig}, }}, - {"HandoverCommandTransfer-ExtIEs", handoverCommandTransferExtIEs, []row{ + {"HandoverCommandTransfer-ExtIEs", extIEsHandoverCommandTransfer, []row{ {IDAdditionalDLForwardingUPTNLInformation, ig}, {IDULForwardingUPTNLInformation, rj}, {IDAdditionalULForwardingUPTNLInformation, rj}, {IDDataForwardingResponseERABList, ig}, }}, - {"UL-NGU-UP-TNLModifyItem-ExtIEs", uLNGUUPTNLModifyItemExtIEs, []row{ + {"UL-NGU-UP-TNLModifyItem-ExtIEs", extIEsULNGUUPTNLModifyItem, []row{ {IDRedundantULNGUUPTNLInformation, ig}, {IDRedundantDLNGUUPTNLInformation, ig}, }}, - {"AdditionalDLUPTNLInformationForHOItem-ExtIEs", additionalDLUPTNLInformationForHOItemExtIEs, []row{ + {"AdditionalDLUPTNLInformationForHOItem-ExtIEs", extIEsAdditionalDLUPTNLInformationForHOItem, []row{ {IDAdditionalRedundantDLNGUUPTNLInformation, ig}, }}, - {"QosFlowAddOrModifyRequestItem-ExtIEs", qosFlowAddOrModifyRequestItemExtIEs, []row{{IDULNGUUPTNLInformation, ig}}}, - {"QosFlowAddOrModifyResponseItem-ExtIEs", qosFlowAddOrModifyResponseItemExtIEs, []row{{IDDLNGUUPTNLInformation, ig}}}, - {"PDUSessionResourceModifyItemModReq-ExtIEs", pDUSessionResourceModifyItemModReqExtIEs, []row{{IDSNSSAI, rj}}}, + {"QosFlowAddOrModifyRequestItem-ExtIEs", extIEsQosFlowAddOrModifyRequestItem, []row{{IDULNGUUPTNLInformation, ig}}}, + {"QosFlowAddOrModifyResponseItem-ExtIEs", extIEsQosFlowAddOrModifyResponseItem, []row{{IDDLNGUUPTNLInformation, ig}}}, + {"PDUSessionResourceModifyItemModReq-ExtIEs", extIEsPDUSessionResourceModifyItemModReq, []row{{IDSNSSAI, rj}}}, } { t.Run(tc.name, func(t *testing.T) { - if got := critOf(ids(tc.table), crits(tc.table)); !reflect.DeepEqual(got, tc.want) { - t.Fatalf("rows %v, want %v", got, tc.want) + got := critOf(ids(tc.table), crits(tc.table)) + next := 0 + + for _, w := range tc.want { + i := slices.Index(got[next:], w) + if i < 0 { + t.Fatalf("rows %v, want %v in this order", got, tc.want) + } + + next += i + 1 } }) } @@ -613,9 +622,12 @@ func TestTNLExtensionCriticality(t *testing.T) { func TestTNLExtensionWireCriticalityKept(t *testing.T) { in := &HandoverCommandTransfer{ULForwardingUPTNLInformation: upTNLPtr(1, 0xa05)} - in.iEExtensions.wire = []wireSlot{{id: IDULForwardingUPTNLInformation, crit: CriticalityIgnore, unknown: -1}} + restore := swapTable(&extIEsHandoverCommandTransfer, tableRow(extIEsHandoverCommandTransfer, IDULForwardingUPTNLInformation, CriticalityIgnore)) b, err := in.Marshal() + + restore() + if err != nil { t.Fatal(err) } @@ -625,10 +637,6 @@ func TestTNLExtensionWireCriticalityKept(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(out.iEExtensions.wire, in.iEExtensions.wire) { - t.Fatalf("wire %+v, want %+v", out.iEExtensions.wire, in.iEExtensions.wire) - } - again, err := out.Marshal() if err != nil || !bytes.Equal(again, b) { t.Fatalf("re-encoded %x (%v), want %x", again, err, b) @@ -643,18 +651,13 @@ func tbNil(t testing.TB, err error) { } } -func unknownRawExtensions(t testing.TB) *rawIEExtensions { +func unknownRawExtensions(t testing.TB) extensionMeta { t.Helper() - w := per.NewWriter() - tbNil(t, per.EncodeConstrainedWholeNumber(w, per.Aligned, 1, maxProtocolExtensions, 1)) - tbNil(t, encodeContainerField(w, per.Aligned, ieField{id: unknownExtensionID, crit: CriticalityIgnore, raw: []byte{0xde, 0xad}})) - w.AlignToByte() - - var e rawIEExtensions - tbNil(t, e.UnmarshalPER(per.NewReader(w.Bytes()), per.Aligned)) + var e extensionMeta + e.Append(rawIE{ID: unknownExtensionID, Criticality: CriticalityIgnore, Value: []byte{0xde, 0xad}}) - return &e + return e } func unknownAdditions(t testing.TB) per.ExtensionAdditions { @@ -675,11 +678,11 @@ func unknownAdditions(t testing.TB) per.ExtensionAdditions { return e } -func unknownMeta(t testing.TB) messageMeta { +func unknownMeta(t testing.TB) extensionMeta { t.Helper() - var m messageMeta - m.preserve(rawIE{id: unknownExtensionID, crit: CriticalityIgnore, value: []byte{0xde, 0xad}}) + var m extensionMeta + m.Append(rawIE{ID: unknownExtensionID, Criticality: CriticalityIgnore, Value: []byte{0xde, 0xad}}) return m } @@ -717,7 +720,7 @@ func losslessCases() []losslessCase { qosParams := func(t testing.TB) QosFlowLevelQosParameters { return QosFlowLevelQosParameters{ - QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsDynamic5QI, Dynamic5QI: Dynamic5QIDescriptor{ + QosCharacteristics: QosCharacteristics{Dynamic5QI: &Dynamic5QIDescriptor{ PriorityLevelQos: 10, PacketDelayBudget: 100, PacketErrorRate: PacketErrorRate{Scalar: 1, Exponent: 6, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)}, @@ -751,14 +754,14 @@ func losslessCases() []losslessCase { } } - transferItem := func(t testing.TB) (*rawIEExtensions, per.ExtensionAdditions) { + transferItem := func(t testing.TB) (extensionMeta, per.ExtensionAdditions) { return unknownRawExtensions(t), unknownAdditions(t) } return []losslessCase{ {name: "GTPTunnel", value: func(t testing.TB) per.Marshaler { u := gtp(t, 1, 0x10) - return &u.GTPTunnel + return u.GTPTunnel }, decode: decodeAs[GTPTunnel]}, {name: "SNSSAI", value: func(t testing.TB) per.Marshaler { s := snssai(t); return &s }, decode: decodeAs[SNSSAI]}, {name: "UPTransportLayerInformationItem", value: func(t testing.TB) per.Marshaler { @@ -843,7 +846,7 @@ func losslessCases() []losslessCase { } }, decode: decodeAs[UserPlaneSecurityInformation]}, {name: "QosFlowWithCauseItem", value: func(t testing.TB) per.Marshaler { - return &QosFlowWithCauseItem{QosFlowIdentifier: 1, Cause: Cause{Group: CauseGroupMisc}, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} + return &QosFlowWithCauseItem{QosFlowIdentifier: 1, Cause: CauseMisc(0).Cause(), iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} }, decode: decodeAs[QosFlowWithCauseItem]}, {name: "QosFlowAcceptedItem", value: func(t testing.TB) per.Marshaler { return &QosFlowAcceptedItem{QosFlowIdentifier: 1, iEExtensions: unknownRawExtensions(t), extensions: unknownAdditions(t)} @@ -915,7 +918,7 @@ func losslessCases() []losslessCase { v := tnlSetupResponseTransfer() v.DLQosFlowPerTNLInformation = qosTNL(t) v.SecurityResult = &SecurityResult{iEExtensions: unknownRawExtensions(t)} - v.QosFlowFailedToSetup = QosFlowListWithCause{{QosFlowIdentifier: 2, Cause: Cause{Group: CauseGroupMisc}, extensions: unknownAdditions(t)}} + v.QosFlowFailedToSetup = QosFlowListWithCause{{QosFlowIdentifier: 2, Cause: CauseMisc(0).Cause(), extensions: unknownAdditions(t)}} v.iEExtensions, v.extensions = unknownMeta(t), unknownAdditions(t) return v @@ -1002,7 +1005,7 @@ func TestTNLStructuresKeepUnknownExtensions(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(twice, out) { + if !equalByMethod(twice, out) { t.Fatalf("re-decoded\n got %+v\nwant %+v", twice, out) } @@ -1019,13 +1022,15 @@ func TestTNLStructuresKeepUnknownExtensions(t *testing.T) { func TestTNLItemKeepsUnknownExtensionCriticalityAndOrder(t *testing.T) { in := &HandoverCommandTransfer{ULForwardingUPTNLInformation: upTNLPtr(1, 0xa05)} - in.iEExtensions.preserve(rawIE{id: unknownExtensionID, crit: CriticalityNotify, value: []byte{0x01}}) - in.iEExtensions.wire = []wireSlot{ - {id: unknownExtensionID, crit: CriticalityNotify, unknown: 0}, - {id: IDULForwardingUPTNLInformation, crit: CriticalityReject, unknown: -1}, - } + restore := swapTable(&extIEsHandoverCommandTransfer, + rawRow[HandoverCommandTransfer](unknownExtensionID, CriticalityNotify, []byte{0x01}), + tableRow(extIEsHandoverCommandTransfer, IDULForwardingUPTNLInformation, CriticalityReject), + ) b, err := in.Marshal() + + restore() + if err != nil { t.Fatal(err) } @@ -1039,15 +1044,6 @@ func TestTNLItemKeepsUnknownExtensionCriticalityAndOrder(t *testing.T) { t.Fatalf("unknown extensions %+v", got) } - ids := make([]ProtocolIEID, 0, len(out.iEExtensions.wire)) - for _, s := range out.iEExtensions.wire { - ids = append(ids, s.id) - } - - if !slices.Equal(ids, []ProtocolIEID{unknownExtensionID, IDULForwardingUPTNLInformation}) { - t.Fatalf("wire order %v", ids) - } - again, err := out.Marshal() if err != nil || !bytes.Equal(again, b) { t.Fatalf("re-encoded %x (%v), want %x", again, err, b) @@ -1056,7 +1052,7 @@ func TestTNLItemKeepsUnknownExtensionCriticalityAndOrder(t *testing.T) { func TestTNLTransferRejectsUnknownRejectExtension(t *testing.T) { in := &HandoverCommandTransfer{} - in.iEExtensions.preserve(rawIE{id: unknownExtensionID, crit: CriticalityReject, value: []byte{0x01}}) + in.iEExtensions.Append(rawIE{ID: unknownExtensionID, Criticality: CriticalityReject, Value: []byte{0x01}}) b, err := in.Marshal() if err != nil { @@ -1214,12 +1210,12 @@ const ( func TestTNLRequestTransfersKeepUnknownIEsAndAdditions(t *testing.T) { setup := tnlSetupRequestTransfer() - setup.preserve(rawIE{id: unknownExtensionID, crit: CriticalityIgnore, value: []byte{0xde, 0xad}}) - setup.extensions = unknownAdditions(t) + setup.Append(rawIE{ID: unknownExtensionID, Criticality: CriticalityIgnore, Value: []byte{0xde, 0xad}}) + setup.ExtensionAdditions = unknownAdditions(t) modify := tnlModifyRequestTransfer() - modify.preserve(rawIE{id: unknownExtensionID, crit: CriticalityNotify, value: []byte{0xde, 0xad}}) - modify.extensions = unknownAdditions(t) + modify.Append(rawIE{ID: unknownExtensionID, Criticality: CriticalityNotify, Value: []byte{0xde, 0xad}}) + modify.ExtensionAdditions = unknownAdditions(t) for _, c := range []struct { name string @@ -1269,18 +1265,18 @@ func TestTNLRequestTransfersKeepUnknownIEsAndAdditions(t *testing.T) { func TestTNLManyUnknownExtensionsKeptExactly(t *testing.T) { in := tnlHandoverCommandTransfer() - fields := make([]ieField, 0, 3*maxPreservedIEs) - for i := range 3 * maxPreservedIEs { - fields = append(fields, ieField{id: unknownExtensionID - ProtocolIEID(i), crit: CriticalityIgnore, raw: []byte{byte(i)}}) + fields := make([]ieField, 0, 3*paddingIEs) + for i := range 3 * paddingIEs { + fields = append(fields, ieField{ID: unknownExtensionID - ProtocolIEID(i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{byte(i)})}) } w := per.NewWriter() tbNil(t, encodeExtensionContainer(w, per.Aligned, fields)) w.AlignToByte() - tbNil(t, decodeExtensionContainer(per.NewReader(w.Bytes()), per.Aligned, handoverCommandTransferExtIEs, in, &in.iEExtensions)) + tbNil(t, decodeExtensionContainer(per.NewReader(w.Bytes()), per.Aligned, extIEsHandoverCommandTransfer, in, &in.iEExtensions)) - if got := len(in.iEExtensions.UnknownIEs()); got != 3*maxPreservedIEs { - t.Fatalf("kept %d unknown extensions, want %d", got, 3*maxPreservedIEs) + if got := len(in.iEExtensions.UnknownIEs()); got != 3*paddingIEs { + t.Fatalf("kept %d unknown extensions, want %d", got, 3*paddingIEs) } b, err := in.Marshal() @@ -1314,13 +1310,13 @@ func TestTNLRequestTransferKeepsManyUnknownIEs(t *testing.T) { fields, err := decodeIEContainer(r, per.Aligned) tbNil(t, err) - all := make([]ieField, 0, len(fields)+3*maxPreservedIEs) + all := make([]ieField, 0, len(fields)+3*paddingIEs) for _, f := range fields { - all = append(all, f.field()) + all = append(all, f.Encodable()) } - for i := range 3 * maxPreservedIEs { - all = append(all, ieField{id: unknownExtensionID - ProtocolIEID(i), crit: CriticalityIgnore, raw: []byte{byte(i)}}) + for i := range 3 * paddingIEs { + all = append(all, ieField{ID: unknownExtensionID - ProtocolIEID(i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{byte(i)})}) } w := per.NewWriter() @@ -1333,8 +1329,8 @@ func TestTNLRequestTransferKeepsManyUnknownIEs(t *testing.T) { t.Fatal(err) } - if got := len(out.UnknownIEs()); got != 3*maxPreservedIEs { - t.Fatalf("kept %d unknown IEs, want %d", got, 3*maxPreservedIEs) + if got := len(out.UnknownIEs()); got != 3*paddingIEs { + t.Fatalf("kept %d unknown IEs, want %d", got, 3*paddingIEs) } again, err := out.Marshal() @@ -1343,18 +1339,30 @@ func TestTNLRequestTransferKeepsManyUnknownIEs(t *testing.T) { } } -func TestMessageTruncatedOnDecodeRefusesToEncode(t *testing.T) { +func TestMessageWithManyUnknownIEsReencodesLosslessly(t *testing.T) { fields := ngSetupFields() - for i := range maxPreservedIEs + 1 { - fields = append(fields, ieField{id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}}) + for i := range paddingIEs + 1 { + fields = append(fields, ieField{ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00})}) + } + + value := container(t, fields...) + + msg, err := ParseNGSetupRequest(value) + if err != nil { + t.Fatal(err) + } + + b, err := msg.Marshal() + if err != nil { + t.Fatal(err) } - msg, err := ParseNGSetupRequest(container(t, fields...)) + pdu, err := Unmarshal(b) if err != nil { t.Fatal(err) } - if _, err := msg.Marshal(); err == nil { - t.Fatal("a message whose unknown IEs were dropped on decode re-encoded") + if !bytes.Equal(pdu.value(), value) { + t.Fatalf("re-encoded %x, want %x", pdu.value(), value) } } diff --git a/ngap/trace.go b/ngap/trace.go index 101b3d3a81..4cfaec800c 100644 --- a/ngap/trace.go +++ b/ngap/trace.go @@ -4,8 +4,6 @@ package ngap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -35,90 +33,58 @@ const ( TraceDepthMinimumWithoutVendorSpecificExtension TraceDepthMediumWithoutVendorSpecificExtension TraceDepthMaximumWithoutVendorSpecificExtension + TraceDepthMinimumOnlyVendorSpecificTraceRecord + TraceDepthMediumOnlyVendorSpecificTraceRecord + TraceDepthMaximumOnlyVendorSpecificTraceRecord ) -const traceDepthRootValues = 6 +type InterfacesToTrace uint8 const ( - InterfaceToTraceNGC uint8 = 1 << (7 - iota) + InterfaceToTraceNGC InterfacesToTrace = 1 << (7 - iota) InterfaceToTraceXnC InterfaceToTraceUu InterfaceToTraceF1C InterfaceToTraceE1 ) -type TraceActivation struct { - NGRANTraceID NGRANTraceID - InterfacesToTrace uint8 - TraceDepth TraceDepth - TraceCollectionEntityIPAddress TransportLayerAddress +func (i InterfacesToTrace) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeBitString(w, enc, 8, 8, true, true, false, []byte{byte(i)}, 8) } -func (t TraceActivation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - - if err := t.NGRANTraceID.MarshalPER(w, enc); err != nil { - return err - } - - if err := per.EncodeBitString(w, enc, 8, 8, true, true, false, []byte{t.InterfacesToTrace}, 8); err != nil { - return err - } - - if err := encodeRootEnumerated(w, enc, traceDepthRootValues, int64(t.TraceDepth), "TraceDepth"); err != nil { - return err - } - - if len(t.TraceCollectionEntityIPAddress) == 0 { - return fmt.Errorf("ngap: TraceActivation without a Trace Collection Entity IP Address") - } - - return t.TraceCollectionEntityIPAddress.MarshalPER(w, enc) -} - -func (t *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - var v TraceActivation - - if err := v.NGRANTraceID.UnmarshalPER(r, enc); err != nil { - return err - } - +func (i *InterfacesToTrace) UnmarshalPER(r *per.Reader, enc per.Encoding) error { b, _, err := per.DecodeBitString(r, enc, 8, 8, true, true, false) if err != nil { return err } - v.InterfacesToTrace = b[0] + *i = InterfacesToTrace(b[0]) - depth, err := decodeRootEnumerated(r, enc, traceDepthRootValues, "TraceDepth") - if err != nil { - return err - } + return nil +} - v.TraceDepth = TraceDepth(depth) +type URIAddress string - if err := v.TraceCollectionEntityIPAddress.UnmarshalPER(r, enc); err != nil { - return err - } +func (u URIAddress) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeKnownMultiplierString(w, enc, per.CharVisibleString, 0, 0, true, false, false, string(u)) +} - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err - } +func (u *URIAddress) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + s, err := per.DecodeKnownMultiplierString(r, enc, per.CharVisibleString, 0, 0, true, false, false) + *u = URIAddress(s) - *t = v + return err +} - return nil +type TraceActivation struct { + NGRANTraceID NGRANTraceID + InterfacesToTrace InterfacesToTrace + TraceDepth TraceDepth + TraceCollectionEntityIPAddress TransportLayerAddress + MDTConfiguration *MDTConfiguration `per:",extie:IDMDTConfiguration,crit:ignore"` + TraceCollectionEntityURI *URIAddress `per:",extie:IDTraceCollectionEntityURI,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type TraceStart struct { @@ -131,25 +97,25 @@ type TraceStart struct { var traceStartIEs = []ieSpec[TraceStart]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceStart, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceStart, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceStart, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceStart, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDTraceActivation, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *TraceStart, raw []byte, enc per.Encoding) error { + ID: IDTraceActivation, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *TraceStart, r *per.Reader, enc per.Encoding) error { var v TraceActivation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -157,7 +123,7 @@ var traceStartIEs = []ieSpec[TraceStart]{ return nil }, - encode: func(m *TraceStart) (per.Marshaler, bool) { + Encode: func(m *TraceStart) (per.Marshaler, bool) { if m.TraceActivation == nil { return nil, false } @@ -191,6 +157,10 @@ func ParseTraceStart(value []byte) (*TraceStart, error) { return parseMessageBody[TraceStart](ProcTraceStart, TriggeringInitiatingMessage, traceStartIEs, value) } +func DecodeTraceStart(value []byte) (*TraceStart, error) { + return decodeMessageBody[TraceStart](ProcTraceStart, traceStartIEs, value) +} + type TraceFailureIndication struct { AMFUENGAPID AMFUENGAPID RANUENGAPID RANUENGAPID @@ -202,25 +172,25 @@ type TraceFailureIndication struct { var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDNGRANTraceID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { + ID: IDNGRANTraceID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { var v NGRANTraceID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -228,7 +198,7 @@ var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ return nil }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { if m.NGRANTraceID == nil { return nil, false } @@ -237,11 +207,11 @@ var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -249,7 +219,7 @@ var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ return nil }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -282,3 +252,12 @@ func (m *TraceFailureIndication) Marshal() ([]byte, error) { func ParseTraceFailureIndication(value []byte) (*TraceFailureIndication, error) { return parseMessageBody[TraceFailureIndication](ProcTraceFailureIndication, TriggeringInitiatingMessage, traceFailureIndicationIEs, value) } + +func DecodeTraceFailureIndication(value []byte) (*TraceFailureIndication, error) { + return decodeMessageBody[TraceFailureIndication](ProcTraceFailureIndication, traceFailureIndicationIEs, value) +} + +func m1IncludesBeamMeasurements(c *M1Configuration) bool { + return c.IncludeBeamMeasurementsIndication != nil && + *c.IncludeBeamMeasurementsIndication == IncludeBeamMeasurementsIndicationTrue +} diff --git a/ngap/trace_test.go b/ngap/trace_test.go index 90b04405b8..8a46e141f6 100644 --- a/ngap/trace_test.go +++ b/ngap/trace_test.go @@ -4,8 +4,12 @@ package ngap import ( + "bytes" "encoding/hex" "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const ( @@ -20,7 +24,7 @@ func goldenTraceActivation() TraceActivation { NGRANTraceID: goldenTraceID, InterfacesToTrace: InterfaceToTraceNGC | InterfaceToTraceXnC | InterfaceToTraceUu | InterfaceToTraceF1C | InterfaceToTraceE1, TraceDepth: TraceDepthMinimum, - TraceCollectionEntityIPAddress: TransportLayerAddress{10, 0, 0, 1}, + TraceCollectionEntityIPAddress: tlaOf(10, 0, 0, 1), } } @@ -59,7 +63,7 @@ func TestTraceStartGolden(t *testing.T) { got := *out.TraceActivation if got.NGRANTraceID != ta.NGRANTraceID || got.InterfacesToTrace != ta.InterfacesToTrace || - got.TraceDepth != ta.TraceDepth || hex.EncodeToString(got.TraceCollectionEntityIPAddress) != "0a000001" { + got.TraceDepth != ta.TraceDepth || got.TraceCollectionEntityIPAddress != ta.TraceCollectionEntityIPAddress { t.Fatalf("round trip TraceActivation %+v, want %+v", got, ta) } } @@ -72,14 +76,49 @@ func TestTraceStartRequiresTraceActivation(t *testing.T) { } } -func TestTraceActivationRequiresTCEAddress(t *testing.T) { +func TestTraceActivationTraceCollectionEntityURIExtension(t *testing.T) { ta := goldenTraceActivation() - ta.TraceCollectionEntityIPAddress = nil + ta.TraceCollectionEntityURI = Ptr(URIAddress("http://tce.example/collect")) - in := TraceStart{AMFUENGAPID: 1, RANUENGAPID: 2, TraceActivation: &ta} + w := per.NewWriter() + if err := ta.MarshalPER(w, per.Aligned); err != nil { + t.Fatal(err) + } - if _, err := in.Marshal(); err == nil { - t.Fatal("encoded a Trace Activation without a TCE address") + uri, err := per.Marshal(ta.TraceCollectionEntityURI) + if err != nil { + t.Fatal(err) + } + + bare := goldenTraceActivation() + + want := per.NewWriter() + want.WriteBit(false) + want.WriteBit(true) + + for _, m := range []per.Marshaler{&bare.NGRANTraceID, &bare.InterfacesToTrace, &bare.TraceDepth, &bare.TraceCollectionEntityIPAddress} { + if err := m.MarshalPER(want, per.Aligned); err != nil { + t.Fatal(err) + } + } + + if err := encodeExtensionContainer(want, per.Aligned, []ieField{ + {ID: IDTraceCollectionEntityURI, Criticality: CriticalityIgnore, Value: ap.RawValue(uri)}, + }); err != nil { + t.Fatal(err) + } + + if !bytes.Equal(perBytes(w), perBytes(want)) { + t.Fatalf("encoding = % x, want % x", perBytes(w), perBytes(want)) + } + + out, err := unmarshalPERValue[TraceActivation](perBytes(w)) + if err != nil { + t.Fatal(err) + } + + if !out.Equal(ta) { + t.Errorf("round trip = %+v, want %+v", out, ta) } } @@ -104,10 +143,10 @@ func TestTraceFailureIndicationGolden(t *testing.T) { t.Fatal(err) } - want := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverCancelled} + want := CauseRadioNetworkHandoverCancelled.Cause() if out.AMFUENGAPID != 1 || out.RANUENGAPID != 2 || out.NGRANTraceID == nil || *out.NGRANTraceID != goldenTraceID || - out.Cause == nil || *out.Cause != want { + out.Cause == nil || !(*out.Cause).Equal(want) { t.Fatalf("decoded %+v", out) } @@ -126,9 +165,9 @@ func TestHandoverRequestTraceActivationRoundTrip(t *testing.T) { in := HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, - UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)}, SecurityContext: SecurityContext{NextHopChainingCount: 1}, PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: handoverSetupTransfer(t), diff --git a/ngap/transparent_container.go b/ngap/transparent_container.go index b36d83de0e..313390e886 100644 --- a/ngap/transparent_container.go +++ b/ngap/transparent_container.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const ( @@ -33,14 +34,24 @@ const ( ) type SourceNGRANNodeToTargetNGRANNodeTransparentContainer struct { - RRCContainer RRCContainer - PDUSessionResourceInformationList PDUSessionResourceInformationList `per:",optional"` - ERABInformationList ERABInformationList `per:",optional"` - TargetCellID NGRANCGI - IndexToRFSP *IndexToRFSP `per:",optional"` - UEHistoryInformation UEHistoryInformation - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + RRCContainer RRCContainer + PDUSessionResourceInformationList PDUSessionResourceInformationList `per:",optional"` + ERABInformationList ERABInformationList `per:",optional"` + TargetCellID NGRANCGI + IndexToRFSP *IndexToRFSP `per:",optional"` + UEHistoryInformation UEHistoryInformation + SgNBUEX2APID *SgNBUEX2APID `per:",extie:IDSgNBUEX2APID,crit:ignore"` + UEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE `per:",extie:IDUEHistoryInformationFromTheUE,crit:ignore"` + SourceNodeID *SourceNodeID `per:",extie:IDSourceNodeID,crit:ignore"` + UEContextReferenceAtSource *RANUENGAPID `per:",extie:IDUEContextReferenceAtSource,crit:ignore"` + MBSActiveSessionInformationSourcetoTargetList MBSActiveSessionInformationSourcetoTargetList `per:",extie:IDMBSActiveSessionInformationSourcetoTargetList,crit:ignore"` + QMCConfigInfo *QMCConfigInfo `per:",extie:IDQMCConfigInfo,crit:ignore"` + NGAPIESupportInformationRequestList NGAPIESupportInformationRequestList `per:",extie:IDNGAPIESupportInformationRequestList,crit:ignore"` + CandidateRelayUEInformationList CandidateRelayUEInformationList `per:",extie:IDCandidateRelayUEInformationList,crit:reject"` + TimeBasedHandoverInformation *TimeBasedHandoverInformation `per:",extie:IDTimeBasedHandoverInformation,crit:ignore"` + SourceSNtoTargetSNQMCInfo *QMCConfigInfo `per:",extie:IDSourceSNtoTargetSNQMCInfo,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } func (c *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Marshal() (SourceToTargetTransparentContainer, error) { @@ -55,14 +66,26 @@ func (c *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Marshal() (Source return SourceToTargetTransparentContainer(w.Bytes()), nil } -func ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b []byte) (*SourceNGRANNodeToTargetNGRANNodeTransparentContainer, error) { - var c SourceNGRANNodeToTargetNGRANNodeTransparentContainer +func DecodeSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b []byte) (*SourceNGRANNodeToTargetNGRANNodeTransparentContainer, error) { + c, err := decodeTransfer[SourceNGRANNodeToTargetNGRANNodeTransparentContainer](b) + if err != nil { + return nil, fmt.Errorf("ngap: SourceNGRANNode-ToTargetNGRANNode-TransparentContainer: %w", err) + } - if err := c.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + return c, nil +} + +func ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b []byte) (*SourceNGRANNodeToTargetNGRANNodeTransparentContainer, error) { + c, err := parseTransfer[SourceNGRANNodeToTargetNGRANNodeTransparentContainer](b) + if err != nil { return nil, fmt.Errorf("ngap: SourceNGRANNode-ToTargetNGRANNode-TransparentContainer: %w", err) } - return &c, nil + return c, nil +} + +func (c *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Diagnostics() Diagnostics { + return diagnosticsOf(c) } type RRCContainer []byte @@ -86,7 +109,7 @@ type PDUSessionResourceInformationItem struct { PDUSessionID PDUSessionID QosFlowInformationList QosFlowInformationList DRBsToQosFlowsMappingList DRBsToQosFlowsMappingList `per:",optional"` - iEExtensions *transparentIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -108,10 +131,13 @@ func (l *PDUSessionResourceInformationList) UnmarshalPER(r *per.Reader, enc per. } type QosFlowInformationItem struct { - QosFlowIdentifier QosFlowIdentifier - DLForwarding *DLForwarding `per:",optional"` - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + QosFlowIdentifier QosFlowIdentifier + DLForwarding *DLForwarding `per:",optional"` + ULForwarding *ULForwarding `per:",extie:IDULForwarding,crit:ignore"` + SourceTNLAddrInfo *TransportLayerAddress `per:",extie:IDSourceTNLAddrInfo,crit:ignore"` + SourceNodeTNLAddrInfo *TransportLayerAddress `per:",extie:IDSourceNodeTNLAddrInfo,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type QosFlowInformationList []QosFlowInformationItem @@ -134,8 +160,9 @@ func (l *QosFlowInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) e type DRBsToQosFlowsMappingItem struct { DRBID DRBID AssociatedQosFlowList AssociatedQosFlowList - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + DAPSRequestInfo *DAPSRequestInfo `per:",extie:IDDAPSRequestInfo,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type DRBsToQosFlowsMappingList []DRBsToQosFlowsMappingItem @@ -159,30 +186,15 @@ type DLForwarding uint8 const ( DLForwardingProposed DLForwarding = iota - - dlForwardingRootCount = 1 ) -func (d DLForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, dlForwardingRootCount, int64(d), "DLForwarding") -} - -func (d *DLForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, dlForwardingRootCount, "DLForwarding") - if err != nil { - return err - } - - *d = DLForwarding(idx) - - return nil -} - type ERABInformationItem struct { - ERABID ERABID - DLForwarding *DLForwarding `per:",optional"` - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + DLForwarding *DLForwarding `per:",optional"` + SourceTNLAddrInfo *TransportLayerAddress `per:",extie:IDSourceTNLAddrInfo,crit:ignore"` + SourceNodeTNLAddrInfo *TransportLayerAddress `per:",extie:IDSourceNodeTNLAddrInfo,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type ERABInformationList []ERABInformationItem @@ -203,61 +215,9 @@ func (l *ERABInformationList) UnmarshalPER(r *per.Reader, enc per.Encoding) erro } type NGRANCGI struct { - NRCGI *NRCGI - EUTRACGI *EUTRACGI - choiceExtension *rawIE -} - -func (c *NGRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := chosenAlternative("NGRAN-CGI", c.NRCGI != nil, c.EUTRACGI != nil, c.choiceExtension != nil) - if err != nil { - return err - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, ngranCGIAlternatives-1, idx); err != nil { - return err - } - - switch idx { - case ngranCGINR: - return c.NRCGI.MarshalPER(w, enc) - case ngranCGIEUTRA: - return c.EUTRACGI.MarshalPER(w, enc) - default: - return encodeContainerField(w, enc, c.choiceExtension.field()) - } -} - -func (c *NGRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, ngranCGIAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: NGRAN-CGI choice: %w", err) - } - - *c = NGRANCGI{} - - switch idx { - case ngranCGINR: - var v NRCGI - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - c.NRCGI = &v - case ngranCGIEUTRA: - var v EUTRACGI - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - c.EUTRACGI = &v - default: - c.choiceExtension, err = decodeTransparentChoiceExtension(r, enc) - - return err - } - - return nil + NRCGI *NRCGI `per:",choice:0"` + EUTRACGI *EUTRACGI `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` } type IndexToRFSP uint16 @@ -267,16 +227,18 @@ func (i IndexToRFSP) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (i *IndexToRFSP) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 1, 256, "IndexToRFSP") + v, err := decodeExtensibleInt[IndexToRFSP](r, enc, 1, 256) if err != nil { return err } - *i = IndexToRFSP(v) + *i = v return nil } +func (v IndexToRFSP) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return outsideRoot(int64(v), 1, 256) } + type UEHistoryInformation []LastVisitedCellItem func (u UEHistoryInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -296,86 +258,16 @@ func (u *UEHistoryInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) err type LastVisitedCellItem struct { LastVisitedCellInformation LastVisitedCellInformation - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type LastVisitedCellInformation struct { - NGRANCell *LastVisitedNGRANCellInformation - EUTRANCell *LastVisitedEUTRANCellInformation - UTRANCell *LastVisitedUTRANCellInformation - GERANCell *LastVisitedGERANCellInformation - choiceExtension *rawIE -} - -func (l *LastVisitedCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := chosenAlternative("LastVisitedCellInformation", l.NGRANCell != nil, l.EUTRANCell != nil, l.UTRANCell != nil, l.GERANCell != nil, l.choiceExtension != nil) - if err != nil { - return err - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, lastVisitedCellInformationAlternatives-1, idx); err != nil { - return err - } - - switch idx { - case lastVisitedCellInformationNGRAN: - return l.NGRANCell.MarshalPER(w, enc) - case lastVisitedCellInformationEUTRAN: - return l.EUTRANCell.MarshalPER(w, enc) - case lastVisitedCellInformationUTRAN: - return l.UTRANCell.MarshalPER(w, enc) - case lastVisitedCellInformationGERAN: - return l.GERANCell.MarshalPER(w, enc) - default: - return encodeContainerField(w, enc, l.choiceExtension.field()) - } -} - -func (l *LastVisitedCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, lastVisitedCellInformationAlternatives-1) - if err != nil { - return fmt.Errorf("ngap: LastVisitedCellInformation choice: %w", err) - } - - *l = LastVisitedCellInformation{} - - switch idx { - case lastVisitedCellInformationNGRAN: - var v LastVisitedNGRANCellInformation - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - l.NGRANCell = &v - case lastVisitedCellInformationEUTRAN: - var v LastVisitedEUTRANCellInformation - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - l.EUTRANCell = &v - case lastVisitedCellInformationUTRAN: - var v LastVisitedUTRANCellInformation - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - l.UTRANCell = &v - case lastVisitedCellInformationGERAN: - var v LastVisitedGERANCellInformation - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - l.GERANCell = &v - default: - l.choiceExtension, err = decodeTransparentChoiceExtension(r, enc) - - return err - } - - return nil + NGRANCell *LastVisitedNGRANCellInformation `per:",choice:0"` + EUTRANCell *LastVisitedEUTRANCellInformation `per:",choice:1"` + UTRANCell *LastVisitedUTRANCellInformation `per:",choice:2"` + GERANCell *LastVisitedGERANCellInformation `per:",choice:3"` + ChoiceExtension *SingleContainer `per:",choice:4,extie"` } type LastVisitedNGRANCellInformation struct { @@ -384,14 +276,15 @@ type LastVisitedNGRANCellInformation struct { TimeUEStayedInCell TimeUEStayedInCell TimeUEStayedInCellEnhancedGranularity *TimeUEStayedInCellEnhancedGranularity `per:",optional"` HOCauseValue *Cause `per:",optional"` - iEExtensions *transparentIEExtensions `per:",optional"` + LastVisitedPSCellList LastVisitedPSCellList `per:",extie:IDLastVisitedPSCellList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } type CellType struct { CellSize CellSize - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type CellSize uint8 @@ -401,25 +294,8 @@ const ( CellSizeSmall CellSizeMedium CellSizeLarge - - cellSizeRootCount = 4 ) -func (c CellSize) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, cellSizeRootCount, int64(c), "CellSize") -} - -func (c *CellSize) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, cellSizeRootCount, "CellSize") - if err != nil { - return err - } - - *c = CellSize(idx) - - return nil -} - type TimeUEStayedInCell uint16 func (t TimeUEStayedInCell) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -504,72 +380,3 @@ func (c *LastVisitedGERANCellInformation) UnmarshalPER(r *per.Reader, enc per.En return nil } - -func decodeTransparentChoiceExtension(r *per.Reader, enc per.Encoding) (*rawIE, error) { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return nil, err - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return nil, err - } - - value, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return nil, err - } - - if len(value) == 0 { - return nil, fmt.Errorf("ngap: empty open type for choice-Extensions IE %d", id) - } - - return &rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: value}, nil -} - -type transparentIEExtensions struct { - data []byte - nbits int -} - -func (e *transparentIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { - if enc == per.Aligned { - w.AlignToByte() - } - - w.WriteBitString(e.data, e.nbits) - - return nil -} - -func (e *transparentIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - if enc == per.Aligned { - r.AlignToByte() - } - - start := r.Offset() - - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) - if err != nil { - return err - } - - for range n { - if _, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs); err != nil { - return err - } - - if _, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false); err != nil { - return err - } - - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - - e.data, e.nbits, err = r.Since(start) - - return err -} diff --git a/ngap/transparent_container_test.go b/ngap/transparent_container_test.go index 6bc4acb9cd..cf3e09f0ae 100644 --- a/ngap/transparent_container_test.go +++ b/ngap/transparent_container_test.go @@ -6,13 +6,12 @@ package ngap import ( "bytes" "encoding/hex" - "errors" "os/exec" - "reflect" "strings" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const goldenSourceNGRANContainer = "7001800040050501004000050140200145030002f8391234567890ff10320002f8390abcdef1800fff9ff604020b0002f83900001011000064" @@ -45,7 +44,7 @@ func goldSourceNGRANContainer() *SourceNGRANNodeToTargetNGRANNodeTransparentCont CellType: CellType{CellSize: CellSizeLarge}, TimeUEStayedInCell: 4095, TimeUEStayedInCellEnhancedGranularity: Ptr(TimeUEStayedInCellEnhancedGranularity(40950)), - HOCauseValue: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + HOCauseValue: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), }}}, {LastVisitedCellInformation: LastVisitedCellInformation{EUTRANCell: Ptr(LastVisitedEUTRANCellInformation(mustHexBytes(goldenS1APLastVisitedEUTRANCellInformation)))}}, }, @@ -78,7 +77,7 @@ func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerGolden(t *testing.T t.Fatal(err) } - if !reflect.DeepEqual(out, in) { + if !out.Equal(*in) { t.Fatalf("decoded\n got %+v\nwant %+v", out, in) } @@ -113,7 +112,7 @@ func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerMinimal(t *testing. t.Fatal(err) } - if !reflect.DeepEqual(out, in) { + if !out.Equal(*in) { t.Fatalf("decoded\n got %+v\nwant %+v", out, in) } } @@ -138,12 +137,6 @@ func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerRejectsInvalid(t *t TargetCellID: NGRANCGI{NRCGI: &NRCGI{}}, UEHistoryInformation: UEHistoryInformation{{}}, }, - "index to RFSP out of root": { - RRCContainer: RRCContainer{0x80}, - TargetCellID: NGRANCGI{NRCGI: &NRCGI{}}, - IndexToRFSP: Ptr(IndexToRFSP(0)), - UEHistoryInformation: UEHistoryInformation{{LastVisitedCellInformation: LastVisitedCellInformation{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}}}, - }, } { t.Run(name, func(t *testing.T) { if _, err := c.Marshal(); err == nil { @@ -181,7 +174,7 @@ func handAdditions(t *testing.T, w *per.Writer) { func handChoiceExtension(t *testing.T, w *per.Writer) { t.Helper() - mustNil(t, encodeContainerField(w, per.Aligned, ieField{id: 998, crit: CriticalityIgnore, raw: []byte{0x01, 0x02, 0x03}})) + mustNil(t, encodeContainerField(w, ieField{ID: 998, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01, 0x02, 0x03})})) } func handSourceNGRANContainer(t *testing.T, extCrit Criticality) []byte { @@ -241,12 +234,16 @@ func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerLossless(t *testing t.Run(crit.String(), func(t *testing.T) { b := handSourceNGRANContainer(t, crit) - c, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) + c, err := DecodeSourceNGRANNodeToTargetNGRANNodeTransparentContainer(b) if err != nil { t.Fatal(err) } - if c.TargetCellID.NRCGI != nil || c.TargetCellID.EUTRACGI != nil || c.TargetCellID.choiceExtension == nil || c.TargetCellID.choiceExtension.id != 998 { + if d := c.Diagnostics(); len(d.IEs) == 0 { + t.Fatal("unknown extensions and alternatives in the container are not reported") + } + + if c.TargetCellID.NRCGI != nil || c.TargetCellID.EUTRACGI != nil || c.TargetCellID.ChoiceExtension == nil || c.TargetCellID.ChoiceExtension.ID != 998 { t.Fatalf("targetCell-ID = %+v", c.TargetCellID) } @@ -289,10 +286,27 @@ func TestSourceNGRANNodeToTargetNGRANNodeTransparentContainerExtensionValue(t *t mustNil(t, RRCContainer{0x80}.MarshalPER(w, per.Aligned)) mustNil(t, (&NGRANCGI{NRCGI: &NRCGI{}}).MarshalPER(w, per.Aligned)) mustNil(t, per.EncodeInteger(w, per.Aligned, per.Bounds{LB: 1, HasLB: true, UB: 256, HasUB: true, Extensible: true}, 300)) + mustNil(t, (UEHistoryInformation{{LastVisitedCellInformation: LastVisitedCellInformation{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}}}).MarshalPER(w, per.Aligned)) w.AlignToByte() - if _, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(w.Bytes()); !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want not comprehended", err) + c, err := DecodeSourceNGRANNodeToTargetNGRANNodeTransparentContainer(w.Bytes()) + if err != nil { + t.Fatalf("decode: %v", err) + } + + if deref(c.IndexToRFSP) != 300 { + t.Errorf("IndexToRFSP = %v, want the extension value 300 kept", c.IndexToRFSP) + } + + re, err := c.Marshal() + mustNil(t, err) + + if !bytes.Equal(re, w.Bytes()) { + t.Errorf("re-encode = % x, want % x", re, w.Bytes()) + } + + if _, err := ParseSourceNGRANNodeToTargetNGRANNodeTransparentContainer(w.Bytes()); err == nil { + t.Fatal("Parse accepted an IndexToRFSP outside its root, want it reported not comprehended") } } @@ -303,14 +317,14 @@ func goldContainerHandoverRequest() *HandoverRequest { } transfer, err := (&PDUSessionResourceSetupRequestTransfer{ - ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: GTPTunnel{ - TransportLayerAddress: TransportLayerAddress{192, 168, 1, 1}, GTPTEID: 1, + ULNGUUPTNLInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{ + TransportLayerAddress: tlaOf(192, 168, 1, 1), GTPTEID: 1, }}, PDUSessionType: PDUSessionTypeIPv4, QosFlowSetupRequest: QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ - QosCharacteristics: QosCharacteristics{Kind: QosCharacteristicsNonDynamic5QI, NonDynamic5QI: NonDynamic5QIDescriptor{FiveQI: 9}}, + QosCharacteristics: QosCharacteristics{NonDynamic5QI: &NonDynamic5QIDescriptor{FiveQI: 9}}, AllocationAndRetentionPriority: AllocationAndRetentionPriority{PriorityLevelARP: 1}, }, }}, @@ -322,9 +336,9 @@ func goldContainerHandoverRequest() *HandoverRequest { return &HandoverRequest{ AMFUENGAPID: 1, HandoverType: HandoverTypeIntra5GS, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverDesirableForRadio}, + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1000000000, UL: 1000000000}, - UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)}, SecurityContext: SecurityContext{NextHopChainingCount: 1}, PDUSessionResourceSetupListHOReq: PDUSessionResourceSetupListHOReq{{ PDUSessionID: 5, SNSSAI: SNSSAI{SST: 1}, Transfer: transfer, @@ -333,19 +347,16 @@ func goldContainerHandoverRequest() *HandoverRequest { SourceToTargetTransparentContainer: c, GUAMI: GUAMI{PLMNIdentity: containerPLMN(), AMFRegionID: 1, AMFSetID: 1}, AMFUENGAPID2: Ptr(AMFUENGAPID(3)), - TargetRANNodeID: &GlobalRANNodeID{Kind: RANNodeIDGNB, PLMNIdentity: containerPLMN(), Value: 0x12345, Bits: 22}, + TargetRANNodeID: Ptr(NewGlobalGNBID(containerPLMN(), 0x12345, 22)), } } func goldPathSwitchRequestSourceAMFGUAMI() *PathSwitchRequest { return &PathSwitchRequest{ - RANUENGAPID: 2, - SourceAMFUENGAPID: 1, - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: containerPLMN(), CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: containerPLMN(), TAC: 1}, - }, - UESecurityCapabilities: &UESecurityCapabilities{NREncryptionAlgorithms: 0x8000, NRIntegrityProtectionAlgorithms: 0x8000}, + RANUENGAPID: 2, + SourceAMFUENGAPID: 1, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: containerPLMN(), NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: containerPLMN(), TAC: 1}}}, + UESecurityCapabilities: &UESecurityCapabilities{NREncryptionAlgorithms: SecurityAlgorithmsFrom(0x8000), NRIntegrityProtectionAlgorithms: SecurityAlgorithmsFrom(0x8000)}, PDUSessionResourceToBeSwitchedDLList: PDUSessionResourceToBeSwitchedDLList{ {PDUSessionID: 5, Transfer: TransferContainer(mustHexBytes("001fc0a80101000000010002"))}, }, @@ -378,13 +389,13 @@ func TestTransparentContainerMessagesGolden(t *testing.T) { func TestTransparentContainerMessagesWireCriticality(t *testing.T) { ho := wireIEs(t, goldContainerHandoverRequest().encodeBody) - if last := ho[len(ho)-1]; last.id != IDTargetRANNodeID || last.crit != CriticalityIgnore { - t.Fatalf("HandoverRequest last IE = %d/%s, want Target-RAN-Node-ID ignore", last.id, last.crit) + if last := ho[len(ho)-1]; last.ID != IDTargetRANNodeID || last.Criticality != CriticalityIgnore { + t.Fatalf("HandoverRequest last IE = %d/%s, want Target-RAN-Node-ID ignore", last.ID, last.Criticality) } ps := wireIEs(t, goldPathSwitchRequestSourceAMFGUAMI().encodeBody) - if last := ps[len(ps)-1]; last.id != IDSourceAMFGUAMI || last.crit != CriticalityIgnore { - t.Fatalf("PathSwitchRequest last IE = %d/%s, want SourceAMF-GUAMI ignore", last.id, last.crit) + if last := ps[len(ps)-1]; last.ID != IDSourceAMFGUAMI || last.Criticality != CriticalityIgnore { + t.Fatalf("PathSwitchRequest last IE = %d/%s, want SourceAMF-GUAMI ignore", last.ID, last.Criticality) } } @@ -439,7 +450,7 @@ func FuzzTransparentContainerRoundTrip(f *testing.F) { t.Fatalf("decode re-encoded value: %v", err) } - if !reflect.DeepEqual(again, c) { + if !again.Equal(*c) { t.Fatalf("re-decoded\n got %+v\nwant %+v", again, c) } diff --git a/ngap/transport_address_test.go b/ngap/transport_address_test.go index de26e43cb5..b67defee46 100644 --- a/ngap/transport_address_test.go +++ b/ngap/transport_address_test.go @@ -3,43 +3,13 @@ package ngap -import "testing" +import "github.com/ellanetworks/core/per/ap" -// TS 38.414 §5.1: the bit string carries an IPv4 address, an IPv6 address, or -// both with the IPv4 one first. -func TestTransportLayerAddressIPs(t *testing.T) { - v4 := []byte{192, 168, 1, 1} - v6 := []byte{0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1} - - tests := []struct { - name string - addr TransportLayerAddress - want4 string - want6 string - }{ - {"ipv4", TransportLayerAddress(v4), "192.168.1.1", ""}, - {"ipv6", TransportLayerAddress(v6), "", "2001:db8::1"}, - {"both", TransportLayerAddress(append(append([]byte{}, v4...), v6...)), "192.168.1.1", "2001:db8::1"}, - {"truncated", TransportLayerAddress{1, 2, 3}, "", ""}, - {"empty", nil, "", ""}, +func tlaOf(octets ...byte) TransportLayerAddress { + a, ok := ap.TransportLayerAddressFromBits(octets, len(octets)*8) + if !ok { + panic("tlaOf") } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ipv4, ipv6 := tt.addr.IPs() - - got4, got6 := "", "" - if ipv4.IsValid() { - got4 = ipv4.String() - } - - if ipv6.IsValid() { - got6 = ipv6.String() - } - - if got4 != tt.want4 || got6 != tt.want6 { - t.Errorf("IPs() = %q/%q, want %q/%q", got4, got6, tt.want4, tt.want6) - } - }) - } + return a } diff --git a/ngap/typing_test.go b/ngap/typing_test.go index 127d2ebb35..9ef01d4e01 100644 --- a/ngap/typing_test.go +++ b/ngap/typing_test.go @@ -72,7 +72,7 @@ type ieRow struct { var ( reTable = regexp.MustCompile(`(?s)var \w+IEs = \[\]ieSpec\[(\w+)\]\{(.*?)\n\}\n`) - reRow = regexp.MustCompile(`(?s)\{\n\t\tid: (ID\w+), presence: (presence\w+), crit: (Criticality\w+),\n(.*?)\n\t\},`) + reRow = regexp.MustCompile(`(?s)\{\n\t\tID: (ID\w+), Presence: (presence\w+), Criticality: (Criticality\w+),\n(.*?)\n\t\},`) reField = regexp.MustCompile(`m\.([A-Z]\w*)`) ) @@ -89,7 +89,7 @@ func parseIETables(t *testing.T) []ieRow { id: m[1], presence: m[2], criticality: m[3], - hasCondition: strings.Contains(m[4], "condition:"), + hasCondition: strings.Contains(m[4], "Condition:"), } if f := reField.FindStringSubmatch(m[4]); f != nil { diff --git a/ngap/ue_context_modification.go b/ngap/ue_context_modification.go index 2c8afb7739..96a13605ce 100644 --- a/ngap/ue_context_modification.go +++ b/ngap/ue_context_modification.go @@ -8,35 +8,73 @@ import ( ) type UEContextModificationRequest struct { - AMFUENGAPID AMFUENGAPID - RANUENGAPID RANUENGAPID - UEAggregateMaximumBitRate *UEAggregateMaximumBitRate - NewAMFUENGAPID *AMFUENGAPID + AMFUENGAPID AMFUENGAPID + RANUENGAPID RANUENGAPID + UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + NewAMFUENGAPID *AMFUENGAPID + RANPagingPriority *RANPagingPriority + SecurityKey *SecurityKey + IndexToRFSP *IndexToRFSP + UESecurityCapabilities *UESecurityCapabilities + CoreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive + EmergencyFallbackIndicator *EmergencyFallbackIndicator + RRCInactiveTransitionReportRequest *RRCInactiveTransitionReportRequest + NewGUAMI *GUAMI + CNAssistedRANTuning *CNAssistedRANTuning + SRVCCOperationPossible *SRVCCOperationPossible + IABAuthorized *IABAuthorized + NRV2XServicesAuthorized *NRV2XServicesAuthorized + LTEV2XServicesAuthorized *LTEV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + LTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + UERadioCapabilityID *UERadioCapabilityID + RGLevelWirelineAccessCharacteristics *RGLevelWirelineAccessCharacteristics + TimeSyncAssistanceInfo *TimeSyncAssistanceInfo + QMCConfigInfo *QMCConfigInfo + QMCDeactivation *QMCDeactivation + UESliceMaximumBitRateList UESliceMaximumBitRateList + ManagementBasedMDTPLMNModificationList MDTPLMNModificationList + FiveGProSeAuthorized *FiveGProSeAuthorized + FiveGProSeUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + FiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters + NetworkControlledRepeaterAuthorized *NetworkControlledRepeaterAuthorized + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + NRA2XServicesAuthorized *NRA2XServicesAuthorized + LTEA2XServicesAuthorized *LTEA2XServicesAuthorized + NRA2XUEPC5AggregateMaximumBitRate *NRUESidelinkAggregateMaximumBitrate + LTEA2XUEPC5AggregateMaximumBitRate *LTEUESidelinkAggregateMaximumBitrate + A2XPC5QoSParameters *A2XPC5QoSParameters + MobileIABAuthorized *MobileIABAuthorized + SLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo messageMeta } var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, + optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *UEContextModificationRequest) **RANPagingPriority { return &m.RANPagingPriority }), + optionalExtension(IDSecurityKey, CriticalityReject, func(m *UEContextModificationRequest) **SecurityKey { return &m.SecurityKey }), + optionalExtension(IDIndexToRFSP, CriticalityIgnore, func(m *UEContextModificationRequest) **IndexToRFSP { return &m.IndexToRFSP }), { - id: IDUEAggregateMaximumBitRate, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitRate, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { var ambr UEAggregateMaximumBitRate - if err := perIEDecode(raw, &ambr); err != nil { + if err := decodeIE(r, &ambr); err != nil { return err } @@ -44,7 +82,7 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return nil }, - encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -52,12 +90,19 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return m.UEAggregateMaximumBitRate, true }, }, + optionalExtension(IDUESecurityCapabilities, CriticalityReject, func(m *UEContextModificationRequest) **UESecurityCapabilities { return &m.UESecurityCapabilities }), + optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *UEContextModificationRequest) **CoreNetworkAssistanceInformationForInactive { + return &m.CoreNetworkAssistanceInformationForInactive + }), + optionalExtension(IDEmergencyFallbackIndicator, CriticalityReject, func(m *UEContextModificationRequest) **EmergencyFallbackIndicator { + return &m.EmergencyFallbackIndicator + }), { - id: IDNewAMFUENGAPID, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { + ID: IDNewAMFUENGAPID, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -65,7 +110,7 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return nil }, - encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { if m.NewAMFUENGAPID == nil { return nil, false } @@ -73,6 +118,59 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return m.NewAMFUENGAPID, true }, }, + optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *UEContextModificationRequest) **RRCInactiveTransitionReportRequest { + return &m.RRCInactiveTransitionReportRequest + }), + optionalExtension(IDNewGUAMI, CriticalityReject, func(m *UEContextModificationRequest) **GUAMI { return &m.NewGUAMI }), + optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *UEContextModificationRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *UEContextModificationRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + optionalExtension(IDIABAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **IABAuthorized { return &m.IABAuthorized }), + optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEUESidelinkAggregateMaximumBitrate + }), + optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *UEContextModificationRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + optionalExtension(IDRGLevelWirelineAccessCharacteristics, CriticalityIgnore, func(m *UEContextModificationRequest) **RGLevelWirelineAccessCharacteristics { + return &m.RGLevelWirelineAccessCharacteristics + }), + optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + optionalExtension(IDQMCConfigInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **QMCConfigInfo { return &m.QMCConfigInfo }), + optionalExtension(IDQMCDeactivation, CriticalityIgnore, func(m *UEContextModificationRequest) **QMCDeactivation { return &m.QMCDeactivation }), + listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *UEContextModificationRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), + listExtension(IDManagementBasedMDTPLMNModificationList, CriticalityIgnore, func(m *UEContextModificationRequest) *MDTPLMNModificationList { + return &m.ManagementBasedMDTPLMNModificationList + }), + optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.FiveGProSeUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **FiveGProSePC5QoSParameters { + return &m.FiveGProSePC5QoSParameters + }), + optionalExtension(IDNetworkControlledRepeaterAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NetworkControlledRepeaterAuthorized { + return &m.NetworkControlledRepeaterAuthorized + }), + optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *UEContextModificationRequest) **AerialUEsubscriptionInformation { + return &m.AerialUEsubscriptionInformation + }), + optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEUESidelinkAggregateMaximumBitrate { + return &m.LTEA2XUEPC5AggregateMaximumBitRate + }), + optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **SLPositioningRangingServiceInfo { + return &m.SLPositioningRangingServiceInfo + }), } func (m *UEContextModificationRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -99,22 +197,27 @@ func ParseUEContextModificationRequest(value []byte) (*UEContextModificationRequ return parseMessageBody[UEContextModificationRequest](ProcUEContextModification, TriggeringInitiatingMessage, uEContextModificationRequestIEs, value) } +func DecodeUEContextModificationRequest(value []byte) (*UEContextModificationRequest, error) { + return decodeMessageBody[UEContextModificationRequest](ProcUEContextModification, uEContextModificationRequestIEs, value) +} + type UEContextModificationResponse struct { AMFUENGAPID *AMFUENGAPID RANUENGAPID *RANUENGAPID UserLocationInformation *UserLocationInformation CriticalityDiagnostics *CriticalityDiagnostics + RRCState *RRCState messageMeta } var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationResponse, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -122,7 +225,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return nil }, - encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -131,11 +234,11 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationResponse, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -143,7 +246,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return nil }, - encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -151,12 +254,13 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return m.RANUENGAPID, true }, }, + optionalExtension(IDRRCState, CriticalityIgnore, func(m *UEContextModificationResponse) **RRCState { return &m.RRCState }), { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextModificationResponse, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -164,7 +268,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return nil }, - encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -173,11 +277,11 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextModificationResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -185,7 +289,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return nil }, - encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -219,6 +323,10 @@ func ParseUEContextModificationResponse(value []byte) (*UEContextModificationRes return parseMessageBody[UEContextModificationResponse](ProcUEContextModification, TriggeringSuccessfulOutcome, uEContextModificationResponseIEs, value) } +func DecodeUEContextModificationResponse(value []byte) (*UEContextModificationResponse, error) { + return decodeMessageBody[UEContextModificationResponse](ProcUEContextModification, uEContextModificationResponseIEs, value) +} + type UEContextModificationFailure struct { AMFUENGAPID *AMFUENGAPID RANUENGAPID *RANUENGAPID @@ -230,11 +338,11 @@ type UEContextModificationFailure struct { var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -242,7 +350,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -251,11 +359,11 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -263,7 +371,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -272,11 +380,11 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -284,7 +392,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -293,11 +401,11 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -305,7 +413,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -338,3 +446,7 @@ func (m *UEContextModificationFailure) Marshal() ([]byte, error) { func ParseUEContextModificationFailure(value []byte) (*UEContextModificationFailure, error) { return parseMessageBody[UEContextModificationFailure](ProcUEContextModification, TriggeringUnsuccessfulOutcome, uEContextModificationFailureIEs, value) } + +func DecodeUEContextModificationFailure(value []byte) (*UEContextModificationFailure, error) { + return decodeMessageBody[UEContextModificationFailure](ProcUEContextModification, uEContextModificationFailureIEs, value) +} diff --git a/ngap/ue_context_modification_test.go b/ngap/ue_context_modification_test.go index 4f55d4f7f3..34f2f25a16 100644 --- a/ngap/ue_context_modification_test.go +++ b/ngap/ue_context_modification_test.go @@ -25,12 +25,9 @@ func goldUEContextModificationResponse() *UEContextModificationResponse { plmn := PLMNIdentity{0x00, 0xf1, 0x10} return &UEContextModificationResponse{ - AMFUENGAPID: Ptr(AMFUENGAPID(1)), - RANUENGAPID: Ptr(RANUENGAPID(2)), - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - }, + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(2)), + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}}, } } @@ -38,7 +35,7 @@ func goldUEContextModificationFailure() *UEContextModificationFailure { return &UEContextModificationFailure{ AMFUENGAPID: Ptr(AMFUENGAPID(1)), RANUENGAPID: Ptr(RANUENGAPID(2)), - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), } } @@ -136,7 +133,7 @@ func TestUEContextModificationRoundTrips(t *testing.T) { } if deref(out.AMFUENGAPID) != 1 || deref(out.RANUENGAPID) != 2 || out.UserLocationInformation == nil || - out.UserLocationInformation.CellIdentity != in.UserLocationInformation.CellIdentity { + !out.UserLocationInformation.Equal(*in.UserLocationInformation) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) @@ -164,7 +161,7 @@ func TestUEContextModificationRoundTrips(t *testing.T) { t.Fatal(err) } - if deref(out.AMFUENGAPID) != 1 || deref(out.RANUENGAPID) != 2 || deref(out.Cause) != deref(in.Cause) { + if deref(out.AMFUENGAPID) != 1 || deref(out.RANUENGAPID) != 2 || !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) diff --git a/ngap/ue_context_release.go b/ngap/ue_context_release.go index a336b490ba..1027faa982 100644 --- a/ngap/ue_context_release.go +++ b/ngap/ue_context_release.go @@ -7,131 +7,26 @@ import ( "github.com/ellanetworks/core/per" ) -// UE-NGAP-IDs CHOICE alternatives. The CHOICE is not extensible, so -// choice-Extensions is a plain alternative index. -const ( - ueNGAPIDsPair = iota - ueNGAPIDsAMFUENGAPID - ueNGAPIDsChoiceExtensions - - ueNGAPIDsAlternatives = 3 -) - // UE-NGAP-IDs ::= CHOICE { uE-NGAP-ID-pair, aMF-UE-NGAP-ID, choice-Extensions }. -// Pair selects uE-NGAP-ID-pair, which the AMF sends once the NG-RAN node has -// assigned a RAN UE NGAP ID; otherwise only AMFUENGAPID is carried. type UENGAPIDs struct { - AMFUENGAPID AMFUENGAPID - RANUENGAPID RANUENGAPID - Pair bool - - pairIEExtensions *rawIEExtensions - pairExtensions per.ExtensionAdditions + UENGAPIDPair *UENGAPIDPair `per:",choice:0"` + AMFUENGAPID *AMFUENGAPID `per:",choice:1"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` } -func (u UENGAPIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { - if !u.Pair { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, ueNGAPIDsAlternatives-1, ueNGAPIDsAMFUENGAPID); err != nil { - return err - } - - return u.AMFUENGAPID.MarshalPER(w, enc) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, ueNGAPIDsAlternatives-1, ueNGAPIDsPair); err != nil { - return err - } - - // UE-NGAP-ID-pair ::= SEQUENCE { aMF-UE-NGAP-ID, rAN-UE-NGAP-ID, - // iE-Extensions OPTIONAL } (extensible). - w.WriteBit(u.pairExtensions.Present()) - w.WriteBit(u.pairIEExtensions != nil) - - if err := u.AMFUENGAPID.MarshalPER(w, enc); err != nil { - return err - } - - if err := u.RANUENGAPID.MarshalPER(w, enc); err != nil { - return err - } - - if u.pairIEExtensions != nil { - if err := u.pairIEExtensions.MarshalPER(w, enc); err != nil { - return err - } - } - - return u.pairExtensions.MarshalPER(w, enc) -} - -func (u *UENGAPIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, ueNGAPIDsAlternatives-1) - if err != nil { - return err - } - - switch idx { - case ueNGAPIDsPair: - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - var amf AMFUENGAPID - if err := amf.UnmarshalPER(r, enc); err != nil { - return err - } - - var ran RANUENGAPID - if err := ran.UnmarshalPER(r, enc); err != nil { - return err - } - - var ieExt *rawIEExtensions - - if extContainer { - ieExt = &rawIEExtensions{} - if err := ieExt.UnmarshalPER(r, enc); err != nil { - return err - } - } - - var ext per.ExtensionAdditions - - if extBit { - if err := ext.UnmarshalPER(r, enc); err != nil { - return err - } - } - - *u = UENGAPIDs{AMFUENGAPID: amf, RANUENGAPID: ran, Pair: true, pairIEExtensions: ieExt, pairExtensions: ext} - - return nil - case ueNGAPIDsChoiceExtensions: - return decodeChoiceExtension(r, enc, "UE-NGAP-IDs") - default: - var amf AMFUENGAPID - if err := amf.UnmarshalPER(r, enc); err != nil { - return err - } - - *u = UENGAPIDs{AMFUENGAPID: amf} - - return nil - } +type UENGAPIDPair struct { + AMFUENGAPID AMFUENGAPID + RANUENGAPID RANUENGAPID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // PDUSessionResourceItemCxtRelReq ::= SEQUENCE { pDUSessionID, iE-Extensions // OPTIONAL } (extensible). type PDUSessionResourceItemCxtRelReq struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PDUSessionID PDUSessionID - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceListCxtRelReq ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF @@ -140,12 +35,12 @@ type PDUSessionResourceItemCxtRelReq struct { type PDUSessionResourceListCxtRelReq []PDUSessionResourceItemCxtRelReq // PDUSessionResourceItemCxtRelCpl ::= SEQUENCE { pDUSessionID, iE-Extensions -// OPTIONAL } (extensible). The release response transfer rides in an -// ignore-criticality extension, so it is skipped with the container. +// OPTIONAL } (extensible). type PDUSessionResourceItemCxtRelCpl struct { - _ [0]struct{} `per:"extseq"` - PDUSessionID PDUSessionID - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + PDUSessionID PDUSessionID + PDUSessionResourceReleaseResponseTransfer *TransferContainer `per:",extie:IDPDUSessionResourceReleaseResponseTransfer,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // PDUSessionResourceListCxtRelCpl ::= SEQUENCE (SIZE(1..maxnoofPDUSessions)) OF @@ -167,18 +62,18 @@ type UEContextReleaseCommand struct { var uEContextReleaseCommandIEs = []ieSpec[UEContextReleaseCommand]{ { - id: IDUENGAPIDs, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UENGAPIDs) + ID: IDUENGAPIDs, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UENGAPIDs) }, - encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { return &m.UENGAPIDs, true }, + Encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { return &m.UENGAPIDs, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseCommand, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseCommand, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -186,7 +81,7 @@ var uEContextReleaseCommandIEs = []ieSpec[UEContextReleaseCommand]{ return nil }, - encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -220,24 +115,30 @@ func ParseUEContextReleaseCommand(value []byte) (*UEContextReleaseCommand, error return parseMessageBody[UEContextReleaseCommand](ProcUEContextRelease, TriggeringInitiatingMessage, uEContextReleaseCommandIEs, value) } +func DecodeUEContextReleaseCommand(value []byte) (*UEContextReleaseCommand, error) { + return decodeMessageBody[UEContextReleaseCommand](ProcUEContextRelease, uEContextReleaseCommandIEs, value) +} + // TS 38.413 §9.2.2.6. type UEContextReleaseComplete struct { - AMFUENGAPID *AMFUENGAPID - RANUENGAPID *RANUENGAPID - UserLocationInformation *UserLocationInformation - PDUSessionResourceList PDUSessionResourceListCxtRelCpl - CriticalityDiagnostics *CriticalityDiagnostics + AMFUENGAPID *AMFUENGAPID + RANUENGAPID *RANUENGAPID + UserLocationInformation *UserLocationInformation + PDUSessionResourceList PDUSessionResourceListCxtRelCpl + CriticalityDiagnostics *CriticalityDiagnostics + InfoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNodesForPaging + PagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE messageMeta } var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var v AMFUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -245,7 +146,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.AMFUENGAPID == nil { return nil, false } @@ -254,11 +155,11 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -266,7 +167,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.RANUENGAPID == nil { return nil, false } @@ -275,11 +176,11 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -287,7 +188,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -295,12 +196,15 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return m.UserLocationInformation, true }, }, + optionalExtension(IDInfoOnRecommendedCellsAndRANNodesForPaging, CriticalityIgnore, func(m *UEContextReleaseComplete) **InfoOnRecommendedCellsAndRANNodesForPaging { + return &m.InfoOnRecommendedCellsAndRANNodesForPaging + }), { - id: IDPDUSessionResourceListCxtRelCpl, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceList) + ID: IDPDUSessionResourceListCxtRelCpl, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceList) }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.PDUSessionResourceList == nil { return nil, false } @@ -309,11 +213,11 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -321,7 +225,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -329,6 +233,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return m.CriticalityDiagnostics, true }, }, + optionalExtension(IDPagingAssisDataforCEcapabUE, CriticalityIgnore, func(m *UEContextReleaseComplete) **PagingAssisDataforCEcapabUE { return &m.PagingAssisDataforCEcapabUE }), } func (m *UEContextReleaseComplete) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -355,6 +260,10 @@ func ParseUEContextReleaseComplete(value []byte) (*UEContextReleaseComplete, err return parseMessageBody[UEContextReleaseComplete](ProcUEContextRelease, TriggeringSuccessfulOutcome, uEContextReleaseCompleteIEs, value) } +func DecodeUEContextReleaseComplete(value []byte) (*UEContextReleaseComplete, error) { + return decodeMessageBody[UEContextReleaseComplete](ProcUEContextRelease, uEContextReleaseCompleteIEs, value) +} + // TS 38.413 §9.2.2.4. type UEContextReleaseRequest struct { AMFUENGAPID AMFUENGAPID @@ -368,25 +277,25 @@ type UEContextReleaseRequest struct { var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDPDUSessionResourceListCxtRelReq, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.PDUSessionResourceList) + ID: IDPDUSessionResourceListCxtRelReq, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.PDUSessionResourceList) }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { if m.PDUSessionResourceList == nil { return nil, false } @@ -395,11 +304,11 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -407,7 +316,7 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ return nil }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -416,11 +325,11 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ }, }, { - id: IDGWContextReleaseIndication, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { + ID: IDGWContextReleaseIndication, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { var v GWContextReleaseIndication - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -428,7 +337,7 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ return nil }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { if m.GWContextReleaseIndication == nil { return nil, false } @@ -461,3 +370,7 @@ func (m *UEContextReleaseRequest) Marshal() ([]byte, error) { func ParseUEContextReleaseRequest(value []byte) (*UEContextReleaseRequest, error) { return parseMessageBody[UEContextReleaseRequest](ProcUEContextReleaseRequest, TriggeringInitiatingMessage, uEContextReleaseRequestIEs, value) } + +func DecodeUEContextReleaseRequest(value []byte) (*UEContextReleaseRequest, error) { + return decodeMessageBody[UEContextReleaseRequest](ProcUEContextReleaseRequest, uEContextReleaseRequestIEs, value) +} diff --git a/ngap/ue_context_release_test.go b/ngap/ue_context_release_test.go index 3e559092e3..a102f767ba 100644 --- a/ngap/ue_context_release_test.go +++ b/ngap/ue_context_release_test.go @@ -7,6 +7,8 @@ import ( "encoding/hex" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) // Golden UE CONTEXT RELEASE PDUs. @@ -32,8 +34,8 @@ func mustMarshalHex(t *testing.T, m interface{ Marshal() ([]byte, error) }) stri func TestUEContextReleaseGoldenEncodings(t *testing.T) { plmn := PLMNIdentity{0x00, 0xf1, 0x10} - inactivity := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity} - normalRelease := Cause{Group: CauseGroupNAS, Value: CauseNASNormalRelease} + inactivity := CauseRadioNetworkUserInactivity.Cause() + normalRelease := CauseNASNormalRelease.Cause() tests := []struct { name string @@ -58,26 +60,23 @@ func TestUEContextReleaseGoldenEncodings(t *testing.T) { { "CommandPair", &UEContextReleaseCommand{ - UENGAPIDs: UENGAPIDs{AMFUENGAPID: 1, RANUENGAPID: 2, Pair: true}, + UENGAPIDs: UENGAPIDs{UENGAPIDPair: &UENGAPIDPair{AMFUENGAPID: 1, RANUENGAPID: 2}}, Cause: &normalRelease, }, goldenUEContextReleaseCommandPair, }, { "CommandAMFIDOnly", - &UEContextReleaseCommand{UENGAPIDs: UENGAPIDs{AMFUENGAPID: 1}, Cause: &normalRelease}, + &UEContextReleaseCommand{UENGAPIDs: UENGAPIDs{AMFUENGAPID: Ptr(AMFUENGAPID(1))}, Cause: &normalRelease}, goldenUEContextReleaseCommandAMF, }, { "Complete", &UEContextReleaseComplete{ - AMFUENGAPID: Ptr(AMFUENGAPID(1)), - RANUENGAPID: Ptr(RANUENGAPID(2)), - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 1}, - }, - PDUSessionResourceList: PDUSessionResourceListCxtRelCpl{{PDUSessionID: 5}}, + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(2)), + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 1}}}, + PDUSessionResourceList: PDUSessionResourceListCxtRelCpl{{PDUSessionID: 5}}, }, goldenUEContextReleaseComplete, }, @@ -99,11 +98,11 @@ func TestUEContextReleaseGoldenEncodings(t *testing.T) { func TestUEContextReleaseRoundTrips(t *testing.T) { plmn := PLMNIdentity{0x00, 0xf1, 0x10} - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity} + cause := CauseRadioNetworkUserInactivity.Cause() t.Run("Command pair", func(t *testing.T) { in := &UEContextReleaseCommand{ - UENGAPIDs: UENGAPIDs{AMFUENGAPID: 1, RANUENGAPID: 7, Pair: true}, + UENGAPIDs: UENGAPIDs{UENGAPIDPair: &UENGAPIDPair{AMFUENGAPID: 1, RANUENGAPID: 7}}, Cause: &cause, } @@ -127,14 +126,14 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { t.Fatal(err) } - if !out.UENGAPIDs.Pair || out.UENGAPIDs.AMFUENGAPID != 1 || out.UENGAPIDs.RANUENGAPID != 7 || - deref(out.Cause) != cause { + if !out.UENGAPIDs.Equal(UENGAPIDs{UENGAPIDPair: &UENGAPIDPair{AMFUENGAPID: 1, RANUENGAPID: 7}}) || + !deref(out.Cause).Equal(cause) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) t.Run("Command bare AMF id", func(t *testing.T) { - in := &UEContextReleaseCommand{UENGAPIDs: UENGAPIDs{AMFUENGAPID: 42}, Cause: &cause} + in := &UEContextReleaseCommand{UENGAPIDs: UENGAPIDs{AMFUENGAPID: Ptr(AMFUENGAPID(42))}, Cause: &cause} b, _ := in.Marshal() @@ -145,7 +144,7 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { t.Fatal(err) } - if out.UENGAPIDs.Pair || out.UENGAPIDs.AMFUENGAPID != 42 || out.UENGAPIDs.RANUENGAPID != 0 { + if out.UENGAPIDs.UENGAPIDPair != nil || deref(out.UENGAPIDs.AMFUENGAPID) != 42 { t.Fatalf("mismatch: %+v", out.UENGAPIDs) } }) @@ -170,12 +169,9 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { t.Run("CompleteWithUserLocation", func(t *testing.T) { in := &UEContextReleaseComplete{ - AMFUENGAPID: Ptr(AMFUENGAPID(1)), - RANUENGAPID: Ptr(RANUENGAPID(7)), - UserLocationInformation: &UserLocationInformation{ - Kind: UserLocationNR, PLMNIdentity: plmn, CellIdentity: 0x123456789, - TAI: TAI{PLMNIdentity: plmn, TAC: 9}, - }, + AMFUENGAPID: Ptr(AMFUENGAPID(1)), + RANUENGAPID: Ptr(RANUENGAPID(7)), + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: plmn, NRCellIdentity: NRCellIdentity(0x123456789)}, TAI: TAI{PLMNIdentity: plmn, TAC: 9}}}, } b, _ := in.Marshal() @@ -187,7 +183,7 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { t.Fatalf("got %+v err %v", out, err) } - if out.UserLocationInformation.CellIdentity != 0x123456789 || out.UserLocationInformation.TAI.TAC != 9 { + if nr := out.UserLocationInformation.NR; nr == nil || nr.NRCGI.NRCellIdentity != 0x123456789 || nr.TAI.TAC != 9 { t.Fatalf("ULI mismatch: %+v", out.UserLocationInformation) } }) @@ -234,7 +230,7 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { } out, err := ParseUEContextReleaseRequest(im.Value) - if err != nil || out.AMFUENGAPID != 1 || out.RANUENGAPID != 7 || deref(out.Cause) != cause { + if err != nil || out.AMFUENGAPID != 1 || out.RANUENGAPID != 7 || !deref(out.Cause).Equal(cause) { t.Fatalf("got %+v err %v", out, err) } @@ -249,9 +245,9 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { // the IE's criticality: reject, so no message is delivered. func TestUEContextReleaseCommandChoiceExtension(t *testing.T) { value := container(t, ieField{ - id: IDUENGAPIDs, - crit: CriticalityReject, - raw: choiceExtensionValue(t, ueNGAPIDsAlternatives, ueNGAPIDsChoiceExtensions, IDUENGAPIDs), + ID: IDUENGAPIDs, + Criticality: CriticalityReject, + Value: ap.RawValue(choiceExtensionValue(t, ueNGAPIDsAlternatives, ueNGAPIDsChoiceExtensions, IDUENGAPIDs)), }) _, err := ParseUEContextReleaseCommand(value) @@ -264,7 +260,7 @@ func TestUEContextReleaseCommandChoiceExtension(t *testing.T) { t.Fatalf("error = %T (%v), want *AbstractSyntaxError", err, err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorReject { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorReject.Cause()) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } @@ -275,7 +271,7 @@ func TestUEContextReleaseCommandChoiceExtension(t *testing.T) { } func uEContextReleaseRequestGoldenCases() []goldenRoundTrip { - inactivity := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity} + inactivity := CauseRadioNetworkUserInactivity.Cause() return []goldenRoundTrip{ { @@ -300,13 +296,13 @@ func TestUEContextReleaseRequestGWContextReleaseIndicationGolden(t *testing.T) { } func TestUEContextReleaseRequestGWContextReleaseIndicationExtensionRejects(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity} + cause := CauseRadioNetworkUserInactivity.Cause() _, err := ParseUEContextReleaseRequest(container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: Ptr(AMFUENGAPID(1))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, val: Ptr(RANUENGAPID(2))}, - ieField{id: IDCause, crit: CriticalityIgnore, val: &cause}, - ieField{id: IDGWContextReleaseIndication, crit: CriticalityReject, raw: extensionEnum(t, gwContextReleaseIndicationRootCount, 0)}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: Ptr(AMFUENGAPID(1))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: Ptr(RANUENGAPID(2))}, + ieField{ID: IDCause, Criticality: CriticalityIgnore, Value: &cause}, + ieField{ID: IDGWContextReleaseIndication, Criticality: CriticalityReject, Value: ap.RawValue(extensionEnum(t, int64(len(enumGWContextReleaseIndication.Root)), 0))}, )) var ase *AbstractSyntaxError diff --git a/ngap/ue_ids.go b/ngap/ue_ids.go index 84e954670f..80afcc3791 100644 --- a/ngap/ue_ids.go +++ b/ngap/ue_ids.go @@ -22,13 +22,13 @@ func PeekAMFUENGAPID(pdu PDU) (AMFUENGAPID, bool) { } for _, f := range fields { - if f.id != IDAMFUENGAPID && f.id != IDSourceAMFUENGAPID { + if f.ID != IDAMFUENGAPID && f.ID != IDSourceAMFUENGAPID { continue } var id AMFUENGAPID - if err := perIEDecode(f.value, &id); err != nil { + if err := perIEDecode(f.Value, &id); err != nil { return 0, false } diff --git a/ngap/ue_radio_capability.go b/ngap/ue_radio_capability.go index 1d62483ecf..46b889122a 100644 --- a/ngap/ue_radio_capability.go +++ b/ngap/ue_radio_capability.go @@ -14,32 +14,34 @@ type UERadioCapabilityInfoIndication struct { UERadioCapability UERadioCapability // A SEQUENCE of separate NR and E-UTRA capabilities, where S1AP's // counterpart is one opaque OCTET STRING (§9.3.1.68). - UERadioCapabilityForPaging *UERadioCapabilityForPaging + UERadioCapabilityForPaging *UERadioCapabilityForPaging + UERadioCapabilityEUTRAFormat UERadioCapability + XrDeviceWith2Rx *XrDeviceWith2Rx messageMeta } var uERadioCapabilityInfoIndicationIEs = []ieSpec[UERadioCapabilityInfoIndication]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UERadioCapabilityInfoIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UERadioCapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UERadioCapabilityInfoIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UERadioCapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, { - id: IDUERadioCapability, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UERadioCapabilityInfoIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UERadioCapability) + ID: IDUERadioCapability, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UERadioCapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UERadioCapability) }, - encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { + Encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { if m.UERadioCapability == nil { return nil, false } @@ -48,11 +50,11 @@ var uERadioCapabilityInfoIndicationIEs = []ieSpec[UERadioCapabilityInfoIndicatio }, }, { - id: IDUERadioCapabilityForPaging, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UERadioCapabilityInfoIndication, raw []byte, enc per.Encoding) error { + ID: IDUERadioCapabilityForPaging, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UERadioCapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { var v UERadioCapabilityForPaging - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -60,7 +62,7 @@ var uERadioCapabilityInfoIndicationIEs = []ieSpec[UERadioCapabilityInfoIndicatio return nil }, - encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { + Encode: func(m *UERadioCapabilityInfoIndication) (per.Marshaler, bool) { if m.UERadioCapabilityForPaging == nil { return nil, false } @@ -68,6 +70,8 @@ var uERadioCapabilityInfoIndicationIEs = []ieSpec[UERadioCapabilityInfoIndicatio return m.UERadioCapabilityForPaging, true }, }, + listExtension(IDUERadioCapabilityEUTRAFormat, CriticalityIgnore, func(m *UERadioCapabilityInfoIndication) *UERadioCapability { return &m.UERadioCapabilityEUTRAFormat }), + optionalExtension(IDXrDeviceWith2Rx, CriticalityIgnore, func(m *UERadioCapabilityInfoIndication) **XrDeviceWith2Rx { return &m.XrDeviceWith2Rx }), } func (m *UERadioCapabilityInfoIndication) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -93,3 +97,7 @@ func (m *UERadioCapabilityInfoIndication) Marshal() ([]byte, error) { func ParseUERadioCapabilityInfoIndication(value []byte) (*UERadioCapabilityInfoIndication, error) { return parseMessageBody[UERadioCapabilityInfoIndication](ProcUERadioCapabilityInfoIndication, TriggeringInitiatingMessage, uERadioCapabilityInfoIndicationIEs, value) } + +func DecodeUERadioCapabilityInfoIndication(value []byte) (*UERadioCapabilityInfoIndication, error) { + return decodeMessageBody[UERadioCapabilityInfoIndication](ProcUERadioCapabilityInfoIndication, uERadioCapabilityInfoIndicationIEs, value) +} diff --git a/ngap/ue_radio_capability_test.go b/ngap/ue_radio_capability_test.go index 0f26744b75..78c3a6d5fa 100644 --- a/ngap/ue_radio_capability_test.go +++ b/ngap/ue_radio_capability_test.go @@ -7,6 +7,8 @@ import ( "bytes" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) // Golden UE RADIO CAPABILITY INFO INDICATION PDUs. @@ -123,8 +125,8 @@ func TestUERadioCapabilityInfoIndicationPaging(t *testing.T) { // without it is still delivered and the absence reported (§10.3.5). func TestUERadioCapabilityInfoIndicationWithoutCapability(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDRANUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(RANUENGAPID(2)))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) msg, err := ParseUERadioCapabilityInfoIndication(value) @@ -137,7 +139,7 @@ func TestUERadioCapabilityInfoIndicationWithoutCapability(t *testing.T) { } d := msg.Diagnostics() - if len(d.IEs) != 1 || d.IEs[0].ID != IDUERadioCapability || d.IEs[0].TypeOfError != TypeOfErrorMissing { + if len(d.IEs) != 1 || d.IEs[0].ID != IDUERadioCapability || typeOfError(d.IEs[0]) != TypeOfErrorMissing { t.Errorf("diagnostics = %+v, want one missing entry for UERadioCapability", d.IEs) } } @@ -146,8 +148,8 @@ func TestUERadioCapabilityInfoIndicationWithoutCapability(t *testing.T) { // missing one (§10.3.5). func TestUERadioCapabilityInfoIndicationMissingRejectIE(t *testing.T) { value := container(t, - ieField{id: IDAMFUENGAPID, crit: CriticalityReject, raw: ieRaw(t, Ptr(AMFUENGAPID(1)))}, - ieField{id: IDUERadioCapability, crit: CriticalityIgnore, raw: ieRaw(t, UERadioCapability{0x01})}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDUERadioCapability, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, UERadioCapability{0x01}))}, ) _, err := ParseUERadioCapabilityInfoIndication(value) diff --git a/ngap/ue_tnla_binding_release.go b/ngap/ue_tnla_binding_release.go index 52ff9095da..1195d652d3 100644 --- a/ngap/ue_tnla_binding_release.go +++ b/ngap/ue_tnla_binding_release.go @@ -16,18 +16,18 @@ type UETNLABindingReleaseRequest struct { var uETNLABindingReleaseRequestIEs = []ieSpec[UETNLABindingReleaseRequest]{ { - id: IDAMFUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UETNLABindingReleaseRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.AMFUENGAPID) + ID: IDAMFUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UETNLABindingReleaseRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.AMFUENGAPID) }, - encode: func(m *UETNLABindingReleaseRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, + Encode: func(m *UETNLABindingReleaseRequest) (per.Marshaler, bool) { return &m.AMFUENGAPID, true }, }, { - id: IDRANUENGAPID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UETNLABindingReleaseRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.RANUENGAPID) + ID: IDRANUENGAPID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UETNLABindingReleaseRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.RANUENGAPID) }, - encode: func(m *UETNLABindingReleaseRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, + Encode: func(m *UETNLABindingReleaseRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, } @@ -54,3 +54,7 @@ func (m *UETNLABindingReleaseRequest) Marshal() ([]byte, error) { func ParseUETNLABindingReleaseRequest(value []byte) (*UETNLABindingReleaseRequest, error) { return parseMessageBody[UETNLABindingReleaseRequest](ProcUETNLABindingRelease, TriggeringInitiatingMessage, uETNLABindingReleaseRequestIEs, value) } + +func DecodeUETNLABindingReleaseRequest(value []byte) (*UETNLABindingReleaseRequest, error) { + return decodeMessageBody[UETNLABindingReleaseRequest](ProcUETNLABindingRelease, uETNLABindingReleaseRequestIEs, value) +} diff --git a/ngap/ue_tnla_binding_release_test.go b/ngap/ue_tnla_binding_release_test.go index 2ac63c5aa2..06bd5a8080 100644 --- a/ngap/ue_tnla_binding_release_test.go +++ b/ngap/ue_tnla_binding_release_test.go @@ -42,7 +42,7 @@ func TestUETNLABindingReleaseRequestEnvelope(t *testing.T) { } func TestUETNLABindingReleaseRequestMissingRejectIE(t *testing.T) { - value := container(t, ieField{id: IDAMFUENGAPID, crit: CriticalityReject, val: Ptr(AMFUENGAPID(1))}) + value := container(t, ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: Ptr(AMFUENGAPID(1))}) _, err := ParseUETNLABindingReleaseRequest(value) diff --git a/ngap/unknown_ie_test.go b/ngap/unknown_ie_test.go index fa2aa1fe4b..a9a2ac1c57 100644 --- a/ngap/unknown_ie_test.go +++ b/ngap/unknown_ie_test.go @@ -6,11 +6,11 @@ package ngap import ( "bytes" "errors" - "reflect" "slices" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // An NG SETUP REQUEST carrying one unmodeled IE at the given criticality. @@ -23,10 +23,10 @@ func encodeWithExtraIE(t *testing.T, crit Criticality, id ProtocolIEID) []byte { w.WriteBit(false) fields := []ieField{ - {id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, - {id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, - {id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, - {id: id, crit: crit, raw: []byte{0xde, 0xad}}, + {ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, + {ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, + {ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, + {ID: id, Criticality: crit, Value: ap.RawValue([]byte{0xde, 0xad})}, } if err := encodeIEContainer(w, per.Aligned, fields); err != nil { @@ -39,7 +39,7 @@ func encodeWithExtraIE(t *testing.T, crit Criticality, id ProtocolIEID) []byte { // §10.3.4.2: reported, still delivered, and preserved verbatim so a re-encode // stays faithful to what the peer sent. func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { - value := encodeWithExtraIE(t, CriticalityIgnore, IDNBIoTDefaultPagingDRX) + value := encodeWithExtraIE(t, CriticalityIgnore, unmodeledIEID) req, err := ParseNGSetupRequest(value) if err != nil { @@ -51,9 +51,9 @@ func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { t.Fatal("diagnostics empty, want the unmodeled IE reported") } - if got := d.IEs[0]; got.ID != IDNBIoTDefaultPagingDRX || + if got := d.IEs[0]; got.ID != unmodeledIEID || got.Criticality != CriticalityIgnore || - got.TypeOfError != TypeOfErrorNotUnderstood { + typeOfError(got) != TypeOfErrorNotUnderstood { t.Errorf("diagnostic = %+v", got) } @@ -63,7 +63,7 @@ func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { } unknown := req.UnknownIEs() - if len(unknown) != 1 || unknown[0].ID != IDNBIoTDefaultPagingDRX || + if len(unknown) != 1 || unknown[0].ID != unmodeledIEID || !bytes.Equal(unknown[0].Value, []byte{0xde, 0xad}) { t.Fatalf("UnknownIEs() = %+v", unknown) } @@ -89,14 +89,14 @@ func TestUnmodeledIgnoreIEIsPreserved(t *testing.T) { } last := fields[len(fields)-1] - if last.id != IDNBIoTDefaultPagingDRX || !bytes.Equal(last.value, []byte{0xde, 0xad}) { + if last.ID != unmodeledIEID || !bytes.Equal(last.Value, []byte{0xde, 0xad}) { t.Errorf("re-encoded trailing IE = %+v, want the preserved one", last) } } // TS 38.413 §10.3.4.2: the same IE marked reject stops the procedure. func TestUnmodeledRejectIEIsRejected(t *testing.T) { - value := encodeWithExtraIE(t, CriticalityReject, IDNBIoTDefaultPagingDRX) + value := encodeWithExtraIE(t, CriticalityReject, unmodeledIEID) msg, err := ParseNGSetupRequest(value) if msg != nil { @@ -108,12 +108,12 @@ func TestUnmodeledRejectIEIsRejected(t *testing.T) { t.Fatalf("error = %v, want *AbstractSyntaxError", err) } - want := Cause{Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject} - if ase.Cause != want { + want := CauseProtocolAbstractSyntaxErrorReject.Cause() + if !ase.Cause.Equal(want) { t.Errorf("cause = %v, want %v", ase.Cause, want) } - if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDNBIoTDefaultPagingDRX || + if len(ase.IEs) != 1 || ase.IEs[0].IEID != unmodeledIEID || ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { t.Errorf("reported IEs = %+v", ase.IEs) } @@ -138,7 +138,7 @@ func TestUnknownIEsNilWhenNone(t *testing.T) { // The peer's criticality is kept: re-emitting under another would change what a // downstream receiver must do with it. func TestUnmodeledIECriticality(t *testing.T) { - value := encodeWithExtraIE(t, CriticalityIgnore, IDNBIoTDefaultPagingDRX) + value := encodeWithExtraIE(t, CriticalityIgnore, unmodeledIEID) req, err := ParseNGSetupRequest(value) if err != nil { @@ -170,9 +170,9 @@ func TestUnmodeledIECriticality(t *testing.T) { } last := fields[len(fields)-1] - if last.id != IDNBIoTDefaultPagingDRX || last.crit != CriticalityIgnore { + if last.ID != unmodeledIEID || last.Criticality != CriticalityIgnore { t.Errorf("re-encoded IE = {%v, %v}, want the preserved id and criticality", - last.id, last.crit) + last.ID, last.Criticality) } } @@ -192,7 +192,7 @@ func wireIDs(t *testing.T, body func(*per.Writer, per.Encoding) error) []Protoco var ids []ProtocolIEID for _, f := range wireIEs(t, body) { - ids = append(ids, f.id) + ids = append(ids, f.ID) } return ids @@ -201,10 +201,10 @@ func wireIDs(t *testing.T, body func(*per.Writer, per.Encoding) error) []Protoco func TestUnknownIEKeepsItsWirePosition(t *testing.T) { src := goldRequest() value := container(t, - ieField{id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, - ieField{id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, - ieField{id: IDNBIoTDefaultPagingDRX, crit: CriticalityIgnore, raw: []byte{0xde, 0xad}}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + ieField{ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, + ieField{ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, + ieField{ID: unmodeledIEID, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xde, 0xad})}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, ) req, err := ParseNGSetupRequest(value) @@ -219,7 +219,7 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { req.RANNodeName = Ptr("ella-gnb") req.UERetentionInformation = Ptr(UERetentionUesRetained) - want := []ProtocolIEID{IDGlobalRANNodeID, IDRANNodeName, IDSupportedTAList, IDNBIoTDefaultPagingDRX, IDDefaultPagingDRX, IDUERetentionInformation} + want := []ProtocolIEID{IDGlobalRANNodeID, IDRANNodeName, IDSupportedTAList, unmodeledIEID, IDDefaultPagingDRX, IDUERetentionInformation} if got := wireIDs(t, req.encodeBody); !slices.Equal(got, want) { t.Fatalf("IE order %v, want %v", got, want) } @@ -236,11 +236,11 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { src := goldRequest() value := container(t, - ieField{id: IDNBIoTDefaultPagingDRX, crit: CriticalityIgnore, raw: []byte{0x01}}, - ieField{id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, - ieField{id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, - ieField{id: ProtocolIEID(9999), crit: CriticalityNotify, raw: []byte{0x02}}, + ieField{ID: unmodeledIEID, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})}, + ieField{ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, + ieField{ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, + ieField{ID: ProtocolIEID(9999), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x02})}, ) req, err := ParseNGSetupRequest(value) @@ -256,9 +256,9 @@ func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { func TestReceivedIECriticalityIsReencoded(t *testing.T) { src := goldRequest() value := container(t, - ieField{id: IDGlobalRANNodeID, crit: CriticalityReject, val: &src.GlobalRANNodeID}, - ieField{id: IDSupportedTAList, crit: CriticalityReject, val: src.SupportedTAList}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityReject, val: PagingDRXv128}, + ieField{ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, + ieField{ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityReject, Value: PagingDRXv128}, ) req, err := ParseNGSetupRequest(value) @@ -271,7 +271,7 @@ func TestReceivedIECriticalityIsReencoded(t *testing.T) { } fresh := &NGSetupRequest{GlobalRANNodeID: src.GlobalRANNodeID, SupportedTAList: src.SupportedTAList, DefaultPagingDRX: Ptr(PagingDRXv128)} - if got := wireIEs(t, fresh.encodeBody)[2].crit; got != CriticalityIgnore { + if got := wireIEs(t, fresh.encodeBody)[2].Criticality; got != CriticalityIgnore { t.Fatalf("built from scratch: Default Paging DRX criticality %v, want ignore", got) } } @@ -284,7 +284,9 @@ func TestConformingMessageParsesToItsBuiltForm(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(req, in) { + if !req.Equal(*in) { t.Fatalf("parsed %+v, want %+v", req, in) } } + +const unmodeledIEID ProtocolIEID = 40000 diff --git a/ngap/wire_criticality_test.go b/ngap/wire_criticality_test.go index f402a16eb4..ce0818658c 100644 --- a/ngap/wire_criticality_test.go +++ b/ngap/wire_criticality_test.go @@ -82,7 +82,7 @@ func TestWireCriticality(t *testing.T) { { "NGSetupFailure §9.2.6.3", (&NGSetupFailure{ - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: CauseMiscUnspecified}), + Cause: Ptr(CauseMiscUnspecified.Cause()), TimeToWait: Ptr(TimeToWaitV1s), CriticalityDiagnostics: &CriticalityDiagnostics{}, }).encodeBody, @@ -97,7 +97,7 @@ func TestWireCriticality(t *testing.T) { (&InitialUEMessage{ RANUENGAPID: 1, NASPDU: NASPDU{0x7e}, - UserLocationInformation: UserLocationInformation{Kind: UserLocationNR}, + UserLocationInformation: UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}}, RRCEstablishmentCause: Ptr(RRCCauseEmergency), FiveGSTMSI: &FiveGSTMSI{}, AMFSetID: Ptr(AMFSetID(1)), @@ -130,7 +130,7 @@ func TestWireCriticality(t *testing.T) { AMFUENGAPID: 1, RANUENGAPID: 2, NASPDU: NASPDU{0x7e}, - UserLocationInformation: &UserLocationInformation{Kind: UserLocationNR}, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}}, }).encodeBody, []wireIE{ {IDAMFUENGAPID, CriticalityReject}, @@ -222,7 +222,7 @@ func TestWireCriticality(t *testing.T) { (&UEContextModificationFailure{ AMFUENGAPID: Ptr(AMFUENGAPID(1)), RANUENGAPID: Ptr(RANUENGAPID(2)), - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), CriticalityDiagnostics: &CriticalityDiagnostics{}, }).encodeBody, []wireIE{ @@ -238,7 +238,7 @@ func TestWireCriticality(t *testing.T) { AMFUENGAPID: Ptr(AMFUENGAPID(1)), RANUENGAPID: Ptr(RANUENGAPID(2)), PDUSessionResourceFailed: PDUSessionResourceFailedToSetupListCxtFail{{PDUSessionID: 5}}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), CriticalityDiagnostics: &CriticalityDiagnostics{}, }).encodeBody, []wireIE{ @@ -253,7 +253,7 @@ func TestWireCriticality(t *testing.T) { "PDUSessionResourceNotify §9.2.1.9", func() func(*per.Writer, per.Encoding) error { m := goldPDUSessionResourceNotify() - m.UserLocationInformation = &UserLocationInformation{Kind: UserLocationNR} + m.UserLocationInformation = &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}} return m.encodeBody }(), @@ -269,7 +269,7 @@ func TestWireCriticality(t *testing.T) { "PDUSessionResourceModifyIndication §9.2.1.7", func() func(*per.Writer, per.Encoding) error { m := goldPDUSessionResourceModifyIndication() - m.UserLocationInformation = &UserLocationInformation{Kind: UserLocationNR} + m.UserLocationInformation = &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}} return m.encodeBody }(), @@ -313,7 +313,7 @@ func TestWireCriticality(t *testing.T) { RANUENGAPID: Ptr(RANUENGAPID(2)), PDUSessionResourceModify: PDUSessionResourceModifyListModRes{{PDUSessionID: 5}}, PDUSessionResourceFailed: PDUSessionResourceFailedToModifyListModRes{{PDUSessionID: 9}}, - UserLocationInformation: &UserLocationInformation{Kind: UserLocationNR}, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}}, CriticalityDiagnostics: &CriticalityDiagnostics{}, }).encodeBody, []wireIE{ @@ -341,7 +341,7 @@ func TestWireCriticality(t *testing.T) { AMFUENGAPID: Ptr(AMFUENGAPID(1)), RANUENGAPID: Ptr(RANUENGAPID(2)), PDUSessionResourceReleased: PDUSessionResourceReleasedListRelRes{{PDUSessionID: 5}}, - UserLocationInformation: &UserLocationInformation{Kind: UserLocationNR}, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}}, CriticalityDiagnostics: &CriticalityDiagnostics{}, }).encodeBody, []wireIE{ @@ -371,7 +371,7 @@ func TestWireCriticality(t *testing.T) { PDUSessionResourceSetup: PDUSessionResourceSetupListSURes{{PDUSessionID: 5}}, PDUSessionResourceFailed: PDUSessionResourceFailedToSetupListSURes{{PDUSessionID: 9}}, CriticalityDiagnostics: &CriticalityDiagnostics{}, - UserLocationInformation: &UserLocationInformation{Kind: UserLocationNR}, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}}, }).encodeBody, []wireIE{ {IDAMFUENGAPID, CriticalityIgnore}, @@ -403,7 +403,7 @@ func TestWireCriticality(t *testing.T) { AMFUENGAPID: 1, RANUENGAPID: 2, PDUSessionResourceList: PDUSessionResourceListCxtRelReq{{PDUSessionID: 5}}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity}), + Cause: Ptr(CauseRadioNetworkUserInactivity.Cause()), }).encodeBody, []wireIE{ {IDAMFUENGAPID, CriticalityReject}, @@ -417,7 +417,7 @@ func TestWireCriticality(t *testing.T) { (&UEContextReleaseRequest{ AMFUENGAPID: 1, RANUENGAPID: 2, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUserInactivity}), + Cause: Ptr(CauseRadioNetworkUserInactivity.Cause()), GWContextReleaseIndication: Ptr(GWContextReleaseIndicationTrue), }).encodeBody, []wireIE{ @@ -503,8 +503,8 @@ func TestWireCriticality(t *testing.T) { { "UEContextReleaseCommand §9.2.2.5", (&UEContextReleaseCommand{ - UENGAPIDs: UENGAPIDs{AMFUENGAPID: 1, RANUENGAPID: 2, Pair: true}, - Cause: Ptr(Cause{Group: CauseGroupNAS, Value: CauseNASNormalRelease}), + UENGAPIDs: UENGAPIDs{UENGAPIDPair: &UENGAPIDPair{AMFUENGAPID: 1, RANUENGAPID: 2}}, + Cause: Ptr(CauseNASNormalRelease.Cause()), }).encodeBody, []wireIE{ {IDUENGAPIDs, CriticalityReject}, @@ -516,7 +516,7 @@ func TestWireCriticality(t *testing.T) { (&UEContextReleaseComplete{ AMFUENGAPID: Ptr(AMFUENGAPID(1)), RANUENGAPID: Ptr(RANUENGAPID(2)), - UserLocationInformation: &UserLocationInformation{Kind: UserLocationNR}, + UserLocationInformation: &UserLocationInformation{NR: &UserLocationInformationNR{NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{}, NRCellIdentity: NRCellIdentity(0)}, TAI: TAI{}}}, PDUSessionResourceList: PDUSessionResourceListCxtRelCpl{{PDUSessionID: 5}}, CriticalityDiagnostics: &CriticalityDiagnostics{}, }).encodeBody, @@ -534,7 +534,7 @@ func TestWireCriticality(t *testing.T) { AMFUENGAPID: 1, RANUENGAPID: 2, NASPDU: NASPDU{0x7e}, - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: CauseMiscUnspecified}), + Cause: Ptr(CauseMiscUnspecified.Cause()), }).encodeBody, []wireIE{ {IDAMFUENGAPID, CriticalityReject}, @@ -553,8 +553,8 @@ func TestWireCriticality(t *testing.T) { } for i, w := range tt.want { - if got[i].id != w.id || got[i].crit != w.crit { - t.Errorf("IE %d: got %v/%v, want %v/%v", i, got[i].id, got[i].crit, w.id, w.crit) + if got[i].ID != w.id || got[i].Criticality != w.crit { + t.Errorf("IE %d: got %v/%v, want %v/%v", i, got[i].ID, got[i].Criticality, w.id, w.crit) } } }) diff --git a/per/ap/container.go b/per/ap/container.go new file mode 100644 index 0000000000..8ab1c9c9c0 --- /dev/null +++ b/per/ap/container.go @@ -0,0 +1,201 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "github.com/ellanetworks/core/per" +) + +const minFieldBits = 34 + +type Field[ID ~uint16] struct { + ID ID + Criticality Criticality + Value []byte +} + +type FieldValue[ID ~uint16] struct { + ID ID + Criticality Criticality + Value per.Marshaler +} + +type RawValue []byte + +func (c RawValue) MarshalPER(w *per.Writer, _ per.Encoding) error { + w.WriteBitString(c, len(c)*8) + + return nil +} + +func EncodeField[ID ~uint16](p *Profile, w *per.Writer, enc per.Encoding, f FieldValue[ID]) error { + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, p.MaxProtocolIEs, int64(f.ID)); err != nil { + return err + } + + if err := per.EncodeEnumerated(w, enc, criticalityCount, false, int64(f.Criticality)); err != nil { + return err + } + + if f.Value == nil { + return p.errorf("%s has no value", p.ieName(uint16(f.ID))) + } + + if raw, ok := f.Value.(RawValue); ok { + return per.EncodeOpenTypeBytes(w, enc, raw) + } + + if err := per.EncodeOpenType(w, enc, f.Value); err != nil { + return p.errorf("encode %s: %w", p.ieName(uint16(f.ID)), err) + } + + return nil +} + +func EncodeIEContainer[ID ~uint16](p *Profile, w *per.Writer, enc per.Encoding, fields []FieldValue[ID]) error { + if int64(len(fields)) > p.MaxProtocolIEs { + return p.errorf("%d IEs exceed maxProtocolIEs", len(fields)) + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, p.MaxProtocolIEs, int64(len(fields))); err != nil { + return err + } + + for _, f := range fields { + if err := EncodeField(p, w, enc, f); err != nil { + return err + } + } + + return nil +} + +func EncodeExtensionContainer[ID ~uint16](p *Profile, w *per.Writer, enc per.Encoding, fields []FieldValue[ID]) error { + if int64(len(fields)) > p.MaxProtocolExtensions { + return p.errorf("%d extensions exceed maxProtocolExtensions", len(fields)) + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 1, p.MaxProtocolExtensions, int64(len(fields))); err != nil { + return err + } + + for _, f := range fields { + if err := EncodeField(p, w, enc, f); err != nil { + return err + } + } + + return nil +} + +func DecodeIEContainer[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) ([]Field[ID], error) { + n, err := per.DecodeConstrainedWholeNumber(r, enc, 0, p.MaxProtocolIEs) + if err != nil { + return nil, p.errorf("IE container length: %w", err) + } + + return decodeFields[ID](p, r, enc, n, "IE", false) +} + +func decodeExtensionFields[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding, allowEmpty bool) ([]Field[ID], error) { + n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, p.MaxProtocolExtensions) + if err != nil { + return nil, p.errorf("extension container length: %w", err) + } + + return decodeFields[ID](p, r, enc, n, "extension", allowEmpty) +} + +func decodeFields[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding, n int64, what string, allowEmpty bool) ([]Field[ID], error) { + if maxBits := int64(r.Bits()); n > maxBits/minFieldBits { + return nil, p.errorf("%s container declares %d fields in %d bits", what, n, maxBits) + } + + fields := make([]Field[ID], 0, n) + + for i := range n { + f, err := decodeField[ID](p, r, enc, allowEmpty) + if err != nil { + return nil, p.errorf("%s %d: %w", what, i, err) + } + + fields = append(fields, f) + } + + return fields, nil +} + +func decodeField[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding, allowEmpty bool) (Field[ID], error) { + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, p.MaxProtocolIEs) + if err != nil { + return Field[ID]{}, err + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) + if err != nil { + return Field[ID]{}, err + } + + val, err := per.DecodeOpenTypeBytes(r, enc) + if err != nil { + return Field[ID]{}, err + } + + if len(val) == 0 && !allowEmpty { + return Field[ID]{}, p.errorf("%s has an empty open type", p.ieName(uint16(id))) + } + + return Field[ID]{ID: ID(id), Criticality: Criticality(crit), Value: val}, nil +} + +func DecodeSingleContainer[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) (Field[ID], error) { + return decodeField[ID](p, r, enc, false) +} + +func SkipExtensionContainer[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) error { + _, err := decodeExtensionFields[ID](p, r, enc, true) + + return err +} + +type SingleContainer[ID ~uint16] struct { + ID ID + Criticality Criticality + Value string +} + +func DecodeSingleContainerValue[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) (SingleContainer[ID], error) { + f, err := decodeField[ID](p, r, enc, false) + if err != nil { + return SingleContainer[ID]{}, err + } + + return SingleContainer[ID]{ID: f.ID, Criticality: f.Criticality, Value: string(f.Value)}, nil +} + +func (c SingleContainer[ID]) Field() FieldValue[ID] { + return FieldValue[ID]{ID: c.ID, Criticality: c.Criticality, Value: RawValue(c.Value)} +} + +type WireCriticality uint8 + +func Wire(wire, spec Criticality) WireCriticality { + if wire == spec { + return 0 + } + + return WireCriticality(wire) + 1 +} + +func (w WireCriticality) Of(spec Criticality) Criticality { + if w == 0 { + return spec + } + + return Criticality(w - 1) +} + +func (f Field[ID]) Encodable() FieldValue[ID] { + return FieldValue[ID]{ID: f.ID, Criticality: f.Criticality, Value: RawValue(f.Value)} +} diff --git a/per/ap/criticality.go b/per/ap/criticality.go new file mode 100644 index 0000000000..8927e6eb4f --- /dev/null +++ b/per/ap/criticality.go @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import "fmt" + +type Criticality uint8 + +const ( + CriticalityReject Criticality = iota + CriticalityIgnore + CriticalityNotify +) + +const criticalityCount = 3 + +var criticalityNames = [criticalityCount]string{"reject", "ignore", "notify"} + +func (c Criticality) String() string { + if int(c) < len(criticalityNames) { + return criticalityNames[c] + } + + return fmt.Sprintf("Criticality(%d)", uint8(c)) +} + +type Presence uint8 + +const ( + PresenceOptional Presence = iota + PresenceConditional + PresenceMandatory +) + +func (c Criticality) Name() string { + if int(c) < len(criticalityNames) { + return criticalityNames[c] + } + + return "" +} diff --git a/per/ap/diagnostics.go b/per/ap/diagnostics.go new file mode 100644 index 0000000000..3d24bf66a8 --- /dev/null +++ b/per/ap/diagnostics.go @@ -0,0 +1,267 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "fmt" + "slices" + "strings" +) + +type Kind uint8 + +const ( + KindNotComprehended Kind = iota + KindMissing + KindWrongOrder + KindTooManyOccurrences + KindErroneouslyPresent +) + +var kindNames = [...]string{ + KindNotComprehended: "not-comprehended", + KindMissing: "missing", + KindWrongOrder: "wrong-order", + KindTooManyOccurrences: "too-many-occurrences", + KindErroneouslyPresent: "erroneously-present", +} + +func (k Kind) String() string { + if int(k) < len(kindNames) { + return kindNames[k] + } + + return fmt.Sprintf("Kind(%d)", uint8(k)) +} + +type Diagnostic[ID ~uint16] struct { + Path []ID + ID ID + Criticality Criticality + Kind Kind + + pos int +} + +func (d Diagnostic[ID]) String() string { + var b strings.Builder + + for _, id := range d.Path { + fmt.Fprintf(&b, "%v/", id) + } + + fmt.Fprintf(&b, "%v (%s, %s)", d.ID, d.Criticality, d.Kind) + + return b.String() +} + +type Diagnostics[ID ~uint16] struct { + IEs []Diagnostic[ID] + RootNotComprehended bool +} + +func (d Diagnostics[ID]) Empty() bool { return len(d.IEs) == 0 && !d.RootNotComprehended } + +func (d Diagnostics[ID]) Notify() []Diagnostic[ID] { + var out []Diagnostic[ID] + + for _, e := range d.IEs { + if e.Criticality == CriticalityNotify && (e.Kind == KindNotComprehended || e.Kind == KindMissing) { + out = append(out, e) + } + } + + return out +} + +func (d Diagnostics[ID]) ReportRequired() bool { return len(d.Notify()) > 0 } + +func (d Diagnostics[ID]) Check() error { + first := -1 + + for i, e := range d.IEs { + if (e.Kind == KindWrongOrder || e.Kind == KindTooManyOccurrences) && (first < 0 || e.pos < d.IEs[first].pos) { + first = i + } + } + + if first >= 0 { + var ies []Diagnostic[ID] + + for _, e := range d.IEs { + if e.pos < d.IEs[first].pos && e.Kind == KindNotComprehended && e.Criticality == CriticalityReject { + ies = append(ies, e) + } + } + + return &AbstractSyntaxError[ID]{FalselyConstructed: true, IEs: ies} + } + + if ies := d.filter(KindNotComprehended, CriticalityReject); len(ies) > 0 || d.RootNotComprehended { + return &AbstractSyntaxError[ID]{IEs: ies} + } + + if slices.ContainsFunc(d.IEs, func(e Diagnostic[ID]) bool { return e.Kind == KindErroneouslyPresent }) { + return &AbstractSyntaxError[ID]{FalselyConstructed: true} + } + + if ies := d.filter(KindMissing, CriticalityReject); len(ies) > 0 { + return &AbstractSyntaxError[ID]{IEs: ies} + } + + return nil +} + +func (d Diagnostics[ID]) filter(kind Kind, crit Criticality) []Diagnostic[ID] { + var out []Diagnostic[ID] + + for _, e := range d.IEs { + if e.Kind == kind && e.Criticality == crit { + out = append(out, e) + } + } + + return out +} + +type AbstractSyntaxError[ID ~uint16] struct { + FalselyConstructed bool + IEs []Diagnostic[ID] +} + +func (e *AbstractSyntaxError[ID]) Error() string { + cause := "abstract syntax error (reject)" + if e.FalselyConstructed { + cause = "abstract syntax error (falsely constructed message)" + } + + if len(e.IEs) == 0 { + return "ap: " + cause + } + + ies := make([]string, len(e.IEs)) + for i, d := range e.IEs { + ies[i] = d.String() + } + + return "ap: " + cause + ": " + strings.Join(ies, ", ") +} + +type Diagnosable[ID ~uint16] interface { + Diagnose(d *Diagnosis[ID]) bool +} + +type Diagnosis[ID ~uint16] struct { + entries []Diagnostic[ID] + path []ID + pos int +} + +func (d *Diagnosis[ID]) report(id ID, crit Criticality, kind Kind) { + d.entries = append(d.entries, Diagnostic[ID]{ + Path: slices.Clone(d.path), + ID: id, + Criticality: crit, + Kind: kind, + pos: d.pos, + }) +} + +func (d *Diagnosis[ID]) Unknown(id ID, crit Criticality) { + d.report(id, crit, KindNotComprehended) +} + +func (d *Diagnosis[ID]) IE(id ID, crit Criticality, v any) { + dv, ok := v.(Diagnosable[ID]) + if !ok { + return + } + + d.path = append(d.path, id) + notComprehended := dv.Diagnose(d) + d.path = d.path[:len(d.path)-1] + + if notComprehended { + d.report(id, crit, KindNotComprehended) + } +} + +func (d *Diagnosis[ID]) Diagnostics() Diagnostics[ID] { + return Diagnostics[ID]{IEs: slices.Clone(d.entries)} +} + +func Comprehended[ID ~uint16](v any) bool { + dv, ok := v.(Diagnosable[ID]) + + return !ok || !dv.Diagnose(&Diagnosis[ID]{}) +} + +func Diagnose[ID ~uint16](v Diagnosable[ID]) Diagnostics[ID] { + var d Diagnosis[ID] + + notComprehended := v.Diagnose(&d) + out := d.Diagnostics() + out.RootNotComprehended = notComprehended + + return out +} + +func DiagnoseExtensions[ID ~uint16, M any](d *Diagnosis[ID], table []IESpec[ID, M], m *M, pres Preserved[ID]) { + top := len(d.path) == 0 + slots := pres.slots() + last := -1 + + for i, s := range slots { + if top { + d.pos = i + } + + switch { + case s.duplicate: + d.report(s.id, s.crit, KindTooManyOccurrences) + case s.preserved: + d.report(s.id, s.crit, KindNotComprehended) + default: + idx := lookup(table, s.id) + if idx < last { + d.report(s.id, s.crit, KindWrongOrder) + } + + last = max(last, idx) + } + } + + for _, spec := range table { + crit := spec.Criticality + + if top { + d.pos = len(slots) + } + + for i, s := range slots { + if !s.preserved && s.id == spec.ID { + crit = s.crit + + if top { + d.pos = i + } + + break + } + } + + val, ok := spec.Encode(m) + + switch { + case ok && spec.Presence == PresenceConditional && !spec.Required(m): + d.report(spec.ID, crit, KindErroneouslyPresent) + case !ok && spec.Required(m): + d.report(spec.ID, crit, KindMissing) + } + + if ok { + d.IE(spec.ID, crit, val) + } + } +} diff --git a/per/ap/errors.go b/per/ap/errors.go new file mode 100644 index 0000000000..ecf6d29e7f --- /dev/null +++ b/per/ap/errors.go @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "errors" + "fmt" +) + +var ( + ErrProfile = errors.New("ap: invalid profile") + ErrNotComprehended = errors.New("ap: not comprehended") + ErrExtensionAlternative = errors.New("ap: PDU extension alternative") + ErrNotProtocolIEContainer = errors.New("ap: message body is not a ProtocolIE-Container") + ErrIndex = errors.New("ap: field index out of range") + ErrTooManyFields = errors.New("ap: more than maxProtocolIEs fields") + ErrCriticality = errors.New("ap: criticality out of range") + ErrDuplicateIE = errors.New("ap: IE present more than once") + ErrIENotPresent = errors.New("ap: IE not present") +) + +type TransferSyntaxError[P ~uint8] struct { + Protocol string + Procedure P + Err error +} + +func (e *TransferSyntaxError[P]) Error() string { + return fmt.Sprintf("%s: %v: transfer syntax error: %v", e.Protocol, e.Procedure, e.Err) +} + +func (e *TransferSyntaxError[P]) Unwrap() error { return e.Err } diff --git a/per/ap/message_equal_test.go b/per/ap/message_equal_test.go new file mode 100644 index 0000000000..860d187e4b --- /dev/null +++ b/per/ap/message_equal_test.go @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import "testing" + +func TestMessageEqualComparesPreservedState(t *testing.T) { + base := func() Message[uint16] { + var m Message[uint16] + + m.Append(Field[uint16]{ID: 9, Criticality: CriticalityIgnore, Value: []byte{1}}) + m.exempt = []uint16{3} + m.absent = []absentIE[uint16]{{id: 4, encoded: "\x01"}} + + return m + } + + if a, b := base(), base(); !a.Equal(b) { + t.Fatal("identical messages differ") + } + + a := base() + a.diagnostics = Diagnostics[uint16]{RootNotComprehended: true} + + if !a.Equal(base()) { + t.Fatal("diagnostics are derived from the preserved state and must not affect equality") + } + + for name, mutate := range map[string]func(*Message[uint16]){ + "preserved IE": func(m *Message[uint16]) { m.Append(Field[uint16]{ID: 10, Value: []byte{2}}) }, + "exempt": func(m *Message[uint16]) { m.exempt = nil }, + "absent": func(m *Message[uint16]) { m.absent[0].encoded = "\x02" }, + } { + m := base() + mutate(&m) + + if m.Equal(base()) { + t.Errorf("%s: messages compare equal", name) + } + } +} diff --git a/per/ap/pdu.go b/per/ap/pdu.go new file mode 100644 index 0000000000..a6d2bce314 --- /dev/null +++ b/per/ap/pdu.go @@ -0,0 +1,116 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "fmt" + "strings" + + "github.com/ellanetworks/core/per" +) + +const ( + pduChoiceCount = 3 + maxProcedureCode = 255 +) + +type Envelope struct { + Choice int + ProcedureCode uint8 + Criticality Criticality + Value []byte +} + +func (p *Profile) EncodePDU(e Envelope) ([]byte, error) { + if err := p.validate(); err != nil { + return nil, err + } + + w := per.NewWriter() + enc := per.Aligned + + w.WriteBit(false) + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, pduChoiceCount-1, int64(e.Choice)); err != nil { + return nil, p.errorf("PDU choice: %w", err) + } + + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, maxProcedureCode, int64(e.ProcedureCode)); err != nil { + return nil, p.errorf("procedureCode: %w", err) + } + + if err := per.EncodeEnumerated(w, enc, criticalityCount, false, int64(e.Criticality)); err != nil { + return nil, p.errorf("criticality: %w", err) + } + + if err := per.EncodeOpenTypeBytes(w, enc, e.Value); err != nil { + return nil, p.errorf("value: %w", err) + } + + w.AlignToByte() + + return w.Bytes(), nil +} + +func (p *Profile) DecodePDU(b []byte) (Envelope, error) { + if err := p.validate(); err != nil { + return Envelope{}, err + } + + r := per.NewReader(b) + + e, err := p.decodeHeader(r) + if err != nil { + return Envelope{}, err + } + + val, err := per.DecodeOpenTypeBytes(r, per.Aligned) + if err != nil { + return Envelope{}, p.errorf("value: %w", err) + } + + e.Value = val + + return e, nil +} + +func (p *Profile) decodeHeader(r *per.Reader) (Envelope, error) { + enc := per.Aligned + + ext, err := r.ReadBit() + if err != nil { + return Envelope{}, p.errorf("PDU choice: %w", err) + } + + if ext { + return Envelope{}, extensionAlternativeError{protocol: p.Name} + } + + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, pduChoiceCount-1) + if err != nil { + return Envelope{}, p.errorf("PDU choice: %w", err) + } + + pc, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProcedureCode) + if err != nil { + return Envelope{}, p.errorf("procedureCode: %w", err) + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) + if err != nil { + return Envelope{}, p.errorf("criticality: %w", err) + } + + return Envelope{Choice: int(idx), ProcedureCode: uint8(pc), Criticality: Criticality(crit)}, nil +} + +type extensionAlternativeError struct { + protocol string +} + +func (e extensionAlternativeError) Error() string { + return fmt.Sprintf("%s: unsupported %s-PDU extension alternative", e.protocol, strings.ToUpper(e.protocol)) +} + +func (e extensionAlternativeError) Is(target error) bool { return target == ErrExtensionAlternative } diff --git a/per/ap/preserved.go b/per/ap/preserved.go new file mode 100644 index 0000000000..32897ecf2c --- /dev/null +++ b/per/ap/preserved.go @@ -0,0 +1,142 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "encoding/binary" + "slices" + + "github.com/ellanetworks/core/per" +) + +const ( + slotSize = 3 + slotPreserved = 0x80 + slotDuplicate = 0x40 + slotFlags = slotPreserved | slotDuplicate +) + +type Preserved[ID ~uint16] struct { + fields string + order string +} + +func (p Preserved[ID]) UnknownIEs() []Field[ID] { + var out []Field[ID] + + for rest := p.fields; rest != ""; { + var f Field[ID] + + f, rest = nextPreserved[ID](rest) + out = append(out, f) + } + + return out +} + +func nextPreserved[ID ~uint16](s string) (Field[ID], string) { + id := ID(uint16(s[0])<<8 | uint16(s[1])) + crit := Criticality(s[2]) + n, w := binary.Uvarint([]byte(s[3:min(len(s), 3+binary.MaxVarintLen64)])) + start := 3 + w + end := start + int(n) + + return Field[ID]{ID: id, Criticality: crit, Value: []byte(s[start:end])}, s[end:] +} + +type slot[ID ~uint16] struct { + id ID + crit Criticality + preserved bool + duplicate bool +} + +func (p Preserved[ID]) slots() []slot[ID] { + out := make([]slot[ID], 0, len(p.order)/slotSize) + + for i := 0; i+slotSize <= len(p.order); i += slotSize { + out = append(out, slot[ID]{ + id: ID(uint16(p.order[i])<<8 | uint16(p.order[i+1])), + crit: Criticality(p.order[i+2] &^ slotFlags), + preserved: p.order[i+2]&slotPreserved != 0, + duplicate: p.order[i+2]&slotDuplicate != 0, + }) + } + + return out +} + +type preservedBuilder[ID ~uint16] struct { + fields []byte + order []byte + canonical bool + last int +} + +func newPreservedBuilder[ID ~uint16]() *preservedBuilder[ID] { + return &preservedBuilder[ID]{canonical: true, last: -1} +} + +func (b *preservedBuilder[ID]) keep(f Field[ID], duplicate bool) { + flags := byte(slotPreserved) + if duplicate { + flags |= slotDuplicate + } + + b.fields = binary.BigEndian.AppendUint16(b.fields, uint16(f.ID)) + b.fields = append(b.fields, byte(f.Criticality)) + b.fields = binary.AppendUvarint(b.fields, uint64(len(f.Value))) + b.fields = append(b.fields, f.Value...) + b.order = binary.BigEndian.AppendUint16(b.order, uint16(f.ID)) + b.order = append(b.order, byte(f.Criticality)|flags) + b.canonical = false +} + +func (b *preservedBuilder[ID]) known(id ID, crit Criticality, idx int, specCrit Criticality) { + b.order = binary.BigEndian.AppendUint16(b.order, uint16(id)) + b.order = append(b.order, byte(crit)) + + if idx <= b.last || crit != specCrit { + b.canonical = false + } + + b.last = idx +} + +func (b *preservedBuilder[ID]) build() Preserved[ID] { + if b.canonical { + return Preserved[ID]{} + } + + return Preserved[ID]{fields: string(b.fields), order: string(b.order)} +} + +type Message[ID ~uint16] struct { + Preserved[ID] + + diagnostics Diagnostics[ID] + exempt []ID + absent []absentIE[ID] + ExtensionAdditions per.ExtensionAdditions +} + +func (m Message[ID]) Diagnostics() Diagnostics[ID] { return m.diagnostics } + +func (m Message[ID]) Equal(o Message[ID]) bool { + return m.Preserved == o.Preserved && m.ExtensionAdditions == o.ExtensionAdditions && + slices.Equal(m.exempt, o.exempt) && slices.Equal(m.absent, o.absent) +} + +func (p *Preserved[ID]) Append(f Field[ID]) { + b := preservedBuilder[ID]{fields: []byte(p.fields), order: []byte(p.order)} + + b.keep(f, false) + + p.fields, p.order = string(b.fields), string(b.order) +} + +type absentIE[ID ~uint16] struct { + id ID + encoded string +} diff --git a/per/ap/profile.go b/per/ap/profile.go new file mode 100644 index 0000000000..374719a69f --- /dev/null +++ b/per/ap/profile.go @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "fmt" + "slices" +) + +const maxContainerBound = 65535 + +type Profile struct { + Name string + MaxProtocolIEs int64 + MaxProtocolExtensions int64 + OpaqueProcedures []uint8 + ProcedureName func(procedureCode uint8) string + IEName func(id uint16) string +} + +func (p *Profile) validate() error { + switch { + case p == nil: + return fmt.Errorf("%w: nil", ErrProfile) + case p.Name == "": + return fmt.Errorf("%w: no name", ErrProfile) + case p.MaxProtocolIEs < 1 || p.MaxProtocolIEs > maxContainerBound: + return fmt.Errorf("%w: %s: maxProtocolIEs %d", ErrProfile, p.Name, p.MaxProtocolIEs) + case p.MaxProtocolExtensions < 1 || p.MaxProtocolExtensions > maxContainerBound: + return fmt.Errorf("%w: %s: maxProtocolExtensions %d", ErrProfile, p.Name, p.MaxProtocolExtensions) + default: + return nil + } +} + +func (p *Profile) Opaque(procedureCode uint8) bool { + return slices.Contains(p.OpaqueProcedures, procedureCode) +} + +func (p *Profile) procedureName(procedureCode uint8) string { + if p.ProcedureName != nil { + return p.ProcedureName(procedureCode) + } + + return fmt.Sprintf("procedure %d", procedureCode) +} + +func (p *Profile) ieName(id uint16) string { + if p.IEName != nil { + return p.IEName(id) + } + + return fmt.Sprintf("%d", id) +} + +func (p *Profile) errorf(format string, args ...any) error { + return fmt.Errorf(p.Name+": "+format, args...) +} diff --git a/per/ap/raw.go b/per/ap/raw.go new file mode 100644 index 0000000000..b3dce93cfb --- /dev/null +++ b/per/ap/raw.go @@ -0,0 +1,408 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "bytes" + "iter" + + "github.com/ellanetworks/core/per" +) + +const fragmentedForm = 0xC0 + +type openType struct { + det []byte + content []byte + raw []byte +} + +type rawField[ID ~uint16] struct { + id ID + crit Criticality + hdr []byte + val openType + content []byte +} + +type RawPDU[ID ~uint16] struct { + profile *Profile + header Envelope + opaque bool + + orig []byte + head []byte + body openType + bodyHdr []byte + count []byte + fields []rawField[ID] + bodyTail []byte + tail []byte + + countChanged bool + dirty bool +} + +func ParseRawPDU[ID ~uint16](p *Profile, b []byte) (*RawPDU[ID], error) { + if err := p.validate(); err != nil { + return nil, err + } + + b = bytes.Clone(b) + r := per.NewReader(b) + + header, err := p.decodeHeader(r) + if err != nil { + return nil, err + } + + r.AlignToByte() + headEnd := r.Offset() / 8 + + body, err := readOpenType(r, b) + if err != nil { + return nil, p.errorf("value: %w", err) + } + + header.Value = body.content + + m := &RawPDU[ID]{ + profile: p, + header: header, + opaque: p.Opaque(header.ProcedureCode), + orig: b, + head: b[:headEnd], + body: body, + tail: b[r.Offset()/8:], + } + + if m.opaque { + return m, nil + } + + if err := m.parseBody(); err != nil { + return nil, err + } + + return m, nil +} + +func (m *RawPDU[ID]) parseBody() error { + p := m.profile + content := m.body.content + r := per.NewReader(content) + enc := per.Aligned + + if _, err := r.ReadBit(); err != nil { + return p.errorf("message preamble: %w", err) + } + + r.AlignToByte() + hdrEnd := r.Offset() / 8 + + n, err := per.DecodeConstrainedWholeNumber(r, enc, 0, p.MaxProtocolIEs) + if err != nil { + return p.errorf("IE count: %w", err) + } + + countEnd := r.Offset() / 8 + + if n > int64(len(content)-countEnd)/(minFieldBits/8) { + return p.errorf("%d IEs declared in %d octets", n, len(content)-countEnd) + } + + m.bodyHdr = content[:hdrEnd] + m.count = content[hdrEnd:countEnd] + m.fields = make([]rawField[ID], 0, n) + + for i := range n { + start := r.Offset() / 8 + + id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, p.MaxProtocolIEs) + if err != nil { + return p.errorf("IE %d id: %w", i, err) + } + + crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) + if err != nil { + return p.errorf("IE %d criticality: %w", i, err) + } + + r.AlignToByte() + hdrEnd := r.Offset() / 8 + + val, err := readOpenType(r, content) + if err != nil { + return p.errorf("IE %d value: %w", i, err) + } + + m.fields = append(m.fields, rawField[ID]{id: ID(id), crit: Criticality(crit), hdr: content[start:hdrEnd], val: val, content: val.content}) + } + + m.bodyTail = content[r.Offset()/8:] + + return nil +} + +func readOpenType(r *per.Reader, buf []byte) (openType, error) { + start := r.Offset() / 8 + + content, err := per.DecodeOpenTypeBytes(r, per.Aligned) + if err != nil { + return openType{}, err + } + + raw := buf[start : r.Offset()/8] + ot := openType{content: content, raw: raw} + + if raw[0]&fragmentedForm != fragmentedForm { + ot.det = raw[:len(raw)-len(content)] + } + + return ot, nil +} + +func (m *RawPDU[ID]) Profile() *Profile { return m.profile } + +func (m *RawPDU[ID]) Choice() int { return m.header.Choice } + +func (m *RawPDU[ID]) ProcedureCode() uint8 { return m.header.ProcedureCode } + +func (m *RawPDU[ID]) Criticality() Criticality { return m.header.Criticality } + +func (m *RawPDU[ID]) Opaque() bool { return m.opaque } + +func (m *RawPDU[ID]) Body() []byte { return bytes.Clone(m.body.content) } + +func (m *RawPDU[ID]) Len() int { return len(m.fields) } + +func (m *RawPDU[ID]) container() error { + if m.opaque { + return m.profile.errorf("%s: %w", m.profile.procedureName(m.header.ProcedureCode), ErrNotProtocolIEContainer) + } + + return nil +} + +func (m *RawPDU[ID]) Field(i int) (Field[ID], error) { + if i < 0 || i >= len(m.fields) { + return Field[ID]{}, ErrIndex + } + + f := m.fields[i] + + return Field[ID]{ID: f.id, Criticality: f.crit, Value: bytes.Clone(f.content)}, nil +} + +func (m *RawPDU[ID]) Fields() []Field[ID] { + out := make([]Field[ID], len(m.fields)) + for i := range m.fields { + out[i], _ = m.Field(i) + } + + return out +} + +func (m *RawPDU[ID]) All(id ID) iter.Seq2[int, Field[ID]] { + return func(yield func(int, Field[ID]) bool) { + for i, f := range m.fields { + if f.id != id { + continue + } + + if !yield(i, Field[ID]{ID: f.id, Criticality: f.crit, Value: bytes.Clone(f.content)}) { + return + } + } + } +} + +func (m *RawPDU[ID]) Index(id ID) (int, error) { + idx := -1 + + for i, f := range m.fields { + if f.id != id { + continue + } + + if idx >= 0 { + return -1, m.profile.errorf("%w: %s", ErrDuplicateIE, m.profile.ieName(uint16(id))) + } + + idx = i + } + + return idx, nil +} + +func (m *RawPDU[ID]) Get(id ID, v per.Unmarshaler) (bool, error) { + i, err := m.Index(id) + if err != nil || i < 0 { + return false, err + } + + if err := v.UnmarshalPER(per.NewReader(m.fields[i].content), per.Aligned); err != nil { + return false, m.profile.errorf("%s: %w", m.profile.ieName(uint16(id)), err) + } + + return true, nil +} + +func (m *RawPDU[ID]) Set(id ID, v per.Marshaler) error { + i, err := m.Index(id) + if err != nil { + return err + } + + if i < 0 { + return m.profile.errorf("%w: %s", ErrIENotPresent, m.profile.ieName(uint16(id))) + } + + b, err := per.Marshal(v, per.Aligned) + if err != nil { + return m.profile.errorf("%s: %w", m.profile.ieName(uint16(id)), err) + } + + return m.SetValue(i, b) +} + +func (m *RawPDU[ID]) SetValue(i int, value []byte) error { + if i < 0 || i >= len(m.fields) { + return ErrIndex + } + + m.fields[i].content = bytes.Clone(value) + m.dirty = true + + return nil +} + +func (m *RawPDU[ID]) Insert(i int, f Field[ID]) error { + if err := m.container(); err != nil { + return err + } + + if i < 0 || i > len(m.fields) { + return ErrIndex + } + + if int64(len(m.fields)) >= m.profile.MaxProtocolIEs { + return ErrTooManyFields + } + + if f.Criticality >= criticalityCount { + return ErrCriticality + } + + nf := rawField[ID]{id: f.ID, crit: f.Criticality, content: append([]byte{}, f.Value...)} + + m.fields = append(m.fields, rawField[ID]{}) + copy(m.fields[i+1:], m.fields[i:]) + m.fields[i] = nf + m.countChanged = true + m.dirty = true + + return nil +} + +func (m *RawPDU[ID]) Remove(i int) error { + if i < 0 || i >= len(m.fields) { + return ErrIndex + } + + m.fields = append(m.fields[:i], m.fields[i+1:]...) + m.countChanged = true + m.dirty = true + + return nil +} + +func (m *RawPDU[ID]) Marshal() ([]byte, error) { + if !m.dirty { + return bytes.Clone(m.orig), nil + } + + content := make([]byte, 0, len(m.body.content)+16) + content = append(content, m.bodyHdr...) + + if m.countChanged { + w := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, m.profile.MaxProtocolIEs, int64(len(m.fields))); err != nil { + return nil, err + } + + content = append(content, w.Bytes()...) + } else { + content = append(content, m.count...) + } + + for _, f := range m.fields { + enc, err := m.encodeField(f) + if err != nil { + return nil, err + } + + content = append(content, enc...) + } + + content = append(content, m.bodyTail...) + + body, err := m.body.encode(content) + if err != nil { + return nil, err + } + + out := make([]byte, 0, len(m.head)+len(body)+len(m.tail)) + out = append(out, m.head...) + out = append(out, body...) + out = append(out, m.tail...) + + return out, nil +} + +func (m *RawPDU[ID]) encodeField(f rawField[ID]) ([]byte, error) { + hdr := f.hdr + if hdr == nil { + w := per.NewWriter() + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, m.profile.MaxProtocolIEs, int64(f.id)); err != nil { + return nil, err + } + + if err := per.EncodeEnumerated(w, per.Aligned, criticalityCount, false, int64(f.crit)); err != nil { + return nil, err + } + + hdr = w.Bytes() + } + + val, err := f.val.encode(f.content) + if err != nil { + return nil, err + } + + out := make([]byte, 0, len(hdr)+len(val)) + out = append(out, hdr...) + + return append(out, val...), nil +} + +func (o openType) encode(content []byte) ([]byte, error) { + if o.raw != nil && bytes.Equal(content, o.content) { + return o.raw, nil + } + + if o.det != nil && len(content) == len(o.content) && len(content) > 0 { + out := make([]byte, 0, len(o.det)+len(content)) + out = append(out, o.det...) + + return append(out, content...), nil + } + + w := per.NewWriter() + if err := per.EncodeOpenTypeBytes(w, per.Aligned, content); err != nil { + return nil, err + } + + return w.Bytes(), nil +} diff --git a/per/protocolie/protocolie_test.go b/per/ap/raw_test.go similarity index 67% rename from per/protocolie/protocolie_test.go rename to per/ap/raw_test.go index 09d9779e8a..67b1233c2e 100644 --- a/per/protocolie/protocolie_test.go +++ b/per/ap/raw_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package protocolie +package ap import ( "bytes" @@ -11,18 +11,18 @@ import ( "github.com/ellanetworks/core/per" ) -func encodeBody(t testing.TB, fields []Field) []byte { +func encodeBody(t testing.TB, fields []Field[uint16]) []byte { t.Helper() w := per.NewWriter() w.WriteBit(false) - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(len(fields))); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, testProfile.MaxProtocolIEs, int64(len(fields))); err != nil { t.Fatal(err) } for _, f := range fields { - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(f.ID)); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, testProfile.MaxProtocolIEs, int64(f.ID)); err != nil { t.Fatal(err) } @@ -48,7 +48,7 @@ func encodePDU(t testing.TB, choice int, pc uint8, crit uint8, body []byte) []by t.Fatal(err) } - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProcedureCode, int64(pc)); err != nil { + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 255, int64(pc)); err != nil { t.Fatal(err) } @@ -63,10 +63,10 @@ func encodePDU(t testing.TB, choice int, pc uint8, crit uint8, body []byte) []by return w.Bytes() } -func mustParse(t testing.TB, b []byte) *Message { +func mustParse(t testing.TB, b []byte) *RawPDU[uint16] { t.Helper() - m, err := Parse(b, nil) + m, err := ParseRawPDU[uint16](testProfile, b) if err != nil { t.Fatalf("Parse(% x): %v", b, err) } @@ -74,10 +74,10 @@ func mustParse(t testing.TB, b []byte) *Message { return m } -func mustBytes(t testing.TB, m *Message) []byte { +func mustBytes(t testing.TB, m *RawPDU[uint16]) []byte { t.Helper() - b, err := m.Bytes() + b, err := m.Marshal() if err != nil { t.Fatal(err) } @@ -86,7 +86,7 @@ func mustBytes(t testing.TB, m *Message) []byte { } func TestParseHeaderAndFields(t *testing.T) { - fields := []Field{ + fields := []Field[uint16]{ {ID: 0, Criticality: 0, Value: []byte{0x00, 0x01}}, {ID: 8, Criticality: 0, Value: []byte{0x00, 0x07}}, {ID: 26, Criticality: 1, Value: []byte{0x01, 0x07}}, @@ -110,8 +110,12 @@ func TestParseHeaderAndFields(t *testing.T) { } } - if m.Index(26) != 2 || m.Index(99) != -1 { - t.Errorf("Index: %d %d", m.Index(26), m.Index(99)) + if i, err := m.Index(26); i != 2 || err != nil { + t.Errorf("Index(26) = %d, %v", i, err) + } + + if i, err := m.Index(99); i != -1 || err != nil { + t.Errorf("Index(99) = %d, %v", i, err) } if !bytes.Equal(mustBytes(t, m), b) { @@ -120,7 +124,7 @@ func TestParseHeaderAndFields(t *testing.T) { } func TestParseIndependentOfInput(t *testing.T) { - fields := []Field{ + fields := []Field[uint16]{ {ID: 0, Criticality: 0, Value: []byte{0x00, 0x01}}, {ID: 8, Criticality: 0, Value: []byte{0x00, 0x07}}, {ID: 26, Criticality: 1, Value: []byte{0x01, 0x07}}, @@ -159,11 +163,11 @@ func TestEmptyContainer(t *testing.T) { t.Fatalf("Len = %d", m.Len()) } - if err := m.Insert(0, Field{ID: 2, Criticality: 1, Value: []byte{0x00}}); err != nil { + if err := m.Insert(0, Field[uint16]{ID: 2, Criticality: 1, Value: []byte{0x00}}); err != nil { t.Fatal(err) } - want := encodePDU(t, 0, 14, 0, encodeBody(t, []Field{{ID: 2, Criticality: 1, Value: []byte{0x00}}})) + want := encodePDU(t, 0, 14, 0, encodeBody(t, []Field[uint16]{{ID: 2, Criticality: 1, Value: []byte{0x00}}})) if got := mustBytes(t, m); !bytes.Equal(got, want) { t.Fatalf("got % x, want % x", got, want) } @@ -174,7 +178,7 @@ func TestSetValueLengthBoundaries(t *testing.T) { for _, from := range sizes { for _, to := range sizes { - fields := []Field{ + fields := []Field[uint16]{ {ID: 1, Criticality: 0, Value: bytes.Repeat([]byte{0xa1}, 5)}, {ID: 2, Criticality: 1, Value: bytes.Repeat([]byte{0xb2}, from)}, {ID: 3, Criticality: 2, Value: bytes.Repeat([]byte{0xc3}, 3)}, @@ -207,7 +211,7 @@ func TestSetValueLengthBoundaries(t *testing.T) { } func TestSetSameValueIsIdentity(t *testing.T) { - fields := []Field{ + fields := []Field[uint16]{ {ID: 1, Criticality: 0, Value: bytes.Repeat([]byte{0x11}, 40000)}, {ID: 2, Criticality: 1, Value: []byte{0x22}}, } @@ -265,7 +269,7 @@ func TestNonCanonicalDeterminantKeptWhenUntouched(t *testing.T) { } func TestPaddingTailAndExtensionKept(t *testing.T) { - body := encodeBody(t, []Field{{ID: 5, Criticality: 0, Value: []byte{0x01}}}) + body := encodeBody(t, []Field[uint16]{{ID: 5, Criticality: 0, Value: []byte{0x01}}}) body[0] |= 0x80 body = append(body, 0x01, 0x80, 0x01, 0xff) @@ -292,14 +296,14 @@ func TestPaddingTailAndExtensionKept(t *testing.T) { } func TestInsertRemove(t *testing.T) { - fields := []Field{ + fields := []Field[uint16]{ {ID: 1, Criticality: 0, Value: []byte{0x01}}, {ID: 2, Criticality: 1, Value: []byte{0x02}}, } b := encodePDU(t, 0, 1, 0, encodeBody(t, fields)) m := mustParse(t, b) - if err := m.Insert(1, Field{ID: 9, Criticality: 2, Value: []byte{0x09, 0x09}}); err != nil { + if err := m.Insert(1, Field[uint16]{ID: 9, Criticality: 2, Value: []byte{0x09, 0x09}}); err != nil { t.Fatal(err) } @@ -307,16 +311,16 @@ func TestInsertRemove(t *testing.T) { t.Fatal(err) } - want := encodePDU(t, 0, 1, 0, encodeBody(t, []Field{{ID: 9, Criticality: 2, Value: []byte{0x09, 0x09}}, fields[1]})) + want := encodePDU(t, 0, 1, 0, encodeBody(t, []Field[uint16]{{ID: 9, Criticality: 2, Value: []byte{0x09, 0x09}}, fields[1]})) if got := mustBytes(t, m); !bytes.Equal(got, want) { t.Fatalf("got % x, want % x", got, want) } - if err := m.Insert(5, Field{}); !errors.Is(err, ErrIndex) { + if err := m.Insert(5, Field[uint16]{}); !errors.Is(err, ErrIndex) { t.Errorf("Insert past end: %v", err) } - if err := m.Insert(0, Field{Criticality: 3}); !errors.Is(err, ErrCriticality) { + if err := m.Insert(0, Field[uint16]{Criticality: 3}); !errors.Is(err, ErrCriticality) { t.Errorf("Insert criticality 3: %v", err) } @@ -332,46 +336,46 @@ func TestInsertRemove(t *testing.T) { func TestRefusals(t *testing.T) { body := encodeBody(t, nil) - if _, err := Parse(encodePDU(t, 0, 39, 1, body), func(pc uint8) bool { return pc == 39 }); !errors.Is(err, ErrNotProtocolIEContainer) { - t.Errorf("private message: %v", err) + if _, err := ParseRawPDU[uint16](nil, encodePDU(t, 0, 1, 0, body)); !errors.Is(err, ErrProfile) { + t.Errorf("nil profile: %v", err) } ext := encodePDU(t, 0, 1, 0, body) ext[0] |= 0x80 - if _, err := Parse(ext, nil); !errors.Is(err, ErrExtensionAlternative) { + if _, err := ParseRawPDU[uint16](testProfile, ext); !errors.Is(err, ErrExtensionAlternative) { t.Errorf("extension alternative: %v", err) } bad := encodePDU(t, 0, 1, 0, body) bad[0] |= 0x60 - if _, err := Parse(bad, nil); err == nil { + if _, err := ParseRawPDU[uint16](testProfile, bad); err == nil { t.Error("choice index 3 accepted") } - badCrit := encodePDU(t, 0, 1, 0, encodeBody(t, []Field{{ID: 1, Value: []byte{0x00}}})) + badCrit := encodePDU(t, 0, 1, 0, encodeBody(t, []Field[uint16]{{ID: 1, Value: []byte{0x00}}})) badCrit[9] = 0xc0 - if _, err := Parse(badCrit, nil); err == nil { + if _, err := ParseRawPDU[uint16](testProfile, badCrit); err == nil { t.Error("IE criticality 3 accepted") } inflated := encodePDU(t, 0, 1, 0, []byte{0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00}) - if _, err := Parse(inflated, nil); err == nil { + if _, err := ParseRawPDU[uint16](testProfile, inflated); err == nil { t.Error("count larger than the content accepted") } - full := encodePDU(t, 0, 1, 0, encodeBody(t, []Field{{ID: 1, Value: []byte{0x00}}})) + full := encodePDU(t, 0, 1, 0, encodeBody(t, []Field[uint16]{{ID: 1, Value: []byte{0x00}}})) for i := range len(full) - 1 { - if _, err := Parse(full[:i], nil); err == nil { + if _, err := ParseRawPDU[uint16](testProfile, full[:i]); err == nil { t.Errorf("truncation at %d accepted", i) } } } func TestFragmentedOuterBody(t *testing.T) { - fields := []Field{ + fields := []Field[uint16]{ {ID: 1, Criticality: 0, Value: bytes.Repeat([]byte{0x01}, 20000)}, {ID: 2, Criticality: 0, Value: []byte{0x00, 0x05}}, } @@ -394,20 +398,20 @@ func TestFragmentedOuterBody(t *testing.T) { } } -func FuzzParse(f *testing.F) { - f.Add(encodePDU(f, 0, 12, 1, encodeBody(f, []Field{{ID: 8, Value: []byte{0x00, 0x01}}, {ID: 26, Criticality: 1, Value: []byte{0x01, 0x07}}}))) +func FuzzRawPDU(f *testing.F) { + f.Add(encodePDU(f, 0, 12, 1, encodeBody(f, []Field[uint16]{{ID: 8, Value: []byte{0x00, 0x01}}, {ID: 26, Criticality: 1, Value: []byte{0x01, 0x07}}}))) f.Add(encodePDU(f, 1, 14, 0, encodeBody(f, nil))) - f.Add(encodePDU(f, 2, 17, 0, encodeBody(f, []Field{{ID: 2, Criticality: 1, Value: bytes.Repeat([]byte{0x33}, 300)}}))) + f.Add(encodePDU(f, 2, 17, 0, encodeBody(f, []Field[uint16]{{ID: 2, Criticality: 1, Value: bytes.Repeat([]byte{0x33}, 300)}}))) f.Add([]byte{0x30, 0x30, 0x30, 0x0a, 0x30, 0x00, 0x01, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00}) f.Add([]byte{0x00, 0x0b, 0x40, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x05}) f.Fuzz(func(t *testing.T, data []byte) { - m, err := Parse(data, nil) + m, err := ParseRawPDU[uint16](testProfile, data) if err != nil { return } - out, err := m.Bytes() + out, err := m.Marshal() if err != nil { t.Fatalf("Bytes: %v", err) } @@ -427,7 +431,7 @@ func FuzzParse(f *testing.F) { } } - out, err = m.Bytes() + out, err = m.Marshal() if err != nil { t.Fatalf("Bytes after same-value replace: %v", err) } @@ -444,12 +448,12 @@ func FuzzParse(f *testing.F) { t.Fatal(err) } - out, err = m.Bytes() + out, err = m.Marshal() if err != nil { t.Fatalf("Bytes after replace: %v", err) } - back, err := Parse(out, nil) + back, err := ParseRawPDU[uint16](testProfile, out) if err != nil { t.Fatalf("re-parse after replace: %v", err) } @@ -463,3 +467,72 @@ func FuzzParse(f *testing.F) { } }) } + +var testProfile = &Profile{Name: "test", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535, OpaqueProcedures: []uint8{39}} + +func TestRawPDUDuplicateIE(t *testing.T) { + fields := []Field[uint16]{ + {ID: 8, Criticality: 0, Value: []byte{0x00, 0x01}}, + {ID: 26, Criticality: 1, Value: []byte{0x01}}, + {ID: 8, Criticality: 0, Value: []byte{0x00, 0x02}}, + } + m := mustParse(t, encodePDU(t, 0, 4, 0, encodeBody(t, fields))) + + var v rawGetter + if _, err := m.Get(8, &v); !errors.Is(err, ErrDuplicateIE) { + t.Errorf("Get: %v", err) + } + + if err := m.Set(8, RawValue{0x00, 0x03}); !errors.Is(err, ErrDuplicateIE) { + t.Errorf("Set: %v", err) + } + + if _, err := m.Index(8); !errors.Is(err, ErrDuplicateIE) { + t.Errorf("Index: %v", err) + } + + var idx []int + + for i, f := range m.All(8) { + idx = append(idx, i) + + if !bytes.Equal(f.Value, fields[i].Value) { + t.Errorf("All yielded %x at %d", f.Value, i) + } + } + + if len(idx) != 2 || idx[0] != 0 || idx[1] != 2 { + t.Fatalf("All(8) indices = %v", idx) + } + + if ok, err := m.Get(26, &v); !ok || err != nil || !bytes.Equal(v, []byte{0x01}) { + t.Fatalf("Get(26) = %v, %v, %x", ok, err, v) + } +} + +func TestRawPDUOpaqueProcedure(t *testing.T) { + body := []byte{0x12, 0x34, 0x56} + b := encodePDU(t, 0, 39, 1, body) + + m := mustParse(t, b) + if !m.Opaque() || m.ProcedureCode() != 39 || m.Len() != 0 || !bytes.Equal(m.Body(), body) { + t.Fatalf("opaque %v pc %d len %d body %x", m.Opaque(), m.ProcedureCode(), m.Len(), m.Body()) + } + + if err := m.Insert(0, Field[uint16]{ID: 1, Value: []byte{0x00}}); !errors.Is(err, ErrNotProtocolIEContainer) { + t.Fatalf("Insert: %v", err) + } + + if !bytes.Equal(mustBytes(t, m), b) { + t.Fatal("opaque PDU not re-emitted verbatim") + } +} + +type rawGetter []byte + +func (g *rawGetter) UnmarshalPER(r *per.Reader, _ per.Encoding) error { + b, err := r.ReadOctets(r.Bits() / 8) + *g = b + + return err +} diff --git a/per/ap/table.go b/per/ap/table.go new file mode 100644 index 0000000000..c2bc640394 --- /dev/null +++ b/per/ap/table.go @@ -0,0 +1,352 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "errors" + "fmt" + "slices" + + "github.com/ellanetworks/core/per" +) + +type IESpec[ID ~uint16, M any] struct { + ID ID + Presence Presence + Criticality Criticality + Condition func(m *M) bool + Decode func(m *M, r *per.Reader, enc per.Encoding) error + Encode func(m *M) (per.Marshaler, bool) +} + +func (s IESpec[ID, M]) Required(m *M) bool { + switch s.Presence { + case PresenceMandatory: + return true + case PresenceConditional: + return s.Condition != nil && s.Condition(m) + default: + return false + } +} + +func lookup[ID ~uint16, M any](table []IESpec[ID, M], id ID) int { + for i := range table { + if table[i].ID == id { + return i + } + } + + return -1 +} + +func EncodeMessage[ID ~uint16, M any](p *Profile, w *per.Writer, enc per.Encoding, table []IESpec[ID, M], m *M, meta *Message[ID]) error { + typed := make([]*FieldValue[ID], len(table)) + + for i, spec := range table { + val, ok := spec.Encode(m) + required := spec.Required(m) + exempt := slices.Contains(meta.exempt, spec.ID) + + if ok && meta.unchangedAbsent(spec.ID, val) { + ok = false + } + + if !ok { + if required && !exempt { + return fmt.Errorf("required IE %s is not set", p.ieName(uint16(spec.ID))) + } + + continue + } + + if spec.Presence == PresenceConditional && !required && !exempt { + return fmt.Errorf("conditional IE %s is set but its condition does not hold", p.ieName(uint16(spec.ID))) + } + + typed[i] = &FieldValue[ID]{ID: spec.ID, Criticality: spec.Criticality, Value: val} + } + + w.WriteBit(meta.ExtensionAdditions.Present()) + + if err := EncodeIEContainer(p, w, enc, orderFields(table, typed, meta.Preserved)); err != nil { + return err + } + + return meta.ExtensionAdditions.MarshalPER(w, enc) +} + +func ExtensionFields[ID ~uint16, M any](table []IESpec[ID, M], m *M, pres Preserved[ID]) []FieldValue[ID] { + typed := make([]*FieldValue[ID], len(table)) + + for i, spec := range table { + if val, ok := spec.Encode(m); ok { + typed[i] = &FieldValue[ID]{ID: spec.ID, Criticality: spec.Criticality, Value: val} + } + } + + return orderFields(table, typed, pres) +} + +func orderFields[ID ~uint16, M any](table []IESpec[ID, M], typed []*FieldValue[ID], pres Preserved[ID]) []FieldValue[ID] { + fields := make([]FieldValue[ID], 0, len(table)) + rest := pres.fields + + nextRaw := func() FieldValue[ID] { + var f Field[ID] + + f, rest = nextPreserved[ID](rest) + + return FieldValue[ID]{ID: f.ID, Criticality: f.Criticality, Value: RawValue(f.Value)} + } + + slots := pres.slots() + onWire := make([]bool, len(table)) + + for _, s := range slots { + if idx := lookup(table, s.id); idx >= 0 && !s.preserved { + onWire[idx] = true + } + } + + next := 0 + + flush := func(upto int) { + for ; next < upto; next++ { + if typed[next] != nil && !onWire[next] { + fields = append(fields, *typed[next]) + } + } + } + + for _, s := range slots { + if s.preserved { + fields = append(fields, nextRaw()) + + continue + } + + idx := lookup(table, s.id) + if idx < 0 { + continue + } + + flush(idx) + + if f := typed[idx]; f != nil { + fields = append(fields, FieldValue[ID]{ID: f.ID, Criticality: s.crit, Value: f.Value}) + } + + next = max(next, idx+1) + } + + flush(len(table)) + + for rest != "" { + fields = append(fields, nextRaw()) + } + + return fields +} + +type outcome uint8 + +const ( + outcomeDecoded outcome = iota + outcomeUnknown + outcomeDuplicate + outcomeNotComprehended +) + +type decodedField struct { + idx int + outcome outcome + wrongOrder bool +} + +func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID]) error { + r := per.NewReader(value) + enc := per.Aligned + + extPresent, err := r.ReadBit() + if err != nil { + return fmt.Errorf("preamble: %w", err) + } + + fields, err := DecodeIEContainer[ID](p, r, enc) + if err != nil { + return err + } + + var additions per.ExtensionAdditions + + if extPresent { + if err := additions.UnmarshalPER(r, enc); err != nil { + return err + } + } + + results, pres, err := decodeTable(p, table, fields, m) + if err != nil { + return err + } + + var d Diagnosis[ID] + + seen := make([]bool, len(table)) + + for i, f := range fields { + d.pos = i + + res := results[i] + + switch res.outcome { + case outcomeUnknown, outcomeNotComprehended: + d.report(f.ID, f.Criticality, KindNotComprehended) + case outcomeDuplicate: + d.report(f.ID, f.Criticality, KindTooManyOccurrences) + case outcomeDecoded: + seen[res.idx] = true + + if res.wrongOrder { + d.report(f.ID, f.Criticality, KindWrongOrder) + } + + if val, ok := table[res.idx].Encode(m); ok { + d.IE(f.ID, f.Criticality, val) + } + } + } + + d.pos = len(fields) + + var ( + exempt []ID + absent []absentIE[ID] + ) + + for i, spec := range table { + required := spec.Required(m) + + if seen[i] { + if spec.Presence == PresenceConditional && !required { + d.report(spec.ID, spec.Criticality, KindErroneouslyPresent) + exempt = append(exempt, spec.ID) + } + + continue + } + + if required { + d.report(spec.ID, spec.Criticality, KindMissing) + exempt = append(exempt, spec.ID) + } + + if val, ok := spec.Encode(m); ok { + absent = append(absent, absentIE[ID]{id: spec.ID, encoded: encodedValue(val)}) + } + } + + meta.exempt = exempt + meta.absent = absent + + meta.Preserved = pres + meta.ExtensionAdditions = additions + meta.diagnostics = d.Diagnostics() + + return nil +} + +func DecodeExtensionContainer[ID ~uint16, M any](p *Profile, r *per.Reader, enc per.Encoding, table []IESpec[ID, M], m *M, pres *Preserved[ID]) error { + fields, err := decodeExtensionFields[ID](p, r, enc, false) + if err != nil { + return err + } + + _, decoded, err := decodeTable(p, table, fields, m) + if err != nil { + return err + } + + *pres = decoded + + return nil +} + +func decodeTable[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], fields []Field[ID], m *M) ([]decodedField, Preserved[ID], error) { + results := make([]decodedField, len(fields)) + occurred := make([]bool, len(table)) + b := newPreservedBuilder[ID]() + last := -1 + + for i, f := range fields { + idx := lookup(table, f.ID) + results[i].idx = idx + + switch { + case idx < 0: + results[i].outcome = outcomeUnknown + + b.keep(f, false) + + continue + case occurred[idx]: + results[i].outcome = outcomeDuplicate + + b.keep(f, true) + + continue + } + + occurred[idx] = true + results[i].wrongOrder = idx < last + last = max(last, idx) + saved := *m + + if err := table[idx].Decode(m, per.NewReader(f.Value), per.Aligned); err != nil { + if !errors.Is(err, ErrNotComprehended) { + return nil, Preserved[ID]{}, fmt.Errorf("IE %s: %w", p.ieName(uint16(f.ID)), err) + } + + *m = saved + results[i].outcome = outcomeNotComprehended + + b.keep(f, false) + + continue + } + + if val, ok := table[idx].Encode(m); ok && !Comprehended[ID](val) { + *m = saved + results[i].outcome = outcomeNotComprehended + + b.keep(f, false) + + continue + } + + b.known(f.ID, f.Criticality, idx, table[idx].Criticality) + } + + return results, b.build(), nil +} + +func encodedValue(v per.Marshaler) string { + b, err := per.Marshal(v, per.Aligned) + if err != nil { + return "\x00error:" + err.Error() + } + + return string(b) +} + +func (m *Message[ID]) unchangedAbsent(id ID, v per.Marshaler) bool { + for _, a := range m.absent { + if a.id == id { + return a.encoded == encodedValue(v) + } + } + + return false +} diff --git a/per/ap/table_test.go b/per/ap/table_test.go new file mode 100644 index 0000000000..7d632b584c --- /dev/null +++ b/per/ap/table_test.go @@ -0,0 +1,461 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "bytes" + "errors" + "slices" + "testing" + + "github.com/ellanetworks/core/per" +) + +type octet uint8 + +const notComprehendedOctet = 0xff + +func (o octet) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeConstrainedWholeNumber(w, enc, 0, 255, int64(o)) +} + +func (o *octet) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 255) + if err != nil { + return err + } + + if v == notComprehendedOctet { + return ErrNotComprehended + } + + *o = octet(v) + + return nil +} + +type item struct { + X octet + Ext *octet + ext Preserved[uint16] +} + +const ( + idA = 1 + idB = 2 + idC = 3 + idItem = 100 +) + +var itemExtIEs = []IESpec[uint16, item]{{ + ID: idItem, Presence: PresenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *item, r *per.Reader, enc per.Encoding) error { + var v octet + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + m.Ext = &v + + return nil + }, + Encode: func(m *item) (per.Marshaler, bool) { + if m.Ext == nil { + return nil, false + } + + return m.Ext, true + }, +}} + +func (it *item) Diagnose(d *Diagnosis[uint16]) bool { + DiagnoseExtensions(d, itemExtIEs, it, it.ext) + + return it.X == unknownOctet +} + +const unknownOctet = 0xfe + +func (it *item) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ExtensionFields(itemExtIEs, it, it.ext) + w.WriteBit(len(ext) > 0) + + if err := it.X.MarshalPER(w, enc); err != nil { + return err + } + + if len(ext) > 0 { + return EncodeExtensionContainer(testProfile, w, enc, ext) + } + + return nil +} + +func (it *item) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + present, err := r.ReadBit() + if err != nil { + return err + } + + if err := it.X.UnmarshalPER(r, enc); err != nil { + return err + } + + if present { + return DecodeExtensionContainer(testProfile, r, enc, itemExtIEs, it, &it.ext) + } + + return nil +} + +type msg struct { + A *octet + B *item + C *octet + meta Message[uint16] +} + +func optional[T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](id uint16, presence Presence, crit Criticality, field func(*msg) **T) IESpec[uint16, msg] { + return IESpec[uint16, msg]{ + ID: id, Presence: presence, Criticality: crit, + Decode: func(m *msg, r *per.Reader, enc per.Encoding) error { + v := PT(new(T)) + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + *field(m) = (*T)(v) + + return nil + }, + Encode: func(m *msg) (per.Marshaler, bool) { + if *field(m) == nil { + return nil, false + } + + return PT(*field(m)), true + }, + } +} + +var msgIEs = func() []IESpec[uint16, msg] { + c := optional[octet](idC, PresenceConditional, CriticalityReject, func(m *msg) **octet { return &m.C }) + c.Condition = func(m *msg) bool { return m.A != nil && *m.A == 1 } + + return []IESpec[uint16, msg]{ + optional[octet](idA, PresenceMandatory, CriticalityReject, func(m *msg) **octet { return &m.A }), + optional[item](idB, PresenceOptional, CriticalityIgnore, func(m *msg) **item { return &m.B }), + c, + } +}() + +func encodeValue(t testing.TB, m per.Marshaler) []byte { + t.Helper() + + b, err := per.Marshal(m, per.Aligned) + if err != nil { + t.Fatal(err) + } + + return b +} + +func itemValue(t testing.TB, ext ...Field[uint16]) []byte { + t.Helper() + + w := per.NewWriter() + w.WriteBit(len(ext) > 0) + + if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 255, 7); err != nil { + t.Fatal(err) + } + + if len(ext) > 0 { + fv := make([]FieldValue[uint16], len(ext)) + for i, f := range ext { + fv[i] = f.Encodable() + } + + if err := EncodeExtensionContainer(testProfile, w, per.Aligned, fv); err != nil { + t.Fatal(err) + } + } + + w.AlignToByte() + + return w.Bytes() +} + +func messageValue(t testing.TB, fields ...Field[uint16]) []byte { + t.Helper() + + w := per.NewWriter() + w.WriteBit(false) + + fv := make([]FieldValue[uint16], len(fields)) + for i, f := range fields { + fv[i] = f.Encodable() + } + + if err := EncodeIEContainer(testProfile, w, per.Aligned, fv); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + return w.Bytes() +} + +func decodeMsg(b []byte) (*msg, error) { + m := new(msg) + if err := DecodeMessage(testProfile, msgIEs, b, m, &m.meta); err != nil { + return nil, err + } + + return m, nil +} + +func encodeMsg(t testing.TB, m *msg) []byte { + t.Helper() + + w := per.NewWriter() + if err := EncodeMessage(testProfile, w, per.Aligned, msgIEs, m, &m.meta); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + return w.Bytes() +} + +type wantCheck struct { + falsely bool + ies []uint16 +} + +func TestDecodeIsTotalForAbstractSyntaxErrors(t *testing.T) { + one := Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: encodeValue(t, octet(1))} + two := Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: encodeValue(t, octet(2))} + b := Field[uint16]{ID: idB, Criticality: CriticalityIgnore, Value: itemValue(t)} + c := Field[uint16]{ID: idC, Criticality: CriticalityReject, Value: encodeValue(t, octet(9))} + unknownIgnore := Field[uint16]{ID: 500, Criticality: CriticalityIgnore, Value: []byte{0xab}} + unknownReject := Field[uint16]{ID: 501, Criticality: CriticalityReject, Value: []byte{0xcd}} + nestedReject := Field[uint16]{ID: idB, Criticality: CriticalityIgnore, Value: itemValue(t, Field[uint16]{ID: 502, Criticality: CriticalityReject, Value: []byte{0x01}})} + valueReject := Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: encodeValue(t, octet(notComprehendedOctet))} + unknownItem := Field[uint16]{ID: idB, Criticality: CriticalityReject, Value: encodeValue(t, &item{X: unknownOctet})} + + cases := []struct { + name string + fields []Field[uint16] + kinds []Kind + check *wantCheck + }{ + {"well formed", []Field[uint16]{one, b, c}, nil, nil}, + {"unknown ignore IE", []Field[uint16]{one, unknownIgnore, c}, []Kind{KindNotComprehended}, nil}, + {"unknown reject IE", []Field[uint16]{one, unknownReject, c}, []Kind{KindNotComprehended}, &wantCheck{ies: []uint16{501}}}, + {"unknown reject extension nested in an item", []Field[uint16]{two, nestedReject}, []Kind{KindNotComprehended}, &wantCheck{ies: []uint16{502}}}, + {"value not comprehended", []Field[uint16]{valueReject}, []Kind{KindNotComprehended, KindMissing}, &wantCheck{ies: []uint16{idA}}}, + {"value decoded but not comprehended", []Field[uint16]{two, unknownItem}, []Kind{KindNotComprehended}, &wantCheck{ies: []uint16{idB}}}, + {"missing mandatory IE", []Field[uint16]{b}, []Kind{KindMissing}, &wantCheck{ies: []uint16{idA}}}, + {"duplicate IE", []Field[uint16]{two, two}, []Kind{KindTooManyOccurrences}, &wantCheck{falsely: true}}, + {"wrong order", []Field[uint16]{b, two}, []Kind{KindWrongOrder}, &wantCheck{falsely: true}}, + {"erroneously present conditional IE", []Field[uint16]{two, c}, []Kind{KindErroneouslyPresent}, &wantCheck{falsely: true}}, + {"reject before wrong order", []Field[uint16]{unknownReject, b, two, unknownReject}, []Kind{KindNotComprehended, KindWrongOrder, KindNotComprehended}, &wantCheck{falsely: true, ies: []uint16{501}}}, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + value := messageValue(t, tc.fields...) + + m, err := decodeMsg(value) + if err != nil { + t.Fatalf("decode: %v", err) + } + + d := m.meta.Diagnostics() + + kinds := make([]Kind, len(d.IEs)) + for i, e := range d.IEs { + kinds[i] = e.Kind + } + + if !slices.Equal(kinds, tc.kinds) { + t.Errorf("kinds = %v, want %v", kinds, tc.kinds) + } + + if got := encodeMsg(t, m); !bytes.Equal(got, value) { + t.Fatalf("re-encoded\n got %x\n want %x", got, value) + } + + err = d.Check() + if tc.check == nil { + if err != nil { + t.Fatalf("Check() = %v, want nil", err) + } + + return + } + + var ase *AbstractSyntaxError[uint16] + if !errors.As(err, &ase) { + t.Fatalf("Check() = %v, want *AbstractSyntaxError", err) + } + + ids := make([]uint16, len(ase.IEs)) + for i, e := range ase.IEs { + ids[i] = e.ID + } + + if ase.FalselyConstructed != tc.check.falsely || !slices.Equal(ids, tc.check.ies) { + t.Fatalf("Check() = falsely %v ids %v, want falsely %v ids %v", ase.FalselyConstructed, ids, tc.check.falsely, tc.check.ies) + } + }) + } +} + +func TestNestedDiagnosticCarriesPath(t *testing.T) { + value := messageValue(t, + Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: encodeValue(t, octet(2))}, + Field[uint16]{ID: idB, Criticality: CriticalityIgnore, Value: itemValue(t, Field[uint16]{ID: 502, Criticality: CriticalityNotify, Value: []byte{0x01}})}, + ) + + m, err := decodeMsg(value) + if err != nil { + t.Fatal(err) + } + + d := m.meta.Diagnostics() + if len(d.IEs) != 1 || !slices.Equal(d.IEs[0].Path, []uint16{idB}) || d.IEs[0].ID != 502 { + t.Fatalf("diagnostics = %+v", d.IEs) + } + + if !d.ReportRequired() || d.Check() != nil { + t.Fatalf("ReportRequired = %v, Check = %v", d.ReportRequired(), d.Check()) + } + + if got := m.B.ext.UnknownIEs(); len(got) != 1 || got[0].ID != 502 { + t.Fatalf("item preserved %+v", got) + } +} + +func TestExtensionContainerDecodeIsLenient(t *testing.T) { + for _, c := range []struct { + crit Criticality + reject bool + }{{CriticalityReject, true}, {CriticalityIgnore, false}} { + var it item + + b := itemValue(t, Field[uint16]{ID: 502, Criticality: c.crit, Value: []byte{0x01}}) + if err := it.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + t.Fatalf("%v: decode is lenient, got %v", c.crit, err) + } + + if got := encodeValue(t, &it); !bytes.Equal(got, b) { + t.Fatalf("%v: re-encoded %x, want %x", c.crit, got, b) + } + + d := Diagnose[uint16](&it) + if len(d.IEs) != 1 || d.IEs[0].ID != 502 || d.IEs[0].Criticality != c.crit || len(d.IEs[0].Path) != 0 { + t.Fatalf("%v: diagnostics = %+v", c.crit, d.IEs) + } + + if (d.Check() != nil) != c.reject { + t.Fatalf("%v: Check() = %v", c.crit, d.Check()) + } + } +} + +func TestExtensionContainerDiagnosesOrderAndDuplicates(t *testing.T) { + ext := Field[uint16]{ID: idItem, Criticality: CriticalityIgnore, Value: encodeValue(t, octet(3))} + + var it item + + b := itemValue(t, ext, ext) + if err := it.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + t.Fatal(err) + } + + if got := encodeValue(t, &it); !bytes.Equal(got, b) { + t.Fatalf("re-encoded %x, want %x", got, b) + } + + d := Diagnose[uint16](&it) + if len(d.IEs) != 1 || d.IEs[0].Kind != KindTooManyOccurrences { + t.Fatalf("diagnostics = %+v, want one duplicate", d.IEs) + } + + var ase *AbstractSyntaxError[uint16] + if !errors.As(d.Check(), &ase) || !ase.FalselyConstructed { + t.Fatalf("Check() = %v, want a falsely constructed message", d.Check()) + } +} + +func TestDiagnoseReportsRootNotComprehended(t *testing.T) { + it := item{X: unknownOctet} + + d := Diagnose[uint16](&it) + if !d.RootNotComprehended || d.Empty() || d.Check() == nil { + t.Fatalf("diagnostics = %+v, Check = %v", d, d.Check()) + } +} + +func TestPreservedIsComparable(t *testing.T) { + var a, b Preserved[uint16] + + a.Append(Field[uint16]{ID: 1, Criticality: CriticalityIgnore, Value: []byte{0x01}}) + b.Append(Field[uint16]{ID: 1, Criticality: CriticalityIgnore, Value: []byte{0x01}}) + + if a != b { + t.Fatal("equal preserved state compared unequal") + } + + set := map[item]bool{{X: 1}: true} + if !set[item{X: 1}] { + t.Fatal("item not usable as a map key") + } +} + +func FuzzDecodeMessage(f *testing.F) { + f.Add(messageValue(f, Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: []byte{0x01}})) + f.Add(messageValue(f, + Field[uint16]{ID: idB, Criticality: CriticalityIgnore, Value: itemValue(f, Field[uint16]{ID: 502, Criticality: CriticalityReject, Value: []byte{0x01}})}, + Field[uint16]{ID: idA, Criticality: CriticalityNotify, Value: []byte{0x02}}, + Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: []byte{0xff}}, + Field[uint16]{ID: 9, Criticality: CriticalityIgnore, Value: []byte{0x00}}, + )) + + f.Fuzz(func(t *testing.T, data []byte) { + m, err := decodeMsg(data) + if err != nil { + return + } + + w := per.NewWriter() + if err := EncodeMessage(testProfile, w, per.Aligned, msgIEs, m, &m.meta); err != nil { + t.Fatalf("encode: %v", err) + } + + w.AlignToByte() + + again, err := decodeMsg(w.Bytes()) + if err != nil { + t.Fatalf("re-decode: %v", err) + } + + w2 := per.NewWriter() + if err := EncodeMessage(testProfile, w2, per.Aligned, msgIEs, again, &again.meta); err != nil { + t.Fatalf("re-encode: %v", err) + } + + w2.AlignToByte() + + if !bytes.Equal(w.Bytes(), w2.Bytes()) { + t.Fatalf("not a fixed point:\n%x\n%x", w.Bytes(), w2.Bytes()) + } + }) +} diff --git a/per/ap/transport_layer_address.go b/per/ap/transport_layer_address.go new file mode 100644 index 0000000000..1c3767f068 --- /dev/null +++ b/per/ap/transport_layer_address.go @@ -0,0 +1,154 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "encoding/hex" + "errors" + "net/netip" + "strconv" + + "github.com/ellanetworks/core/per" +) + +const ( + tnlIPv4Bits = 32 + tnlIPv6Bits = 128 + tnlDualBits = tnlIPv4Bits + tnlIPv6Bits +) + +var ErrTransportLayerAddress = errors.New("ap: invalid transport layer address") + +type TransportLayerAddress struct { + octets string + bits int +} + +func TransportLayerAddressFrom(addr netip.Addr) (TransportLayerAddress, error) { + addr = addr.Unmap() + + switch { + case addr.Is4(): + a := addr.As4() + + return TransportLayerAddress{octets: string(a[:]), bits: tnlIPv4Bits}, nil + case addr.Is6(): + a := addr.As16() + + return TransportLayerAddress{octets: string(a[:]), bits: tnlIPv6Bits}, nil + default: + return TransportLayerAddress{}, ErrTransportLayerAddress + } +} + +func TransportLayerAddressFromAddrs(ipv4, ipv6 netip.Addr) (TransportLayerAddress, error) { + ipv4 = ipv4.Unmap() + + if ipv4.IsValid() && !ipv4.Is4() { + return TransportLayerAddress{}, ErrTransportLayerAddress + } + + if ipv6.IsValid() && (!ipv6.Is6() || ipv6.Is4In6()) { + return TransportLayerAddress{}, ErrTransportLayerAddress + } + + switch { + case ipv4.IsValid() && ipv6.IsValid(): + a4, a6 := ipv4.As4(), ipv6.As16() + + return TransportLayerAddress{octets: string(a4[:]) + string(a6[:]), bits: tnlDualBits}, nil + case ipv4.IsValid(): + return TransportLayerAddressFrom(ipv4) + case ipv6.IsValid(): + return TransportLayerAddressFrom(ipv6) + default: + return TransportLayerAddress{}, ErrTransportLayerAddress + } +} + +func TransportLayerAddressFromOctets(b []byte) TransportLayerAddress { + return newTransportLayerAddress(b, len(b)*8) +} + +func TransportLayerAddressFromBits(b []byte, nbits int) (TransportLayerAddress, bool) { + if nbits < 0 || nbits > len(b)*8 { + return TransportLayerAddress{}, false + } + + return newTransportLayerAddress(b, nbits), true +} + +func newTransportLayerAddress(b []byte, nbits int) TransportLayerAddress { + n := (nbits + 7) / 8 + octets := make([]byte, n) + copy(octets, b[:n]) + + if rem := nbits % 8; rem != 0 { + octets[n-1] &= byte(0xff << (8 - rem)) + } + + return TransportLayerAddress{octets: string(octets), bits: nbits} +} + +func (a TransportLayerAddress) Bits() int { return a.bits } + +func (a TransportLayerAddress) Bytes() []byte { return []byte(a.octets) } + +func (a TransportLayerAddress) IsZero() bool { return a.bits == 0 } + +func (a TransportLayerAddress) Valid() bool { + switch a.bits { + case tnlIPv4Bits, tnlIPv6Bits, tnlDualBits: + return true + default: + return false + } +} + +func (a TransportLayerAddress) IPv4() netip.Addr { + if a.bits != tnlIPv4Bits && a.bits != tnlDualBits { + return netip.Addr{} + } + + return netip.AddrFrom4([4]byte([]byte(a.octets[:4]))) +} + +func (a TransportLayerAddress) IPv6() netip.Addr { + switch a.bits { + case tnlIPv6Bits: + return netip.AddrFrom16([16]byte([]byte(a.octets))) + case tnlDualBits: + return netip.AddrFrom16([16]byte([]byte(a.octets[4:]))) + default: + return netip.Addr{} + } +} + +func (a TransportLayerAddress) String() string { + switch a.bits { + case tnlIPv4Bits: + return a.IPv4().String() + case tnlIPv6Bits: + return a.IPv6().String() + case tnlDualBits: + return a.IPv4().String() + "," + a.IPv6().String() + default: + return hex.EncodeToString([]byte(a.octets)) + "/" + strconv.Itoa(a.bits) + } +} + +func (a TransportLayerAddress) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeBitString(w, enc, 1, tnlDualBits, true, true, true, []byte(a.octets), a.bits) +} + +func (a *TransportLayerAddress) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, nbits, err := per.DecodeBitString(r, enc, 1, tnlDualBits, true, true, true) + if err != nil { + return err + } + + *a = newTransportLayerAddress(b, nbits) + + return nil +} diff --git a/per/ap/transport_layer_address_test.go b/per/ap/transport_layer_address_test.go new file mode 100644 index 0000000000..28b6f2ac18 --- /dev/null +++ b/per/ap/transport_layer_address_test.go @@ -0,0 +1,298 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "bytes" + "errors" + "math/rand/v2" + "net/netip" + "testing" + + "github.com/ellanetworks/core/per" +) + +func encodeTLAThenBit(t *testing.T, enc per.Encoding, a TransportLayerAddress) []byte { + t.Helper() + + w := per.NewWriter() + + if err := a.MarshalPER(w, enc); err != nil { + t.Fatal(err) + } + + w.WriteBit(true) + + return w.Bytes() +} + +func decodeTLAThenBit(t *testing.T, enc per.Encoding, b []byte) TransportLayerAddress { + t.Helper() + + r := per.NewReader(b) + + var a TransportLayerAddress + if err := a.UnmarshalPER(r, enc); err != nil { + t.Fatal(err) + } + + bit, err := r.ReadBit() + if err != nil || !bit { + t.Fatalf("trailing bit = %v, %v: the address consumed the wrong number of bits", bit, err) + } + + return a +} + +func TestTransportLayerAddressRoundTripsEveryLength(t *testing.T) { + rng := rand.New(rand.NewPCG(1, 2)) + + for nbits := 1; nbits <= 200; nbits++ { + for range 8 { + b := make([]byte, (nbits+7)/8) + for i := range b { + b[i] = byte(rng.Uint32()) + } + + a, ok := TransportLayerAddressFromBits(b, nbits) + if !ok { + t.Fatalf("%d bits: rejected", nbits) + } + + if a.Bits() != nbits { + t.Fatalf("Bits() = %d, want %d", a.Bits(), nbits) + } + + for _, enc := range []per.Encoding{per.Aligned, per.Unaligned} { + w := per.NewWriter() + if err := per.EncodeBitString(w, enc, 1, 160, true, true, true, b, nbits); err != nil { + t.Fatal(err) + } + + w.WriteBit(true) + want := w.Bytes() + + got := encodeTLAThenBit(t, enc, a) + if !bytes.Equal(got, want) { + t.Fatalf("%d bits %v: encoded %x, want %x", nbits, enc, got, want) + } + + back := decodeTLAThenBit(t, enc, want) + if back != a { + t.Fatalf("%d bits %v: decoded %v, want %v", nbits, enc, back, a) + } + + if again := encodeTLAThenBit(t, enc, back); !bytes.Equal(again, want) { + t.Fatalf("%d bits %v: re-encoded %x, want %x", nbits, enc, again, want) + } + } + } + } +} + +func TestTransportLayerAddressIgnoresBitsPastTheLength(t *testing.T) { + a, _ := TransportLayerAddressFromBits([]byte{0xff, 0xff}, 9) + b, _ := TransportLayerAddressFromBits([]byte{0xff, 0x80}, 9) + + if a != b { + t.Fatalf("%v != %v", a, b) + } + + if !bytes.Equal(a.Bytes(), []byte{0xff, 0x80}) { + t.Fatalf("Bytes() = %x", a.Bytes()) + } +} + +func TestTransportLayerAddressFromOctets(t *testing.T) { + b := []byte{10, 0, 0, 1, 7} + + a := TransportLayerAddressFromOctets(b) + b[0] = 11 + + if a.Bits() != 40 || !bytes.Equal(a.Bytes(), []byte{10, 0, 0, 1, 7}) { + t.Fatalf("got %d bits %x", a.Bits(), a.Bytes()) + } + + if v4, _ := TransportLayerAddressFrom(netip.MustParseAddr("10.0.0.1")); TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}) != v4 { + t.Fatal("4 octets are not the IPv4 address") + } +} + +func TestTransportLayerAddressFromBitsRejectsShortBuffers(t *testing.T) { + for _, tc := range []struct { + b []byte + nbits int + }{{nil, 1}, {[]byte{1}, 9}, {[]byte{1}, -1}} { + if _, ok := TransportLayerAddressFromBits(tc.b, tc.nbits); ok { + t.Errorf("TransportLayerAddressFromBits(%x, %d) accepted", tc.b, tc.nbits) + } + } +} + +func TestTransportLayerAddressConstructors(t *testing.T) { + v4 := netip.MustParseAddr("10.0.0.1") + v6 := netip.MustParseAddr("2001:db8::1") + mapped := netip.MustParseAddr("::ffff:10.0.0.1") + + tests := []struct { + name string + build func() (TransportLayerAddress, error) + bits int + ipv4, ipv6 netip.Addr + octets []byte + }{ + {"ipv4", func() (TransportLayerAddress, error) { return TransportLayerAddressFrom(v4) }, 32, v4, netip.Addr{}, []byte{10, 0, 0, 1}}, + {"ipv4 mapped in ipv6 is unmapped", func() (TransportLayerAddress, error) { return TransportLayerAddressFrom(mapped) }, 32, v4, netip.Addr{}, []byte{10, 0, 0, 1}}, + {"ipv4 from a 16-octet slice", func() (TransportLayerAddress, error) { + return TransportLayerAddressFrom(netip.AddrFrom16(mapped.As16())) + }, 32, v4, netip.Addr{}, []byte{10, 0, 0, 1}}, + {"ipv6", func() (TransportLayerAddress, error) { return TransportLayerAddressFrom(v6) }, 128, netip.Addr{}, v6, v6.AsSlice()}, + {"pair ipv4 only", func() (TransportLayerAddress, error) { return TransportLayerAddressFromAddrs(v4, netip.Addr{}) }, 32, v4, netip.Addr{}, []byte{10, 0, 0, 1}}, + {"pair mapped ipv4 only", func() (TransportLayerAddress, error) { return TransportLayerAddressFromAddrs(mapped, netip.Addr{}) }, 32, v4, netip.Addr{}, []byte{10, 0, 0, 1}}, + {"pair ipv6 only", func() (TransportLayerAddress, error) { return TransportLayerAddressFromAddrs(netip.Addr{}, v6) }, 128, netip.Addr{}, v6, v6.AsSlice()}, + {"dual puts ipv4 first", func() (TransportLayerAddress, error) { return TransportLayerAddressFromAddrs(v4, v6) }, 160, v4, v6, append([]byte{10, 0, 0, 1}, v6.AsSlice()...)}, + {"dual unmaps ipv4", func() (TransportLayerAddress, error) { return TransportLayerAddressFromAddrs(mapped, v6) }, 160, v4, v6, append([]byte{10, 0, 0, 1}, v6.AsSlice()...)}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + a, err := tt.build() + if err != nil { + t.Fatal(err) + } + + if a.Bits() != tt.bits || a.IPv4() != tt.ipv4 || a.IPv6() != tt.ipv6 || !bytes.Equal(a.Bytes(), tt.octets) || !a.Valid() { + t.Fatalf("got bits %d ipv4 %v ipv6 %v octets %x valid %v", a.Bits(), a.IPv4(), a.IPv6(), a.Bytes(), a.Valid()) + } + + b, ok := TransportLayerAddressFromBits(tt.octets, tt.bits) + if !ok || a != b { + t.Fatalf("constructor %v != bit form %v", a, b) + } + }) + } +} + +func TestTransportLayerAddressConstructorsRejectMisplacedFamilies(t *testing.T) { + v4 := netip.MustParseAddr("10.0.0.1") + v6 := netip.MustParseAddr("2001:db8::1") + mapped := netip.MustParseAddr("::ffff:10.0.0.1") + + for _, tc := range []struct { + name string + ipv4, ipv6 netip.Addr + }{ + {"neither", netip.Addr{}, netip.Addr{}}, + {"ipv6 in the ipv4 slot", v6, netip.Addr{}}, + {"ipv4 in the ipv6 slot", netip.Addr{}, v4}, + {"mapped ipv4 in the ipv6 slot", v4, mapped}, + } { + if a, err := TransportLayerAddressFromAddrs(tc.ipv4, tc.ipv6); !errors.Is(err, ErrTransportLayerAddress) { + t.Errorf("%s: got %v, %v", tc.name, a, err) + } + } + + if a, err := TransportLayerAddressFrom(netip.Addr{}); !errors.Is(err, ErrTransportLayerAddress) { + t.Errorf("zero Addr: got %v, %v", a, err) + } +} + +func TestTransportLayerAddressValid(t *testing.T) { + for nbits := 0; nbits <= 200; nbits++ { + a, _ := TransportLayerAddressFromBits(make([]byte, 25), nbits) + + want := nbits == 32 || nbits == 128 || nbits == 160 + if a.Valid() != want { + t.Errorf("%d bits: Valid() = %v, want %v", nbits, a.Valid(), want) + } + + if a.IPv4().IsValid() != (nbits == 32 || nbits == 160) { + t.Errorf("%d bits: IPv4() = %v", nbits, a.IPv4()) + } + + if a.IPv6().IsValid() != (nbits == 128 || nbits == 160) { + t.Errorf("%d bits: IPv6() = %v", nbits, a.IPv6()) + } + } +} + +func TestTransportLayerAddressAccessorsKeepWireFamily(t *testing.T) { + mapped := netip.MustParseAddr("::ffff:10.0.0.1") + + a, _ := TransportLayerAddressFromBits(mapped.AsSlice(), 128) + if a.IPv4().IsValid() || a.IPv6() != mapped { + t.Fatalf("a 128-bit address is an IPv6 address: IPv4() = %v, IPv6() = %v", a.IPv4(), a.IPv6()) + } +} + +func TestTransportLayerAddressKeepsOddLengths(t *testing.T) { + for _, enc := range []per.Encoding{per.Aligned, per.Unaligned} { + w := per.NewWriter() + if err := per.EncodeBitString(w, enc, 1, 160, true, true, true, []byte{10, 0, 0, 1, 0x80}, 33); err != nil { + t.Fatal(err) + } + + w.WriteBit(true) + wire := w.Bytes() + + a := decodeTLAThenBit(t, enc, wire) + if a.Bits() != 33 { + t.Fatalf("%v: 33-bit address decoded as %d bits", enc, a.Bits()) + } + + if got := encodeTLAThenBit(t, enc, a); !bytes.Equal(got, wire) { + t.Fatalf("%v: 33-bit address re-encoded as %x, want %x", enc, got, wire) + } + + if a.Valid() || a.IPv4().IsValid() { + t.Fatalf("%v: 33 bits is not a TS 38.414 address", enc) + } + + w = per.NewWriter() + if err := per.EncodeBitString(w, enc, 1, 160, true, true, true, []byte{10, 0, 0, 0}, 31); err != nil { + t.Fatal(err) + } + + w.WriteBit(true) + + short := decodeTLAThenBit(t, enc, w.Bytes()) + if short.Bits() != 31 || short.Valid() || short.IPv4().IsValid() { + t.Fatalf("%v: 31-bit address read as IPv4 %v", enc, short.IPv4()) + } + } +} + +func TestTransportLayerAddressKeepsExtensionLengths(t *testing.T) { + b := bytes.Repeat([]byte{0xa5}, 32) + + for _, nbits := range []int{0, 161, 200, 255} { + for _, enc := range []per.Encoding{per.Aligned, per.Unaligned} { + a, _ := TransportLayerAddressFromBits(b, nbits) + + got := encodeTLAThenBit(t, enc, a) + if back := decodeTLAThenBit(t, enc, got); back != a { + t.Fatalf("%d bits %v: decoded %v, want %v", nbits, enc, back, a) + } + + if got[0]&0x80 == 0 { + t.Fatalf("%d bits %v: the extension bit is not set", nbits, enc) + } + } + } +} + +func TestTransportLayerAddressString(t *testing.T) { + v4, _ := TransportLayerAddressFrom(netip.MustParseAddr("10.0.0.1")) + dual, _ := TransportLayerAddressFromAddrs(netip.MustParseAddr("10.0.0.1"), netip.MustParseAddr("2001:db8::1")) + odd, _ := TransportLayerAddressFromBits([]byte{0xab, 0xc0}, 10) + + for _, tc := range []struct { + a TransportLayerAddress + want string + }{{v4, "10.0.0.1"}, {dual, "10.0.0.1,2001:db8::1"}, {odd, "abc0/10"}, {TransportLayerAddress{}, "/0"}} { + if got := tc.a.String(); got != tc.want { + t.Errorf("String() = %q, want %q", got, tc.want) + } + } +} diff --git a/per/asn1spec/ast.go b/per/asn1spec/ast.go new file mode 100644 index 0000000000..a89e825c11 --- /dev/null +++ b/per/asn1spec/ast.go @@ -0,0 +1,429 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package asn1spec + +import ( + "fmt" + "strconv" + "strings" +) + +type Kind int + +const ( + Reference Kind = iota + Integer + Enumerated + BitString + OctetString + Boolean + Null + ObjectIdentifier + CharacterString + Sequence + SequenceOf + Choice + ObjectClassField +) + +var kindNames = [...]string{ + Reference: "reference", + Integer: "INTEGER", + Enumerated: "ENUMERATED", + BitString: "BIT STRING", + OctetString: "OCTET STRING", + Boolean: "BOOLEAN", + Null: "NULL", + ObjectIdentifier: "OBJECT IDENTIFIER", + CharacterString: "character string", + Sequence: "SEQUENCE", + SequenceOf: "SEQUENCE OF", + Choice: "CHOICE", + ObjectClassField: "class field", +} + +func (k Kind) String() string { + if k >= 0 && int(k) < len(kindNames) { + return kindNames[k] + } + + return "Kind(" + strconv.Itoa(int(k)) + ")" +} + +type Value struct { + Ref string + Number string +} + +func (v Value) Int64() (int64, error) { + if v.Ref != "" { + return 0, fmt.Errorf("asn1spec: %s is a reference", v.Ref) + } + + return strconv.ParseInt(v.Number, 10, 64) +} + +func (v Value) IsRef() bool { return v.Ref != "" } + +func (v Value) String() string { + if v.Ref != "" { + return v.Ref + } + + return v.Number +} + +type Range struct { + Lower Value + Upper Value +} + +func (r Range) String() string { + if r.Lower == r.Upper { + return r.Lower.String() + } + + return r.Lower.String() + ".." + r.Upper.String() +} + +type Constraint struct { + Root []Range + Extensible bool + Ext []Range +} + +func (c *Constraint) String() string { + if c == nil { + return "" + } + + parts := make([]string, 0, len(c.Root)) + for _, r := range c.Root { + parts = append(parts, r.String()) + } + + s := strings.Join(parts, "|") + if c.Extensible { + s += ", ..." + } + + for _, r := range c.Ext { + s += ", " + r.String() + } + + return s +} + +type TableConstraint struct { + Set string + At string +} + +type Actual struct { + Value *Value + Set *ObjectSet + Type *Type +} + +type Component struct { + Name string + Type *Type + Optional bool + Default *Value + Extension bool + Group int + Pos Position +} + +type EnumItem struct { + Name string + Number int64 + HasNumber bool + Extension bool +} + +type NamedNumber struct { + Name string + Value Value +} + +type Type struct { + Kind Kind + Name string + Field string + Args []*Actual + Components []*Component + Extensible bool + Elem *Type + Enum []*EnumItem + NamedNumbers []NamedNumber + Range *Constraint + Size *Constraint + Containing *Type + Table *TableConstraint + Pos Position +} + +func (t *Type) Component(name string) *Component { + for _, c := range t.Components { + if c.Name == name { + return c + } + } + + return nil +} + +func (t *Type) String() string { + if t == nil { + return "" + } + + var b strings.Builder + + switch t.Kind { + case Reference: + b.WriteString(t.Name) + + if len(t.Args) > 0 { + args := make([]string, 0, len(t.Args)) + for _, a := range t.Args { + args = append(args, a.String()) + } + + b.WriteString(" {" + strings.Join(args, ", ") + "}") + } + case CharacterString: + b.WriteString(t.Name) + case ObjectClassField: + b.WriteString(t.Name + "." + t.Field) + case SequenceOf: + b.WriteString("SEQUENCE") + + if t.Size != nil { + b.WriteString(" (SIZE(" + t.Size.String() + "))") + } + + b.WriteString(" OF " + t.Elem.String()) + + return b.String() + default: + b.WriteString(t.Kind.String()) + } + + if t.Containing != nil { + b.WriteString(" (CONTAINING " + t.Containing.String() + ")") + } + + if t.Range != nil { + b.WriteString(" (" + t.Range.String() + ")") + } + + if t.Size != nil { + b.WriteString(" (SIZE(" + t.Size.String() + "))") + } + + return b.String() +} + +func (a *Actual) String() string { + switch { + case a.Value != nil: + return a.Value.String() + case a.Type != nil: + return a.Type.String() + case a.Set != nil: + return "{" + a.Set.String() + "}" + } + + return "" +} + +type Param struct { + Governor string + Name string +} + +type TypeAssignment struct { + Name string + Params []Param + Type *Type + Pos Position +} + +type ValueAssignment struct { + Name string + Type *Type + Value Value + Pos Position +} + +type ClassField struct { + Name string + Type *Type + Unique bool + Optional bool + Default *Setting +} + +func (f *ClassField) IsTypeField() bool { + return len(f.Name) > 1 && f.Name[1] >= 'A' && f.Name[1] <= 'Z' +} + +type SyntaxItem struct { + Keywords []string + Field string + Optional bool +} + +type ClassAssignment struct { + Name string + Fields []*ClassField + Syntax []SyntaxItem + Pos Position +} + +func (c *ClassAssignment) Field(name string) *ClassField { + for _, f := range c.Fields { + if f.Name == name { + return f + } + } + + return nil +} + +type Setting struct { + Type *Type + Value *Value +} + +type Object struct { + Class string + Settings map[string]Setting + Pos Position + body []token +} + +func (o *Object) Value(field string) (Value, bool) { + s, ok := o.Settings[field] + if !ok || s.Value == nil { + return Value{}, false + } + + return *s.Value, true +} + +func (o *Object) Type(field string) *Type { + return o.Settings[field].Type +} + +type SetElement struct { + Ref string + Object *Object +} + +type ObjectSet struct { + Root []*SetElement + Extensible bool + Ext []*SetElement +} + +func (s *ObjectSet) String() string { + elems := make([]string, 0, len(s.Root)+len(s.Ext)+1) + for _, e := range s.Root { + elems = append(elems, e.String()) + } + + if s.Extensible { + elems = append(elems, "...") + } + + for _, e := range s.Ext { + elems = append(elems, e.String()) + } + + return strings.Join(elems, ", ") +} + +func (e *SetElement) String() string { + if e.Object != nil { + return fmt.Sprintf("{object %s}", e.Object.Pos) + } + + return e.Ref +} + +type ObjectAssignment struct { + Name string + Class string + Object *Object + Pos Position +} + +type ObjectSetAssignment struct { + Name string + Class string + Set *ObjectSet + Pos Position +} + +type OIDComponent struct { + Name string + Number int64 + HasNumber bool +} + +type Import struct { + Symbols []string + From string +} + +type Module struct { + Name string + OID []OIDComponent + TagDefault string + Imports []Import + Types []*TypeAssignment + Values []*ValueAssignment + Classes []*ClassAssignment + Objects []*ObjectAssignment + ObjectSets []*ObjectSetAssignment + Filename string + names map[string]any +} + +func (m *Module) lookup(name string) any { + return m.names[name] +} + +func (m *Module) Type(name string) *TypeAssignment { + t, _ := m.lookup(name).(*TypeAssignment) + return t +} + +func (m *Module) Value(name string) *ValueAssignment { + v, _ := m.lookup(name).(*ValueAssignment) + return v +} + +func (m *Module) Class(name string) *ClassAssignment { + c, _ := m.lookup(name).(*ClassAssignment) + return c +} + +func (m *Module) Object(name string) *ObjectAssignment { + o, _ := m.lookup(name).(*ObjectAssignment) + return o +} + +func (m *Module) ObjectSet(name string) *ObjectSetAssignment { + s, _ := m.lookup(name).(*ObjectSetAssignment) + return s +} + +func (m *Module) Defines(name string) bool { + _, ok := m.names[name] + return ok +} diff --git a/per/asn1spec/parser.go b/per/asn1spec/parser.go new file mode 100644 index 0000000000..707619549b --- /dev/null +++ b/per/asn1spec/parser.go @@ -0,0 +1,979 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package asn1spec + +import ( + "fmt" + "strconv" +) + +type parser struct { + toks []token + i int + tok token +} + +type bailout struct { + err error +} + +func newParser(toks []token) *parser { + return &parser{toks: toks, tok: toks[0]} +} + +func (p *parser) next() { + if p.i < len(p.toks)-1 { + p.i++ + } + + p.tok = p.toks[p.i] +} + +func (p *parser) peek() token { + if p.i+1 >= len(p.toks) { + return p.toks[len(p.toks)-1] + } + + return p.toks[p.i+1] +} + +func (p *parser) errorf(format string, args ...any) { + panic(bailout{&Error{Pos: p.tok.pos, Msg: fmt.Sprintf(format, args...)}}) +} + +func (p *parser) expect(k tokenKind) token { + t := p.tok + if t.kind != k { + p.errorf("expected %q, found %s", k.String(), t) + } + + p.next() + + return t +} + +func (p *parser) got(k tokenKind) bool { + if p.tok.kind != k { + return false + } + + p.next() + + return true +} + +func (p *parser) is(word string) bool { + return p.tok.kind == tokIdent && p.tok.lit == word +} + +func (p *parser) gotWord(word string) bool { + if !p.is(word) { + return false + } + + p.next() + + return true +} + +func (p *parser) expectWord(word string) { + if !p.is(word) { + p.errorf("expected %q, found %s", word, p.tok) + } + + p.next() +} + +func isUpper(name string) bool { + return name != "" && name[0] >= 'A' && name[0] <= 'Z' +} + +func catch(err *error) { + if r := recover(); r != nil { + b, ok := r.(bailout) + if !ok { + panic(r) + } + + *err = b.err + } +} + +func Parse(filename string, src []byte) (m *Module, err error) { + toks, err := scan(filename, src) + if err != nil { + return nil, err + } + + defer catch(&err) + + p := newParser(toks) + m = &Module{Filename: filename, names: map[string]any{}} + p.parseModule(m) + + if p.tok.kind != tokEOF { + p.errorf("unexpected %s after END", p.tok) + } + + for _, o := range m.allObjects() { + if c := m.Class(o.Class); c != nil { + if err := resolveObject(c, o); err != nil { + return nil, err + } + } + } + + return m, nil +} + +func (p *parser) parseModule(m *Module) { + m.Name = p.expect(tokIdent).lit + + if p.tok.kind == tokLBrace { + m.OID = p.parseOID() + } + + p.expectWord("DEFINITIONS") + + if p.is("AUTOMATIC") || p.is("EXPLICIT") || p.is("IMPLICIT") { + m.TagDefault = p.tok.lit + p.next() + p.expectWord("TAGS") + } + + if p.gotWord("EXTENSIBILITY") { + p.expectWord("IMPLIED") + } + + p.expect(tokAssign) + p.expectWord("BEGIN") + + if p.is("IMPORTS") { + m.Imports = p.parseImports() + } + + for !p.is("END") { + if p.tok.kind == tokEOF { + p.errorf("missing END") + } + + p.parseAssignment(m) + } + + p.next() +} + +func (p *parser) parseOID() []OIDComponent { + p.expect(tokLBrace) + + var oid []OIDComponent + + for p.tok.kind != tokRBrace { + var c OIDComponent + + switch p.tok.kind { + case tokIdent: + c.Name = p.tok.lit + p.next() + + if p.got(tokLParen) { + c.Number, c.HasNumber = p.parseNumber(), true + p.expect(tokRParen) + } + case tokNumber: + c.Number, c.HasNumber = p.parseNumber(), true + default: + p.errorf("unexpected %s in object identifier", p.tok) + } + + oid = append(oid, c) + } + + p.next() + + return oid +} + +func (p *parser) parseNumber() int64 { + t := p.expect(tokNumber) + + n, err := strconv.ParseInt(t.lit, 10, 64) + if err != nil { + p.errorf("invalid number %q: %v", t.lit, err) + } + + return n +} + +func (p *parser) parseImports() []Import { + p.next() + + var imports []Import + + for p.tok.kind != tokSemicolon { + var imp Import + + for { + imp.Symbols = append(imp.Symbols, p.expect(tokIdent).lit) + + if p.got(tokLBrace) { + p.expect(tokRBrace) + } + + if !p.got(tokComma) { + break + } + } + + p.expectWord("FROM") + imp.From = p.expect(tokIdent).lit + imports = append(imports, imp) + } + + p.next() + + return imports +} + +func (m *Module) add(name string, pos Position, x any) { + if _, dup := m.names[name]; dup { + panic(bailout{&Error{Pos: pos, Msg: fmt.Sprintf("%s redefined", name)}}) + } + + m.names[name] = x +} + +func (p *parser) parseAssignment(m *Module) { + nameTok := p.expect(tokIdent) + name, pos := nameTok.lit, nameTok.pos + + switch { + case p.tok.kind == tokAssign && isUpper(name): + p.next() + + if p.gotWord("CLASS") { + c := p.parseClass() + c.Name, c.Pos = name, pos + m.Classes = append(m.Classes, c) + m.add(name, pos, c) + + return + } + + ta := &TypeAssignment{Name: name, Type: p.parseType(), Pos: pos} + m.Types = append(m.Types, ta) + m.add(name, pos, ta) + case p.tok.kind == tokLBrace && isUpper(name): + params := p.parseParams() + p.expect(tokAssign) + ta := &TypeAssignment{Name: name, Params: params, Type: p.parseType(), Pos: pos} + m.Types = append(m.Types, ta) + m.add(name, pos, ta) + case isUpper(name): + class := p.expect(tokIdent).lit + p.expect(tokAssign) + sa := &ObjectSetAssignment{Name: name, Class: class, Set: p.parseObjectSet(class), Pos: pos} + m.ObjectSets = append(m.ObjectSets, sa) + m.add(name, pos, sa) + default: + governor := p.parseType() + p.expect(tokAssign) + + if p.tok.kind == tokLBrace && governor.Kind == Reference && len(governor.Args) == 0 { + oa := &ObjectAssignment{Name: name, Class: governor.Name, Object: p.captureObject(governor.Name), Pos: pos} + m.Objects = append(m.Objects, oa) + m.add(name, pos, oa) + + return + } + + va := &ValueAssignment{Name: name, Type: governor, Value: p.parseValue(), Pos: pos} + m.Values = append(m.Values, va) + m.add(name, pos, va) + } +} + +func (p *parser) parseParams() []Param { + p.expect(tokLBrace) + + var params []Param + + for { + var prm Param + + prm.Name = p.expect(tokIdent).lit + if p.got(tokColon) { + prm.Governor, prm.Name = prm.Name, p.expect(tokIdent).lit + } + + params = append(params, prm) + + if !p.got(tokComma) { + break + } + } + + p.expect(tokRBrace) + + return params +} + +var characterStringTypes = map[string]bool{ + "BMPString": true, + "GeneralString": true, + "GraphicString": true, + "IA5String": true, + "ISO646String": true, + "NumericString": true, + "PrintableString": true, + "TeletexString": true, + "UniversalString": true, + "UTF8String": true, + "VisibleString": true, +} + +func (p *parser) parseType() *Type { + t := &Type{Pos: p.tok.pos} + + if p.tok.kind != tokIdent { + p.errorf("expected type, found %s", p.tok) + } + + lit := p.tok.lit + + switch { + case lit == "INTEGER": + p.next() + + t.Kind = Integer + if p.tok.kind == tokLBrace { + t.NamedNumbers = p.parseNamedNumbers() + } + case lit == "ENUMERATED": + p.next() + + t.Kind = Enumerated + p.parseEnumerated(t) + case lit == "BIT": + p.next() + p.expectWord("STRING") + + t.Kind = BitString + if p.tok.kind == tokLBrace { + t.NamedNumbers = p.parseNamedNumbers() + } + case lit == "OCTET": + p.next() + p.expectWord("STRING") + + t.Kind = OctetString + case lit == "BOOLEAN": + p.next() + + t.Kind = Boolean + case lit == "NULL": + p.next() + + t.Kind = Null + case lit == "OBJECT": + p.next() + p.expectWord("IDENTIFIER") + + t.Kind = ObjectIdentifier + case characterStringTypes[lit]: + p.next() + + t.Kind, t.Name = CharacterString, lit + case lit == "SEQUENCE": + p.next() + p.parseSequence(t) + case lit == "CHOICE": + p.next() + + t.Kind = Choice + p.parseComponents(t, false) + case isUpper(lit) && !reservedWords[lit]: + p.next() + + t.Kind, t.Name = Reference, lit + + switch { + case p.tok.kind == tokDot && p.peek().kind == tokField: + p.next() + + t.Kind, t.Field = ObjectClassField, p.tok.lit + p.next() + case p.tok.kind == tokLBrace: + t.Args = p.parseActuals() + } + default: + p.errorf("unsupported type %s", p.tok) + } + + for p.tok.kind == tokLParen { + p.parseConstraint(t) + } + + return t +} + +var reservedWords = map[string]bool{ + "ABSENT": true, "ALL": true, "ANY": true, "APPLICATION": true, "AUTOMATIC": true, "BEGIN": true, + "BY": true, "CLASS": true, "COMPONENT": true, "COMPONENTS": true, "CONSTRAINED": true, + "CONTAINING": true, "DEFAULT": true, "DEFINED": true, "DEFINITIONS": true, "EMBEDDED": true, + "ENCODED": true, "END": true, "EXCEPT": true, "EXPLICIT": true, "EXPORTS": true, "EXTENSIBILITY": true, + "EXTERNAL": true, "FALSE": true, "FROM": true, "IDENTIFIER": true, "IMPLICIT": true, "IMPLIED": true, + "IMPORTS": true, "INCLUDES": true, "INSTANCE": true, "INTERSECTION": true, "MAX": true, "MIN": true, + "MINUS-INFINITY": true, "OF": true, "OPTIONAL": true, "PATTERN": true, "PDV": true, "PLUS-INFINITY": true, + "PRESENT": true, "PRIVATE": true, "REAL": true, "SET": true, "SIZE": true, "STRING": true, "SYNTAX": true, + "TAGS": true, "TRUE": true, "TYPE-IDENTIFIER": true, "UNION": true, "UNIQUE": true, "UNIVERSAL": true, + "WITH": true, +} + +func (p *parser) parseSequence(t *Type) { + if p.tok.kind == tokLBrace { + t.Kind = Sequence + p.parseComponents(t, true) + + return + } + + t.Kind = SequenceOf + + switch { + case p.tok.kind == tokLParen && p.peek().kind == tokIdent && p.peek().lit == "SIZE": + p.next() + p.next() + + t.Size = p.parseRangeSpec() + p.expect(tokRParen) + case p.is("SIZE"): + p.next() + + t.Size = p.parseRangeSpec() + } + + p.expectWord("OF") + t.Elem = p.parseType() +} + +func (p *parser) parseNamedNumbers() []NamedNumber { + p.expect(tokLBrace) + + var nn []NamedNumber + + for { + n := NamedNumber{Name: p.expect(tokIdent).lit} + + p.expect(tokLParen) + n.Value = p.parseValue() + p.expect(tokRParen) + + nn = append(nn, n) + + if !p.got(tokComma) { + break + } + } + + p.expect(tokRBrace) + + return nn +} + +func (p *parser) parseEnumerated(t *Type) { + p.expect(tokLBrace) + + for { + if p.got(tokEllipsis) { + if t.Extensible { + p.errorf("duplicate extension marker") + } + + t.Extensible = true + } else { + name := p.expect(tokIdent) + if isUpper(name.lit) { + p.errorf("invalid enumeration item %q", name.lit) + } + + item := &EnumItem{Name: name.lit, Extension: t.Extensible} + + if p.got(tokLParen) { + item.Number, item.HasNumber = p.parseSignedNumber(), true + p.expect(tokRParen) + } + + t.Enum = append(t.Enum, item) + } + + if !p.got(tokComma) { + break + } + } + + p.expect(tokRBrace) +} + +func (p *parser) parseSignedNumber() int64 { + if p.got(tokMinus) { + return -p.parseNumber() + } + + return p.parseNumber() +} + +func (p *parser) parseComponents(t *Type, seq bool) { + p.expect(tokLBrace) + + ext, group := 0, 0 + + for p.tok.kind != tokRBrace { + switch { + case p.got(tokEllipsis): + switch ext { + case 0: + t.Extensible, ext = true, 1 + case 1: + ext = 2 + default: + p.errorf("too many extension markers") + } + case p.tok.kind == tokLVersion: + if ext != 1 { + p.errorf("extension addition group outside extension") + } + + p.next() + + group++ + + if p.tok.kind == tokNumber && p.peek().kind == tokColon { + p.next() + p.next() + } + + for { + c := p.parseComponent(seq) + c.Extension, c.Group = true, group + t.Components = append(t.Components, c) + + if !p.got(tokComma) { + break + } + } + + p.expect(tokRVersion) + default: + c := p.parseComponent(seq) + c.Extension = ext == 1 + t.Components = append(t.Components, c) + } + + if !p.got(tokComma) { + break + } + } + + p.expect(tokRBrace) +} + +func (p *parser) parseComponent(seq bool) *Component { + name := p.expect(tokIdent) + if isUpper(name.lit) { + p.errorf("unsupported component %q", name.lit) + } + + c := &Component{Name: name.lit, Pos: name.pos, Type: p.parseType()} + + if seq { + switch { + case p.gotWord("OPTIONAL"): + c.Optional = true + case p.gotWord("DEFAULT"): + v := p.parseValue() + c.Default = &v + } + } + + return c +} + +func (p *parser) parseValue() Value { + switch p.tok.kind { + case tokNumber: + return Value{Number: p.expect(tokNumber).lit} + case tokMinus: + p.next() + + return Value{Number: "-" + p.expect(tokNumber).lit} + case tokIdent: + if isUpper(p.tok.lit) && p.tok.lit != "MIN" && p.tok.lit != "MAX" && p.tok.lit != "TRUE" && p.tok.lit != "FALSE" { + p.errorf("expected value, found %s", p.tok) + } + + v := Value{Ref: p.tok.lit} + p.next() + + return v + } + + p.errorf("expected value, found %s", p.tok) + + return Value{} +} + +func (p *parser) parseConstraint(t *Type) { + next := p.peek() + + switch { + case next.kind == tokLBrace: + if t.Table != nil { + p.errorf("duplicate table constraint") + } + + p.next() + p.next() + + tc := &TableConstraint{Set: p.expect(tokIdent).lit} + p.expect(tokRBrace) + + if p.got(tokLBrace) { + p.expect(tokAt) + tc.At = p.expect(tokIdent).lit + p.expect(tokRBrace) + } + + p.expect(tokRParen) + + t.Table = tc + case next.kind == tokIdent && next.lit == "CONTAINING": + if t.Containing != nil { + p.errorf("duplicate contents constraint") + } + + p.next() + p.next() + + t.Containing = p.parseType() + p.expect(tokRParen) + case next.kind == tokIdent && next.lit == "SIZE": + if t.Size != nil { + p.errorf("duplicate size constraint") + } + + p.next() + p.next() + + t.Size = p.parseRangeSpec() + p.expect(tokRParen) + default: + if t.Range != nil { + p.errorf("duplicate value constraint") + } + + t.Range = p.parseRangeSpec() + } +} + +func (p *parser) parseRangeSpec() *Constraint { + p.expect(tokLParen) + + c := &Constraint{} + + if p.tok.kind != tokEllipsis { + c.Root = p.parseRangeUnion() + + if !p.got(tokComma) { + p.expect(tokRParen) + + return c + } + } + + p.expect(tokEllipsis) + + c.Extensible = true + + if p.got(tokComma) { + c.Ext = p.parseRangeUnion() + } + + p.expect(tokRParen) + + return c +} + +func (p *parser) parseRangeUnion() []Range { + var rs []Range + + for { + r := Range{Lower: p.parseValue()} + + r.Upper = r.Lower + if p.got(tokRange) { + r.Upper = p.parseValue() + } + + rs = append(rs, r) + + if !p.got(tokPipe) { + return rs + } + } +} + +func (p *parser) parseActuals() []*Actual { + p.expect(tokLBrace) + + var args []*Actual + + for { + var a Actual + + switch { + case p.tok.kind == tokLBrace: + a.Set = p.parseObjectSet("") + case p.tok.kind == tokNumber || p.tok.kind == tokMinus || p.tok.kind == tokIdent && !isUpper(p.tok.lit): + v := p.parseValue() + a.Value = &v + default: + a.Type = p.parseType() + } + + args = append(args, &a) + + if !p.got(tokComma) { + break + } + } + + p.expect(tokRBrace) + + return args +} + +func (p *parser) parseObjectSet(class string) *ObjectSet { + p.expect(tokLBrace) + + s := &ObjectSet{} + + for p.tok.kind != tokRBrace { + if p.got(tokEllipsis) { + if s.Extensible { + p.errorf("duplicate extension marker") + } + + s.Extensible = true + } else { + var e SetElement + + switch p.tok.kind { + case tokLBrace: + e.Object = p.captureObject(class) + case tokIdent: + e.Ref = p.tok.lit + p.next() + default: + p.errorf("unexpected %s in object set", p.tok) + } + + if s.Extensible { + s.Ext = append(s.Ext, &e) + } else { + s.Root = append(s.Root, &e) + } + } + + if !p.got(tokComma) && !p.got(tokPipe) { + break + } + } + + p.expect(tokRBrace) + + return s +} + +func (p *parser) captureObject(class string) *Object { + start := p.expect(tokLBrace) + o := &Object{Class: class, Pos: start.pos} + depth := 1 + + for { + switch p.tok.kind { + case tokEOF: + p.errorf("object not terminated") + case tokLBrace: + depth++ + case tokRBrace: + depth-- + if depth == 0 { + o.body = append(o.body, token{kind: tokEOF, pos: p.tok.pos}) + p.next() + + return o + } + } + + o.body = append(o.body, p.tok) + p.next() + } +} + +func (p *parser) parseClass() *ClassAssignment { + c := &ClassAssignment{} + + p.expect(tokLBrace) + + for { + f := &ClassField{Name: p.expect(tokField).lit} + + if !f.IsTypeField() { + f.Type = p.parseType() + f.Unique = p.gotWord("UNIQUE") + } + + switch { + case p.gotWord("OPTIONAL"): + f.Optional = true + case p.gotWord("DEFAULT"): + if f.IsTypeField() { + f.Default = &Setting{Type: p.parseType()} + } else { + v := p.parseValue() + f.Default = &Setting{Value: &v} + } + } + + c.Fields = append(c.Fields, f) + + if !p.got(tokComma) { + break + } + } + + p.expect(tokRBrace) + + if p.gotWord("WITH") { + p.expectWord("SYNTAX") + p.expect(tokLBrace) + c.Syntax = p.parseSyntax(false, tokRBrace) + p.expect(tokRBrace) + } + + for _, it := range c.Syntax { + if c.Field(it.Field) == nil { + p.errorf("syntax refers to undefined field %s", it.Field) + } + } + + return c +} + +func (p *parser) parseSyntax(optional bool, end tokenKind) []SyntaxItem { + var ( + items []SyntaxItem + keywords []string + ) + + for p.tok.kind != end { + switch p.tok.kind { + case tokIdent: + if !isUpper(p.tok.lit) { + p.errorf("invalid syntax keyword %q", p.tok.lit) + } + + keywords = append(keywords, p.tok.lit) + p.next() + case tokField: + items = append(items, SyntaxItem{Keywords: keywords, Field: p.tok.lit, Optional: optional}) + keywords = nil + + p.next() + case tokLBrack: + if optional || len(keywords) > 0 { + p.errorf("unsupported nested optional syntax group") + } + + p.next() + + group := p.parseSyntax(true, tokRBrack) + if len(group) != 1 || len(group[0].Keywords) == 0 { + p.errorf("unsupported optional syntax group") + } + + items = append(items, group...) + + p.expect(tokRBrack) + default: + p.errorf("unexpected %s in WITH SYNTAX", p.tok) + } + } + + if len(keywords) > 0 { + p.errorf("syntax keywords %v not followed by a field", keywords) + } + + return items +} + +func resolveObject(c *ClassAssignment, o *Object) (err error) { + if o.Settings != nil { + return nil + } + + if c.Syntax == nil { + return &Error{Pos: o.Pos, Msg: fmt.Sprintf("class %s has no WITH SYNTAX", c.Name)} + } + + defer catch(&err) + + p := newParser(o.body) + settings := map[string]Setting{} + + for _, it := range c.Syntax { + if it.Optional && !p.is(it.Keywords[0]) { + continue + } + + for _, kw := range it.Keywords { + p.expectWord(kw) + } + + f := c.Field(it.Field) + if f.IsTypeField() { + settings[f.Name] = Setting{Type: p.parseType()} + } else { + v := p.parseValue() + settings[f.Name] = Setting{Value: &v} + } + } + + if p.tok.kind != tokEOF { + p.errorf("unexpected %s in object of class %s", p.tok, c.Name) + } + + o.Class, o.Settings = c.Name, settings + + return nil +} + +func (m *Module) allObjects() []*Object { + var objs []*Object + + for _, oa := range m.Objects { + objs = append(objs, oa.Object) + } + + for _, sa := range m.ObjectSets { + for _, e := range append(append([]*SetElement{}, sa.Set.Root...), sa.Set.Ext...) { + if e.Object != nil { + objs = append(objs, e.Object) + } + } + } + + return objs +} diff --git a/per/asn1spec/parser_test.go b/per/asn1spec/parser_test.go new file mode 100644 index 0000000000..28f8e93a1d --- /dev/null +++ b/per/asn1spec/parser_test.go @@ -0,0 +1,532 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package asn1spec_test + +import ( + "errors" + "strings" + "testing" + + "github.com/ellanetworks/core/per/asn1spec" +) + +func module(body string) []byte { + return []byte("M { itu-t (0) x (1) 2 } DEFINITIONS AUTOMATIC TAGS ::=\nBEGIN\n" + body + "\nEND\n") +} + +func mustParse(t *testing.T, body string) *asn1spec.Module { + t.Helper() + + m, err := asn1spec.Parse("m.asn", module(body)) + if err != nil { + t.Fatalf("Parse: %v", err) + } + + return m +} + +func TestParseHeader(t *testing.T) { + m := mustParse(t, "") + + if m.Name != "M" || m.TagDefault != "AUTOMATIC" { + t.Fatalf("got name %q tags %q", m.Name, m.TagDefault) + } + + want := []asn1spec.OIDComponent{{Name: "itu-t", HasNumber: true}, {Name: "x", Number: 1, HasNumber: true}, {Number: 2, HasNumber: true}} + if len(m.OID) != len(want) { + t.Fatalf("OID = %+v", m.OID) + } + + for i := range want { + if m.OID[i] != want[i] { + t.Errorf("OID[%d] = %+v, want %+v", i, m.OID[i], want[i]) + } + } +} + +func TestParseImports(t *testing.T) { + m := mustParse(t, "IMPORTS\n\tA,\n\tb-c,\n\tP{}\nFROM X\n\tD\nFROM Y;") + + if len(m.Imports) != 2 { + t.Fatalf("imports = %+v", m.Imports) + } + + if got := strings.Join(m.Imports[0].Symbols, " "); got != "A b-c P" || m.Imports[0].From != "X" { + t.Errorf("first import = %+v", m.Imports[0]) + } + + if got := strings.Join(m.Imports[1].Symbols, " "); got != "D" || m.Imports[1].From != "Y" { + t.Errorf("second import = %+v", m.Imports[1]) + } +} + +func TestParseValueAssignments(t *testing.T) { + tests := []struct { + src string + name string + typ string + value string + integer int64 + }{ + {"id-MME-UE-S1AP-ID ProtocolIE-ID ::= 0", "id-MME-UE-S1AP-ID", "ProtocolIE-ID", "0", 0}, + {"maxnoofE-RABs INTEGER ::= 256", "maxnoofE-RABs", "INTEGER", "256", 256}, + {"id-HandoverPreparation ProcedureCode ::= 0", "id-HandoverPreparation", "ProcedureCode", "0", 0}, + {"neg INTEGER ::= -12", "neg", "INTEGER", "-12", -12}, + {"big INTEGER ::= 18446744073709551615", "big", "INTEGER", "18446744073709551615", -1}, + {"alias INTEGER ::= -- comment -- 7", "alias", "INTEGER", "7", 7}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + m := mustParse(t, tt.src) + + va := m.Value(tt.name) + if va == nil { + t.Fatalf("value %s not found", tt.name) + } + + if va.Type.String() != tt.typ || va.Value.String() != tt.value { + t.Errorf("got %s ::= %s", va.Type, va.Value) + } + + n, err := va.Value.Int64() + if tt.integer < 0 && tt.value != "-12" { + if err == nil { + t.Errorf("Int64 accepted out-of-range %s", tt.value) + } + + return + } + + if err != nil || n != tt.integer { + t.Errorf("Int64 = %d, %v", n, err) + } + }) + } +} + +func TestParseSequence(t *testing.T) { + m := mustParse(t, ` +Seq ::= SEQUENCE { + a INTEGER (0..4095, ...), + b OCTET STRING OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {Seq-ExtIEs} } OPTIONAL, + ..., + c BOOLEAN, + [[ d NULL, + e BIT STRING (SIZE(1..160, ...)) OPTIONAL ]], + ..., + f Other DEFAULT x +}`) + + typ := m.Type("Seq").Type + if typ.Kind != asn1spec.Sequence || !typ.Extensible { + t.Fatalf("kind %s extensible %v", typ.Kind, typ.Extensible) + } + + type comp struct { + name string + typ string + optional bool + ext bool + group int + } + + want := []comp{ + {"a", "INTEGER (0..4095, ...)", false, false, 0}, + {"b", "OCTET STRING", true, false, 0}, + {"iE-Extensions", "ProtocolExtensionContainer {{Seq-ExtIEs}}", true, false, 0}, + {"c", "BOOLEAN", false, true, 0}, + {"d", "NULL", false, true, 1}, + {"e", "BIT STRING (SIZE(1..160, ...))", true, true, 1}, + {"f", "Other", false, false, 0}, + } + + if len(typ.Components) != len(want) { + t.Fatalf("got %d components", len(typ.Components)) + } + + for i, w := range want { + c := typ.Components[i] + + got := comp{c.Name, c.Type.String(), c.Optional, c.Extension, c.Group} + if got != w { + t.Errorf("component %d = %+v, want %+v", i, got, w) + } + } + + if d := typ.Component("f").Default; d == nil || d.Ref != "x" { + t.Errorf("DEFAULT = %v", d) + } + + ext := typ.Component("iE-Extensions").Type + if ext.Kind != asn1spec.Reference || len(ext.Args) != 1 || ext.Args[0].Set == nil || ext.Args[0].Set.Root[0].Ref != "Seq-ExtIEs" { + t.Errorf("iE-Extensions = %+v", ext) + } +} + +func TestParseTypes(t *testing.T) { + tests := []struct { + src string + kind asn1spec.Kind + str string + }{ + {"T ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { { E-RABItemIEs} }", asn1spec.SequenceOf, "SEQUENCE (SIZE(1..maxnoofE-RABs)) OF ProtocolIE-SingleContainer {{E-RABItemIEs}}"}, + {"T ::= SEQUENCE SIZE (0..8) OF Item", asn1spec.SequenceOf, "SEQUENCE (SIZE(0..8)) OF Item"}, + {"T ::= INTEGER (1..30|40|50, ...)", asn1spec.Integer, "INTEGER (1..30|40|50, ...)"}, + {"T ::= INTEGER (0..4095, ..., 4096..65535)", asn1spec.Integer, "INTEGER (0..4095, ..., 4096..65535)"}, + {"T ::= INTEGER (-127..128)", asn1spec.Integer, "INTEGER (-127..128)"}, + {"T ::= BIT STRING (SIZE(128, ...))", asn1spec.BitString, "BIT STRING (SIZE(128, ...))"}, + {"T ::= OCTET STRING (SIZE (3))", asn1spec.OctetString, "OCTET STRING (SIZE(3))"}, + {"T ::= OCTET STRING (CONTAINING Transfer)", asn1spec.OctetString, "OCTET STRING (CONTAINING Transfer)"}, + {"T ::= PrintableString (SIZE (1..150,...))", asn1spec.CharacterString, "PrintableString (SIZE(1..150, ...))"}, + {"T ::= VisibleString", asn1spec.CharacterString, "VisibleString"}, + {"T ::= OBJECT IDENTIFIER", asn1spec.ObjectIdentifier, "OBJECT IDENTIFIER"}, + {"T ::= Other", asn1spec.Reference, "Other"}, + {"T ::= C.&id ({Set}{@id})", asn1spec.ObjectClassField, "C.&id"}, + {"T ::= List { 1, maxnoofX, {Items} }", asn1spec.Reference, "List {1, maxnoofX, {Items}}"}, + } + + for _, tt := range tests { + t.Run(tt.str, func(t *testing.T) { + typ := mustParse(t, tt.src).Type("T").Type + if typ.Kind != tt.kind || typ.String() != tt.str { + t.Errorf("got %s %q", typ.Kind, typ.String()) + } + }) + } +} + +func TestParseTableConstraint(t *testing.T) { + typ := mustParse(t, "T ::= SEQUENCE { id C.&id ({S}), value C.&Value ({S}{@id}) }").Type("T").Type + + if tc := typ.Component("id").Type.Table; tc == nil || tc.Set != "S" || tc.At != "" { + t.Errorf("id table = %+v", tc) + } + + if tc := typ.Component("value").Type.Table; tc == nil || tc.Set != "S" || tc.At != "id" { + t.Errorf("value table = %+v", tc) + } +} + +func TestParseIntegerNamedNumbers(t *testing.T) { + typ := mustParse(t, "PriorityLevel ::= INTEGER { spare (0), highest (1), lowest (14), no-priority (15) } (0..15)").Type("PriorityLevel").Type + + if len(typ.NamedNumbers) != 4 || typ.NamedNumbers[3].Name != "no-priority" || typ.NamedNumbers[3].Value.Number != "15" { + t.Errorf("named numbers = %+v", typ.NamedNumbers) + } + + if typ.Range.String() != "0..15" { + t.Errorf("range = %s", typ.Range) + } +} + +func TestParseEnumerated(t *testing.T) { + tests := []struct { + src string + root, ext string + extensible bool + }{ + {"T ::= ENUMERATED { reject, ignore, notify }", "reject ignore notify", "", false}, + {"T ::= ENUMERATED { a, b, ... }", "a b", "", true}, + {"T ::= ENUMERATED {n2, n3, ..., n0}", "n2 n3", "n0", true}, + {"T ::= ENUMERATED { x(1), y(0), ..., z(2) }", "x y", "z", true}, + } + + for _, tt := range tests { + t.Run(tt.src, func(t *testing.T) { + typ := mustParse(t, tt.src).Type("T").Type + + var root, ext []string + + for _, e := range typ.Enum { + if e.Extension { + ext = append(ext, e.Name) + } else { + root = append(root, e.Name) + } + } + + if strings.Join(root, " ") != tt.root || strings.Join(ext, " ") != tt.ext || typ.Extensible != tt.extensible { + t.Errorf("root %v ext %v extensible %v", root, ext, typ.Extensible) + } + }) + } +} + +func TestParseChoice(t *testing.T) { + typ := mustParse(t, `T ::= CHOICE { + gTPTunnel GTPTunnel, + choice-Extensions ProtocolIE-SingleContainer { {T-ExtIEs} }, + ..., + late NULL +}`).Type("T").Type + + if typ.Kind != asn1spec.Choice || !typ.Extensible || len(typ.Components) != 3 { + t.Fatalf("got %+v", typ) + } + + if typ.Components[1].Extension || !typ.Components[2].Extension { + t.Errorf("extension flags wrong") + } +} + +const classes = ` +Criticality ::= ENUMERATED { reject, ignore, notify } +Presence ::= ENUMERATED { optional, conditional, mandatory } +ProtocolIE-ID ::= INTEGER (0..65535) +id-A ProtocolIE-ID ::= 1 +id-B ProtocolIE-ID ::= 2 +ProcedureCode ::= INTEGER (0..255) +id-P ProcedureCode ::= 9 +X-PROTOCOL-IES ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} +X-PROTOCOL-IES-PAIR ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &firstCriticality Criticality, + &FirstValue, + &secondCriticality Criticality, + &SecondValue, + &presence Presence +} +WITH SYNTAX { + ID &id + FIRST CRITICALITY &firstCriticality + FIRST TYPE &FirstValue + SECOND CRITICALITY &secondCriticality + SECOND TYPE &SecondValue + PRESENCE &presence +} +X-ELEMENTARY-PROCEDURE ::= CLASS { + &InitiatingMessage , + &SuccessfulOutcome OPTIONAL, + &UnsuccessfulOutcome OPTIONAL, + &procedureCode ProcedureCode UNIQUE, + &criticality Criticality DEFAULT ignore +} +WITH SYNTAX { + INITIATING MESSAGE &InitiatingMessage + [SUCCESSFUL OUTCOME &SuccessfulOutcome] + [UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome] + PROCEDURE CODE &procedureCode + [CRITICALITY &criticality] +} +ProtocolIE-Container {X-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (0..65535)) OF + ProtocolIE-Field {{IEsSetParam}} +ProtocolIE-Field {X-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE { + id X-PROTOCOL-IES.&id ({IEsSetParam}), + criticality X-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}), + value X-PROTOCOL-IES.&Value ({IEsSetParam}{@id}) +} +` + +func TestObjectSets(t *testing.T) { + m := mustParse(t, classes+` +Msg ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MsgIEs} }, + ... +} +MsgIEs X-PROTOCOL-IES ::= { + { ID id-A CRITICALITY reject TYPE INTEGER (0..7) PRESENCE mandatory}| + { ID id-B CRITICALITY ignore TYPE OCTET STRING (CONTAINING Msg) PRESENCE optional}, + ... +} +PairIEs X-PROTOCOL-IES-PAIR ::= { + { ID id-A FIRST CRITICALITY reject FIRST TYPE Msg SECOND CRITICALITY ignore SECOND TYPE NULL PRESENCE mandatory }, + ... +} +proc X-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE Msg + UNSUCCESSFUL OUTCOME Msg + PROCEDURE CODE id-P +} +Procs X-ELEMENTARY-PROCEDURE ::= { proc, ... } +`) + + set := m.ObjectSet("MsgIEs") + if set == nil || set.Class != "X-PROTOCOL-IES" || !set.Set.Extensible || len(set.Set.Root) != 2 { + t.Fatalf("MsgIEs = %+v", set) + } + + a := set.Set.Root[0].Object + if v, _ := a.Value("&id"); v.Ref != "id-A" { + t.Errorf("id = %v", v) + } + + if v, _ := a.Value("&criticality"); v.Ref != "reject" { + t.Errorf("criticality = %v", v) + } + + if v, _ := a.Value("&presence"); v.Ref != "mandatory" { + t.Errorf("presence = %v", v) + } + + if typ := a.Type("&Value"); typ.String() != "INTEGER (0..7)" { + t.Errorf("type = %s", typ) + } + + if typ := set.Set.Root[1].Object.Type("&Value"); typ.Containing == nil || typ.Containing.Name != "Msg" { + t.Errorf("containing = %v", typ) + } + + pair := m.ObjectSet("PairIEs").Set.Root[0].Object + if pair.Type("&FirstValue").Name != "Msg" || pair.Type("&SecondValue").Kind != asn1spec.Null { + t.Errorf("pair = %+v", pair.Settings) + } + + if v, _ := pair.Value("&secondCriticality"); v.Ref != "ignore" { + t.Errorf("second criticality = %v", v) + } + + proc := m.Object("proc").Object + if proc.Type("&SuccessfulOutcome") != nil || proc.Type("&UnsuccessfulOutcome").Name != "Msg" { + t.Errorf("proc = %+v", proc.Settings) + } + + if _, ok := proc.Value("&criticality"); ok { + t.Errorf("absent optional criticality reported present") + } + + s, err := asn1spec.NewSpec(m) + if err != nil { + t.Fatal(err) + } + + objs, err := s.Objects(s.ObjectSet("Procs").Set) + if err != nil || len(objs) != 1 || objs[0] != proc { + t.Errorf("Objects = %v, %v", objs, err) + } + + if n, err := s.Int(asn1spec.Value{Ref: "id-B"}); err != nil || n != 2 { + t.Errorf("Int(id-B) = %d, %v", n, err) + } + + u, err := s.Underlying(&asn1spec.Type{Kind: asn1spec.Reference, Name: "Presence"}) + if err != nil || u.Kind != asn1spec.Enumerated { + t.Errorf("Underlying = %v, %v", u, err) + } +} + +func TestCrossModuleObjects(t *testing.T) { + c, err := asn1spec.Parse("c.asn", []byte("C DEFINITIONS AUTOMATIC TAGS ::= BEGIN\n"+classes+"\nEND")) + if err != nil { + t.Fatal(err) + } + + u, err := asn1spec.Parse("u.asn", []byte(`U DEFINITIONS AUTOMATIC TAGS ::= BEGIN +IMPORTS id-A, X-PROTOCOL-IES FROM C; +S X-PROTOCOL-IES ::= { { ID id-A CRITICALITY notify TYPE NULL PRESENCE conditional } } +END`)) + if err != nil { + t.Fatal(err) + } + + if u.ObjectSet("S").Set.Root[0].Object.Settings != nil { + t.Fatalf("object resolved without its class") + } + + if _, err := asn1spec.NewSpec(c, u); err != nil { + t.Fatal(err) + } + + if v, _ := u.ObjectSet("S").Set.Root[0].Object.Value("&criticality"); v.Ref != "notify" { + t.Errorf("criticality = %v", v) + } +} + +func TestParseErrors(t *testing.T) { + tests := []struct { + name string + src string + want string + }{ + {"set", "T ::= SET { a INTEGER }", "unsupported type"}, + {"components of", "T ::= SEQUENCE { COMPONENTS OF X }", "unsupported component"}, + {"redefined", "T ::= NULL\nT ::= NULL", "T redefined"}, + {"stray", "T ::= NULL )", "expected"}, + {"bad char", "T ::= NULL #", "unexpected character"}, + {"double ellipsis enum", "T ::= ENUMERATED { a, ..., b, ... }", "duplicate extension marker"}, + {"group outside extension", "T ::= SEQUENCE { [[ a NULL ]] }", "extension addition group outside extension"}, + {"bad object", "X ::= CLASS { &id INTEGER } WITH SYNTAX { ID &id }\nS X ::= { { ID 1 EXTRA } }", "unexpected"}, + {"unterminated", "T ::= SEQUENCE {", `unsupported component "END"`}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := asn1spec.Parse("m.asn", module(tt.src)) + if err == nil || !strings.Contains(err.Error(), tt.want) { + t.Errorf("err = %v, want %q", err, tt.want) + } + }) + } + + if _, err := asn1spec.Parse("m.asn", []byte("M DEFINITIONS ::= BEGIN T ::= NULL")); err == nil || !strings.Contains(err.Error(), "missing END") { + t.Errorf("missing END: %v", err) + } +} + +func TestSpecErrors(t *testing.T) { + tests := []struct { + name string + src string + want string + }{ + {"undefined type", "T ::= SEQUENCE { a Missing }", "undefined type Missing"}, + {"undefined value", "T ::= INTEGER (0..maxMissing)", "undefined value maxMissing"}, + {"parameter count", "P {X : S} ::= NULL\nT ::= P", "takes 1 parameters, got 0"}, + {"unknown import", "IMPORTS A FROM Nowhere;", "unknown module Nowhere"}, + {"enum literal", classes + "S X-PROTOCOL-IES ::= { { ID id-A CRITICALITY maybe TYPE NULL PRESENCE optional } }", "maybe is not a literal of Criticality"}, + {"missing mandatory field", classes + "p X-ELEMENTARY-PROCEDURE ::= { INITIATING MESSAGE NULL PROCEDURE CODE 1 }\nq X-PROTOCOL-IES-PAIR ::= { ID id-A FIRST CRITICALITY reject FIRST TYPE NULL SECOND CRITICALITY reject SECOND TYPE NULL PRESENCE optional }", ""}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + m, err := asn1spec.Parse("m.asn", module(tt.src)) + if err != nil { + t.Fatal(err) + } + + _, err = asn1spec.NewSpec(m) + if tt.want == "" { + if err != nil { + t.Errorf("unexpected error %v", err) + } + + return + } + + if err == nil || !strings.Contains(err.Error(), tt.want) { + t.Errorf("err = %v, want %q", err, tt.want) + } + }) + } +} + +func TestScannerComments(t *testing.T) { + m := mustParse(t, "/* block /* nested */ */ A ::= -- inline -- INTEGER -- trailing\n-- full line\nB ::=\tNULL") + + if m.Type("A") == nil || m.Type("B") == nil { + t.Fatalf("types = %+v", m.Types) + } +} + +func TestErrorPosition(t *testing.T) { + _, err := asn1spec.Parse("m.asn", []byte("M DEFINITIONS ::= BEGIN\n T ::= SET { }\nEND")) + + var perr *asn1spec.Error + if !errors.As(err, &perr) || perr.Pos.Line != 2 || perr.Pos.Column != 9 || perr.Pos.Filename != "m.asn" { + t.Fatalf("err = %#v", err) + } +} diff --git a/per/asn1spec/scanner.go b/per/asn1spec/scanner.go new file mode 100644 index 0000000000..0ab06b07b8 --- /dev/null +++ b/per/asn1spec/scanner.go @@ -0,0 +1,436 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package asn1spec + +import ( + "fmt" + "unicode" + "unicode/utf8" +) + +type Position struct { + Filename string + Line int + Column int +} + +func (p Position) String() string { + if p.Filename == "" { + return fmt.Sprintf("%d:%d", p.Line, p.Column) + } + + return fmt.Sprintf("%s:%d:%d", p.Filename, p.Line, p.Column) +} + +type Error struct { + Pos Position + Msg string +} + +func (e *Error) Error() string { + return e.Pos.String() + ": " + e.Msg +} + +type tokenKind int + +const ( + tokEOF tokenKind = iota + tokIdent + tokNumber + tokCString + tokBString + tokHString + tokField + tokAssign + tokLBrace + tokRBrace + tokLParen + tokRParen + tokLBrack + tokRBrack + tokLVersion + tokRVersion + tokComma + tokDot + tokRange + tokEllipsis + tokColon + tokSemicolon + tokPipe + tokAt + tokMinus + tokExcl + tokCaret + tokLess +) + +var tokenNames = [...]string{ + tokEOF: "EOF", + tokIdent: "identifier", + tokNumber: "number", + tokCString: "cstring", + tokBString: "bstring", + tokHString: "hstring", + tokField: "field reference", + tokAssign: "::=", + tokLBrace: "{", + tokRBrace: "}", + tokLParen: "(", + tokRParen: ")", + tokLBrack: "[", + tokRBrack: "]", + tokLVersion: "[[", + tokRVersion: "]]", + tokComma: ",", + tokDot: ".", + tokRange: "..", + tokEllipsis: "...", + tokColon: ":", + tokSemicolon: ";", + tokPipe: "|", + tokAt: "@", + tokMinus: "-", + tokExcl: "!", + tokCaret: "^", + tokLess: "<", +} + +func (k tokenKind) String() string { + if k >= 0 && int(k) < len(tokenNames) { + return tokenNames[k] + } + + return fmt.Sprintf("token(%d)", int(k)) +} + +type token struct { + kind tokenKind + lit string + pos Position +} + +func (t token) String() string { + switch t.kind { + case tokIdent, tokNumber, tokField, tokCString, tokBString, tokHString: + return fmt.Sprintf("%s %q", t.kind, t.lit) + default: + return fmt.Sprintf("%q", t.kind.String()) + } +} + +type scanner struct { + filename string + src []byte + ch rune + offset int + rdOffset int + line int + lineStart int +} + +func scan(filename string, src []byte) ([]token, error) { + s := &scanner{filename: filename, src: src, line: 1} + s.next() + + var toks []token + + for { + t, err := s.scan() + if err != nil { + return nil, err + } + + toks = append(toks, t) + if t.kind == tokEOF { + return toks, nil + } + } +} + +func (s *scanner) next() { + if s.ch == '\n' { + s.line++ + s.lineStart = s.offset + 1 + } + + if s.rdOffset >= len(s.src) { + s.offset = len(s.src) + s.ch = -1 + + return + } + + s.offset = s.rdOffset + + r, w := rune(s.src[s.rdOffset]), 1 + if r >= utf8.RuneSelf { + r, w = utf8.DecodeRune(s.src[s.rdOffset:]) + } + + s.rdOffset += w + s.ch = r +} + +func (s *scanner) peek() rune { + if s.rdOffset >= len(s.src) { + return -1 + } + + r, _ := utf8.DecodeRune(s.src[s.rdOffset:]) + + return r +} + +func (s *scanner) pos() Position { + return Position{Filename: s.filename, Line: s.line, Column: utf8.RuneCount(s.src[s.lineStart:s.offset]) + 1} +} + +func (s *scanner) errorf(pos Position, format string, args ...any) error { + return &Error{Pos: pos, Msg: fmt.Sprintf(format, args...)} +} + +func (s *scanner) skipSpaceAndComments() error { + for { + switch { + case s.ch >= 0 && unicode.IsSpace(s.ch): + s.next() + case s.ch == '-' && s.peek() == '-': + s.next() + s.next() + + for s.ch != '\n' && s.ch >= 0 { + if s.ch == '-' && s.peek() == '-' { + s.next() + s.next() + + break + } + + s.next() + } + case s.ch == '/' && s.peek() == '*': + if err := s.skipBlockComment(); err != nil { + return err + } + default: + return nil + } + } +} + +func (s *scanner) skipBlockComment() error { + start := s.pos() + depth := 0 + + for { + switch { + case s.ch < 0: + return s.errorf(start, "block comment not terminated") + case s.ch == '/' && s.peek() == '*': + s.next() + s.next() + + depth++ + case s.ch == '*' && s.peek() == '/': + s.next() + s.next() + + depth-- + if depth == 0 { + return nil + } + default: + s.next() + } + } +} + +func isLetter(ch rune) bool { + return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' +} + +func isDigit(ch rune) bool { + return '0' <= ch && ch <= '9' +} + +func (s *scanner) scanIdentifier() string { + start := s.offset + + for { + switch { + case isLetter(s.ch) || isDigit(s.ch): + s.next() + case s.ch == '-' && (isLetter(s.peek()) || isDigit(s.peek())): + s.next() + default: + return string(s.src[start:s.offset]) + } + } +} + +func (s *scanner) scan() (token, error) { + if err := s.skipSpaceAndComments(); err != nil { + return token{}, err + } + + pos := s.pos() + tok := func(k tokenKind, lit string) (token, error) { + return token{kind: k, lit: lit, pos: pos}, nil + } + + switch ch := s.ch; { + case ch < 0: + return tok(tokEOF, "") + case isLetter(ch): + return tok(tokIdent, s.scanIdentifier()) + case isDigit(ch): + start := s.offset + for isDigit(s.ch) { + s.next() + } + + return tok(tokNumber, string(s.src[start:s.offset])) + case ch == '&': + s.next() + + if !isLetter(s.ch) { + return token{}, s.errorf(pos, "invalid field reference") + } + + return tok(tokField, "&"+s.scanIdentifier()) + case ch == '"': + return s.scanCString(pos) + case ch == '\'': + return s.scanBHString(pos) + } + + ch := s.ch + s.next() + + switch ch { + case ':': + if s.ch == ':' && s.peek() == '=' { + s.next() + s.next() + + return tok(tokAssign, "::=") + } + + return tok(tokColon, ":") + case '.': + if s.ch == '.' { + s.next() + + if s.ch == '.' { + s.next() + + return tok(tokEllipsis, "...") + } + + return tok(tokRange, "..") + } + + return tok(tokDot, ".") + case '[': + if s.ch == '[' { + s.next() + + return tok(tokLVersion, "[[") + } + + return tok(tokLBrack, "[") + case ']': + if s.ch == ']' { + s.next() + + return tok(tokRVersion, "]]") + } + + return tok(tokRBrack, "]") + case '{': + return tok(tokLBrace, "{") + case '}': + return tok(tokRBrace, "}") + case '(': + return tok(tokLParen, "(") + case ')': + return tok(tokRParen, ")") + case ',': + return tok(tokComma, ",") + case ';': + return tok(tokSemicolon, ";") + case '|': + return tok(tokPipe, "|") + case '@': + return tok(tokAt, "@") + case '-': + return tok(tokMinus, "-") + case '!': + return tok(tokExcl, "!") + case '^': + return tok(tokCaret, "^") + case '<': + return tok(tokLess, "<") + } + + return token{}, s.errorf(pos, "unexpected character %q", ch) +} + +func (s *scanner) scanCString(pos Position) (token, error) { + s.next() + + var buf []rune + + for { + switch { + case s.ch < 0: + return token{}, s.errorf(pos, "string literal not terminated") + case s.ch == '"' && s.peek() == '"': + s.next() + s.next() + + buf = append(buf, '"') + case s.ch == '"': + s.next() + + return token{kind: tokCString, lit: string(buf), pos: pos}, nil + default: + buf = append(buf, s.ch) + s.next() + } + } +} + +func (s *scanner) scanBHString(pos Position) (token, error) { + s.next() + + var buf []rune + + for s.ch != '\'' { + if s.ch < 0 { + return token{}, s.errorf(pos, "bstring/hstring literal not terminated") + } + + if !unicode.IsSpace(s.ch) { + buf = append(buf, s.ch) + } + + s.next() + } + + s.next() + + switch s.ch { + case 'B': + s.next() + + return token{kind: tokBString, lit: string(buf), pos: pos}, nil + case 'H': + s.next() + + return token{kind: tokHString, lit: string(buf), pos: pos}, nil + } + + return token{}, s.errorf(pos, "bstring/hstring literal without B or H suffix") +} diff --git a/per/asn1spec/spec.go b/per/asn1spec/spec.go new file mode 100644 index 0000000000..1b73ad9b8e --- /dev/null +++ b/per/asn1spec/spec.go @@ -0,0 +1,493 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package asn1spec + +import ( + "errors" + "fmt" + "io/fs" + "path" + "sort" +) + +type Spec struct { + Modules []*Module + byName map[string]*Module +} + +func ParseFS(fsys fs.FS, patterns ...string) (*Spec, error) { + var files []string + + for _, pattern := range patterns { + list, err := fs.Glob(fsys, pattern) + if err != nil { + return nil, err + } + + if len(list) == 0 { + return nil, fmt.Errorf("asn1spec: pattern matches no files: %#q", pattern) + } + + files = append(files, list...) + } + + sort.Strings(files) + + mods := make([]*Module, 0, len(files)) + + for _, name := range files { + src, err := fs.ReadFile(fsys, name) + if err != nil { + return nil, err + } + + m, err := Parse(path.Base(name), src) + if err != nil { + return nil, err + } + + mods = append(mods, m) + } + + return NewSpec(mods...) +} + +func NewSpec(mods ...*Module) (*Spec, error) { + s := &Spec{Modules: mods, byName: map[string]*Module{}} + + for _, m := range mods { + if _, dup := s.byName[m.Name]; dup { + return nil, fmt.Errorf("asn1spec: module %s defined twice", m.Name) + } + + s.byName[m.Name] = m + } + + for _, m := range mods { + for _, imp := range m.Imports { + from := s.byName[imp.From] + if from == nil { + return nil, fmt.Errorf("asn1spec: module %s imports from unknown module %s", m.Name, imp.From) + } + + for _, sym := range imp.Symbols { + if s.lookup(from, sym) == nil { + return nil, fmt.Errorf("asn1spec: module %s imports %s which %s does not define", m.Name, sym, imp.From) + } + } + } + } + + for _, m := range mods { + for _, o := range m.allObjects() { + c, _ := s.lookup(m, o.Class).(*ClassAssignment) + if c == nil { + return nil, &Error{Pos: o.Pos, Msg: fmt.Sprintf("unknown class %s", o.Class)} + } + + if err := resolveObject(c, o); err != nil { + return nil, err + } + } + } + + var errs []error + + for _, m := range mods { + errs = append(errs, s.check(m)...) + } + + if len(errs) > 0 { + return nil, errors.Join(errs...) + } + + return s, nil +} + +func (s *Spec) Resolve(m *Module, name string) (*Module, any) { + return s.resolve(m, name, 0) +} + +func (s *Spec) lookup(m *Module, name string) any { + _, x := s.resolve(m, name, 0) + return x +} + +func (s *Spec) resolve(m *Module, name string, depth int) (*Module, any) { + if x := m.lookup(name); x != nil { + return m, x + } + + if depth > len(s.Modules) { + return nil, nil + } + + for _, imp := range m.Imports { + for _, sym := range imp.Symbols { + if sym == name { + if from := s.byName[imp.From]; from != nil { + return s.resolve(from, name, depth+1) + } + } + } + } + + return nil, nil +} + +func (s *Spec) Module(name string) *Module { + return s.byName[name] +} + +func (s *Spec) find(name string) any { + for _, m := range s.Modules { + if x := m.lookup(name); x != nil { + return x + } + } + + return nil +} + +func (s *Spec) Type(name string) *TypeAssignment { + t, _ := s.find(name).(*TypeAssignment) + return t +} + +func (s *Spec) Value(name string) *ValueAssignment { + v, _ := s.find(name).(*ValueAssignment) + return v +} + +func (s *Spec) Class(name string) *ClassAssignment { + c, _ := s.find(name).(*ClassAssignment) + return c +} + +func (s *Spec) Object(name string) *ObjectAssignment { + o, _ := s.find(name).(*ObjectAssignment) + return o +} + +func (s *Spec) ObjectSet(name string) *ObjectSetAssignment { + o, _ := s.find(name).(*ObjectSetAssignment) + return o +} + +func (s *Spec) Int(v Value) (int64, error) { + for range len(s.Modules) + 64 { + if !v.IsRef() { + return v.Int64() + } + + va := s.Value(v.Ref) + if va == nil { + return 0, fmt.Errorf("asn1spec: undefined value %s", v.Ref) + } + + v = va.Value + } + + return 0, fmt.Errorf("asn1spec: value reference cycle at %s", v.Ref) +} + +func (s *Spec) Underlying(t *Type) (*Type, error) { + seen := map[string]bool{} + + for t.Kind == Reference && len(t.Args) == 0 { + if seen[t.Name] { + return nil, fmt.Errorf("asn1spec: type reference cycle at %s", t.Name) + } + + seen[t.Name] = true + + ta := s.Type(t.Name) + if ta == nil { + return nil, fmt.Errorf("asn1spec: undefined type %s", t.Name) + } + + if len(ta.Params) > 0 { + return t, nil + } + + t = ta.Type + } + + return t, nil +} + +func (s *Spec) Objects(set *ObjectSet) ([]*Object, error) { + var out []*Object + + err := s.collect(set, &out, map[string]bool{}) + + return out, err +} + +func (s *Spec) collect(set *ObjectSet, out *[]*Object, seen map[string]bool) error { + for _, e := range append(append([]*SetElement{}, set.Root...), set.Ext...) { + if e.Object != nil { + *out = append(*out, e.Object) + continue + } + + if seen[e.Ref] { + return fmt.Errorf("asn1spec: object set cycle at %s", e.Ref) + } + + seen[e.Ref] = true + + switch x := s.find(e.Ref).(type) { + case *ObjectAssignment: + *out = append(*out, x.Object) + case *ObjectSetAssignment: + if err := s.collect(x.Set, out, seen); err != nil { + return err + } + default: + return fmt.Errorf("asn1spec: undefined object or object set %s", e.Ref) + } + + delete(seen, e.Ref) + } + + return nil +} + +type checker struct { + s *Spec + m *Module + params map[string]bool + errs []error +} + +func (s *Spec) check(m *Module) []error { + c := &checker{s: s, m: m} + + for _, ta := range m.Types { + c.params = map[string]bool{} + for _, prm := range ta.Params { + c.params[prm.Name] = true + if prm.Governor != "" && prm.Governor != "INTEGER" { + c.class(ta.Pos, prm.Governor) + } + } + + c.typ(ta.Type) + } + + c.params = nil + + for _, va := range m.Values { + c.typ(va.Type) + c.value(va.Pos, va.Type, va.Value) + } + + for _, ca := range m.Classes { + for _, f := range ca.Fields { + if f.Type != nil { + c.typ(f.Type) + } + + if f.Default != nil && f.Default.Type != nil { + c.typ(f.Default.Type) + } + + if f.Default != nil && f.Default.Value != nil { + c.value(ca.Pos, f.Type, *f.Default.Value) + } + } + } + + for _, oa := range m.Objects { + c.class(oa.Pos, oa.Class) + c.object(oa.Object) + } + + for _, sa := range m.ObjectSets { + c.class(sa.Pos, sa.Class) + c.set(sa.Pos, sa.Set) + } + + return c.errs +} + +func (c *checker) errorf(pos Position, format string, args ...any) { + c.errs = append(c.errs, &Error{Pos: pos, Msg: fmt.Sprintf(format, args...)}) +} + +func (c *checker) class(pos Position, name string) { + if _, ok := c.s.lookup(c.m, name).(*ClassAssignment); !ok { + c.errorf(pos, "undefined class %s", name) + } +} + +func (c *checker) typ(t *Type) { + if t == nil { + return + } + + switch t.Kind { + case Reference: + if c.params[t.Name] { + break + } + + ta, ok := c.s.lookup(c.m, t.Name).(*TypeAssignment) + if !ok { + c.errorf(t.Pos, "undefined type %s", t.Name) + break + } + + if len(ta.Params) != len(t.Args) { + c.errorf(t.Pos, "%s takes %d parameters, got %d", t.Name, len(ta.Params), len(t.Args)) + } + + for _, a := range t.Args { + switch { + case a.Value != nil: + c.value(t.Pos, nil, *a.Value) + case a.Type != nil: + c.typ(a.Type) + case a.Set != nil: + c.set(t.Pos, a.Set) + } + } + case ObjectClassField: + ca, ok := c.s.lookup(c.m, t.Name).(*ClassAssignment) + if !ok { + c.errorf(t.Pos, "undefined class %s", t.Name) + } else if ca.Field(t.Field) == nil { + c.errorf(t.Pos, "class %s has no field %s", t.Name, t.Field) + } + case Sequence, Choice: + for _, comp := range t.Components { + c.typ(comp.Type) + } + case SequenceOf: + c.typ(t.Elem) + case Enumerated: + seen := map[string]bool{} + for _, e := range t.Enum { + if seen[e.Name] { + c.errorf(t.Pos, "duplicate enumeration item %s", e.Name) + } + + seen[e.Name] = true + } + } + + c.constraint(t.Pos, t.Range) + c.constraint(t.Pos, t.Size) + c.typ(t.Containing) + + if t.Table != nil && !c.params[t.Table.Set] { + if _, ok := c.s.lookup(c.m, t.Table.Set).(*ObjectSetAssignment); !ok { + c.errorf(t.Pos, "undefined object set %s", t.Table.Set) + } + } +} + +func (c *checker) constraint(pos Position, cs *Constraint) { + if cs == nil { + return + } + + for _, r := range append(append([]Range{}, cs.Root...), cs.Ext...) { + c.value(pos, nil, r.Lower) + c.value(pos, nil, r.Upper) + } +} + +func (c *checker) value(pos Position, governor *Type, v Value) { + c.valueOf(pos, c, governor, v) +} + +func (c *checker) valueOf(pos Position, scope *checker, governor *Type, v Value) { + if !v.IsRef() || c.params[v.Ref] || v.Ref == "MIN" || v.Ref == "MAX" || v.Ref == "TRUE" || v.Ref == "FALSE" { + return + } + + if governor != nil { + if u, err := scope.underlying(governor); err == nil && u.Kind == Enumerated { + for _, e := range u.Enum { + if e.Name == v.Ref { + return + } + } + + c.errorf(pos, "%s is not a literal of %s", v.Ref, governor) + + return + } + } + + if _, ok := c.s.lookup(c.m, v.Ref).(*ValueAssignment); !ok { + c.errorf(pos, "undefined value %s", v.Ref) + } +} + +func (c *checker) underlying(t *Type) (*Type, error) { + for range 64 { + if t.Kind != Reference || len(t.Args) > 0 { + return t, nil + } + + ta, ok := c.s.lookup(c.m, t.Name).(*TypeAssignment) + if !ok { + return nil, fmt.Errorf("undefined type %s", t.Name) + } + + t = ta.Type + } + + return nil, fmt.Errorf("type reference too deep at %s", t.Name) +} + +func (c *checker) set(pos Position, set *ObjectSet) { + for _, e := range append(append([]*SetElement{}, set.Root...), set.Ext...) { + if e.Object != nil { + c.object(e.Object) + continue + } + + if c.params[e.Ref] { + continue + } + + switch c.s.lookup(c.m, e.Ref).(type) { + case *ObjectAssignment, *ObjectSetAssignment: + default: + c.errorf(pos, "undefined object or object set %s", e.Ref) + } + } +} + +func (c *checker) object(o *Object) { + cm, x := c.s.resolve(c.m, o.Class, 0) + + ca, ok := x.(*ClassAssignment) + if !ok { + return + } + + fc := &checker{s: c.s, m: cm} + + for name, st := range o.Settings { + f := ca.Field(name) + + switch { + case st.Type != nil: + c.typ(st.Type) + case st.Value != nil: + c.valueOf(o.Pos, fc, f.Type, *st.Value) + } + } + + for _, f := range ca.Fields { + if _, ok := o.Settings[f.Name]; !ok && !f.Optional && f.Default == nil { + c.errorf(o.Pos, "object of class %s lacks mandatory field %s", ca.Name, f.Name) + } + } +} diff --git a/per/asn1spec/spec_test.go b/per/asn1spec/spec_test.go new file mode 100644 index 0000000000..efdfd105fa --- /dev/null +++ b/per/asn1spec/spec_test.go @@ -0,0 +1,190 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package asn1spec_test + +import ( + "os" + "path/filepath" + "regexp" + "testing" + + "github.com/ellanetworks/core/per/asn1spec" +) + +func countMatches(t *testing.T, dir string, re *regexp.Regexp) int { + t.Helper() + + files, err := filepath.Glob(filepath.Join(dir, "*.asn")) + if err != nil { + t.Fatal(err) + } + + n := 0 + + for _, f := range files { + b, err := os.ReadFile(f) + if err != nil { + t.Fatal(err) + } + + n += len(re.FindAll(b, -1)) + } + + return n +} + +var ( + ieIDAssignment = regexp.MustCompile(`(?m)^\s*id-[A-Za-z0-9-]+\s+ProtocolIE-ID\s*::=`) + procCodeAssignment = regexp.MustCompile(`(?m)^\s*id-[A-Za-z0-9-]+\s+ProcedureCode\s*::=`) + objectSetAssignment = regexp.MustCompile(`(?m)^[A-Za-z0-9-]+\s+[A-Z0-9]+-(PROTOCOL-IES|PROTOCOL-IES-PAIR|PROTOCOL-EXTENSION|ELEMENTARY-PROCEDURE|PRIVATE-IES)\s*::=`) +) + +func TestVendoredSpecs(t *testing.T) { + tests := []struct { + proto string + dir string + modules []string + }{ + {"S1AP", "../../s1ap/testdata/asn1", []string{"S1AP-CommonDataTypes", "S1AP-Constants", "S1AP-Containers", "S1AP-IEs", "S1AP-PDU-Contents", "S1AP-PDU-Descriptions", "SonTransfer-IEs"}}, + {"NGAP", "../../ngap/testdata/asn1", []string{"NGAP-CommonDataTypes", "NGAP-Constants", "NGAP-Containers", "NGAP-IEs", "NGAP-PDU-Contents", "NGAP-PDU-Descriptions"}}, + } + + for _, tt := range tests { + t.Run(tt.proto, func(t *testing.T) { + s, err := asn1spec.ParseFS(os.DirFS(tt.dir), "*.asn") + if err != nil { + t.Fatal(err) + } + + if len(s.Modules) != len(tt.modules) { + t.Fatalf("got %d modules", len(s.Modules)) + } + + for i, name := range tt.modules { + if s.Modules[i].Name != name { + t.Errorf("module %d = %s, want %s", i, s.Modules[i].Name, name) + } + } + + var ieIDs, procCodes, objectSets int + + ids := map[int64]string{} + codes := map[int64]string{} + + for _, m := range s.Modules { + objectSets += len(m.ObjectSets) + len(m.Objects) + + for _, va := range m.Values { + n, err := s.Int(va.Value) + if err != nil { + t.Errorf("%s: %v", va.Name, err) + } + + switch va.Type.Name { + case "ProtocolIE-ID": + ieIDs++ + + if prev, dup := ids[n]; dup { + t.Errorf("ProtocolIE-ID %d assigned to %s and %s", n, prev, va.Name) + } + + ids[n] = va.Name + case "ProcedureCode": + procCodes++ + + if prev, dup := codes[n]; dup { + t.Errorf("ProcedureCode %d assigned to %s and %s", n, prev, va.Name) + } + + codes[n] = va.Name + } + } + + for _, sa := range m.ObjectSets { + objs, err := s.Objects(sa.Set) + if err != nil { + t.Errorf("%s: %v", sa.Name, err) + } + + for _, o := range objs { + if o.Settings == nil { + t.Errorf("%s: unresolved object at %s", sa.Name, o.Pos) + } + } + } + } + + if want := countMatches(t, tt.dir, ieIDAssignment); ieIDs != want { + t.Errorf("parsed %d ProtocolIE-ID values, source has %d", ieIDs, want) + } + + if want := countMatches(t, tt.dir, procCodeAssignment); procCodes != want { + t.Errorf("parsed %d ProcedureCode values, source has %d", procCodes, want) + } + + if want := countMatches(t, tt.dir, objectSetAssignment); objectSets != want { + t.Errorf("parsed %d objects and object sets, source has %d", objectSets, want) + } + + procs := s.ObjectSet(tt.proto + "-ELEMENTARY-PROCEDURES") + if procs == nil { + t.Fatal("no elementary procedure set") + } + + objs, err := s.Objects(procs.Set) + if err != nil { + t.Fatal(err) + } + + seen := map[int64]bool{} + + for _, o := range objs { + v, ok := o.Value("&procedureCode") + if !ok { + t.Fatalf("procedure without code at %s", o.Pos) + } + + n, err := s.Int(v) + if err != nil { + t.Fatal(err) + } + + seen[n] = true + + if o.Type("&InitiatingMessage") == nil { + t.Errorf("procedure %s has no initiating message", v.Ref) + } + } + + if len(seen) != len(objs) || len(objs) != procCodes { + t.Errorf("%d procedures, %d distinct codes, %d code values", len(objs), len(seen), procCodes) + } + }) + } +} + +func TestResolveScoped(t *testing.T) { + s, err := asn1spec.ParseFS(os.DirFS("../../s1ap/testdata/asn1"), "*.asn") + if err != nil { + t.Fatal(err) + } + + son := s.Module("SonTransfer-IEs") + + m, x := s.Resolve(son, "MobilityInformation") + if m != son { + t.Fatalf("MobilityInformation resolved in %v", m) + } + + if ta, ok := x.(*asn1spec.TypeAssignment); !ok || ta != son.Type("MobilityInformation") { + t.Errorf("resolved %v", x) + } + + pc := s.Module("S1AP-PDU-Contents") + + m, _ = s.Resolve(pc, "ProtocolIE-Container") + if m == nil || m.Name != "S1AP-Containers" { + t.Errorf("ProtocolIE-Container resolved in %v", m) + } +} diff --git a/per/cmd/pergen/flags.go b/per/cmd/pergen/flags.go new file mode 100644 index 0000000000..d2d84f227e --- /dev/null +++ b/per/cmd/pergen/flags.go @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package main + +import ( + "errors" + "flag" + "strings" + + "github.com/ellanetworks/core/per/pergen" +) + +func parseFlags(args []string) (pergen.Config, error) { + var cfg pergen.Config + + fs := flag.NewFlagSet("pergen", flag.ContinueOnError) + fs.StringVar(&cfg.Output, "o", "per_gen.go", "output file path") + fs.Var(commaSliceFlag{&cfg.Types}, "type", "comma-separated list of types") + fs.StringVar(&cfg.Profile, "profile", "", "package variable holding the *ap.Profile (application protocol mode)") + fs.StringVar(&cfg.IEID, "ieid", "", "ProtocolIE-ID type (application protocol mode)") + + if err := fs.Parse(args); err != nil { + return cfg, err + } + + switch rest := fs.Args(); len(rest) { + case 0: + cfg.Dir = "." + case 1: + cfg.Dir = rest[0] + default: + return cfg, errors.New("pergen generates one package directory") + } + + return cfg, nil +} + +type commaSliceFlag struct { + p *[]string +} + +func (f commaSliceFlag) String() string { + if f.p == nil || *f.p == nil { + return "" + } + + return strings.Join(*f.p, ",") +} + +func (f commaSliceFlag) Set(s string) error { + if s == "" { + return nil + } + + *f.p = strings.Split(s, ",") + + return nil +} diff --git a/per/cmd/pergen/flags_test.go b/per/cmd/pergen/flags_test.go new file mode 100644 index 0000000000..a8889002ae --- /dev/null +++ b/per/cmd/pergen/flags_test.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package main + +import ( + "slices" + "testing" +) + +func TestParseFlagsDefaults(t *testing.T) { + t.Parallel() + + cfg, err := parseFlags([]string{}) + if err != nil { + t.Fatal(err) + } + + if cfg.Output != "per_gen.go" || cfg.Dir != "." || len(cfg.Types) != 0 || cfg.Profile != "" || cfg.IEID != "" { + t.Fatalf("defaults = %+v", cfg) + } +} + +func TestParseFlagsAll(t *testing.T) { + t.Parallel() + + cfg, err := parseFlags([]string{"-o", "gen.go", "-type", "A,B", "-profile", "profile", "-ieid", "ProtocolIEID", "./pkg"}) + if err != nil { + t.Fatal(err) + } + + if cfg.Output != "gen.go" || cfg.Dir != "./pkg" || !slices.Equal(cfg.Types, []string{"A", "B"}) || cfg.Profile != "profile" || cfg.IEID != "ProtocolIEID" { + t.Fatalf("parsed = %+v", cfg) + } +} + +func TestParseFlagsOneDirectory(t *testing.T) { + t.Parallel() + + if _, err := parseFlags([]string{"./pkg1", "./pkg2"}); err == nil { + t.Fatal("two package directories accepted") + } +} + +func TestParseFlagsTypeEmpty(t *testing.T) { + t.Parallel() + + cfg, err := parseFlags([]string{"-type", ""}) + if err != nil { + t.Fatal(err) + } + + if len(cfg.Types) != 0 { + t.Fatalf("types = %v", cfg.Types) + } +} + +func TestCommaSliceFlag(t *testing.T) { + t.Parallel() + + var vals []string + + f := commaSliceFlag{&vals} + if f.String() != "" { + t.Fatalf("String() = %q", f.String()) + } + + if err := f.Set("A,B,C"); err != nil { + t.Fatal(err) + } + + if len(vals) != 3 || vals[0] != "A" || vals[2] != "C" { + t.Fatalf("vals = %v", vals) + } + + if f.String() != "A,B,C" { + t.Fatalf("String() = %q", f.String()) + } + + if err := f.Set(""); err != nil { + t.Fatal(err) + } + + if len(vals) != 3 { + t.Fatalf("vals after empty Set = %v", vals) + } +} diff --git a/cmd/pergen/main.go b/per/cmd/pergen/main.go similarity index 70% rename from cmd/pergen/main.go rename to per/cmd/pergen/main.go index 8905f2092f..242dc7d31d 100644 --- a/cmd/pergen/main.go +++ b/per/cmd/pergen/main.go @@ -4,8 +4,11 @@ package main import ( + "context" "fmt" "os" + + "github.com/ellanetworks/core/per/pergen" ) func main() { @@ -21,15 +24,10 @@ func run(args []string) error { return err } - pkgs, err := loadPackages(cfg.patterns) + out, err := pergen.Generate(context.Background(), cfg) if err != nil { return err } - g := newGenerator(cfg) - if err := g.generate(pkgs); err != nil { - return err - } - - return g.write() + return os.WriteFile(cfg.Output, out, 0o600) } diff --git a/per/enumerated.go b/per/enumerated.go new file mode 100644 index 0000000000..2b84f0cd1b --- /dev/null +++ b/per/enumerated.go @@ -0,0 +1,72 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package per + +import "fmt" + +type Integer interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 +} + +type Enum[T Integer] struct { + Root []string + Extensible bool + Extension []string +} + +func (e *Enum[T]) extensible() bool { return e.Extensible || len(e.Extension) > 0 } + +func (e *Enum[T]) Encode(w *Writer, enc Encoding, v T) error { + return EncodeEnumerated(w, enc, int64(len(e.Root)), e.extensible(), int64(v)) +} + +func (e *Enum[T]) Decode(r *Reader, enc Encoding) (T, error) { + idx, err := DecodeEnumerated(r, enc, int64(len(e.Root)), e.extensible()) + if err != nil { + return 0, err + } + + if v := T(idx); int64(v) == idx { + return v, nil + } + + return 0, ErrOverflow +} + +func (e *Enum[T]) Known(v T) bool { + return int64(v) >= 0 && int64(v) < int64(len(e.Root)+len(e.Extension)) +} + +func (e *Enum[T]) Name(v T) string { + switch i := int64(v); { + case i >= 0 && i < int64(len(e.Root)): + return e.Root[i] + case i >= int64(len(e.Root)) && i < int64(len(e.Root)+len(e.Extension)): + return e.Extension[i-int64(len(e.Root))] + default: + return fmt.Sprintf("unknown(%d)", i) + } +} + +type ExtensionAlternative struct { + Index int64 + Value string +} + +func (a *ExtensionAlternative) MarshalPER(w *Writer, enc Encoding) error { + if err := EncodeNormallySmall(w, enc, a.Index); err != nil { + return err + } + + return EncodeOpenTypeBytes(w, enc, []byte(a.Value)) +} + +func DecodeExtensionAlternative(r *Reader, enc Encoding, index int64) (*ExtensionAlternative, error) { + b, err := DecodeOpenTypeBytes(r, enc) + if err != nil { + return nil, err + } + + return &ExtensionAlternative{Index: index, Value: string(b)}, nil +} diff --git a/per/errors.go b/per/errors.go index 63607ee354..1fa51d8341 100644 --- a/per/errors.go +++ b/per/errors.go @@ -13,5 +13,6 @@ var ( // ErrUnaligned: an octet-oriented operation on a non-octet-aligned position. ErrUnaligned = errors.New("per: not octet-aligned") // ErrEmpty: a CHOICE or mandatory field has no value set. - ErrEmpty = errors.New("per: no value set") + ErrEmpty = errors.New("per: no value set") + ErrChoice = errors.New("per: CHOICE has more than one alternative set") ) diff --git a/per/extension.go b/per/extension.go index 903107ce6a..a531efd3fe 100644 --- a/per/extension.go +++ b/per/extension.go @@ -3,14 +3,11 @@ package per -type ExtensionAdditions struct { - present []bool - fields []rawBits -} +import "encoding/binary" -type rawBits struct { - data []byte - nbits int +type ExtensionAdditions struct { + present string + fields string } func (e *ExtensionAdditions) Present() bool { return len(e.present) > 0 } @@ -24,8 +21,8 @@ func (e *ExtensionAdditions) MarshalPER(w *Writer, enc Encoding) error { err := EncodeNormallySmallLength(w, enc, int64(len(e.present)), func(count int64) error { end := off + int(count) - for _, p := range e.present[off:end] { - w.WriteBit(p) + for i := off; i < end; i++ { + w.WriteBit(e.present[i] != 0) } off = end @@ -36,19 +33,26 @@ func (e *ExtensionAdditions) MarshalPER(w *Writer, enc Encoding) error { return err } - for _, f := range e.fields { + for rest := e.fields; rest != ""; { + var ( + data string + nbits int + ) + + data, nbits, rest = nextRawBits(rest) + if enc == Aligned { w.AlignToByte() } - w.WriteBitString(f.data, f.nbits) + w.WriteBitString([]byte(data), nbits) } return nil } func (e *ExtensionAdditions) UnmarshalPER(r *Reader, enc Encoding) error { - var present []bool + var present []byte err := DecodeNormallySmallLength(r, enc, func(count int64) error { if int64(r.Bits()) < count { @@ -61,7 +65,11 @@ func (e *ExtensionAdditions) UnmarshalPER(r *Reader, enc Encoding) error { return err } - present = append(present, b) + if b { + present = append(present, 1) + } else { + present = append(present, 0) + } } return nil @@ -70,10 +78,10 @@ func (e *ExtensionAdditions) UnmarshalPER(r *Reader, enc Encoding) error { return err } - var fields []rawBits + var fields []byte for _, p := range present { - if !p { + if p == 0 { continue } @@ -92,10 +100,18 @@ func (e *ExtensionAdditions) UnmarshalPER(r *Reader, enc Encoding) error { return err } - fields = append(fields, rawBits{data: data, nbits: nbits}) + fields = binary.AppendUvarint(fields, uint64(nbits)) + fields = append(fields, data...) } - e.present, e.fields = present, fields + e.present, e.fields = string(present), string(fields) return nil } + +func nextRawBits(s string) (string, int, string) { + n, w := binary.Uvarint([]byte(s[:min(len(s), binary.MaxVarintLen64)])) + end := w + (int(n)+7)/8 + + return s[w:end], int(n), s[end:] +} diff --git a/per/extension_test.go b/per/extension_test.go index 22249e8d17..2d2f242b8f 100644 --- a/per/extension_test.go +++ b/per/extension_test.go @@ -53,8 +53,8 @@ func TestExtensionAdditionsRoundTrip(t *testing.T) { t.Fatalf("%s lead %d: %v", enc, lead, err) } - if !e.Present() || len(e.fields) != 2 { - t.Fatalf("%s lead %d: present %v, %d fields", enc, lead, e.present, len(e.fields)) + if !e.Present() || e.count() != 2 { + t.Fatalf("%s lead %d: present %q, %d fields", enc, lead, e.present, e.count()) } tail, err := r.ReadBits(2) @@ -134,3 +134,45 @@ func TestExtensionAdditionsRejectsZeroLengthBitmap(t *testing.T) { } } } + +func (e *ExtensionAdditions) count() int { + n := 0 + + for rest := e.fields; rest != ""; n++ { + _, _, rest = nextRawBits(rest) + } + + return n +} + +func TestExtensionAdditionsComparable(t *testing.T) { + in := encodeAdditions(t, Aligned, 3, []bool{true, false, true}, [][]byte{{0x01}, {0x02, 0x03}}) + + decode := func() ExtensionAdditions { + r := NewReader(in) + if _, err := r.ReadBits(3); err != nil { + t.Fatal(err) + } + + var e ExtensionAdditions + if err := e.UnmarshalPER(r, Aligned); err != nil { + t.Fatal(err) + } + + return e + } + + a, b := decode(), decode() + if a != b { + t.Fatal("identical additions compare unequal") + } + + if a == (ExtensionAdditions{}) { + t.Fatal("decoded additions equal the zero value") + } + + set := map[ExtensionAdditions]bool{a: true} + if !set[b] { + t.Fatal("additions unusable as a map key") + } +} diff --git a/per/internal/conformance/ngap/ngap_test_types.go b/per/internal/conformance/ngap/ngap_test_types.go index 04aa94621c..622e4fac80 100644 --- a/per/internal/conformance/ngap/ngap_test_types.go +++ b/per/internal/conformance/ngap/ngap_test_types.go @@ -6,7 +6,7 @@ // away, but the PER encoding matches real NGAP for the same field values. package ngaptest -//go:generate sh -c "cd ../../../.. && go run ./cmd/pergen -o per/internal/conformance/ngap/per_gen.go github.com/ellanetworks/core/per/internal/conformance/ngap" +//go:generate go run github.com/ellanetworks/core/per/cmd/pergen // PLMNIdentity holds an MCC/MNC pair in BCD form (TS 38.413 §9.3.3.36). type PLMNIdentity struct { diff --git a/per/internal/conformance/ngap/per_gen.go b/per/internal/conformance/ngap/per_gen.go index d5de4794fc..6e486c0f14 100644 --- a/per/internal/conformance/ngap/per_gen.go +++ b/per/internal/conformance/ngap/per_gen.go @@ -133,11 +133,11 @@ func (nGSetupRequest *NGSetupRequest) UnmarshalPER(r *per.Reader, enc per.Encodi } if p_RANNodeName { var v string - sp, err := per.DecodeString(r, enc) + sp1, err := per.DecodeString(r, enc) if err != nil { return err } - v = string(sp) + v = string(sp1) nGSetupRequest.RANNodeName = &v } if err := (&nGSetupRequest.SupportedTAList).UnmarshalPER(r, enc); err != nil { @@ -157,11 +157,11 @@ func (pLMNIdentity *PLMNIdentity) MarshalPER(w *per.Writer, enc per.Encoding) er } func (pLMNIdentity *PLMNIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - p, err := per.DecodeOctetString(r, enc, 3, 3, true, true, false) + p0, err := per.DecodeOctetString(r, enc, 3, 3, true, true, false) if err != nil { return err } - pLMNIdentity.Value = p + pLMNIdentity.Value = p0 return nil } @@ -195,11 +195,11 @@ func (supportedTAIItem *SupportedTAIItem) UnmarshalPER(r *per.Reader, enc per.En if err := (&supportedTAIItem.PLMN).UnmarshalPER(r, enc); err != nil { return err } - p, err := per.DecodeOctetString(r, enc, 3, 3, true, true, false) + p1, err := per.DecodeOctetString(r, enc, 3, 3, true, true, false) if err != nil { return err } - supportedTAIItem.TAC = p + supportedTAIItem.TAC = p1 return nil } diff --git a/per/internal/conformance/rrc/rrc_test_types.go b/per/internal/conformance/rrc/rrc_test_types.go index f323cf7d18..0c9b7a95fb 100644 --- a/per/internal/conformance/rrc/rrc_test_types.go +++ b/per/internal/conformance/rrc/rrc_test_types.go @@ -5,7 +5,7 @@ // the UNALIGNED PER variant NR-RRC uses (3GPP TS 38.331 §8.1). package rrctest -//go:generate sh -c "cd ../../../.. && go run ./cmd/pergen -o per/internal/conformance/rrc/per_gen.go github.com/ellanetworks/core/per/internal/conformance/rrc" +//go:generate go run github.com/ellanetworks/core/per/cmd/pergen // RRCRelease models the NR-RRC RRCRelease message (TS 38.331 §6.4.2). type RRCRelease struct { diff --git a/per/pergen/ap_test.go b/per/pergen/ap_test.go new file mode 100644 index 0000000000..53fe5dbb78 --- /dev/null +++ b/per/pergen/ap_test.go @@ -0,0 +1,118 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package pergen + +import ( + "go/parser" + "go/token" + "path/filepath" + "strings" + "testing" +) + +func apConfig(dir string) Config { + return Config{Dir: dir, Output: filepath.Join(dir, "per_gen.go"), Profile: "profile", IEID: "ID"} +} + +func TestGenerateApplicationProtocolFixture(t *testing.T) { + out, err := Generate(t.Context(), apConfig("testdata/ap")) + if err != nil { + t.Fatal(err) + } + + if _, err := parser.ParseFile(token.NewFileSet(), "per_gen.go", out, 0); err != nil { + t.Fatalf("generated code does not parse: %v", err) + } + + src := string(out) + + for _, want := range []string{ + "func (kind Kind) MarshalPER(w *per.Writer, enc per.Encoding) error {\n\treturn enumKind.Encode(w, enc, kind)", + "func (kind Kind) Name() string {\n\treturn enumKind.Name(kind)", + "func (kind Kind) Diagnose(*ap.Diagnosis[ID]) bool {\n\treturn !enumKind.Known(kind)", + "var extIEsInner = []ap.IESpec[ID, Inner]{", + "ID: IDThing,", + "ext := ap.ExtensionFields(extIEsInner, inner, inner.ext)", + "ap.DecodeExtensionContainer(profile, r, enc, extIEsInner, inner, &inner.ext)", + "ap.DiagnoseExtensions(d, extIEsInner, inner, inner.ext)", + "*inner = Inner{}", + "inner.add.UnmarshalPER(r, enc)", + "choice.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx)", + "f, err := ap.DecodeSingleContainerValue[ID](profile, r, enc)", + "choice.crit = ap.Wire(f.Criticality, ap.CriticalityReject)", + "if !ap.Comprehended[ID](&v) {", + "choice.Raw = &f", + "return ap.EncodeField(profile, w, enc, ap.FieldValue[ID]{ID: IDThing, Criticality: choice.crit.Of(ap.CriticalityReject), Value: choice.Typed})", + "d.Unknown(choice.Raw.ID, choice.Raw.Criticality)", + "return per.ErrChoice", + "func (list List) Diagnose(d *ap.Diagnosis[ID]) bool {", + "func (inner Inner) Equal(y Inner) bool {", + "(inner.Thing == nil) == (y.Thing == nil) && (inner.Thing == nil || (*inner.Thing) == *y.Thing)", + "inner.ext == y.ext", + "inner.add == y.add", + "(choice.In == nil) == (y.In == nil) && (choice.In == nil || (*choice.In).Equal(*y.In))", + "(choice.Raw == nil) == (y.Raw == nil) && (choice.Raw == nil || (*choice.Raw) == *y.Raw)", + "choice.crit == y.crit", + "func (list List) Equal(y List) bool {", + "if !(list[i].Equal(y[i])) {", + } { + if !strings.Contains(src, want) { + t.Errorf("generated code lacks %q", want) + } + } + + if !strings.Contains(src, "func (choice *Choice) MarshalPER(") || !strings.Contains(src, "\t\treturn per.ErrEmpty\n\t}\n\treturn nil\n}\n\nfunc (choice *Choice) UnmarshalPER(") { + t.Error("a CHOICE with a root alternative that falls through lost its final return") + } + + if !strings.Contains(src, "\t\treturn per.ErrEmpty\n\t}\n}\n\nfunc (container *Container) UnmarshalPER(") { + t.Error("a CHOICE whose every alternative returns ends in unreachable code") + } + + for _, banned := range []string{"SkipOpenType", "RootEnumerated"} { + if strings.Contains(src, banned) { + t.Errorf("generated code drops data through %s", banned) + } + } +} + +func TestGenerateApplicationProtocolRejectsLossyModels(t *testing.T) { + for dir, want := range map[string]string{ + "extseq": "extseq drops extension additions", + "inlineenum": "needs its own per.Enum type", + "handtable": "names a hand-written table", + "choiceraw": "needs a bare extie field", + "equalref": "Hand: Equal: field byName: map[string]uint8 has no Equal method", + } { + t.Run(dir, func(t *testing.T) { + _, err := Generate(t.Context(), apConfig(filepath.Join("testdata/apbad", dir))) + if err == nil || !strings.Contains(err.Error(), want) { + t.Fatalf("err = %v, want %q", err, want) + } + }) + } +} + +func TestParseTagRejectsSkip(t *testing.T) { + if _, err := ParseTag(",skip"); err == nil { + t.Fatal("skip accepted") + } +} + +func TestParseTagApplicationProtocolOptions(t *testing.T) { + tag, err := ParseTag(",extie:IDX,crit:reject,presence:conditional,cond:needsX") + if err != nil { + t.Fatal(err) + } + + if !tag.ExtIE || tag.ExtIEID != "IDX" || tag.Criticality != "reject" || tag.Presence != "conditional" || tag.Condition != "needsX" { + t.Fatalf("parsed %+v", tag) + } + + for _, bad := range []string{",crit:sometimes", ",presence:maybe", ",extie:", ",cond:"} { + if _, err := ParseTag(bad); err == nil { + t.Errorf("%q accepted", bad) + } + } +} diff --git a/cmd/pergen/emit.go b/per/pergen/emit.go similarity index 69% rename from cmd/pergen/emit.go rename to per/pergen/emit.go index f2ffc57497..2e5d44ded4 100644 --- a/cmd/pergen/emit.go +++ b/per/pergen/emit.go @@ -1,11 +1,13 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package main +package pergen import ( + "errors" "fmt" "go/types" + "slices" "strconv" "strings" "unicode" @@ -17,8 +19,11 @@ type structType struct { named *types.Named fields []fieldInfo // extSeq marks the type extensible ("...") with no extension additions. - extSeq bool - extRaw string + extSeq bool + extRaw string + extIEs []fieldInfo + extAlt string + choiceCrit string } // parseStruct classifies each field for emission. Fields tagged `per:"-"` or @@ -28,6 +33,7 @@ func (g *generator) parseStruct(name string, named *types.Named, s *types.Struct for i := 0; i < s.NumFields(); i++ { rawTag := s.Tag(i) + f := s.Field(i) perTag := structTagGet(rawTag, "per") if perTag == "-" { @@ -39,39 +45,187 @@ func (g *generator) parseStruct(name string, named *types.Named, s *types.Struct return nil, err } - if parsed.ExtSeq { + switch { + case parsed.ExtSeq: + if g.apMode() { + return nil, errors.New("extseq drops extension additions: use an extraw field (SEQUENCE) or an extalt field (CHOICE)") + } + st.extSeq = true - continue - } - if parsed.ExtRaw { + continue + case parsed.ExtRaw: if st.extRaw != "" { return nil, fmt.Errorf("%s: more than one extraw field", name) } - st.extRaw = s.Field(i).Name() + if err := g.requireType(f, perImportPath, "ExtensionAdditions", false); err != nil { + return nil, err + } + + st.extRaw = f.Name() + + continue + case parsed.ExtAlt: + if err := g.requireAP(f, "extalt"); err != nil { + return nil, err + } + + if err := g.requireType(f, perImportPath, "ExtensionAlternative", true); err != nil { + return nil, err + } + + st.extAlt = f.Name() + + continue + case parsed.ChoiceCrit: + if err := g.requireAP(f, "choicecrit"); err != nil { + return nil, err + } + + if err := g.requireType(f, apImportPath, "WireCriticality", false); err != nil { + return nil, err + } + + st.choiceCrit = f.Name() + + continue + case parsed.ExtTable != "": + if g.apMode() { + return nil, fmt.Errorf("field %s: exttable:%s names a hand-written table: tag the extensions with extie and use a bare exttable", f.Name(), parsed.ExtTable) + } + + st.fields = append(st.fields, fieldInfo{name: f.Name(), tag: parsed, extTable: parsed.ExtTable, fieldIdx: len(st.fields)}) + + continue + case parsed.ExtTableGenerated: + if err := g.requireAP(f, "exttable"); err != nil { + return nil, err + } + + if err := g.requireType(f, apImportPath, "Preserved", false); err != nil { + return nil, err + } + + st.fields = append(st.fields, fieldInfo{name: f.Name(), tag: parsed, extTable: extTableName(name), genTable: true, fieldIdx: len(st.fields)}) continue } - if parsed.ExtTable != "" { - st.fields = append(st.fields, fieldInfo{name: s.Field(i).Name(), tag: parsed, extTable: parsed.ExtTable, fieldIdx: len(st.fields)}) + if parsed.ExtIE && parsed.ChoiceIdx >= 0 && parsed.ExtIEID == "" { + if err := g.requireAP(f, "extie"); err != nil { + return nil, err + } + + if err := g.requireType(f, apImportPath, "SingleContainer", true); err != nil { + return nil, err + } + + st.fields = append(st.fields, fieldInfo{name: f.Name(), tag: parsed, has: true, rawSingle: true, isOptional: true, fieldIdx: len(st.fields)}) continue } - fi, err := g.classifyField(s.Field(i), rawTag) + fi, err := g.classifyField(f, rawTag) if err != nil { return nil, err } + if parsed.ExtIE { + if err := g.requireAP(f, "extie"); err != nil { + return nil, err + } + + if err := checkExtIE(f, parsed); err != nil { + return nil, err + } + + if parsed.ChoiceIdx < 0 { + if !fi.isOptional { + if _, ok := f.Type().Underlying().(*types.Slice); !ok { + return nil, fmt.Errorf("field %s: an extie extension must be a pointer or a slice", f.Name()) + } + + fi.isOptional = true + fi.noDeref = true + } + + fi.fieldIdx = len(st.fields) + len(st.extIEs) + 1000 + st.extIEs = append(st.extIEs, fi) + + continue + } + } + + if g.apMode() && fi.kind == kindEnum && fi.enumExt { + return nil, fmt.Errorf("field %s: an extensible ENUMERATED needs its own per.Enum type, not an inline tag", f.Name()) + } + + if g.apMode() && fi.tag.Ext && fi.tag.ChoiceIdx < 0 { + return nil, fmt.Errorf("field %s: SEQUENCE extension additions are kept raw: use an extraw field", f.Name()) + } + fi.fieldIdx = len(st.fields) st.fields = append(st.fields, fi) } + if st.extIEs != nil && !slices.ContainsFunc(st.fields, func(fi fieldInfo) bool { return fi.genTable }) { + return nil, errors.New("extie extensions need an exttable field") + } + return st, nil } +func checkExtIE(f *types.Var, t FieldTag) error { + if t.ChoiceIdx >= 0 && t.ExtIEID == "" { + return nil + } + + if t.ExtIEID == "" || t.Criticality == "" { + return fmt.Errorf("field %s: extie needs an id and a crit", f.Name()) + } + + if t.Presence == "conditional" && t.Condition == "" { + return fmt.Errorf("field %s: a conditional extension needs cond", f.Name()) + } + + if t.Condition != "" && t.Presence != "conditional" { + return fmt.Errorf("field %s: cond applies only to presence:conditional", f.Name()) + } + + return nil +} + +func (g *generator) requireAP(f *types.Var, tag string) error { + if !g.apMode() { + return fmt.Errorf("field %s: %s needs application protocol mode (a profile and a ProtocolIE-ID type)", f.Name(), tag) + } + + return nil +} + +func (g *generator) requireType(f *types.Var, pkgPath, name string, pointer bool) error { + t := types.Unalias(f.Type()) + + if pointer { + p, ok := t.(*types.Pointer) + if !ok { + return fmt.Errorf("field %s: want *%s", f.Name(), name) + } + + t = types.Unalias(p.Elem()) + } + + n, ok := t.(*types.Named) + if !ok || n.Origin().Obj().Pkg() == nil || n.Origin().Obj().Pkg().Path() != pkgPath || n.Origin().Obj().Name() != name { + return fmt.Errorf("field %s: want %s.%s, got %s", f.Name(), pkgPath, name, g.goTypeString(f.Type())) + } + + return nil +} + +func extTableName(typeName string) string { return "extIEs" + typeName } + type fieldKind int const ( @@ -117,8 +271,9 @@ type fieldInfo struct { isOptional bool hasDefault bool - isSkip bool extTable string + genTable bool + rawSingle bool // noDeref marks an OPTIONAL field whose absence is a nil slice rather than // a nil pointer, so the value is used without dereferencing. noDeref bool @@ -130,16 +285,12 @@ func (g *generator) classifyField(f *types.Var, rawTag string) (fieldInfo, error fi := fieldInfo{name: f.Name(), typeStr: g.goTypeString(f.Type())} fi.tag, fi.has = perTagFromField(f, rawTag) - ft := f.Type() + ft := types.Unalias(f.Type()) if elem, ok := isPointer(ft); ok { fi.isOptional = true - ft = elem - fi.typeStr = g.goTypeString(ft) - } - - if fi.has && fi.tag.Skip { - fi.isSkip = true + fi.typeStr = g.goTypeString(elem) + ft = types.Unalias(elem) } // A non-pointer OPTIONAL expresses absence as nil-ness, so the Go type must @@ -158,6 +309,18 @@ func (g *generator) classifyField(f *types.Var, rawTag string) (fieldInfo, error fi.hasDefault = true } + if named, ok := isNamed(ft); ok && g.isEnum(named) { + if fi.has && fi.tag.Name == "ENUMERATED" { + return fi, fmt.Errorf("field %s: %s is a per.Enum type: drop the ENUMERATED tag", f.Name(), named.Obj().Name()) + } + + fi.kind = kindDelegate + fi.delegateNamed = named + fi.delegateIsValue = true + + return fi, nil + } + // A named type with a hand-written MarshalPER always delegates, even when // its underlying type would classify as a primitive (e.g. a semantic // integer encoded as an OCTET STRING on the wire). @@ -321,7 +484,7 @@ func (g *generator) boundsExprFromTag(tag FieldTag) string { } func isBasicInt(t types.Type) bool { - b, ok := t.(*types.Basic) + b, ok := types.Unalias(t).(*types.Basic) if !ok { return false } @@ -415,7 +578,7 @@ func isFloat64(t types.Type) bool { } func isNamedInt(t types.Type) *types.Named { - n, ok := t.(*types.Named) + n, ok := types.Unalias(t).(*types.Named) if !ok { return nil } @@ -465,7 +628,7 @@ func isPointer(t types.Type) (elem types.Type, ok bool) { } // isNilable judges named types by their underlying type, so a defined slice -// type such as `type TransportLayerAddress []byte` qualifies. +// type such as `type NASPDU []byte` qualifies. func isNilable(t types.Type) bool { switch t.Underlying().(type) { case *types.Slice, *types.Pointer, *types.Map, *types.Interface: @@ -528,7 +691,7 @@ func hasDeclaredMethod(named *types.Named, name string) bool { // goTypeString spells t as Go source, unqualified for same-package types. func (g *generator) goTypeString(t types.Type) string { return types.TypeString(t, func(p *types.Package) string { - if g.pkg != nil && p.Path() == g.pkg.Types.Path() { + if g.pkg != nil && p.Path() == g.pkg.Path() { return "" } diff --git a/per/pergen/emit_ap.go b/per/pergen/emit_ap.go new file mode 100644 index 0000000000..b4f0cecaf2 --- /dev/null +++ b/per/pergen/emit_ap.go @@ -0,0 +1,459 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package pergen + +import ( + "bytes" + "fmt" + "go/ast" + "go/types" +) + +const apImportPath = "github.com/ellanetworks/core/per/ap" + +type enumInfo struct { + varName string + extensible bool +} + +func (g *generator) collectEnums(names []string) error { + g.enums = make(map[string]enumInfo) + + for _, name := range names { + v, ok := g.pkg.Scope().Lookup(name).(*types.Var) + if !ok { + continue + } + + n, ok := types.Unalias(v.Type()).(*types.Named) + if !ok { + continue + } + + obj := n.Origin().Obj() + if obj.Pkg() == nil || obj.Pkg().Path() != perImportPath || obj.Name() != "Enum" { + continue + } + + arg, ok := types.Unalias(n.TypeArgs().At(0)).(*types.Named) + if !ok || arg.Obj().Pkg() != g.pkg { + return fmt.Errorf("%s: per.Enum must describe a named integer type of this package", name) + } + + typeName := arg.Obj().Name() + if prev, dup := g.enums[typeName]; dup { + return fmt.Errorf("%s: %s is already described by %s", name, typeName, prev.varName) + } + + ext, err := g.enumExtensible(name) + if err != nil { + return err + } + + g.enums[typeName] = enumInfo{varName: name, extensible: ext} + g.genTypes[typeName] = true + } + + return nil +} + +func (g *generator) enumExtensible(varName string) (bool, error) { + for _, f := range g.files { + for _, decl := range f.Decls { + gd, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + + for _, spec := range gd.Specs { + vs, ok := spec.(*ast.ValueSpec) + if !ok { + continue + } + + for i, id := range vs.Names { + if id.Name != varName { + continue + } + + if i >= len(vs.Values) { + return false, fmt.Errorf("%s: per.Enum needs a composite literal", varName) + } + + lit, ok := vs.Values[i].(*ast.CompositeLit) + if !ok { + return false, fmt.Errorf("%s: per.Enum needs a composite literal", varName) + } + + return compositeExtensible(lit), nil + } + } + } + } + + return false, fmt.Errorf("%s: declaration not found", varName) +} + +func compositeExtensible(lit *ast.CompositeLit) bool { + for _, elt := range lit.Elts { + kv, ok := elt.(*ast.KeyValueExpr) + if !ok { + continue + } + + key, ok := kv.Key.(*ast.Ident) + if !ok { + continue + } + + switch key.Name { + case "Extensible": + if v, ok := kv.Value.(*ast.Ident); ok && v.Name == "true" { + return true + } + case "Extension": + if l, ok := kv.Value.(*ast.CompositeLit); ok && len(l.Elts) > 0 { + return true + } + } + } + + return false +} + +func (g *generator) isEnum(n *types.Named) bool { + return n.Obj().Pkg() == g.pkg && g.enums[n.Obj().Name()].varName != "" +} + +func (g *generator) emitEnum(name string, e enumInfo) { + r := &g.buf + recv := g.receiver(name) + + fmt.Fprintf(r, "func (%s %s) MarshalPER(w *per.Writer, enc per.Encoding) error {\n", recv, name) + fmt.Fprintf(r, "\treturn %s.Encode(w, enc, %s)\n}\n\n", e.varName, recv) + fmt.Fprintf(r, "func (%s *%s) UnmarshalPER(r *per.Reader, enc per.Encoding) error {\n", recv, name) + fmt.Fprintf(r, "\tv, err := %s.Decode(r, enc)\n\tif err != nil {\n\t\treturn err\n\t}\n", e.varName) + fmt.Fprintf(r, "\t*%s = v\n\treturn nil\n}\n\n", recv) + fmt.Fprintf(r, "func (%s %s) Name() string {\n\treturn %s.Name(%s)\n}\n\n", recv, name, e.varName, recv) + + if g.apMode() && e.extensible { + g.usesAP = true + + fmt.Fprintf(r, "func (%s %s) Diagnose(*ap.Diagnosis[%s]) bool {\n\treturn !%s.Known(%s)\n}\n\n", recv, name, g.cfg.IEID, e.varName, recv) + } +} + +func (g *generator) sliceTypes(names []string) []string { + var out []string + + for _, name := range names { + nt, ok := g.pkg.Scope().Lookup(name).(*types.TypeName) + if !ok || nt.IsAlias() { + continue + } + + named, ok := nt.Type().(*types.Named) + if !ok || hasDeclaredMethod(named, "Diagnose") { + continue + } + + if _, ok := named.Underlying().(*types.Slice); ok { + out = append(out, name) + } + } + + return out +} + +func (g *generator) emitListDiagnose(name string) { + g.usesAP = true + + r := &g.buf + recv := g.receiver(name) + + fmt.Fprintf(r, "func (%s %s) Diagnose(d *ap.Diagnosis[%s]) bool {\n", recv, name, g.cfg.IEID) + fmt.Fprintf(r, "\tnotComprehended := false\n") + fmt.Fprintf(r, "\tfor i := range %s {\n\t\tif %s[i].Diagnose(d) {\n\t\t\tnotComprehended = true\n\t\t}\n\t}\n", recv, recv) + fmt.Fprintf(r, "\treturn notComprehended\n}\n\n") +} + +func (g *generator) diagnosable(structs map[string]*structType, lists []string) map[string]bool { + diag := make(map[string]bool) + + for name, e := range g.enums { + if e.extensible { + diag[name] = true + } + } + + for name, st := range structs { + if st.extAlt != "" || len(st.extIEs) > 0 { + diag[name] = true + } + + for _, fi := range st.fields { + if fi.genTable || fi.rawSingle || (fi.tag.ExtIE && fi.tag.ChoiceIdx >= 0) { + diag[name] = true + } + } + } + + for changed := true; changed; { + changed = false + + for _, name := range lists { + sl := g.pkg.Scope().Lookup(name).Type().Underlying().(*types.Slice) + if !diag[name] && g.typeDiagnosable(diag, sl.Elem()) { + diag[name] = true + changed = true + } + } + + for name, st := range structs { + if diag[name] { + continue + } + + for _, fi := range st.fields { + if g.fieldDiagnosable(diag, fi) != diagNone { + diag[name] = true + changed = true + + break + } + } + } + } + + return diag +} + +type diagShape uint8 + +const ( + diagNone diagShape = iota + diagValue + diagElems +) + +func (g *generator) fieldDiagnosable(diag map[string]bool, fi fieldInfo) diagShape { + if fi.genTable || fi.rawSingle || fi.extTable != "" { + return diagNone + } + + if fi.kind == kindSequenceOf { + if g.typeDiagnosable(diag, fi.elemType) { + return diagElems + } + + return diagNone + } + + if fi.kind != kindDelegate || fi.delegateNamed == nil { + return diagNone + } + + if g.typeDiagnosable(diag, fi.delegateNamed) { + return diagValue + } + + if sl, ok := fi.delegateNamed.Underlying().(*types.Slice); ok && g.typeDiagnosable(diag, sl.Elem()) { + return diagElems + } + + return diagNone +} + +func (g *generator) typeDiagnosable(diag map[string]bool, t types.Type) bool { + n, ok := types.Unalias(t).(*types.Named) + if !ok { + return false + } + + if n.Obj().Pkg() == g.pkg && diag[n.Obj().Name()] { + return true + } + + return hasDeclaredMethod(n, "Diagnose") +} + +func (g *generator) emitDiagnose(name string, st *structType) { + g.usesAP = true + + r := &g.buf + recv := g.receiver(name) + + fmt.Fprintf(r, "func (%s *%s) Diagnose(d *ap.Diagnosis[%s]) bool {\n", recv, name, g.cfg.IEID) + + if isChoiceType(st) { + g.emitChoiceDiagnose(r, recv, st) + + return + } + + fmt.Fprintf(r, "\tnotComprehended := false\n") + + for _, fi := range st.fields { + expr := recv + "." + fi.name + + if fi.genTable { + fmt.Fprintf(r, "\tap.DiagnoseExtensions(d, %s, %s, %s)\n", fi.extTable, recv, expr) + + continue + } + + switch g.fieldDiagnosable(g.diagTypes, fi) { + case diagValue: + if fi.isOptional && !fi.noDeref { + fmt.Fprintf(r, "\tif %s != nil && %s.Diagnose(d) {\n\t\tnotComprehended = true\n\t}\n", expr, expr) + } else { + fmt.Fprintf(r, "\tif %s.Diagnose(d) {\n\t\tnotComprehended = true\n\t}\n", expr) + } + case diagElems: + slice := expr + if fi.isOptional && !fi.noDeref { + fmt.Fprintf(r, "\tif %s != nil {\n", expr) + + slice = "(*" + expr + ")" + } + + fmt.Fprintf(r, "\tfor i := range %s {\n\t\tif %s[i].Diagnose(d) {\n\t\t\tnotComprehended = true\n\t\t}\n\t}\n", slice, slice) + + if fi.isOptional && !fi.noDeref { + fmt.Fprintf(r, "\t}\n") + } + case diagNone: + } + } + + fmt.Fprintf(r, "\treturn notComprehended\n}\n\n") +} + +func (g *generator) emitChoiceDiagnose(r *bytes.Buffer, recv string, st *structType) { + fmt.Fprintf(r, "\tswitch {\n") + + for _, fi := range st.fields { + expr := recv + "." + fi.name + + fmt.Fprintf(r, "\tcase %s != nil:\n", expr) + + switch { + case fi.rawSingle: + fmt.Fprintf(r, "\t\td.Unknown(%s.ID, %s.Criticality)\n", expr, expr) + case fi.tag.ExtIE: + fmt.Fprintf(r, "\t\td.IE(%s, %s, %s)\n", fi.tag.ExtIEID, g.choiceCritExpr(recv, st, fi), expr) + case g.fieldDiagnosable(g.diagTypes, fi) == diagValue: + fmt.Fprintf(r, "\t\treturn %s.Diagnose(d)\n", expr) + } + } + + if st.extAlt != "" { + fmt.Fprintf(r, "\tcase %s.%s != nil:\n\t\treturn true\n", recv, st.extAlt) + } + + fmt.Fprintf(r, "\t}\n\treturn false\n}\n\n") +} + +func (g *generator) choiceCritExpr(recv string, st *structType, fi fieldInfo) string { + spec := critConst(fi.tag.Criticality) + if st.choiceCrit == "" { + return spec + } + + return recv + "." + st.choiceCrit + ".Of(" + spec + ")" +} + +func critConst(c string) string { + switch c { + case "reject": + return "ap.CriticalityReject" + case "notify": + return "ap.CriticalityNotify" + default: + return "ap.CriticalityIgnore" + } +} + +func presenceConst(p string) string { + switch p { + case "mandatory": + return "ap.PresenceMandatory" + case "conditional": + return "ap.PresenceConditional" + default: + return "ap.PresenceOptional" + } +} + +func (g *generator) emitExtTable(name string, st *structType) { + g.usesAP = true + + r := &g.buf + table := extTableName(name) + + if len(st.extIEs) == 0 { + fmt.Fprintf(r, "var %s []ap.IESpec[%s, %s]\n\n", table, g.cfg.IEID, name) + + return + } + + fmt.Fprintf(r, "var %s = []ap.IESpec[%s, %s]{\n", table, g.cfg.IEID, name) + + for _, fi := range st.extIEs { + expr := "x." + fi.name + + fmt.Fprintf(r, "\t{\n\t\tID: %s,\n\t\tPresence: %s,\n\t\tCriticality: %s,\n", fi.tag.ExtIEID, presenceConst(fi.tag.Presence), critConst(fi.tag.Criticality)) + + if fi.tag.Condition != "" { + fmt.Fprintf(r, "\t\tCondition: %s,\n", fi.tag.Condition) + } + + fmt.Fprintf(r, "\t\tDecode: func(x *%s, r *per.Reader, enc per.Encoding) error {\n", name) + fmt.Fprintf(r, "\t\t\tvar v %s\n", fi.typeStr) + g.emitFieldUnmarshal(r, "v", fi, 2) + + val, absent := "(*"+expr+")", expr+" == nil" + if fi.noDeref { + fmt.Fprintf(r, "\t\t\t%s = v\n\t\t\treturn nil\n\t\t},\n", expr) + + val, absent = expr, "len("+expr+") == 0" + } else { + fmt.Fprintf(r, "\t\t\t%s = &v\n\t\t\treturn nil\n\t\t},\n", expr) + } + + fmt.Fprintf(r, "\t\tEncode: func(x *%s) (per.Marshaler, bool) {\n", name) + fmt.Fprintf(r, "\t\t\tif %s {\n\t\t\t\treturn nil, false\n\t\t\t}\n", absent) + + if fi.kind == kindDelegate { + fmt.Fprintf(r, "\t\t\treturn %s, true\n", expr) + } else { + fmt.Fprintf(r, "\t\t\treturn per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error {\n") + g.emitFieldMarshal(r, "x", fi, val, 3) + fmt.Fprintf(r, "\t\t\t\treturn nil\n\t\t\t}), true\n") + } + + fmt.Fprintf(r, "\t\t},\n\t},\n") + } + + fmt.Fprintf(r, "}\n\n") +} + +func hasGenTable(st *structType) bool { + for _, fi := range st.fields { + if fi.genTable { + return true + } + } + + return false +} + +func (g *generator) receiver(typeName string) string { + recv := receiverName(typeName) + if g.apMode() && recv == typeName { + return "x" + } + + return recv +} diff --git a/cmd/pergen/emit_choice.go b/per/pergen/emit_choice.go similarity index 51% rename from cmd/pergen/emit_choice.go rename to per/pergen/emit_choice.go index d540a9ff46..5886bb0b41 100644 --- a/cmd/pergen/emit_choice.go +++ b/per/pergen/emit_choice.go @@ -1,11 +1,12 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package main +package pergen import ( "bytes" "fmt" + "strings" ) // isChoiceType requires every field to carry a choice: index, so one untagged @@ -32,7 +33,7 @@ type choiceAlt struct { } func (g *generator) emitChoice(name string, s *structType) error { - recv := receiverName(name) + recv := g.receiver(name) var roots, additions []choiceAlt @@ -50,7 +51,7 @@ func (g *generator) emitChoice(name string, s *structType) error { } } - extensible := len(additions) > 0 || s.extSeq + extensible := len(additions) > 0 || s.extSeq || s.extAlt != "" // X.691 §23.2: the index range is 0..n, n being the largest root index. nRoot := int64(0) @@ -63,7 +64,23 @@ func (g *generator) emitChoice(name string, s *structType) error { } } - g.emitHeader(name) + raw := false + + for _, a := range roots { + if a.tag.ExtIE && !a.rawSingle && a.kind != kindDelegate { + return fmt.Errorf("field %s: a choice-Extensions alternative must be a type with its own codec", a.name) + } + + raw = raw || a.rawSingle + } + + for _, a := range roots { + if a.tag.ExtIE && !raw { + return fmt.Errorf("field %s: choice-Extensions needs a bare extie field of type *ap.SingleContainer for unknown alternatives", a.name) + } + } + + g.cur = s g.emitChoiceMarshal(recv, name, roots, additions, extensible, nRoot) g.emitChoiceUnmarshal(recv, name, roots, additions, extensible, nRoot) @@ -73,6 +90,22 @@ func (g *generator) emitChoice(name string, s *structType) error { func (g *generator) emitChoiceMarshal(recv, typeName string, roots, additions []choiceAlt, extensible bool, nRoot int64) { r := &g.buf fmt.Fprintf(r, "func (%s *%s) MarshalPER(w *per.Writer, enc per.Encoding) error {\n", recv, typeName) + + if g.apMode() { + var set []string + + for _, a := range append(append([]choiceAlt{}, roots...), additions...) { + set = append(set, recv+"."+a.name+" != nil") + } + + if g.cur.extAlt != "" { + set = append(set, recv+"."+g.cur.extAlt+" != nil") + } + + fmt.Fprintf(r, "\tset := 0\n\tfor _, ok := range [...]bool{%s} {\n\t\tif ok {\n\t\t\tset++\n\t\t}\n\t}\n", strings.Join(set, ", ")) + fmt.Fprintf(r, "\tif set > 1 {\n\t\treturn per.ErrChoice\n\t}\n") + } + fmt.Fprintf(r, "\tswitch {\n") for _, a := range roots { @@ -89,7 +122,15 @@ func (g *generator) emitChoiceMarshal(recv, typeName string, roots, additions [] fmt.Fprintf(r, "\t\t}\n") } - g.emitFieldMarshal(r, recv, a.fieldInfo, derefExpr(a, expr), 2) + switch { + case a.rawSingle: + fmt.Fprintf(r, "\t\treturn ap.EncodeField(%s, w, enc, %s.Field())\n", g.cfg.Profile, expr) + case a.tag.ExtIE: + fmt.Fprintf(r, "\t\treturn ap.EncodeField(%s, w, enc, ap.FieldValue[%s]{ID: %s, Criticality: %s, Value: %s})\n", + g.cfg.Profile, g.cfg.IEID, a.tag.ExtIEID, g.choiceCritExpr(recv, g.cur, a.fieldInfo), expr) + default: + g.emitFieldMarshal(r, recv, a.fieldInfo, derefExpr(a, expr), 2) + } } for _, a := range additions { @@ -102,16 +143,41 @@ func (g *generator) emitChoiceMarshal(recv, typeName string, roots, additions [] fmt.Fprintf(r, "\t\treturn per.EncodeOpenType(w, enc, %s)\n", expr) } + if g.cur.extAlt != "" { + fmt.Fprintf(r, "\tcase %s.%s != nil:\n", recv, g.cur.extAlt) + fmt.Fprintf(r, "\t\tw.WriteBit(true)\n") + fmt.Fprintf(r, "\t\treturn %s.%s.MarshalPER(w, enc)\n", recv, g.cur.extAlt) + } + fmt.Fprintf(r, "\tdefault:\n") fmt.Fprintf(r, "\t\treturn per.ErrEmpty\n") fmt.Fprintf(r, "\t}\n") - fmt.Fprintf(r, "\treturn nil\n}\n\n") + + if choiceFallsThrough(roots) { + fmt.Fprintf(r, "\treturn nil\n") + } + + fmt.Fprintf(r, "}\n\n") +} + +func choiceFallsThrough(roots []choiceAlt) bool { + for _, a := range roots { + if !a.rawSingle && !a.tag.ExtIE { + return true + } + } + + return false } func (g *generator) emitChoiceUnmarshal(recv, typeName string, roots, additions []choiceAlt, extensible bool, nRoot int64) { r := &g.buf fmt.Fprintf(r, "func (%s *%s) UnmarshalPER(r *per.Reader, enc per.Encoding) error {\n", recv, typeName) + if g.apMode() { + fmt.Fprintf(r, "\t*%s = %s{}\n", recv, typeName) + } + if extensible { fmt.Fprintf(r, "\tisExt, err := r.ReadBit()\n") fmt.Fprintf(r, "\tif err != nil {\n\t\treturn err\n\t}\n") @@ -131,7 +197,15 @@ func (g *generator) emitChoiceUnmarshal(recv, typeName string, roots, additions fmt.Fprintf(r, "\tswitch idx {\n") + var singles []choiceAlt + for _, a := range roots { + if a.tag.ExtIE { + singles = append(singles, a) + + continue + } + expr := recv + "." + a.name fmt.Fprintf(r, "\tcase %d:\n", a.tag.ChoiceIdx) fmt.Fprintf(r, "\t\tvar v %s\n", a.typeStr) @@ -139,13 +213,85 @@ func (g *generator) emitChoiceUnmarshal(recv, typeName string, roots, additions fmt.Fprintf(r, "\t\t%s = &v\n", expr) } + if len(singles) > 0 { + g.emitChoiceSingleDecode(r, recv, singles) + } + fmt.Fprintf(r, "\tdefault:\n") fmt.Fprintf(r, "\t\treturn per.ErrOverflow\n") fmt.Fprintf(r, "\t}\n") fmt.Fprintf(r, "\treturn nil\n}\n\n") } +func (g *generator) emitChoiceSingleDecode(r *bytes.Buffer, recv string, singles []choiceAlt) { + fmt.Fprintf(r, "\tcase %d:\n", singles[0].tag.ChoiceIdx) + fmt.Fprintf(r, "\t\tf, err := ap.DecodeSingleContainerValue[%s](%s, r, enc)\n", g.cfg.IEID, g.cfg.Profile) + fmt.Fprintf(r, "\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n") + fmt.Fprintf(r, "\t\tswitch f.ID {\n") + + var raw string + + for _, a := range singles { + if a.tag.ChoiceIdx != singles[0].tag.ChoiceIdx { + continue + } + + expr := recv + "." + a.name + if a.rawSingle { + raw = expr + + continue + } + + fmt.Fprintf(r, "\t\tcase %s:\n", a.tag.ExtIEID) + fmt.Fprintf(r, "\t\t\tvar v %s\n", a.typeStr) + fmt.Fprintf(r, "\t\t\tif err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n") + fmt.Fprintf(r, "\t\t\tif !ap.Comprehended[%s](&v) {\n\t\t\t\t%s = &f\n\t\t\t\tbreak\n\t\t\t}\n", g.cfg.IEID, rawExpr(recv, singles)) + fmt.Fprintf(r, "\t\t\t%s = &v\n", expr) + + if g.cur.choiceCrit != "" { + fmt.Fprintf(r, "\t\t\t%s.%s = ap.Wire(f.Criticality, %s)\n", recv, g.cur.choiceCrit, critConst(a.tag.Criticality)) + } + } + + fmt.Fprintf(r, "\t\tdefault:\n") + + fmt.Fprintf(r, "\t\t\t%s = &f\n", raw) + + fmt.Fprintf(r, "\t\t}\n") +} + func (g *generator) emitChoiceExtDecode(r *bytes.Buffer, recv string, additions []choiceAlt) { + if g.cur.extAlt != "" { + fmt.Fprintf(r, "\t\textIdx, err := per.DecodeNormallySmall(r, enc)\n") + fmt.Fprintf(r, "\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n") + + if len(additions) == 0 { + fmt.Fprintf(r, "\t\t%s.%s, err = per.DecodeExtensionAlternative(r, enc, extIdx)\n", recv, g.cur.extAlt) + fmt.Fprintf(r, "\t\treturn err\n") + + return + } + + fmt.Fprintf(r, "\t\tswitch extIdx {\n") + + for _, a := range additions { + expr := recv + "." + a.name + fmt.Fprintf(r, "\t\tcase %d:\n", a.extIdx) + fmt.Fprintf(r, "\t\t\tvar v %s\n", a.typeStr) + fmt.Fprintf(r, "\t\t\tif err := per.DecodeOpenType(r, enc, &v); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n") + fmt.Fprintf(r, "\t\t\t%s = &v\n", expr) + } + + fmt.Fprintf(r, "\t\tdefault:\n") + fmt.Fprintf(r, "\t\t\t%s.%s, err = per.DecodeExtensionAlternative(r, enc, extIdx)\n", recv, g.cur.extAlt) + fmt.Fprintf(r, "\t\t\treturn err\n") + fmt.Fprintf(r, "\t\t}\n") + fmt.Fprintf(r, "\t\treturn nil\n") + + return + } + if len(additions) == 0 { fmt.Fprintf(r, "\t\tif _, err := per.DecodeNormallySmall(r, enc); err != nil {\n") fmt.Fprintf(r, "\t\t\treturn err\n") @@ -180,3 +326,13 @@ func derefExpr(a choiceAlt, expr string) string { return expr } + +func rawExpr(recv string, singles []choiceAlt) string { + for _, a := range singles { + if a.rawSingle { + return recv + "." + a.name + } + } + + return "" +} diff --git a/per/pergen/emit_equal.go b/per/pergen/emit_equal.go new file mode 100644 index 0000000000..bf67592697 --- /dev/null +++ b/per/pergen/emit_equal.go @@ -0,0 +1,320 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package pergen + +import ( + "fmt" + "go/types" + "slices" + "sort" + "strings" +) + +func (g *generator) equalTypes(structs map[string]*structType, names []string) []string { + eq := make(map[string]bool) + + for _, name := range names { + named, ok := g.localNamed(name) + if !ok || g.hasEqual(named) { + continue + } + + switch u := named.Underlying().(type) { + case *types.Struct: + if structs[name] != nil || g.isMessage(named) || hasDeclaredMethod(named, "MarshalPER") { + eq[name] = true + } + case *types.Slice: + if n, ok := types.Unalias(u.Elem()).(*types.Named); ok && (g.implementsMarshalPER(n) || hasDeclaredMethod(named, "MarshalPER")) { + eq[name] = true + } + } + } + + g.eqTypes = eq + + for changed := true; changed; { + changed = false + + for _, name := range sortedKeys(eq) { + named, _ := g.localNamed(name) + + for _, t := range componentTypes(named.Underlying()) { + n, ok := g.localNeedingEqual(t) + if ok && !eq[n] { + eq[n] = true + changed = true + } + } + } + } + + return sortedKeys(eq) +} + +func sortedKeys(m map[string]bool) []string { + out := make([]string, 0, len(m)) + for k := range m { + out = append(out, k) + } + + sort.Strings(out) + + return out +} + +func componentTypes(t types.Type) []types.Type { + switch u := t.(type) { + case *types.Struct: + out := make([]types.Type, 0, u.NumFields()) + for i := 0; i < u.NumFields(); i++ { + out = append(out, u.Field(i).Type()) + } + + return out + case *types.Slice: + return []types.Type{u.Elem()} + default: + return nil + } +} + +func (g *generator) localNeedingEqual(t types.Type) (string, bool) { + for { + t = types.Unalias(t) + + if p, ok := t.(*types.Pointer); ok { + t = p.Elem() + + continue + } + + if s, ok := t.(*types.Slice); ok { + t = s.Elem() + + continue + } + + break + } + + n, ok := t.(*types.Named) + if !ok || n.Obj().Pkg() != g.pkg || n.TypeArgs().Len() > 0 || g.hasEqual(n) || refFree(n) { + return "", false + } + + switch n.Underlying().(type) { + case *types.Struct, *types.Slice: + return n.Obj().Name(), true + default: + return "", false + } +} + +func (g *generator) localNamed(name string) (*types.Named, bool) { + nt, ok := g.pkg.Scope().Lookup(name).(*types.TypeName) + if !ok || nt.IsAlias() { + return nil, false + } + + named, ok := nt.Type().(*types.Named) + if !ok || named.TypeParams().Len() > 0 { + return nil, false + } + + return named, true +} + +func (g *generator) hasEqual(n *types.Named) bool { + if n.Obj().Pkg() == g.pkg && g.eqTypes[n.Obj().Name()] { + return true + } + + sel := types.NewMethodSet(types.NewPointer(n)).Lookup(n.Obj().Pkg(), "Equal") + if sel == nil { + return false + } + + sig, ok := sel.Type().(*types.Signature) + if !ok || sig.Params().Len() != 1 || sig.Results().Len() != 1 { + return false + } + + res, ok := sig.Results().At(0).Type().(*types.Basic) + + return ok && res.Kind() == types.Bool && types.Identical(sig.Params().At(0).Type(), n) +} + +func refFree(t types.Type) bool { + switch u := t.Underlying().(type) { + case *types.Basic: + return u.Kind() != types.UnsafePointer && u.Kind() != types.UntypedNil + case *types.Array: + return refFree(u.Elem()) + case *types.Struct: + for i := 0; i < u.NumFields(); i++ { + if !refFree(u.Field(i).Type()) { + return false + } + } + + return true + default: + return false + } +} + +func (g *generator) emitEqual(name string) error { + named, _ := g.localNamed(name) + r := &g.buf + recv := g.receiver(name) + + other := "y" + if recv == other { + other = "z" + } + + if refFree(named) { + fmt.Fprintf(r, "func (%s %s) Equal(%s %s) bool {\n\treturn %s == %s\n}\n\n", recv, name, other, name, recv, other) + + return nil + } + + switch u := named.Underlying().(type) { + case *types.Struct: + var conds []string + + for i := 0; i < u.NumFields(); i++ { + f := u.Field(i) + if f.Name() == "_" { + continue + } + + a, b := recv+"."+f.Name(), other+"."+f.Name() + + cond, err := g.equalExpr(f.Type(), a, b) + if err != nil { + return fmt.Errorf("field %s: %w", f.Name(), err) + } + + if g.absentWhenNil(f, u.Tag(i)) { + cond = fmt.Sprintf("(%s == nil) == (%s == nil) && %s", a, b, cond) + } + + conds = append(conds, cond) + } + + if len(conds) == 0 { + conds = []string{"true"} + } + + fmt.Fprintf(r, "func (%s %s) Equal(%s %s) bool {\n\treturn %s\n}\n\n", recv, name, other, name, strings.Join(conds, " &&\n\t\t")) + case *types.Slice: + cond, err := g.equalExpr(u.Elem(), recv+"[i]", other+"[i]") + if err != nil { + return err + } + + fmt.Fprintf(r, "func (%s %s) Equal(%s %s) bool {\n", recv, name, other, name) + fmt.Fprintf(r, "\tif len(%s) != len(%s) {\n\t\treturn false\n\t}\n", recv, other) + fmt.Fprintf(r, "\tfor i := range %s {\n\t\tif !(%s) {\n\t\t\treturn false\n\t\t}\n\t}\n", recv, cond) + fmt.Fprintf(r, "\treturn true\n}\n\n") + default: + return fmt.Errorf("no Equal for %s", g.goTypeString(named)) + } + + return nil +} + +func (g *generator) absentWhenNil(f *types.Var, rawTag string) bool { + if _, ok := types.Unalias(f.Type()).Underlying().(*types.Slice); !ok { + return false + } + + tag, err := ParseTag(structTagGet(rawTag, "per")) + + return err == nil && tag.Optional +} + +func (g *generator) equalExpr(t types.Type, a, b string) (string, error) { + t = types.Unalias(t) + + if n, ok := t.(*types.Named); ok && g.hasEqual(n) { + return a + ".Equal(" + b + ")", nil + } + + if refFree(t) && types.Comparable(t) { + return a + " == " + b, nil + } + + switch u := t.Underlying().(type) { + case *types.Pointer: + inner, err := g.equalExpr(u.Elem(), "(*"+a+")", "*"+b) + if err != nil { + return "", err + } + + return fmt.Sprintf("(%s == nil) == (%s == nil) && (%s == nil || %s)", a, b, a, inner), nil + case *types.Slice: + elem := types.Unalias(u.Elem()) + if refFree(elem) && types.Comparable(elem) { + g.imports = appendUnique(g.imports, "slices") + + return "slices.Equal(" + a + ", " + b + ")", nil + } + + if n, ok := elem.(*types.Named); ok && n.Obj().Pkg() == g.pkg && g.eqTypes[n.Obj().Name()] { + g.imports = appendUnique(g.imports, "slices") + + return "slices.EqualFunc(" + a + ", " + b + ", " + n.Obj().Name() + ".Equal)", nil + } + + inner, err := g.equalExpr(elem, "v1", "v2") + if err != nil { + return "", err + } + + elemStr, err := g.typeRef(elem) + if err != nil { + return "", err + } + + g.imports = appendUnique(g.imports, "slices") + + return fmt.Sprintf("slices.EqualFunc(%s, %s, func(v1, v2 %s) bool { return %s })", a, b, elemStr, inner), nil + default: + return "", fmt.Errorf("%s has no Equal method and holds references, so == does not compare its value", g.goTypeString(t)) + } +} + +func (g *generator) typeRef(t types.Type) (string, error) { + var foreign []string + + s := types.TypeString(t, func(p *types.Package) string { + switch { + case g.pkg != nil && p.Path() == g.pkg.Path(): + return "" + case p.Path() == apImportPath: + g.usesAP = true + case p.Path() != perImportPath: + foreign = append(foreign, p.Path()) + } + + return p.Name() + }) + + if len(foreign) > 0 { + return "", fmt.Errorf("%s names package %s, which per_gen.go does not import", s, foreign[0]) + } + + return s, nil +} + +func appendUnique(list []string, s string) []string { + if slices.Contains(list, s) { + return list + } + + return append(list, s) +} diff --git a/cmd/pergen/emit_struct.go b/per/pergen/emit_struct.go similarity index 86% rename from cmd/pergen/emit_struct.go rename to per/pergen/emit_struct.go index a535161369..883587ebe8 100644 --- a/cmd/pergen/emit_struct.go +++ b/per/pergen/emit_struct.go @@ -1,24 +1,19 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package main +package pergen import ( "bytes" - "errors" "fmt" - "go/format" "go/types" - "os" - "path/filepath" - "strconv" "strings" ) // emitStruct emits the codec for a SEQUENCE or SET. A SET with AUTOMATIC // tagging encodes in declaration order (X.691 §21), identical to a SEQUENCE. func (g *generator) emitStruct(name string, s *structType) error { - recv := receiverName(name) + recv := g.receiver(name) fields := s.fields var rootFields, extFields []fieldInfo @@ -33,6 +28,10 @@ func (g *generator) emitStruct(name string, s *structType) error { extensible := len(extFields) > 0 || s.extSeq || s.extRaw != "" + if hasGenTable(s) { + g.usesAP = true + } + if s.extRaw != "" && len(extFields) > 0 { return fmt.Errorf("%s: extraw cannot be combined with modeled extension additions", name) } @@ -41,26 +40,19 @@ func (g *generator) emitStruct(name string, s *structType) error { var optionalIdx []int for i, fi := range rootFields { - if fi.isOptional || fi.hasDefault || fi.isSkip || fi.extTable != "" { + if fi.isOptional || fi.hasDefault || fi.extTable != "" || fi.tag.ExtTableGenerated { optionalIdx = append(optionalIdx, i) } } - g.emitHeader(name) g.emitMarshalExt(recv, name, rootFields, extFields, optionalIdx, extensible, s.extRaw) g.emitUnmarshalExt(recv, name, rootFields, extFields, optionalIdx, extensible, s.extRaw) - return nil -} - -// emitHeader writes the file preamble once per package. -func (g *generator) emitHeader(_ string) { - if g.buf.Len() == 0 { - g.buf.WriteString("// Code generated by pergen. DO NOT EDIT.\n\n") - g.buf.WriteString("//go:build !ignore\n\n") - g.buf.WriteString("package " + g.pkg.Name + "\n\n") - g.buf.WriteString("import \"" + perImportPath + "\"\n\n") + if hasGenTable(s) { + g.emitExtTable(name, s) } + + return nil } func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields []fieldInfo, optionalIdx []int, extensible bool, extRaw string) { @@ -68,7 +60,10 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields fmt.Fprintf(r, "func (%s *%s) MarshalPER(w *per.Writer, enc per.Encoding) error {\n", recv, typeName) for _, fi := range rootFields { - if fi.extTable != "" { + switch { + case fi.genTable: + fmt.Fprintf(r, "\text := ap.ExtensionFields(%s, %s, %s.%s)\n", fi.extTable, recv, recv, fi.name) + case fi.extTable != "": fmt.Fprintf(r, "\text := extensionFields(%s, %s, &%s.%s)\n", fi.extTable, recv, recv, fi.name) } } @@ -92,8 +87,6 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields switch { case fi.extTable != "": fmt.Fprintf(r, "\tw.WriteBit(len(ext) > 0)\n") - case fi.isSkip: - fmt.Fprintf(r, "\tw.WriteBit(false)\n") case fi.isOptional: fmt.Fprintf(r, "\tw.WriteBit(%s != nil)\n", expr) case fi.hasDefault: @@ -105,12 +98,14 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields fi := rootFields[i] expr := recv + "." + fi.name - if fi.extTable != "" { + if fi.genTable { + fmt.Fprintf(r, "\tif len(ext) > 0 {\n") + fmt.Fprintf(r, "\t\tif err := ap.EncodeExtensionContainer(%s, w, enc, ext); err != nil {\n\t\t\treturn err\n\t\t}\n", g.cfg.Profile) + fmt.Fprintf(r, "\t}\n") + } else if fi.extTable != "" { fmt.Fprintf(r, "\tif len(ext) > 0 {\n") fmt.Fprintf(r, "\t\tif err := encodeExtensionContainer(w, enc, ext); err != nil {\n\t\t\treturn err\n\t\t}\n") fmt.Fprintf(r, "\t}\n") - } else if fi.isSkip { - continue } else if fi.isOptional { valExpr := "(*" + expr + ")" if fi.noDeref { @@ -216,17 +211,12 @@ func (g *generator) emitFieldMarshal(r *bytes.Buffer, _ string, fi fieldInfo, ex fmt.Fprintf(r, "%s\treturn err\n", prefix) fmt.Fprintf(r, "%s}\n", prefix) case kindEnum: - // An extensible ENUMERATED without extvalues: goes through - // encodeRootEnumerated, which refuses a value outside the root instead - // of emitting it as an extension addition 3GPP has not defined. switch { case fi.enumTotal > 0: fmt.Fprintf(r, "%sif v := int64(%s); v < 0 || v >= %d {\n%s\treturn per.ErrOverflow\n%s}\n", prefix, expr, fi.enumTotal, prefix, prefix) fmt.Fprintf(r, "%sif err := per.EncodeEnumerated(w, enc, %d, true, int64(%s)); err != nil {\n", prefix, fi.enumRoot, expr) - case fi.enumExt: - fmt.Fprintf(r, "%sif err := encodeRootEnumerated(w, enc, %d, int64(%s), %q); err != nil {\n", prefix, fi.enumRoot, expr, fi.typeStr) default: - fmt.Fprintf(r, "%sif err := per.EncodeEnumerated(w, enc, %d, false, int64(%s)); err != nil {\n", prefix, fi.enumRoot, expr) + fmt.Fprintf(r, "%sif err := per.EncodeEnumerated(w, enc, %d, %t, int64(%s)); err != nil {\n", prefix, fi.enumRoot, fi.enumExt, expr) } fmt.Fprintf(r, "%s\treturn err\n", prefix) @@ -320,6 +310,10 @@ func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extField r := &g.buf fmt.Fprintf(r, "func (%s *%s) UnmarshalPER(r *per.Reader, enc per.Encoding) error {\n", recv, typeName) + if g.apMode() { + fmt.Fprintf(r, "\t*%s = %s{}\n", recv, typeName) + } + if extensible { fmt.Fprintf(r, "\textBit, err := r.ReadBit()\n") fmt.Fprintf(r, "\tif err != nil {\n\t\treturn err\n\t}\n") @@ -335,15 +329,13 @@ func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extField fi := rootFields[i] expr := recv + "." + fi.name - if fi.extTable != "" { + if fi.genTable { fmt.Fprintf(r, "\tif %s {\n", preambleVar(fi)) - fmt.Fprintf(r, "\t\tif err := decodeExtensionContainer(r, enc, %s, %s, &%s); err != nil {\n\t\t\treturn err\n\t\t}\n", fi.extTable, recv, expr) + fmt.Fprintf(r, "\t\tif err := ap.DecodeExtensionContainer(%s, r, enc, %s, %s, &%s); err != nil {\n\t\t\treturn err\n\t\t}\n", g.cfg.Profile, fi.extTable, recv, expr) fmt.Fprintf(r, "\t}\n") - } else if fi.isSkip { + } else if fi.extTable != "" { fmt.Fprintf(r, "\tif %s {\n", preambleVar(fi)) - fmt.Fprintf(r, "\t\tvar v %s\n", fi.typeStr) - g.emitFieldUnmarshal(r, "v", fi, 1) - fmt.Fprintf(r, "\t\t_ = v\n") + fmt.Fprintf(r, "\t\tif err := decodeExtensionContainer(r, enc, %s, %s, &%s); err != nil {\n\t\t\treturn err\n\t\t}\n", fi.extTable, recv, expr) fmt.Fprintf(r, "\t}\n") } else if fi.isOptional { fmt.Fprintf(r, "\tif %s {\n", preambleVar(fi)) @@ -449,17 +441,11 @@ func (g *generator) emitFieldUnmarshal(r *bytes.Buffer, target string, fi fieldI fmt.Fprintf(r, "%sif err != nil {\n%s\treturn err\n%s}\n", prefix, prefix, prefix) fmt.Fprintf(r, "%s%s = %s(n%d)\n", prefix, target, fi.typeStr, fi.fieldIdx) case kindEnum: - // An extensible ENUMERATED without extvalues: goes through - // decodeRootEnumerated, which refuses an extension addition rather than - // let nRoot+k narrow back onto a root value in the enumeration's small - // Go type. switch { case fi.enumTotal > 0: fmt.Fprintf(r, "%se%d, err := per.DecodeEnumerated(r, enc, %d, true)\n", prefix, fi.fieldIdx, fi.enumRoot) - case fi.enumExt: - fmt.Fprintf(r, "%se%d, err := decodeRootEnumerated(r, enc, %d, %q)\n", prefix, fi.fieldIdx, fi.enumRoot, fi.typeStr) default: - fmt.Fprintf(r, "%se%d, err := per.DecodeEnumerated(r, enc, %d, false)\n", prefix, fi.fieldIdx, fi.enumRoot) + fmt.Fprintf(r, "%se%d, err := per.DecodeEnumerated(r, enc, %d, %t)\n", prefix, fi.fieldIdx, fi.enumRoot, fi.enumExt) } fmt.Fprintf(r, "%sif err != nil {\n%s\treturn err\n%s}\n", prefix, prefix, prefix) @@ -532,57 +518,3 @@ func (g *generator) emitSequenceOfUnmarshal(r *bytes.Buffer, fi fieldInfo, targe fmt.Fprintf(r, "%s\treturn err\n", prefix) fmt.Fprintf(r, "%s}\n", prefix) } - -func (g *generator) formatOutput() ([]byte, error) { - if g.buf.Len() == 0 { - return nil, errors.New("no generated code") - } - - formatted, err := format.Source(g.buf.Bytes()) - if err != nil { - return g.buf.Bytes(), fmt.Errorf("format: %w", err) - } - - return formatted, nil -} - -func (g *generator) write() error { - if g.pkg == nil { - return errors.New("no package loaded") - } - - if g.buf.Len() == 0 { - return errors.New("nothing generated") - } - - out, err := g.formatOutput() - if err != nil { - // Unformatted output is still written, so a syntax defect can be read. - out = g.buf.Bytes() - } - - wd, err := os.Getwd() - if err != nil { - return err - } - - absPath, err := filepath.Abs(g.cfg.output) - if err != nil { - return err - } - - rel, err := filepath.Rel(wd, absPath) - if err != nil { - return err - } - - if strings.HasPrefix(rel, "..") { - return fmt.Errorf("output path escapes working directory: %s", g.cfg.output) - } - - // #nosec G703: the output path is validated above to sit under the - // working directory, so this cannot traverse outside it. - return os.WriteFile(absPath, out, 0o600) -} - -var _ = strconv.Itoa diff --git a/cmd/pergen/emit_struct_test.go b/per/pergen/emit_struct_test.go similarity index 99% rename from cmd/pergen/emit_struct_test.go rename to per/pergen/emit_struct_test.go index b5ea1ef9ba..34535540c7 100644 --- a/cmd/pergen/emit_struct_test.go +++ b/per/pergen/emit_struct_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package main +package pergen import ( "bytes" diff --git a/per/pergen/gen.go b/per/pergen/gen.go new file mode 100644 index 0000000000..d29c62ea59 --- /dev/null +++ b/per/pergen/gen.go @@ -0,0 +1,402 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package pergen + +import ( + "bytes" + "context" + "errors" + "fmt" + "go/ast" + "go/format" + "go/token" + "go/types" + "path/filepath" + "slices" + "sort" + "strings" +) + +type Config struct { + Dir string + Output string + Types []string + Profile string + IEID string +} + +func Generate(ctx context.Context, cfg Config) ([]byte, error) { + g, err := run(ctx, cfg) + if err != nil { + return nil, err + } + + return g.output() +} + +func Undiagnosed(ctx context.Context, cfg Config) ([]string, error) { + if cfg.Profile == "" { + return nil, errors.New("undiagnosed types are an application protocol mode check") + } + + g, err := run(ctx, cfg) + if err != nil { + return nil, err + } + + return g.undiagnosed(), nil +} + +func run(ctx context.Context, cfg Config) (*generator, error) { + if cfg.Dir == "" { + cfg.Dir = "." + } + + if cfg.Output == "" { + cfg.Output = "per_gen.go" + } + + if (cfg.Profile == "") != (cfg.IEID == "") { + return nil, errors.New("application protocol mode needs both a profile and a ProtocolIE-ID type") + } + + dir, err := filepath.Abs(cfg.Dir) + if err != nil { + return nil, err + } + + out, err := filepath.Abs(cfg.Output) + if err != nil { + return nil, err + } + + exclude := "" + if filepath.Dir(out) == dir { + exclude = filepath.Base(out) + } + + pkg, err := load(ctx, dir, exclude) + if err != nil { + return nil, err + } + + g := &generator{cfg: cfg, pkg: pkg.types, fset: pkg.fset, files: pkg.files} + if err := g.generatePackage(); err != nil { + return nil, err + } + + return g, nil +} + +func (g *generator) undiagnosed() []string { + var out []string + + for _, name := range g.pkg.Scope().Names() { + nt, ok := g.pkg.Scope().Lookup(name).(*types.TypeName) + if !ok || nt.IsAlias() || g.diagTypes[name] { + continue + } + + named, ok := nt.Type().(*types.Named) + if !ok || hasDeclaredMethod(named, "Diagnose") || g.isMessage(named) { + continue + } + + var holds []types.Type + + switch u := named.Underlying().(type) { + case *types.Struct: + for i := 0; i < u.NumFields(); i++ { + holds = append(holds, u.Field(i).Type()) + } + case *types.Slice: + holds = append(holds, u.Elem()) + } + + for _, t := range holds { + if p, ok := t.(*types.Pointer); ok { + t = p.Elem() + } + + if sl, ok := t.(*types.Slice); ok { + t = sl.Elem() + } + + if g.typeDiagnosable(g.diagTypes, t) { + out = append(out, name) + + break + } + } + } + + sort.Strings(out) + + return out +} + +type generator struct { + cfg Config + buf bytes.Buffer + pkg *types.Package + fset *token.FileSet + files []*ast.File + + genTypes map[string]bool + enums map[string]enumInfo + diagTypes map[string]bool + eqTypes map[string]bool + imports []string + usesAP bool + cur *structType +} + +func (g *generator) apMode() bool { return g.cfg.Profile != "" } + +func (g *generator) generatePackage() error { + scope := g.pkg.Scope() + names := slices.Clone(scope.Names()) + sort.Strings(names) + + g.genTypes = make(map[string]bool) + + if err := g.collectEnums(names); err != nil { + return err + } + + for _, name := range names { + underlying, ok := g.localStruct(name) + if !ok { + continue + } + + if structIsPER(underlying) || structIsExtSeq(underlying) { + g.genTypes[name] = true + } + } + + g.collectReferencedStructs(scope) + + structs := make(map[string]*structType) + + for _, name := range names { + if !g.genTypes[name] || g.enums[name].varName != "" || !g.typeEnabled(name) { + continue + } + + underlying, _ := g.localStruct(name) + + st, err := g.parseStruct(name, scope.Lookup(name).Type().(*types.Named), underlying) + if err != nil { + return fmt.Errorf("%s: %w", name, err) + } + + structs[name] = st + } + + var lists []string + + if g.apMode() { + lists = g.sliceTypes(names) + g.diagTypes = g.diagnosable(structs, lists) + } + + found := false + + for _, name := range names { + if e, ok := g.enums[name]; ok && g.typeEnabled(name) { + found = true + + g.emitEnum(name, e) + + continue + } + + st, ok := structs[name] + if !ok { + continue + } + + found = true + + var err error + + if isChoiceType(st) { + err = g.emitChoice(name, st) + } else { + err = g.emitStruct(name, st) + } + + if err != nil { + return fmt.Errorf("%s: %w", name, err) + } + + if g.diagTypes[name] { + g.emitDiagnose(name, st) + } + } + + for _, name := range lists { + if g.diagTypes[name] && g.typeEnabled(name) { + g.emitListDiagnose(name) + } + } + + if g.apMode() { + for _, name := range g.equalTypes(structs, names) { + if !g.typeEnabled(name) { + continue + } + + if err := g.emitEqual(name); err != nil { + return fmt.Errorf("%s: Equal: %w", name, err) + } + } + } + + if !found { + return fmt.Errorf("no types with `per:` tags found in package %s", g.pkg.Name()) + } + + return nil +} + +func (g *generator) localStruct(name string) (*types.Struct, bool) { + nt, ok := g.pkg.Scope().Lookup(name).(*types.TypeName) + if !ok || nt.IsAlias() { + return nil, false + } + + named, ok := nt.Type().(*types.Named) + if !ok { + return nil, false + } + + s, ok := named.Underlying().(*types.Struct) + + return s, ok +} + +func (g *generator) collectReferencedStructs(scope *types.Scope) { + changed := true + for changed { + changed = false + + for name := range g.genTypes { + underlying, ok := g.localStruct(name) + if !ok { + continue + } + + for i := 0; i < underlying.NumFields(); i++ { + if tag := structTagGet(underlying.Tag(i), "per"); tag == "-" || strings.Contains(tag, "exttable") || strings.Contains(tag, "extalt") { + continue + } + + ft := underlying.Field(i).Type() + if p, ok := ft.(*types.Pointer); ok { + ft = p.Elem() + } + + if s, ok := ft.(*types.Slice); ok { + ft = s.Elem() + } + + n, ok := ft.(*types.Named) + if !ok || n.Obj().Pkg() != g.pkg || hasDeclaredMethod(n, "MarshalPER") { + continue + } + + if _, isStruct := n.Underlying().(*types.Struct); isStruct && !g.genTypes[n.Obj().Name()] { + g.genTypes[n.Obj().Name()] = true + changed = true + } + } + } + } + + _ = scope +} + +func structIsPER(s *types.Struct) bool { + for i := 0; i < s.NumFields(); i++ { + tag := structTagGet(s.Tag(i), "per") + if tag == "" || tag == "-" { + continue + } + + return true + } + + return false +} + +func structIsExtSeq(s *types.Struct) bool { + for i := 0; i < s.NumFields(); i++ { + if structTagGet(s.Tag(i), "per") == "extseq" { + return true + } + } + + return false +} + +func (g *generator) typeEnabled(name string) bool { + if len(g.cfg.Types) == 0 { + return true + } + + return slices.Contains(g.cfg.Types, name) +} + +func (g *generator) output() ([]byte, error) { + if g.buf.Len() == 0 { + return nil, errors.New("no generated code") + } + + var head bytes.Buffer + + head.WriteString("// Code generated by pergen. DO NOT EDIT.\n\n") + head.WriteString("//go:build !ignore\n\n") + head.WriteString("package " + g.pkg.Name() + "\n\n") + + imports := append(slices.Clone(g.imports), perImportPath) + if g.usesAP { + imports = append(imports, apImportPath) + } + + if len(imports) == 1 { + head.WriteString("import \"" + imports[0] + "\"\n\n") + } else { + head.WriteString("import (\n") + + for _, imp := range imports { + head.WriteString("\t\"" + imp + "\"\n") + } + + head.WriteString(")\n\n") + } + + head.Write(g.buf.Bytes()) + + formatted, err := format.Source(head.Bytes()) + if err != nil { + return head.Bytes(), fmt.Errorf("format: %w", err) + } + + return formatted, nil +} + +func (g *generator) isMessage(named *types.Named) bool { + obj, _, _ := types.LookupFieldOrMethod(named, true, g.pkg, "Message") + + v, ok := obj.(*types.Var) + if !ok || !v.Embedded() { + return false + } + + n, ok := types.Unalias(v.Type()).(*types.Named) + + return ok && n.Origin().Obj().Pkg() != nil && n.Origin().Obj().Pkg().Path() == apImportPath && n.Origin().Obj().Name() == "Message" +} diff --git a/per/pergen/load.go b/per/pergen/load.go new file mode 100644 index 0000000000..4d9ffd6699 --- /dev/null +++ b/per/pergen/load.go @@ -0,0 +1,133 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package pergen + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "go/ast" + "go/build" + "go/importer" + "go/parser" + "go/token" + "go/types" + "io" + "os" + "os/exec" + "path/filepath" + "regexp" +) + +type loaded struct { + fset *token.FileSet + files []*ast.File + types *types.Package +} + +func load(ctx context.Context, dir, output string) (*loaded, error) { + bp, err := build.ImportDir(dir, 0) + if err != nil { + return nil, fmt.Errorf("load %s: %w", dir, err) + } + + fset := token.NewFileSet() + + var files []*ast.File + + for _, name := range bp.GoFiles { + if name == output { + continue + } + + f, err := parser.ParseFile(fset, filepath.Join(bp.Dir, name), nil, parser.SkipObjectResolution) + if err != nil { + return nil, fmt.Errorf("parse: %w", err) + } + + files = append(files, f) + } + + exports, err := listExports(ctx, bp.Dir) + if err != nil { + return nil, err + } + + var typeErrs []error + + conf := types.Config{ + Importer: importer.ForCompiler(fset, "gc", func(path string) (io.ReadCloser, error) { + file, ok := exports[path] + if !ok || file == "" { + return nil, fmt.Errorf("no export data for %s", path) + } + + return os.Open(file) + }), + Error: func(err error) { + if !pendingMethodError(err) { + typeErrs = append(typeErrs, err) + } + }, + } + + pkg, _ := conf.Check(bp.ImportPath, fset, files, nil) + if len(typeErrs) > 0 { + return nil, fmt.Errorf("type-check %s: %w", bp.ImportPath, errors.Join(typeErrs...)) + } + + return &loaded{fset: fset, files: files, types: pkg}, nil +} + +func listExports(ctx context.Context, dir string) (map[string]string, error) { + cmd := exec.CommandContext(ctx, "go", "list", "-e", "-export", "-deps", "-json=ImportPath,Export", ".") + cmd.Dir = dir + + var stderr bytes.Buffer + + cmd.Stderr = &stderr + + out, runErr := cmd.Output() + exports := make(map[string]string) + + for dec := json.NewDecoder(bytes.NewReader(out)); ; { + var p struct { + ImportPath string + Export string + } + + if err := dec.Decode(&p); errors.Is(err, io.EOF) { + break + } else if err != nil { + return nil, fmt.Errorf("go list: %w", err) + } + + exports[p.ImportPath] = p.Export + } + + if len(exports) == 0 && runErr != nil { + return nil, fmt.Errorf("go list: %w: %s", runErr, stderr.Bytes()) + } + + return exports, nil +} + +var generatedMethod = `(?:MarshalPER|UnmarshalPER|Diagnose|Name|Equal)` + +var pendingMethodPatterns = []*regexp.Regexp{ + regexp.MustCompile(`has no field or method ` + generatedMethod + `\b`), + regexp.MustCompile(`\(missing method ` + generatedMethod + `\)`), +} + +func pendingMethodError(err error) bool { + for _, re := range pendingMethodPatterns { + if re.MatchString(err.Error()) { + return true + } + } + + return false +} diff --git a/per/pergen/names_test.go b/per/pergen/names_test.go new file mode 100644 index 0000000000..099fccf957 --- /dev/null +++ b/per/pergen/names_test.go @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package pergen + +import "testing" + +func TestReceiverName(t *testing.T) { + t.Parallel() + + cases := []struct { + in, want string + }{ + {"Message", "message"}, + {"Foo", "foo"}, + {"", "v"}, + {"ABC", "aBC"}, + } + + for _, c := range cases { + if got := receiverName(c.in); got != c.want { + t.Errorf("receiverName(%q) = %q, want %q", c.in, got, c.want) + } + } +} + +func TestStructTagGet(t *testing.T) { + t.Parallel() + + cases := []struct { + tag, key, want string + }{ + {`per:"INTEGER,range:0..3" json:"version"`, "per", "INTEGER,range:0..3"}, + {`json:"version" per:"optional"`, "per", "optional"}, + {`json:"version"`, "per", ""}, + {``, "per", ""}, + {`per:""`, "per", ""}, + } + + for _, c := range cases { + if got := structTagGet(c.tag, c.key); got != c.want { + t.Errorf("structTagGet(%q, %q) = %q, want %q", c.tag, c.key, got, c.want) + } + } +} diff --git a/cmd/pergen/tag.go b/per/pergen/tag.go similarity index 86% rename from cmd/pergen/tag.go rename to per/pergen/tag.go index cb0426f053..854ae6f314 100644 --- a/cmd/pergen/tag.go +++ b/per/pergen/tag.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package main +package pergen import ( "errors" @@ -30,9 +30,6 @@ type FieldTag struct { SizeExtensible bool Optional bool - // Skip marks an OPTIONAL field the type does not model: encoded as - // always-absent, read and discarded on decode. - Skip bool // DefaultExpr is emitted verbatim into the generated code, not evaluated. DefaultExpr string @@ -51,6 +48,15 @@ type FieldTag struct { ExtRaw bool ExtTable string + ExtTableGenerated bool + ExtIE bool + ExtIEID string + Criticality string + Presence string + Condition string + ExtAlt bool + ChoiceCrit bool + EnumExtValues int64 HasEnumExtValues bool } @@ -70,7 +76,6 @@ const ( // tag := name? ("," option)* // name := "-" | identifier // option := "optional" -// | "skip" // | "ext" // | "extadd:" int // | "range:" range @@ -146,14 +151,15 @@ func knownTypeName(name string) bool { return asn1TypeNames[name] } // looksLikeOption distinguishes an option token from a bare ASN.1 type name. func looksLikeOption(token string) bool { - if token == "optional" || token == "ext" || token == "extseq" || token == "extraw" || token == "skip" { + switch token { + case "optional", "ext", "extseq", "extraw", "skip", "exttable", "extie", "extalt", "choicecrit": return true } if i := strings.IndexByte(token, ':'); i > 0 { key := strings.TrimSpace(token[:i]) switch key { - case "range", "size", "default", "choice", "tag", "extadd", "extvalues", "exttable": + case "range", "size", "default", "choice", "tag", "extadd", "extvalues", "exttable", "extie", "crit", "presence", "cond": return true } // Unknown "key:value" is claimed here so parseOption reports an error @@ -170,7 +176,18 @@ func parseOption(t *FieldTag, opt string) error { t.Optional = true return nil case "skip": - t.Skip = true + return errors.New("skip drops data: model the field (exttable for iE-Extensions)") + case "exttable": + t.ExtTableGenerated = true + return nil + case "extie": + t.ExtIE = true + return nil + case "extalt": + t.ExtAlt = true + return nil + case "choicecrit": + t.ChoiceCrit = true return nil case "ext": t.Ext = true @@ -239,6 +256,41 @@ func parseOption(t *FieldTag, opt string) error { t.ExtTable = value + return nil + case "extie": + if value == "" { + return errors.New("extie: empty id") + } + + t.ExtIE = true + t.ExtIEID = value + + return nil + case "crit": + switch value { + case "reject", "ignore", "notify": + t.Criticality = value + default: + return fmt.Errorf("crit: unknown criticality %q", value) + } + + return nil + case "presence": + switch value { + case "optional", "conditional", "mandatory": + t.Presence = value + default: + return fmt.Errorf("presence: unknown presence %q", value) + } + + return nil + case "cond": + if value == "" { + return errors.New("cond: empty function") + } + + t.Condition = value + return nil case "extvalues": n, err := strconv.ParseInt(value, 10, 64) diff --git a/cmd/pergen/tag_test.go b/per/pergen/tag_test.go similarity index 99% rename from cmd/pergen/tag_test.go rename to per/pergen/tag_test.go index 4087254183..2c1df15e47 100644 --- a/cmd/pergen/tag_test.go +++ b/per/pergen/tag_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package main +package pergen import ( "testing" diff --git a/per/pergen/testdata/ap/fixture.go b/per/pergen/testdata/ap/fixture.go new file mode 100644 index 0000000000..d3fac096a9 --- /dev/null +++ b/per/pergen/testdata/ap/fixture.go @@ -0,0 +1,42 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package fixture + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type ID uint16 + +const IDThing ID = 7 + +var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} + +type Kind uint8 + +var enumKind = per.Enum[Kind]{Root: []string{"a", "b"}, Extension: []string{"c"}} + +type Inner struct { + K Kind + Thing *Kind `per:",extie:IDThing,crit:ignore"` + ext ap.Preserved[ID] `per:",exttable"` + add per.ExtensionAdditions `per:",extraw"` +} + +type Choice struct { + In *Inner `per:",choice:0"` + Typed *Inner `per:",choice:1,extie:IDThing,crit:reject"` + Raw *ap.SingleContainer[ID] `per:",choice:1,extie"` + Ext *per.ExtensionAlternative `per:",extalt"` + crit ap.WireCriticality `per:",choicecrit"` +} + +type List []Inner + +type Container struct { + Typed *Inner `per:",choice:0,extie:IDThing,crit:ignore"` + Raw *ap.SingleContainer[ID] `per:",choice:0,extie"` + crit ap.WireCriticality `per:",choicecrit"` +} diff --git a/per/pergen/testdata/apbad/choiceraw/fixture.go b/per/pergen/testdata/apbad/choiceraw/fixture.go new file mode 100644 index 0000000000..cdffb72c2d --- /dev/null +++ b/per/pergen/testdata/apbad/choiceraw/fixture.go @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package fixture + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type ID uint16 + +var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} + +const IDX ID = 1 + +type S struct { + A uint8 `per:",range:0..3"` +} + +type T struct { + A *S `per:",choice:0"` + B *S `per:",choice:1,extie:IDX,crit:reject"` +} + +var _ per.Encoding diff --git a/per/pergen/testdata/apbad/equalref/fixture.go b/per/pergen/testdata/apbad/equalref/fixture.go new file mode 100644 index 0000000000..bc54d82b99 --- /dev/null +++ b/per/pergen/testdata/apbad/equalref/fixture.go @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package fixture + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type ID uint16 + +var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} + +type Hand struct { + byName map[string]uint8 +} + +func (h *Hand) MarshalPER(*per.Writer, per.Encoding) error { return nil } + +func (h *Hand) UnmarshalPER(*per.Reader, per.Encoding) error { return nil } + +type T struct { + A uint8 `per:",range:0..3"` + Hand Hand + ext ap.Preserved[ID] `per:",exttable"` +} diff --git a/per/pergen/testdata/apbad/extseq/fixture.go b/per/pergen/testdata/apbad/extseq/fixture.go new file mode 100644 index 0000000000..e3bc299611 --- /dev/null +++ b/per/pergen/testdata/apbad/extseq/fixture.go @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package fixture + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type ID uint16 + +var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} + +type T struct { + A uint8 `per:",range:0..3"` + _ [0]struct{} `per:"extseq"` + ext ap.Preserved[ID] `per:",exttable"` +} + +var _ per.Encoding diff --git a/per/pergen/testdata/apbad/handtable/fixture.go b/per/pergen/testdata/apbad/handtable/fixture.go new file mode 100644 index 0000000000..2337324259 --- /dev/null +++ b/per/pergen/testdata/apbad/handtable/fixture.go @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package fixture + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type ID uint16 + +var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} + +var tExt []ap.IESpec[ID, T] + +type T struct { + A uint8 `per:",range:0..3"` + ext ap.Preserved[ID] `per:",exttable:tExt"` + add per.ExtensionAdditions `per:",extraw"` +} diff --git a/per/pergen/testdata/apbad/inlineenum/fixture.go b/per/pergen/testdata/apbad/inlineenum/fixture.go new file mode 100644 index 0000000000..e43bb47881 --- /dev/null +++ b/per/pergen/testdata/apbad/inlineenum/fixture.go @@ -0,0 +1,21 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package fixture + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type ID uint16 + +var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} + +type E uint8 + +type T struct { + A E `per:"ENUMERATED,range:0..1,..."` + ext ap.Preserved[ID] `per:",exttable"` + add per.ExtensionAdditions `per:",extraw"` +} diff --git a/per/protocolie/protocolie.go b/per/protocolie/protocolie.go deleted file mode 100644 index 12b8da95ac..0000000000 --- a/per/protocolie/protocolie.go +++ /dev/null @@ -1,376 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package protocolie - -import ( - "bytes" - "errors" - "fmt" - - "github.com/ellanetworks/core/per" -) - -const ( - pduChoiceCount = 3 - maxProcedureCode = 255 - criticalityCount = 3 - maxProtocolIEs = 65535 - minFieldOctets = 4 - fragmentedForm = 0xC0 -) - -var ( - ErrExtensionAlternative = errors.New("protocolie: PDU extension alternative") - ErrNotProtocolIEContainer = errors.New("protocolie: message body is not a ProtocolIE-Container") - ErrIndex = errors.New("protocolie: field index out of range") - ErrTooManyFields = errors.New("protocolie: more than maxProtocolIEs fields") - ErrCriticality = errors.New("protocolie: criticality out of range") -) - -type Field struct { - ID uint16 - Criticality uint8 - Value []byte -} - -type openType struct { - det []byte - content []byte - raw []byte -} - -type field struct { - id uint16 - crit uint8 - hdr []byte - val openType - content []byte -} - -type Message struct { - choice int - procedureCode uint8 - criticality uint8 - - orig []byte - head []byte - body openType - bodyHdr []byte - count []byte - fields []field - bodyTail []byte - tail []byte - - countChanged bool - dirty bool -} - -func Parse(b []byte, opaque func(procedureCode uint8) bool) (*Message, error) { - b = bytes.Clone(b) - r := per.NewReader(b) - enc := per.Aligned - - ext, err := r.ReadBit() - if err != nil { - return nil, fmt.Errorf("protocolie: PDU choice: %w", err) - } - - if ext { - return nil, ErrExtensionAlternative - } - - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, pduChoiceCount-1) - if err != nil { - return nil, fmt.Errorf("protocolie: PDU choice: %w", err) - } - - pc, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProcedureCode) - if err != nil { - return nil, fmt.Errorf("protocolie: procedureCode: %w", err) - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) - if err != nil { - return nil, fmt.Errorf("protocolie: criticality: %w", err) - } - - if opaque != nil && opaque(uint8(pc)) { - return nil, ErrNotProtocolIEContainer - } - - r.AlignToByte() - headEnd := r.Offset() / 8 - - body, err := readOpenType(r, b) - if err != nil { - return nil, fmt.Errorf("protocolie: value: %w", err) - } - - m := &Message{ - choice: int(idx), - procedureCode: uint8(pc), - criticality: uint8(crit), - orig: b, - head: b[:headEnd], - body: body, - tail: b[r.Offset()/8:], - } - - if err := m.parseBody(); err != nil { - return nil, err - } - - return m, nil -} - -func (m *Message) parseBody() error { - content := m.body.content - r := per.NewReader(content) - enc := per.Aligned - - if _, err := r.ReadBit(); err != nil { - return fmt.Errorf("protocolie: message preamble: %w", err) - } - - r.AlignToByte() - hdrEnd := r.Offset() / 8 - - n, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return fmt.Errorf("protocolie: IE count: %w", err) - } - - countEnd := r.Offset() / 8 - - if n > int64(len(content)-countEnd)/minFieldOctets { - return fmt.Errorf("protocolie: %d IEs declared in %d octets", n, len(content)-countEnd) - } - - m.bodyHdr = content[:hdrEnd] - m.count = content[hdrEnd:countEnd] - m.fields = make([]field, 0, n) - - for i := range n { - start := r.Offset() / 8 - - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return fmt.Errorf("protocolie: IE %d id: %w", i, err) - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) - if err != nil { - return fmt.Errorf("protocolie: IE %d criticality: %w", i, err) - } - - r.AlignToByte() - hdrEnd := r.Offset() / 8 - - val, err := readOpenType(r, content) - if err != nil { - return fmt.Errorf("protocolie: IE %d value: %w", i, err) - } - - m.fields = append(m.fields, field{id: uint16(id), crit: uint8(crit), hdr: content[start:hdrEnd], val: val, content: val.content}) - } - - m.bodyTail = content[r.Offset()/8:] - - return nil -} - -func readOpenType(r *per.Reader, buf []byte) (openType, error) { - start := r.Offset() / 8 - - content, err := per.DecodeOpenTypeBytes(r, per.Aligned) - if err != nil { - return openType{}, err - } - - raw := buf[start : r.Offset()/8] - ot := openType{content: content, raw: raw} - - if raw[0]&fragmentedForm != fragmentedForm { - ot.det = raw[:len(raw)-len(content)] - } - - return ot, nil -} - -func (m *Message) Choice() int { return m.choice } - -func (m *Message) ProcedureCode() uint8 { return m.procedureCode } - -func (m *Message) Criticality() uint8 { return m.criticality } - -func (m *Message) Len() int { return len(m.fields) } - -func (m *Message) Field(i int) (Field, error) { - if i < 0 || i >= len(m.fields) { - return Field{}, ErrIndex - } - - f := m.fields[i] - - return Field{ID: f.id, Criticality: f.crit, Value: append([]byte(nil), f.content...)}, nil -} - -func (m *Message) Fields() []Field { - out := make([]Field, len(m.fields)) - for i := range m.fields { - out[i], _ = m.Field(i) - } - - return out -} - -func (m *Message) Index(id uint16) int { - for i, f := range m.fields { - if f.id == id { - return i - } - } - - return -1 -} - -func (m *Message) SetValue(i int, value []byte) error { - if i < 0 || i >= len(m.fields) { - return ErrIndex - } - - m.fields[i].content = completeEncoding(value) - m.dirty = true - - return nil -} - -func (m *Message) Insert(i int, f Field) error { - if i < 0 || i > len(m.fields) { - return ErrIndex - } - - if len(m.fields) >= maxProtocolIEs { - return ErrTooManyFields - } - - if f.Criticality >= criticalityCount { - return ErrCriticality - } - - nf := field{id: f.ID, crit: f.Criticality, content: completeEncoding(f.Value)} - - m.fields = append(m.fields, field{}) - copy(m.fields[i+1:], m.fields[i:]) - m.fields[i] = nf - m.countChanged = true - m.dirty = true - - return nil -} - -func (m *Message) Remove(i int) error { - if i < 0 || i >= len(m.fields) { - return ErrIndex - } - - m.fields = append(m.fields[:i], m.fields[i+1:]...) - m.countChanged = true - m.dirty = true - - return nil -} - -func (m *Message) Bytes() ([]byte, error) { - if !m.dirty { - return append([]byte(nil), m.orig...), nil - } - - content := make([]byte, 0, len(m.body.content)+16) - content = append(content, m.bodyHdr...) - - if m.countChanged { - w := per.NewWriter() - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(len(m.fields))); err != nil { - return nil, err - } - - content = append(content, w.Bytes()...) - } else { - content = append(content, m.count...) - } - - for _, f := range m.fields { - enc, err := f.encode() - if err != nil { - return nil, err - } - - content = append(content, enc...) - } - - content = append(content, m.bodyTail...) - - body, err := m.body.encode(content) - if err != nil { - return nil, err - } - - out := make([]byte, 0, len(m.head)+len(body)+len(m.tail)) - out = append(out, m.head...) - out = append(out, body...) - out = append(out, m.tail...) - - return out, nil -} - -func (f field) encode() ([]byte, error) { - hdr := f.hdr - if hdr == nil { - w := per.NewWriter() - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(f.id)); err != nil { - return nil, err - } - - if err := per.EncodeEnumerated(w, per.Aligned, criticalityCount, false, int64(f.crit)); err != nil { - return nil, err - } - - hdr = w.Bytes() - } - - val, err := f.val.encode(f.content) - if err != nil { - return nil, err - } - - out := make([]byte, 0, len(hdr)+len(val)) - out = append(out, hdr...) - - return append(out, val...), nil -} - -func (o openType) encode(content []byte) ([]byte, error) { - if o.raw != nil && bytes.Equal(content, o.content) { - return o.raw, nil - } - - if o.det != nil && len(content) == len(o.content) && len(content) > 0 { - out := make([]byte, 0, len(o.det)+len(content)) - out = append(out, o.det...) - - return append(out, content...), nil - } - - w := per.NewWriter() - if err := per.EncodeOpenTypeBytes(w, per.Aligned, content); err != nil { - return nil, err - } - - return w.Bytes(), nil -} - -func completeEncoding(value []byte) []byte { - return append([]byte{}, value...) -} diff --git a/s1ap/abstract_syntax_test.go b/s1ap/abstract_syntax_test.go index 4b5d351282..ad6bb4a26c 100644 --- a/s1ap/abstract_syntax_test.go +++ b/s1ap/abstract_syntax_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // As a peer would send it, without the rules the encoder normally enforces. @@ -26,11 +27,11 @@ func container(t *testing.T, fields ...ieField) []byte { func uplinkNASFields() []ieField { return []ieField{ - {id: IDMMEUES1APID, crit: CriticalityReject, val: Ptr(MMEUES1APID(7))}, - {id: IDENBUES1APID, crit: CriticalityReject, val: Ptr(ENBUES1APID(9))}, - {id: IDNASPDU, crit: CriticalityReject, val: Ptr(NASPDU{0x01})}, - {id: IDEUTRANCGI, crit: CriticalityIgnore, val: Ptr(EUTRANCGI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}})}, - {id: IDTAI, crit: CriticalityIgnore, val: Ptr(TAI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, TAC: TAC(1)})}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: Ptr(MMEUES1APID(7))}, + {ID: IDENBUES1APID, Criticality: CriticalityReject, Value: Ptr(ENBUES1APID(9))}, + {ID: IDNASPDU, Criticality: CriticalityReject, Value: Ptr(NASPDU{0x01})}, + {ID: IDEUTRANCGI, Criticality: CriticalityIgnore, Value: Ptr(EUTRANCGI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}})}, + {ID: IDTAI, Criticality: CriticalityIgnore, Value: Ptr(TAI{PLMNIdentity: PLMNIdentity{0x02, 0xf8, 0x39}, TAC: TAC(1)})}, } } @@ -46,7 +47,7 @@ func TestDuplicateIERejected(t *testing.T) { t.Fatalf("error = %v, want *AbstractSyntaxError", err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage.Cause()) { t.Errorf("cause = %s, want falsely-constructed-message", ase.Cause) } } @@ -64,7 +65,7 @@ func TestIEsOutOfOrderRejected(t *testing.T) { t.Fatalf("error = %v, want *AbstractSyntaxError", err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage.Cause()) { t.Errorf("cause = %s, want falsely-constructed-message", ase.Cause) } } @@ -72,7 +73,7 @@ func TestIEsOutOfOrderRejected(t *testing.T) { // §10.3.6 considers only IEs the receiver's version defines. func TestUnknownIEDoesNotBreakOrdering(t *testing.T) { fields := uplinkNASFields() - unknown := ieField{id: ProtocolIEID(60000), crit: CriticalityIgnore, raw: []byte{0x01, 0x02}} + unknown := ieField{ID: ProtocolIEID(60000), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01, 0x02})} fields = append([]ieField{fields[0], fields[1], unknown}, fields[2:]...) msg, err := ParseUplinkNASTransport(container(t, fields...)) @@ -100,7 +101,7 @@ func TestAbsentIgnoreIEIsDelivered(t *testing.T) { } diag := msg.Diagnostics() - if len(diag.IEs) != 1 || diag.IEs[0].ID != IDTAI || diag.IEs[0].TypeOfError != TypeOfErrorMissing { + if len(diag.IEs) != 1 || diag.IEs[0].ID != IDTAI || typeOfError(diag.IEs[0]) != TypeOfErrorMissing { t.Fatalf("diagnostics = %+v, want TAI reported missing", diag.IEs) } @@ -121,7 +122,7 @@ func TestAbsentRejectIEStopsDelivery(t *testing.T) { t.Fatalf("error = %v, want *AbstractSyntaxError", err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorReject { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorReject.Cause()) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } @@ -164,9 +165,9 @@ func TestEncodeRejectsUnsetRequiredIE(t *testing.T) { // Recording is bounded, since a peer chooses how many IEs to send. func TestDiagnosticsAreBounded(t *testing.T) { fields := uplinkNASFields() - for i := range maxDiagnosticIEs + 10 { + for i := range paddingIEs + 10 { fields = append(fields, ieField{ - id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), }) } @@ -175,17 +176,12 @@ func TestDiagnosticsAreBounded(t *testing.T) { t.Fatalf("parse: %v", err) } - diag := msg.Diagnostics() - if len(diag.IEs) > maxDiagnosticIEs { - t.Errorf("recorded %d diagnostics, want at most %d", len(diag.IEs), maxDiagnosticIEs) - } - - if !diag.Truncated { - t.Error("Truncated = false, want true") + if got := len(msg.Diagnostics().IEs); got != paddingIEs+10 { + t.Errorf("recorded %d diagnostics, want %d", got, paddingIEs+10) } - if got := len(msg.UnknownIEs()); got > maxPreservedIEs { - t.Errorf("preserved %d unknown IEs, want at most %d", got, maxPreservedIEs) + if got := len(msg.UnknownIEs()); got != paddingIEs+10 { + t.Errorf("preserved %d unknown IEs, want %d", got, paddingIEs+10) } } @@ -195,9 +191,9 @@ func TestUEIDsSurvivePadding(t *testing.T) { fields := uplinkNASFields() var padded []ieField - for i := range maxPreservedIEs * 2 { + for i := range paddingIEs * 2 { padded = append(padded, ieField{ - id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), }) } @@ -264,8 +260,8 @@ func TestOversizedIECountRejected(t *testing.T) { // one (§8.7.2.2). func TestUEIDsFromPathSwitchRequest(t *testing.T) { value := container(t, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: Ptr(ENBUES1APID(9))}, - ieField{id: IDSourceMMEUES1APID, crit: CriticalityReject, val: Ptr(MMEUES1APID(7))}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: Ptr(ENBUES1APID(9))}, + ieField{ID: IDSourceMMEUES1APID, Criticality: CriticalityReject, Value: Ptr(MMEUES1APID(7))}, ) _, err := ParsePathSwitchRequest(value) @@ -281,17 +277,15 @@ func TestUEIDsFromPathSwitchRequest(t *testing.T) { } } -// A notify entry must survive the diagnostics bound or the §10.3.4.2 report -// carries no IE. -func TestNotifySurvivesTruncation(t *testing.T) { +func TestNotifyReportedAmongIgnoredIEs(t *testing.T) { fields := uplinkNASFields() - for i := range maxDiagnosticIEs + 10 { + for i := range paddingIEs + 10 { fields = append(fields, ieField{ - id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), }) } - fields = append(fields, ieField{id: ProtocolIEID(50000), crit: CriticalityNotify, raw: []byte{0x00}}) + fields = append(fields, ieField{ID: ProtocolIEID(50000), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x00})}) msg, err := ParseUplinkNASTransport(container(t, fields...)) if err != nil { @@ -308,7 +302,7 @@ func TestNotifySurvivesTruncation(t *testing.T) { t.Fatalf("Report() = %+v, want the notify IE", report) } - if len(diag.IEs) > maxDiagnosticIEs { - t.Errorf("recorded %d diagnostics, want at most %d", len(diag.IEs), maxDiagnosticIEs) + if len(diag.IEs) != paddingIEs+11 { + t.Errorf("recorded %d diagnostics, want %d", len(diag.IEs), paddingIEs+11) } } diff --git a/s1ap/cause.go b/s1ap/cause.go index f284720ad1..885a268e96 100644 --- a/s1ap/cause.go +++ b/s1ap/cause.go @@ -5,160 +5,189 @@ package s1ap import ( "fmt" + "strings" "github.com/ellanetworks/core/per" ) -// CauseGroup selects a Cause CHOICE alternative (TS 36.413). -type CauseGroup uint8 +// Cause ::= CHOICE { radioNetwork, transport, nas, protocol, misc, ... } +// (TS 36.413 §9.2.1.3). +type Cause struct { + RadioNetwork *CauseRadioNetwork `per:",choice:0"` + Transport *CauseTransport `per:",choice:1"` + NAS *CauseNas `per:",choice:2"` + Protocol *CauseProtocol `per:",choice:3"` + Misc *CauseMisc `per:",choice:4"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +type CauseRadioNetwork uint8 const ( - CauseGroupRadioNetwork CauseGroup = iota - CauseGroupTransport - CauseGroupNAS - CauseGroupProtocol - CauseGroupMisc + CauseRadioNetworkUnspecified CauseRadioNetwork = iota + CauseRadioNetworkTX2RelocOverallExpiry + CauseRadioNetworkSuccessfulHandover + CauseRadioNetworkReleaseDueToEUTRANGeneratedReason + CauseRadioNetworkHandoverCancelled + CauseRadioNetworkPartialHandover + CauseRadioNetworkHOFailureInTarget + CauseRadioNetworkHOTargetNotAllowed + CauseRadioNetworkTS1RelocOverallExpiry + CauseRadioNetworkTS1RelocPrepExpiry + CauseRadioNetworkCellNotAvailable + CauseRadioNetworkUnknownTargetID + CauseRadioNetworkNoRadioResourcesInTargetCell + CauseRadioNetworkUnknownMMEUES1APID + CauseRadioNetworkUnknownENBUES1APID + CauseRadioNetworkUnknownPairUES1APID + CauseRadioNetworkHandoverDesirableForRadio + CauseRadioNetworkTimeCriticalHandover + CauseRadioNetworkResourceOptimisationHandover + CauseRadioNetworkReduceLoadInServingCell + CauseRadioNetworkUserInactivity + CauseRadioNetworkRadioConnectionWithUELost + CauseRadioNetworkLoadBalancingTAURequired + CauseRadioNetworkCSFallbackTriggered + CauseRadioNetworkUENotAvailableForPSService + CauseRadioNetworkRadioResourcesNotAvailable + CauseRadioNetworkFailureInRadioInterfaceProcedure + CauseRadioNetworkInvalidQoSCombination + CauseRadioNetworkInterRATRedirection + CauseRadioNetworkInteractionWithOtherProcedure + CauseRadioNetworkUnknownERABID + CauseRadioNetworkMultipleERABIDInstances + CauseRadioNetworkEncryptionAlgorithmsNotSupported + CauseRadioNetworkS1IntraSystemHandoverTriggered + CauseRadioNetworkS1InterSystemHandoverTriggered + CauseRadioNetworkX2HandoverTriggered + CauseRadioNetworkRedirectionTowards1xRTT + CauseRadioNetworkNotSupportedQCIValue + CauseRadioNetworkInvalidCSGID + CauseRadioNetworkReleaseDueToPreemption + CauseRadioNetworkN26InterfaceNotAvailable + CauseRadioNetworkInsufficientUECapabilities + CauseRadioNetworkMaximumBearerPreemptionRateExceeded + CauseRadioNetworkUPIntegrityProtectionNotPossible + CauseRadioNetworkReleaseDueToDiscontinuousCoverage +) - causeRootGroups = 5 +type CauseTransport uint8 + +const ( + CauseTransportResourceUnavailable CauseTransport = iota + CauseTransportUnspecified ) -// Root ENUMERATED values per group, which sets the index width. -var causeGroupRootCount = [causeRootGroups]int{ - CauseGroupRadioNetwork: 36, - CauseGroupTransport: 2, - CauseGroupNAS: 4, - CauseGroupProtocol: 7, - CauseGroupMisc: 6, -} +type CauseNas uint8 -// Root ENUMERATED values of each Cause group (TS 36.413). A value is an index -// within its own group, so the same number differs across groups. const ( - CauseRadioNetworkUnspecified = 0 // unspecified - CauseRadioNetworkSuccessfulHandover = 2 // successful-handover - CauseRadioNetworkReleaseDueToEUTRANGeneratedReason = 3 // release-due-to-eutran-generated-reason - CauseRadioNetworkHandoverCancelled = 4 // handover-cancelled - CauseRadioNetworkPartialHandover = 5 // partial-handover - CauseRadioNetworkHOFailureInTarget = 6 // ho-failure-in-target-EPC-eNB-or-target-system - CauseRadioNetworkHOTargetNotAllowed = 7 // ho-target-not-allowed - CauseRadioNetworkTS1RelocOverallExpiry = 8 // tS1relocoverall-expiry - CauseRadioNetworkUnknownTargetID = 11 // unknown-targetID - CauseRadioNetworkNoRadioResourcesInTargetCell = 12 // no-radio-resources-available-in-target-cell - CauseRadioNetworkUnknownMMEUES1APID = 13 // unknown-mme-ue-s1ap-id - CauseRadioNetworkUnknownENBUES1APID = 14 - CauseRadioNetworkUnknownPairUES1APID = 15 // unknown-pair-ue-s1ap-id - CauseRadioNetworkHandoverDesirableForRadio = 16 // handover-desirable-for-radio-reason - CauseRadioNetworkTimeCriticalHandover = 17 // time-critical-handover - CauseRadioNetworkResourceOptimisationHandover = 18 // resource-optimisation-handover - CauseRadioNetworkReduceLoadInServingCell = 19 // reduce-load-in-serving-cell - CauseRadioNetworkUserInactivity = 20 // user-inactivity - CauseRadioNetworkRadioConnectionWithUELost = 21 // radio-connection-with-ue-lost - CauseRadioNetworkLoadBalancingTAURequired = 22 // load-balancing-tau-required - CauseRadioNetworkCSFallbackTriggered = 23 // cs-fallback-triggered - CauseRadioNetworkUENotAvailableForPSService = 24 // ue-not-available-for-ps-service - CauseRadioNetworkRadioResourcesNotAvailable = 25 // radio-resources-not-available - CauseRadioNetworkInterRATRedirection = 28 // interrat-redirection - CauseRadioNetworkS1IntraSystemHandoverTriggered = 33 // s1-intra-system-handover-triggered - CauseRadioNetworkS1InterSystemHandoverTriggered = 34 // s1-inter-system-handover-triggered - CauseRadioNetworkX2HandoverTriggered = 35 // x2-handover-triggered - CauseRadioNetworkInteractionWithOtherProcedure = 29 // interaction-with-other-procedure - CauseRadioNetworkMultipleERABIDInstances = 31 // multiple-E-RAB-ID-instances - - // encryption-and-or-integrity-protection-algorithms-not-supported - CauseRadioNetworkEncryptionAlgorithmsNotSupported = 32 - - CauseTransportResourceUnavailable = 0 // transport-resource-unavailable - - CauseNASNormalRelease = 0 // normal-release - CauseNASAuthenticationFailure = 1 // authentication-failure - CauseNASDetach = 2 // detach - CauseNASUnspecified = 3 // unspecified - - CauseProtocolTransferSyntaxError = 0 // transfer-syntax-error - CauseProtocolAbstractSyntaxErrorReject = 1 // abstract-syntax-error-reject - CauseProtocolAbstractSyntaxErrorIgnoreAndNotify = 2 // abstract-syntax-error-ignore-and-notify - CauseProtocolMessageNotCompatible = 3 - CauseProtocolSemanticError = 4 // semantic-error - CauseProtocolUnspecified = 6 - - // abstract-syntax-error-falsely-constructed-message - CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage = 5 - - CauseMiscOMIntervention = 3 // om-intervention - CauseMiscUnspecified = 4 // unspecified - CauseMiscUnknownPLMN = 5 // unknown-PLMN + CauseNASNormalRelease CauseNas = iota + CauseNASAuthenticationFailure + CauseNASDetach + CauseNASUnspecified + CauseNASCSGSubscriptionExpiry + CauseNASUENotInPLMNServingArea + CauseNASIABNotAuthorized ) -var CauseInsufficientUECapabilities = Cause{Group: CauseGroupRadioNetwork, Value: 5, Extended: true} +type CauseProtocol uint8 -// CauseN26InterfaceNotAvailable is radioNetwork extension index 4, -// "N26 interface not available" (TS 36.413 §9.2.1.3). -var CauseN26InterfaceNotAvailable = Cause{Group: CauseGroupRadioNetwork, Value: 4, Extended: true} +const ( + CauseProtocolTransferSyntaxError CauseProtocol = iota + CauseProtocolAbstractSyntaxErrorReject + CauseProtocolAbstractSyntaxErrorIgnoreAndNotify + CauseProtocolMessageNotCompatible + CauseProtocolSemanticError + CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage + CauseProtocolUnspecified +) -// Cause ::= CHOICE of five extensible ENUMERATED groups. Value indexes the -// chosen group; Extended marks it as indexing an extension addition. -type Cause struct { - Group CauseGroup - Value int - Extended bool -} +type CauseMisc uint8 -func (c Cause) EnumeratedValue() int { - if c.Extended && int(c.Group) < causeRootGroups { - return causeGroupRootCount[c.Group] + c.Value - } +const ( + CauseMiscControlProcessingOverload CauseMisc = iota + CauseMiscNotEnoughUserPlaneProcessingResources + CauseMiscHardwareFailure + CauseMiscOMIntervention + CauseMiscUnspecified + CauseMiscUnknownPLMN +) - return c.Value -} +func (v CauseRadioNetwork) Cause() Cause { return Cause{RadioNetwork: &v} } -func (c Cause) MarshalPER(w *per.Writer, enc per.Encoding) error { - if int(c.Group) >= causeRootGroups { - return fmt.Errorf("s1ap: invalid cause group %d", c.Group) - } +func (v CauseTransport) Cause() Cause { return Cause{Transport: &v} } - w.WriteBit(false) +func (v CauseNas) Cause() Cause { return Cause{NAS: &v} } - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, causeRootGroups-1, int64(c.Group)); err != nil { - return err - } +func (v CauseProtocol) Cause() Cause { return Cause{Protocol: &v} } - n := int64(causeGroupRootCount[c.Group]) +func (v CauseMisc) Cause() Cause { return Cause{Misc: &v} } - idx := int64(c.Value) - if c.Extended { - idx += n +func (c Cause) alternative() (index int, value interface{ Name() string }, enumIndex int, ok bool) { + switch { + case c.RadioNetwork != nil: + return 0, *c.RadioNetwork, int(*c.RadioNetwork), true + case c.Transport != nil: + return 1, *c.Transport, int(*c.Transport), true + case c.NAS != nil: + return 2, *c.NAS, int(*c.NAS), true + case c.Protocol != nil: + return 3, *c.Protocol, int(*c.Protocol), true + case c.Misc != nil: + return 4, *c.Misc, int(*c.Misc), true + default: + return 0, nil, 0, false } +} - return per.EncodeEnumerated(w, enc, n, true, idx) +var causeGroupNames = [...]string{"radioNetwork", "transport", "nas", "protocol", "misc"} + +func (c Cause) Group() (index int, ok bool) { + index, _, _, ok = c.alternative() + + return index, ok } -func (c *Cause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - gExt, err := r.ReadBit() - if err != nil { - return err +func (c Cause) GroupName() string { + index, _, _, ok := c.alternative() + if !ok { + return "" } - if gExt { - return fmt.Errorf("%w: cause extension group", errNotComprehended) + return causeGroupNames[index] +} + +func (c Cause) EnumeratedValue() int { + _, v := c.ValueName() + + return v +} + +func (c Cause) ValueName() (name string, index int) { + _, v, i, ok := c.alternative() + if !ok { + return "unknown", 0 } - gi, err := per.DecodeConstrainedWholeNumber(r, enc, 0, causeRootGroups-1) - if err != nil { - return fmt.Errorf("s1ap: cause group: %w", err) + name = v.Name() + if strings.HasPrefix(name, "unknown(") { + name = "unknown" } - n := int64(causeGroupRootCount[gi]) + return name, i +} - idx, err := per.DecodeEnumerated(r, enc, n, true) - if err != nil { - return fmt.Errorf("s1ap: cause value: %w", err) - } +func (c Cause) String() string { + group := c.GroupName() + if group == "" { + if c.Ext != nil { + return fmt.Sprintf("extension-%d", c.Ext.Index) + } - if idx >= n { - *c = Cause{Group: CauseGroup(gi), Value: int(idx - n), Extended: true} - } else { - *c = Cause{Group: CauseGroup(gi), Value: int(idx)} + return "" } - return nil + name, index := c.ValueName() + + return fmt.Sprintf("%s: %s (%d)", group, name, index) } diff --git a/s1ap/cause_names.go b/s1ap/cause_names.go index d0d1fe164f..82740f3c42 100644 --- a/s1ap/cause_names.go +++ b/s1ap/cause_names.go @@ -3,145 +3,29 @@ package s1ap -import "fmt" +import "github.com/ellanetworks/core/per" -// Cause value names from TS 36.413 §9.2.1.3. Each group lists its root -// ENUMERATED values, then the extension additions that continue the numbering. -var ( - radioNetworkRoot = []string{ - "unspecified", - "tx2relocoverall-expiry", - "successful-handover", - "release-due-to-eutran-generated-reason", - "handover-cancelled", - "partial-handover", - "ho-failure-in-target-EPC-eNB-or-target-system", - "ho-target-not-allowed", - "tS1relocoverall-expiry", - "tS1relocprep-expiry", - "cell-not-available", - "unknown-targetID", - "no-radio-resources-available-in-target-cell", - "unknown-mme-ue-s1ap-id", - "unknown-enb-ue-s1ap-id", - "unknown-pair-ue-s1ap-id", - "handover-desirable-for-radio-reason", - "time-critical-handover", - "resource-optimisation-handover", - "reduce-load-in-serving-cell", - "user-inactivity", - "radio-connection-with-ue-lost", - "load-balancing-tau-required", - "cs-fallback-triggered", - "ue-not-available-for-ps-service", - "radio-resources-not-available", - "failure-in-radio-interface-procedure", - "invalid-qos-combination", - "interrat-redirection", - "interaction-with-other-procedure", - "unknown-E-RAB-ID", - "multiple-E-RAB-ID-instances", - "encryption-and-or-integrity-protection-algorithms-not-supported", - "s1-intra-system-handover-triggered", - "s1-inter-system-handover-triggered", - "x2-handover-triggered", - } - radioNetworkExt = []string{ - "redirection-towards-1xRTT", - "not-supported-QCI-value", - "invalid-CSG-Id", - "release-due-to-pre-emption", - "n26-interface-not-available", - "insufficient-ue-capabilities", - "maximum-bearer-pre-emption-rate-exceeded", - "up-integrity-protection-not-possible", - "release-due-to-discontinuous-coverage", - } - transportRoot = []string{ - "transport-resource-unavailable", - "unspecified", - } - nasRoot = []string{ - "normal-release", - "authentication-failure", - "detach", - "unspecified", - } - nasExt = []string{ - "csg-subscription-expiry", - "uE-not-in-PLMN-serving-area", - } - protocolRoot = []string{ - "transfer-syntax-error", - "abstract-syntax-error-reject", - "abstract-syntax-error-ignore-and-notify", - "message-not-compatible-with-receiver-state", - "semantic-error", - "abstract-syntax-error-falsely-constructed-message", - "unspecified", - } - miscRoot = []string{ - "control-processing-overload", - "not-enough-user-plane-processing-resources", - "hardware-failure", - "om-intervention", - "unspecified", - "unknown-PLMN", - } -) - -func causeTablesFor(group CauseGroup) (root, ext []string, known bool) { - switch group { - case CauseGroupRadioNetwork: - return radioNetworkRoot, radioNetworkExt, true - case CauseGroupTransport: - return transportRoot, nil, true - case CauseGroupNAS: - return nasRoot, nasExt, true - case CauseGroupProtocol: - return protocolRoot, nil, true - case CauseGroupMisc: - return miscRoot, nil, true - default: - return nil, nil, false - } +var enumCauseRadioNetwork = per.Enum[CauseRadioNetwork]{ + Root: []string{"unspecified", "tx2relocoverall-expiry", "successful-handover", "release-due-to-eutran-generated-reason", "handover-cancelled", "partial-handover", "ho-failure-in-target-EPC-eNB-or-target-system", "ho-target-not-allowed", "tS1relocoverall-expiry", "tS1relocprep-expiry", "cell-not-available", "unknown-targetID", "no-radio-resources-available-in-target-cell", "unknown-mme-ue-s1ap-id", "unknown-enb-ue-s1ap-id", "unknown-pair-ue-s1ap-id", "handover-desirable-for-radio-reason", "time-critical-handover", "resource-optimisation-handover", "reduce-load-in-serving-cell", "user-inactivity", "radio-connection-with-ue-lost", "load-balancing-tau-required", "cs-fallback-triggered", "ue-not-available-for-ps-service", "radio-resources-not-available", "failure-in-radio-interface-procedure", "invalid-qos-combination", "interrat-redirection", "interaction-with-other-procedure", "unknown-E-RAB-ID", "multiple-E-RAB-ID-instances", "encryption-and-or-integrity-protection-algorithms-not-supported", "s1-intra-system-handover-triggered", "s1-inter-system-handover-triggered", "x2-handover-triggered"}, + Extension: []string{"redirection-towards-1xRTT", "not-supported-QCI-value", "invalid-CSG-Id", "release-due-to-pre-emption", "n26-interface-not-available", "insufficient-ue-capabilities", "maximum-bearer-pre-emption-rate-exceeded", "up-integrity-protection-not-possible", "release-due-to-discontinuous-coverage"}, } -var causeGroupNames = map[CauseGroup]string{ - CauseGroupRadioNetwork: "radioNetwork", - CauseGroupTransport: "transport", - CauseGroupNAS: "nas", - CauseGroupProtocol: "protocol", - CauseGroupMisc: "misc", +var enumCauseTransport = per.Enum[CauseTransport]{ + Root: []string{"transport-resource-unavailable", "unspecified"}, + Extensible: true, } -// ValueName returns the 3GPP name of the cause value, or "unknown". -func (c Cause) ValueName() (name string, index int) { - root, ext, known := causeTablesFor(c.Group) - if !known { - return "unknown", c.Value - } - - names, base := root, 0 - if c.Extended { - names, base = ext, len(root) - } - - if c.Value >= 0 && c.Value < len(names) { - return names[c.Value], base + c.Value - } - - return "unknown", base + c.Value +var enumCauseNas = per.Enum[CauseNas]{ + Root: []string{"normal-release", "authentication-failure", "detach", "unspecified"}, + Extension: []string{"csg-subscription-expiry", "uE-not-in-PLMN-serving-area", "iab-not-authorized"}, } -// String renders a cause as "radioNetwork: unspecified (0)". -func (c Cause) String() string { - group, ok := causeGroupNames[c.Group] - if !ok { - return fmt.Sprintf("group-%d: value-%d", int(c.Group), c.Value) - } - - name, index := c.ValueName() +var enumCauseProtocol = per.Enum[CauseProtocol]{ + Root: []string{"transfer-syntax-error", "abstract-syntax-error-reject", "abstract-syntax-error-ignore-and-notify", "message-not-compatible-with-receiver-state", "semantic-error", "abstract-syntax-error-falsely-constructed-message", "unspecified"}, + Extensible: true, +} - return fmt.Sprintf("%s: %s (%d)", group, name, index) +var enumCauseMisc = per.Enum[CauseMisc]{ + Root: []string{"control-processing-overload", "not-enough-user-plane-processing-resources", "hardware-failure", "om-intervention", "unspecified", "unknown-PLMN"}, + Extensible: true, } diff --git a/s1ap/cause_test.go b/s1ap/cause_test.go index 3e9cd2e147..c4c3aa4e3e 100644 --- a/s1ap/cause_test.go +++ b/s1ap/cause_test.go @@ -8,14 +8,14 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestCauseKnownVector(t *testing.T) { - // protocol (group 3 of 5) / abstract-syntax-error-reject (value 1 of 7): - // choice ext 0 + idx 011, enum ext 0 + idx 001 => 0 011 0 001 = 0x31. w := per.NewWriter() - if err := (Cause{Group: CauseGroupProtocol, Value: 1}).MarshalPER(w, per.Aligned); err != nil { + c := CauseProtocolAbstractSyntaxErrorReject.Cause() + if err := c.MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } @@ -26,54 +26,109 @@ func TestCauseKnownVector(t *testing.T) { func TestCauseRoundTrip(t *testing.T) { cases := []Cause{ - {CauseGroupRadioNetwork, 0, false}, - {CauseGroupRadioNetwork, 35, false}, // last root value - {CauseGroupRadioNetwork, 0, true}, // an extension value - {CauseGroupTransport, 1, false}, - {CauseGroupNAS, 3, false}, - {CauseGroupProtocol, 6, false}, - {CauseGroupMisc, 5, false}, - {CauseGroupMisc, 2, true}, + CauseRadioNetworkUnspecified.Cause(), + CauseRadioNetworkX2HandoverTriggered.Cause(), + CauseRadioNetworkRedirectionTowards1xRTT.Cause(), + CauseRadioNetworkReleaseDueToDiscontinuousCoverage.Cause(), + CauseTransportUnspecified.Cause(), + CauseNASUnspecified.Cause(), + CauseNASIABNotAuthorized.Cause(), + CauseProtocolUnspecified.Cause(), + CauseMiscUnknownPLMN.Cause(), + CauseMisc(8).Cause(), } for _, c := range cases { w := per.NewWriter() if err := c.MarshalPER(w, per.Aligned); err != nil { - t.Fatalf("%+v: encode: %v", c, err) + t.Fatalf("%v: encode: %v", c, err) } - got, err := unmarshalPERValue[Cause](perBytes(w)) + b := perBytes(w) + + got, err := unmarshalPERValue[Cause](b) if err != nil { - t.Fatalf("%+v: decode: %v", c, err) + t.Fatalf("%v: decode: %v", c, err) + } + + if !got.Equal(c) { + t.Fatalf("decoded %v, want %v", got, c) } - if got != c { - t.Fatalf("decoded %+v, want %+v", got, c) + if again := ieRaw(t, &got); !bytes.Equal(again, b) { + t.Fatalf("%v: re-encoded % x, want % x", c, again, b) } } } -func TestCauseInvalidGroup(t *testing.T) { - w := per.NewWriter() +func TestCauseRejectsNoOrTwoAlternatives(t *testing.T) { + if err := (&Cause{}).MarshalPER(per.NewWriter(), per.Aligned); err == nil { + t.Fatal("expected an error for a Cause with no alternative") + } + + two := Cause{NAS: Ptr(CauseNASDetach), Misc: Ptr(CauseMiscUnspecified)} + if err := two.MarshalPER(per.NewWriter(), per.Aligned); err == nil { + t.Fatal("expected an error for a Cause with two alternatives") + } +} + +func TestCauseUnknownExtensionAlternativeRoundTrips(t *testing.T) { + in := []byte{0x80, 0x01, 0x2a} + + got, err := unmarshalPERValue[Cause](in) + if err != nil { + t.Fatal(err) + } + + if got.Ext == nil || got.Ext.Index != 0 || got.Ext.Value != "\x2a" { + t.Fatalf("Ext = %+v", got.Ext) + } + + if !got.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Fatal("an unknown Cause alternative must not be comprehended") + } + + if out := ieRaw(t, &got); !bytes.Equal(out, in) { + t.Fatalf("re-encoded % x, want % x", out, in) + } +} + +func TestCauseUnknownExtensionValueRoundTrips(t *testing.T) { + c := CauseTransport(9).Cause() + + b := ieRaw(t, &c) + + got, err := unmarshalPERValue[Cause](b) + if err != nil { + t.Fatal(err) + } + + if got.Transport == nil || *got.Transport != 9 { + t.Fatalf("decoded %v", got) + } - if err := (Cause{Group: 9, Value: 0}).MarshalPER(w, per.Aligned); err == nil { - t.Fatal("expected error for invalid cause group") + if !got.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Fatal("an unknown CauseTransport value must not be comprehended") + } + + if name, idx := got.ValueName(); name != "unknown" || idx != 9 { + t.Fatalf("ValueName = %q, %d", name, idx) } } func TestCauseEnumeratedValueContinuesPastTheRoot(t *testing.T) { - if got := (Cause{Group: CauseGroupNAS, Value: 2}).EnumeratedValue(); got != 2 { + if got := CauseNASDetach.Cause().EnumeratedValue(); got != 2 { t.Fatalf("root value = %d, want 2", got) } - if got := CauseInsufficientUECapabilities.EnumeratedValue(); got != causeGroupRootCount[CauseGroupRadioNetwork]+5 { - t.Fatalf("extension value = %d, want %d", got, causeGroupRootCount[CauseGroupRadioNetwork]+5) + if got := CauseRadioNetworkInsufficientUECapabilities.Cause().EnumeratedValue(); got != len(enumCauseRadioNetwork.Root)+5 { + t.Fatalf("extension value = %d, want %d", got, len(enumCauseRadioNetwork.Root)+5) } } func TestCauseProtocolConstantsMatchTS36413(t *testing.T) { cases := []struct { - value int + value CauseProtocol name string }{ {CauseProtocolTransferSyntaxError, "transfer-syntax-error"}, @@ -85,25 +140,38 @@ func TestCauseProtocolConstantsMatchTS36413(t *testing.T) { {CauseProtocolUnspecified, "unspecified"}, } - if len(cases) != len(protocolRoot) { - t.Fatalf("%d named protocol causes, CauseProtocol has %d root values", len(cases), len(protocolRoot)) + if len(cases) != len(enumCauseProtocol.Root) { + t.Fatalf("%d named protocol causes, CauseProtocol has %d root values", len(cases), len(enumCauseProtocol.Root)) } for i, c := range cases { - if c.value != i { + if int(c.value) != i { t.Errorf("%s = %d, want %d", c.name, c.value, i) } - if got, _ := (Cause{Group: CauseGroupProtocol, Value: c.value}).ValueName(); got != c.name { + if got, _ := c.value.Cause().ValueName(); got != c.name { t.Errorf("value %d named %q, want %q", c.value, got, c.name) } } } +func TestCauseNASIABNotAuthorizedIsRel19ExtensionValue(t *testing.T) { + if got := CauseNASIABNotAuthorized.Name(); got != "iab-not-authorized" { + t.Fatalf("Name = %q", got) + } + + c := CauseNASIABNotAuthorized.Cause() + + if want, got := []byte{0x28, 0x20}, ieRaw(t, &c); !bytes.Equal(got, want) { + t.Fatalf("cause = % x, want % x", got, want) + } +} + func TestCauseMessageNotCompatibleVector(t *testing.T) { w := per.NewWriter() - if err := (Cause{Group: CauseGroupProtocol, Value: CauseProtocolMessageNotCompatible}).MarshalPER(w, per.Aligned); err != nil { + c := CauseProtocolMessageNotCompatible.Cause() + if err := c.MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } diff --git a/s1ap/cell_identity_test.go b/s1ap/cell_identity_test.go index 89a49b7a0d..940bcf5967 100644 --- a/s1ap/cell_identity_test.go +++ b/s1ap/cell_identity_test.go @@ -14,26 +14,25 @@ import ( // fixes — the fact a caller cannot see, and the one this API keeps out of them. func TestCellIdentityComposition(t *testing.T) { tests := []struct { - kind ENBIDKind - enbID uint32 + id ENBID cellID uint32 want uint32 }{ - {ENBIDMacro, 0x1a2b3, 1, 0x1a2b301}, // 20-bit macro, 8-bit cell - {ENBIDMacro, 0x00010, 0, 0x1000}, - {ENBIDHome, 0xabcdef1, 0, 0xabcdef1}, // 28-bit home eNB: the ECI is the eNB id itself + {ENBID{MacroENBID: Ptr(MacroENBID(0x1a2b3))}, 1, 0x1a2b301}, // 20-bit macro, 8-bit cell + {ENBID{MacroENBID: Ptr(MacroENBID(0x00010))}, 0, 0x1000}, + {ENBID{HomeENBID: Ptr(HomeENBID(0xabcdef1))}, 0, 0xabcdef1}, // 28-bit home eNB: the ECI is the eNB id itself } for _, tt := range tests { - id := ENBID{Kind: tt.kind, Value: tt.enbID} + id := tt.id got, err := id.CellIdentity(tt.cellID) if err != nil { - t.Fatalf("kind %d id %#x: %v", tt.kind, tt.enbID, err) + t.Fatalf("%v: %v", id, err) } if got != tt.want { - t.Errorf("kind %d id %#x cell %#x = %#x, want %#x", tt.kind, tt.enbID, tt.cellID, got, tt.want) + t.Errorf("%v cell %#x = %#x, want %#x", id, tt.cellID, got, tt.want) } cell, ok := id.SplitCellIdentity(got) @@ -44,29 +43,29 @@ func TestCellIdentityComposition(t *testing.T) { } func TestCellIdentityRejectsOverflow(t *testing.T) { - macro := ENBID{Kind: ENBIDMacro, Value: 0x1a2b3} + macro := ENBID{MacroENBID: Ptr(MacroENBID(0x1a2b3))} // A 20-bit macro id leaves 8 bits for the cell. if _, err := macro.CellIdentity(1 << 8); err == nil { t.Error("a cell id wider than the space left was accepted") } - if _, err := (ENBID{Kind: ENBIDMacro, Value: 0xffffff}).CellIdentity(0); err == nil { + if _, err := (ENBID{MacroENBID: Ptr(MacroENBID(0xffffff))}).CellIdentity(0); err == nil { t.Error("an eNB id exceeding its own bit width was accepted") } - if _, err := (ENBID{Kind: 99, Value: 1}).CellIdentity(0); err == nil { - t.Error("an unknown eNB id kind was accepted") + if _, err := (ENBID{Ext: &per.ExtensionAlternative{Index: 2, Value: "\x00"}}).CellIdentity(0); err == nil { + t.Error("an unknown eNB id alternative was accepted") } // A home eNB ID is itself the 28-bit cell identity, so only cell 0 exists. - if _, err := (ENBID{Kind: ENBIDHome, Value: 0xabcdef1}).CellIdentity(1); err == nil { + if _, err := (ENBID{HomeENBID: Ptr(HomeENBID(0xabcdef1))}).CellIdentity(1); err == nil { t.Error("a non-zero cell id on a home eNB was accepted") } } func TestENBIDHex(t *testing.T) { - if got := (ENBID{Kind: ENBIDMacro, Value: 0x1a2b3}).Hex(); got != "1a2b3" { + if got := (ENBID{MacroENBID: Ptr(MacroENBID(0x1a2b3))}).Hex(); got != "1a2b3" { t.Errorf("Hex() = %q, want 1a2b3", got) } } @@ -76,11 +75,11 @@ func TestENBIDHex(t *testing.T) { func TestEUTRANCGIRejectsOverWideCellIdentity(t *testing.T) { plmn := PLMNIdentity{0x00, 0xf1, 0x10} - if err := (EUTRANCGI{PLMNIdentity: plmn, CellID: 0xfffffff}).MarshalPER(per.NewWriter(), per.Aligned); err != nil { + if err := (&EUTRANCGI{PLMNIdentity: plmn, CellID: 0xfffffff}).MarshalPER(per.NewWriter(), per.Aligned); err != nil { t.Fatalf("the widest 28-bit cell identity must encode: %v", err) } - if err := (EUTRANCGI{PLMNIdentity: plmn, CellID: 1 << 28}).MarshalPER(per.NewWriter(), per.Aligned); err == nil { + if err := (&EUTRANCGI{PLMNIdentity: plmn, CellID: 1 << 28}).MarshalPER(per.NewWriter(), per.Aligned); err == nil { t.Fatal("a 29-bit cell identity encoded, want an error") } } diff --git a/s1ap/common.go b/s1ap/common.go index 01d34f5592..5fdacea62a 100644 --- a/s1ap/common.go +++ b/s1ap/common.go @@ -17,81 +17,32 @@ // [AbstractSyntaxError]. Anything §10.3.4.2 and §10.3.5 let a receiver carry on // past is not an error: the message is returned and [Diagnostics] reports it. // -// Unmodeled IEs are preserved and re-emitted on encode. Preservation and -// diagnostics are both bounded, since a peer chooses how many IEs to send. +// Unmodeled IEs are preserved and re-emitted on encode. package s1ap import ( - "fmt" - - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func Ptr[T any](v T) *T { return &v } // Not extensible. -type Criticality uint8 +type Criticality = ap.Criticality const ( - CriticalityReject Criticality = iota - CriticalityIgnore - CriticalityNotify + CriticalityReject = ap.CriticalityReject + CriticalityIgnore = ap.CriticalityIgnore + CriticalityNotify = ap.CriticalityNotify criticalityRootCount = 3 ) -func (c Criticality) String() string { - if name, ok := criticalityNames[c]; ok { - return name - } - - return fmt.Sprintf("Criticality(%d)", uint8(c)) -} - -// encodeRootEnumerated refuses to encode a value outside the root. -// per.EncodeEnumerated would take it as the (v-nRoot)'th extension addition and -// put a value 3GPP has not defined on the wire. -func encodeRootEnumerated(w *per.Writer, enc per.Encoding, nRoot, v int64, name string) error { - if v < 0 || v >= nRoot { - return fmt.Errorf("s1ap: %s %d outside the root values", name, v) - } - - return per.EncodeEnumerated(w, enc, nRoot, true, v) -} - -// An extension value decodes as nRoot+k, which narrows back onto a root value -// in these small Go enum types, so it is refused: §10.3.1 case 6 handles it on -// the IE's criticality. -func decodeRootEnumerated(r *per.Reader, enc per.Encoding, nRoot int64, name string) (int64, error) { - idx, err := per.DecodeEnumerated(r, enc, nRoot, true) - if err != nil { - return 0, err - } - - if idx >= nRoot { - return 0, fmt.Errorf("%w: %s extension value %d", errNotComprehended, name, idx) - } - - return idx, nil -} - -// presence is the TS 36.413 §9.1 tabular "Presence" column. -type presence uint8 - -const ( - presenceOptional presence = iota - presenceConditional - presenceMandatory -) - type TriggeringMessage uint8 const ( TriggeringInitiatingMessage TriggeringMessage = iota TriggeringSuccessfulOutcome TriggeringUnsuccessfulOutcome - - triggeringMessageRootCount = 3 ) // ProtocolIEID ::= INTEGER (0..65535). @@ -169,4 +120,5 @@ const ( ProcHandoverSuccess ProcedureCode = 64 ProcENBEarlyStatusTransfer ProcedureCode = 65 ProcMMEEarlyStatusTransfer ProcedureCode = 66 + ProcS1Removal ProcedureCode = 67 ) diff --git a/s1ap/comparable_test.go b/s1ap/comparable_test.go new file mode 100644 index 0000000000..2f0ee498e3 --- /dev/null +++ b/s1ap/comparable_test.go @@ -0,0 +1,78 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "reflect" + "testing" +) + +func requireComparable[T comparable]() reflect.Type { return reflect.TypeFor[T]() } + +func identityTypesWithValueEquality() []reflect.Type { + return []reflect.Type{ + requireComparable[PLMNIdentity](), + requireComparable[TAI](), + requireComparable[GUMMEI](), + requireComparable[EUTRANCGI](), + requireComparable[AllocationAndRetentionPriority](), + requireComparable[GTPTEID](), + requireComparable[TransportLayerAddress](), + requireComparable[TransportInformation](), + requireComparable[ERABSetupItemCtxtSURes](), + requireComparable[ERABToBeSwitchedULItem](), + requireComparable[ERABToBeModifiedItemBearerModInd](), + requireComparable[NRCGI](), + requireComparable[UES1APIDPair](), + requireComparable[SecurityAlgorithms](), + } +} + +func identityTypesWithPointerComponents() []reflect.Type { + return []reflect.Type{ + requireComparable[ENBID](), + requireComparable[GlobalENBID](), + requireComparable[GNBIdentity](), + requireComparable[GlobalRANNodeID](), + requireComparable[UES1APIDs](), + requireComparable[TunnelInformation](), + } +} + +func referenceFree(t reflect.Type, seen map[reflect.Type]bool) bool { + if seen[t] { + return true + } + + seen[t] = true + + switch t.Kind() { + case reflect.Pointer, reflect.Slice, reflect.Map, reflect.Func, reflect.Interface, reflect.Chan, reflect.UnsafePointer: + return false + case reflect.Array: + return referenceFree(t.Elem(), seen) + case reflect.Struct: + for i := range t.NumField() { + if !referenceFree(t.Field(i).Type, seen) { + return false + } + } + } + + return true +} + +func TestIdentityTypesHaveValueEquality(t *testing.T) { + for _, typ := range identityTypesWithValueEquality() { + if !referenceFree(typ, map[reflect.Type]bool{}) { + t.Errorf("%v holds a pointer, slice, map or interface, so == does not compare its value", typ) + } + } + + for _, typ := range identityTypesWithPointerComponents() { + if referenceFree(typ, map[reflect.Type]bool{}) { + t.Errorf("%v now has value equality: move it to identityTypesWithValueEquality", typ) + } + } +} diff --git a/s1ap/config_transfer.go b/s1ap/config_transfer.go index 8bf139de1f..81c704f09c 100644 --- a/s1ap/config_transfer.go +++ b/s1ap/config_transfer.go @@ -4,60 +4,24 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) -// SONConfigurationTransfer is held as raw open-type bytes: it is relayed -// verbatim, and only the leading Target eNB-ID is decoded (TS 36.413 §9.2.3.26). -type SONConfigurationTransfer []byte - -func (c SONConfigurationTransfer) MarshalPER(w *per.Writer, _ per.Encoding) error { - return w.WriteOctets(c) -} - -// The extension bit, then a presence bit for iE-Extensions. -const sonConfigurationTransferPreambleBits = 2 - -// TS 36.413 §9.2.3.26. -func (c SONConfigurationTransfer) TargetENBID() (TargeteNBID, error) { - r := per.NewReader(c) - - for range sonConfigurationTransferPreambleBits { - if _, err := r.ReadBit(); err != nil { - return TargeteNBID{}, fmt.Errorf("s1ap: SONConfigurationTransfer preamble: %w", err) - } - } - - var t TargeteNBID - if err := t.UnmarshalPER(r, per.Aligned); err != nil { - return TargeteNBID{}, err - } - - return t, nil -} - // TS 36.413 §9.1.16. type ENBConfigurationTransfer struct { - SONConfigurationTransfer SONConfigurationTransfer + SONConfigurationTransfer *SONConfigurationTransfer messageMeta } var eNBConfigurationTransferIEs = []ieSpec[ENBConfigurationTransfer]{ { - id: IDSONConfigurationTransferECT, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ENBConfigurationTransfer, raw []byte, enc per.Encoding) error { - m.SONConfigurationTransfer = SONConfigurationTransfer(raw) - return nil + ID: IDSONConfigurationTransferECT, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ENBConfigurationTransfer, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.SONConfigurationTransfer) }, - encode: func(m *ENBConfigurationTransfer) (per.Marshaler, bool) { - if m.SONConfigurationTransfer == nil { - return nil, false - } - - return m.SONConfigurationTransfer, true + Encode: func(m *ENBConfigurationTransfer) (per.Marshaler, bool) { + return optionalIE(m.SONConfigurationTransfer) }, }, } @@ -86,9 +50,13 @@ func ParseENBConfigurationTransfer(value []byte) (*ENBConfigurationTransfer, err return parseMessageBody[ENBConfigurationTransfer](ProcENBConfigurationTransfer, TriggeringInitiatingMessage, eNBConfigurationTransferIEs, value) } +func DecodeENBConfigurationTransfer(value []byte) (*ENBConfigurationTransfer, error) { + return decodeMessageBody[ENBConfigurationTransfer](ProcENBConfigurationTransfer, eNBConfigurationTransferIEs, value) +} + // TS 36.413 §9.1.17. type MMEConfigurationTransfer struct { - SONConfigurationTransfer SONConfigurationTransfer + SONConfigurationTransfer *SONConfigurationTransfer messageMeta } @@ -96,17 +64,12 @@ type MMEConfigurationTransfer struct { // IE is optional, so an empty container is a valid message. var mMEConfigurationTransferIEs = []ieSpec[MMEConfigurationTransfer]{ { - id: IDSONConfigurationTransferMCT, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *MMEConfigurationTransfer, raw []byte, enc per.Encoding) error { - m.SONConfigurationTransfer = SONConfigurationTransfer(raw) - return nil + ID: IDSONConfigurationTransferMCT, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *MMEConfigurationTransfer, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.SONConfigurationTransfer) }, - encode: func(m *MMEConfigurationTransfer) (per.Marshaler, bool) { - if m.SONConfigurationTransfer == nil { - return nil, false - } - - return m.SONConfigurationTransfer, true + Encode: func(m *MMEConfigurationTransfer) (per.Marshaler, bool) { + return optionalIE(m.SONConfigurationTransfer) }, }, } @@ -134,3 +97,7 @@ func (m *MMEConfigurationTransfer) Marshal() ([]byte, error) { func ParseMMEConfigurationTransfer(value []byte) (*MMEConfigurationTransfer, error) { return parseMessageBody[MMEConfigurationTransfer](ProcMMEConfigurationTransfer, TriggeringInitiatingMessage, mMEConfigurationTransferIEs, value) } + +func DecodeMMEConfigurationTransfer(value []byte) (*MMEConfigurationTransfer, error) { + return decodeMessageBody[MMEConfigurationTransfer](ProcMMEConfigurationTransfer, mMEConfigurationTransferIEs, value) +} diff --git a/s1ap/config_transfer_test.go b/s1ap/config_transfer_test.go index d81b328547..4b7a8c7236 100644 --- a/s1ap/config_transfer_test.go +++ b/s1ap/config_transfer_test.go @@ -10,31 +10,34 @@ import ( "github.com/ellanetworks/core/per" ) -// sonTransfer builds a valid leading Target eNB-ID (TS 36.413 §9.2.3.26) -// followed by opaque bytes. -func sonTransfer(t *testing.T, target TargeteNBID, opaque []byte) SONConfigurationTransfer { +func sonTransfer(t *testing.T, target TargeteNBID) SONConfigurationTransfer { t.Helper() - w := per.NewWriter() + tla := tlaOf(192, 0, 2, 7) - w.WriteBit(false) - w.WriteBit(false) - - if err := target.MarshalPER(w, per.Aligned); err != nil { - t.Fatalf("encode Target eNB-ID: %v", err) + son := SONConfigurationTransfer{ + TargeteNBID: target, + SourceeNBID: SourceeNBID{ + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x00abd))}}, + SelectedTAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 8}, + }, + SONInformation: SONInformation{SONInformationRequest: Ptr(SONInformationRequestX2TNLConfigurationInfo)}, + X2TNLConfigurationInfo: &X2TNLConfigurationInfo{ENBX2TransportLayerAddresses: ENBX2TLAs{tla}}, + RequestedTNLInfo: &RequestedTNLInfo{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}}, } + son.iEExtensions.Append(rawIE{ID: 40123, Criticality: CriticalityIgnore, Value: []byte{0xde, 0xad}}) - return SONConfigurationTransfer(append(perBytes(w), opaque...)) + return son } -func enbConfigTransferWire(t *testing.T, son SONConfigurationTransfer) []byte { +func enbConfigTransferWire(t *testing.T, son *SONConfigurationTransfer) []byte { t.Helper() w := per.NewWriter() w.WriteBit(false) - if err := encodeIEContainer(w, per.Aligned, []ieField{{id: IDSONConfigurationTransferECT, crit: CriticalityIgnore, val: son}}); err != nil { + if err := encodeIEContainer(w, per.Aligned, []ieField{{ID: IDSONConfigurationTransferECT, Criticality: CriticalityIgnore, Value: son}}); err != nil { t.Fatalf("encode IE container: %v", err) } @@ -43,14 +46,14 @@ func enbConfigTransferWire(t *testing.T, son SONConfigurationTransfer) []byte { func TestENBConfigurationTransfer_RelayRoundTrip(t *testing.T) { target := TargeteNBID{ - GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 0x00abc}}, + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x00abc))}}, SelectedTAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 7}, } - opaque := []byte{0xde, 0xad, 0xbe, 0xef} - son := sonTransfer(t, target, opaque) + son := sonTransfer(t, target) + sonWire := ieRaw(t, &son) // Decode the ENB CONFIGURATION TRANSFER as the MME receives it. - msg, err := ParseENBConfigurationTransfer(enbConfigTransferWire(t, son)) + msg, err := ParseENBConfigurationTransfer(enbConfigTransferWire(t, &son)) if err != nil { t.Fatalf("ParseENBConfigurationTransfer: %v", err) } @@ -59,17 +62,18 @@ func TestENBConfigurationTransfer_RelayRoundTrip(t *testing.T) { t.Fatal("SON Configuration Transfer IE missing") } - if !bytes.Equal(msg.SONConfigurationTransfer, son) { - t.Fatalf("SON value not preserved: got %x want %x", msg.SONConfigurationTransfer, son) + if got := ieRaw(t, msg.SONConfigurationTransfer); !bytes.Equal(got, sonWire) { + t.Fatalf("SON value not preserved: got %x want %x", got, sonWire) } - // Routing: the leading Target eNB-ID must decode to the destination eNB. - got, err := msg.SONConfigurationTransfer.TargetENBID() - if err != nil { - t.Fatalf("TargetENBID: %v", err) + if msg.SONConfigurationTransfer.X2TNLConfigurationInfo == nil || msg.SONConfigurationTransfer.RequestedTNLInfo == nil { + t.Fatalf("typed extensions lost: %+v", msg.SONConfigurationTransfer) } - if got.GlobalENBID != target.GlobalENBID || got.SelectedTAI != target.SelectedTAI { + // Routing: the leading Target eNB-ID must decode to the destination eNB. + got := msg.SONConfigurationTransfer.TargeteNBID + + if !got.GlobalENBID.Equal(target.GlobalENBID) || got.SelectedTAI != target.SelectedTAI { t.Fatalf("Target eNB-ID mismatch: got %+v want %+v", got, target) } @@ -91,8 +95,8 @@ func TestENBConfigurationTransfer_RelayRoundTrip(t *testing.T) { } relayed := relayedSON(t, im.Value) - if !bytes.Equal(relayed, son) { - t.Fatalf("relayed SON not verbatim: got %x want %x", relayed, son) + if !bytes.Equal(relayed, sonWire) { + t.Fatalf("relayed SON not verbatim: got %x want %x", relayed, sonWire) } } @@ -113,8 +117,8 @@ func relayedSON(t *testing.T, value []byte) []byte { } for _, f := range fields { - if f.id == IDSONConfigurationTransferMCT { - return f.value + if f.ID == IDSONConfigurationTransferMCT { + return f.Value } } @@ -138,14 +142,19 @@ func TestENBConfigurationTransfer_NoSONIE(t *testing.T) { } if msg.SONConfigurationTransfer != nil { - t.Fatalf("expected nil SON Configuration Transfer, got %x", msg.SONConfigurationTransfer) + t.Fatalf("expected nil SON Configuration Transfer, got %+v", msg.SONConfigurationTransfer) } } // §8.15.2/§8.16.2 relay the transfer verbatim, so the payload must survive // untouched in both directions. func TestConfigurationTransferRelaysVerbatimBothDirections(t *testing.T) { - transfer := SONConfigurationTransfer{0x01, 0x02, 0x03, 0x04} + target := TargeteNBID{ + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{HomeENBID: Ptr(HomeENBID(0x1234567))}}, + SelectedTAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 9}, + } + son := sonTransfer(t, target) + transfer := &son t.Run("eNB to MME", func(t *testing.T) { b, err := (&ENBConfigurationTransfer{SONConfigurationTransfer: transfer}).Marshal() @@ -168,8 +177,8 @@ func TestConfigurationTransferRelaysVerbatimBothDirections(t *testing.T) { t.Fatal(err) } - if !bytes.Equal(out.SONConfigurationTransfer, transfer) { - t.Errorf("transfer = %x, want %x", out.SONConfigurationTransfer, transfer) + if got, want := ieRaw(t, out.SONConfigurationTransfer), ieRaw(t, transfer); !bytes.Equal(got, want) { + t.Errorf("transfer = %x, want %x", got, want) } }) @@ -194,8 +203,8 @@ func TestConfigurationTransferRelaysVerbatimBothDirections(t *testing.T) { t.Fatal(err) } - if !bytes.Equal(out.SONConfigurationTransfer, transfer) { - t.Errorf("transfer = %x, want %x", out.SONConfigurationTransfer, transfer) + if got, want := ieRaw(t, out.SONConfigurationTransfer), ieRaw(t, transfer); !bytes.Equal(got, want) { + t.Errorf("transfer = %x, want %x", got, want) } }) } diff --git a/s1ap/criticality_diagnostics.go b/s1ap/criticality_diagnostics.go index bc9a27959e..716eb53919 100644 --- a/s1ap/criticality_diagnostics.go +++ b/s1ap/criticality_diagnostics.go @@ -4,8 +4,6 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -22,115 +20,19 @@ const ( // CriticalityDiagnosticsIEItem reports one offending IE (TS 36.413). type CriticalityDiagnosticsIEItem struct { - _ [0]struct{} `per:"extseq"` - IECriticality Criticality `per:"ENUMERATED,range:0..2"` - IEID ProtocolIEID `per:",range:0..65535"` - TypeOfError TypeOfError `per:"ENUMERATED,range:0..1,..."` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + IECriticality Criticality `per:"ENUMERATED,range:0..2"` + IEID ProtocolIEID `per:",range:0..65535"` + TypeOfError TypeOfError + iEExtensions extensionMeta `per:",exttable"` } // CriticalityDiagnostics ::= SEQUENCE (extensible) with five optional fields. -// iE-Extensions is never emitted and is skipped on decode. type CriticalityDiagnostics struct { - ProcedureCode *ProcedureCode - TriggeringMessage *TriggeringMessage - ProcedureCriticality *Criticality - IEsCriticalityDiagnostics []CriticalityDiagnosticsIEItem -} - -func (d CriticalityDiagnostics) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(d.ProcedureCode != nil) - w.WriteBit(d.TriggeringMessage != nil) - w.WriteBit(d.ProcedureCriticality != nil) - w.WriteBit(len(d.IEsCriticalityDiagnostics) > 0) - w.WriteBit(false) - - if d.ProcedureCode != nil { - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}, int64(*d.ProcedureCode)); err != nil { - return err - } - } - - if d.TriggeringMessage != nil { - if err := per.EncodeEnumerated(w, enc, triggeringMessageRootCount, false, int64(*d.TriggeringMessage)); err != nil { - return err - } - } - - if d.ProcedureCriticality != nil { - if err := per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(*d.ProcedureCriticality)); err != nil { - return err - } - } - - if len(d.IEsCriticalityDiagnostics) > 0 { - if len(d.IEsCriticalityDiagnostics) > maxnoofErrors { - return fmt.Errorf("s1ap: %d criticality-diagnostics items exceed maxnoofErrors", len(d.IEsCriticalityDiagnostics)) - } - - if err := marshalSeqOf(w, enc, 1, maxnoofErrors, d.IEsCriticalityDiagnostics); err != nil { - return err - } - } - - return nil -} - -func (d *CriticalityDiagnostics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - var bits [6]bool - - for i := range bits { - b, err := r.ReadBit() - if err != nil { - return fmt.Errorf("s1ap: criticality diagnostics preamble: %w", err) - } - - bits[i] = b - } - - extBit := bits[0] - - *d = CriticalityDiagnostics{} - - if bits[1] { - v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}) - if err != nil { - return fmt.Errorf("s1ap: criticality diagnostics procedureCode: %w", err) - } - - pc := ProcedureCode(v) - d.ProcedureCode = &pc - } - - if bits[2] { - v, err := per.DecodeEnumerated(r, enc, triggeringMessageRootCount, false) - if err != nil { - return fmt.Errorf("s1ap: criticality diagnostics triggeringMessage: %w", err) - } - - tm := TriggeringMessage(v) - d.TriggeringMessage = &tm - } - - if bits[3] { - v, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return fmt.Errorf("s1ap: criticality diagnostics procedureCriticality: %w", err) - } - - c := Criticality(v) - d.ProcedureCriticality = &c - } - - if bits[4] { - items, err := unmarshalSeqOf[CriticalityDiagnosticsIEItem](r, enc, 1, maxnoofErrors) - if err != nil { - return err - } - - d.IEsCriticalityDiagnostics = items - } - - return skipSequenceExtensionsPER(r, enc, bits[5], extBit) + ProcedureCode *ProcedureCode `per:",optional,range:0..255"` + TriggeringMessage *TriggeringMessage `per:",optional"` + ProcedureCriticality *Criticality `per:"ENUMERATED,range:0..2,optional"` + IEsCriticalityDiagnostics []CriticalityDiagnosticsIEItem `per:"SEQUENCE-OF,size:1..256,optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } diff --git a/s1ap/criticality_diagnostics_test.go b/s1ap/criticality_diagnostics_test.go index a8eedaeb54..5a63ee6ea5 100644 --- a/s1ap/criticality_diagnostics_test.go +++ b/s1ap/criticality_diagnostics_test.go @@ -13,7 +13,7 @@ import ( func TestCriticalityDiagnosticsEmpty(t *testing.T) { w := per.NewWriter() - if err := (CriticalityDiagnostics{}).MarshalPER(w, per.Aligned); err != nil { + if err := (&CriticalityDiagnostics{}).MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } @@ -136,7 +136,7 @@ func TestCriticalityDiagnosticsPartial(t *testing.T) { pc := ProcErrorIndication w := per.NewWriter() - if err := (CriticalityDiagnostics{ProcedureCode: &pc}).MarshalPER(w, per.Aligned); err != nil { + if err := (&CriticalityDiagnostics{ProcedureCode: &pc}).MarshalPER(w, per.Aligned); err != nil { t.Fatal(err) } diff --git a/s1ap/decode_total_test.go b/s1ap/decode_total_test.go new file mode 100644 index 0000000000..61f4498f5a --- /dev/null +++ b/s1ap/decode_total_test.go @@ -0,0 +1,141 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "errors" + "testing" + + "github.com/ellanetworks/core/per/ap" +) + +type totalCase struct { + name string + value []byte + decode func([]byte) (interface{ Marshal() ([]byte, error) }, error) + parse func([]byte) error + cause *CauseProtocol + ies []ProtocolIEID +} + +func checkTotal(t *testing.T, tc totalCase) { + t.Helper() + + m, err := tc.decode(tc.value) + if err != nil { + t.Fatalf("Decode: %v", err) + } + + b, err := m.Marshal() + if err != nil { + t.Fatalf("Marshal: %v", err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(pdu.value(), tc.value) { + t.Fatalf("Marshal(Decode(b))\n got %x\n want %x", pdu.value(), tc.value) + } + + err = tc.parse(tc.value) + if tc.cause == nil { + if err != nil { + t.Fatalf("Parse: %v", err) + } + + return + } + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) { + t.Fatalf("Parse = %v, want *AbstractSyntaxError", err) + } + + if !ase.Cause.Equal(tc.cause.Cause()) { + t.Fatalf("cause = %v, want %v", ase.Cause, *tc.cause) + } + + if len(ase.IEs) != len(tc.ies) { + t.Fatalf("IEs = %+v, want %v", ase.IEs, tc.ies) + } + + for i, id := range tc.ies { + if ase.IEs[i].IEID != id { + t.Fatalf("IEs = %+v, want %v", ase.IEs, tc.ies) + } + } +} + +func uplinkNASCase(name string, fields []ieField, t *testing.T, cause *CauseProtocol, ies ...ProtocolIEID) totalCase { + return totalCase{ + name: name, + value: container(t, fields...), + decode: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return DecodeUplinkNASTransport(b) + }, + parse: func(b []byte) error { + _, err := ParseUplinkNASTransport(b) + return err + }, + cause: cause, + ies: ies, + } +} + +func TestDecodeIsTotalAndLossless(t *testing.T) { + reject := CauseProtocolAbstractSyntaxErrorReject + falsely := CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage + f := uplinkNASFields() + + unknownIgnore := ieField{ID: 40000, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})} + unknownReject := ieField{ID: 40001, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x02})} + + item := ERABToBeSetupItemBearerSUReq{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, NASPDU: NASPDU{0x01}} + item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityReject, Value: []byte{0x5a}}) + + nested, err := Unmarshal(marshalT(t, &ERABSetupRequest{MMEUES1APID: 1, ENBUES1APID: 2, ERABToBeSetup: []ERABToBeSetupItemBearerSUReq{item}})) + if err != nil { + t.Fatal(err) + } + + cases := []totalCase{ + uplinkNASCase("unknown ignore IE", []ieField{f[0], unknownIgnore, f[1], f[2], f[3], f[4]}, t, nil), + uplinkNASCase("unknown reject IE", []ieField{f[0], f[1], f[2], unknownReject, f[3], f[4]}, t, &reject, 40001), + uplinkNASCase("missing mandatory IE", []ieField{f[0], f[1], f[3], f[4]}, t, &reject, IDNASPDU), + uplinkNASCase("duplicate IE", []ieField{f[0], f[0], f[1], f[2], f[3], f[4]}, t, &falsely), + uplinkNASCase("wrong order", []ieField{f[1], f[0], f[2], f[3], f[4]}, t, &falsely), + { + name: "unknown reject extension nested in an item", + value: nested.value(), + decode: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return DecodeERABSetupRequest(b) + }, + parse: func(b []byte) error { + _, err := ParseERABSetupRequest(b) + return err + }, + cause: &reject, + ies: []ProtocolIEID{9999}, + }, + } + + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { checkTotal(t, tc) }) + } +} + +func marshalT(t *testing.T, m interface{ Marshal() ([]byte, error) }) []byte { + t.Helper() + + b, err := m.Marshal() + if err != nil { + t.Fatal(err) + } + + return b +} diff --git a/s1ap/diagnose.go b/s1ap/diagnose.go new file mode 100644 index 0000000000..d814fcc89b --- /dev/null +++ b/s1ap/diagnose.go @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import "github.com/ellanetworks/core/per/ap" + +func diagnoseItems[T any](d *ap.Diagnosis[ProtocolIEID], items []T) bool { + notComprehended := false + + for i := range items { + if diagnoseOptional(d, &items[i]) { + notComprehended = true + } + } + + return notComprehended +} + +func diagnoseOptional[T any](d *ap.Diagnosis[ProtocolIEID], v *T) bool { + if v == nil { + return false + } + + dv, ok := any(v).(ap.Diagnosable[ProtocolIEID]) + + return ok && dv.Diagnose(d) +} diff --git a/s1ap/diagnostics_bound_test.go b/s1ap/diagnostics_bound_test.go index af323289da..0a1cddd9bf 100644 --- a/s1ap/diagnostics_bound_test.go +++ b/s1ap/diagnostics_bound_test.go @@ -6,6 +6,8 @@ package s1ap import ( "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) // CriticalityDiagnostics-IE-List is SIZE(1..maxnoofErrors), so an untruncated @@ -14,9 +16,9 @@ func TestNotUnderstoodReportStaysSendable(t *testing.T) { fields := make([]ieField, 0, maxnoofErrors+64) for i := range cap(fields) { fields = append(fields, ieField{ - id: ProtocolIEID(40000 + i), // outside every id this version models - crit: CriticalityReject, - raw: []byte{0x00}, + ID: ProtocolIEID(40000 + i), // outside every id this version models + Criticality: CriticalityReject, + Value: ap.RawValue([]byte{0x00}), }) } diff --git a/s1ap/enb_config_update.go b/s1ap/enb_config_update.go index 241df0b891..7f6c44e382 100644 --- a/s1ap/enb_config_update.go +++ b/s1ap/enb_config_update.go @@ -18,20 +18,20 @@ type ENBConfigurationUpdate struct { var eNBConfigurationUpdateIEs = []ieSpec[ENBConfigurationUpdate]{ { - id: IDENBname, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ENBConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDENBname, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ENBConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { name := string(n) m.ENBName = &name } return err }, - encode: func(m *ENBConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *ENBConfigurationUpdate) (per.Marshaler, bool) { if m.ENBName == nil { return nil, false } @@ -40,11 +40,11 @@ var eNBConfigurationUpdateIEs = []ieSpec[ENBConfigurationUpdate]{ }, }, { - id: IDSupportedTAs, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *ENBConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SupportedTAs) + ID: IDSupportedTAs, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *ENBConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SupportedTAs) }, - encode: func(m *ENBConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *ENBConfigurationUpdate) (per.Marshaler, bool) { if len(m.SupportedTAs) == 0 { return nil, false } @@ -53,11 +53,11 @@ var eNBConfigurationUpdateIEs = []ieSpec[ENBConfigurationUpdate]{ }, }, { - id: IDDefaultPagingDRX, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ENBConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDDefaultPagingDRX, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ENBConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var drx PagingDRX - if err := perIEDecode(raw, &drx); err != nil { + if err := decodeIE(r, &drx); err != nil { return err } @@ -65,7 +65,7 @@ var eNBConfigurationUpdateIEs = []ieSpec[ENBConfigurationUpdate]{ return nil }, - encode: func(m *ENBConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *ENBConfigurationUpdate) (per.Marshaler, bool) { if m.DefaultPagingDRX == nil { return nil, false } @@ -99,6 +99,10 @@ func ParseENBConfigurationUpdate(value []byte) (*ENBConfigurationUpdate, error) return parseMessageBody[ENBConfigurationUpdate](ProcENBConfigurationUpdate, TriggeringInitiatingMessage, eNBConfigurationUpdateIEs, value) } +func DecodeENBConfigurationUpdate(value []byte) (*ENBConfigurationUpdate, error) { + return decodeMessageBody[ENBConfigurationUpdate](ProcENBConfigurationUpdate, eNBConfigurationUpdateIEs, value) +} + // TS 36.413 §9.1.8.8. type ENBConfigurationUpdateAcknowledge struct { CriticalityDiagnostics *CriticalityDiagnostics @@ -108,11 +112,11 @@ type ENBConfigurationUpdateAcknowledge struct { var eNBConfigurationUpdateAcknowledgeIEs = []ieSpec[ENBConfigurationUpdateAcknowledge]{ { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ENBConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ENBConfigurationUpdateAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -120,7 +124,7 @@ var eNBConfigurationUpdateAcknowledgeIEs = []ieSpec[ENBConfigurationUpdateAcknow return nil }, - encode: func(m *ENBConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + Encode: func(m *ENBConfigurationUpdateAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -154,6 +158,10 @@ func ParseENBConfigurationUpdateAcknowledge(value []byte) (*ENBConfigurationUpda return parseMessageBody[ENBConfigurationUpdateAcknowledge](ProcENBConfigurationUpdate, TriggeringSuccessfulOutcome, eNBConfigurationUpdateAcknowledgeIEs, value) } +func DecodeENBConfigurationUpdateAcknowledge(value []byte) (*ENBConfigurationUpdateAcknowledge, error) { + return decodeMessageBody[ENBConfigurationUpdateAcknowledge](ProcENBConfigurationUpdate, eNBConfigurationUpdateAcknowledgeIEs, value) +} + // TS 36.413 §9.1.8.9. type ENBConfigurationUpdateFailure struct { Cause *Cause @@ -165,11 +173,11 @@ type ENBConfigurationUpdateFailure struct { var eNBConfigurationUpdateFailureIEs = []ieSpec[ENBConfigurationUpdateFailure]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ENBConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ENBConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -177,7 +185,7 @@ var eNBConfigurationUpdateFailureIEs = []ieSpec[ENBConfigurationUpdateFailure]{ return nil }, - encode: func(m *ENBConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *ENBConfigurationUpdateFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -186,11 +194,11 @@ var eNBConfigurationUpdateFailureIEs = []ieSpec[ENBConfigurationUpdateFailure]{ }, }, { - id: IDTimeToWait, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ENBConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDTimeToWait, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ENBConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var ttw TimeToWait - if err := perIEDecode(raw, &ttw); err != nil { + if err := decodeIE(r, &ttw); err != nil { return err } @@ -198,7 +206,7 @@ var eNBConfigurationUpdateFailureIEs = []ieSpec[ENBConfigurationUpdateFailure]{ return nil }, - encode: func(m *ENBConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *ENBConfigurationUpdateFailure) (per.Marshaler, bool) { if m.TimeToWait == nil { return nil, false } @@ -207,11 +215,11 @@ var eNBConfigurationUpdateFailureIEs = []ieSpec[ENBConfigurationUpdateFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ENBConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ENBConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -219,7 +227,7 @@ var eNBConfigurationUpdateFailureIEs = []ieSpec[ENBConfigurationUpdateFailure]{ return nil }, - encode: func(m *ENBConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *ENBConfigurationUpdateFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -252,3 +260,7 @@ func (m *ENBConfigurationUpdateFailure) Marshal() ([]byte, error) { func ParseENBConfigurationUpdateFailure(value []byte) (*ENBConfigurationUpdateFailure, error) { return parseMessageBody[ENBConfigurationUpdateFailure](ProcENBConfigurationUpdate, TriggeringUnsuccessfulOutcome, eNBConfigurationUpdateFailureIEs, value) } + +func DecodeENBConfigurationUpdateFailure(value []byte) (*ENBConfigurationUpdateFailure, error) { + return decodeMessageBody[ENBConfigurationUpdateFailure](ProcENBConfigurationUpdate, eNBConfigurationUpdateFailureIEs, value) +} diff --git a/s1ap/enb_config_update_test.go b/s1ap/enb_config_update_test.go index e2c02a9756..e1d773b329 100644 --- a/s1ap/enb_config_update_test.go +++ b/s1ap/enb_config_update_test.go @@ -68,7 +68,7 @@ func TestENBConfigurationUpdateAcknowledgeRoundTrips(t *testing.T) { } func TestENBConfigurationUpdateFailureRoundTrips(t *testing.T) { - in := &ENBConfigurationUpdateFailure{Cause: Ptr(Cause{Group: CauseGroupMisc, Value: 5})} + in := &ENBConfigurationUpdateFailure{Cause: Ptr(CauseMiscUnknownPLMN.Cause())} b, err := in.Marshal() if err != nil { @@ -90,7 +90,7 @@ func TestENBConfigurationUpdateFailureRoundTrips(t *testing.T) { t.Fatal(err) } - if deref(out.Cause) != deref(in.Cause) { + if !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("cause mismatch: %+v", out.Cause) } } @@ -106,7 +106,7 @@ func TestENBConfigurationUpdateFailureMissingCause(t *testing.T) { t.Error("Marshal() = nil error, want a required-IE error for the absent Cause") } - value := container(t, ieField{id: IDTimeToWait, crit: CriticalityIgnore, val: TimeToWait(0)}) + value := container(t, ieField{ID: IDTimeToWait, Criticality: CriticalityIgnore, Value: TimeToWait(0)}) msg, err := ParseENBConfigurationUpdateFailure(value) if err != nil { @@ -122,7 +122,7 @@ func TestENBConfigurationUpdateFailureMissingCause(t *testing.T) { var reported bool for _, ie := range diag.IEs { - if ie.ID == IDCause && ie.TypeOfError == TypeOfErrorMissing { + if ie.ID == IDCause && typeOfError(ie) == TypeOfErrorMissing { reported = true } } diff --git a/s1ap/encode_golden_test.go b/s1ap/encode_golden_test.go index f7cd37940d..47790da274 100644 --- a/s1ap/encode_golden_test.go +++ b/s1ap/encode_golden_test.go @@ -12,9 +12,9 @@ import ( // Fixtures for the messages whose mandatory SEQUENCE-OF lists cannot be empty. func goldPLMN() PLMNIdentity { return PLMNIdentity{0x00, 0xf1, 0x10} } -func goldTLA() TransportLayerAddress { return TransportLayerAddress{10, 0, 0, 1} } +func goldTLA() TransportLayerAddress { return tlaOf(10, 0, 0, 1) } func goldERABItem() ERABItem { - return ERABItem{ERABID: 1, Cause: Cause{Group: CauseGroupRadioNetwork, Value: 0}} + return ERABItem{ERABID: 1, Cause: CauseRadioNetworkUnspecified.Cause()} } func goldQoS() ERABLevelQoSParameters { @@ -34,7 +34,7 @@ func TestEncodeBodyGolden(t *testing.T) { {"DownlinkUEAssociatedLPPaTransport", (&DownlinkUEAssociatedLPPaTransport{}).encodeBody, "00000400000002000000080002000000940001000093000100"}, {"ENBConfigurationUpdate", (&ENBConfigurationUpdate{}).encodeBody, "000000"}, {"ENBConfigurationUpdateAcknowledge", (&ENBConfigurationUpdateAcknowledge{}).encodeBody, "000000"}, - {"ENBConfigurationUpdateFailure", (&ENBConfigurationUpdateFailure{Cause: new(Cause)}).encodeBody, "000001000240020000"}, + {"ENBConfigurationUpdateFailure", (&ENBConfigurationUpdateFailure{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000001000240020000"}, {"ENBStatusTransfer", (&ENBStatusTransfer{Container: StatusTransferContainer{0xaa}}).encodeBody, "000003000000020000000800020000005a0001aa"}, {"ERABModificationConfirm", (&ERABModificationConfirm{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}).encodeBody, "000002000040020000000840020000"}, {"ERABModificationIndication", (&ERABModificationIndication{ToBeModified: []ERABToBeModifiedItemBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA(), DLGTPTEID: 1}}}).encodeBody, "00000300000002000000080002000000c7000f0000c8000a021f0a00000100000001"}, @@ -47,16 +47,16 @@ func TestEncodeBodyGolden(t *testing.T) { {"ERABSetupRequest", (&ERABSetupRequest{ERABToBeSetup: []ERABToBeSetupItemBearerSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, NASPDU: NASPDU{0x01}}}}).encodeBody, "000003000000020000000800020000001000150000110010020009040f800a000001000000010101"}, {"ERABSetupResponse", (&ERABSetupResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}).encodeBody, "000002000040020000000840020000"}, {"ErrorIndication", (&ErrorIndication{}).encodeBody, "000000"}, - {"HandoverCancel", (&HandoverCancel{Cause: new(Cause)}).encodeBody, "000003000000020000000800020000000240020000"}, + {"HandoverCancel", (&HandoverCancel{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000003000000020000000800020000000240020000"}, {"HandoverCancelAcknowledge", (&HandoverCancelAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}).encodeBody, "000002000040020000000840020000"}, {"HandoverCommand", (&HandoverCommand{TargetToSource: TransparentContainer{0x00}}).encodeBody, "0000040000000200000008000200000001000100007b00020100"}, - {"HandoverFailure", (&HandoverFailure{MMEUES1APID: new(MMEUES1APID), Cause: new(Cause)}).encodeBody, "000002000040020000000240020000"}, + {"HandoverFailure", (&HandoverFailure{MMEUES1APID: new(MMEUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000002000040020000000240020000"}, {"HandoverNotify", (&HandoverNotify{EUTRANCGI: new(EUTRANCGI), TAI: new(TAI)}).encodeBody, "00000400000002000000080002000000644008000000000000000000434006000000000000"}, - {"HandoverPreparationFailure", (&HandoverPreparationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}).encodeBody, "000003000040020000000840020000000240020000"}, - {"HandoverRequest", (&HandoverRequest{Cause: new(Cause), SourceToTarget: TransparentContainer{0x00}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}}).encodeBody, "000008000000020000000100010000024002000000420004000000000035001200001b000d021f0a00000100000001000904006800020100006b0005000000000000280021000000000000000000000000000000000000000000000000000000000000000000"}, + {"HandoverPreparationFailure", (&HandoverPreparationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000003000040020000000840020000000240020000"}, + {"HandoverRequest", (&HandoverRequest{Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), SourceToTarget: TransparentContainer{0x00}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}}).encodeBody, "000008000000020000000100010000024002000000420004000000000035001200001b000d021f0a00000100000001000904006800020100006b0005000000000000280021000000000000000000000000000000000000000000000000000000000000000000"}, {"HandoverRequestAcknowledge", (&HandoverRequestAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), TargetToSource: TransparentContainer{0x00}, ERABAdmitted: []ERABAdmittedItem{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}).encodeBody, "00000400004002000000084002000000124010000014400b0021f00a00000100000001007b00020100"}, - {"HandoverRequired", (&HandoverRequired{Cause: new(Cause), SourceToTarget: TransparentContainer{0x00}}).encodeBody, "00000600000002000000080002000000010001000002400200000004000d00000000000000000000000000006800020100"}, - {"InitialContextSetupFailure", (&InitialContextSetupFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}).encodeBody, "000003000040020000000840020000000240020000"}, + {"HandoverRequired", (&HandoverRequired{Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), TargetID: TargetID{TargeteNBID: &TargeteNBID{GlobalENBID: GlobalENBID{ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0))}}}}, SourceToTarget: TransparentContainer{0x00}}).encodeBody, "00000600000002000000080002000000010001000002400200000004000d00000000000000000000000000006800020100"}, + {"InitialContextSetupFailure", (&InitialContextSetupFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000003000040020000000840020000000240020000"}, {"InitialContextSetupRequest", (&InitialContextSetupRequest{ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}}).encodeBody, "000006000000020000000800020000004200040000000000180013000034000e010009040f800a00000100000001006b00050000000000004900200000000000000000000000000000000000000000000000000000000000000000"}, {"InitialContextSetupResponse", (&InitialContextSetupResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), ERABSetup: []ERABSetupItemCtxtSURes{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}).encodeBody, "0000030000400200000008400200000033400f000032400a021f0a00000100000001"}, {"InitialUEMessage", (&InitialUEMessage{NASPDU: NASPDU{0x07}, EUTRANCGI: new(EUTRANCGI), RRCEstablishmentCause: new(RRCEstablishmentCause)}).encodeBody, "000005000800020000001a00020107004300060000000000000064400800000000000000000086400100"}, @@ -64,25 +64,25 @@ func TestEncodeBodyGolden(t *testing.T) { {"MMEConfigurationTransfer", (&MMEConfigurationTransfer{}).encodeBody, "000000"}, {"MMEConfigurationUpdate", (&MMEConfigurationUpdate{RelativeMMECapacity: new(uint8)}).encodeBody, "0000010057000100"}, {"MMEConfigurationUpdateAcknowledge", (&MMEConfigurationUpdateAcknowledge{}).encodeBody, "000000"}, - {"MMEConfigurationUpdateFailure", (&MMEConfigurationUpdateFailure{Cause: new(Cause)}).encodeBody, "000001000240020000"}, + {"MMEConfigurationUpdateFailure", (&MMEConfigurationUpdateFailure{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000001000240020000"}, {"MMEStatusTransfer", (&MMEStatusTransfer{Container: StatusTransferContainer{0xaa}}).encodeBody, "000003000000020000000800020000005a0001aa"}, - {"NASNonDeliveryIndication", (&NASNonDeliveryIndication{NASPDU: NASPDU{}, Cause: new(Cause)}).encodeBody, "000004000000020000000800020000001a400100000240020000"}, - {"Paging", (&Paging{UEIdentityIndexValue: new(uint16), STMSI: new(STMSI), CNDomain: new(CNDomain), TAIList: []TAI{{PLMNIdentity: goldPLMN(), TAC: 1}}}).encodeBody, "000004005040020000002b4006000000000000006d400100002e400b00002f40060000f1100001"}, + {"NASNonDeliveryIndication", (&NASNonDeliveryIndication{NASPDU: NASPDU{}, Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000004000000020000000800020000001a400100000240020000"}, + {"Paging", (&Paging{UEIdentityIndexValue: new(uint16), UEPagingID: &UEPagingID{STMSI: new(STMSI)}, CNDomain: new(CNDomain), TAIList: TAIList{{TAI: TAI{PLMNIdentity: goldPLMN(), TAC: 1}}}}).encodeBody, "000004005040020000002b4006000000000000006d400100002e400b00002f40060000f1100001"}, {"PathSwitchRequest", (&PathSwitchRequest{EUTRANCGI: new(EUTRANCGI), TAI: new(TAI), UESecurityCapabilities: new(UESecurityCapabilities), ERABToBeSwitchedDL: []ERABToBeSwitchedDLItem{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}).encodeBody, "0000060008000200000016000f000017000a021f0a0000010000000100580002000000644008000000000000000000434006000000000000006b40050000000000"}, {"PathSwitchRequestAcknowledge", (&PathSwitchRequestAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}).encodeBody, "00000300004002000000084002000000280021000000000000000000000000000000000000000000000000000000000000000000"}, - {"PathSwitchRequestFailure", (&PathSwitchRequestFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}).encodeBody, "000003000040020000000840020000000240020000"}, - {"Reset", (&Reset{Cause: new(Cause), ResetType: ResetType{All: true}}).encodeBody, "000002000240020000005c000100"}, + {"PathSwitchRequestFailure", (&PathSwitchRequestFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000003000040020000000840020000000240020000"}, + {"Reset", (&Reset{Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), ResetType: ResetType{S1Interface: Ptr(ResetAllResetAll)}}).encodeBody, "000002000240020000005c000100"}, {"ResetAcknowledge", (&ResetAcknowledge{}).encodeBody, "000000"}, - {"S1SetupFailure", (&S1SetupFailure{Cause: new(Cause)}).encodeBody, "000001000240020000"}, - {"S1SetupRequest", (&S1SetupRequest{DefaultPagingDRX: new(PagingDRX), SupportedTAs: SupportedTAs{{TAC: 1, BroadcastPLMNs: BPLMNs{goldPLMN()}}}}).encodeBody, "000003003b00080000000000000000004000070000004000f1100089400100"}, + {"S1SetupFailure", (&S1SetupFailure{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000001000240020000"}, + {"S1SetupRequest", (&S1SetupRequest{GlobalENBID: GlobalENBID{ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0))}}, DefaultPagingDRX: new(PagingDRX), SupportedTAs: SupportedTAs{{TAC: 1, BroadcastPLMNs: BPLMNs{goldPLMN()}}}}).encodeBody, "000003003b00080000000000000000004000070000004000f1100089400100"}, {"S1SetupResponse", (&S1SetupResponse{RelativeMMECapacity: new(uint8), ServedGUMMEIs: ServedGUMMEIs{{ServedPLMNs: []PLMNIdentity{goldPLMN()}, ServedGroupIDs: []MMEGroupID{{0x80, 0x01}}, ServedMMECs: []MMECode{1}}}}).encodeBody, "0000020069000b000000f1100000800100010057400100"}, {"UECapabilityInfoIndication", (&UECapabilityInfoIndication{UERadioCapability: []byte{}}).encodeBody, "000003000000020000000800020000004a400100"}, - {"UEContextModificationFailure", (&UEContextModificationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}).encodeBody, "000003000040020000000840020000000240020000"}, + {"UEContextModificationFailure", (&UEContextModificationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000003000040020000000840020000000240020000"}, {"UEContextModificationRequest", (&UEContextModificationRequest{UEAggregateMaximumBitRate: &UEAggregateMaximumBitRate{}}).encodeBody, "0000030000000200000008000200000042400400000000"}, {"UEContextModificationResponse", (&UEContextModificationResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}).encodeBody, "000002000040020000000840020000"}, - {"UEContextReleaseCommand", (&UEContextReleaseCommand{Cause: new(Cause)}).encodeBody, "000002006300024000000240020000"}, + {"UEContextReleaseCommand", (&UEContextReleaseCommand{UES1APIDs: UES1APIDs{MMEUES1APID: Ptr(MMEUES1APID(0))}, Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000002006300024000000240020000"}, {"UEContextReleaseComplete", (&UEContextReleaseComplete{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}).encodeBody, "000002000040020000000840020000"}, - {"UEContextReleaseRequest", (&UEContextReleaseRequest{Cause: new(Cause)}).encodeBody, "000003000000020000000800020000000240020000"}, + {"UEContextReleaseRequest", (&UEContextReleaseRequest{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).encodeBody, "000003000000020000000800020000000240020000"}, {"UplinkNASTransport", (&UplinkNASTransport{NASPDU: NASPDU{0x07}, EUTRANCGI: new(EUTRANCGI), TAI: new(TAI)}).encodeBody, "000005000000020000000800020000001a0002010700644008000000000000000000434006000000000000"}, {"UplinkUEAssociatedLPPaTransport", (&UplinkUEAssociatedLPPaTransport{}).encodeBody, "00000400000002000000080002000000940001000093000100"}, } diff --git a/s1ap/enum_encode_test.go b/s1ap/enum_encode_test.go index de39f4596f..2f7a9ca9ee 100644 --- a/s1ap/enum_encode_test.go +++ b/s1ap/enum_encode_test.go @@ -4,44 +4,297 @@ package s1ap import ( + "bytes" + "fmt" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) -// A value outside an extensible ENUMERATED's root must not encode. Left to -// per.EncodeEnumerated it becomes the (v-nRoot)'th extension addition, putting -// a value TS 36.413 has not defined on the wire — the encode-side mirror of the -// decode guard in TestEnumExtensionIsNotComprehended. -func TestEnumOutsideRootIsNotEncoded(t *testing.T) { - tests := []struct { - name string - nRoot int64 - make func(int64) per.Marshaler - }{ - {"PagingDRX", pagingDRXRootCount, func(v int64) per.Marshaler { return PagingDRX(v) }}, - {"TimeToWait", timeToWaitRootCount, func(v int64) per.Marshaler { return TimeToWait(v) }}, - {"RRCEstablishmentCause", rrcEstablishmentCauseRootCount, func(v int64) per.Marshaler { return RRCEstablishmentCause(v) }}, - {"UERetentionInformation", ueRetentionInformationRootCount, func(v int64) per.Marshaler { return UERetentionInformation(v) }}, - {"GWContextReleaseIndication", gwContextReleaseIndicationRootCount, func(v int64) per.Marshaler { return GWContextReleaseIndication(v) }}, - - // HandoverType is absent deliberately: TS 36.413 §9.2.1.13 assigns two - // extension additions Ella encodes, so its bound is the assigned count - // rather than the root. TestHandoverTypeInterSystemValues covers it. +type enumCase struct { + name string + root int64 + known int64 + value func(int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool } + decode func([]byte) (int64, error) +} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // The last root value must still encode. - w := per.NewWriter() - if err := tt.make(tt.nRoot-1).MarshalPER(w, per.Aligned); err != nil { - t.Fatalf("root value %d: %v", tt.nRoot-1, err) - } +func enumCaseOf[T per.Integer, PT interface { + *T + per.Unmarshaler +}](name string, e *per.Enum[T], value func(int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool +}, +) enumCase { + return enumCase{ + name: name, + root: int64(len(e.Root)), + known: int64(len(e.Root) + len(e.Extension)), + value: value, + decode: func(b []byte) (int64, error) { + v := PT(new(T)) + err := v.UnmarshalPER(per.NewReader(b), per.Aligned) + + return int64(*v), err + }, + } +} + +func extensibleEnums() []enumCase { + return []enumCase{ + enumCaseOf("PagingDRX", &enumPagingDRX, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingDRX(v) + }), + enumCaseOf("TimeToWait", &enumTimeToWait, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TimeToWait(v) + }), + enumCaseOf("RRCEstablishmentCause", &enumRRCEstablishmentCause, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RRCEstablishmentCause(v) + }), + enumCaseOf("ForbiddenInterRATs", &enumForbiddenInterRATs, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ForbiddenInterRATs(v) + }), + enumCaseOf("GWContextReleaseIndication", &enumGWContextReleaseIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return GWContextReleaseIndication(v) + }), + enumCaseOf("CauseRadioNetwork", &enumCauseRadioNetwork, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseRadioNetwork(v) + }), + enumCaseOf("CauseTransport", &enumCauseTransport, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseTransport(v) + }), + enumCaseOf("CauseNas", &enumCauseNas, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseNas(v) + }), + enumCaseOf("CauseProtocol", &enumCauseProtocol, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseProtocol(v) + }), + enumCaseOf("CauseMisc", &enumCauseMisc, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CauseMisc(v) + }), + enumCaseOf("HandoverType", &enumHandoverType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return HandoverType(v) + }), + enumCaseOf("GUMMEIType", &enumGUMMEIType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return GUMMEIType(v) + }), + enumCaseOf("NRrestrictioninEPSasSecondaryRAT", &enumNRrestrictioninEPSasSecondaryRAT, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NRrestrictioninEPSasSecondaryRAT(v) + }), + enumCaseOf("UnlicensedSpectrumRestriction", &enumUnlicensedSpectrumRestriction, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UnlicensedSpectrumRestriction(v) + }), + enumCaseOf("NRrestrictionin5GS", &enumNRrestrictionin5GS, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NRrestrictionin5GS(v) + }), + enumCaseOf("CNType", &enumCNType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CNType(v) + }), + enumCaseOf("RequestTypeAdditionalInfo", &enumRequestTypeAdditionalInfo, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RequestTypeAdditionalInfo(v) + }), + enumCaseOf("DAPSIndicator", &enumDAPSIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DAPSIndicator(v) + }), + enumCaseOf("IMSvoiceEPSfallbackfrom5G", &enumIMSvoiceEPSfallbackfrom5G, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IMSvoiceEPSfallbackfrom5G(v) + }), + enumCaseOf("EmergencyIndicator", &enumEmergencyIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EmergencyIndicator(v) + }), + enumCaseOf("SubcarrierSpacingSSB", &enumSubcarrierSpacingSSB, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SubcarrierSpacingSSB(v) + }), + enumCaseOf("RATType", &enumRATType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RATType(v) + }), + enumCaseOf("CoarseUELocationRequested", &enumCoarseUELocationRequested, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CoarseUELocationRequested(v) + }), + enumCaseOf("TimeRefDistribution", &enumTimeRefDistribution, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return TimeRefDistribution(v) + }), + enumCaseOf("SONInformationRequest", &enumSONInformationRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SONInformationRequest(v) + }), + enumCaseOf("SynchronisationStatus", &enumSynchronisationStatus, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SynchronisationStatus(v) + }), + enumCaseOf("MutingAvailabilityIndication", &enumMutingAvailabilityIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MutingAvailabilityIndication(v) + }), + enumCaseOf("MutingPatternPeriod", &enumMutingPatternPeriod, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MutingPatternPeriod(v) + }), + enumCaseOf("PatternPeriod", &enumPatternPeriod, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PatternPeriod(v) + }), + } +} + +func TestEnumValuesRoundTripAsIndices(t *testing.T) { + for _, tc := range extensibleEnums() { + t.Run(tc.name, func(t *testing.T) { + for _, v := range []int64{0, tc.root - 1, tc.root, tc.known - 1, tc.known, tc.known + 1, tc.root + 100} { + if v < 0 { + continue + } + + b, err := per.Marshal(tc.value(v), per.Aligned) + if err != nil { + t.Fatalf("encode %d: %v", v, err) + } + + want := extensionEnum(t, tc.root, v-tc.root) + if v < tc.root { + w := per.NewWriter() + if err := per.EncodeEnumerated(w, per.Aligned, tc.root, true, v); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + want = w.Bytes() + } + + if !bytes.Equal(b, want) { + t.Fatalf("encode %d = %x, want the X.691 index encoding %x", v, b, want) + } + + got, err := tc.decode(b) + if err != nil || got != v { + t.Fatalf("decode %x = %d, %v; want %d", b, got, err, v) + } + + unknown := v >= tc.known + if diagnosed := tc.value(v).Diagnose(&ap.Diagnosis[ProtocolIEID]{}); diagnosed != unknown { + t.Errorf("value %d: Diagnose = %v, want %v", v, diagnosed, unknown) + } - for _, v := range []int64{tt.nRoot, tt.nRoot + 1, tt.nRoot + 200} { - w := per.NewWriter() - if err := tt.make(v).MarshalPER(w, per.Aligned); err == nil { - t.Errorf("value %d outside the %d root values encoded as %x, want an error", v, tt.nRoot, w.Bytes()) + if name := tc.value(v).Name(); unknown != (name == fmt.Sprintf("unknown(%d)", v)) { + t.Errorf("value %d: Name = %q", v, name) } } }) diff --git a/s1ap/enum_extension_test.go b/s1ap/enum_extension_test.go index 8be1eeee94..547906bb7e 100644 --- a/s1ap/enum_extension_test.go +++ b/s1ap/enum_extension_test.go @@ -4,10 +4,10 @@ package s1ap import ( - "errors" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // The k'th extension addition of an ENUMERATED whose root holds nRoot values. @@ -24,64 +24,12 @@ func extensionEnum(t *testing.T, nRoot, k int64) []byte { return w.Bytes() } -// An unguarded decoder narrows nRoot+k back onto a root value: a PagingPriority -// extension with k=255 reads as 7 (priolevel8). §10.3.1 case 6 handles it on -// criticality instead. -func TestEnumExtensionIsNotComprehended(t *testing.T) { - tests := []struct { - name string - nRoot int64 - decode func(*per.Reader) error - aliases string - }{ - {"PagingDRX", pagingDRXRootCount, func(r *per.Reader) error { - var v PagingDRX - return v.UnmarshalPER(r, per.Aligned) - }, "a root paging cycle"}, - {"TimeToWait", timeToWaitRootCount, func(r *per.Reader) error { - var v TimeToWait - return v.UnmarshalPER(r, per.Aligned) - }, "a root wait time"}, - {"RRCEstablishmentCause", rrcEstablishmentCauseRootCount, func(r *per.Reader) error { - var v RRCEstablishmentCause - return v.UnmarshalPER(r, per.Aligned) - }, "a root establishment cause"}, - {"GWContextReleaseIndication", gwContextReleaseIndicationRootCount, func(r *per.Reader) error { - var v GWContextReleaseIndication - return v.UnmarshalPER(r, per.Aligned) - }, "true"}, - // HandoverType is absent deliberately: its first two extension additions - // are values TS 36.413 §9.2.1.13 assigns and Ella decodes. - // TestHandoverTypeInterSystemValues covers both those and the additions - // beyond them, which are refused the same way. - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // Spans a same-byte extension and one needing the normally-small - // length form. - for _, k := range []int64{0, 1, 255} { - raw := extensionEnum(t, tt.nRoot, k) - - err := tt.decode(per.NewReader(raw)) - if err == nil { - t.Fatalf("extension %d decoded, want it refused rather than read as %s", k, tt.aliases) - } - - if !errors.Is(err, errNotComprehended) { - t.Errorf("extension %d: err = %v, want errNotComprehended so criticality decides (§10.3.1 case 6)", k, err) - } - } - }) - } -} - // Through the IE-container engine: the IE is optional-ignore, so §10.3.4.2 // leaves the field absent and acts on the rest. func TestPagingEnumExtensionsAreIgnored(t *testing.T) { msg, err := ParsePaging(container(t, - ieField{id: IDPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, - ieField{id: IDPagingPriority, crit: CriticalityIgnore, raw: extensionEnum(t, pagingPriorityRootCount, 255)}, + ieField{ID: IDPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, + ieField{ID: IDPagingPriority, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, int64(len(enumPagingPriority.Root)), 100))}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -101,8 +49,8 @@ func TestPagingEnumExtensionsAreIgnored(t *testing.T) { // a zero that reads as DefaultPagingDRX v32. func TestNotComprehendedIEIsNotDelivered(t *testing.T) { msg, err := ParseENBConfigurationUpdate(container(t, - ieField{id: IDENBname, crit: CriticalityIgnore, val: Name("ella-enb")}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, raw: extensionEnum(t, pagingDRXRootCount, 255)}, + ieField{ID: IDENBname, Criticality: CriticalityIgnore, Value: Name("ella-enb")}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, int64(len(enumPagingDRX.Root)), 100))}, )) if err != nil { t.Fatalf("parse: %v", err) diff --git a/s1ap/enum_names.go b/s1ap/enum_names.go index babf8ce61a..020493e5e1 100644 --- a/s1ap/enum_names.go +++ b/s1ap/enum_names.go @@ -3,176 +3,219 @@ package s1ap -// ASN.1 enumeration item names from TS 36.413 §9.3.4 and §9.3.5. Each Name -// returns the empty string for a value the module does not name. +import "github.com/ellanetworks/core/per" -var criticalityNames = map[Criticality]string{ - CriticalityReject: "reject", - CriticalityIgnore: "ignore", - CriticalityNotify: "notify", +// ASN.1 enumeration item names from TS 36.413 §9.3.4 and §9.3.5. A Name backed +// by a map returns the empty string for a value the module does not name; one +// generated from a per.Enum returns "unknown(n)". + +var enumTriggeringMessage = per.Enum[TriggeringMessage]{ + Root: []string{"initiating-message", "successful-outcome", "unsuccessfull-outcome"}, //nolint:misspell } -func (c Criticality) Name() string { return criticalityNames[c] } +var enumHandoverType = per.Enum[HandoverType]{ + Root: []string{"intralte", "ltetoutran", "ltetogeran", "utrantolte", "gerantolte"}, + Extension: []string{"eps-to-5gs", "fivegs-to-eps"}, +} -var triggeringMessageNames = map[TriggeringMessage]string{ - TriggeringInitiatingMessage: "initiating-message", - TriggeringSuccessfulOutcome: "successful-outcome", - // TS 36.413 §9.3.5 misspells this ASN.1 identifier; the label reads as intended. - TriggeringUnsuccessfulOutcome: "unsuccessful-outcome", +var enumCNDomain = per.Enum[CNDomain]{ + Root: []string{"ps", "cs"}, } -func (t TriggeringMessage) Name() string { return triggeringMessageNames[t] } +var enumPreemptionCapability = per.Enum[PreemptionCapability]{ + Root: []string{"shall-not-trigger-pre-emption", "may-trigger-pre-emption"}, +} -var typeOfErrorNames = map[TypeOfError]string{ - TypeOfErrorNotUnderstood: "not-understood", - TypeOfErrorMissing: "missing", +var enumPreemptionVulnerability = per.Enum[PreemptionVulnerability]{ + Root: []string{"not-pre-emptable", "pre-emptable"}, } -func (t TypeOfError) Name() string { return typeOfErrorNames[t] } +var enumTypeOfError = per.Enum[TypeOfError]{ + Root: []string{"not-understood", "missing"}, + Extensible: true, +} -// Name returns the name of the Cause CHOICE alternative the group selects. -func (g CauseGroup) Name() string { return causeGroupNames[g] } +var enumEventType = per.Enum[EventType]{ + Root: []string{"direct", "change-of-serve-cell", "stop-change-of-serve-cell"}, + Extensible: true, +} -var pagingDRXNames = map[PagingDRX]string{ - PagingDRXv32: "v32", - PagingDRXv64: "v64", - PagingDRXv128: "v128", - PagingDRXv256: "v256", +var enumReportArea = per.Enum[ReportArea]{ + Root: []string{"ecgi"}, + Extensible: true, } -func (d PagingDRX) Name() string { return pagingDRXNames[d] } +var enumBearerType = per.Enum[BearerType]{ + Root: []string{"non-IP"}, + Extensible: true, +} -var timeToWaitNames = map[TimeToWait]string{ - TimeToWaitV1s: "v1s", - TimeToWaitV2s: "v2s", - TimeToWaitV5s: "v5s", - TimeToWaitV10s: "v10s", - TimeToWaitV20s: "v20s", - TimeToWaitV60s: "v60s", +var enumEthernetType = per.Enum[EthernetType]{ + Root: []string{"true"}, + Extensible: true, } -func (t TimeToWait) Name() string { return timeToWaitNames[t] } +var enumIntegrityProtectionIndication = per.Enum[IntegrityProtectionIndication]{ + Root: []string{"required", "preferred", "not-needed"}, + Extensible: true, +} -var rrcEstablishmentCauseNames = map[RRCEstablishmentCause]string{ - RRCCauseEmergency: "emergency", - RRCCauseHighPriorityAccess: "highPriorityAccess", - RRCCauseMTAccess: "mt-Access", - RRCCauseMOSignalling: "mo-Signalling", - RRCCauseMOData: "mo-Data", +var enumPagingPriority = per.Enum[PagingPriority]{ + Root: []string{"priolevel1", "priolevel2", "priolevel3", "priolevel4", "priolevel5", "priolevel6", "priolevel7", "priolevel8"}, + Extensible: true, } -func (c RRCEstablishmentCause) Name() string { return rrcEstablishmentCauseNames[c] } +var enumUERetentionInformation = per.Enum[UERetentionInformation]{ + Root: []string{"ues-retained"}, + Extensible: true, +} -var handoverTypeNames = map[HandoverType]string{ - HandoverTypeIntraLTE: "intralte", - HandoverTypeLTEtoUTRAN: "ltetoutran", - HandoverTypeLTEtoGERAN: "ltetogeran", - HandoverTypeUTRANtoLTE: "utrantolte", - HandoverTypeGERANtoLTE: "gerantolte", - HandoverTypeEPSToFiveGS: "eps-to-5gs", - HandoverTypeFiveGSToEPS: "fivegs-to-eps", +var enumPagingDRX = per.Enum[PagingDRX]{ + Root: []string{"v32", "v64", "v128", "v256"}, + Extensible: true, } -func (t HandoverType) Name() string { return handoverTypeNames[t] } +var enumForbiddenInterRATs = per.Enum[ForbiddenInterRATs]{ + Root: []string{"all", "geran", "utran", "cdma2000"}, + Extension: []string{"geranandutran", "cdma2000andutran"}, +} -var cnDomainNames = map[CNDomain]string{ - CNDomainPS: "ps", - CNDomainCS: "cs", +var enumDataForwardingNotPossible = per.Enum[DataForwardingNotPossible]{ + Root: []string{"data-Forwarding-not-Possible"}, + Extensible: true, } -func (d CNDomain) Name() string { return cnDomainNames[d] } +var enumTimeToWait = per.Enum[TimeToWait]{ + Root: []string{"v1s", "v2s", "v5s", "v10s", "v20s", "v60s"}, + Extensible: true, +} -var pagingPriorityNames = map[PagingPriority]string{ - PagingPriorityLevel1: "priolevel1", - PagingPriorityLevel2: "priolevel2", - PagingPriorityLevel3: "priolevel3", - PagingPriorityLevel4: "priolevel4", - PagingPriorityLevel5: "priolevel5", - PagingPriorityLevel6: "priolevel6", - PagingPriorityLevel7: "priolevel7", - PagingPriorityLevel8: "priolevel8", +var enumTraceDepth = per.Enum[TraceDepth]{ + Root: []string{"minimum", "medium", "maximum", "minimumWithoutVendorSpecificExtension", "mediumWithoutVendorSpecificExtension", "maximumWithoutVendorSpecificExtension"}, + Extensible: true, } -func (p PagingPriority) Name() string { return pagingPriorityNames[p] } +var enumRRCEstablishmentCause = per.Enum[RRCEstablishmentCause]{ + Root: []string{"emergency", "highPriorityAccess", "mt-Access", "mo-Signalling", "mo-Data"}, + Extension: []string{"delay-TolerantAccess", "mo-VoiceCall", "mo-ExceptionData"}, +} -var directForwardingPathAvailabilityNames = map[DirectForwardingPathAvailability]string{ - DirectForwardingPathAvailable: "directPathAvailable", +var enumGWContextReleaseIndication = per.Enum[GWContextReleaseIndication]{ + Root: []string{"true"}, + Extensible: true, } -func (d DirectForwardingPathAvailability) Name() string { - return directForwardingPathAvailabilityNames[d] +var enumDLForwarding = per.Enum[DLForwarding]{ + Root: []string{"dL-Forwarding-proposed"}, + Extensible: true, } -var ueRetentionInformationNames = map[UERetentionInformation]string{ - UERetentionUesRetained: "ues-retained", +var enumCellSize = per.Enum[CellSize]{ + Root: []string{"verysmall", "small", "medium", "large"}, + Extensible: true, } -func (u UERetentionInformation) Name() string { return ueRetentionInformationNames[u] } +var enumDirectForwardingPathAvailability = per.Enum[DirectForwardingPathAvailability]{ + Root: []string{"directPathAvailable"}, + Extensible: true, +} -var forbiddenInterRATsNames = map[ForbiddenInterRATs]string{ - ForbiddenInterRATsAll: "all", - ForbiddenInterRATsGERAN: "geran", - ForbiddenInterRATsUTRAN: "utran", - ForbiddenInterRATsCDMA2000: "cdma2000", +var enumResetAll = per.Enum[ResetAll]{ + Root: []string{"reset-all"}, + Extensible: true, } -func (f ForbiddenInterRATs) Name() string { return forbiddenInterRATsNames[f] } +var enumOverloadAction = per.Enum[OverloadAction]{ + Root: []string{"reject-non-emergency-mo-dt", "reject-rrc-cr-signalling", "permit-emergency-sessions-and-mobile-terminated-services-only"}, + Extension: []string{"permit-high-priority-sessions-and-mobile-terminated-services-only", "reject-delay-tolerant-access", "permit-high-priority-sessions-and-exception-reporting-and-mobile-terminated-services-only", "not-accept-mo-data-or-delay-tolerant-access-from-CP-CIoT"}, +} -var enbIDKindNames = map[ENBIDKind]string{ - ENBIDMacro: "macroENB-ID", - ENBIDHome: "homeENB-ID", - ENBIDShortMacro: "short-macroENB-ID", - ENBIDLongMacro: "long-macroENB-ID", +var enumGUMMEIType = per.Enum[GUMMEIType]{ + Root: []string{"native", "mapped"}, + Extension: []string{"mappedFrom5G"}, } -// Name returns the name of the ENB-ID CHOICE alternative the kind selects. -func (k ENBIDKind) Name() string { return enbIDKindNames[k] } +var enumNRrestrictioninEPSasSecondaryRAT = per.Enum[NRrestrictioninEPSasSecondaryRAT]{ + Root: []string{"nRrestrictedinEPSasSecondaryRAT"}, + Extensible: true, +} + +var enumUnlicensedSpectrumRestriction = per.Enum[UnlicensedSpectrumRestriction]{ + Root: []string{"unlicensed-restricted"}, + Extensible: true, +} -var eventTypeNames = map[EventType]string{ - EventTypeDirect: "direct", - EventTypeChangeOfServeCell: "change-of-serve-cell", - EventTypeStopChangeOfServeCell: "stop-change-of-serve-cell", +var enumNRrestrictionin5GS = per.Enum[NRrestrictionin5GS]{ + Root: []string{"nRrestrictedin5GS"}, + Extensible: true, } -func (e EventType) Name() string { return eventTypeNames[e] } +var enumCNType = per.Enum[CNType]{ + Root: []string{"fiveGCForbidden"}, + Extension: []string{"epc-Forbiddden"}, +} + +var enumRequestTypeAdditionalInfo = per.Enum[RequestTypeAdditionalInfo]{ + Root: []string{"includePSCell"}, + Extensible: true, +} -var reportAreaNames = map[ReportArea]string{ - ReportAreaECGI: "ecgi", +var enumDAPSIndicator = per.Enum[DAPSIndicator]{ + Root: []string{"dAPS-HO-required"}, + Extensible: true, } -func (r ReportArea) Name() string { return reportAreaNames[r] } +var enumIMSvoiceEPSfallbackfrom5G = per.Enum[IMSvoiceEPSfallbackfrom5G]{ + Root: []string{"true"}, + Extensible: true, +} -var dlForwardingNames = map[DLForwarding]string{ - DLForwardingProposed: "dL-Forwarding-proposed", +var enumEmergencyIndicator = per.Enum[EmergencyIndicator]{ + Root: []string{"true"}, + Extensible: true, } -func (d DLForwarding) Name() string { return dlForwardingNames[d] } +var enumSubcarrierSpacingSSB = per.Enum[SubcarrierSpacingSSB]{ + Root: []string{"kHz15", "kHz30", "kHz60", "kHz120", "kHz240"}, + Extension: []string{"kHz480", "kHz960"}, +} -var cellSizeNames = map[CellSize]string{ - CellSizeVerySmall: "verysmall", - CellSizeSmall: "small", - CellSizeMedium: "medium", - CellSizeLarge: "large", +var enumRATType = per.Enum[RATType]{ + Root: []string{"nbiot"}, + Extension: []string{"nbiot-leo", "nbiot-meo", "nbiot-geo", "nbiot-othersat", "eutran-leo", "eutran-meo", "eutran-geo", "eutran-othersat"}, } -func (c CellSize) Name() string { return cellSizeNames[c] } +var enumCoarseUELocationRequested = per.Enum[CoarseUELocationRequested]{ + Root: []string{"true"}, + Extensible: true, +} -var bearerTypeNames = map[BearerType]string{ - BearerTypeNonIP: "non-IP", +var enumTimeRefDistribution = per.Enum[TimeRefDistribution]{ + Root: []string{"true"}, + Extensible: true, } -func (b BearerType) Name() string { return bearerTypeNames[b] } +var enumSONInformationRequest = per.Enum[SONInformationRequest]{ + Root: []string{"x2TNL-Configuration-Info"}, + Extension: []string{"time-Synchronisation-Info", "activate-Muting", "deactivate-Muting"}, +} -var ethernetTypeNames = map[EthernetType]string{ - EthernetTypeTrue: "true", +var enumSynchronisationStatus = per.Enum[SynchronisationStatus]{ + Root: []string{"synchronous", "asynchronous"}, + Extensible: true, } -func (e EthernetType) Name() string { return ethernetTypeNames[e] } +var enumMutingAvailabilityIndication = per.Enum[MutingAvailabilityIndication]{ + Root: []string{"available", "unavailable"}, + Extensible: true, +} -var integrityProtectionIndicationNames = map[IntegrityProtectionIndication]string{ - IntegrityProtectionRequired: "required", - IntegrityProtectionPreferred: "preferred", - IntegrityProtectionNotNeeded: "not-needed", +var enumMutingPatternPeriod = per.Enum[MutingPatternPeriod]{ + Root: []string{"ms0", "ms1280", "ms2560", "ms5120", "ms10240"}, + Extensible: true, } -func (i IntegrityProtectionIndication) Name() string { return integrityProtectionIndicationNames[i] } +var enumPatternPeriod = per.Enum[PatternPeriod]{ + Root: []string{"ms1280", "ms2560", "ms5120", "ms10240"}, + Extensible: true, +} diff --git a/s1ap/enum_names_test.go b/s1ap/enum_names_test.go index 3c23bd07e4..327119c2bc 100644 --- a/s1ap/enum_names_test.go +++ b/s1ap/enum_names_test.go @@ -3,7 +3,11 @@ package s1ap -import "testing" +import ( + "testing" + + "github.com/ellanetworks/core/per" +) // Name is what the diagnostic decoders render, so an assigned value names // itself and an unassigned one reports nothing rather than a neighbour's name. @@ -16,50 +20,50 @@ func TestEnumNames(t *testing.T) { {"CriticalityReject", CriticalityReject.Name(), "reject"}, {"Criticality(9)", Criticality(9).Name(), ""}, - {"TriggeringUnsuccessfulOutcome", TriggeringUnsuccessfulOutcome.Name(), "unsuccessful-outcome"}, - {"TriggeringMessage(9)", TriggeringMessage(9).Name(), ""}, + {"TriggeringUnsuccessfulOutcome", TriggeringUnsuccessfulOutcome.Name(), "unsuccessfull-outcome"}, //nolint:misspell + {"TriggeringMessage(9)", TriggeringMessage(9).Name(), "unknown(9)"}, {"TypeOfErrorNotUnderstood", TypeOfErrorNotUnderstood.Name(), "not-understood"}, - {"TypeOfError(9)", TypeOfError(9).Name(), ""}, + {"TypeOfError(9)", TypeOfError(9).Name(), "unknown(9)"}, - {"CauseGroupNAS", CauseGroupNAS.Name(), "nas"}, - {"CauseGroup(9)", CauseGroup(9).Name(), ""}, + {"CauseNAS", CauseNASDetach.Cause().GroupName(), "nas"}, + {"CauseExt", Cause{Ext: &per.ExtensionAlternative{}}.GroupName(), ""}, {"PagingDRXv256", PagingDRXv256.Name(), "v256"}, - {"PagingDRX(9)", PagingDRX(9).Name(), ""}, + {"PagingDRX(9)", PagingDRX(9).Name(), "unknown(9)"}, {"TimeToWaitV10s", TimeToWaitV10s.Name(), "v10s"}, - {"TimeToWait(9)", TimeToWait(9).Name(), ""}, + {"TimeToWait(9)", TimeToWait(9).Name(), "unknown(9)"}, {"RRCCauseMTAccess", RRCCauseMTAccess.Name(), "mt-Access"}, - {"RRCEstablishmentCause(99)", RRCEstablishmentCause(99).Name(), ""}, + {"RRCEstablishmentCause(99)", RRCEstablishmentCause(99).Name(), "unknown(99)"}, {"HandoverTypeIntraLTE", HandoverTypeIntraLTE.Name(), "intralte"}, {"HandoverTypeFiveGSToEPS", HandoverTypeFiveGSToEPS.Name(), "fivegs-to-eps"}, - {"HandoverType(99)", HandoverType(99).Name(), ""}, + {"HandoverType(99)", HandoverType(99).Name(), "unknown(99)"}, {"CNDomainPS", CNDomainPS.Name(), "ps"}, - {"CNDomain(9)", CNDomain(9).Name(), ""}, + {"CNDomain(9)", CNDomain(9).Name(), "unknown(9)"}, {"PagingPriorityLevel8", PagingPriorityLevel8.Name(), "priolevel8"}, - {"PagingPriority(99)", PagingPriority(99).Name(), ""}, + {"PagingPriority(99)", PagingPriority(99).Name(), "unknown(99)"}, {"DirectForwardingPathAvailable", DirectForwardingPathAvailable.Name(), "directPathAvailable"}, {"DLForwardingProposed", DLForwardingProposed.Name(), "dL-Forwarding-proposed"}, - {"DLForwarding(9)", DLForwarding(9).Name(), ""}, + {"DLForwarding(9)", DLForwarding(9).Name(), "unknown(9)"}, {"CellSizeVerySmall", CellSizeVerySmall.Name(), "verysmall"}, {"CellSizeLarge", CellSizeLarge.Name(), "large"}, - {"CellSize(9)", CellSize(9).Name(), ""}, - {"DirectForwardingPathAvailability(9)", DirectForwardingPathAvailability(9).Name(), ""}, + {"CellSize(9)", CellSize(9).Name(), "unknown(9)"}, + {"DirectForwardingPathAvailability(9)", DirectForwardingPathAvailability(9).Name(), "unknown(9)"}, {"UERetentionUesRetained", UERetentionUesRetained.Name(), "ues-retained"}, - {"UERetentionInformation(9)", UERetentionInformation(9).Name(), ""}, + {"UERetentionInformation(9)", UERetentionInformation(9).Name(), "unknown(9)"}, {"ForbiddenInterRATsGERAN", ForbiddenInterRATsGERAN.Name(), "geran"}, - {"ForbiddenInterRATs(9)", ForbiddenInterRATs(9).Name(), ""}, + {"ForbiddenInterRATs(9)", ForbiddenInterRATs(9).Name(), "unknown(9)"}, - {"ENBIDShortMacro", ENBIDShortMacro.Name(), "short-macroENB-ID"}, - {"ENBIDKind(9)", ENBIDKind(9).Name(), ""}, + {"ENBIDShortMacro", ENBID{ShortMacroENBID: Ptr(ShortMacroENBID(1))}.AlternativeName(), "short-macroENB-ID"}, + {"ENBIDExt", ENBID{Ext: &per.ExtensionAlternative{}}.AlternativeName(), ""}, } { if tc.got != tc.want { t.Errorf("%s.Name() = %q, want %q", tc.what, tc.got, tc.want) diff --git a/s1ap/equal_test.go b/s1ap/equal_test.go new file mode 100644 index 0000000000..ac91c7df91 --- /dev/null +++ b/s1ap/equal_test.go @@ -0,0 +1,125 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "go/ast" + "go/parser" + "go/token" + "os" + "reflect" + "slices" + "strings" + "testing" +) + +func equalByMethod(got, want any) bool { + g, w := reflect.ValueOf(got), reflect.ValueOf(want) + if g.Type() != w.Type() { + return false + } + + if g.Kind() == reflect.Pointer { + if g.IsNil() || w.IsNil() { + return g.IsNil() == w.IsNil() + } + + g, w = g.Elem(), w.Elem() + } + + eq := g.MethodByName("Equal") + if !eq.IsValid() { + panic(g.Type().String() + " has no Equal method") + } + + return eq.Call([]reflect.Value{w})[0].Bool() +} + +var typesWithoutEqual = []string{"AbstractSyntaxError", "Diagnostics", "RawPDU"} + +func TestEveryModelTypeHasEqual(t *testing.T) { + fset := token.NewFileSet() + + entries, err := os.ReadDir(".") + if err != nil { + t.Fatal(err) + } + + var files []*ast.File + + for _, e := range entries { + if !strings.HasSuffix(e.Name(), ".go") || strings.HasSuffix(e.Name(), "_test.go") { + continue + } + + f, err := parser.ParseFile(fset, e.Name(), nil, parser.SkipObjectResolution) + if err != nil { + t.Fatal(err) + } + + files = append(files, f) + } + + structs := map[string]bool{} + lists := map[string]string{} + equal := map[string]bool{} + + for _, f := range files { + for _, decl := range f.Decls { + switch d := decl.(type) { + case *ast.GenDecl: + for _, spec := range d.Specs { + ts, ok := spec.(*ast.TypeSpec) + if !ok || ts.Assign.IsValid() || !ts.Name.IsExported() { + continue + } + + switch typ := ts.Type.(type) { + case *ast.StructType: + structs[ts.Name.Name] = true + case *ast.ArrayType: + if elem, ok := typ.Elt.(*ast.Ident); ok && typ.Len == nil { + lists[ts.Name.Name] = elem.Name + } + } + } + case *ast.FuncDecl: + if d.Recv == nil || d.Name.Name != "Equal" || len(d.Type.Params.List) != 1 || d.Type.Results == nil || len(d.Type.Results.List) != 1 { + continue + } + + recv := d.Recv.List[0].Type + if star, ok := recv.(*ast.StarExpr); ok { + recv = star.X + } + + name, ok := recv.(*ast.Ident) + param, pok := d.Type.Params.List[0].Type.(*ast.Ident) + res, rok := d.Type.Results.List[0].Type.(*ast.Ident) + + if ok && pok && rok && param.Name == name.Name && res.Name == "bool" { + equal[name.Name] = true + } + } + } + } + + for name := range structs { + if !equal[name] && !slices.Contains(typesWithoutEqual, name) { + t.Errorf("%s has no Equal(%s) bool: run go generate", name, name) + } + } + + for name, elem := range lists { + if structs[elem] && !equal[name] { + t.Errorf("SEQUENCE OF %s (%s) has no Equal(%s) bool: run go generate", elem, name, name) + } + } + + for _, name := range typesWithoutEqual { + if !structs[name] { + t.Errorf("%s is allowlisted but is not an exported struct type of this package", name) + } + } +} diff --git a/s1ap/erab_lists.go b/s1ap/erab_lists.go index 7adc46c525..ddbf6b48b9 100644 --- a/s1ap/erab_lists.go +++ b/s1ap/erab_lists.go @@ -9,7 +9,7 @@ type ERABToBeSwitchedULItem struct { ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } diff --git a/s1ap/erab_modification.go b/s1ap/erab_modification.go index e07a46bb3b..e49b51884e 100644 --- a/s1ap/erab_modification.go +++ b/s1ap/erab_modification.go @@ -13,7 +13,7 @@ type ERABToBeModifiedItemBearerModInd struct { ERABID ERABID TransportLayerAddress TransportLayerAddress DLGTPTEID GTPTEID - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } @@ -25,65 +25,71 @@ type ERABModificationIndication struct { ToBeModified ERABToBeModifiedListBearerModInd NotToBeModified ERABNotToBeModifiedListBearerModInd UserLocationInformation *UserLocationInformation + TunnelInformationForBBF *TunnelInformation messageMeta } var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABModificationIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABModificationIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDERABToBeModifiedListBearerModInd, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABModificationIndication, raw []byte, enc per.Encoding) error { + ID: IDERABToBeModifiedListBearerModInd, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { var err error - m.ToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject) + m.ToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject) return err }, - encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject, m.ToBeModified) - }), true + Encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { + return containerList(maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject, m.ToBeModified), true }, }, { - id: IDERABNotToBeModifiedListBearerModInd, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *ERABModificationIndication, raw []byte, enc per.Encoding) error { + ID: IDERABNotToBeModifiedListBearerModInd, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { var err error - m.NotToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](per.NewReader(raw), enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) + m.NotToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) return err }, - encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { + Encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { if len(m.NotToBeModified) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject, m.NotToBeModified) - }), true + return containerList(maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject, m.NotToBeModified), true }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModificationIndication, raw []byte, enc per.Encoding) error { + ID: IDTunnelInformationForBBF, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TunnelInformationForBBF) + }, + Encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { + return optionalIE(m.TunnelInformationForBBF) + }, + }, + { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -91,7 +97,7 @@ var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ return nil }, - encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { + Encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -125,12 +131,16 @@ func ParseERABModificationIndication(value []byte) (*ERABModificationIndication, return parseMessageBody[ERABModificationIndication](ProcERABModificationIndication, TriggeringInitiatingMessage, eRABModificationIndicationIEs, value) } +func DecodeERABModificationIndication(value []byte) (*ERABModificationIndication, error) { + return decodeMessageBody[ERABModificationIndication](ProcERABModificationIndication, eRABModificationIndicationIEs, value) +} + // erabModifyItemBearerModConf ::= SEQUENCE { e-RAB-ID, iE-Extensions OPTIONAL } // (extensible). type erabModifyItemBearerModConf struct { - _ [0]struct{} `per:"extseq"` - erabID ERABID - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + erabID ERABID + iEExtensions extensionMeta `per:",exttable"` } // TS 36.413 §9.1.3.9. @@ -147,11 +157,11 @@ type ERABModificationConfirm struct { var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationConfirm, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -159,7 +169,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ return nil }, - encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { + Encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -168,11 +178,11 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationConfirm, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -180,7 +190,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ return nil }, - encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { + Encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -189,9 +199,9 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ }, }, { - id: IDERABModifyListBearerModConf, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { - items, err := decodeItemList[erabModifyItemBearerModConf](per.NewReader(raw), enc, maxnoofERABs, IDERABModifyItemBearerModConf, CriticalityIgnore) + ID: IDERABModifyListBearerModConf, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationConfirm, r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[erabModifyItemBearerModConf](r, enc, maxnoofERABs, IDERABModifyItemBearerModConf, CriticalityIgnore) if err != nil { return err } @@ -203,7 +213,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ return nil }, - encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { + Encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { if len(m.ModifiedERABs) == 0 { return nil, false } @@ -213,55 +223,49 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ items[i] = erabModifyItemBearerModConf{erabID: id} } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABModifyItemBearerModConf, CriticalityIgnore, items) - }), true + return containerList(maxnoofERABs, IDERABModifyItemBearerModConf, CriticalityIgnore, items), true }, }, { - id: IDERABFailedToModifyListBearerModConf, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { + ID: IDERABFailedToModifyListBearerModConf, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationConfirm, r *per.Reader, enc per.Encoding) error { var err error - m.FailedToModify, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.FailedToModify, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { + Encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { if len(m.FailedToModify) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.FailedToModify) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.FailedToModify), true }, }, { - id: IDERABToBeReleasedListBearerModConf, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { + ID: IDERABToBeReleasedListBearerModConf, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationConfirm, r *per.Reader, enc per.Encoding) error { var err error - m.ToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ToBeReleased, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { + Encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { if len(m.ToBeReleased) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ToBeReleased) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ToBeReleased), true }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModificationConfirm, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModificationConfirm, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -269,7 +273,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ return nil }, - encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { + Encode: func(m *ERABModificationConfirm) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -302,3 +306,7 @@ func (m *ERABModificationConfirm) Marshal() ([]byte, error) { func ParseERABModificationConfirm(value []byte) (*ERABModificationConfirm, error) { return parseMessageBody[ERABModificationConfirm](ProcERABModificationIndication, TriggeringSuccessfulOutcome, erabModificationConfirmIEs, value) } + +func DecodeERABModificationConfirm(value []byte) (*ERABModificationConfirm, error) { + return decodeMessageBody[ERABModificationConfirm](ProcERABModificationIndication, erabModificationConfirmIEs, value) +} diff --git a/s1ap/erab_modification_test.go b/s1ap/erab_modification_test.go index 62ff5ee5b2..9a6690271a 100644 --- a/s1ap/erab_modification_test.go +++ b/s1ap/erab_modification_test.go @@ -4,7 +4,6 @@ package s1ap import ( - "bytes" "testing" "github.com/ellanetworks/core/per" @@ -18,9 +17,9 @@ func erabModIndicationWire(t *testing.T, items []ERABToBeModifiedItemBearerModIn w.WriteBit(false) err := encodeIEContainer(w, per.Aligned, []ieField{ - {id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(1)}, - {id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(2)}, - {id: IDERABToBeModifiedListBearerModInd, crit: CriticalityReject, val: per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(1)}, + {ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(2)}, + {ID: IDERABToBeModifiedListBearerModInd, Criticality: CriticalityReject, Value: per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject, items) })}, }) @@ -33,8 +32,8 @@ func erabModIndicationWire(t *testing.T, items []ERABToBeModifiedItemBearerModIn func TestERABModificationIndication_Decode(t *testing.T) { items := []ERABToBeModifiedItemBearerModInd{ - {ERABID: 5, TransportLayerAddress: TransportLayerAddress{10, 0, 0, 1}, DLGTPTEID: 0x11223344}, - {ERABID: 6, TransportLayerAddress: TransportLayerAddress{10, 0, 0, 2}, DLGTPTEID: 0x55667788}, + {ERABID: 5, TransportLayerAddress: tlaOf(10, 0, 0, 1), DLGTPTEID: 0x11223344}, + {ERABID: 6, TransportLayerAddress: tlaOf(10, 0, 0, 2), DLGTPTEID: 0x55667788}, } msg, err := ParseERABModificationIndication(erabModIndicationWire(t, items)) @@ -53,7 +52,7 @@ func TestERABModificationIndication_Decode(t *testing.T) { for i, want := range items { got := msg.ToBeModified[i] if got.ERABID != want.ERABID || got.DLGTPTEID != want.DLGTPTEID || - !bytes.Equal(got.TransportLayerAddress, want.TransportLayerAddress) { + got.TransportLayerAddress != want.TransportLayerAddress { t.Fatalf("item %d = %+v, want %+v", i, got, want) } } @@ -66,8 +65,8 @@ func TestERABModificationIndication_MissingMandatoryIE(t *testing.T) { // Only the UE IDs, no E-RABToBeModified list (mandatory). if err := encodeIEContainer(w, per.Aligned, []ieField{ - {id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(1)}, - {id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(2)}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(1)}, + {ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(2)}, }); err != nil { t.Fatalf("encode: %v", err) } @@ -107,7 +106,7 @@ func TestERABModificationConfirm_Marshal(t *testing.T) { var seenList bool for _, f := range fields { - if f.id == IDERABModifyListBearerModConf { + if f.ID == IDERABModifyListBearerModConf { seenList = true } } @@ -118,7 +117,7 @@ func TestERABModificationConfirm_Marshal(t *testing.T) { } func TestERABModificationConfirmToBeReleasedRoundTrip(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified} + cause := CauseRadioNetworkUnspecified.Cause() wire, err := (&ERABModificationConfirm{ MMEUES1APID: Ptr(MMEUES1APID(1)), @@ -140,7 +139,7 @@ func TestERABModificationConfirmToBeReleasedRoundTrip(t *testing.T) { t.Fatalf("ParseERABModificationConfirm: %v", err) } - if len(got.ModifiedERABs) != 1 || len(got.ToBeReleased) != 1 || got.ToBeReleased[0].ERABID != 6 || got.ToBeReleased[0].Cause != cause { + if len(got.ModifiedERABs) != 1 || len(got.ToBeReleased) != 1 || got.ToBeReleased[0].ERABID != 6 || !got.ToBeReleased[0].Cause.Equal(cause) { t.Fatalf("confirm %+v, want E-RAB 5 modified and 6 to be released (TS 36.413 §8.2.4.2)", got) } } diff --git a/s1ap/erab_modify.go b/s1ap/erab_modify.go index 8266b20947..5e00697cdc 100644 --- a/s1ap/erab_modify.go +++ b/s1ap/erab_modify.go @@ -14,8 +14,8 @@ type ERABToBeModifiedItemBearerModReq struct { ERABID ERABID QoS ERABLevelQoSParameters NASPDU NASPDU - TransportInformation *TransportInformation `per:"-"` - iEExtensions messageMeta `per:",exttable:eRABToBeModifyItemBearerModReqExtIEs"` + TransportInformation *TransportInformation `per:",extie:IDTransportInformation,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } @@ -26,36 +26,12 @@ type TransportInformation struct { extensions per.ExtensionAdditions `per:",extraw"` } -var eRABToBeModifyItemBearerModReqExtIEs = []ieSpec[ERABToBeModifiedItemBearerModReq]{ - { - id: IDTransportInformation, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *ERABToBeModifiedItemBearerModReq, raw []byte, enc per.Encoding) error { - var v TransportInformation - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.TransportInformation = &v - - return nil - }, - encode: func(m *ERABToBeModifiedItemBearerModReq) (per.Marshaler, bool) { - if m.TransportInformation == nil { - return nil, false - } - - return m.TransportInformation, true - }, - }, -} - // ERABModifyItemBearerModRes ::= SEQUENCE { e-RAB-ID, iE-Extensions OPTIONAL } // (extensible) (TS 36.413). type ERABModifyItemBearerModRes struct { - _ [0]struct{} `per:"extseq"` - ERABID ERABID - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + iEExtensions extensionMeta `per:",exttable"` } // TS 36.413 §9.1.3.3. @@ -70,28 +46,28 @@ type ERABModifyRequest struct { var eRABModifyRequestIEs = []ieSpec[ERABModifyRequest]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABModifyRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABModifyRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABModifyRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABModifyRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDUEAggregateMaximumBitrate, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *ERABModifyRequest, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitrate, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *ERABModifyRequest, r *per.Reader, enc per.Encoding) error { var ( err error ambr UEAggregateMaximumBitRate ) - err = perIEDecode(raw, &ambr) + err = decodeIE(r, &ambr) if err != nil { return err } @@ -100,7 +76,7 @@ var eRABModifyRequestIEs = []ieSpec[ERABModifyRequest]{ return nil }, - encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { + Encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -109,18 +85,16 @@ var eRABModifyRequestIEs = []ieSpec[ERABModifyRequest]{ }, }, { - id: IDERABToBeModifiedListBearerModReq, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABModifyRequest, raw []byte, enc per.Encoding) error { + ID: IDERABToBeModifiedListBearerModReq, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABModifyRequest, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject) + m.ERABToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModReq](r, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject) return err }, - encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject, m.ERABToBeModified) - }), true + Encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { + return containerList(maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject, m.ERABToBeModified), true }, }, } @@ -149,6 +123,10 @@ func ParseERABModifyRequest(value []byte) (*ERABModifyRequest, error) { return parseMessageBody[ERABModifyRequest](ProcERABModify, TriggeringInitiatingMessage, eRABModifyRequestIEs, value) } +func DecodeERABModifyRequest(value []byte) (*ERABModifyRequest, error) { + return decodeMessageBody[ERABModifyRequest](ProcERABModify, eRABModifyRequestIEs, value) +} + // TS 36.413 §9.1.3.4. type ERABModifyResponse struct { MMEUES1APID *MMEUES1APID @@ -163,11 +141,11 @@ type ERABModifyResponse struct { var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABModifyResponse, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -175,7 +153,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ return nil }, - encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { + Encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -184,11 +162,11 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABModifyResponse, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -196,7 +174,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ return nil }, - encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { + Encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -205,49 +183,45 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ }, }, { - id: IDERABModifyListBearerModRes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDERABModifyListBearerModRes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModifyResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABModify, err = decodeItemList[ERABModifyItemBearerModRes](per.NewReader(raw), enc, maxnoofERABs, IDERABModifyItemBearerModRes, CriticalityIgnore) + m.ERABModify, err = decodeItemList[ERABModifyItemBearerModRes](r, enc, maxnoofERABs, IDERABModifyItemBearerModRes, CriticalityIgnore) return err }, - encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { + Encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { if len(m.ERABModify) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABModifyItemBearerModRes, CriticalityIgnore, m.ERABModify) - }), true + return containerList(maxnoofERABs, IDERABModifyItemBearerModRes, CriticalityIgnore, m.ERABModify), true }, }, { - id: IDERABFailedToModifyList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDERABFailedToModifyList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModifyResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABFailedToModify, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABFailedToModify, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { + Encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { if len(m.ERABFailedToModify) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToModify) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToModify), true }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModifyResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -255,7 +229,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ return nil }, - encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { + Encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -264,11 +238,11 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABModifyResponse, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABModifyResponse, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -276,7 +250,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ return nil }, - encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { + Encode: func(m *ERABModifyResponse) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -309,3 +283,7 @@ func (m *ERABModifyResponse) Marshal() ([]byte, error) { func ParseERABModifyResponse(value []byte) (*ERABModifyResponse, error) { return parseMessageBody[ERABModifyResponse](ProcERABModify, TriggeringSuccessfulOutcome, eRABModifyResponseIEs, value) } + +func DecodeERABModifyResponse(value []byte) (*ERABModifyResponse, error) { + return decodeMessageBody[ERABModifyResponse](ProcERABModify, eRABModifyResponseIEs, value) +} diff --git a/s1ap/erab_release.go b/s1ap/erab_release.go index 0ac9a1e673..d5fff8cd45 100644 --- a/s1ap/erab_release.go +++ b/s1ap/erab_release.go @@ -10,9 +10,9 @@ import ( // ERABReleaseItemBearerRelComp ::= SEQUENCE { e-RAB-ID, iE-Extensions OPTIONAL } // (extensible): an E-RAB the eNB confirms released (TS 36.413). type ERABReleaseItemBearerRelComp struct { - _ [0]struct{} `per:"extseq"` - ERABID ERABID - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + iEExtensions extensionMeta `per:",exttable"` } // TS 36.413 §9.1.3.5. @@ -28,28 +28,28 @@ type ERABReleaseCommand struct { var eRABReleaseCommandIEs = []ieSpec[ERABReleaseCommand]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDUEAggregateMaximumBitrate, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *ERABReleaseCommand, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitrate, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *ERABReleaseCommand, r *per.Reader, enc per.Encoding) error { var ( err error ambr UEAggregateMaximumBitRate ) - err = perIEDecode(raw, &ambr) + err = decodeIE(r, &ambr) if err != nil { return err } @@ -58,7 +58,7 @@ var eRABReleaseCommandIEs = []ieSpec[ERABReleaseCommand]{ return nil }, - encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -67,30 +67,28 @@ var eRABReleaseCommandIEs = []ieSpec[ERABReleaseCommand]{ }, }, { - id: IDERABToBeReleasedList, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABReleaseCommand, raw []byte, enc per.Encoding) error { + ID: IDERABToBeReleasedList, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseCommand, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABToBeReleased, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { if len(m.ERABToBeReleased) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToBeReleased) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToBeReleased), true }, }, { - id: IDNASPDU, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseCommand) (per.Marshaler, bool) { if len(m.NASPDU) == 0 { return nil, false } @@ -124,6 +122,10 @@ func ParseERABReleaseCommand(value []byte) (*ERABReleaseCommand, error) { return parseMessageBody[ERABReleaseCommand](ProcERABRelease, TriggeringInitiatingMessage, eRABReleaseCommandIEs, value) } +func DecodeERABReleaseCommand(value []byte) (*ERABReleaseCommand, error) { + return decodeMessageBody[ERABReleaseCommand](ProcERABRelease, eRABReleaseCommandIEs, value) +} + // TS 36.413 §9.1.3.6. type ERABReleaseResponse struct { MMEUES1APID *MMEUES1APID @@ -138,11 +140,11 @@ type ERABReleaseResponse struct { var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseResponse, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -150,7 +152,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ return nil }, - encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -159,11 +161,11 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseResponse, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -171,7 +173,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ return nil }, - encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -180,49 +182,45 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ }, }, { - id: IDERABReleaseListBearerRelComp, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDERABReleaseListBearerRelComp, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABReleased, err = decodeItemList[ERABReleaseItemBearerRelComp](per.NewReader(raw), enc, maxnoofERABs, IDERABReleaseItemBearerRelComp, CriticalityIgnore) + m.ERABReleased, err = decodeItemList[ERABReleaseItemBearerRelComp](r, enc, maxnoofERABs, IDERABReleaseItemBearerRelComp, CriticalityIgnore) return err }, - encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { if len(m.ERABReleased) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABReleaseItemBearerRelComp, CriticalityIgnore, m.ERABReleased) - }), true + return containerList(maxnoofERABs, IDERABReleaseItemBearerRelComp, CriticalityIgnore, m.ERABReleased), true }, }, { - id: IDERABFailedToReleaseList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDERABFailedToReleaseList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABFailedToRelease, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABFailedToRelease, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { if len(m.ERABFailedToRelease) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToRelease) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToRelease), true }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -230,7 +228,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ return nil }, - encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -239,11 +237,11 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABReleaseResponse, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseResponse, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -251,7 +249,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ return nil }, - encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseResponse) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -285,6 +283,10 @@ func ParseERABReleaseResponse(value []byte) (*ERABReleaseResponse, error) { return parseMessageBody[ERABReleaseResponse](ProcERABRelease, TriggeringSuccessfulOutcome, eRABReleaseResponseIEs, value) } +func DecodeERABReleaseResponse(value []byte) (*ERABReleaseResponse, error) { + return decodeMessageBody[ERABReleaseResponse](ProcERABRelease, eRABReleaseResponseIEs, value) +} + type ERABReleaseIndication struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID @@ -296,44 +298,42 @@ type ERABReleaseIndication struct { var eRABReleaseIndicationIEs = []ieSpec[ERABReleaseIndication]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABReleaseIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABReleaseIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABReleaseIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABReleaseIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDERABReleasedList, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABReleaseIndication, raw []byte, enc per.Encoding) error { + ID: IDERABReleasedList, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseIndication, r *per.Reader, enc per.Encoding) error { var err error - m.ERABReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABReleased, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { if len(m.ERABReleased) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABReleased) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABReleased), true }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABReleaseIndication, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABReleaseIndication, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -341,7 +341,7 @@ var eRABReleaseIndicationIEs = []ieSpec[ERABReleaseIndication]{ return nil }, - encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { + Encode: func(m *ERABReleaseIndication) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -374,3 +374,7 @@ func (m *ERABReleaseIndication) Marshal() ([]byte, error) { func ParseERABReleaseIndication(value []byte) (*ERABReleaseIndication, error) { return parseMessageBody[ERABReleaseIndication](ProcERABReleaseIndication, TriggeringInitiatingMessage, eRABReleaseIndicationIEs, value) } + +func DecodeERABReleaseIndication(value []byte) (*ERABReleaseIndication, error) { + return decodeMessageBody[ERABReleaseIndication](ProcERABReleaseIndication, eRABReleaseIndicationIEs, value) +} diff --git a/s1ap/erab_release_test.go b/s1ap/erab_release_test.go index a4553ec4e2..894f5dfb6d 100644 --- a/s1ap/erab_release_test.go +++ b/s1ap/erab_release_test.go @@ -16,7 +16,7 @@ func TestERABReleaseCommandRoundTrips(t *testing.T) { ENBUES1APID: 1, UEAggregateMaximumBitRate: &ambr, ERABToBeReleased: []ERABItem{ - {ERABID: 6, Cause: Cause{Group: CauseGroupNAS, Value: 2}}, // normal-release + {ERABID: 6, Cause: CauseNASDetach.Cause()}, // normal-release }, NASPDU: NASPDU{0x02, 0x06, 0xcd}, // a Deactivate EPS Bearer Context Request, abbreviated } @@ -49,7 +49,7 @@ func TestERABReleaseCommandRoundTrips(t *testing.T) { t.Fatalf("UE-AMBR mismatch: %+v", out.UEAggregateMaximumBitRate) } - if out.ERABToBeReleased[0].ERABID != 6 || out.ERABToBeReleased[0].Cause != in.ERABToBeReleased[0].Cause { + if out.ERABToBeReleased[0].ERABID != 6 || !out.ERABToBeReleased[0].Cause.Equal(in.ERABToBeReleased[0].Cause) { t.Fatalf("E-RAB item mismatch: %+v", out.ERABToBeReleased[0]) } @@ -124,7 +124,7 @@ func TestERABReleaseResponseRoundTripsUserLocation(t *testing.T) { func TestERABReleaseIndicationRoundTrips(t *testing.T) { plmn := PLMNIdentity{0x00, 0xf1, 0x10} - lost := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkRadioConnectionWithUELost} + lost := CauseRadioNetworkRadioConnectionWithUELost.Cause() in := &ERABReleaseIndication{ MMEUES1APID: 42, @@ -156,7 +156,7 @@ func TestERABReleaseIndicationRoundTrips(t *testing.T) { t.Fatal(err) } - if out.MMEUES1APID != 42 || out.ENBUES1APID != 1 || len(out.ERABReleased) != 2 || out.ERABReleased[1].ERABID != 7 || out.ERABReleased[0].Cause != lost { + if out.MMEUES1APID != 42 || out.ENBUES1APID != 1 || len(out.ERABReleased) != 2 || out.ERABReleased[1].ERABID != 7 || !out.ERABReleased[0].Cause.Equal(lost) { t.Fatalf("E-RAB Release Indication mismatch: %+v", out) } @@ -166,7 +166,7 @@ func TestERABReleaseIndicationRoundTrips(t *testing.T) { } func TestDecodeItemListRejectsWrongItemID(t *testing.T) { - m := &ERABReleaseIndication{MMEUES1APID: 1, ENBUES1APID: 2, ERABReleased: []ERABItem{{ERABID: 5}}} + m := &ERABReleaseIndication{MMEUES1APID: 1, ENBUES1APID: 2, ERABReleased: []ERABItem{{ERABID: 5, Cause: CauseRadioNetworkUnspecified.Cause()}}} wire, err := m.Marshal() if err != nil { diff --git a/s1ap/erab_setup.go b/s1ap/erab_setup.go index 298e9620b1..4402d7d538 100644 --- a/s1ap/erab_setup.go +++ b/s1ap/erab_setup.go @@ -17,34 +17,16 @@ type ERABToBeSetupItemBearerSUReq struct { TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID NASPDU NASPDU - CorrelationID *CorrelationID `per:"-"` - SIPTOCorrelationID *CorrelationID `per:"-"` - BearerType *BearerType `per:"-"` - EthernetType *EthernetType `per:"-"` - SecurityIndication *SecurityIndication `per:"-"` - iEExtensions messageMeta `per:",exttable:eRABToBeSetupItemBearerSUReqExtIEs"` + CorrelationID *CorrelationID `per:",extie:IDCorrelationID,crit:ignore"` + SIPTOCorrelationID *CorrelationID `per:",extie:IDSIPTOCorrelationID,crit:ignore"` + BearerType *BearerType `per:",extie:IDBearerType,crit:reject"` + EthernetType *EthernetType `per:",extie:IDEthernetType,crit:ignore"` + SecurityIndication *SecurityIndication `per:",extie:IDSecurityIndication,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } -var eRABToBeSetupItemBearerSUReqExtIEs = []ieSpec[ERABToBeSetupItemBearerSUReq]{ - optionalExtension(IDCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemBearerSUReq) **CorrelationID { - return &m.CorrelationID - }), - optionalExtension(IDSIPTOCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemBearerSUReq) **CorrelationID { - return &m.SIPTOCorrelationID - }), - optionalExtension(IDBearerType, CriticalityReject, func(m *ERABToBeSetupItemBearerSUReq) **BearerType { - return &m.BearerType - }), - optionalExtension(IDEthernetType, CriticalityIgnore, func(m *ERABToBeSetupItemBearerSUReq) **EthernetType { - return &m.EthernetType - }), - optionalExtension(IDSecurityIndication, CriticalityReject, func(m *ERABToBeSetupItemBearerSUReq) **SecurityIndication { - return &m.SecurityIndication - }), -} - // ERABSetupItemBearerSURes ::= SEQUENCE { e-RAB-ID, transportLayerAddress, // gTP-TEID }: the eNB endpoint the UPF sends downlink traffic to. type ERABSetupItemBearerSURes = ERABSetupItemCtxtSURes @@ -61,28 +43,28 @@ type ERABSetupRequest struct { var eRABSetupRequestIEs = []ieSpec[ERABSetupRequest]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDUEAggregateMaximumBitrate, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *ERABSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitrate, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *ERABSetupRequest, r *per.Reader, enc per.Encoding) error { var ( err error ambr UEAggregateMaximumBitRate ) - err = perIEDecode(raw, &ambr) + err = decodeIE(r, &ambr) if err != nil { return err } @@ -91,7 +73,7 @@ var eRABSetupRequestIEs = []ieSpec[ERABSetupRequest]{ return nil }, - encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { + Encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -100,18 +82,16 @@ var eRABSetupRequestIEs = []ieSpec[ERABSetupRequest]{ }, }, { - id: IDERABToBeSetupListBearerSUReq, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ERABSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDERABToBeSetupListBearerSUReq, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ERABSetupRequest, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemBearerSUReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject) + m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemBearerSUReq](r, enc, maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject) return err }, - encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject, m.ERABToBeSetup) - }), true + Encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { + return containerList(maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject, m.ERABToBeSetup), true }, }, } @@ -140,6 +120,10 @@ func ParseERABSetupRequest(value []byte) (*ERABSetupRequest, error) { return parseMessageBody[ERABSetupRequest](ProcERABSetup, TriggeringInitiatingMessage, eRABSetupRequestIEs, value) } +func DecodeERABSetupRequest(value []byte) (*ERABSetupRequest, error) { + return decodeMessageBody[ERABSetupRequest](ProcERABSetup, eRABSetupRequestIEs, value) +} + // TS 36.413 §9.1.3.2. type ERABSetupResponse struct { MMEUES1APID *MMEUES1APID @@ -154,11 +138,11 @@ type ERABSetupResponse struct { var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABSetupResponse, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -166,7 +150,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ return nil }, - encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { + Encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -175,11 +159,11 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *ERABSetupResponse, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -187,7 +171,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ return nil }, - encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { + Encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -196,49 +180,45 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ }, }, { - id: IDERABSetupListBearerSURes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDERABSetupListBearerSURes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABSetupResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABSetup, err = decodeItemList[ERABSetupItemBearerSURes](per.NewReader(raw), enc, maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore) + m.ERABSetup, err = decodeItemList[ERABSetupItemBearerSURes](r, enc, maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore) return err }, - encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { + Encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { if len(m.ERABSetup) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore, m.ERABSetup) - }), true + return containerList(maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore, m.ERABSetup), true }, }, { - id: IDERABFailedToSetupListBearerSURes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDERABFailedToSetupListBearerSURes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABSetupResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABFailedToSetup, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { + Encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { if len(m.ERABFailedToSetup) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToSetup) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToSetup), true }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABSetupResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -246,7 +226,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ return nil }, - encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { + Encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -255,11 +235,11 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ERABSetupResponse, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -267,7 +247,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ return nil }, - encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { + Encode: func(m *ERABSetupResponse) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -300,3 +280,7 @@ func (m *ERABSetupResponse) Marshal() ([]byte, error) { func ParseERABSetupResponse(value []byte) (*ERABSetupResponse, error) { return parseMessageBody[ERABSetupResponse](ProcERABSetup, TriggeringSuccessfulOutcome, eRABSetupResponseIEs, value) } + +func DecodeERABSetupResponse(value []byte) (*ERABSetupResponse, error) { + return decodeMessageBody[ERABSetupResponse](ProcERABSetup, eRABSetupResponseIEs, value) +} diff --git a/s1ap/erab_setup_test.go b/s1ap/erab_setup_test.go index 31bba081aa..47aa951dfb 100644 --- a/s1ap/erab_setup_test.go +++ b/s1ap/erab_setup_test.go @@ -18,7 +18,7 @@ func TestERABSetupRequestRoundTrips(t *testing.T) { }, } - tla := TransportLayerAddress{10, 45, 0, 1} + tla := tlaOf(10, 45, 0, 1) ambr := UEAggregateMaximumBitRate{DL: 1000000000, UL: 500000000} in := &ERABSetupRequest{ @@ -61,13 +61,13 @@ func TestERABSetupRequestRoundTrips(t *testing.T) { gi, go_ := in.ERABToBeSetup[0], out.ERABToBeSetup[0] if gi.ERABID != go_.ERABID || gi.GTPTEID != go_.GTPTEID || gi.QoS.QCI != go_.QoS.QCI || - !bytes.Equal(gi.TransportLayerAddress, go_.TransportLayerAddress) || !bytes.Equal(gi.NASPDU, go_.NASPDU) { + gi.TransportLayerAddress != go_.TransportLayerAddress || !bytes.Equal(gi.NASPDU, go_.NASPDU) { t.Fatalf("E-RAB item mismatch:\n in %+v\n out %+v", gi, go_) } } func TestERABSetupResponseRoundTrips(t *testing.T) { - tla := TransportLayerAddress{10, 45, 0, 9} + tla := tlaOf(10, 45, 0, 9) in := &ERABSetupResponse{ MMEUES1APID: Ptr(MMEUES1APID(42)), @@ -97,7 +97,7 @@ func TestERABSetupResponseRoundTrips(t *testing.T) { if deref(out.MMEUES1APID) != 42 || deref(out.ENBUES1APID) != 1 || len(out.ERABSetup) != 1 || out.ERABSetup[0].ERABID != 6 || out.ERABSetup[0].GTPTEID != 0xdeadbeef || - !bytes.Equal(out.ERABSetup[0].TransportLayerAddress, tla) { + out.ERABSetup[0].TransportLayerAddress != tla { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } } diff --git a/s1ap/error_indication.go b/s1ap/error_indication.go index bad846b102..ee0d452f6b 100644 --- a/s1ap/error_indication.go +++ b/s1ap/error_indication.go @@ -22,11 +22,11 @@ type ErrorIndication struct { var errorIndicationIEs = []ieSpec[ErrorIndication]{ { - id: IDMMEUES1APID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("s1ap: ErrorIndication MME-UE-S1AP-ID: %w", err) } @@ -34,7 +34,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -43,11 +43,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDENBUES1APID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("s1ap: ErrorIndication eNB-UE-S1AP-ID: %w", err) } @@ -55,7 +55,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -64,11 +64,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDCause, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("s1ap: ErrorIndication Cause: %w", err) } @@ -76,7 +76,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -85,11 +85,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("s1ap: ErrorIndication CriticalityDiagnostics: %w", err) } @@ -97,7 +97,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -106,11 +106,11 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ }, }, { - id: IDSTMSI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ErrorIndication, raw []byte, enc per.Encoding) error { + ID: IDSTMSI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ErrorIndication, r *per.Reader, enc per.Encoding) error { var v STMSI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return fmt.Errorf("s1ap: ErrorIndication S-TMSI: %w", err) } @@ -118,7 +118,7 @@ var errorIndicationIEs = []ieSpec[ErrorIndication]{ return nil }, - encode: func(m *ErrorIndication) (per.Marshaler, bool) { + Encode: func(m *ErrorIndication) (per.Marshaler, bool) { if m.STMSI == nil { return nil, false } @@ -157,3 +157,7 @@ func (m *ErrorIndication) Marshal() ([]byte, error) { func ParseErrorIndication(value []byte) (*ErrorIndication, error) { return parseMessageBody[ErrorIndication](ProcErrorIndication, TriggeringInitiatingMessage, errorIndicationIEs, value) } + +func DecodeErrorIndication(value []byte) (*ErrorIndication, error) { + return decodeMessageBody[ErrorIndication](ProcErrorIndication, errorIndicationIEs, value) +} diff --git a/s1ap/error_indication_test.go b/s1ap/error_indication_test.go index fa30e13fe5..4fc972e653 100644 --- a/s1ap/error_indication_test.go +++ b/s1ap/error_indication_test.go @@ -8,7 +8,7 @@ import "testing" func TestErrorIndicationRoundTrips(t *testing.T) { mme := MMEUES1APID(1) enb := ENBUES1APID(7) - cause := Cause{Group: CauseGroupRadioNetwork, Value: 0} + cause := CauseRadioNetworkUnspecified.Cause() t.Run("full", func(t *testing.T) { in := &ErrorIndication{MMEUES1APID: &mme, ENBUES1APID: &enb, Cause: &cause} @@ -35,7 +35,7 @@ func TestErrorIndicationRoundTrips(t *testing.T) { if out.MMEUES1APID == nil || *out.MMEUES1APID != mme || out.ENBUES1APID == nil || *out.ENBUES1APID != enb || - out.Cause == nil || *out.Cause != cause { + out.Cause == nil || !out.Cause.Equal(cause) { t.Fatalf("mismatch: %+v", out) } }) @@ -65,7 +65,7 @@ func TestErrorIndicationRefusesEmptyOnSend(t *testing.T) { // An eNB that knows only the S-TMSI names the UE with it. func TestErrorIndicationSTMSIRoundTrip(t *testing.T) { sent := &ErrorIndication{ - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}, + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), STMSI: &STMSI{MMEC: 0x2a, MTMSI: 0xdeadbeef}, } @@ -95,7 +95,7 @@ func TestErrorIndicationSTMSIRoundTrip(t *testing.T) { // An all-zero S-TMSI is a legal identity, so absent must stay absent. func TestErrorIndicationSTMSIStaysAbsent(t *testing.T) { - raw, err := (&ErrorIndication{Cause: &Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}}).Marshal() + raw, err := (&ErrorIndication{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}).Marshal() if err != nil { t.Fatalf("marshal: %v", err) } diff --git a/s1ap/errors.go b/s1ap/errors.go index 06910d1512..56106adbab 100644 --- a/s1ap/errors.go +++ b/s1ap/errors.go @@ -4,43 +4,15 @@ package s1ap import ( - "errors" "fmt" "strings" -) - -// A decode failure TS 36.413 §10.3.1 classifies as a not-comprehended IE (cases -// 1, 2 and 6), handled on criticality rather than by abandoning the message. -var errNotComprehended = errors.New("s1ap: IE not comprehended") - -// §10.3.2 treats a not-comprehended item on its own criticality. For an -// unmodeled extension that item is the extension, not the IE containing it, so -// a reject extension rejects the procedure even inside an ignore IE. Decoders -// whose item is the containing IE return the bare sentinel instead. -type notComprehendedIE struct { - ID ProtocolIEID - Crit Criticality - What string -} -func (e *notComprehendedIE) Error() string { - return fmt.Sprintf("%s: %s %s (criticality %s)", errNotComprehended, e.What, e.ID, e.Crit) -} - -func (e *notComprehendedIE) Unwrap() error { return errNotComprehended } + "github.com/ellanetworks/core/per/ap" +) // Octets that are not a decodable PER encoding; nothing of the message is // recoverable (TS 36.413 §10.2). -type TransferSyntaxError struct { - Procedure ProcedureCode - Err error -} - -func (e *TransferSyntaxError) Error() string { - return fmt.Sprintf("s1ap: %s: transfer syntax error: %v", e.Procedure, e.Err) -} - -func (e *TransferSyntaxError) Unwrap() error { return e.Err } +type TransferSyntaxError = ap.TransferSyntaxError[ProcedureCode] // A message that decoded but whose procedure must be rejected: a missing // reject-criticality IE (TS 36.413 §10.3.5), an unhandled reject-criticality IE @@ -143,92 +115,15 @@ func (e *AbstractSyntaxError) UEIDs() (*MMEUES1APID, *ENBUES1APID) { return mmeID, enbID } -// The abstract syntax errors that did not prevent delivery: IEs absent, or not -// comprehended, with ignore or notify criticality (TS 36.413 §10.3.5, -// §10.3.4.2). -// -// No IE in these tables carries notify criticality, so the notify paths below -// never fire today; they implement the protocol's rule, not this table's. type Diagnostics struct { - IEs []DiagnosticIE - - // Truncated reports that recording stopped at maxDiagnosticIEs. - Truncated bool - - // Set even where Truncated dropped the entry, so a report is never starved - // by ignore entries. - notify bool -} - -type DiagnosticIE struct { - ID ProtocolIEID - Criticality Criticality - TypeOfError TypeOfError + ap.Diagnostics[ProtocolIEID] } -func (d Diagnostics) Empty() bool { return len(d.IEs) == 0 } - -// Only notify criticality obliges the receiver to tell the sender -// (§10.3.4.2, §10.3.5). -func (d Diagnostics) ReportRequired() bool { return d.notify } +type DiagnosticIE = ap.Diagnostic[ProtocolIEID] // §9.2.1.21 forbids reporting an IE Criticality of "ignore". func (d Diagnostics) Report() []CriticalityDiagnosticsIEItem { - out := make([]CriticalityDiagnosticsIEItem, 0, len(d.IEs)) - - for _, ie := range d.IEs { - if ie.Criticality != CriticalityNotify { - continue - } - - out = append(out, CriticalityDiagnosticsIEItem{ - IECriticality: ie.Criticality, - IEID: ie.ID, - TypeOfError: ie.TypeOfError, - }) - } - - if len(out) == 0 { - return nil - } - - return out -} - -func (d *Diagnostics) record(id ProtocolIEID, crit Criticality, kind TypeOfError) { - entry := DiagnosticIE{ID: id, Criticality: crit, TypeOfError: kind} - - if crit == CriticalityNotify { - d.notify = true - } - - if len(d.IEs) < maxDiagnosticIEs { - d.IEs = append(d.IEs, entry) - - return - } - - d.Truncated = true - - // §10.3.4.2 wants an entry per reported IE, so a notify entry displaces a - // silent one rather than being dropped behind the bound. - if crit != CriticalityNotify { - return - } - - for i, ie := range d.IEs { - if ie.Criticality != CriticalityNotify { - d.IEs[i] = entry - - return - } - } + return criticalityDiagnosticsItems(d.Notify()) } -func (t TypeOfError) String() string { - if name, ok := typeOfErrorNames[t]; ok { - return name - } - - return fmt.Sprintf("TypeOfError(%d)", uint8(t)) -} +func (t TypeOfError) String() string { return t.Name() } diff --git a/s1ap/extension_criticality_test.go b/s1ap/extension_criticality_test.go index edae384f8d..e802e59983 100644 --- a/s1ap/extension_criticality_test.go +++ b/s1ap/extension_criticality_test.go @@ -4,10 +4,12 @@ package s1ap import ( + "bytes" "errors" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // A real reject-criticality SupportedTAs-Item extension this version does not @@ -56,11 +58,11 @@ func extendedTAI(t *testing.T, crit Criticality) []byte { // extension's id rather than the container's. func TestRejectExtensionInsideIgnoreIERejects(t *testing.T) { _, err := ParseUplinkNASTransport(container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(1)}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(2)}, - ieField{id: IDNASPDU, crit: CriticalityReject, val: NASPDU{0x7e, 0x00}}, - ieField{id: IDEUTRANCGI, crit: CriticalityIgnore, val: &EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x0abcde1}}, - ieField{id: IDTAI, crit: CriticalityIgnore, raw: extendedTAI(t, CriticalityReject)}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(1)}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(2)}, + ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x7e, 0x00}}, + ieField{ID: IDEUTRANCGI, Criticality: CriticalityIgnore, Value: &EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x0abcde1}}, + ieField{ID: IDTAI, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAI(t, CriticalityReject))}, )) var ase *AbstractSyntaxError @@ -84,11 +86,11 @@ func TestRejectExtensionInsideIgnoreIERejects(t *testing.T) { // §10.3.4.2: an ignore extension is skipped and its IE still delivered. func TestIgnoreExtensionKeepsItsIE(t *testing.T) { msg, err := ParseUplinkNASTransport(container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(1)}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(2)}, - ieField{id: IDNASPDU, crit: CriticalityReject, val: NASPDU{0x7e, 0x00}}, - ieField{id: IDEUTRANCGI, crit: CriticalityIgnore, val: &EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x0abcde1}}, - ieField{id: IDTAI, crit: CriticalityIgnore, raw: extendedTAI(t, CriticalityIgnore)}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(1)}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(2)}, + ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x7e, 0x00}}, + ieField{ID: IDEUTRANCGI, Criticality: CriticalityIgnore, Value: &EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x0abcde1}}, + ieField{ID: IDTAI, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAI(t, CriticalityIgnore))}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -103,77 +105,66 @@ func TestIgnoreExtensionKeepsItsIE(t *testing.T) { } } -// erabHOReqExtensions encodes a ProtocolExtensionContainer for -// ERABToBeSetupItemHOReq holding one unmodeled extension, optionally followed -// by the modeled id-Data-Forwarding-Not-Possible. -func erabHOReqExtensions(t *testing.T, unmodeledCrit Criticality, withModeled bool) []byte { +func erabHOReqWithUnknownExtension(t *testing.T, crit Criticality) []byte { t.Helper() - count := int64(1) - if withModeled { - count = 2 + in := ERABToBeSetupItemHOReq{ + ERABID: 1, + TransportLayerAddress: tlaOf(10, 0, 0, 1), + GTPTEID: 1, + QoS: ERABLevelQoSParameters{QCI: 9}, + DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), } + in.iEExtensions.Append(ap.Field[ProtocolIEID]{ID: idRATType, Criticality: crit, Value: []byte{0x00}}) - w := per.NewWriter() - - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 1, maxProtocolExtensions, count); err != nil { - t.Fatalf("ext count: %v", err) + b, err := per.Marshal(&in, per.Aligned) + if err != nil { + t.Fatal(err) } - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(idRATType)); err != nil { - t.Fatalf("ext id: %v", err) - } + return b +} - if err := per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(unmodeledCrit)); err != nil { - t.Fatalf("ext criticality: %v", err) - } +func TestERABToBeSetupItemHOReqUnmodeledRejectExtension(t *testing.T) { + in := erabHOReqWithUnknownExtension(t, CriticalityReject) - if err := per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x00}); err != nil { - t.Fatalf("ext value: %v", err) + var item ERABToBeSetupItemHOReq + if err := item.UnmarshalPER(per.NewReader(in), per.Aligned); err != nil { + t.Fatalf("decode is lenient, got %v", err) } - if withModeled { - if err := per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, maxProtocolIEs, int64(IDDataForwardingNotPossible)); err != nil { - t.Fatalf("modeled ext id: %v", err) - } - - if err := per.EncodeEnumerated(w, per.Aligned, criticalityRootCount, false, int64(CriticalityIgnore)); err != nil { - t.Fatalf("modeled ext criticality: %v", err) - } - - if err := per.EncodeOpenTypeBytes(w, per.Aligned, []byte{0x00}); err != nil { - t.Fatalf("modeled ext value: %v", err) - } + if item.DataForwardingNotPossible == nil { + t.Fatal("Data Forwarding Not Possible: got absent, want present alongside the unknown extension") } - w.AlignToByte() - - return w.Bytes() -} - -func TestERABToBeSetupItemHOReqUnmodeledRejectExtension(t *testing.T) { - var ext ERABToBeSetupItemHOReqExtIEs - - err := ext.UnmarshalPER(per.NewReader(erabHOReqExtensions(t, CriticalityReject, false)), per.Aligned) + d := ap.Diagnose[ProtocolIEID](&item) + if len(d.IEs) != 1 || d.IEs[0].ID != idRATType || d.IEs[0].Criticality != CriticalityReject || d.IEs[0].Kind != ap.KindNotComprehended { + t.Fatalf("diagnostics = %+v, want the reject extension not comprehended", d.IEs) + } - var nc *notComprehendedIE - if !errors.As(err, &nc) { - t.Fatalf("err = %v, want the extension not comprehended", err) + var ase *ap.AbstractSyntaxError[ProtocolIEID] + if !errors.As(d.Check(), &ase) { + t.Fatalf("Check() = %v, want the reject extension to reject", d.Check()) } - if nc.ID != idRATType { - t.Errorf("reported id = %d, want %d", nc.ID, idRATType) + out, err := per.Marshal(&item, per.Aligned) + if err != nil || !bytes.Equal(out, in) { + t.Fatalf("re-encode = %x, %v; want %x", out, err, in) } } func TestERABToBeSetupItemHOReqUnmodeledIgnoreExtension(t *testing.T) { - var ext ERABToBeSetupItemHOReqExtIEs + var item ERABToBeSetupItemHOReq - if err := ext.UnmarshalPER(per.NewReader(erabHOReqExtensions(t, CriticalityIgnore, true)), per.Aligned); err != nil { + if err := item.UnmarshalPER(per.NewReader(erabHOReqWithUnknownExtension(t, CriticalityIgnore)), per.Aligned); err != nil { t.Fatalf("unmarshal: %v", err) } - if ext.DataForwardingNotPossible == nil { + if item.DataForwardingNotPossible == nil { t.Fatal("Data Forwarding Not Possible: got absent, want present alongside the ignored extension") } + + if err := ap.Diagnose[ProtocolIEID](&item).Check(); err != nil { + t.Fatalf("Check() = %v, want an ignore extension to pass", err) + } } diff --git a/s1ap/extension_typing_test.go b/s1ap/extension_typing_test.go new file mode 100644 index 0000000000..e8ef5ffea4 --- /dev/null +++ b/s1ap/extension_typing_test.go @@ -0,0 +1,278 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "os" + "path/filepath" + "regexp" + "strconv" + "strings" + "testing" + + "github.com/ellanetworks/core/per/ap" +) + +type extSpecRow struct { + id ProtocolIEID + crit string + presence string +} + +func extSpecRows[M any](table []ieSpec[M]) []extSpecRow { + rows := make([]extSpecRow, len(table)) + + for i, s := range table { + p := "optional" + + switch s.Presence { + case ap.PresenceMandatory: + p = "mandatory" + case ap.PresenceConditional: + p = "conditional" + } + + rows[i] = extSpecRow{id: s.ID, crit: s.Criticality.String(), presence: p} + } + + return rows +} + +func typedExtensionTables() []struct { + set string + rows []extSpecRow +} { + return []struct { + set string + rows []extSpecRow + }{ + {"Additional-GUTI-ExtIEs", extSpecRows(extIEsAdditionalGUTI)}, + {"AllocationAndRetentionPriority-ExtIEs", extSpecRows(extIEsAllocationAndRetentionPriority)}, + {"CGI-ExtIEs", extSpecRows(extIEsCGI)}, + {"CNTypeRestrictions-Item-ExtIEs", extSpecRows(extIEsCNTypeRestrictionsItem)}, + {"CancelledCellinEAI-Item-ExtIEs", extSpecRows(extIEsCancelledCellInEAIItem)}, + {"CancelledCellinTAI-Item-ExtIEs", extSpecRows(extIEsCancelledCellInTAIItem)}, + {"CellID-Broadcast-Item-ExtIEs", extSpecRows(extIEsCellIDBroadcastItem)}, + {"CellID-Cancelled-Item-ExtIEs", extSpecRows(extIEsCellIDCancelledItem)}, + {"CellType-ExtIEs", extSpecRows(extIEsCellType)}, + {"CompletedCellinEAI-Item-ExtIEs", extSpecRows(extIEsCompletedCellInEAIItem)}, + {"CompletedCellinTAI-Item-ExtIEs", extSpecRows(extIEsCompletedCellInTAIItem)}, + {"ContextatSource-ExtIEs", extSpecRows(extIEsContextatSource)}, + {"CriticalityDiagnostics-ExtIEs", extSpecRows(extIEsCriticalityDiagnostics)}, + {"CriticalityDiagnostics-IE-Item-ExtIEs", extSpecRows(extIEsCriticalityDiagnosticsIEItem)}, + {"DAPSRequestInfo-ExtIEs", extSpecRows(extIEsDAPSRequestInfo)}, + {"ENBX2ExtTLA-ExtIEs", extSpecRows(extIEsENBX2ExtTLA)}, + {"E-RABAdmittedItem-ExtIEs", extSpecRows(extIEsERABAdmittedItem)}, + {"E-RABDataForwardingItem-ExtIEs", extSpecRows(extIEsERABDataForwardingItem)}, + {"E-RABInformationListItem-ExtIEs", extSpecRows(extIEsERABInformationListItem)}, + {"E-RABItem-ExtIEs", extSpecRows(extIEsERABItem)}, + {"E-RABQoSParameters-ExtIEs", extSpecRows(extIEsERABLevelQoSParameters)}, + {"E-RABModifyItemBearerModResExtIEs", extSpecRows(extIEsERABModifyItemBearerModRes)}, + {"E-RABReleaseItemBearerRelCompExtIEs", extSpecRows(extIEsERABReleaseItemBearerRelComp)}, + {"E-RABSetupItemCtxtSUResExtIEs", extSpecRows(extIEsERABSetupItemCtxtSURes)}, + {"E-RABToBeModifiedItemBearerModInd-ExtIEs", extSpecRows(extIEsERABToBeModifiedItemBearerModInd)}, + {"E-RABToBeModifyItemBearerModReqExtIEs", extSpecRows(extIEsERABToBeModifiedItemBearerModReq)}, + {"E-RABToBeSetupItemBearerSUReqExtIEs", extSpecRows(extIEsERABToBeSetupItemBearerSUReq)}, + {"E-RABToBeSetupItemCtxtSUReqExtIEs", extSpecRows(extIEsERABToBeSetupItemCtxtSUReq)}, + {"E-RABToBeSetupItemHOReq-ExtIEs", extSpecRows(extIEsERABToBeSetupItemHOReq)}, + {"E-RABToBeSwitchedDLItem-ExtIEs", extSpecRows(extIEsERABToBeSwitchedDLItem)}, + {"E-RABToBeSwitchedULItem-ExtIEs", extSpecRows(extIEsERABToBeSwitchedULItem)}, + {"EUTRAN-CGI-ExtIEs", extSpecRows(extIEsEUTRANCGI)}, + {"EmergencyAreaID-Broadcast-Item-ExtIEs", extSpecRows(extIEsEmergencyAreaIDBroadcastItem)}, + {"EmergencyAreaID-Cancelled-Item-ExtIEs", extSpecRows(extIEsEmergencyAreaIDCancelledItem)}, + {"FiveGSTAI-ExtIEs", extSpecRows(extIEsFiveGSTAI)}, + {"ForbiddenLAs-Item-ExtIEs", extSpecRows(extIEsForbiddenLAsItem)}, + {"ForbiddenTAs-Item-ExtIEs", extSpecRows(extIEsForbiddenTAsItem)}, + {"GBR-QosInformation-ExtIEs", extSpecRows(extIEsGBRQosInformation)}, + {"GNB-ExtIEs", extSpecRows(extIEsGNB)}, + {"GUMMEI-ExtIEs", extSpecRows(extIEsGUMMEI)}, + {"GlobalENB-ID-ExtIEs", extSpecRows(extIEsGlobalENBID)}, + {"Global-GNB-ID-ExtIEs", extSpecRows(extIEsGlobalGNBID)}, + {"HandoverRestrictionList-ExtIEs", extSpecRows(extIEsHandoverRestrictionList)}, + {"InterSystemMeasurementItem-ExtIEs", extSpecRows(extIEsInterSystemMeasurementItem)}, + {"InterSystemMeasurementParameters-ExtIEs", extSpecRows(extIEsInterSystemMeasurementParameters)}, + {"IntersystemMeasurementConfiguration-ExtIEs", extSpecRows(extIEsIntersystemMeasurementConfiguration)}, + {"LAI-ExtIEs", extSpecRows(extIEsLAI)}, + {"LTE-NTN-TAI-Information-ExtIEs", extSpecRows(extIEsLTENTNTAIInformation)}, + {"LastVisitedEUTRANCellInformation-ExtIEs", extSpecRows(extIEsLastVisitedEUTRANCellInformation)}, + {"LastVisitedPSCellInformation-ExtIEs", extSpecRows(extIEsLastVisitedPSCellInformation)}, + {"ListeningSubframePattern-ExtIEs", extSpecRows(extIEsListeningSubframePattern)}, + {"MutingPatternInformation-ExtIEs", extSpecRows(extIEsMutingPatternInformation)}, + {"NR-CGI-ExtIEs", extSpecRows(extIEsNRCGI)}, + {"NG-eNB-ExtIEs", extSpecRows(extIEsNgENB)}, + {"PSCellInformation-ExtIEs", extSpecRows(extIEsPSCellInformation)}, + {"RAT-RestrictionsItem-ExtIEs", extSpecRows(extIEsRATRestrictionsItem)}, + {"RLFReportInformation-ExtIEs", extSpecRows(extIEsRLFReportInformation)}, + {"RequestType-ExtIEs", extSpecRows(extIEsRequestType)}, + {"RequestedTNLInfo-ExtIEs", extSpecRows(extIEsRequestedTNLInfo)}, + {"SONConfigurationTransfer-ExtIEs", extSpecRows(extIEsSONConfigurationTransfer)}, + {"SONInformationReply-ExtIEs", extSpecRows(extIEsSONInformationReply)}, + {"S-TMSI-ExtIEs", extSpecRows(extIEsSTMSI)}, + {"SecurityContext-ExtIEs", extSpecRows(extIEsSecurityContext)}, + {"SecurityIndication-ExtIEs", extSpecRows(extIEsSecurityIndication)}, + {"ServedGUMMEIsItem-ExtIEs", extSpecRows(extIEsServedGUMMEIsItem)}, + {"SourceNgRanNode-ID-ExtIEs", extSpecRows(extIEsSourceNgRanNodeID)}, + {"SourceeNB-ID-ExtIEs", extSpecRows(extIEsSourceeNBID)}, + {"SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs", extSpecRows(extIEsSourceeNBToTargeteNBTransparentContainer)}, + {"SupportedTAs-Item-ExtIEs", extSpecRows(extIEsSupportedTAItem)}, + {"SynchronisationInformation-ExtIEs", extSpecRows(extIEsSynchronisationInformation)}, + {"TAI-ExtIEs", extSpecRows(extIEsTAI)}, + {"TAI-Broadcast-Item-ExtIEs", extSpecRows(extIEsTAIBroadcastItem)}, + {"TAI-Cancelled-Item-ExtIEs", extSpecRows(extIEsTAICancelledItem)}, + {"TAIItemExtIEs", extSpecRows(extIEsTAIItem)}, + {"TargetNgRanNode-ID-ExtIEs", extSpecRows(extIEsTargetNgRanNodeID)}, + {"TargetRNC-ID-ExtIEs", extSpecRows(extIEsTargetRNCID)}, + {"TargeteNB-ID-ExtIEs", extSpecRows(extIEsTargeteNBID)}, + {"TimeBasedHandoverInformation-ExtIEs", extSpecRows(extIEsTimeBasedHandoverInformation)}, + {"TimeSynchronisationInfo-ExtIEs", extSpecRows(extIEsTimeSynchronisationInfo)}, + {"TraceActivation-ExtIEs", extSpecRows(extIEsTraceActivation)}, + {"Tunnel-Information-ExtIEs", extSpecRows(extIEsTunnelInformation)}, + {"UEAggregate-MaximumBitrates-ExtIEs", extSpecRows(extIEsUEAggregateMaximumBitRate)}, + {"UE-associatedLogicalS1-ConnectionItemExtIEs", extSpecRows(extIEsUEAssociatedLogicalS1ConnectionItem)}, + {"UE-S1AP-ID-pair-ExtIEs", extSpecRows(extIEsUES1APIDPair)}, + {"UESecurityCapabilities-ExtIEs", extSpecRows(extIEsUESecurityCapabilities)}, + {"UserLocationInformation-ExtIEs", extSpecRows(extIEsUserLocationInformation)}, + {"X2TNLConfigurationInfo-ExtIEs", extSpecRows(extIEsX2TNLConfigurationInfo)}, + {"E-RABModifyItemBearerModConfExtIEs", extSpecRows(extIEserabModifyItemBearerModConf)}, + } +} + +var knownUntypedExtensions = map[string]string{ + "TraceActivation-ExtIEs/id-MDTConfiguration": "MDT-Configuration subtree (M1..M7, MDT-Activation, AreaScopeOfMDT); carries no UE id or user-plane TNL", + "TraceActivation-ExtIEs/id-UEAppLayerMeasConfig": "UEAppLayerMeasConfig subtree (QMC area scope); carries no UE id or user-plane TNL", +} + +func asn1Text(t *testing.T) string { + t.Helper() + + files, err := filepath.Glob("testdata/asn1/*.asn") + if err != nil || len(files) == 0 { + t.Fatalf("vendored ASN.1: %v", err) + } + + var b strings.Builder + + for _, f := range files { + raw, err := os.ReadFile(f) + if err != nil { + t.Fatal(err) + } + + b.WriteString(regexp.MustCompile(`--.*`).ReplaceAllString(string(raw), "")) + b.WriteString("\n") + } + + return b.String() +} + +type asn1ExtRow struct { + name string + id ProtocolIEID + crit string + presence string +} + +func asn1ExtensionSets(t *testing.T) map[string][]asn1ExtRow { + t.Helper() + + text := asn1Text(t) + + ids := map[string]ProtocolIEID{} + + for _, m := range regexp.MustCompile(`(id-[\w-]+)\s+ProtocolIE-ID\s*::=\s*(\d+)`).FindAllStringSubmatch(text, -1) { + v, err := strconv.Atoi(m[2]) + if err != nil { + t.Fatal(err) + } + + ids[m[1]] = ProtocolIEID(v) + } + + sets := map[string][]asn1ExtRow{} + setRe := regexp.MustCompile(`(?ms)^([A-Za-z][\w-]*)\s+S1AP-PROTOCOL-EXTENSION\s*::=\s*\{(.*?)^\}`) + rowRe := regexp.MustCompile(`ID\s+(id-[\w-]+)\s+CRITICALITY\s+(\w+)\s+EXTENSION\s+[\w-]+\s+PRESENCE\s+(\w+)`) + + for _, m := range setRe.FindAllStringSubmatch(text, -1) { + rows := []asn1ExtRow{} + + for _, r := range rowRe.FindAllStringSubmatch(m[2], -1) { + id, ok := ids[r[1]] + if !ok { + t.Fatalf("%s: no ProtocolIE-ID for %s", m[1], r[1]) + } + + rows = append(rows, asn1ExtRow{name: r[1], id: id, crit: r[2], presence: r[3]}) + } + + sets[m[1]] = rows + } + + return sets +} + +func TestTypedExtensionsMatchTS36413(t *testing.T) { + sets := asn1ExtensionSets(t) + seenUntyped := map[string]bool{} + + for _, tbl := range typedExtensionTables() { + spec, ok := sets[tbl.set] + if !ok { + t.Errorf("%s: no such ExtIEs set in the vendored ASN.1", tbl.set) + + continue + } + + next := 0 + + for _, row := range tbl.rows { + found := -1 + + for i := next; i < len(spec); i++ { + if spec[i].id == row.id { + found = i + + break + } + } + + if found < 0 { + t.Errorf("%s: typed extension %s is not in the set, or is out of spec order", tbl.set, row.id) + + continue + } + + if spec[found].crit != row.crit || spec[found].presence != row.presence { + t.Errorf("%s/%s: typed as %s/%s, spec says %s/%s", tbl.set, spec[found].name, row.crit, row.presence, spec[found].crit, spec[found].presence) + } + + next = found + 1 + } + + for _, s := range spec { + typed := false + + for _, row := range tbl.rows { + typed = typed || row.id == s.id + } + + key := tbl.set + "/" + s.name + + if typed { + continue + } + + if _, allowed := knownUntypedExtensions[key]; !allowed { + t.Errorf("%s is spec-defined but left untyped", key) + } + + seenUntyped[key] = true + } + } + + for key := range knownUntypedExtensions { + if !seenUntyped[key] { + t.Errorf("allowlisted %s is typed now: remove it from knownUntypedExtensions", key) + } + } +} diff --git a/s1ap/handover_cancel.go b/s1ap/handover_cancel.go index 502a7b8123..47c7399b2f 100644 --- a/s1ap/handover_cancel.go +++ b/s1ap/handover_cancel.go @@ -18,25 +18,25 @@ type HandoverCancel struct { var handoverCancelIEs = []ieSpec[HandoverCancel]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCancel, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCancel, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCancel, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCancel, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *HandoverCancel) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverCancel, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancel, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -44,7 +44,7 @@ var handoverCancelIEs = []ieSpec[HandoverCancel]{ return nil }, - encode: func(m *HandoverCancel) (per.Marshaler, bool) { + Encode: func(m *HandoverCancel) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -78,6 +78,10 @@ func ParseHandoverCancel(value []byte) (*HandoverCancel, error) { return parseMessageBody[HandoverCancel](ProcHandoverCancel, TriggeringInitiatingMessage, handoverCancelIEs, value) } +func DecodeHandoverCancel(value []byte) (*HandoverCancel, error) { + return decodeMessageBody[HandoverCancel](ProcHandoverCancel, handoverCancelIEs, value) +} + // TS 36.413 §9.1.5.12. type HandoverCancelAcknowledge struct { MMEUES1APID *MMEUES1APID @@ -89,11 +93,11 @@ type HandoverCancelAcknowledge struct { var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverCancelAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancelAcknowledge, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -101,7 +105,7 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ return nil }, - encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -110,11 +114,11 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverCancelAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancelAcknowledge, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -122,7 +126,7 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ return nil }, - encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -131,11 +135,11 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCancelAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCancelAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -143,7 +147,7 @@ var handoverCancelAcknowledgeIEs = []ieSpec[HandoverCancelAcknowledge]{ return nil }, - encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverCancelAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -176,3 +180,7 @@ func (m *HandoverCancelAcknowledge) Marshal() ([]byte, error) { func ParseHandoverCancelAcknowledge(value []byte) (*HandoverCancelAcknowledge, error) { return parseMessageBody[HandoverCancelAcknowledge](ProcHandoverCancel, TriggeringSuccessfulOutcome, handoverCancelAcknowledgeIEs, value) } + +func DecodeHandoverCancelAcknowledge(value []byte) (*HandoverCancelAcknowledge, error) { + return decodeMessageBody[HandoverCancelAcknowledge](ProcHandoverCancel, handoverCancelAcknowledgeIEs, value) +} diff --git a/s1ap/handover_cancel_test.go b/s1ap/handover_cancel_test.go index 986740fc63..0b4d0e54be 100644 --- a/s1ap/handover_cancel_test.go +++ b/s1ap/handover_cancel_test.go @@ -8,7 +8,7 @@ import ( ) func TestHandoverCancelRoundTrip(t *testing.T) { - in := &HandoverCancel{MMEUES1APID: 7, ENBUES1APID: 2, Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 5})} + in := &HandoverCancel{MMEUES1APID: 7, ENBUES1APID: 2, Cause: Ptr(CauseRadioNetworkPartialHandover.Cause())} b, err := in.Marshal() if err != nil { @@ -30,7 +30,7 @@ func TestHandoverCancelRoundTrip(t *testing.T) { t.Fatalf("parse: %v", err) } - if out.MMEUES1APID != in.MMEUES1APID || out.ENBUES1APID != in.ENBUES1APID || deref(out.Cause) != deref(in.Cause) { + if out.MMEUES1APID != in.MMEUES1APID || out.ENBUES1APID != in.ENBUES1APID || !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("cancel = %+v, want %+v", out, in) } diff --git a/s1ap/handover_notify.go b/s1ap/handover_notify.go index 1b63b22743..aa3d0e808c 100644 --- a/s1ap/handover_notify.go +++ b/s1ap/handover_notify.go @@ -9,35 +9,36 @@ import ( // TS 36.413 §9.1.5.7. type HandoverNotify struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - EUTRANCGI *EUTRANCGI - TAI *TAI + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + EUTRANCGI *EUTRANCGI + TAI *TAI + TunnelInformationForBBF *TunnelInformation messageMeta } var handoverNotifyIEs = []ieSpec[HandoverNotify]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDEUTRANCGI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { + ID: IDEUTRANCGI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { var v EUTRANCGI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -45,7 +46,7 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ return nil }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { if m.EUTRANCGI == nil { return nil, false } @@ -54,11 +55,11 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ }, }, { - id: IDTAI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverNotify, raw []byte, enc per.Encoding) error { + ID: IDTAI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { var v TAI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -66,7 +67,7 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ return nil }, - encode: func(m *HandoverNotify) (per.Marshaler, bool) { + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { if m.TAI == nil { return nil, false } @@ -74,6 +75,13 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ return m.TAI, true }, }, + { + ID: IDTunnelInformationForBBF, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverNotify, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TunnelInformationForBBF) + }, + Encode: func(m *HandoverNotify) (per.Marshaler, bool) { return optionalIE(m.TunnelInformationForBBF) }, + }, } func (m *HandoverNotify) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -99,3 +107,7 @@ func (m *HandoverNotify) Marshal() ([]byte, error) { func ParseHandoverNotify(value []byte) (*HandoverNotify, error) { return parseMessageBody[HandoverNotify](ProcHandoverNotification, TriggeringInitiatingMessage, handoverNotifyIEs, value) } + +func DecodeHandoverNotify(value []byte) (*HandoverNotify, error) { + return decodeMessageBody[HandoverNotify](ProcHandoverNotification, handoverNotifyIEs, value) +} diff --git a/s1ap/handover_preparation.go b/s1ap/handover_preparation.go index 9c5ecf2650..b93915b22b 100644 --- a/s1ap/handover_preparation.go +++ b/s1ap/handover_preparation.go @@ -28,32 +28,32 @@ type HandoverRequired struct { var handoverRequiredIEs = []ieSpec[HandoverRequired]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDHandoverType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.HandoverType) + ID: IDHandoverType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.HandoverType) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.HandoverType, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.HandoverType, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -61,7 +61,7 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ return nil }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -70,18 +70,18 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ }, }, { - id: IDTargetID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargetID) + ID: IDTargetID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargetID) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.TargetID, true }, + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { return &m.TargetID, true }, }, { - id: IDDirectForwardingPathAvailability, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { + ID: IDDirectForwardingPathAvailability, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { var v DirectForwardingPathAvailability - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -89,7 +89,7 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ return nil }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { if m.DirectForwardingPathAvailability == nil { return nil, false } @@ -98,11 +98,11 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ }, }, { - id: IDSourceToTargetTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequired, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SourceToTarget) + ID: IDSourceToTargetTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SourceToTarget) }, - encode: func(m *HandoverRequired) (per.Marshaler, bool) { + Encode: func(m *HandoverRequired) (per.Marshaler, bool) { if m.SourceToTarget == nil { return nil, false } @@ -136,6 +136,10 @@ func ParseHandoverRequired(value []byte) (*HandoverRequired, error) { return parseMessageBody[HandoverRequired](ProcHandoverPreparation, TriggeringInitiatingMessage, handoverRequiredIEs, value) } +func DecodeHandoverRequired(value []byte) (*HandoverRequired, error) { + return decodeMessageBody[HandoverRequired](ProcHandoverPreparation, handoverRequiredIEs, value) +} + // TS 36.413 §9.1.5.2. The MME tells the source eNB that the target has // resources ready. TS 38.413 §9.2.3.2 carries the same shape; S1AP alone has a // second target container for SRVCC, which is not modelled. @@ -160,33 +164,33 @@ func handoverLeavesEUTRAN(m *HandoverCommand) bool { var handoverCommandIEs = []ieSpec[HandoverCommand]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDHandoverType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.HandoverType) + ID: IDHandoverType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.HandoverType) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.HandoverType, true }, + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { return &m.HandoverType, true }, }, { - id: IDNASSecurityParametersfromEUTRAN, presence: presenceConditional, crit: CriticalityReject, - condition: handoverLeavesEUTRAN, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASSecurityParametersfromEUTRAN) + ID: IDNASSecurityParametersfromEUTRAN, Presence: presenceConditional, Criticality: CriticalityReject, + Condition: handoverLeavesEUTRAN, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASSecurityParametersfromEUTRAN) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.NASSecurityParametersfromEUTRAN == nil { return nil, false } @@ -195,49 +199,45 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ }, }, { - id: IDERABSubjecttoDataForwardingList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { + ID: IDERABSubjecttoDataForwardingList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { var err error - m.ERABSubjecttoDataForwarding, err = decodeItemList[ERABDataForwardingItem](per.NewReader(raw), enc, maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore) + m.ERABSubjecttoDataForwarding, err = decodeItemList[ERABDataForwardingItem](r, enc, maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore) return err }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if len(m.ERABSubjecttoDataForwarding) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore, m.ERABSubjecttoDataForwarding) - }), true + return containerList(maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore, m.ERABSubjecttoDataForwarding), true }, }, { - id: IDERABtoReleaseListHOCmd, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { + ID: IDERABtoReleaseListHOCmd, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToRelease, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABToRelease, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if len(m.ERABToRelease) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToRelease) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToRelease), true }, }, { - id: IDTargetToSourceTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargetToSource) + ID: IDTargetToSourceTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargetToSource) }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.TargetToSource == nil { return nil, false } @@ -246,11 +246,11 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverCommand, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -258,7 +258,7 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ return nil }, - encode: func(m *HandoverCommand) (per.Marshaler, bool) { + Encode: func(m *HandoverCommand) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -292,6 +292,10 @@ func ParseHandoverCommand(value []byte) (*HandoverCommand, error) { return parseMessageBody[HandoverCommand](ProcHandoverPreparation, TriggeringSuccessfulOutcome, handoverCommandIEs, value) } +func DecodeHandoverCommand(value []byte) (*HandoverCommand, error) { + return decodeMessageBody[HandoverCommand](ProcHandoverPreparation, handoverCommandIEs, value) +} + // TS 36.413 §9.1.5.3. type HandoverPreparationFailure struct { MMEUES1APID *MMEUES1APID @@ -304,11 +308,11 @@ type HandoverPreparationFailure struct { var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -316,7 +320,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -325,11 +329,11 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -337,7 +341,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -346,11 +350,11 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -358,7 +362,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -367,11 +371,11 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverPreparationFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverPreparationFailure, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -379,7 +383,7 @@ var handoverPreparationFailureIEs = []ieSpec[HandoverPreparationFailure]{ return nil }, - encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverPreparationFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -412,3 +416,7 @@ func (m *HandoverPreparationFailure) Marshal() ([]byte, error) { func ParseHandoverPreparationFailure(value []byte) (*HandoverPreparationFailure, error) { return parseMessageBody[HandoverPreparationFailure](ProcHandoverPreparation, TriggeringUnsuccessfulOutcome, handoverPreparationFailureIEs, value) } + +func DecodeHandoverPreparationFailure(value []byte) (*HandoverPreparationFailure, error) { + return decodeMessageBody[HandoverPreparationFailure](ProcHandoverPreparation, handoverPreparationFailureIEs, value) +} diff --git a/s1ap/handover_preparation_test.go b/s1ap/handover_preparation_test.go index 17479ebd3b..201034095d 100644 --- a/s1ap/handover_preparation_test.go +++ b/s1ap/handover_preparation_test.go @@ -10,13 +10,14 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestHandoverPreparationFailureRoundTrip(t *testing.T) { in := &HandoverPreparationFailure{ MMEUES1APID: Ptr(MMEUES1APID(7)), ENBUES1APID: Ptr(ENBUES1APID(2)), - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 0}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), } b, err := in.Marshal() @@ -40,7 +41,7 @@ func TestHandoverPreparationFailureRoundTrip(t *testing.T) { } if deref(out.MMEUES1APID) != deref(in.MMEUES1APID) || deref(out.ENBUES1APID) != deref(in.ENBUES1APID) || - deref(out.Cause) != deref(in.Cause) { + !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("failure = %+v, want %+v", out, in) } } @@ -54,10 +55,10 @@ func TestHandoverCommandGolden(t *testing.T) { HandoverType: HandoverTypeIntraLTE, ERABSubjecttoDataForwarding: []ERABDataForwardingItem{{ ERABID: 5, - DLTransportLayerAddr: TransportLayerAddress{192, 0, 2, 1}, + DLTransportLayerAddr: Ptr(tlaOf(192, 0, 2, 1)), DLGTPTEID: Ptr(GTPTEID(0x11223344)), }}, - ERABToRelease: []ERABItem{{ERABID: 6, Cause: Cause{Group: CauseGroupRadioNetwork, Value: 0}}}, + ERABToRelease: []ERABItem{{ERABID: 6, Cause: CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: TransparentContainer{0xcc, 0xdd}, } @@ -178,9 +179,19 @@ func TestHandoverCommandRejectsNASSecurityParametersWithoutCondition(t *testing. t.Fatalf("err = %v, want an AbstractSyntaxError", err) } - if abstract.Cause.Value != CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage { + if !abstract.Cause.Equal(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage.Cause()) { t.Errorf("cause %v, want falsely-constructed-message", abstract.Cause) } + + decoded, err := DecodeHandoverCommand(pdu.(*SuccessfulOutcome).Value) + if err != nil { + t.Fatalf("Decode: %v", err) + } + + again, err := decoded.Marshal() + if err != nil || !bytes.Equal(again, b) { + t.Fatalf("Marshal(Decode(b)) = %x (%v), want %x", again, err, b) + } } // encodedHandoverTypeIE is the HandoverType IE exactly as a message body @@ -189,7 +200,7 @@ func encodedHandoverTypeIE(t *testing.T, v HandoverType) []byte { t.Helper() w := per.NewWriter() - if err := encodeContainerField(w, per.Aligned, ieField{id: IDHandoverType, crit: CriticalityReject, val: v}); err != nil { + if err := encodeContainerField(w, per.Aligned, ieField{ID: IDHandoverType, Criticality: CriticalityReject, Value: v}); err != nil { t.Fatal(err) } @@ -199,8 +210,8 @@ func encodedHandoverTypeIE(t *testing.T, v HandoverType) []byte { } func sampleTargetID() TargetID { - return TargetID{TargeteNBID: TargeteNBID{ - GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 0x00101}}, + return TargetID{TargeteNBID: &TargeteNBID{ + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x00101))}}, SelectedTAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 7}, }} } @@ -210,7 +221,7 @@ func TestHandoverRequiredRoundTrip(t *testing.T) { MMEUES1APID: 0x020000bf, ENBUES1APID: 2, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), // handover-desirable-for-radio-reasons + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), // handover-desirable-for-radio-reasons TargetID: sampleTargetID(), SourceToTarget: TransparentContainer{0x01, 0x02, 0x03, 0x04}, } @@ -239,11 +250,11 @@ func TestHandoverRequiredRoundTrip(t *testing.T) { t.Fatalf("ids/type: mme=%#x enb=%d type=%d", out.MMEUES1APID, out.ENBUES1APID, out.HandoverType) } - if deref(out.Cause) != deref(in.Cause) { + if !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("cause = %+v, want %+v", out.Cause, in.Cause) } - if out.TargetID != in.TargetID { + if !out.TargetID.Equal(in.TargetID) { t.Fatalf("targetID = %+v, want %+v", out.TargetID, in.TargetID) } @@ -259,7 +270,7 @@ func TestHandoverTypeRootValuesRoundTrip(t *testing.T) { MMEUES1APID: 1, ENBUES1APID: 2, HandoverType: ht, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), TargetID: sampleTargetID(), SourceToTarget: TransparentContainer{0x01}, } @@ -285,19 +296,34 @@ func TestHandoverTypeRootValuesRoundTrip(t *testing.T) { } } -func TestTargetIDNonENBAlternativeRejected(t *testing.T) { - w := per.NewWriter() +func TestTargetIDOtherAlternativesRoundTrip(t *testing.T) { + plmn := PLMNIdentity{0x00, 0xf1, 0x10} - // Encode TargetID with root choice index 1 (targetRNC-ID), unmodeled. - if err := func() error { - w.WriteBit(false) - return per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, targetIDRootCount-1, 1) - }(); err != nil { - t.Fatal(err) + cases := []TargetID{ + {TargetRNCID: &TargetRNCID{LAI: LAI{PLMNIdentity: plmn, LAC: 0x1234}, RAC: Ptr(RAC(5)), RNCID: 4095, ExtendedRNCID: Ptr(uint16(65535))}}, + {CGI: &CGI{PLMNIdentity: plmn, LAC: 0x1234, CI: 0xbeef}}, + {Ext: &per.ExtensionAlternative{Index: 1, Value: "\x00"}}, } - if _, err := unmarshalPERValue[TargetID](perBytes(w)); err == nil { - t.Fatal("expected decodeTargetID to reject a non-targeteNB-ID alternative") + for _, in := range cases { + b := ieRaw(t, &in) + + got, err := unmarshalPERValue[TargetID](b) + if err != nil { + t.Fatalf("%+v: %v", in, err) + } + + if !got.Equal(in) { + t.Fatalf("decoded %+v, want %+v", got, in) + } + + if out := ieRaw(t, &got); !bytes.Equal(out, b) { + t.Fatalf("re-encoded % x, want % x", out, b) + } + + if want := in.Ext != nil; got.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) != want { + t.Fatalf("%+v: Diagnose != %v", in, want) + } } } @@ -306,7 +332,7 @@ func TestHandoverCommandRoundTrip(t *testing.T) { MMEUES1APID: 7, ENBUES1APID: 2, HandoverType: HandoverTypeIntraLTE, - ERABToRelease: []ERABItem{{ERABID: 6, Cause: Cause{Group: CauseGroupRadioNetwork, Value: 0}}}, + ERABToRelease: []ERABItem{{ERABID: 6, Cause: CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: TransparentContainer{0x11, 0x22}, } @@ -353,11 +379,11 @@ func TestHandoverRequestNASSecurityParametersCondition(t *testing.T) { return &HandoverRequest{ MMEUES1APID: 1, HandoverType: ht, - Cause: &Cause{Group: CauseGroupRadioNetwork, Value: 0}, + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), UEAMBR: UEAggregateMaximumBitRate{DL: 1000, UL: 1000}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5}}, SourceToTarget: TransparentContainer{0x01}, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}}, } } @@ -439,27 +465,20 @@ func TestHandoverTypeInterSystemValues(t *testing.T) { t.Fatalf("intralte = %x, want 00", raw) } - // An addition a later release makes is refused rather than narrowed onto a - // value this one knows (§10.3.1 case 6). - for _, k := range []int64{2, 3, 255} { + for _, k := range []int64{2, 3, 200} { var v HandoverType - err := v.UnmarshalPER(per.NewReader(extensionEnum(t, handoverTypeRootCount, k)), per.Aligned) - if err == nil { - t.Errorf("extension %d decoded as %d, want it refused", k, v) - - continue + in := extensionEnum(t, int64(len(enumHandoverType.Root)), k) + if err := v.UnmarshalPER(per.NewReader(in), per.Aligned); err != nil { + t.Fatalf("extension %d: %v", k, err) } - if !errors.Is(err, errNotComprehended) { - t.Errorf("extension %d: err = %v, want errNotComprehended", k, err) + if !v.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Errorf("extension %d decoded as known value %s", k, v.Name()) } - } - for _, v := range []HandoverType{handoverTypeCount, handoverTypeCount + 1} { - w := per.NewWriter() - if err := v.MarshalPER(w, per.Aligned); err == nil { - t.Errorf("unassigned value %d encoded as %x, want an error", v, w.Bytes()) + if out := ieRaw(t, &v); !bytes.Equal(out, in) { + t.Errorf("extension %d re-encoded % x, want % x", k, out, in) } } } @@ -468,7 +487,7 @@ func sampleTargetNgRanNodeID() TargetID { return TargetID{TargetNgRanNodeID: &TargetNgRanNodeID{ GlobalRANNodeID: GlobalRANNodeID{GNB: &GNB{GlobalGNBID: GlobalGNBID{ PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - GNBID: GNBID{Value: 0x00101, Bits: 22}, + GNBID: GNBIdentity{GNBID: &GNBID{Value: 0x00101, Bits: 22}}, }}}, SelectedTAI: FiveGSTAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 0x000007}, }} @@ -483,7 +502,7 @@ func TestHandoverRequiredTargetsNGRAN(t *testing.T) { MMEUES1APID: 0x020000bf, ENBUES1APID: 2, HandoverType: HandoverTypeEPSToFiveGS, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), TargetID: sampleTargetNgRanNodeID(), SourceToTarget: TransparentContainer{0x01, 0x02, 0x03, 0x04}, } @@ -521,7 +540,7 @@ func TestHandoverRequiredTargetsNGRAN(t *testing.T) { t.Fatalf("global RAN node = %+v, want a gNB", node.GlobalRANNodeID) } - if got := node.GlobalRANNodeID.GNB.GlobalGNBID.GNBID; got != (GNBID{Value: 0x00101, Bits: 22}) { + if got := node.GlobalRANNodeID.GNB.GlobalGNBID.GNBID; got.GNBID == nil || *got.GNBID != (GNBID{Value: 0x00101, Bits: 22}) { t.Errorf("gNB-ID = %+v, want {0x00101 22}", got) } @@ -543,7 +562,7 @@ func mustMarshalHandoverRequired(t *testing.T, target TargetID) []byte { MMEUES1APID: 1, ENBUES1APID: 2, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), TargetID: target, SourceToTarget: TransparentContainer{0x01}, } @@ -566,7 +585,7 @@ func mustMarshalHandoverRequired(t *testing.T, target TargetID) []byte { func TestGlobalRANNodeIDAlternatives(t *testing.T) { ngENB := GlobalRANNodeID{NgENB: &NgENB{GlobalNgENBID: GlobalENBID{ PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, - ENBID: ENBID{Kind: ENBIDLongMacro, Value: 0x1F0FF}, + ENBID: ENBID{LongMacroENBID: Ptr(LongMacroENBID(0x1F0FF))}, }}} w := per.NewWriter() @@ -585,7 +604,7 @@ func TestGlobalRANNodeIDAlternatives(t *testing.T) { t.Fatalf("round trip = %+v, want an ng-eNB", back) } - if back.NgENB.GlobalNgENBID.ENBID != ngENB.NgENB.GlobalNgENBID.ENBID { + if !back.NgENB.GlobalNgENBID.ENBID.Equal(ngENB.NgENB.GlobalNgENBID.ENBID) { t.Fatalf("ng-eNB id = %+v, want %+v", back.NgENB.GlobalNgENBID.ENBID, ngENB.NgENB.GlobalNgENBID.ENBID) } @@ -596,13 +615,13 @@ func TestGlobalRANNodeIDAlternatives(t *testing.T) { {"no alternative", GlobalRANNodeID{}}, {"both alternatives", GlobalRANNodeID{GNB: &GNB{}, NgENB: &NgENB{}}}, {"gNB-ID narrower than 22 bits", GlobalRANNodeID{GNB: &GNB{GlobalGNBID: GlobalGNBID{ - GNBID: GNBID{Value: 1, Bits: 21}, + GNBID: GNBIdentity{GNBID: &GNBID{Value: 1, Bits: 21}}, }}}}, {"gNB-ID wider than 32 bits", GlobalRANNodeID{GNB: &GNB{GlobalGNBID: GlobalGNBID{ - GNBID: GNBID{Value: 1, Bits: 33}, + GNBID: GNBIdentity{GNBID: &GNBID{Value: 1, Bits: 33}}, }}}}, {"gNB id wider than its own bits", GlobalRANNodeID{GNB: &GNB{GlobalGNBID: GlobalGNBID{ - GNBID: GNBID{Value: 1 << 23, Bits: 22}, + GNBID: GNBIdentity{GNBID: &GNBID{Value: 1 << 23, Bits: 22}}, }}}}, } @@ -628,7 +647,7 @@ func TestHandoverRequiredDirectForwardingPathAvailability(t *testing.T) { MMEUES1APID: 1, ENBUES1APID: 2, HandoverType: HandoverTypeEPSToFiveGS, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), TargetID: sampleTargetNgRanNodeID(), DirectForwardingPathAvailability: Ptr(DirectForwardingPathAvailable), SourceToTarget: TransparentContainer{0x01}, diff --git a/s1ap/handover_resource_allocation.go b/s1ap/handover_resource_allocation.go index dcf2fc53ce..3bd37d38e6 100644 --- a/s1ap/handover_resource_allocation.go +++ b/s1ap/handover_resource_allocation.go @@ -29,6 +29,7 @@ type HandoverRequest struct { NASSecurityParameterstoEUTRAN NASSecurityParameterstoEUTRAN GUMMEI *GUMMEI MMEUES1APID2 *MMEUES1APID + TimeRefDistribution *TimeRefDistribution messageMeta } @@ -41,25 +42,25 @@ func handoverEntersEUTRAN(m *HandoverRequest) bool { var handoverRequestIEs = []ieSpec[HandoverRequest]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDHandoverType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.HandoverType) + ID: IDHandoverType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.HandoverType) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.HandoverType, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.HandoverType, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -67,7 +68,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -76,33 +77,31 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDUEAggregateMaximumBitrate, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UEAMBR) + ID: IDUEAggregateMaximumBitrate, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UEAMBR) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UEAMBR, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UEAMBR, true }, }, { - id: IDERABToBeSetupListHOReq, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDERABToBeSetupListHOReq, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemHOReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject) + m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemHOReq](r, enc, maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject) return err }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject, m.ERABToBeSetup) - }), true + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { + return containerList(maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject, m.ERABToBeSetup), true }, }, { - id: IDSourceToTargetTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SourceToTarget) + ID: IDSourceToTargetTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SourceToTarget) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.SourceToTarget == nil { return nil, false } @@ -111,18 +110,18 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDUESecurityCapabilities, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UESecurityCapabilities) + ID: IDUESecurityCapabilities, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UESecurityCapabilities) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UESecurityCapabilities, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UESecurityCapabilities, true }, }, { - id: IDHandoverRestrictionList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDHandoverRestrictionList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v HandoverRestrictionList - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -130,7 +129,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.HandoverRestrictionList == nil { return nil, false } @@ -139,11 +138,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDTraceActivation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDTraceActivation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v TraceActivation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -151,7 +150,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.TraceActivation == nil { return nil, false } @@ -160,19 +159,19 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDSecurityContext, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SecurityContext) + ID: IDSecurityContext, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SecurityContext) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.SecurityContext, true }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.SecurityContext, true }, }, { - id: IDNASSecurityParameterstoEUTRAN, presence: presenceConditional, crit: CriticalityReject, - condition: handoverEntersEUTRAN, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASSecurityParameterstoEUTRAN) + ID: IDNASSecurityParameterstoEUTRAN, Presence: presenceConditional, Criticality: CriticalityReject, + Condition: handoverEntersEUTRAN, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASSecurityParameterstoEUTRAN) }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.NASSecurityParameterstoEUTRAN == nil { return nil, false } @@ -181,11 +180,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDGUMMEI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDGUMMEI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v GUMMEI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -193,7 +192,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.GUMMEI == nil { return nil, false } @@ -202,11 +201,11 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, }, { - id: IDMMEUES1APID2, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequest, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID2, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -214,7 +213,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return nil }, - encode: func(m *HandoverRequest) (per.Marshaler, bool) { + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { if m.MMEUES1APID2 == nil { return nil, false } @@ -222,6 +221,13 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.MMEUES1APID2, true }, }, + { + ID: IDTimeRefDistribution, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TimeRefDistribution) + }, + Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return optionalIE(m.TimeRefDistribution) }, + }, } func (m *HandoverRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -248,6 +254,10 @@ func ParseHandoverRequest(value []byte) (*HandoverRequest, error) { return parseMessageBody[HandoverRequest](ProcHandoverResourceAllocation, TriggeringInitiatingMessage, handoverRequestIEs, value) } +func DecodeHandoverRequest(value []byte) (*HandoverRequest, error) { + return decodeMessageBody[HandoverRequest](ProcHandoverResourceAllocation, handoverRequestIEs, value) +} + // TS 36.413 §9.1.5.5. type HandoverRequestAcknowledge struct { MMEUES1APID *MMEUES1APID @@ -262,11 +272,11 @@ type HandoverRequestAcknowledge struct { var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -274,7 +284,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -283,11 +293,11 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -295,7 +305,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -304,49 +314,45 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDERABAdmittedList, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDERABAdmittedList, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var err error - m.ERABAdmitted, err = decodeItemList[ERABAdmittedItem](per.NewReader(raw), enc, maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore) + m.ERABAdmitted, err = decodeItemList[ERABAdmittedItem](r, enc, maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore) return err }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if len(m.ERABAdmitted) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore, m.ERABAdmitted) - }), true + return containerList(maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore, m.ERABAdmitted), true }, }, { - id: IDERABFailedToSetupListHOReqAck, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDERABFailedToSetupListHOReqAck, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var err error - m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABFailedtoSetupItemHOReqAck, CriticalityIgnore) + m.ERABFailedToSetup, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABFailedtoSetupItemHOReqAck, CriticalityIgnore) return err }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if len(m.ERABFailedToSetup) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABFailedtoSetupItemHOReqAck, CriticalityIgnore, m.ERABFailedToSetup) - }), true + return containerList(maxnoofERABs, IDERABFailedtoSetupItemHOReqAck, CriticalityIgnore, m.ERABFailedToSetup), true }, }, { - id: IDTargetToSourceTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TargetToSource) + ID: IDTargetToSourceTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TargetToSource) }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.TargetToSource == nil { return nil, false } @@ -355,11 +361,11 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -367,7 +373,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil }, - encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *HandoverRequestAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -401,6 +407,10 @@ func ParseHandoverRequestAcknowledge(value []byte) (*HandoverRequestAcknowledge, return parseMessageBody[HandoverRequestAcknowledge](ProcHandoverResourceAllocation, TriggeringSuccessfulOutcome, handoverRequestAcknowledgeIEs, value) } +func DecodeHandoverRequestAcknowledge(value []byte) (*HandoverRequestAcknowledge, error) { + return decodeMessageBody[HandoverRequestAcknowledge](ProcHandoverResourceAllocation, handoverRequestAcknowledgeIEs, value) +} + // TS 36.413 §9.1.5.6. type HandoverFailure struct { MMEUES1APID *MMEUES1APID @@ -412,11 +422,11 @@ type HandoverFailure struct { var handoverFailureIEs = []ieSpec[HandoverFailure]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverFailure, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverFailure, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -424,7 +434,7 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ return nil }, - encode: func(m *HandoverFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverFailure) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -433,11 +443,11 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *HandoverFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *HandoverFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -445,7 +455,7 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ return nil }, - encode: func(m *HandoverFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -454,11 +464,11 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *HandoverFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *HandoverFailure, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -466,7 +476,7 @@ var handoverFailureIEs = []ieSpec[HandoverFailure]{ return nil }, - encode: func(m *HandoverFailure) (per.Marshaler, bool) { + Encode: func(m *HandoverFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -499,3 +509,7 @@ func (m *HandoverFailure) Marshal() ([]byte, error) { func ParseHandoverFailure(value []byte) (*HandoverFailure, error) { return parseMessageBody[HandoverFailure](ProcHandoverResourceAllocation, TriggeringUnsuccessfulOutcome, handoverFailureIEs, value) } + +func DecodeHandoverFailure(value []byte) (*HandoverFailure, error) { + return decodeMessageBody[HandoverFailure](ProcHandoverResourceAllocation, handoverFailureIEs, value) +} diff --git a/s1ap/handover_resource_allocation_test.go b/s1ap/handover_resource_allocation_test.go index ecfb8d2415..8fc6afa152 100644 --- a/s1ap/handover_resource_allocation_test.go +++ b/s1ap/handover_resource_allocation_test.go @@ -6,7 +6,6 @@ package s1ap import ( "bytes" "encoding/hex" - "reflect" "testing" ) @@ -19,16 +18,16 @@ func TestHandoverRequestRoundTrip(t *testing.T) { in := &HandoverRequest{ MMEUES1APID: 0x020000bf, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAMBR: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ ERABID: 5, - TransportLayerAddress: TransportLayerAddress{10, 1, 2, 3}, + TransportLayerAddress: tlaOf(10, 1, 2, 3), GTPTEID: 0x01020304, QoS: ERABLevelQoSParameters{QCI: 9, ARP: AllocationAndRetentionPriority{PriorityLevel: 15}}, }}, SourceToTarget: TransparentContainer{0xaa, 0xbb}, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}, SecurityContext: SecurityContext{NextHopChainingCount: 3, NextHopParameter: nh}, } @@ -66,7 +65,7 @@ func TestHandoverRequestRoundTrip(t *testing.T) { got, want := out.ERABToBeSetup[0], in.ERABToBeSetup[0] if got.ERABID != want.ERABID || got.GTPTEID != want.GTPTEID || got.QoS.QCI != want.QoS.QCI || - !bytes.Equal(got.TransportLayerAddress, want.TransportLayerAddress) { + got.TransportLayerAddress != want.TransportLayerAddress { t.Fatalf("E-RAB item = %+v, want %+v", got, want) } } @@ -77,10 +76,10 @@ func TestHandoverRequestAcknowledgeRoundTrip(t *testing.T) { ENBUES1APID: Ptr(ENBUES1APID(9)), ERABAdmitted: []ERABAdmittedItem{{ ERABID: 5, - TransportLayerAddress: TransportLayerAddress{10, 9, 9, 9}, + TransportLayerAddress: tlaOf(10, 9, 9, 9), GTPTEID: 0x0a0b0c0d, }}, - ERABFailedToSetup: []ERABItem{{ERABID: 6, Cause: Cause{Group: CauseGroupRadioNetwork, Value: 0}}}, + ERABFailedToSetup: []ERABItem{{ERABID: 6, Cause: CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: TransparentContainer{0x11, 0x22, 0x33}, } @@ -109,7 +108,7 @@ func TestHandoverRequestAcknowledgeRoundTrip(t *testing.T) { } if len(out.ERABAdmitted) != 1 || out.ERABAdmitted[0].GTPTEID != in.ERABAdmitted[0].GTPTEID || - !bytes.Equal(out.ERABAdmitted[0].TransportLayerAddress, in.ERABAdmitted[0].TransportLayerAddress) { + out.ERABAdmitted[0].TransportLayerAddress != in.ERABAdmitted[0].TransportLayerAddress { t.Fatalf("admitted = %+v", out.ERABAdmitted) } @@ -130,9 +129,9 @@ func TestHandoverRequestAcknowledgeForwardingTunnels(t *testing.T) { ENBUES1APID: Ptr(ENBUES1APID(9)), ERABAdmitted: []ERABAdmittedItem{{ ERABID: 5, - TransportLayerAddress: TransportLayerAddress{10, 9, 9, 9}, + TransportLayerAddress: tlaOf(10, 9, 9, 9), GTPTEID: 0x0a0b0c0d, - DLTransportLayerAddr: TransportLayerAddress{10, 8, 8, 8}, + DLTransportLayerAddr: Ptr(tlaOf(10, 8, 8, 8)), DLGTPTEID: &dlTEID, }}, TargetToSource: TransparentContainer{0x01}, @@ -154,7 +153,7 @@ func TestHandoverRequestAcknowledgeForwardingTunnels(t *testing.T) { } it := out.ERABAdmitted[0] - if it.DLGTPTEID == nil || *it.DLGTPTEID != dlTEID || !bytes.Equal(it.DLTransportLayerAddr, in.ERABAdmitted[0].DLTransportLayerAddr) { + if it.DLGTPTEID == nil || *it.DLGTPTEID != dlTEID || it.DLTransportLayerAddr == nil || *it.DLTransportLayerAddr != *in.ERABAdmitted[0].DLTransportLayerAddr { t.Fatalf("DL forwarding tunnel = %+v", it) } @@ -166,7 +165,7 @@ func TestHandoverRequestAcknowledgeForwardingTunnels(t *testing.T) { func TestHandoverFailureRoundTrip(t *testing.T) { in := &HandoverFailure{ MMEUES1APID: Ptr(MMEUES1APID(7)), - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 0}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), } b, err := in.Marshal() @@ -189,7 +188,7 @@ func TestHandoverFailureRoundTrip(t *testing.T) { t.Fatalf("parse: %v", err) } - if deref(out.MMEUES1APID) != deref(in.MMEUES1APID) || deref(out.Cause) != deref(in.Cause) { + if deref(out.MMEUES1APID) != deref(in.MMEUES1APID) || !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("failure = %+v, want %+v", out, in) } } @@ -205,7 +204,7 @@ func TestHandoverRequestAcknowledgeFailedListItemID(t *testing.T) { MMEUES1APID: Ptr(MMEUES1APID(1)), ENBUES1APID: Ptr(ENBUES1APID(2)), ERABAdmitted: []ERABAdmittedItem{{ERABID: 0}}, - ERABFailedToSetup: []ERABItem{{ERABID: 4, Cause: Cause{Group: CauseGroupRadioNetwork, Value: 0}}}, + ERABFailedToSetup: []ERABItem{{ERABID: 4, Cause: CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: TransparentContainer{0x00}, }).Marshal() if err != nil { @@ -225,15 +224,13 @@ func TestHandoverRequestDataForwardingNotPossibleRoundTrip(t *testing.T) { in := &HandoverRequest{ MMEUES1APID: 1, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), ERABToBeSetup: []ERABToBeSetupItemHOReq{{ - ERABID: 5, - TransportLayerAddress: TransportLayerAddress{10, 1, 2, 3}, - GTPTEID: 0x01020304, - QoS: ERABLevelQoSParameters{QCI: 9, ARP: AllocationAndRetentionPriority{PriorityLevel: 15}}, - Extensions: &ERABToBeSetupItemHOReqExtIEs{ - DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), - }, + ERABID: 5, + TransportLayerAddress: tlaOf(10, 1, 2, 3), + GTPTEID: 0x01020304, + QoS: ERABLevelQoSParameters{QCI: 9, ARP: AllocationAndRetentionPriority{PriorityLevel: 15}}, + DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), }}, SourceToTarget: TransparentContainer{0xaa}, } @@ -262,10 +259,7 @@ func TestHandoverRequestDataForwardingNotPossibleRoundTrip(t *testing.T) { t.Fatalf("E-RAB list len = %d, want 1", len(out.ERABToBeSetup)) } - ext := out.ERABToBeSetup[0].Extensions - if ext == nil { - t.Fatal("iE-Extensions: got absent, want present") - } + ext := out.ERABToBeSetup[0] if ext.DataForwardingNotPossible == nil { t.Fatal("Data Forwarding Not Possible: got absent, want present") @@ -276,34 +270,17 @@ func TestHandoverRequestDataForwardingNotPossibleRoundTrip(t *testing.T) { } } -// The container is SIZE(1..maxProtocolExtensions), so a present-but-empty one -// has no legal encoding. -func TestERABToBeSetupItemHOReqEmptyExtensionsRejected(t *testing.T) { - _, err := (&HandoverRequest{ - MMEUES1APID: 1, - HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), - ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5, Extensions: &ERABToBeSetupItemHOReqExtIEs{}}}, - SourceToTarget: TransparentContainer{0xaa}, - }).Marshal() - if err == nil { - t.Fatal("expected an error encoding an empty iE-Extensions container") - } -} - // Verified against the Wireshark S1AP dissector, which reads the container as // id-Data-Forwarding-Not-Possible (143), criticality ignore, value // data-Forwarding-not-Possible. func TestHandoverRequestDataForwardingNotPossibleGolden(t *testing.T) { b, err := (&HandoverRequest{ - Cause: new(Cause), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), SourceToTarget: TransparentContainer{0x00}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ - ERABID: 1, TransportLayerAddress: TransportLayerAddress{10, 0, 0, 1}, GTPTEID: 1, - QoS: ERABLevelQoSParameters{QCI: 9, ARP: AllocationAndRetentionPriority{PriorityLevel: 1}}, - Extensions: &ERABToBeSetupItemHOReqExtIEs{ - DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), - }, + ERABID: 1, TransportLayerAddress: tlaOf(10, 0, 0, 1), GTPTEID: 1, + QoS: ERABLevelQoSParameters{QCI: 9, ARP: AllocationAndRetentionPriority{PriorityLevel: 1}}, + DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), }}, }).Marshal() if err != nil { @@ -330,16 +307,16 @@ func TestHandoverRequestCarriesRestrictionList(t *testing.T) { in := &HandoverRequest{ MMEUES1APID: 1, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 0}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), UEAMBR: UEAggregateMaximumBitRate{DL: 1000, UL: 1000}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ ERABID: 5, - TransportLayerAddress: TransportLayerAddress{192, 0, 2, 1}, + TransportLayerAddress: tlaOf(192, 0, 2, 1), GTPTEID: 1, QoS: ERABLevelQoSParameters{QCI: 9, ARP: AllocationAndRetentionPriority{PriorityLevel: 1}}, }}, SourceToTarget: TransparentContainer{0x01}, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0x8000}}, HandoverRestrictionList: &HandoverRestrictionList{ ServingPLMN: serving, EquivalentPLMNs: EPLMNs{other}, @@ -378,11 +355,11 @@ func TestHandoverRequestCarriesRestrictionList(t *testing.T) { t.Errorf("equivalent PLMNs = %+v, want [% x]", got.EquivalentPLMNs, other) } - if len(got.ForbiddenTAs) != 1 || !reflect.DeepEqual(got.ForbiddenTAs[0].ForbiddenTACs, ForbiddenTACs{7, 8}) { + if len(got.ForbiddenTAs) != 1 || !got.ForbiddenTAs[0].ForbiddenTACs.Equal(ForbiddenTACs{7, 8}) { t.Errorf("forbidden TAs = %+v, want one item with TACs [7 8]", got.ForbiddenTAs) } - if len(got.ForbiddenLAs) != 1 || !reflect.DeepEqual(got.ForbiddenLAs[0].ForbiddenLACs, ForbiddenLACs{9}) { + if len(got.ForbiddenLAs) != 1 || !got.ForbiddenLAs[0].ForbiddenLACs.Equal(ForbiddenLACs{9}) { t.Errorf("forbidden LAs = %+v, want one item with LACs [9]", got.ForbiddenLAs) } @@ -445,11 +422,11 @@ func handoverRequestGoldenCases() []newMessageCase { msg: &HandoverRequest{ MMEUES1APID: 1, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAMBR: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}, SourceToTarget: TransparentContainer{0x00, 0x01, 0x80, 0x00, 0x00, 0xf1, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00, 0xf1, 0x10, 0x00, 0x00, 0x10, 0x20, 0x80, 0x00, 0x0a}, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}, SecurityContext: SecurityContext{NextHopChainingCount: 3}, GUMMEI: Ptr(goldGUMMEI()), MMEUES1APID2: Ptr(MMEUES1APID(3)), diff --git a/s1ap/ie_common.go b/s1ap/ie_common.go index 86828dac8d..5d4ebbf539 100644 --- a/s1ap/ie_common.go +++ b/s1ap/ie_common.go @@ -4,41 +4,18 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) // encodeExtensibleInt encodes an INTEGER whose constraint carries an extension // marker but defines no extension additions: X.691 §13.1 spends one bit, then -// the root value follows. A value outside the root is refused rather than sent -// as an extension, because 3GPP has defined no such addition to send. +// the root value follows. func encodeExtensibleInt(w *per.Writer, enc per.Encoding, lb, ub, n int64) error { - if n < lb || n > ub { - return fmt.Errorf("value %d outside the extension root %d..%d", n, lb, ub) - } - - w.WriteBit(false) - - return per.EncodeInteger(w, enc, per.Bounds{LB: lb, HasLB: true, UB: ub, HasUB: true}, n) + return per.EncodeInteger(w, enc, per.Bounds{LB: lb, HasLB: true, UB: ub, HasUB: true, Extensible: true}, n) } -// decodeExtensibleInt consumes an extension value before reporting it, so the -// reader is left positioned after the field: X.691 §13.1 sends an out-of-root -// value as an unconstrained integer (§13.2.4-13.2.6), which carries its own -// length determinant and is therefore skippable without knowing the addition. -// Criticality then decides what to do with the enclosing IE (§10.3.1 case 6). -func decodeExtensibleInt(r *per.Reader, enc per.Encoding, lb, ub int64, name string) (int64, error) { - v, err := per.DecodeInteger(r, enc, per.Bounds{LB: lb, HasLB: true, UB: ub, HasUB: true, Extensible: true}) - if err != nil { - return 0, err - } - - if v < lb || v > ub { - return 0, fmt.Errorf("%w: %s extension value %d", errNotComprehended, name, v) - } - - return v, nil +func decodeExtensibleInt(r *per.Reader, enc per.Encoding, lb, ub int64) (int64, error) { + return per.DecodeInteger(r, enc, per.Bounds{LB: lb, HasLB: true, UB: ub, HasUB: true, Extensible: true}) } // nameMaxLen bounds ENBname / MMEname (PrintableString (SIZE(1..150,...))). diff --git a/s1ap/ie_erab.go b/s1ap/ie_erab.go index d4ea1a3884..5c521b4fa0 100644 --- a/s1ap/ie_erab.go +++ b/s1ap/ie_erab.go @@ -4,29 +4,38 @@ package s1ap import ( - "net/netip" + "math" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // ERABID ::= INTEGER (0..15, ...) (extensible). type ERABID uint8 func (id ERABID) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeExtensibleInt(w, enc, 0, 15, int64(id)) + return encodeExtensibleInt(w, enc, 0, erabIDRootMax, int64(id)) } func (id *ERABID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, 0, 15, "E-RAB-ID") + v, err := decodeExtensibleInt(r, enc, 0, erabIDRootMax) if err != nil { return err } + if v < 0 || v > math.MaxUint8 { + return per.ErrOverflow + } + *id = ERABID(v) return nil } +const erabIDRootMax = 15 + +func (id *ERABID) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return *id > erabIDRootMax } + // QCI ::= INTEGER (0..255). type QCI uint8 @@ -65,11 +74,11 @@ const ( // pre-emptionCapability, pre-emptionVulnerability, iE-Extensions OPTIONAL } // (extensible). PriorityLevel ::= INTEGER (0..15). type AllocationAndRetentionPriority struct { - PriorityLevel uint8 `per:",range:0..15"` - PreemptionCapability PreemptionCapability `per:"ENUMERATED,range:0..1"` - PreemptionVulnerability PreemptionVulnerability `per:"ENUMERATED,range:0..1"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + PriorityLevel uint8 `per:",range:0..15"` + PreemptionCapability PreemptionCapability + PreemptionVulnerability PreemptionVulnerability + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // GBRQosInformation ::= SEQUENCE { four BitRates, iE-Extensions OPTIONAL } @@ -79,91 +88,27 @@ type GBRQosInformation struct { MaximumBitrateUL BitRate GuaranteedBitrateDL BitRate GuaranteedBitrateUL BitRate - ExtendedMaximumBitrateDL *ExtendedBitRate `per:"-"` - ExtendedMaximumBitrateUL *ExtendedBitRate `per:"-"` - ExtendedGuaranteedBitrateDL *ExtendedBitRate `per:"-"` - ExtendedGuaranteedBitrateUL *ExtendedBitRate `per:"-"` - iEExtensions messageMeta `per:",exttable:gBRQosInformationExtIEs"` + ExtendedMaximumBitrateDL *ExtendedBitRate `per:",extie:IDExtendedERABMaximumBitrateDL,crit:ignore"` + ExtendedMaximumBitrateUL *ExtendedBitRate `per:",extie:IDExtendedERABMaximumBitrateUL,crit:ignore"` + ExtendedGuaranteedBitrateDL *ExtendedBitRate `per:",extie:IDExtendedERABGuaranteedBitrateDL,crit:ignore"` + ExtendedGuaranteedBitrateUL *ExtendedBitRate `per:",extie:IDExtendedERABGuaranteedBitrateUL,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -var gBRQosInformationExtIEs = []ieSpec[GBRQosInformation]{ - optionalExtension(IDExtendedERABMaximumBitrateDL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { - return &m.ExtendedMaximumBitrateDL - }), - optionalExtension(IDExtendedERABMaximumBitrateUL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { - return &m.ExtendedMaximumBitrateUL - }), - optionalExtension(IDExtendedERABGuaranteedBitrateDL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { - return &m.ExtendedGuaranteedBitrateDL - }), - optionalExtension(IDExtendedERABGuaranteedBitrateUL, CriticalityIgnore, func(m *GBRQosInformation) **ExtendedBitRate { - return &m.ExtendedGuaranteedBitrateUL - }), -} - // ERABLevelQoSParameters ::= SEQUENCE { qCI, allocationRetentionPriority, // gbrQosInformation OPTIONAL, iE-Extensions OPTIONAL } (extensible). type ERABLevelQoSParameters struct { QCI QCI ARP AllocationAndRetentionPriority GBR *GBRQosInformation `per:",optional"` - DownlinkPacketLossRate *PacketLossRate `per:"-"` - UplinkPacketLossRate *PacketLossRate `per:"-"` - iEExtensions messageMeta `per:",exttable:eRABLevelQoSParametersExtIEs"` + DownlinkPacketLossRate *PacketLossRate `per:",extie:IDDownlinkPacketLossRate,crit:ignore"` + UplinkPacketLossRate *PacketLossRate `per:",extie:IDUplinkPacketLossRate,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } -var eRABLevelQoSParametersExtIEs = []ieSpec[ERABLevelQoSParameters]{ - optionalExtension(IDDownlinkPacketLossRate, CriticalityIgnore, func(m *ERABLevelQoSParameters) **PacketLossRate { - return &m.DownlinkPacketLossRate - }), - optionalExtension(IDUplinkPacketLossRate, CriticalityIgnore, func(m *ERABLevelQoSParameters) **PacketLossRate { - return &m.UplinkPacketLossRate - }), -} - -// TransportLayerAddress ::= BIT STRING (SIZE(1..160, ...)). Holds the address -// octets (IPv4 = 4, IPv6 = 16). -type TransportLayerAddress []byte - -func (a TransportLayerAddress) MarshalPER(w *per.Writer, enc per.Encoding) error { - return per.EncodeBitString(w, enc, 1, 160, true, true, true, a, len(a)*8) -} - -func (a *TransportLayerAddress) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - b, nbits, err := per.DecodeBitString(r, enc, 1, 160, true, true, true) - if err != nil { - return err - } - - *a = TransportLayerAddress(b[:(nbits+7)/8]) - - return nil -} - -// IPs returns the addresses the bit string carries. TS 36.414 §5.1 packs an -// IPv4 address, an IPv6 address, or both with the IPv4 one first; a return is -// invalid when that address is absent. -func (a TransportLayerAddress) IPs() (ipv4, ipv6 netip.Addr) { - switch len(a) { - case 4: - ipv4, _ = netip.AddrFromSlice(a) - case 16: - ipv6, _ = netip.AddrFromSlice(a) - case 20: - ipv4, _ = netip.AddrFromSlice(a[:4]) - ipv6, _ = netip.AddrFromSlice(a[4:]) - } - - return ipv4, ipv6 -} - -func (a TransportLayerAddress) Valid() bool { - ipv4, ipv6 := a.IPs() - - return ipv4.IsValid() || ipv6.IsValid() -} +type TransportLayerAddress = ap.TransportLayerAddress // GTPTEID ::= OCTET STRING (SIZE(4)). type GTPTEID uint32 @@ -192,127 +137,58 @@ type ERABToBeSetupItemCtxtSUReq struct { TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID NASPDU NASPDU `per:",optional"` - CorrelationID *CorrelationID `per:"-"` - SIPTOCorrelationID *CorrelationID `per:"-"` - BearerType *BearerType `per:"-"` - EthernetType *EthernetType `per:"-"` - SecurityIndication *SecurityIndication `per:"-"` - iEExtensions messageMeta `per:",exttable:eRABToBeSetupItemCtxtSUReqExtIEs"` + CorrelationID *CorrelationID `per:",extie:IDCorrelationID,crit:ignore"` + SIPTOCorrelationID *CorrelationID `per:",extie:IDSIPTOCorrelationID,crit:ignore"` + BearerType *BearerType `per:",extie:IDBearerType,crit:reject"` + EthernetType *EthernetType `per:",extie:IDEthernetType,crit:ignore"` + SecurityIndication *SecurityIndication `per:",extie:IDSecurityIndication,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } -var eRABToBeSetupItemCtxtSUReqExtIEs = []ieSpec[ERABToBeSetupItemCtxtSUReq]{ - optionalExtension(IDCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemCtxtSUReq) **CorrelationID { - return &m.CorrelationID - }), - optionalExtension(IDSIPTOCorrelationID, CriticalityIgnore, func(m *ERABToBeSetupItemCtxtSUReq) **CorrelationID { - return &m.SIPTOCorrelationID - }), - optionalExtension(IDBearerType, CriticalityReject, func(m *ERABToBeSetupItemCtxtSUReq) **BearerType { - return &m.BearerType - }), - optionalExtension(IDEthernetType, CriticalityIgnore, func(m *ERABToBeSetupItemCtxtSUReq) **EthernetType { - return &m.EthernetType - }), - optionalExtension(IDSecurityIndication, CriticalityReject, func(m *ERABToBeSetupItemCtxtSUReq) **SecurityIndication { - return &m.SecurityIndication - }), -} - // ERABSetupItemCtxtSURes ::= SEQUENCE { e-RAB-ID, transportLayerAddress, // gTP-TEID, iE-Extensions OPTIONAL } (extensible). type ERABSetupItemCtxtSURes struct { ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } // ERABItem ::= SEQUENCE { e-RAB-ID, cause, iE-Extensions OPTIONAL } (extensible). type ERABItem struct { - _ [0]struct{} `per:"extseq"` - ERABID ERABID - Cause Cause - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + Cause Cause + iEExtensions extensionMeta `per:",exttable"` } type BearerType uint8 const ( BearerTypeNonIP BearerType = iota - - bearerTypeRootCount = 1 ) -func (b BearerType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, bearerTypeRootCount, int64(b), "BearerType") -} - -func (b *BearerType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, bearerTypeRootCount, "BearerType") - if err != nil { - return err - } - - *b = BearerType(idx) - - return nil -} - type EthernetType uint8 const ( EthernetTypeTrue EthernetType = iota - - ethernetTypeRootCount = 1 ) -func (e EthernetType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, ethernetTypeRootCount, int64(e), "Ethernet-Type") -} - -func (e *EthernetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, ethernetTypeRootCount, "Ethernet-Type") - if err != nil { - return err - } - - *e = EthernetType(idx) - - return nil -} - type IntegrityProtectionIndication uint8 const ( IntegrityProtectionRequired IntegrityProtectionIndication = iota IntegrityProtectionPreferred IntegrityProtectionNotNeeded - - integrityProtectionIndicationRootCount = 3 ) -func (i IntegrityProtectionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, integrityProtectionIndicationRootCount, int64(i), "IntegrityProtectionIndication") -} - -func (i *IntegrityProtectionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, integrityProtectionIndicationRootCount, "IntegrityProtectionIndication") - if err != nil { - return err - } - - *i = IntegrityProtectionIndication(idx) - - return nil -} - type SecurityIndication struct { IntegrityProtectionIndication IntegrityProtectionIndication - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` } @@ -362,7 +238,7 @@ func (b ExtendedBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { } func (b *ExtendedBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := decodeExtensibleInt(r, enc, extendedBitRateMin, extendedBitRateMax, "ExtendedBitRate") + v, err := decodeExtensibleInt(r, enc, extendedBitRateMin, extendedBitRateMax) if err != nil { return err } @@ -371,3 +247,7 @@ func (b *ExtendedBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } + +func (b *ExtendedBitRate) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return *b < extendedBitRateMin || *b > extendedBitRateMax +} diff --git a/s1ap/ie_erab_test.go b/s1ap/ie_erab_test.go index 5d85109e8f..6f6795f50a 100644 --- a/s1ap/ie_erab_test.go +++ b/s1ap/ie_erab_test.go @@ -4,7 +4,6 @@ package s1ap import ( - "reflect" "testing" "github.com/ellanetworks/core/per" @@ -30,7 +29,7 @@ func TestAllocationAndRetentionPriorityRoundTrip(t *testing.T) { t.Fatalf("level %d: %v", level, err) } - if !reflect.DeepEqual(out, in) { + if !out.Equal(in) { t.Fatalf("level %d: round trip %+v, want %+v", level, out, in) } } @@ -56,7 +55,7 @@ func TestGBRQosInformationRoundTrip(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(out, in) { + if !out.Equal(in) { t.Fatalf("round trip %+v, want %+v", out, in) } } diff --git a/s1ap/ie_extension_types.go b/s1ap/ie_extension_types.go new file mode 100644 index 0000000000..adb5a94678 --- /dev/null +++ b/s1ap/ie_extension_types.go @@ -0,0 +1,693 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "math" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +const ( + maxnoofPSCellsPerPrimaryCellinUEHistoryInfo = 8 + maxnoofTACsInNTN = 12 + maxnooffrequencies = 64 + maxnoofeNBX2TLAs = 2 + maxnoofeNBX2ExtTLAs = 16 + maxnoofeNBX2GTPTLAs = 16 + nrCellIdentityBits = 36 + rATRestrictionInformationBits = 8 + stratumLevelRootMax = 3 + patternOffsetRootMax = 10239 +) + +type GUMMEIType uint8 + +const ( + GUMMEITypeNative GUMMEIType = iota + GUMMEITypeMapped + GUMMEITypeMappedFrom5G +) + +type NRrestrictioninEPSasSecondaryRAT uint8 + +const NRrestrictedinEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT = 0 + +type UnlicensedSpectrumRestriction uint8 + +const UnlicensedRestricted UnlicensedSpectrumRestriction = 0 + +type NRrestrictionin5GS uint8 + +const NRrestrictedin5GS NRrestrictionin5GS = 0 + +type CNType uint8 + +const ( + CNTypeFiveGCForbidden CNType = iota + CNTypeEPCForbidden +) + +type CNTypeRestrictionsItem struct { + PLMNIdentity PLMNIdentity + CNType CNType + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CNTypeRestrictions []CNTypeRestrictionsItem + +func (l CNTypeRestrictions) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEPLMNsPlusOne, []CNTypeRestrictionsItem(l)) +} + +func (l *CNTypeRestrictions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CNTypeRestrictionsItem](r, enc, 1, maxnoofEPLMNsPlusOne) + *l = items + + return err +} + +type RATRestrictionInformation struct { + Value uint8 + extended bool + octets string + bits int +} + +func (v RATRestrictionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + if v.extended { + return encodeExtSizedBits(w, enc, rATRestrictionInformationBits, v.octets, v.bits) + } + + return encodeExtSizedBits(w, enc, rATRestrictionInformationBits, string([]byte{v.Value}), rATRestrictionInformationBits) +} + +func (v *RATRestrictionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, nbits, err := per.DecodeBitString(r, enc, rATRestrictionInformationBits, rATRestrictionInformationBits, true, true, true) + if err != nil { + return err + } + + head := make([]byte, 1) + copy(head, b) + + *v = RATRestrictionInformation{Value: head[0]} + + if nbits != rATRestrictionInformationBits { + v.extended, v.octets, v.bits = true, string(b), nbits + } + + return nil +} + +func encodeExtSizedBits(w *per.Writer, enc per.Encoding, size int64, octets string, nbits int) error { + return per.EncodeBitString(w, enc, size, size, true, true, true, []byte(octets), nbits) +} + +type RATRestrictionsItem struct { + PLMNIdentity PLMNIdentity + RATRestrictionInformation RATRestrictionInformation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RATRestrictions []RATRestrictionsItem + +func (l RATRestrictions) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEPLMNsPlusOne, []RATRestrictionsItem(l)) +} + +func (l *RATRestrictions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[RATRestrictionsItem](r, enc, 1, maxnoofEPLMNsPlusOne) + *l = items + + return err +} + +type NRCellIdentity uint64 + +func (c NRCellIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(c), nrCellIdentityBits) +} + +func (c *NRCellIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, nrCellIdentityBits) + *c = NRCellIdentity(v) + + return err +} + +type NRCGI struct { + PLMNIdentity PLMNIdentity + NRCellIdentity NRCellIdentity + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PSCellInformation struct { + NCGI NRCGI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LTENTNTAIInformation struct { + ServingPLMN PLMNIdentity + TACListInLTENTN []TAC `per:"SEQUENCE-OF,size:1..12"` + UELocationDerivedTAC *TAC `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RequestTypeAdditionalInfo uint8 + +const RequestTypeAdditionalInfoIncludePSCell RequestTypeAdditionalInfo = 0 + +type DAPSIndicator uint8 + +const DAPSIndicatorDAPSHORequired DAPSIndicator = 0 + +type DAPSRequestInfo struct { + DAPSIndicator DAPSIndicator + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TimeUEStayedInCellEnhancedGranularity uint16 + +func (t TimeUEStayedInCellEnhancedGranularity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, timeStayBounds, int64(t)) +} + +func (t *TimeUEStayedInCellEnhancedGranularity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, timeStayBounds) + *t = TimeUEStayedInCellEnhancedGranularity(v) + + return err +} + +var timeStayBounds = per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true} + +type LastVisitedPSCellInformation struct { + PSCellID *PSCellInformation `per:",optional"` + TimeStay uint16 `per:",range:0..40950"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type LastVisitedPSCellList []LastVisitedPSCellInformation + +func (l LastVisitedPSCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPSCellsPerPrimaryCellinUEHistoryInfo, []LastVisitedPSCellInformation(l)) +} + +func (l *LastVisitedPSCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[LastVisitedPSCellInformation](r, enc, 1, maxnoofPSCellsPerPrimaryCellinUEHistoryInfo) + *l = items + + return err +} + +type MobilityInformation uint32 + +func (m MobilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(m), 32) +} + +func (m *MobilityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, 32) + *m = MobilityInformation(v) + + return err +} + +type AdditionalRRMPriorityIndex uint32 + +func (a AdditionalRRMPriorityIndex) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(a), 32) +} + +func (a *AdditionalRRMPriorityIndex) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, 32) + *a = AdditionalRRMPriorityIndex(v) + + return err +} + +type UEHistoryInformationFromTheUE []byte + +func (u UEHistoryInformationFromTheUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, false, false, false, u) +} + +func (u *UEHistoryInformationFromTheUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + *u = b + + return err +} + +type IMSvoiceEPSfallbackfrom5G uint8 + +const IMSvoiceEPSfallbackfrom5GTrue IMSvoiceEPSfallbackfrom5G = 0 + +type EmergencyIndicator uint8 + +const EmergencyIndicatorTrue EmergencyIndicator = 0 + +type RANUENGAPID uint32 + +func (id RANUENGAPID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: math.MaxUint32, HasUB: true}, int64(id)) +} + +func (id *RANUENGAPID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: math.MaxUint32, HasUB: true}) + *id = RANUENGAPID(v) + + return err +} + +type ContextatSource struct { + SourceNGRANNodeID GlobalRANNodeID + RANUENGAPID RANUENGAPID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemMeasurementConfiguration struct { + RSRP *uint8 `per:",optional,range:0..127"` + RSRQ *uint8 `per:",optional,range:0..127"` + SINR *uint8 `per:",optional,range:0..127"` + InterSystemMeasurementParameters InterSystemMeasurementParameters + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type InterSystemMeasurementParameters struct { + MeasurementDuration uint8 `per:",range:1..100"` + InterSystemMeasurementList InterSystemMeasurementList `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type InterSystemMeasurementList []InterSystemMeasurementItem + +func (l InterSystemMeasurementList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnooffrequencies, []InterSystemMeasurementItem(l)) +} + +func (l *InterSystemMeasurementList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[InterSystemMeasurementItem](r, enc, 1, maxnooffrequencies) + *l = items + + return err +} + +type SubcarrierSpacingSSB uint8 + +const ( + SubcarrierSpacingSSBkHz15 SubcarrierSpacingSSB = iota + SubcarrierSpacingSSBkHz30 + SubcarrierSpacingSSBkHz60 + SubcarrierSpacingSSBkHz120 + SubcarrierSpacingSSBkHz240 + SubcarrierSpacingSSBkHz480 + SubcarrierSpacingSSBkHz960 +) + +type InterSystemMeasurementItem struct { + FreqBandIndicatorNR uint16 `per:",range:1..1024"` + SSBFrequencies uint32 `per:",range:0..3279165"` + SubcarrierSpacingSSB SubcarrierSpacingSSB + MaxRSIndexCellQual *uint8 `per:",optional,range:1..16"` + SMTC []byte `per:",optional"` + ThreshRSIndexR15 []byte `per:",optional"` + SSBToMeasure []byte `per:",optional"` + SSRSSIMeasurement []byte `per:",optional"` + QuantityConfigNRR15 []byte `per:",optional"` + ExcludedCellsToAddModList []byte `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` +} + +type SourceNgRanNodeID struct { + GlobalRANNodeID GlobalRANNodeID + SelectedTAI FiveGSTAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SourceNodeID struct { + SourceNgRanNodeID *SourceNgRanNodeID `per:",choice:0"` + ChoiceExtension *SingleContainer `per:",choice:1,extie"` +} + +type TimeBasedHandoverInformation struct { + HOWindowStart uint32 `per:",range:0..1048575"` + HOWindowDuration uint16 `per:",range:1..6000"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RATType uint8 + +const ( + RATTypeNBIoT RATType = iota + RATTypeNBIoTLEO + RATTypeNBIoTMEO + RATTypeNBIoTGEO + RATTypeNBIoTOtherSat + RATTypeEUTRANLEO + RATTypeEUTRANMEO + RATTypeEUTRANGEO + RATTypeEUTRANOtherSat +) + +type MDTConfigurationNR []byte + +func (m MDTConfigurationNR) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, false, false, false, m) +} + +func (m *MDTConfigurationNR) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + *m = b + + return err +} + +type URIAddress string + +func (u URIAddress) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeKnownMultiplierString(w, enc, per.CharVisibleString, 0, 0, false, false, false, string(u)) +} + +func (u *URIAddress) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + s, err := per.DecodeKnownMultiplierString(r, enc, per.CharVisibleString, 0, 0, false, false, false) + *u = URIAddress(s) + + return err +} + +type CoarseUELocationRequested uint8 + +const CoarseUELocationRequestedTrue CoarseUELocationRequested = 0 + +type TimeRefDistribution uint8 + +const TimeRefDistributionTrue TimeRefDistribution = 0 + +type CoarseUELocation []byte + +func (c CoarseUELocation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, false, false, false, c) +} + +func (c *CoarseUELocation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + *c = b + + return err +} + +type RequestedTNLInfo struct { + PLMNIdentity PLMNIdentity + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SourceeNBID struct { + GlobalENBID GlobalENBID + SelectedTAI TAI + iEExtensions extensionMeta `per:",exttable"` +} + +type SONInformationRequest uint8 + +const ( + SONInformationRequestX2TNLConfigurationInfo SONInformationRequest = iota + SONInformationRequestTimeSynchronisationInfo + SONInformationRequestActivateMuting + SONInformationRequestDeactivateMuting +) + +type SONInformation struct { + SONInformationRequest *SONInformationRequest `per:",choice:0"` + SONInformationReply *SONInformationReply `per:",choice:1"` + SONInformationExtension *SONInformationExtension `per:",choice:0,ext"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +type SONInformationExtension struct { + SONInformationReport *SONInformationReport `per:",choice:0,extie:IDSONInformationReport,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:0,extie"` + choiceCriticality ap.WireCriticality `per:",choicecrit"` +} + +type SONInformationReport struct { + RLFReportInformation *RLFReportInformation `per:",choice:0"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +type RLFReportContainer []byte + +func (c RLFReportContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, false, false, false, c) +} + +func (c *RLFReportContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + *c = b + + return err +} + +type RLFReportInformation struct { + UERLFReportContainer RLFReportContainer + UERLFReportContainerForExtendedBands *RLFReportContainer `per:",optional"` + NBIoTRLFReportContainer *RLFReportContainer `per:",extie:IDNBIoTRLFReportContainer,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SONInformationReply struct { + X2TNLConfigurationInfo *X2TNLConfigurationInfo `per:",optional"` + TimeSynchronisationInfo *TimeSynchronisationInfo `per:",extie:IDTimeSynchronisationInfo,crit:ignore"` + MutingPatternInformation *MutingPatternInformation `per:",extie:IDMutingPatternInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ENBX2TLAs []TransportLayerAddress + +func (l ENBX2TLAs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofeNBX2TLAs, []TransportLayerAddress(l)) +} + +func (l *ENBX2TLAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TransportLayerAddress](r, enc, 1, maxnoofeNBX2TLAs) + *l = items + + return err +} + +type ENBX2GTPTLAs []TransportLayerAddress + +func (l ENBX2GTPTLAs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofeNBX2GTPTLAs, []TransportLayerAddress(l)) +} + +func (l *ENBX2GTPTLAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TransportLayerAddress](r, enc, 1, maxnoofeNBX2GTPTLAs) + *l = items + + return err +} + +type ENBX2ExtTLA struct { + IPsecTLA *TransportLayerAddress `per:",optional"` + GTPTLAa ENBX2GTPTLAs `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ENBX2ExtTLAs []ENBX2ExtTLA + +func (l ENBX2ExtTLAs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofeNBX2ExtTLAs, []ENBX2ExtTLA(l)) +} + +func (l *ENBX2ExtTLAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ENBX2ExtTLA](r, enc, 1, maxnoofeNBX2ExtTLAs) + *l = items + + return err +} + +type X2TNLConfigurationInfo struct { + ENBX2TransportLayerAddresses ENBX2TLAs + ENBX2ExtendedTransportLayerAddresses ENBX2ExtTLAs `per:",extie:IDENBX2ExtendedTransportLayerAddresses,crit:ignore"` + ENBIndirectX2TransportLayerAddresses ENBX2TLAs `per:",extie:IDENBIndirectX2TransportLayerAddresses,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type StratumLevel uint8 + +func (s StratumLevel) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeExtensibleInt(w, enc, 0, stratumLevelRootMax, int64(s)) +} + +func (s *StratumLevel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeExtensibleInt(r, enc, 0, stratumLevelRootMax) + if err != nil { + return err + } + + if v < 0 || v > math.MaxUint8 { + return per.ErrOverflow + } + + *s = StratumLevel(v) + + return nil +} + +func (s *StratumLevel) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return *s > stratumLevelRootMax } + +type PatternOffset uint16 + +func (p PatternOffset) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeExtensibleInt(w, enc, 0, patternOffsetRootMax, int64(p)) +} + +func (p *PatternOffset) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeExtensibleInt(r, enc, 0, patternOffsetRootMax) + if err != nil { + return err + } + + if v < 0 || v > math.MaxUint16 { + return per.ErrOverflow + } + + *p = PatternOffset(v) + + return nil +} + +func (p *PatternOffset) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { return *p > patternOffsetRootMax } + +type SynchronisationStatus uint8 + +const ( + SynchronisationStatusSynchronous SynchronisationStatus = iota + SynchronisationStatusAsynchronous +) + +type MutingAvailabilityIndication uint8 + +const ( + MutingAvailabilityIndicationAvailable MutingAvailabilityIndication = iota + MutingAvailabilityIndicationUnavailable +) + +type TimeSynchronisationInfo struct { + StratumLevel StratumLevel + SynchronisationStatus SynchronisationStatus + MutingAvailabilityIndication *MutingAvailabilityIndication `per:",extie:IDMutingAvailabilityIndication,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MutingPatternPeriod uint8 + +const ( + MutingPatternPeriodMs0 MutingPatternPeriod = iota + MutingPatternPeriodMs1280 + MutingPatternPeriodMs2560 + MutingPatternPeriodMs5120 + MutingPatternPeriodMs10240 +) + +type MutingPatternInformation struct { + MutingPatternPeriod MutingPatternPeriod + MutingPatternOffset *PatternOffset `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PatternPeriod uint8 + +const ( + PatternPeriodMs1280 PatternPeriod = iota + PatternPeriodMs2560 + PatternPeriodMs5120 + PatternPeriodMs10240 +) + +type ListeningSubframePattern struct { + PatternPeriod PatternPeriod + PatternOffset PatternOffset + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SynchronisationInformation struct { + SourceStratumLevel *StratumLevel `per:",optional"` + ListeningSubframePattern *ListeningSubframePattern `per:",optional"` + AggressoreCGIList []EUTRANCGI `per:"SEQUENCE-OF,size:1..256,optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SONConfigurationTransfer struct { + TargeteNBID TargeteNBID + SourceeNBID SourceeNBID + SONInformation SONInformation + X2TNLConfigurationInfo *X2TNLConfigurationInfo `per:",extie:IDX2TNLConfigurationInfo,crit:ignore,presence:conditional,cond:sonRequestsX2TNLConfigurationInfo"` + SynchronisationInformation *SynchronisationInformation `per:",extie:IDSynchronisationInformation,crit:ignore,presence:conditional,cond:sonRequestsActivateMuting"` + RequestedTNLInfo *RequestedTNLInfo `per:",extie:IDRequestedTNLInfo,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +func sonRequests(c *SONConfigurationTransfer, want SONInformationRequest) bool { + r := c.SONInformation.SONInformationRequest + + return r != nil && *r == want +} + +func sonRequestsX2TNLConfigurationInfo(c *SONConfigurationTransfer) bool { + return sonRequests(c, SONInformationRequestX2TNLConfigurationInfo) +} + +func sonRequestsActivateMuting(c *SONConfigurationTransfer) bool { + return sonRequests(c, SONInformationRequestActivateMuting) +} + +type PortNumber [2]byte + +func (p PortNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 2, 2, true, true, false, p[:]) +} + +func (p *PortNumber) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) + if err != nil { + return err + } + + copy(p[:], b) + + return nil +} + +type TunnelInformation struct { + TransportLayerAddress TransportLayerAddress + UDPPortNumber *PortNumber `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} diff --git a/s1ap/ie_extensions.go b/s1ap/ie_extensions.go deleted file mode 100644 index 6d0620a65e..0000000000 --- a/s1ap/ie_extensions.go +++ /dev/null @@ -1,153 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package s1ap - -import ( - "errors" - "fmt" - - "github.com/ellanetworks/core/per" -) - -func extensionFields[M any](table []ieSpec[M], m *M, meta *messageMeta) []ieField { - typed := make([]*ieField, len(table)) - - for i, spec := range table { - if val, ok := spec.encode(m); ok { - typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} - } - } - - return orderFields(table, typed, meta) -} - -func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - if len(fields) > maxProtocolExtensions { - return fmt.Errorf("s1ap: %d extensions exceed maxProtocolExtensions", len(fields)) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 1, maxProtocolExtensions, int64(len(fields))); err != nil { - return err - } - - for _, f := range fields { - if err := encodeContainerField(w, enc, f); err != nil { - return err - } - } - - return nil -} - -func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *messageMeta) error { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) - if err != nil { - return err - } - - if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { - return fmt.Errorf("s1ap: extension container declares %d fields in %d bits", n, maxBits) - } - - var rejected *notComprehendedIE - - lastIdx := -1 - - for i := int64(0); i < n; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return err - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return err - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return err - } - - if len(val) == 0 { - return fmt.Errorf("s1ap: extension %d has an empty open type", id) - } - - f := rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val} - - if idx, spec, ok := lookupIESpec(table, f.id); ok { - if idx <= lastIdx { - return fmt.Errorf("s1ap: extension %s out of order or repeated", f.id) - } - - lastIdx = idx - - err := spec.decode(m, f.value, enc) - if err == nil { - meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) - - continue - } - - if !errors.Is(err, errNotComprehended) { - return err - } - - var inner *notComprehendedIE - if errors.As(err, &inner) && inner.Crit == CriticalityReject && rejected == nil { - rejected = inner - } - } - - if f.crit == CriticalityReject { - if rejected == nil { - rejected = ¬ComprehendedIE{ID: f.id, Crit: CriticalityReject, What: "iE-Extensions"} - } - - continue - } - - meta.preserveUpTo(f, maxProtocolExtensions) - } - - if rejected != nil { - return rejected - } - - if wireMatchesTable(table, meta.wire) { - meta.wire = nil - } - - return nil -} - -func optionalExtension[M any, T any, PT interface { - *T - per.Marshaler - per.Unmarshaler -}](id ProtocolIEID, crit Criticality, field func(m *M) **T, -) ieSpec[M] { - return ieSpec[M]{ - id: id, presence: presenceOptional, crit: crit, - decode: func(m *M, raw []byte, _ per.Encoding) error { - v := PT(new(T)) - - if err := perIEDecode(raw, v); err != nil { - return err - } - - *field(m) = (*T)(v) - - return nil - }, - encode: func(m *M) (per.Marshaler, bool) { - v := *field(m) - if v == nil { - return nil, false - } - - return PT(v), true - }, - } -} diff --git a/s1ap/ie_gummei.go b/s1ap/ie_gummei.go index 50d1685bc7..6290de1043 100644 --- a/s1ap/ie_gummei.go +++ b/s1ap/ie_gummei.go @@ -52,21 +52,22 @@ func (c *MMECode) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // GUMMEI ::= SEQUENCE { pLMN-Identity, mME-Group-ID, mME-Code, iE-Extensions // OPTIONAL } (extensible) (TS 36.413). type GUMMEI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity MMEGroupID MMEGroupID MMECode MMECode - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // ServedGUMMEIsItem ::= SEQUENCE { servedPLMNs, servedGroupIDs, servedMMECs, // iE-Extensions OPTIONAL } (extensible). type ServedGUMMEIsItem struct { - _ [0]struct{} `per:"extseq"` - ServedPLMNs []PLMNIdentity `per:"SEQUENCE-OF,size:1..32"` - ServedGroupIDs []MMEGroupID `per:"SEQUENCE-OF,size:1..65535"` - ServedMMECs []MMECode `per:"SEQUENCE-OF,size:1..256"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ServedPLMNs []PLMNIdentity `per:"SEQUENCE-OF,size:1..32"` + ServedGroupIDs []MMEGroupID `per:"SEQUENCE-OF,size:1..65535"` + ServedMMECs []MMECode `per:"SEQUENCE-OF,size:1..256"` + GUMMEIType *GUMMEIType `per:",extie:IDGUMMEIType,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // ServedGUMMEIs ::= SEQUENCE (SIZE(1..maxnoofRATs)) OF ServedGUMMEIsItem. diff --git a/s1ap/ie_handover.go b/s1ap/ie_handover.go index fccc0fa813..f66b42e998 100644 --- a/s1ap/ie_handover.go +++ b/s1ap/ie_handover.go @@ -4,8 +4,6 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -27,45 +25,10 @@ const ( HandoverTypeLTEtoGERAN HandoverTypeUTRANtoLTE HandoverTypeGERANtoLTE - - // The extension additions, numbered on from the root as PER numbers them: - // the k-th addition is handoverTypeRootCount+k. HandoverTypeEPSToFiveGS HandoverTypeFiveGSToEPS ) -const ( - handoverTypeRootCount = 5 - // handoverTypeCount is every value 3GPP has assigned, root and extension - // together. A value beyond it names no handover this release defines. - handoverTypeCount = 7 -) - -func (t HandoverType) MarshalPER(w *per.Writer, enc per.Encoding) error { - if t >= handoverTypeCount { - return fmt.Errorf("s1ap: HandoverType %d outside the assigned values", t) - } - - return per.EncodeEnumerated(w, enc, handoverTypeRootCount, true, int64(t)) -} - -func (t *HandoverType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := per.DecodeEnumerated(r, enc, handoverTypeRootCount, true) - if err != nil { - return err - } - - // §10.3.1 case 6, handled on the IE's criticality: an addition a later - // release makes is refused rather than narrowed onto a root value. - if idx >= handoverTypeCount { - return fmt.Errorf("%w: HandoverType extension value %d", errNotComprehended, idx) - } - - *t = HandoverType(idx) - - return nil -} - // Direct-Forwarding-Path-Availability ::= ENUMERATED { directPathAvailable, // ... } (TS 36.413 §9.2.3.15). The source eNB sets it in HANDOVER REQUIRED to // report that a direct forwarding path to the target is available; absent means @@ -75,25 +38,8 @@ type DirectForwardingPathAvailability uint8 const ( DirectForwardingPathAvailable DirectForwardingPathAvailability = iota - - directForwardingPathAvailabilityRootCount = 1 ) -func (d DirectForwardingPathAvailability) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, directForwardingPathAvailabilityRootCount, int64(d), "DirectForwardingPathAvailability") -} - -func (d *DirectForwardingPathAvailability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, directForwardingPathAvailabilityRootCount, "DirectForwardingPathAvailability") - if err != nil { - return err - } - - *d = DirectForwardingPathAvailability(idx) - - return nil -} - // TransparentContainer ::= OCTET STRING, relayed opaquely; the bytes are RAN // RRC information (TS 36.300). type TransparentContainer []byte @@ -156,130 +102,73 @@ func (p *NASSecurityParameterstoEUTRAN) UnmarshalPER(r *per.Reader, enc per.Enco // iE-Extensions OPTIONAL } (extensible) (TS 36.413 §9.2.1.26). The {NH, NCC} // pair the target derives the next KeNB from (TS 33.401). type SecurityContext struct { - _ [0]struct{} `per:"extseq"` - NextHopChainingCount uint8 `per:",range:0..7"` + extensions per.ExtensionAdditions `per:",extraw"` + NextHopChainingCount uint8 `per:",range:0..7"` NextHopParameter SecurityKey - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // TargeteNB-ID ::= SEQUENCE { global-ENB-ID, selected-TAI, iE-Extensions // OPTIONAL } (extensible) (TS 36.413). type TargeteNBID struct { - _ [0]struct{} `per:"extseq"` - GlobalENBID GlobalENBID - SelectedTAI TAI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + GlobalENBID GlobalENBID + SelectedTAI TAI + iEExtensions extensionMeta `per:",exttable"` } // TargetNgRanNode-ID ::= SEQUENCE { global-RAN-NODE-ID, selected-TAI FiveGSTAI, // iE-Extensions OPTIONAL } (extensible) (TS 36.413). It names an NG-RAN node an // EPS to 5GS handover targets, so the tracking area it carries is a 5GS one. type TargetNgRanNodeID struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` GlobalRANNodeID GlobalRANNodeID SelectedTAI FiveGSTAI - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // TargetID ::= CHOICE { targeteNB-ID, targetRNC-ID, cGI, ..., -// targetgNgRanNode-ID } (TS 36.413). Two alternatives are modelled: targeteNB-ID -// for an intra-LTE handover and the targetgNgRanNode-ID extension addition for -// the EPS to 5GS one. targetRNC-ID and cGI name targets Ella cannot reach. +// targetgNgRanNode-ID } (TS 36.413). // // Which alternative is present is not free: TS 36.413 §9.1.5.1 pairs it with the // Handover Type IE, so an eps-to-5gs Handover Required carries the NG-RAN target // and an intralte one the eNB target. The CHOICE does not enforce that — the // message handler does. type TargetID struct { - TargeteNBID TargeteNBID - TargetNgRanNodeID *TargetNgRanNodeID + TargeteNBID *TargeteNBID `per:",choice:0"` + TargetRNCID *TargetRNCID `per:",choice:1"` + CGI *CGI `per:",choice:2"` + TargetNgRanNodeID *TargetNgRanNodeID `per:",choice:0,ext"` + Ext *per.ExtensionAlternative `per:",extalt"` } -const ( - targetIDRootCount = 3 // targeteNB-ID, targetRNC-ID, cGI - - // targetIDExtTargetNgRanNodeID is the extension addition's index: the first, - // and so far only, addition TS 36.413 makes to the CHOICE. - targetIDExtTargetNgRanNodeID = 0 -) - -func (t TargetID) MarshalPER(w *per.Writer, enc per.Encoding) error { - if t.TargetNgRanNodeID != nil { - w.WriteBit(true) - - if err := per.EncodeNormallySmall(w, enc, targetIDExtTargetNgRanNodeID); err != nil { - return err - } - - // An extension alternative travels as an open type, so a receiver that - // does not know it can step over it (X.691 §23). - inner := per.NewWriter() - if err := t.TargetNgRanNodeID.MarshalPER(inner, enc); err != nil { - return err - } - - inner.AlignToByte() - - return per.EncodeOpenTypeBytes(w, enc, inner.Bytes()) - } - - w.WriteBit(false) - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, targetIDRootCount-1, 0); err != nil { - return err - } - - return t.TargeteNBID.MarshalPER(w, enc) +type LAI struct { + PLMNIdentity PLMNIdentity + LAC LAC + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -func (t *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return err - } - - if isExt { - return t.unmarshalExtension(r, enc) - } - - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, targetIDRootCount-1) - if err != nil { - return err - } +type RAC uint8 - if idx != 0 { - return fmt.Errorf("%w: TargetID alternative %d (only targeteNB-ID)", errNotComprehended, idx) - } +type CI uint16 - return t.TargeteNBID.UnmarshalPER(r, enc) +type TargetRNCID struct { + LAI LAI + RAC *RAC `per:",optional"` + RNCID uint16 `per:",range:0..4095"` + ExtendedRNCID *uint16 `per:",optional,range:4096..65535"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -func (t *TargetID) unmarshalExtension(r *per.Reader, enc per.Encoding) error { - extIdx, err := per.DecodeNormallySmall(r, enc) - if err != nil { - return err - } - - // The open type is read whatever it turns out to hold, so an addition a later - // release makes leaves the reader positioned after the alternative it could - // not decode. - raw, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return err - } - - if extIdx != targetIDExtTargetNgRanNodeID { - return fmt.Errorf("%w: TargetID extension alternative %d", errNotComprehended, extIdx) - } - - var node TargetNgRanNodeID - if err := node.UnmarshalPER(per.NewReader(raw), enc); err != nil { - return err - } - - t.TargetNgRanNodeID = &node - - return nil +type CGI struct { + PLMNIdentity PLMNIdentity + LAC LAC + CI CI + RAC *RAC `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // The Handover Restriction List vocabulary (TS 36.413 §9.2.1.22). The list is @@ -311,10 +200,10 @@ type ForbiddenLACs []LAC // ForbiddenTAs-Item ::= SEQUENCE { pLMN-Identity, forbiddenTACs, iE-Extensions // OPTIONAL } (extensible). type ForbiddenTAsItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity ForbiddenTACs ForbiddenTACs - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // ForbiddenTAs ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF ForbiddenTAs-Item. @@ -323,10 +212,10 @@ type ForbiddenTAs []ForbiddenTAsItem // ForbiddenLAs-Item ::= SEQUENCE { pLMN-Identity, forbiddenLACs, iE-Extensions // OPTIONAL } (extensible). type ForbiddenLAsItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity ForbiddenLACs ForbiddenLACs - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // ForbiddenLAs ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF ForbiddenLAs-Item. @@ -342,8 +231,8 @@ const ( ForbiddenInterRATsGERAN ForbiddenInterRATsUTRAN ForbiddenInterRATsCDMA2000 - - forbiddenInterRATsRootCount = 4 + ForbiddenInterRATsGERANandUTRAN + ForbiddenInterRATsCDMA2000andUTRAN ) // Range bounds of the Handover Restriction List vocabulary (TS 36.413, @@ -360,26 +249,36 @@ const ( // iE-Extensions OPTIONAL } (extensible) (TS 36.413 §9.2.1.22). Only the serving // PLMN is mandatory, and it is the one field §8.4.2.4 turns on. type HandoverRestrictionList struct { - _ [0]struct{} `per:"extseq"` - ServingPLMN PLMNIdentity - EquivalentPLMNs EPLMNs `per:",optional"` - ForbiddenTAs ForbiddenTAs `per:",optional"` - ForbiddenLAs ForbiddenLAs `per:",optional"` - ForbiddenInterRATs *ForbiddenInterRATs `per:",optional"` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ServingPLMN PLMNIdentity + EquivalentPLMNs EPLMNs `per:",optional"` + ForbiddenTAs ForbiddenTAs `per:",optional"` + ForbiddenLAs ForbiddenLAs `per:",optional"` + ForbiddenInterRATs *ForbiddenInterRATs `per:",optional"` + NRrestrictioninEPSasSecondaryRAT *NRrestrictioninEPSasSecondaryRAT `per:",extie:IDNRrestrictioninEPSasSecondaryRAT,crit:ignore"` + UnlicensedSpectrumRestriction *UnlicensedSpectrumRestriction `per:",extie:IDUnlicensedSpectrumRestriction,crit:ignore"` + CNTypeRestrictions CNTypeRestrictions `per:",extie:IDCNTypeRestrictions,crit:ignore"` + NRrestrictionin5GS *NRrestrictionin5GS `per:",extie:IDNRrestrictionin5GS,crit:ignore"` + LastNGRANPLMNIdentity *PLMNIdentity `per:",extie:IDLastNGRANPLMNIdentity,crit:ignore"` + RATRestrictions RATRestrictions `per:",extie:IDRATRestrictions,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // ERABToBeSetupItemHOReq ::= SEQUENCE { e-RAB-ID, transportLayerAddress, // gTP-TEID, e-RABlevelQosParameters, iE-Extensions OPTIONAL } (extensible) // (TS 36.413). type ERABToBeSetupItemHOReq struct { - ERABID ERABID - TransportLayerAddress TransportLayerAddress - GTPTEID GTPTEID - QoS ERABLevelQoSParameters - Extensions *ERABToBeSetupItemHOReqExtIEs `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` - containerCrit `per:"-"` + ERABID ERABID + TransportLayerAddress TransportLayerAddress + GTPTEID GTPTEID + QoS ERABLevelQoSParameters + DataForwardingNotPossible *DataForwardingNotPossible `per:",extie:IDDataForwardingNotPossible,crit:ignore"` + BearerType *BearerType `per:",extie:IDBearerType,crit:reject"` + EthernetType *EthernetType `per:",extie:IDEthernetType,crit:ignore"` + SecurityIndication *SecurityIndication `per:",extie:IDSecurityIndication,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } // DataForwardingNotPossible ::= ENUMERATED { data-forwarding-not-possible, @@ -388,54 +287,8 @@ type DataForwardingNotPossible uint8 const ( DataForwardingNotPossibleTrue DataForwardingNotPossible = iota - - dataForwardingNotPossibleRootCount = 1 ) -// ERABToBeSetupItemHOReqExtIEs is the ProtocolExtensionContainer of -// ERABToBeSetupItemHOReq. -type ERABToBeSetupItemHOReqExtIEs struct { - DataForwardingNotPossible *DataForwardingNotPossible - BearerType *BearerType - EthernetType *EthernetType - SecurityIndication *SecurityIndication - - meta messageMeta -} - -var eRABToBeSetupItemHOReqExtIEs = []ieSpec[ERABToBeSetupItemHOReqExtIEs]{ - { - id: IDDataForwardingNotPossible, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ERABToBeSetupItemHOReqExtIEs, raw []byte, enc per.Encoding) error { - var v DataForwardingNotPossible - - if err := perIEDecode(raw, &v); err != nil { - return err - } - - m.DataForwardingNotPossible = &v - - return nil - }, - encode: func(m *ERABToBeSetupItemHOReqExtIEs) (per.Marshaler, bool) { - if m.DataForwardingNotPossible == nil { - return nil, false - } - - return m.DataForwardingNotPossible, true - }, - }, - optionalExtension(IDBearerType, CriticalityReject, func(m *ERABToBeSetupItemHOReqExtIEs) **BearerType { - return &m.BearerType - }), - optionalExtension(IDEthernetType, CriticalityIgnore, func(m *ERABToBeSetupItemHOReqExtIEs) **EthernetType { - return &m.EthernetType - }), - optionalExtension(IDSecurityIndication, CriticalityReject, func(m *ERABToBeSetupItemHOReqExtIEs) **SecurityIndication { - return &m.SecurityIndication - }), -} - // ERABAdmittedItem ::= SEQUENCE { e-RAB-ID, transportLayerAddress, gTP-TEID, // dL-transportLayerAddress OPTIONAL, dL-gTP-TEID OPTIONAL, uL-TransportLayerAddress // OPTIONAL, uL-GTP-TEID OPTIONAL, iE-Extensions OPTIONAL } (extensible) @@ -444,11 +297,11 @@ type ERABAdmittedItem struct { ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - DLTransportLayerAddr TransportLayerAddress `per:",optional"` + DLTransportLayerAddr *TransportLayerAddress `per:",optional"` DLGTPTEID *GTPTEID `per:",optional"` - ULTransportLayerAddr TransportLayerAddress `per:",optional"` + ULTransportLayerAddr *TransportLayerAddress `per:",optional"` ULGTPTEID *GTPTEID `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } @@ -460,11 +313,11 @@ type ERABAdmittedItem struct { // inside the per-session HandoverCommandTransfer. type ERABDataForwardingItem struct { ERABID ERABID - DLTransportLayerAddr TransportLayerAddress `per:",optional"` + DLTransportLayerAddr *TransportLayerAddress `per:",optional"` DLGTPTEID *GTPTEID `per:",optional"` - ULTransportLayerAddr TransportLayerAddress `per:",optional"` + ULTransportLayerAddr *TransportLayerAddress `per:",optional"` ULGTPTEID *GTPTEID `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } diff --git a/s1ap/ie_ids.go b/s1ap/ie_ids.go index 6bcc1ab913..42573ef196 100644 --- a/s1ap/ie_ids.go +++ b/s1ap/ie_ids.go @@ -139,9 +139,59 @@ const ( IDExtendedERABMaximumBitrateUL ProtocolIEID = 256 IDExtendedERABGuaranteedBitrateDL ProtocolIEID = 257 IDExtendedERABGuaranteedBitrateUL ProtocolIEID = 258 + IDExtendedUEAggregateMaximumBitRateDL ProtocolIEID = 259 + IDExtendedUEAggregateMaximumBitRateUL ProtocolIEID = 260 IDDownlinkPacketLossRate ProtocolIEID = 273 IDUplinkPacketLossRate ProtocolIEID = 274 IDWarningAreaCoordinates ProtocolIEID = 286 IDEthernetType ProtocolIEID = 305 IDSecurityIndication ProtocolIEID = 332 + IDGUMMEIType ProtocolIEID = 170 + IDNRrestrictioninEPSasSecondaryRAT ProtocolIEID = 261 + IDUnlicensedSpectrumRestriction ProtocolIEID = 270 + IDCNTypeRestrictions ProtocolIEID = 282 + IDNRrestrictionin5GS ProtocolIEID = 287 + IDLastNGRANPLMNIdentity ProtocolIEID = 290 + IDRATRestrictions ProtocolIEID = 336 + IDPSCellInformation ProtocolIEID = 288 + IDLTENTNTAIInformation ProtocolIEID = 339 + IDRequestTypeAdditionalInfo ProtocolIEID = 298 + IDDAPSRequestInfo ProtocolIEID = 317 + IDSourceTransportLayerAddress ProtocolIEID = 328 + IDSourceNodeTransportLayerAddress ProtocolIEID = 340 + IDTimeUEStayedInCellEnhancedGranularity ProtocolIEID = 167 + IDHOCause ProtocolIEID = 168 + IDLastVisitedPSCellList ProtocolIEID = 329 + IDMobilityInformation ProtocolIEID = 175 + IDUEHistoryInformationFromTheUE ProtocolIEID = 194 + IDIMSvoiceEPSfallbackfrom5G ProtocolIEID = 296 + IDAdditionalRRMPriorityIndex ProtocolIEID = 299 + IDContextatSource ProtocolIEID = 300 + IDIntersystemMeasurementConfiguration ProtocolIEID = 311 + IDSourceNodeID ProtocolIEID = 312 + IDEmergencyIndicator ProtocolIEID = 326 + IDUEContextReferenceatSourceeNB ProtocolIEID = 337 + IDSourceSNID ProtocolIEID = 343 + IDTimeBasedHandoverInformation ProtocolIEID = 350 + IDRATType ProtocolIEID = 232 + IDMDTConfigurationNR ProtocolIEID = 316 + IDTraceCollectionEntityURI ProtocolIEID = 325 + IDCoarseUELocationRequested ProtocolIEID = 353 + IDCoarseUELocation ProtocolIEID = 354 + IDTimeRefDistribution ProtocolIEID = 355 + IDRequestedTNLInfo ProtocolIEID = 356 + IDMDTConfiguration ProtocolIEID = 162 + IDUEAppLayerMeasConfig ProtocolIEID = 262 + IDX2TNLConfigurationInfo ProtocolIEID = 152 + IDSynchronisationInformation ProtocolIEID = 209 + IDSONInformationReport ProtocolIEID = 206 + IDNBIoTRLFReportContainer ProtocolIEID = 313 + IDTimeSynchronisationInfo ProtocolIEID = 149 + IDMutingPatternInformation ProtocolIEID = 208 + IDENBX2ExtendedTransportLayerAddresses ProtocolIEID = 153 + IDENBIndirectX2TransportLayerAddresses ProtocolIEID = 193 + IDMutingAvailabilityIndication ProtocolIEID = 207 + IDTunnelInformationForBBF ProtocolIEID = 176 + IDGWTransportLayerAddress ProtocolIEID = 155 + IDSIPTOLGWTransportLayerAddress ProtocolIEID = 184 ) diff --git a/s1ap/ie_names.go b/s1ap/ie_names.go index 5ef985b6f9..1a041e88aa 100644 --- a/s1ap/ie_names.go +++ b/s1ap/ie_names.go @@ -146,11 +146,61 @@ var protocolIENames = map[ProtocolIEID]string{ IDExtendedERABMaximumBitrateUL: "extended-e-RAB-MaximumBitrateUL", IDExtendedERABGuaranteedBitrateDL: "extended-e-RAB-GuaranteedBitrateDL", IDExtendedERABGuaranteedBitrateUL: "extended-e-RAB-GuaranteedBitrateUL", + IDExtendedUEAggregateMaximumBitRateDL: "extended-uEaggregateMaximumBitRateDL", + IDExtendedUEAggregateMaximumBitRateUL: "extended-uEaggregateMaximumBitRateUL", IDDownlinkPacketLossRate: "DownlinkPacketLossRate", IDUplinkPacketLossRate: "UplinkPacketLossRate", IDWarningAreaCoordinates: "WarningAreaCoordinates", IDEthernetType: "Ethernet-Type", IDSecurityIndication: "SecurityIndication", + IDGUMMEIType: "GUMMEIType", + IDNRrestrictioninEPSasSecondaryRAT: "NRrestrictioninEPSasSecondaryRAT", + IDUnlicensedSpectrumRestriction: "UnlicensedSpectrumRestriction", + IDCNTypeRestrictions: "CNTypeRestrictions", + IDNRrestrictionin5GS: "NRrestrictionin5GS", + IDLastNGRANPLMNIdentity: "LastNG-RANPLMNIdentity", + IDRATRestrictions: "RAT-Restrictions", + IDPSCellInformation: "PSCellInformation", + IDLTENTNTAIInformation: "LTE-NTN-TAI-Information", + IDRequestTypeAdditionalInfo: "RequestTypeAdditionalInfo", + IDDAPSRequestInfo: "DAPSRequestInfo", + IDSourceTransportLayerAddress: "SourceTransportLayerAddress", + IDSourceNodeTransportLayerAddress: "SourceNodeTransportLayerAddress", + IDTimeUEStayedInCellEnhancedGranularity: "Time-UE-StayedInCell-EnhancedGranularity", + IDHOCause: "HO-Cause", + IDLastVisitedPSCellList: "lastVisitedPSCellList", + IDMobilityInformation: "MobilityInformation", + IDUEHistoryInformationFromTheUE: "uE-HistoryInformationFromTheUE", + IDIMSvoiceEPSfallbackfrom5G: "IMSvoiceEPSfallbackfrom5G", + IDAdditionalRRMPriorityIndex: "AdditionalRRMPriorityIndex", + IDContextatSource: "ContextatSource", + IDIntersystemMeasurementConfiguration: "IntersystemMeasurementConfiguration", + IDSourceNodeID: "SourceNodeID", + IDEmergencyIndicator: "EmergencyIndicator", + IDUEContextReferenceatSourceeNB: "UEContextReferenceatSourceeNB", + IDSourceSNID: "SourceSNID", + IDTimeBasedHandoverInformation: "TimeBasedHandoverInformation", + IDRATType: "RAT-Type", + IDMDTConfigurationNR: "MDTConfigurationNR", + IDTraceCollectionEntityURI: "TraceCollectionEntityURI", + IDCoarseUELocationRequested: "CoarseUELocationRequested", + IDCoarseUELocation: "CoarseUELocation", + IDTimeRefDistribution: "TimeRefDistribution", + IDRequestedTNLInfo: "RequestedTNLInfo", + IDMDTConfiguration: "MDTConfiguration", + IDUEAppLayerMeasConfig: "UEAppLayerMeasConfig", + IDX2TNLConfigurationInfo: "x2TNLConfigurationInfo", + IDSynchronisationInformation: "Synchronisation-Information", + IDSONInformationReport: "SON-Information-Report", + IDNBIoTRLFReportContainer: "NB-IoT-RLF-Report-Container", + IDTimeSynchronisationInfo: "Time-Synchronisation-Info", + IDMutingPatternInformation: "Muting-Pattern-Information", + IDENBX2ExtendedTransportLayerAddresses: "eNBX2ExtendedTransportLayerAddresses", + IDENBIndirectX2TransportLayerAddresses: "eNBIndirectX2TransportLayerAddresses", + IDMutingAvailabilityIndication: "Muting-Availability-Indication", + IDTunnelInformationForBBF: "Tunnel-Information-for-BBF", + IDGWTransportLayerAddress: "GW-TransportLayerAddress", + IDSIPTOLGWTransportLayerAddress: "SIPTO-L-GW-TransportLayerAddress", } // ProtocolIEIDName returns the TS 36.413 name of id, and whether it is known. diff --git a/s1ap/ie_pws.go b/s1ap/ie_pws.go index 54e4723d7b..eac6c1b88b 100644 --- a/s1ap/ie_pws.go +++ b/s1ap/ie_pws.go @@ -4,8 +4,6 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -203,252 +201,206 @@ func (k *KillAllWarningMessages) UnmarshalPER(r *per.Reader, enc per.Encoding) e } type CellIDBroadcastItem struct { - _ [0]struct{} `per:"extseq"` - ECGI EUTRANCGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ECGI EUTRANCGI + iEExtensions extensionMeta `per:",exttable"` } type CompletedCellInTAIItem struct { - _ [0]struct{} `per:"extseq"` - ECGI EUTRANCGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ECGI EUTRANCGI + iEExtensions extensionMeta `per:",exttable"` } type TAIBroadcastItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` TAI TAI CompletedCellInTAI []CompletedCellInTAIItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CompletedCellInEAIItem struct { - _ [0]struct{} `per:"extseq"` - ECGI EUTRANCGI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + ECGI EUTRANCGI + iEExtensions extensionMeta `per:",exttable"` } type EmergencyAreaIDBroadcastItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EmergencyAreaID EmergencyAreaID CompletedCellInEAI []CompletedCellInEAIItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CellIDCancelledItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` ECGI EUTRANCGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type CancelledCellInTAIItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` ECGI EUTRANCGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type TAICancelledItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` TAI TAI CancelledCellInTAI []CancelledCellInTAIItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } type CancelledCellInEAIItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` ECGI EUTRANCGI - NumberOfBroadcasts uint16 `per:",range:0..65535"` - _ ieExtensions `per:",skip"` + NumberOfBroadcasts uint16 `per:",range:0..65535"` + iEExtensions extensionMeta `per:",exttable"` } type EmergencyAreaIDCancelledItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` EmergencyAreaID EmergencyAreaID CancelledCellInEAI []CancelledCellInEAIItem `per:"SEQUENCE-OF,size:1..65535"` - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } -func encodeExtensibleChoice(w *per.Writer, enc per.Encoding, nRoot, idx int64) error { - w.WriteBit(false) +type WarningAreaList struct { + CellIDList *ECGIList `per:",choice:0"` + TrackingAreaListforWarning *TAIListforWarning `per:",choice:1"` + EmergencyAreaIDList *EmergencyAreaIDList `per:",choice:2"` + Ext *per.ExtensionAlternative `per:",extalt"` +} - return per.EncodeConstrainedWholeNumber(w, enc, 0, nRoot-1, idx) +type BroadcastCompletedAreaList struct { + CellIDBroadcast *CellIDBroadcast `per:",choice:0"` + TAIBroadcast *TAIBroadcast `per:",choice:1"` + EmergencyAreaIDBroadcast *EmergencyAreaIDBroadcast `per:",choice:2"` + Ext *per.ExtensionAlternative `per:",extalt"` } -func decodeExtensibleChoice(r *per.Reader, enc per.Encoding, nRoot int64, name string) (int64, error) { - isExt, err := r.ReadBit() - if err != nil { - return 0, fmt.Errorf("s1ap: %s choice: %w", name, err) - } +type BroadcastCancelledAreaList struct { + CellIDCancelled *CellIDCancelled `per:",choice:0"` + TAICancelled *TAICancelled `per:",choice:1"` + EmergencyAreaIDCancelled *EmergencyAreaIDCancelled `per:",choice:2"` + Ext *per.ExtensionAlternative `per:",extalt"` +} - if isExt { - return 0, fmt.Errorf("%w: %s extension alternative", errNotComprehended, name) - } +type ECGIList []EUTRANCGI - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, nRoot-1) - if err != nil { - return 0, fmt.Errorf("s1ap: %s choice: %w", name, err) - } +func (l ECGIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellID, []EUTRANCGI(l)) +} + +func (l *ECGIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EUTRANCGI](r, enc, 1, maxnoofCellID) + *l = items - return idx, nil + return err } -func choiceAlternative(name string, set ...bool) (int64, error) { - idx := int64(-1) +type TAIListforWarning []TAI - for i, s := range set { - if !s { - continue - } +func (l TAIListforWarning) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAI(l)) +} - if idx >= 0 { - return 0, fmt.Errorf("s1ap: %s has more than one alternative set", name) - } +func (l *TAIListforWarning) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforWarning) + *l = items - idx = int64(i) - } + return err +} - if idx < 0 { - return 0, fmt.Errorf("s1ap: %s has no alternative set", name) - } +type EmergencyAreaIDList []EmergencyAreaID - return idx, nil +func (l EmergencyAreaIDList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaID(l)) } -type WarningAreaList struct { - CellIDList []EUTRANCGI - TAIList []TAI - EmergencyAreaIDList []EmergencyAreaID +func (l *EmergencyAreaIDList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofEmergencyAreaID) + *l = items + + return err } -func (l WarningAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := choiceAlternative("WarningAreaList", len(l.CellIDList) > 0, len(l.TAIList) > 0, len(l.EmergencyAreaIDList) > 0) - if err != nil { - return err - } +type CellIDBroadcast []CellIDBroadcastItem - if err := encodeExtensibleChoice(w, enc, 3, idx); err != nil { - return err - } +func (l CellIDBroadcast) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellID, []CellIDBroadcastItem(l)) +} - switch idx { - case 0: - return marshalSeqOf(w, enc, 1, maxnoofCellID, l.CellIDList) - case 1: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIList) - default: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDList) - } +func (l *CellIDBroadcast) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CellIDBroadcastItem](r, enc, 1, maxnoofCellID) + *l = items + + return err } -func (l *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeExtensibleChoice(r, enc, 3, "WarningAreaList") - if err != nil { - return err - } +type TAIBroadcast []TAIBroadcastItem - *l = WarningAreaList{} +func (l TAIBroadcast) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAIBroadcastItem(l)) +} - switch idx { - case 0: - l.CellIDList, err = unmarshalSeqOf[EUTRANCGI](r, enc, 1, maxnoofCellID) - case 1: - l.TAIList, err = unmarshalSeqOf[TAI](r, enc, 1, maxnoofTAIforWarning) - default: - l.EmergencyAreaIDList, err = unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofEmergencyAreaID) - } +func (l *TAIBroadcast) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAIBroadcastItem](r, enc, 1, maxnoofTAIforWarning) + *l = items return err } -type BroadcastCompletedAreaList struct { - CellIDBroadcast []CellIDBroadcastItem - TAIBroadcast []TAIBroadcastItem - EmergencyAreaIDBroadcast []EmergencyAreaIDBroadcastItem +type EmergencyAreaIDBroadcast []EmergencyAreaIDBroadcastItem + +func (l EmergencyAreaIDBroadcast) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaIDBroadcastItem(l)) } -func (l BroadcastCompletedAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := choiceAlternative("BroadcastCompletedAreaList", len(l.CellIDBroadcast) > 0, len(l.TAIBroadcast) > 0, len(l.EmergencyAreaIDBroadcast) > 0) - if err != nil { - return err - } +func (l *EmergencyAreaIDBroadcast) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaIDBroadcastItem](r, enc, 1, maxnoofEmergencyAreaID) + *l = items - if err := encodeExtensibleChoice(w, enc, 3, idx); err != nil { - return err - } - - switch idx { - case 0: - return marshalSeqOf(w, enc, 1, maxnoofCellID, l.CellIDBroadcast) - case 1: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAIBroadcast) - default: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDBroadcast) - } + return err } -func (l *BroadcastCompletedAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeExtensibleChoice(r, enc, 3, "BroadcastCompletedAreaList") - if err != nil { - return err - } +type CellIDCancelled []CellIDCancelledItem - *l = BroadcastCompletedAreaList{} +func (l CellIDCancelled) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCellID, []CellIDCancelledItem(l)) +} - switch idx { - case 0: - l.CellIDBroadcast, err = unmarshalSeqOf[CellIDBroadcastItem](r, enc, 1, maxnoofCellID) - case 1: - l.TAIBroadcast, err = unmarshalSeqOf[TAIBroadcastItem](r, enc, 1, maxnoofTAIforWarning) - default: - l.EmergencyAreaIDBroadcast, err = unmarshalSeqOf[EmergencyAreaIDBroadcastItem](r, enc, 1, maxnoofEmergencyAreaID) - } +func (l *CellIDCancelled) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CellIDCancelledItem](r, enc, 1, maxnoofCellID) + *l = items return err } -type BroadcastCancelledAreaList struct { - CellIDCancelled []CellIDCancelledItem - TAICancelled []TAICancelledItem - EmergencyAreaIDCancelled []EmergencyAreaIDCancelledItem -} +type TAICancelled []TAICancelledItem -func (l BroadcastCancelledAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := choiceAlternative("BroadcastCancelledAreaList", len(l.CellIDCancelled) > 0, len(l.TAICancelled) > 0, len(l.EmergencyAreaIDCancelled) > 0) - if err != nil { - return err - } +func (l TAICancelled) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, []TAICancelledItem(l)) +} - if err := encodeExtensibleChoice(w, enc, 3, idx); err != nil { - return err - } +func (l *TAICancelled) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAICancelledItem](r, enc, 1, maxnoofTAIforWarning) + *l = items - switch idx { - case 0: - return marshalSeqOf(w, enc, 1, maxnoofCellID, l.CellIDCancelled) - case 1: - return marshalSeqOf(w, enc, 1, maxnoofTAIforWarning, l.TAICancelled) - default: - return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, l.EmergencyAreaIDCancelled) - } + return err } -func (l *BroadcastCancelledAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeExtensibleChoice(r, enc, 3, "BroadcastCancelledAreaList") - if err != nil { - return err - } +type EmergencyAreaIDCancelled []EmergencyAreaIDCancelledItem - *l = BroadcastCancelledAreaList{} +func (l EmergencyAreaIDCancelled) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEmergencyAreaID, []EmergencyAreaIDCancelledItem(l)) +} - switch idx { - case 0: - l.CellIDCancelled, err = unmarshalSeqOf[CellIDCancelledItem](r, enc, 1, maxnoofCellID) - case 1: - l.TAICancelled, err = unmarshalSeqOf[TAICancelledItem](r, enc, 1, maxnoofTAIforWarning) - default: - l.EmergencyAreaIDCancelled, err = unmarshalSeqOf[EmergencyAreaIDCancelledItem](r, enc, 1, maxnoofEmergencyAreaID) - } +func (l *EmergencyAreaIDCancelled) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[EmergencyAreaIDCancelledItem](r, enc, 1, maxnoofEmergencyAreaID) + *l = items return err } diff --git a/s1ap/ie_ran_node.go b/s1ap/ie_ran_node.go index 23cf668c16..8152d796d4 100644 --- a/s1ap/ie_ran_node.go +++ b/s1ap/ie_ran_node.go @@ -5,39 +5,84 @@ package s1ap import ( "fmt" + + "github.com/ellanetworks/core/per" ) -// ENBIDKind selects an ENB-ID CHOICE alternative (TS 36.413). -type ENBIDKind uint8 +// ENB-ID ::= CHOICE { macroENB-ID, homeENB-ID, ..., short-macroENB-ID, +// long-macroENB-ID }: two root alternatives, two extension alternatives. +type ENBID struct { + MacroENBID *MacroENBID `per:",choice:0"` + HomeENBID *HomeENBID `per:",choice:1"` + ShortMacroENBID *ShortMacroENBID `per:",choice:0,ext"` + LongMacroENBID *LongMacroENBID `per:",choice:1,ext"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +type MacroENBID uint32 + +type HomeENBID uint32 + +type ShortMacroENBID uint32 + +type LongMacroENBID uint32 const ( - ENBIDMacro ENBIDKind = iota // root 0: BIT STRING (SIZE(20)) - ENBIDHome // root 1: BIT STRING (SIZE(28)) - ENBIDShortMacro // extension: BIT STRING (SIZE(18)) - ENBIDLongMacro // extension: BIT STRING (SIZE(21)) + macroENBIDBits = 20 + homeENBIDBits = 28 + shortMacroENBIDBits = 18 + longMacroENBIDBits = 21 ) -var enbIDBits = map[ENBIDKind]int{ - ENBIDMacro: 20, - ENBIDHome: 28, - ENBIDShortMacro: 18, - ENBIDLongMacro: 21, +func (e ENBID) idBits() (value uint32, nbits int, ok bool) { + switch { + case e.MacroENBID != nil: + return uint32(*e.MacroENBID), macroENBIDBits, true + case e.HomeENBID != nil: + return uint32(*e.HomeENBID), homeENBIDBits, true + case e.ShortMacroENBID != nil: + return uint32(*e.ShortMacroENBID), shortMacroENBIDBits, true + case e.LongMacroENBID != nil: + return uint32(*e.LongMacroENBID), longMacroENBIDBits, true + default: + return 0, 0, false + } } -// ENB-ID ::= CHOICE { macroENB-ID, homeENB-ID, ..., short-macroENB-ID, -// long-macroENB-ID }: two root alternatives, two extension alternatives. -type ENBID struct { - Kind ENBIDKind - Value uint32 +func (e ENBID) Value() (uint32, bool) { + v, _, ok := e.idBits() + + return v, ok +} + +func (e ENBID) Bits() int { + _, n, _ := e.idBits() + + return n +} + +func (e ENBID) AlternativeName() string { + switch { + case e.MacroENBID != nil: + return "macroENB-ID" + case e.HomeENBID != nil: + return "homeENB-ID" + case e.ShortMacroENBID != nil: + return "short-macroENB-ID" + case e.LongMacroENBID != nil: + return "long-macroENB-ID" + default: + return "" + } } // GlobalENBID ::= SEQUENCE { pLMNidentity, eNB-ID, iE-Extensions OPTIONAL } // (extensible). type GlobalENBID struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity ENBID ENBID - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // The library owns every conversion between a wire field and the sub-fields @@ -50,9 +95,9 @@ type GlobalENBID struct { // E-UTRAN CGI IE of the cell served by the eNB" — so it leaves a zero-width // cell part and only cell 0 exists. func (e ENBID) CellIdentity(cellID uint32) (uint32, error) { - nodeBits, ok := enbIDBits[e.Kind] + value, nodeBits, ok := e.idBits() if !ok { - return 0, fmt.Errorf("s1ap: invalid ENB-ID kind %d", e.Kind) + return 0, fmt.Errorf("s1ap: ENB-ID carries no known alternative") } if nodeBits > cellIDBits { @@ -64,22 +109,22 @@ func (e ENBID) CellIdentity(cellID uint32) (uint32, error) { return 0, fmt.Errorf("s1ap: cell id %d exceeds the %d bits left by a %d-bit eNB id", cellID, cellBits, nodeBits) } - if uint64(e.Value) >= 1<= 1< cellIDBits { return 0, false } cellBits := cellIDBits - nodeBits - if eci>>uint(cellBits) != e.Value { + if eci>>uint(cellBits) != value { return 0, false } @@ -90,9 +135,15 @@ func (e ENBID) SplitCellIdentity(eci uint32) (cellID uint32, ok bool) { // name its target. It is the only reason these types appear in an S1AP // specification at all. -// GNB-Identity ::= CHOICE { gNB-ID BIT STRING (SIZE(22..32)), ... } -// (TS 36.413). Unlike ENB-ID this is one alternative over a range of widths, so -// the width travels with the value rather than being implied by the alternative. +// GNB-Identity ::= CHOICE { gNB-ID GNB-ID, ... } (TS 36.413). +type GNBIdentity struct { + GNBID *GNBID `per:",choice:0"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +// GNB-ID ::= BIT STRING (SIZE(22..32)). Unlike ENB-ID this is one alternative +// over a range of widths, so the width travels with the value rather than being +// implied by the alternative. type GNBID struct { Value uint32 Bits int @@ -107,35 +158,36 @@ const ( // Global-GNB-ID ::= SEQUENCE { pLMN-Identity, gNB-ID GNB-Identity, // iE-Extensions OPTIONAL } (extensible) (TS 36.413). type GlobalGNBID struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity - GNBID GNBID - _ ieExtensions `per:",skip"` + GNBID GNBIdentity + iEExtensions extensionMeta `per:",exttable"` } // GNB ::= SEQUENCE { global-gNB-ID, iE-Extensions OPTIONAL } (extensible) // (TS 36.413). type GNB struct { - _ [0]struct{} `per:"extseq"` - GlobalGNBID GlobalGNBID - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + GlobalGNBID GlobalGNBID + iEExtensions extensionMeta `per:",exttable"` } // NG-eNB ::= SEQUENCE { global-ng-eNB-ID Global-ENB-ID, iE-Extensions OPTIONAL } // (extensible) (TS 36.413). An ng-eNB is identified by the same Global-ENB-ID an // eNB is, so this alternative reuses S1AP's own type rather than a 5GS one. type NgENB struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` GlobalNgENBID GlobalENBID - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // Global-RAN-NODE-ID ::= CHOICE { gNB, ng-eNB, ... } (TS 36.413). Exactly one // alternative is set; which one is derived from the pointers rather than stored, // so the two can never disagree. type GlobalRANNodeID struct { - GNB *GNB - NgENB *NgENB + GNB *GNB `per:",choice:0"` + NgENB *NgENB `per:",choice:1"` + Ext *per.ExtensionAlternative `per:",extalt"` } // FiveGSTAC ::= OCTET STRING (SIZE(3)) (TS 36.413), held as the 24-bit number @@ -150,30 +202,30 @@ const fiveGSTACMax = 1<<24 - 1 // (extensible) (TS 36.413). The 5GS counterpart of TAI, which S1AP needs only to // name the tracking area an EPS to 5GS handover targets. type FiveGSTAI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity TAC FiveGSTAC - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } func (e ENBID) Hex() string { - bits, ok := enbIDBits[e.Kind] + value, bits, ok := e.idBits() if !ok { return "" } - return fmt.Sprintf("%0*x", (bits+3)/4, e.Value) + return fmt.Sprintf("%0*x", (bits+3)/4, value) } -func (k ENBIDKind) Prefix() string { - switch k { - case ENBIDMacro: +func (e ENBID) Prefix() string { + switch { + case e.MacroENBID != nil: return "MacroeNB-" - case ENBIDHome: + case e.HomeENBID != nil: return "HomeeNB-" - case ENBIDShortMacro: + case e.ShortMacroENBID != nil: return "SMacroeNB-" - case ENBIDLongMacro: + case e.LongMacroENBID != nil: return "LMacroeNB-" } @@ -186,5 +238,5 @@ func (e ENBID) String() string { return "" } - return e.Kind.Prefix() + hex + return e.Prefix() + hex } diff --git a/s1ap/ie_ran_node_test.go b/s1ap/ie_ran_node_test.go index fda557f1bf..b5185ef505 100644 --- a/s1ap/ie_ran_node_test.go +++ b/s1ap/ie_ran_node_test.go @@ -4,51 +4,49 @@ package s1ap import ( - "errors" + "bytes" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestENBIDAllKinds(t *testing.T) { cases := []ENBID{ - {Kind: ENBIDMacro, Value: 0xabcde & 0xfffff}, // 20 bits - {Kind: ENBIDHome, Value: 0x54f6401}, // 28 bits - {Kind: ENBIDShortMacro, Value: 0x3abcd & 0x3ffff}, // 18 bits, extension - {Kind: ENBIDLongMacro, Value: 0x1abcde & 0x1fffff}, // 21 bits, extension + {MacroENBID: Ptr(MacroENBID(0xabcde & 0xfffff))}, + {HomeENBID: Ptr(HomeENBID(0x54f6401))}, + {ShortMacroENBID: Ptr(ShortMacroENBID(0x3abcd & 0x3ffff))}, + {LongMacroENBID: Ptr(LongMacroENBID(0x1abcde & 0x1fffff))}, } for _, in := range cases { w := per.NewWriter() if err := in.MarshalPER(w, per.Aligned); err != nil { - t.Fatalf("%+v: encode: %v", in, err) + t.Fatalf("%v: encode: %v", in, err) } got, err := unmarshalPERValue[ENBID](perBytes(w)) if err != nil { - t.Fatalf("%+v: decode: %v", in, err) + t.Fatalf("%v: decode: %v", in, err) } - if got != in { - t.Fatalf("decoded %+v, want %+v", got, in) + if !got.Equal(in) { + t.Fatalf("decoded %v, want %v", got, in) } } } // ENB-ID ::= CHOICE { macroENB-ID, homeENB-ID, ..., short-macroENB-ID, -// long-macroENB-ID } defines exactly two extension additions. A later one has -// no width the decoder can know, so it is reported as not comprehended and -// handled on the IE's criticality (TS 36.413 §10.3.1) instead of being read as -// a short-macroENB-ID. -func TestENBIDRejectsUndefinedExtensionAlternative(t *testing.T) { +// long-macroENB-ID } defines exactly two extension additions. A later one is +// kept verbatim and reported as not comprehended (TS 36.413 §10.3.1). +func TestENBIDKeepsUndefinedExtensionAlternative(t *testing.T) { tests := []struct { name string in []byte - kind ENBIDKind - want uint32 + want ENBID }{ - {"short-macroENB-ID", []byte{0x80, 0x03, 0xde, 0xad, 0xbe}, ENBIDShortMacro, 0x37ab6}, - {"long-macroENB-ID", []byte{0x81, 0x03, 0xde, 0xad, 0xbe}, ENBIDLongMacro, 0x1bd5b7}, + {"short-macroENB-ID", []byte{0x80, 0x03, 0xde, 0xad, 0xbe}, ENBID{ShortMacroENBID: Ptr(ShortMacroENBID(0x37ab6))}}, + {"long-macroENB-ID", []byte{0x81, 0x03, 0xde, 0xad, 0xbe}, ENBID{LongMacroENBID: Ptr(LongMacroENBID(0x1bd5b7))}}, } for _, tt := range tests { @@ -58,18 +56,30 @@ func TestENBIDRejectsUndefinedExtensionAlternative(t *testing.T) { t.Fatalf("decode: %v", err) } - if e.Kind != tt.kind || e.Value != tt.want { - t.Fatalf("got kind %d value %#x, want kind %d value %#x", e.Kind, e.Value, tt.kind, tt.want) + if !e.Equal(tt.want) { + t.Fatalf("got %v, want %v", e, tt.want) } }) } t.Run("undefined extension alternative", func(t *testing.T) { + in := []byte{0x82, 0x03, 0xde, 0xad, 0xbe} + var e ENBID + if err := (&e).UnmarshalPER(per.NewReader(in), per.Aligned); err != nil { + t.Fatalf("decode: %v", err) + } + + if e.Ext == nil || e.Ext.Index != 2 || e.Ext.Value != "\xde\xad\xbe" { + t.Fatalf("Ext = %+v", e.Ext) + } + + if !e.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Fatal("an undefined ENB-ID alternative must not be comprehended") + } - err := (&e).UnmarshalPER(per.NewReader([]byte{0x82, 0x03, 0xde, 0xad, 0xbe}), per.Aligned) - if !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want errNotComprehended", err) + if out := ieRaw(t, &e); !bytes.Equal(out, in) { + t.Fatalf("re-encoded % x, want % x", out, in) } }) } diff --git a/s1ap/ie_setup.go b/s1ap/ie_setup.go index 45156afc90..3232589f37 100644 --- a/s1ap/ie_setup.go +++ b/s1ap/ie_setup.go @@ -3,6 +3,8 @@ package s1ap +import "github.com/ellanetworks/core/per" + // TAC ::= OCTET STRING (SIZE(2)). type TAC uint16 @@ -12,10 +14,11 @@ type BPLMNs []PLMNIdentity // SupportedTAItem ::= SEQUENCE { tAC, broadcastPLMNs, iE-Extensions OPTIONAL } // (extensible). type SupportedTAItem struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` TAC TAC BroadcastPLMNs BPLMNs - _ ieExtensions `per:",skip"` + RATType *RATType `per:",extie:IDRATType,crit:reject"` + iEExtensions extensionMeta `per:",exttable"` } // SupportedTAs ::= SEQUENCE (SIZE(1..maxnoofTACs)) OF SupportedTAs-Item. @@ -28,8 +31,6 @@ type UERetentionInformation uint8 const ( UERetentionUesRetained UERetentionInformation = iota - - ueRetentionInformationRootCount = 1 ) // PagingDRX ::= ENUMERATED { v32, v64, v128, v256, ... } (extensible). @@ -40,8 +41,6 @@ const ( PagingDRXv64 PagingDRXv128 PagingDRXv256 - - pagingDRXRootCount = 4 ) // maxnoof constants for S1 Setup IEs (TS 36.413, S1AP-Constants). diff --git a/s1ap/ie_stmsi.go b/s1ap/ie_stmsi.go index 416d65f893..23609e8ffe 100644 --- a/s1ap/ie_stmsi.go +++ b/s1ap/ie_stmsi.go @@ -3,6 +3,8 @@ package s1ap +import "github.com/ellanetworks/core/per" + // MTMSI ::= OCTET STRING (SIZE(4)). type MTMSI uint32 @@ -13,8 +15,8 @@ type MTMSI uint32 // m-TMSI OCTET STRING (SIZE(4)), // iE-Extensions ... OPTIONAL } type STMSI struct { - _ [0]struct{} `per:"extseq"` - MMEC MMECode - MTMSI MTMSI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + MMEC MMECode + MTMSI MTMSI + iEExtensions extensionMeta `per:",exttable"` } diff --git a/s1ap/ie_table.go b/s1ap/ie_table.go index 621e1e6365..0baa5d33b5 100644 --- a/s1ap/ie_table.go +++ b/s1ap/ie_table.go @@ -8,382 +8,191 @@ import ( "fmt" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) -// A peer chooses how many IEs to send, and both survive the decode that found -// them. -const ( - maxDiagnosticIEs = 64 - maxPreservedIEs = 32 -) - -// 16-bit id + 2-bit criticality + an open type of at least one length and one -// content octet. -const minIEFieldBits = 34 - // One row of a message's TS 36.413 §9.1 IE table. -type ieSpec[M any] struct { - id ProtocolIEID - presence presence - crit Criticality +type ieSpec[M any] = ap.IESpec[ProtocolIEID, M] - // Set if and only if presence is presenceConditional. - condition func(m *M) bool +const ( + presenceOptional = ap.PresenceOptional + presenceConditional = ap.PresenceConditional + presenceMandatory = ap.PresenceMandatory +) - decode func(m *M, raw []byte, enc per.Encoding) error - // encode reports false when the row's field is unset. - encode func(m *M) (per.Marshaler, bool) +type messageMeta struct { + ap.Message[ProtocolIEID] } -// TS 36.413 §9.1.2.1 Presence. -func (s ieSpec[M]) required(m *M) bool { - switch s.presence { - case presenceMandatory: - return true - case presenceConditional: - return s.condition != nil && s.condition(m) - case presenceOptional: - return false - default: - return false - } -} +type extensionMeta = ap.Preserved[ProtocolIEID] -// §10.3.5: only reject criticality stops an absent IE from being delivered, -// which is what lets a required reject IE be a value type. -func (s ieSpec[M]) deliverable() bool { return s.crit != CriticalityReject } +type SingleContainer = ap.SingleContainer[ProtocolIEID] func (u *messageMeta) meta() *messageMeta { return u } +func (u messageMeta) Diagnostics() Diagnostics { return Diagnostics{u.Message.Diagnostics()} } + type message interface { meta() *messageMeta } -// An unset required IE is an error: TS 36.413 §9.1.2.1 obliges the sender even -// where §10.3.5 lets a receiver carry on without it. func encodeMessageBody[M any, PM interface { *M message }](w *per.Writer, enc per.Encoding, procedure ProcedureCode, table []ieSpec[M], m PM, ) error { - if m.meta().dropped { - return fmt.Errorf("s1ap: %s: unknown IEs were dropped on decode", procedure) - } - - w.WriteBit(m.meta().extensions.Present()) - - typed := make([]*ieField, len(table)) - - for i, spec := range table { - val, ok := spec.encode((*M)(m)) - required := spec.required((*M)(m)) - - if !ok { - if required { - return fmt.Errorf("s1ap: %s: required IE %s is not set", procedure, spec.id) - } - - continue - } - - // §9.1.2.1: a conditional IE is carried only while its condition holds. - if spec.presence == presenceConditional && !required { - return fmt.Errorf("s1ap: %s: conditional IE %s is set but its condition does not hold", procedure, spec.id) - } - - typed[i] = &ieField{id: spec.id, crit: spec.crit, val: val} + if err := ap.EncodeMessage(profile, w, enc, table, (*M)(m), &m.meta().Message); err != nil { + return fmt.Errorf("s1ap: %s: %w", procedure, err) } - if err := encodeIEContainer(w, enc, orderFields(table, typed, m.meta())); err != nil { - return err - } - - return m.meta().extensions.MarshalPER(w, enc) + return nil } -func orderFields[M any](table []ieSpec[M], typed []*ieField, meta *messageMeta) []ieField { - fields := make([]ieField, 0, len(table)+len(meta.unknownIEs)) - - if meta.wire == nil { - for _, f := range typed { - if f != nil { - fields = append(fields, *f) - } - } - - for _, e := range meta.unknownIEs { - fields = append(fields, e.field()) - } - - return fields - } - - onWire := make([]bool, len(table)) - - for _, s := range meta.wire { - if idx, _, ok := lookupIESpec(table, s.id); ok && s.unknown < 0 { - onWire[idx] = true - } - } - - next := 0 - - flush := func(upto int) { - for ; next < upto; next++ { - if typed[next] != nil && !onWire[next] { - fields = append(fields, *typed[next]) - } - } - } - - for _, s := range meta.wire { - if s.unknown >= 0 { - fields = append(fields, meta.unknownIEs[s.unknown].field()) - - continue - } - - idx, _, ok := lookupIESpec(table, s.id) - if !ok { - continue - } - - flush(idx) - - if f := typed[idx]; f != nil { - fields = append(fields, ieField{id: f.id, crit: s.crit, val: f.val}) - } +func decodeMessageBody[M any, PM interface { + *M + message +}](procedure ProcedureCode, table []ieSpec[M], value []byte, +) (PM, error) { + m := PM(new(M)) - next = idx + 1 + if err := ap.DecodeMessage(profile, table, value, (*M)(m), &m.meta().Message); err != nil { + return nil, &TransferSyntaxError{Protocol: profile.Name, Procedure: procedure, Err: err} } - flush(len(table)) - - return fields + return m, nil } -// Applies the abstract syntax error handling of TS 36.413 §10.3.4.2, §10.3.5 and -// §10.3.6. Returns no message when the procedure must be rejected. func parseMessageBody[M any, PM interface { *M message }](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, ) (PM, error) { - return parseBoundedMessageBody[M, PM](procedure, trigger, table, value, maxPreservedIEs) -} - -func parseBoundedMessageBody[M any, PM interface { - *M - message -}](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, limit int, -) (PM, error) { - r := per.NewReader(value) - enc := per.Aligned - - extPresent, err := r.ReadBit() + m, err := decodeMessageBody[M, PM](procedure, table, value) if err != nil { - return nil, &TransferSyntaxError{Procedure: procedure, Err: fmt.Errorf("preamble: %w", err)} + return nil, err } - fields, err := decodeIEContainer(r, enc) - if err != nil { - return nil, &TransferSyntaxError{Procedure: procedure, Err: err} + if err := m.meta().Message.Diagnostics().Check(); err != nil { + return nil, newAbstractSyntaxError(procedure, trigger, err, table, value) } - var additions per.ExtensionAdditions + return m, nil +} - if extPresent { - if err := additions.UnmarshalPER(r, enc); err != nil { - return nil, &TransferSyntaxError{Procedure: procedure, Err: err} - } +func newAbstractSyntaxError[M any](procedure ProcedureCode, trigger TriggeringMessage, err error, table []ieSpec[M], value []byte) error { + var e *ap.AbstractSyntaxError[ProtocolIEID] + if !errors.As(err, &e) { + return err } - reject := func(cause int, ies []CriticalityDiagnosticsIEItem) error { - return &AbstractSyntaxError{ - Procedure: procedure, - Trigger: trigger, - Cause: Cause{Group: CauseGroupProtocol, Value: cause}, - IEs: ies, - decoded: modeledIEs(table, fields), - } + cause := CauseProtocolAbstractSyntaxErrorReject + if e.FalselyConstructed { + cause = CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage } - m := PM(new(M)) - meta := m.meta() - meta.extensions = additions - seen := make(map[ProtocolIEID]bool, len(table)) - lastIdx := -1 - - // Collected for one report naming them all (§10.3.4.2), truncated at the - // maxnoofErrors the list is bounded by so the report stays encodable. - var notUnderstood []CriticalityDiagnosticsIEItem - - reportNotUnderstood := func(id ProtocolIEID, crit Criticality) { - if len(notUnderstood) >= maxnoofErrors { - return - } - - notUnderstood = append(notUnderstood, CriticalityDiagnosticsIEItem{ - IECriticality: crit, - IEID: id, - TypeOfError: TypeOfErrorNotUnderstood, - }) + return &AbstractSyntaxError{ + Procedure: procedure, + Trigger: trigger, + Cause: cause.Cause(), + IEs: criticalityDiagnosticsItems(e.IEs), + decoded: modeledIEs(table, value), } +} - for _, f := range fields { - idx, spec, ok := lookupIESpec(table, f.id) - if !ok { - // §10.3.4.2: reject stops the procedure, the rest are carried - // past. §10.3.1 has the receiver read on either way, so the scan - // continues and reports every offender together. - if f.crit == CriticalityReject { - reportNotUnderstood(f.id, f.crit) - - continue - } - - meta.diagnostics.record(f.id, f.crit, TypeOfErrorNotUnderstood) - meta.preserveUpTo(f, limit) +func criticalityDiagnosticsItems(ds []DiagnosticIE) []CriticalityDiagnosticsIEItem { + var out []CriticalityDiagnosticsIEItem - continue + for _, d := range ds { + if len(out) >= maxnoofErrors { + break } - // §10.3.6: out of the order §9.1 defines, or carried twice. Unknown - // ids do not advance the cursor. - if idx <= lastIdx { - // Abandoning the scan must not drop what it already collected. - return nil, reject(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage, notUnderstood) + kind := TypeOfErrorNotUnderstood + if d.Kind == ap.KindMissing { + kind = TypeOfErrorMissing } - lastIdx = idx - - if err := spec.decode((*M)(m), f.value, enc); err != nil { - // §10.3.1 cases 1, 2 and 6 are handled on criticality, not by - // abandoning the message. - if errors.Is(err, errNotComprehended) { - // §10.3.2 handles the item on its own criticality, which for an - // unmodeled extension is the extension's, not this IE's. - id, crit := f.id, f.crit - - var item *notComprehendedIE - if errors.As(err, &item) { - id, crit = item.ID, item.Crit - } - - if crit == CriticalityReject { - reportNotUnderstood(id, crit) - - continue - } - - meta.diagnostics.record(id, crit, TypeOfErrorNotUnderstood) - - continue - } - - return nil, &TransferSyntaxError{ - Procedure: procedure, - Err: fmt.Errorf("IE %s: %w", f.id, err), - } - } + out = append(out, CriticalityDiagnosticsIEItem{IECriticality: d.Criticality, IEID: d.ID, TypeOfError: kind}) + } - seen[f.id] = true + return out +} - meta.wire = append(meta.wire, wireSlot{id: f.id, crit: f.crit, unknown: -1}) - } +func modeledIEs[M any](table []ieSpec[M], value []byte) []RawIE { + r := per.NewReader(value) - if wireMatchesTable(table, meta.wire) { - meta.wire = nil + if _, err := r.ReadBit(); err != nil { + return nil } - if len(notUnderstood) > 0 { - return nil, reject(CauseProtocolAbstractSyntaxErrorReject, notUnderstood) + fields, err := decodeIEContainer(r, per.Aligned) + if err != nil { + return nil } - // §10.3.5: absence is judged per IE, by the criticality §9.1 assigns it. - var missingReject []CriticalityDiagnosticsIEItem - - for i := range table { - spec := table[i] - required := spec.required((*M)(m)) - - if seen[spec.id] { - // §10.3.6: a conditional IE carried when its condition is false. - if spec.presence == presenceConditional && !required { - return nil, reject(CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage, nil) - } - - continue - } - - if !required { - continue - } + var out []RawIE - if spec.deliverable() { - meta.diagnostics.record(spec.id, spec.crit, TypeOfErrorMissing) + seen := make(map[ProtocolIEID]bool, len(table)) + for _, f := range fields { + if seen[f.ID] || !inTable(table, f.ID) { continue } - missingReject = append(missingReject, CriticalityDiagnosticsIEItem{ - IECriticality: spec.crit, - IEID: spec.id, - TypeOfError: TypeOfErrorMissing, - }) - } + seen[f.ID] = true - if len(missingReject) > 0 { - return nil, reject(CauseProtocolAbstractSyntaxErrorReject, missingReject) + out = append(out, f) } - return m, nil + return out } -func wireMatchesTable[M any](table []ieSpec[M], wire []wireSlot) bool { - for _, s := range wire { - if s.unknown >= 0 { - return false - } - - if _, spec, ok := lookupIESpec(table, s.id); !ok || spec.crit != s.crit { - return false +func inTable[M any](table []ieSpec[M], id ProtocolIEID) bool { + for i := range table { + if table[i].ID == id { + return true } } - return true + return false } -func lookupIESpec[M any](table []ieSpec[M], id ProtocolIEID) (int, ieSpec[M], bool) { - for i := range table { - if table[i].id == id { - return i, table[i], true - } +func decodeValue[T any, PT interface { + *T + per.Unmarshaler +}](what string, b []byte, +) (PT, error) { + v := PT(new(T)) + + if err := v.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + return nil, fmt.Errorf("s1ap: %s: %w", what, err) } - return -1, ieSpec[M]{}, false + return v, nil } -// First occurrence only, bounded by the table length so the peer does not -// choose the size. -func modeledIEs[M any](table []ieSpec[M], fields []rawIE) []RawIE { - var out []RawIE - - seen := make(map[ProtocolIEID]bool, len(table)) - - for _, f := range fields { - if seen[f.id] { - continue - } +func parseValue[T any, PT interface { + *T + per.Unmarshaler +}](what string, b []byte, +) (PT, error) { + v, err := decodeValue[T, PT](what, b) + if err != nil { + return nil, err + } - if _, _, ok := lookupIESpec(table, f.id); !ok { - continue - } + if err := diagnosticsOf(v).Check(); err != nil { + return nil, fmt.Errorf("s1ap: %s: %w", what, err) + } - seen[f.id] = true + return v, nil +} - out = append(out, RawIE{ID: f.id, Criticality: f.crit, Value: f.value}) +func diagnosticsOf(v any) Diagnostics { + dv, ok := v.(ap.Diagnosable[ProtocolIEID]) + if !ok { + return Diagnostics{} } - return out + return Diagnostics{ap.Diagnose(dv)} } diff --git a/s1ap/ie_ue.go b/s1ap/ie_ue.go index bdc74b546a..98cacf0c23 100644 --- a/s1ap/ie_ue.go +++ b/s1ap/ie_ue.go @@ -4,8 +4,6 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -92,10 +90,12 @@ func (b *BitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // UEAggregateMaximumBitRate ::= SEQUENCE { ...DL, ...UL, iE-Extensions OPTIONAL } // (extensible). type UEAggregateMaximumBitRate struct { - _ [0]struct{} `per:"extseq"` - DL BitRate - UL BitRate - _ ieExtensions `per:",skip"` + DL BitRate + UL BitRate + ExtendedDL *ExtendedBitRate `per:",extie:IDExtendedUEAggregateMaximumBitRateDL,crit:ignore"` + ExtendedUL *ExtendedBitRate `per:",extie:IDExtendedUEAggregateMaximumBitRateUL,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } // SecurityKey ::= BIT STRING (SIZE(256)). @@ -120,53 +120,20 @@ func (k *SecurityKey) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // integrityProtectionAlgorithms, iE-Extensions OPTIONAL } (extensible). Each // algorithm field is BIT STRING (SIZE(16, ...)). type UESecurityCapabilities struct { - EncryptionAlgorithms uint16 - IntegrityProtectionAlgorithms uint16 + EncryptionAlgorithms SecurityAlgorithms + IntegrityProtectionAlgorithms SecurityAlgorithms + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -func (c UESecurityCapabilities) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - - if err := per.EncodeBitString(w, enc, 16, 16, true, true, true, uintToBits(uint64(c.EncryptionAlgorithms), 16), 16); err != nil { - return err - } - - return per.EncodeBitString(w, enc, 16, 16, true, true, true, uintToBits(uint64(c.IntegrityProtectionAlgorithms), 16), 16) +type SecurityAlgorithms struct { + Value uint16 + extended bool + octets string + bits int } -func (c *UESecurityCapabilities) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - encAlgs, encBits, err := per.DecodeBitString(r, enc, 16, 16, true, true, true) - if err != nil { - return err - } - - integ, integBits, err := per.DecodeBitString(r, enc, 16, 16, true, true, true) - if err != nil { - return err - } - - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err - } - - *c = UESecurityCapabilities{ - EncryptionAlgorithms: uint16(bitsToUint(encAlgs, encBits)), - IntegrityProtectionAlgorithms: uint16(bitsToUint(integ, integBits)), - } - - return nil -} +const securityAlgorithmsBits = 16 // UERadioCapability ::= OCTET STRING (unconstrained) — TS 36.413 §9.2.1.27. type UERadioCapability []byte @@ -207,69 +174,34 @@ func (c *UERadioCapabilityForPaging) UnmarshalPER(r *per.Reader, enc per.Encodin // TAI ::= SEQUENCE { pLMNidentity, tAC, iE-Extensions OPTIONAL } (extensible). type TAI struct { - _ [0]struct{} `per:"extseq"` + extensions per.ExtensionAdditions `per:",extraw"` PLMNIdentity PLMNIdentity TAC TAC - _ ieExtensions `per:",skip"` + iEExtensions extensionMeta `per:",exttable"` } // EUTRANCGI ::= SEQUENCE { pLMNidentity, cell-ID CellIdentity, iE-Extensions // OPTIONAL } (extensible). CellIdentity ::= BIT STRING (SIZE(28)). type EUTRANCGI struct { PLMNIdentity PLMNIdentity - CellID uint32 // 28-bit cell identity + CellID CellIdentity + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -const cellIDBits = 28 - -func (c EUTRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - - if err := c.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - - return encodeBitStringUint(w, enc, uint64(c.CellID), cellIDBits) -} - -func (c *EUTRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - var plmn PLMNIdentity - if err := plmn.UnmarshalPER(r, enc); err != nil { - return err - } - - b, _, err := per.DecodeBitString(r, enc, cellIDBits, cellIDBits, true, true, false) - if err != nil { - return err - } - - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err - } - - *c = EUTRANCGI{PLMNIdentity: plmn, CellID: uint32(bitsToUint(b, cellIDBits))} +type CellIdentity uint32 - return nil -} +const cellIDBits = 28 // UserLocationInformation ::= SEQUENCE { eutran-CGI EUTRAN-CGI, tai TAI, // iE-Extensions OPTIONAL, ... } (extensible) — TS 36.413 §9.2.1.93. type UserLocationInformation struct { - _ [0]struct{} `per:"extseq"` - EUTRANCGI EUTRANCGI - TAI TAI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + EUTRANCGI EUTRANCGI + TAI TAI + PSCellInformation *PSCellInformation `per:",extie:IDPSCellInformation,crit:ignore"` + LTENTNTAIInformation *LTENTNTAIInformation `per:",extie:IDLTENTNTAIInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // RRCEstablishmentCause ::= ENUMERATED { emergency, highPriorityAccess, @@ -282,44 +214,13 @@ const ( RRCCauseMTAccess RRCCauseMOSignalling RRCCauseMOData - - rrcEstablishmentCauseRootCount = 5 + RRCCauseDelayTolerantAccess + RRCCauseMOVoiceCall + RRCCauseMOExceptionData ) -func (c RRCEstablishmentCause) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, rrcEstablishmentCauseRootCount, int64(c), "RRCEstablishmentCause") -} - -func (c *RRCEstablishmentCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, rrcEstablishmentCauseRootCount, "RRCEstablishmentCause") - if err != nil { - return fmt.Errorf("s1ap: rrc establishment cause: %w", err) - } - - *c = RRCEstablishmentCause(idx) - - return nil -} - type GWContextReleaseIndication uint8 const ( GWContextReleaseIndicationTrue GWContextReleaseIndication = iota - - gwContextReleaseIndicationRootCount = 1 ) - -func (g GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, gwContextReleaseIndicationRootCount, int64(g), "GWContextReleaseIndication") -} - -func (g *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, gwContextReleaseIndicationRootCount, "GWContextReleaseIndication") - if err != nil { - return err - } - - *g = GWContextReleaseIndication(idx) - - return nil -} diff --git a/s1ap/ies.go b/s1ap/ies.go index c798b5996e..75fa430c14 100644 --- a/s1ap/ies.go +++ b/s1ap/ies.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // Container size bounds (TS 36.413, S1AP-Constants). @@ -15,123 +16,34 @@ const ( maxProtocolExtensions = 65535 ) -// Exactly one of val and raw is set; raw holds already-encoded open-type -// content, so an unmodeled IE round-trips verbatim. -type ieField struct { - id ProtocolIEID - crit Criticality - val per.Marshaler - raw []byte +var profile = &ap.Profile{ + Name: "s1ap", + MaxProtocolIEs: maxProtocolIEs, + MaxProtocolExtensions: maxProtocolExtensions, + OpaqueProcedures: []uint8{uint8(ProcPrivateMessage)}, + ProcedureName: func(pc uint8) string { return ProcedureCode(pc).String() }, + IEName: func(id uint16) string { return ProtocolIEID(id).String() }, } -type rawIE struct { - id ProtocolIEID - crit Criticality - value []byte -} +type ieField = ap.FieldValue[ProtocolIEID] -func (e rawIE) field() ieField { - return ieField{id: e.id, crit: e.crit, raw: e.value} -} +type rawIE = ap.Field[ProtocolIEID] // A ProtocolIE-Field the message type does not model; Value is open-type bytes. -type RawIE struct { - ID ProtocolIEID - Criticality Criticality - Value []byte -} +type RawIE = ap.Field[ProtocolIEID] -// What the typed fields cannot carry: IEs this version does not model, and the -// abstract syntax errors that did not stop delivery. -type messageMeta struct { - unknownIEs []rawIE - wire []wireSlot - diagnostics Diagnostics - extensions per.ExtensionAdditions - dropped bool -} - -type wireSlot struct { - id ProtocolIEID - crit Criticality - unknown int +func encodeContainerField(w *per.Writer, enc per.Encoding, f ieField) error { + return ap.EncodeField(profile, w, enc, f) } -// Bounded: a peer chooses both the count and the size of what we would retain. -func (u *messageMeta) preserve(f rawIE) { - u.preserveUpTo(f, maxPreservedIEs) +func decodeIE(r *per.Reader, u per.Unmarshaler) error { + return u.UnmarshalPER(r, per.Aligned) } -func (u *messageMeta) preserveUpTo(f rawIE, limit int) { - if len(u.unknownIEs) >= limit { - u.diagnostics.Truncated = true - u.dropped = true - - return - } +func restOctets(r *per.Reader) []byte { + b, _ := r.ReadOctets(r.Bits() / 8) - u.unknownIEs = append(u.unknownIEs, f) - u.wire = append(u.wire, wireSlot{id: f.id, crit: f.crit, unknown: len(u.unknownIEs) - 1}) -} - -// The abstract syntax errors §10.3.4.2 and §10.3.5 let the receiver carry on -// past. -func (u messageMeta) Diagnostics() Diagnostics { return u.diagnostics } - -// In wire order. -func (u messageMeta) UnknownIEs() []RawIE { - if len(u.unknownIEs) == 0 { - return nil - } - - out := make([]RawIE, len(u.unknownIEs)) - for i, e := range u.unknownIEs { - out[i] = RawIE{ID: e.id, Criticality: e.crit, Value: e.value} - } - - return out -} - -func encodeIEContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - if len(fields) > maxProtocolIEs { - return fmt.Errorf("s1ap: %d IEs exceed maxProtocolIEs", len(fields)) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, maxProtocolIEs, int64(len(fields))); err != nil { - return err - } - - for _, f := range fields { - if err := encodeContainerField(w, enc, f); err != nil { - return err - } - } - - return nil -} - -func encodeContainerField(w *per.Writer, enc per.Encoding, f ieField) error { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, maxProtocolIEs, int64(f.id)); err != nil { - return err - } - - if err := per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(f.crit)); err != nil { - return err - } - - if f.raw != nil { - return per.EncodeOpenTypeBytes(w, enc, f.raw) - } - - if f.val == nil { - return fmt.Errorf("s1ap: IE %d has no value", f.id) - } - - if err := per.EncodeOpenType(w, enc, f.val); err != nil { - return fmt.Errorf("s1ap: encode IE %d: %w", f.id, err) - } - - return nil + return b } // maxnoofERABs bounds the E-RAB SEQUENCE-OF lists (TS 36.413). @@ -142,7 +54,7 @@ const maxnoofERABs = 256 // //nolint:unparam type containerCrit struct { - crit *Criticality + crit ap.WireCriticality } func (c *containerCrit) wireCriticality() *containerCrit { return c } @@ -167,11 +79,11 @@ func encodeSingleContainerList[T any](w *per.Writer, enc per.Encoding, ub int64, } c := crit - if h, ok := any(&items[i]).(containerCritical); ok && h.wireCriticality().crit != nil { - c = *h.wireCriticality().crit + if h, ok := any(&items[i]).(containerCritical); ok { + c = h.wireCriticality().crit.Of(crit) } - if err := encodeContainerField(w, enc, ieField{id: id, crit: c, val: m}); err != nil { + if err := encodeContainerField(w, enc, ieField{ID: id, Criticality: c, Value: m}); err != nil { return err } } @@ -220,9 +132,8 @@ func decodeItemList[T any](r *per.Reader, enc per.Encoding, ub int64, itemID Pro return err } - if h, ok := any(&item).(containerCritical); ok && Criticality(c) != crit { - wire := Criticality(c) - h.wireCriticality().crit = &wire + if h, ok := any(&item).(containerCritical); ok { + h.wireCriticality().crit = ap.Wire(Criticality(c), crit) } items = append(items, item) @@ -241,41 +152,35 @@ func decodeItemList[T any](r *per.Reader, enc per.Encoding, ub int64, itemID Pro // //nolint:unparam func decodeIEContainer(r *per.Reader, enc per.Encoding) ([]rawIE, error) { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return nil, fmt.Errorf("s1ap: IE container length: %w", err) - } - - // A count the remaining octets cannot hold is bogus and must not be - // pre-allocated for. - if maxBits := int64(r.Bits()); n > maxBits/minIEFieldBits { - return nil, fmt.Errorf("s1ap: IE container declares %d IEs in %d bits", n, maxBits) - } - - fields := make([]rawIE, 0, n) + return ap.DecodeIEContainer[ProtocolIEID](profile, r, enc) +} - for i := int64(0); i < n; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return nil, fmt.Errorf("s1ap: IE %d id: %w", i, err) - } +func perIEDecode(b []byte, u per.Unmarshaler) error { + return u.UnmarshalPER(per.NewReader(b), per.Aligned) +} - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return nil, fmt.Errorf("s1ap: IE %d criticality: %w", i, err) - } +type itemList[T any] struct { + lb, ub int64 + id ProtocolIEID + crit Criticality + items []T + single bool +} - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return nil, fmt.Errorf("s1ap: IE %d value: %w", i, err) - } +func containerList[T any](ub int64, id ProtocolIEID, crit Criticality, items []T) itemList[T] { + return itemList[T]{ub: ub, id: id, crit: crit, items: items, single: true} +} - if len(val) == 0 { - return nil, fmt.Errorf("s1ap: IE %d has an empty open type", i) - } +func seqOf[T any](lb, ub int64, items []T) itemList[T] { + return itemList[T]{lb: lb, ub: ub, items: items} +} - fields = append(fields, rawIE{id: ProtocolIEID(id), crit: Criticality(crit), value: val}) +func (l itemList[T]) MarshalPER(w *per.Writer, enc per.Encoding) error { + if l.single { + return encodeSingleContainerList(w, enc, l.ub, l.id, l.crit, l.items) } - return fields, nil + return marshalSeqOf(w, enc, l.lb, l.ub, l.items) } + +func (l itemList[T]) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return diagnoseItems(d, l.items) } diff --git a/s1ap/ies_test.go b/s1ap/ies_test.go index 6ab5cdfdb9..ddd4e3c236 100644 --- a/s1ap/ies_test.go +++ b/s1ap/ies_test.go @@ -8,15 +8,16 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestEncodeIEContainerKnownVector(t *testing.T) { w := per.NewWriter() err := encodeIEContainer(w, per.Aligned, []ieField{{ - id: 59, - crit: CriticalityIgnore, - raw: []byte{0xab, 0xcd}, + ID: 59, + Criticality: CriticalityIgnore, + Value: ap.RawValue([]byte{0xab, 0xcd}), }}) if err != nil { t.Fatal(err) @@ -53,9 +54,9 @@ func TestEmptyIEContainer(t *testing.T) { func TestIEContainerRoundTrip(t *testing.T) { in := []ieField{ - {id: 59, crit: CriticalityReject, raw: []byte{0x01, 0x02, 0x03}}, - {id: 1, crit: CriticalityIgnore, raw: []byte{0xff}}, - {id: 65535, crit: CriticalityNotify, val: per.MarshalerFunc(func(*per.Writer, per.Encoding) error { return nil })}, + {ID: 59, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x01, 0x02, 0x03})}, + {ID: 1, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xff})}, + {ID: 65535, Criticality: CriticalityNotify, Value: per.MarshalerFunc(func(*per.Writer, per.Encoding) error { return nil })}, } w := per.NewWriter() @@ -75,12 +76,12 @@ func TestIEContainerRoundTrip(t *testing.T) { wantValues := [][]byte{{0x01, 0x02, 0x03}, {0xff}, {0x00}} // empty body -> open type min 1 octet for i, f := range in { - if got[i].id != f.id || got[i].crit != f.crit { - t.Fatalf("IE %d: id/crit mismatch got {%d,%v}", i, got[i].id, got[i].crit) + if got[i].ID != f.ID || got[i].Criticality != f.Criticality { + t.Fatalf("IE %d: id/crit mismatch got {%d,%v}", i, got[i].ID, got[i].Criticality) } - if !bytes.Equal(got[i].value, wantValues[i]) { - t.Fatalf("IE %d: value % x, want % x", i, got[i].value, wantValues[i]) + if !bytes.Equal(got[i].Value, wantValues[i]) { + t.Fatalf("IE %d: value % x, want % x", i, got[i].Value, wantValues[i]) } } } @@ -88,8 +89,8 @@ func TestIEContainerRoundTrip(t *testing.T) { func TestRawIEReencodePreserves(t *testing.T) { // A container decoded and re-encoded from preserved raw IEs is byte-identical. original := []ieField{ - {id: 10, crit: CriticalityReject, raw: []byte{0xde, 0xad}}, - {id: 20, crit: CriticalityIgnore, raw: []byte{0xbe, 0xef, 0x00}}, + {ID: 10, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0xde, 0xad})}, + {ID: 20, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xbe, 0xef, 0x00})}, } w1 := per.NewWriter() @@ -104,7 +105,7 @@ func TestRawIEReencodePreserves(t *testing.T) { fields := make([]ieField, len(raw)) for i, e := range raw { - fields[i] = e.field() + fields[i] = e.Encodable() } w2 := per.NewWriter() diff --git a/s1ap/initial_context_setup.go b/s1ap/initial_context_setup.go index a8394ab8db..1426200378 100644 --- a/s1ap/initial_context_setup.go +++ b/s1ap/initial_context_setup.go @@ -18,67 +18,67 @@ type InitialContextSetupRequest struct { UERadioCapability UERadioCapability GUMMEI *GUMMEI MMEUES1APID2 *MMEUES1APID + CoarseUELocation *CoarseUELocation + TimeRefDistribution *TimeRefDistribution messageMeta } var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDUEAggregateMaximumBitrate, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UEAggregateMaximumBitRate) + ID: IDUEAggregateMaximumBitrate, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UEAggregateMaximumBitRate) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.UEAggregateMaximumBitRate, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.UEAggregateMaximumBitRate, true }, }, { - id: IDERABToBeSetupListCtxtSUReq, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDERABToBeSetupListCtxtSUReq, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemCtxtSUReq](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject) + m.ERABToBeSetup, err = decodeItemList[ERABToBeSetupItemCtxtSUReq](r, enc, maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject) return err }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject, m.ERABToBeSetup) - }), true + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + return containerList(maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject, m.ERABToBeSetup), true }, }, { - id: IDUESecurityCapabilities, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UESecurityCapabilities) + ID: IDUESecurityCapabilities, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UESecurityCapabilities) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.UESecurityCapabilities, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.UESecurityCapabilities, true }, }, { - id: IDSecurityKey, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SecurityKey) + ID: IDSecurityKey, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SecurityKey) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.SecurityKey, true }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.SecurityKey, true }, }, { - id: IDUERadioCapability, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UERadioCapability) + ID: IDUERadioCapability, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UERadioCapability) }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.UERadioCapability == nil { return nil, false } @@ -87,11 +87,11 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ }, }, { - id: IDGUMMEI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDGUMMEI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var v GUMMEI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -99,7 +99,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return nil }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.GUMMEI == nil { return nil, false } @@ -108,11 +108,11 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ }, }, { - id: IDMMEUES1APID2, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupRequest, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID2, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -120,7 +120,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return nil }, - encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { if m.MMEUES1APID2 == nil { return nil, false } @@ -128,6 +128,20 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.MMEUES1APID2, true }, }, + { + ID: IDCoarseUELocation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CoarseUELocation) + }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return optionalIE(m.CoarseUELocation) }, + }, + { + ID: IDTimeRefDistribution, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TimeRefDistribution) + }, + Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return optionalIE(m.TimeRefDistribution) }, + }, } func (m *InitialContextSetupRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -154,6 +168,10 @@ func ParseInitialContextSetupRequest(value []byte) (*InitialContextSetupRequest, return parseMessageBody[InitialContextSetupRequest](ProcInitialContextSetup, TriggeringInitiatingMessage, initialContextSetupRequestIEs, value) } +func DecodeInitialContextSetupRequest(value []byte) (*InitialContextSetupRequest, error) { + return decodeMessageBody[InitialContextSetupRequest](ProcInitialContextSetup, initialContextSetupRequestIEs, value) +} + // TS 36.413 §9.1.4.3. type InitialContextSetupResponse struct { MMEUES1APID *MMEUES1APID @@ -167,11 +185,11 @@ type InitialContextSetupResponse struct { var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -179,7 +197,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -188,11 +206,11 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -200,7 +218,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -209,49 +227,45 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ }, }, { - id: IDERABSetupListCtxtSURes, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDERABSetupListCtxtSURes, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABSetup, err = decodeItemList[ERABSetupItemCtxtSURes](per.NewReader(raw), enc, maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore) + m.ERABSetup, err = decodeItemList[ERABSetupItemCtxtSURes](r, enc, maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore) return err }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if len(m.ERABSetup) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore, m.ERABSetup) - }), true + return containerList(maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore, m.ERABSetup), true }, }, { - id: IDERABFailedToSetupListCtxtSURes, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDERABFailedToSetupListCtxtSURes, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var err error - m.ERABFailedToSetup, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABFailedToSetup, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if len(m.ERABFailedToSetup) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToSetup) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToSetup), true }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -259,7 +273,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil }, - encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -293,6 +307,10 @@ func ParseInitialContextSetupResponse(value []byte) (*InitialContextSetupRespons return parseMessageBody[InitialContextSetupResponse](ProcInitialContextSetup, TriggeringSuccessfulOutcome, initialContextSetupResponseIEs, value) } +func DecodeInitialContextSetupResponse(value []byte) (*InitialContextSetupResponse, error) { + return decodeMessageBody[InitialContextSetupResponse](ProcInitialContextSetup, initialContextSetupResponseIEs, value) +} + // TS 36.413 §9.1.4.4. type InitialContextSetupFailure struct { MMEUES1APID *MMEUES1APID @@ -305,11 +323,11 @@ type InitialContextSetupFailure struct { var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -317,7 +335,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -326,11 +344,11 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -338,7 +356,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -347,11 +365,11 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -359,7 +377,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -368,11 +386,11 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *InitialContextSetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialContextSetupFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -380,7 +398,7 @@ var initialContextSetupFailureIEs = []ieSpec[InitialContextSetupFailure]{ return nil }, - encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { + Encode: func(m *InitialContextSetupFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -413,3 +431,7 @@ func (m *InitialContextSetupFailure) Marshal() ([]byte, error) { func ParseInitialContextSetupFailure(value []byte) (*InitialContextSetupFailure, error) { return parseMessageBody[InitialContextSetupFailure](ProcInitialContextSetup, TriggeringUnsuccessfulOutcome, initialContextSetupFailureIEs, value) } + +func DecodeInitialContextSetupFailure(value []byte) (*InitialContextSetupFailure, error) { + return decodeMessageBody[InitialContextSetupFailure](ProcInitialContextSetup, initialContextSetupFailureIEs, value) +} diff --git a/s1ap/initial_context_setup_test.go b/s1ap/initial_context_setup_test.go index 99e557c14c..5c924e6763 100644 --- a/s1ap/initial_context_setup_test.go +++ b/s1ap/initial_context_setup_test.go @@ -6,8 +6,9 @@ package s1ap import ( "bytes" "errors" - "reflect" "testing" + + "github.com/ellanetworks/core/per/ap" ) // A real INITIAL CONTEXT SETUP RESPONSE: MME-UE-S1AP-ID 0x020000bf, @@ -42,7 +43,7 @@ func TestInitialContextSetupResponseGoldenDecode(t *testing.T) { t.Fatalf("ERABSetup len = %d, want 1", len(resp.ERABSetup)) } - if len(resp.ERABSetup[0].TransportLayerAddress) == 0 || resp.ERABSetup[0].GTPTEID == 0 { + if resp.ERABSetup[0].TransportLayerAddress.IsZero() || resp.ERABSetup[0].GTPTEID == 0 { t.Fatalf("E-RAB item missing TLA/TEID: %+v", resp.ERABSetup[0]) } @@ -69,7 +70,7 @@ func TestInitialContextSetupResponseGoldenDecode(t *testing.T) { for i := range resp.ERABSetup { a, b := resp.ERABSetup[i], resp2.ERABSetup[i] - if a.ERABID != b.ERABID || a.GTPTEID != b.GTPTEID || !bytes.Equal(a.TransportLayerAddress, b.TransportLayerAddress) { + if a.ERABID != b.ERABID || a.GTPTEID != b.GTPTEID || a.TransportLayerAddress != b.TransportLayerAddress { t.Fatalf("E-RAB %d round-trip mismatch:\n %+v\n %+v", i, a, b) } } @@ -85,7 +86,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { }, } - tla := TransportLayerAddress{10, 45, 0, 1} + tla := tlaOf(10, 45, 0, 1) var key SecurityKey for i := range key { @@ -101,7 +102,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { ERABID: 5, QoS: qos, TransportLayerAddress: tla, GTPTEID: 0x12345678, NASPDU: NASPDU{0x07, 0x42, 0x01}, }}, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}, SecurityKey: key, UERadioCapability: []byte{0xaa, 0xbb, 0xcc, 0xdd}, } @@ -127,7 +128,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { gi, go_ := in.ERABToBeSetup[0], out.ERABToBeSetup[0] if gi.ERABID != go_.ERABID || gi.GTPTEID != go_.GTPTEID || gi.QoS.QCI != go_.QoS.QCI || - !reflect.DeepEqual(gi.QoS.ARP, go_.QoS.ARP) || !bytes.Equal(gi.TransportLayerAddress, go_.TransportLayerAddress) || + gi.QoS.ARP != go_.QoS.ARP || gi.TransportLayerAddress != go_.TransportLayerAddress || !bytes.Equal(gi.NASPDU, go_.NASPDU) { t.Fatalf("E-RAB item mismatch:\n in %+v\n out %+v", gi, go_) } @@ -153,7 +154,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { if deref(out.MMEUES1APID) != deref(in.MMEUES1APID) || deref(out.ENBUES1APID) != deref(in.ENBUES1APID) || len(out.ERABSetup) != 1 || out.ERABSetup[0].ERABID != 5 || out.ERABSetup[0].GTPTEID != 0x12345678 || - !bytes.Equal(out.ERABSetup[0].TransportLayerAddress, tla) { + out.ERABSetup[0].TransportLayerAddress != tla { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) @@ -161,7 +162,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { t.Run("Failure", func(t *testing.T) { in := &InitialContextSetupFailure{ MMEUES1APID: Ptr(MMEUES1APID(42)), ENBUES1APID: Ptr(ENBUES1APID(1)), - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 0}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), } b, err := in.Marshal() @@ -181,7 +182,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { } if deref(out.MMEUES1APID) != deref(in.MMEUES1APID) || deref(out.ENBUES1APID) != deref(in.ENBUES1APID) || - deref(out.Cause) != deref(in.Cause) { + !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) @@ -191,11 +192,11 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { // MME cannot set up a context without them. func TestInitialContextSetupRequestMissingRejectIE(t *testing.T) { partial := container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, raw: ieRaw(t, Ptr(MMEUES1APID(1)))}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, raw: ieRaw(t, Ptr(ENBUES1APID(2)))}, - ieField{id: IDUEAggregateMaximumBitrate, crit: CriticalityReject, raw: ieRaw(t, &UEAggregateMaximumBitRate{})}, - ieField{id: IDUESecurityCapabilities, crit: CriticalityReject, raw: ieRaw(t, &UESecurityCapabilities{})}, - ieField{id: IDSecurityKey, crit: CriticalityReject, raw: ieRaw(t, Ptr(SecurityKey{}))}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(ENBUES1APID(2))))}, + ieField{ID: IDUEAggregateMaximumBitrate, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, &UEAggregateMaximumBitRate{}))}, + ieField{ID: IDUESecurityCapabilities, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, &UESecurityCapabilities{}))}, + ieField{ID: IDSecurityKey, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(SecurityKey{})))}, ) // Without the E-RAB list the request is incomplete: it is mandatory and @@ -228,7 +229,7 @@ func initialContextSetupRequestGoldenCases() []newMessageCase { ENBUES1APID: 2, UEAggregateMaximumBitRate: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}, GUMMEI: Ptr(goldGUMMEI()), MMEUES1APID2: Ptr(MMEUES1APID(3)), }, diff --git a/s1ap/interworking_cause_names_test.go b/s1ap/interworking_cause_names_test.go index 4e2427fca7..fa609a5d5d 100644 --- a/s1ap/interworking_cause_names_test.go +++ b/s1ap/interworking_cause_names_test.go @@ -15,10 +15,10 @@ func TestInterworkingFailureCauseNames(t *testing.T) { cause s1ap.Cause want string }{ - {s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell}, "no-radio-resources-available-in-target-cell"}, - {s1ap.Cause{Group: s1ap.CauseGroupRadioNetwork, Value: s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported}, "encryption-and-or-integrity-protection-algorithms-not-supported"}, - {s1ap.CauseInsufficientUECapabilities, "insufficient-ue-capabilities"}, - {s1ap.Cause{Group: s1ap.CauseGroupMisc, Value: s1ap.CauseMiscOMIntervention}, "om-intervention"}, + {s1ap.CauseRadioNetworkNoRadioResourcesInTargetCell.Cause(), "no-radio-resources-available-in-target-cell"}, + {s1ap.CauseRadioNetworkEncryptionAlgorithmsNotSupported.Cause(), "encryption-and-or-integrity-protection-algorithms-not-supported"}, + {s1ap.CauseRadioNetworkInsufficientUECapabilities.Cause(), "insufficient-ue-capabilities"}, + {s1ap.CauseMiscOMIntervention.Cause(), "om-intervention"}, } { if got := tc.cause.String(); !strings.Contains(got, tc.want) { t.Errorf("cause %+v = %q, want it to name %q", tc.cause, got, tc.want) diff --git a/s1ap/location_report.go b/s1ap/location_report.go index bbc2eda619..9abf785684 100644 --- a/s1ap/location_report.go +++ b/s1ap/location_report.go @@ -27,10 +27,11 @@ const ( // RequestType ::= SEQUENCE { eventType, reportArea, iE-Extensions OPTIONAL, ... } // (TS 36.413 §9.2.1.35). type RequestType struct { - _ [0]struct{} `per:"extseq"` - EventType EventType `per:"ENUMERATED,range:0..2,..."` - ReportArea ReportArea `per:"ENUMERATED,range:0..0,..."` - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + EventType EventType + ReportArea ReportArea + RequestTypeAdditionalInfo *RequestTypeAdditionalInfo `per:",extie:IDRequestTypeAdditionalInfo,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` } // TS 36.413 §9.1.12.3. @@ -46,25 +47,25 @@ type LocationReport struct { var locationReportIEs = []ieSpec[LocationReport]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *LocationReport) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDEUTRANCGI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { + ID: IDEUTRANCGI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { var v EUTRANCGI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -72,7 +73,7 @@ var locationReportIEs = []ieSpec[LocationReport]{ return nil }, - encode: func(m *LocationReport) (per.Marshaler, bool) { + Encode: func(m *LocationReport) (per.Marshaler, bool) { if m.EUTRANCGI == nil { return nil, false } @@ -81,11 +82,11 @@ var locationReportIEs = []ieSpec[LocationReport]{ }, }, { - id: IDTAI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { + ID: IDTAI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { var v TAI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -93,7 +94,7 @@ var locationReportIEs = []ieSpec[LocationReport]{ return nil }, - encode: func(m *LocationReport) (per.Marshaler, bool) { + Encode: func(m *LocationReport) (per.Marshaler, bool) { if m.TAI == nil { return nil, false } @@ -102,11 +103,11 @@ var locationReportIEs = []ieSpec[LocationReport]{ }, }, { - id: IDRequestType, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *LocationReport, raw []byte, enc per.Encoding) error { + ID: IDRequestType, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *LocationReport, r *per.Reader, enc per.Encoding) error { var v RequestType - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -114,7 +115,7 @@ var locationReportIEs = []ieSpec[LocationReport]{ return nil }, - encode: func(m *LocationReport) (per.Marshaler, bool) { + Encode: func(m *LocationReport) (per.Marshaler, bool) { if m.RequestType == nil { return nil, false } @@ -147,3 +148,7 @@ func (m *LocationReport) Marshal() ([]byte, error) { func ParseLocationReport(value []byte) (*LocationReport, error) { return parseMessageBody[LocationReport](ProcLocationReport, TriggeringInitiatingMessage, locationReportIEs, value) } + +func DecodeLocationReport(value []byte) (*LocationReport, error) { + return decodeMessageBody[LocationReport](ProcLocationReport, locationReportIEs, value) +} diff --git a/s1ap/location_report_test.go b/s1ap/location_report_test.go index b5eb776e6d..83eb061365 100644 --- a/s1ap/location_report_test.go +++ b/s1ap/location_report_test.go @@ -70,8 +70,8 @@ func TestLocationReportMissingMandatoryIE(t *testing.T) { t.Run("ignore-criticality IEs missing are reported", func(t *testing.T) { value := encode(t, []ieField{ - {id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(1)}, - {id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(1)}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(1)}, + {ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(1)}, }) out, err := ParseLocationReport(value) @@ -90,7 +90,7 @@ func TestLocationReportMissingMandatoryIE(t *testing.T) { for i, want := range []ProtocolIEID{IDEUTRANCGI, IDTAI, IDRequestType} { if got[i].ID != want || got[i].Criticality != CriticalityIgnore || - got[i].TypeOfError != TypeOfErrorMissing { + typeOfError(got[i]) != TypeOfErrorMissing { t.Errorf("diagnostic %d = %+v, want %v missing/ignore", i, got[i], want) } } @@ -98,7 +98,7 @@ func TestLocationReportMissingMandatoryIE(t *testing.T) { t.Run("missing reject-criticality IE rejects the procedure", func(t *testing.T) { value := encode(t, []ieField{ - {id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(1)}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(1)}, }) var ase *AbstractSyntaxError diff --git a/s1ap/lppa_transport.go b/s1ap/lppa_transport.go index f0059cacb3..fef3b2b1b8 100644 --- a/s1ap/lppa_transport.go +++ b/s1ap/lppa_transport.go @@ -63,24 +63,24 @@ func lppaTransportIEs[M any]( ) []ieSpec[M] { return []ieSpec[M]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, mme(m)) }, - encode: func(m *M) (per.Marshaler, bool) { return mme(m), true }, + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, mme(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { return mme(m), true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, enb(m)) }, - encode: func(m *M) (per.Marshaler, bool) { return enb(m), true }, + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, enb(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { return enb(m), true }, }, { - id: IDRoutingID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, routing(m)) }, - encode: func(m *M) (per.Marshaler, bool) { return routing(m), true }, + ID: IDRoutingID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, routing(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { return routing(m), true }, }, { - id: IDLPPaPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, pdu(m)) }, - encode: func(m *M) (per.Marshaler, bool) { return pdu(m), true }, + ID: IDLPPaPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, pdu(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { return pdu(m), true }, }, } } @@ -127,6 +127,10 @@ func ParseDownlinkUEAssociatedLPPaTransport(value []byte) (*DownlinkUEAssociated return parseMessageBody[DownlinkUEAssociatedLPPaTransport](ProcDownlinkUEAssociatedLPPaTransport, TriggeringInitiatingMessage, downlinkUEAssociatedLPPaTransportIEs, value) } +func DecodeDownlinkUEAssociatedLPPaTransport(value []byte) (*DownlinkUEAssociatedLPPaTransport, error) { + return decodeMessageBody[DownlinkUEAssociatedLPPaTransport](ProcDownlinkUEAssociatedLPPaTransport, downlinkUEAssociatedLPPaTransportIEs, value) +} + // TS 36.413 §9.1.19.2. type UplinkUEAssociatedLPPaTransport struct { MMEUES1APID MMEUES1APID @@ -157,6 +161,10 @@ func ParseUplinkUEAssociatedLPPaTransport(value []byte) (*UplinkUEAssociatedLPPa return parseMessageBody[UplinkUEAssociatedLPPaTransport](ProcUplinkUEAssociatedLPPaTransport, TriggeringInitiatingMessage, uplinkUEAssociatedLPPaTransportIEs, value) } +func DecodeUplinkUEAssociatedLPPaTransport(value []byte) (*UplinkUEAssociatedLPPaTransport, error) { + return decodeMessageBody[UplinkUEAssociatedLPPaTransport](ProcUplinkUEAssociatedLPPaTransport, uplinkUEAssociatedLPPaTransportIEs, value) +} + // The non-UE-associated pair carries only the routing id and the payload: with // no UE context, there are no UE S1AP IDs to name. func nonUEAssociatedLPPaTransportIEs[M any]( @@ -165,14 +173,14 @@ func nonUEAssociatedLPPaTransportIEs[M any]( ) []ieSpec[M] { return []ieSpec[M]{ { - id: IDRoutingID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, routing(m)) }, - encode: func(m *M) (per.Marshaler, bool) { return routing(m), true }, + ID: IDRoutingID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, routing(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { return routing(m), true }, }, { - id: IDLPPaPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *M, raw []byte, enc per.Encoding) error { return perIEDecode(raw, pdu(m)) }, - encode: func(m *M) (per.Marshaler, bool) { + ID: IDLPPaPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { return decodeIE(r, pdu(m)) }, + Encode: func(m *M) (per.Marshaler, bool) { if *pdu(m) == nil { return nil, false } @@ -237,6 +245,10 @@ func ParseDownlinkNonUEAssociatedLPPaTransport(value []byte) (*DownlinkNonUEAsso return parseMessageBody[DownlinkNonUEAssociatedLPPaTransport](ProcDownlinkNonUEAssociatedLPPaTransport, TriggeringInitiatingMessage, downlinkNonUEAssociatedLPPaTransportIEs, value) } +func DecodeDownlinkNonUEAssociatedLPPaTransport(value []byte) (*DownlinkNonUEAssociatedLPPaTransport, error) { + return decodeMessageBody[DownlinkNonUEAssociatedLPPaTransport](ProcDownlinkNonUEAssociatedLPPaTransport, downlinkNonUEAssociatedLPPaTransportIEs, value) +} + func (m *UplinkNonUEAssociatedLPPaTransport) Marshal() ([]byte, error) { w := per.NewWriter() @@ -256,3 +268,7 @@ func (m *UplinkNonUEAssociatedLPPaTransport) Marshal() ([]byte, error) { func ParseUplinkNonUEAssociatedLPPaTransport(value []byte) (*UplinkNonUEAssociatedLPPaTransport, error) { return parseMessageBody[UplinkNonUEAssociatedLPPaTransport](ProcUplinkNonUEAssociatedLPPaTransport, TriggeringInitiatingMessage, uplinkNonUEAssociatedLPPaTransportIEs, value) } + +func DecodeUplinkNonUEAssociatedLPPaTransport(value []byte) (*UplinkNonUEAssociatedLPPaTransport, error) { + return decodeMessageBody[UplinkNonUEAssociatedLPPaTransport](ProcUplinkNonUEAssociatedLPPaTransport, uplinkNonUEAssociatedLPPaTransportIEs, value) +} diff --git a/s1ap/lppa_transport_test.go b/s1ap/lppa_transport_test.go index 4be85a56e9..b422256656 100644 --- a/s1ap/lppa_transport_test.go +++ b/s1ap/lppa_transport_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const ( @@ -156,11 +157,11 @@ func TestLPPaTransportUnknownIE(t *testing.T) { w.WriteBit(false) fields := []ieField{ - {id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(9)}, - {id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(9)}, - {id: IDRoutingID, crit: CriticalityReject, val: RoutingID(0)}, - {id: IDLPPaPDU, crit: CriticalityReject, val: LPPaPDU{0x01}}, - {id: 999, crit: CriticalityIgnore, raw: []byte{0xaa}}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(9)}, + {ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(9)}, + {ID: IDRoutingID, Criticality: CriticalityReject, Value: RoutingID(0)}, + {ID: IDLPPaPDU, Criticality: CriticalityReject, Value: LPPaPDU{0x01}}, + {ID: 999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xaa})}, } if err := encodeIEContainer(w, per.Aligned, fields); err != nil { @@ -184,8 +185,8 @@ func TestLPPaTransportMissingMandatoryIE(t *testing.T) { // MME-UE-S1AP-ID and eNB-UE-S1AP-ID only; Routing-ID and LPPa-PDU omitted. fields := []ieField{ - {id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(1)}, - {id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(1)}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(1)}, + {ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(1)}, } if err := encodeIEContainer(w, per.Aligned, fields); err != nil { diff --git a/s1ap/mme_config_update.go b/s1ap/mme_config_update.go index 64f4fe4ce1..176be2725a 100644 --- a/s1ap/mme_config_update.go +++ b/s1ap/mme_config_update.go @@ -17,20 +17,20 @@ type MMEConfigurationUpdate struct { var mMEConfigurationUpdateIEs = []ieSpec[MMEConfigurationUpdate]{ { - id: IDMMEname, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *MMEConfigurationUpdate, raw []byte, enc per.Encoding) error { + ID: IDMMEname, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *MMEConfigurationUpdate, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { name := string(n) m.MMEName = &name } return err }, - encode: func(m *MMEConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *MMEConfigurationUpdate) (per.Marshaler, bool) { if m.MMEName == nil { return nil, false } @@ -39,11 +39,11 @@ var mMEConfigurationUpdateIEs = []ieSpec[MMEConfigurationUpdate]{ }, }, { - id: IDServedGUMMEIs, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *MMEConfigurationUpdate, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ServedGUMMEIs) + ID: IDServedGUMMEIs, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *MMEConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ServedGUMMEIs) }, - encode: func(m *MMEConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *MMEConfigurationUpdate) (per.Marshaler, bool) { if len(m.ServedGUMMEIs) == 0 { return nil, false } @@ -52,9 +52,9 @@ var mMEConfigurationUpdateIEs = []ieSpec[MMEConfigurationUpdate]{ }, }, { - id: IDRelativeMMECapacity, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *MMEConfigurationUpdate, raw []byte, enc per.Encoding) error { - v, err := per.DecodeInteger(per.NewReader(raw), enc, relativeMMECapacityBounds) + ID: IDRelativeMMECapacity, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *MMEConfigurationUpdate, r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, relativeMMECapacityBounds) if err != nil { return err } @@ -64,7 +64,7 @@ var mMEConfigurationUpdateIEs = []ieSpec[MMEConfigurationUpdate]{ return nil }, - encode: func(m *MMEConfigurationUpdate) (per.Marshaler, bool) { + Encode: func(m *MMEConfigurationUpdate) (per.Marshaler, bool) { if m.RelativeMMECapacity == nil { return nil, false } @@ -100,6 +100,10 @@ func ParseMMEConfigurationUpdate(value []byte) (*MMEConfigurationUpdate, error) return parseMessageBody[MMEConfigurationUpdate](ProcMMEConfigurationUpdate, TriggeringInitiatingMessage, mMEConfigurationUpdateIEs, value) } +func DecodeMMEConfigurationUpdate(value []byte) (*MMEConfigurationUpdate, error) { + return decodeMessageBody[MMEConfigurationUpdate](ProcMMEConfigurationUpdate, mMEConfigurationUpdateIEs, value) +} + type MMEConfigurationUpdateAcknowledge struct { CriticalityDiagnostics *CriticalityDiagnostics @@ -108,11 +112,11 @@ type MMEConfigurationUpdateAcknowledge struct { var mMEConfigurationUpdateAcknowledgeIEs = []ieSpec[MMEConfigurationUpdateAcknowledge]{ { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *MMEConfigurationUpdateAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *MMEConfigurationUpdateAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -120,7 +124,7 @@ var mMEConfigurationUpdateAcknowledgeIEs = []ieSpec[MMEConfigurationUpdateAcknow return nil }, - encode: func(m *MMEConfigurationUpdateAcknowledge) (per.Marshaler, bool) { + Encode: func(m *MMEConfigurationUpdateAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -154,6 +158,10 @@ func ParseMMEConfigurationUpdateAcknowledge(value []byte) (*MMEConfigurationUpda return parseMessageBody[MMEConfigurationUpdateAcknowledge](ProcMMEConfigurationUpdate, TriggeringSuccessfulOutcome, mMEConfigurationUpdateAcknowledgeIEs, value) } +func DecodeMMEConfigurationUpdateAcknowledge(value []byte) (*MMEConfigurationUpdateAcknowledge, error) { + return decodeMessageBody[MMEConfigurationUpdateAcknowledge](ProcMMEConfigurationUpdate, mMEConfigurationUpdateAcknowledgeIEs, value) +} + type MMEConfigurationUpdateFailure struct { Cause *Cause TimeToWait *TimeToWait @@ -164,11 +172,11 @@ type MMEConfigurationUpdateFailure struct { var mMEConfigurationUpdateFailureIEs = []ieSpec[MMEConfigurationUpdateFailure]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *MMEConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *MMEConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -176,7 +184,7 @@ var mMEConfigurationUpdateFailureIEs = []ieSpec[MMEConfigurationUpdateFailure]{ return nil }, - encode: func(m *MMEConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *MMEConfigurationUpdateFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -185,11 +193,11 @@ var mMEConfigurationUpdateFailureIEs = []ieSpec[MMEConfigurationUpdateFailure]{ }, }, { - id: IDTimeToWait, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *MMEConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDTimeToWait, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *MMEConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var ttw TimeToWait - if err := perIEDecode(raw, &ttw); err != nil { + if err := decodeIE(r, &ttw); err != nil { return err } @@ -197,7 +205,7 @@ var mMEConfigurationUpdateFailureIEs = []ieSpec[MMEConfigurationUpdateFailure]{ return nil }, - encode: func(m *MMEConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *MMEConfigurationUpdateFailure) (per.Marshaler, bool) { if m.TimeToWait == nil { return nil, false } @@ -206,11 +214,11 @@ var mMEConfigurationUpdateFailureIEs = []ieSpec[MMEConfigurationUpdateFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *MMEConfigurationUpdateFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *MMEConfigurationUpdateFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -218,7 +226,7 @@ var mMEConfigurationUpdateFailureIEs = []ieSpec[MMEConfigurationUpdateFailure]{ return nil }, - encode: func(m *MMEConfigurationUpdateFailure) (per.Marshaler, bool) { + Encode: func(m *MMEConfigurationUpdateFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -251,3 +259,7 @@ func (m *MMEConfigurationUpdateFailure) Marshal() ([]byte, error) { func ParseMMEConfigurationUpdateFailure(value []byte) (*MMEConfigurationUpdateFailure, error) { return parseMessageBody[MMEConfigurationUpdateFailure](ProcMMEConfigurationUpdate, TriggeringUnsuccessfulOutcome, mMEConfigurationUpdateFailureIEs, value) } + +func DecodeMMEConfigurationUpdateFailure(value []byte) (*MMEConfigurationUpdateFailure, error) { + return decodeMessageBody[MMEConfigurationUpdateFailure](ProcMMEConfigurationUpdate, mMEConfigurationUpdateFailureIEs, value) +} diff --git a/s1ap/mme_config_update_test.go b/s1ap/mme_config_update_test.go index 0fd93b3f17..2f12c4f871 100644 --- a/s1ap/mme_config_update_test.go +++ b/s1ap/mme_config_update_test.go @@ -108,7 +108,7 @@ func TestMMEConfigurationUpdateFailureRoundTrips(t *testing.T) { ttw := TimeToWait(1) in := &MMEConfigurationUpdateFailure{ - Cause: Ptr(Cause{Group: CauseGroupProtocol, Value: CauseProtocolSemanticError}), + Cause: Ptr(CauseProtocolSemanticError.Cause()), TimeToWait: &ttw, } @@ -132,7 +132,7 @@ func TestMMEConfigurationUpdateFailureRoundTrips(t *testing.T) { t.Fatal(err) } - if out.Cause == nil || out.Cause.Group != CauseGroupProtocol || out.Cause.Value != CauseProtocolSemanticError { + if out.Cause == nil || !out.Cause.Equal(CauseProtocolSemanticError.Cause()) { t.Fatalf("cause mismatch: %+v", out.Cause) } diff --git a/s1ap/names_test.go b/s1ap/names_test.go index ccc6fa1a2b..2f608b94b0 100644 --- a/s1ap/names_test.go +++ b/s1ap/names_test.go @@ -3,7 +3,11 @@ package s1ap -import "testing" +import ( + "testing" + + "github.com/ellanetworks/core/per" +) func TestProcedureCodeString(t *testing.T) { for _, tc := range []struct { @@ -40,12 +44,12 @@ func TestCauseString(t *testing.T) { in Cause want string }{ - {Cause{Group: CauseGroupRadioNetwork, Value: 0}, "radioNetwork: unspecified (0)"}, - {Cause{Group: CauseGroupNAS, Value: CauseNASDetach}, "nas: detach (2)"}, + {CauseRadioNetworkUnspecified.Cause(), "radioNetwork: unspecified (0)"}, + {CauseNASDetach.Cause(), "nas: detach (2)"}, // An extension addition's index continues after the root values. - {Cause{Group: CauseGroupRadioNetwork, Value: 4, Extended: true}, "radioNetwork: n26-interface-not-available (40)"}, - {Cause{Group: CauseGroupRadioNetwork, Value: 99}, "radioNetwork: unknown (99)"}, - {Cause{Group: CauseGroup(9), Value: 1}, "group-9: value-1"}, + {CauseRadioNetworkN26InterfaceNotAvailable.Cause(), "radioNetwork: n26-interface-not-available (40)"}, + {CauseRadioNetwork(99).Cause(), "radioNetwork: unknown (99)"}, + {Cause{Ext: &per.ExtensionAlternative{Index: 1}}, "extension-1"}, } { if got := tc.in.String(); got != tc.want { t.Errorf("String() = %q, want %q", got, tc.want) @@ -57,7 +61,7 @@ func TestAbstractSyntaxErrorMessage(t *testing.T) { err := &AbstractSyntaxError{ Procedure: ProcS1Setup, Trigger: TriggeringInitiatingMessage, - Cause: Cause{Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject}, + Cause: CauseProtocolAbstractSyntaxErrorReject.Cause(), IEs: []CriticalityDiagnosticsIEItem{ {IEID: IDGlobalENBID, IECriticality: CriticalityReject, TypeOfError: TypeOfErrorMissing}, {IEID: IDSupportedTAs, IECriticality: CriticalityReject, TypeOfError: TypeOfErrorNotUnderstood}, diff --git a/s1ap/nas_non_delivery.go b/s1ap/nas_non_delivery.go index 486d4e747b..2342ceb81f 100644 --- a/s1ap/nas_non_delivery.go +++ b/s1ap/nas_non_delivery.go @@ -19,23 +19,23 @@ type NASNonDeliveryIndication struct { var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { - if err := perIEDecode(raw, &m.NASPDU); err != nil { + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { + if err := decodeIE(r, &m.NASPDU); err != nil { return err } @@ -45,7 +45,7 @@ var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ return nil }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -54,11 +54,11 @@ var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *NASNonDeliveryIndication, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *NASNonDeliveryIndication, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -66,7 +66,7 @@ var nASNonDeliveryIndicationIEs = []ieSpec[NASNonDeliveryIndication]{ return nil }, - encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { + Encode: func(m *NASNonDeliveryIndication) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -99,3 +99,7 @@ func (m *NASNonDeliveryIndication) encodeBody(w *per.Writer, enc per.Encoding) e func ParseNASNonDeliveryIndication(value []byte) (*NASNonDeliveryIndication, error) { return parseMessageBody[NASNonDeliveryIndication](ProcNASNonDeliveryIndication, TriggeringInitiatingMessage, nASNonDeliveryIndicationIEs, value) } + +func DecodeNASNonDeliveryIndication(value []byte) (*NASNonDeliveryIndication, error) { + return decodeMessageBody[NASNonDeliveryIndication](ProcNASNonDeliveryIndication, nASNonDeliveryIndicationIEs, value) +} diff --git a/s1ap/nas_non_delivery_test.go b/s1ap/nas_non_delivery_test.go index 6b06bf2c04..a8cfb20dc1 100644 --- a/s1ap/nas_non_delivery_test.go +++ b/s1ap/nas_non_delivery_test.go @@ -13,7 +13,7 @@ func TestNASNonDeliveryIndicationRoundTrip(t *testing.T) { MMEUES1APID: 42, ENBUES1APID: 1, NASPDU: NASPDU{0x7E, 0x00, 0x42}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnknownMMEUES1APID}), + Cause: Ptr(CauseRadioNetworkUnknownMMEUES1APID.Cause()), } b, err := in.Marshal() @@ -37,7 +37,7 @@ func TestNASNonDeliveryIndicationRoundTrip(t *testing.T) { } if out.MMEUES1APID != in.MMEUES1APID || out.ENBUES1APID != in.ENBUES1APID || - deref(out.Cause) != deref(in.Cause) || !bytes.Equal(out.NASPDU, in.NASPDU) { + !deref(out.Cause).Equal(deref(in.Cause)) || !bytes.Equal(out.NASPDU, in.NASPDU) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } } @@ -58,7 +58,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { "minimal", &NASNonDeliveryIndication{ MMEUES1APID: 1, ENBUES1APID: 1, NASPDU: NASPDU{0x7e, 0x00}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnspecified}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), }, goldenNASNonDelivery, }, @@ -69,7 +69,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { &NASNonDeliveryIndication{ MMEUES1APID: 0xffffffff, ENBUES1APID: 0xffffff, NASPDU: NASPDU{0x7e, 0x01, 0x02, 0x03, 0x04}, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkUnknownPairUES1APID}), + Cause: Ptr(CauseRadioNetworkUnknownPairUES1APID.Cause()), }, goldenNASNonDeliveryWideIDs, }, @@ -77,7 +77,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { "nas cause group", &NASNonDeliveryIndication{ MMEUES1APID: 42, ENBUES1APID: 7, NASPDU: NASPDU{0x7e}, - Cause: Ptr(Cause{Group: CauseGroupNAS, Value: CauseNASDetach}), + Cause: Ptr(CauseNASDetach.Cause()), }, goldenNASNonDeliveryNASCause, }, @@ -105,7 +105,7 @@ func TestNASNonDeliveryIndicationGolden(t *testing.T) { } if out.MMEUES1APID != tt.msg.MMEUES1APID || out.ENBUES1APID != tt.msg.ENBUES1APID || - deref(out.Cause) != deref(tt.msg.Cause) || !bytes.Equal(out.NASPDU, tt.msg.NASPDU) { + !deref(out.Cause).Equal(deref(tt.msg.Cause)) || !bytes.Equal(out.NASPDU, tt.msg.NASPDU) { t.Fatalf("decode mismatch:\n got %+v\n want %+v", out, tt.msg) } }) @@ -120,15 +120,15 @@ func TestNASNonDeliveryIndicationMissingIEs(t *testing.T) { } if _, err := ParseNASNonDeliveryIndication(container(t, - ieField{id: IDNASPDU, crit: CriticalityIgnore, val: NASPDU{0x7e}}, - ieField{id: IDCause, crit: CriticalityIgnore, val: Cause{Group: CauseGroupNAS, Value: CauseNASDetach}}, + ieField{ID: IDNASPDU, Criticality: CriticalityIgnore, Value: NASPDU{0x7e}}, + ieField{ID: IDCause, Criticality: CriticalityIgnore, Value: Ptr(CauseNASDetach.Cause())}, )); err == nil { t.Error("decoded a message with neither UE id, want it rejected") } msg, err := ParseNASNonDeliveryIndication(container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(42)}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(7)}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(42)}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(7)}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -141,7 +141,7 @@ func TestNASNonDeliveryIndicationMissingIEs(t *testing.T) { var missing int for _, ie := range msg.Diagnostics().IEs { - if ie.TypeOfError == TypeOfErrorMissing && (ie.ID == IDNASPDU || ie.ID == IDCause) { + if typeOfError(ie) == TypeOfErrorMissing && (ie.ID == IDNASPDU || ie.ID == IDCause) { missing++ } } diff --git a/s1ap/nas_transport.go b/s1ap/nas_transport.go index 13078cefc8..4707bb84cf 100644 --- a/s1ap/nas_transport.go +++ b/s1ap/nas_transport.go @@ -9,31 +9,35 @@ import ( // TS 36.413 §9.1.7.1. type InitialUEMessage struct { - ENBUES1APID ENBUES1APID - NASPDU NASPDU - TAI TAI - EUTRANCGI *EUTRANCGI - RRCEstablishmentCause *RRCEstablishmentCause - STMSI *STMSI // present when the UE re-establishes with an S-TMSI - GUMMEI *GUMMEI // the eNB-selected MME, present when the eNB does not run NNSF + ENBUES1APID ENBUES1APID + NASPDU NASPDU + TAI TAI + EUTRANCGI *EUTRANCGI + RRCEstablishmentCause *RRCEstablishmentCause + STMSI *STMSI // present when the UE re-establishes with an S-TMSI + GUMMEI *GUMMEI // the eNB-selected MME, present when the eNB does not run NNSF + GWTransportLayerAddress *TransportLayerAddress + TunnelInformationForBBF *TunnelInformation + SIPTOLGWTransportLayerAddress *TransportLayerAddress + CoarseUELocationRequested *CoarseUELocationRequested messageMeta } var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -42,18 +46,18 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDTAI, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.TAI) + ID: IDTAI, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TAI) }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.TAI, true }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return &m.TAI, true }, }, { - id: IDEUTRANCGI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDEUTRANCGI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v EUTRANCGI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -61,7 +65,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.EUTRANCGI == nil { return nil, false } @@ -70,11 +74,11 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDRRCEstablishmentCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDRRCEstablishmentCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var v RRCEstablishmentCause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -82,7 +86,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.RRCEstablishmentCause == nil { return nil, false } @@ -91,14 +95,14 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDSTMSI, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDSTMSI, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var ( err error stmsi STMSI ) - err = perIEDecode(raw, &stmsi) + err = decodeIE(r, &stmsi) if err != nil { return err } @@ -107,7 +111,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.STMSI == nil { return nil, false } @@ -116,14 +120,14 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, }, { - id: IDGUMMEI, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *InitialUEMessage, raw []byte, enc per.Encoding) error { + ID: IDGUMMEI, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { var ( err error gummei GUMMEI ) - err = perIEDecode(raw, &gummei) + err = decodeIE(r, &gummei) if err != nil { return err } @@ -132,7 +136,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return nil }, - encode: func(m *InitialUEMessage) (per.Marshaler, bool) { + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { if m.GUMMEI == nil { return nil, false } @@ -140,6 +144,34 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return m.GUMMEI, true }, }, + { + ID: IDGWTransportLayerAddress, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.GWTransportLayerAddress) + }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return optionalIE(m.GWTransportLayerAddress) }, + }, + { + ID: IDTunnelInformationForBBF, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TunnelInformationForBBF) + }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return optionalIE(m.TunnelInformationForBBF) }, + }, + { + ID: IDSIPTOLGWTransportLayerAddress, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.SIPTOLGWTransportLayerAddress) + }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return optionalIE(m.SIPTOLGWTransportLayerAddress) }, + }, + { + ID: IDCoarseUELocationRequested, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CoarseUELocationRequested) + }, + Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return optionalIE(m.CoarseUELocationRequested) }, + }, } func (m *InitialUEMessage) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -166,42 +198,48 @@ func ParseInitialUEMessage(value []byte) (*InitialUEMessage, error) { return parseMessageBody[InitialUEMessage](ProcInitialUEMessage, TriggeringInitiatingMessage, initialUEMessageIEs, value) } +func DecodeInitialUEMessage(value []byte) (*InitialUEMessage, error) { + return decodeMessageBody[InitialUEMessage](ProcInitialUEMessage, initialUEMessageIEs, value) +} + // TS 36.413 §9.1.7.3. type UplinkNASTransport struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - NASPDU NASPDU - EUTRANCGI *EUTRANCGI - TAI *TAI + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + NASPDU NASPDU + EUTRANCGI *EUTRANCGI + TAI *TAI + GWTransportLayerAddress *TransportLayerAddress + SIPTOLGWTransportLayerAddress *TransportLayerAddress messageMeta } var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { // NAS-PDU is an unconstrained OCTET STRING, so a zero-length value is a // legal thing to carry and nil means absent, not empty: the guard below // must test the slice's nil-ness, not its length, or a relayed empty // container would be dropped. - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -210,11 +248,11 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ }, }, { - id: IDEUTRANCGI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { + ID: IDEUTRANCGI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { var v EUTRANCGI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -222,7 +260,7 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ return nil }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { if m.EUTRANCGI == nil { return nil, false } @@ -231,11 +269,11 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ }, }, { - id: IDTAI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UplinkNASTransport, raw []byte, enc per.Encoding) error { + ID: IDTAI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { var v TAI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -243,7 +281,7 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ return nil }, - encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { if m.TAI == nil { return nil, false } @@ -251,6 +289,20 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ return m.TAI, true }, }, + { + ID: IDGWTransportLayerAddress, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.GWTransportLayerAddress) + }, + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return optionalIE(m.GWTransportLayerAddress) }, + }, + { + ID: IDSIPTOLGWTransportLayerAddress, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UplinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.SIPTOLGWTransportLayerAddress) + }, + Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return optionalIE(m.SIPTOLGWTransportLayerAddress) }, + }, } func (m *UplinkNASTransport) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -277,36 +329,41 @@ func ParseUplinkNASTransport(value []byte) (*UplinkNASTransport, error) { return parseMessageBody[UplinkNASTransport](ProcUplinkNASTransport, TriggeringInitiatingMessage, uplinkNASTransportIEs, value) } +func DecodeUplinkNASTransport(value []byte) (*UplinkNASTransport, error) { + return decodeMessageBody[UplinkNASTransport](ProcUplinkNASTransport, uplinkNASTransportIEs, value) +} + // TS 36.413 §9.1.7.2. type DownlinkNASTransport struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - NASPDU NASPDU + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + NASPDU NASPDU + CoarseUELocation *CoarseUELocation messageMeta } var downlinkNASTransportIEs = []ieSpec[DownlinkNASTransport]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDNASPDU, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *DownlinkNASTransport, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.NASPDU) + ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.NASPDU) }, - encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { + Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { if m.NASPDU == nil { return nil, false } @@ -314,6 +371,13 @@ var downlinkNASTransportIEs = []ieSpec[DownlinkNASTransport]{ return &m.NASPDU, true }, }, + { + ID: IDCoarseUELocation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CoarseUELocation) + }, + Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return optionalIE(m.CoarseUELocation) }, + }, } func (m *DownlinkNASTransport) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -339,3 +403,7 @@ func (m *DownlinkNASTransport) Marshal() ([]byte, error) { func ParseDownlinkNASTransport(value []byte) (*DownlinkNASTransport, error) { return parseMessageBody[DownlinkNASTransport](ProcDownlinkNASTransport, TriggeringInitiatingMessage, downlinkNASTransportIEs, value) } + +func DecodeDownlinkNASTransport(value []byte) (*DownlinkNASTransport, error) { + return decodeMessageBody[DownlinkNASTransport](ProcDownlinkNASTransport, downlinkNASTransportIEs, value) +} diff --git a/s1ap/nas_transport_test.go b/s1ap/nas_transport_test.go index 147ec270bc..66b887e4ce 100644 --- a/s1ap/nas_transport_test.go +++ b/s1ap/nas_transport_test.go @@ -262,16 +262,16 @@ func TestUplinkNASTransportMissingIEs(t *testing.T) { } if _, err := ParseUplinkNASTransport(container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(42)}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(7)}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(42)}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(7)}, )); err == nil { t.Error("decoded a message with no NAS-PDU, want it rejected") } msg, err := ParseUplinkNASTransport(container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(42)}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(7)}, - ieField{id: IDNASPDU, crit: CriticalityReject, val: NASPDU{0x07}}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(42)}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(7)}, + ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x07}}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -284,7 +284,7 @@ func TestUplinkNASTransportMissingIEs(t *testing.T) { var missing int for _, ie := range msg.Diagnostics().IEs { - if ie.TypeOfError == TypeOfErrorMissing && (ie.ID == IDEUTRANCGI || ie.ID == IDTAI) { + if typeOfError(ie) == TypeOfErrorMissing && (ie.ID == IDEUTRANCGI || ie.ID == IDTAI) { missing++ } } @@ -363,8 +363,8 @@ func TestDownlinkNASTransportMissingIEs(t *testing.T) { } if _, err := ParseDownlinkNASTransport(container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: MMEUES1APID(42)}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: ENBUES1APID(7)}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: MMEUES1APID(42)}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(7)}, )); err == nil { t.Error("decoded a message with no NAS-PDU, want it rejected") } diff --git a/s1ap/overload.go b/s1ap/overload.go index 01d16d7a67..747c786a55 100644 --- a/s1ap/overload.go +++ b/s1ap/overload.go @@ -4,8 +4,6 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -21,51 +19,15 @@ const ( OverloadActionRejectDelayTolerantAccess OverloadActionPermitHighPrioritySessionsAndExceptionReportingAndMobileTerminatedServicesOnly OverloadActionNotAcceptMODataOrDelayTolerantAccessFromCPCIoT - - overloadActionRootCount = 3 - overloadActionValueCount = 7 ) type OverloadResponse struct { - OverloadAction OverloadAction -} - -func (o OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { - if o.OverloadAction >= overloadActionValueCount { - return fmt.Errorf("s1ap: OverloadAction %d is not defined", o.OverloadAction) - } - - w.WriteBit(false) - - return per.EncodeEnumerated(w, enc, overloadActionRootCount, true, int64(o.OverloadAction)) -} - -func (o *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return fmt.Errorf("s1ap: OverloadResponse choice: %w", err) - } - - if isExt { - return fmt.Errorf("%w: OverloadResponse extension alternative", errNotComprehended) - } - - v, err := per.DecodeEnumerated(r, enc, overloadActionRootCount, true) - if err != nil { - return fmt.Errorf("s1ap: OverloadAction: %w", err) - } - - if v >= overloadActionValueCount { - return fmt.Errorf("%w: OverloadAction extension value %d", errNotComprehended, v) - } - - *o = OverloadResponse{OverloadAction: OverloadAction(v)} - - return nil + OverloadAction *OverloadAction `per:",choice:0"` + Ext *per.ExtensionAlternative `per:",extalt"` } -func decodeGUMMEIList(raw []byte, enc per.Encoding) ([]GUMMEI, error) { - return unmarshalSeqOf[GUMMEI](per.NewReader(raw), enc, 1, maxnoofMMECs) +func decodeGUMMEIList(r *per.Reader, enc per.Encoding) ([]GUMMEI, error) { + return unmarshalSeqOf[GUMMEI](r, enc, 1, maxnoofMMECs) } func gUMMEIListIE(l []GUMMEI) (per.Marshaler, bool) { @@ -73,9 +35,7 @@ func gUMMEIListIE(l []GUMMEI) (per.Marshaler, bool) { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofMMECs, l) - }), true + return seqOf(1, maxnoofMMECs, l), true } type OverloadStart struct { @@ -88,29 +48,29 @@ type OverloadStart struct { var overloadStartIEs = []ieSpec[OverloadStart]{ { - id: IDOverloadResponse, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.OverloadResponse) + ID: IDOverloadResponse, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *OverloadStart, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.OverloadResponse) }, - encode: func(m *OverloadStart) (per.Marshaler, bool) { return &m.OverloadResponse, true }, + Encode: func(m *OverloadStart) (per.Marshaler, bool) { return &m.OverloadResponse, true }, }, { - id: IDGUMMEIList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { + ID: IDGUMMEIList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *OverloadStart, r *per.Reader, enc per.Encoding) error { var err error - m.GUMMEIList, err = decodeGUMMEIList(raw, enc) + m.GUMMEIList, err = decodeGUMMEIList(r, enc) return err }, - encode: func(m *OverloadStart) (per.Marshaler, bool) { return gUMMEIListIE(m.GUMMEIList) }, + Encode: func(m *OverloadStart) (per.Marshaler, bool) { return gUMMEIListIE(m.GUMMEIList) }, }, { - id: IDTrafficLoadReductionIndication, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *OverloadStart, raw []byte, enc per.Encoding) error { - return decodeOptionalInteger(raw, trafficLoadReductionIndicationBounds, &m.TrafficLoadReductionIndication) + ID: IDTrafficLoadReductionIndication, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *OverloadStart, r *per.Reader, enc per.Encoding) error { + return decodeOptionalInteger(r, trafficLoadReductionIndicationBounds, &m.TrafficLoadReductionIndication) }, - encode: func(m *OverloadStart) (per.Marshaler, bool) { + Encode: func(m *OverloadStart) (per.Marshaler, bool) { if m.TrafficLoadReductionIndication == nil { return nil, false } @@ -144,6 +104,10 @@ func ParseOverloadStart(value []byte) (*OverloadStart, error) { return parseMessageBody[OverloadStart](ProcOverloadStart, TriggeringInitiatingMessage, overloadStartIEs, value) } +func DecodeOverloadStart(value []byte) (*OverloadStart, error) { + return decodeMessageBody[OverloadStart](ProcOverloadStart, overloadStartIEs, value) +} + type OverloadStop struct { GUMMEIList []GUMMEI @@ -152,15 +116,15 @@ type OverloadStop struct { var overloadStopIEs = []ieSpec[OverloadStop]{ { - id: IDGUMMEIList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *OverloadStop, raw []byte, enc per.Encoding) error { + ID: IDGUMMEIList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *OverloadStop, r *per.Reader, enc per.Encoding) error { var err error - m.GUMMEIList, err = decodeGUMMEIList(raw, enc) + m.GUMMEIList, err = decodeGUMMEIList(r, enc) return err }, - encode: func(m *OverloadStop) (per.Marshaler, bool) { return gUMMEIListIE(m.GUMMEIList) }, + Encode: func(m *OverloadStop) (per.Marshaler, bool) { return gUMMEIListIE(m.GUMMEIList) }, }, } @@ -187,3 +151,7 @@ func (m *OverloadStop) Marshal() ([]byte, error) { func ParseOverloadStop(value []byte) (*OverloadStop, error) { return parseMessageBody[OverloadStop](ProcOverloadStop, TriggeringInitiatingMessage, overloadStopIEs, value) } + +func DecodeOverloadStop(value []byte) (*OverloadStop, error) { + return decodeMessageBody[OverloadStop](ProcOverloadStop, overloadStopIEs, value) +} diff --git a/s1ap/paging.go b/s1ap/paging.go index c0135f404f..3e23ddd221 100644 --- a/s1ap/paging.go +++ b/s1ap/paging.go @@ -4,19 +4,11 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) const ( maxnoofTAIs = 256 - - // CNDomain ::= ENUMERATED { ps, cs } (non-extensible, TS 36.413). - cnDomainRootCount = 2 - // UEPagingID ::= CHOICE { s-TMSI, iMSI, ... } (extensible). - uePagingIDRootCount = 2 - uePagingIDChoiceSTMSI = 0 ) // Ella Core pages the PS domain. @@ -39,17 +31,15 @@ const ( PagingPriorityLevel6 PagingPriorityLevel7 PagingPriorityLevel8 - - pagingPriorityRootCount = 8 ) // TS 36.413 §9.1.6. type Paging struct { UEIdentityIndexValue *uint16 - STMSI *STMSI + UEPagingID *UEPagingID PagingDRX *PagingDRX CNDomain *CNDomain - TAIList []TAI + TAIList TAIList PagingPriority *PagingPriority // The eNB-reported paging-specific capability; when set, the eNB may use it // to apply specific paging schemes. @@ -58,11 +48,44 @@ type Paging struct { messageMeta } -// taiItem ::= SEQUENCE { tAI TAI, iE-Extensions OPTIONAL, ... }. -type taiItem struct { - _ [0]struct{} `per:"extseq"` - TAI TAI - _ ieExtensions `per:",skip"` +// TAIItem ::= SEQUENCE { tAI TAI, iE-Extensions OPTIONAL, ... }. +type TAIItem struct { + extensions per.ExtensionAdditions `per:",extraw"` + TAI TAI + iEExtensions extensionMeta `per:",exttable"` + containerCrit `per:"-"` +} + +type TAIList []TAIItem + +func (l TAIList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofTAIs, IDTAIItem, CriticalityIgnore, l) +} + +func (l *TAIList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[TAIItem](r, enc, maxnoofTAIs, IDTAIItem, CriticalityIgnore) + *l = items + + return err +} + +type UEPagingID struct { + STMSI *STMSI `per:",choice:0"` + IMSI *IMSI `per:",choice:1"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +type IMSI []byte + +func (i IMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 3, 8, true, true, false, i) +} + +func (i *IMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 3, 8, true, true, false) + *i = b + + return err } // UE-Identity-Index-value ::= BIT STRING (SIZE(10)) — §9.2.3.10. @@ -70,9 +93,9 @@ const ueIdentityIndexValueBits = 10 var pagingIEs = []ieSpec[Paging]{ { - id: IDUEIdentityIndexValue, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - n, err := decodeBitStringUint(per.NewReader(raw), enc, ueIdentityIndexValueBits) + ID: IDUEIdentityIndexValue, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, ueIdentityIndexValueBits) if err != nil { return err } @@ -82,7 +105,7 @@ var pagingIEs = []ieSpec[Paging]{ return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if m.UEIdentityIndexValue == nil { return nil, false } @@ -93,59 +116,18 @@ var pagingIEs = []ieSpec[Paging]{ }, }, { - id: IDUEPagingID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - sub := per.NewReader(raw) - - isExt, err := sub.ReadBit() - if err != nil { - return err - } - - if isExt { - return fmt.Errorf("%w: UE paging identity extension alternative", errNotComprehended) - } - - index, err := per.DecodeConstrainedWholeNumber(sub, enc, 0, uePagingIDRootCount-1) - if err != nil { - return err - } - - if index != uePagingIDChoiceSTMSI { - return fmt.Errorf("%w: UE paging identity choice %d", errNotComprehended, index) - } - - var v STMSI - if err := v.UnmarshalPER(sub, enc); err != nil { - return err - } - - m.STMSI = &v - - return nil - }, - encode: func(m *Paging) (per.Marshaler, bool) { - if m.STMSI == nil { - return nil, false - } - - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, uePagingIDRootCount-1, uePagingIDChoiceSTMSI); err != nil { - return err - } - - return m.STMSI.MarshalPER(w, enc) - }), true + ID: IDUEPagingID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.UEPagingID) }, + Encode: func(m *Paging) (per.Marshaler, bool) { return optionalIE(m.UEPagingID) }, }, { - id: IDPagingDRX, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { + ID: IDPagingDRX, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { var drx PagingDRX - if err := perIEDecode(raw, &drx); err != nil { + if err := decodeIE(r, &drx); err != nil { return err } @@ -153,7 +135,7 @@ var pagingIEs = []ieSpec[Paging]{ return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if m.PagingDRX == nil { return nil, false } @@ -162,91 +144,55 @@ var pagingIEs = []ieSpec[Paging]{ }, }, { - id: IDCNDomain, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - index, err := per.DecodeEnumerated(per.NewReader(raw), enc, cnDomainRootCount, false) - if err != nil { - return err - } - - v := CNDomain(index) - m.CNDomain = &v - - return nil - }, - encode: func(m *Paging) (per.Marshaler, bool) { - if m.CNDomain == nil { - return nil, false - } - - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return per.EncodeEnumerated(w, enc, cnDomainRootCount, false, int64(*m.CNDomain)) - }), true + ID: IDCNDomain, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CNDomain) }, + Encode: func(m *Paging) (per.Marshaler, bool) { return optionalIE(m.CNDomain) }, }, { - id: IDTAIList, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - items, err := decodeItemList[taiItem](per.NewReader(raw), enc, maxnoofTAIs, IDTAIItem, CriticalityIgnore) - if err != nil { - return err - } - - m.TAIList = make([]TAI, len(items)) - for i, it := range items { - m.TAIList[i] = it.TAI - } - - return nil + ID: IDTAIList, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.TAIList) }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if len(m.TAIList) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - items := make([]taiItem, len(m.TAIList)) - for i, tai := range m.TAIList { - items[i] = taiItem{TAI: tai} - } - - return encodeSingleContainerList(w, enc, maxnoofTAIs, IDTAIItem, CriticalityIgnore, items) - }), true + return &m.TAIList, true }, }, { - id: IDPagingPriority, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { - v, err := decodeRootEnumerated(per.NewReader(raw), enc, pagingPriorityRootCount, "PagingPriority") - if err != nil { + ID: IDPagingPriority, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { + var v PagingPriority + if err := v.UnmarshalPER(r, enc); err != nil { return err } - p := PagingPriority(v) - m.PagingPriority = &p + m.PagingPriority = &v return nil }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if m.PagingPriority == nil { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, pagingPriorityRootCount, int64(*m.PagingPriority), "PagingPriority") - }), true + return m.PagingPriority, true }, }, { - id: IDUERadioCapabilityForPaging, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *Paging, raw []byte, enc per.Encoding) error { + ID: IDUERadioCapabilityForPaging, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { var err error - m.UERadioCapabilityForPaging, err = per.DecodeOctetString(per.NewReader(raw), enc, 0, 0, true, false, false) + m.UERadioCapabilityForPaging, err = per.DecodeOctetString(r, enc, 0, 0, true, false, false) return err }, - encode: func(m *Paging) (per.Marshaler, bool) { + Encode: func(m *Paging) (per.Marshaler, bool) { if len(m.UERadioCapabilityForPaging) == 0 { return nil, false } @@ -281,3 +227,7 @@ func (m *Paging) Marshal() ([]byte, error) { func ParsePaging(value []byte) (*Paging, error) { return parseMessageBody[Paging](ProcPaging, TriggeringInitiatingMessage, pagingIEs, value) } + +func DecodePaging(value []byte) (*Paging, error) { + return decodeMessageBody[Paging](ProcPaging, pagingIEs, value) +} diff --git a/s1ap/paging_test.go b/s1ap/paging_test.go index 6e9b5ebd7a..208cd7edda 100644 --- a/s1ap/paging_test.go +++ b/s1ap/paging_test.go @@ -5,19 +5,19 @@ package s1ap import ( "bytes" - "reflect" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestPagingRoundtrip(t *testing.T) { in := &Paging{ UEIdentityIndexValue: Ptr(uint16(0x2a9)), // 10-bit value (IMSI mod 1024) - STMSI: &STMSI{MMEC: 0x01, MTMSI: 0xdeadbeef}, + UEPagingID: &UEPagingID{STMSI: &STMSI{MMEC: 0x01, MTMSI: 0xdeadbeef}}, CNDomain: Ptr(CNDomainPS), - TAIList: []TAI{ - {PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(0x0001)}, + TAIList: TAIList{ + {TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(0x0001)}}, }, UERadioCapabilityForPaging: []byte{0xaa, 0xbb, 0xcc}, } @@ -46,15 +46,15 @@ func TestPagingRoundtrip(t *testing.T) { t.Fatalf("UE identity index = %#x, want %#x", out.UEIdentityIndexValue, in.UEIdentityIndexValue) } - if deref(out.STMSI) != deref(in.STMSI) { - t.Fatalf("S-TMSI = %+v, want %+v", out.STMSI, in.STMSI) + if !out.UEPagingID.Equal(*in.UEPagingID) { + t.Fatalf("UE Paging ID = %+v, want %+v", out.UEPagingID, in.UEPagingID) } if deref(out.CNDomain) != CNDomainPS { t.Fatalf("CN domain = %d, want PS", out.CNDomain) } - if !reflect.DeepEqual(out.TAIList, in.TAIList) { + if !out.TAIList.Equal(in.TAIList) { t.Fatalf("TAI list = %+v, want %+v", out.TAIList, in.TAIList) } @@ -67,9 +67,9 @@ func TestPagingRoundtrip(t *testing.T) { func TestPagingOmitsRadioCapabilityForPaging(t *testing.T) { in := &Paging{ UEIdentityIndexValue: Ptr(uint16(0x2a9)), - STMSI: &STMSI{MMEC: 0x01, MTMSI: 0xdeadbeef}, + UEPagingID: &UEPagingID{STMSI: &STMSI{MMEC: 0x01, MTMSI: 0xdeadbeef}}, CNDomain: Ptr(CNDomainPS), - TAIList: []TAI{{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(0x0001)}}, + TAIList: TAIList{{TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(0x0001)}}}, } b, err := in.Marshal() @@ -97,10 +97,10 @@ func TestPagingDRXAndPriorityRoundTrip(t *testing.T) { // Mandatory in S1AP, with no 5G counterpart. in := &Paging{ UEIdentityIndexValue: Ptr(uint16(42)), - STMSI: &STMSI{MMEC: 1, MTMSI: 0xdeadbeef}, + UEPagingID: &UEPagingID{STMSI: &STMSI{MMEC: 1, MTMSI: 0xdeadbeef}}, PagingDRX: Ptr(PagingDRXv128), CNDomain: Ptr(CNDomainPS), - TAIList: []TAI{{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}, + TAIList: TAIList{{TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}}, PagingPriority: Ptr(PagingPriorityLevel3), } @@ -147,53 +147,64 @@ func TestPagingDRXAndPriorityRoundTrip(t *testing.T) { } } -// §9.2.3.13 makes UE Paging ID an extensible CHOICE of S-TMSI and IMSI. Only -// S-TMSI is modeled, so the rest must error rather than yield a zero identity; -// the IE is ignore, so §10.3.4.2 carries on with the message. -func TestUEPagingIDUnsupportedAlternativesAreIgnored(t *testing.T) { - taiList := per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofTAIs, IDTAIItem, CriticalityIgnore, - []taiItem{{TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}}) - }) +// §9.2.3.13 makes UE Paging ID an extensible CHOICE of S-TMSI and IMSI. Both +// root alternatives decode, and an extension alternative is kept verbatim and +// reported on the IE's ignore criticality, so §10.3.4.2 carries on with the +// message. +func TestUEPagingIDAlternatives(t *testing.T) { + taiList := &TAIList{{TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}} cases := []struct { name string - id per.Marshaler + id []byte + want UEPagingID }{ - { - // iMSI is root alternative 1. - "IMSI alternative", - per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) // not an extension - return per.EncodeConstrainedWholeNumber(w, enc, 0, uePagingIDRootCount-1, 1) - }), - }, - { - "extension alternative", - per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - w.WriteBit(true) // extension marker set - return nil - }), - }, + {"IMSI alternative", []byte{0x40, 0x21, 0x43, 0x65}, UEPagingID{IMSI: &IMSI{0x21, 0x43, 0x65}}}, + {"extension alternative", []byte{0x80, 0x01, 0x2a}, UEPagingID{Ext: &per.ExtensionAlternative{Index: 0, Value: "\x2a"}}}, } for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { - msg, err := ParsePaging(container(t, - ieField{id: IDUEPagingID, crit: CriticalityIgnore, val: tc.id}, - ieField{id: IDTAIList, crit: CriticalityIgnore, val: taiList}, + msg, err := DecodePaging(container(t, + ieField{ID: IDUEPagingID, Criticality: CriticalityIgnore, Value: ap.RawValue(tc.id)}, + ieField{ID: IDTAIList, Criticality: CriticalityIgnore, Value: taiList}, )) if err != nil { - t.Fatalf("parse: %v", err) - } - - if msg.STMSI != nil { - t.Errorf("STMSI = %+v, want nil for an unsupported alternative", msg.STMSI) + t.Fatalf("decode: %v", err) } if len(msg.TAIList) != 1 { t.Errorf("rest of the message lost: %+v", msg.TAIList) } + + if tc.want.Ext != nil { + if msg.UEPagingID != nil { + t.Fatalf("UEPagingID = %+v, want it kept raw", msg.UEPagingID) + } + + if err := msg.Diagnostics().Check(); err != nil { + t.Fatalf("an ignore IE must not fail the check: %v", err) + } + } else if msg.UEPagingID == nil || !msg.UEPagingID.Equal(tc.want) { + t.Fatalf("UEPagingID = %+v, want %+v", msg.UEPagingID, tc.want) + } + + out, err := msg.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(out) + if err != nil { + t.Fatal(err) + } + + if got := pdu.(*InitiatingMessage).Value; !bytes.Equal(got, container(t, + ieField{ID: IDUEPagingID, Criticality: CriticalityIgnore, Value: ap.RawValue(tc.id)}, + ieField{ID: IDTAIList, Criticality: CriticalityIgnore, Value: taiList}, + )) { + t.Fatalf("re-encoded body % x", got) + } }) } } @@ -204,7 +215,7 @@ func TestPagingTAIListBounds(t *testing.T) { base := func() *Paging { return &Paging{ UEIdentityIndexValue: Ptr(uint16(42)), - STMSI: &STMSI{MMEC: 1, MTMSI: 0xdeadbeef}, + UEPagingID: &UEPagingID{STMSI: &STMSI{MMEC: 1, MTMSI: 0xdeadbeef}}, CNDomain: Ptr(CNDomainPS), } } @@ -215,10 +226,10 @@ func TestPagingTAIListBounds(t *testing.T) { } m = base() - m.TAIList = make([]TAI, maxnoofTAIs+1) + m.TAIList = make(TAIList, maxnoofTAIs+1) for i := range m.TAIList { - m.TAIList[i] = TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(i)} + m.TAIList[i] = TAIItem{TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: TAC(i)}} } if _, err := m.Marshal(); err == nil { diff --git a/s1ap/parsers.go b/s1ap/parsers.go index c55682653a..82e7248534 100644 --- a/s1ap/parsers.go +++ b/s1ap/parsers.go @@ -59,6 +59,9 @@ var messageParsers = []messageParser{ {"ParseS1SetupFailure", func(v []byte) error { _, err := ParseS1SetupFailure(v); return err }}, {"ParseS1SetupRequest", func(v []byte) error { _, err := ParseS1SetupRequest(v); return err }}, {"ParseS1SetupResponse", func(v []byte) error { _, err := ParseS1SetupResponse(v); return err }}, + {"ParseS1RemovalRequest", func(v []byte) error { _, err := ParseS1RemovalRequest(v); return err }}, + {"ParseS1RemovalResponse", func(v []byte) error { _, err := ParseS1RemovalResponse(v); return err }}, + {"ParseS1RemovalFailure", func(v []byte) error { _, err := ParseS1RemovalFailure(v); return err }}, {"ParseUECapabilityInfoIndication", func(v []byte) error { _, err := ParseUECapabilityInfoIndication(v); return err }}, {"ParseUEContextModificationFailure", func(v []byte) error { _, err := ParseUEContextModificationFailure(v); return err }}, {"ParseUEContextModificationRequest", func(v []byte) error { _, err := ParseUEContextModificationRequest(v); return err }}, diff --git a/s1ap/path_switch.go b/s1ap/path_switch.go index a85b3ae92f..a6513f217d 100644 --- a/s1ap/path_switch.go +++ b/s1ap/path_switch.go @@ -14,67 +14,60 @@ type ERABToBeSwitchedDLItem struct { ERABID ERABID TransportLayerAddress TransportLayerAddress GTPTEID GTPTEID - SecurityIndication *SecurityIndication `per:"-"` - iEExtensions messageMeta `per:",exttable:eRABToBeSwitchedDLItemExtIEs"` + SecurityIndication *SecurityIndication `per:",extie:IDSecurityIndication,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` containerCrit `per:"-"` } -var eRABToBeSwitchedDLItemExtIEs = []ieSpec[ERABToBeSwitchedDLItem]{ - optionalExtension(IDSecurityIndication, CriticalityIgnore, func(m *ERABToBeSwitchedDLItem) **SecurityIndication { - return &m.SecurityIndication - }), -} - // TS 36.413 §9.1.5.8. type PathSwitchRequest struct { - ENBUES1APID ENBUES1APID - ERABToBeSwitchedDL ERABToBeSwitchedDLList - SourceMMEUES1APID MMEUES1APID - EUTRANCGI *EUTRANCGI - TAI *TAI - UESecurityCapabilities *UESecurityCapabilities - SourceMMEGUMMEI *GUMMEI + ENBUES1APID ENBUES1APID + ERABToBeSwitchedDL ERABToBeSwitchedDLList + SourceMMEUES1APID MMEUES1APID + EUTRANCGI *EUTRANCGI + TAI *TAI + UESecurityCapabilities *UESecurityCapabilities + SourceMMEGUMMEI *GUMMEI + TunnelInformationForBBF *TunnelInformation messageMeta } var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDERABToBeSwitchedDLList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDERABToBeSwitchedDLList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToBeSwitchedDL, err = decodeItemList[ERABToBeSwitchedDLItem](per.NewReader(raw), enc, maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject) + m.ERABToBeSwitchedDL, err = decodeItemList[ERABToBeSwitchedDLItem](r, enc, maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject) return err }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject, m.ERABToBeSwitchedDL) - }), true + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + return containerList(maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject, m.ERABToBeSwitchedDL), true }, }, { - id: IDSourceMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SourceMMEUES1APID) + ID: IDSourceMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SourceMMEUES1APID) }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.SourceMMEUES1APID, true }, + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return &m.SourceMMEUES1APID, true }, }, { - id: IDEUTRANCGI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDEUTRANCGI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var v EUTRANCGI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -82,7 +75,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return nil }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.EUTRANCGI == nil { return nil, false } @@ -91,11 +84,11 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ }, }, { - id: IDTAI, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDTAI, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var v TAI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -103,7 +96,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return nil }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.TAI == nil { return nil, false } @@ -112,11 +105,11 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ }, }, { - id: IDUESecurityCapabilities, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDUESecurityCapabilities, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var v UESecurityCapabilities - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -124,7 +117,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return nil }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.UESecurityCapabilities == nil { return nil, false } @@ -133,11 +126,11 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ }, }, { - id: IDSourceMMEGUMMEI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequest, raw []byte, enc per.Encoding) error { + ID: IDSourceMMEGUMMEI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { var v GUMMEI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -145,7 +138,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return nil }, - encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { if m.SourceMMEGUMMEI == nil { return nil, false } @@ -153,6 +146,13 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return m.SourceMMEGUMMEI, true }, }, + { + ID: IDTunnelInformationForBBF, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TunnelInformationForBBF) + }, + Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return optionalIE(m.TunnelInformationForBBF) }, + }, } func (m *PathSwitchRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -179,6 +179,10 @@ func ParsePathSwitchRequest(value []byte) (*PathSwitchRequest, error) { return parseMessageBody[PathSwitchRequest](ProcPathSwitchRequest, TriggeringInitiatingMessage, pathSwitchRequestIEs, value) } +func DecodePathSwitchRequest(value []byte) (*PathSwitchRequest, error) { + return decodeMessageBody[PathSwitchRequest](ProcPathSwitchRequest, pathSwitchRequestIEs, value) +} + // TS 36.413 §9.1.5.9. type PathSwitchRequestAcknowledge struct { MMEUES1APID *MMEUES1APID @@ -190,18 +194,19 @@ type PathSwitchRequestAcknowledge struct { UESecurityCapabilities *UESecurityCapabilities // E-RABs the MME failed to switch the UP path for, whose data radio bearers // the eNB releases (§8.4.4.2). - ERABToBeReleased []ERABItem + ERABToBeReleased []ERABItem + TimeRefDistribution *TimeRefDistribution messageMeta } var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -209,7 +214,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -218,11 +223,11 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -230,7 +235,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -239,14 +244,14 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDUEAggregateMaximumBitrate, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitrate, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var ( err error ambr UEAggregateMaximumBitRate ) - err = perIEDecode(raw, &ambr) + err = decodeIE(r, &ambr) if err != nil { return err } @@ -255,7 +260,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -264,11 +269,11 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDERABToBeSwitchedULList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ERABToBeSwitchedUL) + ID: IDERABToBeSwitchedULList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ERABToBeSwitchedUL) }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if len(m.ERABToBeSwitchedUL) == 0 { return nil, false } @@ -277,37 +282,35 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDERABToBeReleasedList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDERABToBeReleasedList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var err error - m.ERABToBeReleased, err = decodeItemList[ERABItem](per.NewReader(raw), enc, maxnoofERABs, IDERABItem, CriticalityIgnore) + m.ERABToBeReleased, err = decodeItemList[ERABItem](r, enc, maxnoofERABs, IDERABItem, CriticalityIgnore) return err }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if len(m.ERABToBeReleased) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToBeReleased) - }), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToBeReleased), true }, }, { - id: IDSecurityContext, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SecurityContext) + ID: IDSecurityContext, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SecurityContext) }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return &m.SecurityContext, true }, + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return &m.SecurityContext, true }, }, { - id: IDMMEUES1APID2, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID2, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -315,7 +318,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.MMEUES1APID2 == nil { return nil, false } @@ -324,14 +327,14 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, }, { - id: IDUESecurityCapabilities, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDUESecurityCapabilities, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { var ( err error caps UESecurityCapabilities ) - err = perIEDecode(raw, &caps) + err = decodeIE(r, &caps) if err != nil { return err } @@ -340,7 +343,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil }, - encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { if m.UESecurityCapabilities == nil { return nil, false } @@ -348,6 +351,13 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.UESecurityCapabilities, true }, }, + { + ID: IDTimeRefDistribution, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TimeRefDistribution) + }, + Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return optionalIE(m.TimeRefDistribution) }, + }, } func (m *PathSwitchRequestAcknowledge) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -374,6 +384,10 @@ func ParsePathSwitchRequestAcknowledge(value []byte) (*PathSwitchRequestAcknowle return parseMessageBody[PathSwitchRequestAcknowledge](ProcPathSwitchRequest, TriggeringSuccessfulOutcome, pathSwitchRequestAcknowledgeIEs, value) } +func DecodePathSwitchRequestAcknowledge(value []byte) (*PathSwitchRequestAcknowledge, error) { + return decodeMessageBody[PathSwitchRequestAcknowledge](ProcPathSwitchRequest, pathSwitchRequestAcknowledgeIEs, value) +} + // TS 36.413 §9.1.5.10. type PathSwitchRequestFailure struct { MMEUES1APID *MMEUES1APID @@ -386,11 +400,11 @@ type PathSwitchRequestFailure struct { var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -398,7 +412,7 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ return nil }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -407,11 +421,11 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -419,7 +433,7 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ return nil }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -428,11 +442,11 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -440,7 +454,7 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ return nil }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -449,11 +463,11 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *PathSwitchRequestFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *PathSwitchRequestFailure, r *per.Reader, enc per.Encoding) error { var v CriticalityDiagnostics - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -461,7 +475,7 @@ var pathSwitchRequestFailureIEs = []ieSpec[PathSwitchRequestFailure]{ return nil }, - encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { + Encode: func(m *PathSwitchRequestFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -494,3 +508,7 @@ func (m *PathSwitchRequestFailure) Marshal() ([]byte, error) { func ParsePathSwitchRequestFailure(value []byte) (*PathSwitchRequestFailure, error) { return parseMessageBody[PathSwitchRequestFailure](ProcPathSwitchRequest, TriggeringUnsuccessfulOutcome, pathSwitchRequestFailureIEs, value) } + +func DecodePathSwitchRequestFailure(value []byte) (*PathSwitchRequestFailure, error) { + return decodeMessageBody[PathSwitchRequestFailure](ProcPathSwitchRequest, pathSwitchRequestFailureIEs, value) +} diff --git a/s1ap/path_switch_test.go b/s1ap/path_switch_test.go index 0e3efd6af3..7013758803 100644 --- a/s1ap/path_switch_test.go +++ b/s1ap/path_switch_test.go @@ -4,7 +4,6 @@ package s1ap import ( - "bytes" "testing" ) @@ -12,12 +11,12 @@ func sampledPathSwitchRequest() *PathSwitchRequest { return &PathSwitchRequest{ ENBUES1APID: 2, ERABToBeSwitchedDL: []ERABToBeSwitchedDLItem{ - {ERABID: 5, TransportLayerAddress: TransportLayerAddress{10, 1, 2, 3}, GTPTEID: 0x01020304}, + {ERABID: 5, TransportLayerAddress: tlaOf(10, 1, 2, 3), GTPTEID: 0x01020304}, }, SourceMMEUES1APID: 0x020000bf, EUTRANCGI: Ptr(EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x123c601}), TAI: Ptr(TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}), - UESecurityCapabilities: Ptr(UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}), + UESecurityCapabilities: Ptr(UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}), } } @@ -64,7 +63,7 @@ func TestPathSwitchRequestRoundTrip(t *testing.T) { want := in.ERABToBeSwitchedDL[0] if got.ERABID != want.ERABID || got.GTPTEID != want.GTPTEID || - !bytes.Equal(got.TransportLayerAddress, want.TransportLayerAddress) { + got.TransportLayerAddress != want.TransportLayerAddress { t.Fatalf("E-RAB item = %+v, want %+v", got, want) } } @@ -90,7 +89,7 @@ func TestPathSwitchRequestAcknowledgeRoundTrip(t *testing.T) { ENBUES1APID: Ptr(ENBUES1APID(2)), UEAggregateMaximumBitRate: &UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, SecurityContext: SecurityContext{NextHopChainingCount: 3, NextHopParameter: nh}, - UESecurityCapabilities: &UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0x8000}, + UESecurityCapabilities: &UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0x8000}}, } b, err := in.Marshal() @@ -165,7 +164,7 @@ func TestPathSwitchRequestFailureRoundTrip(t *testing.T) { in := &PathSwitchRequestFailure{ MMEUES1APID: Ptr(MMEUES1APID(7)), ENBUES1APID: Ptr(ENBUES1APID(2)), - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 4}), + Cause: Ptr(CauseRadioNetworkHandoverCancelled.Cause()), } b, err := in.Marshal() @@ -189,7 +188,7 @@ func TestPathSwitchRequestFailureRoundTrip(t *testing.T) { } if deref(out.MMEUES1APID) != deref(in.MMEUES1APID) || deref(out.ENBUES1APID) != deref(in.ENBUES1APID) || - deref(out.Cause) != deref(in.Cause) { + !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("failure = %+v, want %+v", out, in) } } diff --git a/s1ap/pdu.go b/s1ap/pdu.go index 12b6d6d77f..be7b39f2b7 100644 --- a/s1ap/pdu.go +++ b/s1ap/pdu.go @@ -4,9 +4,10 @@ package s1ap import ( + "bytes" "fmt" - "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // S1AP-PDU CHOICE root alternatives (TS 36.413), in declaration order. @@ -14,8 +15,6 @@ const ( pduInitiatingMessage = iota pduSuccessfulOutcome pduUnsuccessfulOutcome - - pduRootCount = 3 ) // PDU is the top-level S1AP-PDU CHOICE: one of [InitiatingMessage], @@ -59,6 +58,18 @@ func (m *UnsuccessfulOutcome) criticality() Criticality { return m.Criticali func (m *UnsuccessfulOutcome) value() []byte { return m.Value } func (m *UnsuccessfulOutcome) choiceIndex() int { return pduUnsuccessfulOutcome } +func (m InitiatingMessage) Equal(o InitiatingMessage) bool { + return m.ProcedureCode == o.ProcedureCode && m.Criticality == o.Criticality && bytes.Equal(m.Value, o.Value) +} + +func (m SuccessfulOutcome) Equal(o SuccessfulOutcome) bool { + return m.ProcedureCode == o.ProcedureCode && m.Criticality == o.Criticality && bytes.Equal(m.Value, o.Value) +} + +func (m UnsuccessfulOutcome) Equal(o UnsuccessfulOutcome) bool { + return m.ProcedureCode == o.ProcedureCode && m.Criticality == o.Criticality && bytes.Equal(m.Value, o.Value) +} + // Each alternative is a non-extensible SEQUENCE with no optional fields, so it // carries no preamble; value is wrapped as an open type. func Marshal(pdu PDU) ([]byte, error) { @@ -66,84 +77,29 @@ func Marshal(pdu PDU) ([]byte, error) { return nil, fmt.Errorf("s1ap: nil PDU") } - w := per.NewWriter() - enc := per.Aligned - - w.WriteBit(false) - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, pduRootCount-1, int64(pdu.choiceIndex())); err != nil { - return nil, err - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 255, int64(pdu.procedureCode())); err != nil { - return nil, err - } - - if err := per.EncodeEnumerated(w, enc, criticalityRootCount, false, int64(pdu.criticality())); err != nil { - return nil, err - } - - if err := per.EncodeOpenTypeBytes(w, enc, pdu.value()); err != nil { - return nil, err - } - - w.AlignToByte() - - return w.Bytes(), nil + return profile.EncodePDU(ap.Envelope{ + Choice: pdu.choiceIndex(), + ProcedureCode: uint8(pdu.procedureCode()), + Criticality: pdu.criticality(), + Value: pdu.value(), + }) } // The open-type payload is left in Value for the message layer. func Unmarshal(b []byte) (PDU, error) { - r := per.NewReader(b) - - isExt, err := r.ReadBit() - if err != nil { - return nil, fmt.Errorf("s1ap: PDU choice: %w", err) - } - - if isExt { - return nil, fmt.Errorf("s1ap: unsupported S1AP-PDU extension alternative") - } - - idx, err := per.DecodeConstrainedWholeNumber(r, per.Aligned, 0, pduRootCount-1) - if err != nil { - return nil, fmt.Errorf("s1ap: PDU choice: %w", err) - } - - pc, crit, val, err := decodeMessageFields(r) + e, err := profile.DecodePDU(b) if err != nil { return nil, err } - switch idx { + pc := ProcedureCode(e.ProcedureCode) + + switch e.Choice { case pduInitiatingMessage: - return &InitiatingMessage{ProcedureCode: pc, Criticality: crit, Value: val}, nil + return &InitiatingMessage{ProcedureCode: pc, Criticality: e.Criticality, Value: e.Value}, nil case pduSuccessfulOutcome: - return &SuccessfulOutcome{ProcedureCode: pc, Criticality: crit, Value: val}, nil - case pduUnsuccessfulOutcome: - return &UnsuccessfulOutcome{ProcedureCode: pc, Criticality: crit, Value: val}, nil + return &SuccessfulOutcome{ProcedureCode: pc, Criticality: e.Criticality, Value: e.Value}, nil default: - return nil, fmt.Errorf("s1ap: unreachable PDU index %d", idx) - } -} - -func decodeMessageFields(r *per.Reader) (ProcedureCode, Criticality, []byte, error) { - enc := per.Aligned - - pc, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 255) - if err != nil { - return 0, 0, nil, fmt.Errorf("s1ap: procedureCode: %w", err) + return &UnsuccessfulOutcome{ProcedureCode: pc, Criticality: e.Criticality, Value: e.Value}, nil } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return 0, 0, nil, fmt.Errorf("s1ap: criticality: %w", err) - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return 0, 0, nil, fmt.Errorf("s1ap: value: %w", err) - } - - return ProcedureCode(pc), Criticality(crit), val, nil } diff --git a/s1ap/per_gen.go b/s1ap/per_gen.go index 90ee7fca8d..d8629828ed 100644 --- a/s1ap/per_gen.go +++ b/s1ap/per_gen.go @@ -4,26 +4,42 @@ package s1ap -import "github.com/ellanetworks/core/per" +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" + "slices" +) func (additionalGUTI *AdditionalGUTI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) + ext := ap.ExtensionFields(extIEsAdditionalGUTI, additionalGUTI, additionalGUTI.iEExtensions) + w.WriteBit(additionalGUTI.extensions.Present()) + w.WriteBit(len(ext) > 0) if err := additionalGUTI.GUMMEI.MarshalPER(w, enc); err != nil { return err } if err := additionalGUTI.MTMSI.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if additionalGUTI.extensions.Present() { + if err := additionalGUTI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } func (additionalGUTI *AdditionalGUTI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *additionalGUTI = AdditionalGUTI{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } @@ -33,53 +49,45 @@ func (additionalGUTI *AdditionalGUTI) UnmarshalPER(r *per.Reader, enc per.Encodi if err := (&additionalGUTI.MTMSI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalGUTI, additionalGUTI, &additionalGUTI.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := additionalGUTI.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } +var extIEsAdditionalGUTI []ap.IESpec[ProtocolIEID, AdditionalGUTI] + +func (additionalGUTI *AdditionalGUTI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if additionalGUTI.GUMMEI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsAdditionalGUTI, additionalGUTI, additionalGUTI.iEExtensions) + return notComprehended +} + func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) w.WriteBit(allocationAndRetentionPriority.extensions.Present()) - w.WriteBit(allocationAndRetentionPriority.iEExtensions != nil) + w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true}, int64(allocationAndRetentionPriority.PriorityLevel)); err != nil { return err } - if err := per.EncodeEnumerated(w, enc, 2, false, int64(allocationAndRetentionPriority.PreemptionCapability)); err != nil { + if err := allocationAndRetentionPriority.PreemptionCapability.MarshalPER(w, enc); err != nil { return err } - if err := per.EncodeEnumerated(w, enc, 2, false, int64(allocationAndRetentionPriority.PreemptionVulnerability)); err != nil { + if err := allocationAndRetentionPriority.PreemptionVulnerability.MarshalPER(w, enc); err != nil { return err } - if allocationAndRetentionPriority.iEExtensions != nil { - if err := (*allocationAndRetentionPriority.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -92,6 +100,7 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER } func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *allocationAndRetentionPriority = AllocationAndRetentionPriority{} extBit, err := r.ReadBit() if err != nil { return err @@ -105,22 +114,16 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return err } allocationAndRetentionPriority.PriorityLevel = uint8(n0) - e1, err := per.DecodeEnumerated(r, enc, 2, false) - if err != nil { + if err := (&allocationAndRetentionPriority.PreemptionCapability).UnmarshalPER(r, enc); err != nil { return err } - allocationAndRetentionPriority.PreemptionCapability = PreemptionCapability(e1) - e2, err := per.DecodeEnumerated(r, enc, 2, false) - if err != nil { + if err := (&allocationAndRetentionPriority.PreemptionVulnerability).UnmarshalPER(r, enc); err != nil { return err } - allocationAndRetentionPriority.PreemptionVulnerability = PreemptionVulnerability(e2) if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions); err != nil { return err } - allocationAndRetentionPriority.iEExtensions = &v } if extBit { if err := allocationAndRetentionPriority.extensions.UnmarshalPER(r, enc); err != nil { @@ -130,266 +133,383 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return nil } -func (cancelledCellInEAIItem *CancelledCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cancelledCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { - return err - } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInEAIItem.NumberOfBroadcasts)); err != nil { +var extIEsAllocationAndRetentionPriority []ap.IESpec[ProtocolIEID, AllocationAndRetentionPriority] + +func (allocationAndRetentionPriority *AllocationAndRetentionPriority) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) + return notComprehended +} + +func (bearerType BearerType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumBearerType.Encode(w, enc, bearerType) +} + +func (bearerType *BearerType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumBearerType.Decode(r, enc) + if err != nil { return err } + *bearerType = v return nil } -func (cancelledCellInEAIItem *CancelledCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err +func (bearerType BearerType) Name() string { + return enumBearerType.Name(bearerType) +} + +func (bearerType BearerType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumBearerType.Known(bearerType) +} + +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{broadcastCancelledAreaList.CellIDCancelled != nil, broadcastCancelledAreaList.TAICancelled != nil, broadcastCancelledAreaList.EmergencyAreaIDCancelled != nil, broadcastCancelledAreaList.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case broadcastCancelledAreaList.CellIDCancelled != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.CellIDCancelled).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.TAICancelled != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.TAICancelled).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.EmergencyAreaIDCancelled != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + if err := (*broadcastCancelledAreaList.EmergencyAreaIDCancelled).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCancelledAreaList.Ext != nil: + w.WriteBit(true) + return broadcastCancelledAreaList.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty } - p_f2, err := r.ReadBit() + return nil +} + +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *broadcastCancelledAreaList = BroadcastCancelledAreaList{} + isExt, err := r.ReadBit() if err != nil { return err } - if err := (&cancelledCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + broadcastCancelledAreaList.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) if err != nil { return err } - cancelledCellInEAIItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions + switch idx { + case 0: + var v CellIDCancelled if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + broadcastCancelledAreaList.CellIDCancelled = &v + case 1: + var v TAICancelled + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + broadcastCancelledAreaList.TAICancelled = &v + case 2: + var v EmergencyAreaIDCancelled + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err } + broadcastCancelledAreaList.EmergencyAreaIDCancelled = &v + default: + return per.ErrOverflow } return nil } -func (cancelledCellInTAIItem *CancelledCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cancelledCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { - return err +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case broadcastCancelledAreaList.CellIDCancelled != nil: + return broadcastCancelledAreaList.CellIDCancelled.Diagnose(d) + case broadcastCancelledAreaList.TAICancelled != nil: + return broadcastCancelledAreaList.TAICancelled.Diagnose(d) + case broadcastCancelledAreaList.EmergencyAreaIDCancelled != nil: + return broadcastCancelledAreaList.EmergencyAreaIDCancelled.Diagnose(d) + case broadcastCancelledAreaList.Ext != nil: + return true + } + return false +} + +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{broadcastCompletedAreaList.CellIDBroadcast != nil, broadcastCompletedAreaList.TAIBroadcast != nil, broadcastCompletedAreaList.EmergencyAreaIDBroadcast != nil, broadcastCompletedAreaList.Ext != nil} { + if ok { + set++ + } } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInTAIItem.NumberOfBroadcasts)); err != nil { - return err + if set > 1 { + return per.ErrChoice + } + switch { + case broadcastCompletedAreaList.CellIDBroadcast != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.CellIDBroadcast).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.TAIBroadcast != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.TAIBroadcast).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.EmergencyAreaIDBroadcast != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + if err := (*broadcastCompletedAreaList.EmergencyAreaIDBroadcast).MarshalPER(w, enc); err != nil { + return err + } + case broadcastCompletedAreaList.Ext != nil: + w.WriteBit(true) + return broadcastCompletedAreaList.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty } return nil } -func (cancelledCellInTAIItem *CancelledCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *broadcastCompletedAreaList = BroadcastCompletedAreaList{} + isExt, err := r.ReadBit() if err != nil { return err } - if err := (&cancelledCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + broadcastCompletedAreaList.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) if err != nil { return err } - cancelledCellInTAIItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions + switch idx { + case 0: + var v CellIDBroadcast if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + broadcastCompletedAreaList.CellIDBroadcast = &v + case 1: + var v TAIBroadcast + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + broadcastCompletedAreaList.TAIBroadcast = &v + case 2: + var v EmergencyAreaIDBroadcast + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err } + broadcastCompletedAreaList.EmergencyAreaIDBroadcast = &v + default: + return per.ErrOverflow } return nil } -func (cellIDBroadcastItem *CellIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cellIDBroadcastItem.ECGI.MarshalPER(w, enc); err != nil { - return err - } - return nil +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case broadcastCompletedAreaList.CellIDBroadcast != nil: + return broadcastCompletedAreaList.CellIDBroadcast.Diagnose(d) + case broadcastCompletedAreaList.TAIBroadcast != nil: + return broadcastCompletedAreaList.TAIBroadcast.Diagnose(d) + case broadcastCompletedAreaList.EmergencyAreaIDBroadcast != nil: + return broadcastCompletedAreaList.EmergencyAreaIDBroadcast.Diagnose(d) + case broadcastCompletedAreaList.Ext != nil: + return true + } + return false } -func (cellIDBroadcastItem *CellIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (cGI *CGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCGI, cGI, cGI.iEExtensions) + w.WriteBit(cGI.extensions.Present()) + w.WriteBit(cGI.RAC != nil) + w.WriteBit(len(ext) > 0) + if err := cGI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { + if err := cGI.LAC.MarshalPER(w, enc); err != nil { return err } - if err := (&cellIDBroadcastItem.ECGI).UnmarshalPER(r, enc); err != nil { + if err := cGI.CI.MarshalPER(w, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if cGI.RAC != nil { + if err := (*cGI.RAC).MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if cGI.extensions.Present() { + if err := cGI.extensions.MarshalPER(w, enc); err != nil { + return err } } return nil } -func (cellIDCancelledItem *CellIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := cellIDCancelledItem.ECGI.MarshalPER(w, enc); err != nil { +func (cGI *CGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cGI = CGI{} + extBit, err := r.ReadBit() + if err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledItem.NumberOfBroadcasts)); err != nil { + p_RAC, err := r.ReadBit() + if err != nil { return err } - return nil -} - -func (cellIDCancelledItem *CellIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { + if err := (&cGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&cellIDCancelledItem.ECGI).UnmarshalPER(r, enc); err != nil { + if err := (&cGI.LAC).UnmarshalPER(r, enc); err != nil { return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + if err := (&cGI.CI).UnmarshalPER(r, enc); err != nil { return err } - cellIDCancelledItem.NumberOfBroadcasts = uint16(n1) - if p_f2 { - var v ieExtensions + if p_RAC { + var v RAC if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + cGI.RAC = &v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCGI, cGI, &cGI.iEExtensions); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if extBit { + if err := cGI.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } -func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(cellType.extensions.Present()) - w.WriteBit(cellType.iEExtensions != nil) - if err := cellType.CellSize.MarshalPER(w, enc); err != nil { +var extIEsCGI []ap.IESpec[ProtocolIEID, CGI] + +func (cGI *CGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsCGI, cGI, cGI.iEExtensions) + return notComprehended +} + +func (cNDomain CNDomain) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCNDomain.Encode(w, enc, cNDomain) +} + +func (cNDomain *CNDomain) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCNDomain.Decode(r, enc) + if err != nil { + return err + } + *cNDomain = v + return nil +} + +func (cNDomain CNDomain) Name() string { + return enumCNDomain.Name(cNDomain) +} + +func (cNType CNType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCNType.Encode(w, enc, cNType) +} + +func (cNType *CNType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCNType.Decode(r, enc) + if err != nil { + return err + } + *cNType = v + return nil +} + +func (cNType CNType) Name() string { + return enumCNType.Name(cNType) +} + +func (cNType CNType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCNType.Known(cNType) +} + +func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, cNTypeRestrictionsItem.iEExtensions) + w.WriteBit(cNTypeRestrictionsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cNTypeRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if cellType.iEExtensions != nil { - if err := (*cellType.iEExtensions).MarshalPER(w, enc); err != nil { + if err := cNTypeRestrictionsItem.CNType.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if cellType.extensions.Present() { - if err := cellType.extensions.MarshalPER(w, enc); err != nil { + if cNTypeRestrictionsItem.extensions.Present() { + if err := cNTypeRestrictionsItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cNTypeRestrictionsItem = CNTypeRestrictionsItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -398,387 +518,570 @@ func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { if err != nil { return err } - if err := (&cellType.CellSize).UnmarshalPER(r, enc); err != nil { + if err := (&cNTypeRestrictionsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&cNTypeRestrictionsItem.CNType).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, &cNTypeRestrictionsItem.iEExtensions); err != nil { return err } - cellType.iEExtensions = &v } if extBit { - if err := cellType.extensions.UnmarshalPER(r, enc); err != nil { + if err := cNTypeRestrictionsItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (completedCellInEAIItem *CompletedCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := completedCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { - return err +var extIEsCNTypeRestrictionsItem []ap.IESpec[ProtocolIEID, CNTypeRestrictionsItem] + +func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cNTypeRestrictionsItem.CNType.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, cNTypeRestrictionsItem.iEExtensions) + return notComprehended } -func (completedCellInEAIItem *CompletedCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f1, err := r.ReadBit() - if err != nil { +func (cancelledCellInEAIItem *CancelledCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, cancelledCellInEAIItem.iEExtensions) + w.WriteBit(cancelledCellInEAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { return err } - if err := (&completedCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInEAIItem.NumberOfBroadcasts)); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if cancelledCellInEAIItem.extensions.Present() { + if err := cancelledCellInEAIItem.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (completedCellInTAIItem *CompletedCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := completedCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { - return err - } - return nil -} - -func (completedCellInTAIItem *CompletedCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelledCellInEAIItem *CancelledCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellInEAIItem = CancelledCellInEAIItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&completedCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + if err := (&cancelledCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cancelledCellInEAIItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, &cancelledCellInEAIItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cancelledCellInEAIItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { - return err +var extIEsCancelledCellInEAIItem []ap.IESpec[ProtocolIEID, CancelledCellInEAIItem] + +func (cancelledCellInEAIItem *CancelledCellInEAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cancelledCellInEAIItem.ECGI.Diagnose(d) { + notComprehended = true } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(criticalityDiagnosticsIEItem.IEID)); err != nil { + ap.DiagnoseExtensions(d, extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, cancelledCellInEAIItem.iEExtensions) + return notComprehended +} + +func (cancelledCellInTAIItem *CancelledCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, cancelledCellInTAIItem.iEExtensions) + w.WriteBit(cancelledCellInTAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { return err } - if err := encodeRootEnumerated(w, enc, 2, int64(criticalityDiagnosticsIEItem.TypeOfError), "TypeOfError"); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInTAIItem.NumberOfBroadcasts)); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cancelledCellInTAIItem.extensions.Present() { + if err := cancelledCellInTAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (cancelledCellInTAIItem *CancelledCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellInTAIItem = CancelledCellInTAIItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f3, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - e0, err := per.DecodeEnumerated(r, enc, 3, false) - if err != nil { + if err := (&cancelledCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { return err } - criticalityDiagnosticsIEItem.IECriticality = Criticality(e0) n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) if err != nil { return err } - criticalityDiagnosticsIEItem.IEID = ProtocolIEID(n1) - e2, err := decodeRootEnumerated(r, enc, 2, "TypeOfError") - if err != nil { - return err - } - criticalityDiagnosticsIEItem.TypeOfError = TypeOfError(e2) - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + cancelledCellInTAIItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, &cancelledCellInTAIItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := cancelledCellInTAIItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (eRABAdmittedItem *ERABAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABAdmittedItem.extensions.Present()) - w.WriteBit(eRABAdmittedItem.DLTransportLayerAddr != nil) - w.WriteBit(eRABAdmittedItem.DLGTPTEID != nil) - w.WriteBit(eRABAdmittedItem.ULTransportLayerAddr != nil) - w.WriteBit(eRABAdmittedItem.ULGTPTEID != nil) - w.WriteBit(eRABAdmittedItem.iEExtensions != nil) - if err := eRABAdmittedItem.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsCancelledCellInTAIItem []ap.IESpec[ProtocolIEID, CancelledCellInTAIItem] + +func (cancelledCellInTAIItem *CancelledCellInTAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cancelledCellInTAIItem.ECGI.Diagnose(d) { + notComprehended = true } - if err := eRABAdmittedItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err + ap.DiagnoseExtensions(d, extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, cancelledCellInTAIItem.iEExtensions) + return notComprehended +} + +func (cause *Cause) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{cause.RadioNetwork != nil, cause.Transport != nil, cause.NAS != nil, cause.Protocol != nil, cause.Misc != nil, cause.Ext != nil} { + if ok { + set++ + } } - if err := eRABAdmittedItem.GTPTEID.MarshalPER(w, enc); err != nil { - return err + if set > 1 { + return per.ErrChoice } - if eRABAdmittedItem.DLTransportLayerAddr != nil { - if err := eRABAdmittedItem.DLTransportLayerAddr.MarshalPER(w, enc); err != nil { + switch { + case cause.RadioNetwork != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 0); err != nil { return err } - } - if eRABAdmittedItem.DLGTPTEID != nil { - if err := (*eRABAdmittedItem.DLGTPTEID).MarshalPER(w, enc); err != nil { + if err := (*cause.RadioNetwork).MarshalPER(w, enc); err != nil { return err } - } - if eRABAdmittedItem.ULTransportLayerAddr != nil { - if err := eRABAdmittedItem.ULTransportLayerAddr.MarshalPER(w, enc); err != nil { + case cause.Transport != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 1); err != nil { return err } - } - if eRABAdmittedItem.ULGTPTEID != nil { - if err := (*eRABAdmittedItem.ULGTPTEID).MarshalPER(w, enc); err != nil { + if err := (*cause.Transport).MarshalPER(w, enc); err != nil { return err } - } - if eRABAdmittedItem.iEExtensions != nil { - if err := (*eRABAdmittedItem.iEExtensions).MarshalPER(w, enc); err != nil { + case cause.NAS != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 2); err != nil { return err } - } - if eRABAdmittedItem.extensions.Present() { - if err := eRABAdmittedItem.extensions.MarshalPER(w, enc); err != nil { + if err := (*cause.NAS).MarshalPER(w, enc); err != nil { + return err + } + case cause.Protocol != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 3); err != nil { + return err + } + if err := (*cause.Protocol).MarshalPER(w, enc); err != nil { return err } + case cause.Misc != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { + return err + } + if err := (*cause.Misc).MarshalPER(w, enc); err != nil { + return err + } + case cause.Ext != nil: + w.WriteBit(true) + return cause.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty } return nil } -func (eRABAdmittedItem *ERABAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (cause *Cause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cause = Cause{} + isExt, err := r.ReadBit() if err != nil { return err } - p_DLTransportLayerAddr, err := r.ReadBit() - if err != nil { + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + cause.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) return err } - p_DLGTPTEID, err := r.ReadBit() + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 4) if err != nil { return err } - p_ULTransportLayerAddr, err := r.ReadBit() + switch idx { + case 0: + var v CauseRadioNetwork + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.RadioNetwork = &v + case 1: + var v CauseTransport + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.Transport = &v + case 2: + var v CauseNas + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.NAS = &v + case 3: + var v CauseProtocol + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.Protocol = &v + case 4: + var v CauseMisc + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cause.Misc = &v + default: + return per.ErrOverflow + } + return nil +} + +func (cause *Cause) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case cause.RadioNetwork != nil: + return cause.RadioNetwork.Diagnose(d) + case cause.Transport != nil: + return cause.Transport.Diagnose(d) + case cause.NAS != nil: + return cause.NAS.Diagnose(d) + case cause.Protocol != nil: + return cause.Protocol.Diagnose(d) + case cause.Misc != nil: + return cause.Misc.Diagnose(d) + case cause.Ext != nil: + return true + } + return false +} + +func (causeMisc CauseMisc) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseMisc.Encode(w, enc, causeMisc) +} + +func (causeMisc *CauseMisc) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseMisc.Decode(r, enc) if err != nil { return err } - p_ULGTPTEID, err := r.ReadBit() + *causeMisc = v + return nil +} + +func (causeMisc CauseMisc) Name() string { + return enumCauseMisc.Name(causeMisc) +} + +func (causeMisc CauseMisc) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseMisc.Known(causeMisc) +} + +func (causeNas CauseNas) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseNas.Encode(w, enc, causeNas) +} + +func (causeNas *CauseNas) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseNas.Decode(r, enc) if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + *causeNas = v + return nil +} + +func (causeNas CauseNas) Name() string { + return enumCauseNas.Name(causeNas) +} + +func (causeNas CauseNas) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseNas.Known(causeNas) +} + +func (causeProtocol CauseProtocol) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseProtocol.Encode(w, enc, causeProtocol) +} + +func (causeProtocol *CauseProtocol) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseProtocol.Decode(r, enc) if err != nil { return err } - if err := (&eRABAdmittedItem.ERABID).UnmarshalPER(r, enc); err != nil { + *causeProtocol = v + return nil +} + +func (causeProtocol CauseProtocol) Name() string { + return enumCauseProtocol.Name(causeProtocol) +} + +func (causeProtocol CauseProtocol) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseProtocol.Known(causeProtocol) +} + +func (causeRadioNetwork CauseRadioNetwork) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseRadioNetwork.Encode(w, enc, causeRadioNetwork) +} + +func (causeRadioNetwork *CauseRadioNetwork) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseRadioNetwork.Decode(r, enc) + if err != nil { return err } - if err := (&eRABAdmittedItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + *causeRadioNetwork = v + return nil +} + +func (causeRadioNetwork CauseRadioNetwork) Name() string { + return enumCauseRadioNetwork.Name(causeRadioNetwork) +} + +func (causeRadioNetwork CauseRadioNetwork) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseRadioNetwork.Known(causeRadioNetwork) +} + +func (causeTransport CauseTransport) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCauseTransport.Encode(w, enc, causeTransport) +} + +func (causeTransport *CauseTransport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCauseTransport.Decode(r, enc) + if err != nil { return err } - if err := (&eRABAdmittedItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + *causeTransport = v + return nil +} + +func (causeTransport CauseTransport) Name() string { + return enumCauseTransport.Name(causeTransport) +} + +func (causeTransport CauseTransport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCauseTransport.Known(causeTransport) +} + +func (cellIDBroadcastItem *CellIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellIDBroadcastItem, cellIDBroadcastItem, cellIDBroadcastItem.iEExtensions) + w.WriteBit(cellIDBroadcastItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellIDBroadcastItem.ECGI.MarshalPER(w, enc); err != nil { return err } - if p_DLTransportLayerAddr { - if err := (&eRABAdmittedItem.DLTransportLayerAddr).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if p_DLGTPTEID { - var v GTPTEID - if err := (&v).UnmarshalPER(r, enc); err != nil { + if cellIDBroadcastItem.extensions.Present() { + if err := cellIDBroadcastItem.extensions.MarshalPER(w, enc); err != nil { return err } - eRABAdmittedItem.DLGTPTEID = &v } - if p_ULTransportLayerAddr { - if err := (&eRABAdmittedItem.ULTransportLayerAddr).UnmarshalPER(r, enc); err != nil { - return err - } + return nil +} + +func (cellIDBroadcastItem *CellIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIDBroadcastItem = CellIDBroadcastItem{} + extBit, err := r.ReadBit() + if err != nil { + return err } - if p_ULGTPTEID { - var v GTPTEID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABAdmittedItem.ULGTPTEID = &v + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cellIDBroadcastItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastItem, cellIDBroadcastItem, &cellIDBroadcastItem.iEExtensions); err != nil { return err } - eRABAdmittedItem.iEExtensions = &v } if extBit { - if err := eRABAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := cellIDBroadcastItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABDataForwardingItem *ERABDataForwardingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABDataForwardingItem.extensions.Present()) - w.WriteBit(eRABDataForwardingItem.DLTransportLayerAddr != nil) - w.WriteBit(eRABDataForwardingItem.DLGTPTEID != nil) - w.WriteBit(eRABDataForwardingItem.ULTransportLayerAddr != nil) - w.WriteBit(eRABDataForwardingItem.ULGTPTEID != nil) - w.WriteBit(eRABDataForwardingItem.iEExtensions != nil) - if err := eRABDataForwardingItem.ERABID.MarshalPER(w, enc); err != nil { +var extIEsCellIDBroadcastItem []ap.IESpec[ProtocolIEID, CellIDBroadcastItem] + +func (cellIDBroadcastItem *CellIDBroadcastItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellIDBroadcastItem.ECGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCellIDBroadcastItem, cellIDBroadcastItem, cellIDBroadcastItem.iEExtensions) + return notComprehended +} + +func (cellIDCancelledItem *CellIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellIDCancelledItem, cellIDCancelledItem, cellIDCancelledItem.iEExtensions) + w.WriteBit(cellIDCancelledItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellIDCancelledItem.ECGI.MarshalPER(w, enc); err != nil { return err } - if eRABDataForwardingItem.DLTransportLayerAddr != nil { - if err := eRABDataForwardingItem.DLTransportLayerAddr.MarshalPER(w, enc); err != nil { - return err - } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cellIDCancelledItem.NumberOfBroadcasts)); err != nil { + return err } - if eRABDataForwardingItem.DLGTPTEID != nil { - if err := (*eRABDataForwardingItem.DLGTPTEID).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABDataForwardingItem.ULTransportLayerAddr != nil { - if err := eRABDataForwardingItem.ULTransportLayerAddr.MarshalPER(w, enc); err != nil { + if cellIDCancelledItem.extensions.Present() { + if err := cellIDCancelledItem.extensions.MarshalPER(w, enc); err != nil { return err } } - if eRABDataForwardingItem.ULGTPTEID != nil { - if err := (*eRABDataForwardingItem.ULGTPTEID).MarshalPER(w, enc); err != nil { - return err - } + return nil +} + +func (cellIDCancelledItem *CellIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIDCancelledItem = CellIDCancelledItem{} + extBit, err := r.ReadBit() + if err != nil { + return err } - if eRABDataForwardingItem.iEExtensions != nil { - if err := (*eRABDataForwardingItem.iEExtensions).MarshalPER(w, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cellIDCancelledItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cellIDCancelledItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledItem, cellIDCancelledItem, &cellIDCancelledItem.iEExtensions); err != nil { return err } } - if eRABDataForwardingItem.extensions.Present() { - if err := eRABDataForwardingItem.extensions.MarshalPER(w, enc); err != nil { + if extBit { + if err := cellIDCancelledItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err +var extIEsCellIDCancelledItem []ap.IESpec[ProtocolIEID, CellIDCancelledItem] + +func (cellIDCancelledItem *CellIDCancelledItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellIDCancelledItem.ECGI.Diagnose(d) { + notComprehended = true } - p_DLTransportLayerAddr, err := r.ReadBit() + ap.DiagnoseExtensions(d, extIEsCellIDCancelledItem, cellIDCancelledItem, cellIDCancelledItem.iEExtensions) + return notComprehended +} + +func (cellSize CellSize) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCellSize.Encode(w, enc, cellSize) +} + +func (cellSize *CellSize) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCellSize.Decode(r, enc) if err != nil { return err } - p_DLGTPTEID, err := r.ReadBit() - if err != nil { + *cellSize = v + return nil +} + +func (cellSize CellSize) Name() string { + return enumCellSize.Name(cellSize) +} + +func (cellSize CellSize) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCellSize.Known(cellSize) +} + +func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCellType, cellType, cellType.iEExtensions) + w.WriteBit(cellType.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellType.CellSize.MarshalPER(w, enc); err != nil { return err } - p_ULTransportLayerAddr, err := r.ReadBit() - if err != nil { - return err + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } } - p_ULGTPTEID, err := r.ReadBit() + if cellType.extensions.Present() { + if err := cellType.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellType = CellType{} + extBit, err := r.ReadBit() if err != nil { return err } @@ -786,373 +1089,402 @@ func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&eRABDataForwardingItem.ERABID).UnmarshalPER(r, enc); err != nil { + if err := (&cellType.CellSize).UnmarshalPER(r, enc); err != nil { return err } - if p_DLTransportLayerAddr { - if err := (&eRABDataForwardingItem.DLTransportLayerAddr).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_DLGTPTEID { - var v GTPTEID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABDataForwardingItem.DLGTPTEID = &v - } - if p_ULTransportLayerAddr { - if err := (&eRABDataForwardingItem.ULTransportLayerAddr).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ULGTPTEID { - var v GTPTEID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABDataForwardingItem.ULGTPTEID = &v - } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellType, cellType, &cellType.iEExtensions); err != nil { return err } - eRABDataForwardingItem.iEExtensions = &v } if extBit { - if err := eRABDataForwardingItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := cellType.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABInformationListItem *ERABInformationListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABInformationListItem.extensions.Present()) - w.WriteBit(eRABInformationListItem.DLForwarding != nil) - w.WriteBit(eRABInformationListItem.iEExtensions != nil) - if err := eRABInformationListItem.ERABID.MarshalPER(w, enc); err != nil { +var extIEsCellType []ap.IESpec[ProtocolIEID, CellType] + +func (cellType *CellType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellType.CellSize.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCellType, cellType, cellType.iEExtensions) + return notComprehended +} + +func (coarseUELocationRequested CoarseUELocationRequested) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCoarseUELocationRequested.Encode(w, enc, coarseUELocationRequested) +} + +func (coarseUELocationRequested *CoarseUELocationRequested) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCoarseUELocationRequested.Decode(r, enc) + if err != nil { return err } - if eRABInformationListItem.DLForwarding != nil { - if err := (*eRABInformationListItem.DLForwarding).MarshalPER(w, enc); err != nil { - return err - } + *coarseUELocationRequested = v + return nil +} + +func (coarseUELocationRequested CoarseUELocationRequested) Name() string { + return enumCoarseUELocationRequested.Name(coarseUELocationRequested) +} + +func (coarseUELocationRequested CoarseUELocationRequested) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumCoarseUELocationRequested.Known(coarseUELocationRequested) +} + +func (completedCellInEAIItem *CompletedCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCompletedCellInEAIItem, completedCellInEAIItem, completedCellInEAIItem.iEExtensions) + w.WriteBit(completedCellInEAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := completedCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { + return err } - if eRABInformationListItem.iEExtensions != nil { - if err := (*eRABInformationListItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABInformationListItem.extensions.Present() { - if err := eRABInformationListItem.extensions.MarshalPER(w, enc); err != nil { + if completedCellInEAIItem.extensions.Present() { + if err := completedCellInEAIItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABInformationListItem *ERABInformationListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellInEAIItem *CompletedCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *completedCellInEAIItem = CompletedCellInEAIItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwarding, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&eRABInformationListItem.ERABID).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { return err } - if p_DLForwarding { - var v DLForwarding - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABInformationListItem.DLForwarding = &v - } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellInEAIItem, completedCellInEAIItem, &completedCellInEAIItem.iEExtensions); err != nil { return err } - eRABInformationListItem.iEExtensions = &v } if extBit { - if err := eRABInformationListItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := completedCellInEAIItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABItem *ERABItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := eRABItem.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsCompletedCellInEAIItem []ap.IESpec[ProtocolIEID, CompletedCellInEAIItem] + +func (completedCellInEAIItem *CompletedCellInEAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if completedCellInEAIItem.ECGI.Diagnose(d) { + notComprehended = true } - if err := eRABItem.Cause.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCompletedCellInEAIItem, completedCellInEAIItem, completedCellInEAIItem.iEExtensions) + return notComprehended +} + +func (completedCellInTAIItem *CompletedCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCompletedCellInTAIItem, completedCellInTAIItem, completedCellInTAIItem.iEExtensions) + w.WriteBit(completedCellInTAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := completedCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if completedCellInTAIItem.extensions.Present() { + if err := completedCellInTAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (eRABItem *ERABItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (completedCellInTAIItem *CompletedCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *completedCellInTAIItem = CompletedCellInTAIItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&eRABItem.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABItem.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&completedCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellInTAIItem, completedCellInTAIItem, &completedCellInTAIItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := completedCellInTAIItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (eRABLevelQoSParameters *ERABLevelQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(eRABLevelQoSParametersExtIEs, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions) - w.WriteBit(eRABLevelQoSParameters.extensions.Present()) - w.WriteBit(eRABLevelQoSParameters.GBR != nil) +var extIEsCompletedCellInTAIItem []ap.IESpec[ProtocolIEID, CompletedCellInTAIItem] + +func (completedCellInTAIItem *CompletedCellInTAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if completedCellInTAIItem.ECGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsCompletedCellInTAIItem, completedCellInTAIItem, completedCellInTAIItem.iEExtensions) + return notComprehended +} + +func (contextatSource *ContextatSource) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsContextatSource, contextatSource, contextatSource.iEExtensions) + w.WriteBit(contextatSource.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eRABLevelQoSParameters.QCI.MarshalPER(w, enc); err != nil { + if err := contextatSource.SourceNGRANNodeID.MarshalPER(w, enc); err != nil { return err } - if err := eRABLevelQoSParameters.ARP.MarshalPER(w, enc); err != nil { + if err := contextatSource.RANUENGAPID.MarshalPER(w, enc); err != nil { return err } - if eRABLevelQoSParameters.GBR != nil { - if err := (*eRABLevelQoSParameters.GBR).MarshalPER(w, enc); err != nil { - return err - } - } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABLevelQoSParameters.extensions.Present() { - if err := eRABLevelQoSParameters.extensions.MarshalPER(w, enc); err != nil { + if contextatSource.extensions.Present() { + if err := contextatSource.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABLevelQoSParameters *ERABLevelQoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (contextatSource *ContextatSource) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *contextatSource = ContextatSource{} extBit, err := r.ReadBit() if err != nil { return err } - p_GBR, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&eRABLevelQoSParameters.QCI).UnmarshalPER(r, enc); err != nil { + if err := (&contextatSource.SourceNGRANNodeID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABLevelQoSParameters.ARP).UnmarshalPER(r, enc); err != nil { + if err := (&contextatSource.RANUENGAPID).UnmarshalPER(r, enc); err != nil { return err } - if p_GBR { - var v GBRQosInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABLevelQoSParameters.GBR = &v - } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, eRABLevelQoSParametersExtIEs, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsContextatSource, contextatSource, &contextatSource.iEExtensions); err != nil { return err } } if extBit { - if err := eRABLevelQoSParameters.extensions.UnmarshalPER(r, enc); err != nil { + if err := contextatSource.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := eRABModifyItemBearerModRes.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsContextatSource []ap.IESpec[ProtocolIEID, ContextatSource] + +func (contextatSource *ContextatSource) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if contextatSource.SourceNGRANNodeID.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsContextatSource, contextatSource, contextatSource.iEExtensions) + return notComprehended } -func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f1, err := r.ReadBit() - if err != nil { - return err +func (criticalityDiagnostics *CriticalityDiagnostics) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + w.WriteBit(criticalityDiagnostics.extensions.Present()) + w.WriteBit(criticalityDiagnostics.ProcedureCode != nil) + w.WriteBit(criticalityDiagnostics.TriggeringMessage != nil) + w.WriteBit(criticalityDiagnostics.ProcedureCriticality != nil) + w.WriteBit(criticalityDiagnostics.IEsCriticalityDiagnostics != nil) + w.WriteBit(len(ext) > 0) + if criticalityDiagnostics.ProcedureCode != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}, int64((*criticalityDiagnostics.ProcedureCode))); err != nil { + return err + } } - if err := (&eRABModifyItemBearerModRes.ERABID).UnmarshalPER(r, enc); err != nil { - return err + if criticalityDiagnostics.TriggeringMessage != nil { + if err := (*criticalityDiagnostics.TriggeringMessage).MarshalPER(w, enc); err != nil { + return err + } } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if criticalityDiagnostics.ProcedureCriticality != nil { + if err := per.EncodeEnumerated(w, enc, 3, false, int64((*criticalityDiagnostics.ProcedureCriticality))); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { + if criticalityDiagnostics.IEsCriticalityDiagnostics != nil { + off3 := 0 + if err := per.EncodeLength(w, enc, 1, 256, true, int64(len(criticalityDiagnostics.IEsCriticalityDiagnostics)), func(count int64) error { + end := off3 + int(count) + for i := off3; i < end; i++ { + if err := criticalityDiagnostics.IEsCriticalityDiagnostics[i].MarshalPER(w, enc); err != nil { return err } - extBits = append(extBits, b) } + off3 = end return nil }); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err } } - return nil -} - -func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := eRABReleaseItemBearerRelComp.ERABID.MarshalPER(w, enc); err != nil { - return err + if criticalityDiagnostics.extensions.Present() { + if err := criticalityDiagnostics.extensions.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (criticalityDiagnostics *CriticalityDiagnostics) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *criticalityDiagnostics = CriticalityDiagnostics{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_ProcedureCode, err := r.ReadBit() if err != nil { return err } - if err := (&eRABReleaseItemBearerRelComp.ERABID).UnmarshalPER(r, enc); err != nil { + p_TriggeringMessage, err := r.ReadBit() + if err != nil { + return err + } + p_ProcedureCriticality, err := r.ReadBit() + if err != nil { + return err + } + p_IEsCriticalityDiagnostics, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if p_f1 { - var v ieExtensions + if p_ProcedureCode { + var v ProcedureCode + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}) + if err != nil { + return err + } + v = ProcedureCode(n0) + criticalityDiagnostics.ProcedureCode = &v + } + if p_TriggeringMessage { + var v TriggeringMessage if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + criticalityDiagnostics.TriggeringMessage = &v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { + if p_ProcedureCriticality { + var v Criticality + e2, err := per.DecodeEnumerated(r, enc, 3, false) + if err != nil { + return err + } + v = Criticality(e2) + criticalityDiagnostics.ProcedureCriticality = &v + } + if p_IEsCriticalityDiagnostics { + criticalityDiagnostics.IEsCriticalityDiagnostics = nil + if err := per.DecodeLength(r, enc, 1, 256, true, func(count int64) error { + start := len(criticalityDiagnostics.IEsCriticalityDiagnostics) + criticalityDiagnostics.IEsCriticalityDiagnostics = append(criticalityDiagnostics.IEsCriticalityDiagnostics, make([]CriticalityDiagnosticsIEItem, count)...) for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { + if err := (&criticalityDiagnostics.IEsCriticalityDiagnostics[start+int(i)]).UnmarshalPER(r, enc); err != nil { return err } - extBits = append(extBits, b) } return nil }); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := criticalityDiagnostics.extensions.UnmarshalPER(r, enc); err != nil { + return err } } return nil } -func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABSetupItemCtxtSURes.extensions.Present()) - w.WriteBit(eRABSetupItemCtxtSURes.iEExtensions != nil) - if err := eRABSetupItemCtxtSURes.ERABID.MarshalPER(w, enc); err != nil { +var extIEsCriticalityDiagnostics []ap.IESpec[ProtocolIEID, CriticalityDiagnostics] + +func (criticalityDiagnostics *CriticalityDiagnostics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range criticalityDiagnostics.IEsCriticalityDiagnostics { + if criticalityDiagnostics.IEsCriticalityDiagnostics[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + return notComprehended +} + +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + w.WriteBit(criticalityDiagnosticsIEItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { return err } - if err := eRABSetupItemCtxtSURes.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(criticalityDiagnosticsIEItem.IEID)); err != nil { return err } - if err := eRABSetupItemCtxtSURes.GTPTEID.MarshalPER(w, enc); err != nil { + if err := criticalityDiagnosticsIEItem.TypeOfError.MarshalPER(w, enc); err != nil { return err } - if eRABSetupItemCtxtSURes.iEExtensions != nil { - if err := (*eRABSetupItemCtxtSURes.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABSetupItemCtxtSURes.extensions.Present() { - if err := eRABSetupItemCtxtSURes.extensions.MarshalPER(w, enc); err != nil { + if criticalityDiagnosticsIEItem.extensions.Present() { + if err := criticalityDiagnosticsIEItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *criticalityDiagnosticsIEItem = CriticalityDiagnosticsIEItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -1161,56 +1493,86 @@ func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&eRABSetupItemCtxtSURes.ERABID).UnmarshalPER(r, enc); err != nil { + e0, err := per.DecodeEnumerated(r, enc, 3, false) + if err != nil { return err } - if err := (&eRABSetupItemCtxtSURes.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + criticalityDiagnosticsIEItem.IECriticality = Criticality(e0) + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { return err } - if err := (&eRABSetupItemCtxtSURes.GTPTEID).UnmarshalPER(r, enc); err != nil { + criticalityDiagnosticsIEItem.IEID = ProtocolIEID(n1) + if err := (&criticalityDiagnosticsIEItem.TypeOfError).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions); err != nil { return err } - eRABSetupItemCtxtSURes.iEExtensions = &v } if extBit { - if err := eRABSetupItemCtxtSURes.extensions.UnmarshalPER(r, enc); err != nil { + if err := criticalityDiagnosticsIEItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABToBeModifiedItemBearerModInd.extensions.Present()) - w.WriteBit(eRABToBeModifiedItemBearerModInd.iEExtensions != nil) - if err := eRABToBeModifiedItemBearerModInd.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsCriticalityDiagnosticsIEItem []ap.IESpec[ProtocolIEID, CriticalityDiagnosticsIEItem] + +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if criticalityDiagnosticsIEItem.TypeOfError.Diagnose(d) { + notComprehended = true } - if err := eRABToBeModifiedItemBearerModInd.TransportLayerAddress.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + return notComprehended +} + +func (dAPSIndicator DAPSIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDAPSIndicator.Encode(w, enc, dAPSIndicator) +} + +func (dAPSIndicator *DAPSIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDAPSIndicator.Decode(r, enc) + if err != nil { return err } - if err := eRABToBeModifiedItemBearerModInd.DLGTPTEID.MarshalPER(w, enc); err != nil { + *dAPSIndicator = v + return nil +} + +func (dAPSIndicator DAPSIndicator) Name() string { + return enumDAPSIndicator.Name(dAPSIndicator) +} + +func (dAPSIndicator DAPSIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDAPSIndicator.Known(dAPSIndicator) +} + +func (dAPSRequestInfo *DAPSRequestInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + w.WriteBit(dAPSRequestInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := dAPSRequestInfo.DAPSIndicator.MarshalPER(w, enc); err != nil { return err } - if eRABToBeModifiedItemBearerModInd.iEExtensions != nil { - if err := (*eRABToBeModifiedItemBearerModInd.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeModifiedItemBearerModInd.extensions.Present() { - if err := eRABToBeModifiedItemBearerModInd.extensions.MarshalPER(w, enc); err != nil { + if dAPSRequestInfo.extensions.Present() { + if err := dAPSRequestInfo.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (dAPSRequestInfo *DAPSRequestInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *dAPSRequestInfo = DAPSRequestInfo{} extBit, err := r.ReadBit() if err != nil { return err @@ -1219,381 +1581,730 @@ func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) Unmars if err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModInd.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeModifiedItemBearerModInd.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeModifiedItemBearerModInd.DLGTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&dAPSRequestInfo.DAPSIndicator).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions); err != nil { return err } - eRABToBeModifiedItemBearerModInd.iEExtensions = &v } if extBit { - if err := eRABToBeModifiedItemBearerModInd.extensions.UnmarshalPER(r, enc); err != nil { + if err := dAPSRequestInfo.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(eRABToBeModifyItemBearerModReqExtIEs, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions) - w.WriteBit(eRABToBeModifiedItemBearerModReq.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := eRABToBeModifiedItemBearerModReq.ERABID.MarshalPER(w, enc); err != nil { +var extIEsDAPSRequestInfo []ap.IESpec[ProtocolIEID, DAPSRequestInfo] + +func (dAPSRequestInfo *DAPSRequestInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if dAPSRequestInfo.DAPSIndicator.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + return notComprehended +} + +func (dLForwarding DLForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDLForwarding.Encode(w, enc, dLForwarding) +} + +func (dLForwarding *DLForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDLForwarding.Decode(r, enc) + if err != nil { return err } - if err := eRABToBeModifiedItemBearerModReq.QoS.MarshalPER(w, enc); err != nil { + *dLForwarding = v + return nil +} + +func (dLForwarding DLForwarding) Name() string { + return enumDLForwarding.Name(dLForwarding) +} + +func (dLForwarding DLForwarding) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDLForwarding.Known(dLForwarding) +} + +func (dataForwardingNotPossible DataForwardingNotPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDataForwardingNotPossible.Encode(w, enc, dataForwardingNotPossible) +} + +func (dataForwardingNotPossible *DataForwardingNotPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDataForwardingNotPossible.Decode(r, enc) + if err != nil { return err } - if err := eRABToBeModifiedItemBearerModReq.NASPDU.MarshalPER(w, enc); err != nil { + *dataForwardingNotPossible = v + return nil +} + +func (dataForwardingNotPossible DataForwardingNotPossible) Name() string { + return enumDataForwardingNotPossible.Name(dataForwardingNotPossible) +} + +func (dataForwardingNotPossible DataForwardingNotPossible) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDataForwardingNotPossible.Known(dataForwardingNotPossible) +} + +func (directForwardingPathAvailability DirectForwardingPathAvailability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDirectForwardingPathAvailability.Encode(w, enc, directForwardingPathAvailability) +} + +func (directForwardingPathAvailability *DirectForwardingPathAvailability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDirectForwardingPathAvailability.Decode(r, enc) + if err != nil { return err } - if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { - return err + *directForwardingPathAvailability = v + return nil +} + +func (directForwardingPathAvailability DirectForwardingPathAvailability) Name() string { + return enumDirectForwardingPathAvailability.Name(directForwardingPathAvailability) +} + +func (directForwardingPathAvailability DirectForwardingPathAvailability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumDirectForwardingPathAvailability.Known(directForwardingPathAvailability) +} + +func (eNBID *ENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{eNBID.MacroENBID != nil, eNBID.HomeENBID != nil, eNBID.ShortMacroENBID != nil, eNBID.LongMacroENBID != nil, eNBID.Ext != nil} { + if ok { + set++ } } - if eRABToBeModifiedItemBearerModReq.extensions.Present() { - if err := eRABToBeModifiedItemBearerModReq.extensions.MarshalPER(w, enc); err != nil { + if set > 1 { + return per.ErrChoice + } + switch { + case eNBID.MacroENBID != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*eNBID.MacroENBID).MarshalPER(w, enc); err != nil { + return err + } + case eNBID.HomeENBID != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*eNBID.HomeENBID).MarshalPER(w, enc); err != nil { + return err + } + case eNBID.ShortMacroENBID != nil: + w.WriteBit(true) + if err := per.EncodeNormallySmall(w, enc, 0); err != nil { + return err + } + return per.EncodeOpenType(w, enc, eNBID.ShortMacroENBID) + case eNBID.LongMacroENBID != nil: + w.WriteBit(true) + if err := per.EncodeNormallySmall(w, enc, 1); err != nil { return err } + return per.EncodeOpenType(w, enc, eNBID.LongMacroENBID) + case eNBID.Ext != nil: + w.WriteBit(true) + return eNBID.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty } return nil } -func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() +func (eNBID *ENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNBID = ENBID{} + isExt, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModReq.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeModifiedItemBearerModReq.QoS).UnmarshalPER(r, enc); err != nil { - return err + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + switch extIdx { + case 0: + var v ShortMacroENBID + if err := per.DecodeOpenType(r, enc, &v); err != nil { + return err + } + eNBID.ShortMacroENBID = &v + case 1: + var v LongMacroENBID + if err := per.DecodeOpenType(r, enc, &v); err != nil { + return err + } + eNBID.LongMacroENBID = &v + default: + eNBID.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + return nil } - if err := (&eRABToBeModifiedItemBearerModReq.NASPDU).UnmarshalPER(r, enc); err != nil { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { return err } - if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, eRABToBeModifyItemBearerModReqExtIEs, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions); err != nil { + switch idx { + case 0: + var v MacroENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - if extBit { - if err := eRABToBeModifiedItemBearerModReq.extensions.UnmarshalPER(r, enc); err != nil { + eNBID.MacroENBID = &v + case 1: + var v HomeENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + eNBID.HomeENBID = &v + default: + return per.ErrOverflow } return nil } -func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(eRABToBeSetupItemBearerSUReqExtIEs, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions) - w.WriteBit(eRABToBeSetupItemBearerSUReq.extensions.Present()) +func (eNBID *ENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case eNBID.MacroENBID != nil: + case eNBID.HomeENBID != nil: + case eNBID.ShortMacroENBID != nil: + case eNBID.LongMacroENBID != nil: + case eNBID.Ext != nil: + return true + } + return false +} + +func (eNBX2ExtTLA *ENBX2ExtTLA) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsENBX2ExtTLA, eNBX2ExtTLA, eNBX2ExtTLA.iEExtensions) + w.WriteBit(eNBX2ExtTLA.extensions.Present()) + w.WriteBit(eNBX2ExtTLA.IPsecTLA != nil) + w.WriteBit(eNBX2ExtTLA.GTPTLAa != nil) w.WriteBit(len(ext) > 0) - if err := eRABToBeSetupItemBearerSUReq.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemBearerSUReq.QoS.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemBearerSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemBearerSUReq.GTPTEID.MarshalPER(w, enc); err != nil { - return err + if eNBX2ExtTLA.IPsecTLA != nil { + if err := (*eNBX2ExtTLA.IPsecTLA).MarshalPER(w, enc); err != nil { + return err + } } - if err := eRABToBeSetupItemBearerSUReq.NASPDU.MarshalPER(w, enc); err != nil { - return err + if eNBX2ExtTLA.GTPTLAa != nil { + if err := eNBX2ExtTLA.GTPTLAa.MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSetupItemBearerSUReq.extensions.Present() { - if err := eRABToBeSetupItemBearerSUReq.extensions.MarshalPER(w, enc); err != nil { + if eNBX2ExtTLA.extensions.Present() { + if err := eNBX2ExtTLA.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eNBX2ExtTLA *ENBX2ExtTLA) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNBX2ExtTLA = ENBX2ExtTLA{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_IPsecTLA, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeSetupItemBearerSUReq.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemBearerSUReq.QoS).UnmarshalPER(r, enc); err != nil { + p_GTPTLAa, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemBearerSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemBearerSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { - return err + if p_IPsecTLA { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eNBX2ExtTLA.IPsecTLA = &v } - if err := (&eRABToBeSetupItemBearerSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { - return err + if p_GTPTLAa { + if err := (&eNBX2ExtTLA.GTPTLAa).UnmarshalPER(r, enc); err != nil { + return err + } } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, eRABToBeSetupItemBearerSUReqExtIEs, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsENBX2ExtTLA, eNBX2ExtTLA, &eNBX2ExtTLA.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeSetupItemBearerSUReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := eNBX2ExtTLA.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(eRABToBeSetupItemCtxtSUReqExtIEs, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions) - w.WriteBit(eRABToBeSetupItemCtxtSUReq.extensions.Present()) - w.WriteBit(eRABToBeSetupItemCtxtSUReq.NASPDU != nil) +var extIEsENBX2ExtTLA []ap.IESpec[ProtocolIEID, ENBX2ExtTLA] + +func (eNBX2ExtTLA *ENBX2ExtTLA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsENBX2ExtTLA, eNBX2ExtTLA, eNBX2ExtTLA.iEExtensions) + return notComprehended +} + +func (eRABAdmittedItem *ERABAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABAdmittedItem, eRABAdmittedItem, eRABAdmittedItem.iEExtensions) + w.WriteBit(eRABAdmittedItem.extensions.Present()) + w.WriteBit(eRABAdmittedItem.DLTransportLayerAddr != nil) + w.WriteBit(eRABAdmittedItem.DLGTPTEID != nil) + w.WriteBit(eRABAdmittedItem.ULTransportLayerAddr != nil) + w.WriteBit(eRABAdmittedItem.ULGTPTEID != nil) w.WriteBit(len(ext) > 0) - if err := eRABToBeSetupItemCtxtSUReq.ERABID.MarshalPER(w, enc); err != nil { + if err := eRABAdmittedItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSetupItemCtxtSUReq.QoS.MarshalPER(w, enc); err != nil { + if err := eRABAdmittedItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSetupItemCtxtSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if err := eRABAdmittedItem.GTPTEID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSetupItemCtxtSUReq.GTPTEID.MarshalPER(w, enc); err != nil { - return err + if eRABAdmittedItem.DLTransportLayerAddr != nil { + if err := (*eRABAdmittedItem.DLTransportLayerAddr).MarshalPER(w, enc); err != nil { + return err + } } - if eRABToBeSetupItemCtxtSUReq.NASPDU != nil { - if err := eRABToBeSetupItemCtxtSUReq.NASPDU.MarshalPER(w, enc); err != nil { + if eRABAdmittedItem.DLGTPTEID != nil { + if err := (*eRABAdmittedItem.DLGTPTEID).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABAdmittedItem.ULTransportLayerAddr != nil { + if err := (*eRABAdmittedItem.ULTransportLayerAddr).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABAdmittedItem.ULGTPTEID != nil { + if err := (*eRABAdmittedItem.ULGTPTEID).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSetupItemCtxtSUReq.extensions.Present() { - if err := eRABToBeSetupItemCtxtSUReq.extensions.MarshalPER(w, enc); err != nil { + if eRABAdmittedItem.extensions.Present() { + if err := eRABAdmittedItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABAdmittedItem *ERABAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABAdmittedItem = ERABAdmittedItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() + p_DLTransportLayerAddr, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_DLGTPTEID, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeSetupItemCtxtSUReq.ERABID).UnmarshalPER(r, enc); err != nil { + p_ULTransportLayerAddr, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemCtxtSUReq.QoS).UnmarshalPER(r, enc); err != nil { + p_ULGTPTEID, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemCtxtSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemCtxtSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABAdmittedItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if p_NASPDU { - if err := (&eRABToBeSetupItemCtxtSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { - return err + if err := (&eRABAdmittedItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABAdmittedItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_DLTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABAdmittedItem.DLTransportLayerAddr = &v + } + if p_DLGTPTEID { + var v GTPTEID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABAdmittedItem.DLGTPTEID = &v + } + if p_ULTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABAdmittedItem.ULTransportLayerAddr = &v + } + if p_ULGTPTEID { + var v GTPTEID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err } + eRABAdmittedItem.ULGTPTEID = &v } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, eRABToBeSetupItemCtxtSUReqExtIEs, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABAdmittedItem, eRABAdmittedItem, &eRABAdmittedItem.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeSetupItemCtxtSUReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABToBeSetupItemHOReq.extensions.Present()) - w.WriteBit(eRABToBeSetupItemHOReq.Extensions != nil) - if err := eRABToBeSetupItemHOReq.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsERABAdmittedItem []ap.IESpec[ProtocolIEID, ERABAdmittedItem] + +func (eRABAdmittedItem *ERABAdmittedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABAdmittedItem.ERABID.Diagnose(d) { + notComprehended = true } - if err := eRABToBeSetupItemHOReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsERABAdmittedItem, eRABAdmittedItem, eRABAdmittedItem.iEExtensions) + return notComprehended +} + +func (eRABDataForwardingItem *ERABDataForwardingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABDataForwardingItem, eRABDataForwardingItem, eRABDataForwardingItem.iEExtensions) + w.WriteBit(eRABDataForwardingItem.extensions.Present()) + w.WriteBit(eRABDataForwardingItem.DLTransportLayerAddr != nil) + w.WriteBit(eRABDataForwardingItem.DLGTPTEID != nil) + w.WriteBit(eRABDataForwardingItem.ULTransportLayerAddr != nil) + w.WriteBit(eRABDataForwardingItem.ULGTPTEID != nil) + w.WriteBit(len(ext) > 0) + if err := eRABDataForwardingItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSetupItemHOReq.GTPTEID.MarshalPER(w, enc); err != nil { - return err + if eRABDataForwardingItem.DLTransportLayerAddr != nil { + if err := (*eRABDataForwardingItem.DLTransportLayerAddr).MarshalPER(w, enc); err != nil { + return err + } } - if err := eRABToBeSetupItemHOReq.QoS.MarshalPER(w, enc); err != nil { - return err + if eRABDataForwardingItem.DLGTPTEID != nil { + if err := (*eRABDataForwardingItem.DLGTPTEID).MarshalPER(w, enc); err != nil { + return err + } } - if eRABToBeSetupItemHOReq.Extensions != nil { - if err := (*eRABToBeSetupItemHOReq.Extensions).MarshalPER(w, enc); err != nil { + if eRABDataForwardingItem.ULTransportLayerAddr != nil { + if err := (*eRABDataForwardingItem.ULTransportLayerAddr).MarshalPER(w, enc); err != nil { return err } } - if eRABToBeSetupItemHOReq.extensions.Present() { - if err := eRABToBeSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { + if eRABDataForwardingItem.ULGTPTEID != nil { + if err := (*eRABDataForwardingItem.ULGTPTEID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABDataForwardingItem.extensions.Present() { + if err := eRABDataForwardingItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABDataForwardingItem = ERABDataForwardingItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_Extensions, err := r.ReadBit() + p_DLTransportLayerAddr, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeSetupItemHOReq.ERABID).UnmarshalPER(r, enc); err != nil { + p_DLGTPTEID, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemHOReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + p_ULTransportLayerAddr, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemHOReq.GTPTEID).UnmarshalPER(r, enc); err != nil { + p_ULGTPTEID, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSetupItemHOReq.QoS).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eRABDataForwardingItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if p_Extensions { - var v ERABToBeSetupItemHOReqExtIEs + if p_DLTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABDataForwardingItem.DLTransportLayerAddr = &v + } + if p_DLGTPTEID { + var v GTPTEID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABDataForwardingItem.DLGTPTEID = &v + } + if p_ULTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABDataForwardingItem.ULTransportLayerAddr = &v + } + if p_ULGTPTEID { + var v GTPTEID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - eRABToBeSetupItemHOReq.Extensions = &v + eRABDataForwardingItem.ULGTPTEID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABDataForwardingItem, eRABDataForwardingItem, &eRABDataForwardingItem.iEExtensions); err != nil { + return err + } } if extBit { - if err := eRABToBeSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABDataForwardingItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(eRABToBeSwitchedDLItemExtIEs, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions) - w.WriteBit(eRABToBeSwitchedDLItem.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := eRABToBeSwitchedDLItem.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsERABDataForwardingItem []ap.IESpec[ProtocolIEID, ERABDataForwardingItem] + +func (eRABDataForwardingItem *ERABDataForwardingItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABDataForwardingItem.ERABID.Diagnose(d) { + notComprehended = true } - if err := eRABToBeSwitchedDLItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsERABDataForwardingItem, eRABDataForwardingItem, eRABDataForwardingItem.iEExtensions) + return notComprehended +} + +func (eRABInformationListItem *ERABInformationListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABInformationListItem, eRABInformationListItem, eRABInformationListItem.iEExtensions) + w.WriteBit(eRABInformationListItem.extensions.Present()) + w.WriteBit(eRABInformationListItem.DLForwarding != nil) + w.WriteBit(len(ext) > 0) + if err := eRABInformationListItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSwitchedDLItem.GTPTEID.MarshalPER(w, enc); err != nil { - return err + if eRABInformationListItem.DLForwarding != nil { + if err := (*eRABInformationListItem.DLForwarding).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSwitchedDLItem.extensions.Present() { - if err := eRABToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { + if eRABInformationListItem.extensions.Present() { + if err := eRABInformationListItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABInformationListItem *ERABInformationListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABInformationListItem = ERABInformationListItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_DLForwarding, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.ERABID).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&eRABInformationListItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.GTPTEID).UnmarshalPER(r, enc); err != nil { - return err + if p_DLForwarding { + var v DLForwarding + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABInformationListItem.DLForwarding = &v } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, eRABToBeSwitchedDLItemExtIEs, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABInformationListItem, eRABInformationListItem, &eRABInformationListItem.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABInformationListItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(eRABToBeSwitchedULItem.extensions.Present()) - w.WriteBit(eRABToBeSwitchedULItem.iEExtensions != nil) - if err := eRABToBeSwitchedULItem.ERABID.MarshalPER(w, enc); err != nil { - return err +var extIEsERABInformationListItem = []ap.IESpec[ProtocolIEID, ERABInformationListItem]{ + { + ID: IDDAPSRequestInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v DAPSRequestInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DAPSRequestInfo = &v + return nil + }, + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.DAPSRequestInfo == nil { + return nil, false + } + return x.DAPSRequestInfo, true + }, + }, + { + ID: IDSourceTransportLayerAddress, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceTransportLayerAddress = &v + return nil + }, + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.SourceTransportLayerAddress == nil { + return nil, false + } + return x.SourceTransportLayerAddress, true + }, + }, + { + ID: IDSecurityIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + }, + { + ID: IDSourceNodeTransportLayerAddress, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceNodeTransportLayerAddress = &v + return nil + }, + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.SourceNodeTransportLayerAddress == nil { + return nil, false + } + return x.SourceNodeTransportLayerAddress, true + }, + }, +} + +func (eRABInformationListItem *ERABInformationListItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABInformationListItem.ERABID.Diagnose(d) { + notComprehended = true } - if err := eRABToBeSwitchedULItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if eRABInformationListItem.DLForwarding != nil && eRABInformationListItem.DLForwarding.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABInformationListItem, eRABInformationListItem, eRABInformationListItem.iEExtensions) + return notComprehended +} + +func (eRABItem *ERABItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABItem, eRABItem, eRABItem.iEExtensions) + w.WriteBit(eRABItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSwitchedULItem.GTPTEID.MarshalPER(w, enc); err != nil { + if err := eRABItem.Cause.MarshalPER(w, enc); err != nil { return err } - if eRABToBeSwitchedULItem.iEExtensions != nil { - if err := (*eRABToBeSwitchedULItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSwitchedULItem.extensions.Present() { - if err := eRABToBeSwitchedULItem.extensions.MarshalPER(w, enc); err != nil { + if eRABItem.extensions.Present() { + if err := eRABItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABItem *ERABItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABItem = ERABItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -1602,400 +2313,441 @@ func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&eRABToBeSwitchedULItem.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSwitchedULItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&eRABItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeSwitchedULItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABItem.Cause).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABItem, eRABItem, &eRABItem.iEExtensions); err != nil { return err } - eRABToBeSwitchedULItem.iEExtensions = &v } if extBit { - if err := eRABToBeSwitchedULItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := emergencyAreaIDBroadcastItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { +var extIEsERABItem []ap.IESpec[ProtocolIEID, ERABItem] + +func (eRABItem *ERABItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABItem.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABItem.Cause.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABItem, eRABItem, eRABItem.iEExtensions) + return notComprehended +} + +func (eRABLevelQoSParameters *ERABLevelQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABLevelQoSParameters, eRABLevelQoSParameters, eRABLevelQoSParameters.iEExtensions) + w.WriteBit(eRABLevelQoSParameters.extensions.Present()) + w.WriteBit(eRABLevelQoSParameters.GBR != nil) + w.WriteBit(len(ext) > 0) + if err := eRABLevelQoSParameters.QCI.MarshalPER(w, enc); err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastItem.CompletedCellInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { + if err := eRABLevelQoSParameters.ARP.MarshalPER(w, enc); err != nil { return err } + if eRABLevelQoSParameters.GBR != nil { + if err := (*eRABLevelQoSParameters.GBR).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABLevelQoSParameters.extensions.Present() { + if err := eRABLevelQoSParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABLevelQoSParameters *ERABLevelQoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABLevelQoSParameters = ERABLevelQoSParameters{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_GBR, err := r.ReadBit() if err != nil { return err } - if err := (&emergencyAreaIDBroadcastItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - emergencyAreaIDBroadcastItem.CompletedCellInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDBroadcastItem.CompletedCellInEAI) - emergencyAreaIDBroadcastItem.CompletedCellInEAI = append(emergencyAreaIDBroadcastItem.CompletedCellInEAI, make([]CompletedCellInEAIItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDBroadcastItem.CompletedCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&eRABLevelQoSParameters.QCI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABLevelQoSParameters.ARP).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions + if p_GBR { + var v GBRQosInformation if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + eRABLevelQoSParameters.GBR = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABLevelQoSParameters, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions); err != nil { + return err + } } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABLevelQoSParameters.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue + } + return nil +} + +var extIEsERABLevelQoSParameters = []ap.IESpec[ProtocolIEID, ERABLevelQoSParameters]{ + { + ID: IDDownlinkPacketLossRate, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABLevelQoSParameters, r *per.Reader, enc per.Encoding) error { + var v PacketLossRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DownlinkPacketLossRate = &v + return nil + }, + Encode: func(x *ERABLevelQoSParameters) (per.Marshaler, bool) { + if x.DownlinkPacketLossRate == nil { + return nil, false } - if err := per.SkipOpenType(r, enc); err != nil { + return x.DownlinkPacketLossRate, true + }, + }, + { + ID: IDUplinkPacketLossRate, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABLevelQoSParameters, r *per.Reader, enc per.Encoding) error { + var v PacketLossRate + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } + x.UplinkPacketLossRate = &v + return nil + }, + Encode: func(x *ERABLevelQoSParameters) (per.Marshaler, bool) { + if x.UplinkPacketLossRate == nil { + return nil, false + } + return x.UplinkPacketLossRate, true + }, + }, +} + +func (eRABLevelQoSParameters *ERABLevelQoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABLevelQoSParameters.ARP.Diagnose(d) { + notComprehended = true } - return nil + if eRABLevelQoSParameters.GBR != nil && eRABLevelQoSParameters.GBR.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABLevelQoSParameters, eRABLevelQoSParameters, eRABLevelQoSParameters.iEExtensions) + return notComprehended } -func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := emergencyAreaIDCancelledItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { +func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, eRABModifyItemBearerModRes.iEExtensions) + w.WriteBit(eRABModifyItemBearerModRes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABModifyItemBearerModRes.ERABID.MarshalPER(w, enc); err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledItem.CancelledCellInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDCancelledItem.CancelledCellInEAI[i].MarshalPER(w, enc); err != nil { - return err - } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABModifyItemBearerModRes.extensions.Present() { + if err := eRABModifyItemBearerModRes.extensions.MarshalPER(w, enc); err != nil { + return err } - off1 = end - return nil - }); err != nil { - return err } return nil } -func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABModifyItemBearerModRes = ERABModifyItemBearerModRes{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&emergencyAreaIDCancelledItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { - return err - } - emergencyAreaIDCancelledItem.CancelledCellInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDCancelledItem.CancelledCellInEAI) - emergencyAreaIDCancelledItem.CancelledCellInEAI = append(emergencyAreaIDCancelledItem.CancelledCellInEAI, make([]CancelledCellInEAIItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDCancelledItem.CancelledCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&eRABModifyItemBearerModRes.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, &eRABModifyItemBearerModRes.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABModifyItemBearerModRes.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (fiveGSTAI *FiveGSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := fiveGSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err +var extIEsERABModifyItemBearerModRes []ap.IESpec[ProtocolIEID, ERABModifyItemBearerModRes] + +func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABModifyItemBearerModRes.ERABID.Diagnose(d) { + notComprehended = true } - if err := fiveGSTAI.TAC.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, eRABModifyItemBearerModRes.iEExtensions) + return notComprehended +} + +func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp.iEExtensions) + w.WriteBit(eRABReleaseItemBearerRelComp.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABReleaseItemBearerRelComp.ERABID.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABReleaseItemBearerRelComp.extensions.Present() { + if err := eRABReleaseItemBearerRelComp.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (fiveGSTAI *FiveGSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABReleaseItemBearerRelComp = ERABReleaseItemBearerRelComp{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&fiveGSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&fiveGSTAI.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&eRABReleaseItemBearerRelComp.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, &eRABReleaseItemBearerRelComp.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABReleaseItemBearerRelComp.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (forbiddenLAsItem *ForbiddenLAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := forbiddenLAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { +var extIEsERABReleaseItemBearerRelComp []ap.IESpec[ProtocolIEID, ERABReleaseItemBearerRelComp] + +func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABReleaseItemBearerRelComp.ERABID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp.iEExtensions) + return notComprehended +} + +func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, eRABSetupItemCtxtSURes.iEExtensions) + w.WriteBit(eRABSetupItemCtxtSURes.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABSetupItemCtxtSURes.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := forbiddenLAsItem.ForbiddenLACs.MarshalPER(w, enc); err != nil { + if err := eRABSetupItemCtxtSURes.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABSetupItemCtxtSURes.GTPTEID.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABSetupItemCtxtSURes.extensions.Present() { + if err := eRABSetupItemCtxtSURes.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (forbiddenLAsItem *ForbiddenLAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABSetupItemCtxtSURes = ERABSetupItemCtxtSURes{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&forbiddenLAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABSetupItemCtxtSURes.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&forbiddenLAsItem.ForbiddenLACs).UnmarshalPER(r, enc); err != nil { + if err := (&eRABSetupItemCtxtSURes.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&eRABSetupItemCtxtSURes.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, &eRABSetupItemCtxtSURes.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABSetupItemCtxtSURes.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (forbiddenTAsItem *ForbiddenTAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := forbiddenTAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { +var extIEsERABSetupItemCtxtSURes []ap.IESpec[ProtocolIEID, ERABSetupItemCtxtSURes] + +func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABSetupItemCtxtSURes.ERABID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, eRABSetupItemCtxtSURes.iEExtensions) + return notComprehended +} + +func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd.iEExtensions) + w.WriteBit(eRABToBeModifiedItemBearerModInd.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeModifiedItemBearerModInd.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := forbiddenTAsItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { + if err := eRABToBeModifiedItemBearerModInd.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeModifiedItemBearerModInd.DLGTPTEID.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABToBeModifiedItemBearerModInd.extensions.Present() { + if err := eRABToBeModifiedItemBearerModInd.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (forbiddenTAsItem *ForbiddenTAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeModifiedItemBearerModInd = ERABToBeModifiedItemBearerModInd{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&forbiddenTAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModInd.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&forbiddenTAsItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModInd.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModInd.DLGTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, &eRABToBeModifiedItemBearerModInd.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeModifiedItemBearerModInd.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(gBRQosInformationExtIEs, gBRQosInformation, &gBRQosInformation.iEExtensions) - w.WriteBit(gBRQosInformation.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := gBRQosInformation.MaximumBitrateDL.MarshalPER(w, enc); err != nil { - return err +var extIEsERABToBeModifiedItemBearerModInd []ap.IESpec[ProtocolIEID, ERABToBeModifiedItemBearerModInd] + +func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeModifiedItemBearerModInd.ERABID.Diagnose(d) { + notComprehended = true } - if err := gBRQosInformation.MaximumBitrateUL.MarshalPER(w, enc); err != nil { + ap.DiagnoseExtensions(d, extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd.iEExtensions) + return notComprehended +} + +func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq.iEExtensions) + w.WriteBit(eRABToBeModifiedItemBearerModReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeModifiedItemBearerModReq.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := gBRQosInformation.GuaranteedBitrateDL.MarshalPER(w, enc); err != nil { + if err := eRABToBeModifiedItemBearerModReq.QoS.MarshalPER(w, enc); err != nil { return err } - if err := gBRQosInformation.GuaranteedBitrateUL.MarshalPER(w, enc); err != nil { + if err := eRABToBeModifiedItemBearerModReq.NASPDU.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := encodeExtensionContainer(w, enc, ext); err != nil { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if gBRQosInformation.extensions.Present() { - if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeModifiedItemBearerModReq.extensions.Present() { + if err := eRABToBeModifiedItemBearerModReq.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeModifiedItemBearerModReq = ERABToBeModifiedItemBearerModReq{} extBit, err := r.ReadBit() if err != nil { return err @@ -2004,413 +2756,614 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. if err != nil { return err } - if err := (&gBRQosInformation.MaximumBitrateDL).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&gBRQosInformation.MaximumBitrateUL).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModReq.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gBRQosInformation.GuaranteedBitrateDL).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModReq.QoS).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gBRQosInformation.GuaranteedBitrateUL).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModReq.NASPDU).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := decodeExtensionContainer(r, enc, gBRQosInformationExtIEs, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions); err != nil { return err } } if extBit { - if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeModifiedItemBearerModReq.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (gNB *GNB) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := gNB.GlobalGNBID.MarshalPER(w, enc); err != nil { - return err - } - return nil -} +var extIEsERABToBeModifiedItemBearerModReq = []ap.IESpec[ProtocolIEID, ERABToBeModifiedItemBearerModReq]{ + { + ID: IDTransportInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *ERABToBeModifiedItemBearerModReq, r *per.Reader, enc per.Encoding) error { + var v TransportInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TransportInformation = &v + return nil + }, + Encode: func(x *ERABToBeModifiedItemBearerModReq) (per.Marshaler, bool) { + if x.TransportInformation == nil { + return nil, false + } + return x.TransportInformation, true + }, + }, +} -func (gNB *GNB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeModifiedItemBearerModReq.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABToBeModifiedItemBearerModReq.QoS.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq.iEExtensions) + return notComprehended +} + +func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemBearerSUReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeSetupItemBearerSUReq.ERABID.MarshalPER(w, enc); err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { + if err := eRABToBeSetupItemBearerSUReq.QoS.MarshalPER(w, enc); err != nil { return err } - if err := (&gNB.GlobalGNBID).UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSetupItemBearerSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSetupItemBearerSUReq.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemBearerSUReq.NASPDU.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if eRABToBeSetupItemBearerSUReq.extensions.Present() { + if err := eRABToBeSetupItemBearerSUReq.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (gUMMEI *GUMMEI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := gUMMEI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := gUMMEI.MMEGroupID.MarshalPER(w, enc); err != nil { +func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSetupItemBearerSUReq = ERABToBeSetupItemBearerSUReq{} + extBit, err := r.ReadBit() + if err != nil { return err } - if err := gUMMEI.MMECode.MarshalPER(w, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - return nil -} - -func (gUMMEI *GUMMEI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.ERABID).UnmarshalPER(r, enc); err != nil { return err } - p_f3, err := r.ReadBit() - if err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.QoS).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gUMMEI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gUMMEI.MMEGroupID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gUMMEI.MMECode).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { return err } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeSetupItemBearerSUReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue + } + return nil +} + +var extIEsERABToBeSetupItemBearerSUReq = []ap.IESpec[ProtocolIEID, ERABToBeSetupItemBearerSUReq]{ + { + ID: IDCorrelationID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CorrelationID = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.CorrelationID == nil { + return nil, false } - if err := per.SkipOpenType(r, enc); err != nil { + return x.CorrelationID, true + }, + }, + { + ID: IDSIPTOCorrelationID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - } - return nil + x.SIPTOCorrelationID = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.SIPTOCorrelationID == nil { + return nil, false + } + return x.SIPTOCorrelationID, true + }, + }, + { + ID: IDBearerType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v BearerType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.BearerType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.BearerType == nil { + return nil, false + } + return x.BearerType, true + }, + }, + { + ID: IDEthernetType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v EthernetType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EthernetType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.EthernetType == nil { + return nil, false + } + return x.EthernetType, true + }, + }, + { + ID: IDSecurityIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + }, } -func (globalENBID *GlobalENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := globalENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err +func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeSetupItemBearerSUReq.ERABID.Diagnose(d) { + notComprehended = true } - if err := globalENBID.ENBID.MarshalPER(w, enc); err != nil { - return err + if eRABToBeSetupItemBearerSUReq.QoS.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq.iEExtensions) + return notComprehended } -func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemCtxtSUReq.extensions.Present()) + w.WriteBit(eRABToBeSetupItemCtxtSUReq.NASPDU != nil) + w.WriteBit(len(ext) > 0) + if err := eRABToBeSetupItemCtxtSUReq.ERABID.MarshalPER(w, enc); err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { + if err := eRABToBeSetupItemCtxtSUReq.QoS.MarshalPER(w, enc); err != nil { return err } - if err := (&globalENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := (&globalENBID.ENBID).UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.GTPTEID.MarshalPER(w, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if eRABToBeSetupItemCtxtSUReq.NASPDU != nil { + if err := eRABToBeSetupItemCtxtSUReq.NASPDU.MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if eRABToBeSetupItemCtxtSUReq.extensions.Present() { + if err := eRABToBeSetupItemCtxtSUReq.extensions.MarshalPER(w, enc); err != nil { + return err } } return nil } -func (globalGNBID *GlobalGNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := globalGNBID.PLMNIdentity.MarshalPER(w, enc); err != nil { +func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSetupItemCtxtSUReq = ERABToBeSetupItemCtxtSUReq{} + extBit, err := r.ReadBit() + if err != nil { return err } - if err := globalGNBID.GNBID.MarshalPER(w, enc); err != nil { + p_NASPDU, err := r.ReadBit() + if err != nil { return err } - return nil -} - -func (globalGNBID *GlobalGNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&globalGNBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.QoS).UnmarshalPER(r, enc); err != nil { return err } - if err := (&globalGNBID.GNBID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NASPDU { + if err := (&eRABToBeSetupItemCtxtSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue + } + return nil +} + +var extIEsERABToBeSetupItemCtxtSUReq = []ap.IESpec[ProtocolIEID, ERABToBeSetupItemCtxtSUReq]{ + { + ID: IDCorrelationID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err } - if err := per.SkipOpenType(r, enc); err != nil { + x.CorrelationID = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.CorrelationID == nil { + return nil, false + } + return x.CorrelationID, true + }, + }, + { + ID: IDSIPTOCorrelationID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } + x.SIPTOCorrelationID = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.SIPTOCorrelationID == nil { + return nil, false + } + return x.SIPTOCorrelationID, true + }, + }, + { + ID: IDBearerType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v BearerType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.BearerType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.BearerType == nil { + return nil, false + } + return x.BearerType, true + }, + }, + { + ID: IDEthernetType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v EthernetType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EthernetType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.EthernetType == nil { + return nil, false + } + return x.EthernetType, true + }, + }, + { + ID: IDSecurityIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + }, +} + +func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeSetupItemCtxtSUReq.ERABID.Diagnose(d) { + notComprehended = true } - return nil + if eRABToBeSetupItemCtxtSUReq.QoS.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq.iEExtensions) + return notComprehended } -func (handoverRestrictionList *HandoverRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(handoverRestrictionList.EquivalentPLMNs != nil) - w.WriteBit(handoverRestrictionList.ForbiddenTAs != nil) - w.WriteBit(handoverRestrictionList.ForbiddenLAs != nil) - w.WriteBit(handoverRestrictionList.ForbiddenInterRATs != nil) - w.WriteBit(false) - if err := handoverRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, eRABToBeSetupItemHOReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemHOReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeSetupItemHOReq.ERABID.MarshalPER(w, enc); err != nil { return err } - if handoverRestrictionList.EquivalentPLMNs != nil { - if err := handoverRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { - return err - } + if err := eRABToBeSetupItemHOReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err } - if handoverRestrictionList.ForbiddenTAs != nil { - if err := handoverRestrictionList.ForbiddenTAs.MarshalPER(w, enc); err != nil { - return err - } + if err := eRABToBeSetupItemHOReq.GTPTEID.MarshalPER(w, enc); err != nil { + return err } - if handoverRestrictionList.ForbiddenLAs != nil { - if err := handoverRestrictionList.ForbiddenLAs.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemHOReq.QoS.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if handoverRestrictionList.ForbiddenInterRATs != nil { - if err := (*handoverRestrictionList.ForbiddenInterRATs).MarshalPER(w, enc); err != nil { + if eRABToBeSetupItemHOReq.extensions.Present() { + if err := eRABToBeSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (handoverRestrictionList *HandoverRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSetupItemHOReq = ERABToBeSetupItemHOReq{} extBit, err := r.ReadBit() if err != nil { return err } - p_EquivalentPLMNs, err := r.ReadBit() - if err != nil { - return err - } - p_ForbiddenTAs, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_ForbiddenLAs, err := r.ReadBit() - if err != nil { + if err := (&eRABToBeSetupItemHOReq.ERABID).UnmarshalPER(r, enc); err != nil { return err } - p_ForbiddenInterRATs, err := r.ReadBit() - if err != nil { + if err := (&eRABToBeSetupItemHOReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - p_f5, err := r.ReadBit() - if err != nil { + if err := (&eRABToBeSetupItemHOReq.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&handoverRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemHOReq.QoS).UnmarshalPER(r, enc); err != nil { return err } - if p_EquivalentPLMNs { - if err := (&handoverRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, &eRABToBeSetupItemHOReq.iEExtensions); err != nil { return err } } - if p_ForbiddenTAs { - if err := (&handoverRestrictionList.ForbiddenTAs).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ForbiddenLAs { - if err := (&handoverRestrictionList.ForbiddenLAs).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ForbiddenInterRATs { - var v ForbiddenInterRATs - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - handoverRestrictionList.ForbiddenInterRATs = &v - } - if p_f5 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if extBit { + if err := eRABToBeSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) + return nil +} + +var extIEsERABToBeSetupItemHOReq = []ap.IESpec[ProtocolIEID, ERABToBeSetupItemHOReq]{ + { + ID: IDDataForwardingNotPossible, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v DataForwardingNotPossible + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err } + x.DataForwardingNotPossible = &v return nil - }); err != nil { - return err - } - for _, present := range extBits { - if !present { - continue + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.DataForwardingNotPossible == nil { + return nil, false } - if err := per.SkipOpenType(r, enc); err != nil { + return x.DataForwardingNotPossible, true + }, + }, + { + ID: IDBearerType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v BearerType + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } + x.BearerType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.BearerType == nil { + return nil, false + } + return x.BearerType, true + }, + }, + { + ID: IDEthernetType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v EthernetType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EthernetType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.EthernetType == nil { + return nil, false + } + return x.EthernetType, true + }, + }, + { + ID: IDSecurityIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + }, +} + +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeSetupItemHOReq.ERABID.Diagnose(d) { + notComprehended = true } - return nil + if eRABToBeSetupItemHOReq.QoS.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, eRABToBeSetupItemHOReq.iEExtensions) + return notComprehended } -func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(lastVisitedEUTRANCellInformation.extensions.Present()) - w.WriteBit(lastVisitedEUTRANCellInformation.iEExtensions != nil) - if err := lastVisitedEUTRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, eRABToBeSwitchedDLItem.iEExtensions) + w.WriteBit(eRABToBeSwitchedDLItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeSwitchedDLItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := lastVisitedEUTRANCellInformation.CellType.MarshalPER(w, enc); err != nil { + if err := eRABToBeSwitchedDLItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := lastVisitedEUTRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { + if err := eRABToBeSwitchedDLItem.GTPTEID.MarshalPER(w, enc); err != nil { return err } - if lastVisitedEUTRANCellInformation.iEExtensions != nil { - if err := (*lastVisitedEUTRANCellInformation.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if lastVisitedEUTRANCellInformation.extensions.Present() { - if err := lastVisitedEUTRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeSwitchedDLItem.extensions.Present() { + if err := eRABToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSwitchedDLItem = ERABToBeSwitchedDLItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -2419,290 +3372,308 @@ func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) Unmars if err != nil { return err } - if err := (&lastVisitedEUTRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedDLItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&lastVisitedEUTRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedDLItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if err := (&lastVisitedEUTRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedDLItem.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions); err != nil { return err } - lastVisitedEUTRANCellInformation.iEExtensions = &v } if extBit { - if err := lastVisitedEUTRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (ngENB *NgENB) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := ngENB.GlobalNgENBID.MarshalPER(w, enc); err != nil { - return err +var extIEsERABToBeSwitchedDLItem = []ap.IESpec[ProtocolIEID, ERABToBeSwitchedDLItem]{ + { + ID: IDSecurityIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ERABToBeSwitchedDLItem, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSwitchedDLItem) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + }, +} + +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeSwitchedDLItem.ERABID.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, eRABToBeSwitchedDLItem.iEExtensions) + return notComprehended } -func (ngENB *NgENB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, eRABToBeSwitchedULItem.iEExtensions) + w.WriteBit(eRABToBeSwitchedULItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeSwitchedULItem.ERABID.MarshalPER(w, enc); err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { + if err := eRABToBeSwitchedULItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := (&ngENB.GlobalNgENBID).UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSwitchedULItem.GTPTEID.MarshalPER(w, enc); err != nil { return err } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if eRABToBeSwitchedULItem.extensions.Present() { + if err := eRABToBeSwitchedULItem.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } - return nil -} - -func (requestType *RequestType) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := encodeRootEnumerated(w, enc, 3, int64(requestType.EventType), "EventType"); err != nil { - return err - } - if err := encodeRootEnumerated(w, enc, 1, int64(requestType.ReportArea), "ReportArea"); err != nil { - return err } return nil } -func (requestType *RequestType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSwitchedULItem = ERABToBeSwitchedULItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - e0, err := decodeRootEnumerated(r, enc, 3, "EventType") - if err != nil { + if err := (&eRABToBeSwitchedULItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - requestType.EventType = EventType(e0) - e1, err := decodeRootEnumerated(r, enc, 1, "ReportArea") - if err != nil { + if err := (&eRABToBeSwitchedULItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - requestType.ReportArea = ReportArea(e1) - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedULItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, &eRABToBeSwitchedULItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eRABToBeSwitchedULItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (sTMSI *STMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := sTMSI.MMEC.MarshalPER(w, enc); err != nil { +var extIEsERABToBeSwitchedULItem []ap.IESpec[ProtocolIEID, ERABToBeSwitchedULItem] + +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeSwitchedULItem.ERABID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, eRABToBeSwitchedULItem.iEExtensions) + return notComprehended +} + +func (eUTRANCGI *EUTRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEUTRANCGI, eUTRANCGI, eUTRANCGI.iEExtensions) + w.WriteBit(eUTRANCGI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eUTRANCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := sTMSI.MTMSI.MarshalPER(w, enc); err != nil { + if err := eUTRANCGI.CellID.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eUTRANCGI.extensions.Present() { + if err := eUTRANCGI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (sTMSI *STMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (eUTRANCGI *EUTRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANCGI = EUTRANCGI{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&sTMSI.MMEC).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&sTMSI.MTMSI).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCGI.CellID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCGI, eUTRANCGI, &eUTRANCGI.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := eUTRANCGI.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { +var extIEsEUTRANCGI []ap.IESpec[ProtocolIEID, EUTRANCGI] + +func (eUTRANCGI *EUTRANCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsEUTRANCGI, eUTRANCGI, eUTRANCGI.iEExtensions) + return notComprehended +} + +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem.iEExtensions) + w.WriteBit(emergencyAreaIDBroadcastItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDBroadcastItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { return err } - if err := securityContext.NextHopParameter.MarshalPER(w, enc); err != nil { + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastItem.CompletedCellInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if emergencyAreaIDBroadcastItem.extensions.Present() { + if err := emergencyAreaIDBroadcastItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDBroadcastItem = EmergencyAreaIDBroadcastItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}) - if err != nil { + if err := (&emergencyAreaIDBroadcastItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { return err } - securityContext.NextHopChainingCount = uint8(n0) - if err := (&securityContext.NextHopParameter).UnmarshalPER(r, enc); err != nil { + emergencyAreaIDBroadcastItem.CompletedCellInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDBroadcastItem.CompletedCellInEAI) + emergencyAreaIDBroadcastItem.CompletedCellInEAI = append(emergencyAreaIDBroadcastItem.CompletedCellInEAI, make([]CompletedCellInEAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDBroadcastItem.CompletedCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, &emergencyAreaIDBroadcastItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := emergencyAreaIDBroadcastItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(securityIndication.extensions.Present()) - w.WriteBit(securityIndication.iEExtensions != nil) - if err := securityIndication.IntegrityProtectionIndication.MarshalPER(w, enc); err != nil { +var extIEsEmergencyAreaIDBroadcastItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastItem] + +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDBroadcastItem.CompletedCellInEAI { + if emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem.iEExtensions) + return notComprehended +} + +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem.iEExtensions) + w.WriteBit(emergencyAreaIDCancelledItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDCancelledItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledItem.CancelledCellInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDCancelledItem.CancelledCellInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { return err } - if securityIndication.iEExtensions != nil { - if err := (*securityIndication.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if securityIndication.extensions.Present() { - if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + if emergencyAreaIDCancelledItem.extensions.Present() { + if err := emergencyAreaIDCancelledItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDCancelledItem = EmergencyAreaIDCancelledItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -2711,973 +3682,9135 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe if err != nil { return err } - if err := (&securityIndication.IntegrityProtectionIndication).UnmarshalPER(r, enc); err != nil { + if err := (&emergencyAreaIDCancelledItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + return err + } + emergencyAreaIDCancelledItem.CancelledCellInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDCancelledItem.CancelledCellInEAI) + emergencyAreaIDCancelledItem.CancelledCellInEAI = append(emergencyAreaIDCancelledItem.CancelledCellInEAI, make([]CancelledCellInEAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDCancelledItem.CancelledCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { return err } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, &emergencyAreaIDCancelledItem.iEExtensions); err != nil { return err } - securityIndication.iEExtensions = &v } if extBit { - if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { + if err := emergencyAreaIDCancelledItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (servedGUMMEIsItem *ServedGUMMEIsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - off0 := 0 - if err := per.EncodeLength(w, enc, 1, 32, true, int64(len(servedGUMMEIsItem.ServedPLMNs)), func(count int64) error { - end := off0 + int(count) - for i := off0; i < end; i++ { - if err := servedGUMMEIsItem.ServedPLMNs[i].MarshalPER(w, enc); err != nil { - return err - } - } - off0 = end - return nil - }); err != nil { - return err - } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(servedGUMMEIsItem.ServedGroupIDs)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := servedGUMMEIsItem.ServedGroupIDs[i].MarshalPER(w, enc); err != nil { - return err - } +var extIEsEmergencyAreaIDCancelledItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDCancelledItem] + +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDCancelledItem.CancelledCellInEAI { + if emergencyAreaIDCancelledItem.CancelledCellInEAI[i].Diagnose(d) { + notComprehended = true } - off1 = end - return nil - }); err != nil { - return err } - off2 := 0 - if err := per.EncodeLength(w, enc, 1, 256, true, int64(len(servedGUMMEIsItem.ServedMMECs)), func(count int64) error { - end := off2 + int(count) - for i := off2; i < end; i++ { - if err := servedGUMMEIsItem.ServedMMECs[i].MarshalPER(w, enc); err != nil { - return err - } - } - off2 = end - return nil - }); err != nil { + ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem.iEExtensions) + return notComprehended +} + +func (emergencyIndicator EmergencyIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEmergencyIndicator.Encode(w, enc, emergencyIndicator) +} + +func (emergencyIndicator *EmergencyIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEmergencyIndicator.Decode(r, enc) + if err != nil { return err } + *emergencyIndicator = v return nil } -func (servedGUMMEIsItem *ServedGUMMEIsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (emergencyIndicator EmergencyIndicator) Name() string { + return enumEmergencyIndicator.Name(emergencyIndicator) +} + +func (emergencyIndicator EmergencyIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEmergencyIndicator.Known(emergencyIndicator) +} + +func (ethernetType EthernetType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEthernetType.Encode(w, enc, ethernetType) +} + +func (ethernetType *EthernetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEthernetType.Decode(r, enc) if err != nil { return err } - p_f3, err := r.ReadBit() + *ethernetType = v + return nil +} + +func (ethernetType EthernetType) Name() string { + return enumEthernetType.Name(ethernetType) +} + +func (ethernetType EthernetType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEthernetType.Known(ethernetType) +} + +func (eventType EventType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEventType.Encode(w, enc, eventType) +} + +func (eventType *EventType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEventType.Decode(r, enc) if err != nil { return err } - servedGUMMEIsItem.ServedPLMNs = nil - if err := per.DecodeLength(r, enc, 1, 32, true, func(count int64) error { - start := len(servedGUMMEIsItem.ServedPLMNs) - servedGUMMEIsItem.ServedPLMNs = append(servedGUMMEIsItem.ServedPLMNs, make([]PLMNIdentity, count)...) - for i := int64(0); i < count; i++ { - if err := (&servedGUMMEIsItem.ServedPLMNs[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { - return err - } - servedGUMMEIsItem.ServedGroupIDs = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(servedGUMMEIsItem.ServedGroupIDs) - servedGUMMEIsItem.ServedGroupIDs = append(servedGUMMEIsItem.ServedGroupIDs, make([]MMEGroupID, count)...) - for i := int64(0); i < count; i++ { - if err := (&servedGUMMEIsItem.ServedGroupIDs[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + *eventType = v + return nil +} + +func (eventType EventType) Name() string { + return enumEventType.Name(eventType) +} + +func (eventType EventType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumEventType.Known(eventType) +} + +func (fiveGSTAI *FiveGSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsFiveGSTAI, fiveGSTAI, fiveGSTAI.iEExtensions) + w.WriteBit(fiveGSTAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := fiveGSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - servedGUMMEIsItem.ServedMMECs = nil - if err := per.DecodeLength(r, enc, 1, 256, true, func(count int64) error { - start := len(servedGUMMEIsItem.ServedMMECs) - servedGUMMEIsItem.ServedMMECs = append(servedGUMMEIsItem.ServedMMECs, make([]MMECode, count)...) - for i := int64(0); i < count; i++ { - if err := (&servedGUMMEIsItem.ServedMMECs[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := fiveGSTAI.TAC.MarshalPER(w, enc); err != nil { return err } - if p_f3 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if fiveGSTAI.extensions.Present() { + if err := fiveGSTAI.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(sourceeNBToTargeteNBTransparentContainer.extensions.Present()) - w.WriteBit(sourceeNBToTargeteNBTransparentContainer.ERABInformationList != nil) - w.WriteBit(sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP != nil) - w.WriteBit(sourceeNBToTargeteNBTransparentContainer.iEExtensions != nil) - if err := sourceeNBToTargeteNBTransparentContainer.RRCContainer.MarshalPER(w, enc); err != nil { +func (fiveGSTAI *FiveGSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fiveGSTAI = FiveGSTAI{} + extBit, err := r.ReadBit() + if err != nil { return err } - if sourceeNBToTargeteNBTransparentContainer.ERABInformationList != nil { - if err := sourceeNBToTargeteNBTransparentContainer.ERABInformationList.MarshalPER(w, enc); err != nil { - return err - } - } - if err := sourceeNBToTargeteNBTransparentContainer.TargetCellID.MarshalPER(w, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP != nil { - if err := (*sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP).MarshalPER(w, enc); err != nil { - return err - } + if err := (&fiveGSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err } - if err := sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation.MarshalPER(w, enc); err != nil { + if err := (&fiveGSTAI.TAC).UnmarshalPER(r, enc); err != nil { return err } - if sourceeNBToTargeteNBTransparentContainer.iEExtensions != nil { - if err := (*sourceeNBToTargeteNBTransparentContainer.iEExtensions).MarshalPER(w, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGSTAI, fiveGSTAI, &fiveGSTAI.iEExtensions); err != nil { return err } } - if sourceeNBToTargeteNBTransparentContainer.extensions.Present() { - if err := sourceeNBToTargeteNBTransparentContainer.extensions.MarshalPER(w, enc); err != nil { + if extBit { + if err := fiveGSTAI.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_ERABInformationList, err := r.ReadBit() +var extIEsFiveGSTAI []ap.IESpec[ProtocolIEID, FiveGSTAI] + +func (fiveGSTAI *FiveGSTAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsFiveGSTAI, fiveGSTAI, fiveGSTAI.iEExtensions) + return notComprehended +} + +func (forbiddenInterRATs ForbiddenInterRATs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumForbiddenInterRATs.Encode(w, enc, forbiddenInterRATs) +} + +func (forbiddenInterRATs *ForbiddenInterRATs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumForbiddenInterRATs.Decode(r, enc) if err != nil { return err } - p_SubscriberProfileIDforRFP, err := r.ReadBit() - if err != nil { + *forbiddenInterRATs = v + return nil +} + +func (forbiddenInterRATs ForbiddenInterRATs) Name() string { + return enumForbiddenInterRATs.Name(forbiddenInterRATs) +} + +func (forbiddenInterRATs ForbiddenInterRATs) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumForbiddenInterRATs.Known(forbiddenInterRATs) +} + +func (forbiddenLAsItem *ForbiddenLAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsForbiddenLAsItem, forbiddenLAsItem, forbiddenLAsItem.iEExtensions) + w.WriteBit(forbiddenLAsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := forbiddenLAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - p_iEExtensions, err := r.ReadBit() - if err != nil { + if err := forbiddenLAsItem.ForbiddenLACs.MarshalPER(w, enc); err != nil { return err } - if err := (&sourceeNBToTargeteNBTransparentContainer.RRCContainer).UnmarshalPER(r, enc); err != nil { - return err + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } } - if p_ERABInformationList { - if err := (&sourceeNBToTargeteNBTransparentContainer.ERABInformationList).UnmarshalPER(r, enc); err != nil { + if forbiddenLAsItem.extensions.Present() { + if err := forbiddenLAsItem.extensions.MarshalPER(w, enc); err != nil { return err } } - if err := (&sourceeNBToTargeteNBTransparentContainer.TargetCellID).UnmarshalPER(r, enc); err != nil { + return nil +} + +func (forbiddenLAsItem *ForbiddenLAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *forbiddenLAsItem = ForbiddenLAsItem{} + extBit, err := r.ReadBit() + if err != nil { return err } - if p_SubscriberProfileIDforRFP { - var v SubscriberProfileIDforRFP - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP = &v + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err } - if err := (&sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation).UnmarshalPER(r, enc); err != nil { + if err := (&forbiddenLAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&forbiddenLAsItem.ForbiddenLACs).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - var v transparentIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenLAsItem, forbiddenLAsItem, &forbiddenLAsItem.iEExtensions); err != nil { return err } - sourceeNBToTargeteNBTransparentContainer.iEExtensions = &v } if extBit { - if err := sourceeNBToTargeteNBTransparentContainer.extensions.UnmarshalPER(r, enc); err != nil { + if err := forbiddenLAsItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { +var extIEsForbiddenLAsItem []ap.IESpec[ProtocolIEID, ForbiddenLAsItem] + +func (forbiddenLAsItem *ForbiddenLAsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsForbiddenLAsItem, forbiddenLAsItem, forbiddenLAsItem.iEExtensions) + return notComprehended +} + +func (forbiddenTAsItem *ForbiddenTAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsForbiddenTAsItem, forbiddenTAsItem, forbiddenTAsItem.iEExtensions) + w.WriteBit(forbiddenTAsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := forbiddenTAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := supportedTAItem.BroadcastPLMNs.MarshalPER(w, enc); err != nil { + if err := forbiddenTAsItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if forbiddenTAsItem.extensions.Present() { + if err := forbiddenTAsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (forbiddenTAsItem *ForbiddenTAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *forbiddenTAsItem = ForbiddenTAsItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&supportedTAItem.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&forbiddenTAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&supportedTAItem.BroadcastPLMNs).UnmarshalPER(r, enc); err != nil { + if err := (&forbiddenTAsItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenTAsItem, forbiddenTAsItem, &forbiddenTAsItem.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := forbiddenTAsItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := tAI.TAC.MarshalPER(w, enc); err != nil { - return err - } - return nil +var extIEsForbiddenTAsItem []ap.IESpec[ProtocolIEID, ForbiddenTAsItem] + +func (forbiddenTAsItem *ForbiddenTAsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsForbiddenTAsItem, forbiddenTAsItem, forbiddenTAsItem.iEExtensions) + return notComprehended } -func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) + w.WriteBit(gBRQosInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gBRQosInformation.MaximumBitrateDL.MarshalPER(w, enc); err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { + if err := gBRQosInformation.MaximumBitrateUL.MarshalPER(w, enc); err != nil { return err } - if err := (&tAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := gBRQosInformation.GuaranteedBitrateDL.MarshalPER(w, enc); err != nil { return err } - if err := (&tAI.TAC).UnmarshalPER(r, enc); err != nil { + if err := gBRQosInformation.GuaranteedBitrateUL.MarshalPER(w, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if gBRQosInformation.extensions.Present() { + if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (tAIBroadcastItem *TAIBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAIBroadcastItem.TAI.MarshalPER(w, enc); err != nil { +func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gBRQosInformation = GBRQosInformation{} + extBit, err := r.ReadBit() + if err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastItem.CompletedCellInTAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := tAIBroadcastItem.CompletedCellInTAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - return nil -} - -func (tAIBroadcastItem *TAIBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { + if err := (&gBRQosInformation.MaximumBitrateDL).UnmarshalPER(r, enc); err != nil { return err } - p_f2, err := r.ReadBit() - if err != nil { + if err := (&gBRQosInformation.MaximumBitrateUL).UnmarshalPER(r, enc); err != nil { return err } - if err := (&tAIBroadcastItem.TAI).UnmarshalPER(r, enc); err != nil { + if err := (&gBRQosInformation.GuaranteedBitrateDL).UnmarshalPER(r, enc); err != nil { return err } - tAIBroadcastItem.CompletedCellInTAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(tAIBroadcastItem.CompletedCellInTAI) - tAIBroadcastItem.CompletedCellInTAI = append(tAIBroadcastItem.CompletedCellInTAI, make([]CompletedCellInTAIItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&tAIBroadcastItem.CompletedCellInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&gBRQosInformation.GuaranteedBitrateUL).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue + } + return nil +} + +var extIEsGBRQosInformation = []ap.IESpec[ProtocolIEID, GBRQosInformation]{ + { + ID: IDExtendedERABMaximumBitrateDL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedMaximumBitrateDL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedMaximumBitrateDL == nil { + return nil, false } - if err := per.SkipOpenType(r, enc); err != nil { + return x.ExtendedMaximumBitrateDL, true + }, + }, + { + ID: IDExtendedERABMaximumBitrateUL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - } - return nil + x.ExtendedMaximumBitrateUL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedMaximumBitrateUL == nil { + return nil, false + } + return x.ExtendedMaximumBitrateUL, true + }, + }, + { + ID: IDExtendedERABGuaranteedBitrateDL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedGuaranteedBitrateDL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedGuaranteedBitrateDL == nil { + return nil, false + } + return x.ExtendedGuaranteedBitrateDL, true + }, + }, + { + ID: IDExtendedERABGuaranteedBitrateUL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedGuaranteedBitrateUL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedGuaranteedBitrateUL == nil { + return nil, false + } + return x.ExtendedGuaranteedBitrateUL, true + }, + }, } -func (tAICancelledItem *TAICancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := tAICancelledItem.TAI.MarshalPER(w, enc); err != nil { +func (gBRQosInformation *GBRQosInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) + return notComprehended +} + +func (gNB *GNB) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGNB, gNB, gNB.iEExtensions) + w.WriteBit(gNB.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gNB.GlobalGNBID.MarshalPER(w, enc); err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledItem.CancelledCellInTAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := tAICancelledItem.CancelledCellInTAI[i].MarshalPER(w, enc); err != nil { - return err - } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gNB.extensions.Present() { + if err := gNB.extensions.MarshalPER(w, enc); err != nil { + return err } - off1 = end - return nil - }); err != nil { - return err } return nil } -func (tAICancelledItem *TAICancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (gNB *GNB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gNB = GNB{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&tAICancelledItem.TAI).UnmarshalPER(r, enc); err != nil { - return err - } - tAICancelledItem.CancelledCellInTAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(tAICancelledItem.CancelledCellInTAI) - tAICancelledItem.CancelledCellInTAI = append(tAICancelledItem.CancelledCellInTAI, make([]CancelledCellInTAIItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&tAICancelledItem.CancelledCellInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&gNB.GlobalGNBID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGNB, gNB, &gNB.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := gNB.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (targetNgRanNodeID *TargetNgRanNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := targetNgRanNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { - return err - } - if err := targetNgRanNodeID.SelectedTAI.MarshalPER(w, enc); err != nil { - return err +var extIEsGNB []ap.IESpec[ProtocolIEID, GNB] + +func (gNB *GNB) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if gNB.GlobalGNBID.Diagnose(d) { + notComprehended = true } - return nil + ap.DiagnoseExtensions(d, extIEsGNB, gNB, gNB.iEExtensions) + return notComprehended } -func (targetNgRanNodeID *TargetNgRanNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err +func (gNBIdentity *GNBIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{gNBIdentity.GNBID != nil, gNBIdentity.Ext != nil} { + if ok { + set++ + } } - p_f2, err := r.ReadBit() - if err != nil { - return err + if set > 1 { + return per.ErrChoice } - if err := (&targetNgRanNodeID.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { - return err + switch { + case gNBIdentity.GNBID != nil: + w.WriteBit(false) + if err := (*gNBIdentity.GNBID).MarshalPER(w, enc); err != nil { + return err + } + case gNBIdentity.Ext != nil: + w.WriteBit(true) + return gNBIdentity.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty } - if err := (&targetNgRanNodeID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return nil +} + +func (gNBIdentity *GNBIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gNBIdentity = GNBIdentity{} + isExt, err := r.ReadBit() + if err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { return err } - _ = v + gNBIdentity.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + var idx int64 = 0 + switch idx { + case 0: + var v GNBID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } + gNBIdentity.GNBID = &v + default: + return per.ErrOverflow } return nil } -func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := targeteNBID.GlobalENBID.MarshalPER(w, enc); err != nil { +func (gNBIdentity *GNBIdentity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case gNBIdentity.GNBID != nil: + case gNBIdentity.Ext != nil: + return true + } + return false +} + +func (gUMMEI *GUMMEI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGUMMEI, gUMMEI, gUMMEI.iEExtensions) + w.WriteBit(gUMMEI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gUMMEI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := targeteNBID.SelectedTAI.MarshalPER(w, enc); err != nil { + if err := gUMMEI.MMEGroupID.MarshalPER(w, enc); err != nil { + return err + } + if err := gUMMEI.MMECode.MarshalPER(w, enc); err != nil { return err } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gUMMEI.extensions.Present() { + if err := gUMMEI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } return nil } -func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (gUMMEI *GUMMEI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gUMMEI = GUMMEI{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&targeteNBID.GlobalENBID).UnmarshalPER(r, enc); err != nil { + if err := (&gUMMEI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&targeteNBID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + if err := (&gUMMEI.MMEGroupID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&gUMMEI.MMECode).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGUMMEI, gUMMEI, &gUMMEI.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := gUMMEI.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (transportInformation *TransportInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(transportInformation.extensions.Present()) - if err := transportInformation.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err - } - if err := transportInformation.ULGTPTEID.MarshalPER(w, enc); err != nil { +var extIEsGUMMEI []ap.IESpec[ProtocolIEID, GUMMEI] + +func (gUMMEI *GUMMEI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsGUMMEI, gUMMEI, gUMMEI.iEExtensions) + return notComprehended +} + +func (gUMMEIType GUMMEIType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumGUMMEIType.Encode(w, enc, gUMMEIType) +} + +func (gUMMEIType *GUMMEIType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumGUMMEIType.Decode(r, enc) + if err != nil { return err } - if transportInformation.extensions.Present() { - if err := transportInformation.extensions.MarshalPER(w, enc); err != nil { - return err - } - } + *gUMMEIType = v return nil } -func (transportInformation *TransportInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() +func (gUMMEIType GUMMEIType) Name() string { + return enumGUMMEIType.Name(gUMMEIType) +} + +func (gUMMEIType GUMMEIType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumGUMMEIType.Known(gUMMEIType) +} + +func (gWContextReleaseIndication GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumGWContextReleaseIndication.Encode(w, enc, gWContextReleaseIndication) +} + +func (gWContextReleaseIndication *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumGWContextReleaseIndication.Decode(r, enc) if err != nil { return err } - if err := (&transportInformation.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + *gWContextReleaseIndication = v + return nil +} + +func (gWContextReleaseIndication GWContextReleaseIndication) Name() string { + return enumGWContextReleaseIndication.Name(gWContextReleaseIndication) +} + +func (gWContextReleaseIndication GWContextReleaseIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumGWContextReleaseIndication.Known(gWContextReleaseIndication) +} + +func (globalENBID *GlobalENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + w.WriteBit(globalENBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if err := (&transportInformation.ULGTPTEID).UnmarshalPER(r, enc); err != nil { + if err := globalENBID.ENBID.MarshalPER(w, enc); err != nil { return err } - if extBit { - if err := transportInformation.extensions.UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - return nil -} - -func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := uEAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { - return err - } - if err := uEAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { - return err + if globalENBID.extensions.Present() { + if err := globalENBID.extensions.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalENBID = GlobalENBID{} extBit, err := r.ReadBit() if err != nil { return err } - p_f2, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&uEAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { + if err := (&globalENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if err := (&uEAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { + if err := (&globalENBID.ENBID).UnmarshalPER(r, enc); err != nil { return err } - if p_f2 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions); err != nil { return err } - _ = v } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := globalENBID.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } } return nil } -func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(uEAssociatedLogicalS1ConnectionItem.extensions.Present()) - w.WriteBit(uEAssociatedLogicalS1ConnectionItem.MMEUES1APID != nil) - w.WriteBit(uEAssociatedLogicalS1ConnectionItem.ENBUES1APID != nil) - w.WriteBit(uEAssociatedLogicalS1ConnectionItem.iEExtensions != nil) - if uEAssociatedLogicalS1ConnectionItem.MMEUES1APID != nil { - if err := (*uEAssociatedLogicalS1ConnectionItem.MMEUES1APID).MarshalPER(w, enc); err != nil { - return err - } +var extIEsGlobalENBID []ap.IESpec[ProtocolIEID, GlobalENBID] + +func (globalENBID *GlobalENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalENBID.ENBID.Diagnose(d) { + notComprehended = true } - if uEAssociatedLogicalS1ConnectionItem.ENBUES1APID != nil { - if err := (*uEAssociatedLogicalS1ConnectionItem.ENBUES1APID).MarshalPER(w, enc); err != nil { - return err - } + ap.DiagnoseExtensions(d, extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + return notComprehended +} + +func (globalGNBID *GlobalGNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + w.WriteBit(globalGNBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalGNBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalGNBID.GNBID.MarshalPER(w, enc); err != nil { + return err } - if uEAssociatedLogicalS1ConnectionItem.iEExtensions != nil { - if err := (*uEAssociatedLogicalS1ConnectionItem.iEExtensions).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if uEAssociatedLogicalS1ConnectionItem.extensions.Present() { - if err := uEAssociatedLogicalS1ConnectionItem.extensions.MarshalPER(w, enc); err != nil { + if globalGNBID.extensions.Present() { + if err := globalGNBID.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (globalGNBID *GlobalGNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalGNBID = GlobalGNBID{} extBit, err := r.ReadBit() if err != nil { return err } - p_MMEUES1APID, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_ENBUES1APID, err := r.ReadBit() - if err != nil { + if err := (&globalGNBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - p_iEExtensions, err := r.ReadBit() - if err != nil { + if err := (&globalGNBID.GNBID).UnmarshalPER(r, enc); err != nil { return err } - if p_MMEUES1APID { - var v MMEUES1APID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - uEAssociatedLogicalS1ConnectionItem.MMEUES1APID = &v - } - if p_ENBUES1APID { - var v ENBUES1APID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - uEAssociatedLogicalS1ConnectionItem.ENBUES1APID = &v - } if p_iEExtensions { - var v rawIEExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions); err != nil { return err } - uEAssociatedLogicalS1ConnectionItem.iEExtensions = &v } if extBit { - if err := uEAssociatedLogicalS1ConnectionItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := globalGNBID.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (userLocationInformation *UserLocationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := userLocationInformation.EUTRANCGI.MarshalPER(w, enc); err != nil { - return err +var extIEsGlobalGNBID []ap.IESpec[ProtocolIEID, GlobalGNBID] + +func (globalGNBID *GlobalGNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalGNBID.GNBID.Diagnose(d) { + notComprehended = true } - if err := userLocationInformation.TAI.MarshalPER(w, enc); err != nil { - return err + ap.DiagnoseExtensions(d, extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + return notComprehended +} + +func (globalRANNodeID *GlobalRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{globalRANNodeID.GNB != nil, globalRANNodeID.NgENB != nil, globalRANNodeID.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case globalRANNodeID.GNB != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*globalRANNodeID.GNB).MarshalPER(w, enc); err != nil { + return err + } + case globalRANNodeID.NgENB != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*globalRANNodeID.NgENB).MarshalPER(w, enc); err != nil { + return err + } + case globalRANNodeID.Ext != nil: + w.WriteBit(true) + return globalRANNodeID.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty } return nil } -func (userLocationInformation *UserLocationInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_f2, err := r.ReadBit() +func (globalRANNodeID *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalRANNodeID = GlobalRANNodeID{} + isExt, err := r.ReadBit() if err != nil { return err } - if err := (&userLocationInformation.EUTRANCGI).UnmarshalPER(r, enc); err != nil { + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + globalRANNodeID.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) return err } - if err := (&userLocationInformation.TAI).UnmarshalPER(r, enc); err != nil { + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { return err } - if p_f2 { - var v ieExtensions + switch idx { + case 0: + var v GNB if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v - } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + globalRANNodeID.GNB = &v + case 1: + var v NgENB + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } + globalRANNodeID.NgENB = &v + default: + return per.ErrOverflow } return nil } -func (erabModifyItemBearerModConf *erabModifyItemBearerModConf) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := erabModifyItemBearerModConf.erabID.MarshalPER(w, enc); err != nil { - return err - } - return nil +func (globalRANNodeID *GlobalRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case globalRANNodeID.GNB != nil: + return globalRANNodeID.GNB.Diagnose(d) + case globalRANNodeID.NgENB != nil: + return globalRANNodeID.NgENB.Diagnose(d) + case globalRANNodeID.Ext != nil: + return true + } + return false } -func (erabModifyItemBearerModConf *erabModifyItemBearerModConf) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { +func (handoverRestrictionList *HandoverRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsHandoverRestrictionList, handoverRestrictionList, handoverRestrictionList.iEExtensions) + w.WriteBit(handoverRestrictionList.extensions.Present()) + w.WriteBit(handoverRestrictionList.EquivalentPLMNs != nil) + w.WriteBit(handoverRestrictionList.ForbiddenTAs != nil) + w.WriteBit(handoverRestrictionList.ForbiddenLAs != nil) + w.WriteBit(handoverRestrictionList.ForbiddenInterRATs != nil) + w.WriteBit(len(ext) > 0) + if err := handoverRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { return err } - p_f1, err := r.ReadBit() - if err != nil { - return err + if handoverRestrictionList.EquivalentPLMNs != nil { + if err := handoverRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { + return err + } } - if err := (&erabModifyItemBearerModConf.erabID).UnmarshalPER(r, enc); err != nil { - return err + if handoverRestrictionList.ForbiddenTAs != nil { + if err := handoverRestrictionList.ForbiddenTAs.MarshalPER(w, enc); err != nil { + return err + } } - if p_f1 { - var v ieExtensions - if err := (&v).UnmarshalPER(r, enc); err != nil { + if handoverRestrictionList.ForbiddenLAs != nil { + if err := handoverRestrictionList.ForbiddenLAs.MarshalPER(w, enc); err != nil { return err } - _ = v } - if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if handoverRestrictionList.ForbiddenInterRATs != nil { + if err := (*handoverRestrictionList.ForbiddenInterRATs).MarshalPER(w, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue - } - if err := per.SkipOpenType(r, enc); err != nil { - return err - } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err } } - return nil -} - -func (taiItem *taiItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - if err := taiItem.TAI.MarshalPER(w, enc); err != nil { - return err + if handoverRestrictionList.extensions.Present() { + if err := handoverRestrictionList.extensions.MarshalPER(w, enc); err != nil { + return err + } } return nil } -func (taiItem *taiItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { +func (handoverRestrictionList *HandoverRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *handoverRestrictionList = HandoverRestrictionList{} extBit, err := r.ReadBit() if err != nil { return err } - p_f1, err := r.ReadBit() + p_EquivalentPLMNs, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenTAs, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenLAs, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenInterRATs, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&taiItem.TAI).UnmarshalPER(r, enc); err != nil { + if err := (&handoverRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { return err } - if p_f1 { - var v ieExtensions + if p_EquivalentPLMNs { + if err := (&handoverRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenTAs { + if err := (&handoverRestrictionList.ForbiddenTAs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenLAs { + if err := (&handoverRestrictionList.ForbiddenLAs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenInterRATs { + var v ForbiddenInterRATs if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - _ = v + handoverRestrictionList.ForbiddenInterRATs = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRestrictionList, handoverRestrictionList, &handoverRestrictionList.iEExtensions); err != nil { + return err + } } if extBit { - var extBits []bool - if err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for i := int64(0); i < count; i++ { - b, err := r.ReadBit() - if err != nil { - return err - } - extBits = append(extBits, b) - } - return nil - }); err != nil { + if err := handoverRestrictionList.extensions.UnmarshalPER(r, enc); err != nil { return err } - for _, present := range extBits { - if !present { - continue + } + return nil +} + +var extIEsHandoverRestrictionList = []ap.IESpec[ProtocolIEID, HandoverRestrictionList]{ + { + ID: IDNRrestrictioninEPSasSecondaryRAT, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v NRrestrictioninEPSasSecondaryRAT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NRrestrictioninEPSasSecondaryRAT = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.NRrestrictioninEPSasSecondaryRAT == nil { + return nil, false } - if err := per.SkipOpenType(r, enc); err != nil { + return x.NRrestrictioninEPSasSecondaryRAT, true + }, + }, + { + ID: IDUnlicensedSpectrumRestriction, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v UnlicensedSpectrumRestriction + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - } - } - return nil + x.UnlicensedSpectrumRestriction = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.UnlicensedSpectrumRestriction == nil { + return nil, false + } + return x.UnlicensedSpectrumRestriction, true + }, + }, + { + ID: IDCNTypeRestrictions, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v CNTypeRestrictions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNTypeRestrictions = v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if len(x.CNTypeRestrictions) == 0 { + return nil, false + } + return x.CNTypeRestrictions, true + }, + }, + { + ID: IDNRrestrictionin5GS, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v NRrestrictionin5GS + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NRrestrictionin5GS = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.NRrestrictionin5GS == nil { + return nil, false + } + return x.NRrestrictionin5GS, true + }, + }, + { + ID: IDLastNGRANPLMNIdentity, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v PLMNIdentity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LastNGRANPLMNIdentity = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.LastNGRANPLMNIdentity == nil { + return nil, false + } + return x.LastNGRANPLMNIdentity, true + }, + }, + { + ID: IDRATRestrictions, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v RATRestrictions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RATRestrictions = v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if len(x.RATRestrictions) == 0 { + return nil, false + } + return x.RATRestrictions, true + }, + }, +} + +func (handoverRestrictionList *HandoverRestrictionList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if handoverRestrictionList.ForbiddenTAs.Diagnose(d) { + notComprehended = true + } + if handoverRestrictionList.ForbiddenLAs.Diagnose(d) { + notComprehended = true + } + if handoverRestrictionList.ForbiddenInterRATs != nil && handoverRestrictionList.ForbiddenInterRATs.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsHandoverRestrictionList, handoverRestrictionList, handoverRestrictionList.iEExtensions) + return notComprehended +} + +func (handoverType HandoverType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumHandoverType.Encode(w, enc, handoverType) +} + +func (handoverType *HandoverType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumHandoverType.Decode(r, enc) + if err != nil { + return err + } + *handoverType = v + return nil +} + +func (handoverType HandoverType) Name() string { + return enumHandoverType.Name(handoverType) +} + +func (handoverType HandoverType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumHandoverType.Known(handoverType) +} + +func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIMSvoiceEPSfallbackfrom5G.Encode(w, enc, iMSvoiceEPSfallbackfrom5G) +} + +func (iMSvoiceEPSfallbackfrom5G *IMSvoiceEPSfallbackfrom5G) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIMSvoiceEPSfallbackfrom5G.Decode(r, enc) + if err != nil { + return err + } + *iMSvoiceEPSfallbackfrom5G = v + return nil +} + +func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) Name() string { + return enumIMSvoiceEPSfallbackfrom5G.Name(iMSvoiceEPSfallbackfrom5G) +} + +func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIMSvoiceEPSfallbackfrom5G.Known(iMSvoiceEPSfallbackfrom5G) +} + +func (integrityProtectionIndication IntegrityProtectionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIntegrityProtectionIndication.Encode(w, enc, integrityProtectionIndication) +} + +func (integrityProtectionIndication *IntegrityProtectionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIntegrityProtectionIndication.Decode(r, enc) + if err != nil { + return err + } + *integrityProtectionIndication = v + return nil +} + +func (integrityProtectionIndication IntegrityProtectionIndication) Name() string { + return enumIntegrityProtectionIndication.Name(integrityProtectionIndication) +} + +func (integrityProtectionIndication IntegrityProtectionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumIntegrityProtectionIndication.Known(integrityProtectionIndication) +} + +func (interSystemMeasurementItem *InterSystemMeasurementItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsInterSystemMeasurementItem, interSystemMeasurementItem, interSystemMeasurementItem.iEExtensions) + w.WriteBit(interSystemMeasurementItem.MaxRSIndexCellQual != nil) + w.WriteBit(interSystemMeasurementItem.SMTC != nil) + w.WriteBit(interSystemMeasurementItem.ThreshRSIndexR15 != nil) + w.WriteBit(interSystemMeasurementItem.SSBToMeasure != nil) + w.WriteBit(interSystemMeasurementItem.SSRSSIMeasurement != nil) + w.WriteBit(interSystemMeasurementItem.QuantityConfigNRR15 != nil) + w.WriteBit(interSystemMeasurementItem.ExcludedCellsToAddModList != nil) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true}, int64(interSystemMeasurementItem.FreqBandIndicatorNR)); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 3279165, HasUB: true}, int64(interSystemMeasurementItem.SSBFrequencies)); err != nil { + return err + } + if err := interSystemMeasurementItem.SubcarrierSpacingSSB.MarshalPER(w, enc); err != nil { + return err + } + if interSystemMeasurementItem.MaxRSIndexCellQual != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true}, int64((*interSystemMeasurementItem.MaxRSIndexCellQual))); err != nil { + return err + } + } + if interSystemMeasurementItem.SMTC != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SMTC); err != nil { + return err + } + } + if interSystemMeasurementItem.ThreshRSIndexR15 != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.ThreshRSIndexR15); err != nil { + return err + } + } + if interSystemMeasurementItem.SSBToMeasure != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SSBToMeasure); err != nil { + return err + } + } + if interSystemMeasurementItem.SSRSSIMeasurement != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SSRSSIMeasurement); err != nil { + return err + } + } + if interSystemMeasurementItem.QuantityConfigNRR15 != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.QuantityConfigNRR15); err != nil { + return err + } + } + if interSystemMeasurementItem.ExcludedCellsToAddModList != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.ExcludedCellsToAddModList); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + return nil +} + +func (interSystemMeasurementItem *InterSystemMeasurementItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *interSystemMeasurementItem = InterSystemMeasurementItem{} + p_MaxRSIndexCellQual, err := r.ReadBit() + if err != nil { + return err + } + p_SMTC, err := r.ReadBit() + if err != nil { + return err + } + p_ThreshRSIndexR15, err := r.ReadBit() + if err != nil { + return err + } + p_SSBToMeasure, err := r.ReadBit() + if err != nil { + return err + } + p_SSRSSIMeasurement, err := r.ReadBit() + if err != nil { + return err + } + p_QuantityConfigNRR15, err := r.ReadBit() + if err != nil { + return err + } + p_ExcludedCellsToAddModList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true}) + if err != nil { + return err + } + interSystemMeasurementItem.FreqBandIndicatorNR = uint16(n0) + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 3279165, HasUB: true}) + if err != nil { + return err + } + interSystemMeasurementItem.SSBFrequencies = uint32(n1) + if err := (&interSystemMeasurementItem.SubcarrierSpacingSSB).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MaxRSIndexCellQual { + var v uint8 + n3, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true}) + if err != nil { + return err + } + v = uint8(n3) + interSystemMeasurementItem.MaxRSIndexCellQual = &v + } + if p_SMTC { + p4, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.SMTC = p4 + } + if p_ThreshRSIndexR15 { + p5, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.ThreshRSIndexR15 = p5 + } + if p_SSBToMeasure { + p6, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.SSBToMeasure = p6 + } + if p_SSRSSIMeasurement { + p7, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.SSRSSIMeasurement = p7 + } + if p_QuantityConfigNRR15 { + p8, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.QuantityConfigNRR15 = p8 + } + if p_ExcludedCellsToAddModList { + p9, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.ExcludedCellsToAddModList = p9 + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemMeasurementItem, interSystemMeasurementItem, &interSystemMeasurementItem.iEExtensions); err != nil { + return err + } + } + return nil +} + +var extIEsInterSystemMeasurementItem []ap.IESpec[ProtocolIEID, InterSystemMeasurementItem] + +func (interSystemMeasurementItem *InterSystemMeasurementItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if interSystemMeasurementItem.SubcarrierSpacingSSB.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsInterSystemMeasurementItem, interSystemMeasurementItem, interSystemMeasurementItem.iEExtensions) + return notComprehended +} + +func (interSystemMeasurementParameters *InterSystemMeasurementParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, interSystemMeasurementParameters.iEExtensions) + w.WriteBit(interSystemMeasurementParameters.extensions.Present()) + w.WriteBit(interSystemMeasurementParameters.InterSystemMeasurementList != nil) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true}, int64(interSystemMeasurementParameters.MeasurementDuration)); err != nil { + return err + } + if interSystemMeasurementParameters.InterSystemMeasurementList != nil { + if err := interSystemMeasurementParameters.InterSystemMeasurementList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if interSystemMeasurementParameters.extensions.Present() { + if err := interSystemMeasurementParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (interSystemMeasurementParameters *InterSystemMeasurementParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *interSystemMeasurementParameters = InterSystemMeasurementParameters{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_InterSystemMeasurementList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + interSystemMeasurementParameters.MeasurementDuration = uint8(n0) + if p_InterSystemMeasurementList { + if err := (&interSystemMeasurementParameters.InterSystemMeasurementList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, &interSystemMeasurementParameters.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := interSystemMeasurementParameters.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsInterSystemMeasurementParameters []ap.IESpec[ProtocolIEID, InterSystemMeasurementParameters] + +func (interSystemMeasurementParameters *InterSystemMeasurementParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if interSystemMeasurementParameters.InterSystemMeasurementList.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, interSystemMeasurementParameters.iEExtensions) + return notComprehended +} + +func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, intersystemMeasurementConfiguration.iEExtensions) + w.WriteBit(intersystemMeasurementConfiguration.extensions.Present()) + w.WriteBit(intersystemMeasurementConfiguration.RSRP != nil) + w.WriteBit(intersystemMeasurementConfiguration.RSRQ != nil) + w.WriteBit(intersystemMeasurementConfiguration.SINR != nil) + w.WriteBit(len(ext) > 0) + if intersystemMeasurementConfiguration.RSRP != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.RSRP))); err != nil { + return err + } + } + if intersystemMeasurementConfiguration.RSRQ != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.RSRQ))); err != nil { + return err + } + } + if intersystemMeasurementConfiguration.SINR != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.SINR))); err != nil { + return err + } + } + if err := intersystemMeasurementConfiguration.InterSystemMeasurementParameters.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemMeasurementConfiguration.extensions.Present() { + if err := intersystemMeasurementConfiguration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemMeasurementConfiguration = IntersystemMeasurementConfiguration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_RSRP, err := r.ReadBit() + if err != nil { + return err + } + p_RSRQ, err := r.ReadBit() + if err != nil { + return err + } + p_SINR, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_RSRP { + var v uint8 + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + v = uint8(n0) + intersystemMeasurementConfiguration.RSRP = &v + } + if p_RSRQ { + var v uint8 + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + v = uint8(n1) + intersystemMeasurementConfiguration.RSRQ = &v + } + if p_SINR { + var v uint8 + n2, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + v = uint8(n2) + intersystemMeasurementConfiguration.SINR = &v + } + if err := (&intersystemMeasurementConfiguration.InterSystemMeasurementParameters).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, &intersystemMeasurementConfiguration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemMeasurementConfiguration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemMeasurementConfiguration []ap.IESpec[ProtocolIEID, IntersystemMeasurementConfiguration] + +func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemMeasurementConfiguration.InterSystemMeasurementParameters.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, intersystemMeasurementConfiguration.iEExtensions) + return notComprehended +} + +func (lAI *LAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLAI, lAI, lAI.iEExtensions) + w.WriteBit(lAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := lAI.LAC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lAI.extensions.Present() { + if err := lAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lAI *LAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lAI = LAI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lAI.LAC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLAI, lAI, &lAI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lAI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLAI []ap.IESpec[ProtocolIEID, LAI] + +func (lAI *LAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsLAI, lAI, lAI.iEExtensions) + return notComprehended +} + +func (lTENTNTAIInformation *LTENTNTAIInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLTENTNTAIInformation, lTENTNTAIInformation, lTENTNTAIInformation.iEExtensions) + w.WriteBit(lTENTNTAIInformation.extensions.Present()) + w.WriteBit(lTENTNTAIInformation.UELocationDerivedTAC != nil) + w.WriteBit(len(ext) > 0) + if err := lTENTNTAIInformation.ServingPLMN.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 12, true, int64(len(lTENTNTAIInformation.TACListInLTENTN)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := lTENTNTAIInformation.TACListInLTENTN[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if lTENTNTAIInformation.UELocationDerivedTAC != nil { + if err := (*lTENTNTAIInformation.UELocationDerivedTAC).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lTENTNTAIInformation.extensions.Present() { + if err := lTENTNTAIInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lTENTNTAIInformation *LTENTNTAIInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lTENTNTAIInformation = LTENTNTAIInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UELocationDerivedTAC, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lTENTNTAIInformation.ServingPLMN).UnmarshalPER(r, enc); err != nil { + return err + } + lTENTNTAIInformation.TACListInLTENTN = nil + if err := per.DecodeLength(r, enc, 1, 12, true, func(count int64) error { + start := len(lTENTNTAIInformation.TACListInLTENTN) + lTENTNTAIInformation.TACListInLTENTN = append(lTENTNTAIInformation.TACListInLTENTN, make([]TAC, count)...) + for i := int64(0); i < count; i++ { + if err := (&lTENTNTAIInformation.TACListInLTENTN[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_UELocationDerivedTAC { + var v TAC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lTENTNTAIInformation.UELocationDerivedTAC = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTENTNTAIInformation, lTENTNTAIInformation, &lTENTNTAIInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lTENTNTAIInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLTENTNTAIInformation []ap.IESpec[ProtocolIEID, LTENTNTAIInformation] + +func (lTENTNTAIInformation *LTENTNTAIInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsLTENTNTAIInformation, lTENTNTAIInformation, lTENTNTAIInformation.iEExtensions) + return notComprehended +} + +func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{lastVisitedCellItem.EUTRANCell != nil, lastVisitedCellItem.UTRANCell != nil, lastVisitedCellItem.GERANCell != nil, lastVisitedCellItem.NGRANCell != nil, lastVisitedCellItem.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case lastVisitedCellItem.EUTRANCell != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*lastVisitedCellItem.EUTRANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellItem.UTRANCell != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*lastVisitedCellItem.UTRANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellItem.GERANCell != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + if err := (*lastVisitedCellItem.GERANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellItem.NGRANCell != nil: + w.WriteBit(true) + if err := per.EncodeNormallySmall(w, enc, 0); err != nil { + return err + } + return per.EncodeOpenType(w, enc, lastVisitedCellItem.NGRANCell) + case lastVisitedCellItem.Ext != nil: + w.WriteBit(true) + return lastVisitedCellItem.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedCellItem = LastVisitedCellItem{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + switch extIdx { + case 0: + var v LastVisitedNGRANCellInformation + if err := per.DecodeOpenType(r, enc, &v); err != nil { + return err + } + lastVisitedCellItem.NGRANCell = &v + default: + lastVisitedCellItem.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + return nil + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v LastVisitedEUTRANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellItem.EUTRANCell = &v + case 1: + var v LastVisitedUTRANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellItem.UTRANCell = &v + case 2: + var v LastVisitedGERANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellItem.GERANCell = &v + default: + return per.ErrOverflow + } + return nil +} + +func (lastVisitedCellItem *LastVisitedCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case lastVisitedCellItem.EUTRANCell != nil: + return lastVisitedCellItem.EUTRANCell.Diagnose(d) + case lastVisitedCellItem.UTRANCell != nil: + case lastVisitedCellItem.GERANCell != nil: + return lastVisitedCellItem.GERANCell.Diagnose(d) + case lastVisitedCellItem.NGRANCell != nil: + case lastVisitedCellItem.Ext != nil: + return true + } + return false +} + +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation.iEExtensions) + w.WriteBit(lastVisitedEUTRANCellInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lastVisitedEUTRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedEUTRANCellInformation.CellType.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedEUTRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lastVisitedEUTRANCellInformation.extensions.Present() { + if err := lastVisitedEUTRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedEUTRANCellInformation = LastVisitedEUTRANCellInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, &lastVisitedEUTRANCellInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lastVisitedEUTRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLastVisitedEUTRANCellInformation = []ap.IESpec[ProtocolIEID, LastVisitedEUTRANCellInformation]{ + { + ID: IDTimeUEStayedInCellEnhancedGranularity, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { + var v TimeUEStayedInCellEnhancedGranularity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TimeUEStayedInCellEnhancedGranularity = &v + return nil + }, + Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { + if x.TimeUEStayedInCellEnhancedGranularity == nil { + return nil, false + } + return x.TimeUEStayedInCellEnhancedGranularity, true + }, + }, + { + ID: IDHOCause, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { + var v Cause + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.HOCause = &v + return nil + }, + Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { + if x.HOCause == nil { + return nil, false + } + return x.HOCause, true + }, + }, + { + ID: IDLastVisitedPSCellList, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { + var v LastVisitedPSCellList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LastVisitedPSCellList = v + return nil + }, + Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { + if len(x.LastVisitedPSCellList) == 0 { + return nil, false + } + return x.LastVisitedPSCellList, true + }, + }, +} + +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lastVisitedEUTRANCellInformation.GlobalCellID.Diagnose(d) { + notComprehended = true + } + if lastVisitedEUTRANCellInformation.CellType.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation.iEExtensions) + return notComprehended +} + +func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{lastVisitedGERANCellInformation.Undefined != nil, lastVisitedGERANCellInformation.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case lastVisitedGERANCellInformation.Undefined != nil: + w.WriteBit(false) + if err := (*lastVisitedGERANCellInformation.Undefined).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedGERANCellInformation.Ext != nil: + w.WriteBit(true) + return lastVisitedGERANCellInformation.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedGERANCellInformation = LastVisitedGERANCellInformation{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + lastVisitedGERANCellInformation.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + var idx int64 = 0 + switch idx { + case 0: + var v per.Null + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedGERANCellInformation.Undefined = &v + default: + return per.ErrOverflow + } + return nil +} + +func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case lastVisitedGERANCellInformation.Undefined != nil: + case lastVisitedGERANCellInformation.Ext != nil: + return true + } + return false +} + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + w.WriteBit(lastVisitedPSCellInformation.extensions.Present()) + w.WriteBit(lastVisitedPSCellInformation.PSCellID != nil) + w.WriteBit(len(ext) > 0) + if lastVisitedPSCellInformation.PSCellID != nil { + if err := (*lastVisitedPSCellInformation.PSCellID).MarshalPER(w, enc); err != nil { + return err + } + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}, int64(lastVisitedPSCellInformation.TimeStay)); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lastVisitedPSCellInformation.extensions.Present() { + if err := lastVisitedPSCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedPSCellInformation = LastVisitedPSCellInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PSCellID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_PSCellID { + var v PSCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedPSCellInformation.PSCellID = &v + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}) + if err != nil { + return err + } + lastVisitedPSCellInformation.TimeStay = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lastVisitedPSCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLastVisitedPSCellInformation []ap.IESpec[ProtocolIEID, LastVisitedPSCellInformation] + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lastVisitedPSCellInformation.PSCellID != nil && lastVisitedPSCellInformation.PSCellID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + return notComprehended +} + +func (listeningSubframePattern *ListeningSubframePattern) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsListeningSubframePattern, listeningSubframePattern, listeningSubframePattern.iEExtensions) + w.WriteBit(listeningSubframePattern.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := listeningSubframePattern.PatternPeriod.MarshalPER(w, enc); err != nil { + return err + } + if err := listeningSubframePattern.PatternOffset.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if listeningSubframePattern.extensions.Present() { + if err := listeningSubframePattern.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (listeningSubframePattern *ListeningSubframePattern) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *listeningSubframePattern = ListeningSubframePattern{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&listeningSubframePattern.PatternPeriod).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&listeningSubframePattern.PatternOffset).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsListeningSubframePattern, listeningSubframePattern, &listeningSubframePattern.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := listeningSubframePattern.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsListeningSubframePattern []ap.IESpec[ProtocolIEID, ListeningSubframePattern] + +func (listeningSubframePattern *ListeningSubframePattern) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if listeningSubframePattern.PatternPeriod.Diagnose(d) { + notComprehended = true + } + if listeningSubframePattern.PatternOffset.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsListeningSubframePattern, listeningSubframePattern, listeningSubframePattern.iEExtensions) + return notComprehended +} + +func (mutingAvailabilityIndication MutingAvailabilityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMutingAvailabilityIndication.Encode(w, enc, mutingAvailabilityIndication) +} + +func (mutingAvailabilityIndication *MutingAvailabilityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMutingAvailabilityIndication.Decode(r, enc) + if err != nil { + return err + } + *mutingAvailabilityIndication = v + return nil +} + +func (mutingAvailabilityIndication MutingAvailabilityIndication) Name() string { + return enumMutingAvailabilityIndication.Name(mutingAvailabilityIndication) +} + +func (mutingAvailabilityIndication MutingAvailabilityIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMutingAvailabilityIndication.Known(mutingAvailabilityIndication) +} + +func (mutingPatternInformation *MutingPatternInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsMutingPatternInformation, mutingPatternInformation, mutingPatternInformation.iEExtensions) + w.WriteBit(mutingPatternInformation.extensions.Present()) + w.WriteBit(mutingPatternInformation.MutingPatternOffset != nil) + w.WriteBit(len(ext) > 0) + if err := mutingPatternInformation.MutingPatternPeriod.MarshalPER(w, enc); err != nil { + return err + } + if mutingPatternInformation.MutingPatternOffset != nil { + if err := (*mutingPatternInformation.MutingPatternOffset).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if mutingPatternInformation.extensions.Present() { + if err := mutingPatternInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (mutingPatternInformation *MutingPatternInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mutingPatternInformation = MutingPatternInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MutingPatternOffset, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mutingPatternInformation.MutingPatternPeriod).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MutingPatternOffset { + var v PatternOffset + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mutingPatternInformation.MutingPatternOffset = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMutingPatternInformation, mutingPatternInformation, &mutingPatternInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := mutingPatternInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsMutingPatternInformation []ap.IESpec[ProtocolIEID, MutingPatternInformation] + +func (mutingPatternInformation *MutingPatternInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mutingPatternInformation.MutingPatternPeriod.Diagnose(d) { + notComprehended = true + } + if mutingPatternInformation.MutingPatternOffset != nil && mutingPatternInformation.MutingPatternOffset.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsMutingPatternInformation, mutingPatternInformation, mutingPatternInformation.iEExtensions) + return notComprehended +} + +func (mutingPatternPeriod MutingPatternPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMutingPatternPeriod.Encode(w, enc, mutingPatternPeriod) +} + +func (mutingPatternPeriod *MutingPatternPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMutingPatternPeriod.Decode(r, enc) + if err != nil { + return err + } + *mutingPatternPeriod = v + return nil +} + +func (mutingPatternPeriod MutingPatternPeriod) Name() string { + return enumMutingPatternPeriod.Name(mutingPatternPeriod) +} + +func (mutingPatternPeriod MutingPatternPeriod) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumMutingPatternPeriod.Known(mutingPatternPeriod) +} + +func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + w.WriteBit(nRCGI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nRCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := nRCGI.NRCellIdentity.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if nRCGI.extensions.Present() { + if err := nRCGI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRCGI = NRCGI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&nRCGI.NRCellIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := nRCGI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNRCGI []ap.IESpec[ProtocolIEID, NRCGI] + +func (nRCGI *NRCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + return notComprehended +} + +func (nRrestrictionin5GS NRrestrictionin5GS) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRrestrictionin5GS.Encode(w, enc, nRrestrictionin5GS) +} + +func (nRrestrictionin5GS *NRrestrictionin5GS) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRrestrictionin5GS.Decode(r, enc) + if err != nil { + return err + } + *nRrestrictionin5GS = v + return nil +} + +func (nRrestrictionin5GS NRrestrictionin5GS) Name() string { + return enumNRrestrictionin5GS.Name(nRrestrictionin5GS) +} + +func (nRrestrictionin5GS NRrestrictionin5GS) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNRrestrictionin5GS.Known(nRrestrictionin5GS) +} + +func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRrestrictioninEPSasSecondaryRAT.Encode(w, enc, nRrestrictioninEPSasSecondaryRAT) +} + +func (nRrestrictioninEPSasSecondaryRAT *NRrestrictioninEPSasSecondaryRAT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRrestrictioninEPSasSecondaryRAT.Decode(r, enc) + if err != nil { + return err + } + *nRrestrictioninEPSasSecondaryRAT = v + return nil +} + +func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) Name() string { + return enumNRrestrictioninEPSasSecondaryRAT.Name(nRrestrictioninEPSasSecondaryRAT) +} + +func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumNRrestrictioninEPSasSecondaryRAT.Known(nRrestrictioninEPSasSecondaryRAT) +} + +func (ngENB *NgENB) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsNgENB, ngENB, ngENB.iEExtensions) + w.WriteBit(ngENB.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := ngENB.GlobalNgENBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if ngENB.extensions.Present() { + if err := ngENB.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (ngENB *NgENB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *ngENB = NgENB{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&ngENB.GlobalNgENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNgENB, ngENB, &ngENB.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := ngENB.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsNgENB []ap.IESpec[ProtocolIEID, NgENB] + +func (ngENB *NgENB) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if ngENB.GlobalNgENBID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsNgENB, ngENB, ngENB.iEExtensions) + return notComprehended +} + +func (overloadAction OverloadAction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumOverloadAction.Encode(w, enc, overloadAction) +} + +func (overloadAction *OverloadAction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumOverloadAction.Decode(r, enc) + if err != nil { + return err + } + *overloadAction = v + return nil +} + +func (overloadAction OverloadAction) Name() string { + return enumOverloadAction.Name(overloadAction) +} + +func (overloadAction OverloadAction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumOverloadAction.Known(overloadAction) +} + +func (overloadResponse *OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{overloadResponse.OverloadAction != nil, overloadResponse.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case overloadResponse.OverloadAction != nil: + w.WriteBit(false) + if err := (*overloadResponse.OverloadAction).MarshalPER(w, enc); err != nil { + return err + } + case overloadResponse.Ext != nil: + w.WriteBit(true) + return overloadResponse.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (overloadResponse *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *overloadResponse = OverloadResponse{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + overloadResponse.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + var idx int64 = 0 + switch idx { + case 0: + var v OverloadAction + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + overloadResponse.OverloadAction = &v + default: + return per.ErrOverflow + } + return nil +} + +func (overloadResponse *OverloadResponse) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case overloadResponse.OverloadAction != nil: + return overloadResponse.OverloadAction.Diagnose(d) + case overloadResponse.Ext != nil: + return true + } + return false +} + +func (pSCellInformation *PSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsPSCellInformation, pSCellInformation, pSCellInformation.iEExtensions) + w.WriteBit(pSCellInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := pSCellInformation.NCGI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pSCellInformation.extensions.Present() { + if err := pSCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (pSCellInformation *PSCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pSCellInformation = PSCellInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pSCellInformation.NCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPSCellInformation, pSCellInformation, &pSCellInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pSCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPSCellInformation []ap.IESpec[ProtocolIEID, PSCellInformation] + +func (pSCellInformation *PSCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pSCellInformation.NCGI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsPSCellInformation, pSCellInformation, pSCellInformation.iEExtensions) + return notComprehended +} + +func (pagingDRX PagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingDRX.Encode(w, enc, pagingDRX) +} + +func (pagingDRX *PagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingDRX.Decode(r, enc) + if err != nil { + return err + } + *pagingDRX = v + return nil +} + +func (pagingDRX PagingDRX) Name() string { + return enumPagingDRX.Name(pagingDRX) +} + +func (pagingDRX PagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingDRX.Known(pagingDRX) +} + +func (pagingPriority PagingPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingPriority.Encode(w, enc, pagingPriority) +} + +func (pagingPriority *PagingPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingPriority.Decode(r, enc) + if err != nil { + return err + } + *pagingPriority = v + return nil +} + +func (pagingPriority PagingPriority) Name() string { + return enumPagingPriority.Name(pagingPriority) +} + +func (pagingPriority PagingPriority) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPagingPriority.Known(pagingPriority) +} + +func (patternPeriod PatternPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPatternPeriod.Encode(w, enc, patternPeriod) +} + +func (patternPeriod *PatternPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPatternPeriod.Decode(r, enc) + if err != nil { + return err + } + *patternPeriod = v + return nil +} + +func (patternPeriod PatternPeriod) Name() string { + return enumPatternPeriod.Name(patternPeriod) +} + +func (patternPeriod PatternPeriod) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumPatternPeriod.Known(patternPeriod) +} + +func (preemptionCapability PreemptionCapability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPreemptionCapability.Encode(w, enc, preemptionCapability) +} + +func (preemptionCapability *PreemptionCapability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPreemptionCapability.Decode(r, enc) + if err != nil { + return err + } + *preemptionCapability = v + return nil +} + +func (preemptionCapability PreemptionCapability) Name() string { + return enumPreemptionCapability.Name(preemptionCapability) +} + +func (preemptionVulnerability PreemptionVulnerability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPreemptionVulnerability.Encode(w, enc, preemptionVulnerability) +} + +func (preemptionVulnerability *PreemptionVulnerability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPreemptionVulnerability.Decode(r, enc) + if err != nil { + return err + } + *preemptionVulnerability = v + return nil +} + +func (preemptionVulnerability PreemptionVulnerability) Name() string { + return enumPreemptionVulnerability.Name(preemptionVulnerability) +} + +func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + w.WriteBit(rATRestrictionsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := rATRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := rATRestrictionsItem.RATRestrictionInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if rATRestrictionsItem.extensions.Present() { + if err := rATRestrictionsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rATRestrictionsItem = RATRestrictionsItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&rATRestrictionsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&rATRestrictionsItem.RATRestrictionInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := rATRestrictionsItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRATRestrictionsItem []ap.IESpec[ProtocolIEID, RATRestrictionsItem] + +func (rATRestrictionsItem *RATRestrictionsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + return notComprehended +} + +func (rATType RATType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRATType.Encode(w, enc, rATType) +} + +func (rATType *RATType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRATType.Decode(r, enc) + if err != nil { + return err + } + *rATType = v + return nil +} + +func (rATType RATType) Name() string { + return enumRATType.Name(rATType) +} + +func (rATType RATType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRATType.Known(rATType) +} + +func (rLFReportInformation *RLFReportInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRLFReportInformation, rLFReportInformation, rLFReportInformation.iEExtensions) + w.WriteBit(rLFReportInformation.extensions.Present()) + w.WriteBit(rLFReportInformation.UERLFReportContainerForExtendedBands != nil) + w.WriteBit(len(ext) > 0) + if err := rLFReportInformation.UERLFReportContainer.MarshalPER(w, enc); err != nil { + return err + } + if rLFReportInformation.UERLFReportContainerForExtendedBands != nil { + if err := (*rLFReportInformation.UERLFReportContainerForExtendedBands).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if rLFReportInformation.extensions.Present() { + if err := rLFReportInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (rLFReportInformation *RLFReportInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *rLFReportInformation = RLFReportInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UERLFReportContainerForExtendedBands, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&rLFReportInformation.UERLFReportContainer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_UERLFReportContainerForExtendedBands { + var v RLFReportContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + rLFReportInformation.UERLFReportContainerForExtendedBands = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRLFReportInformation, rLFReportInformation, &rLFReportInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := rLFReportInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRLFReportInformation = []ap.IESpec[ProtocolIEID, RLFReportInformation]{ + { + ID: IDNBIoTRLFReportContainer, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *RLFReportInformation, r *per.Reader, enc per.Encoding) error { + var v RLFReportContainer + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NBIoTRLFReportContainer = &v + return nil + }, + Encode: func(x *RLFReportInformation) (per.Marshaler, bool) { + if x.NBIoTRLFReportContainer == nil { + return nil, false + } + return x.NBIoTRLFReportContainer, true + }, + }, +} + +func (rLFReportInformation *RLFReportInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsRLFReportInformation, rLFReportInformation, rLFReportInformation.iEExtensions) + return notComprehended +} + +func (rRCEstablishmentCause RRCEstablishmentCause) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRRCEstablishmentCause.Encode(w, enc, rRCEstablishmentCause) +} + +func (rRCEstablishmentCause *RRCEstablishmentCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRRCEstablishmentCause.Decode(r, enc) + if err != nil { + return err + } + *rRCEstablishmentCause = v + return nil +} + +func (rRCEstablishmentCause RRCEstablishmentCause) Name() string { + return enumRRCEstablishmentCause.Name(rRCEstablishmentCause) +} + +func (rRCEstablishmentCause RRCEstablishmentCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRRCEstablishmentCause.Known(rRCEstablishmentCause) +} + +func (reportArea ReportArea) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumReportArea.Encode(w, enc, reportArea) +} + +func (reportArea *ReportArea) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumReportArea.Decode(r, enc) + if err != nil { + return err + } + *reportArea = v + return nil +} + +func (reportArea ReportArea) Name() string { + return enumReportArea.Name(reportArea) +} + +func (reportArea ReportArea) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumReportArea.Known(reportArea) +} + +func (requestType *RequestType) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRequestType, requestType, requestType.iEExtensions) + w.WriteBit(requestType.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := requestType.EventType.MarshalPER(w, enc); err != nil { + return err + } + if err := requestType.ReportArea.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if requestType.extensions.Present() { + if err := requestType.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (requestType *RequestType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *requestType = RequestType{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&requestType.EventType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&requestType.ReportArea).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRequestType, requestType, &requestType.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := requestType.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRequestType = []ap.IESpec[ProtocolIEID, RequestType]{ + { + ID: IDRequestTypeAdditionalInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *RequestType, r *per.Reader, enc per.Encoding) error { + var v RequestTypeAdditionalInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RequestTypeAdditionalInfo = &v + return nil + }, + Encode: func(x *RequestType) (per.Marshaler, bool) { + if x.RequestTypeAdditionalInfo == nil { + return nil, false + } + return x.RequestTypeAdditionalInfo, true + }, + }, +} + +func (requestType *RequestType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if requestType.EventType.Diagnose(d) { + notComprehended = true + } + if requestType.ReportArea.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsRequestType, requestType, requestType.iEExtensions) + return notComprehended +} + +func (requestTypeAdditionalInfo RequestTypeAdditionalInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRequestTypeAdditionalInfo.Encode(w, enc, requestTypeAdditionalInfo) +} + +func (requestTypeAdditionalInfo *RequestTypeAdditionalInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRequestTypeAdditionalInfo.Decode(r, enc) + if err != nil { + return err + } + *requestTypeAdditionalInfo = v + return nil +} + +func (requestTypeAdditionalInfo RequestTypeAdditionalInfo) Name() string { + return enumRequestTypeAdditionalInfo.Name(requestTypeAdditionalInfo) +} + +func (requestTypeAdditionalInfo RequestTypeAdditionalInfo) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumRequestTypeAdditionalInfo.Known(requestTypeAdditionalInfo) +} + +func (requestedTNLInfo *RequestedTNLInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsRequestedTNLInfo, requestedTNLInfo, requestedTNLInfo.iEExtensions) + w.WriteBit(requestedTNLInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := requestedTNLInfo.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if requestedTNLInfo.extensions.Present() { + if err := requestedTNLInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (requestedTNLInfo *RequestedTNLInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *requestedTNLInfo = RequestedTNLInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&requestedTNLInfo.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRequestedTNLInfo, requestedTNLInfo, &requestedTNLInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := requestedTNLInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRequestedTNLInfo []ap.IESpec[ProtocolIEID, RequestedTNLInfo] + +func (requestedTNLInfo *RequestedTNLInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsRequestedTNLInfo, requestedTNLInfo, requestedTNLInfo.iEExtensions) + return notComprehended +} + +func (resetAll ResetAll) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumResetAll.Encode(w, enc, resetAll) +} + +func (resetAll *ResetAll) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumResetAll.Decode(r, enc) + if err != nil { + return err + } + *resetAll = v + return nil +} + +func (resetAll ResetAll) Name() string { + return enumResetAll.Name(resetAll) +} + +func (resetAll ResetAll) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumResetAll.Known(resetAll) +} + +func (resetType *ResetType) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{resetType.S1Interface != nil, resetType.PartOfS1Interface != nil, resetType.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case resetType.S1Interface != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*resetType.S1Interface).MarshalPER(w, enc); err != nil { + return err + } + case resetType.PartOfS1Interface != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*resetType.PartOfS1Interface).MarshalPER(w, enc); err != nil { + return err + } + case resetType.Ext != nil: + w.WriteBit(true) + return resetType.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (resetType *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *resetType = ResetType{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + resetType.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v ResetAll + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + resetType.S1Interface = &v + case 1: + var v UEAssociatedLogicalS1ConnectionListRes + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + resetType.PartOfS1Interface = &v + default: + return per.ErrOverflow + } + return nil +} + +func (resetType *ResetType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case resetType.S1Interface != nil: + return resetType.S1Interface.Diagnose(d) + case resetType.PartOfS1Interface != nil: + return resetType.PartOfS1Interface.Diagnose(d) + case resetType.Ext != nil: + return true + } + return false +} + +func (sONConfigurationTransfer *SONConfigurationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSONConfigurationTransfer, sONConfigurationTransfer, sONConfigurationTransfer.iEExtensions) + w.WriteBit(sONConfigurationTransfer.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sONConfigurationTransfer.TargeteNBID.MarshalPER(w, enc); err != nil { + return err + } + if err := sONConfigurationTransfer.SourceeNBID.MarshalPER(w, enc); err != nil { + return err + } + if err := sONConfigurationTransfer.SONInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sONConfigurationTransfer.extensions.Present() { + if err := sONConfigurationTransfer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sONConfigurationTransfer *SONConfigurationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sONConfigurationTransfer = SONConfigurationTransfer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sONConfigurationTransfer.TargeteNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sONConfigurationTransfer.SourceeNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sONConfigurationTransfer.SONInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSONConfigurationTransfer, sONConfigurationTransfer, &sONConfigurationTransfer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sONConfigurationTransfer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSONConfigurationTransfer = []ap.IESpec[ProtocolIEID, SONConfigurationTransfer]{ + { + ID: IDX2TNLConfigurationInfo, + Presence: ap.PresenceConditional, + Criticality: ap.CriticalityIgnore, + Condition: sonRequestsX2TNLConfigurationInfo, + Decode: func(x *SONConfigurationTransfer, r *per.Reader, enc per.Encoding) error { + var v X2TNLConfigurationInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.X2TNLConfigurationInfo = &v + return nil + }, + Encode: func(x *SONConfigurationTransfer) (per.Marshaler, bool) { + if x.X2TNLConfigurationInfo == nil { + return nil, false + } + return x.X2TNLConfigurationInfo, true + }, + }, + { + ID: IDSynchronisationInformation, + Presence: ap.PresenceConditional, + Criticality: ap.CriticalityIgnore, + Condition: sonRequestsActivateMuting, + Decode: func(x *SONConfigurationTransfer, r *per.Reader, enc per.Encoding) error { + var v SynchronisationInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SynchronisationInformation = &v + return nil + }, + Encode: func(x *SONConfigurationTransfer) (per.Marshaler, bool) { + if x.SynchronisationInformation == nil { + return nil, false + } + return x.SynchronisationInformation, true + }, + }, + { + ID: IDRequestedTNLInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SONConfigurationTransfer, r *per.Reader, enc per.Encoding) error { + var v RequestedTNLInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RequestedTNLInfo = &v + return nil + }, + Encode: func(x *SONConfigurationTransfer) (per.Marshaler, bool) { + if x.RequestedTNLInfo == nil { + return nil, false + } + return x.RequestedTNLInfo, true + }, + }, +} + +func (sONConfigurationTransfer *SONConfigurationTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sONConfigurationTransfer.TargeteNBID.Diagnose(d) { + notComprehended = true + } + if sONConfigurationTransfer.SourceeNBID.Diagnose(d) { + notComprehended = true + } + if sONConfigurationTransfer.SONInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSONConfigurationTransfer, sONConfigurationTransfer, sONConfigurationTransfer.iEExtensions) + return notComprehended +} + +func (sONInformation *SONInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{sONInformation.SONInformationRequest != nil, sONInformation.SONInformationReply != nil, sONInformation.SONInformationExtension != nil, sONInformation.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case sONInformation.SONInformationRequest != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*sONInformation.SONInformationRequest).MarshalPER(w, enc); err != nil { + return err + } + case sONInformation.SONInformationReply != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*sONInformation.SONInformationReply).MarshalPER(w, enc); err != nil { + return err + } + case sONInformation.SONInformationExtension != nil: + w.WriteBit(true) + if err := per.EncodeNormallySmall(w, enc, 0); err != nil { + return err + } + return per.EncodeOpenType(w, enc, sONInformation.SONInformationExtension) + case sONInformation.Ext != nil: + w.WriteBit(true) + return sONInformation.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (sONInformation *SONInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sONInformation = SONInformation{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + switch extIdx { + case 0: + var v SONInformationExtension + if err := per.DecodeOpenType(r, enc, &v); err != nil { + return err + } + sONInformation.SONInformationExtension = &v + default: + sONInformation.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + return nil + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v SONInformationRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sONInformation.SONInformationRequest = &v + case 1: + var v SONInformationReply + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sONInformation.SONInformationReply = &v + default: + return per.ErrOverflow + } + return nil +} + +func (sONInformation *SONInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case sONInformation.SONInformationRequest != nil: + return sONInformation.SONInformationRequest.Diagnose(d) + case sONInformation.SONInformationReply != nil: + return sONInformation.SONInformationReply.Diagnose(d) + case sONInformation.SONInformationExtension != nil: + return sONInformation.SONInformationExtension.Diagnose(d) + case sONInformation.Ext != nil: + return true + } + return false +} + +func (sONInformationExtension *SONInformationExtension) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{sONInformationExtension.SONInformationReport != nil, sONInformationExtension.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case sONInformationExtension.SONInformationReport != nil: + return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSONInformationReport, Criticality: sONInformationExtension.choiceCriticality.Of(ap.CriticalityIgnore), Value: sONInformationExtension.SONInformationReport}) + case sONInformationExtension.ChoiceExtension != nil: + return ap.EncodeField(profile, w, enc, sONInformationExtension.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } +} + +func (sONInformationExtension *SONInformationExtension) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sONInformationExtension = SONInformationExtension{} + var idx int64 = 0 + switch idx { + case 0: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + case IDSONInformationReport: + var v SONInformationReport + if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + return err + } + if !ap.Comprehended[ProtocolIEID](&v) { + sONInformationExtension.ChoiceExtension = &f + break + } + sONInformationExtension.SONInformationReport = &v + sONInformationExtension.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + default: + sONInformationExtension.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (sONInformationExtension *SONInformationExtension) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case sONInformationExtension.SONInformationReport != nil: + d.IE(IDSONInformationReport, sONInformationExtension.choiceCriticality.Of(ap.CriticalityIgnore), sONInformationExtension.SONInformationReport) + case sONInformationExtension.ChoiceExtension != nil: + d.Unknown(sONInformationExtension.ChoiceExtension.ID, sONInformationExtension.ChoiceExtension.Criticality) + } + return false +} + +func (sONInformationReply *SONInformationReply) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSONInformationReply, sONInformationReply, sONInformationReply.iEExtensions) + w.WriteBit(sONInformationReply.extensions.Present()) + w.WriteBit(sONInformationReply.X2TNLConfigurationInfo != nil) + w.WriteBit(len(ext) > 0) + if sONInformationReply.X2TNLConfigurationInfo != nil { + if err := (*sONInformationReply.X2TNLConfigurationInfo).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sONInformationReply.extensions.Present() { + if err := sONInformationReply.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sONInformationReply *SONInformationReply) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sONInformationReply = SONInformationReply{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_X2TNLConfigurationInfo, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_X2TNLConfigurationInfo { + var v X2TNLConfigurationInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sONInformationReply.X2TNLConfigurationInfo = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSONInformationReply, sONInformationReply, &sONInformationReply.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sONInformationReply.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSONInformationReply = []ap.IESpec[ProtocolIEID, SONInformationReply]{ + { + ID: IDTimeSynchronisationInfo, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SONInformationReply, r *per.Reader, enc per.Encoding) error { + var v TimeSynchronisationInfo + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TimeSynchronisationInfo = &v + return nil + }, + Encode: func(x *SONInformationReply) (per.Marshaler, bool) { + if x.TimeSynchronisationInfo == nil { + return nil, false + } + return x.TimeSynchronisationInfo, true + }, + }, + { + ID: IDMutingPatternInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SONInformationReply, r *per.Reader, enc per.Encoding) error { + var v MutingPatternInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MutingPatternInformation = &v + return nil + }, + Encode: func(x *SONInformationReply) (per.Marshaler, bool) { + if x.MutingPatternInformation == nil { + return nil, false + } + return x.MutingPatternInformation, true + }, + }, +} + +func (sONInformationReply *SONInformationReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sONInformationReply.X2TNLConfigurationInfo != nil && sONInformationReply.X2TNLConfigurationInfo.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSONInformationReply, sONInformationReply, sONInformationReply.iEExtensions) + return notComprehended +} + +func (sONInformationReport *SONInformationReport) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{sONInformationReport.RLFReportInformation != nil, sONInformationReport.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case sONInformationReport.RLFReportInformation != nil: + w.WriteBit(false) + if err := (*sONInformationReport.RLFReportInformation).MarshalPER(w, enc); err != nil { + return err + } + case sONInformationReport.Ext != nil: + w.WriteBit(true) + return sONInformationReport.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (sONInformationReport *SONInformationReport) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sONInformationReport = SONInformationReport{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + sONInformationReport.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + var idx int64 = 0 + switch idx { + case 0: + var v RLFReportInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sONInformationReport.RLFReportInformation = &v + default: + return per.ErrOverflow + } + return nil +} + +func (sONInformationReport *SONInformationReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case sONInformationReport.RLFReportInformation != nil: + return sONInformationReport.RLFReportInformation.Diagnose(d) + case sONInformationReport.Ext != nil: + return true + } + return false +} + +func (sONInformationRequest SONInformationRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSONInformationRequest.Encode(w, enc, sONInformationRequest) +} + +func (sONInformationRequest *SONInformationRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSONInformationRequest.Decode(r, enc) + if err != nil { + return err + } + *sONInformationRequest = v + return nil +} + +func (sONInformationRequest SONInformationRequest) Name() string { + return enumSONInformationRequest.Name(sONInformationRequest) +} + +func (sONInformationRequest SONInformationRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSONInformationRequest.Known(sONInformationRequest) +} + +func (sTMSI *STMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSTMSI, sTMSI, sTMSI.iEExtensions) + w.WriteBit(sTMSI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sTMSI.MMEC.MarshalPER(w, enc); err != nil { + return err + } + if err := sTMSI.MTMSI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sTMSI.extensions.Present() { + if err := sTMSI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sTMSI *STMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sTMSI = STMSI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sTMSI.MMEC).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sTMSI.MTMSI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSTMSI, sTMSI, &sTMSI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sTMSI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSTMSI []ap.IESpec[ProtocolIEID, STMSI] + +func (sTMSI *STMSI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSTMSI, sTMSI, sTMSI.iEExtensions) + return notComprehended +} + +func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSecurityContext, securityContext, securityContext.iEExtensions) + w.WriteBit(securityContext.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { + return err + } + if err := securityContext.NextHopParameter.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if securityContext.extensions.Present() { + if err := securityContext.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *securityContext = SecurityContext{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}) + if err != nil { + return err + } + securityContext.NextHopChainingCount = uint8(n0) + if err := (&securityContext.NextHopParameter).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityContext, securityContext, &securityContext.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := securityContext.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecurityContext []ap.IESpec[ProtocolIEID, SecurityContext] + +func (securityContext *SecurityContext) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSecurityContext, securityContext, securityContext.iEExtensions) + return notComprehended +} + +func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + w.WriteBit(securityIndication.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := securityIndication.IntegrityProtectionIndication.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if securityIndication.extensions.Present() { + if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *securityIndication = SecurityIndication{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&securityIndication.IntegrityProtectionIndication).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecurityIndication []ap.IESpec[ProtocolIEID, SecurityIndication] + +func (securityIndication *SecurityIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if securityIndication.IntegrityProtectionIndication.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + return notComprehended +} + +func (servedGUMMEIsItem *ServedGUMMEIsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsServedGUMMEIsItem, servedGUMMEIsItem, servedGUMMEIsItem.iEExtensions) + w.WriteBit(servedGUMMEIsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + off0 := 0 + if err := per.EncodeLength(w, enc, 1, 32, true, int64(len(servedGUMMEIsItem.ServedPLMNs)), func(count int64) error { + end := off0 + int(count) + for i := off0; i < end; i++ { + if err := servedGUMMEIsItem.ServedPLMNs[i].MarshalPER(w, enc); err != nil { + return err + } + } + off0 = end + return nil + }); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(servedGUMMEIsItem.ServedGroupIDs)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := servedGUMMEIsItem.ServedGroupIDs[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + off2 := 0 + if err := per.EncodeLength(w, enc, 1, 256, true, int64(len(servedGUMMEIsItem.ServedMMECs)), func(count int64) error { + end := off2 + int(count) + for i := off2; i < end; i++ { + if err := servedGUMMEIsItem.ServedMMECs[i].MarshalPER(w, enc); err != nil { + return err + } + } + off2 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if servedGUMMEIsItem.extensions.Present() { + if err := servedGUMMEIsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (servedGUMMEIsItem *ServedGUMMEIsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *servedGUMMEIsItem = ServedGUMMEIsItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + servedGUMMEIsItem.ServedPLMNs = nil + if err := per.DecodeLength(r, enc, 1, 32, true, func(count int64) error { + start := len(servedGUMMEIsItem.ServedPLMNs) + servedGUMMEIsItem.ServedPLMNs = append(servedGUMMEIsItem.ServedPLMNs, make([]PLMNIdentity, count)...) + for i := int64(0); i < count; i++ { + if err := (&servedGUMMEIsItem.ServedPLMNs[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + servedGUMMEIsItem.ServedGroupIDs = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(servedGUMMEIsItem.ServedGroupIDs) + servedGUMMEIsItem.ServedGroupIDs = append(servedGUMMEIsItem.ServedGroupIDs, make([]MMEGroupID, count)...) + for i := int64(0); i < count; i++ { + if err := (&servedGUMMEIsItem.ServedGroupIDs[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + servedGUMMEIsItem.ServedMMECs = nil + if err := per.DecodeLength(r, enc, 1, 256, true, func(count int64) error { + start := len(servedGUMMEIsItem.ServedMMECs) + servedGUMMEIsItem.ServedMMECs = append(servedGUMMEIsItem.ServedMMECs, make([]MMECode, count)...) + for i := int64(0); i < count; i++ { + if err := (&servedGUMMEIsItem.ServedMMECs[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsServedGUMMEIsItem, servedGUMMEIsItem, &servedGUMMEIsItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := servedGUMMEIsItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsServedGUMMEIsItem = []ap.IESpec[ProtocolIEID, ServedGUMMEIsItem]{ + { + ID: IDGUMMEIType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *ServedGUMMEIsItem, r *per.Reader, enc per.Encoding) error { + var v GUMMEIType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.GUMMEIType = &v + return nil + }, + Encode: func(x *ServedGUMMEIsItem) (per.Marshaler, bool) { + if x.GUMMEIType == nil { + return nil, false + } + return x.GUMMEIType, true + }, + }, +} + +func (servedGUMMEIsItem *ServedGUMMEIsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsServedGUMMEIsItem, servedGUMMEIsItem, servedGUMMEIsItem.iEExtensions) + return notComprehended +} + +func (sourceNgRanNodeID *SourceNgRanNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSourceNgRanNodeID, sourceNgRanNodeID, sourceNgRanNodeID.iEExtensions) + w.WriteBit(sourceNgRanNodeID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := sourceNgRanNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { + return err + } + if err := sourceNgRanNodeID.SelectedTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sourceNgRanNodeID.extensions.Present() { + if err := sourceNgRanNodeID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sourceNgRanNodeID *SourceNgRanNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sourceNgRanNodeID = SourceNgRanNodeID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sourceNgRanNodeID.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sourceNgRanNodeID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceNgRanNodeID, sourceNgRanNodeID, &sourceNgRanNodeID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sourceNgRanNodeID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSourceNgRanNodeID []ap.IESpec[ProtocolIEID, SourceNgRanNodeID] + +func (sourceNgRanNodeID *SourceNgRanNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sourceNgRanNodeID.GlobalRANNodeID.Diagnose(d) { + notComprehended = true + } + if sourceNgRanNodeID.SelectedTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSourceNgRanNodeID, sourceNgRanNodeID, sourceNgRanNodeID.iEExtensions) + return notComprehended +} + +func (sourceNodeID *SourceNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{sourceNodeID.SourceNgRanNodeID != nil, sourceNodeID.ChoiceExtension != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case sourceNodeID.SourceNgRanNodeID != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*sourceNodeID.SourceNgRanNodeID).MarshalPER(w, enc); err != nil { + return err + } + case sourceNodeID.ChoiceExtension != nil: + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + return ap.EncodeField(profile, w, enc, sourceNodeID.ChoiceExtension.Field()) + default: + return per.ErrEmpty + } + return nil +} + +func (sourceNodeID *SourceNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sourceNodeID = SourceNodeID{} + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v SourceNgRanNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceNodeID.SourceNgRanNodeID = &v + case 1: + f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + if err != nil { + return err + } + switch f.ID { + default: + sourceNodeID.ChoiceExtension = &f + } + default: + return per.ErrOverflow + } + return nil +} + +func (sourceNodeID *SourceNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case sourceNodeID.SourceNgRanNodeID != nil: + return sourceNodeID.SourceNgRanNodeID.Diagnose(d) + case sourceNodeID.ChoiceExtension != nil: + d.Unknown(sourceNodeID.ChoiceExtension.ID, sourceNodeID.ChoiceExtension.Criticality) + } + return false +} + +func (sourceeNBID *SourceeNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSourceeNBID, sourceeNBID, sourceeNBID.iEExtensions) + w.WriteBit(len(ext) > 0) + if err := sourceeNBID.GlobalENBID.MarshalPER(w, enc); err != nil { + return err + } + if err := sourceeNBID.SelectedTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + return nil +} + +func (sourceeNBID *SourceeNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sourceeNBID = SourceeNBID{} + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sourceeNBID.GlobalENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&sourceeNBID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceeNBID, sourceeNBID, &sourceeNBID.iEExtensions); err != nil { + return err + } + } + return nil +} + +var extIEsSourceeNBID []ap.IESpec[ProtocolIEID, SourceeNBID] + +func (sourceeNBID *SourceeNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sourceeNBID.GlobalENBID.Diagnose(d) { + notComprehended = true + } + if sourceeNBID.SelectedTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSourceeNBID, sourceeNBID, sourceeNBID.iEExtensions) + return notComprehended +} + +func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer.iEExtensions) + w.WriteBit(sourceeNBToTargeteNBTransparentContainer.extensions.Present()) + w.WriteBit(sourceeNBToTargeteNBTransparentContainer.ERABInformationList != nil) + w.WriteBit(sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP != nil) + w.WriteBit(len(ext) > 0) + if err := sourceeNBToTargeteNBTransparentContainer.RRCContainer.MarshalPER(w, enc); err != nil { + return err + } + if sourceeNBToTargeteNBTransparentContainer.ERABInformationList != nil { + if err := sourceeNBToTargeteNBTransparentContainer.ERABInformationList.MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceeNBToTargeteNBTransparentContainer.TargetCellID.MarshalPER(w, enc); err != nil { + return err + } + if sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP != nil { + if err := (*sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP).MarshalPER(w, enc); err != nil { + return err + } + } + if err := sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if sourceeNBToTargeteNBTransparentContainer.extensions.Present() { + if err := sourceeNBToTargeteNBTransparentContainer.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *sourceeNBToTargeteNBTransparentContainer = SourceeNBToTargeteNBTransparentContainer{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ERABInformationList, err := r.ReadBit() + if err != nil { + return err + } + p_SubscriberProfileIDforRFP, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&sourceeNBToTargeteNBTransparentContainer.RRCContainer).UnmarshalPER(r, enc); err != nil { + return err + } + if p_ERABInformationList { + if err := (&sourceeNBToTargeteNBTransparentContainer.ERABInformationList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if err := (&sourceeNBToTargeteNBTransparentContainer.TargetCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_SubscriberProfileIDforRFP { + var v SubscriberProfileIDforRFP + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP = &v + } + if err := (&sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, &sourceeNBToTargeteNBTransparentContainer.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := sourceeNBToTargeteNBTransparentContainer.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, SourceeNBToTargeteNBTransparentContainer]{ + { + ID: IDMobilityInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v MobilityInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MobilityInformation = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.MobilityInformation == nil { + return nil, false + } + return x.MobilityInformation, true + }, + }, + { + ID: IDUEHistoryInformationFromTheUE, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v UEHistoryInformationFromTheUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UEHistoryInformationFromTheUE = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.UEHistoryInformationFromTheUE == nil { + return nil, false + } + return x.UEHistoryInformationFromTheUE, true + }, + }, + { + ID: IDIMSvoiceEPSfallbackfrom5G, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v IMSvoiceEPSfallbackfrom5G + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.IMSvoiceEPSfallbackfrom5G = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.IMSvoiceEPSfallbackfrom5G == nil { + return nil, false + } + return x.IMSvoiceEPSfallbackfrom5G, true + }, + }, + { + ID: IDAdditionalRRMPriorityIndex, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v AdditionalRRMPriorityIndex + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.AdditionalRRMPriorityIndex = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.AdditionalRRMPriorityIndex == nil { + return nil, false + } + return x.AdditionalRRMPriorityIndex, true + }, + }, + { + ID: IDContextatSource, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v ContextatSource + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ContextatSource = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.ContextatSource == nil { + return nil, false + } + return x.ContextatSource, true + }, + }, + { + ID: IDIntersystemMeasurementConfiguration, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v IntersystemMeasurementConfiguration + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.IntersystemMeasurementConfiguration = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.IntersystemMeasurementConfiguration == nil { + return nil, false + } + return x.IntersystemMeasurementConfiguration, true + }, + }, + { + ID: IDSourceNodeID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v SourceNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceNodeID = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.SourceNodeID == nil { + return nil, false + } + return x.SourceNodeID, true + }, + }, + { + ID: IDEmergencyIndicator, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v EmergencyIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EmergencyIndicator = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.EmergencyIndicator == nil { + return nil, false + } + return x.EmergencyIndicator, true + }, + }, + { + ID: IDUEContextReferenceatSourceeNB, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v ENBUES1APID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UEContextReferenceatSourceeNB = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.UEContextReferenceatSourceeNB == nil { + return nil, false + } + return x.UEContextReferenceatSourceeNB, true + }, + }, + { + ID: IDSourceSNID, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v GlobalRANNodeID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SourceSNID = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.SourceSNID == nil { + return nil, false + } + return x.SourceSNID, true + }, + }, + { + ID: IDDirectForwardingPathAvailability, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v DirectForwardingPathAvailability + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DirectForwardingPathAvailability = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.DirectForwardingPathAvailability == nil { + return nil, false + } + return x.DirectForwardingPathAvailability, true + }, + }, + { + ID: IDTimeBasedHandoverInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { + var v TimeBasedHandoverInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TimeBasedHandoverInformation = &v + return nil + }, + Encode: func(x *SourceeNBToTargeteNBTransparentContainer) (per.Marshaler, bool) { + if x.TimeBasedHandoverInformation == nil { + return nil, false + } + return x.TimeBasedHandoverInformation, true + }, + }, +} + +func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if sourceeNBToTargeteNBTransparentContainer.ERABInformationList.Diagnose(d) { + notComprehended = true + } + if sourceeNBToTargeteNBTransparentContainer.TargetCellID.Diagnose(d) { + notComprehended = true + } + if sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer.iEExtensions) + return notComprehended +} + +func (subcarrierSpacingSSB SubcarrierSpacingSSB) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSubcarrierSpacingSSB.Encode(w, enc, subcarrierSpacingSSB) +} + +func (subcarrierSpacingSSB *SubcarrierSpacingSSB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSubcarrierSpacingSSB.Decode(r, enc) + if err != nil { + return err + } + *subcarrierSpacingSSB = v + return nil +} + +func (subcarrierSpacingSSB SubcarrierSpacingSSB) Name() string { + return enumSubcarrierSpacingSSB.Name(subcarrierSpacingSSB) +} + +func (subcarrierSpacingSSB SubcarrierSpacingSSB) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSubcarrierSpacingSSB.Known(subcarrierSpacingSSB) +} + +func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + w.WriteBit(supportedTAItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { + return err + } + if err := supportedTAItem.BroadcastPLMNs.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if supportedTAItem.extensions.Present() { + if err := supportedTAItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *supportedTAItem = SupportedTAItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&supportedTAItem.TAC).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&supportedTAItem.BroadcastPLMNs).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := supportedTAItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSupportedTAItem = []ap.IESpec[ProtocolIEID, SupportedTAItem]{ + { + ID: IDRATType, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityReject, + Decode: func(x *SupportedTAItem, r *per.Reader, enc per.Encoding) error { + var v RATType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RATType = &v + return nil + }, + Encode: func(x *SupportedTAItem) (per.Marshaler, bool) { + if x.RATType == nil { + return nil, false + } + return x.RATType, true + }, + }, +} + +func (supportedTAItem *SupportedTAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + return notComprehended +} + +func (synchronisationInformation *SynchronisationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsSynchronisationInformation, synchronisationInformation, synchronisationInformation.iEExtensions) + w.WriteBit(synchronisationInformation.extensions.Present()) + w.WriteBit(synchronisationInformation.SourceStratumLevel != nil) + w.WriteBit(synchronisationInformation.ListeningSubframePattern != nil) + w.WriteBit(synchronisationInformation.AggressoreCGIList != nil) + w.WriteBit(len(ext) > 0) + if synchronisationInformation.SourceStratumLevel != nil { + if err := (*synchronisationInformation.SourceStratumLevel).MarshalPER(w, enc); err != nil { + return err + } + } + if synchronisationInformation.ListeningSubframePattern != nil { + if err := (*synchronisationInformation.ListeningSubframePattern).MarshalPER(w, enc); err != nil { + return err + } + } + if synchronisationInformation.AggressoreCGIList != nil { + off2 := 0 + if err := per.EncodeLength(w, enc, 1, 256, true, int64(len(synchronisationInformation.AggressoreCGIList)), func(count int64) error { + end := off2 + int(count) + for i := off2; i < end; i++ { + if err := synchronisationInformation.AggressoreCGIList[i].MarshalPER(w, enc); err != nil { + return err + } + } + off2 = end + return nil + }); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if synchronisationInformation.extensions.Present() { + if err := synchronisationInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (synchronisationInformation *SynchronisationInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *synchronisationInformation = SynchronisationInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_SourceStratumLevel, err := r.ReadBit() + if err != nil { + return err + } + p_ListeningSubframePattern, err := r.ReadBit() + if err != nil { + return err + } + p_AggressoreCGIList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_SourceStratumLevel { + var v StratumLevel + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + synchronisationInformation.SourceStratumLevel = &v + } + if p_ListeningSubframePattern { + var v ListeningSubframePattern + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + synchronisationInformation.ListeningSubframePattern = &v + } + if p_AggressoreCGIList { + synchronisationInformation.AggressoreCGIList = nil + if err := per.DecodeLength(r, enc, 1, 256, true, func(count int64) error { + start := len(synchronisationInformation.AggressoreCGIList) + synchronisationInformation.AggressoreCGIList = append(synchronisationInformation.AggressoreCGIList, make([]EUTRANCGI, count)...) + for i := int64(0); i < count; i++ { + if err := (&synchronisationInformation.AggressoreCGIList[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSynchronisationInformation, synchronisationInformation, &synchronisationInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := synchronisationInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSynchronisationInformation []ap.IESpec[ProtocolIEID, SynchronisationInformation] + +func (synchronisationInformation *SynchronisationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if synchronisationInformation.SourceStratumLevel != nil && synchronisationInformation.SourceStratumLevel.Diagnose(d) { + notComprehended = true + } + if synchronisationInformation.ListeningSubframePattern != nil && synchronisationInformation.ListeningSubframePattern.Diagnose(d) { + notComprehended = true + } + for i := range synchronisationInformation.AggressoreCGIList { + if synchronisationInformation.AggressoreCGIList[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsSynchronisationInformation, synchronisationInformation, synchronisationInformation.iEExtensions) + return notComprehended +} + +func (synchronisationStatus SynchronisationStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSynchronisationStatus.Encode(w, enc, synchronisationStatus) +} + +func (synchronisationStatus *SynchronisationStatus) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSynchronisationStatus.Decode(r, enc) + if err != nil { + return err + } + *synchronisationStatus = v + return nil +} + +func (synchronisationStatus SynchronisationStatus) Name() string { + return enumSynchronisationStatus.Name(synchronisationStatus) +} + +func (synchronisationStatus SynchronisationStatus) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumSynchronisationStatus.Known(synchronisationStatus) +} + +func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAI, tAI, tAI.iEExtensions) + w.WriteBit(tAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := tAI.TAC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAI.extensions.Present() { + if err := tAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAI = TAI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&tAI.TAC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAI, tAI, &tAI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAI []ap.IESpec[ProtocolIEID, TAI] + +func (tAI *TAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsTAI, tAI, tAI.iEExtensions) + return notComprehended +} + +func (tAIBroadcastItem *TAIBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIBroadcastItem, tAIBroadcastItem, tAIBroadcastItem.iEExtensions) + w.WriteBit(tAIBroadcastItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIBroadcastItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAIBroadcastItem.CompletedCellInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAIBroadcastItem.CompletedCellInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIBroadcastItem.extensions.Present() { + if err := tAIBroadcastItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIBroadcastItem *TAIBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIBroadcastItem = TAIBroadcastItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIBroadcastItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAIBroadcastItem.CompletedCellInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAIBroadcastItem.CompletedCellInTAI) + tAIBroadcastItem.CompletedCellInTAI = append(tAIBroadcastItem.CompletedCellInTAI, make([]CompletedCellInTAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAIBroadcastItem.CompletedCellInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastItem, tAIBroadcastItem, &tAIBroadcastItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIBroadcastItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIBroadcastItem []ap.IESpec[ProtocolIEID, TAIBroadcastItem] + +func (tAIBroadcastItem *TAIBroadcastItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIBroadcastItem.TAI.Diagnose(d) { + notComprehended = true + } + for i := range tAIBroadcastItem.CompletedCellInTAI { + if tAIBroadcastItem.CompletedCellInTAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsTAIBroadcastItem, tAIBroadcastItem, tAIBroadcastItem.iEExtensions) + return notComprehended +} + +func (tAICancelledItem *TAICancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAICancelledItem, tAICancelledItem, tAICancelledItem.iEExtensions) + w.WriteBit(tAICancelledItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAICancelledItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(tAICancelledItem.CancelledCellInTAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := tAICancelledItem.CancelledCellInTAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAICancelledItem.extensions.Present() { + if err := tAICancelledItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAICancelledItem *TAICancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAICancelledItem = TAICancelledItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAICancelledItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + tAICancelledItem.CancelledCellInTAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(tAICancelledItem.CancelledCellInTAI) + tAICancelledItem.CancelledCellInTAI = append(tAICancelledItem.CancelledCellInTAI, make([]CancelledCellInTAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&tAICancelledItem.CancelledCellInTAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledItem, tAICancelledItem, &tAICancelledItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAICancelledItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAICancelledItem []ap.IESpec[ProtocolIEID, TAICancelledItem] + +func (tAICancelledItem *TAICancelledItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAICancelledItem.TAI.Diagnose(d) { + notComprehended = true + } + for i := range tAICancelledItem.CancelledCellInTAI { + if tAICancelledItem.CancelledCellInTAI[i].Diagnose(d) { + notComprehended = true + } + } + ap.DiagnoseExtensions(d, extIEsTAICancelledItem, tAICancelledItem, tAICancelledItem.iEExtensions) + return notComprehended +} + +func (tAIItem *TAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTAIItem, tAIItem, tAIItem.iEExtensions) + w.WriteBit(tAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := tAIItem.TAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tAIItem.extensions.Present() { + if err := tAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tAIItem *TAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tAIItem = TAIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tAIItem.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIItem, tAIItem, &tAIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tAIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTAIItem []ap.IESpec[ProtocolIEID, TAIItem] + +func (tAIItem *TAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if tAIItem.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTAIItem, tAIItem, tAIItem.iEExtensions) + return notComprehended +} + +func (targetID *TargetID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{targetID.TargeteNBID != nil, targetID.TargetRNCID != nil, targetID.CGI != nil, targetID.TargetNgRanNodeID != nil, targetID.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case targetID.TargeteNBID != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*targetID.TargeteNBID).MarshalPER(w, enc); err != nil { + return err + } + case targetID.TargetRNCID != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*targetID.TargetRNCID).MarshalPER(w, enc); err != nil { + return err + } + case targetID.CGI != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + if err := (*targetID.CGI).MarshalPER(w, enc); err != nil { + return err + } + case targetID.TargetNgRanNodeID != nil: + w.WriteBit(true) + if err := per.EncodeNormallySmall(w, enc, 0); err != nil { + return err + } + return per.EncodeOpenType(w, enc, targetID.TargetNgRanNodeID) + case targetID.Ext != nil: + w.WriteBit(true) + return targetID.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (targetID *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetID = TargetID{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + switch extIdx { + case 0: + var v TargetNgRanNodeID + if err := per.DecodeOpenType(r, enc, &v); err != nil { + return err + } + targetID.TargetNgRanNodeID = &v + default: + targetID.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + return nil + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v TargeteNBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + targetID.TargeteNBID = &v + case 1: + var v TargetRNCID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + targetID.TargetRNCID = &v + case 2: + var v CGI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + targetID.CGI = &v + default: + return per.ErrOverflow + } + return nil +} + +func (targetID *TargetID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case targetID.TargeteNBID != nil: + return targetID.TargeteNBID.Diagnose(d) + case targetID.TargetRNCID != nil: + return targetID.TargetRNCID.Diagnose(d) + case targetID.CGI != nil: + return targetID.CGI.Diagnose(d) + case targetID.TargetNgRanNodeID != nil: + return targetID.TargetNgRanNodeID.Diagnose(d) + case targetID.Ext != nil: + return true + } + return false +} + +func (targetNgRanNodeID *TargetNgRanNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetNgRanNodeID, targetNgRanNodeID, targetNgRanNodeID.iEExtensions) + w.WriteBit(targetNgRanNodeID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targetNgRanNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { + return err + } + if err := targetNgRanNodeID.SelectedTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetNgRanNodeID.extensions.Present() { + if err := targetNgRanNodeID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetNgRanNodeID *TargetNgRanNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetNgRanNodeID = TargetNgRanNodeID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetNgRanNodeID.GlobalRANNodeID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targetNgRanNodeID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetNgRanNodeID, targetNgRanNodeID, &targetNgRanNodeID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetNgRanNodeID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetNgRanNodeID []ap.IESpec[ProtocolIEID, TargetNgRanNodeID] + +func (targetNgRanNodeID *TargetNgRanNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetNgRanNodeID.GlobalRANNodeID.Diagnose(d) { + notComprehended = true + } + if targetNgRanNodeID.SelectedTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetNgRanNodeID, targetNgRanNodeID, targetNgRanNodeID.iEExtensions) + return notComprehended +} + +func (targetRNCID *TargetRNCID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + w.WriteBit(targetRNCID.extensions.Present()) + w.WriteBit(targetRNCID.RAC != nil) + w.WriteBit(targetRNCID.ExtendedRNCID != nil) + w.WriteBit(len(ext) > 0) + if err := targetRNCID.LAI.MarshalPER(w, enc); err != nil { + return err + } + if targetRNCID.RAC != nil { + if err := (*targetRNCID.RAC).MarshalPER(w, enc); err != nil { + return err + } + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(targetRNCID.RNCID)); err != nil { + return err + } + if targetRNCID.ExtendedRNCID != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 4096, HasLB: true, UB: 65535, HasUB: true}, int64((*targetRNCID.ExtendedRNCID))); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targetRNCID.extensions.Present() { + if err := targetRNCID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targetRNCID *TargetRNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targetRNCID = TargetRNCID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_RAC, err := r.ReadBit() + if err != nil { + return err + } + p_ExtendedRNCID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targetRNCID.LAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_RAC { + var v RAC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + targetRNCID.RAC = &v + } + n2, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + if err != nil { + return err + } + targetRNCID.RNCID = uint16(n2) + if p_ExtendedRNCID { + var v uint16 + n3, err := per.DecodeInteger(r, enc, per.Bounds{LB: 4096, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + v = uint16(n3) + targetRNCID.ExtendedRNCID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targetRNCID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargetRNCID []ap.IESpec[ProtocolIEID, TargetRNCID] + +func (targetRNCID *TargetRNCID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targetRNCID.LAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + return notComprehended +} + +func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + w.WriteBit(targeteNBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := targeteNBID.GlobalENBID.MarshalPER(w, enc); err != nil { + return err + } + if err := targeteNBID.SelectedTAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if targeteNBID.extensions.Present() { + if err := targeteNBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *targeteNBID = TargeteNBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&targeteNBID.GlobalENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&targeteNBID.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := targeteNBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTargeteNBID []ap.IESpec[ProtocolIEID, TargeteNBID] + +func (targeteNBID *TargeteNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if targeteNBID.GlobalENBID.Diagnose(d) { + notComprehended = true + } + if targeteNBID.SelectedTAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + return notComprehended +} + +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + w.WriteBit(timeBasedHandoverInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 1048575, HasUB: true}, int64(timeBasedHandoverInformation.HOWindowStart)); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 6000, HasUB: true}, int64(timeBasedHandoverInformation.HOWindowDuration)); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if timeBasedHandoverInformation.extensions.Present() { + if err := timeBasedHandoverInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *timeBasedHandoverInformation = TimeBasedHandoverInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 1048575, HasUB: true}) + if err != nil { + return err + } + timeBasedHandoverInformation.HOWindowStart = uint32(n0) + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 6000, HasUB: true}) + if err != nil { + return err + } + timeBasedHandoverInformation.HOWindowDuration = uint16(n1) + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := timeBasedHandoverInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTimeBasedHandoverInformation []ap.IESpec[ProtocolIEID, TimeBasedHandoverInformation] + +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + return notComprehended +} + +func (timeRefDistribution TimeRefDistribution) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTimeRefDistribution.Encode(w, enc, timeRefDistribution) +} + +func (timeRefDistribution *TimeRefDistribution) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTimeRefDistribution.Decode(r, enc) + if err != nil { + return err + } + *timeRefDistribution = v + return nil +} + +func (timeRefDistribution TimeRefDistribution) Name() string { + return enumTimeRefDistribution.Name(timeRefDistribution) +} + +func (timeRefDistribution TimeRefDistribution) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTimeRefDistribution.Known(timeRefDistribution) +} + +func (timeSynchronisationInfo *TimeSynchronisationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTimeSynchronisationInfo, timeSynchronisationInfo, timeSynchronisationInfo.iEExtensions) + w.WriteBit(timeSynchronisationInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := timeSynchronisationInfo.StratumLevel.MarshalPER(w, enc); err != nil { + return err + } + if err := timeSynchronisationInfo.SynchronisationStatus.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if timeSynchronisationInfo.extensions.Present() { + if err := timeSynchronisationInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (timeSynchronisationInfo *TimeSynchronisationInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *timeSynchronisationInfo = TimeSynchronisationInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&timeSynchronisationInfo.StratumLevel).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&timeSynchronisationInfo.SynchronisationStatus).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeSynchronisationInfo, timeSynchronisationInfo, &timeSynchronisationInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := timeSynchronisationInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTimeSynchronisationInfo = []ap.IESpec[ProtocolIEID, TimeSynchronisationInfo]{ + { + ID: IDMutingAvailabilityIndication, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TimeSynchronisationInfo, r *per.Reader, enc per.Encoding) error { + var v MutingAvailabilityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MutingAvailabilityIndication = &v + return nil + }, + Encode: func(x *TimeSynchronisationInfo) (per.Marshaler, bool) { + if x.MutingAvailabilityIndication == nil { + return nil, false + } + return x.MutingAvailabilityIndication, true + }, + }, +} + +func (timeSynchronisationInfo *TimeSynchronisationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if timeSynchronisationInfo.StratumLevel.Diagnose(d) { + notComprehended = true + } + if timeSynchronisationInfo.SynchronisationStatus.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTimeSynchronisationInfo, timeSynchronisationInfo, timeSynchronisationInfo.iEExtensions) + return notComprehended +} + +func (timeToWait TimeToWait) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTimeToWait.Encode(w, enc, timeToWait) +} + +func (timeToWait *TimeToWait) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTimeToWait.Decode(r, enc) + if err != nil { + return err + } + *timeToWait = v + return nil +} + +func (timeToWait TimeToWait) Name() string { + return enumTimeToWait.Name(timeToWait) +} + +func (timeToWait TimeToWait) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTimeToWait.Known(timeToWait) +} + +func (traceActivation *TraceActivation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + w.WriteBit(traceActivation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := traceActivation.EUTRANTraceID.MarshalPER(w, enc); err != nil { + return err + } + if err := traceActivation.InterfacesToTrace.MarshalPER(w, enc); err != nil { + return err + } + if err := traceActivation.TraceDepth.MarshalPER(w, enc); err != nil { + return err + } + if err := traceActivation.TraceCollectionEntityIPAddress.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if traceActivation.extensions.Present() { + if err := traceActivation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (traceActivation *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *traceActivation = TraceActivation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&traceActivation.EUTRANTraceID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&traceActivation.InterfacesToTrace).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&traceActivation.TraceDepth).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&traceActivation.TraceCollectionEntityIPAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := traceActivation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ + { + ID: IDMDTConfigurationNR, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { + var v MDTConfigurationNR + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.MDTConfigurationNR = &v + return nil + }, + Encode: func(x *TraceActivation) (per.Marshaler, bool) { + if x.MDTConfigurationNR == nil { + return nil, false + } + return x.MDTConfigurationNR, true + }, + }, + { + ID: IDTraceCollectionEntityURI, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { + var v URIAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TraceCollectionEntityURI = &v + return nil + }, + Encode: func(x *TraceActivation) (per.Marshaler, bool) { + if x.TraceCollectionEntityURI == nil { + return nil, false + } + return x.TraceCollectionEntityURI, true + }, + }, +} + +func (traceActivation *TraceActivation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if traceActivation.TraceDepth.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + return notComprehended +} + +func (traceDepth TraceDepth) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTraceDepth.Encode(w, enc, traceDepth) +} + +func (traceDepth *TraceDepth) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTraceDepth.Decode(r, enc) + if err != nil { + return err + } + *traceDepth = v + return nil +} + +func (traceDepth TraceDepth) Name() string { + return enumTraceDepth.Name(traceDepth) +} + +func (traceDepth TraceDepth) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTraceDepth.Known(traceDepth) +} + +func (transportInformation *TransportInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + w.WriteBit(transportInformation.extensions.Present()) + if err := transportInformation.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := transportInformation.ULGTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if transportInformation.extensions.Present() { + if err := transportInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (transportInformation *TransportInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *transportInformation = TransportInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + if err := (&transportInformation.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&transportInformation.ULGTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if extBit { + if err := transportInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +func (triggeringMessage TriggeringMessage) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTriggeringMessage.Encode(w, enc, triggeringMessage) +} + +func (triggeringMessage *TriggeringMessage) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTriggeringMessage.Decode(r, enc) + if err != nil { + return err + } + *triggeringMessage = v + return nil +} + +func (triggeringMessage TriggeringMessage) Name() string { + return enumTriggeringMessage.Name(triggeringMessage) +} + +func (tunnelInformation *TunnelInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsTunnelInformation, tunnelInformation, tunnelInformation.iEExtensions) + w.WriteBit(tunnelInformation.extensions.Present()) + w.WriteBit(tunnelInformation.UDPPortNumber != nil) + w.WriteBit(len(ext) > 0) + if err := tunnelInformation.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if tunnelInformation.UDPPortNumber != nil { + if err := (*tunnelInformation.UDPPortNumber).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if tunnelInformation.extensions.Present() { + if err := tunnelInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (tunnelInformation *TunnelInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *tunnelInformation = TunnelInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UDPPortNumber, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&tunnelInformation.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if p_UDPPortNumber { + var v PortNumber + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + tunnelInformation.UDPPortNumber = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTunnelInformation, tunnelInformation, &tunnelInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := tunnelInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsTunnelInformation []ap.IESpec[ProtocolIEID, TunnelInformation] + +func (tunnelInformation *TunnelInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsTunnelInformation, tunnelInformation, tunnelInformation.iEExtensions) + return notComprehended +} + +func (typeOfError TypeOfError) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumTypeOfError.Encode(w, enc, typeOfError) +} + +func (typeOfError *TypeOfError) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumTypeOfError.Decode(r, enc) + if err != nil { + return err + } + *typeOfError = v + return nil +} + +func (typeOfError TypeOfError) Name() string { + return enumTypeOfError.Name(typeOfError) +} + +func (typeOfError TypeOfError) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumTypeOfError.Known(typeOfError) +} + +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + w.WriteBit(uEAggregateMaximumBitRate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uEAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { + return err + } + if err := uEAggregateMaximumBitRate.UL.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEAggregateMaximumBitRate.extensions.Present() { + if err := uEAggregateMaximumBitRate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEAggregateMaximumBitRate = UEAggregateMaximumBitRate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uEAggregateMaximumBitRate.DL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uEAggregateMaximumBitRate.UL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEAggregateMaximumBitRate.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEAggregateMaximumBitRate = []ap.IESpec[ProtocolIEID, UEAggregateMaximumBitRate]{ + { + ID: IDExtendedUEAggregateMaximumBitRateDL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UEAggregateMaximumBitRate, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedDL = &v + return nil + }, + Encode: func(x *UEAggregateMaximumBitRate) (per.Marshaler, bool) { + if x.ExtendedDL == nil { + return nil, false + } + return x.ExtendedDL, true + }, + }, + { + ID: IDExtendedUEAggregateMaximumBitRateUL, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UEAggregateMaximumBitRate, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedUL = &v + return nil + }, + Encode: func(x *UEAggregateMaximumBitRate) (per.Marshaler, bool) { + if x.ExtendedUL == nil { + return nil, false + } + return x.ExtendedUL, true + }, + }, +} + +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + return notComprehended +} + +func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem.iEExtensions) + w.WriteBit(uEAssociatedLogicalS1ConnectionItem.extensions.Present()) + w.WriteBit(uEAssociatedLogicalS1ConnectionItem.MMEUES1APID != nil) + w.WriteBit(uEAssociatedLogicalS1ConnectionItem.ENBUES1APID != nil) + w.WriteBit(len(ext) > 0) + if uEAssociatedLogicalS1ConnectionItem.MMEUES1APID != nil { + if err := (*uEAssociatedLogicalS1ConnectionItem.MMEUES1APID).MarshalPER(w, enc); err != nil { + return err + } + } + if uEAssociatedLogicalS1ConnectionItem.ENBUES1APID != nil { + if err := (*uEAssociatedLogicalS1ConnectionItem.ENBUES1APID).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uEAssociatedLogicalS1ConnectionItem.extensions.Present() { + if err := uEAssociatedLogicalS1ConnectionItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEAssociatedLogicalS1ConnectionItem = UEAssociatedLogicalS1ConnectionItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_MMEUES1APID, err := r.ReadBit() + if err != nil { + return err + } + p_ENBUES1APID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_MMEUES1APID { + var v MMEUES1APID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAssociatedLogicalS1ConnectionItem.MMEUES1APID = &v + } + if p_ENBUES1APID { + var v ENBUES1APID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEAssociatedLogicalS1ConnectionItem.ENBUES1APID = &v + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, &uEAssociatedLogicalS1ConnectionItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uEAssociatedLogicalS1ConnectionItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUEAssociatedLogicalS1ConnectionItem []ap.IESpec[ProtocolIEID, UEAssociatedLogicalS1ConnectionItem] + +func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem.iEExtensions) + return notComprehended +} + +func (uEPagingID *UEPagingID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uEPagingID.STMSI != nil, uEPagingID.IMSI != nil, uEPagingID.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uEPagingID.STMSI != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*uEPagingID.STMSI).MarshalPER(w, enc); err != nil { + return err + } + case uEPagingID.IMSI != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*uEPagingID.IMSI).MarshalPER(w, enc); err != nil { + return err + } + case uEPagingID.Ext != nil: + w.WriteBit(true) + return uEPagingID.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (uEPagingID *UEPagingID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uEPagingID = UEPagingID{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + uEPagingID.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v STMSI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEPagingID.STMSI = &v + case 1: + var v IMSI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uEPagingID.IMSI = &v + default: + return per.ErrOverflow + } + return nil +} + +func (uEPagingID *UEPagingID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uEPagingID.STMSI != nil: + return uEPagingID.STMSI.Diagnose(d) + case uEPagingID.IMSI != nil: + case uEPagingID.Ext != nil: + return true + } + return false +} + +func (uERetentionInformation UERetentionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUERetentionInformation.Encode(w, enc, uERetentionInformation) +} + +func (uERetentionInformation *UERetentionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUERetentionInformation.Decode(r, enc) + if err != nil { + return err + } + *uERetentionInformation = v + return nil +} + +func (uERetentionInformation UERetentionInformation) Name() string { + return enumUERetentionInformation.Name(uERetentionInformation) +} + +func (uERetentionInformation UERetentionInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUERetentionInformation.Known(uERetentionInformation) +} + +func (uES1APIDPair *UES1APIDPair) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUES1APIDPair, uES1APIDPair, uES1APIDPair.iEExtensions) + w.WriteBit(uES1APIDPair.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uES1APIDPair.MMEUES1APID.MarshalPER(w, enc); err != nil { + return err + } + if err := uES1APIDPair.ENBUES1APID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uES1APIDPair.extensions.Present() { + if err := uES1APIDPair.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uES1APIDPair *UES1APIDPair) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uES1APIDPair = UES1APIDPair{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uES1APIDPair.MMEUES1APID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uES1APIDPair.ENBUES1APID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUES1APIDPair, uES1APIDPair, &uES1APIDPair.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uES1APIDPair.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUES1APIDPair []ap.IESpec[ProtocolIEID, UES1APIDPair] + +func (uES1APIDPair *UES1APIDPair) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUES1APIDPair, uES1APIDPair, uES1APIDPair.iEExtensions) + return notComprehended +} + +func (uES1APIDs *UES1APIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{uES1APIDs.UES1APIDPair != nil, uES1APIDs.MMEUES1APID != nil, uES1APIDs.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case uES1APIDs.UES1APIDPair != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*uES1APIDs.UES1APIDPair).MarshalPER(w, enc); err != nil { + return err + } + case uES1APIDs.MMEUES1APID != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*uES1APIDs.MMEUES1APID).MarshalPER(w, enc); err != nil { + return err + } + case uES1APIDs.Ext != nil: + w.WriteBit(true) + return uES1APIDs.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (uES1APIDs *UES1APIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uES1APIDs = UES1APIDs{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + uES1APIDs.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v UES1APIDPair + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uES1APIDs.UES1APIDPair = &v + case 1: + var v MMEUES1APID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + uES1APIDs.MMEUES1APID = &v + default: + return per.ErrOverflow + } + return nil +} + +func (uES1APIDs *UES1APIDs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case uES1APIDs.UES1APIDPair != nil: + return uES1APIDs.UES1APIDPair.Diagnose(d) + case uES1APIDs.MMEUES1APID != nil: + case uES1APIDs.Ext != nil: + return true + } + return false +} + +func (uESecurityCapabilities *UESecurityCapabilities) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + w.WriteBit(uESecurityCapabilities.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uESecurityCapabilities.EncryptionAlgorithms.MarshalPER(w, enc); err != nil { + return err + } + if err := uESecurityCapabilities.IntegrityProtectionAlgorithms.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uESecurityCapabilities.extensions.Present() { + if err := uESecurityCapabilities.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uESecurityCapabilities *UESecurityCapabilities) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uESecurityCapabilities = UESecurityCapabilities{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uESecurityCapabilities.EncryptionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uESecurityCapabilities.IntegrityProtectionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uESecurityCapabilities.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUESecurityCapabilities []ap.IESpec[ProtocolIEID, UESecurityCapabilities] + +func (uESecurityCapabilities *UESecurityCapabilities) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + return notComprehended +} + +func (unlicensedSpectrumRestriction UnlicensedSpectrumRestriction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUnlicensedSpectrumRestriction.Encode(w, enc, unlicensedSpectrumRestriction) +} + +func (unlicensedSpectrumRestriction *UnlicensedSpectrumRestriction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUnlicensedSpectrumRestriction.Decode(r, enc) + if err != nil { + return err + } + *unlicensedSpectrumRestriction = v + return nil +} + +func (unlicensedSpectrumRestriction UnlicensedSpectrumRestriction) Name() string { + return enumUnlicensedSpectrumRestriction.Name(unlicensedSpectrumRestriction) +} + +func (unlicensedSpectrumRestriction UnlicensedSpectrumRestriction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { + return !enumUnlicensedSpectrumRestriction.Known(unlicensedSpectrumRestriction) +} + +func (userLocationInformation *UserLocationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsUserLocationInformation, userLocationInformation, userLocationInformation.iEExtensions) + w.WriteBit(userLocationInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := userLocationInformation.EUTRANCGI.MarshalPER(w, enc); err != nil { + return err + } + if err := userLocationInformation.TAI.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if userLocationInformation.extensions.Present() { + if err := userLocationInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (userLocationInformation *UserLocationInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *userLocationInformation = UserLocationInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&userLocationInformation.EUTRANCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&userLocationInformation.TAI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformation, userLocationInformation, &userLocationInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := userLocationInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUserLocationInformation = []ap.IESpec[ProtocolIEID, UserLocationInformation]{ + { + ID: IDPSCellInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformation, r *per.Reader, enc per.Encoding) error { + var v PSCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.PSCellInformation = &v + return nil + }, + Encode: func(x *UserLocationInformation) (per.Marshaler, bool) { + if x.PSCellInformation == nil { + return nil, false + } + return x.PSCellInformation, true + }, + }, + { + ID: IDLTENTNTAIInformation, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *UserLocationInformation, r *per.Reader, enc per.Encoding) error { + var v LTENTNTAIInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LTENTNTAIInformation = &v + return nil + }, + Encode: func(x *UserLocationInformation) (per.Marshaler, bool) { + if x.LTENTNTAIInformation == nil { + return nil, false + } + return x.LTENTNTAIInformation, true + }, + }, +} + +func (userLocationInformation *UserLocationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if userLocationInformation.EUTRANCGI.Diagnose(d) { + notComprehended = true + } + if userLocationInformation.TAI.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEsUserLocationInformation, userLocationInformation, userLocationInformation.iEExtensions) + return notComprehended +} + +func (warningAreaList *WarningAreaList) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{warningAreaList.CellIDList != nil, warningAreaList.TrackingAreaListforWarning != nil, warningAreaList.EmergencyAreaIDList != nil, warningAreaList.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case warningAreaList.CellIDList != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*warningAreaList.CellIDList).MarshalPER(w, enc); err != nil { + return err + } + case warningAreaList.TrackingAreaListforWarning != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*warningAreaList.TrackingAreaListforWarning).MarshalPER(w, enc); err != nil { + return err + } + case warningAreaList.EmergencyAreaIDList != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + if err := (*warningAreaList.EmergencyAreaIDList).MarshalPER(w, enc); err != nil { + return err + } + case warningAreaList.Ext != nil: + w.WriteBit(true) + return warningAreaList.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (warningAreaList *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *warningAreaList = WarningAreaList{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + warningAreaList.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v ECGIList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + warningAreaList.CellIDList = &v + case 1: + var v TAIListforWarning + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + warningAreaList.TrackingAreaListforWarning = &v + case 2: + var v EmergencyAreaIDList + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + warningAreaList.EmergencyAreaIDList = &v + default: + return per.ErrOverflow + } + return nil +} + +func (warningAreaList *WarningAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + switch { + case warningAreaList.CellIDList != nil: + return warningAreaList.CellIDList.Diagnose(d) + case warningAreaList.TrackingAreaListforWarning != nil: + return warningAreaList.TrackingAreaListforWarning.Diagnose(d) + case warningAreaList.EmergencyAreaIDList != nil: + case warningAreaList.Ext != nil: + return true + } + return false +} + +func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, x2TNLConfigurationInfo.iEExtensions) + w.WriteBit(x2TNLConfigurationInfo.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := x2TNLConfigurationInfo.ENBX2TransportLayerAddresses.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if x2TNLConfigurationInfo.extensions.Present() { + if err := x2TNLConfigurationInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *x2TNLConfigurationInfo = X2TNLConfigurationInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&x2TNLConfigurationInfo.ENBX2TransportLayerAddresses).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, &x2TNLConfigurationInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := x2TNLConfigurationInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsX2TNLConfigurationInfo = []ap.IESpec[ProtocolIEID, X2TNLConfigurationInfo]{ + { + ID: IDENBX2ExtendedTransportLayerAddresses, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *X2TNLConfigurationInfo, r *per.Reader, enc per.Encoding) error { + var v ENBX2ExtTLAs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ENBX2ExtendedTransportLayerAddresses = v + return nil + }, + Encode: func(x *X2TNLConfigurationInfo) (per.Marshaler, bool) { + if len(x.ENBX2ExtendedTransportLayerAddresses) == 0 { + return nil, false + } + return x.ENBX2ExtendedTransportLayerAddresses, true + }, + }, + { + ID: IDENBIndirectX2TransportLayerAddresses, + Presence: ap.PresenceOptional, + Criticality: ap.CriticalityIgnore, + Decode: func(x *X2TNLConfigurationInfo, r *per.Reader, enc per.Encoding) error { + var v ENBX2TLAs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ENBIndirectX2TransportLayerAddresses = v + return nil + }, + Encode: func(x *X2TNLConfigurationInfo) (per.Marshaler, bool) { + if len(x.ENBIndirectX2TransportLayerAddresses) == 0 { + return nil, false + } + return x.ENBIndirectX2TransportLayerAddresses, true + }, + }, +} + +func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + ap.DiagnoseExtensions(d, extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, x2TNLConfigurationInfo.iEExtensions) + return notComprehended +} + +func (x *erabModifyItemBearerModConf) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := ap.ExtensionFields(extIEserabModifyItemBearerModConf, x, x.iEExtensions) + w.WriteBit(x.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := x.erabID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if x.extensions.Present() { + if err := x.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (x *erabModifyItemBearerModConf) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *x = erabModifyItemBearerModConf{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&x.erabID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := ap.DecodeExtensionContainer(profile, r, enc, extIEserabModifyItemBearerModConf, x, &x.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := x.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEserabModifyItemBearerModConf []ap.IESpec[ProtocolIEID, erabModifyItemBearerModConf] + +func (x *erabModifyItemBearerModConf) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if x.erabID.Diagnose(d) { + notComprehended = true + } + ap.DiagnoseExtensions(d, extIEserabModifyItemBearerModConf, x, x.iEExtensions) + return notComprehended +} + +func (cNTypeRestrictions CNTypeRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cNTypeRestrictions { + if cNTypeRestrictions[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIDBroadcast CellIDBroadcast) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIDBroadcast { + if cellIDBroadcast[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (cellIDCancelled CellIDCancelled) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range cellIDCancelled { + if cellIDCancelled[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eCGIList ECGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eCGIList { + if eCGIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eNBX2ExtTLAs ENBX2ExtTLAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eNBX2ExtTLAs { + if eNBX2ExtTLAs[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABAdmittedList ERABAdmittedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABAdmittedList { + if eRABAdmittedList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABInformationList ERABInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABInformationList { + if eRABInformationList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABNotToBeModifiedListBearerModInd ERABNotToBeModifiedListBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABNotToBeModifiedListBearerModInd { + if eRABNotToBeModifiedListBearerModInd[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABSetupListBearerSURes ERABSetupListBearerSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABSetupListBearerSURes { + if eRABSetupListBearerSURes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABSetupListCtxtSURes ERABSetupListCtxtSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABSetupListCtxtSURes { + if eRABSetupListCtxtSURes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABSubjecttoDataForwardingList ERABSubjecttoDataForwardingList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABSubjecttoDataForwardingList { + if eRABSubjecttoDataForwardingList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABToBeModifiedListBearerModInd ERABToBeModifiedListBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABToBeModifiedListBearerModInd { + if eRABToBeModifiedListBearerModInd[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABToBeModifiedListBearerModReq ERABToBeModifiedListBearerModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABToBeModifiedListBearerModReq { + if eRABToBeModifiedListBearerModReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABToBeSetupListBearerSUReq ERABToBeSetupListBearerSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABToBeSetupListBearerSUReq { + if eRABToBeSetupListBearerSUReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABToBeSetupListCtxtSUReq ERABToBeSetupListCtxtSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABToBeSetupListCtxtSUReq { + if eRABToBeSetupListCtxtSUReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABToBeSetupListHOReq ERABToBeSetupListHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABToBeSetupListHOReq { + if eRABToBeSetupListHOReq[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABToBeSwitchedDLList ERABToBeSwitchedDLList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABToBeSwitchedDLList { + if eRABToBeSwitchedDLList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (eRABToBeSwitchedULList ERABToBeSwitchedULList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range eRABToBeSwitchedULList { + if eRABToBeSwitchedULList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (emergencyAreaIDBroadcast EmergencyAreaIDBroadcast) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDBroadcast { + if emergencyAreaIDBroadcast[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (emergencyAreaIDCancelled EmergencyAreaIDCancelled) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDCancelled { + if emergencyAreaIDCancelled[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (forbiddenLAs ForbiddenLAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range forbiddenLAs { + if forbiddenLAs[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (forbiddenTAs ForbiddenTAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range forbiddenTAs { + if forbiddenTAs[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (interSystemMeasurementList InterSystemMeasurementList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range interSystemMeasurementList { + if interSystemMeasurementList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range lastVisitedPSCellList { + if lastVisitedPSCellList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (rATRestrictions RATRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range rATRestrictions { + if rATRestrictions[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (servedGUMMEIs ServedGUMMEIs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range servedGUMMEIs { + if servedGUMMEIs[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (supportedTAs SupportedTAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range supportedTAs { + if supportedTAs[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIBroadcast TAIBroadcast) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIBroadcast { + if tAIBroadcast[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAICancelled TAICancelled) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAICancelled { + if tAICancelled[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIList TAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIList { + if tAIList[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (tAIListforWarning TAIListforWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range tAIListforWarning { + if tAIListforWarning[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uEAssociatedLogicalS1ConnectionListRes UEAssociatedLogicalS1ConnectionListRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uEAssociatedLogicalS1ConnectionListRes { + if uEAssociatedLogicalS1ConnectionListRes[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (uEHistoryInformation UEHistoryInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range uEHistoryInformation { + if uEHistoryInformation[i].Diagnose(d) { + notComprehended = true + } + } + return notComprehended +} + +func (additionalGUTI AdditionalGUTI) Equal(y AdditionalGUTI) bool { + return additionalGUTI == y +} + +func (allocationAndRetentionPriority AllocationAndRetentionPriority) Equal(y AllocationAndRetentionPriority) bool { + return allocationAndRetentionPriority == y +} + +func (bPLMNs BPLMNs) Equal(y BPLMNs) bool { + if len(bPLMNs) != len(y) { + return false + } + for i := range bPLMNs { + if !(bPLMNs[i] == y[i]) { + return false + } + } + return true +} + +func (broadcastCancelledAreaList BroadcastCancelledAreaList) Equal(y BroadcastCancelledAreaList) bool { + return (broadcastCancelledAreaList.CellIDCancelled == nil) == (y.CellIDCancelled == nil) && (broadcastCancelledAreaList.CellIDCancelled == nil || (*broadcastCancelledAreaList.CellIDCancelled).Equal(*y.CellIDCancelled)) && + (broadcastCancelledAreaList.TAICancelled == nil) == (y.TAICancelled == nil) && (broadcastCancelledAreaList.TAICancelled == nil || (*broadcastCancelledAreaList.TAICancelled).Equal(*y.TAICancelled)) && + (broadcastCancelledAreaList.EmergencyAreaIDCancelled == nil) == (y.EmergencyAreaIDCancelled == nil) && (broadcastCancelledAreaList.EmergencyAreaIDCancelled == nil || (*broadcastCancelledAreaList.EmergencyAreaIDCancelled).Equal(*y.EmergencyAreaIDCancelled)) && + (broadcastCancelledAreaList.Ext == nil) == (y.Ext == nil) && (broadcastCancelledAreaList.Ext == nil || (*broadcastCancelledAreaList.Ext) == *y.Ext) +} + +func (broadcastCompletedAreaList BroadcastCompletedAreaList) Equal(y BroadcastCompletedAreaList) bool { + return (broadcastCompletedAreaList.CellIDBroadcast == nil) == (y.CellIDBroadcast == nil) && (broadcastCompletedAreaList.CellIDBroadcast == nil || (*broadcastCompletedAreaList.CellIDBroadcast).Equal(*y.CellIDBroadcast)) && + (broadcastCompletedAreaList.TAIBroadcast == nil) == (y.TAIBroadcast == nil) && (broadcastCompletedAreaList.TAIBroadcast == nil || (*broadcastCompletedAreaList.TAIBroadcast).Equal(*y.TAIBroadcast)) && + (broadcastCompletedAreaList.EmergencyAreaIDBroadcast == nil) == (y.EmergencyAreaIDBroadcast == nil) && (broadcastCompletedAreaList.EmergencyAreaIDBroadcast == nil || (*broadcastCompletedAreaList.EmergencyAreaIDBroadcast).Equal(*y.EmergencyAreaIDBroadcast)) && + (broadcastCompletedAreaList.Ext == nil) == (y.Ext == nil) && (broadcastCompletedAreaList.Ext == nil || (*broadcastCompletedAreaList.Ext) == *y.Ext) +} + +func (cGI CGI) Equal(y CGI) bool { + return cGI.PLMNIdentity == y.PLMNIdentity && + cGI.LAC == y.LAC && + cGI.CI == y.CI && + (cGI.RAC == nil) == (y.RAC == nil) && (cGI.RAC == nil || (*cGI.RAC) == *y.RAC) && + cGI.iEExtensions == y.iEExtensions && + cGI.extensions == y.extensions +} + +func (cNTypeRestrictions CNTypeRestrictions) Equal(y CNTypeRestrictions) bool { + if len(cNTypeRestrictions) != len(y) { + return false + } + for i := range cNTypeRestrictions { + if !(cNTypeRestrictions[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cNTypeRestrictionsItem CNTypeRestrictionsItem) Equal(y CNTypeRestrictionsItem) bool { + return cNTypeRestrictionsItem == y +} + +func (cancelledCellInEAIItem CancelledCellInEAIItem) Equal(y CancelledCellInEAIItem) bool { + return cancelledCellInEAIItem == y +} + +func (cancelledCellInTAIItem CancelledCellInTAIItem) Equal(y CancelledCellInTAIItem) bool { + return cancelledCellInTAIItem == y +} + +func (cause Cause) Equal(y Cause) bool { + return (cause.RadioNetwork == nil) == (y.RadioNetwork == nil) && (cause.RadioNetwork == nil || (*cause.RadioNetwork) == *y.RadioNetwork) && + (cause.Transport == nil) == (y.Transport == nil) && (cause.Transport == nil || (*cause.Transport) == *y.Transport) && + (cause.NAS == nil) == (y.NAS == nil) && (cause.NAS == nil || (*cause.NAS) == *y.NAS) && + (cause.Protocol == nil) == (y.Protocol == nil) && (cause.Protocol == nil || (*cause.Protocol) == *y.Protocol) && + (cause.Misc == nil) == (y.Misc == nil) && (cause.Misc == nil || (*cause.Misc) == *y.Misc) && + (cause.Ext == nil) == (y.Ext == nil) && (cause.Ext == nil || (*cause.Ext) == *y.Ext) +} + +func (cellIDBroadcast CellIDBroadcast) Equal(y CellIDBroadcast) bool { + if len(cellIDBroadcast) != len(y) { + return false + } + for i := range cellIDBroadcast { + if !(cellIDBroadcast[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIDBroadcastItem CellIDBroadcastItem) Equal(y CellIDBroadcastItem) bool { + return cellIDBroadcastItem == y +} + +func (cellIDCancelled CellIDCancelled) Equal(y CellIDCancelled) bool { + if len(cellIDCancelled) != len(y) { + return false + } + for i := range cellIDCancelled { + if !(cellIDCancelled[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cellIDCancelledItem CellIDCancelledItem) Equal(y CellIDCancelledItem) bool { + return cellIDCancelledItem == y +} + +func (cellType CellType) Equal(y CellType) bool { + return cellType == y +} + +func (coarseUELocation CoarseUELocation) Equal(y CoarseUELocation) bool { + if len(coarseUELocation) != len(y) { + return false + } + for i := range coarseUELocation { + if !(coarseUELocation[i] == y[i]) { + return false + } + } + return true +} + +func (completedCellInEAIItem CompletedCellInEAIItem) Equal(y CompletedCellInEAIItem) bool { + return completedCellInEAIItem == y +} + +func (completedCellInTAIItem CompletedCellInTAIItem) Equal(y CompletedCellInTAIItem) bool { + return completedCellInTAIItem == y +} + +func (contextatSource ContextatSource) Equal(y ContextatSource) bool { + return contextatSource.SourceNGRANNodeID.Equal(y.SourceNGRANNodeID) && + contextatSource.RANUENGAPID == y.RANUENGAPID && + contextatSource.iEExtensions == y.iEExtensions && + contextatSource.extensions == y.extensions +} + +func (criticalityDiagnostics CriticalityDiagnostics) Equal(y CriticalityDiagnostics) bool { + return (criticalityDiagnostics.ProcedureCode == nil) == (y.ProcedureCode == nil) && (criticalityDiagnostics.ProcedureCode == nil || (*criticalityDiagnostics.ProcedureCode) == *y.ProcedureCode) && + (criticalityDiagnostics.TriggeringMessage == nil) == (y.TriggeringMessage == nil) && (criticalityDiagnostics.TriggeringMessage == nil || (*criticalityDiagnostics.TriggeringMessage) == *y.TriggeringMessage) && + (criticalityDiagnostics.ProcedureCriticality == nil) == (y.ProcedureCriticality == nil) && (criticalityDiagnostics.ProcedureCriticality == nil || (*criticalityDiagnostics.ProcedureCriticality) == *y.ProcedureCriticality) && + (criticalityDiagnostics.IEsCriticalityDiagnostics == nil) == (y.IEsCriticalityDiagnostics == nil) && slices.Equal(criticalityDiagnostics.IEsCriticalityDiagnostics, y.IEsCriticalityDiagnostics) && + criticalityDiagnostics.iEExtensions == y.iEExtensions && + criticalityDiagnostics.extensions == y.extensions +} + +func (criticalityDiagnosticsIEItem CriticalityDiagnosticsIEItem) Equal(y CriticalityDiagnosticsIEItem) bool { + return criticalityDiagnosticsIEItem == y +} + +func (dAPSRequestInfo DAPSRequestInfo) Equal(y DAPSRequestInfo) bool { + return dAPSRequestInfo == y +} + +func (downlinkNASTransport DownlinkNASTransport) Equal(y DownlinkNASTransport) bool { + return downlinkNASTransport.MMEUES1APID == y.MMEUES1APID && + downlinkNASTransport.ENBUES1APID == y.ENBUES1APID && + downlinkNASTransport.NASPDU.Equal(y.NASPDU) && + (downlinkNASTransport.CoarseUELocation == nil) == (y.CoarseUELocation == nil) && (downlinkNASTransport.CoarseUELocation == nil || (*downlinkNASTransport.CoarseUELocation).Equal(*y.CoarseUELocation)) && + downlinkNASTransport.messageMeta.Equal(y.messageMeta) +} + +func (downlinkNonUEAssociatedLPPaTransport DownlinkNonUEAssociatedLPPaTransport) Equal(y DownlinkNonUEAssociatedLPPaTransport) bool { + return downlinkNonUEAssociatedLPPaTransport.RoutingID == y.RoutingID && + downlinkNonUEAssociatedLPPaTransport.LPPaPDU.Equal(y.LPPaPDU) && + downlinkNonUEAssociatedLPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (downlinkUEAssociatedLPPaTransport DownlinkUEAssociatedLPPaTransport) Equal(y DownlinkUEAssociatedLPPaTransport) bool { + return downlinkUEAssociatedLPPaTransport.MMEUES1APID == y.MMEUES1APID && + downlinkUEAssociatedLPPaTransport.ENBUES1APID == y.ENBUES1APID && + downlinkUEAssociatedLPPaTransport.RoutingID == y.RoutingID && + downlinkUEAssociatedLPPaTransport.LPPaPDU.Equal(y.LPPaPDU) && + downlinkUEAssociatedLPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (eCGIList ECGIList) Equal(y ECGIList) bool { + if len(eCGIList) != len(y) { + return false + } + for i := range eCGIList { + if !(eCGIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eNBConfigurationTransfer ENBConfigurationTransfer) Equal(y ENBConfigurationTransfer) bool { + return (eNBConfigurationTransfer.SONConfigurationTransfer == nil) == (y.SONConfigurationTransfer == nil) && (eNBConfigurationTransfer.SONConfigurationTransfer == nil || (*eNBConfigurationTransfer.SONConfigurationTransfer).Equal(*y.SONConfigurationTransfer)) && + eNBConfigurationTransfer.messageMeta.Equal(y.messageMeta) +} + +func (eNBConfigurationUpdate ENBConfigurationUpdate) Equal(y ENBConfigurationUpdate) bool { + return (eNBConfigurationUpdate.ENBName == nil) == (y.ENBName == nil) && (eNBConfigurationUpdate.ENBName == nil || (*eNBConfigurationUpdate.ENBName) == *y.ENBName) && + eNBConfigurationUpdate.SupportedTAs.Equal(y.SupportedTAs) && + (eNBConfigurationUpdate.DefaultPagingDRX == nil) == (y.DefaultPagingDRX == nil) && (eNBConfigurationUpdate.DefaultPagingDRX == nil || (*eNBConfigurationUpdate.DefaultPagingDRX) == *y.DefaultPagingDRX) && + eNBConfigurationUpdate.messageMeta.Equal(y.messageMeta) +} + +func (eNBConfigurationUpdateAcknowledge ENBConfigurationUpdateAcknowledge) Equal(y ENBConfigurationUpdateAcknowledge) bool { + return (eNBConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eNBConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil || (*eNBConfigurationUpdateAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + eNBConfigurationUpdateAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (eNBConfigurationUpdateFailure ENBConfigurationUpdateFailure) Equal(y ENBConfigurationUpdateFailure) bool { + return (eNBConfigurationUpdateFailure.Cause == nil) == (y.Cause == nil) && (eNBConfigurationUpdateFailure.Cause == nil || (*eNBConfigurationUpdateFailure.Cause).Equal(*y.Cause)) && + (eNBConfigurationUpdateFailure.TimeToWait == nil) == (y.TimeToWait == nil) && (eNBConfigurationUpdateFailure.TimeToWait == nil || (*eNBConfigurationUpdateFailure.TimeToWait) == *y.TimeToWait) && + (eNBConfigurationUpdateFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eNBConfigurationUpdateFailure.CriticalityDiagnostics == nil || (*eNBConfigurationUpdateFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + eNBConfigurationUpdateFailure.messageMeta.Equal(y.messageMeta) +} + +func (eNBID ENBID) Equal(y ENBID) bool { + return (eNBID.MacroENBID == nil) == (y.MacroENBID == nil) && (eNBID.MacroENBID == nil || (*eNBID.MacroENBID) == *y.MacroENBID) && + (eNBID.HomeENBID == nil) == (y.HomeENBID == nil) && (eNBID.HomeENBID == nil || (*eNBID.HomeENBID) == *y.HomeENBID) && + (eNBID.ShortMacroENBID == nil) == (y.ShortMacroENBID == nil) && (eNBID.ShortMacroENBID == nil || (*eNBID.ShortMacroENBID) == *y.ShortMacroENBID) && + (eNBID.LongMacroENBID == nil) == (y.LongMacroENBID == nil) && (eNBID.LongMacroENBID == nil || (*eNBID.LongMacroENBID) == *y.LongMacroENBID) && + (eNBID.Ext == nil) == (y.Ext == nil) && (eNBID.Ext == nil || (*eNBID.Ext) == *y.Ext) +} + +func (eNBStatusTransfer ENBStatusTransfer) Equal(y ENBStatusTransfer) bool { + return eNBStatusTransfer.MMEUES1APID == y.MMEUES1APID && + eNBStatusTransfer.ENBUES1APID == y.ENBUES1APID && + eNBStatusTransfer.Container.Equal(y.Container) && + eNBStatusTransfer.messageMeta.Equal(y.messageMeta) +} + +func (eNBX2ExtTLA ENBX2ExtTLA) Equal(y ENBX2ExtTLA) bool { + return (eNBX2ExtTLA.IPsecTLA == nil) == (y.IPsecTLA == nil) && (eNBX2ExtTLA.IPsecTLA == nil || (*eNBX2ExtTLA.IPsecTLA) == *y.IPsecTLA) && + (eNBX2ExtTLA.GTPTLAa == nil) == (y.GTPTLAa == nil) && eNBX2ExtTLA.GTPTLAa.Equal(y.GTPTLAa) && + eNBX2ExtTLA.iEExtensions == y.iEExtensions && + eNBX2ExtTLA.extensions == y.extensions +} + +func (eNBX2ExtTLAs ENBX2ExtTLAs) Equal(y ENBX2ExtTLAs) bool { + if len(eNBX2ExtTLAs) != len(y) { + return false + } + for i := range eNBX2ExtTLAs { + if !(eNBX2ExtTLAs[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eNBX2GTPTLAs ENBX2GTPTLAs) Equal(y ENBX2GTPTLAs) bool { + if len(eNBX2GTPTLAs) != len(y) { + return false + } + for i := range eNBX2GTPTLAs { + if !(eNBX2GTPTLAs[i] == y[i]) { + return false + } + } + return true +} + +func (eNBX2TLAs ENBX2TLAs) Equal(y ENBX2TLAs) bool { + if len(eNBX2TLAs) != len(y) { + return false + } + for i := range eNBX2TLAs { + if !(eNBX2TLAs[i] == y[i]) { + return false + } + } + return true +} + +func (ePLMNs EPLMNs) Equal(y EPLMNs) bool { + if len(ePLMNs) != len(y) { + return false + } + for i := range ePLMNs { + if !(ePLMNs[i] == y[i]) { + return false + } + } + return true +} + +func (eRABAdmittedItem ERABAdmittedItem) Equal(y ERABAdmittedItem) bool { + return eRABAdmittedItem.ERABID == y.ERABID && + eRABAdmittedItem.TransportLayerAddress == y.TransportLayerAddress && + eRABAdmittedItem.GTPTEID == y.GTPTEID && + (eRABAdmittedItem.DLTransportLayerAddr == nil) == (y.DLTransportLayerAddr == nil) && (eRABAdmittedItem.DLTransportLayerAddr == nil || (*eRABAdmittedItem.DLTransportLayerAddr) == *y.DLTransportLayerAddr) && + (eRABAdmittedItem.DLGTPTEID == nil) == (y.DLGTPTEID == nil) && (eRABAdmittedItem.DLGTPTEID == nil || (*eRABAdmittedItem.DLGTPTEID) == *y.DLGTPTEID) && + (eRABAdmittedItem.ULTransportLayerAddr == nil) == (y.ULTransportLayerAddr == nil) && (eRABAdmittedItem.ULTransportLayerAddr == nil || (*eRABAdmittedItem.ULTransportLayerAddr) == *y.ULTransportLayerAddr) && + (eRABAdmittedItem.ULGTPTEID == nil) == (y.ULGTPTEID == nil) && (eRABAdmittedItem.ULGTPTEID == nil || (*eRABAdmittedItem.ULGTPTEID) == *y.ULGTPTEID) && + eRABAdmittedItem.iEExtensions == y.iEExtensions && + eRABAdmittedItem.extensions == y.extensions && + eRABAdmittedItem.containerCrit == y.containerCrit +} + +func (eRABAdmittedList ERABAdmittedList) Equal(y ERABAdmittedList) bool { + if len(eRABAdmittedList) != len(y) { + return false + } + for i := range eRABAdmittedList { + if !(eRABAdmittedList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABDataForwardingItem ERABDataForwardingItem) Equal(y ERABDataForwardingItem) bool { + return eRABDataForwardingItem.ERABID == y.ERABID && + (eRABDataForwardingItem.DLTransportLayerAddr == nil) == (y.DLTransportLayerAddr == nil) && (eRABDataForwardingItem.DLTransportLayerAddr == nil || (*eRABDataForwardingItem.DLTransportLayerAddr) == *y.DLTransportLayerAddr) && + (eRABDataForwardingItem.DLGTPTEID == nil) == (y.DLGTPTEID == nil) && (eRABDataForwardingItem.DLGTPTEID == nil || (*eRABDataForwardingItem.DLGTPTEID) == *y.DLGTPTEID) && + (eRABDataForwardingItem.ULTransportLayerAddr == nil) == (y.ULTransportLayerAddr == nil) && (eRABDataForwardingItem.ULTransportLayerAddr == nil || (*eRABDataForwardingItem.ULTransportLayerAddr) == *y.ULTransportLayerAddr) && + (eRABDataForwardingItem.ULGTPTEID == nil) == (y.ULGTPTEID == nil) && (eRABDataForwardingItem.ULGTPTEID == nil || (*eRABDataForwardingItem.ULGTPTEID) == *y.ULGTPTEID) && + eRABDataForwardingItem.iEExtensions == y.iEExtensions && + eRABDataForwardingItem.extensions == y.extensions && + eRABDataForwardingItem.containerCrit == y.containerCrit +} + +func (eRABInformationList ERABInformationList) Equal(y ERABInformationList) bool { + if len(eRABInformationList) != len(y) { + return false + } + for i := range eRABInformationList { + if !(eRABInformationList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABInformationListItem ERABInformationListItem) Equal(y ERABInformationListItem) bool { + return eRABInformationListItem.ERABID == y.ERABID && + (eRABInformationListItem.DLForwarding == nil) == (y.DLForwarding == nil) && (eRABInformationListItem.DLForwarding == nil || (*eRABInformationListItem.DLForwarding) == *y.DLForwarding) && + (eRABInformationListItem.DAPSRequestInfo == nil) == (y.DAPSRequestInfo == nil) && (eRABInformationListItem.DAPSRequestInfo == nil || (*eRABInformationListItem.DAPSRequestInfo).Equal(*y.DAPSRequestInfo)) && + (eRABInformationListItem.SourceTransportLayerAddress == nil) == (y.SourceTransportLayerAddress == nil) && (eRABInformationListItem.SourceTransportLayerAddress == nil || (*eRABInformationListItem.SourceTransportLayerAddress) == *y.SourceTransportLayerAddress) && + (eRABInformationListItem.SecurityIndication == nil) == (y.SecurityIndication == nil) && (eRABInformationListItem.SecurityIndication == nil || (*eRABInformationListItem.SecurityIndication).Equal(*y.SecurityIndication)) && + (eRABInformationListItem.SourceNodeTransportLayerAddress == nil) == (y.SourceNodeTransportLayerAddress == nil) && (eRABInformationListItem.SourceNodeTransportLayerAddress == nil || (*eRABInformationListItem.SourceNodeTransportLayerAddress) == *y.SourceNodeTransportLayerAddress) && + eRABInformationListItem.iEExtensions == y.iEExtensions && + eRABInformationListItem.extensions == y.extensions +} + +func (eRABItem ERABItem) Equal(y ERABItem) bool { + return eRABItem.extensions == y.extensions && + eRABItem.ERABID == y.ERABID && + eRABItem.Cause.Equal(y.Cause) && + eRABItem.iEExtensions == y.iEExtensions +} + +func (eRABLevelQoSParameters ERABLevelQoSParameters) Equal(y ERABLevelQoSParameters) bool { + return eRABLevelQoSParameters.QCI == y.QCI && + eRABLevelQoSParameters.ARP.Equal(y.ARP) && + (eRABLevelQoSParameters.GBR == nil) == (y.GBR == nil) && (eRABLevelQoSParameters.GBR == nil || (*eRABLevelQoSParameters.GBR).Equal(*y.GBR)) && + (eRABLevelQoSParameters.DownlinkPacketLossRate == nil) == (y.DownlinkPacketLossRate == nil) && (eRABLevelQoSParameters.DownlinkPacketLossRate == nil || (*eRABLevelQoSParameters.DownlinkPacketLossRate) == *y.DownlinkPacketLossRate) && + (eRABLevelQoSParameters.UplinkPacketLossRate == nil) == (y.UplinkPacketLossRate == nil) && (eRABLevelQoSParameters.UplinkPacketLossRate == nil || (*eRABLevelQoSParameters.UplinkPacketLossRate) == *y.UplinkPacketLossRate) && + eRABLevelQoSParameters.iEExtensions == y.iEExtensions && + eRABLevelQoSParameters.extensions == y.extensions +} + +func (eRABModificationConfirm ERABModificationConfirm) Equal(y ERABModificationConfirm) bool { + return (eRABModificationConfirm.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (eRABModificationConfirm.MMEUES1APID == nil || (*eRABModificationConfirm.MMEUES1APID) == *y.MMEUES1APID) && + (eRABModificationConfirm.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (eRABModificationConfirm.ENBUES1APID == nil || (*eRABModificationConfirm.ENBUES1APID) == *y.ENBUES1APID) && + slices.Equal(eRABModificationConfirm.ModifiedERABs, y.ModifiedERABs) && + slices.EqualFunc(eRABModificationConfirm.FailedToModify, y.FailedToModify, ERABItem.Equal) && + slices.EqualFunc(eRABModificationConfirm.ToBeReleased, y.ToBeReleased, ERABItem.Equal) && + (eRABModificationConfirm.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eRABModificationConfirm.CriticalityDiagnostics == nil || (*eRABModificationConfirm.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + eRABModificationConfirm.messageMeta.Equal(y.messageMeta) +} + +func (eRABModificationIndication ERABModificationIndication) Equal(y ERABModificationIndication) bool { + return eRABModificationIndication.MMEUES1APID == y.MMEUES1APID && + eRABModificationIndication.ENBUES1APID == y.ENBUES1APID && + eRABModificationIndication.ToBeModified.Equal(y.ToBeModified) && + eRABModificationIndication.NotToBeModified.Equal(y.NotToBeModified) && + (eRABModificationIndication.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABModificationIndication.UserLocationInformation == nil || (*eRABModificationIndication.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (eRABModificationIndication.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (eRABModificationIndication.TunnelInformationForBBF == nil || (*eRABModificationIndication.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && + eRABModificationIndication.messageMeta.Equal(y.messageMeta) +} + +func (eRABModifyItemBearerModRes ERABModifyItemBearerModRes) Equal(y ERABModifyItemBearerModRes) bool { + return eRABModifyItemBearerModRes == y +} + +func (eRABModifyRequest ERABModifyRequest) Equal(y ERABModifyRequest) bool { + return eRABModifyRequest.MMEUES1APID == y.MMEUES1APID && + eRABModifyRequest.ENBUES1APID == y.ENBUES1APID && + (eRABModifyRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (eRABModifyRequest.UEAggregateMaximumBitRate == nil || (*eRABModifyRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + eRABModifyRequest.ERABToBeModified.Equal(y.ERABToBeModified) && + eRABModifyRequest.messageMeta.Equal(y.messageMeta) +} + +func (eRABModifyResponse ERABModifyResponse) Equal(y ERABModifyResponse) bool { + return (eRABModifyResponse.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (eRABModifyResponse.MMEUES1APID == nil || (*eRABModifyResponse.MMEUES1APID) == *y.MMEUES1APID) && + (eRABModifyResponse.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (eRABModifyResponse.ENBUES1APID == nil || (*eRABModifyResponse.ENBUES1APID) == *y.ENBUES1APID) && + slices.Equal(eRABModifyResponse.ERABModify, y.ERABModify) && + slices.EqualFunc(eRABModifyResponse.ERABFailedToModify, y.ERABFailedToModify, ERABItem.Equal) && + (eRABModifyResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eRABModifyResponse.CriticalityDiagnostics == nil || (*eRABModifyResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (eRABModifyResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABModifyResponse.UserLocationInformation == nil || (*eRABModifyResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + eRABModifyResponse.messageMeta.Equal(y.messageMeta) +} + +func (eRABNotToBeModifiedListBearerModInd ERABNotToBeModifiedListBearerModInd) Equal(y ERABNotToBeModifiedListBearerModInd) bool { + if len(eRABNotToBeModifiedListBearerModInd) != len(y) { + return false + } + for i := range eRABNotToBeModifiedListBearerModInd { + if !(eRABNotToBeModifiedListBearerModInd[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABReleaseCommand ERABReleaseCommand) Equal(y ERABReleaseCommand) bool { + return eRABReleaseCommand.MMEUES1APID == y.MMEUES1APID && + eRABReleaseCommand.ENBUES1APID == y.ENBUES1APID && + (eRABReleaseCommand.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (eRABReleaseCommand.UEAggregateMaximumBitRate == nil || (*eRABReleaseCommand.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + slices.EqualFunc(eRABReleaseCommand.ERABToBeReleased, y.ERABToBeReleased, ERABItem.Equal) && + eRABReleaseCommand.NASPDU.Equal(y.NASPDU) && + eRABReleaseCommand.messageMeta.Equal(y.messageMeta) +} + +func (eRABReleaseIndication ERABReleaseIndication) Equal(y ERABReleaseIndication) bool { + return eRABReleaseIndication.MMEUES1APID == y.MMEUES1APID && + eRABReleaseIndication.ENBUES1APID == y.ENBUES1APID && + slices.EqualFunc(eRABReleaseIndication.ERABReleased, y.ERABReleased, ERABItem.Equal) && + (eRABReleaseIndication.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABReleaseIndication.UserLocationInformation == nil || (*eRABReleaseIndication.UserLocationInformation).Equal(*y.UserLocationInformation)) && + eRABReleaseIndication.messageMeta.Equal(y.messageMeta) +} + +func (eRABReleaseItemBearerRelComp ERABReleaseItemBearerRelComp) Equal(y ERABReleaseItemBearerRelComp) bool { + return eRABReleaseItemBearerRelComp == y +} + +func (eRABReleaseResponse ERABReleaseResponse) Equal(y ERABReleaseResponse) bool { + return (eRABReleaseResponse.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (eRABReleaseResponse.MMEUES1APID == nil || (*eRABReleaseResponse.MMEUES1APID) == *y.MMEUES1APID) && + (eRABReleaseResponse.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (eRABReleaseResponse.ENBUES1APID == nil || (*eRABReleaseResponse.ENBUES1APID) == *y.ENBUES1APID) && + slices.Equal(eRABReleaseResponse.ERABReleased, y.ERABReleased) && + slices.EqualFunc(eRABReleaseResponse.ERABFailedToRelease, y.ERABFailedToRelease, ERABItem.Equal) && + (eRABReleaseResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eRABReleaseResponse.CriticalityDiagnostics == nil || (*eRABReleaseResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (eRABReleaseResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABReleaseResponse.UserLocationInformation == nil || (*eRABReleaseResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + eRABReleaseResponse.messageMeta.Equal(y.messageMeta) +} + +func (eRABSetupItemCtxtSURes ERABSetupItemCtxtSURes) Equal(y ERABSetupItemCtxtSURes) bool { + return eRABSetupItemCtxtSURes == y +} + +func (eRABSetupListBearerSURes ERABSetupListBearerSURes) Equal(y ERABSetupListBearerSURes) bool { + if len(eRABSetupListBearerSURes) != len(y) { + return false + } + for i := range eRABSetupListBearerSURes { + if !(eRABSetupListBearerSURes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABSetupListCtxtSURes ERABSetupListCtxtSURes) Equal(y ERABSetupListCtxtSURes) bool { + if len(eRABSetupListCtxtSURes) != len(y) { + return false + } + for i := range eRABSetupListCtxtSURes { + if !(eRABSetupListCtxtSURes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABSetupRequest ERABSetupRequest) Equal(y ERABSetupRequest) bool { + return eRABSetupRequest.MMEUES1APID == y.MMEUES1APID && + eRABSetupRequest.ENBUES1APID == y.ENBUES1APID && + (eRABSetupRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (eRABSetupRequest.UEAggregateMaximumBitRate == nil || (*eRABSetupRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + eRABSetupRequest.ERABToBeSetup.Equal(y.ERABToBeSetup) && + eRABSetupRequest.messageMeta.Equal(y.messageMeta) +} + +func (eRABSetupResponse ERABSetupResponse) Equal(y ERABSetupResponse) bool { + return (eRABSetupResponse.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (eRABSetupResponse.MMEUES1APID == nil || (*eRABSetupResponse.MMEUES1APID) == *y.MMEUES1APID) && + (eRABSetupResponse.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (eRABSetupResponse.ENBUES1APID == nil || (*eRABSetupResponse.ENBUES1APID) == *y.ENBUES1APID) && + eRABSetupResponse.ERABSetup.Equal(y.ERABSetup) && + slices.EqualFunc(eRABSetupResponse.ERABFailedToSetup, y.ERABFailedToSetup, ERABItem.Equal) && + (eRABSetupResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eRABSetupResponse.CriticalityDiagnostics == nil || (*eRABSetupResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (eRABSetupResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABSetupResponse.UserLocationInformation == nil || (*eRABSetupResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + eRABSetupResponse.messageMeta.Equal(y.messageMeta) +} + +func (eRABSubjecttoDataForwardingList ERABSubjecttoDataForwardingList) Equal(y ERABSubjecttoDataForwardingList) bool { + if len(eRABSubjecttoDataForwardingList) != len(y) { + return false + } + for i := range eRABSubjecttoDataForwardingList { + if !(eRABSubjecttoDataForwardingList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABToBeModifiedItemBearerModInd ERABToBeModifiedItemBearerModInd) Equal(y ERABToBeModifiedItemBearerModInd) bool { + return eRABToBeModifiedItemBearerModInd == y +} + +func (eRABToBeModifiedItemBearerModReq ERABToBeModifiedItemBearerModReq) Equal(y ERABToBeModifiedItemBearerModReq) bool { + return eRABToBeModifiedItemBearerModReq.ERABID == y.ERABID && + eRABToBeModifiedItemBearerModReq.QoS.Equal(y.QoS) && + eRABToBeModifiedItemBearerModReq.NASPDU.Equal(y.NASPDU) && + (eRABToBeModifiedItemBearerModReq.TransportInformation == nil) == (y.TransportInformation == nil) && (eRABToBeModifiedItemBearerModReq.TransportInformation == nil || (*eRABToBeModifiedItemBearerModReq.TransportInformation).Equal(*y.TransportInformation)) && + eRABToBeModifiedItemBearerModReq.iEExtensions == y.iEExtensions && + eRABToBeModifiedItemBearerModReq.extensions == y.extensions && + eRABToBeModifiedItemBearerModReq.containerCrit == y.containerCrit +} + +func (eRABToBeModifiedListBearerModInd ERABToBeModifiedListBearerModInd) Equal(y ERABToBeModifiedListBearerModInd) bool { + if len(eRABToBeModifiedListBearerModInd) != len(y) { + return false + } + for i := range eRABToBeModifiedListBearerModInd { + if !(eRABToBeModifiedListBearerModInd[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABToBeModifiedListBearerModReq ERABToBeModifiedListBearerModReq) Equal(y ERABToBeModifiedListBearerModReq) bool { + if len(eRABToBeModifiedListBearerModReq) != len(y) { + return false + } + for i := range eRABToBeModifiedListBearerModReq { + if !(eRABToBeModifiedListBearerModReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABToBeSetupItemBearerSUReq ERABToBeSetupItemBearerSUReq) Equal(y ERABToBeSetupItemBearerSUReq) bool { + return eRABToBeSetupItemBearerSUReq.ERABID == y.ERABID && + eRABToBeSetupItemBearerSUReq.QoS.Equal(y.QoS) && + eRABToBeSetupItemBearerSUReq.TransportLayerAddress == y.TransportLayerAddress && + eRABToBeSetupItemBearerSUReq.GTPTEID == y.GTPTEID && + eRABToBeSetupItemBearerSUReq.NASPDU.Equal(y.NASPDU) && + (eRABToBeSetupItemBearerSUReq.CorrelationID == nil) == (y.CorrelationID == nil) && (eRABToBeSetupItemBearerSUReq.CorrelationID == nil || (*eRABToBeSetupItemBearerSUReq.CorrelationID) == *y.CorrelationID) && + (eRABToBeSetupItemBearerSUReq.SIPTOCorrelationID == nil) == (y.SIPTOCorrelationID == nil) && (eRABToBeSetupItemBearerSUReq.SIPTOCorrelationID == nil || (*eRABToBeSetupItemBearerSUReq.SIPTOCorrelationID) == *y.SIPTOCorrelationID) && + (eRABToBeSetupItemBearerSUReq.BearerType == nil) == (y.BearerType == nil) && (eRABToBeSetupItemBearerSUReq.BearerType == nil || (*eRABToBeSetupItemBearerSUReq.BearerType) == *y.BearerType) && + (eRABToBeSetupItemBearerSUReq.EthernetType == nil) == (y.EthernetType == nil) && (eRABToBeSetupItemBearerSUReq.EthernetType == nil || (*eRABToBeSetupItemBearerSUReq.EthernetType) == *y.EthernetType) && + (eRABToBeSetupItemBearerSUReq.SecurityIndication == nil) == (y.SecurityIndication == nil) && (eRABToBeSetupItemBearerSUReq.SecurityIndication == nil || (*eRABToBeSetupItemBearerSUReq.SecurityIndication).Equal(*y.SecurityIndication)) && + eRABToBeSetupItemBearerSUReq.iEExtensions == y.iEExtensions && + eRABToBeSetupItemBearerSUReq.extensions == y.extensions && + eRABToBeSetupItemBearerSUReq.containerCrit == y.containerCrit +} + +func (eRABToBeSetupItemCtxtSUReq ERABToBeSetupItemCtxtSUReq) Equal(y ERABToBeSetupItemCtxtSUReq) bool { + return eRABToBeSetupItemCtxtSUReq.ERABID == y.ERABID && + eRABToBeSetupItemCtxtSUReq.QoS.Equal(y.QoS) && + eRABToBeSetupItemCtxtSUReq.TransportLayerAddress == y.TransportLayerAddress && + eRABToBeSetupItemCtxtSUReq.GTPTEID == y.GTPTEID && + (eRABToBeSetupItemCtxtSUReq.NASPDU == nil) == (y.NASPDU == nil) && eRABToBeSetupItemCtxtSUReq.NASPDU.Equal(y.NASPDU) && + (eRABToBeSetupItemCtxtSUReq.CorrelationID == nil) == (y.CorrelationID == nil) && (eRABToBeSetupItemCtxtSUReq.CorrelationID == nil || (*eRABToBeSetupItemCtxtSUReq.CorrelationID) == *y.CorrelationID) && + (eRABToBeSetupItemCtxtSUReq.SIPTOCorrelationID == nil) == (y.SIPTOCorrelationID == nil) && (eRABToBeSetupItemCtxtSUReq.SIPTOCorrelationID == nil || (*eRABToBeSetupItemCtxtSUReq.SIPTOCorrelationID) == *y.SIPTOCorrelationID) && + (eRABToBeSetupItemCtxtSUReq.BearerType == nil) == (y.BearerType == nil) && (eRABToBeSetupItemCtxtSUReq.BearerType == nil || (*eRABToBeSetupItemCtxtSUReq.BearerType) == *y.BearerType) && + (eRABToBeSetupItemCtxtSUReq.EthernetType == nil) == (y.EthernetType == nil) && (eRABToBeSetupItemCtxtSUReq.EthernetType == nil || (*eRABToBeSetupItemCtxtSUReq.EthernetType) == *y.EthernetType) && + (eRABToBeSetupItemCtxtSUReq.SecurityIndication == nil) == (y.SecurityIndication == nil) && (eRABToBeSetupItemCtxtSUReq.SecurityIndication == nil || (*eRABToBeSetupItemCtxtSUReq.SecurityIndication).Equal(*y.SecurityIndication)) && + eRABToBeSetupItemCtxtSUReq.iEExtensions == y.iEExtensions && + eRABToBeSetupItemCtxtSUReq.extensions == y.extensions && + eRABToBeSetupItemCtxtSUReq.containerCrit == y.containerCrit +} + +func (eRABToBeSetupItemHOReq ERABToBeSetupItemHOReq) Equal(y ERABToBeSetupItemHOReq) bool { + return eRABToBeSetupItemHOReq.ERABID == y.ERABID && + eRABToBeSetupItemHOReq.TransportLayerAddress == y.TransportLayerAddress && + eRABToBeSetupItemHOReq.GTPTEID == y.GTPTEID && + eRABToBeSetupItemHOReq.QoS.Equal(y.QoS) && + (eRABToBeSetupItemHOReq.DataForwardingNotPossible == nil) == (y.DataForwardingNotPossible == nil) && (eRABToBeSetupItemHOReq.DataForwardingNotPossible == nil || (*eRABToBeSetupItemHOReq.DataForwardingNotPossible) == *y.DataForwardingNotPossible) && + (eRABToBeSetupItemHOReq.BearerType == nil) == (y.BearerType == nil) && (eRABToBeSetupItemHOReq.BearerType == nil || (*eRABToBeSetupItemHOReq.BearerType) == *y.BearerType) && + (eRABToBeSetupItemHOReq.EthernetType == nil) == (y.EthernetType == nil) && (eRABToBeSetupItemHOReq.EthernetType == nil || (*eRABToBeSetupItemHOReq.EthernetType) == *y.EthernetType) && + (eRABToBeSetupItemHOReq.SecurityIndication == nil) == (y.SecurityIndication == nil) && (eRABToBeSetupItemHOReq.SecurityIndication == nil || (*eRABToBeSetupItemHOReq.SecurityIndication).Equal(*y.SecurityIndication)) && + eRABToBeSetupItemHOReq.iEExtensions == y.iEExtensions && + eRABToBeSetupItemHOReq.extensions == y.extensions && + eRABToBeSetupItemHOReq.containerCrit == y.containerCrit +} + +func (eRABToBeSetupListBearerSUReq ERABToBeSetupListBearerSUReq) Equal(y ERABToBeSetupListBearerSUReq) bool { + if len(eRABToBeSetupListBearerSUReq) != len(y) { + return false + } + for i := range eRABToBeSetupListBearerSUReq { + if !(eRABToBeSetupListBearerSUReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABToBeSetupListCtxtSUReq ERABToBeSetupListCtxtSUReq) Equal(y ERABToBeSetupListCtxtSUReq) bool { + if len(eRABToBeSetupListCtxtSUReq) != len(y) { + return false + } + for i := range eRABToBeSetupListCtxtSUReq { + if !(eRABToBeSetupListCtxtSUReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABToBeSetupListHOReq ERABToBeSetupListHOReq) Equal(y ERABToBeSetupListHOReq) bool { + if len(eRABToBeSetupListHOReq) != len(y) { + return false + } + for i := range eRABToBeSetupListHOReq { + if !(eRABToBeSetupListHOReq[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABToBeSwitchedDLItem ERABToBeSwitchedDLItem) Equal(y ERABToBeSwitchedDLItem) bool { + return eRABToBeSwitchedDLItem.ERABID == y.ERABID && + eRABToBeSwitchedDLItem.TransportLayerAddress == y.TransportLayerAddress && + eRABToBeSwitchedDLItem.GTPTEID == y.GTPTEID && + (eRABToBeSwitchedDLItem.SecurityIndication == nil) == (y.SecurityIndication == nil) && (eRABToBeSwitchedDLItem.SecurityIndication == nil || (*eRABToBeSwitchedDLItem.SecurityIndication).Equal(*y.SecurityIndication)) && + eRABToBeSwitchedDLItem.iEExtensions == y.iEExtensions && + eRABToBeSwitchedDLItem.extensions == y.extensions && + eRABToBeSwitchedDLItem.containerCrit == y.containerCrit +} + +func (eRABToBeSwitchedDLList ERABToBeSwitchedDLList) Equal(y ERABToBeSwitchedDLList) bool { + if len(eRABToBeSwitchedDLList) != len(y) { + return false + } + for i := range eRABToBeSwitchedDLList { + if !(eRABToBeSwitchedDLList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABToBeSwitchedULItem ERABToBeSwitchedULItem) Equal(y ERABToBeSwitchedULItem) bool { + return eRABToBeSwitchedULItem == y +} + +func (eRABToBeSwitchedULList ERABToBeSwitchedULList) Equal(y ERABToBeSwitchedULList) bool { + if len(eRABToBeSwitchedULList) != len(y) { + return false + } + for i := range eRABToBeSwitchedULList { + if !(eRABToBeSwitchedULList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eUTRANCGI EUTRANCGI) Equal(y EUTRANCGI) bool { + return eUTRANCGI == y +} + +func (emergencyAreaIDBroadcast EmergencyAreaIDBroadcast) Equal(y EmergencyAreaIDBroadcast) bool { + if len(emergencyAreaIDBroadcast) != len(y) { + return false + } + for i := range emergencyAreaIDBroadcast { + if !(emergencyAreaIDBroadcast[i].Equal(y[i])) { + return false + } + } + return true +} + +func (emergencyAreaIDBroadcastItem EmergencyAreaIDBroadcastItem) Equal(y EmergencyAreaIDBroadcastItem) bool { + return emergencyAreaIDBroadcastItem.extensions == y.extensions && + emergencyAreaIDBroadcastItem.EmergencyAreaID == y.EmergencyAreaID && + slices.Equal(emergencyAreaIDBroadcastItem.CompletedCellInEAI, y.CompletedCellInEAI) && + emergencyAreaIDBroadcastItem.iEExtensions == y.iEExtensions +} + +func (emergencyAreaIDCancelled EmergencyAreaIDCancelled) Equal(y EmergencyAreaIDCancelled) bool { + if len(emergencyAreaIDCancelled) != len(y) { + return false + } + for i := range emergencyAreaIDCancelled { + if !(emergencyAreaIDCancelled[i].Equal(y[i])) { + return false + } + } + return true +} + +func (emergencyAreaIDCancelledItem EmergencyAreaIDCancelledItem) Equal(y EmergencyAreaIDCancelledItem) bool { + return emergencyAreaIDCancelledItem.extensions == y.extensions && + emergencyAreaIDCancelledItem.EmergencyAreaID == y.EmergencyAreaID && + slices.Equal(emergencyAreaIDCancelledItem.CancelledCellInEAI, y.CancelledCellInEAI) && + emergencyAreaIDCancelledItem.iEExtensions == y.iEExtensions +} + +func (emergencyAreaIDList EmergencyAreaIDList) Equal(y EmergencyAreaIDList) bool { + if len(emergencyAreaIDList) != len(y) { + return false + } + for i := range emergencyAreaIDList { + if !(emergencyAreaIDList[i] == y[i]) { + return false + } + } + return true +} + +func (errorIndication ErrorIndication) Equal(y ErrorIndication) bool { + return (errorIndication.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (errorIndication.MMEUES1APID == nil || (*errorIndication.MMEUES1APID) == *y.MMEUES1APID) && + (errorIndication.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (errorIndication.ENBUES1APID == nil || (*errorIndication.ENBUES1APID) == *y.ENBUES1APID) && + (errorIndication.Cause == nil) == (y.Cause == nil) && (errorIndication.Cause == nil || (*errorIndication.Cause).Equal(*y.Cause)) && + (errorIndication.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (errorIndication.CriticalityDiagnostics == nil || (*errorIndication.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (errorIndication.STMSI == nil) == (y.STMSI == nil) && (errorIndication.STMSI == nil || (*errorIndication.STMSI).Equal(*y.STMSI)) && + errorIndication.messageMeta.Equal(y.messageMeta) +} + +func (fiveGSTAI FiveGSTAI) Equal(y FiveGSTAI) bool { + return fiveGSTAI == y +} + +func (forbiddenLACs ForbiddenLACs) Equal(y ForbiddenLACs) bool { + if len(forbiddenLACs) != len(y) { + return false + } + for i := range forbiddenLACs { + if !(forbiddenLACs[i] == y[i]) { + return false + } + } + return true +} + +func (forbiddenLAs ForbiddenLAs) Equal(y ForbiddenLAs) bool { + if len(forbiddenLAs) != len(y) { + return false + } + for i := range forbiddenLAs { + if !(forbiddenLAs[i].Equal(y[i])) { + return false + } + } + return true +} + +func (forbiddenLAsItem ForbiddenLAsItem) Equal(y ForbiddenLAsItem) bool { + return forbiddenLAsItem.extensions == y.extensions && + forbiddenLAsItem.PLMNIdentity == y.PLMNIdentity && + forbiddenLAsItem.ForbiddenLACs.Equal(y.ForbiddenLACs) && + forbiddenLAsItem.iEExtensions == y.iEExtensions +} + +func (forbiddenTACs ForbiddenTACs) Equal(y ForbiddenTACs) bool { + if len(forbiddenTACs) != len(y) { + return false + } + for i := range forbiddenTACs { + if !(forbiddenTACs[i] == y[i]) { + return false + } + } + return true +} + +func (forbiddenTAs ForbiddenTAs) Equal(y ForbiddenTAs) bool { + if len(forbiddenTAs) != len(y) { + return false + } + for i := range forbiddenTAs { + if !(forbiddenTAs[i].Equal(y[i])) { + return false + } + } + return true +} + +func (forbiddenTAsItem ForbiddenTAsItem) Equal(y ForbiddenTAsItem) bool { + return forbiddenTAsItem.extensions == y.extensions && + forbiddenTAsItem.PLMNIdentity == y.PLMNIdentity && + forbiddenTAsItem.ForbiddenTACs.Equal(y.ForbiddenTACs) && + forbiddenTAsItem.iEExtensions == y.iEExtensions +} + +func (gBRQosInformation GBRQosInformation) Equal(y GBRQosInformation) bool { + return gBRQosInformation.MaximumBitrateDL == y.MaximumBitrateDL && + gBRQosInformation.MaximumBitrateUL == y.MaximumBitrateUL && + gBRQosInformation.GuaranteedBitrateDL == y.GuaranteedBitrateDL && + gBRQosInformation.GuaranteedBitrateUL == y.GuaranteedBitrateUL && + (gBRQosInformation.ExtendedMaximumBitrateDL == nil) == (y.ExtendedMaximumBitrateDL == nil) && (gBRQosInformation.ExtendedMaximumBitrateDL == nil || (*gBRQosInformation.ExtendedMaximumBitrateDL) == *y.ExtendedMaximumBitrateDL) && + (gBRQosInformation.ExtendedMaximumBitrateUL == nil) == (y.ExtendedMaximumBitrateUL == nil) && (gBRQosInformation.ExtendedMaximumBitrateUL == nil || (*gBRQosInformation.ExtendedMaximumBitrateUL) == *y.ExtendedMaximumBitrateUL) && + (gBRQosInformation.ExtendedGuaranteedBitrateDL == nil) == (y.ExtendedGuaranteedBitrateDL == nil) && (gBRQosInformation.ExtendedGuaranteedBitrateDL == nil || (*gBRQosInformation.ExtendedGuaranteedBitrateDL) == *y.ExtendedGuaranteedBitrateDL) && + (gBRQosInformation.ExtendedGuaranteedBitrateUL == nil) == (y.ExtendedGuaranteedBitrateUL == nil) && (gBRQosInformation.ExtendedGuaranteedBitrateUL == nil || (*gBRQosInformation.ExtendedGuaranteedBitrateUL) == *y.ExtendedGuaranteedBitrateUL) && + gBRQosInformation.iEExtensions == y.iEExtensions && + gBRQosInformation.extensions == y.extensions +} + +func (gNB GNB) Equal(y GNB) bool { + return gNB.extensions == y.extensions && + gNB.GlobalGNBID.Equal(y.GlobalGNBID) && + gNB.iEExtensions == y.iEExtensions +} + +func (gNBID GNBID) Equal(y GNBID) bool { + return gNBID == y +} + +func (gNBIdentity GNBIdentity) Equal(y GNBIdentity) bool { + return (gNBIdentity.GNBID == nil) == (y.GNBID == nil) && (gNBIdentity.GNBID == nil || (*gNBIdentity.GNBID).Equal(*y.GNBID)) && + (gNBIdentity.Ext == nil) == (y.Ext == nil) && (gNBIdentity.Ext == nil || (*gNBIdentity.Ext) == *y.Ext) +} + +func (gUMMEI GUMMEI) Equal(y GUMMEI) bool { + return gUMMEI == y +} + +func (globalENBID GlobalENBID) Equal(y GlobalENBID) bool { + return globalENBID.extensions == y.extensions && + globalENBID.PLMNIdentity == y.PLMNIdentity && + globalENBID.ENBID.Equal(y.ENBID) && + globalENBID.iEExtensions == y.iEExtensions +} + +func (globalGNBID GlobalGNBID) Equal(y GlobalGNBID) bool { + return globalGNBID.extensions == y.extensions && + globalGNBID.PLMNIdentity == y.PLMNIdentity && + globalGNBID.GNBID.Equal(y.GNBID) && + globalGNBID.iEExtensions == y.iEExtensions +} + +func (globalRANNodeID GlobalRANNodeID) Equal(y GlobalRANNodeID) bool { + return (globalRANNodeID.GNB == nil) == (y.GNB == nil) && (globalRANNodeID.GNB == nil || (*globalRANNodeID.GNB).Equal(*y.GNB)) && + (globalRANNodeID.NgENB == nil) == (y.NgENB == nil) && (globalRANNodeID.NgENB == nil || (*globalRANNodeID.NgENB).Equal(*y.NgENB)) && + (globalRANNodeID.Ext == nil) == (y.Ext == nil) && (globalRANNodeID.Ext == nil || (*globalRANNodeID.Ext) == *y.Ext) +} + +func (handoverCancel HandoverCancel) Equal(y HandoverCancel) bool { + return handoverCancel.MMEUES1APID == y.MMEUES1APID && + handoverCancel.ENBUES1APID == y.ENBUES1APID && + (handoverCancel.Cause == nil) == (y.Cause == nil) && (handoverCancel.Cause == nil || (*handoverCancel.Cause).Equal(*y.Cause)) && + handoverCancel.messageMeta.Equal(y.messageMeta) +} + +func (handoverCancelAcknowledge HandoverCancelAcknowledge) Equal(y HandoverCancelAcknowledge) bool { + return (handoverCancelAcknowledge.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (handoverCancelAcknowledge.MMEUES1APID == nil || (*handoverCancelAcknowledge.MMEUES1APID) == *y.MMEUES1APID) && + (handoverCancelAcknowledge.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (handoverCancelAcknowledge.ENBUES1APID == nil || (*handoverCancelAcknowledge.ENBUES1APID) == *y.ENBUES1APID) && + (handoverCancelAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverCancelAcknowledge.CriticalityDiagnostics == nil || (*handoverCancelAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverCancelAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (handoverCommand HandoverCommand) Equal(y HandoverCommand) bool { + return handoverCommand.MMEUES1APID == y.MMEUES1APID && + handoverCommand.ENBUES1APID == y.ENBUES1APID && + handoverCommand.HandoverType == y.HandoverType && + handoverCommand.NASSecurityParametersfromEUTRAN.Equal(y.NASSecurityParametersfromEUTRAN) && + handoverCommand.ERABSubjecttoDataForwarding.Equal(y.ERABSubjecttoDataForwarding) && + slices.EqualFunc(handoverCommand.ERABToRelease, y.ERABToRelease, ERABItem.Equal) && + handoverCommand.TargetToSource.Equal(y.TargetToSource) && + (handoverCommand.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverCommand.CriticalityDiagnostics == nil || (*handoverCommand.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverCommand.messageMeta.Equal(y.messageMeta) +} + +func (handoverFailure HandoverFailure) Equal(y HandoverFailure) bool { + return (handoverFailure.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (handoverFailure.MMEUES1APID == nil || (*handoverFailure.MMEUES1APID) == *y.MMEUES1APID) && + (handoverFailure.Cause == nil) == (y.Cause == nil) && (handoverFailure.Cause == nil || (*handoverFailure.Cause).Equal(*y.Cause)) && + (handoverFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverFailure.CriticalityDiagnostics == nil || (*handoverFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverFailure.messageMeta.Equal(y.messageMeta) +} + +func (handoverNotify HandoverNotify) Equal(y HandoverNotify) bool { + return handoverNotify.MMEUES1APID == y.MMEUES1APID && + handoverNotify.ENBUES1APID == y.ENBUES1APID && + (handoverNotify.EUTRANCGI == nil) == (y.EUTRANCGI == nil) && (handoverNotify.EUTRANCGI == nil || (*handoverNotify.EUTRANCGI).Equal(*y.EUTRANCGI)) && + (handoverNotify.TAI == nil) == (y.TAI == nil) && (handoverNotify.TAI == nil || (*handoverNotify.TAI).Equal(*y.TAI)) && + (handoverNotify.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (handoverNotify.TunnelInformationForBBF == nil || (*handoverNotify.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && + handoverNotify.messageMeta.Equal(y.messageMeta) +} + +func (handoverPreparationFailure HandoverPreparationFailure) Equal(y HandoverPreparationFailure) bool { + return (handoverPreparationFailure.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (handoverPreparationFailure.MMEUES1APID == nil || (*handoverPreparationFailure.MMEUES1APID) == *y.MMEUES1APID) && + (handoverPreparationFailure.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (handoverPreparationFailure.ENBUES1APID == nil || (*handoverPreparationFailure.ENBUES1APID) == *y.ENBUES1APID) && + (handoverPreparationFailure.Cause == nil) == (y.Cause == nil) && (handoverPreparationFailure.Cause == nil || (*handoverPreparationFailure.Cause).Equal(*y.Cause)) && + (handoverPreparationFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverPreparationFailure.CriticalityDiagnostics == nil || (*handoverPreparationFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverPreparationFailure.messageMeta.Equal(y.messageMeta) +} + +func (handoverRequest HandoverRequest) Equal(y HandoverRequest) bool { + return handoverRequest.MMEUES1APID == y.MMEUES1APID && + handoverRequest.HandoverType == y.HandoverType && + (handoverRequest.Cause == nil) == (y.Cause == nil) && (handoverRequest.Cause == nil || (*handoverRequest.Cause).Equal(*y.Cause)) && + handoverRequest.UEAMBR.Equal(y.UEAMBR) && + handoverRequest.ERABToBeSetup.Equal(y.ERABToBeSetup) && + handoverRequest.SourceToTarget.Equal(y.SourceToTarget) && + handoverRequest.UESecurityCapabilities.Equal(y.UESecurityCapabilities) && + (handoverRequest.HandoverRestrictionList == nil) == (y.HandoverRestrictionList == nil) && (handoverRequest.HandoverRestrictionList == nil || (*handoverRequest.HandoverRestrictionList).Equal(*y.HandoverRestrictionList)) && + (handoverRequest.TraceActivation == nil) == (y.TraceActivation == nil) && (handoverRequest.TraceActivation == nil || (*handoverRequest.TraceActivation).Equal(*y.TraceActivation)) && + handoverRequest.SecurityContext.Equal(y.SecurityContext) && + handoverRequest.NASSecurityParameterstoEUTRAN.Equal(y.NASSecurityParameterstoEUTRAN) && + (handoverRequest.GUMMEI == nil) == (y.GUMMEI == nil) && (handoverRequest.GUMMEI == nil || (*handoverRequest.GUMMEI).Equal(*y.GUMMEI)) && + (handoverRequest.MMEUES1APID2 == nil) == (y.MMEUES1APID2 == nil) && (handoverRequest.MMEUES1APID2 == nil || (*handoverRequest.MMEUES1APID2) == *y.MMEUES1APID2) && + (handoverRequest.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (handoverRequest.TimeRefDistribution == nil || (*handoverRequest.TimeRefDistribution) == *y.TimeRefDistribution) && + handoverRequest.messageMeta.Equal(y.messageMeta) +} + +func (handoverRequestAcknowledge HandoverRequestAcknowledge) Equal(y HandoverRequestAcknowledge) bool { + return (handoverRequestAcknowledge.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (handoverRequestAcknowledge.MMEUES1APID == nil || (*handoverRequestAcknowledge.MMEUES1APID) == *y.MMEUES1APID) && + (handoverRequestAcknowledge.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (handoverRequestAcknowledge.ENBUES1APID == nil || (*handoverRequestAcknowledge.ENBUES1APID) == *y.ENBUES1APID) && + handoverRequestAcknowledge.ERABAdmitted.Equal(y.ERABAdmitted) && + slices.EqualFunc(handoverRequestAcknowledge.ERABFailedToSetup, y.ERABFailedToSetup, ERABItem.Equal) && + handoverRequestAcknowledge.TargetToSource.Equal(y.TargetToSource) && + (handoverRequestAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverRequestAcknowledge.CriticalityDiagnostics == nil || (*handoverRequestAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + handoverRequestAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (handoverRequired HandoverRequired) Equal(y HandoverRequired) bool { + return handoverRequired.MMEUES1APID == y.MMEUES1APID && + handoverRequired.ENBUES1APID == y.ENBUES1APID && + handoverRequired.HandoverType == y.HandoverType && + (handoverRequired.Cause == nil) == (y.Cause == nil) && (handoverRequired.Cause == nil || (*handoverRequired.Cause).Equal(*y.Cause)) && + handoverRequired.TargetID.Equal(y.TargetID) && + (handoverRequired.DirectForwardingPathAvailability == nil) == (y.DirectForwardingPathAvailability == nil) && (handoverRequired.DirectForwardingPathAvailability == nil || (*handoverRequired.DirectForwardingPathAvailability) == *y.DirectForwardingPathAvailability) && + handoverRequired.SourceToTarget.Equal(y.SourceToTarget) && + handoverRequired.messageMeta.Equal(y.messageMeta) +} + +func (handoverRestrictionList HandoverRestrictionList) Equal(y HandoverRestrictionList) bool { + return handoverRestrictionList.extensions == y.extensions && + handoverRestrictionList.ServingPLMN == y.ServingPLMN && + (handoverRestrictionList.EquivalentPLMNs == nil) == (y.EquivalentPLMNs == nil) && handoverRestrictionList.EquivalentPLMNs.Equal(y.EquivalentPLMNs) && + (handoverRestrictionList.ForbiddenTAs == nil) == (y.ForbiddenTAs == nil) && handoverRestrictionList.ForbiddenTAs.Equal(y.ForbiddenTAs) && + (handoverRestrictionList.ForbiddenLAs == nil) == (y.ForbiddenLAs == nil) && handoverRestrictionList.ForbiddenLAs.Equal(y.ForbiddenLAs) && + (handoverRestrictionList.ForbiddenInterRATs == nil) == (y.ForbiddenInterRATs == nil) && (handoverRestrictionList.ForbiddenInterRATs == nil || (*handoverRestrictionList.ForbiddenInterRATs) == *y.ForbiddenInterRATs) && + (handoverRestrictionList.NRrestrictioninEPSasSecondaryRAT == nil) == (y.NRrestrictioninEPSasSecondaryRAT == nil) && (handoverRestrictionList.NRrestrictioninEPSasSecondaryRAT == nil || (*handoverRestrictionList.NRrestrictioninEPSasSecondaryRAT) == *y.NRrestrictioninEPSasSecondaryRAT) && + (handoverRestrictionList.UnlicensedSpectrumRestriction == nil) == (y.UnlicensedSpectrumRestriction == nil) && (handoverRestrictionList.UnlicensedSpectrumRestriction == nil || (*handoverRestrictionList.UnlicensedSpectrumRestriction) == *y.UnlicensedSpectrumRestriction) && + handoverRestrictionList.CNTypeRestrictions.Equal(y.CNTypeRestrictions) && + (handoverRestrictionList.NRrestrictionin5GS == nil) == (y.NRrestrictionin5GS == nil) && (handoverRestrictionList.NRrestrictionin5GS == nil || (*handoverRestrictionList.NRrestrictionin5GS) == *y.NRrestrictionin5GS) && + (handoverRestrictionList.LastNGRANPLMNIdentity == nil) == (y.LastNGRANPLMNIdentity == nil) && (handoverRestrictionList.LastNGRANPLMNIdentity == nil || (*handoverRestrictionList.LastNGRANPLMNIdentity) == *y.LastNGRANPLMNIdentity) && + handoverRestrictionList.RATRestrictions.Equal(y.RATRestrictions) && + handoverRestrictionList.iEExtensions == y.iEExtensions +} + +func (iMSI IMSI) Equal(y IMSI) bool { + if len(iMSI) != len(y) { + return false + } + for i := range iMSI { + if !(iMSI[i] == y[i]) { + return false + } + } + return true +} + +func (initialContextSetupFailure InitialContextSetupFailure) Equal(y InitialContextSetupFailure) bool { + return (initialContextSetupFailure.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (initialContextSetupFailure.MMEUES1APID == nil || (*initialContextSetupFailure.MMEUES1APID) == *y.MMEUES1APID) && + (initialContextSetupFailure.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (initialContextSetupFailure.ENBUES1APID == nil || (*initialContextSetupFailure.ENBUES1APID) == *y.ENBUES1APID) && + (initialContextSetupFailure.Cause == nil) == (y.Cause == nil) && (initialContextSetupFailure.Cause == nil || (*initialContextSetupFailure.Cause).Equal(*y.Cause)) && + (initialContextSetupFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (initialContextSetupFailure.CriticalityDiagnostics == nil || (*initialContextSetupFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + initialContextSetupFailure.messageMeta.Equal(y.messageMeta) +} + +func (initialContextSetupRequest InitialContextSetupRequest) Equal(y InitialContextSetupRequest) bool { + return initialContextSetupRequest.MMEUES1APID == y.MMEUES1APID && + initialContextSetupRequest.ENBUES1APID == y.ENBUES1APID && + initialContextSetupRequest.UEAggregateMaximumBitRate.Equal(y.UEAggregateMaximumBitRate) && + initialContextSetupRequest.ERABToBeSetup.Equal(y.ERABToBeSetup) && + initialContextSetupRequest.UESecurityCapabilities.Equal(y.UESecurityCapabilities) && + initialContextSetupRequest.SecurityKey == y.SecurityKey && + initialContextSetupRequest.UERadioCapability.Equal(y.UERadioCapability) && + (initialContextSetupRequest.GUMMEI == nil) == (y.GUMMEI == nil) && (initialContextSetupRequest.GUMMEI == nil || (*initialContextSetupRequest.GUMMEI).Equal(*y.GUMMEI)) && + (initialContextSetupRequest.MMEUES1APID2 == nil) == (y.MMEUES1APID2 == nil) && (initialContextSetupRequest.MMEUES1APID2 == nil || (*initialContextSetupRequest.MMEUES1APID2) == *y.MMEUES1APID2) && + (initialContextSetupRequest.CoarseUELocation == nil) == (y.CoarseUELocation == nil) && (initialContextSetupRequest.CoarseUELocation == nil || (*initialContextSetupRequest.CoarseUELocation).Equal(*y.CoarseUELocation)) && + (initialContextSetupRequest.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (initialContextSetupRequest.TimeRefDistribution == nil || (*initialContextSetupRequest.TimeRefDistribution) == *y.TimeRefDistribution) && + initialContextSetupRequest.messageMeta.Equal(y.messageMeta) +} + +func (initialContextSetupResponse InitialContextSetupResponse) Equal(y InitialContextSetupResponse) bool { + return (initialContextSetupResponse.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (initialContextSetupResponse.MMEUES1APID == nil || (*initialContextSetupResponse.MMEUES1APID) == *y.MMEUES1APID) && + (initialContextSetupResponse.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (initialContextSetupResponse.ENBUES1APID == nil || (*initialContextSetupResponse.ENBUES1APID) == *y.ENBUES1APID) && + initialContextSetupResponse.ERABSetup.Equal(y.ERABSetup) && + slices.EqualFunc(initialContextSetupResponse.ERABFailedToSetup, y.ERABFailedToSetup, ERABItem.Equal) && + (initialContextSetupResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (initialContextSetupResponse.CriticalityDiagnostics == nil || (*initialContextSetupResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + initialContextSetupResponse.messageMeta.Equal(y.messageMeta) +} + +func (initialUEMessage InitialUEMessage) Equal(y InitialUEMessage) bool { + return initialUEMessage.ENBUES1APID == y.ENBUES1APID && + initialUEMessage.NASPDU.Equal(y.NASPDU) && + initialUEMessage.TAI.Equal(y.TAI) && + (initialUEMessage.EUTRANCGI == nil) == (y.EUTRANCGI == nil) && (initialUEMessage.EUTRANCGI == nil || (*initialUEMessage.EUTRANCGI).Equal(*y.EUTRANCGI)) && + (initialUEMessage.RRCEstablishmentCause == nil) == (y.RRCEstablishmentCause == nil) && (initialUEMessage.RRCEstablishmentCause == nil || (*initialUEMessage.RRCEstablishmentCause) == *y.RRCEstablishmentCause) && + (initialUEMessage.STMSI == nil) == (y.STMSI == nil) && (initialUEMessage.STMSI == nil || (*initialUEMessage.STMSI).Equal(*y.STMSI)) && + (initialUEMessage.GUMMEI == nil) == (y.GUMMEI == nil) && (initialUEMessage.GUMMEI == nil || (*initialUEMessage.GUMMEI).Equal(*y.GUMMEI)) && + (initialUEMessage.GWTransportLayerAddress == nil) == (y.GWTransportLayerAddress == nil) && (initialUEMessage.GWTransportLayerAddress == nil || (*initialUEMessage.GWTransportLayerAddress) == *y.GWTransportLayerAddress) && + (initialUEMessage.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (initialUEMessage.TunnelInformationForBBF == nil || (*initialUEMessage.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && + (initialUEMessage.SIPTOLGWTransportLayerAddress == nil) == (y.SIPTOLGWTransportLayerAddress == nil) && (initialUEMessage.SIPTOLGWTransportLayerAddress == nil || (*initialUEMessage.SIPTOLGWTransportLayerAddress) == *y.SIPTOLGWTransportLayerAddress) && + (initialUEMessage.CoarseUELocationRequested == nil) == (y.CoarseUELocationRequested == nil) && (initialUEMessage.CoarseUELocationRequested == nil || (*initialUEMessage.CoarseUELocationRequested) == *y.CoarseUELocationRequested) && + initialUEMessage.messageMeta.Equal(y.messageMeta) +} + +func (interSystemMeasurementItem InterSystemMeasurementItem) Equal(y InterSystemMeasurementItem) bool { + return interSystemMeasurementItem.FreqBandIndicatorNR == y.FreqBandIndicatorNR && + interSystemMeasurementItem.SSBFrequencies == y.SSBFrequencies && + interSystemMeasurementItem.SubcarrierSpacingSSB == y.SubcarrierSpacingSSB && + (interSystemMeasurementItem.MaxRSIndexCellQual == nil) == (y.MaxRSIndexCellQual == nil) && (interSystemMeasurementItem.MaxRSIndexCellQual == nil || (*interSystemMeasurementItem.MaxRSIndexCellQual) == *y.MaxRSIndexCellQual) && + (interSystemMeasurementItem.SMTC == nil) == (y.SMTC == nil) && slices.Equal(interSystemMeasurementItem.SMTC, y.SMTC) && + (interSystemMeasurementItem.ThreshRSIndexR15 == nil) == (y.ThreshRSIndexR15 == nil) && slices.Equal(interSystemMeasurementItem.ThreshRSIndexR15, y.ThreshRSIndexR15) && + (interSystemMeasurementItem.SSBToMeasure == nil) == (y.SSBToMeasure == nil) && slices.Equal(interSystemMeasurementItem.SSBToMeasure, y.SSBToMeasure) && + (interSystemMeasurementItem.SSRSSIMeasurement == nil) == (y.SSRSSIMeasurement == nil) && slices.Equal(interSystemMeasurementItem.SSRSSIMeasurement, y.SSRSSIMeasurement) && + (interSystemMeasurementItem.QuantityConfigNRR15 == nil) == (y.QuantityConfigNRR15 == nil) && slices.Equal(interSystemMeasurementItem.QuantityConfigNRR15, y.QuantityConfigNRR15) && + (interSystemMeasurementItem.ExcludedCellsToAddModList == nil) == (y.ExcludedCellsToAddModList == nil) && slices.Equal(interSystemMeasurementItem.ExcludedCellsToAddModList, y.ExcludedCellsToAddModList) && + interSystemMeasurementItem.iEExtensions == y.iEExtensions +} + +func (interSystemMeasurementList InterSystemMeasurementList) Equal(y InterSystemMeasurementList) bool { + if len(interSystemMeasurementList) != len(y) { + return false + } + for i := range interSystemMeasurementList { + if !(interSystemMeasurementList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (interSystemMeasurementParameters InterSystemMeasurementParameters) Equal(y InterSystemMeasurementParameters) bool { + return interSystemMeasurementParameters.MeasurementDuration == y.MeasurementDuration && + (interSystemMeasurementParameters.InterSystemMeasurementList == nil) == (y.InterSystemMeasurementList == nil) && interSystemMeasurementParameters.InterSystemMeasurementList.Equal(y.InterSystemMeasurementList) && + interSystemMeasurementParameters.iEExtensions == y.iEExtensions && + interSystemMeasurementParameters.extensions == y.extensions +} + +func (intersystemMeasurementConfiguration IntersystemMeasurementConfiguration) Equal(y IntersystemMeasurementConfiguration) bool { + return (intersystemMeasurementConfiguration.RSRP == nil) == (y.RSRP == nil) && (intersystemMeasurementConfiguration.RSRP == nil || (*intersystemMeasurementConfiguration.RSRP) == *y.RSRP) && + (intersystemMeasurementConfiguration.RSRQ == nil) == (y.RSRQ == nil) && (intersystemMeasurementConfiguration.RSRQ == nil || (*intersystemMeasurementConfiguration.RSRQ) == *y.RSRQ) && + (intersystemMeasurementConfiguration.SINR == nil) == (y.SINR == nil) && (intersystemMeasurementConfiguration.SINR == nil || (*intersystemMeasurementConfiguration.SINR) == *y.SINR) && + intersystemMeasurementConfiguration.InterSystemMeasurementParameters.Equal(y.InterSystemMeasurementParameters) && + intersystemMeasurementConfiguration.iEExtensions == y.iEExtensions && + intersystemMeasurementConfiguration.extensions == y.extensions +} + +func (killRequest KillRequest) Equal(y KillRequest) bool { + return killRequest.MessageIdentifier == y.MessageIdentifier && + killRequest.SerialNumber == y.SerialNumber && + (killRequest.WarningAreaList == nil) == (y.WarningAreaList == nil) && (killRequest.WarningAreaList == nil || (*killRequest.WarningAreaList).Equal(*y.WarningAreaList)) && + (killRequest.KillAllWarningMessages == nil) == (y.KillAllWarningMessages == nil) && (killRequest.KillAllWarningMessages == nil || (*killRequest.KillAllWarningMessages) == *y.KillAllWarningMessages) && + killRequest.messageMeta.Equal(y.messageMeta) +} + +func (killResponse KillResponse) Equal(y KillResponse) bool { + return killResponse.MessageIdentifier == y.MessageIdentifier && + killResponse.SerialNumber == y.SerialNumber && + (killResponse.BroadcastCancelledAreaList == nil) == (y.BroadcastCancelledAreaList == nil) && (killResponse.BroadcastCancelledAreaList == nil || (*killResponse.BroadcastCancelledAreaList).Equal(*y.BroadcastCancelledAreaList)) && + (killResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (killResponse.CriticalityDiagnostics == nil || (*killResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + killResponse.messageMeta.Equal(y.messageMeta) +} + +func (lAI LAI) Equal(y LAI) bool { + return lAI == y +} + +func (lPPaPDU LPPaPDU) Equal(y LPPaPDU) bool { + if len(lPPaPDU) != len(y) { + return false + } + for i := range lPPaPDU { + if !(lPPaPDU[i] == y[i]) { + return false + } + } + return true +} + +func (lTENTNTAIInformation LTENTNTAIInformation) Equal(y LTENTNTAIInformation) bool { + return lTENTNTAIInformation.ServingPLMN == y.ServingPLMN && + slices.Equal(lTENTNTAIInformation.TACListInLTENTN, y.TACListInLTENTN) && + (lTENTNTAIInformation.UELocationDerivedTAC == nil) == (y.UELocationDerivedTAC == nil) && (lTENTNTAIInformation.UELocationDerivedTAC == nil || (*lTENTNTAIInformation.UELocationDerivedTAC) == *y.UELocationDerivedTAC) && + lTENTNTAIInformation.iEExtensions == y.iEExtensions && + lTENTNTAIInformation.extensions == y.extensions +} + +func (lastVisitedCellItem LastVisitedCellItem) Equal(y LastVisitedCellItem) bool { + return (lastVisitedCellItem.EUTRANCell == nil) == (y.EUTRANCell == nil) && (lastVisitedCellItem.EUTRANCell == nil || (*lastVisitedCellItem.EUTRANCell).Equal(*y.EUTRANCell)) && + (lastVisitedCellItem.UTRANCell == nil) == (y.UTRANCell == nil) && (lastVisitedCellItem.UTRANCell == nil || (*lastVisitedCellItem.UTRANCell).Equal(*y.UTRANCell)) && + (lastVisitedCellItem.GERANCell == nil) == (y.GERANCell == nil) && (lastVisitedCellItem.GERANCell == nil || (*lastVisitedCellItem.GERANCell).Equal(*y.GERANCell)) && + (lastVisitedCellItem.NGRANCell == nil) == (y.NGRANCell == nil) && (lastVisitedCellItem.NGRANCell == nil || (*lastVisitedCellItem.NGRANCell).Equal(*y.NGRANCell)) && + (lastVisitedCellItem.Ext == nil) == (y.Ext == nil) && (lastVisitedCellItem.Ext == nil || (*lastVisitedCellItem.Ext) == *y.Ext) +} + +func (lastVisitedEUTRANCellInformation LastVisitedEUTRANCellInformation) Equal(y LastVisitedEUTRANCellInformation) bool { + return lastVisitedEUTRANCellInformation.GlobalCellID.Equal(y.GlobalCellID) && + lastVisitedEUTRANCellInformation.CellType.Equal(y.CellType) && + lastVisitedEUTRANCellInformation.TimeUEStayedInCell == y.TimeUEStayedInCell && + (lastVisitedEUTRANCellInformation.TimeUEStayedInCellEnhancedGranularity == nil) == (y.TimeUEStayedInCellEnhancedGranularity == nil) && (lastVisitedEUTRANCellInformation.TimeUEStayedInCellEnhancedGranularity == nil || (*lastVisitedEUTRANCellInformation.TimeUEStayedInCellEnhancedGranularity) == *y.TimeUEStayedInCellEnhancedGranularity) && + (lastVisitedEUTRANCellInformation.HOCause == nil) == (y.HOCause == nil) && (lastVisitedEUTRANCellInformation.HOCause == nil || (*lastVisitedEUTRANCellInformation.HOCause).Equal(*y.HOCause)) && + lastVisitedEUTRANCellInformation.LastVisitedPSCellList.Equal(y.LastVisitedPSCellList) && + lastVisitedEUTRANCellInformation.iEExtensions == y.iEExtensions && + lastVisitedEUTRANCellInformation.extensions == y.extensions +} + +func (lastVisitedGERANCellInformation LastVisitedGERANCellInformation) Equal(y LastVisitedGERANCellInformation) bool { + return (lastVisitedGERANCellInformation.Undefined == nil) == (y.Undefined == nil) && (lastVisitedGERANCellInformation.Undefined == nil || (*lastVisitedGERANCellInformation.Undefined) == *y.Undefined) && + (lastVisitedGERANCellInformation.Ext == nil) == (y.Ext == nil) && (lastVisitedGERANCellInformation.Ext == nil || (*lastVisitedGERANCellInformation.Ext) == *y.Ext) +} + +func (lastVisitedNGRANCellInformation LastVisitedNGRANCellInformation) Equal(y LastVisitedNGRANCellInformation) bool { + if len(lastVisitedNGRANCellInformation) != len(y) { + return false + } + for i := range lastVisitedNGRANCellInformation { + if !(lastVisitedNGRANCellInformation[i] == y[i]) { + return false + } + } + return true +} + +func (lastVisitedPSCellInformation LastVisitedPSCellInformation) Equal(y LastVisitedPSCellInformation) bool { + return (lastVisitedPSCellInformation.PSCellID == nil) == (y.PSCellID == nil) && (lastVisitedPSCellInformation.PSCellID == nil || (*lastVisitedPSCellInformation.PSCellID).Equal(*y.PSCellID)) && + lastVisitedPSCellInformation.TimeStay == y.TimeStay && + lastVisitedPSCellInformation.iEExtensions == y.iEExtensions && + lastVisitedPSCellInformation.extensions == y.extensions +} + +func (lastVisitedPSCellList LastVisitedPSCellList) Equal(y LastVisitedPSCellList) bool { + if len(lastVisitedPSCellList) != len(y) { + return false + } + for i := range lastVisitedPSCellList { + if !(lastVisitedPSCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (lastVisitedUTRANCellInformation LastVisitedUTRANCellInformation) Equal(y LastVisitedUTRANCellInformation) bool { + if len(lastVisitedUTRANCellInformation) != len(y) { + return false + } + for i := range lastVisitedUTRANCellInformation { + if !(lastVisitedUTRANCellInformation[i] == y[i]) { + return false + } + } + return true +} + +func (listeningSubframePattern ListeningSubframePattern) Equal(y ListeningSubframePattern) bool { + return listeningSubframePattern == y +} + +func (locationReport LocationReport) Equal(y LocationReport) bool { + return locationReport.MMEUES1APID == y.MMEUES1APID && + locationReport.ENBUES1APID == y.ENBUES1APID && + (locationReport.EUTRANCGI == nil) == (y.EUTRANCGI == nil) && (locationReport.EUTRANCGI == nil || (*locationReport.EUTRANCGI).Equal(*y.EUTRANCGI)) && + (locationReport.TAI == nil) == (y.TAI == nil) && (locationReport.TAI == nil || (*locationReport.TAI).Equal(*y.TAI)) && + (locationReport.RequestType == nil) == (y.RequestType == nil) && (locationReport.RequestType == nil || (*locationReport.RequestType).Equal(*y.RequestType)) && + locationReport.messageMeta.Equal(y.messageMeta) +} + +func (mDTConfigurationNR MDTConfigurationNR) Equal(y MDTConfigurationNR) bool { + if len(mDTConfigurationNR) != len(y) { + return false + } + for i := range mDTConfigurationNR { + if !(mDTConfigurationNR[i] == y[i]) { + return false + } + } + return true +} + +func (mMEConfigurationTransfer MMEConfigurationTransfer) Equal(y MMEConfigurationTransfer) bool { + return (mMEConfigurationTransfer.SONConfigurationTransfer == nil) == (y.SONConfigurationTransfer == nil) && (mMEConfigurationTransfer.SONConfigurationTransfer == nil || (*mMEConfigurationTransfer.SONConfigurationTransfer).Equal(*y.SONConfigurationTransfer)) && + mMEConfigurationTransfer.messageMeta.Equal(y.messageMeta) +} + +func (mMEConfigurationUpdate MMEConfigurationUpdate) Equal(y MMEConfigurationUpdate) bool { + return (mMEConfigurationUpdate.MMEName == nil) == (y.MMEName == nil) && (mMEConfigurationUpdate.MMEName == nil || (*mMEConfigurationUpdate.MMEName) == *y.MMEName) && + mMEConfigurationUpdate.ServedGUMMEIs.Equal(y.ServedGUMMEIs) && + (mMEConfigurationUpdate.RelativeMMECapacity == nil) == (y.RelativeMMECapacity == nil) && (mMEConfigurationUpdate.RelativeMMECapacity == nil || (*mMEConfigurationUpdate.RelativeMMECapacity) == *y.RelativeMMECapacity) && + mMEConfigurationUpdate.messageMeta.Equal(y.messageMeta) +} + +func (mMEConfigurationUpdateAcknowledge MMEConfigurationUpdateAcknowledge) Equal(y MMEConfigurationUpdateAcknowledge) bool { + return (mMEConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (mMEConfigurationUpdateAcknowledge.CriticalityDiagnostics == nil || (*mMEConfigurationUpdateAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + mMEConfigurationUpdateAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (mMEConfigurationUpdateFailure MMEConfigurationUpdateFailure) Equal(y MMEConfigurationUpdateFailure) bool { + return (mMEConfigurationUpdateFailure.Cause == nil) == (y.Cause == nil) && (mMEConfigurationUpdateFailure.Cause == nil || (*mMEConfigurationUpdateFailure.Cause).Equal(*y.Cause)) && + (mMEConfigurationUpdateFailure.TimeToWait == nil) == (y.TimeToWait == nil) && (mMEConfigurationUpdateFailure.TimeToWait == nil || (*mMEConfigurationUpdateFailure.TimeToWait) == *y.TimeToWait) && + (mMEConfigurationUpdateFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (mMEConfigurationUpdateFailure.CriticalityDiagnostics == nil || (*mMEConfigurationUpdateFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + mMEConfigurationUpdateFailure.messageMeta.Equal(y.messageMeta) +} + +func (mMEStatusTransfer MMEStatusTransfer) Equal(y MMEStatusTransfer) bool { + return mMEStatusTransfer.MMEUES1APID == y.MMEUES1APID && + mMEStatusTransfer.ENBUES1APID == y.ENBUES1APID && + mMEStatusTransfer.Container.Equal(y.Container) && + mMEStatusTransfer.messageMeta.Equal(y.messageMeta) +} + +func (mutingPatternInformation MutingPatternInformation) Equal(y MutingPatternInformation) bool { + return mutingPatternInformation.MutingPatternPeriod == y.MutingPatternPeriod && + (mutingPatternInformation.MutingPatternOffset == nil) == (y.MutingPatternOffset == nil) && (mutingPatternInformation.MutingPatternOffset == nil || (*mutingPatternInformation.MutingPatternOffset) == *y.MutingPatternOffset) && + mutingPatternInformation.iEExtensions == y.iEExtensions && + mutingPatternInformation.extensions == y.extensions +} + +func (nASNonDeliveryIndication NASNonDeliveryIndication) Equal(y NASNonDeliveryIndication) bool { + return nASNonDeliveryIndication.MMEUES1APID == y.MMEUES1APID && + nASNonDeliveryIndication.ENBUES1APID == y.ENBUES1APID && + nASNonDeliveryIndication.NASPDU.Equal(y.NASPDU) && + (nASNonDeliveryIndication.Cause == nil) == (y.Cause == nil) && (nASNonDeliveryIndication.Cause == nil || (*nASNonDeliveryIndication.Cause).Equal(*y.Cause)) && + nASNonDeliveryIndication.messageMeta.Equal(y.messageMeta) +} + +func (nASPDU NASPDU) Equal(y NASPDU) bool { + if len(nASPDU) != len(y) { + return false + } + for i := range nASPDU { + if !(nASPDU[i] == y[i]) { + return false + } + } + return true +} + +func (nASSecurityParametersfromEUTRAN NASSecurityParametersfromEUTRAN) Equal(y NASSecurityParametersfromEUTRAN) bool { + if len(nASSecurityParametersfromEUTRAN) != len(y) { + return false + } + for i := range nASSecurityParametersfromEUTRAN { + if !(nASSecurityParametersfromEUTRAN[i] == y[i]) { + return false + } + } + return true +} + +func (nASSecurityParameterstoEUTRAN NASSecurityParameterstoEUTRAN) Equal(y NASSecurityParameterstoEUTRAN) bool { + if len(nASSecurityParameterstoEUTRAN) != len(y) { + return false + } + for i := range nASSecurityParameterstoEUTRAN { + if !(nASSecurityParameterstoEUTRAN[i] == y[i]) { + return false + } + } + return true +} + +func (nRCGI NRCGI) Equal(y NRCGI) bool { + return nRCGI == y +} + +func (ngENB NgENB) Equal(y NgENB) bool { + return ngENB.extensions == y.extensions && + ngENB.GlobalNgENBID.Equal(y.GlobalNgENBID) && + ngENB.iEExtensions == y.iEExtensions +} + +func (overloadResponse OverloadResponse) Equal(y OverloadResponse) bool { + return (overloadResponse.OverloadAction == nil) == (y.OverloadAction == nil) && (overloadResponse.OverloadAction == nil || (*overloadResponse.OverloadAction) == *y.OverloadAction) && + (overloadResponse.Ext == nil) == (y.Ext == nil) && (overloadResponse.Ext == nil || (*overloadResponse.Ext) == *y.Ext) +} + +func (overloadStart OverloadStart) Equal(y OverloadStart) bool { + return overloadStart.OverloadResponse.Equal(y.OverloadResponse) && + slices.Equal(overloadStart.GUMMEIList, y.GUMMEIList) && + (overloadStart.TrafficLoadReductionIndication == nil) == (y.TrafficLoadReductionIndication == nil) && (overloadStart.TrafficLoadReductionIndication == nil || (*overloadStart.TrafficLoadReductionIndication) == *y.TrafficLoadReductionIndication) && + overloadStart.messageMeta.Equal(y.messageMeta) +} + +func (overloadStop OverloadStop) Equal(y OverloadStop) bool { + return slices.Equal(overloadStop.GUMMEIList, y.GUMMEIList) && + overloadStop.messageMeta.Equal(y.messageMeta) +} + +func (pSCellInformation PSCellInformation) Equal(y PSCellInformation) bool { + return pSCellInformation == y +} + +func (pWSFailureIndication PWSFailureIndication) Equal(y PWSFailureIndication) bool { + return slices.Equal(pWSFailureIndication.PWSFailedECGIList, y.PWSFailedECGIList) && + pWSFailureIndication.GlobalENBID.Equal(y.GlobalENBID) && + pWSFailureIndication.messageMeta.Equal(y.messageMeta) +} + +func (pWSRestartIndication PWSRestartIndication) Equal(y PWSRestartIndication) bool { + return slices.Equal(pWSRestartIndication.ECGIListForRestart, y.ECGIListForRestart) && + pWSRestartIndication.GlobalENBID.Equal(y.GlobalENBID) && + slices.Equal(pWSRestartIndication.TAIListForRestart, y.TAIListForRestart) && + slices.Equal(pWSRestartIndication.EmergencyAreaIDListForRestart, y.EmergencyAreaIDListForRestart) && + pWSRestartIndication.messageMeta.Equal(y.messageMeta) +} + +func (paging Paging) Equal(y Paging) bool { + return (paging.UEIdentityIndexValue == nil) == (y.UEIdentityIndexValue == nil) && (paging.UEIdentityIndexValue == nil || (*paging.UEIdentityIndexValue) == *y.UEIdentityIndexValue) && + (paging.UEPagingID == nil) == (y.UEPagingID == nil) && (paging.UEPagingID == nil || (*paging.UEPagingID).Equal(*y.UEPagingID)) && + (paging.PagingDRX == nil) == (y.PagingDRX == nil) && (paging.PagingDRX == nil || (*paging.PagingDRX) == *y.PagingDRX) && + (paging.CNDomain == nil) == (y.CNDomain == nil) && (paging.CNDomain == nil || (*paging.CNDomain) == *y.CNDomain) && + paging.TAIList.Equal(y.TAIList) && + (paging.PagingPriority == nil) == (y.PagingPriority == nil) && (paging.PagingPriority == nil || (*paging.PagingPriority) == *y.PagingPriority) && + slices.Equal(paging.UERadioCapabilityForPaging, y.UERadioCapabilityForPaging) && + paging.messageMeta.Equal(y.messageMeta) +} + +func (pathSwitchRequest PathSwitchRequest) Equal(y PathSwitchRequest) bool { + return pathSwitchRequest.ENBUES1APID == y.ENBUES1APID && + pathSwitchRequest.ERABToBeSwitchedDL.Equal(y.ERABToBeSwitchedDL) && + pathSwitchRequest.SourceMMEUES1APID == y.SourceMMEUES1APID && + (pathSwitchRequest.EUTRANCGI == nil) == (y.EUTRANCGI == nil) && (pathSwitchRequest.EUTRANCGI == nil || (*pathSwitchRequest.EUTRANCGI).Equal(*y.EUTRANCGI)) && + (pathSwitchRequest.TAI == nil) == (y.TAI == nil) && (pathSwitchRequest.TAI == nil || (*pathSwitchRequest.TAI).Equal(*y.TAI)) && + (pathSwitchRequest.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (pathSwitchRequest.UESecurityCapabilities == nil || (*pathSwitchRequest.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && + (pathSwitchRequest.SourceMMEGUMMEI == nil) == (y.SourceMMEGUMMEI == nil) && (pathSwitchRequest.SourceMMEGUMMEI == nil || (*pathSwitchRequest.SourceMMEGUMMEI).Equal(*y.SourceMMEGUMMEI)) && + (pathSwitchRequest.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (pathSwitchRequest.TunnelInformationForBBF == nil || (*pathSwitchRequest.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && + pathSwitchRequest.messageMeta.Equal(y.messageMeta) +} + +func (pathSwitchRequestAcknowledge PathSwitchRequestAcknowledge) Equal(y PathSwitchRequestAcknowledge) bool { + return (pathSwitchRequestAcknowledge.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (pathSwitchRequestAcknowledge.MMEUES1APID == nil || (*pathSwitchRequestAcknowledge.MMEUES1APID) == *y.MMEUES1APID) && + (pathSwitchRequestAcknowledge.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (pathSwitchRequestAcknowledge.ENBUES1APID == nil || (*pathSwitchRequestAcknowledge.ENBUES1APID) == *y.ENBUES1APID) && + (pathSwitchRequestAcknowledge.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (pathSwitchRequestAcknowledge.UEAggregateMaximumBitRate == nil || (*pathSwitchRequestAcknowledge.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + pathSwitchRequestAcknowledge.ERABToBeSwitchedUL.Equal(y.ERABToBeSwitchedUL) && + pathSwitchRequestAcknowledge.SecurityContext.Equal(y.SecurityContext) && + (pathSwitchRequestAcknowledge.MMEUES1APID2 == nil) == (y.MMEUES1APID2 == nil) && (pathSwitchRequestAcknowledge.MMEUES1APID2 == nil || (*pathSwitchRequestAcknowledge.MMEUES1APID2) == *y.MMEUES1APID2) && + (pathSwitchRequestAcknowledge.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (pathSwitchRequestAcknowledge.UESecurityCapabilities == nil || (*pathSwitchRequestAcknowledge.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && + slices.EqualFunc(pathSwitchRequestAcknowledge.ERABToBeReleased, y.ERABToBeReleased, ERABItem.Equal) && + (pathSwitchRequestAcknowledge.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (pathSwitchRequestAcknowledge.TimeRefDistribution == nil || (*pathSwitchRequestAcknowledge.TimeRefDistribution) == *y.TimeRefDistribution) && + pathSwitchRequestAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (pathSwitchRequestFailure PathSwitchRequestFailure) Equal(y PathSwitchRequestFailure) bool { + return (pathSwitchRequestFailure.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (pathSwitchRequestFailure.MMEUES1APID == nil || (*pathSwitchRequestFailure.MMEUES1APID) == *y.MMEUES1APID) && + (pathSwitchRequestFailure.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (pathSwitchRequestFailure.ENBUES1APID == nil || (*pathSwitchRequestFailure.ENBUES1APID) == *y.ENBUES1APID) && + (pathSwitchRequestFailure.Cause == nil) == (y.Cause == nil) && (pathSwitchRequestFailure.Cause == nil || (*pathSwitchRequestFailure.Cause).Equal(*y.Cause)) && + (pathSwitchRequestFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pathSwitchRequestFailure.CriticalityDiagnostics == nil || (*pathSwitchRequestFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + pathSwitchRequestFailure.messageMeta.Equal(y.messageMeta) +} + +func (rATRestrictionInformation RATRestrictionInformation) Equal(y RATRestrictionInformation) bool { + return rATRestrictionInformation == y +} + +func (rATRestrictions RATRestrictions) Equal(y RATRestrictions) bool { + if len(rATRestrictions) != len(y) { + return false + } + for i := range rATRestrictions { + if !(rATRestrictions[i].Equal(y[i])) { + return false + } + } + return true +} + +func (rATRestrictionsItem RATRestrictionsItem) Equal(y RATRestrictionsItem) bool { + return rATRestrictionsItem == y +} + +func (rLFReportContainer RLFReportContainer) Equal(y RLFReportContainer) bool { + if len(rLFReportContainer) != len(y) { + return false + } + for i := range rLFReportContainer { + if !(rLFReportContainer[i] == y[i]) { + return false + } + } + return true +} + +func (rLFReportInformation RLFReportInformation) Equal(y RLFReportInformation) bool { + return rLFReportInformation.UERLFReportContainer.Equal(y.UERLFReportContainer) && + (rLFReportInformation.UERLFReportContainerForExtendedBands == nil) == (y.UERLFReportContainerForExtendedBands == nil) && (rLFReportInformation.UERLFReportContainerForExtendedBands == nil || (*rLFReportInformation.UERLFReportContainerForExtendedBands).Equal(*y.UERLFReportContainerForExtendedBands)) && + (rLFReportInformation.NBIoTRLFReportContainer == nil) == (y.NBIoTRLFReportContainer == nil) && (rLFReportInformation.NBIoTRLFReportContainer == nil || (*rLFReportInformation.NBIoTRLFReportContainer).Equal(*y.NBIoTRLFReportContainer)) && + rLFReportInformation.iEExtensions == y.iEExtensions && + rLFReportInformation.extensions == y.extensions +} + +func (rRCContainer RRCContainer) Equal(y RRCContainer) bool { + if len(rRCContainer) != len(y) { + return false + } + for i := range rRCContainer { + if !(rRCContainer[i] == y[i]) { + return false + } + } + return true +} + +func (requestType RequestType) Equal(y RequestType) bool { + return requestType.extensions == y.extensions && + requestType.EventType == y.EventType && + requestType.ReportArea == y.ReportArea && + (requestType.RequestTypeAdditionalInfo == nil) == (y.RequestTypeAdditionalInfo == nil) && (requestType.RequestTypeAdditionalInfo == nil || (*requestType.RequestTypeAdditionalInfo) == *y.RequestTypeAdditionalInfo) && + requestType.iEExtensions == y.iEExtensions +} + +func (requestedTNLInfo RequestedTNLInfo) Equal(y RequestedTNLInfo) bool { + return requestedTNLInfo == y +} + +func (rerouteNASRequest RerouteNASRequest) Equal(y RerouteNASRequest) bool { + return rerouteNASRequest.ENBUES1APID == y.ENBUES1APID && + (rerouteNASRequest.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (rerouteNASRequest.MMEUES1APID == nil || (*rerouteNASRequest.MMEUES1APID) == *y.MMEUES1APID) && + rerouteNASRequest.S1Message.Equal(y.S1Message) && + rerouteNASRequest.MMEGroupID == y.MMEGroupID && + (rerouteNASRequest.AdditionalGUTI == nil) == (y.AdditionalGUTI == nil) && (rerouteNASRequest.AdditionalGUTI == nil || (*rerouteNASRequest.AdditionalGUTI).Equal(*y.AdditionalGUTI)) && + (rerouteNASRequest.UEUsageType == nil) == (y.UEUsageType == nil) && (rerouteNASRequest.UEUsageType == nil || (*rerouteNASRequest.UEUsageType) == *y.UEUsageType) && + rerouteNASRequest.messageMeta.Equal(y.messageMeta) +} + +func (reset Reset) Equal(y Reset) bool { + return (reset.Cause == nil) == (y.Cause == nil) && (reset.Cause == nil || (*reset.Cause).Equal(*y.Cause)) && + reset.ResetType.Equal(y.ResetType) && + reset.messageMeta.Equal(y.messageMeta) +} + +func (resetAcknowledge ResetAcknowledge) Equal(y ResetAcknowledge) bool { + return slices.EqualFunc(resetAcknowledge.ConnectionList, y.ConnectionList, UEAssociatedLogicalS1ConnectionItem.Equal) && + (resetAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (resetAcknowledge.CriticalityDiagnostics == nil || (*resetAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + resetAcknowledge.messageMeta.Equal(y.messageMeta) +} + +func (resetType ResetType) Equal(y ResetType) bool { + return (resetType.S1Interface == nil) == (y.S1Interface == nil) && (resetType.S1Interface == nil || (*resetType.S1Interface) == *y.S1Interface) && + (resetType.PartOfS1Interface == nil) == (y.PartOfS1Interface == nil) && (resetType.PartOfS1Interface == nil || (*resetType.PartOfS1Interface).Equal(*y.PartOfS1Interface)) && + (resetType.Ext == nil) == (y.Ext == nil) && (resetType.Ext == nil || (*resetType.Ext) == *y.Ext) +} + +func (s1Message S1Message) Equal(y S1Message) bool { + if len(s1Message) != len(y) { + return false + } + for i := range s1Message { + if !(s1Message[i] == y[i]) { + return false + } + } + return true +} + +func (s1RemovalFailure S1RemovalFailure) Equal(y S1RemovalFailure) bool { + return (s1RemovalFailure.Cause == nil) == (y.Cause == nil) && (s1RemovalFailure.Cause == nil || (*s1RemovalFailure.Cause).Equal(*y.Cause)) && + (s1RemovalFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (s1RemovalFailure.CriticalityDiagnostics == nil || (*s1RemovalFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + s1RemovalFailure.messageMeta.Equal(y.messageMeta) +} + +func (s1RemovalRequest S1RemovalRequest) Equal(y S1RemovalRequest) bool { + return s1RemovalRequest.GlobalENBID.Equal(y.GlobalENBID) && + s1RemovalRequest.messageMeta.Equal(y.messageMeta) +} + +func (s1RemovalResponse S1RemovalResponse) Equal(y S1RemovalResponse) bool { + return (s1RemovalResponse.MMEName == nil) == (y.MMEName == nil) && (s1RemovalResponse.MMEName == nil || (*s1RemovalResponse.MMEName) == *y.MMEName) && + (s1RemovalResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (s1RemovalResponse.CriticalityDiagnostics == nil || (*s1RemovalResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + s1RemovalResponse.messageMeta.Equal(y.messageMeta) +} + +func (s1SetupFailure S1SetupFailure) Equal(y S1SetupFailure) bool { + return (s1SetupFailure.Cause == nil) == (y.Cause == nil) && (s1SetupFailure.Cause == nil || (*s1SetupFailure.Cause).Equal(*y.Cause)) && + (s1SetupFailure.TimeToWait == nil) == (y.TimeToWait == nil) && (s1SetupFailure.TimeToWait == nil || (*s1SetupFailure.TimeToWait) == *y.TimeToWait) && + (s1SetupFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (s1SetupFailure.CriticalityDiagnostics == nil || (*s1SetupFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + s1SetupFailure.messageMeta.Equal(y.messageMeta) +} + +func (s1SetupRequest S1SetupRequest) Equal(y S1SetupRequest) bool { + return s1SetupRequest.GlobalENBID.Equal(y.GlobalENBID) && + (s1SetupRequest.ENBName == nil) == (y.ENBName == nil) && (s1SetupRequest.ENBName == nil || (*s1SetupRequest.ENBName) == *y.ENBName) && + s1SetupRequest.SupportedTAs.Equal(y.SupportedTAs) && + (s1SetupRequest.DefaultPagingDRX == nil) == (y.DefaultPagingDRX == nil) && (s1SetupRequest.DefaultPagingDRX == nil || (*s1SetupRequest.DefaultPagingDRX) == *y.DefaultPagingDRX) && + (s1SetupRequest.UERetentionInformation == nil) == (y.UERetentionInformation == nil) && (s1SetupRequest.UERetentionInformation == nil || (*s1SetupRequest.UERetentionInformation) == *y.UERetentionInformation) && + s1SetupRequest.messageMeta.Equal(y.messageMeta) +} + +func (s1SetupResponse S1SetupResponse) Equal(y S1SetupResponse) bool { + return (s1SetupResponse.MMEName == nil) == (y.MMEName == nil) && (s1SetupResponse.MMEName == nil || (*s1SetupResponse.MMEName) == *y.MMEName) && + s1SetupResponse.ServedGUMMEIs.Equal(y.ServedGUMMEIs) && + (s1SetupResponse.RelativeMMECapacity == nil) == (y.RelativeMMECapacity == nil) && (s1SetupResponse.RelativeMMECapacity == nil || (*s1SetupResponse.RelativeMMECapacity) == *y.RelativeMMECapacity) && + (s1SetupResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (s1SetupResponse.CriticalityDiagnostics == nil || (*s1SetupResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (s1SetupResponse.UERetentionInformation == nil) == (y.UERetentionInformation == nil) && (s1SetupResponse.UERetentionInformation == nil || (*s1SetupResponse.UERetentionInformation) == *y.UERetentionInformation) && + s1SetupResponse.messageMeta.Equal(y.messageMeta) +} + +func (sONConfigurationTransfer SONConfigurationTransfer) Equal(y SONConfigurationTransfer) bool { + return sONConfigurationTransfer.TargeteNBID.Equal(y.TargeteNBID) && + sONConfigurationTransfer.SourceeNBID.Equal(y.SourceeNBID) && + sONConfigurationTransfer.SONInformation.Equal(y.SONInformation) && + (sONConfigurationTransfer.X2TNLConfigurationInfo == nil) == (y.X2TNLConfigurationInfo == nil) && (sONConfigurationTransfer.X2TNLConfigurationInfo == nil || (*sONConfigurationTransfer.X2TNLConfigurationInfo).Equal(*y.X2TNLConfigurationInfo)) && + (sONConfigurationTransfer.SynchronisationInformation == nil) == (y.SynchronisationInformation == nil) && (sONConfigurationTransfer.SynchronisationInformation == nil || (*sONConfigurationTransfer.SynchronisationInformation).Equal(*y.SynchronisationInformation)) && + (sONConfigurationTransfer.RequestedTNLInfo == nil) == (y.RequestedTNLInfo == nil) && (sONConfigurationTransfer.RequestedTNLInfo == nil || (*sONConfigurationTransfer.RequestedTNLInfo).Equal(*y.RequestedTNLInfo)) && + sONConfigurationTransfer.iEExtensions == y.iEExtensions && + sONConfigurationTransfer.extensions == y.extensions +} + +func (sONInformation SONInformation) Equal(y SONInformation) bool { + return (sONInformation.SONInformationRequest == nil) == (y.SONInformationRequest == nil) && (sONInformation.SONInformationRequest == nil || (*sONInformation.SONInformationRequest) == *y.SONInformationRequest) && + (sONInformation.SONInformationReply == nil) == (y.SONInformationReply == nil) && (sONInformation.SONInformationReply == nil || (*sONInformation.SONInformationReply).Equal(*y.SONInformationReply)) && + (sONInformation.SONInformationExtension == nil) == (y.SONInformationExtension == nil) && (sONInformation.SONInformationExtension == nil || (*sONInformation.SONInformationExtension).Equal(*y.SONInformationExtension)) && + (sONInformation.Ext == nil) == (y.Ext == nil) && (sONInformation.Ext == nil || (*sONInformation.Ext) == *y.Ext) +} + +func (sONInformationExtension SONInformationExtension) Equal(y SONInformationExtension) bool { + return (sONInformationExtension.SONInformationReport == nil) == (y.SONInformationReport == nil) && (sONInformationExtension.SONInformationReport == nil || (*sONInformationExtension.SONInformationReport).Equal(*y.SONInformationReport)) && + (sONInformationExtension.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (sONInformationExtension.ChoiceExtension == nil || (*sONInformationExtension.ChoiceExtension) == *y.ChoiceExtension) && + sONInformationExtension.choiceCriticality == y.choiceCriticality +} + +func (sONInformationReply SONInformationReply) Equal(y SONInformationReply) bool { + return (sONInformationReply.X2TNLConfigurationInfo == nil) == (y.X2TNLConfigurationInfo == nil) && (sONInformationReply.X2TNLConfigurationInfo == nil || (*sONInformationReply.X2TNLConfigurationInfo).Equal(*y.X2TNLConfigurationInfo)) && + (sONInformationReply.TimeSynchronisationInfo == nil) == (y.TimeSynchronisationInfo == nil) && (sONInformationReply.TimeSynchronisationInfo == nil || (*sONInformationReply.TimeSynchronisationInfo).Equal(*y.TimeSynchronisationInfo)) && + (sONInformationReply.MutingPatternInformation == nil) == (y.MutingPatternInformation == nil) && (sONInformationReply.MutingPatternInformation == nil || (*sONInformationReply.MutingPatternInformation).Equal(*y.MutingPatternInformation)) && + sONInformationReply.iEExtensions == y.iEExtensions && + sONInformationReply.extensions == y.extensions +} + +func (sONInformationReport SONInformationReport) Equal(y SONInformationReport) bool { + return (sONInformationReport.RLFReportInformation == nil) == (y.RLFReportInformation == nil) && (sONInformationReport.RLFReportInformation == nil || (*sONInformationReport.RLFReportInformation).Equal(*y.RLFReportInformation)) && + (sONInformationReport.Ext == nil) == (y.Ext == nil) && (sONInformationReport.Ext == nil || (*sONInformationReport.Ext) == *y.Ext) +} + +func (sTMSI STMSI) Equal(y STMSI) bool { + return sTMSI == y +} + +func (securityAlgorithms SecurityAlgorithms) Equal(y SecurityAlgorithms) bool { + return securityAlgorithms == y +} + +func (securityContext SecurityContext) Equal(y SecurityContext) bool { + return securityContext == y +} + +func (securityIndication SecurityIndication) Equal(y SecurityIndication) bool { + return securityIndication == y +} + +func (servedGUMMEIs ServedGUMMEIs) Equal(y ServedGUMMEIs) bool { + if len(servedGUMMEIs) != len(y) { + return false + } + for i := range servedGUMMEIs { + if !(servedGUMMEIs[i].Equal(y[i])) { + return false + } + } + return true +} + +func (servedGUMMEIsItem ServedGUMMEIsItem) Equal(y ServedGUMMEIsItem) bool { + return servedGUMMEIsItem.extensions == y.extensions && + slices.Equal(servedGUMMEIsItem.ServedPLMNs, y.ServedPLMNs) && + slices.Equal(servedGUMMEIsItem.ServedGroupIDs, y.ServedGroupIDs) && + slices.Equal(servedGUMMEIsItem.ServedMMECs, y.ServedMMECs) && + (servedGUMMEIsItem.GUMMEIType == nil) == (y.GUMMEIType == nil) && (servedGUMMEIsItem.GUMMEIType == nil || (*servedGUMMEIsItem.GUMMEIType) == *y.GUMMEIType) && + servedGUMMEIsItem.iEExtensions == y.iEExtensions +} + +func (sourceNgRanNodeID SourceNgRanNodeID) Equal(y SourceNgRanNodeID) bool { + return sourceNgRanNodeID.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + sourceNgRanNodeID.SelectedTAI.Equal(y.SelectedTAI) && + sourceNgRanNodeID.iEExtensions == y.iEExtensions && + sourceNgRanNodeID.extensions == y.extensions +} + +func (sourceNodeID SourceNodeID) Equal(y SourceNodeID) bool { + return (sourceNodeID.SourceNgRanNodeID == nil) == (y.SourceNgRanNodeID == nil) && (sourceNodeID.SourceNgRanNodeID == nil || (*sourceNodeID.SourceNgRanNodeID).Equal(*y.SourceNgRanNodeID)) && + (sourceNodeID.ChoiceExtension == nil) == (y.ChoiceExtension == nil) && (sourceNodeID.ChoiceExtension == nil || (*sourceNodeID.ChoiceExtension) == *y.ChoiceExtension) +} + +func (sourceeNBID SourceeNBID) Equal(y SourceeNBID) bool { + return sourceeNBID.GlobalENBID.Equal(y.GlobalENBID) && + sourceeNBID.SelectedTAI.Equal(y.SelectedTAI) && + sourceeNBID.iEExtensions == y.iEExtensions +} + +func (sourceeNBToTargeteNBTransparentContainer SourceeNBToTargeteNBTransparentContainer) Equal(y SourceeNBToTargeteNBTransparentContainer) bool { + return sourceeNBToTargeteNBTransparentContainer.RRCContainer.Equal(y.RRCContainer) && + (sourceeNBToTargeteNBTransparentContainer.ERABInformationList == nil) == (y.ERABInformationList == nil) && sourceeNBToTargeteNBTransparentContainer.ERABInformationList.Equal(y.ERABInformationList) && + sourceeNBToTargeteNBTransparentContainer.TargetCellID.Equal(y.TargetCellID) && + (sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP == nil) == (y.SubscriberProfileIDforRFP == nil) && (sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP == nil || (*sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP) == *y.SubscriberProfileIDforRFP) && + sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation.Equal(y.UEHistoryInformation) && + (sourceeNBToTargeteNBTransparentContainer.MobilityInformation == nil) == (y.MobilityInformation == nil) && (sourceeNBToTargeteNBTransparentContainer.MobilityInformation == nil || (*sourceeNBToTargeteNBTransparentContainer.MobilityInformation) == *y.MobilityInformation) && + (sourceeNBToTargeteNBTransparentContainer.UEHistoryInformationFromTheUE == nil) == (y.UEHistoryInformationFromTheUE == nil) && (sourceeNBToTargeteNBTransparentContainer.UEHistoryInformationFromTheUE == nil || (*sourceeNBToTargeteNBTransparentContainer.UEHistoryInformationFromTheUE).Equal(*y.UEHistoryInformationFromTheUE)) && + (sourceeNBToTargeteNBTransparentContainer.IMSvoiceEPSfallbackfrom5G == nil) == (y.IMSvoiceEPSfallbackfrom5G == nil) && (sourceeNBToTargeteNBTransparentContainer.IMSvoiceEPSfallbackfrom5G == nil || (*sourceeNBToTargeteNBTransparentContainer.IMSvoiceEPSfallbackfrom5G) == *y.IMSvoiceEPSfallbackfrom5G) && + (sourceeNBToTargeteNBTransparentContainer.AdditionalRRMPriorityIndex == nil) == (y.AdditionalRRMPriorityIndex == nil) && (sourceeNBToTargeteNBTransparentContainer.AdditionalRRMPriorityIndex == nil || (*sourceeNBToTargeteNBTransparentContainer.AdditionalRRMPriorityIndex) == *y.AdditionalRRMPriorityIndex) && + (sourceeNBToTargeteNBTransparentContainer.ContextatSource == nil) == (y.ContextatSource == nil) && (sourceeNBToTargeteNBTransparentContainer.ContextatSource == nil || (*sourceeNBToTargeteNBTransparentContainer.ContextatSource).Equal(*y.ContextatSource)) && + (sourceeNBToTargeteNBTransparentContainer.IntersystemMeasurementConfiguration == nil) == (y.IntersystemMeasurementConfiguration == nil) && (sourceeNBToTargeteNBTransparentContainer.IntersystemMeasurementConfiguration == nil || (*sourceeNBToTargeteNBTransparentContainer.IntersystemMeasurementConfiguration).Equal(*y.IntersystemMeasurementConfiguration)) && + (sourceeNBToTargeteNBTransparentContainer.SourceNodeID == nil) == (y.SourceNodeID == nil) && (sourceeNBToTargeteNBTransparentContainer.SourceNodeID == nil || (*sourceeNBToTargeteNBTransparentContainer.SourceNodeID).Equal(*y.SourceNodeID)) && + (sourceeNBToTargeteNBTransparentContainer.EmergencyIndicator == nil) == (y.EmergencyIndicator == nil) && (sourceeNBToTargeteNBTransparentContainer.EmergencyIndicator == nil || (*sourceeNBToTargeteNBTransparentContainer.EmergencyIndicator) == *y.EmergencyIndicator) && + (sourceeNBToTargeteNBTransparentContainer.UEContextReferenceatSourceeNB == nil) == (y.UEContextReferenceatSourceeNB == nil) && (sourceeNBToTargeteNBTransparentContainer.UEContextReferenceatSourceeNB == nil || (*sourceeNBToTargeteNBTransparentContainer.UEContextReferenceatSourceeNB) == *y.UEContextReferenceatSourceeNB) && + (sourceeNBToTargeteNBTransparentContainer.SourceSNID == nil) == (y.SourceSNID == nil) && (sourceeNBToTargeteNBTransparentContainer.SourceSNID == nil || (*sourceeNBToTargeteNBTransparentContainer.SourceSNID).Equal(*y.SourceSNID)) && + (sourceeNBToTargeteNBTransparentContainer.DirectForwardingPathAvailability == nil) == (y.DirectForwardingPathAvailability == nil) && (sourceeNBToTargeteNBTransparentContainer.DirectForwardingPathAvailability == nil || (*sourceeNBToTargeteNBTransparentContainer.DirectForwardingPathAvailability) == *y.DirectForwardingPathAvailability) && + (sourceeNBToTargeteNBTransparentContainer.TimeBasedHandoverInformation == nil) == (y.TimeBasedHandoverInformation == nil) && (sourceeNBToTargeteNBTransparentContainer.TimeBasedHandoverInformation == nil || (*sourceeNBToTargeteNBTransparentContainer.TimeBasedHandoverInformation).Equal(*y.TimeBasedHandoverInformation)) && + sourceeNBToTargeteNBTransparentContainer.iEExtensions == y.iEExtensions && + sourceeNBToTargeteNBTransparentContainer.extensions == y.extensions +} + +func (statusTransferContainer StatusTransferContainer) Equal(y StatusTransferContainer) bool { + if len(statusTransferContainer) != len(y) { + return false + } + for i := range statusTransferContainer { + if !(statusTransferContainer[i] == y[i]) { + return false + } + } + return true +} + +func (supportedTAItem SupportedTAItem) Equal(y SupportedTAItem) bool { + return supportedTAItem.extensions == y.extensions && + supportedTAItem.TAC == y.TAC && + supportedTAItem.BroadcastPLMNs.Equal(y.BroadcastPLMNs) && + (supportedTAItem.RATType == nil) == (y.RATType == nil) && (supportedTAItem.RATType == nil || (*supportedTAItem.RATType) == *y.RATType) && + supportedTAItem.iEExtensions == y.iEExtensions +} + +func (supportedTAs SupportedTAs) Equal(y SupportedTAs) bool { + if len(supportedTAs) != len(y) { + return false + } + for i := range supportedTAs { + if !(supportedTAs[i].Equal(y[i])) { + return false + } + } + return true +} + +func (synchronisationInformation SynchronisationInformation) Equal(y SynchronisationInformation) bool { + return (synchronisationInformation.SourceStratumLevel == nil) == (y.SourceStratumLevel == nil) && (synchronisationInformation.SourceStratumLevel == nil || (*synchronisationInformation.SourceStratumLevel) == *y.SourceStratumLevel) && + (synchronisationInformation.ListeningSubframePattern == nil) == (y.ListeningSubframePattern == nil) && (synchronisationInformation.ListeningSubframePattern == nil || (*synchronisationInformation.ListeningSubframePattern).Equal(*y.ListeningSubframePattern)) && + (synchronisationInformation.AggressoreCGIList == nil) == (y.AggressoreCGIList == nil) && slices.Equal(synchronisationInformation.AggressoreCGIList, y.AggressoreCGIList) && + synchronisationInformation.iEExtensions == y.iEExtensions && + synchronisationInformation.extensions == y.extensions +} + +func (tAI TAI) Equal(y TAI) bool { + return tAI == y +} + +func (tAIBroadcast TAIBroadcast) Equal(y TAIBroadcast) bool { + if len(tAIBroadcast) != len(y) { + return false + } + for i := range tAIBroadcast { + if !(tAIBroadcast[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIBroadcastItem TAIBroadcastItem) Equal(y TAIBroadcastItem) bool { + return tAIBroadcastItem.extensions == y.extensions && + tAIBroadcastItem.TAI.Equal(y.TAI) && + slices.Equal(tAIBroadcastItem.CompletedCellInTAI, y.CompletedCellInTAI) && + tAIBroadcastItem.iEExtensions == y.iEExtensions +} + +func (tAICancelled TAICancelled) Equal(y TAICancelled) bool { + if len(tAICancelled) != len(y) { + return false + } + for i := range tAICancelled { + if !(tAICancelled[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAICancelledItem TAICancelledItem) Equal(y TAICancelledItem) bool { + return tAICancelledItem.extensions == y.extensions && + tAICancelledItem.TAI.Equal(y.TAI) && + slices.Equal(tAICancelledItem.CancelledCellInTAI, y.CancelledCellInTAI) && + tAICancelledItem.iEExtensions == y.iEExtensions +} + +func (tAIItem TAIItem) Equal(y TAIItem) bool { + return tAIItem == y +} + +func (tAIList TAIList) Equal(y TAIList) bool { + if len(tAIList) != len(y) { + return false + } + for i := range tAIList { + if !(tAIList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (tAIListforWarning TAIListforWarning) Equal(y TAIListforWarning) bool { + if len(tAIListforWarning) != len(y) { + return false + } + for i := range tAIListforWarning { + if !(tAIListforWarning[i].Equal(y[i])) { + return false + } + } + return true +} + +func (targetID TargetID) Equal(y TargetID) bool { + return (targetID.TargeteNBID == nil) == (y.TargeteNBID == nil) && (targetID.TargeteNBID == nil || (*targetID.TargeteNBID).Equal(*y.TargeteNBID)) && + (targetID.TargetRNCID == nil) == (y.TargetRNCID == nil) && (targetID.TargetRNCID == nil || (*targetID.TargetRNCID).Equal(*y.TargetRNCID)) && + (targetID.CGI == nil) == (y.CGI == nil) && (targetID.CGI == nil || (*targetID.CGI).Equal(*y.CGI)) && + (targetID.TargetNgRanNodeID == nil) == (y.TargetNgRanNodeID == nil) && (targetID.TargetNgRanNodeID == nil || (*targetID.TargetNgRanNodeID).Equal(*y.TargetNgRanNodeID)) && + (targetID.Ext == nil) == (y.Ext == nil) && (targetID.Ext == nil || (*targetID.Ext) == *y.Ext) +} + +func (targetNgRanNodeID TargetNgRanNodeID) Equal(y TargetNgRanNodeID) bool { + return targetNgRanNodeID.extensions == y.extensions && + targetNgRanNodeID.GlobalRANNodeID.Equal(y.GlobalRANNodeID) && + targetNgRanNodeID.SelectedTAI.Equal(y.SelectedTAI) && + targetNgRanNodeID.iEExtensions == y.iEExtensions +} + +func (targetRNCID TargetRNCID) Equal(y TargetRNCID) bool { + return targetRNCID.LAI.Equal(y.LAI) && + (targetRNCID.RAC == nil) == (y.RAC == nil) && (targetRNCID.RAC == nil || (*targetRNCID.RAC) == *y.RAC) && + targetRNCID.RNCID == y.RNCID && + (targetRNCID.ExtendedRNCID == nil) == (y.ExtendedRNCID == nil) && (targetRNCID.ExtendedRNCID == nil || (*targetRNCID.ExtendedRNCID) == *y.ExtendedRNCID) && + targetRNCID.iEExtensions == y.iEExtensions && + targetRNCID.extensions == y.extensions +} + +func (targeteNBID TargeteNBID) Equal(y TargeteNBID) bool { + return targeteNBID.extensions == y.extensions && + targeteNBID.GlobalENBID.Equal(y.GlobalENBID) && + targeteNBID.SelectedTAI.Equal(y.SelectedTAI) && + targeteNBID.iEExtensions == y.iEExtensions +} + +func (timeBasedHandoverInformation TimeBasedHandoverInformation) Equal(y TimeBasedHandoverInformation) bool { + return timeBasedHandoverInformation == y +} + +func (timeSynchronisationInfo TimeSynchronisationInfo) Equal(y TimeSynchronisationInfo) bool { + return timeSynchronisationInfo.StratumLevel == y.StratumLevel && + timeSynchronisationInfo.SynchronisationStatus == y.SynchronisationStatus && + (timeSynchronisationInfo.MutingAvailabilityIndication == nil) == (y.MutingAvailabilityIndication == nil) && (timeSynchronisationInfo.MutingAvailabilityIndication == nil || (*timeSynchronisationInfo.MutingAvailabilityIndication) == *y.MutingAvailabilityIndication) && + timeSynchronisationInfo.iEExtensions == y.iEExtensions && + timeSynchronisationInfo.extensions == y.extensions +} + +func (traceActivation TraceActivation) Equal(y TraceActivation) bool { + return traceActivation.EUTRANTraceID == y.EUTRANTraceID && + traceActivation.InterfacesToTrace == y.InterfacesToTrace && + traceActivation.TraceDepth == y.TraceDepth && + traceActivation.TraceCollectionEntityIPAddress == y.TraceCollectionEntityIPAddress && + (traceActivation.MDTConfigurationNR == nil) == (y.MDTConfigurationNR == nil) && (traceActivation.MDTConfigurationNR == nil || (*traceActivation.MDTConfigurationNR).Equal(*y.MDTConfigurationNR)) && + (traceActivation.TraceCollectionEntityURI == nil) == (y.TraceCollectionEntityURI == nil) && (traceActivation.TraceCollectionEntityURI == nil || (*traceActivation.TraceCollectionEntityURI) == *y.TraceCollectionEntityURI) && + traceActivation.iEExtensions == y.iEExtensions && + traceActivation.extensions == y.extensions +} + +func (traceFailureIndication TraceFailureIndication) Equal(y TraceFailureIndication) bool { + return traceFailureIndication.MMEUES1APID == y.MMEUES1APID && + traceFailureIndication.ENBUES1APID == y.ENBUES1APID && + (traceFailureIndication.EUTRANTraceID == nil) == (y.EUTRANTraceID == nil) && (traceFailureIndication.EUTRANTraceID == nil || (*traceFailureIndication.EUTRANTraceID) == *y.EUTRANTraceID) && + (traceFailureIndication.Cause == nil) == (y.Cause == nil) && (traceFailureIndication.Cause == nil || (*traceFailureIndication.Cause).Equal(*y.Cause)) && + traceFailureIndication.messageMeta.Equal(y.messageMeta) +} + +func (traceStart TraceStart) Equal(y TraceStart) bool { + return traceStart.MMEUES1APID == y.MMEUES1APID && + traceStart.ENBUES1APID == y.ENBUES1APID && + (traceStart.TraceActivation == nil) == (y.TraceActivation == nil) && (traceStart.TraceActivation == nil || (*traceStart.TraceActivation).Equal(*y.TraceActivation)) && + traceStart.messageMeta.Equal(y.messageMeta) +} + +func (transparentContainer TransparentContainer) Equal(y TransparentContainer) bool { + if len(transparentContainer) != len(y) { + return false + } + for i := range transparentContainer { + if !(transparentContainer[i] == y[i]) { + return false + } + } + return true +} + +func (transportInformation TransportInformation) Equal(y TransportInformation) bool { + return transportInformation == y +} + +func (tunnelInformation TunnelInformation) Equal(y TunnelInformation) bool { + return tunnelInformation.TransportLayerAddress == y.TransportLayerAddress && + (tunnelInformation.UDPPortNumber == nil) == (y.UDPPortNumber == nil) && (tunnelInformation.UDPPortNumber == nil || (*tunnelInformation.UDPPortNumber) == *y.UDPPortNumber) && + tunnelInformation.iEExtensions == y.iEExtensions && + tunnelInformation.extensions == y.extensions +} + +func (uEAggregateMaximumBitRate UEAggregateMaximumBitRate) Equal(y UEAggregateMaximumBitRate) bool { + return uEAggregateMaximumBitRate.DL == y.DL && + uEAggregateMaximumBitRate.UL == y.UL && + (uEAggregateMaximumBitRate.ExtendedDL == nil) == (y.ExtendedDL == nil) && (uEAggregateMaximumBitRate.ExtendedDL == nil || (*uEAggregateMaximumBitRate.ExtendedDL) == *y.ExtendedDL) && + (uEAggregateMaximumBitRate.ExtendedUL == nil) == (y.ExtendedUL == nil) && (uEAggregateMaximumBitRate.ExtendedUL == nil || (*uEAggregateMaximumBitRate.ExtendedUL) == *y.ExtendedUL) && + uEAggregateMaximumBitRate.iEExtensions == y.iEExtensions && + uEAggregateMaximumBitRate.extensions == y.extensions +} + +func (uEAssociatedLogicalS1ConnectionItem UEAssociatedLogicalS1ConnectionItem) Equal(y UEAssociatedLogicalS1ConnectionItem) bool { + return (uEAssociatedLogicalS1ConnectionItem.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (uEAssociatedLogicalS1ConnectionItem.MMEUES1APID == nil || (*uEAssociatedLogicalS1ConnectionItem.MMEUES1APID) == *y.MMEUES1APID) && + (uEAssociatedLogicalS1ConnectionItem.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (uEAssociatedLogicalS1ConnectionItem.ENBUES1APID == nil || (*uEAssociatedLogicalS1ConnectionItem.ENBUES1APID) == *y.ENBUES1APID) && + uEAssociatedLogicalS1ConnectionItem.iEExtensions == y.iEExtensions && + uEAssociatedLogicalS1ConnectionItem.extensions == y.extensions && + uEAssociatedLogicalS1ConnectionItem.containerCrit == y.containerCrit +} + +func (uEAssociatedLogicalS1ConnectionListRes UEAssociatedLogicalS1ConnectionListRes) Equal(y UEAssociatedLogicalS1ConnectionListRes) bool { + if len(uEAssociatedLogicalS1ConnectionListRes) != len(y) { + return false + } + for i := range uEAssociatedLogicalS1ConnectionListRes { + if !(uEAssociatedLogicalS1ConnectionListRes[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uECapabilityInfoIndication UECapabilityInfoIndication) Equal(y UECapabilityInfoIndication) bool { + return uECapabilityInfoIndication.MMEUES1APID == y.MMEUES1APID && + uECapabilityInfoIndication.ENBUES1APID == y.ENBUES1APID && + uECapabilityInfoIndication.UERadioCapability.Equal(y.UERadioCapability) && + uECapabilityInfoIndication.UERadioCapabilityForPaging.Equal(y.UERadioCapabilityForPaging) && + uECapabilityInfoIndication.messageMeta.Equal(y.messageMeta) +} + +func (uEContextModificationFailure UEContextModificationFailure) Equal(y UEContextModificationFailure) bool { + return (uEContextModificationFailure.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (uEContextModificationFailure.MMEUES1APID == nil || (*uEContextModificationFailure.MMEUES1APID) == *y.MMEUES1APID) && + (uEContextModificationFailure.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (uEContextModificationFailure.ENBUES1APID == nil || (*uEContextModificationFailure.ENBUES1APID) == *y.ENBUES1APID) && + (uEContextModificationFailure.Cause == nil) == (y.Cause == nil) && (uEContextModificationFailure.Cause == nil || (*uEContextModificationFailure.Cause).Equal(*y.Cause)) && + (uEContextModificationFailure.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (uEContextModificationFailure.CriticalityDiagnostics == nil || (*uEContextModificationFailure.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + uEContextModificationFailure.messageMeta.Equal(y.messageMeta) +} + +func (uEContextModificationRequest UEContextModificationRequest) Equal(y UEContextModificationRequest) bool { + return uEContextModificationRequest.MMEUES1APID == y.MMEUES1APID && + uEContextModificationRequest.ENBUES1APID == y.ENBUES1APID && + (uEContextModificationRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (uEContextModificationRequest.UEAggregateMaximumBitRate == nil || (*uEContextModificationRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && + (uEContextModificationRequest.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (uEContextModificationRequest.TimeRefDistribution == nil || (*uEContextModificationRequest.TimeRefDistribution) == *y.TimeRefDistribution) && + uEContextModificationRequest.messageMeta.Equal(y.messageMeta) +} + +func (uEContextModificationResponse UEContextModificationResponse) Equal(y UEContextModificationResponse) bool { + return (uEContextModificationResponse.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (uEContextModificationResponse.MMEUES1APID == nil || (*uEContextModificationResponse.MMEUES1APID) == *y.MMEUES1APID) && + (uEContextModificationResponse.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (uEContextModificationResponse.ENBUES1APID == nil || (*uEContextModificationResponse.ENBUES1APID) == *y.ENBUES1APID) && + (uEContextModificationResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (uEContextModificationResponse.CriticalityDiagnostics == nil || (*uEContextModificationResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + uEContextModificationResponse.messageMeta.Equal(y.messageMeta) +} + +func (uEContextReleaseCommand UEContextReleaseCommand) Equal(y UEContextReleaseCommand) bool { + return uEContextReleaseCommand.UES1APIDs.Equal(y.UES1APIDs) && + (uEContextReleaseCommand.Cause == nil) == (y.Cause == nil) && (uEContextReleaseCommand.Cause == nil || (*uEContextReleaseCommand.Cause).Equal(*y.Cause)) && + uEContextReleaseCommand.messageMeta.Equal(y.messageMeta) +} + +func (uEContextReleaseComplete UEContextReleaseComplete) Equal(y UEContextReleaseComplete) bool { + return (uEContextReleaseComplete.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (uEContextReleaseComplete.MMEUES1APID == nil || (*uEContextReleaseComplete.MMEUES1APID) == *y.MMEUES1APID) && + (uEContextReleaseComplete.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (uEContextReleaseComplete.ENBUES1APID == nil || (*uEContextReleaseComplete.ENBUES1APID) == *y.ENBUES1APID) && + (uEContextReleaseComplete.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (uEContextReleaseComplete.CriticalityDiagnostics == nil || (*uEContextReleaseComplete.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (uEContextReleaseComplete.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (uEContextReleaseComplete.UserLocationInformation == nil || (*uEContextReleaseComplete.UserLocationInformation).Equal(*y.UserLocationInformation)) && + uEContextReleaseComplete.messageMeta.Equal(y.messageMeta) +} + +func (uEContextReleaseRequest UEContextReleaseRequest) Equal(y UEContextReleaseRequest) bool { + return uEContextReleaseRequest.MMEUES1APID == y.MMEUES1APID && + uEContextReleaseRequest.ENBUES1APID == y.ENBUES1APID && + (uEContextReleaseRequest.Cause == nil) == (y.Cause == nil) && (uEContextReleaseRequest.Cause == nil || (*uEContextReleaseRequest.Cause).Equal(*y.Cause)) && + (uEContextReleaseRequest.GWContextReleaseIndication == nil) == (y.GWContextReleaseIndication == nil) && (uEContextReleaseRequest.GWContextReleaseIndication == nil || (*uEContextReleaseRequest.GWContextReleaseIndication) == *y.GWContextReleaseIndication) && + uEContextReleaseRequest.messageMeta.Equal(y.messageMeta) +} + +func (uEHistoryInformation UEHistoryInformation) Equal(y UEHistoryInformation) bool { + if len(uEHistoryInformation) != len(y) { + return false + } + for i := range uEHistoryInformation { + if !(uEHistoryInformation[i].Equal(y[i])) { + return false + } + } + return true +} + +func (uEHistoryInformationFromTheUE UEHistoryInformationFromTheUE) Equal(y UEHistoryInformationFromTheUE) bool { + if len(uEHistoryInformationFromTheUE) != len(y) { + return false + } + for i := range uEHistoryInformationFromTheUE { + if !(uEHistoryInformationFromTheUE[i] == y[i]) { + return false + } + } + return true +} + +func (uEPagingID UEPagingID) Equal(y UEPagingID) bool { + return (uEPagingID.STMSI == nil) == (y.STMSI == nil) && (uEPagingID.STMSI == nil || (*uEPagingID.STMSI).Equal(*y.STMSI)) && + (uEPagingID.IMSI == nil) == (y.IMSI == nil) && (uEPagingID.IMSI == nil || (*uEPagingID.IMSI).Equal(*y.IMSI)) && + (uEPagingID.Ext == nil) == (y.Ext == nil) && (uEPagingID.Ext == nil || (*uEPagingID.Ext) == *y.Ext) +} + +func (uERadioCapability UERadioCapability) Equal(y UERadioCapability) bool { + if len(uERadioCapability) != len(y) { + return false + } + for i := range uERadioCapability { + if !(uERadioCapability[i] == y[i]) { + return false + } + } + return true +} + +func (uERadioCapabilityForPaging UERadioCapabilityForPaging) Equal(y UERadioCapabilityForPaging) bool { + if len(uERadioCapabilityForPaging) != len(y) { + return false + } + for i := range uERadioCapabilityForPaging { + if !(uERadioCapabilityForPaging[i] == y[i]) { + return false + } + } + return true +} + +func (uES1APIDPair UES1APIDPair) Equal(y UES1APIDPair) bool { + return uES1APIDPair == y +} + +func (uES1APIDs UES1APIDs) Equal(y UES1APIDs) bool { + return (uES1APIDs.UES1APIDPair == nil) == (y.UES1APIDPair == nil) && (uES1APIDs.UES1APIDPair == nil || (*uES1APIDs.UES1APIDPair).Equal(*y.UES1APIDPair)) && + (uES1APIDs.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (uES1APIDs.MMEUES1APID == nil || (*uES1APIDs.MMEUES1APID) == *y.MMEUES1APID) && + (uES1APIDs.Ext == nil) == (y.Ext == nil) && (uES1APIDs.Ext == nil || (*uES1APIDs.Ext) == *y.Ext) +} + +func (uESecurityCapabilities UESecurityCapabilities) Equal(y UESecurityCapabilities) bool { + return uESecurityCapabilities == y +} + +func (uplinkNASTransport UplinkNASTransport) Equal(y UplinkNASTransport) bool { + return uplinkNASTransport.MMEUES1APID == y.MMEUES1APID && + uplinkNASTransport.ENBUES1APID == y.ENBUES1APID && + uplinkNASTransport.NASPDU.Equal(y.NASPDU) && + (uplinkNASTransport.EUTRANCGI == nil) == (y.EUTRANCGI == nil) && (uplinkNASTransport.EUTRANCGI == nil || (*uplinkNASTransport.EUTRANCGI).Equal(*y.EUTRANCGI)) && + (uplinkNASTransport.TAI == nil) == (y.TAI == nil) && (uplinkNASTransport.TAI == nil || (*uplinkNASTransport.TAI).Equal(*y.TAI)) && + (uplinkNASTransport.GWTransportLayerAddress == nil) == (y.GWTransportLayerAddress == nil) && (uplinkNASTransport.GWTransportLayerAddress == nil || (*uplinkNASTransport.GWTransportLayerAddress) == *y.GWTransportLayerAddress) && + (uplinkNASTransport.SIPTOLGWTransportLayerAddress == nil) == (y.SIPTOLGWTransportLayerAddress == nil) && (uplinkNASTransport.SIPTOLGWTransportLayerAddress == nil || (*uplinkNASTransport.SIPTOLGWTransportLayerAddress) == *y.SIPTOLGWTransportLayerAddress) && + uplinkNASTransport.messageMeta.Equal(y.messageMeta) +} + +func (uplinkNonUEAssociatedLPPaTransport UplinkNonUEAssociatedLPPaTransport) Equal(y UplinkNonUEAssociatedLPPaTransport) bool { + return uplinkNonUEAssociatedLPPaTransport.RoutingID == y.RoutingID && + uplinkNonUEAssociatedLPPaTransport.LPPaPDU.Equal(y.LPPaPDU) && + uplinkNonUEAssociatedLPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (uplinkUEAssociatedLPPaTransport UplinkUEAssociatedLPPaTransport) Equal(y UplinkUEAssociatedLPPaTransport) bool { + return uplinkUEAssociatedLPPaTransport.MMEUES1APID == y.MMEUES1APID && + uplinkUEAssociatedLPPaTransport.ENBUES1APID == y.ENBUES1APID && + uplinkUEAssociatedLPPaTransport.RoutingID == y.RoutingID && + uplinkUEAssociatedLPPaTransport.LPPaPDU.Equal(y.LPPaPDU) && + uplinkUEAssociatedLPPaTransport.messageMeta.Equal(y.messageMeta) +} + +func (userLocationInformation UserLocationInformation) Equal(y UserLocationInformation) bool { + return userLocationInformation.extensions == y.extensions && + userLocationInformation.EUTRANCGI.Equal(y.EUTRANCGI) && + userLocationInformation.TAI.Equal(y.TAI) && + (userLocationInformation.PSCellInformation == nil) == (y.PSCellInformation == nil) && (userLocationInformation.PSCellInformation == nil || (*userLocationInformation.PSCellInformation).Equal(*y.PSCellInformation)) && + (userLocationInformation.LTENTNTAIInformation == nil) == (y.LTENTNTAIInformation == nil) && (userLocationInformation.LTENTNTAIInformation == nil || (*userLocationInformation.LTENTNTAIInformation).Equal(*y.LTENTNTAIInformation)) && + userLocationInformation.iEExtensions == y.iEExtensions +} + +func (warningAreaCoordinates WarningAreaCoordinates) Equal(y WarningAreaCoordinates) bool { + if len(warningAreaCoordinates) != len(y) { + return false + } + for i := range warningAreaCoordinates { + if !(warningAreaCoordinates[i] == y[i]) { + return false + } + } + return true +} + +func (warningAreaList WarningAreaList) Equal(y WarningAreaList) bool { + return (warningAreaList.CellIDList == nil) == (y.CellIDList == nil) && (warningAreaList.CellIDList == nil || (*warningAreaList.CellIDList).Equal(*y.CellIDList)) && + (warningAreaList.TrackingAreaListforWarning == nil) == (y.TrackingAreaListforWarning == nil) && (warningAreaList.TrackingAreaListforWarning == nil || (*warningAreaList.TrackingAreaListforWarning).Equal(*y.TrackingAreaListforWarning)) && + (warningAreaList.EmergencyAreaIDList == nil) == (y.EmergencyAreaIDList == nil) && (warningAreaList.EmergencyAreaIDList == nil || (*warningAreaList.EmergencyAreaIDList).Equal(*y.EmergencyAreaIDList)) && + (warningAreaList.Ext == nil) == (y.Ext == nil) && (warningAreaList.Ext == nil || (*warningAreaList.Ext) == *y.Ext) +} + +func (warningMessageContents WarningMessageContents) Equal(y WarningMessageContents) bool { + if len(warningMessageContents) != len(y) { + return false + } + for i := range warningMessageContents { + if !(warningMessageContents[i] == y[i]) { + return false + } + } + return true +} + +func (writeReplaceWarningRequest WriteReplaceWarningRequest) Equal(y WriteReplaceWarningRequest) bool { + return writeReplaceWarningRequest.MessageIdentifier == y.MessageIdentifier && + writeReplaceWarningRequest.SerialNumber == y.SerialNumber && + (writeReplaceWarningRequest.WarningAreaList == nil) == (y.WarningAreaList == nil) && (writeReplaceWarningRequest.WarningAreaList == nil || (*writeReplaceWarningRequest.WarningAreaList).Equal(*y.WarningAreaList)) && + writeReplaceWarningRequest.RepetitionPeriod == y.RepetitionPeriod && + (writeReplaceWarningRequest.ExtendedRepetitionPeriod == nil) == (y.ExtendedRepetitionPeriod == nil) && (writeReplaceWarningRequest.ExtendedRepetitionPeriod == nil || (*writeReplaceWarningRequest.ExtendedRepetitionPeriod) == *y.ExtendedRepetitionPeriod) && + writeReplaceWarningRequest.NumberofBroadcastRequest == y.NumberofBroadcastRequest && + (writeReplaceWarningRequest.WarningType == nil) == (y.WarningType == nil) && (writeReplaceWarningRequest.WarningType == nil || (*writeReplaceWarningRequest.WarningType) == *y.WarningType) && + (writeReplaceWarningRequest.WarningSecurityInfo == nil) == (y.WarningSecurityInfo == nil) && (writeReplaceWarningRequest.WarningSecurityInfo == nil || (*writeReplaceWarningRequest.WarningSecurityInfo) == *y.WarningSecurityInfo) && + (writeReplaceWarningRequest.DataCodingScheme == nil) == (y.DataCodingScheme == nil) && (writeReplaceWarningRequest.DataCodingScheme == nil || (*writeReplaceWarningRequest.DataCodingScheme) == *y.DataCodingScheme) && + (writeReplaceWarningRequest.WarningMessageContents == nil) == (y.WarningMessageContents == nil) && (writeReplaceWarningRequest.WarningMessageContents == nil || (*writeReplaceWarningRequest.WarningMessageContents).Equal(*y.WarningMessageContents)) && + (writeReplaceWarningRequest.ConcurrentWarningMessageIndicator == nil) == (y.ConcurrentWarningMessageIndicator == nil) && (writeReplaceWarningRequest.ConcurrentWarningMessageIndicator == nil || (*writeReplaceWarningRequest.ConcurrentWarningMessageIndicator) == *y.ConcurrentWarningMessageIndicator) && + (writeReplaceWarningRequest.WarningAreaCoordinates == nil) == (y.WarningAreaCoordinates == nil) && (writeReplaceWarningRequest.WarningAreaCoordinates == nil || (*writeReplaceWarningRequest.WarningAreaCoordinates).Equal(*y.WarningAreaCoordinates)) && + writeReplaceWarningRequest.messageMeta.Equal(y.messageMeta) +} + +func (writeReplaceWarningResponse WriteReplaceWarningResponse) Equal(y WriteReplaceWarningResponse) bool { + return writeReplaceWarningResponse.MessageIdentifier == y.MessageIdentifier && + writeReplaceWarningResponse.SerialNumber == y.SerialNumber && + (writeReplaceWarningResponse.BroadcastCompletedAreaList == nil) == (y.BroadcastCompletedAreaList == nil) && (writeReplaceWarningResponse.BroadcastCompletedAreaList == nil || (*writeReplaceWarningResponse.BroadcastCompletedAreaList).Equal(*y.BroadcastCompletedAreaList)) && + (writeReplaceWarningResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (writeReplaceWarningResponse.CriticalityDiagnostics == nil || (*writeReplaceWarningResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + writeReplaceWarningResponse.messageMeta.Equal(y.messageMeta) +} + +func (x2TNLConfigurationInfo X2TNLConfigurationInfo) Equal(y X2TNLConfigurationInfo) bool { + return x2TNLConfigurationInfo.ENBX2TransportLayerAddresses.Equal(y.ENBX2TransportLayerAddresses) && + x2TNLConfigurationInfo.ENBX2ExtendedTransportLayerAddresses.Equal(y.ENBX2ExtendedTransportLayerAddresses) && + x2TNLConfigurationInfo.ENBIndirectX2TransportLayerAddresses.Equal(y.ENBIndirectX2TransportLayerAddresses) && + x2TNLConfigurationInfo.iEExtensions == y.iEExtensions && + x2TNLConfigurationInfo.extensions == y.extensions +} + +func (x erabModifyItemBearerModConf) Equal(y erabModifyItemBearerModConf) bool { + return x == y +} + +func (x messageMeta) Equal(y messageMeta) bool { + return x.Message.Equal(y.Message) } diff --git a/s1ap/per_gen_test.go b/s1ap/per_gen_test.go new file mode 100644 index 0000000000..60586c6429 --- /dev/null +++ b/s1ap/per_gen_test.go @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "os" + "slices" + "testing" + + "github.com/ellanetworks/core/per/pergen" +) + +var pergenConfig = pergen.Config{Dir: ".", Output: "per_gen.go", Profile: "profile", IEID: "ProtocolIEID"} + +func TestGeneratedCodecsAreUpToDate(t *testing.T) { + want, err := pergen.Generate(t.Context(), pergenConfig) + if err != nil { + t.Fatal(err) + } + + got, err := os.ReadFile("per_gen.go") + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(got, want) { + t.Fatal("per_gen.go is stale: run go generate") + } +} + +var undiagnosedHandWrittenTypes = []string{"AbstractSyntaxError"} + +func TestEveryTypeHoldingDiagnosableStateIsDiagnosed(t *testing.T) { + got, err := pergen.Undiagnosed(t.Context(), pergenConfig) + if err != nil { + t.Fatal(err) + } + + if !slices.Equal(got, undiagnosedHandWrittenTypes) { + t.Fatalf("types that hold diagnosable state without a Diagnose method:\n got %q\nwant %q", got, undiagnosedHandWrittenTypes) + } +} diff --git a/s1ap/per_leaf.go b/s1ap/per_leaf.go index da5299179f..225f11510a 100644 --- a/s1ap/per_leaf.go +++ b/s1ap/per_leaf.go @@ -3,7 +3,7 @@ package s1ap -//go:generate sh -c "cd .. && go run ./cmd/pergen -o s1ap/per_gen.go github.com/ellanetworks/core/s1ap" +//go:generate go run github.com/ellanetworks/core/per/cmd/pergen -profile profile -ieid ProtocolIEID import ( "encoding/binary" @@ -68,8 +68,6 @@ func (t *FiveGSTAC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -// GNB-Identity ::= CHOICE { gNB-ID, ... }: one root alternative, a bit string -// whose width the sender chooses within SIZE(22..32). func (g GNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { if g.Bits < gnbIDMinBits || g.Bits > gnbIDMaxBits { return fmt.Errorf("s1ap: gNB-ID of %d bits, want %d..%d", g.Bits, gnbIDMinBits, gnbIDMaxBits) @@ -79,30 +77,11 @@ func (g GNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { return fmt.Errorf("s1ap: gNB id %d exceeds its own %d bits", g.Value, g.Bits) } - w.WriteBit(false) - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 0, 0); err != nil { - return err - } - return per.EncodeBitString(w, enc, gnbIDMinBits, gnbIDMaxBits, true, true, false, uintToBits(uint64(g.Value), g.Bits), g.Bits) } func (g *GNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return err - } - - if isExt { - return fmt.Errorf("%w: GNB-Identity extension alternative", errNotComprehended) - } - - if _, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 0); err != nil { - return err - } - b, nbits, err := per.DecodeBitString(r, enc, gnbIDMinBits, gnbIDMaxBits, true, true, false) if err != nil { return err @@ -113,79 +92,6 @@ func (g *GNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -// Global-RAN-NODE-ID ::= CHOICE { gNB, ng-eNB, ... }. -const ( - globalRANNodeIDGNB = iota - globalRANNodeIDNgENB - - globalRANNodeIDRootCount = 2 -) - -func (g GlobalRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - var ( - idx int64 - value per.Marshaler - ) - - switch { - case g.GNB != nil && g.NgENB != nil: - return fmt.Errorf("s1ap: Global-RAN-NODE-ID carries both a gNB and an ng-eNB") - case g.GNB != nil: - idx, value = globalRANNodeIDGNB, g.GNB - case g.NgENB != nil: - idx, value = globalRANNodeIDNgENB, g.NgENB - default: - return fmt.Errorf("s1ap: Global-RAN-NODE-ID carries no alternative") - } - - w.WriteBit(false) - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, globalRANNodeIDRootCount-1, idx); err != nil { - return err - } - - return value.MarshalPER(w, enc) -} - -func (g *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return err - } - - if isExt { - return fmt.Errorf("%w: Global-RAN-NODE-ID extension alternative", errNotComprehended) - } - - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, globalRANNodeIDRootCount-1) - if err != nil { - return err - } - - switch idx { - case globalRANNodeIDGNB: - var v GNB - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - *g = GlobalRANNodeID{GNB: &v} - - return nil - case globalRANNodeIDNgENB: - var v NgENB - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - *g = GlobalRANNodeID{NgENB: &v} - - return nil - default: - return fmt.Errorf("%w: Global-RAN-NODE-ID alternative %d", errNotComprehended, idx) - } -} - func (t TAC) MarshalPER(w *per.Writer, enc per.Encoding) error { return per.EncodeOctetString(w, enc, 2, 2, true, true, false, []byte{byte(t >> 8), byte(t)}) } @@ -201,100 +107,48 @@ func (t *TAC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (e ENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - nb, ok := enbIDBits[e.Kind] - if !ok { - return fmt.Errorf("s1ap: invalid ENB-ID kind %d", e.Kind) - } - - switch e.Kind { - case ENBIDMacro, ENBIDHome: - w.WriteBit(false) - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, int64(e.Kind)); err != nil { - return err - } - - return per.EncodeBitString(w, enc, int64(nb), int64(nb), true, true, false, uintToBits(uint64(e.Value), nb), nb) - default: - w.WriteBit(true) - - if err := per.EncodeNormallySmall(w, enc, int64(e.Kind-ENBIDShortMacro)); err != nil { - return err - } - - inner := per.NewWriter() - if err := per.EncodeBitString(inner, enc, int64(nb), int64(nb), true, true, false, uintToBits(uint64(e.Value), nb), nb); err != nil { - return err - } - - inner.AlignToByte() - - return per.EncodeOpenTypeBytes(w, enc, inner.Bytes()) - } +func (e MacroENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(e), macroENBIDBits) } -func (e *ENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := per.DecodeBoolean(r, enc) - if err != nil { - return err - } +func (e *MacroENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, macroENBIDBits) + *e = MacroENBID(v) - if !isExt { - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) - if err != nil { - return err - } - - kind := ENBIDMacro - if idx == 1 { - kind = ENBIDHome - } - - nb := enbIDBits[kind] - - b, _, err := per.DecodeBitString(r, enc, int64(nb), int64(nb), true, true, false) - if err != nil { - return err - } - - *e = ENBID{Kind: kind, Value: uint32(bitsToUint(b, nb))} + return err +} - return nil - } +func (e HomeENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(e), homeENBIDBits) +} - extIdx, err := per.DecodeNormallySmall(r, enc) - if err != nil { - return err - } +func (e *HomeENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, homeENBIDBits) + *e = HomeENBID(v) - raw, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return err - } + return err +} - // ENB-ID defines two extension additions, short-macroENB-ID and - // long-macroENB-ID. The open type above is read first so a later addition - // leaves the reader positioned after the alternative it could not decode. - if extIdx > 1 { - return fmt.Errorf("%w: ENB-ID extension alternative %d", errNotComprehended, extIdx) - } +func (e ShortMacroENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(e), shortMacroENBIDBits) +} - kind := ENBIDShortMacro - if extIdx == 1 { - kind = ENBIDLongMacro - } +func (e *ShortMacroENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, shortMacroENBIDBits) + *e = ShortMacroENBID(v) - nb := enbIDBits[kind] + return err +} - b, _, err := per.DecodeBitString(per.NewReader(raw), enc, int64(nb), int64(nb), true, true, false) - if err != nil { - return err - } +func (e LongMacroENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(e), longMacroENBIDBits) +} - *e = ENBID{Kind: kind, Value: uint32(bitsToUint(b, nb))} +func (e *LongMacroENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, longMacroENBIDBits) + *e = LongMacroENBID(v) - return nil + return err } func encodeBitStringUint(w *per.Writer, enc per.Encoding, v uint64, nbits int) error { @@ -314,36 +168,6 @@ func decodeBitStringUint(r *per.Reader, enc per.Encoding, nbits int) (uint64, er return bitsToUint(b, nbits), nil } -func (u UERetentionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, ueRetentionInformationRootCount, int64(u), "UERetentionInformation") -} - -func (u *UERetentionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, ueRetentionInformationRootCount, "UERetentionInformation") - if err != nil { - return err - } - - *u = UERetentionInformation(idx) - - return nil -} - -func (p PagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, pagingDRXRootCount, int64(p), "PagingDRX") -} - -func (p *PagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, pagingDRXRootCount, "PagingDRX") - if err != nil { - return err - } - - *p = PagingDRX(idx) - - return nil -} - func (b BPLMNs) MarshalPER(w *per.Writer, enc per.Encoding) error { off := 0 @@ -414,233 +238,167 @@ func (s *SupportedTAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { // The container holds at least one extension (SIZE(1..maxProtocolExtensions)), // so a caller with nothing to send leaves the field nil. -func (l LAC) MarshalPER(w *per.Writer, enc per.Encoding) error { - return per.EncodeOctetString(w, enc, 2, 2, true, true, false, []byte{byte(l >> 8), byte(l)}) +func (c RAC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 1, 1, true, true, false, []byte{byte(c)}) } -func (l *LAC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) +func (c *RAC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 1, 1, true, true, false) if err != nil { return err } - *l = LAC(uint16(b[0])<<8 | uint16(b[1])) + *c = RAC(b[0]) return nil } -func (e EPLMNs) MarshalPER(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofEPLMNs, []PLMNIdentity(e)) +func (c CI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 2, 2, true, true, false, []byte{byte(c >> 8), byte(c)}) } -func (e *EPLMNs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - items, err := unmarshalSeqOf[PLMNIdentity](r, enc, 1, maxnoofEPLMNs) +func (c *CI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) if err != nil { return err } - *e = items + *c = CI(uint16(b[0])<<8 | uint16(b[1])) return nil } -func (f ForbiddenTACs) MarshalPER(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofForbTACs, []TAC(f)) +func (c CellIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(c), cellIDBits) } -func (f *ForbiddenTACs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - items, err := unmarshalSeqOf[TAC](r, enc, 1, maxnoofForbTACs) - if err != nil { - return err - } - - *f = items +func (c *CellIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, cellIDBits) + *c = CellIdentity(v) - return nil + return err } -func (f ForbiddenLACs) MarshalPER(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofForbLACs, []LAC(f)) +func (a SecurityAlgorithms) MarshalPER(w *per.Writer, enc per.Encoding) error { + if a.extended { + return per.EncodeBitString(w, enc, securityAlgorithmsBits, securityAlgorithmsBits, true, true, true, []byte(a.octets), a.bits) + } + + return per.EncodeBitString(w, enc, securityAlgorithmsBits, securityAlgorithmsBits, true, true, true, + uintToBits(uint64(a.Value), securityAlgorithmsBits), securityAlgorithmsBits) } -func (f *ForbiddenLACs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - items, err := unmarshalSeqOf[LAC](r, enc, 1, maxnoofForbLACs) +func (a *SecurityAlgorithms) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, nbits, err := per.DecodeBitString(r, enc, securityAlgorithmsBits, securityAlgorithmsBits, true, true, true) if err != nil { return err } - *f = items + if nbits == securityAlgorithmsBits { + *a = SecurityAlgorithms{Value: uint16(bitsToUint(b, nbits))} + + return nil + } + + head := make([]byte, 2) + copy(head, b) + + *a = SecurityAlgorithms{ + Value: uint16(bitsToUint(head, securityAlgorithmsBits)), + extended: true, + octets: string(b), + bits: nbits, + } return nil } -func (f ForbiddenTAs) MarshalPER(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofEPLMNsPlusOne, []ForbiddenTAsItem(f)) +func (l LAC) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 2, 2, true, true, false, []byte{byte(l >> 8), byte(l)}) } -func (f *ForbiddenTAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - items, err := unmarshalSeqOf[ForbiddenTAsItem](r, enc, 1, maxnoofEPLMNsPlusOne) +func (l *LAC) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 2, 2, true, true, false) if err != nil { return err } - *f = items + *l = LAC(uint16(b[0])<<8 | uint16(b[1])) return nil } -func (f ForbiddenLAs) MarshalPER(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofEPLMNsPlusOne, []ForbiddenLAsItem(f)) +func (e EPLMNs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEPLMNs, []PLMNIdentity(e)) } -func (f *ForbiddenLAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - items, err := unmarshalSeqOf[ForbiddenLAsItem](r, enc, 1, maxnoofEPLMNsPlusOne) +func (e *EPLMNs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PLMNIdentity](r, enc, 1, maxnoofEPLMNs) if err != nil { return err } - *f = items + *e = items return nil } -func (f ForbiddenInterRATs) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, forbiddenInterRATsRootCount, int64(f), "ForbiddenInterRATs") +func (f ForbiddenTACs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofForbTACs, []TAC(f)) } -func (f *ForbiddenInterRATs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, forbiddenInterRATsRootCount, "ForbiddenInterRATs") +func (f *ForbiddenTACs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[TAC](r, enc, 1, maxnoofForbTACs) if err != nil { return err } - *f = ForbiddenInterRATs(idx) + *f = items return nil } -func (e *ERABToBeSetupItemHOReqExtIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := extensionFields(eRABToBeSetupItemHOReqExtIEs, e, &e.meta) - if len(ext) == 0 { - return fmt.Errorf("s1ap: E-RABToBeSetupItemHOReq iE-Extensions carries no extension") - } - - return encodeExtensionContainer(w, enc, ext) -} - -func (e *ERABToBeSetupItemHOReqExtIEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - return decodeExtensionContainer(r, enc, eRABToBeSetupItemHOReqExtIEs, e, &e.meta) -} - -func (d DataForwardingNotPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, dataForwardingNotPossibleRootCount, int64(d), "DataForwardingNotPossible") +func (f ForbiddenLACs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofForbLACs, []LAC(f)) } -func (d *DataForwardingNotPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, dataForwardingNotPossibleRootCount, "DataForwardingNotPossible") +func (f *ForbiddenLACs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[LAC](r, enc, 1, maxnoofForbLACs) if err != nil { return err } - *d = DataForwardingNotPossible(idx) + *f = items return nil } -// A ProtocolExtensionContainer: never encoded, and on decode only its -// criticality is acted on. -type ieExtensions struct{} - -func (ieExtensions) MarshalPER(*per.Writer, per.Encoding) error { - return fmt.Errorf("s1ap: unmodeled iE-Extensions cannot be encoded") +func (f ForbiddenTAs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEPLMNsPlusOne, []ForbiddenTAsItem(f)) } -func (*ieExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) +func (f *ForbiddenTAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ForbiddenTAsItem](r, enc, 1, maxnoofEPLMNsPlusOne) if err != nil { return err } - var rejected ProtocolIEID - - comprehended := true - - for i := int64(0); i < n; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return err - } - - crit, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return err - } - - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - - // §10.3.4.2: an unmodeled extension marked reject stops the procedure; - // ignore and notify are skipped and the IE holding them still - // delivered. The container is consumed either way so the reader stays - // aligned. A notify extension should also be reported back, which a - // leaf decoder has no diagnostics sink to do. - // - // This rejects S1 Setup from a Release-13 eNB, whose SupportedTAs-Item - // carries the reject-criticality id-RAT-Type (232) on an NB-IoT TAC. - // Deliberate while NB-IoT is unsupported. Modeling RAT-Type is what - // changes that, not loosening this rule. - if Criticality(crit) == CriticalityReject && comprehended { - comprehended, rejected = false, ProtocolIEID(id) - } - } - - if !comprehended { - return ¬ComprehendedIE{ID: rejected, Crit: CriticalityReject, What: "iE-Extensions"} - } + *f = items return nil } -func skipSequenceExtensionsPER(r *per.Reader, enc per.Encoding, extContainer, extAdditions bool) error { - if extContainer { - var e ieExtensions - if err := e.UnmarshalPER(r, enc); err != nil { - return err - } - } - - if !extAdditions { - return nil - } - - var present []bool - - // A bitmap wider than 64 bits arrives fragmented (X.691 §19.7 via §11.9.3), - // so the callback runs once per fragment and the bits accumulate. - err := per.DecodeNormallySmallLength(r, enc, func(count int64) error { - for range count { - b, err := r.ReadBit() - if err != nil { - return err - } - - present = append(present, b) - } +func (f ForbiddenLAs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofEPLMNsPlusOne, []ForbiddenLAsItem(f)) +} - return nil - }) +func (f *ForbiddenLAs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ForbiddenLAsItem](r, enc, 1, maxnoofEPLMNsPlusOne) if err != nil { return err } - for _, p := range present { - if p { - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - } + *f = items return nil } @@ -693,44 +451,3 @@ func unmarshalSeqOf[T any](r *per.Reader, enc per.Encoding, lb, ub int64) ([]T, return items, nil } - -func perIEDecode(b []byte, u per.Unmarshaler) error { - return u.UnmarshalPER(per.NewReader(b), per.Aligned) -} - -type rawIEExtensions struct { - data []byte - nbits int -} - -func (e *rawIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { - if enc == per.Aligned { - w.AlignToByte() - } - - w.WriteBitString(e.data, e.nbits) - - return nil -} - -func (e *rawIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - if enc == per.Aligned { - r.AlignToByte() - } - - start := r.Offset() - - var c ieExtensions - if err := c.UnmarshalPER(r, enc); err != nil { - return err - } - - data, nbits, err := r.Since(start) - if err != nil { - return err - } - - e.data, e.nbits = data, nbits - - return nil -} diff --git a/s1ap/per_test_helpers_test.go b/s1ap/per_test_helpers_test.go index 869689c676..d488003ba2 100644 --- a/s1ap/per_test_helpers_test.go +++ b/s1ap/per_test_helpers_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func unmarshalPERValue[T any](b []byte) (T, error) { @@ -45,3 +46,35 @@ func deref[T any](p *T) T { return *p } + +//nolint:unparam +func encodeIEContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { + return ap.EncodeIEContainer(profile, w, enc, fields) +} + +func typeOfError(d DiagnosticIE) TypeOfError { + if d.Kind == ap.KindMissing { + return TypeOfErrorMissing + } + + return TypeOfErrorNotUnderstood +} + +const paddingIEs = 64 + +func firstIndex(p *RawPDU, id ProtocolIEID) int { + i, err := p.Index(id) + if err != nil { + return -1 + } + + return i +} + +func encodeExtensionContainer(w *per.Writer, fields []ieField) error { + return ap.EncodeExtensionContainer(profile, w, per.Aligned, fields) +} + +func decodeExtensionContainer[M any](r *per.Reader, table []ieSpec[M], m *M, meta *extensionMeta) error { + return ap.DecodeExtensionContainer(profile, r, per.Aligned, table, m, meta) +} diff --git a/s1ap/procedure_criticality.go b/s1ap/procedure_criticality.go index 082824a2e0..6e906a2a92 100644 --- a/s1ap/procedure_criticality.go +++ b/s1ap/procedure_criticality.go @@ -79,6 +79,7 @@ var procedureInfos = map[ProcedureCode]procedureInfo{ ProcHandoverSuccess: {CriticalityIgnore, false}, ProcENBEarlyStatusTransfer: {CriticalityReject, false}, ProcMMEEarlyStatusTransfer: {CriticalityIgnore, false}, + ProcS1Removal: {CriticalityReject, true}, } // TS 36.413 §9.3.2. diff --git a/s1ap/procedure_names.go b/s1ap/procedure_names.go index a598e8a2d2..2d7603c900 100644 --- a/s1ap/procedure_names.go +++ b/s1ap/procedure_names.go @@ -78,6 +78,7 @@ var procedureNames = map[ProcedureCode]string{ ProcHandoverSuccess: "HandoverSuccess", ProcENBEarlyStatusTransfer: "ENBEarlyStatusTransfer", ProcMMEEarlyStatusTransfer: "MMEEarlyStatusTransfer", + ProcS1Removal: "S1Removal", } // ProcedureCodeName returns the TS 36.413 name of p, and whether it is known. diff --git a/s1ap/pws.go b/s1ap/pws.go index 8532e82483..4522c039da 100644 --- a/s1ap/pws.go +++ b/s1ap/pws.go @@ -10,9 +10,9 @@ import ( func decodeOptionalIE[T any, PT interface { *T per.Unmarshaler -}](raw []byte, dst **T) error { +}](r *per.Reader, dst **T) error { v := PT(new(T)) - if err := perIEDecode(raw, v); err != nil { + if err := decodeIE(r, v); err != nil { return err } @@ -32,8 +32,8 @@ func optionalIE[T any, PT interface { return PT(v), true } -func decodeOptionalInteger[T ~uint8 | ~uint16 | ~uint32](raw []byte, b per.Bounds, dst **T) error { - n, err := per.DecodeInteger(per.NewReader(raw), per.Aligned, b) +func decodeOptionalInteger[T ~uint8 | ~uint16 | ~uint32](r *per.Reader, b per.Bounds, dst **T) error { + n, err := per.DecodeInteger(r, per.Aligned, b) if err != nil { return err } @@ -69,44 +69,44 @@ type WriteReplaceWarningRequest struct { var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return &m.SerialNumber, true }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return &m.SerialNumber, true }, }, { - id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.WarningAreaList) + ID: IDWarningAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.WarningAreaList) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningAreaList) }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningAreaList) }, }, { - id: IDRepetitionPeriod, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - n, err := per.DecodeInteger(per.NewReader(raw), enc, repetitionPeriodBounds) + ID: IDRepetitionPeriod, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, repetitionPeriodBounds) m.RepetitionPeriod = uint16(n) return err }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return integerIE(repetitionPeriodBounds, int64(m.RepetitionPeriod)), true }, }, { - id: IDExtendedRepetitionPeriod, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalInteger(raw, extendedRepetitionPeriodBounds, &m.ExtendedRepetitionPeriod) + ID: IDExtendedRepetitionPeriod, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalInteger(r, extendedRepetitionPeriodBounds, &m.ExtendedRepetitionPeriod) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { if m.ExtendedRepetitionPeriod == nil { return nil, false } @@ -115,62 +115,62 @@ var writeReplaceWarningRequestIEs = []ieSpec[WriteReplaceWarningRequest]{ }, }, { - id: IDNumberofBroadcastRequest, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - n, err := per.DecodeInteger(per.NewReader(raw), enc, numberofBroadcastRequestBounds) + ID: IDNumberofBroadcastRequest, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, numberofBroadcastRequestBounds) m.NumberofBroadcastRequest = uint16(n) return err }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return integerIE(numberofBroadcastRequestBounds, int64(m.NumberofBroadcastRequest)), true }, }, { - id: IDWarningType, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.WarningType) + ID: IDWarningType, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.WarningType) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningType) }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningType) }, }, { - id: IDWarningSecurityInfo, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.WarningSecurityInfo) + ID: IDWarningSecurityInfo, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.WarningSecurityInfo) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningSecurityInfo) }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningSecurityInfo) }, }, { - id: IDDataCodingScheme, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.DataCodingScheme) + ID: IDDataCodingScheme, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.DataCodingScheme) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.DataCodingScheme) }, + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.DataCodingScheme) }, }, { - id: IDWarningMessageContents, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.WarningMessageContents) + ID: IDWarningMessageContents, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.WarningMessageContents) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningMessageContents) }, }, { - id: IDConcurrentWarningMessageIndicator, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.ConcurrentWarningMessageIndicator) + ID: IDConcurrentWarningMessageIndicator, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.ConcurrentWarningMessageIndicator) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.ConcurrentWarningMessageIndicator) }, }, { - id: IDWarningAreaCoordinates, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.WarningAreaCoordinates) + ID: IDWarningAreaCoordinates, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.WarningAreaCoordinates) }, - encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningRequest) (per.Marshaler, bool) { return optionalIE(m.WarningAreaCoordinates) }, }, @@ -200,6 +200,10 @@ func ParseWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, return parseMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, TriggeringInitiatingMessage, writeReplaceWarningRequestIEs, value) } +func DecodeWriteReplaceWarningRequest(value []byte) (*WriteReplaceWarningRequest, error) { + return decodeMessageBody[WriteReplaceWarningRequest](ProcWriteReplaceWarning, writeReplaceWarningRequestIEs, value) +} + type WriteReplaceWarningResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -211,34 +215,34 @@ type WriteReplaceWarningResponse struct { var writeReplaceWarningResponseIEs = []ieSpec[WriteReplaceWarningResponse]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return &m.SerialNumber, true }, + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return &m.SerialNumber, true }, }, { - id: IDBroadcastCompletedAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.BroadcastCompletedAreaList) + ID: IDBroadcastCompletedAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.BroadcastCompletedAreaList) }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return optionalIE(m.BroadcastCompletedAreaList) }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *WriteReplaceWarningResponse, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.CriticalityDiagnostics) + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *WriteReplaceWarningResponse, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CriticalityDiagnostics) }, - encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { + Encode: func(m *WriteReplaceWarningResponse) (per.Marshaler, bool) { return optionalIE(m.CriticalityDiagnostics) }, }, @@ -268,6 +272,10 @@ func ParseWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningRespons return parseMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, TriggeringSuccessfulOutcome, writeReplaceWarningResponseIEs, value) } +func DecodeWriteReplaceWarningResponse(value []byte) (*WriteReplaceWarningResponse, error) { + return decodeMessageBody[WriteReplaceWarningResponse](ProcWriteReplaceWarning, writeReplaceWarningResponseIEs, value) +} + type KillRequest struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -279,32 +287,32 @@ type KillRequest struct { var killRequestIEs = []ieSpec[KillRequest]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *KillRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *KillRequest) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + Encode: func(m *KillRequest) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *KillRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *KillRequest) (per.Marshaler, bool) { return &m.SerialNumber, true }, + Encode: func(m *KillRequest) (per.Marshaler, bool) { return &m.SerialNumber, true }, }, { - id: IDWarningAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.WarningAreaList) + ID: IDWarningAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *KillRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.WarningAreaList) }, - encode: func(m *KillRequest) (per.Marshaler, bool) { return optionalIE(m.WarningAreaList) }, + Encode: func(m *KillRequest) (per.Marshaler, bool) { return optionalIE(m.WarningAreaList) }, }, { - id: IDKillAllWarningMessages, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *KillRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.KillAllWarningMessages) + ID: IDKillAllWarningMessages, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *KillRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.KillAllWarningMessages) }, - encode: func(m *KillRequest) (per.Marshaler, bool) { return optionalIE(m.KillAllWarningMessages) }, + Encode: func(m *KillRequest) (per.Marshaler, bool) { return optionalIE(m.KillAllWarningMessages) }, }, } @@ -332,6 +340,10 @@ func ParseKillRequest(value []byte) (*KillRequest, error) { return parseMessageBody[KillRequest](ProcKill, TriggeringInitiatingMessage, killRequestIEs, value) } +func DecodeKillRequest(value []byte) (*KillRequest, error) { + return decodeMessageBody[KillRequest](ProcKill, killRequestIEs, value) +} + type KillResponse struct { MessageIdentifier MessageIdentifier SerialNumber SerialNumber @@ -343,32 +355,32 @@ type KillResponse struct { var killResponseIEs = []ieSpec[KillResponse]{ { - id: IDMessageIdentifier, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MessageIdentifier) + ID: IDMessageIdentifier, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *KillResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MessageIdentifier) }, - encode: func(m *KillResponse) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, + Encode: func(m *KillResponse) (per.Marshaler, bool) { return &m.MessageIdentifier, true }, }, { - id: IDSerialNumber, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SerialNumber) + ID: IDSerialNumber, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *KillResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SerialNumber) }, - encode: func(m *KillResponse) (per.Marshaler, bool) { return &m.SerialNumber, true }, + Encode: func(m *KillResponse) (per.Marshaler, bool) { return &m.SerialNumber, true }, }, { - id: IDBroadcastCancelledAreaList, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.BroadcastCancelledAreaList) + ID: IDBroadcastCancelledAreaList, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *KillResponse, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.BroadcastCancelledAreaList) }, - encode: func(m *KillResponse) (per.Marshaler, bool) { return optionalIE(m.BroadcastCancelledAreaList) }, + Encode: func(m *KillResponse) (per.Marshaler, bool) { return optionalIE(m.BroadcastCancelledAreaList) }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *KillResponse, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.CriticalityDiagnostics) + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *KillResponse, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CriticalityDiagnostics) }, - encode: func(m *KillResponse) (per.Marshaler, bool) { return optionalIE(m.CriticalityDiagnostics) }, + Encode: func(m *KillResponse) (per.Marshaler, bool) { return optionalIE(m.CriticalityDiagnostics) }, }, } @@ -396,6 +408,10 @@ func ParseKillResponse(value []byte) (*KillResponse, error) { return parseMessageBody[KillResponse](ProcKill, TriggeringSuccessfulOutcome, killResponseIEs, value) } +func DecodeKillResponse(value []byte) (*KillResponse, error) { + return decodeMessageBody[KillResponse](ProcKill, killResponseIEs, value) +} + type PWSRestartIndication struct { ECGIListForRestart []EUTRANCGI GlobalENBID GlobalENBID @@ -407,67 +423,61 @@ type PWSRestartIndication struct { var pWSRestartIndicationIEs = []ieSpec[PWSRestartIndication]{ { - id: IDECGIListForRestart, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + ID: IDECGIListForRestart, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { var err error - m.ECGIListForRestart, err = unmarshalSeqOf[EUTRANCGI](per.NewReader(raw), enc, 1, maxnoofCellsforRestart) + m.ECGIListForRestart, err = unmarshalSeqOf[EUTRANCGI](r, enc, 1, maxnoofCellsforRestart) return err }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { if len(m.ECGIListForRestart) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofCellsforRestart, m.ECGIListForRestart) - }), true + return seqOf(1, maxnoofCellsforRestart, m.ECGIListForRestart), true }, }, { - id: IDGlobalENBID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GlobalENBID) + ID: IDGlobalENBID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GlobalENBID) }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return &m.GlobalENBID, true }, + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { return &m.GlobalENBID, true }, }, { - id: IDTAIListForRestart, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + ID: IDTAIListForRestart, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { var err error - m.TAIListForRestart, err = unmarshalSeqOf[TAI](per.NewReader(raw), enc, 1, maxnoofRestartTAIs) + m.TAIListForRestart, err = unmarshalSeqOf[TAI](r, enc, 1, maxnoofRestartTAIs) return err }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { if len(m.TAIListForRestart) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofRestartTAIs, m.TAIListForRestart) - }), true + return seqOf(1, maxnoofRestartTAIs, m.TAIListForRestart), true }, }, { - id: IDEmergencyAreaIDListForRestart, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *PWSRestartIndication, raw []byte, enc per.Encoding) error { + ID: IDEmergencyAreaIDListForRestart, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *PWSRestartIndication, r *per.Reader, enc per.Encoding) error { var err error - m.EmergencyAreaIDListForRestart, err = unmarshalSeqOf[EmergencyAreaID](per.NewReader(raw), enc, 1, maxnoofRestartEmergencyAreaIDs) + m.EmergencyAreaIDListForRestart, err = unmarshalSeqOf[EmergencyAreaID](r, enc, 1, maxnoofRestartEmergencyAreaIDs) return err }, - encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { + Encode: func(m *PWSRestartIndication) (per.Marshaler, bool) { if len(m.EmergencyAreaIDListForRestart) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofRestartEmergencyAreaIDs, m.EmergencyAreaIDListForRestart) - }), true + return seqOf(1, maxnoofRestartEmergencyAreaIDs, m.EmergencyAreaIDListForRestart), true }, }, } @@ -496,6 +506,10 @@ func ParsePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { return parseMessageBody[PWSRestartIndication](ProcPWSRestartIndication, TriggeringInitiatingMessage, pWSRestartIndicationIEs, value) } +func DecodePWSRestartIndication(value []byte) (*PWSRestartIndication, error) { + return decodeMessageBody[PWSRestartIndication](ProcPWSRestartIndication, pWSRestartIndicationIEs, value) +} + type PWSFailureIndication struct { PWSFailedECGIList []EUTRANCGI GlobalENBID GlobalENBID @@ -505,30 +519,28 @@ type PWSFailureIndication struct { var pWSFailureIndicationIEs = []ieSpec[PWSFailureIndication]{ { - id: IDPWSfailedECGIList, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { + ID: IDPWSfailedECGIList, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSFailureIndication, r *per.Reader, enc per.Encoding) error { var err error - m.PWSFailedECGIList, err = unmarshalSeqOf[EUTRANCGI](per.NewReader(raw), enc, 1, maxnoofCellsineNB) + m.PWSFailedECGIList, err = unmarshalSeqOf[EUTRANCGI](r, enc, 1, maxnoofCellsineNB) return err }, - encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { + Encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { if len(m.PWSFailedECGIList) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return marshalSeqOf(w, enc, 1, maxnoofCellsineNB, m.PWSFailedECGIList) - }), true + return seqOf(1, maxnoofCellsineNB, m.PWSFailedECGIList), true }, }, { - id: IDGlobalENBID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *PWSFailureIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GlobalENBID) + ID: IDGlobalENBID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *PWSFailureIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GlobalENBID) }, - encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return &m.GlobalENBID, true }, + Encode: func(m *PWSFailureIndication) (per.Marshaler, bool) { return &m.GlobalENBID, true }, }, } @@ -555,3 +567,7 @@ func (m *PWSFailureIndication) Marshal() ([]byte, error) { func ParsePWSFailureIndication(value []byte) (*PWSFailureIndication, error) { return parseMessageBody[PWSFailureIndication](ProcPWSFailureIndication, TriggeringInitiatingMessage, pWSFailureIndicationIEs, value) } + +func DecodePWSFailureIndication(value []byte) (*PWSFailureIndication, error) { + return decodeMessageBody[PWSFailureIndication](ProcPWSFailureIndication, pWSFailureIndicationIEs, value) +} diff --git a/s1ap/pws_overload_test.go b/s1ap/pws_overload_test.go index abd3c0b81e..ce244c657d 100644 --- a/s1ap/pws_overload_test.go +++ b/s1ap/pws_overload_test.go @@ -4,24 +4,25 @@ package s1ap import ( + "bytes" "encoding/hex" "errors" "os" - "reflect" "slices" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func pwsPLMN() PLMNIdentity { return PLMNIdentity{0x00, 0xf1, 0x10} } -func pwsECGI(cell uint32) EUTRANCGI { return EUTRANCGI{PLMNIdentity: pwsPLMN(), CellID: cell} } +func pwsECGI(cell CellIdentity) EUTRANCGI { return EUTRANCGI{PLMNIdentity: pwsPLMN(), CellID: cell} } func pwsTAI(tac TAC) TAI { return TAI{PLMNIdentity: pwsPLMN(), TAC: tac} } func pwsENB() GlobalENBID { - return GlobalENBID{PLMNIdentity: pwsPLMN(), ENBID: ENBID{Kind: ENBIDMacro, Value: 0x12345}} + return GlobalENBID{PLMNIdentity: pwsPLMN(), ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x12345))}} } func pwsGUMMEI() GUMMEI { @@ -65,7 +66,7 @@ func newMessageCases() []newMessageCase { { name: "OverloadStart", msg: &OverloadStart{ - OverloadResponse: OverloadResponse{OverloadAction: OverloadActionRejectDelayTolerantAccess}, + OverloadResponse: OverloadResponse{OverloadAction: Ptr(OverloadActionRejectDelayTolerantAccess)}, GUMMEIList: []GUMMEI{pwsGUMMEI()}, TrafficLoadReductionIndication: Ptr(uint8(50)), }, @@ -85,7 +86,7 @@ func newMessageCases() []newMessageCase { msg: &WriteReplaceWarningRequest{ MessageIdentifier: 0x1112, SerialNumber: 0x3000, - WarningAreaList: &WarningAreaList{CellIDList: []EUTRANCGI{pwsECGI(0x1234501), pwsECGI(0x1234502)}}, + WarningAreaList: &WarningAreaList{CellIDList: &ECGIList{pwsECGI(0x1234501), pwsECGI(0x1234502)}}, RepetitionPeriod: 60, ExtendedRepetitionPeriod: Ptr(uint32(5000)), NumberofBroadcastRequest: 0, @@ -105,7 +106,7 @@ func newMessageCases() []newMessageCase { msg: &WriteReplaceWarningRequest{ MessageIdentifier: 0x1100, SerialNumber: 0x0001, - WarningAreaList: &WarningAreaList{TAIList: []TAI{pwsTAI(1)}}, + WarningAreaList: &WarningAreaList{TrackingAreaListforWarning: &TAIListforWarning{pwsTAI(1)}}, RepetitionPeriod: 0, NumberofBroadcastRequest: 1, }, @@ -118,7 +119,7 @@ func newMessageCases() []newMessageCase { msg: &WriteReplaceWarningResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3000, - BroadcastCompletedAreaList: &BroadcastCompletedAreaList{TAIBroadcast: []TAIBroadcastItem{{ + BroadcastCompletedAreaList: &BroadcastCompletedAreaList{TAIBroadcast: &TAIBroadcast{{ TAI: pwsTAI(7), CompletedCellInTAI: []CompletedCellInTAIItem{{ECGI: pwsECGI(0x1234501)}}, }}}, @@ -133,7 +134,7 @@ func newMessageCases() []newMessageCase { msg: &WriteReplaceWarningResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3000, - BroadcastCompletedAreaList: &BroadcastCompletedAreaList{EmergencyAreaIDBroadcast: []EmergencyAreaIDBroadcastItem{{ + BroadcastCompletedAreaList: &BroadcastCompletedAreaList{EmergencyAreaIDBroadcast: &EmergencyAreaIDBroadcast{{ EmergencyAreaID: EmergencyAreaID{0x01, 0x02, 0x03}, CompletedCellInEAI: []CompletedCellInEAIItem{{ECGI: pwsECGI(0x1234501)}}, }}}, @@ -147,7 +148,7 @@ func newMessageCases() []newMessageCase { msg: &KillRequest{ MessageIdentifier: 0x1112, SerialNumber: 0x3000, - WarningAreaList: &WarningAreaList{EmergencyAreaIDList: []EmergencyAreaID{{0x01, 0x02, 0x03}}}, + WarningAreaList: &WarningAreaList{EmergencyAreaIDList: &EmergencyAreaIDList{{0x01, 0x02, 0x03}}}, KillAllWarningMessages: Ptr(KillAllWarningMessagesTrue), }, parse: func(b []byte) (any, error) { return ParseKillRequest(b) }, @@ -159,7 +160,7 @@ func newMessageCases() []newMessageCase { msg: &KillResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3000, - BroadcastCancelledAreaList: &BroadcastCancelledAreaList{CellIDCancelled: []CellIDCancelledItem{ + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{CellIDCancelled: &CellIDCancelled{ {ECGI: pwsECGI(0x1234501), NumberOfBroadcasts: 3}, }}, }, @@ -172,7 +173,7 @@ func newMessageCases() []newMessageCase { msg: &KillResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3000, - BroadcastCancelledAreaList: &BroadcastCancelledAreaList{TAICancelled: []TAICancelledItem{{ + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{TAICancelled: &TAICancelled{{ TAI: pwsTAI(7), CancelledCellInTAI: []CancelledCellInTAIItem{{ECGI: pwsECGI(0x1234501), NumberOfBroadcasts: 300}}, }}}, @@ -186,7 +187,7 @@ func newMessageCases() []newMessageCase { msg: &KillResponse{ MessageIdentifier: 0x1112, SerialNumber: 0x3000, - BroadcastCancelledAreaList: &BroadcastCancelledAreaList{EmergencyAreaIDCancelled: []EmergencyAreaIDCancelledItem{{ + BroadcastCancelledAreaList: &BroadcastCancelledAreaList{EmergencyAreaIDCancelled: &EmergencyAreaIDCancelled{{ EmergencyAreaID: EmergencyAreaID{0x01, 0x02, 0x03}, CancelledCellInEAI: []CancelledCellInEAIItem{{ECGI: pwsECGI(0x1234501), NumberOfBroadcasts: 1}}, }}}, @@ -283,7 +284,7 @@ func TestNewMessagesRoundTrip(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(got, tc.msg) { + if !equalByMethod(got, tc.msg) { t.Errorf("round trip mismatch:\n got %+v\nwant %+v", got, tc.msg) } @@ -355,8 +356,8 @@ func TestNewMessagesWireCriticality(t *testing.T) { } for i := range want { - if got[i].id != want[i].id || got[i].crit != want[i].crit { - t.Errorf("IE %d = {%s, %s}, want {%s, %s}", i, got[i].id, got[i].crit, want[i].id, want[i].crit) + if got[i].ID != want[i].id || got[i].Criticality != want[i].crit { + t.Errorf("IE %d = {%s, %s}, want {%s, %s}", i, got[i].ID, got[i].Criticality, want[i].id, want[i].crit) } } }) @@ -366,49 +367,92 @@ func TestNewMessagesWireCriticality(t *testing.T) { func TestWarningAreaListNeedsExactlyOneAlternative(t *testing.T) { for name, l := range map[string]WarningAreaList{ "none": {}, - "two": {CellIDList: []EUTRANCGI{pwsECGI(1)}, TAIList: []TAI{pwsTAI(1)}}, + "two": {CellIDList: &ECGIList{pwsECGI(1)}, TrackingAreaListforWarning: &TAIListforWarning{pwsTAI(1)}}, } { - if _, err := per.Marshal(l); err == nil { + if _, err := per.Marshal(&l); err == nil { t.Errorf("%s: Marshal() = nil error", name) } } - if _, err := per.Marshal(BroadcastCompletedAreaList{}); err == nil { + if _, err := per.Marshal(&BroadcastCompletedAreaList{}); err == nil { t.Error("empty BroadcastCompletedAreaList encoded") } - if _, err := per.Marshal(BroadcastCancelledAreaList{}); err == nil { + if _, err := per.Marshal(&BroadcastCancelledAreaList{}); err == nil { t.Error("empty BroadcastCancelledAreaList encoded") } } func TestWarningAreaListExtensionAlternativeNotComprehended(t *testing.T) { - var l WarningAreaList - if err := per.Unmarshal([]byte{0x80, 0x01, 0x00}, &l); !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want errNotComprehended", err) + in := []byte{0x80, 0x01, 0x00} + + for _, v := range []interface { + per.Unmarshaler + per.Marshaler + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + }{&WarningAreaList{}, &BroadcastCompletedAreaList{}, &BroadcastCancelledAreaList{}} { + if err := per.Unmarshal(in, v); err != nil { + t.Fatalf("%T: %v", v, err) + } + + if !v.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Errorf("%T: an unknown alternative is reported as comprehended", v) + } + + out, err := per.Marshal(v) + if err != nil { + t.Fatalf("%T: %v", v, err) + } + + if !bytes.Equal(out, in) { + t.Errorf("%T: re-encoded % x, want % x", v, out, in) + } } } func TestOverloadActionExtensionValues(t *testing.T) { for v := OverloadActionRejectNonEmergencyMODT; v <= OverloadActionNotAcceptMODataOrDelayTolerantAccessFromCPCIoT; v++ { - b, err := per.Marshal(OverloadResponse{OverloadAction: v}) + b, err := per.Marshal(&OverloadResponse{OverloadAction: Ptr(v)}) if err != nil { t.Fatalf("%d: %v", v, err) } var got OverloadResponse - if err := per.Unmarshal(b, &got); err != nil || got.OverloadAction != v { - t.Fatalf("%d: got %d, %v", v, got.OverloadAction, err) + if err := per.Unmarshal(b, &got); err != nil || got.OverloadAction == nil || *got.OverloadAction != v { + t.Fatalf("%d: got %v, %v", v, got.OverloadAction, err) } } - if _, err := per.Marshal(OverloadResponse{OverloadAction: 7}); err == nil { - t.Error("undefined OverloadAction encoded") + unknown := OverloadAction(len(enumOverloadAction.Root) + len(enumOverloadAction.Extension)) + + b, err := per.Marshal(&OverloadResponse{OverloadAction: &unknown}) + if err != nil { + t.Fatal(err) } var got OverloadResponse - if err := per.Unmarshal([]byte{0x42, 0x00}, &got); !errors.Is(err, errNotComprehended) { - t.Errorf("unknown extension value: err = %v, want errNotComprehended", err) + if err := per.Unmarshal(b, &got); err != nil || got.OverloadAction == nil || *got.OverloadAction != unknown { + t.Fatalf("unknown extension value: got %v, %v; want it kept", got.OverloadAction, err) + } + + if !got.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Error("an unknown OverloadAction is not reported as not comprehended") + } + + alt := OverloadResponse{Ext: &per.ExtensionAlternative{Index: 3, Value: "\x01\x02"}} + + b, err = per.Marshal(&alt) + if err != nil { + t.Fatal(err) + } + + got = OverloadResponse{} + if err := per.Unmarshal(b, &got); err != nil || got.Ext == nil || *got.Ext != *alt.Ext { + t.Fatalf("unknown extension alternative: got %+v, %v; want it kept", got, err) + } + + if !got.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Error("an unknown OverloadResponse alternative is not reported as not comprehended") } } diff --git a/s1ap/raw_pdu.go b/s1ap/raw_pdu.go index f6899f765f..94a7bcf69b 100644 --- a/s1ap/raw_pdu.go +++ b/s1ap/raw_pdu.go @@ -4,23 +4,25 @@ package s1ap import ( - "errors" - "fmt" + "iter" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/protocolie" + "github.com/ellanetworks/core/per/ap" ) -var ErrIENotPresent = errors.New("s1ap: IE not present") +var ( + ErrIENotPresent = ap.ErrIENotPresent + ErrDuplicateIE = ap.ErrDuplicateIE +) type RawPDU struct { - m *protocolie.Message + m *ap.RawPDU[ProtocolIEID] } func ParseRawPDU(b []byte) (*RawPDU, error) { - m, err := protocolie.Parse(b, func(pc uint8) bool { return ProcedureCode(pc) == ProcPrivateMessage }) + m, err := ap.ParseRawPDU[ProtocolIEID](profile, b) if err != nil { - return nil, fmt.Errorf("s1ap: %w", err) + return nil, err } return &RawPDU{m: m}, nil @@ -30,93 +32,30 @@ func (p *RawPDU) Trigger() TriggeringMessage { return TriggeringMessage(p.m.Choi func (p *RawPDU) ProcedureCode() ProcedureCode { return ProcedureCode(p.m.ProcedureCode()) } -func (p *RawPDU) Criticality() Criticality { return Criticality(p.m.Criticality()) } - -func (p *RawPDU) Len() int { return p.m.Len() } - -func (p *RawPDU) IE(i int) (RawIE, error) { - f, err := p.m.Field(i) - if err != nil { - return RawIE{}, fmt.Errorf("s1ap: %w", err) - } - - return RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value}, nil -} - -func (p *RawPDU) IEs() []RawIE { - fields := p.m.Fields() +func (p *RawPDU) Criticality() Criticality { return p.m.Criticality() } - out := make([]RawIE, len(fields)) - for i, f := range fields { - out[i] = RawIE{ID: ProtocolIEID(f.ID), Criticality: Criticality(f.Criticality), Value: f.Value} - } - - return out -} +func (p *RawPDU) Opaque() bool { return p.m.Opaque() } -func (p *RawPDU) Index(id ProtocolIEID) int { return p.m.Index(uint16(id)) } - -func (p *RawPDU) SetValue(i int, value []byte) error { - if err := p.m.SetValue(i, value); err != nil { - return fmt.Errorf("s1ap: %w", err) - } - - return nil -} - -func (p *RawPDU) Insert(i int, ie RawIE) error { - if err := p.m.Insert(i, protocolie.Field{ID: uint16(ie.ID), Criticality: uint8(ie.Criticality), Value: ie.Value}); err != nil { - return fmt.Errorf("s1ap: %w", err) - } +func (p *RawPDU) Body() []byte { return p.m.Body() } - return nil -} +func (p *RawPDU) Len() int { return p.m.Len() } -func (p *RawPDU) Remove(i int) error { - if err := p.m.Remove(i); err != nil { - return fmt.Errorf("s1ap: %w", err) - } +func (p *RawPDU) IE(i int) (RawIE, error) { return p.m.Field(i) } - return nil -} +func (p *RawPDU) IEs() []RawIE { return p.m.Fields() } -func (p *RawPDU) Marshal() ([]byte, error) { - b, err := p.m.Bytes() - if err != nil { - return nil, fmt.Errorf("s1ap: %w", err) - } +func (p *RawPDU) All(id ProtocolIEID) iter.Seq2[int, RawIE] { return p.m.All(id) } - return b, nil -} +func (p *RawPDU) Index(id ProtocolIEID) (int, error) { return p.m.Index(id) } -func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { - i := p.m.Index(uint16(id)) - if i < 0 { - return false, nil - } +func (p *RawPDU) SetValue(i int, value []byte) error { return p.m.SetValue(i, value) } - f, err := p.m.Field(i) - if err != nil { - return false, fmt.Errorf("s1ap: %w", err) - } - - if err := perIEDecode(f.Value, v); err != nil { - return false, fmt.Errorf("s1ap: IE %s: %w", id, err) - } +func (p *RawPDU) Insert(i int, ie RawIE) error { return p.m.Insert(i, ie) } - return true, nil -} +func (p *RawPDU) Remove(i int) error { return p.m.Remove(i) } -func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { - i := p.m.Index(uint16(id)) - if i < 0 { - return fmt.Errorf("%w: %s", ErrIENotPresent, id) - } +func (p *RawPDU) Marshal() ([]byte, error) { return p.m.Marshal() } - b, err := per.Marshal(v, per.Aligned) - if err != nil { - return fmt.Errorf("s1ap: IE %s: %w", id, err) - } +func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { return p.m.Get(id, v) } - return p.SetValue(i, b) -} +func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { return p.m.Set(id, v) } diff --git a/s1ap/raw_pdu_registry_test.go b/s1ap/raw_pdu_registry_test.go index 415f8f5e14..9f6cee2f38 100644 --- a/s1ap/raw_pdu_registry_test.go +++ b/s1ap/raw_pdu_registry_test.go @@ -556,7 +556,7 @@ func sampleMessages() []typedMessage { &DownlinkUEAssociatedLPPaTransport{}, &ENBConfigurationUpdate{}, &ENBConfigurationUpdateAcknowledge{}, - &ENBConfigurationUpdateFailure{Cause: new(Cause)}, + &ENBConfigurationUpdateFailure{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &ENBStatusTransfer{Container: StatusTransferContainer{0xaa}}, &ERABModificationConfirm{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, &ERABModificationIndication{ToBeModified: []ERABToBeModifiedItemBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA(), DLGTPTEID: 1}}}, @@ -568,16 +568,16 @@ func sampleMessages() []typedMessage { &ERABReleaseResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, &ERABSetupRequest{ERABToBeSetup: []ERABToBeSetupItemBearerSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, NASPDU: NASPDU{0x01}}}}, &ERABSetupResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, - &HandoverCancel{Cause: new(Cause)}, + &HandoverCancel{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &HandoverCancelAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, &HandoverCommand{TargetToSource: TransparentContainer{0x00}}, - &HandoverFailure{MMEUES1APID: new(MMEUES1APID), Cause: new(Cause)}, + &HandoverFailure{MMEUES1APID: new(MMEUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &HandoverNotify{EUTRANCGI: new(EUTRANCGI), TAI: new(TAI)}, - &HandoverPreparationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, - &HandoverRequest{Cause: new(Cause), SourceToTarget: TransparentContainer{0x00}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}}, + &HandoverPreparationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, + &HandoverRequest{Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), SourceToTarget: TransparentContainer{0x00}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}}, &HandoverRequestAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), TargetToSource: TransparentContainer{0x00}, ERABAdmitted: []ERABAdmittedItem{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, - &HandoverRequired{Cause: new(Cause), SourceToTarget: TransparentContainer{0x00}}, - &InitialContextSetupFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, + &HandoverRequired{Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), TargetID: TargetID{TargeteNBID: &TargeteNBID{GlobalENBID: GlobalENBID{ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0))}}}}, SourceToTarget: TransparentContainer{0x00}}, + &InitialContextSetupFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &InitialContextSetupRequest{ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, &InitialContextSetupResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), ERABSetup: []ERABSetupItemCtxtSURes{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, &InitialUEMessage{NASPDU: NASPDU{0x07}, EUTRANCGI: new(EUTRANCGI), RRCEstablishmentCause: new(RRCEstablishmentCause)}, @@ -585,25 +585,25 @@ func sampleMessages() []typedMessage { &MMEConfigurationTransfer{}, &MMEConfigurationUpdate{RelativeMMECapacity: new(uint8)}, &MMEConfigurationUpdateAcknowledge{}, - &MMEConfigurationUpdateFailure{Cause: new(Cause)}, + &MMEConfigurationUpdateFailure{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &MMEStatusTransfer{Container: StatusTransferContainer{0xaa}}, - &NASNonDeliveryIndication{NASPDU: NASPDU{}, Cause: new(Cause)}, - &Paging{UEIdentityIndexValue: new(uint16), STMSI: new(STMSI), CNDomain: new(CNDomain), TAIList: []TAI{{PLMNIdentity: goldPLMN(), TAC: 1}}}, + &NASNonDeliveryIndication{NASPDU: NASPDU{}, Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, + &Paging{UEIdentityIndexValue: new(uint16), UEPagingID: &UEPagingID{STMSI: new(STMSI)}, CNDomain: new(CNDomain), TAIList: TAIList{{TAI: TAI{PLMNIdentity: goldPLMN(), TAC: 1}}}}, &PathSwitchRequest{EUTRANCGI: new(EUTRANCGI), TAI: new(TAI), UESecurityCapabilities: new(UESecurityCapabilities), ERABToBeSwitchedDL: []ERABToBeSwitchedDLItem{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1}}}, &PathSwitchRequestAcknowledge{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, - &PathSwitchRequestFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, - &Reset{Cause: new(Cause), ResetType: ResetType{All: true}}, + &PathSwitchRequestFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, + &Reset{Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), ResetType: ResetType{S1Interface: Ptr(ResetAllResetAll)}}, &ResetAcknowledge{}, - &S1SetupFailure{Cause: new(Cause)}, - &S1SetupRequest{DefaultPagingDRX: new(PagingDRX), SupportedTAs: SupportedTAs{{TAC: 1, BroadcastPLMNs: BPLMNs{goldPLMN()}}}}, + &S1SetupFailure{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, + &S1SetupRequest{GlobalENBID: GlobalENBID{ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0))}}, DefaultPagingDRX: new(PagingDRX), SupportedTAs: SupportedTAs{{TAC: 1, BroadcastPLMNs: BPLMNs{goldPLMN()}}}}, &S1SetupResponse{RelativeMMECapacity: new(uint8), ServedGUMMEIs: ServedGUMMEIs{{ServedPLMNs: []PLMNIdentity{goldPLMN()}, ServedGroupIDs: []MMEGroupID{{0x80, 0x01}}, ServedMMECs: []MMECode{1}}}}, &UECapabilityInfoIndication{UERadioCapability: []byte{}}, - &UEContextModificationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: new(Cause)}, + &UEContextModificationFailure{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID), Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &UEContextModificationRequest{UEAggregateMaximumBitRate: &UEAggregateMaximumBitRate{}}, &UEContextModificationResponse{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, - &UEContextReleaseCommand{Cause: new(Cause)}, + &UEContextReleaseCommand{UES1APIDs: UES1APIDs{MMEUES1APID: Ptr(MMEUES1APID(0))}, Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &UEContextReleaseComplete{MMEUES1APID: new(MMEUES1APID), ENBUES1APID: new(ENBUES1APID)}, - &UEContextReleaseRequest{Cause: new(Cause)}, + &UEContextReleaseRequest{Cause: Ptr(CauseRadioNetworkUnspecified.Cause())}, &UplinkNASTransport{NASPDU: NASPDU{0x07}, EUTRANCGI: new(EUTRANCGI), TAI: new(TAI)}, &UplinkUEAssociatedLPPaTransport{}, } diff --git a/s1ap/raw_pdu_test.go b/s1ap/raw_pdu_test.go index 90191bf3f6..4d109a8475 100644 --- a/s1ap/raw_pdu_test.go +++ b/s1ap/raw_pdu_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) type corpusPDU struct { @@ -167,7 +168,7 @@ func TestRawPDUCorpusIdentity(t *testing.T) { } for i := range ies { - if got[i].ID != ies[i].id || got[i].Criticality != ies[i].crit || !bytes.Equal(got[i].Value, ies[i].value) { + if got[i].ID != ies[i].ID || got[i].Criticality != ies[i].Criticality || !bytes.Equal(got[i].Value, ies[i].Value) { t.Errorf("%s: IE %d differs from decodeIEContainer", c.source, i) } } @@ -202,13 +203,13 @@ func ueIDSetters() []idSetter { field: "MMEUES1APID", set: func(p *RawPDU, v uint64) error { return p.SetMMEUES1APID(MMEUES1APID(v)) }, value: func(v uint64) reflect.Value { return reflect.ValueOf(MMEUES1APID(v)) }, - has: func(p *RawPDU) bool { return p.Index(IDMMEUES1APID) >= 0 }, + has: func(p *RawPDU) bool { return firstIndex(p, IDMMEUES1APID) >= 0 }, }, { field: "ENBUES1APID", set: func(p *RawPDU, v uint64) error { return p.SetENBUES1APID(ENBUES1APID(v)) }, value: func(v uint64) reflect.Value { return reflect.ValueOf(ENBUES1APID(v)) }, - has: func(p *RawPDU) bool { return p.Index(IDENBUES1APID) >= 0 }, + has: func(p *RawPDU) bool { return firstIndex(p, IDENBUES1APID) >= 0 }, }, } } @@ -461,7 +462,7 @@ func TestRawPDUSpliceLocality(t *testing.T) { continue } - target := p.Index(map[string]ProtocolIEID{"MMEUES1APID": IDMMEUES1APID, "ENBUES1APID": IDENBUES1APID}[s.field]) + target := firstIndex(p, map[string]ProtocolIEID{"MMEUES1APID": IDMMEUES1APID, "ENBUES1APID": IDENBUES1APID}[s.field]) if err := s.set(p, v); err != nil { t.Fatal(err) @@ -581,7 +582,7 @@ func TestRawPDUTshark(t *testing.T) { e := expect{source: c.source} - if p.Index(IDMMEUES1APID) >= 0 { + if firstIndex(p, IDMMEUES1APID) >= 0 { if err := p.SetMMEUES1APID(4294967295); err != nil { t.Fatal(err) } @@ -589,7 +590,7 @@ func TestRawPDUTshark(t *testing.T) { e.id1 = strconv.FormatUint(4294967295, 10) } - if p.Index(IDENBUES1APID) >= 0 { + if firstIndex(p, IDENBUES1APID) >= 0 { if err := p.SetENBUES1APID(16777215 - 1); err != nil { t.Fatal(err) } @@ -653,14 +654,30 @@ func hexSpaced(b []byte) string { return strings.Join(parts, " ") } -func TestRawPDURefusesPrivateMessage(t *testing.T) { - b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcPrivateMessage, Criticality: CriticalityIgnore, Value: []byte{0x00, 0x00, 0x00}}) +func TestRawPDUPrivateMessageIsOpaque(t *testing.T) { + body := []byte{0x00, 0x00, 0x00} + + b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcPrivateMessage, Criticality: CriticalityIgnore, Value: body}) + if err != nil { + t.Fatal(err) + } + + p, err := ParseRawPDU(b) if err != nil { t.Fatal(err) } - if _, err := ParseRawPDU(b); err == nil { - t.Fatal("PrivateMessage accepted as a ProtocolIE-Container") + if !p.Opaque() || p.ProcedureCode() != ProcPrivateMessage || p.Len() != 0 || !bytes.Equal(p.Body(), body) { + t.Fatalf("opaque = %v, procedure = %s, len = %d, body = %x", p.Opaque(), p.ProcedureCode(), p.Len(), p.Body()) + } + + if err := p.Insert(0, RawIE{ID: 1, Criticality: CriticalityIgnore, Value: []byte{0x00}}); err == nil { + t.Fatal("Insert into an opaque body succeeded") + } + + out, err := p.Marshal() + if err != nil || !bytes.Equal(out, b) { + t.Fatalf("Marshal = %x (%v), want %x", out, err, b) } } @@ -702,9 +719,9 @@ func TestRawPDUUnmodeledProcedure(t *testing.T) { body.WriteBit(false) if err := encodeIEContainer(body, per.Aligned, []ieField{ - {id: 60000, crit: CriticalityNotify, raw: []byte{0xde, 0xad}}, - {id: IDMMEUES1APID, crit: CriticalityReject, raw: id}, - {id: 60001, crit: CriticalityIgnore, raw: bytes.Repeat([]byte{0xbe}, 200)}, + {ID: 60000, Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0xde, 0xad})}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(id)}, + {ID: 60001, Criticality: CriticalityIgnore, Value: ap.RawValue(bytes.Repeat([]byte{0xbe}, 200))}, }); err != nil { t.Fatal(err) } @@ -786,7 +803,7 @@ func FuzzRawPDU(f *testing.F) { t.Fatalf("same-value replace: %v", err) } - if p.Index(IDMMEUES1APID) < 0 { + if firstIndex(p, IDMMEUES1APID) < 0 { return } diff --git a/s1ap/raw_pdu_ue_ids.go b/s1ap/raw_pdu_ue_ids.go index 1f6cb21d35..988e6d053d 100644 --- a/s1ap/raw_pdu_ue_ids.go +++ b/s1ap/raw_pdu_ue_ids.go @@ -41,4 +41,4 @@ func (p *RawPDU) UES1APIDs() (UES1APIDs, bool, error) { return v, ok, err } -func (p *RawPDU) SetUES1APIDs(v UES1APIDs) error { return p.Set(IDUES1APIDs, v) } +func (p *RawPDU) SetUES1APIDs(v UES1APIDs) error { return p.Set(IDUES1APIDs, &v) } diff --git a/s1ap/raw_pdu_ue_ids_test.go b/s1ap/raw_pdu_ue_ids_test.go index 91a28cc9ec..0149f10f01 100644 --- a/s1ap/raw_pdu_ue_ids_test.go +++ b/s1ap/raw_pdu_ue_ids_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func handUEContextReleaseCommand(t *testing.T, enb uint32) []byte { @@ -17,7 +18,7 @@ func handUEContextReleaseCommand(t *testing.T, enb uint32) []byte { ids := per.NewWriter() ids.WriteBit(false) - mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 0, ues1apIDsChoiceRootCount-1, ues1apIDsPair)) + mustNil(t, per.EncodeConstrainedWholeNumber(ids, enc, 0, 1, 0)) ids.WriteBit(true) ids.WriteBit(true) mustNil(t, MMEUES1APID(7).MarshalPER(ids, enc)) @@ -34,14 +35,14 @@ func handUEContextReleaseCommand(t *testing.T, enb uint32) []byte { })) mustNil(t, per.EncodeOpenTypeBytes(ids, enc, []byte{0x11, 0x22})) - cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + cause, err := per.Marshal(Ptr(CauseMiscControlProcessingOverload.Cause())) mustNil(t, err) body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, enc, []ieField{ - {id: IDUES1APIDs, crit: CriticalityReject, raw: ids.Bytes()}, - {id: IDCause, crit: CriticalityIgnore, raw: cause}, + {ID: IDUES1APIDs, Criticality: CriticalityReject, Value: ap.RawValue(ids.Bytes())}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUEContextRelease, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -61,7 +62,7 @@ func TestRawPDUUES1APIDsKeepPairExtensions(t *testing.T) { t.Fatalf("UES1APIDs() = %v, %v", ok, err) } - if !ids.Pair || ids.MMEUES1APID != 7 || ids.ENBUES1APID != 1 { + if ids.UES1APIDPair == nil || ids.UES1APIDPair.MMEUES1APID != 7 || ids.UES1APIDPair.ENBUES1APID != 1 { t.Fatalf("UES1APIDs() = %+v", ids) } @@ -74,7 +75,7 @@ func TestRawPDUUES1APIDsKeepPairExtensions(t *testing.T) { t.Fatalf("unchanged set:\n got %x\nwant %x", got, in) } - ids.ENBUES1APID = 9 + ids.UES1APIDPair.ENBUES1APID = 9 mustNil(t, p.SetUES1APIDs(ids)) got, err = p.Marshal() diff --git a/s1ap/rel19_test.go b/s1ap/rel19_test.go new file mode 100644 index 0000000000..37f7d8a752 --- /dev/null +++ b/s1ap/rel19_test.go @@ -0,0 +1,242 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "encoding/hex" + "testing" + + "github.com/ellanetworks/core/per" +) + +type rel19Case struct { + name string + msg interface{ Marshal() ([]byte, error) } + id ProtocolIEID + crit Criticality + value []byte + parse func(b []byte) (interface{ Marshal() ([]byte, error) }, error) +} + +func rel19MessageCases(t *testing.T) []rel19Case { + t.Helper() + + tunnel := TunnelInformation{TransportLayerAddress: tlaOf(192, 0, 2, 9), UDPPortNumber: &PortNumber{0x08, 0x68}} + + return []rel19Case{ + { + name: "HandoverRequest/TimeRefDistribution", + msg: &HandoverRequest{ + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), ERABToBeSetup: ERABToBeSetupListHOReq{{ERABID: 5, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}, + SourceToTarget: TransparentContainer{0x00}, TimeRefDistribution: Ptr(TimeRefDistributionTrue), + }, + id: IDTimeRefDistribution, crit: CriticalityIgnore, value: []byte{0x00}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { return ParseHandoverRequest(b) }, + }, + { + name: "PathSwitchRequestAcknowledge/TimeRefDistribution", + msg: &PathSwitchRequestAcknowledge{MMEUES1APID: Ptr(MMEUES1APID(1)), ENBUES1APID: Ptr(ENBUES1APID(2)), TimeRefDistribution: Ptr(TimeRefDistributionTrue)}, + id: IDTimeRefDistribution, crit: CriticalityIgnore, value: []byte{0x00}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return ParsePathSwitchRequestAcknowledge(b) + }, + }, + { + name: "InitialContextSetupRequest/CoarseUELocation", + msg: &InitialContextSetupRequest{MMEUES1APID: 1, ENBUES1APID: 2, ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}, CoarseUELocation: &CoarseUELocation{0x11, 0x22}}, + id: IDCoarseUELocation, crit: CriticalityIgnore, value: []byte{0x02, 0x11, 0x22}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return ParseInitialContextSetupRequest(b) + }, + }, + { + name: "InitialContextSetupRequest/TimeRefDistribution", + msg: &InitialContextSetupRequest{MMEUES1APID: 1, ENBUES1APID: 2, ERABToBeSetup: []ERABToBeSetupItemCtxtSUReq{{ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1}}, TimeRefDistribution: Ptr(TimeRefDistributionTrue)}, + id: IDTimeRefDistribution, crit: CriticalityIgnore, value: []byte{0x00}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return ParseInitialContextSetupRequest(b) + }, + }, + { + name: "UEContextModificationRequest/TimeRefDistribution", + msg: &UEContextModificationRequest{MMEUES1APID: 1, ENBUES1APID: 2, TimeRefDistribution: Ptr(TimeRefDistributionTrue)}, + id: IDTimeRefDistribution, crit: CriticalityIgnore, value: []byte{0x00}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { + return ParseUEContextModificationRequest(b) + }, + }, + { + name: "DownlinkNASTransport/CoarseUELocation", + msg: &DownlinkNASTransport{MMEUES1APID: 1, ENBUES1APID: 2, NASPDU: NASPDU{0x07}, CoarseUELocation: &CoarseUELocation{0x33}}, + id: IDCoarseUELocation, crit: CriticalityIgnore, value: []byte{0x01, 0x33}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { return ParseDownlinkNASTransport(b) }, + }, + { + name: "InitialUEMessage/CoarseUELocationRequested", + msg: &InitialUEMessage{ENBUES1APID: 2, NASPDU: NASPDU{0x07}, TAI: TAI{PLMNIdentity: goldPLMN(), TAC: 1}, EUTRANCGI: &EUTRANCGI{PLMNIdentity: goldPLMN(), CellID: 1}, RRCEstablishmentCause: Ptr(RRCCauseMOSignalling), CoarseUELocationRequested: Ptr(CoarseUELocationRequestedTrue)}, + id: IDCoarseUELocationRequested, crit: CriticalityIgnore, value: []byte{0x00}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { return ParseInitialUEMessage(b) }, + }, + { + name: "InitialUEMessage/GW-TransportLayerAddress", + msg: &InitialUEMessage{ENBUES1APID: 2, NASPDU: NASPDU{0x07}, TAI: TAI{PLMNIdentity: goldPLMN(), TAC: 1}, EUTRANCGI: &EUTRANCGI{PLMNIdentity: goldPLMN(), CellID: 1}, RRCEstablishmentCause: Ptr(RRCCauseMOSignalling), GWTransportLayerAddress: Ptr(tlaOf(192, 0, 2, 1))}, + id: IDGWTransportLayerAddress, crit: CriticalityIgnore, value: []byte{0x0f, 0x80, 0xc0, 0x00, 0x02, 0x01}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { return ParseInitialUEMessage(b) }, + }, + { + name: "UplinkNASTransport/SIPTO-L-GW-TransportLayerAddress", + msg: &UplinkNASTransport{MMEUES1APID: 1, ENBUES1APID: 2, NASPDU: NASPDU{0x07}, EUTRANCGI: &EUTRANCGI{PLMNIdentity: goldPLMN(), CellID: 1}, TAI: &TAI{PLMNIdentity: goldPLMN(), TAC: 1}, SIPTOLGWTransportLayerAddress: Ptr(tlaOf(192, 0, 2, 1))}, + id: IDSIPTOLGWTransportLayerAddress, crit: CriticalityIgnore, value: []byte{0x0f, 0x80, 0xc0, 0x00, 0x02, 0x01}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { return ParseUplinkNASTransport(b) }, + }, + { + name: "HandoverNotify/Tunnel-Information-for-BBF", + msg: &HandoverNotify{MMEUES1APID: 1, ENBUES1APID: 2, EUTRANCGI: &EUTRANCGI{PLMNIdentity: goldPLMN(), CellID: 1}, TAI: &TAI{PLMNIdentity: goldPLMN(), TAC: 1}, TunnelInformationForBBF: &tunnel}, + id: IDTunnelInformationForBBF, crit: CriticalityIgnore, value: []byte{0x41, 0xf0, 0xc0, 0x00, 0x02, 0x09, 0x08, 0x68}, + parse: func(b []byte) (interface{ Marshal() ([]byte, error) }, error) { return ParseHandoverNotify(b) }, + }, + } +} + +func TestRel19AndCarrierMessageIEs(t *testing.T) { + for _, tc := range rel19MessageCases(t) { + t.Run(tc.name, func(t *testing.T) { + b, err := tc.msg.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + body := pdu.value() + + field := findField(t, body, tc.id) + if field.Criticality != tc.crit || !bytes.Equal(field.Value, tc.value) { + t.Fatalf("IE %s = %s % x, want %s % x", tc.id, field.Criticality, field.Value, tc.crit, tc.value) + } + + out, err := tc.parse(body) + if err != nil { + t.Fatalf("parse: %v", err) + } + + again, err := out.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(again, b) { + t.Fatalf("re-encoded\n got % x\nwant % x", again, b) + } + }) + } +} + +func findField(t *testing.T, body []byte, id ProtocolIEID) rawIE { + t.Helper() + + r := per.NewReader(body) + if _, err := r.ReadBit(); err != nil { + t.Fatal(err) + } + + fields, err := decodeIEContainer(r, per.Aligned) + if err != nil { + t.Fatal(err) + } + + for _, f := range fields { + if f.ID == id { + return f + } + } + + t.Fatalf("IE %s not in the message", id) + + return rawIE{} +} + +func TestS1RemovalProcedure(t *testing.T) { + req := &S1RemovalRequest{GlobalENBID: GlobalENBID{PLMNIdentity: goldPLMN(), ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x12345))}}} + + b, err := req.Marshal() + if err != nil { + t.Fatal(err) + } + + if got, want := hex.EncodeToString(b), "0043000f000001003b00080000f11000123450"; got != want { + t.Fatalf("S1 REMOVAL REQUEST = %s, want %s", got, want) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + got, err := ParseS1RemovalRequest(pdu.value()) + if err != nil { + t.Fatal(err) + } + + if !got.GlobalENBID.Equal(req.GlobalENBID) { + t.Fatalf("Global-ENB-ID = %+v", got.GlobalENBID) + } + + resp := &S1RemovalResponse{MMEName: Ptr(Name("mme1"))} + + b, err = resp.Marshal() + if err != nil { + t.Fatal(err) + } + + if pdu, err = Unmarshal(b); err != nil { + t.Fatal(err) + } + + if so, ok := pdu.(*SuccessfulOutcome); !ok || so.ProcedureCode != ProcS1Removal || so.Criticality != CriticalityReject { + t.Fatalf("response PDU = %+v", pdu) + } + + r, err := ParseS1RemovalResponse(pdu.value()) + if err != nil || r.MMEName == nil || *r.MMEName != "mme1" { + t.Fatalf("response = %+v, %v", r, err) + } + + fail := &S1RemovalFailure{Cause: Ptr(CauseMiscUnspecified.Cause())} + + b, err = fail.Marshal() + if err != nil { + t.Fatal(err) + } + + if pdu, err = Unmarshal(b); err != nil { + t.Fatal(err) + } + + if uo, ok := pdu.(*UnsuccessfulOutcome); !ok || uo.ProcedureCode != ProcS1Removal { + t.Fatalf("failure PDU = %+v", pdu) + } + + f, err := ParseS1RemovalFailure(pdu.value()) + if err != nil || f.Cause == nil || !f.Cause.Equal(CauseMiscUnspecified.Cause()) { + t.Fatalf("failure = %+v, %v", f, err) + } + + missing, err := DecodeS1RemovalFailure(container(t)) + if err != nil { + t.Fatal(err) + } + + if d := missing.Diagnostics(); len(d.IEs) != 1 || d.IEs[0].ID != IDCause { + t.Fatalf("diagnostics = %+v, want the missing Cause", d) + } + + if ProcS1Removal != 67 { + t.Fatalf("ProcS1Removal = %d", ProcS1Removal) + } +} diff --git a/s1ap/reroute_nas.go b/s1ap/reroute_nas.go index 9c2aa565bb..57f2c520d7 100644 --- a/s1ap/reroute_nas.go +++ b/s1ap/reroute_nas.go @@ -27,10 +27,10 @@ func (s *S1Message) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } type AdditionalGUTI struct { - _ [0]struct{} `per:"extseq"` - GUMMEI GUMMEI - MTMSI MTMSI - _ ieExtensions `per:",skip"` + extensions per.ExtensionAdditions `per:",extraw"` + GUMMEI GUMMEI + MTMSI MTMSI + iEExtensions extensionMeta `per:",exttable"` } type RerouteNASRequest struct { @@ -46,25 +46,25 @@ type RerouteNASRequest struct { var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDMMEUES1APID, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalIE(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.MMEUES1APID) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return optionalIE(m.MMEUES1APID) }, + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return optionalIE(m.MMEUES1APID) }, }, { - id: IDS1Message, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.S1Message) + ID: IDS1Message, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.S1Message) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { if m.S1Message == nil { return nil, false } @@ -73,18 +73,18 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ }, }, { - id: IDMMEGroupID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEGroupID) + ID: IDMMEGroupID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEGroupID) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return &m.MMEGroupID, true }, + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { return &m.MMEGroupID, true }, }, { - id: IDAdditionalGUTI, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { + ID: IDAdditionalGUTI, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { var v AdditionalGUTI - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -92,7 +92,7 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ return nil }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { if m.AdditionalGUTI == nil { return nil, false } @@ -101,11 +101,11 @@ var rerouteNASRequestIEs = []ieSpec[RerouteNASRequest]{ }, }, { - id: IDUEUsageType, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *RerouteNASRequest, raw []byte, enc per.Encoding) error { - return decodeOptionalInteger(raw, uEUsageTypeBounds, &m.UEUsageType) + ID: IDUEUsageType, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *RerouteNASRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalInteger(r, uEUsageTypeBounds, &m.UEUsageType) }, - encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { + Encode: func(m *RerouteNASRequest) (per.Marshaler, bool) { if m.UEUsageType == nil { return nil, false } @@ -138,3 +138,7 @@ func (m *RerouteNASRequest) Marshal() ([]byte, error) { func ParseRerouteNASRequest(value []byte) (*RerouteNASRequest, error) { return parseMessageBody[RerouteNASRequest](ProcRerouteNASRequest, TriggeringInitiatingMessage, rerouteNASRequestIEs, value) } + +func DecodeRerouteNASRequest(value []byte) (*RerouteNASRequest, error) { + return decodeMessageBody[RerouteNASRequest](ProcRerouteNASRequest, rerouteNASRequestIEs, value) +} diff --git a/s1ap/reset.go b/s1ap/reset.go index e0579b9b94..2f2478031d 100644 --- a/s1ap/reset.go +++ b/s1ap/reset.go @@ -4,94 +4,45 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) // TS 36.413, S1AP-Constants. const maxnoofIndividualS1ConnectionsToReset = 256 -// ResetType CHOICE root alternatives, defined inline in the RESET of TS 36.413 -// §9.1.8.1. The CHOICE is extensible, so an extension bit precedes the index. -const ( - resetTypeS1Interface = iota - resetTypePartOfS1Interface - - resetTypeChoiceRootCount = 2 -) - // ResetAll ::= ENUMERATED { reset-all, ... }. -const resetAllRootCount = 1 +type ResetAll uint8 + +const ResetAllResetAll ResetAll = 0 // TS 36.413. Both identities are optional; an item may carry either or both. type UEAssociatedLogicalS1ConnectionItem struct { - MMEUES1APID *MMEUES1APID `per:",optional"` - ENBUES1APID *ENBUES1APID `per:",optional"` - iEExtensions *rawIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` -} - -// All selects s1-Interface, resetting the whole interface; otherwise Part -// selects partOfS1-Interface, the connections to reset. -type ResetType struct { - All bool - Part []UEAssociatedLogicalS1ConnectionItem + MMEUES1APID *MMEUES1APID `per:",optional"` + ENBUES1APID *ENBUES1APID `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } -func (t ResetType) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - - if t.All { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, resetTypeChoiceRootCount-1, resetTypeS1Interface); err != nil { - return err - } - - return encodeRootEnumerated(w, enc, resetAllRootCount, 0, "ResetAll") - } +type UEAssociatedLogicalS1ConnectionListRes []UEAssociatedLogicalS1ConnectionItem - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, resetTypeChoiceRootCount-1, resetTypePartOfS1Interface); err != nil { - return err - } - - return encodeSingleContainerList(w, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityReject, t.Part) +func (l UEAssociatedLogicalS1ConnectionListRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityReject, l) } -func (t *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return fmt.Errorf("s1ap: ResetType choice: %w", err) - } - - if isExt { - // §10.3.1 case 6: handled on criticality, not by abandoning the RESET. - return fmt.Errorf("%w: ResetType extension alternative", errNotComprehended) - } - - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, resetTypeChoiceRootCount-1) - if err != nil { - return fmt.Errorf("s1ap: ResetType choice: %w", err) - } - - switch idx { - case resetTypeS1Interface: - if _, err := decodeRootEnumerated(r, enc, resetAllRootCount, "ResetAll"); err != nil { - return fmt.Errorf("s1ap: ResetAll: %w", err) - } - - *t = ResetType{All: true} - - return nil - default: - items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](r, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityReject) - if err != nil { - return err - } +func (l *UEAssociatedLogicalS1ConnectionListRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](r, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityReject) + *l = items - *t = ResetType{Part: items} + return err +} - return nil - } +// ResetType ::= CHOICE { s1-Interface ResetAll, partOfS1-Interface +// UE-associatedLogicalS1-ConnectionListRes, ... } (TS 36.413 §9.1.8.1). +type ResetType struct { + S1Interface *ResetAll `per:",choice:0"` + PartOfS1Interface *UEAssociatedLogicalS1ConnectionListRes `per:",choice:1"` + Ext *per.ExtensionAlternative `per:",extalt"` } // TS 36.413 §9.1.8.1. @@ -104,11 +55,11 @@ type Reset struct { var resetIEs = []ieSpec[Reset]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *Reset, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *Reset, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -116,7 +67,7 @@ var resetIEs = []ieSpec[Reset]{ return nil }, - encode: func(m *Reset) (per.Marshaler, bool) { + Encode: func(m *Reset) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -125,11 +76,11 @@ var resetIEs = []ieSpec[Reset]{ }, }, { - id: IDResetType, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *Reset, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ResetType) + ID: IDResetType, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *Reset, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ResetType) }, - encode: func(m *Reset) (per.Marshaler, bool) { return &m.ResetType, true }, + Encode: func(m *Reset) (per.Marshaler, bool) { return &m.ResetType, true }, }, } @@ -157,6 +108,10 @@ func ParseReset(value []byte) (*Reset, error) { return parseMessageBody[Reset](ProcReset, TriggeringInitiatingMessage, resetIEs, value) } +func DecodeReset(value []byte) (*Reset, error) { + return decodeMessageBody[Reset](ProcReset, resetIEs, value) +} + // TS 36.413 §9.1.8.2. type ResetAcknowledge struct { ConnectionList []UEAssociatedLogicalS1ConnectionItem @@ -168,9 +123,9 @@ type ResetAcknowledge struct { // The message has no mandatory IE. var resetAcknowledgeIEs = []ieSpec[ResetAcknowledge]{ { - id: IDUEAssociatedLogicalS1ConnectionListResAck, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ResetAcknowledge, raw []byte, enc per.Encoding) error { - items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](per.NewReader(raw), enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityIgnore) + ID: IDUEAssociatedLogicalS1ConnectionListResAck, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ResetAcknowledge, r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[UEAssociatedLogicalS1ConnectionItem](r, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityIgnore) if err != nil { return err } @@ -179,21 +134,19 @@ var resetAcknowledgeIEs = []ieSpec[ResetAcknowledge]{ return nil }, - encode: func(m *ResetAcknowledge) (per.Marshaler, bool) { + Encode: func(m *ResetAcknowledge) (per.Marshaler, bool) { if len(m.ConnectionList) == 0 { return nil, false } - return per.MarshalerFunc(func(w *per.Writer, enc per.Encoding) error { - return encodeSingleContainerList(w, enc, maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityIgnore, m.ConnectionList) - }), true + return containerList(maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityIgnore, m.ConnectionList), true }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *ResetAcknowledge, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *ResetAcknowledge, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -201,7 +154,7 @@ var resetAcknowledgeIEs = []ieSpec[ResetAcknowledge]{ return nil }, - encode: func(m *ResetAcknowledge) (per.Marshaler, bool) { + Encode: func(m *ResetAcknowledge) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -234,3 +187,7 @@ func (m *ResetAcknowledge) Marshal() ([]byte, error) { func ParseResetAcknowledge(value []byte) (*ResetAcknowledge, error) { return parseMessageBody[ResetAcknowledge](ProcReset, TriggeringSuccessfulOutcome, resetAcknowledgeIEs, value) } + +func DecodeResetAcknowledge(value []byte) (*ResetAcknowledge, error) { + return decodeMessageBody[ResetAcknowledge](ProcReset, resetAcknowledgeIEs, value) +} diff --git a/s1ap/reset_extensions_test.go b/s1ap/reset_extensions_test.go index 08315b122a..8c7ac3aac1 100644 --- a/s1ap/reset_extensions_test.go +++ b/s1ap/reset_extensions_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) type handItem struct { @@ -78,7 +79,7 @@ func encodeHandList(t *testing.T, w *per.Writer, crit Criticality, items []handI mustNil(t, per.EncodeLength(w, per.Aligned, 1, maxnoofIndividualS1ConnectionsToReset, true, int64(len(items)), func(int64) error { for _, it := range items { - if err := encodeContainerField(w, per.Aligned, ieField{id: IDUEAssociatedLogicalS1ConnectionItem, crit: crit, raw: encodeHandItem(t, it)}); err != nil { + if err := encodeContainerField(w, per.Aligned, ieField{ID: IDUEAssociatedLogicalS1ConnectionItem, Criticality: crit, Value: ap.RawValue(encodeHandItem(t, it))}); err != nil { return err } } @@ -92,17 +93,17 @@ func handReset(t *testing.T, items []handItem) []byte { rt := per.NewWriter() rt.WriteBit(false) - mustNil(t, per.EncodeConstrainedWholeNumber(rt, per.Aligned, 0, resetTypeChoiceRootCount-1, resetTypePartOfS1Interface)) + mustNil(t, per.EncodeConstrainedWholeNumber(rt, per.Aligned, 0, 1, 1)) encodeHandList(t, rt, CriticalityReject, items) - cause, err := per.Marshal(&Cause{Group: CauseGroupMisc, Value: 0}) + cause, err := per.Marshal(Ptr(CauseMiscControlProcessingOverload.Cause())) mustNil(t, err) body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {id: IDCause, crit: CriticalityIgnore, raw: cause}, - {id: IDResetType, crit: CriticalityReject, raw: rt.Bytes()}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, + {ID: IDResetType, Criticality: CriticalityReject, Value: ap.RawValue(rt.Bytes())}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcReset, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -120,7 +121,7 @@ func handResetAck(t *testing.T, items []handItem) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {id: IDUEAssociatedLogicalS1ConnectionListResAck, crit: CriticalityIgnore, raw: list.Bytes()}, + {ID: IDUEAssociatedLogicalS1ConnectionListResAck, Criticality: CriticalityIgnore, Value: ap.RawValue(list.Bytes())}, })) b, err := Marshal(&SuccessfulOutcome{ProcedureCode: ProcReset, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -156,10 +157,11 @@ func TestResetPreservesItemExtensions(t *testing.T) { t.Fatalf("unmodified Reset re-encoded differently\n got % x\nwant % x", out, in) } - for i := range m.ResetType.Part { - if m.ResetType.Part[i].MMEUES1APID != nil { - v := *m.ResetType.Part[i].MMEUES1APID + 0x10000000 - 5 - m.ResetType.Part[i].MMEUES1APID = &v + part := *m.ResetType.PartOfS1Interface + for i := range part { + if part[i].MMEUES1APID != nil { + v := *part[i].MMEUES1APID + 0x10000000 - 5 + part[i].MMEUES1APID = &v } } @@ -208,6 +210,13 @@ func TestResetItemRejectExtensionNotComprehended(t *testing.T) { pdu, err := Unmarshal(in) mustNil(t, err) + m, err := DecodeReset(pdu.value()) + mustNil(t, err) + + if out, err := m.Marshal(); err != nil || !bytes.Equal(out, in) { + t.Fatalf("re-encode = % x, %v; want % x", out, err, in) + } + if _, err := ParseReset(pdu.value()); err == nil { t.Fatal("reject-criticality item extension accepted") } diff --git a/s1ap/reset_test.go b/s1ap/reset_test.go index 454f1742b9..21fdec3898 100644 --- a/s1ap/reset_test.go +++ b/s1ap/reset_test.go @@ -10,9 +10,9 @@ import ( ) func TestResetRoundTripsResetAll(t *testing.T) { - cause := Cause{Group: CauseGroupMisc, Value: 0} + cause := CauseMiscControlProcessingOverload.Cause() - in := &Reset{Cause: &cause, ResetType: ResetType{All: true}} + in := &Reset{Cause: &cause, ResetType: ResetType{S1Interface: Ptr(ResetAllResetAll)}} b, err := in.Marshal() if err != nil { @@ -34,27 +34,27 @@ func TestResetRoundTripsResetAll(t *testing.T) { t.Fatal(err) } - if !out.ResetType.All { - t.Fatalf("ResetType.All = false, want true") + if out.ResetType.S1Interface == nil || *out.ResetType.S1Interface != ResetAllResetAll { + t.Fatalf("ResetType.S1Interface = %v, want reset-all", out.ResetType.S1Interface) } - if len(out.ResetType.Part) != 0 { - t.Fatalf("ResetType.Part = %v, want empty", out.ResetType.Part) + if out.ResetType.PartOfS1Interface != nil { + t.Fatalf("ResetType.PartOfS1Interface = %v, want nil", out.ResetType.PartOfS1Interface) } - if deref(out.Cause) != cause { + if !deref(out.Cause).Equal(cause) { t.Fatalf("Cause = %+v, want %+v", out.Cause, cause) } } func TestResetRoundTripsPartOfInterface(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: 0} + cause := CauseRadioNetworkUnspecified.Cause() mme := MMEUES1APID(42) enb := ENBUES1APID(7) in := &Reset{ Cause: &cause, - ResetType: ResetType{Part: []UEAssociatedLogicalS1ConnectionItem{ + ResetType: ResetType{PartOfS1Interface: &UEAssociatedLogicalS1ConnectionListRes{ {MMEUES1APID: &mme, ENBUES1APID: &enb}, {ENBUES1APID: &enb}, }}, @@ -75,21 +75,23 @@ func TestResetRoundTripsPartOfInterface(t *testing.T) { t.Fatal(err) } - if out.ResetType.All { - t.Fatalf("ResetType.All = true, want false") + if out.ResetType.S1Interface != nil { + t.Fatalf("ResetType.S1Interface = %v, want nil", out.ResetType.S1Interface) } - if len(out.ResetType.Part) != 2 { - t.Fatalf("ResetType.Part length = %d, want 2", len(out.ResetType.Part)) + if out.ResetType.PartOfS1Interface == nil || len(*out.ResetType.PartOfS1Interface) != 2 { + t.Fatalf("ResetType.PartOfS1Interface = %v, want 2 items", out.ResetType.PartOfS1Interface) } - first := out.ResetType.Part[0] + part := *out.ResetType.PartOfS1Interface + + first := part[0] if first.MMEUES1APID == nil || *first.MMEUES1APID != mme || first.ENBUES1APID == nil || *first.ENBUES1APID != enb { t.Fatalf("first item = %+v, want mme=%d enb=%d", first, mme, enb) } - second := out.ResetType.Part[1] + second := part[1] if second.MMEUES1APID != nil || second.ENBUES1APID == nil || *second.ENBUES1APID != enb { t.Fatalf("second item = %+v, want only enb=%d", second, enb) } @@ -160,7 +162,7 @@ func TestResetAcknowledgeRoundTripsWithList(t *testing.T) { // encoded. func TestResetTypeRejectsEmptyPart(t *testing.T) { w := per.NewWriter() - if err := (ResetType{Part: []UEAssociatedLogicalS1ConnectionItem{}}).MarshalPER(w, per.Aligned); err == nil { + if err := (&ResetType{PartOfS1Interface: &UEAssociatedLogicalS1ConnectionListRes{}}).MarshalPER(w, per.Aligned); err == nil { t.Fatal("encode accepted an empty partOfS1-Interface list") } } diff --git a/s1ap/s1_removal.go b/s1ap/s1_removal.go new file mode 100644 index 0000000000..f320ce0087 --- /dev/null +++ b/s1ap/s1_removal.go @@ -0,0 +1,156 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "github.com/ellanetworks/core/per" +) + +type S1RemovalRequest struct { + GlobalENBID GlobalENBID + + messageMeta +} + +var s1RemovalRequestIEs = []ieSpec[S1RemovalRequest]{ + { + ID: IDGlobalENBID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *S1RemovalRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GlobalENBID) + }, + Encode: func(m *S1RemovalRequest) (per.Marshaler, bool) { return &m.GlobalENBID, true }, + }, +} + +func (m *S1RemovalRequest) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcS1Removal, s1RemovalRequestIEs, m) +} + +func (m *S1RemovalRequest) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&InitiatingMessage{ + ProcedureCode: ProcS1Removal, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseS1RemovalRequest(value []byte) (*S1RemovalRequest, error) { + return parseMessageBody[S1RemovalRequest](ProcS1Removal, TriggeringInitiatingMessage, s1RemovalRequestIEs, value) +} + +func DecodeS1RemovalRequest(value []byte) (*S1RemovalRequest, error) { + return decodeMessageBody[S1RemovalRequest](ProcS1Removal, s1RemovalRequestIEs, value) +} + +type S1RemovalResponse struct { + MMEName *Name + CriticalityDiagnostics *CriticalityDiagnostics + + messageMeta +} + +var s1RemovalResponseIEs = []ieSpec[S1RemovalResponse]{ + { + ID: IDMMEname, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1RemovalResponse, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.MMEName) + }, + Encode: func(m *S1RemovalResponse) (per.Marshaler, bool) { return optionalIE(m.MMEName) }, + }, + { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1RemovalResponse, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CriticalityDiagnostics) + }, + Encode: func(m *S1RemovalResponse) (per.Marshaler, bool) { return optionalIE(m.CriticalityDiagnostics) }, + }, +} + +func (m *S1RemovalResponse) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcS1Removal, s1RemovalResponseIEs, m) +} + +func (m *S1RemovalResponse) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&SuccessfulOutcome{ + ProcedureCode: ProcS1Removal, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseS1RemovalResponse(value []byte) (*S1RemovalResponse, error) { + return parseMessageBody[S1RemovalResponse](ProcS1Removal, TriggeringSuccessfulOutcome, s1RemovalResponseIEs, value) +} + +func DecodeS1RemovalResponse(value []byte) (*S1RemovalResponse, error) { + return decodeMessageBody[S1RemovalResponse](ProcS1Removal, s1RemovalResponseIEs, value) +} + +type S1RemovalFailure struct { + Cause *Cause + CriticalityDiagnostics *CriticalityDiagnostics + + messageMeta +} + +var s1RemovalFailureIEs = []ieSpec[S1RemovalFailure]{ + { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *S1RemovalFailure, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.Cause) + }, + Encode: func(m *S1RemovalFailure) (per.Marshaler, bool) { return optionalIE(m.Cause) }, + }, + { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1RemovalFailure, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.CriticalityDiagnostics) + }, + Encode: func(m *S1RemovalFailure) (per.Marshaler, bool) { return optionalIE(m.CriticalityDiagnostics) }, + }, +} + +func (m *S1RemovalFailure) encodeBody(w *per.Writer, enc per.Encoding) error { + return encodeMessageBody(w, enc, ProcS1Removal, s1RemovalFailureIEs, m) +} + +func (m *S1RemovalFailure) Marshal() ([]byte, error) { + w := per.NewWriter() + + if err := m.encodeBody(w, per.Aligned); err != nil { + return nil, err + } + + w.AlignToByte() + + return Marshal(&UnsuccessfulOutcome{ + ProcedureCode: ProcS1Removal, + Criticality: CriticalityReject, + Value: w.Bytes(), + }) +} + +func ParseS1RemovalFailure(value []byte) (*S1RemovalFailure, error) { + return parseMessageBody[S1RemovalFailure](ProcS1Removal, TriggeringUnsuccessfulOutcome, s1RemovalFailureIEs, value) +} + +func DecodeS1RemovalFailure(value []byte) (*S1RemovalFailure, error) { + return decodeMessageBody[S1RemovalFailure](ProcS1Removal, s1RemovalFailureIEs, value) +} diff --git a/s1ap/s1_setup.go b/s1ap/s1_setup.go index caf1d559f0..d86f5f9d8c 100644 --- a/s1ap/s1_setup.go +++ b/s1ap/s1_setup.go @@ -21,27 +21,27 @@ type S1SetupRequest struct { var s1SetupRequestIEs = []ieSpec[S1SetupRequest]{ { - id: IDGlobalENBID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *S1SetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.GlobalENBID) + ID: IDGlobalENBID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *S1SetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.GlobalENBID) }, - encode: func(m *S1SetupRequest) (per.Marshaler, bool) { return &m.GlobalENBID, true }, + Encode: func(m *S1SetupRequest) (per.Marshaler, bool) { return &m.GlobalENBID, true }, }, { - id: IDENBname, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *S1SetupRequest, raw []byte, enc per.Encoding) error { + ID: IDENBname, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupRequest, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { name := string(n) m.ENBName = &name } return err }, - encode: func(m *S1SetupRequest) (per.Marshaler, bool) { + Encode: func(m *S1SetupRequest) (per.Marshaler, bool) { if m.ENBName == nil { return nil, false } @@ -50,18 +50,18 @@ var s1SetupRequestIEs = []ieSpec[S1SetupRequest]{ }, }, { - id: IDSupportedTAs, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *S1SetupRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.SupportedTAs) + ID: IDSupportedTAs, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *S1SetupRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.SupportedTAs) }, - encode: func(m *S1SetupRequest) (per.Marshaler, bool) { return m.SupportedTAs, true }, + Encode: func(m *S1SetupRequest) (per.Marshaler, bool) { return m.SupportedTAs, true }, }, { - id: IDDefaultPagingDRX, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *S1SetupRequest, raw []byte, enc per.Encoding) error { + ID: IDDefaultPagingDRX, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupRequest, r *per.Reader, enc per.Encoding) error { var v PagingDRX - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -69,7 +69,7 @@ var s1SetupRequestIEs = []ieSpec[S1SetupRequest]{ return nil }, - encode: func(m *S1SetupRequest) (per.Marshaler, bool) { + Encode: func(m *S1SetupRequest) (per.Marshaler, bool) { if m.DefaultPagingDRX == nil { return nil, false } @@ -78,11 +78,11 @@ var s1SetupRequestIEs = []ieSpec[S1SetupRequest]{ }, }, { - id: IDUERetentionInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *S1SetupRequest, raw []byte, enc per.Encoding) error { + ID: IDUERetentionInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupRequest, r *per.Reader, enc per.Encoding) error { var v UERetentionInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -90,7 +90,7 @@ var s1SetupRequestIEs = []ieSpec[S1SetupRequest]{ return nil }, - encode: func(m *S1SetupRequest) (per.Marshaler, bool) { + Encode: func(m *S1SetupRequest) (per.Marshaler, bool) { if m.UERetentionInformation == nil { return nil, false } @@ -123,3 +123,7 @@ func (m *S1SetupRequest) Marshal() ([]byte, error) { func ParseS1SetupRequest(value []byte) (*S1SetupRequest, error) { return parseMessageBody[S1SetupRequest](ProcS1Setup, TriggeringInitiatingMessage, s1SetupRequestIEs, value) } + +func DecodeS1SetupRequest(value []byte) (*S1SetupRequest, error) { + return decodeMessageBody[S1SetupRequest](ProcS1Setup, s1SetupRequestIEs, value) +} diff --git a/s1ap/s1_setup_failure.go b/s1ap/s1_setup_failure.go index 227dea00c9..da537f3632 100644 --- a/s1ap/s1_setup_failure.go +++ b/s1ap/s1_setup_failure.go @@ -17,25 +17,8 @@ const ( TimeToWaitV10s TimeToWaitV20s TimeToWaitV60s - - timeToWaitRootCount = 6 ) -func (t TimeToWait) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, timeToWaitRootCount, int64(t), "TimeToWait") -} - -func (t *TimeToWait) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, timeToWaitRootCount, "TimeToWait") - if err != nil { - return err - } - - *t = TimeToWait(idx) - - return nil -} - // TS 36.413 §9.1.8.6. type S1SetupFailure struct { Cause *Cause @@ -47,11 +30,11 @@ type S1SetupFailure struct { var s1SetupFailureIEs = []ieSpec[S1SetupFailure]{ { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *S1SetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -59,7 +42,7 @@ var s1SetupFailureIEs = []ieSpec[S1SetupFailure]{ return nil }, - encode: func(m *S1SetupFailure) (per.Marshaler, bool) { + Encode: func(m *S1SetupFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -68,11 +51,11 @@ var s1SetupFailureIEs = []ieSpec[S1SetupFailure]{ }, }, { - id: IDTimeToWait, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *S1SetupFailure, raw []byte, enc per.Encoding) error { + ID: IDTimeToWait, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupFailure, r *per.Reader, enc per.Encoding) error { var ttw TimeToWait - if err := perIEDecode(raw, &ttw); err != nil { + if err := decodeIE(r, &ttw); err != nil { return err } @@ -80,7 +63,7 @@ var s1SetupFailureIEs = []ieSpec[S1SetupFailure]{ return nil }, - encode: func(m *S1SetupFailure) (per.Marshaler, bool) { + Encode: func(m *S1SetupFailure) (per.Marshaler, bool) { if m.TimeToWait == nil { return nil, false } @@ -89,11 +72,11 @@ var s1SetupFailureIEs = []ieSpec[S1SetupFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *S1SetupFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -101,7 +84,7 @@ var s1SetupFailureIEs = []ieSpec[S1SetupFailure]{ return nil }, - encode: func(m *S1SetupFailure) (per.Marshaler, bool) { + Encode: func(m *S1SetupFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -134,3 +117,7 @@ func (m *S1SetupFailure) Marshal() ([]byte, error) { func ParseS1SetupFailure(value []byte) (*S1SetupFailure, error) { return parseMessageBody[S1SetupFailure](ProcS1Setup, TriggeringUnsuccessfulOutcome, s1SetupFailureIEs, value) } + +func DecodeS1SetupFailure(value []byte) (*S1SetupFailure, error) { + return decodeMessageBody[S1SetupFailure](ProcS1Setup, s1SetupFailureIEs, value) +} diff --git a/s1ap/s1_setup_failure_test.go b/s1ap/s1_setup_failure_test.go index 2ed9e905b5..7331696fd9 100644 --- a/s1ap/s1_setup_failure_test.go +++ b/s1ap/s1_setup_failure_test.go @@ -9,7 +9,7 @@ func TestS1SetupFailureRoundTrip(t *testing.T) { ttw := TimeToWaitV10s in := &S1SetupFailure{ - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: 4}), // misc / unspecified + Cause: Ptr(CauseMiscUnspecified.Cause()), // misc / unspecified TimeToWait: &ttw, } @@ -37,7 +37,7 @@ func TestS1SetupFailureRoundTrip(t *testing.T) { t.Fatal(err) } - if deref(out.Cause) != deref(in.Cause) { + if !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("cause = %+v, want %+v", out.Cause, in.Cause) } @@ -47,7 +47,7 @@ func TestS1SetupFailureRoundTrip(t *testing.T) { } func TestS1SetupFailureCauseOnly(t *testing.T) { - in := &S1SetupFailure{Cause: Ptr(Cause{Group: CauseGroupProtocol, Value: 1})} + in := &S1SetupFailure{Cause: Ptr(CauseProtocolAbstractSyntaxErrorReject.Cause())} b, err := in.Marshal() if err != nil { @@ -64,7 +64,7 @@ func TestS1SetupFailureCauseOnly(t *testing.T) { t.Fatal(err) } - if deref(out.Cause) != deref(in.Cause) || out.TimeToWait != nil || out.CriticalityDiagnostics != nil { + if !deref(out.Cause).Equal(deref(in.Cause)) || out.TimeToWait != nil || out.CriticalityDiagnostics != nil { t.Fatalf("got %+v", out) } } diff --git a/s1ap/s1_setup_resp.go b/s1ap/s1_setup_resp.go index ee60b3678f..b4b70b808a 100644 --- a/s1ap/s1_setup_resp.go +++ b/s1ap/s1_setup_resp.go @@ -25,20 +25,20 @@ var relativeMMECapacityBounds = per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: t var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ { - id: IDMMEname, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *S1SetupResponse, raw []byte, enc per.Encoding) error { + ID: IDMMEname, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupResponse, r *per.Reader, enc per.Encoding) error { var ( err error n Name ) - if err = perIEDecode(raw, &n); err == nil { + if err = decodeIE(r, &n); err == nil { name := string(n) m.MMEName = &name } return err }, - encode: func(m *S1SetupResponse) (per.Marshaler, bool) { + Encode: func(m *S1SetupResponse) (per.Marshaler, bool) { if m.MMEName == nil { return nil, false } @@ -47,11 +47,11 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ }, }, { - id: IDServedGUMMEIs, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *S1SetupResponse, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ServedGUMMEIs) + ID: IDServedGUMMEIs, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *S1SetupResponse, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ServedGUMMEIs) }, - encode: func(m *S1SetupResponse) (per.Marshaler, bool) { + Encode: func(m *S1SetupResponse) (per.Marshaler, bool) { if len(m.ServedGUMMEIs) == 0 { return nil, false } @@ -60,9 +60,9 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ }, }, { - id: IDRelativeMMECapacity, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *S1SetupResponse, raw []byte, enc per.Encoding) error { - v, err := per.DecodeInteger(per.NewReader(raw), enc, relativeMMECapacityBounds) + ID: IDRelativeMMECapacity, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupResponse, r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeInteger(r, enc, relativeMMECapacityBounds) if err != nil { return err } @@ -72,7 +72,7 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ return nil }, - encode: func(m *S1SetupResponse) (per.Marshaler, bool) { + Encode: func(m *S1SetupResponse) (per.Marshaler, bool) { if m.RelativeMMECapacity == nil { return nil, false } @@ -83,11 +83,11 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *S1SetupResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -95,7 +95,7 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ return nil }, - encode: func(m *S1SetupResponse) (per.Marshaler, bool) { + Encode: func(m *S1SetupResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -104,11 +104,11 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ }, }, { - id: IDUERetentionInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *S1SetupResponse, raw []byte, enc per.Encoding) error { + ID: IDUERetentionInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *S1SetupResponse, r *per.Reader, enc per.Encoding) error { var v UERetentionInformation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -116,7 +116,7 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ return nil }, - encode: func(m *S1SetupResponse) (per.Marshaler, bool) { + Encode: func(m *S1SetupResponse) (per.Marshaler, bool) { if m.UERetentionInformation == nil { return nil, false } @@ -149,3 +149,7 @@ func (m *S1SetupResponse) Marshal() ([]byte, error) { func ParseS1SetupResponse(value []byte) (*S1SetupResponse, error) { return parseMessageBody[S1SetupResponse](ProcS1Setup, TriggeringSuccessfulOutcome, s1SetupResponseIEs, value) } + +func DecodeS1SetupResponse(value []byte) (*S1SetupResponse, error) { + return decodeMessageBody[S1SetupResponse](ProcS1Setup, s1SetupResponseIEs, value) +} diff --git a/s1ap/s1_setup_test.go b/s1ap/s1_setup_test.go index 6ce6e1b405..46b0283961 100644 --- a/s1ap/s1_setup_test.go +++ b/s1ap/s1_setup_test.go @@ -46,7 +46,7 @@ func TestS1SetupRequestGoldenDecode(t *testing.T) { t.Fatalf("PLMN = % x", req.GlobalENBID.PLMNIdentity) } - if req.GlobalENBID.ENBID.Kind != ENBIDHome || req.GlobalENBID.ENBID.Value != 0x54f6401 { + if req.GlobalENBID.ENBID.HomeENBID == nil || *req.GlobalENBID.ENBID.HomeENBID != 0x54f6401 { t.Fatalf("ENB-ID = %+v", req.GlobalENBID.ENBID) } @@ -93,7 +93,7 @@ func TestS1SetupRequestGoldenReencode(t *testing.T) { func TestS1SetupRequestRoundTrip(t *testing.T) { in := &S1SetupRequest{ - GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 0x0abcd}}, + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x0abcd))}}, ENBName: Ptr("eNB-1"), SupportedTAs: SupportedTAs{{TAC: 0x0001, BroadcastPLMNs: BPLMNs{{0x00, 0xf1, 0x10}}}}, DefaultPagingDRX: Ptr(PagingDRXv128), @@ -114,7 +114,7 @@ func TestS1SetupRequestRoundTrip(t *testing.T) { t.Fatal(err) } - if out.GlobalENBID != in.GlobalENBID || deref(out.ENBName) != deref(in.ENBName) || + if !out.GlobalENBID.Equal(in.GlobalENBID) || deref(out.ENBName) != deref(in.ENBName) || deref(out.DefaultPagingDRX) != deref(in.DefaultPagingDRX) || len(out.SupportedTAs) != 1 || out.SupportedTAs[0].TAC != in.SupportedTAs[0].TAC { @@ -132,18 +132,18 @@ func encodePartialS1Setup(t *testing.T, globalENBID, supportedTAs, pagingDRX boo var fields []ieField if globalENBID { - g := GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 0x0abcd}} - fields = append(fields, ieField{id: IDGlobalENBID, crit: CriticalityReject, val: &g}) + g := GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x0abcd))}} + fields = append(fields, ieField{ID: IDGlobalENBID, Criticality: CriticalityReject, Value: &g}) } if supportedTAs { s := SupportedTAs{{TAC: 0x0001, BroadcastPLMNs: BPLMNs{{0x00, 0xf1, 0x10}}}} - fields = append(fields, ieField{id: IDSupportedTAs, crit: CriticalityReject, val: s}) + fields = append(fields, ieField{ID: IDSupportedTAs, Criticality: CriticalityReject, Value: s}) } if pagingDRX { d := PagingDRXv128 - fields = append(fields, ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: d}) + fields = append(fields, ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: d}) } if err := encodeIEContainer(w, per.Aligned, fields); err != nil { @@ -199,8 +199,8 @@ func TestParseS1SetupRequestMissingMandatoryIE(t *testing.T) { t.Errorf("procedure = %d, want ProcS1Setup", ase.Procedure) } - want := Cause{Group: CauseGroupProtocol, Value: CauseProtocolAbstractSyntaxErrorReject} - if ase.Cause != want { + want := CauseProtocolAbstractSyntaxErrorReject.Cause() + if !ase.Cause.Equal(want) { t.Errorf("cause = %v, want %v", ase.Cause, want) } @@ -239,7 +239,7 @@ func rejectedIEIDs(items []CriticalityDiagnosticsIEItem) []ProtocolIEID { // reject the setup over an IE it does not model. func TestS1SetupUERetentionInformationRoundTrip(t *testing.T) { sent := &S1SetupRequest{ - GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 0x1a2b3}}, + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x1a2b3))}}, SupportedTAs: SupportedTAs{{TAC: 1, BroadcastPLMNs: BPLMNs{{0x00, 0xf1, 0x10}}}}, DefaultPagingDRX: Ptr(PagingDRXv128), UERetentionInformation: Ptr(UERetentionUesRetained), diff --git a/s1ap/status_transfer.go b/s1ap/status_transfer.go index 5d2015966c..478caa9139 100644 --- a/s1ap/status_transfer.go +++ b/s1ap/status_transfer.go @@ -26,26 +26,26 @@ type ENBStatusTransfer struct { var eNBStatusTransferIEs = []ieSpec[ENBStatusTransfer]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ENBStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ENBStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *ENBStatusTransfer) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *ENBStatusTransfer) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ENBStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ENBStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *ENBStatusTransfer) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *ENBStatusTransfer) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDENBStatusTransferTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *ENBStatusTransfer, raw []byte, enc per.Encoding) error { - m.Container = StatusTransferContainer(raw) + ID: IDENBStatusTransferTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *ENBStatusTransfer, r *per.Reader, enc per.Encoding) error { + m.Container = StatusTransferContainer(restOctets(r)) return nil }, - encode: func(m *ENBStatusTransfer) (per.Marshaler, bool) { + Encode: func(m *ENBStatusTransfer) (per.Marshaler, bool) { if m.Container == nil { return nil, false } @@ -79,6 +79,10 @@ func ParseENBStatusTransfer(value []byte) (*ENBStatusTransfer, error) { return parseMessageBody[ENBStatusTransfer](ProcENBStatusTransfer, TriggeringInitiatingMessage, eNBStatusTransferIEs, value) } +func DecodeENBStatusTransfer(value []byte) (*ENBStatusTransfer, error) { + return decodeMessageBody[ENBStatusTransfer](ProcENBStatusTransfer, eNBStatusTransferIEs, value) +} + // TS 36.413 §9.1.5.14. type MMEStatusTransfer struct { MMEUES1APID MMEUES1APID @@ -90,26 +94,26 @@ type MMEStatusTransfer struct { var mMEStatusTransferIEs = []ieSpec[MMEStatusTransfer]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *MMEStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *MMEStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *MMEStatusTransfer) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *MMEStatusTransfer) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *MMEStatusTransfer, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *MMEStatusTransfer, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *MMEStatusTransfer) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *MMEStatusTransfer) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDENBStatusTransferTransparentContainer, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *MMEStatusTransfer, raw []byte, enc per.Encoding) error { - m.Container = StatusTransferContainer(raw) + ID: IDENBStatusTransferTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *MMEStatusTransfer, r *per.Reader, enc per.Encoding) error { + m.Container = StatusTransferContainer(restOctets(r)) return nil }, - encode: func(m *MMEStatusTransfer) (per.Marshaler, bool) { + Encode: func(m *MMEStatusTransfer) (per.Marshaler, bool) { if m.Container == nil { return nil, false } @@ -142,3 +146,7 @@ func (m *MMEStatusTransfer) Marshal() ([]byte, error) { func ParseMMEStatusTransfer(value []byte) (*MMEStatusTransfer, error) { return parseMessageBody[MMEStatusTransfer](ProcMMEStatusTransfer, TriggeringInitiatingMessage, mMEStatusTransferIEs, value) } + +func DecodeMMEStatusTransfer(value []byte) (*MMEStatusTransfer, error) { + return decodeMessageBody[MMEStatusTransfer](ProcMMEStatusTransfer, mMEStatusTransferIEs, value) +} diff --git a/s1ap/table_order_test.go b/s1ap/table_order_test.go index 7f5d132ecd..4306089916 100644 --- a/s1ap/table_order_test.go +++ b/s1ap/table_order_test.go @@ -25,7 +25,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"MMEConfigurationUpdateAcknowledge", tableIDs(mMEConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, {"MMEConfigurationUpdateFailure", tableIDs(mMEConfigurationUpdateFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, {"ERABModificationConfirm", tableIDs(erabModificationConfirmIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABModifyListBearerModConf, IDERABFailedToModifyListBearerModConf, IDERABToBeReleasedListBearerModConf, IDCriticalityDiagnostics}}, - {"ERABModificationIndication", tableIDs(eRABModificationIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABToBeModifiedListBearerModInd, IDERABNotToBeModifiedListBearerModInd, IDUserLocationInformation}}, + {"ERABModificationIndication", tableIDs(eRABModificationIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABToBeModifiedListBearerModInd, IDERABNotToBeModifiedListBearerModInd, IDTunnelInformationForBBF, IDUserLocationInformation}}, {"ERABModifyRequest", tableIDs(eRABModifyRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeModifiedListBearerModReq}}, {"ERABModifyResponse", tableIDs(eRABModifyResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABModifyListBearerModRes, IDERABFailedToModifyList, IDCriticalityDiagnostics, IDUserLocationInformation}}, {"ERABReleaseCommand", tableIDs(eRABReleaseCommandIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeReleasedList, IDNASPDU}}, @@ -38,31 +38,31 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"TraceFailureIndication", tableIDs(traceFailureIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANTraceID, IDCause}}, {"HandoverCancel", tableIDs(handoverCancelIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause}}, {"HandoverCancelAcknowledge", tableIDs(handoverCancelAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCriticalityDiagnostics}}, - {"HandoverNotify", tableIDs(handoverNotifyIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANCGI, IDTAI}}, + {"HandoverNotify", tableIDs(handoverNotifyIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANCGI, IDTAI, IDTunnelInformationForBBF}}, {"HandoverRequired", tableIDs(handoverRequiredIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDHandoverType, IDCause, IDTargetID, IDDirectForwardingPathAvailability, IDSourceToTargetTransparentContainer}}, {"HandoverCommand", tableIDs(handoverCommandIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDHandoverType, IDNASSecurityParametersfromEUTRAN, IDERABSubjecttoDataForwardingList, IDERABtoReleaseListHOCmd, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverPreparationFailure", tableIDs(handoverPreparationFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDHandoverType, IDCause, IDUEAggregateMaximumBitrate, IDERABToBeSetupListHOReq, IDSourceToTargetTransparentContainer, IDUESecurityCapabilities, IDHandoverRestrictionList, IDTraceActivation, IDSecurityContext, IDNASSecurityParameterstoEUTRAN, IDGUMMEI, IDMMEUES1APID2}}, + {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDHandoverType, IDCause, IDUEAggregateMaximumBitrate, IDERABToBeSetupListHOReq, IDSourceToTargetTransparentContainer, IDUESecurityCapabilities, IDHandoverRestrictionList, IDTraceActivation, IDSecurityContext, IDNASSecurityParameterstoEUTRAN, IDGUMMEI, IDMMEUES1APID2, IDTimeRefDistribution}}, {"HandoverRequestAcknowledge", tableIDs(handoverRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABAdmittedList, IDERABFailedToSetupListHOReqAck, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, {"HandoverFailure", tableIDs(handoverFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSetupListCtxtSUReq, IDUESecurityCapabilities, IDSecurityKey, IDUERadioCapability, IDGUMMEI, IDMMEUES1APID2}}, + {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSetupListCtxtSUReq, IDUESecurityCapabilities, IDSecurityKey, IDUERadioCapability, IDGUMMEI, IDMMEUES1APID2, IDCoarseUELocation, IDTimeRefDistribution}}, {"InitialContextSetupResponse", tableIDs(initialContextSetupResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABSetupListCtxtSURes, IDERABFailedToSetupListCtxtSURes, IDCriticalityDiagnostics}}, {"InitialContextSetupFailure", tableIDs(initialContextSetupFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"LocationReport", tableIDs(locationReportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANCGI, IDTAI, IDRequestType}}, {"NASNonDeliveryIndication", tableIDs(nASNonDeliveryIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDCause}}, - {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDENBUES1APID, IDNASPDU, IDTAI, IDEUTRANCGI, IDRRCEstablishmentCause, IDSTMSI, IDGUMMEI}}, - {"UplinkNASTransport", tableIDs(uplinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDEUTRANCGI, IDTAI}}, - {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU}}, + {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDENBUES1APID, IDNASPDU, IDTAI, IDEUTRANCGI, IDRRCEstablishmentCause, IDSTMSI, IDGUMMEI, IDGWTransportLayerAddress, IDTunnelInformationForBBF, IDSIPTOLGWTransportLayerAddress, IDCoarseUELocationRequested}}, + {"UplinkNASTransport", tableIDs(uplinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDEUTRANCGI, IDTAI, IDGWTransportLayerAddress, IDSIPTOLGWTransportLayerAddress}}, + {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDCoarseUELocation}}, {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEIdentityIndexValue, IDUEPagingID, IDPagingDRX, IDCNDomain, IDTAIList, IDPagingPriority, IDUERadioCapabilityForPaging}}, - {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDENBUES1APID, IDERABToBeSwitchedDLList, IDSourceMMEUES1APID, IDEUTRANCGI, IDTAI, IDUESecurityCapabilities, IDSourceMMEGUMMEI}}, - {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSwitchedULList, IDERABToBeReleasedList, IDSecurityContext, IDMMEUES1APID2, IDUESecurityCapabilities}}, - {"E-RABToBeModifyItemBearerModReqExtIEs", tableIDs(eRABToBeModifyItemBearerModReqExtIEs), []ProtocolIEID{IDTransportInformation}}, - {"E-RABToBeSetupItemHOReq-ExtIEs", tableIDs(eRABToBeSetupItemHOReqExtIEs), []ProtocolIEID{IDDataForwardingNotPossible, IDBearerType, IDEthernetType, IDSecurityIndication}}, - {"E-RABToBeSetupItemCtxtSUReqExtIEs", tableIDs(eRABToBeSetupItemCtxtSUReqExtIEs), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, - {"E-RABToBeSetupItemBearerSUReqExtIEs", tableIDs(eRABToBeSetupItemBearerSUReqExtIEs), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, - {"E-RABToBeSwitchedDLItem-ExtIEs", tableIDs(eRABToBeSwitchedDLItemExtIEs), []ProtocolIEID{IDSecurityIndication}}, - {"E-RABQoSParameters-ExtIEs", tableIDs(eRABLevelQoSParametersExtIEs), []ProtocolIEID{IDDownlinkPacketLossRate, IDUplinkPacketLossRate}}, - {"GBR-QosInformation-ExtIEs", tableIDs(gBRQosInformationExtIEs), []ProtocolIEID{IDExtendedERABMaximumBitrateDL, IDExtendedERABMaximumBitrateUL, IDExtendedERABGuaranteedBitrateDL, IDExtendedERABGuaranteedBitrateUL}}, + {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDENBUES1APID, IDERABToBeSwitchedDLList, IDSourceMMEUES1APID, IDEUTRANCGI, IDTAI, IDUESecurityCapabilities, IDSourceMMEGUMMEI, IDTunnelInformationForBBF}}, + {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSwitchedULList, IDERABToBeReleasedList, IDSecurityContext, IDMMEUES1APID2, IDUESecurityCapabilities, IDTimeRefDistribution}}, + {"E-RABToBeModifyItemBearerModReqExtIEs", tableIDs(extIEsERABToBeModifiedItemBearerModReq), []ProtocolIEID{IDTransportInformation}}, + {"E-RABToBeSetupItemHOReq-ExtIEs", tableIDs(extIEsERABToBeSetupItemHOReq), []ProtocolIEID{IDDataForwardingNotPossible, IDBearerType, IDEthernetType, IDSecurityIndication}}, + {"E-RABToBeSetupItemCtxtSUReqExtIEs", tableIDs(extIEsERABToBeSetupItemCtxtSUReq), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, + {"E-RABToBeSetupItemBearerSUReqExtIEs", tableIDs(extIEsERABToBeSetupItemBearerSUReq), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, + {"E-RABToBeSwitchedDLItem-ExtIEs", tableIDs(extIEsERABToBeSwitchedDLItem), []ProtocolIEID{IDSecurityIndication}}, + {"E-RABQoSParameters-ExtIEs", tableIDs(extIEsERABLevelQoSParameters), []ProtocolIEID{IDDownlinkPacketLossRate, IDUplinkPacketLossRate}}, + {"GBR-QosInformation-ExtIEs", tableIDs(extIEsGBRQosInformation), []ProtocolIEID{IDExtendedERABMaximumBitrateDL, IDExtendedERABMaximumBitrateUL, IDExtendedERABGuaranteedBitrateDL, IDExtendedERABGuaranteedBitrateUL}}, {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"Reset", tableIDs(resetIEs), []ProtocolIEID{IDCause, IDResetType}}, {"ResetAcknowledge", tableIDs(resetAcknowledgeIEs), []ProtocolIEID{IDUEAssociatedLogicalS1ConnectionListResAck, IDCriticalityDiagnostics}}, @@ -72,7 +72,11 @@ func TestTableOrderMatchesASN1(t *testing.T) { {"ENBStatusTransfer", tableIDs(eNBStatusTransferIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDENBStatusTransferTransparentContainer}}, {"MMEStatusTransfer", tableIDs(mMEStatusTransferIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDENBStatusTransferTransparentContainer}}, {"UECapabilityInfoIndication", tableIDs(uECapabilityInfoIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUERadioCapability, IDUERadioCapabilityForPaging}}, - {"UEContextModificationRequest", tableIDs(uEContextModificationRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate}}, + {"UEContextModificationRequest", tableIDs(uEContextModificationRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDTimeRefDistribution}}, + {"S1RemovalRequest", tableIDs(s1RemovalRequestIEs), []ProtocolIEID{IDGlobalENBID}}, + {"S1RemovalResponse", tableIDs(s1RemovalResponseIEs), []ProtocolIEID{IDMMEname, IDCriticalityDiagnostics}}, + {"S1RemovalFailure", tableIDs(s1RemovalFailureIEs), []ProtocolIEID{IDCause, IDCriticalityDiagnostics}}, + {"SONConfigurationTransfer-ExtIEs", tableIDs(extIEsSONConfigurationTransfer), []ProtocolIEID{IDX2TNLConfigurationInfo, IDSynchronisationInformation, IDRequestedTNLInfo}}, {"UEContextModificationResponse", tableIDs(uEContextModificationResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCriticalityDiagnostics}}, {"UEContextModificationFailure", tableIDs(uEContextModificationFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, {"UEContextReleaseCommand", tableIDs(uEContextReleaseCommandIEs), []ProtocolIEID{IDUES1APIDs, IDCause}}, @@ -98,7 +102,7 @@ func TestTableOrderMatchesASN1(t *testing.T) { func tableIDs[M any](table []ieSpec[M]) []ProtocolIEID { ids := make([]ProtocolIEID, len(table)) for i, spec := range table { - ids[i] = spec.id + ids[i] = spec.ID } return ids diff --git a/s1ap/testdata/asn1/S1AP-CommonDataTypes.asn b/s1ap/testdata/asn1/S1AP-CommonDataTypes.asn new file mode 100644 index 0000000000..6fb5523a5d --- /dev/null +++ b/s1ap/testdata/asn1/S1AP-CommonDataTypes.asn @@ -0,0 +1,32 @@ +-- ************************************************************** +-- +-- Common definitions +-- +-- ************************************************************** + +S1AP-CommonDataTypes { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +eps-Access (21) modules (3) s1ap (1) version1 (1) s1ap-CommonDataTypes (3) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +Criticality ::= ENUMERATED { reject, ignore, notify } + +Presence ::= ENUMERATED { optional, conditional, mandatory } + +PrivateIE-ID ::= CHOICE { + local INTEGER (0..65535), + global OBJECT IDENTIFIER +} + +ProcedureCode ::= INTEGER (0..255) + +ProtocolExtensionID ::= INTEGER (0..65535) + +ProtocolIE-ID ::= INTEGER (0..65535) + +TriggeringMessage ::= ENUMERATED { initiating-message, successful-outcome, unsuccessfull-outcome } + +END diff --git a/s1ap/testdata/asn1/S1AP-Constants.asn b/s1ap/testdata/asn1/S1AP-Constants.asn new file mode 100644 index 0000000000..9decb5fd9e --- /dev/null +++ b/s1ap/testdata/asn1/S1AP-Constants.asn @@ -0,0 +1,514 @@ +-- ************************************************************** +-- +-- Constant definitions +-- +-- ************************************************************** + +S1AP-Constants { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +eps-Access (21) modules (3) s1ap (1) version1 (1) s1ap-Constants (4) } + +DEFINITIONS AUTOMATIC TAGS ::= +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + ProcedureCode, + ProtocolIE-ID + +FROM S1AP-CommonDataTypes; + + +-- ************************************************************** +-- +-- Elementary Procedures +-- +-- ************************************************************** + +id-HandoverPreparation ProcedureCode ::= 0 +id-HandoverResourceAllocation ProcedureCode ::= 1 +id-HandoverNotification ProcedureCode ::= 2 +id-PathSwitchRequest ProcedureCode ::= 3 +id-HandoverCancel ProcedureCode ::= 4 +id-E-RABSetup ProcedureCode ::= 5 +id-E-RABModify ProcedureCode ::= 6 +id-E-RABRelease ProcedureCode ::= 7 +id-E-RABReleaseIndication ProcedureCode ::= 8 +id-InitialContextSetup ProcedureCode ::= 9 +id-Paging ProcedureCode ::= 10 +id-downlinkNASTransport ProcedureCode ::= 11 +id-initialUEMessage ProcedureCode ::= 12 +id-uplinkNASTransport ProcedureCode ::= 13 +id-Reset ProcedureCode ::= 14 +id-ErrorIndication ProcedureCode ::= 15 +id-NASNonDeliveryIndication ProcedureCode ::= 16 +id-S1Setup ProcedureCode ::= 17 +id-UEContextReleaseRequest ProcedureCode ::= 18 +id-DownlinkS1cdma2000tunnelling ProcedureCode ::= 19 +id-UplinkS1cdma2000tunnelling ProcedureCode ::= 20 +id-UEContextModification ProcedureCode ::= 21 +id-UECapabilityInfoIndication ProcedureCode ::= 22 +id-UEContextRelease ProcedureCode ::= 23 +id-eNBStatusTransfer ProcedureCode ::= 24 +id-MMEStatusTransfer ProcedureCode ::= 25 +id-DeactivateTrace ProcedureCode ::= 26 +id-TraceStart ProcedureCode ::= 27 +id-TraceFailureIndication ProcedureCode ::= 28 +id-ENBConfigurationUpdate ProcedureCode ::= 29 +id-MMEConfigurationUpdate ProcedureCode ::= 30 +id-LocationReportingControl ProcedureCode ::= 31 +id-LocationReportingFailureIndication ProcedureCode ::= 32 +id-LocationReport ProcedureCode ::= 33 +id-OverloadStart ProcedureCode ::= 34 +id-OverloadStop ProcedureCode ::= 35 +id-WriteReplaceWarning ProcedureCode ::= 36 +id-eNBDirectInformationTransfer ProcedureCode ::= 37 +id-MMEDirectInformationTransfer ProcedureCode ::= 38 +id-PrivateMessage ProcedureCode ::= 39 +id-eNBConfigurationTransfer ProcedureCode ::= 40 +id-MMEConfigurationTransfer ProcedureCode ::= 41 +id-CellTrafficTrace ProcedureCode ::= 42 +id-Kill ProcedureCode ::= 43 +id-downlinkUEAssociatedLPPaTransport ProcedureCode ::= 44 +id-uplinkUEAssociatedLPPaTransport ProcedureCode ::= 45 +id-downlinkNonUEAssociatedLPPaTransport ProcedureCode ::= 46 +id-uplinkNonUEAssociatedLPPaTransport ProcedureCode ::= 47 +id-UERadioCapabilityMatch ProcedureCode ::= 48 +id-PWSRestartIndication ProcedureCode ::= 49 +id-E-RABModificationIndication ProcedureCode ::= 50 +id-PWSFailureIndication ProcedureCode ::= 51 +id-RerouteNASRequest ProcedureCode ::= 52 +id-UEContextModificationIndication ProcedureCode ::= 53 +id-ConnectionEstablishmentIndication ProcedureCode ::= 54 +id-UEContextSuspend ProcedureCode ::= 55 +id-UEContextResume ProcedureCode ::= 56 +id-NASDeliveryIndication ProcedureCode ::= 57 +id-RetrieveUEInformation ProcedureCode ::= 58 +id-UEInformationTransfer ProcedureCode ::= 59 +id-eNBCPRelocationIndication ProcedureCode ::= 60 +id-MMECPRelocationIndication ProcedureCode ::= 61 +id-SecondaryRATDataUsageReport ProcedureCode ::= 62 +id-UERadioCapabilityIDMapping ProcedureCode ::= 63 +id-HandoverSuccess ProcedureCode ::= 64 +id-eNBEarlyStatusTransfer ProcedureCode ::= 65 +id-MMEEarlyStatusTransfer ProcedureCode ::= 66 +id-S1Removal ProcedureCode ::= 67 + + +-- ************************************************************** +-- +-- Extension constants +-- +-- ************************************************************** + +maxPrivateIEs INTEGER ::= 65535 +maxProtocolExtensions INTEGER ::= 65535 +maxProtocolIEs INTEGER ::= 65535 +-- ************************************************************** +-- +-- Lists +-- +-- ************************************************************** + +maxnoofCSGs INTEGER ::= 256 +maxnoofE-RABs INTEGER ::= 256 +maxnoofTAIs INTEGER ::= 256 +maxnoofTACs INTEGER ::= 256 +maxnoofErrors INTEGER ::= 256 +maxnoofBPLMNs INTEGER ::= 6 +maxnoofPLMNsPerMME INTEGER ::= 32 +maxnoofEPLMNs INTEGER ::= 15 +maxnoofEPLMNsPlusOne INTEGER ::= 16 +maxnoofForbLACs INTEGER ::= 4096 +maxnoofForbTACs INTEGER ::= 4096 +maxnoofIndividualS1ConnectionsToReset INTEGER ::= 256 +maxnoofCellsinUEHistoryInfo INTEGER ::= 16 +maxnoofCellsineNB INTEGER ::= 256 +maxnoofTAIforWarning INTEGER ::= 65535 +maxnoofCellID INTEGER ::= 65535 +maxnoofDCNs INTEGER ::= 32 +maxnoofEmergencyAreaID INTEGER ::= 65535 +maxnoofCellinTAI INTEGER ::= 65535 +maxnoofCellinEAI INTEGER ::= 65535 +maxnoofeNBX2TLAs INTEGER ::= 2 +maxnoofeNBX2ExtTLAs INTEGER ::= 16 +maxnoofeNBX2GTPTLAs INTEGER ::= 16 +maxnoofRATs INTEGER ::= 8 +maxnoofGroupIDs INTEGER ::= 65535 +maxnoofMMECs INTEGER ::= 256 +maxnoofCellIDforMDT INTEGER ::= 32 +maxnoofTAforMDT INTEGER ::= 8 +maxnoofMDTPLMNs INTEGER ::= 16 +maxnoofCellsforRestart INTEGER ::= 256 +maxnoofRestartTAIs INTEGER ::= 2048 +maxnoofRestartEmergencyAreaIDs INTEGER ::= 256 +maxEARFCN INTEGER ::= 262143 +maxnoofMBSFNAreaMDT INTEGER ::= 8 +maxnoofRecommendedCells INTEGER ::= 16 +maxnoofRecommendedENBs INTEGER ::= 16 +maxnooftimeperiods INTEGER ::= 2 +maxnoofCellIDforQMC INTEGER ::= 32 +maxnoofTAforQMC INTEGER ::= 8 +maxnoofPLMNforQMC INTEGER ::= 16 +maxnoofBluetoothName INTEGER ::= 4 +maxnoofWLANName INTEGER ::= 4 +maxnoofConnectedengNBs INTEGER ::= 256 +maxnoofPC5QoSFlows INTEGER ::= 2048 +maxnooffrequencies INTEGER ::= 64 +maxNARFCN INTEGER ::= 3279165 +maxRS-IndexCellQual INTEGER ::= 16 +maxnoofPSCellsPerPrimaryCellinUEHistoryInfo INTEGER ::= 8 +maxnoofTACsInNTN INTEGER ::= 12 +maxnoofSensorName INTEGER ::= 3 + + +-- ************************************************************** +-- +-- IEs +-- +-- ************************************************************** + +id-MME-UE-S1AP-ID ProtocolIE-ID ::= 0 +id-HandoverType ProtocolIE-ID ::= 1 +id-Cause ProtocolIE-ID ::= 2 +id-SourceID ProtocolIE-ID ::= 3 +id-TargetID ProtocolIE-ID ::= 4 +id-eNB-UE-S1AP-ID ProtocolIE-ID ::= 8 +id-E-RABSubjecttoDataForwardingList ProtocolIE-ID ::= 12 +id-E-RABtoReleaseListHOCmd ProtocolIE-ID ::= 13 +id-E-RABDataForwardingItem ProtocolIE-ID ::= 14 +id-E-RABReleaseItemBearerRelComp ProtocolIE-ID ::= 15 +id-E-RABToBeSetupListBearerSUReq ProtocolIE-ID ::= 16 +id-E-RABToBeSetupItemBearerSUReq ProtocolIE-ID ::= 17 +id-E-RABAdmittedList ProtocolIE-ID ::= 18 +id-E-RABFailedToSetupListHOReqAck ProtocolIE-ID ::= 19 +id-E-RABAdmittedItem ProtocolIE-ID ::= 20 +id-E-RABFailedtoSetupItemHOReqAck ProtocolIE-ID ::= 21 +id-E-RABToBeSwitchedDLList ProtocolIE-ID ::= 22 +id-E-RABToBeSwitchedDLItem ProtocolIE-ID ::= 23 +id-E-RABToBeSetupListCtxtSUReq ProtocolIE-ID ::= 24 +id-TraceActivation ProtocolIE-ID ::= 25 +id-NAS-PDU ProtocolIE-ID ::= 26 +id-E-RABToBeSetupItemHOReq ProtocolIE-ID ::= 27 +id-E-RABSetupListBearerSURes ProtocolIE-ID ::= 28 +id-E-RABFailedToSetupListBearerSURes ProtocolIE-ID ::= 29 +id-E-RABToBeModifiedListBearerModReq ProtocolIE-ID ::= 30 +id-E-RABModifyListBearerModRes ProtocolIE-ID ::= 31 +id-E-RABFailedToModifyList ProtocolIE-ID ::= 32 +id-E-RABToBeReleasedList ProtocolIE-ID ::= 33 +id-E-RABFailedToReleaseList ProtocolIE-ID ::= 34 +id-E-RABItem ProtocolIE-ID ::= 35 +id-E-RABToBeModifiedItemBearerModReq ProtocolIE-ID ::= 36 +id-E-RABModifyItemBearerModRes ProtocolIE-ID ::= 37 +id-E-RABReleaseItem ProtocolIE-ID ::= 38 +id-E-RABSetupItemBearerSURes ProtocolIE-ID ::= 39 +id-SecurityContext ProtocolIE-ID ::= 40 +id-HandoverRestrictionList ProtocolIE-ID ::= 41 +id-UEPagingID ProtocolIE-ID ::= 43 +id-pagingDRX ProtocolIE-ID ::= 44 +id-TAIList ProtocolIE-ID ::= 46 +id-TAIItem ProtocolIE-ID ::= 47 +id-E-RABFailedToSetupListCtxtSURes ProtocolIE-ID ::= 48 +id-E-RABReleaseItemHOCmd ProtocolIE-ID ::= 49 +id-E-RABSetupItemCtxtSURes ProtocolIE-ID ::= 50 +id-E-RABSetupListCtxtSURes ProtocolIE-ID ::= 51 +id-E-RABToBeSetupItemCtxtSUReq ProtocolIE-ID ::= 52 +id-E-RABToBeSetupListHOReq ProtocolIE-ID ::= 53 +id-GERANtoLTEHOInformationRes ProtocolIE-ID ::= 55 +id-UTRANtoLTEHOInformationRes ProtocolIE-ID ::= 57 +id-CriticalityDiagnostics ProtocolIE-ID ::= 58 +id-Global-ENB-ID ProtocolIE-ID ::= 59 +id-eNBname ProtocolIE-ID ::= 60 +id-MMEname ProtocolIE-ID ::= 61 +id-ServedPLMNs ProtocolIE-ID ::= 63 +id-SupportedTAs ProtocolIE-ID ::= 64 +id-TimeToWait ProtocolIE-ID ::= 65 +id-uEaggregateMaximumBitrate ProtocolIE-ID ::= 66 +id-TAI ProtocolIE-ID ::= 67 +id-E-RABReleaseListBearerRelComp ProtocolIE-ID ::= 69 +id-cdma2000PDU ProtocolIE-ID ::= 70 +id-cdma2000RATType ProtocolIE-ID ::= 71 +id-cdma2000SectorID ProtocolIE-ID ::= 72 +id-SecurityKey ProtocolIE-ID ::= 73 +id-UERadioCapability ProtocolIE-ID ::= 74 +id-GUMMEI-ID ProtocolIE-ID ::= 75 +id-E-RABInformationListItem ProtocolIE-ID ::= 78 +id-Direct-Forwarding-Path-Availability ProtocolIE-ID ::= 79 +id-UEIdentityIndexValue ProtocolIE-ID ::= 80 +id-cdma2000HOStatus ProtocolIE-ID ::= 83 +id-cdma2000HORequiredIndication ProtocolIE-ID ::= 84 +id-E-UTRAN-Trace-ID ProtocolIE-ID ::= 86 +id-RelativeMMECapacity ProtocolIE-ID ::= 87 +id-SourceMME-UE-S1AP-ID ProtocolIE-ID ::= 88 +id-Bearers-SubjectToStatusTransfer-Item ProtocolIE-ID ::= 89 +id-eNB-StatusTransfer-TransparentContainer ProtocolIE-ID ::= 90 +id-UE-associatedLogicalS1-ConnectionItem ProtocolIE-ID ::= 91 +id-ResetType ProtocolIE-ID ::= 92 +id-UE-associatedLogicalS1-ConnectionListResAck ProtocolIE-ID ::= 93 +id-E-RABToBeSwitchedULItem ProtocolIE-ID ::= 94 +id-E-RABToBeSwitchedULList ProtocolIE-ID ::= 95 +id-S-TMSI ProtocolIE-ID ::= 96 +id-cdma2000OneXRAND ProtocolIE-ID ::= 97 +id-RequestType ProtocolIE-ID ::= 98 +id-UE-S1AP-IDs ProtocolIE-ID ::= 99 +id-EUTRAN-CGI ProtocolIE-ID ::= 100 +id-OverloadResponse ProtocolIE-ID ::= 101 +id-cdma2000OneXSRVCCInfo ProtocolIE-ID ::= 102 +id-E-RABFailedToBeReleasedList ProtocolIE-ID ::= 103 +id-Source-ToTarget-TransparentContainer ProtocolIE-ID ::= 104 +id-ServedGUMMEIs ProtocolIE-ID ::= 105 +id-SubscriberProfileIDforRFP ProtocolIE-ID ::= 106 +id-UESecurityCapabilities ProtocolIE-ID ::= 107 +id-CSFallbackIndicator ProtocolIE-ID ::= 108 +id-CNDomain ProtocolIE-ID ::= 109 +id-E-RABReleasedList ProtocolIE-ID ::= 110 +id-MessageIdentifier ProtocolIE-ID ::= 111 +id-SerialNumber ProtocolIE-ID ::= 112 +id-WarningAreaList ProtocolIE-ID ::= 113 +id-RepetitionPeriod ProtocolIE-ID ::= 114 +id-NumberofBroadcastRequest ProtocolIE-ID ::= 115 +id-WarningType ProtocolIE-ID ::= 116 +id-WarningSecurityInfo ProtocolIE-ID ::= 117 +id-DataCodingScheme ProtocolIE-ID ::= 118 +id-WarningMessageContents ProtocolIE-ID ::= 119 +id-BroadcastCompletedAreaList ProtocolIE-ID ::= 120 +id-Inter-SystemInformationTransferTypeEDT ProtocolIE-ID ::= 121 +id-Inter-SystemInformationTransferTypeMDT ProtocolIE-ID ::= 122 +id-Target-ToSource-TransparentContainer ProtocolIE-ID ::= 123 +id-SRVCCOperationPossible ProtocolIE-ID ::= 124 +id-SRVCCHOIndication ProtocolIE-ID ::= 125 +id-NAS-DownlinkCount ProtocolIE-ID ::= 126 +id-CSG-Id ProtocolIE-ID ::= 127 +id-CSG-IdList ProtocolIE-ID ::= 128 +id-SONConfigurationTransferECT ProtocolIE-ID ::= 129 +id-SONConfigurationTransferMCT ProtocolIE-ID ::= 130 +id-TraceCollectionEntityIPAddress ProtocolIE-ID ::= 131 +id-MSClassmark2 ProtocolIE-ID ::= 132 +id-MSClassmark3 ProtocolIE-ID ::= 133 +id-RRC-Establishment-Cause ProtocolIE-ID ::= 134 +id-NASSecurityParametersfromE-UTRAN ProtocolIE-ID ::= 135 +id-NASSecurityParameterstoE-UTRAN ProtocolIE-ID ::= 136 +id-DefaultPagingDRX ProtocolIE-ID ::= 137 +id-Source-ToTarget-TransparentContainer-Secondary ProtocolIE-ID ::= 138 +id-Target-ToSource-TransparentContainer-Secondary ProtocolIE-ID ::= 139 +id-EUTRANRoundTripDelayEstimationInfo ProtocolIE-ID ::= 140 +id-BroadcastCancelledAreaList ProtocolIE-ID ::= 141 +id-ConcurrentWarningMessageIndicator ProtocolIE-ID ::= 142 +id-Data-Forwarding-Not-Possible ProtocolIE-ID ::= 143 +id-ExtendedRepetitionPeriod ProtocolIE-ID ::= 144 +id-CellAccessMode ProtocolIE-ID ::= 145 +id-CSGMembershipStatus ProtocolIE-ID ::= 146 +id-LPPa-PDU ProtocolIE-ID ::= 147 +id-Routing-ID ProtocolIE-ID ::= 148 +id-Time-Synchronisation-Info ProtocolIE-ID ::= 149 +id-PS-ServiceNotAvailable ProtocolIE-ID ::= 150 +id-PagingPriority ProtocolIE-ID ::= 151 +id-x2TNLConfigurationInfo ProtocolIE-ID ::= 152 +id-eNBX2ExtendedTransportLayerAddresses ProtocolIE-ID ::= 153 +id-GUMMEIList ProtocolIE-ID ::= 154 +id-GW-TransportLayerAddress ProtocolIE-ID ::= 155 +id-Correlation-ID ProtocolIE-ID ::= 156 +id-SourceMME-GUMMEI ProtocolIE-ID ::= 157 +id-MME-UE-S1AP-ID-2 ProtocolIE-ID ::= 158 +id-RegisteredLAI ProtocolIE-ID ::= 159 +id-RelayNode-Indicator ProtocolIE-ID ::= 160 +id-TrafficLoadReductionIndication ProtocolIE-ID ::= 161 +id-MDTConfiguration ProtocolIE-ID ::= 162 +id-MMERelaySupportIndicator ProtocolIE-ID ::= 163 +id-GWContextReleaseIndication ProtocolIE-ID ::= 164 +id-ManagementBasedMDTAllowed ProtocolIE-ID ::= 165 +id-PrivacyIndicator ProtocolIE-ID ::= 166 +id-Time-UE-StayedInCell-EnhancedGranularity ProtocolIE-ID ::= 167 +id-HO-Cause ProtocolIE-ID ::= 168 +id-VoiceSupportMatchIndicator ProtocolIE-ID ::= 169 +id-GUMMEIType ProtocolIE-ID ::= 170 +id-M3Configuration ProtocolIE-ID ::= 171 +id-M4Configuration ProtocolIE-ID ::= 172 +id-M5Configuration ProtocolIE-ID ::= 173 +id-MDT-Location-Info ProtocolIE-ID ::= 174 +id-MobilityInformation ProtocolIE-ID ::= 175 +id-Tunnel-Information-for-BBF ProtocolIE-ID ::= 176 +id-ManagementBasedMDTPLMNList ProtocolIE-ID ::= 177 +id-SignallingBasedMDTPLMNList ProtocolIE-ID ::= 178 +id-ULCOUNTValueExtended ProtocolIE-ID ::= 179 +id-DLCOUNTValueExtended ProtocolIE-ID ::= 180 +id-ReceiveStatusOfULPDCPSDUsExtended ProtocolIE-ID ::= 181 +id-ECGIListForRestart ProtocolIE-ID ::= 182 +id-SIPTO-Correlation-ID ProtocolIE-ID ::= 183 +id-SIPTO-L-GW-TransportLayerAddress ProtocolIE-ID ::= 184 +id-TransportInformation ProtocolIE-ID ::= 185 +id-LHN-ID ProtocolIE-ID ::= 186 +id-AdditionalCSFallbackIndicator ProtocolIE-ID ::= 187 +id-TAIListForRestart ProtocolIE-ID ::= 188 +id-UserLocationInformation ProtocolIE-ID ::= 189 +id-EmergencyAreaIDListForRestart ProtocolIE-ID ::= 190 +id-KillAllWarningMessages ProtocolIE-ID ::= 191 +id-Masked-IMEISV ProtocolIE-ID ::= 192 +id-eNBIndirectX2TransportLayerAddresses ProtocolIE-ID ::= 193 +id-uE-HistoryInformationFromTheUE ProtocolIE-ID ::= 194 +id-ProSeAuthorized ProtocolIE-ID ::= 195 +id-ExpectedUEBehaviour ProtocolIE-ID ::= 196 +id-LoggedMBSFNMDT ProtocolIE-ID ::= 197 +id-UERadioCapabilityForPaging ProtocolIE-ID ::= 198 +id-E-RABToBeModifiedListBearerModInd ProtocolIE-ID ::= 199 +id-E-RABToBeModifiedItemBearerModInd ProtocolIE-ID ::= 200 +id-E-RABNotToBeModifiedListBearerModInd ProtocolIE-ID ::= 201 +id-E-RABNotToBeModifiedItemBearerModInd ProtocolIE-ID ::= 202 +id-E-RABModifyListBearerModConf ProtocolIE-ID ::= 203 +id-E-RABModifyItemBearerModConf ProtocolIE-ID ::= 204 +id-E-RABFailedToModifyListBearerModConf ProtocolIE-ID ::= 205 +id-SON-Information-Report ProtocolIE-ID ::= 206 +id-Muting-Availability-Indication ProtocolIE-ID ::= 207 +id-Muting-Pattern-Information ProtocolIE-ID ::= 208 +id-Synchronisation-Information ProtocolIE-ID ::= 209 +id-E-RABToBeReleasedListBearerModConf ProtocolIE-ID ::= 210 +id-AssistanceDataForPaging ProtocolIE-ID ::= 211 +id-CellIdentifierAndCELevelForCECapableUEs ProtocolIE-ID ::= 212 +id-InformationOnRecommendedCellsAndENBsForPaging ProtocolIE-ID ::= 213 +id-RecommendedCellItem ProtocolIE-ID ::= 214 +id-RecommendedENBItem ProtocolIE-ID ::= 215 +id-ProSeUEtoNetworkRelaying ProtocolIE-ID ::= 216 +id-ULCOUNTValuePDCP-SNlength18 ProtocolIE-ID ::= 217 +id-DLCOUNTValuePDCP-SNlength18 ProtocolIE-ID ::= 218 +id-ReceiveStatusOfULPDCPSDUsPDCP-SNlength18 ProtocolIE-ID ::= 219 +id-M6Configuration ProtocolIE-ID ::= 220 +id-M7Configuration ProtocolIE-ID ::= 221 +id-PWSfailedECGIList ProtocolIE-ID ::= 222 +id-MME-Group-ID ProtocolIE-ID ::= 223 +id-Additional-GUTI ProtocolIE-ID ::= 224 +id-S1-Message ProtocolIE-ID ::= 225 +id-CSGMembershipInfo ProtocolIE-ID ::= 226 +id-Paging-eDRXInformation ProtocolIE-ID ::= 227 +id-UE-RetentionInformation ProtocolIE-ID ::= 228 +id-UE-Usage-Type ProtocolIE-ID ::= 230 +id-extended-UEIdentityIndexValue ProtocolIE-ID ::= 231 +id-RAT-Type ProtocolIE-ID ::= 232 +id-BearerType ProtocolIE-ID ::= 233 +id-NB-IoT-DefaultPagingDRX ProtocolIE-ID ::= 234 +id-E-RABFailedToResumeListResumeReq ProtocolIE-ID ::= 235 +id-E-RABFailedToResumeItemResumeReq ProtocolIE-ID ::= 236 +id-E-RABFailedToResumeListResumeRes ProtocolIE-ID ::= 237 +id-E-RABFailedToResumeItemResumeRes ProtocolIE-ID ::= 238 +id-NB-IoT-Paging-eDRXInformation ProtocolIE-ID ::= 239 +id-V2XServicesAuthorized ProtocolIE-ID ::= 240 +id-UEUserPlaneCIoTSupportIndicator ProtocolIE-ID ::= 241 +id-CE-mode-B-SupportIndicator ProtocolIE-ID ::= 242 +id-SRVCCOperationNotPossible ProtocolIE-ID ::= 243 +id-NB-IoT-UEIdentityIndexValue ProtocolIE-ID ::= 244 +id-RRC-Resume-Cause ProtocolIE-ID ::= 245 +id-DCN-ID ProtocolIE-ID ::= 246 +id-ServedDCNs ProtocolIE-ID ::= 247 +id-UESidelinkAggregateMaximumBitrate ProtocolIE-ID ::= 248 +id-DLNASPDUDeliveryAckRequest ProtocolIE-ID ::= 249 +id-Coverage-Level ProtocolIE-ID ::= 250 +id-EnhancedCoverageRestricted ProtocolIE-ID ::= 251 +id-UE-Level-QoS-Parameters ProtocolIE-ID ::= 252 +id-DL-CP-SecurityInformation ProtocolIE-ID ::= 253 +id-UL-CP-SecurityInformation ProtocolIE-ID ::= 254 +id-extended-e-RAB-MaximumBitrateDL ProtocolIE-ID ::= 255 +id-extended-e-RAB-MaximumBitrateUL ProtocolIE-ID ::= 256 +id-extended-e-RAB-GuaranteedBitrateDL ProtocolIE-ID ::= 257 +id-extended-e-RAB-GuaranteedBitrateUL ProtocolIE-ID ::= 258 +id-extended-uEaggregateMaximumBitRateDL ProtocolIE-ID ::= 259 +id-extended-uEaggregateMaximumBitRateUL ProtocolIE-ID ::= 260 +id-NRrestrictioninEPSasSecondaryRAT ProtocolIE-ID ::= 261 +id-UEAppLayerMeasConfig ProtocolIE-ID ::= 262 +id-UE-Application-Layer-Measurement-Capability ProtocolIE-ID ::= 263 +id-SecondaryRATDataUsageReportList ProtocolIE-ID ::= 264 +id-SecondaryRATDataUsageReportItem ProtocolIE-ID ::= 265 +id-HandoverFlag ProtocolIE-ID ::= 266 +id-E-RABUsageReportItem ProtocolIE-ID ::= 267 +id-SecondaryRATDataUsageRequest ProtocolIE-ID ::= 268 +id-NRUESecurityCapabilities ProtocolIE-ID ::= 269 +id-UnlicensedSpectrumRestriction ProtocolIE-ID ::= 270 +id-CE-ModeBRestricted ProtocolIE-ID ::= 271 +id-LTE-M-Indication ProtocolIE-ID ::= 272 +id-DownlinkPacketLossRate ProtocolIE-ID ::= 273 +id-UplinkPacketLossRate ProtocolIE-ID ::= 274 +id-UECapabilityInfoRequest ProtocolIE-ID ::= 275 +id-serviceType ProtocolIE-ID ::= 276 +id-AerialUEsubscriptionInformation ProtocolIE-ID ::= 277 +id-Subscription-Based-UE-DifferentiationInfo ProtocolIE-ID ::= 278 +id-EndIndication ProtocolIE-ID ::= 280 +id-EDT-Session ProtocolIE-ID ::= 281 +id-CNTypeRestrictions ProtocolIE-ID ::= 282 +id-PendingDataIndication ProtocolIE-ID ::= 283 +id-BluetoothMeasurementConfiguration ProtocolIE-ID ::= 284 +id-WLANMeasurementConfiguration ProtocolIE-ID ::= 285 +id-WarningAreaCoordinates ProtocolIE-ID ::= 286 +id-NRrestrictionin5GS ProtocolIE-ID ::= 287 +id-PSCellInformation ProtocolIE-ID ::= 288 +id-LastNG-RANPLMNIdentity ProtocolIE-ID ::= 290 +id-ConnectedengNBList ProtocolIE-ID ::= 291 +id-ConnectedengNBToAddList ProtocolIE-ID ::= 292 +id-ConnectedengNBToRemoveList ProtocolIE-ID ::= 293 +id-EN-DCSONConfigurationTransfer-ECT ProtocolIE-ID ::= 294 +id-EN-DCSONConfigurationTransfer-MCT ProtocolIE-ID ::= 295 +id-IMSvoiceEPSfallbackfrom5G ProtocolIE-ID ::= 296 +id-TimeSinceSecondaryNodeRelease ProtocolIE-ID ::= 297 +id-RequestTypeAdditionalInfo ProtocolIE-ID ::= 298 +id-AdditionalRRMPriorityIndex ProtocolIE-ID ::= 299 +id-ContextatSource ProtocolIE-ID ::= 300 +id-IAB-Authorized ProtocolIE-ID ::= 301 +id-IAB-Node-Indication ProtocolIE-ID ::= 302 +id-IAB-Supported ProtocolIE-ID ::= 303 +id-DataSize ProtocolIE-ID ::= 304 +id-Ethernet-Type ProtocolIE-ID ::= 305 +id-NRV2XServicesAuthorized ProtocolIE-ID ::= 306 +id-NRUESidelinkAggregateMaximumBitrate ProtocolIE-ID ::= 307 +id-PC5QoSParameters ProtocolIE-ID ::= 308 +id-IntersystemSONConfigurationTransferMCT ProtocolIE-ID ::= 309 +id-IntersystemSONConfigurationTransferECT ProtocolIE-ID ::= 310 +id-IntersystemMeasurementConfiguration ProtocolIE-ID ::= 311 +id-SourceNodeID ProtocolIE-ID ::= 312 +id-NB-IoT-RLF-Report-Container ProtocolIE-ID ::= 313 +id-UERadioCapabilityID ProtocolIE-ID ::= 314 +id-UERadioCapability-NR-Format ProtocolIE-ID ::= 315 +id-MDTConfigurationNR ProtocolIE-ID ::= 316 +id-DAPSRequestInfo ProtocolIE-ID ::= 317 +id-DAPSResponseInfoList ProtocolIE-ID ::= 318 +id-DAPSResponseInfoItem ProtocolIE-ID ::= 319 +id-NotifySourceeNB ProtocolIE-ID ::= 320 +id-eNB-EarlyStatusTransfer-TransparentContainer ProtocolIE-ID ::= 321 +id-Bearers-SubjectToEarlyStatusTransfer-Item ProtocolIE-ID ::= 322 +id-WUS-Assistance-Information ProtocolIE-ID ::= 323 +id-NB-IoT-PagingDRX ProtocolIE-ID ::= 324 +id-TraceCollectionEntityURI ProtocolIE-ID ::= 325 +id-EmergencyIndicator ProtocolIE-ID ::= 326 +id-UERadioCapabilityForPaging-NR-Format ProtocolIE-ID ::= 327 +id-SourceTransportLayerAddress ProtocolIE-ID ::= 328 +id-lastVisitedPSCellList ProtocolIE-ID ::= 329 +id-RACSIndication ProtocolIE-ID ::= 330 +id-PagingCause ProtocolIE-ID ::= 331 +id-SecurityIndication ProtocolIE-ID ::= 332 +id-SecurityResult ProtocolIE-ID ::= 333 +id-E-RABSecurityResultItem ProtocolIE-ID ::= 334 +id-E-RABSecurityResultList ProtocolIE-ID ::= 335 +id-RAT-Restrictions ProtocolIE-ID ::= 336 +id-UEContextReferenceatSourceeNB ProtocolIE-ID ::= 337 +id-LTE-NTN-TAI-Information ProtocolIE-ID ::= 339 +id-SourceNodeTransportLayerAddress ProtocolIE-ID ::= 340 +id-E-RABToBeUpdatedList ProtocolIE-ID ::= 341 +id-E-RABToBeUpdatedItem ProtocolIE-ID ::= 342 +id-SourceSNID ProtocolIE-ID ::= 343 +id-LoggedMDTTrigger ProtocolIE-ID ::= 344 +id-SensorMeasurementConfiguration ProtocolIE-ID ::= 345 +id-M4ReportAmount ProtocolIE-ID ::= 346 +id-M5ReportAmount ProtocolIE-ID ::= 347 +id-M6ReportAmount ProtocolIE-ID ::= 348 +id-M7ReportAmount ProtocolIE-ID ::= 349 +id-TimeBasedHandoverInformation ProtocolIE-ID ::= 350 +id-Bearers-SubjectToDLDiscarding-Item ProtocolIE-ID ::= 351 +id-Bearers-SubjectToDLDiscardingList ProtocolIE-ID ::= 352 +id-CoarseUELocationRequested ProtocolIE-ID ::= 353 +id-CoarseUELocation ProtocolIE-ID ::= 354 +id-TimeRefDistribution ProtocolIE-ID ::= 355 +id-RequestedTNLInfo ProtocolIE-ID ::= 356 + + +END diff --git a/s1ap/testdata/asn1/S1AP-Containers.asn b/s1ap/testdata/asn1/S1AP-Containers.asn new file mode 100644 index 0000000000..3c6e44a4c7 --- /dev/null +++ b/s1ap/testdata/asn1/S1AP-Containers.asn @@ -0,0 +1,196 @@ +-- ************************************************************** +-- +-- Container definitions +-- +-- ************************************************************** + +S1AP-Containers { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +eps-Access (21) modules (3) s1ap (1) version1 (1) s1ap-Containers (5) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + Criticality, + Presence, + PrivateIE-ID, + ProtocolExtensionID, + ProtocolIE-ID +FROM S1AP-CommonDataTypes + + maxPrivateIEs, + maxProtocolExtensions, + maxProtocolIEs +FROM S1AP-Constants; + +-- ************************************************************** +-- +-- Class Definition for Protocol IEs +-- +-- ************************************************************** + +S1AP-PROTOCOL-IES ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Protocol IEs +-- +-- ************************************************************** + +S1AP-PROTOCOL-IES-PAIR ::= CLASS { + &id ProtocolIE-ID UNIQUE, + &firstCriticality Criticality, + &FirstValue, + &secondCriticality Criticality, + &SecondValue, + &presence Presence +} +WITH SYNTAX { + ID &id + FIRST CRITICALITY &firstCriticality + FIRST TYPE &FirstValue + SECOND CRITICALITY &secondCriticality + SECOND TYPE &SecondValue + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Protocol Extensions +-- +-- ************************************************************** + +S1AP-PROTOCOL-EXTENSION ::= CLASS { + &id ProtocolExtensionID UNIQUE, + &criticality Criticality, + &Extension, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + EXTENSION &Extension + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Class Definition for Private IEs +-- +-- ************************************************************** + +S1AP-PRIVATE-IES ::= CLASS { + &id PrivateIE-ID, + &criticality Criticality, + &Value, + &presence Presence +} +WITH SYNTAX { + ID &id + CRITICALITY &criticality + TYPE &Value + PRESENCE &presence +} + +-- ************************************************************** +-- +-- Container for Protocol IEs +-- +-- ************************************************************** + +ProtocolIE-Container {S1AP-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (0..maxProtocolIEs)) OF + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-SingleContainer {S1AP-PROTOCOL-IES : IEsSetParam} ::= + ProtocolIE-Field {{IEsSetParam}} + +ProtocolIE-Field {S1AP-PROTOCOL-IES : IEsSetParam} ::= SEQUENCE { + id S1AP-PROTOCOL-IES.&id ({IEsSetParam}), + criticality S1AP-PROTOCOL-IES.&criticality ({IEsSetParam}{@id}), + value S1AP-PROTOCOL-IES.&Value ({IEsSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Protocol IE Pairs +-- +-- ************************************************************** +ProtocolIE-ContainerPair {S1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= + SEQUENCE (SIZE (0..maxProtocolIEs)) OF + ProtocolIE-FieldPair {{IEsSetParam}} + +ProtocolIE-FieldPair {S1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= SEQUENCE { + id S1AP-PROTOCOL-IES-PAIR.&id ({IEsSetParam}), + firstCriticality S1AP-PROTOCOL-IES-PAIR.&firstCriticality ({IEsSetParam}{@id}), + firstValue S1AP-PROTOCOL-IES-PAIR.&FirstValue ({IEsSetParam}{@id}), + secondCriticality S1AP-PROTOCOL-IES-PAIR.&secondCriticality ({IEsSetParam}{@id}), + secondValue S1AP-PROTOCOL-IES-PAIR.&SecondValue ({IEsSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container Lists for Protocol IE Containers +-- +-- ************************************************************** + +ProtocolIE-ContainerList {INTEGER : lowerBound, INTEGER : upperBound, S1AP-PROTOCOL-IES : IEsSetParam} ::= + SEQUENCE (SIZE (lowerBound..upperBound)) OF + ProtocolIE-SingleContainer {{IEsSetParam}} + +ProtocolIE-ContainerPairList {INTEGER : lowerBound, INTEGER : upperBound, S1AP-PROTOCOL-IES-PAIR : IEsSetParam} ::= + SEQUENCE (SIZE (lowerBound..upperBound)) OF + ProtocolIE-ContainerPair {{IEsSetParam}} + +-- ************************************************************** +-- +-- Container for Protocol Extensions +-- +-- ************************************************************** + +ProtocolExtensionContainer {S1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= + SEQUENCE (SIZE (1..maxProtocolExtensions)) OF + ProtocolExtensionField {{ExtensionSetParam}} + +ProtocolExtensionField {S1AP-PROTOCOL-EXTENSION : ExtensionSetParam} ::= SEQUENCE { + id S1AP-PROTOCOL-EXTENSION.&id ({ExtensionSetParam}), + criticality S1AP-PROTOCOL-EXTENSION.&criticality ({ExtensionSetParam}{@id}), + extensionValue S1AP-PROTOCOL-EXTENSION.&Extension ({ExtensionSetParam}{@id}) +} + +-- ************************************************************** +-- +-- Container for Private IEs +-- +-- ************************************************************** + +PrivateIE-Container {S1AP-PRIVATE-IES : IEsSetParam } ::= + SEQUENCE (SIZE (1.. maxPrivateIEs)) OF + PrivateIE-Field {{IEsSetParam}} + +PrivateIE-Field {S1AP-PRIVATE-IES : IEsSetParam} ::= SEQUENCE { + id S1AP-PRIVATE-IES.&id ({IEsSetParam}), + criticality S1AP-PRIVATE-IES.&criticality ({IEsSetParam}{@id}), + value S1AP-PRIVATE-IES.&Value ({IEsSetParam}{@id}) +} + +END diff --git a/s1ap/testdata/asn1/S1AP-IEs.asn b/s1ap/testdata/asn1/S1AP-IEs.asn new file mode 100644 index 0000000000..05430d4346 --- /dev/null +++ b/s1ap/testdata/asn1/S1AP-IEs.asn @@ -0,0 +1,3388 @@ +-- ************************************************************** +-- +-- Information Element Definitions +-- +-- ************************************************************** + +S1AP-IEs { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +eps-Access (21) modules (3) s1ap (1) version1 (1) s1ap-IEs (2) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +IMPORTS + id-E-RABInformationListItem, + id-E-RABItem, + id-GUMMEIType, + id-Bearers-SubjectToStatusTransfer-Item, + id-Time-Synchronisation-Info, + id-x2TNLConfigurationInfo, + id-eNBX2ExtendedTransportLayerAddresses, + id-MDTConfiguration, + id-Time-UE-StayedInCell-EnhancedGranularity, + id-HO-Cause, + id-M3Configuration, + id-M4Configuration, + id-M5Configuration, + id-MDT-Location-Info, + id-SignallingBasedMDTPLMNList, + id-MobilityInformation, + id-ULCOUNTValueExtended, + id-DLCOUNTValueExtended, + id-ReceiveStatusOfULPDCPSDUsExtended, + id-eNBIndirectX2TransportLayerAddresses, + id-Muting-Availability-Indication, + id-Muting-Pattern-Information, + id-NRrestrictioninEPSasSecondaryRAT, + id-NRrestrictionin5GS, + id-Synchronisation-Information, + id-uE-HistoryInformationFromTheUE, + id-LoggedMBSFNMDT, + id-SON-Information-Report, + id-RecommendedCellItem, + id-RecommendedENBItem, + id-ProSeUEtoNetworkRelaying, + id-ULCOUNTValuePDCP-SNlength18, + id-DLCOUNTValuePDCP-SNlength18, + id-ReceiveStatusOfULPDCPSDUsPDCP-SNlength18, + id-M6Configuration, + id-M7Configuration, + id-RAT-Type, + id-extended-e-RAB-MaximumBitrateDL, + id-extended-e-RAB-MaximumBitrateUL, + id-extended-e-RAB-GuaranteedBitrateDL, + id-extended-e-RAB-GuaranteedBitrateUL, + id-extended-uEaggregateMaximumBitRateDL, + id-extended-uEaggregateMaximumBitRateUL, + id-SecondaryRATDataUsageReportItem, + id-E-RABUsageReportItem, + id-UEAppLayerMeasConfig, + id-serviceType, + id-UnlicensedSpectrumRestriction, + id-CNTypeRestrictions, + id-DownlinkPacketLossRate, + id-UplinkPacketLossRate, + id-BluetoothMeasurementConfiguration, + id-WLANMeasurementConfiguration, + id-LastNG-RANPLMNIdentity, + id-PSCellInformation, + id-IMSvoiceEPSfallbackfrom5G, + id-RequestTypeAdditionalInfo, + id-AdditionalRRMPriorityIndex, + id-ContextatSource, + id-IntersystemMeasurementConfiguration, + id-SourceNodeID, + id-NB-IoT-RLF-Report-Container, + id-MDTConfigurationNR, + id-DAPSRequestInfo, + id-DAPSResponseInfoList, + id-DAPSResponseInfoItem, + id-Bearers-SubjectToEarlyStatusTransfer-Item, + id-TraceCollectionEntityURI, + id-EmergencyIndicator, + id-SourceTransportLayerAddress, + id-lastVisitedPSCellList, + id-RACSIndication, + id-SecurityIndication, + id-E-RABSecurityResultItem, + id-E-RABSecurityResultList, + id-RAT-Restrictions, + id-UEContextReferenceatSourceeNB, + id-LTE-NTN-TAI-Information, + id-SourceNodeTransportLayerAddress, + id-SourceSNID, + id-Direct-Forwarding-Path-Availability, + id-LoggedMDTTrigger, + id-SensorMeasurementConfiguration, + id-M4ReportAmount, + id-M5ReportAmount, + id-M6ReportAmount, + id-M7ReportAmount, + id-TimeBasedHandoverInformation, + id-Bearers-SubjectToDLDiscarding-Item, + id-Bearers-SubjectToDLDiscardingList, + id-TimeRefDistribution, + id-RequestedTNLInfo, + maxnoofCSGs, + maxnoofE-RABs, + maxnoofErrors, + maxnoofBPLMNs, + maxnoofPLMNsPerMME, + maxnoofTACs, + maxnoofEPLMNs, + maxnoofEPLMNsPlusOne, + maxnoofForbLACs, + maxnoofForbTACs, + maxnoofCellsinUEHistoryInfo, + maxnoofCellID, + maxnoofDCNs, + maxnoofEmergencyAreaID, + maxnoofTAIforWarning, + maxnoofCellinTAI, + maxnoofCellinEAI, + maxnoofeNBX2TLAs, + maxnoofeNBX2ExtTLAs, + maxnoofeNBX2GTPTLAs, + maxnoofRATs, + maxnoofGroupIDs, + maxnoofMMECs, + maxnoofTAforMDT, + maxnoofCellIDforMDT, + maxnoofMDTPLMNs, + maxnoofCellsforRestart, + maxnoofRestartTAIs, + maxnoofRestartEmergencyAreaIDs, + maxnoofMBSFNAreaMDT, + maxEARFCN, + maxnoofCellsineNB, + maxnoofRecommendedCells, + maxnoofRecommendedENBs, + maxnooftimeperiods, + maxnoofCellIDforQMC, + maxnoofTAforQMC, + maxnoofPLMNforQMC, + maxnoofBluetoothName, + maxnoofWLANName, + maxnoofConnectedengNBs, + maxnoofPC5QoSFlows, + maxnooffrequencies, + maxNARFCN, + maxRS-IndexCellQual, + maxnoofPSCellsPerPrimaryCellinUEHistoryInfo, + maxnoofTACsInNTN, + maxnoofSensorName +FROM S1AP-Constants + + Criticality, + ProcedureCode, + ProtocolIE-ID, + TriggeringMessage +FROM S1AP-CommonDataTypes + + ProtocolExtensionContainer{}, + S1AP-PROTOCOL-EXTENSION, + ProtocolIE-SingleContainer{}, + S1AP-PROTOCOL-IES + +FROM S1AP-Containers; + +-- A + +Additional-GUTI::= SEQUENCE { + gUMMEI GUMMEI, + m-TMSI M-TMSI, + iE-Extensions ProtocolExtensionContainer { {Additional-GUTI-ExtIEs} } OPTIONAL, + ... +} + +Additional-GUTI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +AdditionalRRMPriorityIndex ::= BIT STRING (SIZE(32)) + +AerialUEsubscriptionInformation ::= ENUMERATED { + allowed, + not-allowed, + ... +} + +AreaScopeOfMDT ::= CHOICE { + cellBased CellBasedMDT, + tABased TABasedMDT, + pLMNWide NULL, + ..., + tAIBased TAIBasedMDT +} + + +AreaScopeOfQMC ::= CHOICE { + cellBased CellBasedQMC, + tABased TABasedQMC, + tAIBased TAIBasedQMC, + pLMNAreaBased PLMNAreaBasedQMC, + ... +} +AllocationAndRetentionPriority ::= SEQUENCE { + priorityLevel PriorityLevel, + pre-emptionCapability Pre-emptionCapability, + pre-emptionVulnerability Pre-emptionVulnerability, + iE-Extensions ProtocolExtensionContainer { {AllocationAndRetentionPriority-ExtIEs} } OPTIONAL, + ... +} + +AllocationAndRetentionPriority-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +AssistanceDataForCECapableUEs ::= SEQUENCE { + cellIdentifierAndCELevelForCECapableUEs CellIdentifierAndCELevelForCECapableUEs, + iE-Extensions ProtocolExtensionContainer { { InformationForCECapableUEs-ExtIEs} } OPTIONAL, + ... +} + +InformationForCECapableUEs-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +AssistanceDataForPaging ::= SEQUENCE { + assistanceDataForRecommendedCells AssistanceDataForRecommendedCells OPTIONAL, + assistanceDataForCECapableUEs AssistanceDataForCECapableUEs OPTIONAL, + pagingAttemptInformation PagingAttemptInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { AssistanceDataForPaging-ExtIEs} } OPTIONAL, + ... +} + +AssistanceDataForPaging-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +AssistanceDataForRecommendedCells ::= SEQUENCE { + recommendedCellsForPaging RecommendedCellsForPaging, + iE-Extensions ProtocolExtensionContainer { { AssistanceDataForRecommendedCells-ExtIEs} } OPTIONAL, + ... +} + +AssistanceDataForRecommendedCells-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- B + +Bearers-SubjectToStatusTransferList ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { { Bearers-SubjectToStatusTransfer-ItemIEs } } + +Bearers-SubjectToStatusTransfer-ItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-Bearers-SubjectToStatusTransfer-Item CRITICALITY ignore TYPE Bearers-SubjectToStatusTransfer-Item PRESENCE mandatory }, + ... +} +Bearers-SubjectToStatusTransfer-Item ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + uL-COUNTvalue COUNTvalue, + dL-COUNTvalue COUNTvalue, + receiveStatusofULPDCPSDUs ReceiveStatusofULPDCPSDUs OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {Bearers-SubjectToStatusTransfer-ItemExtIEs} } OPTIONAL, + ... +} + +Bearers-SubjectToStatusTransfer-ItemExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-ULCOUNTValueExtended CRITICALITY ignore EXTENSION COUNTValueExtended PRESENCE optional}| + { ID id-DLCOUNTValueExtended CRITICALITY ignore EXTENSION COUNTValueExtended PRESENCE optional}| + { ID id-ReceiveStatusOfULPDCPSDUsExtended CRITICALITY ignore EXTENSION ReceiveStatusOfULPDCPSDUsExtended PRESENCE optional}| + { ID id-ULCOUNTValuePDCP-SNlength18 CRITICALITY ignore EXTENSION COUNTvaluePDCP-SNlength18 PRESENCE optional}| + { ID id-DLCOUNTValuePDCP-SNlength18 CRITICALITY ignore EXTENSION COUNTvaluePDCP-SNlength18 PRESENCE optional}| + { ID id-ReceiveStatusOfULPDCPSDUsPDCP-SNlength18 CRITICALITY ignore EXTENSION ReceiveStatusOfULPDCPSDUsPDCP-SNlength18 PRESENCE optional}, + ... +} + +Bearers-SubjectToEarlyStatusTransferList ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { { Bearers-SubjectToEarlyStatusTransfer-ItemIEs } } + +Bearers-SubjectToEarlyStatusTransfer-ItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-Bearers-SubjectToEarlyStatusTransfer-Item CRITICALITY ignore TYPE Bearers-SubjectToEarlyStatusTransfer-Item PRESENCE mandatory}, + ... +} + +Bearers-SubjectToEarlyStatusTransfer-Item ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + dLCOUNT-PDCP-SNlength DLCOUNT-PDCP-SNlength, + iE-Extensions ProtocolExtensionContainer { {Bearers-SubjectToEarlyStatusTransfer-ItemExtIEs} } OPTIONAL, + ... +} + +Bearers-SubjectToEarlyStatusTransfer-ItemExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Bearers-SubjectToDLDiscardingList ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { { Bearers-SubjectToDLDiscarding-ItemIEs } +} + +Bearers-SubjectToDLDiscarding-ItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-Bearers-SubjectToDLDiscarding-Item CRITICALITY ignore TYPE Bearers-SubjectToDLDiscarding-Item PRESENCE mandatory}, + ... +} + +Bearers-SubjectToDLDiscarding-Item ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + dL-Discarding DLDiscarding, + iE-Extensions ProtocolExtensionContainer { {Bearers-SubjectToDLDiscarding-ItemExtIEs} } OPTIONAL, + ... +} + +Bearers-SubjectToDLDiscarding-ItemExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +BearerType ::= ENUMERATED { + non-IP, + ... +} + +BitRate ::= INTEGER (0..10000000000) + +BluetoothMeasurementConfiguration ::= SEQUENCE { + bluetoothMeasConfig BluetoothMeasConfig, + bluetoothMeasConfigNameList BluetoothMeasConfigNameList OPTIONAL, + bt-rssi ENUMERATED {true, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { BluetoothMeasurementConfiguration-ExtIEs } } OPTIONAL, + ... +} + +BluetoothMeasurementConfiguration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +BluetoothMeasConfigNameList ::= SEQUENCE (SIZE(1..maxnoofBluetoothName)) OF BluetoothName + +BluetoothMeasConfig::= ENUMERATED {setup,...} + +BluetoothName ::= OCTET STRING (SIZE (1..248)) + +BPLMNs ::= SEQUENCE (SIZE(1.. maxnoofBPLMNs)) OF PLMNidentity + +BroadcastCancelledAreaList ::= CHOICE { + cellID-Cancelled CellID-Cancelled, + tAI-Cancelled TAI-Cancelled, + emergencyAreaID-Cancelled EmergencyAreaID-Cancelled, + ... +} + +BroadcastCompletedAreaList ::= CHOICE { + cellID-Broadcast CellID-Broadcast, + tAI-Broadcast TAI-Broadcast, + emergencyAreaID-Broadcast EmergencyAreaID-Broadcast, + ... +} + + +-- C + +CancelledCellinEAI ::= SEQUENCE (SIZE(1..maxnoofCellinEAI)) OF CancelledCellinEAI-Item + +CancelledCellinEAI-Item ::= SEQUENCE { + eCGI EUTRAN-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CancelledCellinEAI-Item-ExtIEs} } OPTIONAL, + ... +} + +CancelledCellinEAI-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CancelledCellinTAI ::= SEQUENCE (SIZE(1..maxnoofCellinTAI)) OF CancelledCellinTAI-Item + +CancelledCellinTAI-Item ::= SEQUENCE{ + eCGI EUTRAN-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CancelledCellinTAI-Item-ExtIEs} } OPTIONAL, + ... +} + +CancelledCellinTAI-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Cause ::= CHOICE { + radioNetwork CauseRadioNetwork, + transport CauseTransport, + nas CauseNas, + protocol CauseProtocol, + misc CauseMisc, + ... +} + +CauseMisc ::= ENUMERATED { + control-processing-overload, + not-enough-user-plane-processing-resources, + hardware-failure, + om-intervention, + unspecified, + unknown-PLMN, +... +} + +CauseProtocol ::= ENUMERATED { + transfer-syntax-error, + abstract-syntax-error-reject, + abstract-syntax-error-ignore-and-notify, + message-not-compatible-with-receiver-state, + semantic-error, + abstract-syntax-error-falsely-constructed-message, + unspecified, + ... +} + +CauseRadioNetwork ::= ENUMERATED { + unspecified, + tx2relocoverall-expiry, + successful-handover, + release-due-to-eutran-generated-reason, + handover-cancelled, + partial-handover, + ho-failure-in-target-EPC-eNB-or-target-system, + ho-target-not-allowed, + tS1relocoverall-expiry, + tS1relocprep-expiry, + cell-not-available, + unknown-targetID, + no-radio-resources-available-in-target-cell, + unknown-mme-ue-s1ap-id, + unknown-enb-ue-s1ap-id, + unknown-pair-ue-s1ap-id, + handover-desirable-for-radio-reason, + time-critical-handover, + resource-optimisation-handover, + reduce-load-in-serving-cell, + user-inactivity, + radio-connection-with-ue-lost, + load-balancing-tau-required, + cs-fallback-triggered, + ue-not-available-for-ps-service, + radio-resources-not-available, + failure-in-radio-interface-procedure, + invalid-qos-combination, + interrat-redirection, + interaction-with-other-procedure, + unknown-E-RAB-ID, + multiple-E-RAB-ID-instances, + encryption-and-or-integrity-protection-algorithms-not-supported, + s1-intra-system-handover-triggered, + s1-inter-system-handover-triggered, + x2-handover-triggered, + ..., + redirection-towards-1xRTT, + not-supported-QCI-value, + invalid-CSG-Id, + release-due-to-pre-emption, + n26-interface-not-available, + insufficient-ue-capabilities, + maximum-bearer-pre-emption-rate-exceeded, + up-integrity-protection-not-possible, + release-due-to-discontinuous-coverage + +} + +CauseTransport ::= ENUMERATED { + transport-resource-unavailable, + unspecified, + ... +} + +CauseNas ::= ENUMERATED { + normal-release, + authentication-failure, + detach, + unspecified, + ..., + csg-subscription-expiry, + uE-not-in-PLMN-serving-area, + iab-not-authorized +} + +CellAccessMode ::= ENUMERATED { + hybrid, + ... +} + +CellIdentifierAndCELevelForCECapableUEs ::= SEQUENCE { + global-Cell-ID EUTRAN-CGI, + cELevel CELevel, + iE-Extensions ProtocolExtensionContainer { { CellIdentifierAndCELevelForCECapableUEs-ExtIEs} } OPTIONAL, + ... +} + +CellIdentifierAndCELevelForCECapableUEs-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CELevel ::= OCTET STRING + +CE-mode-B-SupportIndicator ::= ENUMERATED { + supported, + ... +} + +CellIdentity ::= BIT STRING (SIZE (28)) + +CellID-Broadcast ::= SEQUENCE (SIZE(1..maxnoofCellID)) OF CellID-Broadcast-Item + +CellID-Broadcast-Item ::= SEQUENCE { + eCGI EUTRAN-CGI, + iE-Extensions ProtocolExtensionContainer { {CellID-Broadcast-Item-ExtIEs} } OPTIONAL, + ... +} + +CellID-Broadcast-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CellID-Cancelled::= SEQUENCE (SIZE(1..maxnoofCellID)) OF CellID-Cancelled-Item + +CellID-Cancelled-Item ::= SEQUENCE { + eCGI EUTRAN-CGI, + numberOfBroadcasts NumberOfBroadcasts, + iE-Extensions ProtocolExtensionContainer { {CellID-Cancelled-Item-ExtIEs} } OPTIONAL, + ... +} +CellID-Cancelled-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CellBasedMDT::= SEQUENCE { + cellIdListforMDT CellIdListforMDT, + iE-Extensions ProtocolExtensionContainer { {CellBasedMDT-ExtIEs} } OPTIONAL, + ... +} + +CellBasedMDT-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIdListforMDT ::= SEQUENCE (SIZE(1..maxnoofCellIDforMDT)) OF EUTRAN-CGI + +CellBasedQMC::= SEQUENCE { + cellIdListforQMC CellIdListforQMC, + iE-Extensions ProtocolExtensionContainer { {CellBasedQMC-ExtIEs} } OPTIONAL, + ... +} + +CellBasedQMC-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CellIdListforQMC ::= SEQUENCE (SIZE(1..maxnoofCellIDforQMC)) OF EUTRAN-CGI + +Cdma2000PDU ::= OCTET STRING + +Cdma2000RATType ::= ENUMERATED { + hRPD, + onexRTT, + ... +} + +Cdma2000SectorID ::= OCTET STRING + +Cdma2000HOStatus ::= ENUMERATED { + hOSuccess, + hOFailure, + ... +} + +Cdma2000HORequiredIndication ::= ENUMERATED { + true, + ... +} + +Cdma2000OneXSRVCCInfo ::= SEQUENCE { + cdma2000OneXMEID Cdma2000OneXMEID, + cdma2000OneXMSI Cdma2000OneXMSI, + cdma2000OneXPilot Cdma2000OneXPilot, + iE-Extensions ProtocolExtensionContainer { {Cdma2000OneXSRVCCInfo-ExtIEs} } OPTIONAL, + ... +} + +Cdma2000OneXSRVCCInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Cdma2000OneXMEID ::= OCTET STRING + +Cdma2000OneXMSI ::= OCTET STRING + +Cdma2000OneXPilot ::= OCTET STRING + +Cdma2000OneXRAND ::= OCTET STRING + + +Cell-Size ::= ENUMERATED {verysmall, small, medium, large, ...} + +CellType ::= SEQUENCE { + cell-Size Cell-Size, + iE-Extensions ProtocolExtensionContainer { { CellType-ExtIEs}} OPTIONAL, + ... +} + +CellType-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CGI ::= SEQUENCE { + pLMNidentity PLMNidentity, + lAC LAC, + cI CI, + rAC RAC OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {CGI-ExtIEs} } OPTIONAL, + ... + } + +CGI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CI ::= OCTET STRING (SIZE (2)) + +CNDomain ::= ENUMERATED { + ps, + cs +} + +CNTypeRestrictions::= SEQUENCE (SIZE(1.. maxnoofEPLMNsPlusOne)) OF CNTypeRestrictions-Item + +CNTypeRestrictions-Item ::= SEQUENCE { + pLMN-Identity PLMNidentity, + cNType CNType, + iE-Extensions ProtocolExtensionContainer { { CNTypeRestrictions-Item-ExtIEs} } OPTIONAL, + ... +} + +CNTypeRestrictions-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CNType ::= ENUMERATED { + fiveGCForbidden, + ..., + epc-Forbiddden +} + +CoarseUELocationRequested ::= ENUMERATED { + true, + ... +} + +CoarseUELocation ::= OCTET STRING + +ConcurrentWarningMessageIndicator ::= ENUMERATED { + true +} + +ConnectedengNBList ::= SEQUENCE (SIZE(1..maxnoofConnectedengNBs)) OF ConnectedengNBItem + +ConnectedengNBItem ::= SEQUENCE { + en-gNB-ID En-gNB-ID, + supportedTAs SupportedTAs, + iE-Extensions ProtocolExtensionContainer { {ConnectedengNBItem-ExtIEs} } OPTIONAL, + ... +} + +ConnectedengNBItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ContextatSource ::= SEQUENCE { + sourceNG-RAN-node-ID Global-RAN-NODE-ID, + rAN-UE-NGAP-ID RAN-UE-NGAP-ID, + iE-Extensions ProtocolExtensionContainer { {ContextatSource-ExtIEs} } OPTIONAL, + ... +} + +ContextatSource-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Correlation-ID ::= OCTET STRING (SIZE (4)) + +CSFallbackIndicator ::= ENUMERATED { + cs-fallback-required, + ..., + cs-fallback-high-priority +} + +AdditionalCSFallbackIndicator ::= ENUMERATED { + no-restriction, + restriction, + ... +} + +CSG-Id ::= BIT STRING (SIZE (27)) + + +CSG-IdList ::= SEQUENCE (SIZE (1.. maxnoofCSGs)) OF CSG-IdList-Item + +CSG-IdList-Item ::= SEQUENCE { + cSG-Id CSG-Id, + iE-Extensions ProtocolExtensionContainer { {CSG-IdList-Item-ExtIEs} } OPTIONAL, + ... +} + +CSG-IdList-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CSGMembershipStatus ::= ENUMERATED { + member, + not-member +} + + +COUNTvalue ::= SEQUENCE { + pDCP-SN PDCP-SN, + hFN HFN, + iE-Extensions ProtocolExtensionContainer { {COUNTvalue-ExtIEs} } OPTIONAL, + ... +} +COUNTvalue-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +COUNTValueExtended ::= SEQUENCE { + pDCP-SNExtended PDCP-SNExtended, + hFNModified HFNModified, + iE-Extensions ProtocolExtensionContainer { {COUNTValueExtended-ExtIEs} } OPTIONAL, + ... +} + +COUNTValueExtended-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +COUNTvaluePDCP-SNlength18 ::= SEQUENCE { + pDCP-SNlength18 PDCP-SNlength18, + hFNforPDCP-SNlength18 HFNforPDCP-SNlength18, + iE-Extensions ProtocolExtensionContainer { {COUNTvaluePDCP-SNlength18-ExtIEs} } OPTIONAL, + ... +} + +COUNTvaluePDCP-SNlength18-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Coverage-Level ::= ENUMERATED { + extendedcoverage, + ... +} + +CriticalityDiagnostics ::= SEQUENCE { + procedureCode ProcedureCode OPTIONAL, + triggeringMessage TriggeringMessage OPTIONAL, + procedureCriticality Criticality OPTIONAL, + iEsCriticalityDiagnostics CriticalityDiagnostics-IE-List OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-ExtIEs}} OPTIONAL, + ... +} + +CriticalityDiagnostics-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CriticalityDiagnostics-IE-List ::= SEQUENCE (SIZE (1.. maxnoofErrors)) OF CriticalityDiagnostics-IE-Item + +CriticalityDiagnostics-IE-Item ::= SEQUENCE { + iECriticality Criticality, + iE-ID ProtocolIE-ID, + typeOfError TypeOfError, + iE-Extensions ProtocolExtensionContainer {{CriticalityDiagnostics-IE-Item-ExtIEs}} OPTIONAL, + ... +} + +CriticalityDiagnostics-IE-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +-- D + +DAPSRequestInfo ::= SEQUENCE { + dAPSIndicator ENUMERATED {dAPS-HO-required, ...}, + iE-Extensions ProtocolExtensionContainer { {DAPSRequestInfo-ExtIEs} } OPTIONAL, + ... +} + +DAPSRequestInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DAPSResponseInfoList ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { { DAPSResponseInfoListIEs } } +DAPSResponseInfoListIEs S1AP-PROTOCOL-IES ::= { + { ID id-DAPSResponseInfoItem CRITICALITY ignore TYPE DAPSResponseInfoItem PRESENCE mandatory}, + ... +} + +DAPSResponseInfoItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + dAPSResponseInfo DAPSResponseInfo, + iE-Extensions ProtocolExtensionContainer { {DAPSResponseInfoItem-ExtIEs} } OPTIONAL, + ... +} + +DAPSResponseInfoItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +DAPSResponseInfo ::= SEQUENCE { + dapsresponseindicator ENUMERATED {dAPS-HO-accepted,dAPS-HO-not-accepted,...}, + iE-Extensions ProtocolExtensionContainer { { DAPSResponseInfo-ExtIEs} } OPTIONAL, + ... +} + +DAPSResponseInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DataCodingScheme ::= BIT STRING (SIZE (8)) + +DataSize ::= INTEGER(1..4095, ...) + +DCN-ID ::= INTEGER (0..65535) + +ServedDCNs ::= SEQUENCE (SIZE(0..maxnoofDCNs)) OF ServedDCNsItem + +ServedDCNsItem ::= SEQUENCE { + dCN-ID DCN-ID, + relativeDCNCapacity RelativeMMECapacity, + iE-Extensions ProtocolExtensionContainer { {ServedDCNsItem-ExtIEs} } OPTIONAL, + ... +} + +ServedDCNsItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DL-CP-SecurityInformation ::= SEQUENCE { + dl-NAS-MAC DL-NAS-MAC, + iE-Extensions ProtocolExtensionContainer { { DL-CP-SecurityInformation-ExtIEs} } OPTIONAL, + ... +} + +DL-CP-SecurityInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +DL-Forwarding ::= ENUMERATED { + dL-Forwarding-proposed, + ... +} + +DL-NAS-MAC ::= BIT STRING (SIZE (16)) + +DLCOUNT-PDCP-SNlength ::= CHOICE { + dLCOUNTValuePDCP-SNlength12 COUNTvalue, + dLCOUNTValuePDCP-SNlength15 COUNTValueExtended, + dLCOUNTValuePDCP-SNlength18 COUNTvaluePDCP-SNlength18, + ... +} + +DLDiscarding ::= CHOICE { + discardDLCOUNTValuePDCP-SNlength12 COUNTvalue, + discardDLCOUNTValuePDCP-SNlength15 COUNTValueExtended, + discardDLCOUNTValuePDCP-SNlength18 COUNTvaluePDCP-SNlength18, + ... +} + +Direct-Forwarding-Path-Availability ::= ENUMERATED { + directPathAvailable, + ... +} + +Data-Forwarding-Not-Possible ::= ENUMERATED { + data-Forwarding-not-Possible, + ... +} + +DLNASPDUDeliveryAckRequest ::= ENUMERATED { + requested, + ... +} + +-- E + +EARFCN ::= INTEGER(0..maxEARFCN, ...) + +ECGIList ::= SEQUENCE (SIZE(1..maxnoofCellID)) OF EUTRAN-CGI + +PWSfailedECGIList ::= SEQUENCE (SIZE(1..maxnoofCellsineNB)) OF EUTRAN-CGI + +EDT-Session ::= ENUMERATED { + true, + ... +} + +EmergencyAreaIDList ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaID + +EmergencyAreaID ::= OCTET STRING (SIZE (3)) +EmergencyAreaID-Broadcast ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaID-Broadcast-Item + +EmergencyAreaID-Broadcast-Item ::= SEQUENCE { + emergencyAreaID EmergencyAreaID, + completedCellinEAI CompletedCellinEAI, + iE-Extensions ProtocolExtensionContainer { {EmergencyAreaID-Broadcast-Item-ExtIEs} } OPTIONAL, + ... +} + +EmergencyAreaID-Broadcast-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EmergencyAreaID-Cancelled ::= SEQUENCE (SIZE(1..maxnoofEmergencyAreaID)) OF EmergencyAreaID-Cancelled-Item + +EmergencyAreaID-Cancelled-Item ::= SEQUENCE { + emergencyAreaID EmergencyAreaID, + cancelledCellinEAI CancelledCellinEAI, + iE-Extensions ProtocolExtensionContainer { {EmergencyAreaID-Cancelled-Item-ExtIEs} } OPTIONAL, + ... +} + +EmergencyAreaID-Cancelled-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CompletedCellinEAI ::= SEQUENCE (SIZE(1..maxnoofCellinEAI)) OF CompletedCellinEAI-Item + +CompletedCellinEAI-Item ::= SEQUENCE { + eCGI EUTRAN-CGI, + iE-Extensions ProtocolExtensionContainer { {CompletedCellinEAI-Item-ExtIEs} } OPTIONAL, + ... +} + +CompletedCellinEAI-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ECGI-List ::= SEQUENCE (SIZE(1..maxnoofCellsineNB)) OF EUTRAN-CGI + +EmergencyAreaIDListForRestart ::= SEQUENCE (SIZE(1..maxnoofRestartEmergencyAreaIDs)) OF EmergencyAreaID + +EmergencyIndicator ::= ENUMERATED { + true, + ... +} + +ENB-EarlyStatusTransfer-TransparentContainer ::= SEQUENCE { + bearers-SubjectToEarlyStatusTransferList Bearers-SubjectToEarlyStatusTransferList, + iE-Extensions ProtocolExtensionContainer { {ENB-EarlyStatusTransfer-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} +ENB-EarlyStatusTransfer-TransparentContainer-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-Bearers-SubjectToDLDiscardingList CRITICALITY ignore EXTENSION Bearers-SubjectToDLDiscardingList PRESENCE optional}, + ... +} + +ENB-ID ::= CHOICE { + macroENB-ID BIT STRING (SIZE(20)), + homeENB-ID BIT STRING (SIZE(28)), + ... , + short-macroENB-ID BIT STRING (SIZE(18)), + long-macroENB-ID BIT STRING (SIZE(21)) +} + +En-gNB-ID ::= BIT STRING (SIZE(22..32, ...)) + +GERAN-Cell-ID ::= SEQUENCE { + lAI LAI, + rAC RAC, + cI CI, + iE-Extensions ProtocolExtensionContainer { { GERAN-Cell-ID-ExtIEs} } OPTIONAL, + ... +} + +GERAN-Cell-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Global-ENB-ID ::= SEQUENCE { + pLMNidentity PLMNidentity, + eNB-ID ENB-ID, + iE-Extensions ProtocolExtensionContainer { {GlobalENB-ID-ExtIEs} } OPTIONAL, + ... +} + +GlobalENB-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Global-en-gNB-ID ::= SEQUENCE { + pLMNidentity PLMNidentity, + en-gNB-ID En-gNB-ID, + iE-Extensions ProtocolExtensionContainer { {Global-en-gNB-ID-ExtIEs} } OPTIONAL, + ... +} + +Global-en-gNB-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GUMMEIList::= SEQUENCE (SIZE (1.. maxnoofMMECs)) OF GUMMEI + +ENB-StatusTransfer-TransparentContainer ::= SEQUENCE { + bearers-SubjectToStatusTransferList Bearers-SubjectToStatusTransferList, + iE-Extensions ProtocolExtensionContainer { {ENB-StatusTransfer-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} + +ENB-StatusTransfer-TransparentContainer-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ENB-UE-S1AP-ID ::= INTEGER (0..16777215) + +ENBname ::= PrintableString (SIZE (1..150,...)) + +ENBX2TLAs ::= SEQUENCE (SIZE(1.. maxnoofeNBX2TLAs)) OF TransportLayerAddress + +EncryptionAlgorithms ::= BIT STRING (SIZE (16,...)) + +EN-DCSONConfigurationTransfer ::= SEQUENCE { + transfertype EN-DCSONTransferType, + sONInformation SONInformation, + x2TNLConfigInfo X2TNLConfigurationInfo OPTIONAL, + -- The above IE shall be present if the SON Information IE contains the SON Information Request IE and the SON Information Request IE is set to the value "X2TNL Configuration Info" + iE-Extensions ProtocolExtensionContainer { {EN-DCSONConfigurationTransfer-ExtIEs} } OPTIONAL, +... +} + +EN-DCSONConfigurationTransfer-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EN-DCSONTransferType ::= CHOICE { + request EN-DCTransferTypeRequest, + reply EN-DCTransferTypeReply, + ... +} + +EN-DCTransferTypeRequest ::= SEQUENCE { + sourceeNB EN-DCSONeNBIdentification, + targetengNB EN-DCSONengNBIdentification, + targeteNB EN-DCSONeNBIdentification OPTIONAL, + associatedTAI TAI OPTIONAL, + broadcast5GSTAI FiveGSTAI OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {EN-DCTransferTypeRequest-ExtIEs} } OPTIONAL, +... +} + +EN-DCTransferTypeRequest-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EN-DCTransferTypeReply ::= SEQUENCE { + sourceengNB EN-DCSONengNBIdentification, + targeteNB EN-DCSONeNBIdentification, + iE-Extensions ProtocolExtensionContainer { {EN-DCTransferTypeReply-ExtIEs} } OPTIONAL, +... +} + +EN-DCTransferTypeReply-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EN-DCSONeNBIdentification ::= SEQUENCE { + globaleNBID Global-ENB-ID, + selectedTAI TAI, + iE-Extensions ProtocolExtensionContainer { {EN-DCSONeNBIdentification-ExtIEs} } OPTIONAL, +... +} + +EN-DCSONeNBIdentification-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EN-DCSONengNBIdentification ::= SEQUENCE { + globalengNBID Global-en-gNB-ID, + selectedTAI TAI, + iE-Extensions ProtocolExtensionContainer { {EN-DCSONengNBIdentification-ExtIEs} } OPTIONAL, +... +} + +EN-DCSONengNBIdentification-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EndIndication ::= ENUMERATED { + no-further-data, + further-data-exists, + ... +} + +EnhancedCoverageRestricted ::= ENUMERATED { + restricted, + ... +} + +CE-ModeBRestricted ::= ENUMERATED { + restricted, + not-restricted, + ... +} + +EPLMNs ::= SEQUENCE (SIZE(1..maxnoofEPLMNs)) OF PLMNidentity +EventType ::= ENUMERATED { + direct, + change-of-serve-cell, + stop-change-of-serve-cell, + ... +} + +E-RAB-ID ::= INTEGER (0..15, ...) +E-RABInformationList ::= SEQUENCE (SIZE (1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { { E-RABInformationListIEs } } + +E-RABInformationListIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABInformationListItem CRITICALITY ignore TYPE E-RABInformationListItem PRESENCE mandatory }, + ... +} + +E-RABInformationListItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + dL-Forwarding DL-Forwarding OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {E-RABInformationListItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABInformationListItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-DAPSRequestInfo CRITICALITY ignore EXTENSION DAPSRequestInfo PRESENCE optional }| + { ID id-SourceTransportLayerAddress CRITICALITY ignore EXTENSION TransportLayerAddress PRESENCE optional}| + { ID id-SecurityIndication CRITICALITY ignore EXTENSION SecurityIndication PRESENCE optional }| + { ID id-SourceNodeTransportLayerAddress CRITICALITY ignore EXTENSION TransportLayerAddress PRESENCE optional}, + ... +} + +E-RABList ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABItemIEs} } + +E-RABItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABItem CRITICALITY ignore TYPE E-RABItem PRESENCE mandatory }, + ... +} + +E-RABItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + cause Cause, + iE-Extensions ProtocolExtensionContainer { {E-RABItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +E-RABLevelQoSParameters ::= SEQUENCE { + qCI QCI, + allocationRetentionPriority AllocationAndRetentionPriority, + gbrQosInformation GBR-QosInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {E-RABQoSParameters-ExtIEs} } OPTIONAL, + ... +} + + +E-RABSecurityResultList ::= SEQUENCE (SIZE (1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { { E-RABSecurityResultListIEs } } + +E-RABSecurityResultListIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABSecurityResultItem CRITICALITY ignore TYPE E-RABSecurityResultItem PRESENCE mandatory }, + ... +} + +E-RABSecurityResultItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + securityResult SecurityResult, + iE-Extensions ProtocolExtensionContainer { { E-RABSecurityResultItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABSecurityResultItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +E-RABUsageReportList ::= SEQUENCE (SIZE(1..maxnooftimeperiods)) OF ProtocolIE-SingleContainer { {E-RABUsageReportItemIEs} } + +E-RABUsageReportItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABUsageReportItem CRITICALITY ignore TYPE E-RABUsageReportItem PRESENCE mandatory }, + ... +} + +E-RABUsageReportItem ::= SEQUENCE { + startTimestamp OCTET STRING (SIZE(4)), + endTimestamp OCTET STRING (SIZE(4)), + usageCountUL INTEGER (0..18446744073709551615), + usageCountDL INTEGER (0..18446744073709551615), + iE-Extensions ProtocolExtensionContainer { { E-RABUsageReportItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABUsageReportItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +E-RABQoSParameters-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extended for introduction of downlink and uplink packet loss rate for enhanced Voice performance -- + { ID id-DownlinkPacketLossRate CRITICALITY ignore EXTENSION Packet-LossRate PRESENCE optional}| + { ID id-UplinkPacketLossRate CRITICALITY ignore EXTENSION Packet-LossRate PRESENCE optional}, + ... +} + +Ethernet-Type ::= ENUMERATED { + true, + ... +} + +EUTRAN-CGI ::= SEQUENCE { + pLMNidentity PLMNidentity, + cell-ID CellIdentity, + iE-Extensions ProtocolExtensionContainer { {EUTRAN-CGI-ExtIEs} } OPTIONAL, + ... +} +EUTRAN-CGI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EUTRANRoundTripDelayEstimationInfo ::= INTEGER (0..2047) + +EventL1LoggedMDTConfig ::= SEQUENCE { + l1Threshold MeasurementThresholdL1LoggedMDT, + hysteresis Hysteresis, + timeToTrigger TimeToTrigger, + iE-Extensions ProtocolExtensionContainer { { EventL1LoggedMDTConfig-ExtIEs} } OPTIONAL, + ... +} + +EventL1LoggedMDTConfig-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +EventTrigger::= CHOICE { + outOfCoverage ENUMERATED {true, ...}, + eventL1LoggedMDTConfig EventL1LoggedMDTConfig, + choice-Extensions ProtocolIE-SingleContainer { { EventTrigger-ExtIEs} } +} + +EventTrigger-ExtIEs S1AP-PROTOCOL-IES ::= { + ... +} + +ExpectedUEBehaviour ::= SEQUENCE { + expectedActivity ExpectedUEActivityBehaviour OPTIONAL, + expectedHOInterval ExpectedHOInterval OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ExpectedUEBehaviour-ExtIEs} } OPTIONAL, + ... +} + +ExpectedUEBehaviour-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ExpectedUEActivityBehaviour ::= SEQUENCE { + expectedActivityPeriod ExpectedActivityPeriod OPTIONAL, + expectedIdlePeriod ExpectedIdlePeriod OPTIONAL, + sourceofUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ExpectedUEActivityBehaviour-ExtIEs} } OPTIONAL, + ... +} + +ExpectedUEActivityBehaviour-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ExpectedActivityPeriod ::= INTEGER (1..30|40|50|60|80|100|120|150|180|181,...) + +ExpectedIdlePeriod ::= INTEGER (1..30|40|50|60|80|100|120|150|180|181,...) +SourceOfUEActivityBehaviourInformation ::= ENUMERATED { + subscription-information, + statistics, + ... +} + +ExpectedHOInterval ::= ENUMERATED { + sec15, sec30, sec60, sec90, sec120, sec180, long-time, + ... +} + +ExtendedBitRate ::= INTEGER (10000000001..4000000000000, ...) + +ExtendedRNC-ID ::= INTEGER (4096..65535) + +ExtendedRepetitionPeriod ::= INTEGER (4096..131071) + +Extended-UEIdentityIndexValue ::= BIT STRING (SIZE (14)) + +-- F + +FiveGSTAC ::= OCTET STRING (SIZE (3)) + +FiveGSTAI ::= SEQUENCE { + pLMNidentity PLMNidentity, + fiveGSTAC FiveGSTAC, + iE-Extensions ProtocolExtensionContainer { {FiveGSTAI-ExtIEs} } OPTIONAL, + ... +} + +FiveGSTAI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +FiveQI ::= INTEGER (0..255, ...) + +ForbiddenInterRATs ::= ENUMERATED { + all, + geran, + utran, + cdma2000, + ..., + geranandutran, + cdma2000andutran + +} + +ForbiddenTAs ::= SEQUENCE (SIZE(1.. maxnoofEPLMNsPlusOne)) OF ForbiddenTAs-Item + +ForbiddenTAs-Item ::= SEQUENCE { + pLMN-Identity PLMNidentity, + forbiddenTACs ForbiddenTACs, + iE-Extensions ProtocolExtensionContainer { {ForbiddenTAs-Item-ExtIEs} } OPTIONAL, + ... +} + +ForbiddenTAs-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ForbiddenTACs ::= SEQUENCE (SIZE(1..maxnoofForbTACs)) OF TAC + +ForbiddenLAs ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF ForbiddenLAs-Item + +ForbiddenLAs-Item ::= SEQUENCE { + pLMN-Identity PLMNidentity, + forbiddenLACs ForbiddenLACs, + iE-Extensions ProtocolExtensionContainer { {ForbiddenLAs-Item-ExtIEs} } OPTIONAL, + ... +} + +ForbiddenLAs-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ForbiddenLACs ::= SEQUENCE (SIZE(1..maxnoofForbLACs)) OF LAC + +-- G + +GBR-QosInformation ::= SEQUENCE { + e-RAB-MaximumBitrateDL BitRate, + e-RAB-MaximumBitrateUL BitRate, + e-RAB-GuaranteedBitrateDL BitRate, + e-RAB-GuaranteedBitrateUL BitRate, + iE-Extensions ProtocolExtensionContainer { { GBR-QosInformation-ExtIEs} } OPTIONAL, + ... +} + +GBR-QosInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extension for maximum bitrate > 10G bps -- + { ID id-extended-e-RAB-MaximumBitrateDL CRITICALITY ignore EXTENSION ExtendedBitRate PRESENCE optional}| + { ID id-extended-e-RAB-MaximumBitrateUL CRITICALITY ignore EXTENSION ExtendedBitRate PRESENCE optional}| + { ID id-extended-e-RAB-GuaranteedBitrateDL CRITICALITY ignore EXTENSION ExtendedBitRate PRESENCE optional}| + { ID id-extended-e-RAB-GuaranteedBitrateUL CRITICALITY ignore EXTENSION ExtendedBitRate PRESENCE optional}, + ...} + + +GTP-TEID ::= OCTET STRING (SIZE (4)) + +GUMMEI ::= SEQUENCE { + pLMN-Identity PLMNidentity, + mME-Group-ID MME-Group-ID, + mME-Code MME-Code, + iE-Extensions ProtocolExtensionContainer { {GUMMEI-ExtIEs} } OPTIONAL, + ... +} +GUMMEI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GUMMEIType ::= ENUMERATED { + native, + mapped, + ..., + mappedFrom5G +} + +GWContextReleaseIndication ::= ENUMERATED { + true, + ... +} + +-- H + +HandoverFlag ::= ENUMERATED { + handoverPreparation, + ... +} + + +HandoverRestrictionList ::= SEQUENCE { + servingPLMN PLMNidentity, + equivalentPLMNs EPLMNs OPTIONAL, + forbiddenTAs ForbiddenTAs OPTIONAL, + forbiddenLAs ForbiddenLAs OPTIONAL, + forbiddenInterRATs ForbiddenInterRATs OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {HandoverRestrictionList-ExtIEs} } OPTIONAL, + ... +} + +HandoverRestrictionList-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-NRrestrictioninEPSasSecondaryRAT CRITICALITY ignore EXTENSION NRrestrictioninEPSasSecondaryRAT PRESENCE optional}| + { ID id-UnlicensedSpectrumRestriction CRITICALITY ignore EXTENSION UnlicensedSpectrumRestriction PRESENCE optional}| + { ID id-CNTypeRestrictions CRITICALITY ignore EXTENSION CNTypeRestrictions PRESENCE optional}| + { ID id-NRrestrictionin5GS CRITICALITY ignore EXTENSION NRrestrictionin5GS PRESENCE optional}| + { ID id-LastNG-RANPLMNIdentity CRITICALITY ignore EXTENSION PLMNidentity PRESENCE optional}| + { ID id-RAT-Restrictions CRITICALITY ignore EXTENSION RAT-Restrictions PRESENCE optional}, + ... +} + +HandoverType ::= ENUMERATED { + intralte, + ltetoutran, + ltetogeran, + utrantolte, + gerantolte, + ..., + eps-to-5gs, + fivegs-to-eps +} +HFN ::= INTEGER (0..1048575) + +HFNModified ::= INTEGER (0..131071) + +HFNforPDCP-SNlength18 ::= INTEGER (0..16383) + +Hysteresis ::= INTEGER (0..30) + +-- I + +Masked-IMEISV ::= BIT STRING (SIZE (64)) + +ImmediateMDT ::= SEQUENCE { + measurementsToActivate MeasurementsToActivate, + m1reportingTrigger M1ReportingTrigger, + m1thresholdeventA2 M1ThresholdEventA2 OPTIONAL, + -- The above IE shall be present if the Measurements to Activate IE has the first bit set to “1” and the M1 Reporting Trigger IE is set to the value “A2event-triggered” or to “A2event-triggered periodic” + m1periodicReporting M1PeriodicReporting OPTIONAL, + -- The above IE shall be present if the M1 Reporting Trigger IE is set to the value “periodic”, or “A2event-triggered periodic” + iE-Extensions ProtocolExtensionContainer { { ImmediateMDT-ExtIEs} } OPTIONAL, + ... +} + +ImmediateMDT-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-M3Configuration CRITICALITY ignore EXTENSION M3Configuration PRESENCE conditional}| + { ID id-M4Configuration CRITICALITY ignore EXTENSION M4Configuration PRESENCE conditional}| + { ID id-M5Configuration CRITICALITY ignore EXTENSION M5Configuration PRESENCE conditional}| + { ID id-MDT-Location-Info CRITICALITY ignore EXTENSION MDT-Location-Info PRESENCE optional}| + { ID id-M6Configuration CRITICALITY ignore EXTENSION M6Configuration PRESENCE conditional}| + { ID id-M7Configuration CRITICALITY ignore EXTENSION M7Configuration PRESENCE conditional}| + { ID id-BluetoothMeasurementConfiguration CRITICALITY ignore EXTENSION BluetoothMeasurementConfiguration PRESENCE optional}| + { ID id-WLANMeasurementConfiguration CRITICALITY ignore EXTENSION WLANMeasurementConfiguration PRESENCE optional}| + { ID id-SensorMeasurementConfiguration CRITICALITY ignore EXTENSION SensorMeasurementConfiguration PRESENCE optional}, + ... +} + +IMSI ::= OCTET STRING (SIZE (3..8)) + +InformationOnRecommendedCellsAndENBsForPaging ::= SEQUENCE { + recommendedCellsForPaging RecommendedCellsForPaging, + recommendENBsForPaging RecommendedENBsForPaging, + iE-Extensions ProtocolExtensionContainer { { InformationOnRecommendedCellsAndENBsForPaging-ExtIEs} } OPTIONAL, + ... +} + +InformationOnRecommendedCellsAndENBsForPaging-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +IntegrityProtectionAlgorithms ::= BIT STRING (SIZE (16,...)) + +IntegrityProtectionIndication ::= ENUMERATED { + required, + preferred, + not-needed, + ... +} + +IntegrityProtectionResult ::= ENUMERATED { + performed, + not-performed, + ... +} + +IntendedNumberOfPagingAttempts ::= INTEGER (1..16, ...) + +InterfacesToTrace ::= BIT STRING (SIZE (8)) + +IntersystemMeasurementConfiguration ::= SEQUENCE { + rSRP INTEGER (0.. 127) OPTIONAL, + rSRQ INTEGER (0.. 127) OPTIONAL, + sINR INTEGER (0.. 127) OPTIONAL, + interSystemMeasurementParameters InterSystemMeasurementParameters, + iE-Extensions ProtocolExtensionContainer { { IntersystemMeasurementConfiguration-ExtIEs} } OPTIONAL, + ... +} +IntersystemMeasurementConfiguration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +InterSystemMeasurementParameters ::= SEQUENCE { + measurementDuration INTEGER (1..100), + interSystemMeasurementList InterSystemMeasurementList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { InterSystemMeasurementParameters-ExtIEs} } OPTIONAL, + ... +} +InterSystemMeasurementParameters-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +InterSystemMeasurementList ::= SEQUENCE (SIZE(1.. maxnooffrequencies)) OF InterSystemMeasurementItem + +InterSystemMeasurementItem ::= SEQUENCE { + freqBandIndicatorNR INTEGER (1..1024), + sSBfrequencies INTEGER (0..maxNARFCN), + subcarrierSpacingSSB ENUMERATED {kHz15, kHz30, kHz60, kHz120, kHz240, ..., kHz480, kHz960}, + maxRSIndexCellQual INTEGER (1..maxRS-IndexCellQual) OPTIONAL, + sMTC OCTET STRING OPTIONAL, + threshRS-Index-r15 OCTET STRING OPTIONAL, + sSBToMeasure OCTET STRING OPTIONAL, + sSRSSIMeasurement OCTET STRING OPTIONAL, + quantityConfigNR-R15 OCTET STRING OPTIONAL, + excludedCellsToAddModList OCTET STRING OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { InterSystemMeasurementItem-ExtIEs} } OPTIONAL +} +InterSystemMeasurementItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +IntersystemSONConfigurationTransfer ::= OCTET STRING + +IMSvoiceEPSfallbackfrom5G ::= ENUMERATED { + true, + ... +} + +IAB-Authorized ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +IAB-Node-Indication ::= ENUMERATED { + true, + ... +} + +IAB-Supported ::= ENUMERATED { + true, + ... +} + +-- J +-- K + +KillAllWarningMessages ::= ENUMERATED {true} + +-- L + + +LAC ::= OCTET STRING (SIZE (2)) + +LAI ::= SEQUENCE { + pLMNidentity PLMNidentity, + lAC LAC, + iE-Extensions ProtocolExtensionContainer { {LAI-ExtIEs} } OPTIONAL, + ... +} + +LAI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +LastVisitedCell-Item ::= CHOICE { + e-UTRAN-Cell LastVisitedEUTRANCellInformation, + uTRAN-Cell LastVisitedUTRANCellInformation, + gERAN-Cell LastVisitedGERANCellInformation, + ..., + nG-RAN-Cell LastVisitedNGRANCellInformation +} +LastVisitedEUTRANCellInformation ::= SEQUENCE { + global-Cell-ID EUTRAN-CGI, + cellType CellType, + time-UE-StayedInCell Time-UE-StayedInCell, + iE-Extensions ProtocolExtensionContainer { { LastVisitedEUTRANCellInformation-ExtIEs} } OPTIONAL, + ... +} +LastVisitedEUTRANCellInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extension for Rel-11 to support enhanced granularity for time UE stayed in cell -- + { ID id-Time-UE-StayedInCell-EnhancedGranularity CRITICALITY ignore EXTENSION Time-UE-StayedInCell-EnhancedGranularity PRESENCE optional}| + { ID id-HO-Cause CRITICALITY ignore EXTENSION Cause PRESENCE optional}| + { ID id-lastVisitedPSCellList CRITICALITY ignore EXTENSION LastVisitedPSCellList PRESENCE optional}, + ... +} + +LastVisitedPSCellList ::= SEQUENCE (SIZE(1.. maxnoofPSCellsPerPrimaryCellinUEHistoryInfo)) OF LastVisitedPSCellInformation + + +LastVisitedPSCellInformation ::= SEQUENCE { + pSCellID PSCellInformation OPTIONAL, + timeStay INTEGER (0..40950), + iE-Extensions ProtocolExtensionContainer { { LastVisitedPSCellInformation-ExtIEs} } OPTIONAL, + ... +} + +LastVisitedPSCellInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +LastVisitedNGRANCellInformation ::= OCTET STRING + +LastVisitedUTRANCellInformation ::= OCTET STRING + +LastVisitedGERANCellInformation ::= CHOICE { + undefined NULL, + ... +} + +L3-Information ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +LPPa-PDU ::= OCTET STRING + +LHN-ID ::= OCTET STRING(SIZE (32..256)) + +Links-to-log ::= ENUMERATED {uplink, downlink, both-uplink-and-downlink, ...} + +ListeningSubframePattern ::= SEQUENCE { + pattern-period ENUMERATED {ms1280, ms2560, ms5120, ms10240, ...}, + pattern-offset INTEGER (0..10239, ...), + iE-Extensions ProtocolExtensionContainer { { ListeningSubframePattern-ExtIEs} } OPTIONAL, + ... +} +ListeningSubframePattern-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +... +} + +LoggedMDT ::= SEQUENCE { + loggingInterval LoggingInterval, + loggingDuration LoggingDuration, + iE-Extensions ProtocolExtensionContainer { {LoggedMDT-ExtIEs} } OPTIONAL, + ... +} + +LoggedMDT-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-BluetoothMeasurementConfiguration CRITICALITY ignore EXTENSION BluetoothMeasurementConfiguration PRESENCE optional}| + { ID id-WLANMeasurementConfiguration CRITICALITY ignore EXTENSION WLANMeasurementConfiguration PRESENCE optional}| + { ID id-LoggedMDTTrigger CRITICALITY ignore EXTENSION LoggedMDTTrigger PRESENCE optional}| + { ID id-SensorMeasurementConfiguration CRITICALITY ignore EXTENSION SensorMeasurementConfiguration PRESENCE optional}, +... +} + +LoggingInterval ::= ENUMERATED {ms1280, ms2560, ms5120, ms10240, ms20480, ms30720, ms40960, ms61440} + +LoggingDuration ::= ENUMERATED {m10, m20, m40, m60, m90, m120} + +LoggedMBSFNMDT ::= SEQUENCE { + loggingInterval LoggingInterval, + loggingDuration LoggingDuration, + mBSFN-ResultToLog MBSFN-ResultToLog OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { LoggedMBSFNMDT-ExtIEs } } OPTIONAL, + ... +} + +LoggedMBSFNMDT-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +LoggedMDTTrigger ::= CHOICE{ + periodical NULL, + eventTrigger EventTrigger, + ... +} + +LTE-M-Indication ::= ENUMERATED {lte-m, ... } + +LTE-NTN-TAI-Information ::= SEQUENCE { + servingPLMN PLMNidentity, + tACList-In-LTE-NTN TACList-In-LTE-NTN, + uE-Location-Derived-TAC TAC OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {LTE-NTN-TAI-Information-ExtIEs} } OPTIONAL, + ... +} + +LTE-NTN-TAI-Information-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- M + +M3Configuration ::= SEQUENCE { + m3period M3period, + iE-Extensions ProtocolExtensionContainer { { M3Configuration-ExtIEs} } OPTIONAL, + ... +} + +M3Configuration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +M3period ::= ENUMERATED {ms100, ms1000, ms10000, ...,ms1024, ms1280, ms2048, ms2560, ms5120, ms10240, min1 } + +M4Configuration ::= SEQUENCE { + m4period M4period, + m4-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M4Configuration-ExtIEs} } OPTIONAL, + ... +} + +M4Configuration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +{ ID id-M4ReportAmount CRITICALITY ignore EXTENSION M4ReportAmountMDT PRESENCE optional}, + + ... +} + +M4ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + + +M4period ::= ENUMERATED {ms1024, ms2048, ms5120, ms10240, min1, ... } + +M5Configuration ::= SEQUENCE { + m5period M5period, + m5-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M5Configuration-ExtIEs} } OPTIONAL, + ... +} + +M5Configuration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +{ ID id-M5ReportAmount CRITICALITY ignore EXTENSION M5ReportAmountMDT PRESENCE optional }, + ... +} + +M5ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + +M5period ::= ENUMERATED {ms1024, ms2048, ms5120, ms10240, min1, ... } + +M6Configuration ::= SEQUENCE { + m6report-Interval M6report-Interval, + m6delay-threshold M6delay-threshold OPTIONAL, +-- The above IE shall be present if the M6 Links to log IE is set to the value "uplink" or to "both-uplink-and-downlink" + m6-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M6Configuration-ExtIEs} } OPTIONAL, + ... +} + +M6Configuration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +{ ID id-M6ReportAmount CRITICALITY ignore EXTENSION M6ReportAmountMDT PRESENCE optional }, + ... +} + +M6ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + +M6report-Interval ::= ENUMERATED { ms1024, ms2048, ms5120, ms10240, ... } + +M6delay-threshold ::= ENUMERATED { ms30, ms40, ms50, ms60, ms70, ms80, ms90, ms100, ms150, ms300, ms500, ms750, ... } + +M7Configuration ::= SEQUENCE { + m7period M7period, + m7-links-to-log Links-to-log, + iE-Extensions ProtocolExtensionContainer { { M7Configuration-ExtIEs} } OPTIONAL, + ... +} + +M7Configuration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +{ ID id-M7ReportAmount CRITICALITY ignore EXTENSION M7ReportAmountMDT PRESENCE optional }, + ... +} + +M7ReportAmountMDT ::= ENUMERATED {r1, r2, r4, r8, r16, r32, r64, infinity, ...} + +M7period ::= INTEGER(1..60, ...) + +MDT-Activation ::= ENUMERATED { + immediate-MDT-only, + immediate-MDT-and-Trace, + logged-MDT-only, + ..., + logged-MBSFN-MDT +} + +MDT-Location-Info ::= BIT STRING (SIZE (8)) + +MDT-Configuration ::= SEQUENCE { + mdt-Activation MDT-Activation, + areaScopeOfMDT AreaScopeOfMDT, + mDTMode MDTMode, + iE-Extensions ProtocolExtensionContainer { { MDT-Configuration-ExtIEs} } OPTIONAL, + ... +} +MDT-Configuration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-SignallingBasedMDTPLMNList CRITICALITY ignore EXTENSION MDTPLMNList PRESENCE optional }, + ... +} +ManagementBasedMDTAllowed ::= ENUMERATED {allowed, ...} + +MBSFN-ResultToLog ::= SEQUENCE (SIZE(1..maxnoofMBSFNAreaMDT)) OF MBSFN-ResultToLogInfo + +MBSFN-ResultToLogInfo ::= SEQUENCE { + mBSFN-AreaId INTEGER (0..255) OPTIONAL, + carrierFreq EARFCN, + iE-Extensions ProtocolExtensionContainer { { MBSFN-ResultToLogInfo-ExtIEs} } OPTIONAL, + ... +} + +MBSFN-ResultToLogInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +MDTPLMNList ::= SEQUENCE (SIZE(1..maxnoofMDTPLMNs)) OF PLMNidentity + +PrivacyIndicator ::= ENUMERATED { + immediate-MDT, + logged-MDT, + ... +} + +MDTMode ::= CHOICE { + immediateMDT ImmediateMDT, + loggedMDT LoggedMDT, + ..., + mDTMode-Extension MDTMode-Extension +} + +MDTMode-Extension ::= ProtocolIE-SingleContainer {{ MDTMode-ExtensionIE }} + +MDTMode-ExtensionIE S1AP-PROTOCOL-IES ::= { + { ID id-LoggedMBSFNMDT CRITICALITY ignore TYPE LoggedMBSFNMDT PRESENCE mandatory} +} + +MeasurementsToActivate ::= BIT STRING (SIZE (8)) + +MeasurementThresholdA2 ::= CHOICE { + threshold-RSRP Threshold-RSRP, + threshold-RSRQ Threshold-RSRQ, + ... +} + +MeasurementThresholdL1LoggedMDT ::= CHOICE { + threshold-RSRP Threshold-RSRP, + threshold-RSRQ Threshold-RSRQ, + choice-Extensions ProtocolIE-SingleContainer { { MeasurementThresholdL1LoggedMDT-ExtIEs} } +} + +MeasurementThresholdL1LoggedMDT-ExtIEs S1AP-PROTOCOL-IES ::= { + ... +} +MessageIdentifier ::= BIT STRING (SIZE (16)) + +MobilityInformation ::= BIT STRING (SIZE(32)) + +MMEname ::= PrintableString (SIZE (1..150,...)) + +MMEPagingTarget ::= CHOICE { + global-ENB-ID Global-ENB-ID, + tAI TAI, + ... +} + +MMERelaySupportIndicator ::= ENUMERATED {true, ...} + +MME-Group-ID ::= OCTET STRING (SIZE (2)) + +MME-Code ::= OCTET STRING (SIZE (1)) + +MME-UE-S1AP-ID ::= INTEGER (0..4294967295) +M-TMSI ::= OCTET STRING (SIZE (4)) + +MSClassmark2 ::= OCTET STRING +MSClassmark3 ::= OCTET STRING + +MutingAvailabilityIndication ::= ENUMERATED { + available, + unavailable, + ... +} + + +MutingPatternInformation ::= SEQUENCE { + muting-pattern-period ENUMERATED {ms0, ms1280, ms2560, ms5120, ms10240, ...}, + muting-pattern-offset INTEGER (0..10239, ...) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {MutingPatternInformation-ExtIEs} } OPTIONAL, + ... +} + +MutingPatternInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +MDT-ConfigurationNR ::= OCTET STRING + +-- N + +NAS-PDU ::= OCTET STRING + +NASSecurityParametersfromE-UTRAN ::= OCTET STRING + +NASSecurityParameterstoE-UTRAN ::= OCTET STRING + +NB-IoT-DefaultPagingDRX ::= ENUMERATED { + v128, + v256, + v512, + v1024, + ... + } + +NB-IoT-PagingDRX ::= ENUMERATED { v32, v64, v128, v256, v512, v1024,...} + +NB-IoT-Paging-eDRXInformation ::= SEQUENCE { + nB-IoT-paging-eDRX-Cycle NB-IoT-Paging-eDRX-Cycle, + nB-IoT-pagingTimeWindow NB-IoT-PagingTimeWindow OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { NB-IoT-Paging-eDRXInformation-ExtIEs} } OPTIONAL, + ... +} + +NB-IoT-Paging-eDRXInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +NB-IoT-Paging-eDRX-Cycle ::= ENUMERATED{hf2, hf4, hf6, hf8, hf10, hf12, hf14, hf16, hf32, hf64, hf128, hf256, hf512, hf1024, ...} + +NB-IoT-PagingTimeWindow ::= ENUMERATED{s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, ...} + +NB-IoT-RLF-Report-Container ::= OCTET STRING + +NB-IoT-UEIdentityIndexValue ::= BIT STRING (SIZE (12)) + +NextPagingAreaScope ::= ENUMERATED { + same, + changed, + ... +} + +NotifySourceeNB ::= ENUMERATED { + notifySource, + ... +} + +NRCellIdentity ::= BIT STRING (SIZE(36)) + +NR-CGI ::= SEQUENCE { + pLMNIdentity PLMNidentity, + nRCellIdentity NRCellIdentity, + iE-Extensions ProtocolExtensionContainer { {NR-CGI-ExtIEs} } OPTIONAL, + ... +} + +NR-CGI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +NRencryptionAlgorithms ::= BIT STRING (SIZE (16,...)) +NRintegrityProtectionAlgorithms ::= BIT STRING (SIZE (16,...)) +NRrestrictioninEPSasSecondaryRAT ::= ENUMERATED { + nRrestrictedinEPSasSecondaryRAT, + ... +} + +NRrestrictionin5GS ::= ENUMERATED { + nRrestrictedin5GS, + ... +} + +NRUESecurityCapabilities ::= SEQUENCE { + nRencryptionAlgorithms NRencryptionAlgorithms, + nRintegrityProtectionAlgorithms NRintegrityProtectionAlgorithms, + iE-Extensions ProtocolExtensionContainer { { NRUESecurityCapabilities-ExtIEs} } OPTIONAL, +... +} + +NRUESecurityCapabilities-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +NumberofBroadcastRequest ::= INTEGER (0..65535) + +NumberOfBroadcasts ::= INTEGER (0..65535) + +NRV2XServicesAuthorized ::= SEQUENCE { + vehicleUE VehicleUE OPTIONAL, + pedestrianUE PedestrianUE OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {NRV2XServicesAuthorized-ExtIEs} } OPTIONAL, + ... +} + +NRV2XServicesAuthorized-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +NRUESidelinkAggregateMaximumBitrate ::= SEQUENCE { + uEaggregateMaximumBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { {NRUESidelinkAggregateMaximumBitrate-ExtIEs} } OPTIONAL, + ... +} + +NRUESidelinkAggregateMaximumBitrate-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- O +OldBSS-ToNewBSS-Information ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +OverloadAction ::= ENUMERATED { + reject-non-emergency-mo-dt, + reject-rrc-cr-signalling, + permit-emergency-sessions-and-mobile-terminated-services-only, + ..., + permit-high-priority-sessions-and-mobile-terminated-services-only, + reject-delay-tolerant-access, + permit-high-priority-sessions-and-exception-reporting-and-mobile-terminated-services-only, + not-accept-mo-data-or-delay-tolerant-access-from-CP-CIoT + +} + +OverloadResponse ::= CHOICE { + overloadAction OverloadAction, + ... +} + + +-- P + +Packet-LossRate ::= INTEGER(0..1000) + +PagingAttemptInformation ::= SEQUENCE { + pagingAttemptCount PagingAttemptCount, + intendedNumberOfPagingAttempts IntendedNumberOfPagingAttempts, + nextPagingAreaScope NextPagingAreaScope OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PagingAttemptInformation-ExtIEs} } OPTIONAL, + ... +} + +PagingAttemptInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PagingAttemptCount ::= INTEGER (1..16, ...) + +Paging-eDRXInformation ::= SEQUENCE { + paging-eDRX-Cycle Paging-eDRX-Cycle, + pagingTimeWindow PagingTimeWindow OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { Paging-eDRXInformation-ExtIEs} } OPTIONAL, + ... +} + +Paging-eDRXInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Paging-eDRX-Cycle ::= ENUMERATED{hfhalf, hf1, hf2, hf4, hf6, hf8, hf10, hf12, hf14, hf16, hf32, hf64, hf128, hf256, ...} + +PagingTimeWindow ::= ENUMERATED{s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, ...} + +PagingDRX ::= ENUMERATED { + v32, + v64, + v128, + v256, + ... + } + +PagingPriority ::= ENUMERATED { + priolevel1, + priolevel2, + priolevel3, + priolevel4, + priolevel5, + priolevel6, + priolevel7, + priolevel8, + ... +} + +PagingProbabilityInformation ::= ENUMERATED {p00, p05, p10, p15, p20, p25, p30, p35, p40, p45, p50, p55, p60, p65, p70, p75, p80, p85, p90, p95, p100, ...} + +PagingCause::= ENUMERATED {voice, ...} + +PC5QoSParameters ::= SEQUENCE { + pc5QoSFlowList PC5QoSFlowList, + pc5LinkAggregatedBitRates BitRate OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PC5QoSParameters-ExtIEs} } OPTIONAL, + ... +} + +PC5QoSParameters-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PC5QoSFlowList ::= SEQUENCE (SIZE(1..maxnoofPC5QoSFlows)) OF PC5QoSFlowItem + +PC5QoSFlowItem::= SEQUENCE { + pQI FiveQI, + pc5FlowBitRates PC5FlowBitRates OPTIONAL, + range Range OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { PC5QoSFlowItem-ExtIEs} } OPTIONAL, + ... +} + +PC5QoSFlowItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +PC5FlowBitRates ::= SEQUENCE { + guaranteedFlowBitRate BitRate, + maximumFlowBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { { PC5FlowBitRates-ExtIEs} } OPTIONAL, + ... +} + +PC5FlowBitRates-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +... +} +PDCP-SN ::= INTEGER (0..4095) + +PDCP-SNExtended ::= INTEGER (0..32767) + +PDCP-SNlength18 ::= INTEGER (0..262143) + +PendingDataIndication ::= ENUMERATED { + true, + ... +} + +M1PeriodicReporting ::= SEQUENCE { + reportInterval ReportIntervalMDT, + reportAmount ReportAmountMDT, + iE-Extensions ProtocolExtensionContainer { { M1PeriodicReporting-ExtIEs} } OPTIONAL, + ... +} + +M1PeriodicReporting-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PLMNidentity ::= TBCD-STRING + +PLMNAreaBasedQMC ::= SEQUENCE { + plmnListforQMC PLMNListforQMC, + iE-Extensions ProtocolExtensionContainer { {PLMNAreaBasedQMC-ExtIEs} } OPTIONAL, + ... +} + +PLMNAreaBasedQMC-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +PLMNListforQMC ::= SEQUENCE (SIZE(1..maxnoofPLMNforQMC)) OF PLMNidentity + +Port-Number ::= OCTET STRING (SIZE (2)) + +Pre-emptionCapability ::= ENUMERATED { + shall-not-trigger-pre-emption, + may-trigger-pre-emption +} + +Pre-emptionVulnerability ::= ENUMERATED { + not-pre-emptable, + pre-emptable +} + +PriorityLevel ::= INTEGER { spare (0), highest (1), lowest (14), no-priority (15) } (0..15) + +ProSeAuthorized ::= SEQUENCE { + proSeDirectDiscovery ProSeDirectDiscovery OPTIONAL, + proSeDirectCommunication ProSeDirectCommunication OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {ProSeAuthorized-ExtIEs} } OPTIONAL, + ... +} + +ProSeAuthorized-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-ProSeUEtoNetworkRelaying CRITICALITY ignore EXTENSION ProSeUEtoNetworkRelaying PRESENCE optional}, + ... +} + +ProSeDirectDiscovery ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +ProSeUEtoNetworkRelaying ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +ProSeDirectCommunication ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +PS-ServiceNotAvailable ::= ENUMERATED { + ps-service-not-available, + ... +} + +PSCellInformation ::= SEQUENCE { + nCGI NR-CGI, + iE-Extensions ProtocolExtensionContainer { { PSCellInformation-ExtIEs} } OPTIONAL, + ... +} + +PSCellInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- Q + +QCI ::= INTEGER (0..255) + +-- R + +RACSIndication ::= ENUMERATED {true, ...} + +RAN-UE-NGAP-ID ::= INTEGER (0..4294967295) + +Range ::= ENUMERATED {m50, m80, m180, m200, m350, m400, m500, m700, m1000, ...} +ReceiveStatusofULPDCPSDUs ::= BIT STRING (SIZE(4096)) + +ReceiveStatusOfULPDCPSDUsExtended ::= BIT STRING (SIZE(1..16384)) + +ReceiveStatusOfULPDCPSDUsPDCP-SNlength18 ::= BIT STRING (SIZE(1..131072)) + +RecommendedCellsForPaging ::= SEQUENCE { + recommendedCellList RecommendedCellList, + iE-Extensions ProtocolExtensionContainer { { RecommendedCellsForPaging-ExtIEs} } OPTIONAL, + ... +} + +RecommendedCellsForPaging-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RecommendedCellList ::= SEQUENCE (SIZE(1.. maxnoofRecommendedCells)) OF ProtocolIE-SingleContainer { { RecommendedCellItemIEs } } + +RecommendedCellItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-RecommendedCellItem CRITICALITY ignore TYPE RecommendedCellItem PRESENCE mandatory }, + ... +} + +RecommendedCellItem::= SEQUENCE { + eUTRAN-CGI EUTRAN-CGI, + timeStayedInCell INTEGER (0..4095) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { RecommendedCellsForPagingItem-ExtIEs} } OPTIONAL, + ... +} + +RecommendedCellsForPagingItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RecommendedENBsForPaging ::= SEQUENCE { + recommendedENBList RecommendedENBList, + iE-Extensions ProtocolExtensionContainer { { RecommendedENBsForPaging-ExtIEs} } OPTIONAL, + ... +} + +RecommendedENBsForPaging-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RecommendedENBList::= SEQUENCE (SIZE(1.. maxnoofRecommendedENBs)) OF ProtocolIE-SingleContainer { { RecommendedENBItemIEs } } + +RecommendedENBItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-RecommendedENBItem CRITICALITY ignore TYPE RecommendedENBItem PRESENCE mandatory }, + ... +} + +RecommendedENBItem ::= SEQUENCE { + mMEPagingTarget MMEPagingTarget, + iE-Extensions ProtocolExtensionContainer { { RecommendedENBItem-ExtIEs} } OPTIONAL, + ... +} + +RecommendedENBItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RelativeMMECapacity ::= INTEGER (0..255) + +RelayNode-Indicator ::= ENUMERATED { + true, + ... +} + +RAC ::= OCTET STRING (SIZE (1)) + +RAT-Restrictions ::= SEQUENCE (SIZE(1..maxnoofEPLMNsPlusOne)) OF RAT-RestrictionsItem + +RAT-RestrictionsItem ::= SEQUENCE { + pLMNidentity PLMNidentity, + rAT-RestrictionInformation BIT STRING (SIZE(8, ...)), + iE-Extensions ProtocolExtensionContainer { { RAT-RestrictionsItem-ExtIEs} } OPTIONAL, + ... +} + +RAT-RestrictionsItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RAT-Type ::= ENUMERATED { + nbiot, + ..., + nbiot-leo, + nbiot-meo, + nbiot-geo, + nbiot-othersat, + eutran-leo, + eutran-meo, + eutran-geo, + eutran-othersat +} + +ReportAmountMDT ::= ENUMERATED{r1, r2, r4, r8, r16, r32, r64, rinfinity} + +ReportIntervalMDT ::= ENUMERATED {ms120, ms240, ms480, ms640, ms1024, ms2048, ms5120, ms10240, min1, min6, min12, min30, min60} + +M1ReportingTrigger ::= ENUMERATED{ + periodic, + a2eventtriggered, + ..., + a2eventtriggered-periodic +} +RequestedTNLInfo ::= SEQUENCE { + pLMNidentity PLMNidentity, + iE-Extensions ProtocolExtensionContainer { { RequestedTNLInfo-ExtIEs} } OPTIONAL, + ... +} + +RequestedTNLInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +RequestType ::= SEQUENCE { + eventType EventType, + reportArea ReportArea, + iE-Extensions ProtocolExtensionContainer { { RequestType-ExtIEs} } OPTIONAL, + ... +} + + +RequestType-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-RequestTypeAdditionalInfo CRITICALITY ignore EXTENSION RequestTypeAdditionalInfo PRESENCE optional }, + ... +} + +RequestTypeAdditionalInfo ::= ENUMERATED { + includePSCell, + ... +} + +RIMTransfer ::= SEQUENCE { + rIMInformation RIMInformation, + rIMRoutingAddress RIMRoutingAddress OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { RIMTransfer-ExtIEs} } OPTIONAL, + ... +} + +RIMTransfer-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +RIMInformation ::= OCTET STRING + +RIMRoutingAddress ::= CHOICE { + gERAN-Cell-ID GERAN-Cell-ID, + ..., + targetRNC-ID TargetRNC-ID, + eHRPD-Sector-ID OCTET STRING (SIZE(16)) +} + +ReportArea ::= ENUMERATED { + ecgi, + ... +} + +RepetitionPeriod ::= INTEGER (0..4095) +RLFReportInformation ::= SEQUENCE { + uE-RLF-Report-Container UE-RLF-Report-Container, + uE-RLF-Report-Container-for-extended-bands UE-RLF-Report-Container-for-extended-bands OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{ RLFReportInformation-ExtIEs}} OPTIONAL, + ... +} + +RLFReportInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + {ID id-NB-IoT-RLF-Report-Container CRITICALITY ignore EXTENSION NB-IoT-RLF-Report-Container PRESENCE optional}, + ... +} + +RNC-ID ::= INTEGER (0..4095) + +RRC-Container ::= OCTET STRING + +RRC-Establishment-Cause ::= ENUMERATED { + emergency, + highPriorityAccess, + mt-Access, + mo-Signalling, + mo-Data, + ..., + delay-TolerantAccess, + mo-VoiceCall, + mo-ExceptionData +} + +ECGIListForRestart ::= SEQUENCE (SIZE(1..maxnoofCellsforRestart)) OF EUTRAN-CGI + +Routing-ID ::= INTEGER (0..255) + +-- S + + +SecurityKey ::= BIT STRING (SIZE(256)) + + + +SecurityContext ::= SEQUENCE { + nextHopChainingCount INTEGER (0..7), + nextHopParameter SecurityKey, + iE-Extensions ProtocolExtensionContainer { { SecurityContext-ExtIEs} } OPTIONAL, + ... +} + + +SecurityContext-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SecondaryRATType ::= ENUMERATED { + nR, + ..., + unlicensed +} + + +SecondaryRATDataUsageRequest ::= ENUMERATED { + requested, + ... +} + +SecondaryRATDataUsageReportList ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {SecondaryRATDataUsageReportItemIEs} } + +SecondaryRATDataUsageReportItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-SecondaryRATDataUsageReportItem CRITICALITY ignore TYPE SecondaryRATDataUsageReportItem PRESENCE mandatory }, + ... +} + +SecondaryRATDataUsageReportItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + secondaryRATType SecondaryRATType, + e-RABUsageReportList E-RABUsageReportList, + iE-Extensions ProtocolExtensionContainer { { SecondaryRATDataUsageReportItem-ExtIEs} } OPTIONAL, + ... +} + +SecondaryRATDataUsageReportItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SecurityIndication ::= SEQUENCE { + integrityProtectionIndication IntegrityProtectionIndication, + iE-Extensions ProtocolExtensionContainer { { SecurityIndication-ExtIEs } } OPTIONAL, + ... +} + +SecurityIndication-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SecurityResult ::= SEQUENCE { + integrityProtectionResult IntegrityProtectionResult, + iE-Extensions ProtocolExtensionContainer { {SecurityResult-ExtIEs} } OPTIONAL, + ... +} + +SecurityResult-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SensorMeasConfig::= ENUMERATED {setup,...} + +SensorMeasConfigNameItem ::= SEQUENCE { + sensorNameConfig SensorNameConfig, + iE-Extensions ProtocolExtensionContainer { { SensorMeasConfigNameItem-ExtIEs } } OPTIONAL, + ... +} + +SensorMeasConfigNameItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SensorMeasConfigNameList ::= SEQUENCE (SIZE(1..maxnoofSensorName)) OF SensorMeasConfigNameItem + +SensorMeasurementConfiguration ::= SEQUENCE { + sensorMeasConfig SensorMeasConfig, + sensorMeasConfigNameList SensorMeasConfigNameList OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SensorMeasurementConfiguration-ExtIEs} } OPTIONAL, + ... +} + +SensorMeasurementConfiguration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SensorNameConfig ::= CHOICE { + uncompensatedBarometricConfig ENUMERATED {true, ...}, + choice-Extensions ProtocolIE-SingleContainer { {SensorNameConfig-ExtIEs} } +} + +SensorNameConfig-ExtIEs S1AP-PROTOCOL-IES ::= { + ... +} + +SerialNumber ::= BIT STRING (SIZE (16)) + +ServiceType ::= ENUMERATED{ + qMC-for-streaming-service, + qMC-for-MTSI-service, + ... +} + +SONInformation ::= CHOICE{ + sONInformationRequest SONInformationRequest, + sONInformationReply SONInformationReply, + ..., + sONInformation-Extension SONInformation-Extension +} + +SONInformation-Extension ::= ProtocolIE-SingleContainer {{ SONInformation-ExtensionIE }} + +SONInformation-ExtensionIE S1AP-PROTOCOL-IES ::= { + { ID id-SON-Information-Report CRITICALITY ignore TYPE SONInformationReport PRESENCE mandatory} +} + +SONInformationRequest ::= ENUMERATED { + x2TNL-Configuration-Info, + ..., + time-Synchronisation-Info, + activate-Muting, + deactivate-Muting} + +SONInformationReply ::= SEQUENCE { + x2TNLConfigurationInfo X2TNLConfigurationInfo OPTIONAL, + iE-Extensions ProtocolExtensionContainer {{SONInformationReply-ExtIEs}} OPTIONAL, + ... +} + +SONInformationReply-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extension for Release 9 to transfer Time synchronisation information -- + {ID id-Time-Synchronisation-Info CRITICALITY ignore EXTENSION TimeSynchronisationInfo PRESENCE optional}, + ..., + {ID id-Muting-Pattern-Information CRITICALITY ignore EXTENSION MutingPatternInformation PRESENCE optional} +} + +SONInformationReport ::= CHOICE{ + rLFReportInformation RLFReportInformation, + ... +} + +SONConfigurationTransfer ::= SEQUENCE { + targeteNB-ID TargeteNB-ID, + sourceeNB-ID SourceeNB-ID, + sONInformation SONInformation, + iE-Extensions ProtocolExtensionContainer { { SONConfigurationTransfer-ExtIEs} } OPTIONAL, +... +} + +SONConfigurationTransfer-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extension for Release 10 to transfer the IP addresses of the eNB initiating the ANR action -- + {ID id-x2TNLConfigurationInfo CRITICALITY ignore EXTENSION X2TNLConfigurationInfo PRESENCE conditional}| + -- The above IE shall be present if the SON Information IE contains the SON Information Request IE and the SON Information Request IE is set to the value "X2TNL Configuration Info" +-- Extension for Release 12 to transfer information concerning the source cell of synchronisation and the aggressor cell -- + {ID id-Synchronisation-Information CRITICALITY ignore EXTENSION SynchronisationInformation PRESENCE conditional}| + -- The above IE shall be present if the SON Information IE contains the SON Information Request IE set to the value " Activate Muting " + {ID id-RequestedTNLInfo CRITICALITY ignore EXTENSION RequestedTNLInfo PRESENCE optional}, + ... +} + + +SynchronisationInformation ::= SEQUENCE { + sourceStratumLevel StratumLevel OPTIONAL, + listeningSubframePattern ListeningSubframePattern OPTIONAL, + aggressoreCGI-List ECGI-List OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {SynchronisationInformation-ExtIEs} } OPTIONAL, + ... +} + +SynchronisationInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} +Source-ToTarget-TransparentContainer ::= OCTET STRING +-- This IE includes a transparent container from the source RAN node to the target RAN node. +-- The octets of the OCTET STRING are encoded according to the specifications of the target system. + +SourceBSS-ToTargetBSS-TransparentContainer ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +SourceeNB-ID ::= SEQUENCE { + global-ENB-ID Global-ENB-ID, + selected-TAI TAI, + iE-Extensions ProtocolExtensionContainer { {SourceeNB-ID-ExtIEs} } OPTIONAL +} + +SourceeNB-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SRVCCOperationNotPossible ::= ENUMERATED { + notPossible, + ... +} + +SRVCCOperationPossible ::= ENUMERATED { + possible, + ... +} + +SRVCCHOIndication ::= ENUMERATED { + pSandCS, + cSonly, + ... +} + +SourceNodeID ::= CHOICE { + sourceNgRanNode-ID SourceNgRanNode-ID, + sourceNodeID-Extension SourceNodeID-Extension +} + +SourceNodeID-Extension ::= ProtocolIE-SingleContainer {{ SourceNodeID-ExtensionIE }} + +SourceNodeID-ExtensionIE S1AP-PROTOCOL-IES ::= { +... +} + +SourceeNB-ToTargeteNB-TransparentContainer ::= SEQUENCE { + rRC-Container RRC-Container, + e-RABInformationList E-RABInformationList OPTIONAL, + targetCell-ID EUTRAN-CGI, + subscriberProfileIDforRFP SubscriberProfileIDforRFP OPTIONAL, + uE-HistoryInformation UE-HistoryInformation, + iE-Extensions ProtocolExtensionContainer { {SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} +SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + {ID id-MobilityInformation CRITICALITY ignore EXTENSION MobilityInformation PRESENCE optional}| + {ID id-uE-HistoryInformationFromTheUE CRITICALITY ignore EXTENSION UE-HistoryInformationFromTheUE PRESENCE optional}| + {ID id-IMSvoiceEPSfallbackfrom5G CRITICALITY ignore EXTENSION IMSvoiceEPSfallbackfrom5G PRESENCE optional}| + {ID id-AdditionalRRMPriorityIndex CRITICALITY ignore EXTENSION AdditionalRRMPriorityIndex PRESENCE optional}| + {ID id-ContextatSource CRITICALITY ignore EXTENSION ContextatSource PRESENCE optional}| + {ID id-IntersystemMeasurementConfiguration CRITICALITY ignore EXTENSION IntersystemMeasurementConfiguration PRESENCE optional}| + {ID id-SourceNodeID CRITICALITY ignore EXTENSION SourceNodeID PRESENCE optional}| + {ID id-EmergencyIndicator CRITICALITY ignore EXTENSION EmergencyIndicator PRESENCE optional}| + {ID id-UEContextReferenceatSourceeNB CRITICALITY ignore EXTENSION ENB-UE-S1AP-ID PRESENCE optional}| + {ID id-SourceSNID CRITICALITY ignore EXTENSION Global-RAN-NODE-ID PRESENCE optional}| + {ID id-Direct-Forwarding-Path-Availability CRITICALITY ignore EXTENSION Direct-Forwarding-Path-Availability PRESENCE optional}| + {ID id-TimeBasedHandoverInformation CRITICALITY ignore EXTENSION TimeBasedHandoverInformation PRESENCE optional}, + ... +} + +SourceNgRanNode-ID ::= SEQUENCE { + global-RAN-NODE-ID Global-RAN-NODE-ID, + selected-TAI FiveGSTAI, + iE-Extensions ProtocolExtensionContainer { { SourceNgRanNode-ID-ExtIEs} } OPTIONAL, + ... +} + +SourceNgRanNode-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SourceRNC-ToTargetRNC-TransparentContainer ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +SourceNgRanNode-ToTargetNgRanNode-TransparentContainer ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +ServedGUMMEIs ::= SEQUENCE (SIZE (1.. maxnoofRATs)) OF ServedGUMMEIsItem + +ServedGUMMEIsItem ::= SEQUENCE { + servedPLMNs ServedPLMNs, + servedGroupIDs ServedGroupIDs, + servedMMECs ServedMMECs, + iE-Extensions ProtocolExtensionContainer { {ServedGUMMEIsItem-ExtIEs} } OPTIONAL, + ... +} + +ServedGUMMEIsItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + {ID id-GUMMEIType CRITICALITY ignore EXTENSION GUMMEIType PRESENCE optional}, + ... +} + +ServedGroupIDs ::= SEQUENCE (SIZE(1.. maxnoofGroupIDs)) OF MME-Group-ID +ServedMMECs ::= SEQUENCE (SIZE(1.. maxnoofMMECs)) OF MME-Code + +ServedPLMNs ::= SEQUENCE (SIZE(1.. maxnoofPLMNsPerMME)) OF PLMNidentity + +SubscriberProfileIDforRFP ::= INTEGER (1..256) +Subscription-Based-UE-DifferentiationInfo ::= SEQUENCE { + periodicCommunicationIndicator ENUMERATED {periodically, ondemand, ...} OPTIONAL, + periodicTime INTEGER (1..3600, ...) OPTIONAL, + scheduledCommunicationTime ScheduledCommunicationTime OPTIONAL, + stationaryIndication ENUMERATED {stationary, mobile, ...} OPTIONAL, + trafficProfile ENUMERATED {single-packet, dual-packets, multiple-packets, ...} OPTIONAL, + batteryIndication ENUMERATED {battery-powered, battery-powered-not-rechargeable-or-replaceable, not-battery-powered, ...} + OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { Subscription-Based-UE-DifferentiationInfo-ExtIEs} } OPTIONAL, + ... +} + +Subscription-Based-UE-DifferentiationInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ScheduledCommunicationTime ::= SEQUENCE { + dayofWeek BIT STRING (SIZE(7)) OPTIONAL, + timeofDayStart INTEGER (0..86399, ...) OPTIONAL, + timeofDayEnd INTEGER (0..86399, ...) OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ScheduledCommunicationTime-ExtIEs}} OPTIONAL, + ... +} + +ScheduledCommunicationTime-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +SupportedTAs ::= SEQUENCE (SIZE(1.. maxnoofTACs)) OF SupportedTAs-Item + +SupportedTAs-Item ::= SEQUENCE { + tAC TAC, + broadcastPLMNs BPLMNs, + iE-Extensions ProtocolExtensionContainer { {SupportedTAs-Item-ExtIEs} } OPTIONAL, + ... +} + +SupportedTAs-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + -- Extension for Release 13 to transfer RAT-Type per TAC -- + {ID id-RAT-Type CRITICALITY reject EXTENSION RAT-Type PRESENCE optional}, + ... +} + +StratumLevel ::= INTEGER (0..3, ...) + +SynchronisationStatus ::= ENUMERATED { synchronous, asynchronous, ... } + +TimeSynchronisationInfo ::= SEQUENCE { + stratumLevel StratumLevel, + synchronisationStatus SynchronisationStatus, + iE-Extensions ProtocolExtensionContainer { { TimeSynchronisationInfo-ExtIEs} } OPTIONAL, + ... +} +TimeSynchronisationInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + -- Extension for Release 12 to transfer Muting Availability Indication -- + {ID id-Muting-Availability-Indication CRITICALITY ignore EXTENSION MutingAvailabilityIndication PRESENCE optional}, + ... +} + +S-TMSI ::= SEQUENCE { + mMEC MME-Code, + m-TMSI M-TMSI, + iE-Extensions ProtocolExtensionContainer { {S-TMSI-ExtIEs} } OPTIONAL, + ... +} + +S-TMSI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- T + +TAC ::= OCTET STRING (SIZE (2)) + +TACList-In-LTE-NTN ::= SEQUENCE (SIZE(1..maxnoofTACsInNTN)) OF TAC + +TAIBasedMDT ::= SEQUENCE { + tAIListforMDT TAIListforMDT, + iE-Extensions ProtocolExtensionContainer { {TAIBasedMDT-ExtIEs} } OPTIONAL, + ... +} + +TAIBasedMDT-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TAIListforMDT ::= SEQUENCE (SIZE(1..maxnoofTAforMDT)) OF TAI + +TAIListforWarning ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAI + +TAI ::= SEQUENCE { + pLMNidentity PLMNidentity, + tAC TAC, + iE-Extensions ProtocolExtensionContainer { {TAI-ExtIEs} } OPTIONAL, + ... +} + +TAI-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TAI-Broadcast ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAI-Broadcast-Item + +TAI-Broadcast-Item ::= SEQUENCE { + tAI TAI, + completedCellinTAI CompletedCellinTAI, + iE-Extensions ProtocolExtensionContainer { {TAI-Broadcast-Item-ExtIEs} } OPTIONAL, + ... +} + +TAI-Broadcast-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TAI-Cancelled ::= SEQUENCE (SIZE(1..maxnoofTAIforWarning)) OF TAI-Cancelled-Item + +TAI-Cancelled-Item ::= SEQUENCE { + tAI TAI, + cancelledCellinTAI CancelledCellinTAI, + iE-Extensions ProtocolExtensionContainer { {TAI-Cancelled-Item-ExtIEs} } OPTIONAL, + ... +} + +TAI-Cancelled-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TABasedMDT ::= SEQUENCE { + tAListforMDT TAListforMDT, + iE-Extensions ProtocolExtensionContainer { {TABasedMDT-ExtIEs} } OPTIONAL, + ... +} + +TABasedMDT-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TAListforMDT ::= SEQUENCE (SIZE(1..maxnoofTAforMDT)) OF TAC + +TABasedQMC ::= SEQUENCE { + tAListforQMC TAListforQMC, + iE-Extensions ProtocolExtensionContainer { {TABasedQMC-ExtIEs} } OPTIONAL, + ... +} + +TABasedQMC-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TAListforQMC ::= SEQUENCE (SIZE(1..maxnoofTAforQMC)) OF TAC + +TAIBasedQMC ::= SEQUENCE { + tAIListforQMC TAIListforQMC, + iE-Extensions ProtocolExtensionContainer { {TAIBasedQMC-ExtIEs} } OPTIONAL, + ... +} + +TAIBasedQMC-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} +TAIListforQMC ::= SEQUENCE (SIZE(1..maxnoofTAforQMC)) OF TAI + +CompletedCellinTAI ::= SEQUENCE (SIZE(1..maxnoofCellinTAI)) OF CompletedCellinTAI-Item + +CompletedCellinTAI-Item ::= SEQUENCE{ + eCGI EUTRAN-CGI, + iE-Extensions ProtocolExtensionContainer { {CompletedCellinTAI-Item-ExtIEs} } OPTIONAL, + ... +} + +CompletedCellinTAI-Item-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TBCD-STRING ::= OCTET STRING (SIZE (3)) + +TargetID ::= CHOICE { + targeteNB-ID TargeteNB-ID, + targetRNC-ID TargetRNC-ID, + cGI CGI, + ..., + targetgNgRanNode-ID TargetNgRanNode-ID +} + +TargeteNB-ID ::= SEQUENCE { + global-ENB-ID Global-ENB-ID, + selected-TAI TAI, + iE-Extensions ProtocolExtensionContainer { {TargeteNB-ID-ExtIEs} } OPTIONAL, + ... +} + +TargeteNB-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetRNC-ID ::= SEQUENCE { + lAI LAI, + rAC RAC OPTIONAL, + rNC-ID RNC-ID, + extendedRNC-ID ExtendedRNC-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {TargetRNC-ID-ExtIEs} } OPTIONAL, + ... + } + + +TargetRNC-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TargetNgRanNode-ID ::= SEQUENCE { + global-RAN-NODE-ID Global-RAN-NODE-ID, + selected-TAI FiveGSTAI, + iE-Extensions ProtocolExtensionContainer { { TargetNgRanNode-ID-ExtIEs} } OPTIONAL, + ... +} + +TargetNgRanNode-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Global-RAN-NODE-ID::= CHOICE { + gNB GNB, + ng-eNB NG-eNB, + ... +} + +GNB ::= SEQUENCE { + global-gNB-ID Global-GNB-ID, + iE-Extensions ProtocolExtensionContainer { {GNB-ExtIEs} } OPTIONAL, + ... +} + +GNB-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Global-GNB-ID ::= SEQUENCE { + pLMN-Identity PLMNidentity, + gNB-ID GNB-Identity, + iE-Extensions ProtocolExtensionContainer { { Global-GNB-ID-ExtIEs} } OPTIONAL, + ... +} + +Global-GNB-ID-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-Identity ::= CHOICE { + gNB-ID GNB-ID, + ... +} + +NG-eNB ::= SEQUENCE { + global-ng-eNB-ID Global-ENB-ID, + iE-Extensions ProtocolExtensionContainer { { NG-eNB-ExtIEs} } OPTIONAL, + ... +} + +NG-eNB-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +GNB-ID ::= BIT STRING (SIZE(22..32)) + +TargeteNB-ToSourceeNB-TransparentContainer ::= SEQUENCE { + rRC-Container RRC-Container, + iE-Extensions ProtocolExtensionContainer { {TargeteNB-ToSourceeNB-TransparentContainer-ExtIEs} } OPTIONAL, + ... +} + +TargeteNB-ToSourceeNB-TransparentContainer-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-DAPSResponseInfoList CRITICALITY ignore EXTENSION DAPSResponseInfoList PRESENCE optional}| + { ID id-RACSIndication CRITICALITY ignore EXTENSION RACSIndication PRESENCE optional }| + { ID id-E-RABSecurityResultList CRITICALITY ignore EXTENSION E-RABSecurityResultList PRESENCE optional}| + { ID id-Direct-Forwarding-Path-Availability CRITICALITY ignore EXTENSION Direct-Forwarding-Path-Availability PRESENCE optional }, + ... +} + +Target-ToSource-TransparentContainer ::= OCTET STRING +-- This IE includes a transparent container from the target RAN node to the source RAN node. +-- The octets of the OCTET STRING are coded according to the specifications of the target system. + +TargetRNC-ToSourceRNC-TransparentContainer ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +TargetBSS-ToSourceBSS-TransparentContainer ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +TargetNgRanNode-ToSourceNgRanNode-TransparentContainer ::= OCTET STRING +-- This is a dummy IE used only as a reference to the actual definition in relevant specification. + +M1ThresholdEventA2 ::= SEQUENCE { + measurementThreshold MeasurementThresholdA2, + iE-Extensions ProtocolExtensionContainer { { M1ThresholdEventA2-ExtIEs} } OPTIONAL, + ... +} + +M1ThresholdEventA2-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +Threshold-RSRP ::= INTEGER(0..97) + +Threshold-RSRQ ::= INTEGER(0..34) + +TimeBasedHandoverInformation ::= SEQUENCE { + hOWindowStart HandoverWindowStart, + hOWindowDuration HandoverWindowDuration, + iE-Extensions ProtocolExtensionContainer { {TimeBasedHandoverInformation-ExtIEs} } OPTIONAL, + ... +} + +TimeBasedHandoverInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +HandoverWindowStart ::= INTEGER (0.. 1048575) + +HandoverWindowDuration ::= INTEGER (1..6000) + +TimeToTrigger ::= ENUMERATED {ms0, ms40, ms64, ms80, ms100, ms128, ms160, ms256, ms320, ms480, ms512, ms640, ms1024, ms1280, ms2560, ms5120} +TimeToWait ::= ENUMERATED {v1s, v2s, v5s, v10s, v20s, v60s, ...} + +Time-UE-StayedInCell ::= INTEGER (0..4095) + +Time-UE-StayedInCell-EnhancedGranularity ::= INTEGER (0..40950) + +TimeSinceSecondaryNodeRelease ::= OCTET STRING (SIZE(4)) + +TransportInformation ::= SEQUENCE { + transportLayerAddress TransportLayerAddress, + uL-GTP-TEID GTP-TEID, + ... +} + +TransportLayerAddress ::= BIT STRING (SIZE(1..160, ...)) + +TraceActivation ::= SEQUENCE { + e-UTRAN-Trace-ID E-UTRAN-Trace-ID, + interfacesToTrace InterfacesToTrace, + traceDepth TraceDepth, + traceCollectionEntityIPAddress TransportLayerAddress, + iE-Extensions ProtocolExtensionContainer { { TraceActivation-ExtIEs} } OPTIONAL, + ... +} + +TraceActivation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extension for Rel-10 to support MDT -- + { ID id-MDTConfiguration CRITICALITY ignore EXTENSION MDT-Configuration PRESENCE optional }| +-- Extension for Rel-15 to support QMC -- + { ID id-UEAppLayerMeasConfig CRITICALITY ignore EXTENSION UEAppLayerMeasConfig PRESENCE optional }| + { ID id-MDTConfigurationNR CRITICALITY ignore EXTENSION MDT-ConfigurationNR PRESENCE optional }| + { ID id-TraceCollectionEntityURI CRITICALITY ignore EXTENSION URI-Address PRESENCE optional }, + ... +} + +TraceDepth ::= ENUMERATED { + minimum, + medium, + maximum, + minimumWithoutVendorSpecificExtension, + mediumWithoutVendorSpecificExtension, + maximumWithoutVendorSpecificExtension, + ... +} + +E-UTRAN-Trace-ID ::= OCTET STRING (SIZE (8)) + +TrafficLoadReductionIndication ::= INTEGER (1..99) + +TunnelInformation ::= SEQUENCE { + transportLayerAddress TransportLayerAddress, + uDP-Port-Number Port-Number OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {Tunnel-Information-ExtIEs} } OPTIONAL, + ... +} + +Tunnel-Information-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +TypeOfError ::= ENUMERATED { + not-understood, + missing, + ... +} + +TAIListForRestart ::= SEQUENCE (SIZE(1..maxnoofRestartTAIs)) OF TAI + +TimeRefDistribution ::= ENUMERATED { + true, + ... +} + +-- U + +UEAggregateMaximumBitrate ::= SEQUENCE { + uEaggregateMaximumBitRateDL BitRate, + uEaggregateMaximumBitRateUL BitRate, + iE-Extensions ProtocolExtensionContainer { {UEAggregate-MaximumBitrates-ExtIEs} } OPTIONAL, + ... +} + +UEAggregate-MaximumBitrates-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extension for maximum bitrate > 10G bps -- + { ID id-extended-uEaggregateMaximumBitRateDL CRITICALITY ignore EXTENSION ExtendedBitRate PRESENCE optional}| + { ID id-extended-uEaggregateMaximumBitRateUL CRITICALITY ignore EXTENSION ExtendedBitRate PRESENCE optional}, + ... +} + +UEAppLayerMeasConfig ::= SEQUENCE { + containerForAppLayerMeasConfig OCTET STRING (SIZE(1..1000)), + areaScopeOfQMC AreaScopeOfQMC, + iE-Extensions ProtocolExtensionContainer { {UEAppLayerMeasConfig-ExtIEs} } OPTIONAL, + ... +} + +UEAppLayerMeasConfig-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + {ID id-serviceType CRITICALITY ignore EXTENSION ServiceType PRESENCE optional}, + ... +} + +UECapabilityInfoRequest ::= ENUMERATED { + requested, + ... +} + +UE-RetentionInformation ::= ENUMERATED { + ues-retained, + ...} + +UE-S1AP-IDs ::= CHOICE{ + uE-S1AP-ID-pair UE-S1AP-ID-pair, + mME-UE-S1AP-ID MME-UE-S1AP-ID, + ... +} + +UE-S1AP-ID-pair ::= SEQUENCE{ + mME-UE-S1AP-ID MME-UE-S1AP-ID, + eNB-UE-S1AP-ID ENB-UE-S1AP-ID, + iE-Extensions ProtocolExtensionContainer { {UE-S1AP-ID-pair-ExtIEs} } OPTIONAL, + ... +} +UE-S1AP-ID-pair-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +UE-associatedLogicalS1-ConnectionItem ::= SEQUENCE { + mME-UE-S1AP-ID MME-UE-S1AP-ID OPTIONAL, + eNB-UE-S1AP-ID ENB-UE-S1AP-ID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { UE-associatedLogicalS1-ConnectionItemExtIEs} } OPTIONAL, + ... +} + + +UE-associatedLogicalS1-ConnectionItemExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +UEIdentityIndexValue ::= BIT STRING (SIZE (10)) + +UE-HistoryInformation ::= SEQUENCE (SIZE(1..maxnoofCellsinUEHistoryInfo)) OF LastVisitedCell-Item + +UE-HistoryInformationFromTheUE ::= OCTET STRING + +UEPagingID ::= CHOICE { + s-TMSI S-TMSI, + iMSI IMSI, + ... + } + +UERadioCapability ::= OCTET STRING + +UERadioCapabilityForPaging ::= OCTET STRING + +UERadioCapabilityID ::= OCTET STRING + +UE-RLF-Report-Container ::= OCTET STRING + +UE-RLF-Report-Container-for-extended-bands ::= OCTET STRING +UESecurityCapabilities ::= SEQUENCE { + encryptionAlgorithms EncryptionAlgorithms, + integrityProtectionAlgorithms IntegrityProtectionAlgorithms, + iE-Extensions ProtocolExtensionContainer { { UESecurityCapabilities-ExtIEs} } OPTIONAL, +... +} + +UESecurityCapabilities-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +UESidelinkAggregateMaximumBitrate ::= SEQUENCE { + uESidelinkAggregateMaximumBitRate BitRate, + iE-Extensions ProtocolExtensionContainer { {UE-Sidelink-Aggregate-MaximumBitrates-ExtIEs} } OPTIONAL, + ... +} + +UE-Sidelink-Aggregate-MaximumBitrates-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +UE-Usage-Type ::= INTEGER (0..255) + +UL-CP-SecurityInformation ::= SEQUENCE { + ul-NAS-MAC UL-NAS-MAC, + ul-NAS-Count UL-NAS-Count, + iE-Extensions ProtocolExtensionContainer { { UL-CP-SecurityInformation-ExtIEs} } OPTIONAL, + ... +} + +UL-CP-SecurityInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +UL-NAS-MAC ::= BIT STRING (SIZE (16)) + +UL-NAS-Count ::= BIT STRING (SIZE (5)) + +UnlicensedSpectrumRestriction ::= ENUMERATED { + unlicensed-restricted, + ... +} + + +URI-Address ::= VisibleString + +UserLocationInformation ::= SEQUENCE { + eutran-cgi EUTRAN-CGI, + tai TAI, + iE-Extensions ProtocolExtensionContainer { { UserLocationInformation-ExtIEs} } OPTIONAL, + ... +} + +UserLocationInformation-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-PSCellInformation CRITICALITY ignore EXTENSION PSCellInformation PRESENCE optional}| + { ID id-LTE-NTN-TAI-Information CRITICALITY ignore EXTENSION LTE-NTN-TAI-Information PRESENCE optional}, + ... +} + +UEUserPlaneCIoTSupportIndicator ::= ENUMERATED { + supported, + ... +} + +UE-Application-Layer-Measurement-Capability ::= BIT STRING (SIZE (8)) + +-- First bit: QoE Measurement for streaming service +-- Second bit: QoE Measurement for MTSI service + +-- Note that undefined bits are considered as a spare bit and spare bits shall be set to 0 by the transmitter and shall be ignored by the receiver. + +-- V + +VoiceSupportMatchIndicator ::= ENUMERATED { + supported, + not-supported, + ... +} + +V2XServicesAuthorized ::= SEQUENCE { + vehicleUE VehicleUE OPTIONAL, + pedestrianUE PedestrianUE OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {V2XServicesAuthorized-ExtIEs} } OPTIONAL, + ... +} + +V2XServicesAuthorized-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +VehicleUE ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +PedestrianUE ::= ENUMERATED { + authorized, + not-authorized, + ... +} + +-- W + +WarningAreaCoordinates ::= OCTET STRING (SIZE(1..1024)) + +WarningAreaList ::= CHOICE { + cellIDList ECGIList, + trackingAreaListforWarning TAIListforWarning, + emergencyAreaIDList EmergencyAreaIDList, + ... +} + + +WarningType ::= OCTET STRING (SIZE (2)) + +WarningSecurityInfo ::= OCTET STRING (SIZE (50)) + + +WarningMessageContents ::= OCTET STRING (SIZE(1..9600)) + +WLANMeasurementConfiguration ::= SEQUENCE { + wlanMeasConfig WLANMeasConfig, + wlanMeasConfigNameList WLANMeasConfigNameList OPTIONAL, + wlan-rssi ENUMERATED {true, ...} OPTIONAL, + wlan-rtt ENUMERATED {true, ...} OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { WLANMeasurementConfiguration-ExtIEs } } OPTIONAL, + ... +} + +WLANMeasurementConfiguration-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +WLANMeasConfigNameList ::= SEQUENCE (SIZE(1..maxnoofWLANName)) OF WLANName + +WLANMeasConfig::= ENUMERATED {setup,...} + +WLANName ::= OCTET STRING (SIZE (1..32)) + +WUS-Assistance-Information ::= SEQUENCE { + pagingProbabilityInformation PagingProbabilityInformation, + iE-Extensions ProtocolExtensionContainer { { WUS-Assistance-Information-ExtIEs } } OPTIONAL, + ... +} + +WUS-Assistance-Information-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- X + + +X2TNLConfigurationInfo ::= SEQUENCE { + eNBX2TransportLayerAddresses ENBX2TLAs, + iE-Extensions ProtocolExtensionContainer { { X2TNLConfigurationInfo-ExtIEs} } OPTIONAL, + ... +} + +X2TNLConfigurationInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { +-- Extension for Release 10 to transfer the IPsec and U-plane addresses during ANR action -- + {ID id-eNBX2ExtendedTransportLayerAddresses CRITICALITY ignore EXTENSION ENBX2ExtTLAs PRESENCE optional}| +-- Extension for Release 12 to transfer the IP addresses of the X2 GW -- + {ID id-eNBIndirectX2TransportLayerAddresses CRITICALITY ignore EXTENSION ENBIndirectX2TransportLayerAddresses PRESENCE optional}, + ... +} + +ENBX2ExtTLAs ::= SEQUENCE (SIZE(1.. maxnoofeNBX2ExtTLAs)) OF ENBX2ExtTLA + +ENBX2ExtTLA ::= SEQUENCE { + iPsecTLA TransportLayerAddress OPTIONAL, + gTPTLAa ENBX2GTPTLAs OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { ENBX2ExtTLA-ExtIEs} } OPTIONAL, + ... +} + +ENBX2ExtTLA-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +ENBX2GTPTLAs ::= SEQUENCE (SIZE(1.. maxnoofeNBX2GTPTLAs)) OF TransportLayerAddress + +ENBIndirectX2TransportLayerAddresses ::= SEQUENCE (SIZE(1..maxnoofeNBX2TLAs)) OF TransportLayerAddress + +-- Y +-- Z + +END diff --git a/s1ap/testdata/asn1/S1AP-PDU-Contents.asn b/s1ap/testdata/asn1/S1AP-PDU-Contents.asn new file mode 100644 index 0000000000..fbf9a29162 --- /dev/null +++ b/s1ap/testdata/asn1/S1AP-PDU-Contents.asn @@ -0,0 +1,3415 @@ +-- ************************************************************** +-- +-- PDU definitions for S1AP. +-- +-- ************************************************************** + +S1AP-PDU-Contents { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +eps-Access (21) modules (3) s1ap (1) version1 (1) s1ap-PDU-Contents (1) } + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + + UEAggregateMaximumBitrate, + BearerType, + Cause, + CellAccessMode, + Cdma2000HORequiredIndication, + Cdma2000HOStatus, + Cdma2000OneXSRVCCInfo, + Cdma2000OneXRAND, + Cdma2000PDU, + Cdma2000RATType, + Cdma2000SectorID, + EUTRANRoundTripDelayEstimationInfo, + CNDomain, + ConcurrentWarningMessageIndicator, + CriticalityDiagnostics, + CSFallbackIndicator, + CSG-Id, + CSG-IdList, + CSGMembershipStatus, + Data-Forwarding-Not-Possible, + Direct-Forwarding-Path-Availability, + Global-ENB-ID, + EUTRAN-CGI, + ENBname, + ENB-StatusTransfer-TransparentContainer, + ENB-UE-S1AP-ID, + ExtendedRepetitionPeriod, + GTP-TEID, + GUMMEI, + GUMMEIType, + HandoverRestrictionList, + HandoverType, + Masked-IMEISV, + LAI, + LPPa-PDU, + ManagementBasedMDTAllowed, + MDTPLMNList, + MMEname, + MMERelaySupportIndicator, + MME-UE-S1AP-ID, + MSClassmark2, + MSClassmark3, + NAS-PDU, + NASSecurityParametersfromE-UTRAN, + NASSecurityParameterstoE-UTRAN, + OverloadResponse, + PagingDRX, + PagingPriority, + PLMNidentity, + ProSeAuthorized, + RIMTransfer, + RelativeMMECapacity, + RequestType, + E-RAB-ID, + E-RABLevelQoSParameters, + E-RABList, + RelayNode-Indicator, + Routing-ID, + SecurityKey, + SecurityContext, + ServedGUMMEIs, + SONConfigurationTransfer, + Source-ToTarget-TransparentContainer, + SourceBSS-ToTargetBSS-TransparentContainer, + SourceeNB-ToTargeteNB-TransparentContainer, + SourceRNC-ToTargetRNC-TransparentContainer, + SubscriberProfileIDforRFP, + SRVCCOperationNotPossible, + SRVCCOperationPossible, + SRVCCHOIndication, + SupportedTAs, + TAI, + Target-ToSource-TransparentContainer, + TargetBSS-ToSourceBSS-TransparentContainer, + TargeteNB-ToSourceeNB-TransparentContainer, + TargetID, + TargetRNC-ToSourceRNC-TransparentContainer, + TimeToWait, + TraceActivation, + TrafficLoadReductionIndication, + E-UTRAN-Trace-ID, + TransportLayerAddress, + UEIdentityIndexValue, + UEPagingID, + UERadioCapability, + UERadioCapabilityForPaging, + UE-RetentionInformation, + UE-S1AP-IDs, + UE-associatedLogicalS1-ConnectionItem, + UESecurityCapabilities, + S-TMSI, + MessageIdentifier, + SerialNumber, + WarningAreaList, + RepetitionPeriod, + NumberofBroadcastRequest, + WarningType, + WarningSecurityInfo, + DataCodingScheme, + WarningMessageContents, + BroadcastCompletedAreaList, + RRC-Establishment-Cause, + BroadcastCancelledAreaList, + PS-ServiceNotAvailable, + GUMMEIList, + Correlation-ID, + GWContextReleaseIndication, + PrivacyIndicator, + VoiceSupportMatchIndicator, + TunnelInformation, + KillAllWarningMessages, + TransportInformation, + LHN-ID, + UserLocationInformation, + AdditionalCSFallbackIndicator, + ECGIListForRestart, + TAIListForRestart, + EmergencyAreaIDListForRestart, + ExpectedUEBehaviour, + Paging-eDRXInformation, + Extended-UEIdentityIndexValue, + MME-Group-ID, + Additional-GUTI, + PWSfailedECGIList, + CellIdentifierAndCELevelForCECapableUEs, + AssistanceDataForPaging, + InformationOnRecommendedCellsAndENBsForPaging, + UE-Usage-Type, + UEUserPlaneCIoTSupportIndicator, + NB-IoT-DefaultPagingDRX, + NB-IoT-Paging-eDRXInformation, + CE-mode-B-SupportIndicator, + NB-IoT-UEIdentityIndexValue, + V2XServicesAuthorized, + DCN-ID, + ServedDCNs, + UESidelinkAggregateMaximumBitrate, + DLNASPDUDeliveryAckRequest, + Coverage-Level, + EnhancedCoverageRestricted, + DL-CP-SecurityInformation, + UL-CP-SecurityInformation, + SecondaryRATDataUsageRequest, + SecondaryRATDataUsageReportList, + HandoverFlag, + NRUESecurityCapabilities, + UE-Application-Layer-Measurement-Capability, + CE-ModeBRestricted, + Packet-LossRate, + UECapabilityInfoRequest, + SourceNgRanNode-ToTargetNgRanNode-TransparentContainer, + TargetNgRanNode-ToSourceNgRanNode-TransparentContainer, + EndIndication, + EDT-Session, + LTE-M-Indication, + AerialUEsubscriptionInformation, + PendingDataIndication, + WarningAreaCoordinates, + Subscription-Based-UE-DifferentiationInfo, + PSCellInformation, + NR-CGI, + ConnectedengNBList, + EN-DCSONConfigurationTransfer, + TimeSinceSecondaryNodeRelease, + AdditionalRRMPriorityIndex, + IAB-Authorized, + IAB-Node-Indication, + IAB-Supported, + DataSize, + Ethernet-Type, + NRV2XServicesAuthorized, + NRUESidelinkAggregateMaximumBitrate, + PC5QoSParameters, + IntersystemSONConfigurationTransfer, + UERadioCapabilityID, + NotifySourceeNB, + ENB-EarlyStatusTransfer-TransparentContainer, + WUS-Assistance-Information, + NB-IoT-PagingDRX, + PagingCause, + SecurityIndication, + SecurityResult, + LTE-NTN-TAI-Information, + CoarseUELocationRequested, + CoarseUELocation, + TimeRefDistribution +FROM S1AP-IEs + + PrivateIE-Container{}, + ProtocolExtensionContainer{}, + ProtocolIE-Container{}, + ProtocolIE-ContainerList{}, + ProtocolIE-ContainerPair{}, + ProtocolIE-ContainerPairList{}, + ProtocolIE-SingleContainer{}, + S1AP-PRIVATE-IES, + S1AP-PROTOCOL-EXTENSION, + S1AP-PROTOCOL-IES, + S1AP-PROTOCOL-IES-PAIR +FROM S1AP-Containers + + + id-AssistanceDataForPaging, + id-AerialUEsubscriptionInformation, + id-uEaggregateMaximumBitrate, + id-BearerType, + id-Cause, + id-CellAccessMode, + id-CellIdentifierAndCELevelForCECapableUEs, + id-cdma2000HORequiredIndication, + id-cdma2000HOStatus, + id-cdma2000OneXSRVCCInfo, + id-cdma2000OneXRAND, + id-cdma2000PDU, + id-cdma2000RATType, + id-cdma2000SectorID, + id-EUTRANRoundTripDelayEstimationInfo, + id-CNDomain, + id-ConcurrentWarningMessageIndicator, + id-CriticalityDiagnostics, + id-CSFallbackIndicator, + id-CSG-Id, + id-CSG-IdList, + id-CSGMembershipStatus, + id-Data-Forwarding-Not-Possible, + id-DefaultPagingDRX, + id-Direct-Forwarding-Path-Availability, + id-Global-ENB-ID, + id-EUTRAN-CGI, + id-eNBname, + id-eNB-StatusTransfer-TransparentContainer, + id-eNB-UE-S1AP-ID, + id-GERANtoLTEHOInformationRes, + id-GUMMEI-ID, + id-GUMMEIType, + id-HandoverRestrictionList, + id-HandoverType, + id-Masked-IMEISV, + id-InformationOnRecommendedCellsAndENBsForPaging, + id-InitialContextSetup, + id-Inter-SystemInformationTransferTypeEDT, + id-Inter-SystemInformationTransferTypeMDT, + id-LPPa-PDU, + id-NAS-DownlinkCount, + id-ManagementBasedMDTAllowed, + id-ManagementBasedMDTPLMNList, + id-MMEname, + id-MME-UE-S1AP-ID, + id-MSClassmark2, + id-MSClassmark3, + id-NAS-PDU, + id-NASSecurityParametersfromE-UTRAN, + id-NASSecurityParameterstoE-UTRAN, + id-OverloadResponse, + id-pagingDRX, + id-PagingPriority, + id-RelativeMMECapacity, + id-RequestType, + id-Routing-ID, + id-E-RABAdmittedItem, + id-E-RABAdmittedList, + id-E-RABDataForwardingItem, + id-E-RABFailedToModifyList, + id-E-RABFailedToReleaseList, + id-E-RABFailedtoSetupItemHOReqAck, + id-E-RABFailedToSetupListBearerSURes, + id-E-RABFailedToSetupListCtxtSURes, + id-E-RABFailedToSetupListHOReqAck, + id-E-RABFailedToBeReleasedList, + id-E-RABFailedToResumeListResumeReq, + id-E-RABFailedToResumeItemResumeReq, + id-E-RABFailedToResumeListResumeRes, + id-E-RABFailedToResumeItemResumeRes, + id-E-RABModify, + id-E-RABModifyItemBearerModRes, + id-E-RABModifyListBearerModRes, + id-E-RABRelease, + id-E-RABReleaseItemBearerRelComp, + id-E-RABReleaseItemHOCmd, + id-E-RABReleaseListBearerRelComp, + id-E-RABReleaseIndication, + id-E-RABSetup, + id-E-RABSetupItemBearerSURes, + id-E-RABSetupItemCtxtSURes, + id-E-RABSetupListBearerSURes, + id-E-RABSetupListCtxtSURes, + id-E-RABSubjecttoDataForwardingList, + id-E-RABToBeModifiedItemBearerModReq, + id-E-RABToBeModifiedListBearerModReq, + id-E-RABToBeModifiedListBearerModInd, + id-E-RABToBeModifiedItemBearerModInd, + id-E-RABNotToBeModifiedListBearerModInd, + id-E-RABNotToBeModifiedItemBearerModInd, + id-E-RABModifyListBearerModConf, + id-E-RABModifyItemBearerModConf, + id-E-RABFailedToModifyListBearerModConf, + id-E-RABToBeReleasedListBearerModConf, + id-E-RABToBeReleasedList, + id-E-RABReleasedList, + id-E-RABToBeSetupItemBearerSUReq, + id-E-RABToBeSetupItemCtxtSUReq, + id-E-RABToBeSetupItemHOReq, + id-E-RABToBeSetupListBearerSUReq, + id-E-RABToBeSetupListCtxtSUReq, + id-E-RABToBeSetupListHOReq, + id-E-RABToBeSwitchedDLItem, + id-E-RABToBeSwitchedDLList, + id-E-RABToBeSwitchedULList, + id-E-RABToBeSwitchedULItem, + id-E-RABtoReleaseListHOCmd, + id-ProSeAuthorized, + id-SecurityKey, + id-SecurityContext, + id-ServedGUMMEIs, + id-SONConfigurationTransferECT, + id-SONConfigurationTransferMCT, + id-Source-ToTarget-TransparentContainer, + id-Source-ToTarget-TransparentContainer-Secondary, + id-SourceMME-UE-S1AP-ID, + id-SRVCCOperationNotPossible, + id-SRVCCOperationPossible, + id-SRVCCHOIndication, + id-SubscriberProfileIDforRFP, + id-SupportedTAs, + id-S-TMSI, + id-TAI, + id-TAIItem, + id-TAIList, + id-Target-ToSource-TransparentContainer, + id-Target-ToSource-TransparentContainer-Secondary, + id-TargetID, + id-TimeToWait, + id-TraceActivation, + id-TrafficLoadReductionIndication, + id-E-UTRAN-Trace-ID, + id-UEIdentityIndexValue, + id-UEPagingID, + id-UERadioCapability, + id-UERadioCapabilityForPaging, + id-UTRANtoLTEHOInformationRes, + id-UE-associatedLogicalS1-ConnectionListResAck, + id-UE-associatedLogicalS1-ConnectionItem, + id-UE-RetentionInformation, + id-UESecurityCapabilities, + id-UE-S1AP-IDs, + id-V2XServicesAuthorized, + id-ResetType, + id-MessageIdentifier, + id-SerialNumber, + id-WarningAreaList, + id-RepetitionPeriod, + id-NumberofBroadcastRequest, + id-WarningType, + id-WarningSecurityInfo, + id-DataCodingScheme, + id-WarningMessageContents, + id-BroadcastCompletedAreaList, + id-BroadcastCancelledAreaList, + id-RRC-Establishment-Cause, + id-TraceCollectionEntityIPAddress, + id-AdditionalRRMPriorityIndex, + id-MDTConfigurationNR, + maxnoofTAIs, + maxnoofErrors, + maxnoofE-RABs, + maxnoofIndividualS1ConnectionsToReset, + maxnoofEmergencyAreaID, + maxnoofCellID, + maxnoofTAIforWarning, + maxnoofCellinTAI, + maxnoofCellinEAI, + id-ExtendedRepetitionPeriod, + id-PS-ServiceNotAvailable, + id-RegisteredLAI, + id-GUMMEIList, + id-SourceMME-GUMMEI, + id-MME-UE-S1AP-ID-2, + id-GW-TransportLayerAddress, + id-RelayNode-Indicator, + id-Correlation-ID, + id-MMERelaySupportIndicator, + id-GWContextReleaseIndication, + id-PrivacyIndicator, + id-VoiceSupportMatchIndicator, + id-Tunnel-Information-for-BBF, + id-SIPTO-Correlation-ID, + id-SIPTO-L-GW-TransportLayerAddress, + id-KillAllWarningMessages, + id-TransportInformation, + id-LHN-ID, + id-UserLocationInformation, + id-AdditionalCSFallbackIndicator, + id-ECGIListForRestart, + id-TAIListForRestart, + id-EmergencyAreaIDListForRestart, + id-ExpectedUEBehaviour, + id-Paging-eDRXInformation, + id-extended-UEIdentityIndexValue, + id-CSGMembershipInfo, + id-MME-Group-ID, + id-Additional-GUTI, + id-S1-Message, + id-PWSfailedECGIList, + id-PWSFailureIndication, + id-UE-Usage-Type, + id-UEUserPlaneCIoTSupportIndicator, + id-NB-IoT-DefaultPagingDRX, + id-NB-IoT-Paging-eDRXInformation, + id-CE-mode-B-SupportIndicator, + id-NB-IoT-UEIdentityIndexValue, + id-RRC-Resume-Cause, + id-DCN-ID, + id-ServedDCNs, + id-UESidelinkAggregateMaximumBitrate, + id-DLNASPDUDeliveryAckRequest, + id-Coverage-Level, + id-EnhancedCoverageRestricted, + id-UE-Level-QoS-Parameters, + id-DL-CP-SecurityInformation, + id-UL-CP-SecurityInformation, + id-SecondaryRATDataUsageRequest, + id-SecondaryRATDataUsageReportList, + id-HandoverFlag, + id-NRUESecurityCapabilities, + id-UE-Application-Layer-Measurement-Capability, + id-CE-ModeBRestricted, + id-DownlinkPacketLossRate, + id-UplinkPacketLossRate, + id-UECapabilityInfoRequest, + id-EndIndication, + id-EDT-Session, + id-LTE-M-Indication, + id-PendingDataIndication, + id-WarningAreaCoordinates, + id-Subscription-Based-UE-DifferentiationInfo, + id-PSCellInformation, + id-ConnectedengNBList, + id-ConnectedengNBToAddList, + id-ConnectedengNBToRemoveList, + id-EN-DCSONConfigurationTransfer-ECT, + id-EN-DCSONConfigurationTransfer-MCT, + id-TimeSinceSecondaryNodeRelease, + id-IAB-Authorized, + id-IAB-Node-Indication, + id-IAB-Supported, + id-DataSize, + id-Ethernet-Type, + id-NRV2XServicesAuthorized, + id-NRUESidelinkAggregateMaximumBitrate, + id-PC5QoSParameters, + id-IntersystemSONConfigurationTransferMCT, + id-IntersystemSONConfigurationTransferECT, + id-UERadioCapabilityID, + id-UERadioCapability-NR-Format, + id-NotifySourceeNB, + id-eNB-EarlyStatusTransfer-TransparentContainer, + id-WUS-Assistance-Information, + id-NB-IoT-PagingDRX, + id-UERadioCapabilityForPaging-NR-Format, + id-PagingCause, + id-SecurityIndication, + id-SecurityResult, + id-LTE-NTN-TAI-Information, + id-E-RABToBeUpdatedList, + id-E-RABToBeUpdatedItem, + id-CoarseUELocationRequested, + id-CoarseUELocation, + id-TimeRefDistribution + +FROM S1AP-Constants; + +-- ************************************************************** +-- +-- Common Container Lists +-- +-- ************************************************************** + +E-RAB-IE-ContainerList { S1AP-PROTOCOL-IES : IEsSetParam } ::= ProtocolIE-ContainerList { 1, maxnoofE-RABs, {IEsSetParam} } +E-RAB-IE-ContainerPairList { S1AP-PROTOCOL-IES-PAIR : IEsSetParam } ::= ProtocolIE-ContainerPairList { 1, maxnoofE-RABs, {IEsSetParam} } +ProtocolError-IE-ContainerList { S1AP-PROTOCOL-IES : IEsSetParam } ::= ProtocolIE-ContainerList { 1, maxnoofE-RABs, {IEsSetParam} } + +-- ************************************************************** +-- +-- HANDOVER PREPARATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Handover Required +-- +-- ************************************************************** + +HandoverRequired ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverRequiredIEs} }, + ... +} + +HandoverRequiredIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-HandoverType CRITICALITY reject TYPE HandoverType PRESENCE mandatory}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-TargetID CRITICALITY reject TYPE TargetID PRESENCE mandatory}| + { ID id-Direct-Forwarding-Path-Availability CRITICALITY ignore TYPE Direct-Forwarding-Path-Availability PRESENCE optional}| + { ID id-SRVCCHOIndication CRITICALITY reject TYPE SRVCCHOIndication PRESENCE optional}| + { ID id-Source-ToTarget-TransparentContainer CRITICALITY reject TYPE Source-ToTarget-TransparentContainer PRESENCE mandatory}| + { ID id-Source-ToTarget-TransparentContainer-Secondary CRITICALITY reject TYPE Source-ToTarget-TransparentContainer PRESENCE optional}| + { ID id-MSClassmark2 CRITICALITY reject TYPE MSClassmark2 PRESENCE conditional}| +-- The above IE shall be present if the Handover Type IE is set to the value “LTEtoGERAN” and the SRVCC HO Indication IE is present + { ID id-MSClassmark3 CRITICALITY ignore TYPE MSClassmark3 PRESENCE conditional}| +-- The above IE shall be present if the Handover Type IE is set to the value “LTEtoGERAN” and the SRVCC HO Indication IE is present + { ID id-CSG-Id CRITICALITY reject TYPE CSG-Id PRESENCE optional}| + { ID id-CellAccessMode CRITICALITY reject TYPE CellAccessMode PRESENCE optional}| + { ID id-PS-ServiceNotAvailable CRITICALITY ignore TYPE PS-ServiceNotAvailable PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- Handover Command +-- +-- ************************************************************** + +HandoverCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverCommandIEs} }, + ... +} + +HandoverCommandIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-HandoverType CRITICALITY reject TYPE HandoverType PRESENCE mandatory}| + { ID id-NASSecurityParametersfromE-UTRAN CRITICALITY reject TYPE NASSecurityParametersfromE-UTRAN PRESENCE conditional}| + -- The above IE shall be present if Handover Type IE is set to value "LTEtoUTRAN" or "LTEtoGERAN" + { ID id-E-RABSubjecttoDataForwardingList CRITICALITY ignore TYPE E-RABSubjecttoDataForwardingList PRESENCE optional}| + { ID id-E-RABtoReleaseListHOCmd CRITICALITY ignore TYPE E-RABList PRESENCE optional}| + { ID id-Target-ToSource-TransparentContainer CRITICALITY reject TYPE Target-ToSource-TransparentContainer PRESENCE mandatory}| + { ID id-Target-ToSource-TransparentContainer-Secondary CRITICALITY reject TYPE Target-ToSource-TransparentContainer PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +E-RABSubjecttoDataForwardingList ::= E-RAB-IE-ContainerList { {E-RABDataForwardingItemIEs} } + +E-RABDataForwardingItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABDataForwardingItem CRITICALITY ignore TYPE E-RABDataForwardingItem PRESENCE mandatory }, + ... +} + +E-RABDataForwardingItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + dL-transportLayerAddress TransportLayerAddress OPTIONAL, + dL-gTP-TEID GTP-TEID OPTIONAL, + uL-TransportLayerAddress TransportLayerAddress OPTIONAL, + uL-GTP-TEID GTP-TEID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { E-RABDataForwardingItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABDataForwardingItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} +-- ************************************************************** +-- +-- Handover Preparation Failure +-- +-- ************************************************************** + +HandoverPreparationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverPreparationFailureIEs} }, + ... +} + +HandoverPreparationFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER RESOURCE ALLOCATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Handover Request +-- +-- ************************************************************** + +HandoverRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {HandoverRequestIEs} }, + ... +} + +HandoverRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-HandoverType CRITICALITY reject TYPE HandoverType PRESENCE mandatory}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-uEaggregateMaximumBitrate CRITICALITY reject TYPE UEAggregateMaximumBitrate PRESENCE mandatory}| + { ID id-E-RABToBeSetupListHOReq CRITICALITY reject TYPE E-RABToBeSetupListHOReq PRESENCE mandatory}| + { ID id-Source-ToTarget-TransparentContainer CRITICALITY reject TYPE Source-ToTarget-TransparentContainer PRESENCE mandatory}| + { ID id-UESecurityCapabilities CRITICALITY reject TYPE UESecurityCapabilities PRESENCE mandatory}| + { ID id-HandoverRestrictionList CRITICALITY ignore TYPE HandoverRestrictionList PRESENCE optional}| + { ID id-TraceActivation CRITICALITY ignore TYPE TraceActivation PRESENCE optional}| + { ID id-RequestType CRITICALITY ignore TYPE RequestType PRESENCE optional}| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional}| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE mandatory}| + { ID id-NASSecurityParameterstoE-UTRAN CRITICALITY reject TYPE NASSecurityParameterstoE-UTRAN PRESENCE conditional}| + -- The above IE shall be present if the Handover Type IE is set to the value "UTRANtoLTE" or "GERANtoLTE" + { ID id-CSG-Id CRITICALITY reject TYPE CSG-Id PRESENCE optional}| + { ID id-CSGMembershipStatus CRITICALITY ignore TYPE CSGMembershipStatus PRESENCE optional}| + { ID id-GUMMEI-ID CRITICALITY ignore TYPE GUMMEI PRESENCE optional}| + { ID id-MME-UE-S1AP-ID-2 CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE optional}| + { ID id-ManagementBasedMDTAllowed CRITICALITY ignore TYPE ManagementBasedMDTAllowed PRESENCE optional}| + { ID id-ManagementBasedMDTPLMNList CRITICALITY ignore TYPE MDTPLMNList PRESENCE optional}| + { ID id-Masked-IMEISV CRITICALITY ignore TYPE Masked-IMEISV PRESENCE optional}| + { ID id-ExpectedUEBehaviour CRITICALITY ignore TYPE ExpectedUEBehaviour PRESENCE optional}| + { ID id-ProSeAuthorized CRITICALITY ignore TYPE ProSeAuthorized PRESENCE optional}| + { ID id-UEUserPlaneCIoTSupportIndicator CRITICALITY ignore TYPE UEUserPlaneCIoTSupportIndicator PRESENCE optional}| + { ID id-V2XServicesAuthorized CRITICALITY ignore TYPE V2XServicesAuthorized PRESENCE optional}| + { ID id-UESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE UESidelinkAggregateMaximumBitrate PRESENCE optional}| + { ID id-EnhancedCoverageRestricted CRITICALITY ignore TYPE EnhancedCoverageRestricted PRESENCE optional}| + { ID id-NRUESecurityCapabilities CRITICALITY ignore TYPE NRUESecurityCapabilities PRESENCE optional}| + { ID id-CE-ModeBRestricted CRITICALITY ignore TYPE CE-ModeBRestricted PRESENCE optional}| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional}| + { ID id-PendingDataIndication CRITICALITY ignore TYPE PendingDataIndication PRESENCE optional}| + { ID id-Subscription-Based-UE-DifferentiationInfo CRITICALITY ignore TYPE Subscription-Based-UE-DifferentiationInfo PRESENCE optional}| + { ID id-AdditionalRRMPriorityIndex CRITICALITY ignore TYPE AdditionalRRMPriorityIndex PRESENCE optional }| + { ID id-IAB-Authorized CRITICALITY reject TYPE IAB-Authorized PRESENCE optional}| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional}| + { ID id-TimeRefDistribution CRITICALITY ignore TYPE TimeRefDistribution PRESENCE optional}, + ... +} + +E-RABToBeSetupListHOReq ::= E-RAB-IE-ContainerList { {E-RABToBeSetupItemHOReqIEs} } + +E-RABToBeSetupItemHOReqIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeSetupItemHOReq CRITICALITY reject TYPE E-RABToBeSetupItemHOReq PRESENCE mandatory }, + ... +} + +E-RABToBeSetupItemHOReq ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + e-RABlevelQosParameters E-RABLevelQoSParameters, + iE-Extensions ProtocolExtensionContainer { {E-RABToBeSetupItemHOReq-ExtIEs} } OPTIONAL, + ... +} + +E-RABToBeSetupItemHOReq-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-Data-Forwarding-Not-Possible CRITICALITY ignore EXTENSION Data-Forwarding-Not-Possible PRESENCE optional}| + { ID id-BearerType CRITICALITY reject EXTENSION BearerType PRESENCE optional}| + { ID id-Ethernet-Type CRITICALITY ignore EXTENSION Ethernet-Type PRESENCE optional}| + { ID id-SecurityIndication CRITICALITY reject EXTENSION SecurityIndication PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- Handover Request Acknowledge +-- +-- ************************************************************** + +HandoverRequestAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {HandoverRequestAcknowledgeIEs} }, + ... +} + +HandoverRequestAcknowledgeIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-E-RABAdmittedList CRITICALITY ignore TYPE E-RABAdmittedList PRESENCE mandatory}| + { ID id-E-RABFailedToSetupListHOReqAck CRITICALITY ignore TYPE E-RABFailedtoSetupListHOReqAck PRESENCE optional}| + { ID id-Target-ToSource-TransparentContainer CRITICALITY reject TYPE Target-ToSource-TransparentContainer PRESENCE mandatory}| + { ID id-CSG-Id CRITICALITY ignore TYPE CSG-Id PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| + { ID id-CellAccessMode CRITICALITY ignore TYPE CellAccessMode PRESENCE optional}| + { ID id-CE-mode-B-SupportIndicator CRITICALITY ignore TYPE CE-mode-B-SupportIndicator PRESENCE optional}, + ... +} + +E-RABAdmittedList ::= E-RAB-IE-ContainerList { {E-RABAdmittedItemIEs} } + +E-RABAdmittedItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABAdmittedItem CRITICALITY ignore TYPE E-RABAdmittedItem PRESENCE mandatory }, + ... +} + +E-RABAdmittedItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + dL-transportLayerAddress TransportLayerAddress OPTIONAL, + dL-gTP-TEID GTP-TEID OPTIONAL, + uL-TransportLayerAddress TransportLayerAddress OPTIONAL, + uL-GTP-TEID GTP-TEID OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {E-RABAdmittedItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABAdmittedItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +E-RABFailedtoSetupListHOReqAck ::= E-RAB-IE-ContainerList { {E-RABFailedtoSetupItemHOReqAckIEs} } + +E-RABFailedtoSetupItemHOReqAckIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABFailedtoSetupItemHOReqAck CRITICALITY ignore TYPE E-RABFailedToSetupItemHOReqAck PRESENCE mandatory }, + ... +} + +E-RABFailedToSetupItemHOReqAck ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + cause Cause, + iE-Extensions ProtocolExtensionContainer { { E-RABFailedToSetupItemHOReqAckExtIEs} } OPTIONAL, + ... +} + +E-RABFailedToSetupItemHOReqAckExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +-- ************************************************************** +-- +-- Handover Failure +-- +-- ************************************************************** + +HandoverFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverFailureIEs} }, + ... +} + +HandoverFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER NOTIFICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Handover Notify +-- +-- ************************************************************** + +HandoverNotify ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverNotifyIEs} }, + ... +} + +HandoverNotifyIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-EUTRAN-CGI CRITICALITY ignore TYPE EUTRAN-CGI PRESENCE mandatory}| + { ID id-TAI CRITICALITY ignore TYPE TAI PRESENCE mandatory}| +-- Extension for Release 11 to support BBAI -- + { ID id-Tunnel-Information-for-BBF CRITICALITY ignore TYPE TunnelInformation PRESENCE optional}| + { ID id-LHN-ID CRITICALITY ignore TYPE LHN-ID PRESENCE optional}| + { ID id-PSCellInformation CRITICALITY ignore TYPE PSCellInformation PRESENCE optional }| + { ID id-NotifySourceeNB CRITICALITY ignore TYPE NotifySourceeNB PRESENCE optional}| + { ID id-LTE-NTN-TAI-Information CRITICALITY ignore TYPE LTE-NTN-TAI-Information PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- PATH SWITCH REQUEST ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Path Switch Request +-- +-- ************************************************************** + +PathSwitchRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PathSwitchRequestIEs} }, + ... +} + +PathSwitchRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-E-RABToBeSwitchedDLList CRITICALITY reject TYPE E-RABToBeSwitchedDLList PRESENCE mandatory}| + { ID id-SourceMME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-EUTRAN-CGI CRITICALITY ignore TYPE EUTRAN-CGI PRESENCE mandatory}| + { ID id-TAI CRITICALITY ignore TYPE TAI PRESENCE mandatory}| + { ID id-UESecurityCapabilities CRITICALITY ignore TYPE UESecurityCapabilities PRESENCE mandatory}| + { ID id-CSG-Id CRITICALITY ignore TYPE CSG-Id PRESENCE optional}| + { ID id-CellAccessMode CRITICALITY ignore TYPE CellAccessMode PRESENCE optional}| + { ID id-SourceMME-GUMMEI CRITICALITY ignore TYPE GUMMEI PRESENCE optional}| + { ID id-CSGMembershipStatus CRITICALITY ignore TYPE CSGMembershipStatus PRESENCE optional}| +-- Extension for Release 11 to support BBAI -- + { ID id-Tunnel-Information-for-BBF CRITICALITY ignore TYPE TunnelInformation PRESENCE optional}| + { ID id-LHN-ID CRITICALITY ignore TYPE LHN-ID PRESENCE optional}| + { ID id-RRC-Resume-Cause CRITICALITY ignore TYPE RRC-Establishment-Cause PRESENCE optional }| + { ID id-NRUESecurityCapabilities CRITICALITY ignore TYPE NRUESecurityCapabilities PRESENCE optional}| + { ID id-PSCellInformation CRITICALITY ignore TYPE PSCellInformation PRESENCE optional }| + { ID id-LTE-NTN-TAI-Information CRITICALITY ignore TYPE LTE-NTN-TAI-Information PRESENCE optional}, + ... +} + +E-RABToBeSwitchedDLList ::= E-RAB-IE-ContainerList { {E-RABToBeSwitchedDLItemIEs} } + +E-RABToBeSwitchedDLItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeSwitchedDLItem CRITICALITY reject TYPE E-RABToBeSwitchedDLItem PRESENCE mandatory }, + ... +} + +E-RABToBeSwitchedDLItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { { E-RABToBeSwitchedDLItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABToBeSwitchedDLItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-SecurityIndication CRITICALITY ignore EXTENSION SecurityIndication PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- Path Switch Request Acknowledge +-- +-- ************************************************************** + +PathSwitchRequestAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PathSwitchRequestAcknowledgeIEs} }, + ... +} + +PathSwitchRequestAcknowledgeIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-uEaggregateMaximumBitrate CRITICALITY ignore TYPE UEAggregateMaximumBitrate PRESENCE optional}| + { ID id-E-RABToBeSwitchedULList CRITICALITY ignore TYPE E-RABToBeSwitchedULList PRESENCE optional}| + { ID id-E-RABToBeReleasedList CRITICALITY ignore TYPE E-RABList PRESENCE optional}| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| + { ID id-MME-UE-S1AP-ID-2 CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE optional}| + { ID id-CSGMembershipStatus CRITICALITY ignore TYPE CSGMembershipStatus PRESENCE optional}| + { ID id-ProSeAuthorized CRITICALITY ignore TYPE ProSeAuthorized PRESENCE optional}| + { ID id-UEUserPlaneCIoTSupportIndicator CRITICALITY ignore TYPE UEUserPlaneCIoTSupportIndicator PRESENCE optional}| + { ID id-V2XServicesAuthorized CRITICALITY ignore TYPE V2XServicesAuthorized PRESENCE optional}| + { ID id-UESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE UESidelinkAggregateMaximumBitrate PRESENCE optional}| + { ID id-EnhancedCoverageRestricted CRITICALITY ignore TYPE EnhancedCoverageRestricted PRESENCE optional}| + { ID id-NRUESecurityCapabilities CRITICALITY ignore TYPE NRUESecurityCapabilities PRESENCE optional}| + { ID id-CE-ModeBRestricted CRITICALITY ignore TYPE CE-ModeBRestricted PRESENCE optional}| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional}| + { ID id-PendingDataIndication CRITICALITY ignore TYPE PendingDataIndication PRESENCE optional}| + { ID id-Subscription-Based-UE-DifferentiationInfo CRITICALITY ignore TYPE Subscription-Based-UE-DifferentiationInfo PRESENCE optional}| + { ID id-HandoverRestrictionList CRITICALITY ignore TYPE HandoverRestrictionList PRESENCE optional}| + { ID id-AdditionalRRMPriorityIndex CRITICALITY ignore TYPE AdditionalRRMPriorityIndex PRESENCE optional }| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional}| + { ID id-UESecurityCapabilities CRITICALITY ignore TYPE UESecurityCapabilities PRESENCE optional}| + { ID id-E-RABToBeUpdatedList CRITICALITY ignore TYPE E-RABToBeUpdatedList PRESENCE optional}| + { ID id-TimeRefDistribution CRITICALITY ignore TYPE TimeRefDistribution PRESENCE optional}, + ... +} +E-RABToBeSwitchedULList ::= E-RAB-IE-ContainerList { {E-RABToBeSwitchedULItemIEs} } + +E-RABToBeSwitchedULItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeSwitchedULItem CRITICALITY ignore TYPE E-RABToBeSwitchedULItem PRESENCE mandatory }, + ... +} + +E-RABToBeSwitchedULItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { { E-RABToBeSwitchedULItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABToBeSwitchedULItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + + ... +} + +E-RABToBeUpdatedList ::= E-RAB-IE-ContainerList { {E-RABToBeUpdatedItemIEs} } + +E-RABToBeUpdatedItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeUpdatedItem CRITICALITY ignore TYPE E-RABToBeUpdatedItem PRESENCE mandatory }, + ... +} + +E-RABToBeUpdatedItem ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + securityIndication SecurityIndication OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { E-RABToBeUpdatedItem-ExtIEs} } OPTIONAL, + ... +} + +E-RABToBeUpdatedItem-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- ************************************************************** +-- +-- Path Switch Request Failure +-- +-- ************************************************************** + +PathSwitchRequestFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { PathSwitchRequestFailureIEs} }, + ... +} + +PathSwitchRequestFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER CANCEL ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Handover Cancel +-- +-- ************************************************************** + +HandoverCancel ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverCancelIEs} }, + ... +} + +HandoverCancelIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Handover Cancel Request Acknowledge +-- +-- ************************************************************** + +HandoverCancelAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverCancelAcknowledgeIEs} }, + ... +} + +HandoverCancelAcknowledgeIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- HANDOVER SUCCESS ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Handover Success +-- +-- ************************************************************** + +HandoverSuccess ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { HandoverSuccessIEs} }, + ... +} + +HandoverSuccessIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- eNB EARLY STATUS TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- eNB Early Status Transfer +-- +-- ************************************************************** + +ENBEarlyStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ENBEarlyStatusTransferIEs} }, + ... +} + +ENBEarlyStatusTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-EarlyStatusTransfer-TransparentContainer CRITICALITY reject TYPE ENB-EarlyStatusTransfer-TransparentContainer PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- MME EARLY STATUS TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MME Early Status Transfer +-- +-- ************************************************************** + +MMEEarlyStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MMEEarlyStatusTransferIEs} }, + ... +} + +MMEEarlyStatusTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-EarlyStatusTransfer-TransparentContainer CRITICALITY reject TYPE ENB-EarlyStatusTransfer-TransparentContainer PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- E-RAB SETUP ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- E-RAB Setup Request +-- +-- ************************************************************** + +E-RABSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {E-RABSetupRequestIEs} }, + ... +} + +E-RABSetupRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-uEaggregateMaximumBitrate CRITICALITY reject TYPE UEAggregateMaximumBitrate PRESENCE optional }| + { ID id-E-RABToBeSetupListBearerSUReq CRITICALITY reject TYPE E-RABToBeSetupListBearerSUReq PRESENCE mandatory }, + ... +} + +E-RABToBeSetupListBearerSUReq ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABToBeSetupItemBearerSUReqIEs} } + +E-RABToBeSetupItemBearerSUReqIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeSetupItemBearerSUReq CRITICALITY reject TYPE E-RABToBeSetupItemBearerSUReq PRESENCE mandatory }, + ... +} + +E-RABToBeSetupItemBearerSUReq ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + e-RABlevelQoSParameters E-RABLevelQoSParameters, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + nAS-PDU NAS-PDU, + iE-Extensions ProtocolExtensionContainer { {E-RABToBeSetupItemBearerSUReqExtIEs} } OPTIONAL, + ... +} + + +E-RABToBeSetupItemBearerSUReqExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-Correlation-ID CRITICALITY ignore EXTENSION Correlation-ID PRESENCE optional}| + { ID id-SIPTO-Correlation-ID CRITICALITY ignore EXTENSION Correlation-ID PRESENCE optional}| + { ID id-BearerType CRITICALITY reject EXTENSION BearerType PRESENCE optional}| + { ID id-Ethernet-Type CRITICALITY ignore EXTENSION Ethernet-Type PRESENCE optional}| + { ID id-SecurityIndication CRITICALITY reject EXTENSION SecurityIndication PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- E-RAB Setup Response +-- +-- ************************************************************** + +E-RABSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {E-RABSetupResponseIEs} }, + ... +} + +E-RABSetupResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-RABSetupListBearerSURes CRITICALITY ignore TYPE E-RABSetupListBearerSURes PRESENCE optional }| + { ID id-E-RABFailedToSetupListBearerSURes CRITICALITY ignore TYPE E-RABList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + + +E-RABSetupListBearerSURes ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABSetupItemBearerSUResIEs} } + +E-RABSetupItemBearerSUResIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABSetupItemBearerSURes CRITICALITY ignore TYPE E-RABSetupItemBearerSURes PRESENCE mandatory }, + ... +} + +E-RABSetupItemBearerSURes ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { {E-RABSetupItemBearerSUResExtIEs} } OPTIONAL, + ... +} + + +E-RABSetupItemBearerSUResExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + + +-- ************************************************************** +-- +-- E-RAB MODIFY ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- E-RAB Modify Request +-- +-- ************************************************************** + +E-RABModifyRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {E-RABModifyRequestIEs} }, + ... +} + +E-RABModifyRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-uEaggregateMaximumBitrate CRITICALITY reject TYPE UEAggregateMaximumBitrate PRESENCE optional }| + { ID id-E-RABToBeModifiedListBearerModReq CRITICALITY reject TYPE E-RABToBeModifiedListBearerModReq PRESENCE mandatory }| + { ID id-SecondaryRATDataUsageRequest CRITICALITY ignore TYPE SecondaryRATDataUsageRequest PRESENCE optional }, + ... +} + +E-RABToBeModifiedListBearerModReq ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABToBeModifiedItemBearerModReqIEs} } + +E-RABToBeModifiedItemBearerModReqIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeModifiedItemBearerModReq CRITICALITY reject TYPE E-RABToBeModifiedItemBearerModReq PRESENCE mandatory }, + ... +} + +E-RABToBeModifiedItemBearerModReq ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + e-RABLevelQoSParameters E-RABLevelQoSParameters, + nAS-PDU NAS-PDU, + iE-Extensions ProtocolExtensionContainer { {E-RABToBeModifyItemBearerModReqExtIEs} } OPTIONAL, + ... +} + + +E-RABToBeModifyItemBearerModReqExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-TransportInformation CRITICALITY reject EXTENSION TransportInformation PRESENCE optional}, + ... +} + + + +-- ************************************************************** +-- +-- E-RAB Modify Response +-- +-- ************************************************************** + +E-RABModifyResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {E-RABModifyResponseIEs} }, + ... +} + +E-RABModifyResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-RABModifyListBearerModRes CRITICALITY ignore TYPE E-RABModifyListBearerModRes PRESENCE optional }| + { ID id-E-RABFailedToModifyList CRITICALITY ignore TYPE E-RABList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + + +E-RABModifyListBearerModRes ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABModifyItemBearerModResIEs} } + +E-RABModifyItemBearerModResIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABModifyItemBearerModRes CRITICALITY ignore TYPE E-RABModifyItemBearerModRes PRESENCE mandatory}, + ... +} + +E-RABModifyItemBearerModRes ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + iE-Extensions ProtocolExtensionContainer { {E-RABModifyItemBearerModResExtIEs} } OPTIONAL, + ... +} + + +E-RABModifyItemBearerModResExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + + + +-- ************************************************************** +-- +-- E-RAB RELEASE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- E-RAB Release Command +-- +-- ************************************************************** + +E-RABReleaseCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {E-RABReleaseCommandIEs} }, + ... +} + +E-RABReleaseCommandIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-uEaggregateMaximumBitrate CRITICALITY reject TYPE UEAggregateMaximumBitrate PRESENCE optional }| + { ID id-E-RABToBeReleasedList CRITICALITY ignore TYPE E-RABList PRESENCE mandatory }| + { ID id-NAS-PDU CRITICALITY ignore TYPE NAS-PDU PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- E-RAB Release Response +-- +-- ************************************************************** + +E-RABReleaseResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { E-RABReleaseResponseIEs } }, + ... +} + +E-RABReleaseResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-RABReleaseListBearerRelComp CRITICALITY ignore TYPE E-RABReleaseListBearerRelComp PRESENCE optional }| + { ID id-E-RABFailedToReleaseList CRITICALITY ignore TYPE E-RABList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| +-- Extension for Release 12 to support User Location Information -- + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE optional }, + ... +} + + +E-RABReleaseListBearerRelComp ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABReleaseItemBearerRelCompIEs} } + +E-RABReleaseItemBearerRelCompIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABReleaseItemBearerRelComp CRITICALITY ignore TYPE E-RABReleaseItemBearerRelComp PRESENCE mandatory }, + ... +} + +E-RABReleaseItemBearerRelComp ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + iE-Extensions ProtocolExtensionContainer { {E-RABReleaseItemBearerRelCompExtIEs} } OPTIONAL, + ... +} +E-RABReleaseItemBearerRelCompExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + + +-- ************************************************************** +-- +-- E-RAB RELEASE INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- E-RAB Release Indication +-- +-- ************************************************************** + +E-RABReleaseIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {E-RABReleaseIndicationIEs} }, + ... +} + +E-RABReleaseIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-RABReleasedList CRITICALITY ignore TYPE E-RABList PRESENCE mandatory }| +-- Extension for Release 12 to support User Location Information -- + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE optional }, + ... +} +-- ************************************************************** +-- +-- INITIAL CONTEXT SETUP ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Initial Context Setup Request +-- +-- ************************************************************** + +InitialContextSetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InitialContextSetupRequestIEs} }, + ... +} + +InitialContextSetupRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-uEaggregateMaximumBitrate CRITICALITY reject TYPE UEAggregateMaximumBitrate PRESENCE mandatory}| + { ID id-E-RABToBeSetupListCtxtSUReq CRITICALITY reject TYPE E-RABToBeSetupListCtxtSUReq PRESENCE mandatory}| + { ID id-UESecurityCapabilities CRITICALITY reject TYPE UESecurityCapabilities PRESENCE mandatory}| + { ID id-SecurityKey CRITICALITY reject TYPE SecurityKey PRESENCE mandatory}| + { ID id-TraceActivation CRITICALITY ignore TYPE TraceActivation PRESENCE optional}| + { ID id-HandoverRestrictionList CRITICALITY ignore TYPE HandoverRestrictionList PRESENCE optional}| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional}| + { ID id-SubscriberProfileIDforRFP CRITICALITY ignore TYPE SubscriberProfileIDforRFP PRESENCE optional}| + { ID id-CSFallbackIndicator CRITICALITY reject TYPE CSFallbackIndicator PRESENCE optional}| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional}| + { ID id-CSGMembershipStatus CRITICALITY ignore TYPE CSGMembershipStatus PRESENCE optional}| + { ID id-RegisteredLAI CRITICALITY ignore TYPE LAI PRESENCE optional}| + { ID id-GUMMEI-ID CRITICALITY ignore TYPE GUMMEI PRESENCE optional}| + { ID id-MME-UE-S1AP-ID-2 CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE optional}| + { ID id-ManagementBasedMDTAllowed CRITICALITY ignore TYPE ManagementBasedMDTAllowed PRESENCE optional}| + { ID id-ManagementBasedMDTPLMNList CRITICALITY ignore TYPE MDTPLMNList PRESENCE optional}| + { ID id-AdditionalCSFallbackIndicator CRITICALITY ignore TYPE AdditionalCSFallbackIndicator PRESENCE conditional}| + -- The above IE shall be present if the CS Fallback Indicator IE is set to the value “CS Fallback High Priority” + { ID id-Masked-IMEISV CRITICALITY ignore TYPE Masked-IMEISV PRESENCE optional}| + { ID id-ExpectedUEBehaviour CRITICALITY ignore TYPE ExpectedUEBehaviour PRESENCE optional}| + { ID id-ProSeAuthorized CRITICALITY ignore TYPE ProSeAuthorized PRESENCE optional}| + { ID id-UEUserPlaneCIoTSupportIndicator CRITICALITY ignore TYPE UEUserPlaneCIoTSupportIndicator PRESENCE optional}| + { ID id-V2XServicesAuthorized CRITICALITY ignore TYPE V2XServicesAuthorized PRESENCE optional}| + { ID id-UESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE UESidelinkAggregateMaximumBitrate PRESENCE optional}| + { ID id-EnhancedCoverageRestricted CRITICALITY ignore TYPE EnhancedCoverageRestricted PRESENCE optional}| + { ID id-NRUESecurityCapabilities CRITICALITY ignore TYPE NRUESecurityCapabilities PRESENCE optional}| + { ID id-CE-ModeBRestricted CRITICALITY ignore TYPE CE-ModeBRestricted PRESENCE optional}| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional}| + { ID id-PendingDataIndication CRITICALITY ignore TYPE PendingDataIndication PRESENCE optional}| + { ID id-Subscription-Based-UE-DifferentiationInfo CRITICALITY ignore TYPE Subscription-Based-UE-DifferentiationInfo PRESENCE optional}| + { ID id-AdditionalRRMPriorityIndex CRITICALITY ignore TYPE AdditionalRRMPriorityIndex PRESENCE optional }| + { ID id-IAB-Authorized CRITICALITY ignore TYPE IAB-Authorized PRESENCE optional}| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional}| + { ID id-CoarseUELocation CRITICALITY ignore TYPE CoarseUELocation PRESENCE optional}| + { ID id-TimeRefDistribution CRITICALITY ignore TYPE TimeRefDistribution PRESENCE optional}, + ... +} + + + + +E-RABToBeSetupListCtxtSUReq ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABToBeSetupItemCtxtSUReqIEs} } + +E-RABToBeSetupItemCtxtSUReqIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeSetupItemCtxtSUReq CRITICALITY reject TYPE E-RABToBeSetupItemCtxtSUReq PRESENCE mandatory }, + ... +} + +E-RABToBeSetupItemCtxtSUReq ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + e-RABlevelQoSParameters E-RABLevelQoSParameters, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + nAS-PDU NAS-PDU OPTIONAL, + iE-Extensions ProtocolExtensionContainer { {E-RABToBeSetupItemCtxtSUReqExtIEs} } OPTIONAL, + ... +} + + +E-RABToBeSetupItemCtxtSUReqExtIEs S1AP-PROTOCOL-EXTENSION ::= { + { ID id-Correlation-ID CRITICALITY ignore EXTENSION Correlation-ID PRESENCE optional}| + { ID id-SIPTO-Correlation-ID CRITICALITY ignore EXTENSION Correlation-ID PRESENCE optional}| + { ID id-BearerType CRITICALITY reject EXTENSION BearerType PRESENCE optional}| + { ID id-Ethernet-Type CRITICALITY ignore EXTENSION Ethernet-Type PRESENCE optional}| + { ID id-SecurityIndication CRITICALITY reject EXTENSION SecurityIndication PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- Initial Context Setup Response +-- +-- ************************************************************** + +InitialContextSetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InitialContextSetupResponseIEs} }, + ... +} + +InitialContextSetupResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-RABSetupListCtxtSURes CRITICALITY ignore TYPE E-RABSetupListCtxtSURes PRESENCE mandatory }| + { ID id-E-RABFailedToSetupListCtxtSURes CRITICALITY ignore TYPE E-RABList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + + +E-RABSetupListCtxtSURes ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABSetupItemCtxtSUResIEs} } + +E-RABSetupItemCtxtSUResIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABSetupItemCtxtSURes CRITICALITY ignore TYPE E-RABSetupItemCtxtSURes PRESENCE mandatory }, + ... +} + +E-RABSetupItemCtxtSURes ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + gTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { {E-RABSetupItemCtxtSUResExtIEs} } OPTIONAL, + ... +} +E-RABSetupItemCtxtSUResExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +-- ************************************************************** +-- +-- Initial Context Setup Failure +-- +-- ************************************************************** + +InitialContextSetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {InitialContextSetupFailureIEs} }, + ... +} + +InitialContextSetupFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PAGING ELEMENTARY PROCEDURE +-- +-- ************************************************************** + + +-- ************************************************************** +-- +-- Paging +-- +-- ************************************************************** + +Paging ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{PagingIEs}}, + ... +} + +PagingIEs S1AP-PROTOCOL-IES ::= { + { ID id-UEIdentityIndexValue CRITICALITY ignore TYPE UEIdentityIndexValue PRESENCE mandatory}| + { ID id-UEPagingID CRITICALITY ignore TYPE UEPagingID PRESENCE mandatory}| + { ID id-pagingDRX CRITICALITY ignore TYPE PagingDRX PRESENCE optional}| + { ID id-CNDomain CRITICALITY ignore TYPE CNDomain PRESENCE mandatory}| + { ID id-TAIList CRITICALITY ignore TYPE TAIList PRESENCE mandatory}| + { ID id-CSG-IdList CRITICALITY ignore TYPE CSG-IdList PRESENCE optional}| + { ID id-PagingPriority CRITICALITY ignore TYPE PagingPriority PRESENCE optional}| + { ID id-UERadioCapabilityForPaging CRITICALITY ignore TYPE UERadioCapabilityForPaging PRESENCE optional}| +-- Extension for Release 13 to support Paging Optimisation and Coverage Enhancement paging -- + { ID id-AssistanceDataForPaging CRITICALITY ignore TYPE AssistanceDataForPaging PRESENCE optional}| + { ID id-Paging-eDRXInformation CRITICALITY ignore TYPE Paging-eDRXInformation PRESENCE optional}| + { ID id-extended-UEIdentityIndexValue CRITICALITY ignore TYPE Extended-UEIdentityIndexValue PRESENCE optional}| + { ID id-NB-IoT-Paging-eDRXInformation CRITICALITY ignore TYPE NB-IoT-Paging-eDRXInformation PRESENCE optional}| + { ID id-NB-IoT-UEIdentityIndexValue CRITICALITY ignore TYPE NB-IoT-UEIdentityIndexValue PRESENCE optional}| + { ID id-EnhancedCoverageRestricted CRITICALITY ignore TYPE EnhancedCoverageRestricted PRESENCE optional}| + { ID id-CE-ModeBRestricted CRITICALITY ignore TYPE CE-ModeBRestricted PRESENCE optional}| + { ID id-DataSize CRITICALITY ignore TYPE DataSize PRESENCE optional}| + { ID id-WUS-Assistance-Information CRITICALITY ignore TYPE WUS-Assistance-Information PRESENCE optional}| + { ID id-NB-IoT-PagingDRX CRITICALITY ignore TYPE NB-IoT-PagingDRX PRESENCE optional}| + { ID id-PagingCause CRITICALITY ignore TYPE PagingCause PRESENCE optional}, + ... +} + +TAIList::= SEQUENCE (SIZE(1.. maxnoofTAIs)) OF ProtocolIE-SingleContainer {{TAIItemIEs}} + +TAIItemIEs S1AP-PROTOCOL-IES ::= { + { ID id-TAIItem CRITICALITY ignore TYPE TAIItem PRESENCE mandatory }, + ... +} + +TAIItem ::= SEQUENCE { + tAI TAI, + iE-Extensions ProtocolExtensionContainer { {TAIItemExtIEs} } OPTIONAL, + ... +} + + +TAIItemExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT RELEASE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Context Release Request +-- +-- ************************************************************** + +UEContextReleaseRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{UEContextReleaseRequest-IEs}}, + ... +} + +UEContextReleaseRequest-IEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-GWContextReleaseIndication CRITICALITY reject TYPE GWContextReleaseIndication PRESENCE optional }| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Context Release Command +-- +-- ************************************************************** + +UEContextReleaseCommand ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{UEContextReleaseCommand-IEs}}, + ... +} + +UEContextReleaseCommand-IEs S1AP-PROTOCOL-IES ::= { + { ID id-UE-S1AP-IDs CRITICALITY reject TYPE UE-S1AP-IDs PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE Context Release Complete +-- +-- ************************************************************** + +UEContextReleaseComplete ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{UEContextReleaseComplete-IEs}}, + ... +} + +UEContextReleaseComplete-IEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| +-- Extension for Release 12 to support User Location Information -- + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional}| +-- Extension for Release 13 to support Paging Optimisation + { ID id-InformationOnRecommendedCellsAndENBsForPaging CRITICALITY ignore TYPE InformationOnRecommendedCellsAndENBsForPaging PRESENCE optional}| +-- Extension for Release 13 to support coverage enhancement paging -- + { ID id-CellIdentifierAndCELevelForCECapableUEs CRITICALITY ignore TYPE CellIdentifierAndCELevelForCECapableUEs PRESENCE optional}| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE optional }| + { ID id-TimeSinceSecondaryNodeRelease CRITICALITY ignore TYPE TimeSinceSecondaryNodeRelease PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** +-- ************************************************************** +-- +-- UE Context Modification Request +-- +-- ************************************************************** + +UEContextModificationRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationRequestIEs} }, + ... +} + +UEContextModificationRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-SecurityKey CRITICALITY reject TYPE SecurityKey PRESENCE optional}| + { ID id-SubscriberProfileIDforRFP CRITICALITY ignore TYPE SubscriberProfileIDforRFP PRESENCE optional}| + { ID id-uEaggregateMaximumBitrate CRITICALITY ignore TYPE UEAggregateMaximumBitrate PRESENCE optional}| + { ID id-CSFallbackIndicator CRITICALITY reject TYPE CSFallbackIndicator PRESENCE optional}| + { ID id-UESecurityCapabilities CRITICALITY reject TYPE UESecurityCapabilities PRESENCE optional}| + { ID id-CSGMembershipStatus CRITICALITY ignore TYPE CSGMembershipStatus PRESENCE optional}| + { ID id-RegisteredLAI CRITICALITY ignore TYPE LAI PRESENCE optional}| + { ID id-AdditionalCSFallbackIndicator CRITICALITY ignore TYPE AdditionalCSFallbackIndicator PRESENCE conditional}| + -- The above IE shall be present if the CS Fallback Indicator IE is set to the value “CS Fallback High Priority” + { ID id-ProSeAuthorized CRITICALITY ignore TYPE ProSeAuthorized PRESENCE optional}| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional}| + { ID id-SRVCCOperationNotPossible CRITICALITY ignore TYPE SRVCCOperationNotPossible PRESENCE optional}| + { ID id-V2XServicesAuthorized CRITICALITY ignore TYPE V2XServicesAuthorized PRESENCE optional}| + { ID id-UESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE UESidelinkAggregateMaximumBitrate PRESENCE optional}| + { ID id-NRUESecurityCapabilities CRITICALITY ignore TYPE NRUESecurityCapabilities PRESENCE optional}| + { ID id-AerialUEsubscriptionInformation CRITICALITY ignore TYPE AerialUEsubscriptionInformation PRESENCE optional}| + { ID id-AdditionalRRMPriorityIndex CRITICALITY ignore TYPE AdditionalRRMPriorityIndex PRESENCE optional}| + { ID id-IAB-Authorized CRITICALITY ignore TYPE IAB-Authorized PRESENCE optional}| + { ID id-NRV2XServicesAuthorized CRITICALITY ignore TYPE NRV2XServicesAuthorized PRESENCE optional }| + { ID id-NRUESidelinkAggregateMaximumBitrate CRITICALITY ignore TYPE NRUESidelinkAggregateMaximumBitrate PRESENCE optional }| + { ID id-PC5QoSParameters CRITICALITY ignore TYPE PC5QoSParameters PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional}| + { ID id-TimeRefDistribution CRITICALITY ignore TYPE TimeRefDistribution PRESENCE optional}, + ... +} +-- ************************************************************** +-- +-- UE Context Modification Response +-- +-- ************************************************************** + +UEContextModificationResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationResponseIEs} }, + ... +} + +UEContextModificationResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} +-- ************************************************************** +-- +-- UE Context Modification Failure +-- +-- ************************************************************** + +UEContextModificationFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationFailureIEs} }, + ... +} + +UEContextModificationFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY MATCH ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Radio Capability Match Request +-- +-- ************************************************************** + +UERadioCapabilityMatchRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UERadioCapabilityMatchRequestIEs} }, + ... +} + +UERadioCapabilityMatchRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Radio Capability Match Response +-- +-- ************************************************************** + +UERadioCapabilityMatchResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UERadioCapabilityMatchResponseIEs} }, + ... +} + +UERadioCapabilityMatchResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-VoiceSupportMatchIndicator CRITICALITY reject TYPE VoiceSupportMatchIndicator PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- NAS TRANSPORT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- DOWNLINK NAS TRANSPORT +-- +-- ************************************************************** + +DownlinkNASTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{DownlinkNASTransport-IEs}}, + ... +} + +DownlinkNASTransport-IEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-NAS-PDU CRITICALITY reject TYPE NAS-PDU PRESENCE mandatory}| + { ID id-HandoverRestrictionList CRITICALITY ignore TYPE HandoverRestrictionList PRESENCE optional}| + { ID id-SubscriberProfileIDforRFP CRITICALITY ignore TYPE SubscriberProfileIDforRFP PRESENCE optional}| + { ID id-SRVCCOperationPossible CRITICALITY ignore TYPE SRVCCOperationPossible PRESENCE optional}| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional}| + { ID id-DLNASPDUDeliveryAckRequest CRITICALITY ignore TYPE DLNASPDUDeliveryAckRequest PRESENCE optional}| + { ID id-EnhancedCoverageRestricted CRITICALITY ignore TYPE EnhancedCoverageRestricted PRESENCE optional}| + { ID id-NRUESecurityCapabilities CRITICALITY ignore TYPE NRUESecurityCapabilities PRESENCE optional}| + { ID id-CE-ModeBRestricted CRITICALITY ignore TYPE CE-ModeBRestricted PRESENCE optional}| + { ID id-UECapabilityInfoRequest CRITICALITY ignore TYPE UECapabilityInfoRequest PRESENCE optional}| + { ID id-EndIndication CRITICALITY ignore TYPE EndIndication PRESENCE optional}| + { ID id-PendingDataIndication CRITICALITY ignore TYPE PendingDataIndication PRESENCE optional}| + { ID id-Subscription-Based-UE-DifferentiationInfo CRITICALITY ignore TYPE Subscription-Based-UE-DifferentiationInfo PRESENCE optional}| + { ID id-AdditionalRRMPriorityIndex CRITICALITY ignore TYPE AdditionalRRMPriorityIndex PRESENCE optional}| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional}| + { ID id-Masked-IMEISV CRITICALITY ignore TYPE Masked-IMEISV PRESENCE optional}| + { ID id-CoarseUELocation CRITICALITY ignore TYPE CoarseUELocation PRESENCE optional}, + ... +} +-- ************************************************************** +-- +-- INITIAL UE MESSAGE +-- +-- ************************************************************** + +InitialUEMessage ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{InitialUEMessage-IEs}}, + ... +} + +InitialUEMessage-IEs S1AP-PROTOCOL-IES ::= { + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-NAS-PDU CRITICALITY reject TYPE NAS-PDU PRESENCE mandatory}| + { ID id-TAI CRITICALITY reject TYPE TAI PRESENCE mandatory}| + { ID id-EUTRAN-CGI CRITICALITY ignore TYPE EUTRAN-CGI PRESENCE mandatory}| + { ID id-RRC-Establishment-Cause CRITICALITY ignore TYPE RRC-Establishment-Cause PRESENCE mandatory}| + { ID id-S-TMSI CRITICALITY reject TYPE S-TMSI PRESENCE optional}| + { ID id-CSG-Id CRITICALITY reject TYPE CSG-Id PRESENCE optional}| + { ID id-GUMMEI-ID CRITICALITY reject TYPE GUMMEI PRESENCE optional}| + { ID id-CellAccessMode CRITICALITY reject TYPE CellAccessMode PRESENCE optional}| + { ID id-GW-TransportLayerAddress CRITICALITY ignore TYPE TransportLayerAddress PRESENCE optional}| + { ID id-RelayNode-Indicator CRITICALITY reject TYPE RelayNode-Indicator PRESENCE optional}| + { ID id-GUMMEIType CRITICALITY ignore TYPE GUMMEIType PRESENCE optional}| +-- Extension for Release 11 to support BBAI -- + { ID id-Tunnel-Information-for-BBF CRITICALITY ignore TYPE TunnelInformation PRESENCE optional}| + { ID id-SIPTO-L-GW-TransportLayerAddress CRITICALITY ignore TYPE TransportLayerAddress PRESENCE optional}| + { ID id-LHN-ID CRITICALITY ignore TYPE LHN-ID PRESENCE optional}| + { ID id-MME-Group-ID CRITICALITY ignore TYPE MME-Group-ID PRESENCE optional}| + { ID id-UE-Usage-Type CRITICALITY ignore TYPE UE-Usage-Type PRESENCE optional}| + { ID id-CE-mode-B-SupportIndicator CRITICALITY ignore TYPE CE-mode-B-SupportIndicator PRESENCE optional}| + { ID id-DCN-ID CRITICALITY ignore TYPE DCN-ID PRESENCE optional}| + { ID id-Coverage-Level CRITICALITY ignore TYPE Coverage-Level PRESENCE optional}| + { ID id-UE-Application-Layer-Measurement-Capability CRITICALITY ignore TYPE UE-Application-Layer-Measurement-Capability + PRESENCE optional}| + { ID id-EDT-Session CRITICALITY ignore TYPE EDT-Session PRESENCE optional}| + { ID id-IAB-Node-Indication CRITICALITY reject TYPE IAB-Node-Indication PRESENCE optional}| + { ID id-LTE-NTN-TAI-Information CRITICALITY ignore TYPE LTE-NTN-TAI-Information PRESENCE optional}| + { ID id-CoarseUELocationRequested CRITICALITY ignore TYPE CoarseUELocationRequested PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- UPLINK NAS TRANSPORT +-- +-- ************************************************************** + +UplinkNASTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{UplinkNASTransport-IEs}}, + ... +} +UplinkNASTransport-IEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-NAS-PDU CRITICALITY reject TYPE NAS-PDU PRESENCE mandatory}| + { ID id-EUTRAN-CGI CRITICALITY ignore TYPE EUTRAN-CGI PRESENCE mandatory}| + { ID id-TAI CRITICALITY ignore TYPE TAI PRESENCE mandatory}| + { ID id-GW-TransportLayerAddress CRITICALITY ignore TYPE TransportLayerAddress PRESENCE optional}| + { ID id-SIPTO-L-GW-TransportLayerAddress CRITICALITY ignore TYPE TransportLayerAddress PRESENCE optional}| + { ID id-LHN-ID CRITICALITY ignore TYPE LHN-ID PRESENCE optional}| + { ID id-PSCellInformation CRITICALITY ignore TYPE PSCellInformation PRESENCE optional }| + { ID id-LTE-NTN-TAI-Information CRITICALITY ignore TYPE LTE-NTN-TAI-Information PRESENCE optional}, + ... +} +-- ************************************************************** +-- +-- NAS NON DELIVERY INDICATION +-- +-- ************************************************************** + +NASNonDeliveryIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{NASNonDeliveryIndication-IEs}}, + ... +} + +NASNonDeliveryIndication-IEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-NAS-PDU CRITICALITY ignore TYPE NAS-PDU PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- REROUTE NAS REQUEST +-- +-- ************************************************************** + +RerouteNASRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{RerouteNASRequest-IEs}}, + ... +} + +RerouteNASRequest-IEs S1AP-PROTOCOL-IES ::= { + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE optional}| + { ID id-S1-Message CRITICALITY reject TYPE OCTET STRING PRESENCE mandatory}| + { ID id-MME-Group-ID CRITICALITY reject TYPE MME-Group-ID PRESENCE mandatory}| + { ID id-Additional-GUTI CRITICALITY ignore TYPE Additional-GUTI PRESENCE optional}| + { ID id-UE-Usage-Type CRITICALITY ignore TYPE UE-Usage-Type PRESENCE optional}, + ... +} +-- ************************************************************** +-- +-- NAS DELIVERY INDICATION +-- +-- ************************************************************** + +NASDeliveryIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { NASDeliveryIndicationIEs} }, + ... +} + +NASDeliveryIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- RESET ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Reset +-- +-- ************************************************************** + +Reset ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ResetIEs} }, + ... +} + +ResetIEs S1AP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-ResetType CRITICALITY reject TYPE ResetType PRESENCE mandatory }, + ... +} + +ResetType ::= CHOICE { + s1-Interface ResetAll, + partOfS1-Interface UE-associatedLogicalS1-ConnectionListRes, + ... +} + + + +ResetAll ::= ENUMERATED { + reset-all, + ... +} +UE-associatedLogicalS1-ConnectionListRes ::= SEQUENCE (SIZE(1.. maxnoofIndividualS1ConnectionsToReset)) OF ProtocolIE-SingleContainer { { UE-associatedLogicalS1-ConnectionItemRes } } + +UE-associatedLogicalS1-ConnectionItemRes S1AP-PROTOCOL-IES ::= { + { ID id-UE-associatedLogicalS1-ConnectionItem CRITICALITY reject TYPE UE-associatedLogicalS1-ConnectionItem PRESENCE mandatory}, + ... +} + + +-- ************************************************************** +-- +-- Reset Acknowledge +-- +-- ************************************************************** + +ResetAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ResetAcknowledgeIEs} }, + ... +} + +ResetAcknowledgeIEs S1AP-PROTOCOL-IES ::= { + { ID id-UE-associatedLogicalS1-ConnectionListResAck CRITICALITY ignore TYPE UE-associatedLogicalS1-ConnectionListResAck PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +UE-associatedLogicalS1-ConnectionListResAck ::= SEQUENCE (SIZE(1.. maxnoofIndividualS1ConnectionsToReset)) OF ProtocolIE-SingleContainer { { UE-associatedLogicalS1-ConnectionItemResAck } } + +UE-associatedLogicalS1-ConnectionItemResAck S1AP-PROTOCOL-IES ::= { + { ID id-UE-associatedLogicalS1-ConnectionItem CRITICALITY ignore TYPE UE-associatedLogicalS1-ConnectionItem PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- ERROR INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Error Indication +-- +-- ************************************************************** + +ErrorIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ErrorIndicationIEs}}, + ... +} + +ErrorIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE optional }| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE optional }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }| + { ID id-S-TMSI CRITICALITY ignore TYPE S-TMSI PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- S1 SETUP ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- S1 Setup Request +-- +-- ************************************************************** + +S1SetupRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {S1SetupRequestIEs} }, + ... +} + +S1SetupRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-Global-ENB-ID CRITICALITY reject TYPE Global-ENB-ID PRESENCE mandatory}| + { ID id-eNBname CRITICALITY ignore TYPE ENBname PRESENCE optional}| + { ID id-SupportedTAs CRITICALITY reject TYPE SupportedTAs PRESENCE mandatory}| + { ID id-DefaultPagingDRX CRITICALITY ignore TYPE PagingDRX PRESENCE mandatory}| + { ID id-CSG-IdList CRITICALITY reject TYPE CSG-IdList PRESENCE optional}| + { ID id-UE-RetentionInformation CRITICALITY ignore TYPE UE-RetentionInformation PRESENCE optional}| + { ID id-NB-IoT-DefaultPagingDRX CRITICALITY ignore TYPE NB-IoT-DefaultPagingDRX PRESENCE optional}| + { ID id-ConnectedengNBList CRITICALITY ignore TYPE ConnectedengNBList PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- S1 Setup Response +-- +-- ************************************************************** + +S1SetupResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {S1SetupResponseIEs} }, + ... +} + + +S1SetupResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MMEname CRITICALITY ignore TYPE MMEname PRESENCE optional}| + { ID id-ServedGUMMEIs CRITICALITY reject TYPE ServedGUMMEIs PRESENCE mandatory}| + { ID id-RelativeMMECapacity CRITICALITY ignore TYPE RelativeMMECapacity PRESENCE mandatory}| + { ID id-MMERelaySupportIndicator CRITICALITY ignore TYPE MMERelaySupportIndicator PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| + { ID id-UE-RetentionInformation CRITICALITY ignore TYPE UE-RetentionInformation PRESENCE optional}| + { ID id-ServedDCNs CRITICALITY ignore TYPE ServedDCNs PRESENCE optional}| + { ID id-IAB-Supported CRITICALITY ignore TYPE IAB-Supported PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- S1 Setup Failure +-- +-- ************************************************************** + +S1SetupFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {S1SetupFailureIEs} }, + ... +} + +S1SetupFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- ENB CONFIGURATION UPDATE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- eNB Configuration Update +-- +-- ************************************************************** + +ENBConfigurationUpdate ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ENBConfigurationUpdateIEs} }, + ... +} + +ENBConfigurationUpdateIEs S1AP-PROTOCOL-IES ::= { + { ID id-eNBname CRITICALITY ignore TYPE ENBname PRESENCE optional}| + { ID id-SupportedTAs CRITICALITY reject TYPE SupportedTAs PRESENCE optional}| + { ID id-CSG-IdList CRITICALITY reject TYPE CSG-IdList PRESENCE optional}| + { ID id-DefaultPagingDRX CRITICALITY ignore TYPE PagingDRX PRESENCE optional}| + { ID id-NB-IoT-DefaultPagingDRX CRITICALITY ignore TYPE NB-IoT-DefaultPagingDRX PRESENCE optional}| + { ID id-ConnectedengNBToAddList CRITICALITY ignore TYPE ConnectedengNBList PRESENCE optional}| + { ID id-ConnectedengNBToRemoveList CRITICALITY ignore TYPE ConnectedengNBList PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- eNB Configuration Update Acknowledge +-- +-- ************************************************************** + +ENBConfigurationUpdateAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ENBConfigurationUpdateAcknowledgeIEs} }, + ... +} + + +ENBConfigurationUpdateAcknowledgeIEs S1AP-PROTOCOL-IES ::= { + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- eNB Configuration Update Failure +-- +-- ************************************************************** + +ENBConfigurationUpdateFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ENBConfigurationUpdateFailureIEs} }, + ... +} + +ENBConfigurationUpdateFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, +... +} + + +-- ************************************************************** +-- +-- MME CONFIGURATION UPDATE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MME Configuration Update +-- +-- ************************************************************** + +MMEConfigurationUpdate ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MMEConfigurationUpdateIEs} }, + ... +} + +MMEConfigurationUpdateIEs S1AP-PROTOCOL-IES ::= { + { ID id-MMEname CRITICALITY ignore TYPE MMEname PRESENCE optional }| + { ID id-ServedGUMMEIs CRITICALITY reject TYPE ServedGUMMEIs PRESENCE optional }| + { ID id-RelativeMMECapacity CRITICALITY reject TYPE RelativeMMECapacity PRESENCE optional }| + { ID id-ServedDCNs CRITICALITY ignore TYPE ServedDCNs PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- MME Configuration Update Acknowledge +-- +-- ************************************************************** + +MMEConfigurationUpdateAcknowledge ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MMEConfigurationUpdateAcknowledgeIEs} }, + ... +} + + +MMEConfigurationUpdateAcknowledgeIEs S1AP-PROTOCOL-IES ::= { + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- MME Configuration Update Failure +-- +-- ************************************************************** + +MMEConfigurationUpdateFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MMEConfigurationUpdateFailureIEs} }, + ... +} + +MMEConfigurationUpdateFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }| + { ID id-TimeToWait CRITICALITY ignore TYPE TimeToWait PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- DOWNLINK S1 CDMA2000 TUNNELLING ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Downlink S1 CDMA2000 Tunnelling +-- +-- ************************************************************** + +DownlinkS1cdma2000tunnelling ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {DownlinkS1cdma2000tunnellingIEs} }, + ... +} + +DownlinkS1cdma2000tunnellingIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-RABSubjecttoDataForwardingList CRITICALITY ignore TYPE E-RABSubjecttoDataForwardingList PRESENCE optional }| + { ID id-cdma2000HOStatus CRITICALITY ignore TYPE Cdma2000HOStatus PRESENCE optional }| + { ID id-cdma2000RATType CRITICALITY reject TYPE Cdma2000RATType PRESENCE mandatory }| + { ID id-cdma2000PDU CRITICALITY reject TYPE Cdma2000PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UPLINK S1 CDMA2000 TUNNELLING ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Uplink S1 CDMA2000 Tunnelling +-- +-- ************************************************************** + +UplinkS1cdma2000tunnelling ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UplinkS1cdma2000tunnellingIEs} }, + ... +} + +UplinkS1cdma2000tunnellingIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-cdma2000RATType CRITICALITY reject TYPE Cdma2000RATType PRESENCE mandatory }| + { ID id-cdma2000SectorID CRITICALITY reject TYPE Cdma2000SectorID PRESENCE mandatory }| + { ID id-cdma2000HORequiredIndication CRITICALITY ignore TYPE Cdma2000HORequiredIndication PRESENCE optional }| + { ID id-cdma2000OneXSRVCCInfo CRITICALITY reject TYPE Cdma2000OneXSRVCCInfo PRESENCE optional }| + { ID id-cdma2000OneXRAND CRITICALITY reject TYPE Cdma2000OneXRAND PRESENCE optional }| + { ID id-cdma2000PDU CRITICALITY reject TYPE Cdma2000PDU PRESENCE mandatory }| + { ID id-EUTRANRoundTripDelayEstimationInfo CRITICALITY ignore TYPE EUTRANRoundTripDelayEstimationInfo PRESENCE optional }, + -- Extension for Release 9 to assist target HRPD access with the acquisition of the UE -- + ... +} + + +-- ************************************************************** +-- +-- UE CAPABILITY INFO INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Capability Info Indication +-- +-- ************************************************************** + +UECapabilityInfoIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UECapabilityInfoIndicationIEs} }, + ... +} + +UECapabilityInfoIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE mandatory}| + { ID id-UERadioCapabilityForPaging CRITICALITY ignore TYPE UERadioCapabilityForPaging PRESENCE optional}| + { ID id-UE-Application-Layer-Measurement-Capability CRITICALITY ignore TYPE UE-Application-Layer-Measurement-Capability + PRESENCE optional}| + { ID id-LTE-M-Indication CRITICALITY ignore TYPE LTE-M-Indication PRESENCE optional}| + { ID id-UERadioCapability-NR-Format CRITICALITY ignore TYPE UERadioCapability PRESENCE optional}| + { ID id-UERadioCapabilityForPaging-NR-Format CRITICALITY ignore TYPE UERadioCapabilityForPaging PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- eNB STATUS TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- eNB Status Transfer +-- +-- ************************************************************** + +ENBStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ENBStatusTransferIEs} }, + ... +} + +ENBStatusTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-StatusTransfer-TransparentContainer CRITICALITY reject TYPE ENB-StatusTransfer-TransparentContainer PRESENCE mandatory}, + ... +} + + +-- ************************************************************** +-- +-- MME STATUS TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MME Status Transfer +-- +-- ************************************************************** + +MMEStatusTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {MMEStatusTransferIEs} }, + ... +} + +MMEStatusTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-StatusTransfer-TransparentContainer CRITICALITY reject TYPE ENB-StatusTransfer-TransparentContainer PRESENCE mandatory}, + ... +} + + +-- ************************************************************** +-- +-- TRACE ELEMENTARY PROCEDURES +-- +-- ************************************************************** +-- ************************************************************** +-- +-- Trace Start +-- +-- ************************************************************** + +TraceStart ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {TraceStartIEs} }, + ... +} + +TraceStartIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-TraceActivation CRITICALITY ignore TYPE TraceActivation PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Trace Failure Indication +-- +-- ************************************************************** + +TraceFailureIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {TraceFailureIndicationIEs} }, + ... +} + +TraceFailureIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-UTRAN-Trace-ID CRITICALITY ignore TYPE E-UTRAN-Trace-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- DEACTIVATE TRACE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Deactivate Trace +-- +-- ************************************************************** + +DeactivateTrace ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { DeactivateTraceIEs} }, + ... +} + +DeactivateTraceIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-E-UTRAN-Trace-ID CRITICALITY ignore TYPE E-UTRAN-Trace-ID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- CELL TRAFFIC TRACE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Cell Traffic Trace +-- +-- ************************************************************** + +CellTrafficTrace ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { CellTrafficTraceIEs } }, + ... +} + +CellTrafficTraceIEs S1AP-PROTOCOL-IES ::= { + {ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + {ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + {ID id-E-UTRAN-Trace-ID CRITICALITY ignore TYPE E-UTRAN-Trace-ID PRESENCE mandatory }| + {ID id-EUTRAN-CGI CRITICALITY ignore TYPE EUTRAN-CGI PRESENCE mandatory }| + {ID id-TraceCollectionEntityIPAddress CRITICALITY ignore TYPE TransportLayerAddress PRESENCE mandatory }| + {ID id-PrivacyIndicator CRITICALITY ignore TYPE PrivacyIndicator PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- LOCATION ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Location Reporting Control +-- +-- ************************************************************** + +LocationReportingControl ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { LocationReportingControlIEs} }, + ... +} + +LocationReportingControlIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-RequestType CRITICALITY ignore TYPE RequestType PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Location Report Failure Indication +-- +-- ************************************************************** + +LocationReportingFailureIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { LocationReportingFailureIndicationIEs} }, + ... +} + +LocationReportingFailureIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- Location Report +-- +-- ************************************************************** + +LocationReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { LocationReportIEs} }, + ... +} +LocationReportIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-EUTRAN-CGI CRITICALITY ignore TYPE EUTRAN-CGI PRESENCE mandatory }| + { ID id-TAI CRITICALITY ignore TYPE TAI PRESENCE mandatory }| + { ID id-RequestType CRITICALITY ignore TYPE RequestType PRESENCE mandatory }| + { ID id-PSCellInformation CRITICALITY ignore TYPE PSCellInformation PRESENCE optional }| + { ID id-LTE-NTN-TAI-Information CRITICALITY ignore TYPE LTE-NTN-TAI-Information PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- OVERLOAD ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Overload Start +-- +-- ************************************************************** + +OverloadStart ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {OverloadStartIEs} }, + ... +} + +OverloadStartIEs S1AP-PROTOCOL-IES ::= { + { ID id-OverloadResponse CRITICALITY reject TYPE OverloadResponse PRESENCE mandatory }| + { ID id-GUMMEIList CRITICALITY ignore TYPE GUMMEIList PRESENCE optional }| + { ID id-TrafficLoadReductionIndication CRITICALITY ignore TYPE TrafficLoadReductionIndication PRESENCE optional }, + ... +} +-- ************************************************************** +-- +-- Overload Stop +-- +-- ************************************************************** + +OverloadStop ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {OverloadStopIEs} }, + ... +} + +OverloadStopIEs S1AP-PROTOCOL-IES ::= { +{ ID id-GUMMEIList CRITICALITY ignore TYPE GUMMEIList PRESENCE optional }, + ... +} +-- ************************************************************** +-- +-- WRITE-REPLACE WARNING ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Write-Replace Warning Request +-- +-- ************************************************************** + + +WriteReplaceWarningRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {WriteReplaceWarningRequestIEs} }, + ... +} + +WriteReplaceWarningRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory }| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory }| + { ID id-WarningAreaList CRITICALITY ignore TYPE WarningAreaList PRESENCE optional }| + { ID id-RepetitionPeriod CRITICALITY reject TYPE RepetitionPeriod PRESENCE mandatory }| + { ID id-ExtendedRepetitionPeriod CRITICALITY reject TYPE ExtendedRepetitionPeriod PRESENCE optional }| + { ID id-NumberofBroadcastRequest CRITICALITY reject TYPE NumberofBroadcastRequest PRESENCE mandatory }| + { ID id-WarningType CRITICALITY ignore TYPE WarningType PRESENCE optional }| + { ID id-WarningSecurityInfo CRITICALITY ignore TYPE WarningSecurityInfo PRESENCE optional }| + { ID id-DataCodingScheme CRITICALITY ignore TYPE DataCodingScheme PRESENCE optional }| + { ID id-WarningMessageContents CRITICALITY ignore TYPE WarningMessageContents PRESENCE optional }| + { ID id-ConcurrentWarningMessageIndicator CRITICALITY reject TYPE ConcurrentWarningMessageIndicator PRESENCE optional }| + { ID id-WarningAreaCoordinates CRITICALITY ignore TYPE WarningAreaCoordinates PRESENCE optional }, + ... +} +-- ************************************************************** +-- +-- Write-Replace Warning Response +-- +-- ************************************************************** + +WriteReplaceWarningResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {WriteReplaceWarningResponseIEs} }, + ... +} + +WriteReplaceWarningResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory }| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory }| + { ID id-BroadcastCompletedAreaList CRITICALITY ignore TYPE BroadcastCompletedAreaList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- eNB DIRECT INFORMATION TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** +-- ************************************************************** +-- +-- eNB Direct Information Transfer +-- +-- ************************************************************** + +ENBDirectInformationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ ENBDirectInformationTransferIEs}}, + ... +} + +ENBDirectInformationTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-Inter-SystemInformationTransferTypeEDT CRITICALITY reject TYPE Inter-SystemInformationTransferType PRESENCE mandatory }, + ... +} + +Inter-SystemInformationTransferType ::= CHOICE { + rIMTransfer RIMTransfer, + ... +} + +-- ************************************************************** +-- +-- MME DIRECT INFORMATION TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MME Direct Information Transfer +-- +-- ************************************************************** + +MMEDirectInformationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ MMEDirectInformationTransferIEs}}, + ... +} + +MMEDirectInformationTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-Inter-SystemInformationTransferTypeMDT CRITICALITY reject TYPE Inter-SystemInformationTransferType PRESENCE mandatory }, + ... +} +-- ************************************************************** +-- +-- eNB CONFIGURATION TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- eNB Configuration Transfer +-- +-- ************************************************************** +ENBConfigurationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ ENBConfigurationTransferIEs}}, + ... +} + +ENBConfigurationTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-SONConfigurationTransferECT CRITICALITY ignore TYPE SONConfigurationTransfer PRESENCE optional }| + { ID id-EN-DCSONConfigurationTransfer-ECT CRITICALITY ignore TYPE EN-DCSONConfigurationTransfer PRESENCE optional }| + { ID id-IntersystemSONConfigurationTransferECT CRITICALITY ignore TYPE IntersystemSONConfigurationTransfer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- MME CONFIGURATION TRANSFER ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- MME Configuration Transfer +-- +-- ************************************************************** + +MMEConfigurationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ MMEConfigurationTransferIEs}}, + ... +} + +MMEConfigurationTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-SONConfigurationTransferMCT CRITICALITY ignore TYPE SONConfigurationTransfer PRESENCE optional }| + { ID id-EN-DCSONConfigurationTransfer-MCT CRITICALITY ignore TYPE EN-DCSONConfigurationTransfer PRESENCE optional }| + { ID id-IntersystemSONConfigurationTransferMCT CRITICALITY ignore TYPE IntersystemSONConfigurationTransfer PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PRIVATE MESSAGE ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Private Message +-- +-- ************************************************************** + +PrivateMessage ::= SEQUENCE { + privateIEs PrivateIE-Container {{PrivateMessageIEs}}, + ... +} + +PrivateMessageIEs S1AP-PRIVATE-IES ::= { + ... +} + +-- ************************************************************** +-- +-- KILL PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- Kill Request +-- +-- ************************************************************** + + +KillRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {KillRequestIEs} }, + ... +} + +KillRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory}| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory}| + { ID id-WarningAreaList CRITICALITY ignore TYPE WarningAreaList PRESENCE optional}| + { ID id-KillAllWarningMessages CRITICALITY reject TYPE KillAllWarningMessages PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- Kill Response +-- +-- ************************************************************** + +KillResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {KillResponseIEs} }, + ... +} + +KillResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MessageIdentifier CRITICALITY reject TYPE MessageIdentifier PRESENCE mandatory }| + { ID id-SerialNumber CRITICALITY reject TYPE SerialNumber PRESENCE mandatory }| + { ID id-BroadcastCancelledAreaList CRITICALITY ignore TYPE BroadcastCancelledAreaList PRESENCE optional }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- PWS RESTART INDICATION PROCEDURE +-- +-- ************************************************************** +-- ************************************************************** +-- +-- PWS Restart Indication +-- +-- ************************************************************** + +PWSRestartIndication::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ PWSRestartIndicationIEs}}, + ... +} + +PWSRestartIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-ECGIListForRestart CRITICALITY reject TYPE ECGIListForRestart PRESENCE mandatory}| + { ID id-Global-ENB-ID CRITICALITY reject TYPE Global-ENB-ID PRESENCE mandatory}| + { ID id-TAIListForRestart CRITICALITY reject TYPE TAIListForRestart PRESENCE mandatory}| + { ID id-EmergencyAreaIDListForRestart CRITICALITY reject TYPE EmergencyAreaIDListForRestart PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- PWS Failure Indication +-- +-- ************************************************************** + +PWSFailureIndication::= SEQUENCE { + protocolIEs ProtocolIE-Container {{ PWSFailureIndicationIEs}}, + ... +} + +PWSFailureIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-PWSfailedECGIList CRITICALITY reject TYPE PWSfailedECGIList PRESENCE mandatory}| + { ID id-Global-ENB-ID CRITICALITY reject TYPE Global-ENB-ID PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- LPPA TRANSPORT ELEMENTARY PROCEDURES +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- DOWNLINK UE ASSOCIATED LPPA TRANSPORT +-- +-- ************************************************************** + +DownlinkUEAssociatedLPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{DownlinkUEAssociatedLPPaTransport-IEs}}, + ... +} + +DownlinkUEAssociatedLPPaTransport-IEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Routing-ID CRITICALITY reject TYPE Routing-ID PRESENCE mandatory }| + { ID id-LPPa-PDU CRITICALITY reject TYPE LPPa-PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UPLINK UE ASSOCIATED LPPA TRANSPORT +-- +-- ************************************************************** + +UplinkUEAssociatedLPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{UplinkUEAssociatedLPPaTransport-IEs}}, + ... +} + +UplinkUEAssociatedLPPaTransport-IEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory }| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory }| + { ID id-Routing-ID CRITICALITY reject TYPE Routing-ID PRESENCE mandatory }| + { ID id-LPPa-PDU CRITICALITY reject TYPE LPPa-PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- DOWNLINK NON UE ASSOCIATED LPPA TRANSPORT +-- +-- ************************************************************** + +DownlinkNonUEAssociatedLPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{DownlinkNonUEAssociatedLPPaTransport-IEs}}, + ... +} + +DownlinkNonUEAssociatedLPPaTransport-IEs S1AP-PROTOCOL-IES ::= { + { ID id-Routing-ID CRITICALITY reject TYPE Routing-ID PRESENCE mandatory }| + { ID id-LPPa-PDU CRITICALITY reject TYPE LPPa-PDU PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UPLINK NON UE ASSOCIATED LPPA TRANSPORT +-- +-- ************************************************************** + +UplinkNonUEAssociatedLPPaTransport ::= SEQUENCE { + protocolIEs ProtocolIE-Container {{UplinkNonUEAssociatedLPPaTransport-IEs}}, + ... +} +UplinkNonUEAssociatedLPPaTransport-IEs S1AP-PROTOCOL-IES ::= { + { ID id-Routing-ID CRITICALITY reject TYPE Routing-ID PRESENCE mandatory }| + { ID id-LPPa-PDU CRITICALITY reject TYPE LPPa-PDU PRESENCE mandatory }, + ... +} + + +-- ************************************************************** +-- +-- E-RAB MODIFICATION INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- E-RAB Modification Indication +-- +-- ************************************************************** + +E-RABModificationIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { E-RABModificationIndicationIEs} }, + ... +} + +E-RABModificationIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-E-RABToBeModifiedListBearerModInd CRITICALITY reject TYPE E-RABToBeModifiedListBearerModInd PRESENCE mandatory}| + { ID id-E-RABNotToBeModifiedListBearerModInd CRITICALITY reject TYPE E-RABNotToBeModifiedListBearerModInd PRESENCE optional}| + { ID id-CSGMembershipInfo CRITICALITY reject TYPE CSGMembershipInfo PRESENCE optional}| +-- Extension for Release 11 to support BBAI -- + { ID id-Tunnel-Information-for-BBF CRITICALITY ignore TYPE TunnelInformation PRESENCE optional}| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE optional }| +{ ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }, + ... +} + +E-RABToBeModifiedListBearerModInd ::= E-RAB-IE-ContainerList { {E-RABToBeModifiedItemBearerModIndIEs} } + +E-RABToBeModifiedItemBearerModIndIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABToBeModifiedItemBearerModInd CRITICALITY reject TYPE E-RABToBeModifiedItemBearerModInd PRESENCE mandatory}, + ... +} + +E-RABToBeModifiedItemBearerModInd ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + dL-GTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { { E-RABToBeModifiedItemBearerModInd-ExtIEs} } OPTIONAL, + ... +} + +E-RABToBeModifiedItemBearerModInd-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +E-RABNotToBeModifiedListBearerModInd ::= E-RAB-IE-ContainerList { {E-RABNotToBeModifiedItemBearerModIndIEs} } + +E-RABNotToBeModifiedItemBearerModIndIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABNotToBeModifiedItemBearerModInd CRITICALITY reject TYPE E-RABNotToBeModifiedItemBearerModInd PRESENCE mandatory}, + ... +} + +E-RABNotToBeModifiedItemBearerModInd ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + transportLayerAddress TransportLayerAddress, + dL-GTP-TEID GTP-TEID, + iE-Extensions ProtocolExtensionContainer { { E-RABNotToBeModifiedItemBearerModInd-ExtIEs} } OPTIONAL, + ... +} + +E-RABNotToBeModifiedItemBearerModInd-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +CSGMembershipInfo ::= SEQUENCE { + cSGMembershipStatus CSGMembershipStatus, + cSG-Id CSG-Id, + cellAccessMode CellAccessMode OPTIONAL, + pLMNidentity PLMNidentity OPTIONAL, + iE-Extensions ProtocolExtensionContainer { { CSGMembershipInfo-ExtIEs} } OPTIONAL, + ... +} + +CSGMembershipInfo-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- ************************************************************** +-- +-- E-RAB Modification Confirm +-- +-- ************************************************************** + +E-RABModificationConfirm ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {E-RABModificationConfirmIEs} }, + ... +} + +E-RABModificationConfirmIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-E-RABModifyListBearerModConf CRITICALITY ignore TYPE E-RABModifyListBearerModConf PRESENCE optional}| + { ID id-E-RABFailedToModifyListBearerModConf CRITICALITY ignore TYPE E-RABList PRESENCE optional}| + { ID id-E-RABToBeReleasedListBearerModConf CRITICALITY ignore TYPE E-RABList PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| + { ID id-CSGMembershipStatus CRITICALITY ignore TYPE CSGMembershipStatus PRESENCE optional}, + ... +} + +E-RABModifyListBearerModConf ::= SEQUENCE (SIZE(1.. maxnoofE-RABs)) OF ProtocolIE-SingleContainer { {E-RABModifyItemBearerModConfIEs} } + +E-RABModifyItemBearerModConfIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABModifyItemBearerModConf CRITICALITY ignore TYPE E-RABModifyItemBearerModConf PRESENCE mandatory}, + ... +} + +E-RABModifyItemBearerModConf ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + iE-Extensions ProtocolExtensionContainer { {E-RABModifyItemBearerModConfExtIEs} } OPTIONAL, + ... +} + + +E-RABModifyItemBearerModConfExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + + +-- ************************************************************** +-- +-- UE CONTEXT MODIFICATION INDICATION ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Context Modification Indication +-- +-- ************************************************************** + +UEContextModificationIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextModificationIndicationIEs} }, + ... +} + +UEContextModificationIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-CSGMembershipInfo CRITICALITY reject TYPE CSGMembershipInfo PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- UE Context Modification Confirm +-- +-- ************************************************************** + +UEContextModificationConfirm ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextModificationConfirmIEs} }, + ... +} + +UEContextModificationConfirmIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-CSGMembershipStatus CRITICALITY ignore TYPE CSGMembershipStatus PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT SUSPEND ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Context Suspend Request +-- +-- ************************************************************** + +UEContextSuspendRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextSuspendRequestIEs} }, + ... +} + +UEContextSuspendRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-InformationOnRecommendedCellsAndENBsForPaging CRITICALITY ignore TYPE InformationOnRecommendedCellsAndENBsForPaging PRESENCE optional}| + { ID id-CellIdentifierAndCELevelForCECapableUEs CRITICALITY ignore TYPE CellIdentifierAndCELevelForCECapableUEs PRESENCE optional}| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE optional }| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional }| + { ID id-TimeSinceSecondaryNodeRelease CRITICALITY ignore TYPE TimeSinceSecondaryNodeRelease PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- UE Context Suspend Response +-- +-- ************************************************************** + +UEContextSuspendResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {UEContextSuspendResponseIEs} }, + ... +} + +UEContextSuspendResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- UE CONTEXT RESUME ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Context Resume Request +-- +-- ************************************************************** + +UEContextResumeRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextResumeRequestIEs} }, + ... +} + +UEContextResumeRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-E-RABFailedToResumeListResumeReq CRITICALITY reject TYPE E-RABFailedToResumeListResumeReq PRESENCE optional}| + { ID id-RRC-Resume-Cause CRITICALITY ignore TYPE RRC-Establishment-Cause PRESENCE optional}, + ... +} + +E-RABFailedToResumeListResumeReq ::= E-RAB-IE-ContainerList { {E-RABFailedToResumeItemResumeReqIEs} } + +E-RABFailedToResumeItemResumeReqIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABFailedToResumeItemResumeReq CRITICALITY reject TYPE E-RABFailedToResumeItemResumeReq PRESENCE mandatory}, + ... +} + +E-RABFailedToResumeItemResumeReq ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + cause Cause, + iE-Extensions ProtocolExtensionContainer { { E-RABFailedToResumeItemResumeReq-ExtIEs} } OPTIONAL, + ... +} + +E-RABFailedToResumeItemResumeReq-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- ************************************************************** +-- +-- UE Context Resume Response +-- +-- ************************************************************** +UEContextResumeResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextResumeResponseIEs} }, + ... +} + +UEContextResumeResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-E-RABFailedToResumeListResumeRes CRITICALITY reject TYPE E-RABFailedToResumeListResumeRes PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}| + { ID id-SecurityContext CRITICALITY reject TYPE SecurityContext PRESENCE optional}| + { ID id-PendingDataIndication CRITICALITY ignore TYPE PendingDataIndication PRESENCE optional}, + ... +} + +E-RABFailedToResumeListResumeRes ::= E-RAB-IE-ContainerList { {E-RABFailedToResumeItemResumeResIEs} } + +E-RABFailedToResumeItemResumeResIEs S1AP-PROTOCOL-IES ::= { + { ID id-E-RABFailedToResumeItemResumeRes CRITICALITY reject TYPE E-RABFailedToResumeItemResumeRes PRESENCE mandatory}, + ... +} + +E-RABFailedToResumeItemResumeRes ::= SEQUENCE { + e-RAB-ID E-RAB-ID, + cause Cause, + iE-Extensions ProtocolExtensionContainer { { E-RABFailedToResumeItemResumeRes-ExtIEs} } OPTIONAL, + ... +} + +E-RABFailedToResumeItemResumeRes-ExtIEs S1AP-PROTOCOL-EXTENSION ::= { + ... +} + +-- ************************************************************** +-- +-- UE Context Resume Failure +-- +-- ************************************************************** + +UEContextResumeFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEContextResumeFailureIEs} }, + ... +} + +UEContextResumeFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- Connection Establishment Indication +-- +-- ************************************************************** + +ConnectionEstablishmentIndication::= SEQUENCE { + protocolIEs ProtocolIE-Container { {ConnectionEstablishmentIndicationIEs} }, + ... +} + +ConnectionEstablishmentIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional }| + { ID id-EnhancedCoverageRestricted CRITICALITY ignore TYPE EnhancedCoverageRestricted PRESENCE optional }| + { ID id-DL-CP-SecurityInformation CRITICALITY ignore TYPE DL-CP-SecurityInformation PRESENCE optional }| + { ID id-CE-ModeBRestricted CRITICALITY ignore TYPE CE-ModeBRestricted PRESENCE optional}| + { ID id-EndIndication CRITICALITY ignore TYPE EndIndication PRESENCE optional}| + { ID id-Subscription-Based-UE-DifferentiationInfo CRITICALITY ignore TYPE Subscription-Based-UE-DifferentiationInfo PRESENCE optional}| + { ID id-UE-Level-QoS-Parameters CRITICALITY ignore TYPE E-RABLevelQoSParameters PRESENCE optional}| + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE optional}| + { ID id-Masked-IMEISV CRITICALITY ignore TYPE Masked-IMEISV PRESENCE optional}| + { ID id-CoarseUELocation CRITICALITY ignore TYPE CoarseUELocation PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- Retrieve UE Information +-- +-- ************************************************************** + +RetrieveUEInformation ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { RetrieveUEInformationIEs} }, + ... +} + +RetrieveUEInformationIEs S1AP-PROTOCOL-IES ::= { + { ID id-S-TMSI CRITICALITY reject TYPE S-TMSI PRESENCE mandatory}, +... + +} + + +-- ************************************************************** + +-- UE Information Transfer +-- +-- ************************************************************** +UEInformationTransfer ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UEInformationTransferIEs} }, + ... +} +UEInformationTransferIEs S1AP-PROTOCOL-IES ::= { + { ID id-S-TMSI CRITICALITY reject TYPE S-TMSI PRESENCE mandatory}| + { ID id-UE-Level-QoS-Parameters CRITICALITY ignore TYPE E-RABLevelQoSParameters PRESENCE optional}| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE optional}| + { ID id-Subscription-Based-UE-DifferentiationInfo CRITICALITY ignore TYPE Subscription-Based-UE-DifferentiationInfo PRESENCE optional}| + { ID id-PendingDataIndication CRITICALITY ignore TYPE PendingDataIndication PRESENCE optional}| + { ID id-Masked-IMEISV CRITICALITY ignore TYPE Masked-IMEISV PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- eNB CP Relocation Indication +-- +-- ************************************************************** + +ENBCPRelocationIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { ENBCPRelocationIndicationIEs} }, + ... +} + +ENBCPRelocationIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-S-TMSI CRITICALITY reject TYPE S-TMSI PRESENCE mandatory}| + { ID id-EUTRAN-CGI CRITICALITY ignore TYPE EUTRAN-CGI PRESENCE mandatory}| + { ID id-TAI CRITICALITY ignore TYPE TAI PRESENCE mandatory}| + { ID id-UL-CP-SecurityInformation CRITICALITY reject TYPE UL-CP-SecurityInformation PRESENCE mandatory}| + { ID id-LTE-NTN-TAI-Information CRITICALITY ignore TYPE LTE-NTN-TAI-Information PRESENCE optional}, + ... +} + + +-- ************************************************************** +-- +-- MME CP Relocation Indication +-- +-- ************************************************************** + +MMECPRelocationIndication ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { MMECPRelocationIndicationIEs} }, + ... +} + +MMECPRelocationIndicationIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY reject TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY reject TYPE ENB-UE-S1AP-ID PRESENCE mandatory}, + ... +} + + +-- ************************************************************** +-- +-- Secondary RAT Data Usage Report +-- +-- ************************************************************** + +SecondaryRATDataUsageReport ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { SecondaryRATDataUsageReportIEs} }, + ... +} + +SecondaryRATDataUsageReportIEs S1AP-PROTOCOL-IES ::= { + { ID id-MME-UE-S1AP-ID CRITICALITY ignore TYPE MME-UE-S1AP-ID PRESENCE mandatory}| + { ID id-eNB-UE-S1AP-ID CRITICALITY ignore TYPE ENB-UE-S1AP-ID PRESENCE mandatory}| + { ID id-SecondaryRATDataUsageReportList CRITICALITY ignore TYPE SecondaryRATDataUsageReportList PRESENCE mandatory}| + { ID id-HandoverFlag CRITICALITY ignore TYPE HandoverFlag PRESENCE optional}| + { ID id-UserLocationInformation CRITICALITY ignore TYPE UserLocationInformation PRESENCE optional}| + { ID id-TimeSinceSecondaryNodeRelease CRITICALITY ignore TYPE TimeSinceSecondaryNodeRelease PRESENCE optional }, + ... +} + + +-- ************************************************************** +-- +-- UE RADIO CAPABILITY ID MAPPING PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- UE Radio Capability ID Mapping Request +-- +-- ************************************************************** + +UERadioCapabilityIDMappingRequest::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UERadioCapabilityIDMappingRequestIEs} }, + ... +} + +UERadioCapabilityIDMappingRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE mandatory }, + ... +} + +-- ************************************************************** +-- +-- UE Radio Capability ID Mapping Response +-- +-- ************************************************************** + +UERadioCapabilityIDMappingResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { { UERadioCapabilityIDMappingResponseIEs} }, + ... +} + +UERadioCapabilityIDMappingResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-UERadioCapabilityID CRITICALITY reject TYPE UERadioCapabilityID PRESENCE mandatory }| + { ID id-UERadioCapability CRITICALITY ignore TYPE UERadioCapability PRESENCE mandatory }| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +-- ************************************************************** +-- +-- S1 REMOVAL ELEMENTARY PROCEDURE +-- +-- ************************************************************** + +-- ************************************************************** +-- +-- S1 Removal Request +-- +-- ************************************************************** + +S1RemovalRequest ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {S1RemovalRequestIEs} }, + ... +} + +S1RemovalRequestIEs S1AP-PROTOCOL-IES ::= { + { ID id-Global-ENB-ID CRITICALITY reject TYPE Global-ENB-ID PRESENCE mandatory}, + ... +} + +-- ************************************************************** +-- +-- S1 Removal Response +-- +-- ************************************************************** + +S1RemovalResponse ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {S1RemovalResponseIEs} }, + ... +} + + +S1RemovalResponseIEs S1AP-PROTOCOL-IES ::= { + { ID id-MMEname CRITICALITY ignore TYPE MMEname PRESENCE optional}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional}, + ... +} + +-- ************************************************************** +-- +-- S1 Removal Failure +-- +-- ************************************************************** + +S1RemovalFailure ::= SEQUENCE { + protocolIEs ProtocolIE-Container { {S1RemovalFailureIEs} }, + ... +} + +S1RemovalFailureIEs S1AP-PROTOCOL-IES ::= { + { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory}| + { ID id-CriticalityDiagnostics CRITICALITY ignore TYPE CriticalityDiagnostics PRESENCE optional }, + ... +} + +END diff --git a/s1ap/testdata/asn1/S1AP-PDU-Descriptions.asn b/s1ap/testdata/asn1/S1AP-PDU-Descriptions.asn new file mode 100644 index 0000000000..52cf08fd70 --- /dev/null +++ b/s1ap/testdata/asn1/S1AP-PDU-Descriptions.asn @@ -0,0 +1,789 @@ +-- ************************************************************** +-- +-- Elementary Procedure definitions +-- +-- ************************************************************** + +S1AP-PDU-Descriptions { +itu-t (0) identified-organization (4) etsi (0) mobileDomain (0) +eps-Access (21) modules (3) s1ap (1) version1 (1) s1ap-PDU-Descriptions (0)} + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- ************************************************************** +-- +-- IE parameter types from other modules. +-- +-- ************************************************************** + +IMPORTS + Criticality, + ProcedureCode +FROM S1AP-CommonDataTypes + + CellTrafficTrace, + DeactivateTrace, + DownlinkUEAssociatedLPPaTransport, + DownlinkNASTransport, + DownlinkNonUEAssociatedLPPaTransport, + DownlinkS1cdma2000tunnelling, + ENBDirectInformationTransfer, + ENBStatusTransfer, + ENBConfigurationUpdate, + ENBConfigurationUpdateAcknowledge, + ENBConfigurationUpdateFailure, + ErrorIndication, + HandoverCancel, + HandoverCancelAcknowledge, + HandoverCommand, + HandoverFailure, + HandoverNotify, + HandoverPreparationFailure, + HandoverRequest, + HandoverRequestAcknowledge, + HandoverRequired, + InitialContextSetupFailure, + InitialContextSetupRequest, + InitialContextSetupResponse, + InitialUEMessage, + KillRequest, + KillResponse, + LocationReportingControl, + LocationReportingFailureIndication, + LocationReport, + MMEConfigurationUpdate, + MMEConfigurationUpdateAcknowledge, + MMEConfigurationUpdateFailure, + MMEDirectInformationTransfer, + MMEStatusTransfer, + NASNonDeliveryIndication, + OverloadStart, + OverloadStop, + Paging, + PathSwitchRequest, + PathSwitchRequestAcknowledge, + PathSwitchRequestFailure, + PrivateMessage, + Reset, + ResetAcknowledge, + S1SetupFailure, + S1SetupRequest, + S1SetupResponse, + E-RABModifyRequest, + E-RABModifyResponse, + E-RABModificationIndication, + E-RABModificationConfirm, + E-RABReleaseCommand, + E-RABReleaseResponse, + E-RABReleaseIndication, + E-RABSetupRequest, + E-RABSetupResponse, + TraceFailureIndication, + TraceStart, + UECapabilityInfoIndication, + UEContextModificationFailure, + UEContextModificationRequest, + UEContextModificationResponse, + UEContextReleaseCommand, + UEContextReleaseComplete, + UEContextReleaseRequest, + UERadioCapabilityMatchRequest, + UERadioCapabilityMatchResponse, + UplinkUEAssociatedLPPaTransport, + UplinkNASTransport, + UplinkNonUEAssociatedLPPaTransport, + UplinkS1cdma2000tunnelling, + WriteReplaceWarningRequest, + WriteReplaceWarningResponse, + ENBConfigurationTransfer, + MMEConfigurationTransfer, + PWSRestartIndication, + UEContextModificationIndication, + UEContextModificationConfirm, + RerouteNASRequest, + PWSFailureIndication, + UEContextSuspendRequest, + UEContextSuspendResponse, + UEContextResumeRequest, + UEContextResumeResponse, + UEContextResumeFailure, + ConnectionEstablishmentIndication, + NASDeliveryIndication, + RetrieveUEInformation, + UEInformationTransfer, + ENBCPRelocationIndication, + MMECPRelocationIndication, + SecondaryRATDataUsageReport, + UERadioCapabilityIDMappingRequest, + UERadioCapabilityIDMappingResponse, + HandoverSuccess, + ENBEarlyStatusTransfer, + MMEEarlyStatusTransfer, + S1RemovalFailure, + S1RemovalRequest, + S1RemovalResponse + + + +FROM S1AP-PDU-Contents + + id-CellTrafficTrace, + id-DeactivateTrace, + id-downlinkUEAssociatedLPPaTransport, + id-downlinkNASTransport, + id-downlinkNonUEAssociatedLPPaTransport, + id-DownlinkS1cdma2000tunnelling, + id-eNBStatusTransfer, + id-ErrorIndication, + id-HandoverCancel, + id-HandoverNotification, + id-HandoverPreparation, + id-HandoverResourceAllocation, + id-InitialContextSetup, + id-initialUEMessage, + id-ENBConfigurationUpdate, + id-Kill, + id-LocationReportingControl, + id-LocationReportingFailureIndication, + id-LocationReport, + id-eNBDirectInformationTransfer, + id-MMEConfigurationUpdate, + id-MMEDirectInformationTransfer, + id-MMEStatusTransfer, + id-NASNonDeliveryIndication, + id-OverloadStart, + id-OverloadStop, + id-Paging, + id-PathSwitchRequest, + id-PrivateMessage, + id-Reset, + id-S1Setup, + id-E-RABModify, + id-E-RABModificationIndication, + id-E-RABRelease, + id-E-RABReleaseIndication, + id-E-RABSetup, + id-TraceFailureIndication, + id-TraceStart, + id-UECapabilityInfoIndication, + id-UEContextModification, + id-UEContextRelease, + id-UEContextReleaseRequest, + id-UERadioCapabilityMatch, + id-uplinkUEAssociatedLPPaTransport, + id-uplinkNASTransport, + id-uplinkNonUEAssociatedLPPaTransport, + id-UplinkS1cdma2000tunnelling, + id-WriteReplaceWarning, + id-eNBConfigurationTransfer, + id-MMEConfigurationTransfer, + id-PWSRestartIndication, + id-UEContextModificationIndication, + id-RerouteNASRequest, + id-PWSFailureIndication, + id-UEContextSuspend, + id-UEContextResume, + id-ConnectionEstablishmentIndication, + id-NASDeliveryIndication, + id-RetrieveUEInformation, + id-UEInformationTransfer, + id-eNBCPRelocationIndication, + id-MMECPRelocationIndication, + id-SecondaryRATDataUsageReport, + id-UERadioCapabilityIDMapping, + id-HandoverSuccess, + id-eNBEarlyStatusTransfer, + id-MMEEarlyStatusTransfer, + id-S1Removal + + + +FROM S1AP-Constants; + + +-- ************************************************************** +-- +-- Interface Elementary Procedure Class +-- +-- ************************************************************** + +S1AP-ELEMENTARY-PROCEDURE ::= CLASS { + &InitiatingMessage , + &SuccessfulOutcome OPTIONAL, + &UnsuccessfulOutcome OPTIONAL, + &procedureCode ProcedureCode UNIQUE, + &criticality Criticality DEFAULT ignore +} +WITH SYNTAX { + INITIATING MESSAGE &InitiatingMessage + [SUCCESSFUL OUTCOME &SuccessfulOutcome] + [UNSUCCESSFUL OUTCOME &UnsuccessfulOutcome] + PROCEDURE CODE &procedureCode + [CRITICALITY &criticality] +} + +-- ************************************************************** +-- +-- Interface PDU Definition +-- +-- ************************************************************** + +S1AP-PDU ::= CHOICE { + initiatingMessage InitiatingMessage, + successfulOutcome SuccessfulOutcome, + unsuccessfulOutcome UnsuccessfulOutcome, + ... +} + +InitiatingMessage ::= SEQUENCE { + procedureCode S1AP-ELEMENTARY-PROCEDURE.&procedureCode ({S1AP-ELEMENTARY-PROCEDURES}), + criticality S1AP-ELEMENTARY-PROCEDURE.&criticality ({S1AP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value S1AP-ELEMENTARY-PROCEDURE.&InitiatingMessage ({S1AP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +SuccessfulOutcome ::= SEQUENCE { + procedureCode S1AP-ELEMENTARY-PROCEDURE.&procedureCode ({S1AP-ELEMENTARY-PROCEDURES}), + criticality S1AP-ELEMENTARY-PROCEDURE.&criticality ({S1AP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value S1AP-ELEMENTARY-PROCEDURE.&SuccessfulOutcome ({S1AP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +UnsuccessfulOutcome ::= SEQUENCE { + procedureCode S1AP-ELEMENTARY-PROCEDURE.&procedureCode ({S1AP-ELEMENTARY-PROCEDURES}), + criticality S1AP-ELEMENTARY-PROCEDURE.&criticality ({S1AP-ELEMENTARY-PROCEDURES}{@procedureCode}), + value S1AP-ELEMENTARY-PROCEDURE.&UnsuccessfulOutcome ({S1AP-ELEMENTARY-PROCEDURES}{@procedureCode}) +} + +-- ************************************************************** +-- +-- Interface Elementary Procedure List +-- +-- ************************************************************** + +S1AP-ELEMENTARY-PROCEDURES S1AP-ELEMENTARY-PROCEDURE ::= { + S1AP-ELEMENTARY-PROCEDURES-CLASS-1 | + S1AP-ELEMENTARY-PROCEDURES-CLASS-2, + ... +} + + +S1AP-ELEMENTARY-PROCEDURES-CLASS-1 S1AP-ELEMENTARY-PROCEDURE ::= { + handoverPreparation | + handoverResourceAllocation | + pathSwitchRequest | + e-RABSetup | + e-RABModify | + e-RABRelease | + initialContextSetup | + handoverCancel | + kill | + reset | + s1Setup | + uEContextModification | + uEContextRelease | + eNBConfigurationUpdate | + mMEConfigurationUpdate | + writeReplaceWarning , + ..., + uERadioCapabilityMatch | + e-RABModificationIndication | + uEContextModificationIndication | + uEContextSuspend | + uEContextResume | + uERadioCapabilityIDMapping | + s1Removal +} + +S1AP-ELEMENTARY-PROCEDURES-CLASS-2 S1AP-ELEMENTARY-PROCEDURE ::= { + handoverNotification | + e-RABReleaseIndication | + paging | + downlinkNASTransport | + initialUEMessage | + uplinkNASTransport | + errorIndication | + nASNonDeliveryIndication | + uEContextReleaseRequest | + downlinkS1cdma2000tunnelling | + uplinkS1cdma2000tunnelling | + uECapabilityInfoIndication | + eNBStatusTransfer | + mMEStatusTransfer | + deactivateTrace | + traceStart | + traceFailureIndication | + cellTrafficTrace | + locationReportingControl | + locationReportingFailureIndication | + locationReport | + overloadStart | + overloadStop | + eNBDirectInformationTransfer | + mMEDirectInformationTransfer | + eNBConfigurationTransfer | + mMEConfigurationTransfer | + privateMessage , + ..., + downlinkUEAssociatedLPPaTransport | + uplinkUEAssociatedLPPaTransport | + downlinkNonUEAssociatedLPPaTransport | + uplinkNonUEAssociatedLPPaTransport | + pWSRestartIndication | + rerouteNASRequest | + pWSFailureIndication | + connectionEstablishmentIndication | + nASDeliveryIndication | + retrieveUEInformation | + uEInformationTransfer | + eNBCPRelocationIndication | + mMECPRelocationIndication | + secondaryRATDataUsageReport | + handoverSuccess | + eNBEarlyStatusTransfer | + mMEEarlyStatusTransfer +} + +-- ************************************************************** +-- +-- Interface Elementary Procedures +-- +-- ************************************************************** + +handoverPreparation S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverRequired + SUCCESSFUL OUTCOME HandoverCommand + UNSUCCESSFUL OUTCOME HandoverPreparationFailure + PROCEDURE CODE id-HandoverPreparation + CRITICALITY reject +} + +handoverResourceAllocation S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverRequest + SUCCESSFUL OUTCOME HandoverRequestAcknowledge + UNSUCCESSFUL OUTCOME HandoverFailure + PROCEDURE CODE id-HandoverResourceAllocation + CRITICALITY reject +} + +handoverNotification S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverNotify + PROCEDURE CODE id-HandoverNotification + CRITICALITY ignore +} +pathSwitchRequest S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PathSwitchRequest + SUCCESSFUL OUTCOME PathSwitchRequestAcknowledge + UNSUCCESSFUL OUTCOME PathSwitchRequestFailure + PROCEDURE CODE id-PathSwitchRequest + CRITICALITY reject +} + +e-RABSetup S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE E-RABSetupRequest + SUCCESSFUL OUTCOME E-RABSetupResponse + PROCEDURE CODE id-E-RABSetup + CRITICALITY reject +} + +e-RABModify S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE E-RABModifyRequest + SUCCESSFUL OUTCOME E-RABModifyResponse + PROCEDURE CODE id-E-RABModify + CRITICALITY reject +} + +e-RABRelease S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE E-RABReleaseCommand + SUCCESSFUL OUTCOME E-RABReleaseResponse + PROCEDURE CODE id-E-RABRelease + CRITICALITY reject +} + +e-RABReleaseIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE E-RABReleaseIndication + PROCEDURE CODE id-E-RABReleaseIndication + CRITICALITY ignore +} + +initialContextSetup S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE InitialContextSetupRequest + SUCCESSFUL OUTCOME InitialContextSetupResponse + UNSUCCESSFUL OUTCOME InitialContextSetupFailure + PROCEDURE CODE id-InitialContextSetup + CRITICALITY reject +} + +uEContextReleaseRequest S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextReleaseRequest + PROCEDURE CODE id-UEContextReleaseRequest + CRITICALITY ignore +} + +paging S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE Paging + PROCEDURE CODE id-Paging + CRITICALITY ignore +} +downlinkNASTransport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkNASTransport + PROCEDURE CODE id-downlinkNASTransport + CRITICALITY ignore +} + +initialUEMessage S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE InitialUEMessage + PROCEDURE CODE id-initialUEMessage + CRITICALITY ignore +} + +uplinkNASTransport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkNASTransport + PROCEDURE CODE id-uplinkNASTransport + CRITICALITY ignore +} +nASNonDeliveryIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE NASNonDeliveryIndication + PROCEDURE CODE id-NASNonDeliveryIndication + CRITICALITY ignore +} + +handoverCancel S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverCancel + SUCCESSFUL OUTCOME HandoverCancelAcknowledge + PROCEDURE CODE id-HandoverCancel + CRITICALITY reject +} + +reset S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE Reset + SUCCESSFUL OUTCOME ResetAcknowledge + PROCEDURE CODE id-Reset + CRITICALITY reject +} + +errorIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ErrorIndication + PROCEDURE CODE id-ErrorIndication + CRITICALITY ignore +} + +s1Setup S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE S1SetupRequest + SUCCESSFUL OUTCOME S1SetupResponse + UNSUCCESSFUL OUTCOME S1SetupFailure + PROCEDURE CODE id-S1Setup + CRITICALITY reject +} + +eNBConfigurationUpdate S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ENBConfigurationUpdate + SUCCESSFUL OUTCOME ENBConfigurationUpdateAcknowledge + UNSUCCESSFUL OUTCOME ENBConfigurationUpdateFailure + PROCEDURE CODE id-ENBConfigurationUpdate + CRITICALITY reject +} + +mMEConfigurationUpdate S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MMEConfigurationUpdate + SUCCESSFUL OUTCOME MMEConfigurationUpdateAcknowledge + UNSUCCESSFUL OUTCOME MMEConfigurationUpdateFailure + PROCEDURE CODE id-MMEConfigurationUpdate + CRITICALITY reject +} + +downlinkS1cdma2000tunnelling S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkS1cdma2000tunnelling + PROCEDURE CODE id-DownlinkS1cdma2000tunnelling + CRITICALITY ignore +} + +uplinkS1cdma2000tunnelling S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkS1cdma2000tunnelling + PROCEDURE CODE id-UplinkS1cdma2000tunnelling + CRITICALITY ignore +} + +uEContextModification S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextModificationRequest + SUCCESSFUL OUTCOME UEContextModificationResponse + UNSUCCESSFUL OUTCOME UEContextModificationFailure + PROCEDURE CODE id-UEContextModification + CRITICALITY reject +} + +uECapabilityInfoIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UECapabilityInfoIndication + PROCEDURE CODE id-UECapabilityInfoIndication + CRITICALITY ignore +} + +uEContextRelease S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextReleaseCommand + SUCCESSFUL OUTCOME UEContextReleaseComplete + PROCEDURE CODE id-UEContextRelease + CRITICALITY reject +} + +eNBStatusTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ENBStatusTransfer + PROCEDURE CODE id-eNBStatusTransfer + CRITICALITY ignore +} + +mMEStatusTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MMEStatusTransfer + PROCEDURE CODE id-MMEStatusTransfer + CRITICALITY ignore +} + +deactivateTrace S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DeactivateTrace + PROCEDURE CODE id-DeactivateTrace + CRITICALITY ignore +} + +traceStart S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE TraceStart + PROCEDURE CODE id-TraceStart + CRITICALITY ignore +} + +traceFailureIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE TraceFailureIndication + PROCEDURE CODE id-TraceFailureIndication + CRITICALITY ignore +} +cellTrafficTrace S1AP-ELEMENTARY-PROCEDURE ::={ + INITIATING MESSAGE CellTrafficTrace + PROCEDURE CODE id-CellTrafficTrace + CRITICALITY ignore +} + +locationReportingControl S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE LocationReportingControl + PROCEDURE CODE id-LocationReportingControl + CRITICALITY ignore +} + +locationReportingFailureIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE LocationReportingFailureIndication + PROCEDURE CODE id-LocationReportingFailureIndication + CRITICALITY ignore +} + +locationReport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE LocationReport + PROCEDURE CODE id-LocationReport + CRITICALITY ignore +} + +overloadStart S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE OverloadStart + PROCEDURE CODE id-OverloadStart + CRITICALITY ignore +} + +overloadStop S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE OverloadStop + PROCEDURE CODE id-OverloadStop + CRITICALITY reject +} + +writeReplaceWarning S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE WriteReplaceWarningRequest + SUCCESSFUL OUTCOME WriteReplaceWarningResponse + PROCEDURE CODE id-WriteReplaceWarning + CRITICALITY reject +} + +eNBDirectInformationTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ENBDirectInformationTransfer + PROCEDURE CODE id-eNBDirectInformationTransfer + CRITICALITY ignore +} + +mMEDirectInformationTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MMEDirectInformationTransfer + PROCEDURE CODE id-MMEDirectInformationTransfer + CRITICALITY ignore +} + +eNBConfigurationTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ENBConfigurationTransfer + PROCEDURE CODE id-eNBConfigurationTransfer + CRITICALITY ignore +} + +mMEConfigurationTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MMEConfigurationTransfer + PROCEDURE CODE id-MMEConfigurationTransfer + CRITICALITY ignore +} + + +privateMessage S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PrivateMessage + PROCEDURE CODE id-PrivateMessage + CRITICALITY ignore +} + +pWSRestartIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSRestartIndication + PROCEDURE CODE id-PWSRestartIndication + CRITICALITY ignore +} + +kill S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE KillRequest + SUCCESSFUL OUTCOME KillResponse + PROCEDURE CODE id-Kill + CRITICALITY reject +} +downlinkUEAssociatedLPPaTransport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkUEAssociatedLPPaTransport + PROCEDURE CODE id-downlinkUEAssociatedLPPaTransport + CRITICALITY ignore +} + +uplinkUEAssociatedLPPaTransport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkUEAssociatedLPPaTransport + PROCEDURE CODE id-uplinkUEAssociatedLPPaTransport + CRITICALITY ignore +} +downlinkNonUEAssociatedLPPaTransport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE DownlinkNonUEAssociatedLPPaTransport + PROCEDURE CODE id-downlinkNonUEAssociatedLPPaTransport + CRITICALITY ignore +} + +uplinkNonUEAssociatedLPPaTransport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UplinkNonUEAssociatedLPPaTransport + PROCEDURE CODE id-uplinkNonUEAssociatedLPPaTransport + CRITICALITY ignore +} + +uERadioCapabilityMatch S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UERadioCapabilityMatchRequest + SUCCESSFUL OUTCOME UERadioCapabilityMatchResponse + PROCEDURE CODE id-UERadioCapabilityMatch + CRITICALITY reject +} + +e-RABModificationIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE E-RABModificationIndication + SUCCESSFUL OUTCOME E-RABModificationConfirm + PROCEDURE CODE id-E-RABModificationIndication + CRITICALITY reject +} + +uEContextModificationIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextModificationIndication + SUCCESSFUL OUTCOME UEContextModificationConfirm + PROCEDURE CODE id-UEContextModificationIndication + CRITICALITY reject +} + +rerouteNASRequest S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RerouteNASRequest + PROCEDURE CODE id-RerouteNASRequest + CRITICALITY reject +} + +pWSFailureIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE PWSFailureIndication + PROCEDURE CODE id-PWSFailureIndication + CRITICALITY ignore +} + +uEContextSuspend S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextSuspendRequest + SUCCESSFUL OUTCOME UEContextSuspendResponse + PROCEDURE CODE id-UEContextSuspend + CRITICALITY reject +} + +uEContextResume S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEContextResumeRequest + SUCCESSFUL OUTCOME UEContextResumeResponse + UNSUCCESSFUL OUTCOME UEContextResumeFailure + PROCEDURE CODE id-UEContextResume + CRITICALITY reject +} + +connectionEstablishmentIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ConnectionEstablishmentIndication + PROCEDURE CODE id-ConnectionEstablishmentIndication + CRITICALITY reject +} + +nASDeliveryIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE NASDeliveryIndication + PROCEDURE CODE id-NASDeliveryIndication + CRITICALITY ignore +} + +retrieveUEInformation S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE RetrieveUEInformation + PROCEDURE CODE id-RetrieveUEInformation + CRITICALITY reject +} + +uEInformationTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UEInformationTransfer + PROCEDURE CODE id-UEInformationTransfer + CRITICALITY reject +} + +eNBCPRelocationIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ENBCPRelocationIndication + PROCEDURE CODE id-eNBCPRelocationIndication + CRITICALITY reject +} + +mMECPRelocationIndication S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MMECPRelocationIndication + PROCEDURE CODE id-MMECPRelocationIndication + CRITICALITY reject +} +secondaryRATDataUsageReport S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE SecondaryRATDataUsageReport + PROCEDURE CODE id-SecondaryRATDataUsageReport + CRITICALITY ignore +} + +uERadioCapabilityIDMapping S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE UERadioCapabilityIDMappingRequest + SUCCESSFUL OUTCOME UERadioCapabilityIDMappingResponse + PROCEDURE CODE id-UERadioCapabilityIDMapping + CRITICALITY reject +} + +handoverSuccess S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE HandoverSuccess + PROCEDURE CODE id-HandoverSuccess + CRITICALITY ignore +} + +eNBEarlyStatusTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE ENBEarlyStatusTransfer + PROCEDURE CODE id-eNBEarlyStatusTransfer + CRITICALITY reject +} + +mMEEarlyStatusTransfer S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE MMEEarlyStatusTransfer + PROCEDURE CODE id-MMEEarlyStatusTransfer + CRITICALITY ignore +} + +s1Removal S1AP-ELEMENTARY-PROCEDURE ::= { + INITIATING MESSAGE S1RemovalRequest + SUCCESSFUL OUTCOME S1RemovalResponse + UNSUCCESSFUL OUTCOME S1RemovalFailure + PROCEDURE CODE id-S1Removal + CRITICALITY reject +} + + +END diff --git a/s1ap/testdata/asn1/SonTransfer-IEs.asn b/s1ap/testdata/asn1/SonTransfer-IEs.asn new file mode 100644 index 0000000000..4ef87660ab --- /dev/null +++ b/s1ap/testdata/asn1/SonTransfer-IEs.asn @@ -0,0 +1,329 @@ +-- ************************************************************** +-- +-- IE definitions for the SON Transfer application +-- The IEs in this ASN.1 module shall be defined and encoded +-- using the same rules as applicable for the S1AP-IEs module. +-- +-- ************************************************************** +SonTransfer-IEs + +DEFINITIONS AUTOMATIC TAGS ::= + +BEGIN + +-- +-- Generic IEs for the SON Transfer application +-- + +SONtransferApplicationIdentity ::= ENUMERATED { + cell-load-reporting, + ..., + multi-cell-load-reporting, + event-triggered-cell-load-reporting, + ho-reporting, + eutran-cell-activation, + energy-savings-indication, + failure-event-reporting +} + +SONtransferRequestContainer ::= CHOICE{ + cellLoadReporting NULL, + ..., + multiCellLoadReporting MultiCellLoadReportingRequest, + eventTriggeredCellLoadReporting EventTriggeredCellLoadReportingRequest, + hOReporting HOReport, + eutranCellActivation CellActivationRequest, + energySavingsIndication CellStateIndication, + failureEventReporting FailureEventReport +} + +SONtransferResponseContainer ::= CHOICE{ + cellLoadReporting CellLoadReportingResponse, + ..., + multiCellLoadReporting MultiCellLoadReportingResponse, + eventTriggeredCellLoadReporting EventTriggeredCellLoadReportingResponse, + hOReporting NULL, + eutranCellActivation CellActivationResponse, + energySavingsIndication NULL, + failureEventReporting NULL +} + +SONtransferCause ::= CHOICE { + cellLoadReporting CellLoadReportingCause, + ..., + multiCellLoadReporting CellLoadReportingCause, + eventTriggeredCellLoadReporting CellLoadReportingCause, + hOReporting HOReportingCause, + eutranCellActivation CellActivationCause, + energySavingsIndication CellStateIndicationCause, + failureEventReporting FailureEventReportingCause +} + + +CellLoadReportingCause ::= ENUMERATED { + application-container-syntax-error, + inconsistent-reporting-cell-identifier, + unspecified, + ... +} + +HOReportingCause ::= ENUMERATED { + application-container-syntax-error, + inconsistent-reporting-cell-identifier, + unspecified, + ... +} + +CellActivationCause ::= ENUMERATED { + application-container-syntax-error, + inconsistent-reporting-cell-identifier, + unspecified, + ... +} + +CellStateIndicationCause ::= ENUMERATED { + application-container-syntax-error, + inconsistent-reporting-cell-identifier, + unspecified, + ... +} + +FailureEventReportingCause ::= ENUMERATED { + application-container-syntax-error, + inconsistent-reporting-cell-identifier, + unspecified, + ... +} +-- +-- IEs for Cell Load Reporting application +-- + +CellLoadReportingResponse::= CHOICE{ + eUTRAN EUTRANcellLoadReportingResponse, + uTRAN OCTET STRING, + gERAN OCTET STRING, + ..., + eHRPD EHRPDSectorLoadReportingResponse +} + +CompositeAvailableCapacityGroup ::= OCTET STRING + +EUTRANcellLoadReportingResponse ::= SEQUENCE { + compositeAvailableCapacityGroup CompositeAvailableCapacityGroup, + ... +} + +-- +-- IEs for Multi-Cell Load Reporting application +-- + +EUTRANResponse::= SEQUENCE { + cell-ID OCTET STRING, + eUTRANcellLoadReportingResponse EUTRANcellLoadReportingResponse, + ... +} + +EHRPD-Sector-ID ::= OCTET STRING (SIZE (16)) + +IRAT-Cell-ID ::= CHOICE{ + eUTRAN OCTET STRING, + uTRAN OCTET STRING, + gERAN OCTET STRING, + ..., + eHRPD EHRPD-Sector-ID +} + +RequestedCellList ::= SEQUENCE (SIZE(1.. maxnoofIRATReportingCells)) OF IRAT-Cell-ID + +MultiCellLoadReportingRequest::= SEQUENCE { + requestedCellList RequestedCellList, + ... +} + +ReportingCellList-Item ::= SEQUENCE { + cell-ID IRAT-Cell-ID, + ... +} + +ReportingCellList ::= SEQUENCE (SIZE(1.. maxnoofIRATReportingCells)) OF ReportingCellList-Item + +MultiCellLoadReportingResponse ::= SEQUENCE (SIZE(1.. maxnoofIRATReportingCells)) OF +MultiCellLoadReportingResponse-Item + +MultiCellLoadReportingResponse-Item ::= CHOICE{ + eUTRANResponse EUTRANResponse, + uTRANResponse OCTET STRING, + gERANResponse OCTET STRING, + ..., + eHRPD EHRPDMultiSectorLoadReportingResponseItem +} + + +-- +-- IEs for Event-triggered Cell Load Reporting application +-- + +NumberOfMeasurementReportingLevels ::= ENUMERATED { + rl2, + rl3, + rl4, + rl5, + rl10, + ... +} +EventTriggeredCellLoadReportingRequest ::= SEQUENCE { + numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels, + ... +} + +OverloadFlag ::= ENUMERATED { + overload, + ... +} + +EventTriggeredCellLoadReportingResponse ::= SEQUENCE { + cellLoadReportingResponse CellLoadReportingResponse, + overloadFlag OverloadFlag OPTIONAL, + ... +} + +-- +-- IEs for HO Reporting application +-- + + + +HOReport::= SEQUENCE { + hoType HoType, + hoReportType HoReportType, + hosourceID IRAT-Cell-ID, + hoTargetID IRAT-Cell-ID, + candidateCellList CandidateCellList, + ..., + candidatePCIList CandidatePCIList OPTIONAL +} + +HoType ::= ENUMERATED { + ltetoutran, + ltetogeran, + ... +} + +HoReportType ::= ENUMERATED { + unnecessaryhotoanotherrat, + ..., + earlyirathandover +} + +CandidateCellList ::= SEQUENCE (SIZE(1..maxnoofcandidateCells)) OF IRAT-Cell-ID + +CandidatePCIList ::= SEQUENCE (SIZE(1..maxnoofcandidateCells)) OF CandidatePCI + +CandidatePCI ::= SEQUENCE { + pCI INTEGER (0..503), + eARFCN OCTET STRING, + ... +} + +-- +-- IEs for E-UTRAN Cell Activation application +-- + +CellActivationRequest ::= SEQUENCE { + cellsToActivateList CellsToActivateList, + minimumActivationTime INTEGER (1..60) OPTIONAL, +... +} + +CellsToActivateList ::= SEQUENCE (SIZE(1.. maxnoofCellineNB)) OF CellsToActivateList-Item + +CellsToActivateList-Item ::= SEQUENCE { + cell-ID OCTET STRING, + ... +} + +CellActivationResponse ::= SEQUENCE { + activatedCellsList ActivatedCellsList, + ... +} + +ActivatedCellsList ::= SEQUENCE (SIZE(0.. maxnoofCellineNB)) OF ActivatedCellsList-Item +ActivatedCellsList-Item ::= SEQUENCE { + cell-ID OCTET STRING, + ... +} + +-- +-- IEs for Energy Savings Indication application +-- + +CellStateIndication ::= SEQUENCE { + notificationCellList NotificationCellList, + ... +} + +NotificationCellList ::= SEQUENCE (SIZE(1.. maxnoofCellineNB)) OF NotificationCellList-Item + +NotificationCellList-Item ::= SEQUENCE { + cell-ID OCTET STRING, + notifyFlag NotifyFlag, + ... +} + +NotifyFlag ::= ENUMERATED { + activated, + deactivated, + ... +} + +FailureEventReport::= CHOICE { + tooEarlyInterRATHOReportFromEUTRAN TooEarlyInterRATHOReportReportFromEUTRAN, + ... +} + +TooEarlyInterRATHOReportReportFromEUTRAN ::= SEQUENCE { + uERLFReportContainer OCTET STRING, + mobilityInformation MobilityInformation OPTIONAL, + ... +} + +MobilityInformation ::= BIT STRING (SIZE(32)) + + +-- +-- IEs for reporting of eHRPD load +-- + +EHRPDCapacityValue ::= INTEGER (0..100) + +EHRPDSectorCapacityClassValue ::= INTEGER (1..100, ...) + +EHRPDSectorLoadReportingResponse ::= SEQUENCE { + dL-EHRPD-CompositeAvailableCapacity EHRPDCompositeAvailableCapacity, + uL-EHRPD-CompositeAvailableCapacity EHRPDCompositeAvailableCapacity, + ... +} + +EHRPDCompositeAvailableCapacity ::= SEQUENCE { + eHRPDSectorCapacityClassValue EHRPDSectorCapacityClassValue, + eHRPDCapacityValue EHRPDCapacityValue, + ... +} + +EHRPDMultiSectorLoadReportingResponseItem ::= SEQUENCE { + eHRPD-Sector-ID EHRPD-Sector-ID, + eHRPDSectorLoadReportingResponse EHRPDSectorLoadReportingResponse, + ... +} + + +-- ************************************************************** +-- +-- Constants +-- +-- ************************************************************** + +maxnoofIRATReportingCells INTEGER ::= 128 +maxnoofcandidateCells INTEGER ::= 16 +maxnoofCellineNB INTEGER ::= 256 +END diff --git a/s1ap/tnl_lossless_test.go b/s1ap/tnl_lossless_test.go index 14071b5f26..f0697c5031 100644 --- a/s1ap/tnl_lossless_test.go +++ b/s1ap/tnl_lossless_test.go @@ -6,10 +6,11 @@ package s1ap import ( "bytes" "encoding/hex" - "reflect" + "slices" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const idUnknownExtension ProtocolIEID = 999 @@ -17,7 +18,7 @@ const idUnknownExtension ProtocolIEID = 999 func tnlExtensionContainer(fields ...ieField) []byte { w := per.NewWriter() - if err := encodeExtensionContainer(w, per.Aligned, fields); err != nil { + if err := encodeExtensionContainer(w, fields); err != nil { panic(err) } @@ -26,20 +27,6 @@ func tnlExtensionContainer(fields ...ieField) []byte { return w.Bytes() } -func tnlRawExtensions(fields ...rawIE) *rawIEExtensions { - var ext []ieField - for _, f := range fields { - ext = append(ext, f.field()) - } - - var e rawIEExtensions - if err := e.UnmarshalPER(per.NewReader(tnlExtensionContainer(ext...)), per.Aligned); err != nil { - panic(err) - } - - return &e -} - func tnlExtensionAdditions(contents ...[]byte) per.ExtensionAdditions { w := per.NewWriter() @@ -69,13 +56,11 @@ func tnlExtensionAdditions(contents ...[]byte) per.ExtensionAdditions { return e } -func tnlUnknownExtension() *rawIEExtensions { - return tnlRawExtensions(rawIE{id: idUnknownExtension, crit: CriticalityIgnore, value: []byte{0x5a}}) -} +func tnlUnknownExtension() extensionMeta { return tnlUnknownMeta() } -func tnlUnknownMeta() messageMeta { - var m messageMeta - m.preserve(rawIE{id: idUnknownExtension, crit: CriticalityIgnore, value: []byte{0x5a}}) +func tnlUnknownMeta() extensionMeta { + var m extensionMeta + m.Append(rawIE{ID: idUnknownExtension, Criticality: CriticalityIgnore, Value: []byte{0x5a}}) return m } @@ -102,13 +87,11 @@ func tnlQoS() ERABLevelQoSParameters { } func ignoreCrit() containerCrit { - c := CriticalityIgnore - return containerCrit{crit: &c} + return containerCrit{crit: ap.WireCriticality(CriticalityIgnore) + 1} } func rejectCrit() containerCrit { - c := CriticalityReject - return containerCrit{crit: &c} + return containerCrit{crit: ap.WireCriticality(CriticalityReject) + 1} } type tnlValue interface { @@ -155,7 +138,7 @@ func losslessRoundTrip[T any, PT interface { t.Fatal(err) } - if !reflect.DeepEqual(again, out) { + if !equalByMethod(again, out) { t.Errorf("re-decoded\n got %+v\nwant %+v", again, out) } } @@ -185,12 +168,10 @@ func TestTNLItemsKnownExtensionsTyped(t *testing.T) { ho := &ERABToBeSetupItemHOReq{ ERABID: 7, TransportLayerAddress: goldTLA(), GTPTEID: 3, QoS: goldQoS(), - Extensions: &ERABToBeSetupItemHOReqExtIEs{ - DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), - BearerType: Ptr(BearerTypeNonIP), - EthernetType: Ptr(EthernetTypeTrue), - SecurityIndication: sec, - }, + DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue), + BearerType: Ptr(BearerTypeNonIP), + EthernetType: Ptr(EthernetTypeTrue), + SecurityIndication: sec, } switched := &ERABToBeSwitchedDLItem{ERABID: 8, TransportLayerAddress: goldTLA(), GTPTEID: 4, SecurityIndication: sec} @@ -217,7 +198,7 @@ func TestTNLItemsKnownExtensionsTyped(t *testing.T) { t.Fatalf("a known extension was not comprehended: %v", err) } - if !reflect.DeepEqual(c.out, c.in) { + if !equalByMethod(c.out, c.in) { t.Fatalf("decoded\n got %+v\nwant %+v", c.out, c.in) } }) @@ -225,7 +206,7 @@ func TestTNLItemsKnownExtensionsTyped(t *testing.T) { } func TestTNLItemsLossless(t *testing.T) { - ext := func() *rawIEExtensions { return tnlUnknownExtension() } + ext := func() extensionMeta { return tnlUnknownExtension() } add := func() per.ExtensionAdditions { return tnlExtensionAdditions([]byte{0xaa}, []byte{0xbb, 0xcc}) } t.Run("E-RABToBeSetupItemCtxtSUReq", func(t *testing.T) { @@ -241,11 +222,11 @@ func TestTNLItemsLossless(t *testing.T) { in := &ERABToBeModifiedItemBearerModReq{ERABID: 7, QoS: tnlQoS(), NASPDU: NASPDU{0x27}, extensions: add()} container := tnlExtensionContainer( - ieField{id: IDTransportInformation, crit: CriticalityReject, val: &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 4, extensions: add()}}, - ieField{id: idUnknownExtension, crit: CriticalityIgnore, raw: []byte{0x5a}}, + ieField{ID: IDTransportInformation, Criticality: CriticalityReject, Value: &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 4, extensions: add()}}, + ieField{ID: idUnknownExtension, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x5a})}, ) - if err := decodeExtensionContainer(per.NewReader(container), per.Aligned, eRABToBeModifyItemBearerModReqExtIEs, in, &in.iEExtensions); err != nil { + if err := decodeExtensionContainer(per.NewReader(container), extIEsERABToBeModifiedItemBearerModReq, in, &in.iEExtensions); err != nil { t.Fatal(err) } @@ -262,34 +243,31 @@ func TestTNLItemsLossless(t *testing.T) { in := &ERABToBeSetupItemHOReq{ERABID: 9, TransportLayerAddress: goldTLA(), GTPTEID: 6, QoS: tnlQoS(), extensions: add()} container := tnlExtensionContainer( - ieField{id: idUnknownExtension, crit: CriticalityIgnore, raw: []byte{0x5a}}, - ieField{id: IDDataForwardingNotPossible, crit: CriticalityIgnore, val: DataForwardingNotPossibleTrue}, + ieField{ID: idUnknownExtension, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x5a})}, + ieField{ID: IDDataForwardingNotPossible, Criticality: CriticalityIgnore, Value: DataForwardingNotPossibleTrue}, ) - var e ERABToBeSetupItemHOReqExtIEs - if err := e.UnmarshalPER(per.NewReader(container), per.Aligned); err != nil { + if err := decodeExtensionContainer(per.NewReader(container), extIEsERABToBeSetupItemHOReq, in, &in.iEExtensions); err != nil { t.Fatal(err) } - if e.DataForwardingNotPossible == nil { + if in.DataForwardingNotPossible == nil { t.Fatal("Data-Forwarding-Not-Possible lost") } - in.Extensions = &e - losslessRoundTrip(t, in, "") }) t.Run("E-RABAdmittedItem", func(t *testing.T) { losslessRoundTrip(t, &ERABAdmittedItem{ ERABID: 10, TransportLayerAddress: goldTLA(), GTPTEID: 7, - DLTransportLayerAddr: goldTLA(), DLGTPTEID: Ptr(GTPTEID(8)), - ULTransportLayerAddr: goldTLA(), ULGTPTEID: Ptr(GTPTEID(9)), + DLTransportLayerAddr: Ptr(goldTLA()), DLGTPTEID: Ptr(GTPTEID(8)), + ULTransportLayerAddr: Ptr(goldTLA()), ULGTPTEID: Ptr(GTPTEID(9)), iEExtensions: ext(), extensions: add(), }, "") }) t.Run("E-RABDataForwardingItem", func(t *testing.T) { losslessRoundTrip(t, &ERABDataForwardingItem{ - ERABID: 11, DLTransportLayerAddr: goldTLA(), DLGTPTEID: Ptr(GTPTEID(10)), + ERABID: 11, DLTransportLayerAddr: Ptr(goldTLA()), DLGTPTEID: Ptr(GTPTEID(10)), iEExtensions: ext(), extensions: add(), }, "") }) @@ -306,17 +284,25 @@ func TestTNLItemsLossless(t *testing.T) { func TestTNLItemUnknownRejectExtensionNotComprehended(t *testing.T) { w := per.NewWriter() - if err := encodeExtensionContainer(w, per.Aligned, []ieField{{id: idUnknownExtension, crit: CriticalityReject, raw: []byte{0x00}}}); err != nil { + if err := encodeExtensionContainer(w, []ieField{{ID: idUnknownExtension, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}}); err != nil { t.Fatal(err) } w.AlignToByte() - var meta messageMeta + item := new(ERABToBeModifiedItemBearerModReq) + + if err := decodeExtensionContainer(per.NewReader(w.Bytes()), extIEsERABToBeModifiedItemBearerModReq, item, &item.iEExtensions); err != nil { + t.Fatalf("decode is lenient, got %v", err) + } + + d := ap.Diagnose[ProtocolIEID](item) + if len(d.IEs) != 1 || d.IEs[0].ID != idUnknownExtension || d.IEs[0].Criticality != CriticalityReject { + t.Fatalf("diagnostics = %+v, want the unknown reject extension", d.IEs) + } - err := decodeExtensionContainer(per.NewReader(w.Bytes()), per.Aligned, eRABToBeModifyItemBearerModReqExtIEs, new(ERABToBeModifiedItemBearerModReq), &meta) - if err == nil { - t.Fatal("unknown reject extension accepted") + if d.Check() == nil { + t.Fatal("Check() accepted an unknown reject extension") } } @@ -361,7 +347,7 @@ func TestTNLListsLossless(t *testing.T) { losslessRoundTrip(t, &l, "") }) t.Run("E-RABSubjecttoDataForwardingList", func(t *testing.T) { - l := ERABSubjecttoDataForwardingList{{ERABID: 1, ULTransportLayerAddr: goldTLA(), ULGTPTEID: Ptr(GTPTEID(1)), containerCrit: rejectCrit()}} + l := ERABSubjecttoDataForwardingList{{ERABID: 1, ULTransportLayerAddr: Ptr(goldTLA()), ULGTPTEID: Ptr(GTPTEID(1)), containerCrit: rejectCrit()}} losslessRoundTrip(t, &l, "") }) t.Run("E-RABToBeSwitchedDLList", func(t *testing.T) { @@ -433,7 +419,7 @@ func tnlGoldenCases() []newMessageCase { msg: &PathSwitchRequestAcknowledge{ MMEUES1APID: Ptr(MMEUES1APID(1)), ENBUES1APID: Ptr(ENBUES1APID(2)), - ERABToBeSwitchedUL: ERABToBeSwitchedULList{{ERABID: 5, TransportLayerAddress: TransportLayerAddress{10, 0, 0, 9}, GTPTEID: 0x01020304}}, + ERABToBeSwitchedUL: ERABToBeSwitchedULList{{ERABID: 5, TransportLayerAddress: tlaOf(10, 0, 0, 9), GTPTEID: 0x01020304}}, SecurityContext: SecurityContext{NextHopChainingCount: 3}, }, parse: func(b []byte) (any, error) { return ParsePathSwitchRequestAcknowledge(b) }, @@ -449,7 +435,7 @@ func tnlGoldenCases() []newMessageCase { ERABID: 5, QoS: goldQoS(), NASPDU: NASPDU{0x07, 0x46}, - TransportInformation: &TransportInformation{TransportLayerAddress: TransportLayerAddress{10, 0, 0, 9}, ULGTPTEID: 0x01020304}, + TransportInformation: &TransportInformation{TransportLayerAddress: tlaOf(10, 0, 0, 9), ULGTPTEID: 0x01020304}, }}, }, parse: func(b []byte) (any, error) { return ParseERABModifyRequest(b) }, @@ -506,13 +492,13 @@ func tnlGoldenCases() []newMessageCase { msg: &PathSwitchRequest{ ENBUES1APID: 2, ERABToBeSwitchedDL: ERABToBeSwitchedDLList{{ - ERABID: 5, TransportLayerAddress: TransportLayerAddress{10, 1, 2, 3}, GTPTEID: 0x01020304, + ERABID: 5, TransportLayerAddress: tlaOf(10, 1, 2, 3), GTPTEID: 0x01020304, SecurityIndication: &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionRequired}, }}, SourceMMEUES1APID: 0x020000bf, EUTRANCGI: Ptr(EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x123c601}), TAI: Ptr(TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}), - UESecurityCapabilities: Ptr(UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}), + UESecurityCapabilities: Ptr(UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}), }, parse: func(b []byte) (any, error) { return ParsePathSwitchRequest(b) }, choice: isInitiating, @@ -573,9 +559,9 @@ func FuzzERABListRoundTrip(f *testing.F) { ERABToBeModifiedListBearerModReq{{ERABID: 1, QoS: goldQoS(), NASPDU: NASPDU{0x07}, TransportInformation: &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 1}}}, ERABToBeModifiedListBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA(), extensions: add}}, ERABNotToBeModifiedListBearerModInd{{ERABID: 1, TransportLayerAddress: goldTLA()}}, - ERABToBeSetupListHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), QoS: goldQoS(), Extensions: &ERABToBeSetupItemHOReqExtIEs{DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue)}}}, - ERABAdmittedList{{ERABID: 1, TransportLayerAddress: goldTLA(), DLTransportLayerAddr: goldTLA(), DLGTPTEID: Ptr(GTPTEID(2))}}, - ERABSubjecttoDataForwardingList{{ERABID: 1, ULTransportLayerAddr: goldTLA(), ULGTPTEID: Ptr(GTPTEID(2)), iEExtensions: tnlUnknownExtension()}}, + ERABToBeSetupListHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), QoS: goldQoS(), DataForwardingNotPossible: Ptr(DataForwardingNotPossibleTrue)}}, + ERABAdmittedList{{ERABID: 1, TransportLayerAddress: goldTLA(), DLTransportLayerAddr: Ptr(goldTLA()), DLGTPTEID: Ptr(GTPTEID(2))}}, + ERABSubjecttoDataForwardingList{{ERABID: 1, ULTransportLayerAddr: Ptr(goldTLA()), ULGTPTEID: Ptr(GTPTEID(2)), iEExtensions: tnlUnknownExtension()}}, ERABToBeSwitchedDLList{{ERABID: 1, TransportLayerAddress: goldTLA()}}, ERABToBeSwitchedULList{{ERABID: 1, TransportLayerAddress: goldTLA(), containerCrit: rejectCrit()}}, } @@ -613,7 +599,7 @@ func FuzzERABListRoundTrip(f *testing.F) { t.Fatalf("decode re-encoded value: %v", err) } - if !reflect.DeepEqual(again, v) { + if !equalByMethod(again, v) { t.Fatalf("re-decoded\n got %+v\nwant %+v", again, v) } @@ -652,25 +638,25 @@ func TestTNLKnownExtensionCriticality(t *testing.T) { got []row want []row }{ - {"E-RABToBeSetupItemCtxtSUReqExtIEs", rows(tableIDs(eRABToBeSetupItemCtxtSUReqExtIEs), tableCrits(eRABToBeSetupItemCtxtSUReqExtIEs)), []row{ + {"E-RABToBeSetupItemCtxtSUReqExtIEs", rows(tableIDs(extIEsERABToBeSetupItemCtxtSUReq), tableCrits(extIEsERABToBeSetupItemCtxtSUReq)), []row{ {IDCorrelationID, ig}, {IDSIPTOCorrelationID, ig}, {IDBearerType, rj}, {IDEthernetType, ig}, {IDSecurityIndication, rj}, }}, - {"E-RABToBeSetupItemBearerSUReqExtIEs", rows(tableIDs(eRABToBeSetupItemBearerSUReqExtIEs), tableCrits(eRABToBeSetupItemBearerSUReqExtIEs)), []row{ + {"E-RABToBeSetupItemBearerSUReqExtIEs", rows(tableIDs(extIEsERABToBeSetupItemBearerSUReq), tableCrits(extIEsERABToBeSetupItemBearerSUReq)), []row{ {IDCorrelationID, ig}, {IDSIPTOCorrelationID, ig}, {IDBearerType, rj}, {IDEthernetType, ig}, {IDSecurityIndication, rj}, }}, - {"E-RABToBeSetupItemHOReq-ExtIEs", rows(tableIDs(eRABToBeSetupItemHOReqExtIEs), tableCrits(eRABToBeSetupItemHOReqExtIEs)), []row{ + {"E-RABToBeSetupItemHOReq-ExtIEs", rows(tableIDs(extIEsERABToBeSetupItemHOReq), tableCrits(extIEsERABToBeSetupItemHOReq)), []row{ {IDDataForwardingNotPossible, ig}, {IDBearerType, rj}, {IDEthernetType, ig}, {IDSecurityIndication, rj}, }}, - {"E-RABToBeSwitchedDLItem-ExtIEs", rows(tableIDs(eRABToBeSwitchedDLItemExtIEs), tableCrits(eRABToBeSwitchedDLItemExtIEs)), []row{{IDSecurityIndication, ig}}}, - {"E-RABQoSParameters-ExtIEs", rows(tableIDs(eRABLevelQoSParametersExtIEs), tableCrits(eRABLevelQoSParametersExtIEs)), []row{ + {"E-RABToBeSwitchedDLItem-ExtIEs", rows(tableIDs(extIEsERABToBeSwitchedDLItem), tableCrits(extIEsERABToBeSwitchedDLItem)), []row{{IDSecurityIndication, ig}}}, + {"E-RABQoSParameters-ExtIEs", rows(tableIDs(extIEsERABLevelQoSParameters), tableCrits(extIEsERABLevelQoSParameters)), []row{ {IDDownlinkPacketLossRate, ig}, {IDUplinkPacketLossRate, ig}, }}, - {"GBR-QosInformation-ExtIEs", rows(tableIDs(gBRQosInformationExtIEs), tableCrits(gBRQosInformationExtIEs)), []row{ + {"GBR-QosInformation-ExtIEs", rows(tableIDs(extIEsGBRQosInformation), tableCrits(extIEsGBRQosInformation)), []row{ {IDExtendedERABMaximumBitrateDL, ig}, {IDExtendedERABMaximumBitrateUL, ig}, {IDExtendedERABGuaranteedBitrateDL, ig}, {IDExtendedERABGuaranteedBitrateUL, ig}, }}, } { t.Run(tc.name, func(t *testing.T) { - if !reflect.DeepEqual(tc.got, tc.want) { + if !slices.Equal(tc.got, tc.want) { t.Fatalf("rows %v, want %v", tc.got, tc.want) } }) @@ -680,50 +666,34 @@ func TestTNLKnownExtensionCriticality(t *testing.T) { func tableCrits[M any](table []ieSpec[M]) []Criticality { out := make([]Criticality, len(table)) for i := range table { - out[i] = table[i].crit + out[i] = table[i].Criticality } return out } func TestTNLItemKeepsManyUnknownExtensions(t *testing.T) { - fields := make([]ieField, 0, 3*maxPreservedIEs) - for i := range 3 * maxPreservedIEs { - fields = append(fields, ieField{id: idUnknownExtension + ProtocolIEID(i), crit: CriticalityIgnore, raw: []byte{byte(i) | 1}}) + fields := make([]ieField, 0, 3*paddingIEs) + for i := range 3 * paddingIEs { + fields = append(fields, ieField{ID: idUnknownExtension + ProtocolIEID(i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{byte(i) | 1})}) } in := &ERABToBeSetupItemCtxtSUReq{ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, BearerType: Ptr(BearerTypeNonIP)} w := per.NewWriter() - if err := encodeExtensionContainer(w, per.Aligned, fields); err != nil { + if err := encodeExtensionContainer(w, fields); err != nil { t.Fatal(err) } w.AlignToByte() - if err := decodeExtensionContainer(per.NewReader(w.Bytes()), per.Aligned, eRABToBeSetupItemCtxtSUReqExtIEs, in, &in.iEExtensions); err != nil { + if err := decodeExtensionContainer(per.NewReader(w.Bytes()), extIEsERABToBeSetupItemCtxtSUReq, in, &in.iEExtensions); err != nil { t.Fatal(err) } - if got := len(in.iEExtensions.UnknownIEs()); got != 3*maxPreservedIEs { - t.Fatalf("kept %d unknown extensions, want %d", got, 3*maxPreservedIEs) + if got := len(in.iEExtensions.UnknownIEs()); got != 3*paddingIEs { + t.Fatalf("kept %d unknown extensions, want %d", got, 3*paddingIEs) } losslessRoundTrip(t, in, "") } - -func TestMessageTruncatedOnDecodeRefusesToEncode(t *testing.T) { - fields := uplinkNASFields() - for i := range maxPreservedIEs + 1 { - fields = append(fields, ieField{id: ProtocolIEID(40000 + i), crit: CriticalityIgnore, raw: []byte{0x00}}) - } - - msg, err := ParseUplinkNASTransport(container(t, fields...)) - if err != nil { - t.Fatal(err) - } - - if _, err := msg.Marshal(); err == nil { - t.Fatal("a message whose unknown IEs were dropped on decode re-encoded") - } -} diff --git a/s1ap/trace.go b/s1ap/trace.go index cc0bdefc67..dd51084310 100644 --- a/s1ap/trace.go +++ b/s1ap/trace.go @@ -4,8 +4,6 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) @@ -37,88 +35,36 @@ const ( TraceDepthMaximumWithoutVendorSpecificExtension ) -const traceDepthRootValues = 6 +type InterfacesToTrace uint8 const ( - InterfaceToTraceS1MME uint8 = 1 << (7 - iota) + InterfaceToTraceS1MME InterfacesToTrace = 1 << (7 - iota) InterfaceToTraceX2 InterfaceToTraceUu InterfaceToTraceF1C InterfaceToTraceE1 ) -type TraceActivation struct { - EUTRANTraceID EUTRANTraceID - InterfacesToTrace uint8 - TraceDepth TraceDepth - TraceCollectionEntityIPAddress TransportLayerAddress +func (i InterfacesToTrace) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(i), 8) } -func (t TraceActivation) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - w.WriteBit(false) - - if err := t.EUTRANTraceID.MarshalPER(w, enc); err != nil { - return err - } - - if err := per.EncodeBitString(w, enc, 8, 8, true, true, false, []byte{t.InterfacesToTrace}, 8); err != nil { - return err - } - - if err := encodeRootEnumerated(w, enc, traceDepthRootValues, int64(t.TraceDepth), "TraceDepth"); err != nil { - return err - } +func (i *InterfacesToTrace) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := decodeBitStringUint(r, enc, 8) + *i = InterfacesToTrace(v) - if len(t.TraceCollectionEntityIPAddress) == 0 { - return fmt.Errorf("s1ap: TraceActivation without a Trace Collection Entity IP Address") - } - - return t.TraceCollectionEntityIPAddress.MarshalPER(w, enc) + return err } -func (t *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - var v TraceActivation - - if err := v.EUTRANTraceID.UnmarshalPER(r, enc); err != nil { - return err - } - - b, _, err := per.DecodeBitString(r, enc, 8, 8, true, true, false) - if err != nil { - return err - } - - v.InterfacesToTrace = b[0] - - depth, err := decodeRootEnumerated(r, enc, traceDepthRootValues, "TraceDepth") - if err != nil { - return err - } - - v.TraceDepth = TraceDepth(depth) - - if err := v.TraceCollectionEntityIPAddress.UnmarshalPER(r, enc); err != nil { - return err - } - - if err := skipSequenceExtensionsPER(r, enc, extContainer, extBit); err != nil { - return err - } - - *t = v - - return nil +type TraceActivation struct { + EUTRANTraceID EUTRANTraceID + InterfacesToTrace InterfacesToTrace + TraceDepth TraceDepth + TraceCollectionEntityIPAddress TransportLayerAddress + MDTConfigurationNR *MDTConfigurationNR `per:",extie:IDMDTConfigurationNR,crit:ignore"` + TraceCollectionEntityURI *URIAddress `per:",extie:IDTraceCollectionEntityURI,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type TraceStart struct { @@ -131,25 +77,25 @@ type TraceStart struct { var traceStartIEs = []ieSpec[TraceStart]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceStart, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceStart, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceStart, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceStart, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *TraceStart) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDTraceActivation, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *TraceStart, raw []byte, enc per.Encoding) error { + ID: IDTraceActivation, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *TraceStart, r *per.Reader, enc per.Encoding) error { var v TraceActivation - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -157,7 +103,7 @@ var traceStartIEs = []ieSpec[TraceStart]{ return nil }, - encode: func(m *TraceStart) (per.Marshaler, bool) { + Encode: func(m *TraceStart) (per.Marshaler, bool) { if m.TraceActivation == nil { return nil, false } @@ -191,6 +137,10 @@ func ParseTraceStart(value []byte) (*TraceStart, error) { return parseMessageBody[TraceStart](ProcTraceStart, TriggeringInitiatingMessage, traceStartIEs, value) } +func DecodeTraceStart(value []byte) (*TraceStart, error) { + return decodeMessageBody[TraceStart](ProcTraceStart, traceStartIEs, value) +} + type TraceFailureIndication struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID @@ -202,25 +152,25 @@ type TraceFailureIndication struct { var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDEUTRANTraceID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { + ID: IDEUTRANTraceID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { var v EUTRANTraceID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -228,7 +178,7 @@ var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ return nil }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { if m.EUTRANTraceID == nil { return nil, false } @@ -237,11 +187,11 @@ var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *TraceFailureIndication, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *TraceFailureIndication, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -249,7 +199,7 @@ var traceFailureIndicationIEs = []ieSpec[TraceFailureIndication]{ return nil }, - encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { + Encode: func(m *TraceFailureIndication) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -282,3 +232,7 @@ func (m *TraceFailureIndication) Marshal() ([]byte, error) { func ParseTraceFailureIndication(value []byte) (*TraceFailureIndication, error) { return parseMessageBody[TraceFailureIndication](ProcTraceFailureIndication, TriggeringInitiatingMessage, traceFailureIndicationIEs, value) } + +func DecodeTraceFailureIndication(value []byte) (*TraceFailureIndication, error) { + return decodeMessageBody[TraceFailureIndication](ProcTraceFailureIndication, traceFailureIndicationIEs, value) +} diff --git a/s1ap/trace_test.go b/s1ap/trace_test.go index 933cca34c7..e6e768ef19 100644 --- a/s1ap/trace_test.go +++ b/s1ap/trace_test.go @@ -17,7 +17,7 @@ func goldenTraceActivation() TraceActivation { EUTRANTraceID: goldenTraceID, InterfacesToTrace: InterfaceToTraceS1MME | InterfaceToTraceX2 | InterfaceToTraceUu | InterfaceToTraceF1C | InterfaceToTraceE1, TraceDepth: TraceDepthMinimum, - TraceCollectionEntityIPAddress: TransportLayerAddress{10, 0, 0, 1}, + TraceCollectionEntityIPAddress: tlaOf(10, 0, 0, 1), } } @@ -56,7 +56,7 @@ func TestTraceStartGolden(t *testing.T) { got := *out.TraceActivation if got.EUTRANTraceID != ta.EUTRANTraceID || got.InterfacesToTrace != ta.InterfacesToTrace || - got.TraceDepth != ta.TraceDepth || hex.EncodeToString(got.TraceCollectionEntityIPAddress) != "0a000001" { + got.TraceDepth != ta.TraceDepth || got.TraceCollectionEntityIPAddress != ta.TraceCollectionEntityIPAddress { t.Fatalf("round trip TraceActivation %+v, want %+v", got, ta) } } @@ -70,7 +70,7 @@ func TestTraceStartRequiresTraceActivation(t *testing.T) { } func TestTraceFailureIndicationRoundTrip(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverCancelled} + cause := CauseRadioNetworkHandoverCancelled.Cause() id := goldenTraceID in := TraceFailureIndication{MMEUES1APID: 1, ENBUES1APID: 2, EUTRANTraceID: &id, Cause: &cause} @@ -96,7 +96,7 @@ func TestTraceFailureIndicationRoundTrip(t *testing.T) { } if out.MMEUES1APID != 1 || out.ENBUES1APID != 2 || out.EUTRANTraceID == nil || *out.EUTRANTraceID != goldenTraceID || - out.Cause == nil || *out.Cause != cause { + out.Cause == nil || !out.Cause.Equal(cause) { t.Fatalf("decoded %+v", out) } } @@ -125,12 +125,12 @@ func TestPeekMMEUES1APIDRejectsNilAndReadsSourceID(t *testing.T) { SourceMMEUES1APID: 77, ERABToBeSwitchedDL: []ERABToBeSwitchedDLItem{{ ERABID: 5, - TransportLayerAddress: TransportLayerAddress{10, 1, 2, 3}, + TransportLayerAddress: tlaOf(10, 1, 2, 3), GTPTEID: 1, }}, EUTRANCGI: &EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}}, TAI: &TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, - UESecurityCapabilities: &UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: &UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}, }).Marshal() if err != nil { t.Fatal(err) @@ -156,16 +156,16 @@ func TestHandoverRequestTraceActivationRoundTrip(t *testing.T) { in := &HandoverRequest{ MMEUES1APID: 7, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkHandoverCancelled}), + Cause: Ptr(CauseRadioNetworkHandoverCancelled.Cause()), UEAMBR: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ ERABID: 5, - TransportLayerAddress: TransportLayerAddress{10, 1, 2, 3}, + TransportLayerAddress: tlaOf(10, 1, 2, 3), GTPTEID: 0x01020304, QoS: ERABLevelQoSParameters{QCI: 9, ARP: AllocationAndRetentionPriority{PriorityLevel: 15}}, }}, SourceToTarget: TransparentContainer{0xaa, 0xbb}, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0xc000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}, TraceActivation: &ta, } diff --git a/s1ap/transparent_container.go b/s1ap/transparent_container.go index 547887663f..d9ed78e89d 100644 --- a/s1ap/transparent_container.go +++ b/s1ap/transparent_container.go @@ -4,33 +4,31 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) const maxnoofCellsinUEHistoryInfo = 16 -const ( - lastVisitedCellItemEUTRAN = iota - lastVisitedCellItemUTRAN - lastVisitedCellItemGERAN - - lastVisitedCellItemRootCount = 3 -) - -const lastVisitedCellItemNGRANAddition = 0 - -const lastVisitedGERANCellInformationRootCount = 1 - type SourceeNBToTargeteNBTransparentContainer struct { - RRCContainer RRCContainer - ERABInformationList ERABInformationList `per:",optional"` - TargetCellID EUTRANCGI - SubscriberProfileIDforRFP *SubscriberProfileIDforRFP `per:",optional"` - UEHistoryInformation UEHistoryInformation - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + RRCContainer RRCContainer + ERABInformationList ERABInformationList `per:",optional"` + TargetCellID EUTRANCGI + SubscriberProfileIDforRFP *SubscriberProfileIDforRFP `per:",optional"` + UEHistoryInformation UEHistoryInformation + MobilityInformation *MobilityInformation `per:",extie:IDMobilityInformation,crit:ignore"` + UEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE `per:",extie:IDUEHistoryInformationFromTheUE,crit:ignore"` + IMSvoiceEPSfallbackfrom5G *IMSvoiceEPSfallbackfrom5G `per:",extie:IDIMSvoiceEPSfallbackfrom5G,crit:ignore"` + AdditionalRRMPriorityIndex *AdditionalRRMPriorityIndex `per:",extie:IDAdditionalRRMPriorityIndex,crit:ignore"` + ContextatSource *ContextatSource `per:",extie:IDContextatSource,crit:ignore"` + IntersystemMeasurementConfiguration *IntersystemMeasurementConfiguration `per:",extie:IDIntersystemMeasurementConfiguration,crit:ignore"` + SourceNodeID *SourceNodeID `per:",extie:IDSourceNodeID,crit:ignore"` + EmergencyIndicator *EmergencyIndicator `per:",extie:IDEmergencyIndicator,crit:ignore"` + UEContextReferenceatSourceeNB *ENBUES1APID `per:",extie:IDUEContextReferenceatSourceeNB,crit:ignore"` + SourceSNID *GlobalRANNodeID `per:",extie:IDSourceSNID,crit:ignore"` + DirectForwardingPathAvailability *DirectForwardingPathAvailability `per:",extie:IDDirectForwardingPathAvailability,crit:ignore"` + TimeBasedHandoverInformation *TimeBasedHandoverInformation `per:",extie:IDTimeBasedHandoverInformation,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } func (c *SourceeNBToTargeteNBTransparentContainer) Marshal() (TransparentContainer, error) { @@ -45,16 +43,16 @@ func (c *SourceeNBToTargeteNBTransparentContainer) Marshal() (TransparentContain return TransparentContainer(w.Bytes()), nil } -func ParseSourceeNBToTargeteNBTransparentContainer(b []byte) (*SourceeNBToTargeteNBTransparentContainer, error) { - var c SourceeNBToTargeteNBTransparentContainer - - if err := c.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, fmt.Errorf("s1ap: SourceeNB-ToTargeteNB-TransparentContainer: %w", err) - } +func DecodeSourceeNBToTargeteNBTransparentContainer(b []byte) (*SourceeNBToTargeteNBTransparentContainer, error) { + return decodeValue[SourceeNBToTargeteNBTransparentContainer]("SourceeNB-ToTargeteNB-TransparentContainer", b) +} - return &c, nil +func ParseSourceeNBToTargeteNBTransparentContainer(b []byte) (*SourceeNBToTargeteNBTransparentContainer, error) { + return parseValue[SourceeNBToTargeteNBTransparentContainer]("SourceeNB-ToTargeteNB-TransparentContainer", b) } +func (c *SourceeNBToTargeteNBTransparentContainer) Diagnostics() Diagnostics { return diagnosticsOf(c) } + type RRCContainer []byte func (c RRCContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -76,30 +74,17 @@ type DLForwarding uint8 const ( DLForwardingProposed DLForwarding = iota - - dlForwardingRootCount = 1 ) -func (d DLForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, dlForwardingRootCount, int64(d), "DL-Forwarding") -} - -func (d *DLForwarding) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, dlForwardingRootCount, "DL-Forwarding") - if err != nil { - return err - } - - *d = DLForwarding(idx) - - return nil -} - type ERABInformationListItem struct { - ERABID ERABID - DLForwarding *DLForwarding `per:",optional"` - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + DLForwarding *DLForwarding `per:",optional"` + DAPSRequestInfo *DAPSRequestInfo `per:",extie:IDDAPSRequestInfo,crit:ignore"` + SourceTransportLayerAddress *TransportLayerAddress `per:",extie:IDSourceTransportLayerAddress,crit:ignore"` + SecurityIndication *SecurityIndication `per:",extie:IDSecurityIndication,crit:ignore"` + SourceNodeTransportLayerAddress *TransportLayerAddress `per:",extie:IDSourceNodeTransportLayerAddress,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type ERABInformationList []ERABInformationListItem @@ -154,125 +139,28 @@ func (u *UEHistoryInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) err } type LastVisitedCellItem struct { - EUTRANCell *LastVisitedEUTRANCellInformation - UTRANCell *LastVisitedUTRANCellInformation - GERANCell *LastVisitedGERANCellInformation - NGRANCell *LastVisitedNGRANCellInformation - extension *choiceExtensionAlternative -} - -func (l *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - idx, err := choiceAlternative("LastVisitedCell-Item", l.EUTRANCell != nil, l.UTRANCell != nil, l.GERANCell != nil, l.NGRANCell != nil, l.extension != nil) - if err != nil { - return err - } - - switch idx { - case lastVisitedCellItemEUTRAN: - if err := encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, idx); err != nil { - return err - } - - return l.EUTRANCell.MarshalPER(w, enc) - case lastVisitedCellItemUTRAN: - if err := encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, idx); err != nil { - return err - } - - return l.UTRANCell.MarshalPER(w, enc) - case lastVisitedCellItemGERAN: - if err := encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, idx); err != nil { - return err - } - - return l.GERANCell.MarshalPER(w, enc) - case lastVisitedCellItemRootCount: - return encodeChoiceAddition(w, enc, lastVisitedCellItemNGRANAddition, l.NGRANCell) - default: - return l.extension.MarshalPER(w, enc) - } -} - -func (l *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return err - } - - *l = LastVisitedCellItem{} - - if isExt { - alt, err := decodeChoiceAddition(r, enc) - if err != nil { - return err - } - - if alt.index != lastVisitedCellItemNGRANAddition { - l.extension = alt - - return nil - } - - var v LastVisitedNGRANCellInformation - - inner := per.NewReader(alt.value) - if err := v.UnmarshalPER(inner, enc); err != nil { - return err - } - - if inner.Bits() >= 8 { - return fmt.Errorf("s1ap: LastVisitedCell-Item nG-RAN-Cell open type carries %d trailing bits", inner.Bits()) - } - - l.NGRANCell = &v - - return nil - } - - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, lastVisitedCellItemRootCount-1) - if err != nil { - return err - } - - switch idx { - case lastVisitedCellItemEUTRAN: - var v LastVisitedEUTRANCellInformation - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - l.EUTRANCell = &v - case lastVisitedCellItemUTRAN: - var v LastVisitedUTRANCellInformation - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - l.UTRANCell = &v - default: - var v LastVisitedGERANCellInformation - if err := v.UnmarshalPER(r, enc); err != nil { - return err - } - - l.GERANCell = &v - } - - return nil + EUTRANCell *LastVisitedEUTRANCellInformation `per:",choice:0"` + UTRANCell *LastVisitedUTRANCellInformation `per:",choice:1"` + GERANCell *LastVisitedGERANCellInformation `per:",choice:2"` + NGRANCell *LastVisitedNGRANCellInformation `per:",choice:0,ext"` + Ext *per.ExtensionAlternative `per:",extalt"` } type LastVisitedEUTRANCellInformation struct { - GlobalCellID EUTRANCGI - CellType CellType - TimeUEStayedInCell TimeUEStayedInCell - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + GlobalCellID EUTRANCGI + CellType CellType + TimeUEStayedInCell TimeUEStayedInCell + TimeUEStayedInCellEnhancedGranularity *TimeUEStayedInCellEnhancedGranularity `per:",extie:IDTimeUEStayedInCellEnhancedGranularity,crit:ignore"` + HOCause *Cause `per:",extie:IDHOCause,crit:ignore"` + LastVisitedPSCellList LastVisitedPSCellList `per:",extie:IDLastVisitedPSCellList,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type CellType struct { CellSize CellSize - iEExtensions *transparentIEExtensions `per:",optional"` - extensions per.ExtensionAdditions `per:",extraw"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } type CellSize uint8 @@ -282,25 +170,8 @@ const ( CellSizeSmall CellSizeMedium CellSizeLarge - - cellSizeRootCount = 4 ) -func (c CellSize) MarshalPER(w *per.Writer, enc per.Encoding) error { - return encodeRootEnumerated(w, enc, cellSizeRootCount, int64(c), "Cell-Size") -} - -func (c *CellSize) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - idx, err := decodeRootEnumerated(r, enc, cellSizeRootCount, "Cell-Size") - if err != nil { - return err - } - - *c = CellSize(idx) - - return nil -} - type TimeUEStayedInCell uint16 func (t TimeUEStayedInCell) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -353,121 +224,6 @@ func (c *LastVisitedNGRANCellInformation) UnmarshalPER(r *per.Reader, enc per.En } type LastVisitedGERANCellInformation struct { - extension *choiceExtensionAlternative -} - -func (g *LastVisitedGERANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - if g.extension != nil { - return g.extension.MarshalPER(w, enc) - } - - return encodeExtensibleChoice(w, enc, lastVisitedGERANCellInformationRootCount, 0) -} - -func (g *LastVisitedGERANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return err - } - - *g = LastVisitedGERANCellInformation{} - - if !isExt { - _, err := per.DecodeConstrainedWholeNumber(r, enc, 0, lastVisitedGERANCellInformationRootCount-1) - - return err - } - - g.extension, err = decodeChoiceAddition(r, enc) - - return err -} - -type choiceExtensionAlternative struct { - index int64 - value []byte -} - -func (a *choiceExtensionAlternative) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(true) - - if err := per.EncodeNormallySmall(w, enc, a.index); err != nil { - return err - } - - return per.EncodeOpenTypeBytes(w, enc, a.value) -} - -func encodeChoiceAddition(w *per.Writer, enc per.Encoding, index int64, m per.Marshaler) error { - w.WriteBit(true) - - if err := per.EncodeNormallySmall(w, enc, index); err != nil { - return err - } - - return per.EncodeOpenType(w, enc, m) -} - -func decodeChoiceAddition(r *per.Reader, enc per.Encoding) (*choiceExtensionAlternative, error) { - index, err := per.DecodeNormallySmall(r, enc) - if err != nil { - return nil, err - } - - value, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return nil, err - } - - if len(value) == 0 { - return nil, fmt.Errorf("s1ap: empty open type for CHOICE extension alternative %d", index) - } - - return &choiceExtensionAlternative{index: index, value: value}, nil -} - -type transparentIEExtensions struct { - data []byte - nbits int -} - -func (e *transparentIEExtensions) MarshalPER(w *per.Writer, enc per.Encoding) error { - if enc == per.Aligned { - w.AlignToByte() - } - - w.WriteBitString(e.data, e.nbits) - - return nil -} - -func (e *transparentIEExtensions) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - if enc == per.Aligned { - r.AlignToByte() - } - - start := r.Offset() - - n, err := per.DecodeConstrainedWholeNumber(r, enc, 1, maxProtocolExtensions) - if err != nil { - return err - } - - for range n { - if _, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs); err != nil { - return err - } - - if _, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false); err != nil { - return err - } - - if err := per.SkipOpenType(r, enc); err != nil { - return err - } - } - - e.data, e.nbits, err = r.Since(start) - - return err + Undefined *per.Null `per:",choice:0"` + Ext *per.ExtensionAlternative `per:",extalt"` } diff --git a/s1ap/transparent_container_test.go b/s1ap/transparent_container_test.go index f451859222..5e243cd3af 100644 --- a/s1ap/transparent_container_test.go +++ b/s1ap/transparent_container_test.go @@ -8,11 +8,11 @@ import ( "encoding/hex" "errors" "os/exec" - "reflect" "strings" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const goldenSourceeNBContainer = "60018001004e40024500004e4001060002f839abcdef10ff100002f83900001011800fff800d0c0002f839000000010080001e" @@ -64,7 +64,7 @@ func TestSourceeNBToTargeteNBTransparentContainerGolden(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(out, in) { + if !out.Equal(*in) { t.Fatalf("decoded\n got %+v\nwant %+v", out, in) } @@ -105,7 +105,7 @@ func TestSourceeNBToTargeteNBTransparentContainerAlternatives(t *testing.T) { TargetCellID: EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 1}, UEHistoryInformation: UEHistoryInformation{ {UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01, 0x02})}, - {GERANCell: &LastVisitedGERANCellInformation{}}, + {GERANCell: &LastVisitedGERANCellInformation{Undefined: &per.Null{}}}, }, } @@ -119,7 +119,7 @@ func TestSourceeNBToTargeteNBTransparentContainerAlternatives(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(out, in) { + if !out.Equal(*in) { t.Fatalf("decoded\n got %+v\nwant %+v", out, in) } } @@ -197,9 +197,9 @@ func handSourceeNBContainer(t *testing.T, extCrit Criticality) []byte { handAdditions(t, item) item.AlignToByte() - return encodeContainerField(w, enc, ieField{id: IDERABInformationListItem, crit: CriticalityIgnore, raw: item.Bytes()}) + return encodeContainerField(w, enc, ieField{ID: IDERABInformationListItem, Criticality: CriticalityIgnore, Value: ap.RawValue(item.Bytes())}) })) - mustNil(t, EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}.MarshalPER(w, enc)) + mustNil(t, (&EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}).MarshalPER(w, enc)) mustNil(t, per.EncodeLength(w, enc, 1, maxnoofCellsinUEHistoryInfo, true, 3, func(int64) error { handChoiceAddition(t, w, 7) @@ -208,7 +208,8 @@ func handSourceeNBContainer(t *testing.T, extCrit Criticality) []byte { mustNil(t, per.EncodeNormallySmall(w, enc, 0)) mustNil(t, per.EncodeOpenTypeBytes(w, enc, []byte{0x02, 0xaa, 0xbb})) - mustNil(t, encodeExtensibleChoice(w, enc, lastVisitedCellItemRootCount, lastVisitedCellItemGERAN)) + w.WriteBit(false) + mustNil(t, per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2)) handChoiceAddition(t, w, 4) return nil @@ -226,19 +227,23 @@ func TestSourceeNBToTargeteNBTransparentContainerLossless(t *testing.T) { t.Run(crit.String(), func(t *testing.T) { b := handSourceeNBContainer(t, crit) - c, err := ParseSourceeNBToTargeteNBTransparentContainer(b) + c, err := DecodeSourceeNBToTargeteNBTransparentContainer(b) if err != nil { t.Fatal(err) } + if d := c.Diagnostics(); len(d.IEs) == 0 { + t.Fatal("unknown extensions in the container are not reported") + } + if c.TargetCellID != (EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}) { t.Fatalf("targetCell-ID = %+v", c.TargetCellID) } h := c.UEHistoryInformation - if len(h) != 3 || h[0].extension == nil || h[0].extension.index != 7 || + if len(h) != 3 || h[0].Ext == nil || h[0].Ext.Index != 7 || h[1].NGRANCell == nil || !bytes.Equal(*h[1].NGRANCell, []byte{0xaa, 0xbb}) || - h[2].GERANCell == nil || h[2].GERANCell.extension == nil { + h[2].GERANCell == nil || h[2].GERANCell.Ext == nil { t.Fatalf("UE history = %+v", h) } @@ -280,15 +285,39 @@ func TestSourceeNBToTargeteNBTransparentContainerExtensionValue(t *testing.T) { item.WriteBit(true) item.WriteBit(false) mustNil(t, ERABID(5).MarshalPER(item, per.Aligned)) - mustNil(t, per.EncodeEnumerated(item, per.Aligned, dlForwardingRootCount, true, 1)) + mustNil(t, per.EncodeEnumerated(item, per.Aligned, int64(len(enumDLForwarding.Root)), true, 1)) item.AlignToByte() - return encodeContainerField(w, per.Aligned, ieField{id: IDERABInformationListItem, crit: CriticalityIgnore, raw: item.Bytes()}) + return encodeContainerField(w, per.Aligned, ieField{ID: IDERABInformationListItem, Criticality: CriticalityIgnore, Value: ap.RawValue(item.Bytes())}) })) w.AlignToByte() - if _, err := ParseSourceeNBToTargeteNBTransparentContainer(w.Bytes()); !errors.Is(err, errNotComprehended) { - t.Fatalf("err = %v, want not comprehended", err) + mustNil(t, (&EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 1}).MarshalPER(w, per.Aligned)) + mustNil(t, per.EncodeLength(w, per.Aligned, 1, maxnoofCellsinUEHistoryInfo, true, 1, func(int64) error { + w.WriteBit(false) + mustNil(t, per.EncodeConstrainedWholeNumber(w, per.Aligned, 0, 2, 2)) + handChoiceAddition(t, w, 4) + + return nil + })) + w.AlignToByte() + + c, err := DecodeSourceeNBToTargeteNBTransparentContainer(w.Bytes()) + if err != nil { + t.Fatalf("decode is lenient, got %v", err) + } + + if got := *c.ERABInformationList[0].DLForwarding; got != DLForwarding(len(enumDLForwarding.Root)) { + t.Fatalf("DL-Forwarding = %d, want the extension index kept", got) + } + + if !c.Diagnostics().RootNotComprehended { + t.Fatalf("diagnostics = %+v, want the extension value reported", c.Diagnostics()) + } + + var ase *ap.AbstractSyntaxError[ProtocolIEID] + if _, err := ParseSourceeNBToTargeteNBTransparentContainer(w.Bytes()); !errors.As(err, &ase) { + t.Fatalf("err = %v, want an abstract syntax error", err) } } @@ -301,11 +330,11 @@ func goldContainerHandoverRequest() *HandoverRequest { return &HandoverRequest{ MMEUES1APID: 1, HandoverType: HandoverTypeIntraLTE, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 16}), + Cause: Ptr(CauseRadioNetworkHandoverDesirableForRadio.Cause()), UEAMBR: UEAggregateMaximumBitRate{DL: 1_000_000, UL: 500_000}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}, SourceToTarget: c, - UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: 0x8000, IntegrityProtectionAlgorithms: 0xc000}, + UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}, IntegrityProtectionAlgorithms: SecurityAlgorithms{Value: 0xc000}}, SecurityContext: SecurityContext{NextHopChainingCount: 3}, } } @@ -338,8 +367,8 @@ func transparentContainerGoldenCases() []newMessageCase { func TestPathSwitchRequestSourceMMEGUMMEIWireCriticality(t *testing.T) { ies := wireIEs(t, goldPathSwitchRequestSourceMMEGUMMEI().encodeBody) - if last := ies[len(ies)-1]; last.id != IDSourceMMEGUMMEI || last.crit != CriticalityIgnore { - t.Fatalf("last IE = %d/%s, want SourceMME-GUMMEI ignore", last.id, last.crit) + if last := ies[len(ies)-1]; last.ID != IDSourceMMEGUMMEI || last.Criticality != CriticalityIgnore { + t.Fatalf("last IE = %d/%s, want SourceMME-GUMMEI ignore", last.ID, last.Criticality) } } @@ -395,7 +424,7 @@ func FuzzTransparentContainerRoundTrip(f *testing.F) { t.Fatalf("decode re-encoded value: %v", err) } - if !reflect.DeepEqual(again, c) { + if !again.Equal(*c) { t.Fatalf("re-decoded\n got %+v\nwant %+v", again, c) } diff --git a/s1ap/transport_address_test.go b/s1ap/transport_address_test.go index d7ce1adf39..ac342fc78f 100644 --- a/s1ap/transport_address_test.go +++ b/s1ap/transport_address_test.go @@ -3,43 +3,13 @@ package s1ap -import "testing" +import "github.com/ellanetworks/core/per/ap" -// TS 36.414 §5.1: the bit string carries an IPv4 address, an IPv6 address, or -// both with the IPv4 one first. -func TestTransportLayerAddressIPs(t *testing.T) { - v4 := []byte{192, 168, 1, 1} - v6 := []byte{0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1} - - tests := []struct { - name string - addr TransportLayerAddress - want4 string - want6 string - }{ - {"ipv4", TransportLayerAddress(v4), "192.168.1.1", ""}, - {"ipv6", TransportLayerAddress(v6), "", "2001:db8::1"}, - {"both", TransportLayerAddress(append(append([]byte{}, v4...), v6...)), "192.168.1.1", "2001:db8::1"}, - {"truncated", TransportLayerAddress{1, 2, 3}, "", ""}, - {"empty", nil, "", ""}, +func tlaOf(octets ...byte) TransportLayerAddress { + a, ok := ap.TransportLayerAddressFromBits(octets, len(octets)*8) + if !ok { + panic("tlaOf") } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ipv4, ipv6 := tt.addr.IPs() - - got4, got6 := "", "" - if ipv4.IsValid() { - got4 = ipv4.String() - } - - if ipv6.IsValid() { - got6 = ipv6.String() - } - - if got4 != tt.want4 || got6 != tt.want6 { - t.Errorf("IPs() = %q/%q, want %q/%q", got4, got6, tt.want4, tt.want6) - } - }) - } + return a } diff --git a/s1ap/typed_extension_vectors_test.go b/s1ap/typed_extension_vectors_test.go new file mode 100644 index 0000000000..37b6d7fdf3 --- /dev/null +++ b/s1ap/typed_extension_vectors_test.go @@ -0,0 +1,324 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "reflect" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type extCodec interface { + per.Marshaler + per.Unmarshaler + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool +} + +type typedExtCase struct { + name string + id ProtocolIEID + crit Criticality + value []byte + wire func(raw rawIE) extCodec + fresh func() extCodec + typed func(v extCodec) per.Marshaler +} + +func plmnVec() PLMNIdentity { return PLMNIdentity{0x00, 0xf1, 0x10} } + +func ecgiVec() EUTRANCGI { return EUTRANCGI{PLMNIdentity: plmnVec(), CellID: 0x1234567} } + +func taiVec() TAI { return TAI{PLMNIdentity: plmnVec(), TAC: 7} } + +func globalENBIDVec() GlobalENBID { + return GlobalENBID{PLMNIdentity: plmnVec(), ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x12345))}} +} + +func gnbVec() GlobalRANNodeID { + return GlobalRANNodeID{GNB: &GNB{GlobalGNBID: GlobalGNBID{PLMNIdentity: plmnVec(), GNBID: GNBIdentity{GNBID: &GNBID{Value: 0x101, Bits: 22}}}}} +} + +func encodedVec(t *testing.T, m per.Marshaler) []byte { + t.Helper() + + return ieRaw(t, m) +} + +func sourceContainerVec() *SourceeNBToTargeteNBTransparentContainer { + return &SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: RRCContainer{0x01}, + TargetCellID: ecgiVec(), + UEHistoryInformation: UEHistoryInformation{{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x02})}}, + } +} + +func sourceContainerCase(t *testing.T, name string, id ProtocolIEID, typed per.Marshaler, get func(*SourceeNBToTargeteNBTransparentContainer) per.Marshaler) typedExtCase { + t.Helper() + + return typedExtCase{ + name: name, id: id, crit: CriticalityIgnore, value: encodedVec(t, typed), + wire: func(raw rawIE) extCodec { + c := sourceContainerVec() + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &SourceeNBToTargeteNBTransparentContainer{} }, + typed: func(v extCodec) per.Marshaler { return get(v.(*SourceeNBToTargeteNBTransparentContainer)) }, + } +} + +func erabInfoCase(t *testing.T, name string, id ProtocolIEID, typed per.Marshaler, get func(*ERABInformationListItem) per.Marshaler) typedExtCase { + t.Helper() + + return typedExtCase{ + name: name, id: id, crit: CriticalityIgnore, value: encodedVec(t, typed), + wire: func(raw rawIE) extCodec { + c := &ERABInformationListItem{ERABID: 5} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &ERABInformationListItem{} }, + typed: func(v extCodec) per.Marshaler { return get(v.(*ERABInformationListItem)) }, + } +} + +func hrlCase(t *testing.T, name string, id ProtocolIEID, typed per.Marshaler, get func(*HandoverRestrictionList) per.Marshaler) typedExtCase { + t.Helper() + + return typedExtCase{ + name: name, id: id, crit: CriticalityIgnore, value: encodedVec(t, typed), + wire: func(raw rawIE) extCodec { + c := &HandoverRestrictionList{ServingPLMN: plmnVec()} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &HandoverRestrictionList{} }, + typed: func(v extCodec) per.Marshaler { return get(v.(*HandoverRestrictionList)) }, + } +} + +func lastVisitedCase(t *testing.T, name string, id ProtocolIEID, typed per.Marshaler, get func(*LastVisitedEUTRANCellInformation) per.Marshaler) typedExtCase { + t.Helper() + + return typedExtCase{ + name: name, id: id, crit: CriticalityIgnore, value: encodedVec(t, typed), + wire: func(raw rawIE) extCodec { + c := &LastVisitedEUTRANCellInformation{GlobalCellID: ecgiVec(), TimeUEStayedInCell: 30} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &LastVisitedEUTRANCellInformation{} }, + typed: func(v extCodec) per.Marshaler { return get(v.(*LastVisitedEUTRANCellInformation)) }, + } +} + +func typedExtensionCases(t *testing.T) []typedExtCase { + t.Helper() + + sourceTLA := tlaOf(10, 0, 0, 1) + nodeTLA := tlaOf(0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1) + pscell := PSCellInformation{NCGI: NRCGI{PLMNIdentity: plmnVec(), NRCellIdentity: 0x123456789}} + + return []typedExtCase{ + { + name: "ServedGUMMEIsItem/GUMMEIType", id: IDGUMMEIType, crit: CriticalityIgnore, value: []byte{0x80}, + wire: func(raw rawIE) extCodec { + c := &ServedGUMMEIsItem{ServedPLMNs: []PLMNIdentity{plmnVec()}, ServedGroupIDs: []MMEGroupID{{0x80, 0x01}}, ServedMMECs: []MMECode{1}} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &ServedGUMMEIsItem{} }, + typed: func(v extCodec) per.Marshaler { return v.(*ServedGUMMEIsItem).GUMMEIType }, + }, + hrlCase(t, "HandoverRestrictionList/NRrestrictioninEPSasSecondaryRAT", IDNRrestrictioninEPSasSecondaryRAT, Ptr(NRrestrictedinEPSasSecondaryRAT), func(c *HandoverRestrictionList) per.Marshaler { return c.NRrestrictioninEPSasSecondaryRAT }), + hrlCase(t, "HandoverRestrictionList/UnlicensedSpectrumRestriction", IDUnlicensedSpectrumRestriction, Ptr(UnlicensedRestricted), func(c *HandoverRestrictionList) per.Marshaler { return c.UnlicensedSpectrumRestriction }), + hrlCase(t, "HandoverRestrictionList/CNTypeRestrictions", IDCNTypeRestrictions, &CNTypeRestrictions{{PLMNIdentity: plmnVec(), CNType: CNTypeEPCForbidden}}, func(c *HandoverRestrictionList) per.Marshaler { return &c.CNTypeRestrictions }), + hrlCase(t, "HandoverRestrictionList/NRrestrictionin5GS", IDNRrestrictionin5GS, Ptr(NRrestrictedin5GS), func(c *HandoverRestrictionList) per.Marshaler { return c.NRrestrictionin5GS }), + hrlCase(t, "HandoverRestrictionList/LastNG-RANPLMNIdentity", IDLastNGRANPLMNIdentity, Ptr(plmnVec()), func(c *HandoverRestrictionList) per.Marshaler { return c.LastNGRANPLMNIdentity }), + hrlCase(t, "HandoverRestrictionList/RAT-Restrictions", IDRATRestrictions, &RATRestrictions{{PLMNIdentity: plmnVec(), RATRestrictionInformation: RATRestrictionInformation{Value: 0x80}}}, func(c *HandoverRestrictionList) per.Marshaler { return &c.RATRestrictions }), + { + name: "UserLocationInformation/PSCellInformation", id: IDPSCellInformation, crit: CriticalityIgnore, value: encodedVec(t, &pscell), + wire: func(raw rawIE) extCodec { + c := &UserLocationInformation{EUTRANCGI: ecgiVec(), TAI: taiVec()} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &UserLocationInformation{} }, + typed: func(v extCodec) per.Marshaler { return v.(*UserLocationInformation).PSCellInformation }, + }, + { + name: "UserLocationInformation/LTE-NTN-TAI-Information", id: IDLTENTNTAIInformation, crit: CriticalityIgnore, + value: encodedVec(t, <ENTNTAIInformation{ServingPLMN: plmnVec(), TACListInLTENTN: []TAC{7, 8}, UELocationDerivedTAC: Ptr(TAC(8))}), + wire: func(raw rawIE) extCodec { + c := &UserLocationInformation{EUTRANCGI: ecgiVec(), TAI: taiVec()} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &UserLocationInformation{} }, + typed: func(v extCodec) per.Marshaler { return v.(*UserLocationInformation).LTENTNTAIInformation }, + }, + { + name: "RequestType/RequestTypeAdditionalInfo", id: IDRequestTypeAdditionalInfo, crit: CriticalityIgnore, value: []byte{0x00}, + wire: func(raw rawIE) extCodec { + c := &RequestType{} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &RequestType{} }, + typed: func(v extCodec) per.Marshaler { return v.(*RequestType).RequestTypeAdditionalInfo }, + }, + erabInfoCase(t, "E-RABInformationListItem/DAPSRequestInfo", IDDAPSRequestInfo, &DAPSRequestInfo{}, func(c *ERABInformationListItem) per.Marshaler { return c.DAPSRequestInfo }), + erabInfoCase(t, "E-RABInformationListItem/SourceTransportLayerAddress", IDSourceTransportLayerAddress, &sourceTLA, func(c *ERABInformationListItem) per.Marshaler { return c.SourceTransportLayerAddress }), + erabInfoCase(t, "E-RABInformationListItem/SecurityIndication", IDSecurityIndication, &SecurityIndication{IntegrityProtectionIndication: IntegrityProtectionIndication(1)}, func(c *ERABInformationListItem) per.Marshaler { return c.SecurityIndication }), + erabInfoCase(t, "E-RABInformationListItem/SourceNodeTransportLayerAddress", IDSourceNodeTransportLayerAddress, &nodeTLA, func(c *ERABInformationListItem) per.Marshaler { return c.SourceNodeTransportLayerAddress }), + lastVisitedCase(t, "LastVisitedEUTRANCellInformation/Time-UE-StayedInCell-EnhancedGranularity", IDTimeUEStayedInCellEnhancedGranularity, Ptr(TimeUEStayedInCellEnhancedGranularity(40950)), func(c *LastVisitedEUTRANCellInformation) per.Marshaler { + return c.TimeUEStayedInCellEnhancedGranularity + }), + lastVisitedCase(t, "LastVisitedEUTRANCellInformation/HO-Cause", IDHOCause, Ptr(CauseRadioNetworkTimeCriticalHandover.Cause()), func(c *LastVisitedEUTRANCellInformation) per.Marshaler { return c.HOCause }), + lastVisitedCase(t, "LastVisitedEUTRANCellInformation/lastVisitedPSCellList", IDLastVisitedPSCellList, &LastVisitedPSCellList{{PSCellID: &pscell, TimeStay: 12}}, func(c *LastVisitedEUTRANCellInformation) per.Marshaler { return &c.LastVisitedPSCellList }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/MobilityInformation", IDMobilityInformation, Ptr(MobilityInformation(0xdeadbeef)), func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { return c.MobilityInformation }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/uE-HistoryInformationFromTheUE", IDUEHistoryInformationFromTheUE, &UEHistoryInformationFromTheUE{0x01, 0x02}, func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { + return c.UEHistoryInformationFromTheUE + }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/IMSvoiceEPSfallbackfrom5G", IDIMSvoiceEPSfallbackfrom5G, Ptr(IMSvoiceEPSfallbackfrom5GTrue), func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { return c.IMSvoiceEPSfallbackfrom5G }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/AdditionalRRMPriorityIndex", IDAdditionalRRMPriorityIndex, Ptr(AdditionalRRMPriorityIndex(0x80000001)), func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { + return c.AdditionalRRMPriorityIndex + }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/ContextatSource", IDContextatSource, &ContextatSource{SourceNGRANNodeID: gnbVec(), RANUENGAPID: 0xfffffffe}, func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { return c.ContextatSource }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/IntersystemMeasurementConfiguration", IDIntersystemMeasurementConfiguration, &IntersystemMeasurementConfiguration{ + RSRP: Ptr(uint8(127)), + InterSystemMeasurementParameters: InterSystemMeasurementParameters{MeasurementDuration: 100, InterSystemMeasurementList: InterSystemMeasurementList{ + {FreqBandIndicatorNR: 78, SSBFrequencies: 632628, SubcarrierSpacingSSB: SubcarrierSpacingSSBkHz480, SMTC: []byte{0x01}}, + }}, + }, func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { + return c.IntersystemMeasurementConfiguration + }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/SourceNodeID", IDSourceNodeID, &SourceNodeID{SourceNgRanNodeID: &SourceNgRanNodeID{GlobalRANNodeID: gnbVec(), SelectedTAI: FiveGSTAI{PLMNIdentity: plmnVec(), TAC: 0x10203}}}, func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { + return c.SourceNodeID + }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/EmergencyIndicator", IDEmergencyIndicator, Ptr(EmergencyIndicatorTrue), func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { return c.EmergencyIndicator }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/UEContextReferenceatSourceeNB", IDUEContextReferenceatSourceeNB, Ptr(ENBUES1APID(0xabcdef)), func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { + return c.UEContextReferenceatSourceeNB + }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/SourceSNID", IDSourceSNID, Ptr(gnbVec()), func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { return c.SourceSNID }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/Direct-Forwarding-Path-Availability", IDDirectForwardingPathAvailability, Ptr(DirectForwardingPathAvailable), func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { + return c.DirectForwardingPathAvailability + }), + sourceContainerCase(t, "SourceeNB-ToTargeteNB/TimeBasedHandoverInformation", IDTimeBasedHandoverInformation, &TimeBasedHandoverInformation{HOWindowStart: 1048575, HOWindowDuration: 6000}, func(c *SourceeNBToTargeteNBTransparentContainer) per.Marshaler { + return c.TimeBasedHandoverInformation + }), + { + name: "SupportedTAs-Item/RAT-Type", id: IDRATType, crit: CriticalityReject, value: []byte{0x87}, + wire: func(raw rawIE) extCodec { + c := &SupportedTAItem{TAC: 1, BroadcastPLMNs: BPLMNs{plmnVec()}} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &SupportedTAItem{} }, + typed: func(v extCodec) per.Marshaler { return v.(*SupportedTAItem).RATType }, + }, + { + name: "TraceActivation/MDTConfigurationNR", id: IDMDTConfigurationNR, crit: CriticalityIgnore, value: []byte{0x02, 0xab, 0xcd}, + wire: func(raw rawIE) extCodec { + c := &TraceActivation{TraceCollectionEntityIPAddress: tlaOf(10, 0, 0, 2)} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &TraceActivation{} }, + typed: func(v extCodec) per.Marshaler { return v.(*TraceActivation).MDTConfigurationNR }, + }, + { + name: "TraceActivation/TraceCollectionEntityURI", id: IDTraceCollectionEntityURI, crit: CriticalityIgnore, value: append([]byte{0x05}, "a.b/c"...), + wire: func(raw rawIE) extCodec { + c := &TraceActivation{TraceCollectionEntityIPAddress: tlaOf(10, 0, 0, 2)} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &TraceActivation{} }, + typed: func(v extCodec) per.Marshaler { return v.(*TraceActivation).TraceCollectionEntityURI }, + }, + { + name: "SONConfigurationTransfer/RequestedTNLInfo", id: IDRequestedTNLInfo, crit: CriticalityIgnore, value: []byte{0x00, 0x00, 0xf1, 0x10}, + wire: func(raw rawIE) extCodec { + c := &SONConfigurationTransfer{ + TargeteNBID: TargeteNBID{GlobalENBID: globalENBIDVec(), SelectedTAI: taiVec()}, + SourceeNBID: SourceeNBID{GlobalENBID: globalENBIDVec(), SelectedTAI: taiVec()}, + SONInformation: SONInformation{SONInformationRequest: Ptr(SONInformationRequestDeactivateMuting)}, + } + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &SONConfigurationTransfer{} }, + typed: func(v extCodec) per.Marshaler { return v.(*SONConfigurationTransfer).RequestedTNLInfo }, + }, + { + name: "X2TNLConfigurationInfo/eNBX2ExtendedTransportLayerAddresses", id: IDENBX2ExtendedTransportLayerAddresses, crit: CriticalityIgnore, + value: encodedVec(t, &ENBX2ExtTLAs{{IPsecTLA: Ptr(tlaOf(192, 0, 2, 1)), GTPTLAa: ENBX2GTPTLAs{tlaOf(192, 0, 2, 2)}}}), + wire: func(raw rawIE) extCodec { + c := &X2TNLConfigurationInfo{ENBX2TransportLayerAddresses: ENBX2TLAs{tlaOf(192, 0, 2, 3)}} + c.iEExtensions.Append(raw) + + return c + }, + fresh: func() extCodec { return &X2TNLConfigurationInfo{} }, + typed: func(v extCodec) per.Marshaler { + return &v.(*X2TNLConfigurationInfo).ENBX2ExtendedTransportLayerAddresses + }, + }, + } +} + +func TestTypedExtensionsDecodeFromTheWire(t *testing.T) { + for _, tc := range typedExtensionCases(t) { + t.Run(tc.name, func(t *testing.T) { + in := encodedVec(t, tc.wire(rawIE{ID: tc.id, Criticality: tc.crit, Value: tc.value})) + + got := tc.fresh() + if err := got.UnmarshalPER(per.NewReader(in), per.Aligned); err != nil { + t.Fatalf("decode: %v", err) + } + + typed := tc.typed(got) + if isNilMarshaler(typed) { + t.Fatal("the extension was not decoded into its typed field") + } + + if v := encodedVec(t, typed); !bytes.Equal(v, tc.value) { + t.Fatalf("typed value encodes as % x, want % x", v, tc.value) + } + + if got.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + t.Fatal("a spec-defined extension is reported as not comprehended") + } + + if out := encodedVec(t, got); !bytes.Equal(out, in) { + t.Fatalf("re-encoded\n got % x\nwant % x", out, in) + } + }) + } +} + +func isNilMarshaler(m per.Marshaler) bool { + v := reflect.ValueOf(m) + if m == nil || v.IsNil() { + return true + } + + return v.Elem().Kind() == reflect.Slice && v.Elem().Len() == 0 +} diff --git a/s1ap/typing_test.go b/s1ap/typing_test.go index 398726fea0..4b22752239 100644 --- a/s1ap/typing_test.go +++ b/s1ap/typing_test.go @@ -72,7 +72,7 @@ type ieRow struct { var ( reTable = regexp.MustCompile(`(?s)var \w+IEs = \[\]ieSpec\[(\w+)\]\{(.*?)\n\}\n`) - reRow = regexp.MustCompile(`(?s)\{\n\t\tid: (ID\w+), presence: (presence\w+), crit: (Criticality\w+),\n(.*?)\n\t\},`) + reRow = regexp.MustCompile(`(?s)\{\n\t\tID: (ID\w+), Presence: (presence\w+), Criticality: (Criticality\w+),\n(.*?)\n\t\},`) reField = regexp.MustCompile(`m\.([A-Z]\w*)`) ) @@ -89,7 +89,7 @@ func parseIETables(t *testing.T) []ieRow { id: m[1], presence: m[2], criticality: m[3], - hasCondition: strings.Contains(m[4], "condition:"), + hasCondition: strings.Contains(m[4], "Condition:"), } if f := reField.FindStringSubmatch(m[4]); f != nil { diff --git a/s1ap/ue_ambr_test.go b/s1ap/ue_ambr_test.go new file mode 100644 index 0000000000..123642f362 --- /dev/null +++ b/s1ap/ue_ambr_test.go @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +func TestUEAggregateMaximumBitRateExtendedBitRates(t *testing.T) { + dl, ul := ExtendedBitRate(25_000_000_000), ExtendedBitRate(12_000_000_000) + + w := per.NewWriter() + w.WriteBit(false) + w.WriteBit(true) + mustNil(t, BitRate(10_000_000_000).MarshalPER(w, per.Aligned)) + mustNil(t, BitRate(10_000_000_000).MarshalPER(w, per.Aligned)) + mustNil(t, encodeExtensionContainer(w, []ieField{ + {ID: 259, Criticality: CriticalityIgnore, Value: dl}, + {ID: 260, Criticality: CriticalityIgnore, Value: ul}, + })) + w.AlignToByte() + + raw := w.Bytes() + + var got UEAggregateMaximumBitRate + mustNil(t, got.UnmarshalPER(per.NewReader(raw), per.Aligned)) + + if got.ExtendedDL == nil || *got.ExtendedDL != dl || got.ExtendedUL == nil || *got.ExtendedUL != ul { + t.Fatalf("extended UE-AMBR = %v/%v, want %d/%d", got.ExtendedDL, got.ExtendedUL, dl, ul) + } + + if d := ap.Diagnose[ProtocolIEID](&got); !d.Empty() { + t.Fatalf("diagnostics = %+v, want none for spec-defined extensions", d) + } + + out, err := per.Marshal(&got, per.Aligned) + mustNil(t, err) + + if !bytes.Equal(out, raw) { + t.Fatalf("re-encoded %x, want %x", out, raw) + } + + built, err := per.Marshal(&UEAggregateMaximumBitRate{DL: 10_000_000_000, UL: 10_000_000_000, ExtendedDL: &dl, ExtendedUL: &ul}, per.Aligned) + mustNil(t, err) + + if !bytes.Equal(built, raw) { + t.Fatalf("built %x, want %x", built, raw) + } +} diff --git a/s1ap/ue_capability.go b/s1ap/ue_capability.go index 1f2dc6ac71..82bbcc0948 100644 --- a/s1ap/ue_capability.go +++ b/s1ap/ue_capability.go @@ -21,23 +21,23 @@ type UECapabilityInfoIndication struct { var uECapabilityInfoIndicationIEs = []ieSpec[UECapabilityInfoIndication]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UECapabilityInfoIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UECapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UECapabilityInfoIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UECapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDUERadioCapability, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UECapabilityInfoIndication, raw []byte, enc per.Encoding) error { - if err := perIEDecode(raw, &m.UERadioCapability); err != nil { + ID: IDUERadioCapability, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UECapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { + if err := decodeIE(r, &m.UERadioCapability); err != nil { return err } @@ -47,7 +47,7 @@ var uECapabilityInfoIndicationIEs = []ieSpec[UECapabilityInfoIndication]{ return nil }, - encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { + Encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { if m.UERadioCapability == nil { return nil, false } @@ -56,11 +56,11 @@ var uECapabilityInfoIndicationIEs = []ieSpec[UECapabilityInfoIndication]{ }, }, { - id: IDUERadioCapabilityForPaging, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UECapabilityInfoIndication, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UERadioCapabilityForPaging) + ID: IDUERadioCapabilityForPaging, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UECapabilityInfoIndication, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UERadioCapabilityForPaging) }, - encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { + Encode: func(m *UECapabilityInfoIndication) (per.Marshaler, bool) { if m.UERadioCapabilityForPaging == nil { return nil, false } @@ -93,3 +93,7 @@ func (m *UECapabilityInfoIndication) Marshal() ([]byte, error) { func ParseUECapabilityInfoIndication(value []byte) (*UECapabilityInfoIndication, error) { return parseMessageBody[UECapabilityInfoIndication](ProcUECapabilityInfoIndication, TriggeringInitiatingMessage, uECapabilityInfoIndicationIEs, value) } + +func DecodeUECapabilityInfoIndication(value []byte) (*UECapabilityInfoIndication, error) { + return decodeMessageBody[UECapabilityInfoIndication](ProcUECapabilityInfoIndication, uECapabilityInfoIndicationIEs, value) +} diff --git a/s1ap/ue_capability_test.go b/s1ap/ue_capability_test.go index e3e8f5a784..cbcebfbfd0 100644 --- a/s1ap/ue_capability_test.go +++ b/s1ap/ue_capability_test.go @@ -7,6 +7,8 @@ import ( "bytes" "errors" "testing" + + "github.com/ellanetworks/core/per/ap" ) func TestUECapabilityInfoIndicationRoundTrips(t *testing.T) { @@ -78,8 +80,8 @@ func TestUECapabilityInfoIndicationPaging(t *testing.T) { // without it is still delivered and the absence reported (§10.3.5). func TestUECapabilityInfoIndicationWithoutCapability(t *testing.T) { value := container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, raw: ieRaw(t, Ptr(MMEUES1APID(1)))}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, raw: ieRaw(t, Ptr(ENBUES1APID(2)))}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(ENBUES1APID(2))))}, ) msg, err := ParseUECapabilityInfoIndication(value) @@ -92,7 +94,7 @@ func TestUECapabilityInfoIndicationWithoutCapability(t *testing.T) { } d := msg.Diagnostics() - if len(d.IEs) != 1 || d.IEs[0].ID != IDUERadioCapability || d.IEs[0].TypeOfError != TypeOfErrorMissing { + if len(d.IEs) != 1 || d.IEs[0].ID != IDUERadioCapability || typeOfError(d.IEs[0]) != TypeOfErrorMissing { t.Errorf("diagnostics = %+v, want one missing entry for UERadioCapability", d.IEs) } } @@ -101,8 +103,8 @@ func TestUECapabilityInfoIndicationWithoutCapability(t *testing.T) { // missing one (§10.3.5). func TestUECapabilityInfoIndicationMissingRejectIE(t *testing.T) { value := container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, raw: ieRaw(t, Ptr(MMEUES1APID(1)))}, - ieField{id: IDUERadioCapability, crit: CriticalityIgnore, raw: ieRaw(t, UERadioCapability{0x01})}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, + ieField{ID: IDUERadioCapability, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, UERadioCapability{0x01}))}, ) _, err := ParseUECapabilityInfoIndication(value) diff --git a/s1ap/ue_context_modification.go b/s1ap/ue_context_modification.go index cbbecc7790..dc23e1d9dc 100644 --- a/s1ap/ue_context_modification.go +++ b/s1ap/ue_context_modification.go @@ -11,31 +11,32 @@ type UEContextModificationRequest struct { MMEUES1APID MMEUES1APID ENBUES1APID ENBUES1APID UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + TimeRefDistribution *TimeRefDistribution messageMeta } var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDUEAggregateMaximumBitrate, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextModificationRequest, raw []byte, enc per.Encoding) error { + ID: IDUEAggregateMaximumBitrate, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { var ambr UEAggregateMaximumBitRate - if err := perIEDecode(raw, &ambr); err != nil { + if err := decodeIE(r, &ambr); err != nil { return err } @@ -43,7 +44,7 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return nil }, - encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { if m.UEAggregateMaximumBitRate == nil { return nil, false } @@ -51,6 +52,13 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return m.UEAggregateMaximumBitRate, true }, }, + { + ID: IDTimeRefDistribution, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { + return decodeOptionalIE(r, &m.TimeRefDistribution) + }, + Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return optionalIE(m.TimeRefDistribution) }, + }, } func (m *UEContextModificationRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -77,6 +85,10 @@ func ParseUEContextModificationRequest(value []byte) (*UEContextModificationRequ return parseMessageBody[UEContextModificationRequest](ProcUEContextModification, TriggeringInitiatingMessage, uEContextModificationRequestIEs, value) } +func DecodeUEContextModificationRequest(value []byte) (*UEContextModificationRequest, error) { + return decodeMessageBody[UEContextModificationRequest](ProcUEContextModification, uEContextModificationRequestIEs, value) +} + type UEContextModificationResponse struct { MMEUES1APID *MMEUES1APID ENBUES1APID *ENBUES1APID @@ -87,11 +99,11 @@ type UEContextModificationResponse struct { var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationResponse, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -99,7 +111,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return nil }, - encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -108,11 +120,11 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationResponse, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -120,7 +132,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return nil }, - encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -129,11 +141,11 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextModificationResponse, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -141,7 +153,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return nil }, - encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationResponse) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -175,6 +187,10 @@ func ParseUEContextModificationResponse(value []byte) (*UEContextModificationRes return parseMessageBody[UEContextModificationResponse](ProcUEContextModification, TriggeringSuccessfulOutcome, uEContextModificationResponseIEs, value) } +func DecodeUEContextModificationResponse(value []byte) (*UEContextModificationResponse, error) { + return decodeMessageBody[UEContextModificationResponse](ProcUEContextModification, uEContextModificationResponseIEs, value) +} + type UEContextModificationFailure struct { MMEUES1APID *MMEUES1APID ENBUES1APID *ENBUES1APID @@ -186,11 +202,11 @@ type UEContextModificationFailure struct { var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -198,7 +214,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -207,11 +223,11 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -219,7 +235,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -228,11 +244,11 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -240,7 +256,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -249,11 +265,11 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextModificationFailure, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextModificationFailure, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -261,7 +277,7 @@ var uEContextModificationFailureIEs = []ieSpec[UEContextModificationFailure]{ return nil }, - encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { + Encode: func(m *UEContextModificationFailure) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -294,3 +310,7 @@ func (m *UEContextModificationFailure) Marshal() ([]byte, error) { func ParseUEContextModificationFailure(value []byte) (*UEContextModificationFailure, error) { return parseMessageBody[UEContextModificationFailure](ProcUEContextModification, TriggeringUnsuccessfulOutcome, uEContextModificationFailureIEs, value) } + +func DecodeUEContextModificationFailure(value []byte) (*UEContextModificationFailure, error) { + return decodeMessageBody[UEContextModificationFailure](ProcUEContextModification, uEContextModificationFailureIEs, value) +} diff --git a/s1ap/ue_context_modification_test.go b/s1ap/ue_context_modification_test.go index dd479d5813..be9fb1d739 100644 --- a/s1ap/ue_context_modification_test.go +++ b/s1ap/ue_context_modification_test.go @@ -92,7 +92,7 @@ func TestUEContextModificationRoundTrips(t *testing.T) { in := &UEContextModificationFailure{ MMEUES1APID: Ptr(MMEUES1APID(42)), ENBUES1APID: Ptr(ENBUES1APID(7)), - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 0}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), } b, err := in.Marshal() @@ -115,7 +115,7 @@ func TestUEContextModificationRoundTrips(t *testing.T) { t.Fatal(err) } - if deref(out.MMEUES1APID) != 42 || deref(out.ENBUES1APID) != 7 || deref(out.Cause) != deref(in.Cause) { + if deref(out.MMEUES1APID) != 42 || deref(out.ENBUES1APID) != 7 || !deref(out.Cause).Equal(deref(in.Cause)) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) diff --git a/s1ap/ue_context_release.go b/s1ap/ue_context_release.go index e57da3840d..95b6510e0c 100644 --- a/s1ap/ue_context_release.go +++ b/s1ap/ue_context_release.go @@ -4,138 +4,44 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" ) -// UE-S1AP-IDs CHOICE alternatives. The CHOICE is extensible, so the count is of -// its root alternatives. -const ( - ues1apIDsPair = iota - ues1apIDsMMEUES1APID - - ues1apIDsChoiceRootCount = 2 -) - -// UE-S1AP-IDs ::= CHOICE { uE-S1AP-ID-pair, mME-UE-S1AP-ID, ... }. Pair selects -// uE-S1AP-ID-pair, which the MME sends once the eNB has assigned an eNB UE S1AP -// ID; otherwise only MMEUES1APID is carried. +// UE-S1AP-IDs ::= CHOICE { uE-S1AP-ID-pair, mME-UE-S1AP-ID, ... }. The MME +// sends uE-S1AP-ID-pair once the eNB has assigned an eNB UE S1AP ID; otherwise +// only mME-UE-S1AP-ID is carried. type UES1APIDs struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - Pair bool - - pairIEExtensions *rawIEExtensions - pairExtensions per.ExtensionAdditions + UES1APIDPair *UES1APIDPair `per:",choice:0"` + MMEUES1APID *MMEUES1APID `per:",choice:1"` + Ext *per.ExtensionAlternative `per:",extalt"` } -func (u UES1APIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { - w.WriteBit(false) - - if !u.Pair { - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, ues1apIDsChoiceRootCount-1, ues1apIDsMMEUES1APID); err != nil { - return err - } - - return u.MMEUES1APID.MarshalPER(w, enc) - } - - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, ues1apIDsChoiceRootCount-1, ues1apIDsPair); err != nil { - return err - } - - // UE-S1AP-ID-pair ::= SEQUENCE { mME-UE-S1AP-ID, eNB-UE-S1AP-ID, - // iE-Extensions OPTIONAL } (extensible). - w.WriteBit(u.pairExtensions.Present()) - w.WriteBit(u.pairIEExtensions != nil) - - if err := u.MMEUES1APID.MarshalPER(w, enc); err != nil { - return err - } - - if err := u.ENBUES1APID.MarshalPER(w, enc); err != nil { - return err - } - - if u.pairIEExtensions != nil { - if err := u.pairIEExtensions.MarshalPER(w, enc); err != nil { - return err - } - } - - return u.pairExtensions.MarshalPER(w, enc) +// UE-S1AP-ID-pair ::= SEQUENCE { mME-UE-S1AP-ID, eNB-UE-S1AP-ID, +// iE-Extensions OPTIONAL } (extensible). +type UES1APIDPair struct { + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` } -func (u *UES1APIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - isExt, err := r.ReadBit() - if err != nil { - return err - } - - if isExt { - // §10.3.1 case 6, as for ResetType: handled on criticality rather than - // abandoning the message. - return fmt.Errorf("%w: UE-S1AP-IDs extension alternative", errNotComprehended) +func (u UES1APIDs) MMEID() (MMEUES1APID, bool) { + switch { + case u.UES1APIDPair != nil: + return u.UES1APIDPair.MMEUES1APID, true + case u.MMEUES1APID != nil: + return *u.MMEUES1APID, true + default: + return 0, false } +} - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, ues1apIDsChoiceRootCount-1) - if err != nil { - return err +func (u UES1APIDs) ENBID() (ENBUES1APID, bool) { + if u.UES1APIDPair == nil { + return 0, false } - switch idx { - case ues1apIDsPair: - extBit, err := r.ReadBit() - if err != nil { - return err - } - - extContainer, err := r.ReadBit() - if err != nil { - return err - } - - var mme MMEUES1APID - if err := mme.UnmarshalPER(r, enc); err != nil { - return err - } - - var enb ENBUES1APID - if err := enb.UnmarshalPER(r, enc); err != nil { - return err - } - - var ieExt *rawIEExtensions - - if extContainer { - ieExt = &rawIEExtensions{} - if err := ieExt.UnmarshalPER(r, enc); err != nil { - return err - } - } - - var ext per.ExtensionAdditions - - if extBit { - if err := ext.UnmarshalPER(r, enc); err != nil { - return err - } - } - - *u = UES1APIDs{MMEUES1APID: mme, ENBUES1APID: enb, Pair: true, pairIEExtensions: ieExt, pairExtensions: ext} - - return nil - default: - var mme MMEUES1APID - if err := mme.UnmarshalPER(r, enc); err != nil { - return err - } - - *u = UES1APIDs{MMEUES1APID: mme} - - return nil - } + return u.UES1APIDPair.ENBUES1APID, true } // TS 36.413 §9.1.4.6. @@ -148,18 +54,18 @@ type UEContextReleaseCommand struct { var uEContextReleaseCommandIEs = []ieSpec[UEContextReleaseCommand]{ { - id: IDUES1APIDs, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextReleaseCommand, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.UES1APIDs) + ID: IDUES1APIDs, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseCommand, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.UES1APIDs) }, - encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { return &m.UES1APIDs, true }, + Encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { return &m.UES1APIDs, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseCommand, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseCommand, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -167,7 +73,7 @@ var uEContextReleaseCommandIEs = []ieSpec[UEContextReleaseCommand]{ return nil }, - encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseCommand) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -201,6 +107,10 @@ func ParseUEContextReleaseCommand(value []byte) (*UEContextReleaseCommand, error return parseMessageBody[UEContextReleaseCommand](ProcUEContextRelease, TriggeringInitiatingMessage, uEContextReleaseCommandIEs, value) } +func DecodeUEContextReleaseCommand(value []byte) (*UEContextReleaseCommand, error) { + return decodeMessageBody[UEContextReleaseCommand](ProcUEContextRelease, uEContextReleaseCommandIEs, value) +} + // TS 36.413 §9.1.4.7. type UEContextReleaseComplete struct { MMEUES1APID *MMEUES1APID @@ -213,11 +123,11 @@ type UEContextReleaseComplete struct { var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var v MMEUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -225,7 +135,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.MMEUES1APID == nil { return nil, false } @@ -234,11 +144,11 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -246,7 +156,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.ENBUES1APID == nil { return nil, false } @@ -255,11 +165,11 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ }, }, { - id: IDCriticalityDiagnostics, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var cd CriticalityDiagnostics - if err := perIEDecode(raw, &cd); err != nil { + if err := decodeIE(r, &cd); err != nil { return err } @@ -267,7 +177,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.CriticalityDiagnostics == nil { return nil, false } @@ -276,11 +186,11 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ }, }, { - id: IDUserLocationInformation, presence: presenceOptional, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseComplete, raw []byte, enc per.Encoding) error { + ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseComplete, r *per.Reader, enc per.Encoding) error { var uli UserLocationInformation - if err := perIEDecode(raw, &uli); err != nil { + if err := decodeIE(r, &uli); err != nil { return err } @@ -288,7 +198,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return nil }, - encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseComplete) (per.Marshaler, bool) { if m.UserLocationInformation == nil { return nil, false } @@ -322,6 +232,10 @@ func ParseUEContextReleaseComplete(value []byte) (*UEContextReleaseComplete, err return parseMessageBody[UEContextReleaseComplete](ProcUEContextRelease, TriggeringSuccessfulOutcome, uEContextReleaseCompleteIEs, value) } +func DecodeUEContextReleaseComplete(value []byte) (*UEContextReleaseComplete, error) { + return decodeMessageBody[UEContextReleaseComplete](ProcUEContextRelease, uEContextReleaseCompleteIEs, value) +} + // TS 36.413 §9.1.4.5. type UEContextReleaseRequest struct { MMEUES1APID MMEUES1APID @@ -334,25 +248,25 @@ type UEContextReleaseRequest struct { var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ { - id: IDMMEUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.MMEUES1APID) + ID: IDMMEUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.MMEUES1APID) }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.MMEUES1APID, true }, }, { - id: IDENBUES1APID, presence: presenceMandatory, crit: CriticalityReject, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { - return perIEDecode(raw, &m.ENBUES1APID) + ID: IDENBUES1APID, Presence: presenceMandatory, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { + return decodeIE(r, &m.ENBUES1APID) }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, { - id: IDCause, presence: presenceMandatory, crit: CriticalityIgnore, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { + ID: IDCause, Presence: presenceMandatory, Criticality: CriticalityIgnore, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { var v Cause - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -360,7 +274,7 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ return nil }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { if m.Cause == nil { return nil, false } @@ -369,11 +283,11 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ }, }, { - id: IDGWContextReleaseIndication, presence: presenceOptional, crit: CriticalityReject, - decode: func(m *UEContextReleaseRequest, raw []byte, enc per.Encoding) error { + ID: IDGWContextReleaseIndication, Presence: presenceOptional, Criticality: CriticalityReject, + Decode: func(m *UEContextReleaseRequest, r *per.Reader, enc per.Encoding) error { var v GWContextReleaseIndication - if err := perIEDecode(raw, &v); err != nil { + if err := decodeIE(r, &v); err != nil { return err } @@ -381,7 +295,7 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ return nil }, - encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { + Encode: func(m *UEContextReleaseRequest) (per.Marshaler, bool) { if m.GWContextReleaseIndication == nil { return nil, false } @@ -414,3 +328,7 @@ func (m *UEContextReleaseRequest) Marshal() ([]byte, error) { func ParseUEContextReleaseRequest(value []byte) (*UEContextReleaseRequest, error) { return parseMessageBody[UEContextReleaseRequest](ProcUEContextReleaseRequest, TriggeringInitiatingMessage, uEContextReleaseRequestIEs, value) } + +func DecodeUEContextReleaseRequest(value []byte) (*UEContextReleaseRequest, error) { + return decodeMessageBody[UEContextReleaseRequest](ProcUEContextReleaseRequest, uEContextReleaseRequestIEs, value) +} diff --git a/s1ap/ue_context_release_test.go b/s1ap/ue_context_release_test.go index 4368eaa1e8..7cdeb902dd 100644 --- a/s1ap/ue_context_release_test.go +++ b/s1ap/ue_context_release_test.go @@ -8,14 +8,15 @@ import ( "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) func TestUEContextReleaseRoundTrips(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: 0} + cause := CauseRadioNetworkUnspecified.Cause() t.Run("Command pair", func(t *testing.T) { in := &UEContextReleaseCommand{ - UES1APIDs: UES1APIDs{MMEUES1APID: 1, ENBUES1APID: 7, Pair: true}, + UES1APIDs: UES1APIDs{UES1APIDPair: &UES1APIDPair{MMEUES1APID: 1, ENBUES1APID: 7}}, Cause: &cause, } @@ -39,14 +40,13 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { t.Fatal(err) } - if !out.UES1APIDs.Pair || out.UES1APIDs.MMEUES1APID != 1 || out.UES1APIDs.ENBUES1APID != 7 || - deref(out.Cause) != cause { + if !out.UES1APIDs.Equal(in.UES1APIDs) || !deref(out.Cause).Equal(cause) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) t.Run("Command bare MME id", func(t *testing.T) { - in := &UEContextReleaseCommand{UES1APIDs: UES1APIDs{MMEUES1APID: 42}, Cause: &cause} + in := &UEContextReleaseCommand{UES1APIDs: UES1APIDs{MMEUES1APID: Ptr(MMEUES1APID(42))}, Cause: &cause} b, _ := in.Marshal() @@ -57,7 +57,7 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { t.Fatal(err) } - if out.UES1APIDs.Pair || out.UES1APIDs.MMEUES1APID != 42 { + if out.UES1APIDs.UES1APIDPair != nil || out.UES1APIDs.MMEUES1APID == nil || *out.UES1APIDs.MMEUES1APID != 42 { t.Fatalf("mismatch: %+v", out.UES1APIDs) } }) @@ -120,7 +120,7 @@ func TestUEContextReleaseRoundTrips(t *testing.T) { } out, err := ParseUEContextReleaseRequest(im.Value) - if err != nil || out.MMEUES1APID != 1 || out.ENBUES1APID != 7 || deref(out.Cause) != cause { + if err != nil || out.MMEUES1APID != 1 || out.ENBUES1APID != 7 || !deref(out.Cause).Equal(cause) { t.Fatalf("got %+v err %v", out, err) } }) @@ -142,7 +142,7 @@ func TestUEContextReleaseCommandExtensionAlternative(t *testing.T) { t.Fatal(err) } - value := container(t, ieField{id: IDUES1APIDs, crit: CriticalityReject, raw: perBytes(w)}) + value := container(t, ieField{ID: IDUES1APIDs, Criticality: CriticalityReject, Value: ap.RawValue(perBytes(w))}) _, err := ParseUEContextReleaseCommand(value) if err == nil { @@ -154,7 +154,7 @@ func TestUEContextReleaseCommandExtensionAlternative(t *testing.T) { t.Fatalf("error = %T (%v), want *AbstractSyntaxError", err, err) } - if ase.Cause.Value != CauseProtocolAbstractSyntaxErrorReject { + if !ase.Cause.Equal(CauseProtocolAbstractSyntaxErrorReject.Cause()) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } @@ -165,7 +165,7 @@ func TestUEContextReleaseCommandExtensionAlternative(t *testing.T) { } func uEContextReleaseRequestGoldenCases() []newMessageCase { - x2 := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkX2HandoverTriggered} + x2 := CauseRadioNetworkX2HandoverTriggered.Cause() return []newMessageCase{ { @@ -184,13 +184,13 @@ func uEContextReleaseRequestGoldenCases() []newMessageCase { } func TestUEContextReleaseRequestGWContextReleaseIndicationExtensionRejects(t *testing.T) { - cause := Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkX2HandoverTriggered} + cause := CauseRadioNetworkX2HandoverTriggered.Cause() _, err := ParseUEContextReleaseRequest(container(t, - ieField{id: IDMMEUES1APID, crit: CriticalityReject, val: Ptr(MMEUES1APID(1))}, - ieField{id: IDENBUES1APID, crit: CriticalityReject, val: Ptr(ENBUES1APID(2))}, - ieField{id: IDCause, crit: CriticalityIgnore, val: &cause}, - ieField{id: IDGWContextReleaseIndication, crit: CriticalityReject, raw: extensionEnum(t, gwContextReleaseIndicationRootCount, 0)}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: Ptr(MMEUES1APID(1))}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: Ptr(ENBUES1APID(2))}, + ieField{ID: IDCause, Criticality: CriticalityIgnore, Value: &cause}, + ieField{ID: IDGWContextReleaseIndication, Criticality: CriticalityReject, Value: ap.RawValue(extensionEnum(t, int64(len(enumGWContextReleaseIndication.Root)), 0))}, )) var ase *AbstractSyntaxError diff --git a/s1ap/ue_ids.go b/s1ap/ue_ids.go index 35d6d9e013..0fc455f07a 100644 --- a/s1ap/ue_ids.go +++ b/s1ap/ue_ids.go @@ -22,13 +22,13 @@ func PeekMMEUES1APID(pdu PDU) (MMEUES1APID, bool) { } for _, f := range fields { - if f.id != IDMMEUES1APID && f.id != IDSourceMMEUES1APID { + if f.ID != IDMMEUES1APID && f.ID != IDSourceMMEUES1APID { continue } var id MMEUES1APID - if err := perIEDecode(f.value, &id); err != nil { + if err := perIEDecode(f.Value, &id); err != nil { return 0, false } diff --git a/s1ap/unknown_ie_test.go b/s1ap/unknown_ie_test.go index 80f7f2c2ef..f2bac656a3 100644 --- a/s1ap/unknown_ie_test.go +++ b/s1ap/unknown_ie_test.go @@ -6,11 +6,11 @@ package s1ap import ( "bytes" "errors" - "reflect" "slices" "testing" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // A ProtocolIE the message type does not model must survive Marshal/Parse @@ -24,8 +24,8 @@ func TestUnknownIERoundTrip(t *testing.T) { MMEUES1APID: 1, ENBUES1APID: 2, UERadioCapability: []byte{0xaa, 0xbb}, - messageMeta: messageMeta{unknownIEs: []rawIE{{id: unknownID, crit: CriticalityNotify, value: unknownVal}}}, } + in.Append(rawIE{ID: unknownID, Criticality: CriticalityNotify, Value: unknownVal}) pduBytes, err := in.Marshal() if err != nil { @@ -59,8 +59,8 @@ func TestUnknownIERoundTrip(t *testing.T) { func TestUnknownIEsNilWhenNone(t *testing.T) { in := &UEContextReleaseCommand{ - UES1APIDs: UES1APIDs{MMEUES1APID: 1, ENBUES1APID: 2, Pair: true}, - Cause: Ptr(Cause{Group: CauseGroupNAS, Value: 0}), + UES1APIDs: UES1APIDs{UES1APIDPair: &UES1APIDPair{MMEUES1APID: 1, ENBUES1APID: 2}}, + Cause: Ptr(CauseNASNormalRelease.Cause()), } pduBytes, err := in.Marshal() @@ -145,10 +145,13 @@ func TestUnmodeledIECriticality(t *testing.T) { t.Helper() m := &S1SetupRequest{ - GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 1}}, + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(1))}}, SupportedTAs: SupportedTAs{{TAC: 1, BroadcastPLMNs: BPLMNs{{0x00, 0xf1, 0x10}}}}, DefaultPagingDRX: Ptr(PagingDRXv128), - messageMeta: messageMeta{unknownIEs: unknown}, + } + + for _, u := range unknown { + m.Append(u) } raw, err := m.Marshal() @@ -166,8 +169,8 @@ func TestUnmodeledIECriticality(t *testing.T) { t.Run("reject rejects the procedure", func(t *testing.T) { value := setup(t, - rawIE{id: ignoreID, crit: CriticalityIgnore, value: []byte{0x01}}, - rawIE{id: rejectID, crit: CriticalityReject, value: []byte{0x02}}, + rawIE{ID: ignoreID, Criticality: CriticalityIgnore, Value: []byte{0x01}}, + rawIE{ID: rejectID, Criticality: CriticalityReject, Value: []byte{0x02}}, ) var ase *AbstractSyntaxError @@ -187,8 +190,8 @@ func TestUnmodeledIECriticality(t *testing.T) { t.Run("ignore and notify are reported and preserved", func(t *testing.T) { value := setup(t, - rawIE{id: ignoreID, crit: CriticalityIgnore, value: []byte{0x01}}, - rawIE{id: notifyID, crit: CriticalityNotify, value: []byte{0x03}}, + rawIE{ID: ignoreID, Criticality: CriticalityIgnore, Value: []byte{0x01}}, + rawIE{ID: notifyID, Criticality: CriticalityNotify, Value: []byte{0x03}}, ) out, err := ParseS1SetupRequest(value) @@ -211,7 +214,7 @@ func TestUnmodeledIECriticality(t *testing.T) { }) t.Run("ignore alone needs no report", func(t *testing.T) { - out, err := ParseS1SetupRequest(setup(t, rawIE{id: 400, crit: CriticalityIgnore, value: []byte{0x01}})) + out, err := ParseS1SetupRequest(setup(t, rawIE{ID: 400, Criticality: CriticalityIgnore, Value: []byte{0x01}})) if err != nil { t.Fatal(err) } @@ -224,7 +227,7 @@ func TestUnmodeledIECriticality(t *testing.T) { func goldS1SetupRequestForWire() *S1SetupRequest { return &S1SetupRequest{ - GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{Kind: ENBIDMacro, Value: 0x0abcd}}, + GlobalENBID: GlobalENBID{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, ENBID: ENBID{MacroENBID: Ptr(MacroENBID(0x0abcd))}}, SupportedTAs: SupportedTAs{{TAC: 0x0001, BroadcastPLMNs: BPLMNs{{0x00, 0xf1, 0x10}}}}, DefaultPagingDRX: Ptr(PagingDRXv128), } @@ -246,7 +249,7 @@ func wireIDs(t *testing.T, body func(*per.Writer, per.Encoding) error) []Protoco var ids []ProtocolIEID for _, f := range wireIEs(t, body) { - ids = append(ids, f.id) + ids = append(ids, f.ID) } return ids @@ -257,10 +260,10 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { src := goldS1SetupRequestForWire() value := container(t, - ieField{id: IDGlobalENBID, crit: CriticalityReject, val: &src.GlobalENBID}, - ieField{id: IDSupportedTAs, crit: CriticalityReject, val: src.SupportedTAs}, - ieField{id: unknownID, crit: CriticalityIgnore, raw: []byte{0xde, 0xad}}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, + ieField{ID: IDGlobalENBID, Criticality: CriticalityReject, Value: &src.GlobalENBID}, + ieField{ID: IDSupportedTAs, Criticality: CriticalityReject, Value: src.SupportedTAs}, + ieField{ID: unknownID, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xde, 0xad})}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, ) req, err := ParseS1SetupRequest(value) @@ -284,11 +287,11 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { src := goldS1SetupRequestForWire() value := container(t, - ieField{id: ProtocolIEID(300), crit: CriticalityIgnore, raw: []byte{0x01}}, - ieField{id: IDGlobalENBID, crit: CriticalityReject, val: &src.GlobalENBID}, - ieField{id: IDSupportedTAs, crit: CriticalityReject, val: src.SupportedTAs}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityIgnore, val: PagingDRXv128}, - ieField{id: ProtocolIEID(9999), crit: CriticalityNotify, raw: []byte{0x02}}, + ieField{ID: ProtocolIEID(300), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})}, + ieField{ID: IDGlobalENBID, Criticality: CriticalityReject, Value: &src.GlobalENBID}, + ieField{ID: IDSupportedTAs, Criticality: CriticalityReject, Value: src.SupportedTAs}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, + ieField{ID: ProtocolIEID(9999), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x02})}, ) req, err := ParseS1SetupRequest(value) @@ -304,9 +307,9 @@ func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { func TestReceivedIECriticalityIsReencoded(t *testing.T) { src := goldS1SetupRequestForWire() value := container(t, - ieField{id: IDGlobalENBID, crit: CriticalityReject, val: &src.GlobalENBID}, - ieField{id: IDSupportedTAs, crit: CriticalityReject, val: src.SupportedTAs}, - ieField{id: IDDefaultPagingDRX, crit: CriticalityReject, val: PagingDRXv128}, + ieField{ID: IDGlobalENBID, Criticality: CriticalityReject, Value: &src.GlobalENBID}, + ieField{ID: IDSupportedTAs, Criticality: CriticalityReject, Value: src.SupportedTAs}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityReject, Value: PagingDRXv128}, ) req, err := ParseS1SetupRequest(value) @@ -318,7 +321,7 @@ func TestReceivedIECriticalityIsReencoded(t *testing.T) { t.Fatalf("re-encoded\n got % x\n want % x", got, value) } - if got := wireIEs(t, src.encodeBody)[2].crit; got != CriticalityIgnore { + if got := wireIEs(t, src.encodeBody)[2].Criticality; got != CriticalityIgnore { t.Fatalf("built from scratch: Default Paging DRX criticality %v, want ignore", got) } } @@ -331,7 +334,7 @@ func TestConformingMessageParsesToItsBuiltForm(t *testing.T) { t.Fatal(err) } - if !reflect.DeepEqual(req, in) { + if !req.Equal(*in) { t.Fatalf("parsed %+v, want %+v", req, in) } } diff --git a/s1ap/wire_criticality_test.go b/s1ap/wire_criticality_test.go index d360004210..4ce2c18409 100644 --- a/s1ap/wire_criticality_test.go +++ b/s1ap/wire_criticality_test.go @@ -43,7 +43,7 @@ func TestWireCriticality(t *testing.T) { crit Criticality } - cause := Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 0}) + cause := Ptr(CauseRadioNetworkUnspecified.Cause()) tests := []struct { name string @@ -73,7 +73,7 @@ func TestWireCriticality(t *testing.T) { { "HandoverRequest §9.1.5.4 GUMMEI and MME UE S1AP ID 2", (&HandoverRequest{ - Cause: new(Cause), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), SourceToTarget: TransparentContainer{0x00}, ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 1, TransportLayerAddress: goldTLA(), GTPTEID: 1, QoS: goldQoS()}}, GUMMEI: Ptr(goldGUMMEI()), @@ -400,7 +400,7 @@ func TestWireCriticality(t *testing.T) { (&UEContextReleaseRequest{ MMEUES1APID: 1, ENBUES1APID: 2, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: 0}), + Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), }).encodeBody, []wireIE{ {IDMMEUES1APID, CriticalityReject}, @@ -413,7 +413,7 @@ func TestWireCriticality(t *testing.T) { (&UEContextReleaseRequest{ MMEUES1APID: 1, ENBUES1APID: 2, - Cause: Ptr(Cause{Group: CauseGroupRadioNetwork, Value: CauseRadioNetworkX2HandoverTriggered}), + Cause: Ptr(CauseRadioNetworkX2HandoverTriggered.Cause()), GWContextReleaseIndication: Ptr(GWContextReleaseIndicationTrue), }).encodeBody, []wireIE{ @@ -426,8 +426,8 @@ func TestWireCriticality(t *testing.T) { { "UEContextReleaseCommand §9.1.4.6", (&UEContextReleaseCommand{ - UES1APIDs: UES1APIDs{MMEUES1APID: 1, ENBUES1APID: 2, Pair: true}, - Cause: Ptr(Cause{Group: CauseGroupNAS, Value: 0}), + UES1APIDs: UES1APIDs{UES1APIDPair: &UES1APIDPair{MMEUES1APID: 1, ENBUES1APID: 2}}, + Cause: Ptr(CauseNASNormalRelease.Cause()), }).encodeBody, []wireIE{ {IDUES1APIDs, CriticalityReject}, @@ -485,7 +485,7 @@ func TestWireCriticality(t *testing.T) { MMEUES1APID: 1, ENBUES1APID: 2, NASPDU: NASPDU{0x07}, - Cause: Ptr(Cause{Group: CauseGroupMisc, Value: CauseMiscUnspecified}), + Cause: Ptr(CauseMiscUnspecified.Cause()), }).encodeBody, []wireIE{ {IDMMEUES1APID, CriticalityReject}, @@ -504,8 +504,8 @@ func TestWireCriticality(t *testing.T) { } for i, w := range tt.want { - if got[i].id != w.id || got[i].crit != w.crit { - t.Errorf("IE %d: got %v/%v, want %v/%v", i, got[i].id, got[i].crit, w.id, w.crit) + if got[i].ID != w.id || got[i].Criticality != w.crit { + t.Errorf("IE %d: got %v/%v, want %v/%v", i, got[i].ID, got[i].Criticality, w.id, w.crit) } } }) From 27a58be08c42668fd26b68a71ac6817cbfa83197 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sun, 15 Nov 2026 10:12:00 -0500 Subject: [PATCH 12/16] fix: pr review Signed-off-by: Guillaume Belanger --- go.mod | 2 +- .../decoder/ngap/bit_string_widths_test.go | 138 + .../decoder/ngap/downlink_nas_transport.go | 26 +- internal/decoder/ngap/extension_ies_test.go | 170 + internal/decoder/ngap/golden_test.go | 4 + internal/decoder/ngap/handover.go | 44 + .../ngap/initial_context_setup_request.go | 68 +- internal/decoder/ngap/initial_ue_message.go | 17 + internal/decoder/ngap/ng_setup.go | 14 + internal/decoder/ngap/ngap.go | 1 + internal/decoder/ngap/paging.go | 15 + internal/decoder/ngap/path_switch.go | 42 + .../ngap/pdu_session_resource_modify.go | 15 + .../pdu_session_resource_release_command.go | 4 + .../pdu_session_resource_setup_request.go | 5 + .../pdu_session_resource_setup_response.go | 12 +- internal/decoder/ngap/pdu_session_transfer.go | 5 + .../decoder/ngap/ran_configuration_update.go | 17 + internal/decoder/ngap/render.go | 172 + .../downlink_nas_transport_extensions.json | 298 + ...tial_context_setup_request_extensions.json | 283 + .../decoder/ngap/testdata/golden/invalid.json | 2 +- .../golden/ng_setup_request_extensions.json | 130 + .../testdata/golden/paging_extensions.json | 84 + ...rce_setup_request_transfer_extensions.json | 119 + ...text_modification_response_extensions.json | 70 + .../uplink_nas_transport_extensions.json | 146 + .../decoder/ngap/ue_context_modification.go | 42 + internal/decoder/ngap/ue_context_release.go | 5 + .../ue_radio_capability_info_indication.go | 5 + internal/decoder/ngap/up_tnl_choice_test.go | 47 + internal/decoder/ngap/uplink_nas_transport.go | 6 + internal/decoder/ngap/util.go | 2 +- .../decoder/s1ap/bit_string_widths_test.go | 138 + internal/decoder/s1ap/config_transfer.go | 10 + .../decoder/s1ap/enb_configuration_update.go | 7 + internal/decoder/s1ap/erab_modify.go | 37 +- internal/decoder/s1ap/erab_release.go | 8 + internal/decoder/s1ap/extension_ies_test.go | 144 + internal/decoder/s1ap/golden_test.go | 12 +- internal/decoder/s1ap/handover.go | 63 + .../decoder/s1ap/initial_context_setup.go | 36 + internal/decoder/s1ap/location_report.go | 5 + .../decoder/s1ap/mme_configuration_update.go | 4 + internal/decoder/s1ap/nas_transport.go | 57 + internal/decoder/s1ap/paging.go | 15 + internal/decoder/s1ap/path_switch.go | 41 + internal/decoder/s1ap/render.go | 132 + internal/decoder/s1ap/s1_removal.go | 64 + internal/decoder/s1ap/s1_setup.go | 12 + internal/decoder/s1ap/s1ap.go | 18 +- .../downlink_nas_transport_extensions.json | 152 + .../golden/handover_notify_extensions.json | 112 + .../golden/initial_ue_message_extensions.json | 283 + .../decoder/s1ap/testdata/golden/invalid.json | 2 +- .../golden/location_report_extensions.json | 146 + .../testdata/golden/paging_extensions.json | 136 + .../testdata/golden/s1_removal_failure.json | 70 + .../testdata/golden/s1_removal_request.json | 49 + .../testdata/golden/s1_removal_response.json | 57 + .../golden/s1_setup_request_extensions.json | 136 + .../golden/s1_setup_response_extensions.json | 105 + ...ntext_modification_request_extensions.json | 70 + .../uplink_nas_transport_extensions.json | 168 + internal/decoder/s1ap/ue_capability.go | 7 + .../decoder/s1ap/ue_context_modification.go | 27 + internal/decoder/s1ap/ue_context_release.go | 11 + internal/decoder/utils/asn1_names.go | 2769 ++++ internal/decoder/utils/asn1_names_test.go | 165 + internal/decoder/utils/render.go | 323 + internal/decoder/utils/render_test.go | 120 + internal/mme/s1ap/handle_handover_required.go | 8 + .../mme/s1ap/handle_path_switch_request.go | 3 +- .../s1ap/handle_path_switch_request_test.go | 33 + internal/mme/s1ap/handover_target_test.go | 127 + internal/tester/enb/broadcast_plmn_test.go | 10 +- .../tester/enb/build_initial_ue_message.go | 5 +- internal/tester/enb/build_ng_setup_request.go | 4 +- internal/tester/enb/build_roundtrip_test.go | 11 +- internal/tester/enb/helpers.go | 14 +- internal/tester/gnb/broadcast_plmn.go | 6 + .../tester/gnb/handover_selected_plmn_test.go | 146 + internal/tester/gnb/send.go | 16 +- internal/tester/s1enb/broadcast_plmn.go | 17 +- internal/tester/s1enb/handover.go | 8 +- .../s1enb/handover_selected_plmn_test.go | 117 + internal/tester/s1enb/s1ap.go | 28 +- internal/tester/scenarios/gnb/ims_calls.go | 6 + internal/tester/scenarios/gnb/n2_handover.go | 4 + .../scenarios/gnb/n2_handover_connectivity.go | 4 + .../scenarios/gnb/n2_handover_failure.go | 4 + .../gnb/n2_handover_indirect_forwarding.go | 4 + .../gnb/n2_handover_partial_admission.go | 4 + .../scenarios/gnb/n2_handover_ping_pong.go | 4 + .../scenarios/gnb/xn_handover_connectivity.go | 2 + .../tester/scenarios/gnb/xn_path_switch.go | 8 + .../scenarios/gnb/xn_path_switch_failure.go | 4 + .../scenarios/s1enb/ims_registration.go | 2 +- .../tester/scenarios/s1enb/s1_handover.go | 2 +- .../scenarios/s1enb/s1_handover_failure.go | 2 +- .../s1enb/s1_handover_indirect_forwarding.go | 2 +- .../s1enb/s1_handover_partial_admission.go | 2 +- .../scenarios/s1enb/s1_handover_ping_pong.go | 8 +- .../s1enb/x2_handover_connectivity.go | 2 +- .../tester/scenarios/s1enb/x2_path_switch.go | 2 +- .../scenarios/s1enb/x2_path_switch_failure.go | 2 +- ngap/abstract_syntax_test.go | 12 +- ngap/amf_config_update_test.go | 6 +- ngap/asn1_constants_test.go | 271 + ngap/cause_test.go | 3 +- ngap/choice_alternatives_test.go | 357 + ngap/choice_extension_rule_test.go | 49 + ngap/common.go | 6 + ngap/config_transfer.go | 9 +- ngap/coverage_test.go | 30 +- ngap/decode_total_test.go | 8 +- ngap/diagnostics_bound_test.go | 4 +- ngap/engine_regression_test.go | 284 + ngap/enum_asn1_test.go | 332 + ngap/enum_extension_test.go | 5 +- ngap/errors.go | 17 +- ngap/extension_criticality_test.go | 6 +- ngap/golden_tshark_test.go | 4 +- ngap/handover_cancel_test.go | 8 +- ngap/handover_notify_test.go | 8 +- ngap/handover_resource_allocation.go | 77 +- ngap/ie_ext_types.go | 29 +- ngap/ie_extensions.go | 71 - ngap/ie_handover.go | 14 +- ngap/ie_ran_node.go | 18 +- ngap/ie_ran_node_test.go | 7 +- ngap/ie_table.go | 123 +- ngap/ie_tnl.go | 4 +- ngap/ie_ue.go | 17 +- ngap/ies.go | 17 +- ngap/ies_test.go | 12 +- ngap/initial_context_setup.go | 87 +- ngap/initial_context_setup_test.go | 12 +- ngap/names_test.go | 14 +- ngap/nas_transport.go | 75 +- ngap/nas_transport_test.go | 7 +- ngap/ng_reset_test.go | 3 +- ngap/ng_setup.go | 9 +- ngap/ng_setup_resp.go | 9 +- ngap/not_comprehended_test.go | 31 +- ngap/package_decls_test.go | 229 + ngap/paging.go | 25 +- ngap/paging_test.go | 17 +- ngap/path_switch.go | 73 +- ngap/pdu.go | 6 +- ngap/pdu_session_resource_modify.go | 19 +- ...session_resource_modify_indication_test.go | 6 +- ngap/pdu_session_resource_modify_test.go | 6 +- ngap/pdu_session_resource_release.go | 3 +- ngap/pdu_session_resource_release_test.go | 10 +- ngap/pdu_session_resource_setup.go | 19 +- ngap/pdu_session_resource_setup_test.go | 10 +- ngap/per_gen.go | 7557 +++++----- ngap/per_test_helpers_test.go | 7 +- ngap/procedure_criticality.go | 6 + ngap/procedure_names.go | 6 + ngap/pws_overload_test.go | 3 +- ngap/ran_config_update.go | 9 +- ngap/raw_pdu.go | 42 +- ngap/raw_pdu_test.go | 86 +- ngap/raw_pdu_ue_ids_test.go | 6 +- ngap/reset_extensions_test.go | 8 +- ngap/struct_compare_test.go | 107 + ngap/table_order_test.go | 244 +- .../fuzz/FuzzMessageLossless/aa6d9b4547ed086d | 2 + .../fuzz/FuzzMessageLossless/ed8137981a8dffa6 | 2 + ngap/tnl_lossless_test.go | 16 +- ngap/trace_test.go | 4 +- ngap/transparent_container_test.go | 4 +- ngap/ue_context_modification.go | 73 +- ngap/ue_context_release.go | 5 +- ngap/ue_context_release_test.go | 12 +- ngap/ue_radio_capability.go | 5 +- ngap/ue_radio_capability_test.go | 10 +- ngap/unknown_ie_test.go | 10 +- per/ap/ap.go | 75 + per/ap/apimpl/apimpl.go | 190 + per/ap/{ => internal/impl}/container.go | 14 +- per/ap/{ => internal/impl}/criticality.go | 2 +- per/ap/{ => internal/impl}/diagnostics.go | 72 +- per/ap/{ => internal/impl}/errors.go | 14 +- per/ap/internal/impl/list.go | 260 + per/ap/internal/impl/list_test.go | 253 + .../{ => internal/impl}/message_equal_test.go | 6 +- per/ap/{ => internal/impl}/pdu.go | 34 +- per/ap/{ => internal/impl}/preserved.go | 52 +- per/ap/{ => internal/impl}/profile.go | 2 +- per/ap/internal/impl/protocol.go | 215 + per/ap/{ => internal/impl}/raw.go | 102 +- per/ap/{ => internal/impl}/raw_test.go | 81 +- per/ap/{ => internal/impl}/table.go | 146 +- per/ap/{ => internal/impl}/table_test.go | 168 +- .../impl}/transport_layer_address.go | 38 +- .../impl}/transport_layer_address_test.go | 41 +- per/charstring.go | 27 +- per/charstring_alphabet_test.go | 64 + per/content.go | 4 +- per/errors.go | 5 +- per/marshal.go | 8 +- per/opentype.go | 15 +- per/pergen/ap_test.go | 24 +- per/pergen/emit.go | 6 +- per/pergen/emit_ap.go | 51 +- per/pergen/emit_choice.go | 27 +- per/pergen/emit_equal.go | 4 +- per/pergen/emit_struct.go | 10 +- per/pergen/gen.go | 2 +- per/pergen/testdata/ap/fixture.go | 14 +- .../testdata/apbad/choiceraw/fixture.go | 4 +- per/pergen/testdata/apbad/equalref/fixture.go | 6 +- per/pergen/testdata/apbad/extseq/fixture.go | 6 +- .../testdata/apbad/handtable/fixture.go | 8 +- .../testdata/apbad/inlineenum/fixture.go | 6 +- per/reader.go | 11 + s1ap/abstract_syntax_test.go | 12 +- s1ap/asn1_constants_test.go | 263 + s1ap/asn1_spec_test.go | 110 + s1ap/bit_string.go | 102 + s1ap/choice_alternatives_test.go | 375 + s1ap/comparable_test.go | 2 + s1ap/config_transfer.go | 21 +- s1ap/container_lists_test.go | 298 + s1ap/coverage_cases_test.go | 89 + s1ap/coverage_test.go | 211 + s1ap/decode_total_test.go | 6 +- s1ap/diagnostics_bound_test.go | 4 +- s1ap/enb_config_update.go | 15 +- s1ap/enum_all_test.go | 232 + s1ap/enum_encode_test.go | 343 + s1ap/enum_extension_test.go | 6 +- s1ap/enum_names.go | 257 + s1ap/erab_lists.go | 57 +- s1ap/erab_modification.go | 49 +- s1ap/erab_modify.go | 40 +- s1ap/erab_release.go | 44 +- s1ap/erab_release_test.go | 4 +- s1ap/erab_setup.go | 15 +- s1ap/erab_setup_test.go | 2 +- s1ap/errors.go | 17 +- s1ap/extension_criticality_test.go | 5 +- s1ap/extension_typing_test.go | 313 +- s1ap/full_ie_set_test.go | 51 + s1ap/handover_notify.go | 9 + s1ap/handover_preparation.go | 47 +- s1ap/handover_preparation_test.go | 2 +- s1ap/handover_resource_allocation.go | 87 +- s1ap/handover_resource_allocation_test.go | 6 +- s1ap/ie_erab.go | 9 +- s1ap/ie_extension_types.go | 7 +- s1ap/ie_ids.go | 525 +- s1ap/ie_message_types.go | 1463 ++ s1ap/ie_names.go | 525 +- s1ap/ie_pws.go | 30 - s1ap/ie_table.go | 111 +- s1ap/ies.go | 151 +- s1ap/ies_test.go | 12 +- s1ap/initial_context_setup.go | 101 +- s1ap/initial_context_setup_test.go | 14 +- s1ap/item_list_foreign_test.go | 185 + s1ap/location_report.go | 15 +- s1ap/location_report_test.go | 2 +- s1ap/lppa_transport_test.go | 4 +- s1ap/mme_config_update.go | 3 + s1ap/nas_transport.go | 99 +- s1ap/overload.go | 2 +- s1ap/package_decls_test.go | 229 + s1ap/paging.go | 32 +- s1ap/paging_test.go | 26 +- s1ap/path_switch.go | 95 +- s1ap/path_switch_test.go | 2 +- s1ap/pdu.go | 6 +- s1ap/per_gen.go | 11531 +++++++++++----- s1ap/per_test_helpers_test.go | 7 +- s1ap/pws.go | 8 +- s1ap/raw_pdu.go | 42 +- s1ap/raw_pdu_registry_test.go | 24 + s1ap/raw_pdu_test.go | 81 +- s1ap/raw_pdu_ue_ids_test.go | 6 +- s1ap/reset.go | 7 +- s1ap/reset_extensions_test.go | 10 +- s1ap/s1_setup.go | 7 + s1ap/s1_setup_resp.go | 9 +- s1ap/struct_compare_test.go | 107 + s1ap/table_order_test.go | 102 +- .../FuzzERABListRoundTrip/e8cac6a79c81d833 | 3 + s1ap/tnl_lossless_test.go | 13 +- s1ap/transparent_container.go | 6 + s1ap/transparent_container_test.go | 5 +- s1ap/ue_capability.go | 15 +- s1ap/ue_capability_test.go | 10 +- s1ap/ue_context_modification.go | 63 +- s1ap/ue_context_modification_test.go | 2 +- s1ap/ue_context_release.go | 37 +- s1ap/ue_context_release_test.go | 6 +- s1ap/unknown_ie_test.go | 12 +- 300 files changed, 31031 insertions(+), 8935 deletions(-) create mode 100644 internal/decoder/ngap/bit_string_widths_test.go create mode 100644 internal/decoder/ngap/extension_ies_test.go create mode 100644 internal/decoder/ngap/render.go create mode 100644 internal/decoder/ngap/testdata/golden/downlink_nas_transport_extensions.json create mode 100644 internal/decoder/ngap/testdata/golden/initial_context_setup_request_extensions.json create mode 100644 internal/decoder/ngap/testdata/golden/ng_setup_request_extensions.json create mode 100644 internal/decoder/ngap/testdata/golden/paging_extensions.json create mode 100644 internal/decoder/ngap/testdata/golden/pdu_session_resource_setup_request_transfer_extensions.json create mode 100644 internal/decoder/ngap/testdata/golden/ue_context_modification_response_extensions.json create mode 100644 internal/decoder/ngap/testdata/golden/uplink_nas_transport_extensions.json create mode 100644 internal/decoder/ngap/up_tnl_choice_test.go create mode 100644 internal/decoder/s1ap/bit_string_widths_test.go create mode 100644 internal/decoder/s1ap/extension_ies_test.go create mode 100644 internal/decoder/s1ap/render.go create mode 100644 internal/decoder/s1ap/s1_removal.go create mode 100644 internal/decoder/s1ap/testdata/golden/downlink_nas_transport_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/handover_notify_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/initial_ue_message_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/location_report_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/paging_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/s1_removal_failure.json create mode 100644 internal/decoder/s1ap/testdata/golden/s1_removal_request.json create mode 100644 internal/decoder/s1ap/testdata/golden/s1_removal_response.json create mode 100644 internal/decoder/s1ap/testdata/golden/s1_setup_request_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/s1_setup_response_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/ue_context_modification_request_extensions.json create mode 100644 internal/decoder/s1ap/testdata/golden/uplink_nas_transport_extensions.json create mode 100644 internal/decoder/utils/asn1_names.go create mode 100644 internal/decoder/utils/asn1_names_test.go create mode 100644 internal/decoder/utils/render.go create mode 100644 internal/decoder/utils/render_test.go create mode 100644 internal/mme/s1ap/handover_target_test.go create mode 100644 internal/tester/gnb/handover_selected_plmn_test.go create mode 100644 internal/tester/s1enb/handover_selected_plmn_test.go create mode 100644 ngap/asn1_constants_test.go create mode 100644 ngap/choice_alternatives_test.go create mode 100644 ngap/choice_extension_rule_test.go create mode 100644 ngap/engine_regression_test.go create mode 100644 ngap/enum_asn1_test.go delete mode 100644 ngap/ie_extensions.go create mode 100644 ngap/package_decls_test.go create mode 100644 ngap/struct_compare_test.go create mode 100644 ngap/testdata/fuzz/FuzzMessageLossless/aa6d9b4547ed086d create mode 100644 ngap/testdata/fuzz/FuzzMessageLossless/ed8137981a8dffa6 create mode 100644 per/ap/ap.go create mode 100644 per/ap/apimpl/apimpl.go rename per/ap/{ => internal/impl}/container.go (93%) rename per/ap/{ => internal/impl}/criticality.go (98%) rename per/ap/{ => internal/impl}/diagnostics.go (78%) rename per/ap/{ => internal/impl}/errors.go (82%) create mode 100644 per/ap/internal/impl/list.go create mode 100644 per/ap/internal/impl/list_test.go rename per/ap/{ => internal/impl}/message_equal_test.go (81%) rename per/ap/{ => internal/impl}/pdu.go (65%) rename per/ap/{ => internal/impl}/preserved.go (71%) rename per/ap/{ => internal/impl}/profile.go (99%) create mode 100644 per/ap/internal/impl/protocol.go rename per/ap/{ => internal/impl}/raw.go (72%) rename per/ap/{ => internal/impl}/raw_test.go (82%) rename per/ap/{ => internal/impl}/table.go (70%) rename per/ap/{ => internal/impl}/table_test.go (70%) rename per/ap/{ => internal/impl}/transport_layer_address.go (80%) rename per/ap/{ => internal/impl}/transport_layer_address_test.go (88%) create mode 100644 per/charstring_alphabet_test.go create mode 100644 s1ap/asn1_constants_test.go create mode 100644 s1ap/asn1_spec_test.go create mode 100644 s1ap/bit_string.go create mode 100644 s1ap/choice_alternatives_test.go create mode 100644 s1ap/container_lists_test.go create mode 100644 s1ap/coverage_cases_test.go create mode 100644 s1ap/coverage_test.go create mode 100644 s1ap/enum_all_test.go create mode 100644 s1ap/full_ie_set_test.go create mode 100644 s1ap/ie_message_types.go create mode 100644 s1ap/item_list_foreign_test.go create mode 100644 s1ap/package_decls_test.go create mode 100644 s1ap/struct_compare_test.go create mode 100644 s1ap/testdata/fuzz/FuzzERABListRoundTrip/e8cac6a79c81d833 diff --git a/go.mod b/go.mod index 8923a34c4f..2edbd06e98 100644 --- a/go.mod +++ b/go.mod @@ -32,7 +32,6 @@ require ( github.com/songgao/water v0.0.0-20200317203138-2b4b6d7c09d8 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.1.0 - github.com/stretchr/testify v1.12.1 github.com/vishvananda/netlink v1.3.1 go.etcd.io/bbolt v1.5.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 @@ -100,6 +99,7 @@ require ( github.com/spf13/cast v1.7.1 // indirect github.com/spf13/viper v1.20.1 // indirect github.com/stretchr/objx v0.5.3 // indirect + github.com/stretchr/testify v1.12.1 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/vishvananda/netns v0.0.5 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect diff --git a/internal/decoder/ngap/bit_string_widths_test.go b/internal/decoder/ngap/bit_string_widths_test.go new file mode 100644 index 0000000000..a839edc25a --- /dev/null +++ b/internal/decoder/ngap/bit_string_widths_test.go @@ -0,0 +1,138 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "go/ast" + "go/parser" + "go/token" + "path/filepath" + "strconv" + "strings" + "testing" +) + +func TestBitStringWidthsMatchCodec(t *testing.T) { + codec := codecBitStringWidths(t, filepath.Join("..", "..", "..", "ngap")) + if len(codec) == 0 { + t.Fatal("found no fixed-size BIT STRING types in the codec") + } + + rendered := map[string]int{} + for typ, bits := range bitStringWidths { + rendered[typ.Name()] = bits + } + + for name, bits := range codec { + got, ok := rendered[name] + if !ok { + t.Errorf("%s is a %d-bit BIT STRING the decoder would render as an integer", name, bits) + + continue + } + + if got != bits { + t.Errorf("%s: decoder renders %d bits, codec encodes %d", name, got, bits) + } + } +} + +func codecBitStringWidths(t *testing.T, dir string) map[string]int { + t.Helper() + + paths, err := filepath.Glob(filepath.Join(dir, "*.go")) + if err != nil { + t.Fatal(err) + } + + consts := map[string]int{} + + var files []*ast.File + + for _, p := range paths { + if strings.HasSuffix(p, "_test.go") { + continue + } + + f, err := parser.ParseFile(token.NewFileSet(), p, nil, 0) + if err != nil { + t.Fatalf("parse %s: %v", p, err) + } + + files = append(files, f) + + for _, decl := range f.Decls { + gen, ok := decl.(*ast.GenDecl) + if !ok || gen.Tok != token.CONST { + continue + } + + for _, spec := range gen.Specs { + vs := spec.(*ast.ValueSpec) + for i, name := range vs.Names { + if i >= len(vs.Values) { + continue + } + + if lit, ok := vs.Values[i].(*ast.BasicLit); ok && lit.Kind == token.INT { + n, err := strconv.Atoi(lit.Value) + if err == nil { + consts[name.Name] = n + } + } + } + } + } + } + + out := map[string]int{} + + for _, f := range files { + for _, decl := range f.Decls { + fn, ok := decl.(*ast.FuncDecl) + if !ok || fn.Recv == nil || fn.Name.Name != "MarshalPER" || fn.Body == nil { + continue + } + + recv, ok := fn.Recv.List[0].Type.(*ast.Ident) + if !ok { + continue + } + + ast.Inspect(fn.Body, func(n ast.Node) bool { + call, ok := n.(*ast.CallExpr) + if !ok || len(call.Args) != 4 { + return true + } + + if id, ok := call.Fun.(*ast.Ident); !ok || id.Name != "encodeBitStringUint" { + return true + } + + switch w := call.Args[3].(type) { + case *ast.BasicLit: + n, err := strconv.Atoi(w.Value) + if err != nil { + t.Fatalf("%s: width %q: %v", recv.Name, w.Value, err) + } + + out[recv.Name] = n + case *ast.Ident: + n, ok := consts[w.Name] + if !ok { + t.Fatalf("%s: width constant %s not found", recv.Name, w.Name) + } + + out[recv.Name] = n + default: + t.Fatalf("%s: width is not a constant", recv.Name) + } + + return false + }) + } + } + + return out +} diff --git a/internal/decoder/ngap/downlink_nas_transport.go b/internal/decoder/ngap/downlink_nas_transport.go index 5b3b278088..594eafc5a1 100644 --- a/internal/decoder/ngap/downlink_nas_transport.go +++ b/internal/decoder/ngap/downlink_nas_transport.go @@ -10,9 +10,6 @@ import ( ) // Downlink NAS Transport relays a NAS message to the UE (TS 38.413 §9.2.5.1). -// Only this AMF sends it, and only with the three mandatory IEs; the optional -// ones §9.2.5.1 also allows render as preserved-unmodeled if a capture from -// another core carries them. func buildDownlinkNASTransport(value []byte) NGAPMessageValue { m, err := ngap.ParseDownlinkNASTransport(value) if err != nil { @@ -25,5 +22,28 @@ func buildDownlinkNASTransport(value []byte) NGAPMessageValue { ie(ngap.IDNASPDU, ngap.CriticalityReject, libNASPDU(m.NASPDU)), } + ies = appendTyped(ies, []typedIE{ + {ngap.IDOldAMF, ngap.CriticalityReject, m.OldAMF}, + {ngap.IDRANPagingPriority, ngap.CriticalityIgnore, m.RANPagingPriority}, + {ngap.IDMobilityRestrictionList, ngap.CriticalityIgnore, m.MobilityRestrictionList}, + {ngap.IDIndexToRFSP, ngap.CriticalityIgnore, m.IndexToRFSP}, + {ngap.IDUEAggregateMaximumBitRate, ngap.CriticalityIgnore, m.UEAggregateMaximumBitRate}, + {ngap.IDAllowedNSSAI, ngap.CriticalityReject, m.AllowedNSSAI}, + {ngap.IDSRVCCOperationPossible, ngap.CriticalityIgnore, m.SRVCCOperationPossible}, + {ngap.IDEnhancedCoverageRestriction, ngap.CriticalityIgnore, m.EnhancedCoverageRestriction}, + {ngap.IDExtendedConnectedTime, ngap.CriticalityIgnore, m.ExtendedConnectedTime}, + {ngap.IDUEDifferentiationInfo, ngap.CriticalityIgnore, m.UEDifferentiationInfo}, + {ngap.IDCEmodeBrestricted, ngap.CriticalityIgnore, m.CEmodeBrestricted}, + {ngap.IDUERadioCapability, ngap.CriticalityIgnore, m.UERadioCapability}, + {ngap.IDUECapabilityInfoRequest, ngap.CriticalityIgnore, m.UECapabilityInfoRequest}, + {ngap.IDEndIndication, ngap.CriticalityIgnore, m.EndIndication}, + {ngap.IDUERadioCapabilityID, ngap.CriticalityReject, m.UERadioCapabilityID}, + {ngap.IDTargetNSSAIInformation, ngap.CriticalityIgnore, m.TargetNSSAIInformation}, + {ngap.IDMaskedIMEISV, ngap.CriticalityIgnore, m.MaskedIMEISV}, + {ngap.IDPartiallyAllowedNSSAI, ngap.CriticalityIgnore, m.PartiallyAllowedNSSAI}, + {ngap.IDMobileIABAuthorized, ngap.CriticalityIgnore, m.MobileIABAuthorized}, + {ngap.IDExtendedOldAMF, ngap.CriticalityIgnore, m.ExtendedOldAMF}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/extension_ies_test.go b/internal/decoder/ngap/extension_ies_test.go new file mode 100644 index 0000000000..8e796015d2 --- /dev/null +++ b/internal/decoder/ngap/extension_ies_test.go @@ -0,0 +1,170 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/json" + "strings" + "testing" + + lib "github.com/ellanetworks/core/ngap" + "github.com/ellanetworks/core/per/ap" +) + +func extensionIEsCorpus(t *testing.T) map[string][]byte { + t.Helper() + + sidelink := &lib.NRUESidelinkAggregateMaximumBitrate{UESidelinkAggregateMaximumBitRate: 1000000} + diff := &lib.UEDifferentiationInfo{ + PeriodicCommunicationIndicator: lib.Ptr(lib.UEDifferentiationInfoPeriodicCommunicationIndicatorPeriodically), + PeriodicTime: lib.Ptr(lib.UEDifferentiationInfoPeriodicTime(60)), + } + inactive := &lib.CoreNetworkAssistanceInformationForInactive{ + UEIdentityIndexValue: lib.UEIdentityIndexValue{IndexLength10: lib.Ptr(lib.UEIdentityIndexValueIndexLength10(0x155))}, + PeriodicRegistrationUpdateTimer: 0x21, + MICOModeIndication: lib.Ptr(lib.MICOModeIndicationTrue), + TAIListForInactive: lib.TAIListForInactive{{TAI: testTAI}}, + EUTRAPagingeDRXInformation: &lib.EUTRAPagingeDRXInformation{EUTRApagingeDRXCycle: lib.EUTRAPagingeDRXCycleHf2}, + } + + setupTransfer, err := (&lib.PDUSessionResourceSetupRequestTransfer{ + ULNGUUPTNLInformation: lib.UPTransportLayerInformation{GTPTunnel: &lib.GTPTunnel{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), GTPTEID: 0x11}}, + PDUSessionType: lib.PDUSessionTypeIPv4, + QosFlowSetupRequest: lib.QosFlowSetupRequestList{{ + QosFlowIdentifier: 1, + QosFlowLevelQosParameters: lib.QosFlowLevelQosParameters{ + QosCharacteristics: lib.QosCharacteristics{NonDynamic5QI: &lib.NonDynamic5QIDescriptor{FiveQI: 9}}, + AllocationAndRetentionPriority: lib.AllocationAndRetentionPriority{PriorityLevelARP: 8}, + }, + }}, + CommonNetworkInstance: lib.CommonNetworkInstance{0x69, 0x6e}, + RedundantPDUSessionInformation: &lib.RedundantPDUSessionInformation{RSN: lib.RSNV2}, + }).Marshal() + if err != nil { + t.Fatalf("build setup transfer: %v", err) + } + + return map[string][]byte{ + "downlink_nas_transport_extensions": mustMarshal(t, &lib.DownlinkNASTransport{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + NASPDU: lib.NASPDU{0x7e, 0x00, 0x44}, + OldAMF: lib.Ptr(lib.Name("amf-old")), + RANPagingPriority: lib.Ptr(lib.RANPagingPriority(3)), + IndexToRFSP: lib.Ptr(lib.IndexToRFSP(7)), + UEAggregateMaximumBitRate: &lib.UEAggregateMaximumBitRate{DL: 2000, UL: 1000}, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + SRVCCOperationPossible: lib.Ptr(lib.SRVCCOperationPossiblePossible), + UEDifferentiationInfo: diff, + EndIndication: lib.Ptr(lib.EndIndicationNoFurtherData), + UERadioCapabilityID: lib.Ptr(lib.UERadioCapabilityID{0xca, 0xfe}), + MaskedIMEISV: lib.Ptr(lib.MaskedIMEISV(0x0123456789abcdef)), + PartiallyAllowedNSSAI: lib.PartiallyAllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 2}}}, + }), + "initial_context_setup_request_extensions": mustMarshal(t, &lib.InitialContextSetupRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + GUAMI: lib.GUAMI{PLMNIdentity: testPLMN, AMFRegionID: 2, AMFSetID: 1}, + AllowedNSSAI: lib.AllowedNSSAI{{SNSSAI: lib.SNSSAI{SST: 1}}}, + UESecurityCapabilities: lib.UESecurityCapabilities{ + NREncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), NRIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), + EUTRAEncryptionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), EUTRAIntegrityProtectionAlgorithms: lib.SecurityAlgorithmsFrom(0xc000), + }, + CoreNetworkAssistanceInformationForInactive: inactive, + NRV2XServicesAuthorized: &lib.NRV2XServicesAuthorized{VehicleUE: lib.Ptr(lib.VehicleUEAuthorized)}, + NRUESidelinkAggregateMaximumBitrate: sidelink, + ManagementBasedMDTPLMNList: lib.MDTPLMNList{testPLMN}, + UESliceMaximumBitRateList: lib.UESliceMaximumBitRateList{{SNSSAI: lib.SNSSAI{SST: 1}, UESliceMaximumBitRateDL: 300, UESliceMaximumBitRateUL: 200}}, + FiveGProSeUEPC5AggregateMaximumBitRate: sidelink, + }), + "pdu_session_resource_setup_request_transfer_extensions": mustMarshal(t, &lib.PDUSessionResourceSetupRequest{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + RANPagingPriority: lib.Ptr(lib.RANPagingPriority(1)), + PDUSessionResourceSetup: lib.PDUSessionResourceSetupListSUReq{{ + PDUSessionID: 1, + SNSSAI: lib.SNSSAI{SST: 1}, + Transfer: setupTransfer, + }}, + }), + "ng_setup_request_extensions": mustMarshal(t, &lib.NGSetupRequest{ + GlobalRANNodeID: lib.NewGlobalGNBID(testPLMN, 1, 22), + SupportedTAList: lib.SupportedTAList{{TAC: 1, BroadcastPLMNList: lib.BroadcastPLMNList{{PLMNIdentity: testPLMN, TAISliceSupportList: lib.SliceSupportList{{SNSSAI: lib.SNSSAI{SST: 1}}}}}}}, + DefaultPagingDRX: lib.Ptr(lib.PagingDRXv128), + ExtendedRANNodeName: &lib.ExtendedRANNodeName{RANNodeNameVisibleString: lib.Ptr(lib.RANNodeNameVisibleString("gnb-ext"))}, + NBIoTDefaultPagingDRX: lib.Ptr(lib.NBIoTDefaultPagingDRXRf256), + }), + "paging_extensions": mustMarshal(t, &lib.Paging{ + UEPagingIdentity: &lib.UEPagingIdentity{FiveGSTMSI: &lib.FiveGSTMSI{AMFSetID: 1, AMFPointer: 2, FiveGTMSI: 0x01020304}}, + TAIListForPaging: lib.TAIListForPaging{{TAI: testTAI}}, + PagingCause: lib.Ptr(lib.PagingCauseVoice), + }), + "ue_context_modification_response_extensions": mustMarshal(t, &lib.UEContextModificationResponse{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(7)), + RANUENGAPID: lib.Ptr(lib.RANUENGAPID(3)), + RRCState: lib.Ptr(lib.RRCStateConnected), + }), + "uplink_nas_transport_extensions": mustMarshal(t, &lib.UplinkNASTransport{ + AMFUENGAPID: 1, + RANUENGAPID: 2, + NASPDU: lib.NASPDU{0x7e, 0x00, 0x43}, + UserLocationInformation: &lib.UserLocationInformation{NR: &lib.UserLocationInformationNR{NRCGI: lib.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: 0x10}, TAI: testTAI}}, + TNGFIdentityInformation: lib.Ptr(lib.IdentityInformation{0x01, 0x02}), + }), + } +} + +func TestExtensionIEsRendered(t *testing.T) { + for name, raw := range extensionIEsCorpus(t) { + t.Run(name, func(t *testing.T) { + msg := DecodeNGAPMessage(raw) + if msg.Value.Error != "" { + t.Fatalf("decode error: %s", msg.Value.Error) + } + + pdu, err := lib.ParseRawPDU(raw) + if err != nil { + t.Fatal(err) + } + + wire := pdu.IEs() + if len(wire) != len(msg.Value.IEs) { + t.Fatalf("rendered %d IEs, want the %d on the wire", len(msg.Value.IEs), len(wire)) + } + + for i, w := range wire { + got := msg.Value.IEs[i] + if got.ID.Value != int64(w.ID) { + t.Errorf("IE %d = %d, want %d in wire order", i, got.ID.Value, w.ID) + } + + if got.ID.Unknown { + t.Errorf("IE %d rendered as unknown", got.ID.Value) + } + + if _, raw := got.Value.(rawIEValue); raw { + t.Errorf("IE %s rendered as unmodeled", got.ID.Label) + } + } + }) + } +} + +func TestTransferExtensionsRendered(t *testing.T) { + msg := DecodeNGAPMessage(extensionIEsCorpus(t)["pdu_session_resource_setup_request_transfer_extensions"]) + + b, err := json.Marshal(msg) + if err != nil { + t.Fatal(err) + } + + for _, want := range []string{ + `"common_network_instance":{"hex":"696e"}`, + `"redundant_pdu_session_information":{"rsn":{"type":"enum","value":1,"label":"v2","unknown":false}}`, + } { + if !strings.Contains(string(b), want) { + t.Errorf("rendered transfer lacks %s:\n%s", want, b) + } + } +} diff --git a/internal/decoder/ngap/golden_test.go b/internal/decoder/ngap/golden_test.go index 9e78150267..6b448d2838 100644 --- a/internal/decoder/ngap/golden_test.go +++ b/internal/decoder/ngap/golden_test.go @@ -579,6 +579,10 @@ func goldenCorpus(t *testing.T) map[string][]byte { corpus[name] = b } + for name, b := range extensionIEsCorpus(t) { + corpus[name] = b + } + return corpus } diff --git a/internal/decoder/ngap/handover.go b/internal/decoder/ngap/handover.go index 2f47546b67..9c4ba4d38d 100644 --- a/internal/decoder/ngap/handover.go +++ b/internal/decoder/ngap/handover.go @@ -607,6 +607,44 @@ func buildHandoverRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDTargetRANNodeID, ngap.CriticalityIgnore, buildGlobalRANNodeID(*m.TargetRANNodeID))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDCoreNetworkAssistanceInformationForInactive, ngap.CriticalityIgnore, m.CoreNetworkAssistanceInformationForInactive}, + {ngap.IDMaskedIMEISV, ngap.CriticalityIgnore, m.MaskedIMEISV}, + {ngap.IDLocationReportingRequestType, ngap.CriticalityIgnore, m.LocationReportingRequestType}, + {ngap.IDRRCInactiveTransitionReportRequest, ngap.CriticalityIgnore, m.RRCInactiveTransitionReportRequest}, + {ngap.IDRedirectionVoiceFallback, ngap.CriticalityIgnore, m.RedirectionVoiceFallback}, + {ngap.IDCNAssistedRANTuning, ngap.CriticalityIgnore, m.CNAssistedRANTuning}, + {ngap.IDSRVCCOperationPossible, ngap.CriticalityIgnore, m.SRVCCOperationPossible}, + {ngap.IDIABAuthorized, ngap.CriticalityReject, m.IABAuthorized}, + {ngap.IDEnhancedCoverageRestriction, ngap.CriticalityIgnore, m.EnhancedCoverageRestriction}, + {ngap.IDUEDifferentiationInfo, ngap.CriticalityIgnore, m.UEDifferentiationInfo}, + {ngap.IDNRV2XServicesAuthorized, ngap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {ngap.IDLTEV2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEV2XServicesAuthorized}, + {ngap.IDNRUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {ngap.IDLTEUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.LTEUESidelinkAggregateMaximumBitrate}, + {ngap.IDPC5QoSParameters, ngap.CriticalityIgnore, m.PC5QoSParameters}, + {ngap.IDCEmodeBrestricted, ngap.CriticalityIgnore, m.CEmodeBrestricted}, + {ngap.IDUEUPCIoTSupport, ngap.CriticalityIgnore, m.UEUPCIoTSupport}, + {ngap.IDManagementBasedMDTPLMNList, ngap.CriticalityIgnore, m.ManagementBasedMDTPLMNList}, + {ngap.IDUERadioCapabilityID, ngap.CriticalityReject, m.UERadioCapabilityID}, + {ngap.IDExtendedConnectedTime, ngap.CriticalityIgnore, m.ExtendedConnectedTime}, + {ngap.IDTimeSyncAssistanceInfo, ngap.CriticalityIgnore, m.TimeSyncAssistanceInfo}, + {ngap.IDUESliceMaximumBitRateList, ngap.CriticalityIgnore, m.UESliceMaximumBitRateList}, + {ngap.IDFiveGProSeAuthorized, ngap.CriticalityIgnore, m.FiveGProSeAuthorized}, + {ngap.IDFiveGProSeUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.FiveGProSeUEPC5AggregateMaximumBitRate}, + {ngap.IDFiveGProSePC5QoSParameters, ngap.CriticalityIgnore, m.FiveGProSePC5QoSParameters}, + {ngap.IDAerialUEsubscriptionInformation, ngap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {ngap.IDNRA2XServicesAuthorized, ngap.CriticalityIgnore, m.NRA2XServicesAuthorized}, + {ngap.IDLTEA2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEA2XServicesAuthorized}, + {ngap.IDNRA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.NRA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDLTEA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.LTEA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDA2XPC5QoSParameters, ngap.CriticalityIgnore, m.A2XPC5QoSParameters}, + {ngap.IDMobileIABAuthorized, ngap.CriticalityIgnore, m.MobileIABAuthorized}, + {ngap.IDNoPDUSessionIndication, ngap.CriticalityIgnore, m.NoPDUSessionIndication}, + {ngap.IDPartiallyAllowedNSSAI, ngap.CriticalityIgnore, m.PartiallyAllowedNSSAI}, + {ngap.IDSLPositioningRangingServiceInfo, ngap.CriticalityIgnore, m.SLPositioningRangingServiceInfo}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } @@ -650,6 +688,12 @@ func buildHandoverRequestAcknowledge(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDCriticalityDiagnostics, ngap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDNPNAccessInformation, ngap.CriticalityReject, m.NPNAccessInformation}, + {ngap.IDRedCapIndication, ngap.CriticalityIgnore, m.RedCapIndication}, + {ngap.IDERedCapIndication, ngap.CriticalityIgnore, m.ERedCapIndication}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/initial_context_setup_request.go b/internal/decoder/ngap/initial_context_setup_request.go index acf3bf313b..098de5ee81 100644 --- a/internal/decoder/ngap/initial_context_setup_request.go +++ b/internal/decoder/ngap/initial_context_setup_request.go @@ -5,6 +5,7 @@ package ngap import ( "encoding/hex" + "encoding/json" "fmt" "github.com/ellanetworks/core/internal/decoder/rrc" @@ -55,6 +56,18 @@ type MaximumBitRate struct { type GTPTunnel struct { GTPTEID uint32 `json:"gtp_teid"` TransportLayerAddress string `json:"transport_layer_address"` + + alternative any +} + +func (g GTPTunnel) MarshalJSON() ([]byte, error) { + if g.alternative != nil { + return json.Marshal(g.alternative) + } + + type plain GTPTunnel + + return json.Marshal(plain(g)) } type ULNGUUPTNLInformation struct { @@ -98,6 +111,11 @@ type PDUSessionResourceSetupRequestTransfer struct { NetworkInstance *uint16 `json:"network_instance,omitempty"` RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` AdditionalRedundantULNGUUPTNLInformation []GTPTunnel `json:"additional_redundant_ul_ng_u_up_tnl_information,omitempty"` + RedundantPDUSessionInformation any `json:"redundant_pdu_session_information,omitempty"` + CommonNetworkInstance any `json:"common_network_instance,omitempty"` + RedundantCommonNetworkInstance any `json:"redundant_common_network_instance,omitempty"` + DownlinkTLContainer any `json:"downlink_tl_container,omitempty"` + MBSSessionSetupRequestList any `json:"mbs_session_setup_request_list,omitempty"` UnrecognizedIEs []IE `json:"unrecognized_ies,omitempty"` } @@ -118,10 +136,7 @@ type UESecurityCapabilities struct { } // Initial Context Setup Request establishes the UE context on the NG-RAN node, -// optionally setting up PDU sessions with it (TS 38.413 §9.2.2.1). The optional -// IEs §9.2.2.1 also allows and this AMF never sends — Old AMF, Core Network -// Assistance Information, Mobility Restriction List, Index to RFSP — render as -// preserved-unmodeled if a capture from another core carries them. +// optionally setting up PDU sessions with it (TS 38.413 §9.2.2.1). func buildInitialContextSetupRequest(value []byte) NGAPMessageValue { m, err := ngap.ParseInitialContextSetupRequest(value) if err != nil { @@ -208,6 +223,51 @@ func buildInitialContextSetupRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDAMFUENGAPID2, ngap.CriticalityIgnore, int64(*m.AMFUENGAPID2))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDOldAMF, ngap.CriticalityReject, m.OldAMF}, + {ngap.IDCoreNetworkAssistanceInformationForInactive, ngap.CriticalityIgnore, m.CoreNetworkAssistanceInformationForInactive}, + {ngap.IDIndexToRFSP, ngap.CriticalityIgnore, m.IndexToRFSP}, + {ngap.IDMaskedIMEISV, ngap.CriticalityIgnore, m.MaskedIMEISV}, + {ngap.IDEmergencyFallbackIndicator, ngap.CriticalityReject, m.EmergencyFallbackIndicator}, + {ngap.IDRRCInactiveTransitionReportRequest, ngap.CriticalityIgnore, m.RRCInactiveTransitionReportRequest}, + {ngap.IDRedirectionVoiceFallback, ngap.CriticalityIgnore, m.RedirectionVoiceFallback}, + {ngap.IDLocationReportingRequestType, ngap.CriticalityIgnore, m.LocationReportingRequestType}, + {ngap.IDCNAssistedRANTuning, ngap.CriticalityIgnore, m.CNAssistedRANTuning}, + {ngap.IDSRVCCOperationPossible, ngap.CriticalityIgnore, m.SRVCCOperationPossible}, + {ngap.IDIABAuthorized, ngap.CriticalityIgnore, m.IABAuthorized}, + {ngap.IDEnhancedCoverageRestriction, ngap.CriticalityIgnore, m.EnhancedCoverageRestriction}, + {ngap.IDExtendedConnectedTime, ngap.CriticalityIgnore, m.ExtendedConnectedTime}, + {ngap.IDUEDifferentiationInfo, ngap.CriticalityIgnore, m.UEDifferentiationInfo}, + {ngap.IDNRV2XServicesAuthorized, ngap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {ngap.IDLTEV2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEV2XServicesAuthorized}, + {ngap.IDNRUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {ngap.IDLTEUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.LTEUESidelinkAggregateMaximumBitrate}, + {ngap.IDPC5QoSParameters, ngap.CriticalityIgnore, m.PC5QoSParameters}, + {ngap.IDCEmodeBrestricted, ngap.CriticalityIgnore, m.CEmodeBrestricted}, + {ngap.IDUEUPCIoTSupport, ngap.CriticalityIgnore, m.UEUPCIoTSupport}, + {ngap.IDRGLevelWirelineAccessCharacteristics, ngap.CriticalityIgnore, m.RGLevelWirelineAccessCharacteristics}, + {ngap.IDManagementBasedMDTPLMNList, ngap.CriticalityIgnore, m.ManagementBasedMDTPLMNList}, + {ngap.IDUERadioCapabilityID, ngap.CriticalityReject, m.UERadioCapabilityID}, + {ngap.IDTimeSyncAssistanceInfo, ngap.CriticalityIgnore, m.TimeSyncAssistanceInfo}, + {ngap.IDQMCConfigInfo, ngap.CriticalityIgnore, m.QMCConfigInfo}, + {ngap.IDTargetNSSAIInformation, ngap.CriticalityIgnore, m.TargetNSSAIInformation}, + {ngap.IDUESliceMaximumBitRateList, ngap.CriticalityIgnore, m.UESliceMaximumBitRateList}, + {ngap.IDFiveGProSeAuthorized, ngap.CriticalityIgnore, m.FiveGProSeAuthorized}, + {ngap.IDFiveGProSeUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.FiveGProSeUEPC5AggregateMaximumBitRate}, + {ngap.IDFiveGProSePC5QoSParameters, ngap.CriticalityIgnore, m.FiveGProSePC5QoSParameters}, + {ngap.IDNetworkControlledRepeaterAuthorized, ngap.CriticalityIgnore, m.NetworkControlledRepeaterAuthorized}, + {ngap.IDAerialUEsubscriptionInformation, ngap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {ngap.IDNRA2XServicesAuthorized, ngap.CriticalityIgnore, m.NRA2XServicesAuthorized}, + {ngap.IDLTEA2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEA2XServicesAuthorized}, + {ngap.IDNRA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.NRA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDLTEA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.LTEA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDA2XPC5QoSParameters, ngap.CriticalityIgnore, m.A2XPC5QoSParameters}, + {ngap.IDMobileIABAuthorized, ngap.CriticalityIgnore, m.MobileIABAuthorized}, + {ngap.IDPartiallyAllowedNSSAI, ngap.CriticalityIgnore, m.PartiallyAllowedNSSAI}, + {ngap.IDSLPositioningRangingServiceInfo, ngap.CriticalityIgnore, m.SLPositioningRangingServiceInfo}, + {ngap.IDExtendedOldAMF, ngap.CriticalityIgnore, m.ExtendedOldAMF}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/initial_ue_message.go b/internal/decoder/ngap/initial_ue_message.go index e9c8c87a22..7a4e9f9249 100644 --- a/internal/decoder/ngap/initial_ue_message.go +++ b/internal/decoder/ngap/initial_ue_message.go @@ -119,6 +119,23 @@ func buildInitialUEMessage(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDRequestedNSSAI, ngap.CriticalityIgnore, slices)) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDSourceToTargetAMFInformationReroute, ngap.CriticalityIgnore, m.SourceToTargetAMFInformationReroute}, + {ngap.IDSelectedPLMNIdentity, ngap.CriticalityIgnore, m.SelectedPLMNIdentity}, + {ngap.IDIABNodeIndication, ngap.CriticalityReject, m.IABNodeIndication}, + {ngap.IDCEmodeBSupportIndicator, ngap.CriticalityReject, m.CEmodeBSupportIndicator}, + {ngap.IDLTEMIndication, ngap.CriticalityIgnore, m.LTEMIndication}, + {ngap.IDEDTSession, ngap.CriticalityIgnore, m.EDTSession}, + {ngap.IDAuthenticatedIndication, ngap.CriticalityIgnore, m.AuthenticatedIndication}, + {ngap.IDNPNAccessInformation, ngap.CriticalityReject, m.NPNAccessInformation}, + {ngap.IDRedCapIndication, ngap.CriticalityIgnore, m.RedCapIndication}, + {ngap.IDSelectedNID, ngap.CriticalityIgnore, m.SelectedNID}, + {ngap.IDMobileIABNodeIndication, ngap.CriticalityReject, m.MobileIABNodeIndication}, + {ngap.IDPartiallyAllowedNSSAI, ngap.CriticalityIgnore, m.PartiallyAllowedNSSAI}, + {ngap.IDERedCapIndication, ngap.CriticalityIgnore, m.ERedCapIndication}, + {ngap.IDAUN3DeviceAccessInfo, ngap.CriticalityIgnore, m.AUN3DeviceAccessInfo}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/ng_setup.go b/internal/decoder/ngap/ng_setup.go index ff8636dcf2..a628b52ee0 100644 --- a/internal/decoder/ngap/ng_setup.go +++ b/internal/decoder/ngap/ng_setup.go @@ -146,6 +146,13 @@ func buildNGSetupRequest(value []byte) NGAPMessageValue { buildUERetention(*req.UERetentionInformation))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDNBIoTDefaultPagingDRX, ngap.CriticalityIgnore, req.NBIoTDefaultPagingDRX}, + {ngap.IDExtendedRANNodeName, ngap.CriticalityIgnore, req.ExtendedRANNodeName}, + {ngap.IDAIoTSupport, ngap.CriticalityReject, req.AIoTSupport}, + {ngap.IDAdditionalULI, ngap.CriticalityIgnore, req.AdditionalULI}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(req.UnknownIEs())...)} } @@ -245,6 +252,13 @@ func buildNGSetupResponse(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDExtendedAMFName, ngap.CriticalityIgnore, extendedAMFName(*resp.ExtendedAMFName))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDIABSupported, ngap.CriticalityIgnore, resp.IABSupported}, + {ngap.IDMobileIABSupported, ngap.CriticalityIgnore, resp.MobileIABSupported}, + {ngap.IDAIOTFIdentifier, ngap.CriticalityReject, resp.AIOTFIdentifier}, + {ngap.IDAIOTFName, ngap.CriticalityReject, resp.AIOTFName}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(resp.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/ngap.go b/internal/decoder/ngap/ngap.go index 7e96da347e..4b8f6e9647 100644 --- a/internal/decoder/ngap/ngap.go +++ b/internal/decoder/ngap/ngap.go @@ -65,6 +65,7 @@ func DecodeNGAPMessage(raw []byte) NGAPMessage { } } + msg.Value.IEs = wireOrder(raw, msg.Value.IEs) msg.Summary = buildNGAPSummary(msg) return msg diff --git a/internal/decoder/ngap/paging.go b/internal/decoder/ngap/paging.go index 5340c5958c..ac82172376 100644 --- a/internal/decoder/ngap/paging.go +++ b/internal/decoder/ngap/paging.go @@ -58,6 +58,21 @@ func buildPaging(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDPagingOrigin, ngap.CriticalityIgnore, utils.NamedEnum(uint8(o), o.Name()))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDAssistanceDataForPaging, ngap.CriticalityIgnore, m.AssistanceDataForPaging}, + {ngap.IDNBIoTPagingeDRXInfo, ngap.CriticalityIgnore, m.NBIoTPagingeDRXInfo}, + {ngap.IDNBIoTPagingDRX, ngap.CriticalityIgnore, m.NBIoTPagingDRX}, + {ngap.IDEnhancedCoverageRestriction, ngap.CriticalityIgnore, m.EnhancedCoverageRestriction}, + {ngap.IDWUSAssistanceInformation, ngap.CriticalityIgnore, m.WUSAssistanceInformation}, + {ngap.IDEUTRAPagingeDRXInformation, ngap.CriticalityIgnore, m.EUTRAPagingeDRXInformation}, + {ngap.IDCEmodeBrestricted, ngap.CriticalityIgnore, m.CEmodeBrestricted}, + {ngap.IDNRPagingeDRXInformation, ngap.CriticalityIgnore, m.NRPagingeDRXInformation}, + {ngap.IDPagingCause, ngap.CriticalityIgnore, m.PagingCause}, + {ngap.IDPEIPSassistanceInformation, ngap.CriticalityIgnore, m.PEIPSassistanceInformation}, + {ngap.IDLPWUSPSAssistanceInformation, ngap.CriticalityIgnore, m.LPWUSPSAssistanceInformation}, + {ngap.IDLPWUSDisableIndication, ngap.CriticalityIgnore, m.LPWUSDisableIndication}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/path_switch.go b/internal/decoder/ngap/path_switch.go index 7089623edd..07cab68ae2 100644 --- a/internal/decoder/ngap/path_switch.go +++ b/internal/decoder/ngap/path_switch.go @@ -220,6 +220,12 @@ func buildPathSwitchRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDSourceAMFGUAMI, ngap.CriticalityIgnore, guami(*m.SourceAMFGUAMI))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDRRCResumeCause, ngap.CriticalityIgnore, m.RRCResumeCause}, + {ngap.IDRedCapIndication, ngap.CriticalityIgnore, m.RedCapIndication}, + {ngap.IDERedCapIndication, ngap.CriticalityIgnore, m.ERedCapIndication}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } @@ -285,6 +291,42 @@ func buildPathSwitchRequestAcknowledge(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDAMFUENGAPID2, ngap.CriticalityIgnore, int64(*m.AMFUENGAPID2))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDNewSecurityContextInd, ngap.CriticalityReject, m.NewSecurityContextInd}, + {ngap.IDCoreNetworkAssistanceInformationForInactive, ngap.CriticalityIgnore, m.CoreNetworkAssistanceInformationForInactive}, + {ngap.IDRRCInactiveTransitionReportRequest, ngap.CriticalityIgnore, m.RRCInactiveTransitionReportRequest}, + {ngap.IDRedirectionVoiceFallback, ngap.CriticalityIgnore, m.RedirectionVoiceFallback}, + {ngap.IDCNAssistedRANTuning, ngap.CriticalityIgnore, m.CNAssistedRANTuning}, + {ngap.IDSRVCCOperationPossible, ngap.CriticalityIgnore, m.SRVCCOperationPossible}, + {ngap.IDEnhancedCoverageRestriction, ngap.CriticalityIgnore, m.EnhancedCoverageRestriction}, + {ngap.IDExtendedConnectedTime, ngap.CriticalityIgnore, m.ExtendedConnectedTime}, + {ngap.IDUEDifferentiationInfo, ngap.CriticalityIgnore, m.UEDifferentiationInfo}, + {ngap.IDNRV2XServicesAuthorized, ngap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {ngap.IDLTEV2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEV2XServicesAuthorized}, + {ngap.IDNRUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {ngap.IDLTEUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.LTEUESidelinkAggregateMaximumBitrate}, + {ngap.IDPC5QoSParameters, ngap.CriticalityIgnore, m.PC5QoSParameters}, + {ngap.IDCEmodeBrestricted, ngap.CriticalityIgnore, m.CEmodeBrestricted}, + {ngap.IDUEUPCIoTSupport, ngap.CriticalityIgnore, m.UEUPCIoTSupport}, + {ngap.IDUERadioCapabilityID, ngap.CriticalityReject, m.UERadioCapabilityID}, + {ngap.IDManagementBasedMDTPLMNList, ngap.CriticalityIgnore, m.ManagementBasedMDTPLMNList}, + {ngap.IDTimeSyncAssistanceInfo, ngap.CriticalityIgnore, m.TimeSyncAssistanceInfo}, + {ngap.IDFiveGProSeAuthorized, ngap.CriticalityIgnore, m.FiveGProSeAuthorized}, + {ngap.IDFiveGProSeUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.FiveGProSeUEPC5AggregateMaximumBitRate}, + {ngap.IDFiveGProSePC5QoSParameters, ngap.CriticalityIgnore, m.FiveGProSePC5QoSParameters}, + {ngap.IDManagementBasedMDTPLMNModificationList, ngap.CriticalityIgnore, m.ManagementBasedMDTPLMNModificationList}, + {ngap.IDIABAuthorized, ngap.CriticalityIgnore, m.IABAuthorized}, + {ngap.IDAerialUEsubscriptionInformation, ngap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {ngap.IDNRA2XServicesAuthorized, ngap.CriticalityIgnore, m.NRA2XServicesAuthorized}, + {ngap.IDLTEA2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEA2XServicesAuthorized}, + {ngap.IDNRA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.NRA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDLTEA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.LTEA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDA2XPC5QoSParameters, ngap.CriticalityIgnore, m.A2XPC5QoSParameters}, + {ngap.IDMobileIABAuthorized, ngap.CriticalityIgnore, m.MobileIABAuthorized}, + {ngap.IDPartiallyAllowedNSSAI, ngap.CriticalityIgnore, m.PartiallyAllowedNSSAI}, + {ngap.IDSLPositioningRangingServiceInfo, ngap.CriticalityIgnore, m.SLPositioningRangingServiceInfo}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/pdu_session_resource_modify.go b/internal/decoder/ngap/pdu_session_resource_modify.go index 01bb62bc5b..27830c88a7 100644 --- a/internal/decoder/ngap/pdu_session_resource_modify.go +++ b/internal/decoder/ngap/pdu_session_resource_modify.go @@ -67,6 +67,11 @@ type PDUSessionResourceModifyRequestTransferDecoded struct { AdditionalRedundantULNGUUPTNLInformation []GTPTunnel `json:"additional_redundant_ul_ng_u_up_tnl_information,omitempty"` RedundantULNGUUPTNLInformation *GTPTunnel `json:"redundant_ul_ng_u_up_tnl_information,omitempty"` UserPlaneFailureIndication *UserPlaneFailureIndication `json:"user_plane_failure_indication,omitempty"` + SecurityIndication *SecurityIndication `json:"security_indication,omitempty"` + CommonNetworkInstance any `json:"common_network_instance,omitempty"` + RedundantCommonNetworkInstance any `json:"redundant_common_network_instance,omitempty"` + MBSSessionSetuporModifyRequestList any `json:"mbs_session_setupor_modify_request_list,omitempty"` + MBSSessionToReleaseList any `json:"mbs_session_to_release_list,omitempty"` } // PDUSessionResourceModifyResponseTransferDecoded is what the RAN reports back @@ -216,6 +221,12 @@ func libPDUSessionResourceModifyRequestTransfer(raw ngap.TransferContainer) (any } } + out.SecurityIndication = securityIndication(t.SecurityIndication) + out.CommonNetworkInstance = renderPresent(t.CommonNetworkInstance) + out.RedundantCommonNetworkInstance = renderPresent(t.RedundantCommonNetworkInstance) + out.MBSSessionSetuporModifyRequestList = renderPresent(t.MBSSessionSetuporModifyRequestList) + out.MBSSessionToReleaseList = renderPresent(t.MBSSessionToReleaseList) + return out, nil } @@ -371,6 +382,10 @@ func buildPDUSessionResourceModifyRequest(value []byte) NGAPMessageValue { ie(ngap.IDPDUSessionResourceModifyListModReq, ngap.CriticalityReject, sessions), } + ies = appendTyped(ies, []typedIE{ + {ngap.IDRANPagingPriority, ngap.CriticalityIgnore, m.RANPagingPriority}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/pdu_session_resource_release_command.go b/internal/decoder/ngap/pdu_session_resource_release_command.go index 72f4fa7d3a..24be5f57f9 100644 --- a/internal/decoder/ngap/pdu_session_resource_release_command.go +++ b/internal/decoder/ngap/pdu_session_resource_release_command.go @@ -58,5 +58,9 @@ func buildPDUSessionResourceReleaseCommand(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDPDUSessionResourceToReleaseListRelCmd, ngap.CriticalityReject, out)) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDRANPagingPriority, ngap.CriticalityIgnore, m.RANPagingPriority}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/pdu_session_resource_setup_request.go b/internal/decoder/ngap/pdu_session_resource_setup_request.go index b2c6169bed..afa9678f1e 100644 --- a/internal/decoder/ngap/pdu_session_resource_setup_request.go +++ b/internal/decoder/ngap/pdu_session_resource_setup_request.go @@ -69,5 +69,10 @@ func buildPDUSessionResourceSetupRequest(value []byte) NGAPMessageValue { })) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDRANPagingPriority, ngap.CriticalityIgnore, m.RANPagingPriority}, + {ngap.IDUESliceMaximumBitRateList, ngap.CriticalityIgnore, m.UESliceMaximumBitRateList}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/pdu_session_resource_setup_response.go b/internal/decoder/ngap/pdu_session_resource_setup_response.go index 1f21f2754a..e143fcb554 100644 --- a/internal/decoder/ngap/pdu_session_resource_setup_response.go +++ b/internal/decoder/ngap/pdu_session_resource_setup_response.go @@ -74,7 +74,7 @@ func buildPDUSessionResourceSetupResponse(value []byte) NGAPMessageValue { for _, item := range m.PDUSessionResourceSetup { entry := PDUSessionResourceSetupSURes{PDUSessionID: int64(item.PDUSessionID)} - transfer, err := ngap.ParsePDUSessionResourceSetupResponseTransfer(item.Transfer) + transfer, err := ngap.DecodePDUSessionResourceSetupResponseTransfer(item.Transfer) if err != nil { entry.Error = fmt.Sprintf("failed to decode response transfer: %v", err) } else { @@ -93,7 +93,7 @@ func buildPDUSessionResourceSetupResponse(value []byte) NGAPMessageValue { for _, item := range m.PDUSessionResourceFailed { entry := PDUSessionResourceFailedToSetupSURes{PDUSessionID: int64(item.PDUSessionID)} - transfer, err := ngap.ParsePDUSessionResourceSetupUnsuccessfulTransfer(item.Transfer) + transfer, err := ngap.DecodePDUSessionResourceSetupUnsuccessfulTransfer(item.Transfer) if err != nil { entry.Error = fmt.Sprintf("failed to decode unsuccessful transfer: %v", err) } else { @@ -159,9 +159,13 @@ func libSetupResponseTransfer(t *ngap.PDUSessionResourceSetupResponseTransfer) * return out } -// libGTPTunnel renders the only UPTransportLayerInformation alternative the -// library models; the CHOICE is closed by choice-Extensions (TS 38.413 §9.3.2.1). +// libGTPTunnel renders the GTP tunnel alternative of UPTransportLayerInformation; +// any other alternative is rendered as the CHOICE itself (TS 38.413 §9.3.2.1). func libGTPTunnel(u ngap.UPTransportLayerInformation) GTPTunnel { + if u.GTPTunnel == nil { + return GTPTunnel{alternative: render(u)} + } + return GTPTunnel{ GTPTEID: uint32(u.GTPTunnel.GTPTEID), TransportLayerAddress: transportLayerAddressToString(u.GTPTunnel.TransportLayerAddress), diff --git a/internal/decoder/ngap/pdu_session_transfer.go b/internal/decoder/ngap/pdu_session_transfer.go index a18c647d6a..a1fb1ef428 100644 --- a/internal/decoder/ngap/pdu_session_transfer.go +++ b/internal/decoder/ngap/pdu_session_transfer.go @@ -59,6 +59,11 @@ func libPDUSessionResourceSetupRequestTransfer(raw ngap.TransferContainer) (*PDU out.RedundantULNGUUPTNLInformation = optionalGTPTunnel(t.RedundantULNGUUPTNLInformation) out.AdditionalRedundantULNGUUPTNLInformation = gtpTunnelList(t.AdditionalRedundantULNGUUPTNLInformation) + out.RedundantPDUSessionInformation = renderPresent(t.RedundantPDUSessionInformation) + out.CommonNetworkInstance = renderPresent(t.CommonNetworkInstance) + out.RedundantCommonNetworkInstance = renderPresent(t.RedundantCommonNetworkInstance) + out.DownlinkTLContainer = renderPresent(t.DownlinkTLContainer) + out.MBSSessionSetupRequestList = renderPresent(t.MBSSessionSetupRequestList) out.UnrecognizedIEs = unmodeledIEs(t.UnknownIEs()) return out, nil diff --git a/internal/decoder/ngap/ran_configuration_update.go b/internal/decoder/ngap/ran_configuration_update.go index 3132373954..823d552069 100644 --- a/internal/decoder/ngap/ran_configuration_update.go +++ b/internal/decoder/ngap/ran_configuration_update.go @@ -66,6 +66,13 @@ func buildRANConfigurationUpdate(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDNGRANTNLAssociationToRemoveList, ngap.CriticalityReject, remove)) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDNBIoTDefaultPagingDRX, ngap.CriticalityIgnore, m.NBIoTDefaultPagingDRX}, + {ngap.IDExtendedRANNodeName, ngap.CriticalityIgnore, m.ExtendedRANNodeName}, + {ngap.IDAdditionalULI, ngap.CriticalityIgnore, m.AdditionalULI}, + {ngap.IDAIoTSupport, ngap.CriticalityReject, m.AIoTSupport}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } @@ -120,6 +127,11 @@ func buildUplinkRANConfigurationTransfer(value []byte) NGAPMessageValue { SONConfigurationTransfer{Hex: hex.EncodeToString(m.SONConfigurationTransfer)})) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDENDCSONConfigurationTransferUL, ngap.CriticalityIgnore, m.ENDCSONConfigurationTransferUL}, + {ngap.IDIntersystemSONConfigurationTransferUL, ngap.CriticalityIgnore, m.IntersystemSONConfigurationTransferUL}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } @@ -136,6 +148,11 @@ func buildDownlinkRANConfigurationTransfer(value []byte) NGAPMessageValue { SONConfigurationTransfer{Hex: hex.EncodeToString(m.SONConfigurationTransfer)})) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDENDCSONConfigurationTransferDL, ngap.CriticalityIgnore, m.ENDCSONConfigurationTransferDL}, + {ngap.IDIntersystemSONConfigurationTransferDL, ngap.CriticalityIgnore, m.IntersystemSONConfigurationTransferDL}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/render.go b/internal/decoder/ngap/render.go new file mode 100644 index 0000000000..8a492a8a5b --- /dev/null +++ b/internal/decoder/ngap/render.go @@ -0,0 +1,172 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/hex" + "fmt" + "reflect" + + "github.com/ellanetworks/core/internal/decoder/rrc" + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/ngap" +) + +type typedIE struct { + id ngap.ProtocolIEID + crit ngap.Criticality + value any +} + +func appendTyped(ies []IE, typed []typedIE) []IE { + for _, t := range typed { + if utils.Present(t.value) { + ies = append(ies, ie(t.id, t.crit, render(t.value))) + } + } + + return ies +} + +func wireOrder(raw []byte, ies []IE) []IE { + pdu, err := ngap.ParseRawPDU(raw) + if err != nil { + return ies + } + + wire := pdu.IEs() + ids := make([]int64, len(wire)) + + for i, w := range wire { + ids[i] = int64(w.ID) + } + + return utils.WireOrder(ids, ies, func(e IE) int64 { return e.ID.Value }) +} + +func renderPresent(v any) any { + if !utils.Present(v) { + return nil + } + + return render(v) +} + +func render(v any) any { + return utils.Render(v, leaf) +} + +func leaf(v any) (any, bool) { + switch t := v.(type) { + case ngap.PLMNIdentity: + return plmnIDToDecoder(t), true + case ngap.TAC: + return fmt.Sprintf("%06x", uint32(t)), true + case ngap.TAI: + return tai(t), true + case ngap.NRCGI: + return nrCGI(t), true + case ngap.EUTRACGI: + return eutraCGI(t), true + case ngap.NGRANCGI: + return ngranCGI(t), true + case ngap.SNSSAI: + return buildSNSSAIValue(t), true + case ngap.AllowedNSSAI: + out := make([]SNSSAI, 0, len(t)) + for _, item := range t { + out = append(out, buildSNSSAIValue(item.SNSSAI)) + } + + return out, true + case ngap.GUAMI: + return guami(t), true + case ngap.TimeStamp: + return timeStamp(&t), true + case ngap.Cause: + return cause(t), true + case ngap.CriticalityDiagnostics: + return criticalityDiagnostics(t), true + case ngap.UserLocationInformation: + return userLocationInformation(t), true + case ngap.NASPDU: + return libNASPDU(t), true + case ngap.UERadioCapability: + return rrc.DescribeNGAP(t), true + case ngap.MobilityRestrictionList: + return mobilityRestrictionList(t), true + case ngap.UEAggregateMaximumBitRate: + return UEAggregateMaximumBitRate{Downlink: int64(t.DL), Uplink: int64(t.UL), Unit: "bps"}, true + case ngap.UESecurityCapabilities: + return libUESecurityCapabilities(t), true + case ngap.SecurityKey: + return hex.EncodeToString(t[:]), true + case ngap.SecurityAlgorithms: + return utils.BitStringUint(uint64(t.Uint16()), 16), true + case ngap.RATRestrictionInformation: + return ratRestrictionInformation(t), true + case ngap.GlobalRANNodeID: + return buildGlobalRANNodeID(t), true + case ngap.FiveGSTMSI: + return buildFiveGSTMSI(t), true + case ngap.GTPTunnel: + return GTPTunnel{GTPTEID: uint32(t.GTPTEID), TransportLayerAddress: transportLayerAddressText(t.TransportLayerAddress)}, true + case ngap.ExtendedAMFName: + return extendedAMFName(t), true + case ngap.LocationReportingRequestType: + return libLocationReportingRequestType(t), true + case ngap.SourceToTargetAMFInformationReroute: + return sourceToTargetAMFInformationReroute(t), true + case ngap.ProtocolIEID: + return ieEnum(t), true + case ngap.Criticality: + return criticalityToEnum(t), true + case ngap.ProcedureCode: + return procedureCodeToEnum(t), true + case ngap.SingleContainer: + return ie(t.ID, t.Criticality, rawIEValue{Hex: hex.EncodeToString([]byte(t.Value))}), true + case ngap.GNBIDValue: + return utils.BitStringUint(uint64(t.Value), t.Bits), true + } + + if bits, ok := bitStringWidths[reflect.TypeOf(v)]; ok { + return utils.BitStringUint(reflect.ValueOf(v).Uint(), bits), true + } + + return nil, false +} + +var bitStringWidths = map[reflect.Type]int{ + reflect.TypeFor[ngap.NRCellIdentity](): ngap.NRCellIdentityBits, + reflect.TypeFor[ngap.EUTRACellIdentity](): ngap.EUTRACellIdentityBits, + reflect.TypeFor[ngap.MessageIdentifier](): 16, + reflect.TypeFor[ngap.SerialNumber](): 16, + reflect.TypeFor[ngap.DataCodingScheme](): 8, + reflect.TypeFor[ngap.HomeENBID](): 28, + reflect.TypeFor[ngap.NID](): 44, + reflect.TypeFor[ngap.InterfacesToTrace](): 8, + reflect.TypeFor[ngap.N3IWFIDValue](): 16, + reflect.TypeFor[ngap.MacroNgENBID](): 20, + reflect.TypeFor[ngap.ShortMacroNgENBID](): 18, + reflect.TypeFor[ngap.LongMacroNgENBID](): 21, + reflect.TypeFor[ngap.AMFRegionID](): 8, + reflect.TypeFor[ngap.AMFSetID](): 10, + reflect.TypeFor[ngap.AMFPointer](): 6, + reflect.TypeFor[ngap.CandidateRelayUEID](): 24, + reflect.TypeFor[ngap.MeasurementsToActivate](): 8, + reflect.TypeFor[ngap.CAGID](): 32, + reflect.TypeFor[ngap.MDTLocationInformation](): 8, + reflect.TypeFor[ngap.MaskedIMEISV](): 64, + reflect.TypeFor[ngap.UEIdentityIndexValueIndexLength10](): 10, + reflect.TypeFor[ngap.PeriodicRegistrationUpdateTimer](): 8, + reflect.TypeFor[ngap.ExtendedUEIdentityIndexValue](): 16, + reflect.TypeFor[ngap.FurtherExtendedUEIdentityIndexValue](): 20, + reflect.TypeFor[ngap.ScheduledCommunicationTimeDayofWeek](): 7, + reflect.TypeFor[ngap.ReportCharacteristics](): 32, + reflect.TypeFor[ngap.ClockQualityAcceptanceCriteriaClockFrequencyStability](): 16, + reflect.TypeFor[ngap.ENBIDMacroENBID](): 20, + reflect.TypeFor[ngap.ENBIDHomeENBID](): 28, + reflect.TypeFor[ngap.ENBIDShortmacroENBID](): 18, + reflect.TypeFor[ngap.ENBIDLongmacroENBID](): 21, +} diff --git a/internal/decoder/ngap/testdata/golden/downlink_nas_transport_extensions.json b/internal/decoder/ngap/testdata/golden/downlink_nas_transport_extensions.json new file mode 100644 index 0000000000..72dc8a44b8 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/downlink_nas_transport_extensions.json @@ -0,0 +1,298 @@ +{ + "summary": "DownlinkNASTransport, AMF-UE=1, RAN-UE=2, NAS=REGISTRATION REJECT", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 4, + "label": "DownlinkNASTransport", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 10, + "label": "AMF-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 85, + "label": "RAN-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 48, + "label": "OldAMF", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "amf-old" + }, + { + "id": { + "type": "enum", + "value": 83, + "label": "RANPagingPriority", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 3 + }, + { + "id": { + "type": "enum", + "value": 38, + "label": "NAS-PDU", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "protocol": "NAS", + "raw_hex": "7e0044", + "decoded": { + "security_header": { + "protocol_discriminator": { + "type": "enum", + "value": 126, + "label": "5GMM", + "unknown": false + }, + "security_header_type": { + "type": "enum", + "value": 0, + "label": "plain", + "unknown": false + }, + "sequence_number": 0 + }, + "gmm_message": { + "gmm_header": { + "message_type": { + "type": "enum", + "value": 68, + "label": "REGISTRATION REJECT", + "unknown": false + } + } + }, + "encrypted": false + } + } + }, + { + "id": { + "type": "enum", + "value": 31, + "label": "IndexToRFSP", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 7 + }, + { + "id": { + "type": "enum", + "value": 110, + "label": "UEAggregateMaximumBitRate", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "downlink": 2000, + "uplink": 1000, + "unit": "bps" + } + }, + { + "id": { + "type": "enum", + "value": 0, + "label": "AllowedNSSAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "sst": 1 + } + ] + }, + { + "id": { + "type": "enum", + "value": 177, + "label": "SRVCCOperationPossible", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "possible", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 209, + "label": "UE-DifferentiationInfo", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "periodic_communication_indicator": { + "type": "enum", + "value": 0, + "label": "periodically", + "unknown": false + }, + "periodic_time": 60 + } + }, + { + "id": { + "type": "enum", + "value": 226, + "label": "EndIndication", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "no-further-data", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 264, + "label": "UERadioCapabilityID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "hex": "cafe" + } + }, + { + "id": { + "type": "enum", + "value": 34, + "label": "MaskedIMEISV", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "0123456789abcdef", + "bits": 64 + } + }, + { + "id": { + "type": "enum", + "value": 414, + "label": "Partially-Allowed-NSSAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "s_nssai": { + "sst": 2 + } + } + ] + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/initial_context_setup_request_extensions.json b/internal/decoder/ngap/testdata/golden/initial_context_setup_request_extensions.json new file mode 100644 index 0000000000..318c981d09 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/initial_context_setup_request_extensions.json @@ -0,0 +1,283 @@ +{ + "summary": "InitialContextSetup, AMF-UE=1, RAN-UE=2", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 14, + "label": "InitialContextSetup", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 10, + "label": "AMF-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 85, + "label": "RAN-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 18, + "label": "CoreNetworkAssistanceInformationForInactive", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ue_identity_index_value": { + "index_length10": { + "hex": "5540", + "bits": 10 + } + }, + "periodic_registration_update_timer": { + "hex": "21", + "bits": 8 + }, + "mico_mode_indication": { + "type": "enum", + "value": 0, + "label": "true", + "unknown": false + }, + "tai_list_for_inactive": [ + { + "tai": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": "000001" + } + } + ], + "eutra_paginge_drx_information": { + "eutra_paging_e_drx_cycle": { + "type": "enum", + "value": 2, + "label": "hf2", + "unknown": false + } + } + } + }, + { + "id": { + "type": "enum", + "value": 28, + "label": "GUAMI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "amf_region_id": "02", + "amf_set_id": "004", + "amf_pointer": "00" + } + }, + { + "id": { + "type": "enum", + "value": 0, + "label": "AllowedNSSAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "sst": 1 + } + ] + }, + { + "id": { + "type": "enum", + "value": 119, + "label": "UESecurityCapabilities", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "nr_encryption_algorithms": [ + "NEA1", + "NEA2" + ], + "nr_integrity_protection_algorithms": [ + "NIA1", + "NIA2" + ], + "eutra_encryption_algorithms": "c000", + "eutra_integrity_protection_algorithms": "c000" + } + }, + { + "id": { + "type": "enum", + "value": 94, + "label": "SecurityKey", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": "0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "id": { + "type": "enum", + "value": 216, + "label": "NRV2XServicesAuthorized", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "vehicle_ue": { + "type": "enum", + "value": 0, + "label": "authorized", + "unknown": false + } + } + }, + { + "id": { + "type": "enum", + "value": 218, + "label": "NRUESidelinkAggregateMaximumBitrate", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ue_sidelink_aggregate_maximum_bit_rate": 1000000 + } + }, + { + "id": { + "type": "enum", + "value": 254, + "label": "ManagementBasedMDTPLMNList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "mcc": "001", + "mnc": "01" + } + ] + }, + { + "id": { + "type": "enum", + "value": 335, + "label": "UESliceMaximumBitRateList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "s_nssai": { + "sst": 1 + }, + "ue_slice_maximum_bit_rate_dl": 300, + "ue_slice_maximum_bit_rate_ul": 200 + } + ] + }, + { + "id": { + "type": "enum", + "value": 346, + "label": "FiveG-ProSeUEPC5AggregateMaximumBitRate", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ue_sidelink_aggregate_maximum_bit_rate": 1000000 + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/invalid.json b/internal/decoder/ngap/testdata/golden/invalid.json index 27776caf01..a2b0ec42c9 100644 --- a/internal/decoder/ngap/testdata/golden/invalid.json +++ b/internal/decoder/ngap/testdata/golden/invalid.json @@ -13,6 +13,6 @@ "unknown": false }, "value": { - "error": "Could not decode raw ngap message: ngap: unsupported NGAP-PDU extension alternative" + "error": "Could not decode raw ngap message: ngap: transfer syntax error: ngap: unsupported NGAP-PDU extension alternative" } } diff --git a/internal/decoder/ngap/testdata/golden/ng_setup_request_extensions.json b/internal/decoder/ngap/testdata/golden/ng_setup_request_extensions.json new file mode 100644 index 0000000000..6a531b7378 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/ng_setup_request_extensions.json @@ -0,0 +1,130 @@ +{ + "summary": "NGSetup", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 21, + "label": "NGSetup", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 27, + "label": "GlobalRANNodeID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_identity": { + "mcc": "001", + "mnc": "01" + }, + "global_gnb_id": "000001" + } + }, + { + "id": { + "type": "enum", + "value": 102, + "label": "SupportedTAList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "tac": "000001", + "broadcast_plmn_list": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "slice_support_list": [ + { + "sst": 1 + } + ] + } + ] + } + ] + }, + { + "id": { + "type": "enum", + "value": 21, + "label": "DefaultPagingDRX", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 2, + "label": "v128", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 204, + "label": "NB-IoT-DefaultPagingDRX", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 1, + "label": "rf256", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 273, + "label": "Extended-RANNodeName", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ran_node_name_visible_string": "gnb-ext" + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/paging_extensions.json b/internal/decoder/ngap/testdata/golden/paging_extensions.json new file mode 100644 index 0000000000..996c068467 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/paging_extensions.json @@ -0,0 +1,84 @@ +{ + "summary": "Paging", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 24, + "label": "Paging", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 115, + "label": "UEPagingIdentity", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "five_gs_tmsi": { + "amf_set_id": "004", + "amf_pointer": "08", + "fiveg_tmsi": "01020304" + } + } + }, + { + "id": { + "type": "enum", + "value": 103, + "label": "TAIListForPaging", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": "000001" + } + ] + }, + { + "id": { + "type": "enum", + "value": 342, + "label": "PagingCause", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "voice", + "unknown": false + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/pdu_session_resource_setup_request_transfer_extensions.json b/internal/decoder/ngap/testdata/golden/pdu_session_resource_setup_request_transfer_extensions.json new file mode 100644 index 0000000000..f6daaa309f --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/pdu_session_resource_setup_request_transfer_extensions.json @@ -0,0 +1,119 @@ +{ + "summary": "PDUSessionResourceSetup, AMF-UE=1, RAN-UE=2", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 29, + "label": "PDUSessionResourceSetup", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 10, + "label": "AMF-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 85, + "label": "RAN-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 83, + "label": "RANPagingPriority", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 74, + "label": "PDUSessionResourceSetupListSUReq", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "pdu_session_id": 1, + "snssai": { + "sst": 1 + }, + "pdu_session_resource_setup_request_transfer": { + "ul_ng_u_up_tnl_information": { + "gtp_tunnel": { + "gtp_teid": 17, + "transport_layer_address": "10.0.0.1" + } + }, + "qos_flow_setup_request_list": [ + { + "qos_id": 1, + "five_qi": 9, + "pri_arp": 8 + } + ], + "pdu_s_type": { + "type": "enum", + "value": 0, + "label": "ipv4", + "unknown": false + }, + "redundant_pdu_session_information": { + "rsn": { + "type": "enum", + "value": 1, + "label": "v2", + "unknown": false + } + }, + "common_network_instance": { + "hex": "696e" + } + } + } + ] + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/ue_context_modification_response_extensions.json b/internal/decoder/ngap/testdata/golden/ue_context_modification_response_extensions.json new file mode 100644 index 0000000000..282d039495 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/ue_context_modification_response_extensions.json @@ -0,0 +1,70 @@ +{ + "summary": "UEContextModification, AMF-UE=7, RAN-UE=3", + "pdu_type": "SuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 40, + "label": "UEContextModification", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 10, + "label": "AMF-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 7 + }, + { + "id": { + "type": "enum", + "value": 85, + "label": "RAN-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 3 + }, + { + "id": { + "type": "enum", + "value": 92, + "label": "RRCState", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 1, + "label": "connected", + "unknown": false + } + } + ] + } +} diff --git a/internal/decoder/ngap/testdata/golden/uplink_nas_transport_extensions.json b/internal/decoder/ngap/testdata/golden/uplink_nas_transport_extensions.json new file mode 100644 index 0000000000..6b1a122a76 --- /dev/null +++ b/internal/decoder/ngap/testdata/golden/uplink_nas_transport_extensions.json @@ -0,0 +1,146 @@ +{ + "summary": "UplinkNASTransport, AMF-UE=1, RAN-UE=2, NAS=REGISTRATION COMPLETE", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 46, + "label": "UplinkNASTransport", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 10, + "label": "AMF-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 85, + "label": "RAN-UE-NGAP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 38, + "label": "NAS-PDU", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "protocol": "NAS", + "raw_hex": "7e0043", + "decoded": { + "security_header": { + "protocol_discriminator": { + "type": "enum", + "value": 126, + "label": "5GMM", + "unknown": false + }, + "security_header_type": { + "type": "enum", + "value": 0, + "label": "plain", + "unknown": false + }, + "sequence_number": 0 + }, + "gmm_message": { + "gmm_header": { + "message_type": { + "type": "enum", + "value": 67, + "label": "REGISTRATION COMPLETE", + "unknown": false + } + }, + "registration_complete": {} + }, + "encrypted": false + } + } + }, + { + "id": { + "type": "enum", + "value": 121, + "label": "UserLocationInformation", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "nr": { + "nr_cgi": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "nr_cell_identity": "000000010" + }, + "tai": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": "000001" + } + } + } + }, + { + "id": { + "type": "enum", + "value": 246, + "label": "TNGFIdentityInformation", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "hex": "0102" + } + } + ] + } +} diff --git a/internal/decoder/ngap/ue_context_modification.go b/internal/decoder/ngap/ue_context_modification.go index ab8dff9dd6..4fb3058771 100644 --- a/internal/decoder/ngap/ue_context_modification.go +++ b/internal/decoder/ngap/ue_context_modification.go @@ -32,6 +32,44 @@ func buildUEContextModificationRequest(value []byte) NGAPMessageValue { ies = append(ies, ie(ngap.IDNewAMFUENGAPID, ngap.CriticalityReject, int64(*m.NewAMFUENGAPID))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDRANPagingPriority, ngap.CriticalityIgnore, m.RANPagingPriority}, + {ngap.IDSecurityKey, ngap.CriticalityReject, m.SecurityKey}, + {ngap.IDIndexToRFSP, ngap.CriticalityIgnore, m.IndexToRFSP}, + {ngap.IDUESecurityCapabilities, ngap.CriticalityReject, m.UESecurityCapabilities}, + {ngap.IDCoreNetworkAssistanceInformationForInactive, ngap.CriticalityIgnore, m.CoreNetworkAssistanceInformationForInactive}, + {ngap.IDEmergencyFallbackIndicator, ngap.CriticalityReject, m.EmergencyFallbackIndicator}, + {ngap.IDRRCInactiveTransitionReportRequest, ngap.CriticalityIgnore, m.RRCInactiveTransitionReportRequest}, + {ngap.IDNewGUAMI, ngap.CriticalityReject, m.NewGUAMI}, + {ngap.IDCNAssistedRANTuning, ngap.CriticalityIgnore, m.CNAssistedRANTuning}, + {ngap.IDSRVCCOperationPossible, ngap.CriticalityIgnore, m.SRVCCOperationPossible}, + {ngap.IDIABAuthorized, ngap.CriticalityIgnore, m.IABAuthorized}, + {ngap.IDNRV2XServicesAuthorized, ngap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {ngap.IDLTEV2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEV2XServicesAuthorized}, + {ngap.IDNRUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {ngap.IDLTEUESidelinkAggregateMaximumBitrate, ngap.CriticalityIgnore, m.LTEUESidelinkAggregateMaximumBitrate}, + {ngap.IDPC5QoSParameters, ngap.CriticalityIgnore, m.PC5QoSParameters}, + {ngap.IDUERadioCapabilityID, ngap.CriticalityReject, m.UERadioCapabilityID}, + {ngap.IDRGLevelWirelineAccessCharacteristics, ngap.CriticalityIgnore, m.RGLevelWirelineAccessCharacteristics}, + {ngap.IDTimeSyncAssistanceInfo, ngap.CriticalityIgnore, m.TimeSyncAssistanceInfo}, + {ngap.IDQMCConfigInfo, ngap.CriticalityIgnore, m.QMCConfigInfo}, + {ngap.IDQMCDeactivation, ngap.CriticalityIgnore, m.QMCDeactivation}, + {ngap.IDUESliceMaximumBitRateList, ngap.CriticalityIgnore, m.UESliceMaximumBitRateList}, + {ngap.IDManagementBasedMDTPLMNModificationList, ngap.CriticalityIgnore, m.ManagementBasedMDTPLMNModificationList}, + {ngap.IDFiveGProSeAuthorized, ngap.CriticalityIgnore, m.FiveGProSeAuthorized}, + {ngap.IDFiveGProSeUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.FiveGProSeUEPC5AggregateMaximumBitRate}, + {ngap.IDFiveGProSePC5QoSParameters, ngap.CriticalityIgnore, m.FiveGProSePC5QoSParameters}, + {ngap.IDNetworkControlledRepeaterAuthorized, ngap.CriticalityIgnore, m.NetworkControlledRepeaterAuthorized}, + {ngap.IDAerialUEsubscriptionInformation, ngap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {ngap.IDNRA2XServicesAuthorized, ngap.CriticalityIgnore, m.NRA2XServicesAuthorized}, + {ngap.IDLTEA2XServicesAuthorized, ngap.CriticalityIgnore, m.LTEA2XServicesAuthorized}, + {ngap.IDNRA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.NRA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDLTEA2XUEPC5AggregateMaximumBitRate, ngap.CriticalityIgnore, m.LTEA2XUEPC5AggregateMaximumBitRate}, + {ngap.IDA2XPC5QoSParameters, ngap.CriticalityIgnore, m.A2XPC5QoSParameters}, + {ngap.IDMobileIABAuthorized, ngap.CriticalityIgnore, m.MobileIABAuthorized}, + {ngap.IDSLPositioningRangingServiceInfo, ngap.CriticalityIgnore, m.SLPositioningRangingServiceInfo}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } @@ -61,6 +99,10 @@ func buildUEContextModificationResponse(value []byte) NGAPMessageValue { criticalityDiagnostics(*m.CriticalityDiagnostics))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDRRCState, ngap.CriticalityIgnore, m.RRCState}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/ue_context_release.go b/internal/decoder/ngap/ue_context_release.go index 4f843cfc09..06cf091799 100644 --- a/internal/decoder/ngap/ue_context_release.go +++ b/internal/decoder/ngap/ue_context_release.go @@ -126,5 +126,10 @@ func buildUEContextReleaseComplete(value []byte) NGAPMessageValue { criticalityDiagnostics(*m.CriticalityDiagnostics))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDInfoOnRecommendedCellsAndRANNodesForPaging, ngap.CriticalityIgnore, m.InfoOnRecommendedCellsAndRANNodesForPaging}, + {ngap.IDPagingAssisDataforCEcapabUE, ngap.CriticalityIgnore, m.PagingAssisDataforCEcapabUE}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/ue_radio_capability_info_indication.go b/internal/decoder/ngap/ue_radio_capability_info_indication.go index f239f2ee3c..ae0b557a3c 100644 --- a/internal/decoder/ngap/ue_radio_capability_info_indication.go +++ b/internal/decoder/ngap/ue_radio_capability_info_indication.go @@ -30,5 +30,10 @@ func buildUERadioCapabilityInfoIndication(value []byte) NGAPMessageValue { ueRadioCapabilityForPaging(*m.UERadioCapabilityForPaging))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDUERadioCapabilityEUTRAFormat, ngap.CriticalityIgnore, m.UERadioCapabilityEUTRAFormat}, + {ngap.IDXrDeviceWith2Rx, ngap.CriticalityIgnore, m.XrDeviceWith2Rx}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/up_tnl_choice_test.go b/internal/decoder/ngap/up_tnl_choice_test.go new file mode 100644 index 0000000000..09f24abe6a --- /dev/null +++ b/internal/decoder/ngap/up_tnl_choice_test.go @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "encoding/json" + "strings" + "testing" + + lib "github.com/ellanetworks/core/ngap" +) + +func TestUPTransportLayerInformationChoiceExtension(t *testing.T) { + transfer, err := (&lib.PDUSessionResourceSetupResponseTransfer{ + DLQosFlowPerTNLInformation: lib.QosFlowPerTNLInformation{ + UPTransportLayerInformation: lib.UPTransportLayerInformation{ + ChoiceExtension: &lib.SingleContainer{ID: 999, Criticality: lib.CriticalityIgnore, Value: "\x01\x02"}, + }, + AssociatedQosFlowList: lib.AssociatedQosFlowList{{QosFlowIdentifier: 1}}, + }, + }).Marshal() + if err != nil { + t.Fatalf("build transfer: %v", err) + } + + raw := mustMarshal(t, &lib.PDUSessionResourceSetupResponse{ + AMFUENGAPID: lib.Ptr(lib.AMFUENGAPID(1)), + RANUENGAPID: lib.Ptr(lib.RANUENGAPID(2)), + PDUSessionResourceSetup: lib.PDUSessionResourceSetupListSURes{{PDUSessionID: 1, Transfer: transfer}}, + }) + + b, err := json.Marshal(DecodeNGAPMessage(raw)) + if err != nil { + t.Fatal(err) + } + + want := `"gtp_tunnel":{"choice_extensions":{"id":{"type":"enum","value":999,"label":"","unknown":true},` + + `"criticality":{"type":"enum","value":1,"label":"ignore","unknown":false},"value":{"hex":"0102"}}}` + if !strings.Contains(string(b), want) { + t.Errorf("choice extension not rendered as the CHOICE alternative:\n%s", b) + } + + if strings.Contains(string(b), `"gtp_teid"`) { + t.Errorf("non-GTP alternative rendered as a GTP tunnel:\n%s", b) + } +} diff --git a/internal/decoder/ngap/uplink_nas_transport.go b/internal/decoder/ngap/uplink_nas_transport.go index 2487e76a54..02d684d5c6 100644 --- a/internal/decoder/ngap/uplink_nas_transport.go +++ b/internal/decoder/ngap/uplink_nas_transport.go @@ -40,5 +40,11 @@ func buildUplinkNASTransport(value []byte) NGAPMessageValue { userLocationInformation(*m.UserLocationInformation))) } + ies = appendTyped(ies, []typedIE{ + {ngap.IDWAGFIdentityInformation, ngap.CriticalityReject, m.WAGFIdentityInformation}, + {ngap.IDTNGFIdentityInformation, ngap.CriticalityReject, m.TNGFIdentityInformation}, + {ngap.IDTWIFIdentityInformation, ngap.CriticalityReject, m.TWIFIdentityInformation}, + }) + return NGAPMessageValue{IEs: append(ies, unmodeledIEs(m.UnknownIEs())...)} } diff --git a/internal/decoder/ngap/util.go b/internal/decoder/ngap/util.go index 32b29ba09b..81b4542e1e 100644 --- a/internal/decoder/ngap/util.go +++ b/internal/decoder/ngap/util.go @@ -46,7 +46,7 @@ func ieEnum(id ngap.ProtocolIEID) utils.EnumField { } // transportLayerAddressToString formats a NGAP TransportLayerAddress as a -// human-readable string per 3GPP TS 38.414 Section 5.1: +// human-readable string per 3GPP TS 38.414 Section 5.3: // - 32 bits → IPv4 dotted-decimal // - 128 bits → IPv6 colon-notation // - 160 bits → "IPv4+IPv6" dual-stack diff --git a/internal/decoder/s1ap/bit_string_widths_test.go b/internal/decoder/s1ap/bit_string_widths_test.go new file mode 100644 index 0000000000..b1fe555d32 --- /dev/null +++ b/internal/decoder/s1ap/bit_string_widths_test.go @@ -0,0 +1,138 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "go/ast" + "go/parser" + "go/token" + "path/filepath" + "strconv" + "strings" + "testing" +) + +func TestBitStringWidthsMatchCodec(t *testing.T) { + codec := codecBitStringWidths(t, filepath.Join("..", "..", "..", "s1ap")) + if len(codec) == 0 { + t.Fatal("found no fixed-size BIT STRING types in the codec") + } + + rendered := map[string]int{} + for typ, bits := range bitStringWidths { + rendered[typ.Name()] = bits + } + + for name, bits := range codec { + got, ok := rendered[name] + if !ok { + t.Errorf("%s is a %d-bit BIT STRING the decoder would render as an integer", name, bits) + + continue + } + + if got != bits { + t.Errorf("%s: decoder renders %d bits, codec encodes %d", name, got, bits) + } + } +} + +func codecBitStringWidths(t *testing.T, dir string) map[string]int { + t.Helper() + + paths, err := filepath.Glob(filepath.Join(dir, "*.go")) + if err != nil { + t.Fatal(err) + } + + consts := map[string]int{} + + var files []*ast.File + + for _, p := range paths { + if strings.HasSuffix(p, "_test.go") { + continue + } + + f, err := parser.ParseFile(token.NewFileSet(), p, nil, 0) + if err != nil { + t.Fatalf("parse %s: %v", p, err) + } + + files = append(files, f) + + for _, decl := range f.Decls { + gen, ok := decl.(*ast.GenDecl) + if !ok || gen.Tok != token.CONST { + continue + } + + for _, spec := range gen.Specs { + vs := spec.(*ast.ValueSpec) + for i, name := range vs.Names { + if i >= len(vs.Values) { + continue + } + + if lit, ok := vs.Values[i].(*ast.BasicLit); ok && lit.Kind == token.INT { + n, err := strconv.Atoi(lit.Value) + if err == nil { + consts[name.Name] = n + } + } + } + } + } + } + + out := map[string]int{} + + for _, f := range files { + for _, decl := range f.Decls { + fn, ok := decl.(*ast.FuncDecl) + if !ok || fn.Recv == nil || fn.Name.Name != "MarshalPER" || fn.Body == nil { + continue + } + + recv, ok := fn.Recv.List[0].Type.(*ast.Ident) + if !ok { + continue + } + + ast.Inspect(fn.Body, func(n ast.Node) bool { + call, ok := n.(*ast.CallExpr) + if !ok || len(call.Args) != 4 { + return true + } + + if id, ok := call.Fun.(*ast.Ident); !ok || id.Name != "encodeBitStringUint" { + return true + } + + switch w := call.Args[3].(type) { + case *ast.BasicLit: + n, err := strconv.Atoi(w.Value) + if err != nil { + t.Fatalf("%s: width %q: %v", recv.Name, w.Value, err) + } + + out[recv.Name] = n + case *ast.Ident: + n, ok := consts[w.Name] + if !ok { + t.Fatalf("%s: width constant %s not found", recv.Name, w.Name) + } + + out[recv.Name] = n + default: + t.Fatalf("%s: width is not a constant", recv.Name) + } + + return false + }) + } + } + + return out +} diff --git a/internal/decoder/s1ap/config_transfer.go b/internal/decoder/s1ap/config_transfer.go index 2f627f4c5e..825aa3f8ca 100644 --- a/internal/decoder/s1ap/config_transfer.go +++ b/internal/decoder/s1ap/config_transfer.go @@ -30,6 +30,11 @@ func buildENBConfigurationTransfer(value []byte) (S1APMessageValue, string) { sonConfigurationTransfer(m.SONConfigurationTransfer))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDENDCSONConfigurationTransferECT, s1ap.CriticalityIgnore, m.ENDCSONConfigurationTransferECT}, + {s1ap.IDIntersystemSONConfigurationTransferECT, s1ap.CriticalityIgnore, m.IntersystemSONConfigurationTransferECT}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, "eNB Configuration Transfer" @@ -48,6 +53,11 @@ func buildMMEConfigurationTransfer(value []byte) (S1APMessageValue, string) { sonConfigurationTransfer(m.SONConfigurationTransfer))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDENDCSONConfigurationTransferMCT, s1ap.CriticalityIgnore, m.ENDCSONConfigurationTransferMCT}, + {s1ap.IDIntersystemSONConfigurationTransferMCT, s1ap.CriticalityIgnore, m.IntersystemSONConfigurationTransferMCT}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, "MME Configuration Transfer" diff --git a/internal/decoder/s1ap/enb_configuration_update.go b/internal/decoder/s1ap/enb_configuration_update.go index c09bedffce..431cb60213 100644 --- a/internal/decoder/s1ap/enb_configuration_update.go +++ b/internal/decoder/s1ap/enb_configuration_update.go @@ -31,6 +31,13 @@ func buildENBConfigurationUpdate(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDDefaultPagingDRX, s1ap.CriticalityIgnore, pagingDRXToEnum(*m.DefaultPagingDRX))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGIdList, s1ap.CriticalityReject, m.CSGIdList}, + {s1ap.IDNBIoTDefaultPagingDRX, s1ap.CriticalityIgnore, m.NBIoTDefaultPagingDRX}, + {s1ap.IDConnectedengNBToAddList, s1ap.CriticalityIgnore, m.ConnectedengNBToAddList}, + {s1ap.IDConnectedengNBToRemoveList, s1ap.CriticalityIgnore, m.ConnectedengNBToRemoveList}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) if name == "" { diff --git a/internal/decoder/s1ap/erab_modify.go b/internal/decoder/s1ap/erab_modify.go index bd6ebc2e75..823e61b823 100644 --- a/internal/decoder/s1ap/erab_modify.go +++ b/internal/decoder/s1ap/erab_modify.go @@ -53,6 +53,19 @@ func erabModifiedTunnels(items []s1ap.ERABToBeModifiedItemBearerModInd) []ERABMo return out } +func erabNotModifiedTunnels(items s1ap.ERABNotToBeModifiedListBearerModInd) []ERABModifiedTunnel { + out := make([]ERABModifiedTunnel, 0, len(items)) + for _, it := range items { + out = append(out, ERABModifiedTunnel{ + ERABID: uint8(it.ERABID), + TransportLayerAddress: transportLayerAddress(it.TransportLayerAddress), + DLGTPTEID: uint32(it.DLGTPTEID), + }) + } + + return out +} + func buildERABModifyRequest(value []byte) (S1APMessageValue, string) { m, err := s1ap.ParseERABModifyRequest(value) if err != nil { @@ -92,6 +105,11 @@ func buildERABModifyRequest(value []byte) (S1APMessageValue, string) { } ies = append(ies, ie(s1ap.IDERABToBeModifiedListBearerModReq, s1ap.CriticalityReject, erabs)) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDSecondaryRATDataUsageRequest, s1ap.CriticalityIgnore, m.SecondaryRATDataUsageRequest}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("E-RAB Modify Request (MME-UE %d, eNB-UE %d, %d E-RAB)", m.MMEUES1APID, m.ENBUES1APID, len(m.ERABToBeModified)) @@ -134,6 +152,10 @@ func buildERABModifyResponse(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUserLocationInformation, s1ap.CriticalityIgnore, userLocationInformation(*m.UserLocationInformation))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDSecondaryRATDataUsageReportList, s1ap.CriticalityIgnore, m.SecondaryRATDataUsageReportList}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("E-RAB Modify Response (MME-UE %s, eNB-UE %s, %d E-RAB)", ueIDText(m.MMEUES1APID), ueIDText(m.ENBUES1APID), len(m.ERABModify)) @@ -152,13 +174,22 @@ func buildERABModificationIndication(value []byte) (S1APMessageValue, string) { } if len(m.NotToBeModified) > 0 { - ies = append(ies, ie(s1ap.IDERABNotToBeModifiedListBearerModInd, s1ap.CriticalityReject, erabModifiedTunnels(m.NotToBeModified))) + ies = append(ies, ie(s1ap.IDERABNotToBeModifiedListBearerModInd, s1ap.CriticalityReject, erabNotModifiedTunnels(m.NotToBeModified))) } if m.UserLocationInformation != nil { ies = append(ies, ie(s1ap.IDUserLocationInformation, s1ap.CriticalityIgnore, userLocationInformation(*m.UserLocationInformation))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTunnelInformationForBBF, s1ap.CriticalityIgnore, m.TunnelInformationForBBF}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGMembershipInfo, s1ap.CriticalityReject, m.CSGMembershipInfo}, + {s1ap.IDSecondaryRATDataUsageReportList, s1ap.CriticalityIgnore, m.SecondaryRATDataUsageReportList}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("E-RAB Modification Indication (MME-UE %d, eNB-UE %d, %d E-RAB)", m.MMEUES1APID, m.ENBUES1APID, len(m.ToBeModified)) @@ -211,6 +242,10 @@ func buildERABModificationConfirm(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGMembershipStatus, s1ap.CriticalityIgnore, m.CSGMembershipStatus}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("E-RAB Modification Confirm (MME-UE %s, eNB-UE %s, %d E-RAB)", ueIDText(m.MMEUES1APID), ueIDText(m.ENBUES1APID), len(m.ModifiedERABs)) diff --git a/internal/decoder/s1ap/erab_release.go b/internal/decoder/s1ap/erab_release.go index a1646f7cd3..a1958faa89 100644 --- a/internal/decoder/s1ap/erab_release.go +++ b/internal/decoder/s1ap/erab_release.go @@ -90,6 +90,10 @@ func buildERABReleaseResponse(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUserLocationInformation, s1ap.CriticalityIgnore, userLocationInformation(*m.UserLocationInformation))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDSecondaryRATDataUsageReportList, s1ap.CriticalityIgnore, m.SecondaryRATDataUsageReportList}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("E-RAB Release Response (MME-UE %s, eNB-UE %s, %d E-RAB)", ueIDText(m.MMEUES1APID), ueIDText(m.ENBUES1APID), len(m.ERABReleased)) @@ -116,6 +120,10 @@ func buildERABReleaseIndication(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUserLocationInformation, s1ap.CriticalityIgnore, userLocationInformation(*m.UserLocationInformation))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDSecondaryRATDataUsageReportList, s1ap.CriticalityIgnore, m.SecondaryRATDataUsageReportList}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("E-RAB Release Indication (MME-UE %d, eNB-UE %d, %d E-RAB)", m.MMEUES1APID, m.ENBUES1APID, len(m.ERABReleased)) diff --git a/internal/decoder/s1ap/extension_ies_test.go b/internal/decoder/s1ap/extension_ies_test.go new file mode 100644 index 0000000000..572e32e369 --- /dev/null +++ b/internal/decoder/s1ap/extension_ies_test.go @@ -0,0 +1,144 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "testing" + + "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/s1ap" +) + +func extensionIEsCorpus(t *testing.T) map[string][]byte { + t.Helper() + + gw := ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 9}) + bbf := &s1ap.TunnelInformation{TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 7}), UDPPortNumber: &s1ap.PortNumber{0x08, 0x68}} + + return map[string][]byte{ + "s1_removal_request": mustMarshal(t, &s1ap.S1RemovalRequest{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x12345))}}, + }), + "s1_removal_response": mustMarshal(t, &s1ap.S1RemovalResponse{ + MMEName: s1ap.Ptr(s1ap.Name("mme01")), + CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ProcedureCode: s1ap.Ptr(s1ap.ProcS1Removal)}, + }), + "s1_removal_failure": mustMarshal(t, &s1ap.S1RemovalFailure{ + Cause: s1ap.Ptr(s1ap.CauseMisc(0).Cause()), + CriticalityDiagnostics: &s1ap.CriticalityDiagnostics{ProcedureCode: s1ap.Ptr(s1ap.ProcS1Removal)}, + }), + "initial_ue_message_extensions": mustMarshal(t, &s1ap.InitialUEMessage{ + ENBUES1APID: 2, + NASPDU: s1ap.NASPDU{0x07, 0x41}, + TAI: testTAI, + EUTRANCGI: &testCGI, + RRCEstablishmentCause: s1ap.Ptr(s1ap.RRCCauseMOSignalling), + GWTransportLayerAddress: &gw, + TunnelInformationForBBF: bbf, + SIPTOLGWTransportLayerAddress: &gw, + CoarseUELocationRequested: s1ap.Ptr(s1ap.CoarseUELocationRequestedTrue), + CSGId: s1ap.Ptr(s1ap.CSGId(0x123)), + CellAccessMode: s1ap.Ptr(s1ap.CellAccessModeHybrid), + LHNID: s1ap.Ptr(s1ap.LHNID(make([]byte, 32))), + DCNID: s1ap.Ptr(s1ap.DCNID(5)), + }), + "uplink_nas_transport_extensions": mustMarshal(t, &s1ap.UplinkNASTransport{ + MMEUES1APID: 1, + ENBUES1APID: 2, + NASPDU: s1ap.NASPDU{0x07, 0x41}, + EUTRANCGI: &testCGI, + TAI: &testTAI, + GWTransportLayerAddress: &gw, + SIPTOLGWTransportLayerAddress: &gw, + }), + "downlink_nas_transport_extensions": mustMarshal(t, &s1ap.DownlinkNASTransport{ + MMEUES1APID: 1, + ENBUES1APID: 2, + NASPDU: s1ap.NASPDU{0x07, 0x41}, + CoarseUELocation: s1ap.Ptr(s1ap.CoarseUELocation{0x01, 0x02, 0x03}), + NRUESecurityCapabilities: &s1ap.NRUESecurityCapabilities{ + NRencryptionAlgorithms: s1ap.NRencryptionAlgorithms{BitString: s1ap.BitStringFrom([]byte{0xc0, 0x00}, 16)}, + NRintegrityProtectionAlgorithms: s1ap.NRintegrityProtectionAlgorithms{BitString: s1ap.BitStringFrom([]byte{0xc0, 0x00}, 16)}, + }, + SubscriberProfileIDforRFP: s1ap.Ptr(s1ap.SubscriberProfileIDforRFP(7)), + }), + "s1_setup_request_extensions": mustMarshal(t, &s1ap.S1SetupRequest{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: testPLMN, ENBID: s1ap.ENBID{MacroENBID: s1ap.Ptr(s1ap.MacroENBID(0x12345))}}, + SupportedTAs: s1ap.SupportedTAs{{TAC: 1, BroadcastPLMNs: []s1ap.PLMNIdentity{testPLMN}}}, + DefaultPagingDRX: s1ap.Ptr(s1ap.PagingDRX(1)), + CSGIdList: s1ap.CSGIdList{{CSGId: 0x123}}, + NBIoTDefaultPagingDRX: s1ap.Ptr(s1ap.NBIoTDefaultPagingDRX(1)), + }), + "s1_setup_response_extensions": mustMarshal(t, &s1ap.S1SetupResponse{ + ServedGUMMEIs: s1ap.ServedGUMMEIs{{ServedPLMNs: []s1ap.PLMNIdentity{testPLMN}, ServedGroupIDs: []s1ap.MMEGroupID{{0x00, 0x01}}, ServedMMECs: []s1ap.MMECode{1}}}, + RelativeMMECapacity: s1ap.Ptr(uint8(10)), + ServedDCNs: &s1ap.ServedDCNs{{DCNID: 5, RelativeDCNCapacity: 10}}, + MMERelaySupportIndicator: s1ap.Ptr(s1ap.MMERelaySupportIndicator(0)), + }), + "paging_extensions": mustMarshal(t, &s1ap.Paging{ + UEIdentityIndexValue: s1ap.Ptr(uint16(5)), + UEPagingID: &s1ap.UEPagingID{STMSI: &s1ap.STMSI{MMEC: 1, MTMSI: 0x01020304}}, + CNDomain: s1ap.Ptr(s1ap.CNDomainPS), + TAIList: s1ap.TAIList{{TAI: testTAI}}, + PagingeDRXInformation: &s1ap.PagingeDRXInformation{PagingeDRXCycle: s1ap.PagingeDRXCycleHf2}, + NBIoTUEIdentityIndexValue: s1ap.Ptr(s1ap.NBIoTUEIdentityIndexValue(0x0ab)), + }), + "location_report_extensions": mustMarshal(t, &s1ap.LocationReport{ + MMEUES1APID: 1, + ENBUES1APID: 2, + EUTRANCGI: &testCGI, + TAI: &testTAI, + RequestType: &s1ap.RequestType{EventType: s1ap.EventTypeDirect, ReportArea: s1ap.ReportAreaECGI}, + PSCellInformation: &s1ap.PSCellInformation{NCGI: s1ap.NRCGI{PLMNIdentity: testPLMN, NRCellIdentity: 0x10}}, + }), + "handover_notify_extensions": mustMarshal(t, &s1ap.HandoverNotify{ + MMEUES1APID: 1, + ENBUES1APID: 2, + EUTRANCGI: &testCGI, + TAI: &testTAI, + TunnelInformationForBBF: bbf, + }), + "ue_context_modification_request_extensions": mustMarshal(t, &s1ap.UEContextModificationRequest{ + MMEUES1APID: 1, + ENBUES1APID: 2, + TimeRefDistribution: s1ap.Ptr(s1ap.TimeRefDistributionTrue), + }), + } +} + +func TestExtensionIEsRendered(t *testing.T) { + for name, raw := range extensionIEsCorpus(t) { + t.Run(name, func(t *testing.T) { + msg := DecodeS1APMessage(raw) + if msg.Value.Error != "" { + t.Fatalf("decode error: %s", msg.Value.Error) + } + + pdu, err := s1ap.ParseRawPDU(raw) + if err != nil { + t.Fatal(err) + } + + wire := pdu.IEs() + if len(wire) != len(msg.Value.IEs) { + t.Fatalf("rendered %d IEs, want the %d on the wire", len(msg.Value.IEs), len(wire)) + } + + for i, w := range wire { + got := msg.Value.IEs[i] + if got.ID.Value != int64(w.ID) { + t.Errorf("IE %d = %d, want %d in wire order", i, got.ID.Value, w.ID) + } + + if got.ID.Unknown { + t.Errorf("IE %d rendered as unknown", got.ID.Value) + } + + if _, raw := got.Value.(rawIEValue); raw { + t.Errorf("IE %s rendered as unmodeled", got.ID.Label) + } + } + }) + } +} diff --git a/internal/decoder/s1ap/golden_test.go b/internal/decoder/s1ap/golden_test.go index 63fbd674d5..fd08c8f9b5 100644 --- a/internal/decoder/s1ap/golden_test.go +++ b/internal/decoder/s1ap/golden_test.go @@ -181,7 +181,7 @@ func goldenCorpus(t *testing.T) map[string][]byte { ToBeModified: []s1ap.ERABToBeModifiedItemBearerModInd{ {ERABID: 5, TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 1}), DLGTPTEID: 0x21}, }, - NotToBeModified: []s1ap.ERABToBeModifiedItemBearerModInd{ + NotToBeModified: s1ap.ERABNotToBeModifiedListBearerModInd{ {ERABID: 6, TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 45, 0, 2}), DLGTPTEID: 0x22}, }, UserLocationInformation: &s1ap.UserLocationInformation{EUTRANCGI: testCGI, TAI: testTAI}, @@ -464,6 +464,10 @@ func goldenCorpus(t *testing.T) map[string][]byte { addPWSOverloadCorpus(t, corpus) + for name, b := range extensionIEsCorpus(t) { + corpus[name] = b + } + return corpus } @@ -536,7 +540,7 @@ func TestGoldenCoversEveryRenderedProcedure(t *testing.T) { s1ap.ProcDownlinkNonUEAssociatedLPPaTransport, s1ap.ProcUplinkNonUEAssociatedLPPaTransport, s1ap.ProcWriteReplaceWarning, s1ap.ProcKill, s1ap.ProcPWSRestartIndication, s1ap.ProcPWSFailureIndication, s1ap.ProcOverloadStart, s1ap.ProcOverloadStop, - s1ap.ProcRerouteNASRequest, + s1ap.ProcRerouteNASRequest, s1ap.ProcS1Removal, }, "SuccessfulOutcome": { s1ap.ProcS1Setup, s1ap.ProcInitialContextSetup, s1ap.ProcUEContextRelease, s1ap.ProcUEContextModification, @@ -545,12 +549,12 @@ func TestGoldenCoversEveryRenderedProcedure(t *testing.T) { s1ap.ProcReset, s1ap.ProcPathSwitchRequest, s1ap.ProcERABModify, s1ap.ProcERABModificationIndication, s1ap.ProcENBConfigurationUpdate, - s1ap.ProcWriteReplaceWarning, s1ap.ProcKill, + s1ap.ProcWriteReplaceWarning, s1ap.ProcKill, s1ap.ProcS1Removal, }, "UnsuccessfulOutcome": { s1ap.ProcS1Setup, s1ap.ProcInitialContextSetup, s1ap.ProcUEContextModification, s1ap.ProcHandoverPreparation, s1ap.ProcHandoverResourceAllocation, - s1ap.ProcPathSwitchRequest, s1ap.ProcENBConfigurationUpdate, + s1ap.ProcPathSwitchRequest, s1ap.ProcENBConfigurationUpdate, s1ap.ProcS1Removal, }, } diff --git a/internal/decoder/s1ap/handover.go b/internal/decoder/s1ap/handover.go index bc88002f00..9af11ba834 100644 --- a/internal/decoder/s1ap/handover.go +++ b/internal/decoder/s1ap/handover.go @@ -146,6 +146,17 @@ func buildHandoverRequired(value []byte) (S1APMessageValue, string) { } ies = append(ies, ie(s1ap.IDSourceToTargetTransparentContainer, s1ap.CriticalityReject, sourceToTargetTransparentContainer(m.SourceToTarget, m.HandoverType == s1ap.HandoverTypeIntraLTE))) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDSRVCCHOIndication, s1ap.CriticalityReject, m.SRVCCHOIndication}, + {s1ap.IDSourceToTargetTransparentContainerSecondary, s1ap.CriticalityReject, m.SourceToTargetTransparentContainerSecondary}, + {s1ap.IDMSClassmark2, s1ap.CriticalityReject, m.MSClassmark2}, + {s1ap.IDMSClassmark3, s1ap.CriticalityIgnore, m.MSClassmark3}, + {s1ap.IDCSGId, s1ap.CriticalityReject, m.CSGId}, + {s1ap.IDCellAccessMode, s1ap.CriticalityReject, m.CellAccessMode}, + {s1ap.IDPSServiceNotAvailable, s1ap.CriticalityIgnore, m.PSServiceNotAvailable}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Handover Required (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) @@ -224,6 +235,37 @@ func buildHandoverRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDMMEUES1APID2, s1ap.CriticalityIgnore, uint32(*m.MMEUES1APID2))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTimeRefDistribution, s1ap.CriticalityIgnore, m.TimeRefDistribution}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDRequestType, s1ap.CriticalityIgnore, m.RequestType}, + {s1ap.IDSRVCCOperationPossible, s1ap.CriticalityIgnore, m.SRVCCOperationPossible}, + {s1ap.IDCSGId, s1ap.CriticalityReject, m.CSGId}, + {s1ap.IDCSGMembershipStatus, s1ap.CriticalityIgnore, m.CSGMembershipStatus}, + {s1ap.IDManagementBasedMDTAllowed, s1ap.CriticalityIgnore, m.ManagementBasedMDTAllowed}, + {s1ap.IDManagementBasedMDTPLMNList, s1ap.CriticalityIgnore, m.ManagementBasedMDTPLMNList}, + {s1ap.IDMaskedIMEISV, s1ap.CriticalityIgnore, m.MaskedIMEISV}, + {s1ap.IDExpectedUEBehaviour, s1ap.CriticalityIgnore, m.ExpectedUEBehaviour}, + {s1ap.IDProSeAuthorized, s1ap.CriticalityIgnore, m.ProSeAuthorized}, + {s1ap.IDUEUserPlaneCIoTSupportIndicator, s1ap.CriticalityIgnore, m.UEUserPlaneCIoTSupportIndicator}, + {s1ap.IDV2XServicesAuthorized, s1ap.CriticalityIgnore, m.V2XServicesAuthorized}, + {s1ap.IDUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.UESidelinkAggregateMaximumBitrate}, + {s1ap.IDEnhancedCoverageRestricted, s1ap.CriticalityIgnore, m.EnhancedCoverageRestricted}, + {s1ap.IDNRUESecurityCapabilities, s1ap.CriticalityIgnore, m.NRUESecurityCapabilities}, + {s1ap.IDCEModeBRestricted, s1ap.CriticalityIgnore, m.CEModeBRestricted}, + {s1ap.IDAerialUEsubscriptionInformation, s1ap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {s1ap.IDPendingDataIndication, s1ap.CriticalityIgnore, m.PendingDataIndication}, + {s1ap.IDSubscriptionBasedUEDifferentiationInfo, s1ap.CriticalityIgnore, m.SubscriptionBasedUEDifferentiationInfo}, + {s1ap.IDAdditionalRRMPriorityIndex, s1ap.CriticalityIgnore, m.AdditionalRRMPriorityIndex}, + {s1ap.IDIABAuthorized, s1ap.CriticalityReject, m.IABAuthorized}, + {s1ap.IDNRV2XServicesAuthorized, s1ap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {s1ap.IDNRUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {s1ap.IDPC5QoSParameters, s1ap.CriticalityIgnore, m.PC5QoSParameters}, + {s1ap.IDUERadioCapabilityID, s1ap.CriticalityReject, m.UERadioCapabilityID}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Handover Request (MME-UE %d, %d E-RAB)", m.MMEUES1APID, len(m.ERABToBeSetup)) @@ -278,6 +320,12 @@ func buildHandoverRequestAcknowledge(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGId, s1ap.CriticalityIgnore, m.CSGId}, + {s1ap.IDCellAccessMode, s1ap.CriticalityIgnore, m.CellAccessMode}, + {s1ap.IDCEmodeBSupportIndicator, s1ap.CriticalityIgnore, m.CEmodeBSupportIndicator}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Handover Request Acknowledge (MME-UE %s, eNB-UE %s, %d admitted)", ueIDText(m.MMEUES1APID), ueIDText(m.ENBUES1APID), len(m.ERABAdmitted)) @@ -338,6 +386,10 @@ func buildHandoverCommand(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTargetToSourceTransparentContainerSecondary, s1ap.CriticalityReject, m.TargetToSourceTransparentContainerSecondary}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Handover Command (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) @@ -391,6 +443,17 @@ func buildHandoverNotify(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDTAI, s1ap.CriticalityIgnore, tai(*m.TAI))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTunnelInformationForBBF, s1ap.CriticalityIgnore, m.TunnelInformationForBBF}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDLHNID, s1ap.CriticalityIgnore, m.LHNID}, + {s1ap.IDPSCellInformation, s1ap.CriticalityIgnore, m.PSCellInformation}, + {s1ap.IDNotifySourceeNB, s1ap.CriticalityIgnore, m.NotifySourceeNB}, + {s1ap.IDLTENTNTAIInformation, s1ap.CriticalityIgnore, m.LTENTNTAIInformation}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Handover Notify (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) diff --git a/internal/decoder/s1ap/initial_context_setup.go b/internal/decoder/s1ap/initial_context_setup.go index 822fc5fc7f..725fe28b25 100644 --- a/internal/decoder/s1ap/initial_context_setup.go +++ b/internal/decoder/s1ap/initial_context_setup.go @@ -125,6 +125,42 @@ func buildInitialContextSetupRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDMMEUES1APID2, s1ap.CriticalityIgnore, uint32(*m.MMEUES1APID2))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCoarseUELocation, s1ap.CriticalityIgnore, m.CoarseUELocation}, + {s1ap.IDTimeRefDistribution, s1ap.CriticalityIgnore, m.TimeRefDistribution}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTraceActivation, s1ap.CriticalityIgnore, m.TraceActivation}, + {s1ap.IDHandoverRestrictionList, s1ap.CriticalityIgnore, m.HandoverRestrictionList}, + {s1ap.IDSubscriberProfileIDforRFP, s1ap.CriticalityIgnore, m.SubscriberProfileIDforRFP}, + {s1ap.IDCSFallbackIndicator, s1ap.CriticalityReject, m.CSFallbackIndicator}, + {s1ap.IDSRVCCOperationPossible, s1ap.CriticalityIgnore, m.SRVCCOperationPossible}, + {s1ap.IDCSGMembershipStatus, s1ap.CriticalityIgnore, m.CSGMembershipStatus}, + {s1ap.IDRegisteredLAI, s1ap.CriticalityIgnore, m.RegisteredLAI}, + {s1ap.IDManagementBasedMDTAllowed, s1ap.CriticalityIgnore, m.ManagementBasedMDTAllowed}, + {s1ap.IDManagementBasedMDTPLMNList, s1ap.CriticalityIgnore, m.ManagementBasedMDTPLMNList}, + {s1ap.IDAdditionalCSFallbackIndicator, s1ap.CriticalityIgnore, m.AdditionalCSFallbackIndicator}, + {s1ap.IDMaskedIMEISV, s1ap.CriticalityIgnore, m.MaskedIMEISV}, + {s1ap.IDExpectedUEBehaviour, s1ap.CriticalityIgnore, m.ExpectedUEBehaviour}, + {s1ap.IDProSeAuthorized, s1ap.CriticalityIgnore, m.ProSeAuthorized}, + {s1ap.IDUEUserPlaneCIoTSupportIndicator, s1ap.CriticalityIgnore, m.UEUserPlaneCIoTSupportIndicator}, + {s1ap.IDV2XServicesAuthorized, s1ap.CriticalityIgnore, m.V2XServicesAuthorized}, + {s1ap.IDUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.UESidelinkAggregateMaximumBitrate}, + {s1ap.IDEnhancedCoverageRestricted, s1ap.CriticalityIgnore, m.EnhancedCoverageRestricted}, + {s1ap.IDNRUESecurityCapabilities, s1ap.CriticalityIgnore, m.NRUESecurityCapabilities}, + {s1ap.IDCEModeBRestricted, s1ap.CriticalityIgnore, m.CEModeBRestricted}, + {s1ap.IDAerialUEsubscriptionInformation, s1ap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {s1ap.IDPendingDataIndication, s1ap.CriticalityIgnore, m.PendingDataIndication}, + {s1ap.IDSubscriptionBasedUEDifferentiationInfo, s1ap.CriticalityIgnore, m.SubscriptionBasedUEDifferentiationInfo}, + {s1ap.IDAdditionalRRMPriorityIndex, s1ap.CriticalityIgnore, m.AdditionalRRMPriorityIndex}, + {s1ap.IDIABAuthorized, s1ap.CriticalityIgnore, m.IABAuthorized}, + {s1ap.IDNRV2XServicesAuthorized, s1ap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {s1ap.IDNRUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {s1ap.IDPC5QoSParameters, s1ap.CriticalityIgnore, m.PC5QoSParameters}, + {s1ap.IDUERadioCapabilityID, s1ap.CriticalityReject, m.UERadioCapabilityID}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Initial Context Setup Request (MME-UE %d, eNB-UE %d, %d E-RAB)", m.MMEUES1APID, m.ENBUES1APID, len(m.ERABToBeSetup)) diff --git a/internal/decoder/s1ap/location_report.go b/internal/decoder/s1ap/location_report.go index 88f7a57628..024cf40483 100644 --- a/internal/decoder/s1ap/location_report.go +++ b/internal/decoder/s1ap/location_report.go @@ -47,6 +47,11 @@ func buildLocationReport(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDRequestType, s1ap.CriticalityIgnore, requestType(*m.RequestType))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDPSCellInformation, s1ap.CriticalityIgnore, m.PSCellInformation}, + {s1ap.IDLTENTNTAIInformation, s1ap.CriticalityIgnore, m.LTENTNTAIInformation}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Location Report (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) diff --git a/internal/decoder/s1ap/mme_configuration_update.go b/internal/decoder/s1ap/mme_configuration_update.go index 73a852f934..43a60c2c70 100644 --- a/internal/decoder/s1ap/mme_configuration_update.go +++ b/internal/decoder/s1ap/mme_configuration_update.go @@ -29,6 +29,10 @@ func buildMMEConfigurationUpdate(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDRelativeMMECapacity, s1ap.CriticalityReject, *m.RelativeMMECapacity)) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDServedDCNs, s1ap.CriticalityIgnore, m.ServedDCNs}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) if m.RelativeMMECapacity == nil { diff --git a/internal/decoder/s1ap/nas_transport.go b/internal/decoder/s1ap/nas_transport.go index 2e4a4402b6..8e8f34df58 100644 --- a/internal/decoder/s1ap/nas_transport.go +++ b/internal/decoder/s1ap/nas_transport.go @@ -37,6 +37,30 @@ func buildInitialUEMessage(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDGUMMEI, s1ap.CriticalityReject, gummei(*m.GUMMEI))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDGWTransportLayerAddress, s1ap.CriticalityIgnore, m.GWTransportLayerAddress}, + {s1ap.IDTunnelInformationForBBF, s1ap.CriticalityIgnore, m.TunnelInformationForBBF}, + {s1ap.IDSIPTOLGWTransportLayerAddress, s1ap.CriticalityIgnore, m.SIPTOLGWTransportLayerAddress}, + {s1ap.IDCoarseUELocationRequested, s1ap.CriticalityIgnore, m.CoarseUELocationRequested}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGId, s1ap.CriticalityReject, m.CSGId}, + {s1ap.IDCellAccessMode, s1ap.CriticalityReject, m.CellAccessMode}, + {s1ap.IDRelayNodeIndicator, s1ap.CriticalityReject, m.RelayNodeIndicator}, + {s1ap.IDGUMMEIType, s1ap.CriticalityIgnore, m.GUMMEIType}, + {s1ap.IDLHNID, s1ap.CriticalityIgnore, m.LHNID}, + {s1ap.IDMMEGroupID, s1ap.CriticalityIgnore, m.MMEGroupID}, + {s1ap.IDUEUsageType, s1ap.CriticalityIgnore, m.UEUsageType}, + {s1ap.IDCEmodeBSupportIndicator, s1ap.CriticalityIgnore, m.CEmodeBSupportIndicator}, + {s1ap.IDDCNID, s1ap.CriticalityIgnore, m.DCNID}, + {s1ap.IDCoverageLevel, s1ap.CriticalityIgnore, m.CoverageLevel}, + {s1ap.IDUEApplicationLayerMeasurementCapability, s1ap.CriticalityIgnore, m.UEApplicationLayerMeasurementCapability}, + {s1ap.IDEDTSession, s1ap.CriticalityIgnore, m.EDTSession}, + {s1ap.IDIABNodeIndication, s1ap.CriticalityReject, m.IABNodeIndication}, + {s1ap.IDLTENTNTAIInformation, s1ap.CriticalityIgnore, m.LTENTNTAIInformation}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Initial UE Message (eNB-UE %d%s)", m.ENBUES1APID, nasSummary(m.NASPDU)) @@ -62,6 +86,17 @@ func buildUplinkNASTransport(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDTAI, s1ap.CriticalityIgnore, tai(*m.TAI))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDGWTransportLayerAddress, s1ap.CriticalityIgnore, m.GWTransportLayerAddress}, + {s1ap.IDSIPTOLGWTransportLayerAddress, s1ap.CriticalityIgnore, m.SIPTOLGWTransportLayerAddress}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDLHNID, s1ap.CriticalityIgnore, m.LHNID}, + {s1ap.IDPSCellInformation, s1ap.CriticalityIgnore, m.PSCellInformation}, + {s1ap.IDLTENTNTAIInformation, s1ap.CriticalityIgnore, m.LTENTNTAIInformation}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Uplink NAS Transport (MME-UE %d, eNB-UE %d%s)", m.MMEUES1APID, m.ENBUES1APID, nasSummary(m.NASPDU)) @@ -79,6 +114,28 @@ func buildDownlinkNASTransport(value []byte) (S1APMessageValue, string) { ie(s1ap.IDNASPDU, s1ap.CriticalityReject, nasPDU(m.NASPDU)), } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCoarseUELocation, s1ap.CriticalityIgnore, m.CoarseUELocation}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDHandoverRestrictionList, s1ap.CriticalityIgnore, m.HandoverRestrictionList}, + {s1ap.IDSubscriberProfileIDforRFP, s1ap.CriticalityIgnore, m.SubscriberProfileIDforRFP}, + {s1ap.IDSRVCCOperationPossible, s1ap.CriticalityIgnore, m.SRVCCOperationPossible}, + {s1ap.IDUERadioCapability, s1ap.CriticalityIgnore, m.UERadioCapability}, + {s1ap.IDDLNASPDUDeliveryAckRequest, s1ap.CriticalityIgnore, m.DLNASPDUDeliveryAckRequest}, + {s1ap.IDEnhancedCoverageRestricted, s1ap.CriticalityIgnore, m.EnhancedCoverageRestricted}, + {s1ap.IDNRUESecurityCapabilities, s1ap.CriticalityIgnore, m.NRUESecurityCapabilities}, + {s1ap.IDCEModeBRestricted, s1ap.CriticalityIgnore, m.CEModeBRestricted}, + {s1ap.IDUECapabilityInfoRequest, s1ap.CriticalityIgnore, m.UECapabilityInfoRequest}, + {s1ap.IDEndIndication, s1ap.CriticalityIgnore, m.EndIndication}, + {s1ap.IDPendingDataIndication, s1ap.CriticalityIgnore, m.PendingDataIndication}, + {s1ap.IDSubscriptionBasedUEDifferentiationInfo, s1ap.CriticalityIgnore, m.SubscriptionBasedUEDifferentiationInfo}, + {s1ap.IDAdditionalRRMPriorityIndex, s1ap.CriticalityIgnore, m.AdditionalRRMPriorityIndex}, + {s1ap.IDUERadioCapabilityID, s1ap.CriticalityReject, m.UERadioCapabilityID}, + {s1ap.IDMaskedIMEISV, s1ap.CriticalityIgnore, m.MaskedIMEISV}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Downlink NAS Transport (MME-UE %d, eNB-UE %d%s)", m.MMEUES1APID, m.ENBUES1APID, nasSummary(m.NASPDU)) diff --git a/internal/decoder/s1ap/paging.go b/internal/decoder/s1ap/paging.go index 37e1d66b3d..33f17c0b91 100644 --- a/internal/decoder/s1ap/paging.go +++ b/internal/decoder/s1ap/paging.go @@ -58,6 +58,21 @@ func buildPaging(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUERadioCapabilityForPaging, s1ap.CriticalityIgnore, hex.EncodeToString(m.UERadioCapabilityForPaging))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGIdList, s1ap.CriticalityIgnore, m.CSGIdList}, + {s1ap.IDAssistanceDataForPaging, s1ap.CriticalityIgnore, m.AssistanceDataForPaging}, + {s1ap.IDPagingeDRXInformation, s1ap.CriticalityIgnore, m.PagingeDRXInformation}, + {s1ap.IDExtendedUEIdentityIndexValue, s1ap.CriticalityIgnore, m.ExtendedUEIdentityIndexValue}, + {s1ap.IDNBIoTPagingeDRXInformation, s1ap.CriticalityIgnore, m.NBIoTPagingeDRXInformation}, + {s1ap.IDNBIoTUEIdentityIndexValue, s1ap.CriticalityIgnore, m.NBIoTUEIdentityIndexValue}, + {s1ap.IDEnhancedCoverageRestricted, s1ap.CriticalityIgnore, m.EnhancedCoverageRestricted}, + {s1ap.IDCEModeBRestricted, s1ap.CriticalityIgnore, m.CEModeBRestricted}, + {s1ap.IDDataSize, s1ap.CriticalityIgnore, m.DataSize}, + {s1ap.IDWUSAssistanceInformation, s1ap.CriticalityIgnore, m.WUSAssistanceInformation}, + {s1ap.IDNBIoTPagingDRX, s1ap.CriticalityIgnore, m.NBIoTPagingDRX}, + {s1ap.IDPagingCause, s1ap.CriticalityIgnore, m.PagingCause}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) mtmsi := "?" diff --git a/internal/decoder/s1ap/path_switch.go b/internal/decoder/s1ap/path_switch.go index 29d43bd03d..9d16385499 100644 --- a/internal/decoder/s1ap/path_switch.go +++ b/internal/decoder/s1ap/path_switch.go @@ -67,6 +67,21 @@ func buildPathSwitchRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDSourceMMEGUMMEI, s1ap.CriticalityIgnore, gummei(*m.SourceMMEGUMMEI))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTunnelInformationForBBF, s1ap.CriticalityIgnore, m.TunnelInformationForBBF}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGId, s1ap.CriticalityIgnore, m.CSGId}, + {s1ap.IDCellAccessMode, s1ap.CriticalityIgnore, m.CellAccessMode}, + {s1ap.IDCSGMembershipStatus, s1ap.CriticalityIgnore, m.CSGMembershipStatus}, + {s1ap.IDLHNID, s1ap.CriticalityIgnore, m.LHNID}, + {s1ap.IDRRCResumeCause, s1ap.CriticalityIgnore, m.RRCResumeCause}, + {s1ap.IDNRUESecurityCapabilities, s1ap.CriticalityIgnore, m.NRUESecurityCapabilities}, + {s1ap.IDPSCellInformation, s1ap.CriticalityIgnore, m.PSCellInformation}, + {s1ap.IDLTENTNTAIInformation, s1ap.CriticalityIgnore, m.LTENTNTAIInformation}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Path Switch Request (eNB-UE %d, source MME-UE %d, %d E-RAB)", m.ENBUES1APID, m.SourceMMEUES1APID, len(m.ERABToBeSwitchedDL)) @@ -122,6 +137,32 @@ func buildPathSwitchRequestAcknowledge(value []byte) (S1APMessageValue, string) })) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTimeRefDistribution, s1ap.CriticalityIgnore, m.TimeRefDistribution}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, m.CriticalityDiagnostics}, + {s1ap.IDCSGMembershipStatus, s1ap.CriticalityIgnore, m.CSGMembershipStatus}, + {s1ap.IDProSeAuthorized, s1ap.CriticalityIgnore, m.ProSeAuthorized}, + {s1ap.IDUEUserPlaneCIoTSupportIndicator, s1ap.CriticalityIgnore, m.UEUserPlaneCIoTSupportIndicator}, + {s1ap.IDV2XServicesAuthorized, s1ap.CriticalityIgnore, m.V2XServicesAuthorized}, + {s1ap.IDUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.UESidelinkAggregateMaximumBitrate}, + {s1ap.IDEnhancedCoverageRestricted, s1ap.CriticalityIgnore, m.EnhancedCoverageRestricted}, + {s1ap.IDNRUESecurityCapabilities, s1ap.CriticalityIgnore, m.NRUESecurityCapabilities}, + {s1ap.IDCEModeBRestricted, s1ap.CriticalityIgnore, m.CEModeBRestricted}, + {s1ap.IDAerialUEsubscriptionInformation, s1ap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {s1ap.IDPendingDataIndication, s1ap.CriticalityIgnore, m.PendingDataIndication}, + {s1ap.IDSubscriptionBasedUEDifferentiationInfo, s1ap.CriticalityIgnore, m.SubscriptionBasedUEDifferentiationInfo}, + {s1ap.IDHandoverRestrictionList, s1ap.CriticalityIgnore, m.HandoverRestrictionList}, + {s1ap.IDAdditionalRRMPriorityIndex, s1ap.CriticalityIgnore, m.AdditionalRRMPriorityIndex}, + {s1ap.IDNRV2XServicesAuthorized, s1ap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {s1ap.IDNRUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {s1ap.IDPC5QoSParameters, s1ap.CriticalityIgnore, m.PC5QoSParameters}, + {s1ap.IDUERadioCapabilityID, s1ap.CriticalityReject, m.UERadioCapabilityID}, + {s1ap.IDERABToBeUpdatedList, s1ap.CriticalityIgnore, m.ERABToBeUpdatedList}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("Path Switch Request Acknowledge (MME-UE %s, eNB-UE %s)", ueIDText(m.MMEUES1APID), ueIDText(m.ENBUES1APID)) diff --git a/internal/decoder/s1ap/render.go b/internal/decoder/s1ap/render.go new file mode 100644 index 0000000000..7c744f7301 --- /dev/null +++ b/internal/decoder/s1ap/render.go @@ -0,0 +1,132 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + "reflect" + + "github.com/ellanetworks/core/internal/decoder/rrc" + "github.com/ellanetworks/core/internal/decoder/utils" + "github.com/ellanetworks/core/s1ap" +) + +type typedIE struct { + id s1ap.ProtocolIEID + crit s1ap.Criticality + value any +} + +func appendTyped(ies []IE, typed []typedIE) []IE { + for _, t := range typed { + if utils.Present(t.value) { + ies = append(ies, ie(t.id, t.crit, render(t.value))) + } + } + + return ies +} + +func wireOrder(raw []byte, ies []IE) []IE { + pdu, err := s1ap.ParseRawPDU(raw) + if err != nil { + return ies + } + + wire := pdu.IEs() + ids := make([]int64, len(wire)) + + for i, w := range wire { + ids[i] = int64(w.ID) + } + + return utils.WireOrder(ids, ies, func(e IE) int64 { return e.ID.Value }) +} + +func render(v any) any { + return utils.Render(v, leaf) +} + +func leaf(v any) (any, bool) { + switch t := v.(type) { + case s1ap.PLMNIdentity: + return plmnToID(t), true + case s1ap.TAI: + return tai(t), true + case s1ap.EUTRANCGI: + return eutranCGI(t), true + case s1ap.STMSI: + return stmsi(t), true + case s1ap.UES1APIDs: + return ues1apIDs(t), true + case s1ap.GUMMEI: + return gummei(t), true + case s1ap.GlobalENBID: + return globalENBID(t), true + case s1ap.Cause: + return cause(t), true + case s1ap.CriticalityDiagnostics: + return criticalityDiagnostics(t), true + case s1ap.UserLocationInformation: + return userLocationInformation(t), true + case s1ap.HandoverRestrictionList: + return handoverRestrictionList(t), true + case s1ap.TargetID: + return targetID(t), true + case s1ap.SecurityContext: + return securityContext(t), true + case s1ap.TraceActivation: + return traceActivation(t), true + case s1ap.NASPDU: + return nasPDU(t), true + case s1ap.UERadioCapability: + return rrc.DescribeS1AP(t), true + case s1ap.UESecurityCapabilities: + return UESecurityCapabilities{ + EncryptionAlgorithms: securityAlgorithms(t.EncryptionAlgorithms.Value, "EEA"), + IntegrityProtectionAlgorithms: securityAlgorithms(t.IntegrityProtectionAlgorithms.Value, "EIA"), + }, true + case s1ap.SecurityKey: + return hex.EncodeToString(t[:]), true + case s1ap.SecurityAlgorithms: + return utils.BitStringUint(uint64(t.Value), 16), true + case s1ap.ProtocolIEID: + return ieEnum(t), true + case s1ap.Criticality: + return criticalityToEnum(t), true + case s1ap.ProcedureCode: + return procedureCodeToEnum(t), true + case s1ap.SingleContainer: + return ie(t.ID, t.Criticality, rawIEValue{Hex: hex.EncodeToString([]byte(t.Value))}), true + case s1ap.GNBID: + return utils.BitStringUint(uint64(t.Value), t.Bits), true + } + + if bits, ok := bitStringWidths[reflect.TypeOf(v)]; ok { + return utils.BitStringUint(reflect.ValueOf(v).Uint(), bits), true + } + + return nil, false +} + +var bitStringWidths = map[reflect.Type]int{ + reflect.TypeFor[s1ap.CSGId](): 27, + reflect.TypeFor[s1ap.ExtendedUEIdentityIndexValue](): 14, + reflect.TypeFor[s1ap.MaskedIMEISV](): 64, + reflect.TypeFor[s1ap.NBIoTUEIdentityIndexValue](): 12, + reflect.TypeFor[s1ap.UEApplicationLayerMeasurementCapability](): 8, + reflect.TypeFor[s1ap.ScheduledCommunicationTimeDayofWeek](): 7, + reflect.TypeFor[s1ap.NRCellIdentity](): 36, + reflect.TypeFor[s1ap.MobilityInformation](): 32, + reflect.TypeFor[s1ap.AdditionalRRMPriorityIndex](): 32, + reflect.TypeFor[s1ap.MessageIdentifier](): 16, + reflect.TypeFor[s1ap.SerialNumber](): 16, + reflect.TypeFor[s1ap.DataCodingScheme](): 8, + reflect.TypeFor[s1ap.MacroENBID](): 20, + reflect.TypeFor[s1ap.HomeENBID](): 28, + reflect.TypeFor[s1ap.ShortMacroENBID](): 18, + reflect.TypeFor[s1ap.LongMacroENBID](): 21, + reflect.TypeFor[s1ap.CellIdentity](): 28, + reflect.TypeFor[s1ap.InterfacesToTrace](): 8, +} diff --git a/internal/decoder/s1ap/s1_removal.go b/internal/decoder/s1ap/s1_removal.go new file mode 100644 index 0000000000..3f77c6f7b2 --- /dev/null +++ b/internal/decoder/s1ap/s1_removal.go @@ -0,0 +1,64 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "fmt" + + "github.com/ellanetworks/core/s1ap" +) + +func buildS1RemovalRequest(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseS1RemovalRequest(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse S1 Removal Request: %v", err)}, "" + } + + ies := []IE{ie(s1ap.IDGlobalENBID, s1ap.CriticalityReject, globalENBID(m.GlobalENBID))} + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, "S1 Removal Request" +} + +func buildS1RemovalResponse(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseS1RemovalResponse(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse S1 Removal Response: %v", err)}, "" + } + + var ies []IE + + if m.MMEName != nil { + ies = append(ies, ie(s1ap.IDMMEname, s1ap.CriticalityIgnore, *m.MMEName)) + } + + if m.CriticalityDiagnostics != nil { + ies = append(ies, ie(s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, "S1 Removal Response" +} + +func buildS1RemovalFailure(value []byte) (S1APMessageValue, string) { + m, err := s1ap.ParseS1RemovalFailure(value) + if err != nil { + return S1APMessageValue{Error: fmt.Sprintf("parse S1 Removal Failure: %v", err)}, "" + } + + var ies []IE + + if m.Cause != nil { + ies = append(ies, ie(s1ap.IDCause, s1ap.CriticalityIgnore, cause(*m.Cause))) + } + + if m.CriticalityDiagnostics != nil { + ies = append(ies, ie(s1ap.IDCriticalityDiagnostics, s1ap.CriticalityIgnore, criticalityDiagnostics(*m.CriticalityDiagnostics))) + } + + ies = appendUnknownIEs(ies, m.UnknownIEs()) + + return S1APMessageValue{IEs: ies}, "S1 Removal Failure" +} diff --git a/internal/decoder/s1ap/s1_setup.go b/internal/decoder/s1ap/s1_setup.go index 2ec7a9775f..40b8272871 100644 --- a/internal/decoder/s1ap/s1_setup.go +++ b/internal/decoder/s1ap/s1_setup.go @@ -159,6 +159,12 @@ func buildS1SetupRequest(value []byte) (S1APMessageValue, string) { summary = fmt.Sprintf("S1 Setup Request (%s)", *req.ENBName) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDCSGIdList, s1ap.CriticalityReject, req.CSGIdList}, + {s1ap.IDNBIoTDefaultPagingDRX, s1ap.CriticalityIgnore, req.NBIoTDefaultPagingDRX}, + {s1ap.IDConnectedengNBList, s1ap.CriticalityIgnore, req.ConnectedengNBList}, + }) + ies = appendUnknownIEs(ies, req.UnknownIEs()) return S1APMessageValue{IEs: ies}, summary @@ -203,6 +209,12 @@ func buildS1SetupResponse(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUERetentionInformation, s1ap.CriticalityIgnore, namedEnum(uint8(r), r.Name()))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDMMERelaySupportIndicator, s1ap.CriticalityIgnore, resp.MMERelaySupportIndicator}, + {s1ap.IDServedDCNs, s1ap.CriticalityIgnore, resp.ServedDCNs}, + {s1ap.IDIABSupported, s1ap.CriticalityIgnore, resp.IABSupported}, + }) + ies = appendUnknownIEs(ies, resp.UnknownIEs()) return S1APMessageValue{IEs: ies}, "S1 Setup Response" diff --git a/internal/decoder/s1ap/s1ap.go b/internal/decoder/s1ap/s1ap.go index ff7b8b4537..62d66e1be5 100644 --- a/internal/decoder/s1ap/s1ap.go +++ b/internal/decoder/s1ap/s1ap.go @@ -47,19 +47,25 @@ func DecodeS1APMessage(raw []byte) S1APMessage { } } + var msg S1APMessage + switch p := pdu.(type) { case *s1ap.InitiatingMessage: - return decodeInitiatingMessage(p) + msg = decodeInitiatingMessage(p) case *s1ap.SuccessfulOutcome: - return decodeSuccessfulOutcome(p) + msg = decodeSuccessfulOutcome(p) case *s1ap.UnsuccessfulOutcome: - return decodeUnsuccessfulOutcome(p) + msg = decodeUnsuccessfulOutcome(p) default: return S1APMessage{ PDUType: "Unknown", Value: S1APMessageValue{Error: fmt.Sprintf("unknown S1AP PDU type: %T", pdu)}, } } + + msg.Value.IEs = wireOrder(raw, msg.Value.IEs) + + return msg } func decodeInitiatingMessage(m *s1ap.InitiatingMessage) S1APMessage { @@ -156,6 +162,8 @@ func decodeInitiatingMessage(m *s1ap.InitiatingMessage) S1APMessage { msg.Value, msg.Summary = buildOverloadStop(m.Value) case s1ap.ProcRerouteNASRequest: msg.Value, msg.Summary = buildRerouteNASRequest(m.Value) + case s1ap.ProcS1Removal: + msg.Value, msg.Summary = buildS1RemovalRequest(m.Value) default: msg.Value = unsupportedProcedure(m.ProcedureCode) } @@ -205,6 +213,8 @@ func decodeSuccessfulOutcome(m *s1ap.SuccessfulOutcome) S1APMessage { msg.Value, msg.Summary = buildWriteReplaceWarningResponse(m.Value) case s1ap.ProcKill: msg.Value, msg.Summary = buildKillResponse(m.Value) + case s1ap.ProcS1Removal: + msg.Value, msg.Summary = buildS1RemovalResponse(m.Value) default: msg.Value = unsupportedProcedure(m.ProcedureCode) } @@ -236,6 +246,8 @@ func decodeUnsuccessfulOutcome(m *s1ap.UnsuccessfulOutcome) S1APMessage { msg.Value, msg.Summary = buildENBConfigurationUpdateFailure(m.Value) case s1ap.ProcMMEConfigurationUpdate: msg.Value, msg.Summary = buildMMEConfigurationUpdateFailure(m.Value) + case s1ap.ProcS1Removal: + msg.Value, msg.Summary = buildS1RemovalFailure(m.Value) default: msg.Value = unsupportedProcedure(m.ProcedureCode) } diff --git a/internal/decoder/s1ap/testdata/golden/downlink_nas_transport_extensions.json b/internal/decoder/s1ap/testdata/golden/downlink_nas_transport_extensions.json new file mode 100644 index 0000000000..2a2679bffc --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/downlink_nas_transport_extensions.json @@ -0,0 +1,152 @@ +{ + "summary": "Downlink NAS Transport (MME-UE 1, eNB-UE 2, NAS=ATTACH REQUEST)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 11, + "label": "DownlinkNASTransport", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 0, + "label": "MME-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 8, + "label": "eNB-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 26, + "label": "NAS-PDU", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "protocol": "NAS", + "raw_hex": "0741", + "decoded": { + "security_header": { + "protocol_discriminator": { + "type": "enum", + "value": 7, + "label": "EMM", + "unknown": false + }, + "security_header_type": { + "type": "enum", + "value": 0, + "label": "plain", + "unknown": false + } + }, + "emm_message": { + "emm_header": { + "message_type": { + "type": "enum", + "value": 65, + "label": "ATTACH REQUEST", + "unknown": false + } + }, + "error": "nas: uint8 at octet 2: buffer truncated" + }, + "encrypted": false + } + } + }, + { + "id": { + "type": "enum", + "value": 106, + "label": "SubscriberProfileIDforRFP", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 7 + }, + { + "id": { + "type": "enum", + "value": 269, + "label": "NRUESecurityCapabilities", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "nr_encryption_algorithms": { + "hex": "c000", + "bits": 16 + }, + "nr_integrity_protection_algorithms": { + "hex": "c000", + "bits": 16 + } + } + }, + { + "id": { + "type": "enum", + "value": 354, + "label": "CoarseUELocation", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "010203" + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/handover_notify_extensions.json b/internal/decoder/s1ap/testdata/golden/handover_notify_extensions.json new file mode 100644 index 0000000000..aa855709da --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/handover_notify_extensions.json @@ -0,0 +1,112 @@ +{ + "summary": "Handover Notify (MME-UE 1, eNB-UE 2)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 2, + "label": "HandoverNotification", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 0, + "label": "MME-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 8, + "label": "eNB-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 100, + "label": "EUTRAN-CGI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + } + }, + { + "id": { + "type": "enum", + "value": 67, + "label": "TAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": 1 + } + }, + { + "id": { + "type": "enum", + "value": 176, + "label": "Tunnel-Information-for-BBF", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "transport_layer_address": "10.0.0.7", + "udp_port_number": { + "hex": "0868" + } + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/initial_ue_message_extensions.json b/internal/decoder/s1ap/testdata/golden/initial_ue_message_extensions.json new file mode 100644 index 0000000000..1aa85d75b1 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/initial_ue_message_extensions.json @@ -0,0 +1,283 @@ +{ + "summary": "Initial UE Message (eNB-UE 2, NAS=ATTACH REQUEST)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 12, + "label": "InitialUEMessage", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 8, + "label": "eNB-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 26, + "label": "NAS-PDU", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "protocol": "NAS", + "raw_hex": "0741", + "decoded": { + "security_header": { + "protocol_discriminator": { + "type": "enum", + "value": 7, + "label": "EMM", + "unknown": false + }, + "security_header_type": { + "type": "enum", + "value": 0, + "label": "plain", + "unknown": false + } + }, + "emm_message": { + "emm_header": { + "message_type": { + "type": "enum", + "value": 65, + "label": "ATTACH REQUEST", + "unknown": false + } + }, + "error": "nas: uint8 at octet 2: buffer truncated" + }, + "encrypted": false + } + } + }, + { + "id": { + "type": "enum", + "value": 67, + "label": "TAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": 1 + } + }, + { + "id": { + "type": "enum", + "value": 100, + "label": "EUTRAN-CGI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + } + }, + { + "id": { + "type": "enum", + "value": 134, + "label": "RRC-Establishment-Cause", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 3, + "label": "mo-Signalling", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 127, + "label": "CSG-Id", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "hex": "00002460", + "bits": 27 + } + }, + { + "id": { + "type": "enum", + "value": 145, + "label": "CellAccessMode", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "hybrid", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 155, + "label": "GW-TransportLayerAddress", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": "10.0.0.9" + }, + { + "id": { + "type": "enum", + "value": 176, + "label": "Tunnel-Information-for-BBF", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "transport_layer_address": "10.0.0.7", + "udp_port_number": { + "hex": "0868" + } + } + }, + { + "id": { + "type": "enum", + "value": 184, + "label": "SIPTO-L-GW-TransportLayerAddress", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": "10.0.0.9" + }, + { + "id": { + "type": "enum", + "value": 186, + "label": "LHN-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "id": { + "type": "enum", + "value": 246, + "label": "DCN-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 5 + }, + { + "id": { + "type": "enum", + "value": 353, + "label": "CoarseUELocationRequested", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "true", + "unknown": false + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/invalid.json b/internal/decoder/s1ap/testdata/golden/invalid.json index 3539ea23e7..5f816b5dea 100644 --- a/internal/decoder/s1ap/testdata/golden/invalid.json +++ b/internal/decoder/s1ap/testdata/golden/invalid.json @@ -13,6 +13,6 @@ "unknown": false }, "value": { - "error": "could not decode raw s1ap message: s1ap: unsupported S1AP-PDU extension alternative" + "error": "could not decode raw s1ap message: s1ap: transfer syntax error: s1ap: unsupported S1AP-PDU extension alternative" } } diff --git a/internal/decoder/s1ap/testdata/golden/location_report_extensions.json b/internal/decoder/s1ap/testdata/golden/location_report_extensions.json new file mode 100644 index 0000000000..95d43f6522 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/location_report_extensions.json @@ -0,0 +1,146 @@ +{ + "summary": "Location Report (MME-UE 1, eNB-UE 2)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 33, + "label": "LocationReport", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 0, + "label": "MME-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 8, + "label": "eNB-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 100, + "label": "EUTRAN-CGI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + } + }, + { + "id": { + "type": "enum", + "value": 67, + "label": "TAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": 1 + } + }, + { + "id": { + "type": "enum", + "value": 98, + "label": "RequestType", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "event_type": { + "type": "enum", + "value": 0, + "label": "direct", + "unknown": false + }, + "report_area": { + "type": "enum", + "value": 0, + "label": "ecgi", + "unknown": false + } + } + }, + { + "id": { + "type": "enum", + "value": 288, + "label": "PSCellInformation", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ncgi": { + "plmn_identity": { + "mcc": "001", + "mnc": "01" + }, + "nr_cell_identity": { + "hex": "0000000100", + "bits": 36 + } + } + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/paging_extensions.json b/internal/decoder/s1ap/testdata/golden/paging_extensions.json new file mode 100644 index 0000000000..6a7a9df542 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/paging_extensions.json @@ -0,0 +1,136 @@ +{ + "summary": "Paging (M-TMSI 16909060, 1 TAI)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 10, + "label": "Paging", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 80, + "label": "UEIdentityIndexValue", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 5 + }, + { + "id": { + "type": "enum", + "value": 43, + "label": "UEPagingID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "mmec": 1, + "m_tmsi": 16909060 + } + }, + { + "id": { + "type": "enum", + "value": 109, + "label": "CNDomain", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "ps", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 46, + "label": "TAIList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": 1 + } + ] + }, + { + "id": { + "type": "enum", + "value": 227, + "label": "Paging-eDRXInformation", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "paging_e_drx_cycle": { + "type": "enum", + "value": 2, + "label": "hf2", + "unknown": false + } + } + }, + { + "id": { + "type": "enum", + "value": 244, + "label": "NB-IoT-UEIdentityIndexValue", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "hex": "0ab0", + "bits": 12 + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/s1_removal_failure.json b/internal/decoder/s1ap/testdata/golden/s1_removal_failure.json new file mode 100644 index 0000000000..ae49a3d4d6 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/s1_removal_failure.json @@ -0,0 +1,70 @@ +{ + "summary": "S1 Removal Failure", + "pdu_type": "UnsuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 67, + "label": "S1Removal", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 2, + "label": "Cause", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "group": { + "type": "enum", + "value": 4, + "label": "misc", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "control-processing-overload", + "unknown": false + } + } + }, + { + "id": { + "type": "enum", + "value": 58, + "label": "CriticalityDiagnostics", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "procedure_code": { + "type": "enum", + "value": 67, + "label": "S1Removal", + "unknown": false + } + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/s1_removal_request.json b/internal/decoder/s1ap/testdata/golden/s1_removal_request.json new file mode 100644 index 0000000000..480ce5fd35 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/s1_removal_request.json @@ -0,0 +1,49 @@ +{ + "summary": "S1 Removal Request", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 67, + "label": "S1Removal", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 59, + "label": "Global-ENB-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "enb_id": { + "kind": { + "type": "enum", + "value": 0, + "label": "macroENB-ID", + "unknown": false + }, + "value": 74565 + } + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/s1_removal_response.json b/internal/decoder/s1ap/testdata/golden/s1_removal_response.json new file mode 100644 index 0000000000..331ec06da4 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/s1_removal_response.json @@ -0,0 +1,57 @@ +{ + "summary": "S1 Removal Response", + "pdu_type": "SuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 67, + "label": "S1Removal", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 61, + "label": "MMEname", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": "mme01" + }, + { + "id": { + "type": "enum", + "value": 58, + "label": "CriticalityDiagnostics", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "procedure_code": { + "type": "enum", + "value": 67, + "label": "S1Removal", + "unknown": false + } + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/s1_setup_request_extensions.json b/internal/decoder/s1ap/testdata/golden/s1_setup_request_extensions.json new file mode 100644 index 0000000000..00f1749995 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/s1_setup_request_extensions.json @@ -0,0 +1,136 @@ +{ + "summary": "S1 Setup Request", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 17, + "label": "S1Setup", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 59, + "label": "Global-ENB-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "enb_id": { + "kind": { + "type": "enum", + "value": 0, + "label": "macroENB-ID", + "unknown": false + }, + "value": 74565 + } + } + }, + { + "id": { + "type": "enum", + "value": 64, + "label": "SupportedTAs", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "tac": 1, + "broadcast_plmns": [ + { + "mcc": "001", + "mnc": "01" + } + ] + } + ] + }, + { + "id": { + "type": "enum", + "value": 137, + "label": "DefaultPagingDRX", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 1, + "label": "v64", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 128, + "label": "CSG-IdList", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "csg_id": { + "hex": "00002460", + "bits": 27 + } + } + ] + }, + { + "id": { + "type": "enum", + "value": 234, + "label": "NB-IoT-DefaultPagingDRX", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 1, + "label": "v256", + "unknown": false + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/s1_setup_response_extensions.json b/internal/decoder/s1ap/testdata/golden/s1_setup_response_extensions.json new file mode 100644 index 0000000000..32179d332b --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/s1_setup_response_extensions.json @@ -0,0 +1,105 @@ +{ + "summary": "S1 Setup Response", + "pdu_type": "SuccessfulOutcome", + "procedure_code": { + "type": "enum", + "value": 17, + "label": "S1Setup", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 105, + "label": "ServedGUMMEIs", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": [ + { + "served_plmns": [ + { + "mcc": "001", + "mnc": "01" + } + ], + "served_group_ids": [ + 1 + ], + "served_mme_codes": [ + 1 + ] + } + ] + }, + { + "id": { + "type": "enum", + "value": 87, + "label": "RelativeMMECapacity", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": 10 + }, + { + "id": { + "type": "enum", + "value": 163, + "label": "MMERelaySupportIndicator", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "true", + "unknown": false + } + }, + { + "id": { + "type": "enum", + "value": 247, + "label": "ServedDCNs", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": [ + { + "dcn_id": 5, + "relative_dcn_capacity": 10 + } + ] + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/ue_context_modification_request_extensions.json b/internal/decoder/s1ap/testdata/golden/ue_context_modification_request_extensions.json new file mode 100644 index 0000000000..2abc55f072 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/ue_context_modification_request_extensions.json @@ -0,0 +1,70 @@ +{ + "summary": "UE Context Modification Request (MME-UE 1, eNB-UE 2)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 21, + "label": "UEContextModification", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 0, + "label": "MME-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 8, + "label": "eNB-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 355, + "label": "TimeRefDistribution", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "type": "enum", + "value": 0, + "label": "true", + "unknown": false + } + } + ] + } +} diff --git a/internal/decoder/s1ap/testdata/golden/uplink_nas_transport_extensions.json b/internal/decoder/s1ap/testdata/golden/uplink_nas_transport_extensions.json new file mode 100644 index 0000000000..bcb5553a16 --- /dev/null +++ b/internal/decoder/s1ap/testdata/golden/uplink_nas_transport_extensions.json @@ -0,0 +1,168 @@ +{ + "summary": "Uplink NAS Transport (MME-UE 1, eNB-UE 2, NAS=ATTACH REQUEST)", + "pdu_type": "InitiatingMessage", + "procedure_code": { + "type": "enum", + "value": 13, + "label": "UplinkNASTransport", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "ies": [ + { + "id": { + "type": "enum", + "value": 0, + "label": "MME-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 1 + }, + { + "id": { + "type": "enum", + "value": 8, + "label": "eNB-UE-S1AP-ID", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": 2 + }, + { + "id": { + "type": "enum", + "value": 26, + "label": "NAS-PDU", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 0, + "label": "reject", + "unknown": false + }, + "value": { + "protocol": "NAS", + "raw_hex": "0741", + "decoded": { + "security_header": { + "protocol_discriminator": { + "type": "enum", + "value": 7, + "label": "EMM", + "unknown": false + }, + "security_header_type": { + "type": "enum", + "value": 0, + "label": "plain", + "unknown": false + } + }, + "emm_message": { + "emm_header": { + "message_type": { + "type": "enum", + "value": 65, + "label": "ATTACH REQUEST", + "unknown": false + } + }, + "error": "nas: uint8 at octet 2: buffer truncated" + }, + "encrypted": false + } + } + }, + { + "id": { + "type": "enum", + "value": 100, + "label": "EUTRAN-CGI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "cell_id": "0019b01" + } + }, + { + "id": { + "type": "enum", + "value": 67, + "label": "TAI", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": { + "plmn_id": { + "mcc": "001", + "mnc": "01" + }, + "tac": 1 + } + }, + { + "id": { + "type": "enum", + "value": 155, + "label": "GW-TransportLayerAddress", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": "10.0.0.9" + }, + { + "id": { + "type": "enum", + "value": 184, + "label": "SIPTO-L-GW-TransportLayerAddress", + "unknown": false + }, + "criticality": { + "type": "enum", + "value": 1, + "label": "ignore", + "unknown": false + }, + "value": "10.0.0.9" + } + ] + } +} diff --git a/internal/decoder/s1ap/ue_capability.go b/internal/decoder/s1ap/ue_capability.go index f211ff3264..9aa547cc35 100644 --- a/internal/decoder/s1ap/ue_capability.go +++ b/internal/decoder/s1ap/ue_capability.go @@ -27,6 +27,13 @@ func buildUECapabilityInfoIndication(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUERadioCapabilityForPaging, s1ap.CriticalityIgnore, hex.EncodeToString(m.UERadioCapabilityForPaging))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDUEApplicationLayerMeasurementCapability, s1ap.CriticalityIgnore, m.UEApplicationLayerMeasurementCapability}, + {s1ap.IDLTEMIndication, s1ap.CriticalityIgnore, m.LTEMIndication}, + {s1ap.IDUERadioCapabilityNRFormat, s1ap.CriticalityIgnore, m.UERadioCapabilityNRFormat}, + {s1ap.IDUERadioCapabilityForPagingNRFormat, s1ap.CriticalityIgnore, m.UERadioCapabilityForPagingNRFormat}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("UE Capability Info Indication (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) diff --git a/internal/decoder/s1ap/ue_context_modification.go b/internal/decoder/s1ap/ue_context_modification.go index a9fef29421..dcf43fcd78 100644 --- a/internal/decoder/s1ap/ue_context_modification.go +++ b/internal/decoder/s1ap/ue_context_modification.go @@ -24,6 +24,33 @@ func buildUEContextModificationRequest(value []byte) (S1APMessageValue, string) ies = append(ies, ie(s1ap.IDUEAggregateMaximumBitrate, s1ap.CriticalityIgnore, AMBR{DL: uint64(ambr.DL), UL: uint64(ambr.UL)})) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDTimeRefDistribution, s1ap.CriticalityIgnore, m.TimeRefDistribution}, + }) + + ies = appendTyped(ies, []typedIE{ + {s1ap.IDSecurityKey, s1ap.CriticalityReject, m.SecurityKey}, + {s1ap.IDSubscriberProfileIDforRFP, s1ap.CriticalityIgnore, m.SubscriberProfileIDforRFP}, + {s1ap.IDCSFallbackIndicator, s1ap.CriticalityReject, m.CSFallbackIndicator}, + {s1ap.IDUESecurityCapabilities, s1ap.CriticalityReject, m.UESecurityCapabilities}, + {s1ap.IDCSGMembershipStatus, s1ap.CriticalityIgnore, m.CSGMembershipStatus}, + {s1ap.IDRegisteredLAI, s1ap.CriticalityIgnore, m.RegisteredLAI}, + {s1ap.IDAdditionalCSFallbackIndicator, s1ap.CriticalityIgnore, m.AdditionalCSFallbackIndicator}, + {s1ap.IDProSeAuthorized, s1ap.CriticalityIgnore, m.ProSeAuthorized}, + {s1ap.IDSRVCCOperationPossible, s1ap.CriticalityIgnore, m.SRVCCOperationPossible}, + {s1ap.IDSRVCCOperationNotPossible, s1ap.CriticalityIgnore, m.SRVCCOperationNotPossible}, + {s1ap.IDV2XServicesAuthorized, s1ap.CriticalityIgnore, m.V2XServicesAuthorized}, + {s1ap.IDUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.UESidelinkAggregateMaximumBitrate}, + {s1ap.IDNRUESecurityCapabilities, s1ap.CriticalityIgnore, m.NRUESecurityCapabilities}, + {s1ap.IDAerialUEsubscriptionInformation, s1ap.CriticalityIgnore, m.AerialUEsubscriptionInformation}, + {s1ap.IDAdditionalRRMPriorityIndex, s1ap.CriticalityIgnore, m.AdditionalRRMPriorityIndex}, + {s1ap.IDIABAuthorized, s1ap.CriticalityIgnore, m.IABAuthorized}, + {s1ap.IDNRV2XServicesAuthorized, s1ap.CriticalityIgnore, m.NRV2XServicesAuthorized}, + {s1ap.IDNRUESidelinkAggregateMaximumBitrate, s1ap.CriticalityIgnore, m.NRUESidelinkAggregateMaximumBitrate}, + {s1ap.IDPC5QoSParameters, s1ap.CriticalityIgnore, m.PC5QoSParameters}, + {s1ap.IDUERadioCapabilityID, s1ap.CriticalityReject, m.UERadioCapabilityID}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("UE Context Modification Request (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) diff --git a/internal/decoder/s1ap/ue_context_release.go b/internal/decoder/s1ap/ue_context_release.go index c7d981b822..2209894a2d 100644 --- a/internal/decoder/s1ap/ue_context_release.go +++ b/internal/decoder/s1ap/ue_context_release.go @@ -28,6 +28,10 @@ func buildUEContextReleaseRequest(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDGWContextReleaseIndication, s1ap.CriticalityReject, true)) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDSecondaryRATDataUsageReportList, s1ap.CriticalityIgnore, m.SecondaryRATDataUsageReportList}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("UE Context Release Request (MME-UE %d, eNB-UE %d)", m.MMEUES1APID, m.ENBUES1APID) @@ -79,6 +83,13 @@ func buildUEContextReleaseComplete(value []byte) (S1APMessageValue, string) { ies = append(ies, ie(s1ap.IDUserLocationInformation, s1ap.CriticalityIgnore, userLocationInformation(*m.UserLocationInformation))) } + ies = appendTyped(ies, []typedIE{ + {s1ap.IDInformationOnRecommendedCellsAndENBsForPaging, s1ap.CriticalityIgnore, m.InformationOnRecommendedCellsAndENBsForPaging}, + {s1ap.IDCellIdentifierAndCELevelForCECapableUEs, s1ap.CriticalityIgnore, m.CellIdentifierAndCELevelForCECapableUEs}, + {s1ap.IDSecondaryRATDataUsageReportList, s1ap.CriticalityIgnore, m.SecondaryRATDataUsageReportList}, + {s1ap.IDTimeSinceSecondaryNodeRelease, s1ap.CriticalityIgnore, m.TimeSinceSecondaryNodeRelease}, + }) + ies = appendUnknownIEs(ies, m.UnknownIEs()) return S1APMessageValue{IEs: ies}, fmt.Sprintf("UE Context Release Complete (MME-UE %s, eNB-UE %s)", ueIDText(m.MMEUES1APID), ueIDText(m.ENBUES1APID)) diff --git a/internal/decoder/utils/asn1_names.go b/internal/decoder/utils/asn1_names.go new file mode 100644 index 0000000000..3beaa52764 --- /dev/null +++ b/internal/decoder/utils/asn1_names.go @@ -0,0 +1,2769 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package utils + +var asn1Names = map[string]string{ + "a2xguaranteedflowbitrate": "a2x_guaranteed_flow_bit_rate", + "a2xmaximumflowbitrate": "a2x_maximum_flow_bit_rate", + "a2xpc5flowbitrates": "a2x_pc5_flow_bit_rates", + "a2xpc5linkaggregatebitrates": "a2x_pc5_link_aggregate_bit_rates", + "a2xpc5qosflowitem": "a2x_pc5_qos_flow_item", + "a2xpc5qosflowlist": "a2x_pc5_qos_flow_list", + "a2xpc5qosparameters": "a2x_pc5_qos_parameters", + "a2xpqi": "a2x_pqi", + "a2xrange": "a2x_range", + "activatedcelllist": "activated_cell_list", + "activatedcellslist": "activated_cells_list", + "activatedcellslistitem": "activated_cells_list_item", + "activationid": "activation_id", + "activationstatus": "activation_status", + "additionalcancelledlocationreportingreferenceiditem": "additional_cancelledlocation_reporting_reference_id_item", + "additionalcancelledlocationreportingreferenceidlist": "additional_cancelledlocation_reporting_reference_id_list", + "additionalcsfallbackindicator": "additional_cs_fallback_indicator", + "additionaldlforwardinguptnlinformation": "additional_dl_forwarding_uptnl_information", + "additionaldlnguuptnlinformation": "additional_dl_ngu_up_tnl_information", + "additionaldlqosflowpertnlinformation": "additional_dl_qos_flow_per_tnl_information", + "additionaldluptnlinformationforhoitem": "additional_dluptnl_information_for_ho_item", + "additionaldluptnlinformationforholist": "additional_dluptnl_information_for_ho_list", + "additionalguti": "additional_guti", + "additionalnguuptnlinformation": "additional_ng_uuptnl_information", + "additionalqosflowinformation": "additional_qos_flow_information", + "additionalqosflowsetupresponselist": "additional_qos_flow_setup_response_list", + "additionalrrmpriorityindex": "additional_rrm_priority_index", + "additionaluli": "additional_uli", + "adjustedperiodicity": "adjusted_periodicity", + "aerialcontrollerue": "aerial_controller_ue", + "aerialue": "aerial_ue", + "aerialueflightinformationongoingreportingfailed": "aerial_ue_flight_information_ongoing_reporting_failed", + "aerialueflightinformationreporting": "aerial_ue_flight_information_reporting", + "aerialueflightinformationreportingcontrol": "aerial_ue_flight_information_reporting_control", + "aerialueflightinformationreportingcontrolitem": "aerial_ue_flight_information_reporting_control_item", + "aerialueflightinformationreportingcontrollist": "aerial_ue_flight_information_reporting_control_list", + "aerialuereportingperiodicity": "aerial_ue_reporting_periodicity", + "aerialuereportperiodicity": "aerial_ue_report_periodicity", + "aerialuesubscriptioninformation": "aerial_ue_subscription_information", + "aggressorecgilist": "aggressore_cgi_list", + "aiotareacode": "aiot_area_code", + "aiotareaid": "aiot_area_id", + "aiotcommandassistanceinformation": "aiot_command_assistance_information", + "aiotcorrelationidentifier": "aiot_correlation_identifier", + "aiotdeviceidentificationrequested": "aiot_device_identification_requested", + "aiotdevicereportitem": "aiot_device_report_item", + "aiotdevicereportlist": "aiot_device_report_list", + "aiotfidentifier": "aiotf_identifier", + "aiotfname": "aiotf_name", + "aiotfnameutf8string": "aiotf_name_utf8_string", + "aiotfnamevisiblestring": "aiotf_name_visible_string", + "aiotfollowoncommandindication": "aiot_followon_command_indication", + "aiotinventoryassistanceinformation": "aiot_inventory_assistance_information", + "aiotnaspdu": "aiot_naspdu", + "aiotrandn": "a_io_t_rand_n", + "aiotreaderindex": "aiot_reader_index", + "aiotreaderreportitem": "aiot_reader_report_item", + "aiotreaderreportlist": "aiot_reader_report_list", + "aiotrequestedaiotarealist": "aiot_requested_aiot_area_list", + "aiotrequestedreaderitem": "aiot_requested_reader_item", + "aiotrequestedreaderlist": "aiot_requested_reader_list", + "aiotrequestedserviceareainformation": "aiot_requested_service_area_information", + "aiotsecurityinfo": "aiot_security_info", + "aiotsessionrelease": "aiot_session_release", + "aiotsessionreleasecommand": "aiot_session_release_command", + "aiotsessionreleasecommandtransfer": "aiot_session_release_command_transfer", + "aiotsessionreleasecomplete": "aiot_session_release_complete", + "aiotsessionreleasecompletetransfer": "aiot_session_release_complete_transfer", + "aiotsessionreleaserequest": "aiot_session_release_request", + "aiotsessionreleaserequesttransfer": "aiot_session_release_request_transfer", + "aiotsupport": "aiot_support", + "alldevices": "all_devices", + "allocationandretentionpriority": "allocation_and_retention_priority", + "allocationretentionpriority": "allocation_retention_priority", + "allowedcaglistperplmn": "allowed_cag_list_per_plmn", + "allowednssai": "allowed_nssai", + "allowednssaiitem": "allowed_nssai_item", + "allowedperiodicitylist": "allowed_periodicity_list", + "allowedpninpilist": "allowed_pni_npi_list", + "allowedpninpnitem": "allowed_pni_npn_item", + "allowedpninpnlist": "allowed_pni_npn_list", + "allowedtacs": "allowed_ta_cs", + "alternativeqosparasetindex": "alternative_qos_para_set_index", + "alternativeqosparasetitem": "alternative_qos_para_set_item", + "alternativeqosparasetlist": "alternative_qos_para_set_list", + "alternativeqosparasetnotifyindex": "alternative_qos_para_set_notify_index", + "altitude": "altitude", + "amfconfigurationupdate": "amf_configuration_update", + "amfconfigurationupdateacknowledge": "amf_configuration_update_acknowledge", + "amfconfigurationupdatefailure": "amf_configuration_update_failure", + "amfcprelocationindication": "amfcp_relocation_indication", + "amfname": "amf_name", + "amfnameutf8string": "amf_name_utf8_string", + "amfnamevisiblestring": "amf_name_visible_string", + "amfpagingtarget": "amf_paging_target", + "amfpointer": "amf_pointer", + "amfregionid": "amf_region_id", + "amfsetid": "amf_set_id", + "amfstatusindication": "amf_status_indication", + "amftnlassociationaddress": "amf_tnl_association_address", + "amftnlassociationsetupitem": "amf_tnl_association_setup_item", + "amftnlassociationsetuplist": "amf_tnl_association_setup_list", + "amftnlassociationtoadditem": "amf_tnl_association_to_add_item", + "amftnlassociationtoaddlist": "amf_tnl_association_to_add_list", + "amftnlassociationtoremoveitem": "amf_tnl_association_to_remove_item", + "amftnlassociationtoremovelist": "amf_tnl_association_to_remove_list", + "amftnlassociationtoupdateitem": "amf_tnl_association_to_update_item", + "amftnlassociationtoupdatelist": "amf_tnl_association_to_update_list", + "amfuengapid": "amf_ue_ngap_id", + "anpacketdelaybudgetul": "an_packet_delay_budget_ul", + "applicationlayerbufferlevellist": "application_layer_buffer_level_list", + "approximatenooftargetdevices": "approximate_noof_target_devices", + "areaid": "area_id", + "areaofinterest": "area_of_interest", + "areaofinterestcellitem": "area_of_interest_cell_item", + "areaofinterestcelllist": "area_of_interest_cell_list", + "areaofinterestitem": "area_of_interest_item", + "areaofinterestlist": "area_of_interest_list", + "areaofinterestrannodeitem": "area_of_interest_ran_node_item", + "areaofinterestrannodelist": "area_of_interest_ran_node_list", + "areaofinteresttaiitem": "area_of_interest_tai_item", + "areaofinteresttailist": "area_of_interest_tai_list", + "areascopeofmdt": "area_scope_of_mdt", + "areascopeofmdteutra": "area_scope_of_mdt_eutra", + "areascopeofmdtnr": "area_scope_of_mdt_nr", + "areascopeofneighcellsitem": "area_scope_of_neigh_cells_item", + "areascopeofneighcellslist": "area_scope_of_neigh_cells_list", + "areascopeofqmc": "area_scope_of_qmc", + "assistancedataforcecapableues": "assistance_data_for_ce_capable_ue_s", + "assistancedataforpaging": "assistance_data_for_paging", + "assistancedataforrecommendedcells": "assistance_data_for_recommended_cells", + "assistanceinformationqoemeas": "assistance_information_qo_e_meas", + "associatedmbsqosflowsetupormodifyrequestitem": "associated_mbs_qos_flow_setupor_modify_request_item", + "associatedmbsqosflowsetupormodifyrequestlist": "associated_mbs_qos_flow_setupor_modify_request_list", + "associatedmbsqosflowsetuprequestitem": "associated_mbs_qos_flow_setup_request_item", + "associatedmbsqosflowsetuprequestlist": "associated_mbs_qos_flow_setup_request_list", + "associatedqosflowitem": "associated_qos_flow_item", + "associatedqosflowlist": "associated_qos_flow_list", + "associatedsessionid": "associated_session_id", + "associatedtai": "associated_tai", + "associatedunicastqosflowidentifier": "associated_unicast_qos_flow_identifier", + "aun3deviceaccess": "aun3_device_access", + "aun3deviceaccessinfo": "aun3_device_access_info", + "authenticatedindication": "authenticated_indication", + "availablebitratereportthresholditem": "available_bitrate_report_threshold_item", + "availablebitratereportthresholdlist": "available_bitrate_report_threshold_list", + "availableranvisibleqoemetrics": "available_ran_visible_qo_em_etrics", + "averagingwindow": "averaging_window", + "backupamfname": "backup_amf_name", + "batteryindication": "battery_indication", + "beammeasurementsreportconfiguration": "beam_measurements_report_configuration", + "beammeasurementsreportquantity": "beam_measurements_report_quantity", + "bearerssubjecttodldiscardingitem": "bearers_subject_to_dl_discarding_item", + "bearerssubjecttodldiscardinglist": "bearers_subject_to_dl_discarding_list", + "bearerssubjecttoearlystatustransferitem": "bearers_subject_to_early_status_transfer_item", + "bearerssubjecttoearlystatustransferlist": "bearers_subject_to_early_status_transfer_list", + "bearerssubjecttostatustransferitem": "bearers_subject_to_status_transfer_item", + "bearerssubjecttostatustransferlist": "bearers_subject_to_status_transfer_list", + "bearertype": "bearer_type", + "bitrate": "bit_rate", + "bluetoothmeasconfig": "bluetooth_meas_config", + "bluetoothmeasconfignameitem": "bluetooth_meas_config_name_item", + "bluetoothmeasconfignamelist": "bluetooth_meas_config_name_list", + "bluetoothmeasurementconfiguration": "bluetooth_measurement_configuration", + "bluetoothname": "bluetooth_name", + "bplmns": "bplm_ns", + "broadcast5gstai": "broadcast5_gstai", + "broadcastcancelledarealist": "broadcast_cancelled_area_list", + "broadcastcompletedarealist": "broadcast_completed_area_list", + "broadcastplmnitem": "broadcast_plmn_item", + "broadcastplmnlist": "broadcast_plmn_list", + "broadcastplmns": "broadcast_plm_ns", + "broadcastsessionmodification": "broadcast_session_modification", + "broadcastsessionmodificationfailure": "broadcast_session_modification_failure", + "broadcastsessionmodificationrequest": "broadcast_session_modification_request", + "broadcastsessionmodificationresponse": "broadcast_session_modification_response", + "broadcastsessionrelease": "broadcast_session_release", + "broadcastsessionreleaserequest": "broadcast_session_release_request", + "broadcastsessionreleaserequired": "broadcast_session_release_required", + "broadcastsessionreleaseresponse": "broadcast_session_release_response", + "broadcastsessionsetup": "broadcast_session_setup", + "broadcastsessionsetupfailure": "broadcast_session_setup_failure", + "broadcastsessionsetuprequest": "broadcast_session_setup_request", + "broadcastsessionsetupresponse": "broadcast_session_setup_response", + "broadcastsessiontransport": "broadcast_session_transport", + "broadcastsessiontransportfailure": "broadcast_session_transport_failure", + "broadcastsessiontransportrequest": "broadcast_session_transport_request", + "broadcastsessiontransportresponse": "broadcast_session_transport_response", + "broadcasttransportfailuretransfer": "broadcast_transport_failure_transfer", + "broadcasttransportrequesttransfer": "broadcast_transport_request_transfer", + "broadcasttransportresponsetransfer": "broadcast_transport_response_transfer", + "btrssi": "bt_rssi", + "burstarrivaltime": "burst_arrival_time", + "burstarrivaltimeoffset": "burst_arrival_time_offset", + "burstarrivaltimewindow": "burst_arrival_time_window", + "burstarrivaltimewindowend": "burst_arrival_time_window_end", + "burstarrivaltimewindowstart": "burst_arrival_time_window_start", + "cagid": "cagid", + "caglistformdt": "cag_listfor_mdt", + "caglistformdtitem": "cag_listfor_mdt_item", + "cancelallwarningmessages": "cancel_all_warning_messages", + "cancelledcellineai": "cancelled_cellin_eai", + "cancelledcellineaiitem": "cancelled_cellin_eai_item", + "cancelledcellintai": "cancelled_cellin_tai", + "cancelledcellintaiitem": "cancelled_cellin_tai_item", + "cancelledcellsineaieutra": "cancelled_cells_in_eai_eutra", + "cancelledcellsineaieutraitem": "cancelled_cells_in_eai_eutra_item", + "cancelledcellsineainr": "cancelled_cells_in_eai_nr", + "cancelledcellsineainritem": "cancelled_cells_in_eai_nr_item", + "cancelledcellsintaieutra": "cancelled_cells_in_tai_eutra", + "cancelledcellsintaieutraitem": "cancelled_cells_in_tai_eutra_item", + "cancelledcellsintainr": "cancelled_cells_in_tai_nr", + "cancelledcellsintainritem": "cancelled_cells_in_tai_nr_item", + "candidatecell": "candidate_cell", + "candidatecellid": "candidate_cell_id", + "candidatecellitem": "candidate_cell_item", + "candidatecelllist": "candidate_cell_list", + "candidatecgi": "candidate_cgi", + "candidatenrarfcn": "candidate_nrarfcn", + "candidatepci": "candidate_pci", + "candidatepcilist": "candidate_pci_list", + "candidaterelayueid": "candidate_relay_ue_id", + "candidaterelayueinformationitem": "candidate_relay_ue_information_item", + "candidaterelayueinformationlist": "candidate_relay_ue_information_list", + "capabilityforbatadaptation": "capability_for_bat_adaptation", + "capacityvalue": "capacity_value", + "carrierfreq": "carrier_freq", + "cause": "cause", + "causemisc": "cause_misc", + "causenas": "cause_nas", + "causeprotocol": "cause_protocol", + "causeradionetwork": "cause_radio_network", + "causetransport": "cause_transport", + "cdma2000horequiredindication": "cdma2000_ho_required_indication", + "cdma2000hostatus": "cdma2000_ho_status", + "cdma2000onexmeid": "cdma2000_one_xmeid", + "cdma2000onexmsi": "cdma2000_one_xmsi", + "cdma2000onexpilot": "cdma2000_one_xp_ilot", + "cdma2000onexrand": "cdma2000_one_xrand", + "cdma2000onexsrvccinfo": "cdma2000_one_xsrvcc_info", + "cdma2000pdu": "cdma2000_pdu", + "cdma2000rattype": "cdma2000_rat_type", + "cdma2000sectorid": "cdma2000_sector_id", + "celevel": "ce_level", + "cellaccessmode": "cell_access_mode", + "cellactivationcause": "cell_activation_cause", + "cellactivationrequest": "cell_activation_request", + "cellactivationresponse": "cell_activation_response", + "cellbased": "cell_based", + "cellbasedmdt": "cell_based_mdt", + "cellbasedmdteutra": "cell_based_mdt_eutra", + "cellbasedmdtnr": "cell_based_mdt_nr", + "cellbasedqmc": "cell_based_qmc", + "cellcaginformation": "cell_cag_information", + "cellcaglist": "cell_cag_list", + "cellcapacityclassvalue": "cell_capacity_class_value", + "cellid": "cell_id", + "cellidbroadcast": "cell_id_broadcast", + "cellidbroadcasteutra": "cell_id_broadcast_eutra", + "cellidbroadcasteutraitem": "cell_id_broadcast_eutra_item", + "cellidbroadcastitem": "cell_id_broadcast_item", + "cellidbroadcastnr": "cell_id_broadcast_nr", + "cellidbroadcastnritem": "cell_id_broadcast_nr_item", + "cellidcancelled": "cell_id_cancelled", + "cellidcancelledeutra": "cell_id_cancelled_eutra", + "cellidcancelledeutraitem": "cell_id_cancelled_eutra_item", + "cellidcancelleditem": "cell_id_cancelled_item", + "cellidcancellednr": "cell_id_cancelled_nr", + "cellidcancellednritem": "cell_id_cancelled_nr_item", + "cellidentifierandcelevelforcecapableues": "cell_identifier_and_ce_level_for_ce_capable_ue_s", + "cellidentity": "cell_identity", + "cellidlist": "cell_id_list", + "cellidlistformdt": "cell_id_listfor_mdt", + "cellidlistformdteutra": "cell_id_listfor_mdt_eutra", + "cellidlistformdtnr": "cell_id_listfor_mdt_nr", + "cellidlistforqmc": "cell_id_listfor_qmc", + "cellidlistforrestart": "cell_id_list_for_restart", + "celllistlevel": "cell_list_level", + "cellloadreporting": "cell_load_reporting", + "cellloadreportingcause": "cell_load_reporting_cause", + "cellloadreportingresponse": "cell_load_reporting_response", + "cellsize": "cell_size", + "cellstateindication": "cell_state_indication", + "cellstateindicationcause": "cell_state_indication_cause", + "cellstoactivatelist": "cells_to_activate_list", + "cellstoactivatelistitem": "cells_to_activate_list_item", + "celltraffictrace": "cell_traffic_trace", + "celltype": "cell_type", + "cemodebrestricted": "ce_mode_br_estricted", + "cemodebsupportindicator": "ce_mode_b_support_indicator", + "cgi": "cgi", + "choiceextension": "choice_extension", + "choiceextensions": "choice_extensions", + "ci": "ci", + "circle": "circle", + "clockaccuracy": "clock_accuracy", + "clockaccuracyindex": "clock_accuracy_index", + "clockaccuracyvalue": "clock_accuracy_value", + "clockfrequencystability": "clock_frequency_stability", + "clockqualityacceptancecriteria": "clock_quality_acceptance_criteria", + "clockqualityacceptanceindication": "clock_quality_acceptance_indication", + "clockqualitydetaillevel": "clock_quality_detail_level", + "clockqualitymetrics": "clock_quality_metrics", + "clockqualityreportingcontrolinfo": "clock_quality_reporting_control_info", + "cnassistedrantuning": "cn_assisted_ran_tuning", + "cndomain": "cn_domain", + "cnmtcommunicationhandling": "cn_mt_communication_handling", + "cnpacketdelaybudgetdl": "cn_packet_delay_budget_dl", + "cnpacketdelaybudgetul": "cn_packet_delay_budget_ul", + "cnsubgroupid": "cn_subgroup_id", + "cntype": "cn_type", + "cntyperestrictions": "cn_type_restrictions", + "cntyperestrictionsforequivalent": "cn_type_restrictions_for_equivalent", + "cntyperestrictionsforequivalentitem": "cn_type_restrictions_for_equivalent_item", + "cntyperestrictionsforserving": "cn_type_restrictions_for_serving", + "cntyperestrictionsitem": "cn_type_restrictions_item", + "coarseuelocation": "coarse_ue_location", + "coarseuelocationrequested": "coarse_ue_location_requested", + "commandfailure": "command_failure", + "commandfailuretransfer": "command_failure_transfer", + "commandrequest": "command_request", + "commandrequesttransfer": "command_request_transfer", + "commandresponse": "command_response", + "commandresponsetransfer": "command_response_transfer", + "commonnetworkinstance": "common_network_instance", + "commservicetype": "comm_service_type", + "completedcellineai": "completed_cellin_eai", + "completedcellineaiitem": "completed_cellin_eai_item", + "completedcellintai": "completed_cellin_tai", + "completedcellintaiitem": "completed_cellin_tai_item", + "completedcellsineaieutra": "completed_cells_in_eai_eutra", + "completedcellsineaieutraitem": "completed_cells_in_eai_eutra_item", + "completedcellsineainr": "completed_cells_in_eai_nr", + "completedcellsineainritem": "completed_cells_in_eai_nr_item", + "completedcellsintaieutra": "completed_cells_in_tai_eutra", + "completedcellsintaieutraitem": "completed_cells_in_tai_eutra_item", + "completedcellsintainr": "completed_cells_in_tai_nr", + "completedcellsintainritem": "completed_cells_in_tai_nr_item", + "compositeavailablecapacity": "composite_available_capacity", + "compositeavailablecapacitygroup": "composite_available_capacity_group", + "concurrentwarningmessageind": "concurrent_warning_message_ind", + "concurrentwarningmessageindicator": "concurrent_warning_message_indicator", + "confidentialityprotectionindication": "confidentiality_protection_indication", + "confidentialityprotectionresult": "confidentiality_protection_result", + "configurednssai": "configured_nssai", + "configuredtacindication": "configured_tac_indication", + "congestioninformationrequest": "congestion_information_request", + "connectedengnbitem": "connectedeng_nb_item", + "connectedengnblist": "connectedeng_nb_list", + "connectionestablishmentindication": "connection_establishment_indication", + "containerforapplayermeasconfig": "container_for_app_layer_meas_config", + "contextatsource": "contextat_source", + "corenetworkassistanceinformationforinactive": "core_network_assistance_information_for_inactive", + "correlationid": "correlation_id", + "correlationidentifier": "correlation_identifier", + "count12bits": "count12bits", + "count18bits": "count18bits", + "countvalue": "coun_tvalue", + "countvalueextended": "count_value_extended", + "countvalueforpdcpsn12": "count_value_for_pdcp_sn12", + "countvalueforpdcpsn18": "count_value_for_pdcp_sn18", + "countvaluepdcpsnlength18": "coun_tvalue_pdcp_sn_length18", + "coverageenhancementlevel": "coverage_enhancement_level", + "coveragelevel": "coverage_level", + "cptransportlayerinformation": "cp_transport_layer_information", + "criticality": "criticality", + "criticalitydiagnostics": "criticality_diagnostics", + "criticalitydiagnosticsieitem": "criticality_diagnostics_ie_item", + "criticalitydiagnosticsielist": "criticality_diagnostics_ie_list", + "crnti": "c_rnti", + "csfallbackindicator": "cs_fallback_indicator", + "csgid": "csg_id", + "csgidlist": "csg_id_list", + "csgidlistitem": "csg_id_list_item", + "csgmembershipinfo": "csg_membership_info", + "csgmembershipstatus": "csg_membership_status", + "dapsindicator": "daps_indicator", + "dapsrequestinfo": "daps_request_info", + "dapsresponseindicator": "dapsresponseindicator", + "dapsresponseinfo": "daps_response_info", + "dapsresponseinfoitem": "daps_response_info_item", + "dapsresponseinfolist": "daps_response_info_list", + "datacodingscheme": "data_coding_scheme", + "dataforwardingaccepted": "data_forwarding_accepted", + "dataforwardingnotpossible": "data_forwarding_not_possible", + "dataforwardingresponsedrbitem": "data_forwarding_response_drb_item", + "dataforwardingresponsedrblist": "data_forwarding_response_drb_list", + "dataforwardingresponseerablist": "data_forwarding_response_erab_list", + "dataforwardingresponseerablistitem": "data_forwarding_response_erab_list_item", + "datasize": "data_size", + "dayofweek": "dayof_week", + "dcnid": "dcn_id", + "deactivatetrace": "deactivate_trace", + "delaycritical": "delay_critical", + "devicereportlist": "device_report_list", + "directforwardingpathavailability": "direct_forwarding_path_availability", + "discarddlcountvaluepdcpsnlength12": "discard_dlcount_value_pdcp_sn_length12", + "discarddlcountvaluepdcpsnlength15": "discard_dlcount_value_pdcp_sn_length15", + "discarddlcountvaluepdcpsnlength18": "discard_dlcount_value_pdcp_sn_length18", + "distanceradius": "distance_radius", + "distributionrelease": "distribution_release", + "distributionreleaserequest": "distribution_release_request", + "distributionreleaseresponse": "distribution_release_response", + "distributionsetup": "distribution_setup", + "distributionsetupfailure": "distribution_setup_failure", + "distributionsetuprequest": "distribution_setup_request", + "distributionsetupresponse": "distribution_setup_response", + "dlavailablebitratereportthresholds": "dl_available_bitrate_report_thresholds", + "dlcompositeavailablecapacity": "dl_composite_available_capacity", + "dlcount": "dl_count", + "dlcountchoice": "dl_count_choice", + "dlcountpdcpsnlength": "dlcount_pdcp_sn_length", + "dlcountvalue": "dl_count_value", + "dlcountvaluepdcpsnlength12": "dlcount_value_pdcp_sn_length12", + "dlcountvaluepdcpsnlength15": "dlcount_value_pdcp_sn_length15", + "dlcountvaluepdcpsnlength18": "dlcount_value_pdcp_sn_length18", + "dlcpsecurityinformation": "dl_cp_security_information", + "dldatasize": "dl_data_size", + "dldiscarding": "dl_discarding", + "dlehrpdcompositeavailablecapacity": "dl_ehrpd_composite_available_capacity", + "dlforwarding": "dl_forwarding", + "dlforwardinguptnlinformation": "dl_forwarding_up_tnl_information", + "dlgbrprbusage": "dl_gbr_prb_usage", + "dlgbrprbusageformimo": "dl_gbr_prb_usage_for_mimo", + "dlgtpteid": "dl_gtp_teid", + "dlnasmac": "dl_nas_mac", + "dlnaspdudeliveryackrequest": "dlnaspdu_delivery_ack_request", + "dlngutnlinformationreused": "dl_ngu_tnl_information_reused", + "dlnguuptnlinformation": "dl_ngu_up_tnl_information", + "dlnongbrprbusage": "dl_non_gbr_prb_usage", + "dlnongbrprbusageformimo": "dl_non_gbr_prb_usage_for_mimo", + "dlpdusetinformationmarkingsupportindication": "dlpdu_set_information_marking_support_indication", + "dlpdusetqosinformation": "dl_pdu_set_qos_information", + "dlqosflowpertnlinformation": "dl_qos_flow_per_tnl_information", + "dlschedulingpdcchcceusage": "dl_scheduling_pdcch_cce_usage", + "dlsignalling": "dl_signalling", + "dltotalprbusage": "dl_total_prb_usage", + "dltotalprbusageformimo": "dl_total_prb_usage_for_mimo", + "dltransportlayeraddress": "dl_transport_layer_address", + "downlinknastransport": "downlink_nas_transport", + "downlinknonueassociatedlppatransport": "downlink_non_ue_associated_lp_pa_transport", + "downlinknonueassociatednrppatransport": "downlink_non_ue_associated_nrp_pa_transport", + "downlinkranconfigurationtransfer": "downlink_ran_configuration_transfer", + "downlinkranearlystatustransfer": "downlink_ran_early_status_transfer", + "downlinkranstatustransfer": "downlink_ran_status_transfer", + "downlinkriminformationtransfer": "downlink_rim_information_transfer", + "downlinks1cdma2000tunnelling": "downlink_s1_cdma2000tunnelling", + "downlinktlcontainer": "downlink_tl_container", + "downlinkueassociatedlppatransport": "downlink_ue_associated_lp_pa_transport", + "downlinkueassociatednrppatransport": "downlink_ue_associated_nrp_pa_transport", + "drbid": "drb_id", + "drbssubjecttodldiscarding": "dr_bs_subject_to_dl_discarding", + "drbssubjecttodldiscardingitem": "dr_bs_subject_to_dl_discarding_item", + "drbssubjecttodldiscardinglist": "dr_bs_subject_to_dl_discarding_list", + "drbssubjecttoearlystatustransfer": "dr_bs_subject_to_early_status_transfer", + "drbssubjecttoearlystatustransferitem": "dr_bs_subject_to_early_status_transfer_item", + "drbssubjecttoearlystatustransferlist": "dr_bs_subject_to_early_status_transfer_list", + "drbssubjecttostatustransferitem": "dr_bs_subject_to_status_transfer_item", + "drbssubjecttostatustransferlist": "dr_bs_subject_to_status_transfer_list", + "drbstatusdl": "drb_status_dl", + "drbstatusdl12": "drb_status_dl12", + "drbstatusdl18": "drb_status_dl18", + "drbstatusul": "drb_status_ul", + "drbstatusul12": "drb_status_ul12", + "drbstatusul18": "drb_status_ul18", + "drbstoqosflowsmappingitem": "dr_bs_to_qos_flows_mapping_item", + "drbstoqosflowsmappinglist": "dr_bs_to_qos_flows_mapping_list", + "dynamic5qi": "dynamic5_qi", + "dynamic5qidescriptor": "dynamic5_qi_descriptor", + "earfcn": "earfcn", + "earlyiratho": "early_iratho", + "earlymeasurement": "early_measurement", + "earlystatustransfertransparentcontainer": "early_status_transfer_transparent_container", + "ecgi": "ecgi", + "ecgilist": "ecgi_list", + "ecgilistforrestart": "ecgi_list_for_restart", + "ecnmarkingatranrequest": "ecn_marking_at_ran_request", + "ecnmarkingatupfrequest": "ecn_marking_at_upf_request", + "ecnmarkingorcongestioninformationreportingrequest": "ecn_markingor_congestion_information_reporting_request", + "ecnmarkingorcongestioninformationreportingstatus": "ecn_markingor_congestion_information_reporting_status", + "ecnmarkingorcongestioninformationreportingstatusitem": "ecn_markingor_congestion_information_reporting_status_item", + "edtsession": "edt_session", + "ehrpd": "ehrpd", + "ehrpdcapacityvalue": "ehrpd_capacity_value", + "ehrpdcompositeavailablecapacity": "ehrpd_composite_available_capacity", + "ehrpdmultisectorloadreportingresponseitem": "ehrpd_multi_sector_load_reporting_response_item", + "ehrpdsectorcapacityclassvalue": "ehrpd_sector_capacity_class_value", + "ehrpdsectorid": "ehrpd_sector_id", + "ehrpdsectorloadreportingresponse": "ehrpd_sector_load_reporting_response", + "emergencyareaid": "emergency_area_id", + "emergencyareaidbroadcast": "emergency_area_id_broadcast", + "emergencyareaidbroadcasteutra": "emergency_area_id_broadcast_eutra", + "emergencyareaidbroadcasteutraitem": "emergency_area_id_broadcast_eutra_item", + "emergencyareaidbroadcastitem": "emergency_area_id_broadcast_item", + "emergencyareaidbroadcastnr": "emergency_area_id_broadcast_nr", + "emergencyareaidbroadcastnritem": "emergency_area_id_broadcast_nr_item", + "emergencyareaidcancelled": "emergency_area_id_cancelled", + "emergencyareaidcancelledeutra": "emergency_area_id_cancelled_eutra", + "emergencyareaidcancelledeutraitem": "emergency_area_id_cancelled_eutra_item", + "emergencyareaidcancelleditem": "emergency_area_id_cancelled_item", + "emergencyareaidcancellednr": "emergency_area_id_cancelled_nr", + "emergencyareaidcancellednritem": "emergency_area_id_cancelled_nr_item", + "emergencyareaidlist": "emergency_area_id_list", + "emergencyareaidlistforrestart": "emergency_area_id_list_for_restart", + "emergencyfallbackindicator": "emergency_fallback_indicator", + "emergencyfallbackrequestindicator": "emergency_fallback_request_indicator", + "emergencyindicator": "emergency_indicator", + "emergencyservicetargetcn": "emergency_service_target_cn", + "enbconfigurationtransfer": "enb_configuration_transfer", + "enbconfigurationupdate": "enb_configuration_update", + "enbconfigurationupdateacknowledge": "enb_configuration_update_acknowledge", + "enbconfigurationupdatefailure": "enb_configuration_update_failure", + "enbcprelocationindication": "enbcp_relocation_indication", + "enbdirectinformationtransfer": "enb_direct_information_transfer", + "enbearlystatustransfer": "enb_early_status_transfer", + "enbearlystatustransfertransparentcontainer": "enb_early_status_transfer_transparent_container", + "enbid": "enb_id", + "enbindirectx2transportlayeraddresses": "enb_indirect_x2_transport_layer_addresses", + "enbname": "en_bname", + "enbstatustransfer": "enb_status_transfer", + "enbstatustransfertransparentcontainer": "enb_status_transfer_transparent_container", + "enbues1apid": "enb_ue_s1ap_id", + "enbx2exttla": "enbx2_ext_tla", + "enbx2exttlas": "enbx2_ext_tl_as", + "enbx2gtptlas": "enbx2gtptl_as", + "enbx2tlas": "enbx2tl_as", + "enbx2transportlayeraddresses": "enbx2_transport_layer_addresses", + "encryptionalgorithms": "encryption_algorithms", + "endcsonconfigurationtransfer": "en_dcson_configuration_transfer", + "endcsonenbidentification": "en_dcso_ne_nb_identification", + "endcsonengnbidentification": "en_dcso_neng_nb_identification", + "endcsontransfertype": "en_dcson_transfer_type", + "endctransfertypereply": "en_dc_transfer_type_reply", + "endctransfertyperequest": "en_dc_transfer_type_request", + "endindication": "end_indication", + "endpointipaddress": "endpoint_ip_address", + "endpointipaddressandport": "endpoint_ip_address_and_port", + "endtimestamp": "end_time_stamp", + "energysavingsindication": "energy_savings_indication", + "engnbid": "en_g_nb_id", + "enhancedcoveragerestricted": "enhanced_coverage_restricted", + "enhancedcoveragerestriction": "enhanced_coverage_restriction", + "eplmns": "eplm_ns", + "epstac": "eps_tac", + "epstai": "eps_tai", + "equivalentplmns": "equivalent_plm_ns", + "equivalentsnpnsitem": "equivalent_snp_ns_item", + "equivalentsnpnslist": "equivalent_snp_ns_list", + "erabadmitteditem": "e_rab_admitted_item", + "erabadmittedlist": "e_rab_admitted_list", + "erabdataforwardingitem": "e_rab_data_forwarding_item", + "erabfailedtoresumeitemresumereq": "e_rab_failed_to_resume_item_resume_req", + "erabfailedtoresumeitemresumeres": "e_rab_failed_to_resume_item_resume_res", + "erabfailedtoresumelistresumereq": "e_rab_failed_to_resume_list_resume_req", + "erabfailedtoresumelistresumeres": "e_rab_failed_to_resume_list_resume_res", + "erabfailedtosetupitemhoreqack": "e_rab_failed_to_setup_item_ho_req_ack", + "erabfailedtosetuplisthoreqack": "e_rab_failedto_setup_list_ho_req_ack", + "erabguaranteedbitratedl": "e_rab_guaranteed_bitrate_dl", + "erabguaranteedbitrateul": "e_rab_guaranteed_bitrate_ul", + "erabid": "e_rab_id", + "erabinformationitem": "e_rab_information_item", + "erabinformationlist": "e_rab_information_list", + "erabinformationlistitem": "e_rab_information_list_item", + "erabitem": "e_rab_item", + "erablevelqosparameters": "e_ra_blevel_qos_parameters", + "erablist": "e_rab_list", + "erabmaximumbitratedl": "e_rab_maximum_bitrate_dl", + "erabmaximumbitrateul": "e_rab_maximum_bitrate_ul", + "erabmodificationconfirm": "e_rab_modification_confirm", + "erabmodificationindication": "e_rab_modification_indication", + "erabmodify": "e_rab_modify", + "erabmodifyitembearermodconf": "e_rab_modify_item_bearer_mod_conf", + "erabmodifyitembearermodres": "e_rab_modify_item_bearer_mod_res", + "erabmodifylistbearermodconf": "e_rab_modify_list_bearer_mod_conf", + "erabmodifylistbearermodres": "e_rab_modify_list_bearer_mod_res", + "erabmodifyrequest": "e_rab_modify_request", + "erabmodifyresponse": "e_rab_modify_response", + "erabnottobemodifieditembearermodind": "e_rab_not_to_be_modified_item_bearer_mod_ind", + "erabnottobemodifiedlistbearermodind": "e_rab_not_to_be_modified_list_bearer_mod_ind", + "erabrelease": "e_rab_release", + "erabreleasecommand": "e_rab_release_command", + "erabreleaseindication": "e_rab_release_indication", + "erabreleaseitembearerrelcomp": "e_rab_release_item_bearer_rel_comp", + "erabreleaselistbearerrelcomp": "e_rab_release_list_bearer_rel_comp", + "erabreleaseresponse": "e_rab_release_response", + "erabsecurityresultitem": "e_rab_security_result_item", + "erabsecurityresultlist": "e_rab_security_result_list", + "erabsetup": "e_rab_setup", + "erabsetupitembearersures": "e_rab_setup_item_bearer_su_res", + "erabsetupitemctxtsures": "e_rab_setup_item_ctxt_su_res", + "erabsetuplistbearersures": "e_rab_setup_list_bearer_su_res", + "erabsetuplistctxtsures": "e_rab_setup_list_ctxt_su_res", + "erabsetuprequest": "e_rab_setup_request", + "erabsetupresponse": "e_rab_setup_response", + "erabsubjecttodataforwardinglist": "e_rab_subjectto_data_forwarding_list", + "erabtobemodifieditembearermodind": "e_rab_to_be_modified_item_bearer_mod_ind", + "erabtobemodifieditembearermodreq": "e_rab_to_be_modified_item_bearer_mod_req", + "erabtobemodifiedlistbearermodind": "e_rab_to_be_modified_list_bearer_mod_ind", + "erabtobemodifiedlistbearermodreq": "e_rab_to_be_modified_list_bearer_mod_req", + "erabtobesetupitembearersureq": "e_rab_to_be_setup_item_bearer_su_req", + "erabtobesetupitemctxtsureq": "e_rab_to_be_setup_item_ctxt_su_req", + "erabtobesetupitemhoreq": "e_rab_to_be_setup_item_ho_req", + "erabtobesetuplistbearersureq": "e_rab_to_be_setup_list_bearer_su_req", + "erabtobesetuplistctxtsureq": "e_rab_to_be_setup_list_ctxt_su_req", + "erabtobesetuplisthoreq": "e_rab_to_be_setup_list_ho_req", + "erabtobeswitcheddlitem": "e_rab_to_be_switched_dl_item", + "erabtobeswitcheddllist": "e_rab_to_be_switched_dl_list", + "erabtobeswitchedulitem": "e_rab_to_be_switched_ul_item", + "erabtobeswitchedullist": "e_rab_to_be_switched_ul_list", + "erabtobeupdateditem": "e_rab_to_be_updated_item", + "erabtobeupdatedlist": "e_rab_to_be_updated_list", + "erabusagereportitem": "e_rab_usage_report_item", + "erabusagereportlist": "e_rab_usage_report_list", + "eredcapindication": "er_ed_cap_indication", + "errorindication": "error_indication", + "estimateofexpectedd2rmsgsize": "estimateof_expected_d2r_msg_size", + "ethernettype": "ethernet_type", + "eutracellidentity": "eutra_cell_identity", + "eutracgi": "eutra_cgi", + "eutracgilist": "eutra_cgi_list", + "eutracgilistforrestart": "eutra_cgi_listfor_restart", + "eutracgilistforwarning": "eutra_cgi_list_for_warning", + "eutracgipwsfailedlist": "eutra_cgi_pws_failed_list", + "eutraencryptionalgorithms": "eutr_aencryption_algorithms", + "eutraintegrityprotectionalgorithms": "eutr_aintegrity_protection_algorithms", + "eutran": "eutran", + "eutrancell": "e_utran_cell", + "eutrancellactivation": "eutran_cell_activation", + "eutrancellloadreportingresponse": "eutra_ncell_load_reporting_response", + "eutrancellreportitem": "eutran_cell_report_item", + "eutrancellreportlist": "eutran_cell_report_list", + "eutrancelltoreportitem": "eutran_cell_to_report_item", + "eutrancelltoreportlist": "eutran_cell_to_report_list", + "eutrancgi": "eutran_cgi", + "eutrancompositeavailablecapacitygroup": "eutran_composite_available_capacity_group", + "eutrannoofrrcconnections": "eutran_noof_rrc_connections", + "eutrannumberofactiveues": "eutran_number_of_active_ue_s", + "eutranradioresourcestatus": "eutran_radio_resource_status", + "eutranreportingstatus": "eutran_reporting_status", + "eutranreportingstatusies": "eutran_reporting_status_ie_s", + "eutranreportingsystemies": "eutran_reporting_system_ie_s", + "eutranresponse": "eutran_response", + "eutranroundtripdelayestimationinfo": "eutran_round_trip_delay_estimation_info", + "eutrantraceid": "e_utran_trace_id", + "eutrapagingedrxcycle": "eutra_paging_e_drx_cycle", + "eutrapagingedrxinformation": "eutra_paginge_drx_information", + "eutrapagingtimewindow": "eutra_paging_time_window", + "eventbasedreporting": "event_based_reporting", + "eventbasedreportingies": "event_based_reporting_ie_s", + "eventl1loggedmdtconfig": "event_l1_logged_mdt_config", + "eventtrigger": "event_trigger", + "eventtriggeredcellloadreporting": "event_triggered_cell_load_reporting", + "eventtriggeredcellloadreportingrequest": "event_triggered_cell_load_reporting_request", + "eventtriggeredcellloadreportingresponse": "event_triggered_cell_load_reporting_response", + "eventtype": "event_type", + "excesspacketdelaythresholdconfiguration": "excess_packet_delay_threshold_configuration", + "excesspacketdelaythresholditem": "excess_packet_delay_threshold_item", + "excesspacketdelaythresholdvalue": "excess_packet_delay_threshold_value", + "excludedcellstoaddmodlist": "excluded_cells_to_add_mod_list", + "existingngconnectionwithsamelocation": "existing_ng_connectionwith_same_location", + "expectedactivity": "expected_activity", + "expectedactivityperiod": "expected_activity_period", + "expectedd2rmsgsize": "expected_d2r_msg_size", + "expectedhointerval": "expected_ho_interval", + "expectedidleperiod": "expected_idle_period", + "expectedueactivitybehaviour": "expected_ue_activity_behaviour", + "expecteduebehaviour": "expected_ue_behaviour", + "expecteduemobility": "expected_ue_mobility", + "expecteduemovingtrajectory": "expected_ue_moving_trajectory", + "expecteduemovingtrajectoryitem": "expected_ue_moving_trajectory_item", + "extendedamfname": "extended_amf_name", + "extendedbitrate": "extended_bit_rate", + "extendedconnectedtime": "extended_connected_time", + "extendedmobilityinformation": "extended_mobility_information", + "extendedpacketdelaybudget": "extended_packet_delay_budget", + "extendedrannodename": "extended_ran_node_name", + "extendedratrestrictioninformation": "extended_rat_restriction_information", + "extendedrepetitionperiod": "extended_repetition_period", + "extendedreportintervalmdt": "extended_report_interval_mdt", + "extendedrncid": "extended_rnc_id", + "extendedslicesupportlist": "extended_slice_support_list", + "extendedueidentityindexvalue": "extended_ue_identity_index_value", + "extensionvalue": "extension_value", + "failurecellid": "failurecell_id", + "failureeventreport": "failure_event_report", + "failureeventreporting": "failure_event_reporting", + "failureeventreportingcause": "failure_event_reporting_cause", + "failureindication": "failure_indication", + "failureindicationinformation": "failure_indication_information", + "firstcriticality": "first_criticality", + "firstdlcount": "first_dl_count", + "firstvalue": "first_value", + "fivegcaction": "five_gc_action", + "fivegproseauthorized": "five_g_pro_se_authorized", + "fivegprosedirectcommunication": "five_gp_ro_se_direct_communication", + "fivegprosedirectdiscovery": "five_gp_ro_se_direct_discovery", + "fivegproseguaranteedflowbitrate": "five_gpro_seguaranteed_flow_bit_rate", + "fivegproselayer2mhintermediateuetonetworkrelay": "five_gp_ro_se_layer2_mh_intermediate_ue_to_network_relay", + "fivegproselayer2mhremote": "five_gp_ro_se_layer2_mh_remote", + "fivegproselayer2mhuetonetworkrelay": "five_gp_ro_se_layer2_mhue_to_network_relay", + "fivegproselayer2multipath": "five_gp_ro_se_layer2_multipath", + "fivegproselayer2remoteue": "five_gp_ro_se_layer2_remote_ue", + "fivegproselayer2uetonetworkrelay": "five_gp_ro_se_layer2_ue_to_network_relay", + "fivegproselayer2uetouerelay": "five_gp_ro_se_layer2_ue_to_ue_relay", + "fivegproselayer2uetoueremote": "five_gp_ro_se_layer2_ue_to_ue_remote", + "fivegproselayer3mhuetonetworkrelay": "five_gp_ro_se_layer3_mhue_to_network_relay", + "fivegproselayer3uetonetworkrelay": "five_gp_ro_se_layer3_ue_to_network_relay", + "fivegprosemaximumflowbitrate": "five_gpro_semaximum_flow_bit_rate", + "fivegprosepc5flowbitrates": "five_gpro_sepc5_flow_bit_rates", + "fivegprosepc5linkaggregatebitrates": "five_gp_ro_sepc5_link_aggregate_bit_rates", + "fivegprosepc5qosflowitem": "five_gp_ro_se_pc5_qos_flow_item", + "fivegprosepc5qosflowlist": "five_gp_ro_sepc5_qos_flow_list", + "fivegprosepc5qosparameters": "five_g_pro_se_pc5_qos_parameters", + "fivegprosepqi": "five_gpro_sep_qi", + "fivegproserange": "five_gpro_serange", + "fivegstac": "five_gstac", + "fivegstai": "five_gstai", + "fivegstmsi": "five_g_s_tmsi", + "fivegtmsi": "five_g_tmsi", + "fiveqi": "five_qi", + "forbiddenareainformation": "forbidden_area_information", + "forbiddenareainformationitem": "forbidden_area_information_item", + "forbiddeninterrats": "forbidden_inter_ra_ts", + "forbiddenlacs": "forbidden_la_cs", + "forbiddenlas": "forbidden_la_s", + "forbiddenlasitem": "forbidden_la_s_item", + "forbiddentacs": "forbidden_ta_cs", + "forbiddentas": "forbidden_ta_s", + "forbiddentasitem": "forbidden_ta_s_item", + "freqbandindicatornr": "freq_band_indicator_nr", + "frequencybandlist": "frequency_band_list", + "fromeutrantongran": "from_eutran_to_ngran", + "fromngrantoeutran": "from_ngran_to_eutran", + "furtherextendedueidentityindexvalue": "further_extended_ue_identity_index_value", + "gbrqosinformation": "gbr_qos_information", + "geographybasedmdt": "geography_based_mdt", + "geran": "geran", + "gerancell": "geran_cell", + "gerancellid": "geran_cell_id", + "geranresponse": "geran_response", + "global": "global", + "globalcableid": "global_cable_id", + "globalcableidnew": "global_cable_id_new", + "globalcellid": "global_cell_id", + "globalenbid": "global_enb_id", + "globalengnbid": "globaleng_nbid", + "globalgnbid": "globalg_nb_id", + "globallineid": "global_line_id", + "globallineidentity": "global_line_identity", + "globaln3iwfid": "global_n3iwf_id", + "globalngenbid": "global_ng_e_nb_id", + "globalrannodeid": "global_ran_node_id", + "globaltngfid": "global_tngf_id", + "globaltwifid": "global_twif_id", + "globalwagfid": "global_w_agf_id", + "gnb": "gnb", + "gnbid": "gnb_id", + "gnbidentity": "gnb_identity", + "gnbsetid": "gnb_set_id", + "groupdevices": "group_devices", + "gtpteid": "gtp_teid", + "gtptlaa": "gtptl_aa", + "gtptlas": "gtp_tl_as", + "gtptunnel": "gtp_tunnel", + "guami": "guami", + "guamilist": "guami_list", + "guamilistitem": "guami_list_item", + "guamitype": "guami_type", + "guaranteedflowbitrate": "guaranteed_flow_bit_rate", + "guaranteedflowbitratedl": "guaranteed_flow_bit_rate_dl", + "guaranteedflowbitrateul": "guaranteed_flow_bit_rate_ul", + "gummei": "gummei", + "gummeilist": "gummei_list", + "gummeitype": "gummei_type", + "gwcontextreleaseindication": "gw_context_release_indication", + "handovercancel": "handover_cancel", + "handovercancelacknowledge": "handover_cancel_acknowledge", + "handovercause": "handover_cause", + "handovercommand": "handover_command", + "handovercommandtransfer": "handover_command_transfer", + "handoverfailure": "handover_failure", + "handoverflag": "handover_flag", + "handovernotification": "handover_notification", + "handovernotify": "handover_notify", + "handoverpreparation": "handover_preparation", + "handoverpreparationfailure": "handover_preparation_failure", + "handoverpreparationunsuccessfultransfer": "handover_preparation_unsuccessful_transfer", + "handoverreporttype": "handover_report_type", + "handoverrequest": "handover_request", + "handoverrequestacknowledge": "handover_request_acknowledge", + "handoverrequestacknowledgetransfer": "handover_request_acknowledge_transfer", + "handoverrequesttransfer": "handover_request_transfer", + "handoverrequired": "handover_required", + "handoverrequiredtransfer": "handover_required_transfer", + "handoverresourceallocation": "handover_resource_allocation", + "handoverresourceallocationunsuccessfultransfer": "handover_resource_allocation_unsuccessful_transfer", + "handoverrestrictionlist": "handover_restriction_list", + "handoversuccess": "handover_success", + "handovertype": "handover_type", + "handoverwindowduration": "handover_window_duration", + "handoverwindowstart": "handover_window_start", + "hashedueidentityindexvalue": "hashed_ue_identity_index_value", + "hfcnodeid": "hfc_node_id", + "hfcnodeidnew": "hfc_node_id_new", + "hfn": "hfn", + "hfnforpdcpsnlength18": "hfn_for_pdcp_sn_length18", + "hfnmodified": "hfn_modified", + "hfnpdcpsn12": "hfn_pdcp_sn12", + "hfnpdcpsn18": "hfn_pdcp_sn18", + "higheraltitudethreshold": "higher_altitude_threshold", + "hlcomactivate": "hl_com_activate", + "hlcomdeactivate": "hl_com_deactivate", + "hocausevalue": "ho_cause_value", + "homeenbid": "home_enb_id", + "horeport": "ho_report", + "horeportinformation": "ho_report_information", + "horeporting": "ho_reporting", + "horeportingcause": "ho_reporting_cause", + "horeporttype": "ho_report_type", + "hosourceid": "hosource_id", + "hotargetid": "ho_target_id", + "hotype": "ho_type", + "howindowduration": "ho_window_duration", + "howindowstart": "ho_window_start", + "hysteresis": "hysteresis", + "iabauthorized": "iab_authorized", + "iabnodeindication": "iab_node_indication", + "iabsupported": "iab_supported", + "id": "id", + "ida2xpc5qosparameters": "id_a2x_pc5_qos_parameters", + "idadditionalcancelledlocationreportingreferenceidlist": "id_additional_cancelledlocation_reporting_reference_id_list", + "idadditionaldlforwardinguptnlinformation": "id_additional_dl_forwarding_uptnl_information", + "idadditionaldlqosflowpertnlinformation": "id_additional_dl_qos_flow_per_tnl_information", + "idadditionaldluptnlinformationforholist": "id_additional_dluptnl_information_for_ho_list", + "idadditionalnguuptnlinformation": "id_additional_ngu_up_tnl_information", + "idadditionalredundantdlnguuptnlinformation": "id_additional_redundant_dl_ngu_up_tnl_information", + "idadditionalredundantdlqosflowpertnlinformation": "id_additional_redundant_dl_qos_flow_per_tnl_information", + "idadditionalredundantnguuptnlinformation": "id_additional_redundant_ngu_up_tnl_information", + "idadditionalredundantulnguuptnlinformation": "id_additional_redundant_ul_ngu_up_tnl_information", + "idadditionalulforwardinguptnlinformation": "id_additional_ul_forwarding_uptnl_information", + "idadditionaluli": "id_additional_uli", + "idadditionalulnguuptnlinformation": "id_additional_ul_ngu_up_tnl_information", + "idaerialueflightinformationongoingreportingfailed": "id_aerial_ue_flight_information_ongoing_reporting_failed", + "idaerialueflightinformationreporting": "id_aerial_ue_flight_information_reporting", + "idaerialueflightinformationreportingcontrollist": "id_aerial_ue_flight_information_reporting_control_list", + "idaerialuesubscriptioninformation": "id_aerial_ue_subscription_information", + "idaiotcommandassistanceinformation": "id_aiot_command_assistance_information", + "idaiotcorrelationidentifier": "id_aiot_correlation_identifier", + "idaiotdeviceidentificationrequested": "id_aiot_device_identification_requested", + "idaiotfidentifier": "id_aiotf_identifier", + "idaiotfname": "id_aiotf_name", + "idaiotfollowoncommandindication": "id_aiot_followon_command_indication", + "idaiotinventoryassistanceinformation": "id_aiot_inventory_assistance_information", + "idaiotnaspdu": "id_aiot_naspdu", + "idaiotrequestedserviceareainformation": "id_aiot_requested_service_area_information", + "idaiotsecurityinfo": "id_aiot_security_info", + "idaiotsessionreleasecommandtransfer": "id_aiot_session_release_command_transfer", + "idaiotsessionreleasecompletetransfer": "id_aiot_session_release_complete_transfer", + "idaiotsessionreleaserequest": "id_aiot_session_release_request", + "idaiotsessionreleaserequesttransfer": "id_aiot_session_release_request_transfer", + "idaiotsupport": "id_aiot_support", + "idallowednssai": "id_allowed_nssai", + "idalternativeqosparasetlist": "id_alternative_qos_para_set_list", + "idamfconfigurationupdate": "id_amf_configuration_update", + "idamfname": "id_amf_name", + "idamfoverloadresponse": "id_amf_overload_response", + "idamfsetid": "id_amf_set_id", + "idamftnlassociationfailedtosetuplist": "id_amf_tnl_association_failed_to_setup_list", + "idamftnlassociationsetuplist": "id_amf_tnl_association_setup_list", + "idamftnlassociationtoaddlist": "id_amf_tnl_association_to_add_list", + "idamftnlassociationtoremovelist": "id_amf_tnl_association_to_remove_list", + "idamftnlassociationtoupdatelist": "id_amf_tnl_association_to_update_list", + "idamftrafficloadreductionindication": "id_amf_traffic_load_reduction_indication", + "idamfuengapid": "id_amf_ue_ngap_id", + "idamfuengapid2": "id_amf_ue_ngap_id2", + "idanpacketdelaybudgetul": "id_an_packet_delay_budget_ul", + "idassistancedataforpaging": "id_assistance_data_for_paging", + "idassistanceinformationqoemeas": "id_assistance_information_qo_e_meas", + "idassociatedsessionid": "id_associated_session_id", + "idaun3deviceaccessinfo": "id_aun3_device_access_info", + "idauthenticatedindication": "id_authenticated_indication", + "idbeammeasurementsreportconfiguration": "id_beam_measurements_report_configuration", + "idbroadcastcancelledarealist": "id_broadcast_cancelled_area_list", + "idbroadcastcompletedarealist": "id_broadcast_completed_area_list", + "idbroadcasttransportfailuretransfer": "id_broadcast_transport_failure_transfer", + "idbroadcasttransportrequesttransfer": "id_broadcast_transport_request_transfer", + "idbroadcasttransportresponsetransfer": "id_broadcast_transport_response_transfer", + "idburstarrivaltimedownlink": "id_burst_arrival_time_downlink", + "idcancelallwarningmessages": "id_cancel_all_warning_messages", + "idcandidaterelayueinformationlist": "id_candidate_relay_ue_information_list", + "idcause": "id_cause", + "idcellidlistforrestart": "id_cell_id_list_for_restart", + "idcemodebrestricted": "id_ce_mode_brestricted", + "idcemodebsupportindicator": "id_ce_mode_bs_upport_indicator", + "idclockqualityreportingcontrolinfo": "id_clock_quality_reporting_control_info", + "idcnassistedrantuning": "id_cn_assisted_ran_tuning", + "idcnmtcommunicationhandling": "id_cn_mt_communication_handling", + "idcnpacketdelaybudgetdl": "id_cn_packet_delay_budget_dl", + "idcnpacketdelaybudgetul": "id_cn_packet_delay_budget_ul", + "idcntyperestrictionsforequivalent": "id_cn_type_restrictions_for_equivalent", + "idcntyperestrictionsforserving": "id_cn_type_restrictions_for_serving", + "idcommandfailuretransfer": "id_command_failure_transfer", + "idcommandrequesttransfer": "id_command_request_transfer", + "idcommandresponsetransfer": "id_command_response_transfer", + "idcommonnetworkinstance": "id_common_network_instance", + "idcommservicetype": "id_comm_service_type", + "idconcurrentwarningmessageind": "id_concurrent_warning_message_ind", + "idconfiguredtacindication": "id_configured_tac_indication", + "idcorenetworkassistanceinformationforinactive": "id_core_network_assistance_information_for_inactive", + "idcriticalitydiagnostics": "id_criticality_diagnostics", + "idcurrentqosparasetindex": "id_current_qos_para_set_index", + "iddapsrequestinfo": "id_daps_request_info", + "iddapsresponseinfolist": "id_daps_response_info_list", + "iddatacodingscheme": "id_data_coding_scheme", + "iddataforwardingnotpossible": "id_data_forwarding_not_possible", + "iddataforwardingresponseerablist": "id_data_forwarding_response_erab_list", + "iddefaultpagingdrx": "id_default_paging_drx", + "iddirectforwardingpathavailability": "id_direct_forwarding_path_availability", + "iddlcpsecurityinformation": "id_dl_cp_security_information", + "iddldiscarding": "id_dl_discarding", + "iddlnguuptnlinformation": "id_dl_ngu_up_tnl_information", + "iddlpdusetinformationmarkingsupportindication": "id_dlpdu_set_information_marking_support_indication", + "iddlsignalling": "id_dl_signalling", + "iddownlinktlcontainer": "id_downlink_tl_container", + "idearlymeasurement": "id_early_measurement", + "idearlystatustransfertransparentcontainer": "id_early_status_transfer_transparent_container", + "idecnmarkingorcongestioninformationreportingrequest": "id_ecn_markingor_congestion_information_reporting_request", + "idecnmarkingorcongestioninformationreportingstatus": "id_ecn_markingor_congestion_information_reporting_status", + "idedtsession": "id_edt_session", + "idemergencyareaidlistforrestart": "id_emergency_area_id_list_for_restart", + "idemergencyfallbackindicator": "id_emergency_fallback_indicator", + "idendcsonconfigurationtransferdl": "id_endc_son_configuration_transfer_dl", + "idendcsonconfigurationtransferul": "id_endc_son_configuration_transfer_ul", + "idendindication": "id_end_indication", + "idendpointipaddressandport": "id_endpoint_ip_address_and_port", + "idenergysavingindication": "id_energy_saving_indication", + "idenhancedcoveragerestriction": "id_enhanced_coverage_restriction", + "idequivalentsnpnslist": "id_equivalent_snp_ns_list", + "ideredcapindication": "id_er_ed_cap_indication", + "ideutracgi": "id_eutra_cgi", + "ideutrapagingedrxinformation": "id_eutra_paginge_drx_information", + "idexcesspacketdelaythresholdconfiguration": "id_excess_packet_delay_threshold_configuration", + "idextendedamfname": "id_extended_amf_name", + "idextendedbackupamfname": "id_extended_backup_amf_name", + "idextendedconnectedtime": "id_extended_connected_time", + "idextendedmobilityinformation": "id_extended_mobility_information", + "idextendedoldamf": "id_extended_old_amf", + "idextendedpacketdelaybudget": "id_extended_packet_delay_budget", + "idextendedrannodename": "id_extended_ran_node_name", + "idextendedratrestrictioninformation": "id_extended_rat_restriction_information", + "idextendedreportintervalmdt": "id_extended_report_interval_mdt", + "idextendedslicesupportlist": "id_extended_slice_support_list", + "idextendedtaislicesupportlist": "id_extended_tai_slice_support_list", + "idextendedueidentityindexvalue": "id_extended_ue_identity_index_value", + "idfivegcaction": "id_five_gc_action", + "idfivegproseauthorized": "id_five_g_pro_se_authorized", + "idfivegproselayer2mhintermediateuetonetworkrelay": "id_five_gp_ro_se_layer2_mh_intermediate_ue_to_network_relay", + "idfivegproselayer2mhremote": "id_five_gp_ro_se_layer2_mh_remote", + "idfivegproselayer2mhuetonetworkrelay": "id_five_gp_ro_se_layer2_mhue_to_network_relay", + "idfivegproselayer2multipath": "id_five_gp_ro_se_layer2_multipath", + "idfivegproselayer2uetouerelay": "id_five_gp_ro_se_layer2_ue_to_ue_relay", + "idfivegproselayer2uetoueremote": "id_five_gp_ro_se_layer2_ue_to_ue_remote", + "idfivegproselayer3mhuetonetworkrelay": "id_five_gp_ro_se_layer3_mhue_to_network_relay", + "idfivegprosepc5qosparameters": "id_five_g_pro_se_pc5_qos_parameters", + "idfivegproseuepc5aggregatemaximumbitrate": "id_five_g_pro_se_uepc5_aggregate_maximum_bit_rate", + "idfivegstmsi": "id_five_g_s_tmsi", + "idfurtherextendedueidentityindexvalue": "id_further_extended_ue_identity_index_value", + "idgeographybasedmdt": "id_geography_based_mdt", + "idglobalcableid": "id_global_cable_id", + "idglobalcableidnew": "id_global_cable_id_new", + "idglobalrannodeid": "id_global_ran_node_id", + "idglobaltngfid": "id_global_tngf_id", + "idglobaltwifid": "id_global_twif_id", + "idglobalwagfid": "id_global_w_agf_id", + "idguami": "id_guami", + "idguamilist": "id_guami_list", + "idguamitype": "id_guami_type", + "idgwcontextreleaseindication": "id_gw_context_release_indication", + "idhandoverflag": "id_handover_flag", + "idhandoverpreparation": "id_handover_preparation", + "idhandovertype": "id_handover_type", + "idhashedueidentityindexvalue": "id_hashed_ue_identity_index_value", + "idhfcnodeidnew": "id_hfc_node_id_new", + "idiabauthorized": "id_iab_authorized", + "idiabnodeindication": "id_iab_node_indication", + "idiabsupported": "id_iab_supported", + "idimsvoicesupportindicator": "id_ims_voice_support_indicator", + "idincludebeammeasurementsindication": "id_include_beam_measurements_indication", + "idindextorfsp": "id_index_to_rfsp", + "idindicationofbitrateadaptation": "id_indication_of_bitrate_adaptation", + "idinfoonrecommendedcellsandrannodesforpaging": "id_info_on_recommended_cells_and_ran_nodes_for_paging", + "idintersystemmobilityfailureforvoicefallback": "id_intersystem_mobility_failurefor_voice_fallback", + "idintersystemresourcestatusupdate": "id_intersystem_resource_status_update", + "idintersystemsonconfigurationtransferdl": "id_intersystem_son_configuration_transfer_dl", + "idintersystemsonconfigurationtransferul": "id_intersystem_son_configuration_transfer_ul", + "idintersystemsoninformationreply": "id_intersystem_son_information_reply", + "idintersystemsoninformationrequest": "id_intersystem_son_information_request", + "idinventoryfailuretransfer": "id_inventory_failure_transfer", + "idinventoryreporttransfer": "id_inventory_report_transfer", + "idinventoryrequesttransfer": "id_inventory_request_transfer", + "idinventoryresponsetransfer": "id_inventory_response_transfer", + "idlasteutranplmnidentity": "id_last_eutran_plmn_identity", + "idlastvisitedpscelllist": "id_last_visited_ps_cell_list", + "idlocationreportingadditionalinfo": "id_location_reporting_additional_info", + "idlocationreportingrequesttype": "id_location_reporting_request_type", + "idlpwusdisableindication": "id_lpwus_disable_indication", + "idlpwuspsassistanceinformation": "id_lpwusps_assistance_information", + "idltea2xservicesauthorized": "id_lte_a2x_services_authorized", + "idltea2xuepc5aggregatemaximumbitrate": "id_lte_a2x_ue_pc5_aggregate_maximum_bit_rate", + "idltemindication": "id_ltem_indication", + "idlteuesidelinkaggregatemaximumbitrate": "id_lteue_sidelink_aggregate_maximum_bitrate", + "idltev2xservicesauthorized": "id_ltev2x_services_authorized", + "idm4reportamount": "id_m4_report_amount", + "idm5reportamount": "id_m5_report_amount", + "idm6reportamount": "id_m6_report_amount", + "idm7reportamount": "id_m7_report_amount", + "idmanagementbasedmdtplmnlist": "id_management_based_mdtplmn_list", + "idmanagementbasedmdtplmnmodificationlist": "id_management_based_mdtplmn_modification_list", + "idmaskedimeisv": "id_masked_imeisv", + "idmaximumdataburstvolume": "id_maximum_data_burst_volume", + "idmaximumintegrityprotecteddataratedl": "id_maximum_integrity_protected_data_rate_dl", + "idmbsactivesessioninformationsourcetotargetlist": "id_mbs_active_session_information_sourceto_target_list", + "idmbsactivesessioninformationtargettosourcelist": "id_mbs_active_session_information_targetto_source_list", + "idmbsareasessionid": "id_mbs_area_session_id", + "idmbsassistanceinformation": "id_mbs_assistance_information", + "idmbsdistributionreleaserequesttransfer": "id_mbs_distribution_release_request_transfer", + "idmbsdistributionsetuprequesttransfer": "id_mbs_distribution_setup_request_transfer", + "idmbsdistributionsetupresponsetransfer": "id_mbs_distribution_setup_response_transfer", + "idmbsdistributionsetupunsuccessfultransfer": "id_mbs_distribution_setup_unsuccessful_transfer", + "idmbsintendedservicearealist": "id_mbs_intended_service_area_list", + "idmbsngufailureindication": "id_mbs_ngu_failure_indication", + "idmbsqosflowstobesetuplist": "id_mbs_qos_flows_to_be_setup_list", + "idmbsqosflowstobesetupmodlist": "id_mbs_qos_flows_to_be_setup_mod_list", + "idmbsqosflowtoreleaselist": "id_mbs_qos_flow_to_release_list", + "idmbsservicearea": "id_mbs_service_area", + "idmbssessionfailedtosetuplist": "id_mbs_session_failedto_setup_list", + "idmbssessionfailedtosetupormodifylist": "id_mbs_session_failedto_setupor_modify_list", + "idmbssessionfsaidlist": "id_mbs_session_fsaid_list", + "idmbssessionid": "id_mbs_session_id", + "idmbssessionmodificationfailuretransfer": "id_mbs_session_modification_failure_transfer", + "idmbssessionmodificationrequesttransfer": "id_mbs_session_modification_request_transfer", + "idmbssessionmodificationresponsetransfer": "id_mbs_session_modification_response_transfer", + "idmbssessionreleaseresponsetransfer": "id_mbs_session_release_response_transfer", + "idmbssessionsetupfailuretransfer": "id_mbs_session_setup_failure_transfer", + "idmbssessionsetupormodifyrequestlist": "id_mbs_session_setupor_modify_request_list", + "idmbssessionsetupormodifyresponselist": "id_mbs_session_setupor_modify_response_list", + "idmbssessionsetuprequestlist": "id_mbs_session_setup_request_list", + "idmbssessionsetuprequesttransfer": "id_mbs_session_setup_request_transfer", + "idmbssessionsetupresponselist": "id_mbs_session_setup_response_list", + "idmbssessionsetupresponsetransfer": "id_mbs_session_setup_response_transfer", + "idmbssessiontnlinfo5gc": "id_mbs_session_tnl_info5_gc", + "idmbssessiontoreleaselist": "id_mbs_session_to_release_list", + "idmbssupportindicator": "id_mbs_support_indicator", + "idmbsupfailureindication": "id_mbs_up_failure_indication", + "idmdtconfiguration": "id_mdt_configuration", + "idmessageidentifier": "id_message_identifier", + "idmicoallplmn": "id_mico_all_plmn", + "idmmeues1apid": "id_mme_ue_s1ap_id", + "idmmsid": "id_mmsid", + "idmnonlymdtcollection": "id_mn_only_mdt_collection", + "idmobileiabauthorized": "id_mobile_iab_authorized", + "idmobileiabmtuserlocationinformation": "id_mobile_iab_mt_user_location_information", + "idmobileiabnodeindication": "id_mobile_iab_node_indication", + "idmobileiabsupported": "id_mobile_iab_supported", + "idmobilityrestrictionlist": "id_mobility_restriction_list", + "idmonitoringrequestonavailablebitrate": "id_monitoring_requeston_available_bitrate", + "idmulticastgrouppagingarealist": "id_multicast_group_paging_area_list", + "idmulticastsessionactivationrequesttransfer": "id_multicast_session_activation_request_transfer", + "idmulticastsessiondeactivationrequesttransfer": "id_multicast_session_deactivation_request_transfer", + "idmulticastsessionupdaterequesttransfer": "id_multicast_session_update_request_transfer", + "idn6jitterinformation": "id_n6_jitter_information", + "idnasc": "id_nasc", + "idnaspdu": "id_nas_pdu", + "idnassecurityparametersfromngran": "id_nas_security_parameters_from_ngran", + "idnbiotdefaultpagingdrx": "id_nb_io_t_default_paging_drx", + "idnbiotpagingdrx": "id_nb_io_t_paging_drx", + "idnbiotpagingedrxinfo": "id_nb_io_t_paging_e_drx_info", + "idnbiotuepriority": "id_nb_io_t_ue_priority", + "idnetworkcontrolledrepeaterauthorized": "id_network_controlled_repeater_authorized", + "idnetworkinstance": "id_network_instance", + "idnetworksliceareascopeofmdt": "id_network_slice_area_scopeof_mdt", + "idnewamfuengapid": "id_new_amf_ue_ngap_id", + "idnewguami": "id_new_guami", + "idnewsecuritycontextind": "id_new_security_context_ind", + "idngapiesupportinformationrequestlist": "id_ngapie_support_information_request_list", + "idngapiesupportinformationresponselist": "id_ngapie_support_information_response_list", + "idngapmessage": "id_ngap_message", + "idngrancgi": "id_ngran_cgi", + "idngrantnlassociationtoremovelist": "id_ngran_tnl_association_to_remove_list", + "idngrantraceid": "id_ngran_trace_id", + "idnid": "id_nid", + "idnopdusessionindication": "id_no_pdu_session_indication", + "idnotifysourcengrannode": "id_notify_source_ngran_node", + "idnpnaccessinformation": "id_npn_access_information", + "idnpnmobilityinformation": "id_npn_mobility_information", + "idnpnpagingassistanceinformation": "id_npn_paging_assistance_information", + "idnpnsupport": "id_npn_support", + "idnra2xservicesauthorized": "id_nr_a2x_services_authorized", + "idnra2xuepc5aggregatemaximumbitrate": "id_nr_a2x_ue_pc5_aggregate_maximum_bit_rate", + "idnrcgi": "id_nr_cgi", + "idnrntntaiinformation": "id_nrntntai_information", + "idnrpagingedrxinformation": "id_nr_paginge_drx_information", + "idnrppapdu": "id_nrp_pa_pdu", + "idnruesidelinkaggregatemaximumbitrate": "id_nrue_sidelink_aggregate_maximum_bitrate", + "idnrv2xservicesauthorized": "id_nrv2x_services_authorized", + "idnumberofbroadcastsrequested": "id_number_of_broadcasts_requested", + "idoldamf": "id_old_amf", + "idoldassociatedqosflowlistulendmarkerexpected": "id_old_associated_qos_flow_list_ul_endmarkerexpected", + "idonboardingsupport": "id_onboarding_support", + "idoverloadstartnssailist": "id_overload_start_nssai_list", + "idpagingassisdataforcecapabue": "id_paging_assis_datafor_ce_capab_ue", + "idpagingcause": "id_paging_cause", + "idpagingcauseindicationforvoiceservice": "id_paging_cause_indication_for_voice_service", + "idpagingdrx": "id_paging_drx", + "idpagingorigin": "id_paging_origin", + "idpagingpolicydifferentiation": "id_paging_policy_differentiation", + "idpagingpriority": "id_paging_priority", + "idpartiallyallowednssai": "id_partially_allowed_nssai", + "idpc5qosparameters": "id_pc5_qos_parameters", + "idpdusessionaggregatemaximumbitrate": "id_pdu_session_aggregate_maximum_bit_rate", + "idpdusessionexpectedueactivitybehaviour": "id_pdu_session_expected_ue_activity_behaviour", + "idpdusessionlistmtcommhreq": "id_pdu_session_list_mt_comm_hr_eq", + "idpdusessionpairid": "id_pdu_session_pair_id", + "idpdusessionresourceadmittedlist": "id_pdu_session_resource_admitted_list", + "idpdusessionresourcefailedtomodifylistmodcfm": "id_pdu_session_resource_failed_to_modify_list_mod_cfm", + "idpdusessionresourcefailedtomodifylistmodres": "id_pdu_session_resource_failed_to_modify_list_mod_res", + "idpdusessionresourcefailedtoresumelistresreq": "id_pdu_session_resource_failed_to_resume_list_res_req", + "idpdusessionresourcefailedtoresumelistresres": "id_pdu_session_resource_failed_to_resume_list_res_res", + "idpdusessionresourcefailedtosetuplistcxtfail": "id_pdu_session_resource_failed_to_setup_list_cxt_fail", + "idpdusessionresourcefailedtosetuplistcxtres": "id_pdu_session_resource_failed_to_setup_list_cxt_res", + "idpdusessionresourcefailedtosetuplisthoack": "id_pdu_session_resource_failed_to_setup_list_ho_ack", + "idpdusessionresourcefailedtosetuplistpsreq": "id_pdu_session_resource_failed_to_setup_list_ps_req", + "idpdusessionresourcefailedtosetuplistsures": "id_pdu_session_resource_failed_to_setup_list_su_res", + "idpdusessionresourcehandoverlist": "id_pdu_session_resource_handover_list", + "idpdusessionresourcelistcxtrelcpl": "id_pdu_session_resource_list_cxt_rel_cpl", + "idpdusessionresourcelistcxtrelreq": "id_pdu_session_resource_list_cxt_rel_req", + "idpdusessionresourcelisthorqd": "id_pdu_session_resource_list_ho_rqd", + "idpdusessionresourcemodifylistmodcfm": "id_pdu_session_resource_modify_list_mod_cfm", + "idpdusessionresourcemodifylistmodind": "id_pdu_session_resource_modify_list_mod_ind", + "idpdusessionresourcemodifylistmodreq": "id_pdu_session_resource_modify_list_mod_req", + "idpdusessionresourcemodifylistmodres": "id_pdu_session_resource_modify_list_mod_res", + "idpdusessionresourcenotifylist": "id_pdu_session_resource_notify_list", + "idpdusessionresourcereleasedlistnot": "id_pdu_session_resource_released_list_not", + "idpdusessionresourcereleasedlistpsack": "id_pdu_session_resource_released_list_ps_ack", + "idpdusessionresourcereleasedlistpsfail": "id_pdu_session_resource_released_list_ps_fail", + "idpdusessionresourcereleasedlistrelres": "id_pdu_session_resource_released_list_rel_res", + "idpdusessionresourcereleaseresponsetransfer": "id_pdu_session_resource_release_response_transfer", + "idpdusessionresourceresumelistresreq": "id_pdu_session_resource_resume_list_res_req", + "idpdusessionresourceresumelistresres": "id_pdu_session_resource_resume_list_res_res", + "idpdusessionresourcesecondaryratusagelist": "id_pdu_session_resource_secondary_rat_usage_list", + "idpdusessionresourcesetuplistcxtreq": "id_pdu_session_resource_setup_list_cxt_req", + "idpdusessionresourcesetuplistcxtres": "id_pdu_session_resource_setup_list_cxt_res", + "idpdusessionresourcesetuplisthoreq": "id_pdu_session_resource_setup_list_ho_req", + "idpdusessionresourcesetuplistsureq": "id_pdu_session_resource_setup_list_su_req", + "idpdusessionresourcesetuplistsures": "id_pdu_session_resource_setup_list_su_res", + "idpdusessionresourcesuspendlistsusreq": "id_pdu_session_resource_suspend_list_sus_req", + "idpdusessionresourceswitchedlist": "id_pdu_session_resource_switched_list", + "idpdusessionresourcetobeswitcheddllist": "id_pdu_session_resource_to_be_switched_dl_list", + "idpdusessionresourcetoreleaselisthocmd": "id_pdu_session_resource_to_release_list_ho_cmd", + "idpdusessionresourcetoreleaselistrelcmd": "id_pdu_session_resource_to_release_list_rel_cmd", + "idpdusessiontype": "id_pdu_session_type", + "idpdusetbasedhandlingindicator": "id_pdu_setbased_handling_indicator", + "idpdusetdelaybudgetdownlink": "id_pdu_set_delay_budget_downlink", + "idpdusetdelaybudgetuplink": "id_pdu_set_delay_budget_uplink", + "idpduseterrorratedownlink": "id_pdu_set_error_rate_downlink", + "idpduseterrorrateuplink": "id_pdu_set_error_rate_uplink", + "idpdusetqosparameters": "id_pd_uset_qos_parameters", + "idpeipsassistanceinformation": "id_peip_sassistance_information", + "idplmnsupportlist": "id_plmn_support_list", + "idpninpnareascopeofmdt": "id_pni_npn_area_scopeof_mdt", + "idpninpnbasedmdt": "id_pni_npn_based_mdt", + "idprivacyindicator": "id_privacy_indicator", + "idpscellinformation": "id_ps_cell_information", + "idpwsfailedcellidlist": "id_pws_failed_cell_id_list", + "idqmcconfiginfo": "id_qmc_config_info", + "idqmcdeactivation": "id_qmc_deactivation", + "idqoervqoereportingpaths": "id_qo_erv_qo_er_eporting_paths", + "idqosflowadditionalinfolist": "id_qos_flow_additional_info_list", + "idqosflowaddormodifyrequestlist": "id_qos_flow_add_or_modify_request_list", + "idqosflowfailedtosetuplist": "id_qos_flow_failed_to_setup_list", + "idqosflowfeedbacklist": "id_qos_flow_feedback_list", + "idqosflowparameterslist": "id_qos_flow_parameters_list", + "idqosflowsetuprequestlist": "id_qos_flow_setup_request_list", + "idqosflowtoreleaselist": "id_qos_flow_to_release_list", + "idqosflowtsclist": "id_qos_flow_tsc_list", + "idqosmonitoringreportingfrequency": "id_qos_monitoring_reporting_frequency", + "idqosmonitoringrequest": "id_qos_monitoring_request", + "idranaiotdevicengapid": "id_ran_aiot_device_ngap_id", + "idranfeedbacktype": "id_ra_nfeedbacktype", + "idrannodename": "id_ran_node_name", + "idranpagingpriority": "id_ran_paging_priority", + "idranstatustransfertransparentcontainer": "id_ran_status_transfer_transparent_container", + "idrantimingsynchronisationstatusinfo": "id_ran_timing_synchronisation_status_info", + "idrantssrequesttype": "id_ran_tss_request_type", + "idrantssscope": "id_ran_tss_scope", + "idranuengapid": "id_ran_ue_ngap_id", + "idratinformation": "id_rat_information", + "idredcapindication": "id_red_cap_indication", + "idredirectionvoicefallback": "id_redirection_voice_fallback", + "idredundantcommonnetworkinstance": "id_redundant_common_network_instance", + "idredundantdlngutnlinformationreused": "id_redundant_dl_ngu_tnl_information_reused", + "idredundantdlnguuptnlinformation": "id_redundant_dl_ngu_up_tnl_information", + "idredundantdlqosflowpertnlinformation": "id_redundant_dl_qos_flow_per_tnl_information", + "idredundantpdusessioninformation": "id_redundant_pdu_session_information", + "idredundantqosflowindicator": "id_redundant_qos_flow_indicator", + "idredundantulnguuptnlinformation": "id_redundant_ul_ngu_up_tnl_information", + "idrelativeamfcapacity": "id_relative_amf_capacity", + "idrepetitionperiod": "id_repetition_period", + "idrequestednssai": "id_requested_nssai", + "idrequestedtnlinfo": "id_requested_tnl_info", + "idresettype": "id_reset_type", + "idrglevelwirelineaccesscharacteristics": "id_rg_level_wireline_access_characteristics", + "idriminformationtransfer": "id_rim_information_transfer", + "idroutingid": "id_routing_id", + "idrrcestablishmentcause": "id_rrc_establishment_cause", + "idrrcinactivetransitionreportrequest": "id_rrc_inactive_transition_report_request", + "idrrcresumecause": "id_rrc_resume_cause", + "idrrcstate": "id_rrc_state", + "ids1removal": "id_s1_removal", + "idscgactivationtime": "id_scg_activation_time", + "idsctptlas": "id_sctp_tl_as", + "idsecondaryratusageinformation": "id_secondary_rat_usage_information", + "idsecuritycontext": "id_security_context", + "idsecurityindication": "id_security_indication", + "idsecuritykey": "id_security_key", + "idsecurityresult": "id_security_result", + "idselectednid": "id_selected_nid", + "idselectedplmnidentity": "id_selected_plmn_identity", + "idselectedtargetsnpnidentity": "id_selected_target_snpn_identity", + "idserialnumber": "id_serial_number", + "idservedguamilist": "id_served_guami_list", + "idsgnbuex2apid": "id_sg_nb_ue_x2ap_id", + "idslicesupportlist": "id_slice_support_list", + "idslpositioningrangingserviceinfo": "id_sl_positioning_ranging_service_info", + "idsnpnbasedmdt": "id_snpn_based_mdt", + "idsnpncellbasedmdt": "id_snpn_cell_based_mdt", + "idsnpntaibasedmdt": "id_snpn_tai_based_mdt", + "idsnssai": "id_s_nssai", + "idsonconfigurationtransferdl": "id_son_configuration_transfer_dl", + "idsonconfigurationtransferul": "id_son_configuration_transfer_ul", + "idsoninformationreport": "id_son_information_report", + "idsourceamfguami": "id_source_amf_guami", + "idsourceamfuengapid": "id_source_amf_ue_ngap_id", + "idsourcenodeid": "id_source_node_id", + "idsourcenodetnladdrinfo": "id_source_node_tnl_addr_info", + "idsourcesntotargetsnqmcinfo": "id_source_sn_to_target_sn_qmc_info", + "idsourcetnladdrinfo": "id_source_tnl_addr_info", + "idsourcetotargetamfinformationreroute": "id_source_to_target_amf_information_reroute", + "idsourcetotargettransparentcontainer": "id_source_to_target_transparent_container", + "idsrvccoperationpossible": "id_srvcc_operation_possible", + "idsuccessfulhandoverreportlist": "id_successful_handover_report_list", + "idsuccessfulpscellchangereportlist": "id_successful_ps_cell_change_report_list", + "idsupportedtalist": "id_supported_ta_list", + "idsupporteduetypelist": "id_supported_ue_type_list", + "idsurvivaltime": "id_survival_time", + "idsuspendrequestindication": "id_suspend_request_indication", + "idsuspendresponseindication": "id_suspend_response_indication", + "idtai": "id_tai", + "idtailistforpaging": "id_tai_list_for_paging", + "idtailistforrestart": "id_tai_list_for_restart", + "idtaimbssupportlist": "id_taimbs_support_list", + "idtainsagsupportlist": "id_tainsag_support_list", + "idtargetcellcrnti": "id_target_cell_crnti", + "idtargethomeenbid": "id_target_home_enb_id", + "idtargetid": "id_target_id", + "idtargetnssaiinformation": "id_target_nssai_information", + "idtargetrannodeid": "id_target_ran_node_id", + "idtargetrncid": "id_target_rnc_id", + "idtargettosourcefailuretransparentcontainer": "id_targetto_source_failure_transparent_container", + "idtargettosourcetransparentcontainer": "id_target_to_source_transparent_container", + "idtimebasedhandoverinformation": "id_time_based_handover_information", + "idtimerefdistribution": "id_time_ref_distribution", + "idtimesincefailure": "id_time_since_failure", + "idtimesyncassistanceinfo": "id_time_sync_assistance_info", + "idtimetowait": "id_time_to_wait", + "idtngfidentityinformation": "id_tngf_identity_information", + "idtnlassociationtransportlayeraddressngran": "id_tnl_association_transport_layer_address_ngran", + "idtraceactivation": "id_trace_activation", + "idtracecollectionentityipaddress": "id_trace_collection_entity_ip_address", + "idtracecollectionentityuri": "id_trace_collection_entity_uri", + "idtsctrafficcharacteristics": "id_tsc_traffic_characteristics", + "idtsctrafficcharacteristicsfeedback": "id_tsc_traffic_characteristics_feedback", + "idtwifidentityinformation": "id_twif_identity_information", + "idueaggregatemaximumbitrate": "id_ue_aggregate_maximum_bit_rate", + "idueassociatedlogicalngconnectionlist": "id_ue_associated_logical_ng_connection_list", + "iduecapabilityinforequest": "id_ue_capability_info_request", + "iduecontextreferenceatsource": "id_ue_context_reference_at_source", + "iduecontextrequest": "id_ue_context_request", + "iduedifferentiationinfo": "id_ue_differentiation_info", + "iduehistoryinformationfromtheue": "id_ue_history_information_from_the_ue", + "iduengapids": "id_ue_ngap_id_s", + "iduepagingidentity": "id_ue_paging_identity", + "iduepresenceinareaofinterestlist": "id_ue_presence_in_area_of_interest_list", + "idueradiocapability": "id_ue_radio_capability", + "idueradiocapabilityeutraformat": "id_ue_radio_capability_eutra_format", + "idueradiocapabilityforpaging": "id_ue_radio_capability_for_paging", + "idueradiocapabilityforpagingofnbiot": "id_ue_radio_capability_for_paging_of_nb_io_t", + "idueradiocapabilityid": "id_ue_radio_capability_id", + "idueretentioninformation": "id_ue_retention_information", + "iduesecuritycapabilities": "id_ue_security_capabilities", + "idueslicemaximumbitratelist": "id_ue_slice_maximum_bit_rate_list", + "idueupciotsupport": "id_ue_up_ci_o_t_support", + "idulcpsecurityinformation": "id_ul_cp_security_information", + "idulforwarding": "id_ul_forwarding", + "idulforwardinguptnlinformation": "id_ul_forwarding_up_tnl_information", + "idulnguuptnlinformation": "id_ul_ngu_up_tnl_information", + "idulnguuptnlmodifylist": "id_ul_ngu_up_tnl_modify_list", + "idunavailableguamilist": "id_unavailable_guami_list", + "iduplinktlcontainer": "id_uplink_tl_container", + "idusedrsninformation": "id_used_rsn_information", + "iduserlocationinformation": "id_user_location_information", + "iduserlocationinformationn3iwfwithoutportnumber": "id_user_location_information_n3iwf_without_port_number", + "iduserlocationinformationtngf": "id_user_location_information_tngf", + "iduserlocationinformationtwif": "id_user_location_information_twif", + "iduserlocationinformationwagf": "id_user_location_information_w_agf", + "iduserplaneerrorindicator": "id_user_plane_error_indicator", + "iduserplanefailureindication": "id_user_plane_failure_indication", + "iduserplanefailureindicationreport": "id_user_plane_failure_indication_report", + "idwagfidentityinformation": "id_w_agf_identity_information", + "idwarningareacoordinates": "id_warning_area_coordinates", + "idwarningarealist": "id_warning_area_list", + "idwarningmessagecontents": "id_warning_message_contents", + "idwarningsecurityinfo": "id_warning_security_info", + "idwarningtype": "id_warning_type", + "idwusassistanceinformation": "id_wus_assistance_information", + "idxrdevicewith2rx": "id_xr_device_with2_rx", + "iecriticality": "ie_criticality", + "ieextension": "ie_extension", + "ieextensions": "ie_extensions", + "ieid": "ie_id", + "iescriticalitydiagnostics": "ie_s_criticality_diagnostics", + "immediatemdt": "immediate_mdt", + "immediatemdtnr": "immediate_mdt_nr", + "imsi": "imsi", + "imsvoiceepsfallbackfrom5g": "im_svoice_ep_sfallbackfrom5_g", + "imsvoicesupportindicator": "ims_voice_support_indicator", + "includebeammeasurementsindication": "include_beam_measurements_indication", + "indexlength10": "index_length10", + "indextorfsp": "index_to_rfsp", + "indicationofbitrateadaptation": "indication_of_bitrate_adaptation", + "infoonrecommendedcellsandrannodesforpaging": "info_on_recommended_cells_and_ran_nodes_for_paging", + "informationonrecommendedcellsandenbsforpaging": "information_on_recommended_cells_and_en_bs_for_paging", + "initialcontextsetup": "initial_context_setup", + "initialcontextsetupfailure": "initial_context_setup_failure", + "initialcontextsetuprequest": "initial_context_setup_request", + "initialcontextsetupresponse": "initial_context_setup_response", + "initialuemessage": "initial_ue_message", + "initiatingmessage": "initiating_message", + "integrityprotectionalgorithms": "integrity_protection_algorithms", + "integrityprotectionindication": "integrity_protection_indication", + "integrityprotectionresult": "integrity_protection_result", + "intendednumberofpagingattempts": "intended_number_of_paging_attempts", + "intendedserviceareacoordinates": "intended_service_area_coordinates", + "interfacestotrace": "interfaces_to_trace", + "intersystemcellstateindication": "intersystem_cell_state_indication", + "intersystemfailureindication": "inter_system_failure_indication", + "intersystemhandoverreporttype": "inter_system_handover_report_type", + "intersystemhoreport": "inter_system_ho_report", + "intersysteminformationtransfertype": "inter_system_information_transfer_type", + "intersystemmeasurementconfiguration": "intersystem_measurement_configuration", + "intersystemmeasurementitem": "inter_system_measurement_item", + "intersystemmeasurementlist": "inter_system_measurement_list", + "intersystemmeasurementparameters": "inter_system_measurement_parameters", + "intersystemmobilityfailureforvoicefallback": "intersystem_mobility_failurefor_voice_fallback", + "intersystemresourcestatusreport": "intersystem_resource_status_report", + "intersystemresourcethreshold": "intersystem_resource_threshold", + "intersystemresourcethresholdhigh": "intersystem_resource_threshold_high", + "intersystemresourcethresholdlow": "intersystem_resource_threshold_low", + "intersystemsonconfigurationtransfer": "intersystem_son_configuration_transfer", + "intersystemsonenbid": "intersystem_so_ne_nbid", + "intersystemsoninformation": "intersystem_son_information", + "intersystemsoninformationreply": "intersystem_son_information_reply", + "intersystemsoninformationreport": "intersystem_son_information_report", + "intersystemsoninformationrequest": "intersystem_son_information_request", + "intersystemsonngrannodeid": "intersystem_sonngra_nnode_id", + "intersystemsontransfertype": "intersystem_son_transfer_type", + "intersystemunnecessaryho": "intersystem_unnecessary_ho", + "inventorycompleteindication": "inventory_complete_indication", + "inventoryfailure": "inventory_failure", + "inventoryfailuretransfer": "inventory_failure_transfer", + "inventoryreport": "inventory_report", + "inventoryreporttransfer": "inventory_report_transfer", + "inventoryrequest": "inventory_request", + "inventoryrequesttransfer": "inventory_request_transfer", + "inventoryresponse": "inventory_response", + "inventoryresponsetransfer": "inventory_response_transfer", + "ipaddress": "ip_address", + "ipmulticastaddress": "ip_multicast_address", + "ipsectla": "ip_sec_tla", + "ipsourceaddress": "ip_source_address", + "iratcellid": "irat_cell_id", + "kill": "kill", + "killallwarningmessages": "kill_all_warning_messages", + "killrequest": "kill_request", + "killresponse": "kill_response", + "l1threshold": "l1_threshold", + "l3information": "l3_information", + "lac": "lac", + "lai": "lai", + "lastvisitedcellinformation": "last_visited_cell_information", + "lastvisitedcellitem": "last_visited_cell_item", + "lastvisitedeutrancellinformation": "last_visited_eutran_cell_information", + "lastvisitedgerancellinformation": "last_visited_geran_cell_information", + "lastvisitedngrancellinformation": "last_visited_ngran_cell_information", + "lastvisitedpscellinformation": "last_visited_ps_cell_information", + "lastvisitedpscelllist": "last_visited_ps_cell_list", + "lastvisitedutrancellinformation": "last_visited_utran_cell_information", + "lhnid": "lhn_id", + "linetype": "line_type", + "linkstolog": "links_to_log", + "listeningsubframepattern": "listening_subframe_pattern", + "local": "local", + "locationdependent": "locationdependent", + "locationindependent": "locationindependent", + "locationreport": "location_report", + "locationreportingadditionalinfo": "location_reporting_additional_info", + "locationreportingcontrol": "location_reporting_control", + "locationreportingfailureindication": "location_reporting_failure_indication", + "locationreportingreferenceid": "location_reporting_reference_id", + "locationreportingreferenceidtobecancelled": "location_reporting_reference_id_to_be_cancelled", + "locationreportingrequesttype": "location_reporting_request_type", + "loggedmbsfnmdt": "logged_mbsfnmdt", + "loggedmdt": "logged_mdt", + "loggedmdtnr": "logged_mdt_nr", + "loggedmdttrigger": "logged_mdt_trigger", + "loggingduration": "logging_duration", + "logginginterval": "logging_interval", + "longmacroenbid": "long_macro_enb_id", + "longmacrongenbid": "long_macro_ng_enb_id", + "loweraltitudethreshold": "lower_altitude_threshold", + "lppapdu": "lp_pa_pdu", + "lpwuscnsubgroupid": "lpwu_sc_nsubgroup_id", + "lpwusdisableindication": "lpwus_disable_indication", + "lpwuspsassistanceinformation": "lpwusps_assistance_information", + "lte": "lte", + "ltea2xservicesauthorized": "lte_a2x_services_authorized", + "ltemindication": "lte_m_indication", + "ltentntaiinformation": "lte_ntn_tai_information", + "lteuerlfreportcontainer": "lteuerlf_report_container", + "lteuesidelinkaggregatemaximumbitrate": "lteue_sidelink_aggregate_maximum_bitrate", + "ltev2xservicesauthorized": "ltev2x_services_authorized", + "m1configuration": "m1_configuration", + "m1periodicreporting": "m1_periodic_reporting", + "m1reportingtrigger": "m1_reporting_trigger", + "m1thresholdeventa2": "m1_threshold_event_a2", + "m1thresholdtype": "m1_threshold_type", + "m3configuration": "m3_configuration", + "m3period": "m3_period", + "m4configuration": "m4_configuration", + "m4linkstolog": "m4_links_to_log", + "m4period": "m4_period", + "m4reportamountmdt": "m4_report_amount_mdt", + "m5configuration": "m5_configuration", + "m5linkstolog": "m5_links_to_log", + "m5period": "m5_period", + "m5reportamountmdt": "m5_report_amount_mdt", + "m6configuration": "m6_configuration", + "m6delaythreshold": "m6_delay_threshold", + "m6linkstolog": "m6_links_to_log", + "m6reportamountmdt": "m6_report_amount_mdt", + "m6reportinterval": "m6_report_interval", + "m7configuration": "m7_configuration", + "m7linkstolog": "m7_links_to_log", + "m7period": "m7_period", + "m7reportamountmdt": "m7_report_amount_mdt", + "macroenbid": "macro_enb_id", + "macrongenbid": "macro_ng_enb_id", + "managementbasedmdtallowed": "management_based_mdt_allowed", + "maskedimeisv": "masked_imeisv", + "maximumdataburstvolume": "maximum_data_burst_volume", + "maximumflowbitrate": "maximum_flow_bit_rate", + "maximumflowbitratedl": "maximum_flow_bit_rate_dl", + "maximumflowbitrateul": "maximum_flow_bit_rate_ul", + "maximumintegrityprotecteddatarate": "maximum_integrity_protected_data_rate", + "maximumintegrityprotecteddatarateul": "maximum_integrity_protected_data_rate_ul", + "maximumpacketlossratedl": "maximum_packet_loss_rate_dl", + "maximumpacketlossrateul": "maximum_packet_loss_rate_ul", + "maxnoofaiotareas": "maxnoof_aiot_areas", + "maxnoofallowedareas": "maxnoof_allowed_areas", + "maxnoofallowedcagsperplmn": "maxnoof_allowed_ca_gsper_plmn", + "maxnoofallowedsnssais": "maxnoof_allowed_s_nssa_is", + "maxnoofaoi": "maxnoof_ao_i", + "maxnoofaoiminusone": "maxnoof_ao_im_inus_one", + "maxnoofareantn": "maxnoof_area_ntn", + "maxnoofbluetoothname": "maxnoof_bluetooth_name", + "maxnoofbplmns": "maxnoof_bplm_ns", + "maxnoofcagformdt": "maxnoof_cag_for_mdt", + "maxnoofcagspercell": "maxnoof_cags_per_cell", + "maxnoofcandidatecells": "maxnoof_candidate_cells", + "maxnoofcandidaterelayues": "maxnoof_candidate_relay_ue_s", + "maxnoofcellidformdt": "maxnoof_cell_id_for_mdt", + "maxnoofcellidforqmc": "maxnoof_cell_id_for_qmc", + "maxnoofcellidforwarning": "maxnoof_cell_id_for_warning", + "maxnoofcellinaoi": "maxnoof_cellin_ao_i", + "maxnoofcellineai": "maxnoof_cellin_eai", + "maxnoofcellintai": "maxnoof_cellin_tai", + "maxnoofcellsformbs": "maxnoof_cellsfor_mbs", + "maxnoofcellsingnb": "maxnoof_cellsing_nb", + "maxnoofcellsinngenb": "maxnoof_cellsinnge_nb", + "maxnoofcellsinngrannode": "maxnoof_cellsin_ngran_node", + "maxnoofcellsinuehistoryinfo": "maxnoof_cellsin_ue_history_info", + "maxnoofcellstss": "maxnoof_cells_tss", + "maxnoofcellsuemovingtrajectory": "maxnoof_cells_ue_moving_trajectory", + "maxnoofcsgs": "maxnoof_cs_gs", + "maxnoofdevices": "maxnoof_devices", + "maxnoofdrbs": "maxnoof_dr_bs", + "maxnoofeaiforrestart": "maxnoof_eai_for_restart", + "maxnoofemergencyareaid": "maxnoof_emergency_area_id", + "maxnoofeplmns": "maxnoof_eplm_ns", + "maxnoofeplmnsplusone": "maxnoof_eplm_ns_plus_one", + "maxnooferabs": "maxnoof_e_ra_bs", + "maxnooferrors": "maxnoof_errors", + "maxnoofesnpns": "maxnoof_esnp_ns", + "maxnoofextsliceitems": "maxnoof_ext_slice_items", + "maxnoofflightinforeportcontrol": "maxnoof_flight_info_report_control", + "maxnoofforbtacs": "maxnoof_forb_ta_cs", + "maxnooffreqformdt": "maxnoof_freqfor_mdt", + "maxnoofguamis": "maxnoof_guam_is", + "maxnoofintendedareasformbs": "maxnoof_intended_areasfor_mbs", + "maxnoofiratreportingcells": "maxnoof_irat_reporting_cells", + "maxnoofmbsareasessionids": "maxnoof_mbs_area_session_id_s", + "maxnoofmbsfsas": "maxnoof_mbsfs_as", + "maxnoofmbsqosflows": "maxnoof_mbs_qos_flows", + "maxnoofmbsserviceareainformation": "maxnoof_mbs_service_area_information", + "maxnoofmbssessions": "maxnoof_mbs_sessions", + "maxnoofmbssessionsofue": "maxnoof_mbs_sessionsof_ue", + "maxnoofmdtplmns": "maxnoof_mdtplm_ns", + "maxnoofmdtsnpns": "maxnoof_mdtsnp_ns", + "maxnoofmrbs": "maxnoof_mr_bs", + "maxnoofmulticonnectivity": "maxnoof_multi_connectivity", + "maxnoofmulticonnectivityminusone": "maxnoof_multi_connectivity_minus_one", + "maxnoofneighpciformdt": "maxnoof_neigh_pci_for_mdt", + "maxnoofngapiesupportinfo": "maxnoof_ngapie_support_info", + "maxnoofngconnectionstoreset": "maxnoof_ng_connections_to_reset", + "maxnoofnrcellbands": "maxnoof_nr_cell_bands", + "maxnoofnsags": "maxnoof_nsa_gs", + "maxnoofpagingareas": "maxnoof_paging_areas", + "maxnoofpartiallyallowedsnssais": "maxnoof_partially_allowed_s_nssa_is", + "maxnoofpc5qosflows": "maxnoof_pc5_qos_flows", + "maxnoofpdusessions": "maxnoof_pdu_sessions", + "maxnoofperiodicities": "maxnoof_periodicities", + "maxnoofplmnforqmc": "maxnoof_plmn_for_qmc", + "maxnoofplmns": "maxnoof_plm_ns", + "maxnoofpscellsperprimarycellinuehistoryinfo": "maxnoof_ps_cells_per_primary_cellin_ue_history_info", + "maxnoofqosflows": "maxnoof_qos_flows", + "maxnoofqosparasets": "maxnoof_qos_para_sets", + "maxnoofrannodeinaoi": "maxnoof_ran_nodein_ao_i", + "maxnoofreaders": "maxnoof_readers", + "maxnoofrecommendedcells": "maxnoof_recommended_cells", + "maxnoofrecommendedrannodes": "maxnoof_recommended_ran_nodes", + "maxnoofreportedcells": "maxnoof_reported_cells", + "maxnoofrequestedsnssais": "maxnoof_requested_snssa_is", + "maxnoofrsppqosflows": "maxnoof_rspp_qos_flows", + "maxnoofsensorname": "maxnoof_sensor_name", + "maxnoofservedguamis": "maxnoof_served_guam_is", + "maxnoofsliceitems": "maxnoof_slice_items", + "maxnoofsliceitemsformdt": "maxnoof_slice_itemsfor_mdt", + "maxnoofsnssaiforqmc": "maxnoof_snssai_for_qmc", + "maxnoofsuccessfulhoreports": "maxnoof_successful_ho_reports", + "maxnoofsuccessfulpscellchangereports": "maxnoof_successful_ps_cell_change_reports", + "maxnoofsupportedtaiformbs": "maxnoof_supported_tai_for_mbs", + "maxnooftacs": "maxnoof_ta_cs", + "maxnooftacsinntn": "maxnoof_ta_csin_ntn", + "maxnooftaformdt": "maxnoof_ta_for_mdt", + "maxnooftaforqmc": "maxnoof_ta_for_qmc", + "maxnooftaiforinactive": "maxnoof_tai_for_inactive", + "maxnooftaiformbs": "maxnoof_tai_for_mbs", + "maxnooftaiforpaging": "maxnoof_tai_for_paging", + "maxnooftaiforrestart": "maxnoof_tai_for_restart", + "maxnooftaiforwarning": "maxnoof_tai_for_warning", + "maxnooftaiinaoi": "maxnoof_tai_in_ao_i", + "maxnooftargetsnssais": "maxnoof_target_s_nssa_is", + "maxnoofthresholds": "maxnoof_thresholds", + "maxnoofthresholdsforexcesspacketdelay": "maxnoof_thresholds_for_excess_packet_delay", + "maxnooftimeperiods": "maxnoof_time_periods", + "maxnooftnlassociations": "maxnoof_tnl_associations", + "maxnoofueapplayermeas": "maxnoof_ue_app_layer_meas", + "maxnoofuesforpaging": "maxnoof_ue_sfor_paging", + "maxnoofuetypes": "maxnoof_ue_types", + "maxnoofwlanname": "maxnoof_wlan_name", + "maxnoofxnexttlas": "maxnoof_xn_ext_tl_as", + "maxnoofxngtptlas": "maxnoof_xn_gtp_tl_as", + "maxnoofxntlas": "maxnoof_xn_tl_as", + "maxnrarfcn": "max_nrarfcn", + "maxnrofrsindexestoreport": "max_nrof_rs_indexes_to_report", + "maxprivateies": "max_private_ie_s", + "maxprotocolies": "max_protocol_ie_s", + "maxrsindexcellqual": "max_rs_index_cell_qual", + "mbsactivesessioninformationsourcetotargetitem": "mbs_active_session_information_sourceto_target_item", + "mbsactivesessioninformationsourcetotargetlist": "mbs_active_session_information_sourceto_target_list", + "mbsactivesessioninformationtargettosourceitem": "mbs_active_session_information_targetto_source_item", + "mbsactivesessioninformationtargettosourcelist": "mbs_active_session_information_targetto_source_list", + "mbsareasessionid": "mbs_area_session_id", + "mbsareatailist": "mbs_area_tai_list", + "mbsassistanceinformation": "mbs_assistance_information", + "mbsdataforwardingresponsemrbitem": "mbs_data_forwarding_response_mrb_item", + "mbsdataforwardingresponsemrblist": "mbs_data_forwarding_response_mrb_list", + "mbsdistributionreleaserequesttransfer": "mbs_distribution_release_request_transfer", + "mbsdistributionsetuprequesttransfer": "mbs_distribution_setup_request_transfer", + "mbsdistributionsetupresponsetransfer": "mbs_distribution_setup_response_transfer", + "mbsdistributionsetupunsuccessfultransfer": "mbs_distribution_setup_unsuccessful_transfer", + "mbsfnareaid": "mbsfn_area_id", + "mbsfnresulttolog": "mbsfn_result_to_log", + "mbsfnresulttologinfo": "mbsfn_result_to_log_info", + "mbsintendedservicearealist": "mbs_intended_service_area_list", + "mbsmappinganddataforwardingrequestitem": "mbs_mappingand_data_forwarding_request_item", + "mbsmappinganddataforwardingrequestlist": "mbs_mappingand_data_forwarding_request_list", + "mbsngufailureindication": "mbs_ngu_failure_indication", + "mbsqosflowidentifier": "mbs_qos_flow_identifier", + "mbsqosflowlevelqosparameters": "mb_sqos_flow_level_qos_parameters", + "mbsqosflowlist": "mbs_qos_flow_list", + "mbsqosflowstobesetupitem": "mbs_qos_flows_to_be_setup_item", + "mbsqosflowstobesetuplist": "mbs_qos_flows_to_be_setup_list", + "mbsqosflowtoreleaselist": "mbs_qos_flow_to_release_list", + "mbsservicearea": "mbs_service_area", + "mbsserviceareacelllist": "mbs_service_area_cell_list", + "mbsserviceareainformation": "mbs_service_area_information", + "mbsserviceareainformationitem": "mbs_service_area_information_item", + "mbsserviceareainformationlist": "mbs_service_area_information_list", + "mbsserviceareatailist": "mbs_service_area_tai_list", + "mbssessionfailedtosetupitem": "mbs_session_failedto_setup_item", + "mbssessionfailedtosetuplist": "mbs_session_failedto_setup_list", + "mbssessionfsaid": "mbs_session_fsaid", + "mbssessionfsaidlist": "mbs_session_fsaid_list", + "mbssessionid": "mbs_session_id", + "mbssessionreleaseresponsetransfer": "mbs_session_release_response_transfer", + "mbssessionsetupormodfailuretransfer": "mbs_session_setup_or_mod_failure_transfer", + "mbssessionsetupormodifyrequestitem": "mbs_session_setupor_modify_request_item", + "mbssessionsetupormodifyrequestlist": "mbs_session_setupor_modify_request_list", + "mbssessionsetupormodrequesttransfer": "mbs_session_setup_or_mod_request_transfer", + "mbssessionsetupormodresponsetransfer": "mbs_session_setup_or_mod_response_transfer", + "mbssessionsetuprequestitem": "mbs_session_setup_request_item", + "mbssessionsetuprequestlist": "mbs_session_setup_request_list", + "mbssessionsetupresponseitem": "mbs_session_setup_response_item", + "mbssessionsetupresponselist": "mbs_session_setup_response_list", + "mbssessionstatus": "mbs_session_status", + "mbssessiontnlinfo5gc": "mbs_session_tnl_info5_gc", + "mbssessiontnlinfo5gcitem": "mbs_session_tnl_info5_gc_item", + "mbssessiontnlinfo5gclist": "mbs_session_tnl_info5_gc_list", + "mbssessiontnlinfongran": "mbs_session_tnl_info_ngran", + "mbssessiontnlinfongranitem": "mbs_session_tnl_info_ngran_item", + "mbssessiontnlinfongranlist": "mbs_session_tnl_info_ngran_list", + "mbssessiontoreleaseitem": "mbs_session_to_release_item", + "mbssessiontoreleaselist": "mbs_session_to_release_list", + "mbssupportindicator": "mbs_support_indicator", + "mbsupfailureindication": "mbs_up_failure_indication", + "mbsupfailureindicationitem": "mbs_up_failure_indication_item", + "mbsupfailureindicationlist": "mbs_up_failure_indication_list", + "mdtactivation": "mdt_activation", + "mdtalignmentinfo": "mdt_alignment_info", + "mdtcircle": "mdt_circle", + "mdtconfigeutra": "mdt_config_eutra", + "mdtconfignr": "mdt_config_nr", + "mdtconfiguration": "mdt_configuration", + "mdtconfigurationeutra": "mdt_configuration_eutra", + "mdtconfigurationnr": "mdt_configuration_nr", + "mdtlocationinfo": "mdt_location_info", + "mdtlocationinformation": "mdt_location_information", + "mdtmode": "mdt_mode", + "mdtmodeeutra": "mdt_mode_eutra", + "mdtmodeextension": "mdt_mode_extension", + "mdtmodenr": "mdt_mode_nr", + "mdtplmnlist": "mdtplmn_list", + "mdtplmnmodificationlist": "mdtplmn_modification_list", + "mdtpolygon": "mdt_polygon", + "meascollentityipaddress": "meas_coll_entity_ip_address", + "measconfigapplayerid": "meas_config_app_layer_id", + "measurementduration": "measurement_duration", + "measurementstoactivate": "measurements_to_activate", + "measurementthreshold": "measurement_threshold", + "measurementthresholda2": "measurement_threshold_a2", + "measurementthresholdl1loggedmdt": "measurement_threshold_l1_logged_mdt", + "messageidentifier": "message_identifier", + "micoallplmn": "mico_all_plmn", + "micomodeindication": "mico_mode_indication", + "minimumactivationtime": "minimum_activation_time", + "misc": "misc", + "mmec": "mmec", + "mmecode": "mme_code", + "mmeconfigurationtransfer": "mme_configuration_transfer", + "mmeconfigurationupdate": "mme_configuration_update", + "mmeconfigurationupdateacknowledge": "mme_configuration_update_acknowledge", + "mmeconfigurationupdatefailure": "mme_configuration_update_failure", + "mmecprelocationindication": "mmecp_relocation_indication", + "mmedirectinformationtransfer": "mme_direct_information_transfer", + "mmeearlystatustransfer": "mme_early_status_transfer", + "mmegroupid": "mme_group_id", + "mmename": "mm_ename", + "mmepagingtarget": "mme_paging_target", + "mmerelaysupportindicator": "mme_relay_support_indicator", + "mmestatustransfer": "mme_status_transfer", + "mmeues1apid": "mme_ue_s1ap_id", + "mmsid": "mmsid", + "mnonlymdtcollection": "mn_only_mdt_collection", + "mobileiabauthorized": "mobile_iab_authorized", + "mobileiabmtuserlocationinformation": "mobile_iab_mt_user_location_information", + "mobileiabnodeindication": "mobile_iab_node_indication", + "mobileiabsupported": "mobile_iab_supported", + "mobilityinformation": "mobility_information", + "mobilityrestrictionlist": "mobility_restriction_list", + "monitoringrequest": "monitoring_request", + "monitoringrequestonavailablebitrate": "monitoring_requeston_available_bitrate", + "mrbid": "mrb_id", + "mrbprogressinformation": "mrb_progress_information", + "msclassmark2": "ms_classmark2", + "msclassmark3": "ms_classmark3", + "mtcommunicationhandling": "mt_communication_handling", + "mtcommunicationhandlingfailure": "mt_communication_handling_failure", + "mtcommunicationhandlingrequest": "mt_communication_handling_request", + "mtcommunicationhandlingresponse": "mt_communication_handling_response", + "mtmsi": "m_tmsi", + "multicastgrouppaging": "multicast_group_paging", + "multicastgrouppagingarea": "multicast_group_paging_area", + "multicastgrouppagingareaitem": "multicast_group_paging_area_item", + "multicastgrouppagingarealist": "multicast_group_paging_area_list", + "multicastsessionactivation": "multicast_session_activation", + "multicastsessionactivationfailure": "multicast_session_activation_failure", + "multicastsessionactivationrequest": "multicast_session_activation_request", + "multicastsessionactivationrequesttransfer": "multicast_session_activation_request_transfer", + "multicastsessionactivationresponse": "multicast_session_activation_response", + "multicastsessiondeactivation": "multicast_session_deactivation", + "multicastsessiondeactivationrequest": "multicast_session_deactivation_request", + "multicastsessiondeactivationrequesttransfer": "multicast_session_deactivation_request_transfer", + "multicastsessiondeactivationresponse": "multicast_session_deactivation_response", + "multicastsessionupdate": "multicast_session_update", + "multicastsessionupdatefailure": "multicast_session_update_failure", + "multicastsessionupdaterequest": "multicast_session_update_request", + "multicastsessionupdaterequesttransfer": "multicast_session_update_request_transfer", + "multicastsessionupdateresponse": "multicast_session_update_response", + "multicellloadreporting": "multi_cell_load_reporting", + "multicellloadreportingrequest": "multi_cell_load_reporting_request", + "multicellloadreportingresponse": "multi_cell_load_reporting_response", + "multicellloadreportingresponseitem": "multi_cell_load_reporting_response_item", + "mutingavailabilityindication": "muting_availability_indication", + "mutingpatterninformation": "muting_pattern_information", + "mutingpatternoffset": "muting_pattern_offset", + "mutingpatternperiod": "muting_pattern_period", + "n3iwfid": "n3iwf_id", + "n6jitterinformation": "n6_jitter_information", + "n6jitterlowerbound": "n6_jitter_lower_bound", + "n6jitterupperbound": "n6_jitter_upper_bound", + "nas": "nas", + "nasdeliveryindication": "nas_delivery_indication", + "nasnondeliveryindication": "nas_non_delivery_indication", + "naspdu": "nas_pdu", + "nassecurityparametersfromeutran": "nas_security_parametersfrom_e_utran", + "nassecurityparametersfromngran": "nas_security_parameters_from_ngran", + "nassecurityparameterstoeutran": "nas_security_parametersto_e_utran", + "nbiotdefaultpagingdrx": "nb_io_t_default_paging_drx", + "nbiotpagingdrx": "nb_io_t_paging_drx", + "nbiotpagingedrxcycle": "nb_io_t_paging_e_drx_cycle", + "nbiotpagingedrxinfo": "nb_io_t_paging_e_drx_info", + "nbiotpagingedrxinformation": "nb_io_t_paging_e_drx_information", + "nbiotpagingtimewindow": "nb_io_t_paging_time_window", + "nbiotrlfreportcontainer": "nb_io_t_rlf_report_container", + "nbiotueidentityindexvalue": "nb_io_t_ue_identity_index_value", + "nbiotuepriority": "nb_io_t_ue_priority", + "ncgi": "ncgi", + "networkcontrolledrepeaterauthorized": "network_controlled_repeater_authorized", + "networkinstance": "network_instance", + "networksliceareascopeofmdt": "network_slice_area_scopeof_mdt", + "networksliceitemformdt": "network_slice_itemfor_mdt", + "networkslicelistformdt": "network_slice_listfor_mdt", + "newsecuritycontextind": "new_security_context_ind", + "nexthopchainingcount": "next_hop_chaining_count", + "nexthopnh": "next_hop_nh", + "nexthopparameter": "next_hop_parameter", + "nextpagingareascope": "next_paging_area_scope", + "ngapelementaryprocedure": "ngap_elementary_procedure", + "ngapiesupportinformationrequestitem": "ngapie_support_information_request_item", + "ngapiesupportinformationrequestlist": "ngapie_support_information_request_list", + "ngapiesupportinformationresponseitem": "ngapie_support_information_response_item", + "ngapiesupportinformationresponselist": "ngapie_support_information_response_list", + "ngappdu": "ngap_pdu", + "ngapprivateies": "ngap_private_ies", + "ngapprotocolextension": "ngap_protocol_extension", + "ngapprotocolieid": "ngap_protocol_ie_id", + "ngapprotocoliepresenceinfo": "ngap_protocol_ie_presence_info", + "ngapprotocolies": "ngap_protocol_ies", + "ngapprotocoliespair": "ngap_protocol_ies_pair", + "ngapprotocoliesupportinfo": "ngap_protocol_ie_support_info", + "ngenb": "ng_e_nb", + "ngenbid": "ng_enb_id", + "nginterface": "ng_interface", + "ngran": "ngran", + "ngrancell": "ng_ran_cell", + "ngrancellactivation": "ngran_cell_activation", + "ngrancellreportitem": "ngran_cell_report_item", + "ngrancellreportlist": "ngran_cell_report_list", + "ngrancelltoreportitem": "ngran_cell_to_report_item", + "ngrancelltoreportlist": "ngran_cell_to_report_list", + "ngrancgi": "ngran_cgi", + "ngrancompositeavailablecapacitygroup": "ngran_composite_available_capacity_group", + "ngrannoofrrcconnections": "ngran_noof_rrc_connections", + "ngrannumberofactiveues": "ngran_number_of_active_ue_s", + "ngranradioresourcestatus": "ngran_radio_resource_status", + "ngranreportingstatus": "ngran_reporting_status", + "ngranreportingstatusies": "ngran_reporting_status_ie_s", + "ngranreportingsystemies": "ngran_reporting_system_ie_s", + "ngrantnlassociationtoremoveitem": "ngran_tnl_association_to_remove_item", + "ngrantnlassociationtoremovelist": "ngran_tnl_association_to_remove_list", + "ngrantraceid": "ngran_trace_id", + "ngremoval": "ng_removal", + "ngremovalfailure": "ng_removal_failure", + "ngremovalrequest": "ng_removal_request", + "ngremovalresponse": "ng_removal_response", + "ngreset": "ng_reset", + "ngresetacknowledge": "ng_reset_acknowledge", + "ngsetup": "ng_setup", + "ngsetupfailure": "ng_setup_failure", + "ngsetuprequest": "ng_setup_request", + "ngsetupresponse": "ng_setup_response", + "nguuptnlinformation": "ngu_up_tnl_information", + "nid": "nid", + "nondynamic5qi": "non_dynamic5_qi", + "nondynamic5qidescriptor": "non_dynamic5_qi_descriptor", + "nopdusessionindication": "no_pdu_session_indication", + "noreporting": "no_reporting", + "notallowedtacs": "not_allowed_ta_cs", + "notificationcause": "notification_cause", + "notificationcellitem": "notification_cell_item", + "notificationcelllist": "notification_cell_list", + "notificationcelllistitem": "notification_cell_list_item", + "notificationcontrol": "notification_control", + "notifyflag": "notify_flag", + "notifysourceenb": "notify_sourcee_nb", + "notifysourcengrannode": "notify_source_ngran_node", + "npnaccessinformation": "npn_access_information", + "npnmobilityinformation": "npn_mobility_information", + "npnpagingassistanceinformation": "npn_paging_assistance_information", + "npnsupport": "npn_support", + "nr": "nr", + "nra2xservicesauthorized": "nr_a2x_services_authorized", + "nrarfcn": "nr_arfcn", + "nrcellidentity": "nr_cell_identity", + "nrcgi": "nr_cgi", + "nrcgilist": "nr_cgi_list", + "nrcgilistforrestart": "nr_cgi_listfor_restart", + "nrcgilistforwarning": "nr_cgi_list_for_warning", + "nrcgipwsfailedlist": "nr_cgi_pws_failed_list", + "nrencryptionalgorithms": "nr_encryption_algorithms", + "nrfrequencyband": "nr_frequency_band", + "nrfrequencybanditem": "nr_frequency_band_item", + "nrfrequencybandlist": "nr_frequency_band_list", + "nrfrequencyinfo": "nr_frequency_info", + "nrintegrityprotectionalgorithms": "nr_integrity_protection_algorithms", + "nrmobilityhistoryreport": "nr_mobility_history_report", + "nrntntaiinformation": "nrntntai_information", + "nrpagingedrxcycle": "nr_paging_e_drx_cycle", + "nrpagingedrxinformation": "nr_paginge_drx_information", + "nrpaginglongedrxcycleforrrcinactive": "nr_paging_long_e_drx_cycle_for_rrc_inactive", + "nrpaginglongedrxinformationforrrcinactive": "nr_paging_long_e_drx_information_for_rrc_inactive", + "nrpagingtimewindow": "nr_paging_time_window", + "nrpagingtimewindowforrrcinactive": "nr_paging_time_window_for_rrc_inactive", + "nrpci": "nr_pci", + "nrppapdu": "nrp_pa_pdu", + "nrrestrictionin5gs": "nr_restrictionin5_gs", + "nrrestrictioninepsassecondaryrat": "nr_restrictionin_ep_sas_secondary_rat", + "nruerlfreportcontainer": "nruerlf_report_container", + "nruesecuritycapabilities": "nrue_security_capabilities", + "nruesidelinkaggregatemaximumbitrate": "nrue_sidelink_aggregate_maximum_bitrate", + "nrv2xservicesauthorized": "nrv2x_services_authorized", + "nsagid": "nsag_id", + "nsagslicesupportlist": "nsag_slice_support_list", + "ntngeographicalarea": "ntn_geographical_area", + "ntngeographicalareaitem": "ntn_geographical_area_item", + "ntngeographicalarealist": "ntn_geographical_area_list", + "ntnplmnlist": "ntn_plmn_list", + "numberofbroadcastrequest": "numberof_broadcast_request", + "numberofbroadcasts": "number_of_broadcasts", + "numberofbroadcastsrequested": "number_of_broadcasts_requested", + "numberofmeasurementreportinglevels": "number_of_measurement_reporting_levels", + "oldbsstonewbssinformation": "old_bss_to_new_bss_information", + "onboardingsupport": "onboarding_support", + "outofcoverage": "out_of_coverage", + "overloadaction": "overload_action", + "overloadflag": "overload_flag", + "overloadresponse": "overload_response", + "overloadstart": "overload_start", + "overloadstartnssaiitem": "overload_start_nssai_item", + "overloadstartnssailist": "overload_start_nssai_list", + "overloadstop": "overload_stop", + "packetdelaybudget": "packet_delay_budget", + "packeterrorrate": "packet_error_rate", + "packetlossrate": "packet_loss_rate", + "paging": "paging", + "pagingassisdataforcecapabue": "paging_assis_datafor_ce_capab_ue", + "pagingattemptcount": "paging_attempt_count", + "pagingattemptinformation": "paging_attempt_information", + "pagingcause": "paging_cause", + "pagingcauseindicationforvoiceservice": "paging_cause_indication_for_voice_service", + "pagingdrx": "paging_drx", + "pagingedrxcycle": "paging_e_drx_cycle", + "pagingedrxinformation": "paging_e_drx_information", + "pagingorigin": "paging_origin", + "pagingpolicydifferentiation": "paging_policy_differentiation", + "pagingpolicydifferentiationitem": "paging_policy_differentiation_item", + "pagingpolicydifferentiationlist": "paging_policy_differentiation_list", + "pagingpolicyindicator": "paging_policy_indicator", + "pagingpriority": "paging_priority", + "pagingprobabilityinformation": "paging_probability_information", + "pagingtimewindow": "paging_time_window", + "parenttimesource": "parent_ti_me_source", + "partiallyallowednssai": "partially_allowed_nssai", + "partiallyallowednssaiitem": "partially_allowed_nssai_item", + "partofnginterface": "part_of_ng_interface", + "partofs1interface": "part_of_s1_interface", + "pathswitchrequest": "path_switch_request", + "pathswitchrequestacknowledge": "path_switch_request_acknowledge", + "pathswitchrequestacknowledgetransfer": "path_switch_request_acknowledge_transfer", + "pathswitchrequestfailure": "path_switch_request_failure", + "pathswitchrequestsetupfailedtransfer": "path_switch_request_setup_failed_transfer", + "pathswitchrequesttransfer": "path_switch_request_transfer", + "pathswitchrequestunsuccessfultransfer": "path_switch_request_unsuccessful_transfer", + "patternoffset": "pattern_offset", + "patternperiod": "pattern_period", + "pc5flowbitrates": "pc5_flow_bit_rates", + "pc5linkaggregatebitrates": "pc5_link_aggregate_bit_rates", + "pc5linkaggregatedbitrates": "pc5_link_aggregated_bit_rates", + "pc5qosflowitem": "pc5_qos_flow_item", + "pc5qosflowlist": "pc5_qos_flow_list", + "pc5qosparameters": "pc5_qos_parameters", + "pci": "pci", + "pcilistformdt": "pci_list_for_mdt", + "pdcpsn": "pdcp_sn", + "pdcpsn12": "pdcp_sn12", + "pdcpsn18": "pdcp_sn18", + "pdcpsnextended": "pdcp_sn_extended", + "pdcpsnlength12": "pdcp_sn_length12", + "pdcpsnlength18": "pdcp_sn_length18", + "pdusessionaggregatemaximumbitrate": "pdu_session_aggregate_maximum_bit_rate", + "pdusessionaggregatemaximumbitratedl": "pdu_session_aggregate_maximum_bit_rate_dl", + "pdusessionaggregatemaximumbitrateul": "pdu_session_aggregate_maximum_bit_rate_ul", + "pdusessionforpagingitem": "pdu_session_for_paging_item", + "pdusessionforpaginglist": "pdu_session_for_paging_list", + "pdusessionid": "pdu_session_id", + "pdusessionlistmtcommhreq": "pdu_session_list_mt_comm_hr_eq", + "pdusessionlistmtcommhreqitem": "pdu_session_list_mt_comm_hr_eq_item", + "pdusessionnaspdu": "pdu_session_nas_pdu", + "pdusessionpairid": "pdu_session_pair_id", + "pdusessionresourceadmitteditem": "pdu_session_resource_admitted_item", + "pdusessionresourceadmittedlist": "pdu_session_resource_admitted_list", + "pdusessionresourcefailedtomodifyitemmodcfm": "pdu_session_resource_failed_to_modify_item_mod_cfm", + "pdusessionresourcefailedtomodifyitemmodres": "pdu_session_resource_failed_to_modify_item_mod_res", + "pdusessionresourcefailedtomodifylistmodcfm": "pdu_session_resource_failed_to_modify_list_mod_cfm", + "pdusessionresourcefailedtomodifylistmodres": "pdu_session_resource_failed_to_modify_list_mod_res", + "pdusessionresourcefailedtoresumeitemresreq": "pdu_session_resource_failed_to_resume_item_res_req", + "pdusessionresourcefailedtoresumeitemresres": "pdu_session_resource_failed_to_resume_item_res_res", + "pdusessionresourcefailedtoresumelistresreq": "pdu_session_resource_failed_to_resume_list_res_req", + "pdusessionresourcefailedtoresumelistresres": "pdu_session_resource_failed_to_resume_list_res_res", + "pdusessionresourcefailedtosetupitemcxtfail": "pdu_session_resource_failed_to_setup_item_cxt_fail", + "pdusessionresourcefailedtosetupitemcxtres": "pdu_session_resource_failed_to_setup_item_cxt_res", + "pdusessionresourcefailedtosetupitemhoack": "pdu_session_resource_failed_to_setup_item_ho_ack", + "pdusessionresourcefailedtosetupitempsreq": "pdu_session_resource_failed_to_setup_item_ps_req", + "pdusessionresourcefailedtosetupitemsures": "pdu_session_resource_failed_to_setup_item_su_res", + "pdusessionresourcefailedtosetuplistcxtfail": "pdu_session_resource_failed_to_setup_list_cxt_fail", + "pdusessionresourcefailedtosetuplistcxtres": "pdu_session_resource_failed_to_setup_list_cxt_res", + "pdusessionresourcefailedtosetuplisthoack": "pdu_session_resource_failed_to_setup_list_ho_ack", + "pdusessionresourcefailedtosetuplistpsreq": "pdu_session_resource_failed_to_setup_list_ps_req", + "pdusessionresourcefailedtosetuplistsures": "pdu_session_resource_failed_to_setup_list_su_res", + "pdusessionresourcehandoveritem": "pdu_session_resource_handover_item", + "pdusessionresourcehandoverlist": "pdu_session_resource_handover_list", + "pdusessionresourceinformationitem": "pdu_session_resource_information_item", + "pdusessionresourceinformationlist": "pdu_session_resource_information_list", + "pdusessionresourceitemcxtrelcpl": "pdu_session_resource_item_cxt_rel_cpl", + "pdusessionresourceitemcxtrelreq": "pdu_session_resource_item_cxt_rel_req", + "pdusessionresourceitemhorqd": "pdu_session_resource_item_ho_rqd", + "pdusessionresourcelistcxtrelcpl": "pdu_session_resource_list_cxt_rel_cpl", + "pdusessionresourcelistcxtrelreq": "pdu_session_resource_list_cxt_rel_req", + "pdusessionresourcelisthorqd": "pdu_session_resource_list_ho_rqd", + "pdusessionresourcemodify": "pdu_session_resource_modify", + "pdusessionresourcemodifyconfirm": "pdu_session_resource_modify_confirm", + "pdusessionresourcemodifyconfirmtransfer": "pdu_session_resource_modify_confirm_transfer", + "pdusessionresourcemodifyindication": "pdu_session_resource_modify_indication", + "pdusessionresourcemodifyindicationtransfer": "pdu_session_resource_modify_indication_transfer", + "pdusessionresourcemodifyindicationunsuccessfultransfer": "pdu_session_resource_modify_indication_unsuccessful_transfer", + "pdusessionresourcemodifyitemmodcfm": "pdu_session_resource_modify_item_mod_cfm", + "pdusessionresourcemodifyitemmodind": "pdu_session_resource_modify_item_mod_ind", + "pdusessionresourcemodifyitemmodreq": "pdu_session_resource_modify_item_mod_req", + "pdusessionresourcemodifyitemmodres": "pdu_session_resource_modify_item_mod_res", + "pdusessionresourcemodifylistmodcfm": "pdu_session_resource_modify_list_mod_cfm", + "pdusessionresourcemodifylistmodind": "pdu_session_resource_modify_list_mod_ind", + "pdusessionresourcemodifylistmodreq": "pdu_session_resource_modify_list_mod_req", + "pdusessionresourcemodifylistmodres": "pdu_session_resource_modify_list_mod_res", + "pdusessionresourcemodifyrequest": "pdu_session_resource_modify_request", + "pdusessionresourcemodifyrequesttransfer": "pdu_session_resource_modify_request_transfer", + "pdusessionresourcemodifyresponse": "pdu_session_resource_modify_response", + "pdusessionresourcemodifyresponsetransfer": "pdu_session_resource_modify_response_transfer", + "pdusessionresourcemodifyunsuccessfultransfer": "pdu_session_resource_modify_unsuccessful_transfer", + "pdusessionresourcenotify": "pdu_session_resource_notify", + "pdusessionresourcenotifyitem": "pdu_session_resource_notify_item", + "pdusessionresourcenotifylist": "pdu_session_resource_notify_list", + "pdusessionresourcenotifyreleasedtransfer": "pdu_session_resource_notify_released_transfer", + "pdusessionresourcenotifytransfer": "pdu_session_resource_notify_transfer", + "pdusessionresourcerelease": "pdu_session_resource_release", + "pdusessionresourcereleasecommand": "pdu_session_resource_release_command", + "pdusessionresourcereleasecommandtransfer": "pdu_session_resource_release_command_transfer", + "pdusessionresourcereleaseditemnot": "pdu_session_resource_released_item_not", + "pdusessionresourcereleaseditempsack": "pdu_session_resource_released_item_ps_ack", + "pdusessionresourcereleaseditempsfail": "pdu_session_resource_released_item_ps_fail", + "pdusessionresourcereleaseditemrelres": "pdu_session_resource_released_item_rel_res", + "pdusessionresourcereleasedlistnot": "pdu_session_resource_released_list_not", + "pdusessionresourcereleasedlistpsack": "pdu_session_resource_released_list_ps_ack", + "pdusessionresourcereleasedlistpsfail": "pdu_session_resource_released_list_ps_fail", + "pdusessionresourcereleasedlistrelres": "pdu_session_resource_released_list_rel_res", + "pdusessionresourcereleaseresponse": "pdu_session_resource_release_response", + "pdusessionresourcereleaseresponsetransfer": "pdu_session_resource_release_response_transfer", + "pdusessionresourceresumeitemresreq": "pdu_session_resource_resume_item_res_req", + "pdusessionresourceresumeitemresres": "pdu_session_resource_resume_item_res_res", + "pdusessionresourceresumelistresreq": "pdu_session_resource_resume_list_res_req", + "pdusessionresourceresumelistresres": "pdu_session_resource_resume_list_res_res", + "pdusessionresourcesecondaryratusageitem": "pdu_session_resource_secondary_rat_usage_item", + "pdusessionresourcesecondaryratusagelist": "pdu_session_resource_secondary_rat_usage_list", + "pdusessionresourcesetup": "pdu_session_resource_setup", + "pdusessionresourcesetupitemcxtreq": "pdu_session_resource_setup_item_cxt_req", + "pdusessionresourcesetupitemcxtres": "pdu_session_resource_setup_item_cxt_res", + "pdusessionresourcesetupitemhoreq": "pdu_session_resource_setup_item_ho_req", + "pdusessionresourcesetupitemsureq": "pdu_session_resource_setup_item_su_req", + "pdusessionresourcesetupitemsures": "pdu_session_resource_setup_item_su_res", + "pdusessionresourcesetuplistcxtreq": "pdu_session_resource_setup_list_cxt_req", + "pdusessionresourcesetuplistcxtres": "pdu_session_resource_setup_list_cxt_res", + "pdusessionresourcesetuplisthoreq": "pdu_session_resource_setup_list_ho_req", + "pdusessionresourcesetuplistsureq": "pdu_session_resource_setup_list_su_req", + "pdusessionresourcesetuplistsures": "pdu_session_resource_setup_list_su_res", + "pdusessionresourcesetuprequest": "pdu_session_resource_setup_request", + "pdusessionresourcesetuprequesttransfer": "pdu_session_resource_setup_request_transfer", + "pdusessionresourcesetupresponse": "pdu_session_resource_setup_response", + "pdusessionresourcesetupresponsetransfer": "pdu_session_resource_setup_response_transfer", + "pdusessionresourcesetupunsuccessfultransfer": "pdu_session_resource_setup_unsuccessful_transfer", + "pdusessionresourcesuspenditemsusreq": "pdu_session_resource_suspend_item_sus_req", + "pdusessionresourcesuspendlistsusreq": "pdu_session_resource_suspend_list_sus_req", + "pdusessionresourceswitcheditem": "pdu_session_resource_switched_item", + "pdusessionresourceswitchedlist": "pdu_session_resource_switched_list", + "pdusessionresourcetobeswitcheddlitem": "pdu_session_resource_to_be_switched_dl_item", + "pdusessionresourcetobeswitcheddllist": "pdu_session_resource_to_be_switched_dl_list", + "pdusessionresourcetoreleaseitemhocmd": "pdu_session_resource_to_release_item_ho_cmd", + "pdusessionresourcetoreleaseitemrelcmd": "pdu_session_resource_to_release_item_rel_cmd", + "pdusessionresourcetoreleaselisthocmd": "pdu_session_resource_to_release_list_ho_cmd", + "pdusessionresourcetoreleaselistrelcmd": "pdu_session_resource_to_release_list_rel_cmd", + "pdusessiontimedreportlist": "pdu_session_timed_report_list", + "pdusessiontype": "pdu_session_type", + "pdusessionusagereport": "pdu_session_usage_report", + "pdusetbasedhandlingindicator": "pdu_setbased_handling_indicator", + "pdusetdelaybudget": "pdu_set_delay_budget", + "pduseterrorrate": "pdu_set_error_rate", + "pdusetintegratedhandlinginformation": "pdu_set_integrated_handling_information", + "pdusetqosinformation": "pd_uset_qos_information", + "pdusetqosparameters": "pd_uset_qos_parameters", + "pedestrianue": "pedestrian_ue", + "peipsassistanceinformation": "peip_sassistance_information", + "pendingdataindication": "pending_data_indication", + "perexponent": "per_exponent", + "periodical": "periodical", + "periodiccommunicationindicator": "periodic_communication_indicator", + "periodicity": "periodicity", + "periodicitybound": "periodicity_bound", + "periodicitylist": "periodicity_list", + "periodicitylowerbound": "periodicity_lower_bound", + "periodicityrange": "periodicity_range", + "periodicityupperbound": "periodicity_upper_bound", + "periodicregistrationupdatetimer": "periodic_registration_update_timer", + "periodicreporting": "periodic_reporting", + "periodicreportingies": "periodic_reporting_ie_s", + "periodictime": "periodic_time", + "perscalar": "per_scalar", + "playoutdelayformediastartup": "playout_delay_for_media_startup", + "plmnareabased": "plmn_area_based", + "plmnareabasedqmc": "plmn_area_based_qmc", + "plmnid": "plmn_id", + "plmnidentity": "plmn_identity", + "plmnlistforqmc": "plmn_listfor_qmc", + "plmnsupportitem": "plmn_support_item", + "plmnsupportlist": "plmn_support_list", + "plmnwide": "plmn_wide", + "pninpnaccessinformation": "pni_npn_access_information", + "pninpnareascopeofmdt": "pni_npn_area_scopeof_mdt", + "pninpnbasedmdt": "pni_npn_based_mdt", + "pninpnmobilityinformation": "pni_npn_mobility_information", + "pninpnpagingassistance": "pni_npn_paging_assistance", + "pninpnrestricted": "pni_npn_restricted", + "polygon": "polygon", + "portnumber": "port_number", + "pqi": "pqi", + "preemptioncapability": "pre_emption_capability", + "preemptionvulnerability": "pre_emption_vulnerability", + "presence": "presence", + "primaryratrestriction": "primary_rat_restriction", + "prioritylevel": "priority_level", + "prioritylevelarp": "priority_level_arp", + "prioritylevelqos": "priority_level_qos", + "privacyindicator": "privacy_indicator", + "privateieid": "private_ie_id", + "privateies": "private_ie_s", + "privatemessage": "private_message", + "proactive": "proactive", + "procedurecode": "procedure_code", + "procedurecriticality": "procedure_criticality", + "procedurestage": "procedure_stage", + "procedurestagechoice": "procedure_stage_choice", + "proseauthorized": "pro_se_authorized", + "prosedirectcommunication": "pro_se_direct_communication", + "prosedirectdiscovery": "pro_se_direct_discovery", + "proseuetonetworkrelaying": "pro_se_ue_to_network_relaying", + "protocol": "protocol", + "protocolextensionid": "protocol_extension_id", + "protocolieid": "protocol_ie_id", + "protocolies": "protocol_ie_s", + "pscellid": "ps_cell_id", + "pscellinformation": "ps_cell_information", + "psservicenotavailable": "ps_service_not_available", + "pwscancel": "pws_cancel", + "pwscancelrequest": "pws_cancel_request", + "pwscancelresponse": "pws_cancel_response", + "pwsfailedcellidlist": "pws_failed_cell_id_list", + "pwsfailedecgilist": "pw_sfailed_ecgi_list", + "pwsfailureindication": "pws_failure_indication", + "pwsrestartindication": "pws_restart_indication", + "qci": "qci", + "qmcconfiginfo": "qmc_config_info", + "qmcdeactivation": "qmc_deactivation", + "qoemeasurementstatus": "qo_em_easurement_status", + "qoereference": "qo_er_eference", + "qoereferencelist": "qo_er_eference_list", + "qoereportingpath": "qo_er_eporting_path", + "qoervqoereportingpaths": "qo_erv_qo_er_eporting_paths", + "qoscharacteristics": "qos_characteristics", + "qosflowaccepteditem": "qos_flow_accepted_item", + "qosflowacceptedlist": "qos_flow_accepted_list", + "qosflowadditionalinfoitemrelcom": "qos_flow_additional_info_item_rel_com", + "qosflowadditionalinfoitemrelres": "qos_flow_additional_info_item_rel_res", + "qosflowadditionalinfolistrelcom": "qos_flow_additional_info_list_rel_com", + "qosflowadditionalinfolistrelres": "qos_flow_additional_info_list_rel_res", + "qosflowaddormodifyrequestitem": "qos_flow_add_or_modify_request_item", + "qosflowaddormodifyrequestlist": "qos_flow_add_or_modify_request_list", + "qosflowaddormodifyresponseitem": "qos_flow_add_or_modify_response_item", + "qosflowaddormodifyresponselist": "qos_flow_add_or_modify_response_list", + "qosflowfailedtoaddormodifylist": "qos_flow_failed_to_add_or_modify_list", + "qosflowfailedtomodifylist": "qos_flow_failed_to_modify_list", + "qosflowfailedtoresumelist": "qos_flow_failed_to_resume_list", + "qosflowfailedtosetuplist": "qos_flow_failed_to_setup_list", + "qosflowfeedbackitem": "qos_flow_feedback_item", + "qosflowfeedbacklist": "qos_flow_feedback_list", + "qosflowidentifier": "qos_flow_identifier", + "qosflowinformationitem": "qos_flow_information_item", + "qosflowinformationlist": "qos_flow_information_list", + "qosflowitemwithdataforwarding": "qos_flow_item_with_data_forwarding", + "qosflowlevelqosparameters": "qos_flow_level_qos_parameters", + "qosflowlist": "qos_flow_list", + "qosflowlistwithcause": "qos_flow_list_with_cause", + "qosflowlistwithdataforwarding": "qos_flow_list_with_data_forwarding", + "qosflowmappingindication": "qos_flow_mapping_indication", + "qosflowmodifyconfirmitem": "qos_flow_modify_confirm_item", + "qosflowmodifyconfirmlist": "qos_flow_modify_confirm_list", + "qosflownotifyitem": "qos_flow_notify_item", + "qosflownotifylist": "qos_flow_notify_list", + "qosflowparametersitem": "qos_flow_parameters_item", + "qosflowparameterslist": "qos_flow_parameters_list", + "qosflowpertnlinformation": "qos_flow_per_tnl_information", + "qosflowpertnlinformationitem": "qos_flow_per_tnl_information_item", + "qosflowpertnlinformationlist": "qos_flow_per_tnl_information_list", + "qosflowreleasedlist": "qos_flow_released_list", + "qosflowsetuprequestitem": "qos_flow_setup_request_item", + "qosflowsetuprequestlist": "qos_flow_setup_request_list", + "qosflowsetupresponselist": "qos_flow_setup_response_list", + "qosflowstimedreportlist": "qos_flows_timed_report_list", + "qosflowsusagereportitem": "qos_flows_usage_report_item", + "qosflowsusagereportlist": "qos_flows_usage_report_list", + "qosflowtobeforwardeditem": "qos_flow_to_be_forwarded_item", + "qosflowtobeforwardedlist": "qos_flow_to_be_forwarded_list", + "qosflowtscitem": "qos_flow_tsc_item", + "qosflowtsclist": "qos_flow_tsc_list", + "qosflowwithcauseitem": "qos_flow_with_cause_item", + "qosmonitoringreportingfrequency": "qos_monitoring_reporting_frequency", + "qosmonitoringrequest": "qos_monitoring_request", + "quantityconfignrr15": "quantity_config_nr_r15", + "rac": "rac", + "racsindication": "racs_indication", + "radionetwork": "radio_network", + "ranaiotdevicengapid": "ran_aiot_device_ngap_id", + "ranconfigurationupdate": "ran_configuration_update", + "ranconfigurationupdateacknowledge": "ran_configuration_update_acknowledge", + "ranconfigurationupdatefailure": "ran_configuration_update_failure", + "rancprelocationindication": "rancp_relocation_indication", + "ranfeedbacktype": "ra_nfeedbacktype", + "ranfeedbacktypeproactive": "ra_nfeedbacktype_proactive", + "ranfeedbacktypereactive": "ra_nfeedbacktype_reactive", + "range": "range", + "rannodelevel": "ran_node_level", + "rannodename": "ran_node_name", + "rannodenameutf8string": "ran_node_name_utf8_string", + "rannodenamevisiblestring": "ran_node_name_visible_string", + "ranpagingpriority": "ran_paging_priority", + "ranpagingrequest": "ran_paging_request", + "ranstatustransfertransparentcontainer": "ran_status_transfer_transparent_container", + "rantimingsynchronisationstatusinfo": "ran_timing_synchronisation_status_info", + "rantsscellitem": "rantss_cell_item", + "rantsscelllist": "rantss_cell_list", + "rantssrequesttype": "ran_tss_request_type", + "rantssscope": "ran_tss_scope", + "ranuengapid": "ran_ue_ngap_id", + "ratinformation": "rat_information", + "ratrestrictioninformation": "rat_restriction_information", + "ratrestrictions": "rat_restrictions", + "ratrestrictionsitem": "rat_restrictions_item", + "rattype": "rat_type", + "reactive": "reactive", + "readerindex": "reader_index", + "readerreportlist": "reader_report_list", + "receivestatusofulpdcpsdus": "receive_status_of_ul_pdcp_sd_us", + "receivestatusofulpdcpsdusextended": "receive_status_of_ulpdcpsd_us_extended", + "receivestatusofulpdcpsduspdcpsnlength18": "receive_status_of_ulpdcpsd_us_pdcp_sn_length18", + "recommendedcellitem": "recommended_cell_item", + "recommendedcelllist": "recommended_cell_list", + "recommendedcellsforpaging": "recommended_cells_for_paging", + "recommendedenbitem": "recommended_enb_item", + "recommendedenblist": "recommended_enb_list", + "recommendedenbsforpaging": "recommended_en_bs_for_paging", + "recommendedrannodeitem": "recommended_ran_node_item", + "recommendedrannodelist": "recommended_ran_node_list", + "recommendedrannodesforpaging": "recommended_ran_nodes_for_paging", + "recommendenbsforpaging": "recommend_en_bs_for_paging", + "recommendrannodesforpaging": "recommend_ran_nodes_for_paging", + "reconnectcellid": "reconnect_cell_id", + "redcapindication": "red_cap_indication", + "redirectionvoicefallback": "redirection_voice_fallback", + "redundantpdusessioninformation": "redundant_pdu_session_information", + "redundantqosflowindicator": "redundant_qos_flow_indicator", + "reestablishmentcellcgi": "reestablishmentcell_cgi", + "referencelocation": "reference_location", + "reflectiveqosattribute": "reflective_qos_attribute", + "rejectednssaiinplmn": "rejected_nssai_in_plmn", + "rejectednssaiinta": "rejected_nssai_in_ta", + "relativeamfcapacity": "relative_amf_capacity", + "relativedcncapacity": "relative_dcn_capacity", + "relativemmecapacity": "relative_mme_capacity", + "relaynodeindicator": "relay_node_indicator", + "repetitionperiod": "repetition_period", + "reply": "reply", + "reportamount": "report_amount", + "reportamountmdt": "report_amount_mdt", + "reportarea": "report_area", + "reportcharacteristics": "report_characteristics", + "reportingcelllist": "reporting_cell_list", + "reportingcelllistitem": "reporting_cell_list_item", + "reportingperiodicity": "reporting_periodicity", + "reportingsystem": "reporting_system", + "reportingthreshold": "reporting_threshold", + "reportinterval": "report_interval", + "reportintervalmdt": "report_interval_mdt", + "reporttype": "report_type", + "request": "request", + "requestedaiotarealist": "requested_aiot_area_list", + "requestedcelllist": "requested_cell_list", + "requestednssai": "requested_nssai", + "requestednssaiitem": "requested_nssai_item", + "requestedreaderlist": "requested_reader_list", + "requestedtnlinfo": "requested_tnl_info", + "requesttype": "request_type", + "requesttypeadditionalinfo": "request_type_additional_info", + "reroutenasrequest": "reroute_nas_request", + "reset": "reset", + "resetacknowledge": "reset_acknowledge", + "resetall": "reset_all", + "resettype": "reset_type", + "resourcestatus": "resource_status", + "resourcestatusreportingsystem": "resource_status_reporting_system", + "retrieveueinformation": "retrieve_ue_information", + "rglevelwirelineaccesscharacteristics": "rg_level_wireline_access_characteristics", + "riminformation": "rim_information", + "riminformationtransfer": "rim_information_transfer", + "rimroutingaddress": "rim_routing_address", + "rimrsdetection": "rim_rs_detection", + "rimtransfer": "rim_transfer", + "rlfreportinformation": "rlf_report_information", + "rncid": "rnc_id", + "routingid": "routing_id", + "rrccontainer": "rrc_container", + "rrcestablishmentcause": "rrc_establishment_cause", + "rrcinactivetransitionreport": "rrc_inactive_transition_report", + "rrcinactivetransitionreportrequest": "rrc_inactive_transition_report_request", + "rrcstate": "rrc_state", + "rsn": "rsn", + "rsppflowbitrates": "rspp_flow_bit_rates", + "rspplinkaggregatebitrates": "rspp_link_aggregate_bit_rates", + "rsppqosflowitem": "rspp_qos_flow_item", + "rsppqosflowlist": "rspp_qos_flow_list", + "rsrp": "rsrp", + "rsrq": "rsrq", + "rvqoereportingpath": "rv_qo_er_eporting_path", + "s1apelementaryprocedure": "s1ap_elementary_procedure", + "s1appdu": "s1ap_pdu", + "s1apprivateies": "s1ap_private_ies", + "s1approtocolextension": "s1ap_protocol_extension", + "s1approtocolies": "s1ap_protocol_ies", + "s1approtocoliespair": "s1ap_protocol_ies_pair", + "s1interface": "s1_interface", + "s1removal": "s1_removal", + "s1removalfailure": "s1_removal_failure", + "s1removalrequest": "s1_removal_request", + "s1removalresponse": "s1_removal_response", + "s1setup": "s1_setup", + "s1setupfailure": "s1_setup_failure", + "s1setuprequest": "s1_setup_request", + "s1setupresponse": "s1_setup_response", + "sbasedmdt": "s_based_mdt", + "scgactivationtime": "scg_activation_time", + "scheduledcommunicationtime": "scheduled_communication_time", + "sctptlas": "sctp_tl_as", + "sd": "sd", + "secondaryratdatausagereport": "secondary_rat_data_usage_report", + "secondaryratdatausagereportitem": "secondary_rat_data_usage_report_item", + "secondaryratdatausagereportlist": "secondary_rat_data_usage_report_list", + "secondaryratdatausagereporttransfer": "secondary_rat_data_usage_report_transfer", + "secondaryratdatausagerequest": "secondary_rat_data_usage_request", + "secondaryratrestriction": "secondary_rat_restriction", + "secondaryrattype": "secondary_rat_type", + "secondaryratusageinformation": "secondary_rat_usage_information", + "secondcriticality": "second_criticality", + "secondvalue": "second_value", + "securitycontext": "security_context", + "securityindication": "security_indication", + "securitykey": "security_key", + "securityresult": "security_result", + "selectedepstai": "selected_eps_tai", + "selectedtai": "selected_tai", + "sensormeasconfig": "sensor_meas_config", + "sensormeasconfignameitem": "sensor_meas_config_name_item", + "sensormeasconfignamelist": "sensor_meas_config_name_list", + "sensormeasurementconfiguration": "sensor_measurement_configuration", + "sensornameconfig": "sensor_name_config", + "serialnumber": "serial_number", + "serveddcns": "served_dc_ns", + "serveddcnsitem": "served_dc_ns_item", + "servedgroupids": "served_group_id_s", + "servedguamiitem": "served_guami_item", + "servedguamilist": "served_guami_list", + "servedgummeis": "served_gumme_is", + "servedgummeisitem": "served_gumme_is_item", + "servedmmecs": "served_mme_cs", + "servedplmns": "served_plm_ns", + "serviceareainformation": "service_area_information", + "serviceareainformationitem": "service_area_information_item", + "servicetype": "service_type", + "servingnid": "serving_nid", + "servingplmn": "serving_plmn", + "sgnbuex2apid": "sg_nb_ue_x2ap_id", + "sharedngumulticasttnlinformation": "shared_ngu_multicast_tnl_information", + "sharednguunicasttnlinformation": "shared_ngu_unicast_tnl_information", + "shortmacroenbid": "short_macro_enb_id", + "shortmacrongenbid": "short_macro_ng_enb_id", + "signallingbasedmdtplmnlist": "signalling_based_mdtplmn_list", + "singledevice": "single_device", + "sinr": "sinr", + "slicemdtitem": "slice_mdt_item", + "slicemdtlist": "slice_mdt_list", + "sliceoverloaditem": "slice_overload_item", + "sliceoverloadlist": "slice_overload_list", + "sliceoverloadresponse": "slice_overload_response", + "slicesupportitem": "slice_support_item", + "slicesupportlist": "slice_support_list", + "slicesupportlistqmc": "slice_support_list_qmc", + "slicesupportqmcitem": "slice_support_qmc_item", + "slicetrafficloadreductionindication": "slice_traffic_load_reduction_indication", + "slpositioningrangingauthorized": "sl_positioning_ranging_authorized", + "slpositioningrangingqosparameters": "sl_positioning_ranging_qos_parameters", + "slpositioningrangingserviceinfo": "sl_positioning_ranging_service_info", + "smtc": "smtc", + "snpn": "snpn", + "snpnbasedmdt": "snpn_based_mdt", + "snpncellbasedmdt": "snpn_cell_based_mdt", + "snpncellidlistformdt": "snp_ncell_id_listfor_mdt", + "snpncellidlistformdtitem": "snpn_cell_id_listfor_mdt_item", + "snpnlistformdt": "snpn_listfor_mdt", + "snpnlistformdtitem": "snpn_listfor_mdt_item", + "snpnmobilityinformation": "snpn_mobility_information", + "snpntaibasedmdt": "snpn_tai_based_mdt", + "snpntailistformdt": "snpntai_listfor_mdt", + "snpntailistformdtitem": "snpntai_listfor_mdt_item", + "snssai": "s_nssai", + "sonconfigurationtransfer": "son_configuration_transfer", + "soninformation": "son_information", + "soninformationextension": "son_information_extension", + "soninformationreply": "son_information_reply", + "soninformationreport": "son_information_report", + "soninformationrequest": "son_information_request", + "sontransferapplicationidentity": "so_ntransfer_application_identity", + "sontransfercause": "so_ntransfer_cause", + "sontransferrequestcontainer": "so_ntransfer_request_container", + "sontransferresponsecontainer": "so_ntransfer_response_container", + "sourcebsstotargetbsstransparentcontainer": "source_bss_to_target_bss_transparent_container", + "sourcecellcgi": "sourcecell_cgi", + "sourcecellcrnti": "sourcecell_c_rnti", + "sourcecellid": "sourcecell_id", + "sourceenb": "sourcee_nb", + "sourceenbid": "sourcee_nb_id", + "sourceenbtotargetenbtransparentcontainer": "sourcee_nb_to_targete_nb_transparent_container", + "sourceengnb": "sourceeng_nb", + "sourceengnbid": "sourceeng_nb_id", + "sourcengrannodeid": "source_ng_ran_node_id", + "sourcengrannodetotargetngrannodetransparentcontainer": "source_ngran_node_to_target_ngran_node_transparent_container", + "sourcenodeid": "source_node_id", + "sourcenodeidextension": "source_node_id_extension", + "sourceofueactivitybehaviourinformation": "source_of_ue_activity_behaviour_information", + "sourcerannodeid": "source_ran_node_id", + "sourcernctotargetrnctransparentcontainer": "source_rnc_to_target_rnc_transparent_container", + "sourcestratumlevel": "source_stratum_level", + "sourcetotargetamfinformationreroute": "source_to_target_amf_information_reroute", + "sourcetotargettransparentcontainer": "source_to_target_transparent_container", + "srvcchoindication": "srvccho_indication", + "srvccoperationnotpossible": "srvcc_operation_not_possible", + "srvccoperationpossible": "srvcc_operation_possible", + "ssbfrequencies": "ss_bfrequencies", + "ssbtomeasure": "ssb_to_measure", + "ssrssimeasurement": "ssrssi_measurement", + "sst": "sst", + "starttimestamp": "start_time_stamp", + "stationaryindication": "stationary_indication", + "stmsi": "s_tmsi", + "stratumlevel": "stratum_level", + "subcarrierspacingssb": "subcarrier_spacing_ssb", + "subscriberprofileidforrfp": "subscriber_profile_id_for_rfp", + "subscriptionbaseduedifferentiationinfo": "subscription_based_ue_differentiation_info", + "successfulhandoverreportitem": "successful_handover_report_item", + "successfulhoreportcontainer": "successful_ho_report_container", + "successfuloutcome": "successful_outcome", + "successfulpscellchangereportcontainer": "successful_ps_cell_change_report_container", + "successfulpscellchangereportitem": "successful_ps_cell_change_report_item", + "successfulpscellchangereportlist": "successful_ps_cell_change_report_list", + "supportedtaitem": "supported_ta_item", + "supportedtalist": "supported_ta_list", + "supportedtas": "supported_ta_s", + "supportedtasitem": "supported_ta_s_item", + "supporteduetype": "supported_ue_type", + "supporteduetypelist": "supported_ue_type_list", + "survivaltime": "survival_time", + "suspendindicator": "suspend_indicator", + "suspendrequestindication": "suspend_request_indication", + "suspendresponseindication": "suspend_response_indication", + "synchronisationinformation": "synchronisation_information", + "synchronisationstate": "synchronisation_state", + "synchronisationstatus": "synchronisation_status", + "tabased": "ta_based", + "tabasedmdt": "ta_based_mdt", + "tabasedqmc": "ta_based_qmc", + "tac": "tac", + "taclistinltentn": "tac_list_in_lte_ntn", + "taclistinnrntn": "tac_list_in_nrntn", + "tai": "tai", + "taibased": "tai_based", + "taibasedmdt": "tai_based_mdt", + "taibasedqmc": "tai_based_qmc", + "taibroadcast": "tai_broadcast", + "taibroadcasteutra": "tai_broadcast_eutra", + "taibroadcasteutraitem": "tai_broadcast_eutra_item", + "taibroadcastitem": "tai_broadcast_item", + "taibroadcastnr": "tai_broadcast_nr", + "taibroadcastnritem": "tai_broadcast_nr_item", + "taicancelled": "tai_cancelled", + "taicancelledeutra": "tai_cancelled_eutra", + "taicancelledeutraitem": "tai_cancelled_eutra_item", + "taicancelleditem": "tai_cancelled_item", + "taicancellednr": "tai_cancelled_nr", + "taicancellednritem": "tai_cancelled_nr_item", + "taiitem": "tai_item", + "tailist": "tai_list", + "tailistforinactive": "tai_list_for_inactive", + "tailistforinactiveitem": "tai_list_for_inactive_item", + "tailistformdt": "tai_listfor_mdt", + "tailistforpaging": "tai_list_for_paging", + "tailistforpagingitem": "tai_list_for_paging_item", + "tailistforqmc": "tai_listfor_qmc", + "tailistforrestart": "tai_list_for_restart", + "tailistforwarning": "tai_list_for_warning", + "taimbssupportitem": "taimbs_support_item", + "taimbssupportlist": "taimbs_support_list", + "tainsagsupportitem": "tainsag_support_item", + "tainsagsupportlist": "tainsag_support_list", + "taislicesupportlist": "tai_slice_support_list", + "talistformdt": "ta_listfor_mdt", + "talistforqmc": "ta_listfor_qmc", + "targetbsstosourcebsstransparentcontainer": "target_bss_to_source_bss_transparent_container", + "targetcellcgi": "targetcell_cgi", + "targetcellid": "target_cell_id", + "targetcellineutran": "targetcellin_e_utran", + "targetenb": "targete_nb", + "targetenbid": "targete_nb_id", + "targetenbtosourceenbtransparentcontainer": "targete_nb_to_sourcee_nb_transparent_container", + "targetengnb": "targeteng_nb", + "targetgnbsetid": "targetg_nb_set_id", + "targetgngrannodeid": "targetg_ng_ran_node_id", + "targethomeenbid": "target_home_enb_id", + "targetid": "target_id", + "targetngrannodeid": "target_ngra_nnode_id", + "targetngrannodetosourcengrannodefailuretransparentcontainer": "target_ngran_node_to_source_ngran_node_failure_transparent_container", + "targetngrannodetosourcengrannodetransparentcontainer": "target_ngran_node_to_source_ngran_node_transparent_container", + "targetnssai": "target_nssai", + "targetnssaiinformation": "target_nssai_information", + "targetnssaiitem": "target_nssai_item", + "targetrannodeid": "target_ran_node_id", + "targetrannodeidrim": "target_ran_node_id_rim", + "targetrannodeidson": "target_ran_node_id_son", + "targetrncid": "target_rnc_id", + "targetrnctosourcernctransparentcontainer": "target_rnc_to_source_rnc_transparent_container", + "targettosourcefailuretransparentcontainer": "targetto_source_failure_transparent_container", + "targettosourcetransparentcontainer": "target_to_source_transparent_container", + "tbcdstring": "tbcd_string", + "thresholdrsrp": "threshold_rsrp", + "thresholdrsrq": "threshold_rsrq", + "thresholdsinr": "threshold_sinr", + "threshrsindexr15": "thresh_rs_index_r15", + "timebasedhandoverinformation": "time_based_handover_information", + "timedistributionindication": "time_distribution_indication", + "timeinterval": "time_interval", + "timeofdayend": "timeof_day_end", + "timeofdaystart": "timeof_day_start", + "timerapproachforguamiremoval": "timer_approach_for_guami_removal", + "timerefdistribution": "time_ref_distribution", + "timesincefailure": "time_since_failure", + "timesincesecondarynoderelease": "time_since_secondary_node_release", + "timestamp": "time_stamp", + "timestay": "time_stay", + "timestayedincell": "time_stayed_in_cell", + "timesyncassistanceinfo": "time_sync_assistance_info", + "timesynchronisationinfo": "time_synchronisation_info", + "timetotrigger": "time_to_trigger", + "timetowait": "time_to_wait", + "timeuestayedincell": "time_ue_stayed_in_cell", + "timeuestayedincellenhancedgranularity": "time_ue_stayed_in_cell_enhanced_granularity", + "timingsynchronisationstatus": "timing_synchronisation_status", + "timingsynchronisationstatusfailure": "timing_synchronisation_status_failure", + "timingsynchronisationstatusreport": "timing_synchronisation_status_report", + "timingsynchronisationstatusrequest": "timing_synchronisation_status_request", + "timingsynchronisationstatusresponse": "timing_synchronisation_status_response", + "tlcontainer": "tl_container", + "tmgi": "tmgi", + "tnapid": "tnap_id", + "tngfid": "tngf_id", + "tnladdressweightfactor": "tnl_address_weight_factor", + "tnlassociationaddress": "tnl_association_address", + "tnlassociationitem": "tnl_association_item", + "tnlassociationlist": "tnl_association_list", + "tnlassociationtransportlayeraddress": "tnl_association_transport_layer_address", + "tnlassociationtransportlayeraddressamf": "tnl_association_transport_layer_address_amf", + "tnlassociationusage": "tnl_association_usage", + "tooearlyinterrathoreportfromeutran": "too_early_inter_ratho_report_from_eutran", + "tooearlyinterrathoreportreportfromeutran": "too_early_inter_ratho_report_report_from_eutran", + "tooearlyintersystemho": "tooearly_intersystem_ho", + "traceabletognss": "traceableto_gnss", + "traceabletoutc": "traceableto_utc", + "traceactivation": "trace_activation", + "tracecollectionentityipaddress": "trace_collection_entity_ip_address", + "tracedepth": "trace_depth", + "tracefailureindication": "trace_failure_indication", + "tracestart": "trace_start", + "trackingarealistforwarning": "tracking_area_listfor_warning", + "trafficloadreductionindication": "traffic_load_reduction_indication", + "trafficprofile": "traffic_profile", + "transfertype": "transfer_type", + "transport": "transport", + "transportinformation": "transport_information", + "transportlayeraddress": "transport_layer_address", + "triggeringmessage": "triggering_message", + "tscassistanceinformation": "tsc_assistance_information", + "tscassistanceinformationdl": "tsc_assistance_information_dl", + "tscassistanceinformationul": "tsc_assistance_information_ul", + "tscfeedbackinformation": "tsc_feedback_information", + "tscfeedbackinformationdl": "tsc_feedback_information_dl", + "tscfeedbackinformationul": "tsc_feedback_information_ul", + "tsctrafficcharacteristics": "tsc_traffic_characteristics", + "tsctrafficcharacteristicsfeedback": "tsc_traffic_characteristics_feedback", + "tunnelinformation": "tunnel_information", + "twapid": "twap_id", + "twifid": "twif_id", + "typeoferror": "type_of_error", + "udpportnumber": "udp_port_number", + "ueaggregatemaximumbitrate": "ue_aggregate_maximum_bit_rate", + "ueaggregatemaximumbitratedl": "ue_aggregate_maximum_bit_rate_dl", + "ueaggregatemaximumbitrateul": "ue_aggregate_maximum_bit_rate_ul", + "ueapplayermeasconfig": "ue_app_layer_meas_config", + "ueapplayermeasconfiginfo": "ue_app_layer_meas_config_info", + "ueapplayermeasinfoitem": "ue_app_layer_meas_info_item", + "ueapplayermeasinfolist": "ue_app_layer_meas_info_list", + "ueapplicationlayermeasurementcapability": "ue_application_layer_measurement_capability", + "ueassociatedlogicalngconnectionitem": "ue_associated_logical_ng_connection_item", + "ueassociatedlogicalngconnectionlist": "ue_associated_logical_ng_connection_list", + "ueassociatedlogicals1connectionitem": "ue_associated_logical_s1_connection_item", + "ueassociatedlogicals1connectionlistres": "ue_associated_logical_s1_connection_list_res", + "ueassociatedlogicals1connectionlistresack": "ue_associated_logical_s1_connection_list_res_ack", + "uecapabilityinfoindication": "ue_capability_info_indication", + "uecapabilityinforequest": "ue_capability_info_request", + "uecontextmodification": "ue_context_modification", + "uecontextmodificationconfirm": "ue_context_modification_confirm", + "uecontextmodificationfailure": "ue_context_modification_failure", + "uecontextmodificationindication": "ue_context_modification_indication", + "uecontextmodificationrequest": "ue_context_modification_request", + "uecontextmodificationresponse": "ue_context_modification_response", + "uecontextrelease": "ue_context_release", + "uecontextreleasecommand": "ue_context_release_command", + "uecontextreleasecomplete": "ue_context_release_complete", + "uecontextreleaserequest": "ue_context_release_request", + "uecontextrequest": "ue_context_request", + "uecontextresume": "ue_context_resume", + "uecontextresumefailure": "ue_context_resume_failure", + "uecontextresumerequest": "ue_context_resume_request", + "uecontextresumerequesttransfer": "ue_context_resume_request_transfer", + "uecontextresumeresponse": "ue_context_resume_response", + "uecontextresumeresponsetransfer": "ue_context_resume_response_transfer", + "uecontextsuspend": "ue_context_suspend", + "uecontextsuspendfailure": "ue_context_suspend_failure", + "uecontextsuspendrequest": "ue_context_suspend_request", + "uecontextsuspendrequesttransfer": "ue_context_suspend_request_transfer", + "uecontextsuspendresponse": "ue_context_suspend_response", + "uedifferentiationinfo": "ue_differentiation_info", + "uehistoryinformation": "ue_history_information", + "uehistoryinformationfromtheue": "ue_history_information_from_the_ue", + "ueidentityindexvalue": "ue_identity_index_value", + "ueinformationtransfer": "ue_information_transfer", + "uelocationderivedtac": "ue_location_derived_tac", + "uelocationderivedtacinnrntn": "ue_location_derived_tac_in_nrntn", + "uengapidpair": "ue_ngap_id_pair", + "uengapids": "ue_ngap_id_s", + "ueorientationconfig": "ue_orientation_config", + "uepagingid": "ue_paging_id", + "uepagingidentity": "ue_paging_identity", + "uepagingitem": "ue_paging_item", + "uepaginglist": "ue_paging_list", + "uepresence": "ue_presence", + "uepresenceinareaofinterestitem": "ue_presence_in_area_of_interest_item", + "uepresenceinareaofinterestlist": "ue_presence_in_area_of_interest_list", + "ueradiocapability": "ue_radio_capability", + "ueradiocapabilitycheck": "ue_radio_capability_check", + "ueradiocapabilitycheckrequest": "ue_radio_capability_check_request", + "ueradiocapabilitycheckresponse": "ue_radio_capability_check_response", + "ueradiocapabilityforpaging": "ue_radio_capability_for_paging", + "ueradiocapabilityforpagingofeutra": "ue_radio_capability_for_paging_of_eutra", + "ueradiocapabilityforpagingofnbiot": "ue_radio_capability_for_paging_of_nb_io_t", + "ueradiocapabilityforpagingofnr": "ue_radio_capability_for_paging_of_nr", + "ueradiocapabilityid": "ue_radio_capability_id", + "ueradiocapabilityidmapping": "ue_radio_capability_id_mapping", + "ueradiocapabilityidmappingrequest": "ue_radio_capability_id_mapping_request", + "ueradiocapabilityidmappingresponse": "ue_radio_capability_id_mapping_response", + "ueradiocapabilityinfoindication": "ue_radio_capability_info_indication", + "ueradiocapabilitymatch": "ue_radio_capability_match", + "ueradiocapabilitymatchrequest": "ue_radio_capability_match_request", + "ueradiocapabilitymatchresponse": "ue_radio_capability_match_response", + "uereachabilityindication": "ue_reachability_indication", + "ueretentioninformation": "ue_retention_information", + "uerlfreportcontainer": "uerlf_report_container", + "uerlfreportcontainerforextendedbands": "ue_rlf_report_container_for_extended_bands", + "ues1apidpair": "ue_s1ap_id_pair", + "ues1apids": "ue_s1ap_id_s", + "uesecuritycapabilities": "ue_security_capabilities", + "uesidelinkaggregatemaximumbitrate": "ue_sidelink_aggregate_maximum_bit_rate", + "ueslicemaximumbitratedl": "ue_slice_maximum_bit_rate_dl", + "ueslicemaximumbitrateitem": "ue_slice_maximum_bit_rate_item", + "ueslicemaximumbitratelist": "ue_slice_maximum_bit_rate_list", + "ueslicemaximumbitrateul": "ue_slice_maximum_bit_rate_ul", + "uespecificdrx": "ue_specific_drx", + "uespeedconfig": "ue_speed_config", + "uetnlabindingrelease": "uetnla_binding_release", + "uetnlabindingreleaserequest": "uetnla_binding_release_request", + "ueupciotsupport": "ue_up_ci_o_t_support", + "ueusagetype": "ue_usage_type", + "ueuserplaneciotsupportindicator": "ue_user_plane_ci_o_ts_upport_indicator", + "ulavailablebitratereportthresholds": "ul_available_bitrate_report_thresholds", + "ulcompositeavailablecapacity": "ul_composite_available_capacity", + "ulcountvalue": "ul_count_value", + "ulcpsecurityinformation": "ul_cp_security_information", + "ulehrpdcompositeavailablecapacity": "ul_ehrpd_composite_available_capacity", + "ulforwarding": "ul_forwarding", + "ulforwardinguptnlinformation": "ul_forwarding_up_tnl_information", + "ulgbrprbusage": "ul_gbr_prb_usage", + "ulgbrprbusageformimo": "ul_gbr_prb_usage_for_mimo", + "ulgtpteid": "ul_gtp_teid", + "ulnascount": "ul_nas_count", + "ulnasmac": "ul_nas_mac", + "ulnguuptnlinformation": "ul_ngu_up_tnl_information", + "ulnguuptnlmodifyitem": "ul_ngu_up_tnl_modify_item", + "ulnguuptnlmodifylist": "ul_ngu_up_tnl_modify_list", + "ulnongbrprbusage": "ul_non_gbr_prb_usage", + "ulnongbrprbusageformimo": "ul_non_gbr_prb_usage_for_mimo", + "ulpdusetqosinformation": "ul_pdu_set_qos_information", + "ulschedulingpdcchcceusage": "ul_scheduling_pdcch_cce_usage", + "ultotalprbusage": "ul_total_prb_usage", + "ultotalprbusageformimo": "ul_total_prb_usage_for_mimo", + "ultransportlayeraddress": "ul_transport_layer_address", + "unavailableguamiitem": "unavailable_guami_item", + "unavailableguamilist": "unavailable_guami_list", + "uncompensatedbarometricconfig": "uncompensated_barometric_config", + "undefined": "undefined", + "unlicensedspectrumrestriction": "unlicensed_spectrum_restriction", + "unsuccessfuloutcome": "unsuccessful_outcome", + "updatefeedback": "update_feedback", + "uplinknastransport": "uplink_nas_transport", + "uplinknonueassociatedlppatransport": "uplink_non_ue_associated_lp_pa_transport", + "uplinknonueassociatednrppatransport": "uplink_non_ue_associated_nrp_pa_transport", + "uplinkranconfigurationtransfer": "uplink_ran_configuration_transfer", + "uplinkranearlystatustransfer": "uplink_ran_early_status_transfer", + "uplinkranstatustransfer": "uplink_ran_status_transfer", + "uplinkriminformationtransfer": "uplink_rim_information_transfer", + "uplinks1cdma2000tunnelling": "uplink_s1_cdma2000tunnelling", + "uplinktlcontainer": "uplink_tl_container", + "uplinkueassociatedlppatransport": "uplink_ue_associated_lp_pa_transport", + "uplinkueassociatednrppatransport": "uplink_ue_associated_nrp_pa_transport", + "uptransportlayerinformation": "up_transport_layer_information", + "uptransportlayerinformationitem": "up_transport_layer_information_item", + "uptransportlayerinformationlist": "up_transport_layer_information_list", + "uptransportlayerinformationpairitem": "up_transport_layer_information_pair_item", + "uptransportlayerinformationpairlist": "up_transport_layer_information_pair_list", + "uriaddress": "uri_address", + "usagecountdl": "usage_count_dl", + "usagecountul": "usage_count_ul", + "userlocationinformation": "user_location_information", + "userlocationinformationeutra": "user_location_information_eutra", + "userlocationinformationn3iwfwithoutportnumber": "user_location_information_n3iwf_without_port_number", + "userlocationinformationn3iwfwithportnumber": "user_location_information_n3iwf_with_port_number", + "userlocationinformationnr": "user_location_information_nr", + "userlocationinformationtngf": "user_location_information_tngf", + "userlocationinformationtwif": "user_location_information_twif", + "userlocationinformationwagf": "user_location_information_w_agf", + "userplaneerrorindicator": "user_plane_error_indicator", + "userplanefailureindication": "user_plane_failure_indication", + "userplanefailureindicationreport": "user_plane_failure_indication_report", + "userplanefailuretype": "user_plane_failure_type", + "userplanesecurityinformation": "user_plane_security_information", + "utran": "utran", + "utrancell": "utran_cell", + "utranresponse": "utran_response", + "uutimesyncerrorbudget": "uu_time_sync_error_budget", + "v2xservicesauthorized": "v2x_services_authorized", + "value": "value", + "vehicleue": "vehicle_ue", + "voicesupportmatchindicator": "voice_support_match_indicator", + "volumetimedreportitem": "volume_timed_report_item", + "volumetimedreportlist": "volume_timed_report_list", + "wagfid": "w_agf_id", + "warningareacoordinates": "warning_area_coordinates", + "warningarealist": "warning_area_list", + "warningmessagecontents": "warning_message_contents", + "warningsecurityinfo": "warning_security_info", + "warningtype": "warning_type", + "wlanmeasconfig": "wlan_meas_config", + "wlanmeasconfignameitem": "wlan_meas_config_name_item", + "wlanmeasconfignamelist": "wlan_meas_config_name_list", + "wlanmeasurementconfiguration": "wlan_measurement_configuration", + "wlanname": "wlan_name", + "wlanrssi": "wlan_rssi", + "wlanrtt": "wlan_rtt", + "writereplacewarning": "write_replace_warning", + "writereplacewarningrequest": "write_replace_warning_request", + "writereplacewarningresponse": "write_replace_warning_response", + "wusassistanceinformation": "wus_assistance_information", + "x2tnlconfiginfo": "x2tnl_config_info", + "x2tnlconfigurationinfo": "x2tnl_configuration_info", + "xnextendedtransportlayeraddresses": "xn_extended_transport_layer_addresses", + "xnexttlaitem": "xn_ext_tla_item", + "xnexttlas": "xn_ext_tl_as", + "xngtptlas": "xn_gtp_tl_as", + "xntlas": "xn_tl_as", + "xntnlconfigurationinfo": "xn_tnl_configuration_info", + "xntransportlayeraddresses": "xn_transport_layer_addresses", + "xrdevicewith2rx": "xr_device_with2_rx", +} diff --git a/internal/decoder/utils/asn1_names_test.go b/internal/decoder/utils/asn1_names_test.go new file mode 100644 index 0000000000..511f7444d1 --- /dev/null +++ b/internal/decoder/utils/asn1_names_test.go @@ -0,0 +1,165 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package utils + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "os" + "path/filepath" + "regexp" + "sort" + "strings" + "testing" +) + +var updateNames = flag.Bool("update", false, "regenerate asn1_names.go from the vendored ASN.1 modules") + +var ( + componentRe = regexp.MustCompile(`(?m)^\s+([a-z][A-Za-z0-9-]*)\s+[A-Z]`) + typeRe = regexp.MustCompile(`(?m)^([A-Z][A-Za-z0-9-]*)\s*::=`) +) + +func TestASN1NamesUpToDate(t *testing.T) { + var modules []string + + for _, dir := range []string{"../../../ngap/testdata/asn1", "../../../s1ap/testdata/asn1"} { + paths, err := filepath.Glob(filepath.Join(dir, "*.asn")) + if err != nil { + t.Fatal(err) + } + + if len(paths) == 0 { + t.Fatalf("no ASN.1 modules under %s", dir) + } + + modules = append(modules, paths...) + } + + sort.Strings(modules) + + components := map[string]map[string]int{} + types := map[string]map[string]int{} + + for _, p := range modules { + b, err := os.ReadFile(p) + if err != nil { + t.Fatal(err) + } + + for _, m := range componentRe.FindAllSubmatch(b, -1) { + count(components, string(m[1])) + } + + for _, m := range typeRe.FindAllSubmatch(b, -1) { + count(types, string(m[1])) + } + } + + names := map[string]string{} + + for key, forms := range types { + names[key] = asn1Snake(mostCommon(forms)) + } + + for key, forms := range components { + names[key] = asn1Snake(mostCommon(forms)) + } + + keys := make([]string, 0, len(names)) + for k := range names { + keys = append(keys, k) + } + + sort.Strings(keys) + + var buf bytes.Buffer + + buf.WriteString("// SPDX-FileCopyrightText: Ella Networks Inc.\n// SPDX-License-Identifier: BUSL-1.1\n\npackage utils\n\nvar asn1Names = map[string]string{\n") + + for _, k := range keys { + fmt.Fprintf(&buf, "\t%q: %q,\n", k, names[k]) + } + + buf.WriteString("}\n") + + want, err := format.Source(buf.Bytes()) + if err != nil { + t.Fatal(err) + } + + if *updateNames { + if err := os.WriteFile("asn1_names.go", want, 0o644); err != nil { + t.Fatal(err) + } + + return + } + + got, err := os.ReadFile("asn1_names.go") + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(got, want) { + t.Error("asn1_names.go is stale: run go test ./internal/decoder/utils/ -run TestASN1NamesUpToDate -update") + } +} + +func count(into map[string]map[string]int, ident string) { + key := strings.ToLower(strings.ReplaceAll(ident, "-", "")) + if into[key] == nil { + into[key] = map[string]int{} + } + + into[key][ident]++ +} + +func mostCommon(forms map[string]int) string { + best, n := "", 0 + + for f, c := range forms { + if c > n || (c == n && f < best) { + best, n = f, c + } + } + + return best +} + +func asn1Snake(ident string) string { + segments := strings.Split(ident, "-") + out := make([]string, 0, len(segments)) + + for i, s := range segments { + if s == "" { + continue + } + + if i == 0 { + s = strings.ToUpper(s[:1]) + s[1:] + } + + out = append(out, SnakeCase(s)) + } + + return strings.Join(out, "_") +} + +func TestFieldName(t *testing.T) { + cases := map[string]string{ + "GTPTEID": "gtp_teid", + "TransportLayerAddress": "transport_layer_address", + "EUTRApagingeDRXCycle": "eutra_paging_e_drx_cycle", + "Pc5QoSFlowList": "pc5_qos_flow_list", + } + + for in, want := range cases { + if got := FieldName(in); got != want { + t.Errorf("FieldName(%q) = %q, want %q", in, got, want) + } + } +} diff --git a/internal/decoder/utils/render.go b/internal/decoder/utils/render.go new file mode 100644 index 0000000000..67933fbe56 --- /dev/null +++ b/internal/decoder/utils/render.go @@ -0,0 +1,323 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package utils + +import ( + "bytes" + "cmp" + "encoding/hex" + "encoding/json" + "reflect" + "slices" + "strings" + "unicode" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type Opaque struct { + Hex string `json:"hex"` + Bits int `json:"bits,omitempty"` + Decoded any `json:"decoded,omitempty"` + Error string `json:"error,omitempty"` +} + +func Octets(b []byte) Opaque { + return Opaque{Hex: hex.EncodeToString(b)} +} + +func BitString(b []byte, bits int) Opaque { + return Opaque{Hex: hex.EncodeToString(b), Bits: bits} +} + +func BitStringUint(v uint64, bits int) Opaque { + b := make([]byte, (bits+7)/8) + + for i := range bits { + if v&(1< 0 { + buf.WriteByte(',') + } + + k, err := json.Marshal(m.Key) + if err != nil { + return nil, err + } + + v, err := json.Marshal(m.Value) + if err != nil { + return nil, err + } + + buf.Write(k) + buf.WriteByte(':') + buf.Write(v) + } + + buf.WriteByte('}') + + return buf.Bytes(), nil +} + +type Leaf func(v any) (any, bool) + +func Present(v any) bool { + return present(reflect.ValueOf(v)) +} + +func present(v reflect.Value) bool { + switch v.Kind() { + case reflect.Invalid: + return false + case reflect.Pointer, reflect.Interface, reflect.Map: + return !v.IsNil() + case reflect.Slice: + return v.Len() > 0 + default: + return true + } +} + +func Render(v any, leaf Leaf) any { + return render(reflect.ValueOf(v), leaf) +} + +func render(v reflect.Value, leaf Leaf) any { + for v.Kind() == reflect.Pointer || v.Kind() == reflect.Interface { + if v.IsNil() { + return nil + } + + v = v.Elem() + } + + if !v.IsValid() { + return nil + } + + if v.CanInterface() { + if out, ok := builtin(v, leaf); ok { + return out + } + } + + switch v.Kind() { + case reflect.Bool: + return v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return v.Uint() + case reflect.String: + return v.String() + case reflect.Slice, reflect.Array: + if v.Type().Elem() == reflect.TypeFor[byte]() { + b := make([]byte, v.Len()) + for i := range b { + b[i] = byte(v.Index(i).Uint()) + } + + return Octets(b) + } + + out := make([]any, 0, v.Len()) + for i := range v.Len() { + out = append(out, render(v.Index(i), leaf)) + } + + return out + case reflect.Struct: + return renderStruct(v, leaf) + default: + return nil + } +} + +func builtin(v reflect.Value, leaf Leaf) (any, bool) { + x := v.Interface() + + if leaf != nil { + if out, ok := leaf(x); ok { + return out, true + } + } + + switch t := x.(type) { + case ap.TransportLayerAddress: + return TransportLayerAddressText(t), true + case per.ExtensionAlternative: + return ExtensionAlternative{Index: t.Index, Hex: hex.EncodeToString([]byte(t.Value))}, true + case per.Null: + return true, true + case interface { + Bits() int + Bytes() []byte + }: + return BitString(t.Bytes(), t.Bits()), true + case interface{ Name() string }: + if v.CanInt() { + return NamedEnum(v.Int(), t.Name()), true + } + + if v.CanUint() { + return NamedEnum(v.Uint(), t.Name()), true + } + } + + return nil, false +} + +func renderStruct(v reflect.Value, leaf Leaf) Object { + out := Object{} + t := v.Type() + + for i := range t.NumField() { + f := t.Field(i) + if !f.IsExported() { + continue + } + + fv := v.Field(i) + if !present(fv) { + continue + } + + out = append(out, Member{Key: FieldName(f.Name), Value: render(fv, leaf)}) + } + + return out +} + +func TransportLayerAddressText(a ap.TransportLayerAddress) string { + ipv4, ipv6 := a.IPv4(), a.IPv6() + + switch { + case ipv4.IsValid() && ipv6.IsValid(): + return ipv4.String() + "+" + ipv6.String() + case ipv4.IsValid(): + return ipv4.String() + case ipv6.IsValid(): + return ipv6.String() + default: + return hex.EncodeToString(a.Bytes()) + } +} + +var goAliases = map[string]string{"choiceextension": "choiceextensions"} + +func FieldName(goName string) string { + key := strings.ToLower(goName) + if alias, ok := goAliases[key]; ok { + key = alias + } + + if name, ok := asn1Names[key]; ok { + return name + } + + return SnakeCase(goName) +} + +func SnakeCase(name string) string { + name = strings.NewReplacer("QoS", "Qos", "AIoT", "Aiot").Replace(name) + r := []rune(name) + + var words []string + + for i := 0; i < len(r); { + j := i + 1 + + switch { + case unicode.IsUpper(r[i]): + for j < len(r) && (unicode.IsUpper(r[j]) || unicode.IsDigit(r[j])) { + j++ + } + + k := j + for k < len(r) && (unicode.IsLower(r[k]) || unicode.IsDigit(r[k])) { + k++ + } + + switch { + case j-i == 1 || k == j: + j = k + case j-i == 2 || connectives[string(r[j:k])]: + words = append(words, string(r[i:j])) + i, j = j, k + default: + words = append(words, string(r[i:j-1])) + i, j = j-1, k + } + default: + for j < len(r) && !unicode.IsUpper(r[j]) { + j++ + } + } + + words = append(words, string(r[i:j])) + i = j + } + + return strings.ToLower(strings.Join(words, "_")) +} + +var connectives = map[string]bool{"to": true, "for": true, "of": true, "in": true, "and": true, "or": true, "per": true} + +func WireOrder[T any](wire []int64, items []T, id func(T) int64) []T { + positions := map[int64][]int{} + + for i, w := range wire { + positions[w] = append(positions[w], i) + } + + type ranked struct { + rank int + item T + } + + out := make([]ranked, len(items)) + + for i, item := range items { + out[i] = ranked{rank: len(wire) + i, item: item} + + if p := positions[id(item)]; len(p) > 0 { + out[i].rank = p[0] + positions[id(item)] = p[1:] + } + } + + slices.SortStableFunc(out, func(a, b ranked) int { return cmp.Compare(a.rank, b.rank) }) + + for i, r := range out { + items[i] = r.item + } + + return items +} diff --git a/internal/decoder/utils/render_test.go b/internal/decoder/utils/render_test.go new file mode 100644 index 0000000000..dc27578a72 --- /dev/null +++ b/internal/decoder/utils/render_test.go @@ -0,0 +1,120 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package utils + +import ( + "encoding/json" + "slices" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +type testEnum uint8 + +func (e testEnum) Name() string { + if e == 0 { + return "first" + } + + return "" +} + +type testBits struct{} + +func (testBits) Bits() int { return 12 } +func (testBits) Bytes() []byte { return []byte{0xab, 0xc0} } + +type testChoice struct { + First *testEnum + Second *per.Null + Ext *per.ExtensionAlternative +} + +type testSequence struct { + TransportLayerAddress ap.TransportLayerAddress + GTPTEID uint32 + Absent *testEnum + Empty []testEnum + Octets []byte + Bits testBits + Choice testChoice + List []testEnum + hidden int +} + +func TestRender(t *testing.T) { + v := testSequence{ + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), + GTPTEID: 7, + Octets: []byte{0x01, 0x02}, + Choice: testChoice{Second: &per.Null{}, Ext: &per.ExtensionAlternative{Index: 3, Value: "\x0f"}}, + List: []testEnum{0, 5}, + hidden: 1, + } + + b, err := json.Marshal(Render(&v, nil)) + if err != nil { + t.Fatal(err) + } + + want := `{"transport_layer_address":"10.0.0.1","gtp_teid":7,"octets":{"hex":"0102"},"bits":{"hex":"abc0","bits":12},` + + `"choice":{"second":true,"ext":{"index":3,"hex":"0f"}},` + + `"list":[{"type":"enum","value":0,"label":"first","unknown":false},{"type":"enum","value":5,"label":"","unknown":true}]}` + + if string(b) != want { + t.Errorf("Render =\n%s\nwant\n%s", b, want) + } +} + +func TestRenderLeafOverrides(t *testing.T) { + leaf := func(v any) (any, bool) { + if _, ok := v.(testEnum); ok { + return "overridden", true + } + + return nil, false + } + + b, err := json.Marshal(Render([]testEnum{1}, leaf)) + if err != nil { + t.Fatal(err) + } + + if string(b) != `["overridden"]` { + t.Errorf("Render = %s", b) + } +} + +func TestBitStringUint(t *testing.T) { + got := BitStringUint(0x155, 10) + if got.Hex != "5540" || got.Bits != 10 { + t.Errorf("BitStringUint = %+v, want left-aligned 5540/10", got) + } +} + +func TestPresent(t *testing.T) { + var nilPtr *testEnum + + for _, v := range []any{nil, nilPtr, []byte{}, []testEnum(nil)} { + if Present(v) { + t.Errorf("Present(%#v) = true", v) + } + } + + for _, v := range []any{testEnum(0), new(testEnum), []byte{0}} { + if !Present(v) { + t.Errorf("Present(%#v) = false", v) + } + } +} + +func TestWireOrder(t *testing.T) { + got := WireOrder([]int64{3, 1, 3, 2}, []int64{1, 2, 3, 9, 3}, func(v int64) int64 { return v }) + + if want := []int64{3, 1, 3, 2, 9}; !slices.Equal(got, want) { + t.Errorf("WireOrder = %v, want %v", got, want) + } +} diff --git a/internal/mme/s1ap/handle_handover_required.go b/internal/mme/s1ap/handle_handover_required.go index ca3505846c..1b9fb26cf5 100644 --- a/internal/mme/s1ap/handle_handover_required.go +++ b/internal/mme/s1ap/handle_handover_required.go @@ -60,6 +60,14 @@ func handleHandoverRequired(ctx context.Context, m *mme.MME, radio *mme.Radio, v return } + if req.TargetID.TargeteNBID == nil { + logger.From(ctx, logger.MmeLog).Warn("intra-LTE Handover Required whose target is not an eNB", + logger.MMEUeS1apID(uint32(req.MMEUES1APID))) + mme.SendHandoverPreparationFailure(ctx, m, radio.Conn, req.MMEUES1APID, req.ENBUES1APID, causeUnknownTargetID) + + return + } + targetID, err := mme.RanNodeID(req.TargetID.TargeteNBID.GlobalENBID) if err != nil { logger.From(ctx, logger.MmeLog).Warn("Handover Required for a target eNB that cannot be decoded", diff --git a/internal/mme/s1ap/handle_path_switch_request.go b/internal/mme/s1ap/handle_path_switch_request.go index 384fa70e0b..545450a0c0 100644 --- a/internal/mme/s1ap/handle_path_switch_request.go +++ b/internal/mme/s1ap/handle_path_switch_request.go @@ -258,7 +258,8 @@ func pathSwitchSecurityCapabilities(ctx context.Context, ue *mme.UeContext, rece stored := mme.S1apSecurityCapabilities(uecap) - if received == nil || received.Equal(stored) { + if received == nil || (received.EncryptionAlgorithms == stored.EncryptionAlgorithms && + received.IntegrityProtectionAlgorithms == stored.IntegrityProtectionAlgorithms) { return nil } diff --git a/internal/mme/s1ap/handle_path_switch_request_test.go b/internal/mme/s1ap/handle_path_switch_request_test.go index 27c35bc54a..24d0fe8b36 100644 --- a/internal/mme/s1ap/handle_path_switch_request_test.go +++ b/internal/mme/s1ap/handle_path_switch_request_test.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/internal/mme" "github.com/ellanetworks/core/internal/models" "github.com/ellanetworks/core/nas/eps" + "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" "github.com/ellanetworks/core/s1ap" ) @@ -312,3 +313,35 @@ func TestPathSwitchPartialFailureReleasesUnswitchedERAB(t *testing.T) { t.Fatalf("released E-RAB = %d, want %d", ack.ERABToBeReleased[0].ERABID, unknownERAB) } } + +func TestPathSwitchCapabilityMatchIgnoresUnknownExtension(t *testing.T) { + m := newTestMME(t) + ue := pathSwitchUE(t, m) + + wire := []byte{0x58, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe7, 0x40, 0x01, 0x00} + + var caps s1ap.UESecurityCapabilities + if err := caps.UnmarshalPER(per.NewReader(wire), per.Aligned); err != nil { + t.Fatalf("decode UE Security Capabilities: %v", err) + } + + plain := s1ap.UESecurityCapabilities{EncryptionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}, IntegrityProtectionAlgorithms: s1ap.SecurityAlgorithms{Value: 0xc000}} + if caps.EncryptionAlgorithms != plain.EncryptionAlgorithms || caps.IntegrityProtectionAlgorithms != plain.IntegrityProtectionAlgorithms { + t.Fatalf("decoded algorithms = %+v, want %+v", caps, plain) + } + + if caps.Equal(plain) { + t.Fatal("fixture carries no extension state") + } + + req := samplePathSwitchRequest(ue) + req.UESecurityCapabilities = &caps + + target := &captureConn{} + handlePathSwitchRequest(context.Background(), m, mme.NewRadioForTest(target), pathSwitchValue(t, req)) + + ack := parsePathSwitchAck(t, target.sent[0]) + if ack.UESecurityCapabilities != nil { + t.Fatalf("ack replayed capabilities though the algorithms matched: %+v", ack.UESecurityCapabilities) + } +} diff --git a/internal/mme/s1ap/handover_target_test.go b/internal/mme/s1ap/handover_target_test.go new file mode 100644 index 0000000000..81cdfed837 --- /dev/null +++ b/internal/mme/s1ap/handover_target_test.go @@ -0,0 +1,127 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "context" + "testing" + + "github.com/ellanetworks/core/internal/mme" + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/s1ap" +) + +type targetIDCase struct { + targetID s1ap.TargetID + cause s1ap.Cause +} + +func TestHandoverRequiredTargetIDAlternatives(t *testing.T) { + plmn := s1ap.PLMNIdentity{0x00, 0xf1, 0x10} + rac := s1ap.RAC(7) + notComprehended := s1ap.CauseProtocolAbstractSyntaxErrorReject.Cause() + + cases := map[string]targetIDCase{ + "targetRNC-ID": { + s1ap.TargetID{TargetRNCID: &s1ap.TargetRNCID{LAI: s1ap.LAI{PLMNIdentity: plmn, LAC: 1}, RAC: &rac, RNCID: 12}}, + causeUnknownTargetID, + }, + "cGI": { + s1ap.TargetID{CGI: &s1ap.CGI{PLMNIdentity: plmn, LAC: 1, CI: 2, RAC: &rac}}, + causeUnknownTargetID, + }, + "targetgNgRanNode-ID": { + s1ap.TargetID{TargetNgRanNodeID: &s1ap.TargetNgRanNodeID{ + GlobalRANNodeID: s1ap.GlobalRANNodeID{GNB: &s1ap.GNB{GlobalGNBID: s1ap.GlobalGNBID{ + PLMNIdentity: plmn, + GNBID: s1ap.GNBIdentity{GNBID: &s1ap.GNBID{Value: 1, Bits: 24}}, + }}}, + SelectedTAI: s1ap.FiveGSTAI{PLMNIdentity: plmn, TAC: 1}, + }}, + causeUnknownTargetID, + }, + "unknown extension": { + s1ap.TargetID{Ext: &per.ExtensionAlternative{Index: 1, Value: "\x00"}}, + notComprehended, + }, + "targeteNB-ID with unknown eNB-ID alternative": { + s1ap.TargetID{TargeteNBID: &s1ap.TargeteNBID{ + GlobalENBID: s1ap.GlobalENBID{PLMNIdentity: plmn, ENBID: s1ap.ENBID{Ext: &per.ExtensionAlternative{Index: 2, Value: "\x00"}}}, + SelectedTAI: s1ap.TAI{PLMNIdentity: plmn, TAC: 1}, + }}, + notComprehended, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + m := newTestMME(t) + ue, source, target := handoverUE(t, m) + + req := sampleHandoverRequired(ue) + req.TargetID = tc.targetID + + handleHandoverRequired(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, req.Marshal))) + + fail := preparationFailureOn(t, source) + if fail.Cause == nil || !fail.Cause.Equal(tc.cause) { + t.Fatalf("cause = %+v, want %+v", fail.Cause, tc.cause) + } + + target.mu.Lock() + sent := len(target.sent) + target.mu.Unlock() + + if sent != 0 { + t.Fatalf("target eNB received %d messages, want none", sent) + } + + if ue.HasHandoverForTest() { + t.Fatal("handover context left set on failure") + } + }) + } +} + +func TestHandoverRequiredToFiveGSTargetIDAlternatives(t *testing.T) { + plmn := s1ap.PLMNIdentity{0x00, 0xf1, 0x10} + notComprehended := s1ap.CauseProtocolAbstractSyntaxErrorReject.Cause() + + cases := map[string]targetIDCase{ + "targeteNB-ID": { + s1ap.TargetID{TargeteNBID: &s1ap.TargeteNBID{GlobalENBID: targetGlobalENBID, SelectedTAI: s1ap.TAI{PLMNIdentity: plmn, TAC: 1}}}, + causeUnknownTargetID, + }, + "targetRNC-ID": { + s1ap.TargetID{TargetRNCID: &s1ap.TargetRNCID{LAI: s1ap.LAI{PLMNIdentity: plmn, LAC: 1}, RNCID: 12}}, + causeUnknownTargetID, + }, + "cGI": { + s1ap.TargetID{CGI: &s1ap.CGI{PLMNIdentity: plmn, LAC: 1, CI: 2}}, + causeUnknownTargetID, + }, + "unknown extension": { + s1ap.TargetID{Ext: &per.ExtensionAlternative{Index: 1, Value: "\x00"}}, + notComprehended, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + m := newTestMME(t) + ue, source, _ := handoverUE(t, m) + + req := sampleHandoverRequired(ue) + req.HandoverType = s1ap.HandoverTypeEPSToFiveGS + req.TargetID = tc.targetID + + handleHandoverRequired(context.Background(), m, mme.NewRadioForTest(source), initiatingValue(t, mustMarshal(t, req.Marshal))) + + fail := preparationFailureOn(t, source) + if fail.Cause == nil || !fail.Cause.Equal(tc.cause) { + t.Fatalf("cause = %+v, want %+v", fail.Cause, tc.cause) + } + }) + } +} diff --git a/internal/tester/enb/broadcast_plmn_test.go b/internal/tester/enb/broadcast_plmn_test.go index 2d7bf7eb2c..ee141ba4ab 100644 --- a/internal/tester/enb/broadcast_plmn_test.go +++ b/internal/tester/enb/broadcast_plmn_test.go @@ -49,12 +49,12 @@ func TestBuildInitialUEMessageCarriesSelectedPLMNInTAI(t *testing.T) { t.Fatalf("parse: %v", err) } - uli := msg.UserLocationInformation - if uli.Kind != ngap.UserLocationEUTRA || uli.TAI.PLMNIdentity != (ngap.PLMNIdentity{0x13, 0x00, 0x62}) { - t.Errorf("location = %+v, want an E-UTRA cell with TAI PLMN 310/260", uli) + uli := msg.UserLocationInformation.EUTRA + if uli == nil || uli.TAI.PLMNIdentity != (ngap.PLMNIdentity{0x13, 0x00, 0x62}) { + t.Fatalf("location = %+v, want an E-UTRA cell with TAI PLMN 310/260", msg.UserLocationInformation) } - if uli.PLMNIdentity != (ngap.PLMNIdentity{0x00, 0xf1, 0x10}) { - t.Errorf("E-UTRA CGI PLMN = % x, want the primary PLMN", uli.PLMNIdentity) + if uli.EUTRACGI.PLMNIdentity != (ngap.PLMNIdentity{0x00, 0xf1, 0x10}) { + t.Errorf("E-UTRA CGI PLMN = % x, want the primary PLMN", uli.EUTRACGI.PLMNIdentity) } } diff --git a/internal/tester/enb/build_initial_ue_message.go b/internal/tester/enb/build_initial_ue_message.go index aa6a5e9f33..f09bb83f84 100644 --- a/internal/tester/enb/build_initial_ue_message.go +++ b/internal/tester/enb/build_initial_ue_message.go @@ -101,8 +101,5 @@ func NgENBNodeID(mcc, mnc, enbID string) (ngap.GlobalRANNodeID, error) { return ngap.GlobalRANNodeID{}, fmt.Errorf("ng-eNB id %q is %d octets, too few for a %d-bit node id", enbID, len(b), ngENBIDBits) } - return ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDMacroNgENB, PLMNIdentity: plmn, - Value: uint32(v >> uint(8*len(b)-ngENBIDBits)), Bits: ngENBIDBits, - }, nil + return ngap.NewGlobalNgENBID(plmn, ngap.NgENBID{MacroNgENBID: new(ngap.MacroNgENBID(uint32(v >> uint(8*len(b)-ngENBIDBits))))}), nil } diff --git a/internal/tester/enb/build_ng_setup_request.go b/internal/tester/enb/build_ng_setup_request.go index 90aeb6055c..5920f207be 100644 --- a/internal/tester/enb/build_ng_setup_request.go +++ b/internal/tester/enb/build_ng_setup_request.go @@ -62,7 +62,9 @@ func BuildNGSetupRequest(opts *NGSetupRequestOpts) ([]byte, error) { return nil, err } - bplmns, err := gnb.BuildBroadcastPLMNList(node.PLMNIdentity, ngap.SliceSupportList{{SNSSAI: snssai}}, opts.AdditionalPLMNs) + nodePLMN, _ := node.PLMNIdentity() + + bplmns, err := gnb.BuildBroadcastPLMNList(nodePLMN, ngap.SliceSupportList{{SNSSAI: snssai}}, opts.AdditionalPLMNs) if err != nil { return nil, err } diff --git a/internal/tester/enb/build_roundtrip_test.go b/internal/tester/enb/build_roundtrip_test.go index 951a41738b..be79a62b51 100644 --- a/internal/tester/enb/build_roundtrip_test.go +++ b/internal/tester/enb/build_roundtrip_test.go @@ -49,8 +49,8 @@ func TestBuildNGSetupRequestRoundTrips(t *testing.T) { t.Fatalf("parse: %v", err) } - if msg.GlobalRANNodeID.Kind != ngap.RANNodeIDMacroNgENB { - t.Errorf("node kind = %d, want macro ng-eNB", msg.GlobalRANNodeID.Kind) + if n := msg.GlobalRANNodeID.GlobalNgENBID; n == nil || n.NgENBID.MacroNgENBID == nil { + t.Errorf("node = %+v, want a macro ng-eNB", msg.GlobalRANNodeID) } if msg.RANNodeName == nil || *msg.RANNodeName != "ella-ng-enb" { @@ -97,11 +97,12 @@ func TestBuildUplinkNasTransportRoundTrips(t *testing.T) { t.Errorf("NAS PDU = %x, want %x", msg.NASPDU, nas) } - uli := msg.UserLocationInformation - if uli == nil || uli.Kind != ngap.UserLocationEUTRA { - t.Fatalf("location = %+v, want an E-UTRA cell", uli) + if msg.UserLocationInformation == nil || msg.UserLocationInformation.EUTRA == nil { + t.Fatalf("location = %+v, want an E-UTRA cell", msg.UserLocationInformation) } + uli := msg.UserLocationInformation.EUTRA + if uli.TAI.TAC != 1 { t.Errorf("TAC = %d, want 1", uli.TAI.TAC) } diff --git a/internal/tester/enb/helpers.go b/internal/tester/enb/helpers.go index b6fdf3ccb5..acd03f4cd6 100644 --- a/internal/tester/enb/helpers.go +++ b/internal/tester/enb/helpers.go @@ -29,12 +29,7 @@ func ngENBNodeID(mcc, mnc, enbID string) (ngap.GlobalRANNodeID, error) { v = v<<8 | uint64(o) } - return ngap.GlobalRANNodeID{ - Kind: ngap.RANNodeIDMacroNgENB, - PLMNIdentity: plmn, - Value: uint32(v >> uint(8*len(b)-ngENBIDBits)), - Bits: ngENBIDBits, - }, nil + return ngap.NewGlobalNgENBID(plmn, ngap.NgENBID{MacroNgENBID: new(ngap.MacroNgENBID(uint32(v >> uint(8*len(b)-ngENBIDBits))))}), nil } // userLocation builds the User Location Information this simulator reports: the @@ -72,10 +67,5 @@ func userLocation(mcc, mnc, selMcc, selMnc, enbID, tac string) (ngap.UserLocatio return ngap.UserLocationInformation{}, fmt.Errorf("could not build E-UTRA cell identity: %w", err) } - return ngap.UserLocationInformation{ - Kind: ngap.UserLocationEUTRA, - PLMNIdentity: plmn, - CellIdentity: cellID, - TAI: ngap.TAI{PLMNIdentity: selected, TAC: tacValue}, - }, nil + return ngap.UserLocationInformation{EUTRA: &ngap.UserLocationInformationEUTRA{EUTRACGI: ngap.EUTRACGI{PLMNIdentity: plmn, EUTRACellIdentity: ngap.EUTRACellIdentity(cellID)}, TAI: ngap.TAI{PLMNIdentity: selected, TAC: tacValue}}}, nil } diff --git a/internal/tester/gnb/broadcast_plmn.go b/internal/tester/gnb/broadcast_plmn.go index 642a05af5d..2f94eaa120 100644 --- a/internal/tester/gnb/broadcast_plmn.go +++ b/internal/tester/gnb/broadcast_plmn.go @@ -122,3 +122,9 @@ func (g *GnodeB) dropSelectedPLMN(ranUENGAPID int64) { delete(g.selectedPLMNs, ranUENGAPID) } + +func (g *GnodeB) InheritSelectedPLMN(ranUENGAPID int64, source *GnodeB, sourceRANUENGAPID int64) error { + mcc, mnc := source.SelectedPLMN(sourceRANUENGAPID) + + return g.SelectPLMN(ranUENGAPID, mcc, mnc) +} diff --git a/internal/tester/gnb/handover_selected_plmn_test.go b/internal/tester/gnb/handover_selected_plmn_test.go new file mode 100644 index 0000000000..835d46ca38 --- /dev/null +++ b/internal/tester/gnb/handover_selected_plmn_test.go @@ -0,0 +1,146 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package gnb + +import ( + "net/netip" + "testing" + + "github.com/ellanetworks/core/ngap" +) + +var ( + hoHomePLMN = ngap.PLMNIdentity{0x00, 0xf1, 0x10} + hoOtherPLMN = ngap.PLMNIdentity{0x13, 0x00, 0x62} +) + +func multiPLMNGnodeB(gnbID, mcc, mnc string, additional ...BroadcastPLMN) *GnodeB { + return &GnodeB{GnbID: gnbID, MCC: mcc, MNC: mnc, TAC: "000001", AdditionalPLMNs: additional} +} + +func handoverNotifyTAIPLMN(t *testing.T, g *GnodeB, ranUENGAPID int64) (tai, cgi ngap.PLMNIdentity) { + t.Helper() + + pdu, err := g.handoverNotifyPDU(&HandoverNotifyOpts{AMFUENGAPID: 9, RANUENGAPID: ranUENGAPID}) + if err != nil { + t.Fatalf("build Handover Notify: %v", err) + } + + msg, err := ngap.Unmarshal(pdu) + if err != nil { + t.Fatalf("unmarshal: %v", err) + } + + im, ok := msg.(*ngap.InitiatingMessage) + if !ok || im.ProcedureCode != ngap.ProcHandoverNotification { + t.Fatalf("got %T, want a Handover Notify", msg) + } + + notify, err := ngap.ParseHandoverNotify(im.Value) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if notify.UserLocationInformation == nil || notify.UserLocationInformation.NR == nil { + t.Fatalf("location = %+v, want NR", notify.UserLocationInformation) + } + + nr := notify.UserLocationInformation.NR + + return nr.TAI.PLMNIdentity, nr.NRCGI.PLMNIdentity +} + +func pathSwitchRequestTAIPLMN(t *testing.T, g *GnodeB, ranUENGAPID int64) (tai, cgi ngap.PLMNIdentity) { + t.Helper() + + pdu, err := g.pathSwitchRequestPDU(&PathSwitchRequestOpts{ + RANUENGAPID: ranUENGAPID, SourceAMFUENGAPID: 9, N3GnbIp: netip.MustParseAddr("10.0.0.2"), + PDUSessions: [16]*PDUSessionInformation{{PDUSessionID: 1, DLTEID: 0x10}}, + }) + if err != nil { + t.Fatalf("build Path Switch Request: %v", err) + } + + msg, err := ngap.Unmarshal(pdu) + if err != nil { + t.Fatalf("unmarshal: %v", err) + } + + im, ok := msg.(*ngap.InitiatingMessage) + if !ok || im.ProcedureCode != ngap.ProcPathSwitchRequest { + t.Fatalf("got %T, want a Path Switch Request", msg) + } + + req, err := ngap.ParsePathSwitchRequest(im.Value) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if req.UserLocationInformation == nil || req.UserLocationInformation.NR == nil { + t.Fatalf("location = %+v, want NR", req.UserLocationInformation) + } + + nr := req.UserLocationInformation.NR + + return nr.TAI.PLMNIdentity, nr.NRCGI.PLMNIdentity +} + +func TestHandoverTargetReportsTheSelectedPLMN(t *testing.T) { + source := multiPLMNGnodeB("000102", "001", "01", BroadcastPLMN{Mcc: "310", Mnc: "260"}) + target := multiPLMNGnodeB("000103", "001", "01", BroadcastPLMN{Mcc: "310", Mnc: "260"}) + + if err := source.SelectPLMN(1, "310", "260"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + if err := target.InheritSelectedPLMN(7, source, 1); err != nil { + t.Fatalf("InheritSelectedPLMN: %v", err) + } + + if tai, cgi := handoverNotifyTAIPLMN(t, target, 7); tai != hoOtherPLMN || cgi != hoHomePLMN { + t.Errorf("Handover Notify TAI PLMN = % x, NR CGI PLMN = % x; want the selected 310/260 and the primary 001/01", tai, cgi) + } + + if tai, cgi := pathSwitchRequestTAIPLMN(t, target, 7); tai != hoOtherPLMN || cgi != hoHomePLMN { + t.Errorf("Path Switch Request TAI PLMN = % x, NR CGI PLMN = % x; want the selected 310/260 and the primary 001/01", tai, cgi) + } + + if tai, _ := handoverNotifyTAIPLMN(t, target, 8); tai != hoHomePLMN { + t.Errorf("another UE TAI PLMN = % x, want the primary 001/01", tai) + } +} + +func TestHandoverTargetKeepsTheSourcePrimaryPLMN(t *testing.T) { + source := multiPLMNGnodeB("000102", "310", "260") + target := multiPLMNGnodeB("000103", "001", "01", BroadcastPLMN{Mcc: "310", Mnc: "260"}) + + if err := target.InheritSelectedPLMN(7, source, 1); err != nil { + t.Fatalf("InheritSelectedPLMN: %v", err) + } + + if tai, _ := handoverNotifyTAIPLMN(t, target, 7); tai != hoOtherPLMN { + t.Errorf("Handover Notify TAI PLMN = % x, want the source's 310/260", tai) + } + + if tai, _ := pathSwitchRequestTAIPLMN(t, target, 7); tai != hoOtherPLMN { + t.Errorf("Path Switch Request TAI PLMN = % x, want the source's 310/260", tai) + } +} + +func TestInheritSelectedPLMNRefusesAPLMNTheTargetDoesNotBroadcast(t *testing.T) { + source := multiPLMNGnodeB("000102", "001", "01", BroadcastPLMN{Mcc: "310", Mnc: "014"}) + target := multiPLMNGnodeB("000103", "001", "01", BroadcastPLMN{Mcc: "310", Mnc: "260"}) + + if err := source.SelectPLMN(1, "310", "014"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + if err := target.InheritSelectedPLMN(7, source, 1); err == nil { + t.Fatal("InheritSelectedPLMN accepted a PLMN the target does not broadcast") + } + + if tai, _ := handoverNotifyTAIPLMN(t, target, 7); tai != hoHomePLMN { + t.Errorf("Handover Notify TAI PLMN = % x, want the target's primary 001/01", tai) + } +} diff --git a/internal/tester/gnb/send.go b/internal/tester/gnb/send.go index e2a88cac90..c92d697b70 100644 --- a/internal/tester/gnb/send.go +++ b/internal/tester/gnb/send.go @@ -175,7 +175,7 @@ func (g *GnodeB) SendPDUSessionResourceReleaseResponse(opts *PDUSessionResourceR return g.SendMessage(pdu, NGAPProcedurePDUSessionResourceReleaseResponse) } -func (g *GnodeB) SendPathSwitchRequest(opts *PathSwitchRequestOpts) error { +func (g *GnodeB) pathSwitchRequestPDU(opts *PathSwitchRequestOpts) ([]byte, error) { opts.Mcc = g.MCC opts.Mnc = g.MNC opts.Tac = g.TAC @@ -185,7 +185,11 @@ func (g *GnodeB) SendPathSwitchRequest(opts *PathSwitchRequestOpts) error { opts.SelectedMcc, opts.SelectedMnc = g.explicitPLMN(opts.RANUENGAPID) } - pdu, err := BuildPathSwitchRequest(opts) + return BuildPathSwitchRequest(opts) +} + +func (g *GnodeB) SendPathSwitchRequest(opts *PathSwitchRequestOpts) error { + pdu, err := g.pathSwitchRequestPDU(opts) if err != nil { return fmt.Errorf("couldn't build PathSwitchRequest: %s", err.Error()) } @@ -338,7 +342,7 @@ func (g *GnodeB) SendHandoverRequestAcknowledge(opts *HandoverRequestAcknowledge return nil } -func (g *GnodeB) SendHandoverNotify(opts *HandoverNotifyOpts) error { +func (g *GnodeB) handoverNotifyPDU(opts *HandoverNotifyOpts) ([]byte, error) { opts.Mcc = firstNonEmpty(opts.Mcc, g.MCC) opts.Mnc = firstNonEmpty(opts.Mnc, g.MNC) opts.Tac = firstNonEmpty(opts.Tac, g.TAC) @@ -348,7 +352,11 @@ func (g *GnodeB) SendHandoverNotify(opts *HandoverNotifyOpts) error { opts.SelectedMcc, opts.SelectedMnc = g.explicitPLMN(opts.RANUENGAPID) } - pdu, err := BuildHandoverNotify(opts) + return BuildHandoverNotify(opts) +} + +func (g *GnodeB) SendHandoverNotify(opts *HandoverNotifyOpts) error { + pdu, err := g.handoverNotifyPDU(opts) if err != nil { return fmt.Errorf("couldn't build HandoverNotify: %s", err.Error()) } diff --git a/internal/tester/s1enb/broadcast_plmn.go b/internal/tester/s1enb/broadcast_plmn.go index a9182f08a7..bf708b1ea0 100644 --- a/internal/tester/s1enb/broadcast_plmn.go +++ b/internal/tester/s1enb/broadcast_plmn.go @@ -50,12 +50,25 @@ func (ue *UE) SelectPLMN(mcc, mnc string) error { return nil } +func (ue *UE) servingPLMN() (s1ap.PLMNIdentity, bool) { + switch { + case ue == nil: + return s1ap.PLMNIdentity{}, false + case ue.selectedPLMN != nil: + return *ue.selectedPLMN, true + case ue.enb != nil: + return ue.enb.plmn, true + default: + return s1ap.PLMNIdentity{}, false + } +} + func (e *ENB) AllocateENBUEIDFor(ue *UE) int64 { id := e.AllocateENBUEID() - if ue != nil && ue.selectedPLMN != nil { + if plmn, ok := ue.servingPLMN(); ok && slices.Contains(e.bplmns, plmn) { e.mu.Lock() - e.selected[id] = *ue.selectedPLMN + e.selected[id] = plmn e.mu.Unlock() } diff --git a/internal/tester/s1enb/handover.go b/internal/tester/s1enb/handover.go index 770b7eeca4..410da6d96b 100644 --- a/internal/tester/s1enb/handover.go +++ b/internal/tester/s1enb/handover.go @@ -177,7 +177,7 @@ func (e *ENB) WaitForMMEStatusTransfer(enbUEID int64, timeout time.Duration) (*s return mst, nil } -func (e *ENB) SendHandoverNotify(enbUEID, mmeUEID int64) error { +func (e *ENB) buildHandoverNotify(enbUEID, mmeUEID int64) ([]byte, error) { notify := &s1ap.HandoverNotify{ MMEUES1APID: s1ap.MMEUES1APID(mmeUEID), ENBUES1APID: s1ap.ENBUES1APID(enbUEID), @@ -185,7 +185,11 @@ func (e *ENB) SendHandoverNotify(enbUEID, mmeUEID int64) error { TAI: s1ap.Ptr(e.taiFor(enbUEID)), } - b, err := notify.Marshal() + return notify.Marshal() +} + +func (e *ENB) SendHandoverNotify(enbUEID, mmeUEID int64) error { + b, err := e.buildHandoverNotify(enbUEID, mmeUEID) if err != nil { return fmt.Errorf("s1enb: build Handover Notify: %w", err) } diff --git a/internal/tester/s1enb/handover_selected_plmn_test.go b/internal/tester/s1enb/handover_selected_plmn_test.go new file mode 100644 index 0000000000..a9818b7ce2 --- /dev/null +++ b/internal/tester/s1enb/handover_selected_plmn_test.go @@ -0,0 +1,117 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1enb + +import ( + "net" + "testing" + + "github.com/ellanetworks/core/nas" + "github.com/ellanetworks/core/s1ap" +) + +func handoverENB(t *testing.T, enbID uint32, primary s1ap.PLMNIdentity, additional ...nas.PLMN) *ENB { + t.Helper() + + bplmns, err := broadcastPLMNs(primary, additional) + if err != nil { + t.Fatalf("broadcastPLMNs: %v", err) + } + + return &ENB{ + enbID: enbID, enbIDKind: ENBIDMacro, name: "ella", plmn: primary, bplmns: bplmns, tac: 1, + selected: make(map[int64]s1ap.PLMNIdentity), nextENBUEID: 1, n3Addr: net.IPv4(10, 0, 0, 2).To4(), + } +} + +func handoverNotifyPLMNs(t *testing.T, e *ENB, enbUEID int64) (tai, cgi s1ap.PLMNIdentity) { + t.Helper() + + b, err := e.buildHandoverNotify(enbUEID, 9) + if err != nil { + t.Fatalf("build Handover Notify: %v", err) + } + + msg, err := s1ap.ParseHandoverNotify(initiatingValue(t, b, s1ap.ProcHandoverNotification)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if msg.TAI == nil || msg.EUTRANCGI == nil { + t.Fatalf("Handover Notify = %+v, want a TAI and an E-UTRAN CGI", msg) + } + + return msg.TAI.PLMNIdentity, msg.EUTRANCGI.PLMNIdentity +} + +func pathSwitchRequestPLMNs(t *testing.T, e *ENB, enbUEID int64) (tai, cgi s1ap.PLMNIdentity) { + t.Helper() + + b, err := e.buildPathSwitchRequest(enbUEID, 9, 5, 0x10, s1ap.UESecurityCapabilities{}) + if err != nil { + t.Fatalf("build Path Switch Request: %v", err) + } + + msg, err := s1ap.ParsePathSwitchRequest(initiatingValue(t, b, s1ap.ProcPathSwitchRequest)) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if msg.TAI == nil || msg.EUTRANCGI == nil { + t.Fatalf("Path Switch Request = %+v, want a TAI and an E-UTRAN CGI", msg) + } + + return msg.TAI.PLMNIdentity, msg.EUTRANCGI.PLMNIdentity +} + +func TestHandoverTargetReportsTheSelectedPLMN(t *testing.T) { + source := handoverENB(t, 0x19b, testHomePLMN, nas.PLMN{MCC: "310", MNC: "260"}) + target := handoverENB(t, 0x19c, testHomePLMN, nas.PLMN{MCC: "310", MNC: "260"}) + + ue := source.NewUE("310260000000001", [16]byte{}, [16]byte{}) + if err := ue.SelectPLMN("310", "260"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + id := target.AllocateENBUEIDFor(ue) + + if tai, cgi := handoverNotifyPLMNs(t, target, id); tai != testOtherPLMN || cgi != testHomePLMN { + t.Errorf("Handover Notify TAI PLMN = % x, E-UTRAN CGI PLMN = % x; want the selected 310/260 and the primary 001/01", tai, cgi) + } + + if tai, cgi := pathSwitchRequestPLMNs(t, target, id); tai != testOtherPLMN || cgi != testHomePLMN { + t.Errorf("Path Switch Request TAI PLMN = % x, E-UTRAN CGI PLMN = % x; want the selected 310/260 and the primary 001/01", tai, cgi) + } +} + +func TestHandoverTargetKeepsTheSourcePrimaryPLMN(t *testing.T) { + source := handoverENB(t, 0x19b, testOtherPLMN) + target := handoverENB(t, 0x19c, testHomePLMN, nas.PLMN{MCC: "310", MNC: "260"}) + + id := target.AllocateENBUEIDFor(source.NewUE("310260000000001", [16]byte{}, [16]byte{})) + + if tai, _ := handoverNotifyPLMNs(t, target, id); tai != testOtherPLMN { + t.Errorf("Handover Notify TAI PLMN = % x, want the source's 310/260", tai) + } + + if tai, _ := pathSwitchRequestPLMNs(t, target, id); tai != testOtherPLMN { + t.Errorf("Path Switch Request TAI PLMN = % x, want the source's 310/260", tai) + } +} + +func TestHandoverTargetNeverReportsAPLMNItDoesNotBroadcast(t *testing.T) { + source := handoverENB(t, 0x19b, testHomePLMN, nas.PLMN{MCC: "310", MNC: "014"}) + target := handoverENB(t, 0x19c, testHomePLMN, nas.PLMN{MCC: "310", MNC: "260"}) + + ue := source.NewUE("310014000000001", [16]byte{}, [16]byte{}) + if err := ue.SelectPLMN("310", "014"); err != nil { + t.Fatalf("SelectPLMN: %v", err) + } + + id := target.AllocateENBUEIDFor(ue) + + if tai, _ := handoverNotifyPLMNs(t, target, id); tai != testHomePLMN { + t.Errorf("Handover Notify TAI PLMN = % x, want the target's primary 001/01", tai) + } +} diff --git a/internal/tester/s1enb/s1ap.go b/internal/tester/s1enb/s1ap.go index 1743a67e50..a21d1b6419 100644 --- a/internal/tester/s1enb/s1ap.go +++ b/internal/tester/s1enb/s1ap.go @@ -242,15 +242,26 @@ func (e *ENB) SendUplinkNASTransport(mmeUEID, enbUEID int64, nas []byte) error { // eNB's S1-U endpoint. It returns the eNB downlink TEID it reported, so the caller // can build the target GTP tunnel. func (e *ENB) SendPathSwitchRequest(enbUEID, sourceMMEUEID int64, erabID s1ap.ERABID, caps s1ap.UESecurityCapabilities) (dlTEID uint32, err error) { - addr := e.n3TransportLayerAddress() - dlTEID = e.allocTEID() + b, err := e.buildPathSwitchRequest(enbUEID, sourceMMEUEID, erabID, dlTEID, caps) + if err != nil { + return 0, fmt.Errorf("s1enb: build Path Switch Request: %w", err) + } + + if err := e.SendMessage(b, true); err != nil { + return 0, err + } + + return dlTEID, nil +} + +func (e *ENB) buildPathSwitchRequest(enbUEID, sourceMMEUEID int64, erabID s1ap.ERABID, dlTEID uint32, caps s1ap.UESecurityCapabilities) ([]byte, error) { req := &s1ap.PathSwitchRequest{ ENBUES1APID: s1ap.ENBUES1APID(enbUEID), ERABToBeSwitchedDL: []s1ap.ERABToBeSwitchedDLItem{{ ERABID: erabID, - TransportLayerAddress: addr, + TransportLayerAddress: e.n3TransportLayerAddress(), GTPTEID: s1ap.GTPTEID(dlTEID), }}, SourceMMEUES1APID: s1ap.MMEUES1APID(sourceMMEUEID), @@ -259,16 +270,7 @@ func (e *ENB) SendPathSwitchRequest(enbUEID, sourceMMEUEID int64, erabID s1ap.ER UESecurityCapabilities: s1ap.Ptr(caps), } - b, err := req.Marshal() - if err != nil { - return 0, fmt.Errorf("s1enb: build Path Switch Request: %w", err) - } - - if err := e.SendMessage(b, true); err != nil { - return 0, err - } - - return dlTEID, nil + return req.Marshal() } // CauseUserInactivity is the S1AP radioNetwork cause an eNB uses to request a UE diff --git a/internal/tester/scenarios/gnb/ims_calls.go b/internal/tester/scenarios/gnb/ims_calls.go index 40ab225ac1..be5ab11735 100644 --- a/internal/tester/scenarios/gnb/ims_calls.go +++ b/internal/tester/scenarios/gnb/ims_calls.go @@ -481,6 +481,8 @@ func sourceFiveQIs(l voiceLeg, qfi uint8) map[uint8]int64 { func xnHandOverVoiceUE(target *gnb.GnodeB, n3 netip.Addr, u imsCallUE, qfi uint8) (voiceLeg, error) { ack, err := xnPathSwitch(target, &xnPathSwitchOpts{ + Source: u.leg.gnb, + SourceRANUENGAPID: u.leg.ranUEID, SourceAMFUENGAPID: u.leg.gnb.GetAMFUENGAPID(u.leg.ranUEID), TargetRANUENGAPID: imsHandoverTargetRANID, TargetN3IP: n3, @@ -558,6 +560,10 @@ func n2HandOverVoiceUE(target *gnb.GnodeB, n3 netip.Addr, u imsCallUE, qfi uint8 return voiceLeg{}, fmt.Errorf("extract AMF UE NGAP ID from Handover Request: %w", err) } + if err := target.InheritSelectedPLMN(imsHandoverTargetRANID, source, u.leg.ranUEID); err != nil { + return voiceLeg{}, fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + if err := target.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: targetAMFUEID, RANUENGAPID: imsHandoverTargetRANID, diff --git a/internal/tester/scenarios/gnb/n2_handover.go b/internal/tester/scenarios/gnb/n2_handover.go index 6e036ff966..0f25826339 100644 --- a/internal/tester/scenarios/gnb/n2_handover.go +++ b/internal/tester/scenarios/gnb/n2_handover.go @@ -256,6 +256,10 @@ func runN2Handover(_ context.Context, env scenarios.Env, _ any) error { targetDLTEID := uint32(9000) targetForwardingTEID := targetGNB.AllocateForwardingTEID() + if err := targetGNB.InheritSelectedPLMN(targetRanUENGAPID, sourceGNB, ranUENGAPID); err != nil { + return fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + err = targetGNB.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: targetAmfUENGAPID, RANUENGAPID: targetRanUENGAPID, diff --git a/internal/tester/scenarios/gnb/n2_handover_connectivity.go b/internal/tester/scenarios/gnb/n2_handover_connectivity.go index 2f6eaff085..5406620878 100644 --- a/internal/tester/scenarios/gnb/n2_handover_connectivity.go +++ b/internal/tester/scenarios/gnb/n2_handover_connectivity.go @@ -184,6 +184,10 @@ func runN2HandoverConnectivity(_ context.Context, env scenarios.Env, _ any) erro targetN3IP := netip.MustParseAddr(targetGNBSpec.N3Address) targetDLTEID := uint32(9000) + if err := targetGNB.InheritSelectedPLMN(targetRanUENGAPID, sourceGNB, ranUENGAPID); err != nil { + return fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + err = targetGNB.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: targetAmfUENGAPID, RANUENGAPID: targetRanUENGAPID, diff --git a/internal/tester/scenarios/gnb/n2_handover_failure.go b/internal/tester/scenarios/gnb/n2_handover_failure.go index 6988b707f8..f639c4135c 100644 --- a/internal/tester/scenarios/gnb/n2_handover_failure.go +++ b/internal/tester/scenarios/gnb/n2_handover_failure.go @@ -183,6 +183,10 @@ func runN2HandoverCancel(_ context.Context, env scenarios.Env, _ any) error { targetRanUENGAPID := int64(300) + if err := pair.Target.InheritSelectedPLMN(targetRanUENGAPID, pair.Source, pair.RANUENGAPID); err != nil { + return fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + if err := pair.Target.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: int64(req.AMFUENGAPID), RANUENGAPID: targetRanUENGAPID, diff --git a/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go b/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go index 00335962f7..8180e253fb 100644 --- a/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go +++ b/internal/tester/scenarios/gnb/n2_handover_indirect_forwarding.go @@ -115,6 +115,10 @@ func runN2HandoverIndirectForwarding(_ context.Context, env scenarios.Env, _ any targetGNB.WatchTEID(targetForwardingTEID) + if err := targetGNB.InheritSelectedPLMN(int64(100), sourceGNB, ranUENGAPID); err != nil { + return fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + err = targetGNB.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: targetAmfUENGAPID, RANUENGAPID: int64(100), diff --git a/internal/tester/scenarios/gnb/n2_handover_partial_admission.go b/internal/tester/scenarios/gnb/n2_handover_partial_admission.go index 38dd7769ee..e3845eafe7 100644 --- a/internal/tester/scenarios/gnb/n2_handover_partial_admission.go +++ b/internal/tester/scenarios/gnb/n2_handover_partial_admission.go @@ -135,6 +135,10 @@ func runN2HandoverPartialAdmission(_ context.Context, env scenarios.Env, _ any) refusal := ngaplib.CauseRadioNetworkRadioResourcesNotAvailable.Cause() + if err := targetGNB.InheritSelectedPLMN(partialTargetRANID, sourceGNB, ranUENGAPID); err != nil { + return fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + if err := targetGNB.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: int64(req.AMFUENGAPID), RANUENGAPID: partialTargetRANID, diff --git a/internal/tester/scenarios/gnb/n2_handover_ping_pong.go b/internal/tester/scenarios/gnb/n2_handover_ping_pong.go index 7a21b1b0ec..e53ea97f28 100644 --- a/internal/tester/scenarios/gnb/n2_handover_ping_pong.go +++ b/internal/tester/scenarios/gnb/n2_handover_ping_pong.go @@ -224,6 +224,10 @@ func n2PrepareHandoverLeg(opts *n2LegOpts) (n2LegEndpoints, error) { opts.Target.WatchTEID(forwardingTEID) + if err := opts.Target.InheritSelectedPLMN(opts.NewRANUENGAPID, opts.Source, opts.RANUENGAPID); err != nil { + return n2LegEndpoints{}, fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + err = opts.Target.SendHandoverRequestAcknowledge(&gnb.HandoverRequestAcknowledgeOpts{ AMFUENGAPID: targetAMFUENGAPID, RANUENGAPID: opts.NewRANUENGAPID, diff --git a/internal/tester/scenarios/gnb/xn_handover_connectivity.go b/internal/tester/scenarios/gnb/xn_handover_connectivity.go index 52ac92bf67..db58ed7f93 100644 --- a/internal/tester/scenarios/gnb/xn_handover_connectivity.go +++ b/internal/tester/scenarios/gnb/xn_handover_connectivity.go @@ -128,6 +128,8 @@ func runXnHandoverConnectivity(ctx context.Context, env scenarios.Env, _ any) er } if _, err := xnPathSwitch(targetGNB, &xnPathSwitchOpts{ + Source: sourceGNB, + SourceRANUENGAPID: ranUENGAPID, SourceAMFUENGAPID: sourceAmfUENGAPID, TargetRANUENGAPID: xnHandoverConnRANID, TargetN3IP: targetN3IP, diff --git a/internal/tester/scenarios/gnb/xn_path_switch.go b/internal/tester/scenarios/gnb/xn_path_switch.go index 5550bdf846..401cf64c61 100644 --- a/internal/tester/scenarios/gnb/xn_path_switch.go +++ b/internal/tester/scenarios/gnb/xn_path_switch.go @@ -74,6 +74,8 @@ func runXnPathSwitch(_ context.Context, env scenarios.Env, _ any) error { } ack, err := xnPathSwitch(targetGNB, &xnPathSwitchOpts{ + Source: sourceGNB, + SourceRANUENGAPID: ranUENGAPID, SourceAMFUENGAPID: sourceAmfUENGAPID, TargetRANUENGAPID: xnPathSwitchTargetRANID, TargetN3IP: targetN3IP, @@ -134,6 +136,8 @@ func startXnTargetGNB(env scenarios.Env, n2Address, n3Address string) (*gnb.Gnod } type xnPathSwitchOpts struct { + Source *gnb.GnodeB + SourceRANUENGAPID int64 SourceAMFUENGAPID int64 TargetRANUENGAPID int64 TargetN3IP netip.Addr @@ -145,6 +149,10 @@ type xnPathSwitchOpts struct { } func xnPathSwitch(targetGNB *gnb.GnodeB, opts *xnPathSwitchOpts) (*ngaplib.PathSwitchRequestAcknowledge, error) { + if err := targetGNB.InheritSelectedPLMN(opts.TargetRANUENGAPID, opts.Source, opts.SourceRANUENGAPID); err != nil { + return nil, fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + var sessions [16]*gnb.PDUSessionInformation id := opts.PDUSessionID diff --git a/internal/tester/scenarios/gnb/xn_path_switch_failure.go b/internal/tester/scenarios/gnb/xn_path_switch_failure.go index ed3b3b43ce..4dca4b2b98 100644 --- a/internal/tester/scenarios/gnb/xn_path_switch_failure.go +++ b/internal/tester/scenarios/gnb/xn_path_switch_failure.go @@ -80,6 +80,10 @@ func runXnPathSwitchFailure(_ context.Context, env scenarios.Env, _ any) error { DLTEID: xnFailureTEID, } + if err := targetGNB.InheritSelectedPLMN(xnFailureRANID, sourceGNB, ranUENGAPID); err != nil { + return fmt.Errorf("carry the selected PLMN to the target gNB: %w", err) + } + if err := targetGNB.SendPathSwitchRequest(&gnb.PathSwitchRequestOpts{ RANUENGAPID: xnFailureRANID, SourceAMFUENGAPID: unknownAMFUENGAPID, diff --git a/internal/tester/scenarios/s1enb/ims_registration.go b/internal/tester/scenarios/s1enb/ims_registration.go index f8591d5f4e..e876ed112e 100644 --- a/internal/tester/scenarios/s1enb/ims_registration.go +++ b/internal/tester/scenarios/s1enb/ims_registration.go @@ -1114,7 +1114,7 @@ func handOverVoiceUE(source, target *s1enb.ENB, u imsCallUE, voice *s1enb.Dedica return handedOver{}, fmt.Errorf("voice E-RAB QoS %+v in the Handover Request, want QCI 1 with GBR QoS Information (TS 36.413 §8.4.2.4)", qos) } - out := handedOver{enbUEID: target.AllocateENBUEID(), mmeUEID: int64(req.MMEUES1APID)} + out := handedOver{enbUEID: target.AllocateENBUEIDFor(u.ue), mmeUEID: int64(req.MMEUES1APID)} teids, err := target.SendHandoverRequestAcknowledgePartial(out.enbUEID, out.mmeUEID, erabs, nil, s1ap.Cause{}) if err != nil { diff --git a/internal/tester/scenarios/s1enb/s1_handover.go b/internal/tester/scenarios/s1enb/s1_handover.go index 2818a38024..547598865d 100644 --- a/internal/tester/scenarios/s1enb/s1_handover.go +++ b/internal/tester/scenarios/s1enb/s1_handover.go @@ -129,7 +129,7 @@ func runS1ENBHandover(ctx context.Context, env scenarios.Env, _ any) error { // — on the acknowledge and notify. targetMMEUEID := int64(hoReq.MMEUES1APID) - targetENBUEID := target.AllocateENBUEID() + targetENBUEID := target.AllocateENBUEIDFor(ue) if hoReq.ERABToBeSetup[0].DataForwardingNotPossible != nil { return fmt.Errorf("handover request declared data forwarding not possible despite a direct forwarding path") diff --git a/internal/tester/scenarios/s1enb/s1_handover_failure.go b/internal/tester/scenarios/s1enb/s1_handover_failure.go index a9abdb1c01..064c74c30e 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_failure.go +++ b/internal/tester/scenarios/s1enb/s1_handover_failure.go @@ -171,7 +171,7 @@ func runS1HandoverCancel(_ context.Context, env scenarios.Env, _ any) error { return err } - targetENBUEID := pair.Target.AllocateENBUEID() + targetENBUEID := pair.Target.AllocateENBUEIDFor(pair.UE) if _, _, err := pair.Target.SendHandoverRequestAcknowledge(targetENBUEID, int64(req.MMEUES1APID), pair.Attached.ERABID, false); err != nil { return fmt.Errorf("admit the handover at the target eNB: %w", err) diff --git a/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go b/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go index 4a3af36dc0..db3ac75ec1 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go +++ b/internal/tester/scenarios/s1enb/s1_handover_indirect_forwarding.go @@ -107,7 +107,7 @@ func runS1HandoverIndirectForwarding(_ context.Context, env scenarios.Env, _ any } targetMMEUEID := int64(hoReq.MMEUES1APID) - targetENBUEID := target.AllocateENBUEID() + targetENBUEID := target.AllocateENBUEIDFor(ue) _, targetForwardingTEID, err := target.SendHandoverRequestAcknowledge(targetENBUEID, targetMMEUEID, res.ERABID, true) if err != nil { diff --git a/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go b/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go index 43855805cb..452c709207 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go +++ b/internal/tester/scenarios/s1enb/s1_handover_partial_admission.go @@ -81,7 +81,7 @@ func runS1HandoverPartialAdmission(_ context.Context, env scenarios.Env, _ any) return fmt.Errorf("the Handover Request carried %d E-RABs, want both bearers", len(req.ERABToBeSetup)) } - targetENBUEID := pair.Target.AllocateENBUEID() + targetENBUEID := pair.Target.AllocateENBUEIDFor(pair.UE) refusal := s1ap.CauseRadioNetworkRadioResourcesNotAvailable.Cause() if _, err := pair.Target.SendHandoverRequestAcknowledgePartial(targetENBUEID, int64(req.MMEUES1APID), diff --git a/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go b/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go index 3274652168..c45353793c 100644 --- a/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go +++ b/internal/tester/scenarios/s1enb/s1_handover_ping_pong.go @@ -97,7 +97,7 @@ func runS1HandoverPingPong(_ context.Context, env scenarios.Env, _ any) error { return fmt.Errorf("attach on eNB A: %w", err) } - outbound, err := s1PrepareHandoverLeg(first, second, res.ENBUES1APID, res.MMEUES1APID, res.ERABID, res.UpfAddress) + outbound, err := s1PrepareHandoverLeg(first, second, ue, res.ENBUES1APID, res.MMEUES1APID, res.ERABID, res.UpfAddress) if err != nil { return fmt.Errorf("first leg A to B: %w", err) } @@ -121,7 +121,7 @@ func runS1HandoverPingPong(_ context.Context, env scenarios.Env, _ any) error { return fmt.Errorf("first leg send source UE Context Release Complete: %w", err) } - inbound, err := s1PrepareHandoverLeg(second, first, outbound.TargetENBUEID, outbound.TargetMMEUEID, res.ERABID, res.UpfAddress) + inbound, err := s1PrepareHandoverLeg(second, first, ue, outbound.TargetENBUEID, outbound.TargetMMEUEID, res.ERABID, res.UpfAddress) if err != nil { return fmt.Errorf("second leg B to A: %w", err) } @@ -173,7 +173,7 @@ func runS1HandoverPingPong(_ context.Context, env scenarios.Env, _ any) error { return scenarios.AwaitForwardingTunnelReleased(inboundProbe) } -func s1PrepareHandoverLeg(source, target *s1enb.ENB, sourceENBUEID, sourceMMEUEID int64, erabID s1ap.ERABID, upfAddress string) (s1LegEndpoints, error) { +func s1PrepareHandoverLeg(source, target *s1enb.ENB, ue *s1enb.UE, sourceENBUEID, sourceMMEUEID int64, erabID s1ap.ERABID, upfAddress string) (s1LegEndpoints, error) { if err := source.SendHandoverRequired(sourceENBUEID, sourceMMEUEID, target.GlobalENBID(), false); err != nil { return s1LegEndpoints{}, fmt.Errorf("send Handover Required: %w", err) } @@ -196,7 +196,7 @@ func s1PrepareHandoverLeg(source, target *s1enb.ENB, sourceENBUEID, sourceMMEUEI } targetMMEUEID := int64(hoReq.MMEUES1APID) - targetENBUEID := target.AllocateENBUEID() + targetENBUEID := target.AllocateENBUEIDFor(ue) _, targetFwdTEID, err := target.SendHandoverRequestAcknowledge(targetENBUEID, targetMMEUEID, erabID, true) if err != nil { diff --git a/internal/tester/scenarios/s1enb/x2_handover_connectivity.go b/internal/tester/scenarios/s1enb/x2_handover_connectivity.go index 746b455136..13e29866d5 100644 --- a/internal/tester/scenarios/s1enb/x2_handover_connectivity.go +++ b/internal/tester/scenarios/s1enb/x2_handover_connectivity.go @@ -108,7 +108,7 @@ func runS1ENBX2HandoverConnectivity(ctx context.Context, env scenarios.Env, _ an return fmt.Errorf("ping before handover via source eNB: %w", err) } - targetENBUEID := target.AllocateENBUEID() + targetENBUEID := target.AllocateENBUEIDFor(ue) dlTEID, err := target.SendPathSwitchRequest(targetENBUEID, res.MMEUES1APID, res.ERABID, ue.S1APSecurityCapabilities()) if err != nil { diff --git a/internal/tester/scenarios/s1enb/x2_path_switch.go b/internal/tester/scenarios/s1enb/x2_path_switch.go index 8d6cdae615..94bc4afc7c 100644 --- a/internal/tester/scenarios/s1enb/x2_path_switch.go +++ b/internal/tester/scenarios/s1enb/x2_path_switch.go @@ -76,7 +76,7 @@ func runS1ENBX2PathSwitch(_ context.Context, env scenarios.Env, _ any) error { return fmt.Errorf("attach on source eNB: %w", err) } - targetENBUEID := target.AllocateENBUEID() + targetENBUEID := target.AllocateENBUEIDFor(ue) if _, err := target.SendPathSwitchRequest(targetENBUEID, res.MMEUES1APID, res.ERABID, ue.S1APSecurityCapabilities()); err != nil { return fmt.Errorf("send Path Switch Request: %w", err) } diff --git a/internal/tester/scenarios/s1enb/x2_path_switch_failure.go b/internal/tester/scenarios/s1enb/x2_path_switch_failure.go index 9e95371d6c..9c0fbb6474 100644 --- a/internal/tester/scenarios/s1enb/x2_path_switch_failure.go +++ b/internal/tester/scenarios/s1enb/x2_path_switch_failure.go @@ -40,7 +40,7 @@ func runX2PathSwitchFailure(_ context.Context, env scenarios.Env, _ any) error { defer closePair() - targetENBUEID := pair.Target.AllocateENBUEID() + targetENBUEID := pair.Target.AllocateENBUEIDFor(pair.UE) unknownMMEUEID := pair.Attached.MMEUES1APID + x2UnknownMMEUEGap if _, err := pair.Target.SendPathSwitchRequest(targetENBUEID, unknownMMEUEID, pair.Attached.ERABID, pair.UE.S1APSecurityCapabilities()); err != nil { diff --git a/ngap/abstract_syntax_test.go b/ngap/abstract_syntax_test.go index 647ec4564b..8c133fb6d5 100644 --- a/ngap/abstract_syntax_test.go +++ b/ngap/abstract_syntax_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // As a peer would send it, without the rules the encoder normally enforces. @@ -75,7 +75,7 @@ func TestIEsOutOfOrderRejected(t *testing.T) { // §10.3.6 considers only IEs the receiver's version defines. func TestUnknownIEDoesNotBreakOrdering(t *testing.T) { fields := ngSetupFields() - unknown := ieField{ID: ProtocolIEID(60000), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01, 0x02})} + unknown := ieField{ID: ProtocolIEID(60000), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x01, 0x02})} fields = append([]ieField{fields[0], fields[1], unknown}, fields[2:]...) msg, err := ParseNGSetupRequest(container(t, fields...)) @@ -151,7 +151,7 @@ func TestDiagnosticsAndPreservationAreUnbounded(t *testing.T) { fields := ngSetupFields() for i := range paddingIEs { fields = append(fields, ieField{ - ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00}), }) } @@ -227,11 +227,11 @@ func TestNotifyReportedAmongIgnoredIEs(t *testing.T) { fields := ngSetupFields() for i := range paddingIEs + 10 { fields = append(fields, ieField{ - ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00}), }) } - fields = append(fields, ieField{ID: ProtocolIEID(50000), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x00})}) + fields = append(fields, ieField{ID: ProtocolIEID(50000), Criticality: CriticalityNotify, Value: apimpl.RawValue([]byte{0x00})}) msg, err := ParseNGSetupRequest(container(t, fields...)) if err != nil { @@ -328,7 +328,7 @@ func TestModeledIEsSurvivePadding(t *testing.T) { var padded []ieField for i := range paddingIEs * 2 { padded = append(padded, ieField{ - ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00}), }) } diff --git a/ngap/amf_config_update_test.go b/ngap/amf_config_update_test.go index 7108c77a3d..f28525b88b 100644 --- a/ngap/amf_config_update_test.go +++ b/ngap/amf_config_update_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func TestAMFConfigurationUpdateRoundTrips(t *testing.T) { @@ -376,7 +376,7 @@ func tnlAssociationItemWithRawExtension(t *testing.T) []byte { return err } - return encodeExtensionContainer(w, per.Aligned, []ieField{{ID: 9999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x5a})}}) + return encodeExtensionContainer(w, per.Aligned, []ieField{{ID: 9999, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x5a})}}) })) w.AlignToByte() @@ -385,7 +385,7 @@ func tnlAssociationItemWithRawExtension(t *testing.T) []byte { func TestTNLAssociationItemRawExtensionRoundTrips(t *testing.T) { value := container(t, - ieField{ID: IDAMFTNLAssociationFailedToSetupList, Criticality: CriticalityIgnore, Value: ap.RawValue(tnlAssociationItemWithRawExtension(t))}, + ieField{ID: IDAMFTNLAssociationFailedToSetupList, Criticality: CriticalityIgnore, Value: apimpl.RawValue(tnlAssociationItemWithRawExtension(t))}, ) out, err := ParseAMFConfigurationUpdateAcknowledge(value) diff --git a/ngap/asn1_constants_test.go b/ngap/asn1_constants_test.go new file mode 100644 index 0000000000..3dbd2038d0 --- /dev/null +++ b/ngap/asn1_constants_test.go @@ -0,0 +1,271 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "reflect" + "strings" + "testing" + "unicode" +) + +type elementaryProcedure struct { + name string + code ProcedureCode + criticality Criticality + messages [3]string +} + +func asn1Values(t *testing.T, typeName string) map[int64]string { + t.Helper() + + s := vendoredSpec(t) + out := map[int64]string{} + + for _, m := range s.Modules { + for _, va := range m.Values { + if va.Type.Name != typeName { + continue + } + + n, err := s.Int(va.Value) + if err != nil { + t.Fatal(err) + } + + if prev, ok := out[n]; ok { + t.Fatalf("%s %d is both %s and %s", typeName, n, prev, va.Name) + } + + out[n] = va.Name + } + } + + if len(out) == 0 { + t.Fatalf("no %s values found", typeName) + } + + return out +} + +func elementaryProcedures(t *testing.T) []elementaryProcedure { + t.Helper() + + s := vendoredSpec(t) + + class := s.Class("NGAP-ELEMENTARY-PROCEDURE") + if class == nil { + t.Fatal("NGAP-ELEMENTARY-PROCEDURE not found") + } + + def := class.Field("&criticality") + if def == nil || def.Default == nil || def.Default.Value == nil { + t.Fatal("NGAP-ELEMENTARY-PROCEDURE has no default criticality") + } + + set := s.ObjectSet("NGAP-ELEMENTARY-PROCEDURES") + if set == nil { + t.Fatal("NGAP-ELEMENTARY-PROCEDURES not found") + } + + objs, err := s.Objects(set.Set) + if err != nil { + t.Fatal(err) + } + + crits := map[string]Criticality{"reject": CriticalityReject, "ignore": CriticalityIgnore, "notify": CriticalityNotify} + + out := make([]elementaryProcedure, 0, len(objs)) + + for _, o := range objs { + cv, _ := o.Value("&procedureCode") + + code, err := s.Int(cv) + if err != nil { + t.Fatal(err) + } + + crit := def.Default.Value.Ref + if v, ok := o.Value("&criticality"); ok { + crit = v.Ref + } + + ep := elementaryProcedure{name: cv.Ref, code: ProcedureCode(code), criticality: crits[crit]} + + for i, f := range []string{"&InitiatingMessage", "&SuccessfulOutcome", "&UnsuccessfulOutcome"} { + if ty := o.Type(f); ty != nil { + ep.messages[i] = ty.Name + } + } + + out = append(out, ep) + } + + return out +} + +func goIdentifier(asn1Name string) string { + s := strings.ReplaceAll(strings.TrimPrefix(asn1Name, "id-"), "-", "") + r := []rune(s) + r[0] = unicode.ToUpper(r[0]) + + return string(r) +} + +func TestProtocolIEIDsMatchASN1(t *testing.T) { + spec := asn1Values(t, "ProtocolIE-ID") + + for id, name := range spec { + if got, ok := protocolIENames[ProtocolIEID(id)]; !ok || "id-"+got != name { + t.Errorf("%s = %d: protocolIENames has %q", name, id, got) + } + } + + for id, name := range protocolIENames { + if _, ok := spec[int64(id)]; !ok { + t.Errorf("protocolIENames[%d] = %q is not a TS 38.413 ProtocolIE-ID", uint16(id), name) + } + } +} + +func TestProcedureCodesMatchASN1(t *testing.T) { + spec := asn1Values(t, "ProcedureCode") + + for code, name := range spec { + if got := procedureNames[ProcedureCode(code)]; got != goIdentifier(name) { + t.Errorf("%s = %d: procedureNames has %q", name, code, got) + } + } + + for code, name := range procedureNames { + if _, ok := spec[int64(code)]; !ok { + t.Errorf("procedureNames[%d] = %q is not a TS 38.413 ProcedureCode", uint8(code), name) + } + } +} + +func TestProcedureInfoMatchesASN1(t *testing.T) { + eps := elementaryProcedures(t) + + if len(eps) != len(procedureInfos) { + t.Errorf("NGAP-ELEMENTARY-PROCEDURES has %d procedures, procedureInfos %d", len(eps), len(procedureInfos)) + } + + for _, ep := range eps { + info, ok := procedureInfos[ep.code] + if !ok { + t.Errorf("%s (%d) is missing from procedureInfos", ep.name, ep.code) + + continue + } + + if info.crit != ep.criticality { + t.Errorf("%s: criticality %s, spec says %s", ep.name, info.crit, ep.criticality) + } + + if info.outcome != (ep.messages[2] != "") { + t.Errorf("%s: unsuccessful outcome %v, spec defines %q", ep.name, info.outcome, ep.messages[2]) + } + } +} + +func TestMessagesMatchElementaryProcedures(t *testing.T) { + type slot struct { + ep elementaryProcedure + choice int + } + + bySpecName := map[string]slot{} + + for _, ep := range elementaryProcedures(t) { + for i, m := range ep.messages { + if m != "" { + bySpecName[m] = slot{ep, i} + } + } + } + + for _, c := range messageCases() { + t.Run(c.asn1, func(t *testing.T) { + want, ok := bySpecName[c.asn1] + if !ok { + t.Fatalf("%s is not a message of any NGAP-ELEMENTARY-PROCEDURE", c.asn1) + } + + b, err := sampleMessage(t, c.typ).Interface().(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if pdu.choiceIndex() != want.choice || pdu.procedureCode() != want.ep.code || pdu.criticality() != want.ep.criticality { + t.Errorf("sent as choice %d, %s, %s; spec says choice %d, %s (%d), %s", + pdu.choiceIndex(), pdu.procedureCode(), pdu.criticality(), want.choice, want.ep.name, want.ep.code, want.ep.criticality) + } + }) + } +} + +func TestTypedCodecsCoverEveryMessage(t *testing.T) { + keys := map[string]typedKey{} + + for _, ep := range elementaryProcedures(t) { + for i, m := range ep.messages { + if m != "" { + keys[m] = typedKey{TriggeringMessage(i), ep.code} + } + } + } + + covered := map[typedKey]bool{} + + for _, c := range messageCases() { + key, ok := keys[c.asn1] + if !ok { + t.Errorf("%s is not a message of any elementary procedure", c.asn1) + + continue + } + + covered[key] = true + + codec, ok := typedCodecs[key] + if !ok { + t.Errorf("%s: typedCodecs has no entry for %v", c.asn1, key) + + continue + } + + b, err := sampleMessage(t, c.typ).Interface().(typedMessage).Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + msg, err := codec(pdu.value()) + if err != nil { + t.Errorf("%s: %v", c.asn1, err) + + continue + } + + if got := reflect.TypeOf(msg); got != reflect.PointerTo(c.typ) { + t.Errorf("%s: typedCodecs[%v] returns %v", c.asn1, key, got) + } + } + + for key := range typedCodecs { + if !covered[key] { + t.Errorf("typedCodecs[%v] has no message case", key) + } + } +} diff --git a/ngap/cause_test.go b/ngap/cause_test.go index 0b4b5d0996..425968b3b1 100644 --- a/ngap/cause_test.go +++ b/ngap/cause_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func TestCauseRoundTrip(t *testing.T) { @@ -62,7 +63,7 @@ func causeChoiceExtensionWire(t *testing.T, crit Criticality) []byte { t.Fatal(err) } - if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: ap.RawValue([]byte{0x2a})}); err != nil { + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: apimpl.RawValue([]byte{0x2a})}); err != nil { t.Fatal(err) } diff --git a/ngap/choice_alternatives_test.go b/ngap/choice_alternatives_test.go new file mode 100644 index 0000000000..36d6b32ea3 --- /dev/null +++ b/ngap/choice_alternatives_test.go @@ -0,0 +1,357 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "reflect" + "slices" + "strconv" + "strings" + "testing" + + "github.com/ellanetworks/core/per/asn1spec" +) + +type choiceCase struct { + asn1 string + typ reflect.Type +} + +func choiceCases() []choiceCase { + return []choiceCase{ + {"AMFPagingTarget", reflect.TypeFor[AMFPagingTarget]()}, + {"Area-ID", reflect.TypeFor[AreaID]()}, + {"AreaScopeOfMDT-EUTRA", reflect.TypeFor[AreaScopeOfMDTEUTRA]()}, + {"AreaScopeOfMDT-NR", reflect.TypeFor[AreaScopeOfMDTNR]()}, + {"AreaScopeOfQMC", reflect.TypeFor[AreaScopeOfQMC]()}, + {"BroadcastCancelledAreaList", reflect.TypeFor[BroadcastCancelledAreaList]()}, + {"BroadcastCompletedAreaList", reflect.TypeFor[BroadcastCompletedAreaList]()}, + {"CPTransportLayerInformation", reflect.TypeFor[CPTransportLayerInformation]()}, + {"CandidateCell", reflect.TypeFor[CandidateCell]()}, + {"Cause", reflect.TypeFor[Cause]()}, + {"CellIDListForRestart", reflect.TypeFor[CellIDListForRestart]()}, + {"ClockQualityDetailLevel", reflect.TypeFor[ClockQualityDetailLevel]()}, + {"ECNMarkingorCongestionInformationReportingRequest", reflect.TypeFor[ECNMarkingorCongestionInformationReportingRequest]()}, + {"ENB-ID", reflect.TypeFor[ENBID]()}, + {"EventTrigger", reflect.TypeFor[EventTrigger]()}, + {"GNB-ID", reflect.TypeFor[GNBID]()}, + {"GlobalRANNodeID", reflect.TypeFor[GlobalRANNodeID]()}, + {"InterSystemHandoverReportType", reflect.TypeFor[InterSystemHandoverReportType]()}, + {"IntersystemSONInformation", reflect.TypeFor[IntersystemSONInformation]()}, + {"IntersystemSONInformationReply", reflect.TypeFor[IntersystemSONInformationReply]()}, + {"IntersystemSONInformationReport", reflect.TypeFor[IntersystemSONInformationReport]()}, + {"IntersystemSONInformationRequest", reflect.TypeFor[IntersystemSONInformationRequest]()}, + {"IntersystemSONTransferType", reflect.TypeFor[IntersystemSONTransferType]()}, + {"LastVisitedCellInformation", reflect.TypeFor[LastVisitedCellInformation]()}, + {"LoggedMDTTrigger", reflect.TypeFor[LoggedMDTTrigger]()}, + {"M1ThresholdType", reflect.TypeFor[M1ThresholdType]()}, + {"MBS-ServiceArea", reflect.TypeFor[MBSServiceArea]()}, + {"MDT-AlignmentInfo", reflect.TypeFor[MDTAlignmentInfo]()}, + {"MDTModeNr", reflect.TypeFor[MDTModeNr]()}, + {"MRB-ProgressInformation", reflect.TypeFor[MRBProgressInformation]()}, + {"MeasurementThresholdL1LoggedMDT", reflect.TypeFor[MeasurementThresholdL1LoggedMDT]()}, + {"N3IWF-ID", reflect.TypeFor[N3IWFID]()}, + {"NGRAN-CGI", reflect.TypeFor[NGRANCGI]()}, + {"NPN-AccessInformation", reflect.TypeFor[NPNAccessInformation]()}, + {"NPN-MobilityInformation", reflect.TypeFor[NPNMobilityInformation]()}, + {"NPN-PagingAssistanceInformation", reflect.TypeFor[NPNPagingAssistanceInformation]()}, + {"NPN-Support", reflect.TypeFor[NPNSupport]()}, + {"NTN-Geographical-Area-Item", reflect.TypeFor[NTNGeographicalAreaItem]()}, + {"NgENB-ID", reflect.TypeFor[NgENBID]()}, + {"OverloadResponse", reflect.TypeFor[OverloadResponse]()}, + {"PWSFailedCellIDList", reflect.TypeFor[PWSFailedCellIDList]()}, + {"PeriodicityRange", reflect.TypeFor[PeriodicityRange]()}, + {"QosCharacteristics", reflect.TypeFor[QosCharacteristics]()}, + {"RANfeedbacktype", reflect.TypeFor[RANfeedbacktype]()}, + {"ReportType", reflect.TypeFor[ReportType]()}, + {"ReportingSystem", reflect.TypeFor[ReportingSystem]()}, + {"ResetType", reflect.TypeFor[ResetType]()}, + {"ResourceStatusReportingSystem", reflect.TypeFor[ResourceStatusReportingSystem]()}, + {"SensorNameConfig", reflect.TypeFor[SensorNameConfig]()}, + {"SourceNodeID", reflect.TypeFor[SourceNodeID]()}, + {"TNGF-ID", reflect.TypeFor[TNGFID]()}, + {"TWIF-ID", reflect.TypeFor[TWIFID]()}, + {"TargetID", reflect.TypeFor[TargetID]()}, + {"UEHistoryInformationFromTheUE", reflect.TypeFor[UEHistoryInformationFromTheUE]()}, + {"UEIdentityIndexValue", reflect.TypeFor[UEIdentityIndexValue]()}, + {"UE-NGAP-IDs", reflect.TypeFor[UENGAPIDs]()}, + {"UEPagingIdentity", reflect.TypeFor[UEPagingIdentity]()}, + {"UERLFReportContainer", reflect.TypeFor[UERLFReportContainer]()}, + {"UPTransportLayerInformation", reflect.TypeFor[UPTransportLayerInformation]()}, + {"UserLocationInformation", reflect.TypeFor[UserLocationInformation]()}, + {"UserLocationInformationW-AGF", reflect.TypeFor[UserLocationInformationWAGF]()}, + {"W-AGF-ID", reflect.TypeFor[WAGFID]()}, + {"WarningAreaList", reflect.TypeFor[WarningAreaList]()}, + } +} + +type choiceField struct { + field reflect.StructField + index int + ext bool + raw bool + typed bool + row tableRowSpec +} + +func choiceFields(t *testing.T, typ reflect.Type) (fields []choiceField, extalt bool) { + t.Helper() + + for i := range typ.NumField() { + f := typ.Field(i) + + cf := choiceField{field: f, index: -1} + + for _, o := range strings.Split(f.Tag.Get("per"), ",") { + switch { + case o == "extalt": + extalt = true + case o == "ext": + cf.ext = true + case o == "extie": + cf.raw = true + case strings.HasPrefix(o, "extie:"): + cf.typed = true + cf.row.ID = protocolIEIDNamed(t, strings.TrimPrefix(o, "extie:")) + case o == "crit:reject": + cf.row.Criticality = CriticalityReject + case o == "crit:ignore": + cf.row.Criticality = CriticalityIgnore + case o == "crit:notify": + cf.row.Criticality = CriticalityNotify + case strings.HasPrefix(o, "choice:"): + n, err := strconv.Atoi(strings.TrimPrefix(o, "choice:")) + if err != nil { + t.Fatal(err) + } + + cf.index = n + } + } + + if cf.index >= 0 { + fields = append(fields, cf) + } + } + + return fields, extalt +} + +func protocolIEIDNamed(t *testing.T, name string) ProtocolIEID { + t.Helper() + + for id, n := range protocolIENames { + if "ID"+strings.NewReplacer("-", "", "_", "").Replace(n) == name { + return id + } + } + + t.Fatalf("no ProtocolIE-ID named %s", name) + + return 0 +} + +func normalizeName(s string) string { + return strings.ToLower(strings.NewReplacer("-", "", "_", "").Replace(s)) +} + +func alternativeMatches(f reflect.StructField, c *asn1spec.Component) bool { + elem := f.Type + for elem.Kind() == reflect.Pointer { + elem = elem.Elem() + } + + return normalizeName(f.Name) == normalizeName(c.Name) || + (c.Type.Kind == asn1spec.Reference && normalizeName(elem.Name()) == normalizeName(c.Type.Name)) +} + +func singleContainerSet(s *asn1spec.Spec, ty *asn1spec.Type) (*asn1spec.ObjectSet, bool) { + for range 8 { + if ty.Kind != asn1spec.Reference { + return nil, false + } + + if ty.Name == "ProtocolIE-SingleContainer" { + if len(ty.Args) != 1 || ty.Args[0].Set == nil { + return nil, false + } + + return ty.Args[0].Set, true + } + + ta := s.Type(ty.Name) + if ta == nil { + return nil, false + } + + ty = ta.Type + } + + return nil, false +} + +func singleContainerRows(t *testing.T, set *asn1spec.ObjectSet) []tableRowSpec { + t.Helper() + + s := vendoredSpec(t) + + objs, err := s.Objects(set) + if err != nil { + t.Fatal(err) + } + + crits := map[string]Criticality{"reject": CriticalityReject, "ignore": CriticalityIgnore, "notify": CriticalityNotify} + + var out []tableRowSpec + + for _, o := range objs { + idv, _ := o.Value("&id") + + id, err := s.Int(idv) + if err != nil { + t.Fatal(err) + } + + crit, _ := o.Value("&criticality") + + out = append(out, tableRowSpec{ID: ProtocolIEID(id), Criticality: crits[crit.Ref]}) + } + + return out +} + +func TestChoiceAlternativesMatchASN1(t *testing.T) { + s := vendoredSpec(t) + + for _, c := range choiceCases() { + t.Run(c.asn1, func(t *testing.T) { + ta := s.Type(c.asn1) + if ta == nil || ta.Type.Kind != asn1spec.Choice { + t.Fatalf("%s is not an ASN.1 CHOICE", c.asn1) + } + + var root, ext []*asn1spec.Component + + for _, comp := range ta.Type.Components { + if comp.Extension { + ext = append(ext, comp) + } else { + root = append(root, comp) + } + } + + fields, extalt := choiceFields(t, c.typ) + + if extalt != ta.Type.Extensible { + t.Errorf("extalt field %v, spec extensible %v", extalt, ta.Type.Extensible) + } + + seenRoot := make([]bool, len(root)) + seenExt := make([]bool, len(ext)) + rawAt := map[*asn1spec.Component]bool{} + typedAt := map[*asn1spec.Component][]tableRowSpec{} + + for _, f := range fields { + alts, seen := root, seenRoot + if f.ext { + alts, seen = ext, seenExt + } + + if f.index >= len(alts) { + t.Errorf("%s: alternative %d (ext %v) does not exist in the spec", f.field.Name, f.index, f.ext) + + continue + } + + comp := alts[f.index] + seen[f.index] = true + + if f.raw || f.typed { + if _, ok := singleContainerSet(s, comp.Type); !ok { + t.Errorf("%s: choice-Extensions field at %d, spec alternative %s is %s", f.field.Name, f.index, comp.Name, comp.Type) + + continue + } + + if f.raw { + rawAt[comp] = true + } else { + typedAt[comp] = append(typedAt[comp], f.row) + } + + continue + } + + if !alternativeMatches(f.field, comp) { + t.Errorf("%s (%v) at %d, spec alternative is %s %s", f.field.Name, f.field.Type, f.index, comp.Name, comp.Type) + } + } + + for i, ok := range seenRoot { + if !ok { + t.Errorf("root alternative %s is not modeled", root[i].Name) + } + } + + for i, ok := range seenExt { + if !ok { + t.Errorf("extension alternative %s is not modeled", ext[i].Name) + } + } + + for _, comp := range ta.Type.Components { + set, ok := singleContainerSet(s, comp.Type) + if !ok { + continue + } + + if !rawAt[comp] { + t.Errorf("%s: no raw field for unknown choice-Extensions members", comp.Name) + } + + if want := singleContainerRows(t, set); !slices.Equal(typedAt[comp], want) { + t.Errorf("%s: typed choice-Extensions %v, spec %v", comp.Name, typedAt[comp], want) + } + } + }) + } +} + +func TestChoiceCasesAreComplete(t *testing.T) { + cases := choiceCases() + + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ + } + + checkComplete(t, "CHOICE", scannedDecls(t).choices, types) +} + +func TestPDUChoiceMatchesASN1(t *testing.T) { + ta := vendoredSpec(t).Type("NGAP-PDU") + if ta == nil { + t.Fatal("NGAP-PDU not found") + } + + want := map[string]int{"initiatingMessage": pduInitiatingMessage, "successfulOutcome": pduSuccessfulOutcome, "unsuccessfulOutcome": pduUnsuccessfulOutcome} + + root := 0 + + for _, comp := range ta.Type.Components { + if comp.Extension { + continue + } + + if idx, ok := want[comp.Name]; !ok || idx != root { + t.Errorf("NGAP-PDU alternative %d is %s", root, comp.Name) + } + + root++ + } + + if root != len(want) || !ta.Type.Extensible { + t.Errorf("NGAP-PDU has %d root alternatives (extensible %v), want %d and extensible", root, ta.Type.Extensible, len(want)) + } +} diff --git a/ngap/choice_extension_rule_test.go b/ngap/choice_extension_rule_test.go new file mode 100644 index 0000000000..c740e6938d --- /dev/null +++ b/ngap/choice_extension_rule_test.go @@ -0,0 +1,49 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "errors" + "testing" + + "github.com/ellanetworks/core/per/ap/apimpl" +) + +func TestNGResetWithUnknownResetTypeAlternativeIsRejected(t *testing.T) { + for _, inner := range []Criticality{CriticalityIgnore, CriticalityNotify, CriticalityReject} { + value := container(t, ieField{ + ID: IDResetType, + Criticality: CriticalityReject, + Value: apimpl.RawValue(choiceExtensionValueCrit(t, resetTypeAlternatives, resetTypeChoiceExtensions, 9999, inner)), + }) + + decoded, err := DecodeNGReset(value) + if err != nil { + t.Fatalf("%v: decode: %v", inner, err) + } + + if decoded.ResetType.ChoiceExtension == nil || decoded.ResetType.ChoiceExtension.ID != 9999 { + t.Fatalf("%v: decoded ResetType = %+v, want the unknown alternative kept", inner, decoded.ResetType) + } + + _, err = ParseNGReset(value) + + var ase *AbstractSyntaxError + if !errors.As(err, &ase) { + t.Fatalf("%v: parse = %v, want *AbstractSyntaxError", inner, err) + } + + var onResetType bool + + for _, ie := range ase.IEs { + if ie.IEID == IDResetType && ie.IECriticality == CriticalityReject { + onResetType = true + } + } + + if !onResetType { + t.Errorf("%v: diagnostics = %+v, want ResetType rejected on its own criticality", inner, ase.IEs) + } + } +} diff --git a/ngap/common.go b/ngap/common.go index 8784c43b09..615c60594e 100644 --- a/ngap/common.go +++ b/ngap/common.go @@ -138,4 +138,10 @@ const ( ProcMTCommunicationHandling ProcedureCode = 78 ProcRANPagingRequest ProcedureCode = 79 ProcBroadcastSessionTransport ProcedureCode = 80 + ProcNGRemoval ProcedureCode = 81 + ProcInventoryRequest ProcedureCode = 82 + ProcInventoryReport ProcedureCode = 83 + ProcCommandRequest ProcedureCode = 84 + ProcAIOTSessionRelease ProcedureCode = 85 + ProcAIOTSessionReleaseRequest ProcedureCode = 86 ) diff --git a/ngap/config_transfer.go b/ngap/config_transfer.go index f06412ddc1..6c35c3dd27 100644 --- a/ngap/config_transfer.go +++ b/ngap/config_transfer.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TargetRANNodeIDSON ::= SEQUENCE { globalRANNodeID, selectedTAI, @@ -81,10 +82,10 @@ var uplinkRANConfigurationTransferIEs = []ieSpec[UplinkRANConfigurationTransfer] return m.SONConfigurationTransfer, true }, }, - optionalExtension(IDENDCSONConfigurationTransferUL, CriticalityIgnore, func(m *UplinkRANConfigurationTransfer) **ENDCSONConfigurationTransfer { + apimpl.OptionalIE(IDENDCSONConfigurationTransferUL, CriticalityIgnore, func(m *UplinkRANConfigurationTransfer) **ENDCSONConfigurationTransfer { return &m.ENDCSONConfigurationTransferUL }), - optionalExtension(IDIntersystemSONConfigurationTransferUL, CriticalityIgnore, func(m *UplinkRANConfigurationTransfer) **IntersystemSONConfigurationTransfer { + apimpl.OptionalIE(IDIntersystemSONConfigurationTransferUL, CriticalityIgnore, func(m *UplinkRANConfigurationTransfer) **IntersystemSONConfigurationTransfer { return &m.IntersystemSONConfigurationTransferUL }), } @@ -142,10 +143,10 @@ var downlinkRANConfigurationTransferIEs = []ieSpec[DownlinkRANConfigurationTrans return m.SONConfigurationTransfer, true }, }, - optionalExtension(IDENDCSONConfigurationTransferDL, CriticalityIgnore, func(m *DownlinkRANConfigurationTransfer) **ENDCSONConfigurationTransfer { + apimpl.OptionalIE(IDENDCSONConfigurationTransferDL, CriticalityIgnore, func(m *DownlinkRANConfigurationTransfer) **ENDCSONConfigurationTransfer { return &m.ENDCSONConfigurationTransferDL }), - optionalExtension(IDIntersystemSONConfigurationTransferDL, CriticalityIgnore, func(m *DownlinkRANConfigurationTransfer) **IntersystemSONConfigurationTransfer { + apimpl.OptionalIE(IDIntersystemSONConfigurationTransferDL, CriticalityIgnore, func(m *DownlinkRANConfigurationTransfer) **IntersystemSONConfigurationTransfer { return &m.IntersystemSONConfigurationTransferDL }), } diff --git a/ngap/coverage_test.go b/ngap/coverage_test.go index 6d36af2bf2..eaaf85ad07 100644 --- a/ngap/coverage_test.go +++ b/ngap/coverage_test.go @@ -224,20 +224,28 @@ func fillConditions(t *testing.T, v reflect.Value) { } } +func sampleMessage(t *testing.T, typ reflect.Type) reflect.Value { + t.Helper() + + in := reflect.New(typ) + + for i := range typ.NumField() { + if f := typ.Field(i); f.IsExported() && !f.Anonymous { + fillSample(t, in.Elem().Field(i), 0) + } + } + + if m, ok := in.Interface().(*HandoverCommand); ok { + m.HandoverType = HandoverTypeFiveGSToEPS + } + + return in +} + func TestEveryMessageIERoundTrips(t *testing.T) { for _, c := range messageCases() { t.Run(c.asn1, func(t *testing.T) { - in := reflect.New(c.typ) - - for i := range c.typ.NumField() { - if f := c.typ.Field(i); f.IsExported() && !f.Anonymous { - fillSample(t, in.Elem().Field(i), 0) - } - } - - if m, ok := in.Interface().(*HandoverCommand); ok { - m.HandoverType = HandoverTypeFiveGSToEPS - } + in := sampleMessage(t, c.typ) b, err := in.Interface().(interface{ Marshal() ([]byte, error) }).Marshal() if err != nil { diff --git a/ngap/decode_total_test.go b/ngap/decode_total_test.go index 598c91f60d..0408d59cca 100644 --- a/ngap/decode_total_test.go +++ b/ngap/decode_total_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type totalCase struct { @@ -92,8 +92,8 @@ func TestDecodeIsTotalAndLossless(t *testing.T) { falsely := CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage f := ngSetupFields() - unknownIgnore := ieField{ID: 40000, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})} - unknownReject := ieField{ID: 40001, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x02})} + unknownIgnore := ieField{ID: 40000, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x01})} + unknownReject := ieField{ID: 40001, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x02})} item := goldAMFConfigurationUpdateRelay().PLMNSupportList[1] item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityReject, Value: []byte{0x5a}}) @@ -130,7 +130,7 @@ func TestDecodeIsTotalAndLossless(t *testing.T) { } func TestRawPDUUEIDAccessorRefusesDuplicate(t *testing.T) { - id := ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))} + id := ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))} b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUplinkNASTransport, Criticality: CriticalityIgnore, Value: container(t, id, id)}) if err != nil { diff --git a/ngap/diagnostics_bound_test.go b/ngap/diagnostics_bound_test.go index da56088493..bcf6743fba 100644 --- a/ngap/diagnostics_bound_test.go +++ b/ngap/diagnostics_bound_test.go @@ -7,7 +7,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // CriticalityDiagnostics-IE-List is SIZE(1..maxnoofErrors), so an untruncated @@ -18,7 +18,7 @@ func TestNotUnderstoodReportStaysSendable(t *testing.T) { fields = append(fields, ieField{ ID: ProtocolIEID(40000 + i), // outside every id this version models Criticality: CriticalityReject, - Value: ap.RawValue([]byte{0x00}), + Value: apimpl.RawValue([]byte{0x00}), }) } diff --git a/ngap/engine_regression_test.go b/ngap/engine_regression_test.go new file mode 100644 index 0000000000..5a012632f9 --- /dev/null +++ b/ngap/engine_regression_test.go @@ -0,0 +1,284 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "bytes" + "errors" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +func redundantTunnel(a byte, teid GTPTEID, flow QosFlowIdentifier, mapping *QosFlowMappingIndication) QosFlowPerTNLInformationItem { + return QosFlowPerTNLInformationItem{QosFlowPerTNLInformation: QosFlowPerTNLInformation{ + UPTransportLayerInformation: UPTransportLayerInformation{GTPTunnel: >PTunnel{TransportLayerAddress: tlaOf(10, 0, 0, a), GTPTEID: teid}}, + AssociatedQosFlowList: AssociatedQosFlowList{{QosFlowIdentifier: flow, QosFlowMappingIndication: mapping}}, + }} +} + +func TestPartiallyNotComprehendedListKeepsEveryItemOnDecode(t *testing.T) { + in := &PDUSessionResourceSetupResponseTransfer{ + DLQosFlowPerTNLInformation: redundantTunnel(1, 1, 1, nil).QosFlowPerTNLInformation, + AdditionalRedundantDLQosFlowPerTNLInformation: QosFlowPerTNLInformationList{ + redundantTunnel(2, 2, 1, nil), + redundantTunnel(3, 3, 2, Ptr(QosFlowMappingIndication(7))), + }, + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + decoded, err := DecodePDUSessionResourceSetupResponseTransfer(b) + if err != nil { + t.Fatal(err) + } + + if got := decoded.AdditionalRedundantDLQosFlowPerTNLInformation; len(got) != 2 || got[1].QosFlowPerTNLInformation.UPTransportLayerInformation.GTPTunnel.GTPTEID != 3 { + t.Fatalf("decoded %d redundant tunnels, want both kept", len(got)) + } + + ies := decoded.Diagnostics().IEs + if len(ies) != 1 || ies[0].ID != IDAdditionalRedundantDLQosFlowPerTNLInformation || ies[0].Kind != ap.KindNotComprehended || ies[0].Criticality != CriticalityIgnore { + t.Fatalf("diagnostics = %v, want the ignore extension reported not comprehended", ies) + } + + parsed, err := ParsePDUSessionResourceSetupResponseTransfer(b) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if parsed.AdditionalRedundantDLQosFlowPerTNLInformation != nil { + t.Fatal("parse kept an extension that is partially not comprehended (TS 38.413 §10.3.2)") + } + + if parsed.DLQosFlowPerTNLInformation.UPTransportLayerInformation.GTPTunnel.GTPTEID != 1 { + t.Fatal("parse lost the comprehended part of the transfer") + } + + for name, v := range map[string]*PDUSessionResourceSetupResponseTransfer{"decoded": decoded, "parsed": parsed} { + again, err := v.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(again, b) { + t.Fatalf("%s re-encoded %x, want %x", name, again, b) + } + } +} + +func initialUEMessageValue(t *testing.T, m *InitialUEMessage) []byte { + t.Helper() + + b, err := m.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + return pdu.value() +} + +func TestNotComprehendedMandatoryIEIsNotAlsoMissing(t *testing.T) { + value := initialUEMessageValue(t, &InitialUEMessage{ + RANUENGAPID: 1, + NASPDU: NASPDU{0x7e, 0x00}, + UserLocationInformation: UserLocationInformation{NR: &UserLocationInformationNR{ + NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: 1}, + TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, + }}, + RRCEstablishmentCause: Ptr(RRCEstablishmentCause(40)), + }) + + decoded, err := DecodeInitialUEMessage(value) + if err != nil { + t.Fatal(err) + } + + if decoded.RRCEstablishmentCause == nil || *decoded.RRCEstablishmentCause != 40 { + t.Fatalf("RRCEstablishmentCause = %v, want the unknown value 40 kept", decoded.RRCEstablishmentCause) + } + + ies := decoded.Diagnostics().IEs + if len(ies) != 1 || ies[0].ID != IDRRCEstablishmentCause || ies[0].Kind != ap.KindNotComprehended { + t.Fatalf("diagnostics = %v, want one not-comprehended entry and no missing entry", ies) + } + + parsed, err := ParseInitialUEMessage(value) + if err != nil { + t.Fatal(err) + } + + if parsed.RRCEstablishmentCause != nil { + t.Fatalf("parsed RRCEstablishmentCause = %v, want it treated as not received", *parsed.RRCEstablishmentCause) + } + + for name, m := range map[string]*InitialUEMessage{"decoded": decoded, "parsed": parsed} { + b, err := m.Marshal() + if err != nil { + t.Fatalf("%s: %v", name, err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(pdu.value(), value) { + t.Fatalf("%s re-encoded %x, want %x", name, pdu.value(), value) + } + } +} + +func TestEmptyOctetStringIsPresent(t *testing.T) { + value := initialUEMessageValue(t, &InitialUEMessage{ + RANUENGAPID: 1, + NASPDU: NASPDU{}, + UserLocationInformation: UserLocationInformation{NR: &UserLocationInformationNR{ + NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: 1}, + TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, + }}, + RRCEstablishmentCause: Ptr(RRCCauseEmergency), + }) + + m, err := DecodeInitialUEMessage(value) + if err != nil { + t.Fatal(err) + } + + if m.NASPDU == nil || len(m.NASPDU) != 0 { + t.Fatalf("NASPDU = %#v, want present and empty", m.NASPDU) + } + + if !m.Diagnostics().Empty() { + t.Fatalf("diagnostics = %v, want none: the NAS-PDU was received", m.Diagnostics().IEs) + } + + assertLossless(t, func(b []byte) (typedMessage, error) { return DecodeInitialUEMessage(b) }, value) +} + +func TestTrailingOctetsAreATransferSyntaxError(t *testing.T) { + in := &HandoverCommandTransfer{} + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + if _, err := DecodeHandoverCommandTransfer(append(b, make([]byte, 49)...)); !errors.Is(err, per.ErrTrailing) { + t.Fatalf("decode with trailing octets = %v, want per.ErrTrailing", err) + } + + value := initialUEMessageValue(t, &InitialUEMessage{ + RANUENGAPID: 1, + NASPDU: NASPDU{0x7e}, + UserLocationInformation: UserLocationInformation{NR: &UserLocationInformationNR{ + NRCGI: NRCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, NRCellIdentity: 1}, + TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}, + }}, + RRCEstablishmentCause: Ptr(RRCCauseEmergency), + }) + + _, err = DecodeInitialUEMessage(append(value, 0x00)) + + var tse *TransferSyntaxError + if !errors.As(err, &tse) || !errors.Is(err, per.ErrTrailing) || tse.Procedure != ProcInitialUEMessage { + t.Fatalf("decode with a trailing octet = %v, want a *TransferSyntaxError for InitialUEMessage", err) + } +} + +func TestUnsetTransportLayerAddressDoesNotEncode(t *testing.T) { + if _, err := per.Marshal(>PTunnel{GTPTEID: 1}, per.Aligned); !errors.Is(err, ap.ErrTransportLayerAddress) { + t.Fatalf("encoding a GTPTunnel without an address = %v, want %v", err, ap.ErrTransportLayerAddress) + } +} + +func TestRawPDUErrorsAreTransferSyntaxErrors(t *testing.T) { + for name, b := range map[string][]byte{ + "empty": nil, + "truncated": {0x00, 0x0f, 0x40, 0x10}, + "trailing": append(mustHexBytes(goldenInitialUEMessage), 0x00), + } { + _, err := ParseRawPDU(b) + + var tse *TransferSyntaxError + if !errors.As(err, &tse) { + t.Errorf("%s: ParseRawPDU = %v (%T), want *TransferSyntaxError", name, err, err) + } + } +} + +func assertLossless(t *testing.T, decode func([]byte) (typedMessage, error), value []byte) { + t.Helper() + + m, err := decode(value) + if err != nil { + t.Fatalf("re-decode: %v", err) + } + + b, err := m.Marshal() + if err != nil { + t.Fatalf("a decoded message does not re-encode: %v", err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(pdu.value(), value) { + t.Fatalf("re-encoded %x, want %x", pdu.value(), value) + } +} + +var losslessDecoders = []func([]byte) (typedMessage, error){ + func(b []byte) (typedMessage, error) { return DecodeInitialUEMessage(b) }, + func(b []byte) (typedMessage, error) { return DecodeUplinkNASTransport(b) }, + func(b []byte) (typedMessage, error) { return DecodeDownlinkNASTransport(b) }, + func(b []byte) (typedMessage, error) { return DecodeHandoverRequest(b) }, + func(b []byte) (typedMessage, error) { return DecodePDUSessionResourceSetupRequest(b) }, + func(b []byte) (typedMessage, error) { return DecodeInitialContextSetupRequest(b) }, +} + +func FuzzMessageLossless(f *testing.F) { + f.Add([]byte("0\x00\x03\x00%0\x02\x000\x00%00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")) + + for _, g := range []string{goldenInitialUEMessage, goldenUplinkNASTransportNR, goldenPDUSessionResourceSetupRequest, goldenInitialContextSetupRequest} { + pdu, err := Unmarshal(mustHexBytes(g)) + if err != nil { + f.Fatal(err) + } + + f.Add(pdu.value()) + } + + f.Fuzz(func(t *testing.T, value []byte) { + for _, decode := range losslessDecoders { + m, err := decode(value) + if err != nil { + continue + } + + b, err := m.Marshal() + if err != nil { + t.Fatalf("a decoded message does not re-encode: %v", err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + assertLossless(t, decode, pdu.value()) + } + }) +} diff --git a/ngap/enum_asn1_test.go b/ngap/enum_asn1_test.go new file mode 100644 index 0000000000..9324f00296 --- /dev/null +++ b/ngap/enum_asn1_test.go @@ -0,0 +1,332 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "reflect" + "slices" + "strings" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/asn1spec" +) + +type enumShape struct { + Root []string + Extensible bool + Extension []string +} + +type enumSpecCase struct { + asn1 string + got enumShape + typ reflect.Type +} + +func enumSpec[T per.Integer](asn1 string, e *per.Enum[T]) enumSpecCase { + return enumSpecCase{ + asn1: asn1, + got: enumShape{Root: e.Root, Extensible: e.Extensible || len(e.Extension) > 0, Extension: e.Extension}, + typ: reflect.TypeFor[T](), + } +} + +func asn1Enum(t *testing.T, ref string) enumShape { + t.Helper() + + s := vendoredSpec(t) + + typeName, component, _ := strings.Cut(ref, ".") + + ta := s.Type(typeName) + if ta == nil { + t.Fatalf("ASN.1 type %s not found", typeName) + } + + ty := ta.Type + + if component != "" { + c := ty.Component(component) + if c == nil { + t.Fatalf("%s has no component %s", typeName, component) + } + + ty = c.Type + } + + ty, err := s.Underlying(ty) + if err != nil { + t.Fatal(err) + } + + if ty.Kind != asn1spec.Enumerated { + t.Fatalf("%s is %s, not ENUMERATED", ref, ty.Kind) + } + + var out enumShape + + for _, it := range ty.Enum { + if it.HasNumber { + t.Fatalf("%s: %s has an explicit number", ref, it.Name) + } + + if it.Extension { + out.Extension = append(out.Extension, it.Name) + } else { + out.Root = append(out.Root, it.Name) + } + } + + out.Extensible = ty.Extensible + + return out +} + +func enumSpecCases() []enumSpecCase { + return []enumSpecCase{ + enumSpec("CauseRadioNetwork", &enumCauseRadioNetwork), + enumSpec("CauseTransport", &enumCauseTransport), + enumSpec("CauseNas", &enumCauseNas), + enumSpec("CauseProtocol", &enumCauseProtocol), + enumSpec("CauseMisc", &enumCauseMisc), + enumSpec("TriggeringMessage", &enumTriggeringMessage), + enumSpec("TypeOfError", &enumTypeOfError), + enumSpec("UEPresence", &enumUEPresence), + enumSpec("DelayCritical", &enumDelayCritical), + enumSpec("ReflectiveQosAttribute", &enumReflectiveQosAttribute), + enumSpec("AdditionalQosFlowInformation", &enumAdditionalQosFlowInformation), + enumSpec("Pre-emptionCapability", &enumPreemptionCapability), + enumSpec("Pre-emptionVulnerability", &enumPreemptionVulnerability), + enumSpec("NotificationControl", &enumNotificationControl), + enumSpec("AssociatedQosFlowItem.qosFlowMappingIndication", &enumQosFlowMappingIndication), + enumSpec("DataForwardingAccepted", &enumDataForwardingAccepted), + enumSpec("IntegrityProtectionIndication", &enumIntegrityProtectionIndication), + enumSpec("ConfidentialityProtectionIndication", &enumConfidentialityProtectionIndication), + enumSpec("MaximumIntegrityProtectedDataRate", &enumMaximumIntegrityProtectedDataRate), + enumSpec("IntegrityProtectionResult", &enumIntegrityProtectionResult), + enumSpec("ConfidentialityProtectionResult", &enumConfidentialityProtectionResult), + enumSpec("DirectForwardingPathAvailability", &enumDirectForwardingPathAvailability), + enumSpec("DL-NGU-TNLInformationReused", &enumDLNGUTNLInformationReused), + enumSpec("NotificationCause", &enumNotificationCause), + enumSpec("GUAMIType", &enumGUAMIType), + enumSpec("TimerApproachForGUAMIRemoval", &enumTimerApproachForGUAMIRemoval), + enumSpec("ConcurrentWarningMessageInd", &enumConcurrentWarningMessageInd), + enumSpec("CancelAllWarningMessages", &enumCancelAllWarningMessages), + enumSpec("EventType", &enumEventType), + enumSpec("ReportArea", &enumReportArea), + enumSpec("RRCEstablishmentCause", &enumRRCEstablishmentCause), + enumSpec("UEContextRequest", &enumUEContextRequest), + enumSpec("GW-Context-Release-Indication", &enumGWContextReleaseIndication), + enumSpec("TNLAssociationUsage", &enumTNLAssociationUsage), + enumSpec("PagingPriority", &enumPagingPriority), + enumSpec("PagingOrigin", &enumPagingOrigin), + enumSpec("OnboardingSupport", &enumOnboardingSupport), + enumSpec("NotifySourceNGRANNode", &enumNotifySourceNGRANNode), + enumSpec("OverloadAction", &enumOverloadAction), + enumSpec("TimeToWait", &enumTimeToWait), + enumSpec("TraceDepth", &enumTraceDepth), + enumSpec("UERetentionInformation", &enumUERetentionInformation), + enumSpec("PagingDRX", &enumPagingDRX), + enumSpec("HandoverType", &enumHandoverType), + enumSpec("NewSecurityContextInd", &enumNewSecurityContextInd), + enumSpec("PDUSessionType", &enumPDUSessionType), + enumSpec("DLForwarding", &enumDLForwarding), + enumSpec("CellSize", &enumCellSize), + enumSpec("DataForwardingNotPossible", &enumDataForwardingNotPossible), + enumSpec("UserPlaneFailureType", &enumUserPlaneFailureType), + enumSpec("ResetAll", &enumResetAll), + enumSpec("LineType", &enumLineType), + enumSpec("ConfiguredTACIndication", &enumConfiguredTACIndication), + enumSpec("RAT-Information", &enumRATInformation), + enumSpec("LocationReportingAdditionalInfo", &enumLocationReportingAdditionalInfo), + enumSpec("AerialUEReportingPeriodicity", &enumAerialUEReportingPeriodicity), + enumSpec("MBS-SupportIndicator", &enumMBSSupportIndicator), + enumSpec("PDUSetbasedHandlingIndicator", &enumPDUSetbasedHandlingIndicator), + enumSpec("CNTypeRestrictionsForServing", &enumCNTypeRestrictionsForServing), + enumSpec("QosMonitoringRequest", &enumQosMonitoringRequest), + enumSpec("DLPDUSetInformationMarkingSupportIndication", &enumDLPDUSetInformationMarkingSupportIndication), + enumSpec("Indication-of-Bitrate-Adaptation", &enumIndicationofBitrateAdaptation), + enumSpec("RedundantQosFlowIndicator", &enumRedundantQosFlowIndicator), + enumSpec("UserPlaneFailureIndicationReport", &enumUserPlaneFailureIndicationReport), + enumSpec("ULForwarding", &enumULForwarding), + enumSpec("DAPSRequestInfo.dAPSIndicator", &enumDAPSRequestInfoDAPSIndicator), + enumSpec("RSN", &enumRSN), + enumSpec("CNTypeRestrictionsForEquivalentItem.cn-Type", &enumCNTypeRestrictionsForEquivalentItemCnType), + enumSpec("SourceOfUEActivityBehaviourInformation", &enumSourceOfUEActivityBehaviourInformation), + enumSpec("PDUsetQoSInformation.pduSetIntegratedHandlingInformation", &enumPDUsetQoSInformationPduSetIntegratedHandlingInformation), + enumSpec("MonitoringRequest", &enumMonitoringRequest), + enumSpec("ECNMarkingAtRANRequest", &enumECNMarkingAtRANRequest), + enumSpec("ECNMarkingAtUPFRequest", &enumECNMarkingAtUPFRequest), + enumSpec("CongestionInformationRequest", &enumCongestionInformationRequest), + enumSpec("PDUSessionUsageReport.rATType", &enumPDUSessionUsageReportRATType), + enumSpec("MN-only-MDT-collection", &enumMNonlyMDTcollection), + enumSpec("ActivationStatus", &enumActivationStatus), + enumSpec("QoSFlowsUsageReport-Item.rATType", &enumQoSFlowsUsageReportItemRATType), + enumSpec("MDT-Activation", &enumMDTActivation), + enumSpec("Allowed-PNI-NPN-Item.pNI-NPN-restricted", &enumAllowedPNINPNItemPNINPNrestricted), + enumSpec("RANfeedbacktype-reactive.capabilityForBATAdaptation", &enumRANfeedbacktypereactiveCapabilityForBATAdaptation), + enumSpec("UEAppLayerMeasConfigInfo.qoEMeasurementStatus", &enumUEAppLayerMeasConfigInfoQoEMeasurementStatus), + enumSpec("BluetoothMeasurementConfiguration.bt-rssi", &enumBluetoothMeasurementConfigurationBtrssi), + enumSpec("WLANMeasurementConfiguration.wlan-rssi", &enumWLANMeasurementConfigurationWlanrssi), + enumSpec("WLANMeasurementConfiguration.wlan-rtt", &enumWLANMeasurementConfigurationWlanrtt), + enumSpec("LoggingInterval", &enumLoggingInterval), + enumSpec("LoggingDuration", &enumLoggingDuration), + enumSpec("EarlyMeasurement", &enumEarlyMeasurement), + enumSpec("ServiceType", &enumServiceType), + enumSpec("AvailableRANVisibleQoEMetrics.applicationLayerBufferLevelList", &enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList), + enumSpec("AvailableRANVisibleQoEMetrics.playoutDelayForMediaStartup", &enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup), + enumSpec("CommServiceType", &enumCommServiceType), + enumSpec("QoERVQoEReportingPaths.qoEReportingPath", &enumQoERVQoEReportingPathsQoEReportingPath), + enumSpec("QoERVQoEReportingPaths.rVQoEReportingPath", &enumQoERVQoEReportingPathsRVQoEReportingPath), + enumSpec("M1ReportingTrigger", &enumM1ReportingTrigger), + enumSpec("IncludeBeamMeasurementsIndication", &enumIncludeBeamMeasurementsIndication), + enumSpec("M4period", &enumM4period), + enumSpec("Links-to-log", &enumLinkstolog), + enumSpec("M4ReportAmountMDT", &enumM4ReportAmountMDT), + enumSpec("M5period", &enumM5period), + enumSpec("M5ReportAmountMDT", &enumM5ReportAmountMDT), + enumSpec("M6report-Interval", &enumM6reportInterval), + enumSpec("M6ReportAmountMDT", &enumM6ReportAmountMDT), + enumSpec("M7ReportAmountMDT", &enumM7ReportAmountMDT), + enumSpec("BluetoothMeasConfig", &enumBluetoothMeasConfig), + enumSpec("WLANMeasConfig", &enumWLANMeasConfig), + enumSpec("SensorMeasConfig", &enumSensorMeasConfig), + enumSpec("EventTrigger.outOfCoverage", &enumEventTriggerOutOfCoverage), + enumSpec("ReportIntervalMDT", &enumReportIntervalMDT), + enumSpec("ReportAmountMDT", &enumReportAmountMDT), + enumSpec("ExtendedReportIntervalMDT", &enumExtendedReportIntervalMDT), + enumSpec("BeamMeasurementsReportQuantity.rSRP", &enumBeamMeasurementsReportQuantityRSRP), + enumSpec("BeamMeasurementsReportQuantity.rSRQ", &enumBeamMeasurementsReportQuantityRSRQ), + enumSpec("BeamMeasurementsReportQuantity.sINR", &enumBeamMeasurementsReportQuantitySINR), + enumSpec("ExcessPacketDelayThresholdValue", &enumExcessPacketDelayThresholdValue), + enumSpec("SensorNameConfig.uncompensatedBarometricConfig", &enumSensorNameConfigUncompensatedBarometricConfig), + enumSpec("SensorNameConfig.ueSpeedConfig", &enumSensorNameConfigUeSpeedConfig), + enumSpec("SensorNameConfig.ueOrientationConfig", &enumSensorNameConfigUeOrientationConfig), + enumSpec("TimeToTrigger", &enumTimeToTrigger), + enumSpec("RRCInactiveTransitionReportRequest", &enumRRCInactiveTransitionReportRequest), + enumSpec("RedirectionVoiceFallback", &enumRedirectionVoiceFallback), + enumSpec("SRVCCOperationPossible", &enumSRVCCOperationPossible), + enumSpec("IAB-Authorized", &enumIABAuthorized), + enumSpec("Enhanced-CoverageRestriction", &enumEnhancedCoverageRestriction), + enumSpec("UE-DifferentiationInfo.periodicCommunicationIndicator", &enumUEDifferentiationInfoPeriodicCommunicationIndicator), + enumSpec("UE-DifferentiationInfo.stationaryIndication", &enumUEDifferentiationInfoStationaryIndication), + enumSpec("UE-DifferentiationInfo.trafficProfile", &enumUEDifferentiationInfoTrafficProfile), + enumSpec("UE-DifferentiationInfo.batteryIndication", &enumUEDifferentiationInfoBatteryIndication), + enumSpec("CEmodeBrestricted", &enumCEmodeBrestricted), + enumSpec("UE-UP-CIoT-Support", &enumUEUPCIoTSupport), + enumSpec("TimeSyncAssistanceInfo.timeDistributionIndication", &enumTimeSyncAssistanceInfoTimeDistributionIndication), + enumSpec("AerialUEsubscriptionInformation", &enumAerialUEsubscriptionInformation), + enumSpec("NR-A2X-ServicesAuthorized.aerialUE", &enumNRA2XServicesAuthorizedAerialUE), + enumSpec("NR-A2X-ServicesAuthorized.aerialControllerUE", &enumNRA2XServicesAuthorizedAerialControllerUE), + enumSpec("LTE-A2X-ServicesAuthorized.aerialUE", &enumLTEA2XServicesAuthorizedAerialUE), + enumSpec("LTE-A2X-ServicesAuthorized.aerialControllerUE", &enumLTEA2XServicesAuthorizedAerialControllerUE), + enumSpec("MobileIAB-Authorized", &enumMobileIABAuthorized), + enumSpec("NoPDUSessionIndication", &enumNoPDUSessionIndication), + enumSpec("RedCapIndication", &enumRedCapIndication), + enumSpec("ERedCapIndication", &enumERedCapIndication), + enumSpec("NetworkControlledRepeaterAuthorized", &enumNetworkControlledRepeaterAuthorized), + enumSpec("IABNodeIndication", &enumIABNodeIndication), + enumSpec("CEmodeBSupport-Indicator", &enumCEmodeBSupportIndicator), + enumSpec("LTEM-Indication", &enumLTEMIndication), + enumSpec("EDT-Session", &enumEDTSession), + enumSpec("AuthenticatedIndication", &enumAuthenticatedIndication), + enumSpec("MobileIABNodeIndication", &enumMobileIABNodeIndication), + enumSpec("AUN3DeviceAccessInfo.aUN3DeviceAccess", &enumAUN3DeviceAccessInfoAUN3DeviceAccess), + enumSpec("AUN3DeviceAccessInfo.existingNGConnectionwithSameLocation", &enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation), + enumSpec("UECapabilityInfoRequest", &enumUECapabilityInfoRequest), + enumSpec("EndIndication", &enumEndIndication), + enumSpec("NB-IoT-DefaultPagingDRX", &enumNBIoTDefaultPagingDRX), + enumSpec("AIoT-Support", &enumAIoTSupport), + enumSpec("IAB-Supported", &enumIABSupported), + enumSpec("MobileIAB-Supported", &enumMobileIABSupported), + enumSpec("NB-IoT-PagingDRX", &enumNBIoTPagingDRX), + enumSpec("PagingCause", &enumPagingCause), + enumSpec("LPWUSDisableIndication", &enumLPWUSDisableIndication), + enumSpec("RRCState", &enumRRCState), + enumSpec("XrDeviceWith2Rx", &enumXrDeviceWith2Rx), + enumSpec("MICOModeIndication", &enumMICOModeIndication), + enumSpec("MicoAllPLMN", &enumMicoAllPLMN), + enumSpec("PagingCauseIndicationForVoiceService", &enumPagingCauseIndicationForVoiceService), + enumSpec("CN-MT-CommunicationHandling", &enumCNMTCommunicationHandling), + enumSpec("VehicleUE", &enumVehicleUE), + enumSpec("PedestrianUE", &enumPedestrianUE), + enumSpec("FiveGProSeDirectDiscovery", &enumFiveGProSeDirectDiscovery), + enumSpec("FiveGProSeDirectCommunication", &enumFiveGProSeDirectCommunication), + enumSpec("FiveGProSeLayer2UEtoNetworkRelay", &enumFiveGProSeLayer2UEtoNetworkRelay), + enumSpec("FiveGProSeLayer3UEtoNetworkRelay", &enumFiveGProSeLayer3UEtoNetworkRelay), + enumSpec("FiveGProSeLayer2RemoteUE", &enumFiveGProSeLayer2RemoteUE), + enumSpec("FiveGProSeLayer2Multipath", &enumFiveGProSeLayer2Multipath), + enumSpec("FiveGProSeLayer2UEtoUERelay", &enumFiveGProSeLayer2UEtoUERelay), + enumSpec("FiveGProSeLayer2UEtoUERemote", &enumFiveGProSeLayer2UEtoUERemote), + enumSpec("FiveGProSeLayer2MHUEtoNetworkRelay", &enumFiveGProSeLayer2MHUEtoNetworkRelay), + enumSpec("FiveGProSeLayer2MHIntermediateUEtoNetworkRelay", &enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay), + enumSpec("FiveGProSeLayer2MHRemote", &enumFiveGProSeLayer2MHRemote), + enumSpec("FiveGProSeLayer3MHUEtoNetworkRelay", &enumFiveGProSeLayer3MHUEtoNetworkRelay), + enumSpec("SLPositioningRangingAuthorized", &enumSLPositioningRangingAuthorized), + enumSpec("EmergencyFallbackRequestIndicator", &enumEmergencyFallbackRequestIndicator), + enumSpec("EmergencyServiceTargetCN", &enumEmergencyServiceTargetCN), + enumSpec("NB-IoT-Paging-eDRXCycle", &enumNBIoTPagingeDRXCycle), + enumSpec("NB-IoT-Paging-TimeWindow", &enumNBIoTPagingTimeWindow), + enumSpec("PagingProbabilityInformation", &enumPagingProbabilityInformation), + enumSpec("EUTRA-Paging-eDRX-Cycle", &enumEUTRAPagingeDRXCycle), + enumSpec("EUTRA-Paging-Time-Window", &enumEUTRAPagingTimeWindow), + enumSpec("NR-Paging-eDRX-Cycle", &enumNRPagingeDRXCycle), + enumSpec("NR-Paging-Time-Window", &enumNRPagingTimeWindow), + enumSpec("ExpectedHOInterval", &enumExpectedHOInterval), + enumSpec("ExpectedUEMobility", &enumExpectedUEMobility), + enumSpec("A2X-PC5-QoS-Flow-Item.a2X-Range", &enumA2XPC5QoSFlowItemA2XRange), + enumSpec("NextPagingAreaScope", &enumNextPagingAreaScope), + enumSpec("MBS-AssistanceInformation", &enumMBSAssistanceInformation), + enumSpec("Range", &enumRangeType), + enumSpec("ClockQualityAcceptanceCriteria.traceabletoUTC", &enumClockQualityAcceptanceCriteriaTraceabletoUTC), + enumSpec("ClockQualityAcceptanceCriteria.traceabletoGNSS", &enumClockQualityAcceptanceCriteriaTraceabletoGNSS), + enumSpec("IntersystemUnnecessaryHO.earlyIRATHO", &enumIntersystemUnnecessaryHOEarlyIRATHO), + enumSpec("NotificationCell-Item.notifyFlag", &enumNotificationCellItemNotifyFlag), + enumSpec("NumberOfMeasurementReportingLevels", &enumNumberOfMeasurementReportingLevels), + enumSpec("ReportingPeriodicity", &enumReportingPeriodicity), + } +} + +func TestEnumLiteralsMatchASN1(t *testing.T) { + for _, c := range enumSpecCases() { + t.Run(c.asn1, func(t *testing.T) { + want := asn1Enum(t, c.asn1) + + if !slices.Equal(c.got.Root, want.Root) || c.got.Extensible != want.Extensible || !slices.Equal(c.got.Extension, want.Extension) { + t.Errorf("modeled as %+v, spec says %+v", c.got, want) + } + }) + } +} + +func TestEnumCasesAreComplete(t *testing.T) { + cases := enumSpecCases() + + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ + } + + checkComplete(t, "per.Enum", scannedDecls(t).enums, types) +} + +func TestCriticalityLiteralsMatchASN1(t *testing.T) { + want := asn1Enum(t, "Criticality") + + got := enumShape{} + for _, c := range []Criticality{CriticalityReject, CriticalityIgnore, CriticalityNotify} { + got.Root = append(got.Root, c.String()) + } + + if !slices.Equal(got.Root, want.Root) || want.Extensible || len(want.Root) != criticalityRootCount { + t.Errorf("Criticality = %+v, spec says %+v", got, want) + } + + for i, c := range []Criticality{CriticalityReject, CriticalityIgnore, CriticalityNotify} { + if int(c) != i { + t.Errorf("%s has index %d, spec says %d", c, int(c), i) + } + } +} diff --git a/ngap/enum_extension_test.go b/ngap/enum_extension_test.go index 35182c36a2..faed43138e 100644 --- a/ngap/enum_extension_test.go +++ b/ngap/enum_extension_test.go @@ -8,6 +8,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // The k'th extension addition of an ENUMERATED whose root holds nRoot values. @@ -101,7 +102,7 @@ func TestPagingEnumExtensionsAreIgnored(t *testing.T) { t.Run(tt.name, func(t *testing.T) { msg, err := ParsePaging(container(t, ieField{ID: IDPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, - ieField{ID: tt.id, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, tt.nRoot, 64))}, + ieField{ID: tt.id, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extensionEnum(t, tt.nRoot, 64))}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -124,7 +125,7 @@ func TestPagingEnumExtensionsAreIgnored(t *testing.T) { func TestNotComprehendedIEIsNotDelivered(t *testing.T) { msg, err := ParseRANConfigurationUpdate(container(t, ieField{ID: IDRANNodeName, Criticality: CriticalityIgnore, Value: Name("ella-gnb")}, - ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, int64(len(enumPagingDRX.Root)), 64))}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extensionEnum(t, int64(len(enumPagingDRX.Root)), 64))}, )) if err != nil { t.Fatalf("parse: %v", err) diff --git a/ngap/errors.go b/ngap/errors.go index 252c0a796a..e19a254267 100644 --- a/ngap/errors.go +++ b/ngap/errors.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Octets that are not a decodable PER encoding; nothing of the message is @@ -70,21 +71,7 @@ func (e *AbstractSyntaxError) HasUnsuccessfulOutcome() bool { // Of the IE Criticality, §9.3.1.3 says "The value 'ignore' is not applicable". func reportableIEs(ies []CriticalityDiagnosticsIEItem) []CriticalityDiagnosticsIEItem { - out := make([]CriticalityDiagnosticsIEItem, 0, len(ies)) - - for _, ie := range ies { - if ie.IECriticality == CriticalityIgnore { - continue - } - - out = append(out, ie) - } - - if len(out) == 0 { - return nil - } - - return out + return apimpl.Reportable(ies, func(ie CriticalityDiagnosticsIEItem) Criticality { return ie.IECriticality }) } // An ERROR INDICATION for UE-associated signalling names the association it diff --git a/ngap/extension_criticality_test.go b/ngap/extension_criticality_test.go index 8e4aa2ca8c..46f61b6e17 100644 --- a/ngap/extension_criticality_test.go +++ b/ngap/extension_criticality_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // A real extension id TAI does not model: TAI-ExtIEs is empty (TS 38.413 @@ -65,7 +65,7 @@ func extendedTAIList(t *testing.T, crit Criticality) []byte { func TestRejectExtensionInsideIgnoreIERejects(t *testing.T) { _, err := ParsePaging(container(t, ieField{ID: IDUEPagingIdentity, Criticality: CriticalityIgnore, Value: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}}, - ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAIList(t, CriticalityReject))}, + ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extendedTAIList(t, CriticalityReject))}, )) var ase *AbstractSyntaxError @@ -90,7 +90,7 @@ func TestRejectExtensionInsideIgnoreIERejects(t *testing.T) { func TestIgnoreExtensionKeepsItsIE(t *testing.T) { msg, err := ParsePaging(container(t, ieField{ID: IDUEPagingIdentity, Criticality: CriticalityIgnore, Value: &FiveGSTMSI{AMFSetID: 1, AMFPointer: 1, FiveGTMSI: 0xdeadbeef}}, - ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAIList(t, CriticalityIgnore))}, + ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extendedTAIList(t, CriticalityIgnore))}, )) if err != nil { t.Fatalf("parse: %v", err) diff --git a/ngap/golden_tshark_test.go b/ngap/golden_tshark_test.go index 9ce477818f..b2cf50e310 100644 --- a/ngap/golden_tshark_test.go +++ b/ngap/golden_tshark_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type goldenRoundTrip struct { @@ -135,7 +135,7 @@ func checkWireCase(t *testing.T, c wireCase) { } func rawUnknownIE(id ProtocolIEID, value ...byte) ieField { - return ieField{ID: id, Criticality: CriticalityIgnore, Value: ap.RawValue(value)} + return ieField{ID: id, Criticality: CriticalityIgnore, Value: apimpl.RawValue(value)} } func marshalT(t *testing.T, m interface{ Marshal() ([]byte, error) }) []byte { diff --git a/ngap/handover_cancel_test.go b/ngap/handover_cancel_test.go index dea52e366f..dc4a312d87 100644 --- a/ngap/handover_cancel_test.go +++ b/ngap/handover_cancel_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -92,8 +92,8 @@ func TestHandoverCancelAcknowledgeGolden(t *testing.T) { // continue without it; the AMF still has to see that it was missing. func TestHandoverCancelMissingCause(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) out, err := ParseHandoverCancel(value) @@ -113,7 +113,7 @@ func TestHandoverCancelMissingCause(t *testing.T) { func TestHandoverCancelMissingRANUENGAPID(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, ) _, err := ParseHandoverCancel(value) diff --git a/ngap/handover_notify_test.go b/ngap/handover_notify_test.go index 2301922a8a..1639c81e27 100644 --- a/ngap/handover_notify_test.go +++ b/ngap/handover_notify_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -87,8 +87,8 @@ func TestHandoverNotifyGolden(t *testing.T) { // still has to see that it was missing. func TestHandoverNotifyMissingUserLocation(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) out, err := ParseHandoverNotify(value) @@ -109,7 +109,7 @@ func TestHandoverNotifyMissingUserLocation(t *testing.T) { // A missing mandatory reject IE rejects the procedure (§10.3.5). func TestHandoverNotifyMissingAMFUENGAPID(t *testing.T) { value := container(t, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) if _, err := ParseHandoverNotify(value); err == nil { diff --git a/ngap/handover_resource_allocation.go b/ngap/handover_resource_allocation.go index d8290201e0..5aa7c83d74 100644 --- a/ngap/handover_resource_allocation.go +++ b/ngap/handover_resource_allocation.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413 §9.2.3.4. The AMF asks the target NG-RAN node to reserve resources. @@ -124,7 +125,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.UEAggregateMaximumBitRate, true }, }, - optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *HandoverRequest) **CoreNetworkAssistanceInformationForInactive { + apimpl.OptionalIE(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *HandoverRequest) **CoreNetworkAssistanceInformationForInactive { return &m.CoreNetworkAssistanceInformationForInactive }), { @@ -222,7 +223,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.TraceActivation, true }, }, - optionalExtension(IDMaskedIMEISV, CriticalityIgnore, func(m *HandoverRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), + apimpl.OptionalIE(IDMaskedIMEISV, CriticalityIgnore, func(m *HandoverRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), { ID: IDSourceToTargetTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { @@ -257,8 +258,8 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.MobilityRestrictionList, true }, }, - optionalExtension(IDLocationReportingRequestType, CriticalityIgnore, func(m *HandoverRequest) **LocationReportingRequestType { return &m.LocationReportingRequestType }), - optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *HandoverRequest) **RRCInactiveTransitionReportRequest { + apimpl.OptionalIE(IDLocationReportingRequestType, CriticalityIgnore, func(m *HandoverRequest) **LocationReportingRequestType { return &m.LocationReportingRequestType }), + apimpl.OptionalIE(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *HandoverRequest) **RRCInactiveTransitionReportRequest { return &m.RRCInactiveTransitionReportRequest }), { @@ -268,47 +269,47 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ }, Encode: func(m *HandoverRequest) (per.Marshaler, bool) { return &m.GUAMI, true }, }, - optionalExtension(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *HandoverRequest) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), - optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *HandoverRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), - optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *HandoverRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), - optionalExtension(IDIABAuthorized, CriticalityReject, func(m *HandoverRequest) **IABAuthorized { return &m.IABAuthorized }), - optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *HandoverRequest) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), - optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *HandoverRequest) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), - optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), - optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), - optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *HandoverRequest) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), + apimpl.OptionalIE(IDCNAssistedRANTuning, CriticalityIgnore, func(m *HandoverRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *HandoverRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDIABAuthorized, CriticalityReject, func(m *HandoverRequest) **IABAuthorized { return &m.IABAuthorized }), + apimpl.OptionalIE(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *HandoverRequest) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), + apimpl.OptionalIE(IDUEDifferentiationInfo, CriticalityIgnore, func(m *HandoverRequest) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.NRUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), - optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *HandoverRequest) **CEmodeBrestricted { return &m.CEmodeBrestricted }), - optionalExtension(IDUEUPCIoTSupport, CriticalityIgnore, func(m *HandoverRequest) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), - listExtension(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *HandoverRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), - optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *HandoverRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), - optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *HandoverRequest) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), - optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *HandoverRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), - listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *HandoverRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), - optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *HandoverRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), - optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDCEmodeBrestricted, CriticalityIgnore, func(m *HandoverRequest) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + apimpl.OptionalIE(IDUEUPCIoTSupport, CriticalityIgnore, func(m *HandoverRequest) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), + apimpl.ListIE(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *HandoverRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *HandoverRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + apimpl.OptionalIE(IDExtendedConnectedTime, CriticalityIgnore, func(m *HandoverRequest) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + apimpl.OptionalIE(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *HandoverRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + apimpl.ListIE(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *HandoverRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), + apimpl.OptionalIE(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *HandoverRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + apimpl.OptionalIE(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.FiveGProSeUEPC5AggregateMaximumBitRate }), - optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), - optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *HandoverRequest) **AerialUEsubscriptionInformation { return &m.AerialUEsubscriptionInformation }), - optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), - optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), - optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *HandoverRequest) **AerialUEsubscriptionInformation { return &m.AerialUEsubscriptionInformation }), + apimpl.OptionalIE(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + apimpl.OptionalIE(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.NRA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *HandoverRequest) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), - optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *HandoverRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), - optionalExtension(IDNoPDUSessionIndication, CriticalityIgnore, func(m *HandoverRequest) **NoPDUSessionIndication { return &m.NoPDUSessionIndication }), - listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *HandoverRequest) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), - optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *HandoverRequest) **SLPositioningRangingServiceInfo { return &m.SLPositioningRangingServiceInfo }), + apimpl.OptionalIE(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + apimpl.OptionalIE(IDMobileIABAuthorized, CriticalityIgnore, func(m *HandoverRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + apimpl.OptionalIE(IDNoPDUSessionIndication, CriticalityIgnore, func(m *HandoverRequest) **NoPDUSessionIndication { return &m.NoPDUSessionIndication }), + apimpl.ListIE(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *HandoverRequest) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + apimpl.OptionalIE(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *HandoverRequest) **SLPositioningRangingServiceInfo { return &m.SLPositioningRangingServiceInfo }), { ID: IDAMFUENGAPID2, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { @@ -500,9 +501,9 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return m.CriticalityDiagnostics, true }, }, - optionalExtension(IDNPNAccessInformation, CriticalityReject, func(m *HandoverRequestAcknowledge) **NPNAccessInformation { return &m.NPNAccessInformation }), - optionalExtension(IDRedCapIndication, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **RedCapIndication { return &m.RedCapIndication }), - optionalExtension(IDERedCapIndication, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **ERedCapIndication { return &m.ERedCapIndication }), + apimpl.OptionalIE(IDNPNAccessInformation, CriticalityReject, func(m *HandoverRequestAcknowledge) **NPNAccessInformation { return &m.NPNAccessInformation }), + apimpl.OptionalIE(IDRedCapIndication, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **RedCapIndication { return &m.RedCapIndication }), + apimpl.OptionalIE(IDERedCapIndication, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **ERedCapIndication { return &m.ERedCapIndication }), } func (m *HandoverRequestAcknowledge) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ie_ext_types.go b/ngap/ie_ext_types.go index 1e87a579d8..08c0539c3b 100644 --- a/ngap/ie_ext_types.go +++ b/ngap/ie_ext_types.go @@ -6,6 +6,7 @@ package ngap import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -1361,17 +1362,17 @@ const ( ) type AreaScopeOfMDTNR struct { - CellBased *CellBasedMDTNR `per:",choice:0"` - TABased *TABasedMDT `per:",choice:1"` - PLMNWide *per.Null `per:",choice:2"` - TAIBased *TAIBasedMDT `per:",choice:3"` - PNINPNBasedMDT *PNINPNBasedMDT `per:",choice:4,extie:IDPNINPNBasedMDT,crit:ignore"` - SNPNCellBasedMDT *SNPNCellBasedMDT `per:",choice:4,extie:IDSNPNCellBasedMDT,crit:ignore"` - SNPNTAIBasedMDT *SNPNTAIBasedMDT `per:",choice:4,extie:IDSNPNTAIBasedMDT,crit:ignore"` - SNPNBasedMDT *SNPNBasedMDT `per:",choice:4,extie:IDSNPNBasedMDT,crit:ignore"` - GeographyBasedMDT *GeographyBasedMDT `per:",choice:4,extie:IDGeographyBasedMDT,crit:ignore"` - ChoiceExtension *SingleContainer `per:",choice:4,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + CellBased *CellBasedMDTNR `per:",choice:0"` + TABased *TABasedMDT `per:",choice:1"` + PLMNWide *per.Null `per:",choice:2"` + TAIBased *TAIBasedMDT `per:",choice:3"` + PNINPNBasedMDT *PNINPNBasedMDT `per:",choice:4,extie:IDPNINPNBasedMDT,crit:ignore"` + SNPNCellBasedMDT *SNPNCellBasedMDT `per:",choice:4,extie:IDSNPNCellBasedMDT,crit:ignore"` + SNPNTAIBasedMDT *SNPNTAIBasedMDT `per:",choice:4,extie:IDSNPNTAIBasedMDT,crit:ignore"` + SNPNBasedMDT *SNPNBasedMDT `per:",choice:4,extie:IDSNPNBasedMDT,crit:ignore"` + GeographyBasedMDT *GeographyBasedMDT `per:",choice:4,extie:IDGeographyBasedMDT,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:4,extie"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type MDTModeNr struct { @@ -4257,7 +4258,7 @@ type IntersystemSONInformation struct { IntersystemSONInformationRequest *IntersystemSONInformationRequest `per:",choice:1,extie:IDIntersystemSONInformationRequest,crit:ignore"` IntersystemSONInformationReply *IntersystemSONInformationReply `per:",choice:1,extie:IDIntersystemSONInformationReply,crit:ignore"` ChoiceExtension *SingleContainer `per:",choice:1,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type UEIdentityIndexValueIndexLength10 uint16 @@ -5069,7 +5070,7 @@ type IntersystemSONInformationReport struct { EnergySavingIndication *IntersystemCellStateIndication `per:",choice:2,extie:IDEnergySavingIndication,crit:ignore"` IntersystemResourceStatusUpdate *IntersystemResourceStatusReport `per:",choice:2,extie:IDIntersystemResourceStatusUpdate,crit:ignore"` ChoiceExtension *SingleContainer `per:",choice:2,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type IntersystemSONInformationRequest struct { @@ -5574,7 +5575,7 @@ type InterSystemHandoverReportType struct { IntersystemUnnecessaryHO *IntersystemUnnecessaryHO `per:",choice:1"` IntersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback `per:",choice:2,extie:IDIntersystemMobilityFailureforVoiceFallback,crit:ignore"` ChoiceExtension *SingleContainer `per:",choice:2,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type UERLFReportContainer struct { diff --git a/ngap/ie_extensions.go b/ngap/ie_extensions.go deleted file mode 100644 index 79b174559d..0000000000 --- a/ngap/ie_extensions.go +++ /dev/null @@ -1,71 +0,0 @@ -// SPDX-FileCopyrightText: Ella Networks Inc. -// SPDX-License-Identifier: BUSL-1.1 - -package ngap - -import ( - "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" -) - -func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - return ap.EncodeExtensionContainer(profile, w, enc, fields) -} - -func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *extensionMeta) error { - return ap.DecodeExtensionContainer(profile, r, enc, table, m, meta) -} - -func optionalExtension[M any, T any, PT interface { - *T - per.Marshaler - per.Unmarshaler -}](id ProtocolIEID, crit Criticality, field func(m *M) **T, -) ieSpec[M] { - return ieSpec[M]{ - ID: id, Presence: presenceOptional, Criticality: crit, - Decode: func(m *M, r *per.Reader, _ per.Encoding) error { - v := PT(new(T)) - - if err := decodeIE(r, v); err != nil { - return err - } - - *field(m) = (*T)(v) - - return nil - }, - Encode: func(m *M) (per.Marshaler, bool) { - v := *field(m) - if v == nil { - return nil, false - } - - return PT(v), true - }, - } -} - -func listExtension[M any, L interface { - ~[]E - per.Marshaler -}, E any, PL interface { - *L - per.Unmarshaler -}](id ProtocolIEID, crit Criticality, field func(m *M) *L, -) ieSpec[M] { - return ieSpec[M]{ - ID: id, Presence: presenceOptional, Criticality: crit, - Decode: func(m *M, r *per.Reader, _ per.Encoding) error { - return decodeIE(r, PL(field(m))) - }, - Encode: func(m *M) (per.Marshaler, bool) { - v := *field(m) - if len(v) == 0 { - return nil, false - } - - return v, true - }, - } -} diff --git a/ngap/ie_handover.go b/ngap/ie_handover.go index c22b72ba3f..903439cb86 100644 --- a/ngap/ie_handover.go +++ b/ngap/ie_handover.go @@ -5,7 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // HandoverType ::= ENUMERATED { intra5gs, fivegs-to-eps, eps-to-5gs, ..., @@ -110,12 +110,12 @@ type TargeteNBID struct { // Which alternative belongs is not free: TS 38.413 §9.2.3.1 pairs it with the // Handover Type IE, and the message handler is what holds them together. type TargetID struct { - TargetRANNodeID *TargetRANNodeID `per:",choice:0"` - TargeteNBID *TargeteNBID `per:",choice:1"` - TargetRNCID *TargetRNCID `per:",choice:2,extie:IDTargetRNCID,crit:reject"` - TargetHomeENBID *TargetHomeENBID `per:",choice:2,extie:IDTargetHomeENBID,crit:reject"` - ChoiceExtension *SingleContainer `per:",choice:2,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + TargetRANNodeID *TargetRANNodeID `per:",choice:0"` + TargeteNBID *TargeteNBID `per:",choice:1"` + TargetRNCID *TargetRNCID `per:",choice:2,extie:IDTargetRNCID,crit:reject"` + TargetHomeENBID *TargetHomeENBID `per:",choice:2,extie:IDTargetHomeENBID,crit:reject"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type TargetRNCID struct { diff --git a/ngap/ie_ran_node.go b/ngap/ie_ran_node.go index 3aafd21bdc..153a56488f 100644 --- a/ngap/ie_ran_node.go +++ b/ngap/ie_ran_node.go @@ -7,18 +7,18 @@ import ( "fmt" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type GlobalRANNodeID struct { - GlobalGNBID *GlobalGNBID `per:",choice:0"` - GlobalNgENBID *GlobalNgENBID `per:",choice:1"` - GlobalN3IWFID *GlobalN3IWFID `per:",choice:2"` - GlobalTNGFID *GlobalTNGFID `per:",choice:3,extie:IDGlobalTNGFID,crit:reject"` - GlobalTWIFID *GlobalTWIFID `per:",choice:3,extie:IDGlobalTWIFID,crit:reject"` - GlobalWAGFID *GlobalWAGFID `per:",choice:3,extie:IDGlobalWAGFID,crit:reject"` - ChoiceExtension *SingleContainer `per:",choice:3,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + GlobalGNBID *GlobalGNBID `per:",choice:0"` + GlobalNgENBID *GlobalNgENBID `per:",choice:1"` + GlobalN3IWFID *GlobalN3IWFID `per:",choice:2"` + GlobalTNGFID *GlobalTNGFID `per:",choice:3,extie:IDGlobalTNGFID,crit:reject"` + GlobalTWIFID *GlobalTWIFID `per:",choice:3,extie:IDGlobalTWIFID,crit:reject"` + GlobalWAGFID *GlobalWAGFID `per:",choice:3,extie:IDGlobalWAGFID,crit:reject"` + ChoiceExtension *SingleContainer `per:",choice:3,extie"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type GlobalGNBID struct { diff --git a/ngap/ie_ran_node_test.go b/ngap/ie_ran_node_test.go index 8ee04f14b0..771df87908 100644 --- a/ngap/ie_ran_node_test.go +++ b/ngap/ie_ran_node_test.go @@ -9,6 +9,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func testNgENBNodeID(t *testing.T, plmn PLMNIdentity, id uint32, bits int) GlobalRANNodeID { @@ -81,7 +82,7 @@ func TestGlobalRANNodeIDTypedChoiceExtensionWireBytes(t *testing.T) { t.Fatal(err) } - if err := encodeContainerField(want, ieField{ID: IDGlobalTWIFID, Criticality: CriticalityReject, Value: ap.RawValue(inner)}); err != nil { + if err := encodeContainerField(want, ieField{ID: IDGlobalTWIFID, Criticality: CriticalityReject, Value: apimpl.RawValue(inner)}); err != nil { t.Fatal(err) } @@ -196,7 +197,7 @@ func TestGlobalRANNodeIDUnknownChoiceExtensionsArePreserved(t *testing.T) { t.Fatal(err) } - if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: ap.RawValue([]byte{0x00})}); err != nil { + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: apimpl.RawValue([]byte{0x00})}); err != nil { t.Fatal(err) } @@ -277,7 +278,7 @@ func TestTypedChoiceExtensionsKeepWireCriticality(t *testing.T) { t.Fatal(err) } - if err := encodeContainerField(w, ieField{ID: tc.id, Criticality: CriticalityNotify, Value: ap.RawValue(inner)}); err != nil { + if err := encodeContainerField(w, ieField{ID: tc.id, Criticality: CriticalityNotify, Value: apimpl.RawValue(inner)}); err != nil { t.Fatal(err) } diff --git a/ngap/ie_table.go b/ngap/ie_table.go index 4455b8c18d..1275cbdfb5 100644 --- a/ngap/ie_table.go +++ b/ngap/ie_table.go @@ -9,25 +9,32 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // One row of a message's TS 38.413 §9.2/§9.3 IE table. -type ieSpec[M any] = ap.IESpec[ProtocolIEID, M] +type ieSpec[M any] = apimpl.IESpec[ProtocolIEID, M] const ( - presenceOptional = ap.PresenceOptional - presenceConditional = ap.PresenceConditional - presenceMandatory = ap.PresenceMandatory + presenceOptional = apimpl.PresenceOptional + presenceConditional = apimpl.PresenceConditional + presenceMandatory = apimpl.PresenceMandatory ) type messageMeta struct { - ap.Message[ProtocolIEID] + apimpl.Message[ProtocolIEID] } -type extensionMeta = ap.Preserved[ProtocolIEID] +type extensionMeta = apimpl.Preserved[ProtocolIEID] func (u *messageMeta) meta() *messageMeta { return u } +func (u *messageMeta) appendUnknown(f RawIE) { apimpl.MessagePreserved(&u.Message).Append(f) } + +func (u *messageMeta) setExtensionAdditions(a per.ExtensionAdditions) { + *apimpl.MessageAdditions(&u.Message) = a +} + func (u messageMeta) Diagnostics() Diagnostics { return Diagnostics{u.Message.Diagnostics()} } type message interface { @@ -39,11 +46,7 @@ func encodeMessageBody[M any, PM interface { message }](w *per.Writer, enc per.Encoding, procedure ProcedureCode, table []ieSpec[M], m PM, ) error { - if err := ap.EncodeMessage(profile, w, enc, table, (*M)(m), &m.meta().Message); err != nil { - return fmt.Errorf("ngap: %s: %w", procedure, err) - } - - return nil + return apimpl.EncodeMessageBody(profile, w, enc, procedure, table, (*M)(m), &m.meta().Message) } func decodeMessageBody[M any, PM interface { @@ -53,8 +56,8 @@ func decodeMessageBody[M any, PM interface { ) (PM, error) { m := PM(new(M)) - if err := ap.DecodeMessage(profile, table, value, (*M)(m), &m.meta().Message); err != nil { - return nil, &TransferSyntaxError{Protocol: profile.Name, Procedure: procedure, Err: err} + if err := apimpl.DecodeMessageBody(profile, procedure, table, value, (*M)(m), &m.meta().Message); err != nil { + return nil, err } return m, nil @@ -65,19 +68,16 @@ func parseMessageBody[M any, PM interface { message }](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, ) (PM, error) { - m, err := decodeMessageBody[M, PM](procedure, table, value) - if err != nil { - return nil, err - } + m := PM(new(M)) - if err := m.meta().Message.Diagnostics().Check(); err != nil { - return nil, newAbstractSyntaxError(procedure, trigger, err, table, value) + if err := apimpl.ParseMessageBody(profile, procedure, table, value, (*M)(m), &m.meta().Message); err != nil { + return nil, newAbstractSyntaxError(procedure, trigger, err) } return m, nil } -func newAbstractSyntaxError[M any](procedure ProcedureCode, trigger TriggeringMessage, err error, table []ieSpec[M], value []byte) error { +func newAbstractSyntaxError(procedure ProcedureCode, trigger TriggeringMessage, err error) error { var e *ap.AbstractSyntaxError[ProtocolIEID] if !errors.As(err, &e) { return err @@ -93,66 +93,19 @@ func newAbstractSyntaxError[M any](procedure ProcedureCode, trigger TriggeringMe Trigger: trigger, Cause: cause.Cause(), IEs: criticalityDiagnosticsItems(e.IEs), - decoded: modeledIEs(table, value), + decoded: e.Decoded, } } func criticalityDiagnosticsItems(ds []DiagnosticIE) []CriticalityDiagnosticsIEItem { - var out []CriticalityDiagnosticsIEItem - - for _, d := range ds { - if len(out) >= maxnoofErrors { - break - } - + return apimpl.DiagnosticItems(ds, maxnoofErrors, func(d DiagnosticIE, missing bool) CriticalityDiagnosticsIEItem { kind := TypeOfErrorNotUnderstood - if d.Kind == ap.KindMissing { + if missing { kind = TypeOfErrorMissing } - out = append(out, CriticalityDiagnosticsIEItem{IECriticality: d.Criticality, IEID: d.ID, TypeOfError: kind}) - } - - return out -} - -func modeledIEs[M any](table []ieSpec[M], value []byte) []RawIE { - r := per.NewReader(value) - - if _, err := r.ReadBit(); err != nil { - return nil - } - - fields, err := decodeIEContainer(r, per.Aligned) - if err != nil { - return nil - } - - var out []RawIE - - seen := make(map[ProtocolIEID]bool, len(table)) - - for _, f := range fields { - if seen[f.ID] || !inTable(table, f.ID) { - continue - } - - seen[f.ID] = true - - out = append(out, f) - } - - return out -} - -func inTable[M any](table []ieSpec[M], id ProtocolIEID) bool { - for i := range table { - if table[i].ID == id { - return true - } - } - - return false + return CriticalityDiagnosticsIEItem{IECriticality: d.Criticality, IEID: d.ID, TypeOfError: kind} + }) } func decodeTransfer[T any, PT interface { @@ -160,13 +113,7 @@ func decodeTransfer[T any, PT interface { per.Unmarshaler }](b []byte, ) (PT, error) { - t := PT(new(T)) - - if err := t.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { - return nil, err - } - - return t, nil + return apimpl.DecodeTransfer[ProtocolIEID, T, PT](b) } func parseTransfer[T any, PT interface { @@ -174,23 +121,19 @@ func parseTransfer[T any, PT interface { per.Unmarshaler }](b []byte, ) (PT, error) { - t, err := decodeTransfer[T, PT](b) + t, err := apimpl.ParseTransfer[ProtocolIEID, T, PT](b) if err != nil { - return nil, err - } + var e *ap.AbstractSyntaxError[ProtocolIEID] + if errors.As(err, &e) { + return nil, fmt.Errorf("ngap: %w", err) + } - if err := diagnosticsOf(t).Check(); err != nil { - return nil, fmt.Errorf("ngap: %w", err) + return nil, err } return t, nil } func diagnosticsOf(v any) Diagnostics { - dv, ok := v.(ap.Diagnosable[ProtocolIEID]) - if !ok { - return Diagnostics{} - } - - return Diagnostics{ap.Diagnose(dv)} + return Diagnostics{apimpl.DiagnosticsOf[ProtocolIEID](v)} } diff --git a/ngap/ie_tnl.go b/ngap/ie_tnl.go index b767c19050..9c01f3fc62 100644 --- a/ngap/ie_tnl.go +++ b/ngap/ie_tnl.go @@ -5,7 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413, NGAP-Constants. @@ -17,7 +17,7 @@ type CPTransportLayerInformation struct { EndpointIPAddress *TransportLayerAddress `per:",choice:0"` EndpointIPAddressAndPort *EndpointIPAddressAndPort `per:",choice:1,extie:IDEndpointIPAddressAndPort,crit:reject"` ChoiceExtension *SingleContainer `per:",choice:1,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type EndpointIPAddressAndPort struct { diff --git a/ngap/ie_ue.go b/ngap/ie_ue.go index c4b3c5678d..9cd39cd63b 100644 --- a/ngap/ie_ue.go +++ b/ngap/ie_ue.go @@ -6,6 +6,7 @@ package ngap import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // UE NGAP ID ranges (TS 38.413 §9.3.3). The AMF id is 40 bits wide, so both @@ -150,7 +151,7 @@ type UserLocationInformation struct { WAGF *UserLocationInformationWAGF `per:",choice:3,extie:IDUserLocationInformationWAGF,crit:ignore"` N3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber `per:",choice:3,extie:IDUserLocationInformationN3IWFwithoutPortNumber,crit:ignore"` ChoiceExtension *SingleContainer `per:",choice:3,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type UserLocationInformationEUTRA struct { @@ -203,13 +204,13 @@ type UserLocationInformationTWIF struct { } type UserLocationInformationWAGF struct { - GlobalLineID *GlobalLineID `per:",choice:0"` - HFCNodeID *HFCNodeID `per:",choice:1"` - GlobalCableID *GlobalCableID `per:",choice:2,extie:IDGlobalCableID,crit:ignore"` - HFCNodeIDNew *HFCNodeIDNew `per:",choice:2,extie:IDHFCNodeIDnew,crit:ignore"` - GlobalCableIDNew *GlobalCableIDNew `per:",choice:2,extie:IDGlobalCableIDnew,crit:ignore"` - ChoiceExtension *SingleContainer `per:",choice:2,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + GlobalLineID *GlobalLineID `per:",choice:0"` + HFCNodeID *HFCNodeID `per:",choice:1"` + GlobalCableID *GlobalCableID `per:",choice:2,extie:IDGlobalCableID,crit:ignore"` + HFCNodeIDNew *HFCNodeIDNew `per:",choice:2,extie:IDHFCNodeIDnew,crit:ignore"` + GlobalCableIDNew *GlobalCableIDNew `per:",choice:2,extie:IDGlobalCableIDnew,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:2,extie"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type UserLocationInformationN3IWFWithoutPortNumber struct { diff --git a/ngap/ies.go b/ngap/ies.go index 90ebd4c4ec..64acdc9ffd 100644 --- a/ngap/ies.go +++ b/ngap/ies.go @@ -6,6 +6,7 @@ package ngap import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Container size bounds (TS 38.413, NGAP-Constants). @@ -14,7 +15,7 @@ const ( maxProtocolExtensions = 65535 ) -var profile = &ap.Profile{ +var profile = &apimpl.Profile{ Name: "ngap", MaxProtocolIEs: maxProtocolIEs, MaxProtocolExtensions: maxProtocolExtensions, @@ -23,7 +24,7 @@ var profile = &ap.Profile{ IEName: func(id uint16) string { return ProtocolIEID(id).String() }, } -type ieField = ap.FieldValue[ProtocolIEID] +type ieField = apimpl.FieldValue[ProtocolIEID] type SingleContainer = ap.SingleContainer[ProtocolIEID] @@ -46,9 +47,17 @@ func restOctets(r *per.Reader) []byte { // //nolint:unparam func decodeIEContainer(r *per.Reader, enc per.Encoding) ([]rawIE, error) { - return ap.DecodeIEContainer[ProtocolIEID](profile, r, enc) + return apimpl.DecodeIEContainer[ProtocolIEID](profile, r, enc) } func perIEDecode(b []byte, u per.Unmarshaler) error { - return u.UnmarshalPER(per.NewReader(b), per.Aligned) + return apimpl.DecodeValue(b, u) +} + +func encodeExtensionContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { + return apimpl.EncodeExtensionContainer(profile, w, enc, fields) +} + +func decodeExtensionContainer[M any](r *per.Reader, enc per.Encoding, table []ieSpec[M], m *M, meta *extensionMeta) error { + return apimpl.DecodeExtensionContainer(profile, r, enc, table, m, meta) } diff --git a/ngap/ies_test.go b/ngap/ies_test.go index 8929c957d2..8340f52513 100644 --- a/ngap/ies_test.go +++ b/ngap/ies_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func TestEncodeIEContainerKnownVector(t *testing.T) { @@ -17,7 +17,7 @@ func TestEncodeIEContainerKnownVector(t *testing.T) { err := encodeIEContainer(w, per.Aligned, []ieField{{ ID: 27, Criticality: CriticalityIgnore, - Value: ap.RawValue([]byte{0xab, 0xcd}), + Value: apimpl.RawValue([]byte{0xab, 0xcd}), }}) if err != nil { t.Fatal(err) @@ -54,8 +54,8 @@ func TestEmptyIEContainer(t *testing.T) { func TestIEContainerRoundTrip(t *testing.T) { in := []ieField{ - {ID: 27, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x01, 0x02, 0x03})}, - {ID: 1, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xff})}, + {ID: 27, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x01, 0x02, 0x03})}, + {ID: 1, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0xff})}, {ID: 65535, Criticality: CriticalityNotify, Value: per.MarshalerFunc(func(*per.Writer, per.Encoding) error { return nil })}, } @@ -89,8 +89,8 @@ func TestIEContainerRoundTrip(t *testing.T) { func TestRawIEReencodePreserves(t *testing.T) { // A container decoded and re-encoded from preserved raw IEs is byte-identical. original := []ieField{ - {ID: 10, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0xde, 0xad})}, - {ID: 20, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xbe, 0xef, 0x00})}, + {ID: 10, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0xde, 0xad})}, + {ID: 20, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0xbe, 0xef, 0x00})}, } w1 := per.NewWriter() diff --git a/ngap/initial_context_setup.go b/ngap/initial_context_setup.go index 9f791d9b34..e0514bcf2e 100644 --- a/ngap/initial_context_setup.go +++ b/ngap/initial_context_setup.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // PDUSessionResourceSetupItemCxtReq ::= SEQUENCE { pDUSessionID, nAS-PDU @@ -150,7 +151,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ }, Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, - optionalExtension(IDOldAMF, CriticalityReject, func(m *InitialContextSetupRequest) **Name { return &m.OldAMF }), + apimpl.OptionalIE(IDOldAMF, CriticalityReject, func(m *InitialContextSetupRequest) **Name { return &m.OldAMF }), { ID: IDUEAggregateMaximumBitRate, Presence: presenceConditional, Criticality: CriticalityReject, Condition: func(m *InitialContextSetupRequest) bool { return m.PDUSessionResourceSetup != nil }, @@ -173,7 +174,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UEAggregateMaximumBitRate, true }, }, - optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *InitialContextSetupRequest) **CoreNetworkAssistanceInformationForInactive { + apimpl.OptionalIE(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *InitialContextSetupRequest) **CoreNetworkAssistanceInformationForInactive { return &m.CoreNetworkAssistanceInformationForInactive }), { @@ -246,7 +247,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.TraceActivation, true }, }, - optionalExtension(IDMobilityRestrictionList, CriticalityIgnore, func(m *InitialContextSetupRequest) **MobilityRestrictionList { return &m.MobilityRestrictionList }), + apimpl.OptionalIE(IDMobilityRestrictionList, CriticalityIgnore, func(m *InitialContextSetupRequest) **MobilityRestrictionList { return &m.MobilityRestrictionList }), { ID: IDUERadioCapability, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { @@ -260,8 +261,8 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UERadioCapability, true }, }, - optionalExtension(IDIndexToRFSP, CriticalityIgnore, func(m *InitialContextSetupRequest) **IndexToRFSP { return &m.IndexToRFSP }), - optionalExtension(IDMaskedIMEISV, CriticalityIgnore, func(m *InitialContextSetupRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), + apimpl.OptionalIE(IDIndexToRFSP, CriticalityIgnore, func(m *InitialContextSetupRequest) **IndexToRFSP { return &m.IndexToRFSP }), + apimpl.OptionalIE(IDMaskedIMEISV, CriticalityIgnore, func(m *InitialContextSetupRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), { ID: IDNASPDU, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { @@ -283,8 +284,8 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.NASPDU, true }, }, - optionalExtension(IDEmergencyFallbackIndicator, CriticalityReject, func(m *InitialContextSetupRequest) **EmergencyFallbackIndicator { return &m.EmergencyFallbackIndicator }), - optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *InitialContextSetupRequest) **RRCInactiveTransitionReportRequest { + apimpl.OptionalIE(IDEmergencyFallbackIndicator, CriticalityReject, func(m *InitialContextSetupRequest) **EmergencyFallbackIndicator { return &m.EmergencyFallbackIndicator }), + apimpl.OptionalIE(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *InitialContextSetupRequest) **RRCInactiveTransitionReportRequest { return &m.RRCInactiveTransitionReportRequest }), { @@ -308,64 +309,64 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UERadioCapabilityForPaging, true }, }, - optionalExtension(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *InitialContextSetupRequest) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), - optionalExtension(IDLocationReportingRequestType, CriticalityIgnore, func(m *InitialContextSetupRequest) **LocationReportingRequestType { + apimpl.OptionalIE(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *InitialContextSetupRequest) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), + apimpl.OptionalIE(IDLocationReportingRequestType, CriticalityIgnore, func(m *InitialContextSetupRequest) **LocationReportingRequestType { return &m.LocationReportingRequestType }), - optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *InitialContextSetupRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), - optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *InitialContextSetupRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), - optionalExtension(IDIABAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **IABAuthorized { return &m.IABAuthorized }), - optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *InitialContextSetupRequest) **EnhancedCoverageRestriction { + apimpl.OptionalIE(IDCNAssistedRANTuning, CriticalityIgnore, func(m *InitialContextSetupRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *InitialContextSetupRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDIABAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **IABAuthorized { return &m.IABAuthorized }), + apimpl.OptionalIE(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *InitialContextSetupRequest) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), - optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *InitialContextSetupRequest) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), - optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), - optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), - optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), - optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDExtendedConnectedTime, CriticalityIgnore, func(m *InitialContextSetupRequest) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + apimpl.OptionalIE(IDUEDifferentiationInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.NRUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), - optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *InitialContextSetupRequest) **CEmodeBrestricted { return &m.CEmodeBrestricted }), - optionalExtension(IDUEUPCIoTSupport, CriticalityIgnore, func(m *InitialContextSetupRequest) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), - optionalExtension(IDRGLevelWirelineAccessCharacteristics, CriticalityIgnore, func(m *InitialContextSetupRequest) **RGLevelWirelineAccessCharacteristics { + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDCEmodeBrestricted, CriticalityIgnore, func(m *InitialContextSetupRequest) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + apimpl.OptionalIE(IDUEUPCIoTSupport, CriticalityIgnore, func(m *InitialContextSetupRequest) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), + apimpl.OptionalIE(IDRGLevelWirelineAccessCharacteristics, CriticalityIgnore, func(m *InitialContextSetupRequest) **RGLevelWirelineAccessCharacteristics { return &m.RGLevelWirelineAccessCharacteristics }), - listExtension(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *InitialContextSetupRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), - optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *InitialContextSetupRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), - optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), - optionalExtension(IDQMCConfigInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **QMCConfigInfo { return &m.QMCConfigInfo }), - optionalExtension(IDTargetNSSAIInformation, CriticalityIgnore, func(m *InitialContextSetupRequest) **TargetNSSAIInformation { return &m.TargetNSSAIInformation }), - listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *InitialContextSetupRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), - optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), - optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.ListIE(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *InitialContextSetupRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *InitialContextSetupRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + apimpl.OptionalIE(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + apimpl.OptionalIE(IDQMCConfigInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **QMCConfigInfo { return &m.QMCConfigInfo }), + apimpl.OptionalIE(IDTargetNSSAIInformation, CriticalityIgnore, func(m *InitialContextSetupRequest) **TargetNSSAIInformation { return &m.TargetNSSAIInformation }), + apimpl.ListIE(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *InitialContextSetupRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), + apimpl.OptionalIE(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + apimpl.OptionalIE(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.FiveGProSeUEPC5AggregateMaximumBitRate }), - optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), - optionalExtension(IDNetworkControlledRepeaterAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NetworkControlledRepeaterAuthorized { + apimpl.OptionalIE(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), + apimpl.OptionalIE(IDNetworkControlledRepeaterAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NetworkControlledRepeaterAuthorized { return &m.NetworkControlledRepeaterAuthorized }), - optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *InitialContextSetupRequest) **AerialUEsubscriptionInformation { + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *InitialContextSetupRequest) **AerialUEsubscriptionInformation { return &m.AerialUEsubscriptionInformation }), - optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), - optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), - optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + apimpl.OptionalIE(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.NRA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *InitialContextSetupRequest) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), - optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), - listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *InitialContextSetupRequest) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), - optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **SLPositioningRangingServiceInfo { + apimpl.OptionalIE(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + apimpl.OptionalIE(IDMobileIABAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + apimpl.ListIE(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *InitialContextSetupRequest) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + apimpl.OptionalIE(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **SLPositioningRangingServiceInfo { return &m.SLPositioningRangingServiceInfo }), - optionalExtension(IDExtendedOldAMF, CriticalityIgnore, func(m *InitialContextSetupRequest) **ExtendedAMFName { return &m.ExtendedOldAMF }), + apimpl.OptionalIE(IDExtendedOldAMF, CriticalityIgnore, func(m *InitialContextSetupRequest) **ExtendedAMFName { return &m.ExtendedOldAMF }), { ID: IDAMFUENGAPID2, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { diff --git a/ngap/initial_context_setup_test.go b/ngap/initial_context_setup_test.go index 9861901ab7..343a336028 100644 --- a/ngap/initial_context_setup_test.go +++ b/ngap/initial_context_setup_test.go @@ -8,7 +8,7 @@ import ( "slices" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -257,11 +257,11 @@ func TestInitialContextSetupRequestAMBRCondition(t *testing.T) { // (§10.3.5); the AMF cannot set up a context without them. func TestInitialContextSetupRequestMissingRejectIE(t *testing.T) { full := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, - ieField{ID: IDGUAMI, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(goldContextGUAMI())))}, - ieField{ID: IDUESecurityCapabilities, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(goldUESecurityCapabilities())))}, - ieField{ID: IDSecurityKey, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(goldSecurityKey())))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDGUAMI, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(goldContextGUAMI())))}, + ieField{ID: IDUESecurityCapabilities, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(goldUESecurityCapabilities())))}, + ieField{ID: IDSecurityKey, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(goldSecurityKey())))}, ) // Without the Allowed NSSAI the request is incomplete: it is mandatory and diff --git a/ngap/names_test.go b/ngap/names_test.go index 191dd17ab1..e9626a15a8 100644 --- a/ngap/names_test.go +++ b/ngap/names_test.go @@ -36,11 +36,11 @@ func TestProtocolIEIDString(t *testing.T) { } // Criticality Diagnostics reports the procedure's real criticality (§9.3.1.3). -// TS 38.413 splits the 81 procedures 41 reject / 40 ignore, so a hardcoded +// TS 38.413 splits the 87 procedures 47 reject / 40 ignore, so a hardcoded // value would be wrong about half the time. func TestProcedureCriticalityTable(t *testing.T) { - if got := len(procedureInfos); got != 81 { - t.Errorf("procedureInfos has %d entries, want 81", got) + if got := len(procedureInfos); got != 87 { + t.Errorf("procedureInfos has %d entries, want 87", got) } var reject, ignore, outcomes int @@ -60,12 +60,12 @@ func TestProcedureCriticalityTable(t *testing.T) { } } - if reject != 41 || ignore != 40 { - t.Errorf("criticality split = %d reject / %d ignore, want 41 / 40", reject, ignore) + if reject != 47 || ignore != 40 { + t.Errorf("criticality split = %d reject / %d ignore, want 47 / 40", reject, ignore) } - if outcomes != 18 { - t.Errorf("%d procedures define an unsuccessful outcome, want 18", outcomes) + if outcomes != 21 { + t.Errorf("%d procedures define an unsuccessful outcome, want 21", outcomes) } } diff --git a/ngap/nas_transport.go b/ngap/nas_transport.go index 6fd8c557c4..ce66e147de 100644 --- a/ngap/nas_transport.go +++ b/ngap/nas_transport.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413 §9.2.5.1. @@ -174,22 +175,22 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return m.AllowedNSSAI, true }, }, - optionalExtension(IDSourceToTargetAMFInformationReroute, CriticalityIgnore, func(m *InitialUEMessage) **SourceToTargetAMFInformationReroute { + apimpl.OptionalIE(IDSourceToTargetAMFInformationReroute, CriticalityIgnore, func(m *InitialUEMessage) **SourceToTargetAMFInformationReroute { return &m.SourceToTargetAMFInformationReroute }), - optionalExtension(IDSelectedPLMNIdentity, CriticalityIgnore, func(m *InitialUEMessage) **PLMNIdentity { return &m.SelectedPLMNIdentity }), - optionalExtension(IDIABNodeIndication, CriticalityReject, func(m *InitialUEMessage) **IABNodeIndication { return &m.IABNodeIndication }), - optionalExtension(IDCEmodeBSupportIndicator, CriticalityReject, func(m *InitialUEMessage) **CEmodeBSupportIndicator { return &m.CEmodeBSupportIndicator }), - optionalExtension(IDLTEMIndication, CriticalityIgnore, func(m *InitialUEMessage) **LTEMIndication { return &m.LTEMIndication }), - optionalExtension(IDEDTSession, CriticalityIgnore, func(m *InitialUEMessage) **EDTSession { return &m.EDTSession }), - optionalExtension(IDAuthenticatedIndication, CriticalityIgnore, func(m *InitialUEMessage) **AuthenticatedIndication { return &m.AuthenticatedIndication }), - optionalExtension(IDNPNAccessInformation, CriticalityReject, func(m *InitialUEMessage) **NPNAccessInformation { return &m.NPNAccessInformation }), - optionalExtension(IDRedCapIndication, CriticalityIgnore, func(m *InitialUEMessage) **RedCapIndication { return &m.RedCapIndication }), - optionalExtension(IDSelectedNID, CriticalityIgnore, func(m *InitialUEMessage) **NID { return &m.SelectedNID }), - optionalExtension(IDMobileIABNodeIndication, CriticalityReject, func(m *InitialUEMessage) **MobileIABNodeIndication { return &m.MobileIABNodeIndication }), - listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *InitialUEMessage) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), - optionalExtension(IDERedCapIndication, CriticalityIgnore, func(m *InitialUEMessage) **ERedCapIndication { return &m.ERedCapIndication }), - optionalExtension(IDAUN3DeviceAccessInfo, CriticalityIgnore, func(m *InitialUEMessage) **AUN3DeviceAccessInfo { return &m.AUN3DeviceAccessInfo }), + apimpl.OptionalIE(IDSelectedPLMNIdentity, CriticalityIgnore, func(m *InitialUEMessage) **PLMNIdentity { return &m.SelectedPLMNIdentity }), + apimpl.OptionalIE(IDIABNodeIndication, CriticalityReject, func(m *InitialUEMessage) **IABNodeIndication { return &m.IABNodeIndication }), + apimpl.OptionalIE(IDCEmodeBSupportIndicator, CriticalityReject, func(m *InitialUEMessage) **CEmodeBSupportIndicator { return &m.CEmodeBSupportIndicator }), + apimpl.OptionalIE(IDLTEMIndication, CriticalityIgnore, func(m *InitialUEMessage) **LTEMIndication { return &m.LTEMIndication }), + apimpl.OptionalIE(IDEDTSession, CriticalityIgnore, func(m *InitialUEMessage) **EDTSession { return &m.EDTSession }), + apimpl.OptionalIE(IDAuthenticatedIndication, CriticalityIgnore, func(m *InitialUEMessage) **AuthenticatedIndication { return &m.AuthenticatedIndication }), + apimpl.OptionalIE(IDNPNAccessInformation, CriticalityReject, func(m *InitialUEMessage) **NPNAccessInformation { return &m.NPNAccessInformation }), + apimpl.OptionalIE(IDRedCapIndication, CriticalityIgnore, func(m *InitialUEMessage) **RedCapIndication { return &m.RedCapIndication }), + apimpl.OptionalIE(IDSelectedNID, CriticalityIgnore, func(m *InitialUEMessage) **NID { return &m.SelectedNID }), + apimpl.OptionalIE(IDMobileIABNodeIndication, CriticalityReject, func(m *InitialUEMessage) **MobileIABNodeIndication { return &m.MobileIABNodeIndication }), + apimpl.ListIE(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *InitialUEMessage) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + apimpl.OptionalIE(IDERedCapIndication, CriticalityIgnore, func(m *InitialUEMessage) **ERedCapIndication { return &m.ERedCapIndication }), + apimpl.OptionalIE(IDAUN3DeviceAccessInfo, CriticalityIgnore, func(m *InitialUEMessage) **AUN3DeviceAccessInfo { return &m.AUN3DeviceAccessInfo }), { ID: IDGUAMI, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { @@ -353,9 +354,9 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ return m.UserLocationInformation, true }, }, - optionalExtension(IDWAGFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.WAGFIdentityInformation }), - optionalExtension(IDTNGFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.TNGFIdentityInformation }), - optionalExtension(IDTWIFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.TWIFIdentityInformation }), + apimpl.OptionalIE(IDWAGFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.WAGFIdentityInformation }), + apimpl.OptionalIE(IDTNGFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.TNGFIdentityInformation }), + apimpl.OptionalIE(IDTWIFIdentityInformation, CriticalityReject, func(m *UplinkNASTransport) **IdentityInformation { return &m.TWIFIdentityInformation }), } func (m *UplinkNASTransport) Marshal() ([]byte, error) { @@ -434,8 +435,8 @@ var downlinkNASTransportIEs = []ieSpec[DownlinkNASTransport]{ }, Encode: func(m *DownlinkNASTransport) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, - optionalExtension(IDOldAMF, CriticalityReject, func(m *DownlinkNASTransport) **Name { return &m.OldAMF }), - optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *DownlinkNASTransport) **RANPagingPriority { return &m.RANPagingPriority }), + apimpl.OptionalIE(IDOldAMF, CriticalityReject, func(m *DownlinkNASTransport) **Name { return &m.OldAMF }), + apimpl.OptionalIE(IDRANPagingPriority, CriticalityIgnore, func(m *DownlinkNASTransport) **RANPagingPriority { return &m.RANPagingPriority }), { ID: IDNASPDU, Presence: presenceMandatory, Criticality: CriticalityReject, Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { @@ -449,24 +450,24 @@ var downlinkNASTransportIEs = []ieSpec[DownlinkNASTransport]{ return &m.NASPDU, true }, }, - optionalExtension(IDMobilityRestrictionList, CriticalityIgnore, func(m *DownlinkNASTransport) **MobilityRestrictionList { return &m.MobilityRestrictionList }), - optionalExtension(IDIndexToRFSP, CriticalityIgnore, func(m *DownlinkNASTransport) **IndexToRFSP { return &m.IndexToRFSP }), - optionalExtension(IDUEAggregateMaximumBitRate, CriticalityIgnore, func(m *DownlinkNASTransport) **UEAggregateMaximumBitRate { return &m.UEAggregateMaximumBitRate }), - listExtension(IDAllowedNSSAI, CriticalityReject, func(m *DownlinkNASTransport) *AllowedNSSAI { return &m.AllowedNSSAI }), - optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *DownlinkNASTransport) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), - optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *DownlinkNASTransport) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), - optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *DownlinkNASTransport) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), - optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *DownlinkNASTransport) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), - optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *DownlinkNASTransport) **CEmodeBrestricted { return &m.CEmodeBrestricted }), - listExtension(IDUERadioCapability, CriticalityIgnore, func(m *DownlinkNASTransport) *UERadioCapability { return &m.UERadioCapability }), - optionalExtension(IDUECapabilityInfoRequest, CriticalityIgnore, func(m *DownlinkNASTransport) **UECapabilityInfoRequest { return &m.UECapabilityInfoRequest }), - optionalExtension(IDEndIndication, CriticalityIgnore, func(m *DownlinkNASTransport) **EndIndication { return &m.EndIndication }), - optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *DownlinkNASTransport) **UERadioCapabilityID { return &m.UERadioCapabilityID }), - optionalExtension(IDTargetNSSAIInformation, CriticalityIgnore, func(m *DownlinkNASTransport) **TargetNSSAIInformation { return &m.TargetNSSAIInformation }), - optionalExtension(IDMaskedIMEISV, CriticalityIgnore, func(m *DownlinkNASTransport) **MaskedIMEISV { return &m.MaskedIMEISV }), - listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *DownlinkNASTransport) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), - optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *DownlinkNASTransport) **MobileIABAuthorized { return &m.MobileIABAuthorized }), - optionalExtension(IDExtendedOldAMF, CriticalityIgnore, func(m *DownlinkNASTransport) **ExtendedAMFName { return &m.ExtendedOldAMF }), + apimpl.OptionalIE(IDMobilityRestrictionList, CriticalityIgnore, func(m *DownlinkNASTransport) **MobilityRestrictionList { return &m.MobilityRestrictionList }), + apimpl.OptionalIE(IDIndexToRFSP, CriticalityIgnore, func(m *DownlinkNASTransport) **IndexToRFSP { return &m.IndexToRFSP }), + apimpl.OptionalIE(IDUEAggregateMaximumBitRate, CriticalityIgnore, func(m *DownlinkNASTransport) **UEAggregateMaximumBitRate { return &m.UEAggregateMaximumBitRate }), + apimpl.ListIE(IDAllowedNSSAI, CriticalityReject, func(m *DownlinkNASTransport) *AllowedNSSAI { return &m.AllowedNSSAI }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *DownlinkNASTransport) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *DownlinkNASTransport) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), + apimpl.OptionalIE(IDExtendedConnectedTime, CriticalityIgnore, func(m *DownlinkNASTransport) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + apimpl.OptionalIE(IDUEDifferentiationInfo, CriticalityIgnore, func(m *DownlinkNASTransport) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + apimpl.OptionalIE(IDCEmodeBrestricted, CriticalityIgnore, func(m *DownlinkNASTransport) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + apimpl.ListIE(IDUERadioCapability, CriticalityIgnore, func(m *DownlinkNASTransport) *UERadioCapability { return &m.UERadioCapability }), + apimpl.OptionalIE(IDUECapabilityInfoRequest, CriticalityIgnore, func(m *DownlinkNASTransport) **UECapabilityInfoRequest { return &m.UECapabilityInfoRequest }), + apimpl.OptionalIE(IDEndIndication, CriticalityIgnore, func(m *DownlinkNASTransport) **EndIndication { return &m.EndIndication }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *DownlinkNASTransport) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + apimpl.OptionalIE(IDTargetNSSAIInformation, CriticalityIgnore, func(m *DownlinkNASTransport) **TargetNSSAIInformation { return &m.TargetNSSAIInformation }), + apimpl.OptionalIE(IDMaskedIMEISV, CriticalityIgnore, func(m *DownlinkNASTransport) **MaskedIMEISV { return &m.MaskedIMEISV }), + apimpl.ListIE(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *DownlinkNASTransport) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + apimpl.OptionalIE(IDMobileIABAuthorized, CriticalityIgnore, func(m *DownlinkNASTransport) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + apimpl.OptionalIE(IDExtendedOldAMF, CriticalityIgnore, func(m *DownlinkNASTransport) **ExtendedAMFName { return &m.ExtendedOldAMF }), } func (m *DownlinkNASTransport) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/nas_transport_test.go b/ngap/nas_transport_test.go index 1146d1a73c..077b199ea7 100644 --- a/ngap/nas_transport_test.go +++ b/ngap/nas_transport_test.go @@ -9,6 +9,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden UPLINK NAS TRANSPORT PDUs @@ -194,7 +195,7 @@ func TestUserLocationInformationN3IWFWithoutPortNumberIsTyped(t *testing.T) { t.Fatal(err) } - if err := encodeContainerField(want, ieField{ID: IDUserLocationInformationN3IWFwithoutPortNumber, Criticality: CriticalityIgnore, Value: ap.RawValue(inner)}); err != nil { + if err := encodeContainerField(want, ieField{ID: IDUserLocationInformationN3IWFwithoutPortNumber, Criticality: CriticalityIgnore, Value: apimpl.RawValue(inner)}); err != nil { t.Fatal(err) } @@ -219,7 +220,7 @@ func TestUserLocationInformationUnknownChoiceExtensionIsPreserved(t *testing.T) t.Fatal(err) } - if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: ap.RawValue([]byte{0x00})}); err != nil { + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: crit, Value: apimpl.RawValue([]byte{0x00})}); err != nil { t.Fatal(err) } @@ -626,7 +627,7 @@ func initialUEMessageWireCases(t *testing.T) []wireCase { { name: "InitialUEMessageGUAMIAfterSelectedPLMNIdentity", pdu: insertRawIEs(t, marshalT(t, goldInitialUEMessageFemto()), 4, - ieField{ID: IDSelectedPLMNIdentity, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00, 0xf1, 0x10})}), + ieField{ID: IDSelectedPLMNIdentity, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00, 0xf1, 0x10})}), parse: func(v []byte) (any, error) { return ParseInitialUEMessage(v) }, check: func(t *testing.T, a any) { t.Helper() diff --git a/ngap/ng_reset_test.go b/ngap/ng_reset_test.go index 5b52c34490..5ec152e97b 100644 --- a/ngap/ng_reset_test.go +++ b/ngap/ng_reset_test.go @@ -9,6 +9,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden NG RESET PDUs @@ -181,7 +182,7 @@ func TestResetTypeChoiceExtensionIsPreserved(t *testing.T) { t.Fatal(err) } - if err := encodeContainerField(w, ieField{ID: 9999, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}); err != nil { + if err := encodeContainerField(w, ieField{ID: 9999, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x00})}); err != nil { t.Fatal(err) } diff --git a/ngap/ng_setup.go b/ngap/ng_setup.go index 0857fe542e..55ddd08c47 100644 --- a/ngap/ng_setup.go +++ b/ngap/ng_setup.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413 §9.2.6.1. @@ -101,10 +102,10 @@ var nGSetupRequestIEs = []ieSpec[NGSetupRequest]{ return m.UERetentionInformation, true }, }, - optionalExtension(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *NGSetupRequest) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), - optionalExtension(IDExtendedRANNodeName, CriticalityIgnore, func(m *NGSetupRequest) **ExtendedRANNodeName { return &m.ExtendedRANNodeName }), - optionalExtension(IDAIoTSupport, CriticalityReject, func(m *NGSetupRequest) **AIoTSupport { return &m.AIoTSupport }), - optionalExtension(IDAdditionalULI, CriticalityIgnore, func(m *NGSetupRequest) **AdditionalULI { return &m.AdditionalULI }), + apimpl.OptionalIE(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *NGSetupRequest) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), + apimpl.OptionalIE(IDExtendedRANNodeName, CriticalityIgnore, func(m *NGSetupRequest) **ExtendedRANNodeName { return &m.ExtendedRANNodeName }), + apimpl.OptionalIE(IDAIoTSupport, CriticalityReject, func(m *NGSetupRequest) **AIoTSupport { return &m.AIoTSupport }), + apimpl.OptionalIE(IDAdditionalULI, CriticalityIgnore, func(m *NGSetupRequest) **AdditionalULI { return &m.AdditionalULI }), } func (m *NGSetupRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ng_setup_resp.go b/ngap/ng_setup_resp.go index 3241eb61ee..f0f7e87e16 100644 --- a/ngap/ng_setup_resp.go +++ b/ngap/ng_setup_resp.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413 §9.2.6.2. @@ -122,7 +123,7 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return m.UERetentionInformation, true }, }, - optionalExtension(IDIABSupported, CriticalityIgnore, func(m *NGSetupResponse) **IABSupported { return &m.IABSupported }), + apimpl.OptionalIE(IDIABSupported, CriticalityIgnore, func(m *NGSetupResponse) **IABSupported { return &m.IABSupported }), { ID: IDExtendedAMFName, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *NGSetupResponse, r *per.Reader, enc per.Encoding) error { @@ -144,9 +145,9 @@ var nGSetupResponseIEs = []ieSpec[NGSetupResponse]{ return m.ExtendedAMFName, true }, }, - optionalExtension(IDMobileIABSupported, CriticalityIgnore, func(m *NGSetupResponse) **MobileIABSupported { return &m.MobileIABSupported }), - optionalExtension(IDAIOTFIdentifier, CriticalityReject, func(m *NGSetupResponse) **AIOTFIdentifier { return &m.AIOTFIdentifier }), - optionalExtension(IDAIOTFName, CriticalityReject, func(m *NGSetupResponse) **AIOTFName { return &m.AIOTFName }), + apimpl.OptionalIE(IDMobileIABSupported, CriticalityIgnore, func(m *NGSetupResponse) **MobileIABSupported { return &m.MobileIABSupported }), + apimpl.OptionalIE(IDAIOTFIdentifier, CriticalityReject, func(m *NGSetupResponse) **AIOTFIdentifier { return &m.AIOTFIdentifier }), + apimpl.OptionalIE(IDAIOTFName, CriticalityReject, func(m *NGSetupResponse) **AIOTFName { return &m.AIOTFName }), } func (m *NGSetupResponse) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/not_comprehended_test.go b/ngap/not_comprehended_test.go index 5517cdb30e..422a0c4b36 100644 --- a/ngap/not_comprehended_test.go +++ b/ngap/not_comprehended_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // A CHOICE selecting its choice-Extensions alternative, carrying one entry. @@ -28,7 +28,7 @@ func choiceExtensionValueCrit(t *testing.T, alternatives, index int, id Protocol } if err := encodeContainerField(w, ieField{ - ID: id, Criticality: crit, Value: ap.RawValue([]byte{0x00}), + ID: id, Criticality: crit, Value: apimpl.RawValue([]byte{0x00}), }); err != nil { t.Fatal(err) } @@ -44,7 +44,7 @@ func TestChoiceExtensionOnRejectIEIsAbstractSyntaxError(t *testing.T) { value := container(t, ieField{ ID: IDGlobalRANNodeID, Criticality: CriticalityReject, - Value: ap.RawValue(choiceExtensionValue(t, globalRANNodeIDAlternatives, globalRANNodeIDChoiceExtensions, IDGlobalRANNodeID)), + Value: apimpl.RawValue(choiceExtensionValue(t, globalRANNodeIDAlternatives, globalRANNodeIDChoiceExtensions, IDGlobalRANNodeID)), }) _, err := ParseNGSetupRequest(value) @@ -61,9 +61,9 @@ func TestChoiceExtensionOnRejectIEIsAbstractSyntaxError(t *testing.T) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } - if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDGlobalRANNodeID || - ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { - t.Errorf("diagnostics = %+v, want one not-understood entry for GlobalRANNodeID", ase.IEs) + if len(ase.IEs) != 2 || ase.IEs[1].IEID != IDGlobalRANNodeID || + ase.IEs[1].TypeOfError != TypeOfErrorNotUnderstood { + t.Errorf("diagnostics = %+v, want the unknown choice-Extensions IE and then GlobalRANNodeID, which no alternative is left to comprehend", ase.IEs) } } @@ -73,7 +73,7 @@ func TestChoiceExtensionInsideIgnoreIEIsJudgedOnItsOwnCriticality(t *testing.T) ieField{ ID: IDCause, Criticality: CriticalityIgnore, - Value: ap.RawValue(choiceExtensionValueCrit(t, causeAlternatives, causeChoiceExtensions, 9999, crit)), + Value: apimpl.RawValue(choiceExtensionValueCrit(t, causeAlternatives, causeChoiceExtensions, 9999, crit)), }, ieField{ID: IDResetType, Criticality: CriticalityReject, Value: &ResetType{NGInterface: Ptr(ResetAllResetAll)}}, ) @@ -93,8 +93,17 @@ func TestChoiceExtensionInsideIgnoreIEIsJudgedOnItsOwnCriticality(t *testing.T) t.Fatalf("parse: %v, want the message delivered", err) } - if msg.Cause == nil || msg.Cause.ChoiceExtension == nil || msg.Cause.ChoiceExtension.ID != 9999 { - t.Errorf("Cause = %+v, want the unknown choice-Extensions kept", msg.Cause) + if msg.Cause != nil { + t.Errorf("Cause = %+v, want an ignore IE with no comprehended alternative treated as not received", msg.Cause) + } + + decoded, err := DecodeNGReset(value) + if err != nil { + t.Fatal(err) + } + + if decoded.Cause == nil || decoded.Cause.ChoiceExtension == nil || decoded.Cause.ChoiceExtension.ID != 9999 { + t.Errorf("decoded Cause = %+v, want the unknown choice-Extensions kept", decoded.Cause) } if msg.ResetType.NGInterface == nil { @@ -133,8 +142,8 @@ func TestChoiceExtensionInsideIgnoreIEIsJudgedOnItsOwnCriticality(t *testing.T) // produce two entries, not just the first. func TestAllNotComprehendedRejectIEsAreReported(t *testing.T) { value := container(t, - ieField{ID: ProtocolIEID(40001), Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}, - ieField{ID: ProtocolIEID(40002), Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}, + ieField{ID: ProtocolIEID(40001), Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x00})}, + ieField{ID: ProtocolIEID(40002), Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x00})}, ) _, err := ParseNGSetupRequest(value) diff --git a/ngap/package_decls_test.go b/ngap/package_decls_test.go new file mode 100644 index 0000000000..edd0e40457 --- /dev/null +++ b/ngap/package_decls_test.go @@ -0,0 +1,229 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "path/filepath" + "reflect" + "slices" + "strconv" + "strings" + "sync" + "testing" +) + +type packageDecls struct { + enums map[string]bool + choices map[string]bool + ieTables map[string]bool + extTables map[string]bool +} + +var ( + declsOnce sync.Once + decls packageDecls + declsErr error +) + +func typeArgName(e ast.Expr) string { + if id, ok := e.(*ast.Ident); ok { + return id.Name + } + + return "" +} + +func isSelector(e ast.Expr, pkg, name string) bool { + sel, ok := e.(*ast.SelectorExpr) + if !ok { + return false + } + + id, ok := sel.X.(*ast.Ident) + + return ok && id.Name == pkg && sel.Sel.Name == name +} + +func ieTableElem(e ast.Expr) string { + at, ok := e.(*ast.ArrayType) + if !ok || at.Len != nil { + return "" + } + + switch x := at.Elt.(type) { + case *ast.IndexExpr: + if id, ok := x.X.(*ast.Ident); ok && id.Name == "ieSpec" { + return typeArgName(x.Index) + } + case *ast.IndexListExpr: + if isSelector(x.X, "apimpl", "IESpec") && len(x.Indices) == 2 { + return typeArgName(x.Indices[1]) + } + } + + return "" +} + +func scanPackage() (packageDecls, error) { + d := packageDecls{enums: map[string]bool{}, choices: map[string]bool{}, ieTables: map[string]bool{}, extTables: map[string]bool{}} + + names, err := filepath.Glob("*.go") + if err != nil { + return d, err + } + + fset := token.NewFileSet() + + for _, name := range names { + if strings.HasSuffix(name, "_test.go") { + continue + } + + f, err := parser.ParseFile(fset, name, nil, 0) + if err != nil { + return d, err + } + + for _, decl := range f.Decls { + gd, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + + for _, spec := range gd.Specs { + switch s := spec.(type) { + case *ast.TypeSpec: + st, ok := s.Type.(*ast.StructType) + if !ok { + continue + } + + for _, fld := range st.Fields.List { + if fld.Tag == nil { + continue + } + + tag, err := strconv.Unquote(fld.Tag.Value) + if err != nil { + return d, err + } + + if strings.Contains(reflect.StructTag(tag).Get("per"), "choice:") { + d.choices[s.Name.Name] = true + } + } + case *ast.ValueSpec: + if gd.Tok != token.VAR { + continue + } + + for i, n := range s.Names { + if name, ok := strings.CutSuffix(n.Name, "IEs"); ok && !strings.HasPrefix(n.Name, "extIEs") { + m := strings.ToUpper(name[:1]) + name[1:] + + if i < len(s.Values) { + if cl, ok := s.Values[i].(*ast.CompositeLit); ok { + if m = ieTableElem(cl.Type); m == "" { + return d, fmt.Errorf("%s: %s is not a []ieSpec", fset.Position(n.Pos()), n.Name) + } + } + } + + d.ieTables[m] = true + + continue + } + + typ := s.Type + + if typ == nil && i < len(s.Values) { + if cl, ok := s.Values[i].(*ast.CompositeLit); ok { + typ = cl.Type + } + } + + if typ == nil { + continue + } + + if ix, ok := typ.(*ast.IndexExpr); ok && isSelector(ix.X, "per", "Enum") { + d.enums[typeArgName(ix.Index)] = true + + continue + } + + if m := ieTableElem(typ); m != "" && strings.HasPrefix(n.Name, "extIEs") { + d.extTables[m] = true + } + } + } + } + } + } + + return d, nil +} + +func scannedDecls(t *testing.T) packageDecls { + t.Helper() + + declsOnce.Do(func() { decls, declsErr = scanPackage() }) + + if declsErr != nil { + t.Fatal(declsErr) + } + + return decls +} + +func checkComplete(t *testing.T, what string, declared map[string]bool, covered []reflect.Type) { + t.Helper() + + if len(declared) == 0 { + t.Fatalf("no %s found in the package source", what) + } + + have := map[string]bool{} + + for _, ty := range covered { + if ty.PkgPath() != reflect.TypeFor[ProtocolIEID]().PkgPath() { + t.Errorf("%s case %v is not a type of this package", what, ty) + } + + if have[ty.Name()] { + t.Errorf("%s %s is listed twice", what, ty.Name()) + } + + have[ty.Name()] = true + } + + var missing, extra []string + + for n := range declared { + if !have[n] { + missing = append(missing, n) + } + } + + for n := range have { + if !declared[n] { + extra = append(extra, n) + } + } + + slices.Sort(missing) + slices.Sort(extra) + + for _, n := range missing { + t.Errorf("%s %s is declared in the package but has no case", what, n) + } + + for _, n := range extra { + t.Errorf("%s case %s does not match a declaration in the package", what, n) + } +} diff --git a/ngap/paging.go b/ngap/paging.go index 2af1cd51c9..c183510d7d 100644 --- a/ngap/paging.go +++ b/ngap/paging.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // maxnoofTAIforPaging bounds TAIListForPaging (TS 38.413, NGAP-Constants). @@ -262,18 +263,18 @@ var pagingIEs = []ieSpec[Paging]{ return m.PagingOrigin, true }, }, - optionalExtension(IDAssistanceDataForPaging, CriticalityIgnore, func(m *Paging) **AssistanceDataForPaging { return &m.AssistanceDataForPaging }), - optionalExtension(IDNBIoTPagingeDRXInfo, CriticalityIgnore, func(m *Paging) **NBIoTPagingeDRXInfo { return &m.NBIoTPagingeDRXInfo }), - optionalExtension(IDNBIoTPagingDRX, CriticalityIgnore, func(m *Paging) **NBIoTPagingDRX { return &m.NBIoTPagingDRX }), - optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *Paging) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), - optionalExtension(IDWUSAssistanceInformation, CriticalityIgnore, func(m *Paging) **WUSAssistanceInformation { return &m.WUSAssistanceInformation }), - optionalExtension(IDEUTRAPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **EUTRAPagingeDRXInformation { return &m.EUTRAPagingeDRXInformation }), - optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *Paging) **CEmodeBrestricted { return &m.CEmodeBrestricted }), - optionalExtension(IDNRPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **NRPagingeDRXInformation { return &m.NRPagingeDRXInformation }), - optionalExtension(IDPagingCause, CriticalityIgnore, func(m *Paging) **PagingCause { return &m.PagingCause }), - optionalExtension(IDPEIPSassistanceInformation, CriticalityIgnore, func(m *Paging) **PEIPSassistanceInformation { return &m.PEIPSassistanceInformation }), - optionalExtension(IDLPWUSPSAssistanceInformation, CriticalityIgnore, func(m *Paging) **LPWUSPSAssistanceInformation { return &m.LPWUSPSAssistanceInformation }), - optionalExtension(IDLPWUSDisableIndication, CriticalityIgnore, func(m *Paging) **LPWUSDisableIndication { return &m.LPWUSDisableIndication }), + apimpl.OptionalIE(IDAssistanceDataForPaging, CriticalityIgnore, func(m *Paging) **AssistanceDataForPaging { return &m.AssistanceDataForPaging }), + apimpl.OptionalIE(IDNBIoTPagingeDRXInfo, CriticalityIgnore, func(m *Paging) **NBIoTPagingeDRXInfo { return &m.NBIoTPagingeDRXInfo }), + apimpl.OptionalIE(IDNBIoTPagingDRX, CriticalityIgnore, func(m *Paging) **NBIoTPagingDRX { return &m.NBIoTPagingDRX }), + apimpl.OptionalIE(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *Paging) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), + apimpl.OptionalIE(IDWUSAssistanceInformation, CriticalityIgnore, func(m *Paging) **WUSAssistanceInformation { return &m.WUSAssistanceInformation }), + apimpl.OptionalIE(IDEUTRAPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **EUTRAPagingeDRXInformation { return &m.EUTRAPagingeDRXInformation }), + apimpl.OptionalIE(IDCEmodeBrestricted, CriticalityIgnore, func(m *Paging) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + apimpl.OptionalIE(IDNRPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **NRPagingeDRXInformation { return &m.NRPagingeDRXInformation }), + apimpl.OptionalIE(IDPagingCause, CriticalityIgnore, func(m *Paging) **PagingCause { return &m.PagingCause }), + apimpl.OptionalIE(IDPEIPSassistanceInformation, CriticalityIgnore, func(m *Paging) **PEIPSassistanceInformation { return &m.PEIPSassistanceInformation }), + apimpl.OptionalIE(IDLPWUSPSAssistanceInformation, CriticalityIgnore, func(m *Paging) **LPWUSPSAssistanceInformation { return &m.LPWUSPSAssistanceInformation }), + apimpl.OptionalIE(IDLPWUSDisableIndication, CriticalityIgnore, func(m *Paging) **LPWUSDisableIndication { return &m.LPWUSDisableIndication }), } func (m *Paging) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/paging_test.go b/ngap/paging_test.go index dd29e82472..2c62904619 100644 --- a/ngap/paging_test.go +++ b/ngap/paging_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden PAGING PDUs @@ -154,23 +154,32 @@ func TestUEPagingIdentityChoiceExtensionIsPreserved(t *testing.T) { } if err := encodeContainerField(w, ieField{ - ID: 9999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), + ID: 9999, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00}), }); err != nil { t.Fatal(err) } value := container(t, - ieField{ID: IDUEPagingIdentity, Criticality: CriticalityIgnore, Value: ap.RawValue(perBytes(w))}, + ieField{ID: IDUEPagingIdentity, Criticality: CriticalityIgnore, Value: apimpl.RawValue(perBytes(w))}, ieField{ID: IDTAIListForPaging, Criticality: CriticalityIgnore, Value: &TAIListForPaging{ {TAI: TAI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, TAC: 1}}, }}, ) - msg, err := ParsePaging(value) + parsed, err := ParsePaging(value) if err != nil { t.Fatalf("parse: %v", err) } + if parsed.UEPagingIdentity != nil { + t.Errorf("parsed UEPagingIdentity = %+v, want it treated as not received", parsed.UEPagingIdentity) + } + + msg, err := DecodePaging(value) + if err != nil { + t.Fatalf("decode: %v", err) + } + if msg.UEPagingIdentity == nil || msg.UEPagingIdentity.ChoiceExtension == nil || msg.UEPagingIdentity.FiveGSTMSI != nil { t.Errorf("UEPagingIdentity = %+v, want the raw choice-Extensions kept", msg.UEPagingIdentity) } diff --git a/ngap/path_switch.go b/ngap/path_switch.go index fc99794b21..fa68c539b2 100644 --- a/ngap/path_switch.go +++ b/ngap/path_switch.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413 §9.2.3.8. The target NG-RAN node asks the AMF to switch the @@ -110,9 +111,9 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return m.PDUSessionResourceFailedToSetup, true }, }, - optionalExtension(IDRRCResumeCause, CriticalityIgnore, func(m *PathSwitchRequest) **RRCEstablishmentCause { return &m.RRCResumeCause }), - optionalExtension(IDRedCapIndication, CriticalityIgnore, func(m *PathSwitchRequest) **RedCapIndication { return &m.RedCapIndication }), - optionalExtension(IDERedCapIndication, CriticalityIgnore, func(m *PathSwitchRequest) **ERedCapIndication { return &m.ERedCapIndication }), + apimpl.OptionalIE(IDRRCResumeCause, CriticalityIgnore, func(m *PathSwitchRequest) **RRCEstablishmentCause { return &m.RRCResumeCause }), + apimpl.OptionalIE(IDRedCapIndication, CriticalityIgnore, func(m *PathSwitchRequest) **RedCapIndication { return &m.RedCapIndication }), + apimpl.OptionalIE(IDERedCapIndication, CriticalityIgnore, func(m *PathSwitchRequest) **ERedCapIndication { return &m.ERedCapIndication }), { ID: IDSourceAMFGUAMI, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { @@ -288,7 +289,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return &m.SecurityContext, true }, }, - optionalExtension(IDNewSecurityContextInd, CriticalityReject, func(m *PathSwitchRequestAcknowledge) **NewSecurityContextInd { return &m.NewSecurityContextInd }), + apimpl.OptionalIE(IDNewSecurityContextInd, CriticalityReject, func(m *PathSwitchRequestAcknowledge) **NewSecurityContextInd { return &m.NewSecurityContextInd }), { ID: IDPDUSessionResourceSwitchedList, Presence: presenceMandatory, Criticality: CriticalityIgnore, Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { @@ -328,10 +329,10 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.AllowedNSSAI, true }, }, - optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CoreNetworkAssistanceInformationForInactive { + apimpl.OptionalIE(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CoreNetworkAssistanceInformationForInactive { return &m.CoreNetworkAssistanceInformationForInactive }), - optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **RRCInactiveTransitionReportRequest { + apimpl.OptionalIE(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **RRCInactiveTransitionReportRequest { return &m.RRCInactiveTransitionReportRequest }), { @@ -355,54 +356,54 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.CriticalityDiagnostics, true }, }, - optionalExtension(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), - optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), - optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), - optionalExtension(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **EnhancedCoverageRestriction { + apimpl.OptionalIE(IDRedirectionVoiceFallback, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **RedirectionVoiceFallback { return &m.RedirectionVoiceFallback }), + apimpl.OptionalIE(IDCNAssistedRANTuning, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDEnhancedCoverageRestriction, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **EnhancedCoverageRestriction { return &m.EnhancedCoverageRestriction }), - optionalExtension(IDExtendedConnectedTime, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), - optionalExtension(IDUEDifferentiationInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), - optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), - optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), - optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDExtendedConnectedTime, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **ExtendedConnectedTime { return &m.ExtendedConnectedTime }), + apimpl.OptionalIE(IDUEDifferentiationInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UEDifferentiationInfo { return &m.UEDifferentiationInfo }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { return &m.NRUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **PC5QoSParameters { return &m.PC5QoSParameters }), - optionalExtension(IDCEmodeBrestricted, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CEmodeBrestricted { return &m.CEmodeBrestricted }), - optionalExtension(IDUEUPCIoTSupport, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), - optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *PathSwitchRequestAcknowledge) **UERadioCapabilityID { return &m.UERadioCapabilityID }), - listExtension(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), - optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), - optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), - optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDCEmodeBrestricted, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CEmodeBrestricted { return &m.CEmodeBrestricted }), + apimpl.OptionalIE(IDUEUPCIoTSupport, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UEUPCIoTSupport { return &m.UEUPCIoTSupport }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *PathSwitchRequestAcknowledge) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + apimpl.ListIE(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + apimpl.OptionalIE(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + apimpl.OptionalIE(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + apimpl.OptionalIE(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { return &m.FiveGProSeUEPC5AggregateMaximumBitRate }), - optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **FiveGProSePC5QoSParameters { + apimpl.OptionalIE(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), - listExtension(IDManagementBasedMDTPLMNModificationList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *MDTPLMNModificationList { + apimpl.ListIE(IDManagementBasedMDTPLMNModificationList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *MDTPLMNModificationList { return &m.ManagementBasedMDTPLMNModificationList }), - optionalExtension(IDIABAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **IABAuthorized { return &m.IABAuthorized }), - optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **AerialUEsubscriptionInformation { + apimpl.OptionalIE(IDIABAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **IABAuthorized { return &m.IABAuthorized }), + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **AerialUEsubscriptionInformation { return &m.AerialUEsubscriptionInformation }), - optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), - optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), - optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + apimpl.OptionalIE(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { return &m.NRA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), - optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **MobileIABAuthorized { return &m.MobileIABAuthorized }), - listExtension(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), - optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **SLPositioningRangingServiceInfo { + apimpl.OptionalIE(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + apimpl.OptionalIE(IDMobileIABAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + apimpl.ListIE(IDPartiallyAllowedNSSAI, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *PartiallyAllowedNSSAI { return &m.PartiallyAllowedNSSAI }), + apimpl.OptionalIE(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **SLPositioningRangingServiceInfo { return &m.SLPositioningRangingServiceInfo }), { diff --git a/ngap/pdu.go b/ngap/pdu.go index aec76811a3..bac3b330cf 100644 --- a/ngap/pdu.go +++ b/ngap/pdu.go @@ -7,7 +7,7 @@ import ( "bytes" "fmt" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // NGAP-PDU CHOICE root alternatives (TS 38.413), in declaration order. @@ -77,7 +77,7 @@ func Marshal(pdu PDU) ([]byte, error) { return nil, fmt.Errorf("ngap: nil PDU") } - return profile.EncodePDU(ap.Envelope{ + return apimpl.EncodePDU(profile, apimpl.Envelope{ Choice: pdu.choiceIndex(), ProcedureCode: uint8(pdu.procedureCode()), Criticality: pdu.criticality(), @@ -87,7 +87,7 @@ func Marshal(pdu PDU) ([]byte, error) { // The open-type payload is left in Value for the message layer. func Unmarshal(b []byte) (PDU, error) { - e, err := profile.DecodePDU(b) + e, err := apimpl.DecodePDU[ProcedureCode](profile, b) if err != nil { return nil, err } diff --git a/ngap/pdu_session_resource_modify.go b/ngap/pdu_session_resource_modify.go index c87b9813c7..e7755c8be0 100644 --- a/ngap/pdu_session_resource_modify.go +++ b/ngap/pdu_session_resource_modify.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // PDUSessionResourceModifyItemModReq ::= SEQUENCE { pDUSessionID, nAS-PDU @@ -77,7 +78,7 @@ var pDUSessionResourceModifyRequestIEs = []ieSpec[PDUSessionResourceModifyReques }, Encode: func(m *PDUSessionResourceModifyRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, - optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceModifyRequest) **RANPagingPriority { return &m.RANPagingPriority }), + apimpl.OptionalIE(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceModifyRequest) **RANPagingPriority { return &m.RANPagingPriority }), { ID: IDPDUSessionResourceModifyListModReq, Presence: presenceMandatory, Criticality: CriticalityReject, Decode: func(m *PDUSessionResourceModifyRequest, r *per.Reader, enc per.Encoding) error { @@ -393,26 +394,26 @@ var pDUSessionResourceModifyRequestTransferIEs = []ieSpec[PDUSessionResourceModi return m.AdditionalULNGUUPTNLInformation, true }, }, - listExtension(IDCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *CommonNetworkInstance { + apimpl.ListIE(IDCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *CommonNetworkInstance { return &m.CommonNetworkInstance }), - listExtension(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *UPTransportLayerInformationList { + apimpl.ListIE(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *UPTransportLayerInformationList { return &m.AdditionalRedundantULNGUUPTNLInformation }), - listExtension(IDRedundantCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *CommonNetworkInstance { + apimpl.ListIE(IDRedundantCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *CommonNetworkInstance { return &m.RedundantCommonNetworkInstance }), - optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UPTransportLayerInformation { + apimpl.OptionalIE(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UPTransportLayerInformation { return &m.RedundantULNGUUPTNLInformation }), - optionalExtension(IDSecurityIndication, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **SecurityIndication { return &m.SecurityIndication }), - listExtension(IDMBSSessionSetuporModifyRequestList, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *MBSSessionSetuporModifyRequestList { + apimpl.OptionalIE(IDSecurityIndication, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **SecurityIndication { return &m.SecurityIndication }), + apimpl.ListIE(IDMBSSessionSetuporModifyRequestList, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *MBSSessionSetuporModifyRequestList { return &m.MBSSessionSetuporModifyRequestList }), - listExtension(IDMBSSessionToReleaseList, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *MBSSessionToReleaseList { + apimpl.ListIE(IDMBSSessionToReleaseList, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) *MBSSessionToReleaseList { return &m.MBSSessionToReleaseList }), - optionalExtension(IDUserPlaneFailureIndication, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UserPlaneFailureIndication { + apimpl.OptionalIE(IDUserPlaneFailureIndication, CriticalityIgnore, func(m *PDUSessionResourceModifyRequestTransfer) **UserPlaneFailureIndication { return &m.UserPlaneFailureIndication }), } diff --git a/ngap/pdu_session_resource_modify_indication_test.go b/ngap/pdu_session_resource_modify_indication_test.go index 0f1533f101..48de0e9219 100644 --- a/ngap/pdu_session_resource_modify_indication_test.go +++ b/ngap/pdu_session_resource_modify_indication_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -114,8 +114,8 @@ func TestPDUSessionResourceModifyIndicationRoundTrips(t *testing.T) { // modifies nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceModifyIndicationMissingList(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceModifyIndication(value) diff --git a/ngap/pdu_session_resource_modify_test.go b/ngap/pdu_session_resource_modify_test.go index 0d6a00485e..074940352d 100644 --- a/ngap/pdu_session_resource_modify_test.go +++ b/ngap/pdu_session_resource_modify_test.go @@ -9,7 +9,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden PDU SESSION RESOURCE MODIFY PDUs. @@ -125,8 +125,8 @@ func TestPDUSessionResourceModifyRoundTrips(t *testing.T) { // modifies nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceModifyRequestMissingList(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceModifyRequest(value) diff --git a/ngap/pdu_session_resource_release.go b/ngap/pdu_session_resource_release.go index cdc8fb374d..a142e3fcca 100644 --- a/ngap/pdu_session_resource_release.go +++ b/ngap/pdu_session_resource_release.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // PDUSessionResourceToReleaseItemRelCmd ::= SEQUENCE { pDUSessionID, @@ -61,7 +62,7 @@ var pDUSessionResourceReleaseCommandIEs = []ieSpec[PDUSessionResourceReleaseComm }, Encode: func(m *PDUSessionResourceReleaseCommand) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, - optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceReleaseCommand) **RANPagingPriority { return &m.RANPagingPriority }), + apimpl.OptionalIE(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceReleaseCommand) **RANPagingPriority { return &m.RANPagingPriority }), { ID: IDNASPDU, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *PDUSessionResourceReleaseCommand, r *per.Reader, enc per.Encoding) error { diff --git a/ngap/pdu_session_resource_release_test.go b/ngap/pdu_session_resource_release_test.go index 87683a7d82..02d63ad48f 100644 --- a/ngap/pdu_session_resource_release_test.go +++ b/ngap/pdu_session_resource_release_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden PDU SESSION RESOURCE RELEASE PDUs. @@ -115,8 +115,8 @@ func TestPDUSessionResourceReleaseRoundTrips(t *testing.T) { // releases nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceReleaseCommandMissingList(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceReleaseCommand(value) @@ -139,8 +139,8 @@ func TestPDUSessionResourceReleaseCommandMissingList(t *testing.T) { // it is still delivered and the absence reported (§10.3.5). func TestPDUSessionResourceReleaseResponseMissingList(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityIgnore, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityIgnore, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) msg, err := ParsePDUSessionResourceReleaseResponse(value) diff --git a/ngap/pdu_session_resource_setup.go b/ngap/pdu_session_resource_setup.go index d6888cb0fb..485ee451ba 100644 --- a/ngap/pdu_session_resource_setup.go +++ b/ngap/pdu_session_resource_setup.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // PDUSessionResourceSetupItemSUReq ::= SEQUENCE { pDUSessionID, @@ -121,7 +122,7 @@ var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest] }, Encode: func(m *PDUSessionResourceSetupRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, - optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceSetupRequest) **RANPagingPriority { return &m.RANPagingPriority }), + apimpl.OptionalIE(IDRANPagingPriority, CriticalityIgnore, func(m *PDUSessionResourceSetupRequest) **RANPagingPriority { return &m.RANPagingPriority }), { ID: IDNASPDU, Presence: presenceOptional, Criticality: CriticalityReject, Decode: func(m *PDUSessionResourceSetupRequest, r *per.Reader, enc per.Encoding) error { @@ -177,7 +178,7 @@ var pDUSessionResourceSetupRequestIEs = []ieSpec[PDUSessionResourceSetupRequest] return m.UEAggregateMaximumBitRate, true }, }, - listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *PDUSessionResourceSetupRequest) *UESliceMaximumBitRateList { + apimpl.ListIE(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *PDUSessionResourceSetupRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), } @@ -526,7 +527,7 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return m.QosFlowSetupRequest, true }, }, - listExtension(IDCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *CommonNetworkInstance { + apimpl.ListIE(IDCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *CommonNetworkInstance { return &m.CommonNetworkInstance }), { @@ -550,22 +551,22 @@ var pDUSessionResourceSetupRequestTransferIEs = []ieSpec[PDUSessionResourceSetup return m.DirectForwardingPathAvailability, true }, }, - optionalExtension(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) **UPTransportLayerInformation { + apimpl.OptionalIE(IDRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) **UPTransportLayerInformation { return &m.RedundantULNGUUPTNLInformation }), - listExtension(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *UPTransportLayerInformationList { + apimpl.ListIE(IDAdditionalRedundantULNGUUPTNLInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *UPTransportLayerInformationList { return &m.AdditionalRedundantULNGUUPTNLInformation }), - listExtension(IDRedundantCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *CommonNetworkInstance { + apimpl.ListIE(IDRedundantCommonNetworkInstance, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *CommonNetworkInstance { return &m.RedundantCommonNetworkInstance }), - optionalExtension(IDRedundantPDUSessionInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) **RedundantPDUSessionInformation { + apimpl.OptionalIE(IDRedundantPDUSessionInformation, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) **RedundantPDUSessionInformation { return &m.RedundantPDUSessionInformation }), - listExtension(IDMBSSessionSetupRequestList, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *MBSSessionSetupRequestList { + apimpl.ListIE(IDMBSSessionSetupRequestList, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *MBSSessionSetupRequestList { return &m.MBSSessionSetupRequestList }), - listExtension(IDDownlinkTLContainer, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *TLContainer { return &m.DownlinkTLContainer }), + apimpl.ListIE(IDDownlinkTLContainer, CriticalityIgnore, func(m *PDUSessionResourceSetupRequestTransfer) *TLContainer { return &m.DownlinkTLContainer }), } // Marshal encodes the transfer for the OCTET STRING that carries it. diff --git a/ngap/pdu_session_resource_setup_test.go b/ngap/pdu_session_resource_setup_test.go index 4bcb3e5956..e2c725adc0 100644 --- a/ngap/pdu_session_resource_setup_test.go +++ b/ngap/pdu_session_resource_setup_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden PDU SESSION RESOURCE SETUP PDUs. @@ -140,8 +140,8 @@ func TestPDUSessionResourceSetupRoundTrips(t *testing.T) { // sets up nothing, so it is not delivered (§10.3.5). func TestPDUSessionResourceSetupRequestMissingSessionList(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) _, err := ParsePDUSessionResourceSetupRequest(value) @@ -354,8 +354,8 @@ func TestPDUSessionResourceSetupResponseTransferGolden(t *testing.T) { // the missing IE named in Criticality Diagnostics. func TestPDUSessionResourceSetupRequestTransferMissingTunnel(t *testing.T) { value := container(t, - ieField{ID: IDPDUSessionType, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(PDUSessionTypeIPv4)))}, - ieField{ID: IDQosFlowSetupRequestList, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, QosFlowSetupRequestList{{ + ieField{ID: IDPDUSessionType, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(PDUSessionTypeIPv4)))}, + ieField{ID: IDQosFlowSetupRequestList, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, QosFlowSetupRequestList{{ QosFlowIdentifier: 1, QosFlowLevelQosParameters: QosFlowLevelQosParameters{ QosCharacteristics: QosCharacteristics{ diff --git a/ngap/per_gen.go b/ngap/per_gen.go index b5362ec1bd..93e9073fd0 100644 --- a/ngap/per_gen.go +++ b/ngap/per_gen.go @@ -6,12 +6,12 @@ package ngap import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" "slices" ) func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, a2XPC5FlowBitRates.iEExtensions) + ext := apimpl.ExtensionFields(extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, a2XPC5FlowBitRates.iEExtensions) w.WriteBit(a2XPC5FlowBitRates.extensions.Present()) w.WriteBit(len(ext) > 0) if err := a2XPC5FlowBitRates.A2XGuaranteedFlowBitRate.MarshalPER(w, enc); err != nil { @@ -21,7 +21,7 @@ func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -50,7 +50,7 @@ func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, &a2XPC5FlowBitRates.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, &a2XPC5FlowBitRates.iEExtensions); err != nil { return err } } @@ -62,9 +62,9 @@ func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsA2XPC5FlowBitRates []ap.IESpec[ProtocolIEID, A2XPC5FlowBitRates] +var extIEsA2XPC5FlowBitRates []apimpl.IESpec[ProtocolIEID, A2XPC5FlowBitRates] -func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if a2XPC5FlowBitRates.A2XGuaranteedFlowBitRate.Diagnose(d) { notComprehended = true @@ -72,12 +72,12 @@ func (a2XPC5FlowBitRates *A2XPC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolI if a2XPC5FlowBitRates.A2XMaximumFlowBitRate.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, a2XPC5FlowBitRates.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsA2XPC5FlowBitRates, a2XPC5FlowBitRates, &a2XPC5FlowBitRates.iEExtensions) return notComprehended } func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, a2XPC5QoSFlowItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, a2XPC5QoSFlowItem.iEExtensions) w.WriteBit(a2XPC5QoSFlowItem.extensions.Present()) w.WriteBit(a2XPC5QoSFlowItem.A2XPC5FlowBitRates != nil) w.WriteBit(a2XPC5QoSFlowItem.A2XRange != nil) @@ -96,7 +96,7 @@ func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.En } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -144,7 +144,7 @@ func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per. a2XPC5QoSFlowItem.A2XRange = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, &a2XPC5QoSFlowItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, &a2XPC5QoSFlowItem.iEExtensions); err != nil { return err } } @@ -156,9 +156,9 @@ func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsA2XPC5QoSFlowItem []ap.IESpec[ProtocolIEID, A2XPC5QoSFlowItem] +var extIEsA2XPC5QoSFlowItem []apimpl.IESpec[ProtocolIEID, A2XPC5QoSFlowItem] -func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if a2XPC5QoSFlowItem.A2XPQI.Diagnose(d) { notComprehended = true @@ -169,7 +169,7 @@ func (a2XPC5QoSFlowItem *A2XPC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEI if a2XPC5QoSFlowItem.A2XRange != nil && a2XPC5QoSFlowItem.A2XRange.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, a2XPC5QoSFlowItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsA2XPC5QoSFlowItem, a2XPC5QoSFlowItem, &a2XPC5QoSFlowItem.iEExtensions) return notComprehended } @@ -190,12 +190,12 @@ func (a2XPC5QoSFlowItemA2XRange A2XPC5QoSFlowItemA2XRange) Name() string { return enumA2XPC5QoSFlowItemA2XRange.Name(a2XPC5QoSFlowItemA2XRange) } -func (a2XPC5QoSFlowItemA2XRange A2XPC5QoSFlowItemA2XRange) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (a2XPC5QoSFlowItemA2XRange A2XPC5QoSFlowItemA2XRange) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumA2XPC5QoSFlowItemA2XRange.Known(a2XPC5QoSFlowItemA2XRange) } func (a2XPC5QoSParameters *A2XPC5QoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, a2XPC5QoSParameters.iEExtensions) + ext := apimpl.ExtensionFields(extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, a2XPC5QoSParameters.iEExtensions) w.WriteBit(a2XPC5QoSParameters.extensions.Present()) w.WriteBit(a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates != nil) w.WriteBit(len(ext) > 0) @@ -208,7 +208,7 @@ func (a2XPC5QoSParameters *A2XPC5QoSParameters) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -245,7 +245,7 @@ func (a2XPC5QoSParameters *A2XPC5QoSParameters) UnmarshalPER(r *per.Reader, enc a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, &a2XPC5QoSParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, &a2XPC5QoSParameters.iEExtensions); err != nil { return err } } @@ -257,9 +257,9 @@ func (a2XPC5QoSParameters *A2XPC5QoSParameters) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsA2XPC5QoSParameters []ap.IESpec[ProtocolIEID, A2XPC5QoSParameters] +var extIEsA2XPC5QoSParameters []apimpl.IESpec[ProtocolIEID, A2XPC5QoSParameters] -func (a2XPC5QoSParameters *A2XPC5QoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (a2XPC5QoSParameters *A2XPC5QoSParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if a2XPC5QoSParameters.A2XPC5QoSFlowList.Diagnose(d) { notComprehended = true @@ -267,12 +267,12 @@ func (a2XPC5QoSParameters *A2XPC5QoSParameters) Diagnose(d *ap.Diagnosis[Protoco if a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates != nil && a2XPC5QoSParameters.A2XPC5LinkAggregateBitRates.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, a2XPC5QoSParameters.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsA2XPC5QoSParameters, a2XPC5QoSParameters, &a2XPC5QoSParameters.iEExtensions) return notComprehended } func (aIOTFName *AIOTFName) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAIOTFName, aIOTFName, aIOTFName.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAIOTFName, aIOTFName, aIOTFName.iEExtensions) w.WriteBit(aIOTFName.extensions.Present()) w.WriteBit(aIOTFName.AIOTFNameVisibleString != nil) w.WriteBit(aIOTFName.AIOTFNameUTF8String != nil) @@ -288,7 +288,7 @@ func (aIOTFName *AIOTFName) MarshalPER(w *per.Writer, enc per.Encoding) error { } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -333,7 +333,7 @@ func (aIOTFName *AIOTFName) UnmarshalPER(r *per.Reader, enc per.Encoding) error aIOTFName.AIOTFNameUTF8String = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAIOTFName, aIOTFName, &aIOTFName.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAIOTFName, aIOTFName, &aIOTFName.iEExtensions); err != nil { return err } } @@ -345,11 +345,11 @@ func (aIOTFName *AIOTFName) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -var extIEsAIOTFName []ap.IESpec[ProtocolIEID, AIOTFName] +var extIEsAIOTFName []apimpl.IESpec[ProtocolIEID, AIOTFName] -func (aIOTFName *AIOTFName) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aIOTFName *AIOTFName) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsAIOTFName, aIOTFName, aIOTFName.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAIOTFName, aIOTFName, &aIOTFName.iEExtensions) return notComprehended } @@ -370,7 +370,7 @@ func (aIoTSupport AIoTSupport) Name() string { return enumAIoTSupport.Name(aIoTSupport) } -func (aIoTSupport AIoTSupport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (aIoTSupport AIoTSupport) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAIoTSupport.Known(aIoTSupport) } @@ -403,7 +403,7 @@ func (aMFPagingTarget *AMFPagingTarget) MarshalPER(w *per.Writer, enc per.Encodi if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, aMFPagingTarget.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, aMFPagingTarget.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -430,7 +430,7 @@ func (aMFPagingTarget *AMFPagingTarget) UnmarshalPER(r *per.Reader, enc per.Enco } aMFPagingTarget.TAI = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -444,27 +444,27 @@ func (aMFPagingTarget *AMFPagingTarget) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (aMFPagingTarget *AMFPagingTarget) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFPagingTarget *AMFPagingTarget) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case aMFPagingTarget.GlobalRANNodeID != nil: return aMFPagingTarget.GlobalRANNodeID.Diagnose(d) case aMFPagingTarget.TAI != nil: return aMFPagingTarget.TAI.Diagnose(d) case aMFPagingTarget.ChoiceExtension != nil: - d.Unknown(aMFPagingTarget.ChoiceExtension.ID, aMFPagingTarget.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, aMFPagingTarget.ChoiceExtension) } return false } func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem.iEExtensions) w.WriteBit(aMFTNLAssociationSetupItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := aMFTNLAssociationSetupItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -490,7 +490,7 @@ func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) UnmarshalPER(r *pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, &aMFTNLAssociationSetupItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, &aMFTNLAssociationSetupItem.iEExtensions); err != nil { return err } } @@ -502,19 +502,19 @@ func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) UnmarshalPER(r *pe return nil } -var extIEsAMFTNLAssociationSetupItem []ap.IESpec[ProtocolIEID, AMFTNLAssociationSetupItem] +var extIEsAMFTNLAssociationSetupItem []apimpl.IESpec[ProtocolIEID, AMFTNLAssociationSetupItem] -func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationSetupItem *AMFTNLAssociationSetupItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if aMFTNLAssociationSetupItem.AMFTNLAssociationAddress.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAMFTNLAssociationSetupItem, aMFTNLAssociationSetupItem, &aMFTNLAssociationSetupItem.iEExtensions) return notComprehended } func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem.iEExtensions) w.WriteBit(aMFTNLAssociationToAddItem.extensions.Present()) w.WriteBit(aMFTNLAssociationToAddItem.TNLAssociationUsage != nil) w.WriteBit(len(ext) > 0) @@ -530,7 +530,7 @@ func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) MarshalPER(w *per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -570,7 +570,7 @@ func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) UnmarshalPER(r *pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, &aMFTNLAssociationToAddItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, &aMFTNLAssociationToAddItem.iEExtensions); err != nil { return err } } @@ -582,9 +582,9 @@ func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) UnmarshalPER(r *pe return nil } -var extIEsAMFTNLAssociationToAddItem []ap.IESpec[ProtocolIEID, AMFTNLAssociationToAddItem] +var extIEsAMFTNLAssociationToAddItem []apimpl.IESpec[ProtocolIEID, AMFTNLAssociationToAddItem] -func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if aMFTNLAssociationToAddItem.AMFTNLAssociationAddress.Diagnose(d) { notComprehended = true @@ -592,19 +592,19 @@ func (aMFTNLAssociationToAddItem *AMFTNLAssociationToAddItem) Diagnose(d *ap.Dia if aMFTNLAssociationToAddItem.TNLAssociationUsage != nil && aMFTNLAssociationToAddItem.TNLAssociationUsage.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAMFTNLAssociationToAddItem, aMFTNLAssociationToAddItem, &aMFTNLAssociationToAddItem.iEExtensions) return notComprehended } func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem.iEExtensions) w.WriteBit(aMFTNLAssociationToRemoveItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := aMFTNLAssociationToRemoveItem.AMFTNLAssociationAddress.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -630,7 +630,7 @@ func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) UnmarshalPER return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, &aMFTNLAssociationToRemoveItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, &aMFTNLAssociationToRemoveItem.iEExtensions); err != nil { return err } } @@ -642,11 +642,11 @@ func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) UnmarshalPER return nil } -var extIEsAMFTNLAssociationToRemoveItem = []ap.IESpec[ProtocolIEID, AMFTNLAssociationToRemoveItem]{ +var extIEsAMFTNLAssociationToRemoveItem = []apimpl.IESpec[ProtocolIEID, AMFTNLAssociationToRemoveItem]{ { ID: IDTNLAssociationTransportLayerAddressNGRAN, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *AMFTNLAssociationToRemoveItem, r *per.Reader, enc per.Encoding) error { var v CPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -661,20 +661,23 @@ var extIEsAMFTNLAssociationToRemoveItem = []ap.IESpec[ProtocolIEID, AMFTNLAssoci } return x.TNLAssociationTransportLayerAddressNGRAN, true }, + Clear: func(x *AMFTNLAssociationToRemoveItem) { + x.TNLAssociationTransportLayerAddressNGRAN = nil + }, }, } -func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationToRemoveItem *AMFTNLAssociationToRemoveItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if aMFTNLAssociationToRemoveItem.AMFTNLAssociationAddress.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAMFTNLAssociationToRemoveItem, aMFTNLAssociationToRemoveItem, &aMFTNLAssociationToRemoveItem.iEExtensions) return notComprehended } func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem.iEExtensions) w.WriteBit(aMFTNLAssociationToUpdateItem.extensions.Present()) w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil) w.WriteBit(aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor != nil) @@ -693,7 +696,7 @@ func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) MarshalPER(w } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -741,7 +744,7 @@ func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) UnmarshalPER aMFTNLAssociationToUpdateItem.TNLAddressWeightFactor = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, &aMFTNLAssociationToUpdateItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, &aMFTNLAssociationToUpdateItem.iEExtensions); err != nil { return err } } @@ -753,9 +756,9 @@ func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) UnmarshalPER return nil } -var extIEsAMFTNLAssociationToUpdateItem []ap.IESpec[ProtocolIEID, AMFTNLAssociationToUpdateItem] +var extIEsAMFTNLAssociationToUpdateItem []apimpl.IESpec[ProtocolIEID, AMFTNLAssociationToUpdateItem] -func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if aMFTNLAssociationToUpdateItem.AMFTNLAssociationAddress.Diagnose(d) { notComprehended = true @@ -763,12 +766,12 @@ func (aMFTNLAssociationToUpdateItem *AMFTNLAssociationToUpdateItem) Diagnose(d * if aMFTNLAssociationToUpdateItem.TNLAssociationUsage != nil && aMFTNLAssociationToUpdateItem.TNLAssociationUsage.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAMFTNLAssociationToUpdateItem, aMFTNLAssociationToUpdateItem, &aMFTNLAssociationToUpdateItem.iEExtensions) return notComprehended } func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, aUN3DeviceAccessInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, aUN3DeviceAccessInfo.iEExtensions) w.WriteBit(aUN3DeviceAccessInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := aUN3DeviceAccessInfo.AUN3DeviceAccess.MarshalPER(w, enc); err != nil { @@ -778,7 +781,7 @@ func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) MarshalPER(w *per.Writer, enc return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -807,7 +810,7 @@ func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) UnmarshalPER(r *per.Reader, en return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, &aUN3DeviceAccessInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, &aUN3DeviceAccessInfo.iEExtensions); err != nil { return err } } @@ -819,9 +822,9 @@ func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) UnmarshalPER(r *per.Reader, en return nil } -var extIEsAUN3DeviceAccessInfo []ap.IESpec[ProtocolIEID, AUN3DeviceAccessInfo] +var extIEsAUN3DeviceAccessInfo []apimpl.IESpec[ProtocolIEID, AUN3DeviceAccessInfo] -func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if aUN3DeviceAccessInfo.AUN3DeviceAccess.Diagnose(d) { notComprehended = true @@ -829,7 +832,7 @@ func (aUN3DeviceAccessInfo *AUN3DeviceAccessInfo) Diagnose(d *ap.Diagnosis[Proto if aUN3DeviceAccessInfo.ExistingNGConnectionwithSameLocation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, aUN3DeviceAccessInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAUN3DeviceAccessInfo, aUN3DeviceAccessInfo, &aUN3DeviceAccessInfo.iEExtensions) return notComprehended } @@ -850,7 +853,7 @@ func (aUN3DeviceAccessInfoAUN3DeviceAccess AUN3DeviceAccessInfoAUN3DeviceAccess) return enumAUN3DeviceAccessInfoAUN3DeviceAccess.Name(aUN3DeviceAccessInfoAUN3DeviceAccess) } -func (aUN3DeviceAccessInfoAUN3DeviceAccess AUN3DeviceAccessInfoAUN3DeviceAccess) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (aUN3DeviceAccessInfoAUN3DeviceAccess AUN3DeviceAccessInfoAUN3DeviceAccess) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAUN3DeviceAccessInfoAUN3DeviceAccess.Known(aUN3DeviceAccessInfoAUN3DeviceAccess) } @@ -871,7 +874,7 @@ func (aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation AUN3DeviceAccessI return enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation.Name(aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) } -func (aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation AUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAUN3DeviceAccessInfoExistingNGConnectionwithSameLocation.Known(aUN3DeviceAccessInfoExistingNGConnectionwithSameLocation) } @@ -892,19 +895,19 @@ func (activationStatus ActivationStatus) Name() string { return enumActivationStatus.Name(activationStatus) } -func (activationStatus ActivationStatus) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (activationStatus ActivationStatus) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumActivationStatus.Known(activationStatus) } func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlocationReportingReferenceIDItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem.iEExtensions) w.WriteBit(additionalCancelledlocationReportingReferenceIDItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := additionalCancelledlocationReportingReferenceIDItem.LocationReportingReferenceIDToBeCancelled.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -930,7 +933,7 @@ func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlo return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, &additionalCancelledlocationReportingReferenceIDItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, &additionalCancelledlocationReportingReferenceIDItem.iEExtensions); err != nil { return err } } @@ -942,19 +945,19 @@ func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlo return nil } -var extIEsAdditionalCancelledlocationReportingReferenceIDItem []ap.IESpec[ProtocolIEID, AdditionalCancelledlocationReportingReferenceIDItem] +var extIEsAdditionalCancelledlocationReportingReferenceIDItem []apimpl.IESpec[ProtocolIEID, AdditionalCancelledlocationReportingReferenceIDItem] -func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlocationReportingReferenceIDItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (additionalCancelledlocationReportingReferenceIDItem *AdditionalCancelledlocationReportingReferenceIDItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if additionalCancelledlocationReportingReferenceIDItem.LocationReportingReferenceIDToBeCancelled.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAdditionalCancelledlocationReportingReferenceIDItem, additionalCancelledlocationReportingReferenceIDItem, &additionalCancelledlocationReportingReferenceIDItem.iEExtensions) return notComprehended } func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem.iEExtensions) w.WriteBit(additionalDLUPTNLInformationForHOItem.extensions.Present()) w.WriteBit(additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil) w.WriteBit(len(ext) > 0) @@ -970,7 +973,7 @@ func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOIt } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1010,7 +1013,7 @@ func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOIt additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions); err != nil { return err } } @@ -1022,11 +1025,11 @@ func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOIt return nil } -var extIEsAdditionalDLUPTNLInformationForHOItem = []ap.IESpec[ProtocolIEID, AdditionalDLUPTNLInformationForHOItem]{ +var extIEsAdditionalDLUPTNLInformationForHOItem = []apimpl.IESpec[ProtocolIEID, AdditionalDLUPTNLInformationForHOItem]{ { ID: IDAdditionalRedundantDLNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AdditionalDLUPTNLInformationForHOItem, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -1041,10 +1044,13 @@ var extIEsAdditionalDLUPTNLInformationForHOItem = []ap.IESpec[ProtocolIEID, Addi } return x.AdditionalRedundantDLNGUUPTNLInformation, true }, + Clear: func(x *AdditionalDLUPTNLInformationForHOItem) { + x.AdditionalRedundantDLNGUUPTNLInformation = nil + }, }, } -func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if additionalDLUPTNLInformationForHOItem.AdditionalDLNGUUPTNLInformation.Diagnose(d) { notComprehended = true @@ -1055,7 +1061,7 @@ func (additionalDLUPTNLInformationForHOItem *AdditionalDLUPTNLInformationForHOIt if additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation != nil && additionalDLUPTNLInformationForHOItem.AdditionalDLForwardingUPTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAdditionalDLUPTNLInformationForHOItem, additionalDLUPTNLInformationForHOItem, &additionalDLUPTNLInformationForHOItem.iEExtensions) return notComprehended } @@ -1076,12 +1082,12 @@ func (additionalQosFlowInformation AdditionalQosFlowInformation) Name() string { return enumAdditionalQosFlowInformation.Name(additionalQosFlowInformation) } -func (additionalQosFlowInformation AdditionalQosFlowInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (additionalQosFlowInformation AdditionalQosFlowInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAdditionalQosFlowInformation.Known(additionalQosFlowInformation) } func (additionalULI *AdditionalULI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAdditionalULI, additionalULI, additionalULI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAdditionalULI, additionalULI, additionalULI.iEExtensions) w.WriteBit(additionalULI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := additionalULI.NRCGI.MarshalPER(w, enc); err != nil { @@ -1091,7 +1097,7 @@ func (additionalULI *AdditionalULI) MarshalPER(w *per.Writer, enc per.Encoding) return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1120,7 +1126,7 @@ func (additionalULI *AdditionalULI) UnmarshalPER(r *per.Reader, enc per.Encoding return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalULI, additionalULI, &additionalULI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalULI, additionalULI, &additionalULI.iEExtensions); err != nil { return err } } @@ -1132,9 +1138,9 @@ func (additionalULI *AdditionalULI) UnmarshalPER(r *per.Reader, enc per.Encoding return nil } -var extIEsAdditionalULI []ap.IESpec[ProtocolIEID, AdditionalULI] +var extIEsAdditionalULI []apimpl.IESpec[ProtocolIEID, AdditionalULI] -func (additionalULI *AdditionalULI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (additionalULI *AdditionalULI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if additionalULI.NRCGI.Diagnose(d) { notComprehended = true @@ -1142,12 +1148,12 @@ func (additionalULI *AdditionalULI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool if additionalULI.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAdditionalULI, additionalULI, additionalULI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAdditionalULI, additionalULI, &additionalULI.iEExtensions) return notComprehended } func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, aerialUEFlightInformationReporting.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, aerialUEFlightInformationReporting.iEExtensions) w.WriteBit(aerialUEFlightInformationReporting.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{LB: -420, HasLB: true, UB: 10000, HasUB: true, Extensible: true}, int64(aerialUEFlightInformationReporting.Altitude)); err != nil { @@ -1157,7 +1163,7 @@ func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) Ma return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1188,7 +1194,7 @@ func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) Un return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, &aerialUEFlightInformationReporting.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, &aerialUEFlightInformationReporting.iEExtensions); err != nil { return err } } @@ -1200,16 +1206,16 @@ func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) Un return nil } -var extIEsAerialUEFlightInformationReporting []ap.IESpec[ProtocolIEID, AerialUEFlightInformationReporting] +var extIEsAerialUEFlightInformationReporting []apimpl.IESpec[ProtocolIEID, AerialUEFlightInformationReporting] -func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aerialUEFlightInformationReporting *AerialUEFlightInformationReporting) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, aerialUEFlightInformationReporting.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReporting, aerialUEFlightInformationReporting, &aerialUEFlightInformationReporting.iEExtensions) return notComprehended } func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReportingControl) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl.iEExtensions) w.WriteBit(aerialUEFlightInformationReportingControl.extensions.Present()) w.WriteBit(aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity != nil) w.WriteBit(len(ext) > 0) @@ -1228,7 +1234,7 @@ func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReport return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1275,7 +1281,7 @@ func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReport return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, &aerialUEFlightInformationReportingControl.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, &aerialUEFlightInformationReportingControl.iEExtensions); err != nil { return err } } @@ -1287,9 +1293,9 @@ func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReport return nil } -var extIEsAerialUEFlightInformationReportingControl []ap.IESpec[ProtocolIEID, AerialUEFlightInformationReportingControl] +var extIEsAerialUEFlightInformationReportingControl []apimpl.IESpec[ProtocolIEID, AerialUEFlightInformationReportingControl] -func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReportingControl) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReportingControl) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity != nil && aerialUEFlightInformationReportingControl.AerialUEReportPeriodicity.Diagnose(d) { notComprehended = true @@ -1297,19 +1303,19 @@ func (aerialUEFlightInformationReportingControl *AerialUEFlightInformationReport if aerialUEFlightInformationReportingControl.AreaID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReportingControl, aerialUEFlightInformationReportingControl, &aerialUEFlightInformationReportingControl.iEExtensions) return notComprehended } func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationReportingControlItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem.iEExtensions) w.WriteBit(aerialUEFlightInformationReportingControlItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := aerialUEFlightInformationReportingControlItem.AerialUEFlightInformationReportingControl.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1335,7 +1341,7 @@ func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationRe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, &aerialUEFlightInformationReportingControlItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, &aerialUEFlightInformationReportingControlItem.iEExtensions); err != nil { return err } } @@ -1347,14 +1353,14 @@ func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationRe return nil } -var extIEsAerialUEFlightInformationReportingControlItem []ap.IESpec[ProtocolIEID, AerialUEFlightInformationReportingControlItem] +var extIEsAerialUEFlightInformationReportingControlItem []apimpl.IESpec[ProtocolIEID, AerialUEFlightInformationReportingControlItem] -func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationReportingControlItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aerialUEFlightInformationReportingControlItem *AerialUEFlightInformationReportingControlItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if aerialUEFlightInformationReportingControlItem.AerialUEFlightInformationReportingControl.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAerialUEFlightInformationReportingControlItem, aerialUEFlightInformationReportingControlItem, &aerialUEFlightInformationReportingControlItem.iEExtensions) return notComprehended } @@ -1375,7 +1381,7 @@ func (aerialUEReportingPeriodicity AerialUEReportingPeriodicity) Name() string { return enumAerialUEReportingPeriodicity.Name(aerialUEReportingPeriodicity) } -func (aerialUEReportingPeriodicity AerialUEReportingPeriodicity) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (aerialUEReportingPeriodicity AerialUEReportingPeriodicity) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAerialUEReportingPeriodicity.Known(aerialUEReportingPeriodicity) } @@ -1396,12 +1402,12 @@ func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) Name() st return enumAerialUEsubscriptionInformation.Name(aerialUEsubscriptionInformation) } -func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAerialUEsubscriptionInformation.Known(aerialUEsubscriptionInformation) } func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) w.WriteBit(allocationAndRetentionPriority.extensions.Present()) w.WriteBit(len(ext) > 0) if err := allocationAndRetentionPriority.PriorityLevelARP.MarshalPER(w, enc); err != nil { @@ -1414,7 +1420,7 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1446,7 +1452,7 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions); err != nil { return err } } @@ -1458,9 +1464,9 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return nil } -var extIEsAllocationAndRetentionPriority []ap.IESpec[ProtocolIEID, AllocationAndRetentionPriority] +var extIEsAllocationAndRetentionPriority []apimpl.IESpec[ProtocolIEID, AllocationAndRetentionPriority] -func (allocationAndRetentionPriority *AllocationAndRetentionPriority) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (allocationAndRetentionPriority *AllocationAndRetentionPriority) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if allocationAndRetentionPriority.PreemptionCapability.Diagnose(d) { notComprehended = true @@ -1468,19 +1474,19 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) Diagnose(d if allocationAndRetentionPriority.PreemptionVulnerability.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions) return notComprehended } func (allowedNSSAIItem *AllowedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAllowedNSSAIItem, allowedNSSAIItem, allowedNSSAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAllowedNSSAIItem, allowedNSSAIItem, allowedNSSAIItem.iEExtensions) w.WriteBit(allowedNSSAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := allowedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1506,7 +1512,7 @@ func (allowedNSSAIItem *AllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllowedNSSAIItem, allowedNSSAIItem, &allowedNSSAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAllowedNSSAIItem, allowedNSSAIItem, &allowedNSSAIItem.iEExtensions); err != nil { return err } } @@ -1518,19 +1524,19 @@ func (allowedNSSAIItem *AllowedNSSAIItem) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsAllowedNSSAIItem []ap.IESpec[ProtocolIEID, AllowedNSSAIItem] +var extIEsAllowedNSSAIItem []apimpl.IESpec[ProtocolIEID, AllowedNSSAIItem] -func (allowedNSSAIItem *AllowedNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (allowedNSSAIItem *AllowedNSSAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if allowedNSSAIItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAllowedNSSAIItem, allowedNSSAIItem, allowedNSSAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAllowedNSSAIItem, allowedNSSAIItem, &allowedNSSAIItem.iEExtensions) return notComprehended } func (allowedPNINPNItem *AllowedPNINPNItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAllowedPNINPNItem, allowedPNINPNItem, allowedPNINPNItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAllowedPNINPNItem, allowedPNINPNItem, allowedPNINPNItem.iEExtensions) w.WriteBit(allowedPNINPNItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := allowedPNINPNItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -1543,7 +1549,7 @@ func (allowedPNINPNItem *AllowedPNINPNItem) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1575,7 +1581,7 @@ func (allowedPNINPNItem *AllowedPNINPNItem) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllowedPNINPNItem, allowedPNINPNItem, &allowedPNINPNItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAllowedPNINPNItem, allowedPNINPNItem, &allowedPNINPNItem.iEExtensions); err != nil { return err } } @@ -1587,14 +1593,14 @@ func (allowedPNINPNItem *AllowedPNINPNItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsAllowedPNINPNItem []ap.IESpec[ProtocolIEID, AllowedPNINPNItem] +var extIEsAllowedPNINPNItem []apimpl.IESpec[ProtocolIEID, AllowedPNINPNItem] -func (allowedPNINPNItem *AllowedPNINPNItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (allowedPNINPNItem *AllowedPNINPNItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if allowedPNINPNItem.PNINPNrestricted.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAllowedPNINPNItem, allowedPNINPNItem, allowedPNINPNItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAllowedPNINPNItem, allowedPNINPNItem, &allowedPNINPNItem.iEExtensions) return notComprehended } @@ -1615,12 +1621,12 @@ func (allowedPNINPNItemPNINPNrestricted AllowedPNINPNItemPNINPNrestricted) Name( return enumAllowedPNINPNItemPNINPNrestricted.Name(allowedPNINPNItemPNINPNrestricted) } -func (allowedPNINPNItemPNINPNrestricted AllowedPNINPNItemPNINPNrestricted) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (allowedPNINPNItemPNINPNrestricted AllowedPNINPNItemPNINPNrestricted) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAllowedPNINPNItemPNINPNrestricted.Known(allowedPNINPNItemPNINPNrestricted) } func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, alternativeQoSParaSetItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, alternativeQoSParaSetItem.iEExtensions) w.WriteBit(alternativeQoSParaSetItem.extensions.Present()) w.WriteBit(alternativeQoSParaSetItem.GuaranteedFlowBitRateDL != nil) w.WriteBit(alternativeQoSParaSetItem.GuaranteedFlowBitRateUL != nil) @@ -1651,7 +1657,7 @@ func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) MarshalPER(w *per.Wr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1721,7 +1727,7 @@ func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) UnmarshalPER(r *per. alternativeQoSParaSetItem.PacketErrorRate = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, &alternativeQoSParaSetItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, &alternativeQoSParaSetItem.iEExtensions); err != nil { return err } } @@ -1733,11 +1739,11 @@ func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) UnmarshalPER(r *per. return nil } -var extIEsAlternativeQoSParaSetItem = []ap.IESpec[ProtocolIEID, AlternativeQoSParaSetItem]{ +var extIEsAlternativeQoSParaSetItem = []apimpl.IESpec[ProtocolIEID, AlternativeQoSParaSetItem]{ { ID: IDMaximumDataBurstVolume, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { var v MaximumDataBurstVolume if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -1752,11 +1758,14 @@ var extIEsAlternativeQoSParaSetItem = []ap.IESpec[ProtocolIEID, AlternativeQoSPa } return x.MaximumDataBurstVolume, true }, + Clear: func(x *AlternativeQoSParaSetItem) { + x.MaximumDataBurstVolume = nil + }, }, { ID: IDPduSetDelayBudgetDownlink, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -1771,11 +1780,14 @@ var extIEsAlternativeQoSParaSetItem = []ap.IESpec[ProtocolIEID, AlternativeQoSPa } return x.PduSetDelayBudgetDownlink, true }, + Clear: func(x *AlternativeQoSParaSetItem) { + x.PduSetDelayBudgetDownlink = nil + }, }, { ID: IDPduSetDelayBudgetUplink, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -1790,11 +1802,14 @@ var extIEsAlternativeQoSParaSetItem = []ap.IESpec[ProtocolIEID, AlternativeQoSPa } return x.PduSetDelayBudgetUplink, true }, + Clear: func(x *AlternativeQoSParaSetItem) { + x.PduSetDelayBudgetUplink = nil + }, }, { ID: IDPduSetErrorRateDownlink, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { var v PacketErrorRate if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -1809,11 +1824,14 @@ var extIEsAlternativeQoSParaSetItem = []ap.IESpec[ProtocolIEID, AlternativeQoSPa } return x.PduSetErrorRateDownlink, true }, + Clear: func(x *AlternativeQoSParaSetItem) { + x.PduSetErrorRateDownlink = nil + }, }, { ID: IDPduSetErrorRateUplink, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AlternativeQoSParaSetItem, r *per.Reader, enc per.Encoding) error { var v PacketErrorRate if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -1828,10 +1846,13 @@ var extIEsAlternativeQoSParaSetItem = []ap.IESpec[ProtocolIEID, AlternativeQoSPa } return x.PduSetErrorRateUplink, true }, + Clear: func(x *AlternativeQoSParaSetItem) { + x.PduSetErrorRateUplink = nil + }, }, } -func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if alternativeQoSParaSetItem.AlternativeQoSParaSetIndex.Diagnose(d) { notComprehended = true @@ -1848,7 +1869,7 @@ func (alternativeQoSParaSetItem *AlternativeQoSParaSetItem) Diagnose(d *ap.Diagn if alternativeQoSParaSetItem.PacketErrorRate != nil && alternativeQoSParaSetItem.PacketErrorRate.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, alternativeQoSParaSetItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAlternativeQoSParaSetItem, alternativeQoSParaSetItem, &alternativeQoSParaSetItem.iEExtensions) return notComprehended } @@ -1888,7 +1909,7 @@ func (areaID *AreaID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, areaID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, areaID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -1921,7 +1942,7 @@ func (areaID *AreaID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } areaID.NRCGI = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -1935,7 +1956,7 @@ func (areaID *AreaID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (areaID *AreaID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaID *AreaID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case areaID.TAI != nil: return areaID.TAI.Diagnose(d) @@ -1944,13 +1965,13 @@ func (areaID *AreaID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { case areaID.NRCGI != nil: return areaID.NRCGI.Diagnose(d) case areaID.ChoiceExtension != nil: - d.Unknown(areaID.ChoiceExtension.ID, areaID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, areaID.ChoiceExtension) } return false } func (areaOfInterest *AreaOfInterest) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAreaOfInterest, areaOfInterest, areaOfInterest.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAreaOfInterest, areaOfInterest, areaOfInterest.iEExtensions) w.WriteBit(areaOfInterest.extensions.Present()) w.WriteBit(areaOfInterest.AreaOfInterestTAIList != nil) w.WriteBit(areaOfInterest.AreaOfInterestCellList != nil) @@ -1972,7 +1993,7 @@ func (areaOfInterest *AreaOfInterest) MarshalPER(w *per.Writer, enc per.Encoding } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2022,7 +2043,7 @@ func (areaOfInterest *AreaOfInterest) UnmarshalPER(r *per.Reader, enc per.Encodi } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterest, areaOfInterest, &areaOfInterest.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterest, areaOfInterest, &areaOfInterest.iEExtensions); err != nil { return err } } @@ -2034,9 +2055,9 @@ func (areaOfInterest *AreaOfInterest) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsAreaOfInterest []ap.IESpec[ProtocolIEID, AreaOfInterest] +var extIEsAreaOfInterest []apimpl.IESpec[ProtocolIEID, AreaOfInterest] -func (areaOfInterest *AreaOfInterest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterest *AreaOfInterest) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if areaOfInterest.AreaOfInterestTAIList.Diagnose(d) { notComprehended = true @@ -2047,19 +2068,19 @@ func (areaOfInterest *AreaOfInterest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bo if areaOfInterest.AreaOfInterestRANNodeList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAreaOfInterest, areaOfInterest, areaOfInterest.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAreaOfInterest, areaOfInterest, &areaOfInterest.iEExtensions) return notComprehended } func (areaOfInterestCellItem *AreaOfInterestCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAreaOfInterestCellItem, areaOfInterestCellItem, areaOfInterestCellItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAreaOfInterestCellItem, areaOfInterestCellItem, areaOfInterestCellItem.iEExtensions) w.WriteBit(areaOfInterestCellItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := areaOfInterestCellItem.NGRANCGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2085,7 +2106,7 @@ func (areaOfInterestCellItem *AreaOfInterestCellItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestCellItem, areaOfInterestCellItem, &areaOfInterestCellItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestCellItem, areaOfInterestCellItem, &areaOfInterestCellItem.iEExtensions); err != nil { return err } } @@ -2097,19 +2118,19 @@ func (areaOfInterestCellItem *AreaOfInterestCellItem) UnmarshalPER(r *per.Reader return nil } -var extIEsAreaOfInterestCellItem []ap.IESpec[ProtocolIEID, AreaOfInterestCellItem] +var extIEsAreaOfInterestCellItem []apimpl.IESpec[ProtocolIEID, AreaOfInterestCellItem] -func (areaOfInterestCellItem *AreaOfInterestCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestCellItem *AreaOfInterestCellItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if areaOfInterestCellItem.NGRANCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAreaOfInterestCellItem, areaOfInterestCellItem, areaOfInterestCellItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAreaOfInterestCellItem, areaOfInterestCellItem, &areaOfInterestCellItem.iEExtensions) return notComprehended } func (areaOfInterestItem *AreaOfInterestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAreaOfInterestItem, areaOfInterestItem, areaOfInterestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAreaOfInterestItem, areaOfInterestItem, areaOfInterestItem.iEExtensions) w.WriteBit(areaOfInterestItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := areaOfInterestItem.AreaOfInterest.MarshalPER(w, enc); err != nil { @@ -2119,7 +2140,7 @@ func (areaOfInterestItem *AreaOfInterestItem) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2148,7 +2169,7 @@ func (areaOfInterestItem *AreaOfInterestItem) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestItem, areaOfInterestItem, &areaOfInterestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestItem, areaOfInterestItem, &areaOfInterestItem.iEExtensions); err != nil { return err } } @@ -2160,9 +2181,9 @@ func (areaOfInterestItem *AreaOfInterestItem) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsAreaOfInterestItem []ap.IESpec[ProtocolIEID, AreaOfInterestItem] +var extIEsAreaOfInterestItem []apimpl.IESpec[ProtocolIEID, AreaOfInterestItem] -func (areaOfInterestItem *AreaOfInterestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestItem *AreaOfInterestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if areaOfInterestItem.AreaOfInterest.Diagnose(d) { notComprehended = true @@ -2170,19 +2191,19 @@ func (areaOfInterestItem *AreaOfInterestItem) Diagnose(d *ap.Diagnosis[ProtocolI if areaOfInterestItem.LocationReportingReferenceID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAreaOfInterestItem, areaOfInterestItem, areaOfInterestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAreaOfInterestItem, areaOfInterestItem, &areaOfInterestItem.iEExtensions) return notComprehended } func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, areaOfInterestRANNodeItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, areaOfInterestRANNodeItem.iEExtensions) w.WriteBit(areaOfInterestRANNodeItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := areaOfInterestRANNodeItem.GlobalRANNodeID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2208,7 +2229,7 @@ func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, &areaOfInterestRANNodeItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, &areaOfInterestRANNodeItem.iEExtensions); err != nil { return err } } @@ -2220,26 +2241,26 @@ func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) UnmarshalPER(r *per. return nil } -var extIEsAreaOfInterestRANNodeItem []ap.IESpec[ProtocolIEID, AreaOfInterestRANNodeItem] +var extIEsAreaOfInterestRANNodeItem []apimpl.IESpec[ProtocolIEID, AreaOfInterestRANNodeItem] -func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestRANNodeItem *AreaOfInterestRANNodeItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if areaOfInterestRANNodeItem.GlobalRANNodeID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, areaOfInterestRANNodeItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAreaOfInterestRANNodeItem, areaOfInterestRANNodeItem, &areaOfInterestRANNodeItem.iEExtensions) return notComprehended } func (areaOfInterestTAIItem *AreaOfInterestTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, areaOfInterestTAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, areaOfInterestTAIItem.iEExtensions) w.WriteBit(areaOfInterestTAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := areaOfInterestTAIItem.TAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2265,7 +2286,7 @@ func (areaOfInterestTAIItem *AreaOfInterestTAIItem) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, &areaOfInterestTAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, &areaOfInterestTAIItem.iEExtensions); err != nil { return err } } @@ -2277,14 +2298,14 @@ func (areaOfInterestTAIItem *AreaOfInterestTAIItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsAreaOfInterestTAIItem []ap.IESpec[ProtocolIEID, AreaOfInterestTAIItem] +var extIEsAreaOfInterestTAIItem []apimpl.IESpec[ProtocolIEID, AreaOfInterestTAIItem] -func (areaOfInterestTAIItem *AreaOfInterestTAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestTAIItem *AreaOfInterestTAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if areaOfInterestTAIItem.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, areaOfInterestTAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAreaOfInterestTAIItem, areaOfInterestTAIItem, &areaOfInterestTAIItem.iEExtensions) return notComprehended } @@ -2331,7 +2352,7 @@ func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) MarshalPER(w *per.Writer, enc pe if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, areaScopeOfMDTEUTRA.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, areaScopeOfMDTEUTRA.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -2370,7 +2391,7 @@ func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) UnmarshalPER(r *per.Reader, enc } areaScopeOfMDTEUTRA.TAIBased = &v case 4: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -2384,7 +2405,7 @@ func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) UnmarshalPER(r *per.Reader, enc return nil } -func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case areaScopeOfMDTEUTRA.CellBased != nil: return areaScopeOfMDTEUTRA.CellBased.Diagnose(d) @@ -2394,7 +2415,7 @@ func (areaScopeOfMDTEUTRA *AreaScopeOfMDTEUTRA) Diagnose(d *ap.Diagnosis[Protoco case areaScopeOfMDTEUTRA.TAIBased != nil: return areaScopeOfMDTEUTRA.TAIBased.Diagnose(d) case areaScopeOfMDTEUTRA.ChoiceExtension != nil: - d.Unknown(areaScopeOfMDTEUTRA.ChoiceExtension.ID, areaScopeOfMDTEUTRA.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, areaScopeOfMDTEUTRA.ChoiceExtension) } return false } @@ -2442,32 +2463,32 @@ func (areaScopeOfMDTNR *AreaScopeOfMDTNR) MarshalPER(w *per.Writer, enc per.Enco if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDPNINPNBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.PNINPNBasedMDT}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDPNINPNBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: areaScopeOfMDTNR.PNINPNBasedMDT}) case areaScopeOfMDTNR.SNPNCellBasedMDT != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSNPNCellBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNCellBasedMDT}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDSNPNCellBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNCellBasedMDT}) case areaScopeOfMDTNR.SNPNTAIBasedMDT != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSNPNTAIBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNTAIBasedMDT}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDSNPNTAIBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNTAIBasedMDT}) case areaScopeOfMDTNR.SNPNBasedMDT != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSNPNBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNBasedMDT}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDSNPNBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: areaScopeOfMDTNR.SNPNBasedMDT}) case areaScopeOfMDTNR.GeographyBasedMDT != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGeographyBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), Value: areaScopeOfMDTNR.GeographyBasedMDT}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDGeographyBasedMDT, Criticality: areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: areaScopeOfMDTNR.GeographyBasedMDT}) case areaScopeOfMDTNR.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, areaScopeOfMDTNR.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, areaScopeOfMDTNR.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -2506,66 +2527,46 @@ func (areaScopeOfMDTNR *AreaScopeOfMDTNR) UnmarshalPER(r *per.Reader, enc per.En } areaScopeOfMDTNR.TAIBased = &v case 4: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDPNINPNBasedMDT: var v PNINPNBasedMDT - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - areaScopeOfMDTNR.ChoiceExtension = &f - break - } areaScopeOfMDTNR.PNINPNBasedMDT = &v - areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + areaScopeOfMDTNR.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDSNPNCellBasedMDT: var v SNPNCellBasedMDT - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - areaScopeOfMDTNR.ChoiceExtension = &f - break - } areaScopeOfMDTNR.SNPNCellBasedMDT = &v - areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + areaScopeOfMDTNR.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDSNPNTAIBasedMDT: var v SNPNTAIBasedMDT - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - areaScopeOfMDTNR.ChoiceExtension = &f - break - } areaScopeOfMDTNR.SNPNTAIBasedMDT = &v - areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + areaScopeOfMDTNR.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDSNPNBasedMDT: var v SNPNBasedMDT - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - areaScopeOfMDTNR.ChoiceExtension = &f - break - } areaScopeOfMDTNR.SNPNBasedMDT = &v - areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + areaScopeOfMDTNR.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDGeographyBasedMDT: var v GeographyBasedMDT - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - areaScopeOfMDTNR.ChoiceExtension = &f - break - } areaScopeOfMDTNR.GeographyBasedMDT = &v - areaScopeOfMDTNR.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + areaScopeOfMDTNR.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) default: areaScopeOfMDTNR.ChoiceExtension = &f } @@ -2575,7 +2576,7 @@ func (areaScopeOfMDTNR *AreaScopeOfMDTNR) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (areaScopeOfMDTNR *AreaScopeOfMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaScopeOfMDTNR *AreaScopeOfMDTNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case areaScopeOfMDTNR.CellBased != nil: return areaScopeOfMDTNR.CellBased.Diagnose(d) @@ -2585,23 +2586,23 @@ func (areaScopeOfMDTNR *AreaScopeOfMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIEID] case areaScopeOfMDTNR.TAIBased != nil: return areaScopeOfMDTNR.TAIBased.Diagnose(d) case areaScopeOfMDTNR.PNINPNBasedMDT != nil: - d.IE(IDPNINPNBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.PNINPNBasedMDT) + return apimpl.DiagnoseChoiceExtension(d, IDPNINPNBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), &areaScopeOfMDTNR.PNINPNBasedMDT, &areaScopeOfMDTNR.ChoiceExtension) case areaScopeOfMDTNR.SNPNCellBasedMDT != nil: - d.IE(IDSNPNCellBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.SNPNCellBasedMDT) + return apimpl.DiagnoseChoiceExtension(d, IDSNPNCellBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), &areaScopeOfMDTNR.SNPNCellBasedMDT, &areaScopeOfMDTNR.ChoiceExtension) case areaScopeOfMDTNR.SNPNTAIBasedMDT != nil: - d.IE(IDSNPNTAIBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.SNPNTAIBasedMDT) + return apimpl.DiagnoseChoiceExtension(d, IDSNPNTAIBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), &areaScopeOfMDTNR.SNPNTAIBasedMDT, &areaScopeOfMDTNR.ChoiceExtension) case areaScopeOfMDTNR.SNPNBasedMDT != nil: - d.IE(IDSNPNBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.SNPNBasedMDT) + return apimpl.DiagnoseChoiceExtension(d, IDSNPNBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), &areaScopeOfMDTNR.SNPNBasedMDT, &areaScopeOfMDTNR.ChoiceExtension) case areaScopeOfMDTNR.GeographyBasedMDT != nil: - d.IE(IDGeographyBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(ap.CriticalityIgnore), areaScopeOfMDTNR.GeographyBasedMDT) + return apimpl.DiagnoseChoiceExtension(d, IDGeographyBasedMDT, areaScopeOfMDTNR.choiceCriticality.Of(apimpl.CriticalityIgnore), &areaScopeOfMDTNR.GeographyBasedMDT, &areaScopeOfMDTNR.ChoiceExtension) case areaScopeOfMDTNR.ChoiceExtension != nil: - d.Unknown(areaScopeOfMDTNR.ChoiceExtension.ID, areaScopeOfMDTNR.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, areaScopeOfMDTNR.ChoiceExtension) } return false } func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem.iEExtensions) w.WriteBit(areaScopeOfNeighCellsItem.extensions.Present()) w.WriteBit(areaScopeOfNeighCellsItem.PciListForMDT != nil) w.WriteBit(len(ext) > 0) @@ -2614,7 +2615,7 @@ func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) MarshalPER(w *per.Wr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2649,7 +2650,7 @@ func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) UnmarshalPER(r *per. } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, &areaScopeOfNeighCellsItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, &areaScopeOfNeighCellsItem.iEExtensions); err != nil { return err } } @@ -2661,9 +2662,9 @@ func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) UnmarshalPER(r *per. return nil } -var extIEsAreaScopeOfNeighCellsItem []ap.IESpec[ProtocolIEID, AreaScopeOfNeighCellsItem] +var extIEsAreaScopeOfNeighCellsItem []apimpl.IESpec[ProtocolIEID, AreaScopeOfNeighCellsItem] -func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if areaScopeOfNeighCellsItem.NrFrequencyInfo.Diagnose(d) { notComprehended = true @@ -2671,7 +2672,7 @@ func (areaScopeOfNeighCellsItem *AreaScopeOfNeighCellsItem) Diagnose(d *ap.Diagn if areaScopeOfNeighCellsItem.PciListForMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAreaScopeOfNeighCellsItem, areaScopeOfNeighCellsItem, &areaScopeOfNeighCellsItem.iEExtensions) return notComprehended } @@ -2718,7 +2719,7 @@ func (areaScopeOfQMC *AreaScopeOfQMC) MarshalPER(w *per.Writer, enc per.Encoding if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, areaScopeOfQMC.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, areaScopeOfQMC.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -2757,7 +2758,7 @@ func (areaScopeOfQMC *AreaScopeOfQMC) UnmarshalPER(r *per.Reader, enc per.Encodi } areaScopeOfQMC.PLMNAreaBased = &v case 4: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -2771,7 +2772,7 @@ func (areaScopeOfQMC *AreaScopeOfQMC) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -func (areaScopeOfQMC *AreaScopeOfQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaScopeOfQMC *AreaScopeOfQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case areaScopeOfQMC.CellBased != nil: return areaScopeOfQMC.CellBased.Diagnose(d) @@ -2782,13 +2783,13 @@ func (areaScopeOfQMC *AreaScopeOfQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bo case areaScopeOfQMC.PLMNAreaBased != nil: return areaScopeOfQMC.PLMNAreaBased.Diagnose(d) case areaScopeOfQMC.ChoiceExtension != nil: - d.Unknown(areaScopeOfQMC.ChoiceExtension.ID, areaScopeOfQMC.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, areaScopeOfQMC.ChoiceExtension) } return false } func (assistanceDataForPaging *AssistanceDataForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAssistanceDataForPaging, assistanceDataForPaging, assistanceDataForPaging.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAssistanceDataForPaging, assistanceDataForPaging, assistanceDataForPaging.iEExtensions) w.WriteBit(assistanceDataForPaging.extensions.Present()) w.WriteBit(assistanceDataForPaging.AssistanceDataForRecommendedCells != nil) w.WriteBit(assistanceDataForPaging.PagingAttemptInformation != nil) @@ -2804,7 +2805,7 @@ func (assistanceDataForPaging *AssistanceDataForPaging) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2849,7 +2850,7 @@ func (assistanceDataForPaging *AssistanceDataForPaging) UnmarshalPER(r *per.Read assistanceDataForPaging.PagingAttemptInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForPaging, assistanceDataForPaging, &assistanceDataForPaging.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForPaging, assistanceDataForPaging, &assistanceDataForPaging.iEExtensions); err != nil { return err } } @@ -2861,11 +2862,11 @@ func (assistanceDataForPaging *AssistanceDataForPaging) UnmarshalPER(r *per.Read return nil } -var extIEsAssistanceDataForPaging = []ap.IESpec[ProtocolIEID, AssistanceDataForPaging]{ +var extIEsAssistanceDataForPaging = []apimpl.IESpec[ProtocolIEID, AssistanceDataForPaging]{ { ID: IDNPNPagingAssistanceInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AssistanceDataForPaging, r *per.Reader, enc per.Encoding) error { var v NPNPagingAssistanceInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -2880,11 +2881,14 @@ var extIEsAssistanceDataForPaging = []ap.IESpec[ProtocolIEID, AssistanceDataForP } return x.NPNPagingAssistanceInformation, true }, + Clear: func(x *AssistanceDataForPaging) { + x.NPNPagingAssistanceInformation = nil + }, }, { ID: IDPagingAssisDataforCEcapabUE, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AssistanceDataForPaging, r *per.Reader, enc per.Encoding) error { var v PagingAssisDataforCEcapabUE if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -2899,10 +2903,13 @@ var extIEsAssistanceDataForPaging = []ap.IESpec[ProtocolIEID, AssistanceDataForP } return x.PagingAssisDataforCEcapabUE, true }, + Clear: func(x *AssistanceDataForPaging) { + x.PagingAssisDataforCEcapabUE = nil + }, }, } -func (assistanceDataForPaging *AssistanceDataForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (assistanceDataForPaging *AssistanceDataForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if assistanceDataForPaging.AssistanceDataForRecommendedCells != nil && assistanceDataForPaging.AssistanceDataForRecommendedCells.Diagnose(d) { notComprehended = true @@ -2910,19 +2917,19 @@ func (assistanceDataForPaging *AssistanceDataForPaging) Diagnose(d *ap.Diagnosis if assistanceDataForPaging.PagingAttemptInformation != nil && assistanceDataForPaging.PagingAttemptInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAssistanceDataForPaging, assistanceDataForPaging, assistanceDataForPaging.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAssistanceDataForPaging, assistanceDataForPaging, &assistanceDataForPaging.iEExtensions) return notComprehended } func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, assistanceDataForRecommendedCells.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, assistanceDataForRecommendedCells.iEExtensions) w.WriteBit(assistanceDataForRecommendedCells.extensions.Present()) w.WriteBit(len(ext) > 0) if err := assistanceDataForRecommendedCells.RecommendedCellsForPaging.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -2948,7 +2955,7 @@ func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, &assistanceDataForRecommendedCells.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, &assistanceDataForRecommendedCells.iEExtensions); err != nil { return err } } @@ -2960,19 +2967,19 @@ func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) Unma return nil } -var extIEsAssistanceDataForRecommendedCells []ap.IESpec[ProtocolIEID, AssistanceDataForRecommendedCells] +var extIEsAssistanceDataForRecommendedCells []apimpl.IESpec[ProtocolIEID, AssistanceDataForRecommendedCells] -func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if assistanceDataForRecommendedCells.RecommendedCellsForPaging.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, assistanceDataForRecommendedCells.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, &assistanceDataForRecommendedCells.iEExtensions) return notComprehended } func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem.iEExtensions) w.WriteBit(associatedMBSQosFlowSetupRequestItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := associatedMBSQosFlowSetupRequestItem.MBSQosFlowIdentifier.MarshalPER(w, enc); err != nil { @@ -2982,7 +2989,7 @@ func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3011,7 +3018,7 @@ func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, &associatedMBSQosFlowSetupRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, &associatedMBSQosFlowSetupRequestItem.iEExtensions); err != nil { return err } } @@ -3023,9 +3030,9 @@ func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem return nil } -var extIEsAssociatedMBSQosFlowSetupRequestItem []ap.IESpec[ProtocolIEID, AssociatedMBSQosFlowSetupRequestItem] +var extIEsAssociatedMBSQosFlowSetupRequestItem []apimpl.IESpec[ProtocolIEID, AssociatedMBSQosFlowSetupRequestItem] -func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if associatedMBSQosFlowSetupRequestItem.MBSQosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -3033,12 +3040,12 @@ func (associatedMBSQosFlowSetupRequestItem *AssociatedMBSQosFlowSetupRequestItem if associatedMBSQosFlowSetupRequestItem.AssociatedUnicastQosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAssociatedMBSQosFlowSetupRequestItem, associatedMBSQosFlowSetupRequestItem, &associatedMBSQosFlowSetupRequestItem.iEExtensions) return notComprehended } func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions) w.WriteBit(associatedMBSQosFlowSetuporModifyRequestItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := associatedMBSQosFlowSetuporModifyRequestItem.MBSQosFlowIdentifier.MarshalPER(w, enc); err != nil { @@ -3048,7 +3055,7 @@ func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporM return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3077,7 +3084,7 @@ func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporM return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, &associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, &associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions); err != nil { return err } } @@ -3089,9 +3096,9 @@ func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporM return nil } -var extIEsAssociatedMBSQosFlowSetuporModifyRequestItem []ap.IESpec[ProtocolIEID, AssociatedMBSQosFlowSetuporModifyRequestItem] +var extIEsAssociatedMBSQosFlowSetuporModifyRequestItem []apimpl.IESpec[ProtocolIEID, AssociatedMBSQosFlowSetuporModifyRequestItem] -func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporModifyRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporModifyRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if associatedMBSQosFlowSetuporModifyRequestItem.MBSQosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -3099,12 +3106,12 @@ func (associatedMBSQosFlowSetuporModifyRequestItem *AssociatedMBSQosFlowSetuporM if associatedMBSQosFlowSetuporModifyRequestItem.AssociatedUnicastQosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAssociatedMBSQosFlowSetuporModifyRequestItem, associatedMBSQosFlowSetuporModifyRequestItem, &associatedMBSQosFlowSetuporModifyRequestItem.iEExtensions) return notComprehended } func (associatedQosFlowItem *AssociatedQosFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAssociatedQosFlowItem, associatedQosFlowItem, associatedQosFlowItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAssociatedQosFlowItem, associatedQosFlowItem, associatedQosFlowItem.iEExtensions) w.WriteBit(associatedQosFlowItem.extensions.Present()) w.WriteBit(associatedQosFlowItem.QosFlowMappingIndication != nil) w.WriteBit(len(ext) > 0) @@ -3117,7 +3124,7 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) MarshalPER(w *per.Writer, en } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3154,7 +3161,7 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) UnmarshalPER(r *per.Reader, associatedQosFlowItem.QosFlowMappingIndication = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedQosFlowItem, associatedQosFlowItem, &associatedQosFlowItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssociatedQosFlowItem, associatedQosFlowItem, &associatedQosFlowItem.iEExtensions); err != nil { return err } } @@ -3166,11 +3173,11 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsAssociatedQosFlowItem = []ap.IESpec[ProtocolIEID, AssociatedQosFlowItem]{ +var extIEsAssociatedQosFlowItem = []apimpl.IESpec[ProtocolIEID, AssociatedQosFlowItem]{ { ID: IDCurrentQoSParaSetIndex, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *AssociatedQosFlowItem, r *per.Reader, enc per.Encoding) error { var v AlternativeQoSParaSetIndex if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -3185,10 +3192,13 @@ var extIEsAssociatedQosFlowItem = []ap.IESpec[ProtocolIEID, AssociatedQosFlowIte } return x.CurrentQoSParaSetIndex, true }, + Clear: func(x *AssociatedQosFlowItem) { + x.CurrentQoSParaSetIndex = nil + }, }, } -func (associatedQosFlowItem *AssociatedQosFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (associatedQosFlowItem *AssociatedQosFlowItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if associatedQosFlowItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -3196,7 +3206,7 @@ func (associatedQosFlowItem *AssociatedQosFlowItem) Diagnose(d *ap.Diagnosis[Pro if associatedQosFlowItem.QosFlowMappingIndication != nil && associatedQosFlowItem.QosFlowMappingIndication.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAssociatedQosFlowItem, associatedQosFlowItem, associatedQosFlowItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAssociatedQosFlowItem, associatedQosFlowItem, &associatedQosFlowItem.iEExtensions) return notComprehended } @@ -3217,19 +3227,19 @@ func (authenticatedIndication AuthenticatedIndication) Name() string { return enumAuthenticatedIndication.Name(authenticatedIndication) } -func (authenticatedIndication AuthenticatedIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (authenticatedIndication AuthenticatedIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAuthenticatedIndication.Known(authenticatedIndication) } func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, availableBitrateReportThresholdItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, availableBitrateReportThresholdItem.iEExtensions) w.WriteBit(availableBitrateReportThresholdItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := availableBitrateReportThresholdItem.ReportingThreshold.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3255,7 +3265,7 @@ func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, &availableBitrateReportThresholdItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, &availableBitrateReportThresholdItem.iEExtensions); err != nil { return err } } @@ -3267,19 +3277,19 @@ func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) return nil } -var extIEsAvailableBitrateReportThresholdItem []ap.IESpec[ProtocolIEID, AvailableBitrateReportThresholdItem] +var extIEsAvailableBitrateReportThresholdItem []apimpl.IESpec[ProtocolIEID, AvailableBitrateReportThresholdItem] -func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (availableBitrateReportThresholdItem *AvailableBitrateReportThresholdItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if availableBitrateReportThresholdItem.ReportingThreshold.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, availableBitrateReportThresholdItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAvailableBitrateReportThresholdItem, availableBitrateReportThresholdItem, &availableBitrateReportThresholdItem.iEExtensions) return notComprehended } func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics.iEExtensions) w.WriteBit(availableRANVisibleQoEMetrics.extensions.Present()) w.WriteBit(availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList != nil) w.WriteBit(availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup != nil) @@ -3295,7 +3305,7 @@ func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) MarshalPER(w } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3340,7 +3350,7 @@ func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) UnmarshalPER availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, &availableRANVisibleQoEMetrics.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, &availableRANVisibleQoEMetrics.iEExtensions); err != nil { return err } } @@ -3352,9 +3362,9 @@ func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) UnmarshalPER return nil } -var extIEsAvailableRANVisibleQoEMetrics []ap.IESpec[ProtocolIEID, AvailableRANVisibleQoEMetrics] +var extIEsAvailableRANVisibleQoEMetrics []apimpl.IESpec[ProtocolIEID, AvailableRANVisibleQoEMetrics] -func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList != nil && availableRANVisibleQoEMetrics.ApplicationLayerBufferLevelList.Diagnose(d) { notComprehended = true @@ -3362,7 +3372,7 @@ func (availableRANVisibleQoEMetrics *AvailableRANVisibleQoEMetrics) Diagnose(d * if availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup != nil && availableRANVisibleQoEMetrics.PlayoutDelayForMediaStartup.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAvailableRANVisibleQoEMetrics, availableRANVisibleQoEMetrics, &availableRANVisibleQoEMetrics.iEExtensions) return notComprehended } @@ -3383,7 +3393,7 @@ func (availableRANVisibleQoEMetricsApplicationLayerBufferLevelList AvailableRANV return enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList.Name(availableRANVisibleQoEMetricsApplicationLayerBufferLevelList) } -func (availableRANVisibleQoEMetricsApplicationLayerBufferLevelList AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (availableRANVisibleQoEMetricsApplicationLayerBufferLevelList AvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAvailableRANVisibleQoEMetricsApplicationLayerBufferLevelList.Known(availableRANVisibleQoEMetricsApplicationLayerBufferLevelList) } @@ -3404,12 +3414,12 @@ func (availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup AvailableRANVisib return enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup.Name(availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) } -func (availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup AvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumAvailableRANVisibleQoEMetricsPlayoutDelayForMediaStartup.Known(availableRANVisibleQoEMetricsPlayoutDelayForMediaStartup) } func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration.iEExtensions) w.WriteBit(beamMeasurementsReportConfiguration.extensions.Present()) w.WriteBit(beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity != nil) w.WriteBit(beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport != nil) @@ -3425,7 +3435,7 @@ func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3470,7 +3480,7 @@ func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, &beamMeasurementsReportConfiguration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, &beamMeasurementsReportConfiguration.iEExtensions); err != nil { return err } } @@ -3482,9 +3492,9 @@ func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) return nil } -var extIEsBeamMeasurementsReportConfiguration []ap.IESpec[ProtocolIEID, BeamMeasurementsReportConfiguration] +var extIEsBeamMeasurementsReportConfiguration []apimpl.IESpec[ProtocolIEID, BeamMeasurementsReportConfiguration] -func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity != nil && beamMeasurementsReportConfiguration.BeamMeasurementsReportQuantity.Diagnose(d) { notComprehended = true @@ -3492,12 +3502,12 @@ func (beamMeasurementsReportConfiguration *BeamMeasurementsReportConfiguration) if beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport != nil && beamMeasurementsReportConfiguration.MaxNrofRSIndexesToReport.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsBeamMeasurementsReportConfiguration, beamMeasurementsReportConfiguration, &beamMeasurementsReportConfiguration.iEExtensions) return notComprehended } func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, beamMeasurementsReportQuantity.iEExtensions) + ext := apimpl.ExtensionFields(extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, beamMeasurementsReportQuantity.iEExtensions) w.WriteBit(beamMeasurementsReportQuantity.extensions.Present()) w.WriteBit(len(ext) > 0) if err := beamMeasurementsReportQuantity.RSRP.MarshalPER(w, enc); err != nil { @@ -3510,7 +3520,7 @@ func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3542,7 +3552,7 @@ func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, &beamMeasurementsReportQuantity.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, &beamMeasurementsReportQuantity.iEExtensions); err != nil { return err } } @@ -3554,9 +3564,9 @@ func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) UnmarshalP return nil } -var extIEsBeamMeasurementsReportQuantity []ap.IESpec[ProtocolIEID, BeamMeasurementsReportQuantity] +var extIEsBeamMeasurementsReportQuantity []apimpl.IESpec[ProtocolIEID, BeamMeasurementsReportQuantity] -func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if beamMeasurementsReportQuantity.RSRP.Diagnose(d) { notComprehended = true @@ -3567,7 +3577,7 @@ func (beamMeasurementsReportQuantity *BeamMeasurementsReportQuantity) Diagnose(d if beamMeasurementsReportQuantity.SINR.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, beamMeasurementsReportQuantity.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsBeamMeasurementsReportQuantity, beamMeasurementsReportQuantity, &beamMeasurementsReportQuantity.iEExtensions) return notComprehended } @@ -3588,7 +3598,7 @@ func (beamMeasurementsReportQuantityRSRP BeamMeasurementsReportQuantityRSRP) Nam return enumBeamMeasurementsReportQuantityRSRP.Name(beamMeasurementsReportQuantityRSRP) } -func (beamMeasurementsReportQuantityRSRP BeamMeasurementsReportQuantityRSRP) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (beamMeasurementsReportQuantityRSRP BeamMeasurementsReportQuantityRSRP) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumBeamMeasurementsReportQuantityRSRP.Known(beamMeasurementsReportQuantityRSRP) } @@ -3609,7 +3619,7 @@ func (beamMeasurementsReportQuantityRSRQ BeamMeasurementsReportQuantityRSRQ) Nam return enumBeamMeasurementsReportQuantityRSRQ.Name(beamMeasurementsReportQuantityRSRQ) } -func (beamMeasurementsReportQuantityRSRQ BeamMeasurementsReportQuantityRSRQ) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (beamMeasurementsReportQuantityRSRQ BeamMeasurementsReportQuantityRSRQ) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumBeamMeasurementsReportQuantityRSRQ.Known(beamMeasurementsReportQuantityRSRQ) } @@ -3630,7 +3640,7 @@ func (beamMeasurementsReportQuantitySINR BeamMeasurementsReportQuantitySINR) Nam return enumBeamMeasurementsReportQuantitySINR.Name(beamMeasurementsReportQuantitySINR) } -func (beamMeasurementsReportQuantitySINR BeamMeasurementsReportQuantitySINR) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (beamMeasurementsReportQuantitySINR BeamMeasurementsReportQuantitySINR) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumBeamMeasurementsReportQuantitySINR.Known(beamMeasurementsReportQuantitySINR) } @@ -3651,19 +3661,19 @@ func (bluetoothMeasConfig BluetoothMeasConfig) Name() string { return enumBluetoothMeasConfig.Name(bluetoothMeasConfig) } -func (bluetoothMeasConfig BluetoothMeasConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (bluetoothMeasConfig BluetoothMeasConfig) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumBluetoothMeasConfig.Known(bluetoothMeasConfig) } func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem.iEExtensions) w.WriteBit(bluetoothMeasConfigNameItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := bluetoothMeasConfigNameItem.BluetoothName.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3689,7 +3699,7 @@ func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) UnmarshalPER(r * return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, &bluetoothMeasConfigNameItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, &bluetoothMeasConfigNameItem.iEExtensions); err != nil { return err } } @@ -3701,16 +3711,16 @@ func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) UnmarshalPER(r * return nil } -var extIEsBluetoothMeasConfigNameItem []ap.IESpec[ProtocolIEID, BluetoothMeasConfigNameItem] +var extIEsBluetoothMeasConfigNameItem []apimpl.IESpec[ProtocolIEID, BluetoothMeasConfigNameItem] -func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (bluetoothMeasConfigNameItem *BluetoothMeasConfigNameItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsBluetoothMeasConfigNameItem, bluetoothMeasConfigNameItem, &bluetoothMeasConfigNameItem.iEExtensions) return notComprehended } func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration.iEExtensions) w.WriteBit(bluetoothMeasurementConfiguration.extensions.Present()) w.WriteBit(bluetoothMeasurementConfiguration.BluetoothMeasConfigNameList != nil) w.WriteBit(bluetoothMeasurementConfiguration.Btrssi != nil) @@ -3729,7 +3739,7 @@ func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) Mars } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -3775,7 +3785,7 @@ func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) Unma bluetoothMeasurementConfiguration.Btrssi = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, &bluetoothMeasurementConfiguration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, &bluetoothMeasurementConfiguration.iEExtensions); err != nil { return err } } @@ -3787,9 +3797,9 @@ func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) Unma return nil } -var extIEsBluetoothMeasurementConfiguration []ap.IESpec[ProtocolIEID, BluetoothMeasurementConfiguration] +var extIEsBluetoothMeasurementConfiguration []apimpl.IESpec[ProtocolIEID, BluetoothMeasurementConfiguration] -func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if bluetoothMeasurementConfiguration.BluetoothMeasConfig.Diagnose(d) { notComprehended = true @@ -3800,7 +3810,7 @@ func (bluetoothMeasurementConfiguration *BluetoothMeasurementConfiguration) Diag if bluetoothMeasurementConfiguration.Btrssi != nil && bluetoothMeasurementConfiguration.Btrssi.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsBluetoothMeasurementConfiguration, bluetoothMeasurementConfiguration, &bluetoothMeasurementConfiguration.iEExtensions) return notComprehended } @@ -3821,7 +3831,7 @@ func (bluetoothMeasurementConfigurationBtrssi BluetoothMeasurementConfigurationB return enumBluetoothMeasurementConfigurationBtrssi.Name(bluetoothMeasurementConfigurationBtrssi) } -func (bluetoothMeasurementConfigurationBtrssi BluetoothMeasurementConfigurationBtrssi) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (bluetoothMeasurementConfigurationBtrssi BluetoothMeasurementConfigurationBtrssi) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumBluetoothMeasurementConfigurationBtrssi.Known(bluetoothMeasurementConfigurationBtrssi) } @@ -3882,7 +3892,7 @@ func (broadcastCancelledAreaList *BroadcastCancelledAreaList) MarshalPER(w *per. if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 6); err != nil { return err } - return ap.EncodeField(profile, w, enc, broadcastCancelledAreaList.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, broadcastCancelledAreaList.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -3933,7 +3943,7 @@ func (broadcastCancelledAreaList *BroadcastCancelledAreaList) UnmarshalPER(r *pe } broadcastCancelledAreaList.EmergencyAreaIDCancelledNR = &v case 6: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -3947,7 +3957,7 @@ func (broadcastCancelledAreaList *BroadcastCancelledAreaList) UnmarshalPER(r *pe return nil } -func (broadcastCancelledAreaList *BroadcastCancelledAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case broadcastCancelledAreaList.CellIDCancelledEUTRA != nil: return broadcastCancelledAreaList.CellIDCancelledEUTRA.Diagnose(d) @@ -3962,7 +3972,7 @@ func (broadcastCancelledAreaList *BroadcastCancelledAreaList) Diagnose(d *ap.Dia case broadcastCancelledAreaList.EmergencyAreaIDCancelledNR != nil: return broadcastCancelledAreaList.EmergencyAreaIDCancelledNR.Diagnose(d) case broadcastCancelledAreaList.ChoiceExtension != nil: - d.Unknown(broadcastCancelledAreaList.ChoiceExtension.ID, broadcastCancelledAreaList.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, broadcastCancelledAreaList.ChoiceExtension) } return false } @@ -4024,7 +4034,7 @@ func (broadcastCompletedAreaList *BroadcastCompletedAreaList) MarshalPER(w *per. if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 6, 6); err != nil { return err } - return ap.EncodeField(profile, w, enc, broadcastCompletedAreaList.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, broadcastCompletedAreaList.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -4075,7 +4085,7 @@ func (broadcastCompletedAreaList *BroadcastCompletedAreaList) UnmarshalPER(r *pe } broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR = &v case 6: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -4089,7 +4099,7 @@ func (broadcastCompletedAreaList *BroadcastCompletedAreaList) UnmarshalPER(r *pe return nil } -func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case broadcastCompletedAreaList.CellIDBroadcastEUTRA != nil: return broadcastCompletedAreaList.CellIDBroadcastEUTRA.Diagnose(d) @@ -4104,13 +4114,13 @@ func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *ap.Dia case broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR != nil: return broadcastCompletedAreaList.EmergencyAreaIDBroadcastNR.Diagnose(d) case broadcastCompletedAreaList.ChoiceExtension != nil: - d.Unknown(broadcastCompletedAreaList.ChoiceExtension.ID, broadcastCompletedAreaList.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, broadcastCompletedAreaList.ChoiceExtension) } return false } func (broadcastPLMNItem *BroadcastPLMNItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsBroadcastPLMNItem, broadcastPLMNItem, broadcastPLMNItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsBroadcastPLMNItem, broadcastPLMNItem, broadcastPLMNItem.iEExtensions) w.WriteBit(broadcastPLMNItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := broadcastPLMNItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -4120,7 +4130,7 @@ func (broadcastPLMNItem *BroadcastPLMNItem) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4149,7 +4159,7 @@ func (broadcastPLMNItem *BroadcastPLMNItem) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBroadcastPLMNItem, broadcastPLMNItem, &broadcastPLMNItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsBroadcastPLMNItem, broadcastPLMNItem, &broadcastPLMNItem.iEExtensions); err != nil { return err } } @@ -4161,11 +4171,11 @@ func (broadcastPLMNItem *BroadcastPLMNItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsBroadcastPLMNItem = []ap.IESpec[ProtocolIEID, BroadcastPLMNItem]{ +var extIEsBroadcastPLMNItem = []apimpl.IESpec[ProtocolIEID, BroadcastPLMNItem]{ { ID: IDNPNSupport, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *BroadcastPLMNItem, r *per.Reader, enc per.Encoding) error { var v NPNSupport if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -4180,11 +4190,14 @@ var extIEsBroadcastPLMNItem = []ap.IESpec[ProtocolIEID, BroadcastPLMNItem]{ } return x.NPNSupport, true }, + Clear: func(x *BroadcastPLMNItem) { + x.NPNSupport = nil + }, }, { ID: IDExtendedTAISliceSupportList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *BroadcastPLMNItem, r *per.Reader, enc per.Encoding) error { var v ExtendedSliceSupportList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -4199,11 +4212,14 @@ var extIEsBroadcastPLMNItem = []ap.IESpec[ProtocolIEID, BroadcastPLMNItem]{ } return x.ExtendedTAISliceSupportList, true }, + Clear: func(x *BroadcastPLMNItem) { + x.ExtendedTAISliceSupportList = nil + }, }, { ID: IDTAINSAGSupportList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *BroadcastPLMNItem, r *per.Reader, enc per.Encoding) error { var v TAINSAGSupportList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -4218,20 +4234,23 @@ var extIEsBroadcastPLMNItem = []ap.IESpec[ProtocolIEID, BroadcastPLMNItem]{ } return x.TAINSAGSupportList, true }, + Clear: func(x *BroadcastPLMNItem) { + x.TAINSAGSupportList = nil + }, }, } -func (broadcastPLMNItem *BroadcastPLMNItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (broadcastPLMNItem *BroadcastPLMNItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if broadcastPLMNItem.TAISliceSupportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsBroadcastPLMNItem, broadcastPLMNItem, broadcastPLMNItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsBroadcastPLMNItem, broadcastPLMNItem, &broadcastPLMNItem.iEExtensions) return notComprehended } func (burstArrivalTimeWindow *BurstArrivalTimeWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, burstArrivalTimeWindow.iEExtensions) + ext := apimpl.ExtensionFields(extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, burstArrivalTimeWindow.iEExtensions) w.WriteBit(burstArrivalTimeWindow.extensions.Present()) w.WriteBit(len(ext) > 0) if err := burstArrivalTimeWindow.BurstArrivalTimeWindowStart.MarshalPER(w, enc); err != nil { @@ -4241,7 +4260,7 @@ func (burstArrivalTimeWindow *BurstArrivalTimeWindow) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4270,7 +4289,7 @@ func (burstArrivalTimeWindow *BurstArrivalTimeWindow) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, &burstArrivalTimeWindow.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, &burstArrivalTimeWindow.iEExtensions); err != nil { return err } } @@ -4282,9 +4301,9 @@ func (burstArrivalTimeWindow *BurstArrivalTimeWindow) UnmarshalPER(r *per.Reader return nil } -var extIEsBurstArrivalTimeWindow []ap.IESpec[ProtocolIEID, BurstArrivalTimeWindow] +var extIEsBurstArrivalTimeWindow []apimpl.IESpec[ProtocolIEID, BurstArrivalTimeWindow] -func (burstArrivalTimeWindow *BurstArrivalTimeWindow) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (burstArrivalTimeWindow *BurstArrivalTimeWindow) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if burstArrivalTimeWindow.BurstArrivalTimeWindowStart.Diagnose(d) { notComprehended = true @@ -4292,12 +4311,12 @@ func (burstArrivalTimeWindow *BurstArrivalTimeWindow) Diagnose(d *ap.Diagnosis[P if burstArrivalTimeWindow.BurstArrivalTimeWindowEnd.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, burstArrivalTimeWindow.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsBurstArrivalTimeWindow, burstArrivalTimeWindow, &burstArrivalTimeWindow.iEExtensions) return notComprehended } func (cAGListforMDTItem *CAGListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCAGListforMDTItem, cAGListforMDTItem, cAGListforMDTItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCAGListforMDTItem, cAGListforMDTItem, cAGListforMDTItem.iEExtensions) w.WriteBit(cAGListforMDTItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cAGListforMDTItem.PlmnID.MarshalPER(w, enc); err != nil { @@ -4307,7 +4326,7 @@ func (cAGListforMDTItem *CAGListforMDTItem) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4336,7 +4355,7 @@ func (cAGListforMDTItem *CAGListforMDTItem) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCAGListforMDTItem, cAGListforMDTItem, &cAGListforMDTItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCAGListforMDTItem, cAGListforMDTItem, &cAGListforMDTItem.iEExtensions); err != nil { return err } } @@ -4348,11 +4367,11 @@ func (cAGListforMDTItem *CAGListforMDTItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsCAGListforMDTItem []ap.IESpec[ProtocolIEID, CAGListforMDTItem] +var extIEsCAGListforMDTItem []apimpl.IESpec[ProtocolIEID, CAGListforMDTItem] -func (cAGListforMDTItem *CAGListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cAGListforMDTItem *CAGListforMDTItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsCAGListforMDTItem, cAGListforMDTItem, cAGListforMDTItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCAGListforMDTItem, cAGListforMDTItem, &cAGListforMDTItem.iEExtensions) return notComprehended } @@ -4373,7 +4392,7 @@ func (cEmodeBSupportIndicator CEmodeBSupportIndicator) Name() string { return enumCEmodeBSupportIndicator.Name(cEmodeBSupportIndicator) } -func (cEmodeBSupportIndicator CEmodeBSupportIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cEmodeBSupportIndicator CEmodeBSupportIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCEmodeBSupportIndicator.Known(cEmodeBSupportIndicator) } @@ -4394,12 +4413,12 @@ func (cEmodeBrestricted CEmodeBrestricted) Name() string { return enumCEmodeBrestricted.Name(cEmodeBrestricted) } -func (cEmodeBrestricted CEmodeBrestricted) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cEmodeBrestricted CEmodeBrestricted) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCEmodeBrestricted.Known(cEmodeBrestricted) } func (cNAssistedRANTuning *CNAssistedRANTuning) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCNAssistedRANTuning, cNAssistedRANTuning, cNAssistedRANTuning.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCNAssistedRANTuning, cNAssistedRANTuning, cNAssistedRANTuning.iEExtensions) w.WriteBit(cNAssistedRANTuning.extensions.Present()) w.WriteBit(cNAssistedRANTuning.ExpectedUEBehaviour != nil) w.WriteBit(len(ext) > 0) @@ -4409,7 +4428,7 @@ func (cNAssistedRANTuning *CNAssistedRANTuning) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4443,7 +4462,7 @@ func (cNAssistedRANTuning *CNAssistedRANTuning) UnmarshalPER(r *per.Reader, enc cNAssistedRANTuning.ExpectedUEBehaviour = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCNAssistedRANTuning, cNAssistedRANTuning, &cNAssistedRANTuning.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCNAssistedRANTuning, cNAssistedRANTuning, &cNAssistedRANTuning.iEExtensions); err != nil { return err } } @@ -4455,14 +4474,14 @@ func (cNAssistedRANTuning *CNAssistedRANTuning) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsCNAssistedRANTuning []ap.IESpec[ProtocolIEID, CNAssistedRANTuning] +var extIEsCNAssistedRANTuning []apimpl.IESpec[ProtocolIEID, CNAssistedRANTuning] -func (cNAssistedRANTuning *CNAssistedRANTuning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cNAssistedRANTuning *CNAssistedRANTuning) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cNAssistedRANTuning.ExpectedUEBehaviour != nil && cNAssistedRANTuning.ExpectedUEBehaviour.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCNAssistedRANTuning, cNAssistedRANTuning, cNAssistedRANTuning.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCNAssistedRANTuning, cNAssistedRANTuning, &cNAssistedRANTuning.iEExtensions) return notComprehended } @@ -4483,12 +4502,12 @@ func (cNMTCommunicationHandling CNMTCommunicationHandling) Name() string { return enumCNMTCommunicationHandling.Name(cNMTCommunicationHandling) } -func (cNMTCommunicationHandling CNMTCommunicationHandling) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cNMTCommunicationHandling CNMTCommunicationHandling) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCNMTCommunicationHandling.Known(cNMTCommunicationHandling) } func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem.iEExtensions) w.WriteBit(cNTypeRestrictionsForEquivalentItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cNTypeRestrictionsForEquivalentItem.PlmnIdentity.MarshalPER(w, enc); err != nil { @@ -4498,7 +4517,7 @@ func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4527,7 +4546,7 @@ func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, &cNTypeRestrictionsForEquivalentItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, &cNTypeRestrictionsForEquivalentItem.iEExtensions); err != nil { return err } } @@ -4539,14 +4558,14 @@ func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) return nil } -var extIEsCNTypeRestrictionsForEquivalentItem []ap.IESpec[ProtocolIEID, CNTypeRestrictionsForEquivalentItem] +var extIEsCNTypeRestrictionsForEquivalentItem []apimpl.IESpec[ProtocolIEID, CNTypeRestrictionsForEquivalentItem] -func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cNTypeRestrictionsForEquivalentItem *CNTypeRestrictionsForEquivalentItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cNTypeRestrictionsForEquivalentItem.CnType.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCNTypeRestrictionsForEquivalentItem, cNTypeRestrictionsForEquivalentItem, &cNTypeRestrictionsForEquivalentItem.iEExtensions) return notComprehended } @@ -4567,7 +4586,7 @@ func (cNTypeRestrictionsForEquivalentItemCnType CNTypeRestrictionsForEquivalentI return enumCNTypeRestrictionsForEquivalentItemCnType.Name(cNTypeRestrictionsForEquivalentItemCnType) } -func (cNTypeRestrictionsForEquivalentItemCnType CNTypeRestrictionsForEquivalentItemCnType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cNTypeRestrictionsForEquivalentItemCnType CNTypeRestrictionsForEquivalentItemCnType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCNTypeRestrictionsForEquivalentItemCnType.Known(cNTypeRestrictionsForEquivalentItemCnType) } @@ -4588,7 +4607,7 @@ func (cNTypeRestrictionsForServing CNTypeRestrictionsForServing) Name() string { return enumCNTypeRestrictionsForServing.Name(cNTypeRestrictionsForServing) } -func (cNTypeRestrictionsForServing CNTypeRestrictionsForServing) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cNTypeRestrictionsForServing CNTypeRestrictionsForServing) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCNTypeRestrictionsForServing.Known(cNTypeRestrictionsForServing) } @@ -4614,12 +4633,12 @@ func (cPTransportLayerInformation *CPTransportLayerInformation) MarshalPER(w *pe if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDEndpointIPAddressAndPort, Criticality: cPTransportLayerInformation.choiceCriticality.Of(ap.CriticalityReject), Value: cPTransportLayerInformation.EndpointIPAddressAndPort}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDEndpointIPAddressAndPort, Criticality: cPTransportLayerInformation.choiceCriticality.Of(apimpl.CriticalityReject), Value: cPTransportLayerInformation.EndpointIPAddressAndPort}) case cPTransportLayerInformation.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, cPTransportLayerInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, cPTransportLayerInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -4640,22 +4659,18 @@ func (cPTransportLayerInformation *CPTransportLayerInformation) UnmarshalPER(r * } cPTransportLayerInformation.EndpointIPAddress = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDEndpointIPAddressAndPort: var v EndpointIPAddressAndPort - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - cPTransportLayerInformation.ChoiceExtension = &f - break - } cPTransportLayerInformation.EndpointIPAddressAndPort = &v - cPTransportLayerInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + cPTransportLayerInformation.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityReject) default: cPTransportLayerInformation.ChoiceExtension = &f } @@ -4665,13 +4680,13 @@ func (cPTransportLayerInformation *CPTransportLayerInformation) UnmarshalPER(r * return nil } -func (cPTransportLayerInformation *CPTransportLayerInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cPTransportLayerInformation *CPTransportLayerInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case cPTransportLayerInformation.EndpointIPAddress != nil: case cPTransportLayerInformation.EndpointIPAddressAndPort != nil: - d.IE(IDEndpointIPAddressAndPort, cPTransportLayerInformation.choiceCriticality.Of(ap.CriticalityReject), cPTransportLayerInformation.EndpointIPAddressAndPort) + return apimpl.DiagnoseChoiceExtension(d, IDEndpointIPAddressAndPort, cPTransportLayerInformation.choiceCriticality.Of(apimpl.CriticalityReject), &cPTransportLayerInformation.EndpointIPAddressAndPort, &cPTransportLayerInformation.ChoiceExtension) case cPTransportLayerInformation.ChoiceExtension != nil: - d.Unknown(cPTransportLayerInformation.ChoiceExtension.ID, cPTransportLayerInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, cPTransportLayerInformation.ChoiceExtension) } return false } @@ -4693,12 +4708,12 @@ func (cancelAllWarningMessages CancelAllWarningMessages) Name() string { return enumCancelAllWarningMessages.Name(cancelAllWarningMessages) } -func (cancelAllWarningMessages CancelAllWarningMessages) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cancelAllWarningMessages CancelAllWarningMessages) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCancelAllWarningMessages.Known(cancelAllWarningMessages) } func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem.iEExtensions) w.WriteBit(cancelledCellsInEAIEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cancelledCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { @@ -4708,7 +4723,7 @@ func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4739,7 +4754,7 @@ func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) UnmarshalPER(r } cancelledCellsInEAIEUTRAItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, &cancelledCellsInEAIEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, &cancelledCellsInEAIEUTRAItem.iEExtensions); err != nil { return err } } @@ -4751,19 +4766,19 @@ func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) UnmarshalPER(r return nil } -var extIEsCancelledCellsInEAIEUTRAItem []ap.IESpec[ProtocolIEID, CancelledCellsInEAIEUTRAItem] +var extIEsCancelledCellsInEAIEUTRAItem []apimpl.IESpec[ProtocolIEID, CancelledCellsInEAIEUTRAItem] -func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cancelledCellsInEAIEUTRAItem *CancelledCellsInEAIEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cancelledCellsInEAIEUTRAItem.EUTRACGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCancelledCellsInEAIEUTRAItem, cancelledCellsInEAIEUTRAItem, &cancelledCellsInEAIEUTRAItem.iEExtensions) return notComprehended } func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, cancelledCellsInEAINRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, cancelledCellsInEAINRItem.iEExtensions) w.WriteBit(cancelledCellsInEAINRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cancelledCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { @@ -4773,7 +4788,7 @@ func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4804,7 +4819,7 @@ func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) UnmarshalPER(r *per. } cancelledCellsInEAINRItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, &cancelledCellsInEAINRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, &cancelledCellsInEAINRItem.iEExtensions); err != nil { return err } } @@ -4816,19 +4831,19 @@ func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) UnmarshalPER(r *per. return nil } -var extIEsCancelledCellsInEAINRItem []ap.IESpec[ProtocolIEID, CancelledCellsInEAINRItem] +var extIEsCancelledCellsInEAINRItem []apimpl.IESpec[ProtocolIEID, CancelledCellsInEAINRItem] -func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cancelledCellsInEAINRItem *CancelledCellsInEAINRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cancelledCellsInEAINRItem.NRCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, cancelledCellsInEAINRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCancelledCellsInEAINRItem, cancelledCellsInEAINRItem, &cancelledCellsInEAINRItem.iEExtensions) return notComprehended } func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem.iEExtensions) w.WriteBit(cancelledCellsInTAIEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cancelledCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { @@ -4838,7 +4853,7 @@ func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4869,7 +4884,7 @@ func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) UnmarshalPER(r } cancelledCellsInTAIEUTRAItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, &cancelledCellsInTAIEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, &cancelledCellsInTAIEUTRAItem.iEExtensions); err != nil { return err } } @@ -4881,19 +4896,19 @@ func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) UnmarshalPER(r return nil } -var extIEsCancelledCellsInTAIEUTRAItem []ap.IESpec[ProtocolIEID, CancelledCellsInTAIEUTRAItem] +var extIEsCancelledCellsInTAIEUTRAItem []apimpl.IESpec[ProtocolIEID, CancelledCellsInTAIEUTRAItem] -func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cancelledCellsInTAIEUTRAItem *CancelledCellsInTAIEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cancelledCellsInTAIEUTRAItem.EUTRACGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCancelledCellsInTAIEUTRAItem, cancelledCellsInTAIEUTRAItem, &cancelledCellsInTAIEUTRAItem.iEExtensions) return notComprehended } func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, cancelledCellsInTAINRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, cancelledCellsInTAINRItem.iEExtensions) w.WriteBit(cancelledCellsInTAINRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cancelledCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { @@ -4903,7 +4918,7 @@ func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -4934,7 +4949,7 @@ func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) UnmarshalPER(r *per. } cancelledCellsInTAINRItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, &cancelledCellsInTAINRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, &cancelledCellsInTAINRItem.iEExtensions); err != nil { return err } } @@ -4946,14 +4961,14 @@ func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) UnmarshalPER(r *per. return nil } -var extIEsCancelledCellsInTAINRItem []ap.IESpec[ProtocolIEID, CancelledCellsInTAINRItem] +var extIEsCancelledCellsInTAINRItem []apimpl.IESpec[ProtocolIEID, CancelledCellsInTAINRItem] -func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cancelledCellsInTAINRItem *CancelledCellsInTAINRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cancelledCellsInTAINRItem.NRCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, cancelledCellsInTAINRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCancelledCellsInTAINRItem, cancelledCellsInTAINRItem, &cancelledCellsInTAINRItem.iEExtensions) return notComprehended } @@ -4986,7 +5001,7 @@ func (candidateCell *CandidateCell) MarshalPER(w *per.Writer, enc per.Encoding) if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, candidateCell.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, candidateCell.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -5013,7 +5028,7 @@ func (candidateCell *CandidateCell) UnmarshalPER(r *per.Reader, enc per.Encoding } candidateCell.CandidatePCI = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -5027,27 +5042,27 @@ func (candidateCell *CandidateCell) UnmarshalPER(r *per.Reader, enc per.Encoding return nil } -func (candidateCell *CandidateCell) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (candidateCell *CandidateCell) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case candidateCell.CandidateCGI != nil: return candidateCell.CandidateCGI.Diagnose(d) case candidateCell.CandidatePCI != nil: return candidateCell.CandidatePCI.Diagnose(d) case candidateCell.ChoiceExtension != nil: - d.Unknown(candidateCell.ChoiceExtension.ID, candidateCell.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, candidateCell.ChoiceExtension) } return false } func (candidateCellID *CandidateCellID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCandidateCellID, candidateCellID, candidateCellID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCandidateCellID, candidateCellID, candidateCellID.iEExtensions) w.WriteBit(candidateCellID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := candidateCellID.CandidateCellID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5073,7 +5088,7 @@ func (candidateCellID *CandidateCellID) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidateCellID, candidateCellID, &candidateCellID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCandidateCellID, candidateCellID, &candidateCellID.iEExtensions); err != nil { return err } } @@ -5085,26 +5100,26 @@ func (candidateCellID *CandidateCellID) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsCandidateCellID []ap.IESpec[ProtocolIEID, CandidateCellID] +var extIEsCandidateCellID []apimpl.IESpec[ProtocolIEID, CandidateCellID] -func (candidateCellID *CandidateCellID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (candidateCellID *CandidateCellID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if candidateCellID.CandidateCellID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCandidateCellID, candidateCellID, candidateCellID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCandidateCellID, candidateCellID, &candidateCellID.iEExtensions) return notComprehended } func (candidateCellItem *CandidateCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCandidateCellItem, candidateCellItem, candidateCellItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCandidateCellItem, candidateCellItem, candidateCellItem.iEExtensions) w.WriteBit(candidateCellItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := candidateCellItem.CandidateCell.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5130,7 +5145,7 @@ func (candidateCellItem *CandidateCellItem) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidateCellItem, candidateCellItem, &candidateCellItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCandidateCellItem, candidateCellItem, &candidateCellItem.iEExtensions); err != nil { return err } } @@ -5142,19 +5157,19 @@ func (candidateCellItem *CandidateCellItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsCandidateCellItem []ap.IESpec[ProtocolIEID, CandidateCellItem] +var extIEsCandidateCellItem []apimpl.IESpec[ProtocolIEID, CandidateCellItem] -func (candidateCellItem *CandidateCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (candidateCellItem *CandidateCellItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if candidateCellItem.CandidateCell.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCandidateCellItem, candidateCellItem, candidateCellItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCandidateCellItem, candidateCellItem, &candidateCellItem.iEExtensions) return notComprehended } func (candidatePCI *CandidatePCI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCandidatePCI, candidatePCI, candidatePCI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCandidatePCI, candidatePCI, candidatePCI.iEExtensions) w.WriteBit(candidatePCI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := candidatePCI.CandidatePCI.MarshalPER(w, enc); err != nil { @@ -5164,7 +5179,7 @@ func (candidatePCI *CandidatePCI) MarshalPER(w *per.Writer, enc per.Encoding) er return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5193,7 +5208,7 @@ func (candidatePCI *CandidatePCI) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidatePCI, candidatePCI, &candidatePCI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCandidatePCI, candidatePCI, &candidatePCI.iEExtensions); err != nil { return err } } @@ -5205,26 +5220,26 @@ func (candidatePCI *CandidatePCI) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsCandidatePCI []ap.IESpec[ProtocolIEID, CandidatePCI] +var extIEsCandidatePCI []apimpl.IESpec[ProtocolIEID, CandidatePCI] -func (candidatePCI *CandidatePCI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (candidatePCI *CandidatePCI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if candidatePCI.CandidatePCI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCandidatePCI, candidatePCI, candidatePCI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCandidatePCI, candidatePCI, &candidatePCI.iEExtensions) return notComprehended } func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, candidateRelayUEInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, candidateRelayUEInformationItem.iEExtensions) w.WriteBit(candidateRelayUEInformationItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := candidateRelayUEInformationItem.CandidateRelayUEId.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5250,7 +5265,7 @@ func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) Unmarsha return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, &candidateRelayUEInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, &candidateRelayUEInformationItem.iEExtensions); err != nil { return err } } @@ -5262,11 +5277,11 @@ func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) Unmarsha return nil } -var extIEsCandidateRelayUEInformationItem []ap.IESpec[ProtocolIEID, CandidateRelayUEInformationItem] +var extIEsCandidateRelayUEInformationItem []apimpl.IESpec[ProtocolIEID, CandidateRelayUEInformationItem] -func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (candidateRelayUEInformationItem *CandidateRelayUEInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, candidateRelayUEInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCandidateRelayUEInformationItem, candidateRelayUEInformationItem, &candidateRelayUEInformationItem.iEExtensions) return notComprehended } @@ -5320,7 +5335,7 @@ func (cause *Cause) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 5, 5); err != nil { return err } - return ap.EncodeField(profile, w, enc, cause.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, cause.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -5365,7 +5380,7 @@ func (cause *Cause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } cause.Misc = &v case 5: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -5379,7 +5394,7 @@ func (cause *Cause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (cause *Cause) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cause *Cause) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case cause.RadioNetwork != nil: return cause.RadioNetwork.Diagnose(d) @@ -5392,7 +5407,7 @@ func (cause *Cause) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { case cause.Misc != nil: return cause.Misc.Diagnose(d) case cause.ChoiceExtension != nil: - d.Unknown(cause.ChoiceExtension.ID, cause.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, cause.ChoiceExtension) } return false } @@ -5414,7 +5429,7 @@ func (causeMisc CauseMisc) Name() string { return enumCauseMisc.Name(causeMisc) } -func (causeMisc CauseMisc) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeMisc CauseMisc) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseMisc.Known(causeMisc) } @@ -5435,7 +5450,7 @@ func (causeNas CauseNas) Name() string { return enumCauseNas.Name(causeNas) } -func (causeNas CauseNas) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeNas CauseNas) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseNas.Known(causeNas) } @@ -5456,7 +5471,7 @@ func (causeProtocol CauseProtocol) Name() string { return enumCauseProtocol.Name(causeProtocol) } -func (causeProtocol CauseProtocol) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeProtocol CauseProtocol) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseProtocol.Known(causeProtocol) } @@ -5477,7 +5492,7 @@ func (causeRadioNetwork CauseRadioNetwork) Name() string { return enumCauseRadioNetwork.Name(causeRadioNetwork) } -func (causeRadioNetwork CauseRadioNetwork) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeRadioNetwork CauseRadioNetwork) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseRadioNetwork.Known(causeRadioNetwork) } @@ -5498,19 +5513,19 @@ func (causeTransport CauseTransport) Name() string { return enumCauseTransport.Name(causeTransport) } -func (causeTransport CauseTransport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeTransport CauseTransport) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseTransport.Known(causeTransport) } func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, cellBasedMDTEUTRA.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, cellBasedMDTEUTRA.iEExtensions) w.WriteBit(cellBasedMDTEUTRA.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellBasedMDTEUTRA.CellIdListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5536,7 +5551,7 @@ func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, &cellBasedMDTEUTRA.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, &cellBasedMDTEUTRA.iEExtensions); err != nil { return err } } @@ -5548,26 +5563,26 @@ func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsCellBasedMDTEUTRA []ap.IESpec[ProtocolIEID, CellBasedMDTEUTRA] +var extIEsCellBasedMDTEUTRA []apimpl.IESpec[ProtocolIEID, CellBasedMDTEUTRA] -func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellBasedMDTEUTRA *CellBasedMDTEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellBasedMDTEUTRA.CellIdListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, cellBasedMDTEUTRA.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellBasedMDTEUTRA, cellBasedMDTEUTRA, &cellBasedMDTEUTRA.iEExtensions) return notComprehended } func (cellBasedMDTNR *CellBasedMDTNR) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellBasedMDTNR, cellBasedMDTNR, cellBasedMDTNR.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellBasedMDTNR, cellBasedMDTNR, cellBasedMDTNR.iEExtensions) w.WriteBit(cellBasedMDTNR.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellBasedMDTNR.CellIdListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5593,7 +5608,7 @@ func (cellBasedMDTNR *CellBasedMDTNR) UnmarshalPER(r *per.Reader, enc per.Encodi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedMDTNR, cellBasedMDTNR, &cellBasedMDTNR.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedMDTNR, cellBasedMDTNR, &cellBasedMDTNR.iEExtensions); err != nil { return err } } @@ -5605,26 +5620,26 @@ func (cellBasedMDTNR *CellBasedMDTNR) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsCellBasedMDTNR []ap.IESpec[ProtocolIEID, CellBasedMDTNR] +var extIEsCellBasedMDTNR []apimpl.IESpec[ProtocolIEID, CellBasedMDTNR] -func (cellBasedMDTNR *CellBasedMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellBasedMDTNR *CellBasedMDTNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellBasedMDTNR.CellIdListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellBasedMDTNR, cellBasedMDTNR, cellBasedMDTNR.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellBasedMDTNR, cellBasedMDTNR, &cellBasedMDTNR.iEExtensions) return notComprehended } func (cellBasedQMC *CellBasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellBasedQMC, cellBasedQMC, cellBasedQMC.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellBasedQMC, cellBasedQMC, cellBasedQMC.iEExtensions) w.WriteBit(cellBasedQMC.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellBasedQMC.CellIdListforQMC.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5650,7 +5665,7 @@ func (cellBasedQMC *CellBasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedQMC, cellBasedQMC, &cellBasedQMC.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellBasedQMC, cellBasedQMC, &cellBasedQMC.iEExtensions); err != nil { return err } } @@ -5662,26 +5677,26 @@ func (cellBasedQMC *CellBasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsCellBasedQMC []ap.IESpec[ProtocolIEID, CellBasedQMC] +var extIEsCellBasedQMC []apimpl.IESpec[ProtocolIEID, CellBasedQMC] -func (cellBasedQMC *CellBasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellBasedQMC *CellBasedQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellBasedQMC.CellIdListforQMC.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellBasedQMC, cellBasedQMC, cellBasedQMC.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellBasedQMC, cellBasedQMC, &cellBasedQMC.iEExtensions) return notComprehended } func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem.iEExtensions) w.WriteBit(cellIDBroadcastEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellIDBroadcastEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5707,7 +5722,7 @@ func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, &cellIDBroadcastEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, &cellIDBroadcastEUTRAItem.iEExtensions); err != nil { return err } } @@ -5719,26 +5734,26 @@ func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) UnmarshalPER(r *per.Re return nil } -var extIEsCellIDBroadcastEUTRAItem []ap.IESpec[ProtocolIEID, CellIDBroadcastEUTRAItem] +var extIEsCellIDBroadcastEUTRAItem []apimpl.IESpec[ProtocolIEID, CellIDBroadcastEUTRAItem] -func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDBroadcastEUTRAItem *CellIDBroadcastEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellIDBroadcastEUTRAItem.EUTRACGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellIDBroadcastEUTRAItem, cellIDBroadcastEUTRAItem, &cellIDBroadcastEUTRAItem.iEExtensions) return notComprehended } func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, cellIDBroadcastNRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, cellIDBroadcastNRItem.iEExtensions) w.WriteBit(cellIDBroadcastNRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellIDBroadcastNRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5764,7 +5779,7 @@ func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, &cellIDBroadcastNRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, &cellIDBroadcastNRItem.iEExtensions); err != nil { return err } } @@ -5776,19 +5791,19 @@ func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsCellIDBroadcastNRItem []ap.IESpec[ProtocolIEID, CellIDBroadcastNRItem] +var extIEsCellIDBroadcastNRItem []apimpl.IESpec[ProtocolIEID, CellIDBroadcastNRItem] -func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDBroadcastNRItem *CellIDBroadcastNRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellIDBroadcastNRItem.NRCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, cellIDBroadcastNRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellIDBroadcastNRItem, cellIDBroadcastNRItem, &cellIDBroadcastNRItem.iEExtensions) return notComprehended } func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem.iEExtensions) w.WriteBit(cellIDCancelledEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellIDCancelledEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { @@ -5798,7 +5813,7 @@ func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5829,7 +5844,7 @@ func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) UnmarshalPER(r *per.Re } cellIDCancelledEUTRAItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, &cellIDCancelledEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, &cellIDCancelledEUTRAItem.iEExtensions); err != nil { return err } } @@ -5841,19 +5856,19 @@ func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) UnmarshalPER(r *per.Re return nil } -var extIEsCellIDCancelledEUTRAItem []ap.IESpec[ProtocolIEID, CellIDCancelledEUTRAItem] +var extIEsCellIDCancelledEUTRAItem []apimpl.IESpec[ProtocolIEID, CellIDCancelledEUTRAItem] -func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDCancelledEUTRAItem *CellIDCancelledEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellIDCancelledEUTRAItem.EUTRACGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellIDCancelledEUTRAItem, cellIDCancelledEUTRAItem, &cellIDCancelledEUTRAItem.iEExtensions) return notComprehended } func (cellIDCancelledNRItem *CellIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, cellIDCancelledNRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, cellIDCancelledNRItem.iEExtensions) w.WriteBit(cellIDCancelledNRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellIDCancelledNRItem.NRCGI.MarshalPER(w, enc); err != nil { @@ -5863,7 +5878,7 @@ func (cellIDCancelledNRItem *CellIDCancelledNRItem) MarshalPER(w *per.Writer, en return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -5894,7 +5909,7 @@ func (cellIDCancelledNRItem *CellIDCancelledNRItem) UnmarshalPER(r *per.Reader, } cellIDCancelledNRItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, &cellIDCancelledNRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, &cellIDCancelledNRItem.iEExtensions); err != nil { return err } } @@ -5906,14 +5921,14 @@ func (cellIDCancelledNRItem *CellIDCancelledNRItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsCellIDCancelledNRItem []ap.IESpec[ProtocolIEID, CellIDCancelledNRItem] +var extIEsCellIDCancelledNRItem []apimpl.IESpec[ProtocolIEID, CellIDCancelledNRItem] -func (cellIDCancelledNRItem *CellIDCancelledNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDCancelledNRItem *CellIDCancelledNRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellIDCancelledNRItem.NRCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, cellIDCancelledNRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellIDCancelledNRItem, cellIDCancelledNRItem, &cellIDCancelledNRItem.iEExtensions) return notComprehended } @@ -5946,7 +5961,7 @@ func (cellIDListForRestart *CellIDListForRestart) MarshalPER(w *per.Writer, enc if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, cellIDListForRestart.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, cellIDListForRestart.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -5973,7 +5988,7 @@ func (cellIDListForRestart *CellIDListForRestart) UnmarshalPER(r *per.Reader, en } cellIDListForRestart.NRCGIListforRestart = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -5987,14 +6002,14 @@ func (cellIDListForRestart *CellIDListForRestart) UnmarshalPER(r *per.Reader, en return nil } -func (cellIDListForRestart *CellIDListForRestart) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDListForRestart *CellIDListForRestart) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case cellIDListForRestart.EUTRACGIListforRestart != nil: return cellIDListForRestart.EUTRACGIListforRestart.Diagnose(d) case cellIDListForRestart.NRCGIListforRestart != nil: return cellIDListForRestart.NRCGIListforRestart.Diagnose(d) case cellIDListForRestart.ChoiceExtension != nil: - d.Unknown(cellIDListForRestart.ChoiceExtension.ID, cellIDListForRestart.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, cellIDListForRestart.ChoiceExtension) } return false } @@ -6016,19 +6031,19 @@ func (cellSize CellSize) Name() string { return enumCellSize.Name(cellSize) } -func (cellSize CellSize) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cellSize CellSize) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCellSize.Known(cellSize) } func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellType, cellType, cellType.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellType, cellType, cellType.iEExtensions) w.WriteBit(cellType.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellType.CellSize.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6054,7 +6069,7 @@ func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellType, cellType, &cellType.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellType, cellType, &cellType.iEExtensions); err != nil { return err } } @@ -6066,19 +6081,19 @@ func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsCellType []ap.IESpec[ProtocolIEID, CellType] +var extIEsCellType []apimpl.IESpec[ProtocolIEID, CellType] -func (cellType *CellType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellType *CellType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellType.CellSize.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellType, cellType, cellType.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellType, cellType, &cellType.iEExtensions) return notComprehended } func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria.iEExtensions) + ext := apimpl.ExtensionFields(extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria.iEExtensions) w.WriteBit(clockQualityAcceptanceCriteria.extensions.Present()) w.WriteBit(clockQualityAcceptanceCriteria.SynchronisationState != nil) w.WriteBit(clockQualityAcceptanceCriteria.TraceabletoUTC != nil) @@ -6118,7 +6133,7 @@ func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) MarshalPER } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6207,7 +6222,7 @@ func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) UnmarshalP clockQualityAcceptanceCriteria.ParentTImeSource = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, &clockQualityAcceptanceCriteria.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, &clockQualityAcceptanceCriteria.iEExtensions); err != nil { return err } } @@ -6219,9 +6234,9 @@ func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) UnmarshalP return nil } -var extIEsClockQualityAcceptanceCriteria []ap.IESpec[ProtocolIEID, ClockQualityAcceptanceCriteria] +var extIEsClockQualityAcceptanceCriteria []apimpl.IESpec[ProtocolIEID, ClockQualityAcceptanceCriteria] -func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if clockQualityAcceptanceCriteria.TraceabletoUTC != nil && clockQualityAcceptanceCriteria.TraceabletoUTC.Diagnose(d) { notComprehended = true @@ -6232,7 +6247,7 @@ func (clockQualityAcceptanceCriteria *ClockQualityAcceptanceCriteria) Diagnose(d if clockQualityAcceptanceCriteria.ClockAccuracy != nil && clockQualityAcceptanceCriteria.ClockAccuracy.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsClockQualityAcceptanceCriteria, clockQualityAcceptanceCriteria, &clockQualityAcceptanceCriteria.iEExtensions) return notComprehended } @@ -6253,7 +6268,7 @@ func (clockQualityAcceptanceCriteriaTraceabletoGNSS ClockQualityAcceptanceCriter return enumClockQualityAcceptanceCriteriaTraceabletoGNSS.Name(clockQualityAcceptanceCriteriaTraceabletoGNSS) } -func (clockQualityAcceptanceCriteriaTraceabletoGNSS ClockQualityAcceptanceCriteriaTraceabletoGNSS) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (clockQualityAcceptanceCriteriaTraceabletoGNSS ClockQualityAcceptanceCriteriaTraceabletoGNSS) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumClockQualityAcceptanceCriteriaTraceabletoGNSS.Known(clockQualityAcceptanceCriteriaTraceabletoGNSS) } @@ -6274,19 +6289,19 @@ func (clockQualityAcceptanceCriteriaTraceabletoUTC ClockQualityAcceptanceCriteri return enumClockQualityAcceptanceCriteriaTraceabletoUTC.Name(clockQualityAcceptanceCriteriaTraceabletoUTC) } -func (clockQualityAcceptanceCriteriaTraceabletoUTC ClockQualityAcceptanceCriteriaTraceabletoUTC) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (clockQualityAcceptanceCriteriaTraceabletoUTC ClockQualityAcceptanceCriteriaTraceabletoUTC) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumClockQualityAcceptanceCriteriaTraceabletoUTC.Known(clockQualityAcceptanceCriteriaTraceabletoUTC) } func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, clockQualityAcceptanceIndication.iEExtensions) + ext := apimpl.ExtensionFields(extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, clockQualityAcceptanceIndication.iEExtensions) w.WriteBit(clockQualityAcceptanceIndication.extensions.Present()) w.WriteBit(len(ext) > 0) if err := clockQualityAcceptanceIndication.ClockQualityAcceptanceCriteria.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6312,7 +6327,7 @@ func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) Unmars return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, &clockQualityAcceptanceIndication.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, &clockQualityAcceptanceIndication.iEExtensions); err != nil { return err } } @@ -6324,14 +6339,14 @@ func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) Unmars return nil } -var extIEsClockQualityAcceptanceIndication []ap.IESpec[ProtocolIEID, ClockQualityAcceptanceIndication] +var extIEsClockQualityAcceptanceIndication []apimpl.IESpec[ProtocolIEID, ClockQualityAcceptanceIndication] -func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (clockQualityAcceptanceIndication *ClockQualityAcceptanceIndication) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if clockQualityAcceptanceIndication.ClockQualityAcceptanceCriteria.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, clockQualityAcceptanceIndication.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsClockQualityAcceptanceIndication, clockQualityAcceptanceIndication, &clockQualityAcceptanceIndication.iEExtensions) return notComprehended } @@ -6364,7 +6379,7 @@ func (clockQualityDetailLevel *ClockQualityDetailLevel) MarshalPER(w *per.Writer if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, clockQualityDetailLevel.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, clockQualityDetailLevel.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -6391,7 +6406,7 @@ func (clockQualityDetailLevel *ClockQualityDetailLevel) UnmarshalPER(r *per.Read } clockQualityDetailLevel.ClockQualityAcceptanceIndication = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -6405,26 +6420,26 @@ func (clockQualityDetailLevel *ClockQualityDetailLevel) UnmarshalPER(r *per.Read return nil } -func (clockQualityDetailLevel *ClockQualityDetailLevel) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (clockQualityDetailLevel *ClockQualityDetailLevel) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case clockQualityDetailLevel.ClockQualityMetrics != nil: case clockQualityDetailLevel.ClockQualityAcceptanceIndication != nil: return clockQualityDetailLevel.ClockQualityAcceptanceIndication.Diagnose(d) case clockQualityDetailLevel.ChoiceExtension != nil: - d.Unknown(clockQualityDetailLevel.ChoiceExtension.ID, clockQualityDetailLevel.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, clockQualityDetailLevel.ChoiceExtension) } return false } func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, clockQualityReportingControlInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, clockQualityReportingControlInfo.iEExtensions) w.WriteBit(clockQualityReportingControlInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := clockQualityReportingControlInfo.ClockQualityDetailLevel.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6450,7 +6465,7 @@ func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) Unmars return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, &clockQualityReportingControlInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, &clockQualityReportingControlInfo.iEExtensions); err != nil { return err } } @@ -6462,14 +6477,14 @@ func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) Unmars return nil } -var extIEsClockQualityReportingControlInfo []ap.IESpec[ProtocolIEID, ClockQualityReportingControlInfo] +var extIEsClockQualityReportingControlInfo []apimpl.IESpec[ProtocolIEID, ClockQualityReportingControlInfo] -func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (clockQualityReportingControlInfo *ClockQualityReportingControlInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if clockQualityReportingControlInfo.ClockQualityDetailLevel.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, clockQualityReportingControlInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsClockQualityReportingControlInfo, clockQualityReportingControlInfo, &clockQualityReportingControlInfo.iEExtensions) return notComprehended } @@ -6490,19 +6505,19 @@ func (commServiceType CommServiceType) Name() string { return enumCommServiceType.Name(commServiceType) } -func (commServiceType CommServiceType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (commServiceType CommServiceType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCommServiceType.Known(commServiceType) } func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem.iEExtensions) w.WriteBit(completedCellsInEAIEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := completedCellsInEAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6528,7 +6543,7 @@ func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, &completedCellsInEAIEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, &completedCellsInEAIEUTRAItem.iEExtensions); err != nil { return err } } @@ -6540,26 +6555,26 @@ func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) UnmarshalPER(r return nil } -var extIEsCompletedCellsInEAIEUTRAItem []ap.IESpec[ProtocolIEID, CompletedCellsInEAIEUTRAItem] +var extIEsCompletedCellsInEAIEUTRAItem []apimpl.IESpec[ProtocolIEID, CompletedCellsInEAIEUTRAItem] -func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (completedCellsInEAIEUTRAItem *CompletedCellsInEAIEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if completedCellsInEAIEUTRAItem.EUTRACGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCompletedCellsInEAIEUTRAItem, completedCellsInEAIEUTRAItem, &completedCellsInEAIEUTRAItem.iEExtensions) return notComprehended } func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, completedCellsInEAINRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, completedCellsInEAINRItem.iEExtensions) w.WriteBit(completedCellsInEAINRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := completedCellsInEAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6585,7 +6600,7 @@ func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, &completedCellsInEAINRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, &completedCellsInEAINRItem.iEExtensions); err != nil { return err } } @@ -6597,26 +6612,26 @@ func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) UnmarshalPER(r *per. return nil } -var extIEsCompletedCellsInEAINRItem []ap.IESpec[ProtocolIEID, CompletedCellsInEAINRItem] +var extIEsCompletedCellsInEAINRItem []apimpl.IESpec[ProtocolIEID, CompletedCellsInEAINRItem] -func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (completedCellsInEAINRItem *CompletedCellsInEAINRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if completedCellsInEAINRItem.NRCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, completedCellsInEAINRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCompletedCellsInEAINRItem, completedCellsInEAINRItem, &completedCellsInEAINRItem.iEExtensions) return notComprehended } func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem.iEExtensions) w.WriteBit(completedCellsInTAIEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := completedCellsInTAIEUTRAItem.EUTRACGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6642,7 +6657,7 @@ func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, &completedCellsInTAIEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, &completedCellsInTAIEUTRAItem.iEExtensions); err != nil { return err } } @@ -6654,26 +6669,26 @@ func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) UnmarshalPER(r return nil } -var extIEsCompletedCellsInTAIEUTRAItem []ap.IESpec[ProtocolIEID, CompletedCellsInTAIEUTRAItem] +var extIEsCompletedCellsInTAIEUTRAItem []apimpl.IESpec[ProtocolIEID, CompletedCellsInTAIEUTRAItem] -func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (completedCellsInTAIEUTRAItem *CompletedCellsInTAIEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if completedCellsInTAIEUTRAItem.EUTRACGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCompletedCellsInTAIEUTRAItem, completedCellsInTAIEUTRAItem, &completedCellsInTAIEUTRAItem.iEExtensions) return notComprehended } func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, completedCellsInTAINRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, completedCellsInTAINRItem.iEExtensions) w.WriteBit(completedCellsInTAINRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := completedCellsInTAINRItem.NRCGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6699,7 +6714,7 @@ func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, &completedCellsInTAINRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, &completedCellsInTAINRItem.iEExtensions); err != nil { return err } } @@ -6711,19 +6726,19 @@ func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) UnmarshalPER(r *per. return nil } -var extIEsCompletedCellsInTAINRItem []ap.IESpec[ProtocolIEID, CompletedCellsInTAINRItem] +var extIEsCompletedCellsInTAINRItem []apimpl.IESpec[ProtocolIEID, CompletedCellsInTAINRItem] -func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (completedCellsInTAINRItem *CompletedCellsInTAINRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if completedCellsInTAINRItem.NRCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, completedCellsInTAINRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCompletedCellsInTAINRItem, completedCellsInTAINRItem, &completedCellsInTAINRItem.iEExtensions) return notComprehended } func (compositeAvailableCapacity *CompositeAvailableCapacity) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCompositeAvailableCapacity, compositeAvailableCapacity, compositeAvailableCapacity.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCompositeAvailableCapacity, compositeAvailableCapacity, compositeAvailableCapacity.iEExtensions) w.WriteBit(compositeAvailableCapacity.extensions.Present()) w.WriteBit(compositeAvailableCapacity.CellCapacityClassValue != nil) w.WriteBit(len(ext) > 0) @@ -6736,7 +6751,7 @@ func (compositeAvailableCapacity *CompositeAvailableCapacity) MarshalPER(w *per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6773,7 +6788,7 @@ func (compositeAvailableCapacity *CompositeAvailableCapacity) UnmarshalPER(r *pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompositeAvailableCapacity, compositeAvailableCapacity, &compositeAvailableCapacity.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCompositeAvailableCapacity, compositeAvailableCapacity, &compositeAvailableCapacity.iEExtensions); err != nil { return err } } @@ -6785,14 +6800,14 @@ func (compositeAvailableCapacity *CompositeAvailableCapacity) UnmarshalPER(r *pe return nil } -var extIEsCompositeAvailableCapacity []ap.IESpec[ProtocolIEID, CompositeAvailableCapacity] +var extIEsCompositeAvailableCapacity []apimpl.IESpec[ProtocolIEID, CompositeAvailableCapacity] -func (compositeAvailableCapacity *CompositeAvailableCapacity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (compositeAvailableCapacity *CompositeAvailableCapacity) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if compositeAvailableCapacity.CellCapacityClassValue != nil && compositeAvailableCapacity.CellCapacityClassValue.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCompositeAvailableCapacity, compositeAvailableCapacity, compositeAvailableCapacity.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCompositeAvailableCapacity, compositeAvailableCapacity, &compositeAvailableCapacity.iEExtensions) return notComprehended } @@ -6813,7 +6828,7 @@ func (concurrentWarningMessageInd ConcurrentWarningMessageInd) Name() string { return enumConcurrentWarningMessageInd.Name(concurrentWarningMessageInd) } -func (concurrentWarningMessageInd ConcurrentWarningMessageInd) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (concurrentWarningMessageInd ConcurrentWarningMessageInd) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumConcurrentWarningMessageInd.Known(concurrentWarningMessageInd) } @@ -6834,7 +6849,7 @@ func (confidentialityProtectionIndication ConfidentialityProtectionIndication) N return enumConfidentialityProtectionIndication.Name(confidentialityProtectionIndication) } -func (confidentialityProtectionIndication ConfidentialityProtectionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (confidentialityProtectionIndication ConfidentialityProtectionIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumConfidentialityProtectionIndication.Known(confidentialityProtectionIndication) } @@ -6855,7 +6870,7 @@ func (confidentialityProtectionResult ConfidentialityProtectionResult) Name() st return enumConfidentialityProtectionResult.Name(confidentialityProtectionResult) } -func (confidentialityProtectionResult ConfidentialityProtectionResult) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (confidentialityProtectionResult ConfidentialityProtectionResult) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumConfidentialityProtectionResult.Known(confidentialityProtectionResult) } @@ -6876,7 +6891,7 @@ func (configuredTACIndication ConfiguredTACIndication) Name() string { return enumConfiguredTACIndication.Name(configuredTACIndication) } -func (configuredTACIndication ConfiguredTACIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (configuredTACIndication ConfiguredTACIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumConfiguredTACIndication.Known(configuredTACIndication) } @@ -6897,12 +6912,12 @@ func (congestionInformationRequest CongestionInformationRequest) Name() string { return enumCongestionInformationRequest.Name(congestionInformationRequest) } -func (congestionInformationRequest CongestionInformationRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (congestionInformationRequest CongestionInformationRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCongestionInformationRequest.Known(congestionInformationRequest) } func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive.iEExtensions) w.WriteBit(coreNetworkAssistanceInformationForInactive.extensions.Present()) w.WriteBit(coreNetworkAssistanceInformationForInactive.UESpecificDRX != nil) w.WriteBit(coreNetworkAssistanceInformationForInactive.MICOModeIndication != nil) @@ -6933,7 +6948,7 @@ func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformat } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6998,7 +7013,7 @@ func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformat coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, &coreNetworkAssistanceInformationForInactive.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, &coreNetworkAssistanceInformationForInactive.iEExtensions); err != nil { return err } } @@ -7010,11 +7025,11 @@ func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformat return nil } -var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID, CoreNetworkAssistanceInformationForInactive]{ +var extIEsCoreNetworkAssistanceInformationForInactive = []apimpl.IESpec[ProtocolIEID, CoreNetworkAssistanceInformationForInactive]{ { ID: IDEUTRAPagingeDRXInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v EUTRAPagingeDRXInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7029,11 +7044,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.EUTRAPagingeDRXInformation, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.EUTRAPagingeDRXInformation = nil + }, }, { ID: IDExtendedUEIdentityIndexValue, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v ExtendedUEIdentityIndexValue if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7048,11 +7066,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.ExtendedUEIdentityIndexValue, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.ExtendedUEIdentityIndexValue = nil + }, }, { ID: IDUERadioCapabilityForPaging, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v UERadioCapabilityForPaging if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7067,11 +7088,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.UERadioCapabilityForPaging, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.UERadioCapabilityForPaging = nil + }, }, { ID: IDMicoAllPLMN, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v MicoAllPLMN if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7086,11 +7110,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.MicoAllPLMN, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.MicoAllPLMN = nil + }, }, { ID: IDNRPagingeDRXInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v NRPagingeDRXInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7105,11 +7132,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.NRPagingeDRXInformation, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.NRPagingeDRXInformation = nil + }, }, { ID: IDPagingCauseIndicationForVoiceService, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v PagingCauseIndicationForVoiceService if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7124,11 +7154,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.PagingCauseIndicationForVoiceService, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.PagingCauseIndicationForVoiceService = nil + }, }, { ID: IDPEIPSassistanceInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v PEIPSassistanceInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7143,11 +7176,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.PEIPSassistanceInformation, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.PEIPSassistanceInformation = nil + }, }, { ID: IDHashedUEIdentityIndexValue, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v HashedUEIdentityIndexValue if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7162,11 +7198,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.HashedUEIdentityIndexValue, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.HashedUEIdentityIndexValue = nil + }, }, { ID: IDCNMTCommunicationHandling, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v CNMTCommunicationHandling if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7181,11 +7220,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.CNMTCommunicationHandling, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.CNMTCommunicationHandling = nil + }, }, { ID: IDLPWUSPSAssistanceInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v LPWUSPSAssistanceInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7200,11 +7242,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.LPWUSPSAssistanceInformation, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.LPWUSPSAssistanceInformation = nil + }, }, { ID: IDFurtherExtendedUEIdentityIndexValue, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v FurtherExtendedUEIdentityIndexValue if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7219,11 +7264,14 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.FurtherExtendedUEIdentityIndexValue, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.FurtherExtendedUEIdentityIndexValue = nil + }, }, { ID: IDLPWUSDisableIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *CoreNetworkAssistanceInformationForInactive, r *per.Reader, enc per.Encoding) error { var v LPWUSDisableIndication if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7238,10 +7286,13 @@ var extIEsCoreNetworkAssistanceInformationForInactive = []ap.IESpec[ProtocolIEID } return x.LPWUSDisableIndication, true }, + Clear: func(x *CoreNetworkAssistanceInformationForInactive) { + x.LPWUSDisableIndication = nil + }, }, } -func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformationForInactive) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if coreNetworkAssistanceInformationForInactive.UEIdentityIndexValue.Diagnose(d) { notComprehended = true @@ -7258,12 +7309,12 @@ func (coreNetworkAssistanceInformationForInactive *CoreNetworkAssistanceInformat if coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour != nil && coreNetworkAssistanceInformationForInactive.ExpectedUEBehaviour.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCoreNetworkAssistanceInformationForInactive, coreNetworkAssistanceInformationForInactive, &coreNetworkAssistanceInformationForInactive.iEExtensions) return notComprehended } func (criticalityDiagnostics *CriticalityDiagnostics) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) w.WriteBit(criticalityDiagnostics.extensions.Present()) w.WriteBit(criticalityDiagnostics.ProcedureCode != nil) w.WriteBit(criticalityDiagnostics.TriggeringMessage != nil) @@ -7291,7 +7342,7 @@ func (criticalityDiagnostics *CriticalityDiagnostics) MarshalPER(w *per.Writer, } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7360,7 +7411,7 @@ func (criticalityDiagnostics *CriticalityDiagnostics) UnmarshalPER(r *per.Reader } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions); err != nil { return err } } @@ -7372,19 +7423,19 @@ func (criticalityDiagnostics *CriticalityDiagnostics) UnmarshalPER(r *per.Reader return nil } -var extIEsCriticalityDiagnostics []ap.IESpec[ProtocolIEID, CriticalityDiagnostics] +var extIEsCriticalityDiagnostics []apimpl.IESpec[ProtocolIEID, CriticalityDiagnostics] -func (criticalityDiagnostics *CriticalityDiagnostics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (criticalityDiagnostics *CriticalityDiagnostics) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if criticalityDiagnostics.IEsCriticalityDiagnostics.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions) return notComprehended } func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) w.WriteBit(criticalityDiagnosticsIEItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { @@ -7397,7 +7448,7 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7433,7 +7484,7 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions); err != nil { return err } } @@ -7445,26 +7496,26 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r return nil } -var extIEsCriticalityDiagnosticsIEItem []ap.IESpec[ProtocolIEID, CriticalityDiagnosticsIEItem] +var extIEsCriticalityDiagnosticsIEItem []apimpl.IESpec[ProtocolIEID, CriticalityDiagnosticsIEItem] -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if criticalityDiagnosticsIEItem.TypeOfError.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions) return notComprehended } func (dAPSRequestInfo *DAPSRequestInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) w.WriteBit(dAPSRequestInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := dAPSRequestInfo.DAPSIndicator.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7490,7 +7541,7 @@ func (dAPSRequestInfo *DAPSRequestInfo) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions); err != nil { return err } } @@ -7502,14 +7553,14 @@ func (dAPSRequestInfo *DAPSRequestInfo) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsDAPSRequestInfo []ap.IESpec[ProtocolIEID, DAPSRequestInfo] +var extIEsDAPSRequestInfo []apimpl.IESpec[ProtocolIEID, DAPSRequestInfo] -func (dAPSRequestInfo *DAPSRequestInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dAPSRequestInfo *DAPSRequestInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if dAPSRequestInfo.DAPSIndicator.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions) return notComprehended } @@ -7530,7 +7581,7 @@ func (dAPSRequestInfoDAPSIndicator DAPSRequestInfoDAPSIndicator) Name() string { return enumDAPSRequestInfoDAPSIndicator.Name(dAPSRequestInfoDAPSIndicator) } -func (dAPSRequestInfoDAPSIndicator DAPSRequestInfoDAPSIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dAPSRequestInfoDAPSIndicator DAPSRequestInfoDAPSIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDAPSRequestInfoDAPSIndicator.Known(dAPSRequestInfoDAPSIndicator) } @@ -7551,7 +7602,7 @@ func (dLForwarding DLForwarding) Name() string { return enumDLForwarding.Name(dLForwarding) } -func (dLForwarding DLForwarding) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dLForwarding DLForwarding) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDLForwarding.Known(dLForwarding) } @@ -7572,7 +7623,7 @@ func (dLNGUTNLInformationReused DLNGUTNLInformationReused) Name() string { return enumDLNGUTNLInformationReused.Name(dLNGUTNLInformationReused) } -func (dLNGUTNLInformationReused DLNGUTNLInformationReused) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dLNGUTNLInformationReused DLNGUTNLInformationReused) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDLNGUTNLInformationReused.Known(dLNGUTNLInformationReused) } @@ -7593,12 +7644,12 @@ func (dLPDUSetInformationMarkingSupportIndication DLPDUSetInformationMarkingSupp return enumDLPDUSetInformationMarkingSupportIndication.Name(dLPDUSetInformationMarkingSupportIndication) } -func (dLPDUSetInformationMarkingSupportIndication DLPDUSetInformationMarkingSupportIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dLPDUSetInformationMarkingSupportIndication DLPDUSetInformationMarkingSupportIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDLPDUSetInformationMarkingSupportIndication.Known(dLPDUSetInformationMarkingSupportIndication) } func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem.iEExtensions) w.WriteBit(dRBsToQosFlowsMappingItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := dRBsToQosFlowsMappingItem.DRBID.MarshalPER(w, enc); err != nil { @@ -7608,7 +7659,7 @@ func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7637,7 +7688,7 @@ func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, &dRBsToQosFlowsMappingItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, &dRBsToQosFlowsMappingItem.iEExtensions); err != nil { return err } } @@ -7649,11 +7700,11 @@ func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) UnmarshalPER(r *per. return nil } -var extIEsDRBsToQosFlowsMappingItem = []ap.IESpec[ProtocolIEID, DRBsToQosFlowsMappingItem]{ +var extIEsDRBsToQosFlowsMappingItem = []apimpl.IESpec[ProtocolIEID, DRBsToQosFlowsMappingItem]{ { ID: IDDAPSRequestInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *DRBsToQosFlowsMappingItem, r *per.Reader, enc per.Encoding) error { var v DAPSRequestInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7668,10 +7719,13 @@ var extIEsDRBsToQosFlowsMappingItem = []ap.IESpec[ProtocolIEID, DRBsToQosFlowsMa } return x.DAPSRequestInfo, true }, + Clear: func(x *DRBsToQosFlowsMappingItem) { + x.DAPSRequestInfo = nil + }, }, } -func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if dRBsToQosFlowsMappingItem.DRBID.Diagnose(d) { notComprehended = true @@ -7679,7 +7733,7 @@ func (dRBsToQosFlowsMappingItem *DRBsToQosFlowsMappingItem) Diagnose(d *ap.Diagn if dRBsToQosFlowsMappingItem.AssociatedQosFlowList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsDRBsToQosFlowsMappingItem, dRBsToQosFlowsMappingItem, &dRBsToQosFlowsMappingItem.iEExtensions) return notComprehended } @@ -7700,7 +7754,7 @@ func (dataForwardingAccepted DataForwardingAccepted) Name() string { return enumDataForwardingAccepted.Name(dataForwardingAccepted) } -func (dataForwardingAccepted DataForwardingAccepted) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dataForwardingAccepted DataForwardingAccepted) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDataForwardingAccepted.Known(dataForwardingAccepted) } @@ -7721,12 +7775,12 @@ func (dataForwardingNotPossible DataForwardingNotPossible) Name() string { return enumDataForwardingNotPossible.Name(dataForwardingNotPossible) } -func (dataForwardingNotPossible DataForwardingNotPossible) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dataForwardingNotPossible DataForwardingNotPossible) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDataForwardingNotPossible.Known(dataForwardingNotPossible) } func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, dataForwardingResponseDRBItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, dataForwardingResponseDRBItem.iEExtensions) w.WriteBit(dataForwardingResponseDRBItem.extensions.Present()) w.WriteBit(dataForwardingResponseDRBItem.DLForwardingUPTNLInformation != nil) w.WriteBit(dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil) @@ -7745,7 +7799,7 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) MarshalPER(w } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7793,7 +7847,7 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER dataForwardingResponseDRBItem.ULForwardingUPTNLInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, &dataForwardingResponseDRBItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, &dataForwardingResponseDRBItem.iEExtensions); err != nil { return err } } @@ -7805,9 +7859,9 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) UnmarshalPER return nil } -var extIEsDataForwardingResponseDRBItem []ap.IESpec[ProtocolIEID, DataForwardingResponseDRBItem] +var extIEsDataForwardingResponseDRBItem []apimpl.IESpec[ProtocolIEID, DataForwardingResponseDRBItem] -func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if dataForwardingResponseDRBItem.DRBID.Diagnose(d) { notComprehended = true @@ -7818,12 +7872,12 @@ func (dataForwardingResponseDRBItem *DataForwardingResponseDRBItem) Diagnose(d * if dataForwardingResponseDRBItem.ULForwardingUPTNLInformation != nil && dataForwardingResponseDRBItem.ULForwardingUPTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, dataForwardingResponseDRBItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsDataForwardingResponseDRBItem, dataForwardingResponseDRBItem, &dataForwardingResponseDRBItem.iEExtensions) return notComprehended } func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, dataForwardingResponseERABListItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, dataForwardingResponseERABListItem.iEExtensions) w.WriteBit(dataForwardingResponseERABListItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := dataForwardingResponseERABListItem.ERABID.MarshalPER(w, enc); err != nil { @@ -7833,7 +7887,7 @@ func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) Ma return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7862,7 +7916,7 @@ func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) Un return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, &dataForwardingResponseERABListItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, &dataForwardingResponseERABListItem.iEExtensions); err != nil { return err } } @@ -7874,9 +7928,9 @@ func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) Un return nil } -var extIEsDataForwardingResponseERABListItem []ap.IESpec[ProtocolIEID, DataForwardingResponseERABListItem] +var extIEsDataForwardingResponseERABListItem []apimpl.IESpec[ProtocolIEID, DataForwardingResponseERABListItem] -func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if dataForwardingResponseERABListItem.ERABID.Diagnose(d) { notComprehended = true @@ -7884,7 +7938,7 @@ func (dataForwardingResponseERABListItem *DataForwardingResponseERABListItem) Di if dataForwardingResponseERABListItem.DLForwardingUPTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, dataForwardingResponseERABListItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsDataForwardingResponseERABListItem, dataForwardingResponseERABListItem, &dataForwardingResponseERABListItem.iEExtensions) return notComprehended } @@ -7905,7 +7959,7 @@ func (delayCritical DelayCritical) Name() string { return enumDelayCritical.Name(delayCritical) } -func (delayCritical DelayCritical) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (delayCritical DelayCritical) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDelayCritical.Known(delayCritical) } @@ -7926,12 +7980,12 @@ func (directForwardingPathAvailability DirectForwardingPathAvailability) Name() return enumDirectForwardingPathAvailability.Name(directForwardingPathAvailability) } -func (directForwardingPathAvailability DirectForwardingPathAvailability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (directForwardingPathAvailability DirectForwardingPathAvailability) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDirectForwardingPathAvailability.Known(directForwardingPathAvailability) } func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, dynamic5QIDescriptor.iEExtensions) + ext := apimpl.ExtensionFields(extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, dynamic5QIDescriptor.iEExtensions) w.WriteBit(dynamic5QIDescriptor.extensions.Present()) w.WriteBit(dynamic5QIDescriptor.FiveQI != nil) w.WriteBit(dynamic5QIDescriptor.DelayCritical != nil) @@ -7968,7 +8022,7 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) MarshalPER(w *per.Writer, enc } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8044,7 +8098,7 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, en dynamic5QIDescriptor.MaximumDataBurstVolume = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, &dynamic5QIDescriptor.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, &dynamic5QIDescriptor.iEExtensions); err != nil { return err } } @@ -8056,11 +8110,11 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) UnmarshalPER(r *per.Reader, en return nil } -var extIEsDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, Dynamic5QIDescriptor]{ +var extIEsDynamic5QIDescriptor = []apimpl.IESpec[ProtocolIEID, Dynamic5QIDescriptor]{ { ID: IDExtendedPacketDelayBudget, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *Dynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8075,11 +8129,14 @@ var extIEsDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, Dynamic5QIDescriptor] } return x.ExtendedPacketDelayBudget, true }, + Clear: func(x *Dynamic5QIDescriptor) { + x.ExtendedPacketDelayBudget = nil + }, }, { ID: IDCNPacketDelayBudgetDL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *Dynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8094,11 +8151,14 @@ var extIEsDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, Dynamic5QIDescriptor] } return x.CNPacketDelayBudgetDL, true }, + Clear: func(x *Dynamic5QIDescriptor) { + x.CNPacketDelayBudgetDL = nil + }, }, { ID: IDCNPacketDelayBudgetUL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *Dynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8113,10 +8173,13 @@ var extIEsDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, Dynamic5QIDescriptor] } return x.CNPacketDelayBudgetUL, true }, + Clear: func(x *Dynamic5QIDescriptor) { + x.CNPacketDelayBudgetUL = nil + }, }, } -func (dynamic5QIDescriptor *Dynamic5QIDescriptor) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dynamic5QIDescriptor *Dynamic5QIDescriptor) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if dynamic5QIDescriptor.PriorityLevelQos.Diagnose(d) { notComprehended = true @@ -8139,7 +8202,7 @@ func (dynamic5QIDescriptor *Dynamic5QIDescriptor) Diagnose(d *ap.Diagnosis[Proto if dynamic5QIDescriptor.MaximumDataBurstVolume != nil && dynamic5QIDescriptor.MaximumDataBurstVolume.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, dynamic5QIDescriptor.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsDynamic5QIDescriptor, dynamic5QIDescriptor, &dynamic5QIDescriptor.iEExtensions) return notComprehended } @@ -8160,7 +8223,7 @@ func (eCNMarkingAtRANRequest ECNMarkingAtRANRequest) Name() string { return enumECNMarkingAtRANRequest.Name(eCNMarkingAtRANRequest) } -func (eCNMarkingAtRANRequest ECNMarkingAtRANRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eCNMarkingAtRANRequest ECNMarkingAtRANRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumECNMarkingAtRANRequest.Known(eCNMarkingAtRANRequest) } @@ -8181,7 +8244,7 @@ func (eCNMarkingAtUPFRequest ECNMarkingAtUPFRequest) Name() string { return enumECNMarkingAtUPFRequest.Name(eCNMarkingAtUPFRequest) } -func (eCNMarkingAtUPFRequest ECNMarkingAtUPFRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eCNMarkingAtUPFRequest ECNMarkingAtUPFRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumECNMarkingAtUPFRequest.Known(eCNMarkingAtUPFRequest) } @@ -8221,7 +8284,7 @@ func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionI if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -8254,7 +8317,7 @@ func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionI } eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -8268,7 +8331,7 @@ func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionI return nil } -func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionInformationReportingRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionInformationReportingRequest) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest != nil: return eCNMarkingorCongestionInformationReportingRequest.ECNMarkingAtRANRequest.Diagnose(d) @@ -8277,13 +8340,13 @@ func (eCNMarkingorCongestionInformationReportingRequest *ECNMarkingorCongestionI case eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest != nil: return eCNMarkingorCongestionInformationReportingRequest.CongestionInformationRequest.Diagnose(d) case eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension != nil: - d.Unknown(eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension.ID, eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, eCNMarkingorCongestionInformationReportingRequest.ChoiceExtension) } return false } func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongestionInformationReportingStatusItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions) w.WriteBit(eCNMarkingorCongestionInformationReportingStatusItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eCNMarkingorCongestionInformationReportingStatusItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { @@ -8293,7 +8356,7 @@ func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongesti return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8322,7 +8385,7 @@ func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongesti return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, &eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, &eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions); err != nil { return err } } @@ -8334,9 +8397,9 @@ func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongesti return nil } -var extIEsECNMarkingorCongestionInformationReportingStatusItem []ap.IESpec[ProtocolIEID, ECNMarkingorCongestionInformationReportingStatusItem] +var extIEsECNMarkingorCongestionInformationReportingStatusItem []apimpl.IESpec[ProtocolIEID, ECNMarkingorCongestionInformationReportingStatusItem] -func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongestionInformationReportingStatusItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongestionInformationReportingStatusItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eCNMarkingorCongestionInformationReportingStatusItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -8344,7 +8407,7 @@ func (eCNMarkingorCongestionInformationReportingStatusItem *ECNMarkingorCongesti if eCNMarkingorCongestionInformationReportingStatusItem.ActivationStatus.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsECNMarkingorCongestionInformationReportingStatusItem, eCNMarkingorCongestionInformationReportingStatusItem, &eCNMarkingorCongestionInformationReportingStatusItem.iEExtensions) return notComprehended } @@ -8365,7 +8428,7 @@ func (eDTSession EDTSession) Name() string { return enumEDTSession.Name(eDTSession) } -func (eDTSession EDTSession) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eDTSession EDTSession) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEDTSession.Known(eDTSession) } @@ -8412,7 +8475,7 @@ func (eNBID *ENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, eNBID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, eNBID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -8451,7 +8514,7 @@ func (eNBID *ENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } eNBID.LongmacroENBID = &v case 4: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -8465,20 +8528,20 @@ func (eNBID *ENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (eNBID *ENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNBID *ENBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case eNBID.MacroENBID != nil: case eNBID.HomeENBID != nil: case eNBID.ShortmacroENBID != nil: case eNBID.LongmacroENBID != nil: case eNBID.ChoiceExtension != nil: - d.Unknown(eNBID.ChoiceExtension.ID, eNBID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, eNBID.ChoiceExtension) } return false } func (ePSTAI *EPSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEPSTAI, ePSTAI, ePSTAI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEPSTAI, ePSTAI, ePSTAI.iEExtensions) w.WriteBit(ePSTAI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := ePSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -8488,7 +8551,7 @@ func (ePSTAI *EPSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8517,7 +8580,7 @@ func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEPSTAI, ePSTAI, &ePSTAI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEPSTAI, ePSTAI, &ePSTAI.iEExtensions); err != nil { return err } } @@ -8529,16 +8592,16 @@ func (ePSTAI *EPSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsEPSTAI []ap.IESpec[ProtocolIEID, EPSTAI] +var extIEsEPSTAI []apimpl.IESpec[ProtocolIEID, EPSTAI] -func (ePSTAI *EPSTAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (ePSTAI *EPSTAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsEPSTAI, ePSTAI, ePSTAI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEPSTAI, ePSTAI, &ePSTAI.iEExtensions) return notComprehended } func (eRABInformationItem *ERABInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABInformationItem, eRABInformationItem, eRABInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsERABInformationItem, eRABInformationItem, eRABInformationItem.iEExtensions) w.WriteBit(eRABInformationItem.extensions.Present()) w.WriteBit(eRABInformationItem.DLForwarding != nil) w.WriteBit(len(ext) > 0) @@ -8551,7 +8614,7 @@ func (eRABInformationItem *ERABInformationItem) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8588,7 +8651,7 @@ func (eRABInformationItem *ERABInformationItem) UnmarshalPER(r *per.Reader, enc eRABInformationItem.DLForwarding = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABInformationItem, eRABInformationItem, &eRABInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABInformationItem, eRABInformationItem, &eRABInformationItem.iEExtensions); err != nil { return err } } @@ -8600,11 +8663,11 @@ func (eRABInformationItem *ERABInformationItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsERABInformationItem = []ap.IESpec[ProtocolIEID, ERABInformationItem]{ +var extIEsERABInformationItem = []apimpl.IESpec[ProtocolIEID, ERABInformationItem]{ { ID: IDSourceTNLAddrInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *ERABInformationItem, r *per.Reader, enc per.Encoding) error { var v TransportLayerAddress if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8619,11 +8682,14 @@ var extIEsERABInformationItem = []ap.IESpec[ProtocolIEID, ERABInformationItem]{ } return x.SourceTNLAddrInfo, true }, + Clear: func(x *ERABInformationItem) { + x.SourceTNLAddrInfo = nil + }, }, { ID: IDSourceNodeTNLAddrInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *ERABInformationItem, r *per.Reader, enc per.Encoding) error { var v TransportLayerAddress if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8638,10 +8704,13 @@ var extIEsERABInformationItem = []ap.IESpec[ProtocolIEID, ERABInformationItem]{ } return x.SourceNodeTNLAddrInfo, true }, + Clear: func(x *ERABInformationItem) { + x.SourceNodeTNLAddrInfo = nil + }, }, } -func (eRABInformationItem *ERABInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABInformationItem *ERABInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eRABInformationItem.ERABID.Diagnose(d) { notComprehended = true @@ -8649,7 +8718,7 @@ func (eRABInformationItem *ERABInformationItem) Diagnose(d *ap.Diagnosis[Protoco if eRABInformationItem.DLForwarding != nil && eRABInformationItem.DLForwarding.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABInformationItem, eRABInformationItem, eRABInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABInformationItem, eRABInformationItem, &eRABInformationItem.iEExtensions) return notComprehended } @@ -8670,12 +8739,12 @@ func (eRedCapIndication ERedCapIndication) Name() string { return enumERedCapIndication.Name(eRedCapIndication) } -func (eRedCapIndication ERedCapIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eRedCapIndication ERedCapIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumERedCapIndication.Known(eRedCapIndication) } func (eUTRACGI *EUTRACGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRACGI, eUTRACGI, eUTRACGI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRACGI, eUTRACGI, eUTRACGI.iEExtensions) w.WriteBit(eUTRACGI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eUTRACGI.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -8685,7 +8754,7 @@ func (eUTRACGI *EUTRACGI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8714,7 +8783,7 @@ func (eUTRACGI *EUTRACGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRACGI, eUTRACGI, &eUTRACGI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRACGI, eUTRACGI, &eUTRACGI.iEExtensions); err != nil { return err } } @@ -8726,16 +8795,16 @@ func (eUTRACGI *EUTRACGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsEUTRACGI []ap.IESpec[ProtocolIEID, EUTRACGI] +var extIEsEUTRACGI []apimpl.IESpec[ProtocolIEID, EUTRACGI] -func (eUTRACGI *EUTRACGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRACGI *EUTRACGI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsEUTRACGI, eUTRACGI, eUTRACGI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRACGI, eUTRACGI, &eUTRACGI.iEExtensions) return notComprehended } func (eUTRANCellReportItem *EUTRANCellReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRANCellReportItem, eUTRANCellReportItem, eUTRANCellReportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRANCellReportItem, eUTRANCellReportItem, eUTRANCellReportItem.iEExtensions) w.WriteBit(eUTRANCellReportItem.extensions.Present()) w.WriteBit(eUTRANCellReportItem.EUTRANNumberOfActiveUEs != nil) w.WriteBit(eUTRANCellReportItem.EUTRANNoofRRCConnections != nil) @@ -8763,7 +8832,7 @@ func (eUTRANCellReportItem *EUTRANCellReportItem) MarshalPER(w *per.Writer, enc } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8825,7 +8894,7 @@ func (eUTRANCellReportItem *EUTRANCellReportItem) UnmarshalPER(r *per.Reader, en eUTRANCellReportItem.EUTRANRadioResourceStatus = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCellReportItem, eUTRANCellReportItem, &eUTRANCellReportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCellReportItem, eUTRANCellReportItem, &eUTRANCellReportItem.iEExtensions); err != nil { return err } } @@ -8837,9 +8906,9 @@ func (eUTRANCellReportItem *EUTRANCellReportItem) UnmarshalPER(r *per.Reader, en return nil } -var extIEsEUTRANCellReportItem []ap.IESpec[ProtocolIEID, EUTRANCellReportItem] +var extIEsEUTRANCellReportItem []apimpl.IESpec[ProtocolIEID, EUTRANCellReportItem] -func (eUTRANCellReportItem *EUTRANCellReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANCellReportItem *EUTRANCellReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eUTRANCellReportItem.ECGI.Diagnose(d) { notComprehended = true @@ -8856,19 +8925,19 @@ func (eUTRANCellReportItem *EUTRANCellReportItem) Diagnose(d *ap.Diagnosis[Proto if eUTRANCellReportItem.EUTRANRadioResourceStatus != nil && eUTRANCellReportItem.EUTRANRadioResourceStatus.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEUTRANCellReportItem, eUTRANCellReportItem, eUTRANCellReportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRANCellReportItem, eUTRANCellReportItem, &eUTRANCellReportItem.iEExtensions) return notComprehended } func (eUTRANCellToReportItem *EUTRANCellToReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, eUTRANCellToReportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, eUTRANCellToReportItem.iEExtensions) w.WriteBit(eUTRANCellToReportItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eUTRANCellToReportItem.ECGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8894,7 +8963,7 @@ func (eUTRANCellToReportItem *EUTRANCellToReportItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, &eUTRANCellToReportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, &eUTRANCellToReportItem.iEExtensions); err != nil { return err } } @@ -8906,19 +8975,19 @@ func (eUTRANCellToReportItem *EUTRANCellToReportItem) UnmarshalPER(r *per.Reader return nil } -var extIEsEUTRANCellToReportItem []ap.IESpec[ProtocolIEID, EUTRANCellToReportItem] +var extIEsEUTRANCellToReportItem []apimpl.IESpec[ProtocolIEID, EUTRANCellToReportItem] -func (eUTRANCellToReportItem *EUTRANCellToReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANCellToReportItem *EUTRANCellToReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eUTRANCellToReportItem.ECGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, eUTRANCellToReportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRANCellToReportItem, eUTRANCellToReportItem, &eUTRANCellToReportItem.iEExtensions) return notComprehended } func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGroup) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup.iEExtensions) w.WriteBit(eUTRANCompositeAvailableCapacityGroup.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eUTRANCompositeAvailableCapacityGroup.DLCompositeAvailableCapacity.MarshalPER(w, enc); err != nil { @@ -8928,7 +8997,7 @@ func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGro return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8957,7 +9026,7 @@ func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGro return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, &eUTRANCompositeAvailableCapacityGroup.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, &eUTRANCompositeAvailableCapacityGroup.iEExtensions); err != nil { return err } } @@ -8969,9 +9038,9 @@ func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGro return nil } -var extIEsEUTRANCompositeAvailableCapacityGroup []ap.IESpec[ProtocolIEID, EUTRANCompositeAvailableCapacityGroup] +var extIEsEUTRANCompositeAvailableCapacityGroup []apimpl.IESpec[ProtocolIEID, EUTRANCompositeAvailableCapacityGroup] -func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGroup) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGroup) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eUTRANCompositeAvailableCapacityGroup.DLCompositeAvailableCapacity.Diagnose(d) { notComprehended = true @@ -8979,12 +9048,12 @@ func (eUTRANCompositeAvailableCapacityGroup *EUTRANCompositeAvailableCapacityGro if eUTRANCompositeAvailableCapacityGroup.ULCompositeAvailableCapacity.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRANCompositeAvailableCapacityGroup, eUTRANCompositeAvailableCapacityGroup, &eUTRANCompositeAvailableCapacityGroup.iEExtensions) return notComprehended } func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, eUTRANRadioResourceStatus.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, eUTRANRadioResourceStatus.iEExtensions) w.WriteBit(eUTRANRadioResourceStatus.extensions.Present()) w.WriteBit(eUTRANRadioResourceStatus.DLschedulingPDCCHCCEusage != nil) w.WriteBit(eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage != nil) @@ -9018,7 +9087,7 @@ func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) MarshalPER(w *per.Wr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9081,7 +9150,7 @@ func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) UnmarshalPER(r *per. eUTRANRadioResourceStatus.ULschedulingPDCCHCCEusage = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, &eUTRANRadioResourceStatus.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, &eUTRANRadioResourceStatus.iEExtensions); err != nil { return err } } @@ -9093,23 +9162,23 @@ func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) UnmarshalPER(r *per. return nil } -var extIEsEUTRANRadioResourceStatus []ap.IESpec[ProtocolIEID, EUTRANRadioResourceStatus] +var extIEsEUTRANRadioResourceStatus []apimpl.IESpec[ProtocolIEID, EUTRANRadioResourceStatus] -func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANRadioResourceStatus *EUTRANRadioResourceStatus) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, eUTRANRadioResourceStatus.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRANRadioResourceStatus, eUTRANRadioResourceStatus, &eUTRANRadioResourceStatus.iEExtensions) return notComprehended } func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, eUTRANReportingStatusIEs.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, eUTRANReportingStatusIEs.iEExtensions) w.WriteBit(eUTRANReportingStatusIEs.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eUTRANReportingStatusIEs.EUTRANCellReportList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9135,7 +9204,7 @@ func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, &eUTRANReportingStatusIEs.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, &eUTRANReportingStatusIEs.iEExtensions); err != nil { return err } } @@ -9147,26 +9216,26 @@ func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) UnmarshalPER(r *per.Re return nil } -var extIEsEUTRANReportingStatusIEs []ap.IESpec[ProtocolIEID, EUTRANReportingStatusIEs] +var extIEsEUTRANReportingStatusIEs []apimpl.IESpec[ProtocolIEID, EUTRANReportingStatusIEs] -func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANReportingStatusIEs *EUTRANReportingStatusIEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eUTRANReportingStatusIEs.EUTRANCellReportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, eUTRANReportingStatusIEs.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRANReportingStatusIEs, eUTRANReportingStatusIEs, &eUTRANReportingStatusIEs.iEExtensions) return notComprehended } func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, eUTRANReportingSystemIEs.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, eUTRANReportingSystemIEs.iEExtensions) w.WriteBit(eUTRANReportingSystemIEs.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eUTRANReportingSystemIEs.EUTRANCellToReportList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9192,7 +9261,7 @@ func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, &eUTRANReportingSystemIEs.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, &eUTRANReportingSystemIEs.iEExtensions); err != nil { return err } } @@ -9204,14 +9273,14 @@ func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) UnmarshalPER(r *per.Re return nil } -var extIEsEUTRANReportingSystemIEs []ap.IESpec[ProtocolIEID, EUTRANReportingSystemIEs] +var extIEsEUTRANReportingSystemIEs []apimpl.IESpec[ProtocolIEID, EUTRANReportingSystemIEs] -func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANReportingSystemIEs *EUTRANReportingSystemIEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eUTRANReportingSystemIEs.EUTRANCellToReportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, eUTRANReportingSystemIEs.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRANReportingSystemIEs, eUTRANReportingSystemIEs, &eUTRANReportingSystemIEs.iEExtensions) return notComprehended } @@ -9232,7 +9301,7 @@ func (eUTRAPagingTimeWindow EUTRAPagingTimeWindow) Name() string { return enumEUTRAPagingTimeWindow.Name(eUTRAPagingTimeWindow) } -func (eUTRAPagingTimeWindow EUTRAPagingTimeWindow) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRAPagingTimeWindow EUTRAPagingTimeWindow) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEUTRAPagingTimeWindow.Known(eUTRAPagingTimeWindow) } @@ -9253,12 +9322,12 @@ func (eUTRAPagingeDRXCycle EUTRAPagingeDRXCycle) Name() string { return enumEUTRAPagingeDRXCycle.Name(eUTRAPagingeDRXCycle) } -func (eUTRAPagingeDRXCycle EUTRAPagingeDRXCycle) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRAPagingeDRXCycle EUTRAPagingeDRXCycle) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEUTRAPagingeDRXCycle.Known(eUTRAPagingeDRXCycle) } func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation.iEExtensions) w.WriteBit(eUTRAPagingeDRXInformation.extensions.Present()) w.WriteBit(eUTRAPagingeDRXInformation.EUTRApagingTimeWindow != nil) w.WriteBit(len(ext) > 0) @@ -9271,7 +9340,7 @@ func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9308,7 +9377,7 @@ func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) UnmarshalPER(r *pe eUTRAPagingeDRXInformation.EUTRApagingTimeWindow = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, &eUTRAPagingeDRXInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, &eUTRAPagingeDRXInformation.iEExtensions); err != nil { return err } } @@ -9320,9 +9389,9 @@ func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) UnmarshalPER(r *pe return nil } -var extIEsEUTRAPagingeDRXInformation []ap.IESpec[ProtocolIEID, EUTRAPagingeDRXInformation] +var extIEsEUTRAPagingeDRXInformation []apimpl.IESpec[ProtocolIEID, EUTRAPagingeDRXInformation] -func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eUTRAPagingeDRXInformation.EUTRApagingeDRXCycle.Diagnose(d) { notComprehended = true @@ -9330,7 +9399,7 @@ func (eUTRAPagingeDRXInformation *EUTRAPagingeDRXInformation) Diagnose(d *ap.Dia if eUTRAPagingeDRXInformation.EUTRApagingTimeWindow != nil && eUTRAPagingeDRXInformation.EUTRApagingTimeWindow.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEUTRAPagingeDRXInformation, eUTRAPagingeDRXInformation, &eUTRAPagingeDRXInformation.iEExtensions) return notComprehended } @@ -9351,12 +9420,12 @@ func (earlyMeasurement EarlyMeasurement) Name() string { return enumEarlyMeasurement.Name(earlyMeasurement) } -func (earlyMeasurement EarlyMeasurement) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (earlyMeasurement EarlyMeasurement) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEarlyMeasurement.Known(earlyMeasurement) } func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem.iEExtensions) w.WriteBit(emergencyAreaIDBroadcastEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := emergencyAreaIDBroadcastEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { @@ -9376,7 +9445,7 @@ func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) Mars return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9415,7 +9484,7 @@ func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, &emergencyAreaIDBroadcastEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, &emergencyAreaIDBroadcastEUTRAItem.iEExtensions); err != nil { return err } } @@ -9427,21 +9496,21 @@ func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) Unma return nil } -var extIEsEmergencyAreaIDBroadcastEUTRAItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastEUTRAItem] +var extIEsEmergencyAreaIDBroadcastEUTRAItem []apimpl.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastEUTRAItem] -func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDBroadcastEUTRAItem *EmergencyAreaIDBroadcastEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI { if emergencyAreaIDBroadcastEUTRAItem.CompletedCellsInEAI[i].Diagnose(d) { notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastEUTRAItem, emergencyAreaIDBroadcastEUTRAItem, &emergencyAreaIDBroadcastEUTRAItem.iEExtensions) return notComprehended } func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem.iEExtensions) w.WriteBit(emergencyAreaIDBroadcastNRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := emergencyAreaIDBroadcastNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { @@ -9461,7 +9530,7 @@ func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9500,7 +9569,7 @@ func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, &emergencyAreaIDBroadcastNRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, &emergencyAreaIDBroadcastNRItem.iEExtensions); err != nil { return err } } @@ -9512,21 +9581,21 @@ func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) UnmarshalP return nil } -var extIEsEmergencyAreaIDBroadcastNRItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastNRItem] +var extIEsEmergencyAreaIDBroadcastNRItem []apimpl.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastNRItem] -func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDBroadcastNRItem *EmergencyAreaIDBroadcastNRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI { if emergencyAreaIDBroadcastNRItem.CompletedCellsInEAI[i].Diagnose(d) { notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastNRItem, emergencyAreaIDBroadcastNRItem, &emergencyAreaIDBroadcastNRItem.iEExtensions) return notComprehended } func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem.iEExtensions) w.WriteBit(emergencyAreaIDCancelledEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := emergencyAreaIDCancelledEUTRAItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { @@ -9546,7 +9615,7 @@ func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) Mars return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9585,7 +9654,7 @@ func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, &emergencyAreaIDCancelledEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, &emergencyAreaIDCancelledEUTRAItem.iEExtensions); err != nil { return err } } @@ -9597,21 +9666,21 @@ func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) Unma return nil } -var extIEsEmergencyAreaIDCancelledEUTRAItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDCancelledEUTRAItem] +var extIEsEmergencyAreaIDCancelledEUTRAItem []apimpl.IESpec[ProtocolIEID, EmergencyAreaIDCancelledEUTRAItem] -func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDCancelledEUTRAItem *EmergencyAreaIDCancelledEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI { if emergencyAreaIDCancelledEUTRAItem.CancelledCellsInEAI[i].Diagnose(d) { notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledEUTRAItem, emergencyAreaIDCancelledEUTRAItem, &emergencyAreaIDCancelledEUTRAItem.iEExtensions) return notComprehended } func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem.iEExtensions) w.WriteBit(emergencyAreaIDCancelledNRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := emergencyAreaIDCancelledNRItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { @@ -9631,7 +9700,7 @@ func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9670,7 +9739,7 @@ func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, &emergencyAreaIDCancelledNRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, &emergencyAreaIDCancelledNRItem.iEExtensions); err != nil { return err } } @@ -9682,21 +9751,21 @@ func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) UnmarshalP return nil } -var extIEsEmergencyAreaIDCancelledNRItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDCancelledNRItem] +var extIEsEmergencyAreaIDCancelledNRItem []apimpl.IESpec[ProtocolIEID, EmergencyAreaIDCancelledNRItem] -func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDCancelledNRItem *EmergencyAreaIDCancelledNRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDCancelledNRItem.CancelledCellsInEAI { if emergencyAreaIDCancelledNRItem.CancelledCellsInEAI[i].Diagnose(d) { notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledNRItem, emergencyAreaIDCancelledNRItem, &emergencyAreaIDCancelledNRItem.iEExtensions) return notComprehended } func (emergencyFallbackIndicator *EmergencyFallbackIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, emergencyFallbackIndicator.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, emergencyFallbackIndicator.iEExtensions) w.WriteBit(emergencyFallbackIndicator.extensions.Present()) w.WriteBit(emergencyFallbackIndicator.EmergencyServiceTargetCN != nil) w.WriteBit(len(ext) > 0) @@ -9709,7 +9778,7 @@ func (emergencyFallbackIndicator *EmergencyFallbackIndicator) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9746,7 +9815,7 @@ func (emergencyFallbackIndicator *EmergencyFallbackIndicator) UnmarshalPER(r *pe emergencyFallbackIndicator.EmergencyServiceTargetCN = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, &emergencyFallbackIndicator.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, &emergencyFallbackIndicator.iEExtensions); err != nil { return err } } @@ -9758,9 +9827,9 @@ func (emergencyFallbackIndicator *EmergencyFallbackIndicator) UnmarshalPER(r *pe return nil } -var extIEsEmergencyFallbackIndicator []ap.IESpec[ProtocolIEID, EmergencyFallbackIndicator] +var extIEsEmergencyFallbackIndicator []apimpl.IESpec[ProtocolIEID, EmergencyFallbackIndicator] -func (emergencyFallbackIndicator *EmergencyFallbackIndicator) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyFallbackIndicator *EmergencyFallbackIndicator) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if emergencyFallbackIndicator.EmergencyFallbackRequestIndicator.Diagnose(d) { notComprehended = true @@ -9768,7 +9837,7 @@ func (emergencyFallbackIndicator *EmergencyFallbackIndicator) Diagnose(d *ap.Dia if emergencyFallbackIndicator.EmergencyServiceTargetCN != nil && emergencyFallbackIndicator.EmergencyServiceTargetCN.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, emergencyFallbackIndicator.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEmergencyFallbackIndicator, emergencyFallbackIndicator, &emergencyFallbackIndicator.iEExtensions) return notComprehended } @@ -9789,7 +9858,7 @@ func (emergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator) Name( return enumEmergencyFallbackRequestIndicator.Name(emergencyFallbackRequestIndicator) } -func (emergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyFallbackRequestIndicator EmergencyFallbackRequestIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEmergencyFallbackRequestIndicator.Known(emergencyFallbackRequestIndicator) } @@ -9810,7 +9879,7 @@ func (emergencyServiceTargetCN EmergencyServiceTargetCN) Name() string { return enumEmergencyServiceTargetCN.Name(emergencyServiceTargetCN) } -func (emergencyServiceTargetCN EmergencyServiceTargetCN) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyServiceTargetCN EmergencyServiceTargetCN) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEmergencyServiceTargetCN.Known(emergencyServiceTargetCN) } @@ -9831,12 +9900,12 @@ func (endIndication EndIndication) Name() string { return enumEndIndication.Name(endIndication) } -func (endIndication EndIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (endIndication EndIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEndIndication.Known(endIndication) } func (endpointIPAddressAndPort *EndpointIPAddressAndPort) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, endpointIPAddressAndPort.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, endpointIPAddressAndPort.iEExtensions) w.WriteBit(len(ext) > 0) if err := endpointIPAddressAndPort.EndpointIPAddress.MarshalPER(w, enc); err != nil { return err @@ -9845,7 +9914,7 @@ func (endpointIPAddressAndPort *EndpointIPAddressAndPort) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9865,18 +9934,18 @@ func (endpointIPAddressAndPort *EndpointIPAddressAndPort) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, &endpointIPAddressAndPort.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, &endpointIPAddressAndPort.iEExtensions); err != nil { return err } } return nil } -var extIEsEndpointIPAddressAndPort []ap.IESpec[ProtocolIEID, EndpointIPAddressAndPort] +var extIEsEndpointIPAddressAndPort []apimpl.IESpec[ProtocolIEID, EndpointIPAddressAndPort] -func (endpointIPAddressAndPort *EndpointIPAddressAndPort) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (endpointIPAddressAndPort *EndpointIPAddressAndPort) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, endpointIPAddressAndPort.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEndpointIPAddressAndPort, endpointIPAddressAndPort, &endpointIPAddressAndPort.iEExtensions) return notComprehended } @@ -9897,12 +9966,12 @@ func (enhancedCoverageRestriction EnhancedCoverageRestriction) Name() string { return enumEnhancedCoverageRestriction.Name(enhancedCoverageRestriction) } -func (enhancedCoverageRestriction EnhancedCoverageRestriction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (enhancedCoverageRestriction EnhancedCoverageRestriction) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEnhancedCoverageRestriction.Known(enhancedCoverageRestriction) } func (equivalentSNPNsItem *EquivalentSNPNsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEquivalentSNPNsItem, equivalentSNPNsItem, equivalentSNPNsItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEquivalentSNPNsItem, equivalentSNPNsItem, equivalentSNPNsItem.iEExtensions) w.WriteBit(equivalentSNPNsItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := equivalentSNPNsItem.PlmnIdentity.MarshalPER(w, enc); err != nil { @@ -9912,7 +9981,7 @@ func (equivalentSNPNsItem *EquivalentSNPNsItem) MarshalPER(w *per.Writer, enc pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9941,7 +10010,7 @@ func (equivalentSNPNsItem *EquivalentSNPNsItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEquivalentSNPNsItem, equivalentSNPNsItem, &equivalentSNPNsItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEquivalentSNPNsItem, equivalentSNPNsItem, &equivalentSNPNsItem.iEExtensions); err != nil { return err } } @@ -9953,16 +10022,16 @@ func (equivalentSNPNsItem *EquivalentSNPNsItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsEquivalentSNPNsItem []ap.IESpec[ProtocolIEID, EquivalentSNPNsItem] +var extIEsEquivalentSNPNsItem []apimpl.IESpec[ProtocolIEID, EquivalentSNPNsItem] -func (equivalentSNPNsItem *EquivalentSNPNsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (equivalentSNPNsItem *EquivalentSNPNsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsEquivalentSNPNsItem, equivalentSNPNsItem, equivalentSNPNsItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEquivalentSNPNsItem, equivalentSNPNsItem, &equivalentSNPNsItem.iEExtensions) return notComprehended } func (eventBasedReportingIEs *EventBasedReportingIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEventBasedReportingIEs, eventBasedReportingIEs, eventBasedReportingIEs.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEventBasedReportingIEs, eventBasedReportingIEs, eventBasedReportingIEs.iEExtensions) w.WriteBit(eventBasedReportingIEs.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eventBasedReportingIEs.IntersystemResourceThresholdLow.MarshalPER(w, enc); err != nil { @@ -9975,7 +10044,7 @@ func (eventBasedReportingIEs *EventBasedReportingIEs) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10007,7 +10076,7 @@ func (eventBasedReportingIEs *EventBasedReportingIEs) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEventBasedReportingIEs, eventBasedReportingIEs, &eventBasedReportingIEs.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEventBasedReportingIEs, eventBasedReportingIEs, &eventBasedReportingIEs.iEExtensions); err != nil { return err } } @@ -10019,19 +10088,19 @@ func (eventBasedReportingIEs *EventBasedReportingIEs) UnmarshalPER(r *per.Reader return nil } -var extIEsEventBasedReportingIEs []ap.IESpec[ProtocolIEID, EventBasedReportingIEs] +var extIEsEventBasedReportingIEs []apimpl.IESpec[ProtocolIEID, EventBasedReportingIEs] -func (eventBasedReportingIEs *EventBasedReportingIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eventBasedReportingIEs *EventBasedReportingIEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eventBasedReportingIEs.NumberOfMeasurementReportingLevels.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEventBasedReportingIEs, eventBasedReportingIEs, eventBasedReportingIEs.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEventBasedReportingIEs, eventBasedReportingIEs, &eventBasedReportingIEs.iEExtensions) return notComprehended } func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, eventL1LoggedMDTConfig.iEExtensions) + ext := apimpl.ExtensionFields(extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, eventL1LoggedMDTConfig.iEExtensions) w.WriteBit(eventL1LoggedMDTConfig.extensions.Present()) w.WriteBit(len(ext) > 0) if err := eventL1LoggedMDTConfig.L1Threshold.MarshalPER(w, enc); err != nil { @@ -10044,7 +10113,7 @@ func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10076,7 +10145,7 @@ func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, &eventL1LoggedMDTConfig.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, &eventL1LoggedMDTConfig.iEExtensions); err != nil { return err } } @@ -10088,14 +10157,14 @@ func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) UnmarshalPER(r *per.Reader return nil } -var extIEsEventL1LoggedMDTConfig []ap.IESpec[ProtocolIEID, EventL1LoggedMDTConfig] +var extIEsEventL1LoggedMDTConfig []apimpl.IESpec[ProtocolIEID, EventL1LoggedMDTConfig] -func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eventL1LoggedMDTConfig *EventL1LoggedMDTConfig) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if eventL1LoggedMDTConfig.L1Threshold.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, eventL1LoggedMDTConfig.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsEventL1LoggedMDTConfig, eventL1LoggedMDTConfig, &eventL1LoggedMDTConfig.iEExtensions) return notComprehended } @@ -10128,7 +10197,7 @@ func (eventTrigger *EventTrigger) MarshalPER(w *per.Writer, enc per.Encoding) er if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, eventTrigger.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, eventTrigger.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -10155,7 +10224,7 @@ func (eventTrigger *EventTrigger) UnmarshalPER(r *per.Reader, enc per.Encoding) } eventTrigger.EventL1LoggedMDTConfig = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -10169,14 +10238,14 @@ func (eventTrigger *EventTrigger) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -func (eventTrigger *EventTrigger) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eventTrigger *EventTrigger) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case eventTrigger.OutOfCoverage != nil: return eventTrigger.OutOfCoverage.Diagnose(d) case eventTrigger.EventL1LoggedMDTConfig != nil: return eventTrigger.EventL1LoggedMDTConfig.Diagnose(d) case eventTrigger.ChoiceExtension != nil: - d.Unknown(eventTrigger.ChoiceExtension.ID, eventTrigger.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, eventTrigger.ChoiceExtension) } return false } @@ -10198,7 +10267,7 @@ func (eventTriggerOutOfCoverage EventTriggerOutOfCoverage) Name() string { return enumEventTriggerOutOfCoverage.Name(eventTriggerOutOfCoverage) } -func (eventTriggerOutOfCoverage EventTriggerOutOfCoverage) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eventTriggerOutOfCoverage EventTriggerOutOfCoverage) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEventTriggerOutOfCoverage.Known(eventTriggerOutOfCoverage) } @@ -10219,12 +10288,12 @@ func (eventType EventType) Name() string { return enumEventType.Name(eventType) } -func (eventType EventType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (eventType EventType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumEventType.Known(eventType) } func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, excessPacketDelayThresholdItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, excessPacketDelayThresholdItem.iEExtensions) w.WriteBit(excessPacketDelayThresholdItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := excessPacketDelayThresholdItem.FiveQi.MarshalPER(w, enc); err != nil { @@ -10234,7 +10303,7 @@ func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10263,7 +10332,7 @@ func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, &excessPacketDelayThresholdItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, &excessPacketDelayThresholdItem.iEExtensions); err != nil { return err } } @@ -10275,9 +10344,9 @@ func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) UnmarshalP return nil } -var extIEsExcessPacketDelayThresholdItem []ap.IESpec[ProtocolIEID, ExcessPacketDelayThresholdItem] +var extIEsExcessPacketDelayThresholdItem []apimpl.IESpec[ProtocolIEID, ExcessPacketDelayThresholdItem] -func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if excessPacketDelayThresholdItem.FiveQi.Diagnose(d) { notComprehended = true @@ -10285,7 +10354,7 @@ func (excessPacketDelayThresholdItem *ExcessPacketDelayThresholdItem) Diagnose(d if excessPacketDelayThresholdItem.ExcessPacketDelayThresholdValue.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, excessPacketDelayThresholdItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsExcessPacketDelayThresholdItem, excessPacketDelayThresholdItem, &excessPacketDelayThresholdItem.iEExtensions) return notComprehended } @@ -10306,7 +10375,7 @@ func (excessPacketDelayThresholdValue ExcessPacketDelayThresholdValue) Name() st return enumExcessPacketDelayThresholdValue.Name(excessPacketDelayThresholdValue) } -func (excessPacketDelayThresholdValue ExcessPacketDelayThresholdValue) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (excessPacketDelayThresholdValue ExcessPacketDelayThresholdValue) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumExcessPacketDelayThresholdValue.Known(excessPacketDelayThresholdValue) } @@ -10327,12 +10396,12 @@ func (expectedHOInterval ExpectedHOInterval) Name() string { return enumExpectedHOInterval.Name(expectedHOInterval) } -func (expectedHOInterval ExpectedHOInterval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (expectedHOInterval ExpectedHOInterval) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumExpectedHOInterval.Known(expectedHOInterval) } func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, expectedUEActivityBehaviour.iEExtensions) + ext := apimpl.ExtensionFields(extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, expectedUEActivityBehaviour.iEExtensions) w.WriteBit(expectedUEActivityBehaviour.extensions.Present()) w.WriteBit(expectedUEActivityBehaviour.ExpectedActivityPeriod != nil) w.WriteBit(expectedUEActivityBehaviour.ExpectedIdlePeriod != nil) @@ -10354,7 +10423,7 @@ func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) MarshalPER(w *pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10410,7 +10479,7 @@ func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) UnmarshalPER(r * expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, &expectedUEActivityBehaviour.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, &expectedUEActivityBehaviour.iEExtensions); err != nil { return err } } @@ -10422,9 +10491,9 @@ func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) UnmarshalPER(r * return nil } -var extIEsExpectedUEActivityBehaviour []ap.IESpec[ProtocolIEID, ExpectedUEActivityBehaviour] +var extIEsExpectedUEActivityBehaviour []apimpl.IESpec[ProtocolIEID, ExpectedUEActivityBehaviour] -func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if expectedUEActivityBehaviour.ExpectedActivityPeriod != nil && expectedUEActivityBehaviour.ExpectedActivityPeriod.Diagnose(d) { notComprehended = true @@ -10435,12 +10504,12 @@ func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) Diagnose(d *ap.D if expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation != nil && expectedUEActivityBehaviour.SourceOfUEActivityBehaviourInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, expectedUEActivityBehaviour.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, &expectedUEActivityBehaviour.iEExtensions) return notComprehended } func (expectedUEBehaviour *ExpectedUEBehaviour) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsExpectedUEBehaviour, expectedUEBehaviour, expectedUEBehaviour.iEExtensions) + ext := apimpl.ExtensionFields(extIEsExpectedUEBehaviour, expectedUEBehaviour, expectedUEBehaviour.iEExtensions) w.WriteBit(expectedUEBehaviour.extensions.Present()) w.WriteBit(expectedUEBehaviour.ExpectedUEActivityBehaviour != nil) w.WriteBit(expectedUEBehaviour.ExpectedHOInterval != nil) @@ -10468,7 +10537,7 @@ func (expectedUEBehaviour *ExpectedUEBehaviour) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10533,7 +10602,7 @@ func (expectedUEBehaviour *ExpectedUEBehaviour) UnmarshalPER(r *per.Reader, enc } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEBehaviour, expectedUEBehaviour, &expectedUEBehaviour.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEBehaviour, expectedUEBehaviour, &expectedUEBehaviour.iEExtensions); err != nil { return err } } @@ -10545,9 +10614,9 @@ func (expectedUEBehaviour *ExpectedUEBehaviour) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsExpectedUEBehaviour []ap.IESpec[ProtocolIEID, ExpectedUEBehaviour] +var extIEsExpectedUEBehaviour []apimpl.IESpec[ProtocolIEID, ExpectedUEBehaviour] -func (expectedUEBehaviour *ExpectedUEBehaviour) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (expectedUEBehaviour *ExpectedUEBehaviour) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if expectedUEBehaviour.ExpectedUEActivityBehaviour != nil && expectedUEBehaviour.ExpectedUEActivityBehaviour.Diagnose(d) { notComprehended = true @@ -10561,7 +10630,7 @@ func (expectedUEBehaviour *ExpectedUEBehaviour) Diagnose(d *ap.Diagnosis[Protoco if expectedUEBehaviour.ExpectedUEMovingTrajectory.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsExpectedUEBehaviour, expectedUEBehaviour, expectedUEBehaviour.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsExpectedUEBehaviour, expectedUEBehaviour, &expectedUEBehaviour.iEExtensions) return notComprehended } @@ -10582,12 +10651,12 @@ func (expectedUEMobility ExpectedUEMobility) Name() string { return enumExpectedUEMobility.Name(expectedUEMobility) } -func (expectedUEMobility ExpectedUEMobility) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (expectedUEMobility ExpectedUEMobility) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumExpectedUEMobility.Known(expectedUEMobility) } func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem.iEExtensions) w.WriteBit(expectedUEMovingTrajectoryItem.extensions.Present()) w.WriteBit(expectedUEMovingTrajectoryItem.TimeStayedInCell != nil) w.WriteBit(len(ext) > 0) @@ -10600,7 +10669,7 @@ func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) MarshalPER } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10637,7 +10706,7 @@ func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) UnmarshalP expectedUEMovingTrajectoryItem.TimeStayedInCell = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, &expectedUEMovingTrajectoryItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, &expectedUEMovingTrajectoryItem.iEExtensions); err != nil { return err } } @@ -10649,19 +10718,19 @@ func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) UnmarshalP return nil } -var extIEsExpectedUEMovingTrajectoryItem []ap.IESpec[ProtocolIEID, ExpectedUEMovingTrajectoryItem] +var extIEsExpectedUEMovingTrajectoryItem []apimpl.IESpec[ProtocolIEID, ExpectedUEMovingTrajectoryItem] -func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (expectedUEMovingTrajectoryItem *ExpectedUEMovingTrajectoryItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if expectedUEMovingTrajectoryItem.NGRANCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsExpectedUEMovingTrajectoryItem, expectedUEMovingTrajectoryItem, &expectedUEMovingTrajectoryItem.iEExtensions) return notComprehended } func (extendedAMFName *ExtendedAMFName) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsExtendedAMFName, extendedAMFName, extendedAMFName.iEExtensions) + ext := apimpl.ExtensionFields(extIEsExtendedAMFName, extendedAMFName, extendedAMFName.iEExtensions) w.WriteBit(extendedAMFName.extensions.Present()) w.WriteBit(extendedAMFName.AMFNameVisibleString != nil) w.WriteBit(extendedAMFName.AMFNameUTF8String != nil) @@ -10677,7 +10746,7 @@ func (extendedAMFName *ExtendedAMFName) MarshalPER(w *per.Writer, enc per.Encodi } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10722,7 +10791,7 @@ func (extendedAMFName *ExtendedAMFName) UnmarshalPER(r *per.Reader, enc per.Enco extendedAMFName.AMFNameUTF8String = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExtendedAMFName, extendedAMFName, &extendedAMFName.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExtendedAMFName, extendedAMFName, &extendedAMFName.iEExtensions); err != nil { return err } } @@ -10734,16 +10803,16 @@ func (extendedAMFName *ExtendedAMFName) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsExtendedAMFName []ap.IESpec[ProtocolIEID, ExtendedAMFName] +var extIEsExtendedAMFName []apimpl.IESpec[ProtocolIEID, ExtendedAMFName] -func (extendedAMFName *ExtendedAMFName) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (extendedAMFName *ExtendedAMFName) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsExtendedAMFName, extendedAMFName, extendedAMFName.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsExtendedAMFName, extendedAMFName, &extendedAMFName.iEExtensions) return notComprehended } func (extendedRANNodeName *ExtendedRANNodeName) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsExtendedRANNodeName, extendedRANNodeName, extendedRANNodeName.iEExtensions) + ext := apimpl.ExtensionFields(extIEsExtendedRANNodeName, extendedRANNodeName, extendedRANNodeName.iEExtensions) w.WriteBit(extendedRANNodeName.extensions.Present()) w.WriteBit(extendedRANNodeName.RANNodeNameVisibleString != nil) w.WriteBit(extendedRANNodeName.RANNodeNameUTF8String != nil) @@ -10759,7 +10828,7 @@ func (extendedRANNodeName *ExtendedRANNodeName) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10804,7 +10873,7 @@ func (extendedRANNodeName *ExtendedRANNodeName) UnmarshalPER(r *per.Reader, enc extendedRANNodeName.RANNodeNameUTF8String = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExtendedRANNodeName, extendedRANNodeName, &extendedRANNodeName.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExtendedRANNodeName, extendedRANNodeName, &extendedRANNodeName.iEExtensions); err != nil { return err } } @@ -10816,16 +10885,16 @@ func (extendedRANNodeName *ExtendedRANNodeName) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsExtendedRANNodeName []ap.IESpec[ProtocolIEID, ExtendedRANNodeName] +var extIEsExtendedRANNodeName []apimpl.IESpec[ProtocolIEID, ExtendedRANNodeName] -func (extendedRANNodeName *ExtendedRANNodeName) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (extendedRANNodeName *ExtendedRANNodeName) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsExtendedRANNodeName, extendedRANNodeName, extendedRANNodeName.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsExtendedRANNodeName, extendedRANNodeName, &extendedRANNodeName.iEExtensions) return notComprehended } func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, extendedRATRestrictionInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, extendedRATRestrictionInformation.iEExtensions) w.WriteBit(extendedRATRestrictionInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := extendedRATRestrictionInformation.PrimaryRATRestriction.MarshalPER(w, enc); err != nil { @@ -10835,7 +10904,7 @@ func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) Mars return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10864,7 +10933,7 @@ func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, &extendedRATRestrictionInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, &extendedRATRestrictionInformation.iEExtensions); err != nil { return err } } @@ -10876,11 +10945,11 @@ func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) Unma return nil } -var extIEsExtendedRATRestrictionInformation []ap.IESpec[ProtocolIEID, ExtendedRATRestrictionInformation] +var extIEsExtendedRATRestrictionInformation []apimpl.IESpec[ProtocolIEID, ExtendedRATRestrictionInformation] -func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (extendedRATRestrictionInformation *ExtendedRATRestrictionInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, extendedRATRestrictionInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsExtendedRATRestrictionInformation, extendedRATRestrictionInformation, &extendedRATRestrictionInformation.iEExtensions) return notComprehended } @@ -10901,12 +10970,12 @@ func (extendedReportIntervalMDT ExtendedReportIntervalMDT) Name() string { return enumExtendedReportIntervalMDT.Name(extendedReportIntervalMDT) } -func (extendedReportIntervalMDT ExtendedReportIntervalMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (extendedReportIntervalMDT ExtendedReportIntervalMDT) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumExtendedReportIntervalMDT.Known(extendedReportIntervalMDT) } func (fiveGProSeAuthorized *FiveGProSeAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, fiveGProSeAuthorized.iEExtensions) + ext := apimpl.ExtensionFields(extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, fiveGProSeAuthorized.iEExtensions) w.WriteBit(fiveGProSeAuthorized.extensions.Present()) w.WriteBit(fiveGProSeAuthorized.FiveGProSeDirectDiscovery != nil) w.WriteBit(fiveGProSeAuthorized.FiveGProSeDirectCommunication != nil) @@ -10940,7 +11009,7 @@ func (fiveGProSeAuthorized *FiveGProSeAuthorized) MarshalPER(w *per.Writer, enc } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11018,7 +11087,7 @@ func (fiveGProSeAuthorized *FiveGProSeAuthorized) UnmarshalPER(r *per.Reader, en fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, &fiveGProSeAuthorized.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, &fiveGProSeAuthorized.iEExtensions); err != nil { return err } } @@ -11030,11 +11099,11 @@ func (fiveGProSeAuthorized *FiveGProSeAuthorized) UnmarshalPER(r *per.Reader, en return nil } -var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized]{ +var extIEsFiveGProSeAuthorized = []apimpl.IESpec[ProtocolIEID, FiveGProSeAuthorized]{ { ID: IDFiveGProSeLayer2Multipath, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { var v FiveGProSeLayer2Multipath if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -11049,11 +11118,14 @@ var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized] } return x.FiveGProSeLayer2Multipath, true }, + Clear: func(x *FiveGProSeAuthorized) { + x.FiveGProSeLayer2Multipath = nil + }, }, { ID: IDFiveGProSeLayer2UEtoUERelay, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { var v FiveGProSeLayer2UEtoUERelay if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -11068,11 +11140,14 @@ var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized] } return x.FiveGProSeLayer2UEtoUERelay, true }, + Clear: func(x *FiveGProSeAuthorized) { + x.FiveGProSeLayer2UEtoUERelay = nil + }, }, { ID: IDFiveGProSeLayer2UEtoUERemote, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { var v FiveGProSeLayer2UEtoUERemote if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -11087,11 +11162,14 @@ var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized] } return x.FiveGProSeLayer2UEtoUERemote, true }, + Clear: func(x *FiveGProSeAuthorized) { + x.FiveGProSeLayer2UEtoUERemote = nil + }, }, { ID: IDFiveGProSeLayer2MHUEtoNetworkRelay, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { var v FiveGProSeLayer2MHUEtoNetworkRelay if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -11106,11 +11184,14 @@ var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized] } return x.FiveGProSeLayer2MHUEtoNetworkRelay, true }, + Clear: func(x *FiveGProSeAuthorized) { + x.FiveGProSeLayer2MHUEtoNetworkRelay = nil + }, }, { ID: IDFiveGProSeLayer2MHIntermediateUEtoNetworkRelay, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { var v FiveGProSeLayer2MHIntermediateUEtoNetworkRelay if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -11125,11 +11206,14 @@ var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized] } return x.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay, true }, + Clear: func(x *FiveGProSeAuthorized) { + x.FiveGProSeLayer2MHIntermediateUEtoNetworkRelay = nil + }, }, { ID: IDFiveGProSeLayer2MHRemote, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { var v FiveGProSeLayer2MHRemote if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -11144,11 +11228,14 @@ var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized] } return x.FiveGProSeLayer2MHRemote, true }, + Clear: func(x *FiveGProSeAuthorized) { + x.FiveGProSeLayer2MHRemote = nil + }, }, { ID: IDFiveGProSeLayer3MHUEtoNetworkRelay, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *FiveGProSeAuthorized, r *per.Reader, enc per.Encoding) error { var v FiveGProSeLayer3MHUEtoNetworkRelay if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -11163,10 +11250,13 @@ var extIEsFiveGProSeAuthorized = []ap.IESpec[ProtocolIEID, FiveGProSeAuthorized] } return x.FiveGProSeLayer3MHUEtoNetworkRelay, true }, + Clear: func(x *FiveGProSeAuthorized) { + x.FiveGProSeLayer3MHUEtoNetworkRelay = nil + }, }, } -func (fiveGProSeAuthorized *FiveGProSeAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeAuthorized *FiveGProSeAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if fiveGProSeAuthorized.FiveGProSeDirectDiscovery != nil && fiveGProSeAuthorized.FiveGProSeDirectDiscovery.Diagnose(d) { notComprehended = true @@ -11183,7 +11273,7 @@ func (fiveGProSeAuthorized *FiveGProSeAuthorized) Diagnose(d *ap.Diagnosis[Proto if fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE != nil && fiveGProSeAuthorized.FiveGProSeLayer2RemoteUE.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, fiveGProSeAuthorized.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsFiveGProSeAuthorized, fiveGProSeAuthorized, &fiveGProSeAuthorized.iEExtensions) return notComprehended } @@ -11204,7 +11294,7 @@ func (fiveGProSeDirectCommunication FiveGProSeDirectCommunication) Name() string return enumFiveGProSeDirectCommunication.Name(fiveGProSeDirectCommunication) } -func (fiveGProSeDirectCommunication FiveGProSeDirectCommunication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeDirectCommunication FiveGProSeDirectCommunication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeDirectCommunication.Known(fiveGProSeDirectCommunication) } @@ -11225,7 +11315,7 @@ func (fiveGProSeDirectDiscovery FiveGProSeDirectDiscovery) Name() string { return enumFiveGProSeDirectDiscovery.Name(fiveGProSeDirectDiscovery) } -func (fiveGProSeDirectDiscovery FiveGProSeDirectDiscovery) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeDirectDiscovery FiveGProSeDirectDiscovery) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeDirectDiscovery.Known(fiveGProSeDirectDiscovery) } @@ -11246,7 +11336,7 @@ func (fiveGProSeLayer2MHIntermediateUEtoNetworkRelay FiveGProSeLayer2MHIntermedi return enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay.Name(fiveGProSeLayer2MHIntermediateUEtoNetworkRelay) } -func (fiveGProSeLayer2MHIntermediateUEtoNetworkRelay FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2MHIntermediateUEtoNetworkRelay FiveGProSeLayer2MHIntermediateUEtoNetworkRelay) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2MHIntermediateUEtoNetworkRelay.Known(fiveGProSeLayer2MHIntermediateUEtoNetworkRelay) } @@ -11267,7 +11357,7 @@ func (fiveGProSeLayer2MHRemote FiveGProSeLayer2MHRemote) Name() string { return enumFiveGProSeLayer2MHRemote.Name(fiveGProSeLayer2MHRemote) } -func (fiveGProSeLayer2MHRemote FiveGProSeLayer2MHRemote) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2MHRemote FiveGProSeLayer2MHRemote) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2MHRemote.Known(fiveGProSeLayer2MHRemote) } @@ -11288,7 +11378,7 @@ func (fiveGProSeLayer2MHUEtoNetworkRelay FiveGProSeLayer2MHUEtoNetworkRelay) Nam return enumFiveGProSeLayer2MHUEtoNetworkRelay.Name(fiveGProSeLayer2MHUEtoNetworkRelay) } -func (fiveGProSeLayer2MHUEtoNetworkRelay FiveGProSeLayer2MHUEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2MHUEtoNetworkRelay FiveGProSeLayer2MHUEtoNetworkRelay) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2MHUEtoNetworkRelay.Known(fiveGProSeLayer2MHUEtoNetworkRelay) } @@ -11309,7 +11399,7 @@ func (fiveGProSeLayer2Multipath FiveGProSeLayer2Multipath) Name() string { return enumFiveGProSeLayer2Multipath.Name(fiveGProSeLayer2Multipath) } -func (fiveGProSeLayer2Multipath FiveGProSeLayer2Multipath) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2Multipath FiveGProSeLayer2Multipath) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2Multipath.Known(fiveGProSeLayer2Multipath) } @@ -11330,7 +11420,7 @@ func (fiveGProSeLayer2RemoteUE FiveGProSeLayer2RemoteUE) Name() string { return enumFiveGProSeLayer2RemoteUE.Name(fiveGProSeLayer2RemoteUE) } -func (fiveGProSeLayer2RemoteUE FiveGProSeLayer2RemoteUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2RemoteUE FiveGProSeLayer2RemoteUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2RemoteUE.Known(fiveGProSeLayer2RemoteUE) } @@ -11351,7 +11441,7 @@ func (fiveGProSeLayer2UEtoNetworkRelay FiveGProSeLayer2UEtoNetworkRelay) Name() return enumFiveGProSeLayer2UEtoNetworkRelay.Name(fiveGProSeLayer2UEtoNetworkRelay) } -func (fiveGProSeLayer2UEtoNetworkRelay FiveGProSeLayer2UEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2UEtoNetworkRelay FiveGProSeLayer2UEtoNetworkRelay) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2UEtoNetworkRelay.Known(fiveGProSeLayer2UEtoNetworkRelay) } @@ -11372,7 +11462,7 @@ func (fiveGProSeLayer2UEtoUERelay FiveGProSeLayer2UEtoUERelay) Name() string { return enumFiveGProSeLayer2UEtoUERelay.Name(fiveGProSeLayer2UEtoUERelay) } -func (fiveGProSeLayer2UEtoUERelay FiveGProSeLayer2UEtoUERelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2UEtoUERelay FiveGProSeLayer2UEtoUERelay) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2UEtoUERelay.Known(fiveGProSeLayer2UEtoUERelay) } @@ -11393,7 +11483,7 @@ func (fiveGProSeLayer2UEtoUERemote FiveGProSeLayer2UEtoUERemote) Name() string { return enumFiveGProSeLayer2UEtoUERemote.Name(fiveGProSeLayer2UEtoUERemote) } -func (fiveGProSeLayer2UEtoUERemote FiveGProSeLayer2UEtoUERemote) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer2UEtoUERemote FiveGProSeLayer2UEtoUERemote) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer2UEtoUERemote.Known(fiveGProSeLayer2UEtoUERemote) } @@ -11414,7 +11504,7 @@ func (fiveGProSeLayer3MHUEtoNetworkRelay FiveGProSeLayer3MHUEtoNetworkRelay) Nam return enumFiveGProSeLayer3MHUEtoNetworkRelay.Name(fiveGProSeLayer3MHUEtoNetworkRelay) } -func (fiveGProSeLayer3MHUEtoNetworkRelay FiveGProSeLayer3MHUEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer3MHUEtoNetworkRelay FiveGProSeLayer3MHUEtoNetworkRelay) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer3MHUEtoNetworkRelay.Known(fiveGProSeLayer3MHUEtoNetworkRelay) } @@ -11435,12 +11525,12 @@ func (fiveGProSeLayer3UEtoNetworkRelay FiveGProSeLayer3UEtoNetworkRelay) Name() return enumFiveGProSeLayer3UEtoNetworkRelay.Name(fiveGProSeLayer3UEtoNetworkRelay) } -func (fiveGProSeLayer3UEtoNetworkRelay FiveGProSeLayer3UEtoNetworkRelay) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSeLayer3UEtoNetworkRelay FiveGProSeLayer3UEtoNetworkRelay) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumFiveGProSeLayer3UEtoNetworkRelay.Known(fiveGProSeLayer3UEtoNetworkRelay) } func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates.iEExtensions) + ext := apimpl.ExtensionFields(extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates.iEExtensions) w.WriteBit(fiveGProSePC5FlowBitRates.extensions.Present()) w.WriteBit(len(ext) > 0) if err := fiveGProSePC5FlowBitRates.FiveGproSeguaranteedFlowBitRate.MarshalPER(w, enc); err != nil { @@ -11450,7 +11540,7 @@ func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11479,7 +11569,7 @@ func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, &fiveGProSePC5FlowBitRates.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, &fiveGProSePC5FlowBitRates.iEExtensions); err != nil { return err } } @@ -11491,9 +11581,9 @@ func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) UnmarshalPER(r *per. return nil } -var extIEsFiveGProSePC5FlowBitRates []ap.IESpec[ProtocolIEID, FiveGProSePC5FlowBitRates] +var extIEsFiveGProSePC5FlowBitRates []apimpl.IESpec[ProtocolIEID, FiveGProSePC5FlowBitRates] -func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if fiveGProSePC5FlowBitRates.FiveGproSeguaranteedFlowBitRate.Diagnose(d) { notComprehended = true @@ -11501,12 +11591,12 @@ func (fiveGProSePC5FlowBitRates *FiveGProSePC5FlowBitRates) Diagnose(d *ap.Diagn if fiveGProSePC5FlowBitRates.FiveGproSemaximumFlowBitRate.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsFiveGProSePC5FlowBitRates, fiveGProSePC5FlowBitRates, &fiveGProSePC5FlowBitRates.iEExtensions) return notComprehended } func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem.iEExtensions) w.WriteBit(fiveGProSePC5QoSFlowItem.extensions.Present()) w.WriteBit(fiveGProSePC5QoSFlowItem.FiveGproSepc5FlowBitRates != nil) w.WriteBit(fiveGProSePC5QoSFlowItem.FiveGproSerange != nil) @@ -11525,7 +11615,7 @@ func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11573,7 +11663,7 @@ func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) UnmarshalPER(r *per.Re fiveGProSePC5QoSFlowItem.FiveGproSerange = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, &fiveGProSePC5QoSFlowItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, &fiveGProSePC5QoSFlowItem.iEExtensions); err != nil { return err } } @@ -11585,9 +11675,9 @@ func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) UnmarshalPER(r *per.Re return nil } -var extIEsFiveGProSePC5QoSFlowItem []ap.IESpec[ProtocolIEID, FiveGProSePC5QoSFlowItem] +var extIEsFiveGProSePC5QoSFlowItem []apimpl.IESpec[ProtocolIEID, FiveGProSePC5QoSFlowItem] -func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if fiveGProSePC5QoSFlowItem.FiveGproSepQI.Diagnose(d) { notComprehended = true @@ -11598,12 +11688,12 @@ func (fiveGProSePC5QoSFlowItem *FiveGProSePC5QoSFlowItem) Diagnose(d *ap.Diagnos if fiveGProSePC5QoSFlowItem.FiveGproSerange != nil && fiveGProSePC5QoSFlowItem.FiveGproSerange.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsFiveGProSePC5QoSFlowItem, fiveGProSePC5QoSFlowItem, &fiveGProSePC5QoSFlowItem.iEExtensions) return notComprehended } func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters.iEExtensions) + ext := apimpl.ExtensionFields(extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters.iEExtensions) w.WriteBit(fiveGProSePC5QoSParameters.extensions.Present()) w.WriteBit(fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates != nil) w.WriteBit(len(ext) > 0) @@ -11616,7 +11706,7 @@ func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11653,7 +11743,7 @@ func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) UnmarshalPER(r *pe fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, &fiveGProSePC5QoSParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, &fiveGProSePC5QoSParameters.iEExtensions); err != nil { return err } } @@ -11665,9 +11755,9 @@ func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) UnmarshalPER(r *pe return nil } -var extIEsFiveGProSePC5QoSParameters []ap.IESpec[ProtocolIEID, FiveGProSePC5QoSParameters] +var extIEsFiveGProSePC5QoSParameters []apimpl.IESpec[ProtocolIEID, FiveGProSePC5QoSParameters] -func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if fiveGProSePC5QoSParameters.FiveGProSepc5QoSFlowList.Diagnose(d) { notComprehended = true @@ -11675,12 +11765,12 @@ func (fiveGProSePC5QoSParameters *FiveGProSePC5QoSParameters) Diagnose(d *ap.Dia if fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates != nil && fiveGProSePC5QoSParameters.FiveGProSepc5LinkAggregateBitRates.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsFiveGProSePC5QoSParameters, fiveGProSePC5QoSParameters, &fiveGProSePC5QoSParameters.iEExtensions) return notComprehended } func (fiveGSTMSI *FiveGSTMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFiveGSTMSI, fiveGSTMSI, fiveGSTMSI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsFiveGSTMSI, fiveGSTMSI, fiveGSTMSI.iEExtensions) w.WriteBit(fiveGSTMSI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := fiveGSTMSI.AMFSetID.MarshalPER(w, enc); err != nil { @@ -11693,7 +11783,7 @@ func (fiveGSTMSI *FiveGSTMSI) MarshalPER(w *per.Writer, enc per.Encoding) error return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11725,7 +11815,7 @@ func (fiveGSTMSI *FiveGSTMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGSTMSI, fiveGSTMSI, &fiveGSTMSI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFiveGSTMSI, fiveGSTMSI, &fiveGSTMSI.iEExtensions); err != nil { return err } } @@ -11737,16 +11827,16 @@ func (fiveGSTMSI *FiveGSTMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -var extIEsFiveGSTMSI []ap.IESpec[ProtocolIEID, FiveGSTMSI] +var extIEsFiveGSTMSI []apimpl.IESpec[ProtocolIEID, FiveGSTMSI] -func (fiveGSTMSI *FiveGSTMSI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGSTMSI *FiveGSTMSI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsFiveGSTMSI, fiveGSTMSI, fiveGSTMSI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsFiveGSTMSI, fiveGSTMSI, &fiveGSTMSI.iEExtensions) return notComprehended } func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, forbiddenAreaInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, forbiddenAreaInformationItem.iEExtensions) w.WriteBit(forbiddenAreaInformationItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := forbiddenAreaInformationItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -11756,7 +11846,7 @@ func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11785,7 +11875,7 @@ func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, &forbiddenAreaInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, &forbiddenAreaInformationItem.iEExtensions); err != nil { return err } } @@ -11797,16 +11887,16 @@ func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) UnmarshalPER(r return nil } -var extIEsForbiddenAreaInformationItem []ap.IESpec[ProtocolIEID, ForbiddenAreaInformationItem] +var extIEsForbiddenAreaInformationItem []apimpl.IESpec[ProtocolIEID, ForbiddenAreaInformationItem] -func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (forbiddenAreaInformationItem *ForbiddenAreaInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, forbiddenAreaInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsForbiddenAreaInformationItem, forbiddenAreaInformationItem, &forbiddenAreaInformationItem.iEExtensions) return notComprehended } func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, fromEUTRANtoNGRAN.iEExtensions) + ext := apimpl.ExtensionFields(extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, fromEUTRANtoNGRAN.iEExtensions) w.WriteBit(len(ext) > 0) if err := fromEUTRANtoNGRAN.SourceeNBID.MarshalPER(w, enc); err != nil { return err @@ -11815,7 +11905,7 @@ func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11835,16 +11925,16 @@ func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, &fromEUTRANtoNGRAN.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, &fromEUTRANtoNGRAN.iEExtensions); err != nil { return err } } return nil } -var extIEsFromEUTRANtoNGRAN []ap.IESpec[ProtocolIEID, FromEUTRANtoNGRAN] +var extIEsFromEUTRANtoNGRAN []apimpl.IESpec[ProtocolIEID, FromEUTRANtoNGRAN] -func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if fromEUTRANtoNGRAN.SourceeNBID.Diagnose(d) { notComprehended = true @@ -11852,12 +11942,12 @@ func (fromEUTRANtoNGRAN *FromEUTRANtoNGRAN) Diagnose(d *ap.Diagnosis[ProtocolIEI if fromEUTRANtoNGRAN.TargetNGRANnodeID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, fromEUTRANtoNGRAN.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsFromEUTRANtoNGRAN, fromEUTRANtoNGRAN, &fromEUTRANtoNGRAN.iEExtensions) return notComprehended } func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, fromNGRANtoEUTRAN.iEExtensions) + ext := apimpl.ExtensionFields(extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, fromNGRANtoEUTRAN.iEExtensions) w.WriteBit(len(ext) > 0) if err := fromNGRANtoEUTRAN.SourceNGRANnodeID.MarshalPER(w, enc); err != nil { return err @@ -11866,7 +11956,7 @@ func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -11886,16 +11976,16 @@ func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, &fromNGRANtoEUTRAN.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, &fromNGRANtoEUTRAN.iEExtensions); err != nil { return err } } return nil } -var extIEsFromNGRANtoEUTRAN []ap.IESpec[ProtocolIEID, FromNGRANtoEUTRAN] +var extIEsFromNGRANtoEUTRAN []apimpl.IESpec[ProtocolIEID, FromNGRANtoEUTRAN] -func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if fromNGRANtoEUTRAN.SourceNGRANnodeID.Diagnose(d) { notComprehended = true @@ -11903,12 +11993,12 @@ func (fromNGRANtoEUTRAN *FromNGRANtoEUTRAN) Diagnose(d *ap.Diagnosis[ProtocolIEI if fromNGRANtoEUTRAN.TargeteNBID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, fromNGRANtoEUTRAN.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsFromNGRANtoEUTRAN, fromNGRANtoEUTRAN, &fromNGRANtoEUTRAN.iEExtensions) return notComprehended } func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) w.WriteBit(gBRQosInformation.extensions.Present()) w.WriteBit(gBRQosInformation.NotificationControl != nil) w.WriteBit(gBRQosInformation.MaximumPacketLossRateDL != nil) @@ -11942,7 +12032,7 @@ func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.En } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12010,7 +12100,7 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. gBRQosInformation.MaximumPacketLossRateUL = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { return err } } @@ -12022,11 +12112,11 @@ func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsGBRQosInformation = []ap.IESpec[ProtocolIEID, GBRQosInformation]{ +var extIEsGBRQosInformation = []apimpl.IESpec[ProtocolIEID, GBRQosInformation]{ { ID: IDAlternativeQoSParaSetList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { var v AlternativeQoSParaSetList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -12041,11 +12131,14 @@ var extIEsGBRQosInformation = []ap.IESpec[ProtocolIEID, GBRQosInformation]{ } return x.AlternativeQoSParaSetList, true }, + Clear: func(x *GBRQosInformation) { + x.AlternativeQoSParaSetList = nil + }, }, { ID: IDMonitoringRequestonAvailableBitrate, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { var v MonitoringRequestonAvailableBitrate if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -12060,10 +12153,13 @@ var extIEsGBRQosInformation = []ap.IESpec[ProtocolIEID, GBRQosInformation]{ } return x.MonitoringRequestonAvailableBitrate, true }, + Clear: func(x *GBRQosInformation) { + x.MonitoringRequestonAvailableBitrate = nil + }, }, } -func (gBRQosInformation *GBRQosInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (gBRQosInformation *GBRQosInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if gBRQosInformation.MaximumFlowBitRateDL.Diagnose(d) { notComprehended = true @@ -12086,7 +12182,7 @@ func (gBRQosInformation *GBRQosInformation) Diagnose(d *ap.Diagnosis[ProtocolIEI if gBRQosInformation.MaximumPacketLossRateUL != nil && gBRQosInformation.MaximumPacketLossRateUL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions) return notComprehended } @@ -12112,7 +12208,7 @@ func (gNBID *GNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, gNBID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, gNBID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -12133,7 +12229,7 @@ func (gNBID *GNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } gNBID.GNBID = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -12147,17 +12243,17 @@ func (gNBID *GNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (gNBID *GNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (gNBID *GNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case gNBID.GNBID != nil: case gNBID.ChoiceExtension != nil: - d.Unknown(gNBID.ChoiceExtension.ID, gNBID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, gNBID.ChoiceExtension) } return false } func (gTPTunnel *GTPTunnel) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGTPTunnel, gTPTunnel, gTPTunnel.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGTPTunnel, gTPTunnel, gTPTunnel.iEExtensions) w.WriteBit(gTPTunnel.extensions.Present()) w.WriteBit(len(ext) > 0) if err := gTPTunnel.TransportLayerAddress.MarshalPER(w, enc); err != nil { @@ -12167,7 +12263,7 @@ func (gTPTunnel *GTPTunnel) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12196,7 +12292,7 @@ func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGTPTunnel, gTPTunnel, &gTPTunnel.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGTPTunnel, gTPTunnel, &gTPTunnel.iEExtensions); err != nil { return err } } @@ -12208,16 +12304,16 @@ func (gTPTunnel *GTPTunnel) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -var extIEsGTPTunnel []ap.IESpec[ProtocolIEID, GTPTunnel] +var extIEsGTPTunnel []apimpl.IESpec[ProtocolIEID, GTPTunnel] -func (gTPTunnel *GTPTunnel) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (gTPTunnel *GTPTunnel) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsGTPTunnel, gTPTunnel, gTPTunnel.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGTPTunnel, gTPTunnel, &gTPTunnel.iEExtensions) return notComprehended } func (gUAMI *GUAMI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGUAMI, gUAMI, gUAMI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGUAMI, gUAMI, gUAMI.iEExtensions) w.WriteBit(gUAMI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := gUAMI.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -12233,7 +12329,7 @@ func (gUAMI *GUAMI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12268,7 +12364,7 @@ func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGUAMI, gUAMI, &gUAMI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGUAMI, gUAMI, &gUAMI.iEExtensions); err != nil { return err } } @@ -12280,23 +12376,23 @@ func (gUAMI *GUAMI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsGUAMI []ap.IESpec[ProtocolIEID, GUAMI] +var extIEsGUAMI []apimpl.IESpec[ProtocolIEID, GUAMI] -func (gUAMI *GUAMI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (gUAMI *GUAMI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsGUAMI, gUAMI, gUAMI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGUAMI, gUAMI, &gUAMI.iEExtensions) return notComprehended } func (gUAMIListItem *GUAMIListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGUAMIListItem, gUAMIListItem, gUAMIListItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGUAMIListItem, gUAMIListItem, gUAMIListItem.iEExtensions) w.WriteBit(gUAMIListItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := gUAMIListItem.GUAMI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12322,7 +12418,7 @@ func (gUAMIListItem *GUAMIListItem) UnmarshalPER(r *per.Reader, enc per.Encoding return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGUAMIListItem, gUAMIListItem, &gUAMIListItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGUAMIListItem, gUAMIListItem, &gUAMIListItem.iEExtensions); err != nil { return err } } @@ -12334,14 +12430,14 @@ func (gUAMIListItem *GUAMIListItem) UnmarshalPER(r *per.Reader, enc per.Encoding return nil } -var extIEsGUAMIListItem []ap.IESpec[ProtocolIEID, GUAMIListItem] +var extIEsGUAMIListItem []apimpl.IESpec[ProtocolIEID, GUAMIListItem] -func (gUAMIListItem *GUAMIListItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (gUAMIListItem *GUAMIListItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if gUAMIListItem.GUAMI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGUAMIListItem, gUAMIListItem, gUAMIListItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGUAMIListItem, gUAMIListItem, &gUAMIListItem.iEExtensions) return notComprehended } @@ -12362,7 +12458,7 @@ func (gUAMIType GUAMIType) Name() string { return enumGUAMIType.Name(gUAMIType) } -func (gUAMIType GUAMIType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (gUAMIType GUAMIType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumGUAMIType.Known(gUAMIType) } @@ -12383,12 +12479,12 @@ func (gWContextReleaseIndication GWContextReleaseIndication) Name() string { return enumGWContextReleaseIndication.Name(gWContextReleaseIndication) } -func (gWContextReleaseIndication GWContextReleaseIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (gWContextReleaseIndication GWContextReleaseIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumGWContextReleaseIndication.Known(gWContextReleaseIndication) } func (geographyBasedMDT *GeographyBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGeographyBasedMDT, geographyBasedMDT, geographyBasedMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGeographyBasedMDT, geographyBasedMDT, geographyBasedMDT.iEExtensions) w.WriteBit(geographyBasedMDT.extensions.Present()) w.WriteBit(geographyBasedMDT.NTNPLMNList != nil) w.WriteBit(len(ext) > 0) @@ -12401,7 +12497,7 @@ func (geographyBasedMDT *GeographyBasedMDT) MarshalPER(w *per.Writer, enc per.En } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12436,7 +12532,7 @@ func (geographyBasedMDT *GeographyBasedMDT) UnmarshalPER(r *per.Reader, enc per. } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGeographyBasedMDT, geographyBasedMDT, &geographyBasedMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGeographyBasedMDT, geographyBasedMDT, &geographyBasedMDT.iEExtensions); err != nil { return err } } @@ -12448,19 +12544,19 @@ func (geographyBasedMDT *GeographyBasedMDT) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsGeographyBasedMDT []ap.IESpec[ProtocolIEID, GeographyBasedMDT] +var extIEsGeographyBasedMDT []apimpl.IESpec[ProtocolIEID, GeographyBasedMDT] -func (geographyBasedMDT *GeographyBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (geographyBasedMDT *GeographyBasedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if geographyBasedMDT.NTNGeographicalArea.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGeographyBasedMDT, geographyBasedMDT, geographyBasedMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGeographyBasedMDT, geographyBasedMDT, &geographyBasedMDT.iEExtensions) return notComprehended } func (globalCableIDNew *GlobalCableIDNew) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalCableIDNew, globalCableIDNew, globalCableIDNew.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalCableIDNew, globalCableIDNew, globalCableIDNew.iEExtensions) w.WriteBit(globalCableIDNew.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalCableIDNew.GlobalCableID.MarshalPER(w, enc); err != nil { @@ -12470,7 +12566,7 @@ func (globalCableIDNew *GlobalCableIDNew) MarshalPER(w *per.Writer, enc per.Enco return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12499,7 +12595,7 @@ func (globalCableIDNew *GlobalCableIDNew) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalCableIDNew, globalCableIDNew, &globalCableIDNew.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalCableIDNew, globalCableIDNew, &globalCableIDNew.iEExtensions); err != nil { return err } } @@ -12511,19 +12607,19 @@ func (globalCableIDNew *GlobalCableIDNew) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsGlobalCableIDNew []ap.IESpec[ProtocolIEID, GlobalCableIDNew] +var extIEsGlobalCableIDNew []apimpl.IESpec[ProtocolIEID, GlobalCableIDNew] -func (globalCableIDNew *GlobalCableIDNew) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalCableIDNew *GlobalCableIDNew) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalCableIDNew.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalCableIDNew, globalCableIDNew, globalCableIDNew.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalCableIDNew, globalCableIDNew, &globalCableIDNew.iEExtensions) return notComprehended } func (globalENBID *GlobalENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) w.WriteBit(globalENBID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalENBID.PLMNidentity.MarshalPER(w, enc); err != nil { @@ -12533,7 +12629,7 @@ func (globalENBID *GlobalENBID) MarshalPER(w *per.Writer, enc per.Encoding) erro return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12562,7 +12658,7 @@ func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions); err != nil { return err } } @@ -12574,19 +12670,19 @@ func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsGlobalENBID []ap.IESpec[ProtocolIEID, GlobalENBID] +var extIEsGlobalENBID []apimpl.IESpec[ProtocolIEID, GlobalENBID] -func (globalENBID *GlobalENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalENBID *GlobalENBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalENBID.ENBID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions) return notComprehended } func (globalGNBID *GlobalGNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) w.WriteBit(globalGNBID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalGNBID.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -12596,7 +12692,7 @@ func (globalGNBID *GlobalGNBID) MarshalPER(w *per.Writer, enc per.Encoding) erro return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12625,7 +12721,7 @@ func (globalGNBID *GlobalGNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions); err != nil { return err } } @@ -12637,19 +12733,19 @@ func (globalGNBID *GlobalGNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsGlobalGNBID []ap.IESpec[ProtocolIEID, GlobalGNBID] +var extIEsGlobalGNBID []apimpl.IESpec[ProtocolIEID, GlobalGNBID] -func (globalGNBID *GlobalGNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalGNBID *GlobalGNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalGNBID.GNBID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions) return notComprehended } func (globalLineID *GlobalLineID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalLineID, globalLineID, globalLineID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalLineID, globalLineID, globalLineID.iEExtensions) w.WriteBit(globalLineID.extensions.Present()) w.WriteBit(globalLineID.LineType != nil) w.WriteBit(len(ext) > 0) @@ -12662,7 +12758,7 @@ func (globalLineID *GlobalLineID) MarshalPER(w *per.Writer, enc per.Encoding) er } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12699,7 +12795,7 @@ func (globalLineID *GlobalLineID) UnmarshalPER(r *per.Reader, enc per.Encoding) globalLineID.LineType = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalLineID, globalLineID, &globalLineID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalLineID, globalLineID, &globalLineID.iEExtensions); err != nil { return err } } @@ -12711,11 +12807,11 @@ func (globalLineID *GlobalLineID) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsGlobalLineID = []ap.IESpec[ProtocolIEID, GlobalLineID]{ +var extIEsGlobalLineID = []apimpl.IESpec[ProtocolIEID, GlobalLineID]{ { ID: IDTAI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *GlobalLineID, r *per.Reader, enc per.Encoding) error { var v TAI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -12730,20 +12826,23 @@ var extIEsGlobalLineID = []ap.IESpec[ProtocolIEID, GlobalLineID]{ } return x.TAI, true }, + Clear: func(x *GlobalLineID) { + x.TAI = nil + }, }, } -func (globalLineID *GlobalLineID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalLineID *GlobalLineID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalLineID.LineType != nil && globalLineID.LineType.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalLineID, globalLineID, globalLineID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalLineID, globalLineID, &globalLineID.iEExtensions) return notComprehended } func (globalN3IWFID *GlobalN3IWFID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalN3IWFID, globalN3IWFID, globalN3IWFID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalN3IWFID, globalN3IWFID, globalN3IWFID.iEExtensions) w.WriteBit(globalN3IWFID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalN3IWFID.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -12753,7 +12852,7 @@ func (globalN3IWFID *GlobalN3IWFID) MarshalPER(w *per.Writer, enc per.Encoding) return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12782,7 +12881,7 @@ func (globalN3IWFID *GlobalN3IWFID) UnmarshalPER(r *per.Reader, enc per.Encoding return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalN3IWFID, globalN3IWFID, &globalN3IWFID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalN3IWFID, globalN3IWFID, &globalN3IWFID.iEExtensions); err != nil { return err } } @@ -12794,19 +12893,19 @@ func (globalN3IWFID *GlobalN3IWFID) UnmarshalPER(r *per.Reader, enc per.Encoding return nil } -var extIEsGlobalN3IWFID []ap.IESpec[ProtocolIEID, GlobalN3IWFID] +var extIEsGlobalN3IWFID []apimpl.IESpec[ProtocolIEID, GlobalN3IWFID] -func (globalN3IWFID *GlobalN3IWFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalN3IWFID *GlobalN3IWFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalN3IWFID.N3IWFID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalN3IWFID, globalN3IWFID, globalN3IWFID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalN3IWFID, globalN3IWFID, &globalN3IWFID.iEExtensions) return notComprehended } func (globalNgENBID *GlobalNgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalNgENBID, globalNgENBID, globalNgENBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalNgENBID, globalNgENBID, globalNgENBID.iEExtensions) w.WriteBit(globalNgENBID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalNgENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -12816,7 +12915,7 @@ func (globalNgENBID *GlobalNgENBID) MarshalPER(w *per.Writer, enc per.Encoding) return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -12845,7 +12944,7 @@ func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalNgENBID, globalNgENBID, &globalNgENBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalNgENBID, globalNgENBID, &globalNgENBID.iEExtensions); err != nil { return err } } @@ -12857,14 +12956,14 @@ func (globalNgENBID *GlobalNgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding return nil } -var extIEsGlobalNgENBID []ap.IESpec[ProtocolIEID, GlobalNgENBID] +var extIEsGlobalNgENBID []apimpl.IESpec[ProtocolIEID, GlobalNgENBID] -func (globalNgENBID *GlobalNgENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalNgENBID *GlobalNgENBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalNgENBID.NgENBID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalNgENBID, globalNgENBID, globalNgENBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalNgENBID, globalNgENBID, &globalNgENBID.iEExtensions) return notComprehended } @@ -12904,22 +13003,22 @@ func (globalRANNodeID *GlobalRANNodeID) MarshalPER(w *per.Writer, enc per.Encodi if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalTNGFID, Criticality: globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), Value: globalRANNodeID.GlobalTNGFID}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDGlobalTNGFID, Criticality: globalRANNodeID.choiceCriticality.Of(apimpl.CriticalityReject), Value: globalRANNodeID.GlobalTNGFID}) case globalRANNodeID.GlobalTWIFID != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalTWIFID, Criticality: globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), Value: globalRANNodeID.GlobalTWIFID}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDGlobalTWIFID, Criticality: globalRANNodeID.choiceCriticality.Of(apimpl.CriticalityReject), Value: globalRANNodeID.GlobalTWIFID}) case globalRANNodeID.GlobalWAGFID != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalWAGFID, Criticality: globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), Value: globalRANNodeID.GlobalWAGFID}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDGlobalWAGFID, Criticality: globalRANNodeID.choiceCriticality.Of(apimpl.CriticalityReject), Value: globalRANNodeID.GlobalWAGFID}) case globalRANNodeID.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, globalRANNodeID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, globalRANNodeID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -12952,44 +13051,32 @@ func (globalRANNodeID *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Enco } globalRANNodeID.GlobalN3IWFID = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDGlobalTNGFID: var v GlobalTNGFID - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - globalRANNodeID.ChoiceExtension = &f - break - } globalRANNodeID.GlobalTNGFID = &v - globalRANNodeID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + globalRANNodeID.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityReject) case IDGlobalTWIFID: var v GlobalTWIFID - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - globalRANNodeID.ChoiceExtension = &f - break - } globalRANNodeID.GlobalTWIFID = &v - globalRANNodeID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + globalRANNodeID.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityReject) case IDGlobalWAGFID: var v GlobalWAGFID - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - globalRANNodeID.ChoiceExtension = &f - break - } globalRANNodeID.GlobalWAGFID = &v - globalRANNodeID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + globalRANNodeID.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityReject) default: globalRANNodeID.ChoiceExtension = &f } @@ -12999,7 +13086,7 @@ func (globalRANNodeID *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (globalRANNodeID *GlobalRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalRANNodeID *GlobalRANNodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case globalRANNodeID.GlobalGNBID != nil: return globalRANNodeID.GlobalGNBID.Diagnose(d) @@ -13008,19 +13095,19 @@ func (globalRANNodeID *GlobalRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) case globalRANNodeID.GlobalN3IWFID != nil: return globalRANNodeID.GlobalN3IWFID.Diagnose(d) case globalRANNodeID.GlobalTNGFID != nil: - d.IE(IDGlobalTNGFID, globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), globalRANNodeID.GlobalTNGFID) + return apimpl.DiagnoseChoiceExtension(d, IDGlobalTNGFID, globalRANNodeID.choiceCriticality.Of(apimpl.CriticalityReject), &globalRANNodeID.GlobalTNGFID, &globalRANNodeID.ChoiceExtension) case globalRANNodeID.GlobalTWIFID != nil: - d.IE(IDGlobalTWIFID, globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), globalRANNodeID.GlobalTWIFID) + return apimpl.DiagnoseChoiceExtension(d, IDGlobalTWIFID, globalRANNodeID.choiceCriticality.Of(apimpl.CriticalityReject), &globalRANNodeID.GlobalTWIFID, &globalRANNodeID.ChoiceExtension) case globalRANNodeID.GlobalWAGFID != nil: - d.IE(IDGlobalWAGFID, globalRANNodeID.choiceCriticality.Of(ap.CriticalityReject), globalRANNodeID.GlobalWAGFID) + return apimpl.DiagnoseChoiceExtension(d, IDGlobalWAGFID, globalRANNodeID.choiceCriticality.Of(apimpl.CriticalityReject), &globalRANNodeID.GlobalWAGFID, &globalRANNodeID.ChoiceExtension) case globalRANNodeID.ChoiceExtension != nil: - d.Unknown(globalRANNodeID.ChoiceExtension.ID, globalRANNodeID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, globalRANNodeID.ChoiceExtension) } return false } func (globalTNGFID *GlobalTNGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalTNGFID, globalTNGFID, globalTNGFID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalTNGFID, globalTNGFID, globalTNGFID.iEExtensions) w.WriteBit(globalTNGFID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalTNGFID.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -13030,7 +13117,7 @@ func (globalTNGFID *GlobalTNGFID) MarshalPER(w *per.Writer, enc per.Encoding) er return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13059,7 +13146,7 @@ func (globalTNGFID *GlobalTNGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalTNGFID, globalTNGFID, &globalTNGFID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalTNGFID, globalTNGFID, &globalTNGFID.iEExtensions); err != nil { return err } } @@ -13071,19 +13158,19 @@ func (globalTNGFID *GlobalTNGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsGlobalTNGFID []ap.IESpec[ProtocolIEID, GlobalTNGFID] +var extIEsGlobalTNGFID []apimpl.IESpec[ProtocolIEID, GlobalTNGFID] -func (globalTNGFID *GlobalTNGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalTNGFID *GlobalTNGFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalTNGFID.TNGFID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalTNGFID, globalTNGFID, globalTNGFID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalTNGFID, globalTNGFID, &globalTNGFID.iEExtensions) return notComprehended } func (globalTWIFID *GlobalTWIFID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalTWIFID, globalTWIFID, globalTWIFID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalTWIFID, globalTWIFID, globalTWIFID.iEExtensions) w.WriteBit(globalTWIFID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalTWIFID.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -13093,7 +13180,7 @@ func (globalTWIFID *GlobalTWIFID) MarshalPER(w *per.Writer, enc per.Encoding) er return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13122,7 +13209,7 @@ func (globalTWIFID *GlobalTWIFID) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalTWIFID, globalTWIFID, &globalTWIFID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalTWIFID, globalTWIFID, &globalTWIFID.iEExtensions); err != nil { return err } } @@ -13134,19 +13221,19 @@ func (globalTWIFID *GlobalTWIFID) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsGlobalTWIFID []ap.IESpec[ProtocolIEID, GlobalTWIFID] +var extIEsGlobalTWIFID []apimpl.IESpec[ProtocolIEID, GlobalTWIFID] -func (globalTWIFID *GlobalTWIFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalTWIFID *GlobalTWIFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalTWIFID.TWIFID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalTWIFID, globalTWIFID, globalTWIFID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalTWIFID, globalTWIFID, &globalTWIFID.iEExtensions) return notComprehended } func (globalWAGFID *GlobalWAGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalWAGFID, globalWAGFID, globalWAGFID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsGlobalWAGFID, globalWAGFID, globalWAGFID.iEExtensions) w.WriteBit(globalWAGFID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := globalWAGFID.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -13156,7 +13243,7 @@ func (globalWAGFID *GlobalWAGFID) MarshalPER(w *per.Writer, enc per.Encoding) er return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13185,7 +13272,7 @@ func (globalWAGFID *GlobalWAGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalWAGFID, globalWAGFID, &globalWAGFID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalWAGFID, globalWAGFID, &globalWAGFID.iEExtensions); err != nil { return err } } @@ -13197,19 +13284,19 @@ func (globalWAGFID *GlobalWAGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsGlobalWAGFID []ap.IESpec[ProtocolIEID, GlobalWAGFID] +var extIEsGlobalWAGFID []apimpl.IESpec[ProtocolIEID, GlobalWAGFID] -func (globalWAGFID *GlobalWAGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (globalWAGFID *GlobalWAGFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if globalWAGFID.WAGFID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalWAGFID, globalWAGFID, globalWAGFID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsGlobalWAGFID, globalWAGFID, &globalWAGFID.iEExtensions) return notComprehended } func (hFCNodeIDNew *HFCNodeIDNew) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsHFCNodeIDNew, hFCNodeIDNew, hFCNodeIDNew.iEExtensions) + ext := apimpl.ExtensionFields(extIEsHFCNodeIDNew, hFCNodeIDNew, hFCNodeIDNew.iEExtensions) w.WriteBit(hFCNodeIDNew.extensions.Present()) w.WriteBit(len(ext) > 0) if err := hFCNodeIDNew.HFCNodeID.MarshalPER(w, enc); err != nil { @@ -13219,7 +13306,7 @@ func (hFCNodeIDNew *HFCNodeIDNew) MarshalPER(w *per.Writer, enc per.Encoding) er return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13248,7 +13335,7 @@ func (hFCNodeIDNew *HFCNodeIDNew) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHFCNodeIDNew, hFCNodeIDNew, &hFCNodeIDNew.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsHFCNodeIDNew, hFCNodeIDNew, &hFCNodeIDNew.iEExtensions); err != nil { return err } } @@ -13260,11 +13347,11 @@ func (hFCNodeIDNew *HFCNodeIDNew) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsHFCNodeIDNew = []ap.IESpec[ProtocolIEID, HFCNodeIDNew]{ +var extIEsHFCNodeIDNew = []apimpl.IESpec[ProtocolIEID, HFCNodeIDNew]{ { ID: IDGlobalCableID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HFCNodeIDNew, r *per.Reader, enc per.Encoding) error { var v GlobalCableID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13279,20 +13366,23 @@ var extIEsHFCNodeIDNew = []ap.IESpec[ProtocolIEID, HFCNodeIDNew]{ } return x.GlobalCableID, true }, + Clear: func(x *HFCNodeIDNew) { + x.GlobalCableID = nil + }, }, } -func (hFCNodeIDNew *HFCNodeIDNew) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (hFCNodeIDNew *HFCNodeIDNew) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if hFCNodeIDNew.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsHFCNodeIDNew, hFCNodeIDNew, hFCNodeIDNew.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsHFCNodeIDNew, hFCNodeIDNew, &hFCNodeIDNew.iEExtensions) return notComprehended } func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsHandoverCommandTransfer, handoverCommandTransfer, handoverCommandTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsHandoverCommandTransfer, handoverCommandTransfer, handoverCommandTransfer.iEExtensions) w.WriteBit(handoverCommandTransfer.extensions.Present()) w.WriteBit(handoverCommandTransfer.DLForwardingUPTNLInformation != nil) w.WriteBit(handoverCommandTransfer.QosFlowToBeForwarded != nil) @@ -13314,7 +13404,7 @@ func (handoverCommandTransfer *HandoverCommandTransfer) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13366,7 +13456,7 @@ func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Read } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverCommandTransfer, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsHandoverCommandTransfer, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions); err != nil { return err } } @@ -13378,11 +13468,11 @@ func (handoverCommandTransfer *HandoverCommandTransfer) UnmarshalPER(r *per.Read return nil } -var extIEsHandoverCommandTransfer = []ap.IESpec[ProtocolIEID, HandoverCommandTransfer]{ +var extIEsHandoverCommandTransfer = []apimpl.IESpec[ProtocolIEID, HandoverCommandTransfer]{ { ID: IDAdditionalDLForwardingUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13397,11 +13487,14 @@ var extIEsHandoverCommandTransfer = []ap.IESpec[ProtocolIEID, HandoverCommandTra } return x.AdditionalDLForwardingUPTNLInformation, true }, + Clear: func(x *HandoverCommandTransfer) { + x.AdditionalDLForwardingUPTNLInformation = nil + }, }, { ID: IDULForwardingUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13416,11 +13509,14 @@ var extIEsHandoverCommandTransfer = []ap.IESpec[ProtocolIEID, HandoverCommandTra } return x.ULForwardingUPTNLInformation, true }, + Clear: func(x *HandoverCommandTransfer) { + x.ULForwardingUPTNLInformation = nil + }, }, { ID: IDAdditionalULForwardingUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13435,11 +13531,14 @@ var extIEsHandoverCommandTransfer = []ap.IESpec[ProtocolIEID, HandoverCommandTra } return x.AdditionalULForwardingUPTNLInformation, true }, + Clear: func(x *HandoverCommandTransfer) { + x.AdditionalULForwardingUPTNLInformation = nil + }, }, { ID: IDDataForwardingResponseERABList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { var v DataForwardingResponseERABList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13454,11 +13553,14 @@ var extIEsHandoverCommandTransfer = []ap.IESpec[ProtocolIEID, HandoverCommandTra } return x.DataForwardingResponseERAB, true }, + Clear: func(x *HandoverCommandTransfer) { + x.DataForwardingResponseERAB = nil + }, }, { ID: IDQosFlowFailedToSetupList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverCommandTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowListWithCause if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13473,10 +13575,13 @@ var extIEsHandoverCommandTransfer = []ap.IESpec[ProtocolIEID, HandoverCommandTra } return x.QosFlowFailedToSetupList, true }, + Clear: func(x *HandoverCommandTransfer) { + x.QosFlowFailedToSetupList = nil + }, }, } -func (handoverCommandTransfer *HandoverCommandTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (handoverCommandTransfer *HandoverCommandTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if handoverCommandTransfer.DLForwardingUPTNLInformation != nil && handoverCommandTransfer.DLForwardingUPTNLInformation.Diagnose(d) { notComprehended = true @@ -13487,19 +13592,19 @@ func (handoverCommandTransfer *HandoverCommandTransfer) Diagnose(d *ap.Diagnosis if handoverCommandTransfer.DataForwardingResponseDRB.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsHandoverCommandTransfer, handoverCommandTransfer, handoverCommandTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsHandoverCommandTransfer, handoverCommandTransfer, &handoverCommandTransfer.iEExtensions) return notComprehended } func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer.iEExtensions) w.WriteBit(handoverPreparationUnsuccessfulTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if err := handoverPreparationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13525,7 +13630,7 @@ func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTr return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, &handoverPreparationUnsuccessfulTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, &handoverPreparationUnsuccessfulTransfer.iEExtensions); err != nil { return err } } @@ -13537,19 +13642,19 @@ func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTr return nil } -var extIEsHandoverPreparationUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, HandoverPreparationUnsuccessfulTransfer] +var extIEsHandoverPreparationUnsuccessfulTransfer []apimpl.IESpec[ProtocolIEID, HandoverPreparationUnsuccessfulTransfer] -func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (handoverPreparationUnsuccessfulTransfer *HandoverPreparationUnsuccessfulTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if handoverPreparationUnsuccessfulTransfer.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsHandoverPreparationUnsuccessfulTransfer, handoverPreparationUnsuccessfulTransfer, &handoverPreparationUnsuccessfulTransfer.iEExtensions) return notComprehended } func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer.iEExtensions) w.WriteBit(handoverRequestAcknowledgeTransfer.extensions.Present()) w.WriteBit(handoverRequestAcknowledgeTransfer.DLForwardingUPTNLInformation != nil) w.WriteBit(handoverRequestAcknowledgeTransfer.SecurityResult != nil) @@ -13583,7 +13688,7 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Ma } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13652,7 +13757,7 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions); err != nil { return err } } @@ -13664,11 +13769,11 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Un return nil } -var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, HandoverRequestAcknowledgeTransfer]{ +var extIEsHandoverRequestAcknowledgeTransfer = []apimpl.IESpec[ProtocolIEID, HandoverRequestAcknowledgeTransfer]{ { ID: IDAdditionalDLUPTNLInformationForHOList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v AdditionalDLUPTNLInformationForHOList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13683,11 +13788,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.AdditionalDLUPTNLInformationForHO, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.AdditionalDLUPTNLInformationForHO = nil + }, }, { ID: IDULForwardingUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13702,11 +13810,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.ULForwardingUPTNLInformation, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.ULForwardingUPTNLInformation = nil + }, }, { ID: IDAdditionalULForwardingUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13721,11 +13832,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.AdditionalULForwardingUPTNLInformation, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.AdditionalULForwardingUPTNLInformation = nil + }, }, { ID: IDDataForwardingResponseERABList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v DataForwardingResponseERABList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13740,11 +13854,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.DataForwardingResponseERAB, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.DataForwardingResponseERAB = nil + }, }, { ID: IDRedundantDLNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13759,11 +13876,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.RedundantDLNGUUPTNLInformation, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.RedundantDLNGUUPTNLInformation = nil + }, }, { ID: IDUsedRSNInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v RedundantPDUSessionInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13778,11 +13898,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.UsedRSNInformation, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.UsedRSNInformation = nil + }, }, { ID: IDGlobalRANNodeID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v GlobalRANNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13797,11 +13920,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.GlobalRANNodeID, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.GlobalRANNodeID = nil + }, }, { ID: IDMBSSupportIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSupportIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13816,11 +13942,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.MBSSupportIndicator, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.MBSSupportIndicator = nil + }, }, { ID: IDPDUSetbasedHandlingIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v PDUSetbasedHandlingIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13835,11 +13964,14 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.PDUSetbasedHandlingIndicator, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.PDUSetbasedHandlingIndicator = nil + }, }, { ID: IDECNMarkingorCongestionInformationReportingStatus, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *HandoverRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v ECNMarkingorCongestionInformationReportingStatus if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -13854,10 +13986,13 @@ var extIEsHandoverRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, Handove } return x.ECNMarkingorCongestionInformationReportingStatus, true }, + Clear: func(x *HandoverRequestAcknowledgeTransfer) { + x.ECNMarkingorCongestionInformationReportingStatus = nil + }, }, } -func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if handoverRequestAcknowledgeTransfer.DLNGUUPTNLInformation.Diagnose(d) { notComprehended = true @@ -13877,12 +14012,12 @@ func (handoverRequestAcknowledgeTransfer *HandoverRequestAcknowledgeTransfer) Di if handoverRequestAcknowledgeTransfer.DataForwardingResponseDRB.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsHandoverRequestAcknowledgeTransfer, handoverRequestAcknowledgeTransfer, &handoverRequestAcknowledgeTransfer.iEExtensions) return notComprehended } func (handoverRequiredTransfer *HandoverRequiredTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsHandoverRequiredTransfer, handoverRequiredTransfer, handoverRequiredTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsHandoverRequiredTransfer, handoverRequiredTransfer, handoverRequiredTransfer.iEExtensions) w.WriteBit(handoverRequiredTransfer.extensions.Present()) w.WriteBit(handoverRequiredTransfer.DirectForwardingPathAvailability != nil) w.WriteBit(len(ext) > 0) @@ -13892,7 +14027,7 @@ func (handoverRequiredTransfer *HandoverRequiredTransfer) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -13926,7 +14061,7 @@ func (handoverRequiredTransfer *HandoverRequiredTransfer) UnmarshalPER(r *per.Re handoverRequiredTransfer.DirectForwardingPathAvailability = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRequiredTransfer, handoverRequiredTransfer, &handoverRequiredTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRequiredTransfer, handoverRequiredTransfer, &handoverRequiredTransfer.iEExtensions); err != nil { return err } } @@ -13938,19 +14073,19 @@ func (handoverRequiredTransfer *HandoverRequiredTransfer) UnmarshalPER(r *per.Re return nil } -var extIEsHandoverRequiredTransfer []ap.IESpec[ProtocolIEID, HandoverRequiredTransfer] +var extIEsHandoverRequiredTransfer []apimpl.IESpec[ProtocolIEID, HandoverRequiredTransfer] -func (handoverRequiredTransfer *HandoverRequiredTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (handoverRequiredTransfer *HandoverRequiredTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if handoverRequiredTransfer.DirectForwardingPathAvailability != nil && handoverRequiredTransfer.DirectForwardingPathAvailability.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsHandoverRequiredTransfer, handoverRequiredTransfer, handoverRequiredTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsHandoverRequiredTransfer, handoverRequiredTransfer, &handoverRequiredTransfer.iEExtensions) return notComprehended } func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer.iEExtensions) w.WriteBit(handoverResourceAllocationUnsuccessfulTransfer.extensions.Present()) w.WriteBit(handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(len(ext) > 0) @@ -13963,7 +14098,7 @@ func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocation } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14000,7 +14135,7 @@ func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocation handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, &handoverResourceAllocationUnsuccessfulTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, &handoverResourceAllocationUnsuccessfulTransfer.iEExtensions); err != nil { return err } } @@ -14012,9 +14147,9 @@ func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocation return nil } -var extIEsHandoverResourceAllocationUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, HandoverResourceAllocationUnsuccessfulTransfer] +var extIEsHandoverResourceAllocationUnsuccessfulTransfer []apimpl.IESpec[ProtocolIEID, HandoverResourceAllocationUnsuccessfulTransfer] -func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocationUnsuccessfulTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if handoverResourceAllocationUnsuccessfulTransfer.Cause.Diagnose(d) { notComprehended = true @@ -14022,7 +14157,7 @@ func (handoverResourceAllocationUnsuccessfulTransfer *HandoverResourceAllocation if handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics != nil && handoverResourceAllocationUnsuccessfulTransfer.CriticalityDiagnostics.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsHandoverResourceAllocationUnsuccessfulTransfer, handoverResourceAllocationUnsuccessfulTransfer, &handoverResourceAllocationUnsuccessfulTransfer.iEExtensions) return notComprehended } @@ -14043,7 +14178,7 @@ func (handoverType HandoverType) Name() string { return enumHandoverType.Name(handoverType) } -func (handoverType HandoverType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (handoverType HandoverType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumHandoverType.Known(handoverType) } @@ -14064,7 +14199,7 @@ func (iABAuthorized IABAuthorized) Name() string { return enumIABAuthorized.Name(iABAuthorized) } -func (iABAuthorized IABAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (iABAuthorized IABAuthorized) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIABAuthorized.Known(iABAuthorized) } @@ -14085,7 +14220,7 @@ func (iABNodeIndication IABNodeIndication) Name() string { return enumIABNodeIndication.Name(iABNodeIndication) } -func (iABNodeIndication IABNodeIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (iABNodeIndication IABNodeIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIABNodeIndication.Known(iABNodeIndication) } @@ -14106,12 +14241,12 @@ func (iABSupported IABSupported) Name() string { return enumIABSupported.Name(iABSupported) } -func (iABSupported IABSupported) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (iABSupported IABSupported) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIABSupported.Known(iABSupported) } func (immediateMDTNr *ImmediateMDTNr) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsImmediateMDTNr, immediateMDTNr, immediateMDTNr.iEExtensions) + ext := apimpl.ExtensionFields(extIEsImmediateMDTNr, immediateMDTNr, immediateMDTNr.iEExtensions) w.WriteBit(immediateMDTNr.extensions.Present()) w.WriteBit(immediateMDTNr.M1Configuration != nil) w.WriteBit(immediateMDTNr.M4Configuration != nil) @@ -14172,7 +14307,7 @@ func (immediateMDTNr *ImmediateMDTNr) MarshalPER(w *per.Writer, enc per.Encoding } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14297,7 +14432,7 @@ func (immediateMDTNr *ImmediateMDTNr) UnmarshalPER(r *per.Reader, enc per.Encodi immediateMDTNr.SensorMeasurementConfiguration = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsImmediateMDTNr, immediateMDTNr, &immediateMDTNr.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsImmediateMDTNr, immediateMDTNr, &immediateMDTNr.iEExtensions); err != nil { return err } } @@ -14309,9 +14444,9 @@ func (immediateMDTNr *ImmediateMDTNr) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsImmediateMDTNr []ap.IESpec[ProtocolIEID, ImmediateMDTNr] +var extIEsImmediateMDTNr []apimpl.IESpec[ProtocolIEID, ImmediateMDTNr] -func (immediateMDTNr *ImmediateMDTNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (immediateMDTNr *ImmediateMDTNr) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if immediateMDTNr.M1Configuration != nil && immediateMDTNr.M1Configuration.Diagnose(d) { notComprehended = true @@ -14340,7 +14475,7 @@ func (immediateMDTNr *ImmediateMDTNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bo if immediateMDTNr.SensorMeasurementConfiguration != nil && immediateMDTNr.SensorMeasurementConfiguration.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsImmediateMDTNr, immediateMDTNr, immediateMDTNr.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsImmediateMDTNr, immediateMDTNr, &immediateMDTNr.iEExtensions) return notComprehended } @@ -14361,7 +14496,7 @@ func (includeBeamMeasurementsIndication IncludeBeamMeasurementsIndication) Name( return enumIncludeBeamMeasurementsIndication.Name(includeBeamMeasurementsIndication) } -func (includeBeamMeasurementsIndication IncludeBeamMeasurementsIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (includeBeamMeasurementsIndication IncludeBeamMeasurementsIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIncludeBeamMeasurementsIndication.Known(includeBeamMeasurementsIndication) } @@ -14382,12 +14517,12 @@ func (indicationofBitrateAdaptation IndicationofBitrateAdaptation) Name() string return enumIndicationofBitrateAdaptation.Name(indicationofBitrateAdaptation) } -func (indicationofBitrateAdaptation IndicationofBitrateAdaptation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (indicationofBitrateAdaptation IndicationofBitrateAdaptation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIndicationofBitrateAdaptation.Known(indicationofBitrateAdaptation) } func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNodesForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions) + ext := apimpl.ExtensionFields(extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions) w.WriteBit(infoOnRecommendedCellsAndRANNodesForPaging.extensions.Present()) w.WriteBit(len(ext) > 0) if err := infoOnRecommendedCellsAndRANNodesForPaging.RecommendedCellsForPaging.MarshalPER(w, enc); err != nil { @@ -14397,7 +14532,7 @@ func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNo return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14426,7 +14561,7 @@ func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNo return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, &infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, &infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions); err != nil { return err } } @@ -14438,9 +14573,9 @@ func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNo return nil } -var extIEsInfoOnRecommendedCellsAndRANNodesForPaging []ap.IESpec[ProtocolIEID, InfoOnRecommendedCellsAndRANNodesForPaging] +var extIEsInfoOnRecommendedCellsAndRANNodesForPaging []apimpl.IESpec[ProtocolIEID, InfoOnRecommendedCellsAndRANNodesForPaging] -func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNodesForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNodesForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if infoOnRecommendedCellsAndRANNodesForPaging.RecommendedCellsForPaging.Diagnose(d) { notComprehended = true @@ -14448,7 +14583,7 @@ func (infoOnRecommendedCellsAndRANNodesForPaging *InfoOnRecommendedCellsAndRANNo if infoOnRecommendedCellsAndRANNodesForPaging.RecommendRANNodesForPaging.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsInfoOnRecommendedCellsAndRANNodesForPaging, infoOnRecommendedCellsAndRANNodesForPaging, &infoOnRecommendedCellsAndRANNodesForPaging.iEExtensions) return notComprehended } @@ -14469,7 +14604,7 @@ func (integrityProtectionIndication IntegrityProtectionIndication) Name() string return enumIntegrityProtectionIndication.Name(integrityProtectionIndication) } -func (integrityProtectionIndication IntegrityProtectionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (integrityProtectionIndication IntegrityProtectionIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIntegrityProtectionIndication.Known(integrityProtectionIndication) } @@ -14490,12 +14625,12 @@ func (integrityProtectionResult IntegrityProtectionResult) Name() string { return enumIntegrityProtectionResult.Name(integrityProtectionResult) } -func (integrityProtectionResult IntegrityProtectionResult) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (integrityProtectionResult IntegrityProtectionResult) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIntegrityProtectionResult.Known(integrityProtectionResult) } func (interSystemFailureIndication *InterSystemFailureIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsInterSystemFailureIndication, interSystemFailureIndication, interSystemFailureIndication.iEExtensions) + ext := apimpl.ExtensionFields(extIEsInterSystemFailureIndication, interSystemFailureIndication, interSystemFailureIndication.iEExtensions) w.WriteBit(interSystemFailureIndication.extensions.Present()) w.WriteBit(interSystemFailureIndication.UERLFReportContainer != nil) w.WriteBit(len(ext) > 0) @@ -14505,7 +14640,7 @@ func (interSystemFailureIndication *InterSystemFailureIndication) MarshalPER(w * } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14539,7 +14674,7 @@ func (interSystemFailureIndication *InterSystemFailureIndication) UnmarshalPER(r interSystemFailureIndication.UERLFReportContainer = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemFailureIndication, interSystemFailureIndication, &interSystemFailureIndication.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemFailureIndication, interSystemFailureIndication, &interSystemFailureIndication.iEExtensions); err != nil { return err } } @@ -14551,26 +14686,26 @@ func (interSystemFailureIndication *InterSystemFailureIndication) UnmarshalPER(r return nil } -var extIEsInterSystemFailureIndication []ap.IESpec[ProtocolIEID, InterSystemFailureIndication] +var extIEsInterSystemFailureIndication []apimpl.IESpec[ProtocolIEID, InterSystemFailureIndication] -func (interSystemFailureIndication *InterSystemFailureIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (interSystemFailureIndication *InterSystemFailureIndication) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if interSystemFailureIndication.UERLFReportContainer != nil && interSystemFailureIndication.UERLFReportContainer.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsInterSystemFailureIndication, interSystemFailureIndication, interSystemFailureIndication.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsInterSystemFailureIndication, interSystemFailureIndication, &interSystemFailureIndication.iEExtensions) return notComprehended } func (interSystemHOReport *InterSystemHOReport) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsInterSystemHOReport, interSystemHOReport, interSystemHOReport.iEExtensions) + ext := apimpl.ExtensionFields(extIEsInterSystemHOReport, interSystemHOReport, interSystemHOReport.iEExtensions) w.WriteBit(interSystemHOReport.extensions.Present()) w.WriteBit(len(ext) > 0) if err := interSystemHOReport.HandoverReportType.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14596,7 +14731,7 @@ func (interSystemHOReport *InterSystemHOReport) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemHOReport, interSystemHOReport, &interSystemHOReport.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemHOReport, interSystemHOReport, &interSystemHOReport.iEExtensions); err != nil { return err } } @@ -14608,14 +14743,14 @@ func (interSystemHOReport *InterSystemHOReport) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsInterSystemHOReport []ap.IESpec[ProtocolIEID, InterSystemHOReport] +var extIEsInterSystemHOReport []apimpl.IESpec[ProtocolIEID, InterSystemHOReport] -func (interSystemHOReport *InterSystemHOReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (interSystemHOReport *InterSystemHOReport) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if interSystemHOReport.HandoverReportType.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsInterSystemHOReport, interSystemHOReport, interSystemHOReport.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsInterSystemHOReport, interSystemHOReport, &interSystemHOReport.iEExtensions) return notComprehended } @@ -14648,12 +14783,12 @@ func (interSystemHandoverReportType *InterSystemHandoverReportType) MarshalPER(w if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemMobilityFailureforVoiceFallback, Criticality: interSystemHandoverReportType.choiceCriticality.Of(ap.CriticalityIgnore), Value: interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDIntersystemMobilityFailureforVoiceFallback, Criticality: interSystemHandoverReportType.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback}) case interSystemHandoverReportType.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, interSystemHandoverReportType.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, interSystemHandoverReportType.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -14680,22 +14815,18 @@ func (interSystemHandoverReportType *InterSystemHandoverReportType) UnmarshalPER } interSystemHandoverReportType.IntersystemUnnecessaryHO = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDIntersystemMobilityFailureforVoiceFallback: var v IntersystemMobilityFailureforVoiceFallback - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - interSystemHandoverReportType.ChoiceExtension = &f - break - } interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback = &v - interSystemHandoverReportType.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + interSystemHandoverReportType.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) default: interSystemHandoverReportType.ChoiceExtension = &f } @@ -14705,22 +14836,22 @@ func (interSystemHandoverReportType *InterSystemHandoverReportType) UnmarshalPER return nil } -func (interSystemHandoverReportType *InterSystemHandoverReportType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (interSystemHandoverReportType *InterSystemHandoverReportType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case interSystemHandoverReportType.TooearlyIntersystemHO != nil: return interSystemHandoverReportType.TooearlyIntersystemHO.Diagnose(d) case interSystemHandoverReportType.IntersystemUnnecessaryHO != nil: return interSystemHandoverReportType.IntersystemUnnecessaryHO.Diagnose(d) case interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback != nil: - d.IE(IDIntersystemMobilityFailureforVoiceFallback, interSystemHandoverReportType.choiceCriticality.Of(ap.CriticalityIgnore), interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback) + return apimpl.DiagnoseChoiceExtension(d, IDIntersystemMobilityFailureforVoiceFallback, interSystemHandoverReportType.choiceCriticality.Of(apimpl.CriticalityIgnore), &interSystemHandoverReportType.IntersystemMobilityFailureforVoiceFallback, &interSystemHandoverReportType.ChoiceExtension) case interSystemHandoverReportType.ChoiceExtension != nil: - d.Unknown(interSystemHandoverReportType.ChoiceExtension.ID, interSystemHandoverReportType.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, interSystemHandoverReportType.ChoiceExtension) } return false } func (intersystemCellActivationReply *IntersystemCellActivationReply) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemCellActivationReply, intersystemCellActivationReply, intersystemCellActivationReply.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemCellActivationReply, intersystemCellActivationReply, intersystemCellActivationReply.iEExtensions) w.WriteBit(intersystemCellActivationReply.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemCellActivationReply.ActivatedCellList.MarshalPER(w, enc); err != nil { @@ -14730,7 +14861,7 @@ func (intersystemCellActivationReply *IntersystemCellActivationReply) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14759,7 +14890,7 @@ func (intersystemCellActivationReply *IntersystemCellActivationReply) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellActivationReply, intersystemCellActivationReply, &intersystemCellActivationReply.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellActivationReply, intersystemCellActivationReply, &intersystemCellActivationReply.iEExtensions); err != nil { return err } } @@ -14771,9 +14902,9 @@ func (intersystemCellActivationReply *IntersystemCellActivationReply) UnmarshalP return nil } -var extIEsIntersystemCellActivationReply []ap.IESpec[ProtocolIEID, IntersystemCellActivationReply] +var extIEsIntersystemCellActivationReply []apimpl.IESpec[ProtocolIEID, IntersystemCellActivationReply] -func (intersystemCellActivationReply *IntersystemCellActivationReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemCellActivationReply *IntersystemCellActivationReply) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemCellActivationReply.ActivatedCellList.Diagnose(d) { notComprehended = true @@ -14781,12 +14912,12 @@ func (intersystemCellActivationReply *IntersystemCellActivationReply) Diagnose(d if intersystemCellActivationReply.ActivationID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemCellActivationReply, intersystemCellActivationReply, intersystemCellActivationReply.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemCellActivationReply, intersystemCellActivationReply, &intersystemCellActivationReply.iEExtensions) return notComprehended } func (intersystemCellActivationRequest *IntersystemCellActivationRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, intersystemCellActivationRequest.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, intersystemCellActivationRequest.iEExtensions) w.WriteBit(intersystemCellActivationRequest.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemCellActivationRequest.ActivationID.MarshalPER(w, enc); err != nil { @@ -14796,7 +14927,7 @@ func (intersystemCellActivationRequest *IntersystemCellActivationRequest) Marsha return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14825,7 +14956,7 @@ func (intersystemCellActivationRequest *IntersystemCellActivationRequest) Unmars return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, &intersystemCellActivationRequest.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, &intersystemCellActivationRequest.iEExtensions); err != nil { return err } } @@ -14837,9 +14968,9 @@ func (intersystemCellActivationRequest *IntersystemCellActivationRequest) Unmars return nil } -var extIEsIntersystemCellActivationRequest []ap.IESpec[ProtocolIEID, IntersystemCellActivationRequest] +var extIEsIntersystemCellActivationRequest []apimpl.IESpec[ProtocolIEID, IntersystemCellActivationRequest] -func (intersystemCellActivationRequest *IntersystemCellActivationRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemCellActivationRequest *IntersystemCellActivationRequest) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemCellActivationRequest.ActivationID.Diagnose(d) { notComprehended = true @@ -14847,19 +14978,19 @@ func (intersystemCellActivationRequest *IntersystemCellActivationRequest) Diagno if intersystemCellActivationRequest.CellsToActivateList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, intersystemCellActivationRequest.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemCellActivationRequest, intersystemCellActivationRequest, &intersystemCellActivationRequest.iEExtensions) return notComprehended } func (intersystemCellStateIndication *IntersystemCellStateIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemCellStateIndication, intersystemCellStateIndication, intersystemCellStateIndication.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemCellStateIndication, intersystemCellStateIndication, intersystemCellStateIndication.iEExtensions) w.WriteBit(intersystemCellStateIndication.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemCellStateIndication.NotificationCellList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14885,7 +15016,7 @@ func (intersystemCellStateIndication *IntersystemCellStateIndication) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellStateIndication, intersystemCellStateIndication, &intersystemCellStateIndication.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemCellStateIndication, intersystemCellStateIndication, &intersystemCellStateIndication.iEExtensions); err != nil { return err } } @@ -14897,19 +15028,19 @@ func (intersystemCellStateIndication *IntersystemCellStateIndication) UnmarshalP return nil } -var extIEsIntersystemCellStateIndication []ap.IESpec[ProtocolIEID, IntersystemCellStateIndication] +var extIEsIntersystemCellStateIndication []apimpl.IESpec[ProtocolIEID, IntersystemCellStateIndication] -func (intersystemCellStateIndication *IntersystemCellStateIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemCellStateIndication *IntersystemCellStateIndication) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemCellStateIndication.NotificationCellList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemCellStateIndication, intersystemCellStateIndication, intersystemCellStateIndication.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemCellStateIndication, intersystemCellStateIndication, &intersystemCellStateIndication.iEExtensions) return notComprehended } func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback.iEExtensions) w.WriteBit(intersystemMobilityFailureforVoiceFallback.extensions.Present()) w.WriteBit(intersystemMobilityFailureforVoiceFallback.ReconnectCellID != nil) w.WriteBit(intersystemMobilityFailureforVoiceFallback.UERLFReportContainer != nil) @@ -14931,7 +15062,7 @@ func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforV } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -14982,7 +15113,7 @@ func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforV intersystemMobilityFailureforVoiceFallback.UERLFReportContainer = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, &intersystemMobilityFailureforVoiceFallback.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, &intersystemMobilityFailureforVoiceFallback.iEExtensions); err != nil { return err } } @@ -14994,9 +15125,9 @@ func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforV return nil } -var extIEsIntersystemMobilityFailureforVoiceFallback []ap.IESpec[ProtocolIEID, IntersystemMobilityFailureforVoiceFallback] +var extIEsIntersystemMobilityFailureforVoiceFallback []apimpl.IESpec[ProtocolIEID, IntersystemMobilityFailureforVoiceFallback] -func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforVoiceFallback) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemMobilityFailureforVoiceFallback.SourcecellID.Diagnose(d) { notComprehended = true @@ -15010,19 +15141,19 @@ func (intersystemMobilityFailureforVoiceFallback *IntersystemMobilityFailureforV if intersystemMobilityFailureforVoiceFallback.UERLFReportContainer != nil && intersystemMobilityFailureforVoiceFallback.UERLFReportContainer.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemMobilityFailureforVoiceFallback, intersystemMobilityFailureforVoiceFallback, &intersystemMobilityFailureforVoiceFallback.iEExtensions) return notComprehended } func (intersystemResourceStatusReply *IntersystemResourceStatusReply) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, intersystemResourceStatusReply.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, intersystemResourceStatusReply.iEExtensions) w.WriteBit(intersystemResourceStatusReply.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemResourceStatusReply.Reportingsystem.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -15048,7 +15179,7 @@ func (intersystemResourceStatusReply *IntersystemResourceStatusReply) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, &intersystemResourceStatusReply.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, &intersystemResourceStatusReply.iEExtensions); err != nil { return err } } @@ -15060,26 +15191,26 @@ func (intersystemResourceStatusReply *IntersystemResourceStatusReply) UnmarshalP return nil } -var extIEsIntersystemResourceStatusReply []ap.IESpec[ProtocolIEID, IntersystemResourceStatusReply] +var extIEsIntersystemResourceStatusReply []apimpl.IESpec[ProtocolIEID, IntersystemResourceStatusReply] -func (intersystemResourceStatusReply *IntersystemResourceStatusReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemResourceStatusReply *IntersystemResourceStatusReply) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemResourceStatusReply.Reportingsystem.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, intersystemResourceStatusReply.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemResourceStatusReply, intersystemResourceStatusReply, &intersystemResourceStatusReply.iEExtensions) return notComprehended } func (intersystemResourceStatusReport *IntersystemResourceStatusReport) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, intersystemResourceStatusReport.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, intersystemResourceStatusReport.iEExtensions) w.WriteBit(intersystemResourceStatusReport.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemResourceStatusReport.ReportingSystem.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -15105,7 +15236,7 @@ func (intersystemResourceStatusReport *IntersystemResourceStatusReport) Unmarsha return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, &intersystemResourceStatusReport.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, &intersystemResourceStatusReport.iEExtensions); err != nil { return err } } @@ -15117,19 +15248,19 @@ func (intersystemResourceStatusReport *IntersystemResourceStatusReport) Unmarsha return nil } -var extIEsIntersystemResourceStatusReport []ap.IESpec[ProtocolIEID, IntersystemResourceStatusReport] +var extIEsIntersystemResourceStatusReport []apimpl.IESpec[ProtocolIEID, IntersystemResourceStatusReport] -func (intersystemResourceStatusReport *IntersystemResourceStatusReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemResourceStatusReport *IntersystemResourceStatusReport) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemResourceStatusReport.ReportingSystem.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, intersystemResourceStatusReport.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemResourceStatusReport, intersystemResourceStatusReport, &intersystemResourceStatusReport.iEExtensions) return notComprehended } func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, intersystemResourceStatusRequest.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, intersystemResourceStatusRequest.iEExtensions) w.WriteBit(intersystemResourceStatusRequest.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemResourceStatusRequest.ReportingSystem.MarshalPER(w, enc); err != nil { @@ -15142,7 +15273,7 @@ func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) Marsha return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -15174,7 +15305,7 @@ func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) Unmars return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, &intersystemResourceStatusRequest.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, &intersystemResourceStatusRequest.iEExtensions); err != nil { return err } } @@ -15186,9 +15317,9 @@ func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) Unmars return nil } -var extIEsIntersystemResourceStatusRequest []ap.IESpec[ProtocolIEID, IntersystemResourceStatusRequest] +var extIEsIntersystemResourceStatusRequest []apimpl.IESpec[ProtocolIEID, IntersystemResourceStatusRequest] -func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemResourceStatusRequest.ReportingSystem.Diagnose(d) { notComprehended = true @@ -15196,12 +15327,12 @@ func (intersystemResourceStatusRequest *IntersystemResourceStatusRequest) Diagno if intersystemResourceStatusRequest.ReportType.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, intersystemResourceStatusRequest.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemResourceStatusRequest, intersystemResourceStatusRequest, &intersystemResourceStatusRequest.iEExtensions) return notComprehended } func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer.iEExtensions) w.WriteBit(intersystemSONConfigurationTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemSONConfigurationTransfer.TransferType.MarshalPER(w, enc); err != nil { @@ -15211,7 +15342,7 @@ func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -15240,7 +15371,7 @@ func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, &intersystemSONConfigurationTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, &intersystemSONConfigurationTransfer.iEExtensions); err != nil { return err } } @@ -15252,9 +15383,9 @@ func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) return nil } -var extIEsIntersystemSONConfigurationTransfer []ap.IESpec[ProtocolIEID, IntersystemSONConfigurationTransfer] +var extIEsIntersystemSONConfigurationTransfer []apimpl.IESpec[ProtocolIEID, IntersystemSONConfigurationTransfer] -func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemSONConfigurationTransfer.TransferType.Diagnose(d) { notComprehended = true @@ -15262,7 +15393,7 @@ func (intersystemSONConfigurationTransfer *IntersystemSONConfigurationTransfer) if intersystemSONConfigurationTransfer.IntersystemSONInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemSONConfigurationTransfer, intersystemSONConfigurationTransfer, &intersystemSONConfigurationTransfer.iEExtensions) return notComprehended } @@ -15288,17 +15419,17 @@ func (intersystemSONInformation *IntersystemSONInformation) MarshalPER(w *per.Wr if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemSONInformationRequest, Criticality: intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformation.IntersystemSONInformationRequest}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDIntersystemSONInformationRequest, Criticality: intersystemSONInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: intersystemSONInformation.IntersystemSONInformationRequest}) case intersystemSONInformation.IntersystemSONInformationReply != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemSONInformationReply, Criticality: intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformation.IntersystemSONInformationReply}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDIntersystemSONInformationReply, Criticality: intersystemSONInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: intersystemSONInformation.IntersystemSONInformationReply}) case intersystemSONInformation.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, intersystemSONInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, intersystemSONInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -15319,33 +15450,25 @@ func (intersystemSONInformation *IntersystemSONInformation) UnmarshalPER(r *per. } intersystemSONInformation.IntersystemSONInformationReport = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDIntersystemSONInformationRequest: var v IntersystemSONInformationRequest - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - intersystemSONInformation.ChoiceExtension = &f - break - } intersystemSONInformation.IntersystemSONInformationRequest = &v - intersystemSONInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + intersystemSONInformation.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDIntersystemSONInformationReply: var v IntersystemSONInformationReply - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - intersystemSONInformation.ChoiceExtension = &f - break - } intersystemSONInformation.IntersystemSONInformationReply = &v - intersystemSONInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + intersystemSONInformation.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) default: intersystemSONInformation.ChoiceExtension = &f } @@ -15355,16 +15478,16 @@ func (intersystemSONInformation *IntersystemSONInformation) UnmarshalPER(r *per. return nil } -func (intersystemSONInformation *IntersystemSONInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONInformation *IntersystemSONInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case intersystemSONInformation.IntersystemSONInformationReport != nil: return intersystemSONInformation.IntersystemSONInformationReport.Diagnose(d) case intersystemSONInformation.IntersystemSONInformationRequest != nil: - d.IE(IDIntersystemSONInformationRequest, intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformation.IntersystemSONInformationRequest) + return apimpl.DiagnoseChoiceExtension(d, IDIntersystemSONInformationRequest, intersystemSONInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), &intersystemSONInformation.IntersystemSONInformationRequest, &intersystemSONInformation.ChoiceExtension) case intersystemSONInformation.IntersystemSONInformationReply != nil: - d.IE(IDIntersystemSONInformationReply, intersystemSONInformation.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformation.IntersystemSONInformationReply) + return apimpl.DiagnoseChoiceExtension(d, IDIntersystemSONInformationReply, intersystemSONInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), &intersystemSONInformation.IntersystemSONInformationReply, &intersystemSONInformation.ChoiceExtension) case intersystemSONInformation.ChoiceExtension != nil: - d.Unknown(intersystemSONInformation.ChoiceExtension.ID, intersystemSONInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, intersystemSONInformation.ChoiceExtension) } return false } @@ -15398,7 +15521,7 @@ func (intersystemSONInformationReply *IntersystemSONInformationReply) MarshalPER if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, intersystemSONInformationReply.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, intersystemSONInformationReply.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -15425,7 +15548,7 @@ func (intersystemSONInformationReply *IntersystemSONInformationReply) UnmarshalP } intersystemSONInformationReply.ResourceStatus = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -15439,14 +15562,14 @@ func (intersystemSONInformationReply *IntersystemSONInformationReply) UnmarshalP return nil } -func (intersystemSONInformationReply *IntersystemSONInformationReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONInformationReply *IntersystemSONInformationReply) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case intersystemSONInformationReply.NGRANCellActivation != nil: return intersystemSONInformationReply.NGRANCellActivation.Diagnose(d) case intersystemSONInformationReply.ResourceStatus != nil: return intersystemSONInformationReply.ResourceStatus.Diagnose(d) case intersystemSONInformationReply.ChoiceExtension != nil: - d.Unknown(intersystemSONInformationReply.ChoiceExtension.ID, intersystemSONInformationReply.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, intersystemSONInformationReply.ChoiceExtension) } return false } @@ -15480,17 +15603,17 @@ func (intersystemSONInformationReport *IntersystemSONInformationReport) MarshalP if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDEnergySavingIndication, Criticality: intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformationReport.EnergySavingIndication}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDEnergySavingIndication, Criticality: intersystemSONInformationReport.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: intersystemSONInformationReport.EnergySavingIndication}) case intersystemSONInformationReport.IntersystemResourceStatusUpdate != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDIntersystemResourceStatusUpdate, Criticality: intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), Value: intersystemSONInformationReport.IntersystemResourceStatusUpdate}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDIntersystemResourceStatusUpdate, Criticality: intersystemSONInformationReport.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: intersystemSONInformationReport.IntersystemResourceStatusUpdate}) case intersystemSONInformationReport.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, intersystemSONInformationReport.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, intersystemSONInformationReport.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -15517,33 +15640,25 @@ func (intersystemSONInformationReport *IntersystemSONInformationReport) Unmarsha } intersystemSONInformationReport.FailureIndicationInformation = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDEnergySavingIndication: var v IntersystemCellStateIndication - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - intersystemSONInformationReport.ChoiceExtension = &f - break - } intersystemSONInformationReport.EnergySavingIndication = &v - intersystemSONInformationReport.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + intersystemSONInformationReport.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDIntersystemResourceStatusUpdate: var v IntersystemResourceStatusReport - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - intersystemSONInformationReport.ChoiceExtension = &f - break - } intersystemSONInformationReport.IntersystemResourceStatusUpdate = &v - intersystemSONInformationReport.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + intersystemSONInformationReport.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) default: intersystemSONInformationReport.ChoiceExtension = &f } @@ -15553,18 +15668,18 @@ func (intersystemSONInformationReport *IntersystemSONInformationReport) Unmarsha return nil } -func (intersystemSONInformationReport *IntersystemSONInformationReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONInformationReport *IntersystemSONInformationReport) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case intersystemSONInformationReport.HOReportInformation != nil: return intersystemSONInformationReport.HOReportInformation.Diagnose(d) case intersystemSONInformationReport.FailureIndicationInformation != nil: return intersystemSONInformationReport.FailureIndicationInformation.Diagnose(d) case intersystemSONInformationReport.EnergySavingIndication != nil: - d.IE(IDEnergySavingIndication, intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformationReport.EnergySavingIndication) + return apimpl.DiagnoseChoiceExtension(d, IDEnergySavingIndication, intersystemSONInformationReport.choiceCriticality.Of(apimpl.CriticalityIgnore), &intersystemSONInformationReport.EnergySavingIndication, &intersystemSONInformationReport.ChoiceExtension) case intersystemSONInformationReport.IntersystemResourceStatusUpdate != nil: - d.IE(IDIntersystemResourceStatusUpdate, intersystemSONInformationReport.choiceCriticality.Of(ap.CriticalityIgnore), intersystemSONInformationReport.IntersystemResourceStatusUpdate) + return apimpl.DiagnoseChoiceExtension(d, IDIntersystemResourceStatusUpdate, intersystemSONInformationReport.choiceCriticality.Of(apimpl.CriticalityIgnore), &intersystemSONInformationReport.IntersystemResourceStatusUpdate, &intersystemSONInformationReport.ChoiceExtension) case intersystemSONInformationReport.ChoiceExtension != nil: - d.Unknown(intersystemSONInformationReport.ChoiceExtension.ID, intersystemSONInformationReport.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, intersystemSONInformationReport.ChoiceExtension) } return false } @@ -15598,7 +15713,7 @@ func (intersystemSONInformationRequest *IntersystemSONInformationRequest) Marsha if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, intersystemSONInformationRequest.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, intersystemSONInformationRequest.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -15625,7 +15740,7 @@ func (intersystemSONInformationRequest *IntersystemSONInformationRequest) Unmars } intersystemSONInformationRequest.ResourceStatus = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -15639,20 +15754,20 @@ func (intersystemSONInformationRequest *IntersystemSONInformationRequest) Unmars return nil } -func (intersystemSONInformationRequest *IntersystemSONInformationRequest) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONInformationRequest *IntersystemSONInformationRequest) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case intersystemSONInformationRequest.NGRANCellActivation != nil: return intersystemSONInformationRequest.NGRANCellActivation.Diagnose(d) case intersystemSONInformationRequest.ResourceStatus != nil: return intersystemSONInformationRequest.ResourceStatus.Diagnose(d) case intersystemSONInformationRequest.ChoiceExtension != nil: - d.Unknown(intersystemSONInformationRequest.ChoiceExtension.ID, intersystemSONInformationRequest.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, intersystemSONInformationRequest.ChoiceExtension) } return false } func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, intersystemSONNGRANnodeID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, intersystemSONNGRANnodeID.iEExtensions) w.WriteBit(intersystemSONNGRANnodeID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemSONNGRANnodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { @@ -15662,7 +15777,7 @@ func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -15691,7 +15806,7 @@ func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, &intersystemSONNGRANnodeID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, &intersystemSONNGRANnodeID.iEExtensions); err != nil { return err } } @@ -15703,9 +15818,9 @@ func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) UnmarshalPER(r *per. return nil } -var extIEsIntersystemSONNGRANnodeID []ap.IESpec[ProtocolIEID, IntersystemSONNGRANnodeID] +var extIEsIntersystemSONNGRANnodeID []apimpl.IESpec[ProtocolIEID, IntersystemSONNGRANnodeID] -func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemSONNGRANnodeID.GlobalRANNodeID.Diagnose(d) { notComprehended = true @@ -15713,7 +15828,7 @@ func (intersystemSONNGRANnodeID *IntersystemSONNGRANnodeID) Diagnose(d *ap.Diagn if intersystemSONNGRANnodeID.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, intersystemSONNGRANnodeID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemSONNGRANnodeID, intersystemSONNGRANnodeID, &intersystemSONNGRANnodeID.iEExtensions) return notComprehended } @@ -15746,7 +15861,7 @@ func (intersystemSONTransferType *IntersystemSONTransferType) MarshalPER(w *per. if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, intersystemSONTransferType.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, intersystemSONTransferType.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -15773,7 +15888,7 @@ func (intersystemSONTransferType *IntersystemSONTransferType) UnmarshalPER(r *pe } intersystemSONTransferType.FromNGRANtoEUTRAN = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -15787,20 +15902,20 @@ func (intersystemSONTransferType *IntersystemSONTransferType) UnmarshalPER(r *pe return nil } -func (intersystemSONTransferType *IntersystemSONTransferType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONTransferType *IntersystemSONTransferType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case intersystemSONTransferType.FromEUTRANtoNGRAN != nil: return intersystemSONTransferType.FromEUTRANtoNGRAN.Diagnose(d) case intersystemSONTransferType.FromNGRANtoEUTRAN != nil: return intersystemSONTransferType.FromNGRANtoEUTRAN.Diagnose(d) case intersystemSONTransferType.ChoiceExtension != nil: - d.Unknown(intersystemSONTransferType.ChoiceExtension.ID, intersystemSONTransferType.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, intersystemSONTransferType.ChoiceExtension) } return false } func (intersystemSONeNBID *IntersystemSONeNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemSONeNBID, intersystemSONeNBID, intersystemSONeNBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemSONeNBID, intersystemSONeNBID, intersystemSONeNBID.iEExtensions) w.WriteBit(intersystemSONeNBID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemSONeNBID.GlobaleNBID.MarshalPER(w, enc); err != nil { @@ -15810,7 +15925,7 @@ func (intersystemSONeNBID *IntersystemSONeNBID) MarshalPER(w *per.Writer, enc pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -15839,7 +15954,7 @@ func (intersystemSONeNBID *IntersystemSONeNBID) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONeNBID, intersystemSONeNBID, &intersystemSONeNBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemSONeNBID, intersystemSONeNBID, &intersystemSONeNBID.iEExtensions); err != nil { return err } } @@ -15851,9 +15966,9 @@ func (intersystemSONeNBID *IntersystemSONeNBID) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsIntersystemSONeNBID []ap.IESpec[ProtocolIEID, IntersystemSONeNBID] +var extIEsIntersystemSONeNBID []apimpl.IESpec[ProtocolIEID, IntersystemSONeNBID] -func (intersystemSONeNBID *IntersystemSONeNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemSONeNBID *IntersystemSONeNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemSONeNBID.GlobaleNBID.Diagnose(d) { notComprehended = true @@ -15861,12 +15976,12 @@ func (intersystemSONeNBID *IntersystemSONeNBID) Diagnose(d *ap.Diagnosis[Protoco if intersystemSONeNBID.SelectedEPSTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemSONeNBID, intersystemSONeNBID, intersystemSONeNBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemSONeNBID, intersystemSONeNBID, &intersystemSONeNBID.iEExtensions) return notComprehended } func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, intersystemUnnecessaryHO.iEExtensions) + ext := apimpl.ExtensionFields(extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, intersystemUnnecessaryHO.iEExtensions) w.WriteBit(intersystemUnnecessaryHO.extensions.Present()) w.WriteBit(len(ext) > 0) if err := intersystemUnnecessaryHO.SourcecellID.MarshalPER(w, enc); err != nil { @@ -15882,7 +15997,7 @@ func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -15917,7 +16032,7 @@ func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, &intersystemUnnecessaryHO.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, &intersystemUnnecessaryHO.iEExtensions); err != nil { return err } } @@ -15929,9 +16044,9 @@ func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) UnmarshalPER(r *per.Re return nil } -var extIEsIntersystemUnnecessaryHO []ap.IESpec[ProtocolIEID, IntersystemUnnecessaryHO] +var extIEsIntersystemUnnecessaryHO []apimpl.IESpec[ProtocolIEID, IntersystemUnnecessaryHO] -func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if intersystemUnnecessaryHO.SourcecellID.Diagnose(d) { notComprehended = true @@ -15945,7 +16060,7 @@ func (intersystemUnnecessaryHO *IntersystemUnnecessaryHO) Diagnose(d *ap.Diagnos if intersystemUnnecessaryHO.CandidateCellList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, intersystemUnnecessaryHO.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsIntersystemUnnecessaryHO, intersystemUnnecessaryHO, &intersystemUnnecessaryHO.iEExtensions) return notComprehended } @@ -15966,12 +16081,12 @@ func (intersystemUnnecessaryHOEarlyIRATHO IntersystemUnnecessaryHOEarlyIRATHO) N return enumIntersystemUnnecessaryHOEarlyIRATHO.Name(intersystemUnnecessaryHOEarlyIRATHO) } -func (intersystemUnnecessaryHOEarlyIRATHO IntersystemUnnecessaryHOEarlyIRATHO) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (intersystemUnnecessaryHOEarlyIRATHO IntersystemUnnecessaryHOEarlyIRATHO) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumIntersystemUnnecessaryHOEarlyIRATHO.Known(intersystemUnnecessaryHOEarlyIRATHO) } func (lAI *LAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLAI, lAI, lAI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLAI, lAI, lAI.iEExtensions) w.WriteBit(lAI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := lAI.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -15981,7 +16096,7 @@ func (lAI *LAI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16010,7 +16125,7 @@ func (lAI *LAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLAI, lAI, &lAI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLAI, lAI, &lAI.iEExtensions); err != nil { return err } } @@ -16022,11 +16137,11 @@ func (lAI *LAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsLAI []ap.IESpec[ProtocolIEID, LAI] +var extIEsLAI []apimpl.IESpec[ProtocolIEID, LAI] -func (lAI *LAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lAI *LAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsLAI, lAI, lAI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLAI, lAI, &lAI.iEExtensions) return notComprehended } @@ -16047,19 +16162,19 @@ func (lPWUSDisableIndication LPWUSDisableIndication) Name() string { return enumLPWUSDisableIndication.Name(lPWUSDisableIndication) } -func (lPWUSDisableIndication LPWUSDisableIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (lPWUSDisableIndication LPWUSDisableIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLPWUSDisableIndication.Known(lPWUSDisableIndication) } func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation.iEExtensions) w.WriteBit(lPWUSPSAssistanceInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := lPWUSPSAssistanceInformation.LPWUScNsubgroupID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16085,7 +16200,7 @@ func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, &lPWUSPSAssistanceInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, &lPWUSPSAssistanceInformation.iEExtensions); err != nil { return err } } @@ -16097,19 +16212,19 @@ func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) UnmarshalPER(r return nil } -var extIEsLPWUSPSAssistanceInformation []ap.IESpec[ProtocolIEID, LPWUSPSAssistanceInformation] +var extIEsLPWUSPSAssistanceInformation []apimpl.IESpec[ProtocolIEID, LPWUSPSAssistanceInformation] -func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lPWUSPSAssistanceInformation *LPWUSPSAssistanceInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if lPWUSPSAssistanceInformation.LPWUScNsubgroupID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLPWUSPSAssistanceInformation, lPWUSPSAssistanceInformation, &lPWUSPSAssistanceInformation.iEExtensions) return notComprehended } func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, lTEA2XServicesAuthorized.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, lTEA2XServicesAuthorized.iEExtensions) w.WriteBit(lTEA2XServicesAuthorized.extensions.Present()) w.WriteBit(lTEA2XServicesAuthorized.AerialUE != nil) w.WriteBit(lTEA2XServicesAuthorized.AerialControllerUE != nil) @@ -16125,7 +16240,7 @@ func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16170,7 +16285,7 @@ func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) UnmarshalPER(r *per.Re lTEA2XServicesAuthorized.AerialControllerUE = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, &lTEA2XServicesAuthorized.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, &lTEA2XServicesAuthorized.iEExtensions); err != nil { return err } } @@ -16182,9 +16297,9 @@ func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) UnmarshalPER(r *per.Re return nil } -var extIEsLTEA2XServicesAuthorized []ap.IESpec[ProtocolIEID, LTEA2XServicesAuthorized] +var extIEsLTEA2XServicesAuthorized []apimpl.IESpec[ProtocolIEID, LTEA2XServicesAuthorized] -func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if lTEA2XServicesAuthorized.AerialUE != nil && lTEA2XServicesAuthorized.AerialUE.Diagnose(d) { notComprehended = true @@ -16192,7 +16307,7 @@ func (lTEA2XServicesAuthorized *LTEA2XServicesAuthorized) Diagnose(d *ap.Diagnos if lTEA2XServicesAuthorized.AerialControllerUE != nil && lTEA2XServicesAuthorized.AerialControllerUE.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, lTEA2XServicesAuthorized.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLTEA2XServicesAuthorized, lTEA2XServicesAuthorized, &lTEA2XServicesAuthorized.iEExtensions) return notComprehended } @@ -16213,7 +16328,7 @@ func (lTEA2XServicesAuthorizedAerialControllerUE LTEA2XServicesAuthorizedAerialC return enumLTEA2XServicesAuthorizedAerialControllerUE.Name(lTEA2XServicesAuthorizedAerialControllerUE) } -func (lTEA2XServicesAuthorizedAerialControllerUE LTEA2XServicesAuthorizedAerialControllerUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (lTEA2XServicesAuthorizedAerialControllerUE LTEA2XServicesAuthorizedAerialControllerUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLTEA2XServicesAuthorizedAerialControllerUE.Known(lTEA2XServicesAuthorizedAerialControllerUE) } @@ -16234,7 +16349,7 @@ func (lTEA2XServicesAuthorizedAerialUE LTEA2XServicesAuthorizedAerialUE) Name() return enumLTEA2XServicesAuthorizedAerialUE.Name(lTEA2XServicesAuthorizedAerialUE) } -func (lTEA2XServicesAuthorizedAerialUE LTEA2XServicesAuthorizedAerialUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (lTEA2XServicesAuthorizedAerialUE LTEA2XServicesAuthorizedAerialUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLTEA2XServicesAuthorizedAerialUE.Known(lTEA2XServicesAuthorizedAerialUE) } @@ -16255,19 +16370,19 @@ func (lTEMIndication LTEMIndication) Name() string { return enumLTEMIndication.Name(lTEMIndication) } -func (lTEMIndication LTEMIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (lTEMIndication LTEMIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLTEMIndication.Known(lTEMIndication) } func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate.iEExtensions) w.WriteBit(lTEUESidelinkAggregateMaximumBitrate.extensions.Present()) w.WriteBit(len(ext) > 0) if err := lTEUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16293,7 +16408,7 @@ func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, &lTEUESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, &lTEUESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { return err } } @@ -16305,19 +16420,19 @@ func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate return nil } -var extIEsLTEUESidelinkAggregateMaximumBitrate []ap.IESpec[ProtocolIEID, LTEUESidelinkAggregateMaximumBitrate] +var extIEsLTEUESidelinkAggregateMaximumBitrate []apimpl.IESpec[ProtocolIEID, LTEUESidelinkAggregateMaximumBitrate] -func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lTEUESidelinkAggregateMaximumBitrate *LTEUESidelinkAggregateMaximumBitrate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if lTEUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLTEUESidelinkAggregateMaximumBitrate, lTEUESidelinkAggregateMaximumBitrate, &lTEUESidelinkAggregateMaximumBitrate.iEExtensions) return notComprehended } func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, lTEV2XServicesAuthorized.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, lTEV2XServicesAuthorized.iEExtensions) w.WriteBit(lTEV2XServicesAuthorized.extensions.Present()) w.WriteBit(lTEV2XServicesAuthorized.VehicleUE != nil) w.WriteBit(lTEV2XServicesAuthorized.PedestrianUE != nil) @@ -16333,7 +16448,7 @@ func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16378,7 +16493,7 @@ func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) UnmarshalPER(r *per.Re lTEV2XServicesAuthorized.PedestrianUE = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, &lTEV2XServicesAuthorized.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, &lTEV2XServicesAuthorized.iEExtensions); err != nil { return err } } @@ -16390,9 +16505,9 @@ func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) UnmarshalPER(r *per.Re return nil } -var extIEsLTEV2XServicesAuthorized []ap.IESpec[ProtocolIEID, LTEV2XServicesAuthorized] +var extIEsLTEV2XServicesAuthorized []apimpl.IESpec[ProtocolIEID, LTEV2XServicesAuthorized] -func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if lTEV2XServicesAuthorized.VehicleUE != nil && lTEV2XServicesAuthorized.VehicleUE.Diagnose(d) { notComprehended = true @@ -16400,7 +16515,7 @@ func (lTEV2XServicesAuthorized *LTEV2XServicesAuthorized) Diagnose(d *ap.Diagnos if lTEV2XServicesAuthorized.PedestrianUE != nil && lTEV2XServicesAuthorized.PedestrianUE.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, lTEV2XServicesAuthorized.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLTEV2XServicesAuthorized, lTEV2XServicesAuthorized, &lTEV2XServicesAuthorized.iEExtensions) return notComprehended } @@ -16447,7 +16562,7 @@ func (lastVisitedCellInformation *LastVisitedCellInformation) MarshalPER(w *per. if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, lastVisitedCellInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, lastVisitedCellInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -16486,7 +16601,7 @@ func (lastVisitedCellInformation *LastVisitedCellInformation) UnmarshalPER(r *pe } lastVisitedCellInformation.GERANCell = &v case 4: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -16500,7 +16615,7 @@ func (lastVisitedCellInformation *LastVisitedCellInformation) UnmarshalPER(r *pe return nil } -func (lastVisitedCellInformation *LastVisitedCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lastVisitedCellInformation *LastVisitedCellInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case lastVisitedCellInformation.NGRANCell != nil: return lastVisitedCellInformation.NGRANCell.Diagnose(d) @@ -16508,20 +16623,20 @@ func (lastVisitedCellInformation *LastVisitedCellInformation) Diagnose(d *ap.Dia case lastVisitedCellInformation.UTRANCell != nil: case lastVisitedCellInformation.GERANCell != nil: case lastVisitedCellInformation.ChoiceExtension != nil: - d.Unknown(lastVisitedCellInformation.ChoiceExtension.ID, lastVisitedCellInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, lastVisitedCellInformation.ChoiceExtension) } return false } func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLastVisitedCellItem, lastVisitedCellItem, lastVisitedCellItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLastVisitedCellItem, lastVisitedCellItem, lastVisitedCellItem.iEExtensions) w.WriteBit(lastVisitedCellItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := lastVisitedCellItem.LastVisitedCellInformation.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16547,7 +16662,7 @@ func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedCellItem, lastVisitedCellItem, &lastVisitedCellItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedCellItem, lastVisitedCellItem, &lastVisitedCellItem.iEExtensions); err != nil { return err } } @@ -16559,19 +16674,19 @@ func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsLastVisitedCellItem []ap.IESpec[ProtocolIEID, LastVisitedCellItem] +var extIEsLastVisitedCellItem []apimpl.IESpec[ProtocolIEID, LastVisitedCellItem] -func (lastVisitedCellItem *LastVisitedCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lastVisitedCellItem *LastVisitedCellItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if lastVisitedCellItem.LastVisitedCellInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLastVisitedCellItem, lastVisitedCellItem, lastVisitedCellItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLastVisitedCellItem, lastVisitedCellItem, &lastVisitedCellItem.iEExtensions) return notComprehended } func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation.iEExtensions) w.WriteBit(lastVisitedNGRANCellInformation.extensions.Present()) w.WriteBit(lastVisitedNGRANCellInformation.TimeUEStayedInCellEnhancedGranularity != nil) w.WriteBit(lastVisitedNGRANCellInformation.HOCauseValue != nil) @@ -16596,7 +16711,7 @@ func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) MarshalP } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16650,7 +16765,7 @@ func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) Unmarsha lastVisitedNGRANCellInformation.HOCauseValue = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, &lastVisitedNGRANCellInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, &lastVisitedNGRANCellInformation.iEExtensions); err != nil { return err } } @@ -16662,11 +16777,11 @@ func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) Unmarsha return nil } -var extIEsLastVisitedNGRANCellInformation = []ap.IESpec[ProtocolIEID, LastVisitedNGRANCellInformation]{ +var extIEsLastVisitedNGRANCellInformation = []apimpl.IESpec[ProtocolIEID, LastVisitedNGRANCellInformation]{ { ID: IDLastVisitedPSCellList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *LastVisitedNGRANCellInformation, r *per.Reader, enc per.Encoding) error { var v LastVisitedPSCellList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -16681,10 +16796,13 @@ var extIEsLastVisitedNGRANCellInformation = []ap.IESpec[ProtocolIEID, LastVisite } return x.LastVisitedPSCellList, true }, + Clear: func(x *LastVisitedNGRANCellInformation) { + x.LastVisitedPSCellList = nil + }, }, } -func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if lastVisitedNGRANCellInformation.GlobalCellID.Diagnose(d) { notComprehended = true @@ -16695,12 +16813,12 @@ func (lastVisitedNGRANCellInformation *LastVisitedNGRANCellInformation) Diagnose if lastVisitedNGRANCellInformation.HOCauseValue != nil && lastVisitedNGRANCellInformation.HOCauseValue.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLastVisitedNGRANCellInformation, lastVisitedNGRANCellInformation, &lastVisitedNGRANCellInformation.iEExtensions) return notComprehended } func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) w.WriteBit(lastVisitedPSCellInformation.extensions.Present()) w.WriteBit(lastVisitedPSCellInformation.PSCellID != nil) w.WriteBit(len(ext) > 0) @@ -16713,7 +16831,7 @@ func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16750,7 +16868,7 @@ func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions); err != nil { return err } } @@ -16762,11 +16880,11 @@ func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) UnmarshalPER(r return nil } -var extIEsLastVisitedPSCellInformation = []ap.IESpec[ProtocolIEID, LastVisitedPSCellInformation]{ +var extIEsLastVisitedPSCellInformation = []apimpl.IESpec[ProtocolIEID, LastVisitedPSCellInformation]{ { ID: IDSCGActivationTime, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *LastVisitedPSCellInformation, r *per.Reader, enc per.Encoding) error { var v SCGActivationTime if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -16781,15 +16899,18 @@ var extIEsLastVisitedPSCellInformation = []ap.IESpec[ProtocolIEID, LastVisitedPS } return x.SCGActivationTime, true }, + Clear: func(x *LastVisitedPSCellInformation) { + x.SCGActivationTime = nil + }, }, } -func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if lastVisitedPSCellInformation.PSCellID != nil && lastVisitedPSCellInformation.PSCellID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions) return notComprehended } @@ -16810,7 +16931,7 @@ func (lineType LineType) Name() string { return enumLineType.Name(lineType) } -func (lineType LineType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (lineType LineType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLineType.Known(lineType) } @@ -16831,7 +16952,7 @@ func (linkstolog Linkstolog) Name() string { return enumLinkstolog.Name(linkstolog) } -func (linkstolog Linkstolog) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (linkstolog Linkstolog) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLinkstolog.Known(linkstolog) } @@ -16852,12 +16973,12 @@ func (locationReportingAdditionalInfo LocationReportingAdditionalInfo) Name() st return enumLocationReportingAdditionalInfo.Name(locationReportingAdditionalInfo) } -func (locationReportingAdditionalInfo LocationReportingAdditionalInfo) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (locationReportingAdditionalInfo LocationReportingAdditionalInfo) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLocationReportingAdditionalInfo.Known(locationReportingAdditionalInfo) } func (locationReportingRequestType *LocationReportingRequestType) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLocationReportingRequestType, locationReportingRequestType, locationReportingRequestType.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLocationReportingRequestType, locationReportingRequestType, locationReportingRequestType.iEExtensions) w.WriteBit(locationReportingRequestType.extensions.Present()) w.WriteBit(locationReportingRequestType.AreaOfInterestList != nil) w.WriteBit(locationReportingRequestType.LocationReportingReferenceIDToBeCancelled != nil) @@ -16879,7 +17000,7 @@ func (locationReportingRequestType *LocationReportingRequestType) MarshalPER(w * } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -16928,7 +17049,7 @@ func (locationReportingRequestType *LocationReportingRequestType) UnmarshalPER(r locationReportingRequestType.LocationReportingReferenceIDToBeCancelled = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLocationReportingRequestType, locationReportingRequestType, &locationReportingRequestType.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLocationReportingRequestType, locationReportingRequestType, &locationReportingRequestType.iEExtensions); err != nil { return err } } @@ -16940,11 +17061,11 @@ func (locationReportingRequestType *LocationReportingRequestType) UnmarshalPER(r return nil } -var extIEsLocationReportingRequestType = []ap.IESpec[ProtocolIEID, LocationReportingRequestType]{ +var extIEsLocationReportingRequestType = []apimpl.IESpec[ProtocolIEID, LocationReportingRequestType]{ { ID: IDLocationReportingAdditionalInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *LocationReportingRequestType, r *per.Reader, enc per.Encoding) error { var v LocationReportingAdditionalInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -16959,11 +17080,14 @@ var extIEsLocationReportingRequestType = []ap.IESpec[ProtocolIEID, LocationRepor } return x.LocationReportingAdditionalInfo, true }, + Clear: func(x *LocationReportingRequestType) { + x.LocationReportingAdditionalInfo = nil + }, }, { ID: IDAdditionalCancelledlocationReportingReferenceIDList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *LocationReportingRequestType, r *per.Reader, enc per.Encoding) error { var v AdditionalCancelledlocationReportingReferenceIDList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -16978,11 +17102,14 @@ var extIEsLocationReportingRequestType = []ap.IESpec[ProtocolIEID, LocationRepor } return x.AdditionalCancelledlocationReportingReferenceIDList, true }, + Clear: func(x *LocationReportingRequestType) { + x.AdditionalCancelledlocationReportingReferenceIDList = nil + }, }, { ID: IDAerialUEFlightInformationReportingControlList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *LocationReportingRequestType, r *per.Reader, enc per.Encoding) error { var v AerialUEFlightInformationReportingControlList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -16997,10 +17124,13 @@ var extIEsLocationReportingRequestType = []ap.IESpec[ProtocolIEID, LocationRepor } return x.AerialUEFlightInformationReportingControlList, true }, + Clear: func(x *LocationReportingRequestType) { + x.AerialUEFlightInformationReportingControlList = nil + }, }, } -func (locationReportingRequestType *LocationReportingRequestType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (locationReportingRequestType *LocationReportingRequestType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if locationReportingRequestType.EventType.Diagnose(d) { notComprehended = true @@ -17014,12 +17144,12 @@ func (locationReportingRequestType *LocationReportingRequestType) Diagnose(d *ap if locationReportingRequestType.LocationReportingReferenceIDToBeCancelled != nil && locationReportingRequestType.LocationReportingReferenceIDToBeCancelled.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLocationReportingRequestType, locationReportingRequestType, locationReportingRequestType.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLocationReportingRequestType, locationReportingRequestType, &locationReportingRequestType.iEExtensions) return notComprehended } func (loggedMDTNr *LoggedMDTNr) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLoggedMDTNr, loggedMDTNr, loggedMDTNr.iEExtensions) + ext := apimpl.ExtensionFields(extIEsLoggedMDTNr, loggedMDTNr, loggedMDTNr.iEExtensions) w.WriteBit(loggedMDTNr.extensions.Present()) w.WriteBit(loggedMDTNr.BluetoothMeasurementConfiguration != nil) w.WriteBit(loggedMDTNr.WLANMeasurementConfiguration != nil) @@ -17056,7 +17186,7 @@ func (loggedMDTNr *LoggedMDTNr) MarshalPER(w *per.Writer, enc per.Encoding) erro } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -17130,7 +17260,7 @@ func (loggedMDTNr *LoggedMDTNr) UnmarshalPER(r *per.Reader, enc per.Encoding) er } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLoggedMDTNr, loggedMDTNr, &loggedMDTNr.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLoggedMDTNr, loggedMDTNr, &loggedMDTNr.iEExtensions); err != nil { return err } } @@ -17142,11 +17272,11 @@ func (loggedMDTNr *LoggedMDTNr) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsLoggedMDTNr = []ap.IESpec[ProtocolIEID, LoggedMDTNr]{ +var extIEsLoggedMDTNr = []apimpl.IESpec[ProtocolIEID, LoggedMDTNr]{ { ID: IDEarlyMeasurement, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *LoggedMDTNr, r *per.Reader, enc per.Encoding) error { var v EarlyMeasurement if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -17161,10 +17291,13 @@ var extIEsLoggedMDTNr = []ap.IESpec[ProtocolIEID, LoggedMDTNr]{ } return x.EarlyMeasurement, true }, + Clear: func(x *LoggedMDTNr) { + x.EarlyMeasurement = nil + }, }, } -func (loggedMDTNr *LoggedMDTNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (loggedMDTNr *LoggedMDTNr) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if loggedMDTNr.LoggingInterval.Diagnose(d) { notComprehended = true @@ -17187,7 +17320,7 @@ func (loggedMDTNr *LoggedMDTNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { if loggedMDTNr.AreaScopeOfNeighCellsList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLoggedMDTNr, loggedMDTNr, loggedMDTNr.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsLoggedMDTNr, loggedMDTNr, &loggedMDTNr.iEExtensions) return notComprehended } @@ -17220,7 +17353,7 @@ func (loggedMDTTrigger *LoggedMDTTrigger) MarshalPER(w *per.Writer, enc per.Enco if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, loggedMDTTrigger.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, loggedMDTTrigger.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -17247,7 +17380,7 @@ func (loggedMDTTrigger *LoggedMDTTrigger) UnmarshalPER(r *per.Reader, enc per.En } loggedMDTTrigger.EventTrigger = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -17261,13 +17394,13 @@ func (loggedMDTTrigger *LoggedMDTTrigger) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (loggedMDTTrigger *LoggedMDTTrigger) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (loggedMDTTrigger *LoggedMDTTrigger) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case loggedMDTTrigger.Periodical != nil: case loggedMDTTrigger.EventTrigger != nil: return loggedMDTTrigger.EventTrigger.Diagnose(d) case loggedMDTTrigger.ChoiceExtension != nil: - d.Unknown(loggedMDTTrigger.ChoiceExtension.ID, loggedMDTTrigger.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, loggedMDTTrigger.ChoiceExtension) } return false } @@ -17289,7 +17422,7 @@ func (loggingDuration LoggingDuration) Name() string { return enumLoggingDuration.Name(loggingDuration) } -func (loggingDuration LoggingDuration) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (loggingDuration LoggingDuration) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLoggingDuration.Known(loggingDuration) } @@ -17310,12 +17443,12 @@ func (loggingInterval LoggingInterval) Name() string { return enumLoggingInterval.Name(loggingInterval) } -func (loggingInterval LoggingInterval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (loggingInterval LoggingInterval) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumLoggingInterval.Known(loggingInterval) } func (m1Configuration *M1Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsM1Configuration, m1Configuration, m1Configuration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsM1Configuration, m1Configuration, m1Configuration.iEExtensions) w.WriteBit(m1Configuration.extensions.Present()) w.WriteBit(m1Configuration.M1thresholdEventA2 != nil) w.WriteBit(m1Configuration.M1periodicReporting != nil) @@ -17334,7 +17467,7 @@ func (m1Configuration *M1Configuration) MarshalPER(w *per.Writer, enc per.Encodi } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -17382,7 +17515,7 @@ func (m1Configuration *M1Configuration) UnmarshalPER(r *per.Reader, enc per.Enco m1Configuration.M1periodicReporting = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM1Configuration, m1Configuration, &m1Configuration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsM1Configuration, m1Configuration, &m1Configuration.iEExtensions); err != nil { return err } } @@ -17394,11 +17527,11 @@ func (m1Configuration *M1Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsM1Configuration = []ap.IESpec[ProtocolIEID, M1Configuration]{ +var extIEsM1Configuration = []apimpl.IESpec[ProtocolIEID, M1Configuration]{ { ID: IDIncludeBeamMeasurementsIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *M1Configuration, r *per.Reader, enc per.Encoding) error { var v IncludeBeamMeasurementsIndication if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -17413,11 +17546,14 @@ var extIEsM1Configuration = []ap.IESpec[ProtocolIEID, M1Configuration]{ } return x.IncludeBeamMeasurementsIndication, true }, + Clear: func(x *M1Configuration) { + x.IncludeBeamMeasurementsIndication = nil + }, }, { ID: IDBeamMeasurementsReportConfiguration, - Presence: ap.PresenceConditional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceConditional, + Criticality: apimpl.CriticalityIgnore, Condition: m1IncludesBeamMeasurements, Decode: func(x *M1Configuration, r *per.Reader, enc per.Encoding) error { var v BeamMeasurementsReportConfiguration @@ -17433,10 +17569,13 @@ var extIEsM1Configuration = []ap.IESpec[ProtocolIEID, M1Configuration]{ } return x.BeamMeasurementsReportConfiguration, true }, + Clear: func(x *M1Configuration) { + x.BeamMeasurementsReportConfiguration = nil + }, }, } -func (m1Configuration *M1Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m1Configuration *M1Configuration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if m1Configuration.M1reportingTrigger.Diagnose(d) { notComprehended = true @@ -17447,12 +17586,12 @@ func (m1Configuration *M1Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if m1Configuration.M1periodicReporting != nil && m1Configuration.M1periodicReporting.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsM1Configuration, m1Configuration, m1Configuration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsM1Configuration, m1Configuration, &m1Configuration.iEExtensions) return notComprehended } func (m1PeriodicReporting *M1PeriodicReporting) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsM1PeriodicReporting, m1PeriodicReporting, m1PeriodicReporting.iEExtensions) + ext := apimpl.ExtensionFields(extIEsM1PeriodicReporting, m1PeriodicReporting, m1PeriodicReporting.iEExtensions) w.WriteBit(m1PeriodicReporting.extensions.Present()) w.WriteBit(len(ext) > 0) if err := m1PeriodicReporting.ReportInterval.MarshalPER(w, enc); err != nil { @@ -17462,7 +17601,7 @@ func (m1PeriodicReporting *M1PeriodicReporting) MarshalPER(w *per.Writer, enc pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -17491,7 +17630,7 @@ func (m1PeriodicReporting *M1PeriodicReporting) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM1PeriodicReporting, m1PeriodicReporting, &m1PeriodicReporting.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsM1PeriodicReporting, m1PeriodicReporting, &m1PeriodicReporting.iEExtensions); err != nil { return err } } @@ -17503,11 +17642,11 @@ func (m1PeriodicReporting *M1PeriodicReporting) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsM1PeriodicReporting = []ap.IESpec[ProtocolIEID, M1PeriodicReporting]{ +var extIEsM1PeriodicReporting = []apimpl.IESpec[ProtocolIEID, M1PeriodicReporting]{ { ID: IDExtendedReportIntervalMDT, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *M1PeriodicReporting, r *per.Reader, enc per.Encoding) error { var v ExtendedReportIntervalMDT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -17522,12 +17661,15 @@ var extIEsM1PeriodicReporting = []ap.IESpec[ProtocolIEID, M1PeriodicReporting]{ } return x.ExtendedReportIntervalMDT, true }, + Clear: func(x *M1PeriodicReporting) { + x.ExtendedReportIntervalMDT = nil + }, }, } -func (m1PeriodicReporting *M1PeriodicReporting) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m1PeriodicReporting *M1PeriodicReporting) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsM1PeriodicReporting, m1PeriodicReporting, m1PeriodicReporting.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsM1PeriodicReporting, m1PeriodicReporting, &m1PeriodicReporting.iEExtensions) return notComprehended } @@ -17548,19 +17690,19 @@ func (m1ReportingTrigger M1ReportingTrigger) Name() string { return enumM1ReportingTrigger.Name(m1ReportingTrigger) } -func (m1ReportingTrigger M1ReportingTrigger) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m1ReportingTrigger M1ReportingTrigger) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM1ReportingTrigger.Known(m1ReportingTrigger) } func (m1ThresholdEventA2 *M1ThresholdEventA2) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsM1ThresholdEventA2, m1ThresholdEventA2, m1ThresholdEventA2.iEExtensions) + ext := apimpl.ExtensionFields(extIEsM1ThresholdEventA2, m1ThresholdEventA2, m1ThresholdEventA2.iEExtensions) w.WriteBit(m1ThresholdEventA2.extensions.Present()) w.WriteBit(len(ext) > 0) if err := m1ThresholdEventA2.M1ThresholdType.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -17586,7 +17728,7 @@ func (m1ThresholdEventA2 *M1ThresholdEventA2) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM1ThresholdEventA2, m1ThresholdEventA2, &m1ThresholdEventA2.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsM1ThresholdEventA2, m1ThresholdEventA2, &m1ThresholdEventA2.iEExtensions); err != nil { return err } } @@ -17598,14 +17740,14 @@ func (m1ThresholdEventA2 *M1ThresholdEventA2) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsM1ThresholdEventA2 []ap.IESpec[ProtocolIEID, M1ThresholdEventA2] +var extIEsM1ThresholdEventA2 []apimpl.IESpec[ProtocolIEID, M1ThresholdEventA2] -func (m1ThresholdEventA2 *M1ThresholdEventA2) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m1ThresholdEventA2 *M1ThresholdEventA2) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if m1ThresholdEventA2.M1ThresholdType.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsM1ThresholdEventA2, m1ThresholdEventA2, m1ThresholdEventA2.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsM1ThresholdEventA2, m1ThresholdEventA2, &m1ThresholdEventA2.iEExtensions) return notComprehended } @@ -17645,7 +17787,7 @@ func (m1ThresholdType *M1ThresholdType) MarshalPER(w *per.Writer, enc per.Encodi if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, m1ThresholdType.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, m1ThresholdType.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -17678,7 +17820,7 @@ func (m1ThresholdType *M1ThresholdType) UnmarshalPER(r *per.Reader, enc per.Enco } m1ThresholdType.ThresholdSINR = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -17692,19 +17834,19 @@ func (m1ThresholdType *M1ThresholdType) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (m1ThresholdType *M1ThresholdType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m1ThresholdType *M1ThresholdType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case m1ThresholdType.ThresholdRSRP != nil: case m1ThresholdType.ThresholdRSRQ != nil: case m1ThresholdType.ThresholdSINR != nil: case m1ThresholdType.ChoiceExtension != nil: - d.Unknown(m1ThresholdType.ChoiceExtension.ID, m1ThresholdType.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, m1ThresholdType.ChoiceExtension) } return false } func (m4Configuration *M4Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsM4Configuration, m4Configuration, m4Configuration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsM4Configuration, m4Configuration, m4Configuration.iEExtensions) w.WriteBit(m4Configuration.extensions.Present()) w.WriteBit(len(ext) > 0) if err := m4Configuration.M4period.MarshalPER(w, enc); err != nil { @@ -17714,7 +17856,7 @@ func (m4Configuration *M4Configuration) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -17743,7 +17885,7 @@ func (m4Configuration *M4Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM4Configuration, m4Configuration, &m4Configuration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsM4Configuration, m4Configuration, &m4Configuration.iEExtensions); err != nil { return err } } @@ -17755,11 +17897,11 @@ func (m4Configuration *M4Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsM4Configuration = []ap.IESpec[ProtocolIEID, M4Configuration]{ +var extIEsM4Configuration = []apimpl.IESpec[ProtocolIEID, M4Configuration]{ { ID: IDM4ReportAmount, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *M4Configuration, r *per.Reader, enc per.Encoding) error { var v M4ReportAmountMDT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -17774,10 +17916,13 @@ var extIEsM4Configuration = []ap.IESpec[ProtocolIEID, M4Configuration]{ } return x.M4ReportAmount, true }, + Clear: func(x *M4Configuration) { + x.M4ReportAmount = nil + }, }, } -func (m4Configuration *M4Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m4Configuration *M4Configuration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if m4Configuration.M4period.Diagnose(d) { notComprehended = true @@ -17785,7 +17930,7 @@ func (m4Configuration *M4Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if m4Configuration.M4linkstolog.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsM4Configuration, m4Configuration, m4Configuration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsM4Configuration, m4Configuration, &m4Configuration.iEExtensions) return notComprehended } @@ -17806,7 +17951,7 @@ func (m4ReportAmountMDT M4ReportAmountMDT) Name() string { return enumM4ReportAmountMDT.Name(m4ReportAmountMDT) } -func (m4ReportAmountMDT M4ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m4ReportAmountMDT M4ReportAmountMDT) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM4ReportAmountMDT.Known(m4ReportAmountMDT) } @@ -17827,12 +17972,12 @@ func (m4period M4period) Name() string { return enumM4period.Name(m4period) } -func (m4period M4period) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m4period M4period) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM4period.Known(m4period) } func (m5Configuration *M5Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsM5Configuration, m5Configuration, m5Configuration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsM5Configuration, m5Configuration, m5Configuration.iEExtensions) w.WriteBit(m5Configuration.extensions.Present()) w.WriteBit(len(ext) > 0) if err := m5Configuration.M5period.MarshalPER(w, enc); err != nil { @@ -17842,7 +17987,7 @@ func (m5Configuration *M5Configuration) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -17871,7 +18016,7 @@ func (m5Configuration *M5Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM5Configuration, m5Configuration, &m5Configuration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsM5Configuration, m5Configuration, &m5Configuration.iEExtensions); err != nil { return err } } @@ -17883,11 +18028,11 @@ func (m5Configuration *M5Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsM5Configuration = []ap.IESpec[ProtocolIEID, M5Configuration]{ +var extIEsM5Configuration = []apimpl.IESpec[ProtocolIEID, M5Configuration]{ { ID: IDM5ReportAmount, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *M5Configuration, r *per.Reader, enc per.Encoding) error { var v M5ReportAmountMDT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -17902,10 +18047,13 @@ var extIEsM5Configuration = []ap.IESpec[ProtocolIEID, M5Configuration]{ } return x.M5ReportAmount, true }, + Clear: func(x *M5Configuration) { + x.M5ReportAmount = nil + }, }, } -func (m5Configuration *M5Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m5Configuration *M5Configuration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if m5Configuration.M5period.Diagnose(d) { notComprehended = true @@ -17913,7 +18061,7 @@ func (m5Configuration *M5Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if m5Configuration.M5linkstolog.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsM5Configuration, m5Configuration, m5Configuration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsM5Configuration, m5Configuration, &m5Configuration.iEExtensions) return notComprehended } @@ -17934,7 +18082,7 @@ func (m5ReportAmountMDT M5ReportAmountMDT) Name() string { return enumM5ReportAmountMDT.Name(m5ReportAmountMDT) } -func (m5ReportAmountMDT M5ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m5ReportAmountMDT M5ReportAmountMDT) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM5ReportAmountMDT.Known(m5ReportAmountMDT) } @@ -17955,12 +18103,12 @@ func (m5period M5period) Name() string { return enumM5period.Name(m5period) } -func (m5period M5period) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m5period M5period) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM5period.Known(m5period) } func (m6Configuration *M6Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsM6Configuration, m6Configuration, m6Configuration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsM6Configuration, m6Configuration, m6Configuration.iEExtensions) w.WriteBit(m6Configuration.extensions.Present()) w.WriteBit(len(ext) > 0) if err := m6Configuration.M6reportInterval.MarshalPER(w, enc); err != nil { @@ -17970,7 +18118,7 @@ func (m6Configuration *M6Configuration) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -17999,7 +18147,7 @@ func (m6Configuration *M6Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM6Configuration, m6Configuration, &m6Configuration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsM6Configuration, m6Configuration, &m6Configuration.iEExtensions); err != nil { return err } } @@ -18011,11 +18159,11 @@ func (m6Configuration *M6Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsM6Configuration = []ap.IESpec[ProtocolIEID, M6Configuration]{ +var extIEsM6Configuration = []apimpl.IESpec[ProtocolIEID, M6Configuration]{ { ID: IDM6ReportAmount, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *M6Configuration, r *per.Reader, enc per.Encoding) error { var v M6ReportAmountMDT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -18030,11 +18178,14 @@ var extIEsM6Configuration = []ap.IESpec[ProtocolIEID, M6Configuration]{ } return x.M6ReportAmount, true }, + Clear: func(x *M6Configuration) { + x.M6ReportAmount = nil + }, }, { ID: IDExcessPacketDelayThresholdConfiguration, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *M6Configuration, r *per.Reader, enc per.Encoding) error { var v ExcessPacketDelayThresholdConfiguration if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -18049,10 +18200,13 @@ var extIEsM6Configuration = []ap.IESpec[ProtocolIEID, M6Configuration]{ } return x.ExcessPacketDelayThresholdConfiguration, true }, + Clear: func(x *M6Configuration) { + x.ExcessPacketDelayThresholdConfiguration = nil + }, }, } -func (m6Configuration *M6Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m6Configuration *M6Configuration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if m6Configuration.M6reportInterval.Diagnose(d) { notComprehended = true @@ -18060,7 +18214,7 @@ func (m6Configuration *M6Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if m6Configuration.M6linkstolog.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsM6Configuration, m6Configuration, m6Configuration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsM6Configuration, m6Configuration, &m6Configuration.iEExtensions) return notComprehended } @@ -18081,7 +18235,7 @@ func (m6ReportAmountMDT M6ReportAmountMDT) Name() string { return enumM6ReportAmountMDT.Name(m6ReportAmountMDT) } -func (m6ReportAmountMDT M6ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m6ReportAmountMDT M6ReportAmountMDT) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM6ReportAmountMDT.Known(m6ReportAmountMDT) } @@ -18102,12 +18256,12 @@ func (m6reportInterval M6reportInterval) Name() string { return enumM6reportInterval.Name(m6reportInterval) } -func (m6reportInterval M6reportInterval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m6reportInterval M6reportInterval) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM6reportInterval.Known(m6reportInterval) } func (m7Configuration *M7Configuration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsM7Configuration, m7Configuration, m7Configuration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsM7Configuration, m7Configuration, m7Configuration.iEExtensions) w.WriteBit(m7Configuration.extensions.Present()) w.WriteBit(len(ext) > 0) if err := m7Configuration.M7period.MarshalPER(w, enc); err != nil { @@ -18117,7 +18271,7 @@ func (m7Configuration *M7Configuration) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18146,7 +18300,7 @@ func (m7Configuration *M7Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsM7Configuration, m7Configuration, &m7Configuration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsM7Configuration, m7Configuration, &m7Configuration.iEExtensions); err != nil { return err } } @@ -18158,11 +18312,11 @@ func (m7Configuration *M7Configuration) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsM7Configuration = []ap.IESpec[ProtocolIEID, M7Configuration]{ +var extIEsM7Configuration = []apimpl.IESpec[ProtocolIEID, M7Configuration]{ { ID: IDM7ReportAmount, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *M7Configuration, r *per.Reader, enc per.Encoding) error { var v M7ReportAmountMDT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -18177,10 +18331,13 @@ var extIEsM7Configuration = []ap.IESpec[ProtocolIEID, M7Configuration]{ } return x.M7ReportAmount, true }, + Clear: func(x *M7Configuration) { + x.M7ReportAmount = nil + }, }, } -func (m7Configuration *M7Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (m7Configuration *M7Configuration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if m7Configuration.M7period.Diagnose(d) { notComprehended = true @@ -18188,7 +18345,7 @@ func (m7Configuration *M7Configuration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if m7Configuration.M7linkstolog.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsM7Configuration, m7Configuration, m7Configuration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsM7Configuration, m7Configuration, &m7Configuration.iEExtensions) return notComprehended } @@ -18209,12 +18366,12 @@ func (m7ReportAmountMDT M7ReportAmountMDT) Name() string { return enumM7ReportAmountMDT.Name(m7ReportAmountMDT) } -func (m7ReportAmountMDT M7ReportAmountMDT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (m7ReportAmountMDT M7ReportAmountMDT) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumM7ReportAmountMDT.Known(m7ReportAmountMDT) } func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformationSourcetoTargetItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem.iEExtensions) w.WriteBit(mBSActiveSessionInformationSourcetoTargetItem.extensions.Present()) w.WriteBit(mBSActiveSessionInformationSourcetoTargetItem.MBSAreaSessionID != nil) w.WriteBit(mBSActiveSessionInformationSourcetoTargetItem.MBSServiceArea != nil) @@ -18242,7 +18399,7 @@ func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformation } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18302,7 +18459,7 @@ func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformation } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, &mBSActiveSessionInformationSourcetoTargetItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, &mBSActiveSessionInformationSourcetoTargetItem.iEExtensions); err != nil { return err } } @@ -18314,9 +18471,9 @@ func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformation return nil } -var extIEsMBSActiveSessionInformationSourcetoTargetItem []ap.IESpec[ProtocolIEID, MBSActiveSessionInformationSourcetoTargetItem] +var extIEsMBSActiveSessionInformationSourcetoTargetItem []apimpl.IESpec[ProtocolIEID, MBSActiveSessionInformationSourcetoTargetItem] -func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformationSourcetoTargetItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformationSourcetoTargetItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSActiveSessionInformationSourcetoTargetItem.MBSSessionID.Diagnose(d) { notComprehended = true @@ -18333,7 +18490,7 @@ func (mBSActiveSessionInformationSourcetoTargetItem *MBSActiveSessionInformation if mBSActiveSessionInformationSourcetoTargetItem.MBSMappingandDataForwardingRequestList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSActiveSessionInformationSourcetoTargetItem, mBSActiveSessionInformationSourcetoTargetItem, &mBSActiveSessionInformationSourcetoTargetItem.iEExtensions) return notComprehended } @@ -18354,12 +18511,12 @@ func (mBSAssistanceInformation MBSAssistanceInformation) Name() string { return enumMBSAssistanceInformation.Name(mBSAssistanceInformation) } -func (mBSAssistanceInformation MBSAssistanceInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mBSAssistanceInformation MBSAssistanceInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMBSAssistanceInformation.Known(mBSAssistanceInformation) } func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem.iEExtensions) w.WriteBit(mBSMappingandDataForwardingRequestItem.extensions.Present()) w.WriteBit(mBSMappingandDataForwardingRequestItem.MRBProgressInformation != nil) w.WriteBit(len(ext) > 0) @@ -18375,7 +18532,7 @@ func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequest } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18415,7 +18572,7 @@ func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequest mBSMappingandDataForwardingRequestItem.MRBProgressInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, &mBSMappingandDataForwardingRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, &mBSMappingandDataForwardingRequestItem.iEExtensions); err != nil { return err } } @@ -18427,9 +18584,9 @@ func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequest return nil } -var extIEsMBSMappingandDataForwardingRequestItem []ap.IESpec[ProtocolIEID, MBSMappingandDataForwardingRequestItem] +var extIEsMBSMappingandDataForwardingRequestItem []apimpl.IESpec[ProtocolIEID, MBSMappingandDataForwardingRequestItem] -func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSMappingandDataForwardingRequestItem.MRBID.Diagnose(d) { notComprehended = true @@ -18440,12 +18597,12 @@ func (mBSMappingandDataForwardingRequestItem *MBSMappingandDataForwardingRequest if mBSMappingandDataForwardingRequestItem.MRBProgressInformation != nil && mBSMappingandDataForwardingRequestItem.MRBProgressInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSMappingandDataForwardingRequestItem, mBSMappingandDataForwardingRequestItem, &mBSMappingandDataForwardingRequestItem.iEExtensions) return notComprehended } func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem.iEExtensions) w.WriteBit(mBSQoSFlowsToBeSetupItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := mBSQoSFlowsToBeSetupItem.MBSqosFlowIdentifier.MarshalPER(w, enc); err != nil { @@ -18455,7 +18612,7 @@ func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18484,7 +18641,7 @@ func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, &mBSQoSFlowsToBeSetupItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, &mBSQoSFlowsToBeSetupItem.iEExtensions); err != nil { return err } } @@ -18496,9 +18653,9 @@ func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) UnmarshalPER(r *per.Re return nil } -var extIEsMBSQoSFlowsToBeSetupItem []ap.IESpec[ProtocolIEID, MBSQoSFlowsToBeSetupItem] +var extIEsMBSQoSFlowsToBeSetupItem []apimpl.IESpec[ProtocolIEID, MBSQoSFlowsToBeSetupItem] -func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSQoSFlowsToBeSetupItem.MBSqosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -18506,7 +18663,7 @@ func (mBSQoSFlowsToBeSetupItem *MBSQoSFlowsToBeSetupItem) Diagnose(d *ap.Diagnos if mBSQoSFlowsToBeSetupItem.MBSqosFlowLevelQosParameters.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSQoSFlowsToBeSetupItem, mBSQoSFlowsToBeSetupItem, &mBSQoSFlowsToBeSetupItem.iEExtensions) return notComprehended } @@ -18539,7 +18696,7 @@ func (mBSServiceArea *MBSServiceArea) MarshalPER(w *per.Writer, enc per.Encoding if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, mBSServiceArea.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, mBSServiceArea.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -18566,7 +18723,7 @@ func (mBSServiceArea *MBSServiceArea) UnmarshalPER(r *per.Reader, enc per.Encodi } mBSServiceArea.Locationdependent = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -18580,20 +18737,20 @@ func (mBSServiceArea *MBSServiceArea) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -func (mBSServiceArea *MBSServiceArea) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSServiceArea *MBSServiceArea) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case mBSServiceArea.Locationindependent != nil: return mBSServiceArea.Locationindependent.Diagnose(d) case mBSServiceArea.Locationdependent != nil: return mBSServiceArea.Locationdependent.Diagnose(d) case mBSServiceArea.ChoiceExtension != nil: - d.Unknown(mBSServiceArea.ChoiceExtension.ID, mBSServiceArea.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, mBSServiceArea.ChoiceExtension) } return false } func (mBSServiceAreaInformation *MBSServiceAreaInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, mBSServiceAreaInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, mBSServiceAreaInformation.iEExtensions) w.WriteBit(mBSServiceAreaInformation.extensions.Present()) w.WriteBit(mBSServiceAreaInformation.MBSServiceAreaCellList != nil) w.WriteBit(mBSServiceAreaInformation.MBSServiceAreaTAIList != nil) @@ -18609,7 +18766,7 @@ func (mBSServiceAreaInformation *MBSServiceAreaInformation) MarshalPER(w *per.Wr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18650,7 +18807,7 @@ func (mBSServiceAreaInformation *MBSServiceAreaInformation) UnmarshalPER(r *per. } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, &mBSServiceAreaInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, &mBSServiceAreaInformation.iEExtensions); err != nil { return err } } @@ -18662,11 +18819,11 @@ func (mBSServiceAreaInformation *MBSServiceAreaInformation) UnmarshalPER(r *per. return nil } -var extIEsMBSServiceAreaInformation = []ap.IESpec[ProtocolIEID, MBSServiceAreaInformation]{ +var extIEsMBSServiceAreaInformation = []apimpl.IESpec[ProtocolIEID, MBSServiceAreaInformation]{ { ID: IDMBSIntendedServiceAreaList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MBSServiceAreaInformation, r *per.Reader, enc per.Encoding) error { var v MBSIntendedServiceAreaList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -18681,10 +18838,13 @@ var extIEsMBSServiceAreaInformation = []ap.IESpec[ProtocolIEID, MBSServiceAreaIn } return x.MBSIntendedServiceAreaList, true }, + Clear: func(x *MBSServiceAreaInformation) { + x.MBSIntendedServiceAreaList = nil + }, }, } -func (mBSServiceAreaInformation *MBSServiceAreaInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSServiceAreaInformation *MBSServiceAreaInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSServiceAreaInformation.MBSServiceAreaCellList.Diagnose(d) { notComprehended = true @@ -18692,12 +18852,12 @@ func (mBSServiceAreaInformation *MBSServiceAreaInformation) Diagnose(d *ap.Diagn if mBSServiceAreaInformation.MBSServiceAreaTAIList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, mBSServiceAreaInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSServiceAreaInformation, mBSServiceAreaInformation, &mBSServiceAreaInformation.iEExtensions) return notComprehended } func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, mBSServiceAreaInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, mBSServiceAreaInformationItem.iEExtensions) w.WriteBit(mBSServiceAreaInformationItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := mBSServiceAreaInformationItem.MBSAreaSessionID.MarshalPER(w, enc); err != nil { @@ -18707,7 +18867,7 @@ func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) MarshalPER(w return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18736,7 +18896,7 @@ func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) UnmarshalPER return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, &mBSServiceAreaInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, &mBSServiceAreaInformationItem.iEExtensions); err != nil { return err } } @@ -18748,9 +18908,9 @@ func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) UnmarshalPER return nil } -var extIEsMBSServiceAreaInformationItem []ap.IESpec[ProtocolIEID, MBSServiceAreaInformationItem] +var extIEsMBSServiceAreaInformationItem []apimpl.IESpec[ProtocolIEID, MBSServiceAreaInformationItem] -func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSServiceAreaInformationItem.MBSAreaSessionID.Diagnose(d) { notComprehended = true @@ -18758,12 +18918,12 @@ func (mBSServiceAreaInformationItem *MBSServiceAreaInformationItem) Diagnose(d * if mBSServiceAreaInformationItem.MBSServiceAreaInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, mBSServiceAreaInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSServiceAreaInformationItem, mBSServiceAreaInformationItem, &mBSServiceAreaInformationItem.iEExtensions) return notComprehended } func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem.iEExtensions) w.WriteBit(mBSSessionFailedtoSetupItem.extensions.Present()) w.WriteBit(mBSSessionFailedtoSetupItem.MBSAreaSessionID != nil) w.WriteBit(len(ext) > 0) @@ -18779,7 +18939,7 @@ func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) MarshalPER(w *pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18819,7 +18979,7 @@ func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) UnmarshalPER(r * return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, &mBSSessionFailedtoSetupItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, &mBSSessionFailedtoSetupItem.iEExtensions); err != nil { return err } } @@ -18831,9 +18991,9 @@ func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) UnmarshalPER(r * return nil } -var extIEsMBSSessionFailedtoSetupItem []ap.IESpec[ProtocolIEID, MBSSessionFailedtoSetupItem] +var extIEsMBSSessionFailedtoSetupItem []apimpl.IESpec[ProtocolIEID, MBSSessionFailedtoSetupItem] -func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSSessionFailedtoSetupItem.MBSSessionID.Diagnose(d) { notComprehended = true @@ -18844,12 +19004,12 @@ func (mBSSessionFailedtoSetupItem *MBSSessionFailedtoSetupItem) Diagnose(d *ap.D if mBSSessionFailedtoSetupItem.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSSessionFailedtoSetupItem, mBSSessionFailedtoSetupItem, &mBSSessionFailedtoSetupItem.iEExtensions) return notComprehended } func (mBSSessionID *MBSSessionID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSSessionID, mBSSessionID, mBSSessionID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSSessionID, mBSSessionID, mBSSessionID.iEExtensions) w.WriteBit(mBSSessionID.extensions.Present()) w.WriteBit(mBSSessionID.NID != nil) w.WriteBit(len(ext) > 0) @@ -18862,7 +19022,7 @@ func (mBSSessionID *MBSSessionID) MarshalPER(w *per.Writer, enc per.Encoding) er } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18899,7 +19059,7 @@ func (mBSSessionID *MBSSessionID) UnmarshalPER(r *per.Reader, enc per.Encoding) mBSSessionID.NID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionID, mBSSessionID, &mBSSessionID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionID, mBSSessionID, &mBSSessionID.iEExtensions); err != nil { return err } } @@ -18911,16 +19071,16 @@ func (mBSSessionID *MBSSessionID) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsMBSSessionID []ap.IESpec[ProtocolIEID, MBSSessionID] +var extIEsMBSSessionID []apimpl.IESpec[ProtocolIEID, MBSSessionID] -func (mBSSessionID *MBSSessionID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionID *MBSSessionID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsMBSSessionID, mBSSessionID, mBSSessionID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSSessionID, mBSSessionID, &mBSSessionID.iEExtensions) return notComprehended } func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, mBSSessionSetupRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, mBSSessionSetupRequestItem.iEExtensions) w.WriteBit(mBSSessionSetupRequestItem.extensions.Present()) w.WriteBit(mBSSessionSetupRequestItem.MBSAreaSessionID != nil) w.WriteBit(mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList != nil) @@ -18939,7 +19099,7 @@ func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -18985,7 +19145,7 @@ func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) UnmarshalPER(r *pe } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, &mBSSessionSetupRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, &mBSSessionSetupRequestItem.iEExtensions); err != nil { return err } } @@ -18997,11 +19157,11 @@ func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) UnmarshalPER(r *pe return nil } -var extIEsMBSSessionSetupRequestItem = []ap.IESpec[ProtocolIEID, MBSSessionSetupRequestItem]{ +var extIEsMBSSessionSetupRequestItem = []apimpl.IESpec[ProtocolIEID, MBSSessionSetupRequestItem]{ { ID: IDMBSAssistanceInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MBSSessionSetupRequestItem, r *per.Reader, enc per.Encoding) error { var v MBSAssistanceInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -19016,10 +19176,13 @@ var extIEsMBSSessionSetupRequestItem = []ap.IESpec[ProtocolIEID, MBSSessionSetup } return x.MBSAssistanceInformation, true }, + Clear: func(x *MBSSessionSetupRequestItem) { + x.MBSAssistanceInformation = nil + }, }, } -func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSSessionSetupRequestItem.MBSSessionID.Diagnose(d) { notComprehended = true @@ -19030,12 +19193,12 @@ func (mBSSessionSetupRequestItem *MBSSessionSetupRequestItem) Diagnose(d *ap.Dia if mBSSessionSetupRequestItem.AssociatedMBSQosFlowSetupRequestList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, mBSSessionSetupRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSSessionSetupRequestItem, mBSSessionSetupRequestItem, &mBSSessionSetupRequestItem.iEExtensions) return notComprehended } func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, mBSSessionSetupResponseItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, mBSSessionSetupResponseItem.iEExtensions) w.WriteBit(mBSSessionSetupResponseItem.extensions.Present()) w.WriteBit(mBSSessionSetupResponseItem.MBSAreaSessionID != nil) w.WriteBit(len(ext) > 0) @@ -19048,7 +19211,7 @@ func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) MarshalPER(w *pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19085,7 +19248,7 @@ func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) UnmarshalPER(r * mBSSessionSetupResponseItem.MBSAreaSessionID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, &mBSSessionSetupResponseItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, &mBSSessionSetupResponseItem.iEExtensions); err != nil { return err } } @@ -19097,9 +19260,9 @@ func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) UnmarshalPER(r * return nil } -var extIEsMBSSessionSetupResponseItem []ap.IESpec[ProtocolIEID, MBSSessionSetupResponseItem] +var extIEsMBSSessionSetupResponseItem []apimpl.IESpec[ProtocolIEID, MBSSessionSetupResponseItem] -func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSSessionSetupResponseItem.MBSSessionID.Diagnose(d) { notComprehended = true @@ -19107,12 +19270,12 @@ func (mBSSessionSetupResponseItem *MBSSessionSetupResponseItem) Diagnose(d *ap.D if mBSSessionSetupResponseItem.MBSAreaSessionID != nil && mBSSessionSetupResponseItem.MBSAreaSessionID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, mBSSessionSetupResponseItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSSessionSetupResponseItem, mBSSessionSetupResponseItem, &mBSSessionSetupResponseItem.iEExtensions) return notComprehended } func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem.iEExtensions) w.WriteBit(mBSSessionSetuporModifyRequestItem.extensions.Present()) w.WriteBit(mBSSessionSetuporModifyRequestItem.MBSAreaSessionID != nil) w.WriteBit(mBSSessionSetuporModifyRequestItem.AssociatedMBSQosFlowSetuporModifyRequestList != nil) @@ -19137,7 +19300,7 @@ func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) Ma } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19192,7 +19355,7 @@ func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) Un } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, &mBSSessionSetuporModifyRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, &mBSSessionSetuporModifyRequestItem.iEExtensions); err != nil { return err } } @@ -19204,11 +19367,11 @@ func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) Un return nil } -var extIEsMBSSessionSetuporModifyRequestItem = []ap.IESpec[ProtocolIEID, MBSSessionSetuporModifyRequestItem]{ +var extIEsMBSSessionSetuporModifyRequestItem = []apimpl.IESpec[ProtocolIEID, MBSSessionSetuporModifyRequestItem]{ { ID: IDMBSAssistanceInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MBSSessionSetuporModifyRequestItem, r *per.Reader, enc per.Encoding) error { var v MBSAssistanceInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -19223,10 +19386,13 @@ var extIEsMBSSessionSetuporModifyRequestItem = []ap.IESpec[ProtocolIEID, MBSSess } return x.MBSAssistanceInformation, true }, + Clear: func(x *MBSSessionSetuporModifyRequestItem) { + x.MBSAssistanceInformation = nil + }, }, } -func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSSessionSetuporModifyRequestItem.MBSSessionID.Diagnose(d) { notComprehended = true @@ -19240,12 +19406,12 @@ func (mBSSessionSetuporModifyRequestItem *MBSSessionSetuporModifyRequestItem) Di if mBSSessionSetuporModifyRequestItem.MBSQosFlowToReleaseList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSSessionSetuporModifyRequestItem, mBSSessionSetuporModifyRequestItem, &mBSSessionSetuporModifyRequestItem.iEExtensions) return notComprehended } func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, mBSSessionToReleaseItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, mBSSessionToReleaseItem.iEExtensions) w.WriteBit(mBSSessionToReleaseItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := mBSSessionToReleaseItem.MBSSessionID.MarshalPER(w, enc); err != nil { @@ -19255,7 +19421,7 @@ func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) MarshalPER(w *per.Writer return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19284,7 +19450,7 @@ func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, &mBSSessionToReleaseItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, &mBSSessionToReleaseItem.iEExtensions); err != nil { return err } } @@ -19296,9 +19462,9 @@ func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) UnmarshalPER(r *per.Read return nil } -var extIEsMBSSessionToReleaseItem []ap.IESpec[ProtocolIEID, MBSSessionToReleaseItem] +var extIEsMBSSessionToReleaseItem []apimpl.IESpec[ProtocolIEID, MBSSessionToReleaseItem] -func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mBSSessionToReleaseItem.MBSSessionID.Diagnose(d) { notComprehended = true @@ -19306,7 +19472,7 @@ func (mBSSessionToReleaseItem *MBSSessionToReleaseItem) Diagnose(d *ap.Diagnosis if mBSSessionToReleaseItem.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, mBSSessionToReleaseItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMBSSessionToReleaseItem, mBSSessionToReleaseItem, &mBSSessionToReleaseItem.iEExtensions) return notComprehended } @@ -19327,7 +19493,7 @@ func (mBSSupportIndicator MBSSupportIndicator) Name() string { return enumMBSSupportIndicator.Name(mBSSupportIndicator) } -func (mBSSupportIndicator MBSSupportIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSupportIndicator MBSSupportIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMBSSupportIndicator.Known(mBSSupportIndicator) } @@ -19348,7 +19514,7 @@ func (mDTActivation MDTActivation) Name() string { return enumMDTActivation.Name(mDTActivation) } -func (mDTActivation MDTActivation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mDTActivation MDTActivation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMDTActivation.Known(mDTActivation) } @@ -19374,7 +19540,7 @@ func (mDTAlignmentInfo *MDTAlignmentInfo) MarshalPER(w *per.Writer, enc per.Enco if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, mDTAlignmentInfo.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, mDTAlignmentInfo.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -19395,7 +19561,7 @@ func (mDTAlignmentInfo *MDTAlignmentInfo) UnmarshalPER(r *per.Reader, enc per.En } mDTAlignmentInfo.SbasedMDT = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -19409,17 +19575,17 @@ func (mDTAlignmentInfo *MDTAlignmentInfo) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (mDTAlignmentInfo *MDTAlignmentInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mDTAlignmentInfo *MDTAlignmentInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case mDTAlignmentInfo.SbasedMDT != nil: case mDTAlignmentInfo.ChoiceExtension != nil: - d.Unknown(mDTAlignmentInfo.ChoiceExtension.ID, mDTAlignmentInfo.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, mDTAlignmentInfo.ChoiceExtension) } return false } func (mDTConfiguration *MDTConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMDTConfiguration, mDTConfiguration, mDTConfiguration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMDTConfiguration, mDTConfiguration, mDTConfiguration.iEExtensions) w.WriteBit(mDTConfiguration.extensions.Present()) w.WriteBit(mDTConfiguration.MdtConfigNR != nil) w.WriteBit(mDTConfiguration.MdtConfigEUTRA != nil) @@ -19435,7 +19601,7 @@ func (mDTConfiguration *MDTConfiguration) MarshalPER(w *per.Writer, enc per.Enco } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19480,7 +19646,7 @@ func (mDTConfiguration *MDTConfiguration) UnmarshalPER(r *per.Reader, enc per.En mDTConfiguration.MdtConfigEUTRA = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfiguration, mDTConfiguration, &mDTConfiguration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfiguration, mDTConfiguration, &mDTConfiguration.iEExtensions); err != nil { return err } } @@ -19492,11 +19658,11 @@ func (mDTConfiguration *MDTConfiguration) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsMDTConfiguration = []ap.IESpec[ProtocolIEID, MDTConfiguration]{ +var extIEsMDTConfiguration = []apimpl.IESpec[ProtocolIEID, MDTConfiguration]{ { ID: IDMNonlyMDTcollection, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MDTConfiguration, r *per.Reader, enc per.Encoding) error { var v MNonlyMDTcollection if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -19511,10 +19677,13 @@ var extIEsMDTConfiguration = []ap.IESpec[ProtocolIEID, MDTConfiguration]{ } return x.MNonlyMDTcollection, true }, + Clear: func(x *MDTConfiguration) { + x.MNonlyMDTcollection = nil + }, }, } -func (mDTConfiguration *MDTConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mDTConfiguration *MDTConfiguration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mDTConfiguration.MdtConfigNR != nil && mDTConfiguration.MdtConfigNR.Diagnose(d) { notComprehended = true @@ -19522,12 +19691,12 @@ func (mDTConfiguration *MDTConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID] if mDTConfiguration.MdtConfigEUTRA != nil && mDTConfiguration.MdtConfigEUTRA.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMDTConfiguration, mDTConfiguration, mDTConfiguration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMDTConfiguration, mDTConfiguration, &mDTConfiguration.iEExtensions) return notComprehended } func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, mDTConfigurationEUTRA.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, mDTConfigurationEUTRA.iEExtensions) w.WriteBit(mDTConfigurationEUTRA.extensions.Present()) w.WriteBit(mDTConfigurationEUTRA.SignallingBasedMDTPLMNList != nil) w.WriteBit(len(ext) > 0) @@ -19546,7 +19715,7 @@ func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) MarshalPER(w *per.Writer, en } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19587,7 +19756,7 @@ func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) UnmarshalPER(r *per.Reader, } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, &mDTConfigurationEUTRA.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, &mDTConfigurationEUTRA.iEExtensions); err != nil { return err } } @@ -19599,9 +19768,9 @@ func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) UnmarshalPER(r *per.Reader, return nil } -var extIEsMDTConfigurationEUTRA []ap.IESpec[ProtocolIEID, MDTConfigurationEUTRA] +var extIEsMDTConfigurationEUTRA []apimpl.IESpec[ProtocolIEID, MDTConfigurationEUTRA] -func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mDTConfigurationEUTRA.MdtActivation.Diagnose(d) { notComprehended = true @@ -19609,12 +19778,12 @@ func (mDTConfigurationEUTRA *MDTConfigurationEUTRA) Diagnose(d *ap.Diagnosis[Pro if mDTConfigurationEUTRA.AreaScopeOfMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, mDTConfigurationEUTRA.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMDTConfigurationEUTRA, mDTConfigurationEUTRA, &mDTConfigurationEUTRA.iEExtensions) return notComprehended } func (mDTConfigurationNR *MDTConfigurationNR) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMDTConfigurationNR, mDTConfigurationNR, mDTConfigurationNR.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMDTConfigurationNR, mDTConfigurationNR, mDTConfigurationNR.iEExtensions) w.WriteBit(mDTConfigurationNR.extensions.Present()) w.WriteBit(mDTConfigurationNR.SignallingBasedMDTPLMNList != nil) w.WriteBit(len(ext) > 0) @@ -19633,7 +19802,7 @@ func (mDTConfigurationNR *MDTConfigurationNR) MarshalPER(w *per.Writer, enc per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19674,7 +19843,7 @@ func (mDTConfigurationNR *MDTConfigurationNR) UnmarshalPER(r *per.Reader, enc pe } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfigurationNR, mDTConfigurationNR, &mDTConfigurationNR.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMDTConfigurationNR, mDTConfigurationNR, &mDTConfigurationNR.iEExtensions); err != nil { return err } } @@ -19686,11 +19855,11 @@ func (mDTConfigurationNR *MDTConfigurationNR) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsMDTConfigurationNR = []ap.IESpec[ProtocolIEID, MDTConfigurationNR]{ +var extIEsMDTConfigurationNR = []apimpl.IESpec[ProtocolIEID, MDTConfigurationNR]{ { ID: IDPNINPNAreaScopeofMDT, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MDTConfigurationNR, r *per.Reader, enc per.Encoding) error { var v PNINPNAreaScopeofMDT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -19705,11 +19874,14 @@ var extIEsMDTConfigurationNR = []ap.IESpec[ProtocolIEID, MDTConfigurationNR]{ } return x.PNINPNAreaScopeofMDT, true }, + Clear: func(x *MDTConfigurationNR) { + x.PNINPNAreaScopeofMDT = nil + }, }, { ID: IDNetworkSliceAreaScopeofMDT, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MDTConfigurationNR, r *per.Reader, enc per.Encoding) error { var v NetworkSliceAreaScopeofMDT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -19724,10 +19896,13 @@ var extIEsMDTConfigurationNR = []ap.IESpec[ProtocolIEID, MDTConfigurationNR]{ } return x.NetworkSliceAreaScopeofMDT, true }, + Clear: func(x *MDTConfigurationNR) { + x.NetworkSliceAreaScopeofMDT = nil + }, }, } -func (mDTConfigurationNR *MDTConfigurationNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mDTConfigurationNR *MDTConfigurationNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mDTConfigurationNR.MdtActivation.Diagnose(d) { notComprehended = true @@ -19738,19 +19913,19 @@ func (mDTConfigurationNR *MDTConfigurationNR) Diagnose(d *ap.Diagnosis[ProtocolI if mDTConfigurationNR.MDTModeNr.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMDTConfigurationNR, mDTConfigurationNR, mDTConfigurationNR.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMDTConfigurationNR, mDTConfigurationNR, &mDTConfigurationNR.iEExtensions) return notComprehended } func (mDTLocationInfo *MDTLocationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMDTLocationInfo, mDTLocationInfo, mDTLocationInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMDTLocationInfo, mDTLocationInfo, mDTLocationInfo.iEExtensions) w.WriteBit(mDTLocationInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := mDTLocationInfo.MDTLocationInformation.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19776,7 +19951,7 @@ func (mDTLocationInfo *MDTLocationInfo) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTLocationInfo, mDTLocationInfo, &mDTLocationInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMDTLocationInfo, mDTLocationInfo, &mDTLocationInfo.iEExtensions); err != nil { return err } } @@ -19788,11 +19963,11 @@ func (mDTLocationInfo *MDTLocationInfo) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsMDTLocationInfo []ap.IESpec[ProtocolIEID, MDTLocationInfo] +var extIEsMDTLocationInfo []apimpl.IESpec[ProtocolIEID, MDTLocationInfo] -func (mDTLocationInfo *MDTLocationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mDTLocationInfo *MDTLocationInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsMDTLocationInfo, mDTLocationInfo, mDTLocationInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMDTLocationInfo, mDTLocationInfo, &mDTLocationInfo.iEExtensions) return notComprehended } @@ -19825,7 +20000,7 @@ func (mDTModeNr *MDTModeNr) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, mDTModeNr.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, mDTModeNr.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -19852,7 +20027,7 @@ func (mDTModeNr *MDTModeNr) UnmarshalPER(r *per.Reader, enc per.Encoding) error } mDTModeNr.LoggedMDTNr = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -19866,20 +20041,20 @@ func (mDTModeNr *MDTModeNr) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -func (mDTModeNr *MDTModeNr) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mDTModeNr *MDTModeNr) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case mDTModeNr.ImmediateMDTNr != nil: return mDTModeNr.ImmediateMDTNr.Diagnose(d) case mDTModeNr.LoggedMDTNr != nil: return mDTModeNr.LoggedMDTNr.Diagnose(d) case mDTModeNr.ChoiceExtension != nil: - d.Unknown(mDTModeNr.ChoiceExtension.ID, mDTModeNr.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, mDTModeNr.ChoiceExtension) } return false } func (mDTcircle *MDTcircle) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMDTcircle, mDTcircle, mDTcircle.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMDTcircle, mDTcircle, mDTcircle.iEExtensions) w.WriteBit(mDTcircle.extensions.Present()) w.WriteBit(len(ext) > 0) if err := mDTcircle.Referencelocation.MarshalPER(w, enc); err != nil { @@ -19889,7 +20064,7 @@ func (mDTcircle *MDTcircle) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -19918,7 +20093,7 @@ func (mDTcircle *MDTcircle) UnmarshalPER(r *per.Reader, enc per.Encoding) error return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMDTcircle, mDTcircle, &mDTcircle.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMDTcircle, mDTcircle, &mDTcircle.iEExtensions); err != nil { return err } } @@ -19930,11 +20105,11 @@ func (mDTcircle *MDTcircle) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -var extIEsMDTcircle []ap.IESpec[ProtocolIEID, MDTcircle] +var extIEsMDTcircle []apimpl.IESpec[ProtocolIEID, MDTcircle] -func (mDTcircle *MDTcircle) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mDTcircle *MDTcircle) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsMDTcircle, mDTcircle, mDTcircle.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMDTcircle, mDTcircle, &mDTcircle.iEExtensions) return notComprehended } @@ -19955,7 +20130,7 @@ func (mICOModeIndication MICOModeIndication) Name() string { return enumMICOModeIndication.Name(mICOModeIndication) } -func (mICOModeIndication MICOModeIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mICOModeIndication MICOModeIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMICOModeIndication.Known(mICOModeIndication) } @@ -19976,7 +20151,7 @@ func (mNonlyMDTcollection MNonlyMDTcollection) Name() string { return enumMNonlyMDTcollection.Name(mNonlyMDTcollection) } -func (mNonlyMDTcollection MNonlyMDTcollection) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mNonlyMDTcollection MNonlyMDTcollection) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMNonlyMDTcollection.Known(mNonlyMDTcollection) } @@ -20009,7 +20184,7 @@ func (mRBProgressInformation *MRBProgressInformation) MarshalPER(w *per.Writer, if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, mRBProgressInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, mRBProgressInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -20036,7 +20211,7 @@ func (mRBProgressInformation *MRBProgressInformation) UnmarshalPER(r *per.Reader } mRBProgressInformation.PDCPSNLength18 = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -20050,12 +20225,12 @@ func (mRBProgressInformation *MRBProgressInformation) UnmarshalPER(r *per.Reader return nil } -func (mRBProgressInformation *MRBProgressInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mRBProgressInformation *MRBProgressInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case mRBProgressInformation.PDCPSNLength12 != nil: case mRBProgressInformation.PDCPSNLength18 != nil: case mRBProgressInformation.ChoiceExtension != nil: - d.Unknown(mRBProgressInformation.ChoiceExtension.ID, mRBProgressInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, mRBProgressInformation.ChoiceExtension) } return false } @@ -20077,7 +20252,7 @@ func (maximumIntegrityProtectedDataRate MaximumIntegrityProtectedDataRate) Name( return enumMaximumIntegrityProtectedDataRate.Name(maximumIntegrityProtectedDataRate) } -func (maximumIntegrityProtectedDataRate MaximumIntegrityProtectedDataRate) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (maximumIntegrityProtectedDataRate MaximumIntegrityProtectedDataRate) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMaximumIntegrityProtectedDataRate.Known(maximumIntegrityProtectedDataRate) } @@ -20110,7 +20285,7 @@ func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) MarshalP if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, measurementThresholdL1LoggedMDT.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, measurementThresholdL1LoggedMDT.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -20137,7 +20312,7 @@ func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) Unmarsha } measurementThresholdL1LoggedMDT.ThresholdRSRQ = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -20151,12 +20326,12 @@ func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) Unmarsha return nil } -func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (measurementThresholdL1LoggedMDT *MeasurementThresholdL1LoggedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case measurementThresholdL1LoggedMDT.ThresholdRSRP != nil: case measurementThresholdL1LoggedMDT.ThresholdRSRQ != nil: case measurementThresholdL1LoggedMDT.ChoiceExtension != nil: - d.Unknown(measurementThresholdL1LoggedMDT.ChoiceExtension.ID, measurementThresholdL1LoggedMDT.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, measurementThresholdL1LoggedMDT.ChoiceExtension) } return false } @@ -20178,7 +20353,7 @@ func (micoAllPLMN MicoAllPLMN) Name() string { return enumMicoAllPLMN.Name(micoAllPLMN) } -func (micoAllPLMN MicoAllPLMN) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (micoAllPLMN MicoAllPLMN) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMicoAllPLMN.Known(micoAllPLMN) } @@ -20199,12 +20374,12 @@ func (mobileIABAuthorized MobileIABAuthorized) Name() string { return enumMobileIABAuthorized.Name(mobileIABAuthorized) } -func (mobileIABAuthorized MobileIABAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mobileIABAuthorized MobileIABAuthorized) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMobileIABAuthorized.Known(mobileIABAuthorized) } func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation.iEExtensions) w.WriteBit(mobileIABMTUserLocationInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := mobileIABMTUserLocationInformation.NRCGI.MarshalPER(w, enc); err != nil { @@ -20214,7 +20389,7 @@ func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) Ma return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -20243,7 +20418,7 @@ func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) Un return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, &mobileIABMTUserLocationInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, &mobileIABMTUserLocationInformation.iEExtensions); err != nil { return err } } @@ -20255,9 +20430,9 @@ func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) Un return nil } -var extIEsMobileIABMTUserLocationInformation []ap.IESpec[ProtocolIEID, MobileIABMTUserLocationInformation] +var extIEsMobileIABMTUserLocationInformation []apimpl.IESpec[ProtocolIEID, MobileIABMTUserLocationInformation] -func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mobileIABMTUserLocationInformation.NRCGI.Diagnose(d) { notComprehended = true @@ -20265,7 +20440,7 @@ func (mobileIABMTUserLocationInformation *MobileIABMTUserLocationInformation) Di if mobileIABMTUserLocationInformation.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMobileIABMTUserLocationInformation, mobileIABMTUserLocationInformation, &mobileIABMTUserLocationInformation.iEExtensions) return notComprehended } @@ -20286,7 +20461,7 @@ func (mobileIABNodeIndication MobileIABNodeIndication) Name() string { return enumMobileIABNodeIndication.Name(mobileIABNodeIndication) } -func (mobileIABNodeIndication MobileIABNodeIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mobileIABNodeIndication MobileIABNodeIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMobileIABNodeIndication.Known(mobileIABNodeIndication) } @@ -20307,12 +20482,12 @@ func (mobileIABSupported MobileIABSupported) Name() string { return enumMobileIABSupported.Name(mobileIABSupported) } -func (mobileIABSupported MobileIABSupported) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (mobileIABSupported MobileIABSupported) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMobileIABSupported.Known(mobileIABSupported) } func (mobilityRestrictionList *MobilityRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMobilityRestrictionList, mobilityRestrictionList, mobilityRestrictionList.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMobilityRestrictionList, mobilityRestrictionList, mobilityRestrictionList.iEExtensions) w.WriteBit(mobilityRestrictionList.extensions.Present()) w.WriteBit(mobilityRestrictionList.EquivalentPLMNs != nil) w.WriteBit(mobilityRestrictionList.RATRestrictions != nil) @@ -20343,7 +20518,7 @@ func (mobilityRestrictionList *MobilityRestrictionList) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -20405,7 +20580,7 @@ func (mobilityRestrictionList *MobilityRestrictionList) UnmarshalPER(r *per.Read } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMobilityRestrictionList, mobilityRestrictionList, &mobilityRestrictionList.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMobilityRestrictionList, mobilityRestrictionList, &mobilityRestrictionList.iEExtensions); err != nil { return err } } @@ -20417,11 +20592,11 @@ func (mobilityRestrictionList *MobilityRestrictionList) UnmarshalPER(r *per.Read return nil } -var extIEsMobilityRestrictionList = []ap.IESpec[ProtocolIEID, MobilityRestrictionList]{ +var extIEsMobilityRestrictionList = []apimpl.IESpec[ProtocolIEID, MobilityRestrictionList]{ { ID: IDLastEUTRANPLMNIdentity, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { var v PLMNIdentity if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -20436,11 +20611,14 @@ var extIEsMobilityRestrictionList = []ap.IESpec[ProtocolIEID, MobilityRestrictio } return x.LastEUTRANPLMNIdentity, true }, + Clear: func(x *MobilityRestrictionList) { + x.LastEUTRANPLMNIdentity = nil + }, }, { ID: IDCNTypeRestrictionsForServing, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { var v CNTypeRestrictionsForServing if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -20455,11 +20633,14 @@ var extIEsMobilityRestrictionList = []ap.IESpec[ProtocolIEID, MobilityRestrictio } return x.CNTypeRestrictionsForServing, true }, + Clear: func(x *MobilityRestrictionList) { + x.CNTypeRestrictionsForServing = nil + }, }, { ID: IDCNTypeRestrictionsForEquivalent, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { var v CNTypeRestrictionsForEquivalent if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -20474,11 +20655,14 @@ var extIEsMobilityRestrictionList = []ap.IESpec[ProtocolIEID, MobilityRestrictio } return x.CNTypeRestrictionsForEquivalent, true }, + Clear: func(x *MobilityRestrictionList) { + x.CNTypeRestrictionsForEquivalent = nil + }, }, { ID: IDNPNMobilityInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *MobilityRestrictionList, r *per.Reader, enc per.Encoding) error { var v NPNMobilityInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -20493,10 +20677,13 @@ var extIEsMobilityRestrictionList = []ap.IESpec[ProtocolIEID, MobilityRestrictio } return x.NPNMobilityInformation, true }, + Clear: func(x *MobilityRestrictionList) { + x.NPNMobilityInformation = nil + }, }, } -func (mobilityRestrictionList *MobilityRestrictionList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mobilityRestrictionList *MobilityRestrictionList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if mobilityRestrictionList.RATRestrictions.Diagnose(d) { notComprehended = true @@ -20507,7 +20694,7 @@ func (mobilityRestrictionList *MobilityRestrictionList) Diagnose(d *ap.Diagnosis if mobilityRestrictionList.ServiceAreaInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMobilityRestrictionList, mobilityRestrictionList, mobilityRestrictionList.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMobilityRestrictionList, mobilityRestrictionList, &mobilityRestrictionList.iEExtensions) return notComprehended } @@ -20528,12 +20715,12 @@ func (monitoringRequest MonitoringRequest) Name() string { return enumMonitoringRequest.Name(monitoringRequest) } -func (monitoringRequest MonitoringRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (monitoringRequest MonitoringRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumMonitoringRequest.Known(monitoringRequest) } func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate.iEExtensions) + ext := apimpl.ExtensionFields(extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate.iEExtensions) w.WriteBit(monitoringRequestonAvailableBitrate.extensions.Present()) w.WriteBit(monitoringRequestonAvailableBitrate.DlAvailableBitrateReportThresholds != nil) w.WriteBit(monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds != nil) @@ -20552,7 +20739,7 @@ func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -20596,7 +20783,7 @@ func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, &monitoringRequestonAvailableBitrate.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, &monitoringRequestonAvailableBitrate.iEExtensions); err != nil { return err } } @@ -20608,9 +20795,9 @@ func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) return nil } -var extIEsMonitoringRequestonAvailableBitrate []ap.IESpec[ProtocolIEID, MonitoringRequestonAvailableBitrate] +var extIEsMonitoringRequestonAvailableBitrate []apimpl.IESpec[ProtocolIEID, MonitoringRequestonAvailableBitrate] -func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if monitoringRequestonAvailableBitrate.MonitoringRequest.Diagnose(d) { notComprehended = true @@ -20621,7 +20808,7 @@ func (monitoringRequestonAvailableBitrate *MonitoringRequestonAvailableBitrate) if monitoringRequestonAvailableBitrate.UlAvailableBitrateReportThresholds.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsMonitoringRequestonAvailableBitrate, monitoringRequestonAvailableBitrate, &monitoringRequestonAvailableBitrate.iEExtensions) return notComprehended } @@ -20647,7 +20834,7 @@ func (n3IWFID *N3IWFID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, n3IWFID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, n3IWFID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -20668,7 +20855,7 @@ func (n3IWFID *N3IWFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } n3IWFID.N3IWFID = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -20682,17 +20869,17 @@ func (n3IWFID *N3IWFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (n3IWFID *N3IWFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (n3IWFID *N3IWFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case n3IWFID.N3IWFID != nil: case n3IWFID.ChoiceExtension != nil: - d.Unknown(n3IWFID.ChoiceExtension.ID, n3IWFID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, n3IWFID.ChoiceExtension) } return false } func (n6JitterInformation *N6JitterInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsN6JitterInformation, n6JitterInformation, n6JitterInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsN6JitterInformation, n6JitterInformation, n6JitterInformation.iEExtensions) w.WriteBit(n6JitterInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := n6JitterInformation.N6JitterLowerBound.MarshalPER(w, enc); err != nil { @@ -20702,7 +20889,7 @@ func (n6JitterInformation *N6JitterInformation) MarshalPER(w *per.Writer, enc pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -20731,7 +20918,7 @@ func (n6JitterInformation *N6JitterInformation) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsN6JitterInformation, n6JitterInformation, &n6JitterInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsN6JitterInformation, n6JitterInformation, &n6JitterInformation.iEExtensions); err != nil { return err } } @@ -20743,11 +20930,11 @@ func (n6JitterInformation *N6JitterInformation) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsN6JitterInformation []ap.IESpec[ProtocolIEID, N6JitterInformation] +var extIEsN6JitterInformation []apimpl.IESpec[ProtocolIEID, N6JitterInformation] -func (n6JitterInformation *N6JitterInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (n6JitterInformation *N6JitterInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsN6JitterInformation, n6JitterInformation, n6JitterInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsN6JitterInformation, n6JitterInformation, &n6JitterInformation.iEExtensions) return notComprehended } @@ -20768,7 +20955,7 @@ func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) Name() string { return enumNBIoTDefaultPagingDRX.Name(nBIoTDefaultPagingDRX) } -func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNBIoTDefaultPagingDRX.Known(nBIoTDefaultPagingDRX) } @@ -20789,7 +20976,7 @@ func (nBIoTPagingDRX NBIoTPagingDRX) Name() string { return enumNBIoTPagingDRX.Name(nBIoTPagingDRX) } -func (nBIoTPagingDRX NBIoTPagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nBIoTPagingDRX NBIoTPagingDRX) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNBIoTPagingDRX.Known(nBIoTPagingDRX) } @@ -20810,7 +20997,7 @@ func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) Name() string { return enumNBIoTPagingTimeWindow.Name(nBIoTPagingTimeWindow) } -func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNBIoTPagingTimeWindow.Known(nBIoTPagingTimeWindow) } @@ -20831,12 +21018,12 @@ func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) Name() string { return enumNBIoTPagingeDRXCycle.Name(nBIoTPagingeDRXCycle) } -func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNBIoTPagingeDRXCycle.Known(nBIoTPagingeDRXCycle) } func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo.iEExtensions) w.WriteBit(nBIoTPagingeDRXInfo.extensions.Present()) w.WriteBit(nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow != nil) w.WriteBit(len(ext) > 0) @@ -20849,7 +21036,7 @@ func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -20886,7 +21073,7 @@ func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) UnmarshalPER(r *per.Reader, enc nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, &nBIoTPagingeDRXInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, &nBIoTPagingeDRXInfo.iEExtensions); err != nil { return err } } @@ -20898,9 +21085,9 @@ func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsNBIoTPagingeDRXInfo []ap.IESpec[ProtocolIEID, NBIoTPagingeDRXInfo] +var extIEsNBIoTPagingeDRXInfo []apimpl.IESpec[ProtocolIEID, NBIoTPagingeDRXInfo] -func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nBIoTPagingeDRXInfo.NBIoTPagingeDRXCycle.Diagnose(d) { notComprehended = true @@ -20908,19 +21095,19 @@ func (nBIoTPagingeDRXInfo *NBIoTPagingeDRXInfo) Diagnose(d *ap.Diagnosis[Protoco if nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow != nil && nBIoTPagingeDRXInfo.NBIoTPagingTimeWindow.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNBIoTPagingeDRXInfo, nBIoTPagingeDRXInfo, &nBIoTPagingeDRXInfo.iEExtensions) return notComprehended } func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem.iEExtensions) w.WriteBit(nGAPIESupportInformationRequestItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{}, int64(nGAPIESupportInformationRequestItem.NgapProtocolIEId)); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -20948,7 +21135,7 @@ func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) } nGAPIESupportInformationRequestItem.NgapProtocolIEId = ProtocolIEID(n0) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, &nGAPIESupportInformationRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, &nGAPIESupportInformationRequestItem.iEExtensions); err != nil { return err } } @@ -20960,11 +21147,11 @@ func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) return nil } -var extIEsNGAPIESupportInformationRequestItem []ap.IESpec[ProtocolIEID, NGAPIESupportInformationRequestItem] +var extIEsNGAPIESupportInformationRequestItem []apimpl.IESpec[ProtocolIEID, NGAPIESupportInformationRequestItem] -func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGAPIESupportInformationRequestItem *NGAPIESupportInformationRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNGAPIESupportInformationRequestItem, nGAPIESupportInformationRequestItem, &nGAPIESupportInformationRequestItem.iEExtensions) return notComprehended } @@ -20997,7 +21184,7 @@ func (nGRANCGI *NGRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, nGRANCGI.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, nGRANCGI.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -21024,7 +21211,7 @@ func (nGRANCGI *NGRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } nGRANCGI.EUTRACGI = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -21038,20 +21225,20 @@ func (nGRANCGI *NGRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (nGRANCGI *NGRANCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANCGI *NGRANCGI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case nGRANCGI.NRCGI != nil: return nGRANCGI.NRCGI.Diagnose(d) case nGRANCGI.EUTRACGI != nil: return nGRANCGI.EUTRACGI.Diagnose(d) case nGRANCGI.ChoiceExtension != nil: - d.Unknown(nGRANCGI.ChoiceExtension.ID, nGRANCGI.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, nGRANCGI.ChoiceExtension) } return false } func (nGRANCellReportItem *NGRANCellReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNGRANCellReportItem, nGRANCellReportItem, nGRANCellReportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNGRANCellReportItem, nGRANCellReportItem, nGRANCellReportItem.iEExtensions) w.WriteBit(nGRANCellReportItem.extensions.Present()) w.WriteBit(nGRANCellReportItem.NGRANNumberOfActiveUEs != nil) w.WriteBit(nGRANCellReportItem.NGRANNoofRRCConnections != nil) @@ -21079,7 +21266,7 @@ func (nGRANCellReportItem *NGRANCellReportItem) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21141,7 +21328,7 @@ func (nGRANCellReportItem *NGRANCellReportItem) UnmarshalPER(r *per.Reader, enc nGRANCellReportItem.NGRANRadioResourceStatus = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANCellReportItem, nGRANCellReportItem, &nGRANCellReportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNGRANCellReportItem, nGRANCellReportItem, &nGRANCellReportItem.iEExtensions); err != nil { return err } } @@ -21153,9 +21340,9 @@ func (nGRANCellReportItem *NGRANCellReportItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsNGRANCellReportItem []ap.IESpec[ProtocolIEID, NGRANCellReportItem] +var extIEsNGRANCellReportItem []apimpl.IESpec[ProtocolIEID, NGRANCellReportItem] -func (nGRANCellReportItem *NGRANCellReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANCellReportItem *NGRANCellReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nGRANCellReportItem.NGRANCGI.Diagnose(d) { notComprehended = true @@ -21172,19 +21359,19 @@ func (nGRANCellReportItem *NGRANCellReportItem) Diagnose(d *ap.Diagnosis[Protoco if nGRANCellReportItem.NGRANRadioResourceStatus != nil && nGRANCellReportItem.NGRANRadioResourceStatus.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNGRANCellReportItem, nGRANCellReportItem, nGRANCellReportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNGRANCellReportItem, nGRANCellReportItem, &nGRANCellReportItem.iEExtensions) return notComprehended } func (nGRANCellToReportItem *NGRANCellToReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNGRANCellToReportItem, nGRANCellToReportItem, nGRANCellToReportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNGRANCellToReportItem, nGRANCellToReportItem, nGRANCellToReportItem.iEExtensions) w.WriteBit(nGRANCellToReportItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nGRANCellToReportItem.NGRANCGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21210,7 +21397,7 @@ func (nGRANCellToReportItem *NGRANCellToReportItem) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANCellToReportItem, nGRANCellToReportItem, &nGRANCellToReportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNGRANCellToReportItem, nGRANCellToReportItem, &nGRANCellToReportItem.iEExtensions); err != nil { return err } } @@ -21222,19 +21409,19 @@ func (nGRANCellToReportItem *NGRANCellToReportItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsNGRANCellToReportItem []ap.IESpec[ProtocolIEID, NGRANCellToReportItem] +var extIEsNGRANCellToReportItem []apimpl.IESpec[ProtocolIEID, NGRANCellToReportItem] -func (nGRANCellToReportItem *NGRANCellToReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANCellToReportItem *NGRANCellToReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nGRANCellToReportItem.NGRANCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNGRANCellToReportItem, nGRANCellToReportItem, nGRANCellToReportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNGRANCellToReportItem, nGRANCellToReportItem, &nGRANCellToReportItem.iEExtensions) return notComprehended } func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, nGRANRadioResourceStatus.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, nGRANRadioResourceStatus.iEExtensions) w.WriteBit(nGRANRadioResourceStatus.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nGRANRadioResourceStatus.DLGBRPRBusageforMIMO.MarshalPER(w, enc); err != nil { @@ -21256,7 +21443,7 @@ func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21297,7 +21484,7 @@ func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, &nGRANRadioResourceStatus.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, &nGRANRadioResourceStatus.iEExtensions); err != nil { return err } } @@ -21309,23 +21496,23 @@ func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) UnmarshalPER(r *per.Re return nil } -var extIEsNGRANRadioResourceStatus []ap.IESpec[ProtocolIEID, NGRANRadioResourceStatus] +var extIEsNGRANRadioResourceStatus []apimpl.IESpec[ProtocolIEID, NGRANRadioResourceStatus] -func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANRadioResourceStatus *NGRANRadioResourceStatus) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, nGRANRadioResourceStatus.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNGRANRadioResourceStatus, nGRANRadioResourceStatus, &nGRANRadioResourceStatus.iEExtensions) return notComprehended } func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, nGRANReportingStatusIEs.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, nGRANReportingStatusIEs.iEExtensions) w.WriteBit(nGRANReportingStatusIEs.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nGRANReportingStatusIEs.NGRANCellReportList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21351,7 +21538,7 @@ func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, &nGRANReportingStatusIEs.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, &nGRANReportingStatusIEs.iEExtensions); err != nil { return err } } @@ -21363,26 +21550,26 @@ func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) UnmarshalPER(r *per.Read return nil } -var extIEsNGRANReportingStatusIEs []ap.IESpec[ProtocolIEID, NGRANReportingStatusIEs] +var extIEsNGRANReportingStatusIEs []apimpl.IESpec[ProtocolIEID, NGRANReportingStatusIEs] -func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANReportingStatusIEs *NGRANReportingStatusIEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nGRANReportingStatusIEs.NGRANCellReportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, nGRANReportingStatusIEs.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNGRANReportingStatusIEs, nGRANReportingStatusIEs, &nGRANReportingStatusIEs.iEExtensions) return notComprehended } func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, nGRANReportingSystemIEs.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, nGRANReportingSystemIEs.iEExtensions) w.WriteBit(nGRANReportingSystemIEs.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nGRANReportingSystemIEs.NGRANCellToReportList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21408,7 +21595,7 @@ func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, &nGRANReportingSystemIEs.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, &nGRANReportingSystemIEs.iEExtensions); err != nil { return err } } @@ -21420,19 +21607,19 @@ func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) UnmarshalPER(r *per.Read return nil } -var extIEsNGRANReportingSystemIEs []ap.IESpec[ProtocolIEID, NGRANReportingSystemIEs] +var extIEsNGRANReportingSystemIEs []apimpl.IESpec[ProtocolIEID, NGRANReportingSystemIEs] -func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANReportingSystemIEs *NGRANReportingSystemIEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nGRANReportingSystemIEs.NGRANCellToReportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, nGRANReportingSystemIEs.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNGRANReportingSystemIEs, nGRANReportingSystemIEs, &nGRANReportingSystemIEs.iEExtensions) return notComprehended } func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem.iEExtensions) w.WriteBit(nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil) w.WriteBit(len(ext) > 0) if err := nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.MarshalPER(w, enc); err != nil { @@ -21444,7 +21631,7 @@ func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) MarshalP } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21472,16 +21659,16 @@ func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) Unmarsha nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, &nGRANTNLAssociationToRemoveItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, &nGRANTNLAssociationToRemoveItem.iEExtensions); err != nil { return err } } return nil } -var extIEsNGRANTNLAssociationToRemoveItem []ap.IESpec[ProtocolIEID, NGRANTNLAssociationToRemoveItem] +var extIEsNGRANTNLAssociationToRemoveItem []apimpl.IESpec[ProtocolIEID, NGRANTNLAssociationToRemoveItem] -func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddress.Diagnose(d) { notComprehended = true @@ -21489,7 +21676,7 @@ func (nGRANTNLAssociationToRemoveItem *NGRANTNLAssociationToRemoveItem) Diagnose if nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF != nil && nGRANTNLAssociationToRemoveItem.TNLAssociationTransportLayerAddressAMF.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNGRANTNLAssociationToRemoveItem, nGRANTNLAssociationToRemoveItem, &nGRANTNLAssociationToRemoveItem.iEExtensions) return notComprehended } @@ -21515,7 +21702,7 @@ func (nPNAccessInformation *NPNAccessInformation) MarshalPER(w *per.Writer, enc if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, nPNAccessInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, nPNAccessInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -21536,7 +21723,7 @@ func (nPNAccessInformation *NPNAccessInformation) UnmarshalPER(r *per.Reader, en } nPNAccessInformation.PNINPNAccessInformation = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -21550,11 +21737,11 @@ func (nPNAccessInformation *NPNAccessInformation) UnmarshalPER(r *per.Reader, en return nil } -func (nPNAccessInformation *NPNAccessInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nPNAccessInformation *NPNAccessInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case nPNAccessInformation.PNINPNAccessInformation != nil: case nPNAccessInformation.ChoiceExtension != nil: - d.Unknown(nPNAccessInformation.ChoiceExtension.ID, nPNAccessInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, nPNAccessInformation.ChoiceExtension) } return false } @@ -21588,7 +21775,7 @@ func (nPNMobilityInformation *NPNMobilityInformation) MarshalPER(w *per.Writer, if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, nPNMobilityInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, nPNMobilityInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -21615,7 +21802,7 @@ func (nPNMobilityInformation *NPNMobilityInformation) UnmarshalPER(r *per.Reader } nPNMobilityInformation.PNINPNMobilityInformation = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -21629,14 +21816,14 @@ func (nPNMobilityInformation *NPNMobilityInformation) UnmarshalPER(r *per.Reader return nil } -func (nPNMobilityInformation *NPNMobilityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nPNMobilityInformation *NPNMobilityInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case nPNMobilityInformation.SNPNMobilityInformation != nil: return nPNMobilityInformation.SNPNMobilityInformation.Diagnose(d) case nPNMobilityInformation.PNINPNMobilityInformation != nil: return nPNMobilityInformation.PNINPNMobilityInformation.Diagnose(d) case nPNMobilityInformation.ChoiceExtension != nil: - d.Unknown(nPNMobilityInformation.ChoiceExtension.ID, nPNMobilityInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, nPNMobilityInformation.ChoiceExtension) } return false } @@ -21663,7 +21850,7 @@ func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) MarshalPER if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, nPNPagingAssistanceInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, nPNPagingAssistanceInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -21684,7 +21871,7 @@ func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) UnmarshalP } nPNPagingAssistanceInformation.PNINPNPagingAssistance = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -21698,12 +21885,12 @@ func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) UnmarshalP return nil } -func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nPNPagingAssistanceInformation *NPNPagingAssistanceInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case nPNPagingAssistanceInformation.PNINPNPagingAssistance != nil: return nPNPagingAssistanceInformation.PNINPNPagingAssistance.Diagnose(d) case nPNPagingAssistanceInformation.ChoiceExtension != nil: - d.Unknown(nPNPagingAssistanceInformation.ChoiceExtension.ID, nPNPagingAssistanceInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, nPNPagingAssistanceInformation.ChoiceExtension) } return false } @@ -21730,7 +21917,7 @@ func (nPNSupport *NPNSupport) MarshalPER(w *per.Writer, enc per.Encoding) error if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, nPNSupport.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, nPNSupport.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -21751,7 +21938,7 @@ func (nPNSupport *NPNSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) erro } nPNSupport.SNPN = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -21765,17 +21952,17 @@ func (nPNSupport *NPNSupport) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -func (nPNSupport *NPNSupport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nPNSupport *NPNSupport) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case nPNSupport.SNPN != nil: case nPNSupport.ChoiceExtension != nil: - d.Unknown(nPNSupport.ChoiceExtension.ID, nPNSupport.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, nPNSupport.ChoiceExtension) } return false } func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, nRA2XServicesAuthorized.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, nRA2XServicesAuthorized.iEExtensions) w.WriteBit(nRA2XServicesAuthorized.extensions.Present()) w.WriteBit(nRA2XServicesAuthorized.AerialUE != nil) w.WriteBit(nRA2XServicesAuthorized.AerialControllerUE != nil) @@ -21791,7 +21978,7 @@ func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21836,7 +22023,7 @@ func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) UnmarshalPER(r *per.Read nRA2XServicesAuthorized.AerialControllerUE = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, &nRA2XServicesAuthorized.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, &nRA2XServicesAuthorized.iEExtensions); err != nil { return err } } @@ -21848,9 +22035,9 @@ func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) UnmarshalPER(r *per.Read return nil } -var extIEsNRA2XServicesAuthorized []ap.IESpec[ProtocolIEID, NRA2XServicesAuthorized] +var extIEsNRA2XServicesAuthorized []apimpl.IESpec[ProtocolIEID, NRA2XServicesAuthorized] -func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nRA2XServicesAuthorized.AerialUE != nil && nRA2XServicesAuthorized.AerialUE.Diagnose(d) { notComprehended = true @@ -21858,7 +22045,7 @@ func (nRA2XServicesAuthorized *NRA2XServicesAuthorized) Diagnose(d *ap.Diagnosis if nRA2XServicesAuthorized.AerialControllerUE != nil && nRA2XServicesAuthorized.AerialControllerUE.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, nRA2XServicesAuthorized.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRA2XServicesAuthorized, nRA2XServicesAuthorized, &nRA2XServicesAuthorized.iEExtensions) return notComprehended } @@ -21879,7 +22066,7 @@ func (nRA2XServicesAuthorizedAerialControllerUE NRA2XServicesAuthorizedAerialCon return enumNRA2XServicesAuthorizedAerialControllerUE.Name(nRA2XServicesAuthorizedAerialControllerUE) } -func (nRA2XServicesAuthorizedAerialControllerUE NRA2XServicesAuthorizedAerialControllerUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nRA2XServicesAuthorizedAerialControllerUE NRA2XServicesAuthorizedAerialControllerUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNRA2XServicesAuthorizedAerialControllerUE.Known(nRA2XServicesAuthorizedAerialControllerUE) } @@ -21900,12 +22087,12 @@ func (nRA2XServicesAuthorizedAerialUE NRA2XServicesAuthorizedAerialUE) Name() st return enumNRA2XServicesAuthorizedAerialUE.Name(nRA2XServicesAuthorizedAerialUE) } -func (nRA2XServicesAuthorizedAerialUE NRA2XServicesAuthorizedAerialUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nRA2XServicesAuthorizedAerialUE NRA2XServicesAuthorizedAerialUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNRA2XServicesAuthorizedAerialUE.Known(nRA2XServicesAuthorizedAerialUE) } func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRCGI, nRCGI, nRCGI.iEExtensions) w.WriteBit(nRCGI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nRCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -21915,7 +22102,7 @@ func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21944,7 +22131,7 @@ func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions); err != nil { return err } } @@ -21956,23 +22143,23 @@ func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsNRCGI []ap.IESpec[ProtocolIEID, NRCGI] +var extIEsNRCGI []apimpl.IESpec[ProtocolIEID, NRCGI] -func (nRCGI *NRCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRCGI *NRCGI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions) return notComprehended } func (nRFrequencyBandItem *NRFrequencyBandItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRFrequencyBandItem, nRFrequencyBandItem, nRFrequencyBandItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRFrequencyBandItem, nRFrequencyBandItem, nRFrequencyBandItem.iEExtensions) w.WriteBit(nRFrequencyBandItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nRFrequencyBandItem.Nrfrequencyband.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -21998,7 +22185,7 @@ func (nRFrequencyBandItem *NRFrequencyBandItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRFrequencyBandItem, nRFrequencyBandItem, &nRFrequencyBandItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRFrequencyBandItem, nRFrequencyBandItem, &nRFrequencyBandItem.iEExtensions); err != nil { return err } } @@ -22010,19 +22197,19 @@ func (nRFrequencyBandItem *NRFrequencyBandItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsNRFrequencyBandItem []ap.IESpec[ProtocolIEID, NRFrequencyBandItem] +var extIEsNRFrequencyBandItem []apimpl.IESpec[ProtocolIEID, NRFrequencyBandItem] -func (nRFrequencyBandItem *NRFrequencyBandItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRFrequencyBandItem *NRFrequencyBandItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nRFrequencyBandItem.Nrfrequencyband.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNRFrequencyBandItem, nRFrequencyBandItem, nRFrequencyBandItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRFrequencyBandItem, nRFrequencyBandItem, &nRFrequencyBandItem.iEExtensions) return notComprehended } func (nRFrequencyInfo *NRFrequencyInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRFrequencyInfo, nRFrequencyInfo, nRFrequencyInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRFrequencyInfo, nRFrequencyInfo, nRFrequencyInfo.iEExtensions) w.WriteBit(nRFrequencyInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nRFrequencyInfo.NrARFCN.MarshalPER(w, enc); err != nil { @@ -22032,7 +22219,7 @@ func (nRFrequencyInfo *NRFrequencyInfo) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22061,7 +22248,7 @@ func (nRFrequencyInfo *NRFrequencyInfo) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRFrequencyInfo, nRFrequencyInfo, &nRFrequencyInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRFrequencyInfo, nRFrequencyInfo, &nRFrequencyInfo.iEExtensions); err != nil { return err } } @@ -22073,19 +22260,19 @@ func (nRFrequencyInfo *NRFrequencyInfo) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsNRFrequencyInfo []ap.IESpec[ProtocolIEID, NRFrequencyInfo] +var extIEsNRFrequencyInfo []apimpl.IESpec[ProtocolIEID, NRFrequencyInfo] -func (nRFrequencyInfo *NRFrequencyInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRFrequencyInfo *NRFrequencyInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nRFrequencyInfo.FrequencyBandList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNRFrequencyInfo, nRFrequencyInfo, nRFrequencyInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRFrequencyInfo, nRFrequencyInfo, &nRFrequencyInfo.iEExtensions) return notComprehended } func (nRNTNTAIInformation *NRNTNTAIInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRNTNTAIInformation, nRNTNTAIInformation, nRNTNTAIInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRNTNTAIInformation, nRNTNTAIInformation, nRNTNTAIInformation.iEExtensions) w.WriteBit(nRNTNTAIInformation.extensions.Present()) w.WriteBit(nRNTNTAIInformation.UELocationDerivedTACInNRNTN != nil) w.WriteBit(len(ext) > 0) @@ -22101,7 +22288,7 @@ func (nRNTNTAIInformation *NRNTNTAIInformation) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22141,7 +22328,7 @@ func (nRNTNTAIInformation *NRNTNTAIInformation) UnmarshalPER(r *per.Reader, enc nRNTNTAIInformation.UELocationDerivedTACInNRNTN = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRNTNTAIInformation, nRNTNTAIInformation, &nRNTNTAIInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRNTNTAIInformation, nRNTNTAIInformation, &nRNTNTAIInformation.iEExtensions); err != nil { return err } } @@ -22153,11 +22340,11 @@ func (nRNTNTAIInformation *NRNTNTAIInformation) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsNRNTNTAIInformation []ap.IESpec[ProtocolIEID, NRNTNTAIInformation] +var extIEsNRNTNTAIInformation []apimpl.IESpec[ProtocolIEID, NRNTNTAIInformation] -func (nRNTNTAIInformation *NRNTNTAIInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRNTNTAIInformation *NRNTNTAIInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsNRNTNTAIInformation, nRNTNTAIInformation, nRNTNTAIInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRNTNTAIInformation, nRNTNTAIInformation, &nRNTNTAIInformation.iEExtensions) return notComprehended } @@ -22178,7 +22365,7 @@ func (nRPagingTimeWindow NRPagingTimeWindow) Name() string { return enumNRPagingTimeWindow.Name(nRPagingTimeWindow) } -func (nRPagingTimeWindow NRPagingTimeWindow) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nRPagingTimeWindow NRPagingTimeWindow) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNRPagingTimeWindow.Known(nRPagingTimeWindow) } @@ -22199,12 +22386,12 @@ func (nRPagingeDRXCycle NRPagingeDRXCycle) Name() string { return enumNRPagingeDRXCycle.Name(nRPagingeDRXCycle) } -func (nRPagingeDRXCycle NRPagingeDRXCycle) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nRPagingeDRXCycle NRPagingeDRXCycle) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNRPagingeDRXCycle.Known(nRPagingeDRXCycle) } func (nRPagingeDRXInformation *NRPagingeDRXInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, nRPagingeDRXInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, nRPagingeDRXInformation.iEExtensions) w.WriteBit(nRPagingeDRXInformation.extensions.Present()) w.WriteBit(nRPagingeDRXInformation.NRpagingTimeWindow != nil) w.WriteBit(len(ext) > 0) @@ -22217,7 +22404,7 @@ func (nRPagingeDRXInformation *NRPagingeDRXInformation) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22254,7 +22441,7 @@ func (nRPagingeDRXInformation *NRPagingeDRXInformation) UnmarshalPER(r *per.Read nRPagingeDRXInformation.NRpagingTimeWindow = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, &nRPagingeDRXInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, &nRPagingeDRXInformation.iEExtensions); err != nil { return err } } @@ -22266,9 +22453,9 @@ func (nRPagingeDRXInformation *NRPagingeDRXInformation) UnmarshalPER(r *per.Read return nil } -var extIEsNRPagingeDRXInformation []ap.IESpec[ProtocolIEID, NRPagingeDRXInformation] +var extIEsNRPagingeDRXInformation []apimpl.IESpec[ProtocolIEID, NRPagingeDRXInformation] -func (nRPagingeDRXInformation *NRPagingeDRXInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRPagingeDRXInformation *NRPagingeDRXInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nRPagingeDRXInformation.NRpagingeDRXCycle.Diagnose(d) { notComprehended = true @@ -22276,19 +22463,19 @@ func (nRPagingeDRXInformation *NRPagingeDRXInformation) Diagnose(d *ap.Diagnosis if nRPagingeDRXInformation.NRpagingTimeWindow != nil && nRPagingeDRXInformation.NRpagingTimeWindow.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, nRPagingeDRXInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRPagingeDRXInformation, nRPagingeDRXInformation, &nRPagingeDRXInformation.iEExtensions) return notComprehended } func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate.iEExtensions) w.WriteBit(nRUESidelinkAggregateMaximumBitrate.extensions.Present()) w.WriteBit(len(ext) > 0) if err := nRUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22314,7 +22501,7 @@ func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, &nRUESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, &nRUESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { return err } } @@ -22326,19 +22513,19 @@ func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) return nil } -var extIEsNRUESidelinkAggregateMaximumBitrate []ap.IESpec[ProtocolIEID, NRUESidelinkAggregateMaximumBitrate] +var extIEsNRUESidelinkAggregateMaximumBitrate []apimpl.IESpec[ProtocolIEID, NRUESidelinkAggregateMaximumBitrate] -func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nRUESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, &nRUESidelinkAggregateMaximumBitrate.iEExtensions) return notComprehended } func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, nRV2XServicesAuthorized.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, nRV2XServicesAuthorized.iEExtensions) w.WriteBit(nRV2XServicesAuthorized.extensions.Present()) w.WriteBit(nRV2XServicesAuthorized.VehicleUE != nil) w.WriteBit(nRV2XServicesAuthorized.PedestrianUE != nil) @@ -22354,7 +22541,7 @@ func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22399,7 +22586,7 @@ func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) UnmarshalPER(r *per.Read nRV2XServicesAuthorized.PedestrianUE = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, &nRV2XServicesAuthorized.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, &nRV2XServicesAuthorized.iEExtensions); err != nil { return err } } @@ -22411,9 +22598,9 @@ func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) UnmarshalPER(r *per.Read return nil } -var extIEsNRV2XServicesAuthorized []ap.IESpec[ProtocolIEID, NRV2XServicesAuthorized] +var extIEsNRV2XServicesAuthorized []apimpl.IESpec[ProtocolIEID, NRV2XServicesAuthorized] -func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nRV2XServicesAuthorized.VehicleUE != nil && nRV2XServicesAuthorized.VehicleUE.Diagnose(d) { notComprehended = true @@ -22421,7 +22608,7 @@ func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) Diagnose(d *ap.Diagnosis if nRV2XServicesAuthorized.PedestrianUE != nil && nRV2XServicesAuthorized.PedestrianUE.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, nRV2XServicesAuthorized.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, &nRV2XServicesAuthorized.iEExtensions) return notComprehended } @@ -22454,7 +22641,7 @@ func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) MarshalPER(w *per.Writer if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, nTNGeographicalAreaItem.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, nTNGeographicalAreaItem.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -22481,7 +22668,7 @@ func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) UnmarshalPER(r *per.Read } nTNGeographicalAreaItem.Polygon = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -22495,13 +22682,13 @@ func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) UnmarshalPER(r *per.Read return nil } -func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nTNGeographicalAreaItem *NTNGeographicalAreaItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case nTNGeographicalAreaItem.Circle != nil: return nTNGeographicalAreaItem.Circle.Diagnose(d) case nTNGeographicalAreaItem.Polygon != nil: case nTNGeographicalAreaItem.ChoiceExtension != nil: - d.Unknown(nTNGeographicalAreaItem.ChoiceExtension.ID, nTNGeographicalAreaItem.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, nTNGeographicalAreaItem.ChoiceExtension) } return false } @@ -22523,19 +22710,19 @@ func (networkControlledRepeaterAuthorized NetworkControlledRepeaterAuthorized) N return enumNetworkControlledRepeaterAuthorized.Name(networkControlledRepeaterAuthorized) } -func (networkControlledRepeaterAuthorized NetworkControlledRepeaterAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (networkControlledRepeaterAuthorized NetworkControlledRepeaterAuthorized) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNetworkControlledRepeaterAuthorized.Known(networkControlledRepeaterAuthorized) } func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT.iEExtensions) w.WriteBit(networkSliceAreaScopeofMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := networkSliceAreaScopeofMDT.NetworkSliceListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22561,7 +22748,7 @@ func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) UnmarshalPER(r *pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, &networkSliceAreaScopeofMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, &networkSliceAreaScopeofMDT.iEExtensions); err != nil { return err } } @@ -22573,19 +22760,19 @@ func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) UnmarshalPER(r *pe return nil } -var extIEsNetworkSliceAreaScopeofMDT []ap.IESpec[ProtocolIEID, NetworkSliceAreaScopeofMDT] +var extIEsNetworkSliceAreaScopeofMDT []apimpl.IESpec[ProtocolIEID, NetworkSliceAreaScopeofMDT] -func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (networkSliceAreaScopeofMDT *NetworkSliceAreaScopeofMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if networkSliceAreaScopeofMDT.NetworkSliceListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNetworkSliceAreaScopeofMDT, networkSliceAreaScopeofMDT, &networkSliceAreaScopeofMDT.iEExtensions) return notComprehended } func (networkSliceItemforMDT *NetworkSliceItemforMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, networkSliceItemforMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, networkSliceItemforMDT.iEExtensions) w.WriteBit(networkSliceItemforMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := networkSliceItemforMDT.PlmnID.MarshalPER(w, enc); err != nil { @@ -22595,7 +22782,7 @@ func (networkSliceItemforMDT *NetworkSliceItemforMDT) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22624,7 +22811,7 @@ func (networkSliceItemforMDT *NetworkSliceItemforMDT) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, &networkSliceItemforMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, &networkSliceItemforMDT.iEExtensions); err != nil { return err } } @@ -22636,14 +22823,14 @@ func (networkSliceItemforMDT *NetworkSliceItemforMDT) UnmarshalPER(r *per.Reader return nil } -var extIEsNetworkSliceItemforMDT []ap.IESpec[ProtocolIEID, NetworkSliceItemforMDT] +var extIEsNetworkSliceItemforMDT []apimpl.IESpec[ProtocolIEID, NetworkSliceItemforMDT] -func (networkSliceItemforMDT *NetworkSliceItemforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (networkSliceItemforMDT *NetworkSliceItemforMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if networkSliceItemforMDT.SliceMDTList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, networkSliceItemforMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNetworkSliceItemforMDT, networkSliceItemforMDT, &networkSliceItemforMDT.iEExtensions) return notComprehended } @@ -22664,7 +22851,7 @@ func (newSecurityContextInd NewSecurityContextInd) Name() string { return enumNewSecurityContextInd.Name(newSecurityContextInd) } -func (newSecurityContextInd NewSecurityContextInd) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (newSecurityContextInd NewSecurityContextInd) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNewSecurityContextInd.Known(newSecurityContextInd) } @@ -22685,7 +22872,7 @@ func (nextPagingAreaScope NextPagingAreaScope) Name() string { return enumNextPagingAreaScope.Name(nextPagingAreaScope) } -func (nextPagingAreaScope NextPagingAreaScope) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (nextPagingAreaScope NextPagingAreaScope) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNextPagingAreaScope.Known(nextPagingAreaScope) } @@ -22725,7 +22912,7 @@ func (ngENBID *NgENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ngENBID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, ngENBID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -22758,7 +22945,7 @@ func (ngENBID *NgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } ngENBID.LongMacroNgENBID = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -22772,13 +22959,13 @@ func (ngENBID *NgENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (ngENBID *NgENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (ngENBID *NgENBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case ngENBID.MacroNgENBID != nil: case ngENBID.ShortMacroNgENBID != nil: case ngENBID.LongMacroNgENBID != nil: case ngENBID.ChoiceExtension != nil: - d.Unknown(ngENBID.ChoiceExtension.ID, ngENBID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, ngENBID.ChoiceExtension) } return false } @@ -22800,12 +22987,12 @@ func (noPDUSessionIndication NoPDUSessionIndication) Name() string { return enumNoPDUSessionIndication.Name(noPDUSessionIndication) } -func (noPDUSessionIndication NoPDUSessionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (noPDUSessionIndication NoPDUSessionIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNoPDUSessionIndication.Known(noPDUSessionIndication) } func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, nonDynamic5QIDescriptor.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, nonDynamic5QIDescriptor.iEExtensions) w.WriteBit(nonDynamic5QIDescriptor.extensions.Present()) w.WriteBit(nonDynamic5QIDescriptor.PriorityLevelQos != nil) w.WriteBit(nonDynamic5QIDescriptor.AveragingWindow != nil) @@ -22830,7 +23017,7 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -22889,7 +23076,7 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Read nonDynamic5QIDescriptor.MaximumDataBurstVolume = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, &nonDynamic5QIDescriptor.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, &nonDynamic5QIDescriptor.iEExtensions); err != nil { return err } } @@ -22901,11 +23088,11 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) UnmarshalPER(r *per.Read return nil } -var extIEsNonDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, NonDynamic5QIDescriptor]{ +var extIEsNonDynamic5QIDescriptor = []apimpl.IESpec[ProtocolIEID, NonDynamic5QIDescriptor]{ { ID: IDCNPacketDelayBudgetDL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *NonDynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -22920,11 +23107,14 @@ var extIEsNonDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, NonDynamic5QIDescr } return x.CNPacketDelayBudgetDL, true }, + Clear: func(x *NonDynamic5QIDescriptor) { + x.CNPacketDelayBudgetDL = nil + }, }, { ID: IDCNPacketDelayBudgetUL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *NonDynamic5QIDescriptor, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -22939,10 +23129,13 @@ var extIEsNonDynamic5QIDescriptor = []ap.IESpec[ProtocolIEID, NonDynamic5QIDescr } return x.CNPacketDelayBudgetUL, true }, + Clear: func(x *NonDynamic5QIDescriptor) { + x.CNPacketDelayBudgetUL = nil + }, }, } -func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if nonDynamic5QIDescriptor.FiveQI.Diagnose(d) { notComprehended = true @@ -22956,7 +23149,7 @@ func (nonDynamic5QIDescriptor *NonDynamic5QIDescriptor) Diagnose(d *ap.Diagnosis if nonDynamic5QIDescriptor.MaximumDataBurstVolume != nil && nonDynamic5QIDescriptor.MaximumDataBurstVolume.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, nonDynamic5QIDescriptor.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNonDynamic5QIDescriptor, nonDynamic5QIDescriptor, &nonDynamic5QIDescriptor.iEExtensions) return notComprehended } @@ -22977,12 +23170,12 @@ func (notificationCause NotificationCause) Name() string { return enumNotificationCause.Name(notificationCause) } -func (notificationCause NotificationCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (notificationCause NotificationCause) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNotificationCause.Known(notificationCause) } func (notificationCellItem *NotificationCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNotificationCellItem, notificationCellItem, notificationCellItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsNotificationCellItem, notificationCellItem, notificationCellItem.iEExtensions) w.WriteBit(notificationCellItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := notificationCellItem.NGRANCGI.MarshalPER(w, enc); err != nil { @@ -22992,7 +23185,7 @@ func (notificationCellItem *NotificationCellItem) MarshalPER(w *per.Writer, enc return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23021,7 +23214,7 @@ func (notificationCellItem *NotificationCellItem) UnmarshalPER(r *per.Reader, en return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNotificationCellItem, notificationCellItem, ¬ificationCellItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNotificationCellItem, notificationCellItem, ¬ificationCellItem.iEExtensions); err != nil { return err } } @@ -23033,9 +23226,9 @@ func (notificationCellItem *NotificationCellItem) UnmarshalPER(r *per.Reader, en return nil } -var extIEsNotificationCellItem []ap.IESpec[ProtocolIEID, NotificationCellItem] +var extIEsNotificationCellItem []apimpl.IESpec[ProtocolIEID, NotificationCellItem] -func (notificationCellItem *NotificationCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (notificationCellItem *NotificationCellItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if notificationCellItem.NGRANCGI.Diagnose(d) { notComprehended = true @@ -23043,7 +23236,7 @@ func (notificationCellItem *NotificationCellItem) Diagnose(d *ap.Diagnosis[Proto if notificationCellItem.NotifyFlag.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsNotificationCellItem, notificationCellItem, notificationCellItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNotificationCellItem, notificationCellItem, ¬ificationCellItem.iEExtensions) return notComprehended } @@ -23064,7 +23257,7 @@ func (notificationCellItemNotifyFlag NotificationCellItemNotifyFlag) Name() stri return enumNotificationCellItemNotifyFlag.Name(notificationCellItemNotifyFlag) } -func (notificationCellItemNotifyFlag NotificationCellItemNotifyFlag) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (notificationCellItemNotifyFlag NotificationCellItemNotifyFlag) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNotificationCellItemNotifyFlag.Known(notificationCellItemNotifyFlag) } @@ -23085,7 +23278,7 @@ func (notificationControl NotificationControl) Name() string { return enumNotificationControl.Name(notificationControl) } -func (notificationControl NotificationControl) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (notificationControl NotificationControl) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNotificationControl.Known(notificationControl) } @@ -23106,7 +23299,7 @@ func (notifySourceNGRANNode NotifySourceNGRANNode) Name() string { return enumNotifySourceNGRANNode.Name(notifySourceNGRANNode) } -func (notifySourceNGRANNode NotifySourceNGRANNode) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (notifySourceNGRANNode NotifySourceNGRANNode) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNotifySourceNGRANNode.Known(notifySourceNGRANNode) } @@ -23127,7 +23320,7 @@ func (numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels) Nam return enumNumberOfMeasurementReportingLevels.Name(numberOfMeasurementReportingLevels) } -func (numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (numberOfMeasurementReportingLevels NumberOfMeasurementReportingLevels) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumNumberOfMeasurementReportingLevels.Known(numberOfMeasurementReportingLevels) } @@ -23148,7 +23341,7 @@ func (onboardingSupport OnboardingSupport) Name() string { return enumOnboardingSupport.Name(onboardingSupport) } -func (onboardingSupport OnboardingSupport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (onboardingSupport OnboardingSupport) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumOnboardingSupport.Known(onboardingSupport) } @@ -23169,7 +23362,7 @@ func (overloadAction OverloadAction) Name() string { return enumOverloadAction.Name(overloadAction) } -func (overloadAction OverloadAction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (overloadAction OverloadAction) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumOverloadAction.Known(overloadAction) } @@ -23195,7 +23388,7 @@ func (overloadResponse *OverloadResponse) MarshalPER(w *per.Writer, enc per.Enco if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, overloadResponse.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, overloadResponse.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -23216,7 +23409,7 @@ func (overloadResponse *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.En } overloadResponse.OverloadAction = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -23230,18 +23423,18 @@ func (overloadResponse *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (overloadResponse *OverloadResponse) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (overloadResponse *OverloadResponse) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case overloadResponse.OverloadAction != nil: return overloadResponse.OverloadAction.Diagnose(d) case overloadResponse.ChoiceExtension != nil: - d.Unknown(overloadResponse.ChoiceExtension.ID, overloadResponse.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, overloadResponse.ChoiceExtension) } return false } func (overloadStartNSSAIItem *OverloadStartNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, overloadStartNSSAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, overloadStartNSSAIItem.iEExtensions) w.WriteBit(overloadStartNSSAIItem.extensions.Present()) w.WriteBit(overloadStartNSSAIItem.SliceOverloadResponse != nil) w.WriteBit(overloadStartNSSAIItem.SliceTrafficLoadReductionIndication != nil) @@ -23270,7 +23463,7 @@ func (overloadStartNSSAIItem *OverloadStartNSSAIItem) MarshalPER(w *per.Writer, } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23328,7 +23521,7 @@ func (overloadStartNSSAIItem *OverloadStartNSSAIItem) UnmarshalPER(r *per.Reader overloadStartNSSAIItem.SliceTrafficLoadReductionIndication = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, &overloadStartNSSAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, &overloadStartNSSAIItem.iEExtensions); err != nil { return err } } @@ -23340,9 +23533,9 @@ func (overloadStartNSSAIItem *OverloadStartNSSAIItem) UnmarshalPER(r *per.Reader return nil } -var extIEsOverloadStartNSSAIItem []ap.IESpec[ProtocolIEID, OverloadStartNSSAIItem] +var extIEsOverloadStartNSSAIItem []apimpl.IESpec[ProtocolIEID, OverloadStartNSSAIItem] -func (overloadStartNSSAIItem *OverloadStartNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (overloadStartNSSAIItem *OverloadStartNSSAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range overloadStartNSSAIItem.SliceOverloadList { if overloadStartNSSAIItem.SliceOverloadList[i].Diagnose(d) { @@ -23352,12 +23545,12 @@ func (overloadStartNSSAIItem *OverloadStartNSSAIItem) Diagnose(d *ap.Diagnosis[P if overloadStartNSSAIItem.SliceOverloadResponse != nil && overloadStartNSSAIItem.SliceOverloadResponse.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, overloadStartNSSAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsOverloadStartNSSAIItem, overloadStartNSSAIItem, &overloadStartNSSAIItem.iEExtensions) return notComprehended } func (pC5FlowBitRates *PC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPC5FlowBitRates, pC5FlowBitRates, pC5FlowBitRates.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPC5FlowBitRates, pC5FlowBitRates, pC5FlowBitRates.iEExtensions) w.WriteBit(pC5FlowBitRates.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pC5FlowBitRates.GuaranteedFlowBitRate.MarshalPER(w, enc); err != nil { @@ -23367,7 +23560,7 @@ func (pC5FlowBitRates *PC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23396,7 +23589,7 @@ func (pC5FlowBitRates *PC5FlowBitRates) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPC5FlowBitRates, pC5FlowBitRates, &pC5FlowBitRates.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPC5FlowBitRates, pC5FlowBitRates, &pC5FlowBitRates.iEExtensions); err != nil { return err } } @@ -23408,9 +23601,9 @@ func (pC5FlowBitRates *PC5FlowBitRates) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsPC5FlowBitRates []ap.IESpec[ProtocolIEID, PC5FlowBitRates] +var extIEsPC5FlowBitRates []apimpl.IESpec[ProtocolIEID, PC5FlowBitRates] -func (pC5FlowBitRates *PC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pC5FlowBitRates *PC5FlowBitRates) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pC5FlowBitRates.GuaranteedFlowBitRate.Diagnose(d) { notComprehended = true @@ -23418,12 +23611,12 @@ func (pC5FlowBitRates *PC5FlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if pC5FlowBitRates.MaximumFlowBitRate.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPC5FlowBitRates, pC5FlowBitRates, pC5FlowBitRates.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPC5FlowBitRates, pC5FlowBitRates, &pC5FlowBitRates.iEExtensions) return notComprehended } func (pC5QoSFlowItem *PC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPC5QoSFlowItem, pC5QoSFlowItem, pC5QoSFlowItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPC5QoSFlowItem, pC5QoSFlowItem, pC5QoSFlowItem.iEExtensions) w.WriteBit(pC5QoSFlowItem.extensions.Present()) w.WriteBit(pC5QoSFlowItem.Pc5FlowBitRates != nil) w.WriteBit(pC5QoSFlowItem.Range != nil) @@ -23442,7 +23635,7 @@ func (pC5QoSFlowItem *PC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23490,7 +23683,7 @@ func (pC5QoSFlowItem *PC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Encodi pC5QoSFlowItem.Range = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSFlowItem, pC5QoSFlowItem, &pC5QoSFlowItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSFlowItem, pC5QoSFlowItem, &pC5QoSFlowItem.iEExtensions); err != nil { return err } } @@ -23502,9 +23695,9 @@ func (pC5QoSFlowItem *PC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsPC5QoSFlowItem []ap.IESpec[ProtocolIEID, PC5QoSFlowItem] +var extIEsPC5QoSFlowItem []apimpl.IESpec[ProtocolIEID, PC5QoSFlowItem] -func (pC5QoSFlowItem *PC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pC5QoSFlowItem *PC5QoSFlowItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pC5QoSFlowItem.PQI.Diagnose(d) { notComprehended = true @@ -23515,12 +23708,12 @@ func (pC5QoSFlowItem *PC5QoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bo if pC5QoSFlowItem.Range != nil && pC5QoSFlowItem.Range.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPC5QoSFlowItem, pC5QoSFlowItem, pC5QoSFlowItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPC5QoSFlowItem, pC5QoSFlowItem, &pC5QoSFlowItem.iEExtensions) return notComprehended } func (pC5QoSParameters *PC5QoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPC5QoSParameters, pC5QoSParameters, pC5QoSParameters.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPC5QoSParameters, pC5QoSParameters, pC5QoSParameters.iEExtensions) w.WriteBit(pC5QoSParameters.extensions.Present()) w.WriteBit(pC5QoSParameters.Pc5LinkAggregateBitRates != nil) w.WriteBit(len(ext) > 0) @@ -23533,7 +23726,7 @@ func (pC5QoSParameters *PC5QoSParameters) MarshalPER(w *per.Writer, enc per.Enco } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23570,7 +23763,7 @@ func (pC5QoSParameters *PC5QoSParameters) UnmarshalPER(r *per.Reader, enc per.En pC5QoSParameters.Pc5LinkAggregateBitRates = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSParameters, pC5QoSParameters, &pC5QoSParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSParameters, pC5QoSParameters, &pC5QoSParameters.iEExtensions); err != nil { return err } } @@ -23582,9 +23775,9 @@ func (pC5QoSParameters *PC5QoSParameters) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsPC5QoSParameters []ap.IESpec[ProtocolIEID, PC5QoSParameters] +var extIEsPC5QoSParameters []apimpl.IESpec[ProtocolIEID, PC5QoSParameters] -func (pC5QoSParameters *PC5QoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pC5QoSParameters *PC5QoSParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pC5QoSParameters.Pc5QoSFlowList.Diagnose(d) { notComprehended = true @@ -23592,12 +23785,12 @@ func (pC5QoSParameters *PC5QoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID] if pC5QoSParameters.Pc5LinkAggregateBitRates != nil && pC5QoSParameters.Pc5LinkAggregateBitRates.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPC5QoSParameters, pC5QoSParameters, pC5QoSParameters.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPC5QoSParameters, pC5QoSParameters, &pC5QoSParameters.iEExtensions) return notComprehended } func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate.iEExtensions) w.WriteBit(pDUSessionAggregateMaximumBitRate.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { @@ -23607,7 +23800,7 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Mars return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23636,7 +23829,7 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, &pDUSessionAggregateMaximumBitRate.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, &pDUSessionAggregateMaximumBitRate.iEExtensions); err != nil { return err } } @@ -23648,9 +23841,9 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Unma return nil } -var extIEsPDUSessionAggregateMaximumBitRate []ap.IESpec[ProtocolIEID, PDUSessionAggregateMaximumBitRate] +var extIEsPDUSessionAggregateMaximumBitRate []apimpl.IESpec[ProtocolIEID, PDUSessionAggregateMaximumBitRate] -func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionAggregateMaximumBitRate.DL.Diagnose(d) { notComprehended = true @@ -23658,12 +23851,12 @@ func (pDUSessionAggregateMaximumBitRate *PDUSessionAggregateMaximumBitRate) Diag if pDUSessionAggregateMaximumBitRate.UL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionAggregateMaximumBitRate, pDUSessionAggregateMaximumBitRate, &pDUSessionAggregateMaximumBitRate.iEExtensions) return notComprehended } func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem.iEExtensions) w.WriteBit(pDUSessionResourceAdmittedItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceAdmittedItem.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -23673,7 +23866,7 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23702,7 +23895,7 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, &pDUSessionResourceAdmittedItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, &pDUSessionResourceAdmittedItem.iEExtensions); err != nil { return err } } @@ -23714,16 +23907,16 @@ func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) UnmarshalP return nil } -var extIEsPDUSessionResourceAdmittedItem []ap.IESpec[ProtocolIEID, PDUSessionResourceAdmittedItem] +var extIEsPDUSessionResourceAdmittedItem []apimpl.IESpec[ProtocolIEID, PDUSessionResourceAdmittedItem] -func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceAdmittedItem *PDUSessionResourceAdmittedItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceAdmittedItem, pDUSessionResourceAdmittedItem, &pDUSessionResourceAdmittedItem.iEExtensions) return notComprehended } func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm.iEExtensions) w.WriteBit(pDUSessionResourceFailedToModifyItemModCfm.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceFailedToModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -23733,7 +23926,7 @@ func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23762,7 +23955,7 @@ func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, &pDUSessionResourceFailedToModifyItemModCfm.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, &pDUSessionResourceFailedToModifyItemModCfm.iEExtensions); err != nil { return err } } @@ -23774,16 +23967,16 @@ func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModi return nil } -var extIEsPDUSessionResourceFailedToModifyItemModCfm []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToModifyItemModCfm] +var extIEsPDUSessionResourceFailedToModifyItemModCfm []apimpl.IESpec[ProtocolIEID, PDUSessionResourceFailedToModifyItemModCfm] -func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToModifyItemModCfm *PDUSessionResourceFailedToModifyItemModCfm) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToModifyItemModCfm, pDUSessionResourceFailedToModifyItemModCfm, &pDUSessionResourceFailedToModifyItemModCfm.iEExtensions) return notComprehended } func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes.iEExtensions) w.WriteBit(pDUSessionResourceFailedToModifyItemModRes.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceFailedToModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -23793,7 +23986,7 @@ func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23822,7 +24015,7 @@ func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, &pDUSessionResourceFailedToModifyItemModRes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, &pDUSessionResourceFailedToModifyItemModRes.iEExtensions); err != nil { return err } } @@ -23834,16 +24027,16 @@ func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModi return nil } -var extIEsPDUSessionResourceFailedToModifyItemModRes []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToModifyItemModRes] +var extIEsPDUSessionResourceFailedToModifyItemModRes []apimpl.IESpec[ProtocolIEID, PDUSessionResourceFailedToModifyItemModRes] -func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToModifyItemModRes *PDUSessionResourceFailedToModifyItemModRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToModifyItemModRes, pDUSessionResourceFailedToModifyItemModRes, &pDUSessionResourceFailedToModifyItemModRes.iEExtensions) return notComprehended } func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions) w.WriteBit(pDUSessionResourceFailedToSetupItemCxtFail.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceFailedToSetupItemCxtFail.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -23853,7 +24046,7 @@ func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetu return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23882,7 +24075,7 @@ func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetu return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, &pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, &pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions); err != nil { return err } } @@ -23894,16 +24087,16 @@ func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetu return nil } -var extIEsPDUSessionResourceFailedToSetupItemCxtFail []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemCxtFail] +var extIEsPDUSessionResourceFailedToSetupItemCxtFail []apimpl.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemCxtFail] -func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupItemCxtFail *PDUSessionResourceFailedToSetupItemCxtFail) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemCxtFail, pDUSessionResourceFailedToSetupItemCxtFail, &pDUSessionResourceFailedToSetupItemCxtFail.iEExtensions) return notComprehended } func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions) w.WriteBit(pDUSessionResourceFailedToSetupItemCxtRes.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceFailedToSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -23913,7 +24106,7 @@ func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetup return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -23942,7 +24135,7 @@ func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetup return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, &pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, &pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions); err != nil { return err } } @@ -23954,16 +24147,16 @@ func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetup return nil } -var extIEsPDUSessionResourceFailedToSetupItemCxtRes []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemCxtRes] +var extIEsPDUSessionResourceFailedToSetupItemCxtRes []apimpl.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemCxtRes] -func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupItemCxtRes *PDUSessionResourceFailedToSetupItemCxtRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemCxtRes, pDUSessionResourceFailedToSetupItemCxtRes, &pDUSessionResourceFailedToSetupItemCxtRes.iEExtensions) return notComprehended } func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck.iEExtensions) w.WriteBit(pDUSessionResourceFailedToSetupItemHOAck.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceFailedToSetupItemHOAck.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -23973,7 +24166,7 @@ func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupI return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24002,7 +24195,7 @@ func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupI return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, &pDUSessionResourceFailedToSetupItemHOAck.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, &pDUSessionResourceFailedToSetupItemHOAck.iEExtensions); err != nil { return err } } @@ -24014,16 +24207,16 @@ func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupI return nil } -var extIEsPDUSessionResourceFailedToSetupItemHOAck []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemHOAck] +var extIEsPDUSessionResourceFailedToSetupItemHOAck []apimpl.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemHOAck] -func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupItemHOAck *PDUSessionResourceFailedToSetupItemHOAck) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemHOAck, pDUSessionResourceFailedToSetupItemHOAck, &pDUSessionResourceFailedToSetupItemHOAck.iEExtensions) return notComprehended } func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq.iEExtensions) w.WriteBit(pDUSessionResourceFailedToSetupItemPSReq.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceFailedToSetupItemPSReq.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -24033,7 +24226,7 @@ func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupI return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24062,7 +24255,7 @@ func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupI return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, &pDUSessionResourceFailedToSetupItemPSReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, &pDUSessionResourceFailedToSetupItemPSReq.iEExtensions); err != nil { return err } } @@ -24074,16 +24267,16 @@ func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupI return nil } -var extIEsPDUSessionResourceFailedToSetupItemPSReq []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemPSReq] +var extIEsPDUSessionResourceFailedToSetupItemPSReq []apimpl.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemPSReq] -func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupItemPSReq *PDUSessionResourceFailedToSetupItemPSReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemPSReq, pDUSessionResourceFailedToSetupItemPSReq, &pDUSessionResourceFailedToSetupItemPSReq.iEExtensions) return notComprehended } func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes.iEExtensions) w.WriteBit(pDUSessionResourceFailedToSetupItemSURes.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceFailedToSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -24093,7 +24286,7 @@ func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupI return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24122,7 +24315,7 @@ func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupI return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, &pDUSessionResourceFailedToSetupItemSURes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, &pDUSessionResourceFailedToSetupItemSURes.iEExtensions); err != nil { return err } } @@ -24134,16 +24327,16 @@ func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupI return nil } -var extIEsPDUSessionResourceFailedToSetupItemSURes []ap.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemSURes] +var extIEsPDUSessionResourceFailedToSetupItemSURes []apimpl.IESpec[ProtocolIEID, PDUSessionResourceFailedToSetupItemSURes] -func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupItemSURes *PDUSessionResourceFailedToSetupItemSURes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceFailedToSetupItemSURes, pDUSessionResourceFailedToSetupItemSURes, &pDUSessionResourceFailedToSetupItemSURes.iEExtensions) return notComprehended } func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem.iEExtensions) w.WriteBit(pDUSessionResourceHandoverItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceHandoverItem.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -24153,7 +24346,7 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24182,7 +24375,7 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, &pDUSessionResourceHandoverItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, &pDUSessionResourceHandoverItem.iEExtensions); err != nil { return err } } @@ -24194,16 +24387,16 @@ func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) UnmarshalP return nil } -var extIEsPDUSessionResourceHandoverItem []ap.IESpec[ProtocolIEID, PDUSessionResourceHandoverItem] +var extIEsPDUSessionResourceHandoverItem []apimpl.IESpec[ProtocolIEID, PDUSessionResourceHandoverItem] -func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceHandoverItem *PDUSessionResourceHandoverItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceHandoverItem, pDUSessionResourceHandoverItem, &pDUSessionResourceHandoverItem.iEExtensions) return notComprehended } func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, pDUSessionResourceInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, pDUSessionResourceInformationItem.iEExtensions) w.WriteBit(pDUSessionResourceInformationItem.extensions.Present()) w.WriteBit(pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList != nil) w.WriteBit(len(ext) > 0) @@ -24219,7 +24412,7 @@ func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) Mars } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24257,7 +24450,7 @@ func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) Unma } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, &pDUSessionResourceInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, &pDUSessionResourceInformationItem.iEExtensions); err != nil { return err } } @@ -24269,9 +24462,9 @@ func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) Unma return nil } -var extIEsPDUSessionResourceInformationItem []ap.IESpec[ProtocolIEID, PDUSessionResourceInformationItem] +var extIEsPDUSessionResourceInformationItem []apimpl.IESpec[ProtocolIEID, PDUSessionResourceInformationItem] -func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceInformationItem.QosFlowInformationList.Diagnose(d) { notComprehended = true @@ -24279,19 +24472,19 @@ func (pDUSessionResourceInformationItem *PDUSessionResourceInformationItem) Diag if pDUSessionResourceInformationItem.DRBsToQosFlowsMappingList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, pDUSessionResourceInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceInformationItem, pDUSessionResourceInformationItem, &pDUSessionResourceInformationItem.iEExtensions) return notComprehended } func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl.iEExtensions) w.WriteBit(pDUSessionResourceItemCxtRelCpl.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceItemCxtRelCpl.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24317,7 +24510,7 @@ func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) Unmarsha return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, &pDUSessionResourceItemCxtRelCpl.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, &pDUSessionResourceItemCxtRelCpl.iEExtensions); err != nil { return err } } @@ -24329,11 +24522,11 @@ func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) Unmarsha return nil } -var extIEsPDUSessionResourceItemCxtRelCpl = []ap.IESpec[ProtocolIEID, PDUSessionResourceItemCxtRelCpl]{ +var extIEsPDUSessionResourceItemCxtRelCpl = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceItemCxtRelCpl]{ { ID: IDPDUSessionResourceReleaseResponseTransfer, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceItemCxtRelCpl, r *per.Reader, enc per.Encoding) error { var v TransferContainer if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24348,24 +24541,27 @@ var extIEsPDUSessionResourceItemCxtRelCpl = []ap.IESpec[ProtocolIEID, PDUSession } return x.PDUSessionResourceReleaseResponseTransfer, true }, + Clear: func(x *PDUSessionResourceItemCxtRelCpl) { + x.PDUSessionResourceReleaseResponseTransfer = nil + }, }, } -func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceItemCxtRelCpl *PDUSessionResourceItemCxtRelCpl) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceItemCxtRelCpl, pDUSessionResourceItemCxtRelCpl, &pDUSessionResourceItemCxtRelCpl.iEExtensions) return notComprehended } func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq.iEExtensions) w.WriteBit(pDUSessionResourceItemCxtRelReq.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceItemCxtRelReq.PDUSessionID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24391,7 +24587,7 @@ func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) Unmarsha return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, &pDUSessionResourceItemCxtRelReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, &pDUSessionResourceItemCxtRelReq.iEExtensions); err != nil { return err } } @@ -24403,16 +24599,16 @@ func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) Unmarsha return nil } -var extIEsPDUSessionResourceItemCxtRelReq []ap.IESpec[ProtocolIEID, PDUSessionResourceItemCxtRelReq] +var extIEsPDUSessionResourceItemCxtRelReq []apimpl.IESpec[ProtocolIEID, PDUSessionResourceItemCxtRelReq] -func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceItemCxtRelReq *PDUSessionResourceItemCxtRelReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceItemCxtRelReq, pDUSessionResourceItemCxtRelReq, &pDUSessionResourceItemCxtRelReq.iEExtensions) return notComprehended } func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd.iEExtensions) w.WriteBit(pDUSessionResourceItemHORqd.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceItemHORqd.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -24422,7 +24618,7 @@ func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) MarshalPER(w *pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24451,7 +24647,7 @@ func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r * return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, &pDUSessionResourceItemHORqd.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, &pDUSessionResourceItemHORqd.iEExtensions); err != nil { return err } } @@ -24463,16 +24659,16 @@ func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) UnmarshalPER(r * return nil } -var extIEsPDUSessionResourceItemHORqd []ap.IESpec[ProtocolIEID, PDUSessionResourceItemHORqd] +var extIEsPDUSessionResourceItemHORqd []apimpl.IESpec[ProtocolIEID, PDUSessionResourceItemHORqd] -func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceItemHORqd *PDUSessionResourceItemHORqd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceItemHORqd, pDUSessionResourceItemHORqd, &pDUSessionResourceItemHORqd.iEExtensions) return notComprehended } func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer.iEExtensions) w.WriteBit(pDUSessionResourceModifyConfirmTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceModifyConfirmTransfer.AdditionalNGUUPTNLInformation != nil) w.WriteBit(pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify != nil) @@ -24494,7 +24690,7 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24541,7 +24737,7 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions); err != nil { return err } } @@ -24553,11 +24749,11 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr return nil } -var extIEsPDUSessionResourceModifyConfirmTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyConfirmTransfer]{ +var extIEsPDUSessionResourceModifyConfirmTransfer = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyConfirmTransfer]{ { ID: IDRedundantULNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyConfirmTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24572,11 +24768,14 @@ var extIEsPDUSessionResourceModifyConfirmTransfer = []ap.IESpec[ProtocolIEID, PD } return x.RedundantULNGUUPTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyConfirmTransfer) { + x.RedundantULNGUUPTNLInformation = nil + }, }, { ID: IDAdditionalRedundantNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyConfirmTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformationPairList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24591,10 +24790,13 @@ var extIEsPDUSessionResourceModifyConfirmTransfer = []ap.IESpec[ProtocolIEID, PD } return x.AdditionalRedundantNGUUPTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyConfirmTransfer) { + x.AdditionalRedundantNGUUPTNLInformation = nil + }, }, } -func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceModifyConfirmTransfer.QosFlowModifyConfirm.Diagnose(d) { notComprehended = true @@ -24608,12 +24810,12 @@ func (pDUSessionResourceModifyConfirmTransfer *PDUSessionResourceModifyConfirmTr if pDUSessionResourceModifyConfirmTransfer.QosFlowFailedToModify.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyConfirmTransfer, pDUSessionResourceModifyConfirmTransfer, &pDUSessionResourceModifyConfirmTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer.iEExtensions) w.WriteBit(pDUSessionResourceModifyIndicationTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation != nil) w.WriteBit(len(ext) > 0) @@ -24626,7 +24828,7 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24661,7 +24863,7 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions); err != nil { return err } } @@ -24673,11 +24875,11 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica return nil } -var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyIndicationTransfer]{ +var extIEsPDUSessionResourceModifyIndicationTransfer = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyIndicationTransfer]{ { ID: IDSecondaryRATUsageInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { var v SecondaryRATUsageInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24692,11 +24894,14 @@ var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, } return x.SecondaryRATUsageInformation, true }, + Clear: func(x *PDUSessionResourceModifyIndicationTransfer) { + x.SecondaryRATUsageInformation = nil + }, }, { ID: IDSecurityResult, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { var v SecurityResult if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24711,11 +24916,14 @@ var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, } return x.SecurityResult, true }, + Clear: func(x *PDUSessionResourceModifyIndicationTransfer) { + x.SecurityResult = nil + }, }, { ID: IDRedundantDLQosFlowPerTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24730,11 +24938,14 @@ var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, } return x.RedundantDLQosFlowPerTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyIndicationTransfer) { + x.RedundantDLQosFlowPerTNLInformation = nil + }, }, { ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24749,11 +24960,14 @@ var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, } return x.AdditionalRedundantDLQosFlowPerTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyIndicationTransfer) { + x.AdditionalRedundantDLQosFlowPerTNLInformation = nil + }, }, { ID: IDGlobalRANNodeID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { var v GlobalRANNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24768,11 +24982,14 @@ var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, } return x.GlobalRANNodeID, true }, + Clear: func(x *PDUSessionResourceModifyIndicationTransfer) { + x.GlobalRANNodeID = nil + }, }, { ID: IDECNMarkingorCongestionInformationReportingStatus, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyIndicationTransfer, r *per.Reader, enc per.Encoding) error { var v ECNMarkingorCongestionInformationReportingStatus if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -24787,10 +25004,13 @@ var extIEsPDUSessionResourceModifyIndicationTransfer = []ap.IESpec[ProtocolIEID, } return x.ECNMarkingorCongestionInformationReportingStatus, true }, + Clear: func(x *PDUSessionResourceModifyIndicationTransfer) { + x.ECNMarkingorCongestionInformationReportingStatus = nil + }, }, } -func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndicationTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceModifyIndicationTransfer.DLQosFlowPerTNLInformation.Diagnose(d) { notComprehended = true @@ -24798,19 +25018,19 @@ func (pDUSessionResourceModifyIndicationTransfer *PDUSessionResourceModifyIndica if pDUSessionResourceModifyIndicationTransfer.AdditionalDLQosFlowPerTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyIndicationTransfer, pDUSessionResourceModifyIndicationTransfer, &pDUSessionResourceModifyIndicationTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions) w.WriteBit(pDUSessionResourceModifyIndicationUnsuccessfulTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24836,7 +25056,7 @@ func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResource return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, &pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, &pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions); err != nil { return err } } @@ -24848,19 +25068,19 @@ func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResource return nil } -var extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyIndicationUnsuccessfulTransfer] +var extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyIndicationUnsuccessfulTransfer] -func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyIndicationUnsuccessfulTransfer *PDUSessionResourceModifyIndicationUnsuccessfulTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceModifyIndicationUnsuccessfulTransfer.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyIndicationUnsuccessfulTransfer, pDUSessionResourceModifyIndicationUnsuccessfulTransfer, &pDUSessionResourceModifyIndicationUnsuccessfulTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm.iEExtensions) w.WriteBit(pDUSessionResourceModifyItemModCfm.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceModifyItemModCfm.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -24870,7 +25090,7 @@ func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Ma return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24899,7 +25119,7 @@ func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Un return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, &pDUSessionResourceModifyItemModCfm.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, &pDUSessionResourceModifyItemModCfm.iEExtensions); err != nil { return err } } @@ -24911,16 +25131,16 @@ func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Un return nil } -var extIEsPDUSessionResourceModifyItemModCfm []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModCfm] +var extIEsPDUSessionResourceModifyItemModCfm []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModCfm] -func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyItemModCfm *PDUSessionResourceModifyItemModCfm) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModCfm, pDUSessionResourceModifyItemModCfm, &pDUSessionResourceModifyItemModCfm.iEExtensions) return notComprehended } func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd.iEExtensions) w.WriteBit(pDUSessionResourceModifyItemModInd.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceModifyItemModInd.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -24930,7 +25150,7 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Ma return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -24959,7 +25179,7 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Un return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, &pDUSessionResourceModifyItemModInd.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, &pDUSessionResourceModifyItemModInd.iEExtensions); err != nil { return err } } @@ -24971,16 +25191,16 @@ func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Un return nil } -var extIEsPDUSessionResourceModifyItemModInd []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModInd] +var extIEsPDUSessionResourceModifyItemModInd []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModInd] -func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyItemModInd *PDUSessionResourceModifyItemModInd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModInd, pDUSessionResourceModifyItemModInd, &pDUSessionResourceModifyItemModInd.iEExtensions) return notComprehended } func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq.iEExtensions) w.WriteBit(pDUSessionResourceModifyItemModReq.extensions.Present()) w.WriteBit(pDUSessionResourceModifyItemModReq.NASPDU != nil) w.WriteBit(len(ext) > 0) @@ -24996,7 +25216,7 @@ func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Ma return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25036,7 +25256,7 @@ func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Un return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions); err != nil { return err } } @@ -25048,11 +25268,11 @@ func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Un return nil } -var extIEsPDUSessionResourceModifyItemModReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModReq]{ +var extIEsPDUSessionResourceModifyItemModReq = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModReq]{ { ID: IDSNSSAI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *PDUSessionResourceModifyItemModReq, r *per.Reader, enc per.Encoding) error { var v SNSSAI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25067,11 +25287,14 @@ var extIEsPDUSessionResourceModifyItemModReq = []ap.IESpec[ProtocolIEID, PDUSess } return x.SNSSAI, true }, + Clear: func(x *PDUSessionResourceModifyItemModReq) { + x.SNSSAI = nil + }, }, { ID: IDPduSessionExpectedUEActivityBehaviour, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyItemModReq, r *per.Reader, enc per.Encoding) error { var v ExpectedUEActivityBehaviour if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25086,17 +25309,20 @@ var extIEsPDUSessionResourceModifyItemModReq = []ap.IESpec[ProtocolIEID, PDUSess } return x.PduSessionExpectedUEActivityBehaviour, true }, + Clear: func(x *PDUSessionResourceModifyItemModReq) { + x.PduSessionExpectedUEActivityBehaviour = nil + }, }, } -func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyItemModReq *PDUSessionResourceModifyItemModReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModReq, pDUSessionResourceModifyItemModReq, &pDUSessionResourceModifyItemModReq.iEExtensions) return notComprehended } func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes.iEExtensions) w.WriteBit(pDUSessionResourceModifyItemModRes.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceModifyItemModRes.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -25106,7 +25332,7 @@ func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Ma return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25135,7 +25361,7 @@ func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Un return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, &pDUSessionResourceModifyItemModRes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, &pDUSessionResourceModifyItemModRes.iEExtensions); err != nil { return err } } @@ -25147,16 +25373,16 @@ func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Un return nil } -var extIEsPDUSessionResourceModifyItemModRes []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModRes] +var extIEsPDUSessionResourceModifyItemModRes []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyItemModRes] -func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyItemModRes *PDUSessionResourceModifyItemModRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyItemModRes, pDUSessionResourceModifyItemModRes, &pDUSessionResourceModifyItemModRes.iEExtensions) return notComprehended } func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer.iEExtensions) w.WriteBit(pDUSessionResourceModifyResponseTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil) w.WriteBit(pDUSessionResourceModifyResponseTransfer.ULNGUUPTNLInformation != nil) @@ -25190,7 +25416,7 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25262,7 +25488,7 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions); err != nil { return err } } @@ -25274,11 +25500,11 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse return nil } -var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyResponseTransfer]{ +var extIEsPDUSessionResourceModifyResponseTransfer = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyResponseTransfer]{ { ID: IDAdditionalNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformationPairList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25293,11 +25519,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.AdditionalNGUUPTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.AdditionalNGUUPTNLInformation = nil + }, }, { ID: IDRedundantDLNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25312,11 +25541,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.RedundantDLNGUUPTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.RedundantDLNGUUPTNLInformation = nil + }, }, { ID: IDRedundantULNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25331,11 +25563,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.RedundantULNGUUPTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.RedundantULNGUUPTNLInformation = nil + }, }, { ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25350,11 +25585,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.AdditionalRedundantDLQosFlowPerTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.AdditionalRedundantDLQosFlowPerTNLInformation = nil + }, }, { ID: IDAdditionalRedundantNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformationPairList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25369,11 +25607,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.AdditionalRedundantNGUUPTNLInformation, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.AdditionalRedundantNGUUPTNLInformation = nil + }, }, { ID: IDSecondaryRATUsageInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v SecondaryRATUsageInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25388,11 +25629,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.SecondaryRATUsageInformation, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.SecondaryRATUsageInformation = nil + }, }, { ID: IDMBSSupportIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSupportIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25407,11 +25651,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.MBSSupportIndicator, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.MBSSupportIndicator = nil + }, }, { ID: IDMBSSessionSetuporModifyResponseList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSessionSetupResponseList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25426,11 +25673,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.MBSSessionSetuporModifyResponseList, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.MBSSessionSetuporModifyResponseList = nil + }, }, { ID: IDMBSSessionFailedtoSetuporModifyList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSessionFailedtoSetupList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25445,11 +25695,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.MBSSessionFailedtoSetuporModifyList, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.MBSSessionFailedtoSetuporModifyList = nil + }, }, { ID: IDECNMarkingorCongestionInformationReportingStatus, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v ECNMarkingorCongestionInformationReportingStatus if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25464,11 +25717,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.ECNMarkingorCongestionInformationReportingStatus, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.ECNMarkingorCongestionInformationReportingStatus = nil + }, }, { ID: IDPDUSetbasedHandlingIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v PDUSetbasedHandlingIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25483,11 +25739,14 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.PDUSetbasedHandlingIndicator, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.PDUSetbasedHandlingIndicator = nil + }, }, { ID: IDUserPlaneFailureIndicationReport, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceModifyResponseTransfer, r *per.Reader, enc per.Encoding) error { var v UserPlaneFailureIndicationReport if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25502,10 +25761,13 @@ var extIEsPDUSessionResourceModifyResponseTransfer = []ap.IESpec[ProtocolIEID, P } return x.UserPlaneFailureIndicationReport, true }, + Clear: func(x *PDUSessionResourceModifyResponseTransfer) { + x.UserPlaneFailureIndicationReport = nil + }, }, } -func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponseTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation != nil && pDUSessionResourceModifyResponseTransfer.DLNGUUPTNLInformation.Diagnose(d) { notComprehended = true @@ -25522,12 +25784,12 @@ func (pDUSessionResourceModifyResponseTransfer *PDUSessionResourceModifyResponse if pDUSessionResourceModifyResponseTransfer.QosFlowFailedToAddOrModify.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyResponseTransfer, pDUSessionResourceModifyResponseTransfer, &pDUSessionResourceModifyResponseTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions) w.WriteBit(pDUSessionResourceModifyUnsuccessfulTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(len(ext) > 0) @@ -25540,7 +25802,7 @@ func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsu } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25577,7 +25839,7 @@ func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsu pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, &pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, &pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions); err != nil { return err } } @@ -25589,9 +25851,9 @@ func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsu return nil } -var extIEsPDUSessionResourceModifyUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PDUSessionResourceModifyUnsuccessfulTransfer] +var extIEsPDUSessionResourceModifyUnsuccessfulTransfer []apimpl.IESpec[ProtocolIEID, PDUSessionResourceModifyUnsuccessfulTransfer] -func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsuccessfulTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceModifyUnsuccessfulTransfer.Cause.Diagnose(d) { notComprehended = true @@ -25599,12 +25861,12 @@ func (pDUSessionResourceModifyUnsuccessfulTransfer *PDUSessionResourceModifyUnsu if pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics != nil && pDUSessionResourceModifyUnsuccessfulTransfer.CriticalityDiagnostics.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceModifyUnsuccessfulTransfer, pDUSessionResourceModifyUnsuccessfulTransfer, &pDUSessionResourceModifyUnsuccessfulTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem.iEExtensions) w.WriteBit(pDUSessionResourceNotifyItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceNotifyItem.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -25614,7 +25876,7 @@ func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25643,7 +25905,7 @@ func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, &pDUSessionResourceNotifyItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, &pDUSessionResourceNotifyItem.iEExtensions); err != nil { return err } } @@ -25655,16 +25917,16 @@ func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) UnmarshalPER(r return nil } -var extIEsPDUSessionResourceNotifyItem []ap.IESpec[ProtocolIEID, PDUSessionResourceNotifyItem] +var extIEsPDUSessionResourceNotifyItem []apimpl.IESpec[ProtocolIEID, PDUSessionResourceNotifyItem] -func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceNotifyItem *PDUSessionResourceNotifyItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceNotifyItem, pDUSessionResourceNotifyItem, &pDUSessionResourceNotifyItem.iEExtensions) return notComprehended } func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer.iEExtensions) w.WriteBit(pDUSessionResourceNotifyTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowNotify != nil) w.WriteBit(pDUSessionResourceNotifyTransfer.QosFlowReleased != nil) @@ -25680,7 +25942,7 @@ func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Marsha } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25721,7 +25983,7 @@ func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Unmars } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, &pDUSessionResourceNotifyTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, &pDUSessionResourceNotifyTransfer.iEExtensions); err != nil { return err } } @@ -25733,11 +25995,11 @@ func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Unmars return nil } -var extIEsPDUSessionResourceNotifyTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceNotifyTransfer]{ +var extIEsPDUSessionResourceNotifyTransfer = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceNotifyTransfer]{ { ID: IDSecondaryRATUsageInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceNotifyTransfer, r *per.Reader, enc per.Encoding) error { var v SecondaryRATUsageInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25752,11 +26014,14 @@ var extIEsPDUSessionResourceNotifyTransfer = []ap.IESpec[ProtocolIEID, PDUSessio } return x.SecondaryRATUsageInformation, true }, + Clear: func(x *PDUSessionResourceNotifyTransfer) { + x.SecondaryRATUsageInformation = nil + }, }, { ID: IDQosFlowFeedbackList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceNotifyTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowFeedbackList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25771,10 +26036,13 @@ var extIEsPDUSessionResourceNotifyTransfer = []ap.IESpec[ProtocolIEID, PDUSessio } return x.QosFlowFeedbackList, true }, + Clear: func(x *PDUSessionResourceNotifyTransfer) { + x.QosFlowFeedbackList = nil + }, }, } -func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceNotifyTransfer.QosFlowNotify.Diagnose(d) { notComprehended = true @@ -25782,19 +26050,19 @@ func (pDUSessionResourceNotifyTransfer *PDUSessionResourceNotifyTransfer) Diagno if pDUSessionResourceNotifyTransfer.QosFlowReleased.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceNotifyTransfer, pDUSessionResourceNotifyTransfer, &pDUSessionResourceNotifyTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer.iEExtensions) w.WriteBit(pDUSessionResourceReleaseCommandTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceReleaseCommandTransfer.Cause.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25820,7 +26088,7 @@ func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommand return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, &pDUSessionResourceReleaseCommandTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, &pDUSessionResourceReleaseCommandTransfer.iEExtensions); err != nil { return err } } @@ -25832,11 +26100,11 @@ func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommand return nil } -var extIEsPDUSessionResourceReleaseCommandTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceReleaseCommandTransfer]{ +var extIEsPDUSessionResourceReleaseCommandTransfer = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceReleaseCommandTransfer]{ { ID: IDQosFlowAdditionalInfoList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceReleaseCommandTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowAdditionalInfoListRelCom if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25851,24 +26119,27 @@ var extIEsPDUSessionResourceReleaseCommandTransfer = []ap.IESpec[ProtocolIEID, P } return x.QosFlowAdditionalInfoList, true }, + Clear: func(x *PDUSessionResourceReleaseCommandTransfer) { + x.QosFlowAdditionalInfoList = nil + }, }, } -func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleaseCommandTransfer *PDUSessionResourceReleaseCommandTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceReleaseCommandTransfer.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceReleaseCommandTransfer, pDUSessionResourceReleaseCommandTransfer, &pDUSessionResourceReleaseCommandTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer.iEExtensions) w.WriteBit(pDUSessionResourceReleaseResponseTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25891,7 +26162,7 @@ func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseRespon return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, &pDUSessionResourceReleaseResponseTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, &pDUSessionResourceReleaseResponseTransfer.iEExtensions); err != nil { return err } } @@ -25903,11 +26174,11 @@ func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseRespon return nil } -var extIEsPDUSessionResourceReleaseResponseTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceReleaseResponseTransfer]{ +var extIEsPDUSessionResourceReleaseResponseTransfer = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceReleaseResponseTransfer]{ { ID: IDSecondaryRATUsageInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceReleaseResponseTransfer, r *per.Reader, enc per.Encoding) error { var v SecondaryRATUsageInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25922,11 +26193,14 @@ var extIEsPDUSessionResourceReleaseResponseTransfer = []ap.IESpec[ProtocolIEID, } return x.SecondaryRATUsageInformation, true }, + Clear: func(x *PDUSessionResourceReleaseResponseTransfer) { + x.SecondaryRATUsageInformation = nil + }, }, { ID: IDQosFlowAdditionalInfoList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceReleaseResponseTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowAdditionalInfoListRelRes if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -25941,17 +26215,20 @@ var extIEsPDUSessionResourceReleaseResponseTransfer = []ap.IESpec[ProtocolIEID, } return x.QosFlowAdditionalInfoList, true }, + Clear: func(x *PDUSessionResourceReleaseResponseTransfer) { + x.QosFlowAdditionalInfoList = nil + }, }, } -func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleaseResponseTransfer *PDUSessionResourceReleaseResponseTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceReleaseResponseTransfer, pDUSessionResourceReleaseResponseTransfer, &pDUSessionResourceReleaseResponseTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot.iEExtensions) w.WriteBit(pDUSessionResourceReleasedItemNot.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceReleasedItemNot.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -25961,7 +26238,7 @@ func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) Mars return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -25990,7 +26267,7 @@ func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, &pDUSessionResourceReleasedItemNot.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, &pDUSessionResourceReleasedItemNot.iEExtensions); err != nil { return err } } @@ -26002,16 +26279,16 @@ func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) Unma return nil } -var extIEsPDUSessionResourceReleasedItemNot []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemNot] +var extIEsPDUSessionResourceReleasedItemNot []apimpl.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemNot] -func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedItemNot *PDUSessionResourceReleasedItemNot) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemNot, pDUSessionResourceReleasedItemNot, &pDUSessionResourceReleasedItemNot.iEExtensions) return notComprehended } func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck.iEExtensions) w.WriteBit(pDUSessionResourceReleasedItemPSAck.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceReleasedItemPSAck.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -26021,7 +26298,7 @@ func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26050,7 +26327,7 @@ func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, &pDUSessionResourceReleasedItemPSAck.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, &pDUSessionResourceReleasedItemPSAck.iEExtensions); err != nil { return err } } @@ -26062,16 +26339,16 @@ func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) return nil } -var extIEsPDUSessionResourceReleasedItemPSAck []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemPSAck] +var extIEsPDUSessionResourceReleasedItemPSAck []apimpl.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemPSAck] -func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedItemPSAck *PDUSessionResourceReleasedItemPSAck) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemPSAck, pDUSessionResourceReleasedItemPSAck, &pDUSessionResourceReleasedItemPSAck.iEExtensions) return notComprehended } func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail.iEExtensions) w.WriteBit(pDUSessionResourceReleasedItemPSFail.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceReleasedItemPSFail.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -26081,7 +26358,7 @@ func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26110,7 +26387,7 @@ func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, &pDUSessionResourceReleasedItemPSFail.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, &pDUSessionResourceReleasedItemPSFail.iEExtensions); err != nil { return err } } @@ -26122,16 +26399,16 @@ func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail return nil } -var extIEsPDUSessionResourceReleasedItemPSFail []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemPSFail] +var extIEsPDUSessionResourceReleasedItemPSFail []apimpl.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemPSFail] -func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedItemPSFail *PDUSessionResourceReleasedItemPSFail) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemPSFail, pDUSessionResourceReleasedItemPSFail, &pDUSessionResourceReleasedItemPSFail.iEExtensions) return notComprehended } func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes.iEExtensions) w.WriteBit(pDUSessionResourceReleasedItemRelRes.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceReleasedItemRelRes.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -26141,7 +26418,7 @@ func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26170,7 +26447,7 @@ func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, &pDUSessionResourceReleasedItemRelRes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, &pDUSessionResourceReleasedItemRelRes.iEExtensions); err != nil { return err } } @@ -26182,16 +26459,16 @@ func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes return nil } -var extIEsPDUSessionResourceReleasedItemRelRes []ap.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemRelRes] +var extIEsPDUSessionResourceReleasedItemRelRes []apimpl.IESpec[ProtocolIEID, PDUSessionResourceReleasedItemRelRes] -func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedItemRelRes *PDUSessionResourceReleasedItemRelRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceReleasedItemRelRes, pDUSessionResourceReleasedItemRelRes, &pDUSessionResourceReleasedItemRelRes.iEExtensions) return notComprehended } func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq.iEExtensions) w.WriteBit(pDUSessionResourceSetupItemCxtReq.extensions.Present()) w.WriteBit(pDUSessionResourceSetupItemCxtReq.NASPDU != nil) w.WriteBit(len(ext) > 0) @@ -26210,7 +26487,7 @@ func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Mars return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26253,7 +26530,7 @@ func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, &pDUSessionResourceSetupItemCxtReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, &pDUSessionResourceSetupItemCxtReq.iEExtensions); err != nil { return err } } @@ -26265,11 +26542,11 @@ func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Unma return nil } -var extIEsPDUSessionResourceSetupItemCxtReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemCxtReq]{ +var extIEsPDUSessionResourceSetupItemCxtReq = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSetupItemCxtReq]{ { ID: IDPduSessionExpectedUEActivityBehaviour, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupItemCxtReq, r *per.Reader, enc per.Encoding) error { var v ExpectedUEActivityBehaviour if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26284,20 +26561,23 @@ var extIEsPDUSessionResourceSetupItemCxtReq = []ap.IESpec[ProtocolIEID, PDUSessi } return x.PduSessionExpectedUEActivityBehaviour, true }, + Clear: func(x *PDUSessionResourceSetupItemCxtReq) { + x.PduSessionExpectedUEActivityBehaviour = nil + }, }, } -func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupItemCxtReq *PDUSessionResourceSetupItemCxtReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceSetupItemCxtReq.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemCxtReq, pDUSessionResourceSetupItemCxtReq, &pDUSessionResourceSetupItemCxtReq.iEExtensions) return notComprehended } func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes.iEExtensions) w.WriteBit(pDUSessionResourceSetupItemCxtRes.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceSetupItemCxtRes.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -26307,7 +26587,7 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Mars return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26336,7 +26616,7 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Unma return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, &pDUSessionResourceSetupItemCxtRes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, &pDUSessionResourceSetupItemCxtRes.iEExtensions); err != nil { return err } } @@ -26348,16 +26628,16 @@ func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Unma return nil } -var extIEsPDUSessionResourceSetupItemCxtRes []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemCxtRes] +var extIEsPDUSessionResourceSetupItemCxtRes []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSetupItemCxtRes] -func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupItemCxtRes *PDUSessionResourceSetupItemCxtRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemCxtRes, pDUSessionResourceSetupItemCxtRes, &pDUSessionResourceSetupItemCxtRes.iEExtensions) return notComprehended } func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq.iEExtensions) w.WriteBit(pDUSessionResourceSetupItemHOReq.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceSetupItemHOReq.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -26370,7 +26650,7 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Marsha return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26402,7 +26682,7 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Unmars return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, &pDUSessionResourceSetupItemHOReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, &pDUSessionResourceSetupItemHOReq.iEExtensions); err != nil { return err } } @@ -26414,11 +26694,11 @@ func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Unmars return nil } -var extIEsPDUSessionResourceSetupItemHOReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemHOReq]{ +var extIEsPDUSessionResourceSetupItemHOReq = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSetupItemHOReq]{ { ID: IDPduSessionExpectedUEActivityBehaviour, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupItemHOReq, r *per.Reader, enc per.Encoding) error { var v ExpectedUEActivityBehaviour if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26433,20 +26713,23 @@ var extIEsPDUSessionResourceSetupItemHOReq = []ap.IESpec[ProtocolIEID, PDUSessio } return x.PduSessionExpectedUEActivityBehaviour, true }, + Clear: func(x *PDUSessionResourceSetupItemHOReq) { + x.PduSessionExpectedUEActivityBehaviour = nil + }, }, } -func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupItemHOReq *PDUSessionResourceSetupItemHOReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceSetupItemHOReq.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemHOReq, pDUSessionResourceSetupItemHOReq, &pDUSessionResourceSetupItemHOReq.iEExtensions) return notComprehended } func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq.iEExtensions) w.WriteBit(pDUSessionResourceSetupItemSUReq.extensions.Present()) w.WriteBit(pDUSessionResourceSetupItemSUReq.NASPDU != nil) w.WriteBit(len(ext) > 0) @@ -26465,7 +26748,7 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Marsha return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26508,7 +26791,7 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Unmars return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, &pDUSessionResourceSetupItemSUReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, &pDUSessionResourceSetupItemSUReq.iEExtensions); err != nil { return err } } @@ -26520,11 +26803,11 @@ func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Unmars return nil } -var extIEsPDUSessionResourceSetupItemSUReq = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemSUReq]{ +var extIEsPDUSessionResourceSetupItemSUReq = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSetupItemSUReq]{ { ID: IDPduSessionExpectedUEActivityBehaviour, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupItemSUReq, r *per.Reader, enc per.Encoding) error { var v ExpectedUEActivityBehaviour if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26539,20 +26822,23 @@ var extIEsPDUSessionResourceSetupItemSUReq = []ap.IESpec[ProtocolIEID, PDUSessio } return x.PduSessionExpectedUEActivityBehaviour, true }, + Clear: func(x *PDUSessionResourceSetupItemSUReq) { + x.PduSessionExpectedUEActivityBehaviour = nil + }, }, } -func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupItemSUReq *PDUSessionResourceSetupItemSUReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceSetupItemSUReq.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemSUReq, pDUSessionResourceSetupItemSUReq, &pDUSessionResourceSetupItemSUReq.iEExtensions) return notComprehended } func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes.iEExtensions) w.WriteBit(pDUSessionResourceSetupItemSURes.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceSetupItemSURes.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -26562,7 +26848,7 @@ func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Marsha return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26591,7 +26877,7 @@ func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Unmars return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, &pDUSessionResourceSetupItemSURes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, &pDUSessionResourceSetupItemSURes.iEExtensions); err != nil { return err } } @@ -26603,16 +26889,16 @@ func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Unmars return nil } -var extIEsPDUSessionResourceSetupItemSURes []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupItemSURes] +var extIEsPDUSessionResourceSetupItemSURes []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSetupItemSURes] -func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupItemSURes *PDUSessionResourceSetupItemSURes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupItemSURes, pDUSessionResourceSetupItemSURes, &pDUSessionResourceSetupItemSURes.iEExtensions) return notComprehended } func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer.iEExtensions) w.WriteBit(pDUSessionResourceSetupResponseTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceSetupResponseTransfer.AdditionalDLQosFlowPerTNLInformation != nil) w.WriteBit(pDUSessionResourceSetupResponseTransfer.SecurityResult != nil) @@ -26637,7 +26923,7 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26692,7 +26978,7 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions); err != nil { return err } } @@ -26704,11 +26990,11 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr return nil } -var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupResponseTransfer]{ +var extIEsPDUSessionResourceSetupResponseTransfer = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSetupResponseTransfer]{ { ID: IDRedundantDLQosFlowPerTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26723,11 +27009,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.RedundantDLQosFlowPerTNLInformation, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.RedundantDLQosFlowPerTNLInformation = nil + }, }, { ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26742,11 +27031,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.AdditionalRedundantDLQosFlowPerTNLInformation, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.AdditionalRedundantDLQosFlowPerTNLInformation = nil + }, }, { ID: IDUsedRSNInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v RedundantPDUSessionInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26761,11 +27053,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.UsedRSNInformation, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.UsedRSNInformation = nil + }, }, { ID: IDGlobalRANNodeID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v GlobalRANNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26780,11 +27075,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.GlobalRANNodeID, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.GlobalRANNodeID = nil + }, }, { ID: IDMBSSupportIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSupportIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26799,11 +27097,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.MBSSupportIndicator, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.MBSSupportIndicator = nil + }, }, { ID: IDMBSSessionSetupResponseList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSessionSetupResponseList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26818,11 +27119,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.MBSSessionSetupResponseList, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.MBSSessionSetupResponseList = nil + }, }, { ID: IDMBSSessionFailedtoSetupList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSessionFailedtoSetupList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26837,11 +27141,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.MBSSessionFailedtoSetupList, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.MBSSessionFailedtoSetupList = nil + }, }, { ID: IDQoSFlowTSCList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v QoSFlowTSCList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26856,11 +27163,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.QoSFlowTSCList, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.QoSFlowTSCList = nil + }, }, { ID: IDUplinkTLContainer, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v TLContainer if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26875,11 +27185,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.UplinkTLContainer, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.UplinkTLContainer = nil + }, }, { ID: IDECNMarkingorCongestionInformationReportingStatus, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v ECNMarkingorCongestionInformationReportingStatus if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26894,11 +27207,14 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.ECNMarkingorCongestionInformationReportingStatus, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.ECNMarkingorCongestionInformationReportingStatus = nil + }, }, { ID: IDPDUSetbasedHandlingIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSetupResponseTransfer, r *per.Reader, enc per.Encoding) error { var v PDUSetbasedHandlingIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -26913,10 +27229,13 @@ var extIEsPDUSessionResourceSetupResponseTransfer = []ap.IESpec[ProtocolIEID, PD } return x.PDUSetbasedHandlingIndicator, true }, + Clear: func(x *PDUSessionResourceSetupResponseTransfer) { + x.PDUSetbasedHandlingIndicator = nil + }, }, } -func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceSetupResponseTransfer.DLQosFlowPerTNLInformation.Diagnose(d) { notComprehended = true @@ -26930,12 +27249,12 @@ func (pDUSessionResourceSetupResponseTransfer *PDUSessionResourceSetupResponseTr if pDUSessionResourceSetupResponseTransfer.QosFlowFailedToSetup.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupResponseTransfer, pDUSessionResourceSetupResponseTransfer, &pDUSessionResourceSetupResponseTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions) w.WriteBit(pDUSessionResourceSetupUnsuccessfulTransfer.extensions.Present()) w.WriteBit(pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil) w.WriteBit(len(ext) > 0) @@ -26948,7 +27267,7 @@ func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsucc } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -26985,7 +27304,7 @@ func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsucc pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, &pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, &pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions); err != nil { return err } } @@ -26997,9 +27316,9 @@ func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsucc return nil } -var extIEsPDUSessionResourceSetupUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PDUSessionResourceSetupUnsuccessfulTransfer] +var extIEsPDUSessionResourceSetupUnsuccessfulTransfer []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSetupUnsuccessfulTransfer] -func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsuccessfulTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionResourceSetupUnsuccessfulTransfer.Cause.Diagnose(d) { notComprehended = true @@ -27007,12 +27326,12 @@ func (pDUSessionResourceSetupUnsuccessfulTransfer *PDUSessionResourceSetupUnsucc if pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics != nil && pDUSessionResourceSetupUnsuccessfulTransfer.CriticalityDiagnostics.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSetupUnsuccessfulTransfer, pDUSessionResourceSetupUnsuccessfulTransfer, &pDUSessionResourceSetupUnsuccessfulTransfer.iEExtensions) return notComprehended } func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem.iEExtensions) w.WriteBit(pDUSessionResourceSwitchedItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceSwitchedItem.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -27022,7 +27341,7 @@ func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27051,7 +27370,7 @@ func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, &pDUSessionResourceSwitchedItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, &pDUSessionResourceSwitchedItem.iEExtensions); err != nil { return err } } @@ -27063,11 +27382,11 @@ func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) UnmarshalP return nil } -var extIEsPDUSessionResourceSwitchedItem = []ap.IESpec[ProtocolIEID, PDUSessionResourceSwitchedItem]{ +var extIEsPDUSessionResourceSwitchedItem = []apimpl.IESpec[ProtocolIEID, PDUSessionResourceSwitchedItem]{ { ID: IDPduSessionExpectedUEActivityBehaviour, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PDUSessionResourceSwitchedItem, r *per.Reader, enc per.Encoding) error { var v ExpectedUEActivityBehaviour if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -27082,17 +27401,20 @@ var extIEsPDUSessionResourceSwitchedItem = []ap.IESpec[ProtocolIEID, PDUSessionR } return x.PduSessionExpectedUEActivityBehaviour, true }, + Clear: func(x *PDUSessionResourceSwitchedItem) { + x.PduSessionExpectedUEActivityBehaviour = nil + }, }, } -func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSwitchedItem *PDUSessionResourceSwitchedItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceSwitchedItem, pDUSessionResourceSwitchedItem, &pDUSessionResourceSwitchedItem.iEExtensions) return notComprehended } func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem.iEExtensions) w.WriteBit(pDUSessionResourceToBeSwitchedDLItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceToBeSwitchedDLItem.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -27102,7 +27424,7 @@ func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27131,7 +27453,7 @@ func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, &pDUSessionResourceToBeSwitchedDLItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, &pDUSessionResourceToBeSwitchedDLItem.iEExtensions); err != nil { return err } } @@ -27143,16 +27465,16 @@ func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem return nil } -var extIEsPDUSessionResourceToBeSwitchedDLItem []ap.IESpec[ProtocolIEID, PDUSessionResourceToBeSwitchedDLItem] +var extIEsPDUSessionResourceToBeSwitchedDLItem []apimpl.IESpec[ProtocolIEID, PDUSessionResourceToBeSwitchedDLItem] -func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceToBeSwitchedDLItem *PDUSessionResourceToBeSwitchedDLItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceToBeSwitchedDLItem, pDUSessionResourceToBeSwitchedDLItem, &pDUSessionResourceToBeSwitchedDLItem.iEExtensions) return notComprehended } func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd.iEExtensions) w.WriteBit(pDUSessionResourceToReleaseItemHOCmd.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceToReleaseItemHOCmd.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -27162,7 +27484,7 @@ func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27191,7 +27513,7 @@ func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, &pDUSessionResourceToReleaseItemHOCmd.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, &pDUSessionResourceToReleaseItemHOCmd.iEExtensions); err != nil { return err } } @@ -27203,16 +27525,16 @@ func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd return nil } -var extIEsPDUSessionResourceToReleaseItemHOCmd []ap.IESpec[ProtocolIEID, PDUSessionResourceToReleaseItemHOCmd] +var extIEsPDUSessionResourceToReleaseItemHOCmd []apimpl.IESpec[ProtocolIEID, PDUSessionResourceToReleaseItemHOCmd] -func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceToReleaseItemHOCmd *PDUSessionResourceToReleaseItemHOCmd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceToReleaseItemHOCmd, pDUSessionResourceToReleaseItemHOCmd, &pDUSessionResourceToReleaseItemHOCmd.iEExtensions) return notComprehended } func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd.iEExtensions) w.WriteBit(pDUSessionResourceToReleaseItemRelCmd.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionResourceToReleaseItemRelCmd.PDUSessionID.MarshalPER(w, enc); err != nil { @@ -27222,7 +27544,7 @@ func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelC return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27251,7 +27573,7 @@ func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelC return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, &pDUSessionResourceToReleaseItemRelCmd.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, &pDUSessionResourceToReleaseItemRelCmd.iEExtensions); err != nil { return err } } @@ -27263,11 +27585,11 @@ func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelC return nil } -var extIEsPDUSessionResourceToReleaseItemRelCmd []ap.IESpec[ProtocolIEID, PDUSessionResourceToReleaseItemRelCmd] +var extIEsPDUSessionResourceToReleaseItemRelCmd []apimpl.IESpec[ProtocolIEID, PDUSessionResourceToReleaseItemRelCmd] -func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceToReleaseItemRelCmd *PDUSessionResourceToReleaseItemRelCmd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionResourceToReleaseItemRelCmd, pDUSessionResourceToReleaseItemRelCmd, &pDUSessionResourceToReleaseItemRelCmd.iEExtensions) return notComprehended } @@ -27288,12 +27610,12 @@ func (pDUSessionType PDUSessionType) Name() string { return enumPDUSessionType.Name(pDUSessionType) } -func (pDUSessionType PDUSessionType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionType PDUSessionType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPDUSessionType.Known(pDUSessionType) } func (pDUSessionUsageReport *PDUSessionUsageReport) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUSessionUsageReport, pDUSessionUsageReport, pDUSessionUsageReport.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUSessionUsageReport, pDUSessionUsageReport, pDUSessionUsageReport.iEExtensions) w.WriteBit(pDUSessionUsageReport.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pDUSessionUsageReport.RATType.MarshalPER(w, enc); err != nil { @@ -27303,7 +27625,7 @@ func (pDUSessionUsageReport *PDUSessionUsageReport) MarshalPER(w *per.Writer, en return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27332,7 +27654,7 @@ func (pDUSessionUsageReport *PDUSessionUsageReport) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionUsageReport, pDUSessionUsageReport, &pDUSessionUsageReport.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUSessionUsageReport, pDUSessionUsageReport, &pDUSessionUsageReport.iEExtensions); err != nil { return err } } @@ -27344,9 +27666,9 @@ func (pDUSessionUsageReport *PDUSessionUsageReport) UnmarshalPER(r *per.Reader, return nil } -var extIEsPDUSessionUsageReport []ap.IESpec[ProtocolIEID, PDUSessionUsageReport] +var extIEsPDUSessionUsageReport []apimpl.IESpec[ProtocolIEID, PDUSessionUsageReport] -func (pDUSessionUsageReport *PDUSessionUsageReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionUsageReport *PDUSessionUsageReport) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUSessionUsageReport.RATType.Diagnose(d) { notComprehended = true @@ -27354,7 +27676,7 @@ func (pDUSessionUsageReport *PDUSessionUsageReport) Diagnose(d *ap.Diagnosis[Pro if pDUSessionUsageReport.PDUSessionTimedReportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUSessionUsageReport, pDUSessionUsageReport, pDUSessionUsageReport.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUSessionUsageReport, pDUSessionUsageReport, &pDUSessionUsageReport.iEExtensions) return notComprehended } @@ -27375,7 +27697,7 @@ func (pDUSessionUsageReportRATType PDUSessionUsageReportRATType) Name() string { return enumPDUSessionUsageReportRATType.Name(pDUSessionUsageReportRATType) } -func (pDUSessionUsageReportRATType PDUSessionUsageReportRATType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionUsageReportRATType PDUSessionUsageReportRATType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPDUSessionUsageReportRATType.Known(pDUSessionUsageReportRATType) } @@ -27396,12 +27718,12 @@ func (pDUSetbasedHandlingIndicator PDUSetbasedHandlingIndicator) Name() string { return enumPDUSetbasedHandlingIndicator.Name(pDUSetbasedHandlingIndicator) } -func (pDUSetbasedHandlingIndicator PDUSetbasedHandlingIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSetbasedHandlingIndicator PDUSetbasedHandlingIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPDUSetbasedHandlingIndicator.Known(pDUSetbasedHandlingIndicator) } func (pDUsetQoSInformation *PDUsetQoSInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUsetQoSInformation, pDUsetQoSInformation, pDUsetQoSInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUsetQoSInformation, pDUsetQoSInformation, pDUsetQoSInformation.iEExtensions) w.WriteBit(pDUsetQoSInformation.extensions.Present()) w.WriteBit(pDUsetQoSInformation.PduSetDelayBudget != nil) w.WriteBit(pDUsetQoSInformation.PduSetErrorRate != nil) @@ -27423,7 +27745,7 @@ func (pDUsetQoSInformation *PDUsetQoSInformation) MarshalPER(w *per.Writer, enc } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27479,7 +27801,7 @@ func (pDUsetQoSInformation *PDUsetQoSInformation) UnmarshalPER(r *per.Reader, en pDUsetQoSInformation.PduSetIntegratedHandlingInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUsetQoSInformation, pDUsetQoSInformation, &pDUsetQoSInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUsetQoSInformation, pDUsetQoSInformation, &pDUsetQoSInformation.iEExtensions); err != nil { return err } } @@ -27491,9 +27813,9 @@ func (pDUsetQoSInformation *PDUsetQoSInformation) UnmarshalPER(r *per.Reader, en return nil } -var extIEsPDUsetQoSInformation []ap.IESpec[ProtocolIEID, PDUsetQoSInformation] +var extIEsPDUsetQoSInformation []apimpl.IESpec[ProtocolIEID, PDUsetQoSInformation] -func (pDUsetQoSInformation *PDUsetQoSInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUsetQoSInformation *PDUsetQoSInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUsetQoSInformation.PduSetDelayBudget != nil && pDUsetQoSInformation.PduSetDelayBudget.Diagnose(d) { notComprehended = true @@ -27504,7 +27826,7 @@ func (pDUsetQoSInformation *PDUsetQoSInformation) Diagnose(d *ap.Diagnosis[Proto if pDUsetQoSInformation.PduSetIntegratedHandlingInformation != nil && pDUsetQoSInformation.PduSetIntegratedHandlingInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUsetQoSInformation, pDUsetQoSInformation, pDUsetQoSInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUsetQoSInformation, pDUsetQoSInformation, &pDUsetQoSInformation.iEExtensions) return notComprehended } @@ -27525,12 +27847,12 @@ func (pDUsetQoSInformationPduSetIntegratedHandlingInformation PDUsetQoSInformati return enumPDUsetQoSInformationPduSetIntegratedHandlingInformation.Name(pDUsetQoSInformationPduSetIntegratedHandlingInformation) } -func (pDUsetQoSInformationPduSetIntegratedHandlingInformation PDUsetQoSInformationPduSetIntegratedHandlingInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pDUsetQoSInformationPduSetIntegratedHandlingInformation PDUsetQoSInformationPduSetIntegratedHandlingInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPDUsetQoSInformationPduSetIntegratedHandlingInformation.Known(pDUsetQoSInformationPduSetIntegratedHandlingInformation) } func (pDUsetQoSParameters *PDUsetQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPDUsetQoSParameters, pDUsetQoSParameters, pDUsetQoSParameters.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPDUsetQoSParameters, pDUsetQoSParameters, pDUsetQoSParameters.iEExtensions) w.WriteBit(pDUsetQoSParameters.extensions.Present()) w.WriteBit(pDUsetQoSParameters.UlPDUSetQoSInformation != nil) w.WriteBit(pDUsetQoSParameters.DlPDUSetQoSInformation != nil) @@ -27546,7 +27868,7 @@ func (pDUsetQoSParameters *PDUsetQoSParameters) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27591,7 +27913,7 @@ func (pDUsetQoSParameters *PDUsetQoSParameters) UnmarshalPER(r *per.Reader, enc pDUsetQoSParameters.DlPDUSetQoSInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPDUsetQoSParameters, pDUsetQoSParameters, &pDUsetQoSParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPDUsetQoSParameters, pDUsetQoSParameters, &pDUsetQoSParameters.iEExtensions); err != nil { return err } } @@ -27603,9 +27925,9 @@ func (pDUsetQoSParameters *PDUsetQoSParameters) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsPDUsetQoSParameters []ap.IESpec[ProtocolIEID, PDUsetQoSParameters] +var extIEsPDUsetQoSParameters []apimpl.IESpec[ProtocolIEID, PDUsetQoSParameters] -func (pDUsetQoSParameters *PDUsetQoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUsetQoSParameters *PDUsetQoSParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pDUsetQoSParameters.UlPDUSetQoSInformation != nil && pDUsetQoSParameters.UlPDUSetQoSInformation.Diagnose(d) { notComprehended = true @@ -27613,19 +27935,19 @@ func (pDUsetQoSParameters *PDUsetQoSParameters) Diagnose(d *ap.Diagnosis[Protoco if pDUsetQoSParameters.DlPDUSetQoSInformation != nil && pDUsetQoSParameters.DlPDUSetQoSInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPDUsetQoSParameters, pDUsetQoSParameters, pDUsetQoSParameters.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPDUsetQoSParameters, pDUsetQoSParameters, &pDUsetQoSParameters.iEExtensions) return notComprehended } func (pEIPSassistanceInformation *PEIPSassistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, pEIPSassistanceInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, pEIPSassistanceInformation.iEExtensions) w.WriteBit(pEIPSassistanceInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pEIPSassistanceInformation.CNsubgroupID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27651,7 +27973,7 @@ func (pEIPSassistanceInformation *PEIPSassistanceInformation) UnmarshalPER(r *pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, &pEIPSassistanceInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, &pEIPSassistanceInformation.iEExtensions); err != nil { return err } } @@ -27663,26 +27985,26 @@ func (pEIPSassistanceInformation *PEIPSassistanceInformation) UnmarshalPER(r *pe return nil } -var extIEsPEIPSassistanceInformation []ap.IESpec[ProtocolIEID, PEIPSassistanceInformation] +var extIEsPEIPSassistanceInformation []apimpl.IESpec[ProtocolIEID, PEIPSassistanceInformation] -func (pEIPSassistanceInformation *PEIPSassistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pEIPSassistanceInformation *PEIPSassistanceInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pEIPSassistanceInformation.CNsubgroupID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, pEIPSassistanceInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPEIPSassistanceInformation, pEIPSassistanceInformation, &pEIPSassistanceInformation.iEExtensions) return notComprehended } func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, pLMNAreaBasedQMC.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, pLMNAreaBasedQMC.iEExtensions) w.WriteBit(pLMNAreaBasedQMC.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pLMNAreaBasedQMC.PlmnListforQMC.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27708,7 +28030,7 @@ func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, &pLMNAreaBasedQMC.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, &pLMNAreaBasedQMC.iEExtensions); err != nil { return err } } @@ -27720,16 +28042,16 @@ func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsPLMNAreaBasedQMC []ap.IESpec[ProtocolIEID, PLMNAreaBasedQMC] +var extIEsPLMNAreaBasedQMC []apimpl.IESpec[ProtocolIEID, PLMNAreaBasedQMC] -func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pLMNAreaBasedQMC *PLMNAreaBasedQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, pLMNAreaBasedQMC.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPLMNAreaBasedQMC, pLMNAreaBasedQMC, &pLMNAreaBasedQMC.iEExtensions) return notComprehended } func (pLMNSupportItem *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPLMNSupportItem, pLMNSupportItem, pLMNSupportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPLMNSupportItem, pLMNSupportItem, pLMNSupportItem.iEExtensions) w.WriteBit(pLMNSupportItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pLMNSupportItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -27739,7 +28061,7 @@ func (pLMNSupportItem *PLMNSupportItem) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27768,7 +28090,7 @@ func (pLMNSupportItem *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPLMNSupportItem, pLMNSupportItem, &pLMNSupportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPLMNSupportItem, pLMNSupportItem, &pLMNSupportItem.iEExtensions); err != nil { return err } } @@ -27780,11 +28102,11 @@ func (pLMNSupportItem *PLMNSupportItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsPLMNSupportItem = []ap.IESpec[ProtocolIEID, PLMNSupportItem]{ +var extIEsPLMNSupportItem = []apimpl.IESpec[ProtocolIEID, PLMNSupportItem]{ { ID: IDNPNSupport, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *PLMNSupportItem, r *per.Reader, enc per.Encoding) error { var v NPNSupport if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -27799,11 +28121,14 @@ var extIEsPLMNSupportItem = []ap.IESpec[ProtocolIEID, PLMNSupportItem]{ } return x.NPNSupport, true }, + Clear: func(x *PLMNSupportItem) { + x.NPNSupport = nil + }, }, { ID: IDExtendedSliceSupportList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *PLMNSupportItem, r *per.Reader, enc per.Encoding) error { var v ExtendedSliceSupportList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -27818,11 +28143,14 @@ var extIEsPLMNSupportItem = []ap.IESpec[ProtocolIEID, PLMNSupportItem]{ } return x.ExtendedSliceSupportList, true }, + Clear: func(x *PLMNSupportItem) { + x.ExtendedSliceSupportList = nil + }, }, { ID: IDOnboardingSupport, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PLMNSupportItem, r *per.Reader, enc per.Encoding) error { var v OnboardingSupport if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -27837,27 +28165,30 @@ var extIEsPLMNSupportItem = []ap.IESpec[ProtocolIEID, PLMNSupportItem]{ } return x.OnboardingSupport, true }, + Clear: func(x *PLMNSupportItem) { + x.OnboardingSupport = nil + }, }, } -func (pLMNSupportItem *PLMNSupportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pLMNSupportItem *PLMNSupportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pLMNSupportItem.SliceSupportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPLMNSupportItem, pLMNSupportItem, pLMNSupportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPLMNSupportItem, pLMNSupportItem, &pLMNSupportItem.iEExtensions) return notComprehended } func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT.iEExtensions) w.WriteBit(pNINPNAreaScopeofMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pNINPNAreaScopeofMDT.CAGListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27883,7 +28214,7 @@ func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) UnmarshalPER(r *per.Reader, en return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, &pNINPNAreaScopeofMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, &pNINPNAreaScopeofMDT.iEExtensions); err != nil { return err } } @@ -27895,26 +28226,26 @@ func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) UnmarshalPER(r *per.Reader, en return nil } -var extIEsPNINPNAreaScopeofMDT []ap.IESpec[ProtocolIEID, PNINPNAreaScopeofMDT] +var extIEsPNINPNAreaScopeofMDT []apimpl.IESpec[ProtocolIEID, PNINPNAreaScopeofMDT] -func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pNINPNAreaScopeofMDT *PNINPNAreaScopeofMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pNINPNAreaScopeofMDT.CAGListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPNINPNAreaScopeofMDT, pNINPNAreaScopeofMDT, &pNINPNAreaScopeofMDT.iEExtensions) return notComprehended } func (pNINPNBasedMDT *PNINPNBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPNINPNBasedMDT, pNINPNBasedMDT, pNINPNBasedMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPNINPNBasedMDT, pNINPNBasedMDT, pNINPNBasedMDT.iEExtensions) w.WriteBit(pNINPNBasedMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pNINPNBasedMDT.CAGListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27940,7 +28271,7 @@ func (pNINPNBasedMDT *PNINPNBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encodi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNBasedMDT, pNINPNBasedMDT, &pNINPNBasedMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNBasedMDT, pNINPNBasedMDT, &pNINPNBasedMDT.iEExtensions); err != nil { return err } } @@ -27952,26 +28283,26 @@ func (pNINPNBasedMDT *PNINPNBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsPNINPNBasedMDT []ap.IESpec[ProtocolIEID, PNINPNBasedMDT] +var extIEsPNINPNBasedMDT []apimpl.IESpec[ProtocolIEID, PNINPNBasedMDT] -func (pNINPNBasedMDT *PNINPNBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pNINPNBasedMDT *PNINPNBasedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pNINPNBasedMDT.CAGListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPNINPNBasedMDT, pNINPNBasedMDT, pNINPNBasedMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPNINPNBasedMDT, pNINPNBasedMDT, &pNINPNBasedMDT.iEExtensions) return notComprehended } func (pNINPNMobilityInformation *PNINPNMobilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, pNINPNMobilityInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, pNINPNMobilityInformation.iEExtensions) w.WriteBit(pNINPNMobilityInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pNINPNMobilityInformation.AllowedPNINPIList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -27997,7 +28328,7 @@ func (pNINPNMobilityInformation *PNINPNMobilityInformation) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, &pNINPNMobilityInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, &pNINPNMobilityInformation.iEExtensions); err != nil { return err } } @@ -28009,14 +28340,14 @@ func (pNINPNMobilityInformation *PNINPNMobilityInformation) UnmarshalPER(r *per. return nil } -var extIEsPNINPNMobilityInformation []ap.IESpec[ProtocolIEID, PNINPNMobilityInformation] +var extIEsPNINPNMobilityInformation []apimpl.IESpec[ProtocolIEID, PNINPNMobilityInformation] -func (pNINPNMobilityInformation *PNINPNMobilityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pNINPNMobilityInformation *PNINPNMobilityInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pNINPNMobilityInformation.AllowedPNINPIList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, pNINPNMobilityInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPNINPNMobilityInformation, pNINPNMobilityInformation, &pNINPNMobilityInformation.iEExtensions) return notComprehended } @@ -28049,7 +28380,7 @@ func (pWSFailedCellIDList *PWSFailedCellIDList) MarshalPER(w *per.Writer, enc pe if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, pWSFailedCellIDList.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, pWSFailedCellIDList.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -28076,7 +28407,7 @@ func (pWSFailedCellIDList *PWSFailedCellIDList) UnmarshalPER(r *per.Reader, enc } pWSFailedCellIDList.NRCGIPWSFailedList = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -28090,20 +28421,20 @@ func (pWSFailedCellIDList *PWSFailedCellIDList) UnmarshalPER(r *per.Reader, enc return nil } -func (pWSFailedCellIDList *PWSFailedCellIDList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pWSFailedCellIDList *PWSFailedCellIDList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case pWSFailedCellIDList.EUTRACGIPWSFailedList != nil: return pWSFailedCellIDList.EUTRACGIPWSFailedList.Diagnose(d) case pWSFailedCellIDList.NRCGIPWSFailedList != nil: return pWSFailedCellIDList.NRCGIPWSFailedList.Diagnose(d) case pWSFailedCellIDList.ChoiceExtension != nil: - d.Unknown(pWSFailedCellIDList.ChoiceExtension.ID, pWSFailedCellIDList.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, pWSFailedCellIDList.ChoiceExtension) } return false } func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPacketErrorRate, packetErrorRate, packetErrorRate.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPacketErrorRate, packetErrorRate, packetErrorRate.iEExtensions) w.WriteBit(packetErrorRate.extensions.Present()) w.WriteBit(len(ext) > 0) if err := packetErrorRate.Scalar.MarshalPER(w, enc); err != nil { @@ -28113,7 +28444,7 @@ func (packetErrorRate *PacketErrorRate) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -28142,7 +28473,7 @@ func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPacketErrorRate, packetErrorRate, &packetErrorRate.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPacketErrorRate, packetErrorRate, &packetErrorRate.iEExtensions); err != nil { return err } } @@ -28154,9 +28485,9 @@ func (packetErrorRate *PacketErrorRate) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsPacketErrorRate []ap.IESpec[ProtocolIEID, PacketErrorRate] +var extIEsPacketErrorRate []apimpl.IESpec[ProtocolIEID, PacketErrorRate] -func (packetErrorRate *PacketErrorRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (packetErrorRate *PacketErrorRate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if packetErrorRate.Scalar.Diagnose(d) { notComprehended = true @@ -28164,12 +28495,12 @@ func (packetErrorRate *PacketErrorRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if packetErrorRate.Exponent.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPacketErrorRate, packetErrorRate, packetErrorRate.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPacketErrorRate, packetErrorRate, &packetErrorRate.iEExtensions) return notComprehended } func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE.iEExtensions) w.WriteBit(pagingAssisDataforCEcapabUE.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pagingAssisDataforCEcapabUE.EUTRACGI.MarshalPER(w, enc); err != nil { @@ -28179,7 +28510,7 @@ func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) MarshalPER(w *pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -28208,7 +28539,7 @@ func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) UnmarshalPER(r * return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, &pagingAssisDataforCEcapabUE.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, &pagingAssisDataforCEcapabUE.iEExtensions); err != nil { return err } } @@ -28220,19 +28551,19 @@ func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) UnmarshalPER(r * return nil } -var extIEsPagingAssisDataforCEcapabUE []ap.IESpec[ProtocolIEID, PagingAssisDataforCEcapabUE] +var extIEsPagingAssisDataforCEcapabUE []apimpl.IESpec[ProtocolIEID, PagingAssisDataforCEcapabUE] -func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pagingAssisDataforCEcapabUE *PagingAssisDataforCEcapabUE) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pagingAssisDataforCEcapabUE.EUTRACGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPagingAssisDataforCEcapabUE, pagingAssisDataforCEcapabUE, &pagingAssisDataforCEcapabUE.iEExtensions) return notComprehended } func (pagingAttemptInformation *PagingAttemptInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPagingAttemptInformation, pagingAttemptInformation, pagingAttemptInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPagingAttemptInformation, pagingAttemptInformation, pagingAttemptInformation.iEExtensions) w.WriteBit(pagingAttemptInformation.extensions.Present()) w.WriteBit(pagingAttemptInformation.NextPagingAreaScope != nil) w.WriteBit(len(ext) > 0) @@ -28248,7 +28579,7 @@ func (pagingAttemptInformation *PagingAttemptInformation) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -28288,7 +28619,7 @@ func (pagingAttemptInformation *PagingAttemptInformation) UnmarshalPER(r *per.Re pagingAttemptInformation.NextPagingAreaScope = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPagingAttemptInformation, pagingAttemptInformation, &pagingAttemptInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPagingAttemptInformation, pagingAttemptInformation, &pagingAttemptInformation.iEExtensions); err != nil { return err } } @@ -28300,9 +28631,9 @@ func (pagingAttemptInformation *PagingAttemptInformation) UnmarshalPER(r *per.Re return nil } -var extIEsPagingAttemptInformation []ap.IESpec[ProtocolIEID, PagingAttemptInformation] +var extIEsPagingAttemptInformation []apimpl.IESpec[ProtocolIEID, PagingAttemptInformation] -func (pagingAttemptInformation *PagingAttemptInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pagingAttemptInformation *PagingAttemptInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pagingAttemptInformation.PagingAttemptCount.Diagnose(d) { notComprehended = true @@ -28313,7 +28644,7 @@ func (pagingAttemptInformation *PagingAttemptInformation) Diagnose(d *ap.Diagnos if pagingAttemptInformation.NextPagingAreaScope != nil && pagingAttemptInformation.NextPagingAreaScope.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPagingAttemptInformation, pagingAttemptInformation, pagingAttemptInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPagingAttemptInformation, pagingAttemptInformation, &pagingAttemptInformation.iEExtensions) return notComprehended } @@ -28334,7 +28665,7 @@ func (pagingCause PagingCause) Name() string { return enumPagingCause.Name(pagingCause) } -func (pagingCause PagingCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pagingCause PagingCause) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPagingCause.Known(pagingCause) } @@ -28355,7 +28686,7 @@ func (pagingCauseIndicationForVoiceService PagingCauseIndicationForVoiceService) return enumPagingCauseIndicationForVoiceService.Name(pagingCauseIndicationForVoiceService) } -func (pagingCauseIndicationForVoiceService PagingCauseIndicationForVoiceService) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pagingCauseIndicationForVoiceService PagingCauseIndicationForVoiceService) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPagingCauseIndicationForVoiceService.Known(pagingCauseIndicationForVoiceService) } @@ -28376,7 +28707,7 @@ func (pagingDRX PagingDRX) Name() string { return enumPagingDRX.Name(pagingDRX) } -func (pagingDRX PagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pagingDRX PagingDRX) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPagingDRX.Known(pagingDRX) } @@ -28397,7 +28728,7 @@ func (pagingOrigin PagingOrigin) Name() string { return enumPagingOrigin.Name(pagingOrigin) } -func (pagingOrigin PagingOrigin) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pagingOrigin PagingOrigin) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPagingOrigin.Known(pagingOrigin) } @@ -28418,7 +28749,7 @@ func (pagingPriority PagingPriority) Name() string { return enumPagingPriority.Name(pagingPriority) } -func (pagingPriority PagingPriority) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pagingPriority PagingPriority) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPagingPriority.Known(pagingPriority) } @@ -28439,19 +28770,19 @@ func (pagingProbabilityInformation PagingProbabilityInformation) Name() string { return enumPagingProbabilityInformation.Name(pagingProbabilityInformation) } -func (pagingProbabilityInformation PagingProbabilityInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pagingProbabilityInformation PagingProbabilityInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPagingProbabilityInformation.Known(pagingProbabilityInformation) } func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem.iEExtensions) w.WriteBit(partiallyAllowedNSSAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := partiallyAllowedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -28477,7 +28808,7 @@ func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, &partiallyAllowedNSSAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, &partiallyAllowedNSSAIItem.iEExtensions); err != nil { return err } } @@ -28489,19 +28820,19 @@ func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) UnmarshalPER(r *per. return nil } -var extIEsPartiallyAllowedNSSAIItem []ap.IESpec[ProtocolIEID, PartiallyAllowedNSSAIItem] +var extIEsPartiallyAllowedNSSAIItem []apimpl.IESpec[ProtocolIEID, PartiallyAllowedNSSAIItem] -func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (partiallyAllowedNSSAIItem *PartiallyAllowedNSSAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if partiallyAllowedNSSAIItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPartiallyAllowedNSSAIItem, partiallyAllowedNSSAIItem, &partiallyAllowedNSSAIItem.iEExtensions) return notComprehended } func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer.iEExtensions) w.WriteBit(pathSwitchRequestAcknowledgeTransfer.extensions.Present()) w.WriteBit(pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil) w.WriteBit(pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil) @@ -28517,7 +28848,7 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -28562,7 +28893,7 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer pathSwitchRequestAcknowledgeTransfer.SecurityIndication = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions); err != nil { return err } } @@ -28574,11 +28905,11 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer return nil } -var extIEsPathSwitchRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, PathSwitchRequestAcknowledgeTransfer]{ +var extIEsPathSwitchRequestAcknowledgeTransfer = []apimpl.IESpec[ProtocolIEID, PathSwitchRequestAcknowledgeTransfer]{ { ID: IDAdditionalNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformationPairList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28593,11 +28924,14 @@ var extIEsPathSwitchRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, PathS } return x.AdditionalNGUUPTNLInformation, true }, + Clear: func(x *PathSwitchRequestAcknowledgeTransfer) { + x.AdditionalNGUUPTNLInformation = nil + }, }, { ID: IDRedundantULNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28612,11 +28946,14 @@ var extIEsPathSwitchRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, PathS } return x.RedundantULNGUUPTNLInformation, true }, + Clear: func(x *PathSwitchRequestAcknowledgeTransfer) { + x.RedundantULNGUUPTNLInformation = nil + }, }, { ID: IDAdditionalRedundantNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformationPairList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28631,11 +28968,14 @@ var extIEsPathSwitchRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, PathS } return x.AdditionalRedundantNGUUPTNLInformation, true }, + Clear: func(x *PathSwitchRequestAcknowledgeTransfer) { + x.AdditionalRedundantNGUUPTNLInformation = nil + }, }, { ID: IDQosFlowParametersList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestAcknowledgeTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowParametersList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28650,10 +28990,13 @@ var extIEsPathSwitchRequestAcknowledgeTransfer = []ap.IESpec[ProtocolIEID, PathS } return x.QosFlowParametersList, true }, + Clear: func(x *PathSwitchRequestAcknowledgeTransfer) { + x.QosFlowParametersList = nil + }, }, } -func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation != nil && pathSwitchRequestAcknowledgeTransfer.ULNGUUPTNLInformation.Diagnose(d) { notComprehended = true @@ -28661,19 +29004,19 @@ func (pathSwitchRequestAcknowledgeTransfer *PathSwitchRequestAcknowledgeTransfer if pathSwitchRequestAcknowledgeTransfer.SecurityIndication != nil && pathSwitchRequestAcknowledgeTransfer.SecurityIndication.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPathSwitchRequestAcknowledgeTransfer, pathSwitchRequestAcknowledgeTransfer, &pathSwitchRequestAcknowledgeTransfer.iEExtensions) return notComprehended } func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer.iEExtensions) w.WriteBit(pathSwitchRequestSetupFailedTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pathSwitchRequestSetupFailedTransfer.Cause.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -28699,7 +29042,7 @@ func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, &pathSwitchRequestSetupFailedTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, &pathSwitchRequestSetupFailedTransfer.iEExtensions); err != nil { return err } } @@ -28711,19 +29054,19 @@ func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer return nil } -var extIEsPathSwitchRequestSetupFailedTransfer []ap.IESpec[ProtocolIEID, PathSwitchRequestSetupFailedTransfer] +var extIEsPathSwitchRequestSetupFailedTransfer []apimpl.IESpec[ProtocolIEID, PathSwitchRequestSetupFailedTransfer] -func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pathSwitchRequestSetupFailedTransfer *PathSwitchRequestSetupFailedTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pathSwitchRequestSetupFailedTransfer.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPathSwitchRequestSetupFailedTransfer, pathSwitchRequestSetupFailedTransfer, &pathSwitchRequestSetupFailedTransfer.iEExtensions) return notComprehended } func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, pathSwitchRequestTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, pathSwitchRequestTransfer.iEExtensions) w.WriteBit(pathSwitchRequestTransfer.extensions.Present()) w.WriteBit(pathSwitchRequestTransfer.DLNGUTNLInformationReused != nil) w.WriteBit(pathSwitchRequestTransfer.UserPlaneSecurityInformation != nil) @@ -28745,7 +29088,7 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -28796,7 +29139,7 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions); err != nil { return err } } @@ -28808,11 +29151,11 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) UnmarshalPER(r *per. return nil } -var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchRequestTransfer]{ +var extIEsPathSwitchRequestTransfer = []apimpl.IESpec[ProtocolIEID, PathSwitchRequestTransfer]{ { ID: IDAdditionalDLQosFlowPerTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28827,11 +29170,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.AdditionalDLQosFlowPerTNLInformation, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.AdditionalDLQosFlowPerTNLInformation = nil + }, }, { ID: IDRedundantDLNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28846,11 +29192,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.RedundantDLNGUUPTNLInformation, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.RedundantDLNGUUPTNLInformation = nil + }, }, { ID: IDRedundantDLNGUTNLInformationReused, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v DLNGUTNLInformationReused if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28865,11 +29214,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.RedundantDLNGUTNLInformationReused, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.RedundantDLNGUTNLInformationReused = nil + }, }, { ID: IDAdditionalRedundantDLQosFlowPerTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v QosFlowPerTNLInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28884,11 +29236,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.AdditionalRedundantDLQosFlowPerTNLInformation, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.AdditionalRedundantDLQosFlowPerTNLInformation = nil + }, }, { ID: IDUsedRSNInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v RedundantPDUSessionInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28903,11 +29258,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.UsedRSNInformation, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.UsedRSNInformation = nil + }, }, { ID: IDGlobalRANNodeID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v GlobalRANNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28922,11 +29280,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.GlobalRANNodeID, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.GlobalRANNodeID = nil + }, }, { ID: IDMBSSupportIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v MBSSupportIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28941,11 +29302,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.MBSSupportIndicator, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.MBSSupportIndicator = nil + }, }, { ID: IDPDUSetbasedHandlingIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v PDUSetbasedHandlingIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28960,11 +29324,14 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.PDUSetbasedHandlingIndicator, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.PDUSetbasedHandlingIndicator = nil + }, }, { ID: IDECNMarkingorCongestionInformationReportingStatus, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *PathSwitchRequestTransfer, r *per.Reader, enc per.Encoding) error { var v ECNMarkingorCongestionInformationReportingStatus if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -28979,10 +29346,13 @@ var extIEsPathSwitchRequestTransfer = []ap.IESpec[ProtocolIEID, PathSwitchReques } return x.ECNMarkingorCongestionInformationReportingStatus, true }, + Clear: func(x *PathSwitchRequestTransfer) { + x.ECNMarkingorCongestionInformationReportingStatus = nil + }, }, } -func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pathSwitchRequestTransfer.DLNGUUPTNLInformation.Diagnose(d) { notComprehended = true @@ -28996,19 +29366,19 @@ func (pathSwitchRequestTransfer *PathSwitchRequestTransfer) Diagnose(d *ap.Diagn if pathSwitchRequestTransfer.QosFlowAccepted.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, pathSwitchRequestTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPathSwitchRequestTransfer, pathSwitchRequestTransfer, &pathSwitchRequestTransfer.iEExtensions) return notComprehended } func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer.iEExtensions) w.WriteBit(pathSwitchRequestUnsuccessfulTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if err := pathSwitchRequestUnsuccessfulTransfer.Cause.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29034,7 +29404,7 @@ func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransf return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, &pathSwitchRequestUnsuccessfulTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, &pathSwitchRequestUnsuccessfulTransfer.iEExtensions); err != nil { return err } } @@ -29046,14 +29416,14 @@ func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransf return nil } -var extIEsPathSwitchRequestUnsuccessfulTransfer []ap.IESpec[ProtocolIEID, PathSwitchRequestUnsuccessfulTransfer] +var extIEsPathSwitchRequestUnsuccessfulTransfer []apimpl.IESpec[ProtocolIEID, PathSwitchRequestUnsuccessfulTransfer] -func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pathSwitchRequestUnsuccessfulTransfer *PathSwitchRequestUnsuccessfulTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if pathSwitchRequestUnsuccessfulTransfer.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPathSwitchRequestUnsuccessfulTransfer, pathSwitchRequestUnsuccessfulTransfer, &pathSwitchRequestUnsuccessfulTransfer.iEExtensions) return notComprehended } @@ -29074,19 +29444,19 @@ func (pedestrianUE PedestrianUE) Name() string { return enumPedestrianUE.Name(pedestrianUE) } -func (pedestrianUE PedestrianUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (pedestrianUE PedestrianUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPedestrianUE.Known(pedestrianUE) } func (periodicReportingIEs *PeriodicReportingIEs) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPeriodicReportingIEs, periodicReportingIEs, periodicReportingIEs.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPeriodicReportingIEs, periodicReportingIEs, periodicReportingIEs.iEExtensions) w.WriteBit(periodicReportingIEs.extensions.Present()) w.WriteBit(len(ext) > 0) if err := periodicReportingIEs.ReportingPeriodicity.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29112,7 +29482,7 @@ func (periodicReportingIEs *PeriodicReportingIEs) UnmarshalPER(r *per.Reader, en return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPeriodicReportingIEs, periodicReportingIEs, &periodicReportingIEs.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPeriodicReportingIEs, periodicReportingIEs, &periodicReportingIEs.iEExtensions); err != nil { return err } } @@ -29124,19 +29494,19 @@ func (periodicReportingIEs *PeriodicReportingIEs) UnmarshalPER(r *per.Reader, en return nil } -var extIEsPeriodicReportingIEs []ap.IESpec[ProtocolIEID, PeriodicReportingIEs] +var extIEsPeriodicReportingIEs []apimpl.IESpec[ProtocolIEID, PeriodicReportingIEs] -func (periodicReportingIEs *PeriodicReportingIEs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (periodicReportingIEs *PeriodicReportingIEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if periodicReportingIEs.ReportingPeriodicity.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPeriodicReportingIEs, periodicReportingIEs, periodicReportingIEs.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPeriodicReportingIEs, periodicReportingIEs, &periodicReportingIEs.iEExtensions) return notComprehended } func (periodicityBound *PeriodicityBound) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPeriodicityBound, periodicityBound, periodicityBound.iEExtensions) + ext := apimpl.ExtensionFields(extIEsPeriodicityBound, periodicityBound, periodicityBound.iEExtensions) w.WriteBit(periodicityBound.extensions.Present()) w.WriteBit(len(ext) > 0) if err := periodicityBound.PeriodicityLowerBound.MarshalPER(w, enc); err != nil { @@ -29146,7 +29516,7 @@ func (periodicityBound *PeriodicityBound) MarshalPER(w *per.Writer, enc per.Enco return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29175,7 +29545,7 @@ func (periodicityBound *PeriodicityBound) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPeriodicityBound, periodicityBound, &periodicityBound.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPeriodicityBound, periodicityBound, &periodicityBound.iEExtensions); err != nil { return err } } @@ -29187,9 +29557,9 @@ func (periodicityBound *PeriodicityBound) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsPeriodicityBound []ap.IESpec[ProtocolIEID, PeriodicityBound] +var extIEsPeriodicityBound []apimpl.IESpec[ProtocolIEID, PeriodicityBound] -func (periodicityBound *PeriodicityBound) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (periodicityBound *PeriodicityBound) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if periodicityBound.PeriodicityLowerBound.Diagnose(d) { notComprehended = true @@ -29197,7 +29567,7 @@ func (periodicityBound *PeriodicityBound) Diagnose(d *ap.Diagnosis[ProtocolIEID] if periodicityBound.PeriodicityUpperBound.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsPeriodicityBound, periodicityBound, periodicityBound.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPeriodicityBound, periodicityBound, &periodicityBound.iEExtensions) return notComprehended } @@ -29230,7 +29600,7 @@ func (periodicityRange *PeriodicityRange) MarshalPER(w *per.Writer, enc per.Enco if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, periodicityRange.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, periodicityRange.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -29257,7 +29627,7 @@ func (periodicityRange *PeriodicityRange) UnmarshalPER(r *per.Reader, enc per.En } periodicityRange.PeriodicityList = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -29271,14 +29641,14 @@ func (periodicityRange *PeriodicityRange) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (periodicityRange *PeriodicityRange) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (periodicityRange *PeriodicityRange) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case periodicityRange.PeriodicityBound != nil: return periodicityRange.PeriodicityBound.Diagnose(d) case periodicityRange.PeriodicityList != nil: return periodicityRange.PeriodicityList.Diagnose(d) case periodicityRange.ChoiceExtension != nil: - d.Unknown(periodicityRange.ChoiceExtension.ID, periodicityRange.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, periodicityRange.ChoiceExtension) } return false } @@ -29300,7 +29670,7 @@ func (preemptionCapability PreemptionCapability) Name() string { return enumPreemptionCapability.Name(preemptionCapability) } -func (preemptionCapability PreemptionCapability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (preemptionCapability PreemptionCapability) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPreemptionCapability.Known(preemptionCapability) } @@ -29321,19 +29691,19 @@ func (preemptionVulnerability PreemptionVulnerability) Name() string { return enumPreemptionVulnerability.Name(preemptionVulnerability) } -func (preemptionVulnerability PreemptionVulnerability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (preemptionVulnerability PreemptionVulnerability) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumPreemptionVulnerability.Known(preemptionVulnerability) } func (qMCConfigInfo *QMCConfigInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQMCConfigInfo, qMCConfigInfo, qMCConfigInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQMCConfigInfo, qMCConfigInfo, qMCConfigInfo.iEExtensions) w.WriteBit(qMCConfigInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qMCConfigInfo.UEAppLayerMeasInfoList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29359,7 +29729,7 @@ func (qMCConfigInfo *QMCConfigInfo) UnmarshalPER(r *per.Reader, enc per.Encoding return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQMCConfigInfo, qMCConfigInfo, &qMCConfigInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQMCConfigInfo, qMCConfigInfo, &qMCConfigInfo.iEExtensions); err != nil { return err } } @@ -29371,26 +29741,26 @@ func (qMCConfigInfo *QMCConfigInfo) UnmarshalPER(r *per.Reader, enc per.Encoding return nil } -var extIEsQMCConfigInfo []ap.IESpec[ProtocolIEID, QMCConfigInfo] +var extIEsQMCConfigInfo []apimpl.IESpec[ProtocolIEID, QMCConfigInfo] -func (qMCConfigInfo *QMCConfigInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qMCConfigInfo *QMCConfigInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qMCConfigInfo.UEAppLayerMeasInfoList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQMCConfigInfo, qMCConfigInfo, qMCConfigInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQMCConfigInfo, qMCConfigInfo, &qMCConfigInfo.iEExtensions) return notComprehended } func (qMCDeactivation *QMCDeactivation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQMCDeactivation, qMCDeactivation, qMCDeactivation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQMCDeactivation, qMCDeactivation, qMCDeactivation.iEExtensions) w.WriteBit(qMCDeactivation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qMCDeactivation.QoEReferenceList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29416,7 +29786,7 @@ func (qMCDeactivation *QMCDeactivation) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQMCDeactivation, qMCDeactivation, &qMCDeactivation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQMCDeactivation, qMCDeactivation, &qMCDeactivation.iEExtensions); err != nil { return err } } @@ -29428,16 +29798,16 @@ func (qMCDeactivation *QMCDeactivation) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsQMCDeactivation []ap.IESpec[ProtocolIEID, QMCDeactivation] +var extIEsQMCDeactivation []apimpl.IESpec[ProtocolIEID, QMCDeactivation] -func (qMCDeactivation *QMCDeactivation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qMCDeactivation *QMCDeactivation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsQMCDeactivation, qMCDeactivation, qMCDeactivation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQMCDeactivation, qMCDeactivation, &qMCDeactivation.iEExtensions) return notComprehended } func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, qoERVQoEReportingPaths.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, qoERVQoEReportingPaths.iEExtensions) w.WriteBit(qoERVQoEReportingPaths.extensions.Present()) w.WriteBit(qoERVQoEReportingPaths.QoEReportingPath != nil) w.WriteBit(qoERVQoEReportingPaths.RVQoEReportingPath != nil) @@ -29453,7 +29823,7 @@ func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) MarshalPER(w *per.Writer, } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29498,7 +29868,7 @@ func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) UnmarshalPER(r *per.Reader qoERVQoEReportingPaths.RVQoEReportingPath = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, &qoERVQoEReportingPaths.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, &qoERVQoEReportingPaths.iEExtensions); err != nil { return err } } @@ -29510,9 +29880,9 @@ func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) UnmarshalPER(r *per.Reader return nil } -var extIEsQoERVQoEReportingPaths []ap.IESpec[ProtocolIEID, QoERVQoEReportingPaths] +var extIEsQoERVQoEReportingPaths []apimpl.IESpec[ProtocolIEID, QoERVQoEReportingPaths] -func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qoERVQoEReportingPaths.QoEReportingPath != nil && qoERVQoEReportingPaths.QoEReportingPath.Diagnose(d) { notComprehended = true @@ -29520,7 +29890,7 @@ func (qoERVQoEReportingPaths *QoERVQoEReportingPaths) Diagnose(d *ap.Diagnosis[P if qoERVQoEReportingPaths.RVQoEReportingPath != nil && qoERVQoEReportingPaths.RVQoEReportingPath.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, qoERVQoEReportingPaths.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQoERVQoEReportingPaths, qoERVQoEReportingPaths, &qoERVQoEReportingPaths.iEExtensions) return notComprehended } @@ -29541,7 +29911,7 @@ func (qoERVQoEReportingPathsQoEReportingPath QoERVQoEReportingPathsQoEReportingP return enumQoERVQoEReportingPathsQoEReportingPath.Name(qoERVQoEReportingPathsQoEReportingPath) } -func (qoERVQoEReportingPathsQoEReportingPath QoERVQoEReportingPathsQoEReportingPath) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (qoERVQoEReportingPathsQoEReportingPath QoERVQoEReportingPathsQoEReportingPath) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumQoERVQoEReportingPathsQoEReportingPath.Known(qoERVQoEReportingPathsQoEReportingPath) } @@ -29562,12 +29932,12 @@ func (qoERVQoEReportingPathsRVQoEReportingPath QoERVQoEReportingPathsRVQoEReport return enumQoERVQoEReportingPathsRVQoEReportingPath.Name(qoERVQoEReportingPathsRVQoEReportingPath) } -func (qoERVQoEReportingPathsRVQoEReportingPath QoERVQoEReportingPathsRVQoEReportingPath) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (qoERVQoEReportingPathsRVQoEReportingPath QoERVQoEReportingPathsRVQoEReportingPath) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumQoERVQoEReportingPathsRVQoEReportingPath.Known(qoERVQoEReportingPathsRVQoEReportingPath) } func (qoSFlowTSCItem *QoSFlowTSCItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQoSFlowTSCItem, qoSFlowTSCItem, qoSFlowTSCItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQoSFlowTSCItem, qoSFlowTSCItem, qoSFlowTSCItem.iEExtensions) w.WriteBit(qoSFlowTSCItem.extensions.Present()) w.WriteBit(qoSFlowTSCItem.TSCTrafficCharacteristicsFeedback != nil) w.WriteBit(qoSFlowTSCItem.ANPacketDelayBudgetUL != nil) @@ -29586,7 +29956,7 @@ func (qoSFlowTSCItem *QoSFlowTSCItem) MarshalPER(w *per.Writer, enc per.Encoding } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29634,7 +30004,7 @@ func (qoSFlowTSCItem *QoSFlowTSCItem) UnmarshalPER(r *per.Reader, enc per.Encodi qoSFlowTSCItem.ANPacketDelayBudgetUL = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQoSFlowTSCItem, qoSFlowTSCItem, &qoSFlowTSCItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQoSFlowTSCItem, qoSFlowTSCItem, &qoSFlowTSCItem.iEExtensions); err != nil { return err } } @@ -29646,9 +30016,9 @@ func (qoSFlowTSCItem *QoSFlowTSCItem) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsQoSFlowTSCItem []ap.IESpec[ProtocolIEID, QoSFlowTSCItem] +var extIEsQoSFlowTSCItem []apimpl.IESpec[ProtocolIEID, QoSFlowTSCItem] -func (qoSFlowTSCItem *QoSFlowTSCItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qoSFlowTSCItem *QoSFlowTSCItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qoSFlowTSCItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -29659,12 +30029,12 @@ func (qoSFlowTSCItem *QoSFlowTSCItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bo if qoSFlowTSCItem.ANPacketDelayBudgetUL != nil && qoSFlowTSCItem.ANPacketDelayBudgetUL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQoSFlowTSCItem, qoSFlowTSCItem, qoSFlowTSCItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQoSFlowTSCItem, qoSFlowTSCItem, &qoSFlowTSCItem.iEExtensions) return notComprehended } func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, qoSFlowsUsageReportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, qoSFlowsUsageReportItem.iEExtensions) w.WriteBit(qoSFlowsUsageReportItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qoSFlowsUsageReportItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { @@ -29677,7 +30047,7 @@ func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) MarshalPER(w *per.Writer return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29709,7 +30079,7 @@ func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, &qoSFlowsUsageReportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, &qoSFlowsUsageReportItem.iEExtensions); err != nil { return err } } @@ -29721,9 +30091,9 @@ func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) UnmarshalPER(r *per.Read return nil } -var extIEsQoSFlowsUsageReportItem []ap.IESpec[ProtocolIEID, QoSFlowsUsageReportItem] +var extIEsQoSFlowsUsageReportItem []apimpl.IESpec[ProtocolIEID, QoSFlowsUsageReportItem] -func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qoSFlowsUsageReportItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -29734,7 +30104,7 @@ func (qoSFlowsUsageReportItem *QoSFlowsUsageReportItem) Diagnose(d *ap.Diagnosis if qoSFlowsUsageReportItem.QoSFlowsTimedReportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, qoSFlowsUsageReportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQoSFlowsUsageReportItem, qoSFlowsUsageReportItem, &qoSFlowsUsageReportItem.iEExtensions) return notComprehended } @@ -29755,7 +30125,7 @@ func (qoSFlowsUsageReportItemRATType QoSFlowsUsageReportItemRATType) Name() stri return enumQoSFlowsUsageReportItemRATType.Name(qoSFlowsUsageReportItemRATType) } -func (qoSFlowsUsageReportItemRATType QoSFlowsUsageReportItemRATType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (qoSFlowsUsageReportItemRATType QoSFlowsUsageReportItemRATType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumQoSFlowsUsageReportItemRATType.Known(qoSFlowsUsageReportItemRATType) } @@ -29788,7 +30158,7 @@ func (qosCharacteristics *QosCharacteristics) MarshalPER(w *per.Writer, enc per. if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, qosCharacteristics.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, qosCharacteristics.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -29815,7 +30185,7 @@ func (qosCharacteristics *QosCharacteristics) UnmarshalPER(r *per.Reader, enc pe } qosCharacteristics.Dynamic5QI = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -29829,27 +30199,27 @@ func (qosCharacteristics *QosCharacteristics) UnmarshalPER(r *per.Reader, enc pe return nil } -func (qosCharacteristics *QosCharacteristics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosCharacteristics *QosCharacteristics) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case qosCharacteristics.NonDynamic5QI != nil: return qosCharacteristics.NonDynamic5QI.Diagnose(d) case qosCharacteristics.Dynamic5QI != nil: return qosCharacteristics.Dynamic5QI.Diagnose(d) case qosCharacteristics.ChoiceExtension != nil: - d.Unknown(qosCharacteristics.ChoiceExtension.ID, qosCharacteristics.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, qosCharacteristics.ChoiceExtension) } return false } func (qosFlowAcceptedItem *QosFlowAcceptedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, qosFlowAcceptedItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, qosFlowAcceptedItem.iEExtensions) w.WriteBit(qosFlowAcceptedItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowAcceptedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29875,7 +30245,7 @@ func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, &qosFlowAcceptedItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, &qosFlowAcceptedItem.iEExtensions); err != nil { return err } } @@ -29887,11 +30257,11 @@ func (qosFlowAcceptedItem *QosFlowAcceptedItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsQosFlowAcceptedItem = []ap.IESpec[ProtocolIEID, QosFlowAcceptedItem]{ +var extIEsQosFlowAcceptedItem = []apimpl.IESpec[ProtocolIEID, QosFlowAcceptedItem]{ { ID: IDCurrentQoSParaSetIndex, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAcceptedItem, r *per.Reader, enc per.Encoding) error { var v AlternativeQoSParaSetIndex if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -29906,20 +30276,23 @@ var extIEsQosFlowAcceptedItem = []ap.IESpec[ProtocolIEID, QosFlowAcceptedItem]{ } return x.CurrentQoSParaSetIndex, true }, + Clear: func(x *QosFlowAcceptedItem) { + x.CurrentQoSParaSetIndex = nil + }, }, } -func (qosFlowAcceptedItem *QosFlowAcceptedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAcceptedItem *QosFlowAcceptedItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowAcceptedItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, qosFlowAcceptedItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowAcceptedItem, qosFlowAcceptedItem, &qosFlowAcceptedItem.iEExtensions) return notComprehended } func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem.iEExtensions) w.WriteBit(qosFlowAddOrModifyRequestItem.extensions.Present()) w.WriteBit(qosFlowAddOrModifyRequestItem.QosFlowLevelQosParameters != nil) w.WriteBit(qosFlowAddOrModifyRequestItem.ERABID != nil) @@ -29938,7 +30311,7 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) MarshalPER(w } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -29986,7 +30359,7 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER qosFlowAddOrModifyRequestItem.ERABID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions); err != nil { return err } } @@ -29998,11 +30371,11 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) UnmarshalPER return nil } -var extIEsQosFlowAddOrModifyRequestItem = []ap.IESpec[ProtocolIEID, QosFlowAddOrModifyRequestItem]{ +var extIEsQosFlowAddOrModifyRequestItem = []apimpl.IESpec[ProtocolIEID, QosFlowAddOrModifyRequestItem]{ { ID: IDTSCTrafficCharacteristics, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { var v TSCTrafficCharacteristics if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30017,11 +30390,14 @@ var extIEsQosFlowAddOrModifyRequestItem = []ap.IESpec[ProtocolIEID, QosFlowAddOr } return x.TSCTrafficCharacteristics, true }, + Clear: func(x *QosFlowAddOrModifyRequestItem) { + x.TSCTrafficCharacteristics = nil + }, }, { ID: IDRedundantQosFlowIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { var v RedundantQosFlowIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30036,11 +30412,14 @@ var extIEsQosFlowAddOrModifyRequestItem = []ap.IESpec[ProtocolIEID, QosFlowAddOr } return x.RedundantQosFlowIndicator, true }, + Clear: func(x *QosFlowAddOrModifyRequestItem) { + x.RedundantQosFlowIndicator = nil + }, }, { ID: IDULNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30055,11 +30434,14 @@ var extIEsQosFlowAddOrModifyRequestItem = []ap.IESpec[ProtocolIEID, QosFlowAddOr } return x.ULNGUUPTNLInformation, true }, + Clear: func(x *QosFlowAddOrModifyRequestItem) { + x.ULNGUUPTNLInformation = nil + }, }, { ID: IDDownlinkTLContainer, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { var v TLContainer if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30074,11 +30456,14 @@ var extIEsQosFlowAddOrModifyRequestItem = []ap.IESpec[ProtocolIEID, QosFlowAddOr } return x.DownlinkTLContainer, true }, + Clear: func(x *QosFlowAddOrModifyRequestItem) { + x.DownlinkTLContainer = nil + }, }, { ID: IDECNMarkingorCongestionInformationReportingRequest, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyRequestItem, r *per.Reader, enc per.Encoding) error { var v ECNMarkingorCongestionInformationReportingRequest if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30093,10 +30478,13 @@ var extIEsQosFlowAddOrModifyRequestItem = []ap.IESpec[ProtocolIEID, QosFlowAddOr } return x.ECNMarkingorCongestionInformationReportingRequest, true }, + Clear: func(x *QosFlowAddOrModifyRequestItem) { + x.ECNMarkingorCongestionInformationReportingRequest = nil + }, }, } -func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowAddOrModifyRequestItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -30107,19 +30495,19 @@ func (qosFlowAddOrModifyRequestItem *QosFlowAddOrModifyRequestItem) Diagnose(d * if qosFlowAddOrModifyRequestItem.ERABID != nil && qosFlowAddOrModifyRequestItem.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowAddOrModifyRequestItem, qosFlowAddOrModifyRequestItem, &qosFlowAddOrModifyRequestItem.iEExtensions) return notComprehended } func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem.iEExtensions) w.WriteBit(qosFlowAddOrModifyResponseItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowAddOrModifyResponseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -30145,7 +30533,7 @@ func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions); err != nil { return err } } @@ -30157,11 +30545,11 @@ func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) UnmarshalP return nil } -var extIEsQosFlowAddOrModifyResponseItem = []ap.IESpec[ProtocolIEID, QosFlowAddOrModifyResponseItem]{ +var extIEsQosFlowAddOrModifyResponseItem = []apimpl.IESpec[ProtocolIEID, QosFlowAddOrModifyResponseItem]{ { ID: IDCurrentQoSParaSetIndex, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { var v AlternativeQoSParaSetIndex if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30176,11 +30564,14 @@ var extIEsQosFlowAddOrModifyResponseItem = []ap.IESpec[ProtocolIEID, QosFlowAddO } return x.CurrentQoSParaSetIndex, true }, + Clear: func(x *QosFlowAddOrModifyResponseItem) { + x.CurrentQoSParaSetIndex = nil + }, }, { ID: IDTSCTrafficCharacteristicsFeedback, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { var v TSCTrafficCharacteristicsFeedback if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30195,11 +30586,14 @@ var extIEsQosFlowAddOrModifyResponseItem = []ap.IESpec[ProtocolIEID, QosFlowAddO } return x.TSCTrafficCharacteristicsFeedback, true }, + Clear: func(x *QosFlowAddOrModifyResponseItem) { + x.TSCTrafficCharacteristicsFeedback = nil + }, }, { ID: IDUplinkTLContainer, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { var v TLContainer if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30214,11 +30608,14 @@ var extIEsQosFlowAddOrModifyResponseItem = []ap.IESpec[ProtocolIEID, QosFlowAddO } return x.UplinkTLContainer, true }, + Clear: func(x *QosFlowAddOrModifyResponseItem) { + x.UplinkTLContainer = nil + }, }, { ID: IDDLNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30233,11 +30630,14 @@ var extIEsQosFlowAddOrModifyResponseItem = []ap.IESpec[ProtocolIEID, QosFlowAddO } return x.DLNGUUPTNLInformation, true }, + Clear: func(x *QosFlowAddOrModifyResponseItem) { + x.DLNGUUPTNLInformation = nil + }, }, { ID: IDANPacketDelayBudgetUL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowAddOrModifyResponseItem, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30252,20 +30652,23 @@ var extIEsQosFlowAddOrModifyResponseItem = []ap.IESpec[ProtocolIEID, QosFlowAddO } return x.ANPacketDelayBudgetUL, true }, + Clear: func(x *QosFlowAddOrModifyResponseItem) { + x.ANPacketDelayBudgetUL = nil + }, }, } -func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAddOrModifyResponseItem *QosFlowAddOrModifyResponseItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowAddOrModifyResponseItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowAddOrModifyResponseItem, qosFlowAddOrModifyResponseItem, &qosFlowAddOrModifyResponseItem.iEExtensions) return notComprehended } func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom.iEExtensions) w.WriteBit(qosFlowAdditionalInfoItemRelCom.extensions.Present()) w.WriteBit(qosFlowAdditionalInfoItemRelCom.DownlinkTLContainer != nil) w.WriteBit(len(ext) > 0) @@ -30278,7 +30681,7 @@ func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) MarshalP } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -30313,7 +30716,7 @@ func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) Unmarsha } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, &qosFlowAdditionalInfoItemRelCom.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, &qosFlowAdditionalInfoItemRelCom.iEExtensions); err != nil { return err } } @@ -30325,19 +30728,19 @@ func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) Unmarsha return nil } -var extIEsQosFlowAdditionalInfoItemRelCom []ap.IESpec[ProtocolIEID, QosFlowAdditionalInfoItemRelCom] +var extIEsQosFlowAdditionalInfoItemRelCom []apimpl.IESpec[ProtocolIEID, QosFlowAdditionalInfoItemRelCom] -func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAdditionalInfoItemRelCom *QosFlowAdditionalInfoItemRelCom) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowAdditionalInfoItemRelCom.QosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowAdditionalInfoItemRelCom, qosFlowAdditionalInfoItemRelCom, &qosFlowAdditionalInfoItemRelCom.iEExtensions) return notComprehended } func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes.iEExtensions) w.WriteBit(qosFlowAdditionalInfoItemRelRes.extensions.Present()) w.WriteBit(qosFlowAdditionalInfoItemRelRes.UplinkTLContainer != nil) w.WriteBit(len(ext) > 0) @@ -30350,7 +30753,7 @@ func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) MarshalP } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -30385,7 +30788,7 @@ func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) Unmarsha } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, &qosFlowAdditionalInfoItemRelRes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, &qosFlowAdditionalInfoItemRelRes.iEExtensions); err != nil { return err } } @@ -30397,19 +30800,19 @@ func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) Unmarsha return nil } -var extIEsQosFlowAdditionalInfoItemRelRes []ap.IESpec[ProtocolIEID, QosFlowAdditionalInfoItemRelRes] +var extIEsQosFlowAdditionalInfoItemRelRes []apimpl.IESpec[ProtocolIEID, QosFlowAdditionalInfoItemRelRes] -func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAdditionalInfoItemRelRes *QosFlowAdditionalInfoItemRelRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowAdditionalInfoItemRelRes.QosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowAdditionalInfoItemRelRes, qosFlowAdditionalInfoItemRelRes, &qosFlowAdditionalInfoItemRelRes.iEExtensions) return notComprehended } func (qosFlowFeedbackItem *QosFlowFeedbackItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, qosFlowFeedbackItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, qosFlowFeedbackItem.iEExtensions) w.WriteBit(qosFlowFeedbackItem.extensions.Present()) w.WriteBit(qosFlowFeedbackItem.UpdateFeedback != nil) w.WriteBit(qosFlowFeedbackItem.CNpacketDelayBudgetDL != nil) @@ -30434,7 +30837,7 @@ func (qosFlowFeedbackItem *QosFlowFeedbackItem) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -30493,7 +30896,7 @@ func (qosFlowFeedbackItem *QosFlowFeedbackItem) UnmarshalPER(r *per.Reader, enc qosFlowFeedbackItem.CNpacketDelayBudgetUL = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, &qosFlowFeedbackItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, &qosFlowFeedbackItem.iEExtensions); err != nil { return err } } @@ -30505,9 +30908,9 @@ func (qosFlowFeedbackItem *QosFlowFeedbackItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsQosFlowFeedbackItem []ap.IESpec[ProtocolIEID, QosFlowFeedbackItem] +var extIEsQosFlowFeedbackItem []apimpl.IESpec[ProtocolIEID, QosFlowFeedbackItem] -func (qosFlowFeedbackItem *QosFlowFeedbackItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowFeedbackItem *QosFlowFeedbackItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowFeedbackItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -30518,12 +30921,12 @@ func (qosFlowFeedbackItem *QosFlowFeedbackItem) Diagnose(d *ap.Diagnosis[Protoco if qosFlowFeedbackItem.CNpacketDelayBudgetUL != nil && qosFlowFeedbackItem.CNpacketDelayBudgetUL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, qosFlowFeedbackItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowFeedbackItem, qosFlowFeedbackItem, &qosFlowFeedbackItem.iEExtensions) return notComprehended } func (qosFlowInformationItem *QosFlowInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowInformationItem, qosFlowInformationItem, qosFlowInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowInformationItem, qosFlowInformationItem, qosFlowInformationItem.iEExtensions) w.WriteBit(qosFlowInformationItem.extensions.Present()) w.WriteBit(qosFlowInformationItem.DLForwarding != nil) w.WriteBit(len(ext) > 0) @@ -30536,7 +30939,7 @@ func (qosFlowInformationItem *QosFlowInformationItem) MarshalPER(w *per.Writer, } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -30573,7 +30976,7 @@ func (qosFlowInformationItem *QosFlowInformationItem) UnmarshalPER(r *per.Reader qosFlowInformationItem.DLForwarding = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowInformationItem, qosFlowInformationItem, &qosFlowInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowInformationItem, qosFlowInformationItem, &qosFlowInformationItem.iEExtensions); err != nil { return err } } @@ -30585,11 +30988,11 @@ func (qosFlowInformationItem *QosFlowInformationItem) UnmarshalPER(r *per.Reader return nil } -var extIEsQosFlowInformationItem = []ap.IESpec[ProtocolIEID, QosFlowInformationItem]{ +var extIEsQosFlowInformationItem = []apimpl.IESpec[ProtocolIEID, QosFlowInformationItem]{ { ID: IDULForwarding, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowInformationItem, r *per.Reader, enc per.Encoding) error { var v ULForwarding if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30604,11 +31007,14 @@ var extIEsQosFlowInformationItem = []ap.IESpec[ProtocolIEID, QosFlowInformationI } return x.ULForwarding, true }, + Clear: func(x *QosFlowInformationItem) { + x.ULForwarding = nil + }, }, { ID: IDSourceTNLAddrInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowInformationItem, r *per.Reader, enc per.Encoding) error { var v TransportLayerAddress if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30623,11 +31029,14 @@ var extIEsQosFlowInformationItem = []ap.IESpec[ProtocolIEID, QosFlowInformationI } return x.SourceTNLAddrInfo, true }, + Clear: func(x *QosFlowInformationItem) { + x.SourceTNLAddrInfo = nil + }, }, { ID: IDSourceNodeTNLAddrInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowInformationItem, r *per.Reader, enc per.Encoding) error { var v TransportLayerAddress if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30642,10 +31051,13 @@ var extIEsQosFlowInformationItem = []ap.IESpec[ProtocolIEID, QosFlowInformationI } return x.SourceNodeTNLAddrInfo, true }, + Clear: func(x *QosFlowInformationItem) { + x.SourceNodeTNLAddrInfo = nil + }, }, } -func (qosFlowInformationItem *QosFlowInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowInformationItem *QosFlowInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowInformationItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -30653,12 +31065,12 @@ func (qosFlowInformationItem *QosFlowInformationItem) Diagnose(d *ap.Diagnosis[P if qosFlowInformationItem.DLForwarding != nil && qosFlowInformationItem.DLForwarding.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowInformationItem, qosFlowInformationItem, qosFlowInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowInformationItem, qosFlowInformationItem, &qosFlowInformationItem.iEExtensions) return notComprehended } func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding.iEExtensions) w.WriteBit(qosFlowItemWithDataForwarding.extensions.Present()) w.WriteBit(qosFlowItemWithDataForwarding.DataForwardingAccepted != nil) w.WriteBit(len(ext) > 0) @@ -30671,7 +31083,7 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) MarshalPER(w } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -30708,7 +31120,7 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER qosFlowItemWithDataForwarding.DataForwardingAccepted = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, &qosFlowItemWithDataForwarding.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, &qosFlowItemWithDataForwarding.iEExtensions); err != nil { return err } } @@ -30720,11 +31132,11 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) UnmarshalPER return nil } -var extIEsQosFlowItemWithDataForwarding = []ap.IESpec[ProtocolIEID, QosFlowItemWithDataForwarding]{ +var extIEsQosFlowItemWithDataForwarding = []apimpl.IESpec[ProtocolIEID, QosFlowItemWithDataForwarding]{ { ID: IDCurrentQoSParaSetIndex, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowItemWithDataForwarding, r *per.Reader, enc per.Encoding) error { var v AlternativeQoSParaSetIndex if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30739,10 +31151,13 @@ var extIEsQosFlowItemWithDataForwarding = []ap.IESpec[ProtocolIEID, QosFlowItemW } return x.CurrentQoSParaSetIndex, true }, + Clear: func(x *QosFlowItemWithDataForwarding) { + x.CurrentQoSParaSetIndex = nil + }, }, } -func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowItemWithDataForwarding.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -30750,12 +31165,12 @@ func (qosFlowItemWithDataForwarding *QosFlowItemWithDataForwarding) Diagnose(d * if qosFlowItemWithDataForwarding.DataForwardingAccepted != nil && qosFlowItemWithDataForwarding.DataForwardingAccepted.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowItemWithDataForwarding, qosFlowItemWithDataForwarding, &qosFlowItemWithDataForwarding.iEExtensions) return notComprehended } func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, qosFlowLevelQosParameters.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, qosFlowLevelQosParameters.iEExtensions) w.WriteBit(qosFlowLevelQosParameters.extensions.Present()) w.WriteBit(qosFlowLevelQosParameters.GBRQosInformation != nil) w.WriteBit(qosFlowLevelQosParameters.ReflectiveQosAttribute != nil) @@ -30783,7 +31198,7 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) MarshalPER(w *per.Wr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -30845,7 +31260,7 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per. qosFlowLevelQosParameters.AdditionalQosFlowInformation = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, &qosFlowLevelQosParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, &qosFlowLevelQosParameters.iEExtensions); err != nil { return err } } @@ -30857,11 +31272,11 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) UnmarshalPER(r *per. return nil } -var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosParameters]{ +var extIEsQosFlowLevelQosParameters = []apimpl.IESpec[ProtocolIEID, QosFlowLevelQosParameters]{ { ID: IDQosMonitoringRequest, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { var v QosMonitoringRequest if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30876,11 +31291,14 @@ var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosP } return x.QosMonitoringRequest, true }, + Clear: func(x *QosFlowLevelQosParameters) { + x.QosMonitoringRequest = nil + }, }, { ID: IDQosMonitoringReportingFrequency, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { var v QosMonitoringReportingFrequency if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30895,11 +31313,14 @@ var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosP } return x.QosMonitoringReportingFrequency, true }, + Clear: func(x *QosFlowLevelQosParameters) { + x.QosMonitoringReportingFrequency = nil + }, }, { ID: IDPDUsetQoSParameters, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { var v PDUsetQoSParameters if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30914,11 +31335,14 @@ var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosP } return x.PDUsetQoSParameters, true }, + Clear: func(x *QosFlowLevelQosParameters) { + x.PDUsetQoSParameters = nil + }, }, { ID: IDDLPDUSetInformationMarkingSupportIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { var v DLPDUSetInformationMarkingSupportIndication if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30933,11 +31357,14 @@ var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosP } return x.DLPDUSetInformationMarkingSupportIndication, true }, + Clear: func(x *QosFlowLevelQosParameters) { + x.DLPDUSetInformationMarkingSupportIndication = nil + }, }, { ID: IDMMSID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { var v MMSID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30952,11 +31379,14 @@ var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosP } return x.MMSID, true }, + Clear: func(x *QosFlowLevelQosParameters) { + x.MMSID = nil + }, }, { ID: IDIndicationofBitrateAdaptation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowLevelQosParameters, r *per.Reader, enc per.Encoding) error { var v IndicationofBitrateAdaptation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -30971,10 +31401,13 @@ var extIEsQosFlowLevelQosParameters = []ap.IESpec[ProtocolIEID, QosFlowLevelQosP } return x.IndicationofBitrateAdaptation, true }, + Clear: func(x *QosFlowLevelQosParameters) { + x.IndicationofBitrateAdaptation = nil + }, }, } -func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowLevelQosParameters.QosCharacteristics.Diagnose(d) { notComprehended = true @@ -30991,7 +31424,7 @@ func (qosFlowLevelQosParameters *QosFlowLevelQosParameters) Diagnose(d *ap.Diagn if qosFlowLevelQosParameters.AdditionalQosFlowInformation != nil && qosFlowLevelQosParameters.AdditionalQosFlowInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, qosFlowLevelQosParameters.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowLevelQosParameters, qosFlowLevelQosParameters, &qosFlowLevelQosParameters.iEExtensions) return notComprehended } @@ -31012,19 +31445,19 @@ func (qosFlowMappingIndication QosFlowMappingIndication) Name() string { return enumQosFlowMappingIndication.Name(qosFlowMappingIndication) } -func (qosFlowMappingIndication QosFlowMappingIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowMappingIndication QosFlowMappingIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumQosFlowMappingIndication.Known(qosFlowMappingIndication) } func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, qosFlowModifyConfirmItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, qosFlowModifyConfirmItem.iEExtensions) w.WriteBit(qosFlowModifyConfirmItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowModifyConfirmItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31050,7 +31483,7 @@ func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, &qosFlowModifyConfirmItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, &qosFlowModifyConfirmItem.iEExtensions); err != nil { return err } } @@ -31062,19 +31495,19 @@ func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) UnmarshalPER(r *per.Re return nil } -var extIEsQosFlowModifyConfirmItem []ap.IESpec[ProtocolIEID, QosFlowModifyConfirmItem] +var extIEsQosFlowModifyConfirmItem []apimpl.IESpec[ProtocolIEID, QosFlowModifyConfirmItem] -func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowModifyConfirmItem *QosFlowModifyConfirmItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowModifyConfirmItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, qosFlowModifyConfirmItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowModifyConfirmItem, qosFlowModifyConfirmItem, &qosFlowModifyConfirmItem.iEExtensions) return notComprehended } func (qosFlowNotifyItem *QosFlowNotifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowNotifyItem, qosFlowNotifyItem, qosFlowNotifyItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowNotifyItem, qosFlowNotifyItem, qosFlowNotifyItem.iEExtensions) w.WriteBit(qosFlowNotifyItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowNotifyItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { @@ -31084,7 +31517,7 @@ func (qosFlowNotifyItem *QosFlowNotifyItem) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31113,7 +31546,7 @@ func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowNotifyItem, qosFlowNotifyItem, &qosFlowNotifyItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowNotifyItem, qosFlowNotifyItem, &qosFlowNotifyItem.iEExtensions); err != nil { return err } } @@ -31125,11 +31558,11 @@ func (qosFlowNotifyItem *QosFlowNotifyItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsQosFlowNotifyItem = []ap.IESpec[ProtocolIEID, QosFlowNotifyItem]{ +var extIEsQosFlowNotifyItem = []apimpl.IESpec[ProtocolIEID, QosFlowNotifyItem]{ { ID: IDCurrentQoSParaSetIndex, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowNotifyItem, r *per.Reader, enc per.Encoding) error { var v AlternativeQoSParaSetNotifyIndex if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31144,11 +31577,14 @@ var extIEsQosFlowNotifyItem = []ap.IESpec[ProtocolIEID, QosFlowNotifyItem]{ } return x.CurrentQoSParaSetIndex, true }, + Clear: func(x *QosFlowNotifyItem) { + x.CurrentQoSParaSetIndex = nil + }, }, { ID: IDTSCTrafficCharacteristicsFeedback, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowNotifyItem, r *per.Reader, enc per.Encoding) error { var v TSCTrafficCharacteristicsFeedback if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31163,10 +31599,13 @@ var extIEsQosFlowNotifyItem = []ap.IESpec[ProtocolIEID, QosFlowNotifyItem]{ } return x.TSCTrafficCharacteristicsFeedback, true }, + Clear: func(x *QosFlowNotifyItem) { + x.TSCTrafficCharacteristicsFeedback = nil + }, }, } -func (qosFlowNotifyItem *QosFlowNotifyItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowNotifyItem *QosFlowNotifyItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowNotifyItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -31174,12 +31613,12 @@ func (qosFlowNotifyItem *QosFlowNotifyItem) Diagnose(d *ap.Diagnosis[ProtocolIEI if qosFlowNotifyItem.NotificationCause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowNotifyItem, qosFlowNotifyItem, qosFlowNotifyItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowNotifyItem, qosFlowNotifyItem, &qosFlowNotifyItem.iEExtensions) return notComprehended } func (qosFlowParametersItem *QosFlowParametersItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowParametersItem, qosFlowParametersItem, qosFlowParametersItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowParametersItem, qosFlowParametersItem, qosFlowParametersItem.iEExtensions) w.WriteBit(qosFlowParametersItem.extensions.Present()) w.WriteBit(qosFlowParametersItem.AlternativeQoSParaSetList != nil) w.WriteBit(len(ext) > 0) @@ -31192,7 +31631,7 @@ func (qosFlowParametersItem *QosFlowParametersItem) MarshalPER(w *per.Writer, en } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31227,7 +31666,7 @@ func (qosFlowParametersItem *QosFlowParametersItem) UnmarshalPER(r *per.Reader, } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowParametersItem, qosFlowParametersItem, &qosFlowParametersItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowParametersItem, qosFlowParametersItem, &qosFlowParametersItem.iEExtensions); err != nil { return err } } @@ -31239,11 +31678,11 @@ func (qosFlowParametersItem *QosFlowParametersItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsQosFlowParametersItem = []ap.IESpec[ProtocolIEID, QosFlowParametersItem]{ +var extIEsQosFlowParametersItem = []apimpl.IESpec[ProtocolIEID, QosFlowParametersItem]{ { ID: IDCNPacketDelayBudgetDL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowParametersItem, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31258,11 +31697,14 @@ var extIEsQosFlowParametersItem = []ap.IESpec[ProtocolIEID, QosFlowParametersIte } return x.CNPacketDelayBudgetDL, true }, + Clear: func(x *QosFlowParametersItem) { + x.CNPacketDelayBudgetDL = nil + }, }, { ID: IDCNPacketDelayBudgetUL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowParametersItem, r *per.Reader, enc per.Encoding) error { var v ExtendedPacketDelayBudget if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31277,11 +31719,14 @@ var extIEsQosFlowParametersItem = []ap.IESpec[ProtocolIEID, QosFlowParametersIte } return x.CNPacketDelayBudgetUL, true }, + Clear: func(x *QosFlowParametersItem) { + x.CNPacketDelayBudgetUL = nil + }, }, { ID: IDBurstArrivalTimeDownlink, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowParametersItem, r *per.Reader, enc per.Encoding) error { var v BurstArrivalTime if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31296,10 +31741,13 @@ var extIEsQosFlowParametersItem = []ap.IESpec[ProtocolIEID, QosFlowParametersIte } return x.BurstArrivalTimeDownlink, true }, + Clear: func(x *QosFlowParametersItem) { + x.BurstArrivalTimeDownlink = nil + }, }, } -func (qosFlowParametersItem *QosFlowParametersItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowParametersItem *QosFlowParametersItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowParametersItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -31307,12 +31755,12 @@ func (qosFlowParametersItem *QosFlowParametersItem) Diagnose(d *ap.Diagnosis[Pro if qosFlowParametersItem.AlternativeQoSParaSetList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowParametersItem, qosFlowParametersItem, qosFlowParametersItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowParametersItem, qosFlowParametersItem, &qosFlowParametersItem.iEExtensions) return notComprehended } func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, qosFlowPerTNLInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, qosFlowPerTNLInformation.iEExtensions) w.WriteBit(qosFlowPerTNLInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowPerTNLInformation.UPTransportLayerInformation.MarshalPER(w, enc); err != nil { @@ -31322,7 +31770,7 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31351,7 +31799,7 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, &qosFlowPerTNLInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, &qosFlowPerTNLInformation.iEExtensions); err != nil { return err } } @@ -31363,9 +31811,9 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) UnmarshalPER(r *per.Re return nil } -var extIEsQosFlowPerTNLInformation []ap.IESpec[ProtocolIEID, QosFlowPerTNLInformation] +var extIEsQosFlowPerTNLInformation []apimpl.IESpec[ProtocolIEID, QosFlowPerTNLInformation] -func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowPerTNLInformation.UPTransportLayerInformation.Diagnose(d) { notComprehended = true @@ -31373,19 +31821,19 @@ func (qosFlowPerTNLInformation *QosFlowPerTNLInformation) Diagnose(d *ap.Diagnos if qosFlowPerTNLInformation.AssociatedQosFlowList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, qosFlowPerTNLInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowPerTNLInformation, qosFlowPerTNLInformation, &qosFlowPerTNLInformation.iEExtensions) return notComprehended } func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem.iEExtensions) w.WriteBit(qosFlowPerTNLInformationItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31411,7 +31859,7 @@ func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, &qosFlowPerTNLInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, &qosFlowPerTNLInformationItem.iEExtensions); err != nil { return err } } @@ -31423,19 +31871,19 @@ func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) UnmarshalPER(r return nil } -var extIEsQosFlowPerTNLInformationItem []ap.IESpec[ProtocolIEID, QosFlowPerTNLInformationItem] +var extIEsQosFlowPerTNLInformationItem []apimpl.IESpec[ProtocolIEID, QosFlowPerTNLInformationItem] -func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowPerTNLInformationItem *QosFlowPerTNLInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowPerTNLInformationItem.QosFlowPerTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowPerTNLInformationItem, qosFlowPerTNLInformationItem, &qosFlowPerTNLInformationItem.iEExtensions) return notComprehended } func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, qosFlowSetupRequestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, qosFlowSetupRequestItem.iEExtensions) w.WriteBit(qosFlowSetupRequestItem.extensions.Present()) w.WriteBit(qosFlowSetupRequestItem.ERABID != nil) w.WriteBit(len(ext) > 0) @@ -31451,7 +31899,7 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) MarshalPER(w *per.Writer } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31491,7 +31939,7 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Read qosFlowSetupRequestItem.ERABID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, &qosFlowSetupRequestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, &qosFlowSetupRequestItem.iEExtensions); err != nil { return err } } @@ -31503,11 +31951,11 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) UnmarshalPER(r *per.Read return nil } -var extIEsQosFlowSetupRequestItem = []ap.IESpec[ProtocolIEID, QosFlowSetupRequestItem]{ +var extIEsQosFlowSetupRequestItem = []apimpl.IESpec[ProtocolIEID, QosFlowSetupRequestItem]{ { ID: IDTSCTrafficCharacteristics, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowSetupRequestItem, r *per.Reader, enc per.Encoding) error { var v TSCTrafficCharacteristics if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31522,11 +31970,14 @@ var extIEsQosFlowSetupRequestItem = []ap.IESpec[ProtocolIEID, QosFlowSetupReques } return x.TSCTrafficCharacteristics, true }, + Clear: func(x *QosFlowSetupRequestItem) { + x.TSCTrafficCharacteristics = nil + }, }, { ID: IDRedundantQosFlowIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowSetupRequestItem, r *per.Reader, enc per.Encoding) error { var v RedundantQosFlowIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31541,11 +31992,14 @@ var extIEsQosFlowSetupRequestItem = []ap.IESpec[ProtocolIEID, QosFlowSetupReques } return x.RedundantQosFlowIndicator, true }, + Clear: func(x *QosFlowSetupRequestItem) { + x.RedundantQosFlowIndicator = nil + }, }, { ID: IDECNMarkingorCongestionInformationReportingRequest, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *QosFlowSetupRequestItem, r *per.Reader, enc per.Encoding) error { var v ECNMarkingorCongestionInformationReportingRequest if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -31560,10 +32014,13 @@ var extIEsQosFlowSetupRequestItem = []ap.IESpec[ProtocolIEID, QosFlowSetupReques } return x.ECNMarkingorCongestionInformationReportingRequest, true }, + Clear: func(x *QosFlowSetupRequestItem) { + x.ECNMarkingorCongestionInformationReportingRequest = nil + }, }, } -func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowSetupRequestItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -31574,19 +32031,19 @@ func (qosFlowSetupRequestItem *QosFlowSetupRequestItem) Diagnose(d *ap.Diagnosis if qosFlowSetupRequestItem.ERABID != nil && qosFlowSetupRequestItem.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, qosFlowSetupRequestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowSetupRequestItem, qosFlowSetupRequestItem, &qosFlowSetupRequestItem.iEExtensions) return notComprehended } func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, qosFlowToBeForwardedItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, qosFlowToBeForwardedItem.iEExtensions) w.WriteBit(qosFlowToBeForwardedItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowToBeForwardedItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31612,7 +32069,7 @@ func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, &qosFlowToBeForwardedItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, &qosFlowToBeForwardedItem.iEExtensions); err != nil { return err } } @@ -31624,19 +32081,19 @@ func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) UnmarshalPER(r *per.Re return nil } -var extIEsQosFlowToBeForwardedItem []ap.IESpec[ProtocolIEID, QosFlowToBeForwardedItem] +var extIEsQosFlowToBeForwardedItem []apimpl.IESpec[ProtocolIEID, QosFlowToBeForwardedItem] -func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowToBeForwardedItem *QosFlowToBeForwardedItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowToBeForwardedItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, qosFlowToBeForwardedItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowToBeForwardedItem, qosFlowToBeForwardedItem, &qosFlowToBeForwardedItem.iEExtensions) return notComprehended } func (qosFlowWithCauseItem *QosFlowWithCauseItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, qosFlowWithCauseItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, qosFlowWithCauseItem.iEExtensions) w.WriteBit(qosFlowWithCauseItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := qosFlowWithCauseItem.QosFlowIdentifier.MarshalPER(w, enc); err != nil { @@ -31646,7 +32103,7 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) MarshalPER(w *per.Writer, enc return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31675,7 +32132,7 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, en return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, &qosFlowWithCauseItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, &qosFlowWithCauseItem.iEExtensions); err != nil { return err } } @@ -31687,9 +32144,9 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) UnmarshalPER(r *per.Reader, en return nil } -var extIEsQosFlowWithCauseItem []ap.IESpec[ProtocolIEID, QosFlowWithCauseItem] +var extIEsQosFlowWithCauseItem []apimpl.IESpec[ProtocolIEID, QosFlowWithCauseItem] -func (qosFlowWithCauseItem *QosFlowWithCauseItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowWithCauseItem *QosFlowWithCauseItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if qosFlowWithCauseItem.QosFlowIdentifier.Diagnose(d) { notComprehended = true @@ -31697,7 +32154,7 @@ func (qosFlowWithCauseItem *QosFlowWithCauseItem) Diagnose(d *ap.Diagnosis[Proto if qosFlowWithCauseItem.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, qosFlowWithCauseItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsQosFlowWithCauseItem, qosFlowWithCauseItem, &qosFlowWithCauseItem.iEExtensions) return notComprehended } @@ -31718,7 +32175,7 @@ func (qosMonitoringRequest QosMonitoringRequest) Name() string { return enumQosMonitoringRequest.Name(qosMonitoringRequest) } -func (qosMonitoringRequest QosMonitoringRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (qosMonitoringRequest QosMonitoringRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumQosMonitoringRequest.Known(qosMonitoringRequest) } @@ -31751,7 +32208,7 @@ func (rANfeedbacktype *RANfeedbacktype) MarshalPER(w *per.Writer, enc per.Encodi if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, rANfeedbacktype.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, rANfeedbacktype.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -31778,7 +32235,7 @@ func (rANfeedbacktype *RANfeedbacktype) UnmarshalPER(r *per.Reader, enc per.Enco } rANfeedbacktype.Reactive = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -31792,20 +32249,20 @@ func (rANfeedbacktype *RANfeedbacktype) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (rANfeedbacktype *RANfeedbacktype) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rANfeedbacktype *RANfeedbacktype) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case rANfeedbacktype.Proactive != nil: return rANfeedbacktype.Proactive.Diagnose(d) case rANfeedbacktype.Reactive != nil: return rANfeedbacktype.Reactive.Diagnose(d) case rANfeedbacktype.ChoiceExtension != nil: - d.Unknown(rANfeedbacktype.ChoiceExtension.ID, rANfeedbacktype.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, rANfeedbacktype.ChoiceExtension) } return false } func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, rANfeedbacktypeproactive.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, rANfeedbacktypeproactive.iEExtensions) w.WriteBit(rANfeedbacktypeproactive.extensions.Present()) w.WriteBit(rANfeedbacktypeproactive.PeriodicityRange != nil) w.WriteBit(len(ext) > 0) @@ -31818,7 +32275,7 @@ func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31855,7 +32312,7 @@ func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) UnmarshalPER(r *per.Re rANfeedbacktypeproactive.PeriodicityRange = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, &rANfeedbacktypeproactive.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, &rANfeedbacktypeproactive.iEExtensions); err != nil { return err } } @@ -31867,9 +32324,9 @@ func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) UnmarshalPER(r *per.Re return nil } -var extIEsRANfeedbacktypeproactive []ap.IESpec[ProtocolIEID, RANfeedbacktypeproactive] +var extIEsRANfeedbacktypeproactive []apimpl.IESpec[ProtocolIEID, RANfeedbacktypeproactive] -func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if rANfeedbacktypeproactive.BurstArrivalTimeWindow.Diagnose(d) { notComprehended = true @@ -31877,19 +32334,19 @@ func (rANfeedbacktypeproactive *RANfeedbacktypeproactive) Diagnose(d *ap.Diagnos if rANfeedbacktypeproactive.PeriodicityRange != nil && rANfeedbacktypeproactive.PeriodicityRange.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, rANfeedbacktypeproactive.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRANfeedbacktypeproactive, rANfeedbacktypeproactive, &rANfeedbacktypeproactive.iEExtensions) return notComprehended } func (rANfeedbacktypereactive *RANfeedbacktypereactive) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, rANfeedbacktypereactive.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, rANfeedbacktypereactive.iEExtensions) w.WriteBit(rANfeedbacktypereactive.extensions.Present()) w.WriteBit(len(ext) > 0) if err := rANfeedbacktypereactive.CapabilityForBATAdaptation.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -31915,7 +32372,7 @@ func (rANfeedbacktypereactive *RANfeedbacktypereactive) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, &rANfeedbacktypereactive.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, &rANfeedbacktypereactive.iEExtensions); err != nil { return err } } @@ -31927,14 +32384,14 @@ func (rANfeedbacktypereactive *RANfeedbacktypereactive) UnmarshalPER(r *per.Read return nil } -var extIEsRANfeedbacktypereactive []ap.IESpec[ProtocolIEID, RANfeedbacktypereactive] +var extIEsRANfeedbacktypereactive []apimpl.IESpec[ProtocolIEID, RANfeedbacktypereactive] -func (rANfeedbacktypereactive *RANfeedbacktypereactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rANfeedbacktypereactive *RANfeedbacktypereactive) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if rANfeedbacktypereactive.CapabilityForBATAdaptation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, rANfeedbacktypereactive.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRANfeedbacktypereactive, rANfeedbacktypereactive, &rANfeedbacktypereactive.iEExtensions) return notComprehended } @@ -31955,7 +32412,7 @@ func (rANfeedbacktypereactiveCapabilityForBATAdaptation RANfeedbacktypereactiveC return enumRANfeedbacktypereactiveCapabilityForBATAdaptation.Name(rANfeedbacktypereactiveCapabilityForBATAdaptation) } -func (rANfeedbacktypereactiveCapabilityForBATAdaptation RANfeedbacktypereactiveCapabilityForBATAdaptation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rANfeedbacktypereactiveCapabilityForBATAdaptation RANfeedbacktypereactiveCapabilityForBATAdaptation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRANfeedbacktypereactiveCapabilityForBATAdaptation.Known(rANfeedbacktypereactiveCapabilityForBATAdaptation) } @@ -31976,12 +32433,12 @@ func (rATInformation RATInformation) Name() string { return enumRATInformation.Name(rATInformation) } -func (rATInformation RATInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rATInformation RATInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRATInformation.Known(rATInformation) } func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) w.WriteBit(rATRestrictionsItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := rATRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -31991,7 +32448,7 @@ func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32020,7 +32477,7 @@ func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions); err != nil { return err } } @@ -32032,11 +32489,11 @@ func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsRATRestrictionsItem = []ap.IESpec[ProtocolIEID, RATRestrictionsItem]{ +var extIEsRATRestrictionsItem = []apimpl.IESpec[ProtocolIEID, RATRestrictionsItem]{ { ID: IDExtendedRATRestrictionInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *RATRestrictionsItem, r *per.Reader, enc per.Encoding) error { var v ExtendedRATRestrictionInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -32051,12 +32508,15 @@ var extIEsRATRestrictionsItem = []ap.IESpec[ProtocolIEID, RATRestrictionsItem]{ } return x.ExtendedRATRestrictionInformation, true }, + Clear: func(x *RATRestrictionsItem) { + x.ExtendedRATRestrictionInformation = nil + }, }, } -func (rATRestrictionsItem *RATRestrictionsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rATRestrictionsItem *RATRestrictionsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions) return notComprehended } @@ -32077,7 +32537,7 @@ func (rRCEstablishmentCause RRCEstablishmentCause) Name() string { return enumRRCEstablishmentCause.Name(rRCEstablishmentCause) } -func (rRCEstablishmentCause RRCEstablishmentCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rRCEstablishmentCause RRCEstablishmentCause) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRRCEstablishmentCause.Known(rRCEstablishmentCause) } @@ -32098,7 +32558,7 @@ func (rRCInactiveTransitionReportRequest RRCInactiveTransitionReportRequest) Nam return enumRRCInactiveTransitionReportRequest.Name(rRCInactiveTransitionReportRequest) } -func (rRCInactiveTransitionReportRequest RRCInactiveTransitionReportRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rRCInactiveTransitionReportRequest RRCInactiveTransitionReportRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRRCInactiveTransitionReportRequest.Known(rRCInactiveTransitionReportRequest) } @@ -32119,7 +32579,7 @@ func (rRCState RRCState) Name() string { return enumRRCState.Name(rRCState) } -func (rRCState RRCState) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rRCState RRCState) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRRCState.Known(rRCState) } @@ -32140,12 +32600,12 @@ func (rSN RSN) Name() string { return enumRSN.Name(rSN) } -func (rSN RSN) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rSN RSN) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRSN.Known(rSN) } func (rSPPFlowBitRates *RSPPFlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRSPPFlowBitRates, rSPPFlowBitRates, rSPPFlowBitRates.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRSPPFlowBitRates, rSPPFlowBitRates, rSPPFlowBitRates.iEExtensions) w.WriteBit(rSPPFlowBitRates.extensions.Present()) w.WriteBit(len(ext) > 0) if err := rSPPFlowBitRates.GuaranteedFlowBitRate.MarshalPER(w, enc); err != nil { @@ -32155,7 +32615,7 @@ func (rSPPFlowBitRates *RSPPFlowBitRates) MarshalPER(w *per.Writer, enc per.Enco return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32184,7 +32644,7 @@ func (rSPPFlowBitRates *RSPPFlowBitRates) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRSPPFlowBitRates, rSPPFlowBitRates, &rSPPFlowBitRates.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRSPPFlowBitRates, rSPPFlowBitRates, &rSPPFlowBitRates.iEExtensions); err != nil { return err } } @@ -32196,9 +32656,9 @@ func (rSPPFlowBitRates *RSPPFlowBitRates) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsRSPPFlowBitRates []ap.IESpec[ProtocolIEID, RSPPFlowBitRates] +var extIEsRSPPFlowBitRates []apimpl.IESpec[ProtocolIEID, RSPPFlowBitRates] -func (rSPPFlowBitRates *RSPPFlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rSPPFlowBitRates *RSPPFlowBitRates) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if rSPPFlowBitRates.GuaranteedFlowBitRate.Diagnose(d) { notComprehended = true @@ -32206,12 +32666,12 @@ func (rSPPFlowBitRates *RSPPFlowBitRates) Diagnose(d *ap.Diagnosis[ProtocolIEID] if rSPPFlowBitRates.MaximumFlowBitRate.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRSPPFlowBitRates, rSPPFlowBitRates, rSPPFlowBitRates.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRSPPFlowBitRates, rSPPFlowBitRates, &rSPPFlowBitRates.iEExtensions) return notComprehended } func (rSPPQoSFlowItem *RSPPQoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, rSPPQoSFlowItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, rSPPQoSFlowItem.iEExtensions) w.WriteBit(rSPPQoSFlowItem.extensions.Present()) w.WriteBit(rSPPQoSFlowItem.RSPPFlowBitRates != nil) w.WriteBit(rSPPQoSFlowItem.Range != nil) @@ -32230,7 +32690,7 @@ func (rSPPQoSFlowItem *RSPPQoSFlowItem) MarshalPER(w *per.Writer, enc per.Encodi } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32278,7 +32738,7 @@ func (rSPPQoSFlowItem *RSPPQoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Enco rSPPQoSFlowItem.Range = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, &rSPPQoSFlowItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, &rSPPQoSFlowItem.iEExtensions); err != nil { return err } } @@ -32290,9 +32750,9 @@ func (rSPPQoSFlowItem *RSPPQoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsRSPPQoSFlowItem []ap.IESpec[ProtocolIEID, RSPPQoSFlowItem] +var extIEsRSPPQoSFlowItem []apimpl.IESpec[ProtocolIEID, RSPPQoSFlowItem] -func (rSPPQoSFlowItem *RSPPQoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rSPPQoSFlowItem *RSPPQoSFlowItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if rSPPQoSFlowItem.PQI.Diagnose(d) { notComprehended = true @@ -32303,7 +32763,7 @@ func (rSPPQoSFlowItem *RSPPQoSFlowItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if rSPPQoSFlowItem.Range != nil && rSPPQoSFlowItem.Range.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, rSPPQoSFlowItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRSPPQoSFlowItem, rSPPQoSFlowItem, &rSPPQoSFlowItem.iEExtensions) return notComprehended } @@ -32324,12 +32784,12 @@ func (rangeType RangeType) Name() string { return enumRangeType.Name(rangeType) } -func (rangeType RangeType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rangeType RangeType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRangeType.Known(rangeType) } func (recommendedCellItem *RecommendedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRecommendedCellItem, recommendedCellItem, recommendedCellItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRecommendedCellItem, recommendedCellItem, recommendedCellItem.iEExtensions) w.WriteBit(recommendedCellItem.extensions.Present()) w.WriteBit(recommendedCellItem.TimeStayedInCell != nil) w.WriteBit(len(ext) > 0) @@ -32342,7 +32802,7 @@ func (recommendedCellItem *RecommendedCellItem) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32379,7 +32839,7 @@ func (recommendedCellItem *RecommendedCellItem) UnmarshalPER(r *per.Reader, enc recommendedCellItem.TimeStayedInCell = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellItem, recommendedCellItem, &recommendedCellItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellItem, recommendedCellItem, &recommendedCellItem.iEExtensions); err != nil { return err } } @@ -32391,26 +32851,26 @@ func (recommendedCellItem *RecommendedCellItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsRecommendedCellItem []ap.IESpec[ProtocolIEID, RecommendedCellItem] +var extIEsRecommendedCellItem []apimpl.IESpec[ProtocolIEID, RecommendedCellItem] -func (recommendedCellItem *RecommendedCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (recommendedCellItem *RecommendedCellItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if recommendedCellItem.NGRANCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRecommendedCellItem, recommendedCellItem, recommendedCellItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRecommendedCellItem, recommendedCellItem, &recommendedCellItem.iEExtensions) return notComprehended } func (recommendedCellsForPaging *RecommendedCellsForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRecommendedCellsForPaging, recommendedCellsForPaging, recommendedCellsForPaging.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRecommendedCellsForPaging, recommendedCellsForPaging, recommendedCellsForPaging.iEExtensions) w.WriteBit(recommendedCellsForPaging.extensions.Present()) w.WriteBit(len(ext) > 0) if err := recommendedCellsForPaging.RecommendedCellList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32436,7 +32896,7 @@ func (recommendedCellsForPaging *RecommendedCellsForPaging) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, &recommendedCellsForPaging.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, &recommendedCellsForPaging.iEExtensions); err != nil { return err } } @@ -32448,26 +32908,26 @@ func (recommendedCellsForPaging *RecommendedCellsForPaging) UnmarshalPER(r *per. return nil } -var extIEsRecommendedCellsForPaging []ap.IESpec[ProtocolIEID, RecommendedCellsForPaging] +var extIEsRecommendedCellsForPaging []apimpl.IESpec[ProtocolIEID, RecommendedCellsForPaging] -func (recommendedCellsForPaging *RecommendedCellsForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (recommendedCellsForPaging *RecommendedCellsForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if recommendedCellsForPaging.RecommendedCellList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, recommendedCellsForPaging.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, &recommendedCellsForPaging.iEExtensions) return notComprehended } func (recommendedRANNodeItem *RecommendedRANNodeItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRecommendedRANNodeItem, recommendedRANNodeItem, recommendedRANNodeItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRecommendedRANNodeItem, recommendedRANNodeItem, recommendedRANNodeItem.iEExtensions) w.WriteBit(recommendedRANNodeItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := recommendedRANNodeItem.AMFPagingTarget.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32493,7 +32953,7 @@ func (recommendedRANNodeItem *RecommendedRANNodeItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedRANNodeItem, recommendedRANNodeItem, &recommendedRANNodeItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedRANNodeItem, recommendedRANNodeItem, &recommendedRANNodeItem.iEExtensions); err != nil { return err } } @@ -32505,26 +32965,26 @@ func (recommendedRANNodeItem *RecommendedRANNodeItem) UnmarshalPER(r *per.Reader return nil } -var extIEsRecommendedRANNodeItem []ap.IESpec[ProtocolIEID, RecommendedRANNodeItem] +var extIEsRecommendedRANNodeItem []apimpl.IESpec[ProtocolIEID, RecommendedRANNodeItem] -func (recommendedRANNodeItem *RecommendedRANNodeItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (recommendedRANNodeItem *RecommendedRANNodeItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if recommendedRANNodeItem.AMFPagingTarget.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRecommendedRANNodeItem, recommendedRANNodeItem, recommendedRANNodeItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRecommendedRANNodeItem, recommendedRANNodeItem, &recommendedRANNodeItem.iEExtensions) return notComprehended } func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, recommendedRANNodesForPaging.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, recommendedRANNodesForPaging.iEExtensions) w.WriteBit(recommendedRANNodesForPaging.extensions.Present()) w.WriteBit(len(ext) > 0) if err := recommendedRANNodesForPaging.RecommendedRANNodeList.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32550,7 +33010,7 @@ func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, &recommendedRANNodesForPaging.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, &recommendedRANNodesForPaging.iEExtensions); err != nil { return err } } @@ -32562,14 +33022,14 @@ func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) UnmarshalPER(r return nil } -var extIEsRecommendedRANNodesForPaging []ap.IESpec[ProtocolIEID, RecommendedRANNodesForPaging] +var extIEsRecommendedRANNodesForPaging []apimpl.IESpec[ProtocolIEID, RecommendedRANNodesForPaging] -func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (recommendedRANNodesForPaging *RecommendedRANNodesForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if recommendedRANNodesForPaging.RecommendedRANNodeList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, recommendedRANNodesForPaging.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRecommendedRANNodesForPaging, recommendedRANNodesForPaging, &recommendedRANNodesForPaging.iEExtensions) return notComprehended } @@ -32590,7 +33050,7 @@ func (redCapIndication RedCapIndication) Name() string { return enumRedCapIndication.Name(redCapIndication) } -func (redCapIndication RedCapIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (redCapIndication RedCapIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRedCapIndication.Known(redCapIndication) } @@ -32611,19 +33071,19 @@ func (redirectionVoiceFallback RedirectionVoiceFallback) Name() string { return enumRedirectionVoiceFallback.Name(redirectionVoiceFallback) } -func (redirectionVoiceFallback RedirectionVoiceFallback) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (redirectionVoiceFallback RedirectionVoiceFallback) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRedirectionVoiceFallback.Known(redirectionVoiceFallback) } func (redundantPDUSessionInformation *RedundantPDUSessionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, redundantPDUSessionInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, redundantPDUSessionInformation.iEExtensions) w.WriteBit(redundantPDUSessionInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := redundantPDUSessionInformation.RSN.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -32649,7 +33109,7 @@ func (redundantPDUSessionInformation *RedundantPDUSessionInformation) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, &redundantPDUSessionInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, &redundantPDUSessionInformation.iEExtensions); err != nil { return err } } @@ -32661,11 +33121,11 @@ func (redundantPDUSessionInformation *RedundantPDUSessionInformation) UnmarshalP return nil } -var extIEsRedundantPDUSessionInformation = []ap.IESpec[ProtocolIEID, RedundantPDUSessionInformation]{ +var extIEsRedundantPDUSessionInformation = []apimpl.IESpec[ProtocolIEID, RedundantPDUSessionInformation]{ { ID: IDPDUSessionPairID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *RedundantPDUSessionInformation, r *per.Reader, enc per.Encoding) error { var v PDUSessionPairID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -32680,15 +33140,18 @@ var extIEsRedundantPDUSessionInformation = []ap.IESpec[ProtocolIEID, RedundantPD } return x.PDUSessionPairID, true }, + Clear: func(x *RedundantPDUSessionInformation) { + x.PDUSessionPairID = nil + }, }, } -func (redundantPDUSessionInformation *RedundantPDUSessionInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (redundantPDUSessionInformation *RedundantPDUSessionInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if redundantPDUSessionInformation.RSN.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, redundantPDUSessionInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRedundantPDUSessionInformation, redundantPDUSessionInformation, &redundantPDUSessionInformation.iEExtensions) return notComprehended } @@ -32726,7 +33189,7 @@ func (reflectiveQosAttribute ReflectiveQosAttribute) Name() string { return enumReflectiveQosAttribute.Name(reflectiveQosAttribute) } -func (reflectiveQosAttribute ReflectiveQosAttribute) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (reflectiveQosAttribute ReflectiveQosAttribute) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumReflectiveQosAttribute.Known(reflectiveQosAttribute) } @@ -32764,7 +33227,7 @@ func (reportArea ReportArea) Name() string { return enumReportArea.Name(reportArea) } -func (reportArea ReportArea) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (reportArea ReportArea) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumReportArea.Known(reportArea) } @@ -32814,7 +33277,7 @@ func (reportType *ReportType) MarshalPER(w *per.Writer, enc per.Encoding) error if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, reportType.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, reportType.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -32841,7 +33304,7 @@ func (reportType *ReportType) UnmarshalPER(r *per.Reader, enc per.Encoding) erro } reportType.PeriodicReporting = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -32855,14 +33318,14 @@ func (reportType *ReportType) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -func (reportType *ReportType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (reportType *ReportType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case reportType.EventBasedReporting != nil: return reportType.EventBasedReporting.Diagnose(d) case reportType.PeriodicReporting != nil: return reportType.PeriodicReporting.Diagnose(d) case reportType.ChoiceExtension != nil: - d.Unknown(reportType.ChoiceExtension.ID, reportType.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, reportType.ChoiceExtension) } return false } @@ -32884,7 +33347,7 @@ func (reportingPeriodicity ReportingPeriodicity) Name() string { return enumReportingPeriodicity.Name(reportingPeriodicity) } -func (reportingPeriodicity ReportingPeriodicity) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (reportingPeriodicity ReportingPeriodicity) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumReportingPeriodicity.Known(reportingPeriodicity) } @@ -32924,7 +33387,7 @@ func (reportingSystem *ReportingSystem) MarshalPER(w *per.Writer, enc per.Encodi if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, reportingSystem.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, reportingSystem.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -32957,7 +33420,7 @@ func (reportingSystem *ReportingSystem) UnmarshalPER(r *per.Reader, enc per.Enco } reportingSystem.NoReporting = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -32971,7 +33434,7 @@ func (reportingSystem *ReportingSystem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (reportingSystem *ReportingSystem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (reportingSystem *ReportingSystem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case reportingSystem.EUTRAN != nil: return reportingSystem.EUTRAN.Diagnose(d) @@ -32979,20 +33442,20 @@ func (reportingSystem *ReportingSystem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) return reportingSystem.NGRAN.Diagnose(d) case reportingSystem.NoReporting != nil: case reportingSystem.ChoiceExtension != nil: - d.Unknown(reportingSystem.ChoiceExtension.ID, reportingSystem.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, reportingSystem.ChoiceExtension) } return false } func (requestedNSSAIItem *RequestedNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRequestedNSSAIItem, requestedNSSAIItem, requestedNSSAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRequestedNSSAIItem, requestedNSSAIItem, requestedNSSAIItem.iEExtensions) w.WriteBit(requestedNSSAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := requestedNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33018,7 +33481,7 @@ func (requestedNSSAIItem *RequestedNSSAIItem) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRequestedNSSAIItem, requestedNSSAIItem, &requestedNSSAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRequestedNSSAIItem, requestedNSSAIItem, &requestedNSSAIItem.iEExtensions); err != nil { return err } } @@ -33030,14 +33493,14 @@ func (requestedNSSAIItem *RequestedNSSAIItem) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsRequestedNSSAIItem []ap.IESpec[ProtocolIEID, RequestedNSSAIItem] +var extIEsRequestedNSSAIItem []apimpl.IESpec[ProtocolIEID, RequestedNSSAIItem] -func (requestedNSSAIItem *RequestedNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (requestedNSSAIItem *RequestedNSSAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if requestedNSSAIItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRequestedNSSAIItem, requestedNSSAIItem, requestedNSSAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRequestedNSSAIItem, requestedNSSAIItem, &requestedNSSAIItem.iEExtensions) return notComprehended } @@ -33058,7 +33521,7 @@ func (resetAll ResetAll) Name() string { return enumResetAll.Name(resetAll) } -func (resetAll ResetAll) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (resetAll ResetAll) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumResetAll.Known(resetAll) } @@ -33091,7 +33554,7 @@ func (resetType *ResetType) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, resetType.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, resetType.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -33118,7 +33581,7 @@ func (resetType *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error } resetType.PartOfNGInterface = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -33132,14 +33595,14 @@ func (resetType *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -func (resetType *ResetType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (resetType *ResetType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case resetType.NGInterface != nil: return resetType.NGInterface.Diagnose(d) case resetType.PartOfNGInterface != nil: return resetType.PartOfNGInterface.Diagnose(d) case resetType.ChoiceExtension != nil: - d.Unknown(resetType.ChoiceExtension.ID, resetType.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, resetType.ChoiceExtension) } return false } @@ -33173,7 +33636,7 @@ func (resourceStatusReportingSystem *ResourceStatusReportingSystem) MarshalPER(w if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, resourceStatusReportingSystem.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, resourceStatusReportingSystem.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -33200,7 +33663,7 @@ func (resourceStatusReportingSystem *ResourceStatusReportingSystem) UnmarshalPER } resourceStatusReportingSystem.NGRANReportingStatus = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -33214,14 +33677,14 @@ func (resourceStatusReportingSystem *ResourceStatusReportingSystem) UnmarshalPER return nil } -func (resourceStatusReportingSystem *ResourceStatusReportingSystem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (resourceStatusReportingSystem *ResourceStatusReportingSystem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case resourceStatusReportingSystem.EUTRANReportingStatus != nil: return resourceStatusReportingSystem.EUTRANReportingStatus.Diagnose(d) case resourceStatusReportingSystem.NGRANReportingStatus != nil: return resourceStatusReportingSystem.NGRANReportingStatus.Diagnose(d) case resourceStatusReportingSystem.ChoiceExtension != nil: - d.Unknown(resourceStatusReportingSystem.ChoiceExtension.ID, resourceStatusReportingSystem.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, resourceStatusReportingSystem.ChoiceExtension) } return false } @@ -33243,12 +33706,12 @@ func (sLPositioningRangingAuthorized SLPositioningRangingAuthorized) Name() stri return enumSLPositioningRangingAuthorized.Name(sLPositioningRangingAuthorized) } -func (sLPositioningRangingAuthorized SLPositioningRangingAuthorized) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sLPositioningRangingAuthorized SLPositioningRangingAuthorized) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSLPositioningRangingAuthorized.Known(sLPositioningRangingAuthorized) } func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters.iEExtensions) w.WriteBit(sLPositioningRangingQoSParameters.extensions.Present()) w.WriteBit(sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates != nil) w.WriteBit(len(ext) > 0) @@ -33261,7 +33724,7 @@ func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) Mars } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33298,7 +33761,7 @@ func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) Unma sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, &sLPositioningRangingQoSParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, &sLPositioningRangingQoSParameters.iEExtensions); err != nil { return err } } @@ -33310,9 +33773,9 @@ func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) Unma return nil } -var extIEsSLPositioningRangingQoSParameters []ap.IESpec[ProtocolIEID, SLPositioningRangingQoSParameters] +var extIEsSLPositioningRangingQoSParameters []apimpl.IESpec[ProtocolIEID, SLPositioningRangingQoSParameters] -func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sLPositioningRangingQoSParameters.RSPPQoSFlowList.Diagnose(d) { notComprehended = true @@ -33320,12 +33783,12 @@ func (sLPositioningRangingQoSParameters *SLPositioningRangingQoSParameters) Diag if sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates != nil && sLPositioningRangingQoSParameters.RSPPLinkAggregateBitRates.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSLPositioningRangingQoSParameters, sLPositioningRangingQoSParameters, &sLPositioningRangingQoSParameters.iEExtensions) return notComprehended } func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo.iEExtensions) w.WriteBit(sLPositioningRangingServiceInfo.extensions.Present()) w.WriteBit(sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters != nil) w.WriteBit(len(ext) > 0) @@ -33338,7 +33801,7 @@ func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) MarshalP } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33375,7 +33838,7 @@ func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) Unmarsha sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, &sLPositioningRangingServiceInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, &sLPositioningRangingServiceInfo.iEExtensions); err != nil { return err } } @@ -33387,9 +33850,9 @@ func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) Unmarsha return nil } -var extIEsSLPositioningRangingServiceInfo []ap.IESpec[ProtocolIEID, SLPositioningRangingServiceInfo] +var extIEsSLPositioningRangingServiceInfo []apimpl.IESpec[ProtocolIEID, SLPositioningRangingServiceInfo] -func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sLPositioningRangingServiceInfo.SLPositioningRangingAuthorized.Diagnose(d) { notComprehended = true @@ -33397,19 +33860,19 @@ func (sLPositioningRangingServiceInfo *SLPositioningRangingServiceInfo) Diagnose if sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters != nil && sLPositioningRangingServiceInfo.SLPositioningRangingQoSParameters.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSLPositioningRangingServiceInfo, sLPositioningRangingServiceInfo, &sLPositioningRangingServiceInfo.iEExtensions) return notComprehended } func (sNPNBasedMDT *SNPNBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNPNBasedMDT, sNPNBasedMDT, sNPNBasedMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNPNBasedMDT, sNPNBasedMDT, sNPNBasedMDT.iEExtensions) w.WriteBit(sNPNBasedMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sNPNBasedMDT.SNPNListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33435,7 +33898,7 @@ func (sNPNBasedMDT *SNPNBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNBasedMDT, sNPNBasedMDT, &sNPNBasedMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNPNBasedMDT, sNPNBasedMDT, &sNPNBasedMDT.iEExtensions); err != nil { return err } } @@ -33447,26 +33910,26 @@ func (sNPNBasedMDT *SNPNBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsSNPNBasedMDT []ap.IESpec[ProtocolIEID, SNPNBasedMDT] +var extIEsSNPNBasedMDT []apimpl.IESpec[ProtocolIEID, SNPNBasedMDT] -func (sNPNBasedMDT *SNPNBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNBasedMDT *SNPNBasedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sNPNBasedMDT.SNPNListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSNPNBasedMDT, sNPNBasedMDT, sNPNBasedMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNPNBasedMDT, sNPNBasedMDT, &sNPNBasedMDT.iEExtensions) return notComprehended } func (sNPNCellBasedMDT *SNPNCellBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, sNPNCellBasedMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, sNPNCellBasedMDT.iEExtensions) w.WriteBit(sNPNCellBasedMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sNPNCellBasedMDT.SNPNcellIdListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33492,7 +33955,7 @@ func (sNPNCellBasedMDT *SNPNCellBasedMDT) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, &sNPNCellBasedMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, &sNPNCellBasedMDT.iEExtensions); err != nil { return err } } @@ -33504,19 +33967,19 @@ func (sNPNCellBasedMDT *SNPNCellBasedMDT) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsSNPNCellBasedMDT []ap.IESpec[ProtocolIEID, SNPNCellBasedMDT] +var extIEsSNPNCellBasedMDT []apimpl.IESpec[ProtocolIEID, SNPNCellBasedMDT] -func (sNPNCellBasedMDT *SNPNCellBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNCellBasedMDT *SNPNCellBasedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sNPNCellBasedMDT.SNPNcellIdListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, sNPNCellBasedMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNPNCellBasedMDT, sNPNCellBasedMDT, &sNPNCellBasedMDT.iEExtensions) return notComprehended } func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem.iEExtensions) w.WriteBit(sNPNCellIdListforMDTItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sNPNCellIdListforMDTItem.NRCGI.MarshalPER(w, enc); err != nil { @@ -33526,7 +33989,7 @@ func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33555,7 +34018,7 @@ func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, &sNPNCellIdListforMDTItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, &sNPNCellIdListforMDTItem.iEExtensions); err != nil { return err } } @@ -33567,19 +34030,19 @@ func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) UnmarshalPER(r *per.Re return nil } -var extIEsSNPNCellIdListforMDTItem []ap.IESpec[ProtocolIEID, SNPNCellIdListforMDTItem] +var extIEsSNPNCellIdListforMDTItem []apimpl.IESpec[ProtocolIEID, SNPNCellIdListforMDTItem] -func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNCellIdListforMDTItem *SNPNCellIdListforMDTItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sNPNCellIdListforMDTItem.NRCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNPNCellIdListforMDTItem, sNPNCellIdListforMDTItem, &sNPNCellIdListforMDTItem.iEExtensions) return notComprehended } func (sNPNListforMDTItem *SNPNListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNPNListforMDTItem, sNPNListforMDTItem, sNPNListforMDTItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNPNListforMDTItem, sNPNListforMDTItem, sNPNListforMDTItem.iEExtensions) w.WriteBit(sNPNListforMDTItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sNPNListforMDTItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -33589,7 +34052,7 @@ func (sNPNListforMDTItem *SNPNListforMDTItem) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33618,7 +34081,7 @@ func (sNPNListforMDTItem *SNPNListforMDTItem) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNListforMDTItem, sNPNListforMDTItem, &sNPNListforMDTItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNPNListforMDTItem, sNPNListforMDTItem, &sNPNListforMDTItem.iEExtensions); err != nil { return err } } @@ -33630,23 +34093,23 @@ func (sNPNListforMDTItem *SNPNListforMDTItem) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsSNPNListforMDTItem []ap.IESpec[ProtocolIEID, SNPNListforMDTItem] +var extIEsSNPNListforMDTItem []apimpl.IESpec[ProtocolIEID, SNPNListforMDTItem] -func (sNPNListforMDTItem *SNPNListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNListforMDTItem *SNPNListforMDTItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSNPNListforMDTItem, sNPNListforMDTItem, sNPNListforMDTItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNPNListforMDTItem, sNPNListforMDTItem, &sNPNListforMDTItem.iEExtensions) return notComprehended } func (sNPNMobilityInformation *SNPNMobilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNPNMobilityInformation, sNPNMobilityInformation, sNPNMobilityInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNPNMobilityInformation, sNPNMobilityInformation, sNPNMobilityInformation.iEExtensions) w.WriteBit(sNPNMobilityInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sNPNMobilityInformation.ServingNID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33672,7 +34135,7 @@ func (sNPNMobilityInformation *SNPNMobilityInformation) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNMobilityInformation, sNPNMobilityInformation, &sNPNMobilityInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNPNMobilityInformation, sNPNMobilityInformation, &sNPNMobilityInformation.iEExtensions); err != nil { return err } } @@ -33684,11 +34147,11 @@ func (sNPNMobilityInformation *SNPNMobilityInformation) UnmarshalPER(r *per.Read return nil } -var extIEsSNPNMobilityInformation = []ap.IESpec[ProtocolIEID, SNPNMobilityInformation]{ +var extIEsSNPNMobilityInformation = []apimpl.IESpec[ProtocolIEID, SNPNMobilityInformation]{ { ID: IDEquivalentSNPNsList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *SNPNMobilityInformation, r *per.Reader, enc per.Encoding) error { var v EquivalentSNPNsList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -33703,24 +34166,27 @@ var extIEsSNPNMobilityInformation = []ap.IESpec[ProtocolIEID, SNPNMobilityInform } return x.EquivalentSNPNsList, true }, + Clear: func(x *SNPNMobilityInformation) { + x.EquivalentSNPNsList = nil + }, }, } -func (sNPNMobilityInformation *SNPNMobilityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNMobilityInformation *SNPNMobilityInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSNPNMobilityInformation, sNPNMobilityInformation, sNPNMobilityInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNPNMobilityInformation, sNPNMobilityInformation, &sNPNMobilityInformation.iEExtensions) return notComprehended } func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, sNPNTAIBasedMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, sNPNTAIBasedMDT.iEExtensions) w.WriteBit(sNPNTAIBasedMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sNPNTAIBasedMDT.SNPNTAIListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33746,7 +34212,7 @@ func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, &sNPNTAIBasedMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, &sNPNTAIBasedMDT.iEExtensions); err != nil { return err } } @@ -33758,19 +34224,19 @@ func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsSNPNTAIBasedMDT []ap.IESpec[ProtocolIEID, SNPNTAIBasedMDT] +var extIEsSNPNTAIBasedMDT []apimpl.IESpec[ProtocolIEID, SNPNTAIBasedMDT] -func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNTAIBasedMDT *SNPNTAIBasedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sNPNTAIBasedMDT.SNPNTAIListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, sNPNTAIBasedMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNPNTAIBasedMDT, sNPNTAIBasedMDT, &sNPNTAIBasedMDT.iEExtensions) return notComprehended } func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, sNPNTAIListforMDTItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, sNPNTAIListforMDTItem.iEExtensions) w.WriteBit(sNPNTAIListforMDTItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sNPNTAIListforMDTItem.TAI.MarshalPER(w, enc); err != nil { @@ -33780,7 +34246,7 @@ func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) MarshalPER(w *per.Writer, en return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33809,7 +34275,7 @@ func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, &sNPNTAIListforMDTItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, &sNPNTAIListforMDTItem.iEExtensions); err != nil { return err } } @@ -33821,19 +34287,19 @@ func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsSNPNTAIListforMDTItem []ap.IESpec[ProtocolIEID, SNPNTAIListforMDTItem] +var extIEsSNPNTAIListforMDTItem []apimpl.IESpec[ProtocolIEID, SNPNTAIListforMDTItem] -func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNTAIListforMDTItem *SNPNTAIListforMDTItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sNPNTAIListforMDTItem.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, sNPNTAIListforMDTItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNPNTAIListforMDTItem, sNPNTAIListforMDTItem, &sNPNTAIListforMDTItem.iEExtensions) return notComprehended } func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSNSSAI, sNSSAI, sNSSAI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSNSSAI, sNSSAI, sNSSAI.iEExtensions) w.WriteBit(sNSSAI.extensions.Present()) w.WriteBit(sNSSAI.SD != nil) w.WriteBit(len(ext) > 0) @@ -33846,7 +34312,7 @@ func (sNSSAI *SNSSAI) MarshalPER(w *per.Writer, enc per.Encoding) error { } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -33883,7 +34349,7 @@ func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { sNSSAI.SD = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSNSSAI, sNSSAI, &sNSSAI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSNSSAI, sNSSAI, &sNSSAI.iEExtensions); err != nil { return err } } @@ -33895,11 +34361,11 @@ func (sNSSAI *SNSSAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsSNSSAI []ap.IESpec[ProtocolIEID, SNSSAI] +var extIEsSNSSAI []apimpl.IESpec[ProtocolIEID, SNSSAI] -func (sNSSAI *SNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNSSAI *SNSSAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSNSSAI, sNSSAI, sNSSAI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSNSSAI, sNSSAI, &sNSSAI.iEExtensions) return notComprehended } @@ -33920,12 +34386,12 @@ func (sRVCCOperationPossible SRVCCOperationPossible) Name() string { return enumSRVCCOperationPossible.Name(sRVCCOperationPossible) } -func (sRVCCOperationPossible SRVCCOperationPossible) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sRVCCOperationPossible SRVCCOperationPossible) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSRVCCOperationPossible.Known(sRVCCOperationPossible) } func (scheduledCommunicationTime *ScheduledCommunicationTime) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsScheduledCommunicationTime, scheduledCommunicationTime, scheduledCommunicationTime.iEExtensions) + ext := apimpl.ExtensionFields(extIEsScheduledCommunicationTime, scheduledCommunicationTime, scheduledCommunicationTime.iEExtensions) w.WriteBit(scheduledCommunicationTime.extensions.Present()) w.WriteBit(scheduledCommunicationTime.DayofWeek != nil) w.WriteBit(scheduledCommunicationTime.TimeofDayStart != nil) @@ -33947,7 +34413,7 @@ func (scheduledCommunicationTime *ScheduledCommunicationTime) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34003,7 +34469,7 @@ func (scheduledCommunicationTime *ScheduledCommunicationTime) UnmarshalPER(r *pe scheduledCommunicationTime.TimeofDayEnd = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsScheduledCommunicationTime, scheduledCommunicationTime, &scheduledCommunicationTime.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsScheduledCommunicationTime, scheduledCommunicationTime, &scheduledCommunicationTime.iEExtensions); err != nil { return err } } @@ -34015,9 +34481,9 @@ func (scheduledCommunicationTime *ScheduledCommunicationTime) UnmarshalPER(r *pe return nil } -var extIEsScheduledCommunicationTime []ap.IESpec[ProtocolIEID, ScheduledCommunicationTime] +var extIEsScheduledCommunicationTime []apimpl.IESpec[ProtocolIEID, ScheduledCommunicationTime] -func (scheduledCommunicationTime *ScheduledCommunicationTime) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (scheduledCommunicationTime *ScheduledCommunicationTime) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if scheduledCommunicationTime.TimeofDayStart != nil && scheduledCommunicationTime.TimeofDayStart.Diagnose(d) { notComprehended = true @@ -34025,12 +34491,12 @@ func (scheduledCommunicationTime *ScheduledCommunicationTime) Diagnose(d *ap.Dia if scheduledCommunicationTime.TimeofDayEnd != nil && scheduledCommunicationTime.TimeofDayEnd.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsScheduledCommunicationTime, scheduledCommunicationTime, scheduledCommunicationTime.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsScheduledCommunicationTime, scheduledCommunicationTime, &scheduledCommunicationTime.iEExtensions) return notComprehended } func (secondaryRATUsageInformation *SecondaryRATUsageInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, secondaryRATUsageInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, secondaryRATUsageInformation.iEExtensions) w.WriteBit(secondaryRATUsageInformation.extensions.Present()) w.WriteBit(secondaryRATUsageInformation.PDUSessionUsageReport != nil) w.WriteBit(secondaryRATUsageInformation.QosFlowsUsageReportList != nil) @@ -34046,7 +34512,7 @@ func (secondaryRATUsageInformation *SecondaryRATUsageInformation) MarshalPER(w * } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34089,7 +34555,7 @@ func (secondaryRATUsageInformation *SecondaryRATUsageInformation) UnmarshalPER(r } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, &secondaryRATUsageInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, &secondaryRATUsageInformation.iEExtensions); err != nil { return err } } @@ -34101,9 +34567,9 @@ func (secondaryRATUsageInformation *SecondaryRATUsageInformation) UnmarshalPER(r return nil } -var extIEsSecondaryRATUsageInformation []ap.IESpec[ProtocolIEID, SecondaryRATUsageInformation] +var extIEsSecondaryRATUsageInformation []apimpl.IESpec[ProtocolIEID, SecondaryRATUsageInformation] -func (secondaryRATUsageInformation *SecondaryRATUsageInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (secondaryRATUsageInformation *SecondaryRATUsageInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if secondaryRATUsageInformation.PDUSessionUsageReport != nil && secondaryRATUsageInformation.PDUSessionUsageReport.Diagnose(d) { notComprehended = true @@ -34111,12 +34577,12 @@ func (secondaryRATUsageInformation *SecondaryRATUsageInformation) Diagnose(d *ap if secondaryRATUsageInformation.QosFlowsUsageReportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, secondaryRATUsageInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSecondaryRATUsageInformation, secondaryRATUsageInformation, &secondaryRATUsageInformation.iEExtensions) return notComprehended } func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSecurityContext, securityContext, securityContext.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSecurityContext, securityContext, securityContext.iEExtensions) w.WriteBit(securityContext.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { @@ -34126,7 +34592,7 @@ func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34157,7 +34623,7 @@ func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityContext, securityContext, &securityContext.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSecurityContext, securityContext, &securityContext.iEExtensions); err != nil { return err } } @@ -34169,16 +34635,16 @@ func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsSecurityContext []ap.IESpec[ProtocolIEID, SecurityContext] +var extIEsSecurityContext []apimpl.IESpec[ProtocolIEID, SecurityContext] -func (securityContext *SecurityContext) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (securityContext *SecurityContext) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSecurityContext, securityContext, securityContext.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSecurityContext, securityContext, &securityContext.iEExtensions) return notComprehended } func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) w.WriteBit(securityIndication.extensions.Present()) w.WriteBit(securityIndication.MaximumIntegrityProtectedDataRateUL != nil) w.WriteBit(len(ext) > 0) @@ -34194,7 +34660,7 @@ func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34234,7 +34700,7 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe securityIndication.MaximumIntegrityProtectedDataRateUL = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions); err != nil { return err } } @@ -34246,11 +34712,11 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsSecurityIndication = []ap.IESpec[ProtocolIEID, SecurityIndication]{ +var extIEsSecurityIndication = []apimpl.IESpec[ProtocolIEID, SecurityIndication]{ { ID: IDMaximumIntegrityProtectedDataRateDL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SecurityIndication, r *per.Reader, enc per.Encoding) error { var v MaximumIntegrityProtectedDataRate if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -34265,10 +34731,13 @@ var extIEsSecurityIndication = []ap.IESpec[ProtocolIEID, SecurityIndication]{ } return x.MaximumIntegrityProtectedDataRateDL, true }, + Clear: func(x *SecurityIndication) { + x.MaximumIntegrityProtectedDataRateDL = nil + }, }, } -func (securityIndication *SecurityIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (securityIndication *SecurityIndication) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if securityIndication.IntegrityProtectionIndication.Diagnose(d) { notComprehended = true @@ -34279,12 +34748,12 @@ func (securityIndication *SecurityIndication) Diagnose(d *ap.Diagnosis[ProtocolI if securityIndication.MaximumIntegrityProtectedDataRateUL != nil && securityIndication.MaximumIntegrityProtectedDataRateUL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions) return notComprehended } func (securityResult *SecurityResult) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSecurityResult, securityResult, securityResult.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSecurityResult, securityResult, securityResult.iEExtensions) w.WriteBit(securityResult.extensions.Present()) w.WriteBit(len(ext) > 0) if err := securityResult.IntegrityProtectionResult.MarshalPER(w, enc); err != nil { @@ -34294,7 +34763,7 @@ func (securityResult *SecurityResult) MarshalPER(w *per.Writer, enc per.Encoding return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34323,7 +34792,7 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityResult, securityResult, &securityResult.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSecurityResult, securityResult, &securityResult.iEExtensions); err != nil { return err } } @@ -34335,9 +34804,9 @@ func (securityResult *SecurityResult) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsSecurityResult []ap.IESpec[ProtocolIEID, SecurityResult] +var extIEsSecurityResult []apimpl.IESpec[ProtocolIEID, SecurityResult] -func (securityResult *SecurityResult) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (securityResult *SecurityResult) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if securityResult.IntegrityProtectionResult.Diagnose(d) { notComprehended = true @@ -34345,7 +34814,7 @@ func (securityResult *SecurityResult) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bo if securityResult.ConfidentialityProtectionResult.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSecurityResult, securityResult, securityResult.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSecurityResult, securityResult, &securityResult.iEExtensions) return notComprehended } @@ -34366,19 +34835,19 @@ func (sensorMeasConfig SensorMeasConfig) Name() string { return enumSensorMeasConfig.Name(sensorMeasConfig) } -func (sensorMeasConfig SensorMeasConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sensorMeasConfig SensorMeasConfig) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSensorMeasConfig.Known(sensorMeasConfig) } func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, sensorMeasConfigNameItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, sensorMeasConfigNameItem.iEExtensions) w.WriteBit(sensorMeasConfigNameItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sensorMeasConfigNameItem.SensorNameConfig.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34404,7 +34873,7 @@ func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, &sensorMeasConfigNameItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, &sensorMeasConfigNameItem.iEExtensions); err != nil { return err } } @@ -34416,19 +34885,19 @@ func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) UnmarshalPER(r *per.Re return nil } -var extIEsSensorMeasConfigNameItem []ap.IESpec[ProtocolIEID, SensorMeasConfigNameItem] +var extIEsSensorMeasConfigNameItem []apimpl.IESpec[ProtocolIEID, SensorMeasConfigNameItem] -func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sensorMeasConfigNameItem *SensorMeasConfigNameItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sensorMeasConfigNameItem.SensorNameConfig.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, sensorMeasConfigNameItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSensorMeasConfigNameItem, sensorMeasConfigNameItem, &sensorMeasConfigNameItem.iEExtensions) return notComprehended } func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, sensorMeasurementConfiguration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, sensorMeasurementConfiguration.iEExtensions) w.WriteBit(sensorMeasurementConfiguration.extensions.Present()) w.WriteBit(sensorMeasurementConfiguration.SensorMeasConfigNameList != nil) w.WriteBit(len(ext) > 0) @@ -34441,7 +34910,7 @@ func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) MarshalPER } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34476,7 +34945,7 @@ func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) UnmarshalP } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, &sensorMeasurementConfiguration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, &sensorMeasurementConfiguration.iEExtensions); err != nil { return err } } @@ -34488,9 +34957,9 @@ func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) UnmarshalP return nil } -var extIEsSensorMeasurementConfiguration []ap.IESpec[ProtocolIEID, SensorMeasurementConfiguration] +var extIEsSensorMeasurementConfiguration []apimpl.IESpec[ProtocolIEID, SensorMeasurementConfiguration] -func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sensorMeasurementConfiguration.SensorMeasConfig.Diagnose(d) { notComprehended = true @@ -34498,7 +34967,7 @@ func (sensorMeasurementConfiguration *SensorMeasurementConfiguration) Diagnose(d if sensorMeasurementConfiguration.SensorMeasConfigNameList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, sensorMeasurementConfiguration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSensorMeasurementConfiguration, sensorMeasurementConfiguration, &sensorMeasurementConfiguration.iEExtensions) return notComprehended } @@ -34538,7 +35007,7 @@ func (sensorNameConfig *SensorNameConfig) MarshalPER(w *per.Writer, enc per.Enco if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, sensorNameConfig.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, sensorNameConfig.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -34571,7 +35040,7 @@ func (sensorNameConfig *SensorNameConfig) UnmarshalPER(r *per.Reader, enc per.En } sensorNameConfig.UeOrientationConfig = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -34585,7 +35054,7 @@ func (sensorNameConfig *SensorNameConfig) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (sensorNameConfig *SensorNameConfig) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sensorNameConfig *SensorNameConfig) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case sensorNameConfig.UncompensatedBarometricConfig != nil: return sensorNameConfig.UncompensatedBarometricConfig.Diagnose(d) @@ -34594,7 +35063,7 @@ func (sensorNameConfig *SensorNameConfig) Diagnose(d *ap.Diagnosis[ProtocolIEID] case sensorNameConfig.UeOrientationConfig != nil: return sensorNameConfig.UeOrientationConfig.Diagnose(d) case sensorNameConfig.ChoiceExtension != nil: - d.Unknown(sensorNameConfig.ChoiceExtension.ID, sensorNameConfig.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, sensorNameConfig.ChoiceExtension) } return false } @@ -34616,7 +35085,7 @@ func (sensorNameConfigUeOrientationConfig SensorNameConfigUeOrientationConfig) N return enumSensorNameConfigUeOrientationConfig.Name(sensorNameConfigUeOrientationConfig) } -func (sensorNameConfigUeOrientationConfig SensorNameConfigUeOrientationConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sensorNameConfigUeOrientationConfig SensorNameConfigUeOrientationConfig) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSensorNameConfigUeOrientationConfig.Known(sensorNameConfigUeOrientationConfig) } @@ -34637,7 +35106,7 @@ func (sensorNameConfigUeSpeedConfig SensorNameConfigUeSpeedConfig) Name() string return enumSensorNameConfigUeSpeedConfig.Name(sensorNameConfigUeSpeedConfig) } -func (sensorNameConfigUeSpeedConfig SensorNameConfigUeSpeedConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sensorNameConfigUeSpeedConfig SensorNameConfigUeSpeedConfig) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSensorNameConfigUeSpeedConfig.Known(sensorNameConfigUeSpeedConfig) } @@ -34658,12 +35127,12 @@ func (sensorNameConfigUncompensatedBarometricConfig SensorNameConfigUncompensate return enumSensorNameConfigUncompensatedBarometricConfig.Name(sensorNameConfigUncompensatedBarometricConfig) } -func (sensorNameConfigUncompensatedBarometricConfig SensorNameConfigUncompensatedBarometricConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sensorNameConfigUncompensatedBarometricConfig SensorNameConfigUncompensatedBarometricConfig) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSensorNameConfigUncompensatedBarometricConfig.Known(sensorNameConfigUncompensatedBarometricConfig) } func (servedGUAMIItem *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsServedGUAMIItem, servedGUAMIItem, servedGUAMIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsServedGUAMIItem, servedGUAMIItem, servedGUAMIItem.iEExtensions) w.WriteBit(servedGUAMIItem.extensions.Present()) w.WriteBit(servedGUAMIItem.BackupAMFName != nil) w.WriteBit(len(ext) > 0) @@ -34676,7 +35145,7 @@ func (servedGUAMIItem *ServedGUAMIItem) MarshalPER(w *per.Writer, enc per.Encodi } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34713,7 +35182,7 @@ func (servedGUAMIItem *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Enco servedGUAMIItem.BackupAMFName = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsServedGUAMIItem, servedGUAMIItem, &servedGUAMIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsServedGUAMIItem, servedGUAMIItem, &servedGUAMIItem.iEExtensions); err != nil { return err } } @@ -34725,11 +35194,11 @@ func (servedGUAMIItem *ServedGUAMIItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsServedGUAMIItem = []ap.IESpec[ProtocolIEID, ServedGUAMIItem]{ +var extIEsServedGUAMIItem = []apimpl.IESpec[ProtocolIEID, ServedGUAMIItem]{ { ID: IDGUAMIType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *ServedGUAMIItem, r *per.Reader, enc per.Encoding) error { var v GUAMIType if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -34744,11 +35213,14 @@ var extIEsServedGUAMIItem = []ap.IESpec[ProtocolIEID, ServedGUAMIItem]{ } return x.GUAMIType, true }, + Clear: func(x *ServedGUAMIItem) { + x.GUAMIType = nil + }, }, { ID: IDExtendedBackupAMFName, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *ServedGUAMIItem, r *per.Reader, enc per.Encoding) error { var v ExtendedAMFName if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -34763,20 +35235,23 @@ var extIEsServedGUAMIItem = []ap.IESpec[ProtocolIEID, ServedGUAMIItem]{ } return x.ExtendedBackupAMFName, true }, + Clear: func(x *ServedGUAMIItem) { + x.ExtendedBackupAMFName = nil + }, }, } -func (servedGUAMIItem *ServedGUAMIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (servedGUAMIItem *ServedGUAMIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if servedGUAMIItem.GUAMI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsServedGUAMIItem, servedGUAMIItem, servedGUAMIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsServedGUAMIItem, servedGUAMIItem, &servedGUAMIItem.iEExtensions) return notComprehended } func (serviceAreaInformationItem *ServiceAreaInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsServiceAreaInformationItem, serviceAreaInformationItem, serviceAreaInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsServiceAreaInformationItem, serviceAreaInformationItem, serviceAreaInformationItem.iEExtensions) w.WriteBit(serviceAreaInformationItem.extensions.Present()) w.WriteBit(serviceAreaInformationItem.AllowedTACs != nil) w.WriteBit(serviceAreaInformationItem.NotAllowedTACs != nil) @@ -34795,7 +35270,7 @@ func (serviceAreaInformationItem *ServiceAreaInformationItem) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34839,7 +35314,7 @@ func (serviceAreaInformationItem *ServiceAreaInformationItem) UnmarshalPER(r *pe } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsServiceAreaInformationItem, serviceAreaInformationItem, &serviceAreaInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsServiceAreaInformationItem, serviceAreaInformationItem, &serviceAreaInformationItem.iEExtensions); err != nil { return err } } @@ -34851,11 +35326,11 @@ func (serviceAreaInformationItem *ServiceAreaInformationItem) UnmarshalPER(r *pe return nil } -var extIEsServiceAreaInformationItem []ap.IESpec[ProtocolIEID, ServiceAreaInformationItem] +var extIEsServiceAreaInformationItem []apimpl.IESpec[ProtocolIEID, ServiceAreaInformationItem] -func (serviceAreaInformationItem *ServiceAreaInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (serviceAreaInformationItem *ServiceAreaInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsServiceAreaInformationItem, serviceAreaInformationItem, serviceAreaInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsServiceAreaInformationItem, serviceAreaInformationItem, &serviceAreaInformationItem.iEExtensions) return notComprehended } @@ -34876,19 +35351,19 @@ func (serviceType ServiceType) Name() string { return enumServiceType.Name(serviceType) } -func (serviceType ServiceType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (serviceType ServiceType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumServiceType.Known(serviceType) } func (sliceMDTItem *SliceMDTItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSliceMDTItem, sliceMDTItem, sliceMDTItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSliceMDTItem, sliceMDTItem, sliceMDTItem.iEExtensions) w.WriteBit(sliceMDTItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sliceMDTItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34914,7 +35389,7 @@ func (sliceMDTItem *SliceMDTItem) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceMDTItem, sliceMDTItem, &sliceMDTItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSliceMDTItem, sliceMDTItem, &sliceMDTItem.iEExtensions); err != nil { return err } } @@ -34926,26 +35401,26 @@ func (sliceMDTItem *SliceMDTItem) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsSliceMDTItem []ap.IESpec[ProtocolIEID, SliceMDTItem] +var extIEsSliceMDTItem []apimpl.IESpec[ProtocolIEID, SliceMDTItem] -func (sliceMDTItem *SliceMDTItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sliceMDTItem *SliceMDTItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sliceMDTItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSliceMDTItem, sliceMDTItem, sliceMDTItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSliceMDTItem, sliceMDTItem, &sliceMDTItem.iEExtensions) return notComprehended } func (sliceOverloadItem *SliceOverloadItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSliceOverloadItem, sliceOverloadItem, sliceOverloadItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSliceOverloadItem, sliceOverloadItem, sliceOverloadItem.iEExtensions) w.WriteBit(sliceOverloadItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sliceOverloadItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -34971,7 +35446,7 @@ func (sliceOverloadItem *SliceOverloadItem) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceOverloadItem, sliceOverloadItem, &sliceOverloadItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSliceOverloadItem, sliceOverloadItem, &sliceOverloadItem.iEExtensions); err != nil { return err } } @@ -34983,26 +35458,26 @@ func (sliceOverloadItem *SliceOverloadItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsSliceOverloadItem []ap.IESpec[ProtocolIEID, SliceOverloadItem] +var extIEsSliceOverloadItem []apimpl.IESpec[ProtocolIEID, SliceOverloadItem] -func (sliceOverloadItem *SliceOverloadItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sliceOverloadItem *SliceOverloadItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sliceOverloadItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSliceOverloadItem, sliceOverloadItem, sliceOverloadItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSliceOverloadItem, sliceOverloadItem, &sliceOverloadItem.iEExtensions) return notComprehended } func (sliceSupportItem *SliceSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSliceSupportItem, sliceSupportItem, sliceSupportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSliceSupportItem, sliceSupportItem, sliceSupportItem.iEExtensions) w.WriteBit(sliceSupportItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sliceSupportItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35028,7 +35503,7 @@ func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceSupportItem, sliceSupportItem, &sliceSupportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSliceSupportItem, sliceSupportItem, &sliceSupportItem.iEExtensions); err != nil { return err } } @@ -35040,26 +35515,26 @@ func (sliceSupportItem *SliceSupportItem) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsSliceSupportItem []ap.IESpec[ProtocolIEID, SliceSupportItem] +var extIEsSliceSupportItem []apimpl.IESpec[ProtocolIEID, SliceSupportItem] -func (sliceSupportItem *SliceSupportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sliceSupportItem *SliceSupportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sliceSupportItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSliceSupportItem, sliceSupportItem, sliceSupportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSliceSupportItem, sliceSupportItem, &sliceSupportItem.iEExtensions) return notComprehended } func (sliceSupportQMCItem *SliceSupportQMCItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSliceSupportQMCItem, sliceSupportQMCItem, sliceSupportQMCItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSliceSupportQMCItem, sliceSupportQMCItem, sliceSupportQMCItem.iEExtensions) w.WriteBit(sliceSupportQMCItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sliceSupportQMCItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35085,7 +35560,7 @@ func (sliceSupportQMCItem *SliceSupportQMCItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSliceSupportQMCItem, sliceSupportQMCItem, &sliceSupportQMCItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSliceSupportQMCItem, sliceSupportQMCItem, &sliceSupportQMCItem.iEExtensions); err != nil { return err } } @@ -35097,19 +35572,19 @@ func (sliceSupportQMCItem *SliceSupportQMCItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsSliceSupportQMCItem []ap.IESpec[ProtocolIEID, SliceSupportQMCItem] +var extIEsSliceSupportQMCItem []apimpl.IESpec[ProtocolIEID, SliceSupportQMCItem] -func (sliceSupportQMCItem *SliceSupportQMCItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sliceSupportQMCItem *SliceSupportQMCItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sliceSupportQMCItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSliceSupportQMCItem, sliceSupportQMCItem, sliceSupportQMCItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSliceSupportQMCItem, sliceSupportQMCItem, &sliceSupportQMCItem.iEExtensions) return notComprehended } func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions) w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.extensions.Present()) w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList != nil) w.WriteBit(sourceNGRANNodeToTargetNGRANNodeTransparentContainer.ERABInformationList != nil) @@ -35140,7 +35615,7 @@ func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTar return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35201,7 +35676,7 @@ func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTar return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, &sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, &sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions); err != nil { return err } } @@ -35213,11 +35688,11 @@ func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTar return nil } -var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[ProtocolIEID, SourceNGRANNodeToTargetNGRANNodeTransparentContainer]{ +var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []apimpl.IESpec[ProtocolIEID, SourceNGRANNodeToTargetNGRANNodeTransparentContainer]{ { ID: IDSgNBUEX2APID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v SgNBUEX2APID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35232,11 +35707,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.SgNBUEX2APID, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.SgNBUEX2APID = nil + }, }, { ID: IDUEHistoryInformationFromTheUE, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v UEHistoryInformationFromTheUE if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35251,11 +35729,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.UEHistoryInformationFromTheUE, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.UEHistoryInformationFromTheUE = nil + }, }, { ID: IDSourceNodeID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v SourceNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35270,11 +35751,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.SourceNodeID, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.SourceNodeID = nil + }, }, { ID: IDUEContextReferenceAtSource, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v RANUENGAPID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35289,11 +35773,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.UEContextReferenceAtSource, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.UEContextReferenceAtSource = nil + }, }, { ID: IDMBSActiveSessionInformationSourcetoTargetList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v MBSActiveSessionInformationSourcetoTargetList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35308,11 +35795,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.MBSActiveSessionInformationSourcetoTargetList, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.MBSActiveSessionInformationSourcetoTargetList = nil + }, }, { ID: IDQMCConfigInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v QMCConfigInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35327,11 +35817,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.QMCConfigInfo, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.QMCConfigInfo = nil + }, }, { ID: IDNGAPIESupportInformationRequestList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v NGAPIESupportInformationRequestList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35346,11 +35839,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.NGAPIESupportInformationRequestList, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.NGAPIESupportInformationRequestList = nil + }, }, { ID: IDCandidateRelayUEInformationList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v CandidateRelayUEInformationList if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35365,11 +35861,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.CandidateRelayUEInformationList, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.CandidateRelayUEInformationList = nil + }, }, { ID: IDTimeBasedHandoverInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v TimeBasedHandoverInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35384,11 +35883,14 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.TimeBasedHandoverInformation, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.TimeBasedHandoverInformation = nil + }, }, { ID: IDSourceSNtoTargetSNQMCInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer, r *per.Reader, enc per.Encoding) error { var v QMCConfigInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35403,10 +35905,13 @@ var extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer = []ap.IESpec[Pro } return x.SourceSNtoTargetSNQMCInfo, true }, + Clear: func(x *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) { + x.SourceSNtoTargetSNQMCInfo = nil + }, }, } -func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTargetNGRANNodeTransparentContainer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.PDUSessionResourceInformationList.Diagnose(d) { notComprehended = true @@ -35423,7 +35928,7 @@ func (sourceNGRANNodeToTargetNGRANNodeTransparentContainer *SourceNGRANNodeToTar if sourceNGRANNodeToTargetNGRANNodeTransparentContainer.UEHistoryInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSourceNGRANNodeToTargetNGRANNodeTransparentContainer, sourceNGRANNodeToTargetNGRANNodeTransparentContainer, &sourceNGRANNodeToTargetNGRANNodeTransparentContainer.iEExtensions) return notComprehended } @@ -35449,7 +35954,7 @@ func (sourceNodeID *SourceNodeID) MarshalPER(w *per.Writer, enc per.Encoding) er if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, sourceNodeID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, sourceNodeID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -35470,7 +35975,7 @@ func (sourceNodeID *SourceNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) } sourceNodeID.SourceengNBID = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -35484,12 +35989,12 @@ func (sourceNodeID *SourceNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -func (sourceNodeID *SourceNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sourceNodeID *SourceNodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case sourceNodeID.SourceengNBID != nil: return sourceNodeID.SourceengNBID.Diagnose(d) case sourceNodeID.ChoiceExtension != nil: - d.Unknown(sourceNodeID.ChoiceExtension.ID, sourceNodeID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, sourceNodeID.ChoiceExtension) } return false } @@ -35511,12 +36016,12 @@ func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformat return enumSourceOfUEActivityBehaviourInformation.Name(sourceOfUEActivityBehaviourInformation) } -func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSourceOfUEActivityBehaviourInformation.Known(sourceOfUEActivityBehaviourInformation) } func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute.iEExtensions) w.WriteBit(sourceToTargetAMFInformationReroute.extensions.Present()) w.WriteBit(sourceToTargetAMFInformationReroute.ConfiguredNSSAI != nil) w.WriteBit(sourceToTargetAMFInformationReroute.RejectedNSSAIinPLMN != nil) @@ -35538,7 +36043,7 @@ func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35594,7 +36099,7 @@ func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) sourceToTargetAMFInformationReroute.RejectedNSSAIinTA = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, &sourceToTargetAMFInformationReroute.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, &sourceToTargetAMFInformationReroute.iEExtensions); err != nil { return err } } @@ -35606,16 +36111,16 @@ func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) return nil } -var extIEsSourceToTargetAMFInformationReroute []ap.IESpec[ProtocolIEID, SourceToTargetAMFInformationReroute] +var extIEsSourceToTargetAMFInformationReroute []apimpl.IESpec[ProtocolIEID, SourceToTargetAMFInformationReroute] -func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sourceToTargetAMFInformationReroute *SourceToTargetAMFInformationReroute) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSourceToTargetAMFInformationReroute, sourceToTargetAMFInformationReroute, &sourceToTargetAMFInformationReroute.iEExtensions) return notComprehended } func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) w.WriteBit(supportedTAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { @@ -35625,7 +36130,7 @@ func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35654,7 +36159,7 @@ func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions); err != nil { return err } } @@ -35666,11 +36171,11 @@ func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsSupportedTAItem = []ap.IESpec[ProtocolIEID, SupportedTAItem]{ +var extIEsSupportedTAItem = []apimpl.IESpec[ProtocolIEID, SupportedTAItem]{ { ID: IDConfiguredTACIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SupportedTAItem, r *per.Reader, enc per.Encoding) error { var v ConfiguredTACIndication if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35685,11 +36190,14 @@ var extIEsSupportedTAItem = []ap.IESpec[ProtocolIEID, SupportedTAItem]{ } return x.ConfiguredTACIndication, true }, + Clear: func(x *SupportedTAItem) { + x.ConfiguredTACIndication = nil + }, }, { ID: IDRATInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *SupportedTAItem, r *per.Reader, enc per.Encoding) error { var v RATInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -35704,27 +36212,30 @@ var extIEsSupportedTAItem = []ap.IESpec[ProtocolIEID, SupportedTAItem]{ } return x.RATInformation, true }, + Clear: func(x *SupportedTAItem) { + x.RATInformation = nil + }, }, } -func (supportedTAItem *SupportedTAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (supportedTAItem *SupportedTAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if supportedTAItem.BroadcastPLMNList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions) return notComprehended } func (tABasedMDT *TABasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTABasedMDT, tABasedMDT, tABasedMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTABasedMDT, tABasedMDT, tABasedMDT.iEExtensions) w.WriteBit(tABasedMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tABasedMDT.TAListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35750,7 +36261,7 @@ func (tABasedMDT *TABasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTABasedMDT, tABasedMDT, &tABasedMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTABasedMDT, tABasedMDT, &tABasedMDT.iEExtensions); err != nil { return err } } @@ -35762,23 +36273,23 @@ func (tABasedMDT *TABasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -var extIEsTABasedMDT []ap.IESpec[ProtocolIEID, TABasedMDT] +var extIEsTABasedMDT []apimpl.IESpec[ProtocolIEID, TABasedMDT] -func (tABasedMDT *TABasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tABasedMDT *TABasedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsTABasedMDT, tABasedMDT, tABasedMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTABasedMDT, tABasedMDT, &tABasedMDT.iEExtensions) return notComprehended } func (tABasedQMC *TABasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTABasedQMC, tABasedQMC, tABasedQMC.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTABasedQMC, tABasedQMC, tABasedQMC.iEExtensions) w.WriteBit(tABasedQMC.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tABasedQMC.TAListforQMC.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35804,7 +36315,7 @@ func (tABasedQMC *TABasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTABasedQMC, tABasedQMC, &tABasedQMC.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTABasedQMC, tABasedQMC, &tABasedQMC.iEExtensions); err != nil { return err } } @@ -35816,16 +36327,16 @@ func (tABasedQMC *TABasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -var extIEsTABasedQMC []ap.IESpec[ProtocolIEID, TABasedQMC] +var extIEsTABasedQMC []apimpl.IESpec[ProtocolIEID, TABasedQMC] -func (tABasedQMC *TABasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tABasedQMC *TABasedQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsTABasedQMC, tABasedQMC, tABasedQMC.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTABasedQMC, tABasedQMC, &tABasedQMC.iEExtensions) return notComprehended } func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAI, tAI, tAI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAI, tAI, tAI.iEExtensions) w.WriteBit(tAI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -35835,7 +36346,7 @@ func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35864,7 +36375,7 @@ func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAI, tAI, &tAI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAI, tAI, &tAI.iEExtensions); err != nil { return err } } @@ -35876,23 +36387,23 @@ func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsTAI []ap.IESpec[ProtocolIEID, TAI] +var extIEsTAI []apimpl.IESpec[ProtocolIEID, TAI] -func (tAI *TAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAI *TAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsTAI, tAI, tAI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAI, tAI, &tAI.iEExtensions) return notComprehended } func (tAIBasedMDT *TAIBasedMDT) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIBasedMDT, tAIBasedMDT, tAIBasedMDT.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIBasedMDT, tAIBasedMDT, tAIBasedMDT.iEExtensions) w.WriteBit(tAIBasedMDT.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIBasedMDT.TAIListforMDT.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35918,7 +36429,7 @@ func (tAIBasedMDT *TAIBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBasedMDT, tAIBasedMDT, &tAIBasedMDT.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIBasedMDT, tAIBasedMDT, &tAIBasedMDT.iEExtensions); err != nil { return err } } @@ -35930,26 +36441,26 @@ func (tAIBasedMDT *TAIBasedMDT) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsTAIBasedMDT []ap.IESpec[ProtocolIEID, TAIBasedMDT] +var extIEsTAIBasedMDT []apimpl.IESpec[ProtocolIEID, TAIBasedMDT] -func (tAIBasedMDT *TAIBasedMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBasedMDT *TAIBasedMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIBasedMDT.TAIListforMDT.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTAIBasedMDT, tAIBasedMDT, tAIBasedMDT.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIBasedMDT, tAIBasedMDT, &tAIBasedMDT.iEExtensions) return notComprehended } func (tAIBasedQMC *TAIBasedQMC) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIBasedQMC, tAIBasedQMC, tAIBasedQMC.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIBasedQMC, tAIBasedQMC, tAIBasedQMC.iEExtensions) w.WriteBit(tAIBasedQMC.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIBasedQMC.TAIListforQMC.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -35975,7 +36486,7 @@ func (tAIBasedQMC *TAIBasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBasedQMC, tAIBasedQMC, &tAIBasedQMC.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIBasedQMC, tAIBasedQMC, &tAIBasedQMC.iEExtensions); err != nil { return err } } @@ -35987,19 +36498,19 @@ func (tAIBasedQMC *TAIBasedQMC) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsTAIBasedQMC []ap.IESpec[ProtocolIEID, TAIBasedQMC] +var extIEsTAIBasedQMC []apimpl.IESpec[ProtocolIEID, TAIBasedQMC] -func (tAIBasedQMC *TAIBasedQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBasedQMC *TAIBasedQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIBasedQMC.TAIListforQMC.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTAIBasedQMC, tAIBasedQMC, tAIBasedQMC.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIBasedQMC, tAIBasedQMC, &tAIBasedQMC.iEExtensions) return notComprehended } func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem.iEExtensions) w.WriteBit(tAIBroadcastEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIBroadcastEUTRAItem.TAI.MarshalPER(w, enc); err != nil { @@ -36019,7 +36530,7 @@ func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) MarshalPER(w *per.Writer, en return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36058,7 +36569,7 @@ func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, &tAIBroadcastEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, &tAIBroadcastEUTRAItem.iEExtensions); err != nil { return err } } @@ -36070,9 +36581,9 @@ func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsTAIBroadcastEUTRAItem []ap.IESpec[ProtocolIEID, TAIBroadcastEUTRAItem] +var extIEsTAIBroadcastEUTRAItem []apimpl.IESpec[ProtocolIEID, TAIBroadcastEUTRAItem] -func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIBroadcastEUTRAItem.TAI.Diagnose(d) { notComprehended = true @@ -36082,12 +36593,12 @@ func (tAIBroadcastEUTRAItem *TAIBroadcastEUTRAItem) Diagnose(d *ap.Diagnosis[Pro notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIBroadcastEUTRAItem, tAIBroadcastEUTRAItem, &tAIBroadcastEUTRAItem.iEExtensions) return notComprehended } func (tAIBroadcastNRItem *TAIBroadcastNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, tAIBroadcastNRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, tAIBroadcastNRItem.iEExtensions) w.WriteBit(tAIBroadcastNRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIBroadcastNRItem.TAI.MarshalPER(w, enc); err != nil { @@ -36107,7 +36618,7 @@ func (tAIBroadcastNRItem *TAIBroadcastNRItem) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36146,7 +36657,7 @@ func (tAIBroadcastNRItem *TAIBroadcastNRItem) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, &tAIBroadcastNRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, &tAIBroadcastNRItem.iEExtensions); err != nil { return err } } @@ -36158,9 +36669,9 @@ func (tAIBroadcastNRItem *TAIBroadcastNRItem) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsTAIBroadcastNRItem []ap.IESpec[ProtocolIEID, TAIBroadcastNRItem] +var extIEsTAIBroadcastNRItem []apimpl.IESpec[ProtocolIEID, TAIBroadcastNRItem] -func (tAIBroadcastNRItem *TAIBroadcastNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBroadcastNRItem *TAIBroadcastNRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIBroadcastNRItem.TAI.Diagnose(d) { notComprehended = true @@ -36170,12 +36681,12 @@ func (tAIBroadcastNRItem *TAIBroadcastNRItem) Diagnose(d *ap.Diagnosis[ProtocolI notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, tAIBroadcastNRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIBroadcastNRItem, tAIBroadcastNRItem, &tAIBroadcastNRItem.iEExtensions) return notComprehended } func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, tAICancelledEUTRAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, tAICancelledEUTRAItem.iEExtensions) w.WriteBit(tAICancelledEUTRAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAICancelledEUTRAItem.TAI.MarshalPER(w, enc); err != nil { @@ -36195,7 +36706,7 @@ func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) MarshalPER(w *per.Writer, en return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36234,7 +36745,7 @@ func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, &tAICancelledEUTRAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, &tAICancelledEUTRAItem.iEExtensions); err != nil { return err } } @@ -36246,9 +36757,9 @@ func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsTAICancelledEUTRAItem []ap.IESpec[ProtocolIEID, TAICancelledEUTRAItem] +var extIEsTAICancelledEUTRAItem []apimpl.IESpec[ProtocolIEID, TAICancelledEUTRAItem] -func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAICancelledEUTRAItem.TAI.Diagnose(d) { notComprehended = true @@ -36258,12 +36769,12 @@ func (tAICancelledEUTRAItem *TAICancelledEUTRAItem) Diagnose(d *ap.Diagnosis[Pro notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, tAICancelledEUTRAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAICancelledEUTRAItem, tAICancelledEUTRAItem, &tAICancelledEUTRAItem.iEExtensions) return notComprehended } func (tAICancelledNRItem *TAICancelledNRItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAICancelledNRItem, tAICancelledNRItem, tAICancelledNRItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAICancelledNRItem, tAICancelledNRItem, tAICancelledNRItem.iEExtensions) w.WriteBit(tAICancelledNRItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAICancelledNRItem.TAI.MarshalPER(w, enc); err != nil { @@ -36283,7 +36794,7 @@ func (tAICancelledNRItem *TAICancelledNRItem) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36322,7 +36833,7 @@ func (tAICancelledNRItem *TAICancelledNRItem) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledNRItem, tAICancelledNRItem, &tAICancelledNRItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledNRItem, tAICancelledNRItem, &tAICancelledNRItem.iEExtensions); err != nil { return err } } @@ -36334,9 +36845,9 @@ func (tAICancelledNRItem *TAICancelledNRItem) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsTAICancelledNRItem []ap.IESpec[ProtocolIEID, TAICancelledNRItem] +var extIEsTAICancelledNRItem []apimpl.IESpec[ProtocolIEID, TAICancelledNRItem] -func (tAICancelledNRItem *TAICancelledNRItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAICancelledNRItem *TAICancelledNRItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAICancelledNRItem.TAI.Diagnose(d) { notComprehended = true @@ -36346,19 +36857,19 @@ func (tAICancelledNRItem *TAICancelledNRItem) Diagnose(d *ap.Diagnosis[ProtocolI notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsTAICancelledNRItem, tAICancelledNRItem, tAICancelledNRItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAICancelledNRItem, tAICancelledNRItem, &tAICancelledNRItem.iEExtensions) return notComprehended } func (tAIListForInactiveItem *TAIListForInactiveItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIListForInactiveItem, tAIListForInactiveItem, tAIListForInactiveItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIListForInactiveItem, tAIListForInactiveItem, tAIListForInactiveItem.iEExtensions) w.WriteBit(tAIListForInactiveItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIListForInactiveItem.TAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36384,7 +36895,7 @@ func (tAIListForInactiveItem *TAIListForInactiveItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIListForInactiveItem, tAIListForInactiveItem, &tAIListForInactiveItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIListForInactiveItem, tAIListForInactiveItem, &tAIListForInactiveItem.iEExtensions); err != nil { return err } } @@ -36396,26 +36907,26 @@ func (tAIListForInactiveItem *TAIListForInactiveItem) UnmarshalPER(r *per.Reader return nil } -var extIEsTAIListForInactiveItem []ap.IESpec[ProtocolIEID, TAIListForInactiveItem] +var extIEsTAIListForInactiveItem []apimpl.IESpec[ProtocolIEID, TAIListForInactiveItem] -func (tAIListForInactiveItem *TAIListForInactiveItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListForInactiveItem *TAIListForInactiveItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIListForInactiveItem.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTAIListForInactiveItem, tAIListForInactiveItem, tAIListForInactiveItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIListForInactiveItem, tAIListForInactiveItem, &tAIListForInactiveItem.iEExtensions) return notComprehended } func (tAIListForPagingItem *TAIListForPagingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIListForPagingItem, tAIListForPagingItem, tAIListForPagingItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIListForPagingItem, tAIListForPagingItem, tAIListForPagingItem.iEExtensions) w.WriteBit(tAIListForPagingItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIListForPagingItem.TAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36441,7 +36952,7 @@ func (tAIListForPagingItem *TAIListForPagingItem) UnmarshalPER(r *per.Reader, en return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIListForPagingItem, tAIListForPagingItem, &tAIListForPagingItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIListForPagingItem, tAIListForPagingItem, &tAIListForPagingItem.iEExtensions); err != nil { return err } } @@ -36453,19 +36964,19 @@ func (tAIListForPagingItem *TAIListForPagingItem) UnmarshalPER(r *per.Reader, en return nil } -var extIEsTAIListForPagingItem []ap.IESpec[ProtocolIEID, TAIListForPagingItem] +var extIEsTAIListForPagingItem []apimpl.IESpec[ProtocolIEID, TAIListForPagingItem] -func (tAIListForPagingItem *TAIListForPagingItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListForPagingItem *TAIListForPagingItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIListForPagingItem.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTAIListForPagingItem, tAIListForPagingItem, tAIListForPagingItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIListForPagingItem, tAIListForPagingItem, &tAIListForPagingItem.iEExtensions) return notComprehended } func (tAINSAGSupportItem *TAINSAGSupportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAINSAGSupportItem, tAINSAGSupportItem, tAINSAGSupportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAINSAGSupportItem, tAINSAGSupportItem, tAINSAGSupportItem.iEExtensions) w.WriteBit(tAINSAGSupportItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}, int64(tAINSAGSupportItem.NSAGID)); err != nil { @@ -36475,7 +36986,7 @@ func (tAINSAGSupportItem *TAINSAGSupportItem) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36506,7 +37017,7 @@ func (tAINSAGSupportItem *TAINSAGSupportItem) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAINSAGSupportItem, tAINSAGSupportItem, &tAINSAGSupportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAINSAGSupportItem, tAINSAGSupportItem, &tAINSAGSupportItem.iEExtensions); err != nil { return err } } @@ -36518,14 +37029,14 @@ func (tAINSAGSupportItem *TAINSAGSupportItem) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsTAINSAGSupportItem []ap.IESpec[ProtocolIEID, TAINSAGSupportItem] +var extIEsTAINSAGSupportItem []apimpl.IESpec[ProtocolIEID, TAINSAGSupportItem] -func (tAINSAGSupportItem *TAINSAGSupportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAINSAGSupportItem *TAINSAGSupportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAINSAGSupportItem.NSAGSliceSupportList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTAINSAGSupportItem, tAINSAGSupportItem, tAINSAGSupportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAINSAGSupportItem, tAINSAGSupportItem, &tAINSAGSupportItem.iEExtensions) return notComprehended } @@ -36551,7 +37062,7 @@ func (tNGFID *TNGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, tNGFID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, tNGFID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -36572,7 +37083,7 @@ func (tNGFID *TNGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } tNGFID.TNGFID = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -36586,17 +37097,17 @@ func (tNGFID *TNGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (tNGFID *TNGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tNGFID *TNGFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case tNGFID.TNGFID != nil: case tNGFID.ChoiceExtension != nil: - d.Unknown(tNGFID.ChoiceExtension.ID, tNGFID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, tNGFID.ChoiceExtension) } return false } func (tNLAssociationItem *TNLAssociationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTNLAssociationItem, tNLAssociationItem, tNLAssociationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTNLAssociationItem, tNLAssociationItem, tNLAssociationItem.iEExtensions) w.WriteBit(tNLAssociationItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tNLAssociationItem.TNLAssociationAddress.MarshalPER(w, enc); err != nil { @@ -36606,7 +37117,7 @@ func (tNLAssociationItem *TNLAssociationItem) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36635,7 +37146,7 @@ func (tNLAssociationItem *TNLAssociationItem) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTNLAssociationItem, tNLAssociationItem, &tNLAssociationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTNLAssociationItem, tNLAssociationItem, &tNLAssociationItem.iEExtensions); err != nil { return err } } @@ -36647,9 +37158,9 @@ func (tNLAssociationItem *TNLAssociationItem) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsTNLAssociationItem []ap.IESpec[ProtocolIEID, TNLAssociationItem] +var extIEsTNLAssociationItem []apimpl.IESpec[ProtocolIEID, TNLAssociationItem] -func (tNLAssociationItem *TNLAssociationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tNLAssociationItem *TNLAssociationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tNLAssociationItem.TNLAssociationAddress.Diagnose(d) { notComprehended = true @@ -36657,7 +37168,7 @@ func (tNLAssociationItem *TNLAssociationItem) Diagnose(d *ap.Diagnosis[ProtocolI if tNLAssociationItem.Cause.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTNLAssociationItem, tNLAssociationItem, tNLAssociationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTNLAssociationItem, tNLAssociationItem, &tNLAssociationItem.iEExtensions) return notComprehended } @@ -36678,12 +37189,12 @@ func (tNLAssociationUsage TNLAssociationUsage) Name() string { return enumTNLAssociationUsage.Name(tNLAssociationUsage) } -func (tNLAssociationUsage TNLAssociationUsage) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (tNLAssociationUsage TNLAssociationUsage) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTNLAssociationUsage.Known(tNLAssociationUsage) } func (tSCAssistanceInformation *TSCAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTSCAssistanceInformation, tSCAssistanceInformation, tSCAssistanceInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTSCAssistanceInformation, tSCAssistanceInformation, tSCAssistanceInformation.iEExtensions) w.WriteBit(tSCAssistanceInformation.extensions.Present()) w.WriteBit(tSCAssistanceInformation.BurstArrivalTime != nil) w.WriteBit(len(ext) > 0) @@ -36696,7 +37207,7 @@ func (tSCAssistanceInformation *TSCAssistanceInformation) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36733,7 +37244,7 @@ func (tSCAssistanceInformation *TSCAssistanceInformation) UnmarshalPER(r *per.Re tSCAssistanceInformation.BurstArrivalTime = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCAssistanceInformation, tSCAssistanceInformation, &tSCAssistanceInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTSCAssistanceInformation, tSCAssistanceInformation, &tSCAssistanceInformation.iEExtensions); err != nil { return err } } @@ -36745,11 +37256,11 @@ func (tSCAssistanceInformation *TSCAssistanceInformation) UnmarshalPER(r *per.Re return nil } -var extIEsTSCAssistanceInformation = []ap.IESpec[ProtocolIEID, TSCAssistanceInformation]{ +var extIEsTSCAssistanceInformation = []apimpl.IESpec[ProtocolIEID, TSCAssistanceInformation]{ { ID: IDSurvivalTime, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TSCAssistanceInformation, r *per.Reader, enc per.Encoding) error { var v SurvivalTime if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -36764,11 +37275,14 @@ var extIEsTSCAssistanceInformation = []ap.IESpec[ProtocolIEID, TSCAssistanceInfo } return x.SurvivalTime, true }, + Clear: func(x *TSCAssistanceInformation) { + x.SurvivalTime = nil + }, }, { ID: IDRANfeedbacktype, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TSCAssistanceInformation, r *per.Reader, enc per.Encoding) error { var v RANfeedbacktype if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -36783,11 +37297,14 @@ var extIEsTSCAssistanceInformation = []ap.IESpec[ProtocolIEID, TSCAssistanceInfo } return x.RANfeedbacktype, true }, + Clear: func(x *TSCAssistanceInformation) { + x.RANfeedbacktype = nil + }, }, { ID: IDN6JitterInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TSCAssistanceInformation, r *per.Reader, enc per.Encoding) error { var v N6JitterInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -36802,20 +37319,23 @@ var extIEsTSCAssistanceInformation = []ap.IESpec[ProtocolIEID, TSCAssistanceInfo } return x.N6JitterInformation, true }, + Clear: func(x *TSCAssistanceInformation) { + x.N6JitterInformation = nil + }, }, } -func (tSCAssistanceInformation *TSCAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tSCAssistanceInformation *TSCAssistanceInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tSCAssistanceInformation.Periodicity.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTSCAssistanceInformation, tSCAssistanceInformation, tSCAssistanceInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTSCAssistanceInformation, tSCAssistanceInformation, &tSCAssistanceInformation.iEExtensions) return notComprehended } func (tSCFeedbackInformation *TSCFeedbackInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTSCFeedbackInformation, tSCFeedbackInformation, tSCFeedbackInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTSCFeedbackInformation, tSCFeedbackInformation, tSCFeedbackInformation.iEExtensions) w.WriteBit(tSCFeedbackInformation.extensions.Present()) w.WriteBit(tSCFeedbackInformation.AdjustedPeriodicity != nil) w.WriteBit(len(ext) > 0) @@ -36828,7 +37348,7 @@ func (tSCFeedbackInformation *TSCFeedbackInformation) MarshalPER(w *per.Writer, } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36865,7 +37385,7 @@ func (tSCFeedbackInformation *TSCFeedbackInformation) UnmarshalPER(r *per.Reader tSCFeedbackInformation.AdjustedPeriodicity = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCFeedbackInformation, tSCFeedbackInformation, &tSCFeedbackInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTSCFeedbackInformation, tSCFeedbackInformation, &tSCFeedbackInformation.iEExtensions); err != nil { return err } } @@ -36877,9 +37397,9 @@ func (tSCFeedbackInformation *TSCFeedbackInformation) UnmarshalPER(r *per.Reader return nil } -var extIEsTSCFeedbackInformation []ap.IESpec[ProtocolIEID, TSCFeedbackInformation] +var extIEsTSCFeedbackInformation []apimpl.IESpec[ProtocolIEID, TSCFeedbackInformation] -func (tSCFeedbackInformation *TSCFeedbackInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tSCFeedbackInformation *TSCFeedbackInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tSCFeedbackInformation.BurstArrivalTimeOffset.Diagnose(d) { notComprehended = true @@ -36887,12 +37407,12 @@ func (tSCFeedbackInformation *TSCFeedbackInformation) Diagnose(d *ap.Diagnosis[P if tSCFeedbackInformation.AdjustedPeriodicity != nil && tSCFeedbackInformation.AdjustedPeriodicity.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTSCFeedbackInformation, tSCFeedbackInformation, tSCFeedbackInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTSCFeedbackInformation, tSCFeedbackInformation, &tSCFeedbackInformation.iEExtensions) return notComprehended } func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, tSCTrafficCharacteristics.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, tSCTrafficCharacteristics.iEExtensions) w.WriteBit(tSCTrafficCharacteristics.extensions.Present()) w.WriteBit(tSCTrafficCharacteristics.TSCAssistanceInformationDL != nil) w.WriteBit(tSCTrafficCharacteristics.TSCAssistanceInformationUL != nil) @@ -36908,7 +37428,7 @@ func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) MarshalPER(w *per.Wr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -36953,7 +37473,7 @@ func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) UnmarshalPER(r *per. tSCTrafficCharacteristics.TSCAssistanceInformationUL = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, &tSCTrafficCharacteristics.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, &tSCTrafficCharacteristics.iEExtensions); err != nil { return err } } @@ -36965,9 +37485,9 @@ func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) UnmarshalPER(r *per. return nil } -var extIEsTSCTrafficCharacteristics []ap.IESpec[ProtocolIEID, TSCTrafficCharacteristics] +var extIEsTSCTrafficCharacteristics []apimpl.IESpec[ProtocolIEID, TSCTrafficCharacteristics] -func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tSCTrafficCharacteristics.TSCAssistanceInformationDL != nil && tSCTrafficCharacteristics.TSCAssistanceInformationDL.Diagnose(d) { notComprehended = true @@ -36975,12 +37495,12 @@ func (tSCTrafficCharacteristics *TSCTrafficCharacteristics) Diagnose(d *ap.Diagn if tSCTrafficCharacteristics.TSCAssistanceInformationUL != nil && tSCTrafficCharacteristics.TSCAssistanceInformationUL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, tSCTrafficCharacteristics.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTSCTrafficCharacteristics, tSCTrafficCharacteristics, &tSCTrafficCharacteristics.iEExtensions) return notComprehended } func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback.iEExtensions) w.WriteBit(tSCTrafficCharacteristicsFeedback.extensions.Present()) w.WriteBit(tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL != nil) w.WriteBit(tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL != nil) @@ -36996,7 +37516,7 @@ func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) Mars } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37041,7 +37561,7 @@ func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) Unma tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, &tSCTrafficCharacteristicsFeedback.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, &tSCTrafficCharacteristicsFeedback.iEExtensions); err != nil { return err } } @@ -37053,9 +37573,9 @@ func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) Unma return nil } -var extIEsTSCTrafficCharacteristicsFeedback []ap.IESpec[ProtocolIEID, TSCTrafficCharacteristicsFeedback] +var extIEsTSCTrafficCharacteristicsFeedback []apimpl.IESpec[ProtocolIEID, TSCTrafficCharacteristicsFeedback] -func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL != nil && tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationDL.Diagnose(d) { notComprehended = true @@ -37063,7 +37583,7 @@ func (tSCTrafficCharacteristicsFeedback *TSCTrafficCharacteristicsFeedback) Diag if tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL != nil && tSCTrafficCharacteristicsFeedback.TSCFeedbackInformationUL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTSCTrafficCharacteristicsFeedback, tSCTrafficCharacteristicsFeedback, &tSCTrafficCharacteristicsFeedback.iEExtensions) return notComprehended } @@ -37089,7 +37609,7 @@ func (tWIFID *TWIFID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, tWIFID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, tWIFID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -37110,7 +37630,7 @@ func (tWIFID *TWIFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } tWIFID.TWIFID = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -37124,17 +37644,17 @@ func (tWIFID *TWIFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (tWIFID *TWIFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tWIFID *TWIFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case tWIFID.TWIFID != nil: case tWIFID.ChoiceExtension != nil: - d.Unknown(tWIFID.ChoiceExtension.ID, tWIFID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, tWIFID.ChoiceExtension) } return false } func (targetHomeENBID *TargetHomeENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetHomeENBID, targetHomeENBID, targetHomeENBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetHomeENBID, targetHomeENBID, targetHomeENBID.iEExtensions) w.WriteBit(targetHomeENBID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targetHomeENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -37147,7 +37667,7 @@ func (targetHomeENBID *TargetHomeENBID) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37179,7 +37699,7 @@ func (targetHomeENBID *TargetHomeENBID) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetHomeENBID, targetHomeENBID, &targetHomeENBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetHomeENBID, targetHomeENBID, &targetHomeENBID.iEExtensions); err != nil { return err } } @@ -37191,14 +37711,14 @@ func (targetHomeENBID *TargetHomeENBID) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsTargetHomeENBID []ap.IESpec[ProtocolIEID, TargetHomeENBID] +var extIEsTargetHomeENBID []apimpl.IESpec[ProtocolIEID, TargetHomeENBID] -func (targetHomeENBID *TargetHomeENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetHomeENBID *TargetHomeENBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetHomeENBID.SelectedEPSTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetHomeENBID, targetHomeENBID, targetHomeENBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetHomeENBID, targetHomeENBID, &targetHomeENBID.iEExtensions) return notComprehended } @@ -37231,17 +37751,17 @@ func (targetID *TargetID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDTargetRNCID, Criticality: targetID.choiceCriticality.Of(ap.CriticalityReject), Value: targetID.TargetRNCID}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDTargetRNCID, Criticality: targetID.choiceCriticality.Of(apimpl.CriticalityReject), Value: targetID.TargetRNCID}) case targetID.TargetHomeENBID != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDTargetHomeENBID, Criticality: targetID.choiceCriticality.Of(ap.CriticalityReject), Value: targetID.TargetHomeENBID}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDTargetHomeENBID, Criticality: targetID.choiceCriticality.Of(apimpl.CriticalityReject), Value: targetID.TargetHomeENBID}) case targetID.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, targetID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, targetID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -37268,33 +37788,25 @@ func (targetID *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } targetID.TargeteNBID = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDTargetRNCID: var v TargetRNCID - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - targetID.ChoiceExtension = &f - break - } targetID.TargetRNCID = &v - targetID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + targetID.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityReject) case IDTargetHomeENBID: var v TargetHomeENBID - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - targetID.ChoiceExtension = &f - break - } targetID.TargetHomeENBID = &v - targetID.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityReject) + targetID.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityReject) default: targetID.ChoiceExtension = &f } @@ -37304,24 +37816,24 @@ func (targetID *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (targetID *TargetID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetID *TargetID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case targetID.TargetRANNodeID != nil: return targetID.TargetRANNodeID.Diagnose(d) case targetID.TargeteNBID != nil: return targetID.TargeteNBID.Diagnose(d) case targetID.TargetRNCID != nil: - d.IE(IDTargetRNCID, targetID.choiceCriticality.Of(ap.CriticalityReject), targetID.TargetRNCID) + return apimpl.DiagnoseChoiceExtension(d, IDTargetRNCID, targetID.choiceCriticality.Of(apimpl.CriticalityReject), &targetID.TargetRNCID, &targetID.ChoiceExtension) case targetID.TargetHomeENBID != nil: - d.IE(IDTargetHomeENBID, targetID.choiceCriticality.Of(ap.CriticalityReject), targetID.TargetHomeENBID) + return apimpl.DiagnoseChoiceExtension(d, IDTargetHomeENBID, targetID.choiceCriticality.Of(apimpl.CriticalityReject), &targetID.TargetHomeENBID, &targetID.ChoiceExtension) case targetID.ChoiceExtension != nil: - d.Unknown(targetID.ChoiceExtension.ID, targetID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, targetID.ChoiceExtension) } return false } func (targetNSSAIInformation *TargetNSSAIInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetNSSAIInformation, targetNSSAIInformation, targetNSSAIInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetNSSAIInformation, targetNSSAIInformation, targetNSSAIInformation.iEExtensions) w.WriteBit(targetNSSAIInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targetNSSAIInformation.TargetNSSAI.MarshalPER(w, enc); err != nil { @@ -37331,7 +37843,7 @@ func (targetNSSAIInformation *TargetNSSAIInformation) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37360,7 +37872,7 @@ func (targetNSSAIInformation *TargetNSSAIInformation) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetNSSAIInformation, targetNSSAIInformation, &targetNSSAIInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetNSSAIInformation, targetNSSAIInformation, &targetNSSAIInformation.iEExtensions); err != nil { return err } } @@ -37372,9 +37884,9 @@ func (targetNSSAIInformation *TargetNSSAIInformation) UnmarshalPER(r *per.Reader return nil } -var extIEsTargetNSSAIInformation []ap.IESpec[ProtocolIEID, TargetNSSAIInformation] +var extIEsTargetNSSAIInformation []apimpl.IESpec[ProtocolIEID, TargetNSSAIInformation] -func (targetNSSAIInformation *TargetNSSAIInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetNSSAIInformation *TargetNSSAIInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetNSSAIInformation.TargetNSSAI.Diagnose(d) { notComprehended = true @@ -37382,19 +37894,19 @@ func (targetNSSAIInformation *TargetNSSAIInformation) Diagnose(d *ap.Diagnosis[P if targetNSSAIInformation.IndexToRFSP.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetNSSAIInformation, targetNSSAIInformation, targetNSSAIInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetNSSAIInformation, targetNSSAIInformation, &targetNSSAIInformation.iEExtensions) return notComprehended } func (targetNSSAIItem *TargetNSSAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetNSSAIItem, targetNSSAIItem, targetNSSAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetNSSAIItem, targetNSSAIItem, targetNSSAIItem.iEExtensions) w.WriteBit(targetNSSAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targetNSSAIItem.SNSSAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37420,7 +37932,7 @@ func (targetNSSAIItem *TargetNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetNSSAIItem, targetNSSAIItem, &targetNSSAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetNSSAIItem, targetNSSAIItem, &targetNSSAIItem.iEExtensions); err != nil { return err } } @@ -37432,19 +37944,19 @@ func (targetNSSAIItem *TargetNSSAIItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsTargetNSSAIItem []ap.IESpec[ProtocolIEID, TargetNSSAIItem] +var extIEsTargetNSSAIItem []apimpl.IESpec[ProtocolIEID, TargetNSSAIItem] -func (targetNSSAIItem *TargetNSSAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetNSSAIItem *TargetNSSAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetNSSAIItem.SNSSAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetNSSAIItem, targetNSSAIItem, targetNSSAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetNSSAIItem, targetNSSAIItem, &targetNSSAIItem.iEExtensions) return notComprehended } func (targetRANNodeID *TargetRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetRANNodeID, targetRANNodeID, targetRANNodeID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetRANNodeID, targetRANNodeID, targetRANNodeID.iEExtensions) w.WriteBit(targetRANNodeID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targetRANNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { @@ -37454,7 +37966,7 @@ func (targetRANNodeID *TargetRANNodeID) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37483,7 +37995,7 @@ func (targetRANNodeID *TargetRANNodeID) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRANNodeID, targetRANNodeID, &targetRANNodeID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetRANNodeID, targetRANNodeID, &targetRANNodeID.iEExtensions); err != nil { return err } } @@ -37495,11 +38007,11 @@ func (targetRANNodeID *TargetRANNodeID) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsTargetRANNodeID = []ap.IESpec[ProtocolIEID, TargetRANNodeID]{ +var extIEsTargetRANNodeID = []apimpl.IESpec[ProtocolIEID, TargetRANNodeID]{ { ID: IDSelectedTargetSNPNIdentity, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *TargetRANNodeID, r *per.Reader, enc per.Encoding) error { var v NID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -37514,10 +38026,13 @@ var extIEsTargetRANNodeID = []ap.IESpec[ProtocolIEID, TargetRANNodeID]{ } return x.SelectedTargetSNPNIdentity, true }, + Clear: func(x *TargetRANNodeID) { + x.SelectedTargetSNPNIdentity = nil + }, }, } -func (targetRANNodeID *TargetRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetRANNodeID *TargetRANNodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetRANNodeID.GlobalRANNodeID.Diagnose(d) { notComprehended = true @@ -37525,12 +38040,12 @@ func (targetRANNodeID *TargetRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) if targetRANNodeID.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetRANNodeID, targetRANNodeID, targetRANNodeID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetRANNodeID, targetRANNodeID, &targetRANNodeID.iEExtensions) return notComprehended } func (targetRANNodeIDSON *TargetRANNodeIDSON) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetRANNodeIDSON, targetRANNodeIDSON, targetRANNodeIDSON.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetRANNodeIDSON, targetRANNodeIDSON, targetRANNodeIDSON.iEExtensions) w.WriteBit(targetRANNodeIDSON.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targetRANNodeIDSON.GlobalRANNodeID.MarshalPER(w, enc); err != nil { @@ -37540,7 +38055,7 @@ func (targetRANNodeIDSON *TargetRANNodeIDSON) MarshalPER(w *per.Writer, enc per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37569,7 +38084,7 @@ func (targetRANNodeIDSON *TargetRANNodeIDSON) UnmarshalPER(r *per.Reader, enc pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRANNodeIDSON, targetRANNodeIDSON, &targetRANNodeIDSON.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetRANNodeIDSON, targetRANNodeIDSON, &targetRANNodeIDSON.iEExtensions); err != nil { return err } } @@ -37581,11 +38096,11 @@ func (targetRANNodeIDSON *TargetRANNodeIDSON) UnmarshalPER(r *per.Reader, enc pe return nil } -var extIEsTargetRANNodeIDSON = []ap.IESpec[ProtocolIEID, TargetRANNodeIDSON]{ +var extIEsTargetRANNodeIDSON = []apimpl.IESpec[ProtocolIEID, TargetRANNodeIDSON]{ { ID: IDNRCGI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TargetRANNodeIDSON, r *per.Reader, enc per.Encoding) error { var v NRCGI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -37600,10 +38115,13 @@ var extIEsTargetRANNodeIDSON = []ap.IESpec[ProtocolIEID, TargetRANNodeIDSON]{ } return x.NRCGI, true }, + Clear: func(x *TargetRANNodeIDSON) { + x.NRCGI = nil + }, }, } -func (targetRANNodeIDSON *TargetRANNodeIDSON) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetRANNodeIDSON *TargetRANNodeIDSON) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetRANNodeIDSON.GlobalRANNodeID.Diagnose(d) { notComprehended = true @@ -37611,12 +38129,12 @@ func (targetRANNodeIDSON *TargetRANNodeIDSON) Diagnose(d *ap.Diagnosis[ProtocolI if targetRANNodeIDSON.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetRANNodeIDSON, targetRANNodeIDSON, targetRANNodeIDSON.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetRANNodeIDSON, targetRANNodeIDSON, &targetRANNodeIDSON.iEExtensions) return notComprehended } func (targetRNCID *TargetRNCID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) w.WriteBit(targetRNCID.extensions.Present()) w.WriteBit(targetRNCID.ExtendedRNCID != nil) w.WriteBit(len(ext) > 0) @@ -37632,7 +38150,7 @@ func (targetRNCID *TargetRNCID) MarshalPER(w *per.Writer, enc per.Encoding) erro } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37672,7 +38190,7 @@ func (targetRNCID *TargetRNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) er targetRNCID.ExtendedRNCID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions); err != nil { return err } } @@ -37684,19 +38202,19 @@ func (targetRNCID *TargetRNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsTargetRNCID []ap.IESpec[ProtocolIEID, TargetRNCID] +var extIEsTargetRNCID []apimpl.IESpec[ProtocolIEID, TargetRNCID] -func (targetRNCID *TargetRNCID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetRNCID *TargetRNCID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetRNCID.LAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions) return notComprehended } func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) w.WriteBit(targeteNBID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targeteNBID.GlobalENBID.MarshalPER(w, enc); err != nil { @@ -37706,7 +38224,7 @@ func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) erro return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37735,7 +38253,7 @@ func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions); err != nil { return err } } @@ -37747,9 +38265,9 @@ func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsTargeteNBID []ap.IESpec[ProtocolIEID, TargeteNBID] +var extIEsTargeteNBID []apimpl.IESpec[ProtocolIEID, TargeteNBID] -func (targeteNBID *TargeteNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targeteNBID *TargeteNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targeteNBID.GlobalENBID.Diagnose(d) { notComprehended = true @@ -37757,12 +38275,12 @@ func (targeteNBID *TargeteNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { if targeteNBID.SelectedEPSTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions) return notComprehended } func (timeBasedHandoverInformation *TimeBasedHandoverInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) w.WriteBit(timeBasedHandoverInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := timeBasedHandoverInformation.HOWindowStart.MarshalPER(w, enc); err != nil { @@ -37772,7 +38290,7 @@ func (timeBasedHandoverInformation *TimeBasedHandoverInformation) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37801,7 +38319,7 @@ func (timeBasedHandoverInformation *TimeBasedHandoverInformation) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions); err != nil { return err } } @@ -37813,16 +38331,16 @@ func (timeBasedHandoverInformation *TimeBasedHandoverInformation) UnmarshalPER(r return nil } -var extIEsTimeBasedHandoverInformation []ap.IESpec[ProtocolIEID, TimeBasedHandoverInformation] +var extIEsTimeBasedHandoverInformation []apimpl.IESpec[ProtocolIEID, TimeBasedHandoverInformation] -func (timeBasedHandoverInformation *TimeBasedHandoverInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions) return notComprehended } func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, timeSyncAssistanceInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, timeSyncAssistanceInfo.iEExtensions) w.WriteBit(timeSyncAssistanceInfo.extensions.Present()) w.WriteBit(timeSyncAssistanceInfo.UUTimeSyncErrorBudget != nil) w.WriteBit(len(ext) > 0) @@ -37835,7 +38353,7 @@ func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) MarshalPER(w *per.Writer, } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -37872,7 +38390,7 @@ func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) UnmarshalPER(r *per.Reader timeSyncAssistanceInfo.UUTimeSyncErrorBudget = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, &timeSyncAssistanceInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, &timeSyncAssistanceInfo.iEExtensions); err != nil { return err } } @@ -37884,11 +38402,11 @@ func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) UnmarshalPER(r *per.Reader return nil } -var extIEsTimeSyncAssistanceInfo = []ap.IESpec[ProtocolIEID, TimeSyncAssistanceInfo]{ +var extIEsTimeSyncAssistanceInfo = []apimpl.IESpec[ProtocolIEID, TimeSyncAssistanceInfo]{ { ID: IDClockQualityReportingControlInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TimeSyncAssistanceInfo, r *per.Reader, enc per.Encoding) error { var v ClockQualityReportingControlInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -37903,10 +38421,13 @@ var extIEsTimeSyncAssistanceInfo = []ap.IESpec[ProtocolIEID, TimeSyncAssistanceI } return x.ClockQualityReportingControlInfo, true }, + Clear: func(x *TimeSyncAssistanceInfo) { + x.ClockQualityReportingControlInfo = nil + }, }, } -func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if timeSyncAssistanceInfo.TimeDistributionIndication.Diagnose(d) { notComprehended = true @@ -37914,7 +38435,7 @@ func (timeSyncAssistanceInfo *TimeSyncAssistanceInfo) Diagnose(d *ap.Diagnosis[P if timeSyncAssistanceInfo.UUTimeSyncErrorBudget != nil && timeSyncAssistanceInfo.UUTimeSyncErrorBudget.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, timeSyncAssistanceInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTimeSyncAssistanceInfo, timeSyncAssistanceInfo, &timeSyncAssistanceInfo.iEExtensions) return notComprehended } @@ -37935,7 +38456,7 @@ func (timeSyncAssistanceInfoTimeDistributionIndication TimeSyncAssistanceInfoTim return enumTimeSyncAssistanceInfoTimeDistributionIndication.Name(timeSyncAssistanceInfoTimeDistributionIndication) } -func (timeSyncAssistanceInfoTimeDistributionIndication TimeSyncAssistanceInfoTimeDistributionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (timeSyncAssistanceInfoTimeDistributionIndication TimeSyncAssistanceInfoTimeDistributionIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTimeSyncAssistanceInfoTimeDistributionIndication.Known(timeSyncAssistanceInfoTimeDistributionIndication) } @@ -37973,7 +38494,7 @@ func (timeToWait TimeToWait) Name() string { return enumTimeToWait.Name(timeToWait) } -func (timeToWait TimeToWait) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (timeToWait TimeToWait) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTimeToWait.Known(timeToWait) } @@ -37994,12 +38515,12 @@ func (timerApproachForGUAMIRemoval TimerApproachForGUAMIRemoval) Name() string { return enumTimerApproachForGUAMIRemoval.Name(timerApproachForGUAMIRemoval) } -func (timerApproachForGUAMIRemoval TimerApproachForGUAMIRemoval) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (timerApproachForGUAMIRemoval TimerApproachForGUAMIRemoval) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTimerApproachForGUAMIRemoval.Known(timerApproachForGUAMIRemoval) } func (tooearlyIntersystemHO *TooearlyIntersystemHO) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, tooearlyIntersystemHO.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, tooearlyIntersystemHO.iEExtensions) w.WriteBit(tooearlyIntersystemHO.extensions.Present()) w.WriteBit(tooearlyIntersystemHO.UERLFReportContainer != nil) w.WriteBit(len(ext) > 0) @@ -38015,7 +38536,7 @@ func (tooearlyIntersystemHO *TooearlyIntersystemHO) MarshalPER(w *per.Writer, en } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -38055,7 +38576,7 @@ func (tooearlyIntersystemHO *TooearlyIntersystemHO) UnmarshalPER(r *per.Reader, tooearlyIntersystemHO.UERLFReportContainer = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, &tooearlyIntersystemHO.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, &tooearlyIntersystemHO.iEExtensions); err != nil { return err } } @@ -38067,9 +38588,9 @@ func (tooearlyIntersystemHO *TooearlyIntersystemHO) UnmarshalPER(r *per.Reader, return nil } -var extIEsTooearlyIntersystemHO []ap.IESpec[ProtocolIEID, TooearlyIntersystemHO] +var extIEsTooearlyIntersystemHO []apimpl.IESpec[ProtocolIEID, TooearlyIntersystemHO] -func (tooearlyIntersystemHO *TooearlyIntersystemHO) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tooearlyIntersystemHO *TooearlyIntersystemHO) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tooearlyIntersystemHO.SourcecellID.Diagnose(d) { notComprehended = true @@ -38080,12 +38601,12 @@ func (tooearlyIntersystemHO *TooearlyIntersystemHO) Diagnose(d *ap.Diagnosis[Pro if tooearlyIntersystemHO.UERLFReportContainer != nil && tooearlyIntersystemHO.UERLFReportContainer.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, tooearlyIntersystemHO.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTooearlyIntersystemHO, tooearlyIntersystemHO, &tooearlyIntersystemHO.iEExtensions) return notComprehended } func (traceActivation *TraceActivation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) w.WriteBit(traceActivation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := traceActivation.NGRANTraceID.MarshalPER(w, enc); err != nil { @@ -38101,7 +38622,7 @@ func (traceActivation *TraceActivation) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -38136,7 +38657,7 @@ func (traceActivation *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions); err != nil { return err } } @@ -38148,11 +38669,11 @@ func (traceActivation *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ +var extIEsTraceActivation = []apimpl.IESpec[ProtocolIEID, TraceActivation]{ { ID: IDMDTConfiguration, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { var v MDTConfiguration if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -38167,11 +38688,14 @@ var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ } return x.MDTConfiguration, true }, + Clear: func(x *TraceActivation) { + x.MDTConfiguration = nil + }, }, { ID: IDTraceCollectionEntityURI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { var v URIAddress if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -38186,15 +38710,18 @@ var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ } return x.TraceCollectionEntityURI, true }, + Clear: func(x *TraceActivation) { + x.TraceCollectionEntityURI = nil + }, }, } -func (traceActivation *TraceActivation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (traceActivation *TraceActivation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if traceActivation.TraceDepth.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions) return notComprehended } @@ -38215,7 +38742,7 @@ func (traceDepth TraceDepth) Name() string { return enumTraceDepth.Name(traceDepth) } -func (traceDepth TraceDepth) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (traceDepth TraceDepth) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTraceDepth.Known(traceDepth) } @@ -38253,12 +38780,12 @@ func (typeOfError TypeOfError) Name() string { return enumTypeOfError.Name(typeOfError) } -func (typeOfError TypeOfError) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (typeOfError TypeOfError) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTypeOfError.Known(typeOfError) } func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) w.WriteBit(uEAggregateMaximumBitRate.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uEAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { @@ -38268,7 +38795,7 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -38297,7 +38824,7 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions); err != nil { return err } } @@ -38309,9 +38836,9 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per. return nil } -var extIEsUEAggregateMaximumBitRate []ap.IESpec[ProtocolIEID, UEAggregateMaximumBitRate] +var extIEsUEAggregateMaximumBitRate []apimpl.IESpec[ProtocolIEID, UEAggregateMaximumBitRate] -func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uEAggregateMaximumBitRate.DL.Diagnose(d) { notComprehended = true @@ -38319,12 +38846,12 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) Diagnose(d *ap.Diagn if uEAggregateMaximumBitRate.UL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions) return notComprehended } func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo.iEExtensions) w.WriteBit(uEAppLayerMeasConfigInfo.extensions.Present()) w.WriteBit(uEAppLayerMeasConfigInfo.AreaScopeOfQMC != nil) w.WriteBit(uEAppLayerMeasConfigInfo.QoEMeasurementStatus != nil) @@ -38379,7 +38906,7 @@ func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) MarshalPER(w *per.Writ } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -38484,7 +39011,7 @@ func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) UnmarshalPER(r *per.Re uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, &uEAppLayerMeasConfigInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, &uEAppLayerMeasConfigInfo.iEExtensions); err != nil { return err } } @@ -38496,11 +39023,11 @@ func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) UnmarshalPER(r *per.Re return nil } -var extIEsUEAppLayerMeasConfigInfo = []ap.IESpec[ProtocolIEID, UEAppLayerMeasConfigInfo]{ +var extIEsUEAppLayerMeasConfigInfo = []apimpl.IESpec[ProtocolIEID, UEAppLayerMeasConfigInfo]{ { ID: IDAssistanceInformationQoEMeas, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UEAppLayerMeasConfigInfo, r *per.Reader, enc per.Encoding) error { var v AssistanceInformationQoEMeas if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -38515,11 +39042,14 @@ var extIEsUEAppLayerMeasConfigInfo = []ap.IESpec[ProtocolIEID, UEAppLayerMeasCon } return x.AssistanceInformationQoEMeas, true }, + Clear: func(x *UEAppLayerMeasConfigInfo) { + x.AssistanceInformationQoEMeas = nil + }, }, { ID: IDCommServiceType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UEAppLayerMeasConfigInfo, r *per.Reader, enc per.Encoding) error { var v CommServiceType if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -38534,11 +39064,14 @@ var extIEsUEAppLayerMeasConfigInfo = []ap.IESpec[ProtocolIEID, UEAppLayerMeasCon } return x.CommServiceType, true }, + Clear: func(x *UEAppLayerMeasConfigInfo) { + x.CommServiceType = nil + }, }, { ID: IDQoERVQoEReportingPaths, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UEAppLayerMeasConfigInfo, r *per.Reader, enc per.Encoding) error { var v QoERVQoEReportingPaths if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -38553,10 +39086,13 @@ var extIEsUEAppLayerMeasConfigInfo = []ap.IESpec[ProtocolIEID, UEAppLayerMeasCon } return x.QoERVQoEReportingPaths, true }, + Clear: func(x *UEAppLayerMeasConfigInfo) { + x.QoERVQoEReportingPaths = nil + }, }, } -func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uEAppLayerMeasConfigInfo.ServiceType.Diagnose(d) { notComprehended = true @@ -38579,7 +39115,7 @@ func (uEAppLayerMeasConfigInfo *UEAppLayerMeasConfigInfo) Diagnose(d *ap.Diagnos if uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics != nil && uEAppLayerMeasConfigInfo.AvailableRANVisibleQoEMetrics.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEAppLayerMeasConfigInfo, uEAppLayerMeasConfigInfo, &uEAppLayerMeasConfigInfo.iEExtensions) return notComprehended } @@ -38600,19 +39136,19 @@ func (uEAppLayerMeasConfigInfoQoEMeasurementStatus UEAppLayerMeasConfigInfoQoEMe return enumUEAppLayerMeasConfigInfoQoEMeasurementStatus.Name(uEAppLayerMeasConfigInfoQoEMeasurementStatus) } -func (uEAppLayerMeasConfigInfoQoEMeasurementStatus UEAppLayerMeasConfigInfoQoEMeasurementStatus) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEAppLayerMeasConfigInfoQoEMeasurementStatus UEAppLayerMeasConfigInfoQoEMeasurementStatus) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEAppLayerMeasConfigInfoQoEMeasurementStatus.Known(uEAppLayerMeasConfigInfoQoEMeasurementStatus) } func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem.iEExtensions) w.WriteBit(uEAppLayerMeasInfoItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uEAppLayerMeasInfoItem.UEAppLayerMeasConfigInfo.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -38638,7 +39174,7 @@ func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, &uEAppLayerMeasInfoItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, &uEAppLayerMeasInfoItem.iEExtensions); err != nil { return err } } @@ -38650,19 +39186,19 @@ func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) UnmarshalPER(r *per.Reader return nil } -var extIEsUEAppLayerMeasInfoItem []ap.IESpec[ProtocolIEID, UEAppLayerMeasInfoItem] +var extIEsUEAppLayerMeasInfoItem []apimpl.IESpec[ProtocolIEID, UEAppLayerMeasInfoItem] -func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAppLayerMeasInfoItem *UEAppLayerMeasInfoItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uEAppLayerMeasInfoItem.UEAppLayerMeasConfigInfo.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEAppLayerMeasInfoItem, uEAppLayerMeasInfoItem, &uEAppLayerMeasInfoItem.iEExtensions) return notComprehended } func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem.iEExtensions) w.WriteBit(uEAssociatedLogicalNGConnectionItem.extensions.Present()) w.WriteBit(uEAssociatedLogicalNGConnectionItem.AMFUENGAPID != nil) w.WriteBit(uEAssociatedLogicalNGConnectionItem.RANUENGAPID != nil) @@ -38678,7 +39214,7 @@ func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -38723,7 +39259,7 @@ func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) uEAssociatedLogicalNGConnectionItem.RANUENGAPID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, &uEAssociatedLogicalNGConnectionItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, &uEAssociatedLogicalNGConnectionItem.iEExtensions); err != nil { return err } } @@ -38735,11 +39271,11 @@ func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) return nil } -var extIEsUEAssociatedLogicalNGConnectionItem []ap.IESpec[ProtocolIEID, UEAssociatedLogicalNGConnectionItem] +var extIEsUEAssociatedLogicalNGConnectionItem []apimpl.IESpec[ProtocolIEID, UEAssociatedLogicalNGConnectionItem] -func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAssociatedLogicalNGConnectionItem *UEAssociatedLogicalNGConnectionItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEAssociatedLogicalNGConnectionItem, uEAssociatedLogicalNGConnectionItem, &uEAssociatedLogicalNGConnectionItem.iEExtensions) return notComprehended } @@ -38760,7 +39296,7 @@ func (uECapabilityInfoRequest UECapabilityInfoRequest) Name() string { return enumUECapabilityInfoRequest.Name(uECapabilityInfoRequest) } -func (uECapabilityInfoRequest UECapabilityInfoRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uECapabilityInfoRequest UECapabilityInfoRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUECapabilityInfoRequest.Known(uECapabilityInfoRequest) } @@ -38781,12 +39317,12 @@ func (uEContextRequest UEContextRequest) Name() string { return enumUEContextRequest.Name(uEContextRequest) } -func (uEContextRequest UEContextRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEContextRequest UEContextRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEContextRequest.Known(uEContextRequest) } func (uEDifferentiationInfo *UEDifferentiationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEDifferentiationInfo, uEDifferentiationInfo, uEDifferentiationInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEDifferentiationInfo, uEDifferentiationInfo, uEDifferentiationInfo.iEExtensions) w.WriteBit(uEDifferentiationInfo.extensions.Present()) w.WriteBit(uEDifferentiationInfo.PeriodicCommunicationIndicator != nil) w.WriteBit(uEDifferentiationInfo.PeriodicTime != nil) @@ -38826,7 +39362,7 @@ func (uEDifferentiationInfo *UEDifferentiationInfo) MarshalPER(w *per.Writer, en } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -38915,7 +39451,7 @@ func (uEDifferentiationInfo *UEDifferentiationInfo) UnmarshalPER(r *per.Reader, uEDifferentiationInfo.BatteryIndication = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEDifferentiationInfo, uEDifferentiationInfo, &uEDifferentiationInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEDifferentiationInfo, uEDifferentiationInfo, &uEDifferentiationInfo.iEExtensions); err != nil { return err } } @@ -38927,9 +39463,9 @@ func (uEDifferentiationInfo *UEDifferentiationInfo) UnmarshalPER(r *per.Reader, return nil } -var extIEsUEDifferentiationInfo []ap.IESpec[ProtocolIEID, UEDifferentiationInfo] +var extIEsUEDifferentiationInfo []apimpl.IESpec[ProtocolIEID, UEDifferentiationInfo] -func (uEDifferentiationInfo *UEDifferentiationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEDifferentiationInfo *UEDifferentiationInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uEDifferentiationInfo.PeriodicCommunicationIndicator != nil && uEDifferentiationInfo.PeriodicCommunicationIndicator.Diagnose(d) { notComprehended = true @@ -38949,7 +39485,7 @@ func (uEDifferentiationInfo *UEDifferentiationInfo) Diagnose(d *ap.Diagnosis[Pro if uEDifferentiationInfo.BatteryIndication != nil && uEDifferentiationInfo.BatteryIndication.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUEDifferentiationInfo, uEDifferentiationInfo, uEDifferentiationInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEDifferentiationInfo, uEDifferentiationInfo, &uEDifferentiationInfo.iEExtensions) return notComprehended } @@ -38970,7 +39506,7 @@ func (uEDifferentiationInfoBatteryIndication UEDifferentiationInfoBatteryIndicat return enumUEDifferentiationInfoBatteryIndication.Name(uEDifferentiationInfoBatteryIndication) } -func (uEDifferentiationInfoBatteryIndication UEDifferentiationInfoBatteryIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEDifferentiationInfoBatteryIndication UEDifferentiationInfoBatteryIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEDifferentiationInfoBatteryIndication.Known(uEDifferentiationInfoBatteryIndication) } @@ -38991,7 +39527,7 @@ func (uEDifferentiationInfoPeriodicCommunicationIndicator UEDifferentiationInfoP return enumUEDifferentiationInfoPeriodicCommunicationIndicator.Name(uEDifferentiationInfoPeriodicCommunicationIndicator) } -func (uEDifferentiationInfoPeriodicCommunicationIndicator UEDifferentiationInfoPeriodicCommunicationIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEDifferentiationInfoPeriodicCommunicationIndicator UEDifferentiationInfoPeriodicCommunicationIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEDifferentiationInfoPeriodicCommunicationIndicator.Known(uEDifferentiationInfoPeriodicCommunicationIndicator) } @@ -39012,7 +39548,7 @@ func (uEDifferentiationInfoStationaryIndication UEDifferentiationInfoStationaryI return enumUEDifferentiationInfoStationaryIndication.Name(uEDifferentiationInfoStationaryIndication) } -func (uEDifferentiationInfoStationaryIndication UEDifferentiationInfoStationaryIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEDifferentiationInfoStationaryIndication UEDifferentiationInfoStationaryIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEDifferentiationInfoStationaryIndication.Known(uEDifferentiationInfoStationaryIndication) } @@ -39033,7 +39569,7 @@ func (uEDifferentiationInfoTrafficProfile UEDifferentiationInfoTrafficProfile) N return enumUEDifferentiationInfoTrafficProfile.Name(uEDifferentiationInfoTrafficProfile) } -func (uEDifferentiationInfoTrafficProfile UEDifferentiationInfoTrafficProfile) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEDifferentiationInfoTrafficProfile UEDifferentiationInfoTrafficProfile) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEDifferentiationInfoTrafficProfile.Known(uEDifferentiationInfoTrafficProfile) } @@ -39059,7 +39595,7 @@ func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) MarshalPER(w if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, uEHistoryInformationFromTheUE.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, uEHistoryInformationFromTheUE.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -39080,7 +39616,7 @@ func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) UnmarshalPER } uEHistoryInformationFromTheUE.NR = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -39094,11 +39630,11 @@ func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) UnmarshalPER return nil } -func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEHistoryInformationFromTheUE *UEHistoryInformationFromTheUE) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uEHistoryInformationFromTheUE.NR != nil: case uEHistoryInformationFromTheUE.ChoiceExtension != nil: - d.Unknown(uEHistoryInformationFromTheUE.ChoiceExtension.ID, uEHistoryInformationFromTheUE.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, uEHistoryInformationFromTheUE.ChoiceExtension) } return false } @@ -39125,7 +39661,7 @@ func (uEIdentityIndexValue *UEIdentityIndexValue) MarshalPER(w *per.Writer, enc if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, uEIdentityIndexValue.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, uEIdentityIndexValue.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -39146,7 +39682,7 @@ func (uEIdentityIndexValue *UEIdentityIndexValue) UnmarshalPER(r *per.Reader, en } uEIdentityIndexValue.IndexLength10 = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -39160,17 +39696,17 @@ func (uEIdentityIndexValue *UEIdentityIndexValue) UnmarshalPER(r *per.Reader, en return nil } -func (uEIdentityIndexValue *UEIdentityIndexValue) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEIdentityIndexValue *UEIdentityIndexValue) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uEIdentityIndexValue.IndexLength10 != nil: case uEIdentityIndexValue.ChoiceExtension != nil: - d.Unknown(uEIdentityIndexValue.ChoiceExtension.ID, uEIdentityIndexValue.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, uEIdentityIndexValue.ChoiceExtension) } return false } func (uENGAPIDPair *UENGAPIDPair) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUENGAPIDPair, uENGAPIDPair, uENGAPIDPair.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUENGAPIDPair, uENGAPIDPair, uENGAPIDPair.iEExtensions) w.WriteBit(uENGAPIDPair.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uENGAPIDPair.AMFUENGAPID.MarshalPER(w, enc); err != nil { @@ -39180,7 +39716,7 @@ func (uENGAPIDPair *UENGAPIDPair) MarshalPER(w *per.Writer, enc per.Encoding) er return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -39209,7 +39745,7 @@ func (uENGAPIDPair *UENGAPIDPair) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUENGAPIDPair, uENGAPIDPair, &uENGAPIDPair.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUENGAPIDPair, uENGAPIDPair, &uENGAPIDPair.iEExtensions); err != nil { return err } } @@ -39221,11 +39757,11 @@ func (uENGAPIDPair *UENGAPIDPair) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsUENGAPIDPair []ap.IESpec[ProtocolIEID, UENGAPIDPair] +var extIEsUENGAPIDPair []apimpl.IESpec[ProtocolIEID, UENGAPIDPair] -func (uENGAPIDPair *UENGAPIDPair) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uENGAPIDPair *UENGAPIDPair) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUENGAPIDPair, uENGAPIDPair, uENGAPIDPair.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUENGAPIDPair, uENGAPIDPair, &uENGAPIDPair.iEExtensions) return notComprehended } @@ -39258,7 +39794,7 @@ func (uENGAPIDs *UENGAPIDs) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, uENGAPIDs.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, uENGAPIDs.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -39285,7 +39821,7 @@ func (uENGAPIDs *UENGAPIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error } uENGAPIDs.AMFUENGAPID = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -39299,13 +39835,13 @@ func (uENGAPIDs *UENGAPIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -func (uENGAPIDs *UENGAPIDs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uENGAPIDs *UENGAPIDs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uENGAPIDs.UENGAPIDPair != nil: return uENGAPIDs.UENGAPIDPair.Diagnose(d) case uENGAPIDs.AMFUENGAPID != nil: case uENGAPIDs.ChoiceExtension != nil: - d.Unknown(uENGAPIDs.ChoiceExtension.ID, uENGAPIDs.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, uENGAPIDs.ChoiceExtension) } return false } @@ -39332,7 +39868,7 @@ func (uEPagingIdentity *UEPagingIdentity) MarshalPER(w *per.Writer, enc per.Enco if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, uEPagingIdentity.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, uEPagingIdentity.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -39353,7 +39889,7 @@ func (uEPagingIdentity *UEPagingIdentity) UnmarshalPER(r *per.Reader, enc per.En } uEPagingIdentity.FiveGSTMSI = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -39367,12 +39903,12 @@ func (uEPagingIdentity *UEPagingIdentity) UnmarshalPER(r *per.Reader, enc per.En return nil } -func (uEPagingIdentity *UEPagingIdentity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEPagingIdentity *UEPagingIdentity) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uEPagingIdentity.FiveGSTMSI != nil: return uEPagingIdentity.FiveGSTMSI.Diagnose(d) case uEPagingIdentity.ChoiceExtension != nil: - d.Unknown(uEPagingIdentity.ChoiceExtension.ID, uEPagingIdentity.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, uEPagingIdentity.ChoiceExtension) } return false } @@ -39394,12 +39930,12 @@ func (uEPresence UEPresence) Name() string { return enumUEPresence.Name(uEPresence) } -func (uEPresence UEPresence) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEPresence UEPresence) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEPresence.Known(uEPresence) } func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem.iEExtensions) w.WriteBit(uEPresenceInAreaOfInterestItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uEPresenceInAreaOfInterestItem.LocationReportingReferenceID.MarshalPER(w, enc); err != nil { @@ -39409,7 +39945,7 @@ func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -39438,7 +39974,7 @@ func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, &uEPresenceInAreaOfInterestItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, &uEPresenceInAreaOfInterestItem.iEExtensions); err != nil { return err } } @@ -39450,9 +39986,9 @@ func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) UnmarshalP return nil } -var extIEsUEPresenceInAreaOfInterestItem []ap.IESpec[ProtocolIEID, UEPresenceInAreaOfInterestItem] +var extIEsUEPresenceInAreaOfInterestItem []apimpl.IESpec[ProtocolIEID, UEPresenceInAreaOfInterestItem] -func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uEPresenceInAreaOfInterestItem.LocationReportingReferenceID.Diagnose(d) { notComprehended = true @@ -39460,7 +39996,7 @@ func (uEPresenceInAreaOfInterestItem *UEPresenceInAreaOfInterestItem) Diagnose(d if uEPresenceInAreaOfInterestItem.UEPresence.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEPresenceInAreaOfInterestItem, uEPresenceInAreaOfInterestItem, &uEPresenceInAreaOfInterestItem.iEExtensions) return notComprehended } @@ -39493,7 +40029,7 @@ func (uERLFReportContainer *UERLFReportContainer) MarshalPER(w *per.Writer, enc if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, uERLFReportContainer.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, uERLFReportContainer.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -39520,7 +40056,7 @@ func (uERLFReportContainer *UERLFReportContainer) UnmarshalPER(r *per.Reader, en } uERLFReportContainer.LTE = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -39534,18 +40070,18 @@ func (uERLFReportContainer *UERLFReportContainer) UnmarshalPER(r *per.Reader, en return nil } -func (uERLFReportContainer *UERLFReportContainer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uERLFReportContainer *UERLFReportContainer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uERLFReportContainer.NR != nil: case uERLFReportContainer.LTE != nil: case uERLFReportContainer.ChoiceExtension != nil: - d.Unknown(uERLFReportContainer.ChoiceExtension.ID, uERLFReportContainer.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, uERLFReportContainer.ChoiceExtension) } return false } func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, uERadioCapabilityForPaging.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, uERadioCapabilityForPaging.iEExtensions) w.WriteBit(uERadioCapabilityForPaging.extensions.Present()) w.WriteBit(uERadioCapabilityForPaging.NR != nil) w.WriteBit(uERadioCapabilityForPaging.EUTRA != nil) @@ -39561,7 +40097,7 @@ func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -39606,7 +40142,7 @@ func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) UnmarshalPER(r *pe uERadioCapabilityForPaging.EUTRA = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, &uERadioCapabilityForPaging.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, &uERadioCapabilityForPaging.iEExtensions); err != nil { return err } } @@ -39618,11 +40154,11 @@ func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) UnmarshalPER(r *pe return nil } -var extIEsUERadioCapabilityForPaging = []ap.IESpec[ProtocolIEID, UERadioCapabilityForPaging]{ +var extIEsUERadioCapabilityForPaging = []apimpl.IESpec[ProtocolIEID, UERadioCapabilityForPaging]{ { ID: IDUERadioCapabilityForPagingOfNBIoT, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UERadioCapabilityForPaging, r *per.Reader, enc per.Encoding) error { var v UERadioCapabilityForPagingOfNBIoT if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -39637,12 +40173,15 @@ var extIEsUERadioCapabilityForPaging = []ap.IESpec[ProtocolIEID, UERadioCapabili } return x.NBIoT, true }, + Clear: func(x *UERadioCapabilityForPaging) { + x.NBIoT = nil + }, }, } -func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uERadioCapabilityForPaging *UERadioCapabilityForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, uERadioCapabilityForPaging.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUERadioCapabilityForPaging, uERadioCapabilityForPaging, &uERadioCapabilityForPaging.iEExtensions) return notComprehended } @@ -39663,12 +40202,12 @@ func (uERetentionInformation UERetentionInformation) Name() string { return enumUERetentionInformation.Name(uERetentionInformation) } -func (uERetentionInformation UERetentionInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uERetentionInformation UERetentionInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUERetentionInformation.Known(uERetentionInformation) } func (uESecurityCapabilities *UESecurityCapabilities) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) w.WriteBit(uESecurityCapabilities.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uESecurityCapabilities.NREncryptionAlgorithms.MarshalPER(w, enc); err != nil { @@ -39684,7 +40223,7 @@ func (uESecurityCapabilities *UESecurityCapabilities) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -39719,7 +40258,7 @@ func (uESecurityCapabilities *UESecurityCapabilities) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions); err != nil { return err } } @@ -39731,16 +40270,16 @@ func (uESecurityCapabilities *UESecurityCapabilities) UnmarshalPER(r *per.Reader return nil } -var extIEsUESecurityCapabilities []ap.IESpec[ProtocolIEID, UESecurityCapabilities] +var extIEsUESecurityCapabilities []apimpl.IESpec[ProtocolIEID, UESecurityCapabilities] -func (uESecurityCapabilities *UESecurityCapabilities) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uESecurityCapabilities *UESecurityCapabilities) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions) return notComprehended } func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, uESliceMaximumBitRateItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, uESliceMaximumBitRateItem.iEExtensions) w.WriteBit(uESliceMaximumBitRateItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uESliceMaximumBitRateItem.SNSSAI.MarshalPER(w, enc); err != nil { @@ -39753,7 +40292,7 @@ func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -39785,7 +40324,7 @@ func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, &uESliceMaximumBitRateItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, &uESliceMaximumBitRateItem.iEExtensions); err != nil { return err } } @@ -39797,9 +40336,9 @@ func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) UnmarshalPER(r *per. return nil } -var extIEsUESliceMaximumBitRateItem []ap.IESpec[ProtocolIEID, UESliceMaximumBitRateItem] +var extIEsUESliceMaximumBitRateItem []apimpl.IESpec[ProtocolIEID, UESliceMaximumBitRateItem] -func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uESliceMaximumBitRateItem.SNSSAI.Diagnose(d) { notComprehended = true @@ -39810,7 +40349,7 @@ func (uESliceMaximumBitRateItem *UESliceMaximumBitRateItem) Diagnose(d *ap.Diagn if uESliceMaximumBitRateItem.UESliceMaximumBitRateUL.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, uESliceMaximumBitRateItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUESliceMaximumBitRateItem, uESliceMaximumBitRateItem, &uESliceMaximumBitRateItem.iEExtensions) return notComprehended } @@ -39831,7 +40370,7 @@ func (uEUPCIoTSupport UEUPCIoTSupport) Name() string { return enumUEUPCIoTSupport.Name(uEUPCIoTSupport) } -func (uEUPCIoTSupport UEUPCIoTSupport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uEUPCIoTSupport UEUPCIoTSupport) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUEUPCIoTSupport.Known(uEUPCIoTSupport) } @@ -39852,12 +40391,12 @@ func (uLForwarding ULForwarding) Name() string { return enumULForwarding.Name(uLForwarding) } -func (uLForwarding ULForwarding) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uLForwarding ULForwarding) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumULForwarding.Known(uLForwarding) } func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, uLNGUUPTNLModifyItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, uLNGUUPTNLModifyItem.iEExtensions) w.WriteBit(uLNGUUPTNLModifyItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uLNGUUPTNLModifyItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { @@ -39867,7 +40406,7 @@ func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) MarshalPER(w *per.Writer, enc return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -39896,7 +40435,7 @@ func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) UnmarshalPER(r *per.Reader, en return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions); err != nil { return err } } @@ -39908,11 +40447,11 @@ func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) UnmarshalPER(r *per.Reader, en return nil } -var extIEsULNGUUPTNLModifyItem = []ap.IESpec[ProtocolIEID, ULNGUUPTNLModifyItem]{ +var extIEsULNGUUPTNLModifyItem = []apimpl.IESpec[ProtocolIEID, ULNGUUPTNLModifyItem]{ { ID: IDRedundantULNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *ULNGUUPTNLModifyItem, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -39927,11 +40466,14 @@ var extIEsULNGUUPTNLModifyItem = []ap.IESpec[ProtocolIEID, ULNGUUPTNLModifyItem] } return x.RedundantULNGUUPTNLInformation, true }, + Clear: func(x *ULNGUUPTNLModifyItem) { + x.RedundantULNGUUPTNLInformation = nil + }, }, { ID: IDRedundantDLNGUUPTNLInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *ULNGUUPTNLModifyItem, r *per.Reader, enc per.Encoding) error { var v UPTransportLayerInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -39946,10 +40488,13 @@ var extIEsULNGUUPTNLModifyItem = []ap.IESpec[ProtocolIEID, ULNGUUPTNLModifyItem] } return x.RedundantDLNGUUPTNLInformation, true }, + Clear: func(x *ULNGUUPTNLModifyItem) { + x.RedundantDLNGUUPTNLInformation = nil + }, }, } -func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uLNGUUPTNLModifyItem.ULNGUUPTNLInformation.Diagnose(d) { notComprehended = true @@ -39957,7 +40502,7 @@ func (uLNGUUPTNLModifyItem *ULNGUUPTNLModifyItem) Diagnose(d *ap.Diagnosis[Proto if uLNGUUPTNLModifyItem.DLNGUUPTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, uLNGUUPTNLModifyItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsULNGUUPTNLModifyItem, uLNGUUPTNLModifyItem, &uLNGUUPTNLModifyItem.iEExtensions) return notComprehended } @@ -39983,7 +40528,7 @@ func (uPTransportLayerInformation *UPTransportLayerInformation) MarshalPER(w *pe if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, uPTransportLayerInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, uPTransportLayerInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -40004,7 +40549,7 @@ func (uPTransportLayerInformation *UPTransportLayerInformation) UnmarshalPER(r * } uPTransportLayerInformation.GTPTunnel = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -40018,25 +40563,25 @@ func (uPTransportLayerInformation *UPTransportLayerInformation) UnmarshalPER(r * return nil } -func (uPTransportLayerInformation *UPTransportLayerInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uPTransportLayerInformation *UPTransportLayerInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uPTransportLayerInformation.GTPTunnel != nil: return uPTransportLayerInformation.GTPTunnel.Diagnose(d) case uPTransportLayerInformation.ChoiceExtension != nil: - d.Unknown(uPTransportLayerInformation.ChoiceExtension.ID, uPTransportLayerInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, uPTransportLayerInformation.ChoiceExtension) } return false } func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, uPTransportLayerInformationItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, uPTransportLayerInformationItem.iEExtensions) w.WriteBit(uPTransportLayerInformationItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uPTransportLayerInformationItem.NGUUPTNLInformation.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40062,7 +40607,7 @@ func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) Unmarsha return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, &uPTransportLayerInformationItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, &uPTransportLayerInformationItem.iEExtensions); err != nil { return err } } @@ -40074,11 +40619,11 @@ func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) Unmarsha return nil } -var extIEsUPTransportLayerInformationItem = []ap.IESpec[ProtocolIEID, UPTransportLayerInformationItem]{ +var extIEsUPTransportLayerInformationItem = []apimpl.IESpec[ProtocolIEID, UPTransportLayerInformationItem]{ { ID: IDCommonNetworkInstance, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UPTransportLayerInformationItem, r *per.Reader, enc per.Encoding) error { var v CommonNetworkInstance if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40093,20 +40638,23 @@ var extIEsUPTransportLayerInformationItem = []ap.IESpec[ProtocolIEID, UPTranspor } return x.CommonNetworkInstance, true }, + Clear: func(x *UPTransportLayerInformationItem) { + x.CommonNetworkInstance = nil + }, }, } -func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uPTransportLayerInformationItem *UPTransportLayerInformationItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uPTransportLayerInformationItem.NGUUPTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, uPTransportLayerInformationItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUPTransportLayerInformationItem, uPTransportLayerInformationItem, &uPTransportLayerInformationItem.iEExtensions) return notComprehended } func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem.iEExtensions) w.WriteBit(uPTransportLayerInformationPairItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uPTransportLayerInformationPairItem.ULNGUUPTNLInformation.MarshalPER(w, enc); err != nil { @@ -40116,7 +40664,7 @@ func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40145,7 +40693,7 @@ func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, &uPTransportLayerInformationPairItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, &uPTransportLayerInformationPairItem.iEExtensions); err != nil { return err } } @@ -40157,9 +40705,9 @@ func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) return nil } -var extIEsUPTransportLayerInformationPairItem []ap.IESpec[ProtocolIEID, UPTransportLayerInformationPairItem] +var extIEsUPTransportLayerInformationPairItem []apimpl.IESpec[ProtocolIEID, UPTransportLayerInformationPairItem] -func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if uPTransportLayerInformationPairItem.ULNGUUPTNLInformation.Diagnose(d) { notComprehended = true @@ -40167,12 +40715,12 @@ func (uPTransportLayerInformationPairItem *UPTransportLayerInformationPairItem) if uPTransportLayerInformationPairItem.DLNGUUPTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUPTransportLayerInformationPairItem, uPTransportLayerInformationPairItem, &uPTransportLayerInformationPairItem.iEExtensions) return notComprehended } func (unavailableGUAMIItem *UnavailableGUAMIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUnavailableGUAMIItem, unavailableGUAMIItem, unavailableGUAMIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUnavailableGUAMIItem, unavailableGUAMIItem, unavailableGUAMIItem.iEExtensions) w.WriteBit(unavailableGUAMIItem.extensions.Present()) w.WriteBit(unavailableGUAMIItem.TimerApproachForGUAMIRemoval != nil) w.WriteBit(unavailableGUAMIItem.BackupAMFName != nil) @@ -40191,7 +40739,7 @@ func (unavailableGUAMIItem *UnavailableGUAMIItem) MarshalPER(w *per.Writer, enc } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40239,7 +40787,7 @@ func (unavailableGUAMIItem *UnavailableGUAMIItem) UnmarshalPER(r *per.Reader, en unavailableGUAMIItem.BackupAMFName = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUnavailableGUAMIItem, unavailableGUAMIItem, &unavailableGUAMIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUnavailableGUAMIItem, unavailableGUAMIItem, &unavailableGUAMIItem.iEExtensions); err != nil { return err } } @@ -40251,11 +40799,11 @@ func (unavailableGUAMIItem *UnavailableGUAMIItem) UnmarshalPER(r *per.Reader, en return nil } -var extIEsUnavailableGUAMIItem = []ap.IESpec[ProtocolIEID, UnavailableGUAMIItem]{ +var extIEsUnavailableGUAMIItem = []apimpl.IESpec[ProtocolIEID, UnavailableGUAMIItem]{ { ID: IDExtendedBackupAMFName, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UnavailableGUAMIItem, r *per.Reader, enc per.Encoding) error { var v ExtendedAMFName if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40270,10 +40818,13 @@ var extIEsUnavailableGUAMIItem = []ap.IESpec[ProtocolIEID, UnavailableGUAMIItem] } return x.ExtendedBackupAMFName, true }, + Clear: func(x *UnavailableGUAMIItem) { + x.ExtendedBackupAMFName = nil + }, }, } -func (unavailableGUAMIItem *UnavailableGUAMIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (unavailableGUAMIItem *UnavailableGUAMIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if unavailableGUAMIItem.GUAMI.Diagnose(d) { notComprehended = true @@ -40281,7 +40832,7 @@ func (unavailableGUAMIItem *UnavailableGUAMIItem) Diagnose(d *ap.Diagnosis[Proto if unavailableGUAMIItem.TimerApproachForGUAMIRemoval != nil && unavailableGUAMIItem.TimerApproachForGUAMIRemoval.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUnavailableGUAMIItem, unavailableGUAMIItem, unavailableGUAMIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUnavailableGUAMIItem, unavailableGUAMIItem, &unavailableGUAMIItem.iEExtensions) return notComprehended } @@ -40321,27 +40872,27 @@ func (userLocationInformation *UserLocationInformation) MarshalPER(w *per.Writer if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationTNGF, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.TNGF}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationTNGF, Criticality: userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: userLocationInformation.TNGF}) case userLocationInformation.TWIF != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationTWIF, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.TWIF}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationTWIF, Criticality: userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: userLocationInformation.TWIF}) case userLocationInformation.WAGF != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationWAGF, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.WAGF}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationWAGF, Criticality: userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: userLocationInformation.WAGF}) case userLocationInformation.N3IWFWithoutPortNumber != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationN3IWFwithoutPortNumber, Criticality: userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformation.N3IWFWithoutPortNumber}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDUserLocationInformationN3IWFwithoutPortNumber, Criticality: userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: userLocationInformation.N3IWFWithoutPortNumber}) case userLocationInformation.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 3, 3); err != nil { return err } - return ap.EncodeField(profile, w, enc, userLocationInformation.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, userLocationInformation.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -40374,55 +40925,39 @@ func (userLocationInformation *UserLocationInformation) UnmarshalPER(r *per.Read } userLocationInformation.N3IWF = &v case 3: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDUserLocationInformationTNGF: var v UserLocationInformationTNGF - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - userLocationInformation.ChoiceExtension = &f - break - } userLocationInformation.TNGF = &v - userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + userLocationInformation.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDUserLocationInformationTWIF: var v UserLocationInformationTWIF - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - userLocationInformation.ChoiceExtension = &f - break - } userLocationInformation.TWIF = &v - userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + userLocationInformation.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDUserLocationInformationWAGF: var v UserLocationInformationWAGF - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - userLocationInformation.ChoiceExtension = &f - break - } userLocationInformation.WAGF = &v - userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + userLocationInformation.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDUserLocationInformationN3IWFwithoutPortNumber: var v UserLocationInformationN3IWFWithoutPortNumber - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - userLocationInformation.ChoiceExtension = &f - break - } userLocationInformation.N3IWFWithoutPortNumber = &v - userLocationInformation.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + userLocationInformation.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) default: userLocationInformation.ChoiceExtension = &f } @@ -40432,7 +40967,7 @@ func (userLocationInformation *UserLocationInformation) UnmarshalPER(r *per.Read return nil } -func (userLocationInformation *UserLocationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformation *UserLocationInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case userLocationInformation.EUTRA != nil: return userLocationInformation.EUTRA.Diagnose(d) @@ -40441,21 +40976,21 @@ func (userLocationInformation *UserLocationInformation) Diagnose(d *ap.Diagnosis case userLocationInformation.N3IWF != nil: return userLocationInformation.N3IWF.Diagnose(d) case userLocationInformation.TNGF != nil: - d.IE(IDUserLocationInformationTNGF, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.TNGF) + return apimpl.DiagnoseChoiceExtension(d, IDUserLocationInformationTNGF, userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), &userLocationInformation.TNGF, &userLocationInformation.ChoiceExtension) case userLocationInformation.TWIF != nil: - d.IE(IDUserLocationInformationTWIF, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.TWIF) + return apimpl.DiagnoseChoiceExtension(d, IDUserLocationInformationTWIF, userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), &userLocationInformation.TWIF, &userLocationInformation.ChoiceExtension) case userLocationInformation.WAGF != nil: - d.IE(IDUserLocationInformationWAGF, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.WAGF) + return apimpl.DiagnoseChoiceExtension(d, IDUserLocationInformationWAGF, userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), &userLocationInformation.WAGF, &userLocationInformation.ChoiceExtension) case userLocationInformation.N3IWFWithoutPortNumber != nil: - d.IE(IDUserLocationInformationN3IWFwithoutPortNumber, userLocationInformation.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformation.N3IWFWithoutPortNumber) + return apimpl.DiagnoseChoiceExtension(d, IDUserLocationInformationN3IWFwithoutPortNumber, userLocationInformation.choiceCriticality.Of(apimpl.CriticalityIgnore), &userLocationInformation.N3IWFWithoutPortNumber, &userLocationInformation.ChoiceExtension) case userLocationInformation.ChoiceExtension != nil: - d.Unknown(userLocationInformation.ChoiceExtension.ID, userLocationInformation.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, userLocationInformation.ChoiceExtension) } return false } func (userLocationInformationEUTRA *UserLocationInformationEUTRA) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, userLocationInformationEUTRA.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, userLocationInformationEUTRA.iEExtensions) w.WriteBit(userLocationInformationEUTRA.extensions.Present()) w.WriteBit(userLocationInformationEUTRA.TimeStamp != nil) w.WriteBit(len(ext) > 0) @@ -40471,7 +41006,7 @@ func (userLocationInformationEUTRA *UserLocationInformationEUTRA) MarshalPER(w * } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40511,7 +41046,7 @@ func (userLocationInformationEUTRA *UserLocationInformationEUTRA) UnmarshalPER(r userLocationInformationEUTRA.TimeStamp = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, &userLocationInformationEUTRA.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, &userLocationInformationEUTRA.iEExtensions); err != nil { return err } } @@ -40523,11 +41058,11 @@ func (userLocationInformationEUTRA *UserLocationInformationEUTRA) UnmarshalPER(r return nil } -var extIEsUserLocationInformationEUTRA = []ap.IESpec[ProtocolIEID, UserLocationInformationEUTRA]{ +var extIEsUserLocationInformationEUTRA = []apimpl.IESpec[ProtocolIEID, UserLocationInformationEUTRA]{ { ID: IDPSCellInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationEUTRA, r *per.Reader, enc per.Encoding) error { var v NGRANCGI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40542,10 +41077,13 @@ var extIEsUserLocationInformationEUTRA = []ap.IESpec[ProtocolIEID, UserLocationI } return x.PSCellInformation, true }, + Clear: func(x *UserLocationInformationEUTRA) { + x.PSCellInformation = nil + }, }, } -func (userLocationInformationEUTRA *UserLocationInformationEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformationEUTRA *UserLocationInformationEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if userLocationInformationEUTRA.EUTRACGI.Diagnose(d) { notComprehended = true @@ -40553,12 +41091,12 @@ func (userLocationInformationEUTRA *UserLocationInformationEUTRA) Diagnose(d *ap if userLocationInformationEUTRA.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, userLocationInformationEUTRA.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserLocationInformationEUTRA, userLocationInformationEUTRA, &userLocationInformationEUTRA.iEExtensions) return notComprehended } func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWithPortNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber.iEExtensions) w.WriteBit(userLocationInformationN3IWFWithPortNumber.extensions.Present()) w.WriteBit(len(ext) > 0) if err := userLocationInformationN3IWFWithPortNumber.IPAddress.MarshalPER(w, enc); err != nil { @@ -40568,7 +41106,7 @@ func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40597,7 +41135,7 @@ func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, &userLocationInformationN3IWFWithPortNumber.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, &userLocationInformationN3IWFWithPortNumber.iEExtensions); err != nil { return err } } @@ -40609,11 +41147,11 @@ func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWi return nil } -var extIEsUserLocationInformationN3IWFWithPortNumber = []ap.IESpec[ProtocolIEID, UserLocationInformationN3IWFWithPortNumber]{ +var extIEsUserLocationInformationN3IWFWithPortNumber = []apimpl.IESpec[ProtocolIEID, UserLocationInformationN3IWFWithPortNumber]{ { ID: IDTAI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationN3IWFWithPortNumber, r *per.Reader, enc per.Encoding) error { var v TAI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40628,17 +41166,20 @@ var extIEsUserLocationInformationN3IWFWithPortNumber = []ap.IESpec[ProtocolIEID, } return x.TAI, true }, + Clear: func(x *UserLocationInformationN3IWFWithPortNumber) { + x.TAI = nil + }, }, } -func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWithPortNumber) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformationN3IWFWithPortNumber *UserLocationInformationN3IWFWithPortNumber) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserLocationInformationN3IWFWithPortNumber, userLocationInformationN3IWFWithPortNumber, &userLocationInformationN3IWFWithPortNumber.iEExtensions) return notComprehended } func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber.iEExtensions) w.WriteBit(userLocationInformationN3IWFWithoutPortNumber.extensions.Present()) w.WriteBit(userLocationInformationN3IWFWithoutPortNumber.TAI != nil) w.WriteBit(len(ext) > 0) @@ -40651,7 +41192,7 @@ func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IW } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40688,7 +41229,7 @@ func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IW userLocationInformationN3IWFWithoutPortNumber.TAI = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, &userLocationInformationN3IWFWithoutPortNumber.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, &userLocationInformationN3IWFWithoutPortNumber.iEExtensions); err != nil { return err } } @@ -40700,19 +41241,19 @@ func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IW return nil } -var extIEsUserLocationInformationN3IWFWithoutPortNumber []ap.IESpec[ProtocolIEID, UserLocationInformationN3IWFWithoutPortNumber] +var extIEsUserLocationInformationN3IWFWithoutPortNumber []apimpl.IESpec[ProtocolIEID, UserLocationInformationN3IWFWithoutPortNumber] -func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformationN3IWFWithoutPortNumber *UserLocationInformationN3IWFWithoutPortNumber) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if userLocationInformationN3IWFWithoutPortNumber.TAI != nil && userLocationInformationN3IWFWithoutPortNumber.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserLocationInformationN3IWFWithoutPortNumber, userLocationInformationN3IWFWithoutPortNumber, &userLocationInformationN3IWFWithoutPortNumber.iEExtensions) return notComprehended } func (userLocationInformationNR *UserLocationInformationNR) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserLocationInformationNR, userLocationInformationNR, userLocationInformationNR.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserLocationInformationNR, userLocationInformationNR, userLocationInformationNR.iEExtensions) w.WriteBit(userLocationInformationNR.extensions.Present()) w.WriteBit(userLocationInformationNR.TimeStamp != nil) w.WriteBit(len(ext) > 0) @@ -40728,7 +41269,7 @@ func (userLocationInformationNR *UserLocationInformationNR) MarshalPER(w *per.Wr } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40768,7 +41309,7 @@ func (userLocationInformationNR *UserLocationInformationNR) UnmarshalPER(r *per. userLocationInformationNR.TimeStamp = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationNR, userLocationInformationNR, &userLocationInformationNR.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationNR, userLocationInformationNR, &userLocationInformationNR.iEExtensions); err != nil { return err } } @@ -40780,11 +41321,11 @@ func (userLocationInformationNR *UserLocationInformationNR) UnmarshalPER(r *per. return nil } -var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInformationNR]{ +var extIEsUserLocationInformationNR = []apimpl.IESpec[ProtocolIEID, UserLocationInformationNR]{ { ID: IDPSCellInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { var v NGRANCGI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40799,11 +41340,14 @@ var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInfo } return x.PSCellInformation, true }, + Clear: func(x *UserLocationInformationNR) { + x.PSCellInformation = nil + }, }, { ID: IDNID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { var v NID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40818,11 +41362,14 @@ var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInfo } return x.NID, true }, + Clear: func(x *UserLocationInformationNR) { + x.NID = nil + }, }, { ID: IDNRNTNTAIInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { var v NRNTNTAIInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40837,11 +41384,14 @@ var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInfo } return x.NRNTNTAIInformation, true }, + Clear: func(x *UserLocationInformationNR) { + x.NRNTNTAIInformation = nil + }, }, { ID: IDMobileIABMTUserLocationInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { var v MobileIABMTUserLocationInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40856,11 +41406,14 @@ var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInfo } return x.MobileIABMTUserLocationInformation, true }, + Clear: func(x *UserLocationInformationNR) { + x.MobileIABMTUserLocationInformation = nil + }, }, { ID: IDAdditionalULI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { var v AdditionalULI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40875,11 +41428,14 @@ var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInfo } return x.AdditionalULI, true }, + Clear: func(x *UserLocationInformationNR) { + x.AdditionalULI = nil + }, }, { ID: IDAerialUEFlightInformationReporting, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationNR, r *per.Reader, enc per.Encoding) error { var v AerialUEFlightInformationReporting if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40894,10 +41450,13 @@ var extIEsUserLocationInformationNR = []ap.IESpec[ProtocolIEID, UserLocationInfo } return x.AerialUEFlightInformationReporting, true }, + Clear: func(x *UserLocationInformationNR) { + x.AerialUEFlightInformationReporting = nil + }, }, } -func (userLocationInformationNR *UserLocationInformationNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformationNR *UserLocationInformationNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if userLocationInformationNR.NRCGI.Diagnose(d) { notComprehended = true @@ -40905,12 +41464,12 @@ func (userLocationInformationNR *UserLocationInformationNR) Diagnose(d *ap.Diagn if userLocationInformationNR.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUserLocationInformationNR, userLocationInformationNR, userLocationInformationNR.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserLocationInformationNR, userLocationInformationNR, &userLocationInformationNR.iEExtensions) return notComprehended } func (userLocationInformationTNGF *UserLocationInformationTNGF) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserLocationInformationTNGF, userLocationInformationTNGF, userLocationInformationTNGF.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserLocationInformationTNGF, userLocationInformationTNGF, userLocationInformationTNGF.iEExtensions) w.WriteBit(userLocationInformationTNGF.extensions.Present()) w.WriteBit(userLocationInformationTNGF.PortNumber != nil) w.WriteBit(len(ext) > 0) @@ -40926,7 +41485,7 @@ func (userLocationInformationTNGF *UserLocationInformationTNGF) MarshalPER(w *pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -40966,7 +41525,7 @@ func (userLocationInformationTNGF *UserLocationInformationTNGF) UnmarshalPER(r * userLocationInformationTNGF.PortNumber = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationTNGF, userLocationInformationTNGF, &userLocationInformationTNGF.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationTNGF, userLocationInformationTNGF, &userLocationInformationTNGF.iEExtensions); err != nil { return err } } @@ -40978,11 +41537,11 @@ func (userLocationInformationTNGF *UserLocationInformationTNGF) UnmarshalPER(r * return nil } -var extIEsUserLocationInformationTNGF = []ap.IESpec[ProtocolIEID, UserLocationInformationTNGF]{ +var extIEsUserLocationInformationTNGF = []apimpl.IESpec[ProtocolIEID, UserLocationInformationTNGF]{ { ID: IDTAI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationTNGF, r *per.Reader, enc per.Encoding) error { var v TAI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -40997,17 +41556,20 @@ var extIEsUserLocationInformationTNGF = []ap.IESpec[ProtocolIEID, UserLocationIn } return x.TAI, true }, + Clear: func(x *UserLocationInformationTNGF) { + x.TAI = nil + }, }, } -func (userLocationInformationTNGF *UserLocationInformationTNGF) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformationTNGF *UserLocationInformationTNGF) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUserLocationInformationTNGF, userLocationInformationTNGF, userLocationInformationTNGF.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserLocationInformationTNGF, userLocationInformationTNGF, &userLocationInformationTNGF.iEExtensions) return notComprehended } func (userLocationInformationTWIF *UserLocationInformationTWIF) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserLocationInformationTWIF, userLocationInformationTWIF, userLocationInformationTWIF.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserLocationInformationTWIF, userLocationInformationTWIF, userLocationInformationTWIF.iEExtensions) w.WriteBit(userLocationInformationTWIF.extensions.Present()) w.WriteBit(userLocationInformationTWIF.PortNumber != nil) w.WriteBit(len(ext) > 0) @@ -41023,7 +41585,7 @@ func (userLocationInformationTWIF *UserLocationInformationTWIF) MarshalPER(w *pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -41063,7 +41625,7 @@ func (userLocationInformationTWIF *UserLocationInformationTWIF) UnmarshalPER(r * userLocationInformationTWIF.PortNumber = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationTWIF, userLocationInformationTWIF, &userLocationInformationTWIF.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformationTWIF, userLocationInformationTWIF, &userLocationInformationTWIF.iEExtensions); err != nil { return err } } @@ -41075,11 +41637,11 @@ func (userLocationInformationTWIF *UserLocationInformationTWIF) UnmarshalPER(r * return nil } -var extIEsUserLocationInformationTWIF = []ap.IESpec[ProtocolIEID, UserLocationInformationTWIF]{ +var extIEsUserLocationInformationTWIF = []apimpl.IESpec[ProtocolIEID, UserLocationInformationTWIF]{ { ID: IDTAI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformationTWIF, r *per.Reader, enc per.Encoding) error { var v TAI if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -41094,12 +41656,15 @@ var extIEsUserLocationInformationTWIF = []ap.IESpec[ProtocolIEID, UserLocationIn } return x.TAI, true }, + Clear: func(x *UserLocationInformationTWIF) { + x.TAI = nil + }, }, } -func (userLocationInformationTWIF *UserLocationInformationTWIF) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformationTWIF *UserLocationInformationTWIF) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUserLocationInformationTWIF, userLocationInformationTWIF, userLocationInformationTWIF.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserLocationInformationTWIF, userLocationInformationTWIF, &userLocationInformationTWIF.iEExtensions) return notComprehended } @@ -41132,22 +41697,22 @@ func (userLocationInformationWAGF *UserLocationInformationWAGF) MarshalPER(w *pe if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalCableID, Criticality: userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformationWAGF.GlobalCableID}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDGlobalCableID, Criticality: userLocationInformationWAGF.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: userLocationInformationWAGF.GlobalCableID}) case userLocationInformationWAGF.HFCNodeIDNew != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDHFCNodeIDnew, Criticality: userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformationWAGF.HFCNodeIDNew}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDHFCNodeIDnew, Criticality: userLocationInformationWAGF.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: userLocationInformationWAGF.HFCNodeIDNew}) case userLocationInformationWAGF.GlobalCableIDNew != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDGlobalCableIDnew, Criticality: userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), Value: userLocationInformationWAGF.GlobalCableIDNew}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDGlobalCableIDnew, Criticality: userLocationInformationWAGF.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: userLocationInformationWAGF.GlobalCableIDNew}) case userLocationInformationWAGF.ChoiceExtension != nil: if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { return err } - return ap.EncodeField(profile, w, enc, userLocationInformationWAGF.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, userLocationInformationWAGF.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -41174,44 +41739,32 @@ func (userLocationInformationWAGF *UserLocationInformationWAGF) UnmarshalPER(r * } userLocationInformationWAGF.HFCNodeID = &v case 2: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDGlobalCableID: var v GlobalCableID - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - userLocationInformationWAGF.ChoiceExtension = &f - break - } userLocationInformationWAGF.GlobalCableID = &v - userLocationInformationWAGF.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + userLocationInformationWAGF.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDHFCNodeIDnew: var v HFCNodeIDNew - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - userLocationInformationWAGF.ChoiceExtension = &f - break - } userLocationInformationWAGF.HFCNodeIDNew = &v - userLocationInformationWAGF.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + userLocationInformationWAGF.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) case IDGlobalCableIDnew: var v GlobalCableIDNew - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - userLocationInformationWAGF.ChoiceExtension = &f - break - } userLocationInformationWAGF.GlobalCableIDNew = &v - userLocationInformationWAGF.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + userLocationInformationWAGF.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) default: userLocationInformationWAGF.ChoiceExtension = &f } @@ -41221,25 +41774,25 @@ func (userLocationInformationWAGF *UserLocationInformationWAGF) UnmarshalPER(r * return nil } -func (userLocationInformationWAGF *UserLocationInformationWAGF) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformationWAGF *UserLocationInformationWAGF) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case userLocationInformationWAGF.GlobalLineID != nil: return userLocationInformationWAGF.GlobalLineID.Diagnose(d) case userLocationInformationWAGF.HFCNodeID != nil: case userLocationInformationWAGF.GlobalCableID != nil: - d.IE(IDGlobalCableID, userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformationWAGF.GlobalCableID) + return apimpl.DiagnoseChoiceExtension(d, IDGlobalCableID, userLocationInformationWAGF.choiceCriticality.Of(apimpl.CriticalityIgnore), &userLocationInformationWAGF.GlobalCableID, &userLocationInformationWAGF.ChoiceExtension) case userLocationInformationWAGF.HFCNodeIDNew != nil: - d.IE(IDHFCNodeIDnew, userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformationWAGF.HFCNodeIDNew) + return apimpl.DiagnoseChoiceExtension(d, IDHFCNodeIDnew, userLocationInformationWAGF.choiceCriticality.Of(apimpl.CriticalityIgnore), &userLocationInformationWAGF.HFCNodeIDNew, &userLocationInformationWAGF.ChoiceExtension) case userLocationInformationWAGF.GlobalCableIDNew != nil: - d.IE(IDGlobalCableIDnew, userLocationInformationWAGF.choiceCriticality.Of(ap.CriticalityIgnore), userLocationInformationWAGF.GlobalCableIDNew) + return apimpl.DiagnoseChoiceExtension(d, IDGlobalCableIDnew, userLocationInformationWAGF.choiceCriticality.Of(apimpl.CriticalityIgnore), &userLocationInformationWAGF.GlobalCableIDNew, &userLocationInformationWAGF.ChoiceExtension) case userLocationInformationWAGF.ChoiceExtension != nil: - d.Unknown(userLocationInformationWAGF.ChoiceExtension.ID, userLocationInformationWAGF.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, userLocationInformationWAGF.ChoiceExtension) } return false } func (userPlaneFailureIndication *UserPlaneFailureIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserPlaneFailureIndication, userPlaneFailureIndication, userPlaneFailureIndication.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserPlaneFailureIndication, userPlaneFailureIndication, userPlaneFailureIndication.iEExtensions) w.WriteBit(userPlaneFailureIndication.extensions.Present()) w.WriteBit(len(ext) > 0) if err := userPlaneFailureIndication.UserPlaneFailureType.MarshalPER(w, enc); err != nil { @@ -41252,7 +41805,7 @@ func (userPlaneFailureIndication *UserPlaneFailureIndication) MarshalPER(w *per. return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -41284,7 +41837,7 @@ func (userPlaneFailureIndication *UserPlaneFailureIndication) UnmarshalPER(r *pe return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserPlaneFailureIndication, userPlaneFailureIndication, &userPlaneFailureIndication.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserPlaneFailureIndication, userPlaneFailureIndication, &userPlaneFailureIndication.iEExtensions); err != nil { return err } } @@ -41296,9 +41849,9 @@ func (userPlaneFailureIndication *UserPlaneFailureIndication) UnmarshalPER(r *pe return nil } -var extIEsUserPlaneFailureIndication []ap.IESpec[ProtocolIEID, UserPlaneFailureIndication] +var extIEsUserPlaneFailureIndication []apimpl.IESpec[ProtocolIEID, UserPlaneFailureIndication] -func (userPlaneFailureIndication *UserPlaneFailureIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userPlaneFailureIndication *UserPlaneFailureIndication) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if userPlaneFailureIndication.UserPlaneFailureType.Diagnose(d) { notComprehended = true @@ -41309,7 +41862,7 @@ func (userPlaneFailureIndication *UserPlaneFailureIndication) Diagnose(d *ap.Dia if userPlaneFailureIndication.DLNGUUPTNLInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUserPlaneFailureIndication, userPlaneFailureIndication, userPlaneFailureIndication.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserPlaneFailureIndication, userPlaneFailureIndication, &userPlaneFailureIndication.iEExtensions) return notComprehended } @@ -41330,7 +41883,7 @@ func (userPlaneFailureIndicationReport UserPlaneFailureIndicationReport) Name() return enumUserPlaneFailureIndicationReport.Name(userPlaneFailureIndicationReport) } -func (userPlaneFailureIndicationReport UserPlaneFailureIndicationReport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (userPlaneFailureIndicationReport UserPlaneFailureIndicationReport) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUserPlaneFailureIndicationReport.Known(userPlaneFailureIndicationReport) } @@ -41351,12 +41904,12 @@ func (userPlaneFailureType UserPlaneFailureType) Name() string { return enumUserPlaneFailureType.Name(userPlaneFailureType) } -func (userPlaneFailureType UserPlaneFailureType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (userPlaneFailureType UserPlaneFailureType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUserPlaneFailureType.Known(userPlaneFailureType) } func (userPlaneSecurityInformation *UserPlaneSecurityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, userPlaneSecurityInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, userPlaneSecurityInformation.iEExtensions) w.WriteBit(userPlaneSecurityInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := userPlaneSecurityInformation.SecurityResult.MarshalPER(w, enc); err != nil { @@ -41366,7 +41919,7 @@ func (userPlaneSecurityInformation *UserPlaneSecurityInformation) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -41395,7 +41948,7 @@ func (userPlaneSecurityInformation *UserPlaneSecurityInformation) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, &userPlaneSecurityInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, &userPlaneSecurityInformation.iEExtensions); err != nil { return err } } @@ -41407,9 +41960,9 @@ func (userPlaneSecurityInformation *UserPlaneSecurityInformation) UnmarshalPER(r return nil } -var extIEsUserPlaneSecurityInformation []ap.IESpec[ProtocolIEID, UserPlaneSecurityInformation] +var extIEsUserPlaneSecurityInformation []apimpl.IESpec[ProtocolIEID, UserPlaneSecurityInformation] -func (userPlaneSecurityInformation *UserPlaneSecurityInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userPlaneSecurityInformation *UserPlaneSecurityInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if userPlaneSecurityInformation.SecurityResult.Diagnose(d) { notComprehended = true @@ -41417,7 +41970,7 @@ func (userPlaneSecurityInformation *UserPlaneSecurityInformation) Diagnose(d *ap if userPlaneSecurityInformation.SecurityIndication.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, userPlaneSecurityInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserPlaneSecurityInformation, userPlaneSecurityInformation, &userPlaneSecurityInformation.iEExtensions) return notComprehended } @@ -41438,12 +41991,12 @@ func (vehicleUE VehicleUE) Name() string { return enumVehicleUE.Name(vehicleUE) } -func (vehicleUE VehicleUE) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (vehicleUE VehicleUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumVehicleUE.Known(vehicleUE) } func (volumeTimedReportItem *VolumeTimedReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsVolumeTimedReportItem, volumeTimedReportItem, volumeTimedReportItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsVolumeTimedReportItem, volumeTimedReportItem, volumeTimedReportItem.iEExtensions) w.WriteBit(volumeTimedReportItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := volumeTimedReportItem.StartTimeStamp.MarshalPER(w, enc); err != nil { @@ -41459,7 +42012,7 @@ func (volumeTimedReportItem *VolumeTimedReportItem) MarshalPER(w *per.Writer, en return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -41494,7 +42047,7 @@ func (volumeTimedReportItem *VolumeTimedReportItem) UnmarshalPER(r *per.Reader, return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsVolumeTimedReportItem, volumeTimedReportItem, &volumeTimedReportItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsVolumeTimedReportItem, volumeTimedReportItem, &volumeTimedReportItem.iEExtensions); err != nil { return err } } @@ -41506,11 +42059,11 @@ func (volumeTimedReportItem *VolumeTimedReportItem) UnmarshalPER(r *per.Reader, return nil } -var extIEsVolumeTimedReportItem []ap.IESpec[ProtocolIEID, VolumeTimedReportItem] +var extIEsVolumeTimedReportItem []apimpl.IESpec[ProtocolIEID, VolumeTimedReportItem] -func (volumeTimedReportItem *VolumeTimedReportItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (volumeTimedReportItem *VolumeTimedReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsVolumeTimedReportItem, volumeTimedReportItem, volumeTimedReportItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsVolumeTimedReportItem, volumeTimedReportItem, &volumeTimedReportItem.iEExtensions) return notComprehended } @@ -41536,7 +42089,7 @@ func (wAGFID *WAGFID) MarshalPER(w *per.Writer, enc per.Encoding) error { if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, wAGFID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, wAGFID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -41557,7 +42110,7 @@ func (wAGFID *WAGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { } wAGFID.WAGFID = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -41571,11 +42124,11 @@ func (wAGFID *WAGFID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (wAGFID *WAGFID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (wAGFID *WAGFID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case wAGFID.WAGFID != nil: case wAGFID.ChoiceExtension != nil: - d.Unknown(wAGFID.ChoiceExtension.ID, wAGFID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, wAGFID.ChoiceExtension) } return false } @@ -41597,19 +42150,19 @@ func (wLANMeasConfig WLANMeasConfig) Name() string { return enumWLANMeasConfig.Name(wLANMeasConfig) } -func (wLANMeasConfig WLANMeasConfig) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (wLANMeasConfig WLANMeasConfig) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumWLANMeasConfig.Known(wLANMeasConfig) } func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, wLANMeasConfigNameItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, wLANMeasConfigNameItem.iEExtensions) w.WriteBit(wLANMeasConfigNameItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := wLANMeasConfigNameItem.WLANName.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -41635,7 +42188,7 @@ func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, &wLANMeasConfigNameItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, &wLANMeasConfigNameItem.iEExtensions); err != nil { return err } } @@ -41647,16 +42200,16 @@ func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) UnmarshalPER(r *per.Reader return nil } -var extIEsWLANMeasConfigNameItem []ap.IESpec[ProtocolIEID, WLANMeasConfigNameItem] +var extIEsWLANMeasConfigNameItem []apimpl.IESpec[ProtocolIEID, WLANMeasConfigNameItem] -func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (wLANMeasConfigNameItem *WLANMeasConfigNameItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, wLANMeasConfigNameItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsWLANMeasConfigNameItem, wLANMeasConfigNameItem, &wLANMeasConfigNameItem.iEExtensions) return notComprehended } func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, wLANMeasurementConfiguration.iEExtensions) + ext := apimpl.ExtensionFields(extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, wLANMeasurementConfiguration.iEExtensions) w.WriteBit(wLANMeasurementConfiguration.extensions.Present()) w.WriteBit(wLANMeasurementConfiguration.WlanMeasConfigNameList != nil) w.WriteBit(wLANMeasurementConfiguration.Wlanrssi != nil) @@ -41681,7 +42234,7 @@ func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) MarshalPER(w * } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -41738,7 +42291,7 @@ func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) UnmarshalPER(r wLANMeasurementConfiguration.Wlanrtt = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, &wLANMeasurementConfiguration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, &wLANMeasurementConfiguration.iEExtensions); err != nil { return err } } @@ -41750,9 +42303,9 @@ func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) UnmarshalPER(r return nil } -var extIEsWLANMeasurementConfiguration []ap.IESpec[ProtocolIEID, WLANMeasurementConfiguration] +var extIEsWLANMeasurementConfiguration []apimpl.IESpec[ProtocolIEID, WLANMeasurementConfiguration] -func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if wLANMeasurementConfiguration.WlanMeasConfig.Diagnose(d) { notComprehended = true @@ -41766,7 +42319,7 @@ func (wLANMeasurementConfiguration *WLANMeasurementConfiguration) Diagnose(d *ap if wLANMeasurementConfiguration.Wlanrtt != nil && wLANMeasurementConfiguration.Wlanrtt.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, wLANMeasurementConfiguration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsWLANMeasurementConfiguration, wLANMeasurementConfiguration, &wLANMeasurementConfiguration.iEExtensions) return notComprehended } @@ -41787,7 +42340,7 @@ func (wLANMeasurementConfigurationWlanrssi WLANMeasurementConfigurationWlanrssi) return enumWLANMeasurementConfigurationWlanrssi.Name(wLANMeasurementConfigurationWlanrssi) } -func (wLANMeasurementConfigurationWlanrssi WLANMeasurementConfigurationWlanrssi) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (wLANMeasurementConfigurationWlanrssi WLANMeasurementConfigurationWlanrssi) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumWLANMeasurementConfigurationWlanrssi.Known(wLANMeasurementConfigurationWlanrssi) } @@ -41808,19 +42361,19 @@ func (wLANMeasurementConfigurationWlanrtt WLANMeasurementConfigurationWlanrtt) N return enumWLANMeasurementConfigurationWlanrtt.Name(wLANMeasurementConfigurationWlanrtt) } -func (wLANMeasurementConfigurationWlanrtt WLANMeasurementConfigurationWlanrtt) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (wLANMeasurementConfigurationWlanrtt WLANMeasurementConfigurationWlanrtt) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumWLANMeasurementConfigurationWlanrtt.Known(wLANMeasurementConfigurationWlanrtt) } func (wUSAssistanceInformation *WUSAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsWUSAssistanceInformation, wUSAssistanceInformation, wUSAssistanceInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsWUSAssistanceInformation, wUSAssistanceInformation, wUSAssistanceInformation.iEExtensions) w.WriteBit(wUSAssistanceInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := wUSAssistanceInformation.PagingProbabilityInformation.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -41846,7 +42399,7 @@ func (wUSAssistanceInformation *WUSAssistanceInformation) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsWUSAssistanceInformation, wUSAssistanceInformation, &wUSAssistanceInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsWUSAssistanceInformation, wUSAssistanceInformation, &wUSAssistanceInformation.iEExtensions); err != nil { return err } } @@ -41858,14 +42411,14 @@ func (wUSAssistanceInformation *WUSAssistanceInformation) UnmarshalPER(r *per.Re return nil } -var extIEsWUSAssistanceInformation []ap.IESpec[ProtocolIEID, WUSAssistanceInformation] +var extIEsWUSAssistanceInformation []apimpl.IESpec[ProtocolIEID, WUSAssistanceInformation] -func (wUSAssistanceInformation *WUSAssistanceInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (wUSAssistanceInformation *WUSAssistanceInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if wUSAssistanceInformation.PagingProbabilityInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsWUSAssistanceInformation, wUSAssistanceInformation, wUSAssistanceInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsWUSAssistanceInformation, wUSAssistanceInformation, &wUSAssistanceInformation.iEExtensions) return notComprehended } @@ -41912,7 +42465,7 @@ func (warningAreaList *WarningAreaList) MarshalPER(w *per.Writer, enc per.Encodi if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 4, 4); err != nil { return err } - return ap.EncodeField(profile, w, enc, warningAreaList.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, warningAreaList.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -41951,7 +42504,7 @@ func (warningAreaList *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Enco } warningAreaList.EmergencyAreaIDList = &v case 4: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -41965,7 +42518,7 @@ func (warningAreaList *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (warningAreaList *WarningAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (warningAreaList *WarningAreaList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case warningAreaList.EUTRACGIListForWarning != nil: return warningAreaList.EUTRACGIListForWarning.Diagnose(d) @@ -41975,7 +42528,7 @@ func (warningAreaList *WarningAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) return warningAreaList.TAIListForWarning.Diagnose(d) case warningAreaList.EmergencyAreaIDList != nil: case warningAreaList.ChoiceExtension != nil: - d.Unknown(warningAreaList.ChoiceExtension.ID, warningAreaList.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, warningAreaList.ChoiceExtension) } return false } @@ -41997,11 +42550,11 @@ func (xrDeviceWith2Rx XrDeviceWith2Rx) Name() string { return enumXrDeviceWith2Rx.Name(xrDeviceWith2Rx) } -func (xrDeviceWith2Rx XrDeviceWith2Rx) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (xrDeviceWith2Rx XrDeviceWith2Rx) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumXrDeviceWith2Rx.Known(xrDeviceWith2Rx) } -func (a2XPC5QoSFlowList A2XPC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (a2XPC5QoSFlowList A2XPC5QoSFlowList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range a2XPC5QoSFlowList { if a2XPC5QoSFlowList[i].Diagnose(d) { @@ -42011,7 +42564,7 @@ func (a2XPC5QoSFlowList A2XPC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (aMFTNLAssociationSetupList AMFTNLAssociationSetupList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationSetupList AMFTNLAssociationSetupList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range aMFTNLAssociationSetupList { if aMFTNLAssociationSetupList[i].Diagnose(d) { @@ -42021,7 +42574,7 @@ func (aMFTNLAssociationSetupList AMFTNLAssociationSetupList) Diagnose(d *ap.Diag return notComprehended } -func (aMFTNLAssociationToAddList AMFTNLAssociationToAddList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationToAddList AMFTNLAssociationToAddList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range aMFTNLAssociationToAddList { if aMFTNLAssociationToAddList[i].Diagnose(d) { @@ -42031,7 +42584,7 @@ func (aMFTNLAssociationToAddList AMFTNLAssociationToAddList) Diagnose(d *ap.Diag return notComprehended } -func (aMFTNLAssociationToRemoveList AMFTNLAssociationToRemoveList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationToRemoveList AMFTNLAssociationToRemoveList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range aMFTNLAssociationToRemoveList { if aMFTNLAssociationToRemoveList[i].Diagnose(d) { @@ -42041,7 +42594,7 @@ func (aMFTNLAssociationToRemoveList AMFTNLAssociationToRemoveList) Diagnose(d *a return notComprehended } -func (aMFTNLAssociationToUpdateList AMFTNLAssociationToUpdateList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aMFTNLAssociationToUpdateList AMFTNLAssociationToUpdateList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range aMFTNLAssociationToUpdateList { if aMFTNLAssociationToUpdateList[i].Diagnose(d) { @@ -42051,7 +42604,7 @@ func (aMFTNLAssociationToUpdateList AMFTNLAssociationToUpdateList) Diagnose(d *a return notComprehended } -func (activatedCellList ActivatedCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (activatedCellList ActivatedCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range activatedCellList { if activatedCellList[i].Diagnose(d) { @@ -42061,7 +42614,7 @@ func (activatedCellList ActivatedCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (additionalCancelledlocationReportingReferenceIDList AdditionalCancelledlocationReportingReferenceIDList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (additionalCancelledlocationReportingReferenceIDList AdditionalCancelledlocationReportingReferenceIDList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range additionalCancelledlocationReportingReferenceIDList { if additionalCancelledlocationReportingReferenceIDList[i].Diagnose(d) { @@ -42071,7 +42624,7 @@ func (additionalCancelledlocationReportingReferenceIDList AdditionalCancelledloc return notComprehended } -func (additionalDLUPTNLInformationForHOList AdditionalDLUPTNLInformationForHOList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (additionalDLUPTNLInformationForHOList AdditionalDLUPTNLInformationForHOList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range additionalDLUPTNLInformationForHOList { if additionalDLUPTNLInformationForHOList[i].Diagnose(d) { @@ -42081,7 +42634,7 @@ func (additionalDLUPTNLInformationForHOList AdditionalDLUPTNLInformationForHOLis return notComprehended } -func (aerialUEFlightInformationReportingControlList AerialUEFlightInformationReportingControlList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (aerialUEFlightInformationReportingControlList AerialUEFlightInformationReportingControlList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range aerialUEFlightInformationReportingControlList { if aerialUEFlightInformationReportingControlList[i].Diagnose(d) { @@ -42091,7 +42644,7 @@ func (aerialUEFlightInformationReportingControlList AerialUEFlightInformationRep return notComprehended } -func (allowedNSSAI AllowedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (allowedNSSAI AllowedNSSAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range allowedNSSAI { if allowedNSSAI[i].Diagnose(d) { @@ -42101,7 +42654,7 @@ func (allowedNSSAI AllowedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (allowedPNINPNList AllowedPNINPNList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (allowedPNINPNList AllowedPNINPNList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range allowedPNINPNList { if allowedPNINPNList[i].Diagnose(d) { @@ -42111,7 +42664,7 @@ func (allowedPNINPNList AllowedPNINPNList) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (allowedPeriodicityList AllowedPeriodicityList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (allowedPeriodicityList AllowedPeriodicityList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range allowedPeriodicityList { if allowedPeriodicityList[i].Diagnose(d) { @@ -42121,7 +42674,7 @@ func (allowedPeriodicityList AllowedPeriodicityList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (alternativeQoSParaSetList AlternativeQoSParaSetList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (alternativeQoSParaSetList AlternativeQoSParaSetList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range alternativeQoSParaSetList { if alternativeQoSParaSetList[i].Diagnose(d) { @@ -42131,7 +42684,7 @@ func (alternativeQoSParaSetList AlternativeQoSParaSetList) Diagnose(d *ap.Diagno return notComprehended } -func (areaOfInterestCellList AreaOfInterestCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestCellList AreaOfInterestCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range areaOfInterestCellList { if areaOfInterestCellList[i].Diagnose(d) { @@ -42141,7 +42694,7 @@ func (areaOfInterestCellList AreaOfInterestCellList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (areaOfInterestList AreaOfInterestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestList AreaOfInterestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range areaOfInterestList { if areaOfInterestList[i].Diagnose(d) { @@ -42151,7 +42704,7 @@ func (areaOfInterestList AreaOfInterestList) Diagnose(d *ap.Diagnosis[ProtocolIE return notComprehended } -func (areaOfInterestRANNodeList AreaOfInterestRANNodeList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestRANNodeList AreaOfInterestRANNodeList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range areaOfInterestRANNodeList { if areaOfInterestRANNodeList[i].Diagnose(d) { @@ -42161,7 +42714,7 @@ func (areaOfInterestRANNodeList AreaOfInterestRANNodeList) Diagnose(d *ap.Diagno return notComprehended } -func (areaOfInterestTAIList AreaOfInterestTAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaOfInterestTAIList AreaOfInterestTAIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range areaOfInterestTAIList { if areaOfInterestTAIList[i].Diagnose(d) { @@ -42171,7 +42724,7 @@ func (areaOfInterestTAIList AreaOfInterestTAIList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (areaScopeOfNeighCellsList AreaScopeOfNeighCellsList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (areaScopeOfNeighCellsList AreaScopeOfNeighCellsList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range areaScopeOfNeighCellsList { if areaScopeOfNeighCellsList[i].Diagnose(d) { @@ -42181,7 +42734,7 @@ func (areaScopeOfNeighCellsList AreaScopeOfNeighCellsList) Diagnose(d *ap.Diagno return notComprehended } -func (associatedMBSQosFlowSetupRequestList AssociatedMBSQosFlowSetupRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (associatedMBSQosFlowSetupRequestList AssociatedMBSQosFlowSetupRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range associatedMBSQosFlowSetupRequestList { if associatedMBSQosFlowSetupRequestList[i].Diagnose(d) { @@ -42191,7 +42744,7 @@ func (associatedMBSQosFlowSetupRequestList AssociatedMBSQosFlowSetupRequestList) return notComprehended } -func (associatedMBSQosFlowSetuporModifyRequestList AssociatedMBSQosFlowSetuporModifyRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (associatedMBSQosFlowSetuporModifyRequestList AssociatedMBSQosFlowSetuporModifyRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range associatedMBSQosFlowSetuporModifyRequestList { if associatedMBSQosFlowSetuporModifyRequestList[i].Diagnose(d) { @@ -42201,7 +42754,7 @@ func (associatedMBSQosFlowSetuporModifyRequestList AssociatedMBSQosFlowSetuporMo return notComprehended } -func (associatedQosFlowList AssociatedQosFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (associatedQosFlowList AssociatedQosFlowList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range associatedQosFlowList { if associatedQosFlowList[i].Diagnose(d) { @@ -42211,7 +42764,7 @@ func (associatedQosFlowList AssociatedQosFlowList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (availableBitrateReportThresholdList AvailableBitrateReportThresholdList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (availableBitrateReportThresholdList AvailableBitrateReportThresholdList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range availableBitrateReportThresholdList { if availableBitrateReportThresholdList[i].Diagnose(d) { @@ -42221,7 +42774,7 @@ func (availableBitrateReportThresholdList AvailableBitrateReportThresholdList) D return notComprehended } -func (bluetoothMeasConfigNameList BluetoothMeasConfigNameList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (bluetoothMeasConfigNameList BluetoothMeasConfigNameList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range bluetoothMeasConfigNameList { if bluetoothMeasConfigNameList[i].Diagnose(d) { @@ -42231,7 +42784,7 @@ func (bluetoothMeasConfigNameList BluetoothMeasConfigNameList) Diagnose(d *ap.Di return notComprehended } -func (broadcastPLMNList BroadcastPLMNList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (broadcastPLMNList BroadcastPLMNList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range broadcastPLMNList { if broadcastPLMNList[i].Diagnose(d) { @@ -42241,7 +42794,7 @@ func (broadcastPLMNList BroadcastPLMNList) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (cAGListforMDT CAGListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cAGListforMDT CAGListforMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cAGListforMDT { if cAGListforMDT[i].Diagnose(d) { @@ -42251,7 +42804,7 @@ func (cAGListforMDT CAGListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool return notComprehended } -func (cNTypeRestrictionsForEquivalent CNTypeRestrictionsForEquivalent) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cNTypeRestrictionsForEquivalent CNTypeRestrictionsForEquivalent) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cNTypeRestrictionsForEquivalent { if cNTypeRestrictionsForEquivalent[i].Diagnose(d) { @@ -42261,7 +42814,7 @@ func (cNTypeRestrictionsForEquivalent CNTypeRestrictionsForEquivalent) Diagnose( return notComprehended } -func (candidateCellList CandidateCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (candidateCellList CandidateCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range candidateCellList { if candidateCellList[i].Diagnose(d) { @@ -42271,7 +42824,7 @@ func (candidateCellList CandidateCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (candidateRelayUEInformationList CandidateRelayUEInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (candidateRelayUEInformationList CandidateRelayUEInformationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range candidateRelayUEInformationList { if candidateRelayUEInformationList[i].Diagnose(d) { @@ -42281,7 +42834,7 @@ func (candidateRelayUEInformationList CandidateRelayUEInformationList) Diagnose( return notComprehended } -func (cellIDBroadcastEUTRA CellIDBroadcastEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDBroadcastEUTRA CellIDBroadcastEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellIDBroadcastEUTRA { if cellIDBroadcastEUTRA[i].Diagnose(d) { @@ -42291,7 +42844,7 @@ func (cellIDBroadcastEUTRA CellIDBroadcastEUTRA) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (cellIDBroadcastNR CellIDBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDBroadcastNR CellIDBroadcastNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellIDBroadcastNR { if cellIDBroadcastNR[i].Diagnose(d) { @@ -42301,7 +42854,7 @@ func (cellIDBroadcastNR CellIDBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (cellIDCancelledEUTRA CellIDCancelledEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDCancelledEUTRA CellIDCancelledEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellIDCancelledEUTRA { if cellIDCancelledEUTRA[i].Diagnose(d) { @@ -42311,7 +42864,7 @@ func (cellIDCancelledEUTRA CellIDCancelledEUTRA) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (cellIDCancelledNR CellIDCancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDCancelledNR CellIDCancelledNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellIDCancelledNR { if cellIDCancelledNR[i].Diagnose(d) { @@ -42321,7 +42874,7 @@ func (cellIDCancelledNR CellIDCancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (cellIdListforMDTEUTRA CellIdListforMDTEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIdListforMDTEUTRA CellIdListforMDTEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellIdListforMDTEUTRA { if cellIdListforMDTEUTRA[i].Diagnose(d) { @@ -42331,7 +42884,7 @@ func (cellIdListforMDTEUTRA CellIdListforMDTEUTRA) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (cellIdListforMDTNR CellIdListforMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIdListforMDTNR CellIdListforMDTNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellIdListforMDTNR { if cellIdListforMDTNR[i].Diagnose(d) { @@ -42341,7 +42894,7 @@ func (cellIdListforMDTNR CellIdListforMDTNR) Diagnose(d *ap.Diagnosis[ProtocolIE return notComprehended } -func (cellIdListforQMC CellIdListforQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIdListforQMC CellIdListforQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellIdListforQMC { if cellIdListforQMC[i].Diagnose(d) { @@ -42351,7 +42904,7 @@ func (cellIdListforQMC CellIdListforQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) return notComprehended } -func (cellsToActivateList CellsToActivateList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellsToActivateList CellsToActivateList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cellsToActivateList { if cellsToActivateList[i].Diagnose(d) { @@ -42361,7 +42914,7 @@ func (cellsToActivateList CellsToActivateList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (criticalityDiagnosticsIEList CriticalityDiagnosticsIEList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (criticalityDiagnosticsIEList CriticalityDiagnosticsIEList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range criticalityDiagnosticsIEList { if criticalityDiagnosticsIEList[i].Diagnose(d) { @@ -42371,7 +42924,7 @@ func (criticalityDiagnosticsIEList CriticalityDiagnosticsIEList) Diagnose(d *ap. return notComprehended } -func (dRBsToQosFlowsMappingList DRBsToQosFlowsMappingList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dRBsToQosFlowsMappingList DRBsToQosFlowsMappingList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range dRBsToQosFlowsMappingList { if dRBsToQosFlowsMappingList[i].Diagnose(d) { @@ -42381,7 +42934,7 @@ func (dRBsToQosFlowsMappingList DRBsToQosFlowsMappingList) Diagnose(d *ap.Diagno return notComprehended } -func (dataForwardingResponseDRBList DataForwardingResponseDRBList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dataForwardingResponseDRBList DataForwardingResponseDRBList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range dataForwardingResponseDRBList { if dataForwardingResponseDRBList[i].Diagnose(d) { @@ -42391,7 +42944,7 @@ func (dataForwardingResponseDRBList DataForwardingResponseDRBList) Diagnose(d *a return notComprehended } -func (dataForwardingResponseERABList DataForwardingResponseERABList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dataForwardingResponseERABList DataForwardingResponseERABList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range dataForwardingResponseERABList { if dataForwardingResponseERABList[i].Diagnose(d) { @@ -42401,7 +42954,7 @@ func (dataForwardingResponseERABList DataForwardingResponseERABList) Diagnose(d return notComprehended } -func (eCNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eCNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInformationReportingStatus) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range eCNMarkingorCongestionInformationReportingStatus { if eCNMarkingorCongestionInformationReportingStatus[i].Diagnose(d) { @@ -42411,7 +42964,7 @@ func (eCNMarkingorCongestionInformationReportingStatus ECNMarkingorCongestionInf return notComprehended } -func (eRABInformationList ERABInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABInformationList ERABInformationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range eRABInformationList { if eRABInformationList[i].Diagnose(d) { @@ -42421,7 +42974,7 @@ func (eRABInformationList ERABInformationList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (eUTRACGIList EUTRACGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRACGIList EUTRACGIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range eUTRACGIList { if eUTRACGIList[i].Diagnose(d) { @@ -42431,7 +42984,7 @@ func (eUTRACGIList EUTRACGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (eUTRACGIListForWarning EUTRACGIListForWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRACGIListForWarning EUTRACGIListForWarning) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range eUTRACGIListForWarning { if eUTRACGIListForWarning[i].Diagnose(d) { @@ -42441,7 +42994,7 @@ func (eUTRACGIListForWarning EUTRACGIListForWarning) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (eUTRANCellReportList EUTRANCellReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANCellReportList EUTRANCellReportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range eUTRANCellReportList { if eUTRANCellReportList[i].Diagnose(d) { @@ -42451,7 +43004,7 @@ func (eUTRANCellReportList EUTRANCellReportList) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (eUTRANCellToReportList EUTRANCellToReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eUTRANCellToReportList EUTRANCellToReportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range eUTRANCellToReportList { if eUTRANCellToReportList[i].Diagnose(d) { @@ -42461,7 +43014,7 @@ func (eUTRANCellToReportList EUTRANCellToReportList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (emergencyAreaIDBroadcastEUTRA EmergencyAreaIDBroadcastEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDBroadcastEUTRA EmergencyAreaIDBroadcastEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDBroadcastEUTRA { if emergencyAreaIDBroadcastEUTRA[i].Diagnose(d) { @@ -42471,7 +43024,7 @@ func (emergencyAreaIDBroadcastEUTRA EmergencyAreaIDBroadcastEUTRA) Diagnose(d *a return notComprehended } -func (emergencyAreaIDBroadcastNR EmergencyAreaIDBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDBroadcastNR EmergencyAreaIDBroadcastNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDBroadcastNR { if emergencyAreaIDBroadcastNR[i].Diagnose(d) { @@ -42481,7 +43034,7 @@ func (emergencyAreaIDBroadcastNR EmergencyAreaIDBroadcastNR) Diagnose(d *ap.Diag return notComprehended } -func (emergencyAreaIDCancelledEUTRA EmergencyAreaIDCancelledEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDCancelledEUTRA EmergencyAreaIDCancelledEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDCancelledEUTRA { if emergencyAreaIDCancelledEUTRA[i].Diagnose(d) { @@ -42491,7 +43044,7 @@ func (emergencyAreaIDCancelledEUTRA EmergencyAreaIDCancelledEUTRA) Diagnose(d *a return notComprehended } -func (emergencyAreaIDCancelledNR EmergencyAreaIDCancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDCancelledNR EmergencyAreaIDCancelledNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDCancelledNR { if emergencyAreaIDCancelledNR[i].Diagnose(d) { @@ -42501,7 +43054,7 @@ func (emergencyAreaIDCancelledNR EmergencyAreaIDCancelledNR) Diagnose(d *ap.Diag return notComprehended } -func (equivalentSNPNsList EquivalentSNPNsList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (equivalentSNPNsList EquivalentSNPNsList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range equivalentSNPNsList { if equivalentSNPNsList[i].Diagnose(d) { @@ -42511,7 +43064,7 @@ func (equivalentSNPNsList EquivalentSNPNsList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (excessPacketDelayThresholdConfiguration ExcessPacketDelayThresholdConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (excessPacketDelayThresholdConfiguration ExcessPacketDelayThresholdConfiguration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range excessPacketDelayThresholdConfiguration { if excessPacketDelayThresholdConfiguration[i].Diagnose(d) { @@ -42521,7 +43074,7 @@ func (excessPacketDelayThresholdConfiguration ExcessPacketDelayThresholdConfigur return notComprehended } -func (expectedUEMovingTrajectory ExpectedUEMovingTrajectory) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (expectedUEMovingTrajectory ExpectedUEMovingTrajectory) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range expectedUEMovingTrajectory { if expectedUEMovingTrajectory[i].Diagnose(d) { @@ -42531,7 +43084,7 @@ func (expectedUEMovingTrajectory ExpectedUEMovingTrajectory) Diagnose(d *ap.Diag return notComprehended } -func (extendedSliceSupportList ExtendedSliceSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (extendedSliceSupportList ExtendedSliceSupportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range extendedSliceSupportList { if extendedSliceSupportList[i].Diagnose(d) { @@ -42541,7 +43094,7 @@ func (extendedSliceSupportList ExtendedSliceSupportList) Diagnose(d *ap.Diagnosi return notComprehended } -func (fiveGProSePC5QoSFlowList FiveGProSePC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (fiveGProSePC5QoSFlowList FiveGProSePC5QoSFlowList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range fiveGProSePC5QoSFlowList { if fiveGProSePC5QoSFlowList[i].Diagnose(d) { @@ -42551,7 +43104,7 @@ func (fiveGProSePC5QoSFlowList FiveGProSePC5QoSFlowList) Diagnose(d *ap.Diagnosi return notComprehended } -func (forbiddenAreaInformation ForbiddenAreaInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (forbiddenAreaInformation ForbiddenAreaInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range forbiddenAreaInformation { if forbiddenAreaInformation[i].Diagnose(d) { @@ -42561,7 +43114,7 @@ func (forbiddenAreaInformation ForbiddenAreaInformation) Diagnose(d *ap.Diagnosi return notComprehended } -func (gUAMIList GUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (gUAMIList GUAMIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range gUAMIList { if gUAMIList[i].Diagnose(d) { @@ -42571,7 +43124,7 @@ func (gUAMIList GUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range lastVisitedPSCellList { if lastVisitedPSCellList[i].Diagnose(d) { @@ -42581,7 +43134,7 @@ func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (mBSActiveSessionInformationSourcetoTargetList MBSActiveSessionInformationSourcetoTargetList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSActiveSessionInformationSourcetoTargetList MBSActiveSessionInformationSourcetoTargetList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSActiveSessionInformationSourcetoTargetList { if mBSActiveSessionInformationSourcetoTargetList[i].Diagnose(d) { @@ -42591,7 +43144,7 @@ func (mBSActiveSessionInformationSourcetoTargetList MBSActiveSessionInformationS return notComprehended } -func (mBSMappingandDataForwardingRequestList MBSMappingandDataForwardingRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSMappingandDataForwardingRequestList MBSMappingandDataForwardingRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSMappingandDataForwardingRequestList { if mBSMappingandDataForwardingRequestList[i].Diagnose(d) { @@ -42601,7 +43154,7 @@ func (mBSMappingandDataForwardingRequestList MBSMappingandDataForwardingRequestL return notComprehended } -func (mBSQoSFlowList MBSQoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSQoSFlowList MBSQoSFlowList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSQoSFlowList { if mBSQoSFlowList[i].Diagnose(d) { @@ -42611,7 +43164,7 @@ func (mBSQoSFlowList MBSQoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) boo return notComprehended } -func (mBSQoSFlowsToBeSetupList MBSQoSFlowsToBeSetupList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSQoSFlowsToBeSetupList MBSQoSFlowsToBeSetupList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSQoSFlowsToBeSetupList { if mBSQoSFlowsToBeSetupList[i].Diagnose(d) { @@ -42621,7 +43174,7 @@ func (mBSQoSFlowsToBeSetupList MBSQoSFlowsToBeSetupList) Diagnose(d *ap.Diagnosi return notComprehended } -func (mBSServiceAreaCellList MBSServiceAreaCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSServiceAreaCellList MBSServiceAreaCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSServiceAreaCellList { if mBSServiceAreaCellList[i].Diagnose(d) { @@ -42631,7 +43184,7 @@ func (mBSServiceAreaCellList MBSServiceAreaCellList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (mBSServiceAreaInformationList MBSServiceAreaInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSServiceAreaInformationList MBSServiceAreaInformationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSServiceAreaInformationList { if mBSServiceAreaInformationList[i].Diagnose(d) { @@ -42641,7 +43194,7 @@ func (mBSServiceAreaInformationList MBSServiceAreaInformationList) Diagnose(d *a return notComprehended } -func (mBSServiceAreaTAIList MBSServiceAreaTAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSServiceAreaTAIList MBSServiceAreaTAIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSServiceAreaTAIList { if mBSServiceAreaTAIList[i].Diagnose(d) { @@ -42651,7 +43204,7 @@ func (mBSServiceAreaTAIList MBSServiceAreaTAIList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (mBSSessionFailedtoSetupList MBSSessionFailedtoSetupList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionFailedtoSetupList MBSSessionFailedtoSetupList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSSessionFailedtoSetupList { if mBSSessionFailedtoSetupList[i].Diagnose(d) { @@ -42661,7 +43214,7 @@ func (mBSSessionFailedtoSetupList MBSSessionFailedtoSetupList) Diagnose(d *ap.Di return notComprehended } -func (mBSSessionSetupRequestList MBSSessionSetupRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionSetupRequestList MBSSessionSetupRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSSessionSetupRequestList { if mBSSessionSetupRequestList[i].Diagnose(d) { @@ -42671,7 +43224,7 @@ func (mBSSessionSetupRequestList MBSSessionSetupRequestList) Diagnose(d *ap.Diag return notComprehended } -func (mBSSessionSetupResponseList MBSSessionSetupResponseList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionSetupResponseList MBSSessionSetupResponseList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSSessionSetupResponseList { if mBSSessionSetupResponseList[i].Diagnose(d) { @@ -42681,7 +43234,7 @@ func (mBSSessionSetupResponseList MBSSessionSetupResponseList) Diagnose(d *ap.Di return notComprehended } -func (mBSSessionSetuporModifyRequestList MBSSessionSetuporModifyRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionSetuporModifyRequestList MBSSessionSetuporModifyRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSSessionSetuporModifyRequestList { if mBSSessionSetuporModifyRequestList[i].Diagnose(d) { @@ -42691,7 +43244,7 @@ func (mBSSessionSetuporModifyRequestList MBSSessionSetuporModifyRequestList) Dia return notComprehended } -func (mBSSessionToReleaseList MBSSessionToReleaseList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (mBSSessionToReleaseList MBSSessionToReleaseList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range mBSSessionToReleaseList { if mBSSessionToReleaseList[i].Diagnose(d) { @@ -42701,7 +43254,7 @@ func (mBSSessionToReleaseList MBSSessionToReleaseList) Diagnose(d *ap.Diagnosis[ return notComprehended } -func (nGAPIESupportInformationRequestList NGAPIESupportInformationRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGAPIESupportInformationRequestList NGAPIESupportInformationRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nGAPIESupportInformationRequestList { if nGAPIESupportInformationRequestList[i].Diagnose(d) { @@ -42711,7 +43264,7 @@ func (nGAPIESupportInformationRequestList NGAPIESupportInformationRequestList) D return notComprehended } -func (nGRANCellReportList NGRANCellReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANCellReportList NGRANCellReportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nGRANCellReportList { if nGRANCellReportList[i].Diagnose(d) { @@ -42721,7 +43274,7 @@ func (nGRANCellReportList NGRANCellReportList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (nGRANCellToReportList NGRANCellToReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANCellToReportList NGRANCellToReportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nGRANCellToReportList { if nGRANCellToReportList[i].Diagnose(d) { @@ -42731,7 +43284,7 @@ func (nGRANCellToReportList NGRANCellToReportList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (nGRANTNLAssociationToRemoveList NGRANTNLAssociationToRemoveList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nGRANTNLAssociationToRemoveList NGRANTNLAssociationToRemoveList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nGRANTNLAssociationToRemoveList { if nGRANTNLAssociationToRemoveList[i].Diagnose(d) { @@ -42741,7 +43294,7 @@ func (nGRANTNLAssociationToRemoveList NGRANTNLAssociationToRemoveList) Diagnose( return notComprehended } -func (nRCGIList NRCGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRCGIList NRCGIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nRCGIList { if nRCGIList[i].Diagnose(d) { @@ -42751,7 +43304,7 @@ func (nRCGIList NRCGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (nRCGIListForWarning NRCGIListForWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRCGIListForWarning NRCGIListForWarning) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nRCGIListForWarning { if nRCGIListForWarning[i].Diagnose(d) { @@ -42761,7 +43314,7 @@ func (nRCGIListForWarning NRCGIListForWarning) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (nRFrequencyBandList NRFrequencyBandList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRFrequencyBandList NRFrequencyBandList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nRFrequencyBandList { if nRFrequencyBandList[i].Diagnose(d) { @@ -42771,7 +43324,7 @@ func (nRFrequencyBandList NRFrequencyBandList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (nTNGeographicalAreaList NTNGeographicalAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nTNGeographicalAreaList NTNGeographicalAreaList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range nTNGeographicalAreaList { if nTNGeographicalAreaList[i].Diagnose(d) { @@ -42781,7 +43334,7 @@ func (nTNGeographicalAreaList NTNGeographicalAreaList) Diagnose(d *ap.Diagnosis[ return notComprehended } -func (networkSliceListforMDT NetworkSliceListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (networkSliceListforMDT NetworkSliceListforMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range networkSliceListforMDT { if networkSliceListforMDT[i].Diagnose(d) { @@ -42791,7 +43344,7 @@ func (networkSliceListforMDT NetworkSliceListforMDT) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (notificationCellList NotificationCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (notificationCellList NotificationCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range notificationCellList { if notificationCellList[i].Diagnose(d) { @@ -42801,7 +43354,7 @@ func (notificationCellList NotificationCellList) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (overloadStartNSSAIList OverloadStartNSSAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (overloadStartNSSAIList OverloadStartNSSAIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range overloadStartNSSAIList { if overloadStartNSSAIList[i].Diagnose(d) { @@ -42811,7 +43364,7 @@ func (overloadStartNSSAIList OverloadStartNSSAIList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (pC5QoSFlowList PC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pC5QoSFlowList PC5QoSFlowList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pC5QoSFlowList { if pC5QoSFlowList[i].Diagnose(d) { @@ -42821,7 +43374,7 @@ func (pC5QoSFlowList PC5QoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) boo return notComprehended } -func (pCIListForMDT PCIListForMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pCIListForMDT PCIListForMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pCIListForMDT { if pCIListForMDT[i].Diagnose(d) { @@ -42831,7 +43384,7 @@ func (pCIListForMDT PCIListForMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool return notComprehended } -func (pDUSessionResourceAdmittedList PDUSessionResourceAdmittedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceAdmittedList PDUSessionResourceAdmittedList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceAdmittedList { if pDUSessionResourceAdmittedList[i].Diagnose(d) { @@ -42841,7 +43394,7 @@ func (pDUSessionResourceAdmittedList PDUSessionResourceAdmittedList) Diagnose(d return notComprehended } -func (pDUSessionResourceFailedToModifyListModCfm PDUSessionResourceFailedToModifyListModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToModifyListModCfm PDUSessionResourceFailedToModifyListModCfm) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceFailedToModifyListModCfm { if pDUSessionResourceFailedToModifyListModCfm[i].Diagnose(d) { @@ -42851,7 +43404,7 @@ func (pDUSessionResourceFailedToModifyListModCfm PDUSessionResourceFailedToModif return notComprehended } -func (pDUSessionResourceFailedToModifyListModRes PDUSessionResourceFailedToModifyListModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToModifyListModRes PDUSessionResourceFailedToModifyListModRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceFailedToModifyListModRes { if pDUSessionResourceFailedToModifyListModRes[i].Diagnose(d) { @@ -42861,7 +43414,7 @@ func (pDUSessionResourceFailedToModifyListModRes PDUSessionResourceFailedToModif return notComprehended } -func (pDUSessionResourceFailedToSetupListCxtFail PDUSessionResourceFailedToSetupListCxtFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupListCxtFail PDUSessionResourceFailedToSetupListCxtFail) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceFailedToSetupListCxtFail { if pDUSessionResourceFailedToSetupListCxtFail[i].Diagnose(d) { @@ -42871,7 +43424,7 @@ func (pDUSessionResourceFailedToSetupListCxtFail PDUSessionResourceFailedToSetup return notComprehended } -func (pDUSessionResourceFailedToSetupListCxtRes PDUSessionResourceFailedToSetupListCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupListCxtRes PDUSessionResourceFailedToSetupListCxtRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceFailedToSetupListCxtRes { if pDUSessionResourceFailedToSetupListCxtRes[i].Diagnose(d) { @@ -42881,7 +43434,7 @@ func (pDUSessionResourceFailedToSetupListCxtRes PDUSessionResourceFailedToSetupL return notComprehended } -func (pDUSessionResourceFailedToSetupListHOAck PDUSessionResourceFailedToSetupListHOAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupListHOAck PDUSessionResourceFailedToSetupListHOAck) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceFailedToSetupListHOAck { if pDUSessionResourceFailedToSetupListHOAck[i].Diagnose(d) { @@ -42891,7 +43444,7 @@ func (pDUSessionResourceFailedToSetupListHOAck PDUSessionResourceFailedToSetupLi return notComprehended } -func (pDUSessionResourceFailedToSetupListPSReq PDUSessionResourceFailedToSetupListPSReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupListPSReq PDUSessionResourceFailedToSetupListPSReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceFailedToSetupListPSReq { if pDUSessionResourceFailedToSetupListPSReq[i].Diagnose(d) { @@ -42901,7 +43454,7 @@ func (pDUSessionResourceFailedToSetupListPSReq PDUSessionResourceFailedToSetupLi return notComprehended } -func (pDUSessionResourceFailedToSetupListSURes PDUSessionResourceFailedToSetupListSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceFailedToSetupListSURes PDUSessionResourceFailedToSetupListSURes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceFailedToSetupListSURes { if pDUSessionResourceFailedToSetupListSURes[i].Diagnose(d) { @@ -42911,7 +43464,7 @@ func (pDUSessionResourceFailedToSetupListSURes PDUSessionResourceFailedToSetupLi return notComprehended } -func (pDUSessionResourceHandoverList PDUSessionResourceHandoverList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceHandoverList PDUSessionResourceHandoverList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceHandoverList { if pDUSessionResourceHandoverList[i].Diagnose(d) { @@ -42921,7 +43474,7 @@ func (pDUSessionResourceHandoverList PDUSessionResourceHandoverList) Diagnose(d return notComprehended } -func (pDUSessionResourceInformationList PDUSessionResourceInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceInformationList PDUSessionResourceInformationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceInformationList { if pDUSessionResourceInformationList[i].Diagnose(d) { @@ -42931,7 +43484,7 @@ func (pDUSessionResourceInformationList PDUSessionResourceInformationList) Diagn return notComprehended } -func (pDUSessionResourceListCxtRelCpl PDUSessionResourceListCxtRelCpl) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceListCxtRelCpl PDUSessionResourceListCxtRelCpl) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceListCxtRelCpl { if pDUSessionResourceListCxtRelCpl[i].Diagnose(d) { @@ -42941,7 +43494,7 @@ func (pDUSessionResourceListCxtRelCpl PDUSessionResourceListCxtRelCpl) Diagnose( return notComprehended } -func (pDUSessionResourceListCxtRelReq PDUSessionResourceListCxtRelReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceListCxtRelReq PDUSessionResourceListCxtRelReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceListCxtRelReq { if pDUSessionResourceListCxtRelReq[i].Diagnose(d) { @@ -42951,7 +43504,7 @@ func (pDUSessionResourceListCxtRelReq PDUSessionResourceListCxtRelReq) Diagnose( return notComprehended } -func (pDUSessionResourceListHORqd PDUSessionResourceListHORqd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceListHORqd PDUSessionResourceListHORqd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceListHORqd { if pDUSessionResourceListHORqd[i].Diagnose(d) { @@ -42961,7 +43514,7 @@ func (pDUSessionResourceListHORqd PDUSessionResourceListHORqd) Diagnose(d *ap.Di return notComprehended } -func (pDUSessionResourceModifyListModCfm PDUSessionResourceModifyListModCfm) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyListModCfm PDUSessionResourceModifyListModCfm) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceModifyListModCfm { if pDUSessionResourceModifyListModCfm[i].Diagnose(d) { @@ -42971,7 +43524,7 @@ func (pDUSessionResourceModifyListModCfm PDUSessionResourceModifyListModCfm) Dia return notComprehended } -func (pDUSessionResourceModifyListModInd PDUSessionResourceModifyListModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyListModInd PDUSessionResourceModifyListModInd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceModifyListModInd { if pDUSessionResourceModifyListModInd[i].Diagnose(d) { @@ -42981,7 +43534,7 @@ func (pDUSessionResourceModifyListModInd PDUSessionResourceModifyListModInd) Dia return notComprehended } -func (pDUSessionResourceModifyListModReq PDUSessionResourceModifyListModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyListModReq PDUSessionResourceModifyListModReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceModifyListModReq { if pDUSessionResourceModifyListModReq[i].Diagnose(d) { @@ -42991,7 +43544,7 @@ func (pDUSessionResourceModifyListModReq PDUSessionResourceModifyListModReq) Dia return notComprehended } -func (pDUSessionResourceModifyListModRes PDUSessionResourceModifyListModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceModifyListModRes PDUSessionResourceModifyListModRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceModifyListModRes { if pDUSessionResourceModifyListModRes[i].Diagnose(d) { @@ -43001,7 +43554,7 @@ func (pDUSessionResourceModifyListModRes PDUSessionResourceModifyListModRes) Dia return notComprehended } -func (pDUSessionResourceNotifyList PDUSessionResourceNotifyList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceNotifyList PDUSessionResourceNotifyList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceNotifyList { if pDUSessionResourceNotifyList[i].Diagnose(d) { @@ -43011,7 +43564,7 @@ func (pDUSessionResourceNotifyList PDUSessionResourceNotifyList) Diagnose(d *ap. return notComprehended } -func (pDUSessionResourceReleasedListNot PDUSessionResourceReleasedListNot) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedListNot PDUSessionResourceReleasedListNot) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceReleasedListNot { if pDUSessionResourceReleasedListNot[i].Diagnose(d) { @@ -43021,7 +43574,7 @@ func (pDUSessionResourceReleasedListNot PDUSessionResourceReleasedListNot) Diagn return notComprehended } -func (pDUSessionResourceReleasedListPSAck PDUSessionResourceReleasedListPSAck) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedListPSAck PDUSessionResourceReleasedListPSAck) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceReleasedListPSAck { if pDUSessionResourceReleasedListPSAck[i].Diagnose(d) { @@ -43031,7 +43584,7 @@ func (pDUSessionResourceReleasedListPSAck PDUSessionResourceReleasedListPSAck) D return notComprehended } -func (pDUSessionResourceReleasedListPSFail PDUSessionResourceReleasedListPSFail) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedListPSFail PDUSessionResourceReleasedListPSFail) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceReleasedListPSFail { if pDUSessionResourceReleasedListPSFail[i].Diagnose(d) { @@ -43041,7 +43594,7 @@ func (pDUSessionResourceReleasedListPSFail PDUSessionResourceReleasedListPSFail) return notComprehended } -func (pDUSessionResourceReleasedListRelRes PDUSessionResourceReleasedListRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceReleasedListRelRes PDUSessionResourceReleasedListRelRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceReleasedListRelRes { if pDUSessionResourceReleasedListRelRes[i].Diagnose(d) { @@ -43051,7 +43604,7 @@ func (pDUSessionResourceReleasedListRelRes PDUSessionResourceReleasedListRelRes) return notComprehended } -func (pDUSessionResourceSetupListCxtReq PDUSessionResourceSetupListCxtReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupListCxtReq PDUSessionResourceSetupListCxtReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceSetupListCxtReq { if pDUSessionResourceSetupListCxtReq[i].Diagnose(d) { @@ -43061,7 +43614,7 @@ func (pDUSessionResourceSetupListCxtReq PDUSessionResourceSetupListCxtReq) Diagn return notComprehended } -func (pDUSessionResourceSetupListCxtRes PDUSessionResourceSetupListCxtRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupListCxtRes PDUSessionResourceSetupListCxtRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceSetupListCxtRes { if pDUSessionResourceSetupListCxtRes[i].Diagnose(d) { @@ -43071,7 +43624,7 @@ func (pDUSessionResourceSetupListCxtRes PDUSessionResourceSetupListCxtRes) Diagn return notComprehended } -func (pDUSessionResourceSetupListHOReq PDUSessionResourceSetupListHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupListHOReq PDUSessionResourceSetupListHOReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceSetupListHOReq { if pDUSessionResourceSetupListHOReq[i].Diagnose(d) { @@ -43081,7 +43634,7 @@ func (pDUSessionResourceSetupListHOReq PDUSessionResourceSetupListHOReq) Diagnos return notComprehended } -func (pDUSessionResourceSetupListSUReq PDUSessionResourceSetupListSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupListSUReq PDUSessionResourceSetupListSUReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceSetupListSUReq { if pDUSessionResourceSetupListSUReq[i].Diagnose(d) { @@ -43091,7 +43644,7 @@ func (pDUSessionResourceSetupListSUReq PDUSessionResourceSetupListSUReq) Diagnos return notComprehended } -func (pDUSessionResourceSetupListSURes PDUSessionResourceSetupListSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSetupListSURes PDUSessionResourceSetupListSURes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceSetupListSURes { if pDUSessionResourceSetupListSURes[i].Diagnose(d) { @@ -43101,7 +43654,7 @@ func (pDUSessionResourceSetupListSURes PDUSessionResourceSetupListSURes) Diagnos return notComprehended } -func (pDUSessionResourceSwitchedList PDUSessionResourceSwitchedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceSwitchedList PDUSessionResourceSwitchedList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceSwitchedList { if pDUSessionResourceSwitchedList[i].Diagnose(d) { @@ -43111,7 +43664,7 @@ func (pDUSessionResourceSwitchedList PDUSessionResourceSwitchedList) Diagnose(d return notComprehended } -func (pDUSessionResourceToBeSwitchedDLList PDUSessionResourceToBeSwitchedDLList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceToBeSwitchedDLList PDUSessionResourceToBeSwitchedDLList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceToBeSwitchedDLList { if pDUSessionResourceToBeSwitchedDLList[i].Diagnose(d) { @@ -43121,7 +43674,7 @@ func (pDUSessionResourceToBeSwitchedDLList PDUSessionResourceToBeSwitchedDLList) return notComprehended } -func (pDUSessionResourceToReleaseListHOCmd PDUSessionResourceToReleaseListHOCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceToReleaseListHOCmd PDUSessionResourceToReleaseListHOCmd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceToReleaseListHOCmd { if pDUSessionResourceToReleaseListHOCmd[i].Diagnose(d) { @@ -43131,7 +43684,7 @@ func (pDUSessionResourceToReleaseListHOCmd PDUSessionResourceToReleaseListHOCmd) return notComprehended } -func (pDUSessionResourceToReleaseListRelCmd PDUSessionResourceToReleaseListRelCmd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pDUSessionResourceToReleaseListRelCmd PDUSessionResourceToReleaseListRelCmd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pDUSessionResourceToReleaseListRelCmd { if pDUSessionResourceToReleaseListRelCmd[i].Diagnose(d) { @@ -43141,7 +43694,7 @@ func (pDUSessionResourceToReleaseListRelCmd PDUSessionResourceToReleaseListRelCm return notComprehended } -func (pLMNSupportList PLMNSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pLMNSupportList PLMNSupportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range pLMNSupportList { if pLMNSupportList[i].Diagnose(d) { @@ -43151,7 +43704,7 @@ func (pLMNSupportList PLMNSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) b return notComprehended } -func (partiallyAllowedNSSAI PartiallyAllowedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (partiallyAllowedNSSAI PartiallyAllowedNSSAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range partiallyAllowedNSSAI { if partiallyAllowedNSSAI[i].Diagnose(d) { @@ -43161,7 +43714,7 @@ func (partiallyAllowedNSSAI PartiallyAllowedNSSAI) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (qoSFlowTSCList QoSFlowTSCList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qoSFlowTSCList QoSFlowTSCList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qoSFlowTSCList { if qoSFlowTSCList[i].Diagnose(d) { @@ -43171,7 +43724,7 @@ func (qoSFlowTSCList QoSFlowTSCList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) boo return notComprehended } -func (qoSFlowsUsageReportList QoSFlowsUsageReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qoSFlowsUsageReportList QoSFlowsUsageReportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qoSFlowsUsageReportList { if qoSFlowsUsageReportList[i].Diagnose(d) { @@ -43181,7 +43734,7 @@ func (qoSFlowsUsageReportList QoSFlowsUsageReportList) Diagnose(d *ap.Diagnosis[ return notComprehended } -func (qosFlowAcceptedList QosFlowAcceptedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAcceptedList QosFlowAcceptedList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowAcceptedList { if qosFlowAcceptedList[i].Diagnose(d) { @@ -43191,7 +43744,7 @@ func (qosFlowAcceptedList QosFlowAcceptedList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (qosFlowAddOrModifyRequestList QosFlowAddOrModifyRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAddOrModifyRequestList QosFlowAddOrModifyRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowAddOrModifyRequestList { if qosFlowAddOrModifyRequestList[i].Diagnose(d) { @@ -43201,7 +43754,7 @@ func (qosFlowAddOrModifyRequestList QosFlowAddOrModifyRequestList) Diagnose(d *a return notComprehended } -func (qosFlowAddOrModifyResponseList QosFlowAddOrModifyResponseList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAddOrModifyResponseList QosFlowAddOrModifyResponseList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowAddOrModifyResponseList { if qosFlowAddOrModifyResponseList[i].Diagnose(d) { @@ -43211,7 +43764,7 @@ func (qosFlowAddOrModifyResponseList QosFlowAddOrModifyResponseList) Diagnose(d return notComprehended } -func (qosFlowAdditionalInfoListRelCom QosFlowAdditionalInfoListRelCom) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAdditionalInfoListRelCom QosFlowAdditionalInfoListRelCom) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowAdditionalInfoListRelCom { if qosFlowAdditionalInfoListRelCom[i].Diagnose(d) { @@ -43221,7 +43774,7 @@ func (qosFlowAdditionalInfoListRelCom QosFlowAdditionalInfoListRelCom) Diagnose( return notComprehended } -func (qosFlowAdditionalInfoListRelRes QosFlowAdditionalInfoListRelRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowAdditionalInfoListRelRes QosFlowAdditionalInfoListRelRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowAdditionalInfoListRelRes { if qosFlowAdditionalInfoListRelRes[i].Diagnose(d) { @@ -43231,7 +43784,7 @@ func (qosFlowAdditionalInfoListRelRes QosFlowAdditionalInfoListRelRes) Diagnose( return notComprehended } -func (qosFlowFeedbackList QosFlowFeedbackList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowFeedbackList QosFlowFeedbackList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowFeedbackList { if qosFlowFeedbackList[i].Diagnose(d) { @@ -43241,7 +43794,7 @@ func (qosFlowFeedbackList QosFlowFeedbackList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (qosFlowInformationList QosFlowInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowInformationList QosFlowInformationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowInformationList { if qosFlowInformationList[i].Diagnose(d) { @@ -43251,7 +43804,7 @@ func (qosFlowInformationList QosFlowInformationList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (qosFlowListWithCause QosFlowListWithCause) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowListWithCause QosFlowListWithCause) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowListWithCause { if qosFlowListWithCause[i].Diagnose(d) { @@ -43261,7 +43814,7 @@ func (qosFlowListWithCause QosFlowListWithCause) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (qosFlowListWithDataForwarding QosFlowListWithDataForwarding) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowListWithDataForwarding QosFlowListWithDataForwarding) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowListWithDataForwarding { if qosFlowListWithDataForwarding[i].Diagnose(d) { @@ -43271,7 +43824,7 @@ func (qosFlowListWithDataForwarding QosFlowListWithDataForwarding) Diagnose(d *a return notComprehended } -func (qosFlowModifyConfirmList QosFlowModifyConfirmList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowModifyConfirmList QosFlowModifyConfirmList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowModifyConfirmList { if qosFlowModifyConfirmList[i].Diagnose(d) { @@ -43281,7 +43834,7 @@ func (qosFlowModifyConfirmList QosFlowModifyConfirmList) Diagnose(d *ap.Diagnosi return notComprehended } -func (qosFlowNotifyList QosFlowNotifyList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowNotifyList QosFlowNotifyList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowNotifyList { if qosFlowNotifyList[i].Diagnose(d) { @@ -43291,7 +43844,7 @@ func (qosFlowNotifyList QosFlowNotifyList) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (qosFlowParametersList QosFlowParametersList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowParametersList QosFlowParametersList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowParametersList { if qosFlowParametersList[i].Diagnose(d) { @@ -43301,7 +43854,7 @@ func (qosFlowParametersList QosFlowParametersList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (qosFlowPerTNLInformationList QosFlowPerTNLInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowPerTNLInformationList QosFlowPerTNLInformationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowPerTNLInformationList { if qosFlowPerTNLInformationList[i].Diagnose(d) { @@ -43311,7 +43864,7 @@ func (qosFlowPerTNLInformationList QosFlowPerTNLInformationList) Diagnose(d *ap. return notComprehended } -func (qosFlowSetupRequestList QosFlowSetupRequestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowSetupRequestList QosFlowSetupRequestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowSetupRequestList { if qosFlowSetupRequestList[i].Diagnose(d) { @@ -43321,7 +43874,7 @@ func (qosFlowSetupRequestList QosFlowSetupRequestList) Diagnose(d *ap.Diagnosis[ return notComprehended } -func (qosFlowToBeForwardedList QosFlowToBeForwardedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (qosFlowToBeForwardedList QosFlowToBeForwardedList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range qosFlowToBeForwardedList { if qosFlowToBeForwardedList[i].Diagnose(d) { @@ -43331,7 +43884,7 @@ func (qosFlowToBeForwardedList QosFlowToBeForwardedList) Diagnose(d *ap.Diagnosi return notComprehended } -func (rATRestrictions RATRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rATRestrictions RATRestrictions) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range rATRestrictions { if rATRestrictions[i].Diagnose(d) { @@ -43341,7 +43894,7 @@ func (rATRestrictions RATRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIEID]) b return notComprehended } -func (rSPPQoSFlowList RSPPQoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rSPPQoSFlowList RSPPQoSFlowList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range rSPPQoSFlowList { if rSPPQoSFlowList[i].Diagnose(d) { @@ -43351,7 +43904,7 @@ func (rSPPQoSFlowList RSPPQoSFlowList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) b return notComprehended } -func (recommendedCellList RecommendedCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (recommendedCellList RecommendedCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range recommendedCellList { if recommendedCellList[i].Diagnose(d) { @@ -43361,7 +43914,7 @@ func (recommendedCellList RecommendedCellList) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (recommendedRANNodeList RecommendedRANNodeList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (recommendedRANNodeList RecommendedRANNodeList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range recommendedRANNodeList { if recommendedRANNodeList[i].Diagnose(d) { @@ -43371,7 +43924,7 @@ func (recommendedRANNodeList RecommendedRANNodeList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (requestedNSSAI RequestedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (requestedNSSAI RequestedNSSAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range requestedNSSAI { if requestedNSSAI[i].Diagnose(d) { @@ -43381,7 +43934,7 @@ func (requestedNSSAI RequestedNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) boo return notComprehended } -func (sNPNCellIdListforMDT SNPNCellIdListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNCellIdListforMDT SNPNCellIdListforMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range sNPNCellIdListforMDT { if sNPNCellIdListforMDT[i].Diagnose(d) { @@ -43391,7 +43944,7 @@ func (sNPNCellIdListforMDT SNPNCellIdListforMDT) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (sNPNListforMDT SNPNListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNListforMDT SNPNListforMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range sNPNListforMDT { if sNPNListforMDT[i].Diagnose(d) { @@ -43401,7 +43954,7 @@ func (sNPNListforMDT SNPNListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) boo return notComprehended } -func (sNPNTAIListforMDT SNPNTAIListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sNPNTAIListforMDT SNPNTAIListforMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range sNPNTAIListforMDT { if sNPNTAIListforMDT[i].Diagnose(d) { @@ -43411,7 +43964,7 @@ func (sNPNTAIListforMDT SNPNTAIListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (sensorMeasConfigNameList SensorMeasConfigNameList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sensorMeasConfigNameList SensorMeasConfigNameList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range sensorMeasConfigNameList { if sensorMeasConfigNameList[i].Diagnose(d) { @@ -43421,7 +43974,7 @@ func (sensorMeasConfigNameList SensorMeasConfigNameList) Diagnose(d *ap.Diagnosi return notComprehended } -func (servedGUAMIList ServedGUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (servedGUAMIList ServedGUAMIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range servedGUAMIList { if servedGUAMIList[i].Diagnose(d) { @@ -43431,7 +43984,7 @@ func (servedGUAMIList ServedGUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) b return notComprehended } -func (serviceAreaInformation ServiceAreaInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (serviceAreaInformation ServiceAreaInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range serviceAreaInformation { if serviceAreaInformation[i].Diagnose(d) { @@ -43441,7 +43994,7 @@ func (serviceAreaInformation ServiceAreaInformation) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (sliceMDTList SliceMDTList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sliceMDTList SliceMDTList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range sliceMDTList { if sliceMDTList[i].Diagnose(d) { @@ -43451,7 +44004,7 @@ func (sliceMDTList SliceMDTList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (sliceSupportList SliceSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sliceSupportList SliceSupportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range sliceSupportList { if sliceSupportList[i].Diagnose(d) { @@ -43461,7 +44014,7 @@ func (sliceSupportList SliceSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) return notComprehended } -func (sliceSupportListQMC SliceSupportListQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sliceSupportListQMC SliceSupportListQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range sliceSupportListQMC { if sliceSupportListQMC[i].Diagnose(d) { @@ -43471,7 +44024,7 @@ func (sliceSupportListQMC SliceSupportListQMC) Diagnose(d *ap.Diagnosis[Protocol return notComprehended } -func (supportedTAList SupportedTAList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (supportedTAList SupportedTAList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range supportedTAList { if supportedTAList[i].Diagnose(d) { @@ -43481,7 +44034,7 @@ func (supportedTAList SupportedTAList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) b return notComprehended } -func (tAIBroadcastEUTRA TAIBroadcastEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBroadcastEUTRA TAIBroadcastEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIBroadcastEUTRA { if tAIBroadcastEUTRA[i].Diagnose(d) { @@ -43491,7 +44044,7 @@ func (tAIBroadcastEUTRA TAIBroadcastEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (tAIBroadcastNR TAIBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBroadcastNR TAIBroadcastNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIBroadcastNR { if tAIBroadcastNR[i].Diagnose(d) { @@ -43501,7 +44054,7 @@ func (tAIBroadcastNR TAIBroadcastNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) boo return notComprehended } -func (tAICancelledEUTRA TAICancelledEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAICancelledEUTRA TAICancelledEUTRA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAICancelledEUTRA { if tAICancelledEUTRA[i].Diagnose(d) { @@ -43511,7 +44064,7 @@ func (tAICancelledEUTRA TAICancelledEUTRA) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (tAICancelledNR TAICancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAICancelledNR TAICancelledNR) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAICancelledNR { if tAICancelledNR[i].Diagnose(d) { @@ -43521,7 +44074,7 @@ func (tAICancelledNR TAICancelledNR) Diagnose(d *ap.Diagnosis[ProtocolIEID]) boo return notComprehended } -func (tAIListForInactive TAIListForInactive) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListForInactive TAIListForInactive) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIListForInactive { if tAIListForInactive[i].Diagnose(d) { @@ -43531,7 +44084,7 @@ func (tAIListForInactive TAIListForInactive) Diagnose(d *ap.Diagnosis[ProtocolIE return notComprehended } -func (tAIListForPaging TAIListForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListForPaging TAIListForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIListForPaging { if tAIListForPaging[i].Diagnose(d) { @@ -43541,7 +44094,7 @@ func (tAIListForPaging TAIListForPaging) Diagnose(d *ap.Diagnosis[ProtocolIEID]) return notComprehended } -func (tAIListForRestart TAIListForRestart) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListForRestart TAIListForRestart) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIListForRestart { if tAIListForRestart[i].Diagnose(d) { @@ -43551,7 +44104,7 @@ func (tAIListForRestart TAIListForRestart) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (tAIListForWarning TAIListForWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListForWarning TAIListForWarning) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIListForWarning { if tAIListForWarning[i].Diagnose(d) { @@ -43561,7 +44114,7 @@ func (tAIListForWarning TAIListForWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID return notComprehended } -func (tAIListforMDT TAIListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListforMDT TAIListforMDT) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIListforMDT { if tAIListforMDT[i].Diagnose(d) { @@ -43571,7 +44124,7 @@ func (tAIListforMDT TAIListforMDT) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool return notComprehended } -func (tAIListforQMC TAIListforQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListforQMC TAIListforQMC) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAIListforQMC { if tAIListforQMC[i].Diagnose(d) { @@ -43581,7 +44134,7 @@ func (tAIListforQMC TAIListforQMC) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool return notComprehended } -func (tAINSAGSupportList TAINSAGSupportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAINSAGSupportList TAINSAGSupportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tAINSAGSupportList { if tAINSAGSupportList[i].Diagnose(d) { @@ -43591,7 +44144,7 @@ func (tAINSAGSupportList TAINSAGSupportList) Diagnose(d *ap.Diagnosis[ProtocolIE return notComprehended } -func (tNLAssociationList TNLAssociationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tNLAssociationList TNLAssociationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range tNLAssociationList { if tNLAssociationList[i].Diagnose(d) { @@ -43601,7 +44154,7 @@ func (tNLAssociationList TNLAssociationList) Diagnose(d *ap.Diagnosis[ProtocolIE return notComprehended } -func (targetNSSAI TargetNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetNSSAI TargetNSSAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range targetNSSAI { if targetNSSAI[i].Diagnose(d) { @@ -43611,7 +44164,7 @@ func (targetNSSAI TargetNSSAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (uEAppLayerMeasInfoList UEAppLayerMeasInfoList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAppLayerMeasInfoList UEAppLayerMeasInfoList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uEAppLayerMeasInfoList { if uEAppLayerMeasInfoList[i].Diagnose(d) { @@ -43621,7 +44174,7 @@ func (uEAppLayerMeasInfoList UEAppLayerMeasInfoList) Diagnose(d *ap.Diagnosis[Pr return notComprehended } -func (uEAssociatedLogicalNGConnectionList UEAssociatedLogicalNGConnectionList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAssociatedLogicalNGConnectionList UEAssociatedLogicalNGConnectionList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uEAssociatedLogicalNGConnectionList { if uEAssociatedLogicalNGConnectionList[i].Diagnose(d) { @@ -43631,7 +44184,7 @@ func (uEAssociatedLogicalNGConnectionList UEAssociatedLogicalNGConnectionList) D return notComprehended } -func (uEHistoryInformation UEHistoryInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEHistoryInformation UEHistoryInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uEHistoryInformation { if uEHistoryInformation[i].Diagnose(d) { @@ -43641,7 +44194,7 @@ func (uEHistoryInformation UEHistoryInformation) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (uEPresenceInAreaOfInterestList UEPresenceInAreaOfInterestList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEPresenceInAreaOfInterestList UEPresenceInAreaOfInterestList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uEPresenceInAreaOfInterestList { if uEPresenceInAreaOfInterestList[i].Diagnose(d) { @@ -43651,7 +44204,7 @@ func (uEPresenceInAreaOfInterestList UEPresenceInAreaOfInterestList) Diagnose(d return notComprehended } -func (uESliceMaximumBitRateList UESliceMaximumBitRateList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uESliceMaximumBitRateList UESliceMaximumBitRateList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uESliceMaximumBitRateList { if uESliceMaximumBitRateList[i].Diagnose(d) { @@ -43661,7 +44214,7 @@ func (uESliceMaximumBitRateList UESliceMaximumBitRateList) Diagnose(d *ap.Diagno return notComprehended } -func (uLNGUUPTNLModifyList ULNGUUPTNLModifyList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uLNGUUPTNLModifyList ULNGUUPTNLModifyList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uLNGUUPTNLModifyList { if uLNGUUPTNLModifyList[i].Diagnose(d) { @@ -43671,7 +44224,7 @@ func (uLNGUUPTNLModifyList ULNGUUPTNLModifyList) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (uPTransportLayerInformationList UPTransportLayerInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uPTransportLayerInformationList UPTransportLayerInformationList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uPTransportLayerInformationList { if uPTransportLayerInformationList[i].Diagnose(d) { @@ -43681,7 +44234,7 @@ func (uPTransportLayerInformationList UPTransportLayerInformationList) Diagnose( return notComprehended } -func (uPTransportLayerInformationPairList UPTransportLayerInformationPairList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uPTransportLayerInformationPairList UPTransportLayerInformationPairList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uPTransportLayerInformationPairList { if uPTransportLayerInformationPairList[i].Diagnose(d) { @@ -43691,7 +44244,7 @@ func (uPTransportLayerInformationPairList UPTransportLayerInformationPairList) D return notComprehended } -func (unavailableGUAMIList UnavailableGUAMIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (unavailableGUAMIList UnavailableGUAMIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range unavailableGUAMIList { if unavailableGUAMIList[i].Diagnose(d) { @@ -43701,7 +44254,7 @@ func (unavailableGUAMIList UnavailableGUAMIList) Diagnose(d *ap.Diagnosis[Protoc return notComprehended } -func (volumeTimedReportList VolumeTimedReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (volumeTimedReportList VolumeTimedReportList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range volumeTimedReportList { if volumeTimedReportList[i].Diagnose(d) { @@ -43711,7 +44264,7 @@ func (volumeTimedReportList VolumeTimedReportList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (wLANMeasConfigNameList WLANMeasConfigNameList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (wLANMeasConfigNameList WLANMeasConfigNameList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range wLANMeasConfigNameList { if wLANMeasConfigNameList[i].Diagnose(d) { diff --git a/ngap/per_test_helpers_test.go b/ngap/per_test_helpers_test.go index 662a3172b1..8d3c7c6169 100644 --- a/ngap/per_test_helpers_test.go +++ b/ngap/per_test_helpers_test.go @@ -8,6 +8,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func unmarshalPERValue[T any](b []byte) (T, error) { @@ -49,7 +50,7 @@ func deref[T any](p *T) T { //nolint:unparam func encodeIEContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - return ap.EncodeIEContainer(profile, w, enc, fields) + return apimpl.EncodeIEContainer(profile, w, enc, fields) } func typeOfError(d DiagnosticIE) TypeOfError { @@ -82,7 +83,7 @@ func rawRow[M any](id ProtocolIEID, crit Criticality, value []byte) ieSpec[M] { return ieSpec[M]{ ID: id, Presence: presenceOptional, Criticality: crit, Decode: func(*M, *per.Reader, per.Encoding) error { return nil }, - Encode: func(*M) (per.Marshaler, bool) { return ap.RawValue(value), true }, + Encode: func(*M) (per.Marshaler, bool) { return apimpl.RawValue(value), true }, } } @@ -99,5 +100,5 @@ func tableRow[M any](table []ieSpec[M], id ProtocolIEID, crit Criticality) ieSpe } func encodeContainerField(w *per.Writer, f ieField) error { - return ap.EncodeField(profile, w, per.Aligned, f) + return apimpl.EncodeField(profile, w, per.Aligned, f) } diff --git a/ngap/procedure_criticality.go b/ngap/procedure_criticality.go index 7b5d60abc0..2de6906a0d 100644 --- a/ngap/procedure_criticality.go +++ b/ngap/procedure_criticality.go @@ -93,6 +93,12 @@ var procedureInfos = map[ProcedureCode]procedureInfo{ ProcMTCommunicationHandling: {CriticalityReject, true}, ProcRANPagingRequest: {CriticalityIgnore, false}, ProcBroadcastSessionTransport: {CriticalityReject, true}, + ProcNGRemoval: {CriticalityReject, true}, + ProcInventoryRequest: {CriticalityReject, true}, + ProcInventoryReport: {CriticalityReject, false}, + ProcCommandRequest: {CriticalityReject, true}, + ProcAIOTSessionRelease: {CriticalityReject, false}, + ProcAIOTSessionReleaseRequest: {CriticalityReject, false}, } // TS 38.413 §9.4.3. diff --git a/ngap/procedure_names.go b/ngap/procedure_names.go index 8af67c34c6..fe8006b39a 100644 --- a/ngap/procedure_names.go +++ b/ngap/procedure_names.go @@ -93,6 +93,12 @@ var procedureNames = map[ProcedureCode]string{ ProcMTCommunicationHandling: "MTCommunicationHandling", ProcRANPagingRequest: "RANPagingRequest", ProcBroadcastSessionTransport: "BroadcastSessionTransport", + ProcNGRemoval: "NGRemoval", + ProcInventoryRequest: "InventoryRequest", + ProcInventoryReport: "InventoryReport", + ProcCommandRequest: "CommandRequest", + ProcAIOTSessionRelease: "AIOTSessionRelease", + ProcAIOTSessionReleaseRequest: "AIOTSessionReleaseRequest", } // ProcedureCodeName returns the TS 38.413 name of p, and whether it is known. diff --git a/ngap/pws_overload_test.go b/ngap/pws_overload_test.go index a73e2b7181..611b63f389 100644 --- a/ngap/pws_overload_test.go +++ b/ngap/pws_overload_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func pwsPLMN() PLMNIdentity { return PLMNIdentity{0x00, 0xf1, 0x10} } @@ -419,7 +420,7 @@ func TestPWSChoiceExtensionsArePreserved(t *testing.T) { t.Fatal(err) } - if err := encodeContainerField(w, ieField{ID: 999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00})}); err != nil { + if err := encodeContainerField(w, ieField{ID: 999, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00})}); err != nil { t.Fatal(err) } diff --git a/ngap/ran_config_update.go b/ngap/ran_config_update.go index cd61c7fe04..6f86c7141a 100644 --- a/ngap/ran_config_update.go +++ b/ngap/ran_config_update.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413 §9.2.6.4. Every IE is optional: §8.7.2.2 leaves the corresponding @@ -116,10 +117,10 @@ var rANConfigurationUpdateIEs = []ieSpec[RANConfigurationUpdate]{ return m.NGRANTNLAssociationToRemoveList, true }, }, - optionalExtension(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *RANConfigurationUpdate) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), - optionalExtension(IDExtendedRANNodeName, CriticalityIgnore, func(m *RANConfigurationUpdate) **ExtendedRANNodeName { return &m.ExtendedRANNodeName }), - optionalExtension(IDAdditionalULI, CriticalityIgnore, func(m *RANConfigurationUpdate) **AdditionalULI { return &m.AdditionalULI }), - optionalExtension(IDAIoTSupport, CriticalityReject, func(m *RANConfigurationUpdate) **AIoTSupport { return &m.AIoTSupport }), + apimpl.OptionalIE(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *RANConfigurationUpdate) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), + apimpl.OptionalIE(IDExtendedRANNodeName, CriticalityIgnore, func(m *RANConfigurationUpdate) **ExtendedRANNodeName { return &m.ExtendedRANNodeName }), + apimpl.OptionalIE(IDAdditionalULI, CriticalityIgnore, func(m *RANConfigurationUpdate) **AdditionalULI { return &m.AdditionalULI }), + apimpl.OptionalIE(IDAIoTSupport, CriticalityReject, func(m *RANConfigurationUpdate) **AIoTSupport { return &m.AIoTSupport }), } func (m *RANConfigurationUpdate) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/raw_pdu.go b/ngap/raw_pdu.go index c16f7a9adf..9c0a75e6bb 100644 --- a/ngap/raw_pdu.go +++ b/ngap/raw_pdu.go @@ -4,10 +4,8 @@ package ngap import ( - "iter" - - "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) var ( @@ -16,46 +14,14 @@ var ( ) type RawPDU struct { - m *ap.RawPDU[ProtocolIEID] + *ap.RawPDU[ProtocolIEID, ProcedureCode, TriggeringMessage] } func ParseRawPDU(b []byte) (*RawPDU, error) { - m, err := ap.ParseRawPDU[ProtocolIEID](profile, b) + m, err := apimpl.ParseRawPDU[ProtocolIEID, ProcedureCode, TriggeringMessage](profile, b) if err != nil { return nil, err } - return &RawPDU{m: m}, nil + return &RawPDU{m}, nil } - -func (p *RawPDU) Trigger() TriggeringMessage { return TriggeringMessage(p.m.Choice()) } - -func (p *RawPDU) ProcedureCode() ProcedureCode { return ProcedureCode(p.m.ProcedureCode()) } - -func (p *RawPDU) Criticality() Criticality { return p.m.Criticality() } - -func (p *RawPDU) Opaque() bool { return p.m.Opaque() } - -func (p *RawPDU) Body() []byte { return p.m.Body() } - -func (p *RawPDU) Len() int { return p.m.Len() } - -func (p *RawPDU) IE(i int) (RawIE, error) { return p.m.Field(i) } - -func (p *RawPDU) IEs() []RawIE { return p.m.Fields() } - -func (p *RawPDU) All(id ProtocolIEID) iter.Seq2[int, RawIE] { return p.m.All(id) } - -func (p *RawPDU) Index(id ProtocolIEID) (int, error) { return p.m.Index(id) } - -func (p *RawPDU) SetValue(i int, value []byte) error { return p.m.SetValue(i, value) } - -func (p *RawPDU) Insert(i int, ie RawIE) error { return p.m.Insert(i, ie) } - -func (p *RawPDU) Remove(i int) error { return p.m.Remove(i) } - -func (p *RawPDU) Marshal() ([]byte, error) { return p.m.Marshal() } - -func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { return p.m.Get(id, v) } - -func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { return p.m.Set(id, v) } diff --git a/ngap/raw_pdu_test.go b/ngap/raw_pdu_test.go index 988edcba11..bebfdd3190 100644 --- a/ngap/raw_pdu_test.go +++ b/ngap/raw_pdu_test.go @@ -9,6 +9,7 @@ import ( "encoding/hex" "errors" "fmt" + "maps" "os" "os/exec" "path/filepath" @@ -20,7 +21,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type corpusPDU struct { @@ -37,6 +38,17 @@ type typedMessage interface { Marshal() ([]byte, error) } +var corpusWithoutTypedCodec = map[typedKey]bool{} + +var corpusRefusedByTypedCodec = map[string]string{ + "corpus.txt:10": "ngap: InitialContextSetup (14): protocol: abstract-syntax-error-falsely-constructed-message (5)", + "corpus.txt:28": "ngap: InitialContextSetup (14): protocol: abstract-syntax-error-falsely-constructed-message (5)", + "corpus.txt:39": "ngap: InitialContextSetup (14): protocol: abstract-syntax-error-falsely-constructed-message (5)", + "corpus.txt:48": "ngap: InitialContextSetup (14): protocol: abstract-syntax-error-falsely-constructed-message (5)", + "corpus.txt:57": "ngap: InitialContextSetup (14): protocol: abstract-syntax-error-falsely-constructed-message (5)", + "corpus.txt:64": "ngap: InitialContextSetup (14): protocol: abstract-syntax-error-falsely-constructed-message (5)", +} + var hexLiteral = regexp.MustCompile(`"([0-9a-fA-F]{8,})"`) func loadCorpus(t testing.TB) []corpusPDU { @@ -270,8 +282,51 @@ func withEnvelopeOf(t *testing.T, re []byte, orig PDU) []byte { return b } +type corpusSkips struct { + unmodeled map[typedKey]bool + refused map[string]string +} + +func (s *corpusSkips) codec(c corpusPDU, pdu PDU) (func([]byte) (typedMessage, error), bool) { + key := typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()} + + codec, ok := typedCodecs[key] + if !ok { + s.unmodeled[key] = true + + return nil, false + } + + if _, err := codec(pdu.value()); err != nil { + s.refused[c.source] = err.Error() + + return nil, false + } + + return codec, true +} + +func (s *corpusSkips) check(t *testing.T) { + t.Helper() + + if !maps.Equal(s.unmodeled, corpusWithoutTypedCodec) { + t.Errorf("corpus PDUs without a typed codec %v, want %v", slices.Collect(maps.Keys(s.unmodeled)), slices.Collect(maps.Keys(corpusWithoutTypedCodec))) + } + + if !maps.Equal(s.refused, corpusRefusedByTypedCodec) { + t.Errorf("corpus PDUs the typed codec refuses %q, want %q", s.refused, corpusRefusedByTypedCodec) + } +} + +func newCorpusSkips() *corpusSkips { + return &corpusSkips{unmodeled: map[typedKey]bool{}, refused: map[string]string{}} +} + func TestTypedCodecReencodesCorpusExactly(t *testing.T) { - var exact, envelope, refused int + var exact, envelope int + + skips := newCorpusSkips() + defer skips.check(t) for _, c := range loadCorpus(t) { pdu, err := Unmarshal(c.b) @@ -279,16 +334,14 @@ func TestTypedCodecReencodesCorpusExactly(t *testing.T) { t.Fatal(err) } - codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + codec, ok := skips.codec(c, pdu) if !ok { continue } msg, err := codec(pdu.value()) if err != nil { - refused++ - - continue + t.Fatal(err) } re, err := msg.Marshal() @@ -311,7 +364,7 @@ func TestTypedCodecReencodesCorpusExactly(t *testing.T) { exact++ } - t.Logf("%d re-encoded byte for byte (%d of them under a procedure criticality other than the wire's), %d refused", exact, envelope, refused) + t.Logf("%d re-encoded byte for byte (%d of them under a procedure criticality other than the wire's)", exact, envelope) if exact < 20 { t.Fatalf("only %d corpus PDUs re-encoded", exact) @@ -319,7 +372,10 @@ func TestTypedCodecReencodesCorpusExactly(t *testing.T) { } func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { - var compared, refused, unmodeled int + var compared int + + skips := newCorpusSkips() + defer skips.check(t) for _, c := range loadCorpus(t) { pdu, err := Unmarshal(c.b) @@ -327,9 +383,8 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { t.Fatal(err) } - codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + codec, ok := skips.codec(c, pdu) if !ok { - unmodeled++ continue } @@ -346,8 +401,7 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { for _, v := range ueIDValues[s.field] { msg, err := codec(pdu.value()) if err != nil { - refused++ - break + t.Fatal(err) } re, err := msg.Marshal() @@ -392,7 +446,7 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { } } - t.Logf("compared %d splices with the typed codec; typed codec skipped: %d refused, %d unmodeled", compared, refused, unmodeled) + t.Logf("compared %d splices with the typed codec", compared) if compared < 20 { t.Fatalf("only %d comparisons", compared) @@ -719,9 +773,9 @@ func TestRawPDUUnmodeledProcedure(t *testing.T) { body.WriteBit(false) if err := encodeIEContainer(body, per.Aligned, []ieField{ - {ID: 60000, Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0xde, 0xad})}, - {ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(id)}, - {ID: 60001, Criticality: CriticalityIgnore, Value: ap.RawValue(bytes.Repeat([]byte{0xbe}, 200))}, + {ID: 60000, Criticality: CriticalityNotify, Value: apimpl.RawValue([]byte{0xde, 0xad})}, + {ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(id)}, + {ID: 60001, Criticality: CriticalityIgnore, Value: apimpl.RawValue(bytes.Repeat([]byte{0xbe}, 200))}, }); err != nil { t.Fatal(err) } diff --git a/ngap/raw_pdu_ue_ids_test.go b/ngap/raw_pdu_ue_ids_test.go index 047de5a96a..e9e2c86137 100644 --- a/ngap/raw_pdu_ue_ids_test.go +++ b/ngap/raw_pdu_ue_ids_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func handUEContextReleaseCommand(t *testing.T, ran uint32) []byte { @@ -40,8 +40,8 @@ func handUEContextReleaseCommand(t *testing.T, ran uint32) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, enc, []ieField{ - {ID: IDUENGAPIDs, Criticality: CriticalityReject, Value: ap.RawValue(ids.Bytes())}, - {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, + {ID: IDUENGAPIDs, Criticality: CriticalityReject, Value: apimpl.RawValue(ids.Bytes())}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: apimpl.RawValue(cause)}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUEContextRelease, Criticality: CriticalityReject, Value: body.Bytes()}) diff --git a/ngap/reset_extensions_test.go b/ngap/reset_extensions_test.go index a272a30a9a..03dc1254eb 100644 --- a/ngap/reset_extensions_test.go +++ b/ngap/reset_extensions_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type handItem struct { @@ -93,8 +93,8 @@ func handNGReset(t *testing.T, items []handItem) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, - {ID: IDResetType, Criticality: CriticalityReject, Value: ap.RawValue(rt.Bytes())}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: apimpl.RawValue(cause)}, + {ID: IDResetType, Criticality: CriticalityReject, Value: apimpl.RawValue(rt.Bytes())}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcNGReset, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -112,7 +112,7 @@ func handNGResetAck(t *testing.T, items []handItem) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {ID: IDUEAssociatedLogicalNGConnectionList, Criticality: CriticalityIgnore, Value: ap.RawValue(list.Bytes())}, + {ID: IDUEAssociatedLogicalNGConnectionList, Criticality: CriticalityIgnore, Value: apimpl.RawValue(list.Bytes())}, })) b, err := Marshal(&SuccessfulOutcome{ProcedureCode: ProcNGReset, Criticality: CriticalityReject, Value: body.Bytes()}) diff --git a/ngap/struct_compare_test.go b/ngap/struct_compare_test.go new file mode 100644 index 0000000000..f4f7e8306e --- /dev/null +++ b/ngap/struct_compare_test.go @@ -0,0 +1,107 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ngap + +import ( + "go/ast" + "go/importer" + "go/parser" + "go/token" + "go/types" + "path/filepath" + "reflect" + "strings" + "testing" +) + +func holdsReference(t types.Type, seen map[types.Type]bool) bool { + if seen[t] { + return false + } + + seen[t] = true + + switch u := t.Underlying().(type) { + case *types.Pointer, *types.Slice, *types.Map, *types.Signature, *types.Interface, *types.Chan: + return true + case *types.Array: + return holdsReference(u.Elem(), seen) + case *types.Struct: + for i := range u.NumFields() { + if holdsReference(u.Field(i).Type(), seen) { + return true + } + } + } + + return false +} + +func comparesByReference(t types.Type) bool { + n, ok := t.(*types.Named) + if !ok || n.Obj().Pkg() == nil { + return false + } + + if _, ok := t.Underlying().(*types.Struct); !ok { + return false + } + + return strings.HasPrefix(n.Obj().Pkg().Path(), "github.com/ellanetworks/core/") && holdsReference(t, map[types.Type]bool{}) +} + +func TestNoEqualityOperatorOnReferenceHoldingStructs(t *testing.T) { + if testing.Short() { + t.Skip("type-checks the package from source") + } + + names, err := filepath.Glob("*.go") + if err != nil { + t.Fatal(err) + } + + fset := token.NewFileSet() + pkgName := reflect.TypeFor[ProtocolIEID]().PkgPath() + + var files []*ast.File + + for _, name := range names { + f, err := parser.ParseFile(fset, name, nil, 0) + if err != nil { + t.Fatal(err) + } + + if f.Name.Name == filepath.Base(pkgName) { + files = append(files, f) + } + } + + info := &types.Info{Types: map[ast.Expr]types.TypeAndValue{}} + conf := types.Config{Importer: importer.ForCompiler(fset, "source", nil)} + + if _, err := conf.Check(pkgName, fset, files, info); err != nil { + t.Fatal(err) + } + + for _, f := range files { + ast.Inspect(f, func(n ast.Node) bool { + switch x := n.(type) { + case *ast.BinaryExpr: + if x.Op != token.EQL && x.Op != token.NEQ { + return true + } + + if ty := info.TypeOf(x.X); ty != nil && comparesByReference(ty) { + t.Errorf("%s: %s on %s compares pointers, not values: use Equal", fset.Position(x.OpPos), x.Op, ty) + } + case *ast.MapType: + if ty := info.TypeOf(x.Key); ty != nil && comparesByReference(ty) { + t.Errorf("%s: map keyed by %s compares pointers, not values", fset.Position(x.Pos()), ty) + } + } + + return true + }) + } +} diff --git a/ngap/table_order_test.go b/ngap/table_order_test.go index 780c5feb84..c1f4a22abf 100644 --- a/ngap/table_order_test.go +++ b/ngap/table_order_test.go @@ -4,113 +4,163 @@ package ngap import ( + "reflect" "slices" "testing" ) -// TestTableOrderMatchesASN1 pins the IEs each table models to their relative -// order in the message's NGAP-PROTOCOL-IES container (TS 38.413 §9.4.5), which -// is the order encode emits them in. IEs a table does not model are not pinned. -func TestTableOrderMatchesASN1(t *testing.T) { - tests := []struct { - name string - got []tableRowSpec - asn1 string - container string - }{ - {"AMFStatusIndication", tableRows(aMFStatusIndicationIEs), "AMFStatusIndication", "ProtocolIE-Container"}, - {"ErrorIndication", tableRows(errorIndicationIEs), "ErrorIndication", "ProtocolIE-Container"}, - {"NGReset", tableRows(nGResetIEs), "NGReset", "ProtocolIE-Container"}, - {"NGResetAcknowledge", tableRows(nGResetAcknowledgeIEs), "NGResetAcknowledge", "ProtocolIE-Container"}, - {"NGSetupRequest", tableRows(nGSetupRequestIEs), "NGSetupRequest", "ProtocolIE-Container"}, - {"NGSetupResponse", tableRows(nGSetupResponseIEs), "NGSetupResponse", "ProtocolIE-Container"}, - {"NGSetupFailure", tableRows(nGSetupFailureIEs), "NGSetupFailure", "ProtocolIE-Container"}, - {"NASNonDeliveryIndication", tableRows(nASNonDeliveryIndicationIEs), "NASNonDeliveryIndication", "ProtocolIE-Container"}, - {"InitialUEMessage", tableRows(initialUEMessageIEs), "InitialUEMessage", "ProtocolIE-Container"}, - {"DownlinkNASTransport", tableRows(downlinkNASTransportIEs), "DownlinkNASTransport", "ProtocolIE-Container"}, - {"UplinkNASTransport", tableRows(uplinkNASTransportIEs), "UplinkNASTransport", "ProtocolIE-Container"}, - {"InitialContextSetupRequest", tableRows(initialContextSetupRequestIEs), "InitialContextSetupRequest", "ProtocolIE-Container"}, - {"InitialContextSetupResponse", tableRows(initialContextSetupResponseIEs), "InitialContextSetupResponse", "ProtocolIE-Container"}, - {"InitialContextSetupFailure", tableRows(initialContextSetupFailureIEs), "InitialContextSetupFailure", "ProtocolIE-Container"}, - {"HandoverRequired", tableRows(handoverRequiredIEs), "HandoverRequired", "ProtocolIE-Container"}, - {"HandoverCommand", tableRows(handoverCommandIEs), "HandoverCommand", "ProtocolIE-Container"}, - {"HandoverPreparationFailure", tableRows(handoverPreparationFailureIEs), "HandoverPreparationFailure", "ProtocolIE-Container"}, - {"HandoverRequest", tableRows(handoverRequestIEs), "HandoverRequest", "ProtocolIE-Container"}, - {"HandoverRequestAcknowledge", tableRows(handoverRequestAcknowledgeIEs), "HandoverRequestAcknowledge", "ProtocolIE-Container"}, - {"HandoverFailure", tableRows(handoverFailureIEs), "HandoverFailure", "ProtocolIE-Container"}, - {"DownlinkUEAssociatedNRPPaTransport", tableRows(downlinkUEAssociatedNRPPaTransportIEs), "DownlinkUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, - {"UplinkUEAssociatedNRPPaTransport", tableRows(uplinkUEAssociatedNRPPaTransportIEs), "UplinkUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, - {"DownlinkNonUEAssociatedNRPPaTransport", tableRows(downlinkNonUEAssociatedNRPPaTransportIEs), "DownlinkNonUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, - {"UplinkNonUEAssociatedNRPPaTransport", tableRows(uplinkNonUEAssociatedNRPPaTransportIEs), "UplinkNonUEAssociatedNRPPaTransport", "ProtocolIE-Container"}, - {"LocationReport", tableRows(locationReportIEs), "LocationReport", "ProtocolIE-Container"}, - {"LocationReportingControl", tableRows(locationReportingControlIEs), "LocationReportingControl", "ProtocolIE-Container"}, - {"PathSwitchRequest", tableRows(pathSwitchRequestIEs), "PathSwitchRequest", "ProtocolIE-Container"}, - {"PathSwitchRequestAcknowledge", tableRows(pathSwitchRequestAcknowledgeIEs), "PathSwitchRequestAcknowledge", "ProtocolIE-Container"}, - {"PathSwitchRequestFailure", tableRows(pathSwitchRequestFailureIEs), "PathSwitchRequestFailure", "ProtocolIE-Container"}, - {"UplinkRANStatusTransfer", tableRows(uplinkRANStatusTransferIEs), "UplinkRANStatusTransfer", "ProtocolIE-Container"}, - {"DownlinkRANStatusTransfer", tableRows(downlinkRANStatusTransferIEs), "DownlinkRANStatusTransfer", "ProtocolIE-Container"}, - {"HandoverNotify", tableRows(handoverNotifyIEs), "HandoverNotify", "ProtocolIE-Container"}, - {"TraceStart", tableRows(traceStartIEs), "TraceStart", "ProtocolIE-Container"}, - {"TraceFailureIndication", tableRows(traceFailureIndicationIEs), "TraceFailureIndication", "ProtocolIE-Container"}, - {"HandoverCancel", tableRows(handoverCancelIEs), "HandoverCancel", "ProtocolIE-Container"}, - {"HandoverCancelAcknowledge", tableRows(handoverCancelAcknowledgeIEs), "HandoverCancelAcknowledge", "ProtocolIE-Container"}, - {"PDUSessionResourceNotify", tableRows(pDUSessionResourceNotifyIEs), "PDUSessionResourceNotify", "ProtocolIE-Container"}, - {"PDUSessionResourceModifyIndication", tableRows(pDUSessionResourceModifyIndicationIEs), "PDUSessionResourceModifyIndication", "ProtocolIE-Container"}, - {"PDUSessionResourceModifyConfirm", tableRows(pDUSessionResourceModifyConfirmIEs), "PDUSessionResourceModifyConfirm", "ProtocolIE-Container"}, - {"PDUSessionResourceModifyRequest", tableRows(pDUSessionResourceModifyRequestIEs), "PDUSessionResourceModifyRequest", "ProtocolIE-Container"}, - {"PDUSessionResourceModifyResponse", tableRows(pDUSessionResourceModifyResponseIEs), "PDUSessionResourceModifyResponse", "ProtocolIE-Container"}, - {"PDUSessionResourceReleaseCommand", tableRows(pDUSessionResourceReleaseCommandIEs), "PDUSessionResourceReleaseCommand", "ProtocolIE-Container"}, - {"PDUSessionResourceReleaseResponse", tableRows(pDUSessionResourceReleaseResponseIEs), "PDUSessionResourceReleaseResponse", "ProtocolIE-Container"}, - {"PDUSessionResourceSetupRequest", tableRows(pDUSessionResourceSetupRequestIEs), "PDUSessionResourceSetupRequest", "ProtocolIE-Container"}, - {"PDUSessionResourceSetupResponse", tableRows(pDUSessionResourceSetupResponseIEs), "PDUSessionResourceSetupResponse", "ProtocolIE-Container"}, - {"UERadioCapabilityInfoIndication", tableRows(uERadioCapabilityInfoIndicationIEs), "UERadioCapabilityInfoIndication", "ProtocolIE-Container"}, - {"UEContextModificationRequest", tableRows(uEContextModificationRequestIEs), "UEContextModificationRequest", "ProtocolIE-Container"}, - {"UEContextModificationResponse", tableRows(uEContextModificationResponseIEs), "UEContextModificationResponse", "ProtocolIE-Container"}, - {"UEContextModificationFailure", tableRows(uEContextModificationFailureIEs), "UEContextModificationFailure", "ProtocolIE-Container"}, - {"UEContextReleaseRequest", tableRows(uEContextReleaseRequestIEs), "UEContextReleaseRequest", "ProtocolIE-Container"}, - {"UEContextReleaseCommand", tableRows(uEContextReleaseCommandIEs), "UEContextReleaseCommand", "ProtocolIE-Container"}, - {"UEContextReleaseComplete", tableRows(uEContextReleaseCompleteIEs), "UEContextReleaseComplete", "ProtocolIE-Container"}, - {"Paging", tableRows(pagingIEs), "Paging", "ProtocolIE-Container"}, - {"RANConfigurationUpdate", tableRows(rANConfigurationUpdateIEs), "RANConfigurationUpdate", "ProtocolIE-Container"}, - {"AMFConfigurationUpdate", tableRows(aMFConfigurationUpdateIEs), "AMFConfigurationUpdate", "ProtocolIE-Container"}, - {"PLMNSupportItem extensions", tableRows(extIEsPLMNSupportItem), "PLMNSupportItem", "ProtocolExtensionContainer"}, - {"AMFTNLAssociationToRemoveItem extensions", tableRows(extIEsAMFTNLAssociationToRemoveItem), "AMF-TNLAssociationToRemoveItem", "ProtocolExtensionContainer"}, - {"ServedGUAMIItem extensions", tableRows(extIEsServedGUAMIItem), "ServedGUAMIItem", "ProtocolExtensionContainer"}, - {"UnavailableGUAMIItem extensions", tableRows(extIEsUnavailableGUAMIItem), "UnavailableGUAMIItem", "ProtocolExtensionContainer"}, - {"OverloadStart", tableRows(overloadStartIEs), "OverloadStart", "ProtocolIE-Container"}, - {"OverloadStop", tableRows(overloadStopIEs), "OverloadStop", "ProtocolIE-Container"}, - {"AMFConfigurationUpdateAcknowledge", tableRows(aMFConfigurationUpdateAcknowledgeIEs), "AMFConfigurationUpdateAcknowledge", "ProtocolIE-Container"}, - {"UETNLABindingReleaseRequest", tableRows(uETNLABindingReleaseRequestIEs), "UETNLABindingReleaseRequest", "ProtocolIE-Container"}, - {"AMFConfigurationUpdateFailure", tableRows(aMFConfigurationUpdateFailureIEs), "AMFConfigurationUpdateFailure", "ProtocolIE-Container"}, - {"RANConfigurationUpdateAcknowledge", tableRows(rANConfigurationUpdateAcknowledgeIEs), "RANConfigurationUpdateAcknowledge", "ProtocolIE-Container"}, - {"UplinkRANConfigurationTransfer", tableRows(uplinkRANConfigurationTransferIEs), "UplinkRANConfigurationTransfer", "ProtocolIE-Container"}, - {"DownlinkRANConfigurationTransfer", tableRows(downlinkRANConfigurationTransferIEs), "DownlinkRANConfigurationTransfer", "ProtocolIE-Container"}, - {"RANConfigurationUpdateFailure", tableRows(rANConfigurationUpdateFailureIEs), "RANConfigurationUpdateFailure", "ProtocolIE-Container"}, +type tableCase struct { + asn1 string + rows []tableRowSpec + typ reflect.Type +} + +func ieTable[M any](asn1 string, table []ieSpec[M]) tableCase { + return tableCase{asn1: asn1, rows: tableRows(table), typ: reflect.TypeFor[M]()} +} + +func tableCases() []tableCase { + return []tableCase{ + ieTable("AMFConfigurationUpdate", aMFConfigurationUpdateIEs), + ieTable("AMFConfigurationUpdateAcknowledge", aMFConfigurationUpdateAcknowledgeIEs), + ieTable("AMFConfigurationUpdateFailure", aMFConfigurationUpdateFailureIEs), + ieTable("AMFStatusIndication", aMFStatusIndicationIEs), + ieTable("DownlinkNASTransport", downlinkNASTransportIEs), + ieTable("DownlinkUEAssociatedNRPPaTransport", downlinkUEAssociatedNRPPaTransportIEs), + ieTable("UplinkUEAssociatedNRPPaTransport", uplinkUEAssociatedNRPPaTransportIEs), + ieTable("DownlinkNonUEAssociatedNRPPaTransport", downlinkNonUEAssociatedNRPPaTransportIEs), + ieTable("UplinkNonUEAssociatedNRPPaTransport", uplinkNonUEAssociatedNRPPaTransportIEs), + ieTable("DownlinkRANConfigurationTransfer", downlinkRANConfigurationTransferIEs), + ieTable("DownlinkRANStatusTransfer", downlinkRANStatusTransferIEs), + ieTable("ErrorIndication", errorIndicationIEs), + ieTable("HandoverCancel", handoverCancelIEs), + ieTable("HandoverCancelAcknowledge", handoverCancelAcknowledgeIEs), + ieTable("HandoverCommand", handoverCommandIEs), + ieTable("HandoverFailure", handoverFailureIEs), + ieTable("HandoverNotify", handoverNotifyIEs), + ieTable("HandoverPreparationFailure", handoverPreparationFailureIEs), + ieTable("HandoverRequest", handoverRequestIEs), + ieTable("HandoverRequestAcknowledge", handoverRequestAcknowledgeIEs), + ieTable("HandoverRequired", handoverRequiredIEs), + ieTable("InitialContextSetupFailure", initialContextSetupFailureIEs), + ieTable("InitialContextSetupRequest", initialContextSetupRequestIEs), + ieTable("InitialContextSetupResponse", initialContextSetupResponseIEs), + ieTable("InitialUEMessage", initialUEMessageIEs), + ieTable("LocationReport", locationReportIEs), + ieTable("LocationReportingControl", locationReportingControlIEs), + ieTable("NASNonDeliveryIndication", nASNonDeliveryIndicationIEs), + ieTable("NGReset", nGResetIEs), + ieTable("NGResetAcknowledge", nGResetAcknowledgeIEs), + ieTable("NGSetupFailure", nGSetupFailureIEs), + ieTable("NGSetupRequest", nGSetupRequestIEs), + ieTable("NGSetupResponse", nGSetupResponseIEs), + ieTable("OverloadStart", overloadStartIEs), + ieTable("OverloadStop", overloadStopIEs), + ieTable("PDUSessionResourceModifyConfirm", pDUSessionResourceModifyConfirmIEs), + ieTable("PDUSessionResourceModifyIndication", pDUSessionResourceModifyIndicationIEs), + ieTable("PDUSessionResourceModifyRequest", pDUSessionResourceModifyRequestIEs), + ieTable("PDUSessionResourceModifyResponse", pDUSessionResourceModifyResponseIEs), + ieTable("PDUSessionResourceNotify", pDUSessionResourceNotifyIEs), + ieTable("PDUSessionResourceReleaseCommand", pDUSessionResourceReleaseCommandIEs), + ieTable("PDUSessionResourceReleaseResponse", pDUSessionResourceReleaseResponseIEs), + ieTable("PDUSessionResourceSetupRequest", pDUSessionResourceSetupRequestIEs), + ieTable("PDUSessionResourceSetupResponse", pDUSessionResourceSetupResponseIEs), + ieTable("PWSCancelRequest", pWSCancelRequestIEs), + ieTable("PWSCancelResponse", pWSCancelResponseIEs), + ieTable("PWSFailureIndication", pWSFailureIndicationIEs), + ieTable("PWSRestartIndication", pWSRestartIndicationIEs), + ieTable("Paging", pagingIEs), + ieTable("PathSwitchRequest", pathSwitchRequestIEs), + ieTable("PathSwitchRequestAcknowledge", pathSwitchRequestAcknowledgeIEs), + ieTable("PathSwitchRequestFailure", pathSwitchRequestFailureIEs), + ieTable("RANConfigurationUpdate", rANConfigurationUpdateIEs), + ieTable("RANConfigurationUpdateAcknowledge", rANConfigurationUpdateAcknowledgeIEs), + ieTable("RANConfigurationUpdateFailure", rANConfigurationUpdateFailureIEs), + ieTable("RerouteNASRequest", rerouteNASRequestIEs), + ieTable("TraceFailureIndication", traceFailureIndicationIEs), + ieTable("TraceStart", traceStartIEs), + ieTable("UEContextModificationFailure", uEContextModificationFailureIEs), + ieTable("UEContextModificationRequest", uEContextModificationRequestIEs), + ieTable("UEContextModificationResponse", uEContextModificationResponseIEs), + ieTable("UEContextReleaseCommand", uEContextReleaseCommandIEs), + ieTable("UEContextReleaseComplete", uEContextReleaseCompleteIEs), + ieTable("UEContextReleaseRequest", uEContextReleaseRequestIEs), + ieTable("UERadioCapabilityInfoIndication", uERadioCapabilityInfoIndicationIEs), + ieTable("UETNLABindingReleaseRequest", uETNLABindingReleaseRequestIEs), + ieTable("UplinkNASTransport", uplinkNASTransportIEs), + ieTable("UplinkRANConfigurationTransfer", uplinkRANConfigurationTransferIEs), + ieTable("UplinkRANStatusTransfer", uplinkRANStatusTransferIEs), + ieTable("WriteReplaceWarningRequest", writeReplaceWarningRequestIEs), + ieTable("WriteReplaceWarningResponse", writeReplaceWarningResponseIEs), // The §9.3.4 transfer containers reuse the ProtocolIE-Container shape, so // their rows are ordered by the same rule. - {"PDUSessionResourceSetupRequestTransfer", tableRows(pDUSessionResourceSetupRequestTransferIEs), "PDUSessionResourceSetupRequestTransfer", "ProtocolIE-Container"}, - {"PDUSessionResourceModifyRequestTransfer", tableRows(pDUSessionResourceModifyRequestTransferIEs), "PDUSessionResourceModifyRequestTransfer", "ProtocolIE-Container"}, - {"PDUSessionResourceSetupResponseTransfer extensions", tableRows(extIEsPDUSessionResourceSetupResponseTransfer), "PDUSessionResourceSetupResponseTransfer", "ProtocolExtensionContainer"}, - {"PDUSessionResourceModifyResponseTransfer extensions", tableRows(extIEsPDUSessionResourceModifyResponseTransfer), "PDUSessionResourceModifyResponseTransfer", "ProtocolExtensionContainer"}, - {"PDUSessionResourceModifyIndicationTransfer extensions", tableRows(extIEsPDUSessionResourceModifyIndicationTransfer), "PDUSessionResourceModifyIndicationTransfer", "ProtocolExtensionContainer"}, - {"PDUSessionResourceModifyConfirmTransfer extensions", tableRows(extIEsPDUSessionResourceModifyConfirmTransfer), "PDUSessionResourceModifyConfirmTransfer", "ProtocolExtensionContainer"}, - {"PathSwitchRequestTransfer extensions", tableRows(extIEsPathSwitchRequestTransfer), "PathSwitchRequestTransfer", "ProtocolExtensionContainer"}, - {"PathSwitchRequestAcknowledgeTransfer extensions", tableRows(extIEsPathSwitchRequestAcknowledgeTransfer), "PathSwitchRequestAcknowledgeTransfer", "ProtocolExtensionContainer"}, - {"HandoverRequestAcknowledgeTransfer extensions", tableRows(extIEsHandoverRequestAcknowledgeTransfer), "HandoverRequestAcknowledgeTransfer", "ProtocolExtensionContainer"}, - {"HandoverCommandTransfer extensions", tableRows(extIEsHandoverCommandTransfer), "HandoverCommandTransfer", "ProtocolExtensionContainer"}, - {"UL-NGU-UP-TNLModifyItem extensions", tableRows(extIEsULNGUUPTNLModifyItem), "UL-NGU-UP-TNLModifyItem", "ProtocolExtensionContainer"}, - {"AdditionalDLUPTNLInformationForHOItem extensions", tableRows(extIEsAdditionalDLUPTNLInformationForHOItem), "AdditionalDLUPTNLInformationForHOItem", "ProtocolExtensionContainer"}, - {"QosFlowAddOrModifyRequestItem extensions", tableRows(extIEsQosFlowAddOrModifyRequestItem), "QosFlowAddOrModifyRequestItem", "ProtocolExtensionContainer"}, - {"QosFlowAddOrModifyResponseItem extensions", tableRows(extIEsQosFlowAddOrModifyResponseItem), "QosFlowAddOrModifyResponseItem", "ProtocolExtensionContainer"}, + ieTable("PDUSessionResourceModifyRequestTransfer", pDUSessionResourceModifyRequestTransferIEs), + ieTable("PDUSessionResourceSetupRequestTransfer", pDUSessionResourceSetupRequestTransferIEs), } +} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - want := asn1Rows(t, tt.asn1, tt.container) - if !slices.Equal(tt.got, want) { - t.Fatalf("rows\n %v\nwant\n %v", tt.got, want) +// TestTableOrderMatchesASN1 pins each table to the ProtocolIE-Container rows of +// its message (TS 38.413 §9.4.5): every IE, its criticality and presence, in +// the order encode emits them in. +func TestTableOrderMatchesASN1(t *testing.T) { + for _, c := range tableCases() { + t.Run(c.asn1, func(t *testing.T) { + want := asn1Rows(t, c.asn1, "ProtocolIE-Container") + if !slices.Equal(c.rows, want) { + t.Fatalf("rows\n %v\nwant\n %v", c.rows, want) } }) } } + +func TestTableCasesAreComplete(t *testing.T) { + cases := tableCases() + + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ + } + + checkComplete(t, "IE table", scannedDecls(t).ieTables, types) +} + +func TestExtensionTableCasesAreComplete(t *testing.T) { + cases := extTableCases() + + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ + } + + checkComplete(t, "extension table", scannedDecls(t).extTables, types) +} + +func TestMessageCasesAreComplete(t *testing.T) { + messages := map[string]bool{} + + for _, ep := range elementaryProcedures(t) { + for _, m := range ep.messages { + if m != "" { + messages[m] = true + } + } + } + + declared := map[string]bool{} + + for _, c := range tableCases() { + if messages[c.asn1] { + declared[c.typ.Name()] = true + } + } + + cases := messageCases() + + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ + } + + checkComplete(t, "message", declared, types) +} diff --git a/ngap/testdata/fuzz/FuzzMessageLossless/aa6d9b4547ed086d b/ngap/testdata/fuzz/FuzzMessageLossless/aa6d9b4547ed086d new file mode 100644 index 0000000000..feea28cea4 --- /dev/null +++ b/ngap/testdata/fuzz/FuzzMessageLossless/aa6d9b4547ed086d @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("0\x00\x04000\x0200000\x03000000\x0f000000000000000000\x010") diff --git a/ngap/testdata/fuzz/FuzzMessageLossless/ed8137981a8dffa6 b/ngap/testdata/fuzz/FuzzMessageLossless/ed8137981a8dffa6 new file mode 100644 index 0000000000..754c197c18 --- /dev/null +++ b/ngap/testdata/fuzz/FuzzMessageLossless/ed8137981a8dffa6 @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("0\x00\x04000\x0200\x0000\x03\x000\x00000\x0f000000000000000000\x010") diff --git a/ngap/tnl_lossless_test.go b/ngap/tnl_lossless_test.go index 8b1e5af5c2..f8e69feb7b 100644 --- a/ngap/tnl_lossless_test.go +++ b/ngap/tnl_lossless_test.go @@ -15,7 +15,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const unknownExtensionID ProtocolIEID = 65000 @@ -1210,12 +1210,12 @@ const ( func TestTNLRequestTransfersKeepUnknownIEsAndAdditions(t *testing.T) { setup := tnlSetupRequestTransfer() - setup.Append(rawIE{ID: unknownExtensionID, Criticality: CriticalityIgnore, Value: []byte{0xde, 0xad}}) - setup.ExtensionAdditions = unknownAdditions(t) + setup.appendUnknown(rawIE{ID: unknownExtensionID, Criticality: CriticalityIgnore, Value: []byte{0xde, 0xad}}) + setup.setExtensionAdditions(unknownAdditions(t)) modify := tnlModifyRequestTransfer() - modify.Append(rawIE{ID: unknownExtensionID, Criticality: CriticalityNotify, Value: []byte{0xde, 0xad}}) - modify.ExtensionAdditions = unknownAdditions(t) + modify.appendUnknown(rawIE{ID: unknownExtensionID, Criticality: CriticalityNotify, Value: []byte{0xde, 0xad}}) + modify.setExtensionAdditions(unknownAdditions(t)) for _, c := range []struct { name string @@ -1267,7 +1267,7 @@ func TestTNLManyUnknownExtensionsKeptExactly(t *testing.T) { fields := make([]ieField, 0, 3*paddingIEs) for i := range 3 * paddingIEs { - fields = append(fields, ieField{ID: unknownExtensionID - ProtocolIEID(i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{byte(i)})}) + fields = append(fields, ieField{ID: unknownExtensionID - ProtocolIEID(i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{byte(i)})}) } w := per.NewWriter() @@ -1316,7 +1316,7 @@ func TestTNLRequestTransferKeepsManyUnknownIEs(t *testing.T) { } for i := range 3 * paddingIEs { - all = append(all, ieField{ID: unknownExtensionID - ProtocolIEID(i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{byte(i)})}) + all = append(all, ieField{ID: unknownExtensionID - ProtocolIEID(i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{byte(i)})}) } w := per.NewWriter() @@ -1342,7 +1342,7 @@ func TestTNLRequestTransferKeepsManyUnknownIEs(t *testing.T) { func TestMessageWithManyUnknownIEsReencodesLosslessly(t *testing.T) { fields := ngSetupFields() for i := range paddingIEs + 1 { - fields = append(fields, ieField{ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00})}) + fields = append(fields, ieField{ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00})}) } value := container(t, fields...) diff --git a/ngap/trace_test.go b/ngap/trace_test.go index 8a46e141f6..601e3c40e2 100644 --- a/ngap/trace_test.go +++ b/ngap/trace_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -103,7 +103,7 @@ func TestTraceActivationTraceCollectionEntityURIExtension(t *testing.T) { } if err := encodeExtensionContainer(want, per.Aligned, []ieField{ - {ID: IDTraceCollectionEntityURI, Criticality: CriticalityIgnore, Value: ap.RawValue(uri)}, + {ID: IDTraceCollectionEntityURI, Criticality: CriticalityIgnore, Value: apimpl.RawValue(uri)}, }); err != nil { t.Fatal(err) } diff --git a/ngap/transparent_container_test.go b/ngap/transparent_container_test.go index cf3e09f0ae..11691f1e8d 100644 --- a/ngap/transparent_container_test.go +++ b/ngap/transparent_container_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const goldenSourceNGRANContainer = "7001800040050501004000050140200145030002f8391234567890ff10320002f8390abcdef1800fff9ff604020b0002f83900001011000064" @@ -174,7 +174,7 @@ func handAdditions(t *testing.T, w *per.Writer) { func handChoiceExtension(t *testing.T, w *per.Writer) { t.Helper() - mustNil(t, encodeContainerField(w, ieField{ID: 998, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01, 0x02, 0x03})})) + mustNil(t, encodeContainerField(w, ieField{ID: 998, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x01, 0x02, 0x03})})) } func handSourceNGRANContainer(t *testing.T, extCrit Criticality) []byte { diff --git a/ngap/ue_context_modification.go b/ngap/ue_context_modification.go index 96a13605ce..eace89e378 100644 --- a/ngap/ue_context_modification.go +++ b/ngap/ue_context_modification.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) type UEContextModificationRequest struct { @@ -66,9 +67,9 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ }, Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.RANUENGAPID, true }, }, - optionalExtension(IDRANPagingPriority, CriticalityIgnore, func(m *UEContextModificationRequest) **RANPagingPriority { return &m.RANPagingPriority }), - optionalExtension(IDSecurityKey, CriticalityReject, func(m *UEContextModificationRequest) **SecurityKey { return &m.SecurityKey }), - optionalExtension(IDIndexToRFSP, CriticalityIgnore, func(m *UEContextModificationRequest) **IndexToRFSP { return &m.IndexToRFSP }), + apimpl.OptionalIE(IDRANPagingPriority, CriticalityIgnore, func(m *UEContextModificationRequest) **RANPagingPriority { return &m.RANPagingPriority }), + apimpl.OptionalIE(IDSecurityKey, CriticalityReject, func(m *UEContextModificationRequest) **SecurityKey { return &m.SecurityKey }), + apimpl.OptionalIE(IDIndexToRFSP, CriticalityIgnore, func(m *UEContextModificationRequest) **IndexToRFSP { return &m.IndexToRFSP }), { ID: IDUEAggregateMaximumBitRate, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { @@ -90,11 +91,11 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return m.UEAggregateMaximumBitRate, true }, }, - optionalExtension(IDUESecurityCapabilities, CriticalityReject, func(m *UEContextModificationRequest) **UESecurityCapabilities { return &m.UESecurityCapabilities }), - optionalExtension(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *UEContextModificationRequest) **CoreNetworkAssistanceInformationForInactive { + apimpl.OptionalIE(IDUESecurityCapabilities, CriticalityReject, func(m *UEContextModificationRequest) **UESecurityCapabilities { return &m.UESecurityCapabilities }), + apimpl.OptionalIE(IDCoreNetworkAssistanceInformationForInactive, CriticalityIgnore, func(m *UEContextModificationRequest) **CoreNetworkAssistanceInformationForInactive { return &m.CoreNetworkAssistanceInformationForInactive }), - optionalExtension(IDEmergencyFallbackIndicator, CriticalityReject, func(m *UEContextModificationRequest) **EmergencyFallbackIndicator { + apimpl.OptionalIE(IDEmergencyFallbackIndicator, CriticalityReject, func(m *UEContextModificationRequest) **EmergencyFallbackIndicator { return &m.EmergencyFallbackIndicator }), { @@ -118,57 +119,57 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return m.NewAMFUENGAPID, true }, }, - optionalExtension(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *UEContextModificationRequest) **RRCInactiveTransitionReportRequest { + apimpl.OptionalIE(IDRRCInactiveTransitionReportRequest, CriticalityIgnore, func(m *UEContextModificationRequest) **RRCInactiveTransitionReportRequest { return &m.RRCInactiveTransitionReportRequest }), - optionalExtension(IDNewGUAMI, CriticalityReject, func(m *UEContextModificationRequest) **GUAMI { return &m.NewGUAMI }), - optionalExtension(IDCNAssistedRANTuning, CriticalityIgnore, func(m *UEContextModificationRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), - optionalExtension(IDSRVCCOperationPossible, CriticalityIgnore, func(m *UEContextModificationRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), - optionalExtension(IDIABAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **IABAuthorized { return &m.IABAuthorized }), - optionalExtension(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), - optionalExtension(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), - optionalExtension(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDNewGUAMI, CriticalityReject, func(m *UEContextModificationRequest) **GUAMI { return &m.NewGUAMI }), + apimpl.OptionalIE(IDCNAssistedRANTuning, CriticalityIgnore, func(m *UEContextModificationRequest) **CNAssistedRANTuning { return &m.CNAssistedRANTuning }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *UEContextModificationRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDIABAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **IABAuthorized { return &m.IABAuthorized }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEV2XServicesAuthorized { return &m.LTEV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.NRUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEUESidelinkAggregateMaximumBitrate }), - optionalExtension(IDPC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), - optionalExtension(IDUERadioCapabilityID, CriticalityReject, func(m *UEContextModificationRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), - optionalExtension(IDRGLevelWirelineAccessCharacteristics, CriticalityIgnore, func(m *UEContextModificationRequest) **RGLevelWirelineAccessCharacteristics { + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *UEContextModificationRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + apimpl.OptionalIE(IDRGLevelWirelineAccessCharacteristics, CriticalityIgnore, func(m *UEContextModificationRequest) **RGLevelWirelineAccessCharacteristics { return &m.RGLevelWirelineAccessCharacteristics }), - optionalExtension(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), - optionalExtension(IDQMCConfigInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **QMCConfigInfo { return &m.QMCConfigInfo }), - optionalExtension(IDQMCDeactivation, CriticalityIgnore, func(m *UEContextModificationRequest) **QMCDeactivation { return &m.QMCDeactivation }), - listExtension(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *UEContextModificationRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), - listExtension(IDManagementBasedMDTPLMNModificationList, CriticalityIgnore, func(m *UEContextModificationRequest) *MDTPLMNModificationList { + apimpl.OptionalIE(IDTimeSyncAssistanceInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **TimeSyncAssistanceInfo { return &m.TimeSyncAssistanceInfo }), + apimpl.OptionalIE(IDQMCConfigInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **QMCConfigInfo { return &m.QMCConfigInfo }), + apimpl.OptionalIE(IDQMCDeactivation, CriticalityIgnore, func(m *UEContextModificationRequest) **QMCDeactivation { return &m.QMCDeactivation }), + apimpl.ListIE(IDUESliceMaximumBitRateList, CriticalityIgnore, func(m *UEContextModificationRequest) *UESliceMaximumBitRateList { return &m.UESliceMaximumBitRateList }), + apimpl.ListIE(IDManagementBasedMDTPLMNModificationList, CriticalityIgnore, func(m *UEContextModificationRequest) *MDTPLMNModificationList { return &m.ManagementBasedMDTPLMNModificationList }), - optionalExtension(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), - optionalExtension(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDFiveGProSeAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **FiveGProSeAuthorized { return &m.FiveGProSeAuthorized }), + apimpl.OptionalIE(IDFiveGProSeUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.FiveGProSeUEPC5AggregateMaximumBitRate }), - optionalExtension(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **FiveGProSePC5QoSParameters { + apimpl.OptionalIE(IDFiveGProSePC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **FiveGProSePC5QoSParameters { return &m.FiveGProSePC5QoSParameters }), - optionalExtension(IDNetworkControlledRepeaterAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NetworkControlledRepeaterAuthorized { + apimpl.OptionalIE(IDNetworkControlledRepeaterAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NetworkControlledRepeaterAuthorized { return &m.NetworkControlledRepeaterAuthorized }), - optionalExtension(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *UEContextModificationRequest) **AerialUEsubscriptionInformation { + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *UEContextModificationRequest) **AerialUEsubscriptionInformation { return &m.AerialUEsubscriptionInformation }), - optionalExtension(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), - optionalExtension(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), - optionalExtension(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDNRA2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NRA2XServicesAuthorized { return &m.NRA2XServicesAuthorized }), + apimpl.OptionalIE(IDLTEA2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEA2XServicesAuthorized { return &m.LTEA2XServicesAuthorized }), + apimpl.OptionalIE(IDNRA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { return &m.NRA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEUESidelinkAggregateMaximumBitrate { + apimpl.OptionalIE(IDLTEA2XUEPC5AggregateMaximumBitRate, CriticalityIgnore, func(m *UEContextModificationRequest) **LTEUESidelinkAggregateMaximumBitrate { return &m.LTEA2XUEPC5AggregateMaximumBitRate }), - optionalExtension(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), - optionalExtension(IDMobileIABAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), - optionalExtension(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **SLPositioningRangingServiceInfo { + apimpl.OptionalIE(IDA2XPC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **A2XPC5QoSParameters { return &m.A2XPC5QoSParameters }), + apimpl.OptionalIE(IDMobileIABAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **MobileIABAuthorized { return &m.MobileIABAuthorized }), + apimpl.OptionalIE(IDSLPositioningRangingServiceInfo, CriticalityIgnore, func(m *UEContextModificationRequest) **SLPositioningRangingServiceInfo { return &m.SLPositioningRangingServiceInfo }), } @@ -254,7 +255,7 @@ var uEContextModificationResponseIEs = []ieSpec[UEContextModificationResponse]{ return m.RANUENGAPID, true }, }, - optionalExtension(IDRRCState, CriticalityIgnore, func(m *UEContextModificationResponse) **RRCState { return &m.RRCState }), + apimpl.OptionalIE(IDRRCState, CriticalityIgnore, func(m *UEContextModificationResponse) **RRCState { return &m.RRCState }), { ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *UEContextModificationResponse, r *per.Reader, enc per.Encoding) error { diff --git a/ngap/ue_context_release.go b/ngap/ue_context_release.go index 1027faa982..e2b728eb24 100644 --- a/ngap/ue_context_release.go +++ b/ngap/ue_context_release.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // UE-NGAP-IDs ::= CHOICE { uE-NGAP-ID-pair, aMF-UE-NGAP-ID, choice-Extensions }. @@ -196,7 +197,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return m.UserLocationInformation, true }, }, - optionalExtension(IDInfoOnRecommendedCellsAndRANNodesForPaging, CriticalityIgnore, func(m *UEContextReleaseComplete) **InfoOnRecommendedCellsAndRANNodesForPaging { + apimpl.OptionalIE(IDInfoOnRecommendedCellsAndRANNodesForPaging, CriticalityIgnore, func(m *UEContextReleaseComplete) **InfoOnRecommendedCellsAndRANNodesForPaging { return &m.InfoOnRecommendedCellsAndRANNodesForPaging }), { @@ -233,7 +234,7 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return m.CriticalityDiagnostics, true }, }, - optionalExtension(IDPagingAssisDataforCEcapabUE, CriticalityIgnore, func(m *UEContextReleaseComplete) **PagingAssisDataforCEcapabUE { return &m.PagingAssisDataforCEcapabUE }), + apimpl.OptionalIE(IDPagingAssisDataforCEcapabUE, CriticalityIgnore, func(m *UEContextReleaseComplete) **PagingAssisDataforCEcapabUE { return &m.PagingAssisDataforCEcapabUE }), } func (m *UEContextReleaseComplete) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ue_context_release_test.go b/ngap/ue_context_release_test.go index a102f767ba..2a06d75ca0 100644 --- a/ngap/ue_context_release_test.go +++ b/ngap/ue_context_release_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden UE CONTEXT RELEASE PDUs. @@ -247,7 +247,7 @@ func TestUEContextReleaseCommandChoiceExtension(t *testing.T) { value := container(t, ieField{ ID: IDUENGAPIDs, Criticality: CriticalityReject, - Value: ap.RawValue(choiceExtensionValue(t, ueNGAPIDsAlternatives, ueNGAPIDsChoiceExtensions, IDUENGAPIDs)), + Value: apimpl.RawValue(choiceExtensionValue(t, ueNGAPIDsAlternatives, ueNGAPIDsChoiceExtensions, IDUENGAPIDs)), }) _, err := ParseUEContextReleaseCommand(value) @@ -264,9 +264,9 @@ func TestUEContextReleaseCommandChoiceExtension(t *testing.T) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } - if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDUENGAPIDs || - ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { - t.Errorf("diagnostics = %+v, want one not-understood entry for UE-NGAP-IDs", ase.IEs) + if len(ase.IEs) != 2 || ase.IEs[1].IEID != IDUENGAPIDs || + ase.IEs[1].TypeOfError != TypeOfErrorNotUnderstood { + t.Errorf("diagnostics = %+v, want the unknown choice-Extensions IE and then UE-NGAP-IDs", ase.IEs) } } @@ -302,7 +302,7 @@ func TestUEContextReleaseRequestGWContextReleaseIndicationExtensionRejects(t *te ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: Ptr(AMFUENGAPID(1))}, ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: Ptr(RANUENGAPID(2))}, ieField{ID: IDCause, Criticality: CriticalityIgnore, Value: &cause}, - ieField{ID: IDGWContextReleaseIndication, Criticality: CriticalityReject, Value: ap.RawValue(extensionEnum(t, int64(len(enumGWContextReleaseIndication.Root)), 0))}, + ieField{ID: IDGWContextReleaseIndication, Criticality: CriticalityReject, Value: apimpl.RawValue(extensionEnum(t, int64(len(enumGWContextReleaseIndication.Root)), 0))}, )) var ase *AbstractSyntaxError diff --git a/ngap/ue_radio_capability.go b/ngap/ue_radio_capability.go index 46b889122a..24f6dd97e1 100644 --- a/ngap/ue_radio_capability.go +++ b/ngap/ue_radio_capability.go @@ -5,6 +5,7 @@ package ngap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 38.413 §9.2.13.1. @@ -70,8 +71,8 @@ var uERadioCapabilityInfoIndicationIEs = []ieSpec[UERadioCapabilityInfoIndicatio return m.UERadioCapabilityForPaging, true }, }, - listExtension(IDUERadioCapabilityEUTRAFormat, CriticalityIgnore, func(m *UERadioCapabilityInfoIndication) *UERadioCapability { return &m.UERadioCapabilityEUTRAFormat }), - optionalExtension(IDXrDeviceWith2Rx, CriticalityIgnore, func(m *UERadioCapabilityInfoIndication) **XrDeviceWith2Rx { return &m.XrDeviceWith2Rx }), + apimpl.ListIE(IDUERadioCapabilityEUTRAFormat, CriticalityIgnore, func(m *UERadioCapabilityInfoIndication) *UERadioCapability { return &m.UERadioCapabilityEUTRAFormat }), + apimpl.OptionalIE(IDXrDeviceWith2Rx, CriticalityIgnore, func(m *UERadioCapabilityInfoIndication) **XrDeviceWith2Rx { return &m.XrDeviceWith2Rx }), } func (m *UERadioCapabilityInfoIndication) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/ngap/ue_radio_capability_test.go b/ngap/ue_radio_capability_test.go index 78c3a6d5fa..4da6d93703 100644 --- a/ngap/ue_radio_capability_test.go +++ b/ngap/ue_radio_capability_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Golden UE RADIO CAPABILITY INFO INDICATION PDUs. @@ -125,8 +125,8 @@ func TestUERadioCapabilityInfoIndicationPaging(t *testing.T) { // without it is still delivered and the absence reported (§10.3.5). func TestUERadioCapabilityInfoIndicationWithoutCapability(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDRANUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(RANUENGAPID(2))))}, ) msg, err := ParseUERadioCapabilityInfoIndication(value) @@ -148,8 +148,8 @@ func TestUERadioCapabilityInfoIndicationWithoutCapability(t *testing.T) { // missing one (§10.3.5). func TestUERadioCapabilityInfoIndicationMissingRejectIE(t *testing.T) { value := container(t, - ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, - ieField{ID: IDUERadioCapability, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, UERadioCapability{0x01}))}, + ieField{ID: IDAMFUENGAPID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(AMFUENGAPID(1))))}, + ieField{ID: IDUERadioCapability, Criticality: CriticalityIgnore, Value: apimpl.RawValue(ieRaw(t, UERadioCapability{0x01}))}, ) _, err := ParseUERadioCapabilityInfoIndication(value) diff --git a/ngap/unknown_ie_test.go b/ngap/unknown_ie_test.go index a9a2ac1c57..779a4095de 100644 --- a/ngap/unknown_ie_test.go +++ b/ngap/unknown_ie_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // An NG SETUP REQUEST carrying one unmodeled IE at the given criticality. @@ -26,7 +26,7 @@ func encodeWithExtraIE(t *testing.T, crit Criticality, id ProtocolIEID) []byte { {ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, {ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, {ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, - {ID: id, Criticality: crit, Value: ap.RawValue([]byte{0xde, 0xad})}, + {ID: id, Criticality: crit, Value: apimpl.RawValue([]byte{0xde, 0xad})}, } if err := encodeIEContainer(w, per.Aligned, fields); err != nil { @@ -203,7 +203,7 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { value := container(t, ieField{ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, ieField{ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, - ieField{ID: unmodeledIEID, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xde, 0xad})}, + ieField{ID: unmodeledIEID, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0xde, 0xad})}, ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, ) @@ -236,11 +236,11 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { src := goldRequest() value := container(t, - ieField{ID: unmodeledIEID, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})}, + ieField{ID: unmodeledIEID, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x01})}, ieField{ID: IDGlobalRANNodeID, Criticality: CriticalityReject, Value: &src.GlobalRANNodeID}, ieField{ID: IDSupportedTAList, Criticality: CriticalityReject, Value: src.SupportedTAList}, ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, - ieField{ID: ProtocolIEID(9999), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x02})}, + ieField{ID: ProtocolIEID(9999), Criticality: CriticalityNotify, Value: apimpl.RawValue([]byte{0x02})}, ) req, err := ParseNGSetupRequest(value) diff --git a/per/ap/ap.go b/per/ap/ap.go new file mode 100644 index 0000000000..2a83722643 --- /dev/null +++ b/per/ap/ap.go @@ -0,0 +1,75 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package ap + +import ( + "net/netip" + + "github.com/ellanetworks/core/per/ap/internal/impl" +) + +type ( + Criticality = impl.Criticality + Presence = impl.Presence + Kind = impl.Kind + + Field[ID ~uint16] = impl.Field[ID] + SingleContainer[ID ~uint16] = impl.SingleContainer[ID] + + Diagnostic[ID ~uint16] = impl.Diagnostic[ID] + Diagnostics[ID ~uint16] = impl.Diagnostics[ID] + Diagnosis[ID ~uint16] = impl.Diagnosis[ID] + Diagnosable[ID ~uint16] = impl.Diagnosable[ID] + AbstractSyntaxError[ID ~uint16] = impl.AbstractSyntaxError[ID] + TransferSyntaxError[P ~uint8] = impl.TransferSyntaxError[P] + + RawPDU[ID ~uint16, P ~uint8, T ~uint8] = impl.RawPDU[ID, P, T] + + TransportLayerAddress = impl.TransportLayerAddress +) + +const ( + CriticalityReject = impl.CriticalityReject + CriticalityIgnore = impl.CriticalityIgnore + CriticalityNotify = impl.CriticalityNotify + + PresenceOptional = impl.PresenceOptional + PresenceConditional = impl.PresenceConditional + PresenceMandatory = impl.PresenceMandatory + + KindNotComprehended = impl.KindNotComprehended + KindMissing = impl.KindMissing + KindWrongOrder = impl.KindWrongOrder + KindTooManyOccurrences = impl.KindTooManyOccurrences + KindErroneouslyPresent = impl.KindErroneouslyPresent +) + +var ( + ErrExtensionAlternative = impl.ErrExtensionAlternative + ErrNotProtocolIEContainer = impl.ErrNotProtocolIEContainer + ErrIndex = impl.ErrIndex + ErrTooManyFields = impl.ErrTooManyFields + ErrCriticality = impl.ErrCriticality + ErrDuplicateIE = impl.ErrDuplicateIE + ErrIENotPresent = impl.ErrIENotPresent + ErrTransportLayerAddress = impl.ErrTransportLayerAddress +) + +func Diagnose[ID ~uint16](v Diagnosable[ID]) Diagnostics[ID] { return impl.Diagnose(v) } + +func TransportLayerAddressFrom(addr netip.Addr) (TransportLayerAddress, error) { + return impl.TransportLayerAddressFrom(addr) +} + +func TransportLayerAddressFromAddrs(ipv4, ipv6 netip.Addr) (TransportLayerAddress, error) { + return impl.TransportLayerAddressFromAddrs(ipv4, ipv6) +} + +func TransportLayerAddressFromOctets(b []byte) TransportLayerAddress { + return impl.TransportLayerAddressFromOctets(b) +} + +func TransportLayerAddressFromBits(b []byte, nbits int) (TransportLayerAddress, bool) { + return impl.TransportLayerAddressFromBits(b, nbits) +} diff --git a/per/ap/apimpl/apimpl.go b/per/ap/apimpl/apimpl.go new file mode 100644 index 0000000000..7657d18fea --- /dev/null +++ b/per/ap/apimpl/apimpl.go @@ -0,0 +1,190 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package apimpl + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/internal/impl" +) + +type ( + Criticality = impl.Criticality + Presence = impl.Presence + WireCriticality = impl.WireCriticality + Profile = impl.Profile + Envelope = impl.Envelope + RawValue = impl.RawValue + + Field[ID ~uint16] = impl.Field[ID] + FieldValue[ID ~uint16] = impl.FieldValue[ID] + SingleContainer[ID ~uint16] = impl.SingleContainer[ID] + Preserved[ID ~uint16] = impl.Preserved[ID] + Message[ID ~uint16] = impl.Message[ID] + ListItem[ID ~uint16] = impl.ListItem[ID] + IESpec[ID ~uint16, M any] = impl.IESpec[ID, M] + Diagnosis[ID ~uint16] = impl.Diagnosis[ID] + Diagnostic[ID ~uint16] = impl.Diagnostic[ID] + Diagnostics[ID ~uint16] = impl.Diagnostics[ID] + AbstractSyntaxError[ID ~uint16] = impl.AbstractSyntaxError[ID] + + RawPDU[ID ~uint16, P ~uint8, T ~uint8] = impl.RawPDU[ID, P, T] +) + +const ( + CriticalityReject = impl.CriticalityReject + CriticalityIgnore = impl.CriticalityIgnore + CriticalityNotify = impl.CriticalityNotify + + PresenceOptional = impl.PresenceOptional + PresenceConditional = impl.PresenceConditional + PresenceMandatory = impl.PresenceMandatory +) + +func Wire(wire, spec Criticality) WireCriticality { return impl.Wire(wire, spec) } + +func ListItemCriticality[ID ~uint16](wire Criticality) ListItem[ID] { + return impl.ListItemCriticality[ID](wire) +} + +func EncodePDU(p *Profile, e Envelope) ([]byte, error) { return impl.EncodePDU(p, e) } + +func DecodePDU[P ~uint8](p *Profile, b []byte) (Envelope, error) { return impl.DecodePDU[P](p, b) } + +func ParseRawPDU[ID ~uint16, P ~uint8, T ~uint8](p *Profile, b []byte) (*RawPDU[ID, P, T], error) { + return impl.ParseRawPDU[ID, P, T](p, b) +} + +func EncodeField[ID ~uint16](p *Profile, w *per.Writer, enc per.Encoding, f FieldValue[ID]) error { + return impl.EncodeField(p, w, enc, f) +} + +func EncodeIEContainer[ID ~uint16](p *Profile, w *per.Writer, enc per.Encoding, fields []FieldValue[ID]) error { + return impl.EncodeIEContainer(p, w, enc, fields) +} + +func DecodeIEContainer[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) ([]Field[ID], error) { + return impl.DecodeIEContainer[ID](p, r, enc) +} + +func EncodeExtensionContainer[ID ~uint16](p *Profile, w *per.Writer, enc per.Encoding, fields []FieldValue[ID]) error { + return impl.EncodeExtensionContainer(p, w, enc, fields) +} + +func DecodeExtensionContainer[ID ~uint16, M any](p *Profile, r *per.Reader, enc per.Encoding, table []IESpec[ID, M], m *M, pres *Preserved[ID]) error { + return impl.DecodeExtensionContainer(p, r, enc, table, m, pres) +} + +func ExtensionFields[ID ~uint16, M any](table []IESpec[ID, M], m *M, pres Preserved[ID]) []FieldValue[ID] { + return impl.ExtensionFields(table, m, pres) +} + +func DiagnoseExtensions[ID ~uint16, M any](d *Diagnosis[ID], table []IESpec[ID, M], m *M, pres *Preserved[ID]) { + impl.DiagnoseExtensions(d, table, m, pres) +} + +func DecodeSingleContainerValue[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) (SingleContainer[ID], error) { + return impl.DecodeSingleContainerValue[ID](p, r, enc) +} + +func DecodeValue(b []byte, u per.Unmarshaler) error { return impl.DecodeValue(b, u) } + +func DiagnoseChoiceExtension[ID ~uint16, T any, PT interface { + *T + per.Marshaler +}](d *Diagnosis[ID], id ID, crit Criticality, alt *PT, raw **SingleContainer[ID], +) bool { + return impl.DiagnoseChoiceExtension(d, id, crit, alt, raw) +} + +func DiagnoseUnknownChoiceExtension[ID ~uint16](d *Diagnosis[ID], c *SingleContainer[ID]) bool { + return impl.DiagnoseUnknownChoiceExtension(d, c) +} + +func EncodeItemList[ID ~uint16, T any](p *Profile, w *per.Writer, enc per.Encoding, ub int64, id ID, crit Criticality, items []T) error { + return impl.EncodeItemList(p, w, enc, ub, id, crit, items) +} + +func DecodeItemList[ID ~uint16, T any](p *Profile, r *per.Reader, enc per.Encoding, ub int64, id ID, crit Criticality) ([]T, error) { + return impl.DecodeItemList[ID, T](p, r, enc, ub, id, crit) +} + +func DiagnoseItemList[ID ~uint16, T any](d *Diagnosis[ID], id ID, crit Criticality, items *[]T) bool { + return impl.DiagnoseItemList(d, id, crit, items) +} + +func MessagePreserved[ID ~uint16](m *Message[ID]) *Preserved[ID] { return impl.MessagePreserved(m) } + +func MessageAdditions[ID ~uint16](m *Message[ID]) *per.ExtensionAdditions { + return impl.MessageAdditions(m) +} + +func EncodeMessageBody[ID ~uint16, P ~uint8, M any](p *Profile, w *per.Writer, enc per.Encoding, procedure P, table []IESpec[ID, M], m *M, meta *Message[ID]) error { + return impl.EncodeMessageBody(p, w, enc, procedure, table, m, meta) +} + +func DecodeMessageBody[ID ~uint16, P ~uint8, M any](p *Profile, procedure P, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID]) error { + return impl.DecodeMessageBody(p, procedure, table, value, m, meta) +} + +func ParseMessageBody[ID ~uint16, P ~uint8, M any](p *Profile, procedure P, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID]) error { + return impl.ParseMessageBody(p, procedure, table, value, m, meta) +} + +func DecodeTransfer[ID ~uint16, T any, PT interface { + *T + per.Unmarshaler +}](b []byte, +) (PT, error) { + return impl.DecodeTransfer[ID, T, PT](b) +} + +func ParseTransfer[ID ~uint16, T any, PT interface { + *T + per.Unmarshaler +}](b []byte, +) (PT, error) { + return impl.ParseTransfer[ID, T, PT](b) +} + +func Prune[ID ~uint16](v impl.Diagnosable[ID]) Diagnostics[ID] { return impl.Prune(v) } + +func DiagnosticsOf[ID ~uint16](v any) Diagnostics[ID] { return impl.DiagnosticsOf[ID](v) } + +func DiagnosticItems[ID ~uint16, T any](ds []Diagnostic[ID], limit int, item func(d Diagnostic[ID], missing bool) T) []T { + return impl.DiagnosticItems(ds, limit, item) +} + +func Reportable[T any](items []T, criticality func(T) Criticality) []T { + return impl.Reportable(items, criticality) +} + +func OptionalIE[ID ~uint16, M any, T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](id ID, crit Criticality, field func(m *M) **T, +) IESpec[ID, M] { + return impl.OptionalIE[ID, M, T, PT](id, crit, field) +} + +func ConditionalIE[ID ~uint16, M any, T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](id ID, crit Criticality, cond func(m *M) bool, field func(m *M) **T, +) IESpec[ID, M] { + return impl.ConditionalIE[ID, M, T, PT](id, crit, cond, field) +} + +func ListIE[ID ~uint16, M any, L interface { + ~[]E + per.Marshaler +}, E any, PL interface { + *L + per.Marshaler + per.Unmarshaler +}](id ID, crit Criticality, field func(m *M) *L, +) IESpec[ID, M] { + return impl.ListIE[ID, M, L, E, PL](id, crit, field) +} diff --git a/per/ap/container.go b/per/ap/internal/impl/container.go similarity index 93% rename from per/ap/container.go rename to per/ap/internal/impl/container.go index 8ab1c9c9c0..a8ca801130 100644 --- a/per/ap/container.go +++ b/per/ap/internal/impl/container.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "github.com/ellanetworks/core/per" @@ -149,14 +149,14 @@ func decodeField[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding, allowE return Field[ID]{ID: ID(id), Criticality: Criticality(crit), Value: val}, nil } -func DecodeSingleContainer[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) (Field[ID], error) { - return decodeField[ID](p, r, enc, false) -} +func DecodeValue(b []byte, u per.Unmarshaler) error { + r := per.NewReader(b) -func SkipExtensionContainer[ID ~uint16](p *Profile, r *per.Reader, enc per.Encoding) error { - _, err := decodeExtensionFields[ID](p, r, enc, true) + if err := u.UnmarshalPER(r, per.Aligned); err != nil { + return err + } - return err + return r.Complete() } type SingleContainer[ID ~uint16] struct { diff --git a/per/ap/criticality.go b/per/ap/internal/impl/criticality.go similarity index 98% rename from per/ap/criticality.go rename to per/ap/internal/impl/criticality.go index 8927e6eb4f..cfa11b61d7 100644 --- a/per/ap/criticality.go +++ b/per/ap/internal/impl/criticality.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import "fmt" diff --git a/per/ap/diagnostics.go b/per/ap/internal/impl/diagnostics.go similarity index 78% rename from per/ap/diagnostics.go rename to per/ap/internal/impl/diagnostics.go index 3d24bf66a8..552ca1ba26 100644 --- a/per/ap/diagnostics.go +++ b/per/ap/internal/impl/diagnostics.go @@ -1,12 +1,14 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "fmt" "slices" "strings" + + "github.com/ellanetworks/core/per" ) type Kind uint8 @@ -128,6 +130,7 @@ func (d Diagnostics[ID]) filter(kind Kind, crit Criticality) []Diagnostic[ID] { type AbstractSyntaxError[ID ~uint16] struct { FalselyConstructed bool IEs []Diagnostic[ID] + Decoded []Field[ID] } func (e *AbstractSyntaxError[ID]) Error() string { @@ -156,6 +159,7 @@ type Diagnosis[ID ~uint16] struct { entries []Diagnostic[ID] path []ID pos int + prune bool } func (d *Diagnosis[ID]) report(id ID, crit Criticality, kind Kind) { @@ -172,10 +176,10 @@ func (d *Diagnosis[ID]) Unknown(id ID, crit Criticality) { d.report(id, crit, KindNotComprehended) } -func (d *Diagnosis[ID]) IE(id ID, crit Criticality, v any) { +func (d *Diagnosis[ID]) IE(id ID, crit Criticality, v any) bool { dv, ok := v.(Diagnosable[ID]) if !ok { - return + return false } d.path = append(d.path, id) @@ -185,20 +189,24 @@ func (d *Diagnosis[ID]) IE(id ID, crit Criticality, v any) { if notComprehended { d.report(id, crit, KindNotComprehended) } + + return notComprehended } func (d *Diagnosis[ID]) Diagnostics() Diagnostics[ID] { return Diagnostics[ID]{IEs: slices.Clone(d.entries)} } -func Comprehended[ID ~uint16](v any) bool { - dv, ok := v.(Diagnosable[ID]) +func Diagnose[ID ~uint16](v Diagnosable[ID]) Diagnostics[ID] { + return walk(v, false) +} - return !ok || !dv.Diagnose(&Diagnosis[ID]{}) +func Prune[ID ~uint16](v Diagnosable[ID]) Diagnostics[ID] { + return walk(v, true) } -func Diagnose[ID ~uint16](v Diagnosable[ID]) Diagnostics[ID] { - var d Diagnosis[ID] +func walk[ID ~uint16](v Diagnosable[ID], prune bool) Diagnostics[ID] { + d := Diagnosis[ID]{prune: prune} notComprehended := v.Diagnose(&d) out := d.Diagnostics() @@ -207,7 +215,7 @@ func Diagnose[ID ~uint16](v Diagnosable[ID]) Diagnostics[ID] { return out } -func DiagnoseExtensions[ID ~uint16, M any](d *Diagnosis[ID], table []IESpec[ID, M], m *M, pres Preserved[ID]) { +func DiagnoseExtensions[ID ~uint16, M any](d *Diagnosis[ID], table []IESpec[ID, M], m *M, pres *Preserved[ID]) { top := len(d.path) == 0 slots := pres.slots() last := -1 @@ -234,13 +242,20 @@ func DiagnoseExtensions[ID ~uint16, M any](d *Diagnosis[ID], table []IESpec[ID, for _, spec := range table { crit := spec.Criticality + received := false if top { d.pos = len(slots) } for i, s := range slots { - if !s.preserved && s.id == spec.ID { + if s.id != spec.ID { + continue + } + + received = true + + if !s.preserved { crit = s.crit if top { @@ -256,12 +271,43 @@ func DiagnoseExtensions[ID ~uint16, M any](d *Diagnosis[ID], table []IESpec[ID, switch { case ok && spec.Presence == PresenceConditional && !spec.Required(m): d.report(spec.ID, crit, KindErroneouslyPresent) - case !ok && spec.Required(m): + case !ok && !received && spec.Required(m): d.report(spec.ID, crit, KindMissing) } - if ok { - d.IE(spec.ID, crit, val) + if ok && d.IE(spec.ID, crit, val) && d.prune && spec.Clear != nil { + raw, err := per.Marshal(val, per.Aligned) + if err != nil { + continue + } + + *pres = demote(*pres, table, m, spec.ID, crit, raw) + spec.Clear(m) } } } + +func DiagnoseChoiceExtension[ID ~uint16, T any, PT interface { + *T + per.Marshaler +}](d *Diagnosis[ID], id ID, crit Criticality, alt *PT, raw **SingleContainer[ID], +) bool { + if !d.IE(id, crit, *alt) { + return false + } + + if d.prune { + if b, err := per.Marshal(*alt, per.Aligned); err == nil { + *raw = &SingleContainer[ID]{ID: id, Criticality: crit, Value: string(b)} + *alt = nil + } + } + + return true +} + +func DiagnoseUnknownChoiceExtension[ID ~uint16](d *Diagnosis[ID], c *SingleContainer[ID]) bool { + d.Unknown(c.ID, c.Criticality) + + return true +} diff --git a/per/ap/errors.go b/per/ap/internal/impl/errors.go similarity index 82% rename from per/ap/errors.go rename to per/ap/internal/impl/errors.go index ecf6d29e7f..ee49f8e43c 100644 --- a/per/ap/errors.go +++ b/per/ap/internal/impl/errors.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "errors" @@ -10,7 +10,6 @@ import ( var ( ErrProfile = errors.New("ap: invalid profile") - ErrNotComprehended = errors.New("ap: not comprehended") ErrExtensionAlternative = errors.New("ap: PDU extension alternative") ErrNotProtocolIEContainer = errors.New("ap: message body is not a ProtocolIE-Container") ErrIndex = errors.New("ap: field index out of range") @@ -21,12 +20,17 @@ var ( ) type TransferSyntaxError[P ~uint8] struct { - Protocol string - Procedure P - Err error + Protocol string + Procedure P + ProcedureKnown bool + Err error } func (e *TransferSyntaxError[P]) Error() string { + if !e.ProcedureKnown { + return fmt.Sprintf("%s: transfer syntax error: %v", e.Protocol, e.Err) + } + return fmt.Sprintf("%s: %v: transfer syntax error: %v", e.Protocol, e.Procedure, e.Err) } diff --git a/per/ap/internal/impl/list.go b/per/ap/internal/impl/list.go new file mode 100644 index 0000000000..8e895606c9 --- /dev/null +++ b/per/ap/internal/impl/list.go @@ -0,0 +1,260 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package impl + +import ( + "encoding/binary" + "fmt" + + "github.com/ellanetworks/core/per" +) + +type ListItem[ID ~uint16] struct { + crit WireCriticality + before string + after string + placeholder bool +} + +func ListItemCriticality[ID ~uint16](wire Criticality) ListItem[ID] { + return ListItem[ID]{crit: WireCriticality(wire) + 1} +} + +func (it *ListItem[ID]) listItem() *ListItem[ID] { return it } + +type listItem[ID ~uint16] interface { + listItem() *ListItem[ID] +} + +func (it ListItem[ID]) ForeignIEs() []Field[ID] { + return append(decodeForeign[ID](it.before), decodeForeign[ID](it.after)...) +} + +func appendForeign[ID ~uint16](b []byte, f Field[ID]) []byte { + b = binary.BigEndian.AppendUint16(b, uint16(f.ID)) + b = append(b, byte(f.Criticality)) + b = binary.AppendUvarint(b, uint64(len(f.Value))) + + return append(b, f.Value...) +} + +func decodeForeign[ID ~uint16](s string) []Field[ID] { + var out []Field[ID] + + for s != "" { + var f Field[ID] + + f, s = nextPreserved[ID](s) + out = append(out, f) + } + + return out +} + +func asListItem[ID ~uint16](v any) (*ListItem[ID], error) { + h, ok := v.(listItem[ID]) + if !ok { + return nil, fmt.Errorf("ap: %T does not embed ListItem", v) + } + + return h.listItem(), nil +} + +func EncodeItemList[ID ~uint16, T any](p *Profile, w *per.Writer, enc per.Encoding, ub int64, id ID, crit Criticality, items []T) error { + var fields []FieldValue[ID] + + for i := range items { + it, err := asListItem[ID](&items[i]) + if err != nil { + return err + } + + for _, f := range decodeForeign[ID](it.before) { + fields = append(fields, f.Encodable()) + } + + if !it.placeholder { + m, ok := any(&items[i]).(per.Marshaler) + if !ok { + return fmt.Errorf("ap: %T does not implement per.Marshaler", items[i]) + } + + fields = append(fields, FieldValue[ID]{ID: id, Criticality: it.crit.Of(crit), Value: m}) + } + + for _, f := range decodeForeign[ID](it.after) { + fields = append(fields, f.Encodable()) + } + } + + if len(fields) < 1 || int64(len(fields)) > ub { + return p.errorf("single-container list length %d outside [1, %d]", len(fields), ub) + } + + off := 0 + + return per.EncodeLength(w, enc, 1, ub, true, int64(len(fields)), func(count int64) error { + end := off + int(count) + for _, f := range fields[off:end] { + if err := EncodeField(p, w, enc, f); err != nil { + return err + } + } + + off = end + + return nil + }) +} + +func DecodeItemList[ID ~uint16, T any](p *Profile, r *per.Reader, enc per.Encoding, ub int64, id ID, crit Criticality) ([]T, error) { + var ( + items []T + pending []byte + ) + + err := per.DecodeLength(r, enc, 1, ub, true, func(count int64) error { + for range count { + f, err := decodeField[ID](p, r, enc, false) + if err != nil { + return err + } + + if f.ID != id { + pending = appendForeign(pending, f) + + continue + } + + var item T + + u, ok := any(&item).(per.Unmarshaler) + if !ok { + return fmt.Errorf("ap: %T does not implement per.Unmarshaler", item) + } + + if err := DecodeValue(f.Value, u); err != nil { + return err + } + + it, err := asListItem[ID](&item) + if err != nil { + return err + } + + it.crit = Wire(f.Criticality, crit) + it.before = string(pending) + pending = nil + + items = append(items, item) + } + + return nil + }) + if err != nil { + return nil, err + } + + if len(pending) > 0 { + if len(items) == 0 { + var item T + + it, err := asListItem[ID](&item) + if err != nil { + return nil, err + } + + it.placeholder, it.before = true, string(pending) + + return []T{item}, nil + } + + it, err := asListItem[ID](&items[len(items)-1]) + if err != nil { + return nil, err + } + + it.after = string(pending) + } + + return items, nil +} + +func DiagnoseItemList[ID ~uint16, T any](d *Diagnosis[ID], id ID, crit Criticality, items *[]T) bool { + list := *items + kept := list[:0] + comprehended := 0 + + var pending []byte + + for i := range list { + it, err := asListItem[ID](&list[i]) + if err != nil { + return false + } + + for _, f := range it.ForeignIEs() { + d.Unknown(f.ID, f.Criticality) + } + + if !it.placeholder { + wire := it.crit.Of(crit) + + switch { + case !d.IE(id, wire, &list[i]): + comprehended++ + case d.prune: + if raw, ok := marshalItem(&list[i]); ok { + pending = append(pending, it.before...) + pending = appendForeign(pending, Field[ID]{ID: id, Criticality: wire, Value: raw}) + pending = append(pending, it.after...) + + continue + } + } + } + + if !d.prune { + continue + } + + if len(pending) > 0 { + it.before = string(pending) + it.before + pending = nil + } + + kept = append(kept, list[i]) + } + + if d.prune { + if len(pending) > 0 { + if len(kept) > 0 { + it, _ := asListItem[ID](&kept[len(kept)-1]) + it.after += string(pending) + } else { + var item T + + it, _ := asListItem[ID](&item) + it.placeholder, it.before = true, string(pending) + + kept = append(kept, item) + } + } + + *items = kept + } + + return len(list) > 0 && comprehended == 0 +} + +func marshalItem(v any) ([]byte, bool) { + m, ok := v.(per.Marshaler) + if !ok { + return nil, false + } + + b, err := per.Marshal(m, per.Aligned) + + return b, err == nil +} diff --git a/per/ap/internal/impl/list_test.go b/per/ap/internal/impl/list_test.go new file mode 100644 index 0000000000..870e217d26 --- /dev/null +++ b/per/ap/internal/impl/list_test.go @@ -0,0 +1,253 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package impl + +import ( + "bytes" + "slices" + "testing" + + "github.com/ellanetworks/core/per" +) + +const ( + testItemID uint16 = 7 + testForeignID uint16 = 900 + testListUB = 16 +) + +type testItem struct { + V uint8 + ListItem[uint16] +} + +func (x *testItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeConstrainedWholeNumber(w, enc, 0, 255, int64(x.V)) +} + +func (x *testItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 255) + x.V = uint8(v) + + return err +} + +func (x *testItem) Diagnose(*Diagnosis[uint16]) bool { return x.V == notComprehendedOctet } + +func typedField(v uint8) FieldValue[uint16] { + return FieldValue[uint16]{ID: testItemID, Criticality: CriticalityIgnore, Value: &testItem{V: v}} +} + +func foreignField(crit Criticality) FieldValue[uint16] { + return FieldValue[uint16]{ID: testForeignID, Criticality: crit, Value: RawValue{0xab, 0xcd}} +} + +func encodeTestList(t *testing.T, fields []FieldValue[uint16]) []byte { + t.Helper() + + w := per.NewWriter() + + err := per.EncodeLength(w, per.Aligned, 1, testListUB, true, int64(len(fields)), func(int64) error { + for _, f := range fields { + if err := EncodeField(testProfile, w, per.Aligned, f); err != nil { + return err + } + } + + return nil + }) + if err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + return w.Bytes() +} + +func TestItemListKeepsForeignIEs(t *testing.T) { + for _, c := range []struct { + name string + fields []FieldValue[uint16] + values []uint8 + foreign int + notComprehended bool + }{ + {"front", []FieldValue[uint16]{foreignField(CriticalityReject), typedField(1), typedField(2)}, []uint8{1, 2}, 1, false}, + {"middle", []FieldValue[uint16]{typedField(1), foreignField(CriticalityIgnore), typedField(2)}, []uint8{1, 2}, 1, false}, + {"end", []FieldValue[uint16]{typedField(1), foreignField(CriticalityNotify), foreignField(CriticalityIgnore)}, []uint8{1}, 2, false}, + {"only", []FieldValue[uint16]{foreignField(CriticalityIgnore), foreignField(CriticalityReject)}, []uint8{0}, 2, true}, + } { + t.Run(c.name, func(t *testing.T) { + b := encodeTestList(t, c.fields) + + items, err := DecodeItemList[uint16, testItem](testProfile, per.NewReader(b), per.Aligned, testListUB, testItemID, CriticalityIgnore) + if err != nil { + t.Fatalf("decode: %v", err) + } + + var got []uint8 + for _, it := range items { + got = append(got, it.V) + } + + if !slices.Equal(got, c.values) { + t.Errorf("typed values = %v, want %v", got, c.values) + } + + var d Diagnosis[uint16] + + if nc := DiagnoseItemList(&d, testItemID, CriticalityIgnore, &items); nc != c.notComprehended { + t.Errorf("not comprehended = %v, want %v", nc, c.notComprehended) + } + + var reported []Diagnostic[uint16] + + for _, e := range d.Diagnostics().IEs { + if e.ID == testForeignID && e.Kind == KindNotComprehended { + reported = append(reported, e) + } + } + + if len(reported) != c.foreign { + t.Fatalf("reported %v, want %d foreign IEs", d.Diagnostics().IEs, c.foreign) + } + + i := 0 + + for _, f := range c.fields { + if f.ID == testForeignID { + if reported[i].Criticality != f.Criticality { + t.Errorf("foreign IE %d reported with %s, sent with %s", i, reported[i].Criticality, f.Criticality) + } + + i++ + } + } + + w := per.NewWriter() + if err := EncodeItemList(testProfile, w, per.Aligned, testListUB, testItemID, CriticalityIgnore, items); err != nil { + t.Fatalf("encode: %v", err) + } + + w.AlignToByte() + + if !bytes.Equal(w.Bytes(), b) { + t.Fatalf("re-encode = % x, want % x", w.Bytes(), b) + } + }) + } +} + +func TestItemListForeignIEsAreCheckedOnTheirOwnCriticality(t *testing.T) { + for _, c := range []struct { + crit Criticality + reject bool + }{ + {CriticalityIgnore, false}, + {CriticalityNotify, false}, + {CriticalityReject, true}, + } { + t.Run(c.crit.String(), func(t *testing.T) { + b := encodeTestList(t, []FieldValue[uint16]{typedField(1), foreignField(c.crit)}) + + items, err := DecodeItemList[uint16, testItem](testProfile, per.NewReader(b), per.Aligned, testListUB, testItemID, CriticalityIgnore) + if err != nil { + t.Fatal(err) + } + + var d Diagnosis[uint16] + + list := itemListValue(items) + + d.IE(1, CriticalityIgnore, &list) + + if err := d.Diagnostics().Check(); (err != nil) != c.reject { + t.Fatalf("Check() = %v, want reject %v", err, c.reject) + } + + for _, e := range d.Diagnostics().IEs { + if e.ID == testForeignID && !slices.Equal(e.Path, []uint16{1}) { + t.Errorf("foreign IE path = %v, want [1]", e.Path) + } + } + }) + } +} + +type itemListValue []testItem + +func (l *itemListValue) Diagnose(d *Diagnosis[uint16]) bool { + return DiagnoseItemList(d, testItemID, CriticalityIgnore, (*[]testItem)(l)) +} + +func TestItemListNotComprehendedItemIsJudgedOnItsOwnCriticality(t *testing.T) { + bad := FieldValue[uint16]{ID: testItemID, Criticality: CriticalityReject, Value: &testItem{V: notComprehendedOctet}} + + for _, c := range []struct { + name string + fields []FieldValue[uint16] + values []uint8 + pruned []uint8 + reject bool + listNotCmp bool + }{ + {"ignore item", []FieldValue[uint16]{typedField(1), typedField(notComprehendedOctet), typedField(2)}, []uint8{1, notComprehendedOctet, 2}, []uint8{1, 2}, false, false}, + {"reject item", []FieldValue[uint16]{typedField(1), bad}, []uint8{1, notComprehendedOctet}, []uint8{1}, true, false}, + {"every item", []FieldValue[uint16]{typedField(notComprehendedOctet)}, []uint8{notComprehendedOctet}, []uint8{0}, false, true}, + } { + t.Run(c.name, func(t *testing.T) { + b := encodeTestList(t, c.fields) + + items, err := DecodeItemList[uint16, testItem](testProfile, per.NewReader(b), per.Aligned, testListUB, testItemID, CriticalityIgnore) + if err != nil { + t.Fatal(err) + } + + if got := values(items); !slices.Equal(got, c.values) { + t.Fatalf("decoded values = %v, want %v: decode must keep every item", got, c.values) + } + + list := itemListValue(items) + + var d Diagnosis[uint16] + + if nc := d.IE(1, CriticalityIgnore, &list); nc != c.listNotCmp { + t.Fatalf("list not comprehended = %v, want %v", nc, c.listNotCmp) + } + + if err := d.Diagnostics().Check(); (err != nil) != c.reject { + t.Fatalf("Check() = %v, want reject %v", err, c.reject) + } + + pruned := itemListValue(slices.Clone(items)) + + Prune[uint16](&pruned) + + if got := values(pruned); !slices.Equal(got, c.pruned) { + t.Fatalf("pruned values = %v, want %v", got, c.pruned) + } + + w := per.NewWriter() + if err := EncodeItemList(testProfile, w, per.Aligned, testListUB, testItemID, CriticalityIgnore, []testItem(pruned)); err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + if !bytes.Equal(w.Bytes(), b) { + t.Fatalf("pruned list re-encoded %x, want %x", w.Bytes(), b) + } + }) + } +} + +func values(items []testItem) []uint8 { + out := make([]uint8, len(items)) + for i, it := range items { + out[i] = it.V + } + + return out +} diff --git a/per/ap/message_equal_test.go b/per/ap/internal/impl/message_equal_test.go similarity index 81% rename from per/ap/message_equal_test.go rename to per/ap/internal/impl/message_equal_test.go index 860d187e4b..8e0a1fd9ab 100644 --- a/per/ap/message_equal_test.go +++ b/per/ap/internal/impl/message_equal_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import "testing" @@ -9,7 +9,7 @@ func TestMessageEqualComparesPreservedState(t *testing.T) { base := func() Message[uint16] { var m Message[uint16] - m.Append(Field[uint16]{ID: 9, Criticality: CriticalityIgnore, Value: []byte{1}}) + m.preserved.Append(Field[uint16]{ID: 9, Criticality: CriticalityIgnore, Value: []byte{1}}) m.exempt = []uint16{3} m.absent = []absentIE[uint16]{{id: 4, encoded: "\x01"}} @@ -28,7 +28,7 @@ func TestMessageEqualComparesPreservedState(t *testing.T) { } for name, mutate := range map[string]func(*Message[uint16]){ - "preserved IE": func(m *Message[uint16]) { m.Append(Field[uint16]{ID: 10, Value: []byte{2}}) }, + "preserved IE": func(m *Message[uint16]) { m.preserved.Append(Field[uint16]{ID: 10, Value: []byte{2}}) }, "exempt": func(m *Message[uint16]) { m.exempt = nil }, "absent": func(m *Message[uint16]) { m.absent[0].encoded = "\x02" }, } { diff --git a/per/ap/pdu.go b/per/ap/internal/impl/pdu.go similarity index 65% rename from per/ap/pdu.go rename to per/ap/internal/impl/pdu.go index a6d2bce314..0ec5ab5952 100644 --- a/per/ap/pdu.go +++ b/per/ap/internal/impl/pdu.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "fmt" @@ -22,7 +22,7 @@ type Envelope struct { Value []byte } -func (p *Profile) EncodePDU(e Envelope) ([]byte, error) { +func EncodePDU(p *Profile, e Envelope) ([]byte, error) { if err := p.validate(); err != nil { return nil, err } @@ -53,21 +53,25 @@ func (p *Profile) EncodePDU(e Envelope) ([]byte, error) { return w.Bytes(), nil } -func (p *Profile) DecodePDU(b []byte) (Envelope, error) { +func DecodePDU[P ~uint8](p *Profile, b []byte) (Envelope, error) { if err := p.validate(); err != nil { return Envelope{}, err } r := per.NewReader(b) - e, err := p.decodeHeader(r) + e, err := decodeHeader[P](p, r) if err != nil { return Envelope{}, err } val, err := per.DecodeOpenTypeBytes(r, per.Aligned) + if err == nil { + err = r.Complete() + } + if err != nil { - return Envelope{}, p.errorf("value: %w", err) + return Envelope{}, procedureSyntaxError(p, P(e.ProcedureCode), fmt.Errorf("value: %w", err)) } e.Value = val @@ -75,31 +79,39 @@ func (p *Profile) DecodePDU(b []byte) (Envelope, error) { return e, nil } -func (p *Profile) decodeHeader(r *per.Reader) (Envelope, error) { +func envelopeSyntaxError[P ~uint8](p *Profile, err error) error { + return &TransferSyntaxError[P]{Protocol: p.Name, Err: err} +} + +func procedureSyntaxError[P ~uint8](p *Profile, procedure P, err error) error { + return &TransferSyntaxError[P]{Protocol: p.Name, Procedure: procedure, ProcedureKnown: true, Err: err} +} + +func decodeHeader[P ~uint8](p *Profile, r *per.Reader) (Envelope, error) { enc := per.Aligned ext, err := r.ReadBit() if err != nil { - return Envelope{}, p.errorf("PDU choice: %w", err) + return Envelope{}, envelopeSyntaxError[P](p, fmt.Errorf("PDU choice: %w", err)) } if ext { - return Envelope{}, extensionAlternativeError{protocol: p.Name} + return Envelope{}, envelopeSyntaxError[P](p, extensionAlternativeError{protocol: p.Name}) } idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, pduChoiceCount-1) if err != nil { - return Envelope{}, p.errorf("PDU choice: %w", err) + return Envelope{}, envelopeSyntaxError[P](p, fmt.Errorf("PDU choice: %w", err)) } pc, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProcedureCode) if err != nil { - return Envelope{}, p.errorf("procedureCode: %w", err) + return Envelope{}, envelopeSyntaxError[P](p, fmt.Errorf("procedureCode: %w", err)) } crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) if err != nil { - return Envelope{}, p.errorf("criticality: %w", err) + return Envelope{}, procedureSyntaxError(p, P(pc), fmt.Errorf("criticality: %w", err)) } return Envelope{Choice: int(idx), ProcedureCode: uint8(pc), Criticality: Criticality(crit)}, nil diff --git a/per/ap/preserved.go b/per/ap/internal/impl/preserved.go similarity index 71% rename from per/ap/preserved.go rename to per/ap/internal/impl/preserved.go index 32897ecf2c..1fdd738072 100644 --- a/per/ap/preserved.go +++ b/per/ap/internal/impl/preserved.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "encoding/binary" @@ -113,21 +113,26 @@ func (b *preservedBuilder[ID]) build() Preserved[ID] { } type Message[ID ~uint16] struct { - Preserved[ID] - - diagnostics Diagnostics[ID] - exempt []ID - absent []absentIE[ID] - ExtensionAdditions per.ExtensionAdditions + preserved Preserved[ID] + additions per.ExtensionAdditions + diagnostics Diagnostics[ID] + exempt []ID + absent []absentIE[ID] } func (m Message[ID]) Diagnostics() Diagnostics[ID] { return m.diagnostics } +func (m Message[ID]) UnknownIEs() []Field[ID] { return m.preserved.UnknownIEs() } + func (m Message[ID]) Equal(o Message[ID]) bool { - return m.Preserved == o.Preserved && m.ExtensionAdditions == o.ExtensionAdditions && + return m.preserved == o.preserved && m.additions == o.additions && slices.Equal(m.exempt, o.exempt) && slices.Equal(m.absent, o.absent) } +func MessagePreserved[ID ~uint16](m *Message[ID]) *Preserved[ID] { return &m.preserved } + +func MessageAdditions[ID ~uint16](m *Message[ID]) *per.ExtensionAdditions { return &m.additions } + func (p *Preserved[ID]) Append(f Field[ID]) { b := preservedBuilder[ID]{fields: []byte(p.fields), order: []byte(p.order)} @@ -136,6 +141,37 @@ func (p *Preserved[ID]) Append(f Field[ID]) { p.fields, p.order = string(b.fields), string(b.order) } +func demote[ID ~uint16, M any](p Preserved[ID], table []IESpec[ID, M], m *M, id ID, crit Criticality, raw []byte) Preserved[ID] { + slots := p.slots() + if p.order == "" { + for _, spec := range table { + if _, ok := spec.Encode(m); ok { + slots = append(slots, slot[ID]{id: spec.ID, crit: spec.Criticality}) + } + } + } + + var b preservedBuilder[ID] + + rest := p.fields + + for _, s := range slots { + switch { + case s.preserved: + var f Field[ID] + + f, rest = nextPreserved[ID](rest) + b.keep(f, s.duplicate) + case s.id == id: + b.keep(Field[ID]{ID: id, Criticality: crit, Value: raw}, false) + default: + b.known(s.id, s.crit, 0, s.crit) + } + } + + return Preserved[ID]{fields: string(b.fields), order: string(b.order)} +} + type absentIE[ID ~uint16] struct { id ID encoded string diff --git a/per/ap/profile.go b/per/ap/internal/impl/profile.go similarity index 99% rename from per/ap/profile.go rename to per/ap/internal/impl/profile.go index 374719a69f..c45d340f6e 100644 --- a/per/ap/profile.go +++ b/per/ap/internal/impl/profile.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "fmt" diff --git a/per/ap/internal/impl/protocol.go b/per/ap/internal/impl/protocol.go new file mode 100644 index 0000000000..e2d69d056e --- /dev/null +++ b/per/ap/internal/impl/protocol.go @@ -0,0 +1,215 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package impl + +import ( + "errors" + "fmt" + + "github.com/ellanetworks/core/per" +) + +func EncodeMessageBody[ID ~uint16, P ~uint8, M any](p *Profile, w *per.Writer, enc per.Encoding, procedure P, table []IESpec[ID, M], m *M, meta *Message[ID]) error { + if err := EncodeMessage(p, w, enc, table, m, meta); err != nil { + return fmt.Errorf("%s: %v: %w", p.Name, procedure, err) + } + + return nil +} + +func DecodeMessageBody[ID ~uint16, P ~uint8, M any](p *Profile, procedure P, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID]) error { + if err := DecodeMessage(p, table, value, m, meta, false); err != nil { + return procedureSyntaxError(p, procedure, err) + } + + return nil +} + +func ParseMessageBody[ID ~uint16, P ~uint8, M any](p *Profile, procedure P, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID]) error { + if err := DecodeMessage(p, table, value, m, meta, true); err != nil { + return procedureSyntaxError(p, procedure, err) + } + + err := meta.diagnostics.Check() + + var e *AbstractSyntaxError[ID] + if errors.As(err, &e) { + e.Decoded = modeledIEs(p, table, value) + } + + return err +} + +func modeledIEs[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value []byte) []Field[ID] { + r := per.NewReader(value) + + if _, err := r.ReadBit(); err != nil { + return nil + } + + fields, err := DecodeIEContainer[ID](p, r, per.Aligned) + if err != nil { + return nil + } + + var out []Field[ID] + + seen := make([]bool, len(table)) + + for _, f := range fields { + idx := lookup(table, f.ID) + if idx < 0 || seen[idx] { + continue + } + + seen[idx] = true + + out = append(out, f) + } + + return out +} + +func DecodeTransfer[ID ~uint16, T any, PT interface { + *T + per.Unmarshaler +}](b []byte, +) (PT, error) { + v := PT(new(T)) + + if err := DecodeValue(b, v); err != nil { + return nil, err + } + + return v, nil +} + +func ParseTransfer[ID ~uint16, T any, PT interface { + *T + per.Unmarshaler +}](b []byte, +) (PT, error) { + v, err := DecodeTransfer[ID, T, PT](b) + if err != nil { + return nil, err + } + + dv, ok := any(v).(Diagnosable[ID]) + if !ok { + return v, nil + } + + if err := Prune(dv).Check(); err != nil { + return nil, err + } + + return v, nil +} + +func DiagnosticsOf[ID ~uint16](v any) Diagnostics[ID] { + dv, ok := v.(Diagnosable[ID]) + if !ok { + return Diagnostics[ID]{} + } + + return Diagnose(dv) +} + +func DiagnosticItems[ID ~uint16, T any](ds []Diagnostic[ID], limit int, item func(d Diagnostic[ID], missing bool) T) []T { + var out []T + + for _, d := range ds { + if len(out) >= limit { + break + } + + out = append(out, item(d, d.Kind == KindMissing)) + } + + return out +} + +func Reportable[T any](items []T, criticality func(T) Criticality) []T { + out := make([]T, 0, len(items)) + + for _, it := range items { + if criticality(it) != CriticalityIgnore { + out = append(out, it) + } + } + + if len(out) == 0 { + return nil + } + + return out +} + +func OptionalIE[ID ~uint16, M any, T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](id ID, crit Criticality, field func(m *M) **T, +) IESpec[ID, M] { + return IESpec[ID, M]{ + ID: id, Presence: PresenceOptional, Criticality: crit, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { + v := PT(new(T)) + + if err := v.UnmarshalPER(r, enc); err != nil { + return err + } + + *field(m) = (*T)(v) + + return nil + }, + Encode: func(m *M) (per.Marshaler, bool) { + v := *field(m) + if v == nil { + return nil, false + } + + return PT(v), true + }, + Clear: func(m *M) { *field(m) = nil }, + } +} + +func ConditionalIE[ID ~uint16, M any, T any, PT interface { + *T + per.Marshaler + per.Unmarshaler +}](id ID, crit Criticality, cond func(m *M) bool, field func(m *M) **T, +) IESpec[ID, M] { + s := OptionalIE[ID, M, T, PT](id, crit, field) + s.Presence, s.Condition = PresenceConditional, cond + + return s +} + +func ListIE[ID ~uint16, M any, L interface { + ~[]E + per.Marshaler +}, E any, PL interface { + *L + per.Marshaler + per.Unmarshaler +}](id ID, crit Criticality, field func(m *M) *L, +) IESpec[ID, M] { + return IESpec[ID, M]{ + ID: id, Presence: PresenceOptional, Criticality: crit, + Decode: func(m *M, r *per.Reader, enc per.Encoding) error { + return PL(field(m)).UnmarshalPER(r, enc) + }, + Encode: func(m *M) (per.Marshaler, bool) { + if len(*field(m)) == 0 { + return nil, false + } + + return PL(field(m)), true + }, + Clear: func(m *M) { *field(m) = nil }, + } +} diff --git a/per/ap/raw.go b/per/ap/internal/impl/raw.go similarity index 72% rename from per/ap/raw.go rename to per/ap/internal/impl/raw.go index b3dce93cfb..8abd2cb44b 100644 --- a/per/ap/raw.go +++ b/per/ap/internal/impl/raw.go @@ -1,10 +1,11 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "bytes" + "fmt" "iter" "github.com/ellanetworks/core/per" @@ -26,7 +27,7 @@ type rawField[ID ~uint16] struct { content []byte } -type RawPDU[ID ~uint16] struct { +type RawPDU[ID ~uint16, P ~uint8, T ~uint8] struct { profile *Profile header Envelope opaque bool @@ -38,13 +39,12 @@ type RawPDU[ID ~uint16] struct { count []byte fields []rawField[ID] bodyTail []byte - tail []byte countChanged bool dirty bool } -func ParseRawPDU[ID ~uint16](p *Profile, b []byte) (*RawPDU[ID], error) { +func ParseRawPDU[ID ~uint16, P ~uint8, T ~uint8](p *Profile, b []byte) (*RawPDU[ID, P, T], error) { if err := p.validate(); err != nil { return nil, err } @@ -52,7 +52,7 @@ func ParseRawPDU[ID ~uint16](p *Profile, b []byte) (*RawPDU[ID], error) { b = bytes.Clone(b) r := per.NewReader(b) - header, err := p.decodeHeader(r) + header, err := decodeHeader[P](p, r) if err != nil { return nil, err } @@ -61,20 +61,23 @@ func ParseRawPDU[ID ~uint16](p *Profile, b []byte) (*RawPDU[ID], error) { headEnd := r.Offset() / 8 body, err := readOpenType(r, b) + if err == nil { + err = r.Complete() + } + if err != nil { - return nil, p.errorf("value: %w", err) + return nil, procedureSyntaxError(p, P(header.ProcedureCode), fmt.Errorf("value: %w", err)) } header.Value = body.content - m := &RawPDU[ID]{ + m := &RawPDU[ID, P, T]{ profile: p, header: header, opaque: p.Opaque(header.ProcedureCode), orig: b, head: b[:headEnd], body: body, - tail: b[r.Offset()/8:], } if m.opaque { @@ -82,20 +85,21 @@ func ParseRawPDU[ID ~uint16](p *Profile, b []byte) (*RawPDU[ID], error) { } if err := m.parseBody(); err != nil { - return nil, err + return nil, procedureSyntaxError(p, P(header.ProcedureCode), err) } return m, nil } -func (m *RawPDU[ID]) parseBody() error { +func (m *RawPDU[ID, P, T]) parseBody() error { p := m.profile content := m.body.content r := per.NewReader(content) enc := per.Aligned - if _, err := r.ReadBit(); err != nil { - return p.errorf("message preamble: %w", err) + extPresent, err := r.ReadBit() + if err != nil { + return fmt.Errorf("message preamble: %w", err) } r.AlignToByte() @@ -103,13 +107,13 @@ func (m *RawPDU[ID]) parseBody() error { n, err := per.DecodeConstrainedWholeNumber(r, enc, 0, p.MaxProtocolIEs) if err != nil { - return p.errorf("IE count: %w", err) + return fmt.Errorf("IE count: %w", err) } countEnd := r.Offset() / 8 if n > int64(len(content)-countEnd)/(minFieldBits/8) { - return p.errorf("%d IEs declared in %d octets", n, len(content)-countEnd) + return fmt.Errorf("%d IEs declared in %d octets", n, len(content)-countEnd) } m.bodyHdr = content[:hdrEnd] @@ -121,12 +125,12 @@ func (m *RawPDU[ID]) parseBody() error { id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, p.MaxProtocolIEs) if err != nil { - return p.errorf("IE %d id: %w", i, err) + return fmt.Errorf("IE %d id: %w", i, err) } crit, err := per.DecodeEnumerated(r, enc, criticalityCount, false) if err != nil { - return p.errorf("IE %d criticality: %w", i, err) + return fmt.Errorf("IE %d criticality: %w", i, err) } r.AlignToByte() @@ -134,13 +138,27 @@ func (m *RawPDU[ID]) parseBody() error { val, err := readOpenType(r, content) if err != nil { - return p.errorf("IE %d value: %w", i, err) + return fmt.Errorf("IE %d value: %w", i, err) } m.fields = append(m.fields, rawField[ID]{id: ID(id), crit: Criticality(crit), hdr: content[start:hdrEnd], val: val, content: val.content}) } - m.bodyTail = content[r.Offset()/8:] + tail := r.Offset() / 8 + + if extPresent { + var additions per.ExtensionAdditions + + if err := additions.UnmarshalPER(r, enc); err != nil { + return fmt.Errorf("extension additions: %w", err) + } + } + + if err := r.Complete(); err != nil { + return err + } + + m.bodyTail = content[tail:] return nil } @@ -163,21 +181,19 @@ func readOpenType(r *per.Reader, buf []byte) (openType, error) { return ot, nil } -func (m *RawPDU[ID]) Profile() *Profile { return m.profile } - -func (m *RawPDU[ID]) Choice() int { return m.header.Choice } +func (m *RawPDU[ID, P, T]) Trigger() T { return T(m.header.Choice) } -func (m *RawPDU[ID]) ProcedureCode() uint8 { return m.header.ProcedureCode } +func (m *RawPDU[ID, P, T]) ProcedureCode() P { return P(m.header.ProcedureCode) } -func (m *RawPDU[ID]) Criticality() Criticality { return m.header.Criticality } +func (m *RawPDU[ID, P, T]) Criticality() Criticality { return m.header.Criticality } -func (m *RawPDU[ID]) Opaque() bool { return m.opaque } +func (m *RawPDU[ID, P, T]) Opaque() bool { return m.opaque } -func (m *RawPDU[ID]) Body() []byte { return bytes.Clone(m.body.content) } +func (m *RawPDU[ID, P, T]) Body() []byte { return bytes.Clone(m.body.content) } -func (m *RawPDU[ID]) Len() int { return len(m.fields) } +func (m *RawPDU[ID, P, T]) Len() int { return len(m.fields) } -func (m *RawPDU[ID]) container() error { +func (m *RawPDU[ID, P, T]) container() error { if m.opaque { return m.profile.errorf("%s: %w", m.profile.procedureName(m.header.ProcedureCode), ErrNotProtocolIEContainer) } @@ -185,7 +201,7 @@ func (m *RawPDU[ID]) container() error { return nil } -func (m *RawPDU[ID]) Field(i int) (Field[ID], error) { +func (m *RawPDU[ID, P, T]) IE(i int) (Field[ID], error) { if i < 0 || i >= len(m.fields) { return Field[ID]{}, ErrIndex } @@ -195,16 +211,16 @@ func (m *RawPDU[ID]) Field(i int) (Field[ID], error) { return Field[ID]{ID: f.id, Criticality: f.crit, Value: bytes.Clone(f.content)}, nil } -func (m *RawPDU[ID]) Fields() []Field[ID] { +func (m *RawPDU[ID, P, T]) IEs() []Field[ID] { out := make([]Field[ID], len(m.fields)) for i := range m.fields { - out[i], _ = m.Field(i) + out[i], _ = m.IE(i) } return out } -func (m *RawPDU[ID]) All(id ID) iter.Seq2[int, Field[ID]] { +func (m *RawPDU[ID, P, T]) All(id ID) iter.Seq2[int, Field[ID]] { return func(yield func(int, Field[ID]) bool) { for i, f := range m.fields { if f.id != id { @@ -218,7 +234,7 @@ func (m *RawPDU[ID]) All(id ID) iter.Seq2[int, Field[ID]] { } } -func (m *RawPDU[ID]) Index(id ID) (int, error) { +func (m *RawPDU[ID, P, T]) Index(id ID) (int, error) { idx := -1 for i, f := range m.fields { @@ -236,20 +252,20 @@ func (m *RawPDU[ID]) Index(id ID) (int, error) { return idx, nil } -func (m *RawPDU[ID]) Get(id ID, v per.Unmarshaler) (bool, error) { +func (m *RawPDU[ID, P, T]) Get(id ID, v per.Unmarshaler) (bool, error) { i, err := m.Index(id) if err != nil || i < 0 { return false, err } - if err := v.UnmarshalPER(per.NewReader(m.fields[i].content), per.Aligned); err != nil { + if err := DecodeValue(m.fields[i].content, v); err != nil { return false, m.profile.errorf("%s: %w", m.profile.ieName(uint16(id)), err) } return true, nil } -func (m *RawPDU[ID]) Set(id ID, v per.Marshaler) error { +func (m *RawPDU[ID, P, T]) Set(id ID, v per.Marshaler) error { i, err := m.Index(id) if err != nil { return err @@ -267,7 +283,7 @@ func (m *RawPDU[ID]) Set(id ID, v per.Marshaler) error { return m.SetValue(i, b) } -func (m *RawPDU[ID]) SetValue(i int, value []byte) error { +func (m *RawPDU[ID, P, T]) SetValue(i int, value []byte) error { if i < 0 || i >= len(m.fields) { return ErrIndex } @@ -278,7 +294,7 @@ func (m *RawPDU[ID]) SetValue(i int, value []byte) error { return nil } -func (m *RawPDU[ID]) Insert(i int, f Field[ID]) error { +func (m *RawPDU[ID, P, T]) Insert(i int, f Field[ID]) error { if err := m.container(); err != nil { return err } @@ -306,7 +322,7 @@ func (m *RawPDU[ID]) Insert(i int, f Field[ID]) error { return nil } -func (m *RawPDU[ID]) Remove(i int) error { +func (m *RawPDU[ID, P, T]) Remove(i int) error { if i < 0 || i >= len(m.fields) { return ErrIndex } @@ -318,7 +334,7 @@ func (m *RawPDU[ID]) Remove(i int) error { return nil } -func (m *RawPDU[ID]) Marshal() ([]byte, error) { +func (m *RawPDU[ID, P, T]) Marshal() ([]byte, error) { if !m.dirty { return bytes.Clone(m.orig), nil } @@ -353,15 +369,13 @@ func (m *RawPDU[ID]) Marshal() ([]byte, error) { return nil, err } - out := make([]byte, 0, len(m.head)+len(body)+len(m.tail)) + out := make([]byte, 0, len(m.head)+len(body)) out = append(out, m.head...) - out = append(out, body...) - out = append(out, m.tail...) - return out, nil + return append(out, body...), nil } -func (m *RawPDU[ID]) encodeField(f rawField[ID]) ([]byte, error) { +func (m *RawPDU[ID, P, T]) encodeField(f rawField[ID]) ([]byte, error) { hdr := f.hdr if hdr == nil { w := per.NewWriter() diff --git a/per/ap/raw_test.go b/per/ap/internal/impl/raw_test.go similarity index 82% rename from per/ap/raw_test.go rename to per/ap/internal/impl/raw_test.go index 67b1233c2e..c9a76edc05 100644 --- a/per/ap/raw_test.go +++ b/per/ap/internal/impl/raw_test.go @@ -1,11 +1,12 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "bytes" "errors" + "slices" "testing" "github.com/ellanetworks/core/per" @@ -63,10 +64,10 @@ func encodePDU(t testing.TB, choice int, pc uint8, crit uint8, body []byte) []by return w.Bytes() } -func mustParse(t testing.TB, b []byte) *RawPDU[uint16] { +func mustParse(t testing.TB, b []byte) *RawPDU[uint16, uint8, uint8] { t.Helper() - m, err := ParseRawPDU[uint16](testProfile, b) + m, err := ParseRawPDU[uint16, uint8, uint8](testProfile, b) if err != nil { t.Fatalf("Parse(% x): %v", b, err) } @@ -74,7 +75,7 @@ func mustParse(t testing.TB, b []byte) *RawPDU[uint16] { return m } -func mustBytes(t testing.TB, m *RawPDU[uint16]) []byte { +func mustBytes(t testing.TB, m *RawPDU[uint16, uint8, uint8]) []byte { t.Helper() b, err := m.Marshal() @@ -95,11 +96,11 @@ func TestParseHeaderAndFields(t *testing.T) { m := mustParse(t, b) - if m.Choice() != 1 || m.ProcedureCode() != 11 || m.Criticality() != 1 { - t.Fatalf("header = %d/%d/%d", m.Choice(), m.ProcedureCode(), m.Criticality()) + if m.Trigger() != 1 || m.ProcedureCode() != 11 || m.Criticality() != 1 { + t.Fatalf("header = %d/%d/%d", m.Trigger(), m.ProcedureCode(), m.Criticality()) } - got := m.Fields() + got := m.IEs() if len(got) != len(fields) { t.Fatalf("got %d fields, want %d", len(got), len(fields)) } @@ -203,7 +204,7 @@ func TestSetValueLengthBoundaries(t *testing.T) { } back := mustParse(t, want) - if f, _ := back.Field(1); !bytes.Equal(f.Value, nv) { + if f, _ := back.IE(1); !bytes.Equal(f.Value, nv) { t.Fatalf("%d -> %d: value did not survive", from, to) } } @@ -219,7 +220,7 @@ func TestSetSameValueIsIdentity(t *testing.T) { m := mustParse(t, b) for i := range m.Len() { - f, _ := m.Field(i) + f, _ := m.IE(i) if err := m.SetValue(i, f.Value); err != nil { t.Fatal(err) } @@ -268,14 +269,13 @@ func TestNonCanonicalDeterminantKeptWhenUntouched(t *testing.T) { } } -func TestPaddingTailAndExtensionKept(t *testing.T) { +func TestPaddingAndExtensionKept(t *testing.T) { body := encodeBody(t, []Field[uint16]{{ID: 5, Criticality: 0, Value: []byte{0x01}}}) body[0] |= 0x80 body = append(body, 0x01, 0x80, 0x01, 0xff) b := encodePDU(t, 0, 7, 0, body) b[0] |= 0x01 - b = append(b, 0xee) m := mustParse(t, b) @@ -285,8 +285,8 @@ func TestPaddingTailAndExtensionKept(t *testing.T) { got := mustBytes(t, m) - if got[0] != b[0] || got[len(got)-1] != 0xee { - t.Fatalf("header padding or PDU tail lost: % x", got) + if got[0] != b[0] { + t.Fatalf("header padding lost: % x", got) } back := mustParse(t, got) @@ -336,39 +336,39 @@ func TestInsertRemove(t *testing.T) { func TestRefusals(t *testing.T) { body := encodeBody(t, nil) - if _, err := ParseRawPDU[uint16](nil, encodePDU(t, 0, 1, 0, body)); !errors.Is(err, ErrProfile) { + if _, err := ParseRawPDU[uint16, uint8, uint8](nil, encodePDU(t, 0, 1, 0, body)); !errors.Is(err, ErrProfile) { t.Errorf("nil profile: %v", err) } ext := encodePDU(t, 0, 1, 0, body) ext[0] |= 0x80 - if _, err := ParseRawPDU[uint16](testProfile, ext); !errors.Is(err, ErrExtensionAlternative) { + if _, err := ParseRawPDU[uint16, uint8, uint8](testProfile, ext); !errors.Is(err, ErrExtensionAlternative) { t.Errorf("extension alternative: %v", err) } bad := encodePDU(t, 0, 1, 0, body) bad[0] |= 0x60 - if _, err := ParseRawPDU[uint16](testProfile, bad); err == nil { + if _, err := ParseRawPDU[uint16, uint8, uint8](testProfile, bad); err == nil { t.Error("choice index 3 accepted") } badCrit := encodePDU(t, 0, 1, 0, encodeBody(t, []Field[uint16]{{ID: 1, Value: []byte{0x00}}})) badCrit[9] = 0xc0 - if _, err := ParseRawPDU[uint16](testProfile, badCrit); err == nil { + if _, err := ParseRawPDU[uint16, uint8, uint8](testProfile, badCrit); err == nil { t.Error("IE criticality 3 accepted") } inflated := encodePDU(t, 0, 1, 0, []byte{0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00}) - if _, err := ParseRawPDU[uint16](testProfile, inflated); err == nil { + if _, err := ParseRawPDU[uint16, uint8, uint8](testProfile, inflated); err == nil { t.Error("count larger than the content accepted") } full := encodePDU(t, 0, 1, 0, encodeBody(t, []Field[uint16]{{ID: 1, Value: []byte{0x00}}})) for i := range len(full) - 1 { - if _, err := ParseRawPDU[uint16](testProfile, full[:i]); err == nil { + if _, err := ParseRawPDU[uint16, uint8, uint8](testProfile, full[:i]); err == nil { t.Errorf("truncation at %d accepted", i) } } @@ -406,7 +406,7 @@ func FuzzRawPDU(f *testing.F) { f.Add([]byte{0x00, 0x0b, 0x40, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x01, 0x00, 0x08, 0x00, 0x02, 0x00, 0x05}) f.Fuzz(func(t *testing.T, data []byte) { - m, err := ParseRawPDU[uint16](testProfile, data) + m, err := ParseRawPDU[uint16, uint8, uint8](testProfile, data) if err != nil { return } @@ -421,7 +421,7 @@ func FuzzRawPDU(f *testing.F) { } for i := range m.Len() { - fld, err := m.Field(i) + fld, err := m.IE(i) if err != nil { t.Fatal(err) } @@ -453,7 +453,7 @@ func FuzzRawPDU(f *testing.F) { t.Fatalf("Bytes after replace: %v", err) } - back, err := ParseRawPDU[uint16](testProfile, out) + back, err := ParseRawPDU[uint16, uint8, uint8](testProfile, out) if err != nil { t.Fatalf("re-parse after replace: %v", err) } @@ -462,7 +462,7 @@ func FuzzRawPDU(f *testing.F) { t.Fatalf("field count changed: %d -> %d", m.Len(), back.Len()) } - if fld, _ := back.Field(0); !bytes.Equal(fld.Value, []byte{0x5a, 0x5a, 0x5a}) { + if fld, _ := back.IE(0); !bytes.Equal(fld.Value, []byte{0x5a, 0x5a, 0x5a}) { t.Fatalf("replaced value lost: % x", fld.Value) } }) @@ -536,3 +536,38 @@ func (g *rawGetter) UnmarshalPER(r *per.Reader, _ per.Encoding) error { return err } + +func TestTrailingOctetsAreATransferSyntaxError(t *testing.T) { + body := encodeBody(t, []Field[uint16]{{ID: 5, Criticality: 0, Value: []byte{0x01}}}) + + for name, b := range map[string][]byte{ + "after the PDU": append(encodePDU(t, 0, 7, 0, body), 0xee), + "after the IE container": encodePDU(t, 0, 7, 0, append(slices.Clone(body), 0xee)), + } { + _, err := ParseRawPDU[uint16, uint8, uint8](testProfile, b) + + var tse *TransferSyntaxError[uint8] + if !errors.As(err, &tse) || !errors.Is(err, per.ErrTrailing) || !tse.ProcedureKnown || tse.Procedure != 7 { + t.Errorf("%s: ParseRawPDU = %v, want a *TransferSyntaxError for procedure 7 wrapping per.ErrTrailing", name, err) + } + } + + if _, err := DecodePDU[uint8](testProfile, append(encodePDU(t, 0, 7, 0, body), 0xee)); !errors.Is(err, per.ErrTrailing) { + t.Errorf("DecodePDU = %v, want per.ErrTrailing", err) + } +} + +func TestEnvelopeErrorsAreTransferSyntaxErrors(t *testing.T) { + for name, b := range map[string][]byte{ + "empty": nil, + "extension alternative": {0x80}, + "truncated value": {0x00, 0x07, 0x00, 0x05, 0x01}, + } { + _, err := ParseRawPDU[uint16, uint8, uint8](testProfile, b) + + var tse *TransferSyntaxError[uint8] + if !errors.As(err, &tse) { + t.Errorf("%s: ParseRawPDU = %v (%T), want *TransferSyntaxError", name, err, err) + } + } +} diff --git a/per/ap/table.go b/per/ap/internal/impl/table.go similarity index 70% rename from per/ap/table.go rename to per/ap/internal/impl/table.go index c2bc640394..03c2a066cd 100644 --- a/per/ap/table.go +++ b/per/ap/internal/impl/table.go @@ -1,10 +1,9 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( - "errors" "fmt" "slices" @@ -18,6 +17,7 @@ type IESpec[ID ~uint16, M any] struct { Condition func(m *M) bool Decode func(m *M, r *per.Reader, enc per.Encoding) error Encode func(m *M) (per.Marshaler, bool) + Clear func(m *M) } func (s IESpec[ID, M]) Required(m *M) bool { @@ -68,13 +68,13 @@ func EncodeMessage[ID ~uint16, M any](p *Profile, w *per.Writer, enc per.Encodin typed[i] = &FieldValue[ID]{ID: spec.ID, Criticality: spec.Criticality, Value: val} } - w.WriteBit(meta.ExtensionAdditions.Present()) + w.WriteBit(meta.additions.Present()) - if err := EncodeIEContainer(p, w, enc, orderFields(table, typed, meta.Preserved)); err != nil { + if err := EncodeIEContainer(p, w, enc, orderFields(table, typed, meta.preserved)); err != nil { return err } - return meta.ExtensionAdditions.MarshalPER(w, enc) + return meta.additions.MarshalPER(w, enc) } func ExtensionFields[ID ~uint16, M any](table []IESpec[ID, M], m *M, pres Preserved[ID]) []FieldValue[ID] { @@ -156,7 +156,7 @@ const ( outcomeDecoded outcome = iota outcomeUnknown outcomeDuplicate - outcomeNotComprehended + outcomePruned ) type decodedField struct { @@ -165,7 +165,7 @@ type decodedField struct { wrongOrder bool } -func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID]) error { +func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID], prune bool) error { r := per.NewReader(value) enc := per.Aligned @@ -187,12 +187,18 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ } } - results, pres, err := decodeTable(p, table, fields, m) + if err := r.Complete(); err != nil { + return err + } + + results, pres, err := decodeTable(p, table, fields, m, nil) if err != nil { return err } - var d Diagnosis[ID] + d := Diagnosis[ID]{prune: prune} + + var pruned []bool seen := make([]bool, len(table)) @@ -202,7 +208,7 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ res := results[i] switch res.outcome { - case outcomeUnknown, outcomeNotComprehended: + case outcomeUnknown, outcomePruned: d.report(f.ID, f.Criticality, KindNotComprehended) case outcomeDuplicate: d.report(f.ID, f.Criticality, KindTooManyOccurrences) @@ -213,34 +219,72 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ d.report(f.ID, f.Criticality, KindWrongOrder) } - if val, ok := table[res.idx].Encode(m); ok { - d.IE(f.ID, f.Criticality, val) + val, ok := table[res.idx].Encode(m) + if ok && d.IE(f.ID, f.Criticality, val) && prune { + if pruned == nil { + pruned = make([]bool, len(fields)) + } + + pruned[i] = true } } } d.pos = len(fields) - var ( - exempt []ID - absent []absentIE[ID] - ) + var exempt []ID - for i, spec := range table { - required := spec.Required(m) + for i := range table { + spec := &table[i] + + switch { + case spec.Presence == PresenceOptional, seen[i] && spec.Presence == PresenceMandatory: + case seen[i] && !spec.Required(m): + d.report(spec.ID, spec.Criticality, KindErroneouslyPresent) + exempt = append(exempt, spec.ID) + case !seen[i] && spec.Required(m): + d.report(spec.ID, spec.Criticality, KindMissing) + exempt = append(exempt, spec.ID) + } + } + + diagnostics := d.Diagnostics() + + if pruned != nil { + var zero M + + *m = zero - if seen[i] { - if spec.Presence == PresenceConditional && !required { - d.report(spec.ID, spec.Criticality, KindErroneouslyPresent) - exempt = append(exempt, spec.ID) + if results, pres, err = decodeTable(p, table, fields, m, pruned); err != nil { + return err + } + + nested := Diagnosis[ID]{prune: true} + + for i, f := range fields { + if results[i].outcome != outcomeDecoded { + continue } - continue + if val, ok := table[results[i].idx].Encode(m); ok { + nested.IE(f.ID, f.Criticality, val) + } } - if required { - d.report(spec.ID, spec.Criticality, KindMissing) - exempt = append(exempt, spec.ID) + for i, f := range fields { + if pruned[i] && table[results[i].idx].Required(m) { + exempt = append(exempt, f.ID) + } + } + } + + var absent []absentIE[ID] + + for i := range table { + spec := &table[i] + + if seen[i] && !prunedID(fields, pruned, spec.ID) { + continue } if val, ok := spec.Encode(m); ok { @@ -248,23 +292,34 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ } } - meta.exempt = exempt - meta.absent = absent - - meta.Preserved = pres - meta.ExtensionAdditions = additions - meta.diagnostics = d.Diagnostics() + *meta = Message[ID]{ + preserved: pres, + additions: additions, + diagnostics: diagnostics, + exempt: exempt, + absent: absent, + } return nil } +func prunedID[ID ~uint16](fields []Field[ID], pruned []bool, id ID) bool { + for i := range pruned { + if pruned[i] && fields[i].ID == id { + return true + } + } + + return false +} + func DecodeExtensionContainer[ID ~uint16, M any](p *Profile, r *per.Reader, enc per.Encoding, table []IESpec[ID, M], m *M, pres *Preserved[ID]) error { fields, err := decodeExtensionFields[ID](p, r, enc, false) if err != nil { return err } - _, decoded, err := decodeTable(p, table, fields, m) + _, decoded, err := decodeTable(p, table, fields, m, nil) if err != nil { return err } @@ -274,11 +329,12 @@ func DecodeExtensionContainer[ID ~uint16, M any](p *Profile, r *per.Reader, enc return nil } -func decodeTable[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], fields []Field[ID], m *M) ([]decodedField, Preserved[ID], error) { +func decodeTable[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], fields []Field[ID], m *M, skip []bool) ([]decodedField, Preserved[ID], error) { results := make([]decodedField, len(fields)) occurred := make([]bool, len(table)) b := newPreservedBuilder[ID]() last := -1 + r := per.NewReader(nil) for i, f := range fields { idx := lookup(table, f.ID) @@ -302,28 +358,24 @@ func decodeTable[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], fields [] occurred[idx] = true results[i].wrongOrder = idx < last last = max(last, idx) - saved := *m - if err := table[idx].Decode(m, per.NewReader(f.Value), per.Aligned); err != nil { - if !errors.Is(err, ErrNotComprehended) { - return nil, Preserved[ID]{}, fmt.Errorf("IE %s: %w", p.ieName(uint16(f.ID)), err) - } - - *m = saved - results[i].outcome = outcomeNotComprehended + if skip != nil && skip[i] { + results[i].outcome = outcomePruned b.keep(f, false) continue } - if val, ok := table[idx].Encode(m); ok && !Comprehended[ID](val) { - *m = saved - results[i].outcome = outcomeNotComprehended + r.Reset(f.Value) - b.keep(f, false) + err := table[idx].Decode(m, r, per.Aligned) + if err == nil { + err = r.Complete() + } - continue + if err != nil { + return nil, Preserved[ID]{}, fmt.Errorf("IE %s: %w", p.ieName(uint16(f.ID)), err) } b.known(f.ID, f.Criticality, idx, table[idx].Criticality) diff --git a/per/ap/table_test.go b/per/ap/internal/impl/table_test.go similarity index 70% rename from per/ap/table_test.go rename to per/ap/internal/impl/table_test.go index 7d632b584c..639f82c93b 100644 --- a/per/ap/table_test.go +++ b/per/ap/internal/impl/table_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "bytes" @@ -26,15 +26,13 @@ func (o *octet) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } - if v == notComprehendedOctet { - return ErrNotComprehended - } - *o = octet(v) return nil } +func (o *octet) Diagnose(*Diagnosis[uint16]) bool { return *o == notComprehendedOctet } + type item struct { X octet Ext *octet @@ -67,10 +65,11 @@ var itemExtIEs = []IESpec[uint16, item]{{ return m.Ext, true }, + Clear: func(m *item) { m.Ext = nil }, }} func (it *item) Diagnose(d *Diagnosis[uint16]) bool { - DiagnoseExtensions(d, itemExtIEs, it, it.ext) + DiagnoseExtensions(d, itemExtIEs, it, &it.ext) return it.X == unknownOctet } @@ -213,7 +212,16 @@ func messageValue(t testing.TB, fields ...Field[uint16]) []byte { func decodeMsg(b []byte) (*msg, error) { m := new(msg) - if err := DecodeMessage(testProfile, msgIEs, b, m, &m.meta); err != nil { + if err := DecodeMessage(testProfile, msgIEs, b, m, &m.meta, false); err != nil { + return nil, err + } + + return m, nil +} + +func parseMsg(b []byte) (*msg, error) { + m := new(msg) + if err := DecodeMessage(testProfile, msgIEs, b, m, &m.meta, true); err != nil { return nil, err } @@ -259,7 +267,7 @@ func TestDecodeIsTotalForAbstractSyntaxErrors(t *testing.T) { {"unknown ignore IE", []Field[uint16]{one, unknownIgnore, c}, []Kind{KindNotComprehended}, nil}, {"unknown reject IE", []Field[uint16]{one, unknownReject, c}, []Kind{KindNotComprehended}, &wantCheck{ies: []uint16{501}}}, {"unknown reject extension nested in an item", []Field[uint16]{two, nestedReject}, []Kind{KindNotComprehended}, &wantCheck{ies: []uint16{502}}}, - {"value not comprehended", []Field[uint16]{valueReject}, []Kind{KindNotComprehended, KindMissing}, &wantCheck{ies: []uint16{idA}}}, + {"value not comprehended", []Field[uint16]{valueReject}, []Kind{KindNotComprehended}, &wantCheck{ies: []uint16{idA}}}, {"value decoded but not comprehended", []Field[uint16]{two, unknownItem}, []Kind{KindNotComprehended}, &wantCheck{ies: []uint16{idB}}}, {"missing mandatory IE", []Field[uint16]{b}, []Kind{KindMissing}, &wantCheck{ies: []uint16{idA}}}, {"duplicate IE", []Field[uint16]{two, two}, []Kind{KindTooManyOccurrences}, &wantCheck{falsely: true}}, @@ -459,3 +467,147 @@ func FuzzDecodeMessage(f *testing.F) { } }) } + +func TestDecodeKeepsNotComprehendedValuesAndParsePrunesThem(t *testing.T) { + value := messageValue(t, + Field[uint16]{ID: idA, Criticality: CriticalityIgnore, Value: encodeValue(t, octet(notComprehendedOctet))}, + Field[uint16]{ID: idB, Criticality: CriticalityIgnore, Value: encodeValue(t, &item{X: 4, Ext: ptr(octet(notComprehendedOctet))})}, + ) + + decoded, err := decodeMsg(value) + if err != nil { + t.Fatal(err) + } + + if decoded.A == nil || *decoded.A != notComprehendedOctet || decoded.B == nil || decoded.B.Ext == nil || *decoded.B.Ext != notComprehendedOctet { + t.Fatalf("decode dropped a not comprehended value: A %v B %+v", decoded.A, decoded.B) + } + + want := []Diagnostic[uint16]{ + {ID: idA, Criticality: CriticalityIgnore, Kind: KindNotComprehended}, + {Path: []uint16{idB}, ID: idItem, Criticality: CriticalityIgnore, Kind: KindNotComprehended}, + } + + got := decoded.meta.Diagnostics().IEs + if len(got) != len(want) { + t.Fatalf("diagnostics = %v, want %v", got, want) + } + + for i := range want { + if got[i].ID != want[i].ID || got[i].Kind != want[i].Kind || !slices.Equal(got[i].Path, want[i].Path) { + t.Fatalf("diagnostics = %v, want %v", got, want) + } + } + + parsed, err := parseMsg(value) + if err != nil { + t.Fatal(err) + } + + if parsed.A != nil || parsed.B == nil || parsed.B.X != 4 || parsed.B.Ext != nil { + t.Fatalf("parse kept a not comprehended IE: A %v B %+v", parsed.A, parsed.B) + } + + if !slices.EqualFunc(parsed.meta.Diagnostics().IEs, got, func(a, b Diagnostic[uint16]) bool { + return a.ID == b.ID && a.Kind == b.Kind && slices.Equal(a.Path, b.Path) + }) { + t.Fatalf("parse diagnostics %v differ from decode diagnostics %v", parsed.meta.Diagnostics().IEs, got) + } + + for name, m := range map[string]*msg{"decoded": decoded, "parsed": parsed} { + if b := encodeMsg(t, m); !bytes.Equal(b, value) { + t.Fatalf("%s re-encoded %x, want %x", name, b, value) + } + } +} + +func TestPrunedExtensionStaysInWireOrder(t *testing.T) { + ext := func(id uint16, v octet) Field[uint16] { + return Field[uint16]{ID: id, Criticality: CriticalityIgnore, Value: encodeValue(t, v)} + } + + b := itemValue(t, ext(600, 1), ext(idItem, notComprehendedOctet), ext(601, 2)) + + var it item + if err := DecodeValue(b, &it); err != nil { + t.Fatal(err) + } + + Prune[uint16](&it) + + if it.Ext != nil { + t.Fatalf("Ext = %v, want pruned", *it.Ext) + } + + if got := encodeValue(t, &it); !bytes.Equal(got, b) { + t.Fatalf("re-encoded %x, want %x", got, b) + } + + d := Diagnose[uint16](&it) + for _, e := range d.IEs { + if e.Kind == KindMissing { + t.Fatalf("a pruned extension is reported missing: %v", d.IEs) + } + } +} + +func TestDecodeValueRejectsTrailingOctets(t *testing.T) { + b := append(itemValue(t), 0x00) + + var it item + if err := DecodeValue(b, &it); !errors.Is(err, per.ErrTrailing) { + t.Fatalf("DecodeValue = %v, want per.ErrTrailing", err) + } + + m := messageValue(t, Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: append(encodeValue(t, octet(1)), 0x00)}) + if _, err := decodeMsg(m); !errors.Is(err, per.ErrTrailing) { + t.Fatalf("decode with a trailing octet in an IE value = %v, want per.ErrTrailing", err) + } + + if _, err := decodeMsg(append(messageValue(t, Field[uint16]{ID: idA, Criticality: CriticalityReject, Value: []byte{0x01}}), 0x00)); !errors.Is(err, per.ErrTrailing) { + t.Fatalf("decode with a trailing octet after the message = %v, want per.ErrTrailing", err) + } +} + +type choice struct { + Known *octet + Raw *SingleContainer[uint16] +} + +func (c *choice) Diagnose(d *Diagnosis[uint16]) bool { + switch { + case c.Known != nil: + return DiagnoseChoiceExtension(d, idItem, CriticalityIgnore, &c.Known, &c.Raw) + case c.Raw != nil: + return DiagnoseUnknownChoiceExtension(d, c.Raw) + } + + return false +} + +func TestChoiceExtensionNotComprehendedReachesTheEnclosingIE(t *testing.T) { + for name, c := range map[string]*choice{ + "unknown alternative": {Raw: &SingleContainer[uint16]{ID: 999, Criticality: CriticalityIgnore, Value: "\x00"}}, + "not comprehended typed IE": {Known: ptr(octet(notComprehendedOctet))}, + } { + var d Diagnosis[uint16] + + if !d.IE(idB, CriticalityReject, c) { + t.Errorf("%s: the enclosing IE is comprehended", name) + } + + var ase *AbstractSyntaxError[uint16] + if err := d.Diagnostics().Check(); !errors.As(err, &ase) || len(ase.IEs) != 1 || ase.IEs[0].ID != idB { + t.Errorf("%s: Check() = %v, want a reject on the enclosing IE", name, err) + } + } + + c := &choice{Known: ptr(octet(notComprehendedOctet))} + Prune[uint16](c) + + if c.Known != nil || c.Raw == nil || c.Raw.ID != idItem || c.Raw.Value != string(encodeValue(t, octet(notComprehendedOctet))) { + t.Fatalf("pruned choice = %+v", c) + } +} + +func ptr[T any](v T) *T { return &v } diff --git a/per/ap/transport_layer_address.go b/per/ap/internal/impl/transport_layer_address.go similarity index 80% rename from per/ap/transport_layer_address.go rename to per/ap/internal/impl/transport_layer_address.go index 1c3767f068..dca9f8ba7c 100644 --- a/per/ap/transport_layer_address.go +++ b/per/ap/internal/impl/transport_layer_address.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "encoding/hex" @@ -22,7 +22,7 @@ var ErrTransportLayerAddress = errors.New("ap: invalid transport layer address") type TransportLayerAddress struct { octets string - bits int + length int } func TransportLayerAddressFrom(addr netip.Addr) (TransportLayerAddress, error) { @@ -32,11 +32,11 @@ func TransportLayerAddressFrom(addr netip.Addr) (TransportLayerAddress, error) { case addr.Is4(): a := addr.As4() - return TransportLayerAddress{octets: string(a[:]), bits: tnlIPv4Bits}, nil + return TransportLayerAddress{octets: string(a[:]), length: tnlIPv4Bits + 1}, nil case addr.Is6(): a := addr.As16() - return TransportLayerAddress{octets: string(a[:]), bits: tnlIPv6Bits}, nil + return TransportLayerAddress{octets: string(a[:]), length: tnlIPv6Bits + 1}, nil default: return TransportLayerAddress{}, ErrTransportLayerAddress } @@ -57,7 +57,7 @@ func TransportLayerAddressFromAddrs(ipv4, ipv6 netip.Addr) (TransportLayerAddres case ipv4.IsValid() && ipv6.IsValid(): a4, a6 := ipv4.As4(), ipv6.As16() - return TransportLayerAddress{octets: string(a4[:]) + string(a6[:]), bits: tnlDualBits}, nil + return TransportLayerAddress{octets: string(a4[:]) + string(a6[:]), length: tnlDualBits + 1}, nil case ipv4.IsValid(): return TransportLayerAddressFrom(ipv4) case ipv6.IsValid(): @@ -68,11 +68,15 @@ func TransportLayerAddressFromAddrs(ipv4, ipv6 netip.Addr) (TransportLayerAddres } func TransportLayerAddressFromOctets(b []byte) TransportLayerAddress { + if len(b) == 0 { + return TransportLayerAddress{} + } + return newTransportLayerAddress(b, len(b)*8) } func TransportLayerAddressFromBits(b []byte, nbits int) (TransportLayerAddress, bool) { - if nbits < 0 || nbits > len(b)*8 { + if nbits < 1 || nbits > len(b)*8 { return TransportLayerAddress{}, false } @@ -88,17 +92,17 @@ func newTransportLayerAddress(b []byte, nbits int) TransportLayerAddress { octets[n-1] &= byte(0xff << (8 - rem)) } - return TransportLayerAddress{octets: string(octets), bits: nbits} + return TransportLayerAddress{octets: string(octets), length: nbits + 1} } -func (a TransportLayerAddress) Bits() int { return a.bits } +func (a TransportLayerAddress) Bits() int { return max(a.length-1, 0) } func (a TransportLayerAddress) Bytes() []byte { return []byte(a.octets) } -func (a TransportLayerAddress) IsZero() bool { return a.bits == 0 } +func (a TransportLayerAddress) IsZero() bool { return a.length == 0 } func (a TransportLayerAddress) Valid() bool { - switch a.bits { + switch a.Bits() { case tnlIPv4Bits, tnlIPv6Bits, tnlDualBits: return true default: @@ -107,7 +111,7 @@ func (a TransportLayerAddress) Valid() bool { } func (a TransportLayerAddress) IPv4() netip.Addr { - if a.bits != tnlIPv4Bits && a.bits != tnlDualBits { + if n := a.Bits(); n != tnlIPv4Bits && n != tnlDualBits { return netip.Addr{} } @@ -115,7 +119,7 @@ func (a TransportLayerAddress) IPv4() netip.Addr { } func (a TransportLayerAddress) IPv6() netip.Addr { - switch a.bits { + switch a.Bits() { case tnlIPv6Bits: return netip.AddrFrom16([16]byte([]byte(a.octets))) case tnlDualBits: @@ -126,7 +130,7 @@ func (a TransportLayerAddress) IPv6() netip.Addr { } func (a TransportLayerAddress) String() string { - switch a.bits { + switch a.Bits() { case tnlIPv4Bits: return a.IPv4().String() case tnlIPv6Bits: @@ -134,12 +138,16 @@ func (a TransportLayerAddress) String() string { case tnlDualBits: return a.IPv4().String() + "," + a.IPv6().String() default: - return hex.EncodeToString([]byte(a.octets)) + "/" + strconv.Itoa(a.bits) + return hex.EncodeToString([]byte(a.octets)) + "/" + strconv.Itoa(a.Bits()) } } func (a TransportLayerAddress) MarshalPER(w *per.Writer, enc per.Encoding) error { - return per.EncodeBitString(w, enc, 1, tnlDualBits, true, true, true, []byte(a.octets), a.bits) + if a.IsZero() { + return ErrTransportLayerAddress + } + + return per.EncodeBitString(w, enc, 1, tnlDualBits, true, true, true, []byte(a.octets), a.Bits()) } func (a *TransportLayerAddress) UnmarshalPER(r *per.Reader, enc per.Encoding) error { diff --git a/per/ap/transport_layer_address_test.go b/per/ap/internal/impl/transport_layer_address_test.go similarity index 88% rename from per/ap/transport_layer_address_test.go rename to per/ap/internal/impl/transport_layer_address_test.go index 28b6f2ac18..787ec4f91c 100644 --- a/per/ap/transport_layer_address_test.go +++ b/per/ap/internal/impl/transport_layer_address_test.go @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Ella Networks Inc. // SPDX-License-Identifier: BUSL-1.1 -package ap +package impl import ( "bytes" @@ -266,7 +266,7 @@ func TestTransportLayerAddressKeepsOddLengths(t *testing.T) { func TestTransportLayerAddressKeepsExtensionLengths(t *testing.T) { b := bytes.Repeat([]byte{0xa5}, 32) - for _, nbits := range []int{0, 161, 200, 255} { + for _, nbits := range []int{161, 200, 255} { for _, enc := range []per.Encoding{per.Aligned, per.Unaligned} { a, _ := TransportLayerAddressFromBits(b, nbits) @@ -296,3 +296,40 @@ func TestTransportLayerAddressString(t *testing.T) { } } } + +func TestTransportLayerAddressZeroValueDoesNotEncode(t *testing.T) { + var unset TransportLayerAddress + + if _, err := per.Marshal(unset, per.Aligned); !errors.Is(err, ErrTransportLayerAddress) { + t.Fatalf("encoding the zero TransportLayerAddress = %v, want %v", err, ErrTransportLayerAddress) + } + + if a := TransportLayerAddressFromOctets(nil); !a.IsZero() { + t.Fatalf("TransportLayerAddressFromOctets(nil) = %v, want the zero value", a) + } + + if _, ok := TransportLayerAddressFromBits([]byte{0xff}, 0); ok { + t.Fatal("TransportLayerAddressFromBits accepted a 0-bit address") + } +} + +func TestTransportLayerAddressKeepsAZeroBitExtensionValue(t *testing.T) { + for _, enc := range []per.Encoding{per.Aligned, per.Unaligned} { + w := per.NewWriter() + if err := per.EncodeBitString(w, enc, 1, tnlDualBits, true, true, true, nil, 0); err != nil { + t.Fatal(err) + } + + w.WriteBit(true) + wire := w.Bytes() + + a := decodeTLAThenBit(t, enc, wire) + if a.IsZero() || a.Bits() != 0 || a.Valid() { + t.Fatalf("%v: decoded %+v, want a present 0-bit value", enc, a) + } + + if got := encodeTLAThenBit(t, enc, a); !bytes.Equal(got, wire) { + t.Fatalf("%v: re-encoded %x, want %x", enc, got, wire) + } + } +} diff --git a/per/charstring.go b/per/charstring.go index 427bd6a86a..199404d78e 100644 --- a/per/charstring.go +++ b/per/charstring.go @@ -314,7 +314,7 @@ func decodeKMStringLen( return "", err } - return expandChars(t, chars, b), nil + return expandChars(t, chars, b) } func decodeFixedChars(r *Reader, enc Encoding, t charStringType, n int, b int, octetAlign bool) (string, error) { @@ -332,18 +332,25 @@ func decodeFixedChars(r *Reader, enc Encoding, t charStringType, n int, b int, o chars = append(chars, uint32(v)) } - return expandChars(t, chars, b), nil + return expandChars(t, chars, b) } // expandChars converts compacted numeric values back to a string (§30.5.4). -func expandChars(t charStringType, chars []uint32, b int) string { +func expandChars(t charStringType, chars []uint32, b int) (string, error) { + var sb strings.Builder + if !needsCompaction(t, b) { - var sb strings.Builder + info := charSet(t) + for _, v := range chars { + if uint64(v) > info.ub || uint64(v) < info.lb { + return "", fmt.Errorf("%w: character %q outside the permitted alphabet", ErrOverflow, rune(v)) + } + sb.WriteRune(rune(v)) } - return sb.String() + return sb.String(), nil } table := buildCharTable(t) @@ -353,10 +360,14 @@ func expandChars(t charStringType, chars []uint32, b int) string { reverse[v] = r } - var sb strings.Builder for _, v := range chars { - sb.WriteRune(reverse[v]) + r, ok := reverse[v] + if !ok { + return "", fmt.Errorf("%w: character index %d outside the permitted alphabet", ErrOverflow, v) + } + + sb.WriteRune(r) } - return sb.String() + return sb.String(), nil } diff --git a/per/charstring_alphabet_test.go b/per/charstring_alphabet_test.go new file mode 100644 index 0000000000..4c049c903e --- /dev/null +++ b/per/charstring_alphabet_test.go @@ -0,0 +1,64 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package per + +import ( + "errors" + "testing" +) + +func TestDecodedCharacterOutsideTheAlphabetIsRejected(t *testing.T) { + for _, enc := range []Encoding{Aligned, Unaligned} { + w := NewWriter() + if err := EncodeKnownMultiplierString(w, enc, CharPrintableString, 1, 150, true, true, true, "a"); err != nil { + t.Fatal(err) + } + + b := w.Bytes() + b[len(b)-1] = 0x00 + + if enc == Unaligned { + b[len(b)-1] = 0x7f + } + + if _, err := DecodeKnownMultiplierString(NewReader(b), enc, CharPrintableString, 1, 150, true, true, true); !errors.Is(err, ErrOverflow) { + t.Errorf("%v: decode = %v, want ErrOverflow: the encoder refuses the same value", enc, err) + } + } +} + +func TestCompleteRejectsTrailingOctets(t *testing.T) { + for _, c := range []struct { + b []byte + read int + ok bool + }{ + {[]byte{0x00}, 0, true}, + {[]byte{0x80}, 1, true}, + {[]byte{0x80, 0x00}, 1, false}, + {[]byte{0xff, 0xff}, 16, true}, + {[]byte{0xff, 0xff, 0x00}, 16, false}, + } { + r := NewReader(c.b) + if _, err := r.ReadBits(c.read); err != nil { + t.Fatal(err) + } + + if err := r.Complete(); (err == nil) != c.ok { + t.Errorf("%x after %d bits: Complete() = %v, want ok %v", c.b, c.read, err, c.ok) + } + } +} + +func TestEmptyOctetStringDecodesNonNil(t *testing.T) { + w := NewWriter() + if err := EncodeOctetString(w, Aligned, 0, 0, true, false, false, nil); err != nil { + t.Fatal(err) + } + + b, err := DecodeOctetString(NewReader(w.Bytes()), Aligned, 0, 0, true, false, false) + if err != nil || b == nil || len(b) != 0 { + t.Fatalf("DecodeOctetString = %#v, %v, want a present empty value", b, err) + } +} diff --git a/per/content.go b/per/content.go index 3bbe9011b3..395c2bda1d 100644 --- a/per/content.go +++ b/per/content.go @@ -260,7 +260,7 @@ func DecodeOctetString( } if hasUB && ub == 0 { - return nil, nil + return []byte{}, nil } if hasUB && hasLB && ub == lb { @@ -284,7 +284,7 @@ func decodeOctetStringValue( r *Reader, enc Encoding, lb, ub int64, hasUB bool, ) ([]byte, error) { - var buf []byte + buf := []byte{} err := DecodeLength(r, enc, lb, ub, hasUB, func(count int64) error { p, err := readOctetAligned(r, enc, int(count)) diff --git a/per/errors.go b/per/errors.go index 1fa51d8341..6a71a96933 100644 --- a/per/errors.go +++ b/per/errors.go @@ -13,6 +13,7 @@ var ( // ErrUnaligned: an octet-oriented operation on a non-octet-aligned position. ErrUnaligned = errors.New("per: not octet-aligned") // ErrEmpty: a CHOICE or mandatory field has no value set. - ErrEmpty = errors.New("per: no value set") - ErrChoice = errors.New("per: CHOICE has more than one alternative set") + ErrEmpty = errors.New("per: no value set") + ErrChoice = errors.New("per: CHOICE has more than one alternative set") + ErrTrailing = errors.New("per: octets after the complete encoding") ) diff --git a/per/marshal.go b/per/marshal.go index 44f7b5afee..d72e5339ff 100644 --- a/per/marshal.go +++ b/per/marshal.go @@ -39,7 +39,7 @@ func Marshal(m Marshaler, enc ...Encoding) ([]byte, error) { } // Unmarshal decodes b into u; enc defaults to [Aligned]. Bits left unread are -// not an error, since a top-level encoding is padded to an octet boundary. +// an error unless they are the padding of X.691 §11.1. func Unmarshal(b []byte, u Unmarshaler, enc ...Encoding) error { e := Aligned if len(enc) > 0 { @@ -48,5 +48,9 @@ func Unmarshal(b []byte, u Unmarshaler, enc ...Encoding) error { r := NewReader(b) - return u.UnmarshalPER(r, e) + if err := u.UnmarshalPER(r, e); err != nil { + return err + } + + return r.Complete() } diff --git a/per/opentype.go b/per/opentype.go index c9b9121b61..b30b339f02 100644 --- a/per/opentype.go +++ b/per/opentype.go @@ -34,9 +34,22 @@ func DecodeOpenType(r *Reader, enc Encoding, u Unmarshaler) error { return err } + return u.UnmarshalPER(NewReader(buf), enc) +} + +func DecodeCompleteOpenType(r *Reader, enc Encoding, u Unmarshaler) error { + buf, err := DecodeOpenTypeBytes(r, enc) + if err != nil { + return err + } + inner := NewReader(buf) - return u.UnmarshalPER(inner, enc) + if err := u.UnmarshalPER(inner, enc); err != nil { + return err + } + + return inner.Complete() } // SkipOpenType reads and discards an open type field (§11.2). diff --git a/per/pergen/ap_test.go b/per/pergen/ap_test.go index 53fe5dbb78..00c301c216 100644 --- a/per/pergen/ap_test.go +++ b/per/pergen/ap_test.go @@ -30,23 +30,25 @@ func TestGenerateApplicationProtocolFixture(t *testing.T) { for _, want := range []string{ "func (kind Kind) MarshalPER(w *per.Writer, enc per.Encoding) error {\n\treturn enumKind.Encode(w, enc, kind)", "func (kind Kind) Name() string {\n\treturn enumKind.Name(kind)", - "func (kind Kind) Diagnose(*ap.Diagnosis[ID]) bool {\n\treturn !enumKind.Known(kind)", - "var extIEsInner = []ap.IESpec[ID, Inner]{", + "func (kind Kind) Diagnose(*apimpl.Diagnosis[ID]) bool {\n\treturn !enumKind.Known(kind)", + "var extIEsInner = []apimpl.IESpec[ID, Inner]{", "ID: IDThing,", - "ext := ap.ExtensionFields(extIEsInner, inner, inner.ext)", - "ap.DecodeExtensionContainer(profile, r, enc, extIEsInner, inner, &inner.ext)", - "ap.DiagnoseExtensions(d, extIEsInner, inner, inner.ext)", + "ext := apimpl.ExtensionFields(extIEsInner, inner, inner.ext)", + "apimpl.DecodeExtensionContainer(profile, r, enc, extIEsInner, inner, &inner.ext)", + "apimpl.DiagnoseExtensions(d, extIEsInner, inner, &inner.ext)", "*inner = Inner{}", "inner.add.UnmarshalPER(r, enc)", "choice.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx)", - "f, err := ap.DecodeSingleContainerValue[ID](profile, r, enc)", - "choice.crit = ap.Wire(f.Criticality, ap.CriticalityReject)", - "if !ap.Comprehended[ID](&v) {", + "f, err := apimpl.DecodeSingleContainerValue[ID](profile, r, enc)", + "choice.crit = apimpl.Wire(f.Criticality, apimpl.CriticalityReject)", + "if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil {", + "Clear: func(x *Inner) {", "choice.Raw = &f", - "return ap.EncodeField(profile, w, enc, ap.FieldValue[ID]{ID: IDThing, Criticality: choice.crit.Of(ap.CriticalityReject), Value: choice.Typed})", - "d.Unknown(choice.Raw.ID, choice.Raw.Criticality)", + "return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ID]{ID: IDThing, Criticality: choice.crit.Of(apimpl.CriticalityReject), Value: choice.Typed})", + "return apimpl.DiagnoseUnknownChoiceExtension(d, choice.Raw)", + "return apimpl.DiagnoseChoiceExtension(d, IDThing, choice.crit.Of(apimpl.CriticalityReject), &choice.Typed, &choice.Raw)", "return per.ErrChoice", - "func (list List) Diagnose(d *ap.Diagnosis[ID]) bool {", + "func (list List) Diagnose(d *apimpl.Diagnosis[ID]) bool {", "func (inner Inner) Equal(y Inner) bool {", "(inner.Thing == nil) == (y.Thing == nil) && (inner.Thing == nil || (*inner.Thing) == *y.Thing)", "inner.ext == y.ext", diff --git a/per/pergen/emit.go b/per/pergen/emit.go index 2e5d44ded4..6b127c44bd 100644 --- a/per/pergen/emit.go +++ b/per/pergen/emit.go @@ -83,7 +83,7 @@ func (g *generator) parseStruct(name string, named *types.Named, s *types.Struct return nil, err } - if err := g.requireType(f, apImportPath, "WireCriticality", false); err != nil { + if err := g.requireType(f, apInternalPath, "WireCriticality", false); err != nil { return nil, err } @@ -103,7 +103,7 @@ func (g *generator) parseStruct(name string, named *types.Named, s *types.Struct return nil, err } - if err := g.requireType(f, apImportPath, "Preserved", false); err != nil { + if err := g.requireType(f, apInternalPath, "Preserved", false); err != nil { return nil, err } @@ -117,7 +117,7 @@ func (g *generator) parseStruct(name string, named *types.Named, s *types.Struct return nil, err } - if err := g.requireType(f, apImportPath, "SingleContainer", true); err != nil { + if err := g.requireType(f, apInternalPath, "SingleContainer", true); err != nil { return nil, err } diff --git a/per/pergen/emit_ap.go b/per/pergen/emit_ap.go index b4f0cecaf2..1d1cda6d6d 100644 --- a/per/pergen/emit_ap.go +++ b/per/pergen/emit_ap.go @@ -10,7 +10,11 @@ import ( "go/types" ) -const apImportPath = "github.com/ellanetworks/core/per/ap" +const ( + apImportPath = "github.com/ellanetworks/core/per/ap/apimpl" + apPublicPath = "github.com/ellanetworks/core/per/ap" + apInternalPath = "github.com/ellanetworks/core/per/ap/internal/impl" +) type enumInfo struct { varName string @@ -140,7 +144,7 @@ func (g *generator) emitEnum(name string, e enumInfo) { if g.apMode() && e.extensible { g.usesAP = true - fmt.Fprintf(r, "func (%s %s) Diagnose(*ap.Diagnosis[%s]) bool {\n\treturn !%s.Known(%s)\n}\n\n", recv, name, g.cfg.IEID, e.varName, recv) + fmt.Fprintf(r, "func (%s %s) Diagnose(*apimpl.Diagnosis[%s]) bool {\n\treturn !%s.Known(%s)\n}\n\n", recv, name, g.cfg.IEID, e.varName, recv) } } @@ -172,7 +176,7 @@ func (g *generator) emitListDiagnose(name string) { r := &g.buf recv := g.receiver(name) - fmt.Fprintf(r, "func (%s %s) Diagnose(d *ap.Diagnosis[%s]) bool {\n", recv, name, g.cfg.IEID) + fmt.Fprintf(r, "func (%s %s) Diagnose(d *apimpl.Diagnosis[%s]) bool {\n", recv, name, g.cfg.IEID) fmt.Fprintf(r, "\tnotComprehended := false\n") fmt.Fprintf(r, "\tfor i := range %s {\n\t\tif %s[i].Diagnose(d) {\n\t\t\tnotComprehended = true\n\t\t}\n\t}\n", recv, recv) fmt.Fprintf(r, "\treturn notComprehended\n}\n\n") @@ -284,7 +288,7 @@ func (g *generator) emitDiagnose(name string, st *structType) { r := &g.buf recv := g.receiver(name) - fmt.Fprintf(r, "func (%s *%s) Diagnose(d *ap.Diagnosis[%s]) bool {\n", recv, name, g.cfg.IEID) + fmt.Fprintf(r, "func (%s *%s) Diagnose(d *apimpl.Diagnosis[%s]) bool {\n", recv, name, g.cfg.IEID) if isChoiceType(st) { g.emitChoiceDiagnose(r, recv, st) @@ -298,7 +302,7 @@ func (g *generator) emitDiagnose(name string, st *structType) { expr := recv + "." + fi.name if fi.genTable { - fmt.Fprintf(r, "\tap.DiagnoseExtensions(d, %s, %s, %s)\n", fi.extTable, recv, expr) + fmt.Fprintf(r, "\tapimpl.DiagnoseExtensions(d, %s, %s, &%s)\n", fi.extTable, recv, expr) continue } @@ -331,6 +335,14 @@ func (g *generator) emitDiagnose(name string, st *structType) { } func (g *generator) emitChoiceDiagnose(r *bytes.Buffer, recv string, st *structType) { + raw := "" + + for _, fi := range st.fields { + if fi.rawSingle { + raw = recv + "." + fi.name + } + } + fmt.Fprintf(r, "\tswitch {\n") for _, fi := range st.fields { @@ -340,9 +352,9 @@ func (g *generator) emitChoiceDiagnose(r *bytes.Buffer, recv string, st *structT switch { case fi.rawSingle: - fmt.Fprintf(r, "\t\td.Unknown(%s.ID, %s.Criticality)\n", expr, expr) + fmt.Fprintf(r, "\t\treturn apimpl.DiagnoseUnknownChoiceExtension(d, %s)\n", expr) case fi.tag.ExtIE: - fmt.Fprintf(r, "\t\td.IE(%s, %s, %s)\n", fi.tag.ExtIEID, g.choiceCritExpr(recv, st, fi), expr) + fmt.Fprintf(r, "\t\treturn apimpl.DiagnoseChoiceExtension(d, %s, %s, &%s, &%s)\n", fi.tag.ExtIEID, g.choiceCritExpr(recv, st, fi), expr, raw) case g.fieldDiagnosable(g.diagTypes, fi) == diagValue: fmt.Fprintf(r, "\t\treturn %s.Diagnose(d)\n", expr) } @@ -367,22 +379,22 @@ func (g *generator) choiceCritExpr(recv string, st *structType, fi fieldInfo) st func critConst(c string) string { switch c { case "reject": - return "ap.CriticalityReject" + return "apimpl.CriticalityReject" case "notify": - return "ap.CriticalityNotify" + return "apimpl.CriticalityNotify" default: - return "ap.CriticalityIgnore" + return "apimpl.CriticalityIgnore" } } func presenceConst(p string) string { switch p { case "mandatory": - return "ap.PresenceMandatory" + return "apimpl.PresenceMandatory" case "conditional": - return "ap.PresenceConditional" + return "apimpl.PresenceConditional" default: - return "ap.PresenceOptional" + return "apimpl.PresenceOptional" } } @@ -393,12 +405,12 @@ func (g *generator) emitExtTable(name string, st *structType) { table := extTableName(name) if len(st.extIEs) == 0 { - fmt.Fprintf(r, "var %s []ap.IESpec[%s, %s]\n\n", table, g.cfg.IEID, name) + fmt.Fprintf(r, "var %s []apimpl.IESpec[%s, %s]\n\n", table, g.cfg.IEID, name) return } - fmt.Fprintf(r, "var %s = []ap.IESpec[%s, %s]{\n", table, g.cfg.IEID, name) + fmt.Fprintf(r, "var %s = []apimpl.IESpec[%s, %s]{\n", table, g.cfg.IEID, name) for _, fi := range st.extIEs { expr := "x." + fi.name @@ -433,6 +445,7 @@ func (g *generator) emitExtTable(name string, st *structType) { fmt.Fprintf(r, "\t\t\t\treturn nil\n\t\t\t}), true\n") } + fmt.Fprintf(r, "\t\t},\n\t\tClear: func(x *%s) {\n\t\t\t%s = nil\n", name, expr) fmt.Fprintf(r, "\t\t},\n\t},\n") } @@ -457,3 +470,11 @@ func (g *generator) receiver(typeName string) string { return recv } + +func (g *generator) openTypeDecoder() string { + if g.apMode() { + return "per.DecodeCompleteOpenType" + } + + return "per.DecodeOpenType" +} diff --git a/per/pergen/emit_choice.go b/per/pergen/emit_choice.go index 5886bb0b41..3806ad1124 100644 --- a/per/pergen/emit_choice.go +++ b/per/pergen/emit_choice.go @@ -76,7 +76,7 @@ func (g *generator) emitChoice(name string, s *structType) error { for _, a := range roots { if a.tag.ExtIE && !raw { - return fmt.Errorf("field %s: choice-Extensions needs a bare extie field of type *ap.SingleContainer for unknown alternatives", a.name) + return fmt.Errorf("field %s: choice-Extensions needs a bare extie field of type *apimpl.SingleContainer for unknown alternatives", a.name) } } @@ -124,9 +124,9 @@ func (g *generator) emitChoiceMarshal(recv, typeName string, roots, additions [] switch { case a.rawSingle: - fmt.Fprintf(r, "\t\treturn ap.EncodeField(%s, w, enc, %s.Field())\n", g.cfg.Profile, expr) + fmt.Fprintf(r, "\t\treturn apimpl.EncodeField(%s, w, enc, %s.Field())\n", g.cfg.Profile, expr) case a.tag.ExtIE: - fmt.Fprintf(r, "\t\treturn ap.EncodeField(%s, w, enc, ap.FieldValue[%s]{ID: %s, Criticality: %s, Value: %s})\n", + fmt.Fprintf(r, "\t\treturn apimpl.EncodeField(%s, w, enc, apimpl.FieldValue[%s]{ID: %s, Criticality: %s, Value: %s})\n", g.cfg.Profile, g.cfg.IEID, a.tag.ExtIEID, g.choiceCritExpr(recv, g.cur, a.fieldInfo), expr) default: g.emitFieldMarshal(r, recv, a.fieldInfo, derefExpr(a, expr), 2) @@ -225,7 +225,7 @@ func (g *generator) emitChoiceUnmarshal(recv, typeName string, roots, additions func (g *generator) emitChoiceSingleDecode(r *bytes.Buffer, recv string, singles []choiceAlt) { fmt.Fprintf(r, "\tcase %d:\n", singles[0].tag.ChoiceIdx) - fmt.Fprintf(r, "\t\tf, err := ap.DecodeSingleContainerValue[%s](%s, r, enc)\n", g.cfg.IEID, g.cfg.Profile) + fmt.Fprintf(r, "\t\tf, err := apimpl.DecodeSingleContainerValue[%s](%s, r, enc)\n", g.cfg.IEID, g.cfg.Profile) fmt.Fprintf(r, "\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n") fmt.Fprintf(r, "\t\tswitch f.ID {\n") @@ -245,12 +245,11 @@ func (g *generator) emitChoiceSingleDecode(r *bytes.Buffer, recv string, singles fmt.Fprintf(r, "\t\tcase %s:\n", a.tag.ExtIEID) fmt.Fprintf(r, "\t\t\tvar v %s\n", a.typeStr) - fmt.Fprintf(r, "\t\t\tif err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n") - fmt.Fprintf(r, "\t\t\tif !ap.Comprehended[%s](&v) {\n\t\t\t\t%s = &f\n\t\t\t\tbreak\n\t\t\t}\n", g.cfg.IEID, rawExpr(recv, singles)) + fmt.Fprintf(r, "\t\t\tif err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n") fmt.Fprintf(r, "\t\t\t%s = &v\n", expr) if g.cur.choiceCrit != "" { - fmt.Fprintf(r, "\t\t\t%s.%s = ap.Wire(f.Criticality, %s)\n", recv, g.cur.choiceCrit, critConst(a.tag.Criticality)) + fmt.Fprintf(r, "\t\t\t%s.%s = apimpl.Wire(f.Criticality, %s)\n", recv, g.cur.choiceCrit, critConst(a.tag.Criticality)) } } @@ -279,7 +278,7 @@ func (g *generator) emitChoiceExtDecode(r *bytes.Buffer, recv string, additions expr := recv + "." + a.name fmt.Fprintf(r, "\t\tcase %d:\n", a.extIdx) fmt.Fprintf(r, "\t\t\tvar v %s\n", a.typeStr) - fmt.Fprintf(r, "\t\t\tif err := per.DecodeOpenType(r, enc, &v); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n") + fmt.Fprintf(r, "\t\t\tif err := %s(r, enc, &v); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n", g.openTypeDecoder()) fmt.Fprintf(r, "\t\t\t%s = &v\n", expr) } @@ -309,7 +308,7 @@ func (g *generator) emitChoiceExtDecode(r *bytes.Buffer, recv string, additions expr := recv + "." + a.name fmt.Fprintf(r, "\t\tcase %d:\n", a.extIdx) fmt.Fprintf(r, "\t\t\tvar v %s\n", a.typeStr) - fmt.Fprintf(r, "\t\t\tif err := per.DecodeOpenType(r, enc, &v); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n") + fmt.Fprintf(r, "\t\t\tif err := %s(r, enc, &v); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n", g.openTypeDecoder()) fmt.Fprintf(r, "\t\t\t%s = &v\n", expr) } @@ -326,13 +325,3 @@ func derefExpr(a choiceAlt, expr string) string { return expr } - -func rawExpr(recv string, singles []choiceAlt) string { - for _, a := range singles { - if a.rawSingle { - return recv + "." + a.name - } - } - - return "" -} diff --git a/per/pergen/emit_equal.go b/per/pergen/emit_equal.go index bf67592697..57dc0ee885 100644 --- a/per/pergen/emit_equal.go +++ b/per/pergen/emit_equal.go @@ -295,8 +295,10 @@ func (g *generator) typeRef(t types.Type) (string, error) { switch { case g.pkg != nil && p.Path() == g.pkg.Path(): return "" - case p.Path() == apImportPath: + case p.Path() == apImportPath || p.Path() == apPublicPath || p.Path() == apInternalPath: g.usesAP = true + + return "apimpl" case p.Path() != perImportPath: foreign = append(foreign, p.Path()) } diff --git a/per/pergen/emit_struct.go b/per/pergen/emit_struct.go index 883587ebe8..0a02126ca5 100644 --- a/per/pergen/emit_struct.go +++ b/per/pergen/emit_struct.go @@ -62,7 +62,7 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields for _, fi := range rootFields { switch { case fi.genTable: - fmt.Fprintf(r, "\text := ap.ExtensionFields(%s, %s, %s.%s)\n", fi.extTable, recv, recv, fi.name) + fmt.Fprintf(r, "\text := apimpl.ExtensionFields(%s, %s, %s.%s)\n", fi.extTable, recv, recv, fi.name) case fi.extTable != "": fmt.Fprintf(r, "\text := extensionFields(%s, %s, &%s.%s)\n", fi.extTable, recv, recv, fi.name) } @@ -100,7 +100,7 @@ func (g *generator) emitMarshalExt(recv, typeName string, rootFields, extFields expr := recv + "." + fi.name if fi.genTable { fmt.Fprintf(r, "\tif len(ext) > 0 {\n") - fmt.Fprintf(r, "\t\tif err := ap.EncodeExtensionContainer(%s, w, enc, ext); err != nil {\n\t\t\treturn err\n\t\t}\n", g.cfg.Profile) + fmt.Fprintf(r, "\t\tif err := apimpl.EncodeExtensionContainer(%s, w, enc, ext); err != nil {\n\t\t\treturn err\n\t\t}\n", g.cfg.Profile) fmt.Fprintf(r, "\t}\n") } else if fi.extTable != "" { fmt.Fprintf(r, "\tif len(ext) > 0 {\n") @@ -331,7 +331,7 @@ func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extField expr := recv + "." + fi.name if fi.genTable { fmt.Fprintf(r, "\tif %s {\n", preambleVar(fi)) - fmt.Fprintf(r, "\t\tif err := ap.DecodeExtensionContainer(%s, r, enc, %s, %s, &%s); err != nil {\n\t\t\treturn err\n\t\t}\n", g.cfg.Profile, fi.extTable, recv, expr) + fmt.Fprintf(r, "\t\tif err := apimpl.DecodeExtensionContainer(%s, r, enc, %s, %s, &%s); err != nil {\n\t\t\treturn err\n\t\t}\n", g.cfg.Profile, fi.extTable, recv, expr) fmt.Fprintf(r, "\t}\n") } else if fi.extTable != "" { fmt.Fprintf(r, "\tif %s {\n", preambleVar(fi)) @@ -402,9 +402,9 @@ func (g *generator) emitUnmarshalExt(recv, typeName string, rootFields, extField fmt.Fprintf(r, "\t\t\t\tvar v %s\n", ef.typeStr) if ef.kind == kindDelegate { - fmt.Fprintf(r, "\t\t\t\tif err := per.DecodeOpenType(r, enc, &v); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n") + fmt.Fprintf(r, "\t\t\t\tif err := %s(r, enc, &v); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n", g.openTypeDecoder()) } else { - fmt.Fprintf(r, "\t\t\t\tif err := per.DecodeOpenType(r, enc, per.UnmarshalerFunc(func(r *per.Reader, enc per.Encoding) error {\n") + fmt.Fprintf(r, "\t\t\t\tif err := %s(r, enc, per.UnmarshalerFunc(func(r *per.Reader, enc per.Encoding) error {\n", g.openTypeDecoder()) g.emitFieldUnmarshal(r, "v", ef, 4) fmt.Fprintf(r, "\t\t\t\t\treturn nil\n") fmt.Fprintf(r, "\t\t\t\t})); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n") diff --git a/per/pergen/gen.go b/per/pergen/gen.go index d29c62ea59..34703c7c5d 100644 --- a/per/pergen/gen.go +++ b/per/pergen/gen.go @@ -398,5 +398,5 @@ func (g *generator) isMessage(named *types.Named) bool { n, ok := types.Unalias(v.Type()).(*types.Named) - return ok && n.Origin().Obj().Pkg() != nil && n.Origin().Obj().Pkg().Path() == apImportPath && n.Origin().Obj().Name() == "Message" + return ok && n.Origin().Obj().Pkg() != nil && n.Origin().Obj().Pkg().Path() == apInternalPath && n.Origin().Obj().Name() == "Message" } diff --git a/per/pergen/testdata/ap/fixture.go b/per/pergen/testdata/ap/fixture.go index d3fac096a9..a2fe7ef89d 100644 --- a/per/pergen/testdata/ap/fixture.go +++ b/per/pergen/testdata/ap/fixture.go @@ -5,14 +5,14 @@ package fixture import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type ID uint16 const IDThing ID = 7 -var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} +var profile = &apimpl.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} type Kind uint8 @@ -21,22 +21,22 @@ var enumKind = per.Enum[Kind]{Root: []string{"a", "b"}, Extension: []string{"c"} type Inner struct { K Kind Thing *Kind `per:",extie:IDThing,crit:ignore"` - ext ap.Preserved[ID] `per:",exttable"` + ext apimpl.Preserved[ID] `per:",exttable"` add per.ExtensionAdditions `per:",extraw"` } type Choice struct { In *Inner `per:",choice:0"` Typed *Inner `per:",choice:1,extie:IDThing,crit:reject"` - Raw *ap.SingleContainer[ID] `per:",choice:1,extie"` + Raw *apimpl.SingleContainer[ID] `per:",choice:1,extie"` Ext *per.ExtensionAlternative `per:",extalt"` - crit ap.WireCriticality `per:",choicecrit"` + crit apimpl.WireCriticality `per:",choicecrit"` } type List []Inner type Container struct { Typed *Inner `per:",choice:0,extie:IDThing,crit:ignore"` - Raw *ap.SingleContainer[ID] `per:",choice:0,extie"` - crit ap.WireCriticality `per:",choicecrit"` + Raw *apimpl.SingleContainer[ID] `per:",choice:0,extie"` + crit apimpl.WireCriticality `per:",choicecrit"` } diff --git a/per/pergen/testdata/apbad/choiceraw/fixture.go b/per/pergen/testdata/apbad/choiceraw/fixture.go index cdffb72c2d..809b05eb9c 100644 --- a/per/pergen/testdata/apbad/choiceraw/fixture.go +++ b/per/pergen/testdata/apbad/choiceraw/fixture.go @@ -5,12 +5,12 @@ package fixture import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type ID uint16 -var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} +var profile = &apimpl.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} const IDX ID = 1 diff --git a/per/pergen/testdata/apbad/equalref/fixture.go b/per/pergen/testdata/apbad/equalref/fixture.go index bc54d82b99..621870b67b 100644 --- a/per/pergen/testdata/apbad/equalref/fixture.go +++ b/per/pergen/testdata/apbad/equalref/fixture.go @@ -5,12 +5,12 @@ package fixture import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type ID uint16 -var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} +var profile = &apimpl.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} type Hand struct { byName map[string]uint8 @@ -23,5 +23,5 @@ func (h *Hand) UnmarshalPER(*per.Reader, per.Encoding) error { return nil } type T struct { A uint8 `per:",range:0..3"` Hand Hand - ext ap.Preserved[ID] `per:",exttable"` + ext apimpl.Preserved[ID] `per:",exttable"` } diff --git a/per/pergen/testdata/apbad/extseq/fixture.go b/per/pergen/testdata/apbad/extseq/fixture.go index e3bc299611..6687082acc 100644 --- a/per/pergen/testdata/apbad/extseq/fixture.go +++ b/per/pergen/testdata/apbad/extseq/fixture.go @@ -5,17 +5,17 @@ package fixture import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type ID uint16 -var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} +var profile = &apimpl.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} type T struct { A uint8 `per:",range:0..3"` _ [0]struct{} `per:"extseq"` - ext ap.Preserved[ID] `per:",exttable"` + ext apimpl.Preserved[ID] `per:",exttable"` } var _ per.Encoding diff --git a/per/pergen/testdata/apbad/handtable/fixture.go b/per/pergen/testdata/apbad/handtable/fixture.go index 2337324259..ca340d2fb4 100644 --- a/per/pergen/testdata/apbad/handtable/fixture.go +++ b/per/pergen/testdata/apbad/handtable/fixture.go @@ -5,17 +5,17 @@ package fixture import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type ID uint16 -var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} +var profile = &apimpl.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} -var tExt []ap.IESpec[ID, T] +var tExt []apimpl.IESpec[ID, T] type T struct { A uint8 `per:",range:0..3"` - ext ap.Preserved[ID] `per:",exttable:tExt"` + ext apimpl.Preserved[ID] `per:",exttable:tExt"` add per.ExtensionAdditions `per:",extraw"` } diff --git a/per/pergen/testdata/apbad/inlineenum/fixture.go b/per/pergen/testdata/apbad/inlineenum/fixture.go index e43bb47881..c51abaa91c 100644 --- a/per/pergen/testdata/apbad/inlineenum/fixture.go +++ b/per/pergen/testdata/apbad/inlineenum/fixture.go @@ -5,17 +5,17 @@ package fixture import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type ID uint16 -var profile = &ap.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} +var profile = &apimpl.Profile{Name: "fixture", MaxProtocolIEs: 65535, MaxProtocolExtensions: 65535} type E uint8 type T struct { A E `per:"ENUMERATED,range:0..1,..."` - ext ap.Preserved[ID] `per:",exttable"` + ext apimpl.Preserved[ID] `per:",exttable"` add per.ExtensionAdditions `per:",extraw"` } diff --git a/per/reader.go b/per/reader.go index 4029884e0f..ec7cf525e3 100644 --- a/per/reader.go +++ b/per/reader.go @@ -16,6 +16,8 @@ type Reader struct { // NewReader returns a Reader over b without copying it. func NewReader(b []byte) *Reader { return &Reader{buf: b} } +func (r *Reader) Reset(b []byte) { *r = Reader{buf: b} } + // Bits returns the number of bits remaining. func (r *Reader) Bits() int { return (len(r.buf)-r.pos)*8 - int(r.bit) @@ -120,6 +122,15 @@ func (r *Reader) ReadOctets(n int) ([]byte, error) { func (r *Reader) Offset() int { return r.pos*8 + int(r.bit) } +func (r *Reader) Complete() error { + read := r.Offset() + if len(r.buf)*8-read < 8 || (read == 0 && len(r.buf) == 1) { + return nil + } + + return ErrTrailing +} + func (r *Reader) Since(start int) ([]byte, int, error) { end := r.Offset() if start < 0 || start > end { diff --git a/s1ap/abstract_syntax_test.go b/s1ap/abstract_syntax_test.go index ad6bb4a26c..f06ce812fe 100644 --- a/s1ap/abstract_syntax_test.go +++ b/s1ap/abstract_syntax_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // As a peer would send it, without the rules the encoder normally enforces. @@ -73,7 +73,7 @@ func TestIEsOutOfOrderRejected(t *testing.T) { // §10.3.6 considers only IEs the receiver's version defines. func TestUnknownIEDoesNotBreakOrdering(t *testing.T) { fields := uplinkNASFields() - unknown := ieField{ID: ProtocolIEID(60000), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01, 0x02})} + unknown := ieField{ID: ProtocolIEID(60000), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x01, 0x02})} fields = append([]ieField{fields[0], fields[1], unknown}, fields[2:]...) msg, err := ParseUplinkNASTransport(container(t, fields...)) @@ -167,7 +167,7 @@ func TestDiagnosticsAreBounded(t *testing.T) { fields := uplinkNASFields() for i := range paddingIEs + 10 { fields = append(fields, ieField{ - ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00}), }) } @@ -193,7 +193,7 @@ func TestUEIDsSurvivePadding(t *testing.T) { var padded []ieField for i := range paddingIEs * 2 { padded = append(padded, ieField{ - ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00}), }) } @@ -281,11 +281,11 @@ func TestNotifyReportedAmongIgnoredIEs(t *testing.T) { fields := uplinkNASFields() for i := range paddingIEs + 10 { fields = append(fields, ieField{ - ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x00}), + ID: ProtocolIEID(40000 + i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x00}), }) } - fields = append(fields, ieField{ID: ProtocolIEID(50000), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x00})}) + fields = append(fields, ieField{ID: ProtocolIEID(50000), Criticality: CriticalityNotify, Value: apimpl.RawValue([]byte{0x00})}) msg, err := ParseUplinkNASTransport(container(t, fields...)) if err != nil { diff --git a/s1ap/asn1_constants_test.go b/s1ap/asn1_constants_test.go new file mode 100644 index 0000000000..04cd570723 --- /dev/null +++ b/s1ap/asn1_constants_test.go @@ -0,0 +1,263 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "reflect" + "strings" + "testing" + "unicode" +) + +type elementaryProcedure struct { + name string + code ProcedureCode + criticality Criticality + messages [3]string +} + +func asn1Values(t *testing.T, typeName string) map[int64]string { + t.Helper() + + s := vendoredSpec(t) + out := map[int64]string{} + + for _, m := range s.Modules { + for _, va := range m.Values { + if va.Type.Name != typeName { + continue + } + + n, err := s.Int(va.Value) + if err != nil { + t.Fatal(err) + } + + out[n] = va.Name + } + } + + return out +} + +func elementaryProcedures(t *testing.T) []elementaryProcedure { + t.Helper() + + s := vendoredSpec(t) + + class := s.Class("S1AP-ELEMENTARY-PROCEDURE") + if class == nil { + t.Fatal("S1AP-ELEMENTARY-PROCEDURE not found") + } + + def := class.Field("&criticality") + if def == nil || def.Default == nil || def.Default.Value == nil { + t.Fatal("S1AP-ELEMENTARY-PROCEDURE has no default criticality") + } + + set := s.ObjectSet("S1AP-ELEMENTARY-PROCEDURES") + if set == nil { + t.Fatal("S1AP-ELEMENTARY-PROCEDURES not found") + } + + objs, err := s.Objects(set.Set) + if err != nil { + t.Fatal(err) + } + + crits := map[string]Criticality{"reject": CriticalityReject, "ignore": CriticalityIgnore, "notify": CriticalityNotify} + + out := make([]elementaryProcedure, 0, len(objs)) + + for _, o := range objs { + cv, _ := o.Value("&procedureCode") + + code, err := s.Int(cv) + if err != nil { + t.Fatal(err) + } + + crit := def.Default.Value.Ref + if v, ok := o.Value("&criticality"); ok { + crit = v.Ref + } + + ep := elementaryProcedure{name: cv.Ref, code: ProcedureCode(code), criticality: crits[crit]} + + for i, f := range []string{"&InitiatingMessage", "&SuccessfulOutcome", "&UnsuccessfulOutcome"} { + if ty := o.Type(f); ty != nil { + ep.messages[i] = ty.Name + } + } + + out = append(out, ep) + } + + return out +} + +func goIdentifier(asn1Name string) string { + s := strings.ReplaceAll(strings.TrimPrefix(asn1Name, "id-"), "-", "") + r := []rune(s) + r[0] = unicode.ToUpper(r[0]) + + return string(r) +} + +func TestProtocolIEIDsMatchASN1(t *testing.T) { + spec := asn1Values(t, "ProtocolIE-ID") + + for id, name := range spec { + if got, ok := protocolIENames[ProtocolIEID(id)]; !ok || "id-"+got != name { + t.Errorf("%s = %d: protocolIENames has %q", name, id, got) + } + } + + for id, name := range protocolIENames { + if _, ok := spec[int64(id)]; !ok { + t.Errorf("protocolIENames[%d] = %q is not a TS 36.413 ProtocolIE-ID", uint16(id), name) + } + } +} + +func TestProcedureCodesMatchASN1(t *testing.T) { + spec := asn1Values(t, "ProcedureCode") + + for code, name := range spec { + if got := procedureNames[ProcedureCode(code)]; got != goIdentifier(name) { + t.Errorf("%s = %d: procedureNames has %q", name, code, got) + } + } + + for code, name := range procedureNames { + if _, ok := spec[int64(code)]; !ok { + t.Errorf("procedureNames[%d] = %q is not a TS 36.413 ProcedureCode", uint8(code), name) + } + } +} + +func TestProcedureInfoMatchesASN1(t *testing.T) { + eps := elementaryProcedures(t) + + if len(eps) != len(procedureInfos) { + t.Errorf("S1AP-ELEMENTARY-PROCEDURES has %d procedures, procedureInfos %d", len(eps), len(procedureInfos)) + } + + for _, ep := range eps { + info, ok := procedureInfos[ep.code] + if !ok { + t.Errorf("%s (%d) is missing from procedureInfos", ep.name, ep.code) + + continue + } + + if info.crit != ep.criticality { + t.Errorf("%s: criticality %s, spec says %s", ep.name, info.crit, ep.criticality) + } + + if info.outcome != (ep.messages[2] != "") { + t.Errorf("%s: unsuccessful outcome %v, spec defines %q", ep.name, info.outcome, ep.messages[2]) + } + } +} + +func TestMessagesMatchElementaryProcedures(t *testing.T) { + type slot struct { + ep elementaryProcedure + choice int + } + + bySpecName := map[string]slot{} + + for _, ep := range elementaryProcedures(t) { + for i, m := range ep.messages { + if m != "" { + bySpecName[m] = slot{ep, i} + } + } + } + + for _, c := range messageCases() { + t.Run(c.asn1, func(t *testing.T) { + want, ok := bySpecName[c.asn1] + if !ok { + t.Fatalf("%s is not a message of any S1AP-ELEMENTARY-PROCEDURE", c.asn1) + } + + b, err := sampleMessage(t, c.typ).Interface().(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + if pdu.choiceIndex() != want.choice || pdu.procedureCode() != want.ep.code || pdu.criticality() != want.ep.criticality { + t.Errorf("sent as choice %d, %s, %s; spec says choice %d, %s (%d), %s", + pdu.choiceIndex(), pdu.procedureCode(), pdu.criticality(), want.choice, want.ep.name, want.ep.code, want.ep.criticality) + } + }) + } +} + +func TestTypedCodecsCoverEveryMessage(t *testing.T) { + keys := map[string]typedKey{} + + for _, ep := range elementaryProcedures(t) { + for i, m := range ep.messages { + if m != "" { + keys[m] = typedKey{TriggeringMessage(i), ep.code} + } + } + } + + covered := map[typedKey]bool{} + + for _, c := range messageCases() { + key, ok := keys[c.asn1] + if !ok { + t.Errorf("%s is not a message of any elementary procedure", c.asn1) + + continue + } + + covered[key] = true + + codec, ok := typedCodecs[key] + if !ok { + t.Errorf("%s: typedCodecs has no entry for %v", c.asn1, key) + + continue + } + + b, err := sampleMessage(t, c.typ).Interface().(typedMessage).Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + msg, err := codec(pdu.value()) + if err != nil { + t.Errorf("%s: %v", c.asn1, err) + + continue + } + + if got := reflect.TypeOf(msg); got != reflect.PointerTo(c.typ) { + t.Errorf("%s: typedCodecs[%v] returns %v", c.asn1, key, got) + } + } + + for key := range typedCodecs { + if !covered[key] { + t.Errorf("typedCodecs[%v] has no message case", key) + } + } +} diff --git a/s1ap/asn1_spec_test.go b/s1ap/asn1_spec_test.go new file mode 100644 index 0000000000..db6cbf9011 --- /dev/null +++ b/s1ap/asn1_spec_test.go @@ -0,0 +1,110 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "os" + "sync" + "testing" + + "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/asn1spec" +) + +type tableRowSpec struct { + ID ProtocolIEID + Criticality Criticality + Presence ap.Presence +} + +var ( + asn1Once sync.Once + asn1Spec *asn1spec.Spec + asn1Err error +) + +func vendoredSpec(t *testing.T) *asn1spec.Spec { + t.Helper() + + asn1Once.Do(func() { + asn1Spec, asn1Err = asn1spec.ParseFS(os.DirFS("testdata/asn1"), "*.asn") + }) + + if asn1Err != nil { + t.Fatal(asn1Err) + } + + return asn1Spec +} + +func asn1Objects(t *testing.T, typeName, container string) []*asn1spec.Object { + t.Helper() + + s := vendoredSpec(t) + + ta := s.Type(typeName) + if ta == nil { + t.Fatalf("ASN.1 type %s not found", typeName) + } + + var set *asn1spec.ObjectSet + + for _, c := range ta.Type.Components { + if c.Type.Name == container && len(c.Type.Args) == 1 { + set = c.Type.Args[0].Set + } + } + + if set == nil { + t.Fatalf("%s has no %s", typeName, container) + } + + objs, err := s.Objects(set) + if err != nil { + t.Fatal(err) + } + + return objs +} + +func asn1Row(t *testing.T, o *asn1spec.Object) tableRowSpec { + t.Helper() + + crits := map[string]Criticality{"reject": CriticalityReject, "ignore": CriticalityIgnore, "notify": CriticalityNotify} + presences := map[string]ap.Presence{"optional": ap.PresenceOptional, "conditional": ap.PresenceConditional, "mandatory": ap.PresenceMandatory} + + idv, _ := o.Value("&id") + + id, err := vendoredSpec(t).Int(idv) + if err != nil { + t.Fatal(err) + } + + crit, _ := o.Value("&criticality") + pres, _ := o.Value("&presence") + + return tableRowSpec{ID: ProtocolIEID(id), Criticality: crits[crit.Ref], Presence: presences[pres.Ref]} +} + +func asn1Rows(t *testing.T, typeName, container string) []tableRowSpec { + t.Helper() + + objs := asn1Objects(t, typeName, container) + + out := make([]tableRowSpec, 0, len(objs)) + for _, o := range objs { + out = append(out, asn1Row(t, o)) + } + + return out +} + +func tableRows[M any](table []ieSpec[M]) []tableRowSpec { + out := make([]tableRowSpec, len(table)) + for i, r := range table { + out[i] = tableRowSpec{ID: r.ID, Criticality: r.Criticality, Presence: r.Presence} + } + + return out +} diff --git a/s1ap/bit_string.go b/s1ap/bit_string.go new file mode 100644 index 0000000000..498d18c5bb --- /dev/null +++ b/s1ap/bit_string.go @@ -0,0 +1,102 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/hex" + "strconv" + + "github.com/ellanetworks/core/per" +) + +type BitString struct { + octets string + bits int +} + +func BitStringFrom(b []byte, nbits int) BitString { + nbits = max(0, min(nbits, len(b)*8)) + n := (nbits + 7) / 8 + octets := make([]byte, n) + copy(octets, b[:n]) + + if rem := nbits % 8; rem != 0 { + octets[n-1] &= byte(0xff << (8 - rem)) + } + + return BitString{octets: string(octets), bits: nbits} +} + +func (b BitString) Bits() int { return b.bits } + +func (b BitString) Bytes() []byte { return []byte(b.octets) } + +func (b BitString) String() string { + return hex.EncodeToString([]byte(b.octets)) + "/" + strconv.Itoa(b.bits) +} + +func (b BitString) Equal(y BitString) bool { return b == y } + +func (b BitString) encode(w *per.Writer, enc per.Encoding, lb, ub int64, ext bool) error { + return per.EncodeBitString(w, enc, lb, ub, true, true, ext, []byte(b.octets), b.bits) +} + +func decodeBitString(r *per.Reader, enc per.Encoding, lb, ub int64, ext bool) (BitString, error) { + data, nbits, err := per.DecodeBitString(r, enc, lb, ub, true, true, ext) + if err != nil { + return BitString{}, err + } + + return BitStringFrom(data, nbits), nil +} + +const uint64RangeOctets = 8 + +func encodeUint64Range(w *per.Writer, enc per.Encoding, v uint64) error { + if enc == per.Unaligned { + w.WriteBits(v, 64) + + return nil + } + + octets := 1 + for x := v >> 8; x != 0; x >>= 8 { + octets++ + } + + return per.EncodeLength(w, enc, 1, uint64RangeOctets, true, int64(octets), func(int64) error { + w.AlignToByte() + + for i := octets - 1; i >= 0; i-- { + w.WriteBits(v>>(8*i)&0xff, 8) + } + + return nil + }) +} + +func decodeUint64Range(r *per.Reader, enc per.Encoding) (uint64, error) { + if enc == per.Unaligned { + return r.ReadBits(64) + } + + var v uint64 + + err := per.DecodeLength(r, enc, 1, uint64RangeOctets, true, func(count int64) error { + r.AlignToByte() + + for range count { + b, err := r.ReadBits(8) + if err != nil { + return err + } + + v = v<<8 | b + } + + return nil + }) + + return v, err +} diff --git a/s1ap/choice_alternatives_test.go b/s1ap/choice_alternatives_test.go new file mode 100644 index 0000000000..28d6bacca6 --- /dev/null +++ b/s1ap/choice_alternatives_test.go @@ -0,0 +1,375 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "maps" + "reflect" + "slices" + "strconv" + "strings" + "testing" + + "github.com/ellanetworks/core/per/asn1spec" +) + +type choiceCase struct { + asn1 string + typ reflect.Type +} + +func choiceCases() []choiceCase { + return []choiceCase{ + {"BroadcastCancelledAreaList", reflect.TypeFor[BroadcastCancelledAreaList]()}, + {"BroadcastCompletedAreaList", reflect.TypeFor[BroadcastCompletedAreaList]()}, + {"Cause", reflect.TypeFor[Cause]()}, + {"ENB-ID", reflect.TypeFor[ENBID]()}, + {"EN-DCSONTransferType", reflect.TypeFor[ENDCSONTransferType]()}, + {"Global-RAN-NODE-ID", reflect.TypeFor[GlobalRANNodeID]()}, + {"GNB-Identity", reflect.TypeFor[GNBIdentity]()}, + {"LastVisitedCell-Item", reflect.TypeFor[LastVisitedCellItem]()}, + {"LastVisitedGERANCellInformation", reflect.TypeFor[LastVisitedGERANCellInformation]()}, + {"MMEPagingTarget", reflect.TypeFor[MMEPagingTarget]()}, + {"OverloadResponse", reflect.TypeFor[OverloadResponse]()}, + {"ResetType", reflect.TypeFor[ResetType]()}, + {"SONInformation", reflect.TypeFor[SONInformation]()}, + {"SONInformationReport", reflect.TypeFor[SONInformationReport]()}, + {"SourceNodeID", reflect.TypeFor[SourceNodeID]()}, + {"TargetID", reflect.TypeFor[TargetID]()}, + {"UEPagingID", reflect.TypeFor[UEPagingID]()}, + {"UE-S1AP-IDs", reflect.TypeFor[UES1APIDs]()}, + {"WarningAreaList", reflect.TypeFor[WarningAreaList]()}, + } +} + +type choiceField struct { + field reflect.StructField + index int + ext bool + raw bool +} + +func choiceFields(t *testing.T, typ reflect.Type) (fields []choiceField, extalt bool) { + t.Helper() + + for i := range typ.NumField() { + f := typ.Field(i) + opts := strings.Split(f.Tag.Get("per"), ",") + + cf := choiceField{field: f, index: -1} + + for _, o := range opts { + switch { + case o == "extalt": + extalt = true + case o == "ext": + cf.ext = true + case o == "extie": + cf.raw = true + case strings.HasPrefix(o, "choice:"): + n, err := strconv.Atoi(strings.TrimPrefix(o, "choice:")) + if err != nil { + t.Fatal(err) + } + + cf.index = n + } + } + + if cf.index >= 0 { + fields = append(fields, cf) + } + } + + return fields, extalt +} + +func normalizeName(s string) string { + return strings.ToLower(strings.NewReplacer("-", "", "_", "").Replace(s)) +} + +func alternativeMatches(f reflect.StructField, c *asn1spec.Component) bool { + elem := f.Type + for elem.Kind() == reflect.Pointer { + elem = elem.Elem() + } + + return normalizeName(f.Name) == normalizeName(c.Name) || + (c.Type.Kind == asn1spec.Reference && normalizeName(elem.Name()) == normalizeName(c.Type.Name)) +} + +func isSingleContainer(s *asn1spec.Spec, ty *asn1spec.Type) bool { + _, ok := singleContainerSet(s, ty) + + return ok +} + +func singleContainerSet(s *asn1spec.Spec, ty *asn1spec.Type) (string, bool) { + for range 8 { + if ty.Kind != asn1spec.Reference { + return "", false + } + + if ty.Name == "ProtocolIE-SingleContainer" { + if len(ty.Args) != 1 || ty.Args[0].Set == nil || len(ty.Args[0].Set.Root) != 1 { + return "", true + } + + return ty.Args[0].Set.Root[0].Ref, true + } + + ta := s.Type(ty.Name) + if ta == nil { + return "", false + } + + ty = ta.Type + } + + return "", false +} + +type choiceExtensionCase struct { + set string + typ reflect.Type +} + +func choiceExtensionCases() []choiceExtensionCase { + return []choiceExtensionCase{ + {"SONInformation-ExtensionIE", reflect.TypeFor[SONInformationExtension]()}, + {"SourceNodeID-ExtensionIE", reflect.TypeFor[SourceNodeID]()}, + } +} + +func TestChoiceCasesAreComplete(t *testing.T) { + s := vendoredSpec(t) + + sets := map[string]bool{} + types := map[reflect.Type]bool{} + + for _, c := range choiceExtensionCases() { + sets[c.set] = true + types[c.typ] = true + } + + for _, c := range choiceCases() { + types[c.typ] = true + + ta := s.Type(c.asn1) + if ta == nil { + t.Errorf("%s not found", c.asn1) + + continue + } + + for _, comp := range ta.Type.Components { + set, ok := singleContainerSet(s, comp.Type) + if !ok { + continue + } + + if set == "" { + t.Errorf("%s.%s: cannot name the choice-Extensions set of %s", c.asn1, comp.Name, comp.Type) + + continue + } + + if !sets[set] { + t.Errorf("%s.%s: %s has no choiceExtensionCases entry", c.asn1, comp.Name, set) + } + } + } + + checkComplete(t, "CHOICE", scannedDecls(t).choices, slices.Collect(maps.Keys(types))) +} + +func TestChoiceAlternativesMatchASN1(t *testing.T) { + s := vendoredSpec(t) + + for _, c := range choiceCases() { + t.Run(c.asn1, func(t *testing.T) { + ta := s.Type(c.asn1) + if ta == nil || ta.Type.Kind != asn1spec.Choice { + t.Fatalf("%s is not an ASN.1 CHOICE", c.asn1) + } + + var root, ext []*asn1spec.Component + + for _, comp := range ta.Type.Components { + if comp.Extension { + ext = append(ext, comp) + } else { + root = append(root, comp) + } + } + + fields, extalt := choiceFields(t, c.typ) + + if extalt != ta.Type.Extensible { + t.Errorf("extalt field %v, spec extensible %v", extalt, ta.Type.Extensible) + } + + seenRoot := make([]bool, len(root)) + seenExt := make([]bool, len(ext)) + + for _, f := range fields { + alts, seen := root, seenRoot + if f.ext { + alts, seen = ext, seenExt + } + + if f.index >= len(alts) { + t.Errorf("%s: alternative %d (ext %v) does not exist in the spec", f.field.Name, f.index, f.ext) + + continue + } + + comp := alts[f.index] + seen[f.index] = true + + if f.raw { + if !isSingleContainer(s, comp.Type) { + t.Errorf("%s: choice-Extensions field at %d, spec alternative %s is %s", f.field.Name, f.index, comp.Name, comp.Type) + } + + continue + } + + if !alternativeMatches(f.field, comp) { + t.Errorf("%s (%v) at %d, spec alternative is %s %s", f.field.Name, f.field.Type, f.index, comp.Name, comp.Type) + } + } + + for i, ok := range seenRoot { + if !ok { + t.Errorf("root alternative %s is not modeled", root[i].Name) + } + } + + for i, ok := range seenExt { + if !ok { + t.Errorf("extension alternative %s is not modeled", ext[i].Name) + } + } + }) + } +} + +func TestPDUChoiceMatchesASN1(t *testing.T) { + ta := vendoredSpec(t).Type("S1AP-PDU") + if ta == nil { + t.Fatal("S1AP-PDU not found") + } + + want := map[string]int{"initiatingMessage": pduInitiatingMessage, "successfulOutcome": pduSuccessfulOutcome, "unsuccessfulOutcome": pduUnsuccessfulOutcome} + + root := 0 + + for _, comp := range ta.Type.Components { + if comp.Extension { + continue + } + + if idx, ok := want[comp.Name]; !ok || idx != root { + t.Errorf("S1AP-PDU alternative %d is %s", root, comp.Name) + } + + root++ + } + + if root != len(want) || !ta.Type.Extensible { + t.Errorf("S1AP-PDU has %d root alternatives (extensible %v), want %d and extensible", root, ta.Type.Extensible, len(want)) + } +} + +func extieTag(t *testing.T, f reflect.StructField) (tableRowSpec, bool) { + t.Helper() + + var ( + row tableRowSpec + typed bool + ) + + for _, o := range strings.Split(f.Tag.Get("per"), ",") { + switch { + case strings.HasPrefix(o, "extie:"): + name := strings.TrimPrefix(o, "extie:") + + for id, n := range protocolIENames { + if "ID"+goIdentifier(n) == name { + row.ID, typed = id, true + } + } + + if !typed { + t.Fatalf("%s: no ProtocolIE-ID named %s", f.Name, name) + } + case o == "crit:reject": + row.Criticality = CriticalityReject + case o == "crit:ignore": + row.Criticality = CriticalityIgnore + case o == "crit:notify": + row.Criticality = CriticalityNotify + } + } + + return row, typed +} + +func TestChoiceExtensionsMatchASN1(t *testing.T) { + s := vendoredSpec(t) + + for _, c := range choiceExtensionCases() { + t.Run(c.set, func(t *testing.T) { + sa := s.ObjectSet(c.set) + if sa == nil { + t.Fatalf("%s not found", c.set) + } + + objs, err := s.Objects(sa.Set) + if err != nil { + t.Fatal(err) + } + + var want []tableRowSpec + + for _, o := range objs { + row := asn1Row(t, o) + want = append(want, tableRowSpec{ID: row.ID, Criticality: row.Criticality}) + } + + var got []tableRowSpec + + raw := false + + for i := range c.typ.NumField() { + f := c.typ.Field(i) + if !strings.Contains(f.Tag.Get("per"), "extie") { + continue + } + + row, typed := extieTag(t, f) + if typed { + got = append(got, row) + } else { + raw = true + } + } + + if !raw { + t.Errorf("%v has no raw field for unknown %s members", c.typ, c.set) + } + + if len(got) != len(want) { + t.Fatalf("typed %v, spec %v", got, want) + } + + for i := range got { + if got[i] != want[i] { + t.Errorf("typed %v, spec %v", got[i], want[i]) + } + } + }) + } +} diff --git a/s1ap/comparable_test.go b/s1ap/comparable_test.go index 2f0ee498e3..cffb62a0d9 100644 --- a/s1ap/comparable_test.go +++ b/s1ap/comparable_test.go @@ -21,8 +21,10 @@ func identityTypesWithValueEquality() []reflect.Type { requireComparable[TransportLayerAddress](), requireComparable[TransportInformation](), requireComparable[ERABSetupItemCtxtSURes](), + requireComparable[ERABSetupItemBearerSURes](), requireComparable[ERABToBeSwitchedULItem](), requireComparable[ERABToBeModifiedItemBearerModInd](), + requireComparable[ERABNotToBeModifiedItemBearerModInd](), requireComparable[NRCGI](), requireComparable[UES1APIDPair](), requireComparable[SecurityAlgorithms](), diff --git a/s1ap/config_transfer.go b/s1ap/config_transfer.go index 81c704f09c..066f4737ea 100644 --- a/s1ap/config_transfer.go +++ b/s1ap/config_transfer.go @@ -5,11 +5,14 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.16. type ENBConfigurationTransfer struct { - SONConfigurationTransfer *SONConfigurationTransfer + SONConfigurationTransfer *SONConfigurationTransfer + ENDCSONConfigurationTransferECT *ENDCSONConfigurationTransfer + IntersystemSONConfigurationTransferECT *IntersystemSONConfigurationTransfer messageMeta } @@ -24,6 +27,12 @@ var eNBConfigurationTransferIEs = []ieSpec[ENBConfigurationTransfer]{ return optionalIE(m.SONConfigurationTransfer) }, }, + apimpl.OptionalIE(IDENDCSONConfigurationTransferECT, CriticalityIgnore, func(m *ENBConfigurationTransfer) **ENDCSONConfigurationTransfer { + return &m.ENDCSONConfigurationTransferECT + }), + apimpl.OptionalIE(IDIntersystemSONConfigurationTransferECT, CriticalityIgnore, func(m *ENBConfigurationTransfer) **IntersystemSONConfigurationTransfer { + return &m.IntersystemSONConfigurationTransferECT + }), } func (m *ENBConfigurationTransfer) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -56,7 +65,9 @@ func DecodeENBConfigurationTransfer(value []byte) (*ENBConfigurationTransfer, er // TS 36.413 §9.1.17. type MMEConfigurationTransfer struct { - SONConfigurationTransfer *SONConfigurationTransfer + SONConfigurationTransfer *SONConfigurationTransfer + ENDCSONConfigurationTransferMCT *ENDCSONConfigurationTransfer + IntersystemSONConfigurationTransferMCT *IntersystemSONConfigurationTransfer messageMeta } @@ -72,6 +83,12 @@ var mMEConfigurationTransferIEs = []ieSpec[MMEConfigurationTransfer]{ return optionalIE(m.SONConfigurationTransfer) }, }, + apimpl.OptionalIE(IDENDCSONConfigurationTransferMCT, CriticalityIgnore, func(m *MMEConfigurationTransfer) **ENDCSONConfigurationTransfer { + return &m.ENDCSONConfigurationTransferMCT + }), + apimpl.OptionalIE(IDIntersystemSONConfigurationTransferMCT, CriticalityIgnore, func(m *MMEConfigurationTransfer) **IntersystemSONConfigurationTransfer { + return &m.IntersystemSONConfigurationTransferMCT + }), } func (m *MMEConfigurationTransfer) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/container_lists_test.go b/s1ap/container_lists_test.go new file mode 100644 index 0000000000..b417faf145 --- /dev/null +++ b/s1ap/container_lists_test.go @@ -0,0 +1,298 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "reflect" + "strings" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/asn1spec" +) + +type itemListSpec struct { + item tableRowSpec + ub int64 +} + +func asn1ItemList(t *testing.T, ty *asn1spec.Type) (itemListSpec, bool) { + t.Helper() + + s := vendoredSpec(t) + + var ( + set *asn1spec.ObjectSet + ub *asn1spec.Value + ) + + for range 8 { + switch { + case ty.Kind == asn1spec.SequenceOf && ty.Elem.Name == "ProtocolIE-SingleContainer" && ty.Size != nil: + set, ub = ty.Elem.Args[0].Set, &ty.Size.Root[0].Upper + case ty.Kind == asn1spec.Reference && ty.Name == "ProtocolIE-ContainerList": + ub = ty.Args[1].Value + } + + if set == nil && ty.Kind == asn1spec.Reference { + for _, a := range ty.Args { + if a.Set != nil && len(a.Set.Root) == 1 && a.Set.Root[0].Ref != "" && s.ObjectSet(a.Set.Root[0].Ref) != nil { + set = a.Set + } + } + } + + if set != nil && ub != nil { + break + } + + if ty.Kind != asn1spec.Reference { + return itemListSpec{}, false + } + + ta := s.Type(ty.Name) + if ta == nil { + return itemListSpec{}, false + } + + ty = ta.Type + } + + if set == nil || ub == nil { + return itemListSpec{}, false + } + + objs, err := s.Objects(set) + if err != nil { + t.Fatal(err) + } + + if len(objs) != 1 { + t.Fatalf("item IE set has %d members", len(objs)) + } + + n, err := s.Int(*ub) + if err != nil { + t.Fatal(err) + } + + return itemListSpec{item: asn1Row(t, objs[0]), ub: n}, true +} + +func wireItems(t *testing.T, value []byte, ub int64) []tableRowSpec { + t.Helper() + + r := per.NewReader(value) + + var out []tableRowSpec + + err := per.DecodeLength(r, per.Aligned, 1, ub, true, func(count int64) error { + for range count { + id, err := per.DecodeConstrainedWholeNumber(r, per.Aligned, 0, maxProtocolIEs) + if err != nil { + return err + } + + c, err := per.DecodeEnumerated(r, per.Aligned, 3, false) + if err != nil { + return err + } + + if _, err := per.DecodeOpenTypeBytes(r, per.Aligned); err != nil { + return err + } + + out = append(out, tableRowSpec{ID: ProtocolIEID(id), Criticality: Criticality(c)}) + } + + return nil + }) + if err != nil { + t.Fatal(err) + } + + return out +} + +func checkItems(t *testing.T, name string, spec itemListSpec, value []byte) { + t.Helper() + + items := wireItems(t, value, spec.ub) + if len(items) == 0 { + t.Fatalf("%s: sample list is empty", name) + } + + for _, it := range items { + if it.ID != spec.item.ID || it.Criticality != spec.item.Criticality { + t.Errorf("%s: item sent as %s/%s, spec says %s/%s", name, it.ID, it.Criticality, spec.item.ID, spec.item.Criticality) + } + } +} + +func TestMessageItemListsMatchASN1(t *testing.T) { + checked := 0 + + for _, c := range messageCases() { + t.Run(c.asn1, func(t *testing.T) { + types := map[ProtocolIEID]*asn1spec.Type{} + for _, o := range asn1Objects(t, c.asn1, "ProtocolIE-Container") { + types[asn1Row(t, o).ID] = o.Type("&Value") + } + + b, err := sampleMessage(t, c.typ).Interface().(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatal(err) + } + + raw, err := ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + for _, ie := range raw.IEs() { + spec, ok := asn1ItemList(t, types[ie.ID]) + if !ok { + continue + } + + checkItems(t, ie.ID.String(), spec, ie.Value) + + checked++ + } + }) + } + + if checked == 0 { + t.Fatal("no single-container list was checked") + } +} + +func TestNestedItemListsMatchASN1(t *testing.T) { + for _, c := range []struct { + asn1 string + typ reflect.Type + }{ + {"UE-associatedLogicalS1-ConnectionListRes", reflect.TypeFor[UEAssociatedLogicalS1ConnectionListRes]()}, + {"E-RABInformationList", reflect.TypeFor[ERABInformationList]()}, + {"TAIList", reflect.TypeFor[TAIList]()}, + {"E-RABToBeUpdatedList", reflect.TypeFor[ERABToBeUpdatedList]()}, + {"SecondaryRATDataUsageReportList", reflect.TypeFor[SecondaryRATDataUsageReportList]()}, + {"RecommendedCellList", reflect.TypeFor[RecommendedCellList]()}, + {"RecommendedENBList", reflect.TypeFor[RecommendedENBList]()}, + {"E-RABUsageReportList", reflect.TypeFor[ERABUsageReportList]()}, + } { + t.Run(c.asn1, func(t *testing.T) { + ta := vendoredSpec(t).Type(c.asn1) + if ta == nil { + t.Fatalf("%s not found", c.asn1) + } + + spec, ok := asn1ItemList(t, ta.Type) + if !ok { + t.Fatalf("%s is not a ProtocolIE-SingleContainer list", c.asn1) + } + + v := reflect.New(c.typ) + fillSample(t, v.Elem(), 0) + + b, err := per.Marshal(v.Interface().(per.Marshaler)) + if err != nil { + t.Fatal(err) + } + + checkItems(t, c.asn1, spec, b) + }) + } +} + +func TestItemListElementTypesMatchASN1(t *testing.T) { + for _, c := range []struct { + asn1 string + typ reflect.Type + }{ + {"E-RABToBeSetupListCtxtSUReq", reflect.TypeFor[ERABToBeSetupListCtxtSUReq]()}, + {"E-RABSetupListCtxtSURes", reflect.TypeFor[ERABSetupListCtxtSURes]()}, + {"E-RABToBeSetupListBearerSUReq", reflect.TypeFor[ERABToBeSetupListBearerSUReq]()}, + {"E-RABSetupListBearerSURes", reflect.TypeFor[ERABSetupListBearerSURes]()}, + {"E-RABToBeModifiedListBearerModReq", reflect.TypeFor[ERABToBeModifiedListBearerModReq]()}, + {"E-RABToBeModifiedListBearerModInd", reflect.TypeFor[ERABToBeModifiedListBearerModInd]()}, + {"E-RABNotToBeModifiedListBearerModInd", reflect.TypeFor[ERABNotToBeModifiedListBearerModInd]()}, + {"E-RABToBeSetupListHOReq", reflect.TypeFor[ERABToBeSetupListHOReq]()}, + {"E-RABAdmittedList", reflect.TypeFor[ERABAdmittedList]()}, + {"E-RABSubjecttoDataForwardingList", reflect.TypeFor[ERABSubjecttoDataForwardingList]()}, + {"E-RABToBeSwitchedDLList", reflect.TypeFor[ERABToBeSwitchedDLList]()}, + {"E-RABToBeSwitchedULList", reflect.TypeFor[ERABToBeSwitchedULList]()}, + {"TAIList", reflect.TypeFor[TAIList]()}, + {"E-RABToBeUpdatedList", reflect.TypeFor[ERABToBeUpdatedList]()}, + {"SecondaryRATDataUsageReportList", reflect.TypeFor[SecondaryRATDataUsageReportList]()}, + {"RecommendedCellList", reflect.TypeFor[RecommendedCellList]()}, + {"RecommendedENBList", reflect.TypeFor[RecommendedENBList]()}, + {"E-RABUsageReportList", reflect.TypeFor[ERABUsageReportList]()}, + {"E-RABInformationList", reflect.TypeFor[ERABInformationList]()}, + {"UE-associatedLogicalS1-ConnectionListRes", reflect.TypeFor[UEAssociatedLogicalS1ConnectionListRes]()}, + } { + t.Run(c.asn1, func(t *testing.T) { + s := vendoredSpec(t) + + ta := s.Type(c.asn1) + if ta == nil { + t.Fatalf("%s not found", c.asn1) + } + + item := asn1ItemType(t, ta.Type) + if got := c.typ.Elem().Name(); goTypeName(item) != got { + t.Errorf("%s items are %s, spec says %s", c.asn1, got, item) + } + }) + } +} + +func asn1ItemType(t *testing.T, ty *asn1spec.Type) string { + t.Helper() + + s := vendoredSpec(t) + + for range 8 { + var set *asn1spec.ObjectSet + + switch { + case ty.Kind == asn1spec.SequenceOf && ty.Elem.Name == "ProtocolIE-SingleContainer": + set = ty.Elem.Args[0].Set + case ty.Kind == asn1spec.Reference: + for _, a := range ty.Args { + if a.Set != nil && len(a.Set.Root) == 1 && a.Set.Root[0].Ref != "" && s.ObjectSet(a.Set.Root[0].Ref) != nil { + set = a.Set + } + } + } + + if set != nil { + objs, err := s.Objects(set) + if err != nil { + t.Fatal(err) + } + + if len(objs) != 1 { + t.Fatalf("item IE set has %d members", len(objs)) + } + + return objs[0].Type("&Value").Name + } + + ta := s.Type(ty.Name) + if ty.Kind != asn1spec.Reference || ta == nil { + t.Fatalf("%s is not a ProtocolIE-SingleContainer list", ty.Name) + } + + ty = ta.Type + } + + t.Fatal("item list nests too deep") + + return "" +} + +func goTypeName(asn1 string) string { + return strings.ReplaceAll(strings.Replace(asn1, "UE-associated", "UEAssociated", 1), "-", "") +} diff --git a/s1ap/coverage_cases_test.go b/s1ap/coverage_cases_test.go new file mode 100644 index 0000000000..fb00557cb1 --- /dev/null +++ b/s1ap/coverage_cases_test.go @@ -0,0 +1,89 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import "reflect" + +type messageCase struct { + asn1 string + rows []tableRowSpec + typ reflect.Type + parse func([]byte) (any, error) +} + +func messageCases() []messageCase { + return []messageCase{ + {"DownlinkNASTransport", tableRows(downlinkNASTransportIEs), reflect.TypeFor[DownlinkNASTransport](), func(b []byte) (any, error) { return ParseDownlinkNASTransport(b) }}, + {"DownlinkNonUEAssociatedLPPaTransport", tableRows(downlinkNonUEAssociatedLPPaTransportIEs), reflect.TypeFor[DownlinkNonUEAssociatedLPPaTransport](), func(b []byte) (any, error) { return ParseDownlinkNonUEAssociatedLPPaTransport(b) }}, + {"DownlinkUEAssociatedLPPaTransport", tableRows(downlinkUEAssociatedLPPaTransportIEs), reflect.TypeFor[DownlinkUEAssociatedLPPaTransport](), func(b []byte) (any, error) { return ParseDownlinkUEAssociatedLPPaTransport(b) }}, + {"E-RABModificationConfirm", tableRows(erabModificationConfirmIEs), reflect.TypeFor[ERABModificationConfirm](), func(b []byte) (any, error) { return ParseERABModificationConfirm(b) }}, + {"E-RABModificationIndication", tableRows(eRABModificationIndicationIEs), reflect.TypeFor[ERABModificationIndication](), func(b []byte) (any, error) { return ParseERABModificationIndication(b) }}, + {"E-RABModifyRequest", tableRows(eRABModifyRequestIEs), reflect.TypeFor[ERABModifyRequest](), func(b []byte) (any, error) { return ParseERABModifyRequest(b) }}, + {"E-RABModifyResponse", tableRows(eRABModifyResponseIEs), reflect.TypeFor[ERABModifyResponse](), func(b []byte) (any, error) { return ParseERABModifyResponse(b) }}, + {"E-RABReleaseCommand", tableRows(eRABReleaseCommandIEs), reflect.TypeFor[ERABReleaseCommand](), func(b []byte) (any, error) { return ParseERABReleaseCommand(b) }}, + {"E-RABReleaseIndication", tableRows(eRABReleaseIndicationIEs), reflect.TypeFor[ERABReleaseIndication](), func(b []byte) (any, error) { return ParseERABReleaseIndication(b) }}, + {"E-RABReleaseResponse", tableRows(eRABReleaseResponseIEs), reflect.TypeFor[ERABReleaseResponse](), func(b []byte) (any, error) { return ParseERABReleaseResponse(b) }}, + {"E-RABSetupRequest", tableRows(eRABSetupRequestIEs), reflect.TypeFor[ERABSetupRequest](), func(b []byte) (any, error) { return ParseERABSetupRequest(b) }}, + {"E-RABSetupResponse", tableRows(eRABSetupResponseIEs), reflect.TypeFor[ERABSetupResponse](), func(b []byte) (any, error) { return ParseERABSetupResponse(b) }}, + {"ENBConfigurationTransfer", tableRows(eNBConfigurationTransferIEs), reflect.TypeFor[ENBConfigurationTransfer](), func(b []byte) (any, error) { return ParseENBConfigurationTransfer(b) }}, + {"ENBConfigurationUpdate", tableRows(eNBConfigurationUpdateIEs), reflect.TypeFor[ENBConfigurationUpdate](), func(b []byte) (any, error) { return ParseENBConfigurationUpdate(b) }}, + {"ENBConfigurationUpdateAcknowledge", tableRows(eNBConfigurationUpdateAcknowledgeIEs), reflect.TypeFor[ENBConfigurationUpdateAcknowledge](), func(b []byte) (any, error) { return ParseENBConfigurationUpdateAcknowledge(b) }}, + {"ENBConfigurationUpdateFailure", tableRows(eNBConfigurationUpdateFailureIEs), reflect.TypeFor[ENBConfigurationUpdateFailure](), func(b []byte) (any, error) { return ParseENBConfigurationUpdateFailure(b) }}, + {"ENBStatusTransfer", tableRows(eNBStatusTransferIEs), reflect.TypeFor[ENBStatusTransfer](), func(b []byte) (any, error) { return ParseENBStatusTransfer(b) }}, + {"ErrorIndication", tableRows(errorIndicationIEs), reflect.TypeFor[ErrorIndication](), func(b []byte) (any, error) { return ParseErrorIndication(b) }}, + {"HandoverCancel", tableRows(handoverCancelIEs), reflect.TypeFor[HandoverCancel](), func(b []byte) (any, error) { return ParseHandoverCancel(b) }}, + {"HandoverCancelAcknowledge", tableRows(handoverCancelAcknowledgeIEs), reflect.TypeFor[HandoverCancelAcknowledge](), func(b []byte) (any, error) { return ParseHandoverCancelAcknowledge(b) }}, + {"HandoverCommand", tableRows(handoverCommandIEs), reflect.TypeFor[HandoverCommand](), func(b []byte) (any, error) { return ParseHandoverCommand(b) }}, + {"HandoverFailure", tableRows(handoverFailureIEs), reflect.TypeFor[HandoverFailure](), func(b []byte) (any, error) { return ParseHandoverFailure(b) }}, + {"HandoverNotify", tableRows(handoverNotifyIEs), reflect.TypeFor[HandoverNotify](), func(b []byte) (any, error) { return ParseHandoverNotify(b) }}, + {"HandoverPreparationFailure", tableRows(handoverPreparationFailureIEs), reflect.TypeFor[HandoverPreparationFailure](), func(b []byte) (any, error) { return ParseHandoverPreparationFailure(b) }}, + {"HandoverRequest", tableRows(handoverRequestIEs), reflect.TypeFor[HandoverRequest](), func(b []byte) (any, error) { return ParseHandoverRequest(b) }}, + {"HandoverRequestAcknowledge", tableRows(handoverRequestAcknowledgeIEs), reflect.TypeFor[HandoverRequestAcknowledge](), func(b []byte) (any, error) { return ParseHandoverRequestAcknowledge(b) }}, + {"HandoverRequired", tableRows(handoverRequiredIEs), reflect.TypeFor[HandoverRequired](), func(b []byte) (any, error) { return ParseHandoverRequired(b) }}, + {"InitialContextSetupFailure", tableRows(initialContextSetupFailureIEs), reflect.TypeFor[InitialContextSetupFailure](), func(b []byte) (any, error) { return ParseInitialContextSetupFailure(b) }}, + {"InitialContextSetupRequest", tableRows(initialContextSetupRequestIEs), reflect.TypeFor[InitialContextSetupRequest](), func(b []byte) (any, error) { return ParseInitialContextSetupRequest(b) }}, + {"InitialContextSetupResponse", tableRows(initialContextSetupResponseIEs), reflect.TypeFor[InitialContextSetupResponse](), func(b []byte) (any, error) { return ParseInitialContextSetupResponse(b) }}, + {"InitialUEMessage", tableRows(initialUEMessageIEs), reflect.TypeFor[InitialUEMessage](), func(b []byte) (any, error) { return ParseInitialUEMessage(b) }}, + {"KillRequest", tableRows(killRequestIEs), reflect.TypeFor[KillRequest](), func(b []byte) (any, error) { return ParseKillRequest(b) }}, + {"KillResponse", tableRows(killResponseIEs), reflect.TypeFor[KillResponse](), func(b []byte) (any, error) { return ParseKillResponse(b) }}, + {"LocationReport", tableRows(locationReportIEs), reflect.TypeFor[LocationReport](), func(b []byte) (any, error) { return ParseLocationReport(b) }}, + {"MMEConfigurationTransfer", tableRows(mMEConfigurationTransferIEs), reflect.TypeFor[MMEConfigurationTransfer](), func(b []byte) (any, error) { return ParseMMEConfigurationTransfer(b) }}, + {"MMEConfigurationUpdate", tableRows(mMEConfigurationUpdateIEs), reflect.TypeFor[MMEConfigurationUpdate](), func(b []byte) (any, error) { return ParseMMEConfigurationUpdate(b) }}, + {"MMEConfigurationUpdateAcknowledge", tableRows(mMEConfigurationUpdateAcknowledgeIEs), reflect.TypeFor[MMEConfigurationUpdateAcknowledge](), func(b []byte) (any, error) { return ParseMMEConfigurationUpdateAcknowledge(b) }}, + {"MMEConfigurationUpdateFailure", tableRows(mMEConfigurationUpdateFailureIEs), reflect.TypeFor[MMEConfigurationUpdateFailure](), func(b []byte) (any, error) { return ParseMMEConfigurationUpdateFailure(b) }}, + {"MMEStatusTransfer", tableRows(mMEStatusTransferIEs), reflect.TypeFor[MMEStatusTransfer](), func(b []byte) (any, error) { return ParseMMEStatusTransfer(b) }}, + {"NASNonDeliveryIndication", tableRows(nASNonDeliveryIndicationIEs), reflect.TypeFor[NASNonDeliveryIndication](), func(b []byte) (any, error) { return ParseNASNonDeliveryIndication(b) }}, + {"OverloadStart", tableRows(overloadStartIEs), reflect.TypeFor[OverloadStart](), func(b []byte) (any, error) { return ParseOverloadStart(b) }}, + {"OverloadStop", tableRows(overloadStopIEs), reflect.TypeFor[OverloadStop](), func(b []byte) (any, error) { return ParseOverloadStop(b) }}, + {"PWSFailureIndication", tableRows(pWSFailureIndicationIEs), reflect.TypeFor[PWSFailureIndication](), func(b []byte) (any, error) { return ParsePWSFailureIndication(b) }}, + {"PWSRestartIndication", tableRows(pWSRestartIndicationIEs), reflect.TypeFor[PWSRestartIndication](), func(b []byte) (any, error) { return ParsePWSRestartIndication(b) }}, + {"Paging", tableRows(pagingIEs), reflect.TypeFor[Paging](), func(b []byte) (any, error) { return ParsePaging(b) }}, + {"PathSwitchRequest", tableRows(pathSwitchRequestIEs), reflect.TypeFor[PathSwitchRequest](), func(b []byte) (any, error) { return ParsePathSwitchRequest(b) }}, + {"PathSwitchRequestAcknowledge", tableRows(pathSwitchRequestAcknowledgeIEs), reflect.TypeFor[PathSwitchRequestAcknowledge](), func(b []byte) (any, error) { return ParsePathSwitchRequestAcknowledge(b) }}, + {"PathSwitchRequestFailure", tableRows(pathSwitchRequestFailureIEs), reflect.TypeFor[PathSwitchRequestFailure](), func(b []byte) (any, error) { return ParsePathSwitchRequestFailure(b) }}, + {"RerouteNASRequest", tableRows(rerouteNASRequestIEs), reflect.TypeFor[RerouteNASRequest](), func(b []byte) (any, error) { return ParseRerouteNASRequest(b) }}, + {"Reset", tableRows(resetIEs), reflect.TypeFor[Reset](), func(b []byte) (any, error) { return ParseReset(b) }}, + {"ResetAcknowledge", tableRows(resetAcknowledgeIEs), reflect.TypeFor[ResetAcknowledge](), func(b []byte) (any, error) { return ParseResetAcknowledge(b) }}, + {"S1RemovalFailure", tableRows(s1RemovalFailureIEs), reflect.TypeFor[S1RemovalFailure](), func(b []byte) (any, error) { return ParseS1RemovalFailure(b) }}, + {"S1RemovalRequest", tableRows(s1RemovalRequestIEs), reflect.TypeFor[S1RemovalRequest](), func(b []byte) (any, error) { return ParseS1RemovalRequest(b) }}, + {"S1RemovalResponse", tableRows(s1RemovalResponseIEs), reflect.TypeFor[S1RemovalResponse](), func(b []byte) (any, error) { return ParseS1RemovalResponse(b) }}, + {"S1SetupFailure", tableRows(s1SetupFailureIEs), reflect.TypeFor[S1SetupFailure](), func(b []byte) (any, error) { return ParseS1SetupFailure(b) }}, + {"S1SetupRequest", tableRows(s1SetupRequestIEs), reflect.TypeFor[S1SetupRequest](), func(b []byte) (any, error) { return ParseS1SetupRequest(b) }}, + {"S1SetupResponse", tableRows(s1SetupResponseIEs), reflect.TypeFor[S1SetupResponse](), func(b []byte) (any, error) { return ParseS1SetupResponse(b) }}, + {"TraceFailureIndication", tableRows(traceFailureIndicationIEs), reflect.TypeFor[TraceFailureIndication](), func(b []byte) (any, error) { return ParseTraceFailureIndication(b) }}, + {"TraceStart", tableRows(traceStartIEs), reflect.TypeFor[TraceStart](), func(b []byte) (any, error) { return ParseTraceStart(b) }}, + {"UECapabilityInfoIndication", tableRows(uECapabilityInfoIndicationIEs), reflect.TypeFor[UECapabilityInfoIndication](), func(b []byte) (any, error) { return ParseUECapabilityInfoIndication(b) }}, + {"UEContextModificationFailure", tableRows(uEContextModificationFailureIEs), reflect.TypeFor[UEContextModificationFailure](), func(b []byte) (any, error) { return ParseUEContextModificationFailure(b) }}, + {"UEContextModificationRequest", tableRows(uEContextModificationRequestIEs), reflect.TypeFor[UEContextModificationRequest](), func(b []byte) (any, error) { return ParseUEContextModificationRequest(b) }}, + {"UEContextModificationResponse", tableRows(uEContextModificationResponseIEs), reflect.TypeFor[UEContextModificationResponse](), func(b []byte) (any, error) { return ParseUEContextModificationResponse(b) }}, + {"UEContextReleaseCommand", tableRows(uEContextReleaseCommandIEs), reflect.TypeFor[UEContextReleaseCommand](), func(b []byte) (any, error) { return ParseUEContextReleaseCommand(b) }}, + {"UEContextReleaseComplete", tableRows(uEContextReleaseCompleteIEs), reflect.TypeFor[UEContextReleaseComplete](), func(b []byte) (any, error) { return ParseUEContextReleaseComplete(b) }}, + {"UEContextReleaseRequest", tableRows(uEContextReleaseRequestIEs), reflect.TypeFor[UEContextReleaseRequest](), func(b []byte) (any, error) { return ParseUEContextReleaseRequest(b) }}, + {"UplinkNASTransport", tableRows(uplinkNASTransportIEs), reflect.TypeFor[UplinkNASTransport](), func(b []byte) (any, error) { return ParseUplinkNASTransport(b) }}, + {"UplinkNonUEAssociatedLPPaTransport", tableRows(uplinkNonUEAssociatedLPPaTransportIEs), reflect.TypeFor[UplinkNonUEAssociatedLPPaTransport](), func(b []byte) (any, error) { return ParseUplinkNonUEAssociatedLPPaTransport(b) }}, + {"UplinkUEAssociatedLPPaTransport", tableRows(uplinkUEAssociatedLPPaTransportIEs), reflect.TypeFor[UplinkUEAssociatedLPPaTransport](), func(b []byte) (any, error) { return ParseUplinkUEAssociatedLPPaTransport(b) }}, + {"WriteReplaceWarningRequest", tableRows(writeReplaceWarningRequestIEs), reflect.TypeFor[WriteReplaceWarningRequest](), func(b []byte) (any, error) { return ParseWriteReplaceWarningRequest(b) }}, + {"WriteReplaceWarningResponse", tableRows(writeReplaceWarningResponseIEs), reflect.TypeFor[WriteReplaceWarningResponse](), func(b []byte) (any, error) { return ParseWriteReplaceWarningResponse(b) }}, + } +} diff --git a/s1ap/coverage_test.go b/s1ap/coverage_test.go new file mode 100644 index 0000000000..1bc4ef2df1 --- /dev/null +++ b/s1ap/coverage_test.go @@ -0,0 +1,211 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "reflect" + "strings" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +var sampleValues = map[reflect.Type]any{ + reflect.TypeFor[TransportLayerAddress](): goldTLA(), + reflect.TypeFor[PLMNIdentity](): goldPLMN(), + reflect.TypeFor[EngNBID](): EngNBID{BitStringFrom([]byte{0x12, 0x34, 0x54}, 22)}, + reflect.TypeFor[NRencryptionAlgorithms](): NRencryptionAlgorithms{BitStringFrom([]byte{0xe0, 0x00}, 16)}, + reflect.TypeFor[NRintegrityProtectionAlgorithms](): NRintegrityProtectionAlgorithms{BitStringFrom([]byte{0xe0, 0x00}, 16)}, +} + +func isChoiceStruct(t reflect.Type) bool { + if t.Kind() != reflect.Struct { + return false + } + + alternatives := 0 + + for i := range t.NumField() { + f := t.Field(i) + if !f.IsExported() { + continue + } + + tag := f.Tag.Get("per") + if !strings.Contains(tag, "choice:") && !strings.Contains(tag, "extalt") { + return false + } + + alternatives++ + } + + return alternatives > 0 +} + +func usable(v reflect.Value) bool { + if d, ok := v.Addr().Interface().(ap.Diagnosable[ProtocolIEID]); ok && d.Diagnose(&ap.Diagnosis[ProtocolIEID]{}) { + return false + } + + m, ok := v.Addr().Interface().(per.Marshaler) + if !ok { + return true + } + + _, err := per.Marshal(m) + + return err == nil +} + +func fillSample(t *testing.T, v reflect.Value, depth int) { + t.Helper() + + if depth > 40 { + t.Fatalf("sample for %v nests too deep", v.Type()) + } + + if s, ok := sampleValues[v.Type()]; ok { + v.Set(reflect.ValueOf(s)) + + return + } + + switch v.Kind() { + case reflect.Pointer: + p := reflect.New(v.Type().Elem()) + fillSample(t, p.Elem(), depth+1) + v.Set(p) + case reflect.Struct: + if isChoiceStruct(v.Type()) { + for i := range v.NumField() { + tag := v.Type().Field(i).Tag.Get("per") + if v.Type().Field(i).IsExported() && strings.Contains(tag, "choice:") && !strings.Contains(tag, "extie") && !strings.Contains(tag, ",ext") { + fillSample(t, v.Field(i), depth+1) + + return + } + } + + t.Fatalf("%v has no root alternative", v.Type()) + } + + for i := range v.NumField() { + f := v.Type().Field(i) + tag := f.Tag.Get("per") + + if !f.IsExported() || strings.Contains(tag, "optional") || strings.Contains(tag, "extie") { + continue + } + + fillSample(t, v.Field(i), depth+1) + } + case reflect.Slice: + if v.Type().Elem() == reflect.TypeFor[byte]() { + for n := 1; n <= 1024; n++ { + v.Set(reflect.ValueOf(bytes.Repeat([]byte{0x01}, n)).Convert(v.Type())) + + if usable(v) { + return + } + } + + t.Fatalf("no usable %v", v.Type()) + } + + s := reflect.MakeSlice(v.Type(), 1, 1) + fillSample(t, s.Index(0), depth+1) + v.Set(s) + case reflect.Array: + for i := range v.Len() { + fillSample(t, v.Index(i), depth+1) + } + case reflect.String: + v.SetString("a") + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + for _, n := range []int64{0, 1, 2, 3, 4096, 65536} { + v.SetInt(n) + + if usable(v) { + return + } + } + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + for _, n := range []uint64{0, 1, 2, 3, 4096, 65536} { + v.SetUint(n) + + if usable(v) { + return + } + } + } +} + +func sampleMessage(t *testing.T, typ reflect.Type) reflect.Value { + t.Helper() + + in := reflect.New(typ) + + for i := range typ.NumField() { + if f := typ.Field(i); f.IsExported() && !f.Anonymous { + fillSample(t, in.Elem().Field(i), 0) + } + } + + switch m := in.Interface().(type) { + case *HandoverCommand: + m.HandoverType = HandoverTypeLTEtoUTRAN + case *HandoverRequest: + m.HandoverType = HandoverTypeUTRANtoLTE + case *HandoverRequired: + m.HandoverType = HandoverTypeLTEtoGERAN + case *InitialContextSetupRequest: + m.CSFallbackIndicator = Ptr(CSFallbackIndicatorCSFallbackHighPriority) + case *UEContextModificationRequest: + m.CSFallbackIndicator = Ptr(CSFallbackIndicatorCSFallbackHighPriority) + case *OverloadStart: + m.TrafficLoadReductionIndication = Ptr(uint8(1)) + case *WriteReplaceWarningRequest: + m.ExtendedRepetitionPeriod = Ptr(uint32(4096)) + } + + return in +} + +func TestEveryMessageIERoundTrips(t *testing.T) { + for _, c := range messageCases() { + t.Run(c.asn1, func(t *testing.T) { + in := sampleMessage(t, c.typ) + + b, err := in.Interface().(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatalf("marshal: %v", err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + out, err := c.parse(pdu.value()) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if !equalByMethod(out, in.Interface()) { + t.Fatalf("decoded\n %+v\nwant\n %+v", out, in.Interface()) + } + + re, err := out.(interface{ Marshal() ([]byte, error) }).Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, b) { + t.Fatalf("re-encode = % x, want % x", re, b) + } + }) + } +} diff --git a/s1ap/decode_total_test.go b/s1ap/decode_total_test.go index 61f4498f5a..ff697916b7 100644 --- a/s1ap/decode_total_test.go +++ b/s1ap/decode_total_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type totalCase struct { @@ -92,8 +92,8 @@ func TestDecodeIsTotalAndLossless(t *testing.T) { falsely := CauseProtocolAbstractSyntaxErrorFalselyConstructedMessage f := uplinkNASFields() - unknownIgnore := ieField{ID: 40000, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})} - unknownReject := ieField{ID: 40001, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x02})} + unknownIgnore := ieField{ID: 40000, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x01})} + unknownReject := ieField{ID: 40001, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x02})} item := ERABToBeSetupItemBearerSUReq{ERABID: 1, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, NASPDU: NASPDU{0x01}} item.iEExtensions.Append(rawIE{ID: 9999, Criticality: CriticalityReject, Value: []byte{0x5a}}) diff --git a/s1ap/diagnostics_bound_test.go b/s1ap/diagnostics_bound_test.go index 0a1cddd9bf..2f6151d8d8 100644 --- a/s1ap/diagnostics_bound_test.go +++ b/s1ap/diagnostics_bound_test.go @@ -7,7 +7,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // CriticalityDiagnostics-IE-List is SIZE(1..maxnoofErrors), so an untruncated @@ -18,7 +18,7 @@ func TestNotUnderstoodReportStaysSendable(t *testing.T) { fields = append(fields, ieField{ ID: ProtocolIEID(40000 + i), // outside every id this version models Criticality: CriticalityReject, - Value: ap.RawValue([]byte{0x00}), + Value: apimpl.RawValue([]byte{0x00}), }) } diff --git a/s1ap/enb_config_update.go b/s1ap/enb_config_update.go index 7f6c44e382..f9dfd3abd7 100644 --- a/s1ap/enb_config_update.go +++ b/s1ap/enb_config_update.go @@ -5,13 +5,18 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.8.7. type ENBConfigurationUpdate struct { - ENBName *string - SupportedTAs SupportedTAs - DefaultPagingDRX *PagingDRX + ENBName *string + SupportedTAs SupportedTAs + DefaultPagingDRX *PagingDRX + CSGIdList CSGIdList + NBIoTDefaultPagingDRX *NBIoTDefaultPagingDRX + ConnectedengNBToAddList ConnectedengNBList + ConnectedengNBToRemoveList ConnectedengNBList messageMeta } @@ -52,6 +57,7 @@ var eNBConfigurationUpdateIEs = []ieSpec[ENBConfigurationUpdate]{ return &m.SupportedTAs, true }, }, + apimpl.ListIE(IDCSGIdList, CriticalityReject, func(m *ENBConfigurationUpdate) *CSGIdList { return &m.CSGIdList }), { ID: IDDefaultPagingDRX, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *ENBConfigurationUpdate, r *per.Reader, enc per.Encoding) error { @@ -73,6 +79,9 @@ var eNBConfigurationUpdateIEs = []ieSpec[ENBConfigurationUpdate]{ return m.DefaultPagingDRX, true }, }, + apimpl.OptionalIE(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *ENBConfigurationUpdate) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), + apimpl.ListIE(IDConnectedengNBToAddList, CriticalityIgnore, func(m *ENBConfigurationUpdate) *ConnectedengNBList { return &m.ConnectedengNBToAddList }), + apimpl.ListIE(IDConnectedengNBToRemoveList, CriticalityIgnore, func(m *ENBConfigurationUpdate) *ConnectedengNBList { return &m.ConnectedengNBToRemoveList }), } func (m *ENBConfigurationUpdate) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/enum_all_test.go b/s1ap/enum_all_test.go new file mode 100644 index 0000000000..530297ddb3 --- /dev/null +++ b/s1ap/enum_all_test.go @@ -0,0 +1,232 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "reflect" + "slices" + "strings" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/asn1spec" +) + +type enumShape struct { + Root []string + Extensible bool + Extension []string +} + +type enumSpecCase struct { + asn1 string + got enumShape + typ reflect.Type +} + +func enumSpec[T per.Integer](asn1 string, e *per.Enum[T]) enumSpecCase { + return enumSpecCase{ + asn1: asn1, + got: enumShape{Root: e.Root, Extensible: e.Extensible || len(e.Extension) > 0, Extension: e.Extension}, + typ: reflect.TypeFor[T](), + } +} + +func asn1Enum(t *testing.T, ref string) enumShape { + t.Helper() + + s := vendoredSpec(t) + + typeName, component, _ := strings.Cut(ref, ".") + + ta := s.Type(typeName) + if ta == nil { + t.Fatalf("ASN.1 type %s not found", typeName) + } + + ty := ta.Type + + if component != "" { + c := ty.Component(component) + if c == nil { + t.Fatalf("%s has no component %s", typeName, component) + } + + ty = c.Type + } + + ty, err := s.Underlying(ty) + if err != nil { + t.Fatal(err) + } + + if ty.Kind != asn1spec.Enumerated { + t.Fatalf("%s is %s, not ENUMERATED", ref, ty.Kind) + } + + var out enumShape + + for _, it := range ty.Enum { + if it.HasNumber { + t.Fatalf("%s: %s has an explicit number", ref, it.Name) + } + + if it.Extension { + out.Extension = append(out.Extension, it.Name) + } else { + out.Root = append(out.Root, it.Name) + } + } + + out.Extensible = ty.Extensible + + return out +} + +func enumCases() []enumSpecCase { + return []enumSpecCase{ + enumSpec("TriggeringMessage", &enumTriggeringMessage), + enumSpec("HandoverType", &enumHandoverType), + enumSpec("CNDomain", &enumCNDomain), + enumSpec("Pre-emptionCapability", &enumPreemptionCapability), + enumSpec("Pre-emptionVulnerability", &enumPreemptionVulnerability), + enumSpec("TypeOfError", &enumTypeOfError), + enumSpec("EventType", &enumEventType), + enumSpec("ReportArea", &enumReportArea), + enumSpec("BearerType", &enumBearerType), + enumSpec("Ethernet-Type", &enumEthernetType), + enumSpec("IntegrityProtectionIndication", &enumIntegrityProtectionIndication), + enumSpec("PagingPriority", &enumPagingPriority), + enumSpec("UE-RetentionInformation", &enumUERetentionInformation), + enumSpec("PagingDRX", &enumPagingDRX), + enumSpec("ForbiddenInterRATs", &enumForbiddenInterRATs), + enumSpec("Data-Forwarding-Not-Possible", &enumDataForwardingNotPossible), + enumSpec("TimeToWait", &enumTimeToWait), + enumSpec("TraceDepth", &enumTraceDepth), + enumSpec("RRC-Establishment-Cause", &enumRRCEstablishmentCause), + enumSpec("GWContextReleaseIndication", &enumGWContextReleaseIndication), + enumSpec("DL-Forwarding", &enumDLForwarding), + enumSpec("Cell-Size", &enumCellSize), + enumSpec("Direct-Forwarding-Path-Availability", &enumDirectForwardingPathAvailability), + enumSpec("ResetAll", &enumResetAll), + enumSpec("OverloadAction", &enumOverloadAction), + enumSpec("GUMMEIType", &enumGUMMEIType), + enumSpec("NRrestrictioninEPSasSecondaryRAT", &enumNRrestrictioninEPSasSecondaryRAT), + enumSpec("UnlicensedSpectrumRestriction", &enumUnlicensedSpectrumRestriction), + enumSpec("NRrestrictionin5GS", &enumNRrestrictionin5GS), + enumSpec("CNType", &enumCNType), + enumSpec("RequestTypeAdditionalInfo", &enumRequestTypeAdditionalInfo), + enumSpec("DAPSRequestInfo.dAPSIndicator", &enumDAPSIndicator), + enumSpec("IMSvoiceEPSfallbackfrom5G", &enumIMSvoiceEPSfallbackfrom5G), + enumSpec("EmergencyIndicator", &enumEmergencyIndicator), + enumSpec("InterSystemMeasurementItem.subcarrierSpacingSSB", &enumSubcarrierSpacingSSB), + enumSpec("RAT-Type", &enumRATType), + enumSpec("CoarseUELocationRequested", &enumCoarseUELocationRequested), + enumSpec("TimeRefDistribution", &enumTimeRefDistribution), + enumSpec("SONInformationRequest", &enumSONInformationRequest), + enumSpec("SynchronisationStatus", &enumSynchronisationStatus), + enumSpec("MutingAvailabilityIndication", &enumMutingAvailabilityIndication), + enumSpec("MutingPatternInformation.muting-pattern-period", &enumMutingPatternPeriod), + enumSpec("ListeningSubframePattern.pattern-period", &enumPatternPeriod), + enumSpec("ConcurrentWarningMessageIndicator", &enumConcurrentWarningMessageIndicator), + enumSpec("KillAllWarningMessages", &enumKillAllWarningMessages), + enumSpec("CauseRadioNetwork", &enumCauseRadioNetwork), + enumSpec("CauseTransport", &enumCauseTransport), + enumSpec("CauseNas", &enumCauseNas), + enumSpec("CauseProtocol", &enumCauseProtocol), + enumSpec("CauseMisc", &enumCauseMisc), + enumSpec("AdditionalCSFallbackIndicator", &enumAdditionalCSFallbackIndicator), + enumSpec("AerialUEsubscriptionInformation", &enumAerialUEsubscriptionInformation), + enumSpec("CE-ModeBRestricted", &enumCEModeBRestricted), + enumSpec("CE-mode-B-SupportIndicator", &enumCEmodeBSupportIndicator), + enumSpec("CSFallbackIndicator", &enumCSFallbackIndicator), + enumSpec("CSGMembershipStatus", &enumCSGMembershipStatus), + enumSpec("CellAccessMode", &enumCellAccessMode), + enumSpec("Coverage-Level", &enumCoverageLevel), + enumSpec("DLNASPDUDeliveryAckRequest", &enumDLNASPDUDeliveryAckRequest), + enumSpec("EDT-Session", &enumEDTSession), + enumSpec("EndIndication", &enumEndIndication), + enumSpec("EnhancedCoverageRestricted", &enumEnhancedCoverageRestricted), + enumSpec("IAB-Authorized", &enumIABAuthorized), + enumSpec("IAB-Node-Indication", &enumIABNodeIndication), + enumSpec("IAB-Supported", &enumIABSupported), + enumSpec("LTE-M-Indication", &enumLTEMIndication), + enumSpec("MMERelaySupportIndicator", &enumMMERelaySupportIndicator), + enumSpec("ManagementBasedMDTAllowed", &enumManagementBasedMDTAllowed), + enumSpec("NB-IoT-DefaultPagingDRX", &enumNBIoTDefaultPagingDRX), + enumSpec("NB-IoT-PagingDRX", &enumNBIoTPagingDRX), + enumSpec("NotifySourceeNB", &enumNotifySourceeNB), + enumSpec("PS-ServiceNotAvailable", &enumPSServiceNotAvailable), + enumSpec("PagingCause", &enumPagingCause), + enumSpec("PendingDataIndication", &enumPendingDataIndication), + enumSpec("RelayNode-Indicator", &enumRelayNodeIndicator), + enumSpec("SRVCCHOIndication", &enumSRVCCHOIndication), + enumSpec("SRVCCOperationNotPossible", &enumSRVCCOperationNotPossible), + enumSpec("SRVCCOperationPossible", &enumSRVCCOperationPossible), + enumSpec("SecondaryRATDataUsageRequest", &enumSecondaryRATDataUsageRequest), + enumSpec("Subscription-Based-UE-DifferentiationInfo.periodicCommunicationIndicator", &enumSubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator), + enumSpec("Subscription-Based-UE-DifferentiationInfo.stationaryIndication", &enumSubscriptionBasedUEDifferentiationInfoStationaryIndication), + enumSpec("Subscription-Based-UE-DifferentiationInfo.trafficProfile", &enumSubscriptionBasedUEDifferentiationInfoTrafficProfile), + enumSpec("Subscription-Based-UE-DifferentiationInfo.batteryIndication", &enumSubscriptionBasedUEDifferentiationInfoBatteryIndication), + enumSpec("UECapabilityInfoRequest", &enumUECapabilityInfoRequest), + enumSpec("UEUserPlaneCIoTSupportIndicator", &enumUEUserPlaneCIoTSupportIndicator), + enumSpec("ExpectedHOInterval", &enumExpectedHOInterval), + enumSpec("NB-IoT-Paging-eDRX-Cycle", &enumNBIoTPagingeDRXCycle), + enumSpec("NB-IoT-PagingTimeWindow", &enumNBIoTPagingTimeWindow), + enumSpec("VehicleUE", &enumVehicleUE), + enumSpec("PedestrianUE", &enumPedestrianUE), + enumSpec("Paging-eDRX-Cycle", &enumPagingeDRXCycle), + enumSpec("PagingTimeWindow", &enumPagingTimeWindow), + enumSpec("ProSeDirectDiscovery", &enumProSeDirectDiscovery), + enumSpec("ProSeDirectCommunication", &enumProSeDirectCommunication), + enumSpec("ProSeUEtoNetworkRelaying", &enumProSeUEtoNetworkRelaying), + enumSpec("PagingProbabilityInformation", &enumPagingProbabilityInformation), + enumSpec("NextPagingAreaScope", &enumNextPagingAreaScope), + enumSpec("SourceOfUEActivityBehaviourInformation", &enumSourceOfUEActivityBehaviourInformation), + enumSpec("SecondaryRATType", &enumSecondaryRATType), + enumSpec("Range", &enumRangeType), + } +} + +func TestEnumLiteralsMatchASN1(t *testing.T) { + for _, c := range enumCases() { + t.Run(c.asn1, func(t *testing.T) { + want := asn1Enum(t, c.asn1) + + if !slices.Equal(c.got.Root, want.Root) || c.got.Extensible != want.Extensible || !slices.Equal(c.got.Extension, want.Extension) { + t.Errorf("modeled as %+v, spec says %+v", c.got, want) + } + }) + } +} + +func TestEnumCasesAreComplete(t *testing.T) { + cases := enumCases() + + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ + } + + checkComplete(t, "per.Enum", scannedDecls(t).enums, types) +} + +func TestCriticalityLiteralsMatchASN1(t *testing.T) { + want := asn1Enum(t, "Criticality") + + got := enumShape{} + for _, c := range []Criticality{CriticalityReject, CriticalityIgnore, CriticalityNotify} { + got.Root = append(got.Root, c.String()) + } + + if !slices.Equal(got.Root, want.Root) || want.Extensible { + t.Errorf("Criticality = %+v, spec says %+v", got, want) + } + + for i, c := range []Criticality{CriticalityReject, CriticalityIgnore, CriticalityNotify} { + if int(c) != i { + t.Errorf("%s has index %d, spec says %d", c, int(c), i) + } + } +} diff --git a/s1ap/enum_encode_test.go b/s1ap/enum_encode_test.go index 2f7a9ca9ee..9453d685de 100644 --- a/s1ap/enum_encode_test.go +++ b/s1ap/enum_encode_test.go @@ -49,6 +49,349 @@ func enumCaseOf[T per.Integer, PT interface { func extensibleEnums() []enumCase { return []enumCase{ + enumCaseOf("AdditionalCSFallbackIndicator", &enumAdditionalCSFallbackIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AdditionalCSFallbackIndicator(v) + }), + enumCaseOf("AerialUEsubscriptionInformation", &enumAerialUEsubscriptionInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return AerialUEsubscriptionInformation(v) + }), + enumCaseOf("CEModeBRestricted", &enumCEModeBRestricted, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CEModeBRestricted(v) + }), + enumCaseOf("CEmodeBSupportIndicator", &enumCEmodeBSupportIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CEmodeBSupportIndicator(v) + }), + enumCaseOf("CSFallbackIndicator", &enumCSFallbackIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CSFallbackIndicator(v) + }), + enumCaseOf("CellAccessMode", &enumCellAccessMode, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CellAccessMode(v) + }), + enumCaseOf("CoverageLevel", &enumCoverageLevel, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return CoverageLevel(v) + }), + enumCaseOf("DLNASPDUDeliveryAckRequest", &enumDLNASPDUDeliveryAckRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return DLNASPDUDeliveryAckRequest(v) + }), + enumCaseOf("EDTSession", &enumEDTSession, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EDTSession(v) + }), + enumCaseOf("EndIndication", &enumEndIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EndIndication(v) + }), + enumCaseOf("EnhancedCoverageRestricted", &enumEnhancedCoverageRestricted, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return EnhancedCoverageRestricted(v) + }), + enumCaseOf("IABAuthorized", &enumIABAuthorized, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IABAuthorized(v) + }), + enumCaseOf("IABNodeIndication", &enumIABNodeIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IABNodeIndication(v) + }), + enumCaseOf("IABSupported", &enumIABSupported, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return IABSupported(v) + }), + enumCaseOf("LTEMIndication", &enumLTEMIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return LTEMIndication(v) + }), + enumCaseOf("MMERelaySupportIndicator", &enumMMERelaySupportIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return MMERelaySupportIndicator(v) + }), + enumCaseOf("ManagementBasedMDTAllowed", &enumManagementBasedMDTAllowed, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ManagementBasedMDTAllowed(v) + }), + enumCaseOf("NBIoTDefaultPagingDRX", &enumNBIoTDefaultPagingDRX, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTDefaultPagingDRX(v) + }), + enumCaseOf("NBIoTPagingDRX", &enumNBIoTPagingDRX, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTPagingDRX(v) + }), + enumCaseOf("NotifySourceeNB", &enumNotifySourceeNB, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NotifySourceeNB(v) + }), + enumCaseOf("PSServiceNotAvailable", &enumPSServiceNotAvailable, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PSServiceNotAvailable(v) + }), + enumCaseOf("PagingCause", &enumPagingCause, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingCause(v) + }), + enumCaseOf("PendingDataIndication", &enumPendingDataIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PendingDataIndication(v) + }), + enumCaseOf("RelayNodeIndicator", &enumRelayNodeIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RelayNodeIndicator(v) + }), + enumCaseOf("SRVCCHOIndication", &enumSRVCCHOIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SRVCCHOIndication(v) + }), + enumCaseOf("SRVCCOperationNotPossible", &enumSRVCCOperationNotPossible, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SRVCCOperationNotPossible(v) + }), + enumCaseOf("SRVCCOperationPossible", &enumSRVCCOperationPossible, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SRVCCOperationPossible(v) + }), + enumCaseOf("SecondaryRATDataUsageRequest", &enumSecondaryRATDataUsageRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SecondaryRATDataUsageRequest(v) + }), + enumCaseOf("SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator", &enumSubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator(v) + }), + enumCaseOf("SubscriptionBasedUEDifferentiationInfoStationaryIndication", &enumSubscriptionBasedUEDifferentiationInfoStationaryIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SubscriptionBasedUEDifferentiationInfoStationaryIndication(v) + }), + enumCaseOf("SubscriptionBasedUEDifferentiationInfoTrafficProfile", &enumSubscriptionBasedUEDifferentiationInfoTrafficProfile, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SubscriptionBasedUEDifferentiationInfoTrafficProfile(v) + }), + enumCaseOf("SubscriptionBasedUEDifferentiationInfoBatteryIndication", &enumSubscriptionBasedUEDifferentiationInfoBatteryIndication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SubscriptionBasedUEDifferentiationInfoBatteryIndication(v) + }), + enumCaseOf("UECapabilityInfoRequest", &enumUECapabilityInfoRequest, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UECapabilityInfoRequest(v) + }), + enumCaseOf("UEUserPlaneCIoTSupportIndicator", &enumUEUserPlaneCIoTSupportIndicator, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return UEUserPlaneCIoTSupportIndicator(v) + }), + enumCaseOf("ExpectedHOInterval", &enumExpectedHOInterval, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ExpectedHOInterval(v) + }), + enumCaseOf("NBIoTPagingeDRXCycle", &enumNBIoTPagingeDRXCycle, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTPagingeDRXCycle(v) + }), + enumCaseOf("NBIoTPagingTimeWindow", &enumNBIoTPagingTimeWindow, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NBIoTPagingTimeWindow(v) + }), + enumCaseOf("VehicleUE", &enumVehicleUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return VehicleUE(v) + }), + enumCaseOf("PedestrianUE", &enumPedestrianUE, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PedestrianUE(v) + }), + enumCaseOf("PagingeDRXCycle", &enumPagingeDRXCycle, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingeDRXCycle(v) + }), + enumCaseOf("PagingTimeWindow", &enumPagingTimeWindow, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingTimeWindow(v) + }), + enumCaseOf("ProSeDirectDiscovery", &enumProSeDirectDiscovery, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ProSeDirectDiscovery(v) + }), + enumCaseOf("ProSeDirectCommunication", &enumProSeDirectCommunication, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ProSeDirectCommunication(v) + }), + enumCaseOf("ProSeUEtoNetworkRelaying", &enumProSeUEtoNetworkRelaying, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return ProSeUEtoNetworkRelaying(v) + }), + enumCaseOf("PagingProbabilityInformation", &enumPagingProbabilityInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return PagingProbabilityInformation(v) + }), + enumCaseOf("NextPagingAreaScope", &enumNextPagingAreaScope, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return NextPagingAreaScope(v) + }), + enumCaseOf("SourceOfUEActivityBehaviourInformation", &enumSourceOfUEActivityBehaviourInformation, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SourceOfUEActivityBehaviourInformation(v) + }), + enumCaseOf("SecondaryRATType", &enumSecondaryRATType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return SecondaryRATType(v) + }), + enumCaseOf("RangeType", &enumRangeType, func(v int64) interface { + per.Marshaler + Name() string + Diagnose(*ap.Diagnosis[ProtocolIEID]) bool + } { + return RangeType(v) + }), enumCaseOf("PagingDRX", &enumPagingDRX, func(v int64) interface { per.Marshaler Name() string diff --git a/s1ap/enum_extension_test.go b/s1ap/enum_extension_test.go index 547906bb7e..cb2aac7f1f 100644 --- a/s1ap/enum_extension_test.go +++ b/s1ap/enum_extension_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // The k'th extension addition of an ENUMERATED whose root holds nRoot values. @@ -29,7 +29,7 @@ func extensionEnum(t *testing.T, nRoot, k int64) []byte { func TestPagingEnumExtensionsAreIgnored(t *testing.T) { msg, err := ParsePaging(container(t, ieField{ID: IDPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, - ieField{ID: IDPagingPriority, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, int64(len(enumPagingPriority.Root)), 100))}, + ieField{ID: IDPagingPriority, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extensionEnum(t, int64(len(enumPagingPriority.Root)), 100))}, )) if err != nil { t.Fatalf("parse: %v", err) @@ -50,7 +50,7 @@ func TestPagingEnumExtensionsAreIgnored(t *testing.T) { func TestNotComprehendedIEIsNotDelivered(t *testing.T) { msg, err := ParseENBConfigurationUpdate(container(t, ieField{ID: IDENBname, Criticality: CriticalityIgnore, Value: Name("ella-enb")}, - ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: ap.RawValue(extensionEnum(t, int64(len(enumPagingDRX.Root)), 100))}, + ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extensionEnum(t, int64(len(enumPagingDRX.Root)), 100))}, )) if err != nil { t.Fatalf("parse: %v", err) diff --git a/s1ap/enum_names.go b/s1ap/enum_names.go index 020493e5e1..c8a8c9bd4f 100644 --- a/s1ap/enum_names.go +++ b/s1ap/enum_names.go @@ -219,3 +219,260 @@ var enumPatternPeriod = per.Enum[PatternPeriod]{ Root: []string{"ms1280", "ms2560", "ms5120", "ms10240"}, Extensible: true, } + +var enumConcurrentWarningMessageIndicator = per.Enum[ConcurrentWarningMessageIndicator]{ + Root: []string{"true"}, +} + +var enumKillAllWarningMessages = per.Enum[KillAllWarningMessages]{ + Root: []string{"true"}, +} + +var enumAdditionalCSFallbackIndicator = per.Enum[AdditionalCSFallbackIndicator]{ + Root: []string{"no-restriction", "restriction"}, + Extensible: true, +} + +var enumAerialUEsubscriptionInformation = per.Enum[AerialUEsubscriptionInformation]{ + Root: []string{"allowed", "not-allowed"}, + Extensible: true, +} + +var enumCEModeBRestricted = per.Enum[CEModeBRestricted]{ + Root: []string{"restricted", "not-restricted"}, + Extensible: true, +} + +var enumCEmodeBSupportIndicator = per.Enum[CEmodeBSupportIndicator]{ + Root: []string{"supported"}, + Extensible: true, +} + +var enumCSFallbackIndicator = per.Enum[CSFallbackIndicator]{ + Root: []string{"cs-fallback-required"}, + Extension: []string{"cs-fallback-high-priority"}, +} + +var enumCSGMembershipStatus = per.Enum[CSGMembershipStatus]{ + Root: []string{"member", "not-member"}, +} + +var enumCellAccessMode = per.Enum[CellAccessMode]{ + Root: []string{"hybrid"}, + Extensible: true, +} + +var enumCoverageLevel = per.Enum[CoverageLevel]{ + Root: []string{"extendedcoverage"}, + Extensible: true, +} + +var enumDLNASPDUDeliveryAckRequest = per.Enum[DLNASPDUDeliveryAckRequest]{ + Root: []string{"requested"}, + Extensible: true, +} + +var enumEDTSession = per.Enum[EDTSession]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumEndIndication = per.Enum[EndIndication]{ + Root: []string{"no-further-data", "further-data-exists"}, + Extensible: true, +} + +var enumEnhancedCoverageRestricted = per.Enum[EnhancedCoverageRestricted]{ + Root: []string{"restricted"}, + Extensible: true, +} + +var enumIABAuthorized = per.Enum[IABAuthorized]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumIABNodeIndication = per.Enum[IABNodeIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumIABSupported = per.Enum[IABSupported]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumLTEMIndication = per.Enum[LTEMIndication]{ + Root: []string{"lte-m"}, + Extensible: true, +} + +var enumMMERelaySupportIndicator = per.Enum[MMERelaySupportIndicator]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumManagementBasedMDTAllowed = per.Enum[ManagementBasedMDTAllowed]{ + Root: []string{"allowed"}, + Extensible: true, +} + +var enumNBIoTDefaultPagingDRX = per.Enum[NBIoTDefaultPagingDRX]{ + Root: []string{"v128", "v256", "v512", "v1024"}, + Extensible: true, +} + +var enumNBIoTPagingDRX = per.Enum[NBIoTPagingDRX]{ + Root: []string{"v32", "v64", "v128", "v256", "v512", "v1024"}, + Extensible: true, +} + +var enumNotifySourceeNB = per.Enum[NotifySourceeNB]{ + Root: []string{"notifySource"}, + Extensible: true, +} + +var enumPSServiceNotAvailable = per.Enum[PSServiceNotAvailable]{ + Root: []string{"ps-service-not-available"}, + Extensible: true, +} + +var enumPagingCause = per.Enum[PagingCause]{ + Root: []string{"voice"}, + Extensible: true, +} + +var enumPendingDataIndication = per.Enum[PendingDataIndication]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumRelayNodeIndicator = per.Enum[RelayNodeIndicator]{ + Root: []string{"true"}, + Extensible: true, +} + +var enumSRVCCHOIndication = per.Enum[SRVCCHOIndication]{ + Root: []string{"pSandCS", "cSonly"}, + Extensible: true, +} + +var enumSRVCCOperationNotPossible = per.Enum[SRVCCOperationNotPossible]{ + Root: []string{"notPossible"}, + Extensible: true, +} + +var enumSRVCCOperationPossible = per.Enum[SRVCCOperationPossible]{ + Root: []string{"possible"}, + Extensible: true, +} + +var enumSecondaryRATDataUsageRequest = per.Enum[SecondaryRATDataUsageRequest]{ + Root: []string{"requested"}, + Extensible: true, +} + +var enumSubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator = per.Enum[SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator]{ + Root: []string{"periodically", "ondemand"}, + Extensible: true, +} + +var enumSubscriptionBasedUEDifferentiationInfoStationaryIndication = per.Enum[SubscriptionBasedUEDifferentiationInfoStationaryIndication]{ + Root: []string{"stationary", "mobile"}, + Extensible: true, +} + +var enumSubscriptionBasedUEDifferentiationInfoTrafficProfile = per.Enum[SubscriptionBasedUEDifferentiationInfoTrafficProfile]{ + Root: []string{"single-packet", "dual-packets", "multiple-packets"}, + Extensible: true, +} + +var enumSubscriptionBasedUEDifferentiationInfoBatteryIndication = per.Enum[SubscriptionBasedUEDifferentiationInfoBatteryIndication]{ + Root: []string{"battery-powered", "battery-powered-not-rechargeable-or-replaceable", "not-battery-powered"}, + Extensible: true, +} + +var enumUECapabilityInfoRequest = per.Enum[UECapabilityInfoRequest]{ + Root: []string{"requested"}, + Extensible: true, +} + +var enumUEUserPlaneCIoTSupportIndicator = per.Enum[UEUserPlaneCIoTSupportIndicator]{ + Root: []string{"supported"}, + Extensible: true, +} + +var enumExpectedHOInterval = per.Enum[ExpectedHOInterval]{ + Root: []string{"sec15", "sec30", "sec60", "sec90", "sec120", "sec180", "long-time"}, + Extensible: true, +} + +var enumNBIoTPagingeDRXCycle = per.Enum[NBIoTPagingeDRXCycle]{ + Root: []string{"hf2", "hf4", "hf6", "hf8", "hf10", "hf12", "hf14", "hf16", "hf32", "hf64", "hf128", "hf256", "hf512", "hf1024"}, + Extensible: true, +} + +var enumNBIoTPagingTimeWindow = per.Enum[NBIoTPagingTimeWindow]{ + Root: []string{"s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s16"}, + Extensible: true, +} + +var enumVehicleUE = per.Enum[VehicleUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumPedestrianUE = per.Enum[PedestrianUE]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumPagingeDRXCycle = per.Enum[PagingeDRXCycle]{ + Root: []string{"hfhalf", "hf1", "hf2", "hf4", "hf6", "hf8", "hf10", "hf12", "hf14", "hf16", "hf32", "hf64", "hf128", "hf256"}, + Extensible: true, +} + +var enumPagingTimeWindow = per.Enum[PagingTimeWindow]{ + Root: []string{"s1", "s2", "s3", "s4", "s5", "s6", "s7", "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", "s16"}, + Extensible: true, +} + +var enumProSeDirectDiscovery = per.Enum[ProSeDirectDiscovery]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumProSeDirectCommunication = per.Enum[ProSeDirectCommunication]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumProSeUEtoNetworkRelaying = per.Enum[ProSeUEtoNetworkRelaying]{ + Root: []string{"authorized", "not-authorized"}, + Extensible: true, +} + +var enumPagingProbabilityInformation = per.Enum[PagingProbabilityInformation]{ + Root: []string{"p00", "p05", "p10", "p15", "p20", "p25", "p30", "p35", "p40", "p45", "p50", "p55", "p60", "p65", "p70", "p75", "p80", "p85", "p90", "p95", "p100"}, + Extensible: true, +} + +var enumNextPagingAreaScope = per.Enum[NextPagingAreaScope]{ + Root: []string{"same", "changed"}, + Extensible: true, +} + +var enumSourceOfUEActivityBehaviourInformation = per.Enum[SourceOfUEActivityBehaviourInformation]{ + Root: []string{"subscription-information", "statistics"}, + Extensible: true, +} + +var enumSecondaryRATType = per.Enum[SecondaryRATType]{ + Root: []string{"nR"}, + Extension: []string{"unlicensed"}, +} + +var enumRangeType = per.Enum[RangeType]{ + Root: []string{"m50", "m80", "m180", "m200", "m350", "m400", "m500", "m700", "m1000"}, + Extensible: true, +} diff --git a/s1ap/erab_lists.go b/s1ap/erab_lists.go index ddbf6b48b9..20cf3663e2 100644 --- a/s1ap/erab_lists.go +++ b/s1ap/erab_lists.go @@ -3,7 +3,10 @@ package s1ap -import "github.com/ellanetworks/core/per" +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) type ERABToBeSwitchedULItem struct { ERABID ERABID @@ -116,14 +119,14 @@ func (l *ERABToBeModifiedListBearerModInd) UnmarshalPER(r *per.Reader, enc per.E return nil } -type ERABNotToBeModifiedListBearerModInd []ERABToBeModifiedItemBearerModInd +type ERABNotToBeModifiedListBearerModInd []ERABNotToBeModifiedItemBearerModInd func (l ERABNotToBeModifiedListBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject, l) } func (l *ERABNotToBeModifiedListBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - items, err := decodeItemList[ERABToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) + items, err := decodeItemList[ERABNotToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) if err != nil { return err } @@ -217,3 +220,51 @@ func (l *ERABToBeSwitchedULList) UnmarshalPER(r *per.Reader, enc per.Encoding) e return nil } + +func (l *ERABToBeSetupListCtxtSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeSetupItemCtxtSUReq, CriticalityReject, l) +} + +func (l *ERABSetupListCtxtSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABSetupItemCtxtSURes, CriticalityIgnore, l) +} + +func (l *ERABToBeSetupListBearerSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeSetupItemBearerSUReq, CriticalityReject, l) +} + +func (l *ERABSetupListBearerSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABSetupItemBearerSURes, CriticalityIgnore, l) +} + +func (l *ERABToBeModifiedListBearerModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeModifiedItemBearerModReq, CriticalityReject, l) +} + +func (l *ERABToBeModifiedListBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeModifiedItemBearerModInd, CriticalityReject, l) +} + +func (l *ERABNotToBeModifiedListBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject, l) +} + +func (l *ERABToBeSetupListHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeSetupItemHOReq, CriticalityReject, l) +} + +func (l *ERABAdmittedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABAdmittedItem, CriticalityIgnore, l) +} + +func (l *ERABSubjecttoDataForwardingList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABDataForwardingItem, CriticalityIgnore, l) +} + +func (l *ERABToBeSwitchedDLList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeSwitchedDLItem, CriticalityReject, l) +} + +func (l *ERABToBeSwitchedULList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeSwitchedULItem, CriticalityIgnore, l) +} diff --git a/s1ap/erab_modification.go b/s1ap/erab_modification.go index e49b51884e..51f7ecae99 100644 --- a/s1ap/erab_modification.go +++ b/s1ap/erab_modification.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // ERABToBeModifiedItemBearerModInd ::= SEQUENCE { e-RAB-ID, transportLayerAddress, @@ -18,14 +19,25 @@ type ERABToBeModifiedItemBearerModInd struct { containerCrit `per:"-"` } +type ERABNotToBeModifiedItemBearerModInd struct { + ERABID ERABID + TransportLayerAddress TransportLayerAddress + DLGTPTEID GTPTEID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + // TS 36.413 §9.1.3.8. type ERABModificationIndication struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - ToBeModified ERABToBeModifiedListBearerModInd - NotToBeModified ERABNotToBeModifiedListBearerModInd - UserLocationInformation *UserLocationInformation - TunnelInformationForBBF *TunnelInformation + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + ToBeModified ERABToBeModifiedListBearerModInd + NotToBeModified ERABNotToBeModifiedListBearerModInd + UserLocationInformation *UserLocationInformation + TunnelInformationForBBF *TunnelInformation + CSGMembershipInfo *CSGMembershipInfo + SecondaryRATDataUsageReportList SecondaryRATDataUsageReportList messageMeta } @@ -55,7 +67,7 @@ var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ return err }, Encode: func(m *ERABModificationIndication) (per.Marshaler, bool) { - return containerList(maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject, m.ToBeModified), true + return containerList(maxnoofERABs, IDERABToBeModifiedItemBearerModInd, CriticalityReject, &m.ToBeModified), true }, }, { @@ -63,7 +75,7 @@ var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { var err error - m.NotToBeModified, err = decodeItemList[ERABToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) + m.NotToBeModified, err = decodeItemList[ERABNotToBeModifiedItemBearerModInd](r, enc, maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject) return err }, @@ -72,9 +84,10 @@ var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ return nil, false } - return containerList(maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject, m.NotToBeModified), true + return containerList(maxnoofERABs, IDERABNotToBeModifiedItemBearerModInd, CriticalityReject, &m.NotToBeModified), true }, }, + apimpl.OptionalIE(IDCSGMembershipInfo, CriticalityReject, func(m *ERABModificationIndication) **CSGMembershipInfo { return &m.CSGMembershipInfo }), { ID: IDTunnelInformationForBBF, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { @@ -84,6 +97,9 @@ var eRABModificationIndicationIEs = []ieSpec[ERABModificationIndication]{ return optionalIE(m.TunnelInformationForBBF) }, }, + apimpl.ListIE(IDSecondaryRATDataUsageReportList, CriticalityIgnore, func(m *ERABModificationIndication) *SecondaryRATDataUsageReportList { + return &m.SecondaryRATDataUsageReportList + }), { ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *ERABModificationIndication, r *per.Reader, enc per.Encoding) error { @@ -138,9 +154,10 @@ func DecodeERABModificationIndication(value []byte) (*ERABModificationIndication // erabModifyItemBearerModConf ::= SEQUENCE { e-RAB-ID, iE-Extensions OPTIONAL } // (extensible). type erabModifyItemBearerModConf struct { - extensions per.ExtensionAdditions `per:",extraw"` - erabID ERABID - iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + erabID ERABID + iEExtensions extensionMeta `per:",exttable"` + containerCrit `per:"-"` } // TS 36.413 §9.1.3.9. @@ -151,6 +168,7 @@ type ERABModificationConfirm struct { FailedToModify []ERABItem ToBeReleased []ERABItem CriticalityDiagnostics *CriticalityDiagnostics + CSGMembershipStatus *CSGMembershipStatus messageMeta } @@ -223,7 +241,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ items[i] = erabModifyItemBearerModConf{erabID: id} } - return containerList(maxnoofERABs, IDERABModifyItemBearerModConf, CriticalityIgnore, items), true + return containerList(maxnoofERABs, IDERABModifyItemBearerModConf, CriticalityIgnore, &items), true }, }, { @@ -240,7 +258,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.FailedToModify), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.FailedToModify), true }, }, { @@ -257,7 +275,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ToBeReleased), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ToBeReleased), true }, }, { @@ -281,6 +299,7 @@ var erabModificationConfirmIEs = []ieSpec[ERABModificationConfirm]{ return m.CriticalityDiagnostics, true }, }, + apimpl.OptionalIE(IDCSGMembershipStatus, CriticalityIgnore, func(m *ERABModificationConfirm) **CSGMembershipStatus { return &m.CSGMembershipStatus }), } func (m *ERABModificationConfirm) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/erab_modify.go b/s1ap/erab_modify.go index 5e00697cdc..3047d74483 100644 --- a/s1ap/erab_modify.go +++ b/s1ap/erab_modify.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // ERABToBeModifiedItemBearerModReq ::= SEQUENCE { e-RAB-ID, @@ -29,17 +30,19 @@ type TransportInformation struct { // ERABModifyItemBearerModRes ::= SEQUENCE { e-RAB-ID, iE-Extensions OPTIONAL } // (extensible) (TS 36.413). type ERABModifyItemBearerModRes struct { - extensions per.ExtensionAdditions `per:",extraw"` - ERABID ERABID - iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + iEExtensions extensionMeta `per:",exttable"` + containerCrit `per:"-"` } // TS 36.413 §9.1.3.3. type ERABModifyRequest struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - UEAggregateMaximumBitRate *UEAggregateMaximumBitRate - ERABToBeModified ERABToBeModifiedListBearerModReq + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + ERABToBeModified ERABToBeModifiedListBearerModReq + SecondaryRATDataUsageRequest *SecondaryRATDataUsageRequest messageMeta } @@ -94,9 +97,10 @@ var eRABModifyRequestIEs = []ieSpec[ERABModifyRequest]{ return err }, Encode: func(m *ERABModifyRequest) (per.Marshaler, bool) { - return containerList(maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject, m.ERABToBeModified), true + return containerList(maxnoofERABs, IDERABToBeModifiedItemBearerModReq, CriticalityReject, &m.ERABToBeModified), true }, }, + apimpl.OptionalIE(IDSecondaryRATDataUsageRequest, CriticalityIgnore, func(m *ERABModifyRequest) **SecondaryRATDataUsageRequest { return &m.SecondaryRATDataUsageRequest }), } func (m *ERABModifyRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -129,12 +133,13 @@ func DecodeERABModifyRequest(value []byte) (*ERABModifyRequest, error) { // TS 36.413 §9.1.3.4. type ERABModifyResponse struct { - MMEUES1APID *MMEUES1APID - ENBUES1APID *ENBUES1APID - ERABModify []ERABModifyItemBearerModRes - ERABFailedToModify []ERABItem - CriticalityDiagnostics *CriticalityDiagnostics - UserLocationInformation *UserLocationInformation + MMEUES1APID *MMEUES1APID + ENBUES1APID *ENBUES1APID + ERABModify []ERABModifyItemBearerModRes + ERABFailedToModify []ERABItem + CriticalityDiagnostics *CriticalityDiagnostics + UserLocationInformation *UserLocationInformation + SecondaryRATDataUsageReportList SecondaryRATDataUsageReportList messageMeta } @@ -196,7 +201,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABModifyItemBearerModRes, CriticalityIgnore, m.ERABModify), true + return containerList(maxnoofERABs, IDERABModifyItemBearerModRes, CriticalityIgnore, &m.ERABModify), true }, }, { @@ -213,7 +218,7 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToModify), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABFailedToModify), true }, }, { @@ -237,6 +242,9 @@ var eRABModifyResponseIEs = []ieSpec[ERABModifyResponse]{ return m.CriticalityDiagnostics, true }, }, + apimpl.ListIE(IDSecondaryRATDataUsageReportList, CriticalityIgnore, func(m *ERABModifyResponse) *SecondaryRATDataUsageReportList { + return &m.SecondaryRATDataUsageReportList + }), { ID: IDUserLocationInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *ERABModifyResponse, r *per.Reader, enc per.Encoding) error { diff --git a/s1ap/erab_release.go b/s1ap/erab_release.go index d5fff8cd45..bd2e12e959 100644 --- a/s1ap/erab_release.go +++ b/s1ap/erab_release.go @@ -5,14 +5,16 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // ERABReleaseItemBearerRelComp ::= SEQUENCE { e-RAB-ID, iE-Extensions OPTIONAL } // (extensible): an E-RAB the eNB confirms released (TS 36.413). type ERABReleaseItemBearerRelComp struct { - extensions per.ExtensionAdditions `per:",extraw"` - ERABID ERABID - iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + iEExtensions extensionMeta `per:",exttable"` + containerCrit `per:"-"` } // TS 36.413 §9.1.3.5. @@ -80,7 +82,7 @@ var eRABReleaseCommandIEs = []ieSpec[ERABReleaseCommand]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToBeReleased), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABToBeReleased), true }, }, { @@ -128,12 +130,13 @@ func DecodeERABReleaseCommand(value []byte) (*ERABReleaseCommand, error) { // TS 36.413 §9.1.3.6. type ERABReleaseResponse struct { - MMEUES1APID *MMEUES1APID - ENBUES1APID *ENBUES1APID - ERABReleased []ERABReleaseItemBearerRelComp - ERABFailedToRelease []ERABItem - CriticalityDiagnostics *CriticalityDiagnostics - UserLocationInformation *UserLocationInformation + MMEUES1APID *MMEUES1APID + ENBUES1APID *ENBUES1APID + ERABReleased []ERABReleaseItemBearerRelComp + ERABFailedToRelease []ERABItem + CriticalityDiagnostics *CriticalityDiagnostics + UserLocationInformation *UserLocationInformation + SecondaryRATDataUsageReportList SecondaryRATDataUsageReportList messageMeta } @@ -195,7 +198,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABReleaseItemBearerRelComp, CriticalityIgnore, m.ERABReleased), true + return containerList(maxnoofERABs, IDERABReleaseItemBearerRelComp, CriticalityIgnore, &m.ERABReleased), true }, }, { @@ -212,7 +215,7 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToRelease), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABFailedToRelease), true }, }, { @@ -257,6 +260,9 @@ var eRABReleaseResponseIEs = []ieSpec[ERABReleaseResponse]{ return m.UserLocationInformation, true }, }, + apimpl.ListIE(IDSecondaryRATDataUsageReportList, CriticalityIgnore, func(m *ERABReleaseResponse) *SecondaryRATDataUsageReportList { + return &m.SecondaryRATDataUsageReportList + }), } func (m *ERABReleaseResponse) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -288,10 +294,11 @@ func DecodeERABReleaseResponse(value []byte) (*ERABReleaseResponse, error) { } type ERABReleaseIndication struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - ERABReleased []ERABItem - UserLocationInformation *UserLocationInformation + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + ERABReleased []ERABItem + UserLocationInformation *UserLocationInformation + SecondaryRATDataUsageReportList SecondaryRATDataUsageReportList messageMeta } @@ -325,7 +332,7 @@ var eRABReleaseIndicationIEs = []ieSpec[ERABReleaseIndication]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABReleased), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABReleased), true }, }, { @@ -349,6 +356,9 @@ var eRABReleaseIndicationIEs = []ieSpec[ERABReleaseIndication]{ return m.UserLocationInformation, true }, }, + apimpl.ListIE(IDSecondaryRATDataUsageReportList, CriticalityIgnore, func(m *ERABReleaseIndication) *SecondaryRATDataUsageReportList { + return &m.SecondaryRATDataUsageReportList + }), } func (m *ERABReleaseIndication) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/erab_release_test.go b/s1ap/erab_release_test.go index 894f5dfb6d..23766728a9 100644 --- a/s1ap/erab_release_test.go +++ b/s1ap/erab_release_test.go @@ -45,7 +45,7 @@ func TestERABReleaseCommandRoundTrips(t *testing.T) { t.Fatalf("header mismatch: %+v", out) } - if out.UEAggregateMaximumBitRate == nil || *out.UEAggregateMaximumBitRate != ambr { + if out.UEAggregateMaximumBitRate == nil || !out.UEAggregateMaximumBitRate.Equal(ambr) { t.Fatalf("UE-AMBR mismatch: %+v", out.UEAggregateMaximumBitRate) } @@ -165,7 +165,7 @@ func TestERABReleaseIndicationRoundTrips(t *testing.T) { } } -func TestDecodeItemListRejectsWrongItemID(t *testing.T) { +func TestWrongListItemIDNeverReachesTheTypedList(t *testing.T) { m := &ERABReleaseIndication{MMEUES1APID: 1, ENBUES1APID: 2, ERABReleased: []ERABItem{{ERABID: 5, Cause: CauseRadioNetworkUnspecified.Cause()}}} wire, err := m.Marshal() diff --git a/s1ap/erab_setup.go b/s1ap/erab_setup.go index 4402d7d538..93e32f2b7e 100644 --- a/s1ap/erab_setup.go +++ b/s1ap/erab_setup.go @@ -29,7 +29,14 @@ type ERABToBeSetupItemBearerSUReq struct { // ERABSetupItemBearerSURes ::= SEQUENCE { e-RAB-ID, transportLayerAddress, // gTP-TEID }: the eNB endpoint the UPF sends downlink traffic to. -type ERABSetupItemBearerSURes = ERABSetupItemCtxtSURes +type ERABSetupItemBearerSURes struct { + ERABID ERABID + TransportLayerAddress TransportLayerAddress + GTPTEID GTPTEID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} // TS 36.413 §9.1.3.1. type ERABSetupRequest struct { @@ -91,7 +98,7 @@ var eRABSetupRequestIEs = []ieSpec[ERABSetupRequest]{ return err }, Encode: func(m *ERABSetupRequest) (per.Marshaler, bool) { - return containerList(maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject, m.ERABToBeSetup), true + return containerList(maxnoofERABs, IDERABToBeSetupItemBearerSUReq, CriticalityReject, &m.ERABToBeSetup), true }, }, } @@ -193,7 +200,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore, m.ERABSetup), true + return containerList(maxnoofERABs, IDERABSetupItemBearerSURes, CriticalityIgnore, &m.ERABSetup), true }, }, { @@ -210,7 +217,7 @@ var eRABSetupResponseIEs = []ieSpec[ERABSetupResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToSetup), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABFailedToSetup), true }, }, { diff --git a/s1ap/erab_setup_test.go b/s1ap/erab_setup_test.go index 47aa951dfb..ede6eaac26 100644 --- a/s1ap/erab_setup_test.go +++ b/s1ap/erab_setup_test.go @@ -55,7 +55,7 @@ func TestERABSetupRequestRoundTrips(t *testing.T) { t.Fatalf("header mismatch: %+v", out) } - if out.UEAggregateMaximumBitRate == nil || *out.UEAggregateMaximumBitRate != ambr { + if out.UEAggregateMaximumBitRate == nil || !out.UEAggregateMaximumBitRate.Equal(ambr) { t.Fatalf("UE-AMBR mismatch: %+v", out.UEAggregateMaximumBitRate) } diff --git a/s1ap/errors.go b/s1ap/errors.go index 56106adbab..b6ee0e59ad 100644 --- a/s1ap/errors.go +++ b/s1ap/errors.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Octets that are not a decodable PER encoding; nothing of the message is @@ -70,21 +71,7 @@ func (e *AbstractSyntaxError) HasUnsuccessfulOutcome() bool { // Of the IE Criticality, §9.2.1.21 says "The value 'ignore' shall not be used". func reportableIEs(ies []CriticalityDiagnosticsIEItem) []CriticalityDiagnosticsIEItem { - out := make([]CriticalityDiagnosticsIEItem, 0, len(ies)) - - for _, ie := range ies { - if ie.IECriticality == CriticalityIgnore { - continue - } - - out = append(out, ie) - } - - if len(out) == 0 { - return nil - } - - return out + return apimpl.Reportable(ies, func(ie CriticalityDiagnosticsIEItem) Criticality { return ie.IECriticality }) } // An ERROR INDICATION for UE-associated signalling names the association it diff --git a/s1ap/extension_criticality_test.go b/s1ap/extension_criticality_test.go index e802e59983..4fd0e1740c 100644 --- a/s1ap/extension_criticality_test.go +++ b/s1ap/extension_criticality_test.go @@ -10,6 +10,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // A real reject-criticality SupportedTAs-Item extension this version does not @@ -62,7 +63,7 @@ func TestRejectExtensionInsideIgnoreIERejects(t *testing.T) { ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(2)}, ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x7e, 0x00}}, ieField{ID: IDEUTRANCGI, Criticality: CriticalityIgnore, Value: &EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x0abcde1}}, - ieField{ID: IDTAI, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAI(t, CriticalityReject))}, + ieField{ID: IDTAI, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extendedTAI(t, CriticalityReject))}, )) var ase *AbstractSyntaxError @@ -90,7 +91,7 @@ func TestIgnoreExtensionKeepsItsIE(t *testing.T) { ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(2)}, ieField{ID: IDNASPDU, Criticality: CriticalityReject, Value: NASPDU{0x7e, 0x00}}, ieField{ID: IDEUTRANCGI, Criticality: CriticalityIgnore, Value: &EUTRANCGI{PLMNIdentity: PLMNIdentity{0x00, 0xf1, 0x10}, CellID: 0x0abcde1}}, - ieField{ID: IDTAI, Criticality: CriticalityIgnore, Value: ap.RawValue(extendedTAI(t, CriticalityIgnore))}, + ieField{ID: IDTAI, Criticality: CriticalityIgnore, Value: apimpl.RawValue(extendedTAI(t, CriticalityIgnore))}, )) if err != nil { t.Fatalf("parse: %v", err) diff --git a/s1ap/extension_typing_test.go b/s1ap/extension_typing_test.go index e8ef5ffea4..73effb872e 100644 --- a/s1ap/extension_typing_test.go +++ b/s1ap/extension_typing_test.go @@ -4,11 +4,7 @@ package s1ap import ( - "os" - "path/filepath" - "regexp" - "strconv" - "strings" + "reflect" "testing" "github.com/ellanetworks/core/per/ap" @@ -39,131 +35,153 @@ func extSpecRows[M any](table []ieSpec[M]) []extSpecRow { return rows } -func typedExtensionTables() []struct { +type extTableCase struct { set string rows []extSpecRow -} { - return []struct { - set string - rows []extSpecRow - }{ - {"Additional-GUTI-ExtIEs", extSpecRows(extIEsAdditionalGUTI)}, - {"AllocationAndRetentionPriority-ExtIEs", extSpecRows(extIEsAllocationAndRetentionPriority)}, - {"CGI-ExtIEs", extSpecRows(extIEsCGI)}, - {"CNTypeRestrictions-Item-ExtIEs", extSpecRows(extIEsCNTypeRestrictionsItem)}, - {"CancelledCellinEAI-Item-ExtIEs", extSpecRows(extIEsCancelledCellInEAIItem)}, - {"CancelledCellinTAI-Item-ExtIEs", extSpecRows(extIEsCancelledCellInTAIItem)}, - {"CellID-Broadcast-Item-ExtIEs", extSpecRows(extIEsCellIDBroadcastItem)}, - {"CellID-Cancelled-Item-ExtIEs", extSpecRows(extIEsCellIDCancelledItem)}, - {"CellType-ExtIEs", extSpecRows(extIEsCellType)}, - {"CompletedCellinEAI-Item-ExtIEs", extSpecRows(extIEsCompletedCellInEAIItem)}, - {"CompletedCellinTAI-Item-ExtIEs", extSpecRows(extIEsCompletedCellInTAIItem)}, - {"ContextatSource-ExtIEs", extSpecRows(extIEsContextatSource)}, - {"CriticalityDiagnostics-ExtIEs", extSpecRows(extIEsCriticalityDiagnostics)}, - {"CriticalityDiagnostics-IE-Item-ExtIEs", extSpecRows(extIEsCriticalityDiagnosticsIEItem)}, - {"DAPSRequestInfo-ExtIEs", extSpecRows(extIEsDAPSRequestInfo)}, - {"ENBX2ExtTLA-ExtIEs", extSpecRows(extIEsENBX2ExtTLA)}, - {"E-RABAdmittedItem-ExtIEs", extSpecRows(extIEsERABAdmittedItem)}, - {"E-RABDataForwardingItem-ExtIEs", extSpecRows(extIEsERABDataForwardingItem)}, - {"E-RABInformationListItem-ExtIEs", extSpecRows(extIEsERABInformationListItem)}, - {"E-RABItem-ExtIEs", extSpecRows(extIEsERABItem)}, - {"E-RABQoSParameters-ExtIEs", extSpecRows(extIEsERABLevelQoSParameters)}, - {"E-RABModifyItemBearerModResExtIEs", extSpecRows(extIEsERABModifyItemBearerModRes)}, - {"E-RABReleaseItemBearerRelCompExtIEs", extSpecRows(extIEsERABReleaseItemBearerRelComp)}, - {"E-RABSetupItemCtxtSUResExtIEs", extSpecRows(extIEsERABSetupItemCtxtSURes)}, - {"E-RABToBeModifiedItemBearerModInd-ExtIEs", extSpecRows(extIEsERABToBeModifiedItemBearerModInd)}, - {"E-RABToBeModifyItemBearerModReqExtIEs", extSpecRows(extIEsERABToBeModifiedItemBearerModReq)}, - {"E-RABToBeSetupItemBearerSUReqExtIEs", extSpecRows(extIEsERABToBeSetupItemBearerSUReq)}, - {"E-RABToBeSetupItemCtxtSUReqExtIEs", extSpecRows(extIEsERABToBeSetupItemCtxtSUReq)}, - {"E-RABToBeSetupItemHOReq-ExtIEs", extSpecRows(extIEsERABToBeSetupItemHOReq)}, - {"E-RABToBeSwitchedDLItem-ExtIEs", extSpecRows(extIEsERABToBeSwitchedDLItem)}, - {"E-RABToBeSwitchedULItem-ExtIEs", extSpecRows(extIEsERABToBeSwitchedULItem)}, - {"EUTRAN-CGI-ExtIEs", extSpecRows(extIEsEUTRANCGI)}, - {"EmergencyAreaID-Broadcast-Item-ExtIEs", extSpecRows(extIEsEmergencyAreaIDBroadcastItem)}, - {"EmergencyAreaID-Cancelled-Item-ExtIEs", extSpecRows(extIEsEmergencyAreaIDCancelledItem)}, - {"FiveGSTAI-ExtIEs", extSpecRows(extIEsFiveGSTAI)}, - {"ForbiddenLAs-Item-ExtIEs", extSpecRows(extIEsForbiddenLAsItem)}, - {"ForbiddenTAs-Item-ExtIEs", extSpecRows(extIEsForbiddenTAsItem)}, - {"GBR-QosInformation-ExtIEs", extSpecRows(extIEsGBRQosInformation)}, - {"GNB-ExtIEs", extSpecRows(extIEsGNB)}, - {"GUMMEI-ExtIEs", extSpecRows(extIEsGUMMEI)}, - {"GlobalENB-ID-ExtIEs", extSpecRows(extIEsGlobalENBID)}, - {"Global-GNB-ID-ExtIEs", extSpecRows(extIEsGlobalGNBID)}, - {"HandoverRestrictionList-ExtIEs", extSpecRows(extIEsHandoverRestrictionList)}, - {"InterSystemMeasurementItem-ExtIEs", extSpecRows(extIEsInterSystemMeasurementItem)}, - {"InterSystemMeasurementParameters-ExtIEs", extSpecRows(extIEsInterSystemMeasurementParameters)}, - {"IntersystemMeasurementConfiguration-ExtIEs", extSpecRows(extIEsIntersystemMeasurementConfiguration)}, - {"LAI-ExtIEs", extSpecRows(extIEsLAI)}, - {"LTE-NTN-TAI-Information-ExtIEs", extSpecRows(extIEsLTENTNTAIInformation)}, - {"LastVisitedEUTRANCellInformation-ExtIEs", extSpecRows(extIEsLastVisitedEUTRANCellInformation)}, - {"LastVisitedPSCellInformation-ExtIEs", extSpecRows(extIEsLastVisitedPSCellInformation)}, - {"ListeningSubframePattern-ExtIEs", extSpecRows(extIEsListeningSubframePattern)}, - {"MutingPatternInformation-ExtIEs", extSpecRows(extIEsMutingPatternInformation)}, - {"NR-CGI-ExtIEs", extSpecRows(extIEsNRCGI)}, - {"NG-eNB-ExtIEs", extSpecRows(extIEsNgENB)}, - {"PSCellInformation-ExtIEs", extSpecRows(extIEsPSCellInformation)}, - {"RAT-RestrictionsItem-ExtIEs", extSpecRows(extIEsRATRestrictionsItem)}, - {"RLFReportInformation-ExtIEs", extSpecRows(extIEsRLFReportInformation)}, - {"RequestType-ExtIEs", extSpecRows(extIEsRequestType)}, - {"RequestedTNLInfo-ExtIEs", extSpecRows(extIEsRequestedTNLInfo)}, - {"SONConfigurationTransfer-ExtIEs", extSpecRows(extIEsSONConfigurationTransfer)}, - {"SONInformationReply-ExtIEs", extSpecRows(extIEsSONInformationReply)}, - {"S-TMSI-ExtIEs", extSpecRows(extIEsSTMSI)}, - {"SecurityContext-ExtIEs", extSpecRows(extIEsSecurityContext)}, - {"SecurityIndication-ExtIEs", extSpecRows(extIEsSecurityIndication)}, - {"ServedGUMMEIsItem-ExtIEs", extSpecRows(extIEsServedGUMMEIsItem)}, - {"SourceNgRanNode-ID-ExtIEs", extSpecRows(extIEsSourceNgRanNodeID)}, - {"SourceeNB-ID-ExtIEs", extSpecRows(extIEsSourceeNBID)}, - {"SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs", extSpecRows(extIEsSourceeNBToTargeteNBTransparentContainer)}, - {"SupportedTAs-Item-ExtIEs", extSpecRows(extIEsSupportedTAItem)}, - {"SynchronisationInformation-ExtIEs", extSpecRows(extIEsSynchronisationInformation)}, - {"TAI-ExtIEs", extSpecRows(extIEsTAI)}, - {"TAI-Broadcast-Item-ExtIEs", extSpecRows(extIEsTAIBroadcastItem)}, - {"TAI-Cancelled-Item-ExtIEs", extSpecRows(extIEsTAICancelledItem)}, - {"TAIItemExtIEs", extSpecRows(extIEsTAIItem)}, - {"TargetNgRanNode-ID-ExtIEs", extSpecRows(extIEsTargetNgRanNodeID)}, - {"TargetRNC-ID-ExtIEs", extSpecRows(extIEsTargetRNCID)}, - {"TargeteNB-ID-ExtIEs", extSpecRows(extIEsTargeteNBID)}, - {"TimeBasedHandoverInformation-ExtIEs", extSpecRows(extIEsTimeBasedHandoverInformation)}, - {"TimeSynchronisationInfo-ExtIEs", extSpecRows(extIEsTimeSynchronisationInfo)}, - {"TraceActivation-ExtIEs", extSpecRows(extIEsTraceActivation)}, - {"Tunnel-Information-ExtIEs", extSpecRows(extIEsTunnelInformation)}, - {"UEAggregate-MaximumBitrates-ExtIEs", extSpecRows(extIEsUEAggregateMaximumBitRate)}, - {"UE-associatedLogicalS1-ConnectionItemExtIEs", extSpecRows(extIEsUEAssociatedLogicalS1ConnectionItem)}, - {"UE-S1AP-ID-pair-ExtIEs", extSpecRows(extIEsUES1APIDPair)}, - {"UESecurityCapabilities-ExtIEs", extSpecRows(extIEsUESecurityCapabilities)}, - {"UserLocationInformation-ExtIEs", extSpecRows(extIEsUserLocationInformation)}, - {"X2TNLConfigurationInfo-ExtIEs", extSpecRows(extIEsX2TNLConfigurationInfo)}, - {"E-RABModifyItemBearerModConfExtIEs", extSpecRows(extIEserabModifyItemBearerModConf)}, - } + typ reflect.Type } -var knownUntypedExtensions = map[string]string{ - "TraceActivation-ExtIEs/id-MDTConfiguration": "MDT-Configuration subtree (M1..M7, MDT-Activation, AreaScopeOfMDT); carries no UE id or user-plane TNL", - "TraceActivation-ExtIEs/id-UEAppLayerMeasConfig": "UEAppLayerMeasConfig subtree (QMC area scope); carries no UE id or user-plane TNL", +func extTable[M any](set string, table []ieSpec[M]) extTableCase { + return extTableCase{set: set, rows: extSpecRows(table), typ: reflect.TypeFor[M]()} } -func asn1Text(t *testing.T) string { - t.Helper() - - files, err := filepath.Glob("testdata/asn1/*.asn") - if err != nil || len(files) == 0 { - t.Fatalf("vendored ASN.1: %v", err) - } - - var b strings.Builder - - for _, f := range files { - raw, err := os.ReadFile(f) - if err != nil { - t.Fatal(err) - } - - b.WriteString(regexp.MustCompile(`--.*`).ReplaceAllString(string(raw), "")) - b.WriteString("\n") +func typedExtensionTables() []extTableCase { + return []extTableCase{ + extTable("Additional-GUTI-ExtIEs", extIEsAdditionalGUTI), + extTable("AllocationAndRetentionPriority-ExtIEs", extIEsAllocationAndRetentionPriority), + extTable("CGI-ExtIEs", extIEsCGI), + extTable("CNTypeRestrictions-Item-ExtIEs", extIEsCNTypeRestrictionsItem), + extTable("CancelledCellinEAI-Item-ExtIEs", extIEsCancelledCellInEAIItem), + extTable("CancelledCellinTAI-Item-ExtIEs", extIEsCancelledCellInTAIItem), + extTable("CellID-Broadcast-Item-ExtIEs", extIEsCellIDBroadcastItem), + extTable("CellID-Cancelled-Item-ExtIEs", extIEsCellIDCancelledItem), + extTable("CellType-ExtIEs", extIEsCellType), + extTable("CompletedCellinEAI-Item-ExtIEs", extIEsCompletedCellInEAIItem), + extTable("CompletedCellinTAI-Item-ExtIEs", extIEsCompletedCellInTAIItem), + extTable("ContextatSource-ExtIEs", extIEsContextatSource), + extTable("CriticalityDiagnostics-ExtIEs", extIEsCriticalityDiagnostics), + extTable("CriticalityDiagnostics-IE-Item-ExtIEs", extIEsCriticalityDiagnosticsIEItem), + extTable("DAPSRequestInfo-ExtIEs", extIEsDAPSRequestInfo), + extTable("ENBX2ExtTLA-ExtIEs", extIEsENBX2ExtTLA), + extTable("E-RABAdmittedItem-ExtIEs", extIEsERABAdmittedItem), + extTable("E-RABDataForwardingItem-ExtIEs", extIEsERABDataForwardingItem), + extTable("E-RABInformationListItem-ExtIEs", extIEsERABInformationListItem), + extTable("E-RABItem-ExtIEs", extIEsERABItem), + extTable("E-RABQoSParameters-ExtIEs", extIEsERABLevelQoSParameters), + extTable("E-RABModifyItemBearerModResExtIEs", extIEsERABModifyItemBearerModRes), + extTable("E-RABReleaseItemBearerRelCompExtIEs", extIEsERABReleaseItemBearerRelComp), + extTable("E-RABSetupItemCtxtSUResExtIEs", extIEsERABSetupItemCtxtSURes), + extTable("E-RABToBeModifiedItemBearerModInd-ExtIEs", extIEsERABToBeModifiedItemBearerModInd), + extTable("E-RABToBeModifyItemBearerModReqExtIEs", extIEsERABToBeModifiedItemBearerModReq), + extTable("E-RABToBeSetupItemBearerSUReqExtIEs", extIEsERABToBeSetupItemBearerSUReq), + extTable("E-RABToBeSetupItemCtxtSUReqExtIEs", extIEsERABToBeSetupItemCtxtSUReq), + extTable("E-RABToBeSetupItemHOReq-ExtIEs", extIEsERABToBeSetupItemHOReq), + extTable("E-RABToBeSwitchedDLItem-ExtIEs", extIEsERABToBeSwitchedDLItem), + extTable("E-RABToBeSwitchedULItem-ExtIEs", extIEsERABToBeSwitchedULItem), + extTable("EUTRAN-CGI-ExtIEs", extIEsEUTRANCGI), + extTable("EmergencyAreaID-Broadcast-Item-ExtIEs", extIEsEmergencyAreaIDBroadcastItem), + extTable("EmergencyAreaID-Cancelled-Item-ExtIEs", extIEsEmergencyAreaIDCancelledItem), + extTable("FiveGSTAI-ExtIEs", extIEsFiveGSTAI), + extTable("ForbiddenLAs-Item-ExtIEs", extIEsForbiddenLAsItem), + extTable("ForbiddenTAs-Item-ExtIEs", extIEsForbiddenTAsItem), + extTable("GBR-QosInformation-ExtIEs", extIEsGBRQosInformation), + extTable("GNB-ExtIEs", extIEsGNB), + extTable("GUMMEI-ExtIEs", extIEsGUMMEI), + extTable("GlobalENB-ID-ExtIEs", extIEsGlobalENBID), + extTable("Global-GNB-ID-ExtIEs", extIEsGlobalGNBID), + extTable("HandoverRestrictionList-ExtIEs", extIEsHandoverRestrictionList), + extTable("InterSystemMeasurementItem-ExtIEs", extIEsInterSystemMeasurementItem), + extTable("InterSystemMeasurementParameters-ExtIEs", extIEsInterSystemMeasurementParameters), + extTable("IntersystemMeasurementConfiguration-ExtIEs", extIEsIntersystemMeasurementConfiguration), + extTable("LAI-ExtIEs", extIEsLAI), + extTable("LTE-NTN-TAI-Information-ExtIEs", extIEsLTENTNTAIInformation), + extTable("LastVisitedEUTRANCellInformation-ExtIEs", extIEsLastVisitedEUTRANCellInformation), + extTable("LastVisitedPSCellInformation-ExtIEs", extIEsLastVisitedPSCellInformation), + extTable("ListeningSubframePattern-ExtIEs", extIEsListeningSubframePattern), + extTable("MutingPatternInformation-ExtIEs", extIEsMutingPatternInformation), + extTable("NR-CGI-ExtIEs", extIEsNRCGI), + extTable("ProSeAuthorized-ExtIEs", extIEsProSeAuthorized), + extTable("NG-eNB-ExtIEs", extIEsNgENB), + extTable("PSCellInformation-ExtIEs", extIEsPSCellInformation), + extTable("RAT-RestrictionsItem-ExtIEs", extIEsRATRestrictionsItem), + extTable("RLFReportInformation-ExtIEs", extIEsRLFReportInformation), + extTable("RequestType-ExtIEs", extIEsRequestType), + extTable("RequestedTNLInfo-ExtIEs", extIEsRequestedTNLInfo), + extTable("SONConfigurationTransfer-ExtIEs", extIEsSONConfigurationTransfer), + extTable("SONInformationReply-ExtIEs", extIEsSONInformationReply), + extTable("S-TMSI-ExtIEs", extIEsSTMSI), + extTable("SecurityContext-ExtIEs", extIEsSecurityContext), + extTable("SecurityIndication-ExtIEs", extIEsSecurityIndication), + extTable("ServedGUMMEIsItem-ExtIEs", extIEsServedGUMMEIsItem), + extTable("SourceNgRanNode-ID-ExtIEs", extIEsSourceNgRanNodeID), + extTable("SourceeNB-ID-ExtIEs", extIEsSourceeNBID), + extTable("SourceeNB-ToTargeteNB-TransparentContainer-ExtIEs", extIEsSourceeNBToTargeteNBTransparentContainer), + extTable("SupportedTAs-Item-ExtIEs", extIEsSupportedTAItem), + extTable("SynchronisationInformation-ExtIEs", extIEsSynchronisationInformation), + extTable("TAI-ExtIEs", extIEsTAI), + extTable("TAI-Broadcast-Item-ExtIEs", extIEsTAIBroadcastItem), + extTable("TAI-Cancelled-Item-ExtIEs", extIEsTAICancelledItem), + extTable("TAIItemExtIEs", extIEsTAIItem), + extTable("TargetNgRanNode-ID-ExtIEs", extIEsTargetNgRanNodeID), + extTable("TargetRNC-ID-ExtIEs", extIEsTargetRNCID), + extTable("TargeteNB-ID-ExtIEs", extIEsTargeteNBID), + extTable("TimeBasedHandoverInformation-ExtIEs", extIEsTimeBasedHandoverInformation), + extTable("TimeSynchronisationInfo-ExtIEs", extIEsTimeSynchronisationInfo), + extTable("TraceActivation-ExtIEs", extIEsTraceActivation), + extTable("Tunnel-Information-ExtIEs", extIEsTunnelInformation), + extTable("UEAggregate-MaximumBitrates-ExtIEs", extIEsUEAggregateMaximumBitRate), + extTable("UE-associatedLogicalS1-ConnectionItemExtIEs", extIEsUEAssociatedLogicalS1ConnectionItem), + extTable("UE-S1AP-ID-pair-ExtIEs", extIEsUES1APIDPair), + extTable("UESecurityCapabilities-ExtIEs", extIEsUESecurityCapabilities), + extTable("UserLocationInformation-ExtIEs", extIEsUserLocationInformation), + extTable("X2TNLConfigurationInfo-ExtIEs", extIEsX2TNLConfigurationInfo), + extTable("E-RABModifyItemBearerModConfExtIEs", extIEserabModifyItemBearerModConf), + extTable("InformationForCECapableUEs-ExtIEs", extIEsAssistanceDataForCECapableUEs), + extTable("AssistanceDataForPaging-ExtIEs", extIEsAssistanceDataForPaging), + extTable("AssistanceDataForRecommendedCells-ExtIEs", extIEsAssistanceDataForRecommendedCells), + extTable("CSG-IdList-Item-ExtIEs", extIEsCSGIdListItem), + extTable("CSGMembershipInfo-ExtIEs", extIEsCSGMembershipInfo), + extTable("CellIdentifierAndCELevelForCECapableUEs-ExtIEs", extIEsCellIdentifierAndCELevelForCECapableUEs), + extTable("ConnectedengNBItem-ExtIEs", extIEsConnectedengNBItem), + extTable("EN-DCSONConfigurationTransfer-ExtIEs", extIEsENDCSONConfigurationTransfer), + extTable("EN-DCSONeNBIdentification-ExtIEs", extIEsENDCSONeNBIdentification), + extTable("EN-DCSONengNBIdentification-ExtIEs", extIEsENDCSONengNBIdentification), + extTable("EN-DCTransferTypeReply-ExtIEs", extIEsENDCTransferTypeReply), + extTable("EN-DCTransferTypeRequest-ExtIEs", extIEsENDCTransferTypeRequest), + extTable("E-RABNotToBeModifiedItemBearerModInd-ExtIEs", extIEsERABNotToBeModifiedItemBearerModInd), + extTable("E-RABSetupItemBearerSUResExtIEs", extIEsERABSetupItemBearerSURes), + extTable("E-RABToBeUpdatedItem-ExtIEs", extIEsERABToBeUpdatedItem), + extTable("E-RABUsageReportItem-ExtIEs", extIEsERABUsageReportItem), + extTable("ExpectedUEActivityBehaviour-ExtIEs", extIEsExpectedUEActivityBehaviour), + extTable("ExpectedUEBehaviour-ExtIEs", extIEsExpectedUEBehaviour), + extTable("Global-en-gNB-ID-ExtIEs", extIEsGlobalengNBID), + extTable("InformationOnRecommendedCellsAndENBsForPaging-ExtIEs", extIEsInformationOnRecommendedCellsAndENBsForPaging), + extTable("NB-IoT-Paging-eDRXInformation-ExtIEs", extIEsNBIoTPagingeDRXInformation), + extTable("NRUESecurityCapabilities-ExtIEs", extIEsNRUESecurityCapabilities), + extTable("NRUESidelinkAggregateMaximumBitrate-ExtIEs", extIEsNRUESidelinkAggregateMaximumBitrate), + extTable("NRV2XServicesAuthorized-ExtIEs", extIEsNRV2XServicesAuthorized), + extTable("PC5FlowBitRates-ExtIEs", extIEsPC5FlowBitRates), + extTable("PC5QoSFlowItem-ExtIEs", extIEsPC5QoSFlowItem), + extTable("PC5QoSParameters-ExtIEs", extIEsPC5QoSParameters), + extTable("PagingAttemptInformation-ExtIEs", extIEsPagingAttemptInformation), + extTable("Paging-eDRXInformation-ExtIEs", extIEsPagingeDRXInformation), + extTable("RecommendedCellsForPagingItem-ExtIEs", extIEsRecommendedCellItem), + extTable("RecommendedCellsForPaging-ExtIEs", extIEsRecommendedCellsForPaging), + extTable("RecommendedENBItem-ExtIEs", extIEsRecommendedENBItem), + extTable("RecommendedENBsForPaging-ExtIEs", extIEsRecommendedENBsForPaging), + extTable("ScheduledCommunicationTime-ExtIEs", extIEsScheduledCommunicationTime), + extTable("SecondaryRATDataUsageReportItem-ExtIEs", extIEsSecondaryRATDataUsageReportItem), + extTable("ServedDCNsItem-ExtIEs", extIEsServedDCNsItem), + extTable("Subscription-Based-UE-DifferentiationInfo-ExtIEs", extIEsSubscriptionBasedUEDifferentiationInfo), + extTable("UE-Sidelink-Aggregate-MaximumBitrates-ExtIEs", extIEsUESidelinkAggregateMaximumBitrate), + extTable("V2XServicesAuthorized-ExtIEs", extIEsV2XServicesAuthorized), + extTable("WUS-Assistance-Information-ExtIEs", extIEsWUSAssistanceInformation), } +} - return b.String() +var knownUntypedExtensions = map[string]string{ + "TraceActivation-ExtIEs/id-MDTConfiguration": "MDT-Configuration subtree (M1..M7, MDT-Activation, AreaScopeOfMDT); carries no UE id or user-plane TNL", + "TraceActivation-ExtIEs/id-UEAppLayerMeasConfig": "UEAppLayerMeasConfig subtree (QMC area scope); carries no UE id or user-plane TNL", } type asn1ExtRow struct { @@ -176,36 +194,32 @@ type asn1ExtRow struct { func asn1ExtensionSets(t *testing.T) map[string][]asn1ExtRow { t.Helper() - text := asn1Text(t) - - ids := map[string]ProtocolIEID{} + s := vendoredSpec(t) + sets := map[string][]asn1ExtRow{} - for _, m := range regexp.MustCompile(`(id-[\w-]+)\s+ProtocolIE-ID\s*::=\s*(\d+)`).FindAllStringSubmatch(text, -1) { - v, err := strconv.Atoi(m[2]) - if err != nil { - t.Fatal(err) - } + for _, m := range s.Modules { + for _, sa := range m.ObjectSets { + if sa.Class != "S1AP-PROTOCOL-EXTENSION" { + continue + } - ids[m[1]] = ProtocolIEID(v) - } + objs, err := s.Objects(sa.Set) + if err != nil { + t.Fatal(err) + } - sets := map[string][]asn1ExtRow{} - setRe := regexp.MustCompile(`(?ms)^([A-Za-z][\w-]*)\s+S1AP-PROTOCOL-EXTENSION\s*::=\s*\{(.*?)^\}`) - rowRe := regexp.MustCompile(`ID\s+(id-[\w-]+)\s+CRITICALITY\s+(\w+)\s+EXTENSION\s+[\w-]+\s+PRESENCE\s+(\w+)`) + rows := []asn1ExtRow{} - for _, m := range setRe.FindAllStringSubmatch(text, -1) { - rows := []asn1ExtRow{} + for _, o := range objs { + idv, _ := o.Value("&id") + crit, _ := o.Value("&criticality") + pres, _ := o.Value("&presence") - for _, r := range rowRe.FindAllStringSubmatch(m[2], -1) { - id, ok := ids[r[1]] - if !ok { - t.Fatalf("%s: no ProtocolIE-ID for %s", m[1], r[1]) + rows = append(rows, asn1ExtRow{name: idv.Ref, id: asn1Row(t, o).ID, crit: crit.Ref, presence: pres.Ref}) } - rows = append(rows, asn1ExtRow{name: r[1], id: id, crit: r[2], presence: r[3]}) + sets[sa.Name] = rows } - - sets[m[1]] = rows } return sets @@ -276,3 +290,14 @@ func TestTypedExtensionsMatchTS36413(t *testing.T) { } } } + +func TestTypedExtensionTablesAreComplete(t *testing.T) { + cases := typedExtensionTables() + + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ + } + + checkComplete(t, "extension table", scannedDecls(t).extTables, types) +} diff --git a/s1ap/full_ie_set_test.go b/s1ap/full_ie_set_test.go new file mode 100644 index 0000000000..939597587a --- /dev/null +++ b/s1ap/full_ie_set_test.go @@ -0,0 +1,51 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "testing" +) + +func TestDownlinkNASTransportWithUERadioCapabilityIDParses(t *testing.T) { + in := &DownlinkNASTransport{ + MMEUES1APID: 1, + ENBUES1APID: 2, + NASPDU: NASPDU{0x07, 0x41}, + UERadioCapabilityID: &UERadioCapabilityID{0x0a, 0x0b}, + MaskedIMEISV: Ptr(MaskedIMEISV(0x0123456789abcdef)), + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + out, err := ParseDownlinkNASTransport(pdu.value()) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if !out.Equal(*in) { + t.Fatalf("decoded %+v, want %+v", out, in) + } + + if !out.Diagnostics().Empty() { + t.Fatalf("diagnostics = %v, want none", out.Diagnostics().IEs) + } + + re, err := out.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, b) { + t.Fatalf("re-encode = % x, want % x", re, b) + } +} diff --git a/s1ap/handover_notify.go b/s1ap/handover_notify.go index aa3d0e808c..a40c1d4a19 100644 --- a/s1ap/handover_notify.go +++ b/s1ap/handover_notify.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.5.7. @@ -14,6 +15,10 @@ type HandoverNotify struct { EUTRANCGI *EUTRANCGI TAI *TAI TunnelInformationForBBF *TunnelInformation + LHNID *LHNID + PSCellInformation *PSCellInformation + NotifySourceeNB *NotifySourceeNB + LTENTNTAIInformation *LTENTNTAIInformation messageMeta } @@ -82,6 +87,10 @@ var handoverNotifyIEs = []ieSpec[HandoverNotify]{ }, Encode: func(m *HandoverNotify) (per.Marshaler, bool) { return optionalIE(m.TunnelInformationForBBF) }, }, + apimpl.OptionalIE(IDLHNID, CriticalityIgnore, func(m *HandoverNotify) **LHNID { return &m.LHNID }), + apimpl.OptionalIE(IDPSCellInformation, CriticalityIgnore, func(m *HandoverNotify) **PSCellInformation { return &m.PSCellInformation }), + apimpl.OptionalIE(IDNotifySourceeNB, CriticalityIgnore, func(m *HandoverNotify) **NotifySourceeNB { return &m.NotifySourceeNB }), + apimpl.OptionalIE(IDLTENTNTAIInformation, CriticalityIgnore, func(m *HandoverNotify) **LTENTNTAIInformation { return &m.LTENTNTAIInformation }), } func (m *HandoverNotify) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/handover_preparation.go b/s1ap/handover_preparation.go index b93915b22b..9f57875c9f 100644 --- a/s1ap/handover_preparation.go +++ b/s1ap/handover_preparation.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.5.1. @@ -21,7 +22,14 @@ type HandoverRequired struct { // root value and carries "not available" as the IE's absence. DirectForwardingPathAvailability *DirectForwardingPathAvailability - SourceToTarget TransparentContainer + SourceToTarget TransparentContainer + SRVCCHOIndication *SRVCCHOIndication + SourceToTargetTransparentContainerSecondary *TransparentContainer + MSClassmark2 *MSClassmark2 + MSClassmark3 *MSClassmark3 + CSGId *CSGId + CellAccessMode *CellAccessMode + PSServiceNotAvailable *PSServiceNotAvailable messageMeta } @@ -97,6 +105,7 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ return m.DirectForwardingPathAvailability, true }, }, + apimpl.OptionalIE(IDSRVCCHOIndication, CriticalityReject, func(m *HandoverRequired) **SRVCCHOIndication { return &m.SRVCCHOIndication }), { ID: IDSourceToTargetTransparentContainer, Presence: presenceMandatory, Criticality: CriticalityReject, Decode: func(m *HandoverRequired, r *per.Reader, enc per.Encoding) error { @@ -110,6 +119,14 @@ var handoverRequiredIEs = []ieSpec[HandoverRequired]{ return &m.SourceToTarget, true }, }, + apimpl.OptionalIE(IDSourceToTargetTransparentContainerSecondary, CriticalityReject, func(m *HandoverRequired) **TransparentContainer { + return &m.SourceToTargetTransparentContainerSecondary + }), + apimpl.ConditionalIE(IDMSClassmark2, CriticalityReject, handoverRequiredSRVCCToGERAN, func(m *HandoverRequired) **MSClassmark2 { return &m.MSClassmark2 }), + apimpl.ConditionalIE(IDMSClassmark3, CriticalityIgnore, handoverRequiredSRVCCToGERAN, func(m *HandoverRequired) **MSClassmark3 { return &m.MSClassmark3 }), + apimpl.OptionalIE(IDCSGId, CriticalityReject, func(m *HandoverRequired) **CSGId { return &m.CSGId }), + apimpl.OptionalIE(IDCellAccessMode, CriticalityReject, func(m *HandoverRequired) **CellAccessMode { return &m.CellAccessMode }), + apimpl.OptionalIE(IDPSServiceNotAvailable, CriticalityIgnore, func(m *HandoverRequired) **PSServiceNotAvailable { return &m.PSServiceNotAvailable }), } func (m *HandoverRequired) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -142,16 +159,17 @@ func DecodeHandoverRequired(value []byte) (*HandoverRequired, error) { // TS 36.413 §9.1.5.2. The MME tells the source eNB that the target has // resources ready. TS 38.413 §9.2.3.2 carries the same shape; S1AP alone has a -// second target container for SRVCC, which is not modelled. +// second target container for SRVCC. type HandoverCommand struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - HandoverType HandoverType - NASSecurityParametersfromEUTRAN NASSecurityParametersfromEUTRAN - ERABSubjecttoDataForwarding ERABSubjecttoDataForwardingList - ERABToRelease []ERABItem - TargetToSource TransparentContainer - CriticalityDiagnostics *CriticalityDiagnostics + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + HandoverType HandoverType + NASSecurityParametersfromEUTRAN NASSecurityParametersfromEUTRAN + ERABSubjecttoDataForwarding ERABSubjecttoDataForwardingList + ERABToRelease []ERABItem + TargetToSource TransparentContainer + CriticalityDiagnostics *CriticalityDiagnostics + TargetToSourceTransparentContainerSecondary *TransparentContainer messageMeta } @@ -212,7 +230,7 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ return nil, false } - return containerList(maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore, m.ERABSubjecttoDataForwarding), true + return containerList(maxnoofERABs, IDERABDataForwardingItem, CriticalityIgnore, &m.ERABSubjecttoDataForwarding), true }, }, { @@ -229,7 +247,7 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToRelease), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABToRelease), true }, }, { @@ -245,6 +263,7 @@ var handoverCommandIEs = []ieSpec[HandoverCommand]{ return &m.TargetToSource, true }, }, + apimpl.OptionalIE(IDTargetToSourceTransparentContainerSecondary, CriticalityReject, func(m *HandoverCommand) **TransparentContainer { return &m.TargetToSourceTransparentContainerSecondary }), { ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *HandoverCommand, r *per.Reader, enc per.Encoding) error { @@ -420,3 +439,7 @@ func ParseHandoverPreparationFailure(value []byte) (*HandoverPreparationFailure, func DecodeHandoverPreparationFailure(value []byte) (*HandoverPreparationFailure, error) { return decodeMessageBody[HandoverPreparationFailure](ProcHandoverPreparation, handoverPreparationFailureIEs, value) } + +func handoverRequiredSRVCCToGERAN(m *HandoverRequired) bool { + return m.HandoverType == HandoverTypeLTEtoGERAN && m.SRVCCHOIndication != nil +} diff --git a/s1ap/handover_preparation_test.go b/s1ap/handover_preparation_test.go index 201034095d..05c3517b28 100644 --- a/s1ap/handover_preparation_test.go +++ b/s1ap/handover_preparation_test.go @@ -381,7 +381,7 @@ func TestHandoverRequestNASSecurityParametersCondition(t *testing.T) { HandoverType: ht, Cause: Ptr(CauseRadioNetworkUnspecified.Cause()), UEAMBR: UEAggregateMaximumBitRate{DL: 1000, UL: 1000}, - ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5}}, + ERABToBeSetup: []ERABToBeSetupItemHOReq{{ERABID: 5, TransportLayerAddress: goldTLA()}}, SourceToTarget: TransparentContainer{0x01}, UESecurityCapabilities: UESecurityCapabilities{EncryptionAlgorithms: SecurityAlgorithms{Value: 0x8000}}, } diff --git a/s1ap/handover_resource_allocation.go b/s1ap/handover_resource_allocation.go index 3bd37d38e6..9a2feff69c 100644 --- a/s1ap/handover_resource_allocation.go +++ b/s1ap/handover_resource_allocation.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.5.4. @@ -26,10 +27,34 @@ type HandoverRequest struct { SecurityContext SecurityContext // C-iffromUTRANGERAN: present exactly when Handover Type is UTRANtoLTE or // GERANtoLTE (§9.1.5.4). - NASSecurityParameterstoEUTRAN NASSecurityParameterstoEUTRAN - GUMMEI *GUMMEI - MMEUES1APID2 *MMEUES1APID - TimeRefDistribution *TimeRefDistribution + NASSecurityParameterstoEUTRAN NASSecurityParameterstoEUTRAN + GUMMEI *GUMMEI + MMEUES1APID2 *MMEUES1APID + TimeRefDistribution *TimeRefDistribution + RequestType *RequestType + SRVCCOperationPossible *SRVCCOperationPossible + CSGId *CSGId + CSGMembershipStatus *CSGMembershipStatus + ManagementBasedMDTAllowed *ManagementBasedMDTAllowed + ManagementBasedMDTPLMNList MDTPLMNList + MaskedIMEISV *MaskedIMEISV + ExpectedUEBehaviour *ExpectedUEBehaviour + ProSeAuthorized *ProSeAuthorized + UEUserPlaneCIoTSupportIndicator *UEUserPlaneCIoTSupportIndicator + V2XServicesAuthorized *V2XServicesAuthorized + UESidelinkAggregateMaximumBitrate *UESidelinkAggregateMaximumBitrate + EnhancedCoverageRestricted *EnhancedCoverageRestricted + NRUESecurityCapabilities *NRUESecurityCapabilities + CEModeBRestricted *CEModeBRestricted + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + PendingDataIndication *PendingDataIndication + SubscriptionBasedUEDifferentiationInfo *SubscriptionBasedUEDifferentiationInfo + AdditionalRRMPriorityIndex *AdditionalRRMPriorityIndex + IABAuthorized *IABAuthorized + NRV2XServicesAuthorized *NRV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + UERadioCapabilityID *UERadioCapabilityID messageMeta } @@ -93,7 +118,7 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return err }, Encode: func(m *HandoverRequest) (per.Marshaler, bool) { - return containerList(maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject, m.ERABToBeSetup), true + return containerList(maxnoofERABs, IDERABToBeSetupItemHOReq, CriticalityReject, &m.ERABToBeSetup), true }, }, { @@ -158,6 +183,8 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.TraceActivation, true }, }, + apimpl.OptionalIE(IDRequestType, CriticalityIgnore, func(m *HandoverRequest) **RequestType { return &m.RequestType }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *HandoverRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), { ID: IDSecurityContext, Presence: presenceMandatory, Criticality: CriticalityReject, Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { @@ -179,6 +206,8 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.NASSecurityParameterstoEUTRAN, true }, }, + apimpl.OptionalIE(IDCSGId, CriticalityReject, func(m *HandoverRequest) **CSGId { return &m.CSGId }), + apimpl.OptionalIE(IDCSGMembershipStatus, CriticalityIgnore, func(m *HandoverRequest) **CSGMembershipStatus { return &m.CSGMembershipStatus }), { ID: IDGUMMEI, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { @@ -221,6 +250,32 @@ var handoverRequestIEs = []ieSpec[HandoverRequest]{ return m.MMEUES1APID2, true }, }, + apimpl.OptionalIE(IDManagementBasedMDTAllowed, CriticalityIgnore, func(m *HandoverRequest) **ManagementBasedMDTAllowed { return &m.ManagementBasedMDTAllowed }), + apimpl.ListIE(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *HandoverRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + apimpl.OptionalIE(IDMaskedIMEISV, CriticalityIgnore, func(m *HandoverRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), + apimpl.OptionalIE(IDExpectedUEBehaviour, CriticalityIgnore, func(m *HandoverRequest) **ExpectedUEBehaviour { return &m.ExpectedUEBehaviour }), + apimpl.OptionalIE(IDProSeAuthorized, CriticalityIgnore, func(m *HandoverRequest) **ProSeAuthorized { return &m.ProSeAuthorized }), + apimpl.OptionalIE(IDUEUserPlaneCIoTSupportIndicator, CriticalityIgnore, func(m *HandoverRequest) **UEUserPlaneCIoTSupportIndicator { return &m.UEUserPlaneCIoTSupportIndicator }), + apimpl.OptionalIE(IDV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **V2XServicesAuthorized { return &m.V2XServicesAuthorized }), + apimpl.OptionalIE(IDUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **UESidelinkAggregateMaximumBitrate { + return &m.UESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDEnhancedCoverageRestricted, CriticalityIgnore, func(m *HandoverRequest) **EnhancedCoverageRestricted { return &m.EnhancedCoverageRestricted }), + apimpl.OptionalIE(IDNRUESecurityCapabilities, CriticalityIgnore, func(m *HandoverRequest) **NRUESecurityCapabilities { return &m.NRUESecurityCapabilities }), + apimpl.OptionalIE(IDCEModeBRestricted, CriticalityIgnore, func(m *HandoverRequest) **CEModeBRestricted { return &m.CEModeBRestricted }), + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *HandoverRequest) **AerialUEsubscriptionInformation { return &m.AerialUEsubscriptionInformation }), + apimpl.OptionalIE(IDPendingDataIndication, CriticalityIgnore, func(m *HandoverRequest) **PendingDataIndication { return &m.PendingDataIndication }), + apimpl.OptionalIE(IDSubscriptionBasedUEDifferentiationInfo, CriticalityIgnore, func(m *HandoverRequest) **SubscriptionBasedUEDifferentiationInfo { + return &m.SubscriptionBasedUEDifferentiationInfo + }), + apimpl.OptionalIE(IDAdditionalRRMPriorityIndex, CriticalityIgnore, func(m *HandoverRequest) **AdditionalRRMPriorityIndex { return &m.AdditionalRRMPriorityIndex }), + apimpl.OptionalIE(IDIABAuthorized, CriticalityReject, func(m *HandoverRequest) **IABAuthorized { return &m.IABAuthorized }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *HandoverRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *HandoverRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *HandoverRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *HandoverRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), { ID: IDTimeRefDistribution, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *HandoverRequest, r *per.Reader, enc per.Encoding) error { @@ -260,12 +315,15 @@ func DecodeHandoverRequest(value []byte) (*HandoverRequest, error) { // TS 36.413 §9.1.5.5. type HandoverRequestAcknowledge struct { - MMEUES1APID *MMEUES1APID - ENBUES1APID *ENBUES1APID - ERABAdmitted ERABAdmittedList - ERABFailedToSetup []ERABItem - TargetToSource TransparentContainer - CriticalityDiagnostics *CriticalityDiagnostics + MMEUES1APID *MMEUES1APID + ENBUES1APID *ENBUES1APID + ERABAdmitted ERABAdmittedList + ERABFailedToSetup []ERABItem + TargetToSource TransparentContainer + CriticalityDiagnostics *CriticalityDiagnostics + CSGId *CSGId + CellAccessMode *CellAccessMode + CEmodeBSupportIndicator *CEmodeBSupportIndicator messageMeta } @@ -327,7 +385,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil, false } - return containerList(maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore, m.ERABAdmitted), true + return containerList(maxnoofERABs, IDERABAdmittedItem, CriticalityIgnore, &m.ERABAdmitted), true }, }, { @@ -344,7 +402,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return nil, false } - return containerList(maxnoofERABs, IDERABFailedtoSetupItemHOReqAck, CriticalityIgnore, m.ERABFailedToSetup), true + return containerList(maxnoofERABs, IDERABFailedtoSetupItemHOReqAck, CriticalityIgnore, &m.ERABFailedToSetup), true }, }, { @@ -360,6 +418,7 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return &m.TargetToSource, true }, }, + apimpl.OptionalIE(IDCSGId, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **CSGId { return &m.CSGId }), { ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *HandoverRequestAcknowledge, r *per.Reader, enc per.Encoding) error { @@ -381,6 +440,8 @@ var handoverRequestAcknowledgeIEs = []ieSpec[HandoverRequestAcknowledge]{ return m.CriticalityDiagnostics, true }, }, + apimpl.OptionalIE(IDCellAccessMode, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **CellAccessMode { return &m.CellAccessMode }), + apimpl.OptionalIE(IDCEmodeBSupportIndicator, CriticalityIgnore, func(m *HandoverRequestAcknowledge) **CEmodeBSupportIndicator { return &m.CEmodeBSupportIndicator }), } func (m *HandoverRequestAcknowledge) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/handover_resource_allocation_test.go b/s1ap/handover_resource_allocation_test.go index 8fc6afa152..22f6218d59 100644 --- a/s1ap/handover_resource_allocation_test.go +++ b/s1ap/handover_resource_allocation_test.go @@ -55,7 +55,7 @@ func TestHandoverRequestRoundTrip(t *testing.T) { t.Fatalf("mme=%#x secctx=%+v", out.MMEUES1APID, out.SecurityContext) } - if out.UEAMBR != in.UEAMBR || out.UESecurityCapabilities != in.UESecurityCapabilities { + if !out.UEAMBR.Equal(in.UEAMBR) || out.UESecurityCapabilities != in.UESecurityCapabilities { t.Fatalf("ambr=%+v caps=%+v", out.UEAMBR, out.UESecurityCapabilities) } @@ -203,7 +203,7 @@ func TestHandoverRequestAcknowledgeFailedListItemID(t *testing.T) { b, err := (&HandoverRequestAcknowledge{ MMEUES1APID: Ptr(MMEUES1APID(1)), ENBUES1APID: Ptr(ENBUES1APID(2)), - ERABAdmitted: []ERABAdmittedItem{{ERABID: 0}}, + ERABAdmitted: []ERABAdmittedItem{{ERABID: 0, TransportLayerAddress: goldTLA()}}, ERABFailedToSetup: []ERABItem{{ERABID: 4, Cause: CauseRadioNetworkUnspecified.Cause()}}, TargetToSource: TransparentContainer{0x00}, }).Marshal() @@ -213,7 +213,7 @@ func TestHandoverRequestAcknowledgeFailedListItemID(t *testing.T) { // The outer id-E-RABFailedToSetupListHOReqAck (19) container holds one // single container keyed 0x0015 = 21. - const want = "200100310000050000400200010008400200020012400c000014400700100000000000001340080000154003080000007b00020100" + const want = "2001003500000500004002000100084002000200124010000014400b0001f00a00000100000000001340080000154003080000007b00020100" if got := hex.EncodeToString(b); got != want { t.Fatalf("encoded\n got %s\nwant %s", got, want) diff --git a/s1ap/ie_erab.go b/s1ap/ie_erab.go index 5c521b4fa0..74b594e096 100644 --- a/s1ap/ie_erab.go +++ b/s1ap/ie_erab.go @@ -160,10 +160,11 @@ type ERABSetupItemCtxtSURes struct { // ERABItem ::= SEQUENCE { e-RAB-ID, cause, iE-Extensions OPTIONAL } (extensible). type ERABItem struct { - extensions per.ExtensionAdditions `per:",extraw"` - ERABID ERABID - Cause Cause - iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + ERABID ERABID + Cause Cause + iEExtensions extensionMeta `per:",exttable"` + containerCrit `per:"-"` } type BearerType uint8 diff --git a/s1ap/ie_extension_types.go b/s1ap/ie_extension_types.go index adb5a94678..dfb89b5623 100644 --- a/s1ap/ie_extension_types.go +++ b/s1ap/ie_extension_types.go @@ -8,6 +8,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -441,9 +442,9 @@ type SONInformation struct { } type SONInformationExtension struct { - SONInformationReport *SONInformationReport `per:",choice:0,extie:IDSONInformationReport,crit:ignore"` - ChoiceExtension *SingleContainer `per:",choice:0,extie"` - choiceCriticality ap.WireCriticality `per:",choicecrit"` + SONInformationReport *SONInformationReport `per:",choice:0,extie:IDSONInformationReport,crit:ignore"` + ChoiceExtension *SingleContainer `per:",choice:0,extie"` + choiceCriticality apimpl.WireCriticality `per:",choicecrit"` } type SONInformationReport struct { diff --git a/s1ap/ie_ids.go b/s1ap/ie_ids.go index 42573ef196..b618ad63a5 100644 --- a/s1ap/ie_ids.go +++ b/s1ap/ie_ids.go @@ -5,193 +5,340 @@ package s1ap // ProtocolIE-ID values (TS 36.413 §9.3.6, S1AP-Constants). const ( - IDMMEUES1APID ProtocolIEID = 0 - IDHandoverType ProtocolIEID = 1 - IDCause ProtocolIEID = 2 - IDTargetID ProtocolIEID = 4 - IDENBUES1APID ProtocolIEID = 8 - IDERABSubjecttoDataForwardingList ProtocolIEID = 12 - IDERABtoReleaseListHOCmd ProtocolIEID = 13 - IDERABDataForwardingItem ProtocolIEID = 14 - IDERABReleaseItemBearerRelComp ProtocolIEID = 15 - IDERABToBeSetupListBearerSUReq ProtocolIEID = 16 - IDERABToBeSetupItemBearerSUReq ProtocolIEID = 17 - IDERABAdmittedList ProtocolIEID = 18 - IDERABFailedToSetupListHOReqAck ProtocolIEID = 19 - IDERABAdmittedItem ProtocolIEID = 20 - IDERABFailedtoSetupItemHOReqAck ProtocolIEID = 21 - IDERABToBeSwitchedDLList ProtocolIEID = 22 - IDERABToBeSwitchedDLItem ProtocolIEID = 23 - IDERABToBeSetupListCtxtSUReq ProtocolIEID = 24 - IDTraceActivation ProtocolIEID = 25 - IDNASPDU ProtocolIEID = 26 - IDERABToBeSetupItemHOReq ProtocolIEID = 27 - IDERABSetupListBearerSURes ProtocolIEID = 28 - IDERABFailedToSetupListBearerSURes ProtocolIEID = 29 - IDERABToBeModifiedListBearerModReq ProtocolIEID = 30 - IDERABModifyListBearerModRes ProtocolIEID = 31 - IDERABFailedToModifyList ProtocolIEID = 32 - IDERABToBeReleasedList ProtocolIEID = 33 - IDERABFailedToReleaseList ProtocolIEID = 34 - IDERABItem ProtocolIEID = 35 - IDERABToBeModifiedItemBearerModReq ProtocolIEID = 36 - IDERABModifyItemBearerModRes ProtocolIEID = 37 - IDERABSetupItemBearerSURes ProtocolIEID = 39 - IDSecurityContext ProtocolIEID = 40 - IDHandoverRestrictionList ProtocolIEID = 41 - IDUEPagingID ProtocolIEID = 43 - IDPagingDRX ProtocolIEID = 44 - IDTAIList ProtocolIEID = 46 - IDTAIItem ProtocolIEID = 47 - IDERABFailedToSetupListCtxtSURes ProtocolIEID = 48 - IDERABSetupItemCtxtSURes ProtocolIEID = 50 - IDERABSetupListCtxtSURes ProtocolIEID = 51 - IDERABToBeSetupItemCtxtSUReq ProtocolIEID = 52 - IDERABToBeSetupListHOReq ProtocolIEID = 53 - IDCriticalityDiagnostics ProtocolIEID = 58 - IDGlobalENBID ProtocolIEID = 59 - IDENBname ProtocolIEID = 60 - IDMMEname ProtocolIEID = 61 - IDSupportedTAs ProtocolIEID = 64 - IDTimeToWait ProtocolIEID = 65 - IDUEAggregateMaximumBitrate ProtocolIEID = 66 - IDTAI ProtocolIEID = 67 - IDERABReleaseListBearerRelComp ProtocolIEID = 69 - IDSecurityKey ProtocolIEID = 73 - IDUERadioCapability ProtocolIEID = 74 - IDGUMMEI ProtocolIEID = 75 - IDERABInformationListItem ProtocolIEID = 78 - IDDirectForwardingPathAvailability ProtocolIEID = 79 - IDUEIdentityIndexValue ProtocolIEID = 80 - IDEUTRANTraceID ProtocolIEID = 86 - IDRelativeMMECapacity ProtocolIEID = 87 - IDSourceMMEUES1APID ProtocolIEID = 88 - IDENBStatusTransferTransparentContainer ProtocolIEID = 90 - IDUEAssociatedLogicalS1ConnectionItem ProtocolIEID = 91 - IDResetType ProtocolIEID = 92 - IDUEAssociatedLogicalS1ConnectionListResAck ProtocolIEID = 93 - IDERABToBeSwitchedULItem ProtocolIEID = 94 - IDERABToBeSwitchedULList ProtocolIEID = 95 - IDSTMSI ProtocolIEID = 96 - IDRequestType ProtocolIEID = 98 - IDUES1APIDs ProtocolIEID = 99 - IDEUTRANCGI ProtocolIEID = 100 - IDOverloadResponse ProtocolIEID = 101 - IDSourceToTargetTransparentContainer ProtocolIEID = 104 - IDServedGUMMEIs ProtocolIEID = 105 - IDUESecurityCapabilities ProtocolIEID = 107 - IDCNDomain ProtocolIEID = 109 - IDERABReleasedList ProtocolIEID = 110 - IDMessageIdentifier ProtocolIEID = 111 - IDSerialNumber ProtocolIEID = 112 - IDWarningAreaList ProtocolIEID = 113 - IDRepetitionPeriod ProtocolIEID = 114 - IDNumberofBroadcastRequest ProtocolIEID = 115 - IDWarningType ProtocolIEID = 116 - IDWarningSecurityInfo ProtocolIEID = 117 - IDDataCodingScheme ProtocolIEID = 118 - IDWarningMessageContents ProtocolIEID = 119 - IDBroadcastCompletedAreaList ProtocolIEID = 120 - IDTargetToSourceTransparentContainer ProtocolIEID = 123 - IDSONConfigurationTransferECT ProtocolIEID = 129 - IDSONConfigurationTransferMCT ProtocolIEID = 130 - IDRRCEstablishmentCause ProtocolIEID = 134 - IDNASSecurityParametersfromEUTRAN ProtocolIEID = 135 - IDNASSecurityParameterstoEUTRAN ProtocolIEID = 136 - IDDefaultPagingDRX ProtocolIEID = 137 - IDBroadcastCancelledAreaList ProtocolIEID = 141 - IDConcurrentWarningMessageIndicator ProtocolIEID = 142 - IDDataForwardingNotPossible ProtocolIEID = 143 - IDExtendedRepetitionPeriod ProtocolIEID = 144 - IDLPPaPDU ProtocolIEID = 147 - IDRoutingID ProtocolIEID = 148 - IDPagingPriority ProtocolIEID = 151 - IDGUMMEIList ProtocolIEID = 154 - IDCorrelationID ProtocolIEID = 156 - IDSourceMMEGUMMEI ProtocolIEID = 157 - IDMMEUES1APID2 ProtocolIEID = 158 - IDTrafficLoadReductionIndication ProtocolIEID = 161 - IDGWContextReleaseIndication ProtocolIEID = 164 - IDECGIListForRestart ProtocolIEID = 182 - IDSIPTOCorrelationID ProtocolIEID = 183 - IDTransportInformation ProtocolIEID = 185 - IDTAIListForRestart ProtocolIEID = 188 - IDUserLocationInformation ProtocolIEID = 189 - IDEmergencyAreaIDListForRestart ProtocolIEID = 190 - IDKillAllWarningMessages ProtocolIEID = 191 - IDUERadioCapabilityForPaging ProtocolIEID = 198 - IDERABToBeModifiedListBearerModInd ProtocolIEID = 199 - IDERABToBeModifiedItemBearerModInd ProtocolIEID = 200 - IDERABNotToBeModifiedListBearerModInd ProtocolIEID = 201 - IDERABNotToBeModifiedItemBearerModInd ProtocolIEID = 202 - IDERABModifyListBearerModConf ProtocolIEID = 203 - IDERABModifyItemBearerModConf ProtocolIEID = 204 - IDERABFailedToModifyListBearerModConf ProtocolIEID = 205 - IDERABToBeReleasedListBearerModConf ProtocolIEID = 210 - IDPWSfailedECGIList ProtocolIEID = 222 - IDMMEGroupID ProtocolIEID = 223 - IDAdditionalGUTI ProtocolIEID = 224 - IDS1Message ProtocolIEID = 225 - IDUERetentionInformation ProtocolIEID = 228 - IDUEUsageType ProtocolIEID = 230 - IDBearerType ProtocolIEID = 233 - IDExtendedERABMaximumBitrateDL ProtocolIEID = 255 - IDExtendedERABMaximumBitrateUL ProtocolIEID = 256 - IDExtendedERABGuaranteedBitrateDL ProtocolIEID = 257 - IDExtendedERABGuaranteedBitrateUL ProtocolIEID = 258 - IDExtendedUEAggregateMaximumBitRateDL ProtocolIEID = 259 - IDExtendedUEAggregateMaximumBitRateUL ProtocolIEID = 260 - IDDownlinkPacketLossRate ProtocolIEID = 273 - IDUplinkPacketLossRate ProtocolIEID = 274 - IDWarningAreaCoordinates ProtocolIEID = 286 - IDEthernetType ProtocolIEID = 305 - IDSecurityIndication ProtocolIEID = 332 - IDGUMMEIType ProtocolIEID = 170 - IDNRrestrictioninEPSasSecondaryRAT ProtocolIEID = 261 - IDUnlicensedSpectrumRestriction ProtocolIEID = 270 - IDCNTypeRestrictions ProtocolIEID = 282 - IDNRrestrictionin5GS ProtocolIEID = 287 - IDLastNGRANPLMNIdentity ProtocolIEID = 290 - IDRATRestrictions ProtocolIEID = 336 - IDPSCellInformation ProtocolIEID = 288 - IDLTENTNTAIInformation ProtocolIEID = 339 - IDRequestTypeAdditionalInfo ProtocolIEID = 298 - IDDAPSRequestInfo ProtocolIEID = 317 - IDSourceTransportLayerAddress ProtocolIEID = 328 - IDSourceNodeTransportLayerAddress ProtocolIEID = 340 - IDTimeUEStayedInCellEnhancedGranularity ProtocolIEID = 167 - IDHOCause ProtocolIEID = 168 - IDLastVisitedPSCellList ProtocolIEID = 329 - IDMobilityInformation ProtocolIEID = 175 - IDUEHistoryInformationFromTheUE ProtocolIEID = 194 - IDIMSvoiceEPSfallbackfrom5G ProtocolIEID = 296 - IDAdditionalRRMPriorityIndex ProtocolIEID = 299 - IDContextatSource ProtocolIEID = 300 - IDIntersystemMeasurementConfiguration ProtocolIEID = 311 - IDSourceNodeID ProtocolIEID = 312 - IDEmergencyIndicator ProtocolIEID = 326 - IDUEContextReferenceatSourceeNB ProtocolIEID = 337 - IDSourceSNID ProtocolIEID = 343 - IDTimeBasedHandoverInformation ProtocolIEID = 350 - IDRATType ProtocolIEID = 232 - IDMDTConfigurationNR ProtocolIEID = 316 - IDTraceCollectionEntityURI ProtocolIEID = 325 - IDCoarseUELocationRequested ProtocolIEID = 353 - IDCoarseUELocation ProtocolIEID = 354 - IDTimeRefDistribution ProtocolIEID = 355 - IDRequestedTNLInfo ProtocolIEID = 356 - IDMDTConfiguration ProtocolIEID = 162 - IDUEAppLayerMeasConfig ProtocolIEID = 262 - IDX2TNLConfigurationInfo ProtocolIEID = 152 - IDSynchronisationInformation ProtocolIEID = 209 - IDSONInformationReport ProtocolIEID = 206 - IDNBIoTRLFReportContainer ProtocolIEID = 313 - IDTimeSynchronisationInfo ProtocolIEID = 149 - IDMutingPatternInformation ProtocolIEID = 208 - IDENBX2ExtendedTransportLayerAddresses ProtocolIEID = 153 - IDENBIndirectX2TransportLayerAddresses ProtocolIEID = 193 - IDMutingAvailabilityIndication ProtocolIEID = 207 - IDTunnelInformationForBBF ProtocolIEID = 176 - IDGWTransportLayerAddress ProtocolIEID = 155 - IDSIPTOLGWTransportLayerAddress ProtocolIEID = 184 + IDMMEUES1APID ProtocolIEID = 0 + IDHandoverType ProtocolIEID = 1 + IDCause ProtocolIEID = 2 + IDTargetID ProtocolIEID = 4 + IDENBUES1APID ProtocolIEID = 8 + IDERABSubjecttoDataForwardingList ProtocolIEID = 12 + IDERABtoReleaseListHOCmd ProtocolIEID = 13 + IDERABDataForwardingItem ProtocolIEID = 14 + IDERABReleaseItemBearerRelComp ProtocolIEID = 15 + IDERABToBeSetupListBearerSUReq ProtocolIEID = 16 + IDERABToBeSetupItemBearerSUReq ProtocolIEID = 17 + IDERABAdmittedList ProtocolIEID = 18 + IDERABFailedToSetupListHOReqAck ProtocolIEID = 19 + IDERABAdmittedItem ProtocolIEID = 20 + IDERABFailedtoSetupItemHOReqAck ProtocolIEID = 21 + IDERABToBeSwitchedDLList ProtocolIEID = 22 + IDERABToBeSwitchedDLItem ProtocolIEID = 23 + IDERABToBeSetupListCtxtSUReq ProtocolIEID = 24 + IDTraceActivation ProtocolIEID = 25 + IDNASPDU ProtocolIEID = 26 + IDERABToBeSetupItemHOReq ProtocolIEID = 27 + IDERABSetupListBearerSURes ProtocolIEID = 28 + IDERABFailedToSetupListBearerSURes ProtocolIEID = 29 + IDERABToBeModifiedListBearerModReq ProtocolIEID = 30 + IDERABModifyListBearerModRes ProtocolIEID = 31 + IDERABFailedToModifyList ProtocolIEID = 32 + IDERABToBeReleasedList ProtocolIEID = 33 + IDERABFailedToReleaseList ProtocolIEID = 34 + IDERABItem ProtocolIEID = 35 + IDERABToBeModifiedItemBearerModReq ProtocolIEID = 36 + IDERABModifyItemBearerModRes ProtocolIEID = 37 + IDERABSetupItemBearerSURes ProtocolIEID = 39 + IDSecurityContext ProtocolIEID = 40 + IDHandoverRestrictionList ProtocolIEID = 41 + IDUEPagingID ProtocolIEID = 43 + IDPagingDRX ProtocolIEID = 44 + IDTAIList ProtocolIEID = 46 + IDTAIItem ProtocolIEID = 47 + IDERABFailedToSetupListCtxtSURes ProtocolIEID = 48 + IDERABSetupItemCtxtSURes ProtocolIEID = 50 + IDERABSetupListCtxtSURes ProtocolIEID = 51 + IDERABToBeSetupItemCtxtSUReq ProtocolIEID = 52 + IDERABToBeSetupListHOReq ProtocolIEID = 53 + IDCriticalityDiagnostics ProtocolIEID = 58 + IDGlobalENBID ProtocolIEID = 59 + IDENBname ProtocolIEID = 60 + IDMMEname ProtocolIEID = 61 + IDSupportedTAs ProtocolIEID = 64 + IDTimeToWait ProtocolIEID = 65 + IDUEAggregateMaximumBitrate ProtocolIEID = 66 + IDTAI ProtocolIEID = 67 + IDERABReleaseListBearerRelComp ProtocolIEID = 69 + IDSecurityKey ProtocolIEID = 73 + IDUERadioCapability ProtocolIEID = 74 + IDGUMMEI ProtocolIEID = 75 + IDERABInformationListItem ProtocolIEID = 78 + IDDirectForwardingPathAvailability ProtocolIEID = 79 + IDUEIdentityIndexValue ProtocolIEID = 80 + IDEUTRANTraceID ProtocolIEID = 86 + IDRelativeMMECapacity ProtocolIEID = 87 + IDSourceMMEUES1APID ProtocolIEID = 88 + IDENBStatusTransferTransparentContainer ProtocolIEID = 90 + IDUEAssociatedLogicalS1ConnectionItem ProtocolIEID = 91 + IDResetType ProtocolIEID = 92 + IDUEAssociatedLogicalS1ConnectionListResAck ProtocolIEID = 93 + IDERABToBeSwitchedULItem ProtocolIEID = 94 + IDERABToBeSwitchedULList ProtocolIEID = 95 + IDSTMSI ProtocolIEID = 96 + IDRequestType ProtocolIEID = 98 + IDUES1APIDs ProtocolIEID = 99 + IDEUTRANCGI ProtocolIEID = 100 + IDOverloadResponse ProtocolIEID = 101 + IDSourceToTargetTransparentContainer ProtocolIEID = 104 + IDServedGUMMEIs ProtocolIEID = 105 + IDUESecurityCapabilities ProtocolIEID = 107 + IDCNDomain ProtocolIEID = 109 + IDERABReleasedList ProtocolIEID = 110 + IDMessageIdentifier ProtocolIEID = 111 + IDSerialNumber ProtocolIEID = 112 + IDWarningAreaList ProtocolIEID = 113 + IDRepetitionPeriod ProtocolIEID = 114 + IDNumberofBroadcastRequest ProtocolIEID = 115 + IDWarningType ProtocolIEID = 116 + IDWarningSecurityInfo ProtocolIEID = 117 + IDDataCodingScheme ProtocolIEID = 118 + IDWarningMessageContents ProtocolIEID = 119 + IDBroadcastCompletedAreaList ProtocolIEID = 120 + IDTargetToSourceTransparentContainer ProtocolIEID = 123 + IDSONConfigurationTransferECT ProtocolIEID = 129 + IDSONConfigurationTransferMCT ProtocolIEID = 130 + IDRRCEstablishmentCause ProtocolIEID = 134 + IDNASSecurityParametersfromEUTRAN ProtocolIEID = 135 + IDNASSecurityParameterstoEUTRAN ProtocolIEID = 136 + IDDefaultPagingDRX ProtocolIEID = 137 + IDBroadcastCancelledAreaList ProtocolIEID = 141 + IDConcurrentWarningMessageIndicator ProtocolIEID = 142 + IDDataForwardingNotPossible ProtocolIEID = 143 + IDExtendedRepetitionPeriod ProtocolIEID = 144 + IDLPPaPDU ProtocolIEID = 147 + IDRoutingID ProtocolIEID = 148 + IDPagingPriority ProtocolIEID = 151 + IDGUMMEIList ProtocolIEID = 154 + IDCorrelationID ProtocolIEID = 156 + IDSourceMMEGUMMEI ProtocolIEID = 157 + IDMMEUES1APID2 ProtocolIEID = 158 + IDTrafficLoadReductionIndication ProtocolIEID = 161 + IDGWContextReleaseIndication ProtocolIEID = 164 + IDECGIListForRestart ProtocolIEID = 182 + IDSIPTOCorrelationID ProtocolIEID = 183 + IDTransportInformation ProtocolIEID = 185 + IDTAIListForRestart ProtocolIEID = 188 + IDUserLocationInformation ProtocolIEID = 189 + IDEmergencyAreaIDListForRestart ProtocolIEID = 190 + IDKillAllWarningMessages ProtocolIEID = 191 + IDUERadioCapabilityForPaging ProtocolIEID = 198 + IDERABToBeModifiedListBearerModInd ProtocolIEID = 199 + IDERABToBeModifiedItemBearerModInd ProtocolIEID = 200 + IDERABNotToBeModifiedListBearerModInd ProtocolIEID = 201 + IDERABNotToBeModifiedItemBearerModInd ProtocolIEID = 202 + IDERABModifyListBearerModConf ProtocolIEID = 203 + IDERABModifyItemBearerModConf ProtocolIEID = 204 + IDERABFailedToModifyListBearerModConf ProtocolIEID = 205 + IDERABToBeReleasedListBearerModConf ProtocolIEID = 210 + IDPWSfailedECGIList ProtocolIEID = 222 + IDMMEGroupID ProtocolIEID = 223 + IDAdditionalGUTI ProtocolIEID = 224 + IDS1Message ProtocolIEID = 225 + IDUERetentionInformation ProtocolIEID = 228 + IDUEUsageType ProtocolIEID = 230 + IDBearerType ProtocolIEID = 233 + IDExtendedERABMaximumBitrateDL ProtocolIEID = 255 + IDExtendedERABMaximumBitrateUL ProtocolIEID = 256 + IDExtendedERABGuaranteedBitrateDL ProtocolIEID = 257 + IDExtendedERABGuaranteedBitrateUL ProtocolIEID = 258 + IDExtendedUEAggregateMaximumBitRateDL ProtocolIEID = 259 + IDExtendedUEAggregateMaximumBitRateUL ProtocolIEID = 260 + IDDownlinkPacketLossRate ProtocolIEID = 273 + IDUplinkPacketLossRate ProtocolIEID = 274 + IDWarningAreaCoordinates ProtocolIEID = 286 + IDEthernetType ProtocolIEID = 305 + IDSecurityIndication ProtocolIEID = 332 + IDGUMMEIType ProtocolIEID = 170 + IDNRrestrictioninEPSasSecondaryRAT ProtocolIEID = 261 + IDUnlicensedSpectrumRestriction ProtocolIEID = 270 + IDCNTypeRestrictions ProtocolIEID = 282 + IDNRrestrictionin5GS ProtocolIEID = 287 + IDLastNGRANPLMNIdentity ProtocolIEID = 290 + IDRATRestrictions ProtocolIEID = 336 + IDPSCellInformation ProtocolIEID = 288 + IDLTENTNTAIInformation ProtocolIEID = 339 + IDRequestTypeAdditionalInfo ProtocolIEID = 298 + IDDAPSRequestInfo ProtocolIEID = 317 + IDSourceTransportLayerAddress ProtocolIEID = 328 + IDSourceNodeTransportLayerAddress ProtocolIEID = 340 + IDTimeUEStayedInCellEnhancedGranularity ProtocolIEID = 167 + IDHOCause ProtocolIEID = 168 + IDLastVisitedPSCellList ProtocolIEID = 329 + IDMobilityInformation ProtocolIEID = 175 + IDUEHistoryInformationFromTheUE ProtocolIEID = 194 + IDIMSvoiceEPSfallbackfrom5G ProtocolIEID = 296 + IDAdditionalRRMPriorityIndex ProtocolIEID = 299 + IDContextatSource ProtocolIEID = 300 + IDIntersystemMeasurementConfiguration ProtocolIEID = 311 + IDSourceNodeID ProtocolIEID = 312 + IDEmergencyIndicator ProtocolIEID = 326 + IDUEContextReferenceatSourceeNB ProtocolIEID = 337 + IDSourceSNID ProtocolIEID = 343 + IDTimeBasedHandoverInformation ProtocolIEID = 350 + IDRATType ProtocolIEID = 232 + IDMDTConfigurationNR ProtocolIEID = 316 + IDTraceCollectionEntityURI ProtocolIEID = 325 + IDCoarseUELocationRequested ProtocolIEID = 353 + IDCoarseUELocation ProtocolIEID = 354 + IDTimeRefDistribution ProtocolIEID = 355 + IDRequestedTNLInfo ProtocolIEID = 356 + IDMDTConfiguration ProtocolIEID = 162 + IDUEAppLayerMeasConfig ProtocolIEID = 262 + IDX2TNLConfigurationInfo ProtocolIEID = 152 + IDSynchronisationInformation ProtocolIEID = 209 + IDSONInformationReport ProtocolIEID = 206 + IDNBIoTRLFReportContainer ProtocolIEID = 313 + IDTimeSynchronisationInfo ProtocolIEID = 149 + IDMutingPatternInformation ProtocolIEID = 208 + IDENBX2ExtendedTransportLayerAddresses ProtocolIEID = 153 + IDENBIndirectX2TransportLayerAddresses ProtocolIEID = 193 + IDMutingAvailabilityIndication ProtocolIEID = 207 + IDTunnelInformationForBBF ProtocolIEID = 176 + IDGWTransportLayerAddress ProtocolIEID = 155 + IDSIPTOLGWTransportLayerAddress ProtocolIEID = 184 + IDSourceID ProtocolIEID = 3 + IDERABReleaseItem ProtocolIEID = 38 + IDERABReleaseItemHOCmd ProtocolIEID = 49 + IDGERANtoLTEHOInformationRes ProtocolIEID = 55 + IDUTRANtoLTEHOInformationRes ProtocolIEID = 57 + IDServedPLMNs ProtocolIEID = 63 + IDCdma2000PDU ProtocolIEID = 70 + IDCdma2000RATType ProtocolIEID = 71 + IDCdma2000SectorID ProtocolIEID = 72 + IDCdma2000HOStatus ProtocolIEID = 83 + IDCdma2000HORequiredIndication ProtocolIEID = 84 + IDBearersSubjectToStatusTransferItem ProtocolIEID = 89 + IDCdma2000OneXRAND ProtocolIEID = 97 + IDCdma2000OneXSRVCCInfo ProtocolIEID = 102 + IDERABFailedToBeReleasedList ProtocolIEID = 103 + IDSubscriberProfileIDforRFP ProtocolIEID = 106 + IDCSFallbackIndicator ProtocolIEID = 108 + IDInterSystemInformationTransferTypeEDT ProtocolIEID = 121 + IDInterSystemInformationTransferTypeMDT ProtocolIEID = 122 + IDSRVCCOperationPossible ProtocolIEID = 124 + IDSRVCCHOIndication ProtocolIEID = 125 + IDNASDownlinkCount ProtocolIEID = 126 + IDCSGId ProtocolIEID = 127 + IDCSGIdList ProtocolIEID = 128 + IDTraceCollectionEntityIPAddress ProtocolIEID = 131 + IDMSClassmark2 ProtocolIEID = 132 + IDMSClassmark3 ProtocolIEID = 133 + IDSourceToTargetTransparentContainerSecondary ProtocolIEID = 138 + IDTargetToSourceTransparentContainerSecondary ProtocolIEID = 139 + IDEUTRANRoundTripDelayEstimationInfo ProtocolIEID = 140 + IDCellAccessMode ProtocolIEID = 145 + IDCSGMembershipStatus ProtocolIEID = 146 + IDPSServiceNotAvailable ProtocolIEID = 150 + IDRegisteredLAI ProtocolIEID = 159 + IDRelayNodeIndicator ProtocolIEID = 160 + IDMMERelaySupportIndicator ProtocolIEID = 163 + IDManagementBasedMDTAllowed ProtocolIEID = 165 + IDPrivacyIndicator ProtocolIEID = 166 + IDVoiceSupportMatchIndicator ProtocolIEID = 169 + IDM3Configuration ProtocolIEID = 171 + IDM4Configuration ProtocolIEID = 172 + IDM5Configuration ProtocolIEID = 173 + IDMDTLocationInfo ProtocolIEID = 174 + IDManagementBasedMDTPLMNList ProtocolIEID = 177 + IDSignallingBasedMDTPLMNList ProtocolIEID = 178 + IDULCOUNTValueExtended ProtocolIEID = 179 + IDDLCOUNTValueExtended ProtocolIEID = 180 + IDReceiveStatusOfULPDCPSDUsExtended ProtocolIEID = 181 + IDLHNID ProtocolIEID = 186 + IDAdditionalCSFallbackIndicator ProtocolIEID = 187 + IDMaskedIMEISV ProtocolIEID = 192 + IDProSeAuthorized ProtocolIEID = 195 + IDExpectedUEBehaviour ProtocolIEID = 196 + IDLoggedMBSFNMDT ProtocolIEID = 197 + IDAssistanceDataForPaging ProtocolIEID = 211 + IDCellIdentifierAndCELevelForCECapableUEs ProtocolIEID = 212 + IDInformationOnRecommendedCellsAndENBsForPaging ProtocolIEID = 213 + IDRecommendedCellItem ProtocolIEID = 214 + IDRecommendedENBItem ProtocolIEID = 215 + IDProSeUEtoNetworkRelaying ProtocolIEID = 216 + IDULCOUNTValuePDCPSNlength18 ProtocolIEID = 217 + IDDLCOUNTValuePDCPSNlength18 ProtocolIEID = 218 + IDReceiveStatusOfULPDCPSDUsPDCPSNlength18 ProtocolIEID = 219 + IDM6Configuration ProtocolIEID = 220 + IDM7Configuration ProtocolIEID = 221 + IDCSGMembershipInfo ProtocolIEID = 226 + IDPagingeDRXInformation ProtocolIEID = 227 + IDExtendedUEIdentityIndexValue ProtocolIEID = 231 + IDNBIoTDefaultPagingDRX ProtocolIEID = 234 + IDERABFailedToResumeListResumeReq ProtocolIEID = 235 + IDERABFailedToResumeItemResumeReq ProtocolIEID = 236 + IDERABFailedToResumeListResumeRes ProtocolIEID = 237 + IDERABFailedToResumeItemResumeRes ProtocolIEID = 238 + IDNBIoTPagingeDRXInformation ProtocolIEID = 239 + IDV2XServicesAuthorized ProtocolIEID = 240 + IDUEUserPlaneCIoTSupportIndicator ProtocolIEID = 241 + IDCEmodeBSupportIndicator ProtocolIEID = 242 + IDSRVCCOperationNotPossible ProtocolIEID = 243 + IDNBIoTUEIdentityIndexValue ProtocolIEID = 244 + IDRRCResumeCause ProtocolIEID = 245 + IDDCNID ProtocolIEID = 246 + IDServedDCNs ProtocolIEID = 247 + IDUESidelinkAggregateMaximumBitrate ProtocolIEID = 248 + IDDLNASPDUDeliveryAckRequest ProtocolIEID = 249 + IDCoverageLevel ProtocolIEID = 250 + IDEnhancedCoverageRestricted ProtocolIEID = 251 + IDUELevelQoSParameters ProtocolIEID = 252 + IDDLCPSecurityInformation ProtocolIEID = 253 + IDULCPSecurityInformation ProtocolIEID = 254 + IDUEApplicationLayerMeasurementCapability ProtocolIEID = 263 + IDSecondaryRATDataUsageReportList ProtocolIEID = 264 + IDSecondaryRATDataUsageReportItem ProtocolIEID = 265 + IDHandoverFlag ProtocolIEID = 266 + IDERABUsageReportItem ProtocolIEID = 267 + IDSecondaryRATDataUsageRequest ProtocolIEID = 268 + IDNRUESecurityCapabilities ProtocolIEID = 269 + IDCEModeBRestricted ProtocolIEID = 271 + IDLTEMIndication ProtocolIEID = 272 + IDUECapabilityInfoRequest ProtocolIEID = 275 + IDServiceType ProtocolIEID = 276 + IDAerialUEsubscriptionInformation ProtocolIEID = 277 + IDSubscriptionBasedUEDifferentiationInfo ProtocolIEID = 278 + IDEndIndication ProtocolIEID = 280 + IDEDTSession ProtocolIEID = 281 + IDPendingDataIndication ProtocolIEID = 283 + IDBluetoothMeasurementConfiguration ProtocolIEID = 284 + IDWLANMeasurementConfiguration ProtocolIEID = 285 + IDConnectedengNBList ProtocolIEID = 291 + IDConnectedengNBToAddList ProtocolIEID = 292 + IDConnectedengNBToRemoveList ProtocolIEID = 293 + IDENDCSONConfigurationTransferECT ProtocolIEID = 294 + IDENDCSONConfigurationTransferMCT ProtocolIEID = 295 + IDTimeSinceSecondaryNodeRelease ProtocolIEID = 297 + IDIABAuthorized ProtocolIEID = 301 + IDIABNodeIndication ProtocolIEID = 302 + IDIABSupported ProtocolIEID = 303 + IDDataSize ProtocolIEID = 304 + IDNRV2XServicesAuthorized ProtocolIEID = 306 + IDNRUESidelinkAggregateMaximumBitrate ProtocolIEID = 307 + IDPC5QoSParameters ProtocolIEID = 308 + IDIntersystemSONConfigurationTransferMCT ProtocolIEID = 309 + IDIntersystemSONConfigurationTransferECT ProtocolIEID = 310 + IDUERadioCapabilityID ProtocolIEID = 314 + IDUERadioCapabilityNRFormat ProtocolIEID = 315 + IDDAPSResponseInfoList ProtocolIEID = 318 + IDDAPSResponseInfoItem ProtocolIEID = 319 + IDNotifySourceeNB ProtocolIEID = 320 + IDENBEarlyStatusTransferTransparentContainer ProtocolIEID = 321 + IDBearersSubjectToEarlyStatusTransferItem ProtocolIEID = 322 + IDWUSAssistanceInformation ProtocolIEID = 323 + IDNBIoTPagingDRX ProtocolIEID = 324 + IDUERadioCapabilityForPagingNRFormat ProtocolIEID = 327 + IDRACSIndication ProtocolIEID = 330 + IDPagingCause ProtocolIEID = 331 + IDSecurityResult ProtocolIEID = 333 + IDERABSecurityResultItem ProtocolIEID = 334 + IDERABSecurityResultList ProtocolIEID = 335 + IDERABToBeUpdatedList ProtocolIEID = 341 + IDERABToBeUpdatedItem ProtocolIEID = 342 + IDLoggedMDTTrigger ProtocolIEID = 344 + IDSensorMeasurementConfiguration ProtocolIEID = 345 + IDM4ReportAmount ProtocolIEID = 346 + IDM5ReportAmount ProtocolIEID = 347 + IDM6ReportAmount ProtocolIEID = 348 + IDM7ReportAmount ProtocolIEID = 349 + IDBearersSubjectToDLDiscardingItem ProtocolIEID = 351 + IDBearersSubjectToDLDiscardingList ProtocolIEID = 352 ) diff --git a/s1ap/ie_message_types.go b/s1ap/ie_message_types.go new file mode 100644 index 0000000000..d108bc87ef --- /dev/null +++ b/s1ap/ie_message_types.go @@ -0,0 +1,1463 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" +) + +const ( + maxnoofCSGs = 256 + maxnoofConnectedengNBs = 256 + maxnoofDCNs = 32 + maxnoofMDTPLMNs = 16 + maxnoofPC5QoSFlows = 2048 + maxnoofRecommendedCells = 16 + maxnoofRecommendedENBs = 16 + maxnooftimeperiods = 2 +) + +type AdditionalCSFallbackIndicator uint8 + +const ( + AdditionalCSFallbackIndicatorNoRestriction AdditionalCSFallbackIndicator = iota + AdditionalCSFallbackIndicatorRestriction +) + +type AerialUEsubscriptionInformation uint8 + +const ( + AerialUEsubscriptionInformationAllowed AerialUEsubscriptionInformation = iota + AerialUEsubscriptionInformationNotAllowed +) + +type AssistanceDataForPaging struct { + AssistanceDataForRecommendedCells *AssistanceDataForRecommendedCells `per:",optional"` + AssistanceDataForCECapableUEs *AssistanceDataForCECapableUEs `per:",optional"` + PagingAttemptInformation *PagingAttemptInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CEModeBRestricted uint8 + +const ( + CEModeBRestrictedRestricted CEModeBRestricted = iota + CEModeBRestrictedNotRestricted +) + +type CEmodeBSupportIndicator uint8 + +const ( + CEmodeBSupportIndicatorSupported CEmodeBSupportIndicator = iota +) + +type CSFallbackIndicator uint8 + +const ( + CSFallbackIndicatorCSFallbackRequired CSFallbackIndicator = iota + CSFallbackIndicatorCSFallbackHighPriority +) + +type CSGId uint32 + +func (v CSGId) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 27) +} + +func (v *CSGId) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 27) + if err != nil { + return err + } + + *v = CSGId(n) + + return nil +} + +type CSGIdList []CSGIdListItem + +func (l CSGIdList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofCSGs, []CSGIdListItem(l)) +} + +func (l *CSGIdList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[CSGIdListItem](r, enc, 1, maxnoofCSGs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type CSGMembershipInfo struct { + CSGMembershipStatus CSGMembershipStatus + CSGId CSGId + CellAccessMode *CellAccessMode `per:",optional"` + PLMNidentity *PLMNIdentity `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CSGMembershipStatus uint8 + +const ( + CSGMembershipStatusMember CSGMembershipStatus = iota + CSGMembershipStatusNotMember +) + +type CellAccessMode uint8 + +const ( + CellAccessModeHybrid CellAccessMode = iota +) + +type CellIdentifierAndCELevelForCECapableUEs struct { + GlobalCellID EUTRANCGI + CELevel CELevel + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ConnectedengNBList []ConnectedengNBItem + +func (l ConnectedengNBList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofConnectedengNBs, []ConnectedengNBItem(l)) +} + +func (l *ConnectedengNBList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ConnectedengNBItem](r, enc, 1, maxnoofConnectedengNBs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type CoverageLevel uint8 + +const ( + CoverageLevelExtendedcoverage CoverageLevel = iota +) + +type DCNID uint16 + +func (v DCNID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(v)) +} + +func (v *DCNID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + + *v = DCNID(n) + + return nil +} + +type DLNASPDUDeliveryAckRequest uint8 + +const ( + DLNASPDUDeliveryAckRequestRequested DLNASPDUDeliveryAckRequest = iota +) + +type DataSize int64 + +func (v DataSize) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 4095, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *DataSize) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 4095, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = DataSize(n) + + return nil +} + +type ERABToBeUpdatedList []ERABToBeUpdatedItem + +func (l ERABToBeUpdatedList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDERABToBeUpdatedItem, CriticalityIgnore, l) +} + +func (l *ERABToBeUpdatedList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABToBeUpdatedItem](r, enc, maxnoofERABs, IDERABToBeUpdatedItem, CriticalityIgnore) + *l = items + + return err +} + +type EDTSession uint8 + +const ( + EDTSessionTrue EDTSession = iota +) + +type ENDCSONConfigurationTransfer struct { + Transfertype ENDCSONTransferType + SONInformation SONInformation + X2TNLConfigInfo *X2TNLConfigurationInfo `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type EndIndication uint8 + +const ( + EndIndicationNoFurtherData EndIndication = iota + EndIndicationFurtherDataExists +) + +type EnhancedCoverageRestricted uint8 + +const ( + EnhancedCoverageRestrictedRestricted EnhancedCoverageRestricted = iota +) + +type ExpectedUEBehaviour struct { + ExpectedActivity *ExpectedUEActivityBehaviour `per:",optional"` + ExpectedHOInterval *ExpectedHOInterval `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExtendedUEIdentityIndexValue uint16 + +func (v ExtendedUEIdentityIndexValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 14) +} + +func (v *ExtendedUEIdentityIndexValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 14) + if err != nil { + return err + } + + *v = ExtendedUEIdentityIndexValue(n) + + return nil +} + +type IABAuthorized uint8 + +const ( + IABAuthorizedAuthorized IABAuthorized = iota + IABAuthorizedNotAuthorized +) + +type IABNodeIndication uint8 + +const ( + IABNodeIndicationTrue IABNodeIndication = iota +) + +type IABSupported uint8 + +const ( + IABSupportedTrue IABSupported = iota +) + +type InformationOnRecommendedCellsAndENBsForPaging struct { + RecommendedCellsForPaging RecommendedCellsForPaging + RecommendENBsForPaging RecommendedENBsForPaging + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type IntersystemSONConfigurationTransfer []byte + +func (v IntersystemSONConfigurationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *IntersystemSONConfigurationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type LHNID []byte + +func (v LHNID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 32, 256, true, true, false, v) +} + +func (v *LHNID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 32, 256, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type LTEMIndication uint8 + +const ( + LTEMIndicationLTEM LTEMIndication = iota +) + +type MDTPLMNList []PLMNIdentity + +func (l MDTPLMNList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofMDTPLMNs, []PLMNIdentity(l)) +} + +func (l *MDTPLMNList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PLMNIdentity](r, enc, 1, maxnoofMDTPLMNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type MMERelaySupportIndicator uint8 + +const ( + MMERelaySupportIndicatorTrue MMERelaySupportIndicator = iota +) + +type MSClassmark2 []byte + +func (v MSClassmark2) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *MSClassmark2) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type MSClassmark3 []byte + +func (v MSClassmark3) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *MSClassmark3) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type ManagementBasedMDTAllowed uint8 + +const ( + ManagementBasedMDTAllowedAllowed ManagementBasedMDTAllowed = iota +) + +type MaskedIMEISV uint64 + +func (v MaskedIMEISV) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 64) +} + +func (v *MaskedIMEISV) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 64) + if err != nil { + return err + } + + *v = MaskedIMEISV(n) + + return nil +} + +type NBIoTDefaultPagingDRX uint8 + +const ( + NBIoTDefaultPagingDRXV128 NBIoTDefaultPagingDRX = iota + NBIoTDefaultPagingDRXV256 + NBIoTDefaultPagingDRXV512 + NBIoTDefaultPagingDRXV1024 +) + +type NBIoTPagingeDRXInformation struct { + NBIoTpagingeDRXCycle NBIoTPagingeDRXCycle + NBIoTpagingTimeWindow *NBIoTPagingTimeWindow `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NBIoTPagingDRX uint8 + +const ( + NBIoTPagingDRXV32 NBIoTPagingDRX = iota + NBIoTPagingDRXV64 + NBIoTPagingDRXV128 + NBIoTPagingDRXV256 + NBIoTPagingDRXV512 + NBIoTPagingDRXV1024 +) + +type NBIoTUEIdentityIndexValue uint16 + +func (v NBIoTUEIdentityIndexValue) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 12) +} + +func (v *NBIoTUEIdentityIndexValue) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 12) + if err != nil { + return err + } + + *v = NBIoTUEIdentityIndexValue(n) + + return nil +} + +type NRUESecurityCapabilities struct { + NRencryptionAlgorithms NRencryptionAlgorithms + NRintegrityProtectionAlgorithms NRintegrityProtectionAlgorithms + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRUESidelinkAggregateMaximumBitrate struct { + UEaggregateMaximumBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NRV2XServicesAuthorized struct { + VehicleUE *VehicleUE `per:",optional"` + PedestrianUE *PedestrianUE `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NotifySourceeNB uint8 + +const ( + NotifySourceeNBNotifySource NotifySourceeNB = iota +) + +type PC5QoSParameters struct { + Pc5QoSFlowList PC5QoSFlowList + Pc5LinkAggregatedBitRates *BitRate `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PSServiceNotAvailable uint8 + +const ( + PSServiceNotAvailablePSServiceNotAvailable PSServiceNotAvailable = iota +) + +type PagingeDRXInformation struct { + PagingeDRXCycle PagingeDRXCycle + PagingTimeWindow *PagingTimeWindow `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PagingCause uint8 + +const ( + PagingCauseVoice PagingCause = iota +) + +type PendingDataIndication uint8 + +const ( + PendingDataIndicationTrue PendingDataIndication = iota +) + +type ProSeAuthorized struct { + ProSeDirectDiscovery *ProSeDirectDiscovery `per:",optional"` + ProSeDirectCommunication *ProSeDirectCommunication `per:",optional"` + ProSeUEtoNetworkRelaying *ProSeUEtoNetworkRelaying `per:",extie:IDProSeUEtoNetworkRelaying,crit:ignore"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RelayNodeIndicator uint8 + +const ( + RelayNodeIndicatorTrue RelayNodeIndicator = iota +) + +type SRVCCHOIndication uint8 + +const ( + SRVCCHOIndicationPSandCS SRVCCHOIndication = iota + SRVCCHOIndicationCSonly +) + +type SRVCCOperationNotPossible uint8 + +const ( + SRVCCOperationNotPossibleNotPossible SRVCCOperationNotPossible = iota +) + +type SRVCCOperationPossible uint8 + +const ( + SRVCCOperationPossiblePossible SRVCCOperationPossible = iota +) + +type SecondaryRATDataUsageReportList []SecondaryRATDataUsageReportItem + +func (l SecondaryRATDataUsageReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofERABs, IDSecondaryRATDataUsageReportItem, CriticalityIgnore, l) +} + +func (l *SecondaryRATDataUsageReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[SecondaryRATDataUsageReportItem](r, enc, maxnoofERABs, IDSecondaryRATDataUsageReportItem, CriticalityIgnore) + *l = items + + return err +} + +type SecondaryRATDataUsageRequest uint8 + +const ( + SecondaryRATDataUsageRequestRequested SecondaryRATDataUsageRequest = iota +) + +type ServedDCNs []ServedDCNsItem + +func (l ServedDCNs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 0, maxnoofDCNs, []ServedDCNsItem(l)) +} + +func (l *ServedDCNs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[ServedDCNsItem](r, enc, 0, maxnoofDCNs) + if err != nil { + return err + } + + *l = items + + return nil +} + +type SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator uint8 + +const ( + SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicatorPeriodically SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator = iota + SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicatorOndemand +) + +type SubscriptionBasedUEDifferentiationInfoPeriodicTime int64 + +func (v SubscriptionBasedUEDifferentiationInfoPeriodicTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 3600, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *SubscriptionBasedUEDifferentiationInfoPeriodicTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 3600, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = SubscriptionBasedUEDifferentiationInfoPeriodicTime(n) + + return nil +} + +type SubscriptionBasedUEDifferentiationInfoStationaryIndication uint8 + +const ( + SubscriptionBasedUEDifferentiationInfoStationaryIndicationStationary SubscriptionBasedUEDifferentiationInfoStationaryIndication = iota + SubscriptionBasedUEDifferentiationInfoStationaryIndicationMobile +) + +type SubscriptionBasedUEDifferentiationInfoTrafficProfile uint8 + +const ( + SubscriptionBasedUEDifferentiationInfoTrafficProfileSinglePacket SubscriptionBasedUEDifferentiationInfoTrafficProfile = iota + SubscriptionBasedUEDifferentiationInfoTrafficProfileDualPackets + SubscriptionBasedUEDifferentiationInfoTrafficProfileMultiplePackets +) + +type SubscriptionBasedUEDifferentiationInfoBatteryIndication uint8 + +const ( + SubscriptionBasedUEDifferentiationInfoBatteryIndicationBatteryPowered SubscriptionBasedUEDifferentiationInfoBatteryIndication = iota + SubscriptionBasedUEDifferentiationInfoBatteryIndicationBatteryPoweredNotRechargeableOrReplaceable + SubscriptionBasedUEDifferentiationInfoBatteryIndicationNotBatteryPowered +) + +type SubscriptionBasedUEDifferentiationInfo struct { + PeriodicCommunicationIndicator *SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator `per:",optional"` + PeriodicTime *SubscriptionBasedUEDifferentiationInfoPeriodicTime `per:",optional"` + ScheduledCommunicationTime *ScheduledCommunicationTime `per:",optional"` + StationaryIndication *SubscriptionBasedUEDifferentiationInfoStationaryIndication `per:",optional"` + TrafficProfile *SubscriptionBasedUEDifferentiationInfoTrafficProfile `per:",optional"` + BatteryIndication *SubscriptionBasedUEDifferentiationInfoBatteryIndication `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type TimeSinceSecondaryNodeRelease []byte + +func (v TimeSinceSecondaryNodeRelease) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 4, 4, true, true, false, v) +} + +func (v *TimeSinceSecondaryNodeRelease) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type UEApplicationLayerMeasurementCapability uint8 + +func (v UEApplicationLayerMeasurementCapability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 8) +} + +func (v *UEApplicationLayerMeasurementCapability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 8) + if err != nil { + return err + } + + *v = UEApplicationLayerMeasurementCapability(n) + + return nil +} + +type UEUsageType uint8 + +func (v UEUsageType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}, int64(v)) +} + +func (v *UEUsageType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}) + if err != nil { + return err + } + + *v = UEUsageType(n) + + return nil +} + +type UECapabilityInfoRequest uint8 + +const ( + UECapabilityInfoRequestRequested UECapabilityInfoRequest = iota +) + +type UERadioCapabilityID []byte + +func (v UERadioCapabilityID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *UERadioCapabilityID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type UESidelinkAggregateMaximumBitrate struct { + UESidelinkAggregateMaximumBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type UEUserPlaneCIoTSupportIndicator uint8 + +const ( + UEUserPlaneCIoTSupportIndicatorSupported UEUserPlaneCIoTSupportIndicator = iota +) + +type V2XServicesAuthorized struct { + VehicleUE *VehicleUE `per:",optional"` + PedestrianUE *PedestrianUE `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type WUSAssistanceInformation struct { + PagingProbabilityInformation PagingProbabilityInformation + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AssistanceDataForRecommendedCells struct { + RecommendedCellsForPaging RecommendedCellsForPaging + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type AssistanceDataForCECapableUEs struct { + CellIdentifierAndCELevelForCECapableUEs CellIdentifierAndCELevelForCECapableUEs + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PagingAttemptInformation struct { + PagingAttemptCount PagingAttemptCount + IntendedNumberOfPagingAttempts IntendedNumberOfPagingAttempts + NextPagingAreaScope *NextPagingAreaScope `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CSGIdListItem struct { + CSGId CSGId + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type CELevel []byte + +func (v CELevel) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 0, 0, true, false, false, v) +} + +func (v *CELevel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 0, 0, true, false, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type ConnectedengNBItem struct { + EngNBID EngNBID + SupportedTAs SupportedTAs + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ERABToBeUpdatedItem struct { + ERABID ERABID + SecurityIndication *SecurityIndication `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +type ENDCSONTransferType struct { + Request *ENDCTransferTypeRequest `per:",choice:0"` + Reply *ENDCTransferTypeReply `per:",choice:1"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +type ExpectedUEActivityBehaviour struct { + ExpectedActivityPeriod *ExpectedActivityPeriod `per:",optional"` + ExpectedIdlePeriod *ExpectedIdlePeriod `per:",optional"` + SourceofUEActivityBehaviourInformation *SourceOfUEActivityBehaviourInformation `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExpectedHOInterval uint8 + +const ( + ExpectedHOIntervalSec15 ExpectedHOInterval = iota + ExpectedHOIntervalSec30 + ExpectedHOIntervalSec60 + ExpectedHOIntervalSec90 + ExpectedHOIntervalSec120 + ExpectedHOIntervalSec180 + ExpectedHOIntervalLongTime +) + +type RecommendedCellsForPaging struct { + RecommendedCellList RecommendedCellList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RecommendedENBsForPaging struct { + RecommendedENBList RecommendedENBList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type NBIoTPagingeDRXCycle uint8 + +const ( + NBIoTPagingeDRXCycleHf2 NBIoTPagingeDRXCycle = iota + NBIoTPagingeDRXCycleHf4 + NBIoTPagingeDRXCycleHf6 + NBIoTPagingeDRXCycleHf8 + NBIoTPagingeDRXCycleHf10 + NBIoTPagingeDRXCycleHf12 + NBIoTPagingeDRXCycleHf14 + NBIoTPagingeDRXCycleHf16 + NBIoTPagingeDRXCycleHf32 + NBIoTPagingeDRXCycleHf64 + NBIoTPagingeDRXCycleHf128 + NBIoTPagingeDRXCycleHf256 + NBIoTPagingeDRXCycleHf512 + NBIoTPagingeDRXCycleHf1024 +) + +type NBIoTPagingTimeWindow uint8 + +const ( + NBIoTPagingTimeWindowS1 NBIoTPagingTimeWindow = iota + NBIoTPagingTimeWindowS2 + NBIoTPagingTimeWindowS3 + NBIoTPagingTimeWindowS4 + NBIoTPagingTimeWindowS5 + NBIoTPagingTimeWindowS6 + NBIoTPagingTimeWindowS7 + NBIoTPagingTimeWindowS8 + NBIoTPagingTimeWindowS9 + NBIoTPagingTimeWindowS10 + NBIoTPagingTimeWindowS11 + NBIoTPagingTimeWindowS12 + NBIoTPagingTimeWindowS13 + NBIoTPagingTimeWindowS14 + NBIoTPagingTimeWindowS15 + NBIoTPagingTimeWindowS16 +) + +type NRencryptionAlgorithms struct{ BitString } + +func (v NRencryptionAlgorithms) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 16, 16, true) +} + +func (v *NRencryptionAlgorithms) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 16, 16, true) + if err != nil { + return err + } + + *v = NRencryptionAlgorithms{b} + + return nil +} + +type NRintegrityProtectionAlgorithms struct{ BitString } + +func (v NRintegrityProtectionAlgorithms) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 16, 16, true) +} + +func (v *NRintegrityProtectionAlgorithms) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 16, 16, true) + if err != nil { + return err + } + + *v = NRintegrityProtectionAlgorithms{b} + + return nil +} + +type VehicleUE uint8 + +const ( + VehicleUEAuthorized VehicleUE = iota + VehicleUENotAuthorized +) + +type PedestrianUE uint8 + +const ( + PedestrianUEAuthorized PedestrianUE = iota + PedestrianUENotAuthorized +) + +type PC5QoSFlowList []PC5QoSFlowItem + +func (l PC5QoSFlowList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return marshalSeqOf(w, enc, 1, maxnoofPC5QoSFlows, []PC5QoSFlowItem(l)) +} + +func (l *PC5QoSFlowList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := unmarshalSeqOf[PC5QoSFlowItem](r, enc, 1, maxnoofPC5QoSFlows) + if err != nil { + return err + } + + *l = items + + return nil +} + +type PagingeDRXCycle uint8 + +const ( + PagingeDRXCycleHfhalf PagingeDRXCycle = iota + PagingeDRXCycleHf1 + PagingeDRXCycleHf2 + PagingeDRXCycleHf4 + PagingeDRXCycleHf6 + PagingeDRXCycleHf8 + PagingeDRXCycleHf10 + PagingeDRXCycleHf12 + PagingeDRXCycleHf14 + PagingeDRXCycleHf16 + PagingeDRXCycleHf32 + PagingeDRXCycleHf64 + PagingeDRXCycleHf128 + PagingeDRXCycleHf256 +) + +type PagingTimeWindow uint8 + +const ( + PagingTimeWindowS1 PagingTimeWindow = iota + PagingTimeWindowS2 + PagingTimeWindowS3 + PagingTimeWindowS4 + PagingTimeWindowS5 + PagingTimeWindowS6 + PagingTimeWindowS7 + PagingTimeWindowS8 + PagingTimeWindowS9 + PagingTimeWindowS10 + PagingTimeWindowS11 + PagingTimeWindowS12 + PagingTimeWindowS13 + PagingTimeWindowS14 + PagingTimeWindowS15 + PagingTimeWindowS16 +) + +type ProSeDirectDiscovery uint8 + +const ( + ProSeDirectDiscoveryAuthorized ProSeDirectDiscovery = iota + ProSeDirectDiscoveryNotAuthorized +) + +type ProSeDirectCommunication uint8 + +const ( + ProSeDirectCommunicationAuthorized ProSeDirectCommunication = iota + ProSeDirectCommunicationNotAuthorized +) + +type ProSeUEtoNetworkRelaying uint8 + +const ( + ProSeUEtoNetworkRelayingAuthorized ProSeUEtoNetworkRelaying = iota + ProSeUEtoNetworkRelayingNotAuthorized +) + +type SecondaryRATDataUsageReportItem struct { + ERABID ERABID + SecondaryRATType SecondaryRATType + ERABUsageReportList ERABUsageReportList + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +type ServedDCNsItem struct { + DCNID DCNID + RelativeDCNCapacity RelativeMMECapacity + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ScheduledCommunicationTimeDayofWeek uint8 + +func (v ScheduledCommunicationTimeDayofWeek) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeBitStringUint(w, enc, uint64(v), 7) +} + +func (v *ScheduledCommunicationTimeDayofWeek) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeBitStringUint(r, enc, 7) + if err != nil { + return err + } + + *v = ScheduledCommunicationTimeDayofWeek(n) + + return nil +} + +type ScheduledCommunicationTimeTimeofDayStart int64 + +func (v ScheduledCommunicationTimeTimeofDayStart) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ScheduledCommunicationTimeTimeofDayStart) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ScheduledCommunicationTimeTimeofDayStart(n) + + return nil +} + +type ScheduledCommunicationTimeTimeofDayEnd int64 + +func (v ScheduledCommunicationTimeTimeofDayEnd) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ScheduledCommunicationTimeTimeofDayEnd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 86399, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ScheduledCommunicationTimeTimeofDayEnd(n) + + return nil +} + +type ScheduledCommunicationTime struct { + DayofWeek *ScheduledCommunicationTimeDayofWeek `per:",optional"` + TimeofDayStart *ScheduledCommunicationTimeTimeofDayStart `per:",optional"` + TimeofDayEnd *ScheduledCommunicationTimeTimeofDayEnd `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type PagingProbabilityInformation uint8 + +const ( + PagingProbabilityInformationP00 PagingProbabilityInformation = iota + PagingProbabilityInformationP05 + PagingProbabilityInformationP10 + PagingProbabilityInformationP15 + PagingProbabilityInformationP20 + PagingProbabilityInformationP25 + PagingProbabilityInformationP30 + PagingProbabilityInformationP35 + PagingProbabilityInformationP40 + PagingProbabilityInformationP45 + PagingProbabilityInformationP50 + PagingProbabilityInformationP55 + PagingProbabilityInformationP60 + PagingProbabilityInformationP65 + PagingProbabilityInformationP70 + PagingProbabilityInformationP75 + PagingProbabilityInformationP80 + PagingProbabilityInformationP85 + PagingProbabilityInformationP90 + PagingProbabilityInformationP95 + PagingProbabilityInformationP100 +) + +type PagingAttemptCount int64 + +func (v PagingAttemptCount) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *PagingAttemptCount) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = PagingAttemptCount(n) + + return nil +} + +type IntendedNumberOfPagingAttempts int64 + +func (v IntendedNumberOfPagingAttempts) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *IntendedNumberOfPagingAttempts) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = IntendedNumberOfPagingAttempts(n) + + return nil +} + +type NextPagingAreaScope uint8 + +const ( + NextPagingAreaScopeSame NextPagingAreaScope = iota + NextPagingAreaScopeChanged +) + +type EngNBID struct{ BitString } + +func (v EngNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + return v.encode(w, enc, 22, 32, true) +} + +func (v *EngNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := decodeBitString(r, enc, 22, 32, true) + if err != nil { + return err + } + + *v = EngNBID{b} + + return nil +} + +type ENDCTransferTypeRequest struct { + SourceeNB ENDCSONeNBIdentification + TargetengNB ENDCSONengNBIdentification + TargeteNB *ENDCSONeNBIdentification `per:",optional"` + AssociatedTAI *TAI `per:",optional"` + Broadcast5GSTAI *FiveGSTAI `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ENDCTransferTypeReply struct { + SourceengNB ENDCSONengNBIdentification + TargeteNB ENDCSONeNBIdentification + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ExpectedActivityPeriod int64 + +func (v ExpectedActivityPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ExpectedActivityPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ExpectedActivityPeriod(n) + + return nil +} + +type ExpectedIdlePeriod int64 + +func (v ExpectedIdlePeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *ExpectedIdlePeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 181, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = ExpectedIdlePeriod(n) + + return nil +} + +type SourceOfUEActivityBehaviourInformation uint8 + +const ( + SourceOfUEActivityBehaviourInformationSubscriptionInformation SourceOfUEActivityBehaviourInformation = iota + SourceOfUEActivityBehaviourInformationStatistics +) + +type RecommendedCellList []RecommendedCellItem + +func (l RecommendedCellList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofRecommendedCells, IDRecommendedCellItem, CriticalityIgnore, l) +} + +func (l *RecommendedCellList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[RecommendedCellItem](r, enc, maxnoofRecommendedCells, IDRecommendedCellItem, CriticalityIgnore) + *l = items + + return err +} + +type RecommendedENBList []RecommendedENBItem + +func (l RecommendedENBList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnoofRecommendedENBs, IDRecommendedENBItem, CriticalityIgnore, l) +} + +func (l *RecommendedENBList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[RecommendedENBItem](r, enc, maxnoofRecommendedENBs, IDRecommendedENBItem, CriticalityIgnore) + *l = items + + return err +} + +type PC5QoSFlowItem struct { + PQI FiveQI + Pc5FlowBitRates *PC5FlowBitRates `per:",optional"` + Range *RangeType `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type SecondaryRATType uint8 + +const ( + SecondaryRATTypeNR SecondaryRATType = iota + SecondaryRATTypeUnlicensed +) + +type ERABUsageReportList []ERABUsageReportItem + +func (l ERABUsageReportList) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeSingleContainerList(w, enc, maxnooftimeperiods, IDERABUsageReportItem, CriticalityIgnore, l) +} + +func (l *ERABUsageReportList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + items, err := decodeItemList[ERABUsageReportItem](r, enc, maxnooftimeperiods, IDERABUsageReportItem, CriticalityIgnore) + *l = items + + return err +} + +type RelativeMMECapacity uint8 + +func (v RelativeMMECapacity) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}, int64(v)) +} + +func (v *RelativeMMECapacity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true}) + if err != nil { + return err + } + + *v = RelativeMMECapacity(n) + + return nil +} + +type ENDCSONeNBIdentification struct { + GlobaleNBID GlobalENBID + SelectedTAI TAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type ENDCSONengNBIdentification struct { + GlobalengNBID GlobalengNBID + SelectedTAI TAI + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RecommendedCellItemTimeStayedInCell uint16 + +func (v RecommendedCellItemTimeStayedInCell) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}, int64(v)) +} + +func (v *RecommendedCellItemTimeStayedInCell) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 4095, HasUB: true}) + if err != nil { + return err + } + + *v = RecommendedCellItemTimeStayedInCell(n) + + return nil +} + +type RecommendedCellItem struct { + EUTRANCGI EUTRANCGI + TimeStayedInCell *RecommendedCellItemTimeStayedInCell `per:",optional"` + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +type RecommendedENBItem struct { + MMEPagingTarget MMEPagingTarget + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +type FiveQI int64 + +func (v FiveQI) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}, int64(v)) +} + +func (v *FiveQI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 255, HasUB: true, Extensible: true}) + if err != nil { + return err + } + + *v = FiveQI(n) + + return nil +} + +type PC5FlowBitRates struct { + GuaranteedFlowBitRate BitRate + MaximumFlowBitRate BitRate + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type RangeType uint8 + +const ( + RangeTypeM50 RangeType = iota + RangeTypeM80 + RangeTypeM180 + RangeTypeM200 + RangeTypeM350 + RangeTypeM400 + RangeTypeM500 + RangeTypeM700 + RangeTypeM1000 +) + +type ERABUsageReportItemStartTimestamp []byte + +func (v ERABUsageReportItemStartTimestamp) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 4, 4, true, true, false, v) +} + +func (v *ERABUsageReportItemStartTimestamp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type ERABUsageReportItemEndTimestamp []byte + +func (v ERABUsageReportItemEndTimestamp) MarshalPER(w *per.Writer, enc per.Encoding) error { + return per.EncodeOctetString(w, enc, 4, 4, true, true, false, v) +} + +func (v *ERABUsageReportItemEndTimestamp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + b, err := per.DecodeOctetString(r, enc, 4, 4, true, true, false) + if err != nil { + return err + } + + *v = b + + return nil +} + +type ERABUsageReportItemUsageCountUL uint64 + +func (v ERABUsageReportItemUsageCountUL) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeUint64Range(w, enc, uint64(v)) +} + +func (v *ERABUsageReportItemUsageCountUL) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeUint64Range(r, enc) + *v = ERABUsageReportItemUsageCountUL(n) + + return err +} + +type ERABUsageReportItemUsageCountDL uint64 + +func (v ERABUsageReportItemUsageCountDL) MarshalPER(w *per.Writer, enc per.Encoding) error { + return encodeUint64Range(w, enc, uint64(v)) +} + +func (v *ERABUsageReportItemUsageCountDL) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + n, err := decodeUint64Range(r, enc) + *v = ERABUsageReportItemUsageCountDL(n) + + return err +} + +type ERABUsageReportItem struct { + StartTimestamp ERABUsageReportItemStartTimestamp + EndTimestamp ERABUsageReportItemEndTimestamp + UsageCountUL ERABUsageReportItemUsageCountUL + UsageCountDL ERABUsageReportItemUsageCountDL + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` +} + +type GlobalengNBID struct { + PLMNidentity PLMNIdentity + EngNBID EngNBID + iEExtensions extensionMeta `per:",exttable"` + extensions per.ExtensionAdditions `per:",extraw"` +} + +type MMEPagingTarget struct { + GlobalENBID *GlobalENBID `per:",choice:0"` + TAI *TAI `per:",choice:1"` + Ext *per.ExtensionAlternative `per:",extalt"` +} + +func (l *ERABToBeUpdatedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABToBeUpdatedItem, CriticalityIgnore, l) +} + +func (l *SecondaryRATDataUsageReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDSecondaryRATDataUsageReportItem, CriticalityIgnore, l) +} + +func (l *RecommendedCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDRecommendedCellItem, CriticalityIgnore, l) +} + +func (l *RecommendedENBList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDRecommendedENBItem, CriticalityIgnore, l) +} + +func (l *ERABUsageReportList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABUsageReportItem, CriticalityIgnore, l) +} diff --git a/s1ap/ie_names.go b/s1ap/ie_names.go index 1a041e88aa..99492613e3 100644 --- a/s1ap/ie_names.go +++ b/s1ap/ie_names.go @@ -12,195 +12,342 @@ import "fmt" // "bearer" pattern against the E-RAB list names, where a bearer is an EPS // radio bearer (TS 36.413 §9.1.3). var protocolIENames = map[ProtocolIEID]string{ - IDMMEUES1APID: "MME-UE-S1AP-ID", - IDHandoverType: "HandoverType", - IDCause: "Cause", - IDTargetID: "TargetID", - IDENBUES1APID: "eNB-UE-S1AP-ID", - IDERABSubjecttoDataForwardingList: "E-RABSubjecttoDataForwardingList", - IDERABtoReleaseListHOCmd: "E-RABtoReleaseListHOCmd", - IDERABDataForwardingItem: "E-RABDataForwardingItem", - IDERABReleaseItemBearerRelComp: "E-RABReleaseItemBearerRelComp", - IDERABToBeSetupListBearerSUReq: "E-RABToBeSetupListBearerSUReq", - IDERABToBeSetupItemBearerSUReq: "E-RABToBeSetupItemBearerSUReq", - IDERABAdmittedList: "E-RABAdmittedList", - IDERABFailedToSetupListHOReqAck: "E-RABFailedToSetupListHOReqAck", - IDERABAdmittedItem: "E-RABAdmittedItem", - IDERABFailedtoSetupItemHOReqAck: "E-RABFailedtoSetupItemHOReqAck", - IDERABToBeSwitchedDLList: "E-RABToBeSwitchedDLList", - IDERABToBeSwitchedDLItem: "E-RABToBeSwitchedDLItem", - IDERABToBeSetupListCtxtSUReq: "E-RABToBeSetupListCtxtSUReq", - IDTraceActivation: "TraceActivation", - IDNASPDU: "NAS-PDU", - IDERABToBeSetupItemHOReq: "E-RABToBeSetupItemHOReq", - IDERABSetupListBearerSURes: "E-RABSetupListBearerSURes", - IDERABFailedToSetupListBearerSURes: "E-RABFailedToSetupListBearerSURes", - IDERABToBeModifiedListBearerModReq: "E-RABToBeModifiedListBearerModReq", - IDERABModifyListBearerModRes: "E-RABModifyListBearerModRes", - IDERABFailedToModifyList: "E-RABFailedToModifyList", - IDERABToBeReleasedList: "E-RABToBeReleasedList", - IDERABReleasedList: "E-RABReleasedList", - IDERABFailedToReleaseList: "E-RABFailedToReleaseList", - IDERABItem: "E-RABItem", - IDERABToBeModifiedItemBearerModReq: "E-RABToBeModifiedItemBearerModReq", - IDERABModifyItemBearerModRes: "E-RABModifyItemBearerModRes", - IDERABSetupItemBearerSURes: "E-RABSetupItemBearerSURes", - IDSecurityContext: "SecurityContext", - IDHandoverRestrictionList: "HandoverRestrictionList", - IDUEPagingID: "UEPagingID", - IDPagingDRX: "pagingDRX", - IDTAIList: "TAIList", - IDTAIItem: "TAIItem", - IDERABFailedToSetupListCtxtSURes: "E-RABFailedToSetupListCtxtSURes", - IDERABSetupItemCtxtSURes: "E-RABSetupItemCtxtSURes", - IDERABSetupListCtxtSURes: "E-RABSetupListCtxtSURes", - IDERABToBeSetupItemCtxtSUReq: "E-RABToBeSetupItemCtxtSUReq", - IDERABToBeSetupListHOReq: "E-RABToBeSetupListHOReq", - IDCriticalityDiagnostics: "CriticalityDiagnostics", - IDGlobalENBID: "Global-ENB-ID", - IDENBname: "eNBname", - IDMMEname: "MMEname", - IDSupportedTAs: "SupportedTAs", - IDTimeToWait: "TimeToWait", - IDUEAggregateMaximumBitrate: "uEaggregateMaximumBitrate", - IDTAI: "TAI", - IDERABReleaseListBearerRelComp: "E-RABReleaseListBearerRelComp", - IDSecurityKey: "SecurityKey", - IDUERadioCapability: "UERadioCapability", - IDGUMMEI: "GUMMEI-ID", - IDERABInformationListItem: "E-RABInformationListItem", - IDDirectForwardingPathAvailability: "Direct-Forwarding-Path-Availability", - IDUEIdentityIndexValue: "UEIdentityIndexValue", - IDEUTRANTraceID: "E-UTRAN-Trace-ID", - IDRelativeMMECapacity: "RelativeMMECapacity", - IDSourceMMEUES1APID: "SourceMME-UE-S1AP-ID", - IDENBStatusTransferTransparentContainer: "eNB-StatusTransfer-TransparentContainer", - IDUEAssociatedLogicalS1ConnectionItem: "UE-associatedLogicalS1-ConnectionItem", - IDResetType: "ResetType", - IDUEAssociatedLogicalS1ConnectionListResAck: "UE-associatedLogicalS1-ConnectionListResAck", - IDERABToBeSwitchedULItem: "E-RABToBeSwitchedULItem", - IDERABToBeSwitchedULList: "E-RABToBeSwitchedULList", - IDSTMSI: "S-TMSI", - IDRequestType: "RequestType", - IDUES1APIDs: "UE-S1AP-IDs", - IDEUTRANCGI: "EUTRAN-CGI", - IDSourceToTargetTransparentContainer: "Source-ToTarget-TransparentContainer", - IDServedGUMMEIs: "ServedGUMMEIs", - IDUESecurityCapabilities: "UESecurityCapabilities", - IDCNDomain: "CNDomain", - IDTargetToSourceTransparentContainer: "Target-ToSource-TransparentContainer", - IDSONConfigurationTransferECT: "SONConfigurationTransferECT", - IDSONConfigurationTransferMCT: "SONConfigurationTransferMCT", - IDRRCEstablishmentCause: "RRC-Establishment-Cause", - IDNASSecurityParametersfromEUTRAN: "NASSecurityParametersfromE-UTRAN", - IDNASSecurityParameterstoEUTRAN: "NASSecurityParameterstoE-UTRAN", - IDDefaultPagingDRX: "DefaultPagingDRX", - IDDataForwardingNotPossible: "Data-Forwarding-Not-Possible", - IDLPPaPDU: "LPPa-PDU", - IDRoutingID: "Routing-ID", - IDPagingPriority: "PagingPriority", - IDCorrelationID: "Correlation-ID", - IDSIPTOCorrelationID: "SIPTO-Correlation-ID", - IDUserLocationInformation: "UserLocationInformation", - IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", - IDERABToBeModifiedListBearerModInd: "E-RABToBeModifiedListBearerModInd", - IDERABToBeModifiedItemBearerModInd: "E-RABToBeModifiedItemBearerModInd", - IDERABNotToBeModifiedListBearerModInd: "E-RABNotToBeModifiedListBearerModInd", - IDERABNotToBeModifiedItemBearerModInd: "E-RABNotToBeModifiedItemBearerModInd", - IDERABModifyListBearerModConf: "E-RABModifyListBearerModConf", - IDERABModifyItemBearerModConf: "E-RABModifyItemBearerModConf", - IDERABFailedToModifyListBearerModConf: "E-RABFailedToModifyListBearerModConf", - IDERABToBeReleasedListBearerModConf: "E-RABToBeReleasedListBearerModConf", - IDUERetentionInformation: "UE-RetentionInformation", - IDOverloadResponse: "OverloadResponse", - IDMessageIdentifier: "MessageIdentifier", - IDSerialNumber: "SerialNumber", - IDWarningAreaList: "WarningAreaList", - IDRepetitionPeriod: "RepetitionPeriod", - IDNumberofBroadcastRequest: "NumberofBroadcastRequest", - IDWarningType: "WarningType", - IDWarningSecurityInfo: "WarningSecurityInfo", - IDDataCodingScheme: "DataCodingScheme", - IDWarningMessageContents: "WarningMessageContents", - IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", - IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", - IDConcurrentWarningMessageIndicator: "ConcurrentWarningMessageIndicator", - IDExtendedRepetitionPeriod: "ExtendedRepetitionPeriod", - IDGUMMEIList: "GUMMEIList", - IDSourceMMEGUMMEI: "SourceMME-GUMMEI", - IDMMEUES1APID2: "MME-UE-S1AP-ID-2", - IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", - IDGWContextReleaseIndication: "GWContextReleaseIndication", - IDECGIListForRestart: "ECGIListForRestart", - IDTransportInformation: "TransportInformation", - IDTAIListForRestart: "TAIListForRestart", - IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", - IDKillAllWarningMessages: "KillAllWarningMessages", - IDPWSfailedECGIList: "PWSfailedECGIList", - IDMMEGroupID: "MME-Group-ID", - IDAdditionalGUTI: "Additional-GUTI", - IDS1Message: "S1-Message", - IDUEUsageType: "UE-Usage-Type", - IDBearerType: "BearerType", - IDExtendedERABMaximumBitrateDL: "extended-e-RAB-MaximumBitrateDL", - IDExtendedERABMaximumBitrateUL: "extended-e-RAB-MaximumBitrateUL", - IDExtendedERABGuaranteedBitrateDL: "extended-e-RAB-GuaranteedBitrateDL", - IDExtendedERABGuaranteedBitrateUL: "extended-e-RAB-GuaranteedBitrateUL", - IDExtendedUEAggregateMaximumBitRateDL: "extended-uEaggregateMaximumBitRateDL", - IDExtendedUEAggregateMaximumBitRateUL: "extended-uEaggregateMaximumBitRateUL", - IDDownlinkPacketLossRate: "DownlinkPacketLossRate", - IDUplinkPacketLossRate: "UplinkPacketLossRate", - IDWarningAreaCoordinates: "WarningAreaCoordinates", - IDEthernetType: "Ethernet-Type", - IDSecurityIndication: "SecurityIndication", - IDGUMMEIType: "GUMMEIType", - IDNRrestrictioninEPSasSecondaryRAT: "NRrestrictioninEPSasSecondaryRAT", - IDUnlicensedSpectrumRestriction: "UnlicensedSpectrumRestriction", - IDCNTypeRestrictions: "CNTypeRestrictions", - IDNRrestrictionin5GS: "NRrestrictionin5GS", - IDLastNGRANPLMNIdentity: "LastNG-RANPLMNIdentity", - IDRATRestrictions: "RAT-Restrictions", - IDPSCellInformation: "PSCellInformation", - IDLTENTNTAIInformation: "LTE-NTN-TAI-Information", - IDRequestTypeAdditionalInfo: "RequestTypeAdditionalInfo", - IDDAPSRequestInfo: "DAPSRequestInfo", - IDSourceTransportLayerAddress: "SourceTransportLayerAddress", - IDSourceNodeTransportLayerAddress: "SourceNodeTransportLayerAddress", - IDTimeUEStayedInCellEnhancedGranularity: "Time-UE-StayedInCell-EnhancedGranularity", - IDHOCause: "HO-Cause", - IDLastVisitedPSCellList: "lastVisitedPSCellList", - IDMobilityInformation: "MobilityInformation", - IDUEHistoryInformationFromTheUE: "uE-HistoryInformationFromTheUE", - IDIMSvoiceEPSfallbackfrom5G: "IMSvoiceEPSfallbackfrom5G", - IDAdditionalRRMPriorityIndex: "AdditionalRRMPriorityIndex", - IDContextatSource: "ContextatSource", - IDIntersystemMeasurementConfiguration: "IntersystemMeasurementConfiguration", - IDSourceNodeID: "SourceNodeID", - IDEmergencyIndicator: "EmergencyIndicator", - IDUEContextReferenceatSourceeNB: "UEContextReferenceatSourceeNB", - IDSourceSNID: "SourceSNID", - IDTimeBasedHandoverInformation: "TimeBasedHandoverInformation", - IDRATType: "RAT-Type", - IDMDTConfigurationNR: "MDTConfigurationNR", - IDTraceCollectionEntityURI: "TraceCollectionEntityURI", - IDCoarseUELocationRequested: "CoarseUELocationRequested", - IDCoarseUELocation: "CoarseUELocation", - IDTimeRefDistribution: "TimeRefDistribution", - IDRequestedTNLInfo: "RequestedTNLInfo", - IDMDTConfiguration: "MDTConfiguration", - IDUEAppLayerMeasConfig: "UEAppLayerMeasConfig", - IDX2TNLConfigurationInfo: "x2TNLConfigurationInfo", - IDSynchronisationInformation: "Synchronisation-Information", - IDSONInformationReport: "SON-Information-Report", - IDNBIoTRLFReportContainer: "NB-IoT-RLF-Report-Container", - IDTimeSynchronisationInfo: "Time-Synchronisation-Info", - IDMutingPatternInformation: "Muting-Pattern-Information", - IDENBX2ExtendedTransportLayerAddresses: "eNBX2ExtendedTransportLayerAddresses", - IDENBIndirectX2TransportLayerAddresses: "eNBIndirectX2TransportLayerAddresses", - IDMutingAvailabilityIndication: "Muting-Availability-Indication", - IDTunnelInformationForBBF: "Tunnel-Information-for-BBF", - IDGWTransportLayerAddress: "GW-TransportLayerAddress", - IDSIPTOLGWTransportLayerAddress: "SIPTO-L-GW-TransportLayerAddress", + IDMMEUES1APID: "MME-UE-S1AP-ID", + IDHandoverType: "HandoverType", + IDCause: "Cause", + IDTargetID: "TargetID", + IDENBUES1APID: "eNB-UE-S1AP-ID", + IDERABSubjecttoDataForwardingList: "E-RABSubjecttoDataForwardingList", + IDERABtoReleaseListHOCmd: "E-RABtoReleaseListHOCmd", + IDERABDataForwardingItem: "E-RABDataForwardingItem", + IDERABReleaseItemBearerRelComp: "E-RABReleaseItemBearerRelComp", + IDERABToBeSetupListBearerSUReq: "E-RABToBeSetupListBearerSUReq", + IDERABToBeSetupItemBearerSUReq: "E-RABToBeSetupItemBearerSUReq", + IDERABAdmittedList: "E-RABAdmittedList", + IDERABFailedToSetupListHOReqAck: "E-RABFailedToSetupListHOReqAck", + IDERABAdmittedItem: "E-RABAdmittedItem", + IDERABFailedtoSetupItemHOReqAck: "E-RABFailedtoSetupItemHOReqAck", + IDERABToBeSwitchedDLList: "E-RABToBeSwitchedDLList", + IDERABToBeSwitchedDLItem: "E-RABToBeSwitchedDLItem", + IDERABToBeSetupListCtxtSUReq: "E-RABToBeSetupListCtxtSUReq", + IDTraceActivation: "TraceActivation", + IDNASPDU: "NAS-PDU", + IDERABToBeSetupItemHOReq: "E-RABToBeSetupItemHOReq", + IDERABSetupListBearerSURes: "E-RABSetupListBearerSURes", + IDERABFailedToSetupListBearerSURes: "E-RABFailedToSetupListBearerSURes", + IDERABToBeModifiedListBearerModReq: "E-RABToBeModifiedListBearerModReq", + IDERABModifyListBearerModRes: "E-RABModifyListBearerModRes", + IDERABFailedToModifyList: "E-RABFailedToModifyList", + IDERABToBeReleasedList: "E-RABToBeReleasedList", + IDERABReleasedList: "E-RABReleasedList", + IDERABFailedToReleaseList: "E-RABFailedToReleaseList", + IDERABItem: "E-RABItem", + IDERABToBeModifiedItemBearerModReq: "E-RABToBeModifiedItemBearerModReq", + IDERABModifyItemBearerModRes: "E-RABModifyItemBearerModRes", + IDERABSetupItemBearerSURes: "E-RABSetupItemBearerSURes", + IDSecurityContext: "SecurityContext", + IDHandoverRestrictionList: "HandoverRestrictionList", + IDUEPagingID: "UEPagingID", + IDPagingDRX: "pagingDRX", + IDTAIList: "TAIList", + IDTAIItem: "TAIItem", + IDERABFailedToSetupListCtxtSURes: "E-RABFailedToSetupListCtxtSURes", + IDERABSetupItemCtxtSURes: "E-RABSetupItemCtxtSURes", + IDERABSetupListCtxtSURes: "E-RABSetupListCtxtSURes", + IDERABToBeSetupItemCtxtSUReq: "E-RABToBeSetupItemCtxtSUReq", + IDERABToBeSetupListHOReq: "E-RABToBeSetupListHOReq", + IDCriticalityDiagnostics: "CriticalityDiagnostics", + IDGlobalENBID: "Global-ENB-ID", + IDENBname: "eNBname", + IDMMEname: "MMEname", + IDSupportedTAs: "SupportedTAs", + IDTimeToWait: "TimeToWait", + IDUEAggregateMaximumBitrate: "uEaggregateMaximumBitrate", + IDTAI: "TAI", + IDERABReleaseListBearerRelComp: "E-RABReleaseListBearerRelComp", + IDSecurityKey: "SecurityKey", + IDUERadioCapability: "UERadioCapability", + IDGUMMEI: "GUMMEI-ID", + IDERABInformationListItem: "E-RABInformationListItem", + IDDirectForwardingPathAvailability: "Direct-Forwarding-Path-Availability", + IDUEIdentityIndexValue: "UEIdentityIndexValue", + IDEUTRANTraceID: "E-UTRAN-Trace-ID", + IDRelativeMMECapacity: "RelativeMMECapacity", + IDSourceMMEUES1APID: "SourceMME-UE-S1AP-ID", + IDENBStatusTransferTransparentContainer: "eNB-StatusTransfer-TransparentContainer", + IDUEAssociatedLogicalS1ConnectionItem: "UE-associatedLogicalS1-ConnectionItem", + IDResetType: "ResetType", + IDUEAssociatedLogicalS1ConnectionListResAck: "UE-associatedLogicalS1-ConnectionListResAck", + IDERABToBeSwitchedULItem: "E-RABToBeSwitchedULItem", + IDERABToBeSwitchedULList: "E-RABToBeSwitchedULList", + IDSTMSI: "S-TMSI", + IDRequestType: "RequestType", + IDUES1APIDs: "UE-S1AP-IDs", + IDEUTRANCGI: "EUTRAN-CGI", + IDSourceToTargetTransparentContainer: "Source-ToTarget-TransparentContainer", + IDServedGUMMEIs: "ServedGUMMEIs", + IDUESecurityCapabilities: "UESecurityCapabilities", + IDCNDomain: "CNDomain", + IDTargetToSourceTransparentContainer: "Target-ToSource-TransparentContainer", + IDSONConfigurationTransferECT: "SONConfigurationTransferECT", + IDSONConfigurationTransferMCT: "SONConfigurationTransferMCT", + IDRRCEstablishmentCause: "RRC-Establishment-Cause", + IDNASSecurityParametersfromEUTRAN: "NASSecurityParametersfromE-UTRAN", + IDNASSecurityParameterstoEUTRAN: "NASSecurityParameterstoE-UTRAN", + IDDefaultPagingDRX: "DefaultPagingDRX", + IDDataForwardingNotPossible: "Data-Forwarding-Not-Possible", + IDLPPaPDU: "LPPa-PDU", + IDRoutingID: "Routing-ID", + IDPagingPriority: "PagingPriority", + IDCorrelationID: "Correlation-ID", + IDSIPTOCorrelationID: "SIPTO-Correlation-ID", + IDUserLocationInformation: "UserLocationInformation", + IDUERadioCapabilityForPaging: "UERadioCapabilityForPaging", + IDERABToBeModifiedListBearerModInd: "E-RABToBeModifiedListBearerModInd", + IDERABToBeModifiedItemBearerModInd: "E-RABToBeModifiedItemBearerModInd", + IDERABNotToBeModifiedListBearerModInd: "E-RABNotToBeModifiedListBearerModInd", + IDERABNotToBeModifiedItemBearerModInd: "E-RABNotToBeModifiedItemBearerModInd", + IDERABModifyListBearerModConf: "E-RABModifyListBearerModConf", + IDERABModifyItemBearerModConf: "E-RABModifyItemBearerModConf", + IDERABFailedToModifyListBearerModConf: "E-RABFailedToModifyListBearerModConf", + IDERABToBeReleasedListBearerModConf: "E-RABToBeReleasedListBearerModConf", + IDUERetentionInformation: "UE-RetentionInformation", + IDOverloadResponse: "OverloadResponse", + IDMessageIdentifier: "MessageIdentifier", + IDSerialNumber: "SerialNumber", + IDWarningAreaList: "WarningAreaList", + IDRepetitionPeriod: "RepetitionPeriod", + IDNumberofBroadcastRequest: "NumberofBroadcastRequest", + IDWarningType: "WarningType", + IDWarningSecurityInfo: "WarningSecurityInfo", + IDDataCodingScheme: "DataCodingScheme", + IDWarningMessageContents: "WarningMessageContents", + IDBroadcastCompletedAreaList: "BroadcastCompletedAreaList", + IDBroadcastCancelledAreaList: "BroadcastCancelledAreaList", + IDConcurrentWarningMessageIndicator: "ConcurrentWarningMessageIndicator", + IDExtendedRepetitionPeriod: "ExtendedRepetitionPeriod", + IDGUMMEIList: "GUMMEIList", + IDSourceMMEGUMMEI: "SourceMME-GUMMEI", + IDMMEUES1APID2: "MME-UE-S1AP-ID-2", + IDTrafficLoadReductionIndication: "TrafficLoadReductionIndication", + IDGWContextReleaseIndication: "GWContextReleaseIndication", + IDECGIListForRestart: "ECGIListForRestart", + IDTransportInformation: "TransportInformation", + IDTAIListForRestart: "TAIListForRestart", + IDEmergencyAreaIDListForRestart: "EmergencyAreaIDListForRestart", + IDKillAllWarningMessages: "KillAllWarningMessages", + IDPWSfailedECGIList: "PWSfailedECGIList", + IDMMEGroupID: "MME-Group-ID", + IDAdditionalGUTI: "Additional-GUTI", + IDS1Message: "S1-Message", + IDUEUsageType: "UE-Usage-Type", + IDBearerType: "BearerType", + IDExtendedERABMaximumBitrateDL: "extended-e-RAB-MaximumBitrateDL", + IDExtendedERABMaximumBitrateUL: "extended-e-RAB-MaximumBitrateUL", + IDExtendedERABGuaranteedBitrateDL: "extended-e-RAB-GuaranteedBitrateDL", + IDExtendedERABGuaranteedBitrateUL: "extended-e-RAB-GuaranteedBitrateUL", + IDExtendedUEAggregateMaximumBitRateDL: "extended-uEaggregateMaximumBitRateDL", + IDExtendedUEAggregateMaximumBitRateUL: "extended-uEaggregateMaximumBitRateUL", + IDDownlinkPacketLossRate: "DownlinkPacketLossRate", + IDUplinkPacketLossRate: "UplinkPacketLossRate", + IDWarningAreaCoordinates: "WarningAreaCoordinates", + IDEthernetType: "Ethernet-Type", + IDSecurityIndication: "SecurityIndication", + IDGUMMEIType: "GUMMEIType", + IDNRrestrictioninEPSasSecondaryRAT: "NRrestrictioninEPSasSecondaryRAT", + IDUnlicensedSpectrumRestriction: "UnlicensedSpectrumRestriction", + IDCNTypeRestrictions: "CNTypeRestrictions", + IDNRrestrictionin5GS: "NRrestrictionin5GS", + IDLastNGRANPLMNIdentity: "LastNG-RANPLMNIdentity", + IDRATRestrictions: "RAT-Restrictions", + IDPSCellInformation: "PSCellInformation", + IDLTENTNTAIInformation: "LTE-NTN-TAI-Information", + IDRequestTypeAdditionalInfo: "RequestTypeAdditionalInfo", + IDDAPSRequestInfo: "DAPSRequestInfo", + IDSourceTransportLayerAddress: "SourceTransportLayerAddress", + IDSourceNodeTransportLayerAddress: "SourceNodeTransportLayerAddress", + IDTimeUEStayedInCellEnhancedGranularity: "Time-UE-StayedInCell-EnhancedGranularity", + IDHOCause: "HO-Cause", + IDLastVisitedPSCellList: "lastVisitedPSCellList", + IDMobilityInformation: "MobilityInformation", + IDUEHistoryInformationFromTheUE: "uE-HistoryInformationFromTheUE", + IDIMSvoiceEPSfallbackfrom5G: "IMSvoiceEPSfallbackfrom5G", + IDAdditionalRRMPriorityIndex: "AdditionalRRMPriorityIndex", + IDContextatSource: "ContextatSource", + IDIntersystemMeasurementConfiguration: "IntersystemMeasurementConfiguration", + IDSourceNodeID: "SourceNodeID", + IDEmergencyIndicator: "EmergencyIndicator", + IDUEContextReferenceatSourceeNB: "UEContextReferenceatSourceeNB", + IDSourceSNID: "SourceSNID", + IDTimeBasedHandoverInformation: "TimeBasedHandoverInformation", + IDRATType: "RAT-Type", + IDMDTConfigurationNR: "MDTConfigurationNR", + IDTraceCollectionEntityURI: "TraceCollectionEntityURI", + IDCoarseUELocationRequested: "CoarseUELocationRequested", + IDCoarseUELocation: "CoarseUELocation", + IDTimeRefDistribution: "TimeRefDistribution", + IDRequestedTNLInfo: "RequestedTNLInfo", + IDMDTConfiguration: "MDTConfiguration", + IDUEAppLayerMeasConfig: "UEAppLayerMeasConfig", + IDX2TNLConfigurationInfo: "x2TNLConfigurationInfo", + IDSynchronisationInformation: "Synchronisation-Information", + IDSONInformationReport: "SON-Information-Report", + IDNBIoTRLFReportContainer: "NB-IoT-RLF-Report-Container", + IDTimeSynchronisationInfo: "Time-Synchronisation-Info", + IDMutingPatternInformation: "Muting-Pattern-Information", + IDENBX2ExtendedTransportLayerAddresses: "eNBX2ExtendedTransportLayerAddresses", + IDENBIndirectX2TransportLayerAddresses: "eNBIndirectX2TransportLayerAddresses", + IDMutingAvailabilityIndication: "Muting-Availability-Indication", + IDTunnelInformationForBBF: "Tunnel-Information-for-BBF", + IDGWTransportLayerAddress: "GW-TransportLayerAddress", + IDSIPTOLGWTransportLayerAddress: "SIPTO-L-GW-TransportLayerAddress", + IDSourceID: "SourceID", + IDERABReleaseItem: "E-RABReleaseItem", + IDERABReleaseItemHOCmd: "E-RABReleaseItemHOCmd", + IDGERANtoLTEHOInformationRes: "GERANtoLTEHOInformationRes", + IDUTRANtoLTEHOInformationRes: "UTRANtoLTEHOInformationRes", + IDServedPLMNs: "ServedPLMNs", + IDCdma2000PDU: "cdma2000PDU", + IDCdma2000RATType: "cdma2000RATType", + IDCdma2000SectorID: "cdma2000SectorID", + IDCdma2000HOStatus: "cdma2000HOStatus", + IDCdma2000HORequiredIndication: "cdma2000HORequiredIndication", + IDBearersSubjectToStatusTransferItem: "Bearers-SubjectToStatusTransfer-Item", + IDCdma2000OneXRAND: "cdma2000OneXRAND", + IDCdma2000OneXSRVCCInfo: "cdma2000OneXSRVCCInfo", + IDERABFailedToBeReleasedList: "E-RABFailedToBeReleasedList", + IDSubscriberProfileIDforRFP: "SubscriberProfileIDforRFP", + IDCSFallbackIndicator: "CSFallbackIndicator", + IDInterSystemInformationTransferTypeEDT: "Inter-SystemInformationTransferTypeEDT", + IDInterSystemInformationTransferTypeMDT: "Inter-SystemInformationTransferTypeMDT", + IDSRVCCOperationPossible: "SRVCCOperationPossible", + IDSRVCCHOIndication: "SRVCCHOIndication", + IDNASDownlinkCount: "NAS-DownlinkCount", + IDCSGId: "CSG-Id", + IDCSGIdList: "CSG-IdList", + IDTraceCollectionEntityIPAddress: "TraceCollectionEntityIPAddress", + IDMSClassmark2: "MSClassmark2", + IDMSClassmark3: "MSClassmark3", + IDSourceToTargetTransparentContainerSecondary: "Source-ToTarget-TransparentContainer-Secondary", + IDTargetToSourceTransparentContainerSecondary: "Target-ToSource-TransparentContainer-Secondary", + IDEUTRANRoundTripDelayEstimationInfo: "EUTRANRoundTripDelayEstimationInfo", + IDCellAccessMode: "CellAccessMode", + IDCSGMembershipStatus: "CSGMembershipStatus", + IDPSServiceNotAvailable: "PS-ServiceNotAvailable", + IDRegisteredLAI: "RegisteredLAI", + IDRelayNodeIndicator: "RelayNode-Indicator", + IDMMERelaySupportIndicator: "MMERelaySupportIndicator", + IDManagementBasedMDTAllowed: "ManagementBasedMDTAllowed", + IDPrivacyIndicator: "PrivacyIndicator", + IDVoiceSupportMatchIndicator: "VoiceSupportMatchIndicator", + IDM3Configuration: "M3Configuration", + IDM4Configuration: "M4Configuration", + IDM5Configuration: "M5Configuration", + IDMDTLocationInfo: "MDT-Location-Info", + IDManagementBasedMDTPLMNList: "ManagementBasedMDTPLMNList", + IDSignallingBasedMDTPLMNList: "SignallingBasedMDTPLMNList", + IDULCOUNTValueExtended: "ULCOUNTValueExtended", + IDDLCOUNTValueExtended: "DLCOUNTValueExtended", + IDReceiveStatusOfULPDCPSDUsExtended: "ReceiveStatusOfULPDCPSDUsExtended", + IDLHNID: "LHN-ID", + IDAdditionalCSFallbackIndicator: "AdditionalCSFallbackIndicator", + IDMaskedIMEISV: "Masked-IMEISV", + IDProSeAuthorized: "ProSeAuthorized", + IDExpectedUEBehaviour: "ExpectedUEBehaviour", + IDLoggedMBSFNMDT: "LoggedMBSFNMDT", + IDAssistanceDataForPaging: "AssistanceDataForPaging", + IDCellIdentifierAndCELevelForCECapableUEs: "CellIdentifierAndCELevelForCECapableUEs", + IDInformationOnRecommendedCellsAndENBsForPaging: "InformationOnRecommendedCellsAndENBsForPaging", + IDRecommendedCellItem: "RecommendedCellItem", + IDRecommendedENBItem: "RecommendedENBItem", + IDProSeUEtoNetworkRelaying: "ProSeUEtoNetworkRelaying", + IDULCOUNTValuePDCPSNlength18: "ULCOUNTValuePDCP-SNlength18", + IDDLCOUNTValuePDCPSNlength18: "DLCOUNTValuePDCP-SNlength18", + IDReceiveStatusOfULPDCPSDUsPDCPSNlength18: "ReceiveStatusOfULPDCPSDUsPDCP-SNlength18", + IDM6Configuration: "M6Configuration", + IDM7Configuration: "M7Configuration", + IDCSGMembershipInfo: "CSGMembershipInfo", + IDPagingeDRXInformation: "Paging-eDRXInformation", + IDExtendedUEIdentityIndexValue: "extended-UEIdentityIndexValue", + IDNBIoTDefaultPagingDRX: "NB-IoT-DefaultPagingDRX", + IDERABFailedToResumeListResumeReq: "E-RABFailedToResumeListResumeReq", + IDERABFailedToResumeItemResumeReq: "E-RABFailedToResumeItemResumeReq", + IDERABFailedToResumeListResumeRes: "E-RABFailedToResumeListResumeRes", + IDERABFailedToResumeItemResumeRes: "E-RABFailedToResumeItemResumeRes", + IDNBIoTPagingeDRXInformation: "NB-IoT-Paging-eDRXInformation", + IDV2XServicesAuthorized: "V2XServicesAuthorized", + IDUEUserPlaneCIoTSupportIndicator: "UEUserPlaneCIoTSupportIndicator", + IDCEmodeBSupportIndicator: "CE-mode-B-SupportIndicator", + IDSRVCCOperationNotPossible: "SRVCCOperationNotPossible", + IDNBIoTUEIdentityIndexValue: "NB-IoT-UEIdentityIndexValue", + IDRRCResumeCause: "RRC-Resume-Cause", + IDDCNID: "DCN-ID", + IDServedDCNs: "ServedDCNs", + IDUESidelinkAggregateMaximumBitrate: "UESidelinkAggregateMaximumBitrate", + IDDLNASPDUDeliveryAckRequest: "DLNASPDUDeliveryAckRequest", + IDCoverageLevel: "Coverage-Level", + IDEnhancedCoverageRestricted: "EnhancedCoverageRestricted", + IDUELevelQoSParameters: "UE-Level-QoS-Parameters", + IDDLCPSecurityInformation: "DL-CP-SecurityInformation", + IDULCPSecurityInformation: "UL-CP-SecurityInformation", + IDUEApplicationLayerMeasurementCapability: "UE-Application-Layer-Measurement-Capability", + IDSecondaryRATDataUsageReportList: "SecondaryRATDataUsageReportList", + IDSecondaryRATDataUsageReportItem: "SecondaryRATDataUsageReportItem", + IDHandoverFlag: "HandoverFlag", + IDERABUsageReportItem: "E-RABUsageReportItem", + IDSecondaryRATDataUsageRequest: "SecondaryRATDataUsageRequest", + IDNRUESecurityCapabilities: "NRUESecurityCapabilities", + IDCEModeBRestricted: "CE-ModeBRestricted", + IDLTEMIndication: "LTE-M-Indication", + IDUECapabilityInfoRequest: "UECapabilityInfoRequest", + IDServiceType: "serviceType", + IDAerialUEsubscriptionInformation: "AerialUEsubscriptionInformation", + IDSubscriptionBasedUEDifferentiationInfo: "Subscription-Based-UE-DifferentiationInfo", + IDEndIndication: "EndIndication", + IDEDTSession: "EDT-Session", + IDPendingDataIndication: "PendingDataIndication", + IDBluetoothMeasurementConfiguration: "BluetoothMeasurementConfiguration", + IDWLANMeasurementConfiguration: "WLANMeasurementConfiguration", + IDConnectedengNBList: "ConnectedengNBList", + IDConnectedengNBToAddList: "ConnectedengNBToAddList", + IDConnectedengNBToRemoveList: "ConnectedengNBToRemoveList", + IDENDCSONConfigurationTransferECT: "EN-DCSONConfigurationTransfer-ECT", //nolint:misspell + IDENDCSONConfigurationTransferMCT: "EN-DCSONConfigurationTransfer-MCT", + IDTimeSinceSecondaryNodeRelease: "TimeSinceSecondaryNodeRelease", + IDIABAuthorized: "IAB-Authorized", + IDIABNodeIndication: "IAB-Node-Indication", + IDIABSupported: "IAB-Supported", + IDDataSize: "DataSize", + IDNRV2XServicesAuthorized: "NRV2XServicesAuthorized", + IDNRUESidelinkAggregateMaximumBitrate: "NRUESidelinkAggregateMaximumBitrate", + IDPC5QoSParameters: "PC5QoSParameters", + IDIntersystemSONConfigurationTransferMCT: "IntersystemSONConfigurationTransferMCT", + IDIntersystemSONConfigurationTransferECT: "IntersystemSONConfigurationTransferECT", + IDUERadioCapabilityID: "UERadioCapabilityID", + IDUERadioCapabilityNRFormat: "UERadioCapability-NR-Format", + IDDAPSResponseInfoList: "DAPSResponseInfoList", + IDDAPSResponseInfoItem: "DAPSResponseInfoItem", + IDNotifySourceeNB: "NotifySourceeNB", + IDENBEarlyStatusTransferTransparentContainer: "eNB-EarlyStatusTransfer-TransparentContainer", + IDBearersSubjectToEarlyStatusTransferItem: "Bearers-SubjectToEarlyStatusTransfer-Item", + IDWUSAssistanceInformation: "WUS-Assistance-Information", + IDNBIoTPagingDRX: "NB-IoT-PagingDRX", + IDUERadioCapabilityForPagingNRFormat: "UERadioCapabilityForPaging-NR-Format", + IDRACSIndication: "RACSIndication", + IDPagingCause: "PagingCause", + IDSecurityResult: "SecurityResult", + IDERABSecurityResultItem: "E-RABSecurityResultItem", + IDERABSecurityResultList: "E-RABSecurityResultList", + IDERABToBeUpdatedList: "E-RABToBeUpdatedList", + IDERABToBeUpdatedItem: "E-RABToBeUpdatedItem", + IDLoggedMDTTrigger: "LoggedMDTTrigger", + IDSensorMeasurementConfiguration: "SensorMeasurementConfiguration", + IDM4ReportAmount: "M4ReportAmount", + IDM5ReportAmount: "M5ReportAmount", + IDM6ReportAmount: "M6ReportAmount", + IDM7ReportAmount: "M7ReportAmount", + IDBearersSubjectToDLDiscardingItem: "Bearers-SubjectToDLDiscarding-Item", + IDBearersSubjectToDLDiscardingList: "Bearers-SubjectToDLDiscardingList", } // ProtocolIEIDName returns the TS 36.413 name of id, and whether it is known. diff --git a/s1ap/ie_pws.go b/s1ap/ie_pws.go index eac6c1b88b..92f4e40984 100644 --- a/s1ap/ie_pws.go +++ b/s1ap/ie_pws.go @@ -166,40 +166,10 @@ type ConcurrentWarningMessageIndicator uint8 const ConcurrentWarningMessageIndicatorTrue ConcurrentWarningMessageIndicator = 0 -func (c ConcurrentWarningMessageIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { - return per.EncodeEnumerated(w, enc, 1, false, int64(c)) -} - -func (c *ConcurrentWarningMessageIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := per.DecodeEnumerated(r, enc, 1, false) - if err != nil { - return err - } - - *c = ConcurrentWarningMessageIndicator(v) - - return nil -} - type KillAllWarningMessages uint8 const KillAllWarningMessagesTrue KillAllWarningMessages = 0 -func (k KillAllWarningMessages) MarshalPER(w *per.Writer, enc per.Encoding) error { - return per.EncodeEnumerated(w, enc, 1, false, int64(k)) -} - -func (k *KillAllWarningMessages) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := per.DecodeEnumerated(r, enc, 1, false) - if err != nil { - return err - } - - *k = KillAllWarningMessages(v) - - return nil -} - type CellIDBroadcastItem struct { extensions per.ExtensionAdditions `per:",extraw"` ECGI EUTRANCGI diff --git a/s1ap/ie_table.go b/s1ap/ie_table.go index 0baa5d33b5..c9947cdcdf 100644 --- a/s1ap/ie_table.go +++ b/s1ap/ie_table.go @@ -9,27 +9,30 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // One row of a message's TS 36.413 §9.1 IE table. -type ieSpec[M any] = ap.IESpec[ProtocolIEID, M] +type ieSpec[M any] = apimpl.IESpec[ProtocolIEID, M] const ( - presenceOptional = ap.PresenceOptional - presenceConditional = ap.PresenceConditional - presenceMandatory = ap.PresenceMandatory + presenceOptional = apimpl.PresenceOptional + presenceConditional = apimpl.PresenceConditional + presenceMandatory = apimpl.PresenceMandatory ) type messageMeta struct { - ap.Message[ProtocolIEID] + apimpl.Message[ProtocolIEID] } -type extensionMeta = ap.Preserved[ProtocolIEID] +type extensionMeta = apimpl.Preserved[ProtocolIEID] type SingleContainer = ap.SingleContainer[ProtocolIEID] func (u *messageMeta) meta() *messageMeta { return u } +func (u *messageMeta) appendUnknown(f RawIE) { apimpl.MessagePreserved(&u.Message).Append(f) } + func (u messageMeta) Diagnostics() Diagnostics { return Diagnostics{u.Message.Diagnostics()} } type message interface { @@ -41,11 +44,7 @@ func encodeMessageBody[M any, PM interface { message }](w *per.Writer, enc per.Encoding, procedure ProcedureCode, table []ieSpec[M], m PM, ) error { - if err := ap.EncodeMessage(profile, w, enc, table, (*M)(m), &m.meta().Message); err != nil { - return fmt.Errorf("s1ap: %s: %w", procedure, err) - } - - return nil + return apimpl.EncodeMessageBody(profile, w, enc, procedure, table, (*M)(m), &m.meta().Message) } func decodeMessageBody[M any, PM interface { @@ -55,8 +54,8 @@ func decodeMessageBody[M any, PM interface { ) (PM, error) { m := PM(new(M)) - if err := ap.DecodeMessage(profile, table, value, (*M)(m), &m.meta().Message); err != nil { - return nil, &TransferSyntaxError{Protocol: profile.Name, Procedure: procedure, Err: err} + if err := apimpl.DecodeMessageBody(profile, procedure, table, value, (*M)(m), &m.meta().Message); err != nil { + return nil, err } return m, nil @@ -67,19 +66,16 @@ func parseMessageBody[M any, PM interface { message }](procedure ProcedureCode, trigger TriggeringMessage, table []ieSpec[M], value []byte, ) (PM, error) { - m, err := decodeMessageBody[M, PM](procedure, table, value) - if err != nil { - return nil, err - } + m := PM(new(M)) - if err := m.meta().Message.Diagnostics().Check(); err != nil { - return nil, newAbstractSyntaxError(procedure, trigger, err, table, value) + if err := apimpl.ParseMessageBody(profile, procedure, table, value, (*M)(m), &m.meta().Message); err != nil { + return nil, newAbstractSyntaxError(procedure, trigger, err) } return m, nil } -func newAbstractSyntaxError[M any](procedure ProcedureCode, trigger TriggeringMessage, err error, table []ieSpec[M], value []byte) error { +func newAbstractSyntaxError(procedure ProcedureCode, trigger TriggeringMessage, err error) error { var e *ap.AbstractSyntaxError[ProtocolIEID] if !errors.As(err, &e) { return err @@ -95,66 +91,19 @@ func newAbstractSyntaxError[M any](procedure ProcedureCode, trigger TriggeringMe Trigger: trigger, Cause: cause.Cause(), IEs: criticalityDiagnosticsItems(e.IEs), - decoded: modeledIEs(table, value), + decoded: e.Decoded, } } func criticalityDiagnosticsItems(ds []DiagnosticIE) []CriticalityDiagnosticsIEItem { - var out []CriticalityDiagnosticsIEItem - - for _, d := range ds { - if len(out) >= maxnoofErrors { - break - } - + return apimpl.DiagnosticItems(ds, maxnoofErrors, func(d DiagnosticIE, missing bool) CriticalityDiagnosticsIEItem { kind := TypeOfErrorNotUnderstood - if d.Kind == ap.KindMissing { + if missing { kind = TypeOfErrorMissing } - out = append(out, CriticalityDiagnosticsIEItem{IECriticality: d.Criticality, IEID: d.ID, TypeOfError: kind}) - } - - return out -} - -func modeledIEs[M any](table []ieSpec[M], value []byte) []RawIE { - r := per.NewReader(value) - - if _, err := r.ReadBit(); err != nil { - return nil - } - - fields, err := decodeIEContainer(r, per.Aligned) - if err != nil { - return nil - } - - var out []RawIE - - seen := make(map[ProtocolIEID]bool, len(table)) - - for _, f := range fields { - if seen[f.ID] || !inTable(table, f.ID) { - continue - } - - seen[f.ID] = true - - out = append(out, f) - } - - return out -} - -func inTable[M any](table []ieSpec[M], id ProtocolIEID) bool { - for i := range table { - if table[i].ID == id { - return true - } - } - - return false + return CriticalityDiagnosticsIEItem{IECriticality: d.Criticality, IEID: d.ID, TypeOfError: kind} + }) } func decodeValue[T any, PT interface { @@ -162,9 +111,8 @@ func decodeValue[T any, PT interface { per.Unmarshaler }](what string, b []byte, ) (PT, error) { - v := PT(new(T)) - - if err := v.UnmarshalPER(per.NewReader(b), per.Aligned); err != nil { + v, err := apimpl.DecodeTransfer[ProtocolIEID, T, PT](b) + if err != nil { return nil, fmt.Errorf("s1ap: %s: %w", what, err) } @@ -176,12 +124,8 @@ func parseValue[T any, PT interface { per.Unmarshaler }](what string, b []byte, ) (PT, error) { - v, err := decodeValue[T, PT](what, b) + v, err := apimpl.ParseTransfer[ProtocolIEID, T, PT](b) if err != nil { - return nil, err - } - - if err := diagnosticsOf(v).Check(); err != nil { return nil, fmt.Errorf("s1ap: %s: %w", what, err) } @@ -189,10 +133,5 @@ func parseValue[T any, PT interface { } func diagnosticsOf(v any) Diagnostics { - dv, ok := v.(ap.Diagnosable[ProtocolIEID]) - if !ok { - return Diagnostics{} - } - - return Diagnostics{ap.Diagnose(dv)} + return Diagnostics{apimpl.DiagnosticsOf[ProtocolIEID](v)} } diff --git a/s1ap/ies.go b/s1ap/ies.go index 75fa430c14..5b3deab245 100644 --- a/s1ap/ies.go +++ b/s1ap/ies.go @@ -4,10 +4,9 @@ package s1ap import ( - "fmt" - "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // Container size bounds (TS 36.413, S1AP-Constants). @@ -16,7 +15,7 @@ const ( maxProtocolExtensions = 65535 ) -var profile = &ap.Profile{ +var profile = &apimpl.Profile{ Name: "s1ap", MaxProtocolIEs: maxProtocolIEs, MaxProtocolExtensions: maxProtocolExtensions, @@ -25,7 +24,7 @@ var profile = &ap.Profile{ IEName: func(id uint16) string { return ProtocolIEID(id).String() }, } -type ieField = ap.FieldValue[ProtocolIEID] +type ieField = apimpl.FieldValue[ProtocolIEID] type rawIE = ap.Field[ProtocolIEID] @@ -33,7 +32,7 @@ type rawIE = ap.Field[ProtocolIEID] type RawIE = ap.Field[ProtocolIEID] func encodeContainerField(w *per.Writer, enc per.Encoding, f ieField) error { - return ap.EncodeField(profile, w, enc, f) + return apimpl.EncodeField(profile, w, enc, f) } func decodeIE(r *per.Reader, u per.Unmarshaler) error { @@ -49,138 +48,82 @@ func restOctets(r *per.Reader) []byte { // maxnoofERABs bounds the E-RAB SEQUENCE-OF lists (TS 36.413). const maxnoofERABs = 256 +type containerCrit = apimpl.ListItem[ProtocolIEID] + +type containerItem interface { + ForeignIEs() []RawIE +} + // ub is each list's own ASN.1 SIZE bound; that today's lists share 256 is // coincidental. // //nolint:unparam -type containerCrit struct { - crit ap.WireCriticality -} - -func (c *containerCrit) wireCriticality() *containerCrit { return c } - -type containerCritical interface { - wireCriticality() *containerCrit -} - -func encodeSingleContainerList[T any](w *per.Writer, enc per.Encoding, ub int64, id ProtocolIEID, crit Criticality, items []T) error { - if len(items) < 1 || int64(len(items)) > ub { - return fmt.Errorf("s1ap: single-container list length %d outside [1, %d]", len(items), ub) - } - - off := 0 - - return per.EncodeLength(w, enc, 1, ub, true, int64(len(items)), func(count int64) error { - end := off + int(count) - for i := off; i < end; i++ { - m, ok := any(&items[i]).(per.Marshaler) - if !ok { - return fmt.Errorf("s1ap: %T does not implement per.Marshaler", items[i]) - } - - c := crit - if h, ok := any(&items[i]).(containerCritical); ok { - c = h.wireCriticality().crit.Of(crit) - } - - if err := encodeContainerField(w, enc, ieField{ID: id, Criticality: c, Value: m}); err != nil { - return err - } - } - - off = end - - return nil - }) +func encodeSingleContainerList[T any, PT interface { + *T + containerItem +}](w *per.Writer, enc per.Encoding, ub int64, id ProtocolIEID, crit Criticality, items []T, +) error { + return apimpl.EncodeItemList(profile, w, enc, ub, id, crit, items) } // Each item is its own open type, so each gets a fresh reader. // //nolint:unparam -func decodeItemList[T any](r *per.Reader, enc per.Encoding, ub int64, itemID ProtocolIEID, crit Criticality) ([]T, error) { - var items []T - - err := per.DecodeLength(r, enc, 1, ub, true, func(count int64) error { - for i := int64(0); i < count; i++ { - id, err := per.DecodeConstrainedWholeNumber(r, enc, 0, maxProtocolIEs) - if err != nil { - return err - } - - if ProtocolIEID(id) != itemID { - return fmt.Errorf("s1ap: list item %d has IE id %d, want %d", i, id, itemID) - } - - c, err := per.DecodeEnumerated(r, enc, criticalityRootCount, false) - if err != nil { - return err - } - - val, err := per.DecodeOpenTypeBytes(r, enc) - if err != nil { - return err - } - - var item T - - u, ok := any(&item).(per.Unmarshaler) - if !ok { - return fmt.Errorf("s1ap: %T does not implement per.Unmarshaler", item) - } - - if err := u.UnmarshalPER(per.NewReader(val), enc); err != nil { - return err - } - - if h, ok := any(&item).(containerCritical); ok { - h.wireCriticality().crit = ap.Wire(Criticality(c), crit) - } - - items = append(items, item) - } - - return nil - }) - if err != nil { - return nil, err - } +func decodeItemList[T any, PT interface { + *T + containerItem +}](r *per.Reader, enc per.Encoding, ub int64, itemID ProtocolIEID, crit Criticality, +) ([]T, error) { + return apimpl.DecodeItemList[ProtocolIEID, T](profile, r, enc, ub, itemID, crit) +} - return items, nil +func diagnoseItemList[L ~[]T, T any](d *ap.Diagnosis[ProtocolIEID], id ProtocolIEID, crit Criticality, l *L) bool { + items := []T(*l) + notComprehended := apimpl.DiagnoseItemList(d, id, crit, &items) + *l = L(items) + + return notComprehended } // Keeps every field, including ids the caller does not model. // //nolint:unparam func decodeIEContainer(r *per.Reader, enc per.Encoding) ([]rawIE, error) { - return ap.DecodeIEContainer[ProtocolIEID](profile, r, enc) + return apimpl.DecodeIEContainer[ProtocolIEID](profile, r, enc) } func perIEDecode(b []byte, u per.Unmarshaler) error { - return u.UnmarshalPER(per.NewReader(b), per.Aligned) + return apimpl.DecodeValue(b, u) } -type itemList[T any] struct { +type itemList[L ~[]T, T any] struct { lb, ub int64 id ProtocolIEID crit Criticality - items []T + items *L single bool } -func containerList[T any](ub int64, id ProtocolIEID, crit Criticality, items []T) itemList[T] { - return itemList[T]{ub: ub, id: id, crit: crit, items: items, single: true} +func containerList[L ~[]T, T any](ub int64, id ProtocolIEID, crit Criticality, items *L) itemList[L, T] { + return itemList[L, T]{ub: ub, id: id, crit: crit, items: items, single: true} } -func seqOf[T any](lb, ub int64, items []T) itemList[T] { - return itemList[T]{lb: lb, ub: ub, items: items} +func seqOf[L ~[]T, T any](lb, ub int64, items *L) itemList[L, T] { + return itemList[L, T]{lb: lb, ub: ub, items: items} } -func (l itemList[T]) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (l itemList[L, T]) MarshalPER(w *per.Writer, enc per.Encoding) error { if l.single { - return encodeSingleContainerList(w, enc, l.ub, l.id, l.crit, l.items) + return apimpl.EncodeItemList(profile, w, enc, l.ub, l.id, l.crit, []T(*l.items)) } - return marshalSeqOf(w, enc, l.lb, l.ub, l.items) + return marshalSeqOf(w, enc, l.lb, l.ub, []T(*l.items)) } -func (l itemList[T]) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return diagnoseItems(d, l.items) } +func (l itemList[L, T]) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + if l.single { + return diagnoseItemList(d, l.id, l.crit, l.items) + } + + return diagnoseItems(d, []T(*l.items)) +} diff --git a/s1ap/ies_test.go b/s1ap/ies_test.go index ddd4e3c236..5ea3d167db 100644 --- a/s1ap/ies_test.go +++ b/s1ap/ies_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func TestEncodeIEContainerKnownVector(t *testing.T) { @@ -17,7 +17,7 @@ func TestEncodeIEContainerKnownVector(t *testing.T) { err := encodeIEContainer(w, per.Aligned, []ieField{{ ID: 59, Criticality: CriticalityIgnore, - Value: ap.RawValue([]byte{0xab, 0xcd}), + Value: apimpl.RawValue([]byte{0xab, 0xcd}), }}) if err != nil { t.Fatal(err) @@ -54,8 +54,8 @@ func TestEmptyIEContainer(t *testing.T) { func TestIEContainerRoundTrip(t *testing.T) { in := []ieField{ - {ID: 59, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x01, 0x02, 0x03})}, - {ID: 1, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xff})}, + {ID: 59, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x01, 0x02, 0x03})}, + {ID: 1, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0xff})}, {ID: 65535, Criticality: CriticalityNotify, Value: per.MarshalerFunc(func(*per.Writer, per.Encoding) error { return nil })}, } @@ -89,8 +89,8 @@ func TestIEContainerRoundTrip(t *testing.T) { func TestRawIEReencodePreserves(t *testing.T) { // A container decoded and re-encoded from preserved raw IEs is byte-identical. original := []ieField{ - {ID: 10, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0xde, 0xad})}, - {ID: 20, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xbe, 0xef, 0x00})}, + {ID: 10, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0xde, 0xad})}, + {ID: 20, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0xbe, 0xef, 0x00})}, } w1 := per.NewWriter() diff --git a/s1ap/initial_context_setup.go b/s1ap/initial_context_setup.go index 1426200378..ca9456eb7c 100644 --- a/s1ap/initial_context_setup.go +++ b/s1ap/initial_context_setup.go @@ -5,21 +5,50 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.4.1. type InitialContextSetupRequest struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - UEAggregateMaximumBitRate UEAggregateMaximumBitRate - ERABToBeSetup ERABToBeSetupListCtxtSUReq - UESecurityCapabilities UESecurityCapabilities - SecurityKey SecurityKey - UERadioCapability UERadioCapability - GUMMEI *GUMMEI - MMEUES1APID2 *MMEUES1APID - CoarseUELocation *CoarseUELocation - TimeRefDistribution *TimeRefDistribution + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + UEAggregateMaximumBitRate UEAggregateMaximumBitRate + ERABToBeSetup ERABToBeSetupListCtxtSUReq + UESecurityCapabilities UESecurityCapabilities + SecurityKey SecurityKey + UERadioCapability UERadioCapability + GUMMEI *GUMMEI + MMEUES1APID2 *MMEUES1APID + CoarseUELocation *CoarseUELocation + TimeRefDistribution *TimeRefDistribution + TraceActivation *TraceActivation + HandoverRestrictionList *HandoverRestrictionList + SubscriberProfileIDforRFP *SubscriberProfileIDforRFP + CSFallbackIndicator *CSFallbackIndicator + SRVCCOperationPossible *SRVCCOperationPossible + CSGMembershipStatus *CSGMembershipStatus + RegisteredLAI *LAI + ManagementBasedMDTAllowed *ManagementBasedMDTAllowed + ManagementBasedMDTPLMNList MDTPLMNList + AdditionalCSFallbackIndicator *AdditionalCSFallbackIndicator + MaskedIMEISV *MaskedIMEISV + ExpectedUEBehaviour *ExpectedUEBehaviour + ProSeAuthorized *ProSeAuthorized + UEUserPlaneCIoTSupportIndicator *UEUserPlaneCIoTSupportIndicator + V2XServicesAuthorized *V2XServicesAuthorized + UESidelinkAggregateMaximumBitrate *UESidelinkAggregateMaximumBitrate + EnhancedCoverageRestricted *EnhancedCoverageRestricted + NRUESecurityCapabilities *NRUESecurityCapabilities + CEModeBRestricted *CEModeBRestricted + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + PendingDataIndication *PendingDataIndication + SubscriptionBasedUEDifferentiationInfo *SubscriptionBasedUEDifferentiationInfo + AdditionalRRMPriorityIndex *AdditionalRRMPriorityIndex + IABAuthorized *IABAuthorized + NRV2XServicesAuthorized *NRV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + UERadioCapabilityID *UERadioCapabilityID messageMeta } @@ -56,7 +85,7 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return err }, Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { - return containerList(maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject, m.ERABToBeSetup), true + return containerList(maxnoofERABs, IDERABToBeSetupItemCtxtSUReq, CriticalityReject, &m.ERABToBeSetup), true }, }, { @@ -73,6 +102,8 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ }, Encode: func(m *InitialContextSetupRequest) (per.Marshaler, bool) { return &m.SecurityKey, true }, }, + apimpl.OptionalIE(IDTraceActivation, CriticalityIgnore, func(m *InitialContextSetupRequest) **TraceActivation { return &m.TraceActivation }), + apimpl.OptionalIE(IDHandoverRestrictionList, CriticalityIgnore, func(m *InitialContextSetupRequest) **HandoverRestrictionList { return &m.HandoverRestrictionList }), { ID: IDUERadioCapability, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { @@ -86,6 +117,11 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.UERadioCapability, true }, }, + apimpl.OptionalIE(IDSubscriberProfileIDforRFP, CriticalityIgnore, func(m *InitialContextSetupRequest) **SubscriberProfileIDforRFP { return &m.SubscriberProfileIDforRFP }), + apimpl.OptionalIE(IDCSFallbackIndicator, CriticalityReject, func(m *InitialContextSetupRequest) **CSFallbackIndicator { return &m.CSFallbackIndicator }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *InitialContextSetupRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDCSGMembershipStatus, CriticalityIgnore, func(m *InitialContextSetupRequest) **CSGMembershipStatus { return &m.CSGMembershipStatus }), + apimpl.OptionalIE(IDRegisteredLAI, CriticalityIgnore, func(m *InitialContextSetupRequest) **LAI { return &m.RegisteredLAI }), { ID: IDGUMMEI, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { @@ -128,6 +164,39 @@ var initialContextSetupRequestIEs = []ieSpec[InitialContextSetupRequest]{ return m.MMEUES1APID2, true }, }, + apimpl.OptionalIE(IDManagementBasedMDTAllowed, CriticalityIgnore, func(m *InitialContextSetupRequest) **ManagementBasedMDTAllowed { return &m.ManagementBasedMDTAllowed }), + apimpl.ListIE(IDManagementBasedMDTPLMNList, CriticalityIgnore, func(m *InitialContextSetupRequest) *MDTPLMNList { return &m.ManagementBasedMDTPLMNList }), + apimpl.ConditionalIE(IDAdditionalCSFallbackIndicator, CriticalityIgnore, initialContextSetupCSFBHighPriority, func(m *InitialContextSetupRequest) **AdditionalCSFallbackIndicator { + return &m.AdditionalCSFallbackIndicator + }), + apimpl.OptionalIE(IDMaskedIMEISV, CriticalityIgnore, func(m *InitialContextSetupRequest) **MaskedIMEISV { return &m.MaskedIMEISV }), + apimpl.OptionalIE(IDExpectedUEBehaviour, CriticalityIgnore, func(m *InitialContextSetupRequest) **ExpectedUEBehaviour { return &m.ExpectedUEBehaviour }), + apimpl.OptionalIE(IDProSeAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **ProSeAuthorized { return &m.ProSeAuthorized }), + apimpl.OptionalIE(IDUEUserPlaneCIoTSupportIndicator, CriticalityIgnore, func(m *InitialContextSetupRequest) **UEUserPlaneCIoTSupportIndicator { + return &m.UEUserPlaneCIoTSupportIndicator + }), + apimpl.OptionalIE(IDV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **V2XServicesAuthorized { return &m.V2XServicesAuthorized }), + apimpl.OptionalIE(IDUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **UESidelinkAggregateMaximumBitrate { + return &m.UESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDEnhancedCoverageRestricted, CriticalityIgnore, func(m *InitialContextSetupRequest) **EnhancedCoverageRestricted { return &m.EnhancedCoverageRestricted }), + apimpl.OptionalIE(IDNRUESecurityCapabilities, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESecurityCapabilities { return &m.NRUESecurityCapabilities }), + apimpl.OptionalIE(IDCEModeBRestricted, CriticalityIgnore, func(m *InitialContextSetupRequest) **CEModeBRestricted { return &m.CEModeBRestricted }), + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *InitialContextSetupRequest) **AerialUEsubscriptionInformation { + return &m.AerialUEsubscriptionInformation + }), + apimpl.OptionalIE(IDPendingDataIndication, CriticalityIgnore, func(m *InitialContextSetupRequest) **PendingDataIndication { return &m.PendingDataIndication }), + apimpl.OptionalIE(IDSubscriptionBasedUEDifferentiationInfo, CriticalityIgnore, func(m *InitialContextSetupRequest) **SubscriptionBasedUEDifferentiationInfo { + return &m.SubscriptionBasedUEDifferentiationInfo + }), + apimpl.OptionalIE(IDAdditionalRRMPriorityIndex, CriticalityIgnore, func(m *InitialContextSetupRequest) **AdditionalRRMPriorityIndex { return &m.AdditionalRRMPriorityIndex }), + apimpl.OptionalIE(IDIABAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **IABAuthorized { return &m.IABAuthorized }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *InitialContextSetupRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *InitialContextSetupRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *InitialContextSetupRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), { ID: IDCoarseUELocation, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialContextSetupRequest, r *per.Reader, enc per.Encoding) error { @@ -240,7 +309,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore, m.ERABSetup), true + return containerList(maxnoofERABs, IDERABSetupItemCtxtSURes, CriticalityIgnore, &m.ERABSetup), true }, }, { @@ -257,7 +326,7 @@ var initialContextSetupResponseIEs = []ieSpec[InitialContextSetupResponse]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABFailedToSetup), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABFailedToSetup), true }, }, { @@ -435,3 +504,7 @@ func ParseInitialContextSetupFailure(value []byte) (*InitialContextSetupFailure, func DecodeInitialContextSetupFailure(value []byte) (*InitialContextSetupFailure, error) { return decodeMessageBody[InitialContextSetupFailure](ProcInitialContextSetup, initialContextSetupFailureIEs, value) } + +func initialContextSetupCSFBHighPriority(m *InitialContextSetupRequest) bool { + return m.CSFallbackIndicator != nil && *m.CSFallbackIndicator == CSFallbackIndicatorCSFallbackHighPriority +} diff --git a/s1ap/initial_context_setup_test.go b/s1ap/initial_context_setup_test.go index 5c924e6763..b1306c98ea 100644 --- a/s1ap/initial_context_setup_test.go +++ b/s1ap/initial_context_setup_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // A real INITIAL CONTEXT SETUP RESPONSE: MME-UE-S1AP-ID 0x020000bf, @@ -120,7 +120,7 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { } if out.MMEUES1APID != in.MMEUES1APID || out.ENBUES1APID != in.ENBUES1APID || - out.UEAggregateMaximumBitRate != in.UEAggregateMaximumBitRate || + !out.UEAggregateMaximumBitRate.Equal(in.UEAggregateMaximumBitRate) || out.UESecurityCapabilities != in.UESecurityCapabilities || out.SecurityKey != in.SecurityKey || !bytes.Equal(out.UERadioCapability, in.UERadioCapability) || len(out.ERABToBeSetup) != 1 { t.Fatalf("scalar mismatch:\n in %+v\n out %+v", in, out) @@ -192,11 +192,11 @@ func TestInitialContextSetupRoundTrips(t *testing.T) { // MME cannot set up a context without them. func TestInitialContextSetupRequestMissingRejectIE(t *testing.T) { partial := container(t, - ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, - ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(ENBUES1APID(2))))}, - ieField{ID: IDUEAggregateMaximumBitrate, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, &UEAggregateMaximumBitRate{}))}, - ieField{ID: IDUESecurityCapabilities, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, &UESecurityCapabilities{}))}, - ieField{ID: IDSecurityKey, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(SecurityKey{})))}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(ENBUES1APID(2))))}, + ieField{ID: IDUEAggregateMaximumBitrate, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, &UEAggregateMaximumBitRate{}))}, + ieField{ID: IDUESecurityCapabilities, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, &UESecurityCapabilities{}))}, + ieField{ID: IDSecurityKey, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(SecurityKey{})))}, ) // Without the E-RAB list the request is incomplete: it is mandatory and diff --git a/s1ap/item_list_foreign_test.go b/s1ap/item_list_foreign_test.go new file mode 100644 index 0000000000..472e57f7cc --- /dev/null +++ b/s1ap/item_list_foreign_test.go @@ -0,0 +1,185 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "bytes" + "slices" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" +) + +const idForeignListItem ProtocolIEID = 9999 + +func erabSetupResponseWithList(t *testing.T, fields []apimpl.FieldValue[ProtocolIEID]) []byte { + t.Helper() + + w := per.NewWriter() + + err := per.EncodeLength(w, per.Aligned, 1, maxnoofERABs, true, int64(len(fields)), func(int64) error { + for _, f := range fields { + if err := encodeContainerField(w, per.Aligned, f); err != nil { + return err + } + } + + return nil + }) + if err != nil { + t.Fatal(err) + } + + w.AlignToByte() + + b, err := (&ERABSetupResponse{ + MMEUES1APID: Ptr(MMEUES1APID(1)), + ENBUES1APID: Ptr(ENBUES1APID(2)), + ERABSetup: ERABSetupListBearerSURes{{ERABID: 1, TransportLayerAddress: goldTLA()}}, + }).Marshal() + if err != nil { + t.Fatal(err) + } + + raw, err := ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + i, err := raw.Index(IDERABSetupListBearerSURes) + if err != nil { + t.Fatal(err) + } + + if err := raw.SetValue(i, w.Bytes()); err != nil { + t.Fatal(err) + } + + out, err := raw.Marshal() + if err != nil { + t.Fatal(err) + } + + return out +} + +func setupItemField(id ERABID) apimpl.FieldValue[ProtocolIEID] { + return apimpl.FieldValue[ProtocolIEID]{ + ID: IDERABSetupItemBearerSURes, + Criticality: CriticalityIgnore, + Value: &ERABSetupItemBearerSURes{ERABID: id, TransportLayerAddress: goldTLA(), GTPTEID: GTPTEID(id)}, + } +} + +func foreignItemField(crit Criticality) apimpl.FieldValue[ProtocolIEID] { + return apimpl.FieldValue[ProtocolIEID]{ID: idForeignListItem, Criticality: crit, Value: apimpl.RawValue{0x01, 0x02}} +} + +func TestItemListWithForeignIEIsAnAbstractSyntaxError(t *testing.T) { + for _, c := range []struct { + name string + fields []apimpl.FieldValue[ProtocolIEID] + erabs []ERABID + crit Criticality + reject bool + }{ + {"ignore before item", []apimpl.FieldValue[ProtocolIEID]{foreignItemField(CriticalityIgnore), setupItemField(5)}, []ERABID{5}, CriticalityIgnore, false}, + {"notify between items", []apimpl.FieldValue[ProtocolIEID]{setupItemField(5), foreignItemField(CriticalityNotify), setupItemField(6)}, []ERABID{5, 6}, CriticalityNotify, false}, + {"reject after item", []apimpl.FieldValue[ProtocolIEID]{setupItemField(5), foreignItemField(CriticalityReject)}, []ERABID{5}, CriticalityReject, true}, + } { + t.Run(c.name, func(t *testing.T) { + b := erabSetupResponseWithList(t, c.fields) + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + m, err := DecodeERABSetupResponse(pdu.value()) + if err != nil { + t.Fatalf("decode: %v", err) + } + + var got []ERABID + for _, it := range m.ERABSetup { + got = append(got, it.ERABID) + } + + if !slices.Equal(got, c.erabs) { + t.Errorf("E-RABs = %v, want %v", got, c.erabs) + } + + want := DiagnosticIE{Path: []ProtocolIEID{IDERABSetupListBearerSURes}, ID: idForeignListItem, Criticality: c.crit, Kind: ap.KindNotComprehended} + + if ies := m.Diagnostics().IEs; len(ies) != 1 || ies[0].String() != want.String() { + t.Fatalf("diagnostics = %v, want %v", ies, want) + } + + re, err := m.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, b) { + t.Fatalf("re-encode = % x, want % x", re, b) + } + + if _, err := ParseERABSetupResponse(pdu.value()); (err != nil) != c.reject { + t.Fatalf("parse = %v, want reject %v", err, c.reject) + } + }) + } +} + +func TestItemListOfOnlyForeignIEsIsNotComprehended(t *testing.T) { + b := erabSetupResponseWithList(t, []apimpl.FieldValue[ProtocolIEID]{foreignItemField(CriticalityIgnore)}) + + pdu, err := Unmarshal(b) + if err != nil { + t.Fatal(err) + } + + m, err := DecodeERABSetupResponse(pdu.value()) + if err != nil { + t.Fatalf("decode: %v", err) + } + + if len(m.ERABSetup) != 1 || len(m.ERABSetup[0].ForeignIEs()) != 1 { + t.Errorf("ERABSetup = %+v, want the foreign IE kept in the list", m.ERABSetup) + } + + var kinds []string + for _, d := range m.Diagnostics().IEs { + kinds = append(kinds, d.String()) + } + + want := []string{ + DiagnosticIE{Path: []ProtocolIEID{IDERABSetupListBearerSURes}, ID: idForeignListItem, Criticality: CriticalityIgnore}.String(), + DiagnosticIE{ID: IDERABSetupListBearerSURes, Criticality: CriticalityIgnore}.String(), + } + + if !slices.Equal(kinds, want) { + t.Errorf("diagnostics = %v, want %v", kinds, want) + } + + re, err := m.Marshal() + if err != nil { + t.Fatal(err) + } + + if !bytes.Equal(re, b) { + t.Fatalf("re-encode = % x, want % x", re, b) + } + + parsed, err := ParseERABSetupResponse(pdu.value()) + if err != nil { + t.Fatal(err) + } + + if parsed.ERABSetup != nil { + t.Errorf("parsed ERABSetup = %+v, want the not comprehended list treated as not received", parsed.ERABSetup) + } +} diff --git a/s1ap/location_report.go b/s1ap/location_report.go index 9abf785684..e99530f068 100644 --- a/s1ap/location_report.go +++ b/s1ap/location_report.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // EventType ::= ENUMERATED { direct, change-of-serve-cell, stop-change-of-serve-cell, @@ -36,11 +37,13 @@ type RequestType struct { // TS 36.413 §9.1.12.3. type LocationReport struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - EUTRANCGI *EUTRANCGI - TAI *TAI - RequestType *RequestType + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + EUTRANCGI *EUTRANCGI + TAI *TAI + RequestType *RequestType + PSCellInformation *PSCellInformation + LTENTNTAIInformation *LTENTNTAIInformation messageMeta } @@ -123,6 +126,8 @@ var locationReportIEs = []ieSpec[LocationReport]{ return m.RequestType, true }, }, + apimpl.OptionalIE(IDPSCellInformation, CriticalityIgnore, func(m *LocationReport) **PSCellInformation { return &m.PSCellInformation }), + apimpl.OptionalIE(IDLTENTNTAIInformation, CriticalityIgnore, func(m *LocationReport) **LTENTNTAIInformation { return &m.LTENTNTAIInformation }), } func (m *LocationReport) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/location_report_test.go b/s1ap/location_report_test.go index 83eb061365..bbcd1c34dc 100644 --- a/s1ap/location_report_test.go +++ b/s1ap/location_report_test.go @@ -47,7 +47,7 @@ func TestLocationReportRoundTrip(t *testing.T) { t.Fatalf("location: cgi=%+v tai=%+v", out.EUTRANCGI, out.TAI) } - if deref(out.RequestType) != deref(in.RequestType) { + if !deref(out.RequestType).Equal(deref(in.RequestType)) { t.Fatalf("request type = %+v, want %+v", out.RequestType, in.RequestType) } } diff --git a/s1ap/lppa_transport_test.go b/s1ap/lppa_transport_test.go index b422256656..42c2296982 100644 --- a/s1ap/lppa_transport_test.go +++ b/s1ap/lppa_transport_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -161,7 +161,7 @@ func TestLPPaTransportUnknownIE(t *testing.T) { {ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ENBUES1APID(9)}, {ID: IDRoutingID, Criticality: CriticalityReject, Value: RoutingID(0)}, {ID: IDLPPaPDU, Criticality: CriticalityReject, Value: LPPaPDU{0x01}}, - {ID: 999, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xaa})}, + {ID: 999, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0xaa})}, } if err := encodeIEContainer(w, per.Aligned, fields); err != nil { diff --git a/s1ap/mme_config_update.go b/s1ap/mme_config_update.go index 176be2725a..ef89b28040 100644 --- a/s1ap/mme_config_update.go +++ b/s1ap/mme_config_update.go @@ -5,12 +5,14 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) type MMEConfigurationUpdate struct { MMEName *string ServedGUMMEIs ServedGUMMEIs RelativeMMECapacity *uint8 + ServedDCNs *ServedDCNs messageMeta } @@ -74,6 +76,7 @@ var mMEConfigurationUpdateIEs = []ieSpec[MMEConfigurationUpdate]{ }), true }, }, + apimpl.OptionalIE(IDServedDCNs, CriticalityIgnore, func(m *MMEConfigurationUpdate) **ServedDCNs { return &m.ServedDCNs }), } func (m *MMEConfigurationUpdate) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/nas_transport.go b/s1ap/nas_transport.go index 4707bb84cf..9a7c674e70 100644 --- a/s1ap/nas_transport.go +++ b/s1ap/nas_transport.go @@ -5,21 +5,36 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.7.1. type InitialUEMessage struct { - ENBUES1APID ENBUES1APID - NASPDU NASPDU - TAI TAI - EUTRANCGI *EUTRANCGI - RRCEstablishmentCause *RRCEstablishmentCause - STMSI *STMSI // present when the UE re-establishes with an S-TMSI - GUMMEI *GUMMEI // the eNB-selected MME, present when the eNB does not run NNSF - GWTransportLayerAddress *TransportLayerAddress - TunnelInformationForBBF *TunnelInformation - SIPTOLGWTransportLayerAddress *TransportLayerAddress - CoarseUELocationRequested *CoarseUELocationRequested + ENBUES1APID ENBUES1APID + NASPDU NASPDU + TAI TAI + EUTRANCGI *EUTRANCGI + RRCEstablishmentCause *RRCEstablishmentCause + STMSI *STMSI // present when the UE re-establishes with an S-TMSI + GUMMEI *GUMMEI // the eNB-selected MME, present when the eNB does not run NNSF + GWTransportLayerAddress *TransportLayerAddress + TunnelInformationForBBF *TunnelInformation + SIPTOLGWTransportLayerAddress *TransportLayerAddress + CoarseUELocationRequested *CoarseUELocationRequested + CSGId *CSGId + CellAccessMode *CellAccessMode + RelayNodeIndicator *RelayNodeIndicator + GUMMEIType *GUMMEIType + LHNID *LHNID + MMEGroupID *MMEGroupID + UEUsageType *UEUsageType + CEmodeBSupportIndicator *CEmodeBSupportIndicator + DCNID *DCNID + CoverageLevel *CoverageLevel + UEApplicationLayerMeasurementCapability *UEApplicationLayerMeasurementCapability + EDTSession *EDTSession + IABNodeIndication *IABNodeIndication + LTENTNTAIInformation *LTENTNTAIInformation messageMeta } @@ -119,6 +134,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return m.STMSI, true }, }, + apimpl.OptionalIE(IDCSGId, CriticalityReject, func(m *InitialUEMessage) **CSGId { return &m.CSGId }), { ID: IDGUMMEI, Presence: presenceOptional, Criticality: CriticalityReject, Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { @@ -144,6 +160,7 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ return m.GUMMEI, true }, }, + apimpl.OptionalIE(IDCellAccessMode, CriticalityReject, func(m *InitialUEMessage) **CellAccessMode { return &m.CellAccessMode }), { ID: IDGWTransportLayerAddress, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { @@ -151,6 +168,8 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return optionalIE(m.GWTransportLayerAddress) }, }, + apimpl.OptionalIE(IDRelayNodeIndicator, CriticalityReject, func(m *InitialUEMessage) **RelayNodeIndicator { return &m.RelayNodeIndicator }), + apimpl.OptionalIE(IDGUMMEIType, CriticalityIgnore, func(m *InitialUEMessage) **GUMMEIType { return &m.GUMMEIType }), { ID: IDTunnelInformationForBBF, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { @@ -165,6 +184,18 @@ var initialUEMessageIEs = []ieSpec[InitialUEMessage]{ }, Encode: func(m *InitialUEMessage) (per.Marshaler, bool) { return optionalIE(m.SIPTOLGWTransportLayerAddress) }, }, + apimpl.OptionalIE(IDLHNID, CriticalityIgnore, func(m *InitialUEMessage) **LHNID { return &m.LHNID }), + apimpl.OptionalIE(IDMMEGroupID, CriticalityIgnore, func(m *InitialUEMessage) **MMEGroupID { return &m.MMEGroupID }), + apimpl.OptionalIE(IDUEUsageType, CriticalityIgnore, func(m *InitialUEMessage) **UEUsageType { return &m.UEUsageType }), + apimpl.OptionalIE(IDCEmodeBSupportIndicator, CriticalityIgnore, func(m *InitialUEMessage) **CEmodeBSupportIndicator { return &m.CEmodeBSupportIndicator }), + apimpl.OptionalIE(IDDCNID, CriticalityIgnore, func(m *InitialUEMessage) **DCNID { return &m.DCNID }), + apimpl.OptionalIE(IDCoverageLevel, CriticalityIgnore, func(m *InitialUEMessage) **CoverageLevel { return &m.CoverageLevel }), + apimpl.OptionalIE(IDUEApplicationLayerMeasurementCapability, CriticalityIgnore, func(m *InitialUEMessage) **UEApplicationLayerMeasurementCapability { + return &m.UEApplicationLayerMeasurementCapability + }), + apimpl.OptionalIE(IDEDTSession, CriticalityIgnore, func(m *InitialUEMessage) **EDTSession { return &m.EDTSession }), + apimpl.OptionalIE(IDIABNodeIndication, CriticalityReject, func(m *InitialUEMessage) **IABNodeIndication { return &m.IABNodeIndication }), + apimpl.OptionalIE(IDLTENTNTAIInformation, CriticalityIgnore, func(m *InitialUEMessage) **LTENTNTAIInformation { return &m.LTENTNTAIInformation }), { ID: IDCoarseUELocationRequested, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *InitialUEMessage, r *per.Reader, enc per.Encoding) error { @@ -211,6 +242,9 @@ type UplinkNASTransport struct { TAI *TAI GWTransportLayerAddress *TransportLayerAddress SIPTOLGWTransportLayerAddress *TransportLayerAddress + LHNID *LHNID + PSCellInformation *PSCellInformation + LTENTNTAIInformation *LTENTNTAIInformation messageMeta } @@ -303,6 +337,9 @@ var uplinkNASTransportIEs = []ieSpec[UplinkNASTransport]{ }, Encode: func(m *UplinkNASTransport) (per.Marshaler, bool) { return optionalIE(m.SIPTOLGWTransportLayerAddress) }, }, + apimpl.OptionalIE(IDLHNID, CriticalityIgnore, func(m *UplinkNASTransport) **LHNID { return &m.LHNID }), + apimpl.OptionalIE(IDPSCellInformation, CriticalityIgnore, func(m *UplinkNASTransport) **PSCellInformation { return &m.PSCellInformation }), + apimpl.OptionalIE(IDLTENTNTAIInformation, CriticalityIgnore, func(m *UplinkNASTransport) **LTENTNTAIInformation { return &m.LTENTNTAIInformation }), } func (m *UplinkNASTransport) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -335,10 +372,25 @@ func DecodeUplinkNASTransport(value []byte) (*UplinkNASTransport, error) { // TS 36.413 §9.1.7.2. type DownlinkNASTransport struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - NASPDU NASPDU - CoarseUELocation *CoarseUELocation + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + NASPDU NASPDU + CoarseUELocation *CoarseUELocation + HandoverRestrictionList *HandoverRestrictionList + SubscriberProfileIDforRFP *SubscriberProfileIDforRFP + SRVCCOperationPossible *SRVCCOperationPossible + UERadioCapability *UERadioCapability + DLNASPDUDeliveryAckRequest *DLNASPDUDeliveryAckRequest + EnhancedCoverageRestricted *EnhancedCoverageRestricted + NRUESecurityCapabilities *NRUESecurityCapabilities + CEModeBRestricted *CEModeBRestricted + UECapabilityInfoRequest *UECapabilityInfoRequest + EndIndication *EndIndication + PendingDataIndication *PendingDataIndication + SubscriptionBasedUEDifferentiationInfo *SubscriptionBasedUEDifferentiationInfo + AdditionalRRMPriorityIndex *AdditionalRRMPriorityIndex + UERadioCapabilityID *UERadioCapabilityID + MaskedIMEISV *MaskedIMEISV messageMeta } @@ -371,6 +423,23 @@ var downlinkNASTransportIEs = []ieSpec[DownlinkNASTransport]{ return &m.NASPDU, true }, }, + apimpl.OptionalIE(IDHandoverRestrictionList, CriticalityIgnore, func(m *DownlinkNASTransport) **HandoverRestrictionList { return &m.HandoverRestrictionList }), + apimpl.OptionalIE(IDSubscriberProfileIDforRFP, CriticalityIgnore, func(m *DownlinkNASTransport) **SubscriberProfileIDforRFP { return &m.SubscriberProfileIDforRFP }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *DownlinkNASTransport) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDUERadioCapability, CriticalityIgnore, func(m *DownlinkNASTransport) **UERadioCapability { return &m.UERadioCapability }), + apimpl.OptionalIE(IDDLNASPDUDeliveryAckRequest, CriticalityIgnore, func(m *DownlinkNASTransport) **DLNASPDUDeliveryAckRequest { return &m.DLNASPDUDeliveryAckRequest }), + apimpl.OptionalIE(IDEnhancedCoverageRestricted, CriticalityIgnore, func(m *DownlinkNASTransport) **EnhancedCoverageRestricted { return &m.EnhancedCoverageRestricted }), + apimpl.OptionalIE(IDNRUESecurityCapabilities, CriticalityIgnore, func(m *DownlinkNASTransport) **NRUESecurityCapabilities { return &m.NRUESecurityCapabilities }), + apimpl.OptionalIE(IDCEModeBRestricted, CriticalityIgnore, func(m *DownlinkNASTransport) **CEModeBRestricted { return &m.CEModeBRestricted }), + apimpl.OptionalIE(IDUECapabilityInfoRequest, CriticalityIgnore, func(m *DownlinkNASTransport) **UECapabilityInfoRequest { return &m.UECapabilityInfoRequest }), + apimpl.OptionalIE(IDEndIndication, CriticalityIgnore, func(m *DownlinkNASTransport) **EndIndication { return &m.EndIndication }), + apimpl.OptionalIE(IDPendingDataIndication, CriticalityIgnore, func(m *DownlinkNASTransport) **PendingDataIndication { return &m.PendingDataIndication }), + apimpl.OptionalIE(IDSubscriptionBasedUEDifferentiationInfo, CriticalityIgnore, func(m *DownlinkNASTransport) **SubscriptionBasedUEDifferentiationInfo { + return &m.SubscriptionBasedUEDifferentiationInfo + }), + apimpl.OptionalIE(IDAdditionalRRMPriorityIndex, CriticalityIgnore, func(m *DownlinkNASTransport) **AdditionalRRMPriorityIndex { return &m.AdditionalRRMPriorityIndex }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *DownlinkNASTransport) **UERadioCapabilityID { return &m.UERadioCapabilityID }), + apimpl.OptionalIE(IDMaskedIMEISV, CriticalityIgnore, func(m *DownlinkNASTransport) **MaskedIMEISV { return &m.MaskedIMEISV }), { ID: IDCoarseUELocation, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *DownlinkNASTransport, r *per.Reader, enc per.Encoding) error { diff --git a/s1ap/overload.go b/s1ap/overload.go index 747c786a55..b8915beefa 100644 --- a/s1ap/overload.go +++ b/s1ap/overload.go @@ -35,7 +35,7 @@ func gUMMEIListIE(l []GUMMEI) (per.Marshaler, bool) { return nil, false } - return seqOf(1, maxnoofMMECs, l), true + return seqOf(1, maxnoofMMECs, &l), true } type OverloadStart struct { diff --git a/s1ap/package_decls_test.go b/s1ap/package_decls_test.go new file mode 100644 index 0000000000..4929f9e0fa --- /dev/null +++ b/s1ap/package_decls_test.go @@ -0,0 +1,229 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "path/filepath" + "reflect" + "slices" + "strconv" + "strings" + "sync" + "testing" +) + +type packageDecls struct { + enums map[string]bool + choices map[string]bool + ieTables map[string]bool + extTables map[string]bool +} + +var ( + declsOnce sync.Once + decls packageDecls + declsErr error +) + +func typeArgName(e ast.Expr) string { + if id, ok := e.(*ast.Ident); ok { + return id.Name + } + + return "" +} + +func isSelector(e ast.Expr, pkg, name string) bool { + sel, ok := e.(*ast.SelectorExpr) + if !ok { + return false + } + + id, ok := sel.X.(*ast.Ident) + + return ok && id.Name == pkg && sel.Sel.Name == name +} + +func ieTableElem(e ast.Expr) string { + at, ok := e.(*ast.ArrayType) + if !ok || at.Len != nil { + return "" + } + + switch x := at.Elt.(type) { + case *ast.IndexExpr: + if id, ok := x.X.(*ast.Ident); ok && id.Name == "ieSpec" { + return typeArgName(x.Index) + } + case *ast.IndexListExpr: + if isSelector(x.X, "apimpl", "IESpec") && len(x.Indices) == 2 { + return typeArgName(x.Indices[1]) + } + } + + return "" +} + +func scanPackage() (packageDecls, error) { + d := packageDecls{enums: map[string]bool{}, choices: map[string]bool{}, ieTables: map[string]bool{}, extTables: map[string]bool{}} + + names, err := filepath.Glob("*.go") + if err != nil { + return d, err + } + + fset := token.NewFileSet() + + for _, name := range names { + if strings.HasSuffix(name, "_test.go") { + continue + } + + f, err := parser.ParseFile(fset, name, nil, 0) + if err != nil { + return d, err + } + + for _, decl := range f.Decls { + gd, ok := decl.(*ast.GenDecl) + if !ok { + continue + } + + for _, spec := range gd.Specs { + switch s := spec.(type) { + case *ast.TypeSpec: + st, ok := s.Type.(*ast.StructType) + if !ok { + continue + } + + for _, fld := range st.Fields.List { + if fld.Tag == nil { + continue + } + + tag, err := strconv.Unquote(fld.Tag.Value) + if err != nil { + return d, err + } + + if strings.Contains(reflect.StructTag(tag).Get("per"), "choice:") { + d.choices[s.Name.Name] = true + } + } + case *ast.ValueSpec: + if gd.Tok != token.VAR { + continue + } + + for i, n := range s.Names { + if name, ok := strings.CutSuffix(n.Name, "IEs"); ok && !strings.HasPrefix(n.Name, "extIEs") { + m := strings.ToUpper(name[:1]) + name[1:] + + if i < len(s.Values) { + if cl, ok := s.Values[i].(*ast.CompositeLit); ok { + if m = ieTableElem(cl.Type); m == "" { + return d, fmt.Errorf("%s: %s is not a []ieSpec", fset.Position(n.Pos()), n.Name) + } + } + } + + d.ieTables[m] = true + + continue + } + + typ := s.Type + + if typ == nil && i < len(s.Values) { + if cl, ok := s.Values[i].(*ast.CompositeLit); ok { + typ = cl.Type + } + } + + if typ == nil { + continue + } + + if ix, ok := typ.(*ast.IndexExpr); ok && isSelector(ix.X, "per", "Enum") { + d.enums[typeArgName(ix.Index)] = true + + continue + } + + if m := ieTableElem(typ); m != "" && strings.HasPrefix(n.Name, "extIEs") { + d.extTables[m] = true + } + } + } + } + } + } + + return d, nil +} + +func scannedDecls(t *testing.T) packageDecls { + t.Helper() + + declsOnce.Do(func() { decls, declsErr = scanPackage() }) + + if declsErr != nil { + t.Fatal(declsErr) + } + + return decls +} + +func checkComplete(t *testing.T, what string, declared map[string]bool, covered []reflect.Type) { + t.Helper() + + if len(declared) == 0 { + t.Fatalf("no %s found in the package source", what) + } + + have := map[string]bool{} + + for _, ty := range covered { + if ty.PkgPath() != reflect.TypeFor[ProtocolIEID]().PkgPath() { + t.Errorf("%s case %v is not a type of this package", what, ty) + } + + if have[ty.Name()] { + t.Errorf("%s %s is listed twice", what, ty.Name()) + } + + have[ty.Name()] = true + } + + var missing, extra []string + + for n := range declared { + if !have[n] { + missing = append(missing, n) + } + } + + for n := range have { + if !declared[n] { + extra = append(extra, n) + } + } + + slices.Sort(missing) + slices.Sort(extra) + + for _, n := range missing { + t.Errorf("%s %s is declared in the package but has no case", what, n) + } + + for _, n := range extra { + t.Errorf("%s case %s does not match a declaration in the package", what, n) + } +} diff --git a/s1ap/paging.go b/s1ap/paging.go index 3e23ddd221..f28efd8a2e 100644 --- a/s1ap/paging.go +++ b/s1ap/paging.go @@ -5,6 +5,8 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const ( @@ -43,7 +45,19 @@ type Paging struct { PagingPriority *PagingPriority // The eNB-reported paging-specific capability; when set, the eNB may use it // to apply specific paging schemes. - UERadioCapabilityForPaging []byte + UERadioCapabilityForPaging []byte + CSGIdList CSGIdList + AssistanceDataForPaging *AssistanceDataForPaging + PagingeDRXInformation *PagingeDRXInformation + ExtendedUEIdentityIndexValue *ExtendedUEIdentityIndexValue + NBIoTPagingeDRXInformation *NBIoTPagingeDRXInformation + NBIoTUEIdentityIndexValue *NBIoTUEIdentityIndexValue + EnhancedCoverageRestricted *EnhancedCoverageRestricted + CEModeBRestricted *CEModeBRestricted + DataSize *DataSize + WUSAssistanceInformation *WUSAssistanceInformation + NBIoTPagingDRX *NBIoTPagingDRX + PagingCause *PagingCause messageMeta } @@ -163,6 +177,7 @@ var pagingIEs = []ieSpec[Paging]{ return &m.TAIList, true }, }, + apimpl.ListIE(IDCSGIdList, CriticalityIgnore, func(m *Paging) *CSGIdList { return &m.CSGIdList }), { ID: IDPagingPriority, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *Paging, r *per.Reader, enc per.Encoding) error { @@ -202,6 +217,17 @@ var pagingIEs = []ieSpec[Paging]{ }), true }, }, + apimpl.OptionalIE(IDAssistanceDataForPaging, CriticalityIgnore, func(m *Paging) **AssistanceDataForPaging { return &m.AssistanceDataForPaging }), + apimpl.OptionalIE(IDPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **PagingeDRXInformation { return &m.PagingeDRXInformation }), + apimpl.OptionalIE(IDExtendedUEIdentityIndexValue, CriticalityIgnore, func(m *Paging) **ExtendedUEIdentityIndexValue { return &m.ExtendedUEIdentityIndexValue }), + apimpl.OptionalIE(IDNBIoTPagingeDRXInformation, CriticalityIgnore, func(m *Paging) **NBIoTPagingeDRXInformation { return &m.NBIoTPagingeDRXInformation }), + apimpl.OptionalIE(IDNBIoTUEIdentityIndexValue, CriticalityIgnore, func(m *Paging) **NBIoTUEIdentityIndexValue { return &m.NBIoTUEIdentityIndexValue }), + apimpl.OptionalIE(IDEnhancedCoverageRestricted, CriticalityIgnore, func(m *Paging) **EnhancedCoverageRestricted { return &m.EnhancedCoverageRestricted }), + apimpl.OptionalIE(IDCEModeBRestricted, CriticalityIgnore, func(m *Paging) **CEModeBRestricted { return &m.CEModeBRestricted }), + apimpl.OptionalIE(IDDataSize, CriticalityIgnore, func(m *Paging) **DataSize { return &m.DataSize }), + apimpl.OptionalIE(IDWUSAssistanceInformation, CriticalityIgnore, func(m *Paging) **WUSAssistanceInformation { return &m.WUSAssistanceInformation }), + apimpl.OptionalIE(IDNBIoTPagingDRX, CriticalityIgnore, func(m *Paging) **NBIoTPagingDRX { return &m.NBIoTPagingDRX }), + apimpl.OptionalIE(IDPagingCause, CriticalityIgnore, func(m *Paging) **PagingCause { return &m.PagingCause }), } func (m *Paging) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -231,3 +257,7 @@ func ParsePaging(value []byte) (*Paging, error) { func DecodePaging(value []byte) (*Paging, error) { return decodeMessageBody[Paging](ProcPaging, pagingIEs, value) } + +func (l *TAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDTAIItem, CriticalityIgnore, l) +} diff --git a/s1ap/paging_test.go b/s1ap/paging_test.go index 208cd7edda..2638015b6f 100644 --- a/s1ap/paging_test.go +++ b/s1ap/paging_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func TestPagingRoundtrip(t *testing.T) { @@ -166,7 +166,7 @@ func TestUEPagingIDAlternatives(t *testing.T) { for _, tc := range cases { t.Run(tc.name, func(t *testing.T) { msg, err := DecodePaging(container(t, - ieField{ID: IDUEPagingID, Criticality: CriticalityIgnore, Value: ap.RawValue(tc.id)}, + ieField{ID: IDUEPagingID, Criticality: CriticalityIgnore, Value: apimpl.RawValue(tc.id)}, ieField{ID: IDTAIList, Criticality: CriticalityIgnore, Value: taiList}, )) if err != nil { @@ -177,14 +177,26 @@ func TestUEPagingIDAlternatives(t *testing.T) { t.Errorf("rest of the message lost: %+v", msg.TAIList) } - if tc.want.Ext != nil { - if msg.UEPagingID != nil { - t.Fatalf("UEPagingID = %+v, want it kept raw", msg.UEPagingID) - } + if msg.UEPagingID == nil || !msg.UEPagingID.Equal(tc.want) { + t.Fatalf("UEPagingID = %+v, want %+v: decode keeps the value", msg.UEPagingID, tc.want) + } + if tc.want.Ext != nil { if err := msg.Diagnostics().Check(); err != nil { t.Fatalf("an ignore IE must not fail the check: %v", err) } + + parsed, err := ParsePaging(container(t, + ieField{ID: IDUEPagingID, Criticality: CriticalityIgnore, Value: apimpl.RawValue(tc.id)}, + ieField{ID: IDTAIList, Criticality: CriticalityIgnore, Value: taiList}, + )) + if err != nil { + t.Fatalf("parse: %v", err) + } + + if parsed.UEPagingID != nil { + t.Fatalf("parsed UEPagingID = %+v, want the not comprehended IE treated as not received", parsed.UEPagingID) + } } else if msg.UEPagingID == nil || !msg.UEPagingID.Equal(tc.want) { t.Fatalf("UEPagingID = %+v, want %+v", msg.UEPagingID, tc.want) } @@ -200,7 +212,7 @@ func TestUEPagingIDAlternatives(t *testing.T) { } if got := pdu.(*InitiatingMessage).Value; !bytes.Equal(got, container(t, - ieField{ID: IDUEPagingID, Criticality: CriticalityIgnore, Value: ap.RawValue(tc.id)}, + ieField{ID: IDUEPagingID, Criticality: CriticalityIgnore, Value: apimpl.RawValue(tc.id)}, ieField{ID: IDTAIList, Criticality: CriticalityIgnore, Value: taiList}, )) { t.Fatalf("re-encoded body % x", got) diff --git a/s1ap/path_switch.go b/s1ap/path_switch.go index a6513f217d..933d7a63b3 100644 --- a/s1ap/path_switch.go +++ b/s1ap/path_switch.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // ERABToBeSwitchedDLItem ::= SEQUENCE { e-RAB-ID, transportLayerAddress, @@ -22,14 +23,22 @@ type ERABToBeSwitchedDLItem struct { // TS 36.413 §9.1.5.8. type PathSwitchRequest struct { - ENBUES1APID ENBUES1APID - ERABToBeSwitchedDL ERABToBeSwitchedDLList - SourceMMEUES1APID MMEUES1APID - EUTRANCGI *EUTRANCGI - TAI *TAI - UESecurityCapabilities *UESecurityCapabilities - SourceMMEGUMMEI *GUMMEI - TunnelInformationForBBF *TunnelInformation + ENBUES1APID ENBUES1APID + ERABToBeSwitchedDL ERABToBeSwitchedDLList + SourceMMEUES1APID MMEUES1APID + EUTRANCGI *EUTRANCGI + TAI *TAI + UESecurityCapabilities *UESecurityCapabilities + SourceMMEGUMMEI *GUMMEI + TunnelInformationForBBF *TunnelInformation + CSGId *CSGId + CellAccessMode *CellAccessMode + CSGMembershipStatus *CSGMembershipStatus + LHNID *LHNID + RRCResumeCause *RRCEstablishmentCause + NRUESecurityCapabilities *NRUESecurityCapabilities + PSCellInformation *PSCellInformation + LTENTNTAIInformation *LTENTNTAIInformation messageMeta } @@ -52,7 +61,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return err }, Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { - return containerList(maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject, m.ERABToBeSwitchedDL), true + return containerList(maxnoofERABs, IDERABToBeSwitchedDLItem, CriticalityReject, &m.ERABToBeSwitchedDL), true }, }, { @@ -125,6 +134,8 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return m.UESecurityCapabilities, true }, }, + apimpl.OptionalIE(IDCSGId, CriticalityIgnore, func(m *PathSwitchRequest) **CSGId { return &m.CSGId }), + apimpl.OptionalIE(IDCellAccessMode, CriticalityIgnore, func(m *PathSwitchRequest) **CellAccessMode { return &m.CellAccessMode }), { ID: IDSourceMMEGUMMEI, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { @@ -146,6 +157,7 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ return m.SourceMMEGUMMEI, true }, }, + apimpl.OptionalIE(IDCSGMembershipStatus, CriticalityIgnore, func(m *PathSwitchRequest) **CSGMembershipStatus { return &m.CSGMembershipStatus }), { ID: IDTunnelInformationForBBF, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *PathSwitchRequest, r *per.Reader, enc per.Encoding) error { @@ -153,6 +165,11 @@ var pathSwitchRequestIEs = []ieSpec[PathSwitchRequest]{ }, Encode: func(m *PathSwitchRequest) (per.Marshaler, bool) { return optionalIE(m.TunnelInformationForBBF) }, }, + apimpl.OptionalIE(IDLHNID, CriticalityIgnore, func(m *PathSwitchRequest) **LHNID { return &m.LHNID }), + apimpl.OptionalIE(IDRRCResumeCause, CriticalityIgnore, func(m *PathSwitchRequest) **RRCEstablishmentCause { return &m.RRCResumeCause }), + apimpl.OptionalIE(IDNRUESecurityCapabilities, CriticalityIgnore, func(m *PathSwitchRequest) **NRUESecurityCapabilities { return &m.NRUESecurityCapabilities }), + apimpl.OptionalIE(IDPSCellInformation, CriticalityIgnore, func(m *PathSwitchRequest) **PSCellInformation { return &m.PSCellInformation }), + apimpl.OptionalIE(IDLTENTNTAIInformation, CriticalityIgnore, func(m *PathSwitchRequest) **LTENTNTAIInformation { return &m.LTENTNTAIInformation }), } func (m *PathSwitchRequest) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -194,8 +211,27 @@ type PathSwitchRequestAcknowledge struct { UESecurityCapabilities *UESecurityCapabilities // E-RABs the MME failed to switch the UP path for, whose data radio bearers // the eNB releases (§8.4.4.2). - ERABToBeReleased []ERABItem - TimeRefDistribution *TimeRefDistribution + ERABToBeReleased []ERABItem + TimeRefDistribution *TimeRefDistribution + CriticalityDiagnostics *CriticalityDiagnostics + CSGMembershipStatus *CSGMembershipStatus + ProSeAuthorized *ProSeAuthorized + UEUserPlaneCIoTSupportIndicator *UEUserPlaneCIoTSupportIndicator + V2XServicesAuthorized *V2XServicesAuthorized + UESidelinkAggregateMaximumBitrate *UESidelinkAggregateMaximumBitrate + EnhancedCoverageRestricted *EnhancedCoverageRestricted + NRUESecurityCapabilities *NRUESecurityCapabilities + CEModeBRestricted *CEModeBRestricted + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + PendingDataIndication *PendingDataIndication + SubscriptionBasedUEDifferentiationInfo *SubscriptionBasedUEDifferentiationInfo + HandoverRestrictionList *HandoverRestrictionList + AdditionalRRMPriorityIndex *AdditionalRRMPriorityIndex + NRV2XServicesAuthorized *NRV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + UERadioCapabilityID *UERadioCapabilityID + ERABToBeUpdatedList ERABToBeUpdatedList messageMeta } @@ -278,7 +314,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil, false } - return m.ERABToBeSwitchedUL, true + return &m.ERABToBeSwitchedUL, true }, }, { @@ -295,7 +331,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return nil, false } - return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, m.ERABToBeReleased), true + return containerList(maxnoofERABs, IDERABItem, CriticalityIgnore, &m.ERABToBeReleased), true }, }, { @@ -305,6 +341,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ }, Encode: func(m *PathSwitchRequestAcknowledge) (per.Marshaler, bool) { return &m.SecurityContext, true }, }, + apimpl.OptionalIE(IDCriticalityDiagnostics, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CriticalityDiagnostics { return &m.CriticalityDiagnostics }), { ID: IDMMEUES1APID2, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { @@ -326,6 +363,37 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.MMEUES1APID2, true }, }, + apimpl.OptionalIE(IDCSGMembershipStatus, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CSGMembershipStatus { return &m.CSGMembershipStatus }), + apimpl.OptionalIE(IDProSeAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **ProSeAuthorized { return &m.ProSeAuthorized }), + apimpl.OptionalIE(IDUEUserPlaneCIoTSupportIndicator, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UEUserPlaneCIoTSupportIndicator { + return &m.UEUserPlaneCIoTSupportIndicator + }), + apimpl.OptionalIE(IDV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **V2XServicesAuthorized { return &m.V2XServicesAuthorized }), + apimpl.OptionalIE(IDUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **UESidelinkAggregateMaximumBitrate { + return &m.UESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDEnhancedCoverageRestricted, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **EnhancedCoverageRestricted { + return &m.EnhancedCoverageRestricted + }), + apimpl.OptionalIE(IDNRUESecurityCapabilities, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESecurityCapabilities { return &m.NRUESecurityCapabilities }), + apimpl.OptionalIE(IDCEModeBRestricted, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **CEModeBRestricted { return &m.CEModeBRestricted }), + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **AerialUEsubscriptionInformation { + return &m.AerialUEsubscriptionInformation + }), + apimpl.OptionalIE(IDPendingDataIndication, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **PendingDataIndication { return &m.PendingDataIndication }), + apimpl.OptionalIE(IDSubscriptionBasedUEDifferentiationInfo, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **SubscriptionBasedUEDifferentiationInfo { + return &m.SubscriptionBasedUEDifferentiationInfo + }), + apimpl.OptionalIE(IDHandoverRestrictionList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **HandoverRestrictionList { return &m.HandoverRestrictionList }), + apimpl.OptionalIE(IDAdditionalRRMPriorityIndex, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **AdditionalRRMPriorityIndex { + return &m.AdditionalRRMPriorityIndex + }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *PathSwitchRequestAcknowledge) **UERadioCapabilityID { return &m.UERadioCapabilityID }), { ID: IDUESecurityCapabilities, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { @@ -351,6 +419,7 @@ var pathSwitchRequestAcknowledgeIEs = []ieSpec[PathSwitchRequestAcknowledge]{ return m.UESecurityCapabilities, true }, }, + apimpl.ListIE(IDERABToBeUpdatedList, CriticalityIgnore, func(m *PathSwitchRequestAcknowledge) *ERABToBeUpdatedList { return &m.ERABToBeUpdatedList }), { ID: IDTimeRefDistribution, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *PathSwitchRequestAcknowledge, r *per.Reader, enc per.Encoding) error { diff --git a/s1ap/path_switch_test.go b/s1ap/path_switch_test.go index 7013758803..4307f43f46 100644 --- a/s1ap/path_switch_test.go +++ b/s1ap/path_switch_test.go @@ -120,7 +120,7 @@ func TestPathSwitchRequestAcknowledgeRoundTrip(t *testing.T) { t.Fatalf("security context = %+v, want %+v", out.SecurityContext, in.SecurityContext) } - if out.UEAggregateMaximumBitRate == nil || *out.UEAggregateMaximumBitRate != *in.UEAggregateMaximumBitRate { + if out.UEAggregateMaximumBitRate == nil || !out.UEAggregateMaximumBitRate.Equal(*in.UEAggregateMaximumBitRate) { t.Fatalf("UE-AMBR = %+v, want %+v", out.UEAggregateMaximumBitRate, in.UEAggregateMaximumBitRate) } diff --git a/s1ap/pdu.go b/s1ap/pdu.go index be7b39f2b7..f23f703a66 100644 --- a/s1ap/pdu.go +++ b/s1ap/pdu.go @@ -7,7 +7,7 @@ import ( "bytes" "fmt" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // S1AP-PDU CHOICE root alternatives (TS 36.413), in declaration order. @@ -77,7 +77,7 @@ func Marshal(pdu PDU) ([]byte, error) { return nil, fmt.Errorf("s1ap: nil PDU") } - return profile.EncodePDU(ap.Envelope{ + return apimpl.EncodePDU(profile, apimpl.Envelope{ Choice: pdu.choiceIndex(), ProcedureCode: uint8(pdu.procedureCode()), Criticality: pdu.criticality(), @@ -87,7 +87,7 @@ func Marshal(pdu PDU) ([]byte, error) { // The open-type payload is left in Value for the message layer. func Unmarshal(b []byte) (PDU, error) { - e, err := profile.DecodePDU(b) + e, err := apimpl.DecodePDU[ProcedureCode](profile, b) if err != nil { return nil, err } diff --git a/s1ap/per_gen.go b/s1ap/per_gen.go index d8629828ed..a8098706c6 100644 --- a/s1ap/per_gen.go +++ b/s1ap/per_gen.go @@ -6,12 +6,33 @@ package s1ap import ( "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" "slices" ) +func (additionalCSFallbackIndicator AdditionalCSFallbackIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAdditionalCSFallbackIndicator.Encode(w, enc, additionalCSFallbackIndicator) +} + +func (additionalCSFallbackIndicator *AdditionalCSFallbackIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAdditionalCSFallbackIndicator.Decode(r, enc) + if err != nil { + return err + } + *additionalCSFallbackIndicator = v + return nil +} + +func (additionalCSFallbackIndicator AdditionalCSFallbackIndicator) Name() string { + return enumAdditionalCSFallbackIndicator.Name(additionalCSFallbackIndicator) +} + +func (additionalCSFallbackIndicator AdditionalCSFallbackIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumAdditionalCSFallbackIndicator.Known(additionalCSFallbackIndicator) +} + func (additionalGUTI *AdditionalGUTI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAdditionalGUTI, additionalGUTI, additionalGUTI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAdditionalGUTI, additionalGUTI, additionalGUTI.iEExtensions) w.WriteBit(additionalGUTI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := additionalGUTI.GUMMEI.MarshalPER(w, enc); err != nil { @@ -21,7 +42,7 @@ func (additionalGUTI *AdditionalGUTI) MarshalPER(w *per.Writer, enc per.Encoding return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -50,7 +71,7 @@ func (additionalGUTI *AdditionalGUTI) UnmarshalPER(r *per.Reader, enc per.Encodi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalGUTI, additionalGUTI, &additionalGUTI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAdditionalGUTI, additionalGUTI, &additionalGUTI.iEExtensions); err != nil { return err } } @@ -62,19 +83,40 @@ func (additionalGUTI *AdditionalGUTI) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEsAdditionalGUTI []ap.IESpec[ProtocolIEID, AdditionalGUTI] +var extIEsAdditionalGUTI []apimpl.IESpec[ProtocolIEID, AdditionalGUTI] -func (additionalGUTI *AdditionalGUTI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (additionalGUTI *AdditionalGUTI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if additionalGUTI.GUMMEI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsAdditionalGUTI, additionalGUTI, additionalGUTI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsAdditionalGUTI, additionalGUTI, &additionalGUTI.iEExtensions) return notComprehended } +func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumAerialUEsubscriptionInformation.Encode(w, enc, aerialUEsubscriptionInformation) +} + +func (aerialUEsubscriptionInformation *AerialUEsubscriptionInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumAerialUEsubscriptionInformation.Decode(r, enc) + if err != nil { + return err + } + *aerialUEsubscriptionInformation = v + return nil +} + +func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) Name() string { + return enumAerialUEsubscriptionInformation.Name(aerialUEsubscriptionInformation) +} + +func (aerialUEsubscriptionInformation AerialUEsubscriptionInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumAerialUEsubscriptionInformation.Known(aerialUEsubscriptionInformation) +} + func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) + ext := apimpl.ExtensionFields(extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) w.WriteBit(allocationAndRetentionPriority.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 15, HasUB: true}, int64(allocationAndRetentionPriority.PriorityLevel)); err != nil { @@ -87,7 +129,7 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) MarshalPER return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -121,7 +163,7 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions); err != nil { return err } } @@ -133,11 +175,233 @@ func (allocationAndRetentionPriority *AllocationAndRetentionPriority) UnmarshalP return nil } -var extIEsAllocationAndRetentionPriority []ap.IESpec[ProtocolIEID, AllocationAndRetentionPriority] +var extIEsAllocationAndRetentionPriority []apimpl.IESpec[ProtocolIEID, AllocationAndRetentionPriority] + +func (allocationAndRetentionPriority *AllocationAndRetentionPriority) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, &allocationAndRetentionPriority.iEExtensions) + return notComprehended +} + +func (assistanceDataForCECapableUEs *AssistanceDataForCECapableUEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsAssistanceDataForCECapableUEs, assistanceDataForCECapableUEs, assistanceDataForCECapableUEs.iEExtensions) + w.WriteBit(assistanceDataForCECapableUEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := assistanceDataForCECapableUEs.CellIdentifierAndCELevelForCECapableUEs.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if assistanceDataForCECapableUEs.extensions.Present() { + if err := assistanceDataForCECapableUEs.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (assistanceDataForCECapableUEs *AssistanceDataForCECapableUEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *assistanceDataForCECapableUEs = AssistanceDataForCECapableUEs{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&assistanceDataForCECapableUEs.CellIdentifierAndCELevelForCECapableUEs).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForCECapableUEs, assistanceDataForCECapableUEs, &assistanceDataForCECapableUEs.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := assistanceDataForCECapableUEs.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsAssistanceDataForCECapableUEs []apimpl.IESpec[ProtocolIEID, AssistanceDataForCECapableUEs] + +func (assistanceDataForCECapableUEs *AssistanceDataForCECapableUEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if assistanceDataForCECapableUEs.CellIdentifierAndCELevelForCECapableUEs.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsAssistanceDataForCECapableUEs, assistanceDataForCECapableUEs, &assistanceDataForCECapableUEs.iEExtensions) + return notComprehended +} + +func (assistanceDataForPaging *AssistanceDataForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsAssistanceDataForPaging, assistanceDataForPaging, assistanceDataForPaging.iEExtensions) + w.WriteBit(assistanceDataForPaging.extensions.Present()) + w.WriteBit(assistanceDataForPaging.AssistanceDataForRecommendedCells != nil) + w.WriteBit(assistanceDataForPaging.AssistanceDataForCECapableUEs != nil) + w.WriteBit(assistanceDataForPaging.PagingAttemptInformation != nil) + w.WriteBit(len(ext) > 0) + if assistanceDataForPaging.AssistanceDataForRecommendedCells != nil { + if err := (*assistanceDataForPaging.AssistanceDataForRecommendedCells).MarshalPER(w, enc); err != nil { + return err + } + } + if assistanceDataForPaging.AssistanceDataForCECapableUEs != nil { + if err := (*assistanceDataForPaging.AssistanceDataForCECapableUEs).MarshalPER(w, enc); err != nil { + return err + } + } + if assistanceDataForPaging.PagingAttemptInformation != nil { + if err := (*assistanceDataForPaging.PagingAttemptInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if assistanceDataForPaging.extensions.Present() { + if err := assistanceDataForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (assistanceDataForPaging *AssistanceDataForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *assistanceDataForPaging = AssistanceDataForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_AssistanceDataForRecommendedCells, err := r.ReadBit() + if err != nil { + return err + } + p_AssistanceDataForCECapableUEs, err := r.ReadBit() + if err != nil { + return err + } + p_PagingAttemptInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_AssistanceDataForRecommendedCells { + var v AssistanceDataForRecommendedCells + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + assistanceDataForPaging.AssistanceDataForRecommendedCells = &v + } + if p_AssistanceDataForCECapableUEs { + var v AssistanceDataForCECapableUEs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + assistanceDataForPaging.AssistanceDataForCECapableUEs = &v + } + if p_PagingAttemptInformation { + var v PagingAttemptInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + assistanceDataForPaging.PagingAttemptInformation = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForPaging, assistanceDataForPaging, &assistanceDataForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := assistanceDataForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsAssistanceDataForPaging []apimpl.IESpec[ProtocolIEID, AssistanceDataForPaging] + +func (assistanceDataForPaging *AssistanceDataForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if assistanceDataForPaging.AssistanceDataForRecommendedCells != nil && assistanceDataForPaging.AssistanceDataForRecommendedCells.Diagnose(d) { + notComprehended = true + } + if assistanceDataForPaging.AssistanceDataForCECapableUEs != nil && assistanceDataForPaging.AssistanceDataForCECapableUEs.Diagnose(d) { + notComprehended = true + } + if assistanceDataForPaging.PagingAttemptInformation != nil && assistanceDataForPaging.PagingAttemptInformation.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsAssistanceDataForPaging, assistanceDataForPaging, &assistanceDataForPaging.iEExtensions) + return notComprehended +} + +func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, assistanceDataForRecommendedCells.iEExtensions) + w.WriteBit(assistanceDataForRecommendedCells.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := assistanceDataForRecommendedCells.RecommendedCellsForPaging.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if assistanceDataForRecommendedCells.extensions.Present() { + if err := assistanceDataForRecommendedCells.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *assistanceDataForRecommendedCells = AssistanceDataForRecommendedCells{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&assistanceDataForRecommendedCells.RecommendedCellsForPaging).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, &assistanceDataForRecommendedCells.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := assistanceDataForRecommendedCells.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsAssistanceDataForRecommendedCells []apimpl.IESpec[ProtocolIEID, AssistanceDataForRecommendedCells] -func (allocationAndRetentionPriority *AllocationAndRetentionPriority) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (assistanceDataForRecommendedCells *AssistanceDataForRecommendedCells) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsAllocationAndRetentionPriority, allocationAndRetentionPriority, allocationAndRetentionPriority.iEExtensions) + if assistanceDataForRecommendedCells.RecommendedCellsForPaging.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsAssistanceDataForRecommendedCells, assistanceDataForRecommendedCells, &assistanceDataForRecommendedCells.iEExtensions) return notComprehended } @@ -158,7 +422,7 @@ func (bearerType BearerType) Name() string { return enumBearerType.Name(bearerType) } -func (bearerType BearerType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (bearerType BearerType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumBearerType.Known(bearerType) } @@ -249,7 +513,7 @@ func (broadcastCancelledAreaList *BroadcastCancelledAreaList) UnmarshalPER(r *pe return nil } -func (broadcastCancelledAreaList *BroadcastCancelledAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (broadcastCancelledAreaList *BroadcastCancelledAreaList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case broadcastCancelledAreaList.CellIDCancelled != nil: return broadcastCancelledAreaList.CellIDCancelled.Diagnose(d) @@ -350,7 +614,7 @@ func (broadcastCompletedAreaList *BroadcastCompletedAreaList) UnmarshalPER(r *pe return nil } -func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case broadcastCompletedAreaList.CellIDBroadcast != nil: return broadcastCompletedAreaList.CellIDBroadcast.Diagnose(d) @@ -364,8 +628,50 @@ func (broadcastCompletedAreaList *BroadcastCompletedAreaList) Diagnose(d *ap.Dia return false } +func (cEModeBRestricted CEModeBRestricted) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCEModeBRestricted.Encode(w, enc, cEModeBRestricted) +} + +func (cEModeBRestricted *CEModeBRestricted) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCEModeBRestricted.Decode(r, enc) + if err != nil { + return err + } + *cEModeBRestricted = v + return nil +} + +func (cEModeBRestricted CEModeBRestricted) Name() string { + return enumCEModeBRestricted.Name(cEModeBRestricted) +} + +func (cEModeBRestricted CEModeBRestricted) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumCEModeBRestricted.Known(cEModeBRestricted) +} + +func (cEmodeBSupportIndicator CEmodeBSupportIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCEmodeBSupportIndicator.Encode(w, enc, cEmodeBSupportIndicator) +} + +func (cEmodeBSupportIndicator *CEmodeBSupportIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCEmodeBSupportIndicator.Decode(r, enc) + if err != nil { + return err + } + *cEmodeBSupportIndicator = v + return nil +} + +func (cEmodeBSupportIndicator CEmodeBSupportIndicator) Name() string { + return enumCEmodeBSupportIndicator.Name(cEmodeBSupportIndicator) +} + +func (cEmodeBSupportIndicator CEmodeBSupportIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumCEmodeBSupportIndicator.Known(cEmodeBSupportIndicator) +} + func (cGI *CGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCGI, cGI, cGI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCGI, cGI, cGI.iEExtensions) w.WriteBit(cGI.extensions.Present()) w.WriteBit(cGI.RAC != nil) w.WriteBit(len(ext) > 0) @@ -384,7 +690,7 @@ func (cGI *CGI) MarshalPER(w *per.Writer, enc per.Encoding) error { } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -427,7 +733,7 @@ func (cGI *CGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { cGI.RAC = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCGI, cGI, &cGI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCGI, cGI, &cGI.iEExtensions); err != nil { return err } } @@ -439,11 +745,11 @@ func (cGI *CGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsCGI []ap.IESpec[ProtocolIEID, CGI] +var extIEsCGI []apimpl.IESpec[ProtocolIEID, CGI] -func (cGI *CGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cGI *CGI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsCGI, cGI, cGI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCGI, cGI, &cGI.iEExtensions) return notComprehended } @@ -481,12 +787,12 @@ func (cNType CNType) Name() string { return enumCNType.Name(cNType) } -func (cNType CNType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cNType CNType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCNType.Known(cNType) } func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, cNTypeRestrictionsItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, cNTypeRestrictionsItem.iEExtensions) w.WriteBit(cNTypeRestrictionsItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cNTypeRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -496,7 +802,7 @@ func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -525,7 +831,7 @@ func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, &cNTypeRestrictionsItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, &cNTypeRestrictionsItem.iEExtensions); err != nil { return err } } @@ -537,42 +843,60 @@ func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) UnmarshalPER(r *per.Reader return nil } -var extIEsCNTypeRestrictionsItem []ap.IESpec[ProtocolIEID, CNTypeRestrictionsItem] +var extIEsCNTypeRestrictionsItem []apimpl.IESpec[ProtocolIEID, CNTypeRestrictionsItem] -func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cNTypeRestrictionsItem *CNTypeRestrictionsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cNTypeRestrictionsItem.CNType.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, cNTypeRestrictionsItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCNTypeRestrictionsItem, cNTypeRestrictionsItem, &cNTypeRestrictionsItem.iEExtensions) return notComprehended } -func (cancelledCellInEAIItem *CancelledCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, cancelledCellInEAIItem.iEExtensions) - w.WriteBit(cancelledCellInEAIItem.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := cancelledCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { +func (cSFallbackIndicator CSFallbackIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCSFallbackIndicator.Encode(w, enc, cSFallbackIndicator) +} + +func (cSFallbackIndicator *CSFallbackIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCSFallbackIndicator.Decode(r, enc) + if err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInEAIItem.NumberOfBroadcasts)); err != nil { + *cSFallbackIndicator = v + return nil +} + +func (cSFallbackIndicator CSFallbackIndicator) Name() string { + return enumCSFallbackIndicator.Name(cSFallbackIndicator) +} + +func (cSFallbackIndicator CSFallbackIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumCSFallbackIndicator.Known(cSFallbackIndicator) +} + +func (cSGIdListItem *CSGIdListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsCSGIdListItem, cSGIdListItem, cSGIdListItem.iEExtensions) + w.WriteBit(cSGIdListItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cSGIdListItem.CSGId.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if cancelledCellInEAIItem.extensions.Present() { - if err := cancelledCellInEAIItem.extensions.MarshalPER(w, enc); err != nil { + if cSGIdListItem.extensions.Present() { + if err := cSGIdListItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (cancelledCellInEAIItem *CancelledCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *cancelledCellInEAIItem = CancelledCellInEAIItem{} +func (cSGIdListItem *CSGIdListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cSGIdListItem = CSGIdListItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -581,85 +905,256 @@ func (cancelledCellInEAIItem *CancelledCellInEAIItem) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&cancelledCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { - return err - } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) - if err != nil { + if err := (&cSGIdListItem.CSGId).UnmarshalPER(r, enc); err != nil { return err } - cancelledCellInEAIItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, &cancelledCellInEAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCSGIdListItem, cSGIdListItem, &cSGIdListItem.iEExtensions); err != nil { return err } } if extBit { - if err := cancelledCellInEAIItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := cSGIdListItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsCancelledCellInEAIItem []ap.IESpec[ProtocolIEID, CancelledCellInEAIItem] +var extIEsCSGIdListItem []apimpl.IESpec[ProtocolIEID, CSGIdListItem] -func (cancelledCellInEAIItem *CancelledCellInEAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cSGIdListItem *CSGIdListItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if cancelledCellInEAIItem.ECGI.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, cancelledCellInEAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCSGIdListItem, cSGIdListItem, &cSGIdListItem.iEExtensions) return notComprehended } -func (cancelledCellInTAIItem *CancelledCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, cancelledCellInTAIItem.iEExtensions) - w.WriteBit(cancelledCellInTAIItem.extensions.Present()) +func (cSGMembershipInfo *CSGMembershipInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsCSGMembershipInfo, cSGMembershipInfo, cSGMembershipInfo.iEExtensions) + w.WriteBit(cSGMembershipInfo.extensions.Present()) + w.WriteBit(cSGMembershipInfo.CellAccessMode != nil) + w.WriteBit(cSGMembershipInfo.PLMNidentity != nil) w.WriteBit(len(ext) > 0) - if err := cancelledCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { + if err := cSGMembershipInfo.CSGMembershipStatus.MarshalPER(w, enc); err != nil { return err } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInTAIItem.NumberOfBroadcasts)); err != nil { + if err := cSGMembershipInfo.CSGId.MarshalPER(w, enc); err != nil { return err } + if cSGMembershipInfo.CellAccessMode != nil { + if err := (*cSGMembershipInfo.CellAccessMode).MarshalPER(w, enc); err != nil { + return err + } + } + if cSGMembershipInfo.PLMNidentity != nil { + if err := (*cSGMembershipInfo.PLMNidentity).MarshalPER(w, enc); err != nil { + return err + } + } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if cancelledCellInTAIItem.extensions.Present() { - if err := cancelledCellInTAIItem.extensions.MarshalPER(w, enc); err != nil { + if cSGMembershipInfo.extensions.Present() { + if err := cSGMembershipInfo.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (cancelledCellInTAIItem *CancelledCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *cancelledCellInTAIItem = CancelledCellInTAIItem{} +func (cSGMembershipInfo *CSGMembershipInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cSGMembershipInfo = CSGMembershipInfo{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_CellAccessMode, err := r.ReadBit() if err != nil { return err } - if err := (&cancelledCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + p_PLMNidentity, err := r.ReadBit() + if err != nil { return err } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - cancelledCellInTAIItem.NumberOfBroadcasts = uint16(n1) - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, &cancelledCellInTAIItem.iEExtensions); err != nil { - return err - } + if err := (&cSGMembershipInfo.CSGMembershipStatus).UnmarshalPER(r, enc); err != nil { + return err } - if extBit { + if err := (&cSGMembershipInfo.CSGId).UnmarshalPER(r, enc); err != nil { + return err + } + if p_CellAccessMode { + var v CellAccessMode + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cSGMembershipInfo.CellAccessMode = &v + } + if p_PLMNidentity { + var v PLMNIdentity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + cSGMembershipInfo.PLMNidentity = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCSGMembershipInfo, cSGMembershipInfo, &cSGMembershipInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := cSGMembershipInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsCSGMembershipInfo []apimpl.IESpec[ProtocolIEID, CSGMembershipInfo] + +func (cSGMembershipInfo *CSGMembershipInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cSGMembershipInfo.CellAccessMode != nil && cSGMembershipInfo.CellAccessMode.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsCSGMembershipInfo, cSGMembershipInfo, &cSGMembershipInfo.iEExtensions) + return notComprehended +} + +func (cSGMembershipStatus CSGMembershipStatus) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCSGMembershipStatus.Encode(w, enc, cSGMembershipStatus) +} + +func (cSGMembershipStatus *CSGMembershipStatus) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCSGMembershipStatus.Decode(r, enc) + if err != nil { + return err + } + *cSGMembershipStatus = v + return nil +} + +func (cSGMembershipStatus CSGMembershipStatus) Name() string { + return enumCSGMembershipStatus.Name(cSGMembershipStatus) +} + +func (cancelledCellInEAIItem *CancelledCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, cancelledCellInEAIItem.iEExtensions) + w.WriteBit(cancelledCellInEAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInEAIItem.NumberOfBroadcasts)); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cancelledCellInEAIItem.extensions.Present() { + if err := cancelledCellInEAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (cancelledCellInEAIItem *CancelledCellInEAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellInEAIItem = CancelledCellInEAIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cancelledCellInEAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cancelledCellInEAIItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, &cancelledCellInEAIItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := cancelledCellInEAIItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsCancelledCellInEAIItem []apimpl.IESpec[ProtocolIEID, CancelledCellInEAIItem] + +func (cancelledCellInEAIItem *CancelledCellInEAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cancelledCellInEAIItem.ECGI.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsCancelledCellInEAIItem, cancelledCellInEAIItem, &cancelledCellInEAIItem.iEExtensions) + return notComprehended +} + +func (cancelledCellInTAIItem *CancelledCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, cancelledCellInTAIItem.iEExtensions) + w.WriteBit(cancelledCellInTAIItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cancelledCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}, int64(cancelledCellInTAIItem.NumberOfBroadcasts)); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cancelledCellInTAIItem.extensions.Present() { + if err := cancelledCellInTAIItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (cancelledCellInTAIItem *CancelledCellInTAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cancelledCellInTAIItem = CancelledCellInTAIItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cancelledCellInTAIItem.ECGI).UnmarshalPER(r, enc); err != nil { + return err + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 65535, HasUB: true}) + if err != nil { + return err + } + cancelledCellInTAIItem.NumberOfBroadcasts = uint16(n1) + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, &cancelledCellInTAIItem.iEExtensions); err != nil { + return err + } + } + if extBit { if err := cancelledCellInTAIItem.extensions.UnmarshalPER(r, enc); err != nil { return err } @@ -667,14 +1162,14 @@ func (cancelledCellInTAIItem *CancelledCellInTAIItem) UnmarshalPER(r *per.Reader return nil } -var extIEsCancelledCellInTAIItem []ap.IESpec[ProtocolIEID, CancelledCellInTAIItem] +var extIEsCancelledCellInTAIItem []apimpl.IESpec[ProtocolIEID, CancelledCellInTAIItem] -func (cancelledCellInTAIItem *CancelledCellInTAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cancelledCellInTAIItem *CancelledCellInTAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cancelledCellInTAIItem.ECGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, cancelledCellInTAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCancelledCellInTAIItem, cancelledCellInTAIItem, &cancelledCellInTAIItem.iEExtensions) return notComprehended } @@ -793,7 +1288,7 @@ func (cause *Cause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (cause *Cause) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cause *Cause) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case cause.RadioNetwork != nil: return cause.RadioNetwork.Diagnose(d) @@ -828,7 +1323,7 @@ func (causeMisc CauseMisc) Name() string { return enumCauseMisc.Name(causeMisc) } -func (causeMisc CauseMisc) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeMisc CauseMisc) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseMisc.Known(causeMisc) } @@ -849,7 +1344,7 @@ func (causeNas CauseNas) Name() string { return enumCauseNas.Name(causeNas) } -func (causeNas CauseNas) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeNas CauseNas) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseNas.Known(causeNas) } @@ -870,7 +1365,7 @@ func (causeProtocol CauseProtocol) Name() string { return enumCauseProtocol.Name(causeProtocol) } -func (causeProtocol CauseProtocol) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeProtocol CauseProtocol) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseProtocol.Known(causeProtocol) } @@ -891,7 +1386,7 @@ func (causeRadioNetwork CauseRadioNetwork) Name() string { return enumCauseRadioNetwork.Name(causeRadioNetwork) } -func (causeRadioNetwork CauseRadioNetwork) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeRadioNetwork CauseRadioNetwork) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseRadioNetwork.Known(causeRadioNetwork) } @@ -912,19 +1407,40 @@ func (causeTransport CauseTransport) Name() string { return enumCauseTransport.Name(causeTransport) } -func (causeTransport CauseTransport) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (causeTransport CauseTransport) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCauseTransport.Known(causeTransport) } +func (cellAccessMode CellAccessMode) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCellAccessMode.Encode(w, enc, cellAccessMode) +} + +func (cellAccessMode *CellAccessMode) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCellAccessMode.Decode(r, enc) + if err != nil { + return err + } + *cellAccessMode = v + return nil +} + +func (cellAccessMode CellAccessMode) Name() string { + return enumCellAccessMode.Name(cellAccessMode) +} + +func (cellAccessMode CellAccessMode) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumCellAccessMode.Known(cellAccessMode) +} + func (cellIDBroadcastItem *CellIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellIDBroadcastItem, cellIDBroadcastItem, cellIDBroadcastItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellIDBroadcastItem, cellIDBroadcastItem, cellIDBroadcastItem.iEExtensions) w.WriteBit(cellIDBroadcastItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellIDBroadcastItem.ECGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -950,7 +1466,7 @@ func (cellIDBroadcastItem *CellIDBroadcastItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastItem, cellIDBroadcastItem, &cellIDBroadcastItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellIDBroadcastItem, cellIDBroadcastItem, &cellIDBroadcastItem.iEExtensions); err != nil { return err } } @@ -962,19 +1478,19 @@ func (cellIDBroadcastItem *CellIDBroadcastItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsCellIDBroadcastItem []ap.IESpec[ProtocolIEID, CellIDBroadcastItem] +var extIEsCellIDBroadcastItem []apimpl.IESpec[ProtocolIEID, CellIDBroadcastItem] -func (cellIDBroadcastItem *CellIDBroadcastItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDBroadcastItem *CellIDBroadcastItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellIDBroadcastItem.ECGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellIDBroadcastItem, cellIDBroadcastItem, cellIDBroadcastItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellIDBroadcastItem, cellIDBroadcastItem, &cellIDBroadcastItem.iEExtensions) return notComprehended } func (cellIDCancelledItem *CellIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellIDCancelledItem, cellIDCancelledItem, cellIDCancelledItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellIDCancelledItem, cellIDCancelledItem, cellIDCancelledItem.iEExtensions) w.WriteBit(cellIDCancelledItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellIDCancelledItem.ECGI.MarshalPER(w, enc); err != nil { @@ -984,7 +1500,7 @@ func (cellIDCancelledItem *CellIDCancelledItem) MarshalPER(w *per.Writer, enc pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1015,7 +1531,7 @@ func (cellIDCancelledItem *CellIDCancelledItem) UnmarshalPER(r *per.Reader, enc } cellIDCancelledItem.NumberOfBroadcasts = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledItem, cellIDCancelledItem, &cellIDCancelledItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellIDCancelledItem, cellIDCancelledItem, &cellIDCancelledItem.iEExtensions); err != nil { return err } } @@ -1027,14 +1543,77 @@ func (cellIDCancelledItem *CellIDCancelledItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsCellIDCancelledItem []ap.IESpec[ProtocolIEID, CellIDCancelledItem] +var extIEsCellIDCancelledItem []apimpl.IESpec[ProtocolIEID, CellIDCancelledItem] -func (cellIDCancelledItem *CellIDCancelledItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDCancelledItem *CellIDCancelledItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellIDCancelledItem.ECGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellIDCancelledItem, cellIDCancelledItem, cellIDCancelledItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellIDCancelledItem, cellIDCancelledItem, &cellIDCancelledItem.iEExtensions) + return notComprehended +} + +func (cellIdentifierAndCELevelForCECapableUEs *CellIdentifierAndCELevelForCECapableUEs) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsCellIdentifierAndCELevelForCECapableUEs, cellIdentifierAndCELevelForCECapableUEs, cellIdentifierAndCELevelForCECapableUEs.iEExtensions) + w.WriteBit(cellIdentifierAndCELevelForCECapableUEs.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := cellIdentifierAndCELevelForCECapableUEs.GlobalCellID.MarshalPER(w, enc); err != nil { + return err + } + if err := cellIdentifierAndCELevelForCECapableUEs.CELevel.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if cellIdentifierAndCELevelForCECapableUEs.extensions.Present() { + if err := cellIdentifierAndCELevelForCECapableUEs.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (cellIdentifierAndCELevelForCECapableUEs *CellIdentifierAndCELevelForCECapableUEs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *cellIdentifierAndCELevelForCECapableUEs = CellIdentifierAndCELevelForCECapableUEs{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&cellIdentifierAndCELevelForCECapableUEs.GlobalCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&cellIdentifierAndCELevelForCECapableUEs.CELevel).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellIdentifierAndCELevelForCECapableUEs, cellIdentifierAndCELevelForCECapableUEs, &cellIdentifierAndCELevelForCECapableUEs.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := cellIdentifierAndCELevelForCECapableUEs.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsCellIdentifierAndCELevelForCECapableUEs []apimpl.IESpec[ProtocolIEID, CellIdentifierAndCELevelForCECapableUEs] + +func (cellIdentifierAndCELevelForCECapableUEs *CellIdentifierAndCELevelForCECapableUEs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if cellIdentifierAndCELevelForCECapableUEs.GlobalCellID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsCellIdentifierAndCELevelForCECapableUEs, cellIdentifierAndCELevelForCECapableUEs, &cellIdentifierAndCELevelForCECapableUEs.iEExtensions) return notComprehended } @@ -1055,19 +1634,19 @@ func (cellSize CellSize) Name() string { return enumCellSize.Name(cellSize) } -func (cellSize CellSize) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (cellSize CellSize) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCellSize.Known(cellSize) } func (cellType *CellType) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCellType, cellType, cellType.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCellType, cellType, cellType.iEExtensions) w.WriteBit(cellType.extensions.Present()) w.WriteBit(len(ext) > 0) if err := cellType.CellSize.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1093,7 +1672,7 @@ func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCellType, cellType, &cellType.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCellType, cellType, &cellType.iEExtensions); err != nil { return err } } @@ -1105,14 +1684,14 @@ func (cellType *CellType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsCellType []ap.IESpec[ProtocolIEID, CellType] +var extIEsCellType []apimpl.IESpec[ProtocolIEID, CellType] -func (cellType *CellType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellType *CellType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if cellType.CellSize.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCellType, cellType, cellType.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCellType, cellType, &cellType.iEExtensions) return notComprehended } @@ -1133,19 +1712,19 @@ func (coarseUELocationRequested CoarseUELocationRequested) Name() string { return enumCoarseUELocationRequested.Name(coarseUELocationRequested) } -func (coarseUELocationRequested CoarseUELocationRequested) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (coarseUELocationRequested CoarseUELocationRequested) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumCoarseUELocationRequested.Known(coarseUELocationRequested) } func (completedCellInEAIItem *CompletedCellInEAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCompletedCellInEAIItem, completedCellInEAIItem, completedCellInEAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCompletedCellInEAIItem, completedCellInEAIItem, completedCellInEAIItem.iEExtensions) w.WriteBit(completedCellInEAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := completedCellInEAIItem.ECGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1171,7 +1750,7 @@ func (completedCellInEAIItem *CompletedCellInEAIItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellInEAIItem, completedCellInEAIItem, &completedCellInEAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellInEAIItem, completedCellInEAIItem, &completedCellInEAIItem.iEExtensions); err != nil { return err } } @@ -1183,26 +1762,26 @@ func (completedCellInEAIItem *CompletedCellInEAIItem) UnmarshalPER(r *per.Reader return nil } -var extIEsCompletedCellInEAIItem []ap.IESpec[ProtocolIEID, CompletedCellInEAIItem] +var extIEsCompletedCellInEAIItem []apimpl.IESpec[ProtocolIEID, CompletedCellInEAIItem] -func (completedCellInEAIItem *CompletedCellInEAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (completedCellInEAIItem *CompletedCellInEAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if completedCellInEAIItem.ECGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCompletedCellInEAIItem, completedCellInEAIItem, completedCellInEAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCompletedCellInEAIItem, completedCellInEAIItem, &completedCellInEAIItem.iEExtensions) return notComprehended } func (completedCellInTAIItem *CompletedCellInTAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCompletedCellInTAIItem, completedCellInTAIItem, completedCellInTAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCompletedCellInTAIItem, completedCellInTAIItem, completedCellInTAIItem.iEExtensions) w.WriteBit(completedCellInTAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := completedCellInTAIItem.ECGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1228,7 +1807,7 @@ func (completedCellInTAIItem *CompletedCellInTAIItem) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellInTAIItem, completedCellInTAIItem, &completedCellInTAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCompletedCellInTAIItem, completedCellInTAIItem, &completedCellInTAIItem.iEExtensions); err != nil { return err } } @@ -1240,19 +1819,99 @@ func (completedCellInTAIItem *CompletedCellInTAIItem) UnmarshalPER(r *per.Reader return nil } -var extIEsCompletedCellInTAIItem []ap.IESpec[ProtocolIEID, CompletedCellInTAIItem] +var extIEsCompletedCellInTAIItem []apimpl.IESpec[ProtocolIEID, CompletedCellInTAIItem] -func (completedCellInTAIItem *CompletedCellInTAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (completedCellInTAIItem *CompletedCellInTAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if completedCellInTAIItem.ECGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCompletedCellInTAIItem, completedCellInTAIItem, completedCellInTAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCompletedCellInTAIItem, completedCellInTAIItem, &completedCellInTAIItem.iEExtensions) + return notComprehended +} + +func (concurrentWarningMessageIndicator ConcurrentWarningMessageIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumConcurrentWarningMessageIndicator.Encode(w, enc, concurrentWarningMessageIndicator) +} + +func (concurrentWarningMessageIndicator *ConcurrentWarningMessageIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumConcurrentWarningMessageIndicator.Decode(r, enc) + if err != nil { + return err + } + *concurrentWarningMessageIndicator = v + return nil +} + +func (concurrentWarningMessageIndicator ConcurrentWarningMessageIndicator) Name() string { + return enumConcurrentWarningMessageIndicator.Name(concurrentWarningMessageIndicator) +} + +func (connectedengNBItem *ConnectedengNBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsConnectedengNBItem, connectedengNBItem, connectedengNBItem.iEExtensions) + w.WriteBit(connectedengNBItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := connectedengNBItem.EngNBID.MarshalPER(w, enc); err != nil { + return err + } + if err := connectedengNBItem.SupportedTAs.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if connectedengNBItem.extensions.Present() { + if err := connectedengNBItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (connectedengNBItem *ConnectedengNBItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *connectedengNBItem = ConnectedengNBItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&connectedengNBItem.EngNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&connectedengNBItem.SupportedTAs).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsConnectedengNBItem, connectedengNBItem, &connectedengNBItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := connectedengNBItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsConnectedengNBItem []apimpl.IESpec[ProtocolIEID, ConnectedengNBItem] + +func (connectedengNBItem *ConnectedengNBItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if connectedengNBItem.SupportedTAs.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsConnectedengNBItem, connectedengNBItem, &connectedengNBItem.iEExtensions) return notComprehended } func (contextatSource *ContextatSource) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsContextatSource, contextatSource, contextatSource.iEExtensions) + ext := apimpl.ExtensionFields(extIEsContextatSource, contextatSource, contextatSource.iEExtensions) w.WriteBit(contextatSource.extensions.Present()) w.WriteBit(len(ext) > 0) if err := contextatSource.SourceNGRANNodeID.MarshalPER(w, enc); err != nil { @@ -1262,7 +1921,7 @@ func (contextatSource *ContextatSource) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1291,7 +1950,7 @@ func (contextatSource *ContextatSource) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsContextatSource, contextatSource, &contextatSource.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsContextatSource, contextatSource, &contextatSource.iEExtensions); err != nil { return err } } @@ -1303,21 +1962,42 @@ func (contextatSource *ContextatSource) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsContextatSource []ap.IESpec[ProtocolIEID, ContextatSource] +var extIEsContextatSource []apimpl.IESpec[ProtocolIEID, ContextatSource] -func (contextatSource *ContextatSource) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (contextatSource *ContextatSource) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if contextatSource.SourceNGRANNodeID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsContextatSource, contextatSource, contextatSource.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsContextatSource, contextatSource, &contextatSource.iEExtensions) return notComprehended } -func (criticalityDiagnostics *CriticalityDiagnostics) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) - w.WriteBit(criticalityDiagnostics.extensions.Present()) - w.WriteBit(criticalityDiagnostics.ProcedureCode != nil) +func (coverageLevel CoverageLevel) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumCoverageLevel.Encode(w, enc, coverageLevel) +} + +func (coverageLevel *CoverageLevel) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumCoverageLevel.Decode(r, enc) + if err != nil { + return err + } + *coverageLevel = v + return nil +} + +func (coverageLevel CoverageLevel) Name() string { + return enumCoverageLevel.Name(coverageLevel) +} + +func (coverageLevel CoverageLevel) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumCoverageLevel.Known(coverageLevel) +} + +func (criticalityDiagnostics *CriticalityDiagnostics) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + w.WriteBit(criticalityDiagnostics.extensions.Present()) + w.WriteBit(criticalityDiagnostics.ProcedureCode != nil) w.WriteBit(criticalityDiagnostics.TriggeringMessage != nil) w.WriteBit(criticalityDiagnostics.ProcedureCriticality != nil) w.WriteBit(criticalityDiagnostics.IEsCriticalityDiagnostics != nil) @@ -1353,7 +2033,7 @@ func (criticalityDiagnostics *CriticalityDiagnostics) MarshalPER(w *per.Writer, } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1432,7 +2112,7 @@ func (criticalityDiagnostics *CriticalityDiagnostics) UnmarshalPER(r *per.Reader } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions); err != nil { return err } } @@ -1444,21 +2124,21 @@ func (criticalityDiagnostics *CriticalityDiagnostics) UnmarshalPER(r *per.Reader return nil } -var extIEsCriticalityDiagnostics []ap.IESpec[ProtocolIEID, CriticalityDiagnostics] +var extIEsCriticalityDiagnostics []apimpl.IESpec[ProtocolIEID, CriticalityDiagnostics] -func (criticalityDiagnostics *CriticalityDiagnostics) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (criticalityDiagnostics *CriticalityDiagnostics) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range criticalityDiagnostics.IEsCriticalityDiagnostics { if criticalityDiagnostics.IEsCriticalityDiagnostics[i].Diagnose(d) { notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsCriticalityDiagnostics, criticalityDiagnostics, criticalityDiagnostics.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCriticalityDiagnostics, criticalityDiagnostics, &criticalityDiagnostics.iEExtensions) return notComprehended } func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) w.WriteBit(criticalityDiagnosticsIEItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeEnumerated(w, enc, 3, false, int64(criticalityDiagnosticsIEItem.IECriticality)); err != nil { @@ -1471,7 +2151,7 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1507,7 +2187,7 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions); err != nil { return err } } @@ -1519,14 +2199,14 @@ func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) UnmarshalPER(r return nil } -var extIEsCriticalityDiagnosticsIEItem []ap.IESpec[ProtocolIEID, CriticalityDiagnosticsIEItem] +var extIEsCriticalityDiagnosticsIEItem []apimpl.IESpec[ProtocolIEID, CriticalityDiagnosticsIEItem] -func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (criticalityDiagnosticsIEItem *CriticalityDiagnosticsIEItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if criticalityDiagnosticsIEItem.TypeOfError.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsCriticalityDiagnosticsIEItem, criticalityDiagnosticsIEItem, &criticalityDiagnosticsIEItem.iEExtensions) return notComprehended } @@ -1547,19 +2227,19 @@ func (dAPSIndicator DAPSIndicator) Name() string { return enumDAPSIndicator.Name(dAPSIndicator) } -func (dAPSIndicator DAPSIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dAPSIndicator DAPSIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDAPSIndicator.Known(dAPSIndicator) } func (dAPSRequestInfo *DAPSRequestInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) w.WriteBit(dAPSRequestInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := dAPSRequestInfo.DAPSIndicator.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1585,7 +2265,7 @@ func (dAPSRequestInfo *DAPSRequestInfo) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions); err != nil { return err } } @@ -1597,14 +2277,14 @@ func (dAPSRequestInfo *DAPSRequestInfo) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsDAPSRequestInfo []ap.IESpec[ProtocolIEID, DAPSRequestInfo] +var extIEsDAPSRequestInfo []apimpl.IESpec[ProtocolIEID, DAPSRequestInfo] -func (dAPSRequestInfo *DAPSRequestInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (dAPSRequestInfo *DAPSRequestInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if dAPSRequestInfo.DAPSIndicator.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsDAPSRequestInfo, dAPSRequestInfo, dAPSRequestInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsDAPSRequestInfo, dAPSRequestInfo, &dAPSRequestInfo.iEExtensions) return notComprehended } @@ -1625,10 +2305,31 @@ func (dLForwarding DLForwarding) Name() string { return enumDLForwarding.Name(dLForwarding) } -func (dLForwarding DLForwarding) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dLForwarding DLForwarding) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDLForwarding.Known(dLForwarding) } +func (dLNASPDUDeliveryAckRequest DLNASPDUDeliveryAckRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumDLNASPDUDeliveryAckRequest.Encode(w, enc, dLNASPDUDeliveryAckRequest) +} + +func (dLNASPDUDeliveryAckRequest *DLNASPDUDeliveryAckRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumDLNASPDUDeliveryAckRequest.Decode(r, enc) + if err != nil { + return err + } + *dLNASPDUDeliveryAckRequest = v + return nil +} + +func (dLNASPDUDeliveryAckRequest DLNASPDUDeliveryAckRequest) Name() string { + return enumDLNASPDUDeliveryAckRequest.Name(dLNASPDUDeliveryAckRequest) +} + +func (dLNASPDUDeliveryAckRequest DLNASPDUDeliveryAckRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumDLNASPDUDeliveryAckRequest.Known(dLNASPDUDeliveryAckRequest) +} + func (dataForwardingNotPossible DataForwardingNotPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { return enumDataForwardingNotPossible.Encode(w, enc, dataForwardingNotPossible) } @@ -1646,7 +2347,7 @@ func (dataForwardingNotPossible DataForwardingNotPossible) Name() string { return enumDataForwardingNotPossible.Name(dataForwardingNotPossible) } -func (dataForwardingNotPossible DataForwardingNotPossible) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (dataForwardingNotPossible DataForwardingNotPossible) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDataForwardingNotPossible.Known(dataForwardingNotPossible) } @@ -1667,10 +2368,31 @@ func (directForwardingPathAvailability DirectForwardingPathAvailability) Name() return enumDirectForwardingPathAvailability.Name(directForwardingPathAvailability) } -func (directForwardingPathAvailability DirectForwardingPathAvailability) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (directForwardingPathAvailability DirectForwardingPathAvailability) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumDirectForwardingPathAvailability.Known(directForwardingPathAvailability) } +func (eDTSession EDTSession) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEDTSession.Encode(w, enc, eDTSession) +} + +func (eDTSession *EDTSession) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEDTSession.Decode(r, enc) + if err != nil { + return err + } + *eDTSession = v + return nil +} + +func (eDTSession EDTSession) Name() string { + return enumEDTSession.Name(eDTSession) +} + +func (eDTSession EDTSession) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumEDTSession.Known(eDTSession) +} + func (eNBID *ENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { set := 0 for _, ok := range [...]bool{eNBID.MacroENBID != nil, eNBID.HomeENBID != nil, eNBID.ShortMacroENBID != nil, eNBID.LongMacroENBID != nil, eNBID.Ext != nil} { @@ -1733,13 +2455,13 @@ func (eNBID *ENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { switch extIdx { case 0: var v ShortMacroENBID - if err := per.DecodeOpenType(r, enc, &v); err != nil { + if err := per.DecodeCompleteOpenType(r, enc, &v); err != nil { return err } eNBID.ShortMacroENBID = &v case 1: var v LongMacroENBID - if err := per.DecodeOpenType(r, enc, &v); err != nil { + if err := per.DecodeCompleteOpenType(r, enc, &v); err != nil { return err } eNBID.LongMacroENBID = &v @@ -1772,7 +2494,7 @@ func (eNBID *ENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (eNBID *ENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNBID *ENBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case eNBID.MacroENBID != nil: case eNBID.HomeENBID != nil: @@ -1785,7 +2507,7 @@ func (eNBID *ENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { } func (eNBX2ExtTLA *ENBX2ExtTLA) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsENBX2ExtTLA, eNBX2ExtTLA, eNBX2ExtTLA.iEExtensions) + ext := apimpl.ExtensionFields(extIEsENBX2ExtTLA, eNBX2ExtTLA, eNBX2ExtTLA.iEExtensions) w.WriteBit(eNBX2ExtTLA.extensions.Present()) w.WriteBit(eNBX2ExtTLA.IPsecTLA != nil) w.WriteBit(eNBX2ExtTLA.GTPTLAa != nil) @@ -1801,7 +2523,7 @@ func (eNBX2ExtTLA *ENBX2ExtTLA) MarshalPER(w *per.Writer, enc per.Encoding) erro } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -1844,7 +2566,7 @@ func (eNBX2ExtTLA *ENBX2ExtTLA) UnmarshalPER(r *per.Reader, enc per.Encoding) er } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsENBX2ExtTLA, eNBX2ExtTLA, &eNBX2ExtTLA.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsENBX2ExtTLA, eNBX2ExtTLA, &eNBX2ExtTLA.iEExtensions); err != nil { return err } } @@ -1856,83 +2578,50 @@ func (eNBX2ExtTLA *ENBX2ExtTLA) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsENBX2ExtTLA []ap.IESpec[ProtocolIEID, ENBX2ExtTLA] +var extIEsENBX2ExtTLA []apimpl.IESpec[ProtocolIEID, ENBX2ExtTLA] -func (eNBX2ExtTLA *ENBX2ExtTLA) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNBX2ExtTLA *ENBX2ExtTLA) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsENBX2ExtTLA, eNBX2ExtTLA, eNBX2ExtTLA.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsENBX2ExtTLA, eNBX2ExtTLA, &eNBX2ExtTLA.iEExtensions) return notComprehended } -func (eRABAdmittedItem *ERABAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABAdmittedItem, eRABAdmittedItem, eRABAdmittedItem.iEExtensions) - w.WriteBit(eRABAdmittedItem.extensions.Present()) - w.WriteBit(eRABAdmittedItem.DLTransportLayerAddr != nil) - w.WriteBit(eRABAdmittedItem.DLGTPTEID != nil) - w.WriteBit(eRABAdmittedItem.ULTransportLayerAddr != nil) - w.WriteBit(eRABAdmittedItem.ULGTPTEID != nil) +func (eNDCSONConfigurationTransfer *ENDCSONConfigurationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsENDCSONConfigurationTransfer, eNDCSONConfigurationTransfer, eNDCSONConfigurationTransfer.iEExtensions) + w.WriteBit(eNDCSONConfigurationTransfer.extensions.Present()) + w.WriteBit(eNDCSONConfigurationTransfer.X2TNLConfigInfo != nil) w.WriteBit(len(ext) > 0) - if err := eRABAdmittedItem.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABAdmittedItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if err := eNDCSONConfigurationTransfer.Transfertype.MarshalPER(w, enc); err != nil { return err } - if err := eRABAdmittedItem.GTPTEID.MarshalPER(w, enc); err != nil { + if err := eNDCSONConfigurationTransfer.SONInformation.MarshalPER(w, enc); err != nil { return err } - if eRABAdmittedItem.DLTransportLayerAddr != nil { - if err := (*eRABAdmittedItem.DLTransportLayerAddr).MarshalPER(w, enc); err != nil { - return err - } - } - if eRABAdmittedItem.DLGTPTEID != nil { - if err := (*eRABAdmittedItem.DLGTPTEID).MarshalPER(w, enc); err != nil { - return err - } - } - if eRABAdmittedItem.ULTransportLayerAddr != nil { - if err := (*eRABAdmittedItem.ULTransportLayerAddr).MarshalPER(w, enc); err != nil { - return err - } - } - if eRABAdmittedItem.ULGTPTEID != nil { - if err := (*eRABAdmittedItem.ULGTPTEID).MarshalPER(w, enc); err != nil { + if eNDCSONConfigurationTransfer.X2TNLConfigInfo != nil { + if err := (*eNDCSONConfigurationTransfer.X2TNLConfigInfo).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABAdmittedItem.extensions.Present() { - if err := eRABAdmittedItem.extensions.MarshalPER(w, enc); err != nil { + if eNDCSONConfigurationTransfer.extensions.Present() { + if err := eNDCSONConfigurationTransfer.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABAdmittedItem *ERABAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABAdmittedItem = ERABAdmittedItem{} +func (eNDCSONConfigurationTransfer *ENDCSONConfigurationTransfer) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNDCSONConfigurationTransfer = ENDCSONConfigurationTransfer{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLTransportLayerAddr, err := r.ReadBit() - if err != nil { - return err - } - p_DLGTPTEID, err := r.ReadBit() - if err != nil { - return err - } - p_ULTransportLayerAddr, err := r.ReadBit() - if err != nil { - return err - } - p_ULGTPTEID, err := r.ReadBit() + p_X2TNLConfigInfo, err := r.ReadBit() if err != nil { return err } @@ -1940,371 +2629,291 @@ func (eRABAdmittedItem *ERABAdmittedItem) UnmarshalPER(r *per.Reader, enc per.En if err != nil { return err } - if err := (&eRABAdmittedItem.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABAdmittedItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&eNDCSONConfigurationTransfer.Transfertype).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABAdmittedItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&eNDCSONConfigurationTransfer.SONInformation).UnmarshalPER(r, enc); err != nil { return err } - if p_DLTransportLayerAddr { - var v TransportLayerAddress - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABAdmittedItem.DLTransportLayerAddr = &v - } - if p_DLGTPTEID { - var v GTPTEID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABAdmittedItem.DLGTPTEID = &v - } - if p_ULTransportLayerAddr { - var v TransportLayerAddress - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABAdmittedItem.ULTransportLayerAddr = &v - } - if p_ULGTPTEID { - var v GTPTEID + if p_X2TNLConfigInfo { + var v X2TNLConfigurationInfo if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - eRABAdmittedItem.ULGTPTEID = &v + eNDCSONConfigurationTransfer.X2TNLConfigInfo = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABAdmittedItem, eRABAdmittedItem, &eRABAdmittedItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsENDCSONConfigurationTransfer, eNDCSONConfigurationTransfer, &eNDCSONConfigurationTransfer.iEExtensions); err != nil { return err } } if extBit { - if err := eRABAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eNDCSONConfigurationTransfer.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABAdmittedItem []ap.IESpec[ProtocolIEID, ERABAdmittedItem] +var extIEsENDCSONConfigurationTransfer []apimpl.IESpec[ProtocolIEID, ENDCSONConfigurationTransfer] -func (eRABAdmittedItem *ERABAdmittedItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNDCSONConfigurationTransfer *ENDCSONConfigurationTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABAdmittedItem.ERABID.Diagnose(d) { + if eNDCSONConfigurationTransfer.Transfertype.Diagnose(d) { + notComprehended = true + } + if eNDCSONConfigurationTransfer.SONInformation.Diagnose(d) { + notComprehended = true + } + if eNDCSONConfigurationTransfer.X2TNLConfigInfo != nil && eNDCSONConfigurationTransfer.X2TNLConfigInfo.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABAdmittedItem, eRABAdmittedItem, eRABAdmittedItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsENDCSONConfigurationTransfer, eNDCSONConfigurationTransfer, &eNDCSONConfigurationTransfer.iEExtensions) return notComprehended } -func (eRABDataForwardingItem *ERABDataForwardingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABDataForwardingItem, eRABDataForwardingItem, eRABDataForwardingItem.iEExtensions) - w.WriteBit(eRABDataForwardingItem.extensions.Present()) - w.WriteBit(eRABDataForwardingItem.DLTransportLayerAddr != nil) - w.WriteBit(eRABDataForwardingItem.DLGTPTEID != nil) - w.WriteBit(eRABDataForwardingItem.ULTransportLayerAddr != nil) - w.WriteBit(eRABDataForwardingItem.ULGTPTEID != nil) - w.WriteBit(len(ext) > 0) - if err := eRABDataForwardingItem.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if eRABDataForwardingItem.DLTransportLayerAddr != nil { - if err := (*eRABDataForwardingItem.DLTransportLayerAddr).MarshalPER(w, enc); err != nil { - return err +func (eNDCSONTransferType *ENDCSONTransferType) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{eNDCSONTransferType.Request != nil, eNDCSONTransferType.Reply != nil, eNDCSONTransferType.Ext != nil} { + if ok { + set++ } } - if eRABDataForwardingItem.DLGTPTEID != nil { - if err := (*eRABDataForwardingItem.DLGTPTEID).MarshalPER(w, enc); err != nil { - return err - } + if set > 1 { + return per.ErrChoice } - if eRABDataForwardingItem.ULTransportLayerAddr != nil { - if err := (*eRABDataForwardingItem.ULTransportLayerAddr).MarshalPER(w, enc); err != nil { + switch { + case eNDCSONTransferType.Request != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { return err } - } - if eRABDataForwardingItem.ULGTPTEID != nil { - if err := (*eRABDataForwardingItem.ULGTPTEID).MarshalPER(w, enc); err != nil { + if err := (*eNDCSONTransferType.Request).MarshalPER(w, enc); err != nil { return err } - } - if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + case eNDCSONTransferType.Reply != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - } - if eRABDataForwardingItem.extensions.Present() { - if err := eRABDataForwardingItem.extensions.MarshalPER(w, enc); err != nil { + if err := (*eNDCSONTransferType.Reply).MarshalPER(w, enc); err != nil { return err } + case eNDCSONTransferType.Ext != nil: + w.WriteBit(true) + return eNDCSONTransferType.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty } return nil } -func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABDataForwardingItem = ERABDataForwardingItem{} - extBit, err := r.ReadBit() +func (eNDCSONTransferType *ENDCSONTransferType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNDCSONTransferType = ENDCSONTransferType{} + isExt, err := r.ReadBit() if err != nil { return err } - p_DLTransportLayerAddr, err := r.ReadBit() - if err != nil { + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + eNDCSONTransferType.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) return err } - p_DLGTPTEID, err := r.ReadBit() + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) if err != nil { return err } - p_ULTransportLayerAddr, err := r.ReadBit() - if err != nil { - return err + switch idx { + case 0: + var v ENDCTransferTypeRequest + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eNDCSONTransferType.Request = &v + case 1: + var v ENDCTransferTypeReply + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eNDCSONTransferType.Reply = &v + default: + return per.ErrOverflow } - p_ULGTPTEID, err := r.ReadBit() - if err != nil { - return err + return nil +} + +func (eNDCSONTransferType *ENDCSONTransferType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + switch { + case eNDCSONTransferType.Request != nil: + return eNDCSONTransferType.Request.Diagnose(d) + case eNDCSONTransferType.Reply != nil: + return eNDCSONTransferType.Reply.Diagnose(d) + case eNDCSONTransferType.Ext != nil: + return true } - p_iEExtensions, err := r.ReadBit() - if err != nil { + return false +} + +func (eNDCSONeNBIdentification *ENDCSONeNBIdentification) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsENDCSONeNBIdentification, eNDCSONeNBIdentification, eNDCSONeNBIdentification.iEExtensions) + w.WriteBit(eNDCSONeNBIdentification.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eNDCSONeNBIdentification.GlobaleNBID.MarshalPER(w, enc); err != nil { return err } - if err := (&eRABDataForwardingItem.ERABID).UnmarshalPER(r, enc); err != nil { + if err := eNDCSONeNBIdentification.SelectedTAI.MarshalPER(w, enc); err != nil { return err } - if p_DLTransportLayerAddr { - var v TransportLayerAddress - if err := (&v).UnmarshalPER(r, enc); err != nil { + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - eRABDataForwardingItem.DLTransportLayerAddr = &v } - if p_DLGTPTEID { - var v GTPTEID - if err := (&v).UnmarshalPER(r, enc); err != nil { + if eNDCSONeNBIdentification.extensions.Present() { + if err := eNDCSONeNBIdentification.extensions.MarshalPER(w, enc); err != nil { return err } - eRABDataForwardingItem.DLGTPTEID = &v } - if p_ULTransportLayerAddr { - var v TransportLayerAddress - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABDataForwardingItem.ULTransportLayerAddr = &v + return nil +} + +func (eNDCSONeNBIdentification *ENDCSONeNBIdentification) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNDCSONeNBIdentification = ENDCSONeNBIdentification{} + extBit, err := r.ReadBit() + if err != nil { + return err } - if p_ULGTPTEID { - var v GTPTEID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABDataForwardingItem.ULGTPTEID = &v + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eNDCSONeNBIdentification.GlobaleNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eNDCSONeNBIdentification.SelectedTAI).UnmarshalPER(r, enc); err != nil { + return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABDataForwardingItem, eRABDataForwardingItem, &eRABDataForwardingItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsENDCSONeNBIdentification, eNDCSONeNBIdentification, &eNDCSONeNBIdentification.iEExtensions); err != nil { return err } } if extBit { - if err := eRABDataForwardingItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eNDCSONeNBIdentification.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABDataForwardingItem []ap.IESpec[ProtocolIEID, ERABDataForwardingItem] +var extIEsENDCSONeNBIdentification []apimpl.IESpec[ProtocolIEID, ENDCSONeNBIdentification] -func (eRABDataForwardingItem *ERABDataForwardingItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNDCSONeNBIdentification *ENDCSONeNBIdentification) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABDataForwardingItem.ERABID.Diagnose(d) { + if eNDCSONeNBIdentification.GlobaleNBID.Diagnose(d) { + notComprehended = true + } + if eNDCSONeNBIdentification.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABDataForwardingItem, eRABDataForwardingItem, eRABDataForwardingItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsENDCSONeNBIdentification, eNDCSONeNBIdentification, &eNDCSONeNBIdentification.iEExtensions) return notComprehended } -func (eRABInformationListItem *ERABInformationListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABInformationListItem, eRABInformationListItem, eRABInformationListItem.iEExtensions) - w.WriteBit(eRABInformationListItem.extensions.Present()) - w.WriteBit(eRABInformationListItem.DLForwarding != nil) +func (eNDCSONengNBIdentification *ENDCSONengNBIdentification) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsENDCSONengNBIdentification, eNDCSONengNBIdentification, eNDCSONengNBIdentification.iEExtensions) + w.WriteBit(eNDCSONengNBIdentification.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eRABInformationListItem.ERABID.MarshalPER(w, enc); err != nil { + if err := eNDCSONengNBIdentification.GlobalengNBID.MarshalPER(w, enc); err != nil { return err } - if eRABInformationListItem.DLForwarding != nil { - if err := (*eRABInformationListItem.DLForwarding).MarshalPER(w, enc); err != nil { - return err - } + if err := eNDCSONengNBIdentification.SelectedTAI.MarshalPER(w, enc); err != nil { + return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABInformationListItem.extensions.Present() { - if err := eRABInformationListItem.extensions.MarshalPER(w, enc); err != nil { + if eNDCSONengNBIdentification.extensions.Present() { + if err := eNDCSONengNBIdentification.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABInformationListItem *ERABInformationListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABInformationListItem = ERABInformationListItem{} +func (eNDCSONengNBIdentification *ENDCSONengNBIdentification) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNDCSONengNBIdentification = ENDCSONengNBIdentification{} extBit, err := r.ReadBit() if err != nil { return err } - p_DLForwarding, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() - if err != nil { + if err := (&eNDCSONengNBIdentification.GlobalengNBID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABInformationListItem.ERABID).UnmarshalPER(r, enc); err != nil { + if err := (&eNDCSONengNBIdentification.SelectedTAI).UnmarshalPER(r, enc); err != nil { return err } - if p_DLForwarding { - var v DLForwarding - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - eRABInformationListItem.DLForwarding = &v - } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABInformationListItem, eRABInformationListItem, &eRABInformationListItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsENDCSONengNBIdentification, eNDCSONengNBIdentification, &eNDCSONengNBIdentification.iEExtensions); err != nil { return err } } if extBit { - if err := eRABInformationListItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eNDCSONengNBIdentification.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABInformationListItem = []ap.IESpec[ProtocolIEID, ERABInformationListItem]{ - { - ID: IDDAPSRequestInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { - var v DAPSRequestInfo - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.DAPSRequestInfo = &v - return nil - }, - Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { - if x.DAPSRequestInfo == nil { - return nil, false - } - return x.DAPSRequestInfo, true - }, - }, - { - ID: IDSourceTransportLayerAddress, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { - var v TransportLayerAddress - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.SourceTransportLayerAddress = &v - return nil - }, - Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { - if x.SourceTransportLayerAddress == nil { - return nil, false - } - return x.SourceTransportLayerAddress, true - }, - }, - { - ID: IDSecurityIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { - var v SecurityIndication - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.SecurityIndication = &v - return nil - }, - Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { - if x.SecurityIndication == nil { - return nil, false - } - return x.SecurityIndication, true - }, - }, - { - ID: IDSourceNodeTransportLayerAddress, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { - var v TransportLayerAddress - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.SourceNodeTransportLayerAddress = &v - return nil - }, - Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { - if x.SourceNodeTransportLayerAddress == nil { - return nil, false - } - return x.SourceNodeTransportLayerAddress, true - }, - }, -} +var extIEsENDCSONengNBIdentification []apimpl.IESpec[ProtocolIEID, ENDCSONengNBIdentification] -func (eRABInformationListItem *ERABInformationListItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNDCSONengNBIdentification *ENDCSONengNBIdentification) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABInformationListItem.ERABID.Diagnose(d) { + if eNDCSONengNBIdentification.GlobalengNBID.Diagnose(d) { notComprehended = true } - if eRABInformationListItem.DLForwarding != nil && eRABInformationListItem.DLForwarding.Diagnose(d) { + if eNDCSONengNBIdentification.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABInformationListItem, eRABInformationListItem, eRABInformationListItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsENDCSONengNBIdentification, eNDCSONengNBIdentification, &eNDCSONengNBIdentification.iEExtensions) return notComprehended } -func (eRABItem *ERABItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABItem, eRABItem, eRABItem.iEExtensions) - w.WriteBit(eRABItem.extensions.Present()) +func (eNDCTransferTypeReply *ENDCTransferTypeReply) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsENDCTransferTypeReply, eNDCTransferTypeReply, eNDCTransferTypeReply.iEExtensions) + w.WriteBit(eNDCTransferTypeReply.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eRABItem.ERABID.MarshalPER(w, enc); err != nil { + if err := eNDCTransferTypeReply.SourceengNB.MarshalPER(w, enc); err != nil { return err } - if err := eRABItem.Cause.MarshalPER(w, enc); err != nil { + if err := eNDCTransferTypeReply.TargeteNB.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABItem.extensions.Present() { - if err := eRABItem.extensions.MarshalPER(w, enc); err != nil { + if eNDCTransferTypeReply.extensions.Present() { + if err := eNDCTransferTypeReply.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABItem *ERABItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABItem = ERABItem{} +func (eNDCTransferTypeReply *ENDCTransferTypeReply) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNDCTransferTypeReply = ENDCTransferTypeReply{} extBit, err := r.ReadBit() if err != nil { return err @@ -2313,75 +2922,95 @@ func (eRABItem *ERABItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { if err != nil { return err } - if err := (&eRABItem.ERABID).UnmarshalPER(r, enc); err != nil { + if err := (&eNDCTransferTypeReply.SourceengNB).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABItem.Cause).UnmarshalPER(r, enc); err != nil { + if err := (&eNDCTransferTypeReply.TargeteNB).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABItem, eRABItem, &eRABItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsENDCTransferTypeReply, eNDCTransferTypeReply, &eNDCTransferTypeReply.iEExtensions); err != nil { return err } } if extBit { - if err := eRABItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eNDCTransferTypeReply.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABItem []ap.IESpec[ProtocolIEID, ERABItem] +var extIEsENDCTransferTypeReply []apimpl.IESpec[ProtocolIEID, ENDCTransferTypeReply] -func (eRABItem *ERABItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNDCTransferTypeReply *ENDCTransferTypeReply) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABItem.ERABID.Diagnose(d) { + if eNDCTransferTypeReply.SourceengNB.Diagnose(d) { notComprehended = true } - if eRABItem.Cause.Diagnose(d) { + if eNDCTransferTypeReply.TargeteNB.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABItem, eRABItem, eRABItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsENDCTransferTypeReply, eNDCTransferTypeReply, &eNDCTransferTypeReply.iEExtensions) return notComprehended } -func (eRABLevelQoSParameters *ERABLevelQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABLevelQoSParameters, eRABLevelQoSParameters, eRABLevelQoSParameters.iEExtensions) - w.WriteBit(eRABLevelQoSParameters.extensions.Present()) - w.WriteBit(eRABLevelQoSParameters.GBR != nil) +func (eNDCTransferTypeRequest *ENDCTransferTypeRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsENDCTransferTypeRequest, eNDCTransferTypeRequest, eNDCTransferTypeRequest.iEExtensions) + w.WriteBit(eNDCTransferTypeRequest.extensions.Present()) + w.WriteBit(eNDCTransferTypeRequest.TargeteNB != nil) + w.WriteBit(eNDCTransferTypeRequest.AssociatedTAI != nil) + w.WriteBit(eNDCTransferTypeRequest.Broadcast5GSTAI != nil) w.WriteBit(len(ext) > 0) - if err := eRABLevelQoSParameters.QCI.MarshalPER(w, enc); err != nil { + if err := eNDCTransferTypeRequest.SourceeNB.MarshalPER(w, enc); err != nil { return err } - if err := eRABLevelQoSParameters.ARP.MarshalPER(w, enc); err != nil { + if err := eNDCTransferTypeRequest.TargetengNB.MarshalPER(w, enc); err != nil { return err } - if eRABLevelQoSParameters.GBR != nil { - if err := (*eRABLevelQoSParameters.GBR).MarshalPER(w, enc); err != nil { + if eNDCTransferTypeRequest.TargeteNB != nil { + if err := (*eNDCTransferTypeRequest.TargeteNB).MarshalPER(w, enc); err != nil { + return err + } + } + if eNDCTransferTypeRequest.AssociatedTAI != nil { + if err := (*eNDCTransferTypeRequest.AssociatedTAI).MarshalPER(w, enc); err != nil { + return err + } + } + if eNDCTransferTypeRequest.Broadcast5GSTAI != nil { + if err := (*eNDCTransferTypeRequest.Broadcast5GSTAI).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABLevelQoSParameters.extensions.Present() { - if err := eRABLevelQoSParameters.extensions.MarshalPER(w, enc); err != nil { + if eNDCTransferTypeRequest.extensions.Present() { + if err := eNDCTransferTypeRequest.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABLevelQoSParameters *ERABLevelQoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABLevelQoSParameters = ERABLevelQoSParameters{} +func (eNDCTransferTypeRequest *ENDCTransferTypeRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eNDCTransferTypeRequest = ENDCTransferTypeRequest{} extBit, err := r.ReadBit() if err != nil { return err } - p_GBR, err := r.ReadBit() + p_TargeteNB, err := r.ReadBit() + if err != nil { + return err + } + p_AssociatedTAI, err := r.ReadBit() + if err != nil { + return err + } + p_Broadcast5GSTAI, err := r.ReadBit() if err != nil { return err } @@ -2389,651 +3018,599 @@ func (eRABLevelQoSParameters *ERABLevelQoSParameters) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&eRABLevelQoSParameters.QCI).UnmarshalPER(r, enc); err != nil { + if err := (&eNDCTransferTypeRequest.SourceeNB).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABLevelQoSParameters.ARP).UnmarshalPER(r, enc); err != nil { + if err := (&eNDCTransferTypeRequest.TargetengNB).UnmarshalPER(r, enc); err != nil { return err } - if p_GBR { - var v GBRQosInformation + if p_TargeteNB { + var v ENDCSONeNBIdentification if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - eRABLevelQoSParameters.GBR = &v + eNDCTransferTypeRequest.TargeteNB = &v + } + if p_AssociatedTAI { + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eNDCTransferTypeRequest.AssociatedTAI = &v + } + if p_Broadcast5GSTAI { + var v FiveGSTAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eNDCTransferTypeRequest.Broadcast5GSTAI = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABLevelQoSParameters, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsENDCTransferTypeRequest, eNDCTransferTypeRequest, &eNDCTransferTypeRequest.iEExtensions); err != nil { return err } } if extBit { - if err := eRABLevelQoSParameters.extensions.UnmarshalPER(r, enc); err != nil { + if err := eNDCTransferTypeRequest.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABLevelQoSParameters = []ap.IESpec[ProtocolIEID, ERABLevelQoSParameters]{ - { - ID: IDDownlinkPacketLossRate, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABLevelQoSParameters, r *per.Reader, enc per.Encoding) error { - var v PacketLossRate - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.DownlinkPacketLossRate = &v - return nil - }, - Encode: func(x *ERABLevelQoSParameters) (per.Marshaler, bool) { - if x.DownlinkPacketLossRate == nil { - return nil, false - } - return x.DownlinkPacketLossRate, true - }, - }, - { - ID: IDUplinkPacketLossRate, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABLevelQoSParameters, r *per.Reader, enc per.Encoding) error { - var v PacketLossRate - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.UplinkPacketLossRate = &v - return nil - }, - Encode: func(x *ERABLevelQoSParameters) (per.Marshaler, bool) { - if x.UplinkPacketLossRate == nil { - return nil, false - } - return x.UplinkPacketLossRate, true - }, - }, -} +var extIEsENDCTransferTypeRequest []apimpl.IESpec[ProtocolIEID, ENDCTransferTypeRequest] -func (eRABLevelQoSParameters *ERABLevelQoSParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNDCTransferTypeRequest *ENDCTransferTypeRequest) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABLevelQoSParameters.ARP.Diagnose(d) { + if eNDCTransferTypeRequest.SourceeNB.Diagnose(d) { notComprehended = true } - if eRABLevelQoSParameters.GBR != nil && eRABLevelQoSParameters.GBR.Diagnose(d) { + if eNDCTransferTypeRequest.TargetengNB.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABLevelQoSParameters, eRABLevelQoSParameters, eRABLevelQoSParameters.iEExtensions) - return notComprehended -} - -func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, eRABModifyItemBearerModRes.iEExtensions) - w.WriteBit(eRABModifyItemBearerModRes.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := eRABModifyItemBearerModRes.ERABID.MarshalPER(w, enc); err != nil { - return err + if eNDCTransferTypeRequest.TargeteNB != nil && eNDCTransferTypeRequest.TargeteNB.Diagnose(d) { + notComprehended = true } - if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { - return err - } + if eNDCTransferTypeRequest.AssociatedTAI != nil && eNDCTransferTypeRequest.AssociatedTAI.Diagnose(d) { + notComprehended = true } - if eRABModifyItemBearerModRes.extensions.Present() { - if err := eRABModifyItemBearerModRes.extensions.MarshalPER(w, enc); err != nil { - return err - } + if eNDCTransferTypeRequest.Broadcast5GSTAI != nil && eNDCTransferTypeRequest.Broadcast5GSTAI.Diagnose(d) { + notComprehended = true } - return nil + apimpl.DiagnoseExtensions(d, extIEsENDCTransferTypeRequest, eNDCTransferTypeRequest, &eNDCTransferTypeRequest.iEExtensions) + return notComprehended } -func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABModifyItemBearerModRes = ERABModifyItemBearerModRes{} - extBit, err := r.ReadBit() - if err != nil { +func (eRABAdmittedItem *ERABAdmittedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABAdmittedItem, eRABAdmittedItem, eRABAdmittedItem.iEExtensions) + w.WriteBit(eRABAdmittedItem.extensions.Present()) + w.WriteBit(eRABAdmittedItem.DLTransportLayerAddr != nil) + w.WriteBit(eRABAdmittedItem.DLGTPTEID != nil) + w.WriteBit(eRABAdmittedItem.ULTransportLayerAddr != nil) + w.WriteBit(eRABAdmittedItem.ULGTPTEID != nil) + w.WriteBit(len(ext) > 0) + if err := eRABAdmittedItem.ERABID.MarshalPER(w, enc); err != nil { return err } - p_iEExtensions, err := r.ReadBit() - if err != nil { + if err := eRABAdmittedItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := (&eRABModifyItemBearerModRes.ERABID).UnmarshalPER(r, enc); err != nil { + if err := eRABAdmittedItem.GTPTEID.MarshalPER(w, enc); err != nil { return err } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, &eRABModifyItemBearerModRes.iEExtensions); err != nil { + if eRABAdmittedItem.DLTransportLayerAddr != nil { + if err := (*eRABAdmittedItem.DLTransportLayerAddr).MarshalPER(w, enc); err != nil { return err } } - if extBit { - if err := eRABModifyItemBearerModRes.extensions.UnmarshalPER(r, enc); err != nil { + if eRABAdmittedItem.DLGTPTEID != nil { + if err := (*eRABAdmittedItem.DLGTPTEID).MarshalPER(w, enc); err != nil { return err } } - return nil -} - -var extIEsERABModifyItemBearerModRes []ap.IESpec[ProtocolIEID, ERABModifyItemBearerModRes] - -func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - if eRABModifyItemBearerModRes.ERABID.Diagnose(d) { - notComprehended = true + if eRABAdmittedItem.ULTransportLayerAddr != nil { + if err := (*eRABAdmittedItem.ULTransportLayerAddr).MarshalPER(w, enc); err != nil { + return err + } } - ap.DiagnoseExtensions(d, extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, eRABModifyItemBearerModRes.iEExtensions) - return notComprehended -} - -func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp.iEExtensions) - w.WriteBit(eRABReleaseItemBearerRelComp.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := eRABReleaseItemBearerRelComp.ERABID.MarshalPER(w, enc); err != nil { - return err + if eRABAdmittedItem.ULGTPTEID != nil { + if err := (*eRABAdmittedItem.ULGTPTEID).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABReleaseItemBearerRelComp.extensions.Present() { - if err := eRABReleaseItemBearerRelComp.extensions.MarshalPER(w, enc); err != nil { + if eRABAdmittedItem.extensions.Present() { + if err := eRABAdmittedItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABReleaseItemBearerRelComp = ERABReleaseItemBearerRelComp{} +func (eRABAdmittedItem *ERABAdmittedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABAdmittedItem = ERABAdmittedItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_DLTransportLayerAddr, err := r.ReadBit() if err != nil { return err } - if err := (&eRABReleaseItemBearerRelComp.ERABID).UnmarshalPER(r, enc); err != nil { + p_DLGTPTEID, err := r.ReadBit() + if err != nil { return err } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, &eRABReleaseItemBearerRelComp.iEExtensions); err != nil { - return err - } + p_ULTransportLayerAddr, err := r.ReadBit() + if err != nil { + return err } - if extBit { - if err := eRABReleaseItemBearerRelComp.extensions.UnmarshalPER(r, enc); err != nil { - return err - } + p_ULGTPTEID, err := r.ReadBit() + if err != nil { + return err } - return nil -} - -var extIEsERABReleaseItemBearerRelComp []ap.IESpec[ProtocolIEID, ERABReleaseItemBearerRelComp] - -func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - if eRABReleaseItemBearerRelComp.ERABID.Diagnose(d) { - notComprehended = true + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err } - ap.DiagnoseExtensions(d, extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp.iEExtensions) - return notComprehended -} - -func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, eRABSetupItemCtxtSURes.iEExtensions) - w.WriteBit(eRABSetupItemCtxtSURes.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := eRABSetupItemCtxtSURes.ERABID.MarshalPER(w, enc); err != nil { + if err := (&eRABAdmittedItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := eRABSetupItemCtxtSURes.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if err := (&eRABAdmittedItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if err := eRABSetupItemCtxtSURes.GTPTEID.MarshalPER(w, enc); err != nil { + if err := (&eRABAdmittedItem.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if p_DLTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + eRABAdmittedItem.DLTransportLayerAddr = &v } - if eRABSetupItemCtxtSURes.extensions.Present() { - if err := eRABSetupItemCtxtSURes.extensions.MarshalPER(w, enc); err != nil { + if p_DLGTPTEID { + var v GTPTEID + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + eRABAdmittedItem.DLGTPTEID = &v } - return nil -} - -func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABSetupItemCtxtSURes = ERABSetupItemCtxtSURes{} - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err - } - if err := (&eRABSetupItemCtxtSURes.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABSetupItemCtxtSURes.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { - return err + if p_ULTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABAdmittedItem.ULTransportLayerAddr = &v } - if err := (&eRABSetupItemCtxtSURes.GTPTEID).UnmarshalPER(r, enc); err != nil { - return err + if p_ULGTPTEID { + var v GTPTEID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABAdmittedItem.ULGTPTEID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, &eRABSetupItemCtxtSURes.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABAdmittedItem, eRABAdmittedItem, &eRABAdmittedItem.iEExtensions); err != nil { return err } } if extBit { - if err := eRABSetupItemCtxtSURes.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABAdmittedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABSetupItemCtxtSURes []ap.IESpec[ProtocolIEID, ERABSetupItemCtxtSURes] +var extIEsERABAdmittedItem []apimpl.IESpec[ProtocolIEID, ERABAdmittedItem] -func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABAdmittedItem *ERABAdmittedItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABSetupItemCtxtSURes.ERABID.Diagnose(d) { + if eRABAdmittedItem.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, eRABSetupItemCtxtSURes.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABAdmittedItem, eRABAdmittedItem, &eRABAdmittedItem.iEExtensions) return notComprehended } -func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd.iEExtensions) - w.WriteBit(eRABToBeModifiedItemBearerModInd.extensions.Present()) +func (eRABDataForwardingItem *ERABDataForwardingItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABDataForwardingItem, eRABDataForwardingItem, eRABDataForwardingItem.iEExtensions) + w.WriteBit(eRABDataForwardingItem.extensions.Present()) + w.WriteBit(eRABDataForwardingItem.DLTransportLayerAddr != nil) + w.WriteBit(eRABDataForwardingItem.DLGTPTEID != nil) + w.WriteBit(eRABDataForwardingItem.ULTransportLayerAddr != nil) + w.WriteBit(eRABDataForwardingItem.ULGTPTEID != nil) w.WriteBit(len(ext) > 0) - if err := eRABToBeModifiedItemBearerModInd.ERABID.MarshalPER(w, enc); err != nil { + if err := eRABDataForwardingItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeModifiedItemBearerModInd.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err + if eRABDataForwardingItem.DLTransportLayerAddr != nil { + if err := (*eRABDataForwardingItem.DLTransportLayerAddr).MarshalPER(w, enc); err != nil { + return err + } } - if err := eRABToBeModifiedItemBearerModInd.DLGTPTEID.MarshalPER(w, enc); err != nil { - return err + if eRABDataForwardingItem.DLGTPTEID != nil { + if err := (*eRABDataForwardingItem.DLGTPTEID).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABDataForwardingItem.ULTransportLayerAddr != nil { + if err := (*eRABDataForwardingItem.ULTransportLayerAddr).MarshalPER(w, enc); err != nil { + return err + } + } + if eRABDataForwardingItem.ULGTPTEID != nil { + if err := (*eRABDataForwardingItem.ULGTPTEID).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeModifiedItemBearerModInd.extensions.Present() { - if err := eRABToBeModifiedItemBearerModInd.extensions.MarshalPER(w, enc); err != nil { + if eRABDataForwardingItem.extensions.Present() { + if err := eRABDataForwardingItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABToBeModifiedItemBearerModInd = ERABToBeModifiedItemBearerModInd{} +func (eRABDataForwardingItem *ERABDataForwardingItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABDataForwardingItem = ERABDataForwardingItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_DLTransportLayerAddr, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModInd.ERABID).UnmarshalPER(r, enc); err != nil { + p_DLGTPTEID, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModInd.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + p_ULTransportLayerAddr, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModInd.DLGTPTEID).UnmarshalPER(r, enc); err != nil { + p_ULGTPTEID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&eRABDataForwardingItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } + if p_DLTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABDataForwardingItem.DLTransportLayerAddr = &v + } + if p_DLGTPTEID { + var v GTPTEID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABDataForwardingItem.DLGTPTEID = &v + } + if p_ULTransportLayerAddr { + var v TransportLayerAddress + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABDataForwardingItem.ULTransportLayerAddr = &v + } + if p_ULGTPTEID { + var v GTPTEID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABDataForwardingItem.ULGTPTEID = &v + } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, &eRABToBeModifiedItemBearerModInd.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABDataForwardingItem, eRABDataForwardingItem, &eRABDataForwardingItem.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeModifiedItemBearerModInd.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABDataForwardingItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABToBeModifiedItemBearerModInd []ap.IESpec[ProtocolIEID, ERABToBeModifiedItemBearerModInd] +var extIEsERABDataForwardingItem []apimpl.IESpec[ProtocolIEID, ERABDataForwardingItem] -func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABDataForwardingItem *ERABDataForwardingItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABToBeModifiedItemBearerModInd.ERABID.Diagnose(d) { + if eRABDataForwardingItem.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABDataForwardingItem, eRABDataForwardingItem, &eRABDataForwardingItem.iEExtensions) return notComprehended } -func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq.iEExtensions) - w.WriteBit(eRABToBeModifiedItemBearerModReq.extensions.Present()) +func (eRABInformationListItem *ERABInformationListItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABInformationListItem, eRABInformationListItem, eRABInformationListItem.iEExtensions) + w.WriteBit(eRABInformationListItem.extensions.Present()) + w.WriteBit(eRABInformationListItem.DLForwarding != nil) w.WriteBit(len(ext) > 0) - if err := eRABToBeModifiedItemBearerModReq.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeModifiedItemBearerModReq.QoS.MarshalPER(w, enc); err != nil { + if err := eRABInformationListItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeModifiedItemBearerModReq.NASPDU.MarshalPER(w, enc); err != nil { - return err + if eRABInformationListItem.DLForwarding != nil { + if err := (*eRABInformationListItem.DLForwarding).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeModifiedItemBearerModReq.extensions.Present() { - if err := eRABToBeModifiedItemBearerModReq.extensions.MarshalPER(w, enc); err != nil { + if eRABInformationListItem.extensions.Present() { + if err := eRABInformationListItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABToBeModifiedItemBearerModReq = ERABToBeModifiedItemBearerModReq{} +func (eRABInformationListItem *ERABInformationListItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABInformationListItem = ERABInformationListItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_DLForwarding, err := r.ReadBit() if err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModReq.ERABID).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModReq.QoS).UnmarshalPER(r, enc); err != nil { + if err := (&eRABInformationListItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeModifiedItemBearerModReq.NASPDU).UnmarshalPER(r, enc); err != nil { - return err + if p_DLForwarding { + var v DLForwarding + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABInformationListItem.DLForwarding = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABInformationListItem, eRABInformationListItem, &eRABInformationListItem.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeModifiedItemBearerModReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABInformationListItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABToBeModifiedItemBearerModReq = []ap.IESpec[ProtocolIEID, ERABToBeModifiedItemBearerModReq]{ +var extIEsERABInformationListItem = []apimpl.IESpec[ProtocolIEID, ERABInformationListItem]{ { - ID: IDTransportInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, - Decode: func(x *ERABToBeModifiedItemBearerModReq, r *per.Reader, enc per.Encoding) error { - var v TransportInformation + ID: IDDAPSRequestInfo, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v DAPSRequestInfo if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.TransportInformation = &v + x.DAPSRequestInfo = &v return nil }, - Encode: func(x *ERABToBeModifiedItemBearerModReq) (per.Marshaler, bool) { - if x.TransportInformation == nil { + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.DAPSRequestInfo == nil { return nil, false } - return x.TransportInformation, true + return x.DAPSRequestInfo, true + }, + Clear: func(x *ERABInformationListItem) { + x.DAPSRequestInfo = nil }, }, -} - -func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - if eRABToBeModifiedItemBearerModReq.ERABID.Diagnose(d) { - notComprehended = true - } - if eRABToBeModifiedItemBearerModReq.QoS.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq.iEExtensions) - return notComprehended -} - -func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq.iEExtensions) - w.WriteBit(eRABToBeSetupItemBearerSUReq.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := eRABToBeSetupItemBearerSUReq.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemBearerSUReq.QoS.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemBearerSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemBearerSUReq.GTPTEID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemBearerSUReq.NASPDU.MarshalPER(w, enc); err != nil { - return err - } - if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { - return err - } - } - if eRABToBeSetupItemBearerSUReq.extensions.Present() { - if err := eRABToBeSetupItemBearerSUReq.extensions.MarshalPER(w, enc); err != nil { - return err - } - } - return nil -} - -func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABToBeSetupItemBearerSUReq = ERABToBeSetupItemBearerSUReq{} - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err - } - if err := (&eRABToBeSetupItemBearerSUReq.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemBearerSUReq.QoS).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemBearerSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemBearerSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemBearerSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { - return err - } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions); err != nil { - return err - } - } - if extBit { - if err := eRABToBeSetupItemBearerSUReq.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil -} - -var extIEsERABToBeSetupItemBearerSUReq = []ap.IESpec[ProtocolIEID, ERABToBeSetupItemBearerSUReq]{ { - ID: IDCorrelationID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { - var v CorrelationID + ID: IDSourceTransportLayerAddress, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.CorrelationID = &v + x.SourceTransportLayerAddress = &v return nil }, - Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { - if x.CorrelationID == nil { + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.SourceTransportLayerAddress == nil { return nil, false } - return x.CorrelationID, true - }, - }, - { - ID: IDSIPTOCorrelationID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { - var v CorrelationID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.SIPTOCorrelationID = &v - return nil + return x.SourceTransportLayerAddress, true }, - Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { - if x.SIPTOCorrelationID == nil { - return nil, false - } - return x.SIPTOCorrelationID, true + Clear: func(x *ERABInformationListItem) { + x.SourceTransportLayerAddress = nil }, }, { - ID: IDBearerType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, - Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { - var v BearerType + ID: IDSecurityIndication, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.BearerType = &v + x.SecurityIndication = &v return nil }, - Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { - if x.BearerType == nil { + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.SecurityIndication == nil { return nil, false } - return x.BearerType, true - }, - }, - { - ID: IDEthernetType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { - var v EthernetType - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.EthernetType = &v - return nil + return x.SecurityIndication, true }, - Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { - if x.EthernetType == nil { - return nil, false - } - return x.EthernetType, true + Clear: func(x *ERABInformationListItem) { + x.SecurityIndication = nil }, }, { - ID: IDSecurityIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, - Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { - var v SecurityIndication + ID: IDSourceNodeTransportLayerAddress, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABInformationListItem, r *per.Reader, enc per.Encoding) error { + var v TransportLayerAddress if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.SecurityIndication = &v + x.SourceNodeTransportLayerAddress = &v return nil }, - Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { - if x.SecurityIndication == nil { + Encode: func(x *ERABInformationListItem) (per.Marshaler, bool) { + if x.SourceNodeTransportLayerAddress == nil { return nil, false } - return x.SecurityIndication, true + return x.SourceNodeTransportLayerAddress, true + }, + Clear: func(x *ERABInformationListItem) { + x.SourceNodeTransportLayerAddress = nil }, }, } -func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABInformationListItem *ERABInformationListItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABToBeSetupItemBearerSUReq.ERABID.Diagnose(d) { + if eRABInformationListItem.ERABID.Diagnose(d) { notComprehended = true } - if eRABToBeSetupItemBearerSUReq.QoS.Diagnose(d) { + if eRABInformationListItem.DLForwarding != nil && eRABInformationListItem.DLForwarding.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABInformationListItem, eRABInformationListItem, &eRABInformationListItem.iEExtensions) return notComprehended } -func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq.iEExtensions) - w.WriteBit(eRABToBeSetupItemCtxtSUReq.extensions.Present()) - w.WriteBit(eRABToBeSetupItemCtxtSUReq.NASPDU != nil) +func (eRABItem *ERABItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABItem, eRABItem, eRABItem.iEExtensions) + w.WriteBit(eRABItem.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eRABToBeSetupItemCtxtSUReq.ERABID.MarshalPER(w, enc); err != nil { + if err := eRABItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSetupItemCtxtSUReq.QoS.MarshalPER(w, enc); err != nil { + if err := eRABItem.Cause.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSetupItemCtxtSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if eRABItem.extensions.Present() { + if err := eRABItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (eRABItem *ERABItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABItem = ERABItem{} + extBit, err := r.ReadBit() + if err != nil { return err } - if err := eRABToBeSetupItemCtxtSUReq.GTPTEID.MarshalPER(w, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if eRABToBeSetupItemCtxtSUReq.NASPDU != nil { - if err := eRABToBeSetupItemCtxtSUReq.NASPDU.MarshalPER(w, enc); err != nil { + if err := (&eRABItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABItem.Cause).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABItem, eRABItem, &eRABItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := eRABItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsERABItem []apimpl.IESpec[ProtocolIEID, ERABItem] + +func (eRABItem *ERABItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABItem.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABItem.Cause.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsERABItem, eRABItem, &eRABItem.iEExtensions) + return notComprehended +} + +func (eRABLevelQoSParameters *ERABLevelQoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABLevelQoSParameters, eRABLevelQoSParameters, eRABLevelQoSParameters.iEExtensions) + w.WriteBit(eRABLevelQoSParameters.extensions.Present()) + w.WriteBit(eRABLevelQoSParameters.GBR != nil) + w.WriteBit(len(ext) > 0) + if err := eRABLevelQoSParameters.QCI.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABLevelQoSParameters.ARP.MarshalPER(w, enc); err != nil { + return err + } + if eRABLevelQoSParameters.GBR != nil { + if err := (*eRABLevelQoSParameters.GBR).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSetupItemCtxtSUReq.extensions.Present() { - if err := eRABToBeSetupItemCtxtSUReq.extensions.MarshalPER(w, enc); err != nil { + if eRABLevelQoSParameters.extensions.Present() { + if err := eRABLevelQoSParameters.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABToBeSetupItemCtxtSUReq = ERABToBeSetupItemCtxtSUReq{} +func (eRABLevelQoSParameters *ERABLevelQoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABLevelQoSParameters = ERABLevelQoSParameters{} extBit, err := r.ReadBit() if err != nil { return err } - p_NASPDU, err := r.ReadBit() + p_GBR, err := r.ReadBit() if err != nil { return err } @@ -3041,177 +3618,113 @@ func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *pe if err != nil { return err } - if err := (&eRABToBeSetupItemCtxtSUReq.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemCtxtSUReq.QoS).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemCtxtSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&eRABLevelQoSParameters.QCI).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeSetupItemCtxtSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABLevelQoSParameters.ARP).UnmarshalPER(r, enc); err != nil { return err } - if p_NASPDU { - if err := (&eRABToBeSetupItemCtxtSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { + if p_GBR { + var v GBRQosInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + eRABLevelQoSParameters.GBR = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABLevelQoSParameters, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeSetupItemCtxtSUReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABLevelQoSParameters.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABToBeSetupItemCtxtSUReq = []ap.IESpec[ProtocolIEID, ERABToBeSetupItemCtxtSUReq]{ +var extIEsERABLevelQoSParameters = []apimpl.IESpec[ProtocolIEID, ERABLevelQoSParameters]{ { - ID: IDCorrelationID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { - var v CorrelationID + ID: IDDownlinkPacketLossRate, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABLevelQoSParameters, r *per.Reader, enc per.Encoding) error { + var v PacketLossRate if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.CorrelationID = &v + x.DownlinkPacketLossRate = &v return nil }, - Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { - if x.CorrelationID == nil { + Encode: func(x *ERABLevelQoSParameters) (per.Marshaler, bool) { + if x.DownlinkPacketLossRate == nil { return nil, false } - return x.CorrelationID, true + return x.DownlinkPacketLossRate, true + }, + Clear: func(x *ERABLevelQoSParameters) { + x.DownlinkPacketLossRate = nil }, }, { - ID: IDSIPTOCorrelationID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { - var v CorrelationID + ID: IDUplinkPacketLossRate, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABLevelQoSParameters, r *per.Reader, enc per.Encoding) error { + var v PacketLossRate if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.SIPTOCorrelationID = &v + x.UplinkPacketLossRate = &v return nil }, - Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { - if x.SIPTOCorrelationID == nil { + Encode: func(x *ERABLevelQoSParameters) (per.Marshaler, bool) { + if x.UplinkPacketLossRate == nil { return nil, false } - return x.SIPTOCorrelationID, true - }, - }, - { - ID: IDBearerType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, - Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { - var v BearerType - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.BearerType = &v - return nil - }, - Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { - if x.BearerType == nil { - return nil, false - } - return x.BearerType, true - }, - }, - { - ID: IDEthernetType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { - var v EthernetType - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.EthernetType = &v - return nil - }, - Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { - if x.EthernetType == nil { - return nil, false - } - return x.EthernetType, true - }, - }, - { - ID: IDSecurityIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, - Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { - var v SecurityIndication - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.SecurityIndication = &v - return nil - }, - Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { - if x.SecurityIndication == nil { - return nil, false - } - return x.SecurityIndication, true + return x.UplinkPacketLossRate, true + }, + Clear: func(x *ERABLevelQoSParameters) { + x.UplinkPacketLossRate = nil }, }, } -func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABLevelQoSParameters *ERABLevelQoSParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABToBeSetupItemCtxtSUReq.ERABID.Diagnose(d) { + if eRABLevelQoSParameters.ARP.Diagnose(d) { notComprehended = true } - if eRABToBeSetupItemCtxtSUReq.QoS.Diagnose(d) { + if eRABLevelQoSParameters.GBR != nil && eRABLevelQoSParameters.GBR.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABLevelQoSParameters, eRABLevelQoSParameters, &eRABLevelQoSParameters.iEExtensions) return notComprehended } -func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, eRABToBeSetupItemHOReq.iEExtensions) - w.WriteBit(eRABToBeSetupItemHOReq.extensions.Present()) +func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, eRABModifyItemBearerModRes.iEExtensions) + w.WriteBit(eRABModifyItemBearerModRes.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eRABToBeSetupItemHOReq.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemHOReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemHOReq.GTPTEID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSetupItemHOReq.QoS.MarshalPER(w, enc); err != nil { + if err := eRABModifyItemBearerModRes.ERABID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSetupItemHOReq.extensions.Present() { - if err := eRABToBeSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { + if eRABModifyItemBearerModRes.extensions.Present() { + if err := eRABModifyItemBearerModRes.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABToBeSetupItemHOReq = ERABToBeSetupItemHOReq{} +func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABModifyItemBearerModRes = ERABModifyItemBearerModRes{} extBit, err := r.ReadBit() if err != nil { return err @@ -3220,150 +3733,61 @@ func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&eRABToBeSetupItemHOReq.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemHOReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemHOReq.GTPTEID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSetupItemHOReq.QoS).UnmarshalPER(r, enc); err != nil { + if err := (&eRABModifyItemBearerModRes.ERABID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, &eRABToBeSetupItemHOReq.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, &eRABModifyItemBearerModRes.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABModifyItemBearerModRes.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABToBeSetupItemHOReq = []ap.IESpec[ProtocolIEID, ERABToBeSetupItemHOReq]{ - { - ID: IDDataForwardingNotPossible, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { - var v DataForwardingNotPossible - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.DataForwardingNotPossible = &v - return nil - }, - Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { - if x.DataForwardingNotPossible == nil { - return nil, false - } - return x.DataForwardingNotPossible, true - }, - }, - { - ID: IDBearerType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, - Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { - var v BearerType - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.BearerType = &v - return nil - }, - Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { - if x.BearerType == nil { - return nil, false - } - return x.BearerType, true - }, - }, - { - ID: IDEthernetType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { - var v EthernetType - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.EthernetType = &v - return nil - }, - Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { - if x.EthernetType == nil { - return nil, false - } - return x.EthernetType, true - }, - }, - { - ID: IDSecurityIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, - Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { - var v SecurityIndication - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.SecurityIndication = &v - return nil - }, - Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { - if x.SecurityIndication == nil { - return nil, false - } - return x.SecurityIndication, true - }, - }, -} +var extIEsERABModifyItemBearerModRes []apimpl.IESpec[ProtocolIEID, ERABModifyItemBearerModRes] -func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABModifyItemBearerModRes *ERABModifyItemBearerModRes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABToBeSetupItemHOReq.ERABID.Diagnose(d) { - notComprehended = true - } - if eRABToBeSetupItemHOReq.QoS.Diagnose(d) { + if eRABModifyItemBearerModRes.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, eRABToBeSetupItemHOReq.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABModifyItemBearerModRes, eRABModifyItemBearerModRes, &eRABModifyItemBearerModRes.iEExtensions) return notComprehended } -func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, eRABToBeSwitchedDLItem.iEExtensions) - w.WriteBit(eRABToBeSwitchedDLItem.extensions.Present()) +func (eRABNotToBeModifiedItemBearerModInd *ERABNotToBeModifiedItemBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABNotToBeModifiedItemBearerModInd, eRABNotToBeModifiedItemBearerModInd, eRABNotToBeModifiedItemBearerModInd.iEExtensions) + w.WriteBit(eRABNotToBeModifiedItemBearerModInd.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eRABToBeSwitchedDLItem.ERABID.MarshalPER(w, enc); err != nil { + if err := eRABNotToBeModifiedItemBearerModInd.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSwitchedDLItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { + if err := eRABNotToBeModifiedItemBearerModInd.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := eRABToBeSwitchedDLItem.GTPTEID.MarshalPER(w, enc); err != nil { + if err := eRABNotToBeModifiedItemBearerModInd.DLGTPTEID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSwitchedDLItem.extensions.Present() { - if err := eRABToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { + if eRABNotToBeModifiedItemBearerModInd.extensions.Present() { + if err := eRABNotToBeModifiedItemBearerModInd.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABToBeSwitchedDLItem = ERABToBeSwitchedDLItem{} +func (eRABNotToBeModifiedItemBearerModInd *ERABNotToBeModifiedItemBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABNotToBeModifiedItemBearerModInd = ERABNotToBeModifiedItemBearerModInd{} extBit, err := r.ReadBit() if err != nil { return err @@ -3372,87 +3796,61 @@ func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.ERABID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABNotToBeModifiedItemBearerModInd.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + if err := (&eRABNotToBeModifiedItemBearerModInd.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eRABToBeSwitchedDLItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABNotToBeModifiedItemBearerModInd.DLGTPTEID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABNotToBeModifiedItemBearerModInd, eRABNotToBeModifiedItemBearerModInd, &eRABNotToBeModifiedItemBearerModInd.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABNotToBeModifiedItemBearerModInd.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABToBeSwitchedDLItem = []ap.IESpec[ProtocolIEID, ERABToBeSwitchedDLItem]{ - { - ID: IDSecurityIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *ERABToBeSwitchedDLItem, r *per.Reader, enc per.Encoding) error { - var v SecurityIndication - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.SecurityIndication = &v - return nil - }, - Encode: func(x *ERABToBeSwitchedDLItem) (per.Marshaler, bool) { - if x.SecurityIndication == nil { - return nil, false - } - return x.SecurityIndication, true - }, - }, -} +var extIEsERABNotToBeModifiedItemBearerModInd []apimpl.IESpec[ProtocolIEID, ERABNotToBeModifiedItemBearerModInd] -func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABNotToBeModifiedItemBearerModInd *ERABNotToBeModifiedItemBearerModInd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABToBeSwitchedDLItem.ERABID.Diagnose(d) { + if eRABNotToBeModifiedItemBearerModInd.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, eRABToBeSwitchedDLItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABNotToBeModifiedItemBearerModInd, eRABNotToBeModifiedItemBearerModInd, &eRABNotToBeModifiedItemBearerModInd.iEExtensions) return notComprehended } -func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, eRABToBeSwitchedULItem.iEExtensions) - w.WriteBit(eRABToBeSwitchedULItem.extensions.Present()) +func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp.iEExtensions) + w.WriteBit(eRABReleaseItemBearerRelComp.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eRABToBeSwitchedULItem.ERABID.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSwitchedULItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { - return err - } - if err := eRABToBeSwitchedULItem.GTPTEID.MarshalPER(w, enc); err != nil { + if err := eRABReleaseItemBearerRelComp.ERABID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eRABToBeSwitchedULItem.extensions.Present() { - if err := eRABToBeSwitchedULItem.extensions.MarshalPER(w, enc); err != nil { + if eRABReleaseItemBearerRelComp.extensions.Present() { + if err := eRABReleaseItemBearerRelComp.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eRABToBeSwitchedULItem = ERABToBeSwitchedULItem{} +func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABReleaseItemBearerRelComp = ERABReleaseItemBearerRelComp{} extBit, err := r.ReadBit() if err != nil { return err @@ -3461,64 +3859,61 @@ func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&eRABToBeSwitchedULItem.ERABID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSwitchedULItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&eRABToBeSwitchedULItem.GTPTEID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABReleaseItemBearerRelComp.ERABID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, &eRABToBeSwitchedULItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, &eRABReleaseItemBearerRelComp.iEExtensions); err != nil { return err } } if extBit { - if err := eRABToBeSwitchedULItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABReleaseItemBearerRelComp.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsERABToBeSwitchedULItem []ap.IESpec[ProtocolIEID, ERABToBeSwitchedULItem] +var extIEsERABReleaseItemBearerRelComp []apimpl.IESpec[ProtocolIEID, ERABReleaseItemBearerRelComp] -func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABReleaseItemBearerRelComp *ERABReleaseItemBearerRelComp) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if eRABToBeSwitchedULItem.ERABID.Diagnose(d) { + if eRABReleaseItemBearerRelComp.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, eRABToBeSwitchedULItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABReleaseItemBearerRelComp, eRABReleaseItemBearerRelComp, &eRABReleaseItemBearerRelComp.iEExtensions) return notComprehended } -func (eUTRANCGI *EUTRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEUTRANCGI, eUTRANCGI, eUTRANCGI.iEExtensions) - w.WriteBit(eUTRANCGI.extensions.Present()) +func (eRABSetupItemBearerSURes *ERABSetupItemBearerSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABSetupItemBearerSURes, eRABSetupItemBearerSURes, eRABSetupItemBearerSURes.iEExtensions) + w.WriteBit(eRABSetupItemBearerSURes.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := eUTRANCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := eRABSetupItemBearerSURes.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := eUTRANCGI.CellID.MarshalPER(w, enc); err != nil { + if err := eRABSetupItemBearerSURes.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABSetupItemBearerSURes.GTPTEID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if eUTRANCGI.extensions.Present() { - if err := eUTRANCGI.extensions.MarshalPER(w, enc); err != nil { + if eRABSetupItemBearerSURes.extensions.Present() { + if err := eRABSetupItemBearerSURes.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (eUTRANCGI *EUTRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *eUTRANCGI = EUTRANCGI{} +func (eRABSetupItemBearerSURes *ERABSetupItemBearerSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABSetupItemBearerSURes = ERABSetupItemBearerSURes{} extBit, err := r.ReadBit() if err != nil { return err @@ -3527,68 +3922,67 @@ func (eUTRANCGI *EUTRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error if err != nil { return err } - if err := (&eUTRANCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABSetupItemBearerSURes.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&eUTRANCGI.CellID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABSetupItemBearerSURes.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABSetupItemBearerSURes.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCGI, eUTRANCGI, &eUTRANCGI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABSetupItemBearerSURes, eRABSetupItemBearerSURes, &eRABSetupItemBearerSURes.iEExtensions); err != nil { return err } } if extBit { - if err := eUTRANCGI.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABSetupItemBearerSURes.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsEUTRANCGI []ap.IESpec[ProtocolIEID, EUTRANCGI] +var extIEsERABSetupItemBearerSURes []apimpl.IESpec[ProtocolIEID, ERABSetupItemBearerSURes] -func (eUTRANCGI *EUTRANCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABSetupItemBearerSURes *ERABSetupItemBearerSURes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsEUTRANCGI, eUTRANCGI, eUTRANCGI.iEExtensions) + if eRABSetupItemBearerSURes.ERABID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsERABSetupItemBearerSURes, eRABSetupItemBearerSURes, &eRABSetupItemBearerSURes.iEExtensions) return notComprehended } -func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem.iEExtensions) - w.WriteBit(emergencyAreaIDBroadcastItem.extensions.Present()) +func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, eRABSetupItemCtxtSURes.iEExtensions) + w.WriteBit(eRABSetupItemCtxtSURes.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := emergencyAreaIDBroadcastItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + if err := eRABSetupItemCtxtSURes.ERABID.MarshalPER(w, enc); err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastItem.CompletedCellInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { + if err := eRABSetupItemCtxtSURes.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABSetupItemCtxtSURes.GTPTEID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if emergencyAreaIDBroadcastItem.extensions.Present() { - if err := emergencyAreaIDBroadcastItem.extensions.MarshalPER(w, enc); err != nil { + if eRABSetupItemCtxtSURes.extensions.Present() { + if err := eRABSetupItemCtxtSURes.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *emergencyAreaIDBroadcastItem = EmergencyAreaIDBroadcastItem{} +func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABSetupItemCtxtSURes = ERABSetupItemCtxtSURes{} extBit, err := r.ReadBit() if err != nil { return err @@ -3597,83 +3991,67 @@ func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) UnmarshalPER(r if err != nil { return err } - if err := (&emergencyAreaIDBroadcastItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABSetupItemCtxtSURes.ERABID).UnmarshalPER(r, enc); err != nil { return err } - emergencyAreaIDBroadcastItem.CompletedCellInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDBroadcastItem.CompletedCellInEAI) - emergencyAreaIDBroadcastItem.CompletedCellInEAI = append(emergencyAreaIDBroadcastItem.CompletedCellInEAI, make([]CompletedCellInEAIItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDBroadcastItem.CompletedCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&eRABSetupItemCtxtSURes.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABSetupItemCtxtSURes.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, &emergencyAreaIDBroadcastItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, &eRABSetupItemCtxtSURes.iEExtensions); err != nil { return err } } if extBit { - if err := emergencyAreaIDBroadcastItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABSetupItemCtxtSURes.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsEmergencyAreaIDBroadcastItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastItem] +var extIEsERABSetupItemCtxtSURes []apimpl.IESpec[ProtocolIEID, ERABSetupItemCtxtSURes] -func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABSetupItemCtxtSURes *ERABSetupItemCtxtSURes) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range emergencyAreaIDBroadcastItem.CompletedCellInEAI { - if emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].Diagnose(d) { - notComprehended = true - } + if eRABSetupItemCtxtSURes.ERABID.Diagnose(d) { + notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABSetupItemCtxtSURes, eRABSetupItemCtxtSURes, &eRABSetupItemCtxtSURes.iEExtensions) return notComprehended } -func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem.iEExtensions) - w.WriteBit(emergencyAreaIDCancelledItem.extensions.Present()) +func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd.iEExtensions) + w.WriteBit(eRABToBeModifiedItemBearerModInd.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := emergencyAreaIDCancelledItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + if err := eRABToBeModifiedItemBearerModInd.ERABID.MarshalPER(w, enc); err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledItem.CancelledCellInEAI)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := emergencyAreaIDCancelledItem.CancelledCellInEAI[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { + if err := eRABToBeModifiedItemBearerModInd.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeModifiedItemBearerModInd.DLGTPTEID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if emergencyAreaIDCancelledItem.extensions.Present() { - if err := emergencyAreaIDCancelledItem.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeModifiedItemBearerModInd.extensions.Present() { + if err := eRABToBeModifiedItemBearerModInd.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *emergencyAreaIDCancelledItem = EmergencyAreaIDCancelledItem{} +func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeModifiedItemBearerModInd = ERABToBeModifiedItemBearerModInd{} extBit, err := r.ReadBit() if err != nil { return err @@ -3682,136 +4060,67 @@ func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) UnmarshalPER(r if err != nil { return err } - if err := (&emergencyAreaIDCancelledItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModInd.ERABID).UnmarshalPER(r, enc); err != nil { return err } - emergencyAreaIDCancelledItem.CancelledCellInEAI = nil - if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { - start := len(emergencyAreaIDCancelledItem.CancelledCellInEAI) - emergencyAreaIDCancelledItem.CancelledCellInEAI = append(emergencyAreaIDCancelledItem.CancelledCellInEAI, make([]CancelledCellInEAIItem, count)...) - for i := int64(0); i < count; i++ { - if err := (&emergencyAreaIDCancelledItem.CancelledCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&eRABToBeModifiedItemBearerModInd.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeModifiedItemBearerModInd.DLGTPTEID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, &emergencyAreaIDCancelledItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, &eRABToBeModifiedItemBearerModInd.iEExtensions); err != nil { return err } } if extBit { - if err := emergencyAreaIDCancelledItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeModifiedItemBearerModInd.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsEmergencyAreaIDCancelledItem []ap.IESpec[ProtocolIEID, EmergencyAreaIDCancelledItem] +var extIEsERABToBeModifiedItemBearerModInd []apimpl.IESpec[ProtocolIEID, ERABToBeModifiedItemBearerModInd] -func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABToBeModifiedItemBearerModInd *ERABToBeModifiedItemBearerModInd) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range emergencyAreaIDCancelledItem.CancelledCellInEAI { - if emergencyAreaIDCancelledItem.CancelledCellInEAI[i].Diagnose(d) { - notComprehended = true - } + if eRABToBeModifiedItemBearerModInd.ERABID.Diagnose(d) { + notComprehended = true } - ap.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABToBeModifiedItemBearerModInd, eRABToBeModifiedItemBearerModInd, &eRABToBeModifiedItemBearerModInd.iEExtensions) return notComprehended } -func (emergencyIndicator EmergencyIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumEmergencyIndicator.Encode(w, enc, emergencyIndicator) -} - -func (emergencyIndicator *EmergencyIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumEmergencyIndicator.Decode(r, enc) - if err != nil { - return err - } - *emergencyIndicator = v - return nil -} - -func (emergencyIndicator EmergencyIndicator) Name() string { - return enumEmergencyIndicator.Name(emergencyIndicator) -} - -func (emergencyIndicator EmergencyIndicator) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumEmergencyIndicator.Known(emergencyIndicator) -} - -func (ethernetType EthernetType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumEthernetType.Encode(w, enc, ethernetType) -} - -func (ethernetType *EthernetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumEthernetType.Decode(r, enc) - if err != nil { - return err - } - *ethernetType = v - return nil -} - -func (ethernetType EthernetType) Name() string { - return enumEthernetType.Name(ethernetType) -} - -func (ethernetType EthernetType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumEthernetType.Known(ethernetType) -} - -func (eventType EventType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumEventType.Encode(w, enc, eventType) -} - -func (eventType *EventType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumEventType.Decode(r, enc) - if err != nil { +func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq.iEExtensions) + w.WriteBit(eRABToBeModifiedItemBearerModReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeModifiedItemBearerModReq.ERABID.MarshalPER(w, enc); err != nil { return err } - *eventType = v - return nil -} - -func (eventType EventType) Name() string { - return enumEventType.Name(eventType) -} - -func (eventType EventType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumEventType.Known(eventType) -} - -func (fiveGSTAI *FiveGSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsFiveGSTAI, fiveGSTAI, fiveGSTAI.iEExtensions) - w.WriteBit(fiveGSTAI.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := fiveGSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := eRABToBeModifiedItemBearerModReq.QoS.MarshalPER(w, enc); err != nil { return err } - if err := fiveGSTAI.TAC.MarshalPER(w, enc); err != nil { + if err := eRABToBeModifiedItemBearerModReq.NASPDU.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if fiveGSTAI.extensions.Present() { - if err := fiveGSTAI.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeModifiedItemBearerModReq.extensions.Present() { + if err := eRABToBeModifiedItemBearerModReq.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (fiveGSTAI *FiveGSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *fiveGSTAI = FiveGSTAI{} +func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeModifiedItemBearerModReq = ERABToBeModifiedItemBearerModReq{} extBit, err := r.ReadBit() if err != nil { return err @@ -3820,79 +4129,99 @@ func (fiveGSTAI *FiveGSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error if err != nil { return err } - if err := (&fiveGSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModReq.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&fiveGSTAI.TAC).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeModifiedItemBearerModReq.QoS).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeModifiedItemBearerModReq.NASPDU).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsFiveGSTAI, fiveGSTAI, &fiveGSTAI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions); err != nil { return err } } if extBit { - if err := fiveGSTAI.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeModifiedItemBearerModReq.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsFiveGSTAI []ap.IESpec[ProtocolIEID, FiveGSTAI] +var extIEsERABToBeModifiedItemBearerModReq = []apimpl.IESpec[ProtocolIEID, ERABToBeModifiedItemBearerModReq]{ + { + ID: IDTransportInformation, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, + Decode: func(x *ERABToBeModifiedItemBearerModReq, r *per.Reader, enc per.Encoding) error { + var v TransportInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.TransportInformation = &v + return nil + }, + Encode: func(x *ERABToBeModifiedItemBearerModReq) (per.Marshaler, bool) { + if x.TransportInformation == nil { + return nil, false + } + return x.TransportInformation, true + }, + Clear: func(x *ERABToBeModifiedItemBearerModReq) { + x.TransportInformation = nil + }, + }, +} -func (fiveGSTAI *FiveGSTAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABToBeModifiedItemBearerModReq *ERABToBeModifiedItemBearerModReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsFiveGSTAI, fiveGSTAI, fiveGSTAI.iEExtensions) + if eRABToBeModifiedItemBearerModReq.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABToBeModifiedItemBearerModReq.QoS.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsERABToBeModifiedItemBearerModReq, eRABToBeModifiedItemBearerModReq, &eRABToBeModifiedItemBearerModReq.iEExtensions) return notComprehended } -func (forbiddenInterRATs ForbiddenInterRATs) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumForbiddenInterRATs.Encode(w, enc, forbiddenInterRATs) -} - -func (forbiddenInterRATs *ForbiddenInterRATs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumForbiddenInterRATs.Decode(r, enc) - if err != nil { +func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemBearerSUReq.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeSetupItemBearerSUReq.ERABID.MarshalPER(w, enc); err != nil { return err } - *forbiddenInterRATs = v - return nil -} - -func (forbiddenInterRATs ForbiddenInterRATs) Name() string { - return enumForbiddenInterRATs.Name(forbiddenInterRATs) -} - -func (forbiddenInterRATs ForbiddenInterRATs) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumForbiddenInterRATs.Known(forbiddenInterRATs) -} - -func (forbiddenLAsItem *ForbiddenLAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsForbiddenLAsItem, forbiddenLAsItem, forbiddenLAsItem.iEExtensions) - w.WriteBit(forbiddenLAsItem.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := forbiddenLAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemBearerSUReq.QoS.MarshalPER(w, enc); err != nil { return err } - if err := forbiddenLAsItem.ForbiddenLACs.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemBearerSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemBearerSUReq.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemBearerSUReq.NASPDU.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if forbiddenLAsItem.extensions.Present() { - if err := forbiddenLAsItem.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeSetupItemBearerSUReq.extensions.Present() { + if err := eRABToBeSetupItemBearerSUReq.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (forbiddenLAsItem *ForbiddenLAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *forbiddenLAsItem = ForbiddenLAsItem{} +func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSetupItemBearerSUReq = ERABToBeSetupItemBearerSUReq{} extBit, err := r.ReadBit() if err != nil { return err @@ -3901,264 +4230,394 @@ func (forbiddenLAsItem *ForbiddenLAsItem) UnmarshalPER(r *per.Reader, enc per.En if err != nil { return err } - if err := (&forbiddenLAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&forbiddenLAsItem.ForbiddenLACs).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.QoS).UnmarshalPER(r, enc); err != nil { return err } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenLAsItem, forbiddenLAsItem, &forbiddenLAsItem.iEExtensions); err != nil { - return err - } - } - if extBit { - if err := forbiddenLAsItem.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil -} - -var extIEsForbiddenLAsItem []ap.IESpec[ProtocolIEID, ForbiddenLAsItem] - -func (forbiddenLAsItem *ForbiddenLAsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - ap.DiagnoseExtensions(d, extIEsForbiddenLAsItem, forbiddenLAsItem, forbiddenLAsItem.iEExtensions) - return notComprehended -} - -func (forbiddenTAsItem *ForbiddenTAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsForbiddenTAsItem, forbiddenTAsItem, forbiddenTAsItem.iEExtensions) - w.WriteBit(forbiddenTAsItem.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := forbiddenTAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err - } - if err := forbiddenTAsItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { - return err - } - if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { - return err - } - } - if forbiddenTAsItem.extensions.Present() { - if err := forbiddenTAsItem.extensions.MarshalPER(w, enc); err != nil { - return err - } - } - return nil -} - -func (forbiddenTAsItem *ForbiddenTAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *forbiddenTAsItem = ForbiddenTAsItem{} - extBit, err := r.ReadBit() - if err != nil { - return err - } - p_iEExtensions, err := r.ReadBit() - if err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if err := (&forbiddenTAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&forbiddenTAsItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemBearerSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenTAsItem, forbiddenTAsItem, &forbiddenTAsItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions); err != nil { return err } } if extBit { - if err := forbiddenTAsItem.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSetupItemBearerSUReq.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsForbiddenTAsItem []ap.IESpec[ProtocolIEID, ForbiddenTAsItem] +var extIEsERABToBeSetupItemBearerSUReq = []apimpl.IESpec[ProtocolIEID, ERABToBeSetupItemBearerSUReq]{ + { + ID: IDCorrelationID, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CorrelationID = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.CorrelationID == nil { + return nil, false + } + return x.CorrelationID, true + }, + Clear: func(x *ERABToBeSetupItemBearerSUReq) { + x.CorrelationID = nil + }, + }, + { + ID: IDSIPTOCorrelationID, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SIPTOCorrelationID = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.SIPTOCorrelationID == nil { + return nil, false + } + return x.SIPTOCorrelationID, true + }, + Clear: func(x *ERABToBeSetupItemBearerSUReq) { + x.SIPTOCorrelationID = nil + }, + }, + { + ID: IDBearerType, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v BearerType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.BearerType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.BearerType == nil { + return nil, false + } + return x.BearerType, true + }, + Clear: func(x *ERABToBeSetupItemBearerSUReq) { + x.BearerType = nil + }, + }, + { + ID: IDEthernetType, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v EthernetType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EthernetType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.EthernetType == nil { + return nil, false + } + return x.EthernetType, true + }, + Clear: func(x *ERABToBeSetupItemBearerSUReq) { + x.EthernetType = nil + }, + }, + { + ID: IDSecurityIndication, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, + Decode: func(x *ERABToBeSetupItemBearerSUReq, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemBearerSUReq) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + Clear: func(x *ERABToBeSetupItemBearerSUReq) { + x.SecurityIndication = nil + }, + }, +} -func (forbiddenTAsItem *ForbiddenTAsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABToBeSetupItemBearerSUReq *ERABToBeSetupItemBearerSUReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsForbiddenTAsItem, forbiddenTAsItem, forbiddenTAsItem.iEExtensions) + if eRABToBeSetupItemBearerSUReq.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABToBeSetupItemBearerSUReq.QoS.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsERABToBeSetupItemBearerSUReq, eRABToBeSetupItemBearerSUReq, &eRABToBeSetupItemBearerSUReq.iEExtensions) return notComprehended } -func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) - w.WriteBit(gBRQosInformation.extensions.Present()) +func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemCtxtSUReq.extensions.Present()) + w.WriteBit(eRABToBeSetupItemCtxtSUReq.NASPDU != nil) w.WriteBit(len(ext) > 0) - if err := gBRQosInformation.MaximumBitrateDL.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := gBRQosInformation.MaximumBitrateUL.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.QoS.MarshalPER(w, enc); err != nil { return err } - if err := gBRQosInformation.GuaranteedBitrateDL.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := gBRQosInformation.GuaranteedBitrateUL.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.GTPTEID.MarshalPER(w, enc); err != nil { return err } + if eRABToBeSetupItemCtxtSUReq.NASPDU != nil { + if err := eRABToBeSetupItemCtxtSUReq.NASPDU.MarshalPER(w, enc); err != nil { + return err + } + } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if gBRQosInformation.extensions.Present() { - if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeSetupItemCtxtSUReq.extensions.Present() { + if err := eRABToBeSetupItemCtxtSUReq.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *gBRQosInformation = GBRQosInformation{} +func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSetupItemCtxtSUReq = ERABToBeSetupItemCtxtSUReq{} extBit, err := r.ReadBit() if err != nil { return err } + p_NASPDU, err := r.ReadBit() + if err != nil { + return err + } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&gBRQosInformation.MaximumBitrateDL).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gBRQosInformation.MaximumBitrateUL).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.QoS).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gBRQosInformation.GuaranteedBitrateDL).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gBRQosInformation.GuaranteedBitrateUL).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemCtxtSUReq.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } + if p_NASPDU { + if err := (&eRABToBeSetupItemCtxtSUReq.NASPDU).UnmarshalPER(r, enc); err != nil { + return err + } + } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions); err != nil { return err } } if extBit { - if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSetupItemCtxtSUReq.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsGBRQosInformation = []ap.IESpec[ProtocolIEID, GBRQosInformation]{ +var extIEsERABToBeSetupItemCtxtSUReq = []apimpl.IESpec[ProtocolIEID, ERABToBeSetupItemCtxtSUReq]{ { - ID: IDExtendedERABMaximumBitrateDL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { - var v ExtendedBitRate + ID: IDCorrelationID, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.ExtendedMaximumBitrateDL = &v + x.CorrelationID = &v return nil }, - Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { - if x.ExtendedMaximumBitrateDL == nil { + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.CorrelationID == nil { return nil, false } - return x.ExtendedMaximumBitrateDL, true + return x.CorrelationID, true + }, + Clear: func(x *ERABToBeSetupItemCtxtSUReq) { + x.CorrelationID = nil }, }, { - ID: IDExtendedERABMaximumBitrateUL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { - var v ExtendedBitRate + ID: IDSIPTOCorrelationID, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v CorrelationID if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.ExtendedMaximumBitrateUL = &v + x.SIPTOCorrelationID = &v return nil }, - Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { - if x.ExtendedMaximumBitrateUL == nil { + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.SIPTOCorrelationID == nil { return nil, false } - return x.ExtendedMaximumBitrateUL, true + return x.SIPTOCorrelationID, true + }, + Clear: func(x *ERABToBeSetupItemCtxtSUReq) { + x.SIPTOCorrelationID = nil }, }, { - ID: IDExtendedERABGuaranteedBitrateDL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { - var v ExtendedBitRate + ID: IDBearerType, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v BearerType if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.ExtendedGuaranteedBitrateDL = &v + x.BearerType = &v return nil }, - Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { - if x.ExtendedGuaranteedBitrateDL == nil { + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.BearerType == nil { return nil, false } - return x.ExtendedGuaranteedBitrateDL, true + return x.BearerType, true + }, + Clear: func(x *ERABToBeSetupItemCtxtSUReq) { + x.BearerType = nil }, }, { - ID: IDExtendedERABGuaranteedBitrateUL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { - var v ExtendedBitRate + ID: IDEthernetType, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v EthernetType if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.ExtendedGuaranteedBitrateUL = &v + x.EthernetType = &v return nil }, - Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { - if x.ExtendedGuaranteedBitrateUL == nil { + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.EthernetType == nil { return nil, false } - return x.ExtendedGuaranteedBitrateUL, true + return x.EthernetType, true + }, + Clear: func(x *ERABToBeSetupItemCtxtSUReq) { + x.EthernetType = nil + }, + }, + { + ID: IDSecurityIndication, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, + Decode: func(x *ERABToBeSetupItemCtxtSUReq, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemCtxtSUReq) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + Clear: func(x *ERABToBeSetupItemCtxtSUReq) { + x.SecurityIndication = nil }, }, } -func (gBRQosInformation *GBRQosInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - ap.DiagnoseExtensions(d, extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) - return notComprehended -} - -func (gNB *GNB) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGNB, gNB, gNB.iEExtensions) - w.WriteBit(gNB.extensions.Present()) +func (eRABToBeSetupItemCtxtSUReq *ERABToBeSetupItemCtxtSUReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if eRABToBeSetupItemCtxtSUReq.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABToBeSetupItemCtxtSUReq.QoS.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsERABToBeSetupItemCtxtSUReq, eRABToBeSetupItemCtxtSUReq, &eRABToBeSetupItemCtxtSUReq.iEExtensions) + return notComprehended +} + +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, eRABToBeSetupItemHOReq.iEExtensions) + w.WriteBit(eRABToBeSetupItemHOReq.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := gNB.GlobalGNBID.MarshalPER(w, enc); err != nil { + if err := eRABToBeSetupItemHOReq.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemHOReq.TransportLayerAddress.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemHOReq.GTPTEID.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABToBeSetupItemHOReq.QoS.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if gNB.extensions.Present() { - if err := gNB.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeSetupItemHOReq.extensions.Present() { + if err := eRABToBeSetupItemHOReq.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (gNB *GNB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *gNB = GNB{} +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSetupItemHOReq = ERABToBeSetupItemHOReq{} extBit, err := r.ReadBit() if err != nil { return err @@ -4167,123 +4626,162 @@ func (gNB *GNB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { if err != nil { return err } - if err := (&gNB.GlobalGNBID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSetupItemHOReq.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSetupItemHOReq.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSetupItemHOReq.GTPTEID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSetupItemHOReq.QoS).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGNB, gNB, &gNB.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, &eRABToBeSetupItemHOReq.iEExtensions); err != nil { return err } } if extBit { - if err := gNB.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSetupItemHOReq.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsGNB []ap.IESpec[ProtocolIEID, GNB] +var extIEsERABToBeSetupItemHOReq = []apimpl.IESpec[ProtocolIEID, ERABToBeSetupItemHOReq]{ + { + ID: IDDataForwardingNotPossible, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v DataForwardingNotPossible + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.DataForwardingNotPossible = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.DataForwardingNotPossible == nil { + return nil, false + } + return x.DataForwardingNotPossible, true + }, + Clear: func(x *ERABToBeSetupItemHOReq) { + x.DataForwardingNotPossible = nil + }, + }, + { + ID: IDBearerType, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v BearerType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.BearerType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.BearerType == nil { + return nil, false + } + return x.BearerType, true + }, + Clear: func(x *ERABToBeSetupItemHOReq) { + x.BearerType = nil + }, + }, + { + ID: IDEthernetType, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v EthernetType + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.EthernetType = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.EthernetType == nil { + return nil, false + } + return x.EthernetType, true + }, + Clear: func(x *ERABToBeSetupItemHOReq) { + x.EthernetType = nil + }, + }, + { + ID: IDSecurityIndication, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, + Decode: func(x *ERABToBeSetupItemHOReq, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSetupItemHOReq) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + Clear: func(x *ERABToBeSetupItemHOReq) { + x.SecurityIndication = nil + }, + }, +} -func (gNB *GNB) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABToBeSetupItemHOReq *ERABToBeSetupItemHOReq) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if gNB.GlobalGNBID.Diagnose(d) { + if eRABToBeSetupItemHOReq.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGNB, gNB, gNB.iEExtensions) - return notComprehended -} - -func (gNBIdentity *GNBIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { - set := 0 - for _, ok := range [...]bool{gNBIdentity.GNBID != nil, gNBIdentity.Ext != nil} { - if ok { - set++ - } - } - if set > 1 { - return per.ErrChoice - } - switch { - case gNBIdentity.GNBID != nil: - w.WriteBit(false) - if err := (*gNBIdentity.GNBID).MarshalPER(w, enc); err != nil { - return err - } - case gNBIdentity.Ext != nil: - w.WriteBit(true) - return gNBIdentity.Ext.MarshalPER(w, enc) - default: - return per.ErrEmpty - } - return nil -} - -func (gNBIdentity *GNBIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *gNBIdentity = GNBIdentity{} - isExt, err := r.ReadBit() - if err != nil { - return err - } - if isExt { - extIdx, err := per.DecodeNormallySmall(r, enc) - if err != nil { - return err - } - gNBIdentity.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) - return err - } - var idx int64 = 0 - switch idx { - case 0: - var v GNBID - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - gNBIdentity.GNBID = &v - default: - return per.ErrOverflow - } - return nil -} - -func (gNBIdentity *GNBIdentity) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - switch { - case gNBIdentity.GNBID != nil: - case gNBIdentity.Ext != nil: - return true + if eRABToBeSetupItemHOReq.QoS.Diagnose(d) { + notComprehended = true } - return false + apimpl.DiagnoseExtensions(d, extIEsERABToBeSetupItemHOReq, eRABToBeSetupItemHOReq, &eRABToBeSetupItemHOReq.iEExtensions) + return notComprehended } -func (gUMMEI *GUMMEI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGUMMEI, gUMMEI, gUMMEI.iEExtensions) - w.WriteBit(gUMMEI.extensions.Present()) +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, eRABToBeSwitchedDLItem.iEExtensions) + w.WriteBit(eRABToBeSwitchedDLItem.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := gUMMEI.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := eRABToBeSwitchedDLItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := gUMMEI.MMEGroupID.MarshalPER(w, enc); err != nil { + if err := eRABToBeSwitchedDLItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := gUMMEI.MMECode.MarshalPER(w, enc); err != nil { + if err := eRABToBeSwitchedDLItem.GTPTEID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if gUMMEI.extensions.Present() { - if err := gUMMEI.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeSwitchedDLItem.extensions.Present() { + if err := eRABToBeSwitchedDLItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (gUMMEI *GUMMEI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *gUMMEI = GUMMEI{} +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSwitchedDLItem = ERABToBeSwitchedDLItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -4292,103 +4790,90 @@ func (gUMMEI *GUMMEI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { if err != nil { return err } - if err := (&gUMMEI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedDLItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gUMMEI.MMEGroupID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedDLItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { return err } - if err := (&gUMMEI.MMECode).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedDLItem.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGUMMEI, gUMMEI, &gUMMEI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions); err != nil { return err } } if extBit { - if err := gUMMEI.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSwitchedDLItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsGUMMEI []ap.IESpec[ProtocolIEID, GUMMEI] +var extIEsERABToBeSwitchedDLItem = []apimpl.IESpec[ProtocolIEID, ERABToBeSwitchedDLItem]{ + { + ID: IDSecurityIndication, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ERABToBeSwitchedDLItem, r *per.Reader, enc per.Encoding) error { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.SecurityIndication = &v + return nil + }, + Encode: func(x *ERABToBeSwitchedDLItem) (per.Marshaler, bool) { + if x.SecurityIndication == nil { + return nil, false + } + return x.SecurityIndication, true + }, + Clear: func(x *ERABToBeSwitchedDLItem) { + x.SecurityIndication = nil + }, + }, +} -func (gUMMEI *GUMMEI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABToBeSwitchedDLItem *ERABToBeSwitchedDLItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsGUMMEI, gUMMEI, gUMMEI.iEExtensions) + if eRABToBeSwitchedDLItem.ERABID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsERABToBeSwitchedDLItem, eRABToBeSwitchedDLItem, &eRABToBeSwitchedDLItem.iEExtensions) return notComprehended } -func (gUMMEIType GUMMEIType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumGUMMEIType.Encode(w, enc, gUMMEIType) -} - -func (gUMMEIType *GUMMEIType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumGUMMEIType.Decode(r, enc) - if err != nil { - return err - } - *gUMMEIType = v - return nil -} - -func (gUMMEIType GUMMEIType) Name() string { - return enumGUMMEIType.Name(gUMMEIType) -} - -func (gUMMEIType GUMMEIType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumGUMMEIType.Known(gUMMEIType) -} - -func (gWContextReleaseIndication GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumGWContextReleaseIndication.Encode(w, enc, gWContextReleaseIndication) -} - -func (gWContextReleaseIndication *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumGWContextReleaseIndication.Decode(r, enc) - if err != nil { +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, eRABToBeSwitchedULItem.iEExtensions) + w.WriteBit(eRABToBeSwitchedULItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABToBeSwitchedULItem.ERABID.MarshalPER(w, enc); err != nil { return err } - *gWContextReleaseIndication = v - return nil -} - -func (gWContextReleaseIndication GWContextReleaseIndication) Name() string { - return enumGWContextReleaseIndication.Name(gWContextReleaseIndication) -} - -func (gWContextReleaseIndication GWContextReleaseIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumGWContextReleaseIndication.Known(gWContextReleaseIndication) -} - -func (globalENBID *GlobalENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) - w.WriteBit(globalENBID.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := globalENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := eRABToBeSwitchedULItem.TransportLayerAddress.MarshalPER(w, enc); err != nil { return err } - if err := globalENBID.ENBID.MarshalPER(w, enc); err != nil { + if err := eRABToBeSwitchedULItem.GTPTEID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if globalENBID.extensions.Present() { - if err := globalENBID.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeSwitchedULItem.extensions.Present() { + if err := eRABToBeSwitchedULItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *globalENBID = GlobalENBID{} +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeSwitchedULItem = ERABToBeSwitchedULItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -4397,1014 +4882,3900 @@ func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er if err != nil { return err } - if err := (&globalENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedULItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } - if err := (&globalENBID.ENBID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeSwitchedULItem.TransportLayerAddress).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABToBeSwitchedULItem.GTPTEID).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, &eRABToBeSwitchedULItem.iEExtensions); err != nil { return err } } if extBit { - if err := globalENBID.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeSwitchedULItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsGlobalENBID []ap.IESpec[ProtocolIEID, GlobalENBID] +var extIEsERABToBeSwitchedULItem []apimpl.IESpec[ProtocolIEID, ERABToBeSwitchedULItem] -func (globalENBID *GlobalENBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABToBeSwitchedULItem *ERABToBeSwitchedULItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if globalENBID.ENBID.Diagnose(d) { + if eRABToBeSwitchedULItem.ERABID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABToBeSwitchedULItem, eRABToBeSwitchedULItem, &eRABToBeSwitchedULItem.iEExtensions) return notComprehended } -func (globalGNBID *GlobalGNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) - w.WriteBit(globalGNBID.extensions.Present()) +func (eRABToBeUpdatedItem *ERABToBeUpdatedItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABToBeUpdatedItem, eRABToBeUpdatedItem, eRABToBeUpdatedItem.iEExtensions) + w.WriteBit(eRABToBeUpdatedItem.extensions.Present()) + w.WriteBit(eRABToBeUpdatedItem.SecurityIndication != nil) w.WriteBit(len(ext) > 0) - if err := globalGNBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := eRABToBeUpdatedItem.ERABID.MarshalPER(w, enc); err != nil { return err } - if err := globalGNBID.GNBID.MarshalPER(w, enc); err != nil { - return err + if eRABToBeUpdatedItem.SecurityIndication != nil { + if err := (*eRABToBeUpdatedItem.SecurityIndication).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if globalGNBID.extensions.Present() { - if err := globalGNBID.extensions.MarshalPER(w, enc); err != nil { + if eRABToBeUpdatedItem.extensions.Present() { + if err := eRABToBeUpdatedItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (globalGNBID *GlobalGNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *globalGNBID = GlobalGNBID{} +func (eRABToBeUpdatedItem *ERABToBeUpdatedItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABToBeUpdatedItem = ERABToBeUpdatedItem{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_SecurityIndication, err := r.ReadBit() if err != nil { return err } - if err := (&globalGNBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&globalGNBID.GNBID).UnmarshalPER(r, enc); err != nil { + if err := (&eRABToBeUpdatedItem.ERABID).UnmarshalPER(r, enc); err != nil { return err } + if p_SecurityIndication { + var v SecurityIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + eRABToBeUpdatedItem.SecurityIndication = &v + } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABToBeUpdatedItem, eRABToBeUpdatedItem, &eRABToBeUpdatedItem.iEExtensions); err != nil { return err } } if extBit { - if err := globalGNBID.extensions.UnmarshalPER(r, enc); err != nil { + if err := eRABToBeUpdatedItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsGlobalGNBID []ap.IESpec[ProtocolIEID, GlobalGNBID] +var extIEsERABToBeUpdatedItem []apimpl.IESpec[ProtocolIEID, ERABToBeUpdatedItem] -func (globalGNBID *GlobalGNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eRABToBeUpdatedItem *ERABToBeUpdatedItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if globalGNBID.GNBID.Diagnose(d) { + if eRABToBeUpdatedItem.ERABID.Diagnose(d) { + notComprehended = true + } + if eRABToBeUpdatedItem.SecurityIndication != nil && eRABToBeUpdatedItem.SecurityIndication.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsERABToBeUpdatedItem, eRABToBeUpdatedItem, &eRABToBeUpdatedItem.iEExtensions) return notComprehended } -func (globalRANNodeID *GlobalRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - set := 0 - for _, ok := range [...]bool{globalRANNodeID.GNB != nil, globalRANNodeID.NgENB != nil, globalRANNodeID.Ext != nil} { - if ok { - set++ - } +func (eRABUsageReportItem *ERABUsageReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsERABUsageReportItem, eRABUsageReportItem, eRABUsageReportItem.iEExtensions) + w.WriteBit(eRABUsageReportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := eRABUsageReportItem.StartTimestamp.MarshalPER(w, enc); err != nil { + return err } - if set > 1 { - return per.ErrChoice + if err := eRABUsageReportItem.EndTimestamp.MarshalPER(w, enc); err != nil { + return err } - switch { - case globalRANNodeID.GNB != nil: - w.WriteBit(false) - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { - return err - } - if err := (*globalRANNodeID.GNB).MarshalPER(w, enc); err != nil { - return err - } - case globalRANNodeID.NgENB != nil: - w.WriteBit(false) - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + if err := eRABUsageReportItem.UsageCountUL.MarshalPER(w, enc); err != nil { + return err + } + if err := eRABUsageReportItem.UsageCountDL.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - if err := (*globalRANNodeID.NgENB).MarshalPER(w, enc); err != nil { + } + if eRABUsageReportItem.extensions.Present() { + if err := eRABUsageReportItem.extensions.MarshalPER(w, enc); err != nil { return err } - case globalRANNodeID.Ext != nil: - w.WriteBit(true) - return globalRANNodeID.Ext.MarshalPER(w, enc) - default: - return per.ErrEmpty } return nil } -func (globalRANNodeID *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *globalRANNodeID = GlobalRANNodeID{} - isExt, err := r.ReadBit() +func (eRABUsageReportItem *ERABUsageReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eRABUsageReportItem = ERABUsageReportItem{} + extBit, err := r.ReadBit() if err != nil { return err } - if isExt { - extIdx, err := per.DecodeNormallySmall(r, enc) - if err != nil { - return err - } - globalRANNodeID.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) - if err != nil { + if err := (&eRABUsageReportItem.StartTimestamp).UnmarshalPER(r, enc); err != nil { return err } - switch idx { - case 0: - var v GNB - if err := (&v).UnmarshalPER(r, enc); err != nil { + if err := (&eRABUsageReportItem.EndTimestamp).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABUsageReportItem.UsageCountUL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&eRABUsageReportItem.UsageCountDL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsERABUsageReportItem, eRABUsageReportItem, &eRABUsageReportItem.iEExtensions); err != nil { return err } - globalRANNodeID.GNB = &v - case 1: - var v NgENB - if err := (&v).UnmarshalPER(r, enc); err != nil { + } + if extBit { + if err := eRABUsageReportItem.extensions.UnmarshalPER(r, enc); err != nil { return err } - globalRANNodeID.NgENB = &v - default: - return per.ErrOverflow } return nil } -func (globalRANNodeID *GlobalRANNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - switch { - case globalRANNodeID.GNB != nil: - return globalRANNodeID.GNB.Diagnose(d) - case globalRANNodeID.NgENB != nil: - return globalRANNodeID.NgENB.Diagnose(d) - case globalRANNodeID.Ext != nil: - return true - } - return false +var extIEsERABUsageReportItem []apimpl.IESpec[ProtocolIEID, ERABUsageReportItem] + +func (eRABUsageReportItem *ERABUsageReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsERABUsageReportItem, eRABUsageReportItem, &eRABUsageReportItem.iEExtensions) + return notComprehended } -func (handoverRestrictionList *HandoverRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsHandoverRestrictionList, handoverRestrictionList, handoverRestrictionList.iEExtensions) - w.WriteBit(handoverRestrictionList.extensions.Present()) - w.WriteBit(handoverRestrictionList.EquivalentPLMNs != nil) - w.WriteBit(handoverRestrictionList.ForbiddenTAs != nil) - w.WriteBit(handoverRestrictionList.ForbiddenLAs != nil) - w.WriteBit(handoverRestrictionList.ForbiddenInterRATs != nil) +func (eUTRANCGI *EUTRANCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsEUTRANCGI, eUTRANCGI, eUTRANCGI.iEExtensions) + w.WriteBit(eUTRANCGI.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := handoverRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { + if err := eUTRANCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if handoverRestrictionList.EquivalentPLMNs != nil { - if err := handoverRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { - return err - } - } - if handoverRestrictionList.ForbiddenTAs != nil { - if err := handoverRestrictionList.ForbiddenTAs.MarshalPER(w, enc); err != nil { - return err - } - } - if handoverRestrictionList.ForbiddenLAs != nil { - if err := handoverRestrictionList.ForbiddenLAs.MarshalPER(w, enc); err != nil { - return err - } - } - if handoverRestrictionList.ForbiddenInterRATs != nil { - if err := (*handoverRestrictionList.ForbiddenInterRATs).MarshalPER(w, enc); err != nil { - return err - } + if err := eUTRANCGI.CellID.MarshalPER(w, enc); err != nil { + return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if handoverRestrictionList.extensions.Present() { - if err := handoverRestrictionList.extensions.MarshalPER(w, enc); err != nil { + if eUTRANCGI.extensions.Present() { + if err := eUTRANCGI.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (handoverRestrictionList *HandoverRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *handoverRestrictionList = HandoverRestrictionList{} +func (eUTRANCGI *EUTRANCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *eUTRANCGI = EUTRANCGI{} extBit, err := r.ReadBit() if err != nil { return err } - p_EquivalentPLMNs, err := r.ReadBit() - if err != nil { - return err - } - p_ForbiddenTAs, err := r.ReadBit() - if err != nil { - return err - } - p_ForbiddenLAs, err := r.ReadBit() - if err != nil { - return err - } - p_ForbiddenInterRATs, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&handoverRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { + if err := (&eUTRANCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - if p_EquivalentPLMNs { - if err := (&handoverRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ForbiddenTAs { - if err := (&handoverRestrictionList.ForbiddenTAs).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ForbiddenLAs { - if err := (&handoverRestrictionList.ForbiddenLAs).UnmarshalPER(r, enc); err != nil { - return err - } - } - if p_ForbiddenInterRATs { - var v ForbiddenInterRATs - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - handoverRestrictionList.ForbiddenInterRATs = &v + if err := (&eUTRANCGI.CellID).UnmarshalPER(r, enc); err != nil { + return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRestrictionList, handoverRestrictionList, &handoverRestrictionList.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEUTRANCGI, eUTRANCGI, &eUTRANCGI.iEExtensions); err != nil { return err } } if extBit { - if err := handoverRestrictionList.extensions.UnmarshalPER(r, enc); err != nil { + if err := eUTRANCGI.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsHandoverRestrictionList = []ap.IESpec[ProtocolIEID, HandoverRestrictionList]{ - { - ID: IDNRrestrictioninEPSasSecondaryRAT, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { - var v NRrestrictioninEPSasSecondaryRAT - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err +var extIEsEUTRANCGI []apimpl.IESpec[ProtocolIEID, EUTRANCGI] + +func (eUTRANCGI *EUTRANCGI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsEUTRANCGI, eUTRANCGI, &eUTRANCGI.iEExtensions) + return notComprehended +} + +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem.iEExtensions) + w.WriteBit(emergencyAreaIDBroadcastItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDBroadcastItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDBroadcastItem.CompletedCellInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].MarshalPER(w, enc); err != nil { + return err } - x.NRrestrictioninEPSasSecondaryRAT = &v - return nil - }, - Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { - if x.NRrestrictioninEPSasSecondaryRAT == nil { - return nil, false + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if emergencyAreaIDBroadcastItem.extensions.Present() { + if err := emergencyAreaIDBroadcastItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDBroadcastItem = EmergencyAreaIDBroadcastItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&emergencyAreaIDBroadcastItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + return err + } + emergencyAreaIDBroadcastItem.CompletedCellInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDBroadcastItem.CompletedCellInEAI) + emergencyAreaIDBroadcastItem.CompletedCellInEAI = append(emergencyAreaIDBroadcastItem.CompletedCellInEAI, make([]CompletedCellInEAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDBroadcastItem.CompletedCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err } - return x.NRrestrictioninEPSasSecondaryRAT, true - }, - }, - { - ID: IDUnlicensedSpectrumRestriction, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { - var v UnlicensedSpectrumRestriction - if err := (&v).UnmarshalPER(r, enc); err != nil { + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, &emergencyAreaIDBroadcastItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := emergencyAreaIDBroadcastItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsEmergencyAreaIDBroadcastItem []apimpl.IESpec[ProtocolIEID, EmergencyAreaIDBroadcastItem] + +func (emergencyAreaIDBroadcastItem *EmergencyAreaIDBroadcastItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDBroadcastItem.CompletedCellInEAI { + if emergencyAreaIDBroadcastItem.CompletedCellInEAI[i].Diagnose(d) { + notComprehended = true + } + } + apimpl.DiagnoseExtensions(d, extIEsEmergencyAreaIDBroadcastItem, emergencyAreaIDBroadcastItem, &emergencyAreaIDBroadcastItem.iEExtensions) + return notComprehended +} + +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem.iEExtensions) + w.WriteBit(emergencyAreaIDCancelledItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := emergencyAreaIDCancelledItem.EmergencyAreaID.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 65535, true, int64(len(emergencyAreaIDCancelledItem.CancelledCellInEAI)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := emergencyAreaIDCancelledItem.CancelledCellInEAI[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if emergencyAreaIDCancelledItem.extensions.Present() { + if err := emergencyAreaIDCancelledItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *emergencyAreaIDCancelledItem = EmergencyAreaIDCancelledItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&emergencyAreaIDCancelledItem.EmergencyAreaID).UnmarshalPER(r, enc); err != nil { + return err + } + emergencyAreaIDCancelledItem.CancelledCellInEAI = nil + if err := per.DecodeLength(r, enc, 1, 65535, true, func(count int64) error { + start := len(emergencyAreaIDCancelledItem.CancelledCellInEAI) + emergencyAreaIDCancelledItem.CancelledCellInEAI = append(emergencyAreaIDCancelledItem.CancelledCellInEAI, make([]CancelledCellInEAIItem, count)...) + for i := int64(0); i < count; i++ { + if err := (&emergencyAreaIDCancelledItem.CancelledCellInEAI[start+int(i)]).UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil + }); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, &emergencyAreaIDCancelledItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := emergencyAreaIDCancelledItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsEmergencyAreaIDCancelledItem []apimpl.IESpec[ProtocolIEID, EmergencyAreaIDCancelledItem] + +func (emergencyAreaIDCancelledItem *EmergencyAreaIDCancelledItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + for i := range emergencyAreaIDCancelledItem.CancelledCellInEAI { + if emergencyAreaIDCancelledItem.CancelledCellInEAI[i].Diagnose(d) { + notComprehended = true + } + } + apimpl.DiagnoseExtensions(d, extIEsEmergencyAreaIDCancelledItem, emergencyAreaIDCancelledItem, &emergencyAreaIDCancelledItem.iEExtensions) + return notComprehended +} + +func (emergencyIndicator EmergencyIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEmergencyIndicator.Encode(w, enc, emergencyIndicator) +} + +func (emergencyIndicator *EmergencyIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEmergencyIndicator.Decode(r, enc) + if err != nil { + return err + } + *emergencyIndicator = v + return nil +} + +func (emergencyIndicator EmergencyIndicator) Name() string { + return enumEmergencyIndicator.Name(emergencyIndicator) +} + +func (emergencyIndicator EmergencyIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumEmergencyIndicator.Known(emergencyIndicator) +} + +func (endIndication EndIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEndIndication.Encode(w, enc, endIndication) +} + +func (endIndication *EndIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEndIndication.Decode(r, enc) + if err != nil { + return err + } + *endIndication = v + return nil +} + +func (endIndication EndIndication) Name() string { + return enumEndIndication.Name(endIndication) +} + +func (endIndication EndIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumEndIndication.Known(endIndication) +} + +func (enhancedCoverageRestricted EnhancedCoverageRestricted) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEnhancedCoverageRestricted.Encode(w, enc, enhancedCoverageRestricted) +} + +func (enhancedCoverageRestricted *EnhancedCoverageRestricted) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEnhancedCoverageRestricted.Decode(r, enc) + if err != nil { + return err + } + *enhancedCoverageRestricted = v + return nil +} + +func (enhancedCoverageRestricted EnhancedCoverageRestricted) Name() string { + return enumEnhancedCoverageRestricted.Name(enhancedCoverageRestricted) +} + +func (enhancedCoverageRestricted EnhancedCoverageRestricted) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumEnhancedCoverageRestricted.Known(enhancedCoverageRestricted) +} + +func (ethernetType EthernetType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEthernetType.Encode(w, enc, ethernetType) +} + +func (ethernetType *EthernetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEthernetType.Decode(r, enc) + if err != nil { + return err + } + *ethernetType = v + return nil +} + +func (ethernetType EthernetType) Name() string { + return enumEthernetType.Name(ethernetType) +} + +func (ethernetType EthernetType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumEthernetType.Known(ethernetType) +} + +func (eventType EventType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumEventType.Encode(w, enc, eventType) +} + +func (eventType *EventType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumEventType.Decode(r, enc) + if err != nil { + return err + } + *eventType = v + return nil +} + +func (eventType EventType) Name() string { + return enumEventType.Name(eventType) +} + +func (eventType EventType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumEventType.Known(eventType) +} + +func (expectedHOInterval ExpectedHOInterval) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumExpectedHOInterval.Encode(w, enc, expectedHOInterval) +} + +func (expectedHOInterval *ExpectedHOInterval) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumExpectedHOInterval.Decode(r, enc) + if err != nil { + return err + } + *expectedHOInterval = v + return nil +} + +func (expectedHOInterval ExpectedHOInterval) Name() string { + return enumExpectedHOInterval.Name(expectedHOInterval) +} + +func (expectedHOInterval ExpectedHOInterval) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumExpectedHOInterval.Known(expectedHOInterval) +} + +func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, expectedUEActivityBehaviour.iEExtensions) + w.WriteBit(expectedUEActivityBehaviour.extensions.Present()) + w.WriteBit(expectedUEActivityBehaviour.ExpectedActivityPeriod != nil) + w.WriteBit(expectedUEActivityBehaviour.ExpectedIdlePeriod != nil) + w.WriteBit(expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation != nil) + w.WriteBit(len(ext) > 0) + if expectedUEActivityBehaviour.ExpectedActivityPeriod != nil { + if err := (*expectedUEActivityBehaviour.ExpectedActivityPeriod).MarshalPER(w, enc); err != nil { + return err + } + } + if expectedUEActivityBehaviour.ExpectedIdlePeriod != nil { + if err := (*expectedUEActivityBehaviour.ExpectedIdlePeriod).MarshalPER(w, enc); err != nil { + return err + } + } + if expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation != nil { + if err := (*expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if expectedUEActivityBehaviour.extensions.Present() { + if err := expectedUEActivityBehaviour.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *expectedUEActivityBehaviour = ExpectedUEActivityBehaviour{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ExpectedActivityPeriod, err := r.ReadBit() + if err != nil { + return err + } + p_ExpectedIdlePeriod, err := r.ReadBit() + if err != nil { + return err + } + p_SourceofUEActivityBehaviourInformation, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_ExpectedActivityPeriod { + var v ExpectedActivityPeriod + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEActivityBehaviour.ExpectedActivityPeriod = &v + } + if p_ExpectedIdlePeriod { + var v ExpectedIdlePeriod + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEActivityBehaviour.ExpectedIdlePeriod = &v + } + if p_SourceofUEActivityBehaviourInformation { + var v SourceOfUEActivityBehaviourInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, &expectedUEActivityBehaviour.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := expectedUEActivityBehaviour.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsExpectedUEActivityBehaviour []apimpl.IESpec[ProtocolIEID, ExpectedUEActivityBehaviour] + +func (expectedUEActivityBehaviour *ExpectedUEActivityBehaviour) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation != nil && expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsExpectedUEActivityBehaviour, expectedUEActivityBehaviour, &expectedUEActivityBehaviour.iEExtensions) + return notComprehended +} + +func (expectedUEBehaviour *ExpectedUEBehaviour) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsExpectedUEBehaviour, expectedUEBehaviour, expectedUEBehaviour.iEExtensions) + w.WriteBit(expectedUEBehaviour.extensions.Present()) + w.WriteBit(expectedUEBehaviour.ExpectedActivity != nil) + w.WriteBit(expectedUEBehaviour.ExpectedHOInterval != nil) + w.WriteBit(len(ext) > 0) + if expectedUEBehaviour.ExpectedActivity != nil { + if err := (*expectedUEBehaviour.ExpectedActivity).MarshalPER(w, enc); err != nil { + return err + } + } + if expectedUEBehaviour.ExpectedHOInterval != nil { + if err := (*expectedUEBehaviour.ExpectedHOInterval).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if expectedUEBehaviour.extensions.Present() { + if err := expectedUEBehaviour.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (expectedUEBehaviour *ExpectedUEBehaviour) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *expectedUEBehaviour = ExpectedUEBehaviour{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_ExpectedActivity, err := r.ReadBit() + if err != nil { + return err + } + p_ExpectedHOInterval, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_ExpectedActivity { + var v ExpectedUEActivityBehaviour + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEBehaviour.ExpectedActivity = &v + } + if p_ExpectedHOInterval { + var v ExpectedHOInterval + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + expectedUEBehaviour.ExpectedHOInterval = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsExpectedUEBehaviour, expectedUEBehaviour, &expectedUEBehaviour.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := expectedUEBehaviour.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsExpectedUEBehaviour []apimpl.IESpec[ProtocolIEID, ExpectedUEBehaviour] + +func (expectedUEBehaviour *ExpectedUEBehaviour) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if expectedUEBehaviour.ExpectedActivity != nil && expectedUEBehaviour.ExpectedActivity.Diagnose(d) { + notComprehended = true + } + if expectedUEBehaviour.ExpectedHOInterval != nil && expectedUEBehaviour.ExpectedHOInterval.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsExpectedUEBehaviour, expectedUEBehaviour, &expectedUEBehaviour.iEExtensions) + return notComprehended +} + +func (fiveGSTAI *FiveGSTAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsFiveGSTAI, fiveGSTAI, fiveGSTAI.iEExtensions) + w.WriteBit(fiveGSTAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := fiveGSTAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := fiveGSTAI.TAC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if fiveGSTAI.extensions.Present() { + if err := fiveGSTAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (fiveGSTAI *FiveGSTAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *fiveGSTAI = FiveGSTAI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&fiveGSTAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&fiveGSTAI.TAC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsFiveGSTAI, fiveGSTAI, &fiveGSTAI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := fiveGSTAI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsFiveGSTAI []apimpl.IESpec[ProtocolIEID, FiveGSTAI] + +func (fiveGSTAI *FiveGSTAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsFiveGSTAI, fiveGSTAI, &fiveGSTAI.iEExtensions) + return notComprehended +} + +func (forbiddenInterRATs ForbiddenInterRATs) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumForbiddenInterRATs.Encode(w, enc, forbiddenInterRATs) +} + +func (forbiddenInterRATs *ForbiddenInterRATs) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumForbiddenInterRATs.Decode(r, enc) + if err != nil { + return err + } + *forbiddenInterRATs = v + return nil +} + +func (forbiddenInterRATs ForbiddenInterRATs) Name() string { + return enumForbiddenInterRATs.Name(forbiddenInterRATs) +} + +func (forbiddenInterRATs ForbiddenInterRATs) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumForbiddenInterRATs.Known(forbiddenInterRATs) +} + +func (forbiddenLAsItem *ForbiddenLAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsForbiddenLAsItem, forbiddenLAsItem, forbiddenLAsItem.iEExtensions) + w.WriteBit(forbiddenLAsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := forbiddenLAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := forbiddenLAsItem.ForbiddenLACs.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if forbiddenLAsItem.extensions.Present() { + if err := forbiddenLAsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (forbiddenLAsItem *ForbiddenLAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *forbiddenLAsItem = ForbiddenLAsItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&forbiddenLAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&forbiddenLAsItem.ForbiddenLACs).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenLAsItem, forbiddenLAsItem, &forbiddenLAsItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := forbiddenLAsItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsForbiddenLAsItem []apimpl.IESpec[ProtocolIEID, ForbiddenLAsItem] + +func (forbiddenLAsItem *ForbiddenLAsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsForbiddenLAsItem, forbiddenLAsItem, &forbiddenLAsItem.iEExtensions) + return notComprehended +} + +func (forbiddenTAsItem *ForbiddenTAsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsForbiddenTAsItem, forbiddenTAsItem, forbiddenTAsItem.iEExtensions) + w.WriteBit(forbiddenTAsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := forbiddenTAsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := forbiddenTAsItem.ForbiddenTACs.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if forbiddenTAsItem.extensions.Present() { + if err := forbiddenTAsItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (forbiddenTAsItem *ForbiddenTAsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *forbiddenTAsItem = ForbiddenTAsItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&forbiddenTAsItem.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&forbiddenTAsItem.ForbiddenTACs).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsForbiddenTAsItem, forbiddenTAsItem, &forbiddenTAsItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := forbiddenTAsItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsForbiddenTAsItem []apimpl.IESpec[ProtocolIEID, ForbiddenTAsItem] + +func (forbiddenTAsItem *ForbiddenTAsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsForbiddenTAsItem, forbiddenTAsItem, &forbiddenTAsItem.iEExtensions) + return notComprehended +} + +func (gBRQosInformation *GBRQosInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsGBRQosInformation, gBRQosInformation, gBRQosInformation.iEExtensions) + w.WriteBit(gBRQosInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gBRQosInformation.MaximumBitrateDL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.MaximumBitrateUL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.GuaranteedBitrateDL.MarshalPER(w, enc); err != nil { + return err + } + if err := gBRQosInformation.GuaranteedBitrateUL.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gBRQosInformation.extensions.Present() { + if err := gBRQosInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gBRQosInformation *GBRQosInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gBRQosInformation = GBRQosInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gBRQosInformation.MaximumBitrateDL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.MaximumBitrateUL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.GuaranteedBitrateDL).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gBRQosInformation.GuaranteedBitrateUL).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := gBRQosInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGBRQosInformation = []apimpl.IESpec[ProtocolIEID, GBRQosInformation]{ + { + ID: IDExtendedERABMaximumBitrateDL, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedMaximumBitrateDL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedMaximumBitrateDL == nil { + return nil, false + } + return x.ExtendedMaximumBitrateDL, true + }, + Clear: func(x *GBRQosInformation) { + x.ExtendedMaximumBitrateDL = nil + }, + }, + { + ID: IDExtendedERABMaximumBitrateUL, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedMaximumBitrateUL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedMaximumBitrateUL == nil { + return nil, false + } + return x.ExtendedMaximumBitrateUL, true + }, + Clear: func(x *GBRQosInformation) { + x.ExtendedMaximumBitrateUL = nil + }, + }, + { + ID: IDExtendedERABGuaranteedBitrateDL, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedGuaranteedBitrateDL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedGuaranteedBitrateDL == nil { + return nil, false + } + return x.ExtendedGuaranteedBitrateDL, true + }, + Clear: func(x *GBRQosInformation) { + x.ExtendedGuaranteedBitrateDL = nil + }, + }, + { + ID: IDExtendedERABGuaranteedBitrateUL, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *GBRQosInformation, r *per.Reader, enc per.Encoding) error { + var v ExtendedBitRate + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ExtendedGuaranteedBitrateUL = &v + return nil + }, + Encode: func(x *GBRQosInformation) (per.Marshaler, bool) { + if x.ExtendedGuaranteedBitrateUL == nil { + return nil, false + } + return x.ExtendedGuaranteedBitrateUL, true + }, + Clear: func(x *GBRQosInformation) { + x.ExtendedGuaranteedBitrateUL = nil + }, + }, +} + +func (gBRQosInformation *GBRQosInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsGBRQosInformation, gBRQosInformation, &gBRQosInformation.iEExtensions) + return notComprehended +} + +func (gNB *GNB) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsGNB, gNB, gNB.iEExtensions) + w.WriteBit(gNB.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gNB.GlobalGNBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gNB.extensions.Present() { + if err := gNB.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gNB *GNB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gNB = GNB{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gNB.GlobalGNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGNB, gNB, &gNB.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := gNB.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGNB []apimpl.IESpec[ProtocolIEID, GNB] + +func (gNB *GNB) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if gNB.GlobalGNBID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsGNB, gNB, &gNB.iEExtensions) + return notComprehended +} + +func (gNBIdentity *GNBIdentity) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{gNBIdentity.GNBID != nil, gNBIdentity.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case gNBIdentity.GNBID != nil: + w.WriteBit(false) + if err := (*gNBIdentity.GNBID).MarshalPER(w, enc); err != nil { + return err + } + case gNBIdentity.Ext != nil: + w.WriteBit(true) + return gNBIdentity.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (gNBIdentity *GNBIdentity) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gNBIdentity = GNBIdentity{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + gNBIdentity.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + var idx int64 = 0 + switch idx { + case 0: + var v GNBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + gNBIdentity.GNBID = &v + default: + return per.ErrOverflow + } + return nil +} + +func (gNBIdentity *GNBIdentity) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + switch { + case gNBIdentity.GNBID != nil: + case gNBIdentity.Ext != nil: + return true + } + return false +} + +func (gUMMEI *GUMMEI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsGUMMEI, gUMMEI, gUMMEI.iEExtensions) + w.WriteBit(gUMMEI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := gUMMEI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := gUMMEI.MMEGroupID.MarshalPER(w, enc); err != nil { + return err + } + if err := gUMMEI.MMECode.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if gUMMEI.extensions.Present() { + if err := gUMMEI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (gUMMEI *GUMMEI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *gUMMEI = GUMMEI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&gUMMEI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUMMEI.MMEGroupID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&gUMMEI.MMECode).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGUMMEI, gUMMEI, &gUMMEI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := gUMMEI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGUMMEI []apimpl.IESpec[ProtocolIEID, GUMMEI] + +func (gUMMEI *GUMMEI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsGUMMEI, gUMMEI, &gUMMEI.iEExtensions) + return notComprehended +} + +func (gUMMEIType GUMMEIType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumGUMMEIType.Encode(w, enc, gUMMEIType) +} + +func (gUMMEIType *GUMMEIType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumGUMMEIType.Decode(r, enc) + if err != nil { + return err + } + *gUMMEIType = v + return nil +} + +func (gUMMEIType GUMMEIType) Name() string { + return enumGUMMEIType.Name(gUMMEIType) +} + +func (gUMMEIType GUMMEIType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumGUMMEIType.Known(gUMMEIType) +} + +func (gWContextReleaseIndication GWContextReleaseIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumGWContextReleaseIndication.Encode(w, enc, gWContextReleaseIndication) +} + +func (gWContextReleaseIndication *GWContextReleaseIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumGWContextReleaseIndication.Decode(r, enc) + if err != nil { + return err + } + *gWContextReleaseIndication = v + return nil +} + +func (gWContextReleaseIndication GWContextReleaseIndication) Name() string { + return enumGWContextReleaseIndication.Name(gWContextReleaseIndication) +} + +func (gWContextReleaseIndication GWContextReleaseIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumGWContextReleaseIndication.Known(gWContextReleaseIndication) +} + +func (globalENBID *GlobalENBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsGlobalENBID, globalENBID, globalENBID.iEExtensions) + w.WriteBit(globalENBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalENBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalENBID.ENBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalENBID.extensions.Present() { + if err := globalENBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalENBID *GlobalENBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalENBID = GlobalENBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalENBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalENBID.ENBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalENBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalENBID []apimpl.IESpec[ProtocolIEID, GlobalENBID] + +func (globalENBID *GlobalENBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalENBID.ENBID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsGlobalENBID, globalENBID, &globalENBID.iEExtensions) + return notComprehended +} + +func (globalGNBID *GlobalGNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsGlobalGNBID, globalGNBID, globalGNBID.iEExtensions) + w.WriteBit(globalGNBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalGNBID.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalGNBID.GNBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalGNBID.extensions.Present() { + if err := globalGNBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalGNBID *GlobalGNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalGNBID = GlobalGNBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalGNBID.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalGNBID.GNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalGNBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalGNBID []apimpl.IESpec[ProtocolIEID, GlobalGNBID] + +func (globalGNBID *GlobalGNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if globalGNBID.GNBID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsGlobalGNBID, globalGNBID, &globalGNBID.iEExtensions) + return notComprehended +} + +func (globalRANNodeID *GlobalRANNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{globalRANNodeID.GNB != nil, globalRANNodeID.NgENB != nil, globalRANNodeID.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case globalRANNodeID.GNB != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*globalRANNodeID.GNB).MarshalPER(w, enc); err != nil { + return err + } + case globalRANNodeID.NgENB != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*globalRANNodeID.NgENB).MarshalPER(w, enc); err != nil { + return err + } + case globalRANNodeID.Ext != nil: + w.WriteBit(true) + return globalRANNodeID.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (globalRANNodeID *GlobalRANNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalRANNodeID = GlobalRANNodeID{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + globalRANNodeID.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err + } + switch idx { + case 0: + var v GNB + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + globalRANNodeID.GNB = &v + case 1: + var v NgENB + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + globalRANNodeID.NgENB = &v + default: + return per.ErrOverflow + } + return nil +} + +func (globalRANNodeID *GlobalRANNodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + switch { + case globalRANNodeID.GNB != nil: + return globalRANNodeID.GNB.Diagnose(d) + case globalRANNodeID.NgENB != nil: + return globalRANNodeID.NgENB.Diagnose(d) + case globalRANNodeID.Ext != nil: + return true + } + return false +} + +func (globalengNBID *GlobalengNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsGlobalengNBID, globalengNBID, globalengNBID.iEExtensions) + w.WriteBit(globalengNBID.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := globalengNBID.PLMNidentity.MarshalPER(w, enc); err != nil { + return err + } + if err := globalengNBID.EngNBID.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if globalengNBID.extensions.Present() { + if err := globalengNBID.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (globalengNBID *GlobalengNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *globalengNBID = GlobalengNBID{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&globalengNBID.PLMNidentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&globalengNBID.EngNBID).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsGlobalengNBID, globalengNBID, &globalengNBID.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := globalengNBID.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsGlobalengNBID []apimpl.IESpec[ProtocolIEID, GlobalengNBID] + +func (globalengNBID *GlobalengNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsGlobalengNBID, globalengNBID, &globalengNBID.iEExtensions) + return notComprehended +} + +func (handoverRestrictionList *HandoverRestrictionList) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsHandoverRestrictionList, handoverRestrictionList, handoverRestrictionList.iEExtensions) + w.WriteBit(handoverRestrictionList.extensions.Present()) + w.WriteBit(handoverRestrictionList.EquivalentPLMNs != nil) + w.WriteBit(handoverRestrictionList.ForbiddenTAs != nil) + w.WriteBit(handoverRestrictionList.ForbiddenLAs != nil) + w.WriteBit(handoverRestrictionList.ForbiddenInterRATs != nil) + w.WriteBit(len(ext) > 0) + if err := handoverRestrictionList.ServingPLMN.MarshalPER(w, enc); err != nil { + return err + } + if handoverRestrictionList.EquivalentPLMNs != nil { + if err := handoverRestrictionList.EquivalentPLMNs.MarshalPER(w, enc); err != nil { + return err + } + } + if handoverRestrictionList.ForbiddenTAs != nil { + if err := handoverRestrictionList.ForbiddenTAs.MarshalPER(w, enc); err != nil { + return err + } + } + if handoverRestrictionList.ForbiddenLAs != nil { + if err := handoverRestrictionList.ForbiddenLAs.MarshalPER(w, enc); err != nil { + return err + } + } + if handoverRestrictionList.ForbiddenInterRATs != nil { + if err := (*handoverRestrictionList.ForbiddenInterRATs).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if handoverRestrictionList.extensions.Present() { + if err := handoverRestrictionList.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (handoverRestrictionList *HandoverRestrictionList) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *handoverRestrictionList = HandoverRestrictionList{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_EquivalentPLMNs, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenTAs, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenLAs, err := r.ReadBit() + if err != nil { + return err + } + p_ForbiddenInterRATs, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&handoverRestrictionList.ServingPLMN).UnmarshalPER(r, enc); err != nil { + return err + } + if p_EquivalentPLMNs { + if err := (&handoverRestrictionList.EquivalentPLMNs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenTAs { + if err := (&handoverRestrictionList.ForbiddenTAs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenLAs { + if err := (&handoverRestrictionList.ForbiddenLAs).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_ForbiddenInterRATs { + var v ForbiddenInterRATs + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + handoverRestrictionList.ForbiddenInterRATs = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsHandoverRestrictionList, handoverRestrictionList, &handoverRestrictionList.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := handoverRestrictionList.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsHandoverRestrictionList = []apimpl.IESpec[ProtocolIEID, HandoverRestrictionList]{ + { + ID: IDNRrestrictioninEPSasSecondaryRAT, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v NRrestrictioninEPSasSecondaryRAT + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NRrestrictioninEPSasSecondaryRAT = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.NRrestrictioninEPSasSecondaryRAT == nil { + return nil, false + } + return x.NRrestrictioninEPSasSecondaryRAT, true + }, + Clear: func(x *HandoverRestrictionList) { + x.NRrestrictioninEPSasSecondaryRAT = nil + }, + }, + { + ID: IDUnlicensedSpectrumRestriction, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v UnlicensedSpectrumRestriction + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.UnlicensedSpectrumRestriction = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.UnlicensedSpectrumRestriction == nil { + return nil, false + } + return x.UnlicensedSpectrumRestriction, true + }, + Clear: func(x *HandoverRestrictionList) { + x.UnlicensedSpectrumRestriction = nil + }, + }, + { + ID: IDCNTypeRestrictions, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v CNTypeRestrictions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.CNTypeRestrictions = v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if len(x.CNTypeRestrictions) == 0 { + return nil, false + } + return x.CNTypeRestrictions, true + }, + Clear: func(x *HandoverRestrictionList) { + x.CNTypeRestrictions = nil + }, + }, + { + ID: IDNRrestrictionin5GS, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v NRrestrictionin5GS + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.NRrestrictionin5GS = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.NRrestrictionin5GS == nil { + return nil, false + } + return x.NRrestrictionin5GS, true + }, + Clear: func(x *HandoverRestrictionList) { + x.NRrestrictionin5GS = nil + }, + }, + { + ID: IDLastNGRANPLMNIdentity, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v PLMNIdentity + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.LastNGRANPLMNIdentity = &v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if x.LastNGRANPLMNIdentity == nil { + return nil, false + } + return x.LastNGRANPLMNIdentity, true + }, + Clear: func(x *HandoverRestrictionList) { + x.LastNGRANPLMNIdentity = nil + }, + }, + { + ID: IDRATRestrictions, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { + var v RATRestrictions + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.RATRestrictions = v + return nil + }, + Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { + if len(x.RATRestrictions) == 0 { + return nil, false + } + return x.RATRestrictions, true + }, + Clear: func(x *HandoverRestrictionList) { + x.RATRestrictions = nil + }, + }, +} + +func (handoverRestrictionList *HandoverRestrictionList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if handoverRestrictionList.ForbiddenTAs.Diagnose(d) { + notComprehended = true + } + if handoverRestrictionList.ForbiddenLAs.Diagnose(d) { + notComprehended = true + } + if handoverRestrictionList.ForbiddenInterRATs != nil && handoverRestrictionList.ForbiddenInterRATs.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsHandoverRestrictionList, handoverRestrictionList, &handoverRestrictionList.iEExtensions) + return notComprehended +} + +func (handoverType HandoverType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumHandoverType.Encode(w, enc, handoverType) +} + +func (handoverType *HandoverType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumHandoverType.Decode(r, enc) + if err != nil { + return err + } + *handoverType = v + return nil +} + +func (handoverType HandoverType) Name() string { + return enumHandoverType.Name(handoverType) +} + +func (handoverType HandoverType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumHandoverType.Known(handoverType) +} + +func (iABAuthorized IABAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIABAuthorized.Encode(w, enc, iABAuthorized) +} + +func (iABAuthorized *IABAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIABAuthorized.Decode(r, enc) + if err != nil { + return err + } + *iABAuthorized = v + return nil +} + +func (iABAuthorized IABAuthorized) Name() string { + return enumIABAuthorized.Name(iABAuthorized) +} + +func (iABAuthorized IABAuthorized) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumIABAuthorized.Known(iABAuthorized) +} + +func (iABNodeIndication IABNodeIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIABNodeIndication.Encode(w, enc, iABNodeIndication) +} + +func (iABNodeIndication *IABNodeIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIABNodeIndication.Decode(r, enc) + if err != nil { + return err + } + *iABNodeIndication = v + return nil +} + +func (iABNodeIndication IABNodeIndication) Name() string { + return enumIABNodeIndication.Name(iABNodeIndication) +} + +func (iABNodeIndication IABNodeIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumIABNodeIndication.Known(iABNodeIndication) +} + +func (iABSupported IABSupported) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIABSupported.Encode(w, enc, iABSupported) +} + +func (iABSupported *IABSupported) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIABSupported.Decode(r, enc) + if err != nil { + return err + } + *iABSupported = v + return nil +} + +func (iABSupported IABSupported) Name() string { + return enumIABSupported.Name(iABSupported) +} + +func (iABSupported IABSupported) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumIABSupported.Known(iABSupported) +} + +func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIMSvoiceEPSfallbackfrom5G.Encode(w, enc, iMSvoiceEPSfallbackfrom5G) +} + +func (iMSvoiceEPSfallbackfrom5G *IMSvoiceEPSfallbackfrom5G) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIMSvoiceEPSfallbackfrom5G.Decode(r, enc) + if err != nil { + return err + } + *iMSvoiceEPSfallbackfrom5G = v + return nil +} + +func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) Name() string { + return enumIMSvoiceEPSfallbackfrom5G.Name(iMSvoiceEPSfallbackfrom5G) +} + +func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumIMSvoiceEPSfallbackfrom5G.Known(iMSvoiceEPSfallbackfrom5G) +} + +func (informationOnRecommendedCellsAndENBsForPaging *InformationOnRecommendedCellsAndENBsForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsInformationOnRecommendedCellsAndENBsForPaging, informationOnRecommendedCellsAndENBsForPaging, informationOnRecommendedCellsAndENBsForPaging.iEExtensions) + w.WriteBit(informationOnRecommendedCellsAndENBsForPaging.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := informationOnRecommendedCellsAndENBsForPaging.RecommendedCellsForPaging.MarshalPER(w, enc); err != nil { + return err + } + if err := informationOnRecommendedCellsAndENBsForPaging.RecommendENBsForPaging.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if informationOnRecommendedCellsAndENBsForPaging.extensions.Present() { + if err := informationOnRecommendedCellsAndENBsForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (informationOnRecommendedCellsAndENBsForPaging *InformationOnRecommendedCellsAndENBsForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *informationOnRecommendedCellsAndENBsForPaging = InformationOnRecommendedCellsAndENBsForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&informationOnRecommendedCellsAndENBsForPaging.RecommendedCellsForPaging).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&informationOnRecommendedCellsAndENBsForPaging.RecommendENBsForPaging).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsInformationOnRecommendedCellsAndENBsForPaging, informationOnRecommendedCellsAndENBsForPaging, &informationOnRecommendedCellsAndENBsForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := informationOnRecommendedCellsAndENBsForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsInformationOnRecommendedCellsAndENBsForPaging []apimpl.IESpec[ProtocolIEID, InformationOnRecommendedCellsAndENBsForPaging] + +func (informationOnRecommendedCellsAndENBsForPaging *InformationOnRecommendedCellsAndENBsForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if informationOnRecommendedCellsAndENBsForPaging.RecommendedCellsForPaging.Diagnose(d) { + notComprehended = true + } + if informationOnRecommendedCellsAndENBsForPaging.RecommendENBsForPaging.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsInformationOnRecommendedCellsAndENBsForPaging, informationOnRecommendedCellsAndENBsForPaging, &informationOnRecommendedCellsAndENBsForPaging.iEExtensions) + return notComprehended +} + +func (integrityProtectionIndication IntegrityProtectionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumIntegrityProtectionIndication.Encode(w, enc, integrityProtectionIndication) +} + +func (integrityProtectionIndication *IntegrityProtectionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumIntegrityProtectionIndication.Decode(r, enc) + if err != nil { + return err + } + *integrityProtectionIndication = v + return nil +} + +func (integrityProtectionIndication IntegrityProtectionIndication) Name() string { + return enumIntegrityProtectionIndication.Name(integrityProtectionIndication) +} + +func (integrityProtectionIndication IntegrityProtectionIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumIntegrityProtectionIndication.Known(integrityProtectionIndication) +} + +func (interSystemMeasurementItem *InterSystemMeasurementItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsInterSystemMeasurementItem, interSystemMeasurementItem, interSystemMeasurementItem.iEExtensions) + w.WriteBit(interSystemMeasurementItem.MaxRSIndexCellQual != nil) + w.WriteBit(interSystemMeasurementItem.SMTC != nil) + w.WriteBit(interSystemMeasurementItem.ThreshRSIndexR15 != nil) + w.WriteBit(interSystemMeasurementItem.SSBToMeasure != nil) + w.WriteBit(interSystemMeasurementItem.SSRSSIMeasurement != nil) + w.WriteBit(interSystemMeasurementItem.QuantityConfigNRR15 != nil) + w.WriteBit(interSystemMeasurementItem.ExcludedCellsToAddModList != nil) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true}, int64(interSystemMeasurementItem.FreqBandIndicatorNR)); err != nil { + return err + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 3279165, HasUB: true}, int64(interSystemMeasurementItem.SSBFrequencies)); err != nil { + return err + } + if err := interSystemMeasurementItem.SubcarrierSpacingSSB.MarshalPER(w, enc); err != nil { + return err + } + if interSystemMeasurementItem.MaxRSIndexCellQual != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true}, int64((*interSystemMeasurementItem.MaxRSIndexCellQual))); err != nil { + return err + } + } + if interSystemMeasurementItem.SMTC != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SMTC); err != nil { + return err + } + } + if interSystemMeasurementItem.ThreshRSIndexR15 != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.ThreshRSIndexR15); err != nil { + return err + } + } + if interSystemMeasurementItem.SSBToMeasure != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SSBToMeasure); err != nil { + return err + } + } + if interSystemMeasurementItem.SSRSSIMeasurement != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SSRSSIMeasurement); err != nil { + return err + } + } + if interSystemMeasurementItem.QuantityConfigNRR15 != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.QuantityConfigNRR15); err != nil { + return err + } + } + if interSystemMeasurementItem.ExcludedCellsToAddModList != nil { + if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.ExcludedCellsToAddModList); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + return nil +} + +func (interSystemMeasurementItem *InterSystemMeasurementItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *interSystemMeasurementItem = InterSystemMeasurementItem{} + p_MaxRSIndexCellQual, err := r.ReadBit() + if err != nil { + return err + } + p_SMTC, err := r.ReadBit() + if err != nil { + return err + } + p_ThreshRSIndexR15, err := r.ReadBit() + if err != nil { + return err + } + p_SSBToMeasure, err := r.ReadBit() + if err != nil { + return err + } + p_SSRSSIMeasurement, err := r.ReadBit() + if err != nil { + return err + } + p_QuantityConfigNRR15, err := r.ReadBit() + if err != nil { + return err + } + p_ExcludedCellsToAddModList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true}) + if err != nil { + return err + } + interSystemMeasurementItem.FreqBandIndicatorNR = uint16(n0) + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 3279165, HasUB: true}) + if err != nil { + return err + } + interSystemMeasurementItem.SSBFrequencies = uint32(n1) + if err := (&interSystemMeasurementItem.SubcarrierSpacingSSB).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MaxRSIndexCellQual { + var v uint8 + n3, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true}) + if err != nil { + return err + } + v = uint8(n3) + interSystemMeasurementItem.MaxRSIndexCellQual = &v + } + if p_SMTC { + p4, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.SMTC = p4 + } + if p_ThreshRSIndexR15 { + p5, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.ThreshRSIndexR15 = p5 + } + if p_SSBToMeasure { + p6, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.SSBToMeasure = p6 + } + if p_SSRSSIMeasurement { + p7, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.SSRSSIMeasurement = p7 + } + if p_QuantityConfigNRR15 { + p8, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.QuantityConfigNRR15 = p8 + } + if p_ExcludedCellsToAddModList { + p9, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) + if err != nil { + return err + } + interSystemMeasurementItem.ExcludedCellsToAddModList = p9 + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemMeasurementItem, interSystemMeasurementItem, &interSystemMeasurementItem.iEExtensions); err != nil { + return err + } + } + return nil +} + +var extIEsInterSystemMeasurementItem []apimpl.IESpec[ProtocolIEID, InterSystemMeasurementItem] + +func (interSystemMeasurementItem *InterSystemMeasurementItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if interSystemMeasurementItem.SubcarrierSpacingSSB.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsInterSystemMeasurementItem, interSystemMeasurementItem, &interSystemMeasurementItem.iEExtensions) + return notComprehended +} + +func (interSystemMeasurementParameters *InterSystemMeasurementParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, interSystemMeasurementParameters.iEExtensions) + w.WriteBit(interSystemMeasurementParameters.extensions.Present()) + w.WriteBit(interSystemMeasurementParameters.InterSystemMeasurementList != nil) + w.WriteBit(len(ext) > 0) + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true}, int64(interSystemMeasurementParameters.MeasurementDuration)); err != nil { + return err + } + if interSystemMeasurementParameters.InterSystemMeasurementList != nil { + if err := interSystemMeasurementParameters.InterSystemMeasurementList.MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if interSystemMeasurementParameters.extensions.Present() { + if err := interSystemMeasurementParameters.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (interSystemMeasurementParameters *InterSystemMeasurementParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *interSystemMeasurementParameters = InterSystemMeasurementParameters{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_InterSystemMeasurementList, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true}) + if err != nil { + return err + } + interSystemMeasurementParameters.MeasurementDuration = uint8(n0) + if p_InterSystemMeasurementList { + if err := (&interSystemMeasurementParameters.InterSystemMeasurementList).UnmarshalPER(r, enc); err != nil { + return err + } + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, &interSystemMeasurementParameters.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := interSystemMeasurementParameters.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsInterSystemMeasurementParameters []apimpl.IESpec[ProtocolIEID, InterSystemMeasurementParameters] + +func (interSystemMeasurementParameters *InterSystemMeasurementParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if interSystemMeasurementParameters.InterSystemMeasurementList.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, &interSystemMeasurementParameters.iEExtensions) + return notComprehended +} + +func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, intersystemMeasurementConfiguration.iEExtensions) + w.WriteBit(intersystemMeasurementConfiguration.extensions.Present()) + w.WriteBit(intersystemMeasurementConfiguration.RSRP != nil) + w.WriteBit(intersystemMeasurementConfiguration.RSRQ != nil) + w.WriteBit(intersystemMeasurementConfiguration.SINR != nil) + w.WriteBit(len(ext) > 0) + if intersystemMeasurementConfiguration.RSRP != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.RSRP))); err != nil { + return err + } + } + if intersystemMeasurementConfiguration.RSRQ != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.RSRQ))); err != nil { + return err + } + } + if intersystemMeasurementConfiguration.SINR != nil { + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.SINR))); err != nil { + return err + } + } + if err := intersystemMeasurementConfiguration.InterSystemMeasurementParameters.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if intersystemMeasurementConfiguration.extensions.Present() { + if err := intersystemMeasurementConfiguration.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *intersystemMeasurementConfiguration = IntersystemMeasurementConfiguration{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_RSRP, err := r.ReadBit() + if err != nil { + return err + } + p_RSRQ, err := r.ReadBit() + if err != nil { + return err + } + p_SINR, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_RSRP { + var v uint8 + n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + v = uint8(n0) + intersystemMeasurementConfiguration.RSRP = &v + } + if p_RSRQ { + var v uint8 + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + v = uint8(n1) + intersystemMeasurementConfiguration.RSRQ = &v + } + if p_SINR { + var v uint8 + n2, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) + if err != nil { + return err + } + v = uint8(n2) + intersystemMeasurementConfiguration.SINR = &v + } + if err := (&intersystemMeasurementConfiguration.InterSystemMeasurementParameters).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, &intersystemMeasurementConfiguration.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := intersystemMeasurementConfiguration.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsIntersystemMeasurementConfiguration []apimpl.IESpec[ProtocolIEID, IntersystemMeasurementConfiguration] + +func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if intersystemMeasurementConfiguration.InterSystemMeasurementParameters.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, &intersystemMeasurementConfiguration.iEExtensions) + return notComprehended +} + +func (killAllWarningMessages KillAllWarningMessages) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumKillAllWarningMessages.Encode(w, enc, killAllWarningMessages) +} + +func (killAllWarningMessages *KillAllWarningMessages) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumKillAllWarningMessages.Decode(r, enc) + if err != nil { + return err + } + *killAllWarningMessages = v + return nil +} + +func (killAllWarningMessages KillAllWarningMessages) Name() string { + return enumKillAllWarningMessages.Name(killAllWarningMessages) +} + +func (lAI *LAI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsLAI, lAI, lAI.iEExtensions) + w.WriteBit(lAI.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lAI.PLMNIdentity.MarshalPER(w, enc); err != nil { + return err + } + if err := lAI.LAC.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lAI.extensions.Present() { + if err := lAI.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lAI *LAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lAI = LAI{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lAI.LAC).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLAI, lAI, &lAI.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lAI.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLAI []apimpl.IESpec[ProtocolIEID, LAI] + +func (lAI *LAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsLAI, lAI, &lAI.iEExtensions) + return notComprehended +} + +func (lTEMIndication LTEMIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumLTEMIndication.Encode(w, enc, lTEMIndication) +} + +func (lTEMIndication *LTEMIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumLTEMIndication.Decode(r, enc) + if err != nil { + return err + } + *lTEMIndication = v + return nil +} + +func (lTEMIndication LTEMIndication) Name() string { + return enumLTEMIndication.Name(lTEMIndication) +} + +func (lTEMIndication LTEMIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumLTEMIndication.Known(lTEMIndication) +} + +func (lTENTNTAIInformation *LTENTNTAIInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsLTENTNTAIInformation, lTENTNTAIInformation, lTENTNTAIInformation.iEExtensions) + w.WriteBit(lTENTNTAIInformation.extensions.Present()) + w.WriteBit(lTENTNTAIInformation.UELocationDerivedTAC != nil) + w.WriteBit(len(ext) > 0) + if err := lTENTNTAIInformation.ServingPLMN.MarshalPER(w, enc); err != nil { + return err + } + off1 := 0 + if err := per.EncodeLength(w, enc, 1, 12, true, int64(len(lTENTNTAIInformation.TACListInLTENTN)), func(count int64) error { + end := off1 + int(count) + for i := off1; i < end; i++ { + if err := lTENTNTAIInformation.TACListInLTENTN[i].MarshalPER(w, enc); err != nil { + return err + } + } + off1 = end + return nil + }); err != nil { + return err + } + if lTENTNTAIInformation.UELocationDerivedTAC != nil { + if err := (*lTENTNTAIInformation.UELocationDerivedTAC).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lTENTNTAIInformation.extensions.Present() { + if err := lTENTNTAIInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lTENTNTAIInformation *LTENTNTAIInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lTENTNTAIInformation = LTENTNTAIInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_UELocationDerivedTAC, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lTENTNTAIInformation.ServingPLMN).UnmarshalPER(r, enc); err != nil { + return err + } + lTENTNTAIInformation.TACListInLTENTN = nil + if err := per.DecodeLength(r, enc, 1, 12, true, func(count int64) error { + start := len(lTENTNTAIInformation.TACListInLTENTN) + lTENTNTAIInformation.TACListInLTENTN = append(lTENTNTAIInformation.TACListInLTENTN, make([]TAC, count)...) + for i := int64(0); i < count; i++ { + if err := (&lTENTNTAIInformation.TACListInLTENTN[start+int(i)]).UnmarshalPER(r, enc); err != nil { return err } - x.UnlicensedSpectrumRestriction = &v - return nil - }, - Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { - if x.UnlicensedSpectrumRestriction == nil { - return nil, false - } - return x.UnlicensedSpectrumRestriction, true - }, - }, - { - ID: IDCNTypeRestrictions, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { - var v CNTypeRestrictions - if err := (&v).UnmarshalPER(r, enc); err != nil { + } + return nil + }); err != nil { + return err + } + if p_UELocationDerivedTAC { + var v TAC + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lTENTNTAIInformation.UELocationDerivedTAC = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLTENTNTAIInformation, lTENTNTAIInformation, &lTENTNTAIInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lTENTNTAIInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLTENTNTAIInformation []apimpl.IESpec[ProtocolIEID, LTENTNTAIInformation] + +func (lTENTNTAIInformation *LTENTNTAIInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsLTENTNTAIInformation, lTENTNTAIInformation, &lTENTNTAIInformation.iEExtensions) + return notComprehended +} + +func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{lastVisitedCellItem.EUTRANCell != nil, lastVisitedCellItem.UTRANCell != nil, lastVisitedCellItem.GERANCell != nil, lastVisitedCellItem.NGRANCell != nil, lastVisitedCellItem.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case lastVisitedCellItem.EUTRANCell != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { + return err + } + if err := (*lastVisitedCellItem.EUTRANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellItem.UTRANCell != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { + return err + } + if err := (*lastVisitedCellItem.UTRANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellItem.GERANCell != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { + return err + } + if err := (*lastVisitedCellItem.GERANCell).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedCellItem.NGRANCell != nil: + w.WriteBit(true) + if err := per.EncodeNormallySmall(w, enc, 0); err != nil { + return err + } + return per.EncodeOpenType(w, enc, lastVisitedCellItem.NGRANCell) + case lastVisitedCellItem.Ext != nil: + w.WriteBit(true) + return lastVisitedCellItem.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedCellItem = LastVisitedCellItem{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + switch extIdx { + case 0: + var v LastVisitedNGRANCellInformation + if err := per.DecodeCompleteOpenType(r, enc, &v); err != nil { return err } - x.CNTypeRestrictions = v - return nil - }, - Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { - if len(x.CNTypeRestrictions) == 0 { - return nil, false - } - return x.CNTypeRestrictions, true - }, - }, + lastVisitedCellItem.NGRANCell = &v + default: + lastVisitedCellItem.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + return nil + } + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) + if err != nil { + return err + } + switch idx { + case 0: + var v LastVisitedEUTRANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellItem.EUTRANCell = &v + case 1: + var v LastVisitedUTRANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellItem.UTRANCell = &v + case 2: + var v LastVisitedGERANCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedCellItem.GERANCell = &v + default: + return per.ErrOverflow + } + return nil +} + +func (lastVisitedCellItem *LastVisitedCellItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + switch { + case lastVisitedCellItem.EUTRANCell != nil: + return lastVisitedCellItem.EUTRANCell.Diagnose(d) + case lastVisitedCellItem.UTRANCell != nil: + case lastVisitedCellItem.GERANCell != nil: + return lastVisitedCellItem.GERANCell.Diagnose(d) + case lastVisitedCellItem.NGRANCell != nil: + case lastVisitedCellItem.Ext != nil: + return true + } + return false +} + +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation.iEExtensions) + w.WriteBit(lastVisitedEUTRANCellInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := lastVisitedEUTRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedEUTRANCellInformation.CellType.MarshalPER(w, enc); err != nil { + return err + } + if err := lastVisitedEUTRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lastVisitedEUTRANCellInformation.extensions.Present() { + if err := lastVisitedEUTRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedEUTRANCellInformation = LastVisitedEUTRANCellInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&lastVisitedEUTRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, &lastVisitedEUTRANCellInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lastVisitedEUTRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLastVisitedEUTRANCellInformation = []apimpl.IESpec[ProtocolIEID, LastVisitedEUTRANCellInformation]{ { - ID: IDNRrestrictionin5GS, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { - var v NRrestrictionin5GS + ID: IDTimeUEStayedInCellEnhancedGranularity, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { + var v TimeUEStayedInCellEnhancedGranularity if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.NRrestrictionin5GS = &v + x.TimeUEStayedInCellEnhancedGranularity = &v return nil }, - Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { - if x.NRrestrictionin5GS == nil { + Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { + if x.TimeUEStayedInCellEnhancedGranularity == nil { return nil, false } - return x.NRrestrictionin5GS, true + return x.TimeUEStayedInCellEnhancedGranularity, true + }, + Clear: func(x *LastVisitedEUTRANCellInformation) { + x.TimeUEStayedInCellEnhancedGranularity = nil }, }, { - ID: IDLastNGRANPLMNIdentity, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { - var v PLMNIdentity + ID: IDHOCause, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { + var v Cause if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.LastNGRANPLMNIdentity = &v + x.HOCause = &v return nil }, - Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { - if x.LastNGRANPLMNIdentity == nil { + Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { + if x.HOCause == nil { return nil, false } - return x.LastNGRANPLMNIdentity, true + return x.HOCause, true + }, + Clear: func(x *LastVisitedEUTRANCellInformation) { + x.HOCause = nil }, }, { - ID: IDRATRestrictions, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *HandoverRestrictionList, r *per.Reader, enc per.Encoding) error { - var v RATRestrictions + ID: IDLastVisitedPSCellList, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { + var v LastVisitedPSCellList if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - x.RATRestrictions = v + x.LastVisitedPSCellList = v return nil }, - Encode: func(x *HandoverRestrictionList) (per.Marshaler, bool) { - if len(x.RATRestrictions) == 0 { + Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { + if len(x.LastVisitedPSCellList) == 0 { return nil, false } - return x.RATRestrictions, true + return x.LastVisitedPSCellList, true + }, + Clear: func(x *LastVisitedEUTRANCellInformation) { + x.LastVisitedPSCellList = nil }, }, } -func (handoverRestrictionList *HandoverRestrictionList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - if handoverRestrictionList.ForbiddenTAs.Diagnose(d) { - notComprehended = true +func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lastVisitedEUTRANCellInformation.GlobalCellID.Diagnose(d) { + notComprehended = true + } + if lastVisitedEUTRANCellInformation.CellType.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, &lastVisitedEUTRANCellInformation.iEExtensions) + return notComprehended +} + +func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{lastVisitedGERANCellInformation.Undefined != nil, lastVisitedGERANCellInformation.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case lastVisitedGERANCellInformation.Undefined != nil: + w.WriteBit(false) + if err := (*lastVisitedGERANCellInformation.Undefined).MarshalPER(w, enc); err != nil { + return err + } + case lastVisitedGERANCellInformation.Ext != nil: + w.WriteBit(true) + return lastVisitedGERANCellInformation.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedGERANCellInformation = LastVisitedGERANCellInformation{} + isExt, err := r.ReadBit() + if err != nil { + return err + } + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + lastVisitedGERANCellInformation.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err + } + var idx int64 = 0 + switch idx { + case 0: + var v per.Null + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedGERANCellInformation.Undefined = &v + default: + return per.ErrOverflow + } + return nil +} + +func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + switch { + case lastVisitedGERANCellInformation.Undefined != nil: + case lastVisitedGERANCellInformation.Ext != nil: + return true + } + return false +} + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + w.WriteBit(lastVisitedPSCellInformation.extensions.Present()) + w.WriteBit(lastVisitedPSCellInformation.PSCellID != nil) + w.WriteBit(len(ext) > 0) + if lastVisitedPSCellInformation.PSCellID != nil { + if err := (*lastVisitedPSCellInformation.PSCellID).MarshalPER(w, enc); err != nil { + return err + } + } + if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}, int64(lastVisitedPSCellInformation.TimeStay)); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if lastVisitedPSCellInformation.extensions.Present() { + if err := lastVisitedPSCellInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *lastVisitedPSCellInformation = LastVisitedPSCellInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PSCellID, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_PSCellID { + var v PSCellInformation + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + lastVisitedPSCellInformation.PSCellID = &v + } + n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}) + if err != nil { + return err + } + lastVisitedPSCellInformation.TimeStay = uint16(n1) + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := lastVisitedPSCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsLastVisitedPSCellInformation []apimpl.IESpec[ProtocolIEID, LastVisitedPSCellInformation] + +func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if lastVisitedPSCellInformation.PSCellID != nil && lastVisitedPSCellInformation.PSCellID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions) + return notComprehended +} + +func (listeningSubframePattern *ListeningSubframePattern) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsListeningSubframePattern, listeningSubframePattern, listeningSubframePattern.iEExtensions) + w.WriteBit(listeningSubframePattern.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := listeningSubframePattern.PatternPeriod.MarshalPER(w, enc); err != nil { + return err + } + if err := listeningSubframePattern.PatternOffset.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if listeningSubframePattern.extensions.Present() { + if err := listeningSubframePattern.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (listeningSubframePattern *ListeningSubframePattern) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *listeningSubframePattern = ListeningSubframePattern{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&listeningSubframePattern.PatternPeriod).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&listeningSubframePattern.PatternOffset).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsListeningSubframePattern, listeningSubframePattern, &listeningSubframePattern.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := listeningSubframePattern.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsListeningSubframePattern []apimpl.IESpec[ProtocolIEID, ListeningSubframePattern] + +func (listeningSubframePattern *ListeningSubframePattern) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if listeningSubframePattern.PatternPeriod.Diagnose(d) { + notComprehended = true + } + if listeningSubframePattern.PatternOffset.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsListeningSubframePattern, listeningSubframePattern, &listeningSubframePattern.iEExtensions) + return notComprehended +} + +func (mMEPagingTarget *MMEPagingTarget) MarshalPER(w *per.Writer, enc per.Encoding) error { + set := 0 + for _, ok := range [...]bool{mMEPagingTarget.GlobalENBID != nil, mMEPagingTarget.TAI != nil, mMEPagingTarget.Ext != nil} { + if ok { + set++ + } + } + if set > 1 { + return per.ErrChoice + } + switch { + case mMEPagingTarget.GlobalENBID != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 0); err != nil { + return err + } + if err := (*mMEPagingTarget.GlobalENBID).MarshalPER(w, enc); err != nil { + return err + } + case mMEPagingTarget.TAI != nil: + w.WriteBit(false) + if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { + return err + } + if err := (*mMEPagingTarget.TAI).MarshalPER(w, enc); err != nil { + return err + } + case mMEPagingTarget.Ext != nil: + w.WriteBit(true) + return mMEPagingTarget.Ext.MarshalPER(w, enc) + default: + return per.ErrEmpty + } + return nil +} + +func (mMEPagingTarget *MMEPagingTarget) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mMEPagingTarget = MMEPagingTarget{} + isExt, err := r.ReadBit() + if err != nil { + return err } - if handoverRestrictionList.ForbiddenLAs.Diagnose(d) { - notComprehended = true + if isExt { + extIdx, err := per.DecodeNormallySmall(r, enc) + if err != nil { + return err + } + mMEPagingTarget.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) + return err } - if handoverRestrictionList.ForbiddenInterRATs != nil && handoverRestrictionList.ForbiddenInterRATs.Diagnose(d) { - notComprehended = true + idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 1) + if err != nil { + return err } - ap.DiagnoseExtensions(d, extIEsHandoverRestrictionList, handoverRestrictionList, handoverRestrictionList.iEExtensions) - return notComprehended + switch idx { + case 0: + var v GlobalENBID + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mMEPagingTarget.GlobalENBID = &v + case 1: + var v TAI + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + mMEPagingTarget.TAI = &v + default: + return per.ErrOverflow + } + return nil } -func (handoverType HandoverType) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumHandoverType.Encode(w, enc, handoverType) +func (mMEPagingTarget *MMEPagingTarget) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + switch { + case mMEPagingTarget.GlobalENBID != nil: + return mMEPagingTarget.GlobalENBID.Diagnose(d) + case mMEPagingTarget.TAI != nil: + return mMEPagingTarget.TAI.Diagnose(d) + case mMEPagingTarget.Ext != nil: + return true + } + return false } -func (handoverType *HandoverType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumHandoverType.Decode(r, enc) +func (mMERelaySupportIndicator MMERelaySupportIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMMERelaySupportIndicator.Encode(w, enc, mMERelaySupportIndicator) +} + +func (mMERelaySupportIndicator *MMERelaySupportIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMMERelaySupportIndicator.Decode(r, enc) if err != nil { return err } - *handoverType = v + *mMERelaySupportIndicator = v return nil } -func (handoverType HandoverType) Name() string { - return enumHandoverType.Name(handoverType) +func (mMERelaySupportIndicator MMERelaySupportIndicator) Name() string { + return enumMMERelaySupportIndicator.Name(mMERelaySupportIndicator) } -func (handoverType HandoverType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumHandoverType.Known(handoverType) +func (mMERelaySupportIndicator MMERelaySupportIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumMMERelaySupportIndicator.Known(mMERelaySupportIndicator) } -func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumIMSvoiceEPSfallbackfrom5G.Encode(w, enc, iMSvoiceEPSfallbackfrom5G) +func (managementBasedMDTAllowed ManagementBasedMDTAllowed) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumManagementBasedMDTAllowed.Encode(w, enc, managementBasedMDTAllowed) } -func (iMSvoiceEPSfallbackfrom5G *IMSvoiceEPSfallbackfrom5G) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumIMSvoiceEPSfallbackfrom5G.Decode(r, enc) +func (managementBasedMDTAllowed *ManagementBasedMDTAllowed) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumManagementBasedMDTAllowed.Decode(r, enc) if err != nil { return err } - *iMSvoiceEPSfallbackfrom5G = v + *managementBasedMDTAllowed = v return nil } -func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) Name() string { - return enumIMSvoiceEPSfallbackfrom5G.Name(iMSvoiceEPSfallbackfrom5G) +func (managementBasedMDTAllowed ManagementBasedMDTAllowed) Name() string { + return enumManagementBasedMDTAllowed.Name(managementBasedMDTAllowed) } -func (iMSvoiceEPSfallbackfrom5G IMSvoiceEPSfallbackfrom5G) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumIMSvoiceEPSfallbackfrom5G.Known(iMSvoiceEPSfallbackfrom5G) +func (managementBasedMDTAllowed ManagementBasedMDTAllowed) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumManagementBasedMDTAllowed.Known(managementBasedMDTAllowed) } -func (integrityProtectionIndication IntegrityProtectionIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumIntegrityProtectionIndication.Encode(w, enc, integrityProtectionIndication) +func (mutingAvailabilityIndication MutingAvailabilityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMutingAvailabilityIndication.Encode(w, enc, mutingAvailabilityIndication) } -func (integrityProtectionIndication *IntegrityProtectionIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumIntegrityProtectionIndication.Decode(r, enc) +func (mutingAvailabilityIndication *MutingAvailabilityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMutingAvailabilityIndication.Decode(r, enc) if err != nil { return err } - *integrityProtectionIndication = v + *mutingAvailabilityIndication = v return nil } -func (integrityProtectionIndication IntegrityProtectionIndication) Name() string { - return enumIntegrityProtectionIndication.Name(integrityProtectionIndication) +func (mutingAvailabilityIndication MutingAvailabilityIndication) Name() string { + return enumMutingAvailabilityIndication.Name(mutingAvailabilityIndication) } -func (integrityProtectionIndication IntegrityProtectionIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumIntegrityProtectionIndication.Known(integrityProtectionIndication) +func (mutingAvailabilityIndication MutingAvailabilityIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumMutingAvailabilityIndication.Known(mutingAvailabilityIndication) } -func (interSystemMeasurementItem *InterSystemMeasurementItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsInterSystemMeasurementItem, interSystemMeasurementItem, interSystemMeasurementItem.iEExtensions) - w.WriteBit(interSystemMeasurementItem.MaxRSIndexCellQual != nil) - w.WriteBit(interSystemMeasurementItem.SMTC != nil) - w.WriteBit(interSystemMeasurementItem.ThreshRSIndexR15 != nil) - w.WriteBit(interSystemMeasurementItem.SSBToMeasure != nil) - w.WriteBit(interSystemMeasurementItem.SSRSSIMeasurement != nil) - w.WriteBit(interSystemMeasurementItem.QuantityConfigNRR15 != nil) - w.WriteBit(interSystemMeasurementItem.ExcludedCellsToAddModList != nil) +func (mutingPatternInformation *MutingPatternInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsMutingPatternInformation, mutingPatternInformation, mutingPatternInformation.iEExtensions) + w.WriteBit(mutingPatternInformation.extensions.Present()) + w.WriteBit(mutingPatternInformation.MutingPatternOffset != nil) w.WriteBit(len(ext) > 0) - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true}, int64(interSystemMeasurementItem.FreqBandIndicatorNR)); err != nil { - return err - } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 3279165, HasUB: true}, int64(interSystemMeasurementItem.SSBFrequencies)); err != nil { - return err - } - if err := interSystemMeasurementItem.SubcarrierSpacingSSB.MarshalPER(w, enc); err != nil { + if err := mutingPatternInformation.MutingPatternPeriod.MarshalPER(w, enc); err != nil { return err } - if interSystemMeasurementItem.MaxRSIndexCellQual != nil { - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true}, int64((*interSystemMeasurementItem.MaxRSIndexCellQual))); err != nil { + if mutingPatternInformation.MutingPatternOffset != nil { + if err := (*mutingPatternInformation.MutingPatternOffset).MarshalPER(w, enc); err != nil { return err } } - if interSystemMeasurementItem.SMTC != nil { - if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SMTC); err != nil { + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if interSystemMeasurementItem.ThreshRSIndexR15 != nil { - if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.ThreshRSIndexR15); err != nil { + if mutingPatternInformation.extensions.Present() { + if err := mutingPatternInformation.extensions.MarshalPER(w, enc); err != nil { return err } } - if interSystemMeasurementItem.SSBToMeasure != nil { - if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SSBToMeasure); err != nil { - return err - } + return nil +} + +func (mutingPatternInformation *MutingPatternInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *mutingPatternInformation = MutingPatternInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err } - if interSystemMeasurementItem.SSRSSIMeasurement != nil { - if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.SSRSSIMeasurement); err != nil { - return err - } + p_MutingPatternOffset, err := r.ReadBit() + if err != nil { + return err } - if interSystemMeasurementItem.QuantityConfigNRR15 != nil { - if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.QuantityConfigNRR15); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&mutingPatternInformation.MutingPatternPeriod).UnmarshalPER(r, enc); err != nil { + return err + } + if p_MutingPatternOffset { + var v PatternOffset + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + mutingPatternInformation.MutingPatternOffset = &v } - if interSystemMeasurementItem.ExcludedCellsToAddModList != nil { - if err := per.EncodeOctetString(w, enc, 0, 0, false, false, false, interSystemMeasurementItem.ExcludedCellsToAddModList); err != nil { + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsMutingPatternInformation, mutingPatternInformation, &mutingPatternInformation.iEExtensions); err != nil { return err } } - if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if extBit { + if err := mutingPatternInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -func (interSystemMeasurementItem *InterSystemMeasurementItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *interSystemMeasurementItem = InterSystemMeasurementItem{} - p_MaxRSIndexCellQual, err := r.ReadBit() - if err != nil { - return err - } - p_SMTC, err := r.ReadBit() - if err != nil { - return err - } - p_ThreshRSIndexR15, err := r.ReadBit() - if err != nil { - return err - } - p_SSBToMeasure, err := r.ReadBit() - if err != nil { - return err +var extIEsMutingPatternInformation []apimpl.IESpec[ProtocolIEID, MutingPatternInformation] + +func (mutingPatternInformation *MutingPatternInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if mutingPatternInformation.MutingPatternPeriod.Diagnose(d) { + notComprehended = true } - p_SSRSSIMeasurement, err := r.ReadBit() - if err != nil { - return err + if mutingPatternInformation.MutingPatternOffset != nil && mutingPatternInformation.MutingPatternOffset.Diagnose(d) { + notComprehended = true } - p_QuantityConfigNRR15, err := r.ReadBit() + apimpl.DiagnoseExtensions(d, extIEsMutingPatternInformation, mutingPatternInformation, &mutingPatternInformation.iEExtensions) + return notComprehended +} + +func (mutingPatternPeriod MutingPatternPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumMutingPatternPeriod.Encode(w, enc, mutingPatternPeriod) +} + +func (mutingPatternPeriod *MutingPatternPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumMutingPatternPeriod.Decode(r, enc) if err != nil { return err } - p_ExcludedCellsToAddModList, err := r.ReadBit() + *mutingPatternPeriod = v + return nil +} + +func (mutingPatternPeriod MutingPatternPeriod) Name() string { + return enumMutingPatternPeriod.Name(mutingPatternPeriod) +} + +func (mutingPatternPeriod MutingPatternPeriod) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumMutingPatternPeriod.Known(mutingPatternPeriod) +} + +func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTDefaultPagingDRX.Encode(w, enc, nBIoTDefaultPagingDRX) +} + +func (nBIoTDefaultPagingDRX *NBIoTDefaultPagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTDefaultPagingDRX.Decode(r, enc) if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + *nBIoTDefaultPagingDRX = v + return nil +} + +func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) Name() string { + return enumNBIoTDefaultPagingDRX.Name(nBIoTDefaultPagingDRX) +} + +func (nBIoTDefaultPagingDRX NBIoTDefaultPagingDRX) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTDefaultPagingDRX.Known(nBIoTDefaultPagingDRX) +} + +func (nBIoTPagingDRX NBIoTPagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTPagingDRX.Encode(w, enc, nBIoTPagingDRX) +} + +func (nBIoTPagingDRX *NBIoTPagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTPagingDRX.Decode(r, enc) if err != nil { return err } - n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 1024, HasUB: true}) + *nBIoTPagingDRX = v + return nil +} + +func (nBIoTPagingDRX NBIoTPagingDRX) Name() string { + return enumNBIoTPagingDRX.Name(nBIoTPagingDRX) +} + +func (nBIoTPagingDRX NBIoTPagingDRX) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTPagingDRX.Known(nBIoTPagingDRX) +} + +func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTPagingTimeWindow.Encode(w, enc, nBIoTPagingTimeWindow) +} + +func (nBIoTPagingTimeWindow *NBIoTPagingTimeWindow) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTPagingTimeWindow.Decode(r, enc) if err != nil { return err } - interSystemMeasurementItem.FreqBandIndicatorNR = uint16(n0) - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 3279165, HasUB: true}) + *nBIoTPagingTimeWindow = v + return nil +} + +func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) Name() string { + return enumNBIoTPagingTimeWindow.Name(nBIoTPagingTimeWindow) +} + +func (nBIoTPagingTimeWindow NBIoTPagingTimeWindow) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTPagingTimeWindow.Known(nBIoTPagingTimeWindow) +} + +func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNBIoTPagingeDRXCycle.Encode(w, enc, nBIoTPagingeDRXCycle) +} + +func (nBIoTPagingeDRXCycle *NBIoTPagingeDRXCycle) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNBIoTPagingeDRXCycle.Decode(r, enc) if err != nil { return err } - interSystemMeasurementItem.SSBFrequencies = uint32(n1) - if err := (&interSystemMeasurementItem.SubcarrierSpacingSSB).UnmarshalPER(r, enc); err != nil { - return err - } - if p_MaxRSIndexCellQual { - var v uint8 - n3, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 16, HasUB: true}) - if err != nil { - return err - } - v = uint8(n3) - interSystemMeasurementItem.MaxRSIndexCellQual = &v - } - if p_SMTC { - p4, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) - if err != nil { - return err - } - interSystemMeasurementItem.SMTC = p4 - } - if p_ThreshRSIndexR15 { - p5, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) - if err != nil { + *nBIoTPagingeDRXCycle = v + return nil +} + +func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) Name() string { + return enumNBIoTPagingeDRXCycle.Name(nBIoTPagingeDRXCycle) +} + +func (nBIoTPagingeDRXCycle NBIoTPagingeDRXCycle) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNBIoTPagingeDRXCycle.Known(nBIoTPagingeDRXCycle) +} + +func (nBIoTPagingeDRXInformation *NBIoTPagingeDRXInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsNBIoTPagingeDRXInformation, nBIoTPagingeDRXInformation, nBIoTPagingeDRXInformation.iEExtensions) + w.WriteBit(nBIoTPagingeDRXInformation.extensions.Present()) + w.WriteBit(nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow != nil) + w.WriteBit(len(ext) > 0) + if err := nBIoTPagingeDRXInformation.NBIoTpagingeDRXCycle.MarshalPER(w, enc); err != nil { + return err + } + if nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow != nil { + if err := (*nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow).MarshalPER(w, enc); err != nil { return err } - interSystemMeasurementItem.ThreshRSIndexR15 = p5 } - if p_SSBToMeasure { - p6, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) - if err != nil { + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - interSystemMeasurementItem.SSBToMeasure = p6 } - if p_SSRSSIMeasurement { - p7, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) - if err != nil { + if nBIoTPagingeDRXInformation.extensions.Present() { + if err := nBIoTPagingeDRXInformation.extensions.MarshalPER(w, enc); err != nil { return err } - interSystemMeasurementItem.SSRSSIMeasurement = p7 } - if p_QuantityConfigNRR15 { - p8, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) - if err != nil { + return nil +} + +func (nBIoTPagingeDRXInformation *NBIoTPagingeDRXInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nBIoTPagingeDRXInformation = NBIoTPagingeDRXInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_NBIoTpagingTimeWindow, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nBIoTPagingeDRXInformation.NBIoTpagingeDRXCycle).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NBIoTpagingTimeWindow { + var v NBIoTPagingTimeWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - interSystemMeasurementItem.QuantityConfigNRR15 = p8 + nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow = &v } - if p_ExcludedCellsToAddModList { - p9, err := per.DecodeOctetString(r, enc, 0, 0, false, false, false) - if err != nil { + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNBIoTPagingeDRXInformation, nBIoTPagingeDRXInformation, &nBIoTPagingeDRXInformation.iEExtensions); err != nil { return err } - interSystemMeasurementItem.ExcludedCellsToAddModList = p9 } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemMeasurementItem, interSystemMeasurementItem, &interSystemMeasurementItem.iEExtensions); err != nil { + if extBit { + if err := nBIoTPagingeDRXInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsInterSystemMeasurementItem []ap.IESpec[ProtocolIEID, InterSystemMeasurementItem] +var extIEsNBIoTPagingeDRXInformation []apimpl.IESpec[ProtocolIEID, NBIoTPagingeDRXInformation] -func (interSystemMeasurementItem *InterSystemMeasurementItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nBIoTPagingeDRXInformation *NBIoTPagingeDRXInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if interSystemMeasurementItem.SubcarrierSpacingSSB.Diagnose(d) { + if nBIoTPagingeDRXInformation.NBIoTpagingeDRXCycle.Diagnose(d) { + notComprehended = true + } + if nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow != nil && nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsInterSystemMeasurementItem, interSystemMeasurementItem, interSystemMeasurementItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNBIoTPagingeDRXInformation, nBIoTPagingeDRXInformation, &nBIoTPagingeDRXInformation.iEExtensions) return notComprehended } -func (interSystemMeasurementParameters *InterSystemMeasurementParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, interSystemMeasurementParameters.iEExtensions) - w.WriteBit(interSystemMeasurementParameters.extensions.Present()) - w.WriteBit(interSystemMeasurementParameters.InterSystemMeasurementList != nil) +func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + w.WriteBit(nRCGI.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true}, int64(interSystemMeasurementParameters.MeasurementDuration)); err != nil { + if err := nRCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } - if interSystemMeasurementParameters.InterSystemMeasurementList != nil { - if err := interSystemMeasurementParameters.InterSystemMeasurementList.MarshalPER(w, enc); err != nil { - return err - } + if err := nRCGI.NRCellIdentity.MarshalPER(w, enc); err != nil { + return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if interSystemMeasurementParameters.extensions.Present() { - if err := interSystemMeasurementParameters.extensions.MarshalPER(w, enc); err != nil { + if nRCGI.extensions.Present() { + if err := nRCGI.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (interSystemMeasurementParameters *InterSystemMeasurementParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *interSystemMeasurementParameters = InterSystemMeasurementParameters{} +func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRCGI = NRCGI{} extBit, err := r.ReadBit() if err != nil { return err } - p_InterSystemMeasurementList, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 1, HasLB: true, UB: 100, HasUB: true}) - if err != nil { + if err := (&nRCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { return err } - interSystemMeasurementParameters.MeasurementDuration = uint8(n0) - if p_InterSystemMeasurementList { - if err := (&interSystemMeasurementParameters.InterSystemMeasurementList).UnmarshalPER(r, enc); err != nil { - return err - } + if err := (&nRCGI.NRCellIdentity).UnmarshalPER(r, enc); err != nil { + return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, &interSystemMeasurementParameters.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions); err != nil { return err } } if extBit { - if err := interSystemMeasurementParameters.extensions.UnmarshalPER(r, enc); err != nil { + if err := nRCGI.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsInterSystemMeasurementParameters []ap.IESpec[ProtocolIEID, InterSystemMeasurementParameters] +var extIEsNRCGI []apimpl.IESpec[ProtocolIEID, NRCGI] -func (interSystemMeasurementParameters *InterSystemMeasurementParameters) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRCGI *NRCGI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if interSystemMeasurementParameters.InterSystemMeasurementList.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsInterSystemMeasurementParameters, interSystemMeasurementParameters, interSystemMeasurementParameters.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions) return notComprehended } -func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, intersystemMeasurementConfiguration.iEExtensions) - w.WriteBit(intersystemMeasurementConfiguration.extensions.Present()) - w.WriteBit(intersystemMeasurementConfiguration.RSRP != nil) - w.WriteBit(intersystemMeasurementConfiguration.RSRQ != nil) - w.WriteBit(intersystemMeasurementConfiguration.SINR != nil) +func (nRUESecurityCapabilities *NRUESecurityCapabilities) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsNRUESecurityCapabilities, nRUESecurityCapabilities, nRUESecurityCapabilities.iEExtensions) + w.WriteBit(nRUESecurityCapabilities.extensions.Present()) w.WriteBit(len(ext) > 0) - if intersystemMeasurementConfiguration.RSRP != nil { - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.RSRP))); err != nil { - return err - } - } - if intersystemMeasurementConfiguration.RSRQ != nil { - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.RSRQ))); err != nil { - return err - } - } - if intersystemMeasurementConfiguration.SINR != nil { - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}, int64((*intersystemMeasurementConfiguration.SINR))); err != nil { - return err - } + if err := nRUESecurityCapabilities.NRencryptionAlgorithms.MarshalPER(w, enc); err != nil { + return err } - if err := intersystemMeasurementConfiguration.InterSystemMeasurementParameters.MarshalPER(w, enc); err != nil { + if err := nRUESecurityCapabilities.NRintegrityProtectionAlgorithms.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if intersystemMeasurementConfiguration.extensions.Present() { - if err := intersystemMeasurementConfiguration.extensions.MarshalPER(w, enc); err != nil { + if nRUESecurityCapabilities.extensions.Present() { + if err := nRUESecurityCapabilities.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *intersystemMeasurementConfiguration = IntersystemMeasurementConfiguration{} +func (nRUESecurityCapabilities *NRUESecurityCapabilities) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRUESecurityCapabilities = NRUESecurityCapabilities{} extBit, err := r.ReadBit() if err != nil { return err } - p_RSRP, err := r.ReadBit() + p_iEExtensions, err := r.ReadBit() if err != nil { return err } - p_RSRQ, err := r.ReadBit() - if err != nil { + if err := (&nRUESecurityCapabilities.NRencryptionAlgorithms).UnmarshalPER(r, enc); err != nil { return err } - p_SINR, err := r.ReadBit() - if err != nil { + if err := (&nRUESecurityCapabilities.NRintegrityProtectionAlgorithms).UnmarshalPER(r, enc); err != nil { return err } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRUESecurityCapabilities, nRUESecurityCapabilities, &nRUESecurityCapabilities.iEExtensions); err != nil { + return err + } } - if p_RSRP { - var v uint8 - n0, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) - if err != nil { + if extBit { + if err := nRUESecurityCapabilities.extensions.UnmarshalPER(r, enc); err != nil { return err } - v = uint8(n0) - intersystemMeasurementConfiguration.RSRP = &v } - if p_RSRQ { - var v uint8 - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) - if err != nil { + return nil +} + +var extIEsNRUESecurityCapabilities []apimpl.IESpec[ProtocolIEID, NRUESecurityCapabilities] + +func (nRUESecurityCapabilities *NRUESecurityCapabilities) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsNRUESecurityCapabilities, nRUESecurityCapabilities, &nRUESecurityCapabilities.iEExtensions) + return notComprehended +} + +func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate.iEExtensions) + w.WriteBit(nRUESidelinkAggregateMaximumBitrate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := nRUESidelinkAggregateMaximumBitrate.UEaggregateMaximumBitRate.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } - v = uint8(n1) - intersystemMeasurementConfiguration.RSRQ = &v } - if p_SINR { - var v uint8 - n2, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 127, HasUB: true}) - if err != nil { + if nRUESidelinkAggregateMaximumBitrate.extensions.Present() { + if err := nRUESidelinkAggregateMaximumBitrate.extensions.MarshalPER(w, enc); err != nil { return err } - v = uint8(n2) - intersystemMeasurementConfiguration.SINR = &v } - if err := (&intersystemMeasurementConfiguration.InterSystemMeasurementParameters).UnmarshalPER(r, enc); err != nil { + return nil +} + +func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRUESidelinkAggregateMaximumBitrate = NRUESidelinkAggregateMaximumBitrate{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&nRUESidelinkAggregateMaximumBitrate.UEaggregateMaximumBitRate).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, &intersystemMeasurementConfiguration.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, &nRUESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { return err } } if extBit { - if err := intersystemMeasurementConfiguration.extensions.UnmarshalPER(r, enc); err != nil { + if err := nRUESidelinkAggregateMaximumBitrate.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsIntersystemMeasurementConfiguration []ap.IESpec[ProtocolIEID, IntersystemMeasurementConfiguration] +var extIEsNRUESidelinkAggregateMaximumBitrate []apimpl.IESpec[ProtocolIEID, NRUESidelinkAggregateMaximumBitrate] -func (intersystemMeasurementConfiguration *IntersystemMeasurementConfiguration) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if intersystemMeasurementConfiguration.InterSystemMeasurementParameters.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsIntersystemMeasurementConfiguration, intersystemMeasurementConfiguration, intersystemMeasurementConfiguration.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsNRUESidelinkAggregateMaximumBitrate, nRUESidelinkAggregateMaximumBitrate, &nRUESidelinkAggregateMaximumBitrate.iEExtensions) return notComprehended } -func (lAI *LAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLAI, lAI, lAI.iEExtensions) - w.WriteBit(lAI.extensions.Present()) +func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, nRV2XServicesAuthorized.iEExtensions) + w.WriteBit(nRV2XServicesAuthorized.extensions.Present()) + w.WriteBit(nRV2XServicesAuthorized.VehicleUE != nil) + w.WriteBit(nRV2XServicesAuthorized.PedestrianUE != nil) w.WriteBit(len(ext) > 0) - if err := lAI.PLMNIdentity.MarshalPER(w, enc); err != nil { - return err + if nRV2XServicesAuthorized.VehicleUE != nil { + if err := (*nRV2XServicesAuthorized.VehicleUE).MarshalPER(w, enc); err != nil { + return err + } } - if err := lAI.LAC.MarshalPER(w, enc); err != nil { - return err + if nRV2XServicesAuthorized.PedestrianUE != nil { + if err := (*nRV2XServicesAuthorized.PedestrianUE).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if lAI.extensions.Present() { - if err := lAI.extensions.MarshalPER(w, enc); err != nil { + if nRV2XServicesAuthorized.extensions.Present() { + if err := nRV2XServicesAuthorized.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (lAI *LAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *lAI = LAI{} +func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *nRV2XServicesAuthorized = NRV2XServicesAuthorized{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_VehicleUE, err := r.ReadBit() if err != nil { return err } - if err := (&lAI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + p_PedestrianUE, err := r.ReadBit() + if err != nil { return err } - if err := (&lAI.LAC).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } + if p_VehicleUE { + var v VehicleUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRV2XServicesAuthorized.VehicleUE = &v + } + if p_PedestrianUE { + var v PedestrianUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + nRV2XServicesAuthorized.PedestrianUE = &v + } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLAI, lAI, &lAI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, &nRV2XServicesAuthorized.iEExtensions); err != nil { return err } } if extBit { - if err := lAI.extensions.UnmarshalPER(r, enc); err != nil { + if err := nRV2XServicesAuthorized.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsLAI []ap.IESpec[ProtocolIEID, LAI] +var extIEsNRV2XServicesAuthorized []apimpl.IESpec[ProtocolIEID, NRV2XServicesAuthorized] -func (lAI *LAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (nRV2XServicesAuthorized *NRV2XServicesAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsLAI, lAI, lAI.iEExtensions) + if nRV2XServicesAuthorized.VehicleUE != nil && nRV2XServicesAuthorized.VehicleUE.Diagnose(d) { + notComprehended = true + } + if nRV2XServicesAuthorized.PedestrianUE != nil && nRV2XServicesAuthorized.PedestrianUE.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsNRV2XServicesAuthorized, nRV2XServicesAuthorized, &nRV2XServicesAuthorized.iEExtensions) return notComprehended } -func (lTENTNTAIInformation *LTENTNTAIInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLTENTNTAIInformation, lTENTNTAIInformation, lTENTNTAIInformation.iEExtensions) - w.WriteBit(lTENTNTAIInformation.extensions.Present()) - w.WriteBit(lTENTNTAIInformation.UELocationDerivedTAC != nil) - w.WriteBit(len(ext) > 0) - if err := lTENTNTAIInformation.ServingPLMN.MarshalPER(w, enc); err != nil { +func (nRrestrictionin5GS NRrestrictionin5GS) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRrestrictionin5GS.Encode(w, enc, nRrestrictionin5GS) +} + +func (nRrestrictionin5GS *NRrestrictionin5GS) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRrestrictionin5GS.Decode(r, enc) + if err != nil { return err } - off1 := 0 - if err := per.EncodeLength(w, enc, 1, 12, true, int64(len(lTENTNTAIInformation.TACListInLTENTN)), func(count int64) error { - end := off1 + int(count) - for i := off1; i < end; i++ { - if err := lTENTNTAIInformation.TACListInLTENTN[i].MarshalPER(w, enc); err != nil { - return err - } - } - off1 = end - return nil - }); err != nil { + *nRrestrictionin5GS = v + return nil +} + +func (nRrestrictionin5GS NRrestrictionin5GS) Name() string { + return enumNRrestrictionin5GS.Name(nRrestrictionin5GS) +} + +func (nRrestrictionin5GS NRrestrictionin5GS) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNRrestrictionin5GS.Known(nRrestrictionin5GS) +} + +func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNRrestrictioninEPSasSecondaryRAT.Encode(w, enc, nRrestrictioninEPSasSecondaryRAT) +} + +func (nRrestrictioninEPSasSecondaryRAT *NRrestrictioninEPSasSecondaryRAT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNRrestrictioninEPSasSecondaryRAT.Decode(r, enc) + if err != nil { + return err + } + *nRrestrictioninEPSasSecondaryRAT = v + return nil +} + +func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) Name() string { + return enumNRrestrictioninEPSasSecondaryRAT.Name(nRrestrictioninEPSasSecondaryRAT) +} + +func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNRrestrictioninEPSasSecondaryRAT.Known(nRrestrictioninEPSasSecondaryRAT) +} + +func (nextPagingAreaScope NextPagingAreaScope) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNextPagingAreaScope.Encode(w, enc, nextPagingAreaScope) +} + +func (nextPagingAreaScope *NextPagingAreaScope) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNextPagingAreaScope.Decode(r, enc) + if err != nil { return err } - if lTENTNTAIInformation.UELocationDerivedTAC != nil { - if err := (*lTENTNTAIInformation.UELocationDerivedTAC).MarshalPER(w, enc); err != nil { - return err - } + *nextPagingAreaScope = v + return nil +} + +func (nextPagingAreaScope NextPagingAreaScope) Name() string { + return enumNextPagingAreaScope.Name(nextPagingAreaScope) +} + +func (nextPagingAreaScope NextPagingAreaScope) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNextPagingAreaScope.Known(nextPagingAreaScope) +} + +func (ngENB *NgENB) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsNgENB, ngENB, ngENB.iEExtensions) + w.WriteBit(ngENB.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := ngENB.GlobalNgENBID.MarshalPER(w, enc); err != nil { + return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if lTENTNTAIInformation.extensions.Present() { - if err := lTENTNTAIInformation.extensions.MarshalPER(w, enc); err != nil { + if ngENB.extensions.Present() { + if err := ngENB.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (lTENTNTAIInformation *LTENTNTAIInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *lTENTNTAIInformation = LTENTNTAIInformation{} +func (ngENB *NgENB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *ngENB = NgENB{} extBit, err := r.ReadBit() if err != nil { return err } - p_UELocationDerivedTAC, err := r.ReadBit() - if err != nil { - return err - } p_iEExtensions, err := r.ReadBit() if err != nil { return err } - if err := (&lTENTNTAIInformation.ServingPLMN).UnmarshalPER(r, enc); err != nil { - return err - } - lTENTNTAIInformation.TACListInLTENTN = nil - if err := per.DecodeLength(r, enc, 1, 12, true, func(count int64) error { - start := len(lTENTNTAIInformation.TACListInLTENTN) - lTENTNTAIInformation.TACListInLTENTN = append(lTENTNTAIInformation.TACListInLTENTN, make([]TAC, count)...) - for i := int64(0); i < count; i++ { - if err := (&lTENTNTAIInformation.TACListInLTENTN[start+int(i)]).UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil - }); err != nil { + if err := (&ngENB.GlobalNgENBID).UnmarshalPER(r, enc); err != nil { return err } - if p_UELocationDerivedTAC { - var v TAC - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - lTENTNTAIInformation.UELocationDerivedTAC = &v - } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLTENTNTAIInformation, lTENTNTAIInformation, &lTENTNTAIInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsNgENB, ngENB, &ngENB.iEExtensions); err != nil { return err } } if extBit { - if err := lTENTNTAIInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := ngENB.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsLTENTNTAIInformation []ap.IESpec[ProtocolIEID, LTENTNTAIInformation] +var extIEsNgENB []apimpl.IESpec[ProtocolIEID, NgENB] -func (lTENTNTAIInformation *LTENTNTAIInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (ngENB *NgENB) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsLTENTNTAIInformation, lTENTNTAIInformation, lTENTNTAIInformation.iEExtensions) + if ngENB.GlobalNgENBID.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsNgENB, ngENB, &ngENB.iEExtensions) return notComprehended } -func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { +func (notifySourceeNB NotifySourceeNB) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumNotifySourceeNB.Encode(w, enc, notifySourceeNB) +} + +func (notifySourceeNB *NotifySourceeNB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumNotifySourceeNB.Decode(r, enc) + if err != nil { + return err + } + *notifySourceeNB = v + return nil +} + +func (notifySourceeNB NotifySourceeNB) Name() string { + return enumNotifySourceeNB.Name(notifySourceeNB) +} + +func (notifySourceeNB NotifySourceeNB) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumNotifySourceeNB.Known(notifySourceeNB) +} + +func (overloadAction OverloadAction) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumOverloadAction.Encode(w, enc, overloadAction) +} + +func (overloadAction *OverloadAction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumOverloadAction.Decode(r, enc) + if err != nil { + return err + } + *overloadAction = v + return nil +} + +func (overloadAction OverloadAction) Name() string { + return enumOverloadAction.Name(overloadAction) +} + +func (overloadAction OverloadAction) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumOverloadAction.Known(overloadAction) +} + +func (overloadResponse *OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { set := 0 - for _, ok := range [...]bool{lastVisitedCellItem.EUTRANCell != nil, lastVisitedCellItem.UTRANCell != nil, lastVisitedCellItem.GERANCell != nil, lastVisitedCellItem.NGRANCell != nil, lastVisitedCellItem.Ext != nil} { + for _, ok := range [...]bool{overloadResponse.OverloadAction != nil, overloadResponse.Ext != nil} { if ok { set++ } @@ -5413,47 +8784,22 @@ func (lastVisitedCellItem *LastVisitedCellItem) MarshalPER(w *per.Writer, enc pe return per.ErrChoice } switch { - case lastVisitedCellItem.EUTRANCell != nil: - w.WriteBit(false) - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 0); err != nil { - return err - } - if err := (*lastVisitedCellItem.EUTRANCell).MarshalPER(w, enc); err != nil { - return err - } - case lastVisitedCellItem.UTRANCell != nil: - w.WriteBit(false) - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 1); err != nil { - return err - } - if err := (*lastVisitedCellItem.UTRANCell).MarshalPER(w, enc); err != nil { - return err - } - case lastVisitedCellItem.GERANCell != nil: + case overloadResponse.OverloadAction != nil: w.WriteBit(false) - if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 2, 2); err != nil { - return err - } - if err := (*lastVisitedCellItem.GERANCell).MarshalPER(w, enc); err != nil { - return err - } - case lastVisitedCellItem.NGRANCell != nil: - w.WriteBit(true) - if err := per.EncodeNormallySmall(w, enc, 0); err != nil { + if err := (*overloadResponse.OverloadAction).MarshalPER(w, enc); err != nil { return err } - return per.EncodeOpenType(w, enc, lastVisitedCellItem.NGRANCell) - case lastVisitedCellItem.Ext != nil: + case overloadResponse.Ext != nil: w.WriteBit(true) - return lastVisitedCellItem.Ext.MarshalPER(w, enc) + return overloadResponse.Ext.MarshalPER(w, enc) default: return per.ErrEmpty } return nil } -func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *lastVisitedCellItem = LastVisitedCellItem{} +func (overloadResponse *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *overloadResponse = OverloadResponse{} isExt, err := r.ReadBit() if err != nil { return err @@ -5463,287 +8809,220 @@ func (lastVisitedCellItem *LastVisitedCellItem) UnmarshalPER(r *per.Reader, enc if err != nil { return err } - switch extIdx { - case 0: - var v LastVisitedNGRANCellInformation - if err := per.DecodeOpenType(r, enc, &v); err != nil { - return err - } - lastVisitedCellItem.NGRANCell = &v - default: - lastVisitedCellItem.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) - return err - } - return nil - } - idx, err := per.DecodeConstrainedWholeNumber(r, enc, 0, 2) - if err != nil { + overloadResponse.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) return err } + var idx int64 = 0 switch idx { case 0: - var v LastVisitedEUTRANCellInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - lastVisitedCellItem.EUTRANCell = &v - case 1: - var v LastVisitedUTRANCellInformation - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - lastVisitedCellItem.UTRANCell = &v - case 2: - var v LastVisitedGERANCellInformation + var v OverloadAction if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - lastVisitedCellItem.GERANCell = &v + overloadResponse.OverloadAction = &v default: return per.ErrOverflow } return nil } -func (lastVisitedCellItem *LastVisitedCellItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (overloadResponse *OverloadResponse) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { - case lastVisitedCellItem.EUTRANCell != nil: - return lastVisitedCellItem.EUTRANCell.Diagnose(d) - case lastVisitedCellItem.UTRANCell != nil: - case lastVisitedCellItem.GERANCell != nil: - return lastVisitedCellItem.GERANCell.Diagnose(d) - case lastVisitedCellItem.NGRANCell != nil: - case lastVisitedCellItem.Ext != nil: + case overloadResponse.OverloadAction != nil: + return overloadResponse.OverloadAction.Diagnose(d) + case overloadResponse.Ext != nil: return true } return false } -func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation.iEExtensions) - w.WriteBit(lastVisitedEUTRANCellInformation.extensions.Present()) +func (pC5FlowBitRates *PC5FlowBitRates) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsPC5FlowBitRates, pC5FlowBitRates, pC5FlowBitRates.iEExtensions) + w.WriteBit(pC5FlowBitRates.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := lastVisitedEUTRANCellInformation.GlobalCellID.MarshalPER(w, enc); err != nil { - return err - } - if err := lastVisitedEUTRANCellInformation.CellType.MarshalPER(w, enc); err != nil { + if err := pC5FlowBitRates.GuaranteedFlowBitRate.MarshalPER(w, enc); err != nil { return err } - if err := lastVisitedEUTRANCellInformation.TimeUEStayedInCell.MarshalPER(w, enc); err != nil { + if err := pC5FlowBitRates.MaximumFlowBitRate.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if lastVisitedEUTRANCellInformation.extensions.Present() { - if err := lastVisitedEUTRANCellInformation.extensions.MarshalPER(w, enc); err != nil { + if pC5FlowBitRates.extensions.Present() { + if err := pC5FlowBitRates.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *lastVisitedEUTRANCellInformation = LastVisitedEUTRANCellInformation{} +func (pC5FlowBitRates *PC5FlowBitRates) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pC5FlowBitRates = PC5FlowBitRates{} extBit, err := r.ReadBit() if err != nil { return err } p_iEExtensions, err := r.ReadBit() if err != nil { - return err - } - if err := (&lastVisitedEUTRANCellInformation.GlobalCellID).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&lastVisitedEUTRANCellInformation.CellType).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&lastVisitedEUTRANCellInformation.TimeUEStayedInCell).UnmarshalPER(r, enc); err != nil { - return err - } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, &lastVisitedEUTRANCellInformation.iEExtensions); err != nil { - return err - } - } - if extBit { - if err := lastVisitedEUTRANCellInformation.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } - return nil -} - -var extIEsLastVisitedEUTRANCellInformation = []ap.IESpec[ProtocolIEID, LastVisitedEUTRANCellInformation]{ - { - ID: IDTimeUEStayedInCellEnhancedGranularity, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { - var v TimeUEStayedInCellEnhancedGranularity - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.TimeUEStayedInCellEnhancedGranularity = &v - return nil - }, - Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { - if x.TimeUEStayedInCellEnhancedGranularity == nil { - return nil, false - } - return x.TimeUEStayedInCellEnhancedGranularity, true - }, - }, - { - ID: IDHOCause, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { - var v Cause - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.HOCause = &v - return nil - }, - Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { - if x.HOCause == nil { - return nil, false - } - return x.HOCause, true - }, - }, - { - ID: IDLastVisitedPSCellList, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, - Decode: func(x *LastVisitedEUTRANCellInformation, r *per.Reader, enc per.Encoding) error { - var v LastVisitedPSCellList - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - x.LastVisitedPSCellList = v - return nil - }, - Encode: func(x *LastVisitedEUTRANCellInformation) (per.Marshaler, bool) { - if len(x.LastVisitedPSCellList) == 0 { - return nil, false - } - return x.LastVisitedPSCellList, true - }, - }, + return err + } + if err := (&pC5FlowBitRates.GuaranteedFlowBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pC5FlowBitRates.MaximumFlowBitRate).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPC5FlowBitRates, pC5FlowBitRates, &pC5FlowBitRates.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pC5FlowBitRates.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil } -func (lastVisitedEUTRANCellInformation *LastVisitedEUTRANCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +var extIEsPC5FlowBitRates []apimpl.IESpec[ProtocolIEID, PC5FlowBitRates] + +func (pC5FlowBitRates *PC5FlowBitRates) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if lastVisitedEUTRANCellInformation.GlobalCellID.Diagnose(d) { - notComprehended = true - } - if lastVisitedEUTRANCellInformation.CellType.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsLastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation, lastVisitedEUTRANCellInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPC5FlowBitRates, pC5FlowBitRates, &pC5FlowBitRates.iEExtensions) return notComprehended } -func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - set := 0 - for _, ok := range [...]bool{lastVisitedGERANCellInformation.Undefined != nil, lastVisitedGERANCellInformation.Ext != nil} { - if ok { - set++ +func (pC5QoSFlowItem *PC5QoSFlowItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsPC5QoSFlowItem, pC5QoSFlowItem, pC5QoSFlowItem.iEExtensions) + w.WriteBit(pC5QoSFlowItem.extensions.Present()) + w.WriteBit(pC5QoSFlowItem.Pc5FlowBitRates != nil) + w.WriteBit(pC5QoSFlowItem.Range != nil) + w.WriteBit(len(ext) > 0) + if err := pC5QoSFlowItem.PQI.MarshalPER(w, enc); err != nil { + return err + } + if pC5QoSFlowItem.Pc5FlowBitRates != nil { + if err := (*pC5QoSFlowItem.Pc5FlowBitRates).MarshalPER(w, enc); err != nil { + return err } } - if set > 1 { - return per.ErrChoice + if pC5QoSFlowItem.Range != nil { + if err := (*pC5QoSFlowItem.Range).MarshalPER(w, enc); err != nil { + return err + } } - switch { - case lastVisitedGERANCellInformation.Undefined != nil: - w.WriteBit(false) - if err := (*lastVisitedGERANCellInformation.Undefined).MarshalPER(w, enc); err != nil { + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if pC5QoSFlowItem.extensions.Present() { + if err := pC5QoSFlowItem.extensions.MarshalPER(w, enc); err != nil { return err } - case lastVisitedGERANCellInformation.Ext != nil: - w.WriteBit(true) - return lastVisitedGERANCellInformation.Ext.MarshalPER(w, enc) - default: - return per.ErrEmpty } return nil } -func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *lastVisitedGERANCellInformation = LastVisitedGERANCellInformation{} - isExt, err := r.ReadBit() +func (pC5QoSFlowItem *PC5QoSFlowItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pC5QoSFlowItem = PC5QoSFlowItem{} + extBit, err := r.ReadBit() if err != nil { return err } - if isExt { - extIdx, err := per.DecodeNormallySmall(r, enc) - if err != nil { + p_Pc5FlowBitRates, err := r.ReadBit() + if err != nil { + return err + } + p_Range, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&pC5QoSFlowItem.PQI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_Pc5FlowBitRates { + var v PC5FlowBitRates + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - lastVisitedGERANCellInformation.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) - return err + pC5QoSFlowItem.Pc5FlowBitRates = &v } - var idx int64 = 0 - switch idx { - case 0: - var v per.Null + if p_Range { + var v RangeType if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - lastVisitedGERANCellInformation.Undefined = &v - default: - return per.ErrOverflow + pC5QoSFlowItem.Range = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSFlowItem, pC5QoSFlowItem, &pC5QoSFlowItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pC5QoSFlowItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } } return nil } -func (lastVisitedGERANCellInformation *LastVisitedGERANCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - switch { - case lastVisitedGERANCellInformation.Undefined != nil: - case lastVisitedGERANCellInformation.Ext != nil: - return true +var extIEsPC5QoSFlowItem []apimpl.IESpec[ProtocolIEID, PC5QoSFlowItem] + +func (pC5QoSFlowItem *PC5QoSFlowItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pC5QoSFlowItem.Pc5FlowBitRates != nil && pC5QoSFlowItem.Pc5FlowBitRates.Diagnose(d) { + notComprehended = true } - return false + if pC5QoSFlowItem.Range != nil && pC5QoSFlowItem.Range.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsPC5QoSFlowItem, pC5QoSFlowItem, &pC5QoSFlowItem.iEExtensions) + return notComprehended } -func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) - w.WriteBit(lastVisitedPSCellInformation.extensions.Present()) - w.WriteBit(lastVisitedPSCellInformation.PSCellID != nil) +func (pC5QoSParameters *PC5QoSParameters) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsPC5QoSParameters, pC5QoSParameters, pC5QoSParameters.iEExtensions) + w.WriteBit(pC5QoSParameters.extensions.Present()) + w.WriteBit(pC5QoSParameters.Pc5LinkAggregatedBitRates != nil) w.WriteBit(len(ext) > 0) - if lastVisitedPSCellInformation.PSCellID != nil { - if err := (*lastVisitedPSCellInformation.PSCellID).MarshalPER(w, enc); err != nil { + if err := pC5QoSParameters.Pc5QoSFlowList.MarshalPER(w, enc); err != nil { + return err + } + if pC5QoSParameters.Pc5LinkAggregatedBitRates != nil { + if err := (*pC5QoSParameters.Pc5LinkAggregatedBitRates).MarshalPER(w, enc); err != nil { return err } } - if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}, int64(lastVisitedPSCellInformation.TimeStay)); err != nil { - return err - } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if lastVisitedPSCellInformation.extensions.Present() { - if err := lastVisitedPSCellInformation.extensions.MarshalPER(w, enc); err != nil { + if pC5QoSParameters.extensions.Present() { + if err := pC5QoSParameters.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *lastVisitedPSCellInformation = LastVisitedPSCellInformation{} +func (pC5QoSParameters *PC5QoSParameters) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pC5QoSParameters = PC5QoSParameters{} extBit, err := r.ReadBit() if err != nil { return err } - p_PSCellID, err := r.ReadBit() + p_Pc5LinkAggregatedBitRates, err := r.ReadBit() if err != nil { return err } @@ -5751,67 +9030,62 @@ func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) UnmarshalPER(r if err != nil { return err } - if p_PSCellID { - var v PSCellInformation + if err := (&pC5QoSParameters.Pc5QoSFlowList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_Pc5LinkAggregatedBitRates { + var v BitRate if err := (&v).UnmarshalPER(r, enc); err != nil { return err } - lastVisitedPSCellInformation.PSCellID = &v - } - n1, err := per.DecodeInteger(r, enc, per.Bounds{LB: 0, HasLB: true, UB: 40950, HasUB: true}) - if err != nil { - return err + pC5QoSParameters.Pc5LinkAggregatedBitRates = &v } - lastVisitedPSCellInformation.TimeStay = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, &lastVisitedPSCellInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPC5QoSParameters, pC5QoSParameters, &pC5QoSParameters.iEExtensions); err != nil { return err } } if extBit { - if err := lastVisitedPSCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + if err := pC5QoSParameters.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsLastVisitedPSCellInformation []ap.IESpec[ProtocolIEID, LastVisitedPSCellInformation] +var extIEsPC5QoSParameters []apimpl.IESpec[ProtocolIEID, PC5QoSParameters] -func (lastVisitedPSCellInformation *LastVisitedPSCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pC5QoSParameters *PC5QoSParameters) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if lastVisitedPSCellInformation.PSCellID != nil && lastVisitedPSCellInformation.PSCellID.Diagnose(d) { + if pC5QoSParameters.Pc5QoSFlowList.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsLastVisitedPSCellInformation, lastVisitedPSCellInformation, lastVisitedPSCellInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPC5QoSParameters, pC5QoSParameters, &pC5QoSParameters.iEExtensions) return notComprehended } -func (listeningSubframePattern *ListeningSubframePattern) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsListeningSubframePattern, listeningSubframePattern, listeningSubframePattern.iEExtensions) - w.WriteBit(listeningSubframePattern.extensions.Present()) +func (pSCellInformation *PSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsPSCellInformation, pSCellInformation, pSCellInformation.iEExtensions) + w.WriteBit(pSCellInformation.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := listeningSubframePattern.PatternPeriod.MarshalPER(w, enc); err != nil { - return err - } - if err := listeningSubframePattern.PatternOffset.MarshalPER(w, enc); err != nil { + if err := pSCellInformation.NCGI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if listeningSubframePattern.extensions.Present() { - if err := listeningSubframePattern.extensions.MarshalPER(w, enc); err != nil { + if pSCellInformation.extensions.Present() { + if err := pSCellInformation.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (listeningSubframePattern *ListeningSubframePattern) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *listeningSubframePattern = ListeningSubframePattern{} +func (pSCellInformation *PSCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pSCellInformation = PSCellInformation{} extBit, err := r.ReadBit() if err != nil { return err @@ -5820,93 +9094,90 @@ func (listeningSubframePattern *ListeningSubframePattern) UnmarshalPER(r *per.Re if err != nil { return err } - if err := (&listeningSubframePattern.PatternPeriod).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&listeningSubframePattern.PatternOffset).UnmarshalPER(r, enc); err != nil { + if err := (&pSCellInformation.NCGI).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsListeningSubframePattern, listeningSubframePattern, &listeningSubframePattern.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPSCellInformation, pSCellInformation, &pSCellInformation.iEExtensions); err != nil { return err } } if extBit { - if err := listeningSubframePattern.extensions.UnmarshalPER(r, enc); err != nil { + if err := pSCellInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsListeningSubframePattern []ap.IESpec[ProtocolIEID, ListeningSubframePattern] +var extIEsPSCellInformation []apimpl.IESpec[ProtocolIEID, PSCellInformation] -func (listeningSubframePattern *ListeningSubframePattern) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pSCellInformation *PSCellInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if listeningSubframePattern.PatternPeriod.Diagnose(d) { - notComprehended = true - } - if listeningSubframePattern.PatternOffset.Diagnose(d) { + if pSCellInformation.NCGI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsListeningSubframePattern, listeningSubframePattern, listeningSubframePattern.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsPSCellInformation, pSCellInformation, &pSCellInformation.iEExtensions) return notComprehended } -func (mutingAvailabilityIndication MutingAvailabilityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumMutingAvailabilityIndication.Encode(w, enc, mutingAvailabilityIndication) +func (pSServiceNotAvailable PSServiceNotAvailable) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPSServiceNotAvailable.Encode(w, enc, pSServiceNotAvailable) } -func (mutingAvailabilityIndication *MutingAvailabilityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumMutingAvailabilityIndication.Decode(r, enc) +func (pSServiceNotAvailable *PSServiceNotAvailable) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPSServiceNotAvailable.Decode(r, enc) if err != nil { return err } - *mutingAvailabilityIndication = v + *pSServiceNotAvailable = v return nil } -func (mutingAvailabilityIndication MutingAvailabilityIndication) Name() string { - return enumMutingAvailabilityIndication.Name(mutingAvailabilityIndication) +func (pSServiceNotAvailable PSServiceNotAvailable) Name() string { + return enumPSServiceNotAvailable.Name(pSServiceNotAvailable) } -func (mutingAvailabilityIndication MutingAvailabilityIndication) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumMutingAvailabilityIndication.Known(mutingAvailabilityIndication) +func (pSServiceNotAvailable PSServiceNotAvailable) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPSServiceNotAvailable.Known(pSServiceNotAvailable) } -func (mutingPatternInformation *MutingPatternInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsMutingPatternInformation, mutingPatternInformation, mutingPatternInformation.iEExtensions) - w.WriteBit(mutingPatternInformation.extensions.Present()) - w.WriteBit(mutingPatternInformation.MutingPatternOffset != nil) +func (pagingAttemptInformation *PagingAttemptInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsPagingAttemptInformation, pagingAttemptInformation, pagingAttemptInformation.iEExtensions) + w.WriteBit(pagingAttemptInformation.extensions.Present()) + w.WriteBit(pagingAttemptInformation.NextPagingAreaScope != nil) w.WriteBit(len(ext) > 0) - if err := mutingPatternInformation.MutingPatternPeriod.MarshalPER(w, enc); err != nil { + if err := pagingAttemptInformation.PagingAttemptCount.MarshalPER(w, enc); err != nil { return err } - if mutingPatternInformation.MutingPatternOffset != nil { - if err := (*mutingPatternInformation.MutingPatternOffset).MarshalPER(w, enc); err != nil { + if err := pagingAttemptInformation.IntendedNumberOfPagingAttempts.MarshalPER(w, enc); err != nil { + return err + } + if pagingAttemptInformation.NextPagingAreaScope != nil { + if err := (*pagingAttemptInformation.NextPagingAreaScope).MarshalPER(w, enc); err != nil { return err } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if mutingPatternInformation.extensions.Present() { - if err := mutingPatternInformation.extensions.MarshalPER(w, enc); err != nil { + if pagingAttemptInformation.extensions.Present() { + if err := pagingAttemptInformation.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (mutingPatternInformation *MutingPatternInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *mutingPatternInformation = MutingPatternInformation{} +func (pagingAttemptInformation *PagingAttemptInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pagingAttemptInformation = PagingAttemptInformation{} extBit, err := r.ReadBit() if err != nil { return err } - p_MutingPatternOffset, err := r.ReadBit() + p_NextPagingAreaScope, err := r.ReadBit() if err != nil { return err } @@ -5914,463 +9185,519 @@ func (mutingPatternInformation *MutingPatternInformation) UnmarshalPER(r *per.Re if err != nil { return err } - if err := (&mutingPatternInformation.MutingPatternPeriod).UnmarshalPER(r, enc); err != nil { + if err := (&pagingAttemptInformation.PagingAttemptCount).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&pagingAttemptInformation.IntendedNumberOfPagingAttempts).UnmarshalPER(r, enc); err != nil { + return err + } + if p_NextPagingAreaScope { + var v NextPagingAreaScope + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pagingAttemptInformation.NextPagingAreaScope = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPagingAttemptInformation, pagingAttemptInformation, &pagingAttemptInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := pagingAttemptInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsPagingAttemptInformation []apimpl.IESpec[ProtocolIEID, PagingAttemptInformation] + +func (pagingAttemptInformation *PagingAttemptInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if pagingAttemptInformation.NextPagingAreaScope != nil && pagingAttemptInformation.NextPagingAreaScope.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsPagingAttemptInformation, pagingAttemptInformation, &pagingAttemptInformation.iEExtensions) + return notComprehended +} + +func (pagingCause PagingCause) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingCause.Encode(w, enc, pagingCause) +} + +func (pagingCause *PagingCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingCause.Decode(r, enc) + if err != nil { + return err + } + *pagingCause = v + return nil +} + +func (pagingCause PagingCause) Name() string { + return enumPagingCause.Name(pagingCause) +} + +func (pagingCause PagingCause) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPagingCause.Known(pagingCause) +} + +func (pagingDRX PagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingDRX.Encode(w, enc, pagingDRX) +} + +func (pagingDRX *PagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingDRX.Decode(r, enc) + if err != nil { + return err + } + *pagingDRX = v + return nil +} + +func (pagingDRX PagingDRX) Name() string { + return enumPagingDRX.Name(pagingDRX) +} + +func (pagingDRX PagingDRX) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPagingDRX.Known(pagingDRX) +} + +func (pagingPriority PagingPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingPriority.Encode(w, enc, pagingPriority) +} + +func (pagingPriority *PagingPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingPriority.Decode(r, enc) + if err != nil { + return err + } + *pagingPriority = v + return nil +} + +func (pagingPriority PagingPriority) Name() string { + return enumPagingPriority.Name(pagingPriority) +} + +func (pagingPriority PagingPriority) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPagingPriority.Known(pagingPriority) +} + +func (pagingProbabilityInformation PagingProbabilityInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingProbabilityInformation.Encode(w, enc, pagingProbabilityInformation) +} + +func (pagingProbabilityInformation *PagingProbabilityInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingProbabilityInformation.Decode(r, enc) + if err != nil { + return err + } + *pagingProbabilityInformation = v + return nil +} + +func (pagingProbabilityInformation PagingProbabilityInformation) Name() string { + return enumPagingProbabilityInformation.Name(pagingProbabilityInformation) +} + +func (pagingProbabilityInformation PagingProbabilityInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPagingProbabilityInformation.Known(pagingProbabilityInformation) +} + +func (pagingTimeWindow PagingTimeWindow) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingTimeWindow.Encode(w, enc, pagingTimeWindow) +} + +func (pagingTimeWindow *PagingTimeWindow) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingTimeWindow.Decode(r, enc) + if err != nil { return err } - if p_MutingPatternOffset { - var v PatternOffset - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - mutingPatternInformation.MutingPatternOffset = &v - } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsMutingPatternInformation, mutingPatternInformation, &mutingPatternInformation.iEExtensions); err != nil { - return err - } - } - if extBit { - if err := mutingPatternInformation.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } + *pagingTimeWindow = v return nil } -var extIEsMutingPatternInformation []ap.IESpec[ProtocolIEID, MutingPatternInformation] +func (pagingTimeWindow PagingTimeWindow) Name() string { + return enumPagingTimeWindow.Name(pagingTimeWindow) +} -func (mutingPatternInformation *MutingPatternInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - if mutingPatternInformation.MutingPatternPeriod.Diagnose(d) { - notComprehended = true - } - if mutingPatternInformation.MutingPatternOffset != nil && mutingPatternInformation.MutingPatternOffset.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsMutingPatternInformation, mutingPatternInformation, mutingPatternInformation.iEExtensions) - return notComprehended +func (pagingTimeWindow PagingTimeWindow) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPagingTimeWindow.Known(pagingTimeWindow) } -func (mutingPatternPeriod MutingPatternPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumMutingPatternPeriod.Encode(w, enc, mutingPatternPeriod) +func (pagingeDRXCycle PagingeDRXCycle) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPagingeDRXCycle.Encode(w, enc, pagingeDRXCycle) } -func (mutingPatternPeriod *MutingPatternPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumMutingPatternPeriod.Decode(r, enc) +func (pagingeDRXCycle *PagingeDRXCycle) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPagingeDRXCycle.Decode(r, enc) if err != nil { return err } - *mutingPatternPeriod = v + *pagingeDRXCycle = v return nil } -func (mutingPatternPeriod MutingPatternPeriod) Name() string { - return enumMutingPatternPeriod.Name(mutingPatternPeriod) +func (pagingeDRXCycle PagingeDRXCycle) Name() string { + return enumPagingeDRXCycle.Name(pagingeDRXCycle) } -func (mutingPatternPeriod MutingPatternPeriod) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumMutingPatternPeriod.Known(mutingPatternPeriod) +func (pagingeDRXCycle PagingeDRXCycle) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPagingeDRXCycle.Known(pagingeDRXCycle) } -func (nRCGI *NRCGI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNRCGI, nRCGI, nRCGI.iEExtensions) - w.WriteBit(nRCGI.extensions.Present()) +func (pagingeDRXInformation *PagingeDRXInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsPagingeDRXInformation, pagingeDRXInformation, pagingeDRXInformation.iEExtensions) + w.WriteBit(pagingeDRXInformation.extensions.Present()) + w.WriteBit(pagingeDRXInformation.PagingTimeWindow != nil) w.WriteBit(len(ext) > 0) - if err := nRCGI.PLMNIdentity.MarshalPER(w, enc); err != nil { + if err := pagingeDRXInformation.PagingeDRXCycle.MarshalPER(w, enc); err != nil { return err } - if err := nRCGI.NRCellIdentity.MarshalPER(w, enc); err != nil { - return err + if pagingeDRXInformation.PagingTimeWindow != nil { + if err := (*pagingeDRXInformation.PagingTimeWindow).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if nRCGI.extensions.Present() { - if err := nRCGI.extensions.MarshalPER(w, enc); err != nil { + if pagingeDRXInformation.extensions.Present() { + if err := pagingeDRXInformation.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (nRCGI *NRCGI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *nRCGI = NRCGI{} +func (pagingeDRXInformation *PagingeDRXInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *pagingeDRXInformation = PagingeDRXInformation{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_PagingTimeWindow, err := r.ReadBit() if err != nil { return err } - if err := (&nRCGI.PLMNIdentity).UnmarshalPER(r, enc); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { return err } - if err := (&nRCGI.NRCellIdentity).UnmarshalPER(r, enc); err != nil { + if err := (&pagingeDRXInformation.PagingeDRXCycle).UnmarshalPER(r, enc); err != nil { return err } + if p_PagingTimeWindow { + var v PagingTimeWindow + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + pagingeDRXInformation.PagingTimeWindow = &v + } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNRCGI, nRCGI, &nRCGI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsPagingeDRXInformation, pagingeDRXInformation, &pagingeDRXInformation.iEExtensions); err != nil { return err } } if extBit { - if err := nRCGI.extensions.UnmarshalPER(r, enc); err != nil { + if err := pagingeDRXInformation.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsNRCGI []ap.IESpec[ProtocolIEID, NRCGI] +var extIEsPagingeDRXInformation []apimpl.IESpec[ProtocolIEID, PagingeDRXInformation] -func (nRCGI *NRCGI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pagingeDRXInformation *PagingeDRXInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsNRCGI, nRCGI, nRCGI.iEExtensions) + if pagingeDRXInformation.PagingeDRXCycle.Diagnose(d) { + notComprehended = true + } + if pagingeDRXInformation.PagingTimeWindow != nil && pagingeDRXInformation.PagingTimeWindow.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsPagingeDRXInformation, pagingeDRXInformation, &pagingeDRXInformation.iEExtensions) return notComprehended } -func (nRrestrictionin5GS NRrestrictionin5GS) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumNRrestrictionin5GS.Encode(w, enc, nRrestrictionin5GS) +func (patternPeriod PatternPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPatternPeriod.Encode(w, enc, patternPeriod) } -func (nRrestrictionin5GS *NRrestrictionin5GS) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumNRrestrictionin5GS.Decode(r, enc) +func (patternPeriod *PatternPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPatternPeriod.Decode(r, enc) if err != nil { return err } - *nRrestrictionin5GS = v + *patternPeriod = v return nil } -func (nRrestrictionin5GS NRrestrictionin5GS) Name() string { - return enumNRrestrictionin5GS.Name(nRrestrictionin5GS) +func (patternPeriod PatternPeriod) Name() string { + return enumPatternPeriod.Name(patternPeriod) } -func (nRrestrictionin5GS NRrestrictionin5GS) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumNRrestrictionin5GS.Known(nRrestrictionin5GS) +func (patternPeriod PatternPeriod) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPatternPeriod.Known(patternPeriod) } -func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumNRrestrictioninEPSasSecondaryRAT.Encode(w, enc, nRrestrictioninEPSasSecondaryRAT) +func (pedestrianUE PedestrianUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPedestrianUE.Encode(w, enc, pedestrianUE) } -func (nRrestrictioninEPSasSecondaryRAT *NRrestrictioninEPSasSecondaryRAT) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumNRrestrictioninEPSasSecondaryRAT.Decode(r, enc) +func (pedestrianUE *PedestrianUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPedestrianUE.Decode(r, enc) if err != nil { return err } - *nRrestrictioninEPSasSecondaryRAT = v + *pedestrianUE = v return nil } -func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) Name() string { - return enumNRrestrictioninEPSasSecondaryRAT.Name(nRrestrictioninEPSasSecondaryRAT) +func (pedestrianUE PedestrianUE) Name() string { + return enumPedestrianUE.Name(pedestrianUE) } -func (nRrestrictioninEPSasSecondaryRAT NRrestrictioninEPSasSecondaryRAT) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumNRrestrictioninEPSasSecondaryRAT.Known(nRrestrictioninEPSasSecondaryRAT) +func (pedestrianUE PedestrianUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPedestrianUE.Known(pedestrianUE) } -func (ngENB *NgENB) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsNgENB, ngENB, ngENB.iEExtensions) - w.WriteBit(ngENB.extensions.Present()) - w.WriteBit(len(ext) > 0) - if err := ngENB.GlobalNgENBID.MarshalPER(w, enc); err != nil { - return err - } - if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { - return err - } - } - if ngENB.extensions.Present() { - if err := ngENB.extensions.MarshalPER(w, enc); err != nil { - return err - } - } - return nil +func (pendingDataIndication PendingDataIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPendingDataIndication.Encode(w, enc, pendingDataIndication) } -func (ngENB *NgENB) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *ngENB = NgENB{} - extBit, err := r.ReadBit() +func (pendingDataIndication *PendingDataIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPendingDataIndication.Decode(r, enc) if err != nil { return err } - p_iEExtensions, err := r.ReadBit() - if err != nil { - return err - } - if err := (&ngENB.GlobalNgENBID).UnmarshalPER(r, enc); err != nil { - return err - } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsNgENB, ngENB, &ngENB.iEExtensions); err != nil { - return err - } - } - if extBit { - if err := ngENB.extensions.UnmarshalPER(r, enc); err != nil { - return err - } - } + *pendingDataIndication = v return nil } -var extIEsNgENB []ap.IESpec[ProtocolIEID, NgENB] +func (pendingDataIndication PendingDataIndication) Name() string { + return enumPendingDataIndication.Name(pendingDataIndication) +} -func (ngENB *NgENB) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - if ngENB.GlobalNgENBID.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsNgENB, ngENB, ngENB.iEExtensions) - return notComprehended +func (pendingDataIndication PendingDataIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumPendingDataIndication.Known(pendingDataIndication) } -func (overloadAction OverloadAction) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumOverloadAction.Encode(w, enc, overloadAction) +func (preemptionCapability PreemptionCapability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPreemptionCapability.Encode(w, enc, preemptionCapability) } -func (overloadAction *OverloadAction) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumOverloadAction.Decode(r, enc) +func (preemptionCapability *PreemptionCapability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPreemptionCapability.Decode(r, enc) if err != nil { return err } - *overloadAction = v + *preemptionCapability = v return nil } -func (overloadAction OverloadAction) Name() string { - return enumOverloadAction.Name(overloadAction) -} - -func (overloadAction OverloadAction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumOverloadAction.Known(overloadAction) +func (preemptionCapability PreemptionCapability) Name() string { + return enumPreemptionCapability.Name(preemptionCapability) } -func (overloadResponse *OverloadResponse) MarshalPER(w *per.Writer, enc per.Encoding) error { - set := 0 - for _, ok := range [...]bool{overloadResponse.OverloadAction != nil, overloadResponse.Ext != nil} { - if ok { - set++ - } - } - if set > 1 { - return per.ErrChoice - } - switch { - case overloadResponse.OverloadAction != nil: - w.WriteBit(false) - if err := (*overloadResponse.OverloadAction).MarshalPER(w, enc); err != nil { - return err - } - case overloadResponse.Ext != nil: - w.WriteBit(true) - return overloadResponse.Ext.MarshalPER(w, enc) - default: - return per.ErrEmpty - } - return nil +func (preemptionVulnerability PreemptionVulnerability) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumPreemptionVulnerability.Encode(w, enc, preemptionVulnerability) } -func (overloadResponse *OverloadResponse) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *overloadResponse = OverloadResponse{} - isExt, err := r.ReadBit() +func (preemptionVulnerability *PreemptionVulnerability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumPreemptionVulnerability.Decode(r, enc) if err != nil { return err } - if isExt { - extIdx, err := per.DecodeNormallySmall(r, enc) - if err != nil { - return err - } - overloadResponse.Ext, err = per.DecodeExtensionAlternative(r, enc, extIdx) - return err - } - var idx int64 = 0 - switch idx { - case 0: - var v OverloadAction - if err := (&v).UnmarshalPER(r, enc); err != nil { - return err - } - overloadResponse.OverloadAction = &v - default: - return per.ErrOverflow - } + *preemptionVulnerability = v return nil } -func (overloadResponse *OverloadResponse) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - switch { - case overloadResponse.OverloadAction != nil: - return overloadResponse.OverloadAction.Diagnose(d) - case overloadResponse.Ext != nil: - return true - } - return false +func (preemptionVulnerability PreemptionVulnerability) Name() string { + return enumPreemptionVulnerability.Name(preemptionVulnerability) } -func (pSCellInformation *PSCellInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsPSCellInformation, pSCellInformation, pSCellInformation.iEExtensions) - w.WriteBit(pSCellInformation.extensions.Present()) +func (proSeAuthorized *ProSeAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsProSeAuthorized, proSeAuthorized, proSeAuthorized.iEExtensions) + w.WriteBit(proSeAuthorized.extensions.Present()) + w.WriteBit(proSeAuthorized.ProSeDirectDiscovery != nil) + w.WriteBit(proSeAuthorized.ProSeDirectCommunication != nil) w.WriteBit(len(ext) > 0) - if err := pSCellInformation.NCGI.MarshalPER(w, enc); err != nil { - return err + if proSeAuthorized.ProSeDirectDiscovery != nil { + if err := (*proSeAuthorized.ProSeDirectDiscovery).MarshalPER(w, enc); err != nil { + return err + } + } + if proSeAuthorized.ProSeDirectCommunication != nil { + if err := (*proSeAuthorized.ProSeDirectCommunication).MarshalPER(w, enc); err != nil { + return err + } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if pSCellInformation.extensions.Present() { - if err := pSCellInformation.extensions.MarshalPER(w, enc); err != nil { + if proSeAuthorized.extensions.Present() { + if err := proSeAuthorized.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (pSCellInformation *PSCellInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *pSCellInformation = PSCellInformation{} +func (proSeAuthorized *ProSeAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *proSeAuthorized = ProSeAuthorized{} extBit, err := r.ReadBit() if err != nil { return err } - p_iEExtensions, err := r.ReadBit() + p_ProSeDirectDiscovery, err := r.ReadBit() if err != nil { return err } - if err := (&pSCellInformation.NCGI).UnmarshalPER(r, enc); err != nil { + p_ProSeDirectCommunication, err := r.ReadBit() + if err != nil { return err } - if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsPSCellInformation, pSCellInformation, &pSCellInformation.iEExtensions); err != nil { + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_ProSeDirectDiscovery { + var v ProSeDirectDiscovery + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + proSeAuthorized.ProSeDirectDiscovery = &v } - if extBit { - if err := pSCellInformation.extensions.UnmarshalPER(r, enc); err != nil { + if p_ProSeDirectCommunication { + var v ProSeDirectCommunication + if err := (&v).UnmarshalPER(r, enc); err != nil { return err } + proSeAuthorized.ProSeDirectCommunication = &v } - return nil -} - -var extIEsPSCellInformation []ap.IESpec[ProtocolIEID, PSCellInformation] - -func (pSCellInformation *PSCellInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - if pSCellInformation.NCGI.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsPSCellInformation, pSCellInformation, pSCellInformation.iEExtensions) - return notComprehended -} - -func (pagingDRX PagingDRX) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumPagingDRX.Encode(w, enc, pagingDRX) -} - -func (pagingDRX *PagingDRX) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumPagingDRX.Decode(r, enc) - if err != nil { - return err + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsProSeAuthorized, proSeAuthorized, &proSeAuthorized.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := proSeAuthorized.extensions.UnmarshalPER(r, enc); err != nil { + return err + } } - *pagingDRX = v return nil } -func (pagingDRX PagingDRX) Name() string { - return enumPagingDRX.Name(pagingDRX) +var extIEsProSeAuthorized = []apimpl.IESpec[ProtocolIEID, ProSeAuthorized]{ + { + ID: IDProSeUEtoNetworkRelaying, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, + Decode: func(x *ProSeAuthorized, r *per.Reader, enc per.Encoding) error { + var v ProSeUEtoNetworkRelaying + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + x.ProSeUEtoNetworkRelaying = &v + return nil + }, + Encode: func(x *ProSeAuthorized) (per.Marshaler, bool) { + if x.ProSeUEtoNetworkRelaying == nil { + return nil, false + } + return x.ProSeUEtoNetworkRelaying, true + }, + Clear: func(x *ProSeAuthorized) { + x.ProSeUEtoNetworkRelaying = nil + }, + }, } -func (pagingDRX PagingDRX) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumPagingDRX.Known(pagingDRX) +func (proSeAuthorized *ProSeAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if proSeAuthorized.ProSeDirectDiscovery != nil && proSeAuthorized.ProSeDirectDiscovery.Diagnose(d) { + notComprehended = true + } + if proSeAuthorized.ProSeDirectCommunication != nil && proSeAuthorized.ProSeDirectCommunication.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsProSeAuthorized, proSeAuthorized, &proSeAuthorized.iEExtensions) + return notComprehended } -func (pagingPriority PagingPriority) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumPagingPriority.Encode(w, enc, pagingPriority) +func (proSeDirectCommunication ProSeDirectCommunication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumProSeDirectCommunication.Encode(w, enc, proSeDirectCommunication) } -func (pagingPriority *PagingPriority) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumPagingPriority.Decode(r, enc) +func (proSeDirectCommunication *ProSeDirectCommunication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumProSeDirectCommunication.Decode(r, enc) if err != nil { return err } - *pagingPriority = v + *proSeDirectCommunication = v return nil } -func (pagingPriority PagingPriority) Name() string { - return enumPagingPriority.Name(pagingPriority) +func (proSeDirectCommunication ProSeDirectCommunication) Name() string { + return enumProSeDirectCommunication.Name(proSeDirectCommunication) } -func (pagingPriority PagingPriority) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumPagingPriority.Known(pagingPriority) +func (proSeDirectCommunication ProSeDirectCommunication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumProSeDirectCommunication.Known(proSeDirectCommunication) } -func (patternPeriod PatternPeriod) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumPatternPeriod.Encode(w, enc, patternPeriod) +func (proSeDirectDiscovery ProSeDirectDiscovery) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumProSeDirectDiscovery.Encode(w, enc, proSeDirectDiscovery) } -func (patternPeriod *PatternPeriod) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumPatternPeriod.Decode(r, enc) +func (proSeDirectDiscovery *ProSeDirectDiscovery) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumProSeDirectDiscovery.Decode(r, enc) if err != nil { return err } - *patternPeriod = v + *proSeDirectDiscovery = v return nil } -func (patternPeriod PatternPeriod) Name() string { - return enumPatternPeriod.Name(patternPeriod) +func (proSeDirectDiscovery ProSeDirectDiscovery) Name() string { + return enumProSeDirectDiscovery.Name(proSeDirectDiscovery) } -func (patternPeriod PatternPeriod) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumPatternPeriod.Known(patternPeriod) +func (proSeDirectDiscovery ProSeDirectDiscovery) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumProSeDirectDiscovery.Known(proSeDirectDiscovery) } -func (preemptionCapability PreemptionCapability) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumPreemptionCapability.Encode(w, enc, preemptionCapability) +func (proSeUEtoNetworkRelaying ProSeUEtoNetworkRelaying) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumProSeUEtoNetworkRelaying.Encode(w, enc, proSeUEtoNetworkRelaying) } -func (preemptionCapability *PreemptionCapability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumPreemptionCapability.Decode(r, enc) +func (proSeUEtoNetworkRelaying *ProSeUEtoNetworkRelaying) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumProSeUEtoNetworkRelaying.Decode(r, enc) if err != nil { return err } - *preemptionCapability = v + *proSeUEtoNetworkRelaying = v return nil } -func (preemptionCapability PreemptionCapability) Name() string { - return enumPreemptionCapability.Name(preemptionCapability) -} - -func (preemptionVulnerability PreemptionVulnerability) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumPreemptionVulnerability.Encode(w, enc, preemptionVulnerability) -} - -func (preemptionVulnerability *PreemptionVulnerability) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumPreemptionVulnerability.Decode(r, enc) - if err != nil { - return err - } - *preemptionVulnerability = v - return nil +func (proSeUEtoNetworkRelaying ProSeUEtoNetworkRelaying) Name() string { + return enumProSeUEtoNetworkRelaying.Name(proSeUEtoNetworkRelaying) } -func (preemptionVulnerability PreemptionVulnerability) Name() string { - return enumPreemptionVulnerability.Name(preemptionVulnerability) +func (proSeUEtoNetworkRelaying ProSeUEtoNetworkRelaying) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumProSeUEtoNetworkRelaying.Known(proSeUEtoNetworkRelaying) } func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) w.WriteBit(rATRestrictionsItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := rATRestrictionsItem.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -6380,7 +9707,7 @@ func (rATRestrictionsItem *RATRestrictionsItem) MarshalPER(w *per.Writer, enc pe return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6409,7 +9736,7 @@ func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions); err != nil { return err } } @@ -6421,11 +9748,11 @@ func (rATRestrictionsItem *RATRestrictionsItem) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsRATRestrictionsItem []ap.IESpec[ProtocolIEID, RATRestrictionsItem] +var extIEsRATRestrictionsItem []apimpl.IESpec[ProtocolIEID, RATRestrictionsItem] -func (rATRestrictionsItem *RATRestrictionsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rATRestrictionsItem *RATRestrictionsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsRATRestrictionsItem, rATRestrictionsItem, rATRestrictionsItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRATRestrictionsItem, rATRestrictionsItem, &rATRestrictionsItem.iEExtensions) return notComprehended } @@ -6446,12 +9773,12 @@ func (rATType RATType) Name() string { return enumRATType.Name(rATType) } -func (rATType RATType) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (rATType RATType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRATType.Known(rATType) } func (rLFReportInformation *RLFReportInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRLFReportInformation, rLFReportInformation, rLFReportInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRLFReportInformation, rLFReportInformation, rLFReportInformation.iEExtensions) w.WriteBit(rLFReportInformation.extensions.Present()) w.WriteBit(rLFReportInformation.UERLFReportContainerForExtendedBands != nil) w.WriteBit(len(ext) > 0) @@ -6464,7 +9791,7 @@ func (rLFReportInformation *RLFReportInformation) MarshalPER(w *per.Writer, enc } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6501,7 +9828,7 @@ func (rLFReportInformation *RLFReportInformation) UnmarshalPER(r *per.Reader, en rLFReportInformation.UERLFReportContainerForExtendedBands = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRLFReportInformation, rLFReportInformation, &rLFReportInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRLFReportInformation, rLFReportInformation, &rLFReportInformation.iEExtensions); err != nil { return err } } @@ -6513,11 +9840,11 @@ func (rLFReportInformation *RLFReportInformation) UnmarshalPER(r *per.Reader, en return nil } -var extIEsRLFReportInformation = []ap.IESpec[ProtocolIEID, RLFReportInformation]{ +var extIEsRLFReportInformation = []apimpl.IESpec[ProtocolIEID, RLFReportInformation]{ { ID: IDNBIoTRLFReportContainer, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *RLFReportInformation, r *per.Reader, enc per.Encoding) error { var v RLFReportContainer if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -6532,34 +9859,324 @@ var extIEsRLFReportInformation = []ap.IESpec[ProtocolIEID, RLFReportInformation] } return x.NBIoTRLFReportContainer, true }, + Clear: func(x *RLFReportInformation) { + x.NBIoTRLFReportContainer = nil + }, }, } -func (rLFReportInformation *RLFReportInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rLFReportInformation *RLFReportInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsRLFReportInformation, rLFReportInformation, &rLFReportInformation.iEExtensions) + return notComprehended +} + +func (rRCEstablishmentCause RRCEstablishmentCause) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRRCEstablishmentCause.Encode(w, enc, rRCEstablishmentCause) +} + +func (rRCEstablishmentCause *RRCEstablishmentCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRRCEstablishmentCause.Decode(r, enc) + if err != nil { + return err + } + *rRCEstablishmentCause = v + return nil +} + +func (rRCEstablishmentCause RRCEstablishmentCause) Name() string { + return enumRRCEstablishmentCause.Name(rRCEstablishmentCause) +} + +func (rRCEstablishmentCause RRCEstablishmentCause) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumRRCEstablishmentCause.Known(rRCEstablishmentCause) +} + +func (rangeType RangeType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRangeType.Encode(w, enc, rangeType) +} + +func (rangeType *RangeType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRangeType.Decode(r, enc) + if err != nil { + return err + } + *rangeType = v + return nil +} + +func (rangeType RangeType) Name() string { + return enumRangeType.Name(rangeType) +} + +func (rangeType RangeType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumRangeType.Known(rangeType) +} + +func (recommendedCellItem *RecommendedCellItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsRecommendedCellItem, recommendedCellItem, recommendedCellItem.iEExtensions) + w.WriteBit(recommendedCellItem.extensions.Present()) + w.WriteBit(recommendedCellItem.TimeStayedInCell != nil) + w.WriteBit(len(ext) > 0) + if err := recommendedCellItem.EUTRANCGI.MarshalPER(w, enc); err != nil { + return err + } + if recommendedCellItem.TimeStayedInCell != nil { + if err := (*recommendedCellItem.TimeStayedInCell).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedCellItem.extensions.Present() { + if err := recommendedCellItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedCellItem *RecommendedCellItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedCellItem = RecommendedCellItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_TimeStayedInCell, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedCellItem.EUTRANCGI).UnmarshalPER(r, enc); err != nil { + return err + } + if p_TimeStayedInCell { + var v RecommendedCellItemTimeStayedInCell + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + recommendedCellItem.TimeStayedInCell = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellItem, recommendedCellItem, &recommendedCellItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedCellItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedCellItem []apimpl.IESpec[ProtocolIEID, RecommendedCellItem] + +func (recommendedCellItem *RecommendedCellItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if recommendedCellItem.EUTRANCGI.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsRecommendedCellItem, recommendedCellItem, &recommendedCellItem.iEExtensions) + return notComprehended +} + +func (recommendedCellsForPaging *RecommendedCellsForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsRecommendedCellsForPaging, recommendedCellsForPaging, recommendedCellsForPaging.iEExtensions) + w.WriteBit(recommendedCellsForPaging.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := recommendedCellsForPaging.RecommendedCellList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedCellsForPaging.extensions.Present() { + if err := recommendedCellsForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedCellsForPaging *RecommendedCellsForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedCellsForPaging = RecommendedCellsForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedCellsForPaging.RecommendedCellList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, &recommendedCellsForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedCellsForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedCellsForPaging []apimpl.IESpec[ProtocolIEID, RecommendedCellsForPaging] + +func (recommendedCellsForPaging *RecommendedCellsForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if recommendedCellsForPaging.RecommendedCellList.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsRecommendedCellsForPaging, recommendedCellsForPaging, &recommendedCellsForPaging.iEExtensions) + return notComprehended +} + +func (recommendedENBItem *RecommendedENBItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsRecommendedENBItem, recommendedENBItem, recommendedENBItem.iEExtensions) + w.WriteBit(recommendedENBItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := recommendedENBItem.MMEPagingTarget.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedENBItem.extensions.Present() { + if err := recommendedENBItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedENBItem *RecommendedENBItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedENBItem = RecommendedENBItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedENBItem.MMEPagingTarget).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedENBItem, recommendedENBItem, &recommendedENBItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedENBItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedENBItem []apimpl.IESpec[ProtocolIEID, RecommendedENBItem] + +func (recommendedENBItem *RecommendedENBItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if recommendedENBItem.MMEPagingTarget.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsRecommendedENBItem, recommendedENBItem, &recommendedENBItem.iEExtensions) + return notComprehended +} + +func (recommendedENBsForPaging *RecommendedENBsForPaging) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsRecommendedENBsForPaging, recommendedENBsForPaging, recommendedENBsForPaging.iEExtensions) + w.WriteBit(recommendedENBsForPaging.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := recommendedENBsForPaging.RecommendedENBList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if recommendedENBsForPaging.extensions.Present() { + if err := recommendedENBsForPaging.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (recommendedENBsForPaging *RecommendedENBsForPaging) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *recommendedENBsForPaging = RecommendedENBsForPaging{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&recommendedENBsForPaging.RecommendedENBList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRecommendedENBsForPaging, recommendedENBsForPaging, &recommendedENBsForPaging.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := recommendedENBsForPaging.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsRecommendedENBsForPaging []apimpl.IESpec[ProtocolIEID, RecommendedENBsForPaging] + +func (recommendedENBsForPaging *RecommendedENBsForPaging) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsRLFReportInformation, rLFReportInformation, rLFReportInformation.iEExtensions) + if recommendedENBsForPaging.RecommendedENBList.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsRecommendedENBsForPaging, recommendedENBsForPaging, &recommendedENBsForPaging.iEExtensions) return notComprehended } -func (rRCEstablishmentCause RRCEstablishmentCause) MarshalPER(w *per.Writer, enc per.Encoding) error { - return enumRRCEstablishmentCause.Encode(w, enc, rRCEstablishmentCause) +func (relayNodeIndicator RelayNodeIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumRelayNodeIndicator.Encode(w, enc, relayNodeIndicator) } -func (rRCEstablishmentCause *RRCEstablishmentCause) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - v, err := enumRRCEstablishmentCause.Decode(r, enc) +func (relayNodeIndicator *RelayNodeIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumRelayNodeIndicator.Decode(r, enc) if err != nil { return err } - *rRCEstablishmentCause = v + *relayNodeIndicator = v return nil } -func (rRCEstablishmentCause RRCEstablishmentCause) Name() string { - return enumRRCEstablishmentCause.Name(rRCEstablishmentCause) +func (relayNodeIndicator RelayNodeIndicator) Name() string { + return enumRelayNodeIndicator.Name(relayNodeIndicator) } -func (rRCEstablishmentCause RRCEstablishmentCause) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { - return !enumRRCEstablishmentCause.Known(rRCEstablishmentCause) +func (relayNodeIndicator RelayNodeIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumRelayNodeIndicator.Known(relayNodeIndicator) } func (reportArea ReportArea) MarshalPER(w *per.Writer, enc per.Encoding) error { @@ -6579,12 +10196,12 @@ func (reportArea ReportArea) Name() string { return enumReportArea.Name(reportArea) } -func (reportArea ReportArea) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (reportArea ReportArea) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumReportArea.Known(reportArea) } func (requestType *RequestType) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRequestType, requestType, requestType.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRequestType, requestType, requestType.iEExtensions) w.WriteBit(requestType.extensions.Present()) w.WriteBit(len(ext) > 0) if err := requestType.EventType.MarshalPER(w, enc); err != nil { @@ -6594,7 +10211,7 @@ func (requestType *RequestType) MarshalPER(w *per.Writer, enc per.Encoding) erro return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6623,7 +10240,7 @@ func (requestType *RequestType) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRequestType, requestType, &requestType.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRequestType, requestType, &requestType.iEExtensions); err != nil { return err } } @@ -6635,11 +10252,11 @@ func (requestType *RequestType) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsRequestType = []ap.IESpec[ProtocolIEID, RequestType]{ +var extIEsRequestType = []apimpl.IESpec[ProtocolIEID, RequestType]{ { ID: IDRequestTypeAdditionalInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *RequestType, r *per.Reader, enc per.Encoding) error { var v RequestTypeAdditionalInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -6654,10 +10271,13 @@ var extIEsRequestType = []ap.IESpec[ProtocolIEID, RequestType]{ } return x.RequestTypeAdditionalInfo, true }, + Clear: func(x *RequestType) { + x.RequestTypeAdditionalInfo = nil + }, }, } -func (requestType *RequestType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (requestType *RequestType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if requestType.EventType.Diagnose(d) { notComprehended = true @@ -6665,7 +10285,7 @@ func (requestType *RequestType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { if requestType.ReportArea.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsRequestType, requestType, requestType.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRequestType, requestType, &requestType.iEExtensions) return notComprehended } @@ -6686,19 +10306,19 @@ func (requestTypeAdditionalInfo RequestTypeAdditionalInfo) Name() string { return enumRequestTypeAdditionalInfo.Name(requestTypeAdditionalInfo) } -func (requestTypeAdditionalInfo RequestTypeAdditionalInfo) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (requestTypeAdditionalInfo RequestTypeAdditionalInfo) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumRequestTypeAdditionalInfo.Known(requestTypeAdditionalInfo) } func (requestedTNLInfo *RequestedTNLInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsRequestedTNLInfo, requestedTNLInfo, requestedTNLInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsRequestedTNLInfo, requestedTNLInfo, requestedTNLInfo.iEExtensions) w.WriteBit(requestedTNLInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := requestedTNLInfo.PLMNIdentity.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6724,7 +10344,7 @@ func (requestedTNLInfo *RequestedTNLInfo) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsRequestedTNLInfo, requestedTNLInfo, &requestedTNLInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsRequestedTNLInfo, requestedTNLInfo, &requestedTNLInfo.iEExtensions); err != nil { return err } } @@ -6736,11 +10356,11 @@ func (requestedTNLInfo *RequestedTNLInfo) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsRequestedTNLInfo []ap.IESpec[ProtocolIEID, RequestedTNLInfo] +var extIEsRequestedTNLInfo []apimpl.IESpec[ProtocolIEID, RequestedTNLInfo] -func (requestedTNLInfo *RequestedTNLInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (requestedTNLInfo *RequestedTNLInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsRequestedTNLInfo, requestedTNLInfo, requestedTNLInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsRequestedTNLInfo, requestedTNLInfo, &requestedTNLInfo.iEExtensions) return notComprehended } @@ -6761,7 +10381,7 @@ func (resetAll ResetAll) Name() string { return enumResetAll.Name(resetAll) } -func (resetAll ResetAll) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (resetAll ResetAll) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumResetAll.Known(resetAll) } @@ -6838,7 +10458,7 @@ func (resetType *ResetType) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -func (resetType *ResetType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (resetType *ResetType) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case resetType.S1Interface != nil: return resetType.S1Interface.Diagnose(d) @@ -6851,7 +10471,7 @@ func (resetType *ResetType) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { } func (sONConfigurationTransfer *SONConfigurationTransfer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSONConfigurationTransfer, sONConfigurationTransfer, sONConfigurationTransfer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSONConfigurationTransfer, sONConfigurationTransfer, sONConfigurationTransfer.iEExtensions) w.WriteBit(sONConfigurationTransfer.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sONConfigurationTransfer.TargeteNBID.MarshalPER(w, enc); err != nil { @@ -6864,7 +10484,7 @@ func (sONConfigurationTransfer *SONConfigurationTransfer) MarshalPER(w *per.Writ return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -6896,7 +10516,7 @@ func (sONConfigurationTransfer *SONConfigurationTransfer) UnmarshalPER(r *per.Re return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSONConfigurationTransfer, sONConfigurationTransfer, &sONConfigurationTransfer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSONConfigurationTransfer, sONConfigurationTransfer, &sONConfigurationTransfer.iEExtensions); err != nil { return err } } @@ -6908,11 +10528,11 @@ func (sONConfigurationTransfer *SONConfigurationTransfer) UnmarshalPER(r *per.Re return nil } -var extIEsSONConfigurationTransfer = []ap.IESpec[ProtocolIEID, SONConfigurationTransfer]{ +var extIEsSONConfigurationTransfer = []apimpl.IESpec[ProtocolIEID, SONConfigurationTransfer]{ { ID: IDX2TNLConfigurationInfo, - Presence: ap.PresenceConditional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceConditional, + Criticality: apimpl.CriticalityIgnore, Condition: sonRequestsX2TNLConfigurationInfo, Decode: func(x *SONConfigurationTransfer, r *per.Reader, enc per.Encoding) error { var v X2TNLConfigurationInfo @@ -6928,11 +10548,14 @@ var extIEsSONConfigurationTransfer = []ap.IESpec[ProtocolIEID, SONConfigurationT } return x.X2TNLConfigurationInfo, true }, + Clear: func(x *SONConfigurationTransfer) { + x.X2TNLConfigurationInfo = nil + }, }, { ID: IDSynchronisationInformation, - Presence: ap.PresenceConditional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceConditional, + Criticality: apimpl.CriticalityIgnore, Condition: sonRequestsActivateMuting, Decode: func(x *SONConfigurationTransfer, r *per.Reader, enc per.Encoding) error { var v SynchronisationInformation @@ -6948,11 +10571,14 @@ var extIEsSONConfigurationTransfer = []ap.IESpec[ProtocolIEID, SONConfigurationT } return x.SynchronisationInformation, true }, + Clear: func(x *SONConfigurationTransfer) { + x.SynchronisationInformation = nil + }, }, { ID: IDRequestedTNLInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SONConfigurationTransfer, r *per.Reader, enc per.Encoding) error { var v RequestedTNLInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -6967,10 +10593,13 @@ var extIEsSONConfigurationTransfer = []ap.IESpec[ProtocolIEID, SONConfigurationT } return x.RequestedTNLInfo, true }, + Clear: func(x *SONConfigurationTransfer) { + x.RequestedTNLInfo = nil + }, }, } -func (sONConfigurationTransfer *SONConfigurationTransfer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sONConfigurationTransfer *SONConfigurationTransfer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sONConfigurationTransfer.TargeteNBID.Diagnose(d) { notComprehended = true @@ -6981,7 +10610,7 @@ func (sONConfigurationTransfer *SONConfigurationTransfer) Diagnose(d *ap.Diagnos if sONConfigurationTransfer.SONInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSONConfigurationTransfer, sONConfigurationTransfer, sONConfigurationTransfer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSONConfigurationTransfer, sONConfigurationTransfer, &sONConfigurationTransfer.iEExtensions) return notComprehended } @@ -7041,7 +10670,7 @@ func (sONInformation *SONInformation) UnmarshalPER(r *per.Reader, enc per.Encodi switch extIdx { case 0: var v SONInformationExtension - if err := per.DecodeOpenType(r, enc, &v); err != nil { + if err := per.DecodeCompleteOpenType(r, enc, &v); err != nil { return err } sONInformation.SONInformationExtension = &v @@ -7074,7 +10703,7 @@ func (sONInformation *SONInformation) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -func (sONInformation *SONInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sONInformation *SONInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case sONInformation.SONInformationRequest != nil: return sONInformation.SONInformationRequest.Diagnose(d) @@ -7100,9 +10729,9 @@ func (sONInformationExtension *SONInformationExtension) MarshalPER(w *per.Writer } switch { case sONInformationExtension.SONInformationReport != nil: - return ap.EncodeField(profile, w, enc, ap.FieldValue[ProtocolIEID]{ID: IDSONInformationReport, Criticality: sONInformationExtension.choiceCriticality.Of(ap.CriticalityIgnore), Value: sONInformationExtension.SONInformationReport}) + return apimpl.EncodeField(profile, w, enc, apimpl.FieldValue[ProtocolIEID]{ID: IDSONInformationReport, Criticality: sONInformationExtension.choiceCriticality.Of(apimpl.CriticalityIgnore), Value: sONInformationExtension.SONInformationReport}) case sONInformationExtension.ChoiceExtension != nil: - return ap.EncodeField(profile, w, enc, sONInformationExtension.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, sONInformationExtension.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -7113,22 +10742,18 @@ func (sONInformationExtension *SONInformationExtension) UnmarshalPER(r *per.Read var idx int64 = 0 switch idx { case 0: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } switch f.ID { case IDSONInformationReport: var v SONInformationReport - if err := (&v).UnmarshalPER(per.NewReader([]byte(f.Value)), enc); err != nil { + if err := apimpl.DecodeValue([]byte(f.Value), &v); err != nil { return err } - if !ap.Comprehended[ProtocolIEID](&v) { - sONInformationExtension.ChoiceExtension = &f - break - } sONInformationExtension.SONInformationReport = &v - sONInformationExtension.choiceCriticality = ap.Wire(f.Criticality, ap.CriticalityIgnore) + sONInformationExtension.choiceCriticality = apimpl.Wire(f.Criticality, apimpl.CriticalityIgnore) default: sONInformationExtension.ChoiceExtension = &f } @@ -7138,18 +10763,18 @@ func (sONInformationExtension *SONInformationExtension) UnmarshalPER(r *per.Read return nil } -func (sONInformationExtension *SONInformationExtension) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sONInformationExtension *SONInformationExtension) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case sONInformationExtension.SONInformationReport != nil: - d.IE(IDSONInformationReport, sONInformationExtension.choiceCriticality.Of(ap.CriticalityIgnore), sONInformationExtension.SONInformationReport) + return apimpl.DiagnoseChoiceExtension(d, IDSONInformationReport, sONInformationExtension.choiceCriticality.Of(apimpl.CriticalityIgnore), &sONInformationExtension.SONInformationReport, &sONInformationExtension.ChoiceExtension) case sONInformationExtension.ChoiceExtension != nil: - d.Unknown(sONInformationExtension.ChoiceExtension.ID, sONInformationExtension.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, sONInformationExtension.ChoiceExtension) } return false } func (sONInformationReply *SONInformationReply) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSONInformationReply, sONInformationReply, sONInformationReply.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSONInformationReply, sONInformationReply, sONInformationReply.iEExtensions) w.WriteBit(sONInformationReply.extensions.Present()) w.WriteBit(sONInformationReply.X2TNLConfigurationInfo != nil) w.WriteBit(len(ext) > 0) @@ -7159,7 +10784,7 @@ func (sONInformationReply *SONInformationReply) MarshalPER(w *per.Writer, enc pe } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7193,7 +10818,7 @@ func (sONInformationReply *SONInformationReply) UnmarshalPER(r *per.Reader, enc sONInformationReply.X2TNLConfigurationInfo = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSONInformationReply, sONInformationReply, &sONInformationReply.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSONInformationReply, sONInformationReply, &sONInformationReply.iEExtensions); err != nil { return err } } @@ -7205,11 +10830,11 @@ func (sONInformationReply *SONInformationReply) UnmarshalPER(r *per.Reader, enc return nil } -var extIEsSONInformationReply = []ap.IESpec[ProtocolIEID, SONInformationReply]{ +var extIEsSONInformationReply = []apimpl.IESpec[ProtocolIEID, SONInformationReply]{ { ID: IDTimeSynchronisationInfo, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SONInformationReply, r *per.Reader, enc per.Encoding) error { var v TimeSynchronisationInfo if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7224,11 +10849,14 @@ var extIEsSONInformationReply = []ap.IESpec[ProtocolIEID, SONInformationReply]{ } return x.TimeSynchronisationInfo, true }, + Clear: func(x *SONInformationReply) { + x.TimeSynchronisationInfo = nil + }, }, { ID: IDMutingPatternInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SONInformationReply, r *per.Reader, enc per.Encoding) error { var v MutingPatternInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7243,15 +10871,18 @@ var extIEsSONInformationReply = []ap.IESpec[ProtocolIEID, SONInformationReply]{ } return x.MutingPatternInformation, true }, + Clear: func(x *SONInformationReply) { + x.MutingPatternInformation = nil + }, }, } -func (sONInformationReply *SONInformationReply) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sONInformationReply *SONInformationReply) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sONInformationReply.X2TNLConfigurationInfo != nil && sONInformationReply.X2TNLConfigurationInfo.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSONInformationReply, sONInformationReply, sONInformationReply.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSONInformationReply, sONInformationReply, &sONInformationReply.iEExtensions) return notComprehended } @@ -7308,7 +10939,7 @@ func (sONInformationReport *SONInformationReport) UnmarshalPER(r *per.Reader, en return nil } -func (sONInformationReport *SONInformationReport) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sONInformationReport *SONInformationReport) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case sONInformationReport.RLFReportInformation != nil: return sONInformationReport.RLFReportInformation.Diagnose(d) @@ -7335,12 +10966,75 @@ func (sONInformationRequest SONInformationRequest) Name() string { return enumSONInformationRequest.Name(sONInformationRequest) } -func (sONInformationRequest SONInformationRequest) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (sONInformationRequest SONInformationRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSONInformationRequest.Known(sONInformationRequest) } +func (sRVCCHOIndication SRVCCHOIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSRVCCHOIndication.Encode(w, enc, sRVCCHOIndication) +} + +func (sRVCCHOIndication *SRVCCHOIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSRVCCHOIndication.Decode(r, enc) + if err != nil { + return err + } + *sRVCCHOIndication = v + return nil +} + +func (sRVCCHOIndication SRVCCHOIndication) Name() string { + return enumSRVCCHOIndication.Name(sRVCCHOIndication) +} + +func (sRVCCHOIndication SRVCCHOIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSRVCCHOIndication.Known(sRVCCHOIndication) +} + +func (sRVCCOperationNotPossible SRVCCOperationNotPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSRVCCOperationNotPossible.Encode(w, enc, sRVCCOperationNotPossible) +} + +func (sRVCCOperationNotPossible *SRVCCOperationNotPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSRVCCOperationNotPossible.Decode(r, enc) + if err != nil { + return err + } + *sRVCCOperationNotPossible = v + return nil +} + +func (sRVCCOperationNotPossible SRVCCOperationNotPossible) Name() string { + return enumSRVCCOperationNotPossible.Name(sRVCCOperationNotPossible) +} + +func (sRVCCOperationNotPossible SRVCCOperationNotPossible) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSRVCCOperationNotPossible.Known(sRVCCOperationNotPossible) +} + +func (sRVCCOperationPossible SRVCCOperationPossible) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSRVCCOperationPossible.Encode(w, enc, sRVCCOperationPossible) +} + +func (sRVCCOperationPossible *SRVCCOperationPossible) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSRVCCOperationPossible.Decode(r, enc) + if err != nil { + return err + } + *sRVCCOperationPossible = v + return nil +} + +func (sRVCCOperationPossible SRVCCOperationPossible) Name() string { + return enumSRVCCOperationPossible.Name(sRVCCOperationPossible) +} + +func (sRVCCOperationPossible SRVCCOperationPossible) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSRVCCOperationPossible.Known(sRVCCOperationPossible) +} + func (sTMSI *STMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSTMSI, sTMSI, sTMSI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSTMSI, sTMSI, sTMSI.iEExtensions) w.WriteBit(sTMSI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sTMSI.MMEC.MarshalPER(w, enc); err != nil { @@ -7350,7 +11044,7 @@ func (sTMSI *STMSI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7379,7 +11073,7 @@ func (sTMSI *STMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSTMSI, sTMSI, &sTMSI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSTMSI, sTMSI, &sTMSI.iEExtensions); err != nil { return err } } @@ -7391,16 +11085,232 @@ func (sTMSI *STMSI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsSTMSI []ap.IESpec[ProtocolIEID, STMSI] +var extIEsSTMSI []apimpl.IESpec[ProtocolIEID, STMSI] + +func (sTMSI *STMSI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsSTMSI, sTMSI, &sTMSI.iEExtensions) + return notComprehended +} + +func (scheduledCommunicationTime *ScheduledCommunicationTime) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsScheduledCommunicationTime, scheduledCommunicationTime, scheduledCommunicationTime.iEExtensions) + w.WriteBit(scheduledCommunicationTime.extensions.Present()) + w.WriteBit(scheduledCommunicationTime.DayofWeek != nil) + w.WriteBit(scheduledCommunicationTime.TimeofDayStart != nil) + w.WriteBit(scheduledCommunicationTime.TimeofDayEnd != nil) + w.WriteBit(len(ext) > 0) + if scheduledCommunicationTime.DayofWeek != nil { + if err := (*scheduledCommunicationTime.DayofWeek).MarshalPER(w, enc); err != nil { + return err + } + } + if scheduledCommunicationTime.TimeofDayStart != nil { + if err := (*scheduledCommunicationTime.TimeofDayStart).MarshalPER(w, enc); err != nil { + return err + } + } + if scheduledCommunicationTime.TimeofDayEnd != nil { + if err := (*scheduledCommunicationTime.TimeofDayEnd).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if scheduledCommunicationTime.extensions.Present() { + if err := scheduledCommunicationTime.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (scheduledCommunicationTime *ScheduledCommunicationTime) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *scheduledCommunicationTime = ScheduledCommunicationTime{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_DayofWeek, err := r.ReadBit() + if err != nil { + return err + } + p_TimeofDayStart, err := r.ReadBit() + if err != nil { + return err + } + p_TimeofDayEnd, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_DayofWeek { + var v ScheduledCommunicationTimeDayofWeek + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + scheduledCommunicationTime.DayofWeek = &v + } + if p_TimeofDayStart { + var v ScheduledCommunicationTimeTimeofDayStart + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + scheduledCommunicationTime.TimeofDayStart = &v + } + if p_TimeofDayEnd { + var v ScheduledCommunicationTimeTimeofDayEnd + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + scheduledCommunicationTime.TimeofDayEnd = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsScheduledCommunicationTime, scheduledCommunicationTime, &scheduledCommunicationTime.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := scheduledCommunicationTime.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsScheduledCommunicationTime []apimpl.IESpec[ProtocolIEID, ScheduledCommunicationTime] + +func (scheduledCommunicationTime *ScheduledCommunicationTime) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsScheduledCommunicationTime, scheduledCommunicationTime, &scheduledCommunicationTime.iEExtensions) + return notComprehended +} + +func (secondaryRATDataUsageReportItem *SecondaryRATDataUsageReportItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsSecondaryRATDataUsageReportItem, secondaryRATDataUsageReportItem, secondaryRATDataUsageReportItem.iEExtensions) + w.WriteBit(secondaryRATDataUsageReportItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := secondaryRATDataUsageReportItem.ERABID.MarshalPER(w, enc); err != nil { + return err + } + if err := secondaryRATDataUsageReportItem.SecondaryRATType.MarshalPER(w, enc); err != nil { + return err + } + if err := secondaryRATDataUsageReportItem.ERABUsageReportList.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if secondaryRATDataUsageReportItem.extensions.Present() { + if err := secondaryRATDataUsageReportItem.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (secondaryRATDataUsageReportItem *SecondaryRATDataUsageReportItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *secondaryRATDataUsageReportItem = SecondaryRATDataUsageReportItem{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&secondaryRATDataUsageReportItem.ERABID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&secondaryRATDataUsageReportItem.SecondaryRATType).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&secondaryRATDataUsageReportItem.ERABUsageReportList).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSecondaryRATDataUsageReportItem, secondaryRATDataUsageReportItem, &secondaryRATDataUsageReportItem.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := secondaryRATDataUsageReportItem.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecondaryRATDataUsageReportItem []apimpl.IESpec[ProtocolIEID, SecondaryRATDataUsageReportItem] -func (sTMSI *STMSI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (secondaryRATDataUsageReportItem *SecondaryRATDataUsageReportItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSTMSI, sTMSI, sTMSI.iEExtensions) + if secondaryRATDataUsageReportItem.ERABID.Diagnose(d) { + notComprehended = true + } + if secondaryRATDataUsageReportItem.SecondaryRATType.Diagnose(d) { + notComprehended = true + } + if secondaryRATDataUsageReportItem.ERABUsageReportList.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsSecondaryRATDataUsageReportItem, secondaryRATDataUsageReportItem, &secondaryRATDataUsageReportItem.iEExtensions) return notComprehended } +func (secondaryRATDataUsageRequest SecondaryRATDataUsageRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSecondaryRATDataUsageRequest.Encode(w, enc, secondaryRATDataUsageRequest) +} + +func (secondaryRATDataUsageRequest *SecondaryRATDataUsageRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSecondaryRATDataUsageRequest.Decode(r, enc) + if err != nil { + return err + } + *secondaryRATDataUsageRequest = v + return nil +} + +func (secondaryRATDataUsageRequest SecondaryRATDataUsageRequest) Name() string { + return enumSecondaryRATDataUsageRequest.Name(secondaryRATDataUsageRequest) +} + +func (secondaryRATDataUsageRequest SecondaryRATDataUsageRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSecondaryRATDataUsageRequest.Known(secondaryRATDataUsageRequest) +} + +func (secondaryRATType SecondaryRATType) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSecondaryRATType.Encode(w, enc, secondaryRATType) +} + +func (secondaryRATType *SecondaryRATType) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSecondaryRATType.Decode(r, enc) + if err != nil { + return err + } + *secondaryRATType = v + return nil +} + +func (secondaryRATType SecondaryRATType) Name() string { + return enumSecondaryRATType.Name(secondaryRATType) +} + +func (secondaryRATType SecondaryRATType) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSecondaryRATType.Known(secondaryRATType) +} + func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSecurityContext, securityContext, securityContext.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSecurityContext, securityContext, securityContext.iEExtensions) w.WriteBit(securityContext.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 7, HasUB: true}, int64(securityContext.NextHopChainingCount)); err != nil { @@ -7410,7 +11320,7 @@ func (securityContext *SecurityContext) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7441,7 +11351,7 @@ func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityContext, securityContext, &securityContext.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSecurityContext, securityContext, &securityContext.iEExtensions); err != nil { return err } } @@ -7453,36 +11363,96 @@ func (securityContext *SecurityContext) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsSecurityContext []ap.IESpec[ProtocolIEID, SecurityContext] +var extIEsSecurityContext []apimpl.IESpec[ProtocolIEID, SecurityContext] -func (securityContext *SecurityContext) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (securityContext *SecurityContext) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSecurityContext, securityContext, securityContext.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSecurityContext, securityContext, &securityContext.iEExtensions) return notComprehended } func (securityIndication *SecurityIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) w.WriteBit(securityIndication.extensions.Present()) w.WriteBit(len(ext) > 0) - if err := securityIndication.IntegrityProtectionIndication.MarshalPER(w, enc); err != nil { + if err := securityIndication.IntegrityProtectionIndication.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if securityIndication.extensions.Present() { + if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *securityIndication = SecurityIndication{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&securityIndication.IntegrityProtectionIndication).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSecurityIndication []apimpl.IESpec[ProtocolIEID, SecurityIndication] + +func (securityIndication *SecurityIndication) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if securityIndication.IntegrityProtectionIndication.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions) + return notComprehended +} + +func (servedDCNsItem *ServedDCNsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsServedDCNsItem, servedDCNsItem, servedDCNsItem.iEExtensions) + w.WriteBit(servedDCNsItem.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := servedDCNsItem.DCNID.MarshalPER(w, enc); err != nil { + return err + } + if err := servedDCNsItem.RelativeDCNCapacity.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } - if securityIndication.extensions.Present() { - if err := securityIndication.extensions.MarshalPER(w, enc); err != nil { + if servedDCNsItem.extensions.Present() { + if err := servedDCNsItem.extensions.MarshalPER(w, enc); err != nil { return err } } return nil } -func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *securityIndication = SecurityIndication{} +func (servedDCNsItem *ServedDCNsItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *servedDCNsItem = ServedDCNsItem{} extBit, err := r.ReadBit() if err != nil { return err @@ -7491,35 +11461,35 @@ func (securityIndication *SecurityIndication) UnmarshalPER(r *per.Reader, enc pe if err != nil { return err } - if err := (&securityIndication.IntegrityProtectionIndication).UnmarshalPER(r, enc); err != nil { + if err := (&servedDCNsItem.DCNID).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&servedDCNsItem.RelativeDCNCapacity).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSecurityIndication, securityIndication, &securityIndication.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsServedDCNsItem, servedDCNsItem, &servedDCNsItem.iEExtensions); err != nil { return err } } if extBit { - if err := securityIndication.extensions.UnmarshalPER(r, enc); err != nil { + if err := servedDCNsItem.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsSecurityIndication []ap.IESpec[ProtocolIEID, SecurityIndication] +var extIEsServedDCNsItem []apimpl.IESpec[ProtocolIEID, ServedDCNsItem] -func (securityIndication *SecurityIndication) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (servedDCNsItem *ServedDCNsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - if securityIndication.IntegrityProtectionIndication.Diagnose(d) { - notComprehended = true - } - ap.DiagnoseExtensions(d, extIEsSecurityIndication, securityIndication, securityIndication.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsServedDCNsItem, servedDCNsItem, &servedDCNsItem.iEExtensions) return notComprehended } func (servedGUMMEIsItem *ServedGUMMEIsItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsServedGUMMEIsItem, servedGUMMEIsItem, servedGUMMEIsItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsServedGUMMEIsItem, servedGUMMEIsItem, servedGUMMEIsItem.iEExtensions) w.WriteBit(servedGUMMEIsItem.extensions.Present()) w.WriteBit(len(ext) > 0) off0 := 0 @@ -7562,7 +11532,7 @@ func (servedGUMMEIsItem *ServedGUMMEIsItem) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7624,7 +11594,7 @@ func (servedGUMMEIsItem *ServedGUMMEIsItem) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsServedGUMMEIsItem, servedGUMMEIsItem, &servedGUMMEIsItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsServedGUMMEIsItem, servedGUMMEIsItem, &servedGUMMEIsItem.iEExtensions); err != nil { return err } } @@ -7636,11 +11606,11 @@ func (servedGUMMEIsItem *ServedGUMMEIsItem) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsServedGUMMEIsItem = []ap.IESpec[ProtocolIEID, ServedGUMMEIsItem]{ +var extIEsServedGUMMEIsItem = []apimpl.IESpec[ProtocolIEID, ServedGUMMEIsItem]{ { ID: IDGUMMEIType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *ServedGUMMEIsItem, r *per.Reader, enc per.Encoding) error { var v GUMMEIType if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7655,17 +11625,20 @@ var extIEsServedGUMMEIsItem = []ap.IESpec[ProtocolIEID, ServedGUMMEIsItem]{ } return x.GUMMEIType, true }, + Clear: func(x *ServedGUMMEIsItem) { + x.GUMMEIType = nil + }, }, } -func (servedGUMMEIsItem *ServedGUMMEIsItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (servedGUMMEIsItem *ServedGUMMEIsItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsServedGUMMEIsItem, servedGUMMEIsItem, servedGUMMEIsItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsServedGUMMEIsItem, servedGUMMEIsItem, &servedGUMMEIsItem.iEExtensions) return notComprehended } func (sourceNgRanNodeID *SourceNgRanNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSourceNgRanNodeID, sourceNgRanNodeID, sourceNgRanNodeID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSourceNgRanNodeID, sourceNgRanNodeID, sourceNgRanNodeID.iEExtensions) w.WriteBit(sourceNgRanNodeID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := sourceNgRanNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { @@ -7675,7 +11648,7 @@ func (sourceNgRanNodeID *SourceNgRanNodeID) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7704,7 +11677,7 @@ func (sourceNgRanNodeID *SourceNgRanNodeID) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceNgRanNodeID, sourceNgRanNodeID, &sourceNgRanNodeID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSourceNgRanNodeID, sourceNgRanNodeID, &sourceNgRanNodeID.iEExtensions); err != nil { return err } } @@ -7716,9 +11689,9 @@ func (sourceNgRanNodeID *SourceNgRanNodeID) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsSourceNgRanNodeID []ap.IESpec[ProtocolIEID, SourceNgRanNodeID] +var extIEsSourceNgRanNodeID []apimpl.IESpec[ProtocolIEID, SourceNgRanNodeID] -func (sourceNgRanNodeID *SourceNgRanNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sourceNgRanNodeID *SourceNgRanNodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sourceNgRanNodeID.GlobalRANNodeID.Diagnose(d) { notComprehended = true @@ -7726,7 +11699,7 @@ func (sourceNgRanNodeID *SourceNgRanNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEI if sourceNgRanNodeID.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSourceNgRanNodeID, sourceNgRanNodeID, sourceNgRanNodeID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSourceNgRanNodeID, sourceNgRanNodeID, &sourceNgRanNodeID.iEExtensions) return notComprehended } @@ -7752,7 +11725,7 @@ func (sourceNodeID *SourceNodeID) MarshalPER(w *per.Writer, enc per.Encoding) er if err := per.EncodeConstrainedWholeNumber(w, enc, 0, 1, 1); err != nil { return err } - return ap.EncodeField(profile, w, enc, sourceNodeID.ChoiceExtension.Field()) + return apimpl.EncodeField(profile, w, enc, sourceNodeID.ChoiceExtension.Field()) default: return per.ErrEmpty } @@ -7773,7 +11746,7 @@ func (sourceNodeID *SourceNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) } sourceNodeID.SourceNgRanNodeID = &v case 1: - f, err := ap.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) + f, err := apimpl.DecodeSingleContainerValue[ProtocolIEID](profile, r, enc) if err != nil { return err } @@ -7787,18 +11760,39 @@ func (sourceNodeID *SourceNodeID) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -func (sourceNodeID *SourceNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sourceNodeID *SourceNodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case sourceNodeID.SourceNgRanNodeID != nil: return sourceNodeID.SourceNgRanNodeID.Diagnose(d) case sourceNodeID.ChoiceExtension != nil: - d.Unknown(sourceNodeID.ChoiceExtension.ID, sourceNodeID.ChoiceExtension.Criticality) + return apimpl.DiagnoseUnknownChoiceExtension(d, sourceNodeID.ChoiceExtension) } return false } +func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSourceOfUEActivityBehaviourInformation.Encode(w, enc, sourceOfUEActivityBehaviourInformation) +} + +func (sourceOfUEActivityBehaviourInformation *SourceOfUEActivityBehaviourInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSourceOfUEActivityBehaviourInformation.Decode(r, enc) + if err != nil { + return err + } + *sourceOfUEActivityBehaviourInformation = v + return nil +} + +func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) Name() string { + return enumSourceOfUEActivityBehaviourInformation.Name(sourceOfUEActivityBehaviourInformation) +} + +func (sourceOfUEActivityBehaviourInformation SourceOfUEActivityBehaviourInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSourceOfUEActivityBehaviourInformation.Known(sourceOfUEActivityBehaviourInformation) +} + func (sourceeNBID *SourceeNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSourceeNBID, sourceeNBID, sourceeNBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSourceeNBID, sourceeNBID, sourceeNBID.iEExtensions) w.WriteBit(len(ext) > 0) if err := sourceeNBID.GlobalENBID.MarshalPER(w, enc); err != nil { return err @@ -7807,7 +11801,7 @@ func (sourceeNBID *SourceeNBID) MarshalPER(w *per.Writer, enc per.Encoding) erro return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7827,16 +11821,16 @@ func (sourceeNBID *SourceeNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceeNBID, sourceeNBID, &sourceeNBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSourceeNBID, sourceeNBID, &sourceeNBID.iEExtensions); err != nil { return err } } return nil } -var extIEsSourceeNBID []ap.IESpec[ProtocolIEID, SourceeNBID] +var extIEsSourceeNBID []apimpl.IESpec[ProtocolIEID, SourceeNBID] -func (sourceeNBID *SourceeNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sourceeNBID *SourceeNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sourceeNBID.GlobalENBID.Diagnose(d) { notComprehended = true @@ -7844,12 +11838,12 @@ func (sourceeNBID *SourceeNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { if sourceeNBID.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSourceeNBID, sourceeNBID, sourceeNBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSourceeNBID, sourceeNBID, &sourceeNBID.iEExtensions) return notComprehended } func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer.iEExtensions) w.WriteBit(sourceeNBToTargeteNBTransparentContainer.extensions.Present()) w.WriteBit(sourceeNBToTargeteNBTransparentContainer.ERABInformationList != nil) w.WriteBit(sourceeNBToTargeteNBTransparentContainer.SubscriberProfileIDforRFP != nil) @@ -7874,7 +11868,7 @@ func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentC return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -7926,7 +11920,7 @@ func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentC return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, &sourceeNBToTargeteNBTransparentContainer.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, &sourceeNBToTargeteNBTransparentContainer.iEExtensions); err != nil { return err } } @@ -7938,11 +11932,11 @@ func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentC return nil } -var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, SourceeNBToTargeteNBTransparentContainer]{ +var extIEsSourceeNBToTargeteNBTransparentContainer = []apimpl.IESpec[ProtocolIEID, SourceeNBToTargeteNBTransparentContainer]{ { ID: IDMobilityInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v MobilityInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7957,11 +11951,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.MobilityInformation, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.MobilityInformation = nil + }, }, { ID: IDUEHistoryInformationFromTheUE, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v UEHistoryInformationFromTheUE if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7976,11 +11973,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.UEHistoryInformationFromTheUE, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.UEHistoryInformationFromTheUE = nil + }, }, { ID: IDIMSvoiceEPSfallbackfrom5G, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v IMSvoiceEPSfallbackfrom5G if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -7995,11 +11995,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.IMSvoiceEPSfallbackfrom5G, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.IMSvoiceEPSfallbackfrom5G = nil + }, }, { ID: IDAdditionalRRMPriorityIndex, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v AdditionalRRMPriorityIndex if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8014,11 +12017,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.AdditionalRRMPriorityIndex, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.AdditionalRRMPriorityIndex = nil + }, }, { ID: IDContextatSource, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v ContextatSource if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8033,11 +12039,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.ContextatSource, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.ContextatSource = nil + }, }, { ID: IDIntersystemMeasurementConfiguration, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v IntersystemMeasurementConfiguration if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8052,11 +12061,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.IntersystemMeasurementConfiguration, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.IntersystemMeasurementConfiguration = nil + }, }, { ID: IDSourceNodeID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v SourceNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8071,11 +12083,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.SourceNodeID, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.SourceNodeID = nil + }, }, { ID: IDEmergencyIndicator, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v EmergencyIndicator if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8090,11 +12105,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.EmergencyIndicator, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.EmergencyIndicator = nil + }, }, { ID: IDUEContextReferenceatSourceeNB, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v ENBUES1APID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8109,11 +12127,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.UEContextReferenceatSourceeNB, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.UEContextReferenceatSourceeNB = nil + }, }, { ID: IDSourceSNID, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v GlobalRANNodeID if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8128,11 +12149,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.SourceSNID, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.SourceSNID = nil + }, }, { ID: IDDirectForwardingPathAvailability, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v DirectForwardingPathAvailability if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8147,11 +12171,14 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.DirectForwardingPathAvailability, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.DirectForwardingPathAvailability = nil + }, }, { ID: IDTimeBasedHandoverInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *SourceeNBToTargeteNBTransparentContainer, r *per.Reader, enc per.Encoding) error { var v TimeBasedHandoverInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8166,10 +12193,13 @@ var extIEsSourceeNBToTargeteNBTransparentContainer = []ap.IESpec[ProtocolIEID, S } return x.TimeBasedHandoverInformation, true }, + Clear: func(x *SourceeNBToTargeteNBTransparentContainer) { + x.TimeBasedHandoverInformation = nil + }, }, } -func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentContainer) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if sourceeNBToTargeteNBTransparentContainer.ERABInformationList.Diagnose(d) { notComprehended = true @@ -8180,7 +12210,7 @@ func (sourceeNBToTargeteNBTransparentContainer *SourceeNBToTargeteNBTransparentC if sourceeNBToTargeteNBTransparentContainer.UEHistoryInformation.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSourceeNBToTargeteNBTransparentContainer, sourceeNBToTargeteNBTransparentContainer, &sourceeNBToTargeteNBTransparentContainer.iEExtensions) return notComprehended } @@ -8201,12 +12231,261 @@ func (subcarrierSpacingSSB SubcarrierSpacingSSB) Name() string { return enumSubcarrierSpacingSSB.Name(subcarrierSpacingSSB) } -func (subcarrierSpacingSSB SubcarrierSpacingSSB) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (subcarrierSpacingSSB SubcarrierSpacingSSB) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSubcarrierSpacingSSB.Known(subcarrierSpacingSSB) } +func (subscriptionBasedUEDifferentiationInfo *SubscriptionBasedUEDifferentiationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsSubscriptionBasedUEDifferentiationInfo, subscriptionBasedUEDifferentiationInfo, subscriptionBasedUEDifferentiationInfo.iEExtensions) + w.WriteBit(subscriptionBasedUEDifferentiationInfo.extensions.Present()) + w.WriteBit(subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator != nil) + w.WriteBit(subscriptionBasedUEDifferentiationInfo.PeriodicTime != nil) + w.WriteBit(subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime != nil) + w.WriteBit(subscriptionBasedUEDifferentiationInfo.StationaryIndication != nil) + w.WriteBit(subscriptionBasedUEDifferentiationInfo.TrafficProfile != nil) + w.WriteBit(subscriptionBasedUEDifferentiationInfo.BatteryIndication != nil) + w.WriteBit(len(ext) > 0) + if subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator != nil { + if err := (*subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator).MarshalPER(w, enc); err != nil { + return err + } + } + if subscriptionBasedUEDifferentiationInfo.PeriodicTime != nil { + if err := (*subscriptionBasedUEDifferentiationInfo.PeriodicTime).MarshalPER(w, enc); err != nil { + return err + } + } + if subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime != nil { + if err := (*subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime).MarshalPER(w, enc); err != nil { + return err + } + } + if subscriptionBasedUEDifferentiationInfo.StationaryIndication != nil { + if err := (*subscriptionBasedUEDifferentiationInfo.StationaryIndication).MarshalPER(w, enc); err != nil { + return err + } + } + if subscriptionBasedUEDifferentiationInfo.TrafficProfile != nil { + if err := (*subscriptionBasedUEDifferentiationInfo.TrafficProfile).MarshalPER(w, enc); err != nil { + return err + } + } + if subscriptionBasedUEDifferentiationInfo.BatteryIndication != nil { + if err := (*subscriptionBasedUEDifferentiationInfo.BatteryIndication).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if subscriptionBasedUEDifferentiationInfo.extensions.Present() { + if err := subscriptionBasedUEDifferentiationInfo.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (subscriptionBasedUEDifferentiationInfo *SubscriptionBasedUEDifferentiationInfo) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *subscriptionBasedUEDifferentiationInfo = SubscriptionBasedUEDifferentiationInfo{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_PeriodicCommunicationIndicator, err := r.ReadBit() + if err != nil { + return err + } + p_PeriodicTime, err := r.ReadBit() + if err != nil { + return err + } + p_ScheduledCommunicationTime, err := r.ReadBit() + if err != nil { + return err + } + p_StationaryIndication, err := r.ReadBit() + if err != nil { + return err + } + p_TrafficProfile, err := r.ReadBit() + if err != nil { + return err + } + p_BatteryIndication, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_PeriodicCommunicationIndicator { + var v SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator = &v + } + if p_PeriodicTime { + var v SubscriptionBasedUEDifferentiationInfoPeriodicTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + subscriptionBasedUEDifferentiationInfo.PeriodicTime = &v + } + if p_ScheduledCommunicationTime { + var v ScheduledCommunicationTime + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime = &v + } + if p_StationaryIndication { + var v SubscriptionBasedUEDifferentiationInfoStationaryIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + subscriptionBasedUEDifferentiationInfo.StationaryIndication = &v + } + if p_TrafficProfile { + var v SubscriptionBasedUEDifferentiationInfoTrafficProfile + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + subscriptionBasedUEDifferentiationInfo.TrafficProfile = &v + } + if p_BatteryIndication { + var v SubscriptionBasedUEDifferentiationInfoBatteryIndication + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + subscriptionBasedUEDifferentiationInfo.BatteryIndication = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSubscriptionBasedUEDifferentiationInfo, subscriptionBasedUEDifferentiationInfo, &subscriptionBasedUEDifferentiationInfo.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := subscriptionBasedUEDifferentiationInfo.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsSubscriptionBasedUEDifferentiationInfo []apimpl.IESpec[ProtocolIEID, SubscriptionBasedUEDifferentiationInfo] + +func (subscriptionBasedUEDifferentiationInfo *SubscriptionBasedUEDifferentiationInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator != nil && subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator.Diagnose(d) { + notComprehended = true + } + if subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime != nil && subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime.Diagnose(d) { + notComprehended = true + } + if subscriptionBasedUEDifferentiationInfo.StationaryIndication != nil && subscriptionBasedUEDifferentiationInfo.StationaryIndication.Diagnose(d) { + notComprehended = true + } + if subscriptionBasedUEDifferentiationInfo.TrafficProfile != nil && subscriptionBasedUEDifferentiationInfo.TrafficProfile.Diagnose(d) { + notComprehended = true + } + if subscriptionBasedUEDifferentiationInfo.BatteryIndication != nil && subscriptionBasedUEDifferentiationInfo.BatteryIndication.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsSubscriptionBasedUEDifferentiationInfo, subscriptionBasedUEDifferentiationInfo, &subscriptionBasedUEDifferentiationInfo.iEExtensions) + return notComprehended +} + +func (subscriptionBasedUEDifferentiationInfoBatteryIndication SubscriptionBasedUEDifferentiationInfoBatteryIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSubscriptionBasedUEDifferentiationInfoBatteryIndication.Encode(w, enc, subscriptionBasedUEDifferentiationInfoBatteryIndication) +} + +func (subscriptionBasedUEDifferentiationInfoBatteryIndication *SubscriptionBasedUEDifferentiationInfoBatteryIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSubscriptionBasedUEDifferentiationInfoBatteryIndication.Decode(r, enc) + if err != nil { + return err + } + *subscriptionBasedUEDifferentiationInfoBatteryIndication = v + return nil +} + +func (subscriptionBasedUEDifferentiationInfoBatteryIndication SubscriptionBasedUEDifferentiationInfoBatteryIndication) Name() string { + return enumSubscriptionBasedUEDifferentiationInfoBatteryIndication.Name(subscriptionBasedUEDifferentiationInfoBatteryIndication) +} + +func (subscriptionBasedUEDifferentiationInfoBatteryIndication SubscriptionBasedUEDifferentiationInfoBatteryIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSubscriptionBasedUEDifferentiationInfoBatteryIndication.Known(subscriptionBasedUEDifferentiationInfoBatteryIndication) +} + +func (subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator.Encode(w, enc, subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator) +} + +func (subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator *SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator.Decode(r, enc) + if err != nil { + return err + } + *subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator = v + return nil +} + +func (subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator) Name() string { + return enumSubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator.Name(subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator) +} + +func (subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator SubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSubscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator.Known(subscriptionBasedUEDifferentiationInfoPeriodicCommunicationIndicator) +} + +func (subscriptionBasedUEDifferentiationInfoStationaryIndication SubscriptionBasedUEDifferentiationInfoStationaryIndication) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSubscriptionBasedUEDifferentiationInfoStationaryIndication.Encode(w, enc, subscriptionBasedUEDifferentiationInfoStationaryIndication) +} + +func (subscriptionBasedUEDifferentiationInfoStationaryIndication *SubscriptionBasedUEDifferentiationInfoStationaryIndication) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSubscriptionBasedUEDifferentiationInfoStationaryIndication.Decode(r, enc) + if err != nil { + return err + } + *subscriptionBasedUEDifferentiationInfoStationaryIndication = v + return nil +} + +func (subscriptionBasedUEDifferentiationInfoStationaryIndication SubscriptionBasedUEDifferentiationInfoStationaryIndication) Name() string { + return enumSubscriptionBasedUEDifferentiationInfoStationaryIndication.Name(subscriptionBasedUEDifferentiationInfoStationaryIndication) +} + +func (subscriptionBasedUEDifferentiationInfoStationaryIndication SubscriptionBasedUEDifferentiationInfoStationaryIndication) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSubscriptionBasedUEDifferentiationInfoStationaryIndication.Known(subscriptionBasedUEDifferentiationInfoStationaryIndication) +} + +func (subscriptionBasedUEDifferentiationInfoTrafficProfile SubscriptionBasedUEDifferentiationInfoTrafficProfile) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumSubscriptionBasedUEDifferentiationInfoTrafficProfile.Encode(w, enc, subscriptionBasedUEDifferentiationInfoTrafficProfile) +} + +func (subscriptionBasedUEDifferentiationInfoTrafficProfile *SubscriptionBasedUEDifferentiationInfoTrafficProfile) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumSubscriptionBasedUEDifferentiationInfoTrafficProfile.Decode(r, enc) + if err != nil { + return err + } + *subscriptionBasedUEDifferentiationInfoTrafficProfile = v + return nil +} + +func (subscriptionBasedUEDifferentiationInfoTrafficProfile SubscriptionBasedUEDifferentiationInfoTrafficProfile) Name() string { + return enumSubscriptionBasedUEDifferentiationInfoTrafficProfile.Name(subscriptionBasedUEDifferentiationInfoTrafficProfile) +} + +func (subscriptionBasedUEDifferentiationInfoTrafficProfile SubscriptionBasedUEDifferentiationInfoTrafficProfile) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumSubscriptionBasedUEDifferentiationInfoTrafficProfile.Known(subscriptionBasedUEDifferentiationInfoTrafficProfile) +} + func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) w.WriteBit(supportedTAItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := supportedTAItem.TAC.MarshalPER(w, enc); err != nil { @@ -8216,7 +12495,7 @@ func (supportedTAItem *SupportedTAItem) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8245,7 +12524,7 @@ func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions); err != nil { return err } } @@ -8257,11 +12536,11 @@ func (supportedTAItem *SupportedTAItem) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsSupportedTAItem = []ap.IESpec[ProtocolIEID, SupportedTAItem]{ +var extIEsSupportedTAItem = []apimpl.IESpec[ProtocolIEID, SupportedTAItem]{ { ID: IDRATType, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityReject, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityReject, Decode: func(x *SupportedTAItem, r *per.Reader, enc per.Encoding) error { var v RATType if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -8276,17 +12555,20 @@ var extIEsSupportedTAItem = []ap.IESpec[ProtocolIEID, SupportedTAItem]{ } return x.RATType, true }, + Clear: func(x *SupportedTAItem) { + x.RATType = nil + }, }, } -func (supportedTAItem *SupportedTAItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (supportedTAItem *SupportedTAItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsSupportedTAItem, supportedTAItem, supportedTAItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSupportedTAItem, supportedTAItem, &supportedTAItem.iEExtensions) return notComprehended } func (synchronisationInformation *SynchronisationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsSynchronisationInformation, synchronisationInformation, synchronisationInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsSynchronisationInformation, synchronisationInformation, synchronisationInformation.iEExtensions) w.WriteBit(synchronisationInformation.extensions.Present()) w.WriteBit(synchronisationInformation.SourceStratumLevel != nil) w.WriteBit(synchronisationInformation.ListeningSubframePattern != nil) @@ -8318,7 +12600,7 @@ func (synchronisationInformation *SynchronisationInformation) MarshalPER(w *per. } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8382,7 +12664,7 @@ func (synchronisationInformation *SynchronisationInformation) UnmarshalPER(r *pe } } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsSynchronisationInformation, synchronisationInformation, &synchronisationInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsSynchronisationInformation, synchronisationInformation, &synchronisationInformation.iEExtensions); err != nil { return err } } @@ -8394,9 +12676,9 @@ func (synchronisationInformation *SynchronisationInformation) UnmarshalPER(r *pe return nil } -var extIEsSynchronisationInformation []ap.IESpec[ProtocolIEID, SynchronisationInformation] +var extIEsSynchronisationInformation []apimpl.IESpec[ProtocolIEID, SynchronisationInformation] -func (synchronisationInformation *SynchronisationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (synchronisationInformation *SynchronisationInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if synchronisationInformation.SourceStratumLevel != nil && synchronisationInformation.SourceStratumLevel.Diagnose(d) { notComprehended = true @@ -8409,7 +12691,7 @@ func (synchronisationInformation *SynchronisationInformation) Diagnose(d *ap.Dia notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsSynchronisationInformation, synchronisationInformation, synchronisationInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsSynchronisationInformation, synchronisationInformation, &synchronisationInformation.iEExtensions) return notComprehended } @@ -8430,12 +12712,12 @@ func (synchronisationStatus SynchronisationStatus) Name() string { return enumSynchronisationStatus.Name(synchronisationStatus) } -func (synchronisationStatus SynchronisationStatus) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (synchronisationStatus SynchronisationStatus) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumSynchronisationStatus.Known(synchronisationStatus) } func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAI, tAI, tAI.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAI, tAI, tAI.iEExtensions) w.WriteBit(tAI.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAI.PLMNIdentity.MarshalPER(w, enc); err != nil { @@ -8445,7 +12727,7 @@ func (tAI *TAI) MarshalPER(w *per.Writer, enc per.Encoding) error { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8474,7 +12756,7 @@ func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAI, tAI, &tAI.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAI, tAI, &tAI.iEExtensions); err != nil { return err } } @@ -8486,16 +12768,16 @@ func (tAI *TAI) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsTAI []ap.IESpec[ProtocolIEID, TAI] +var extIEsTAI []apimpl.IESpec[ProtocolIEID, TAI] -func (tAI *TAI) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAI *TAI) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsTAI, tAI, tAI.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAI, tAI, &tAI.iEExtensions) return notComprehended } func (tAIBroadcastItem *TAIBroadcastItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIBroadcastItem, tAIBroadcastItem, tAIBroadcastItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIBroadcastItem, tAIBroadcastItem, tAIBroadcastItem.iEExtensions) w.WriteBit(tAIBroadcastItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIBroadcastItem.TAI.MarshalPER(w, enc); err != nil { @@ -8515,7 +12797,7 @@ func (tAIBroadcastItem *TAIBroadcastItem) MarshalPER(w *per.Writer, enc per.Enco return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8554,7 +12836,7 @@ func (tAIBroadcastItem *TAIBroadcastItem) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastItem, tAIBroadcastItem, &tAIBroadcastItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIBroadcastItem, tAIBroadcastItem, &tAIBroadcastItem.iEExtensions); err != nil { return err } } @@ -8566,9 +12848,9 @@ func (tAIBroadcastItem *TAIBroadcastItem) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsTAIBroadcastItem []ap.IESpec[ProtocolIEID, TAIBroadcastItem] +var extIEsTAIBroadcastItem []apimpl.IESpec[ProtocolIEID, TAIBroadcastItem] -func (tAIBroadcastItem *TAIBroadcastItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBroadcastItem *TAIBroadcastItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIBroadcastItem.TAI.Diagnose(d) { notComprehended = true @@ -8578,12 +12860,12 @@ func (tAIBroadcastItem *TAIBroadcastItem) Diagnose(d *ap.Diagnosis[ProtocolIEID] notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsTAIBroadcastItem, tAIBroadcastItem, tAIBroadcastItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIBroadcastItem, tAIBroadcastItem, &tAIBroadcastItem.iEExtensions) return notComprehended } func (tAICancelledItem *TAICancelledItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAICancelledItem, tAICancelledItem, tAICancelledItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAICancelledItem, tAICancelledItem, tAICancelledItem.iEExtensions) w.WriteBit(tAICancelledItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAICancelledItem.TAI.MarshalPER(w, enc); err != nil { @@ -8603,7 +12885,7 @@ func (tAICancelledItem *TAICancelledItem) MarshalPER(w *per.Writer, enc per.Enco return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8642,7 +12924,7 @@ func (tAICancelledItem *TAICancelledItem) UnmarshalPER(r *per.Reader, enc per.En return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledItem, tAICancelledItem, &tAICancelledItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAICancelledItem, tAICancelledItem, &tAICancelledItem.iEExtensions); err != nil { return err } } @@ -8654,9 +12936,9 @@ func (tAICancelledItem *TAICancelledItem) UnmarshalPER(r *per.Reader, enc per.En return nil } -var extIEsTAICancelledItem []ap.IESpec[ProtocolIEID, TAICancelledItem] +var extIEsTAICancelledItem []apimpl.IESpec[ProtocolIEID, TAICancelledItem] -func (tAICancelledItem *TAICancelledItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAICancelledItem *TAICancelledItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAICancelledItem.TAI.Diagnose(d) { notComprehended = true @@ -8666,19 +12948,19 @@ func (tAICancelledItem *TAICancelledItem) Diagnose(d *ap.Diagnosis[ProtocolIEID] notComprehended = true } } - ap.DiagnoseExtensions(d, extIEsTAICancelledItem, tAICancelledItem, tAICancelledItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAICancelledItem, tAICancelledItem, &tAICancelledItem.iEExtensions) return notComprehended } func (tAIItem *TAIItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTAIItem, tAIItem, tAIItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTAIItem, tAIItem, tAIItem.iEExtensions) w.WriteBit(tAIItem.extensions.Present()) w.WriteBit(len(ext) > 0) if err := tAIItem.TAI.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8704,7 +12986,7 @@ func (tAIItem *TAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTAIItem, tAIItem, &tAIItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTAIItem, tAIItem, &tAIItem.iEExtensions); err != nil { return err } } @@ -8716,14 +12998,14 @@ func (tAIItem *TAIItem) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -var extIEsTAIItem []ap.IESpec[ProtocolIEID, TAIItem] +var extIEsTAIItem []apimpl.IESpec[ProtocolIEID, TAIItem] -func (tAIItem *TAIItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIItem *TAIItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if tAIItem.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTAIItem, tAIItem, tAIItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTAIItem, tAIItem, &tAIItem.iEExtensions) return notComprehended } @@ -8791,7 +13073,7 @@ func (targetID *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { switch extIdx { case 0: var v TargetNgRanNodeID - if err := per.DecodeOpenType(r, enc, &v); err != nil { + if err := per.DecodeCompleteOpenType(r, enc, &v); err != nil { return err } targetID.TargetNgRanNodeID = &v @@ -8830,7 +13112,7 @@ func (targetID *TargetID) UnmarshalPER(r *per.Reader, enc per.Encoding) error { return nil } -func (targetID *TargetID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetID *TargetID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case targetID.TargeteNBID != nil: return targetID.TargeteNBID.Diagnose(d) @@ -8847,7 +13129,7 @@ func (targetID *TargetID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { } func (targetNgRanNodeID *TargetNgRanNodeID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetNgRanNodeID, targetNgRanNodeID, targetNgRanNodeID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetNgRanNodeID, targetNgRanNodeID, targetNgRanNodeID.iEExtensions) w.WriteBit(targetNgRanNodeID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targetNgRanNodeID.GlobalRANNodeID.MarshalPER(w, enc); err != nil { @@ -8857,7 +13139,7 @@ func (targetNgRanNodeID *TargetNgRanNodeID) MarshalPER(w *per.Writer, enc per.En return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8886,7 +13168,7 @@ func (targetNgRanNodeID *TargetNgRanNodeID) UnmarshalPER(r *per.Reader, enc per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetNgRanNodeID, targetNgRanNodeID, &targetNgRanNodeID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetNgRanNodeID, targetNgRanNodeID, &targetNgRanNodeID.iEExtensions); err != nil { return err } } @@ -8898,9 +13180,9 @@ func (targetNgRanNodeID *TargetNgRanNodeID) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsTargetNgRanNodeID []ap.IESpec[ProtocolIEID, TargetNgRanNodeID] +var extIEsTargetNgRanNodeID []apimpl.IESpec[ProtocolIEID, TargetNgRanNodeID] -func (targetNgRanNodeID *TargetNgRanNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetNgRanNodeID *TargetNgRanNodeID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetNgRanNodeID.GlobalRANNodeID.Diagnose(d) { notComprehended = true @@ -8908,12 +13190,12 @@ func (targetNgRanNodeID *TargetNgRanNodeID) Diagnose(d *ap.Diagnosis[ProtocolIEI if targetNgRanNodeID.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetNgRanNodeID, targetNgRanNodeID, targetNgRanNodeID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetNgRanNodeID, targetNgRanNodeID, &targetNgRanNodeID.iEExtensions) return notComprehended } func (targetRNCID *TargetRNCID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) w.WriteBit(targetRNCID.extensions.Present()) w.WriteBit(targetRNCID.RAC != nil) w.WriteBit(targetRNCID.ExtendedRNCID != nil) @@ -8935,7 +13217,7 @@ func (targetRNCID *TargetRNCID) MarshalPER(w *per.Writer, enc per.Encoding) erro } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -8990,7 +13272,7 @@ func (targetRNCID *TargetRNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) er targetRNCID.ExtendedRNCID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions); err != nil { return err } } @@ -9002,19 +13284,19 @@ func (targetRNCID *TargetRNCID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsTargetRNCID []ap.IESpec[ProtocolIEID, TargetRNCID] +var extIEsTargetRNCID []apimpl.IESpec[ProtocolIEID, TargetRNCID] -func (targetRNCID *TargetRNCID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targetRNCID *TargetRNCID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targetRNCID.LAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargetRNCID, targetRNCID, targetRNCID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargetRNCID, targetRNCID, &targetRNCID.iEExtensions) return notComprehended } func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) w.WriteBit(targeteNBID.extensions.Present()) w.WriteBit(len(ext) > 0) if err := targeteNBID.GlobalENBID.MarshalPER(w, enc); err != nil { @@ -9024,7 +13306,7 @@ func (targeteNBID *TargeteNBID) MarshalPER(w *per.Writer, enc per.Encoding) erro return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9053,7 +13335,7 @@ func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions); err != nil { return err } } @@ -9065,9 +13347,9 @@ func (targeteNBID *TargeteNBID) UnmarshalPER(r *per.Reader, enc per.Encoding) er return nil } -var extIEsTargeteNBID []ap.IESpec[ProtocolIEID, TargeteNBID] +var extIEsTargeteNBID []apimpl.IESpec[ProtocolIEID, TargeteNBID] -func (targeteNBID *TargeteNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (targeteNBID *TargeteNBID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if targeteNBID.GlobalENBID.Diagnose(d) { notComprehended = true @@ -9075,12 +13357,12 @@ func (targeteNBID *TargeteNBID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { if targeteNBID.SelectedTAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTargeteNBID, targeteNBID, targeteNBID.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTargeteNBID, targeteNBID, &targeteNBID.iEExtensions) return notComprehended } func (timeBasedHandoverInformation *TimeBasedHandoverInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) w.WriteBit(timeBasedHandoverInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := per.EncodeInteger(w, enc, per.Bounds{LB: 0, HasLB: true, UB: 1048575, HasUB: true}, int64(timeBasedHandoverInformation.HOWindowStart)); err != nil { @@ -9090,7 +13372,7 @@ func (timeBasedHandoverInformation *TimeBasedHandoverInformation) MarshalPER(w * return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9123,7 +13405,7 @@ func (timeBasedHandoverInformation *TimeBasedHandoverInformation) UnmarshalPER(r } timeBasedHandoverInformation.HOWindowDuration = uint16(n1) if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions); err != nil { return err } } @@ -9135,11 +13417,11 @@ func (timeBasedHandoverInformation *TimeBasedHandoverInformation) UnmarshalPER(r return nil } -var extIEsTimeBasedHandoverInformation []ap.IESpec[ProtocolIEID, TimeBasedHandoverInformation] +var extIEsTimeBasedHandoverInformation []apimpl.IESpec[ProtocolIEID, TimeBasedHandoverInformation] -func (timeBasedHandoverInformation *TimeBasedHandoverInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (timeBasedHandoverInformation *TimeBasedHandoverInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, timeBasedHandoverInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTimeBasedHandoverInformation, timeBasedHandoverInformation, &timeBasedHandoverInformation.iEExtensions) return notComprehended } @@ -9160,12 +13442,12 @@ func (timeRefDistribution TimeRefDistribution) Name() string { return enumTimeRefDistribution.Name(timeRefDistribution) } -func (timeRefDistribution TimeRefDistribution) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (timeRefDistribution TimeRefDistribution) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTimeRefDistribution.Known(timeRefDistribution) } func (timeSynchronisationInfo *TimeSynchronisationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTimeSynchronisationInfo, timeSynchronisationInfo, timeSynchronisationInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTimeSynchronisationInfo, timeSynchronisationInfo, timeSynchronisationInfo.iEExtensions) w.WriteBit(timeSynchronisationInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := timeSynchronisationInfo.StratumLevel.MarshalPER(w, enc); err != nil { @@ -9175,7 +13457,7 @@ func (timeSynchronisationInfo *TimeSynchronisationInfo) MarshalPER(w *per.Writer return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9204,7 +13486,7 @@ func (timeSynchronisationInfo *TimeSynchronisationInfo) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTimeSynchronisationInfo, timeSynchronisationInfo, &timeSynchronisationInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTimeSynchronisationInfo, timeSynchronisationInfo, &timeSynchronisationInfo.iEExtensions); err != nil { return err } } @@ -9216,11 +13498,11 @@ func (timeSynchronisationInfo *TimeSynchronisationInfo) UnmarshalPER(r *per.Read return nil } -var extIEsTimeSynchronisationInfo = []ap.IESpec[ProtocolIEID, TimeSynchronisationInfo]{ +var extIEsTimeSynchronisationInfo = []apimpl.IESpec[ProtocolIEID, TimeSynchronisationInfo]{ { ID: IDMutingAvailabilityIndication, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TimeSynchronisationInfo, r *per.Reader, enc per.Encoding) error { var v MutingAvailabilityIndication if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -9235,10 +13517,13 @@ var extIEsTimeSynchronisationInfo = []ap.IESpec[ProtocolIEID, TimeSynchronisatio } return x.MutingAvailabilityIndication, true }, + Clear: func(x *TimeSynchronisationInfo) { + x.MutingAvailabilityIndication = nil + }, }, } -func (timeSynchronisationInfo *TimeSynchronisationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (timeSynchronisationInfo *TimeSynchronisationInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if timeSynchronisationInfo.StratumLevel.Diagnose(d) { notComprehended = true @@ -9246,7 +13531,7 @@ func (timeSynchronisationInfo *TimeSynchronisationInfo) Diagnose(d *ap.Diagnosis if timeSynchronisationInfo.SynchronisationStatus.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTimeSynchronisationInfo, timeSynchronisationInfo, timeSynchronisationInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTimeSynchronisationInfo, timeSynchronisationInfo, &timeSynchronisationInfo.iEExtensions) return notComprehended } @@ -9267,12 +13552,12 @@ func (timeToWait TimeToWait) Name() string { return enumTimeToWait.Name(timeToWait) } -func (timeToWait TimeToWait) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (timeToWait TimeToWait) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTimeToWait.Known(timeToWait) } func (traceActivation *TraceActivation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) w.WriteBit(traceActivation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := traceActivation.EUTRANTraceID.MarshalPER(w, enc); err != nil { @@ -9288,7 +13573,7 @@ func (traceActivation *TraceActivation) MarshalPER(w *per.Writer, enc per.Encodi return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9323,7 +13608,7 @@ func (traceActivation *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Enco return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions); err != nil { return err } } @@ -9335,11 +13620,11 @@ func (traceActivation *TraceActivation) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ +var extIEsTraceActivation = []apimpl.IESpec[ProtocolIEID, TraceActivation]{ { ID: IDMDTConfigurationNR, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { var v MDTConfigurationNR if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -9354,11 +13639,14 @@ var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ } return x.MDTConfigurationNR, true }, + Clear: func(x *TraceActivation) { + x.MDTConfigurationNR = nil + }, }, { ID: IDTraceCollectionEntityURI, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *TraceActivation, r *per.Reader, enc per.Encoding) error { var v URIAddress if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -9373,15 +13661,18 @@ var extIEsTraceActivation = []ap.IESpec[ProtocolIEID, TraceActivation]{ } return x.TraceCollectionEntityURI, true }, + Clear: func(x *TraceActivation) { + x.TraceCollectionEntityURI = nil + }, }, } -func (traceActivation *TraceActivation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (traceActivation *TraceActivation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if traceActivation.TraceDepth.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsTraceActivation, traceActivation, traceActivation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTraceActivation, traceActivation, &traceActivation.iEExtensions) return notComprehended } @@ -9402,7 +13693,7 @@ func (traceDepth TraceDepth) Name() string { return enumTraceDepth.Name(traceDepth) } -func (traceDepth TraceDepth) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (traceDepth TraceDepth) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTraceDepth.Known(traceDepth) } @@ -9460,7 +13751,7 @@ func (triggeringMessage TriggeringMessage) Name() string { } func (tunnelInformation *TunnelInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsTunnelInformation, tunnelInformation, tunnelInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsTunnelInformation, tunnelInformation, tunnelInformation.iEExtensions) w.WriteBit(tunnelInformation.extensions.Present()) w.WriteBit(tunnelInformation.UDPPortNumber != nil) w.WriteBit(len(ext) > 0) @@ -9473,7 +13764,7 @@ func (tunnelInformation *TunnelInformation) MarshalPER(w *per.Writer, enc per.En } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9510,7 +13801,7 @@ func (tunnelInformation *TunnelInformation) UnmarshalPER(r *per.Reader, enc per. tunnelInformation.UDPPortNumber = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsTunnelInformation, tunnelInformation, &tunnelInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsTunnelInformation, tunnelInformation, &tunnelInformation.iEExtensions); err != nil { return err } } @@ -9522,11 +13813,11 @@ func (tunnelInformation *TunnelInformation) UnmarshalPER(r *per.Reader, enc per. return nil } -var extIEsTunnelInformation []ap.IESpec[ProtocolIEID, TunnelInformation] +var extIEsTunnelInformation []apimpl.IESpec[ProtocolIEID, TunnelInformation] -func (tunnelInformation *TunnelInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tunnelInformation *TunnelInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsTunnelInformation, tunnelInformation, tunnelInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsTunnelInformation, tunnelInformation, &tunnelInformation.iEExtensions) return notComprehended } @@ -9547,12 +13838,12 @@ func (typeOfError TypeOfError) Name() string { return enumTypeOfError.Name(typeOfError) } -func (typeOfError TypeOfError) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (typeOfError TypeOfError) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumTypeOfError.Known(typeOfError) } func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) w.WriteBit(uEAggregateMaximumBitRate.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uEAggregateMaximumBitRate.DL.MarshalPER(w, enc); err != nil { @@ -9562,7 +13853,7 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) MarshalPER(w *per.Wr return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9591,7 +13882,7 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per. return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions); err != nil { return err } } @@ -9603,11 +13894,11 @@ func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) UnmarshalPER(r *per. return nil } -var extIEsUEAggregateMaximumBitRate = []ap.IESpec[ProtocolIEID, UEAggregateMaximumBitRate]{ +var extIEsUEAggregateMaximumBitRate = []apimpl.IESpec[ProtocolIEID, UEAggregateMaximumBitRate]{ { ID: IDExtendedUEAggregateMaximumBitRateDL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UEAggregateMaximumBitRate, r *per.Reader, enc per.Encoding) error { var v ExtendedBitRate if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -9622,11 +13913,14 @@ var extIEsUEAggregateMaximumBitRate = []ap.IESpec[ProtocolIEID, UEAggregateMaxim } return x.ExtendedDL, true }, + Clear: func(x *UEAggregateMaximumBitRate) { + x.ExtendedDL = nil + }, }, { ID: IDExtendedUEAggregateMaximumBitRateUL, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UEAggregateMaximumBitRate, r *per.Reader, enc per.Encoding) error { var v ExtendedBitRate if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -9641,17 +13935,20 @@ var extIEsUEAggregateMaximumBitRate = []ap.IESpec[ProtocolIEID, UEAggregateMaxim } return x.ExtendedUL, true }, + Clear: func(x *UEAggregateMaximumBitRate) { + x.ExtendedUL = nil + }, }, } -func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAggregateMaximumBitRate *UEAggregateMaximumBitRate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, uEAggregateMaximumBitRate.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEAggregateMaximumBitRate, uEAggregateMaximumBitRate, &uEAggregateMaximumBitRate.iEExtensions) return notComprehended } func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem.iEExtensions) w.WriteBit(uEAssociatedLogicalS1ConnectionItem.extensions.Present()) w.WriteBit(uEAssociatedLogicalS1ConnectionItem.MMEUES1APID != nil) w.WriteBit(uEAssociatedLogicalS1ConnectionItem.ENBUES1APID != nil) @@ -9667,7 +13964,7 @@ func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) } } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9712,7 +14009,7 @@ func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) uEAssociatedLogicalS1ConnectionItem.ENBUES1APID = &v } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, &uEAssociatedLogicalS1ConnectionItem.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, &uEAssociatedLogicalS1ConnectionItem.iEExtensions); err != nil { return err } } @@ -9724,14 +14021,35 @@ func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) return nil } -var extIEsUEAssociatedLogicalS1ConnectionItem []ap.IESpec[ProtocolIEID, UEAssociatedLogicalS1ConnectionItem] +var extIEsUEAssociatedLogicalS1ConnectionItem []apimpl.IESpec[ProtocolIEID, UEAssociatedLogicalS1ConnectionItem] -func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEAssociatedLogicalS1ConnectionItem *UEAssociatedLogicalS1ConnectionItem) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUEAssociatedLogicalS1ConnectionItem, uEAssociatedLogicalS1ConnectionItem, &uEAssociatedLogicalS1ConnectionItem.iEExtensions) return notComprehended } +func (uECapabilityInfoRequest UECapabilityInfoRequest) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUECapabilityInfoRequest.Encode(w, enc, uECapabilityInfoRequest) +} + +func (uECapabilityInfoRequest *UECapabilityInfoRequest) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUECapabilityInfoRequest.Decode(r, enc) + if err != nil { + return err + } + *uECapabilityInfoRequest = v + return nil +} + +func (uECapabilityInfoRequest UECapabilityInfoRequest) Name() string { + return enumUECapabilityInfoRequest.Name(uECapabilityInfoRequest) +} + +func (uECapabilityInfoRequest UECapabilityInfoRequest) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumUECapabilityInfoRequest.Known(uECapabilityInfoRequest) +} + func (uEPagingID *UEPagingID) MarshalPER(w *per.Writer, enc per.Encoding) error { set := 0 for _, ok := range [...]bool{uEPagingID.STMSI != nil, uEPagingID.IMSI != nil, uEPagingID.Ext != nil} { @@ -9805,7 +14123,7 @@ func (uEPagingID *UEPagingID) UnmarshalPER(r *per.Reader, enc per.Encoding) erro return nil } -func (uEPagingID *UEPagingID) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEPagingID *UEPagingID) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uEPagingID.STMSI != nil: return uEPagingID.STMSI.Diagnose(d) @@ -9833,12 +14151,12 @@ func (uERetentionInformation UERetentionInformation) Name() string { return enumUERetentionInformation.Name(uERetentionInformation) } -func (uERetentionInformation UERetentionInformation) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (uERetentionInformation UERetentionInformation) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUERetentionInformation.Known(uERetentionInformation) } func (uES1APIDPair *UES1APIDPair) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUES1APIDPair, uES1APIDPair, uES1APIDPair.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUES1APIDPair, uES1APIDPair, uES1APIDPair.iEExtensions) w.WriteBit(uES1APIDPair.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uES1APIDPair.MMEUES1APID.MarshalPER(w, enc); err != nil { @@ -9848,7 +14166,7 @@ func (uES1APIDPair *UES1APIDPair) MarshalPER(w *per.Writer, enc per.Encoding) er return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -9877,7 +14195,7 @@ func (uES1APIDPair *UES1APIDPair) UnmarshalPER(r *per.Reader, enc per.Encoding) return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUES1APIDPair, uES1APIDPair, &uES1APIDPair.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUES1APIDPair, uES1APIDPair, &uES1APIDPair.iEExtensions); err != nil { return err } } @@ -9889,11 +14207,11 @@ func (uES1APIDPair *UES1APIDPair) UnmarshalPER(r *per.Reader, enc per.Encoding) return nil } -var extIEsUES1APIDPair []ap.IESpec[ProtocolIEID, UES1APIDPair] +var extIEsUES1APIDPair []apimpl.IESpec[ProtocolIEID, UES1APIDPair] -func (uES1APIDPair *UES1APIDPair) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uES1APIDPair *UES1APIDPair) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUES1APIDPair, uES1APIDPair, uES1APIDPair.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUES1APIDPair, uES1APIDPair, &uES1APIDPair.iEExtensions) return notComprehended } @@ -9970,7 +14288,7 @@ func (uES1APIDs *UES1APIDs) UnmarshalPER(r *per.Reader, enc per.Encoding) error return nil } -func (uES1APIDs *UES1APIDs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uES1APIDs *UES1APIDs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case uES1APIDs.UES1APIDPair != nil: return uES1APIDs.UES1APIDPair.Diagnose(d) @@ -9982,7 +14300,7 @@ func (uES1APIDs *UES1APIDs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { } func (uESecurityCapabilities *UESecurityCapabilities) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) w.WriteBit(uESecurityCapabilities.extensions.Present()) w.WriteBit(len(ext) > 0) if err := uESecurityCapabilities.EncryptionAlgorithms.MarshalPER(w, enc); err != nil { @@ -9992,7 +14310,7 @@ func (uESecurityCapabilities *UESecurityCapabilities) MarshalPER(w *per.Writer, return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10004,8 +14322,65 @@ func (uESecurityCapabilities *UESecurityCapabilities) MarshalPER(w *per.Writer, return nil } -func (uESecurityCapabilities *UESecurityCapabilities) UnmarshalPER(r *per.Reader, enc per.Encoding) error { - *uESecurityCapabilities = UESecurityCapabilities{} +func (uESecurityCapabilities *UESecurityCapabilities) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uESecurityCapabilities = UESecurityCapabilities{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&uESecurityCapabilities.EncryptionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if err := (&uESecurityCapabilities.IntegrityProtectionAlgorithms).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := uESecurityCapabilities.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsUESecurityCapabilities []apimpl.IESpec[ProtocolIEID, UESecurityCapabilities] + +func (uESecurityCapabilities *UESecurityCapabilities) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + apimpl.DiagnoseExtensions(d, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions) + return notComprehended +} + +func (uESidelinkAggregateMaximumBitrate *UESidelinkAggregateMaximumBitrate) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsUESidelinkAggregateMaximumBitrate, uESidelinkAggregateMaximumBitrate, uESidelinkAggregateMaximumBitrate.iEExtensions) + w.WriteBit(uESidelinkAggregateMaximumBitrate.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := uESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if uESidelinkAggregateMaximumBitrate.extensions.Present() { + if err := uESidelinkAggregateMaximumBitrate.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (uESidelinkAggregateMaximumBitrate *UESidelinkAggregateMaximumBitrate) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *uESidelinkAggregateMaximumBitrate = UESidelinkAggregateMaximumBitrate{} extBit, err := r.ReadBit() if err != nil { return err @@ -10014,33 +14389,51 @@ func (uESecurityCapabilities *UESecurityCapabilities) UnmarshalPER(r *per.Reader if err != nil { return err } - if err := (&uESecurityCapabilities.EncryptionAlgorithms).UnmarshalPER(r, enc); err != nil { - return err - } - if err := (&uESecurityCapabilities.IntegrityProtectionAlgorithms).UnmarshalPER(r, enc); err != nil { + if err := (&uESidelinkAggregateMaximumBitrate.UESidelinkAggregateMaximumBitRate).UnmarshalPER(r, enc); err != nil { return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUESecurityCapabilities, uESecurityCapabilities, &uESecurityCapabilities.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUESidelinkAggregateMaximumBitrate, uESidelinkAggregateMaximumBitrate, &uESidelinkAggregateMaximumBitrate.iEExtensions); err != nil { return err } } if extBit { - if err := uESecurityCapabilities.extensions.UnmarshalPER(r, enc); err != nil { + if err := uESidelinkAggregateMaximumBitrate.extensions.UnmarshalPER(r, enc); err != nil { return err } } return nil } -var extIEsUESecurityCapabilities []ap.IESpec[ProtocolIEID, UESecurityCapabilities] +var extIEsUESidelinkAggregateMaximumBitrate []apimpl.IESpec[ProtocolIEID, UESidelinkAggregateMaximumBitrate] -func (uESecurityCapabilities *UESecurityCapabilities) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uESidelinkAggregateMaximumBitrate *UESidelinkAggregateMaximumBitrate) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsUESecurityCapabilities, uESecurityCapabilities, uESecurityCapabilities.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUESidelinkAggregateMaximumBitrate, uESidelinkAggregateMaximumBitrate, &uESidelinkAggregateMaximumBitrate.iEExtensions) return notComprehended } +func (uEUserPlaneCIoTSupportIndicator UEUserPlaneCIoTSupportIndicator) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumUEUserPlaneCIoTSupportIndicator.Encode(w, enc, uEUserPlaneCIoTSupportIndicator) +} + +func (uEUserPlaneCIoTSupportIndicator *UEUserPlaneCIoTSupportIndicator) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumUEUserPlaneCIoTSupportIndicator.Decode(r, enc) + if err != nil { + return err + } + *uEUserPlaneCIoTSupportIndicator = v + return nil +} + +func (uEUserPlaneCIoTSupportIndicator UEUserPlaneCIoTSupportIndicator) Name() string { + return enumUEUserPlaneCIoTSupportIndicator.Name(uEUserPlaneCIoTSupportIndicator) +} + +func (uEUserPlaneCIoTSupportIndicator UEUserPlaneCIoTSupportIndicator) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumUEUserPlaneCIoTSupportIndicator.Known(uEUserPlaneCIoTSupportIndicator) +} + func (unlicensedSpectrumRestriction UnlicensedSpectrumRestriction) MarshalPER(w *per.Writer, enc per.Encoding) error { return enumUnlicensedSpectrumRestriction.Encode(w, enc, unlicensedSpectrumRestriction) } @@ -10058,12 +14451,12 @@ func (unlicensedSpectrumRestriction UnlicensedSpectrumRestriction) Name() string return enumUnlicensedSpectrumRestriction.Name(unlicensedSpectrumRestriction) } -func (unlicensedSpectrumRestriction UnlicensedSpectrumRestriction) Diagnose(*ap.Diagnosis[ProtocolIEID]) bool { +func (unlicensedSpectrumRestriction UnlicensedSpectrumRestriction) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { return !enumUnlicensedSpectrumRestriction.Known(unlicensedSpectrumRestriction) } func (userLocationInformation *UserLocationInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsUserLocationInformation, userLocationInformation, userLocationInformation.iEExtensions) + ext := apimpl.ExtensionFields(extIEsUserLocationInformation, userLocationInformation, userLocationInformation.iEExtensions) w.WriteBit(userLocationInformation.extensions.Present()) w.WriteBit(len(ext) > 0) if err := userLocationInformation.EUTRANCGI.MarshalPER(w, enc); err != nil { @@ -10073,7 +14466,7 @@ func (userLocationInformation *UserLocationInformation) MarshalPER(w *per.Writer return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10102,7 +14495,7 @@ func (userLocationInformation *UserLocationInformation) UnmarshalPER(r *per.Read return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformation, userLocationInformation, &userLocationInformation.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsUserLocationInformation, userLocationInformation, &userLocationInformation.iEExtensions); err != nil { return err } } @@ -10114,11 +14507,11 @@ func (userLocationInformation *UserLocationInformation) UnmarshalPER(r *per.Read return nil } -var extIEsUserLocationInformation = []ap.IESpec[ProtocolIEID, UserLocationInformation]{ +var extIEsUserLocationInformation = []apimpl.IESpec[ProtocolIEID, UserLocationInformation]{ { ID: IDPSCellInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformation, r *per.Reader, enc per.Encoding) error { var v PSCellInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -10133,11 +14526,14 @@ var extIEsUserLocationInformation = []ap.IESpec[ProtocolIEID, UserLocationInform } return x.PSCellInformation, true }, + Clear: func(x *UserLocationInformation) { + x.PSCellInformation = nil + }, }, { ID: IDLTENTNTAIInformation, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *UserLocationInformation, r *per.Reader, enc per.Encoding) error { var v LTENTNTAIInformation if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -10152,10 +14548,13 @@ var extIEsUserLocationInformation = []ap.IESpec[ProtocolIEID, UserLocationInform } return x.LTENTNTAIInformation, true }, + Clear: func(x *UserLocationInformation) { + x.LTENTNTAIInformation = nil + }, }, } -func (userLocationInformation *UserLocationInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (userLocationInformation *UserLocationInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if userLocationInformation.EUTRANCGI.Diagnose(d) { notComprehended = true @@ -10163,7 +14562,173 @@ func (userLocationInformation *UserLocationInformation) Diagnose(d *ap.Diagnosis if userLocationInformation.TAI.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEsUserLocationInformation, userLocationInformation, userLocationInformation.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsUserLocationInformation, userLocationInformation, &userLocationInformation.iEExtensions) + return notComprehended +} + +func (v2XServicesAuthorized *V2XServicesAuthorized) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsV2XServicesAuthorized, v2XServicesAuthorized, v2XServicesAuthorized.iEExtensions) + w.WriteBit(v2XServicesAuthorized.extensions.Present()) + w.WriteBit(v2XServicesAuthorized.VehicleUE != nil) + w.WriteBit(v2XServicesAuthorized.PedestrianUE != nil) + w.WriteBit(len(ext) > 0) + if v2XServicesAuthorized.VehicleUE != nil { + if err := (*v2XServicesAuthorized.VehicleUE).MarshalPER(w, enc); err != nil { + return err + } + } + if v2XServicesAuthorized.PedestrianUE != nil { + if err := (*v2XServicesAuthorized.PedestrianUE).MarshalPER(w, enc); err != nil { + return err + } + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if v2XServicesAuthorized.extensions.Present() { + if err := v2XServicesAuthorized.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (v2XServicesAuthorized *V2XServicesAuthorized) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *v2XServicesAuthorized = V2XServicesAuthorized{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_VehicleUE, err := r.ReadBit() + if err != nil { + return err + } + p_PedestrianUE, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if p_VehicleUE { + var v VehicleUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + v2XServicesAuthorized.VehicleUE = &v + } + if p_PedestrianUE { + var v PedestrianUE + if err := (&v).UnmarshalPER(r, enc); err != nil { + return err + } + v2XServicesAuthorized.PedestrianUE = &v + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsV2XServicesAuthorized, v2XServicesAuthorized, &v2XServicesAuthorized.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := v2XServicesAuthorized.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsV2XServicesAuthorized []apimpl.IESpec[ProtocolIEID, V2XServicesAuthorized] + +func (v2XServicesAuthorized *V2XServicesAuthorized) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if v2XServicesAuthorized.VehicleUE != nil && v2XServicesAuthorized.VehicleUE.Diagnose(d) { + notComprehended = true + } + if v2XServicesAuthorized.PedestrianUE != nil && v2XServicesAuthorized.PedestrianUE.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsV2XServicesAuthorized, v2XServicesAuthorized, &v2XServicesAuthorized.iEExtensions) + return notComprehended +} + +func (vehicleUE VehicleUE) MarshalPER(w *per.Writer, enc per.Encoding) error { + return enumVehicleUE.Encode(w, enc, vehicleUE) +} + +func (vehicleUE *VehicleUE) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + v, err := enumVehicleUE.Decode(r, enc) + if err != nil { + return err + } + *vehicleUE = v + return nil +} + +func (vehicleUE VehicleUE) Name() string { + return enumVehicleUE.Name(vehicleUE) +} + +func (vehicleUE VehicleUE) Diagnose(*apimpl.Diagnosis[ProtocolIEID]) bool { + return !enumVehicleUE.Known(vehicleUE) +} + +func (wUSAssistanceInformation *WUSAssistanceInformation) MarshalPER(w *per.Writer, enc per.Encoding) error { + ext := apimpl.ExtensionFields(extIEsWUSAssistanceInformation, wUSAssistanceInformation, wUSAssistanceInformation.iEExtensions) + w.WriteBit(wUSAssistanceInformation.extensions.Present()) + w.WriteBit(len(ext) > 0) + if err := wUSAssistanceInformation.PagingProbabilityInformation.MarshalPER(w, enc); err != nil { + return err + } + if len(ext) > 0 { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + return err + } + } + if wUSAssistanceInformation.extensions.Present() { + if err := wUSAssistanceInformation.extensions.MarshalPER(w, enc); err != nil { + return err + } + } + return nil +} + +func (wUSAssistanceInformation *WUSAssistanceInformation) UnmarshalPER(r *per.Reader, enc per.Encoding) error { + *wUSAssistanceInformation = WUSAssistanceInformation{} + extBit, err := r.ReadBit() + if err != nil { + return err + } + p_iEExtensions, err := r.ReadBit() + if err != nil { + return err + } + if err := (&wUSAssistanceInformation.PagingProbabilityInformation).UnmarshalPER(r, enc); err != nil { + return err + } + if p_iEExtensions { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsWUSAssistanceInformation, wUSAssistanceInformation, &wUSAssistanceInformation.iEExtensions); err != nil { + return err + } + } + if extBit { + if err := wUSAssistanceInformation.extensions.UnmarshalPER(r, enc); err != nil { + return err + } + } + return nil +} + +var extIEsWUSAssistanceInformation []apimpl.IESpec[ProtocolIEID, WUSAssistanceInformation] + +func (wUSAssistanceInformation *WUSAssistanceInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { + notComprehended := false + if wUSAssistanceInformation.PagingProbabilityInformation.Diagnose(d) { + notComprehended = true + } + apimpl.DiagnoseExtensions(d, extIEsWUSAssistanceInformation, wUSAssistanceInformation, &wUSAssistanceInformation.iEExtensions) return notComprehended } @@ -10254,7 +14819,7 @@ func (warningAreaList *WarningAreaList) UnmarshalPER(r *per.Reader, enc per.Enco return nil } -func (warningAreaList *WarningAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (warningAreaList *WarningAreaList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { switch { case warningAreaList.CellIDList != nil: return warningAreaList.CellIDList.Diagnose(d) @@ -10268,14 +14833,14 @@ func (warningAreaList *WarningAreaList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) } func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, x2TNLConfigurationInfo.iEExtensions) + ext := apimpl.ExtensionFields(extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, x2TNLConfigurationInfo.iEExtensions) w.WriteBit(x2TNLConfigurationInfo.extensions.Present()) w.WriteBit(len(ext) > 0) if err := x2TNLConfigurationInfo.ENBX2TransportLayerAddresses.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10301,7 +14866,7 @@ func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) UnmarshalPER(r *per.Reader return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, &x2TNLConfigurationInfo.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, &x2TNLConfigurationInfo.iEExtensions); err != nil { return err } } @@ -10313,11 +14878,11 @@ func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) UnmarshalPER(r *per.Reader return nil } -var extIEsX2TNLConfigurationInfo = []ap.IESpec[ProtocolIEID, X2TNLConfigurationInfo]{ +var extIEsX2TNLConfigurationInfo = []apimpl.IESpec[ProtocolIEID, X2TNLConfigurationInfo]{ { ID: IDENBX2ExtendedTransportLayerAddresses, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *X2TNLConfigurationInfo, r *per.Reader, enc per.Encoding) error { var v ENBX2ExtTLAs if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -10332,11 +14897,14 @@ var extIEsX2TNLConfigurationInfo = []ap.IESpec[ProtocolIEID, X2TNLConfigurationI } return x.ENBX2ExtendedTransportLayerAddresses, true }, + Clear: func(x *X2TNLConfigurationInfo) { + x.ENBX2ExtendedTransportLayerAddresses = nil + }, }, { ID: IDENBIndirectX2TransportLayerAddresses, - Presence: ap.PresenceOptional, - Criticality: ap.CriticalityIgnore, + Presence: apimpl.PresenceOptional, + Criticality: apimpl.CriticalityIgnore, Decode: func(x *X2TNLConfigurationInfo, r *per.Reader, enc per.Encoding) error { var v ENBX2TLAs if err := (&v).UnmarshalPER(r, enc); err != nil { @@ -10351,24 +14919,27 @@ var extIEsX2TNLConfigurationInfo = []ap.IESpec[ProtocolIEID, X2TNLConfigurationI } return x.ENBIndirectX2TransportLayerAddresses, true }, + Clear: func(x *X2TNLConfigurationInfo) { + x.ENBIndirectX2TransportLayerAddresses = nil + }, }, } -func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (x2TNLConfigurationInfo *X2TNLConfigurationInfo) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - ap.DiagnoseExtensions(d, extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, x2TNLConfigurationInfo.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEsX2TNLConfigurationInfo, x2TNLConfigurationInfo, &x2TNLConfigurationInfo.iEExtensions) return notComprehended } func (x *erabModifyItemBearerModConf) MarshalPER(w *per.Writer, enc per.Encoding) error { - ext := ap.ExtensionFields(extIEserabModifyItemBearerModConf, x, x.iEExtensions) + ext := apimpl.ExtensionFields(extIEserabModifyItemBearerModConf, x, x.iEExtensions) w.WriteBit(x.extensions.Present()) w.WriteBit(len(ext) > 0) if err := x.erabID.MarshalPER(w, enc); err != nil { return err } if len(ext) > 0 { - if err := ap.EncodeExtensionContainer(profile, w, enc, ext); err != nil { + if err := apimpl.EncodeExtensionContainer(profile, w, enc, ext); err != nil { return err } } @@ -10394,7 +14965,7 @@ func (x *erabModifyItemBearerModConf) UnmarshalPER(r *per.Reader, enc per.Encodi return err } if p_iEExtensions { - if err := ap.DecodeExtensionContainer(profile, r, enc, extIEserabModifyItemBearerModConf, x, &x.iEExtensions); err != nil { + if err := apimpl.DecodeExtensionContainer(profile, r, enc, extIEserabModifyItemBearerModConf, x, &x.iEExtensions); err != nil { return err } } @@ -10406,18 +14977,18 @@ func (x *erabModifyItemBearerModConf) UnmarshalPER(r *per.Reader, enc per.Encodi return nil } -var extIEserabModifyItemBearerModConf []ap.IESpec[ProtocolIEID, erabModifyItemBearerModConf] +var extIEserabModifyItemBearerModConf []apimpl.IESpec[ProtocolIEID, erabModifyItemBearerModConf] -func (x *erabModifyItemBearerModConf) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (x *erabModifyItemBearerModConf) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false if x.erabID.Diagnose(d) { notComprehended = true } - ap.DiagnoseExtensions(d, extIEserabModifyItemBearerModConf, x, x.iEExtensions) + apimpl.DiagnoseExtensions(d, extIEserabModifyItemBearerModConf, x, &x.iEExtensions) return notComprehended } -func (cNTypeRestrictions CNTypeRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cNTypeRestrictions CNTypeRestrictions) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range cNTypeRestrictions { if cNTypeRestrictions[i].Diagnose(d) { @@ -10427,177 +14998,67 @@ func (cNTypeRestrictions CNTypeRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIE return notComprehended } -func (cellIDBroadcast CellIDBroadcast) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range cellIDBroadcast { - if cellIDBroadcast[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (cellIDCancelled CellIDCancelled) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range cellIDCancelled { - if cellIDCancelled[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eCGIList ECGIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eCGIList { - if eCGIList[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eNBX2ExtTLAs ENBX2ExtTLAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eNBX2ExtTLAs { - if eNBX2ExtTLAs[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABAdmittedList ERABAdmittedList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eRABAdmittedList { - if eRABAdmittedList[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABInformationList ERABInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eRABInformationList { - if eRABInformationList[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABNotToBeModifiedListBearerModInd ERABNotToBeModifiedListBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eRABNotToBeModifiedListBearerModInd { - if eRABNotToBeModifiedListBearerModInd[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABSetupListBearerSURes ERABSetupListBearerSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eRABSetupListBearerSURes { - if eRABSetupListBearerSURes[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABSetupListCtxtSURes ERABSetupListCtxtSURes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eRABSetupListCtxtSURes { - if eRABSetupListCtxtSURes[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABSubjecttoDataForwardingList ERABSubjecttoDataForwardingList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eRABSubjecttoDataForwardingList { - if eRABSubjecttoDataForwardingList[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABToBeModifiedListBearerModInd ERABToBeModifiedListBearerModInd) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { - notComprehended := false - for i := range eRABToBeModifiedListBearerModInd { - if eRABToBeModifiedListBearerModInd[i].Diagnose(d) { - notComprehended = true - } - } - return notComprehended -} - -func (eRABToBeModifiedListBearerModReq ERABToBeModifiedListBearerModReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cSGIdList CSGIdList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range eRABToBeModifiedListBearerModReq { - if eRABToBeModifiedListBearerModReq[i].Diagnose(d) { + for i := range cSGIdList { + if cSGIdList[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (eRABToBeSetupListBearerSUReq ERABToBeSetupListBearerSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDBroadcast CellIDBroadcast) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range eRABToBeSetupListBearerSUReq { - if eRABToBeSetupListBearerSUReq[i].Diagnose(d) { + for i := range cellIDBroadcast { + if cellIDBroadcast[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (eRABToBeSetupListCtxtSUReq ERABToBeSetupListCtxtSUReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (cellIDCancelled CellIDCancelled) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range eRABToBeSetupListCtxtSUReq { - if eRABToBeSetupListCtxtSUReq[i].Diagnose(d) { + for i := range cellIDCancelled { + if cellIDCancelled[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (eRABToBeSetupListHOReq ERABToBeSetupListHOReq) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (connectedengNBList ConnectedengNBList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range eRABToBeSetupListHOReq { - if eRABToBeSetupListHOReq[i].Diagnose(d) { + for i := range connectedengNBList { + if connectedengNBList[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (eRABToBeSwitchedDLList ERABToBeSwitchedDLList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eCGIList ECGIList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range eRABToBeSwitchedDLList { - if eRABToBeSwitchedDLList[i].Diagnose(d) { + for i := range eCGIList { + if eCGIList[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (eRABToBeSwitchedULList ERABToBeSwitchedULList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (eNBX2ExtTLAs ENBX2ExtTLAs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range eRABToBeSwitchedULList { - if eRABToBeSwitchedULList[i].Diagnose(d) { + for i := range eNBX2ExtTLAs { + if eNBX2ExtTLAs[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (emergencyAreaIDBroadcast EmergencyAreaIDBroadcast) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDBroadcast EmergencyAreaIDBroadcast) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDBroadcast { if emergencyAreaIDBroadcast[i].Diagnose(d) { @@ -10607,7 +15068,7 @@ func (emergencyAreaIDBroadcast EmergencyAreaIDBroadcast) Diagnose(d *ap.Diagnosi return notComprehended } -func (emergencyAreaIDCancelled EmergencyAreaIDCancelled) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (emergencyAreaIDCancelled EmergencyAreaIDCancelled) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range emergencyAreaIDCancelled { if emergencyAreaIDCancelled[i].Diagnose(d) { @@ -10617,7 +15078,7 @@ func (emergencyAreaIDCancelled EmergencyAreaIDCancelled) Diagnose(d *ap.Diagnosi return notComprehended } -func (forbiddenLAs ForbiddenLAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (forbiddenLAs ForbiddenLAs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range forbiddenLAs { if forbiddenLAs[i].Diagnose(d) { @@ -10627,7 +15088,7 @@ func (forbiddenLAs ForbiddenLAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (forbiddenTAs ForbiddenTAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (forbiddenTAs ForbiddenTAs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range forbiddenTAs { if forbiddenTAs[i].Diagnose(d) { @@ -10637,7 +15098,7 @@ func (forbiddenTAs ForbiddenTAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { return notComprehended } -func (interSystemMeasurementList InterSystemMeasurementList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (interSystemMeasurementList InterSystemMeasurementList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range interSystemMeasurementList { if interSystemMeasurementList[i].Diagnose(d) { @@ -10647,7 +15108,7 @@ func (interSystemMeasurementList InterSystemMeasurementList) Diagnose(d *ap.Diag return notComprehended } -func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range lastVisitedPSCellList { if lastVisitedPSCellList[i].Diagnose(d) { @@ -10657,87 +15118,87 @@ func (lastVisitedPSCellList LastVisitedPSCellList) Diagnose(d *ap.Diagnosis[Prot return notComprehended } -func (rATRestrictions RATRestrictions) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (pC5QoSFlowList PC5QoSFlowList) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range rATRestrictions { - if rATRestrictions[i].Diagnose(d) { + for i := range pC5QoSFlowList { + if pC5QoSFlowList[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (servedGUMMEIs ServedGUMMEIs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (rATRestrictions RATRestrictions) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range servedGUMMEIs { - if servedGUMMEIs[i].Diagnose(d) { + for i := range rATRestrictions { + if rATRestrictions[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (supportedTAs SupportedTAs) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (servedDCNs ServedDCNs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range supportedTAs { - if supportedTAs[i].Diagnose(d) { + for i := range servedDCNs { + if servedDCNs[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (tAIBroadcast TAIBroadcast) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (servedGUMMEIs ServedGUMMEIs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range tAIBroadcast { - if tAIBroadcast[i].Diagnose(d) { + for i := range servedGUMMEIs { + if servedGUMMEIs[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (tAICancelled TAICancelled) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (supportedTAs SupportedTAs) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range tAICancelled { - if tAICancelled[i].Diagnose(d) { + for i := range supportedTAs { + if supportedTAs[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (tAIList TAIList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIBroadcast TAIBroadcast) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range tAIList { - if tAIList[i].Diagnose(d) { + for i := range tAIBroadcast { + if tAIBroadcast[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (tAIListforWarning TAIListforWarning) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAICancelled TAICancelled) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range tAIListforWarning { - if tAIListforWarning[i].Diagnose(d) { + for i := range tAICancelled { + if tAICancelled[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (uEAssociatedLogicalS1ConnectionListRes UEAssociatedLogicalS1ConnectionListRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (tAIListforWarning TAIListforWarning) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false - for i := range uEAssociatedLogicalS1ConnectionListRes { - if uEAssociatedLogicalS1ConnectionListRes[i].Diagnose(d) { + for i := range tAIListforWarning { + if tAIListforWarning[i].Diagnose(d) { notComprehended = true } } return notComprehended } -func (uEHistoryInformation UEHistoryInformation) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { +func (uEHistoryInformation UEHistoryInformation) Diagnose(d *apimpl.Diagnosis[ProtocolIEID]) bool { notComprehended := false for i := range uEHistoryInformation { if uEHistoryInformation[i].Diagnose(d) { @@ -10755,6 +15216,26 @@ func (allocationAndRetentionPriority AllocationAndRetentionPriority) Equal(y All return allocationAndRetentionPriority == y } +func (assistanceDataForCECapableUEs AssistanceDataForCECapableUEs) Equal(y AssistanceDataForCECapableUEs) bool { + return assistanceDataForCECapableUEs.CellIdentifierAndCELevelForCECapableUEs.Equal(y.CellIdentifierAndCELevelForCECapableUEs) && + assistanceDataForCECapableUEs.iEExtensions == y.iEExtensions && + assistanceDataForCECapableUEs.extensions == y.extensions +} + +func (assistanceDataForPaging AssistanceDataForPaging) Equal(y AssistanceDataForPaging) bool { + return (assistanceDataForPaging.AssistanceDataForRecommendedCells == nil) == (y.AssistanceDataForRecommendedCells == nil) && (assistanceDataForPaging.AssistanceDataForRecommendedCells == nil || (*assistanceDataForPaging.AssistanceDataForRecommendedCells).Equal(*y.AssistanceDataForRecommendedCells)) && + (assistanceDataForPaging.AssistanceDataForCECapableUEs == nil) == (y.AssistanceDataForCECapableUEs == nil) && (assistanceDataForPaging.AssistanceDataForCECapableUEs == nil || (*assistanceDataForPaging.AssistanceDataForCECapableUEs).Equal(*y.AssistanceDataForCECapableUEs)) && + (assistanceDataForPaging.PagingAttemptInformation == nil) == (y.PagingAttemptInformation == nil) && (assistanceDataForPaging.PagingAttemptInformation == nil || (*assistanceDataForPaging.PagingAttemptInformation).Equal(*y.PagingAttemptInformation)) && + assistanceDataForPaging.iEExtensions == y.iEExtensions && + assistanceDataForPaging.extensions == y.extensions +} + +func (assistanceDataForRecommendedCells AssistanceDataForRecommendedCells) Equal(y AssistanceDataForRecommendedCells) bool { + return assistanceDataForRecommendedCells.RecommendedCellsForPaging.Equal(y.RecommendedCellsForPaging) && + assistanceDataForRecommendedCells.iEExtensions == y.iEExtensions && + assistanceDataForRecommendedCells.extensions == y.extensions +} + func (bPLMNs BPLMNs) Equal(y BPLMNs) bool { if len(bPLMNs) != len(y) { return false @@ -10781,6 +15262,18 @@ func (broadcastCompletedAreaList BroadcastCompletedAreaList) Equal(y BroadcastCo (broadcastCompletedAreaList.Ext == nil) == (y.Ext == nil) && (broadcastCompletedAreaList.Ext == nil || (*broadcastCompletedAreaList.Ext) == *y.Ext) } +func (cELevel CELevel) Equal(y CELevel) bool { + if len(cELevel) != len(y) { + return false + } + for i := range cELevel { + if !(cELevel[i] == y[i]) { + return false + } + } + return true +} + func (cGI CGI) Equal(y CGI) bool { return cGI.PLMNIdentity == y.PLMNIdentity && cGI.LAC == y.LAC && @@ -10806,6 +15299,31 @@ func (cNTypeRestrictionsItem CNTypeRestrictionsItem) Equal(y CNTypeRestrictionsI return cNTypeRestrictionsItem == y } +func (cSGIdList CSGIdList) Equal(y CSGIdList) bool { + if len(cSGIdList) != len(y) { + return false + } + for i := range cSGIdList { + if !(cSGIdList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (cSGIdListItem CSGIdListItem) Equal(y CSGIdListItem) bool { + return cSGIdListItem == y +} + +func (cSGMembershipInfo CSGMembershipInfo) Equal(y CSGMembershipInfo) bool { + return cSGMembershipInfo.CSGMembershipStatus == y.CSGMembershipStatus && + cSGMembershipInfo.CSGId == y.CSGId && + (cSGMembershipInfo.CellAccessMode == nil) == (y.CellAccessMode == nil) && (cSGMembershipInfo.CellAccessMode == nil || (*cSGMembershipInfo.CellAccessMode) == *y.CellAccessMode) && + (cSGMembershipInfo.PLMNidentity == nil) == (y.PLMNidentity == nil) && (cSGMembershipInfo.PLMNidentity == nil || (*cSGMembershipInfo.PLMNidentity) == *y.PLMNidentity) && + cSGMembershipInfo.iEExtensions == y.iEExtensions && + cSGMembershipInfo.extensions == y.extensions +} + func (cancelledCellInEAIItem CancelledCellInEAIItem) Equal(y CancelledCellInEAIItem) bool { return cancelledCellInEAIItem == y } @@ -10855,6 +15373,13 @@ func (cellIDCancelledItem CellIDCancelledItem) Equal(y CellIDCancelledItem) bool return cellIDCancelledItem == y } +func (cellIdentifierAndCELevelForCECapableUEs CellIdentifierAndCELevelForCECapableUEs) Equal(y CellIdentifierAndCELevelForCECapableUEs) bool { + return cellIdentifierAndCELevelForCECapableUEs.GlobalCellID.Equal(y.GlobalCellID) && + cellIdentifierAndCELevelForCECapableUEs.CELevel.Equal(y.CELevel) && + cellIdentifierAndCELevelForCECapableUEs.iEExtensions == y.iEExtensions && + cellIdentifierAndCELevelForCECapableUEs.extensions == y.extensions +} + func (cellType CellType) Equal(y CellType) bool { return cellType == y } @@ -10879,6 +15404,25 @@ func (completedCellInTAIItem CompletedCellInTAIItem) Equal(y CompletedCellInTAII return completedCellInTAIItem == y } +func (connectedengNBItem ConnectedengNBItem) Equal(y ConnectedengNBItem) bool { + return connectedengNBItem.EngNBID.Equal(y.EngNBID) && + connectedengNBItem.SupportedTAs.Equal(y.SupportedTAs) && + connectedengNBItem.iEExtensions == y.iEExtensions && + connectedengNBItem.extensions == y.extensions +} + +func (connectedengNBList ConnectedengNBList) Equal(y ConnectedengNBList) bool { + if len(connectedengNBList) != len(y) { + return false + } + for i := range connectedengNBList { + if !(connectedengNBList[i].Equal(y[i])) { + return false + } + } + return true +} + func (contextatSource ContextatSource) Equal(y ContextatSource) bool { return contextatSource.SourceNGRANNodeID.Equal(y.SourceNGRANNodeID) && contextatSource.RANUENGAPID == y.RANUENGAPID && @@ -10908,6 +15452,21 @@ func (downlinkNASTransport DownlinkNASTransport) Equal(y DownlinkNASTransport) b downlinkNASTransport.ENBUES1APID == y.ENBUES1APID && downlinkNASTransport.NASPDU.Equal(y.NASPDU) && (downlinkNASTransport.CoarseUELocation == nil) == (y.CoarseUELocation == nil) && (downlinkNASTransport.CoarseUELocation == nil || (*downlinkNASTransport.CoarseUELocation).Equal(*y.CoarseUELocation)) && + (downlinkNASTransport.HandoverRestrictionList == nil) == (y.HandoverRestrictionList == nil) && (downlinkNASTransport.HandoverRestrictionList == nil || (*downlinkNASTransport.HandoverRestrictionList).Equal(*y.HandoverRestrictionList)) && + (downlinkNASTransport.SubscriberProfileIDforRFP == nil) == (y.SubscriberProfileIDforRFP == nil) && (downlinkNASTransport.SubscriberProfileIDforRFP == nil || (*downlinkNASTransport.SubscriberProfileIDforRFP) == *y.SubscriberProfileIDforRFP) && + (downlinkNASTransport.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (downlinkNASTransport.SRVCCOperationPossible == nil || (*downlinkNASTransport.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (downlinkNASTransport.UERadioCapability == nil) == (y.UERadioCapability == nil) && (downlinkNASTransport.UERadioCapability == nil || (*downlinkNASTransport.UERadioCapability).Equal(*y.UERadioCapability)) && + (downlinkNASTransport.DLNASPDUDeliveryAckRequest == nil) == (y.DLNASPDUDeliveryAckRequest == nil) && (downlinkNASTransport.DLNASPDUDeliveryAckRequest == nil || (*downlinkNASTransport.DLNASPDUDeliveryAckRequest) == *y.DLNASPDUDeliveryAckRequest) && + (downlinkNASTransport.EnhancedCoverageRestricted == nil) == (y.EnhancedCoverageRestricted == nil) && (downlinkNASTransport.EnhancedCoverageRestricted == nil || (*downlinkNASTransport.EnhancedCoverageRestricted) == *y.EnhancedCoverageRestricted) && + (downlinkNASTransport.NRUESecurityCapabilities == nil) == (y.NRUESecurityCapabilities == nil) && (downlinkNASTransport.NRUESecurityCapabilities == nil || (*downlinkNASTransport.NRUESecurityCapabilities).Equal(*y.NRUESecurityCapabilities)) && + (downlinkNASTransport.CEModeBRestricted == nil) == (y.CEModeBRestricted == nil) && (downlinkNASTransport.CEModeBRestricted == nil || (*downlinkNASTransport.CEModeBRestricted) == *y.CEModeBRestricted) && + (downlinkNASTransport.UECapabilityInfoRequest == nil) == (y.UECapabilityInfoRequest == nil) && (downlinkNASTransport.UECapabilityInfoRequest == nil || (*downlinkNASTransport.UECapabilityInfoRequest) == *y.UECapabilityInfoRequest) && + (downlinkNASTransport.EndIndication == nil) == (y.EndIndication == nil) && (downlinkNASTransport.EndIndication == nil || (*downlinkNASTransport.EndIndication) == *y.EndIndication) && + (downlinkNASTransport.PendingDataIndication == nil) == (y.PendingDataIndication == nil) && (downlinkNASTransport.PendingDataIndication == nil || (*downlinkNASTransport.PendingDataIndication) == *y.PendingDataIndication) && + (downlinkNASTransport.SubscriptionBasedUEDifferentiationInfo == nil) == (y.SubscriptionBasedUEDifferentiationInfo == nil) && (downlinkNASTransport.SubscriptionBasedUEDifferentiationInfo == nil || (*downlinkNASTransport.SubscriptionBasedUEDifferentiationInfo).Equal(*y.SubscriptionBasedUEDifferentiationInfo)) && + (downlinkNASTransport.AdditionalRRMPriorityIndex == nil) == (y.AdditionalRRMPriorityIndex == nil) && (downlinkNASTransport.AdditionalRRMPriorityIndex == nil || (*downlinkNASTransport.AdditionalRRMPriorityIndex) == *y.AdditionalRRMPriorityIndex) && + (downlinkNASTransport.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (downlinkNASTransport.UERadioCapabilityID == nil || (*downlinkNASTransport.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && + (downlinkNASTransport.MaskedIMEISV == nil) == (y.MaskedIMEISV == nil) && (downlinkNASTransport.MaskedIMEISV == nil || (*downlinkNASTransport.MaskedIMEISV) == *y.MaskedIMEISV) && downlinkNASTransport.messageMeta.Equal(y.messageMeta) } @@ -10939,6 +15498,8 @@ func (eCGIList ECGIList) Equal(y ECGIList) bool { func (eNBConfigurationTransfer ENBConfigurationTransfer) Equal(y ENBConfigurationTransfer) bool { return (eNBConfigurationTransfer.SONConfigurationTransfer == nil) == (y.SONConfigurationTransfer == nil) && (eNBConfigurationTransfer.SONConfigurationTransfer == nil || (*eNBConfigurationTransfer.SONConfigurationTransfer).Equal(*y.SONConfigurationTransfer)) && + (eNBConfigurationTransfer.ENDCSONConfigurationTransferECT == nil) == (y.ENDCSONConfigurationTransferECT == nil) && (eNBConfigurationTransfer.ENDCSONConfigurationTransferECT == nil || (*eNBConfigurationTransfer.ENDCSONConfigurationTransferECT).Equal(*y.ENDCSONConfigurationTransferECT)) && + (eNBConfigurationTransfer.IntersystemSONConfigurationTransferECT == nil) == (y.IntersystemSONConfigurationTransferECT == nil) && (eNBConfigurationTransfer.IntersystemSONConfigurationTransferECT == nil || (*eNBConfigurationTransfer.IntersystemSONConfigurationTransferECT).Equal(*y.IntersystemSONConfigurationTransferECT)) && eNBConfigurationTransfer.messageMeta.Equal(y.messageMeta) } @@ -10946,6 +15507,10 @@ func (eNBConfigurationUpdate ENBConfigurationUpdate) Equal(y ENBConfigurationUpd return (eNBConfigurationUpdate.ENBName == nil) == (y.ENBName == nil) && (eNBConfigurationUpdate.ENBName == nil || (*eNBConfigurationUpdate.ENBName) == *y.ENBName) && eNBConfigurationUpdate.SupportedTAs.Equal(y.SupportedTAs) && (eNBConfigurationUpdate.DefaultPagingDRX == nil) == (y.DefaultPagingDRX == nil) && (eNBConfigurationUpdate.DefaultPagingDRX == nil || (*eNBConfigurationUpdate.DefaultPagingDRX) == *y.DefaultPagingDRX) && + eNBConfigurationUpdate.CSGIdList.Equal(y.CSGIdList) && + (eNBConfigurationUpdate.NBIoTDefaultPagingDRX == nil) == (y.NBIoTDefaultPagingDRX == nil) && (eNBConfigurationUpdate.NBIoTDefaultPagingDRX == nil || (*eNBConfigurationUpdate.NBIoTDefaultPagingDRX) == *y.NBIoTDefaultPagingDRX) && + eNBConfigurationUpdate.ConnectedengNBToAddList.Equal(y.ConnectedengNBToAddList) && + eNBConfigurationUpdate.ConnectedengNBToRemoveList.Equal(y.ConnectedengNBToRemoveList) && eNBConfigurationUpdate.messageMeta.Equal(y.messageMeta) } @@ -11019,6 +15584,48 @@ func (eNBX2TLAs ENBX2TLAs) Equal(y ENBX2TLAs) bool { return true } +func (eNDCSONConfigurationTransfer ENDCSONConfigurationTransfer) Equal(y ENDCSONConfigurationTransfer) bool { + return eNDCSONConfigurationTransfer.Transfertype.Equal(y.Transfertype) && + eNDCSONConfigurationTransfer.SONInformation.Equal(y.SONInformation) && + (eNDCSONConfigurationTransfer.X2TNLConfigInfo == nil) == (y.X2TNLConfigInfo == nil) && (eNDCSONConfigurationTransfer.X2TNLConfigInfo == nil || (*eNDCSONConfigurationTransfer.X2TNLConfigInfo).Equal(*y.X2TNLConfigInfo)) && + eNDCSONConfigurationTransfer.iEExtensions == y.iEExtensions && + eNDCSONConfigurationTransfer.extensions == y.extensions +} + +func (eNDCSONTransferType ENDCSONTransferType) Equal(y ENDCSONTransferType) bool { + return (eNDCSONTransferType.Request == nil) == (y.Request == nil) && (eNDCSONTransferType.Request == nil || (*eNDCSONTransferType.Request).Equal(*y.Request)) && + (eNDCSONTransferType.Reply == nil) == (y.Reply == nil) && (eNDCSONTransferType.Reply == nil || (*eNDCSONTransferType.Reply).Equal(*y.Reply)) && + (eNDCSONTransferType.Ext == nil) == (y.Ext == nil) && (eNDCSONTransferType.Ext == nil || (*eNDCSONTransferType.Ext) == *y.Ext) +} + +func (eNDCSONeNBIdentification ENDCSONeNBIdentification) Equal(y ENDCSONeNBIdentification) bool { + return eNDCSONeNBIdentification.GlobaleNBID.Equal(y.GlobaleNBID) && + eNDCSONeNBIdentification.SelectedTAI.Equal(y.SelectedTAI) && + eNDCSONeNBIdentification.iEExtensions == y.iEExtensions && + eNDCSONeNBIdentification.extensions == y.extensions +} + +func (eNDCSONengNBIdentification ENDCSONengNBIdentification) Equal(y ENDCSONengNBIdentification) bool { + return eNDCSONengNBIdentification == y +} + +func (eNDCTransferTypeReply ENDCTransferTypeReply) Equal(y ENDCTransferTypeReply) bool { + return eNDCTransferTypeReply.SourceengNB.Equal(y.SourceengNB) && + eNDCTransferTypeReply.TargeteNB.Equal(y.TargeteNB) && + eNDCTransferTypeReply.iEExtensions == y.iEExtensions && + eNDCTransferTypeReply.extensions == y.extensions +} + +func (eNDCTransferTypeRequest ENDCTransferTypeRequest) Equal(y ENDCTransferTypeRequest) bool { + return eNDCTransferTypeRequest.SourceeNB.Equal(y.SourceeNB) && + eNDCTransferTypeRequest.TargetengNB.Equal(y.TargetengNB) && + (eNDCTransferTypeRequest.TargeteNB == nil) == (y.TargeteNB == nil) && (eNDCTransferTypeRequest.TargeteNB == nil || (*eNDCTransferTypeRequest.TargeteNB).Equal(*y.TargeteNB)) && + (eNDCTransferTypeRequest.AssociatedTAI == nil) == (y.AssociatedTAI == nil) && (eNDCTransferTypeRequest.AssociatedTAI == nil || (*eNDCTransferTypeRequest.AssociatedTAI).Equal(*y.AssociatedTAI)) && + (eNDCTransferTypeRequest.Broadcast5GSTAI == nil) == (y.Broadcast5GSTAI == nil) && (eNDCTransferTypeRequest.Broadcast5GSTAI == nil || (*eNDCTransferTypeRequest.Broadcast5GSTAI).Equal(*y.Broadcast5GSTAI)) && + eNDCTransferTypeRequest.iEExtensions == y.iEExtensions && + eNDCTransferTypeRequest.extensions == y.extensions +} + func (ePLMNs EPLMNs) Equal(y EPLMNs) bool { if len(ePLMNs) != len(y) { return false @@ -11087,14 +15694,16 @@ func (eRABInformationListItem ERABInformationListItem) Equal(y ERABInformationLi (eRABInformationListItem.SecurityIndication == nil) == (y.SecurityIndication == nil) && (eRABInformationListItem.SecurityIndication == nil || (*eRABInformationListItem.SecurityIndication).Equal(*y.SecurityIndication)) && (eRABInformationListItem.SourceNodeTransportLayerAddress == nil) == (y.SourceNodeTransportLayerAddress == nil) && (eRABInformationListItem.SourceNodeTransportLayerAddress == nil || (*eRABInformationListItem.SourceNodeTransportLayerAddress) == *y.SourceNodeTransportLayerAddress) && eRABInformationListItem.iEExtensions == y.iEExtensions && - eRABInformationListItem.extensions == y.extensions + eRABInformationListItem.extensions == y.extensions && + eRABInformationListItem.containerCrit == y.containerCrit } func (eRABItem ERABItem) Equal(y ERABItem) bool { return eRABItem.extensions == y.extensions && eRABItem.ERABID == y.ERABID && eRABItem.Cause.Equal(y.Cause) && - eRABItem.iEExtensions == y.iEExtensions + eRABItem.iEExtensions == y.iEExtensions && + eRABItem.containerCrit == y.containerCrit } func (eRABLevelQoSParameters ERABLevelQoSParameters) Equal(y ERABLevelQoSParameters) bool { @@ -11114,6 +15723,7 @@ func (eRABModificationConfirm ERABModificationConfirm) Equal(y ERABModificationC slices.EqualFunc(eRABModificationConfirm.FailedToModify, y.FailedToModify, ERABItem.Equal) && slices.EqualFunc(eRABModificationConfirm.ToBeReleased, y.ToBeReleased, ERABItem.Equal) && (eRABModificationConfirm.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eRABModificationConfirm.CriticalityDiagnostics == nil || (*eRABModificationConfirm.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (eRABModificationConfirm.CSGMembershipStatus == nil) == (y.CSGMembershipStatus == nil) && (eRABModificationConfirm.CSGMembershipStatus == nil || (*eRABModificationConfirm.CSGMembershipStatus) == *y.CSGMembershipStatus) && eRABModificationConfirm.messageMeta.Equal(y.messageMeta) } @@ -11124,6 +15734,8 @@ func (eRABModificationIndication ERABModificationIndication) Equal(y ERABModific eRABModificationIndication.NotToBeModified.Equal(y.NotToBeModified) && (eRABModificationIndication.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABModificationIndication.UserLocationInformation == nil || (*eRABModificationIndication.UserLocationInformation).Equal(*y.UserLocationInformation)) && (eRABModificationIndication.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (eRABModificationIndication.TunnelInformationForBBF == nil || (*eRABModificationIndication.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && + (eRABModificationIndication.CSGMembershipInfo == nil) == (y.CSGMembershipInfo == nil) && (eRABModificationIndication.CSGMembershipInfo == nil || (*eRABModificationIndication.CSGMembershipInfo).Equal(*y.CSGMembershipInfo)) && + eRABModificationIndication.SecondaryRATDataUsageReportList.Equal(y.SecondaryRATDataUsageReportList) && eRABModificationIndication.messageMeta.Equal(y.messageMeta) } @@ -11136,6 +15748,7 @@ func (eRABModifyRequest ERABModifyRequest) Equal(y ERABModifyRequest) bool { eRABModifyRequest.ENBUES1APID == y.ENBUES1APID && (eRABModifyRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (eRABModifyRequest.UEAggregateMaximumBitRate == nil || (*eRABModifyRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && eRABModifyRequest.ERABToBeModified.Equal(y.ERABToBeModified) && + (eRABModifyRequest.SecondaryRATDataUsageRequest == nil) == (y.SecondaryRATDataUsageRequest == nil) && (eRABModifyRequest.SecondaryRATDataUsageRequest == nil || (*eRABModifyRequest.SecondaryRATDataUsageRequest) == *y.SecondaryRATDataUsageRequest) && eRABModifyRequest.messageMeta.Equal(y.messageMeta) } @@ -11146,9 +15759,14 @@ func (eRABModifyResponse ERABModifyResponse) Equal(y ERABModifyResponse) bool { slices.EqualFunc(eRABModifyResponse.ERABFailedToModify, y.ERABFailedToModify, ERABItem.Equal) && (eRABModifyResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eRABModifyResponse.CriticalityDiagnostics == nil || (*eRABModifyResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && (eRABModifyResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABModifyResponse.UserLocationInformation == nil || (*eRABModifyResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + eRABModifyResponse.SecondaryRATDataUsageReportList.Equal(y.SecondaryRATDataUsageReportList) && eRABModifyResponse.messageMeta.Equal(y.messageMeta) } +func (eRABNotToBeModifiedItemBearerModInd ERABNotToBeModifiedItemBearerModInd) Equal(y ERABNotToBeModifiedItemBearerModInd) bool { + return eRABNotToBeModifiedItemBearerModInd == y +} + func (eRABNotToBeModifiedListBearerModInd ERABNotToBeModifiedListBearerModInd) Equal(y ERABNotToBeModifiedListBearerModInd) bool { if len(eRABNotToBeModifiedListBearerModInd) != len(y) { return false @@ -11175,6 +15793,7 @@ func (eRABReleaseIndication ERABReleaseIndication) Equal(y ERABReleaseIndication eRABReleaseIndication.ENBUES1APID == y.ENBUES1APID && slices.EqualFunc(eRABReleaseIndication.ERABReleased, y.ERABReleased, ERABItem.Equal) && (eRABReleaseIndication.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABReleaseIndication.UserLocationInformation == nil || (*eRABReleaseIndication.UserLocationInformation).Equal(*y.UserLocationInformation)) && + eRABReleaseIndication.SecondaryRATDataUsageReportList.Equal(y.SecondaryRATDataUsageReportList) && eRABReleaseIndication.messageMeta.Equal(y.messageMeta) } @@ -11189,9 +15808,14 @@ func (eRABReleaseResponse ERABReleaseResponse) Equal(y ERABReleaseResponse) bool slices.EqualFunc(eRABReleaseResponse.ERABFailedToRelease, y.ERABFailedToRelease, ERABItem.Equal) && (eRABReleaseResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (eRABReleaseResponse.CriticalityDiagnostics == nil || (*eRABReleaseResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && (eRABReleaseResponse.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (eRABReleaseResponse.UserLocationInformation == nil || (*eRABReleaseResponse.UserLocationInformation).Equal(*y.UserLocationInformation)) && + eRABReleaseResponse.SecondaryRATDataUsageReportList.Equal(y.SecondaryRATDataUsageReportList) && eRABReleaseResponse.messageMeta.Equal(y.messageMeta) } +func (eRABSetupItemBearerSURes ERABSetupItemBearerSURes) Equal(y ERABSetupItemBearerSURes) bool { + return eRABSetupItemBearerSURes == y +} + func (eRABSetupItemCtxtSURes ERABSetupItemCtxtSURes) Equal(y ERABSetupItemCtxtSURes) bool { return eRABSetupItemCtxtSURes == y } @@ -11408,6 +16032,72 @@ func (eRABToBeSwitchedULList ERABToBeSwitchedULList) Equal(y ERABToBeSwitchedULL return true } +func (eRABToBeUpdatedItem ERABToBeUpdatedItem) Equal(y ERABToBeUpdatedItem) bool { + return eRABToBeUpdatedItem.ERABID == y.ERABID && + (eRABToBeUpdatedItem.SecurityIndication == nil) == (y.SecurityIndication == nil) && (eRABToBeUpdatedItem.SecurityIndication == nil || (*eRABToBeUpdatedItem.SecurityIndication).Equal(*y.SecurityIndication)) && + eRABToBeUpdatedItem.iEExtensions == y.iEExtensions && + eRABToBeUpdatedItem.extensions == y.extensions && + eRABToBeUpdatedItem.containerCrit == y.containerCrit +} + +func (eRABToBeUpdatedList ERABToBeUpdatedList) Equal(y ERABToBeUpdatedList) bool { + if len(eRABToBeUpdatedList) != len(y) { + return false + } + for i := range eRABToBeUpdatedList { + if !(eRABToBeUpdatedList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (eRABUsageReportItem ERABUsageReportItem) Equal(y ERABUsageReportItem) bool { + return eRABUsageReportItem.StartTimestamp.Equal(y.StartTimestamp) && + eRABUsageReportItem.EndTimestamp.Equal(y.EndTimestamp) && + eRABUsageReportItem.UsageCountUL == y.UsageCountUL && + eRABUsageReportItem.UsageCountDL == y.UsageCountDL && + eRABUsageReportItem.iEExtensions == y.iEExtensions && + eRABUsageReportItem.extensions == y.extensions && + eRABUsageReportItem.containerCrit == y.containerCrit +} + +func (eRABUsageReportItemEndTimestamp ERABUsageReportItemEndTimestamp) Equal(y ERABUsageReportItemEndTimestamp) bool { + if len(eRABUsageReportItemEndTimestamp) != len(y) { + return false + } + for i := range eRABUsageReportItemEndTimestamp { + if !(eRABUsageReportItemEndTimestamp[i] == y[i]) { + return false + } + } + return true +} + +func (eRABUsageReportItemStartTimestamp ERABUsageReportItemStartTimestamp) Equal(y ERABUsageReportItemStartTimestamp) bool { + if len(eRABUsageReportItemStartTimestamp) != len(y) { + return false + } + for i := range eRABUsageReportItemStartTimestamp { + if !(eRABUsageReportItemStartTimestamp[i] == y[i]) { + return false + } + } + return true +} + +func (eRABUsageReportList ERABUsageReportList) Equal(y ERABUsageReportList) bool { + if len(eRABUsageReportList) != len(y) { + return false + } + for i := range eRABUsageReportList { + if !(eRABUsageReportList[i].Equal(y[i])) { + return false + } + } + return true +} + func (eUTRANCGI EUTRANCGI) Equal(y EUTRANCGI) bool { return eUTRANCGI == y } @@ -11462,6 +16152,10 @@ func (emergencyAreaIDList EmergencyAreaIDList) Equal(y EmergencyAreaIDList) bool return true } +func (engNBID EngNBID) Equal(y EngNBID) bool { + return engNBID == y +} + func (errorIndication ErrorIndication) Equal(y ErrorIndication) bool { return (errorIndication.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (errorIndication.MMEUES1APID == nil || (*errorIndication.MMEUES1APID) == *y.MMEUES1APID) && (errorIndication.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (errorIndication.ENBUES1APID == nil || (*errorIndication.ENBUES1APID) == *y.ENBUES1APID) && @@ -11471,6 +16165,21 @@ func (errorIndication ErrorIndication) Equal(y ErrorIndication) bool { errorIndication.messageMeta.Equal(y.messageMeta) } +func (expectedUEActivityBehaviour ExpectedUEActivityBehaviour) Equal(y ExpectedUEActivityBehaviour) bool { + return (expectedUEActivityBehaviour.ExpectedActivityPeriod == nil) == (y.ExpectedActivityPeriod == nil) && (expectedUEActivityBehaviour.ExpectedActivityPeriod == nil || (*expectedUEActivityBehaviour.ExpectedActivityPeriod) == *y.ExpectedActivityPeriod) && + (expectedUEActivityBehaviour.ExpectedIdlePeriod == nil) == (y.ExpectedIdlePeriod == nil) && (expectedUEActivityBehaviour.ExpectedIdlePeriod == nil || (*expectedUEActivityBehaviour.ExpectedIdlePeriod) == *y.ExpectedIdlePeriod) && + (expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation == nil) == (y.SourceofUEActivityBehaviourInformation == nil) && (expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation == nil || (*expectedUEActivityBehaviour.SourceofUEActivityBehaviourInformation) == *y.SourceofUEActivityBehaviourInformation) && + expectedUEActivityBehaviour.iEExtensions == y.iEExtensions && + expectedUEActivityBehaviour.extensions == y.extensions +} + +func (expectedUEBehaviour ExpectedUEBehaviour) Equal(y ExpectedUEBehaviour) bool { + return (expectedUEBehaviour.ExpectedActivity == nil) == (y.ExpectedActivity == nil) && (expectedUEBehaviour.ExpectedActivity == nil || (*expectedUEBehaviour.ExpectedActivity).Equal(*y.ExpectedActivity)) && + (expectedUEBehaviour.ExpectedHOInterval == nil) == (y.ExpectedHOInterval == nil) && (expectedUEBehaviour.ExpectedHOInterval == nil || (*expectedUEBehaviour.ExpectedHOInterval) == *y.ExpectedHOInterval) && + expectedUEBehaviour.iEExtensions == y.iEExtensions && + expectedUEBehaviour.extensions == y.extensions +} + func (fiveGSTAI FiveGSTAI) Equal(y FiveGSTAI) bool { return fiveGSTAI == y } @@ -11589,6 +16298,10 @@ func (globalRANNodeID GlobalRANNodeID) Equal(y GlobalRANNodeID) bool { (globalRANNodeID.Ext == nil) == (y.Ext == nil) && (globalRANNodeID.Ext == nil || (*globalRANNodeID.Ext) == *y.Ext) } +func (globalengNBID GlobalengNBID) Equal(y GlobalengNBID) bool { + return globalengNBID == y +} + func (handoverCancel HandoverCancel) Equal(y HandoverCancel) bool { return handoverCancel.MMEUES1APID == y.MMEUES1APID && handoverCancel.ENBUES1APID == y.ENBUES1APID && @@ -11612,6 +16325,7 @@ func (handoverCommand HandoverCommand) Equal(y HandoverCommand) bool { slices.EqualFunc(handoverCommand.ERABToRelease, y.ERABToRelease, ERABItem.Equal) && handoverCommand.TargetToSource.Equal(y.TargetToSource) && (handoverCommand.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverCommand.CriticalityDiagnostics == nil || (*handoverCommand.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (handoverCommand.TargetToSourceTransparentContainerSecondary == nil) == (y.TargetToSourceTransparentContainerSecondary == nil) && (handoverCommand.TargetToSourceTransparentContainerSecondary == nil || (*handoverCommand.TargetToSourceTransparentContainerSecondary).Equal(*y.TargetToSourceTransparentContainerSecondary)) && handoverCommand.messageMeta.Equal(y.messageMeta) } @@ -11628,6 +16342,10 @@ func (handoverNotify HandoverNotify) Equal(y HandoverNotify) bool { (handoverNotify.EUTRANCGI == nil) == (y.EUTRANCGI == nil) && (handoverNotify.EUTRANCGI == nil || (*handoverNotify.EUTRANCGI).Equal(*y.EUTRANCGI)) && (handoverNotify.TAI == nil) == (y.TAI == nil) && (handoverNotify.TAI == nil || (*handoverNotify.TAI).Equal(*y.TAI)) && (handoverNotify.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (handoverNotify.TunnelInformationForBBF == nil || (*handoverNotify.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && + (handoverNotify.LHNID == nil) == (y.LHNID == nil) && (handoverNotify.LHNID == nil || (*handoverNotify.LHNID).Equal(*y.LHNID)) && + (handoverNotify.PSCellInformation == nil) == (y.PSCellInformation == nil) && (handoverNotify.PSCellInformation == nil || (*handoverNotify.PSCellInformation).Equal(*y.PSCellInformation)) && + (handoverNotify.NotifySourceeNB == nil) == (y.NotifySourceeNB == nil) && (handoverNotify.NotifySourceeNB == nil || (*handoverNotify.NotifySourceeNB) == *y.NotifySourceeNB) && + (handoverNotify.LTENTNTAIInformation == nil) == (y.LTENTNTAIInformation == nil) && (handoverNotify.LTENTNTAIInformation == nil || (*handoverNotify.LTENTNTAIInformation).Equal(*y.LTENTNTAIInformation)) && handoverNotify.messageMeta.Equal(y.messageMeta) } @@ -11654,6 +16372,30 @@ func (handoverRequest HandoverRequest) Equal(y HandoverRequest) bool { (handoverRequest.GUMMEI == nil) == (y.GUMMEI == nil) && (handoverRequest.GUMMEI == nil || (*handoverRequest.GUMMEI).Equal(*y.GUMMEI)) && (handoverRequest.MMEUES1APID2 == nil) == (y.MMEUES1APID2 == nil) && (handoverRequest.MMEUES1APID2 == nil || (*handoverRequest.MMEUES1APID2) == *y.MMEUES1APID2) && (handoverRequest.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (handoverRequest.TimeRefDistribution == nil || (*handoverRequest.TimeRefDistribution) == *y.TimeRefDistribution) && + (handoverRequest.RequestType == nil) == (y.RequestType == nil) && (handoverRequest.RequestType == nil || (*handoverRequest.RequestType).Equal(*y.RequestType)) && + (handoverRequest.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (handoverRequest.SRVCCOperationPossible == nil || (*handoverRequest.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (handoverRequest.CSGId == nil) == (y.CSGId == nil) && (handoverRequest.CSGId == nil || (*handoverRequest.CSGId) == *y.CSGId) && + (handoverRequest.CSGMembershipStatus == nil) == (y.CSGMembershipStatus == nil) && (handoverRequest.CSGMembershipStatus == nil || (*handoverRequest.CSGMembershipStatus) == *y.CSGMembershipStatus) && + (handoverRequest.ManagementBasedMDTAllowed == nil) == (y.ManagementBasedMDTAllowed == nil) && (handoverRequest.ManagementBasedMDTAllowed == nil || (*handoverRequest.ManagementBasedMDTAllowed) == *y.ManagementBasedMDTAllowed) && + handoverRequest.ManagementBasedMDTPLMNList.Equal(y.ManagementBasedMDTPLMNList) && + (handoverRequest.MaskedIMEISV == nil) == (y.MaskedIMEISV == nil) && (handoverRequest.MaskedIMEISV == nil || (*handoverRequest.MaskedIMEISV) == *y.MaskedIMEISV) && + (handoverRequest.ExpectedUEBehaviour == nil) == (y.ExpectedUEBehaviour == nil) && (handoverRequest.ExpectedUEBehaviour == nil || (*handoverRequest.ExpectedUEBehaviour).Equal(*y.ExpectedUEBehaviour)) && + (handoverRequest.ProSeAuthorized == nil) == (y.ProSeAuthorized == nil) && (handoverRequest.ProSeAuthorized == nil || (*handoverRequest.ProSeAuthorized).Equal(*y.ProSeAuthorized)) && + (handoverRequest.UEUserPlaneCIoTSupportIndicator == nil) == (y.UEUserPlaneCIoTSupportIndicator == nil) && (handoverRequest.UEUserPlaneCIoTSupportIndicator == nil || (*handoverRequest.UEUserPlaneCIoTSupportIndicator) == *y.UEUserPlaneCIoTSupportIndicator) && + (handoverRequest.V2XServicesAuthorized == nil) == (y.V2XServicesAuthorized == nil) && (handoverRequest.V2XServicesAuthorized == nil || (*handoverRequest.V2XServicesAuthorized).Equal(*y.V2XServicesAuthorized)) && + (handoverRequest.UESidelinkAggregateMaximumBitrate == nil) == (y.UESidelinkAggregateMaximumBitrate == nil) && (handoverRequest.UESidelinkAggregateMaximumBitrate == nil || (*handoverRequest.UESidelinkAggregateMaximumBitrate).Equal(*y.UESidelinkAggregateMaximumBitrate)) && + (handoverRequest.EnhancedCoverageRestricted == nil) == (y.EnhancedCoverageRestricted == nil) && (handoverRequest.EnhancedCoverageRestricted == nil || (*handoverRequest.EnhancedCoverageRestricted) == *y.EnhancedCoverageRestricted) && + (handoverRequest.NRUESecurityCapabilities == nil) == (y.NRUESecurityCapabilities == nil) && (handoverRequest.NRUESecurityCapabilities == nil || (*handoverRequest.NRUESecurityCapabilities).Equal(*y.NRUESecurityCapabilities)) && + (handoverRequest.CEModeBRestricted == nil) == (y.CEModeBRestricted == nil) && (handoverRequest.CEModeBRestricted == nil || (*handoverRequest.CEModeBRestricted) == *y.CEModeBRestricted) && + (handoverRequest.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (handoverRequest.AerialUEsubscriptionInformation == nil || (*handoverRequest.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (handoverRequest.PendingDataIndication == nil) == (y.PendingDataIndication == nil) && (handoverRequest.PendingDataIndication == nil || (*handoverRequest.PendingDataIndication) == *y.PendingDataIndication) && + (handoverRequest.SubscriptionBasedUEDifferentiationInfo == nil) == (y.SubscriptionBasedUEDifferentiationInfo == nil) && (handoverRequest.SubscriptionBasedUEDifferentiationInfo == nil || (*handoverRequest.SubscriptionBasedUEDifferentiationInfo).Equal(*y.SubscriptionBasedUEDifferentiationInfo)) && + (handoverRequest.AdditionalRRMPriorityIndex == nil) == (y.AdditionalRRMPriorityIndex == nil) && (handoverRequest.AdditionalRRMPriorityIndex == nil || (*handoverRequest.AdditionalRRMPriorityIndex) == *y.AdditionalRRMPriorityIndex) && + (handoverRequest.IABAuthorized == nil) == (y.IABAuthorized == nil) && (handoverRequest.IABAuthorized == nil || (*handoverRequest.IABAuthorized) == *y.IABAuthorized) && + (handoverRequest.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (handoverRequest.NRV2XServicesAuthorized == nil || (*handoverRequest.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (handoverRequest.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (handoverRequest.NRUESidelinkAggregateMaximumBitrate == nil || (*handoverRequest.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (handoverRequest.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (handoverRequest.PC5QoSParameters == nil || (*handoverRequest.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (handoverRequest.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (handoverRequest.UERadioCapabilityID == nil || (*handoverRequest.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && handoverRequest.messageMeta.Equal(y.messageMeta) } @@ -11664,6 +16406,9 @@ func (handoverRequestAcknowledge HandoverRequestAcknowledge) Equal(y HandoverReq slices.EqualFunc(handoverRequestAcknowledge.ERABFailedToSetup, y.ERABFailedToSetup, ERABItem.Equal) && handoverRequestAcknowledge.TargetToSource.Equal(y.TargetToSource) && (handoverRequestAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (handoverRequestAcknowledge.CriticalityDiagnostics == nil || (*handoverRequestAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (handoverRequestAcknowledge.CSGId == nil) == (y.CSGId == nil) && (handoverRequestAcknowledge.CSGId == nil || (*handoverRequestAcknowledge.CSGId) == *y.CSGId) && + (handoverRequestAcknowledge.CellAccessMode == nil) == (y.CellAccessMode == nil) && (handoverRequestAcknowledge.CellAccessMode == nil || (*handoverRequestAcknowledge.CellAccessMode) == *y.CellAccessMode) && + (handoverRequestAcknowledge.CEmodeBSupportIndicator == nil) == (y.CEmodeBSupportIndicator == nil) && (handoverRequestAcknowledge.CEmodeBSupportIndicator == nil || (*handoverRequestAcknowledge.CEmodeBSupportIndicator) == *y.CEmodeBSupportIndicator) && handoverRequestAcknowledge.messageMeta.Equal(y.messageMeta) } @@ -11675,6 +16420,13 @@ func (handoverRequired HandoverRequired) Equal(y HandoverRequired) bool { handoverRequired.TargetID.Equal(y.TargetID) && (handoverRequired.DirectForwardingPathAvailability == nil) == (y.DirectForwardingPathAvailability == nil) && (handoverRequired.DirectForwardingPathAvailability == nil || (*handoverRequired.DirectForwardingPathAvailability) == *y.DirectForwardingPathAvailability) && handoverRequired.SourceToTarget.Equal(y.SourceToTarget) && + (handoverRequired.SRVCCHOIndication == nil) == (y.SRVCCHOIndication == nil) && (handoverRequired.SRVCCHOIndication == nil || (*handoverRequired.SRVCCHOIndication) == *y.SRVCCHOIndication) && + (handoverRequired.SourceToTargetTransparentContainerSecondary == nil) == (y.SourceToTargetTransparentContainerSecondary == nil) && (handoverRequired.SourceToTargetTransparentContainerSecondary == nil || (*handoverRequired.SourceToTargetTransparentContainerSecondary).Equal(*y.SourceToTargetTransparentContainerSecondary)) && + (handoverRequired.MSClassmark2 == nil) == (y.MSClassmark2 == nil) && (handoverRequired.MSClassmark2 == nil || (*handoverRequired.MSClassmark2).Equal(*y.MSClassmark2)) && + (handoverRequired.MSClassmark3 == nil) == (y.MSClassmark3 == nil) && (handoverRequired.MSClassmark3 == nil || (*handoverRequired.MSClassmark3).Equal(*y.MSClassmark3)) && + (handoverRequired.CSGId == nil) == (y.CSGId == nil) && (handoverRequired.CSGId == nil || (*handoverRequired.CSGId) == *y.CSGId) && + (handoverRequired.CellAccessMode == nil) == (y.CellAccessMode == nil) && (handoverRequired.CellAccessMode == nil || (*handoverRequired.CellAccessMode) == *y.CellAccessMode) && + (handoverRequired.PSServiceNotAvailable == nil) == (y.PSServiceNotAvailable == nil) && (handoverRequired.PSServiceNotAvailable == nil || (*handoverRequired.PSServiceNotAvailable) == *y.PSServiceNotAvailable) && handoverRequired.messageMeta.Equal(y.messageMeta) } @@ -11706,6 +16458,13 @@ func (iMSI IMSI) Equal(y IMSI) bool { return true } +func (informationOnRecommendedCellsAndENBsForPaging InformationOnRecommendedCellsAndENBsForPaging) Equal(y InformationOnRecommendedCellsAndENBsForPaging) bool { + return informationOnRecommendedCellsAndENBsForPaging.RecommendedCellsForPaging.Equal(y.RecommendedCellsForPaging) && + informationOnRecommendedCellsAndENBsForPaging.RecommendENBsForPaging.Equal(y.RecommendENBsForPaging) && + informationOnRecommendedCellsAndENBsForPaging.iEExtensions == y.iEExtensions && + informationOnRecommendedCellsAndENBsForPaging.extensions == y.extensions +} + func (initialContextSetupFailure InitialContextSetupFailure) Equal(y InitialContextSetupFailure) bool { return (initialContextSetupFailure.MMEUES1APID == nil) == (y.MMEUES1APID == nil) && (initialContextSetupFailure.MMEUES1APID == nil || (*initialContextSetupFailure.MMEUES1APID) == *y.MMEUES1APID) && (initialContextSetupFailure.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (initialContextSetupFailure.ENBUES1APID == nil || (*initialContextSetupFailure.ENBUES1APID) == *y.ENBUES1APID) && @@ -11726,6 +16485,34 @@ func (initialContextSetupRequest InitialContextSetupRequest) Equal(y InitialCont (initialContextSetupRequest.MMEUES1APID2 == nil) == (y.MMEUES1APID2 == nil) && (initialContextSetupRequest.MMEUES1APID2 == nil || (*initialContextSetupRequest.MMEUES1APID2) == *y.MMEUES1APID2) && (initialContextSetupRequest.CoarseUELocation == nil) == (y.CoarseUELocation == nil) && (initialContextSetupRequest.CoarseUELocation == nil || (*initialContextSetupRequest.CoarseUELocation).Equal(*y.CoarseUELocation)) && (initialContextSetupRequest.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (initialContextSetupRequest.TimeRefDistribution == nil || (*initialContextSetupRequest.TimeRefDistribution) == *y.TimeRefDistribution) && + (initialContextSetupRequest.TraceActivation == nil) == (y.TraceActivation == nil) && (initialContextSetupRequest.TraceActivation == nil || (*initialContextSetupRequest.TraceActivation).Equal(*y.TraceActivation)) && + (initialContextSetupRequest.HandoverRestrictionList == nil) == (y.HandoverRestrictionList == nil) && (initialContextSetupRequest.HandoverRestrictionList == nil || (*initialContextSetupRequest.HandoverRestrictionList).Equal(*y.HandoverRestrictionList)) && + (initialContextSetupRequest.SubscriberProfileIDforRFP == nil) == (y.SubscriberProfileIDforRFP == nil) && (initialContextSetupRequest.SubscriberProfileIDforRFP == nil || (*initialContextSetupRequest.SubscriberProfileIDforRFP) == *y.SubscriberProfileIDforRFP) && + (initialContextSetupRequest.CSFallbackIndicator == nil) == (y.CSFallbackIndicator == nil) && (initialContextSetupRequest.CSFallbackIndicator == nil || (*initialContextSetupRequest.CSFallbackIndicator) == *y.CSFallbackIndicator) && + (initialContextSetupRequest.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (initialContextSetupRequest.SRVCCOperationPossible == nil || (*initialContextSetupRequest.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (initialContextSetupRequest.CSGMembershipStatus == nil) == (y.CSGMembershipStatus == nil) && (initialContextSetupRequest.CSGMembershipStatus == nil || (*initialContextSetupRequest.CSGMembershipStatus) == *y.CSGMembershipStatus) && + (initialContextSetupRequest.RegisteredLAI == nil) == (y.RegisteredLAI == nil) && (initialContextSetupRequest.RegisteredLAI == nil || (*initialContextSetupRequest.RegisteredLAI).Equal(*y.RegisteredLAI)) && + (initialContextSetupRequest.ManagementBasedMDTAllowed == nil) == (y.ManagementBasedMDTAllowed == nil) && (initialContextSetupRequest.ManagementBasedMDTAllowed == nil || (*initialContextSetupRequest.ManagementBasedMDTAllowed) == *y.ManagementBasedMDTAllowed) && + initialContextSetupRequest.ManagementBasedMDTPLMNList.Equal(y.ManagementBasedMDTPLMNList) && + (initialContextSetupRequest.AdditionalCSFallbackIndicator == nil) == (y.AdditionalCSFallbackIndicator == nil) && (initialContextSetupRequest.AdditionalCSFallbackIndicator == nil || (*initialContextSetupRequest.AdditionalCSFallbackIndicator) == *y.AdditionalCSFallbackIndicator) && + (initialContextSetupRequest.MaskedIMEISV == nil) == (y.MaskedIMEISV == nil) && (initialContextSetupRequest.MaskedIMEISV == nil || (*initialContextSetupRequest.MaskedIMEISV) == *y.MaskedIMEISV) && + (initialContextSetupRequest.ExpectedUEBehaviour == nil) == (y.ExpectedUEBehaviour == nil) && (initialContextSetupRequest.ExpectedUEBehaviour == nil || (*initialContextSetupRequest.ExpectedUEBehaviour).Equal(*y.ExpectedUEBehaviour)) && + (initialContextSetupRequest.ProSeAuthorized == nil) == (y.ProSeAuthorized == nil) && (initialContextSetupRequest.ProSeAuthorized == nil || (*initialContextSetupRequest.ProSeAuthorized).Equal(*y.ProSeAuthorized)) && + (initialContextSetupRequest.UEUserPlaneCIoTSupportIndicator == nil) == (y.UEUserPlaneCIoTSupportIndicator == nil) && (initialContextSetupRequest.UEUserPlaneCIoTSupportIndicator == nil || (*initialContextSetupRequest.UEUserPlaneCIoTSupportIndicator) == *y.UEUserPlaneCIoTSupportIndicator) && + (initialContextSetupRequest.V2XServicesAuthorized == nil) == (y.V2XServicesAuthorized == nil) && (initialContextSetupRequest.V2XServicesAuthorized == nil || (*initialContextSetupRequest.V2XServicesAuthorized).Equal(*y.V2XServicesAuthorized)) && + (initialContextSetupRequest.UESidelinkAggregateMaximumBitrate == nil) == (y.UESidelinkAggregateMaximumBitrate == nil) && (initialContextSetupRequest.UESidelinkAggregateMaximumBitrate == nil || (*initialContextSetupRequest.UESidelinkAggregateMaximumBitrate).Equal(*y.UESidelinkAggregateMaximumBitrate)) && + (initialContextSetupRequest.EnhancedCoverageRestricted == nil) == (y.EnhancedCoverageRestricted == nil) && (initialContextSetupRequest.EnhancedCoverageRestricted == nil || (*initialContextSetupRequest.EnhancedCoverageRestricted) == *y.EnhancedCoverageRestricted) && + (initialContextSetupRequest.NRUESecurityCapabilities == nil) == (y.NRUESecurityCapabilities == nil) && (initialContextSetupRequest.NRUESecurityCapabilities == nil || (*initialContextSetupRequest.NRUESecurityCapabilities).Equal(*y.NRUESecurityCapabilities)) && + (initialContextSetupRequest.CEModeBRestricted == nil) == (y.CEModeBRestricted == nil) && (initialContextSetupRequest.CEModeBRestricted == nil || (*initialContextSetupRequest.CEModeBRestricted) == *y.CEModeBRestricted) && + (initialContextSetupRequest.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (initialContextSetupRequest.AerialUEsubscriptionInformation == nil || (*initialContextSetupRequest.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (initialContextSetupRequest.PendingDataIndication == nil) == (y.PendingDataIndication == nil) && (initialContextSetupRequest.PendingDataIndication == nil || (*initialContextSetupRequest.PendingDataIndication) == *y.PendingDataIndication) && + (initialContextSetupRequest.SubscriptionBasedUEDifferentiationInfo == nil) == (y.SubscriptionBasedUEDifferentiationInfo == nil) && (initialContextSetupRequest.SubscriptionBasedUEDifferentiationInfo == nil || (*initialContextSetupRequest.SubscriptionBasedUEDifferentiationInfo).Equal(*y.SubscriptionBasedUEDifferentiationInfo)) && + (initialContextSetupRequest.AdditionalRRMPriorityIndex == nil) == (y.AdditionalRRMPriorityIndex == nil) && (initialContextSetupRequest.AdditionalRRMPriorityIndex == nil || (*initialContextSetupRequest.AdditionalRRMPriorityIndex) == *y.AdditionalRRMPriorityIndex) && + (initialContextSetupRequest.IABAuthorized == nil) == (y.IABAuthorized == nil) && (initialContextSetupRequest.IABAuthorized == nil || (*initialContextSetupRequest.IABAuthorized) == *y.IABAuthorized) && + (initialContextSetupRequest.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (initialContextSetupRequest.NRV2XServicesAuthorized == nil || (*initialContextSetupRequest.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (initialContextSetupRequest.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (initialContextSetupRequest.NRUESidelinkAggregateMaximumBitrate == nil || (*initialContextSetupRequest.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (initialContextSetupRequest.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (initialContextSetupRequest.PC5QoSParameters == nil || (*initialContextSetupRequest.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (initialContextSetupRequest.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (initialContextSetupRequest.UERadioCapabilityID == nil || (*initialContextSetupRequest.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && initialContextSetupRequest.messageMeta.Equal(y.messageMeta) } @@ -11750,6 +16537,20 @@ func (initialUEMessage InitialUEMessage) Equal(y InitialUEMessage) bool { (initialUEMessage.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (initialUEMessage.TunnelInformationForBBF == nil || (*initialUEMessage.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && (initialUEMessage.SIPTOLGWTransportLayerAddress == nil) == (y.SIPTOLGWTransportLayerAddress == nil) && (initialUEMessage.SIPTOLGWTransportLayerAddress == nil || (*initialUEMessage.SIPTOLGWTransportLayerAddress) == *y.SIPTOLGWTransportLayerAddress) && (initialUEMessage.CoarseUELocationRequested == nil) == (y.CoarseUELocationRequested == nil) && (initialUEMessage.CoarseUELocationRequested == nil || (*initialUEMessage.CoarseUELocationRequested) == *y.CoarseUELocationRequested) && + (initialUEMessage.CSGId == nil) == (y.CSGId == nil) && (initialUEMessage.CSGId == nil || (*initialUEMessage.CSGId) == *y.CSGId) && + (initialUEMessage.CellAccessMode == nil) == (y.CellAccessMode == nil) && (initialUEMessage.CellAccessMode == nil || (*initialUEMessage.CellAccessMode) == *y.CellAccessMode) && + (initialUEMessage.RelayNodeIndicator == nil) == (y.RelayNodeIndicator == nil) && (initialUEMessage.RelayNodeIndicator == nil || (*initialUEMessage.RelayNodeIndicator) == *y.RelayNodeIndicator) && + (initialUEMessage.GUMMEIType == nil) == (y.GUMMEIType == nil) && (initialUEMessage.GUMMEIType == nil || (*initialUEMessage.GUMMEIType) == *y.GUMMEIType) && + (initialUEMessage.LHNID == nil) == (y.LHNID == nil) && (initialUEMessage.LHNID == nil || (*initialUEMessage.LHNID).Equal(*y.LHNID)) && + (initialUEMessage.MMEGroupID == nil) == (y.MMEGroupID == nil) && (initialUEMessage.MMEGroupID == nil || (*initialUEMessage.MMEGroupID) == *y.MMEGroupID) && + (initialUEMessage.UEUsageType == nil) == (y.UEUsageType == nil) && (initialUEMessage.UEUsageType == nil || (*initialUEMessage.UEUsageType) == *y.UEUsageType) && + (initialUEMessage.CEmodeBSupportIndicator == nil) == (y.CEmodeBSupportIndicator == nil) && (initialUEMessage.CEmodeBSupportIndicator == nil || (*initialUEMessage.CEmodeBSupportIndicator) == *y.CEmodeBSupportIndicator) && + (initialUEMessage.DCNID == nil) == (y.DCNID == nil) && (initialUEMessage.DCNID == nil || (*initialUEMessage.DCNID) == *y.DCNID) && + (initialUEMessage.CoverageLevel == nil) == (y.CoverageLevel == nil) && (initialUEMessage.CoverageLevel == nil || (*initialUEMessage.CoverageLevel) == *y.CoverageLevel) && + (initialUEMessage.UEApplicationLayerMeasurementCapability == nil) == (y.UEApplicationLayerMeasurementCapability == nil) && (initialUEMessage.UEApplicationLayerMeasurementCapability == nil || (*initialUEMessage.UEApplicationLayerMeasurementCapability) == *y.UEApplicationLayerMeasurementCapability) && + (initialUEMessage.EDTSession == nil) == (y.EDTSession == nil) && (initialUEMessage.EDTSession == nil || (*initialUEMessage.EDTSession) == *y.EDTSession) && + (initialUEMessage.IABNodeIndication == nil) == (y.IABNodeIndication == nil) && (initialUEMessage.IABNodeIndication == nil || (*initialUEMessage.IABNodeIndication) == *y.IABNodeIndication) && + (initialUEMessage.LTENTNTAIInformation == nil) == (y.LTENTNTAIInformation == nil) && (initialUEMessage.LTENTNTAIInformation == nil || (*initialUEMessage.LTENTNTAIInformation).Equal(*y.LTENTNTAIInformation)) && initialUEMessage.messageMeta.Equal(y.messageMeta) } @@ -11795,6 +16596,18 @@ func (intersystemMeasurementConfiguration IntersystemMeasurementConfiguration) E intersystemMeasurementConfiguration.extensions == y.extensions } +func (intersystemSONConfigurationTransfer IntersystemSONConfigurationTransfer) Equal(y IntersystemSONConfigurationTransfer) bool { + if len(intersystemSONConfigurationTransfer) != len(y) { + return false + } + for i := range intersystemSONConfigurationTransfer { + if !(intersystemSONConfigurationTransfer[i] == y[i]) { + return false + } + } + return true +} + func (killRequest KillRequest) Equal(y KillRequest) bool { return killRequest.MessageIdentifier == y.MessageIdentifier && killRequest.SerialNumber == y.SerialNumber && @@ -11815,6 +16628,18 @@ func (lAI LAI) Equal(y LAI) bool { return lAI == y } +func (lHNID LHNID) Equal(y LHNID) bool { + if len(lHNID) != len(y) { + return false + } + for i := range lHNID { + if !(lHNID[i] == y[i]) { + return false + } + } + return true +} + func (lPPaPDU LPPaPDU) Equal(y LPPaPDU) bool { if len(lPPaPDU) != len(y) { return false @@ -11912,6 +16737,8 @@ func (locationReport LocationReport) Equal(y LocationReport) bool { (locationReport.EUTRANCGI == nil) == (y.EUTRANCGI == nil) && (locationReport.EUTRANCGI == nil || (*locationReport.EUTRANCGI).Equal(*y.EUTRANCGI)) && (locationReport.TAI == nil) == (y.TAI == nil) && (locationReport.TAI == nil || (*locationReport.TAI).Equal(*y.TAI)) && (locationReport.RequestType == nil) == (y.RequestType == nil) && (locationReport.RequestType == nil || (*locationReport.RequestType).Equal(*y.RequestType)) && + (locationReport.PSCellInformation == nil) == (y.PSCellInformation == nil) && (locationReport.PSCellInformation == nil || (*locationReport.PSCellInformation).Equal(*y.PSCellInformation)) && + (locationReport.LTENTNTAIInformation == nil) == (y.LTENTNTAIInformation == nil) && (locationReport.LTENTNTAIInformation == nil || (*locationReport.LTENTNTAIInformation).Equal(*y.LTENTNTAIInformation)) && locationReport.messageMeta.Equal(y.messageMeta) } @@ -11927,8 +16754,22 @@ func (mDTConfigurationNR MDTConfigurationNR) Equal(y MDTConfigurationNR) bool { return true } +func (mDTPLMNList MDTPLMNList) Equal(y MDTPLMNList) bool { + if len(mDTPLMNList) != len(y) { + return false + } + for i := range mDTPLMNList { + if !(mDTPLMNList[i] == y[i]) { + return false + } + } + return true +} + func (mMEConfigurationTransfer MMEConfigurationTransfer) Equal(y MMEConfigurationTransfer) bool { return (mMEConfigurationTransfer.SONConfigurationTransfer == nil) == (y.SONConfigurationTransfer == nil) && (mMEConfigurationTransfer.SONConfigurationTransfer == nil || (*mMEConfigurationTransfer.SONConfigurationTransfer).Equal(*y.SONConfigurationTransfer)) && + (mMEConfigurationTransfer.ENDCSONConfigurationTransferMCT == nil) == (y.ENDCSONConfigurationTransferMCT == nil) && (mMEConfigurationTransfer.ENDCSONConfigurationTransferMCT == nil || (*mMEConfigurationTransfer.ENDCSONConfigurationTransferMCT).Equal(*y.ENDCSONConfigurationTransferMCT)) && + (mMEConfigurationTransfer.IntersystemSONConfigurationTransferMCT == nil) == (y.IntersystemSONConfigurationTransferMCT == nil) && (mMEConfigurationTransfer.IntersystemSONConfigurationTransferMCT == nil || (*mMEConfigurationTransfer.IntersystemSONConfigurationTransferMCT).Equal(*y.IntersystemSONConfigurationTransferMCT)) && mMEConfigurationTransfer.messageMeta.Equal(y.messageMeta) } @@ -11936,6 +16777,7 @@ func (mMEConfigurationUpdate MMEConfigurationUpdate) Equal(y MMEConfigurationUpd return (mMEConfigurationUpdate.MMEName == nil) == (y.MMEName == nil) && (mMEConfigurationUpdate.MMEName == nil || (*mMEConfigurationUpdate.MMEName) == *y.MMEName) && mMEConfigurationUpdate.ServedGUMMEIs.Equal(y.ServedGUMMEIs) && (mMEConfigurationUpdate.RelativeMMECapacity == nil) == (y.RelativeMMECapacity == nil) && (mMEConfigurationUpdate.RelativeMMECapacity == nil || (*mMEConfigurationUpdate.RelativeMMECapacity) == *y.RelativeMMECapacity) && + (mMEConfigurationUpdate.ServedDCNs == nil) == (y.ServedDCNs == nil) && (mMEConfigurationUpdate.ServedDCNs == nil || (*mMEConfigurationUpdate.ServedDCNs).Equal(*y.ServedDCNs)) && mMEConfigurationUpdate.messageMeta.Equal(y.messageMeta) } @@ -11951,6 +16793,12 @@ func (mMEConfigurationUpdateFailure MMEConfigurationUpdateFailure) Equal(y MMECo mMEConfigurationUpdateFailure.messageMeta.Equal(y.messageMeta) } +func (mMEPagingTarget MMEPagingTarget) Equal(y MMEPagingTarget) bool { + return (mMEPagingTarget.GlobalENBID == nil) == (y.GlobalENBID == nil) && (mMEPagingTarget.GlobalENBID == nil || (*mMEPagingTarget.GlobalENBID).Equal(*y.GlobalENBID)) && + (mMEPagingTarget.TAI == nil) == (y.TAI == nil) && (mMEPagingTarget.TAI == nil || (*mMEPagingTarget.TAI).Equal(*y.TAI)) && + (mMEPagingTarget.Ext == nil) == (y.Ext == nil) && (mMEPagingTarget.Ext == nil || (*mMEPagingTarget.Ext) == *y.Ext) +} + func (mMEStatusTransfer MMEStatusTransfer) Equal(y MMEStatusTransfer) bool { return mMEStatusTransfer.MMEUES1APID == y.MMEUES1APID && mMEStatusTransfer.ENBUES1APID == y.ENBUES1APID && @@ -11958,6 +16806,30 @@ func (mMEStatusTransfer MMEStatusTransfer) Equal(y MMEStatusTransfer) bool { mMEStatusTransfer.messageMeta.Equal(y.messageMeta) } +func (mSClassmark2 MSClassmark2) Equal(y MSClassmark2) bool { + if len(mSClassmark2) != len(y) { + return false + } + for i := range mSClassmark2 { + if !(mSClassmark2[i] == y[i]) { + return false + } + } + return true +} + +func (mSClassmark3 MSClassmark3) Equal(y MSClassmark3) bool { + if len(mSClassmark3) != len(y) { + return false + } + for i := range mSClassmark3 { + if !(mSClassmark3[i] == y[i]) { + return false + } + } + return true +} + func (mutingPatternInformation MutingPatternInformation) Equal(y MutingPatternInformation) bool { return mutingPatternInformation.MutingPatternPeriod == y.MutingPatternPeriod && (mutingPatternInformation.MutingPatternOffset == nil) == (y.MutingPatternOffset == nil) && (mutingPatternInformation.MutingPatternOffset == nil || (*mutingPatternInformation.MutingPatternOffset) == *y.MutingPatternOffset) && @@ -12009,10 +16881,40 @@ func (nASSecurityParameterstoEUTRAN NASSecurityParameterstoEUTRAN) Equal(y NASSe return true } +func (nBIoTPagingeDRXInformation NBIoTPagingeDRXInformation) Equal(y NBIoTPagingeDRXInformation) bool { + return nBIoTPagingeDRXInformation.NBIoTpagingeDRXCycle == y.NBIoTpagingeDRXCycle && + (nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow == nil) == (y.NBIoTpagingTimeWindow == nil) && (nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow == nil || (*nBIoTPagingeDRXInformation.NBIoTpagingTimeWindow) == *y.NBIoTpagingTimeWindow) && + nBIoTPagingeDRXInformation.iEExtensions == y.iEExtensions && + nBIoTPagingeDRXInformation.extensions == y.extensions +} + func (nRCGI NRCGI) Equal(y NRCGI) bool { return nRCGI == y } +func (nRUESecurityCapabilities NRUESecurityCapabilities) Equal(y NRUESecurityCapabilities) bool { + return nRUESecurityCapabilities == y +} + +func (nRUESidelinkAggregateMaximumBitrate NRUESidelinkAggregateMaximumBitrate) Equal(y NRUESidelinkAggregateMaximumBitrate) bool { + return nRUESidelinkAggregateMaximumBitrate == y +} + +func (nRV2XServicesAuthorized NRV2XServicesAuthorized) Equal(y NRV2XServicesAuthorized) bool { + return (nRV2XServicesAuthorized.VehicleUE == nil) == (y.VehicleUE == nil) && (nRV2XServicesAuthorized.VehicleUE == nil || (*nRV2XServicesAuthorized.VehicleUE) == *y.VehicleUE) && + (nRV2XServicesAuthorized.PedestrianUE == nil) == (y.PedestrianUE == nil) && (nRV2XServicesAuthorized.PedestrianUE == nil || (*nRV2XServicesAuthorized.PedestrianUE) == *y.PedestrianUE) && + nRV2XServicesAuthorized.iEExtensions == y.iEExtensions && + nRV2XServicesAuthorized.extensions == y.extensions +} + +func (nRencryptionAlgorithms NRencryptionAlgorithms) Equal(y NRencryptionAlgorithms) bool { + return nRencryptionAlgorithms == y +} + +func (nRintegrityProtectionAlgorithms NRintegrityProtectionAlgorithms) Equal(y NRintegrityProtectionAlgorithms) bool { + return nRintegrityProtectionAlgorithms == y +} + func (ngENB NgENB) Equal(y NgENB) bool { return ngENB.extensions == y.extensions && ngENB.GlobalNgENBID.Equal(y.GlobalNgENBID) && @@ -12036,6 +16938,37 @@ func (overloadStop OverloadStop) Equal(y OverloadStop) bool { overloadStop.messageMeta.Equal(y.messageMeta) } +func (pC5FlowBitRates PC5FlowBitRates) Equal(y PC5FlowBitRates) bool { + return pC5FlowBitRates == y +} + +func (pC5QoSFlowItem PC5QoSFlowItem) Equal(y PC5QoSFlowItem) bool { + return pC5QoSFlowItem.PQI == y.PQI && + (pC5QoSFlowItem.Pc5FlowBitRates == nil) == (y.Pc5FlowBitRates == nil) && (pC5QoSFlowItem.Pc5FlowBitRates == nil || (*pC5QoSFlowItem.Pc5FlowBitRates).Equal(*y.Pc5FlowBitRates)) && + (pC5QoSFlowItem.Range == nil) == (y.Range == nil) && (pC5QoSFlowItem.Range == nil || (*pC5QoSFlowItem.Range) == *y.Range) && + pC5QoSFlowItem.iEExtensions == y.iEExtensions && + pC5QoSFlowItem.extensions == y.extensions +} + +func (pC5QoSFlowList PC5QoSFlowList) Equal(y PC5QoSFlowList) bool { + if len(pC5QoSFlowList) != len(y) { + return false + } + for i := range pC5QoSFlowList { + if !(pC5QoSFlowList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (pC5QoSParameters PC5QoSParameters) Equal(y PC5QoSParameters) bool { + return pC5QoSParameters.Pc5QoSFlowList.Equal(y.Pc5QoSFlowList) && + (pC5QoSParameters.Pc5LinkAggregatedBitRates == nil) == (y.Pc5LinkAggregatedBitRates == nil) && (pC5QoSParameters.Pc5LinkAggregatedBitRates == nil || (*pC5QoSParameters.Pc5LinkAggregatedBitRates) == *y.Pc5LinkAggregatedBitRates) && + pC5QoSParameters.iEExtensions == y.iEExtensions && + pC5QoSParameters.extensions == y.extensions +} + func (pSCellInformation PSCellInformation) Equal(y PSCellInformation) bool { return pSCellInformation == y } @@ -12062,9 +16995,36 @@ func (paging Paging) Equal(y Paging) bool { paging.TAIList.Equal(y.TAIList) && (paging.PagingPriority == nil) == (y.PagingPriority == nil) && (paging.PagingPriority == nil || (*paging.PagingPriority) == *y.PagingPriority) && slices.Equal(paging.UERadioCapabilityForPaging, y.UERadioCapabilityForPaging) && + paging.CSGIdList.Equal(y.CSGIdList) && + (paging.AssistanceDataForPaging == nil) == (y.AssistanceDataForPaging == nil) && (paging.AssistanceDataForPaging == nil || (*paging.AssistanceDataForPaging).Equal(*y.AssistanceDataForPaging)) && + (paging.PagingeDRXInformation == nil) == (y.PagingeDRXInformation == nil) && (paging.PagingeDRXInformation == nil || (*paging.PagingeDRXInformation).Equal(*y.PagingeDRXInformation)) && + (paging.ExtendedUEIdentityIndexValue == nil) == (y.ExtendedUEIdentityIndexValue == nil) && (paging.ExtendedUEIdentityIndexValue == nil || (*paging.ExtendedUEIdentityIndexValue) == *y.ExtendedUEIdentityIndexValue) && + (paging.NBIoTPagingeDRXInformation == nil) == (y.NBIoTPagingeDRXInformation == nil) && (paging.NBIoTPagingeDRXInformation == nil || (*paging.NBIoTPagingeDRXInformation).Equal(*y.NBIoTPagingeDRXInformation)) && + (paging.NBIoTUEIdentityIndexValue == nil) == (y.NBIoTUEIdentityIndexValue == nil) && (paging.NBIoTUEIdentityIndexValue == nil || (*paging.NBIoTUEIdentityIndexValue) == *y.NBIoTUEIdentityIndexValue) && + (paging.EnhancedCoverageRestricted == nil) == (y.EnhancedCoverageRestricted == nil) && (paging.EnhancedCoverageRestricted == nil || (*paging.EnhancedCoverageRestricted) == *y.EnhancedCoverageRestricted) && + (paging.CEModeBRestricted == nil) == (y.CEModeBRestricted == nil) && (paging.CEModeBRestricted == nil || (*paging.CEModeBRestricted) == *y.CEModeBRestricted) && + (paging.DataSize == nil) == (y.DataSize == nil) && (paging.DataSize == nil || (*paging.DataSize) == *y.DataSize) && + (paging.WUSAssistanceInformation == nil) == (y.WUSAssistanceInformation == nil) && (paging.WUSAssistanceInformation == nil || (*paging.WUSAssistanceInformation).Equal(*y.WUSAssistanceInformation)) && + (paging.NBIoTPagingDRX == nil) == (y.NBIoTPagingDRX == nil) && (paging.NBIoTPagingDRX == nil || (*paging.NBIoTPagingDRX) == *y.NBIoTPagingDRX) && + (paging.PagingCause == nil) == (y.PagingCause == nil) && (paging.PagingCause == nil || (*paging.PagingCause) == *y.PagingCause) && paging.messageMeta.Equal(y.messageMeta) } +func (pagingAttemptInformation PagingAttemptInformation) Equal(y PagingAttemptInformation) bool { + return pagingAttemptInformation.PagingAttemptCount == y.PagingAttemptCount && + pagingAttemptInformation.IntendedNumberOfPagingAttempts == y.IntendedNumberOfPagingAttempts && + (pagingAttemptInformation.NextPagingAreaScope == nil) == (y.NextPagingAreaScope == nil) && (pagingAttemptInformation.NextPagingAreaScope == nil || (*pagingAttemptInformation.NextPagingAreaScope) == *y.NextPagingAreaScope) && + pagingAttemptInformation.iEExtensions == y.iEExtensions && + pagingAttemptInformation.extensions == y.extensions +} + +func (pagingeDRXInformation PagingeDRXInformation) Equal(y PagingeDRXInformation) bool { + return pagingeDRXInformation.PagingeDRXCycle == y.PagingeDRXCycle && + (pagingeDRXInformation.PagingTimeWindow == nil) == (y.PagingTimeWindow == nil) && (pagingeDRXInformation.PagingTimeWindow == nil || (*pagingeDRXInformation.PagingTimeWindow) == *y.PagingTimeWindow) && + pagingeDRXInformation.iEExtensions == y.iEExtensions && + pagingeDRXInformation.extensions == y.extensions +} + func (pathSwitchRequest PathSwitchRequest) Equal(y PathSwitchRequest) bool { return pathSwitchRequest.ENBUES1APID == y.ENBUES1APID && pathSwitchRequest.ERABToBeSwitchedDL.Equal(y.ERABToBeSwitchedDL) && @@ -12074,6 +17034,14 @@ func (pathSwitchRequest PathSwitchRequest) Equal(y PathSwitchRequest) bool { (pathSwitchRequest.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (pathSwitchRequest.UESecurityCapabilities == nil || (*pathSwitchRequest.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && (pathSwitchRequest.SourceMMEGUMMEI == nil) == (y.SourceMMEGUMMEI == nil) && (pathSwitchRequest.SourceMMEGUMMEI == nil || (*pathSwitchRequest.SourceMMEGUMMEI).Equal(*y.SourceMMEGUMMEI)) && (pathSwitchRequest.TunnelInformationForBBF == nil) == (y.TunnelInformationForBBF == nil) && (pathSwitchRequest.TunnelInformationForBBF == nil || (*pathSwitchRequest.TunnelInformationForBBF).Equal(*y.TunnelInformationForBBF)) && + (pathSwitchRequest.CSGId == nil) == (y.CSGId == nil) && (pathSwitchRequest.CSGId == nil || (*pathSwitchRequest.CSGId) == *y.CSGId) && + (pathSwitchRequest.CellAccessMode == nil) == (y.CellAccessMode == nil) && (pathSwitchRequest.CellAccessMode == nil || (*pathSwitchRequest.CellAccessMode) == *y.CellAccessMode) && + (pathSwitchRequest.CSGMembershipStatus == nil) == (y.CSGMembershipStatus == nil) && (pathSwitchRequest.CSGMembershipStatus == nil || (*pathSwitchRequest.CSGMembershipStatus) == *y.CSGMembershipStatus) && + (pathSwitchRequest.LHNID == nil) == (y.LHNID == nil) && (pathSwitchRequest.LHNID == nil || (*pathSwitchRequest.LHNID).Equal(*y.LHNID)) && + (pathSwitchRequest.RRCResumeCause == nil) == (y.RRCResumeCause == nil) && (pathSwitchRequest.RRCResumeCause == nil || (*pathSwitchRequest.RRCResumeCause) == *y.RRCResumeCause) && + (pathSwitchRequest.NRUESecurityCapabilities == nil) == (y.NRUESecurityCapabilities == nil) && (pathSwitchRequest.NRUESecurityCapabilities == nil || (*pathSwitchRequest.NRUESecurityCapabilities).Equal(*y.NRUESecurityCapabilities)) && + (pathSwitchRequest.PSCellInformation == nil) == (y.PSCellInformation == nil) && (pathSwitchRequest.PSCellInformation == nil || (*pathSwitchRequest.PSCellInformation).Equal(*y.PSCellInformation)) && + (pathSwitchRequest.LTENTNTAIInformation == nil) == (y.LTENTNTAIInformation == nil) && (pathSwitchRequest.LTENTNTAIInformation == nil || (*pathSwitchRequest.LTENTNTAIInformation).Equal(*y.LTENTNTAIInformation)) && pathSwitchRequest.messageMeta.Equal(y.messageMeta) } @@ -12087,6 +17055,25 @@ func (pathSwitchRequestAcknowledge PathSwitchRequestAcknowledge) Equal(y PathSwi (pathSwitchRequestAcknowledge.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (pathSwitchRequestAcknowledge.UESecurityCapabilities == nil || (*pathSwitchRequestAcknowledge.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && slices.EqualFunc(pathSwitchRequestAcknowledge.ERABToBeReleased, y.ERABToBeReleased, ERABItem.Equal) && (pathSwitchRequestAcknowledge.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (pathSwitchRequestAcknowledge.TimeRefDistribution == nil || (*pathSwitchRequestAcknowledge.TimeRefDistribution) == *y.TimeRefDistribution) && + (pathSwitchRequestAcknowledge.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (pathSwitchRequestAcknowledge.CriticalityDiagnostics == nil || (*pathSwitchRequestAcknowledge.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && + (pathSwitchRequestAcknowledge.CSGMembershipStatus == nil) == (y.CSGMembershipStatus == nil) && (pathSwitchRequestAcknowledge.CSGMembershipStatus == nil || (*pathSwitchRequestAcknowledge.CSGMembershipStatus) == *y.CSGMembershipStatus) && + (pathSwitchRequestAcknowledge.ProSeAuthorized == nil) == (y.ProSeAuthorized == nil) && (pathSwitchRequestAcknowledge.ProSeAuthorized == nil || (*pathSwitchRequestAcknowledge.ProSeAuthorized).Equal(*y.ProSeAuthorized)) && + (pathSwitchRequestAcknowledge.UEUserPlaneCIoTSupportIndicator == nil) == (y.UEUserPlaneCIoTSupportIndicator == nil) && (pathSwitchRequestAcknowledge.UEUserPlaneCIoTSupportIndicator == nil || (*pathSwitchRequestAcknowledge.UEUserPlaneCIoTSupportIndicator) == *y.UEUserPlaneCIoTSupportIndicator) && + (pathSwitchRequestAcknowledge.V2XServicesAuthorized == nil) == (y.V2XServicesAuthorized == nil) && (pathSwitchRequestAcknowledge.V2XServicesAuthorized == nil || (*pathSwitchRequestAcknowledge.V2XServicesAuthorized).Equal(*y.V2XServicesAuthorized)) && + (pathSwitchRequestAcknowledge.UESidelinkAggregateMaximumBitrate == nil) == (y.UESidelinkAggregateMaximumBitrate == nil) && (pathSwitchRequestAcknowledge.UESidelinkAggregateMaximumBitrate == nil || (*pathSwitchRequestAcknowledge.UESidelinkAggregateMaximumBitrate).Equal(*y.UESidelinkAggregateMaximumBitrate)) && + (pathSwitchRequestAcknowledge.EnhancedCoverageRestricted == nil) == (y.EnhancedCoverageRestricted == nil) && (pathSwitchRequestAcknowledge.EnhancedCoverageRestricted == nil || (*pathSwitchRequestAcknowledge.EnhancedCoverageRestricted) == *y.EnhancedCoverageRestricted) && + (pathSwitchRequestAcknowledge.NRUESecurityCapabilities == nil) == (y.NRUESecurityCapabilities == nil) && (pathSwitchRequestAcknowledge.NRUESecurityCapabilities == nil || (*pathSwitchRequestAcknowledge.NRUESecurityCapabilities).Equal(*y.NRUESecurityCapabilities)) && + (pathSwitchRequestAcknowledge.CEModeBRestricted == nil) == (y.CEModeBRestricted == nil) && (pathSwitchRequestAcknowledge.CEModeBRestricted == nil || (*pathSwitchRequestAcknowledge.CEModeBRestricted) == *y.CEModeBRestricted) && + (pathSwitchRequestAcknowledge.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (pathSwitchRequestAcknowledge.AerialUEsubscriptionInformation == nil || (*pathSwitchRequestAcknowledge.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (pathSwitchRequestAcknowledge.PendingDataIndication == nil) == (y.PendingDataIndication == nil) && (pathSwitchRequestAcknowledge.PendingDataIndication == nil || (*pathSwitchRequestAcknowledge.PendingDataIndication) == *y.PendingDataIndication) && + (pathSwitchRequestAcknowledge.SubscriptionBasedUEDifferentiationInfo == nil) == (y.SubscriptionBasedUEDifferentiationInfo == nil) && (pathSwitchRequestAcknowledge.SubscriptionBasedUEDifferentiationInfo == nil || (*pathSwitchRequestAcknowledge.SubscriptionBasedUEDifferentiationInfo).Equal(*y.SubscriptionBasedUEDifferentiationInfo)) && + (pathSwitchRequestAcknowledge.HandoverRestrictionList == nil) == (y.HandoverRestrictionList == nil) && (pathSwitchRequestAcknowledge.HandoverRestrictionList == nil || (*pathSwitchRequestAcknowledge.HandoverRestrictionList).Equal(*y.HandoverRestrictionList)) && + (pathSwitchRequestAcknowledge.AdditionalRRMPriorityIndex == nil) == (y.AdditionalRRMPriorityIndex == nil) && (pathSwitchRequestAcknowledge.AdditionalRRMPriorityIndex == nil || (*pathSwitchRequestAcknowledge.AdditionalRRMPriorityIndex) == *y.AdditionalRRMPriorityIndex) && + (pathSwitchRequestAcknowledge.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (pathSwitchRequestAcknowledge.NRV2XServicesAuthorized == nil || (*pathSwitchRequestAcknowledge.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (pathSwitchRequestAcknowledge.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (pathSwitchRequestAcknowledge.NRUESidelinkAggregateMaximumBitrate == nil || (*pathSwitchRequestAcknowledge.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (pathSwitchRequestAcknowledge.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (pathSwitchRequestAcknowledge.PC5QoSParameters == nil || (*pathSwitchRequestAcknowledge.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (pathSwitchRequestAcknowledge.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (pathSwitchRequestAcknowledge.UERadioCapabilityID == nil || (*pathSwitchRequestAcknowledge.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && + pathSwitchRequestAcknowledge.ERABToBeUpdatedList.Equal(y.ERABToBeUpdatedList) && pathSwitchRequestAcknowledge.messageMeta.Equal(y.messageMeta) } @@ -12098,6 +17085,14 @@ func (pathSwitchRequestFailure PathSwitchRequestFailure) Equal(y PathSwitchReque pathSwitchRequestFailure.messageMeta.Equal(y.messageMeta) } +func (proSeAuthorized ProSeAuthorized) Equal(y ProSeAuthorized) bool { + return (proSeAuthorized.ProSeDirectDiscovery == nil) == (y.ProSeDirectDiscovery == nil) && (proSeAuthorized.ProSeDirectDiscovery == nil || (*proSeAuthorized.ProSeDirectDiscovery) == *y.ProSeDirectDiscovery) && + (proSeAuthorized.ProSeDirectCommunication == nil) == (y.ProSeDirectCommunication == nil) && (proSeAuthorized.ProSeDirectCommunication == nil || (*proSeAuthorized.ProSeDirectCommunication) == *y.ProSeDirectCommunication) && + (proSeAuthorized.ProSeUEtoNetworkRelaying == nil) == (y.ProSeUEtoNetworkRelaying == nil) && (proSeAuthorized.ProSeUEtoNetworkRelaying == nil || (*proSeAuthorized.ProSeUEtoNetworkRelaying) == *y.ProSeUEtoNetworkRelaying) && + proSeAuthorized.iEExtensions == y.iEExtensions && + proSeAuthorized.extensions == y.extensions +} + func (rATRestrictionInformation RATRestrictionInformation) Equal(y RATRestrictionInformation) bool { return rATRestrictionInformation == y } @@ -12150,6 +17145,57 @@ func (rRCContainer RRCContainer) Equal(y RRCContainer) bool { return true } +func (recommendedCellItem RecommendedCellItem) Equal(y RecommendedCellItem) bool { + return recommendedCellItem.EUTRANCGI.Equal(y.EUTRANCGI) && + (recommendedCellItem.TimeStayedInCell == nil) == (y.TimeStayedInCell == nil) && (recommendedCellItem.TimeStayedInCell == nil || (*recommendedCellItem.TimeStayedInCell) == *y.TimeStayedInCell) && + recommendedCellItem.iEExtensions == y.iEExtensions && + recommendedCellItem.extensions == y.extensions && + recommendedCellItem.containerCrit == y.containerCrit +} + +func (recommendedCellList RecommendedCellList) Equal(y RecommendedCellList) bool { + if len(recommendedCellList) != len(y) { + return false + } + for i := range recommendedCellList { + if !(recommendedCellList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (recommendedCellsForPaging RecommendedCellsForPaging) Equal(y RecommendedCellsForPaging) bool { + return recommendedCellsForPaging.RecommendedCellList.Equal(y.RecommendedCellList) && + recommendedCellsForPaging.iEExtensions == y.iEExtensions && + recommendedCellsForPaging.extensions == y.extensions +} + +func (recommendedENBItem RecommendedENBItem) Equal(y RecommendedENBItem) bool { + return recommendedENBItem.MMEPagingTarget.Equal(y.MMEPagingTarget) && + recommendedENBItem.iEExtensions == y.iEExtensions && + recommendedENBItem.extensions == y.extensions && + recommendedENBItem.containerCrit == y.containerCrit +} + +func (recommendedENBList RecommendedENBList) Equal(y RecommendedENBList) bool { + if len(recommendedENBList) != len(y) { + return false + } + for i := range recommendedENBList { + if !(recommendedENBList[i].Equal(y[i])) { + return false + } + } + return true +} + +func (recommendedENBsForPaging RecommendedENBsForPaging) Equal(y RecommendedENBsForPaging) bool { + return recommendedENBsForPaging.RecommendedENBList.Equal(y.RecommendedENBList) && + recommendedENBsForPaging.iEExtensions == y.iEExtensions && + recommendedENBsForPaging.extensions == y.extensions +} + func (requestType RequestType) Equal(y RequestType) bool { return requestType.extensions == y.extensions && requestType.EventType == y.EventType && @@ -12232,6 +17278,9 @@ func (s1SetupRequest S1SetupRequest) Equal(y S1SetupRequest) bool { s1SetupRequest.SupportedTAs.Equal(y.SupportedTAs) && (s1SetupRequest.DefaultPagingDRX == nil) == (y.DefaultPagingDRX == nil) && (s1SetupRequest.DefaultPagingDRX == nil || (*s1SetupRequest.DefaultPagingDRX) == *y.DefaultPagingDRX) && (s1SetupRequest.UERetentionInformation == nil) == (y.UERetentionInformation == nil) && (s1SetupRequest.UERetentionInformation == nil || (*s1SetupRequest.UERetentionInformation) == *y.UERetentionInformation) && + s1SetupRequest.CSGIdList.Equal(y.CSGIdList) && + (s1SetupRequest.NBIoTDefaultPagingDRX == nil) == (y.NBIoTDefaultPagingDRX == nil) && (s1SetupRequest.NBIoTDefaultPagingDRX == nil || (*s1SetupRequest.NBIoTDefaultPagingDRX) == *y.NBIoTDefaultPagingDRX) && + s1SetupRequest.ConnectedengNBList.Equal(y.ConnectedengNBList) && s1SetupRequest.messageMeta.Equal(y.messageMeta) } @@ -12241,6 +17290,9 @@ func (s1SetupResponse S1SetupResponse) Equal(y S1SetupResponse) bool { (s1SetupResponse.RelativeMMECapacity == nil) == (y.RelativeMMECapacity == nil) && (s1SetupResponse.RelativeMMECapacity == nil || (*s1SetupResponse.RelativeMMECapacity) == *y.RelativeMMECapacity) && (s1SetupResponse.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (s1SetupResponse.CriticalityDiagnostics == nil || (*s1SetupResponse.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && (s1SetupResponse.UERetentionInformation == nil) == (y.UERetentionInformation == nil) && (s1SetupResponse.UERetentionInformation == nil || (*s1SetupResponse.UERetentionInformation) == *y.UERetentionInformation) && + (s1SetupResponse.MMERelaySupportIndicator == nil) == (y.MMERelaySupportIndicator == nil) && (s1SetupResponse.MMERelaySupportIndicator == nil || (*s1SetupResponse.MMERelaySupportIndicator) == *y.MMERelaySupportIndicator) && + (s1SetupResponse.ServedDCNs == nil) == (y.ServedDCNs == nil) && (s1SetupResponse.ServedDCNs == nil || (*s1SetupResponse.ServedDCNs).Equal(*y.ServedDCNs)) && + (s1SetupResponse.IABSupported == nil) == (y.IABSupported == nil) && (s1SetupResponse.IABSupported == nil || (*s1SetupResponse.IABSupported) == *y.IABSupported) && s1SetupResponse.messageMeta.Equal(y.messageMeta) } @@ -12285,6 +17337,35 @@ func (sTMSI STMSI) Equal(y STMSI) bool { return sTMSI == y } +func (scheduledCommunicationTime ScheduledCommunicationTime) Equal(y ScheduledCommunicationTime) bool { + return (scheduledCommunicationTime.DayofWeek == nil) == (y.DayofWeek == nil) && (scheduledCommunicationTime.DayofWeek == nil || (*scheduledCommunicationTime.DayofWeek) == *y.DayofWeek) && + (scheduledCommunicationTime.TimeofDayStart == nil) == (y.TimeofDayStart == nil) && (scheduledCommunicationTime.TimeofDayStart == nil || (*scheduledCommunicationTime.TimeofDayStart) == *y.TimeofDayStart) && + (scheduledCommunicationTime.TimeofDayEnd == nil) == (y.TimeofDayEnd == nil) && (scheduledCommunicationTime.TimeofDayEnd == nil || (*scheduledCommunicationTime.TimeofDayEnd) == *y.TimeofDayEnd) && + scheduledCommunicationTime.iEExtensions == y.iEExtensions && + scheduledCommunicationTime.extensions == y.extensions +} + +func (secondaryRATDataUsageReportItem SecondaryRATDataUsageReportItem) Equal(y SecondaryRATDataUsageReportItem) bool { + return secondaryRATDataUsageReportItem.ERABID == y.ERABID && + secondaryRATDataUsageReportItem.SecondaryRATType == y.SecondaryRATType && + secondaryRATDataUsageReportItem.ERABUsageReportList.Equal(y.ERABUsageReportList) && + secondaryRATDataUsageReportItem.iEExtensions == y.iEExtensions && + secondaryRATDataUsageReportItem.extensions == y.extensions && + secondaryRATDataUsageReportItem.containerCrit == y.containerCrit +} + +func (secondaryRATDataUsageReportList SecondaryRATDataUsageReportList) Equal(y SecondaryRATDataUsageReportList) bool { + if len(secondaryRATDataUsageReportList) != len(y) { + return false + } + for i := range secondaryRATDataUsageReportList { + if !(secondaryRATDataUsageReportList[i].Equal(y[i])) { + return false + } + } + return true +} + func (securityAlgorithms SecurityAlgorithms) Equal(y SecurityAlgorithms) bool { return securityAlgorithms == y } @@ -12297,6 +17378,22 @@ func (securityIndication SecurityIndication) Equal(y SecurityIndication) bool { return securityIndication == y } +func (servedDCNs ServedDCNs) Equal(y ServedDCNs) bool { + if len(servedDCNs) != len(y) { + return false + } + for i := range servedDCNs { + if !(servedDCNs[i].Equal(y[i])) { + return false + } + } + return true +} + +func (servedDCNsItem ServedDCNsItem) Equal(y ServedDCNsItem) bool { + return servedDCNsItem == y +} + func (servedGUMMEIs ServedGUMMEIs) Equal(y ServedGUMMEIs) bool { if len(servedGUMMEIs) != len(y) { return false @@ -12370,6 +17467,17 @@ func (statusTransferContainer StatusTransferContainer) Equal(y StatusTransferCon return true } +func (subscriptionBasedUEDifferentiationInfo SubscriptionBasedUEDifferentiationInfo) Equal(y SubscriptionBasedUEDifferentiationInfo) bool { + return (subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator == nil) == (y.PeriodicCommunicationIndicator == nil) && (subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator == nil || (*subscriptionBasedUEDifferentiationInfo.PeriodicCommunicationIndicator) == *y.PeriodicCommunicationIndicator) && + (subscriptionBasedUEDifferentiationInfo.PeriodicTime == nil) == (y.PeriodicTime == nil) && (subscriptionBasedUEDifferentiationInfo.PeriodicTime == nil || (*subscriptionBasedUEDifferentiationInfo.PeriodicTime) == *y.PeriodicTime) && + (subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime == nil) == (y.ScheduledCommunicationTime == nil) && (subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime == nil || (*subscriptionBasedUEDifferentiationInfo.ScheduledCommunicationTime).Equal(*y.ScheduledCommunicationTime)) && + (subscriptionBasedUEDifferentiationInfo.StationaryIndication == nil) == (y.StationaryIndication == nil) && (subscriptionBasedUEDifferentiationInfo.StationaryIndication == nil || (*subscriptionBasedUEDifferentiationInfo.StationaryIndication) == *y.StationaryIndication) && + (subscriptionBasedUEDifferentiationInfo.TrafficProfile == nil) == (y.TrafficProfile == nil) && (subscriptionBasedUEDifferentiationInfo.TrafficProfile == nil || (*subscriptionBasedUEDifferentiationInfo.TrafficProfile) == *y.TrafficProfile) && + (subscriptionBasedUEDifferentiationInfo.BatteryIndication == nil) == (y.BatteryIndication == nil) && (subscriptionBasedUEDifferentiationInfo.BatteryIndication == nil || (*subscriptionBasedUEDifferentiationInfo.BatteryIndication) == *y.BatteryIndication) && + subscriptionBasedUEDifferentiationInfo.iEExtensions == y.iEExtensions && + subscriptionBasedUEDifferentiationInfo.extensions == y.extensions +} + func (supportedTAItem SupportedTAItem) Equal(y SupportedTAItem) bool { return supportedTAItem.extensions == y.extensions && supportedTAItem.TAC == y.TAC && @@ -12503,6 +17611,18 @@ func (timeBasedHandoverInformation TimeBasedHandoverInformation) Equal(y TimeBas return timeBasedHandoverInformation == y } +func (timeSinceSecondaryNodeRelease TimeSinceSecondaryNodeRelease) Equal(y TimeSinceSecondaryNodeRelease) bool { + if len(timeSinceSecondaryNodeRelease) != len(y) { + return false + } + for i := range timeSinceSecondaryNodeRelease { + if !(timeSinceSecondaryNodeRelease[i] == y[i]) { + return false + } + } + return true +} + func (timeSynchronisationInfo TimeSynchronisationInfo) Equal(y TimeSynchronisationInfo) bool { return timeSynchronisationInfo.StratumLevel == y.StratumLevel && timeSynchronisationInfo.SynchronisationStatus == y.SynchronisationStatus && @@ -12594,6 +17714,10 @@ func (uECapabilityInfoIndication UECapabilityInfoIndication) Equal(y UECapabilit uECapabilityInfoIndication.ENBUES1APID == y.ENBUES1APID && uECapabilityInfoIndication.UERadioCapability.Equal(y.UERadioCapability) && uECapabilityInfoIndication.UERadioCapabilityForPaging.Equal(y.UERadioCapabilityForPaging) && + (uECapabilityInfoIndication.UEApplicationLayerMeasurementCapability == nil) == (y.UEApplicationLayerMeasurementCapability == nil) && (uECapabilityInfoIndication.UEApplicationLayerMeasurementCapability == nil || (*uECapabilityInfoIndication.UEApplicationLayerMeasurementCapability) == *y.UEApplicationLayerMeasurementCapability) && + (uECapabilityInfoIndication.LTEMIndication == nil) == (y.LTEMIndication == nil) && (uECapabilityInfoIndication.LTEMIndication == nil || (*uECapabilityInfoIndication.LTEMIndication) == *y.LTEMIndication) && + (uECapabilityInfoIndication.UERadioCapabilityNRFormat == nil) == (y.UERadioCapabilityNRFormat == nil) && (uECapabilityInfoIndication.UERadioCapabilityNRFormat == nil || (*uECapabilityInfoIndication.UERadioCapabilityNRFormat).Equal(*y.UERadioCapabilityNRFormat)) && + (uECapabilityInfoIndication.UERadioCapabilityForPagingNRFormat == nil) == (y.UERadioCapabilityForPagingNRFormat == nil) && (uECapabilityInfoIndication.UERadioCapabilityForPagingNRFormat == nil || (*uECapabilityInfoIndication.UERadioCapabilityForPagingNRFormat).Equal(*y.UERadioCapabilityForPagingNRFormat)) && uECapabilityInfoIndication.messageMeta.Equal(y.messageMeta) } @@ -12610,6 +17734,26 @@ func (uEContextModificationRequest UEContextModificationRequest) Equal(y UEConte uEContextModificationRequest.ENBUES1APID == y.ENBUES1APID && (uEContextModificationRequest.UEAggregateMaximumBitRate == nil) == (y.UEAggregateMaximumBitRate == nil) && (uEContextModificationRequest.UEAggregateMaximumBitRate == nil || (*uEContextModificationRequest.UEAggregateMaximumBitRate).Equal(*y.UEAggregateMaximumBitRate)) && (uEContextModificationRequest.TimeRefDistribution == nil) == (y.TimeRefDistribution == nil) && (uEContextModificationRequest.TimeRefDistribution == nil || (*uEContextModificationRequest.TimeRefDistribution) == *y.TimeRefDistribution) && + (uEContextModificationRequest.SecurityKey == nil) == (y.SecurityKey == nil) && (uEContextModificationRequest.SecurityKey == nil || (*uEContextModificationRequest.SecurityKey) == *y.SecurityKey) && + (uEContextModificationRequest.SubscriberProfileIDforRFP == nil) == (y.SubscriberProfileIDforRFP == nil) && (uEContextModificationRequest.SubscriberProfileIDforRFP == nil || (*uEContextModificationRequest.SubscriberProfileIDforRFP) == *y.SubscriberProfileIDforRFP) && + (uEContextModificationRequest.CSFallbackIndicator == nil) == (y.CSFallbackIndicator == nil) && (uEContextModificationRequest.CSFallbackIndicator == nil || (*uEContextModificationRequest.CSFallbackIndicator) == *y.CSFallbackIndicator) && + (uEContextModificationRequest.UESecurityCapabilities == nil) == (y.UESecurityCapabilities == nil) && (uEContextModificationRequest.UESecurityCapabilities == nil || (*uEContextModificationRequest.UESecurityCapabilities).Equal(*y.UESecurityCapabilities)) && + (uEContextModificationRequest.CSGMembershipStatus == nil) == (y.CSGMembershipStatus == nil) && (uEContextModificationRequest.CSGMembershipStatus == nil || (*uEContextModificationRequest.CSGMembershipStatus) == *y.CSGMembershipStatus) && + (uEContextModificationRequest.RegisteredLAI == nil) == (y.RegisteredLAI == nil) && (uEContextModificationRequest.RegisteredLAI == nil || (*uEContextModificationRequest.RegisteredLAI).Equal(*y.RegisteredLAI)) && + (uEContextModificationRequest.AdditionalCSFallbackIndicator == nil) == (y.AdditionalCSFallbackIndicator == nil) && (uEContextModificationRequest.AdditionalCSFallbackIndicator == nil || (*uEContextModificationRequest.AdditionalCSFallbackIndicator) == *y.AdditionalCSFallbackIndicator) && + (uEContextModificationRequest.ProSeAuthorized == nil) == (y.ProSeAuthorized == nil) && (uEContextModificationRequest.ProSeAuthorized == nil || (*uEContextModificationRequest.ProSeAuthorized).Equal(*y.ProSeAuthorized)) && + (uEContextModificationRequest.SRVCCOperationPossible == nil) == (y.SRVCCOperationPossible == nil) && (uEContextModificationRequest.SRVCCOperationPossible == nil || (*uEContextModificationRequest.SRVCCOperationPossible) == *y.SRVCCOperationPossible) && + (uEContextModificationRequest.SRVCCOperationNotPossible == nil) == (y.SRVCCOperationNotPossible == nil) && (uEContextModificationRequest.SRVCCOperationNotPossible == nil || (*uEContextModificationRequest.SRVCCOperationNotPossible) == *y.SRVCCOperationNotPossible) && + (uEContextModificationRequest.V2XServicesAuthorized == nil) == (y.V2XServicesAuthorized == nil) && (uEContextModificationRequest.V2XServicesAuthorized == nil || (*uEContextModificationRequest.V2XServicesAuthorized).Equal(*y.V2XServicesAuthorized)) && + (uEContextModificationRequest.UESidelinkAggregateMaximumBitrate == nil) == (y.UESidelinkAggregateMaximumBitrate == nil) && (uEContextModificationRequest.UESidelinkAggregateMaximumBitrate == nil || (*uEContextModificationRequest.UESidelinkAggregateMaximumBitrate).Equal(*y.UESidelinkAggregateMaximumBitrate)) && + (uEContextModificationRequest.NRUESecurityCapabilities == nil) == (y.NRUESecurityCapabilities == nil) && (uEContextModificationRequest.NRUESecurityCapabilities == nil || (*uEContextModificationRequest.NRUESecurityCapabilities).Equal(*y.NRUESecurityCapabilities)) && + (uEContextModificationRequest.AerialUEsubscriptionInformation == nil) == (y.AerialUEsubscriptionInformation == nil) && (uEContextModificationRequest.AerialUEsubscriptionInformation == nil || (*uEContextModificationRequest.AerialUEsubscriptionInformation) == *y.AerialUEsubscriptionInformation) && + (uEContextModificationRequest.AdditionalRRMPriorityIndex == nil) == (y.AdditionalRRMPriorityIndex == nil) && (uEContextModificationRequest.AdditionalRRMPriorityIndex == nil || (*uEContextModificationRequest.AdditionalRRMPriorityIndex) == *y.AdditionalRRMPriorityIndex) && + (uEContextModificationRequest.IABAuthorized == nil) == (y.IABAuthorized == nil) && (uEContextModificationRequest.IABAuthorized == nil || (*uEContextModificationRequest.IABAuthorized) == *y.IABAuthorized) && + (uEContextModificationRequest.NRV2XServicesAuthorized == nil) == (y.NRV2XServicesAuthorized == nil) && (uEContextModificationRequest.NRV2XServicesAuthorized == nil || (*uEContextModificationRequest.NRV2XServicesAuthorized).Equal(*y.NRV2XServicesAuthorized)) && + (uEContextModificationRequest.NRUESidelinkAggregateMaximumBitrate == nil) == (y.NRUESidelinkAggregateMaximumBitrate == nil) && (uEContextModificationRequest.NRUESidelinkAggregateMaximumBitrate == nil || (*uEContextModificationRequest.NRUESidelinkAggregateMaximumBitrate).Equal(*y.NRUESidelinkAggregateMaximumBitrate)) && + (uEContextModificationRequest.PC5QoSParameters == nil) == (y.PC5QoSParameters == nil) && (uEContextModificationRequest.PC5QoSParameters == nil || (*uEContextModificationRequest.PC5QoSParameters).Equal(*y.PC5QoSParameters)) && + (uEContextModificationRequest.UERadioCapabilityID == nil) == (y.UERadioCapabilityID == nil) && (uEContextModificationRequest.UERadioCapabilityID == nil || (*uEContextModificationRequest.UERadioCapabilityID).Equal(*y.UERadioCapabilityID)) && uEContextModificationRequest.messageMeta.Equal(y.messageMeta) } @@ -12631,6 +17775,10 @@ func (uEContextReleaseComplete UEContextReleaseComplete) Equal(y UEContextReleas (uEContextReleaseComplete.ENBUES1APID == nil) == (y.ENBUES1APID == nil) && (uEContextReleaseComplete.ENBUES1APID == nil || (*uEContextReleaseComplete.ENBUES1APID) == *y.ENBUES1APID) && (uEContextReleaseComplete.CriticalityDiagnostics == nil) == (y.CriticalityDiagnostics == nil) && (uEContextReleaseComplete.CriticalityDiagnostics == nil || (*uEContextReleaseComplete.CriticalityDiagnostics).Equal(*y.CriticalityDiagnostics)) && (uEContextReleaseComplete.UserLocationInformation == nil) == (y.UserLocationInformation == nil) && (uEContextReleaseComplete.UserLocationInformation == nil || (*uEContextReleaseComplete.UserLocationInformation).Equal(*y.UserLocationInformation)) && + (uEContextReleaseComplete.InformationOnRecommendedCellsAndENBsForPaging == nil) == (y.InformationOnRecommendedCellsAndENBsForPaging == nil) && (uEContextReleaseComplete.InformationOnRecommendedCellsAndENBsForPaging == nil || (*uEContextReleaseComplete.InformationOnRecommendedCellsAndENBsForPaging).Equal(*y.InformationOnRecommendedCellsAndENBsForPaging)) && + (uEContextReleaseComplete.CellIdentifierAndCELevelForCECapableUEs == nil) == (y.CellIdentifierAndCELevelForCECapableUEs == nil) && (uEContextReleaseComplete.CellIdentifierAndCELevelForCECapableUEs == nil || (*uEContextReleaseComplete.CellIdentifierAndCELevelForCECapableUEs).Equal(*y.CellIdentifierAndCELevelForCECapableUEs)) && + uEContextReleaseComplete.SecondaryRATDataUsageReportList.Equal(y.SecondaryRATDataUsageReportList) && + (uEContextReleaseComplete.TimeSinceSecondaryNodeRelease == nil) == (y.TimeSinceSecondaryNodeRelease == nil) && (uEContextReleaseComplete.TimeSinceSecondaryNodeRelease == nil || (*uEContextReleaseComplete.TimeSinceSecondaryNodeRelease).Equal(*y.TimeSinceSecondaryNodeRelease)) && uEContextReleaseComplete.messageMeta.Equal(y.messageMeta) } @@ -12639,6 +17787,7 @@ func (uEContextReleaseRequest UEContextReleaseRequest) Equal(y UEContextReleaseR uEContextReleaseRequest.ENBUES1APID == y.ENBUES1APID && (uEContextReleaseRequest.Cause == nil) == (y.Cause == nil) && (uEContextReleaseRequest.Cause == nil || (*uEContextReleaseRequest.Cause).Equal(*y.Cause)) && (uEContextReleaseRequest.GWContextReleaseIndication == nil) == (y.GWContextReleaseIndication == nil) && (uEContextReleaseRequest.GWContextReleaseIndication == nil || (*uEContextReleaseRequest.GWContextReleaseIndication) == *y.GWContextReleaseIndication) && + uEContextReleaseRequest.SecondaryRATDataUsageReportList.Equal(y.SecondaryRATDataUsageReportList) && uEContextReleaseRequest.messageMeta.Equal(y.messageMeta) } @@ -12696,6 +17845,18 @@ func (uERadioCapabilityForPaging UERadioCapabilityForPaging) Equal(y UERadioCapa return true } +func (uERadioCapabilityID UERadioCapabilityID) Equal(y UERadioCapabilityID) bool { + if len(uERadioCapabilityID) != len(y) { + return false + } + for i := range uERadioCapabilityID { + if !(uERadioCapabilityID[i] == y[i]) { + return false + } + } + return true +} + func (uES1APIDPair UES1APIDPair) Equal(y UES1APIDPair) bool { return uES1APIDPair == y } @@ -12710,6 +17871,10 @@ func (uESecurityCapabilities UESecurityCapabilities) Equal(y UESecurityCapabilit return uESecurityCapabilities == y } +func (uESidelinkAggregateMaximumBitrate UESidelinkAggregateMaximumBitrate) Equal(y UESidelinkAggregateMaximumBitrate) bool { + return uESidelinkAggregateMaximumBitrate == y +} + func (uplinkNASTransport UplinkNASTransport) Equal(y UplinkNASTransport) bool { return uplinkNASTransport.MMEUES1APID == y.MMEUES1APID && uplinkNASTransport.ENBUES1APID == y.ENBUES1APID && @@ -12718,6 +17883,9 @@ func (uplinkNASTransport UplinkNASTransport) Equal(y UplinkNASTransport) bool { (uplinkNASTransport.TAI == nil) == (y.TAI == nil) && (uplinkNASTransport.TAI == nil || (*uplinkNASTransport.TAI).Equal(*y.TAI)) && (uplinkNASTransport.GWTransportLayerAddress == nil) == (y.GWTransportLayerAddress == nil) && (uplinkNASTransport.GWTransportLayerAddress == nil || (*uplinkNASTransport.GWTransportLayerAddress) == *y.GWTransportLayerAddress) && (uplinkNASTransport.SIPTOLGWTransportLayerAddress == nil) == (y.SIPTOLGWTransportLayerAddress == nil) && (uplinkNASTransport.SIPTOLGWTransportLayerAddress == nil || (*uplinkNASTransport.SIPTOLGWTransportLayerAddress) == *y.SIPTOLGWTransportLayerAddress) && + (uplinkNASTransport.LHNID == nil) == (y.LHNID == nil) && (uplinkNASTransport.LHNID == nil || (*uplinkNASTransport.LHNID).Equal(*y.LHNID)) && + (uplinkNASTransport.PSCellInformation == nil) == (y.PSCellInformation == nil) && (uplinkNASTransport.PSCellInformation == nil || (*uplinkNASTransport.PSCellInformation).Equal(*y.PSCellInformation)) && + (uplinkNASTransport.LTENTNTAIInformation == nil) == (y.LTENTNTAIInformation == nil) && (uplinkNASTransport.LTENTNTAIInformation == nil || (*uplinkNASTransport.LTENTNTAIInformation).Equal(*y.LTENTNTAIInformation)) && uplinkNASTransport.messageMeta.Equal(y.messageMeta) } @@ -12744,6 +17912,17 @@ func (userLocationInformation UserLocationInformation) Equal(y UserLocationInfor userLocationInformation.iEExtensions == y.iEExtensions } +func (v2XServicesAuthorized V2XServicesAuthorized) Equal(y V2XServicesAuthorized) bool { + return (v2XServicesAuthorized.VehicleUE == nil) == (y.VehicleUE == nil) && (v2XServicesAuthorized.VehicleUE == nil || (*v2XServicesAuthorized.VehicleUE) == *y.VehicleUE) && + (v2XServicesAuthorized.PedestrianUE == nil) == (y.PedestrianUE == nil) && (v2XServicesAuthorized.PedestrianUE == nil || (*v2XServicesAuthorized.PedestrianUE) == *y.PedestrianUE) && + v2XServicesAuthorized.iEExtensions == y.iEExtensions && + v2XServicesAuthorized.extensions == y.extensions +} + +func (wUSAssistanceInformation WUSAssistanceInformation) Equal(y WUSAssistanceInformation) bool { + return wUSAssistanceInformation == y +} + func (warningAreaCoordinates WarningAreaCoordinates) Equal(y WarningAreaCoordinates) bool { if len(warningAreaCoordinates) != len(y) { return false diff --git a/s1ap/per_test_helpers_test.go b/s1ap/per_test_helpers_test.go index d488003ba2..930c04a0c0 100644 --- a/s1ap/per_test_helpers_test.go +++ b/s1ap/per_test_helpers_test.go @@ -8,6 +8,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func unmarshalPERValue[T any](b []byte) (T, error) { @@ -49,7 +50,7 @@ func deref[T any](p *T) T { //nolint:unparam func encodeIEContainer(w *per.Writer, enc per.Encoding, fields []ieField) error { - return ap.EncodeIEContainer(profile, w, enc, fields) + return apimpl.EncodeIEContainer(profile, w, enc, fields) } func typeOfError(d DiagnosticIE) TypeOfError { @@ -72,9 +73,9 @@ func firstIndex(p *RawPDU, id ProtocolIEID) int { } func encodeExtensionContainer(w *per.Writer, fields []ieField) error { - return ap.EncodeExtensionContainer(profile, w, per.Aligned, fields) + return apimpl.EncodeExtensionContainer(profile, w, per.Aligned, fields) } func decodeExtensionContainer[M any](r *per.Reader, table []ieSpec[M], m *M, meta *extensionMeta) error { - return ap.DecodeExtensionContainer(profile, r, per.Aligned, table, m, meta) + return apimpl.DecodeExtensionContainer(profile, r, per.Aligned, table, m, meta) } diff --git a/s1ap/pws.go b/s1ap/pws.go index 4522c039da..2ebe503fc5 100644 --- a/s1ap/pws.go +++ b/s1ap/pws.go @@ -436,7 +436,7 @@ var pWSRestartIndicationIEs = []ieSpec[PWSRestartIndication]{ return nil, false } - return seqOf(1, maxnoofCellsforRestart, m.ECGIListForRestart), true + return seqOf(1, maxnoofCellsforRestart, &m.ECGIListForRestart), true }, }, { @@ -460,7 +460,7 @@ var pWSRestartIndicationIEs = []ieSpec[PWSRestartIndication]{ return nil, false } - return seqOf(1, maxnoofRestartTAIs, m.TAIListForRestart), true + return seqOf(1, maxnoofRestartTAIs, &m.TAIListForRestart), true }, }, { @@ -477,7 +477,7 @@ var pWSRestartIndicationIEs = []ieSpec[PWSRestartIndication]{ return nil, false } - return seqOf(1, maxnoofRestartEmergencyAreaIDs, m.EmergencyAreaIDListForRestart), true + return seqOf(1, maxnoofRestartEmergencyAreaIDs, &m.EmergencyAreaIDListForRestart), true }, }, } @@ -532,7 +532,7 @@ var pWSFailureIndicationIEs = []ieSpec[PWSFailureIndication]{ return nil, false } - return seqOf(1, maxnoofCellsineNB, m.PWSFailedECGIList), true + return seqOf(1, maxnoofCellsineNB, &m.PWSFailedECGIList), true }, }, { diff --git a/s1ap/raw_pdu.go b/s1ap/raw_pdu.go index 94a7bcf69b..bddab09f52 100644 --- a/s1ap/raw_pdu.go +++ b/s1ap/raw_pdu.go @@ -4,10 +4,8 @@ package s1ap import ( - "iter" - - "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) var ( @@ -16,46 +14,14 @@ var ( ) type RawPDU struct { - m *ap.RawPDU[ProtocolIEID] + *ap.RawPDU[ProtocolIEID, ProcedureCode, TriggeringMessage] } func ParseRawPDU(b []byte) (*RawPDU, error) { - m, err := ap.ParseRawPDU[ProtocolIEID](profile, b) + m, err := apimpl.ParseRawPDU[ProtocolIEID, ProcedureCode, TriggeringMessage](profile, b) if err != nil { return nil, err } - return &RawPDU{m: m}, nil + return &RawPDU{m}, nil } - -func (p *RawPDU) Trigger() TriggeringMessage { return TriggeringMessage(p.m.Choice()) } - -func (p *RawPDU) ProcedureCode() ProcedureCode { return ProcedureCode(p.m.ProcedureCode()) } - -func (p *RawPDU) Criticality() Criticality { return p.m.Criticality() } - -func (p *RawPDU) Opaque() bool { return p.m.Opaque() } - -func (p *RawPDU) Body() []byte { return p.m.Body() } - -func (p *RawPDU) Len() int { return p.m.Len() } - -func (p *RawPDU) IE(i int) (RawIE, error) { return p.m.Field(i) } - -func (p *RawPDU) IEs() []RawIE { return p.m.Fields() } - -func (p *RawPDU) All(id ProtocolIEID) iter.Seq2[int, RawIE] { return p.m.All(id) } - -func (p *RawPDU) Index(id ProtocolIEID) (int, error) { return p.m.Index(id) } - -func (p *RawPDU) SetValue(i int, value []byte) error { return p.m.SetValue(i, value) } - -func (p *RawPDU) Insert(i int, ie RawIE) error { return p.m.Insert(i, ie) } - -func (p *RawPDU) Remove(i int) error { return p.m.Remove(i) } - -func (p *RawPDU) Marshal() ([]byte, error) { return p.m.Marshal() } - -func (p *RawPDU) Get(id ProtocolIEID, v per.Unmarshaler) (bool, error) { return p.m.Get(id, v) } - -func (p *RawPDU) Set(id ProtocolIEID, v per.Marshaler) error { return p.m.Set(id, v) } diff --git a/s1ap/raw_pdu_registry_test.go b/s1ap/raw_pdu_registry_test.go index 9f6cee2f38..2eacac0643 100644 --- a/s1ap/raw_pdu_registry_test.go +++ b/s1ap/raw_pdu_registry_test.go @@ -546,6 +546,30 @@ var typedCodecs = map[typedKey]func([]byte) (typedMessage, error){ return nil, err } + return m, nil + }, + {TriggeringInitiatingMessage, ProcS1Removal}: func(v []byte) (typedMessage, error) { + m, err := ParseS1RemovalRequest(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringSuccessfulOutcome, ProcS1Removal}: func(v []byte) (typedMessage, error) { + m, err := ParseS1RemovalResponse(v) + if err != nil { + return nil, err + } + + return m, nil + }, + {TriggeringUnsuccessfulOutcome, ProcS1Removal}: func(v []byte) (typedMessage, error) { + m, err := ParseS1RemovalFailure(v) + if err != nil { + return nil, err + } + return m, nil }, } diff --git a/s1ap/raw_pdu_test.go b/s1ap/raw_pdu_test.go index 4d109a8475..1a78934f9f 100644 --- a/s1ap/raw_pdu_test.go +++ b/s1ap/raw_pdu_test.go @@ -9,6 +9,7 @@ import ( "encoding/hex" "errors" "fmt" + "maps" "os" "os/exec" "path/filepath" @@ -20,7 +21,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type corpusPDU struct { @@ -37,6 +38,12 @@ type typedMessage interface { Marshal() ([]byte, error) } +var corpusWithoutTypedCodec = map[typedKey]bool{} + +var corpusRefusedByTypedCodec = map[string]string{ + "corpus.txt:6": "s1ap: S1Setup (17): protocol: abstract-syntax-error-reject (1): pagingDRX (44) (reject, not-understood)", +} + var hexLiteral = regexp.MustCompile(`"([0-9a-fA-F]{8,})"`) func loadCorpus(t testing.TB) []corpusPDU { @@ -270,8 +277,51 @@ func withEnvelopeOf(t *testing.T, re []byte, orig PDU) []byte { return b } +type corpusSkips struct { + unmodeled map[typedKey]bool + refused map[string]string +} + +func (s *corpusSkips) codec(c corpusPDU, pdu PDU) (func([]byte) (typedMessage, error), bool) { + key := typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()} + + codec, ok := typedCodecs[key] + if !ok { + s.unmodeled[key] = true + + return nil, false + } + + if _, err := codec(pdu.value()); err != nil { + s.refused[c.source] = err.Error() + + return nil, false + } + + return codec, true +} + +func (s *corpusSkips) check(t *testing.T) { + t.Helper() + + if !maps.Equal(s.unmodeled, corpusWithoutTypedCodec) { + t.Errorf("corpus PDUs without a typed codec %v, want %v", slices.Collect(maps.Keys(s.unmodeled)), slices.Collect(maps.Keys(corpusWithoutTypedCodec))) + } + + if !maps.Equal(s.refused, corpusRefusedByTypedCodec) { + t.Errorf("corpus PDUs the typed codec refuses %q, want %q", s.refused, corpusRefusedByTypedCodec) + } +} + +func newCorpusSkips() *corpusSkips { + return &corpusSkips{unmodeled: map[typedKey]bool{}, refused: map[string]string{}} +} + func TestTypedCodecReencodesCorpusExactly(t *testing.T) { - var exact, envelope, refused int + var exact, envelope int + + skips := newCorpusSkips() + defer skips.check(t) for _, c := range loadCorpus(t) { pdu, err := Unmarshal(c.b) @@ -279,16 +329,14 @@ func TestTypedCodecReencodesCorpusExactly(t *testing.T) { t.Fatal(err) } - codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + codec, ok := skips.codec(c, pdu) if !ok { continue } msg, err := codec(pdu.value()) if err != nil { - refused++ - - continue + t.Fatal(err) } re, err := msg.Marshal() @@ -311,7 +359,7 @@ func TestTypedCodecReencodesCorpusExactly(t *testing.T) { exact++ } - t.Logf("%d re-encoded byte for byte (%d of them under a procedure criticality other than the wire's), %d refused", exact, envelope, refused) + t.Logf("%d re-encoded byte for byte (%d of them under a procedure criticality other than the wire's)", exact, envelope) if exact < 20 { t.Fatalf("only %d corpus PDUs re-encoded", exact) @@ -319,7 +367,10 @@ func TestTypedCodecReencodesCorpusExactly(t *testing.T) { } func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { - var compared, refused, unmodeled int + var compared int + + skips := newCorpusSkips() + defer skips.check(t) for _, c := range loadCorpus(t) { pdu, err := Unmarshal(c.b) @@ -327,9 +378,8 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { t.Fatal(err) } - codec, ok := typedCodecs[typedKey{TriggeringMessage(pdu.choiceIndex()), pdu.procedureCode()}] + codec, ok := skips.codec(c, pdu) if !ok { - unmodeled++ continue } @@ -346,8 +396,7 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { for _, v := range ueIDValues[s.field] { msg, err := codec(pdu.value()) if err != nil { - refused++ - break + t.Fatal(err) } re, err := msg.Marshal() @@ -392,7 +441,7 @@ func TestRawPDUSpliceMatchesTypedCodec(t *testing.T) { } } - t.Logf("compared %d splices with the typed codec; typed codec skipped: %d refused, %d unmodeled", compared, refused, unmodeled) + t.Logf("compared %d splices with the typed codec", compared) if compared < 20 { t.Fatalf("only %d comparisons", compared) @@ -719,9 +768,9 @@ func TestRawPDUUnmodeledProcedure(t *testing.T) { body.WriteBit(false) if err := encodeIEContainer(body, per.Aligned, []ieField{ - {ID: 60000, Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0xde, 0xad})}, - {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(id)}, - {ID: 60001, Criticality: CriticalityIgnore, Value: ap.RawValue(bytes.Repeat([]byte{0xbe}, 200))}, + {ID: 60000, Criticality: CriticalityNotify, Value: apimpl.RawValue([]byte{0xde, 0xad})}, + {ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: apimpl.RawValue(id)}, + {ID: 60001, Criticality: CriticalityIgnore, Value: apimpl.RawValue(bytes.Repeat([]byte{0xbe}, 200))}, }); err != nil { t.Fatal(err) } diff --git a/s1ap/raw_pdu_ue_ids_test.go b/s1ap/raw_pdu_ue_ids_test.go index 0149f10f01..b121c7de84 100644 --- a/s1ap/raw_pdu_ue_ids_test.go +++ b/s1ap/raw_pdu_ue_ids_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func handUEContextReleaseCommand(t *testing.T, enb uint32) []byte { @@ -41,8 +41,8 @@ func handUEContextReleaseCommand(t *testing.T, enb uint32) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, enc, []ieField{ - {ID: IDUES1APIDs, Criticality: CriticalityReject, Value: ap.RawValue(ids.Bytes())}, - {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, + {ID: IDUES1APIDs, Criticality: CriticalityReject, Value: apimpl.RawValue(ids.Bytes())}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: apimpl.RawValue(cause)}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcUEContextRelease, Criticality: CriticalityReject, Value: body.Bytes()}) diff --git a/s1ap/reset.go b/s1ap/reset.go index 2f2478031d..80b36a01c5 100644 --- a/s1ap/reset.go +++ b/s1ap/reset.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) // TS 36.413, S1AP-Constants. @@ -139,7 +140,7 @@ var resetAcknowledgeIEs = []ieSpec[ResetAcknowledge]{ return nil, false } - return containerList(maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityIgnore, m.ConnectionList), true + return containerList(maxnoofIndividualS1ConnectionsToReset, IDUEAssociatedLogicalS1ConnectionItem, CriticalityIgnore, &m.ConnectionList), true }, }, { @@ -191,3 +192,7 @@ func ParseResetAcknowledge(value []byte) (*ResetAcknowledge, error) { func DecodeResetAcknowledge(value []byte) (*ResetAcknowledge, error) { return decodeMessageBody[ResetAcknowledge](ProcReset, resetAcknowledgeIEs, value) } + +func (l *UEAssociatedLogicalS1ConnectionListRes) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDUEAssociatedLogicalS1ConnectionItem, CriticalityReject, l) +} diff --git a/s1ap/reset_extensions_test.go b/s1ap/reset_extensions_test.go index 8c7ac3aac1..926599f64d 100644 --- a/s1ap/reset_extensions_test.go +++ b/s1ap/reset_extensions_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) type handItem struct { @@ -79,7 +79,7 @@ func encodeHandList(t *testing.T, w *per.Writer, crit Criticality, items []handI mustNil(t, per.EncodeLength(w, per.Aligned, 1, maxnoofIndividualS1ConnectionsToReset, true, int64(len(items)), func(int64) error { for _, it := range items { - if err := encodeContainerField(w, per.Aligned, ieField{ID: IDUEAssociatedLogicalS1ConnectionItem, Criticality: crit, Value: ap.RawValue(encodeHandItem(t, it))}); err != nil { + if err := encodeContainerField(w, per.Aligned, ieField{ID: IDUEAssociatedLogicalS1ConnectionItem, Criticality: crit, Value: apimpl.RawValue(encodeHandItem(t, it))}); err != nil { return err } } @@ -102,8 +102,8 @@ func handReset(t *testing.T, items []handItem) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {ID: IDCause, Criticality: CriticalityIgnore, Value: ap.RawValue(cause)}, - {ID: IDResetType, Criticality: CriticalityReject, Value: ap.RawValue(rt.Bytes())}, + {ID: IDCause, Criticality: CriticalityIgnore, Value: apimpl.RawValue(cause)}, + {ID: IDResetType, Criticality: CriticalityReject, Value: apimpl.RawValue(rt.Bytes())}, })) b, err := Marshal(&InitiatingMessage{ProcedureCode: ProcReset, Criticality: CriticalityReject, Value: body.Bytes()}) @@ -121,7 +121,7 @@ func handResetAck(t *testing.T, items []handItem) []byte { body := per.NewWriter() body.WriteBit(false) mustNil(t, encodeIEContainer(body, per.Aligned, []ieField{ - {ID: IDUEAssociatedLogicalS1ConnectionListResAck, Criticality: CriticalityIgnore, Value: ap.RawValue(list.Bytes())}, + {ID: IDUEAssociatedLogicalS1ConnectionListResAck, Criticality: CriticalityIgnore, Value: apimpl.RawValue(list.Bytes())}, })) b, err := Marshal(&SuccessfulOutcome{ProcedureCode: ProcReset, Criticality: CriticalityReject, Value: body.Bytes()}) diff --git a/s1ap/s1_setup.go b/s1ap/s1_setup.go index d86f5f9d8c..1064dc0aa6 100644 --- a/s1ap/s1_setup.go +++ b/s1ap/s1_setup.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.8.4. @@ -15,6 +16,9 @@ type S1SetupRequest struct { DefaultPagingDRX *PagingDRX // What the eNB offers (§8.7.3.2); the MME never accepts it. UERetentionInformation *UERetentionInformation + CSGIdList CSGIdList + NBIoTDefaultPagingDRX *NBIoTDefaultPagingDRX + ConnectedengNBList ConnectedengNBList messageMeta } @@ -77,6 +81,7 @@ var s1SetupRequestIEs = []ieSpec[S1SetupRequest]{ return m.DefaultPagingDRX, true }, }, + apimpl.ListIE(IDCSGIdList, CriticalityReject, func(m *S1SetupRequest) *CSGIdList { return &m.CSGIdList }), { ID: IDUERetentionInformation, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *S1SetupRequest, r *per.Reader, enc per.Encoding) error { @@ -98,6 +103,8 @@ var s1SetupRequestIEs = []ieSpec[S1SetupRequest]{ return m.UERetentionInformation, true }, }, + apimpl.OptionalIE(IDNBIoTDefaultPagingDRX, CriticalityIgnore, func(m *S1SetupRequest) **NBIoTDefaultPagingDRX { return &m.NBIoTDefaultPagingDRX }), + apimpl.ListIE(IDConnectedengNBList, CriticalityIgnore, func(m *S1SetupRequest) *ConnectedengNBList { return &m.ConnectedengNBList }), } func (m *S1SetupRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/s1_setup_resp.go b/s1ap/s1_setup_resp.go index b4b70b808a..6a366d9cda 100644 --- a/s1ap/s1_setup_resp.go +++ b/s1ap/s1_setup_resp.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.8.5. @@ -15,7 +16,10 @@ type S1SetupResponse struct { CriticalityDiagnostics *CriticalityDiagnostics // Whether the MME retained UE contexts across the setup (§8.7.3.2); Ella // Core never does, so it is left absent on send. - UERetentionInformation *UERetentionInformation + UERetentionInformation *UERetentionInformation + MMERelaySupportIndicator *MMERelaySupportIndicator + ServedDCNs *ServedDCNs + IABSupported *IABSupported messageMeta } @@ -82,6 +86,7 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ }), true }, }, + apimpl.OptionalIE(IDMMERelaySupportIndicator, CriticalityIgnore, func(m *S1SetupResponse) **MMERelaySupportIndicator { return &m.MMERelaySupportIndicator }), { ID: IDCriticalityDiagnostics, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *S1SetupResponse, r *per.Reader, enc per.Encoding) error { @@ -124,6 +129,8 @@ var s1SetupResponseIEs = []ieSpec[S1SetupResponse]{ return m.UERetentionInformation, true }, }, + apimpl.OptionalIE(IDServedDCNs, CriticalityIgnore, func(m *S1SetupResponse) **ServedDCNs { return &m.ServedDCNs }), + apimpl.OptionalIE(IDIABSupported, CriticalityIgnore, func(m *S1SetupResponse) **IABSupported { return &m.IABSupported }), } func (m *S1SetupResponse) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/struct_compare_test.go b/s1ap/struct_compare_test.go new file mode 100644 index 0000000000..882481c171 --- /dev/null +++ b/s1ap/struct_compare_test.go @@ -0,0 +1,107 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "go/ast" + "go/importer" + "go/parser" + "go/token" + "go/types" + "path/filepath" + "reflect" + "strings" + "testing" +) + +func holdsReference(t types.Type, seen map[types.Type]bool) bool { + if seen[t] { + return false + } + + seen[t] = true + + switch u := t.Underlying().(type) { + case *types.Pointer, *types.Slice, *types.Map, *types.Signature, *types.Interface, *types.Chan: + return true + case *types.Array: + return holdsReference(u.Elem(), seen) + case *types.Struct: + for i := range u.NumFields() { + if holdsReference(u.Field(i).Type(), seen) { + return true + } + } + } + + return false +} + +func comparesByReference(t types.Type) bool { + n, ok := t.(*types.Named) + if !ok || n.Obj().Pkg() == nil { + return false + } + + if _, ok := t.Underlying().(*types.Struct); !ok { + return false + } + + return strings.HasPrefix(n.Obj().Pkg().Path(), "github.com/ellanetworks/core/") && holdsReference(t, map[types.Type]bool{}) +} + +func TestNoEqualityOperatorOnReferenceHoldingStructs(t *testing.T) { + if testing.Short() { + t.Skip("type-checks the package from source") + } + + names, err := filepath.Glob("*.go") + if err != nil { + t.Fatal(err) + } + + fset := token.NewFileSet() + pkgName := reflect.TypeFor[ProtocolIEID]().PkgPath() + + var files []*ast.File + + for _, name := range names { + f, err := parser.ParseFile(fset, name, nil, 0) + if err != nil { + t.Fatal(err) + } + + if f.Name.Name == filepath.Base(pkgName) { + files = append(files, f) + } + } + + info := &types.Info{Types: map[ast.Expr]types.TypeAndValue{}} + conf := types.Config{Importer: importer.ForCompiler(fset, "source", nil)} + + if _, err := conf.Check(pkgName, fset, files, info); err != nil { + t.Fatal(err) + } + + for _, f := range files { + ast.Inspect(f, func(n ast.Node) bool { + switch x := n.(type) { + case *ast.BinaryExpr: + if x.Op != token.EQL && x.Op != token.NEQ { + return true + } + + if ty := info.TypeOf(x.X); ty != nil && comparesByReference(ty) { + t.Errorf("%s: %s on %s compares pointers, not values: use Equal", fset.Position(x.OpPos), x.Op, ty) + } + case *ast.MapType: + if ty := info.TypeOf(x.Key); ty != nil && comparesByReference(ty) { + t.Errorf("%s: map keyed by %s compares pointers, not values", fset.Position(x.Pos()), ty) + } + } + + return true + }) + } +} diff --git a/s1ap/table_order_test.go b/s1ap/table_order_test.go index 4306089916..7cdea67085 100644 --- a/s1ap/table_order_test.go +++ b/s1ap/table_order_test.go @@ -4,99 +4,31 @@ package s1ap import ( + "reflect" + "slices" "testing" ) -// TestTableOrderMatchesASN1 pins the IEs each table models to their relative -// order in the message's S1AP-PROTOCOL-IES container (TS 36.413 §9.3.3), which -// is the order encode emits them in. IEs a table does not model are not pinned. func TestTableOrderMatchesASN1(t *testing.T) { - tests := []struct { - name string - got []ProtocolIEID - want []ProtocolIEID - }{ - {"ENBConfigurationTransfer", tableIDs(eNBConfigurationTransferIEs), []ProtocolIEID{IDSONConfigurationTransferECT}}, - {"MMEConfigurationTransfer", tableIDs(mMEConfigurationTransferIEs), []ProtocolIEID{IDSONConfigurationTransferMCT}}, - {"ENBConfigurationUpdate", tableIDs(eNBConfigurationUpdateIEs), []ProtocolIEID{IDENBname, IDSupportedTAs, IDDefaultPagingDRX}}, - {"ENBConfigurationUpdateAcknowledge", tableIDs(eNBConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, - {"ENBConfigurationUpdateFailure", tableIDs(eNBConfigurationUpdateFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, - {"MMEConfigurationUpdate", tableIDs(mMEConfigurationUpdateIEs), []ProtocolIEID{IDMMEname, IDServedGUMMEIs, IDRelativeMMECapacity}}, - {"MMEConfigurationUpdateAcknowledge", tableIDs(mMEConfigurationUpdateAcknowledgeIEs), []ProtocolIEID{IDCriticalityDiagnostics}}, - {"MMEConfigurationUpdateFailure", tableIDs(mMEConfigurationUpdateFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, - {"ERABModificationConfirm", tableIDs(erabModificationConfirmIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABModifyListBearerModConf, IDERABFailedToModifyListBearerModConf, IDERABToBeReleasedListBearerModConf, IDCriticalityDiagnostics}}, - {"ERABModificationIndication", tableIDs(eRABModificationIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABToBeModifiedListBearerModInd, IDERABNotToBeModifiedListBearerModInd, IDTunnelInformationForBBF, IDUserLocationInformation}}, - {"ERABModifyRequest", tableIDs(eRABModifyRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeModifiedListBearerModReq}}, - {"ERABModifyResponse", tableIDs(eRABModifyResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABModifyListBearerModRes, IDERABFailedToModifyList, IDCriticalityDiagnostics, IDUserLocationInformation}}, - {"ERABReleaseCommand", tableIDs(eRABReleaseCommandIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeReleasedList, IDNASPDU}}, - {"ERABReleaseIndication", tableIDs(eRABReleaseIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABReleasedList, IDUserLocationInformation}}, - {"ERABReleaseResponse", tableIDs(eRABReleaseResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABReleaseListBearerRelComp, IDERABFailedToReleaseList, IDCriticalityDiagnostics, IDUserLocationInformation}}, - {"ERABSetupRequest", tableIDs(eRABSetupRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSetupListBearerSUReq}}, - {"ERABSetupResponse", tableIDs(eRABSetupResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABSetupListBearerSURes, IDERABFailedToSetupListBearerSURes, IDCriticalityDiagnostics, IDUserLocationInformation}}, - {"ErrorIndication", tableIDs(errorIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics, IDSTMSI}}, - {"TraceStart", tableIDs(traceStartIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDTraceActivation}}, - {"TraceFailureIndication", tableIDs(traceFailureIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANTraceID, IDCause}}, - {"HandoverCancel", tableIDs(handoverCancelIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause}}, - {"HandoverCancelAcknowledge", tableIDs(handoverCancelAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCriticalityDiagnostics}}, - {"HandoverNotify", tableIDs(handoverNotifyIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANCGI, IDTAI, IDTunnelInformationForBBF}}, - {"HandoverRequired", tableIDs(handoverRequiredIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDHandoverType, IDCause, IDTargetID, IDDirectForwardingPathAvailability, IDSourceToTargetTransparentContainer}}, - {"HandoverCommand", tableIDs(handoverCommandIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDHandoverType, IDNASSecurityParametersfromEUTRAN, IDERABSubjecttoDataForwardingList, IDERABtoReleaseListHOCmd, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, - {"HandoverPreparationFailure", tableIDs(handoverPreparationFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"HandoverRequest", tableIDs(handoverRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDHandoverType, IDCause, IDUEAggregateMaximumBitrate, IDERABToBeSetupListHOReq, IDSourceToTargetTransparentContainer, IDUESecurityCapabilities, IDHandoverRestrictionList, IDTraceActivation, IDSecurityContext, IDNASSecurityParameterstoEUTRAN, IDGUMMEI, IDMMEUES1APID2, IDTimeRefDistribution}}, - {"HandoverRequestAcknowledge", tableIDs(handoverRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABAdmittedList, IDERABFailedToSetupListHOReqAck, IDTargetToSourceTransparentContainer, IDCriticalityDiagnostics}}, - {"HandoverFailure", tableIDs(handoverFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"InitialContextSetupRequest", tableIDs(initialContextSetupRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSetupListCtxtSUReq, IDUESecurityCapabilities, IDSecurityKey, IDUERadioCapability, IDGUMMEI, IDMMEUES1APID2, IDCoarseUELocation, IDTimeRefDistribution}}, - {"InitialContextSetupResponse", tableIDs(initialContextSetupResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDERABSetupListCtxtSURes, IDERABFailedToSetupListCtxtSURes, IDCriticalityDiagnostics}}, - {"InitialContextSetupFailure", tableIDs(initialContextSetupFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"LocationReport", tableIDs(locationReportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDEUTRANCGI, IDTAI, IDRequestType}}, - {"NASNonDeliveryIndication", tableIDs(nASNonDeliveryIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDCause}}, - {"InitialUEMessage", tableIDs(initialUEMessageIEs), []ProtocolIEID{IDENBUES1APID, IDNASPDU, IDTAI, IDEUTRANCGI, IDRRCEstablishmentCause, IDSTMSI, IDGUMMEI, IDGWTransportLayerAddress, IDTunnelInformationForBBF, IDSIPTOLGWTransportLayerAddress, IDCoarseUELocationRequested}}, - {"UplinkNASTransport", tableIDs(uplinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDEUTRANCGI, IDTAI, IDGWTransportLayerAddress, IDSIPTOLGWTransportLayerAddress}}, - {"DownlinkNASTransport", tableIDs(downlinkNASTransportIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDNASPDU, IDCoarseUELocation}}, - {"Paging", tableIDs(pagingIEs), []ProtocolIEID{IDUEIdentityIndexValue, IDUEPagingID, IDPagingDRX, IDCNDomain, IDTAIList, IDPagingPriority, IDUERadioCapabilityForPaging}}, - {"PathSwitchRequest", tableIDs(pathSwitchRequestIEs), []ProtocolIEID{IDENBUES1APID, IDERABToBeSwitchedDLList, IDSourceMMEUES1APID, IDEUTRANCGI, IDTAI, IDUESecurityCapabilities, IDSourceMMEGUMMEI, IDTunnelInformationForBBF}}, - {"PathSwitchRequestAcknowledge", tableIDs(pathSwitchRequestAcknowledgeIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDERABToBeSwitchedULList, IDERABToBeReleasedList, IDSecurityContext, IDMMEUES1APID2, IDUESecurityCapabilities, IDTimeRefDistribution}}, - {"E-RABToBeModifyItemBearerModReqExtIEs", tableIDs(extIEsERABToBeModifiedItemBearerModReq), []ProtocolIEID{IDTransportInformation}}, - {"E-RABToBeSetupItemHOReq-ExtIEs", tableIDs(extIEsERABToBeSetupItemHOReq), []ProtocolIEID{IDDataForwardingNotPossible, IDBearerType, IDEthernetType, IDSecurityIndication}}, - {"E-RABToBeSetupItemCtxtSUReqExtIEs", tableIDs(extIEsERABToBeSetupItemCtxtSUReq), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, - {"E-RABToBeSetupItemBearerSUReqExtIEs", tableIDs(extIEsERABToBeSetupItemBearerSUReq), []ProtocolIEID{IDCorrelationID, IDSIPTOCorrelationID, IDBearerType, IDEthernetType, IDSecurityIndication}}, - {"E-RABToBeSwitchedDLItem-ExtIEs", tableIDs(extIEsERABToBeSwitchedDLItem), []ProtocolIEID{IDSecurityIndication}}, - {"E-RABQoSParameters-ExtIEs", tableIDs(extIEsERABLevelQoSParameters), []ProtocolIEID{IDDownlinkPacketLossRate, IDUplinkPacketLossRate}}, - {"GBR-QosInformation-ExtIEs", tableIDs(extIEsGBRQosInformation), []ProtocolIEID{IDExtendedERABMaximumBitrateDL, IDExtendedERABMaximumBitrateUL, IDExtendedERABGuaranteedBitrateDL, IDExtendedERABGuaranteedBitrateUL}}, - {"PathSwitchRequestFailure", tableIDs(pathSwitchRequestFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"Reset", tableIDs(resetIEs), []ProtocolIEID{IDCause, IDResetType}}, - {"ResetAcknowledge", tableIDs(resetAcknowledgeIEs), []ProtocolIEID{IDUEAssociatedLogicalS1ConnectionListResAck, IDCriticalityDiagnostics}}, - {"S1SetupRequest", tableIDs(s1SetupRequestIEs), []ProtocolIEID{IDGlobalENBID, IDENBname, IDSupportedTAs, IDDefaultPagingDRX, IDUERetentionInformation}}, - {"S1SetupFailure", tableIDs(s1SetupFailureIEs), []ProtocolIEID{IDCause, IDTimeToWait, IDCriticalityDiagnostics}}, - {"S1SetupResponse", tableIDs(s1SetupResponseIEs), []ProtocolIEID{IDMMEname, IDServedGUMMEIs, IDRelativeMMECapacity, IDCriticalityDiagnostics, IDUERetentionInformation}}, - {"ENBStatusTransfer", tableIDs(eNBStatusTransferIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDENBStatusTransferTransparentContainer}}, - {"MMEStatusTransfer", tableIDs(mMEStatusTransferIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDENBStatusTransferTransparentContainer}}, - {"UECapabilityInfoIndication", tableIDs(uECapabilityInfoIndicationIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUERadioCapability, IDUERadioCapabilityForPaging}}, - {"UEContextModificationRequest", tableIDs(uEContextModificationRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDUEAggregateMaximumBitrate, IDTimeRefDistribution}}, - {"S1RemovalRequest", tableIDs(s1RemovalRequestIEs), []ProtocolIEID{IDGlobalENBID}}, - {"S1RemovalResponse", tableIDs(s1RemovalResponseIEs), []ProtocolIEID{IDMMEname, IDCriticalityDiagnostics}}, - {"S1RemovalFailure", tableIDs(s1RemovalFailureIEs), []ProtocolIEID{IDCause, IDCriticalityDiagnostics}}, - {"SONConfigurationTransfer-ExtIEs", tableIDs(extIEsSONConfigurationTransfer), []ProtocolIEID{IDX2TNLConfigurationInfo, IDSynchronisationInformation, IDRequestedTNLInfo}}, - {"UEContextModificationResponse", tableIDs(uEContextModificationResponseIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCriticalityDiagnostics}}, - {"UEContextModificationFailure", tableIDs(uEContextModificationFailureIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDCriticalityDiagnostics}}, - {"UEContextReleaseCommand", tableIDs(uEContextReleaseCommandIEs), []ProtocolIEID{IDUES1APIDs, IDCause}}, - {"UEContextReleaseComplete", tableIDs(uEContextReleaseCompleteIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCriticalityDiagnostics, IDUserLocationInformation}}, - {"UEContextReleaseRequest", tableIDs(uEContextReleaseRequestIEs), []ProtocolIEID{IDMMEUES1APID, IDENBUES1APID, IDCause, IDGWContextReleaseIndication}}, + for _, c := range messageCases() { + t.Run(c.asn1, func(t *testing.T) { + want := asn1Rows(t, c.asn1, "ProtocolIE-Container") + if !slices.Equal(c.rows, want) { + t.Errorf("table %v\nspec %v", c.rows, want) + } + }) } +} - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if len(tt.got) != len(tt.want) { - t.Fatalf("%d IEs, want %d: %v vs %v", len(tt.got), len(tt.want), tt.got, tt.want) - } +func TestMessageCasesAreComplete(t *testing.T) { + cases := messageCases() - for i := range tt.got { - if tt.got[i] != tt.want[i] { - t.Errorf("row %d = %s, want %s", i, tt.got[i], tt.want[i]) - } - } - }) + types := make([]reflect.Type, len(cases)) + for i, c := range cases { + types[i] = c.typ } + + checkComplete(t, "IE table", scannedDecls(t).ieTables, types) } func tableIDs[M any](table []ieSpec[M]) []ProtocolIEID { diff --git a/s1ap/testdata/fuzz/FuzzERABListRoundTrip/e8cac6a79c81d833 b/s1ap/testdata/fuzz/FuzzERABListRoundTrip/e8cac6a79c81d833 new file mode 100644 index 0000000000..19600e4b98 --- /dev/null +++ b/s1ap/testdata/fuzz/FuzzERABListRoundTrip/e8cac6a79c81d833 @@ -0,0 +1,3 @@ +go test fuzz v1 +byte('i') +[]byte("\x00000\x00") diff --git a/s1ap/tnl_lossless_test.go b/s1ap/tnl_lossless_test.go index f0697c5031..8dbb80d375 100644 --- a/s1ap/tnl_lossless_test.go +++ b/s1ap/tnl_lossless_test.go @@ -11,6 +11,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const idUnknownExtension ProtocolIEID = 999 @@ -87,11 +88,11 @@ func tnlQoS() ERABLevelQoSParameters { } func ignoreCrit() containerCrit { - return containerCrit{crit: ap.WireCriticality(CriticalityIgnore) + 1} + return apimpl.ListItemCriticality[ProtocolIEID](CriticalityIgnore) } func rejectCrit() containerCrit { - return containerCrit{crit: ap.WireCriticality(CriticalityReject) + 1} + return apimpl.ListItemCriticality[ProtocolIEID](CriticalityReject) } type tnlValue interface { @@ -223,7 +224,7 @@ func TestTNLItemsLossless(t *testing.T) { container := tnlExtensionContainer( ieField{ID: IDTransportInformation, Criticality: CriticalityReject, Value: &TransportInformation{TransportLayerAddress: goldTLA(), ULGTPTEID: 4, extensions: add()}}, - ieField{ID: idUnknownExtension, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x5a})}, + ieField{ID: idUnknownExtension, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x5a})}, ) if err := decodeExtensionContainer(per.NewReader(container), extIEsERABToBeModifiedItemBearerModReq, in, &in.iEExtensions); err != nil { @@ -243,7 +244,7 @@ func TestTNLItemsLossless(t *testing.T) { in := &ERABToBeSetupItemHOReq{ERABID: 9, TransportLayerAddress: goldTLA(), GTPTEID: 6, QoS: tnlQoS(), extensions: add()} container := tnlExtensionContainer( - ieField{ID: idUnknownExtension, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x5a})}, + ieField{ID: idUnknownExtension, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x5a})}, ieField{ID: IDDataForwardingNotPossible, Criticality: CriticalityIgnore, Value: DataForwardingNotPossibleTrue}, ) @@ -284,7 +285,7 @@ func TestTNLItemsLossless(t *testing.T) { func TestTNLItemUnknownRejectExtensionNotComprehended(t *testing.T) { w := per.NewWriter() - if err := encodeExtensionContainer(w, []ieField{{ID: idUnknownExtension, Criticality: CriticalityReject, Value: ap.RawValue([]byte{0x00})}}); err != nil { + if err := encodeExtensionContainer(w, []ieField{{ID: idUnknownExtension, Criticality: CriticalityReject, Value: apimpl.RawValue([]byte{0x00})}}); err != nil { t.Fatal(err) } @@ -675,7 +676,7 @@ func tableCrits[M any](table []ieSpec[M]) []Criticality { func TestTNLItemKeepsManyUnknownExtensions(t *testing.T) { fields := make([]ieField, 0, 3*paddingIEs) for i := range 3 * paddingIEs { - fields = append(fields, ieField{ID: idUnknownExtension + ProtocolIEID(i), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{byte(i) | 1})}) + fields = append(fields, ieField{ID: idUnknownExtension + ProtocolIEID(i), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{byte(i) | 1})}) } in := &ERABToBeSetupItemCtxtSUReq{ERABID: 5, QoS: goldQoS(), TransportLayerAddress: goldTLA(), GTPTEID: 1, BearerType: Ptr(BearerTypeNonIP)} diff --git a/s1ap/transparent_container.go b/s1ap/transparent_container.go index d9ed78e89d..e36a4cff7f 100644 --- a/s1ap/transparent_container.go +++ b/s1ap/transparent_container.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" ) const maxnoofCellsinUEHistoryInfo = 16 @@ -85,6 +86,7 @@ type ERABInformationListItem struct { SourceNodeTransportLayerAddress *TransportLayerAddress `per:",extie:IDSourceNodeTransportLayerAddress,crit:ignore"` iEExtensions extensionMeta `per:",exttable"` extensions per.ExtensionAdditions `per:",extraw"` + containerCrit `per:"-"` } type ERABInformationList []ERABInformationListItem @@ -227,3 +229,7 @@ type LastVisitedGERANCellInformation struct { Undefined *per.Null `per:",choice:0"` Ext *per.ExtensionAlternative `per:",extalt"` } + +func (l *ERABInformationList) Diagnose(d *ap.Diagnosis[ProtocolIEID]) bool { + return diagnoseItemList(d, IDERABInformationListItem, CriticalityIgnore, l) +} diff --git a/s1ap/transparent_container_test.go b/s1ap/transparent_container_test.go index 5e243cd3af..e810bb67b4 100644 --- a/s1ap/transparent_container_test.go +++ b/s1ap/transparent_container_test.go @@ -13,6 +13,7 @@ import ( "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) const goldenSourceeNBContainer = "60018001004e40024500004e4001060002f839abcdef10ff100002f83900001011800fff800d0c0002f839000000010080001e" @@ -197,7 +198,7 @@ func handSourceeNBContainer(t *testing.T, extCrit Criticality) []byte { handAdditions(t, item) item.AlignToByte() - return encodeContainerField(w, enc, ieField{ID: IDERABInformationListItem, Criticality: CriticalityIgnore, Value: ap.RawValue(item.Bytes())}) + return encodeContainerField(w, enc, ieField{ID: IDERABInformationListItem, Criticality: CriticalityIgnore, Value: apimpl.RawValue(item.Bytes())}) })) mustNil(t, (&EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 0xabcdef1}).MarshalPER(w, enc)) @@ -288,7 +289,7 @@ func TestSourceeNBToTargeteNBTransparentContainerExtensionValue(t *testing.T) { mustNil(t, per.EncodeEnumerated(item, per.Aligned, int64(len(enumDLForwarding.Root)), true, 1)) item.AlignToByte() - return encodeContainerField(w, per.Aligned, ieField{ID: IDERABInformationListItem, Criticality: CriticalityIgnore, Value: ap.RawValue(item.Bytes())}) + return encodeContainerField(w, per.Aligned, ieField{ID: IDERABInformationListItem, Criticality: CriticalityIgnore, Value: apimpl.RawValue(item.Bytes())}) })) w.AlignToByte() diff --git a/s1ap/ue_capability.go b/s1ap/ue_capability.go index 82bbcc0948..6f38fd7002 100644 --- a/s1ap/ue_capability.go +++ b/s1ap/ue_capability.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // TS 36.413 §9.1.10. @@ -14,7 +15,11 @@ type UECapabilityInfoIndication struct { UERadioCapability UERadioCapability // One opaque OCTET STRING, where NGAP's counterpart is a SEQUENCE of // separate NR and E-UTRA capabilities (§9.2.1.98). - UERadioCapabilityForPaging UERadioCapabilityForPaging + UERadioCapabilityForPaging UERadioCapabilityForPaging + UEApplicationLayerMeasurementCapability *UEApplicationLayerMeasurementCapability + LTEMIndication *LTEMIndication + UERadioCapabilityNRFormat *UERadioCapability + UERadioCapabilityForPagingNRFormat *UERadioCapabilityForPaging messageMeta } @@ -68,6 +73,14 @@ var uECapabilityInfoIndicationIEs = []ieSpec[UECapabilityInfoIndication]{ return m.UERadioCapabilityForPaging, true }, }, + apimpl.OptionalIE(IDUEApplicationLayerMeasurementCapability, CriticalityIgnore, func(m *UECapabilityInfoIndication) **UEApplicationLayerMeasurementCapability { + return &m.UEApplicationLayerMeasurementCapability + }), + apimpl.OptionalIE(IDLTEMIndication, CriticalityIgnore, func(m *UECapabilityInfoIndication) **LTEMIndication { return &m.LTEMIndication }), + apimpl.OptionalIE(IDUERadioCapabilityNRFormat, CriticalityIgnore, func(m *UECapabilityInfoIndication) **UERadioCapability { return &m.UERadioCapabilityNRFormat }), + apimpl.OptionalIE(IDUERadioCapabilityForPagingNRFormat, CriticalityIgnore, func(m *UECapabilityInfoIndication) **UERadioCapabilityForPaging { + return &m.UERadioCapabilityForPagingNRFormat + }), } func (m *UECapabilityInfoIndication) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/ue_capability_test.go b/s1ap/ue_capability_test.go index cbcebfbfd0..33676b9df0 100644 --- a/s1ap/ue_capability_test.go +++ b/s1ap/ue_capability_test.go @@ -8,7 +8,7 @@ import ( "errors" "testing" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func TestUECapabilityInfoIndicationRoundTrips(t *testing.T) { @@ -80,8 +80,8 @@ func TestUECapabilityInfoIndicationPaging(t *testing.T) { // without it is still delivered and the absence reported (§10.3.5). func TestUECapabilityInfoIndicationWithoutCapability(t *testing.T) { value := container(t, - ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, - ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(ENBUES1APID(2))))}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, + ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(ENBUES1APID(2))))}, ) msg, err := ParseUECapabilityInfoIndication(value) @@ -103,8 +103,8 @@ func TestUECapabilityInfoIndicationWithoutCapability(t *testing.T) { // missing one (§10.3.5). func TestUECapabilityInfoIndicationMissingRejectIE(t *testing.T) { value := container(t, - ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: ap.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, - ieField{ID: IDUERadioCapability, Criticality: CriticalityIgnore, Value: ap.RawValue(ieRaw(t, UERadioCapability{0x01}))}, + ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: apimpl.RawValue(ieRaw(t, Ptr(MMEUES1APID(1))))}, + ieField{ID: IDUERadioCapability, Criticality: CriticalityIgnore, Value: apimpl.RawValue(ieRaw(t, UERadioCapability{0x01}))}, ) _, err := ParseUECapabilityInfoIndication(value) diff --git a/s1ap/ue_context_modification.go b/s1ap/ue_context_modification.go index dc23e1d9dc..0f6868f875 100644 --- a/s1ap/ue_context_modification.go +++ b/s1ap/ue_context_modification.go @@ -5,13 +5,34 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) type UEContextModificationRequest struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - UEAggregateMaximumBitRate *UEAggregateMaximumBitRate - TimeRefDistribution *TimeRefDistribution + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + UEAggregateMaximumBitRate *UEAggregateMaximumBitRate + TimeRefDistribution *TimeRefDistribution + SecurityKey *SecurityKey + SubscriberProfileIDforRFP *SubscriberProfileIDforRFP + CSFallbackIndicator *CSFallbackIndicator + UESecurityCapabilities *UESecurityCapabilities + CSGMembershipStatus *CSGMembershipStatus + RegisteredLAI *LAI + AdditionalCSFallbackIndicator *AdditionalCSFallbackIndicator + ProSeAuthorized *ProSeAuthorized + SRVCCOperationPossible *SRVCCOperationPossible + SRVCCOperationNotPossible *SRVCCOperationNotPossible + V2XServicesAuthorized *V2XServicesAuthorized + UESidelinkAggregateMaximumBitrate *UESidelinkAggregateMaximumBitrate + NRUESecurityCapabilities *NRUESecurityCapabilities + AerialUEsubscriptionInformation *AerialUEsubscriptionInformation + AdditionalRRMPriorityIndex *AdditionalRRMPriorityIndex + IABAuthorized *IABAuthorized + NRV2XServicesAuthorized *NRV2XServicesAuthorized + NRUESidelinkAggregateMaximumBitrate *NRUESidelinkAggregateMaximumBitrate + PC5QoSParameters *PC5QoSParameters + UERadioCapabilityID *UERadioCapabilityID messageMeta } @@ -31,6 +52,8 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ }, Encode: func(m *UEContextModificationRequest) (per.Marshaler, bool) { return &m.ENBUES1APID, true }, }, + apimpl.OptionalIE(IDSecurityKey, CriticalityReject, func(m *UEContextModificationRequest) **SecurityKey { return &m.SecurityKey }), + apimpl.OptionalIE(IDSubscriberProfileIDforRFP, CriticalityIgnore, func(m *UEContextModificationRequest) **SubscriberProfileIDforRFP { return &m.SubscriberProfileIDforRFP }), { ID: IDUEAggregateMaximumBitrate, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { @@ -52,6 +75,34 @@ var uEContextModificationRequestIEs = []ieSpec[UEContextModificationRequest]{ return m.UEAggregateMaximumBitRate, true }, }, + apimpl.OptionalIE(IDCSFallbackIndicator, CriticalityReject, func(m *UEContextModificationRequest) **CSFallbackIndicator { return &m.CSFallbackIndicator }), + apimpl.OptionalIE(IDUESecurityCapabilities, CriticalityReject, func(m *UEContextModificationRequest) **UESecurityCapabilities { return &m.UESecurityCapabilities }), + apimpl.OptionalIE(IDCSGMembershipStatus, CriticalityIgnore, func(m *UEContextModificationRequest) **CSGMembershipStatus { return &m.CSGMembershipStatus }), + apimpl.OptionalIE(IDRegisteredLAI, CriticalityIgnore, func(m *UEContextModificationRequest) **LAI { return &m.RegisteredLAI }), + apimpl.ConditionalIE(IDAdditionalCSFallbackIndicator, CriticalityIgnore, ueContextModificationCSFBHighPriority, func(m *UEContextModificationRequest) **AdditionalCSFallbackIndicator { + return &m.AdditionalCSFallbackIndicator + }), + apimpl.OptionalIE(IDProSeAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **ProSeAuthorized { return &m.ProSeAuthorized }), + apimpl.OptionalIE(IDSRVCCOperationPossible, CriticalityIgnore, func(m *UEContextModificationRequest) **SRVCCOperationPossible { return &m.SRVCCOperationPossible }), + apimpl.OptionalIE(IDSRVCCOperationNotPossible, CriticalityIgnore, func(m *UEContextModificationRequest) **SRVCCOperationNotPossible { return &m.SRVCCOperationNotPossible }), + apimpl.OptionalIE(IDV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **V2XServicesAuthorized { return &m.V2XServicesAuthorized }), + apimpl.OptionalIE(IDUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **UESidelinkAggregateMaximumBitrate { + return &m.UESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDNRUESecurityCapabilities, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESecurityCapabilities { return &m.NRUESecurityCapabilities }), + apimpl.OptionalIE(IDAerialUEsubscriptionInformation, CriticalityIgnore, func(m *UEContextModificationRequest) **AerialUEsubscriptionInformation { + return &m.AerialUEsubscriptionInformation + }), + apimpl.OptionalIE(IDAdditionalRRMPriorityIndex, CriticalityIgnore, func(m *UEContextModificationRequest) **AdditionalRRMPriorityIndex { + return &m.AdditionalRRMPriorityIndex + }), + apimpl.OptionalIE(IDIABAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **IABAuthorized { return &m.IABAuthorized }), + apimpl.OptionalIE(IDNRV2XServicesAuthorized, CriticalityIgnore, func(m *UEContextModificationRequest) **NRV2XServicesAuthorized { return &m.NRV2XServicesAuthorized }), + apimpl.OptionalIE(IDNRUESidelinkAggregateMaximumBitrate, CriticalityIgnore, func(m *UEContextModificationRequest) **NRUESidelinkAggregateMaximumBitrate { + return &m.NRUESidelinkAggregateMaximumBitrate + }), + apimpl.OptionalIE(IDPC5QoSParameters, CriticalityIgnore, func(m *UEContextModificationRequest) **PC5QoSParameters { return &m.PC5QoSParameters }), + apimpl.OptionalIE(IDUERadioCapabilityID, CriticalityReject, func(m *UEContextModificationRequest) **UERadioCapabilityID { return &m.UERadioCapabilityID }), { ID: IDTimeRefDistribution, Presence: presenceOptional, Criticality: CriticalityIgnore, Decode: func(m *UEContextModificationRequest, r *per.Reader, enc per.Encoding) error { @@ -314,3 +365,7 @@ func ParseUEContextModificationFailure(value []byte) (*UEContextModificationFail func DecodeUEContextModificationFailure(value []byte) (*UEContextModificationFailure, error) { return decodeMessageBody[UEContextModificationFailure](ProcUEContextModification, uEContextModificationFailureIEs, value) } + +func ueContextModificationCSFBHighPriority(m *UEContextModificationRequest) bool { + return m.CSFallbackIndicator != nil && *m.CSFallbackIndicator == CSFallbackIndicatorCSFallbackHighPriority +} diff --git a/s1ap/ue_context_modification_test.go b/s1ap/ue_context_modification_test.go index be9fb1d739..7e446fd97b 100644 --- a/s1ap/ue_context_modification_test.go +++ b/s1ap/ue_context_modification_test.go @@ -35,7 +35,7 @@ func TestUEContextModificationRoundTrips(t *testing.T) { } if out.MMEUES1APID != 42 || out.ENBUES1APID != 7 || out.UEAggregateMaximumBitRate == nil || - *out.UEAggregateMaximumBitRate != *in.UEAggregateMaximumBitRate { + !out.UEAggregateMaximumBitRate.Equal(*in.UEAggregateMaximumBitRate) { t.Fatalf("mismatch:\n in %+v\n out %+v", in, out) } }) diff --git a/s1ap/ue_context_release.go b/s1ap/ue_context_release.go index 95b6510e0c..f16eb9a9c2 100644 --- a/s1ap/ue_context_release.go +++ b/s1ap/ue_context_release.go @@ -5,6 +5,7 @@ package s1ap import ( "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap/apimpl" ) // UE-S1AP-IDs ::= CHOICE { uE-S1AP-ID-pair, mME-UE-S1AP-ID, ... }. The MME @@ -113,10 +114,14 @@ func DecodeUEContextReleaseCommand(value []byte) (*UEContextReleaseCommand, erro // TS 36.413 §9.1.4.7. type UEContextReleaseComplete struct { - MMEUES1APID *MMEUES1APID - ENBUES1APID *ENBUES1APID - CriticalityDiagnostics *CriticalityDiagnostics - UserLocationInformation *UserLocationInformation + MMEUES1APID *MMEUES1APID + ENBUES1APID *ENBUES1APID + CriticalityDiagnostics *CriticalityDiagnostics + UserLocationInformation *UserLocationInformation + InformationOnRecommendedCellsAndENBsForPaging *InformationOnRecommendedCellsAndENBsForPaging + CellIdentifierAndCELevelForCECapableUEs *CellIdentifierAndCELevelForCECapableUEs + SecondaryRATDataUsageReportList SecondaryRATDataUsageReportList + TimeSinceSecondaryNodeRelease *TimeSinceSecondaryNodeRelease messageMeta } @@ -206,6 +211,18 @@ var uEContextReleaseCompleteIEs = []ieSpec[UEContextReleaseComplete]{ return m.UserLocationInformation, true }, }, + apimpl.OptionalIE(IDInformationOnRecommendedCellsAndENBsForPaging, CriticalityIgnore, func(m *UEContextReleaseComplete) **InformationOnRecommendedCellsAndENBsForPaging { + return &m.InformationOnRecommendedCellsAndENBsForPaging + }), + apimpl.OptionalIE(IDCellIdentifierAndCELevelForCECapableUEs, CriticalityIgnore, func(m *UEContextReleaseComplete) **CellIdentifierAndCELevelForCECapableUEs { + return &m.CellIdentifierAndCELevelForCECapableUEs + }), + apimpl.ListIE(IDSecondaryRATDataUsageReportList, CriticalityIgnore, func(m *UEContextReleaseComplete) *SecondaryRATDataUsageReportList { + return &m.SecondaryRATDataUsageReportList + }), + apimpl.OptionalIE(IDTimeSinceSecondaryNodeRelease, CriticalityIgnore, func(m *UEContextReleaseComplete) **TimeSinceSecondaryNodeRelease { + return &m.TimeSinceSecondaryNodeRelease + }), } func (m *UEContextReleaseComplete) encodeBody(w *per.Writer, enc per.Encoding) error { @@ -238,10 +255,11 @@ func DecodeUEContextReleaseComplete(value []byte) (*UEContextReleaseComplete, er // TS 36.413 §9.1.4.5. type UEContextReleaseRequest struct { - MMEUES1APID MMEUES1APID - ENBUES1APID ENBUES1APID - Cause *Cause - GWContextReleaseIndication *GWContextReleaseIndication + MMEUES1APID MMEUES1APID + ENBUES1APID ENBUES1APID + Cause *Cause + GWContextReleaseIndication *GWContextReleaseIndication + SecondaryRATDataUsageReportList SecondaryRATDataUsageReportList messageMeta } @@ -303,6 +321,9 @@ var uEContextReleaseRequestIEs = []ieSpec[UEContextReleaseRequest]{ return m.GWContextReleaseIndication, true }, }, + apimpl.ListIE(IDSecondaryRATDataUsageReportList, CriticalityIgnore, func(m *UEContextReleaseRequest) *SecondaryRATDataUsageReportList { + return &m.SecondaryRATDataUsageReportList + }), } func (m *UEContextReleaseRequest) encodeBody(w *per.Writer, enc per.Encoding) error { diff --git a/s1ap/ue_context_release_test.go b/s1ap/ue_context_release_test.go index 7cdeb902dd..5f0c342449 100644 --- a/s1ap/ue_context_release_test.go +++ b/s1ap/ue_context_release_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) func TestUEContextReleaseRoundTrips(t *testing.T) { @@ -142,7 +142,7 @@ func TestUEContextReleaseCommandExtensionAlternative(t *testing.T) { t.Fatal(err) } - value := container(t, ieField{ID: IDUES1APIDs, Criticality: CriticalityReject, Value: ap.RawValue(perBytes(w))}) + value := container(t, ieField{ID: IDUES1APIDs, Criticality: CriticalityReject, Value: apimpl.RawValue(perBytes(w))}) _, err := ParseUEContextReleaseCommand(value) if err == nil { @@ -190,7 +190,7 @@ func TestUEContextReleaseRequestGWContextReleaseIndicationExtensionRejects(t *te ieField{ID: IDMMEUES1APID, Criticality: CriticalityReject, Value: Ptr(MMEUES1APID(1))}, ieField{ID: IDENBUES1APID, Criticality: CriticalityReject, Value: Ptr(ENBUES1APID(2))}, ieField{ID: IDCause, Criticality: CriticalityIgnore, Value: &cause}, - ieField{ID: IDGWContextReleaseIndication, Criticality: CriticalityReject, Value: ap.RawValue(extensionEnum(t, int64(len(enumGWContextReleaseIndication.Root)), 0))}, + ieField{ID: IDGWContextReleaseIndication, Criticality: CriticalityReject, Value: apimpl.RawValue(extensionEnum(t, int64(len(enumGWContextReleaseIndication.Root)), 0))}, )) var ase *AbstractSyntaxError diff --git a/s1ap/unknown_ie_test.go b/s1ap/unknown_ie_test.go index f2bac656a3..c5836da342 100644 --- a/s1ap/unknown_ie_test.go +++ b/s1ap/unknown_ie_test.go @@ -10,7 +10,7 @@ import ( "testing" "github.com/ellanetworks/core/per" - "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" ) // A ProtocolIE the message type does not model must survive Marshal/Parse @@ -25,7 +25,7 @@ func TestUnknownIERoundTrip(t *testing.T) { ENBUES1APID: 2, UERadioCapability: []byte{0xaa, 0xbb}, } - in.Append(rawIE{ID: unknownID, Criticality: CriticalityNotify, Value: unknownVal}) + in.appendUnknown(rawIE{ID: unknownID, Criticality: CriticalityNotify, Value: unknownVal}) pduBytes, err := in.Marshal() if err != nil { @@ -151,7 +151,7 @@ func TestUnmodeledIECriticality(t *testing.T) { } for _, u := range unknown { - m.Append(u) + m.appendUnknown(u) } raw, err := m.Marshal() @@ -262,7 +262,7 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { value := container(t, ieField{ID: IDGlobalENBID, Criticality: CriticalityReject, Value: &src.GlobalENBID}, ieField{ID: IDSupportedTAs, Criticality: CriticalityReject, Value: src.SupportedTAs}, - ieField{ID: unknownID, Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0xde, 0xad})}, + ieField{ID: unknownID, Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0xde, 0xad})}, ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, ) @@ -287,11 +287,11 @@ func TestUnknownIEKeepsItsWirePosition(t *testing.T) { func TestUnknownIEBeforeEveryTypedIEKeepsItsWirePosition(t *testing.T) { src := goldS1SetupRequestForWire() value := container(t, - ieField{ID: ProtocolIEID(300), Criticality: CriticalityIgnore, Value: ap.RawValue([]byte{0x01})}, + ieField{ID: ProtocolIEID(300), Criticality: CriticalityIgnore, Value: apimpl.RawValue([]byte{0x01})}, ieField{ID: IDGlobalENBID, Criticality: CriticalityReject, Value: &src.GlobalENBID}, ieField{ID: IDSupportedTAs, Criticality: CriticalityReject, Value: src.SupportedTAs}, ieField{ID: IDDefaultPagingDRX, Criticality: CriticalityIgnore, Value: PagingDRXv128}, - ieField{ID: ProtocolIEID(9999), Criticality: CriticalityNotify, Value: ap.RawValue([]byte{0x02})}, + ieField{ID: ProtocolIEID(9999), Criticality: CriticalityNotify, Value: apimpl.RawValue([]byte{0x02})}, ) req, err := ParseS1SetupRequest(value) From b552202c72a2a7c9656f9615a8059bdfc64c54f5 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sun, 15 Nov 2026 10:46:16 -0500 Subject: [PATCH 13/16] fix: pr review Signed-off-by: Guillaume Belanger --- internal/decoder/s1ap/foreign_list_test.go | 62 ++++++++++ ngap/choice_extension_rule_test.go | 13 +-- ngap/config_transfer.go | 4 +- ngap/engine_regression_test.go | 22 ++++ ngap/ie_table.go | 15 +-- ngap/not_comprehended_test.go | 6 +- ngap/ue_context_release_test.go | 6 +- per/ap/apimpl/apimpl.go | 12 +- per/ap/internal/impl/diagnostics.go | 101 +++++++++++++++- per/ap/internal/impl/list.go | 130 ++++++++++++--------- per/ap/internal/impl/list_test.go | 14 ++- per/ap/internal/impl/protocol.go | 38 ++++-- per/ap/internal/impl/table.go | 49 +++++--- per/ap/internal/impl/table_test.go | 24 ++++ s1ap/ie_table.go | 15 +-- s1ap/item_list_foreign_test.go | 9 +- s1ap/transfer_errors_test.go | 99 ++++++++++++++++ 17 files changed, 484 insertions(+), 135 deletions(-) create mode 100644 internal/decoder/s1ap/foreign_list_test.go create mode 100644 s1ap/transfer_errors_test.go diff --git a/internal/decoder/s1ap/foreign_list_test.go b/internal/decoder/s1ap/foreign_list_test.go new file mode 100644 index 0000000000..6278f3a9c4 --- /dev/null +++ b/internal/decoder/s1ap/foreign_list_test.go @@ -0,0 +1,62 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "encoding/json" + "strings" + "testing" + + "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/s1ap" +) + +func TestListOfOnlyUnknownItemsIsRenderedAsAnUnknownIE(t *testing.T) { + b, err := (&s1ap.ERABSetupResponse{ + MMEUES1APID: s1ap.Ptr(s1ap.MMEUES1APID(1)), + ENBUES1APID: s1ap.Ptr(s1ap.ENBUES1APID(2)), + ERABSetup: s1ap.ERABSetupListBearerSURes{{ + ERABID: 1, + TransportLayerAddress: ap.TransportLayerAddressFromOctets([]byte{10, 0, 0, 1}), + GTPTEID: 1, + }}, + }).Marshal() + if err != nil { + t.Fatal(err) + } + + raw, err := s1ap.ParseRawPDU(b) + if err != nil { + t.Fatal(err) + } + + i, err := raw.Index(s1ap.IDERABSetupListBearerSURes) + if err != nil { + t.Fatal(err) + } + + if err := raw.SetValue(i, []byte{0x00, 0x27, 0x0f, 0x40, 0x01, 0xab}); err != nil { + t.Fatal(err) + } + + b, err = raw.Marshal() + if err != nil { + t.Fatal(err) + } + + out, err := json.Marshal(DecodeS1APMessage(b)) + if err != nil { + t.Fatal(err) + } + + got := string(out) + + if strings.Contains(got, "erab_id") { + t.Fatalf("a zero E-RAB is rendered for a list that holds none: %s", got) + } + + if !strings.Contains(got, `"hex":"00270f4001ab"`) { + t.Fatalf("the list IE is not rendered as an unknown {id, criticality, hex} IE: %s", got) + } +} diff --git a/ngap/choice_extension_rule_test.go b/ngap/choice_extension_rule_test.go index c740e6938d..7e65fb45ef 100644 --- a/ngap/choice_extension_rule_test.go +++ b/ngap/choice_extension_rule_test.go @@ -34,16 +34,13 @@ func TestNGResetWithUnknownResetTypeAlternativeIsRejected(t *testing.T) { t.Fatalf("%v: parse = %v, want *AbstractSyntaxError", inner, err) } - var onResetType bool - - for _, ie := range ase.IEs { - if ie.IEID == IDResetType && ie.IECriticality == CriticalityReject { - onResetType = true - } + want := IDResetType + if inner == CriticalityReject { + want = 9999 } - if !onResetType { - t.Errorf("%v: diagnostics = %+v, want ResetType rejected on its own criticality", inner, ase.IEs) + if len(ase.IEs) != 1 || ase.IEs[0].IEID != want || ase.IEs[0].IECriticality != CriticalityReject { + t.Errorf("%v: diagnostics = %+v, want one reject entry for %v", inner, ase.IEs, want) } } } diff --git a/ngap/config_transfer.go b/ngap/config_transfer.go index 6c35c3dd27..3fb98428bb 100644 --- a/ngap/config_transfer.go +++ b/ngap/config_transfer.go @@ -46,13 +46,13 @@ func (c SONConfigurationTransfer) TargetRANNodeID() (TargetRANNodeIDSON, error) for range sonConfigurationTransferPreambleBits { if _, err := r.ReadBit(); err != nil { - return TargetRANNodeIDSON{}, fmt.Errorf("ngap: SONConfigurationTransfer preamble: %w", err) + return TargetRANNodeIDSON{}, &TransferSyntaxError{Protocol: profile.Name, Err: fmt.Errorf("SONConfigurationTransfer preamble: %w", err)} } } var t TargetRANNodeIDSON if err := t.UnmarshalPER(r, per.Aligned); err != nil { - return TargetRANNodeIDSON{}, err + return TargetRANNodeIDSON{}, &TransferSyntaxError{Protocol: profile.Name, Err: fmt.Errorf("SONConfigurationTransfer targetRANNodeID: %w", err)} } return t, nil diff --git a/ngap/engine_regression_test.go b/ngap/engine_regression_test.go index 5a012632f9..5ca72d1b8e 100644 --- a/ngap/engine_regression_test.go +++ b/ngap/engine_regression_test.go @@ -282,3 +282,25 @@ func FuzzMessageLossless(f *testing.F) { } }) } + +func TestTransferDecodeErrorsAreTransferSyntaxErrors(t *testing.T) { + for name, err := range map[string]error{ + "truncated transfer": func() error { + _, err := DecodePDUSessionResourceSetupResponseTransfer(TransferContainer{0x80}) + return err + }(), + "trailing octets": func() error { + _, err := ParseHandoverCommandTransfer(TransferContainer{0x00, 0x00, 0x00}) + return err + }(), + "SON transfer": func() error { + _, err := SONConfigurationTransfer{}.TargetRANNodeID() + return err + }(), + } { + var tse *TransferSyntaxError + if !errors.As(err, &tse) || tse.ProcedureKnown { + t.Errorf("%s: err = %v (%T), want a *TransferSyntaxError", name, err, err) + } + } +} diff --git a/ngap/ie_table.go b/ngap/ie_table.go index 1275cbdfb5..54fb5cea46 100644 --- a/ngap/ie_table.go +++ b/ngap/ie_table.go @@ -5,7 +5,6 @@ package ngap import ( "errors" - "fmt" "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" @@ -113,7 +112,7 @@ func decodeTransfer[T any, PT interface { per.Unmarshaler }](b []byte, ) (PT, error) { - return apimpl.DecodeTransfer[ProtocolIEID, T, PT](b) + return apimpl.DecodeTransfer[ProtocolIEID, ProcedureCode, T, PT](profile, "", b) } func parseTransfer[T any, PT interface { @@ -121,17 +120,7 @@ func parseTransfer[T any, PT interface { per.Unmarshaler }](b []byte, ) (PT, error) { - t, err := apimpl.ParseTransfer[ProtocolIEID, T, PT](b) - if err != nil { - var e *ap.AbstractSyntaxError[ProtocolIEID] - if errors.As(err, &e) { - return nil, fmt.Errorf("ngap: %w", err) - } - - return nil, err - } - - return t, nil + return apimpl.ParseTransfer[ProtocolIEID, ProcedureCode, T, PT](profile, "", b) } func diagnosticsOf(v any) Diagnostics { diff --git a/ngap/not_comprehended_test.go b/ngap/not_comprehended_test.go index 422a0c4b36..f1df3cadd6 100644 --- a/ngap/not_comprehended_test.go +++ b/ngap/not_comprehended_test.go @@ -61,9 +61,9 @@ func TestChoiceExtensionOnRejectIEIsAbstractSyntaxError(t *testing.T) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } - if len(ase.IEs) != 2 || ase.IEs[1].IEID != IDGlobalRANNodeID || - ase.IEs[1].TypeOfError != TypeOfErrorNotUnderstood { - t.Errorf("diagnostics = %+v, want the unknown choice-Extensions IE and then GlobalRANNodeID, which no alternative is left to comprehend", ase.IEs) + if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDGlobalRANNodeID || + ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { + t.Errorf("diagnostics = %+v, want one not-understood entry for GlobalRANNodeID", ase.IEs) } } diff --git a/ngap/ue_context_release_test.go b/ngap/ue_context_release_test.go index 2a06d75ca0..7004cf34dd 100644 --- a/ngap/ue_context_release_test.go +++ b/ngap/ue_context_release_test.go @@ -264,9 +264,9 @@ func TestUEContextReleaseCommandChoiceExtension(t *testing.T) { t.Errorf("cause = %s, want abstract-syntax-error-reject", ase.Cause) } - if len(ase.IEs) != 2 || ase.IEs[1].IEID != IDUENGAPIDs || - ase.IEs[1].TypeOfError != TypeOfErrorNotUnderstood { - t.Errorf("diagnostics = %+v, want the unknown choice-Extensions IE and then UE-NGAP-IDs", ase.IEs) + if len(ase.IEs) != 1 || ase.IEs[0].IEID != IDUENGAPIDs || + ase.IEs[0].TypeOfError != TypeOfErrorNotUnderstood { + t.Errorf("diagnostics = %+v, want one not-understood entry for UE-NGAP-IDs", ase.IEs) } } diff --git a/per/ap/apimpl/apimpl.go b/per/ap/apimpl/apimpl.go index 7657d18fea..336f436155 100644 --- a/per/ap/apimpl/apimpl.go +++ b/per/ap/apimpl/apimpl.go @@ -131,20 +131,20 @@ func ParseMessageBody[ID ~uint16, P ~uint8, M any](p *Profile, procedure P, tabl return impl.ParseMessageBody(p, procedure, table, value, m, meta) } -func DecodeTransfer[ID ~uint16, T any, PT interface { +func DecodeTransfer[ID ~uint16, P ~uint8, T any, PT interface { *T per.Unmarshaler -}](b []byte, +}](p *Profile, what string, b []byte, ) (PT, error) { - return impl.DecodeTransfer[ID, T, PT](b) + return impl.DecodeTransfer[ID, P, T, PT](p, what, b) } -func ParseTransfer[ID ~uint16, T any, PT interface { +func ParseTransfer[ID ~uint16, P ~uint8, T any, PT interface { *T per.Unmarshaler -}](b []byte, +}](p *Profile, what string, b []byte, ) (PT, error) { - return impl.ParseTransfer[ID, T, PT](b) + return impl.ParseTransfer[ID, P, T, PT](p, what, b) } func Prune[ID ~uint16](v impl.Diagnosable[ID]) Diagnostics[ID] { return impl.Prune(v) } diff --git a/per/ap/internal/impl/diagnostics.go b/per/ap/internal/impl/diagnostics.go index 552ca1ba26..780e3e991a 100644 --- a/per/ap/internal/impl/diagnostics.go +++ b/per/ap/internal/impl/diagnostics.go @@ -43,7 +43,8 @@ type Diagnostic[ID ~uint16] struct { Criticality Criticality Kind Kind - pos int + pos int + chained bool } func (d Diagnostic[ID]) String() string { @@ -177,22 +178,89 @@ func (d *Diagnosis[ID]) Unknown(id ID, crit Criticality) { } func (d *Diagnosis[ID]) IE(id ID, crit Criticality, v any) bool { + return d.ie(id, crit, v, false) +} + +func (d *Diagnosis[ID]) ie(id ID, crit Criticality, v any, chain bool) bool { dv, ok := v.(Diagnosable[ID]) if !ok { return false } + start := len(d.entries) + d.path = append(d.path, id) notComprehended := dv.Diagnose(d) d.path = d.path[:len(d.path)-1] if notComprehended { - d.report(id, crit, KindNotComprehended) + d.enclose(id, crit, start, chain) } return notComprehended } +func (d *Diagnosis[ID]) uncomprehended(id ID, crit Criticality, inner []Field[ID]) { + start := len(d.entries) + + d.path = append(d.path, id) + + for _, f := range inner { + d.report(f.ID, f.Criticality, KindNotComprehended) + d.entries[len(d.entries)-1].chained = true + } + + d.path = d.path[:len(d.path)-1] + + d.enclose(id, crit, start, false) +} + +func (d *Diagnosis[ID]) enclose(id ID, crit Criticality, start int, chain bool) { + inner := -1 + + for i := start; i < len(d.entries); i++ { + if d.entries[i].chained && (inner < 0 || severity(d.entries[i].Criticality) > severity(d.entries[inner].Criticality)) { + inner = i + } + } + + if inner >= 0 && severity(d.entries[inner].Criticality) >= severity(crit) { + for i := start; i < len(d.entries); i++ { + if d.entries[i].chained { + d.entries[i].chained = chain + } + } + + return + } + + if inner >= 0 { + kept := d.entries[:start] + + for _, e := range d.entries[start:] { + if !e.chained { + kept = append(kept, e) + } + } + + d.entries = kept + } + + d.report(id, crit, KindNotComprehended) + d.entries[len(d.entries)-1].chained = chain +} + +func severity(c Criticality) int { + switch c { + case CriticalityReject: + return 2 + case CriticalityNotify: + return 1 + default: + return 0 + } +} + func (d *Diagnosis[ID]) Diagnostics() Diagnostics[ID] { return Diagnostics[ID]{IEs: slices.Clone(d.entries)} } @@ -219,16 +287,29 @@ func DiagnoseExtensions[ID ~uint16, M any](d *Diagnosis[ID], table []IESpec[ID, top := len(d.path) == 0 slots := pres.slots() last := -1 + rest := pres.fields for i, s := range slots { if top { d.pos = i } + var f Field[ID] + + if s.preserved { + f, rest = nextPreserved[ID](rest) + } + switch { case s.duplicate: d.report(s.id, s.crit, KindTooManyOccurrences) case s.preserved: + if inner, raw := uncomprehendedExtension(table, f); raw { + d.uncomprehended(s.id, s.crit, inner) + + continue + } + d.report(s.id, s.crit, KindNotComprehended) default: idx := lookup(table, s.id) @@ -292,7 +373,7 @@ func DiagnoseChoiceExtension[ID ~uint16, T any, PT interface { per.Marshaler }](d *Diagnosis[ID], id ID, crit Criticality, alt *PT, raw **SingleContainer[ID], ) bool { - if !d.IE(id, crit, *alt) { + if !d.ie(id, crit, *alt, true) { return false } @@ -308,6 +389,20 @@ func DiagnoseChoiceExtension[ID ~uint16, T any, PT interface { func DiagnoseUnknownChoiceExtension[ID ~uint16](d *Diagnosis[ID], c *SingleContainer[ID]) bool { d.Unknown(c.ID, c.Criticality) + d.entries[len(d.entries)-1].chained = true return true } + +func uncomprehendedExtension[ID ~uint16, M any](table []IESpec[ID, M], f Field[ID]) ([]Field[ID], bool) { + idx := lookup(table, f.ID) + if idx < 0 { + return nil, false + } + + var scratch M + + r := per.NewReader(f.Value) + + return asUncomprehended[ID](table[idx].Decode(&scratch, r, per.Aligned)) +} diff --git a/per/ap/internal/impl/list.go b/per/ap/internal/impl/list.go index 8e895606c9..b31abdfa6a 100644 --- a/per/ap/internal/impl/list.go +++ b/per/ap/internal/impl/list.go @@ -5,16 +5,24 @@ package impl import ( "encoding/binary" + "errors" "fmt" "github.com/ellanetworks/core/per" ) type ListItem[ID ~uint16] struct { - crit WireCriticality - before string - after string - placeholder bool + crit WireCriticality + before string + after string +} + +type uncomprehendedValueError[ID ~uint16] struct { + inner []Field[ID] +} + +func (e *uncomprehendedValueError[ID]) Error() string { + return "ap: single-container list holds no item of its own IE" } func ListItemCriticality[ID ~uint16](wire Criticality) ListItem[ID] { @@ -74,15 +82,13 @@ func EncodeItemList[ID ~uint16, T any](p *Profile, w *per.Writer, enc per.Encodi fields = append(fields, f.Encodable()) } - if !it.placeholder { - m, ok := any(&items[i]).(per.Marshaler) - if !ok { - return fmt.Errorf("ap: %T does not implement per.Marshaler", items[i]) - } - - fields = append(fields, FieldValue[ID]{ID: id, Criticality: it.crit.Of(crit), Value: m}) + m, ok := any(&items[i]).(per.Marshaler) + if !ok { + return fmt.Errorf("ap: %T does not implement per.Marshaler", items[i]) } + fields = append(fields, FieldValue[ID]{ID: id, Criticality: it.crit.Of(crit), Value: m}) + for _, f := range decodeForeign[ID](it.after) { fields = append(fields, f.Encodable()) } @@ -112,6 +118,7 @@ func DecodeItemList[ID ~uint16, T any](p *Profile, r *per.Reader, enc per.Encodi var ( items []T pending []byte + all []Field[ID] ) err := per.DecodeLength(r, enc, 1, ub, true, func(count int64) error { @@ -121,6 +128,8 @@ func DecodeItemList[ID ~uint16, T any](p *Profile, r *per.Reader, enc per.Encodi return err } + all = append(all, f) + if f.ID != id { pending = appendForeign(pending, f) @@ -135,6 +144,12 @@ func DecodeItemList[ID ~uint16, T any](p *Profile, r *per.Reader, enc per.Encodi } if err := DecodeValue(f.Value, u); err != nil { + if _, raw := asUncomprehended[ID](err); raw { + pending = appendForeign(pending, f) + + continue + } + return err } @@ -156,20 +171,11 @@ func DecodeItemList[ID ~uint16, T any](p *Profile, r *per.Reader, enc per.Encodi return nil, err } - if len(pending) > 0 { - if len(items) == 0 { - var item T - - it, err := asListItem[ID](&item) - if err != nil { - return nil, err - } - - it.placeholder, it.before = true, string(pending) - - return []T{item}, nil - } + if len(items) == 0 { + return nil, &uncomprehendedValueError[ID]{inner: all} + } + if len(pending) > 0 { it, err := asListItem[ID](&items[len(items)-1]) if err != nil { return nil, err @@ -181,10 +187,20 @@ func DecodeItemList[ID ~uint16, T any](p *Profile, r *per.Reader, enc per.Encodi return items, nil } +func asUncomprehended[ID ~uint16](err error) ([]Field[ID], bool) { + var e *uncomprehendedValueError[ID] + if errors.As(err, &e) { + return e.inner, true + } + + return nil, false +} + func DiagnoseItemList[ID ~uint16, T any](d *Diagnosis[ID], id ID, crit Criticality, items *[]T) bool { list := *items kept := list[:0] comprehended := 0 + pruned := false var pending []byte @@ -195,28 +211,25 @@ func DiagnoseItemList[ID ~uint16, T any](d *Diagnosis[ID], id ID, crit Criticali } for _, f := range it.ForeignIEs() { - d.Unknown(f.ID, f.Criticality) + diagnoseRawIE[ID, T](d, id, f) } - if !it.placeholder { - wire := it.crit.Of(crit) - - switch { - case !d.IE(id, wire, &list[i]): - comprehended++ - case d.prune: - if raw, ok := marshalItem(&list[i]); ok { - pending = append(pending, it.before...) - pending = appendForeign(pending, Field[ID]{ID: id, Criticality: wire, Value: raw}) - pending = append(pending, it.after...) + wire := it.crit.Of(crit) + notComprehended := d.IE(id, wire, &list[i]) - continue - } - } + if !notComprehended { + comprehended++ } - if !d.prune { - continue + if notComprehended && d.prune { + if raw, ok := marshalItem(&list[i]); ok { + pending = append(pending, it.before...) + pending = appendForeign(pending, Field[ID]{ID: id, Criticality: wire, Value: raw}) + pending = append(pending, it.after...) + pruned = true + + continue + } } if len(pending) > 0 { @@ -227,25 +240,34 @@ func DiagnoseItemList[ID ~uint16, T any](d *Diagnosis[ID], id ID, crit Criticali kept = append(kept, list[i]) } - if d.prune { - if len(pending) > 0 { - if len(kept) > 0 { - it, _ := asListItem[ID](&kept[len(kept)-1]) - it.after += string(pending) - } else { - var item T + if !pruned || len(kept) == 0 { + return len(list) > 0 && comprehended == 0 + } + + if len(pending) > 0 { + it, _ := asListItem[ID](&kept[len(kept)-1]) + it.after += string(pending) + } - it, _ := asListItem[ID](&item) - it.placeholder, it.before = true, string(pending) + *items = kept - kept = append(kept, item) + return false +} + +func diagnoseRawIE[ID ~uint16, T any](d *Diagnosis[ID], id ID, f Field[ID]) { + if f.ID == id { + var item T + + if u, ok := any(&item).(per.Unmarshaler); ok { + if inner, raw := asUncomprehended[ID](DecodeValue(f.Value, u)); raw { + d.uncomprehended(f.ID, f.Criticality, inner) + + return } } - - *items = kept } - return len(list) > 0 && comprehended == 0 + d.Unknown(f.ID, f.Criticality) } func marshalItem(v any) ([]byte, bool) { diff --git a/per/ap/internal/impl/list_test.go b/per/ap/internal/impl/list_test.go index 870e217d26..c0ecf05d59 100644 --- a/per/ap/internal/impl/list_test.go +++ b/per/ap/internal/impl/list_test.go @@ -77,7 +77,6 @@ func TestItemListKeepsForeignIEs(t *testing.T) { {"front", []FieldValue[uint16]{foreignField(CriticalityReject), typedField(1), typedField(2)}, []uint8{1, 2}, 1, false}, {"middle", []FieldValue[uint16]{typedField(1), foreignField(CriticalityIgnore), typedField(2)}, []uint8{1, 2}, 1, false}, {"end", []FieldValue[uint16]{typedField(1), foreignField(CriticalityNotify), foreignField(CriticalityIgnore)}, []uint8{1}, 2, false}, - {"only", []FieldValue[uint16]{foreignField(CriticalityIgnore), foreignField(CriticalityReject)}, []uint8{0}, 2, true}, } { t.Run(c.name, func(t *testing.T) { b := encodeTestList(t, c.fields) @@ -195,7 +194,7 @@ func TestItemListNotComprehendedItemIsJudgedOnItsOwnCriticality(t *testing.T) { }{ {"ignore item", []FieldValue[uint16]{typedField(1), typedField(notComprehendedOctet), typedField(2)}, []uint8{1, notComprehendedOctet, 2}, []uint8{1, 2}, false, false}, {"reject item", []FieldValue[uint16]{typedField(1), bad}, []uint8{1, notComprehendedOctet}, []uint8{1}, true, false}, - {"every item", []FieldValue[uint16]{typedField(notComprehendedOctet)}, []uint8{notComprehendedOctet}, []uint8{0}, false, true}, + {"every item", []FieldValue[uint16]{typedField(notComprehendedOctet)}, []uint8{notComprehendedOctet}, []uint8{notComprehendedOctet}, false, true}, } { t.Run(c.name, func(t *testing.T) { b := encodeTestList(t, c.fields) @@ -251,3 +250,14 @@ func values(items []testItem) []uint8 { return out } + +func TestItemListOfOnlyForeignIEsHasNoTypedValue(t *testing.T) { + fields := []FieldValue[uint16]{foreignField(CriticalityIgnore), foreignField(CriticalityReject)} + + items, err := DecodeItemList[uint16, testItem](testProfile, per.NewReader(encodeTestList(t, fields)), per.Aligned, testListUB, testItemID, CriticalityIgnore) + + inner, ok := asUncomprehended[uint16](err) + if !ok || items != nil || len(inner) != 2 || inner[1].Criticality != CriticalityReject { + t.Fatalf("DecodeItemList = %v, %v, want no typed items and the two raw IEs", items, err) + } +} diff --git a/per/ap/internal/impl/protocol.go b/per/ap/internal/impl/protocol.go index e2d69d056e..a8ebb62eb9 100644 --- a/per/ap/internal/impl/protocol.go +++ b/per/ap/internal/impl/protocol.go @@ -6,6 +6,7 @@ package impl import ( "errors" "fmt" + "strings" "github.com/ellanetworks/core/per" ) @@ -71,26 +72,41 @@ func modeledIEs[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value []by return out } -func DecodeTransfer[ID ~uint16, T any, PT interface { +func DecodeTransfer[ID ~uint16, P ~uint8, T any, PT interface { *T per.Unmarshaler -}](b []byte, +}](p *Profile, what string, b []byte, ) (PT, error) { v := PT(new(T)) - if err := DecodeValue(b, v); err != nil { - return nil, err + err := DecodeValue(b, v) + if err == nil { + return v, nil } - return v, nil + if what == "" { + what = strings.TrimPrefix(fmt.Sprintf("%T", v), "*") + } + + if inner, raw := asUncomprehended[ID](err); raw { + var d Diagnosis[ID] + + for _, f := range inner { + d.report(f.ID, f.Criticality, KindNotComprehended) + } + + return nil, fmt.Errorf("%s: %s: %w", p.Name, what, &AbstractSyntaxError[ID]{IEs: d.entries}) + } + + return nil, &TransferSyntaxError[P]{Protocol: p.Name, Err: fmt.Errorf("%s: %w", what, err)} } -func ParseTransfer[ID ~uint16, T any, PT interface { +func ParseTransfer[ID ~uint16, P ~uint8, T any, PT interface { *T per.Unmarshaler -}](b []byte, +}](p *Profile, what string, b []byte, ) (PT, error) { - v, err := DecodeTransfer[ID, T, PT](b) + v, err := DecodeTransfer[ID, P, T, PT](p, what, b) if err != nil { return nil, err } @@ -101,7 +117,11 @@ func ParseTransfer[ID ~uint16, T any, PT interface { } if err := Prune(dv).Check(); err != nil { - return nil, err + if what == "" { + what = strings.TrimPrefix(fmt.Sprintf("%T", v), "*") + } + + return nil, fmt.Errorf("%s: %s: %w", p.Name, what, err) } return v, nil diff --git a/per/ap/internal/impl/table.go b/per/ap/internal/impl/table.go index 03c2a066cd..736aefde3a 100644 --- a/per/ap/internal/impl/table.go +++ b/per/ap/internal/impl/table.go @@ -157,12 +157,14 @@ const ( outcomeUnknown outcomeDuplicate outcomePruned + outcomeUncomprehended ) -type decodedField struct { +type decodedField[ID ~uint16] struct { idx int outcome outcome wrongOrder bool + inner []Field[ID] } func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value []byte, m *M, meta *Message[ID], prune bool) error { @@ -210,6 +212,14 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ switch res.outcome { case outcomeUnknown, outcomePruned: d.report(f.ID, f.Criticality, KindNotComprehended) + case outcomeUncomprehended: + seen[res.idx] = true + + if res.wrongOrder { + d.report(f.ID, f.Criticality, KindWrongOrder) + } + + d.uncomprehended(f.ID, f.Criticality, res.inner) case outcomeDuplicate: d.report(f.ID, f.Criticality, KindTooManyOccurrences) case outcomeDecoded: @@ -270,11 +280,19 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ nested.IE(f.ID, f.Criticality, val) } } + } - for i, f := range fields { - if pruned[i] && table[results[i].idx].Required(m) { + typed := make([]bool, len(table)) + + for i, f := range fields { + switch results[i].outcome { + case outcomeDecoded: + typed[results[i].idx] = true + case outcomePruned, outcomeUncomprehended: + if table[results[i].idx].Required(m) { exempt = append(exempt, f.ID) } + case outcomeUnknown, outcomeDuplicate: } } @@ -283,7 +301,7 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ for i := range table { spec := &table[i] - if seen[i] && !prunedID(fields, pruned, spec.ID) { + if typed[i] { continue } @@ -303,16 +321,6 @@ func DecodeMessage[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], value [ return nil } -func prunedID[ID ~uint16](fields []Field[ID], pruned []bool, id ID) bool { - for i := range pruned { - if pruned[i] && fields[i].ID == id { - return true - } - } - - return false -} - func DecodeExtensionContainer[ID ~uint16, M any](p *Profile, r *per.Reader, enc per.Encoding, table []IESpec[ID, M], m *M, pres *Preserved[ID]) error { fields, err := decodeExtensionFields[ID](p, r, enc, false) if err != nil { @@ -329,8 +337,8 @@ func DecodeExtensionContainer[ID ~uint16, M any](p *Profile, r *per.Reader, enc return nil } -func decodeTable[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], fields []Field[ID], m *M, skip []bool) ([]decodedField, Preserved[ID], error) { - results := make([]decodedField, len(fields)) +func decodeTable[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], fields []Field[ID], m *M, skip []bool) ([]decodedField[ID], Preserved[ID], error) { + results := make([]decodedField[ID], len(fields)) occurred := make([]bool, len(table)) b := newPreservedBuilder[ID]() last := -1 @@ -374,6 +382,15 @@ func decodeTable[ID ~uint16, M any](p *Profile, table []IESpec[ID, M], fields [] err = r.Complete() } + if inner, raw := asUncomprehended[ID](err); raw { + results[i].outcome = outcomeUncomprehended + results[i].inner = inner + + b.keep(f, false) + + continue + } + if err != nil { return nil, Preserved[ID]{}, fmt.Errorf("IE %s: %w", p.ieName(uint16(f.ID)), err) } diff --git a/per/ap/internal/impl/table_test.go b/per/ap/internal/impl/table_test.go index 639f82c93b..0678de8151 100644 --- a/per/ap/internal/impl/table_test.go +++ b/per/ap/internal/impl/table_test.go @@ -611,3 +611,27 @@ func TestChoiceExtensionNotComprehendedReachesTheEnclosingIE(t *testing.T) { } func ptr[T any](v T) *T { return &v } + +func TestOneFaultIsReportedOnceOnTheGoverningCriticality(t *testing.T) { + for _, c := range []struct { + inner, enclosing Criticality + wantID uint16 + wantCrit Criticality + }{ + {CriticalityIgnore, CriticalityReject, idB, CriticalityReject}, + {CriticalityNotify, CriticalityReject, idB, CriticalityReject}, + {CriticalityReject, CriticalityIgnore, 999, CriticalityReject}, + {CriticalityNotify, CriticalityIgnore, 999, CriticalityNotify}, + {CriticalityReject, CriticalityReject, 999, CriticalityReject}, + {CriticalityIgnore, CriticalityIgnore, 999, CriticalityIgnore}, + } { + var d Diagnosis[uint16] + + d.IE(idB, c.enclosing, &choice{Raw: &SingleContainer[uint16]{ID: 999, Criticality: c.inner, Value: "\x00"}}) + + ies := d.Diagnostics().IEs + if len(ies) != 1 || ies[0].ID != c.wantID || ies[0].Criticality != c.wantCrit { + t.Errorf("inner %v enclosing %v: diagnostics = %v, want one entry for %d (%v)", c.inner, c.enclosing, ies, c.wantID, c.wantCrit) + } + } +} diff --git a/s1ap/ie_table.go b/s1ap/ie_table.go index c9947cdcdf..0c0e76c6d2 100644 --- a/s1ap/ie_table.go +++ b/s1ap/ie_table.go @@ -5,7 +5,6 @@ package s1ap import ( "errors" - "fmt" "github.com/ellanetworks/core/per" "github.com/ellanetworks/core/per/ap" @@ -111,12 +110,7 @@ func decodeValue[T any, PT interface { per.Unmarshaler }](what string, b []byte, ) (PT, error) { - v, err := apimpl.DecodeTransfer[ProtocolIEID, T, PT](b) - if err != nil { - return nil, fmt.Errorf("s1ap: %s: %w", what, err) - } - - return v, nil + return apimpl.DecodeTransfer[ProtocolIEID, ProcedureCode, T, PT](profile, what, b) } func parseValue[T any, PT interface { @@ -124,12 +118,7 @@ func parseValue[T any, PT interface { per.Unmarshaler }](what string, b []byte, ) (PT, error) { - v, err := apimpl.ParseTransfer[ProtocolIEID, T, PT](b) - if err != nil { - return nil, fmt.Errorf("s1ap: %s: %w", what, err) - } - - return v, nil + return apimpl.ParseTransfer[ProtocolIEID, ProcedureCode, T, PT](profile, what, b) } func diagnosticsOf(v any) Diagnostics { diff --git a/s1ap/item_list_foreign_test.go b/s1ap/item_list_foreign_test.go index 472e57f7cc..ff042a456e 100644 --- a/s1ap/item_list_foreign_test.go +++ b/s1ap/item_list_foreign_test.go @@ -147,8 +147,12 @@ func TestItemListOfOnlyForeignIEsIsNotComprehended(t *testing.T) { t.Fatalf("decode: %v", err) } - if len(m.ERABSetup) != 1 || len(m.ERABSetup[0].ForeignIEs()) != 1 { - t.Errorf("ERABSetup = %+v, want the foreign IE kept in the list", m.ERABSetup) + if m.ERABSetup != nil { + t.Errorf("ERABSetup = %+v, want no typed item: the list holds none of its own", m.ERABSetup) + } + + if u := m.UnknownIEs(); len(u) != 1 || u[0].ID != IDERABSetupListBearerSURes { + t.Errorf("unknown IEs = %+v, want the list IE kept raw at its wire position", u) } var kinds []string @@ -158,7 +162,6 @@ func TestItemListOfOnlyForeignIEsIsNotComprehended(t *testing.T) { want := []string{ DiagnosticIE{Path: []ProtocolIEID{IDERABSetupListBearerSURes}, ID: idForeignListItem, Criticality: CriticalityIgnore}.String(), - DiagnosticIE{ID: IDERABSetupListBearerSURes, Criticality: CriticalityIgnore}.String(), } if !slices.Equal(kinds, want) { diff --git a/s1ap/transfer_errors_test.go b/s1ap/transfer_errors_test.go new file mode 100644 index 0000000000..5fc975304a --- /dev/null +++ b/s1ap/transfer_errors_test.go @@ -0,0 +1,99 @@ +// SPDX-FileCopyrightText: Ella Networks Inc. +// SPDX-License-Identifier: BUSL-1.1 + +package s1ap + +import ( + "errors" + "testing" + + "github.com/ellanetworks/core/per" + "github.com/ellanetworks/core/per/ap" + "github.com/ellanetworks/core/per/ap/apimpl" +) + +func TestContainerDecodeErrorsAreTyped(t *testing.T) { + _, err := DecodeSourceeNBToTargeteNBTransparentContainer([]byte{0x80}) + + var tse *TransferSyntaxError + if !errors.As(err, &tse) { + t.Fatalf("truncated container: err = %v (%T), want *TransferSyntaxError", err, err) + } + + in := &SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: RRCContainer{0x80}, + TargetCellID: EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 1}, + ERABInformationList: ERABInformationList{{ERABID: 1}}, + UEHistoryInformation: UEHistoryInformation{{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}}, + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + if _, err := DecodeSourceeNBToTargeteNBTransparentContainer(append(b, 0x00)); !errors.As(err, &tse) || !errors.Is(err, per.ErrTrailing) { + t.Fatalf("trailing octet: err = %v, want *TransferSyntaxError wrapping per.ErrTrailing", err) + } +} + +func TestContainerWhoseRootListHoldsOnlyUnknownIEsIsAnAbstractSyntaxError(t *testing.T) { + in := &SourceeNBToTargeteNBTransparentContainer{ + RRCContainer: RRCContainer{0x80}, + TargetCellID: EUTRANCGI{PLMNIdentity: containerPLMN(), CellID: 1}, + ERABInformationList: ERABInformationList{{ERABID: 1}}, + UEHistoryInformation: UEHistoryInformation{{UTRANCell: Ptr(LastVisitedUTRANCellInformation{0x01})}}, + } + + b, err := in.Marshal() + if err != nil { + t.Fatal(err) + } + + item, err := per.Marshal(&in.ERABInformationList[0], per.Aligned) + if err != nil { + t.Fatal(err) + } + + foreign := bytesReplace(t, b, item) + + _, err = DecodeSourceeNBToTargeteNBTransparentContainer(foreign) + + var ase *ap.AbstractSyntaxError[ProtocolIEID] + if !errors.As(err, &ase) || len(ase.IEs) != 1 || ase.IEs[0].ID != idForeignListItem { + t.Fatalf("err = %v, want an *ap.AbstractSyntaxError naming the unknown IE", err) + } +} + +func bytesReplace(t *testing.T, b, item []byte) []byte { + t.Helper() + + w := per.NewWriter() + if err := encodeContainerField(w, per.Aligned, ieField{ID: IDERABInformationListItem, Criticality: CriticalityIgnore, Value: apimpl.RawValue(item)}); err != nil { + t.Fatal(err) + } + + known := w.Bytes() + + w = per.NewWriter() + if err := encodeContainerField(w, per.Aligned, ieField{ID: idForeignListItem, Criticality: CriticalityIgnore, Value: apimpl.RawValue(item)}); err != nil { + t.Fatal(err) + } + + out := make([]byte, 0, len(b)) + + for i := 0; i < len(b); i++ { + if i+len(known) <= len(b) && string(b[i:i+len(known)]) == string(known) { + out = append(out, w.Bytes()...) + out = append(out, b[i+len(known):]...) + + return out + } + + out = append(out, b[i]) + } + + t.Fatal("list item not found in the encoding") + + return nil +} From d65106ef48d173f8df548c83b4372faccc5263c6 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sun, 15 Nov 2026 11:23:14 -0500 Subject: [PATCH 14/16] fix: flakes Signed-off-by: Guillaume Belanger --- internal/decoder/utils/asn1_names.go | 2 +- internal/decoder/utils/asn1_names_test.go | 2 +- per/cmd/pergen/main.go | 22 +++++++++++++++++++++- per/pergen/load.go | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/internal/decoder/utils/asn1_names.go b/internal/decoder/utils/asn1_names.go index 3beaa52764..1b8b34cb5a 100644 --- a/internal/decoder/utils/asn1_names.go +++ b/internal/decoder/utils/asn1_names.go @@ -3,7 +3,7 @@ package utils -var asn1Names = map[string]string{ +var asn1Names = map[string]string{ // #nosec: G101 -- ASN.1 identifier names, not credentials "a2xguaranteedflowbitrate": "a2x_guaranteed_flow_bit_rate", "a2xmaximumflowbitrate": "a2x_maximum_flow_bit_rate", "a2xpc5flowbitrates": "a2x_pc5_flow_bit_rates", diff --git a/internal/decoder/utils/asn1_names_test.go b/internal/decoder/utils/asn1_names_test.go index 511f7444d1..2688d85e70 100644 --- a/internal/decoder/utils/asn1_names_test.go +++ b/internal/decoder/utils/asn1_names_test.go @@ -78,7 +78,7 @@ func TestASN1NamesUpToDate(t *testing.T) { var buf bytes.Buffer - buf.WriteString("// SPDX-FileCopyrightText: Ella Networks Inc.\n// SPDX-License-Identifier: BUSL-1.1\n\npackage utils\n\nvar asn1Names = map[string]string{\n") + buf.WriteString("// SPDX-FileCopyrightText: Ella Networks Inc.\n// SPDX-License-Identifier: BUSL-1.1\n\npackage utils\n\nvar asn1Names = map[string]string{ // #nosec: G101 -- ASN.1 identifier names, not credentials\n") for _, k := range keys { fmt.Fprintf(&buf, "\t%q: %q,\n", k, names[k]) diff --git a/per/cmd/pergen/main.go b/per/cmd/pergen/main.go index 242dc7d31d..cce8386e51 100644 --- a/per/cmd/pergen/main.go +++ b/per/cmd/pergen/main.go @@ -29,5 +29,25 @@ func run(args []string) error { return err } - return os.WriteFile(cfg.Output, out, 0o600) + return writeOutput(cfg.Output, out) +} + +func writeOutput(name string, data []byte) error { + root, err := os.OpenRoot(".") + if err != nil { + return err + } + defer func() { _ = root.Close() }() + + f, err := root.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o600) + if err != nil { + return err + } + + if _, err := f.Write(data); err != nil { + _ = f.Close() + return err + } + + return f.Close() } diff --git a/per/pergen/load.go b/per/pergen/load.go index 4d9ffd6699..776269bd84 100644 --- a/per/pergen/load.go +++ b/per/pergen/load.go @@ -65,7 +65,7 @@ func load(ctx context.Context, dir, output string) (*loaded, error) { return nil, fmt.Errorf("no export data for %s", path) } - return os.Open(file) + return os.Open(filepath.Clean(file)) }), Error: func(err error) { if !pendingMethodError(err) { From ee82dcb74d6768bfb20bf8dd2a4782c68a33068b Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Sun, 15 Nov 2026 15:59:58 -0500 Subject: [PATCH 15/16] fix: bugs Signed-off-by: Guillaume Belanger --- sctp/writer.go | 24 ++--- sctp/writer_test.go | 214 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 176 insertions(+), 62 deletions(-) diff --git a/sctp/writer.go b/sctp/writer.go index d0d10a3f85..40acc5cf69 100644 --- a/sctp/writer.go +++ b/sctp/writer.go @@ -20,17 +20,14 @@ const ( pacedQueueShare = writeQueueDepth / 2 ) -// Shortened by tests to exercise the deadline path. -var writeTimeout = 5 * time.Second - // Bounds on a graceful close, so a stalled peer cannot hold up shutdown. var ( flushTimeout = 2 * time.Second drainTimeout = 500 * time.Millisecond ) -// errWriteQueueFull reports that the peer stopped draining and the association -// has been aborted. +// errWriteQueueFull reports that the outbound queue has no room for the +// message. The association stays up. var errWriteQueueFull = errors.New("sctp: outbound queue full") var testHookBeforeEnqueue = func() {} @@ -112,7 +109,12 @@ func (c *SCTPConn) sendQueued(qw queuedWrite) bool { <-c.pacedSlots } - if err := c.setWriteDeadline(time.Now().Add(c.sendTimeout())); err != nil { + var deadline time.Time + if d := time.Duration(c.writeTimeout.Load()); d > 0 { + deadline = time.Now().Add(d) + } + + if err := c.setWriteDeadline(deadline); err != nil { c.failAssociation("set write deadline", err) return false } @@ -129,14 +131,6 @@ func (c *SCTPConn) SetWriteTimeout(d time.Duration) { c.writeTimeout.Store(int64(d)) } -func (c *SCTPConn) sendTimeout() time.Duration { - if d := time.Duration(c.writeTimeout.Load()); d > 0 { - return d - } - - return writeTimeout -} - // WriteMsg queues b for the association's writer goroutine: a nil error means // queued, not sent. Conns without a writer send synchronously. func (c *SCTPConn) WriteMsg(b []byte, info *SndRcvInfo) (int, error) { @@ -167,8 +161,6 @@ func (c *SCTPConn) WriteMsg(b []byte, info *SndRcvInfo) (int, error) { case c.writeCh <- qw: return len(b), nil default: - c.failAssociation("queue full", errWriteQueueFull) - return 0, errWriteQueueFull } } diff --git a/sctp/writer_test.go b/sctp/writer_test.go index caa97e2794..e4bace4d5a 100644 --- a/sctp/writer_test.go +++ b/sctp/writer_test.go @@ -119,7 +119,7 @@ func TestWriter_DeliversInOrder(t *testing.T) { } // A peer that keeps the association up but stops reading must not block a sender. -func TestWriter_WedgedPeerFailsAssociation(t *testing.T) { +func TestWriter_QueueFullKeepsAssociation(t *testing.T) { srv, serverConn, disconnected, client := serverWithAcceptedConn(t) defer func() { @@ -129,19 +129,12 @@ func TestWriter_WedgedPeerFailsAssociation(t *testing.T) { srv.Shutdown(sctx) }() - // Shrink both buffers so the write side wedges within a few messages. - _ = client.controlFd(func(fd int) error { - return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_RCVBUF, 2048) - }) - _ = serverConn.controlFd(func(fd int) error { - return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_SNDBUF, 2048) - }) - - payload := make([]byte, 1024) - deadline := time.Now().Add(20 * time.Second) + payload := make([]byte, 4096) + queued := 0 sawQueueFull := false - for i := 0; i < writeQueueDepth*8 && time.Now().Before(deadline); i++ { + for i := 0; i < writeQueueDepth*8; i++ { + payload[0], payload[1] = byte(i>>8), byte(i) start := time.Now() _, err := serverConn.WriteMsg(payload, &SndRcvInfo{PPID: PPIDWireOrder(testPPID), Stream: 0}) @@ -154,16 +147,65 @@ func TestWriter_WedgedPeerFailsAssociation(t *testing.T) { sawQueueFull = true break } - } - select { - case <-disconnected: - case <-time.After(10 * time.Second): - t.Fatal("wedged peer did not fail the association") + if err != nil { + t.Fatalf("WriteMsg %d: %v", i, err) + } + + queued++ } if !sawQueueFull { - t.Log("association failed via write deadline, not queue overflow") + t.Fatal("the queue never filled; the peer applied no backpressure") + } + + if serverConn.closed.Load() { + t.Fatal("a full queue closed the association") + } + + buf := make([]byte, 8192) + + readNext := func(want int) { + t.Helper() + + if err := client.setDeadline(time.Now().Add(10 * time.Second)); err != nil { + t.Fatalf("set deadline: %v", err) + } + + for { + read, _, notification, err := client.readMsg(buf) + if err != nil { + t.Fatalf("client read %d: %v", want, err) + } + + if notification != nil { + continue + } + + if read != len(payload) || int(buf[0])<<8|int(buf[1]) != want { + t.Fatalf("client read message %d out of order", want) + } + + return + } + } + + for i := 0; i < queued; i++ { + readNext(i) + } + + payload[0], payload[1] = byte(queued>>8), byte(queued) + + if _, err := serverConn.WriteMsg(payload, &SndRcvInfo{PPID: PPIDWireOrder(testPPID), Stream: 0}); err != nil { + t.Fatalf("WriteMsg after the peer drained: %v", err) + } + + readNext(queued) + + select { + case <-disconnected: + t.Fatal("a full queue failed the association") + default: } } @@ -214,11 +256,6 @@ func TestWriter_StartAfterCloseDoesNotOrphan(t *testing.T) { // A send that stays parked past the write deadline must fail the association // even when the queue has room. func TestWriter_WriteDeadlineFailsAssociation(t *testing.T) { - original := writeTimeout - writeTimeout = 250 * time.Millisecond - - defer func() { writeTimeout = original }() - srv, serverConn, disconnected, client := serverWithAcceptedConn(t) defer func() { @@ -228,6 +265,8 @@ func TestWriter_WriteDeadlineFailsAssociation(t *testing.T) { srv.Shutdown(sctx) }() + serverConn.SetWriteTimeout(250 * time.Millisecond) + _ = client.controlFd(func(fd int) error { return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_RCVBUF, 2048) }) @@ -399,11 +438,6 @@ func TestWriter_WriteMsgWaitReturnsOnContextDone(t *testing.T) { } func TestWriter_WriteMsgWaitEndsWhenWedgedPeerFailsAssociation(t *testing.T) { - original := writeTimeout - writeTimeout = 250 * time.Millisecond - - defer func() { writeTimeout = original }() - srv, serverConn, disconnected, client := serverWithAcceptedConn(t) defer func() { @@ -413,6 +447,8 @@ func TestWriter_WriteMsgWaitEndsWhenWedgedPeerFailsAssociation(t *testing.T) { srv.Shutdown(sctx) }() + serverConn.SetWriteTimeout(250 * time.Millisecond) + _ = client.controlFd(func(fd int) error { return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_RCVBUF, 2048) }) @@ -447,12 +483,84 @@ func TestWriter_WriteMsgWaitEndsWhenWedgedPeerFailsAssociation(t *testing.T) { } } -func TestWriter_SetWriteTimeoutOverridesTheDefault(t *testing.T) { - original := writeTimeout - writeTimeout = 250 * time.Millisecond +func TestWriter_PeerThatStopsReadingKeepsAssociation(t *testing.T) { + srv, serverConn, disconnected, client := serverWithAcceptedConn(t) + + defer func() { + sctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + srv.Shutdown(sctx) + }() + + const n = 1024 - defer func() { writeTimeout = original }() + sendErr := make(chan error, 1) + go func() { + payload := make([]byte, 4096) + + for i := range n { + payload[0], payload[1] = byte(i>>8), byte(i) + + if _, err := serverConn.WriteMsgWait(context.Background(), payload, &SndRcvInfo{PPID: PPIDWireOrder(testPPID), Stream: 0}); err != nil { + sendErr <- err + return + } + } + + sendErr <- nil + }() + + select { + case <-disconnected: + t.Fatal("a peer that stopped reading lost its association") + case err := <-sendErr: + t.Fatalf("WriteMsgWait returned while the peer was not reading: %v", err) + case <-time.After(6 * time.Second): + } + + if len(serverConn.writeCh) != pacedQueueShare { + t.Fatalf("queue holds %d writes; the writer never stalled on the peer", len(serverConn.writeCh)) + } + + buf := make([]byte, 8192) + + for i := range n { + if err := client.setDeadline(time.Now().Add(30 * time.Second)); err != nil { + t.Fatalf("set deadline: %v", err) + } + + for { + read, _, notification, err := client.readMsg(buf) + if err != nil { + t.Fatalf("client read %d: %v", i, err) + } + + if notification != nil { + continue + } + + if read != 4096 || int(buf[0])<<8|int(buf[1]) != i { + t.Fatalf("client read message %d out of order", i) + } + + break + } + } + + if err := <-sendErr; err != nil { + t.Fatalf("WriteMsgWait: %v", err) + } + + select { + case <-disconnected: + t.Fatal("a peer that stopped reading lost its association") + default: + } +} + +func TestWriter_WriteMsgWaitEndsWhenPeerAborts(t *testing.T) { srv, serverConn, disconnected, client := serverWithAcceptedConn(t) defer func() { @@ -462,8 +570,6 @@ func TestWriter_SetWriteTimeoutOverridesTheDefault(t *testing.T) { srv.Shutdown(sctx) }() - serverConn.SetWriteTimeout(10 * time.Second) - _ = client.controlFd(func(fd int) error { return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_RCVBUF, 2048) }) @@ -471,28 +577,44 @@ func TestWriter_SetWriteTimeoutOverridesTheDefault(t *testing.T) { return syscall.SetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_SNDBUF, 2048) }) - ctx, cancel := context.WithTimeout(context.Background(), time.Second) - defer cancel() + sendErr := make(chan error, 1) - payload := make([]byte, 1024) + go func() { + payload := make([]byte, 1024) - var err error + for { + if _, err := serverConn.WriteMsgWait(context.Background(), payload, &SndRcvInfo{PPID: PPIDWireOrder(testPPID), Stream: 0}); err != nil { + sendErr <- err + return + } + } + }() - for range writeQueueDepth * 8 { - _, err = serverConn.WriteMsgWait(ctx, payload, &SndRcvInfo{PPID: PPIDWireOrder(testPPID), Stream: 0}) - if err != nil { - break + stalled := time.Now().Add(5 * time.Second) + + for len(serverConn.writeCh) < pacedQueueShare { + if time.Now().After(stalled) { + t.Fatal("the writer never stalled on the peer") } + + time.Sleep(10 * time.Millisecond) } - if !errors.Is(err, context.DeadlineExceeded) { - t.Fatalf("WriteMsgWait error = %v, want the context's", err) + _ = client.Abort() + + select { + case err := <-sendErr: + if !errors.Is(err, net.ErrClosed) { + t.Fatalf("WriteMsgWait error = %v, want net.ErrClosed", err) + } + case <-time.After(5 * time.Second): + t.Fatal("WriteMsgWait stayed blocked after the peer aborted") } select { case <-disconnected: - t.Fatal("association failed before the per-conn write timeout") - default: + case <-time.After(5 * time.Second): + t.Fatal("a peer abort did not end the association") } } From ec0a4f594154b7ddc01aaefb8b35ea5d772dadf8 Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Mon, 16 Nov 2026 07:12:26 -0500 Subject: [PATCH 16/16] fix: conflicts Signed-off-by: Guillaume Belanger --- internal/amf/release_window_test.go | 2 +- internal/amf/sms_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/amf/release_window_test.go b/internal/amf/release_window_test.go index d69180026e..8f14ecee14 100644 --- a/internal/amf/release_window_test.go +++ b/internal/amf/release_window_test.go @@ -42,7 +42,7 @@ func releasingUE(t *testing.T, imsi string) (*amf.AMF, *amf.UeContext, *amf.UeCo }}) amfInstance.ReleaseOnRANRequest(t.Context(), ueConn, - ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, nil) + ngap.CauseRadioNetworkUserInactivity.Cause(), nil) if !amfInstance.ReleaseClaimed(ueConn) { t.Fatal("expected a UE Context Release Command in flight") diff --git a/internal/amf/sms_test.go b/internal/amf/sms_test.go index ed8271363d..25e0c6ec76 100644 --- a/internal/amf/sms_test.go +++ b/internal/amf/sms_test.go @@ -284,7 +284,7 @@ func TestAUEBeingReleasedIsPagedForSMSOnceTheReleaseCompletes(t *testing.T) { connectSMSUE(t, a, ue, sender) ueConn := ue.Conn() - a.ReleaseOnRANRequest(t.Context(), ueConn, ngap.Cause{Group: ngap.CauseGroupRadioNetwork, Value: ngap.CauseRadioNetworkUserInactivity}, nil) + a.ReleaseOnRANRequest(t.Context(), ueConn, ngap.CauseRadioNetworkUserInactivity.Cause(), nil) done := make(chan error, 1)